dispach 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/README.md +34 -27
  2. package/dist/APEv2Parser-x13n424p.js +5 -0
  3. package/dist/{FlacParser-7t7da7qy.js.map → APEv2Parser-x13n424p.js.map} +1 -1
  4. package/dist/{AiffParser-y21k3fak.js → AiffParser-ns1y9f0g.js} +3 -3
  5. package/dist/{AiffParser-y21k3fak.js.map → AiffParser-ns1y9f0g.js.map} +1 -1
  6. package/dist/App-wkpkwgjt.js +11 -0
  7. package/dist/{App-4w3qkcs4.js.map → App-wkpkwgjt.js.map} +3 -3
  8. package/dist/AsfParser-bae2a1yf.js +5 -0
  9. package/dist/{AsfParser-wd98k2h4.js.map → AsfParser-bae2a1yf.js.map} +1 -1
  10. package/dist/ConfigEditor-hy9jtas3.js +6 -0
  11. package/dist/{ConfigEditor-vk7vxaa6.js.map → ConfigEditor-hy9jtas3.js.map} +1 -1
  12. package/dist/DsdiffParser-s0zvxnfa.js +5 -0
  13. package/dist/{DsdiffParser-cbfaj500.js.map → DsdiffParser-s0zvxnfa.js.map} +1 -1
  14. package/dist/{DsfParser-tybrja4x.js → DsfParser-90mvzt4v.js} +3 -3
  15. package/dist/{DsfParser-tybrja4x.js.map → DsfParser-90mvzt4v.js.map} +1 -1
  16. package/dist/FlacParser-8xprykrh.js +5 -0
  17. package/dist/{APEv2Parser-etzjd528.js.map → FlacParser-8xprykrh.js.map} +1 -1
  18. package/dist/{KeyProbe-5anphmb7.js → KeyProbe-fk5krzks.js} +3 -3
  19. package/dist/{KeyProbe-5anphmb7.js.map → KeyProbe-fk5krzks.js.map} +1 -1
  20. package/dist/MP4Parser-nmvbkq21.js +5 -0
  21. package/dist/{MP4Parser-gc94h1n9.js.map → MP4Parser-nmvbkq21.js.map} +2 -2
  22. package/dist/{MatroskaParser-cy2k4fac.js → MatroskaParser-tsmz2qfq.js} +3 -3
  23. package/dist/{MatroskaParser-cy2k4fac.js.map → MatroskaParser-tsmz2qfq.js.map} +1 -1
  24. package/dist/{MpegParser-c460fwf0.js → MpegParser-y5fjpaz9.js} +3 -3
  25. package/dist/{MpegParser-c460fwf0.js.map → MpegParser-y5fjpaz9.js.map} +1 -1
  26. package/dist/MusepackParser-544q0byg.js +5 -0
  27. package/dist/{MusepackParser-8mq2eabg.js.map → MusepackParser-544q0byg.js.map} +2 -2
  28. package/dist/OggParser-v77rbjnt.js +5 -0
  29. package/dist/{OggParser-7dnc6apg.js.map → OggParser-v77rbjnt.js.map} +1 -1
  30. package/dist/Picker-32m79nmp.js +5 -0
  31. package/dist/{Picker-j7txnm7w.js.map → Picker-32m79nmp.js.map} +1 -1
  32. package/dist/SessionPicker-9p06npt5.js +5 -0
  33. package/dist/{SessionPicker-hpv2ncsb.js.map → SessionPicker-9p06npt5.js.map} +1 -1
  34. package/dist/SkillBrowser-ezdx3xsh.js +5 -0
  35. package/dist/{SkillBrowser-qc542n71.js.map → SkillBrowser-ezdx3xsh.js.map} +1 -1
  36. package/dist/WavPackParser-k623m0hk.js +5 -0
  37. package/dist/{WavPackParser-kt7cds9c.js.map → WavPackParser-k623m0hk.js.map} +1 -1
  38. package/dist/WaveParser-nj4p1vx8.js +5 -0
  39. package/dist/{WaveParser-g47ja0vy.js.map → WaveParser-nj4p1vx8.js.map} +1 -1
  40. package/dist/WizardApp-p350qspw.js +5 -0
  41. package/dist/{WizardApp-q4p979d1.js.map → WizardApp-p350qspw.js.map} +1 -1
  42. package/dist/channels-a9zx9yba.js +31 -0
  43. package/dist/{channels-4t89qpdt.js.map → channels-a9zx9yba.js.map} +1 -1
  44. package/dist/client.d.ts +43 -0
  45. package/dist/client.js +9 -9
  46. package/dist/client.js.map +5 -5
  47. package/dist/components/App.d.ts.map +1 -1
  48. package/dist/config-3mz4zwsf.js +24 -0
  49. package/dist/{config-35r6n1gh.js.map → config-3mz4zwsf.js.map} +2 -2
  50. package/dist/credential-ja7zmd4c.js +19 -0
  51. package/dist/{credential-dpdgg4j6.js.map → credential-ja7zmd4c.js.map} +1 -1
  52. package/dist/index-039ew35r.js +6 -0
  53. package/dist/index-039ew35r.js.map +10 -0
  54. package/dist/index-0dvs3a06.js +6 -0
  55. package/dist/{index-jc4kmfwa.js.map → index-0dvs3a06.js.map} +1 -1
  56. package/dist/{index-pszmnhgq.js → index-1cagdzqe.js} +9 -9
  57. package/dist/{index-pszmnhgq.js.map → index-1cagdzqe.js.map} +1 -1
  58. package/dist/index-2fw9e5gg.js +6 -0
  59. package/dist/{index-0444sh6x.js.map → index-2fw9e5gg.js.map} +1 -1
  60. package/dist/{index-a2eh8dnk.js → index-2td5h856.js} +12 -12
  61. package/dist/{index-a2eh8dnk.js.map → index-2td5h856.js.map} +1 -1
  62. package/dist/{index-m6fqx0ch.js → index-446exxcb.js} +7 -7
  63. package/dist/{index-m6fqx0ch.js.map → index-446exxcb.js.map} +1 -1
  64. package/dist/{index-snz49ndn.js → index-4fajxhdv.js} +4 -4
  65. package/dist/{index-snz49ndn.js.map → index-4fajxhdv.js.map} +1 -1
  66. package/dist/index-4j65jp20.js +9 -0
  67. package/dist/{index-38gs9anh.js.map → index-4j65jp20.js.map} +1 -1
  68. package/dist/index-5gn74n56.js +10 -0
  69. package/dist/{index-ew997be5.js.map → index-5gn74n56.js.map} +2 -2
  70. package/dist/index-5zpfz4kb.js +9 -0
  71. package/dist/{index-8h6kewy1.js.map → index-5zpfz4kb.js.map} +1 -1
  72. package/dist/index-60h4knj6.js +126 -0
  73. package/dist/{index-zce9gy22.js.map → index-60h4knj6.js.map} +2 -2
  74. package/dist/index-635wcsh1.js +5 -0
  75. package/dist/{index-2bsardvh.js.map → index-635wcsh1.js.map} +1 -1
  76. package/dist/index-67sfck4d.js +110 -0
  77. package/dist/index-67sfck4d.js.map +13 -0
  78. package/dist/index-7p8d1gf0.js +63 -0
  79. package/dist/{index-ytxbw8py.js.map → index-7p8d1gf0.js.map} +1 -1
  80. package/dist/index-7zgjkbb0.js +5 -0
  81. package/dist/{index-qgsdgbk8.js.map → index-7zgjkbb0.js.map} +1 -1
  82. package/dist/{index-zw6wyas6.js → index-86rb86nr.js} +4 -4
  83. package/dist/{index-zw6wyas6.js.map → index-86rb86nr.js.map} +1 -1
  84. package/dist/{index-fbsrhcga.js → index-8jejze0z.js} +4 -4
  85. package/dist/{index-fbsrhcga.js.map → index-8jejze0z.js.map} +1 -1
  86. package/dist/index-8k8y7edx.js +7 -0
  87. package/dist/{index-3826kf9t.js.map → index-8k8y7edx.js.map} +1 -1
  88. package/dist/index-8mkatm20.js +6 -0
  89. package/dist/{index-42e29zs4.js.map → index-8mkatm20.js.map} +1 -1
  90. package/dist/{index-3vzf253k.js → index-9k6qa50r.js} +7 -7
  91. package/dist/{index-3vzf253k.js.map → index-9k6qa50r.js.map} +1 -1
  92. package/dist/{index-yw3fby4n.js → index-a1axc952.js} +4 -4
  93. package/dist/{index-yw3fby4n.js.map → index-a1axc952.js.map} +1 -1
  94. package/dist/index-ayhdn87b.js +6 -0
  95. package/dist/{index-dzy19wtf.js.map → index-ayhdn87b.js.map} +1 -1
  96. package/dist/index-b8bfzbfe.js +6 -0
  97. package/dist/{index-7mn8ack9.js.map → index-b8bfzbfe.js.map} +2 -2
  98. package/dist/index-brh25jhq.js +6 -0
  99. package/dist/{index-fa9wvpyw.js.map → index-brh25jhq.js.map} +2 -2
  100. package/dist/index-c6qrcweh.js +6 -0
  101. package/dist/{index-nxhqf597.js.map → index-c6qrcweh.js.map} +1 -1
  102. package/dist/index-cb45233h.js +6 -0
  103. package/dist/{index-nvc24414.js.map → index-cb45233h.js.map} +1 -1
  104. package/dist/{index-51x0n5z0.js → index-dcy14zdn.js} +5 -5
  105. package/dist/{index-51x0n5z0.js.map → index-dcy14zdn.js.map} +1 -1
  106. package/dist/index-f6r3h2yh.js +8 -0
  107. package/dist/{index-twn9bfm2.js.map → index-f6r3h2yh.js.map} +1 -1
  108. package/dist/index-gezqawvw.js +11 -0
  109. package/dist/{index-fcsg95m5.js.map → index-gezqawvw.js.map} +1 -1
  110. package/dist/index-h787rq0h.js +12 -0
  111. package/dist/{index-wc4entme.js.map → index-h787rq0h.js.map} +3 -3
  112. package/dist/index-hd5nkwd7.js +74 -0
  113. package/dist/index-hd5nkwd7.js.map +13 -0
  114. package/dist/index-k6wq0j4q.js +6 -0
  115. package/dist/{index-gq1npngp.js.map → index-k6wq0j4q.js.map} +1 -1
  116. package/dist/index-kz01jz58.js +6 -0
  117. package/dist/{index-323jvr1g.js.map → index-kz01jz58.js.map} +1 -1
  118. package/dist/{index-kjqksgch.js → index-mgef1n4e.js} +10 -10
  119. package/dist/{index-kjqksgch.js.map → index-mgef1n4e.js.map} +1 -1
  120. package/dist/{index-haypwvzd.js → index-n197qdw1.js} +188 -188
  121. package/dist/{index-haypwvzd.js.map → index-n197qdw1.js.map} +3 -3
  122. package/dist/index-nndwx2wp.js +153 -0
  123. package/dist/{index-z157at3s.js.map → index-nndwx2wp.js.map} +2 -2
  124. package/dist/index-pz92ksp8.js +5 -0
  125. package/dist/{index-3c5jt6by.js.map → index-pz92ksp8.js.map} +1 -1
  126. package/dist/index-qj4adnfe.js +14 -0
  127. package/dist/{index-eqqd4k4f.js.map → index-qj4adnfe.js.map} +2 -2
  128. package/dist/index-r83jpct7.js +6 -0
  129. package/dist/{index-gbkma7ds.js.map → index-r83jpct7.js.map} +2 -2
  130. package/dist/{index-2zjh5zd5.js → index-rqfwd7j5.js} +4 -4
  131. package/dist/{index-2zjh5zd5.js.map → index-rqfwd7j5.js.map} +1 -1
  132. package/dist/index-s0f0s6n5.js +6 -0
  133. package/dist/{index-p1zy871m.js.map → index-s0f0s6n5.js.map} +1 -1
  134. package/dist/index-s0t15ndj.js +6 -0
  135. package/dist/{index-8edck2pr.js.map → index-s0t15ndj.js.map} +1 -1
  136. package/dist/index-tc054tcb.js +6 -0
  137. package/dist/{index-8tmv33mr.js.map → index-tc054tcb.js.map} +1 -1
  138. package/dist/{index-095hrkyr.js → index-ts8a1sdn.js} +6 -6
  139. package/dist/{index-095hrkyr.js.map → index-ts8a1sdn.js.map} +1 -1
  140. package/dist/index-tv52jhac.js +1252 -0
  141. package/dist/{index-qg9bn980.js.map → index-tv52jhac.js.map} +15 -14
  142. package/dist/index-x9nn57kk.js +6 -0
  143. package/dist/{index-1x8mzvz7.js.map → index-x9nn57kk.js.map} +1 -1
  144. package/dist/{index-ynsvkqgb.js → index-xyh98x7p.js} +4 -4
  145. package/dist/{index-ynsvkqgb.js.map → index-xyh98x7p.js.map} +1 -1
  146. package/dist/{index-ma6p7bt4.js → index-yy4v9kca.js} +4 -4
  147. package/dist/{index-ma6p7bt4.js.map → index-yy4v9kca.js.map} +1 -1
  148. package/dist/{index-bqdkm3de.js → index-yz0fcxky.js} +4 -4
  149. package/dist/{index-bqdkm3de.js.map → index-yz0fcxky.js.map} +1 -1
  150. package/dist/{index-p6ya59m6.js → index-z4adxmzm.js} +5 -5
  151. package/dist/{index-p6ya59m6.js.map → index-z4adxmzm.js.map} +1 -1
  152. package/dist/{index-4fj1k64j.js → index-zzpgsbn3.js} +4 -4
  153. package/dist/{index-4fj1k64j.js.map → index-zzpgsbn3.js.map} +1 -1
  154. package/dist/index.js +343 -343
  155. package/dist/index.js.map +7 -7
  156. package/dist/lib/source.d.ts +8 -0
  157. package/dist/lib/source.d.ts.map +1 -1
  158. package/dist/lib/types.d.ts +8 -2
  159. package/dist/lib/types.d.ts.map +1 -1
  160. package/dist/run.d.ts.map +1 -1
  161. package/dist/transcript.d.ts.map +1 -1
  162. package/dist/web-7mdrcb8a.js +14 -0
  163. package/dist/{web-zph4h3p9.js.map → web-7mdrcb8a.js.map} +1 -1
  164. package/dist/wire.d.ts +19 -0
  165. package/dist/wire.js +5 -5
  166. package/dist/wire.js.map +4 -4
  167. package/dist/wrapper-4hdmdwft.js +5 -0
  168. package/dist/{wrapper-f662ny3r.js.map → wrapper-4hdmdwft.js.map} +1 -1
  169. package/package.json +1 -1
  170. package/dist/APEv2Parser-etzjd528.js +0 -5
  171. package/dist/App-4w3qkcs4.js +0 -11
  172. package/dist/AsfParser-wd98k2h4.js +0 -5
  173. package/dist/ConfigEditor-vk7vxaa6.js +0 -6
  174. package/dist/DsdiffParser-cbfaj500.js +0 -5
  175. package/dist/FlacParser-7t7da7qy.js +0 -5
  176. package/dist/MP4Parser-gc94h1n9.js +0 -5
  177. package/dist/MusepackParser-8mq2eabg.js +0 -5
  178. package/dist/OggParser-7dnc6apg.js +0 -5
  179. package/dist/Picker-j7txnm7w.js +0 -5
  180. package/dist/SessionPicker-hpv2ncsb.js +0 -5
  181. package/dist/SkillBrowser-qc542n71.js +0 -5
  182. package/dist/WavPackParser-kt7cds9c.js +0 -5
  183. package/dist/WaveParser-g47ja0vy.js +0 -5
  184. package/dist/WizardApp-q4p979d1.js +0 -5
  185. package/dist/channels-4t89qpdt.js +0 -31
  186. package/dist/config-35r6n1gh.js +0 -24
  187. package/dist/credential-dpdgg4j6.js +0 -19
  188. package/dist/index-0444sh6x.js +0 -6
  189. package/dist/index-1x8mzvz7.js +0 -6
  190. package/dist/index-2bsardvh.js +0 -5
  191. package/dist/index-323jvr1g.js +0 -6
  192. package/dist/index-3826kf9t.js +0 -7
  193. package/dist/index-38gs9anh.js +0 -9
  194. package/dist/index-3c5jt6by.js +0 -5
  195. package/dist/index-42e29zs4.js +0 -6
  196. package/dist/index-664xcamy.js +0 -110
  197. package/dist/index-664xcamy.js.map +0 -13
  198. package/dist/index-7mn8ack9.js +0 -6
  199. package/dist/index-8edck2pr.js +0 -6
  200. package/dist/index-8h6kewy1.js +0 -9
  201. package/dist/index-8tmv33mr.js +0 -6
  202. package/dist/index-9914wh1d.js +0 -6
  203. package/dist/index-9914wh1d.js.map +0 -10
  204. package/dist/index-dzy19wtf.js +0 -6
  205. package/dist/index-eqqd4k4f.js +0 -14
  206. package/dist/index-ew997be5.js +0 -10
  207. package/dist/index-fa9wvpyw.js +0 -6
  208. package/dist/index-fcsg95m5.js +0 -11
  209. package/dist/index-gbkma7ds.js +0 -6
  210. package/dist/index-gq1npngp.js +0 -6
  211. package/dist/index-jc4kmfwa.js +0 -6
  212. package/dist/index-nvc24414.js +0 -6
  213. package/dist/index-nxhqf597.js +0 -6
  214. package/dist/index-p1zy871m.js +0 -6
  215. package/dist/index-qg9bn980.js +0 -1213
  216. package/dist/index-qgsdgbk8.js +0 -5
  217. package/dist/index-r4ax3x4d.js +0 -74
  218. package/dist/index-r4ax3x4d.js.map +0 -13
  219. package/dist/index-twn9bfm2.js +0 -8
  220. package/dist/index-wc4entme.js +0 -12
  221. package/dist/index-ytxbw8py.js +0 -63
  222. package/dist/index-z157at3s.js +0 -153
  223. package/dist/index-zce9gy22.js +0 -126
  224. package/dist/web-zph4h3p9.js +0 -14
  225. package/dist/wrapper-f662ny3r.js +0 -5
@@ -4,9 +4,9 @@
4
4
  "sourcesContent": [
5
5
  "/**\n * What you can type at a running prompt, as data.\n *\n * The outer CLI's help is generated from `COMMANDS`, so a flag the parser honours cannot be missing\n * from `--help`. The in-session help had no such link: it was a string in a component, and the two\n * drifted in both directions — `/help` was advertised by the banner and unhandled on the plain path,\n * where it was sent to the model as a prompt, while five working key chords went undocumented.\n *\n * So the same discipline applies here. One table drives dispatch *and* the help text, which closes\n * the drift for commands. Key bindings cannot be generated the same way, because they live in a\n * function rather than a table — `keyToIntent` decides what `^C` means from whether a turn is in\n * flight. The loop is closed by tests instead: every documented chord is walked through the real\n * `keyToIntent`, and every chord it honours is required to appear here.\n *\n * Pure, and free of Ink: both renderers dispatch through this, which is what keeps `--plain` and the\n * rich path from answering the same keystroke differently.\n */\n\nimport { nearest } from \"@dispach/core\"\nimport { keyValue } from \"#lib/render\"\n\nexport type SessionCommandKind =\n | \"help\"\n | \"status\"\n | \"context\"\n | \"restart\"\n | \"new\"\n | \"tools\"\n | \"reset\"\n | \"exit\"\n\nexport interface SessionCommandSpec {\n readonly kind: SessionCommandKind\n readonly word: string\n /** Accepted and not advertised individually; they appear beside the canonical word. */\n readonly aliases: readonly string[]\n readonly summary: string\n}\n\nexport const SESSION_COMMANDS: readonly SessionCommandSpec[] = [\n { kind: \"help\", word: \"/help\", aliases: [], summary: \"this list\" },\n {\n // The human twin of context slot 2. Until this existed, the *model* was told its model,\n // window, channels, server and permissions on every turn — and the person at the prompt\n // had no way to see any of it. An agent that knows more about the runtime than its operator\n // does is the same asymmetry, pointed the other way, that slot 2 was added to fix.\n kind: \"status\",\n word: \"/status\",\n aliases: [],\n summary: \"model, channels, server, store — what this agent is and what is actually running\",\n },\n {\n // The status line has carried `ctx 61%` since Phase 7A and has never said what the denominator\n // is — it is not the window, and two of its three terms are invisible from outside the\n // assembler. This is where they are written down.\n kind: \"context\",\n word: \"/context\",\n aliases: [],\n summary:\n \"what is in the prompt right now, per slot, and what the percentage is a percentage of\",\n },\n {\n kind: \"restart\",\n word: \"/restart\",\n aliases: [],\n summary:\n \"restart the agent, for any configuration changes to take effect (memory files on disk are untouched)\",\n },\n {\n kind: \"tools\",\n word: \"/tools\",\n aliases: [],\n summary: \"what the model may call, and what the catalogue costs every turn\",\n },\n {\n // Next to `/reset` deliberately: they are the pair a person picks between, and picking wrong\n // is destructive in one direction only. The summaries carry the distinction rather than the\n // names, because \"new\" and \"reset\" do not tell you which one keeps the conversation.\n kind: \"new\",\n word: \"/new\",\n aliases: [],\n summary:\n \"start a fresh conversation — this one stays in the store under its own key, and /sessions goes back to it\",\n },\n {\n kind: \"reset\",\n word: \"/reset\",\n aliases: [],\n summary:\n \"clear this conversation's history in place, keeping its key — memory files on disk are untouched\",\n },\n {\n kind: \"exit\",\n word: \"/exit\",\n aliases: [\"/quit\", \":q\"],\n // Says that it asks, because it does. The session takes the whole terminal and its buffer is\n // discarded on the way out, so leaving is not a keystroke to make by accident — the same reasoning\n // that made ^C take two presses.\n summary: \"leave — asks first, because the screen goes with it\",\n },\n]\n\nexport interface KeyBindingSpec {\n /** As shown to a reader. Ctrl chords are written `^X`, and the drift test reads them back out. */\n readonly chord: string\n readonly summary: string\n}\n\n/**\n * How to put a line break in a message, as one line of hint text.\n *\n * ⌥⏎ leads because it is the chord that works everywhere: it arrives as ESC then carriage return, which\n * is a sequence every terminal can send and Ink already parses. The backslash is the fallback for anyone\n * whose Option key is bound to something else.\n *\n * Shift+⏎ is deliberately absent. It requires the terminal to send a distinguishable sequence — kitty's\n * `CSI 13;2u`, which `terminal-setup` installs for the terminals that can be taught — and whether it\n * reaches this process cannot be detected from inside it. A hint naming a chord that silently *sends*\n * the message instead is worse than one naming only what always works.\n */\nexport const NEWLINE_HINT = \"⌥⏎ or a trailing \\\\ for a new line · ⏎ sends\"\n\n/**\n * The one line of guidance a brand-new conversation carries.\n *\n * Everything on it is true of this runtime, which is the whole reason it is written here rather than\n * copied from a screenshot of another tool: `/` really does open the palette, and `^C` really does take\n * two presses. A hint naming a chord that does something else — or nothing — is worse than no hint, and\n * this is the one screen where a person has no conversation to learn the keys from.\n */\nexport const NEW_SESSION_HINT = \"/ commands · ⏎ sends · ⇧⏎ new line · ^C twice leaves\"\n\nexport const KEY_BINDINGS: readonly KeyBindingSpec[] = [\n {\n chord: \"^C\",\n summary:\n \"cancel the turn in flight — at an idle prompt, press it twice to leave (the screen goes with it)\",\n },\n { chord: \"^D\", summary: \"leave when the line is empty; delete forward when it is not\" },\n { chord: \"^A / ^E\", summary: \"start of line / end of line\" },\n { chord: \"^B / ^F\", summary: \"back one character / forward one\" },\n { chord: \"^U / ^K\", summary: \"delete to the start of the line / to the end\" },\n { chord: \"^W\", summary: \"delete the word before the cursor\" },\n { chord: \"^P / ^N\", summary: \"previous / next of what you have already sent\" },\n {\n chord: \"↑ / ↓\",\n summary:\n \"a line up or down inside the message — the same history at its first and last line\",\n },\n {\n // Both, and the qualification belongs here rather than in the composer hint. ⌥⏎ arrives as `ESC`\n // then carriage return and works in every terminal; ⇧⏎ needs one that can distinguish it, which\n // the kitty keyboard protocol delivers where it negotiates — and where it does not, ⇧⏎ *is* ⏎ and\n // silently sends the message. A permanently-visible hint cannot carry that condition; this line\n // can, which is the split `Prompt.tsx` documents.\n chord: \"⌥⏎ / ⇧⏎\",\n summary:\n \"a new line in the message — ⌥⏎ everywhere, ⇧⏎ where the terminal can tell it apart (`keys` says); a trailing \\\\ does the same; ⏎ sends it\",\n },\n { chord: \"⌥← / ⌥→\", summary: \"back one word / forward one — ^← / ^→ do the same\" },\n { chord: \"⌥⌫ / ⌥d\", summary: \"delete the word before the cursor / after it\" },\n { chord: \"Home / End\", summary: \"start of line / end of line, the same as ^A / ^E\" },\n {\n // Cmd chords need the kitty keyboard protocol, which is negotiated at mount and simply does not\n // arrive on a terminal that declines it — so this row names the readline equivalent alongside,\n // rather than describing a chord that silently does nothing on half the terminals in use.\n chord: \"cmd← / cmd→\",\n summary: \"start of line / end of line, where the terminal reports cmd (else ^A / ^E)\",\n },\n {\n chord: \"cmd↑ / cmd↓\",\n summary: \"the start / end of the whole message, however many lines it has\",\n },\n { chord: \"cmd⌫ / cmd⌦\", summary: \"delete to the start of the line / to the end\" },\n { chord: \"cmdz / cmd⇧z\", summary: \"undo / redo, the same as ^Z / ^Y\" },\n {\n // One row for the whole family, because the rule is one sentence: shift turns any motion above\n // into a selection. Listing ten shifted chords separately would be ten rows saying that once each.\n chord: \"⇧ + any motion\",\n summary:\n \"select as the cursor moves — ⇧← a character, ⇧⌥← a word, ⇧cmd← to the line start, ⇧cmd↑ to the top; typing or ⌫ replaces what is selected\",\n },\n { chord: \"cmda\", summary: \"select the whole message\" },\n {\n chord: \"^R\",\n summary: \"search what you have already sent — ↑↓ to pick, ⏎ to use it, esc to cancel\",\n },\n {\n // Not SIGTSTP: Ink puts stdin in raw mode, so the terminal never generates the signal. Suspend\n // is genuinely gone here, which is why it is written down rather than left to be discovered.\n chord: \"^Z / ^Y\",\n summary: \"undo / redo the last edit — suspend is not available inside a session\",\n },\n {\n // Deliberately not ^U/^D, which would be the shell habit: both are already taken above, both are\n // documented, and a scroll key that silently deleted half a message is the worse bug by far.\n chord: \"PgUp / PgDn\",\n summary: \"back and forward through the conversation a screen at a time\",\n },\n { chord: \"⌥↑ / ⌥↓\", summary: \"the same, one row at a time\" },\n { chord: \"⌥PgUp / ⌥PgDn\", summary: \"the start of the conversation / back to the newest reply\" },\n {\n chord: \"^O / ⌥r\",\n summary:\n \"show the model's reasoning whole — folded to a few rows so the reply stays findable; ^O works on every terminal, ⌥r needs one that reports it\",\n },\n {\n // The one entry that is not a keystroke, and it earns its place: mouse tracking is what makes the\n // wheel scroll, and the same tracking is what stops the *terminal* selecting text — so without a\n // line here, a person reasonably concludes selection is broken rather than reimplemented.\n chord: \"drag\",\n summary:\n \"select text — in the conversation it goes to the clipboard when you let go, so ⌘V works; in the input box it does not, because you are usually about to type over it (⌘C copies, ⌘X cuts). Double-click a word, triple-click a line, esc clears\",\n },\n { chord: \"esc\", summary: \"return to the newest reply when you have scrolled away\" },\n]\n\n/**\n * Every Ctrl letter the table documents, read back out of the chord strings rather than listed\n * again — a second list is one more thing that can disagree with the first. The drift test walks\n * these through `keyToIntent` and requires every letter it honours to appear here.\n */\nexport const DOCUMENTED_CTRL_LETTERS: readonly string[] = KEY_BINDINGS.flatMap((spec) =>\n [...spec.chord.matchAll(/\\^([A-Za-z])/g)].map((match) => (match[1] ?? \"\").toLowerCase()),\n)\n\n/**\n * Every option-letter chord the table documents, read back the same way.\n *\n * The ctrl list above has had a two-way drift test since Phase 2 and the option chords never did — so\n * `⌥r` was documented, bound, handled, and reaching nothing, with no test anywhere able to say so. The\n * asymmetry was not a decision: `^` is one character to match and `⌥` is one the regex simply never\n * learned about.\n */\nexport const DOCUMENTED_META_LETTERS: readonly string[] = KEY_BINDINGS.flatMap((spec) =>\n // A *lowercase* letter that no other letter follows, which is narrower than the ctrl regex for two\n // reasons the first version of this got wrong. `⌥PgUp` starts with a capital and is a key name, so\n // a `[A-Za-z]` class extracted a phantom `⌥p` and the test failed against a chord that does not\n // exist. And a letter chord is always one letter here, so requiring nothing after it keeps a future\n // `⌥Home` out of the list too.\n [...spec.chord.matchAll(/⌥([a-z])(?![A-Za-z])/g)].map((match) => match[1] ?? \"\"),\n)\n\n/**\n * Letters a terminal sends *as* an option chord without anybody pressing them.\n *\n * `⌥←` reaches us as `ESC b` from Apple Terminal and as `CSI 1;3D` from iTerm2, so `keyToIntent` honours\n * `meta` plus the letter `b` — and that is an encoding, not a binding. Documenting `⌥b` would advertise a\n * chord nobody uses to mean a thing they already have an arrow key for. Listed here rather than dropped\n * from the check, so the exemption is a decision with a reason on it instead of a hole in the test.\n */\nexport const META_LETTERS_THAT_ARE_ARROWS: readonly string[] = [\"b\", \"f\"]\n\nexport type SessionCommand =\n | { readonly kind: SessionCommandKind; readonly rest?: string }\n /**\n * A slash command this table does not own — a CLI command, offered in a session.\n *\n * Resolved here rather than in the renderer so both paths agree about what a typed line means, and\n * carried with its arguments intact for whichever host runs it.\n */\n | { readonly kind: \"command\"; readonly name: string; readonly rest: string }\n /** Looked like a command and was not one. Refused rather than billed as a prompt. */\n | { readonly kind: \"unknown\"; readonly word: string; readonly nearest?: string }\n\n/**\n * One word starting with a slash, and nothing else on the line.\n *\n * Deliberately narrow, because the alternative costs real messages. `/etc/passwd is world-readable`\n * and `and/or` are things a person says to an agent; a second slash or a space means this is prose\n * and goes to the model untouched. What remains — a lone `/word` — can only have been meant as a\n * command, so getting it wrong is worth reporting.\n */\nconst COMMAND_SHAPE = /^\\/[A-Za-z][\\w-]*$/\n\n/**\n * The same word, followed by arguments.\n *\n * The narrow rule above still decides everything it can, and this only adds a case it cannot reach:\n * `/logs 200` and `/skills validate` need a space, which the narrow rule reads as prose. The escape is\n * **the first token being exactly a known command** — decidable from the tables alone, with no\n * heuristic. So `/etc/passwd is world-readable` still goes to the model, because `/etc` is not a\n * command; and a mistyped `/skils validate` is prose rather than a refusal, which is the one thing this\n * loosening costs and the cheaper of the two errors.\n */\nconst COMMAND_WITH_ARGS = /^(\\/[A-Za-z][\\w-]*)\\s+(.*)$/\n\nconst KNOWN = new Map<string, SessionCommandKind>(\n SESSION_COMMANDS.flatMap((spec) =>\n [spec.word, ...spec.aliases].map((word) => [word.toLowerCase(), spec.kind] as const),\n ),\n)\n\n/**\n * `undefined` means \"this is a prompt\" — the overwhelming majority of lines.\n *\n * `offered` is the set of CLI command names a session exposes, passed in rather than imported: this\n * module is dispatch and `commands.ts` is the table, and importing one into the other would put the\n * whole command surface behind every consumer of `resolveSessionCommand`, including the plain path.\n */\nexport function resolveSessionCommand(\n text: string,\n offered: readonly string[] = [],\n): SessionCommand | undefined {\n const trimmed = text.trim()\n const kind = KNOWN.get(trimmed.toLowerCase())\n if (kind !== undefined) return { kind }\n\n const names = new Set(offered)\n if (names.has(trimmed.slice(1).toLowerCase()) && COMMAND_SHAPE.test(trimmed)) {\n return { kind: \"command\", name: trimmed.slice(1).toLowerCase(), rest: \"\" }\n }\n\n const withArgs = COMMAND_WITH_ARGS.exec(trimmed)\n if (withArgs !== null) {\n const head = (withArgs[1] ?? \"\").toLowerCase()\n const rest = withArgs[2] ?? \"\"\n const known = KNOWN.get(head)\n if (known !== undefined) return { kind: known, rest }\n if (names.has(head.slice(1))) {\n return { kind: \"command\", name: head.slice(1), rest }\n }\n // Not a known first token, so the narrow rule stands and this is prose.\n return undefined\n }\n\n if (!COMMAND_SHAPE.test(trimmed)) return undefined\n\n const suggestion = nearest(trimmed.toLowerCase(), [\n ...KNOWN.keys(),\n ...offered.map((name) => `/${name}`),\n ])\n return {\n kind: \"unknown\",\n word: trimmed,\n ...(suggestion === undefined ? {} : { nearest: suggestion }),\n }\n}\n\nconst COMMAND_COLUMN = 20\n\nfunction commandLine(spec: SessionCommandSpec): string {\n const forms = [spec.word, ...spec.aliases].join(\" / \")\n return ` ${forms.padEnd(COMMAND_COLUMN)}${spec.summary}`\n}\n\nfunction keyLine(spec: KeyBindingSpec): string {\n return ` ${spec.chord.padEnd(COMMAND_COLUMN)}${spec.summary}`\n}\n\n/** Generated, so a command the prompt honours cannot be missing from it. */\nexport function sessionHelpText(): string {\n return [\n \"commands:\",\n ...SESSION_COMMANDS.map(commandLine),\n \"\",\n \"keys:\",\n ...KEY_BINDINGS.map(keyLine),\n ].join(\"\\n\")\n}\n\nexport function unknownCommandText(command: {\n readonly word: string\n readonly nearest?: string\n}): string {\n const suggestion = command.nearest === undefined ? \"\" : ` Did you mean ${command.nearest}?`\n return `${command.word} is not a command.${suggestion} Type /help for the list — or add a space if you meant to say it to the model.`\n}\n\n/** The narrow slice of an agent `/tools` reports on. Structural, so core owns no CLI shapes. */\nexport interface ToolsView {\n readonly dialect: string\n readonly catalogueTokens: number\n readonly tools: readonly {\n readonly slug: string\n readonly mutating: boolean\n /**\n * Whether this tool's output may carry text a stranger wrote.\n *\n * Shown because it is not cosmetic: an untrusted tool taints the turn, and after it has run\n * a mutating call needs an explicit rule or a live approval. \"Why did my second `exec` get\n * blocked?\" is answered by this column and by nothing else on this surface.\n */\n readonly trust: string\n /**\n * Why a tool declares itself trusted when a provider tool defaults to untrusted.\n *\n * Shown here rather than warned about at boot. The warning fired on every start of every agent\n * using the system provider — four tools whose output the runtime composed — and a warning that\n * is always present for a correct configuration is one people stop reading. The reason belongs\n * where someone is already looking at the catalogue.\n */\n readonly trustReason?: string\n readonly summary: string\n }[]\n}\n\n/**\n * The part of an agent this needs, stated structurally.\n *\n * `Agent` satisfies it without being named, which keeps the projection below testable with a plain\n * object rather than a live runtime — and a projection nobody can test is one that quietly stops\n * matching what it projects.\n */\nexport interface AgentToolsSource {\n describe(): { readonly dialect: string; readonly catalogueTokens: number }\n readonly tools: {\n specs(): readonly {\n readonly slug: string\n readonly mutating: boolean\n /** Optional here because it is optional on `ToolSpec`; the registry settles it. */\n readonly trust?: string\n readonly trustReason?: string\n readonly summary: string\n }[]\n }\n}\n\n/** Here rather than in each renderer, so the two cannot show different things. */\nexport function toolsView(agent: AgentToolsSource): ToolsView {\n const described = agent.describe()\n return {\n dialect: described.dialect,\n catalogueTokens: described.catalogueTokens,\n tools: agent.tools.specs().map((spec) => ({\n slug: spec.slug,\n mutating: spec.mutating,\n // Already normalised by the registry, so the fallback is unreachable for anything that\n // came through one — but `ToolSpec.trust` is optional in the type, and a view that\n // silently printed nothing would be the wrong way to find that out.\n trust: spec.trust ?? \"trusted\",\n ...(spec.trustReason === undefined ? {} : { trustReason: spec.trustReason }),\n summary: spec.summary,\n })),\n }\n}\n\n/**\n * What the model can actually call.\n *\n * Worth a command because the catalogue is resolved once at load and is otherwise invisible: when a\n * model will not call a tool you believe is pinned, whether it is *in* the catalogue is the first\n * question, and `catalogueTokens` is the recurring cost of every turn in the session.\n */\nexport function toolsReport(view: ToolsView): string {\n if (view.tools.length === 0) {\n return `no tools — this agent pinned none, so the model can only reply. Add them under tools.local or tools.pinned. (call format ${view.dialect})`\n }\n\n const pad = view.tools.reduce((longest, tool) => Math.max(longest, tool.slug.length), 0)\n const rows = view.tools.flatMap((tool) => [\n ` ${tool.slug.padEnd(pad)} ${tool.mutating ? \"write\" : \"read \"} ${\n tool.trust === \"untrusted\" ? \"untrusted\" : \"trusted \"\n } ${tool.summary}`,\n // Only a tool that opted out of the untrusted default has one, so this is rare and worth the\n // line when it appears: it is the difference between a fence someone removed on purpose and one\n // a package forgot.\n // Aligned under the summary column: 2 leading spaces, the slug, and the two fixed columns\n // with their separators. Computed rather than hardcoded, or it drifts the first time a column\n // changes width.\n ...(tool.trustReason === undefined\n ? []\n : [`${\" \".repeat(2 + pad + 2 + 5 + 2 + 9 + 2)}trusted: ${tool.trustReason}`]),\n ])\n return [\n // \"dialect nlt\" led the line once and read as a third tool — and asked about it, the model\n // guessed NLTK, because the dialect is harness plumbing it is never told the name of. The\n // count leads; the protocol is labelled as what it is.\n `${view.tools.length} tool${view.tools.length === 1 ? \"\" : \"s\"} · call format ${view.dialect} · catalogue ${view.catalogueTokens} tokens, on every turn`,\n ...rows,\n ].join(\"\\n\")\n}\n\n/**\n * Everything `/context` needs, gathered by the host.\n *\n * A view rather than the agent itself, for the reason every view in this file is one: the report is a\n * pure function of these numbers, and a test that has to boot a runtime to check an arithmetic line\n * is a test nobody writes.\n */\nexport interface ContextView {\n readonly slots: readonly {\n readonly slot: number\n readonly label: string\n readonly tokens: number\n readonly pinned: boolean\n }[]\n /** What the history slot is made of, largest first. Empty on a conversation with no history. */\n readonly history: readonly {\n readonly label: string\n readonly tokens: number\n readonly messages: number\n }[]\n readonly total: number\n readonly window: number\n /** Already rendered by `describeWindowSource` — the CLI owns no second wording for it. */\n readonly windowSource: string\n readonly wireTokens: number\n readonly reserveOutput: number\n readonly calibration: { readonly ratio: number; readonly samples: number }\n /** The last compaction stage this session ran, if any. */\n readonly lastCompaction: string | undefined\n /** Undefined when no turn's endpoint reported a cache figure — not the same as nothing cached. */\n readonly cache:\n | {\n readonly cached: number\n readonly prompt: number\n readonly turns: number\n readonly source: string\n }\n | undefined\n}\n\n/**\n * `/context` — what is in the prompt right now, and what the percentage is a percentage *of*.\n *\n * The status line has carried `ctx 61%` since Phase 7A without ever saying what the denominator is,\n * and it is not the window: `assembleContext` is handed `window − wireTokens` and then subtracts\n * `reserveOutput` from that. Three terms, two of them invisible. So the budget line is written out as\n * the subtraction rather than as a result — a reader who disagrees with the number can see which term\n * they disagree with.\n *\n * `estimated` versus `corrected` is the other thing worth a line. The estimator runs **16–20% low**\n * on the prompts that matter (`evals/budget`, measured over a session filling with tool results),\n * which is the overflow direction exactly when the window is tight; a percentage from a session with\n * no samples yet is that raw estimate, and the reader deserves to know which one they are reading.\n */\nexport function contextReport(view: ContextView): string {\n const budget = Math.max(1, view.window - view.wireTokens - view.reserveOutput)\n const percent = ((view.total / budget) * 100).toFixed(1)\n const trust =\n view.calibration.samples === 0\n ? // Deliberately short: at 100 columns the longer version wrapped, and a wrapped value in a\n // `keyValue` block loses its alignment. \"estimated\" already carries \"no figure yet\"; what\n // it does not carry is the direction of the error, and that is the half worth the words.\n \"estimated — the estimator runs low on tool-heavy prompts\"\n : `corrected ×${view.calibration.ratio.toFixed(2)} from ${view.calibration.samples} reported ${view.calibration.samples === 1 ? \"figure\" : \"figures\"}`\n // Widest label decides the column, so a slot named later cannot push the numbers out of line.\n const pad = view.slots.reduce((longest, entry) => Math.max(longest, entry.label.length), 0)\n const slots = view.slots.map(\n (entry) =>\n ` ${String(entry.slot).padStart(2)} ${entry.label.padEnd(pad)} ${String(entry.tokens).padStart(6)}${entry.pinned ? \" pinned\" : \"\"}`,\n )\n // Indented under the history slot it decomposes, and only when there is something to decompose:\n // a fresh session's empty breakdown would be a heading with nothing under it.\n const historyPad = view.history.reduce((longest, e) => Math.max(longest, e.label.length), 0)\n const historyRows =\n view.history.length === 0\n ? []\n : view.history.map(\n (entry) =>\n ` ${entry.label.padEnd(historyPad)} ${String(entry.tokens).padStart(6)} ${percentOf(entry.tokens, view.total).padStart(6)} ${String(entry.messages).padStart(3)} msg`,\n )\n\n return [\n keyValue([\n { label: \"window\", value: `${view.window} (${view.windowSource})` },\n {\n label: \"budget\",\n // Written as the subtraction on purpose. `wireTokens` is zero under `nlt` and the term\n // is still printed: a zero that is shown is a term a reader can rule out, and a term\n // that is absent is one they have to know about to miss.\n value: `${budget} = window ${view.window} − wire ${view.wireTokens} − reserveOutput ${view.reserveOutput}`,\n },\n { label: \"prompt\", value: `${view.total} tokens · ${percent}% of budget` },\n { label: \"counted\", value: trust },\n {\n label: \"compaction\",\n value: view.lastCompaction ?? \"none this session\",\n },\n // Absent rather than \"0%\" when nothing reported: an endpoint that caches nothing and one\n // that declines to say are the same bill and opposite conclusions, and only one of them\n // is a reason to go looking at the prefix.\n {\n label: \"cache\",\n value:\n view.cache === undefined\n ? \"not reported by this endpoint\"\n : `${view.cache.cached} of ${view.cache.prompt} prompt tokens (${percentOf(view.cache.cached, view.cache.prompt)}) over ${view.cache.turns} turn${view.cache.turns === 1 ? \"\" : \"s\"} · ${view.cache.source}`,\n },\n ]),\n \"\",\n \" slots\",\n ...slots,\n // The heading names the denominator, because these are shares of the *whole prompt* and not of\n // the history — so they do not sum to 100 and, unlabelled, read as an arithmetic bug. Total is\n // the right denominator anyway: the question is what fraction of the bill each kind is, which\n // makes these directly comparable with the slot figures above.\n ...(historyRows.length === 0\n ? []\n : [\"\", \" history, by kind — share of the whole prompt\", ...historyRows]),\n ].join(\"\\n\")\n}\n\n/** A share, to one decimal, with the degenerate denominator handled rather than printed as NaN. */\nfunction percentOf(part: number, whole: number): string {\n return whole <= 0 ? \"—\" : `${((part / whole) * 100).toFixed(1)}%`\n}\n",
6
6
  "/**\n * The slash-command palette: what a partially typed `/word` could mean.\n *\n * ## Generated, not listed\n *\n * The entries come from two tables that already exist. `SESSION_COMMANDS` holds the verbs that only make\n * sense inside a session — `/help`, `/reset`, `/exit` — and `COMMANDS` holds the whole CLI, with every\n * flag, every `choices` value and every summary already written down for `--help`.\n *\n * Reading `COMMANDS` rather than a second list is the load-bearing decision. A flag added to the CLI\n * appears in the TUI with nothing to remember, which is the discipline `session-commands.ts`'s own header\n * argues for after watching `/help` drift in both directions when it was a string in a component. A\n * command that should not be offered in a session declares `inSession: \"hidden\"` — hiding by omission\n * from a hand-written list is the same drift wearing a different hat, and a required field means a new\n * command cannot be silently absent instead.\n *\n * ## Pure\n *\n * Derived from the editor's value, so the only state the renderer adds is a cursor index. No filesystem,\n * no process, no renderer — PURE-listed, and the matching rules are asserted as data.\n */\n\nimport { COMMANDS } from \"#lib/commands\"\nimport type { CommandSpec } from \"#lib/schema\"\nimport { SESSION_COMMANDS } from \"#lib/session-commands\"\n\nexport interface PaletteEntry {\n /** With the slash, as it would be typed. */\n readonly word: string\n readonly summary: string\n /**\n * `session` — dispatched by `resolveSessionCommand`.\n * `view` — a bespoke screen.\n * `output` — run the command and show what it printed.\n */\n readonly kind: \"session\" | \"view\" | \"output\"\n /** Present for a CLI command, so a host can read its flags and actions. */\n readonly spec?: CommandSpec\n}\n\n/**\n * Every entry a session offers, session verbs first.\n *\n * Session verbs lead because they are the ones with no shell equivalent and the ones typed most: `/help`\n * and `/exit` at the top of an unfiltered list is what makes the palette answer \"what can I do here\"\n * rather than \"what commands exist\".\n */\nexport function paletteEntries(): readonly PaletteEntry[] {\n const session: PaletteEntry[] = SESSION_COMMANDS.map((spec) => ({\n word: spec.word,\n summary: spec.summary,\n kind: \"session\" as const,\n }))\n const own = new Set(session.map((entry) => entry.word))\n const commands: PaletteEntry[] = COMMANDS.filter((spec) => spec.inSession !== \"hidden\")\n // A CLI command whose name collides with a session verb loses: `/tools` inside a session means\n // the running agent's catalogue, not a fresh load of the manifest from disk.\n .filter((spec) => !own.has(`/${spec.name}`))\n .map((spec) => ({\n word: `/${spec.name}`,\n summary: spec.summary,\n kind: spec.inSession === \"view\" ? (\"view\" as const) : (\"output\" as const),\n spec,\n }))\n return [...session, ...commands]\n}\n\nexport interface Palette {\n /** What has been typed after the slash, lowercased. */\n readonly query: string\n readonly matches: readonly PaletteEntry[]\n}\n\n/**\n * The palette for a buffer, or `undefined` when the buffer is not a slash command being typed.\n *\n * Open only while the *whole* buffer is one `/word` under construction. Two consequences, both\n * deliberate: a message that merely mentions a path never opens it, and once arguments are being typed\n * the list closes, because there is nothing left to complete and a list covering the line would hide\n * what is being written.\n */\nexport function paletteFor(\n value: string,\n entries: readonly PaletteEntry[] = paletteEntries(),\n): Palette | undefined {\n if (!/^\\/[A-Za-z-]*$/.test(value)) return undefined\n const query = value.slice(1).toLowerCase()\n const matches = entries.filter((entry) => entry.word.slice(1).toLowerCase().startsWith(query))\n // Prefix, not fuzzy. A palette that offers `/sessions` for `/st` reads as noise, and the words are\n // short enough that a prefix always reaches them in two or three characters.\n return { query, matches }\n}\n\n/** The entry a cursor is on, clamped, or `undefined` when nothing matches. */\nexport function paletteSelection(palette: Palette, index: number): PaletteEntry | undefined {\n if (palette.matches.length === 0) return undefined\n return palette.matches[Math.max(0, Math.min(index, palette.matches.length - 1))]\n}\n\n/**\n * The command names a typed slash line may use, without the leading slash.\n *\n * `resolveSessionCommand` takes this list, and it defaulted to empty at the one call site that mattered\n * — so a typed `/config get x` was prose and the same command chosen from the palette ran. Derived from\n * the palette rather than from `COMMANDS` directly, because the palette is what the person was just\n * shown: anything offered there has to be typeable, and anything typeable has to be offered.\n */\nexport function offeredCommands(): readonly string[] {\n return paletteEntries()\n .filter((entry) => entry.kind !== \"session\")\n .map((entry) => entry.word.slice(1))\n}\n",
7
- "/**\n * Events in, view state out. Pure, and the only place that decides what a turn looks like.\n *\n * The CLI has always been a `runtime.bus` subscriber; this makes it a *reducer* over that bus\n * instead of a set of callbacks writing to stdout. Three things follow from that:\n *\n * - \"What does the reader see when a turn errors mid-stream?\" is a unit test rather than something\n * reproduced by hand against a live endpoint.\n * - Finished items are append-only and immutable, which is exactly the contract Ink's `<Static>`\n * needs: a node written once and never re-rendered. The still-moving reply lives in `live`, so\n * the dynamic region stays one item regardless of how long the conversation gets.\n * - Phase 4's SSE client and Phase 12's TUI client can consume the same reduction instead of\n * re-deriving it.\n *\n * No clock and no randomness: ids come from a counter in the state, so the same events always\n * produce the same output and the tests need no fakes.\n */\n\nimport { type AnyEvent, endNote, SUBMIT_ARTIFACT } from \"@dispach/core\"\nimport { MAX_TRANSCRIPT_ITEMS, REASONING_FOLD_ROWS } from \"#lib/const\"\nimport { compactTokens } from \"#lib/rows\"\nimport { ROLE_PREFIX } from \"#lib/theme\"\nimport type {\n SubagentView,\n TranscriptItem,\n TranscriptRole,\n TranscriptRow,\n TranscriptState,\n TurnStats,\n} from \"#lib/types\"\nimport { wrapText } from \"#lib/wrap\"\n\n/**\n * The transcript is driven by more than the bus — a typed line and a cancellation request are not\n * events — so the reducer takes an action union rather than an event directly.\n */\nexport type TranscriptAction =\n | { readonly kind: \"user\"; readonly text: string }\n | { readonly kind: \"event\"; readonly event: AnyEvent }\n | { readonly kind: \"note\"; readonly text: string }\n | { readonly kind: \"cancelling\" }\n /**\n * A model delta that has already been through the dialect's stream filter.\n *\n * Filtering cannot happen in here: a filter is stateful and this reducer is pure. So the caller\n * owns one per step and dispatches what is left. A caller that dispatches the raw `model.chunk`\n * event instead still works — it just shows the invocation blocks, which is right for a dialect\n * with no in-band protocol and wrong for NLT.\n */\n | { readonly kind: \"delta\"; readonly of: \"text\" | \"reasoning\"; readonly text: string }\n /**\n * Drop the oldest items if the buffer is over `MAX_TRANSCRIPT_ITEMS`.\n *\n * An action rather than something `append` does on its own, because whether it is *safe* depends on\n * a fact this reducer cannot see: rows are addressed by position, so dropping any from the front\n * moves every offset below them. A reader parked twelve turns back would keep their offset and\n * silently start reading different text — the appearance of a live session that is not one, which is\n * the failure `ScrollState.pinned` exists to make impossible. Only the layer holding that flag knows\n * when eviction is allowed, so only it can ask.\n */\n | { readonly kind: \"trim\" }\n\nexport const EMPTY_TRANSCRIPT: TranscriptState = {\n items: [],\n live: undefined,\n status: \"idle\",\n nextId: 0,\n turnFrom: undefined,\n}\n\nfunction append(\n state: TranscriptState,\n role: TranscriptRole,\n text: string,\n extra: {\n readonly stats?: TurnStats\n readonly callId?: string\n readonly pending?: boolean\n } = {},\n): TranscriptState {\n const item: TranscriptItem = {\n id: `t${state.nextId}`,\n role,\n text,\n ...(extra.stats === undefined ? {} : { stats: extra.stats }),\n ...(extra.callId === undefined ? {} : { callId: extra.callId }),\n ...(extra.pending === undefined ? {} : { pending: extra.pending }),\n }\n return { ...state, items: [...state.items, item], nextId: state.nextId + 1 }\n}\n\n/**\n * Commit whatever the model has streamed so far, and clear it.\n *\n * Called at each step boundary rather than once at the end of the turn, which is what puts the\n * transcript back in the order things happened. Committing at `turn.end` alone produced a turn shaped\n * \"every tool row, then all the reasoning, then all the text\" — so the reasoning that *decided* to call\n * a tool was printed below the tool's result, and step one's reasoning was concatenated onto step two's\n * with no break between them. Live output on a real turn read `…look for it in my workspace.The user is\n * asking me to…`, two sentences from two steps with nothing marking the join.\n *\n * Reasoning goes in ahead of the text it produced. Whether it is *shown* is the view's business — the\n * item is written either way, so `--show-reasoning` can be honoured after the fact.\n */\nfunction flushLive(state: TranscriptState): TranscriptState {\n const live = state.live\n if (live === undefined) return state\n let next = state\n if (live.reasoning !== \"\") next = append(next, \"reasoning\", live.reasoning)\n if (live.text !== \"\") next = append(next, \"assistant\", live.text)\n return { ...next, live: undefined }\n}\n\n/** `data` is typed per event in core's map; narrowing by `type` first is what makes this safe. */\nexport function reduce(state: TranscriptState, action: TranscriptAction): TranscriptState {\n switch (action.kind) {\n case \"user\":\n return append(state, \"user\", action.text)\n\n case \"note\":\n return append(state, \"note\", action.text)\n\n case \"cancelling\":\n // A state, not an item. Cancellation that produced partial text still ends in a\n // `turn.end`, and that is what commits the text.\n return state.status === \"idle\" ? state : { ...state, status: \"cancelling\" }\n\n case \"delta\":\n return applyDelta(state, action.of, action.text)\n\n case \"event\":\n return reduceEvent(state, action.event)\n\n case \"trim\":\n return trim(state)\n }\n}\n\n/**\n * The oldest items above the cap, dropped. Identity when there is nothing to do.\n *\n * Returning the same object rather than a copy is what makes this cheap to ask about: `useReducer`\n * compares by reference and skips the render, so the caller can dispatch on every change without\n * checking first — and a caller that has to check first is a caller that eventually forgets.\n *\n * The banner is an ordinary item and goes with the rest. It is four hundred turns of scrollback above\n * the reader by then, and exempting it would leave the session's opening line pinned above a\n * conversation it no longer describes.\n */\nfunction trim(state: TranscriptState): TranscriptState {\n const over = state.items.length - MAX_TRANSCRIPT_ITEMS\n return over <= 0 ? state : { ...state, items: state.items.slice(over) }\n}\n\nfunction applyDelta(\n state: TranscriptState,\n kind: \"text\" | \"reasoning\",\n delta: string,\n): TranscriptState {\n if (delta === \"\") return state\n const live = state.live ?? { text: \"\", reasoning: \"\", last: undefined }\n return {\n ...state,\n live: {\n text: kind === \"text\" ? live.text + delta : live.text,\n reasoning: kind === \"reasoning\" ? live.reasoning + delta : live.reasoning,\n last: kind,\n },\n // A cancellation already asked for is not undone by another token arriving in flight; the\n // request stands until the turn actually ends.\n status: state.status === \"cancelling\" ? \"cancelling\" : \"streaming\",\n }\n}\n\n/** The tool row `match` picks, with its subagent replaced. Unchanged state when no row matches. */\nfunction withSubagent(\n state: TranscriptState,\n match: (item: TranscriptItem) => boolean,\n change: (view: SubagentView | undefined, item: TranscriptItem) => SubagentView | undefined,\n): TranscriptState {\n const at = state.items.findIndex(match)\n if (at === -1) return state\n const items = [...state.items]\n const item = items[at] as TranscriptItem\n const view = change(item.subagent, item)\n if (view === undefined) return state\n items[at] = { ...item, subagent: view }\n return { ...state, items }\n}\n\n/**\n * A subagent's own event: its tool calls become lines under the routed call's row. Its text and\n * turn events stay out of the conversation, which is the parent's; `handoff.result` reports the end.\n */\nfunction reduceChild(state: TranscriptState, event: AnyEvent): TranscriptState {\n const mine = (item: TranscriptItem) => item.subagent?.sessionKey === event.sessionKey\n // The child's return channel is how it hands back its answer, not work it did for the person.\n if (\"slug\" in event.data && event.data.slug === SUBMIT_ARTIFACT) return state\n switch (event.type) {\n case \"tool.call\":\n return withSubagent(state, mine, (view) =>\n view === undefined\n ? undefined\n : {\n ...view,\n lines: [\n ...view.lines,\n { callId: event.data.callId, text: `${event.data.slug} …` },\n ],\n },\n )\n case \"tool.result\": {\n const { slug, callId, ok, latencyMs } = event.data\n const text = `${slug} — ${ok ? \"ok\" : \"failed\"} · ${latencyMs} ms`\n return withSubagent(state, mine, (view) =>\n view === undefined\n ? undefined\n : {\n ...view,\n lines: view.lines.some((line) => line.callId === callId)\n ? view.lines.map((line) =>\n line.callId === callId ? { callId, text } : line,\n )\n : [...view.lines, { callId, text }],\n },\n )\n }\n case \"tool.gated\":\n return withSubagent(state, mine, (view) =>\n view === undefined\n ? undefined\n : {\n ...view,\n lines: [\n ...view.lines,\n { text: `${event.data.slug} — blocked: ${event.data.reason}` },\n ],\n },\n )\n default:\n return state\n }\n}\n\nfunction reduceEvent(state: TranscriptState, event: AnyEvent): TranscriptState {\n if (event.parentTurnId !== undefined) return reduceChild(state, event)\n switch (event.type) {\n case \"handoff.start\": {\n const { kind, name, callId, sessionKey } = event.data\n if (kind !== \"self\" || callId === undefined) return state\n return withSubagent(\n state,\n (item) => item.callId === callId,\n () => ({ name: name ?? \"subagent\", sessionKey, lines: [] }),\n )\n }\n\n case \"handoff.result\": {\n const { sessionKey, steps, tokens, outcome } = event.data\n const summary = `${steps} step${steps === 1 ? \"\" : \"s\"} · ${compactTokens(tokens.prompt + tokens.output)} tokens · ${outcome === \"ok\" ? \"ok\" : outcome.replace(\"_\", \" \")}`\n return withSubagent(\n state,\n (item) => item.subagent?.sessionKey === sessionKey,\n (view) => (view === undefined ? undefined : { ...view, summary }),\n )\n }\n\n case \"turn.start\":\n return {\n ...state,\n live: { text: \"\", reasoning: \"\", last: undefined },\n status: \"thinking\",\n turnFrom: state.items.length,\n }\n\n case \"model.result\":\n // The step boundary. `model.result` is emitted once per model call, so this is where a step's\n // reasoning and text stop growing — no new event was needed to find it.\n return flushLive(state)\n\n case \"model.chunk\":\n return applyDelta(state, event.data.kind, event.data.delta)\n\n case \"tool.call\":\n // Committed the moment the call starts, not when it returns: a tool that takes eight\n // seconds must not leave the screen looking like a stalled model. Anything the model\n // streamed before deciding to call it is flushed first, so the reasoning sits above the\n // call it explains rather than below the call's result.\n return {\n ...append(\n flushLive(state),\n \"tool\",\n `${event.data.slug}${event.data.mutating ? \" (changes state)\" : \"\"}`,\n { callId: event.data.callId, pending: true },\n ),\n status: state.status === \"cancelling\" ? \"cancelling\" : \"working\",\n }\n\n case \"tool.result\": {\n const { slug, callId, ok, latencyMs, truncated } = event.data\n const text = `${slug} — ${ok ? \"ok\" : \"failed\"} · ${latencyMs} ms${truncated ? \" · observation trimmed\" : \"\"}`\n // The call's own row, completed. Matched on `callId` rather than on position, because calls\n // can overlap and \"the last tool row\" is then not the row this result belongs to.\n const at = state.items.findIndex(\n (item) => item.callId === callId && item.pending === true,\n )\n if (at === -1) {\n // No row to complete — a result for a call this transcript never saw. Appended rather\n // than dropped: an observation nobody can account for is exactly the thing worth seeing.\n return append(state, ok ? \"tool\" : \"error\", text)\n }\n const items = [...state.items]\n const item = items[at] as TranscriptItem\n items[at] = {\n id: item.id,\n role: ok ? \"tool\" : \"error\",\n text,\n callId,\n // The routed call's block outlives its own completion: the child's lines are the point.\n ...(item.subagent === undefined ? {} : { subagent: item.subagent }),\n }\n return { ...state, items }\n }\n\n case \"tool.gated\":\n // Deliberately visible. A blocked write is the one tool outcome a person must not have\n // to go looking for — and it is a `note` rather than an `error` because the wire spec is\n // explicit that this is not one: the turn continues and the model reports back.\n return append(state, \"note\", `${event.data.slug} — blocked: ${event.data.reason}`)\n\n case \"tool.repair\":\n // A silent repair is indistinguishable from a slow turn, and it costs a whole step. With no\n // slugs it is the runtime's nudge (14.123), not a tool that failed, and says so.\n return append(\n state,\n \"note\",\n event.data.slugs.length === 0\n ? `reply stopped short (${event.data.errors.join(\"; \")}), asking the model to finish`\n : `${event.data.slugs.join(\", \")} — could not be used, asking the model again`,\n )\n\n case \"model.retry\": {\n const { status, attempt, delayMs } = event.data\n return append(\n state,\n \"note\",\n `retrying after HTTP ${status} — attempt ${attempt}, waiting ${delayMs} ms`,\n )\n }\n\n case \"turn.end\": {\n const { reason, steps, tokens, durationMs } = event.data\n const stats: TurnStats = {\n promptTokens: tokens.prompt,\n outputTokens: tokens.output,\n durationMs,\n steps,\n reason,\n }\n\n // Whatever the last step streamed but never got a `model.result` for — a cancelled turn, or\n // one that ended on an error mid-stream. On a clean turn this is a no-op, because each step\n // committed itself as it finished.\n const next = flushLive(state)\n const from = state.turnFrom ?? 0\n // The reply this turn produced, which is where its cost belongs. Searched from the turn's own\n // first item: without that floor, a turn that produced no text would hang its statistics on\n // the *previous* turn's reply, which reads as that reply having cost twice.\n let reply = -1\n for (let at = next.items.length - 1; at >= from; at -= 1) {\n if (next.items[at]?.role === \"assistant\") {\n reply = at\n break\n }\n }\n // Why the turn stopped, from the formatter the plain path uses. Until this existed\n // `stats.reason` reached the reducer and was rendered nowhere, so a turn the step budget\n // cut off looked exactly like a completed one — which is how an agent came to stop\n // mid-task on \"Let me install it\" with nothing on screen explaining it.\n const why = endNote(reason, { steps, durationMs })\n\n if (reply === -1) {\n // A turn that produced nothing is not a normal outcome and must not look like one.\n const said = append(\n next,\n \"note\",\n why ?? (reason === \"final\" ? \"the model returned no text\" : \"\"),\n { stats },\n )\n return { ...said, live: undefined, status: \"idle\", turnFrom: undefined }\n }\n const items = [...next.items]\n const item = items[reply] as TranscriptItem\n items[reply] = { ...item, stats }\n const settled: TranscriptState = {\n ...next,\n items,\n live: undefined,\n status: \"idle\",\n turnFrom: undefined,\n }\n // Below the reply, not attached to it: the reply is what the model said, and this is what\n // the runtime did. Attaching it to the item would put a harness sentence in the model's\n // voice — the distinction `note` exists for.\n return why === undefined ? settled : append(settled, \"note\", why)\n }\n\n // `agent.error` used to fall through to here. It was declared in Phase 1, carried a\n // hint, and was emitted by **nothing, ever** — so this label was reachable only from a\n // test that constructed one by hand. Deleted rather than wired up: `error` already\n // carries every uncaught failure, and a second error event with no emitter is vocabulary\n // that makes the catalogue look richer than it is.\n case \"error\": {\n const { code, message, hint } = event.data\n return append(state, \"error\", `${code}: ${message}\\nhint: ${hint}`)\n }\n\n case \"context.dropped\": {\n const { messages, budget } = event.data\n // A note, not a stage line: the ladder decided what to compact and this is the budget\n // running out regardless. Worth saying because the agent is now answering without part of\n // the conversation, and nothing else on any surface would mention it.\n return append(\n state,\n \"note\",\n `context: ${messages} older message(s) did not fit the ${budget}-token budget and were left out`,\n )\n }\n\n case \"agent.warning\": {\n const { code, message } = event.data\n return append(state, \"note\", `${code}: ${message}`)\n }\n\n case \"context.pressure\":\n // A gauge, so it replaces rather than accumulates. `source` is deliberately not shown: it\n // is diagnostic and the status line has no room for a word that changes nothing a person\n // would do — it is on the event for whoever is reading events.\n return { ...state, pressure: event.data.fraction }\n\n case \"compaction.stage\": {\n const { stage, changed, before, after } = event.data\n // Only the stages that destroy detail get a line. trim, snip and micro are recoverable —\n // the conversation is still in the store and a snipped observation keeps a pointer — while\n // collapse and reset replace a span of the conversation with a summary, and a person who\n // was not watching the gauge still needs to know that happened.\n if (!changed || (stage !== \"collapse\" && stage !== \"reset\")) return state\n const what =\n stage === \"reset\"\n ? \"the conversation so far was replaced by a summary\"\n : \"earlier turns were replaced by a summary\"\n return append(state, \"note\", `context: ${what} (${before} → ${after} tokens)`)\n }\n\n case \"phase.changed\": {\n const { to, tools } = event.data\n // A line *and* the gauge. The line because a phase change is the reason the agent's\n // abilities changed mid-conversation, and a person scrolling back needs it where it\n // happened; the gauge because \"which phase am I in\" is a current-state question.\n const next = append(\n state,\n \"note\",\n `phase: now in ${to} · ${tools} tool${tools === 1 ? \"\" : \"s\"} available`,\n )\n return { ...next, phase: to }\n }\n\n case \"context.reset\": {\n const { warning } = event.data\n // The count itself is not shown — the note above already said what happened. A *second*\n // reset is a configuration problem rather than a busy session, and that is worth a line.\n return warning === undefined ? state : append(state, \"note\", `context: ${warning}`)\n }\n\n default:\n // Boot and bookkeeping events — `runtime.ready`, `store.ready`, `model.call`,\n // `context.assembled`. They belong to the banner and the status bar, not the transcript. Ignored explicitly so that a new event type added in a later\n // phase is inert here rather than a crash.\n return state\n }\n}\n\n/** What a renderer writes for a turn's cost. Kept here so the plain and rich paths agree. */\nexport function formatStats(stats: TurnStats): string {\n return `${stats.promptTokens} prompt · ${stats.outputTokens} output · ${stats.durationMs} ms`\n}\n\n/**\n * Opening banner — version, session, store, any turn a previous process left unfinished.\n *\n * One `banner` item rather than N notes, so the rich renderer can box it as a unit. The plain\n * path never calls this — it writes the lines directly — so plain output is unchanged by the\n * boxing.\n */\nexport function seed(notes: readonly string[]): TranscriptState {\n if (notes.length === 0) return EMPTY_TRANSCRIPT\n return append(EMPTY_TRANSCRIPT, \"banner\", notes.join(\"\\n\"))\n}\n\n/** One earlier message, as much of it as a transcript row needs. */\nexport interface PriorMessage {\n readonly role: \"user\" | \"assistant\"\n readonly text: string\n}\n\n/**\n * Put the conversation that already happened on the screen.\n *\n * Resuming used to paint an empty transcript over a full history: the messages reached the *model* and\n * never the person, so the banner said `17 message(s)` above a blank screen and the only honest reading\n * was that something had been lost. Rendering them is what makes that count verifiable.\n *\n * A separate function rather than a second argument to `seed`, because an optional parameter here would\n * have to distinguish \"no history\" from \"not asked for\" — and under `exactOptionalPropertyTypes` a\n * default parameter fires on an explicitly passed `undefined`, which has already cost this repo a\n * debugging round. `seedHistory(seed(banner), prior)` composes with nothing to remember.\n *\n * **Prose only.** Tool calls and observations are left out for the same reason they are left out of the\n * memory index: an observation is a wall of text a stranger wrote, and replaying forty of them above the\n * composer buries the conversation the person came back for. The turn statistics are left off too — they\n * were true of a process that has exited, and a cost line under a resumed reply reads as this session's.\n */\nexport function seedHistory(\n state: TranscriptState,\n messages: readonly PriorMessage[],\n): TranscriptState {\n let next = state\n for (const message of messages) {\n if (message.text.trim() === \"\") continue\n next = append(next, message.role, message.text)\n }\n return next\n}\n\n/** The most recent completed turn's cost, for the status bar. */\nexport function lastStats(items: readonly TranscriptItem[]): TurnStats | undefined {\n for (let i = items.length - 1; i >= 0; i -= 1) {\n const stats = items[i]?.stats\n if (stats !== undefined) return stats\n }\n return undefined\n}\n\n// ─── the finished conversation, as rows ──────────────────────────────────────────────────\n\n/**\n * Flatten items into the rows a windowed transcript scrolls through.\n *\n * ## Why rows rather than items\n *\n * Scrolling by item is the cheaper thing to build and the wrong unit. One assistant reply is a single\n * item and forty rows on screen, so an item-indexed window either shows the whole answer or none of it —\n * page-up from the bottom of a long reply would jump over the entire thing and land on the question\n * before it. Rows are what a reader moves through, so rows are what the offset counts.\n *\n * Wrapping happens here, not in Ink. A window has to know its content's height before it draws any of\n * it, and a count Ink might disagree with is a window off by however many lines wrapped — which shows up\n * as the last line of a reply hidden under the composer, intermittently, depending on the text.\n *\n * Pure, and one derivation for both halves of the frame: the component renders these rows and the layout\n * asks how many there are.\n */\nexport function transcriptRows(\n items: readonly TranscriptItem[],\n options: {\n readonly showReasoning: boolean\n readonly quiet: boolean\n readonly columns: number\n /** Reasoning blocks are shown whole rather than folded to `REASONING_FOLD_ROWS`. */\n readonly expandReasoning?: boolean\n },\n): readonly TranscriptRow[] {\n const rows: TranscriptRow[] = []\n const visible = items.filter((item) => item.role !== \"reasoning\" || options.showReasoning)\n\n /**\n * A row this renderer invented: a gap, a label, a fold notice, a stats line.\n *\n * `lead: 0` because there is no prefix to exclude, and `continuation: false` because it starts a line of\n * its own. Selectable, deliberately — a stats line or a banner note is text somebody may well want to\n * copy, and the cells worth excluding are the role prefixes, which are per-row and handled below.\n */\n const chrome = (row: Omit<TranscriptRow, \"lead\" | \"continuation\">): TranscriptRow => ({\n ...row,\n lead: 0,\n continuation: false,\n })\n\n for (const [at, item] of visible.entries()) {\n // A blank row between items, and never a trailing one. The rich transcript is read rather than\n // grepped, and two turns that touch each other read as one wall of text; a blank row at the end\n // would instead be a permanent gap above the composer.\n if (at > 0) rows.push(chrome({ key: `${item.id}:gap`, role: item.role, text: \"\" }))\n\n if (item.role === \"banner\") {\n // The banner keeps its content and loses its border. A bordered box inside a windowed list\n // costs two rows this module cannot count — Ink measures the frame, not us — and the frame\n // was decoration on a surface that is now itself a frame.\n const [title = \"\", ...lines] = item.text.split(\"\\n\")\n rows.push(chrome({ key: `${item.id}:title`, role: \"banner\", text: title, bold: true }))\n for (const [n, line] of lines.entries()) {\n for (const [w, wrapped] of wrapText(line, options.columns).entries()) {\n rows.push({\n key: `${item.id}:note-${n}-${w}`,\n role: \"banner\",\n text: wrapped,\n dim: true,\n lead: 0,\n // Only rows the *wrap* invented continue; a fresh source line does not.\n continuation: w > 0,\n })\n }\n }\n continue\n }\n\n const prefix = ROLE_PREFIX[item.role]\n const pad = \" \".repeat([...prefix].length)\n // The prefix is part of the first row's width and an indent on every row after it, so a reply\n // that wraps stays in one column instead of reading as a second message.\n const body = wrapText(item.text, Math.max(1, options.columns - [...prefix].length))\n\n if (item.role === \"reasoning\") {\n // A header row and an indented body, rather than a label wide enough to be the indent. Folded\n // unless asked for: the block is secondary, and at full length it routinely fills the screen\n // and pushes the reply it produced out of sight.\n const shown =\n options.expandReasoning === true\n ? body.length\n : Math.min(body.length, REASONING_FOLD_ROWS)\n const folded = body.length - shown\n rows.push(\n chrome({\n key: `${item.id}:label`,\n role: \"reasoning\",\n dim: true,\n text:\n folded > 0\n ? `· reasoning · ${body.length} rows · ⌥r expands`\n : `· reasoning · ${body.length} row${body.length === 1 ? \"\" : \"s\"}`,\n }),\n )\n for (const [n, line] of body.slice(0, shown).entries()) {\n rows.push({\n key: `${item.id}:${n}`,\n role: \"reasoning\",\n text: `${pad}${line}`,\n lead: pad.length,\n continuation: n > 0,\n })\n }\n if (folded > 0) {\n rows.push(\n chrome({\n key: `${item.id}:folded`,\n role: \"reasoning\",\n dim: true,\n text: `${pad}… ${folded} more row${folded === 1 ? \"\" : \"s\"}`,\n }),\n )\n }\n continue\n }\n\n for (const [n, line] of body.entries()) {\n rows.push({\n key: `${item.id}:${n}`,\n role: item.role,\n text: `${n === 0 ? prefix : pad}${line}`,\n // The prefix on the first row and its hanging indent on every row after it are the same\n // width, so one number covers both — and it is exactly the span a copy must drop.\n lead: [...prefix].length,\n continuation: n > 0,\n })\n }\n\n if (item.subagent !== undefined) {\n // Folded with the reasoning blocks, by the same key: both are the detail behind a row, and\n // the reply is what a person reads first.\n const view = item.subagent\n const open = options.expandReasoning === true\n const status = view.summary ?? \"running\"\n const more =\n !open && view.lines.length > 0\n ? ` · ⌥r shows ${view.lines.length} call${view.lines.length === 1 ? \"\" : \"s\"}`\n : \"\"\n for (const [n, line] of wrapText(\n `↳ subagent ${view.name} · ${status}${more}`,\n Math.max(1, options.columns - pad.length),\n ).entries()) {\n rows.push(\n chrome({\n key: `${item.id}:sub-${n}`,\n role: item.role,\n text: `${pad}${line}`,\n dim: true,\n }),\n )\n }\n if (open) {\n const inner = `${pad} `\n for (const [n, line] of view.lines.entries()) {\n for (const [w, wrapped] of wrapText(\n line.text,\n Math.max(1, options.columns - inner.length),\n ).entries()) {\n rows.push({\n key: `${item.id}:sub-${n}-${w}`,\n role: item.role,\n text: `${inner}${wrapped}`,\n dim: true,\n lead: inner.length,\n continuation: w > 0,\n })\n }\n }\n }\n }\n\n if (item.stats !== undefined && !options.quiet) {\n rows.push(\n chrome({\n key: `${item.id}:stats`,\n role: item.role,\n text: ` ${formatStats(item.stats)}`,\n dim: true,\n }),\n )\n }\n }\n\n return rows\n}\n"
7
+ "/**\n * Events in, view state out. Pure, and the only place that decides what a turn looks like.\n *\n * The CLI has always been a `runtime.bus` subscriber; this makes it a *reducer* over that bus\n * instead of a set of callbacks writing to stdout. Three things follow from that:\n *\n * - \"What does the reader see when a turn errors mid-stream?\" is a unit test rather than something\n * reproduced by hand against a live endpoint.\n * - Finished items are append-only and immutable, which is exactly the contract Ink's `<Static>`\n * needs: a node written once and never re-rendered. The still-moving reply lives in `live`, so\n * the dynamic region stays one item regardless of how long the conversation gets.\n * - Phase 4's SSE client and Phase 12's TUI client can consume the same reduction instead of\n * re-deriving it.\n *\n * No clock and no randomness: ids come from a counter in the state, so the same events always\n * produce the same output and the tests need no fakes.\n */\n\nimport { type AnyEvent, endNote, SUBMIT_ARTIFACT } from \"@dispach/core\"\nimport { MAX_TRANSCRIPT_ITEMS, REASONING_FOLD_ROWS } from \"#lib/const\"\nimport { compactTokens } from \"#lib/rows\"\nimport { ROLE_PREFIX } from \"#lib/theme\"\nimport type {\n SubagentView,\n TranscriptItem,\n TranscriptRole,\n TranscriptRow,\n TranscriptState,\n TurnStats,\n} from \"#lib/types\"\nimport { wrapText } from \"#lib/wrap\"\n\n/**\n * The transcript is driven by more than the bus — a typed line and a cancellation request are not\n * events — so the reducer takes an action union rather than an event directly.\n */\nexport type TranscriptAction =\n | { readonly kind: \"user\"; readonly text: string }\n | { readonly kind: \"event\"; readonly event: AnyEvent }\n | { readonly kind: \"note\"; readonly text: string }\n | { readonly kind: \"cancelling\" }\n /**\n * A model delta that has already been through the dialect's stream filter.\n *\n * Filtering cannot happen in here: a filter is stateful and this reducer is pure. So the caller\n * owns one per step and dispatches what is left. A caller that dispatches the raw `model.chunk`\n * event instead still works — it just shows the invocation blocks, which is right for a dialect\n * with no in-band protocol and wrong for NLT.\n */\n | { readonly kind: \"delta\"; readonly of: \"text\" | \"reasoning\"; readonly text: string }\n /**\n * Drop the oldest items if the buffer is over `MAX_TRANSCRIPT_ITEMS`.\n *\n * An action rather than something `append` does on its own, because whether it is *safe* depends on\n * a fact this reducer cannot see: rows are addressed by position, so dropping any from the front\n * moves every offset below them. A reader parked twelve turns back would keep their offset and\n * silently start reading different text — the appearance of a live session that is not one, which is\n * the failure `ScrollState.pinned` exists to make impossible. Only the layer holding that flag knows\n * when eviction is allowed, so only it can ask.\n */\n | { readonly kind: \"trim\" }\n\nexport const EMPTY_TRANSCRIPT: TranscriptState = {\n items: [],\n live: undefined,\n status: \"idle\",\n nextId: 0,\n turnFrom: undefined,\n}\n\nfunction append(\n state: TranscriptState,\n role: TranscriptRole,\n text: string,\n extra: {\n readonly stats?: TurnStats\n readonly callId?: string\n readonly pending?: boolean\n } = {},\n): TranscriptState {\n const item: TranscriptItem = {\n id: `t${state.nextId}`,\n role,\n text,\n ...(extra.stats === undefined ? {} : { stats: extra.stats }),\n ...(extra.callId === undefined ? {} : { callId: extra.callId }),\n ...(extra.pending === undefined ? {} : { pending: extra.pending }),\n }\n return { ...state, items: [...state.items, item], nextId: state.nextId + 1 }\n}\n\n/**\n * Commit whatever the model has streamed so far, and clear it.\n *\n * Called at each step boundary rather than once at the end of the turn, which is what puts the\n * transcript back in the order things happened. Committing at `turn.end` alone produced a turn shaped\n * \"every tool row, then all the reasoning, then all the text\" — so the reasoning that *decided* to call\n * a tool was printed below the tool's result, and step one's reasoning was concatenated onto step two's\n * with no break between them. Live output on a real turn read `…look for it in my workspace.The user is\n * asking me to…`, two sentences from two steps with nothing marking the join.\n *\n * Reasoning goes in ahead of the text it produced. Whether it is *shown* is the view's business — the\n * item is written either way, so `--show-reasoning` can be honoured after the fact.\n */\nfunction flushLive(state: TranscriptState): TranscriptState {\n const live = state.live\n if (live === undefined) return state\n let next = state\n if (live.reasoning !== \"\") next = append(next, \"reasoning\", live.reasoning)\n if (live.text !== \"\") next = append(next, \"assistant\", live.text)\n return { ...next, live: undefined }\n}\n\n/** `data` is typed per event in core's map; narrowing by `type` first is what makes this safe. */\nexport function reduce(state: TranscriptState, action: TranscriptAction): TranscriptState {\n switch (action.kind) {\n case \"user\":\n return append(state, \"user\", action.text)\n\n case \"note\":\n return append(state, \"note\", action.text)\n\n case \"cancelling\":\n // A state, not an item. Cancellation that produced partial text still ends in a\n // `turn.end`, and that is what commits the text.\n return state.status === \"idle\" ? state : { ...state, status: \"cancelling\" }\n\n case \"delta\":\n return applyDelta(state, action.of, action.text)\n\n case \"event\":\n return reduceEvent(state, action.event)\n\n case \"trim\":\n return trim(state)\n }\n}\n\n/**\n * The oldest items above the cap, dropped. Identity when there is nothing to do.\n *\n * Returning the same object rather than a copy is what makes this cheap to ask about: `useReducer`\n * compares by reference and skips the render, so the caller can dispatch on every change without\n * checking first — and a caller that has to check first is a caller that eventually forgets.\n *\n * The banner is an ordinary item and goes with the rest. It is four hundred turns of scrollback above\n * the reader by then, and exempting it would leave the session's opening line pinned above a\n * conversation it no longer describes.\n */\nfunction trim(state: TranscriptState): TranscriptState {\n const over = state.items.length - MAX_TRANSCRIPT_ITEMS\n return over <= 0 ? state : { ...state, items: state.items.slice(over) }\n}\n\nfunction applyDelta(\n state: TranscriptState,\n kind: \"text\" | \"reasoning\",\n delta: string,\n): TranscriptState {\n if (delta === \"\") return state\n const live = state.live ?? { text: \"\", reasoning: \"\", last: undefined }\n return {\n ...state,\n live: {\n text: kind === \"text\" ? live.text + delta : live.text,\n reasoning: kind === \"reasoning\" ? live.reasoning + delta : live.reasoning,\n last: kind,\n },\n // A cancellation already asked for is not undone by another token arriving in flight; the\n // request stands until the turn actually ends.\n status: state.status === \"cancelling\" ? \"cancelling\" : \"streaming\",\n }\n}\n\n/**\n * The tool row `match` picks, with its subagent for `sessionKey` changed or added. Unchanged state\n * when no row matches or `change` declines.\n */\nfunction withSubagent(\n state: TranscriptState,\n match: (item: TranscriptItem) => boolean,\n sessionKey: string,\n change: (view: SubagentView | undefined) => SubagentView | undefined,\n): TranscriptState {\n const at = state.items.findIndex(match)\n if (at === -1) return state\n const items = [...state.items]\n const item = items[at] as TranscriptItem\n const views = item.subagents ?? []\n const index = views.findIndex((view) => view.sessionKey === sessionKey)\n const view = change(index === -1 ? undefined : views[index])\n if (view === undefined) return state\n const next =\n index === -1\n ? [...views, view].sort((a, b) => (a.index ?? 0) - (b.index ?? 0))\n : views.map((existing, i) => (i === index ? view : existing))\n items[at] = { ...item, subagents: next }\n return { ...state, items }\n}\n\n/** The row holding the subagent whose session is `sessionKey`. */\nconst holds = (sessionKey: string) => (item: TranscriptItem) =>\n item.subagents?.some((view) => view.sessionKey === sessionKey) === true\n\n/**\n * A subagent's own event: its tool calls become lines under the routed call's row. Its text and\n * turn events stay out of the conversation, which is the parent's; `handoff.result` reports the end.\n */\nfunction reduceChild(state: TranscriptState, event: AnyEvent): TranscriptState {\n const key = event.sessionKey ?? \"\"\n const mine = holds(key)\n // The child's return channel is how it hands back its answer, not work it did for the person.\n if (\"slug\" in event.data && event.data.slug === SUBMIT_ARTIFACT) return state\n switch (event.type) {\n case \"tool.call\":\n return withSubagent(state, mine, key, (view) =>\n view === undefined\n ? undefined\n : {\n ...view,\n lines: [\n ...view.lines,\n { callId: event.data.callId, text: `${event.data.slug} …` },\n ],\n },\n )\n case \"tool.result\": {\n const { slug, callId, ok, latencyMs } = event.data\n const text = `${slug} — ${ok ? \"ok\" : \"failed\"} · ${latencyMs} ms`\n return withSubagent(state, mine, key, (view) =>\n view === undefined\n ? undefined\n : {\n ...view,\n lines: view.lines.some((line) => line.callId === callId)\n ? view.lines.map((line) =>\n line.callId === callId ? { callId, text } : line,\n )\n : [...view.lines, { callId, text }],\n },\n )\n }\n case \"tool.gated\":\n return withSubagent(state, mine, key, (view) =>\n view === undefined\n ? undefined\n : {\n ...view,\n lines: [\n ...view.lines,\n { text: `${event.data.slug} — blocked: ${event.data.reason}` },\n ],\n },\n )\n default:\n return state\n }\n}\n\nfunction reduceEvent(state: TranscriptState, event: AnyEvent): TranscriptState {\n if (event.parentTurnId !== undefined) return reduceChild(state, event)\n switch (event.type) {\n case \"handoff.start\": {\n const { kind, name, callId, sessionKey, label, index } = event.data\n if (kind !== \"self\" || callId === undefined) return state\n return withSubagent(\n state,\n (item) => item.callId === callId,\n sessionKey,\n (view) =>\n view ?? {\n name: name ?? \"subagent\",\n sessionKey,\n lines: [],\n ...(label === undefined ? {} : { label }),\n ...(index === undefined ? {} : { index }),\n },\n )\n }\n\n case \"handoff.result\": {\n const { sessionKey, steps, tokens, outcome } = event.data\n const summary = `${steps} step${steps === 1 ? \"\" : \"s\"} · ${compactTokens(tokens.prompt + tokens.output)} tokens · ${outcome === \"ok\" ? \"ok\" : outcome.replace(\"_\", \" \")}`\n return withSubagent(state, holds(sessionKey), sessionKey, (view) =>\n view === undefined ? undefined : { ...view, summary },\n )\n }\n\n case \"turn.start\":\n return {\n ...state,\n live: { text: \"\", reasoning: \"\", last: undefined },\n status: \"thinking\",\n turnFrom: state.items.length,\n }\n\n case \"model.result\":\n // The step boundary. `model.result` is emitted once per model call, so this is where a step's\n // reasoning and text stop growing — no new event was needed to find it.\n return flushLive(state)\n\n case \"model.chunk\":\n return applyDelta(state, event.data.kind, event.data.delta)\n\n case \"tool.call\":\n // Committed the moment the call starts, not when it returns: a tool that takes eight\n // seconds must not leave the screen looking like a stalled model. Anything the model\n // streamed before deciding to call it is flushed first, so the reasoning sits above the\n // call it explains rather than below the call's result.\n return {\n ...append(\n flushLive(state),\n \"tool\",\n `${event.data.slug}${event.data.mutating ? \" (changes state)\" : \"\"}`,\n { callId: event.data.callId, pending: true },\n ),\n status: state.status === \"cancelling\" ? \"cancelling\" : \"working\",\n }\n\n case \"tool.result\": {\n const { slug, callId, ok, latencyMs, truncated } = event.data\n const text = `${slug} — ${ok ? \"ok\" : \"failed\"} · ${latencyMs} ms${truncated ? \" · observation trimmed\" : \"\"}`\n // The call's own row, completed. Matched on `callId` rather than on position, because calls\n // can overlap and \"the last tool row\" is then not the row this result belongs to.\n const at = state.items.findIndex(\n (item) => item.callId === callId && item.pending === true,\n )\n if (at === -1) {\n // No row to complete — a result for a call this transcript never saw. Appended rather\n // than dropped: an observation nobody can account for is exactly the thing worth seeing.\n return append(state, ok ? \"tool\" : \"error\", text)\n }\n const items = [...state.items]\n const item = items[at] as TranscriptItem\n items[at] = {\n id: item.id,\n role: ok ? \"tool\" : \"error\",\n text,\n callId,\n // The call's blocks outlive its own completion: the children's lines are the point.\n ...(item.subagents === undefined ? {} : { subagents: item.subagents }),\n }\n return { ...state, items }\n }\n\n case \"tool.gated\":\n // Deliberately visible. A blocked write is the one tool outcome a person must not have\n // to go looking for — and it is a `note` rather than an `error` because the wire spec is\n // explicit that this is not one: the turn continues and the model reports back.\n return append(state, \"note\", `${event.data.slug} — blocked: ${event.data.reason}`)\n\n case \"tool.repair\":\n // A silent repair is indistinguishable from a slow turn, and it costs a whole step. With no\n // slugs it is the runtime's nudge (14.123), not a tool that failed, and says so.\n return append(\n state,\n \"note\",\n event.data.slugs.length === 0\n ? `reply stopped short (${event.data.errors.join(\"; \")}), asking the model to finish`\n : `${event.data.slugs.join(\", \")} — could not be used, asking the model again`,\n )\n\n case \"model.retry\": {\n const { status, attempt, delayMs } = event.data\n return append(\n state,\n \"note\",\n `retrying after HTTP ${status} — attempt ${attempt}, waiting ${delayMs} ms`,\n )\n }\n\n case \"turn.end\": {\n const { reason, steps, tokens, durationMs } = event.data\n const stats: TurnStats = {\n promptTokens: tokens.prompt,\n outputTokens: tokens.output,\n durationMs,\n steps,\n reason,\n }\n\n // Whatever the last step streamed but never got a `model.result` for — a cancelled turn, or\n // one that ended on an error mid-stream. On a clean turn this is a no-op, because each step\n // committed itself as it finished.\n const next = flushLive(state)\n const from = state.turnFrom ?? 0\n // The reply this turn produced, which is where its cost belongs. Searched from the turn's own\n // first item: without that floor, a turn that produced no text would hang its statistics on\n // the *previous* turn's reply, which reads as that reply having cost twice.\n let reply = -1\n for (let at = next.items.length - 1; at >= from; at -= 1) {\n if (next.items[at]?.role === \"assistant\") {\n reply = at\n break\n }\n }\n // Why the turn stopped, from the formatter the plain path uses. Until this existed\n // `stats.reason` reached the reducer and was rendered nowhere, so a turn the step budget\n // cut off looked exactly like a completed one — which is how an agent came to stop\n // mid-task on \"Let me install it\" with nothing on screen explaining it.\n const why = endNote(reason, { steps, durationMs })\n\n if (reply === -1) {\n // A turn that produced nothing is not a normal outcome and must not look like one.\n const said = append(\n next,\n \"note\",\n why ?? (reason === \"final\" ? \"the model returned no text\" : \"\"),\n { stats },\n )\n return { ...said, live: undefined, status: \"idle\", turnFrom: undefined }\n }\n const items = [...next.items]\n const item = items[reply] as TranscriptItem\n items[reply] = { ...item, stats }\n const settled: TranscriptState = {\n ...next,\n items,\n live: undefined,\n status: \"idle\",\n turnFrom: undefined,\n }\n // Below the reply, not attached to it: the reply is what the model said, and this is what\n // the runtime did. Attaching it to the item would put a harness sentence in the model's\n // voice — the distinction `note` exists for.\n return why === undefined ? settled : append(settled, \"note\", why)\n }\n\n // `agent.error` used to fall through to here. It was declared in Phase 1, carried a\n // hint, and was emitted by **nothing, ever** — so this label was reachable only from a\n // test that constructed one by hand. Deleted rather than wired up: `error` already\n // carries every uncaught failure, and a second error event with no emitter is vocabulary\n // that makes the catalogue look richer than it is.\n case \"error\": {\n const { code, message, hint } = event.data\n return append(state, \"error\", `${code}: ${message}\\nhint: ${hint}`)\n }\n\n case \"context.dropped\": {\n const { messages, budget } = event.data\n // A note, not a stage line: the ladder decided what to compact and this is the budget\n // running out regardless. Worth saying because the agent is now answering without part of\n // the conversation, and nothing else on any surface would mention it.\n return append(\n state,\n \"note\",\n `context: ${messages} older message(s) did not fit the ${budget}-token budget and were left out`,\n )\n }\n\n case \"agent.warning\": {\n const { code, message } = event.data\n return append(state, \"note\", `${code}: ${message}`)\n }\n\n case \"context.pressure\":\n // A gauge, so it replaces rather than accumulates. `source` is deliberately not shown: it\n // is diagnostic and the status line has no room for a word that changes nothing a person\n // would do — it is on the event for whoever is reading events.\n return { ...state, pressure: event.data.fraction }\n\n case \"compaction.stage\": {\n const { stage, changed, before, after } = event.data\n // Only the stages that destroy detail get a line. trim, snip and micro are recoverable —\n // the conversation is still in the store and a snipped observation keeps a pointer — while\n // collapse and reset replace a span of the conversation with a summary, and a person who\n // was not watching the gauge still needs to know that happened.\n if (!changed || (stage !== \"collapse\" && stage !== \"reset\")) return state\n const what =\n stage === \"reset\"\n ? \"the conversation so far was replaced by a summary\"\n : \"earlier turns were replaced by a summary\"\n return append(state, \"note\", `context: ${what} (${before} → ${after} tokens)`)\n }\n\n case \"phase.changed\": {\n const { to, tools } = event.data\n // A line *and* the gauge. The line because a phase change is the reason the agent's\n // abilities changed mid-conversation, and a person scrolling back needs it where it\n // happened; the gauge because \"which phase am I in\" is a current-state question.\n const next = append(\n state,\n \"note\",\n `phase: now in ${to} · ${tools} tool${tools === 1 ? \"\" : \"s\"} available`,\n )\n return { ...next, phase: to }\n }\n\n case \"context.reset\": {\n const { warning } = event.data\n // The count itself is not shown — the note above already said what happened. A *second*\n // reset is a configuration problem rather than a busy session, and that is worth a line.\n return warning === undefined ? state : append(state, \"note\", `context: ${warning}`)\n }\n\n default:\n // Boot and bookkeeping events — `runtime.ready`, `store.ready`, `model.call`,\n // `context.assembled`. They belong to the banner and the status bar, not the transcript. Ignored explicitly so that a new event type added in a later\n // phase is inert here rather than a crash.\n return state\n }\n}\n\n/** What a renderer writes for a turn's cost. Kept here so the plain and rich paths agree. */\nexport function formatStats(stats: TurnStats): string {\n return `${stats.promptTokens} prompt · ${stats.outputTokens} output · ${stats.durationMs} ms`\n}\n\n/**\n * Opening banner — version, session, store, any turn a previous process left unfinished.\n *\n * One `banner` item rather than N notes, so the rich renderer can box it as a unit. The plain\n * path never calls this — it writes the lines directly — so plain output is unchanged by the\n * boxing.\n */\nexport function seed(notes: readonly string[]): TranscriptState {\n if (notes.length === 0) return EMPTY_TRANSCRIPT\n return append(EMPTY_TRANSCRIPT, \"banner\", notes.join(\"\\n\"))\n}\n\n/** One earlier message, as much of it as a transcript row needs. */\nexport interface PriorMessage {\n readonly role: \"user\" | \"assistant\"\n readonly text: string\n}\n\n/**\n * Put the conversation that already happened on the screen.\n *\n * Resuming used to paint an empty transcript over a full history: the messages reached the *model* and\n * never the person, so the banner said `17 message(s)` above a blank screen and the only honest reading\n * was that something had been lost. Rendering them is what makes that count verifiable.\n *\n * A separate function rather than a second argument to `seed`, because an optional parameter here would\n * have to distinguish \"no history\" from \"not asked for\" — and under `exactOptionalPropertyTypes` a\n * default parameter fires on an explicitly passed `undefined`, which has already cost this repo a\n * debugging round. `seedHistory(seed(banner), prior)` composes with nothing to remember.\n *\n * **Prose only.** Tool calls and observations are left out for the same reason they are left out of the\n * memory index: an observation is a wall of text a stranger wrote, and replaying forty of them above the\n * composer buries the conversation the person came back for. The turn statistics are left off too — they\n * were true of a process that has exited, and a cost line under a resumed reply reads as this session's.\n */\nexport function seedHistory(\n state: TranscriptState,\n messages: readonly PriorMessage[],\n): TranscriptState {\n let next = state\n for (const message of messages) {\n if (message.text.trim() === \"\") continue\n next = append(next, message.role, message.text)\n }\n return next\n}\n\n/** The most recent completed turn's cost, for the status bar. */\nexport function lastStats(items: readonly TranscriptItem[]): TurnStats | undefined {\n for (let i = items.length - 1; i >= 0; i -= 1) {\n const stats = items[i]?.stats\n if (stats !== undefined) return stats\n }\n return undefined\n}\n\n// ─── the finished conversation, as rows ──────────────────────────────────────────────────\n\n/**\n * Flatten items into the rows a windowed transcript scrolls through.\n *\n * ## Why rows rather than items\n *\n * Scrolling by item is the cheaper thing to build and the wrong unit. One assistant reply is a single\n * item and forty rows on screen, so an item-indexed window either shows the whole answer or none of it —\n * page-up from the bottom of a long reply would jump over the entire thing and land on the question\n * before it. Rows are what a reader moves through, so rows are what the offset counts.\n *\n * Wrapping happens here, not in Ink. A window has to know its content's height before it draws any of\n * it, and a count Ink might disagree with is a window off by however many lines wrapped — which shows up\n * as the last line of a reply hidden under the composer, intermittently, depending on the text.\n *\n * Pure, and one derivation for both halves of the frame: the component renders these rows and the layout\n * asks how many there are.\n */\nexport function transcriptRows(\n items: readonly TranscriptItem[],\n options: {\n readonly showReasoning: boolean\n readonly quiet: boolean\n readonly columns: number\n /** Reasoning blocks are shown whole rather than folded to `REASONING_FOLD_ROWS`. */\n readonly expandReasoning?: boolean\n },\n): readonly TranscriptRow[] {\n const rows: TranscriptRow[] = []\n const visible = items.filter((item) => item.role !== \"reasoning\" || options.showReasoning)\n\n /**\n * A row this renderer invented: a gap, a label, a fold notice, a stats line.\n *\n * `lead: 0` because there is no prefix to exclude, and `continuation: false` because it starts a line of\n * its own. Selectable, deliberately — a stats line or a banner note is text somebody may well want to\n * copy, and the cells worth excluding are the role prefixes, which are per-row and handled below.\n */\n const chrome = (row: Omit<TranscriptRow, \"lead\" | \"continuation\">): TranscriptRow => ({\n ...row,\n lead: 0,\n continuation: false,\n })\n\n for (const [at, item] of visible.entries()) {\n // A blank row between items, and never a trailing one. The rich transcript is read rather than\n // grepped, and two turns that touch each other read as one wall of text; a blank row at the end\n // would instead be a permanent gap above the composer.\n if (at > 0) rows.push(chrome({ key: `${item.id}:gap`, role: item.role, text: \"\" }))\n\n if (item.role === \"banner\") {\n // The banner keeps its content and loses its border. A bordered box inside a windowed list\n // costs two rows this module cannot count — Ink measures the frame, not us — and the frame\n // was decoration on a surface that is now itself a frame.\n const [title = \"\", ...lines] = item.text.split(\"\\n\")\n rows.push(chrome({ key: `${item.id}:title`, role: \"banner\", text: title, bold: true }))\n for (const [n, line] of lines.entries()) {\n for (const [w, wrapped] of wrapText(line, options.columns).entries()) {\n rows.push({\n key: `${item.id}:note-${n}-${w}`,\n role: \"banner\",\n text: wrapped,\n dim: true,\n lead: 0,\n // Only rows the *wrap* invented continue; a fresh source line does not.\n continuation: w > 0,\n })\n }\n }\n continue\n }\n\n const prefix = ROLE_PREFIX[item.role]\n const pad = \" \".repeat([...prefix].length)\n // The prefix is part of the first row's width and an indent on every row after it, so a reply\n // that wraps stays in one column instead of reading as a second message.\n const body = wrapText(item.text, Math.max(1, options.columns - [...prefix].length))\n\n if (item.role === \"reasoning\") {\n // A header row and an indented body, rather than a label wide enough to be the indent. Folded\n // unless asked for: the block is secondary, and at full length it routinely fills the screen\n // and pushes the reply it produced out of sight.\n const shown =\n options.expandReasoning === true\n ? body.length\n : Math.min(body.length, REASONING_FOLD_ROWS)\n const folded = body.length - shown\n rows.push(\n chrome({\n key: `${item.id}:label`,\n role: \"reasoning\",\n dim: true,\n text:\n folded > 0\n ? `· reasoning · ${body.length} rows · ⌥r expands`\n : `· reasoning · ${body.length} row${body.length === 1 ? \"\" : \"s\"}`,\n }),\n )\n for (const [n, line] of body.slice(0, shown).entries()) {\n rows.push({\n key: `${item.id}:${n}`,\n role: \"reasoning\",\n text: `${pad}${line}`,\n lead: pad.length,\n continuation: n > 0,\n })\n }\n if (folded > 0) {\n rows.push(\n chrome({\n key: `${item.id}:folded`,\n role: \"reasoning\",\n dim: true,\n text: `${pad}… ${folded} more row${folded === 1 ? \"\" : \"s\"}`,\n }),\n )\n }\n continue\n }\n\n for (const [n, line] of body.entries()) {\n rows.push({\n key: `${item.id}:${n}`,\n role: item.role,\n text: `${n === 0 ? prefix : pad}${line}`,\n // The prefix on the first row and its hanging indent on every row after it are the same\n // width, so one number covers both — and it is exactly the span a copy must drop.\n lead: [...prefix].length,\n continuation: n > 0,\n })\n }\n\n for (const [b, view] of (item.subagents ?? []).entries()) {\n // Folded with the reasoning blocks, by the same key: both are the detail behind a row, and\n // the reply is what a person reads first.\n const open = options.expandReasoning === true\n const status = view.summary ?? \"running\"\n const more =\n !open && view.lines.length > 0\n ? ` · ⌥r shows ${view.lines.length} call${view.lines.length === 1 ? \"\" : \"s\"}`\n : \"\"\n const label = view.label === undefined ? \"\" : ` · ${view.label}`\n for (const [n, line] of wrapText(\n `↳ subagent ${view.name}${label} · ${status}${more}`,\n Math.max(1, options.columns - pad.length),\n ).entries()) {\n rows.push(\n chrome({\n key: `${item.id}:sub${b}-${n}`,\n role: item.role,\n text: `${pad}${line}`,\n dim: true,\n }),\n )\n }\n if (open) {\n const inner = `${pad} `\n for (const [n, line] of view.lines.entries()) {\n for (const [w, wrapped] of wrapText(\n line.text,\n Math.max(1, options.columns - inner.length),\n ).entries()) {\n rows.push({\n key: `${item.id}:sub${b}-${n}-${w}`,\n role: item.role,\n text: `${inner}${wrapped}`,\n dim: true,\n lead: inner.length,\n continuation: w > 0,\n })\n }\n }\n }\n }\n\n if (item.stats !== undefined && !options.quiet) {\n rows.push(\n chrome({\n key: `${item.id}:stats`,\n role: item.role,\n text: ` ${formatStats(item.stats)}`,\n dim: true,\n }),\n )\n }\n }\n\n return rows\n}\n"
8
8
  ],
9
- "mappings": ";mQAuCO,IAAM,EAAkD,CAC3D,CAAE,KAAM,OAAQ,KAAM,QAAS,QAAS,CAAC,EAAG,QAAS,WAAY,EACjE,CAKI,KAAM,SACN,KAAM,UACN,QAAS,CAAC,EACV,QAAS,kFACb,EACA,CAII,KAAM,UACN,KAAM,WACN,QAAS,CAAC,EACV,QACI,uFACR,EACA,CACI,KAAM,UACN,KAAM,WACN,QAAS,CAAC,EACV,QACI,sGACR,EACA,CACI,KAAM,QACN,KAAM,SACN,QAAS,CAAC,EACV,QAAS,kEACb,EACA,CAII,KAAM,MACN,KAAM,OACN,QAAS,CAAC,EACV,QACI,2GACR,EACA,CACI,KAAM,QACN,KAAM,SACN,QAAS,CAAC,EACV,QACI,kGACR,EACA,CACI,KAAM,OACN,KAAM,QACN,QAAS,CAAC,QAAS,IAAI,EAIvB,QAAS,qDACb,CACJ,EAoBa,GAAe,+CAUf,GAAmB,uDAEnB,EAA0C,CACnD,CACI,MAAO,KACP,QACI,kGACR,EACA,CAAE,MAAO,KAAM,QAAS,6DAA8D,EACtF,CAAE,MAAO,UAAW,QAAS,6BAA8B,EAC3D,CAAE,MAAO,UAAW,QAAS,kCAAmC,EAChE,CAAE,MAAO,UAAW,QAAS,8CAA+C,EAC5E,CAAE,MAAO,KAAM,QAAS,mCAAoC,EAC5D,CAAE,MAAO,UAAW,QAAS,+CAAgD,E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