dispach 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +94 -36
  2. package/dist/APEv2Parser-ysjr6adv.js +5 -0
  3. package/dist/{FlacParser-bf8y3e0w.js.map → APEv2Parser-ysjr6adv.js.map} +1 -1
  4. package/dist/{AiffParser-tbx3xkmk.js → AiffParser-9hj6fpmy.js} +3 -3
  5. package/dist/{AiffParser-tbx3xkmk.js.map → AiffParser-9hj6fpmy.js.map} +1 -1
  6. package/dist/App-2f72vhjv.js +11 -0
  7. package/dist/{App-hjn867nc.js.map → App-2f72vhjv.js.map} +3 -3
  8. package/dist/{AsfParser-d784ak3y.js → AsfParser-7emspn04.js} +3 -3
  9. package/dist/{AsfParser-d784ak3y.js.map → AsfParser-7emspn04.js.map} +1 -1
  10. package/dist/{ConfigEditor-g7eb2wsm.js → ConfigEditor-vk7vxaa6.js} +3 -3
  11. package/dist/{ConfigEditor-g7eb2wsm.js.map → ConfigEditor-vk7vxaa6.js.map} +1 -1
  12. package/dist/{DsdiffParser-vxnfx80c.js → DsdiffParser-dz88pnnr.js} +3 -3
  13. package/dist/{DsdiffParser-vxnfx80c.js.map → DsdiffParser-dz88pnnr.js.map} +1 -1
  14. package/dist/{DsfParser-0xsh0zzk.js → DsfParser-qgh63tbs.js} +3 -3
  15. package/dist/{DsfParser-0xsh0zzk.js.map → DsfParser-qgh63tbs.js.map} +1 -1
  16. package/dist/FlacParser-drm5wq0p.js +5 -0
  17. package/dist/{APEv2Parser-9wqew3zv.js.map → FlacParser-drm5wq0p.js.map} +1 -1
  18. package/dist/{KeyProbe-w8c37s9q.js → KeyProbe-5anphmb7.js} +3 -3
  19. package/dist/{KeyProbe-w8c37s9q.js.map → KeyProbe-5anphmb7.js.map} +1 -1
  20. package/dist/{MP4Parser-tq7r7wd4.js → MP4Parser-yr7p3z12.js} +3 -3
  21. package/dist/{MP4Parser-tq7r7wd4.js.map → MP4Parser-yr7p3z12.js.map} +1 -1
  22. package/dist/{MatroskaParser-a79gsmzb.js → MatroskaParser-jkbsbsk3.js} +3 -3
  23. package/dist/{MatroskaParser-a79gsmzb.js.map → MatroskaParser-jkbsbsk3.js.map} +1 -1
  24. package/dist/{MpegParser-zs61b3wq.js → MpegParser-t93vwnew.js} +3 -3
  25. package/dist/{MpegParser-zs61b3wq.js.map → MpegParser-t93vwnew.js.map} +1 -1
  26. package/dist/{MusepackParser-bp8dm6nz.js → MusepackParser-6e8kbh2d.js} +3 -3
  27. package/dist/{MusepackParser-bp8dm6nz.js.map → MusepackParser-6e8kbh2d.js.map} +1 -1
  28. package/dist/OggParser-ggcypmag.js +5 -0
  29. package/dist/{OggParser-7pxr1sn9.js.map → OggParser-ggcypmag.js.map} +1 -1
  30. package/dist/Picker-j7txnm7w.js +5 -0
  31. package/dist/{Picker-b09hr4tk.js.map → Picker-j7txnm7w.js.map} +1 -1
  32. package/dist/SessionPicker-hpv2ncsb.js +5 -0
  33. package/dist/{SessionPicker-wtfxwdxg.js.map → SessionPicker-hpv2ncsb.js.map} +3 -3
  34. package/dist/SkillBrowser-qc542n71.js +5 -0
  35. package/dist/{SkillBrowser-p9ht63c7.js.map → SkillBrowser-qc542n71.js.map} +1 -1
  36. package/dist/{WavPackParser-gpf3r92t.js → WavPackParser-jw9stzqp.js} +3 -3
  37. package/dist/{WavPackParser-gpf3r92t.js.map → WavPackParser-jw9stzqp.js.map} +1 -1
  38. package/dist/{WaveParser-3kcak550.js → WaveParser-epmncs9w.js} +3 -3
  39. package/dist/{WaveParser-3kcak550.js.map → WaveParser-epmncs9w.js.map} +1 -1
  40. package/dist/WizardApp-pgzcz9zq.js +5 -0
  41. package/dist/{WizardApp-494018sk.js.map → WizardApp-pgzcz9zq.js.map} +3 -3
  42. package/dist/{channels-yhdvxxrb.js → channels-m8nambmm.js} +14 -14
  43. package/dist/{channels-yhdvxxrb.js.map → channels-m8nambmm.js.map} +1 -1
  44. package/dist/client.d.ts +285 -1
  45. package/dist/client.js +11 -11
  46. package/dist/client.js.map +5 -5
  47. package/dist/components/App.d.ts.map +1 -1
  48. package/dist/{config-g0ybmm4t.js → config-hmgrqgf2.js} +17 -17
  49. package/dist/{config-g0ybmm4t.js.map → config-hmgrqgf2.js.map} +1 -1
  50. package/dist/{credential-pkme1sfe.js → credential-nkb2ya59.js} +5 -5
  51. package/dist/{credential-pkme1sfe.js.map → credential-nkb2ya59.js.map} +1 -1
  52. package/dist/{index-q8b1fc3k.js → index-0444sh6x.js} +4 -4
  53. package/dist/{index-q8b1fc3k.js.map → index-0444sh6x.js.map} +1 -1
  54. package/dist/{index-ec101x93.js → index-095hrkyr.js} +6 -6
  55. package/dist/{index-ec101x93.js.map → index-095hrkyr.js.map} +1 -1
  56. package/dist/index-1mbdz3f7.js +12 -0
  57. package/dist/{index-3fgq1acj.js.map → index-1mbdz3f7.js.map} +3 -3
  58. package/dist/index-1x8mzvz7.js +6 -0
  59. package/dist/{index-f056wkb4.js.map → index-1x8mzvz7.js.map} +1 -1
  60. package/dist/{index-633eqxry.js → index-22fzzn7z.js} +7 -7
  61. package/dist/{index-633eqxry.js.map → index-22fzzn7z.js.map} +1 -1
  62. package/dist/index-2bsardvh.js +5 -0
  63. package/dist/{index-9dmgk6d3.js.map → index-2bsardvh.js.map} +2 -2
  64. package/dist/{index-thmq816c.js → index-2zjh5zd5.js} +4 -4
  65. package/dist/{index-thmq816c.js.map → index-2zjh5zd5.js.map} +1 -1
  66. package/dist/{index-ad5c9t83.js → index-308y9xt0.js} +4 -4
  67. package/dist/{index-ad5c9t83.js.map → index-308y9xt0.js.map} +1 -1
  68. package/dist/{index-t6xnecdx.js → index-323jvr1g.js} +4 -4
  69. package/dist/{index-t6xnecdx.js.map → index-323jvr1g.js.map} +1 -1
  70. package/dist/{index-mn34kj95.js → index-3826kf9t.js} +5 -5
  71. package/dist/{index-mn34kj95.js.map → index-3826kf9t.js.map} +1 -1
  72. package/dist/index-38gs9anh.js +9 -0
  73. package/dist/{index-akv6e7ge.js.map → index-38gs9anh.js.map} +1 -1
  74. package/dist/index-3c5jt6by.js +5 -0
  75. package/dist/{index-3b3h8kyh.js.map → index-3c5jt6by.js.map} +2 -2
  76. package/dist/{index-a6mtqkth.js → index-3vzf253k.js} +7 -7
  77. package/dist/{index-a6mtqkth.js.map → index-3vzf253k.js.map} +1 -1
  78. package/dist/{index-5m9wydxb.js → index-42e29zs4.js} +4 -4
  79. package/dist/{index-5m9wydxb.js.map → index-42e29zs4.js.map} +1 -1
  80. package/dist/{index-v7mz396x.js → index-4fj1k64j.js} +4 -4
  81. package/dist/{index-v7mz396x.js.map → index-4fj1k64j.js.map} +1 -1
  82. package/dist/{index-s2tzq27a.js → index-51x0n5z0.js} +5 -5
  83. package/dist/{index-s2tzq27a.js.map → index-51x0n5z0.js.map} +1 -1
  84. package/dist/index-836hc2h1.js +6 -0
  85. package/dist/{index-xa9crtzq.js.map → index-836hc2h1.js.map} +2 -2
  86. package/dist/index-8edck2pr.js +6 -0
  87. package/dist/{index-7gsbzvnc.js.map → index-8edck2pr.js.map} +1 -1
  88. package/dist/index-8tmv33mr.js +6 -0
  89. package/dist/{index-vw2hf4d8.js.map → index-8tmv33mr.js.map} +1 -1
  90. package/dist/index-9t4dz145.js +8 -0
  91. package/dist/{index-0mz7wpbw.js.map → index-9t4dz145.js.map} +2 -2
  92. package/dist/{index-81vj1bxe.js → index-bqdkm3de.js} +4 -4
  93. package/dist/{index-81vj1bxe.js.map → index-bqdkm3de.js.map} +1 -1
  94. package/dist/index-djeqvfms.js +74 -0
  95. package/dist/index-djeqvfms.js.map +13 -0
  96. package/dist/{index-307qmvb0.js → index-dpcm1j62.js} +28 -28
  97. package/dist/{index-307qmvb0.js.map → index-dpcm1j62.js.map} +1 -1
  98. package/dist/index-dv9pdjy4.js +429 -0
  99. package/dist/index-dv9pdjy4.js.map +12 -0
  100. package/dist/{index-j20k6k0m.js → index-dzy19wtf.js} +4 -4
  101. package/dist/{index-j20k6k0m.js.map → index-dzy19wtf.js.map} +1 -1
  102. package/dist/{index-9qv87rq7.js → index-eztfverw.js} +7 -7
  103. package/dist/{index-9qv87rq7.js.map → index-eztfverw.js.map} +1 -1
  104. package/dist/{index-myg5enf5.js → index-fbsrhcga.js} +4 -4
  105. package/dist/{index-myg5enf5.js.map → index-fbsrhcga.js.map} +1 -1
  106. package/dist/{index-6r9h7ftn.js → index-fxpmx6cr.js} +117 -117
  107. package/dist/index-fxpmx6cr.js.map +21 -0
  108. package/dist/{index-ye2yb3xf.js → index-hgm2gchq.js} +6 -6
  109. package/dist/{index-ye2yb3xf.js.map → index-hgm2gchq.js.map} +1 -1
  110. package/dist/index-hpvfqq6r.js +1252 -0
  111. package/dist/{index-26ejkp8q.js.map → index-hpvfqq6r.js.map} +30 -26
  112. package/dist/{index-y34s71qe.js → index-hrwakb11.js} +3 -3
  113. package/dist/{index-y34s71qe.js.map → index-hrwakb11.js.map} +1 -1
  114. package/dist/{index-qh82wtpa.js → index-jc4kmfwa.js} +4 -4
  115. package/dist/{index-qh82wtpa.js.map → index-jc4kmfwa.js.map} +1 -1
  116. package/dist/{index-twcgf73h.js → index-jff5q27j.js} +4 -4
  117. package/dist/{index-twcgf73h.js.map → index-jff5q27j.js.map} +1 -1
  118. package/dist/index-k8e9f466.js +110 -0
  119. package/dist/index-k8e9f466.js.map +13 -0
  120. package/dist/{index-trx9xb59.js → index-m6fqx0ch.js} +7 -7
  121. package/dist/{index-trx9xb59.js.map → index-m6fqx0ch.js.map} +1 -1
  122. package/dist/{index-ac2wzspd.js → index-mjfv7k5w.js} +4 -4
  123. package/dist/{index-ac2wzspd.js.map → index-mjfv7k5w.js.map} +1 -1
  124. package/dist/index-nvc24414.js +6 -0
  125. package/dist/{index-1f1erzfx.js.map → index-nvc24414.js.map} +1 -1
  126. package/dist/index-nxhqf597.js +6 -0
  127. package/dist/{index-w97gprre.js.map → index-nxhqf597.js.map} +1 -1
  128. package/dist/{index-jh2az41t.js → index-p6ya59m6.js} +5 -5
  129. package/dist/{index-jh2az41t.js.map → index-p6ya59m6.js.map} +1 -1
  130. package/dist/{index-psk6q25h.js → index-pqw1n1pv.js} +4 -4
  131. package/dist/{index-psk6q25h.js.map → index-pqw1n1pv.js.map} +1 -1
  132. package/dist/{index-6c4p19m1.js → index-pszmnhgq.js} +2 -2
  133. package/dist/index-qgsdgbk8.js +5 -0
  134. package/dist/{index-wk6andxq.js.map → index-qgsdgbk8.js.map} +2 -2
  135. package/dist/index-qv6ktepc.js +6 -0
  136. package/dist/index-qv6ktepc.js.map +10 -0
  137. package/dist/{index-pdsey1ab.js → index-ry6a4bqh.js} +62 -62
  138. package/dist/{index-pdsey1ab.js.map → index-ry6a4bqh.js.map} +1 -1
  139. package/dist/{index-x9z2xnct.js → index-sh44ymqz.js} +5 -5
  140. package/dist/{index-x9z2xnct.js.map → index-sh44ymqz.js.map} +1 -1
  141. package/dist/{index-zg89tq04.js → index-snz49ndn.js} +4 -4
  142. package/dist/{index-zg89tq04.js.map → index-snz49ndn.js.map} +1 -1
  143. package/dist/{index-zjphh8ch.js → index-xg7s813b.js} +4 -4
  144. package/dist/{index-zjphh8ch.js.map → index-xg7s813b.js.map} +1 -1
  145. package/dist/{index-gqaa06yh.js → index-y7dxq4a4.js} +9 -9
  146. package/dist/{index-gqaa06yh.js.map → index-y7dxq4a4.js.map} +1 -1
  147. package/dist/index-ytxbw8py.js +63 -0
  148. package/dist/{index-0pddq849.js.map → index-ytxbw8py.js.map} +2 -2
  149. package/dist/index-yw3fby4n.js +6 -0
  150. package/dist/{index-4emtktc0.js.map → index-yw3fby4n.js.map} +2 -2
  151. package/dist/{index-skkddg44.js → index-zw6wyas6.js} +4 -4
  152. package/dist/{index-skkddg44.js.map → index-zw6wyas6.js.map} +1 -1
  153. package/dist/index.js +304 -288
  154. package/dist/index.js.map +15 -12
  155. package/dist/init.d.ts.map +1 -1
  156. package/dist/lib/agent-template.d.ts +5 -0
  157. package/dist/lib/agent-template.d.ts.map +1 -1
  158. package/dist/lib/commands.d.ts.map +1 -1
  159. package/dist/lib/init-flow.d.ts +7 -30
  160. package/dist/lib/init-flow.d.ts.map +1 -1
  161. package/dist/lib/owner.d.ts +49 -0
  162. package/dist/lib/owner.d.ts.map +1 -0
  163. package/dist/lib/presets.d.ts +44 -0
  164. package/dist/lib/presets.d.ts.map +1 -0
  165. package/dist/lib/provision.d.ts +8 -1
  166. package/dist/lib/provision.d.ts.map +1 -1
  167. package/dist/lib/relay-client.d.ts +17 -0
  168. package/dist/lib/relay-client.d.ts.map +1 -0
  169. package/dist/lib/schema.d.ts +2 -0
  170. package/dist/lib/schema.d.ts.map +1 -1
  171. package/dist/lib/sessions-view.d.ts +2 -0
  172. package/dist/lib/sessions-view.d.ts.map +1 -1
  173. package/dist/lib/source.d.ts +25 -0
  174. package/dist/lib/source.d.ts.map +1 -1
  175. package/dist/lib/types.d.ts +8 -2
  176. package/dist/lib/types.d.ts.map +1 -1
  177. package/dist/lib/wizard.d.ts.map +1 -1
  178. package/dist/owner.d.ts +16 -0
  179. package/dist/owner.d.ts.map +1 -0
  180. package/dist/run.d.ts.map +1 -1
  181. package/dist/serve.d.ts.map +1 -1
  182. package/dist/transcript.d.ts.map +1 -1
  183. package/dist/{web-f6869dy2.js → web-gfv0mzgs.js} +7 -7
  184. package/dist/{web-f6869dy2.js.map → web-gfv0mzgs.js.map} +1 -1
  185. package/dist/wire.d.ts +50 -0
  186. package/dist/wire.js +5 -5
  187. package/dist/wire.js.map +4 -4
  188. package/dist/wrapper-f662ny3r.js +5 -0
  189. package/dist/{wrapper-52c0vacs.js.map → wrapper-f662ny3r.js.map} +1 -1
  190. package/package.json +4 -1
  191. package/dist/APEv2Parser-9wqew3zv.js +0 -5
  192. package/dist/App-hjn867nc.js +0 -11
  193. package/dist/FlacParser-bf8y3e0w.js +0 -5
  194. package/dist/OggParser-7pxr1sn9.js +0 -5
  195. package/dist/Picker-b09hr4tk.js +0 -5
  196. package/dist/SessionPicker-wtfxwdxg.js +0 -5
  197. package/dist/SkillBrowser-p9ht63c7.js +0 -5
  198. package/dist/WizardApp-494018sk.js +0 -5
  199. package/dist/index-0mz7wpbw.js +0 -8
  200. package/dist/index-0pddq849.js +0 -63
  201. package/dist/index-1f1erzfx.js +0 -6
  202. package/dist/index-26ejkp8q.js +0 -1194
  203. package/dist/index-3b3h8kyh.js +0 -5
  204. package/dist/index-3fgq1acj.js +0 -12
  205. package/dist/index-4emtktc0.js +0 -6
  206. package/dist/index-4t3p7vm9.js +0 -6
  207. package/dist/index-4t3p7vm9.js.map +0 -10
  208. package/dist/index-6r9h7ftn.js.map +0 -21
  209. package/dist/index-7gsbzvnc.js +0 -6
  210. package/dist/index-94k4mh6s.js +0 -96
  211. package/dist/index-94k4mh6s.js.map +0 -13
  212. package/dist/index-9dmgk6d3.js +0 -5
  213. package/dist/index-akv6e7ge.js +0 -9
  214. package/dist/index-f056wkb4.js +0 -6
  215. package/dist/index-s57ztjhq.js +0 -74
  216. package/dist/index-s57ztjhq.js.map +0 -13
  217. package/dist/index-vw2hf4d8.js +0 -6
  218. package/dist/index-w97gprre.js +0 -6
  219. package/dist/index-wk6andxq.js +0 -5
  220. package/dist/index-xa9crtzq.js +0 -6
  221. package/dist/index-z0dgxd7d.js +0 -429
  222. package/dist/index-z0dgxd7d.js.map +0 -11
  223. package/dist/wrapper-52c0vacs.js +0 -5
  224. /package/dist/{index-6c4p19m1.js.map → index-pszmnhgq.js.map} +0 -0
package/README.md CHANGED
@@ -3,12 +3,14 @@
3
3
  [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
4
4
  [![CI](https://github.com/moeen-mahmud/dispach/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/moeen-mahmud/dispach/actions/workflows/ci.yml)
5
5
  [![npm](https://img.shields.io/npm/v/dispach)](https://www.npmjs.com/package/dispach)
6
+ [![XERJ Corpus Hub contributor](https://hub.xerj.org/contributors/moeen-mahmud/badge.svg)](https://hub.xerj.org/contributors/moeen-mahmud)
6
7
 
7
8
  **The agent backend your product calls over HTTP.** Open source and self-hosted: one API for agents
8
9
  with memory, tools, schedules, channels and approvals, on any OpenAI-compatible model.
9
10
 
10
11
  ```bash
11
12
  npm i -g dispach # Node 24+, or: brew install moeen-mahmud/tap/dispach
13
+ # no Node? curl -fsSL https://github.com/moeen-mahmud/dispach/releases/latest/download/install.sh | sh
12
14
  dispach init # name the agent, pick a model, paste a key
13
15
  dispach run milo # talk to it in the terminal
14
16
  ```
@@ -22,9 +24,14 @@ Or run it as a server: one `docker run`, and [Call it over HTTP](#call-it-over-h
22
24
  agent and streams its reply in three requests.
23
25
 
24
26
  ```bash
25
- docker run -d -p 7420:7420 -e DISPACH_API_TOKEN=pick-a-secret ghcr.io/moeen-mahmud/dispach:0.2.0
27
+ docker run -d --init -p 7420:7420 -v dispach-home:/home/dispach \
28
+ -e DISPACH_API_TOKEN=pick-a-secret ghcr.io/moeen-mahmud/dispach:0.2.2
26
29
  ```
27
30
 
31
+ The named volume is where the store, every agent and every key live; without it a `docker rm` for
32
+ an upgrade starts empty. `--init` is there because `exec` backgrounds children and a child whose
33
+ parent is PID 1 has nothing to reap it.
34
+
28
35
  **Research:** [*What May an Agent Change About Itself? A Containment Floor for Self-Configuring Agent
29
36
  Runtimes*](https://arxiv.org/abs/2610.06274) (Hossain and Mahmud, 2026, preprint) measures the floor in
30
37
  Dispach's settings tool: with it in place, 0 of 167 protected writes were saved, though the models
@@ -39,10 +46,11 @@ shipped on Node, Apache-2.0.
39
46
  **Where it is going: the multiplayer agent runtime.** 0.2.0 gives every user and every team in your
40
47
  product their own isolated runtime of agents. Those agents share rooms and memory with the people
41
48
  they work for, and stand in for them, openly, when they are away. That half ships in 0.2.0 as
42
- **experimental**: on the HTTP API, with no TUI or web screens yet, and it may change within 0.2.x.
49
+ **experimental**: on the HTTP API and the browser console (no TUI screens yet), and it may change within 0.2.x.
43
50
  Everything else described in this README is stable.
44
51
 
45
52
  **Docs:** [dispach.blivius.com/docs](https://dispach.blivius.com/docs) ·
53
+ **New in 0.2.2:** [the changelog, with upgrade notes](CHANGELOG.md) ·
46
54
  **New in 0.2.0:** [what changed and how to upgrade](developer-docs/runtime/whats-new-0-2-0.md) ·
47
55
  **Limits:** [what is measured, and what it does not do](developer-docs/runtime/limits-and-evidence.md)
48
56
 
@@ -60,8 +68,8 @@ or the [larger pieces that need an owner](https://github.com/moeen-mahmud/dispac
60
68
 
61
69
  ```bash
62
70
  export TOKEN=pick-a-secret
63
- docker run -d -p 7420:7420 -v dispach-home:/home/dispach -e DISPACH_API_TOKEN=$TOKEN \
64
- ghcr.io/moeen-mahmud/dispach:0.2.0
71
+ docker run -d --init -p 7420:7420 -v dispach-home:/home/dispach -e DISPACH_API_TOKEN=$TOKEN \
72
+ ghcr.io/moeen-mahmud/dispach:0.2.2
65
73
 
66
74
  curl -s -H "Authorization: Bearer $TOKEN" localhost:7420/v1/agents \
67
75
  -d '{"answers":{"user":"you","name":"milo","apiKey":"sk-…"}}'
@@ -114,8 +122,8 @@ gap of a few runs is noise. Hermes leads on Gemini 4 Argon and the two small ope
114
122
 
115
123
  ## Status
116
124
 
117
- **0.2.0**, from npm, Homebrew or the container image. Every install runs
118
- under Node. [`CHANGELOG.md`](CHANGELOG.md) has what landed in each release.
125
+ **0.2.2**, from npm, Homebrew, the container image or the standalone installer. Every install
126
+ runs under Node. [`CHANGELOG.md`](CHANGELOG.md) has what landed in each release.
119
127
 
120
128
  Built and in use:
121
129
 
@@ -128,15 +136,18 @@ Built and in use:
128
136
  models, vision input, and replayed signed thinking.
129
137
  - **Channels and tools:** Telegram and WhatsApp (the latter a bundled plugin, with a warning;
130
138
  [see below](#whatsapp)), the plugin API with all four middleware wrap points, system and web
131
- tool providers under a policy engine, remote MCP servers, and subagents.
139
+ tool providers under a policy engine, remote MCP servers, and subagents, routed by the harness or
140
+ started by the model with `delegate` to fan research out in parallel.
132
141
  - **Coordination and delivery:** supervisor delegation with typed handoffs, and an idempotent
133
142
  outbox.
134
143
  - **Front ends and hosting:** a browser UI on the same origin as the API, the TUI, launchd
135
144
  services, the Docker image with a compose front door, Kubernetes, and `GET /v1/backup` for the
136
145
  whole sandbox.
137
146
 
138
- **Experimental in 0.2.0**, on the HTTP API only: rooms, stand-ins and team memory; the Slack,
139
- Microsoft Teams and A2A channels; and media (transcription, image generation, spoken replies).
147
+ **Experimental in 0.2.0**: rooms, stand-ins and team memory; the Slack, Microsoft Teams and A2A
148
+ channels; and media (transcription, image generation, spoken replies). The first three and the
149
+ channels have screens in the browser console since 0.2.2 (People, Rooms, Actions, Memory,
150
+ add a channel); media is still API-only.
140
151
 
141
152
  **MCP is a tool provider, never the substrate** (decision 4.7): remote servers over Streamable HTTP,
142
153
  their tools pinned by name like any other provider's. Composio is still called directly.
@@ -171,7 +182,8 @@ The ones that would otherwise look like mistakes:
171
182
  - **Tools are pinned at load, not searched at runtime.** Search-then-execute is two-hop
172
183
  reasoning, which is where small models fail.
173
184
  - **Compaction is progressive and harness-driven** — five stages from 60% context pressure,
174
- not one lossy summarise at 95%.
185
+ not one lossy summarise at 95%. A long conversation is checkpointed, so it stops paying for its
186
+ compaction on every turn, and can be compacted on demand.
175
187
  - **Memory is SQLite FTS5, not embeddings.** No model weights, no embedding service, no
176
188
  network in the memory path.
177
189
  - **Zero network I/O before readiness.** Channels connect after `runtime.ready` and report
@@ -189,7 +201,7 @@ Full rationale for every decision, including the negative ones, is in `docs/00-D
189
201
 
190
202
  ```bash
191
203
  npm i -g dispach # the `dispach` command
192
- dispach --version # 0.2.0
204
+ dispach --version # 0.2.2
193
205
  ```
194
206
 
195
207
  and in an application that talks to a running server:
@@ -203,11 +215,39 @@ import { createClient } from "dispach/client"
203
215
  import type { AnyEvent } from "dispach/wire"
204
216
  ```
205
217
 
206
- There is no `@dispach/*` scope, deliberately: the runtime is nine workspace packages and one name,
218
+ There is no `@dispach/*` scope, deliberately: the runtime is sixteen workspace packages (and a separately licensed control plane) under one name,
207
219
  so there is one thing to install, one thing to version and one thing to trust. `dispach/client`
208
220
  pulls in no terminal UI — asserted by the package's own tests, because an HTTP client has no
209
221
  business paying the ~170-210 ms that importing Ink and React costs.
210
222
 
223
+ ### Or without Node
224
+
225
+ ```bash
226
+ curl -fsSL https://github.com/moeen-mahmud/dispach/releases/latest/download/install.sh | sh
227
+ ```
228
+
229
+ macOS and Linux (glibc), arm64 and x64. Each release attaches one archive per platform: an official
230
+ Node 24, checked against nodejs.org's checksums, beside the same npm tarball the other installs use.
231
+ It is not a single compiled file on purpose — Bun can compile one, and Bun cannot complete the
232
+ WhatsApp handshake (see below), so what ships is Node. The script checks the archive against the
233
+ release's `SHA256SUMS`, unpacks it into `~/.dispach/versions/<version>`, links
234
+ `~/.dispach/bin/dispach`, and adds that directory to `PATH` in your shell's rc file, saying which.
235
+ Nothing needs root. Run it again to upgrade.
236
+
237
+ | Variable | Effect |
238
+ | --- | --- |
239
+ | `DISPACH_VERSION=0.2.2` | that release instead of the latest |
240
+ | `DISPACH_NO_MODIFY_PATH=1` | change no rc file; it prints the line to add |
241
+ | `DISPACH_INSTALL_DIR=<dir>` | install somewhere other than `~/.dispach` |
242
+
243
+ An upgrade does not move a background server installed with `dispach daemon install`, because the
244
+ service names the version directory it was started from; the script says so and keeps that
245
+ version, and `dispach daemon install` moves it. To uninstall, delete `~/.dispach/bin` and
246
+ `~/.dispach/versions` and the `PATH` line; your agents beside them in `~/.dispach` are left alone.
247
+
248
+ **Windows:** run it inside WSL (`wsl --install`), or use the container. A native build needs the
249
+ shell tool and the service manager ported; that is [open for contributions (#76)](https://github.com/moeen-mahmud/dispach/issues/76).
250
+
211
251
  ### Or with Homebrew
212
252
 
213
253
  ```bash
@@ -228,7 +268,7 @@ until `brew trust moeen-mahmud/tap` is run, because a bare name carries no such
228
268
  ### Or the container
229
269
 
230
270
  ```bash
231
- docker pull ghcr.io/moeen-mahmud/dispach:0.2.0
271
+ docker pull ghcr.io/moeen-mahmud/dispach:0.2.2
232
272
  ```
233
273
 
234
274
  The [Docker](#docker) and [Compose](#hosting-with-compose) sections below have the run lines and
@@ -247,7 +287,7 @@ bun run build # builds every package the binary imports
247
287
  cd packages/cli && bun link # puts `dispach` on your PATH
248
288
  cd ../..
249
289
 
250
- dispach --version # 0.2.0
290
+ dispach --version # 0.2.2
251
291
  dispach --help
252
292
  ```
253
293
 
@@ -258,8 +298,8 @@ Four things that are not obvious:
258
298
  command picks it up; you never re-link. If `dispach: command not found`, `~/.bun/bin` is not on
259
299
  your `PATH` — Bun's installer adds it, and a shell opened before you installed Bun will not have it.
260
300
  - **`bun run build` builds every workspace package, and you need all of them.** The CLI imports
261
- `tools-system`, `tools-web`, `tools-composio` and `channel-telegram` from their `dist`, so building
262
- only `core` and `cli` leaves the binary running yesterday's provider code — and the symptom is the
301
+ every provider package — tools, channels, the Bedrock transport, media — from their `dist`
302
+ (`packages/cli/src/lib/providers.ts` is the list), so building only `core` and `cli` leaves the binary running yesterday's provider code — and the symptom is the
263
303
  worst kind: your change is correct, a test fails, and the stack trace points into a stale `dist`.
264
304
  - **Node 24+ must be on your `PATH`.** The built entry's shebang is `#!/usr/bin/env node`; Bun builds
265
305
  it and Node runs it — the same runtime every install ships.
@@ -293,12 +333,23 @@ passed on the command line lands in shell history — so a scripted run
293
333
  it in.
294
334
 
295
335
  **`--preset` carries the endpoints worth not typing from memory** — OpenAI, Anthropic, DeepSeek,
296
- OpenRouter, Groq, NVIDIA NIM, and Ollama both local and hosted — and `custom` is a first-class
297
- answer for anything else. Any OpenAI-compatible `/chat/completions` endpoint works, because there is
298
- no provider branch in the transport: one POST, one body builder. What a preset actually buys is
299
- getting the base URL's *shape* right, which is the part that is easy to get wrong. It must end at
300
- the version segment; the runtime appends `/chat/completions` itself, so a URL copied from a
301
- provider's docs with the full path is refused.
336
+ OpenRouter, Groq, NVIDIA NIM, Ollama both local and hosted, and AWS Bedrock — and `custom` is a
337
+ first-class answer for anything else. Any OpenAI-compatible `/chat/completions` endpoint works,
338
+ because there is no provider branch in the transport: one POST, one body builder. What a preset
339
+ actually buys is getting the base URL's *shape* right, which is the part that is easy to get wrong.
340
+ It must end at the version segment; the runtime appends `/chat/completions` itself, so a URL copied
341
+ from a provider's docs with the full path is refused. Bedrock is the one preset that is not three
342
+ strings: `--preset bedrock --region eu-west-1` writes `api: bedrock-converse` and `options.region`,
343
+ no URL and no key variable, because credentials come from the AWS default chain (environment, a
344
+ named profile, the container or instance role). The web console's Models page offers the same list.
345
+
346
+ **You talk to an agent in one conversation, wherever you reach it.** `init` makes you the owner of
347
+ the agents it creates and writes `sessions.scope: owner`, so what you said on Telegram this morning
348
+ is in the web console's chat and the terminal's this afternoon, and each reply goes back to wherever
349
+ you asked. "New conversation" starts afresh on all of them at once. Strangers on a channel keep their
350
+ own conversations, and anything one of your agents saves about you is recalled by your others.
351
+ `dispach owner adopt <agent>` does the same for an agent made before 0.2.2
352
+ (`docs/23-SPEC-SESSIONS.md`).
302
353
 
303
354
  Local Ollama and Ollama Cloud are **two presets on purpose.** Local needs no key, and the absent
304
355
  `apiKeyEnv` is what makes the manifest omit the field and the provider send no `authorization`
@@ -443,7 +494,7 @@ token.
443
494
 
444
495
  ```bash
445
496
  cp .env.example .env # then DISPACH_API_TOKEN
446
- docker compose up -d --build --wait
497
+ docker compose up -d --wait # pulls ghcr.io/moeen-mahmud/dispach, DISPACH_VERSION pins a tag
447
498
  curl localhost:7420/v1/ready # {"status":"ready","agents":0}
448
499
  docker compose logs server # the claim link — open it once to get a browser key
449
500
  ```
@@ -472,13 +523,18 @@ fail because one of N agents is misconfigured.
472
523
 
473
524
  Then open `http://localhost:7420` and paste nothing: the claim link in the logs carries a one-time
474
525
  token the page exchanges for a key it keeps. From there the page creates agents, holds a streaming
475
- conversation with one, and — since 0.1.1 — changes its settings and schedules; the tool, channel and
476
- key panels remain reports. Reading the container's own output is what confers
526
+ conversation with one, and changes its models, tools, schedules, channels, files and settings; it
527
+ also shows usage and every turn, and manages people, rooms, the actions queue, shared memory,
528
+ webhooks, backups and scoped keys. Reading the container's own output is what confers
477
529
  first ownership, which grants nothing new to anyone who could already run `docker compose logs`.
478
530
 
479
- **`--build` is not optional after the first run.** `image: dispach:local` names a tag, and compose
480
- builds only when that tag is *absent* — so a second `up` reuses whatever was built before, reports
481
- healthy, and serves it. Measured while writing this: a two-day-old image came up green and answered
531
+ **A plain `up` pulls the published image once and never again.** `image:` names
532
+ `ghcr.io/moeen-mahmud/dispach:${DISPACH_VERSION:-latest}` with `pull_policy: missing`, so a machine
533
+ that pulled `latest` last month keeps serving it until `docker compose pull`; pin `DISPACH_VERSION`
534
+ in `.env` to make an upgrade a visible edit. Working from a checkout, `up -d --build --wait` builds
535
+ this tree under the same tag — and then **`--build` is not optional after the first run**, because
536
+ compose builds only when the tag is *absent*, so a second `up` reuses whatever was built before,
537
+ reports healthy, and serves it. Measured while writing this: a two-day-old image came up green and answered
482
538
  every request from a binary that predated two whole phases. The recorded stale-`dist` hazard with a
483
539
  container around it, and the same tell — everything works, nothing is current.
484
540
 
@@ -537,7 +593,7 @@ the shape.
537
593
  The container is the honest place to exercise an agent that has a shell, and not only for
538
594
  containment. Every `exec` test in this repo otherwise runs on macOS, where the shell is a real
539
595
  bash and `realpath` resolves `/var` through a symlink — the exact conditions the recorded
540
- `$PWD`-comparison bug lived in. In the image it is busybox `sh` on Linux, with a different PATH
596
+ `$PWD`-comparison bug lived in. In the image it is Debian's `dash` as `/bin/sh` on Linux, with a different PATH
541
597
  and different `realpath` semantics. Those have never been exercised until now.
542
598
 
543
599
  ```bash
@@ -566,7 +622,7 @@ fenced as untrusted. What the agent's shell can reach is `sh`, `bash`, `git`, `p
566
622
  and `curl` — `git` because the skills catalogue is fetched with it and its absence *deletes* that
567
623
  feature rather than degrading it, `python3` and `uv` because a skill shipping scripts needs them.
568
624
 
569
- What is **absent on purpose**, and asserted as such: no Bun — the application is the published npm
625
+ What is **absent on purpose** (CI asserts Bun and the editors are missing): no Bun — the application is the published npm
570
626
  package running under Node, exactly what a laptop runs; no `wget`, so there is one obvious HTTP client rather than two; and no pager
571
627
  and no editor, because `exec` hands a child a file descriptor and never a TTY — anything that pages
572
628
  or prompts blocks until its deadline and reads as a hung agent. The CI `docker` job asserts both
@@ -594,13 +650,14 @@ consequence: run it on a laptop and the policy is the only boundary there is.
594
650
  ## Docker
595
651
 
596
652
  ```bash
597
- docker pull ghcr.io/moeen-mahmud/dispach:0.2.0 # or build it: docker build -f docker/Dockerfile -t dispach .
598
- docker run --rm -p 7420:7420 \
653
+ docker pull ghcr.io/moeen-mahmud/dispach:0.2.2 # or build it: docker build -f docker/Dockerfile -t dispach .
654
+ cp examples/minimal/.env.example examples/minimal/.env # then MODEL_API_KEY; only the example is tracked
655
+ docker run --rm --init -p 7420:7420 \
599
656
  --env-file examples/minimal/.env \
600
657
  -e DISPACH_API_TOKEN=pick-something \
601
658
  -v "$PWD/examples/minimal:/agent" \
602
659
  -v dispach-home:/home/dispach \
603
- ghcr.io/moeen-mahmud/dispach:0.2.0
660
+ ghcr.io/moeen-mahmud/dispach:0.2.2
604
661
  ```
605
662
 
606
663
  The token is not optional and is not boilerplate. The image binds `0.0.0.0`, because a process
@@ -684,8 +741,8 @@ Public pull requests are welcome; [`CONTRIBUTING.md`](CONTRIBUTING.md) is the co
684
741
 
685
742
  ## Boot budget
686
743
 
687
- Process start → `runtime.ready` in under **1000 ms**, enforced in CI at 1200 ms. Every number in this
688
- README has a row in [`evals/CLAIMS.md`](evals/CLAIMS.md) naming the file it comes from.
744
+ Process start → `runtime.ready` in under **1000 ms**, enforced in CI at 1200 ms. Every performance
745
+ number in this README has a row in [`evals/CLAIMS.md`](evals/CLAIMS.md) naming the file it comes from.
689
746
 
690
747
  Measured at **~65 ms** at 0.2.0 — 45 ms of interpreter and imports, 21 ms inside `Runtime.create` —
691
748
  and checked on every phase rather than at the end (it was ~53 ms at 0.1.3; the 0.2.0 packages
@@ -697,7 +754,7 @@ bun run bench:boot
697
754
 
698
755
  Reported with the machine state it was taken on, because without that a boot number is a number
699
756
  about somebody's afternoon: the figure above is a 7-run median on an Apple M4 Pro at a load
700
- average of ~3.4, and an earlier run of the same tree at a load average of ~5 measured 91 ms. The budget has
757
+ average of ~3.3, and an earlier run of the same tree at a load average of ~5 measured 91 ms. The budget has
701
758
  three orders of magnitude of headroom, so the reason to say this is not the arithmetic — it is that
702
759
  a regression is only visible against a figure you can reproduce.
703
760
 
@@ -800,6 +857,7 @@ hand-written, and was missing five commands at once. `dispach <command> --help`
800
857
  | `sessions` | list stored sessions, or inspect one |
801
858
  | `memory` | search what the agent remembers, or rebuild the index from the files |
802
859
  | `config` | read and change an agent's settings, and fill in its secrets |
860
+ | `owner` | show who owns this machine's agents, or make an existing agent yours |
803
861
  | `validate` | load and validate a manifest, then exit |
804
862
  | `workspace` | check the workspace files against the authoring rules |
805
863
  | `soul` | scaffold a hand-edited compact identity from a long-form document |
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import{hA,Lt}from"./index-22fzzn7z.js";export{Lt as APEv2Parser,hA as tryParseApeHeader};
3
+
4
+ //# debugId=9FE7887B3249D88664756E2164756E21
5
+ //# sourceMappingURL=APEv2Parser-ysjr6adv.js.map
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "12BF04B5321E01E264756E2164756E21",
7
+ "debugId": "9FE7887B3249D88664756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{B,Ne,N,E,m,g,v,l,M,P,O}from"./index-633eqxry.js";import{Qe}from"./index-y34s71qe.js";import{I}from"./index-t6xnecdx.js";var u=I(N(),1);var k={NONE:"not compressed\tPCM\tApple Computer",sowt:"PCM (byte swapped)",fl32:"32-bit floating point IEEE 32-bit float",fl64:"64-bit floating point IEEE 64-bit float\tApple Computer",alaw:"ALaw 2:1\t8-bit ITU-T G.711 A-law",ulaw:"µLaw 2:1\t8-bit ITU-T G.711 µ-law\tApple Computer",ULAW:"CCITT G.711 u-law 8-bit ITU-T G.711 µ-law",ALAW:"CCITT G.711 A-law 8-bit ITU-T G.711 A-law",FL32:"Float 32\tIEEE 32-bit float "};class n extends M("AIFF"){}class c{constructor(t,e){this.isAifc=e;let a=e?22:18;if(t.chunkSize<a)throw new n(`COMMON CHUNK size should always be at least ${a}`);this.len=t.chunkSize}get(t,e){let a=m.get(t,e+8)-16398,s=m.get(t,e+8+2),i={numChannels:m.get(t,e),numSampleFrames:g.get(t,e+2),sampleSize:m.get(t,e+6),sampleRate:a<0?s>>Math.abs(a):s<<a};if(this.isAifc){if(i.compressionType=O.get(t,e+18),this.len>22){let o=E.get(t,e+22);if(o>0){let d=(o+1)%2;if(23+o+d===this.len)i.compressionName=new l(o,"latin1").get(t,e+23);else throw new n("Illegal pstring length")}else i.compressionName=void 0}}else i.compressionName="PCM";return i}}var r={len:8,get:(t,e)=>({chunkID:O.get(t,e),chunkSize:Number(BigInt(g.get(t,e+4)))})};var p=u.default("music-metadata:parser:aiff");class w extends P{constructor(){super(...arguments);this.isCompressed=null}async parse(){if((await this.tokenizer.readToken(r)).chunkID!=="FORM")throw new n("Invalid Chunk-ID, expected 'FORM'");let e=await this.tokenizer.readToken(O);switch(e){case"AIFF":this.metadata.setFormat("container",e),this.isCompressed=!1;break;case"AIFC":this.metadata.setFormat("container","AIFF-C"),this.isCompressed=!0;break;default:throw new n(`Unsupported AIFF type: ${e}`)}this.metadata.setFormat("lossless",!this.isCompressed),this.metadata.setAudioOnly();try{while(!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=r.len){p(`Reading AIFF chunk at offset=${this.tokenizer.position}`);let a=await this.tokenizer.readToken(r),s=2*Math.round(a.chunkSize/2),i=await this.readData(a);await this.tokenizer.ignore(s-i)}}catch(a){if(a instanceof B)p("End-of-stream");else throw a}}async readData(t){switch(t.chunkID){case"COMM":{if(this.isCompressed===null)throw new n("Failed to parse AIFF.COMM chunk when compression type is unknown");let e=await this.tokenizer.readToken(new c(t,this.isCompressed));if(this.metadata.setFormat("bitsPerSample",e.sampleSize),this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("numberOfChannels",e.numChannels),this.metadata.setFormat("numberOfSamples",e.numSampleFrames),this.metadata.setFormat("duration",e.numSampleFrames/e.sampleRate),e.compressionName||e.compressionType)this.metadata.setFormat("codec",e.compressionName??k[e.compressionType]);return t.chunkSize}case"ID3 ":{let e=await this.tokenizer.readToken(new v(t.chunkSize)),a=Ne(e);return await new Qe().parse(this.metadata,a,this.options),t.chunkSize}case"SSND":if(this.metadata.format.duration)this.metadata.setFormat("bitrate",8*t.chunkSize/this.metadata.format.duration);return 0;case"NAME":case"AUTH":case"(c) ":case"ANNO":return this.readTextChunk(t);default:return p(`Ignore chunk id=${t.chunkID}, size=${t.chunkSize}`),0}}async readTextChunk(t){let a=(await this.tokenizer.readToken(new l(t.chunkSize,"ascii"))).split("\x00").map((s)=>s.trim()).filter((s)=>s?.length);return await Promise.all(a.map((s)=>this.metadata.addTag("AIFF",t.chunkID,s))),t.chunkSize}}export{w as AIFFParser};
2
+ import{B,Me,N,C,m,g,L,l,M,G,O}from"./index-22fzzn7z.js";import{Qe}from"./index-hrwakb11.js";import{I}from"./index-323jvr1g.js";var u=I(N(),1);var k={NONE:"not compressed\tPCM\tApple Computer",sowt:"PCM (byte swapped)",fl32:"32-bit floating point IEEE 32-bit float",fl64:"64-bit floating point IEEE 64-bit float\tApple Computer",alaw:"ALaw 2:1\t8-bit ITU-T G.711 A-law",ulaw:"µLaw 2:1\t8-bit ITU-T G.711 µ-law\tApple Computer",ULAW:"CCITT G.711 u-law 8-bit ITU-T G.711 µ-law",ALAW:"CCITT G.711 A-law 8-bit ITU-T G.711 A-law",FL32:"Float 32\tIEEE 32-bit float "};class n extends M("AIFF"){}class c{constructor(t,e){this.isAifc=e;let a=e?22:18;if(t.chunkSize<a)throw new n(`COMMON CHUNK size should always be at least ${a}`);this.len=t.chunkSize}get(t,e){let a=m.get(t,e+8)-16398,s=m.get(t,e+8+2),i={numChannels:m.get(t,e),numSampleFrames:g.get(t,e+2),sampleSize:m.get(t,e+6),sampleRate:a<0?s>>Math.abs(a):s<<a};if(this.isAifc){if(i.compressionType=O.get(t,e+18),this.len>22){let o=C.get(t,e+22);if(o>0){let d=(o+1)%2;if(23+o+d===this.len)i.compressionName=new l(o,"latin1").get(t,e+23);else throw new n("Illegal pstring length")}else i.compressionName=void 0}}else i.compressionName="PCM";return i}}var r={len:8,get:(t,e)=>({chunkID:O.get(t,e),chunkSize:Number(BigInt(g.get(t,e+4)))})};var p=u.default("music-metadata:parser:aiff");class w extends G{constructor(){super(...arguments);this.isCompressed=null}async parse(){if((await this.tokenizer.readToken(r)).chunkID!=="FORM")throw new n("Invalid Chunk-ID, expected 'FORM'");let e=await this.tokenizer.readToken(O);switch(e){case"AIFF":this.metadata.setFormat("container",e),this.isCompressed=!1;break;case"AIFC":this.metadata.setFormat("container","AIFF-C"),this.isCompressed=!0;break;default:throw new n(`Unsupported AIFF type: ${e}`)}this.metadata.setFormat("lossless",!this.isCompressed),this.metadata.setAudioOnly();try{while(!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=r.len){p(`Reading AIFF chunk at offset=${this.tokenizer.position}`);let a=await this.tokenizer.readToken(r),s=2*Math.round(a.chunkSize/2),i=await this.readData(a);await this.tokenizer.ignore(s-i)}}catch(a){if(a instanceof B)p("End-of-stream");else throw a}}async readData(t){switch(t.chunkID){case"COMM":{if(this.isCompressed===null)throw new n("Failed to parse AIFF.COMM chunk when compression type is unknown");let e=await this.tokenizer.readToken(new c(t,this.isCompressed));if(this.metadata.setFormat("bitsPerSample",e.sampleSize),this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("numberOfChannels",e.numChannels),this.metadata.setFormat("numberOfSamples",e.numSampleFrames),this.metadata.setFormat("duration",e.numSampleFrames/e.sampleRate),e.compressionName||e.compressionType)this.metadata.setFormat("codec",e.compressionName??k[e.compressionType]);return t.chunkSize}case"ID3 ":{let e=await this.tokenizer.readToken(new L(t.chunkSize)),a=Me(e);return await new Qe().parse(this.metadata,a,this.options),t.chunkSize}case"SSND":if(this.metadata.format.duration)this.metadata.setFormat("bitrate",8*t.chunkSize/this.metadata.format.duration);return 0;case"NAME":case"AUTH":case"(c) ":case"ANNO":return this.readTextChunk(t);default:return p(`Ignore chunk id=${t.chunkID}, size=${t.chunkSize}`),0}}async readTextChunk(t){let a=(await this.tokenizer.readToken(new l(t.chunkSize,"ascii"))).split("\x00").map((s)=>s.trim()).filter((s)=>s?.length);return await Promise.all(a.map((s)=>this.metadata.addTag("AIFF",t.chunkID,s))),t.chunkSize}}export{w as AIFFParser};
3
3
 
4
- //# debugId=42D2B70EF367866864756E2164756E21
5
- //# sourceMappingURL=AiffParser-tbx3xkmk.js.map
4
+ //# debugId=8CFC9DFCFB18C5CD64756E2164756E21
5
+ //# sourceMappingURL=AiffParser-9hj6fpmy.js.map
@@ -7,6 +7,6 @@
7
7
  "import * as Token from 'token-types';\nimport { FourCcToken } from '../common/FourCC.js';\n/**\n * Common AIFF chunk header\n */\nexport const Header = {\n len: 8,\n get: (buf, off) => {\n return {\n // Chunk type ID\n chunkID: FourCcToken.get(buf, off),\n // Chunk size\n chunkSize: Number(BigInt(Token.UINT32_BE.get(buf, off + 4)))\n };\n }\n};\n"
8
8
  ],
9
9
  "mappings": "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",
10
- "debugId": "42D2B70EF367866864756E2164756E21",
10
+ "debugId": "8CFC9DFCFB18C5CD64756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import{t,J}from"./index-hpvfqq6r.js";import{i,sa,aa,b,$e}from"./index-dzy19wtf.js";import{Rn,mA,_n}from"./index-snz49ndn.js";import{nt}from"./index-1x8mzvz7.js";import{no}from"./index-p6ya59m6.js";import{kn,vn}from"./index-3826kf9t.js";import{Ki,Yi,Hn,Kn,nn,DA,er,Ji,Fr,Yn,qi,Ur,zi,Zi}from"./index-1mbdz3f7.js";import{je}from"./index-fbsrhcga.js";import"./index-dv9pdjy4.js";import"./index-djeqvfms.js";import"./index-fxpmx6cr.js";import{TA}from"./index-qv6ktepc.js";import{BA,Nn}from"./index-eztfverw.js";import{he,en,wA,Ge,xi,Gn,tn}from"./index-m6fqx0ch.js";import"./index-mjfv7k5w.js";import"./index-sh44ymqz.js";import"./index-3vzf253k.js";import{wt}from"./index-zw6wyas6.js";import{Mr,Pe}from"./index-jc4kmfwa.js";import{Y,De}from"./index-0444sh6x.js";import{be,Lo,Po,Uo,pa,ya,Qa,ma,Sa,Tr,Sn,Da}from"./index-8tmv33mr.js";import{Box as O,Text as X,useApp as Nt,useInput as et}from"ink";import{useCallback as tt,useEffect as ot,useMemo as rt,useRef as Wt,useState as _}from"react";import{Box as Ee,Text as oe}from"ink";import{jsx as ce,jsxs as re}from"react/jsx-runtime";function sn({lines:e,label:n,offset:o,maxRows:r,code:a}){if(e===void 0)return ce(Ee,{marginLeft:2,children:ce(nt,{label:`running ${n}`})});if(e.length===0)return ce(Ee,{marginLeft:2,children:re(oe,{color:i.muted,children:[n," printed nothing"]})});let{from:s,to:l}=De(e.length,Math.min(o+Math.floor(r/2),e.length-1),r),u=e.slice(s,l).map((m,w)=>({row:s+w,text:m}));return re(Ee,{flexDirection:"column",children:[a!==void 0&&a!==0?re(oe,{color:i.error,wrap:"truncate",children:[b.error,n," exited ",a]}):null,s>0?re(oe,{dimColor:!0,wrap:"truncate",children:[" ",b.ellipsis," ",s," line",s===1?"":"s"," above"]}):null,u.map((m)=>ce(oe,{wrap:"truncate",children:m.text},m.row)),l<e.length?re(oe,{dimColor:!0,wrap:"truncate",children:[" ",b.ellipsis," ",e.length-l," line",e.length-l===1?"":"s"," ","below"]}):null]})}import{Box as ht,Text as N}from"ink";import{jsx as ie,jsxs as ue}from"react/jsx-runtime";function an({editor:e,width:n,maxRows:o}){let r=e.search;if(r===void 0)return null;let a=en(e),s=Math.min(r.index,Math.max(0,a.length-1)),{from:l,to:u}=De(a.length,s,o),m=Math.max(8,n-4);return ue(ht,{flexDirection:"column",children:[a.length===0?ue(N,{color:i.muted,wrap:"truncate",children:[" ","nothing you have sent matches that"]}):a.slice(l,u).map((w,v)=>{let p=l+v===s;return ue(N,{wrap:"truncate",children:[ie(N,{color:i.accent,children:p?b.pointer:" "}),ie(N,{bold:p,dimColor:!p,children:Y(w.replace(/\s+/g," "),m)})]},w)}),ue(N,{wrap:"truncate",children:[ie(N,{color:i.muted,children:" search: "}),r.query,ie(N,{inverse:!0,children:" "}),a.length>1?ie(N,{color:i.muted,children:` ${s+1} of ${a.length}`}):null]})]})}import{Box as xt,Text as dn}from"ink";import{jsxs as ve}from"react/jsx-runtime";function ln({live:e,showReasoning:n,columns:o}){let r=n&&e.reasoning!==""&&e.text==="",a=r?e.reasoning:e.text;if(a==="")return null;let s=r?"· reasoning · ":"",l=no(a,o-[...s].length,Lo),u=l.lines.map((m,w)=>({at:w,text:m}));return ve(xt,{flexDirection:"column",children:[l.hidden>0?ve(dn,{dimColor:!0,wrap:"truncate",children:["… ",l.hidden," earlier row(s) hidden while streaming"]}):null,u.map((m)=>ve(dn,{dimColor:r,wrap:"truncate",children:[m.at===0?s:"",m.text]},`row-${m.at}`))]})}import{Box as gt,Text as W}from"ink";import{jsx as Ce,jsxs as ee}from"react/jsx-runtime";function bt(e){return e.matches.reduce((n,o)=>Math.max(n,o.word.length),0)}function cn({palette:e,index:n,width:o,maxRows:r}){if(e.matches.length===0)return ee(W,{color:i.muted,wrap:"truncate",children:[" ","no command starts with /",e.query]});let a=Math.min(n,e.matches.length-1),{from:s,to:l}=De(e.matches.length,a,r),u=bt(e),m=Math.max(8,o-(2+u+2));return ee(gt,{flexDirection:"column",children:[s>0?ee(W,{dimColor:!0,wrap:"truncate",children:[" ",b.ellipsis," ",s," above"]}):null,e.matches.slice(s,l).map((w,v)=>{let E=s+v===a;return ee(W,{wrap:"truncate",children:[Ce(W,{color:i.accent,children:E?b.pointer:" "}),Ce(W,{bold:E,...E?{color:i.accent}:{},children:w.word.padEnd(u)})," ",Ce(W,{dimColor:!0,children:Y(w.summary,m)})]},w.word)}),l<e.matches.length?ee(W,{dimColor:!0,wrap:"truncate",children:[" ",b.ellipsis," ",e.matches.length-l," below"]}):null,ee(W,{dimColor:!0,wrap:"truncate",children:[" ","↑↓ move · tab complete · enter run · esc close"]})]})}import{Box as un,Text as yt}from"ink";import{jsx as mn,jsxs as fn}from"react/jsx-runtime";function pn({editor:e,busy:n,placeholder:o,columns:r}){let a=e.value.split(`
3
+ `).length,s=Math.max(1,r-4);return fn(un,{flexDirection:"column",children:[mn(un,{borderStyle:$e,borderColor:n?i.border:i.borderActive,width:r,paddingX:1,children:mn(vn,{editor:e,gutter:Po,maxRows:Uo,columns:s,...o===void 0?{}:{placeholder:o}})}),a>1?fn(yt,{dimColor:!0,wrap:"truncate",children:[" ",Ki]}):null]})}import{Text as me}from"ink";import{jsx as gn,jsxs as xn}from"react/jsx-runtime";var Tt={idle:"ready",thinking:"thinking",streaming:"replying",working:"running a tool",cancelling:"cancelling"};function St(e){return`${(e/1000).toFixed(1)}s`}function hn(e,n){if(e!=="idle")return" · ^C cancels";return n?" · ^C again to leave":" · ^C twice to leave · /exit"}function kt(e){if(e!=="idle")return"";return" · ^O show reasoning"}var Rt=0.5,Mt=0.8;function wn({status:e,model:n,sessionKey:o,elapsedMs:r,last:a,quiet:s,armed:l,pressure:u,phase:m}){return xn(me,{dimColor:!0,wrap:"truncate",children:[xn(me,{color:sa[e],children:[b.dot,Tt[e]]}),e==="idle"?"":` ${St(r)}`,` · ${n} · ${o}`,m===void 0||s?"":` · ${m}`,u===void 0||u<Rt||s?"":gn(me,{...u>=Mt?{color:i.warning}:{},children:` · ctx ${Math.round(u*100)}%`}),a===void 0||s?"":` · last ${Ur(a)}`,kt(e),l===!0?gn(me,{color:i.warning,children:hn(e,!0)}):hn(e,!1)]})}import{Box as Pt,Text as fe}from"ink";var V={offset:0,pinned:!0};function bn(e,n){return Math.max(0,e-n)}function yn(e,n,o){let r=bn(n,o);return e.pinned?r:Math.max(0,Math.min(e.offset,r))}function Tn(e,n,o,r){if(n==="bottom")return V;let a=bn(o,r);if(a===0)return V;if(n==="top")return{offset:0,pinned:!1};let s=n==="pageUp"||n==="pageDown"?Math.max(1,r-1):1,l=n==="down"||n==="pageDown"?s:-s,u=yn(e,o,r)+l;if(u>=a)return V;return{offset:Math.max(0,u),pinned:!1}}function Mn(e,n,o){if(o<=0)return{from:0,to:0,above:n,below:0};let r=yn(e,n,o),a=Math.min(n,r+o);return{from:r,to:a,above:r,below:n-a}}function En(e,n){return Math.max(ya,e-n-1)}function Pn(e){let n=[];if(e.above>0)n.push(`↑ ${e.above} row${e.above===1?"":"s"} above`);if(e.below>0)n.push(`↓ ${e.below} row${e.below===1?"":"s"} below`,"esc returns");return n.length===0?"":` ${n.join(" · ")}`}function Cn(e){return{anchor:e,focus:e,dragging:!0}}function _e(e,n){if(!e.dragging)return e;return{...e,focus:n}}function An(e){return{...e,dragging:!1}}function Ln(e,n){return{...e,focus:n,dragging:!1}}function Et(e,n){return e.row<n.row||e.row===n.row&&e.column<=n.column}function Bn(e){if(e===void 0)return;let{anchor:n,focus:o}=e;if(n.row===o.row&&n.column===o.column)return;return Et(n,o)?{start:n,end:o}:{start:o,end:n}}function Le(e,n,o){let r=Bn(e);if(r===void 0)return;if(n<r.start.row||n>r.end.row)return;let a=n===r.start.row?Math.min(r.start.column,o):0,s=n===r.end.row?Math.min(r.end.column,o):o;return s<=a?void 0:{from:a,to:s}}function $n(e,n){let o=Bn(n);if(o===void 0)return"";let r=[];for(let a=o.start.row;a<=o.end.row;a+=1){let s=e[a];if(s===void 0)continue;let l=[...s.text],u=Le(n,a,l.length),m=u===void 0?"":l.slice(Math.max(u.from,s.lead),u.to).join("");if(s.continuation&&r.length>0){r[r.length-1]+=m;continue}r.push(m)}return r.map((a)=>a.replace(/\s+$/,"")).join(`
4
+ `)}function Ae(e){return e!==void 0&&!/\s/.test(e)}function In(e,n){let o=e[n.row];if(o===void 0)return{anchor:n,focus:n,dragging:!1};let r=[...o.text];if(!Ae(r[n.column]))return Be(e,n);let{column:a,column:s}=n;while(a>o.lead&&Ae(r[a-1]))a-=1;while(s<r.length&&Ae(r[s]))s+=1;return{anchor:{row:n.row,column:a},focus:{row:n.row,column:s},dragging:!1}}function Be(e,n){let o=e[n.row],r=o===void 0?0:[...o.text].length;return{anchor:{row:n.row,column:o?.lead??0},focus:{row:n.row,column:r},dragging:!1}}import{jsx as Ie,jsxs as On}from"react/jsx-runtime";function Dn({rows:e,slice:n,selection:o}){let r=e.slice(n.from,n.to),a=Pn(n);return On(Pt,{flexDirection:"column",children:[Ie(fe,{color:i.muted,wrap:"truncate",children:a===""?" ":a}),r.map((s,l)=>{let u=s.dim===!0?i.muted:aa[s.role],m=[...s.text],w=Le(o,n.from+l,m.length);if(w===void 0)return Ie(fe,{wrap:"truncate",bold:s.bold===!0,...u===void 0?{}:{color:u},children:s.text===""?" ":s.text},s.key);let v=Math.max(w.from,s.lead);return On(fe,{wrap:"truncate",bold:s.bold===!0,...u===void 0?{}:{color:u},children:[m.slice(0,v).join(""),Ie(fe,{backgroundColor:i.selection,children:m.slice(v,w.to).join("")}),m.slice(w.to).join("")]},s.key)})]})}import{useEffect as vt,useState as Ct}from"react";var At=100;function Wn(e){let[n,o]=Ct(0);return vt(()=>{if(!e){o(0);return}let r=Date.now();o(0);let a=setInterval(()=>o(Date.now()-r),At);return()=>clearInterval(a)},[e]),n}import{useCallback as pe,useEffect as _t,useReducer as Lt,useRef as Fn}from"react";function Un(e){let{source:n,sessionKey:o,initial:r}=e,[a,s]=Lt(qi,r),l=Fn(void 0),u=Fn(n.streamFilter());_t(()=>n.subscribe((p)=>{if(p.sessionKey!==void 0&&p.sessionKey!==o){if(p.parentSessionKey===o)s({kind:"event",event:p});return}if(p.type==="model.chunk"){let{delta:L,kind:B}=p.data;if(B==="reasoning"){s({kind:"delta",of:"reasoning",text:L});return}s({kind:"delta",of:"text",text:u.current.push(L)});return}if(p.type==="model.result"){s({kind:"delta",of:"text",text:u.current.endStep()});return}if(p.type==="turn.end")s({kind:"delta",of:"text",text:u.current.end()}),u.current=n.streamFilter();s({kind:"event",event:p})}),[n,o]);let m=pe((p)=>{s({kind:"user",text:p});let L=new AbortController;l.current=L,n.send(p,{sessionKey:o,signal:L.signal}).catch((B)=>{s({kind:"event",event:{v:1,ts:new Date().toISOString(),runtimeId:"cli",sessionKey:o,type:"error",data:{code:"cli_turn_failed",message:B instanceof Error?B.message:String(B),hint:"This escaped the turn loop's own error handling. Re-run with DEBUG=1 for a stack trace."}}})}).finally(()=>{if(l.current===L)l.current=void 0})},[n,o]),w=pe(()=>{let p=l.current;if(p===void 0||p.signal.aborted)return;s({kind:"cancelling"}),p.abort()},[]),v=pe((p)=>s({kind:"note",text:p}),[]),E=pe(()=>s({kind:"trim"}),[]);return{state:a,busy:a.status!=="idle",send:m,cancel:w,note:v,trim:E}}var Oe=1,He=1,Ue=1,jn=2,Ne=4,We=2,Vn=14;function Fe(e,n){let{rows:o,caretRow:r}=kn(e,Math.max(1,n-Ne-We)),a=o.length,{from:s,to:l}=De(a,r,Math.max(1,Math.min(a,Uo)));return jn+(l-s)+(s>0?1:0)+(a-l>0?1:0)+(e.value.includes(`
5
+ `)?1:0)}var Bt=2;function $t(e,n){if(e===void 0)return 0;if(e.matches.length===0)return 1;let o=Math.min(e.matches.length,n),r=e.matches.length>o?1:0;return o+r+1}function Xn(e,n){if(e.search===void 0)return 0;let o=en(e);return(o.length===0?1:Math.min(o.length,n))+1}function zn(e){let n=e.live,o=n===void 0?"":e.showReasoning&&n.reasoning!==""&&n.text===""?n.reasoning:n.text,r=Oe+He+no(o,e.columns-Vn,Lo).rows+Xn(e.editor,e.searchMaxRows)+Fe(e.editor,e.columns)+(e.confirming?1:0)+(e.hint?1:0),a=Math.max(1,Math.min(e.paletteMaxRows,e.rows-r-Bt-1)),s=Oe+He+no(o,e.columns-Vn,Lo).rows+$t(e.palette,a)+Xn(e.editor,e.searchMaxRows)+Fe(e.editor,e.columns)+(e.confirming?1:0)+(e.hint?1:0),l=En(e.rows,s),u=e.landing?Math.max(0,l-ma-Tr):0;return{paletteRows:a,brand:u,body:l,transcript:Math.max(1,l-Ue),pane:Math.max(1,l-3)}}function Jn(e,n){let o=(n.brandLines===0?0:n.brandLines+Tr)+Oe+Ue,r=e.row-o;if(r<0)return;let a=n.from+r;if(a>=n.to)return;return{row:a,column:e.column}}function Qn(e,n){let o=kn(n.editor,Math.max(1,n.columns-Ne-We)),r=o.rows.length,{from:a,to:s}=De(r,o.caretRow,Math.max(1,Math.min(r,Uo))),l=a>0?1:0,u=Fe(n.editor,n.columns),w=n.rows-He-(n.hint?1:0)-u+jn/2+l,v=e.row-w;if(v<0||v>=s-a)return;let E=o.rows[a+v];if(E===void 0)return;let p=e.column-Ne/2-We;if(p<0)return E.start;return Math.min(E.end,E.start+Math.max(0,p-E.lead))}function Zn(e,n){let o=n===0?0:n+Tr;return Math.max(1,e.body-o-Ue)}var It=[{command:"pbcopy",args:[]},{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}];async function Ve(e){if(e==="")return{copied:!1,problem:"nothing selected"};let n=[];for(let o of It){let r=await wt({command:o.command,args:o.args,input:e,timeoutMs:2000});if(r.notFound){n.push(o.command);continue}if(r.code===0)return{copied:!0,using:o.command};return{copied:!1,using:o.command,problem:r.stderr.trim()||`${o.command} exited ${r.code}`}}return{copied:!1,problem:`no clipboard command found (tried ${n.join(", ")})`}}function Ot(e){return TA(e)?.args.findIndex((n)=>n.name==="manifest")??-1}function Dt(e){let n=e.rest.trim()===""?[]:e.rest.trim().split(/\s+/),o=Ot(e.name),r=o===-1||n.length<o?n:[...n.slice(0,o),e.manifestPath,...n.slice(o)];return[e.name,...r,"--plain"]}function Ht(e){let n=TA(e.name);if(n===void 0)return;let o=n.flags.find((s)=>s.name==="follow");if(o===void 0)return;if(!e.rest.trim().split(/\s+/).some((s)=>s==="--follow"||o.short!==void 0&&s===`-${o.short}`))return;return`--follow keeps printing until it is interrupted, and a pane has nothing to interrupt it with. Run it in its own terminal: ${e.name} ${e.rest.trim()}`}async function qn(e){let n=Ht(e);if(n!==void 0)return{lines:[n],code:1};let o=e.interpreter??process.execPath,r=e.script??(e.interpreter!==void 0?"":process.argv[1]??""),a=await wt({command:o,args:[r,...Dt(e)],...e.env===void 0?{}:{env:e.env},timeoutMs:e.timeoutMs??30000}),s=[a.stdout,a.stderr].filter((u)=>u.trim()!=="").join(`
6
+ `),l=s===""?[]:s.replace(/\n+$/,"").split(`
7
+ `);if(a.notFound)return{lines:[`could not run ${o}`],code:1};if(a.signalled)return{lines:[...l,`${e.name} was stopped before it finished`],code:1};return{lines:l,code:a.code}}import{jsx as g,jsxs as K,Fragment as Gt}from"react/jsx-runtime";function Lr({source:e,sessionKey:n,model:o,agentName:r,warnings:a,freshSession:s,initial:l,correctKeys:u,showReasoning:m,quiet:w,onRestart:v,onSwitch:E,onNew:p,sessions:L,initialDraft:B,manifestPath:D,catalogue:ne,status:Ye,contextView:Xe}){let{exit:j}=Nt(),z=je(),R=Pe(z.columns,be),{state:P,busy:se,send:it,cancel:st,note:x,trim:Ke}=Un({source:e,sessionKey:n,initial:l}),[A,I]=_(()=>B===void 0||B===""?he:{...he,value:B,cursor:[...B].length}),[k,C]=_({kind:"none"}),[ze,at]=_(void 0),[Je,dt]=_(void 0),[Qe,lt]=_(void 0),[ae,xe]=_(V),[te,ge]=_(!1),[we,Ze]=_(!1),[qe,ct]=_(!1),[Q,G]=_(void 0),ye=Wt(void 0),H=k.kind==="none"?Ji(A.value):void 0,[Te,de]=_(0),ut=Wn(se),mt=rt(()=>zi(P.items),[P.items]),Z=rt(()=>Zi(P.items,{showReasoning:m,quiet:w,columns:R,expandReasoning:qe}),[P.items,m,w,R,qe]),q=s===!0&&!P.items.some((h)=>h.role==="user"),Se=q?Qa:pa,F=zn({rows:z.rows,columns:R,editor:A,live:P.live,showReasoning:m,palette:H,paletteMaxRows:Se,searchMaxRows:Se,confirming:we,landing:q,hint:q}),le=F.brand>0?_n(t.name,{columns:R-mA,rows:F.brand}):void 0,ke=Mn(ae,Z.length,Zn(F,le?.lines.length??0));ot(()=>{if(!ae.pinned)return;G(void 0),Ke()},[ae.pinned,P.items.length,Ke]),ot(()=>{if(!te)return;let h=setTimeout(()=>ge(!1),Da);return()=>clearTimeout(h)},[te]);let on=(h,T)=>{let f=Hn(h,Yn());if(f!==void 0)switch(f.kind){case"exit":Ze(!0);return;case"restart":{let d=e.reload;if(d===void 0){v?.(T),j();return}x("asking the host to reload this agent…"),d().then((c)=>x(`reloaded ${c.join(", ")} — this conversation continues`)).catch((c)=>x(`could not reload: ${c instanceof Error?c.message:String(c)}`));return}case"new":p?.(T),j();return;case"help":x(Kn());return;case"tools":e.tools().then((d)=>x(DA(d))).catch((d)=>x(`could not read the tools: ${d instanceof Error?d.message:String(d)}`));return;case"context":if(Xe===void 0){x("context is unavailable in this session");return}Xe().then(x).catch((d)=>x(`could not read the context: ${d instanceof Error?d.message:String(d)}`));return;case"status":if(Ye===void 0){x("status is unavailable in this session");return}Ye().then(x).catch((d)=>x(`could not read the status: ${d instanceof Error?d.message:String(d)}`));return;case"reset":e.clearSession(n).then(()=>x("session cleared — memory files on disk are untouched")).catch((d)=>x(`could not clear the session: ${d instanceof Error?d.message:String(d)}`));return;case"command":if(rn(`/${f.name}`,f.rest))return;x(nn({word:`/${f.name}`}));return;case"unknown":x(nn(f));return}if(se){x("a turn is still running — ^C cancels it, then send again");return}it(h)},Re=tt((h,T)=>{C({kind:"output",label:`/${h}`,lines:void 0,offset:0}),qn({name:h,rest:T,manifestPath:D??""}).then((f)=>C({kind:"output",label:`/${h}`,lines:f.lines,code:f.code,offset:0})).catch((f)=>C({kind:"output",label:`/${h}`,lines:[f instanceof Error?f.message:String(f)],code:1,offset:0}))},[D]),rn=tt((h,T)=>{let f=er().find((d)=>d.word===h);if(f===void 0)return!1;if(f.kind==="view"){if(f.word==="/sessions"&&L!==void 0&&E!==void 0)return C({kind:"sessions",stored:void 0}),import("./SessionPicker-hpv2ncsb.js").then((d)=>lt(()=>d.SessionPicker)),L().then((d)=>C({kind:"sessions",stored:d})).catch((d)=>{C({kind:"none"}),x(`could not read the stored conversations: ${d instanceof Error?d.message:String(d)}`)}),!0;if(f.word==="/config"&&(T.trim()===""||T.trim()==="edit")){if(D===void 0)return x("this session has no manifest path, so there is nothing to edit"),!0;return C({kind:"config",rows:BA(D)}),import("./ConfigEditor-vk7vxaa6.js").then((d)=>dt(()=>d.ConfigEditor)),!0}if(f.word==="/skills"&&ne!==void 0)return C({kind:"skills"}),import("./SkillBrowser-qc542n71.js").then((d)=>at(()=>d.SkillBrowser)),!0;return Re(f.word.slice(1),T),!0}if(f.kind==="output")return Re(f.word.slice(1),T),!0;return!1},[Re,ne,L,E,x,D]);if(et((h,T)=>{if(k.kind!=="output")return;if(T.escape||h==="q"){C({kind:"none"});return}let f=k.lines?.length??0,d=T.pageDown||T.pageUp?F.pane:1,c=T.downArrow||T.pageDown?d:T.upArrow||T.pageUp?-d:0;if(c!==0)C({...k,offset:Math.max(0,Math.min(k.offset+c,Math.max(0,f-1)))})},{isActive:k.kind==="output"}),et((h,T)=>{let f=u===void 0?T:u(T,h);if(we){if(Ze(!1),h.toLowerCase()==="y"||f.return)j();return}if(H!==void 0){if(f.escape){I((y)=>Ge(y,{kind:"killToStart"})),de(0);return}if(f.upArrow||f.downArrow){de((y)=>Math.max(0,Math.min(y+(f.downArrow?1:-1),H.matches.length-1)));return}if(f.tab){let y=Fr(H,Te);if(y!==void 0)I((M)=>Ge({...M,value:"",cursor:0},{kind:"insert",text:y.word}));return}let c=Fr(H,Te);if(f.return&&c!==void 0){let y=c;if(de(0),I((M)=>({...M,value:"",cursor:0})),y.kind==="session")on(y.word,"");else rn(y.word,"");return}}let d=tn(h,f,Gn(A,se,{armed:te,scrolled:!ae.pinned}));if(te&&d.kind!=="exit")ge(!1);if(d.kind==="arm"){ge(!0);return}if(d.kind==="scroll"){let c=Math.max(1,d.times??1);xe((y)=>{let M=y;for(let S=0;S<c;S+=1)M=Tn(M,d.move,Z.length,F.transcript);return M});return}if(d.kind==="pointer"){let c=Jn({column:d.column,row:d.row},{brandLines:le?.lines.length??0,from:ke.from,to:ke.to});if(c===void 0){let S=Qn({column:d.column,row:d.row},{editor:A,columns:R,rows:z.rows,hint:q});if(S===void 0){if(d.gesture==="press")G(void 0),I((U)=>({...U,anchor:void 0}));return}G(void 0),I((U)=>d.gesture==="press"&&!d.shift?{...U,cursor:S,anchor:S}:{...U,cursor:S,anchor:U.anchor??U.cursor});return}if(d.gesture==="press"){if(d.shift&&Q!==void 0){G(Ln(Q,c)),ye.current=void 0;return}let S=ye.current,Me=S!==void 0&&Date.now()-S.when<=Sa&&S.at.row===c.row&&S.at.column===c.column?S.clicks%3+1:1;ye.current={at:c,when:Date.now(),clicks:Me},I((pt)=>({...pt,anchor:void 0})),G(Me===3?Be(Z,c):Me===2?In(Z,c):Cn(c));return}if(d.gesture==="drag"){G((S)=>S===void 0?void 0:_e(S,c));return}let y=Q===void 0?void 0:An(_e(Q,c));G(y);let M=$n(Z,y);if(M!=="")Ve(M).then((S)=>{if(!S.copied&&S.problem!=="nothing selected")x(`could not copy: ${S.problem??"unknown"}`)});return}if(d.kind==="copySelection"||d.kind==="cutSelection"){let c=wA(A);if(c===void 0){x("nothing selected — hold shift with a motion, or drag in the box");return}let y=[...A.value].slice(c.start,c.end).join("");if(d.kind==="cutSelection")I((M)=>Ge(M,d));Ve(y).then((M)=>{if(!M.copied)x(`could not copy: ${M.problem??"unknown"}`)});return}if(d.kind==="reasoning"){let c=P.items.some((y)=>(y.subagents??[]).some((M)=>M.lines.length>0));if(!c&&!m){x("reasoning is off: either this model does not stream it, or --no-reasoning is set");return}if(!c&&!P.items.some((y)=>y.role==="reasoning")){x("no reasoning to show yet — this expands it once a turn has streamed some");return}ct((y)=>!y),xe(V);return}if(d.kind==="exit"){j();return}if(d.kind==="cancel"){st();return}if(d.kind==="submit"){let c=xi(A);if(I(c.state),xe(V),c.text!=="")on(c.text,c.state.value);return}if(d.kind==="paste"){I((c)=>Ge(c,{kind:"insert",text:d.lines.join(`
8
+ `)}));return}if(H!==void 0)de(0);I((c)=>Ge(c,d))},{isActive:k.kind==="none"}),k.kind==="config")return K(O,{flexDirection:"column",width:R,height:z.rows,children:[g(X,{color:i.accent,bold:!0,wrap:"truncate",children:Mr({title:`${t.name} ${J}`,summary:"settings"},R)}),Je===void 0?g(O,{marginLeft:2,children:g(nt,{label:"reading the settings"})}):g(Je,{rows:k.rows,apply:(h,T)=>Nn(D??"",h,T),reload:()=>BA(D??""),columns:R,window:Sn,onDone:(h)=>{if(C({kind:"none"}),h)v?.(A.value),j()}}),g(O,{flexGrow:1})]});if(k.kind==="sessions")return K(O,{flexDirection:"column",width:R,height:z.rows,children:[g(X,{color:i.accent,bold:!0,wrap:"truncate",children:Mr({title:`${t.name} ${J}`,summary:"pick a conversation"},R)}),g(O,{flexGrow:1}),k.stored===void 0||Qe===void 0?g(O,{marginLeft:2,children:g(nt,{label:"reading the stored conversations"})}):g(Qe,{sessions:k.stored,now:Date.now(),columns:R,maxRows:Sn,current:n,onDone:(h)=>{if(h===void 0||h===n){C({kind:"none"});return}E?.(h,A.value),j()}}),g(O,{flexGrow:1})]});if(k.kind==="skills"&&ne!==void 0&&ze!==void 0)return g(ze,{title:`${t.name} ${J}`,agents:[],target:D??"",load:ne.load,install:ne.install,onDone:()=>C({kind:"none"})});let ft=Mr({title:`${t.name} ${J}`,summary:"",agent:{name:r,model:o},...a===void 0||a.length===0?{}:{warnings:a}},R);return K(O,{flexDirection:"column",width:R,height:z.rows,children:[le===void 0?null:K(Gt,{children:[g(Rn,{lines:le.lines}),g(X,{children:" "})]}),g(X,{color:i.accent,bold:!0,wrap:"truncate",children:ft}),k.kind==="output"?K(O,{flexDirection:"column",children:[g(sn,{lines:k.lines,label:k.label,offset:k.offset,maxRows:F.pane,...k.code===void 0?{}:{code:k.code}}),K(X,{dimColor:!0,wrap:"truncate",children:[" ","↑↓ scroll · esc back to the prompt"]})]}):g(Dn,{rows:Z,slice:ke,...Q===void 0?{}:{selection:Q}}),g(O,{flexGrow:1}),P.live===void 0?null:g(ln,{live:P.live,showReasoning:m,columns:R}),H===void 0?null:g(cn,{palette:H,index:Te,width:R,maxRows:F.paletteRows}),g(an,{editor:A,width:R,maxRows:Se}),we?g(X,{color:i.warning,wrap:"truncate",children:" leave this session? press y to confirm · any other key stays"}):null,g(pn,{editor:A,busy:se,columns:R,...q?{placeholder:"Ask anything…"}:{}}),q?K(X,{dimColor:!0,wrap:"truncate",children:[" ",Yi]}):null,g(wn,{status:P.status,model:o,sessionKey:n,elapsedMs:ut,last:mt,quiet:w,armed:te,...P.pressure===void 0?{}:{pressure:P.pressure},...P.phase===void 0?{}:{phase:P.phase}})]})}export{Lr as App};
9
+
10
+ //# debugId=A9CB6A7901DF057064756E2164756E21
11
+ //# sourceMappingURL=App-2f72vhjv.js.map