dispach 0.2.0 → 0.2.1

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 (167) hide show
  1. package/README.md +58 -18
  2. package/dist/APEv2Parser-9wqew3zv.js +5 -0
  3. package/dist/{APEv2Parser-jdp5yp24.js.map → APEv2Parser-9wqew3zv.js.map} +1 -1
  4. package/dist/{AiffParser-n65syezh.js → AiffParser-tbx3xkmk.js} +3 -3
  5. package/dist/{AiffParser-n65syezh.js.map → AiffParser-tbx3xkmk.js.map} +1 -1
  6. package/dist/App-hjn867nc.js +11 -0
  7. package/dist/{App-pmqmzsb3.js.map → App-hjn867nc.js.map} +1 -1
  8. package/dist/{AsfParser-da1fqvxz.js → AsfParser-d784ak3y.js} +3 -3
  9. package/dist/{AsfParser-da1fqvxz.js.map → AsfParser-d784ak3y.js.map} +1 -1
  10. package/dist/{ConfigEditor-4nqbeejh.js → ConfigEditor-g7eb2wsm.js} +3 -3
  11. package/dist/{ConfigEditor-4nqbeejh.js.map → ConfigEditor-g7eb2wsm.js.map} +1 -1
  12. package/dist/{DsdiffParser-gk95sj7t.js → DsdiffParser-vxnfx80c.js} +2 -2
  13. package/dist/{DsfParser-b0enevjw.js → DsfParser-0xsh0zzk.js} +3 -3
  14. package/dist/{DsfParser-b0enevjw.js.map → DsfParser-0xsh0zzk.js.map} +1 -1
  15. package/dist/FlacParser-bf8y3e0w.js +5 -0
  16. package/dist/{KeyProbe-rspsxpsr.js → KeyProbe-w8c37s9q.js} +3 -3
  17. package/dist/{KeyProbe-rspsxpsr.js.map → KeyProbe-w8c37s9q.js.map} +1 -1
  18. package/dist/{MP4Parser-ph7rv2fn.js → MP4Parser-tq7r7wd4.js} +3 -3
  19. package/dist/{MP4Parser-ph7rv2fn.js.map → MP4Parser-tq7r7wd4.js.map} +1 -1
  20. package/dist/{MatroskaParser-fjk1mpct.js → MatroskaParser-a79gsmzb.js} +3 -3
  21. package/dist/{MatroskaParser-fjk1mpct.js.map → MatroskaParser-a79gsmzb.js.map} +1 -1
  22. package/dist/{MpegParser-vp7cj8ts.js → MpegParser-zs61b3wq.js} +3 -3
  23. package/dist/{MpegParser-vp7cj8ts.js.map → MpegParser-zs61b3wq.js.map} +1 -1
  24. package/dist/{MusepackParser-v22gft1f.js → MusepackParser-bp8dm6nz.js} +3 -3
  25. package/dist/{MusepackParser-v22gft1f.js.map → MusepackParser-bp8dm6nz.js.map} +1 -1
  26. package/dist/{OggParser-as1m8xsa.js → OggParser-7pxr1sn9.js} +3 -3
  27. package/dist/{OggParser-as1m8xsa.js.map → OggParser-7pxr1sn9.js.map} +1 -1
  28. package/dist/{Picker-jkmd5xnx.js → Picker-b09hr4tk.js} +3 -3
  29. package/dist/{Picker-jkmd5xnx.js.map → Picker-b09hr4tk.js.map} +1 -1
  30. package/dist/{SessionPicker-3712ke3k.js → SessionPicker-wtfxwdxg.js} +3 -3
  31. package/dist/{SessionPicker-3712ke3k.js.map → SessionPicker-wtfxwdxg.js.map} +1 -1
  32. package/dist/{SkillBrowser-qhsyszt4.js → SkillBrowser-p9ht63c7.js} +3 -3
  33. package/dist/{SkillBrowser-qhsyszt4.js.map → SkillBrowser-p9ht63c7.js.map} +1 -1
  34. package/dist/{WavPackParser-b4qqavzg.js → WavPackParser-gpf3r92t.js} +3 -3
  35. package/dist/{WavPackParser-b4qqavzg.js.map → WavPackParser-gpf3r92t.js.map} +1 -1
  36. package/dist/{WaveParser-fqs1h38f.js → WaveParser-3kcak550.js} +3 -3
  37. package/dist/{WaveParser-fqs1h38f.js.map → WaveParser-3kcak550.js.map} +1 -1
  38. package/dist/WizardApp-494018sk.js +5 -0
  39. package/dist/{WizardApp-qrq36nv8.js.map → WizardApp-494018sk.js.map} +1 -1
  40. package/dist/{channels-gf31stv7.js → channels-yhdvxxrb.js} +14 -14
  41. package/dist/{channels-gf31stv7.js.map → channels-yhdvxxrb.js.map} +1 -1
  42. package/dist/config-g0ybmm4t.js +24 -0
  43. package/dist/{config-z2cd0c5f.js.map → config-g0ybmm4t.js.map} +1 -1
  44. package/dist/credential-pkme1sfe.js +19 -0
  45. package/dist/{credential-h0wmsjsw.js.map → credential-pkme1sfe.js.map} +1 -1
  46. package/dist/{index-dwxmy0kx.js → index-0mz7wpbw.js} +6 -6
  47. package/dist/{index-dwxmy0kx.js.map → index-0mz7wpbw.js.map} +1 -1
  48. package/dist/{index-fcqy46mh.js → index-0pddq849.js} +25 -25
  49. package/dist/{index-fcqy46mh.js.map → index-0pddq849.js.map} +1 -1
  50. package/dist/{index-2yj11ykt.js → index-1f1erzfx.js} +4 -4
  51. package/dist/{index-2yj11ykt.js.map → index-1f1erzfx.js.map} +1 -1
  52. package/dist/{index-1h9pqnec.js → index-26ejkp8q.js} +189 -189
  53. package/dist/{index-1h9pqnec.js.map → index-26ejkp8q.js.map} +7 -7
  54. package/dist/{index-ccpq4k6r.js → index-307qmvb0.js} +25 -25
  55. package/dist/{index-ccpq4k6r.js.map → index-307qmvb0.js.map} +1 -1
  56. package/dist/index-3b3h8kyh.js +5 -0
  57. package/dist/{index-3mvenfbg.js.map → index-3b3h8kyh.js.map} +1 -1
  58. package/dist/{index-0p9p6fvc.js → index-3fgq1acj.js} +10 -10
  59. package/dist/{index-0p9p6fvc.js.map → index-3fgq1acj.js.map} +3 -3
  60. package/dist/{index-dh2g58s1.js → index-4emtktc0.js} +3 -3
  61. package/dist/{index-dh2g58s1.js.map → index-4emtktc0.js.map} +1 -1
  62. package/dist/{index-026q0y3a.js → index-4t3p7vm9.js} +4 -4
  63. package/dist/{index-026q0y3a.js.map → index-4t3p7vm9.js.map} +1 -1
  64. package/dist/{index-t5d8ey5t.js → index-5m9wydxb.js} +4 -4
  65. package/dist/{index-t5d8ey5t.js.map → index-5m9wydxb.js.map} +1 -1
  66. package/dist/{index-g1d06ct5.js → index-633eqxry.js} +7 -7
  67. package/dist/{index-g1d06ct5.js.map → index-633eqxry.js.map} +1 -1
  68. package/dist/index-6r9h7ftn.js +308 -0
  69. package/dist/index-6r9h7ftn.js.map +21 -0
  70. package/dist/{index-kktaw552.js → index-7gsbzvnc.js} +2 -2
  71. package/dist/{index-z88f35vs.js → index-94k4mh6s.js} +13 -13
  72. package/dist/{index-z88f35vs.js.map → index-94k4mh6s.js.map} +3 -3
  73. package/dist/index-9dmgk6d3.js +5 -0
  74. package/dist/{index-tny7c703.js.map → index-9dmgk6d3.js.map} +1 -1
  75. package/dist/index-9qv87rq7.js +9 -0
  76. package/dist/{index-s4a28ctb.js.map → index-9qv87rq7.js.map} +1 -1
  77. package/dist/{index-k2q76dhw.js → index-a6mtqkth.js} +6 -6
  78. package/dist/{index-k2q76dhw.js.map → index-a6mtqkth.js.map} +1 -1
  79. package/dist/{index-0m0x1454.js → index-ac2wzspd.js} +4 -4
  80. package/dist/{index-0m0x1454.js.map → index-ac2wzspd.js.map} +1 -1
  81. package/dist/{index-wxmqyv4c.js → index-ad5c9t83.js} +4 -4
  82. package/dist/{index-wxmqyv4c.js.map → index-ad5c9t83.js.map} +1 -1
  83. package/dist/{index-b7qc21s7.js → index-akv6e7ge.js} +6 -6
  84. package/dist/{index-b7qc21s7.js.map → index-akv6e7ge.js.map} +1 -1
  85. package/dist/{index-v271gbaz.js → index-ec101x93.js} +4 -4
  86. package/dist/{index-v271gbaz.js.map → index-ec101x93.js.map} +1 -1
  87. package/dist/{index-rhv6gqpt.js → index-f056wkb4.js} +4 -4
  88. package/dist/{index-rhv6gqpt.js.map → index-f056wkb4.js.map} +1 -1
  89. package/dist/{index-c2qjdz4q.js → index-gqaa06yh.js} +8 -8
  90. package/dist/{index-c2qjdz4q.js.map → index-gqaa06yh.js.map} +1 -1
  91. package/dist/{index-rfa0ztab.js → index-j20k6k0m.js} +4 -4
  92. package/dist/{index-rfa0ztab.js.map → index-j20k6k0m.js.map} +1 -1
  93. package/dist/{index-2pzgta33.js → index-jh2az41t.js} +4 -4
  94. package/dist/{index-2pzgta33.js.map → index-jh2az41t.js.map} +1 -1
  95. package/dist/{index-gace5ac7.js → index-mn34kj95.js} +4 -4
  96. package/dist/{index-gace5ac7.js.map → index-mn34kj95.js.map} +1 -1
  97. package/dist/{index-rvq7t636.js → index-myg5enf5.js} +2 -2
  98. package/dist/{index-s78sq9g1.js → index-pdsey1ab.js} +45 -45
  99. package/dist/{index-s78sq9g1.js.map → index-pdsey1ab.js.map} +1 -1
  100. package/dist/{index-jmnjcw61.js → index-psk6q25h.js} +4 -4
  101. package/dist/{index-jmnjcw61.js.map → index-psk6q25h.js.map} +1 -1
  102. package/dist/{index-3s2q0m64.js → index-q8b1fc3k.js} +4 -4
  103. package/dist/{index-3s2q0m64.js.map → index-q8b1fc3k.js.map} +1 -1
  104. package/dist/{index-g8n8rhtr.js → index-qh82wtpa.js} +3 -3
  105. package/dist/{index-g8n8rhtr.js.map → index-qh82wtpa.js.map} +1 -1
  106. package/dist/{index-gqbny9gy.js → index-s2tzq27a.js} +6 -6
  107. package/dist/{index-gqbny9gy.js.map → index-s2tzq27a.js.map} +1 -1
  108. package/dist/{index-1wxw30j1.js → index-s57ztjhq.js} +35 -35
  109. package/dist/index-s57ztjhq.js.map +13 -0
  110. package/dist/{index-jv7egrh2.js → index-skkddg44.js} +4 -4
  111. package/dist/{index-jv7egrh2.js.map → index-skkddg44.js.map} +1 -1
  112. package/dist/{index-9m6b14b4.js → index-thmq816c.js} +4 -4
  113. package/dist/{index-9m6b14b4.js.map → index-thmq816c.js.map} +1 -1
  114. package/dist/{index-es4bgkbh.js → index-trx9xb59.js} +6 -6
  115. package/dist/{index-es4bgkbh.js.map → index-trx9xb59.js.map} +1 -1
  116. package/dist/{index-60jxyzbe.js → index-twcgf73h.js} +4 -4
  117. package/dist/{index-60jxyzbe.js.map → index-twcgf73h.js.map} +1 -1
  118. package/dist/index-vw2hf4d8.js +6 -0
  119. package/dist/{index-v6taf4vn.js.map → index-vw2hf4d8.js.map} +1 -1
  120. package/dist/{index-m5rmhcez.js → index-w97gprre.js} +4 -4
  121. package/dist/{index-m5rmhcez.js.map → index-w97gprre.js.map} +1 -1
  122. package/dist/index-wk6andxq.js +5 -0
  123. package/dist/{index-ak304afj.js.map → index-wk6andxq.js.map} +1 -1
  124. package/dist/index-x9z2xnct.js +11 -0
  125. package/dist/{index-5nprb9px.js.map → index-x9z2xnct.js.map} +1 -1
  126. package/dist/index-xa9crtzq.js +6 -0
  127. package/dist/{index-qe3ybzh6.js.map → index-xa9crtzq.js.map} +1 -1
  128. package/dist/{index-0v2gw4mk.js → index-y34s71qe.js} +3 -3
  129. package/dist/{index-0v2gw4mk.js.map → index-y34s71qe.js.map} +1 -1
  130. package/dist/{index-y6r1k2yd.js → index-ye2yb3xf.js} +7 -7
  131. package/dist/{index-y6r1k2yd.js.map → index-ye2yb3xf.js.map} +1 -1
  132. package/dist/{index-y605a1rj.js → index-z0dgxd7d.js} +10 -10
  133. package/dist/{index-y605a1rj.js.map → index-z0dgxd7d.js.map} +2 -2
  134. package/dist/{index-m01mb74d.js → index-zg89tq04.js} +4 -4
  135. package/dist/{index-m01mb74d.js.map → index-zg89tq04.js.map} +1 -1
  136. package/dist/{index-dgrwpzz9.js → index-zjphh8ch.js} +4 -4
  137. package/dist/{index-dgrwpzz9.js.map → index-zjphh8ch.js.map} +1 -1
  138. package/dist/index.js +172 -172
  139. package/dist/index.js.map +4 -4
  140. package/dist/transcript.d.ts.map +1 -1
  141. package/dist/web-f6869dy2.js +14 -0
  142. package/dist/{web-stkkwyka.js.map → web-f6869dy2.js.map} +1 -1
  143. package/dist/wrapper-52c0vacs.js +5 -0
  144. package/dist/{wrapper-bwxbqa53.js.map → wrapper-52c0vacs.js.map} +1 -1
  145. package/package.json +2 -2
  146. package/dist/APEv2Parser-jdp5yp24.js +0 -5
  147. package/dist/App-pmqmzsb3.js +0 -11
  148. package/dist/FlacParser-6jwner07.js +0 -5
  149. package/dist/WizardApp-qrq36nv8.js +0 -5
  150. package/dist/config-z2cd0c5f.js +0 -24
  151. package/dist/credential-h0wmsjsw.js +0 -19
  152. package/dist/index-1wxw30j1.js.map +0 -13
  153. package/dist/index-358nsn9t.js +0 -65
  154. package/dist/index-358nsn9t.js.map +0 -21
  155. package/dist/index-3mvenfbg.js +0 -5
  156. package/dist/index-5nprb9px.js +0 -11
  157. package/dist/index-ak304afj.js +0 -5
  158. package/dist/index-qe3ybzh6.js +0 -6
  159. package/dist/index-s4a28ctb.js +0 -9
  160. package/dist/index-tny7c703.js +0 -5
  161. package/dist/index-v6taf4vn.js +0 -6
  162. package/dist/web-stkkwyka.js +0 -14
  163. package/dist/wrapper-bwxbqa53.js +0 -5
  164. /package/dist/{DsdiffParser-gk95sj7t.js.map → DsdiffParser-vxnfx80c.js.map} +0 -0
  165. /package/dist/{FlacParser-6jwner07.js.map → FlacParser-bf8y3e0w.js.map} +0 -0
  166. /package/dist/{index-kktaw552.js.map → index-7gsbzvnc.js.map} +0 -0
  167. /package/dist/{index-rvq7t636.js.map → index-myg5enf5.js.map} +0 -0
package/dist/index.js.map CHANGED
@@ -18,13 +18,13 @@
18
18
  "/**\n * What an endpoint will tell you about itself, and what it will only tell you by refusing.\n *\n * Pure: every function here takes bytes an endpoint sent and returns a finding. The network lives in\n * `model.ts`, which is what makes the interesting half — *which* of four techniques answered, and\n * whether the answer is a floor or a ceiling — testable against recorded responses rather than\n * against somebody's API key.\n *\n * ## Floors and ceilings are different claims and must never be merged\n *\n * A request that **succeeds** at 100,000 tokens proves the window is *at least* 100,000. It says\n * nothing about the number above it. A request that is **refused with a number in the message** proves\n * the window is *exactly* that number, because the endpoint just said so.\n *\n * The registry's existing comment is honest about being a floor — *\"A floor, not a ceiling… Claiming\n * only what was shown\"* — and that honesty is precisely how `deepseek-v4-pro` came to be declared at\n * 393,216 against a published 1,048,576 and stayed there. So a floor is reported as a floor, and\n * `--write` refuses to put one in a manifest without being told to: writing a floor as though it were\n * a measurement recreates the bug this phase exists to fix, one generation later.\n *\n * ## Why the techniques are ordered\n *\n * Cheapest first, and every one of them is worth trying because they fail independently:\n *\n * 1. **`GET /models`** — free. Some gateways publish a context length; OpenAI does not, vLLM does.\n * 2. **An over-range `max_tokens`** — free, because the request is refused before a token is\n * generated. This is the one that yields a *ceiling* on the output limit, and sometimes on the\n * window, because the refusal is generated from the endpoint's own configuration.\n * 3. **Caching by effect** — two small calls. The only way to answer a question no endpoint answers\n * directly. It was written on the suspicion that `promptCache: \"none\"` on every `deepseek-*` row\n * meant the cache-stable prefix had never been exercised, and the first live run **refuted that**:\n * DeepSeek reported 1024 of 1115 prompt tokens cached with no cache-control markers sent, which is\n * exactly what the registry's own comment already said — *\"`none` is a statement about the\n * runtime's job, not the provider's behaviour\"*. The technique stays because confirming a comment\n * with a number is the point, and because an endpoint that stops caching would otherwise be\n * invisible.\n * 4. **A prompt-size search** — expensive, behind `--window`, and the only technique that can raise a\n * floor when the endpoint refuses to say anything.\n */\n\n/** Whether a number bounds the window from above, from below, or not at all. */\nexport type Bound = \"ceiling\" | \"floor\"\n\nexport type Technique = \"metadata\" | \"refusal\" | \"search\"\n\nexport interface WindowFinding {\n readonly technique: Technique\n readonly tokens: number\n readonly bound: Bound\n /** One line naming what was observed, for a report a person has to believe. */\n readonly detail: string\n}\n\nexport interface CacheFinding {\n /**\n * `undefined` means the endpoint reported no cache field at all — which is not the same as\n * reporting a zero hit, and the two must not be collapsed. A missing field means the question was\n * not answered; a zero means it was answered \"no hit on this call\", which on a second identical\n * call is evidence of no caching.\n */\n readonly cached: number | undefined\n readonly promptTokens: number\n /** The usage field that carried it — vendors spell this three different ways. */\n readonly field: string | undefined\n}\n\n/** The four numbers a `/models` row might carry a window under, across the gateways seen so far. */\nconst CONTEXT_KEYS = [\n \"context_length\",\n \"context_window\",\n \"max_context_length\",\n // vLLM, which is what an open-weights host is usually running.\n \"max_model_len\",\n] as const\n\n/** The three spellings of \"how much of this prompt was a cache hit\". */\nconst CACHE_FIELDS = [\n // DeepSeek: a top-level pair on `usage`.\n [\"prompt_cache_hit_tokens\", (usage: Record<string, unknown>) => usage.prompt_cache_hit_tokens],\n // OpenAI: nested under `prompt_tokens_details`.\n [\n \"prompt_tokens_details.cached_tokens\",\n (usage: Record<string, unknown>) => {\n const details = usage.prompt_tokens_details\n return isRecord(details) ? details.cached_tokens : undefined\n },\n ],\n // Anthropic-compatible gateways.\n [\"cache_read_input_tokens\", (usage: Record<string, unknown>) => usage.cache_read_input_tokens],\n] as const\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n}\n\nfunction positiveInteger(value: unknown): number | undefined {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return undefined\n if (!Number.isInteger(value) || value <= 0) return undefined\n return value\n}\n\n/**\n * A context length published by `GET /models`, for the row naming this model.\n *\n * Matched on the row rather than taken from the first entry: an endpoint serving several models\n * returns several rows, and the first one is somebody else's window. A gateway that returns the id in\n * a different shape than the manifest spells it — a vendor prefix, an Ollama tag — is handled by the\n * same suffix rule the capability registry uses, because the two are answering the same question\n * about the same string.\n */\nexport function contextFromModels(payload: unknown, modelId: string): WindowFinding | undefined {\n const data = isRecord(payload) ? payload.data : undefined\n const rows = Array.isArray(data) ? data : Array.isArray(payload) ? payload : undefined\n if (rows === undefined) return undefined\n\n const wanted = modelId.toLowerCase()\n for (const row of rows) {\n if (!isRecord(row)) continue\n const id = typeof row.id === \"string\" ? row.id.toLowerCase() : undefined\n if (id === undefined) continue\n // Exact, or the bare name behind a gateway's vendor prefix. Never a loose contains: `gpt-4o`\n // is a substring of `gpt-4o-mini`, and returning the wrong row's window silently would be the\n // worst available outcome for a command whose whole job is to be trusted.\n const matches = id === wanted || id.endsWith(`/${wanted}`) || wanted.endsWith(`/${id}`)\n if (!matches) continue\n for (const key of CONTEXT_KEYS) {\n const tokens = positiveInteger(row[key])\n if (tokens !== undefined) {\n return {\n technique: \"metadata\",\n tokens,\n // The endpoint published it as a property of the model, so it is what the endpoint\n // believes rather than something inferred from an acceptance.\n bound: \"ceiling\",\n detail: `GET /models published ${key}: ${tokens}`,\n }\n }\n }\n // The row exists and carries no context field. Worth stopping on rather than continuing to\n // scan: another row matching the same id is not a thing that happens, and reporting a\n // different model's number is worse than reporting nothing.\n return undefined\n }\n return undefined\n}\n\n/**\n * A number an endpoint named while refusing.\n *\n * Deliberately narrow. Every candidate is a *labelled* number — \"maximum context length is 128000\",\n * \"max_tokens must be <= 8192\" — because an error message is full of numbers that mean nothing here:\n * an HTTP status, a request id, a rate-limit window. A parser that grabbed the largest integer in the\n * string would eventually write a request id into somebody's manifest as a context window.\n *\n * Returns the *largest* labelled match rather than the first: a message naming both the window and\n * the tokens already used (\"128000 tokens, however you requested 130000\") reads in either order, and\n * the window is the larger of the pair in every real message seen.\n */\nexport function ceilingFromRefusal(message: string): number | undefined {\n const patterns = [\n // \"the valid range of max_tokens is [1, 393216]\" — DeepSeek, measured 2026-08-24. The upper\n // bound is the answer and the lower one is a **trap**: the lazy `max_?tokens` pattern below\n // matches the `1` and reported an output cap of 1, which is what a live run found. Kept first\n // for readability only; `Math.max` over every labelled match is what actually saves it, and\n // that rule earned its keep here rather than in the abstract.\n /(?:max_?tokens|context[\\s_]?(?:length|window))[^[\\]]{0,40}\\[\\s*\\d[\\d_,]*\\s*,\\s*(\\d[\\d_,]*)\\s*\\]/i,\n // \"This model's maximum context length is 128000 tokens\"\n /maximum context length is (\\d[\\d_,]*)/i,\n // \"max_tokens must be <= 8192\", \"max_tokens: must be less than or equal to 4096\"\n /max_?tokens[^.\\d]{0,40}?(\\d[\\d_,]*)/i,\n // \"context length of 32768\", \"context window of 200000\"\n /context (?:length|window)(?: of)? (?:is )?(\\d[\\d_,]*)/i,\n // vLLM: \"This model's maximum context length is 4096 tokens. However, you requested...\"\n /maximum (?:sequence|model) length (?:is )?(\\d[\\d_,]*)/i,\n ]\n const found: number[] = []\n for (const pattern of patterns) {\n const match = pattern.exec(message)\n if (match?.[1] === undefined) continue\n const tokens = positiveInteger(Number(match[1].replaceAll(/[,_]/g, \"\")))\n if (tokens !== undefined) found.push(tokens)\n }\n if (found.length === 0) return undefined\n return Math.max(...found)\n}\n\n/** What a `usage` object says about cache hits, in whichever of the three spellings it uses. */\nexport function cacheFromUsage(usage: unknown): CacheFinding | undefined {\n if (!isRecord(usage)) return undefined\n const promptTokens = positiveInteger(usage.prompt_tokens) ?? 0\n for (const [field, read] of CACHE_FIELDS) {\n const raw = read(usage)\n // Zero is a real answer here and `positiveInteger` would discard it — the difference between\n // \"reported no hit\" and \"did not report\" is the whole finding.\n if (typeof raw === \"number\" && Number.isFinite(raw)) {\n return { cached: raw, promptTokens, field }\n }\n }\n return { cached: undefined, promptTokens, field: undefined }\n}\n\n/**\n * The verdict two identical calls support, and nothing stronger.\n *\n * A hit on the second call proves caching. No hit proves nothing on its own — the prefix may be under\n * the endpoint's minimum cacheable size, which for the vendors documenting one is in the hundreds of\n * tokens — so the negative verdict names that possibility instead of asserting `promptCache: \"none\"`.\n * Writing an unsupported negative into a registry row is how the current rows got there.\n */\nexport function cacheVerdict(\n first: CacheFinding | undefined,\n second: CacheFinding | undefined,\n minimumPrefix: number,\n): { readonly supported: boolean | undefined; readonly detail: string } {\n if (first === undefined || second === undefined) {\n return {\n supported: undefined,\n detail: \"no usage came back, so the question was not answered\",\n }\n }\n if (second.field === undefined) {\n return {\n supported: undefined,\n detail: \"the endpoint reported usage with no cache field in it — unknown, not absent\",\n }\n }\n const hit = second.cached ?? 0\n if (hit > 0) {\n return {\n supported: true,\n detail: `the second identical call reported ${hit} cached of ${second.promptTokens} prompt tokens, via ${second.field}`,\n }\n }\n return {\n supported: false,\n detail: `${second.field} came back 0 on an identical repeat of a ${minimumPrefix}-token prefix — evidence of no caching, not proof: a longer prefix may still hit`,\n }\n}\n\nexport interface RoleProbe {\n readonly role: string\n readonly modelId: string\n readonly baseUrl: string\n /** What the manifest and registry currently believe, for the comparison line. */\n readonly declared: number\n readonly declaredSource: string\n readonly findings: readonly WindowFinding[]\n readonly cache: { readonly supported: boolean | undefined; readonly detail: string }\n /** An `outputCeiling` the refusal named, when it named one separately from the window. */\n readonly outputCeiling: number | undefined\n readonly failures: readonly string[]\n}\n\n/**\n * The strongest claim the findings support.\n *\n * A ceiling beats a floor however large the floor is, because they are different claims rather than\n * competing estimates: a floor of 900,000 and a ceiling of 128,000 means the search was measuring\n * something other than the window, and taking the larger would publish a number the endpoint has\n * already contradicted. Among findings of the same kind the largest wins — a bigger floor is a\n * stronger floor, and two ceilings that disagree are an endpoint contradicting itself, where the\n * higher one is the one it refused *with*.\n */\nexport function bestFinding(findings: readonly WindowFinding[]): WindowFinding | undefined {\n const ceilings = findings.filter((entry) => entry.bound === \"ceiling\")\n const pool = ceilings.length > 0 ? ceilings : findings\n return pool.reduce<WindowFinding | undefined>(\n (best, entry) => (best === undefined || entry.tokens > best.tokens ? entry : best),\n undefined,\n )\n}\n\n/**\n * A paste-ready registry row for `capabilities.ts`.\n *\n * Printed rather than written, deliberately: changing a shipped default affects every agent that ever\n * runs that model, and the one thing worse than a wrong number in the registry is a wrong number that\n * arrived there without anybody reading it. `--write` touches the manifest, which is one agent.\n */\nexport function registryRow(\n modelId: string,\n tokens: number,\n outputCeiling: number | undefined,\n): string {\n const pattern = `${modelId.split(\":\")[0]}*`\n return [\n \" {\",\n ` pattern: \"${pattern}\",`,\n \" capabilities: {\",\n ` contextWindow: ${tokens.toLocaleString(\"en-US\").replaceAll(\",\", \"_\")},`,\n ...(outputCeiling === undefined\n ? []\n : [\n ` maxOutput: ${outputCeiling.toLocaleString(\"en-US\").replaceAll(\",\", \"_\")},`,\n ]),\n \" // the other fields are unchanged — this row reports only what was measured\",\n \" },\",\n \" },\",\n ].join(\"\\n\")\n}\n\n/**\n * The comment `--write` leaves beside the number it writes.\n *\n * This is the whole of decision 3.8's \"measured\" case: there is no schema field saying a number was\n * measured, because a field like that is settable by hand and would turn a fact into a claim. A dated\n * comment naming the endpoint is for the person reading the file in six months, and nothing parses it.\n */\nexport function measuredComment(host: string, isoDate: string, detail: string): string {\n return `measured ${isoDate} against ${host} — ${detail}`\n}\n\n/**\n * What a `--window` search will spend, in tokens, before it runs.\n *\n * Tokens rather than dollars, and that is a deliberate departure from the plan as written. Pricing is\n * per-vendor, changes without notice, and a table of it in this repo would be wrong within a quarter —\n * a confidently wrong dollar figure is worse than an honest token count the person can multiply by a\n * number they actually know. `--price` accepts that number when they want the arithmetic done.\n *\n * The doubling search sends each size once, so the total is the sum of the sizes, which is a hair\n * under twice the largest — the standard geometric-series result, stated because a reader checking the\n * estimate against the requests will otherwise expect the sum of a linear scan.\n */\nexport function searchCost(start: number, ceiling: number): { requests: number; tokens: number } {\n let size = Math.max(1, start)\n let tokens = 0\n let requests = 0\n while (size < ceiling) {\n tokens += size\n requests += 1\n size *= 2\n }\n tokens += ceiling\n requests += 1\n return { requests, tokens }\n}\n",
19
19
  "/**\n * `model probe` — ask the endpoint what it can actually do, instead of guessing from its name.\n *\n * Every `init` preset's default model has an unverified context window and nothing has ever said so.\n * `deepseek-v4-pro` is declared at 393,216 against a published 1,048,576, and `claude-*` is one\n * registry row for every Claude model ever released.\n *\n * The third suspicion this was built on turned out to be wrong, which is worth keeping written down:\n * `promptCache: \"none\"` on every `deepseek-*` row looked like a cost bug, and the registry comment\n * beside those rows had already answered it — the field says the *runtime* places no breakpoints, not\n * that the provider does not cache. The first live run measured 1024 of 1115 prompt tokens cached, so\n * the comment was right and the alarm was not. Nothing in core reads the field at all today; its only\n * consumer is a line of `validate`'s output.\n *\n * ## What it costs, and why the order is what it is\n *\n * Two of the four techniques are free. `GET /models` is a metadata read. The over-range `max_tokens`\n * request is **refused before a token is generated**, so it is billed for nothing — which is what\n * makes it the best technique here rather than merely a clever one: it asks the endpoint to state its\n * own limit and the endpoint answers in the error message.\n *\n * The caching probe sends two small calls, and is the only way to answer a question no endpoint\n * exposes directly. The window search is behind `--window` because it is the one that spends real\n * money, and it prints what it will spend before it spends it.\n *\n * ## Every role, not just main\n *\n * An agent can run three models on three endpoints, and until Phase 7D only main's window was\n * reported anywhere at all. A compactor quietly running on `CONSERVATIVE`'s 8,192 is the configuration\n * decision 12.x calls *\"the intended production shape and usually the biggest available cost win\"*, so\n * it is exactly the one that must not be silently wrong. Roles that fall back to main are skipped\n * rather than probed twice — they are the same endpoint and the same model.\n */\n\nimport {\n bearerHeaders,\n editManifest,\n endpointUrl,\n isHarnessError,\n loadManifest,\n modelsUrl,\n windowReport,\n} from \"@dispach/core\"\nimport { ambientEnv } from \"#lib/ambient\"\nimport { askYesNo } from \"#lib/confirm\"\nimport { EXIT_FAILURE, EXIT_OK } from \"#lib/const\"\nimport {\n bestFinding,\n type CacheFinding,\n cacheFromUsage,\n cacheVerdict,\n ceilingFromRefusal,\n contextFromModels,\n measuredComment,\n type RoleProbe,\n registryRow,\n searchCost,\n type WindowFinding,\n} from \"#lib/probe\"\nimport { keyValue, section } from \"#lib/render\"\n\n/**\n * A `max_tokens` no endpoint can honour, chosen to be refused rather than clamped.\n *\n * Large enough that nothing serves it, small enough to stay inside a 32-bit signed integer — a value\n * past that is rejected by some gateways as a *type* error, whose message names no limit and answers\n * nothing.\n */\nconst IMPOSSIBLE_MAX_TOKENS = 2_000_000_000\n\n/**\n * The prefix length the caching probe repeats.\n *\n * Vendors that document a minimum cacheable prefix put it in the hundreds of tokens, so a two-word\n * probe would report \"no caching\" for every endpoint on earth and the negative would be worthless.\n * This is deliberately over that line and still costs a fraction of a cent.\n */\nconst CACHE_PREFIX_TOKENS = 1024\n\n/** Where a `--window` search starts, and the ceiling it refuses to climb past without being asked. */\nconst SEARCH_START = 8192\nconst SEARCH_LIMIT = 2_097_152\n\nexport interface ModelOptions {\n readonly manifestPath: string\n readonly window: boolean\n /** Dollars per million input tokens, for the one arithmetic step this cannot know. */\n readonly price?: number\n readonly write: boolean\n /** Skip the `--window` spend prompt. Never widens anything else. */\n readonly yes: boolean\n readonly json: boolean\n /** Injected by tests. Production passes nothing and gets the global. */\n readonly fetch?: typeof globalThis.fetch\n}\n\ninterface Endpoint {\n readonly chat: string\n readonly models: string\n readonly headers: Record<string, string>\n readonly modelId: string\n}\n\n/** A word of roughly one token, repeated — good enough to size a prompt, which is all this needs. */\nfunction filler(tokens: number): string {\n return \"context \".repeat(Math.max(1, tokens))\n}\n\nasync function readBody(response: Response): Promise<{ text: string; json: unknown }> {\n const text = await response.text()\n try {\n return { text, json: JSON.parse(text) }\n } catch {\n return { text, json: undefined }\n }\n}\n\n/** The message an endpoint put in its error body, wherever it put it. */\nfunction errorMessage(json: unknown, fallback: string): string {\n if (typeof json === \"object\" && json !== null) {\n const record = json as Record<string, unknown>\n const error = record.error\n if (typeof error === \"string\") return error\n if (typeof error === \"object\" && error !== null) {\n const message = (error as Record<string, unknown>).message\n if (typeof message === \"string\") return message\n }\n if (typeof record.message === \"string\") return record.message\n }\n return fallback\n}\n\n/** Technique 1: metadata. Free, and absent on more endpoints than it is present. */\nasync function probeMetadata(\n endpoint: Endpoint,\n doFetch: typeof globalThis.fetch,\n failures: string[],\n): Promise<WindowFinding | undefined> {\n try {\n const response = await doFetch(endpoint.models, { headers: endpoint.headers })\n if (!response.ok) {\n failures.push(`GET /models answered ${response.status}`)\n return undefined\n }\n const { json } = await readBody(response)\n const finding = contextFromModels(json, endpoint.modelId)\n if (finding === undefined) failures.push(\"GET /models published no context length\")\n return finding\n } catch (cause) {\n failures.push(\n `GET /models failed: ${cause instanceof Error ? cause.message : String(cause)}`,\n )\n return undefined\n }\n}\n\n/**\n * Technique 2: ask for an impossible output and read the refusal.\n *\n * The refusal is free and it is *authoritative* — the endpoint generated the number from its own\n * configuration rather than from a table somebody maintained. Two numbers can come back: an output\n * ceiling (`max_tokens must be <= 8192`) and sometimes the window itself.\n */\nasync function probeRefusal(\n endpoint: Endpoint,\n doFetch: typeof globalThis.fetch,\n failures: string[],\n): Promise<{ window: WindowFinding | undefined; outputCeiling: number | undefined }> {\n try {\n const response = await doFetch(endpoint.chat, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", ...endpoint.headers },\n body: JSON.stringify({\n model: endpoint.modelId,\n messages: [{ role: \"user\", content: \"hi\" }],\n max_tokens: IMPOSSIBLE_MAX_TOKENS,\n }),\n })\n const { text, json } = await readBody(response)\n if (response.ok) {\n // It served the request rather than refusing it, which means `max_tokens` was clamped\n // silently. That is a real finding about the endpoint and not a probe failure — and it is\n // the shape CLAUDE.md warns about: an endpoint that ignores a parameter says nothing.\n failures.push(\n \"the endpoint accepted an impossible max_tokens rather than refusing it — it clamps silently, so this technique cannot measure it\",\n )\n return { window: undefined, outputCeiling: undefined }\n }\n const message = errorMessage(json, text.slice(0, 400))\n const named = ceilingFromRefusal(message)\n if (named === undefined) {\n failures.push(`the refusal named no number: ${message.slice(0, 160)}`)\n return { window: undefined, outputCeiling: undefined }\n }\n // A number under the declared window is an *output* ceiling, not a context one: no endpoint\n // refuses a two-token prompt for being too long. Above it, the refusal is about the window.\n const looksLikeOutput = /max_?tokens/i.test(message)\n return {\n window: looksLikeOutput\n ? undefined\n : {\n technique: \"refusal\",\n tokens: named,\n bound: \"ceiling\",\n detail: `refused an over-range request naming ${named}`,\n },\n outputCeiling: looksLikeOutput ? named : undefined,\n }\n } catch (cause) {\n failures.push(\n `the over-range request failed: ${cause instanceof Error ? cause.message : String(cause)}`,\n )\n return { window: undefined, outputCeiling: undefined }\n }\n}\n\n/** One small call, returning what it reported about caching. */\nasync function cacheCall(\n endpoint: Endpoint,\n doFetch: typeof globalThis.fetch,\n prompt: string,\n): Promise<CacheFinding | undefined> {\n const response = await doFetch(endpoint.chat, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", ...endpoint.headers },\n body: JSON.stringify({\n model: endpoint.modelId,\n messages: [{ role: \"user\", content: prompt }],\n max_tokens: 1,\n }),\n })\n if (!response.ok) return undefined\n const { json } = await readBody(response)\n const usage =\n typeof json === \"object\" && json !== null\n ? (json as Record<string, unknown>).usage\n : undefined\n return cacheFromUsage(usage)\n}\n\n/**\n * Technique 3: the same prompt twice, looking for a hit on the second.\n *\n * The single most consequential line in this command's output. It is also the one whose *negative*\n * must be stated carefully — a miss proves nothing on its own, because the prefix may be under the\n * endpoint's minimum, and `cacheVerdict` says so rather than concluding `none`.\n */\nasync function probeCache(\n endpoint: Endpoint,\n doFetch: typeof globalThis.fetch,\n failures: string[],\n): Promise<{ supported: boolean | undefined; detail: string }> {\n const prompt = `${filler(CACHE_PREFIX_TOKENS)}\\nReply with the single character x.`\n try {\n const first = await cacheCall(endpoint, doFetch, prompt)\n const second = await cacheCall(endpoint, doFetch, prompt)\n return cacheVerdict(first, second, CACHE_PREFIX_TOKENS)\n } catch (cause) {\n failures.push(\n `the caching probe failed: ${cause instanceof Error ? cause.message : String(cause)}`,\n )\n return { supported: undefined, detail: \"the probe did not complete\" }\n }\n}\n\n/**\n * Technique 4: grow a prompt until it is refused.\n *\n * Doubling rather than binary search, and the difference is the point: a binary search needs an upper\n * bound to bisect against, and not knowing the upper bound is the entire problem. Doubling finds the\n * bracket, and the *refusal* that ends it usually names the real number — at which point the search\n * has bought a ceiling rather than the floor it was aiming for, which is a better result than it was\n * designed to get.\n */\nasync function probeSearch(\n endpoint: Endpoint,\n doFetch: typeof globalThis.fetch,\n failures: string[],\n): Promise<WindowFinding | undefined> {\n let size = SEARCH_START\n let lastAccepted = 0\n while (size <= SEARCH_LIMIT) {\n let response: Response\n try {\n response = await doFetch(endpoint.chat, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", ...endpoint.headers },\n body: JSON.stringify({\n model: endpoint.modelId,\n messages: [{ role: \"user\", content: filler(size) }],\n max_tokens: 1,\n }),\n })\n } catch (cause) {\n failures.push(\n `the search stopped at ${size}: ${cause instanceof Error ? cause.message : String(cause)}`,\n )\n break\n }\n if (response.ok) {\n // The *reported* count, never the requested one. `filler` repeats a word and a word is not\n // a token, so the sizes this loop chooses are only roughly tokens — and a floor is a claim\n // about a number, so labelling it with an estimate would make the one honest output of\n // this technique dishonest. The endpoint counted the prompt; take its answer.\n const { json } = await readBody(response)\n const usage =\n typeof json === \"object\" && json !== null\n ? (json as Record<string, unknown>).usage\n : undefined\n const counted =\n typeof usage === \"object\" && usage !== null\n ? (usage as Record<string, unknown>).prompt_tokens\n : undefined\n lastAccepted =\n typeof counted === \"number\" && Number.isFinite(counted) ? counted : lastAccepted\n size *= 2\n continue\n }\n const { text, json } = await readBody(response)\n const named = ceilingFromRefusal(errorMessage(json, text.slice(0, 400)))\n if (named !== undefined) {\n return {\n technique: \"search\",\n tokens: named,\n bound: \"ceiling\",\n detail: `refused a ${size}-token prompt and named ${named}`,\n }\n }\n break\n }\n if (lastAccepted === 0) return undefined\n return {\n technique: \"search\",\n tokens: lastAccepted,\n // A floor and nothing more. The endpoint accepted this and never said what it would refuse.\n bound: \"floor\",\n detail: `accepted a prompt the endpoint counted at ${lastAccepted} tokens; nothing above it named a number`,\n }\n}\n\nfunction renderRole(probe: RoleProbe, price: number | undefined): string {\n const best = bestFinding(probe.findings)\n const verdict =\n best === undefined\n ? \"nothing measured — every technique came back empty\"\n : `${best.tokens} (${best.bound}) · ${best.detail}`\n const agreement =\n best === undefined\n ? \"\"\n : best.tokens === probe.declared\n ? \"matches what is configured\"\n : best.bound === \"ceiling\" && best.tokens > probe.declared\n ? `configured value is ${probe.declared}, which is ${(best.tokens - probe.declared).toLocaleString(\"en-US\")} tokens short`\n : `configured value is ${probe.declared}`\n const cache =\n probe.cache.supported === undefined\n ? `unknown — ${probe.cache.detail}`\n : probe.cache.supported\n ? `yes — ${probe.cache.detail}`\n : `no — ${probe.cache.detail}`\n\n return [\n section(` ${probe.role} · ${probe.modelId}`),\n keyValue([\n { label: \"endpoint\", value: probe.baseUrl },\n { label: \"configured\", value: `${probe.declared} (${probe.declaredSource})` },\n { label: \"measured\", value: verdict },\n { label: \"agreement\", value: agreement },\n {\n label: \"output cap\",\n value: probe.outputCeiling === undefined ? \"\" : String(probe.outputCeiling),\n },\n { label: \"prompt cache\", value: cache },\n ...(price === undefined\n ? []\n : [{ label: \"price\", value: `$${price}/Mtok input, as given` }]),\n ]),\n ...(probe.failures.length === 0\n ? []\n : [\n // Printed rather than swallowed. A technique that found nothing is information about\n // the endpoint — \"it clamps max_tokens silently\" is a fact worth knowing — and a\n // report that showed only successes would look like the probe had nothing to say.\n \" what did not answer:\",\n ...probe.failures.map((line) => ` · ${line}`),\n ]),\n ...(best === undefined || best.bound !== \"ceiling\"\n ? []\n : [\n \"\",\n \" registry row, if this model should ship with it:\",\n registryRow(probe.modelId, best.tokens, probe.outputCeiling)\n .split(\"\\n\")\n .map((line) => ` ${line}`)\n .join(\"\\n\"),\n ]),\n ].join(\"\\n\")\n}\n\nexport async function modelCommand(options: ModelOptions): Promise<number> {\n const doFetch = options.fetch ?? globalThis.fetch\n try {\n const loaded = loadManifest(options.manifestPath, {\n env: ambientEnv([options.manifestPath]),\n })\n const { manifest } = loaded\n // Only roles carrying their own configuration. A fallback role is the same model on the same\n // endpoint, so probing it again would spend money to learn the same thing twice.\n const roles = windowReport(manifest).filter((entry) => entry.role === entry.configuredAs)\n\n // Decided before the loop so the question is asked once rather than once per role, and\n // *not* by returning early: the two free techniques cost nothing, so declining the search is\n // a reason to skip the search and no reason to skip them. An earlier version returned here\n // and printed \"the free techniques still ran above\", which they had not — a sentence\n // asserting something that did not happen, found by reading the output rather than the code.\n let searchApproved = false\n if (options.window) {\n const cost = searchCost(SEARCH_START, SEARCH_LIMIT)\n const perRole = cost.tokens * roles.length\n const dollars =\n options.price === undefined\n ? \"\"\n : ` ≈ $${((perRole / 1_000_000) * options.price).toFixed(2)}`\n process.stdout.write(\n `--window will send up to ${cost.requests} requests per role, about ${perRole.toLocaleString(\"en-US\")} input tokens in total${dollars}.\\n` +\n \"That is an upper bound: the search stops at the first refusal, and the refused request generates nothing.\\n\" +\n \"Tokens rather than dollars unless --price says otherwise: a price table in this repo would be wrong within a quarter.\\n\",\n )\n // An estimate a person cannot act on is decoration. `askYesNo` answers **no** on a\n // non-TTY, so a pipe or a CI run is told rather than charged — the same asymmetry\n // `remove` uses, and the reason `--yes` exists for the scripted case.\n searchApproved = options.yes || (await askYesNo(\"spend it?\"))\n process.stdout.write(\n searchApproved\n ? \"\\n\"\n : \"\\nSkipping the search. The free techniques below still run — re-run with --window --yes to search without asking.\\n\\n\",\n )\n }\n\n const probes: RoleProbe[] = []\n for (const entry of roles) {\n const config = manifest.model[entry.role] ?? manifest.model.main\n if (config.baseUrl === undefined) {\n // Every probe here is a chat-completions request; another transport has no\n // `/models` to read and no bearer to send. Saying so beats a request that cannot mean\n // anything.\n process.stdout.write(\n `model.${entry.role} uses the ${config.api ?? \"chat-completions\"} transport, which this probe does not speak. Its window comes from the capability registry: ${entry.window.contextWindow.toLocaleString(\"en-US\")} tokens (${entry.window.source}).\\n`,\n )\n continue\n }\n const endpoint: Endpoint = {\n chat: endpointUrl(config.baseUrl),\n models: modelsUrl(config.baseUrl),\n headers: bearerHeaders(config.apiKeyEnv, loaded.env, `model.${entry.role}`),\n modelId: config.id,\n }\n const failures: string[] = []\n const findings: WindowFinding[] = []\n\n const metadata = await probeMetadata(endpoint, doFetch, failures)\n if (metadata !== undefined) findings.push(metadata)\n\n const refusal = await probeRefusal(endpoint, doFetch, failures)\n if (refusal.window !== undefined) findings.push(refusal.window)\n\n const cache = await probeCache(endpoint, doFetch, failures)\n\n if (searchApproved) {\n const searched = await probeSearch(endpoint, doFetch, failures)\n if (searched !== undefined) findings.push(searched)\n }\n\n probes.push({\n role: entry.role,\n modelId: config.id,\n baseUrl: config.baseUrl,\n declared: entry.window.contextWindow,\n declaredSource: entry.window.source,\n findings,\n cache,\n outputCeiling: refusal.outputCeiling,\n failures,\n })\n }\n\n if (options.json) {\n process.stdout.write(`${JSON.stringify({ agent: manifest.id, probes }, null, 2)}\\n`)\n return EXIT_OK\n }\n\n const applied = options.write\n ? await writeMeasured(loaded.path, probes)\n : { written: [], refused: [] }\n\n process.stdout.write(\n [\n `probed ${manifest.id} · ${probes.length} role${probes.length === 1 ? \"\" : \"s\"}`,\n ...probes.map((probe) => renderRole(probe, options.price)),\n \"\",\n ...(options.write\n ? [\n ...(applied.written.length === 0\n ? []\n : [\n \" written to the manifest:\",\n ...applied.written.map((l) => ` ${l}`),\n ]),\n // Refusals are printed, never silent. \"Nothing happened\" and \"nothing needed\n // to happen\" are different, and a --write that reported neither would look\n // like it had worked.\n ...(applied.refused.length === 0\n ? []\n : [\" not written:\", ...applied.refused.map((l) => ` ${l}`)]),\n \" A restart picks it up — an agent's settings are fixed for its lifetime.\",\n ]\n : [writeNote(probes)]),\n \"\",\n ].join(\"\\n\"),\n )\n return EXIT_OK\n } catch (error) {\n if (isHarnessError(error)) {\n process.stderr.write(`${error.format()}\\n`)\n return EXIT_FAILURE\n }\n throw error\n }\n}\n\n/**\n * Write the measured window into the manifest — and refuse to write a floor.\n *\n * The refusal is the feature. A floor says \"at least this much\" and writing it as `contextWindow`\n * turns it into \"exactly this much\" the moment anybody reads the file: that is precisely how\n * `deepseek-v4-pro` came to sit at 393,216 against a published 1,048,576, and a command that\n * recreated it one generation later would be worse than no command. Only a **ceiling** — a number the\n * endpoint named while refusing — is written.\n *\n * Through `editManifest`, never by re-serialising: a whole-file rewrite cannot be validated, and\n * `parseDocument` → `setIn` → `String(doc)` reflows comments into the wrong section.\n */\nasync function writeMeasured(\n file: string,\n probes: readonly RoleProbe[],\n): Promise<{ written: string[]; refused: string[] }> {\n const written: string[] = []\n const refused: string[] = []\n for (const probe of probes) {\n const best = bestFinding(probe.findings)\n if (best === undefined) {\n refused.push(`${probe.role}: nothing measured`)\n continue\n }\n if (best.bound !== \"ceiling\") {\n refused.push(\n `${probe.role}: ${best.tokens} is a floor, not a window — the endpoint accepted it and never said what it would refuse`,\n )\n continue\n }\n if (best.tokens === probe.declared) {\n refused.push(`${probe.role}: already ${best.tokens}, nothing to change`)\n continue\n }\n await editManifest({\n file,\n path: [\"model\", probe.role, \"capabilities\", \"contextWindow\"],\n value: best.tokens,\n })\n written.push(`${probe.role}: ${probe.declared} → ${best.tokens}`)\n }\n return { written, refused }\n}\n\n/**\n * The paste-ready line, for the run that did not pass `--write`.\n *\n * The comment is the whole of decision 3.8's \"measured\" case: there is no schema field claiming a\n * number was measured, because such a field is settable by hand and would turn a fact into a claim.\n * A dated comment naming the endpoint is for the person reading the file in six months.\n */\nfunction writeNote(probes: readonly RoleProbe[]): string {\n const ceilings = probes.filter((probe) => bestFinding(probe.findings)?.bound === \"ceiling\")\n if (ceilings.length === 0) {\n return \" Nothing measured a ceiling, so there is nothing worth writing down. A floor is not a window.\"\n }\n const first = ceilings[0]\n const best = first === undefined ? undefined : bestFinding(first.findings)\n if (first === undefined || best === undefined) return \"\"\n const host = new URL(first.baseUrl).host\n return [\n \" --write records this. By hand, it is one line under the role, and the comment is the point:\",\n ` contextWindow: ${best.tokens}`,\n ` # ${measuredComment(host, new Date().toISOString().slice(0, 10), best.detail)}`,\n ].join(\"\\n\")\n}\n",
20
20
  "/**\n * `plugins` — install one, list what an agent loaded, or remove one.\n *\n * ## Three questions, and why `list` answers two of them\n *\n * `plugins list` was the whole command for three phases: the surface decision 7.5 promised, since\n * `permissions` is advisory vocabulary and a vocabulary nobody can read is one nobody declares\n * accurately. It prints the declarations beside what each plugin registered, which together answer\n * the only two questions worth asking of a plugin — what did naming this buy me, and what did it ask\n * for. It is a command rather than a line in `validate` because `plugin.loaded` fires during boot,\n * before anything can subscribe, so the runtime carries the report and this reads it.\n *\n * It now also prints **which lookup answered** for each entry. With three lookups — the binary's own\n * registry, the plugin root, then a module import — \"which code is loaded\" stops being derivable from\n * the manifest alone, and an installed plugin shadowed by a same-named bundled one would otherwise be\n * invisible.\n *\n * ## Why `add` verifies before it writes\n *\n * A manifest naming a plugin that will not load **does not load**, so an `add` that wrote the entry\n * and left a broken directory behind would brick the agent and report success — and `plugins remove`,\n * the command that undoes it, would be reachable only by hand-editing the file. So the order is:\n * fetch to a partial directory, refuse there, and only then rename into place and write the entry.\n *\n * The verification is `conformance()` from `@dispach/core/testing` — the same suite the plugin's own\n * author runs, rather than a second definition of \"well-formed\" living here. It calls `setup` once\n * into a void, so nothing is constructed and no credential is read. That does mean **reading the\n * declarations runs the plugin's module scope**, which `add` says out loud: there is no way to learn\n * what a plugin declares without loading it, because the declarations are its default export, and a\n * second place to declare them would be a second thing to keep in step.\n */\n\nimport { existsSync, rmSync } from \"node:fs\"\nimport { resolve } from \"node:path\"\nimport {\n BRAND,\n editManifest,\n HarnessError,\n type Permission,\n type Plugin,\n Runtime,\n readManifestHeader,\n satisfiesApiRange,\n VERSION,\n} from \"@dispach/core\"\nimport { conformance } from \"@dispach/core/testing\"\nimport { ambientEnv } from \"#lib/ambient\"\nimport { EXIT_OK } from \"#lib/const\"\nimport { onExit } from \"#lib/exit\"\nimport {\n entryOf,\n fetchPlugin,\n type InstalledPlugin,\n installedPlugins,\n notSelfContained,\n pluginNameFor,\n} from \"#lib/plugin-install\"\nimport {\n BUILT_IN_PLUGIN_SPECS,\n BUILT_IN_PLUGINS,\n CHANNELS,\n MEDIA_PROVIDERS,\n MODEL_TRANSPORTS,\n scriptRunner,\n TOOL_PROVIDERS,\n} from \"#lib/providers\"\nimport { keyValue, type Row } from \"#lib/render\"\nimport { listAgents, pluginDir, pluginRoot, storePath } from \"#lib/sandbox\"\nimport type { PluginsOptions } from \"#lib/schema\"\nimport { looksLikePath } from \"#lib/source-cache\"\nimport { isSourceName, parseSourceUrl } from \"#lib/sources\"\n\nexport async function pluginsCommand(options: PluginsOptions): Promise<number> {\n switch (options.action) {\n case \"list\":\n return await listCommand(options)\n case \"add\":\n return await addCommand(options)\n case \"remove\":\n return await removeCommand(options)\n default:\n throw new HarnessError({\n code: \"cli_plugins_action_unknown\",\n message: `plugins: ${JSON.stringify(options.action)} is not an action`,\n hint: `Actions are list, add and remove — \\`${BRAND.slug} plugins list <agent>\\`.`,\n })\n }\n}\n\n// ─── list ────────────────────────────────────────────────────────────────────────────────\n\nasync function listCommand(options: PluginsOptions): Promise<number> {\n const runtime = await Runtime.create({\n agents: [options.manifestPath],\n toolProviders: TOOL_PROVIDERS,\n modelTransports: MODEL_TRANSPORTS,\n mediaProviders: MEDIA_PROVIDERS,\n builtInPlugins: BUILT_IN_PLUGINS,\n pluginRoot: pluginRoot(options.env),\n scriptRunner: scriptRunner(),\n channels: CHANNELS,\n env: ambientEnv([options.manifestPath]),\n store: storePath(options.env),\n lease: false,\n })\n onExit(() => runtime.stop(\"cli-exit\"))\n\n const loaded = [...runtime.plugins.values()].flat()\n const installed = installedPlugins(options.env)\n\n if (options.json === true) {\n process.stdout.write(\n `${JSON.stringify(\n { plugins: loaded, installed, available: BUILT_IN_PLUGIN_SPECS },\n null,\n 2,\n )}\\n`,\n )\n return EXIT_OK\n }\n\n if (loaded.length === 0) {\n // Names what could be written rather than printing an empty table. A capability reachable\n // only by somebody who already knows the field names is a capability the surface is hiding —\n // the same reason `init` asks about every provider the runtime has.\n process.stdout.write(\n `No plugins. This binary can resolve these by name:\\n\\n${BUILT_IN_PLUGIN_SPECS.map(\n (spec) => ` - \"${spec}\"`,\n ).join(\n \"\\n\",\n )}\\n\\nAdd a \\`plugins:\\` block to agent.yaml naming the ones you want, or fetch one with \\`${BRAND.slug} plugins add <agent> <repo>\\`.\\n`,\n )\n if (installed.length > 0) {\n process.stdout.write(\n `\\nInstalled in ${pluginRoot(options.env)} and named by no agent:\\n${installed\n .map((entry) => ` - \"${entry.name}\"`)\n .join(\"\\n\")}\\n`,\n )\n }\n return EXIT_OK\n }\n\n const rows: Row[] = loaded.map((plugin) => ({\n label: plugin.name,\n value: `${plugin.version} ${`${plugin.setupMs} ms`.padStart(9)}`,\n note: `${lookupNote(plugin.spec, plugin.lookup, installed)} — ${\n plugin.registered.length === 0 ? \"registered nothing\" : plugin.registered.join(\", \")\n }`,\n }))\n process.stdout.write(`${keyValue(rows)}\\n`)\n\n // Printed separately, and only when something declared one. Advisory in v1 — the line says so,\n // because a permission list that reads as enforcement is worse than none: it invites the belief\n // that installing a plugin is bounded by what it declared.\n const declaring = loaded.filter((plugin) => plugin.permissions.length > 0)\n if (declaring.length > 0) {\n process.stdout.write(\"\\nDeclared access — advisory in v1, recorded and not enforced:\\n\")\n for (const plugin of declaring) {\n for (const permission of plugin.permissions) {\n process.stdout.write(\n ` ${plugin.name} ${permission.kind} ${permissionDetail(permission)}\\n`,\n )\n }\n }\n }\n\n const unused = installed.filter((entry) => !loaded.some((plugin) => plugin.spec === entry.name))\n if (unused.length > 0) {\n process.stdout.write(\n `\\nAlso installed, named by no agent: ${unused.map((entry) => entry.name).join(\", \")}\\n`,\n )\n }\n return EXIT_OK\n}\n\n/** Which of the three lookups answered, with the commit when provenance knows one. */\nfunction lookupNote(spec: string, lookup: string, installed: readonly InstalledPlugin[]): string {\n if (lookup !== \"installed\") return lookup === \"registry\" ? \"built in\" : \"imported\"\n const origin = installed.find((entry) => entry.name === spec)?.origin\n return origin === undefined ? \"installed\" : `installed ${origin.commit}`\n}\n\nfunction permissionDetail(permission: Permission): string {\n switch (permission.kind) {\n case \"network\":\n return permission.hosts.join(\", \")\n case \"env\":\n return permission.vars.join(\", \")\n case \"fs\":\n return `${permission.paths.join(\", \")} (${permission.mode})`\n case \"exec\":\n return permission.commands.join(\", \")\n default:\n return permission.tables.join(\", \")\n }\n}\n\n// ─── add ─────────────────────────────────────────────────────────────────────────────────\n\nasync function addCommand(options: PluginsOptions): Promise<number> {\n const typed = options.rest?.[0]\n if (typed === undefined || typed === \"\") {\n throw new HarnessError({\n code: \"cli_plugins_add_needs_repo\",\n message: \"plugins add needs a repository\",\n hint: `\\`${BRAND.slug} plugins add <agent> <owner/repo> [--ref v1.0.0]\\`. A plugin is fetched with git — an owner/repo shorthand, a clone URL, the page URL you were reading (whose .../tree/<branch>/<subdir> is understood), or a local repository while you are writing one.`,\n })\n }\n // A local repository is a first-class spec, because it is the only way an author can test the\n // bundle they are about to publish: `plugins:` can already name a relative path, but that is not\n // what runs in the container — a vendored copy in the plugin root is. Filesystem-first, the rule\n // `resolveAgentRef` and `skills install` both follow, so a path is never read as `owner/repo`.\n const parsed = looksLikePath(typed)\n ? { url: resolve(typed.replace(/^file:\\/\\//, \"\")) }\n : parseSourceUrl(typed)\n // A `--ref` beats one read out of a `/tree/<branch>/` URL: the flag is what somebody typed on\n // purpose, and the URL's branch is usually whatever page they happened to be reading.\n const ref = options.ref ?? parsed.ref\n const name =\n options.name === undefined ? pluginNameFor(parsed.url, parsed.path) : checked(options.name)\n\n const existing = installedPlugins(options.env).find((entry) => entry.name === name)\n if (existing?.origin !== undefined && existing.origin.url !== parsed.url) {\n throw new HarnessError({\n code: \"plugin_name_taken\",\n message: `A different plugin is already installed as \"${name}\" — from ${existing.origin.url}`,\n hint: `Two repositories cannot share one directory, and the directory name is what a manifest's \\`plugins:\\` entry means. Pass \\`--name <name>\\`, or \\`${BRAND.slug} plugins remove <agent> ${name}\\` first.`,\n })\n }\n\n process.stdout.write(\n `Fetching ${parsed.url}${ref === undefined ? \"\" : ` at ${ref}`} as \"${name}\"…\\n`,\n )\n\n let report: Awaited<ReturnType<typeof conformance>> | undefined\n\n const fetched = await fetchPlugin(\n {\n name,\n url: parsed.url,\n ...(ref === undefined ? {} : { ref }),\n ...(parsed.path === undefined ? {} : { path: parsed.path }),\n },\n {\n ...(options.env === undefined ? {} : { env: options.env }),\n ...(options.git === undefined ? {} : { git: options.git }),\n // Everything that could refuse runs here, against the partial directory, so a refusal\n // leaves whatever was installed under this name untouched and the manifest unwritten.\n inspect: async (dir) => {\n const problem = notSelfContained(dir)\n if (problem !== undefined) {\n throw new HarnessError({\n code: \"plugin_not_self_contained\",\n message: `${name} cannot be loaded as fetched: ${problem}`,\n hint: \"A plugin is distributed as one self-contained bundle. Nothing is installed while this runtime runs (hard rule 5), so a declared dependency would simply be missing at boot. Ask the author to bundle their dependencies, or commit node_modules in the distribution repository.\",\n })\n }\n const entry = entryOf(dir)\n if (!existsSync(entry)) {\n throw new HarnessError({\n code: \"plugin_entry_missing\",\n message: `${name} has no entry file — ${entry.slice(dir.length + 1)} is not in the repository`,\n hint: \"A plugin directory is entered through the `main` its package.json names, defaulting to index.js. A distribution repository commits its built entry file; a source checkout does not, which is usually what this means.\",\n })\n }\n const plugin = await pluginFromFile(name, entry)\n report = await conformance(plugin)\n if (!report.ok) {\n throw new HarnessError({\n code: \"plugin_not_conformant\",\n message: `${report.declared.name} does not meet the plugin contract:\\n${report.findings\n .filter((finding) => finding.level === \"error\")\n .map((finding) => ` ${finding.check}: ${finding.message}`)\n .join(\"\\n\")}`,\n hint: `This is the same suite the plugin's own author runs — \\`conformance()\\` from ${BRAND.packageScope}/core/testing. Nothing was installed. Report it upstream with the checks named above.`,\n })\n }\n // A range that does not admit this host is a **warning** in the suite, because\n // running it against a newer host than a plugin targets is a normal thing for an\n // author to do. Installing is not: the loader refuses this at boot, so writing the\n // entry would leave an agent that will not start, reported as success.\n if (satisfiesApiRange(VERSION, report.declared.apiRange) !== true) {\n throw new HarnessError({\n code: \"plugin_api_mismatch\",\n message: `${report.declared.name} ${report.declared.version} supports host ${report.declared.apiRange}, and this host is ${VERSION}`,\n hint: \"The loader refuses this at boot, so installing it would write an entry that stops the agent starting. Look for a newer release of the plugin, or a `--ref` that matches this host.\",\n })\n }\n },\n },\n )\n\n // Disclosure after the fetch rather than before, and the reason is stated rather than hidden:\n // what a plugin declares *is* its default export, so there is nothing to read without loading\n // the module — which has now happened. The alternative is a second place to declare it.\n const declared = report?.declared\n process.stdout.write(\n `\\n${declared?.name ?? name} ${declared?.version ?? \"?\"} (${fetched.commit})\\n` +\n ` from ${parsed.url}${ref === undefined ? \"\" : ` at ${ref}`}\\n` +\n ` installed ${fetched.dir}\\n` +\n ` host range ${declared?.apiRange ?? \"?\"} — this host is ${VERSION}\\n` +\n ` registers ${report === undefined || report.registered.length === 0 ? \"nothing\" : report.registered.join(\", \")}\\n`,\n )\n if (declared !== undefined && declared.permissions.length > 0) {\n process.stdout.write(\n `\\nIt declares access to:\\n${declared.permissions\n .map((permission) => ` ${permission.kind} ${permissionDetail(permission)}`)\n .join(\"\\n\")}\\n` +\n \"\\nAdvisory only. `permissions` is recorded and enforced by nothing in v1 (decision 7.5) —\\n\" +\n \"a plugin is trusted in-process code, so this list is what the author says it needs, not a\\n\" +\n \"boundary. Install plugins you trust.\\n\",\n )\n } else {\n process.stdout.write(\n \"\\nIt declares no access. That is not a guarantee: `permissions` is advisory in v1, so a\\nplugin that declares nothing can still do anything this process can. Install plugins you trust.\\n\",\n )\n }\n const warnings = report?.findings.filter((finding) => finding.level === \"warning\") ?? []\n for (const warning of warnings) {\n process.stdout.write(`\\nnote: ${warning.check} — ${warning.message}\\n`)\n }\n\n // The manifest entry is the **directory** name, which is not always the plugin's own `name` —\n // `--name` decides one and the author decides the other. Said out loud when they differ, because\n // `plugins list` keys its rows by the plugin's name and the manifest by the directory, and\n // somebody reading both would otherwise have two names and no stated relationship.\n if (declared !== undefined && declared.name !== name) {\n process.stdout.write(\n `\\nnote: it calls itself \"${declared.name}\"; the \\`plugins:\\` entry is the directory, \"${name}\".\\n`,\n )\n }\n\n const result = await addToManifest(options.manifestPath, name)\n process.stdout.write(\n result === \"already\"\n ? `\\n${options.manifestPath} already names \"${name}\".\\n`\n : `\\nAdded \"${name}\" to the plugins: block in ${options.manifestPath}.\\nIt loads at the next start — an agent's plugins are fixed for its lifetime, so restart a running one.\\n`,\n )\n return EXIT_OK\n}\n\nfunction checked(name: string): string {\n if (isSourceName(name)) return name\n throw new HarnessError({\n code: \"plugin_name_invalid\",\n message: `--name ${JSON.stringify(name)} is not a usable plugin directory name`,\n hint: \"Lowercase letters, digits and single hyphens. That segment is what the manifest's `plugins:` entry names, so it has to be a directory name and a YAML scalar at once.\",\n })\n}\n\n/**\n * Load a file and get the plugin out of it.\n *\n * Deliberately narrow: two conditions, and `conformance()` produces every other finding. A third\n * definition of \"is this a plugin\" — after the loader's and the suite's — is what this avoids.\n */\nasync function pluginFromFile(name: string, entry: string): Promise<Plugin> {\n let module: unknown\n try {\n module = await import(entry)\n } catch (cause) {\n throw new HarnessError({\n code: \"plugin_import_failed\",\n message: `${name}: ${entry} could not be imported — ${cause instanceof Error ? cause.message : String(cause)}`,\n hint: \"A plugin is one self-contained ES module. A bare `require` or an unresolved import is what this usually means, and neither can be fixed by installing anything: nothing is installed while this runtime runs. Nothing was installed.\",\n cause,\n })\n }\n const candidate = (module as { default?: unknown }).default\n if (candidate === null || typeof candidate !== \"object\") {\n throw new HarnessError({\n code: \"plugin_malformed\",\n message: `${name}: ${entry} has no object as its default export`,\n hint: `A plugin is the module's default export: an object with \\`name\\`, \\`version\\`, a \\`${BRAND.slug}Api\\` host range and \\`setup\\`. A named export is not searched for and a factory function is not called, because a wrong guess produces a plugin that registers nothing and reports success.`,\n })\n }\n if (typeof (candidate as { setup?: unknown }).setup !== \"function\") {\n throw new HarnessError({\n code: \"plugin_malformed\",\n message: `${name}: the default export of ${entry} has no \\`setup\\` function`,\n hint: \"`setup(context)` is the whole extension surface — it registers channels, tool providers, a script runner or middleware, and does no work.\",\n })\n }\n return candidate as Plugin\n}\n\n/** Append the entry unless it is already there. The one manifest writer does the placing. */\nasync function addToManifest(manifestPath: string, name: string): Promise<\"written\" | \"already\"> {\n const header = readManifestHeader(manifestPath)\n const refs = header.plugins ?? []\n const already = refs.some((ref) => (typeof ref === \"string\" ? ref : ref.spec) === name)\n if (already) return \"already\"\n await editManifest({\n file: manifestPath,\n path: [\"plugins\"],\n // Strings, not `{spec}` maps: a bare entry is what a manifest should carry when there is no\n // config, and the object form is for the entries that need one.\n value: [...refs.map((ref) => (typeof ref === \"string\" ? ref : ref.spec)), name],\n })\n return \"written\"\n}\n\n// ─── remove ──────────────────────────────────────────────────────────────────────────────\n\nasync function removeCommand(options: PluginsOptions): Promise<number> {\n const name = options.rest?.[0]\n if (name === undefined || name === \"\") {\n throw new HarnessError({\n code: \"cli_plugins_remove_needs_name\",\n message: \"plugins remove needs a name\",\n hint: `\\`${BRAND.slug} plugins remove <agent> <name>\\`, where the name is the \\`plugins:\\` entry — \\`plugins list <agent>\\` prints them.`,\n })\n }\n\n const header = readManifestHeader(options.manifestPath)\n const refs = (header.plugins ?? []).map((ref) => (typeof ref === \"string\" ? ref : ref.spec))\n if (refs.includes(name)) {\n await editManifest({\n file: options.manifestPath,\n path: [\"plugins\"],\n value: refs.filter((ref) => ref !== name),\n })\n // A pointer rather than a claim. Whether anything in the manifest *depended* on this plugin\n // is only knowable by loading it, which has just been deleted — and the consequence is loud\n // at the next start (`channels[0] declares type \"x\", which is not registered here`), so what\n // is worth buying here is the one command that says so before that start.\n process.stdout.write(\n `Dropped \"${name}\" from ${options.manifestPath}.\\nRun \\`${BRAND.slug} validate ${options.manifestPath}\\` — a channel or tool provider it supplied is now unresolved.\\n`,\n )\n } else {\n process.stdout.write(`${options.manifestPath} does not name \"${name}\".\\n`)\n }\n\n const dir = pluginDir(name, options.env)\n if (!existsSync(dir)) {\n process.stdout.write(`Nothing installed at ${dir}.\\n`)\n return EXIT_OK\n }\n\n // The directory is machine-level and shared, so deleting it while another agent still names it\n // would break that agent at its next start — with the damage done by a command somebody ran\n // about a different agent. Named rather than deleted, which is the same call `remove` makes\n // about two directories sharing one manifest id.\n const others = otherAgentsNaming(name, options.manifestPath, options.env)\n if (others.length > 0) {\n process.stdout.write(\n `Kept ${dir} — still named by ${others.join(\", \")}.\\nRemove it from those agents first, or delete the directory by hand.\\n`,\n )\n return EXIT_OK\n }\n rmSync(dir, { recursive: true, force: true })\n process.stdout.write(`Deleted ${dir}.\\n`)\n return EXIT_OK\n}\n\n/** Sandbox agents other than this one whose `plugins:` names it. Header reads, so no credentials. */\nfunction otherAgentsNaming(\n name: string,\n exceptManifest: string,\n env?: Readonly<Record<string, string | undefined>>,\n): readonly string[] {\n const found: string[] = []\n for (const agent of listAgents(env)) {\n if (agent.manifestPath === exceptManifest) continue\n try {\n const header = readManifestHeader(agent.manifestPath)\n const refs = (header.plugins ?? []).map((ref) =>\n typeof ref === \"string\" ? ref : ref.spec,\n )\n if (refs.includes(name)) found.push(agent.ref)\n } catch {\n // A broken manifest cannot be asked. Not a reason to refuse the delete — `listAgents`\n // already surfaces it, and treating unreadable as \"names it\" would make one corrupt\n // agent pin every plugin on the machine forever.\n }\n }\n return found\n}\n",
21
- "import\"../index-yn977xfp.js\";\nimport {\n EventBus2,\n VERSION2,\n satisfies,\n SETUP_BUDGET_MS2\n} from \"../index-a2myjg6x.js\";\n\n// src/testing/conformance.ts\nvar SILENT = { debug: () => {}, info: () => {}, warn: () => {}, error: () => {} };\nfunction isPermission(value) {\n if (value === null || typeof value !== \"object\")\n return false;\n const kind = value.kind;\n return kind === \"network\" || kind === \"env\" || kind === \"fs\" || kind === \"exec\" || kind === \"store\";\n}\nasync function conformance(plugin, options = {}) {\n const findings = [];\n const registered = [];\n const hostVersion = options.hostVersion ?? VERSION2;\n const error = (check, message, hint) => {\n findings.push({ level: \"error\", check, message, hint });\n };\n const warn = (check, message, hint) => {\n findings.push({ level: \"warning\", check, message, hint });\n };\n if (typeof plugin.name !== \"string\" || plugin.name === \"\") {\n error(\"name\", \"The plugin has no name.\", \"`name` is how events, errors and `plugins` output refer to this plugin. It must be unique within a runtime.\");\n }\n if (satisfies(plugin.version, \"*\") === undefined) {\n error(\"version\", `\\`version\\` is ${JSON.stringify(plugin.version)}, which is not a plain semver triple.`, \"Write it as `major.minor.patch`. It is reported verbatim in `plugin.loaded`, and a version nobody can compare is a version nobody can act on.\");\n }\n const decided = satisfies(hostVersion, plugin.dispachApi);\n if (decided === undefined) {\n error(\"dispachApi\", `\\`dispachApi\\` is ${JSON.stringify(plugin.dispachApi)}, which the host cannot check.`, \"Supported: `*`, an exact version, `^`, `~`, space-separated comparators, and `||`. A range the host cannot parse is refused rather than assumed satisfied, so this plugin would not load.\");\n } else if (!decided) {\n warn(\"dispachApi\", `\\`dispachApi\\` ${plugin.dispachApi} does not admit this host (${hostVersion}).`, \"Correct if you are testing against a host you do not support. A warning rather than an error, because running the suite on a newer host than the plugin targets is a normal thing to do.\");\n }\n if (plugin.dispachApi.trim() === \"*\") {\n warn(\"dispachApi\", \"`dispachApi` is `*`, which accepts every host version including ones that do not exist yet.\", \"Narrow it to the range you have actually tested. A plugin that never refuses to load is a plugin that fails at runtime instead, somewhere else, with nothing pointing back at the skew.\");\n }\n for (const [index, permission] of (plugin.permissions ?? []).entries()) {\n if (!isPermission(permission)) {\n error(\"permissions\", `\\`permissions[${index}]\\` is not one of the declared kinds.`, \"Kinds are network, env, fs, exec and store. Advisory in v1 — but authors who declare accurately before enforcement lands are the ones who will not have to scramble afterwards.\");\n }\n }\n let config = options.config ?? {};\n if (plugin.configSchema !== undefined) {\n const parsed = plugin.configSchema.safeParse(config);\n if (parsed.success)\n config = parsed.data;\n else {\n warn(\"configSchema\", \"The schema refused the config this suite passed.\", \"Pass a valid `config` through `conformance(plugin, { config })`. The default is `{}`, which a schema with required fields correctly rejects.\");\n }\n }\n const context = {\n defineChannel: (id) => registered.push(`channel:${id}`),\n defineToolProvider: (id) => registered.push(`toolProvider:${id}`),\n defineModelTransport: (api) => registered.push(`modelTransport:${api}`),\n defineMediaProvider: (name) => registered.push(`mediaProvider:${name}`),\n defineScriptRunner: () => registered.push(\"scriptRunner\"),\n use: (entry) => registered.push(`middleware:${entry.name}`),\n defineRoute: (route) => registered.push(`route:${route.method} ${route.path}`),\n config,\n agentId: \"conformance\",\n paths: {\n workspace: \"/nonexistent/conformance\",\n state: \"/nonexistent/conformance/.state\",\n manifest: \"/nonexistent/conformance/agent.yaml\"\n },\n env: {},\n logger: SILENT,\n events: new EventBus2({ runtimeId: \"conformance\" })\n };\n const started = performance.now();\n try {\n await plugin.setup(context);\n } catch (cause) {\n error(\"setup\", `\\`setup\\` threw: ${cause instanceof Error ? cause.message : String(cause)}`, \"`setup` registers capabilities and does no work, so it must succeed with an empty environment and a workspace that does not exist. Read a token in the factory you register, not here — that runs only when an agent actually uses the capability.\");\n }\n const setupMs = Math.round((performance.now() - started) * 100) / 100;\n if (setupMs > SETUP_BUDGET_MS2) {\n error(\"setup budget\", `\\`setup\\` took ${setupMs} ms against a ${SETUP_BUDGET_MS2} ms budget.`, \"Move the work into the factory you register. A channel connects in `start()`, which runs after readiness; a provider resolves from its cache at boot and refreshes afterwards. Hard rule 4: no network I/O before `runtime.ready`.\");\n }\n if (registered.length === 0) {\n warn(\"setup\", \"`setup` registered nothing.\", \"A plugin that registers no channel, tool provider, script runner or middleware extends nothing. Every `define*` and `use` call is recorded, so registering something and still seeing this means the registration did not run — check for a branch in `setup` that skipped it.\");\n }\n return {\n ok: findings.every((finding) => finding.level !== \"error\"),\n findings,\n registered,\n setupMs,\n declared: {\n name: plugin.name,\n version: plugin.version,\n apiRange: plugin.dispachApi,\n permissions: (plugin.permissions ?? []).filter(isPermission)\n }\n };\n}\nfunction formatFindings(result) {\n if (result.findings.length === 0)\n return \"conformance: ok\";\n return result.findings.map((finding) => `${finding.level}: ${finding.check} — ${finding.message}\n hint: ${finding.hint}`).join(`\n`);\n}\nexport {\n conformance,\n formatFindings\n};\n\n//# debugId=F3C53EED8CB17C7064756E2164756E21\n//# sourceMappingURL=index.js.map\n",
21
+ "import\"../index-yn977xfp.js\";\nimport {\n EventBus2,\n VERSION2,\n satisfies,\n SETUP_BUDGET_MS2\n} from \"../index-fz4as3rh.js\";\n\n// src/testing/conformance.ts\nvar SILENT = { debug: () => {}, info: () => {}, warn: () => {}, error: () => {} };\nfunction isPermission(value) {\n if (value === null || typeof value !== \"object\")\n return false;\n const kind = value.kind;\n return kind === \"network\" || kind === \"env\" || kind === \"fs\" || kind === \"exec\" || kind === \"store\";\n}\nasync function conformance(plugin, options = {}) {\n const findings = [];\n const registered = [];\n const hostVersion = options.hostVersion ?? VERSION2;\n const error = (check, message, hint) => {\n findings.push({ level: \"error\", check, message, hint });\n };\n const warn = (check, message, hint) => {\n findings.push({ level: \"warning\", check, message, hint });\n };\n if (typeof plugin.name !== \"string\" || plugin.name === \"\") {\n error(\"name\", \"The plugin has no name.\", \"`name` is how events, errors and `plugins` output refer to this plugin. It must be unique within a runtime.\");\n }\n if (satisfies(plugin.version, \"*\") === undefined) {\n error(\"version\", `\\`version\\` is ${JSON.stringify(plugin.version)}, which is not a plain semver triple.`, \"Write it as `major.minor.patch`. It is reported verbatim in `plugin.loaded`, and a version nobody can compare is a version nobody can act on.\");\n }\n const decided = satisfies(hostVersion, plugin.dispachApi);\n if (decided === undefined) {\n error(\"dispachApi\", `\\`dispachApi\\` is ${JSON.stringify(plugin.dispachApi)}, which the host cannot check.`, \"Supported: `*`, an exact version, `^`, `~`, space-separated comparators, and `||`. A range the host cannot parse is refused rather than assumed satisfied, so this plugin would not load.\");\n } else if (!decided) {\n warn(\"dispachApi\", `\\`dispachApi\\` ${plugin.dispachApi} does not admit this host (${hostVersion}).`, \"Correct if you are testing against a host you do not support. A warning rather than an error, because running the suite on a newer host than the plugin targets is a normal thing to do.\");\n }\n if (plugin.dispachApi.trim() === \"*\") {\n warn(\"dispachApi\", \"`dispachApi` is `*`, which accepts every host version including ones that do not exist yet.\", \"Narrow it to the range you have actually tested. A plugin that never refuses to load is a plugin that fails at runtime instead, somewhere else, with nothing pointing back at the skew.\");\n }\n for (const [index, permission] of (plugin.permissions ?? []).entries()) {\n if (!isPermission(permission)) {\n error(\"permissions\", `\\`permissions[${index}]\\` is not one of the declared kinds.`, \"Kinds are network, env, fs, exec and store. Advisory in v1 — but authors who declare accurately before enforcement lands are the ones who will not have to scramble afterwards.\");\n }\n }\n let config = options.config ?? {};\n if (plugin.configSchema !== undefined) {\n const parsed = plugin.configSchema.safeParse(config);\n if (parsed.success)\n config = parsed.data;\n else {\n warn(\"configSchema\", \"The schema refused the config this suite passed.\", \"Pass a valid `config` through `conformance(plugin, { config })`. The default is `{}`, which a schema with required fields correctly rejects.\");\n }\n }\n const context = {\n defineChannel: (id) => registered.push(`channel:${id}`),\n defineToolProvider: (id) => registered.push(`toolProvider:${id}`),\n defineModelTransport: (api) => registered.push(`modelTransport:${api}`),\n defineMediaProvider: (name) => registered.push(`mediaProvider:${name}`),\n defineScriptRunner: () => registered.push(\"scriptRunner\"),\n use: (entry) => registered.push(`middleware:${entry.name}`),\n defineRoute: (route) => registered.push(`route:${route.method} ${route.path}`),\n config,\n agentId: \"conformance\",\n paths: {\n workspace: \"/nonexistent/conformance\",\n state: \"/nonexistent/conformance/.state\",\n manifest: \"/nonexistent/conformance/agent.yaml\"\n },\n env: {},\n logger: SILENT,\n events: new EventBus2({ runtimeId: \"conformance\" })\n };\n const started = performance.now();\n try {\n await plugin.setup(context);\n } catch (cause) {\n error(\"setup\", `\\`setup\\` threw: ${cause instanceof Error ? cause.message : String(cause)}`, \"`setup` registers capabilities and does no work, so it must succeed with an empty environment and a workspace that does not exist. Read a token in the factory you register, not here — that runs only when an agent actually uses the capability.\");\n }\n const setupMs = Math.round((performance.now() - started) * 100) / 100;\n if (setupMs > SETUP_BUDGET_MS2) {\n error(\"setup budget\", `\\`setup\\` took ${setupMs} ms against a ${SETUP_BUDGET_MS2} ms budget.`, \"Move the work into the factory you register. A channel connects in `start()`, which runs after readiness; a provider resolves from its cache at boot and refreshes afterwards. Hard rule 4: no network I/O before `runtime.ready`.\");\n }\n if (registered.length === 0) {\n warn(\"setup\", \"`setup` registered nothing.\", \"A plugin that registers no channel, tool provider, script runner or middleware extends nothing. Every `define*` and `use` call is recorded, so registering something and still seeing this means the registration did not run — check for a branch in `setup` that skipped it.\");\n }\n return {\n ok: findings.every((finding) => finding.level !== \"error\"),\n findings,\n registered,\n setupMs,\n declared: {\n name: plugin.name,\n version: plugin.version,\n apiRange: plugin.dispachApi,\n permissions: (plugin.permissions ?? []).filter(isPermission)\n }\n };\n}\nfunction formatFindings(result) {\n if (result.findings.length === 0)\n return \"conformance: ok\";\n return result.findings.map((finding) => `${finding.level}: ${finding.check} — ${finding.message}\n hint: ${finding.hint}`).join(`\n`);\n}\nexport {\n conformance,\n formatFindings\n};\n\n//# debugId=F3C53EED8CB17C7064756E2164756E21\n//# sourceMappingURL=index.js.map\n",
22
22
  "/**\n * Fetching a plugin, and reading what is installed.\n *\n * ## One self-contained bundle, and why that is the whole design\n *\n * Nothing installs dependencies, ever — hard rule 5, and it is what makes this mechanism small\n * enough to be worth having at all. A plugin is fetched as a directory with a runnable entry file\n * and nothing to resolve, so the npm install and the container — whose `node_modules` holds only\n * the two declared dependencies — load a plugin exactly as a checkout does. `notSelfContained` is what keeps that\n * true: a tree that declares runtime dependencies and ships none is refused **here**, rather than\n * half-loading at somebody's next boot.\n *\n * ## Git, and what git costs\n *\n * `realGit` from `lib/source-cache.ts` is reused wholesale — the only network module in the CLI, with\n * prompting disabled in all four ways git can be asked and a wall-clock timeout, because a\n * `git ls-remote` on a repository that does not exist once sat for two minutes waiting for a\n * credential prompt nobody was watching.\n *\n * What git does not buy, stated rather than discovered: no version resolution and no integrity check.\n * A bare spec is whatever that branch points at today. `--ref` pins a tag or a commit, the resolved\n * commit is recorded beside the plugin, and `plugins list` prints it — so \"which code is loaded\" has\n * an answer. The host-range gate is a **compatibility** check and not an authenticity one; nothing\n * here verifies who published what. npm specs are the thing that would, and they are deliberately out\n * of scope: a registry fetch plus a tar extractor, and a change to \"one npm name\" worth its own\n * decision rather than arriving as a side effect.\n *\n * ## No registry file\n *\n * `sources` needs `sources.json` because a source is machine-level and nothing else records it. A\n * plugin is selected by each agent's own `plugins:` block, so the manifest *is* the registry, and a\n * second list would be exactly the drift this repo keeps paying for. What lives beside the code is\n * provenance, not selection: `.origin.json`, one file per plugin, deleted with the directory.\n */\n\nimport {\n existsSync,\n mkdirSync,\n readdirSync,\n readFileSync,\n renameSync,\n rmSync,\n writeFileSync,\n} from \"node:fs\"\nimport { join } from \"node:path\"\nimport { HarnessError } from \"@dispach/core\"\nimport { pluginDir, pluginRoot } from \"#lib/sandbox\"\nimport { type Git, realGit } from \"#lib/source-cache\"\nimport { isSourceName } from \"#lib/sources\"\n\n/** Provenance, written beside the code. Not a registry — see the module docstring. */\nexport interface PluginOrigin {\n readonly url: string\n /** The branch, tag or commit asked for, or absent for the remote's default. */\n readonly ref?: string\n /** Subdirectory of the repository the plugin was taken from, when it is a monorepo. */\n readonly path?: string\n /** What the ref resolved to at fetch time. Short, as `git rev-parse --short` prints it. */\n readonly commit: string\n readonly fetchedAt: string\n}\n\nexport const ORIGIN_FILE = \".origin.json\"\n\nexport interface InstalledPlugin {\n /** The directory name, which is what a manifest's `plugins:` entry writes. */\n readonly name: string\n readonly dir: string\n readonly origin?: PluginOrigin\n}\n\nexport function readOrigin(dir: string): PluginOrigin | undefined {\n const path = join(dir, ORIGIN_FILE)\n if (!existsSync(path)) return undefined\n try {\n return JSON.parse(readFileSync(path, \"utf8\")) as PluginOrigin\n } catch {\n // A corrupt provenance file costs an \"unknown origin\" line and nothing else. The code beside\n // it still loads, and refusing to list it would hide a plugin that is working.\n return undefined\n }\n}\n\n/**\n * Every plugin directory in the root, alphabetical.\n *\n * A listing of what is *available*, which is a different question from what an agent loads — that\n * one only the manifest answers, and `plugins list` prints both.\n */\nexport function installedPlugins(\n env?: Readonly<Record<string, string | undefined>>,\n): readonly InstalledPlugin[] {\n const root = pluginRoot(env)\n let entries: string[]\n try {\n entries = readdirSync(root)\n } catch {\n // No plugins yet is the normal state, not an error.\n return []\n }\n const found: InstalledPlugin[] = []\n for (const name of entries.sort()) {\n if (name.startsWith(\".\") || name.endsWith(\".partial\")) continue\n const dir = join(root, name)\n if (!existsSync(join(dir, \"package.json\")) && !existsSync(join(dir, \"index.js\"))) continue\n const origin = readOrigin(dir)\n found.push({ name, dir, ...(origin === undefined ? {} : { origin }) })\n }\n return found\n}\n\n/**\n * The entry file a directory would be loaded through — the same derivation the loader performs.\n *\n * Duplicated deliberately and narrowly: core's version *throws* the load-time refusals, and this one\n * answers \"would it load\" before anything is renamed into place. The shape it has to agree about is\n * one field of one file, and `plugins add` asserts the agreement by loading through it.\n */\nexport function entryOf(dir: string): string {\n const packageFile = join(dir, \"package.json\")\n if (!existsSync(packageFile)) return join(dir, \"index.js\")\n try {\n const parsed = JSON.parse(readFileSync(packageFile, \"utf8\")) as { main?: unknown }\n if (typeof parsed.main === \"string\" && parsed.main !== \"\") return join(dir, parsed.main)\n } catch {\n // Reported by the caller's own check, which has a better sentence for it than this does.\n }\n return join(dir, \"index.js\")\n}\n\n/**\n * Why this tree cannot be loaded without an install, or `undefined` when it can.\n *\n * A committed `node_modules` clears it: vendoring the dependencies is a perfectly good way to be\n * self-contained, and refusing a tree that already has what it declares would be refusing the thing\n * being asked for.\n */\nexport function notSelfContained(dir: string): string | undefined {\n const packageFile = join(dir, \"package.json\")\n if (!existsSync(packageFile)) return undefined\n let parsed: { dependencies?: Record<string, string> }\n try {\n parsed = JSON.parse(readFileSync(packageFile, \"utf8\")) as {\n dependencies?: Record<string, string>\n }\n } catch (cause) {\n return `its package.json is not valid JSON (${cause instanceof Error ? cause.message : String(cause)})`\n }\n const declared = Object.keys(parsed.dependencies ?? {})\n if (declared.length === 0) return undefined\n if (existsSync(join(dir, \"node_modules\"))) return undefined\n const shown = declared.slice(0, 4).join(\", \")\n return `it declares ${declared.length} runtime ${declared.length === 1 ? \"dependency\" : \"dependencies\"} (${shown}${declared.length > 4 ? \", …\" : \"\"}) and ships no node_modules`\n}\n\n/** What a person typed, turned into something to clone. */\nexport interface PluginSpec {\n readonly name: string\n readonly url: string\n readonly ref?: string\n readonly path?: string\n}\n\n/**\n * Where a repository URL's plugin name comes from.\n *\n * The subdirectory when the URL names one — a monorepo's `packages/channel-whatsapp` is the plugin,\n * not the repository — and the repository name otherwise. Refused rather than transformed when it is\n * not a usable directory name: silently lowercasing `My-Channel` would put the code somewhere\n * other than where the `plugins:` entry the person then reads says it is.\n */\nexport function pluginNameFor(url: string, path: string | undefined): string {\n const segment =\n (path ?? url)\n .split(\"/\")\n .filter((part) => part.length > 0)\n .pop() ?? \"\"\n const name = segment.replace(/\\.git$/, \"\")\n if (!isSourceName(name)) {\n throw new HarnessError({\n code: \"plugin_name_invalid\",\n message: `${JSON.stringify(name || url)} is not a usable plugin directory name`,\n hint: \"A plugin is installed into one lowercase path segment — letters, digits and single hyphens — because that segment is what the manifest's `plugins:` entry names. Pass `--name <name>` to choose it.\",\n })\n }\n return name\n}\n\nexport interface FetchPluginResult {\n readonly dir: string\n readonly commit: string\n}\n\n/**\n * Clone a plugin into the root, replacing whatever was there only once it has worked.\n *\n * `<dir>.partial` then a rename, the same discipline `fetchSource` uses and for the same reason: an\n * interrupted update leaves the previous copy intact and loadable, and an interrupted *first* fetch\n * leaves no directory rather than an empty one that reads as a plugin with nothing in it.\n *\n * `.git` is dropped afterwards, which is where this differs from a skills source. A source is a\n * working copy that `sources update` re-clones; a plugin directory is a vendored artefact that\n * `.origin.json` describes, and leaving a checkout there invites a `git pull` that would move the\n * code out from under the recorded commit with nothing reporting it.\n *\n * The caller decides whether the result is acceptable *before* renaming — see `plugins add`, which\n * loads the plugin out of the partial directory and refuses there. A command that undoes a mistake\n * must not sit behind the load the mistake breaks.\n */\nexport async function fetchPlugin(\n spec: PluginSpec,\n options: {\n readonly env?: Readonly<Record<string, string | undefined>>\n readonly git?: Git\n /** Called with the partial directory before it is renamed into place. Throwing discards it. */\n readonly inspect?: (dir: string) => Promise<void> | void\n } = {},\n): Promise<FetchPluginResult> {\n const git = options.git ?? realGit\n const target = pluginDir(spec.name, options.env)\n const partial = `${target}.partial`\n\n mkdirSync(pluginRoot(options.env), { recursive: true })\n rmSync(partial, { recursive: true, force: true })\n\n const result = await git([\n \"clone\",\n \"--depth\",\n \"1\",\n \"--single-branch\",\n ...(spec.ref === undefined ? [] : [\"--branch\", spec.ref]),\n spec.url,\n partial,\n ])\n if (result.code !== 0) {\n rmSync(partial, { recursive: true, force: true })\n throw cloneFailed(spec, result.stderr, result.timedOut === true)\n }\n\n const head = await git([\"rev-parse\", \"--short\", \"HEAD\"], partial)\n const commit = head.code === 0 ? head.stdout.trim() : \"unknown\"\n\n // The plugin is the named subdirectory when there is one, so everything downstream — the\n // inspection, the entry, the origin file — is about the tree that will actually be loaded.\n const from = spec.path === undefined ? partial : join(partial, spec.path)\n if (!existsSync(from)) {\n rmSync(partial, { recursive: true, force: true })\n throw new HarnessError({\n code: \"plugin_path_missing\",\n message: `${spec.url} has no ${spec.path} at ${commit}`,\n hint: \"The path comes from the URL you pasted — .../tree/<branch>/<subdir>. Check it against the repository, or pass the repository URL on its own.\",\n })\n }\n rmSync(join(from, \".git\"), { recursive: true, force: true })\n\n try {\n await options.inspect?.(from)\n } catch (error) {\n rmSync(partial, { recursive: true, force: true })\n throw error\n }\n\n rmSync(target, { recursive: true, force: true })\n if (from === partial) {\n renameSync(partial, target)\n } else {\n renameSync(from, target)\n rmSync(partial, { recursive: true, force: true })\n }\n\n const origin: PluginOrigin = {\n url: spec.url,\n ...(spec.ref === undefined ? {} : { ref: spec.ref }),\n ...(spec.path === undefined ? {} : { path: spec.path }),\n commit,\n fetchedAt: new Date().toISOString(),\n }\n writeFileSync(join(target, ORIGIN_FILE), `${JSON.stringify(origin, null, 4)}\\n`)\n return { dir: target, commit }\n}\n\nfunction cloneFailed(spec: PluginSpec, stderr: string, timedOut: boolean): HarnessError {\n const said = stderr.trim().split(\"\\n\").slice(-3).join(\" \")\n if (timedOut) {\n return new HarnessError({\n code: \"plugin_fetch_timeout\",\n message: `${spec.name}: git did not finish in time`,\n hint: `Check the network and try again — the partial fetch was discarded, so whatever was installed as ${spec.name} is untouched.`,\n })\n }\n return new HarnessError({\n code: \"plugin_fetch_failed\",\n message: `${spec.name}: could not clone ${spec.url}${said.length === 0 ? \"\" : ` — ${said}`}`,\n hint: \"A private repository needs a credential helper git can use without prompting. Check the URL and the --ref; nothing was written.\",\n })\n}\n",
23
23
  "/**\n * `remove <agent>` — the mirror of `init`.\n *\n * `init` creates a sandbox agent: a directory, a manifest, a workspace, an `.env`. Everything after\n * that scatters — sessions and memory into one shared `store.db` keyed by manifest id, logs into\n * `logs/<id>.*.log`, a LaunchAgent under `<slug>.agent.<id>`, a lease row while it runs. Nothing put\n * those back together, so deleting an agent meant `rm -rf` plus knowledge nobody has, and the rows\n * left behind were unreachable: `LeaseStore.orphans` sees ids with *running* turns and no lease, which\n * cannot see an agent whose directory was deleted while it was idle.\n *\n * ## Only the sandbox\n *\n * A ref, never a path. `run` accepts `./somewhere/agent.yaml` because running a manifest in place is a\n * real thing to want; deleting one is not — a directory somebody pointed at is theirs to remove, and a\n * command that recursively deletes an arbitrary argument is one bad tab-completion from being the worst\n * thing in this repository. A path is refused, by name, with `rm -rf` named as the honest alternative.\n *\n * ## Show, then require the name typed back\n *\n * `--dry-run` and the confirmation print the *same* listing from the same function, so what a dry run\n * shows is what a real run does. The bar is the agent's name typed back rather than a keypress: `y`\n * against the wrong listing is one keystroke from deleting conversations that cannot be recovered, and\n * the listing exists on the assumption somebody reads it. Not a TTY means no, so a piped run without\n * `--yes` deletes nothing and says so.\n *\n * ## The order is the safety\n *\n * Stop, then unload the service, then rows, then logs, then the directory — see `removalSteps` for why\n * each of those is where it is. The short version: every step but the last is recoverable, and the\n * directory is the only part that is not.\n */\n\nimport { existsSync, readdirSync, rmSync, statSync } from \"node:fs\"\nimport { homedir } from \"node:os\"\nimport { join } from \"node:path\"\nimport { BRAND, HarnessError, processAlive, readManifestHeader, SqliteStore } from \"@dispach/core\"\nimport { EXIT_FAILURE, EXIT_OK } from \"#lib/const\"\nimport { labelFor } from \"#lib/launchd\"\nimport {\n type FileFacts,\n type Orphan,\n type RemovalFacts,\n removalFindings,\n removalSteps,\n renderOrphans,\n renderRemoval,\n} from \"#lib/remove-plan\"\nimport { bullet, keyValue, type Row, section } from \"#lib/render\"\nimport { agentsDir, listAgents, logPaths, sandboxRoot, storePath } from \"#lib/sandbox\"\nimport { type Exec, resolveServiceManager, type ServiceManager } from \"#lib/service\"\nimport { stopCommand } from \"#stop\"\n\n/**\n * The facts plus the manifest path the executor needs.\n *\n * `manifestPath` is deliberately **not** on `RemovalFacts`: the plan module never reads it, and a pure\n * module carrying a field nothing in it uses is a field that can quietly go wrong. It is `stop`'s\n * argument, so it belongs to the half of this that does the work.\n */\ntype Removal = RemovalFacts & { readonly manifestPath: string }\n\nexport interface RemoveOptions {\n /** The sandbox directory name. Absent only with `--prune` or `--all`. */\n readonly ref?: string\n readonly dryRun?: boolean\n /** Delete the directory only; leave the store, the logs and the service alone. */\n readonly filesOnly?: boolean\n /** Rows and logs no sandbox directory claims. */\n readonly prune?: boolean\n readonly all?: boolean\n readonly yes?: boolean\n readonly json?: boolean\n readonly store?: string\n /** Test seams. Nothing in `src/` outside this file passes them. */\n readonly exec?: Exec\n readonly platform?: string\n /** Injected so the prompt is testable, and so `--yes` can bypass it without a fake TTY. */\n readonly confirm?: (question: string, expected: string) => Promise<boolean>\n}\n\nexport async function removeCommand(options: RemoveOptions): Promise<number> {\n const store = await SqliteStore.open({ path: options.store ?? storePath() })\n try {\n if (options.prune === true) return await pruneAction(options, store)\n if (options.all === true) return await allAction(options, store)\n if (options.ref === undefined) {\n throw new HarnessError({\n code: \"cli_remove_needs_agent\",\n message: \"remove needs an agent.\",\n hint: `\\`${BRAND.slug} remove <name>\\` takes a sandbox agent's name — the ones \\`${BRAND.slug} run\\` lists. \\`--prune\\` clears data no agent claims; \\`--all\\` removes every agent.`,\n })\n }\n return await removeOne(options.ref, options, store)\n } finally {\n await store.close()\n }\n}\n\n// ─── one agent ──────────────────────────────────────────────────────────────────────────\n\nasync function removeOne(ref: string, options: RemoveOptions, store: SqliteStore): Promise<number> {\n const facts = await gather(ref, options, store)\n const findings = removalFindings(facts)\n if (findings.length > 0) {\n const first = findings[0] as { code: string; message: string; hint: string }\n throw new HarnessError({ code: first.code, message: first.message, hint: first.hint })\n }\n\n const steps = removalSteps(facts)\n const listing = `${section(`removing ${ref} will:`, true)}\\n${renderRemoval(facts)}\\n\\n${steps\n .map((step) => bullet(step.detail))\n .join(\"\\n\")}\\n`\n\n if (options.dryRun === true) {\n process.stdout.write(\n options.json === true\n ? `${JSON.stringify({ ref, agentId: facts.agentId, steps, footprint: facts.footprint }, null, 2)}\\n`\n : `${listing}\\nNothing was deleted — this was --dry-run.\\n`,\n )\n return EXIT_OK\n }\n\n process.stdout.write(listing)\n if (!(await agreed(options, ref, `type the agent's name to confirm:`))) {\n process.stdout.write(\"\\nNothing was deleted.\\n\")\n return EXIT_OK\n }\n\n return await execute(facts, options, store)\n}\n\n/**\n * Perform the steps, in order, reporting each.\n *\n * A failure to stop **aborts** rather than continuing: deleting the directory out from under a live\n * process leaves it serving from a manifest that no longer exists, with the backgrounded children only\n * a graceful stop would have reaped.\n */\nasync function execute(\n facts: Removal,\n options: RemoveOptions,\n store: SqliteStore,\n): Promise<number> {\n const done: Row[] = []\n\n if (facts.running !== undefined || (!facts.filesOnly && facts.service !== undefined)) {\n // Delegated to `stop` rather than reimplemented: it consults both sources, sends SIGTERM before\n // SIGKILL, and disables as well as unloading. Its output is the same words the stop command\n // prints, which is the point — this is not a second, subtly different way to stop an agent.\n const code = await stopCommand({\n manifestPath: facts.manifestPath,\n ...(options.exec === undefined ? {} : { exec: options.exec }),\n ...(options.platform === undefined ? {} : { platform: options.platform }),\n })\n if (code !== EXIT_OK) {\n process.stderr.write(\n `\\nStopping ${facts.ref} did not succeed, so nothing was deleted. Its directory and data are untouched.\\n hint: check what is still running with \\`${BRAND.slug} stop --dry-run\\`, then run remove again.\\n`,\n )\n return EXIT_FAILURE\n }\n done.push({ label: \"stopped\", value: facts.ref })\n }\n\n if (!facts.filesOnly && facts.service !== undefined) {\n // `stop` disabled and unloaded it; this deletes the definition. Both are needed — a plist left\n // on disk is a job that reappears the moment somebody runs `daemon start`.\n const manager = serviceManager(options)\n try {\n manager?.uninstall(facts.service)\n done.push({ label: \"service\", value: `${facts.service} removed` })\n } catch (error) {\n // Not fatal: the agent is still going, and a plist for a deleted agent fails loudly at the\n // next login rather than silently. Named so it can be cleaned up by hand.\n done.push({\n label: \"service\",\n value: `${facts.service} could NOT be removed`,\n note: error instanceof Error ? error.message : String(error),\n })\n }\n }\n\n if (!facts.filesOnly) {\n const went = await store.purgeAgent(facts.agentId)\n done.push({\n label: \"store\",\n value: `${went.sessions} conversation(s), ${went.messages} message(s), ${went.passages} passage(s)`,\n })\n for (const log of facts.logs) rmSync(log.path, { force: true })\n if (facts.logs.length > 0) {\n done.push({ label: \"logs\", value: `${facts.logs.length} file(s)` })\n }\n }\n\n // Last, for the reason `removalSteps` documents: it is the only irreplaceable part.\n rmSync(facts.dir, { recursive: true, force: true })\n done.push({ label: \"directory\", value: facts.dir })\n\n if (options.json === true) {\n process.stdout.write(\n `${JSON.stringify({ removed: facts.ref, agentId: facts.agentId, filesOnly: facts.filesOnly }, null, 2)}\\n`,\n )\n return EXIT_OK\n }\n process.stdout.write(`\\n${facts.ref} removed.\\n${keyValue(done)}\\n`)\n if (facts.filesOnly) {\n process.stdout.write(\n `\\nIts sessions and memory are still in the store under the id \"${facts.agentId}\", which another agent shares.\\n`,\n )\n }\n return EXIT_OK\n}\n\n// ─── every agent, and the leftovers ─────────────────────────────────────────────────────\n\nasync function allAction(options: RemoveOptions, store: SqliteStore): Promise<number> {\n const agents = listAgents()\n if (agents.length === 0) {\n process.stdout.write(\"The sandbox is empty — there is nothing to remove.\\n\")\n return EXIT_OK\n }\n\n process.stdout.write(\n `${section(`removing every agent in ${agentsDir()}:`, true)}\\n${agents\n .map((agent) =>\n bullet(\n `${agent.ref}${agent.id === undefined || agent.id === agent.ref ? \"\" : ` (id ${agent.id})`}`,\n ),\n )\n .join(\"\\n\")}\\n`,\n )\n if (options.dryRun === true) {\n process.stdout.write(\"\\nNothing was deleted — this was --dry-run.\\n\")\n return EXIT_OK\n }\n // A different word from a ref, so a half-remembered `--all` cannot be confirmed by typing the name\n // of the one agent somebody had in mind.\n if (!(await agreed(options, \"all\", `type \\`all\\` to remove all ${agents.length}:`))) {\n process.stdout.write(\"\\nNothing was deleted.\\n\")\n return EXIT_OK\n }\n\n let worst = EXIT_OK\n for (const agent of agents) {\n const facts = await gather(agent.ref, options, store)\n // Every agent is going, so a shared id is no longer a reason to refuse: nothing is left behind\n // to be surprised by the deletion. Ordering still matters per agent.\n const code = await execute({ ...facts, sharesIdWith: [] }, options, store)\n if (code !== EXIT_OK) worst = code\n }\n return worst\n}\n\n/**\n * Rows and logs belonging to no sandbox directory.\n *\n * The gap `LeaseStore.orphans`'s own docstring admits to and pointed at a `sessions --reap-orphans`\n * that was never built. Two sources, because an orphan can appear in either: `store.agentIds()` for\n * rows, and the logs directory for files a service wrote before its agent was deleted.\n */\nasync function pruneAction(options: RemoveOptions, store: SqliteStore): Promise<number> {\n const claimed = new Set(\n listAgents()\n .map((agent) => agent.id ?? agent.ref)\n .filter((id) => id !== \"\"),\n )\n const ids = new Set<string>((await store.agentIds()).filter((id) => !claimed.has(id)))\n for (const id of logAgentIds()) if (!claimed.has(id)) ids.add(id)\n\n const orphans: Orphan[] = []\n for (const agentId of [...ids].sort()) {\n orphans.push({\n agentId,\n footprint: await store.agentFootprint(agentId),\n logs: logsFor(agentId),\n })\n }\n\n if (orphans.length === 0) {\n process.stdout.write(\n options.json === true\n ? `${JSON.stringify({ pruned: [] })}\\n`\n : `Nothing to prune — every agent id in the store and the log directory belongs to an agent in ${agentsDir()}.\\n`,\n )\n return EXIT_OK\n }\n\n process.stdout.write(\n `${section(\"no sandbox directory claims these:\", true)}\\n${renderOrphans(orphans)}\\n`,\n )\n if (options.dryRun === true) {\n process.stdout.write(\"\\nNothing was deleted — this was --dry-run.\\n\")\n return EXIT_OK\n }\n if (!(await agreed(options, \"prune\", \"type `prune` to delete them:\"))) {\n process.stdout.write(\"\\nNothing was deleted.\\n\")\n return EXIT_OK\n }\n\n const rows: Row[] = []\n for (const orphan of orphans) {\n const went = await store.purgeAgent(orphan.agentId)\n for (const log of orphan.logs) rmSync(log.path, { force: true })\n rows.push({\n label: orphan.agentId,\n value: `${went.sessions} conversation(s), ${went.passages} passage(s), ${orphan.logs.length} log file(s)`,\n })\n }\n process.stdout.write(\n options.json === true\n ? `${JSON.stringify({ pruned: orphans.map((o) => o.agentId) }, null, 2)}\\n`\n : `\\npruned ${orphans.length} agent id(s).\\n${keyValue(rows)}\\n`,\n )\n return EXIT_OK\n}\n\n// ─── facts ──────────────────────────────────────────────────────────────────────────────\n\nasync function gather(ref: string, options: RemoveOptions, store: SqliteStore): Promise<Removal> {\n if (ref.includes(\"/\") || ref.endsWith(\".yaml\") || ref.endsWith(\".yml\")) {\n throw new HarnessError({\n code: \"cli_remove_takes_a_name\",\n message: `remove takes a sandbox agent's name, and \"${ref}\" is a path.`,\n hint: `An agent outside ${agentsDir()} is a directory you created and yours to delete — \\`rm -rf\\` it. This command only removes agents \\`${BRAND.slug} init\\` made, because it also has to clear their sessions, memory, logs and service.`,\n })\n }\n\n const agents = listAgents()\n const agent = agents.find((candidate) => candidate.ref === ref)\n if (agent === undefined) {\n const known = agents.map((candidate) => candidate.ref)\n throw new HarnessError({\n code: \"cli_agent_unknown\",\n message: `No agent named \"${ref}\" in the sandbox${known.length === 0 ? \", which is empty\" : \"\"}.`,\n hint:\n known.length === 0\n ? `Nothing to remove. \\`${BRAND.slug} init\\` creates one.`\n : `Known agents: ${known.join(\", \")}. \\`--prune\\` clears data left by an agent whose directory is already gone.`,\n })\n }\n\n // The header, not `loadManifest`: loading checks that key env vars are set, and refusing to delete\n // a broken agent because its API key is missing would refuse exactly the agent most worth deleting.\n let agentId = agent.id\n if (agentId === undefined) {\n try {\n agentId = readManifestHeader(agent.manifestPath).id\n } catch {\n // Unreadable manifest. The directory can still go; there is just no id to key data by, so\n // this degrades to files-only rather than guessing that the ref is the id.\n }\n }\n\n const filesOnly = options.filesOnly === true || agentId === undefined\n const id = agentId ?? ref\n const footprint = await store.agentFootprint(id)\n const lease = footprint.lease ? await store.leases.get(id) : undefined\n const service = serviceManager(options)\n const label = labelFor(BRAND.slug, id)\n\n return {\n ref,\n agentId: id,\n manifestPath: agent.manifestPath,\n dir: agent.dir,\n files: treeSize(agent.dir),\n footprint,\n logs: logsFor(id),\n sharesIdWith: agents\n .filter((other) => other.ref !== ref && (other.id ?? \"\") === id)\n .map((other) => other.ref),\n // A lease row is a claim, not a fact: a boot that failed after claiming leaves a row seconds old\n // with no process under it, and reporting that as running would block a removal on a pid that\n // does not exist.\n ...(lease !== undefined && processAlive(lease.pid)\n ? { running: { pid: lease.pid, mode: lease.mode } }\n : {}),\n ...(service?.state(label).installed === true ? { service: label } : {}),\n filesOnly,\n }\n}\n\nfunction serviceManager(options: RemoveOptions): ServiceManager | undefined {\n const platform = options.platform ?? process.platform\n if (platform !== \"darwin\") return undefined\n return resolveServiceManager(platform, {\n home: homedir(),\n uid: process.getuid?.() ?? 0,\n envPrefix: BRAND.envPrefix,\n ...(options.exec === undefined ? {} : { exec: options.exec }),\n })\n}\n\n/** Files and bytes under a directory. A directory that cannot be read counts as empty rather than throwing. */\nfunction treeSize(dir: string): { readonly count: number; readonly bytes: number } {\n let count = 0\n let total = 0\n const walk = (at: string): void => {\n let entries: string[]\n try {\n entries = readdirSync(at)\n } catch {\n return\n }\n for (const entry of entries) {\n const path = join(at, entry)\n try {\n const stats = statSync(path)\n if (stats.isDirectory()) {\n walk(path)\n continue\n }\n count += 1\n total += stats.size\n } catch {\n // Raced away mid-walk. The listing is a summary, not an inventory.\n }\n }\n }\n walk(dir)\n return { count, bytes: total }\n}\n\nfunction logsFor(agentId: string): readonly FileFacts[] {\n const paths = logPaths(agentId)\n const out: FileFacts[] = []\n for (const path of [paths.out, paths.err]) {\n try {\n if (!existsSync(path)) continue\n out.push({ path, bytes: statSync(path).size })\n } catch {\n // Unreadable. Not listed, and not deleted either.\n }\n }\n return out\n}\n\n/**\n * Agent ids implied by the log directory.\n *\n * A service can have written logs for an agent that never reached the store — a manifest that failed to\n * load restarts, writes to stderr and persists nothing — so the log directory names ids `agentIds()`\n * cannot. `dot.err.log` on the author's machine was exactly that.\n */\nfunction logAgentIds(): readonly string[] {\n let entries: string[]\n try {\n entries = readdirSync(join(sandboxRoot(), \"logs\"))\n } catch {\n return []\n }\n const ids = new Set<string>()\n for (const entry of entries) {\n for (const suffix of [\".out.log\", \".err.log\"]) {\n if (entry.endsWith(suffix)) ids.add(entry.slice(0, -suffix.length))\n }\n }\n return [...ids]\n}\n\nasync function agreed(\n options: RemoveOptions,\n expected: string,\n question: string,\n): Promise<boolean> {\n if (options.yes === true) return true\n const ask = options.confirm\n if (ask === undefined) return false\n return await ask(question, expected)\n}\n",
24
24
  "/**\n * What removing an agent would actually take, and what should stop it.\n *\n * Facts in, a listing and an ordered plan out. Gathering the facts needs the filesystem, the store and\n * `launchctl`; deciding what to do with them needs none of that — and the interesting cases here are\n * exactly the ones that are painful to produce on a real machine: a manifest id shared by two\n * directories, a live lease, an installed service, rows nobody claims. A table beats breaking a\n * sandbox nine different ways.\n *\n * ## Why the listing and the deletion come from one place\n *\n * The confirmation is a listing plus the agent's name typed back, and the listing *is* `--dry-run` —\n * one code path, so what a dry run shows is what a real run does. Deriving the two separately is how a\n * confirmation comes to describe something other than what happens, which for an irreversible command\n * is the worst available failure: the person read it, agreed to it, and got something else.\n *\n * No `node:*`, no `process`. This module is on the boundaries test's `PURE` list.\n */\n\nimport type { AgentFootprint } from \"@dispach/core\"\nimport { bytes, keyValue, type Row } from \"#lib/render\"\n\nexport interface Finding {\n readonly code: string\n readonly message: string\n /** Never optional. Hard rule 7, and a test asserts it over every finding this can produce. */\n readonly hint: string\n}\n\n/** A file the removal would delete, and what it costs to keep. */\nexport interface FileFacts {\n readonly path: string\n readonly bytes: number\n}\n\nexport interface RemovalFacts {\n /** The directory name — what was typed, and what the confirmation asks to be typed back. */\n readonly ref: string\n /** The manifest id. Keys the store, the logs and the service label; may differ from `ref`. */\n readonly agentId: string\n readonly dir: string\n /** Files under `dir`, counted and summed. Empty when the directory could not be read. */\n readonly files: { readonly count: number; readonly bytes: number }\n /** What the store holds for `agentId`. */\n readonly footprint: AgentFootprint\n /** Log files that exist. Absent entries are simply not listed. */\n readonly logs: readonly FileFacts[]\n /**\n * Other sandbox directories whose manifest id is also `agentId`.\n *\n * The refusal case. Store rows, logs and the service label are all keyed by id, so removing this\n * agent's *data* would remove theirs.\n */\n readonly sharesIdWith: readonly string[]\n /** A live process holding the lease, if any. */\n readonly running?: { readonly pid: number; readonly mode: string }\n /** The launchd label, when a service is installed under it. */\n readonly service?: string\n /** Only the directory goes; the store, the logs and the service are left alone. */\n readonly filesOnly: boolean\n}\n\n/**\n * What must not be removed, and why.\n *\n * **A shared manifest id blocks, rather than degrading to a partial removal.** Deleting store rows by\n * `agent_id` when two directories answer to that id destroys the other agent's conversations and\n * memory, and reports success — the silent-loss shape hard rule 8 exists to prevent. Falling back to\n * files-only automatically was the alternative and is worse in a quieter way: it leaves rows that\n * `agentIds` will list forever as belonging to nobody, having told the person their agent was gone.\n *\n * `--files-only` clears it, because then the id is not being acted on at all.\n */\nexport function removalFindings(facts: RemovalFacts): readonly Finding[] {\n if (facts.filesOnly || facts.sharesIdWith.length === 0) return []\n const others = facts.sharesIdWith.join(\", \")\n return [\n {\n code: \"cli_agent_id_shared\",\n message: `\"${facts.ref}\" has the manifest id \"${facts.agentId}\", which is also used by ${others} — removing its data would take that agent's sessions and memory too.`,\n hint: `Change one manifest's id and run \\`memory rebuild\\` for it, or pass --files-only to delete just the ${facts.ref} directory and leave the store alone.`,\n },\n ]\n}\n\nexport type StepKind = \"stop\" | \"service\" | \"store\" | \"logs\" | \"directory\"\n\nexport interface Step {\n readonly kind: StepKind\n /** What this step will do, in the imperative. Shown before it happens. */\n readonly detail: string\n}\n\n/**\n * The steps, in the order they must run.\n *\n * The order is not cosmetic:\n *\n * 1. **Stop first.** A process holding the lease is still writing sessions, and a graceful stop is the\n * only path that runs `provider.stop()` — the sole reaper for backgrounded `exec` children. Deleting\n * a running agent's directory would leave a live process serving from a manifest that no longer\n * exists, with orphaned shells behind it.\n * 2. **Service next.** `disable` persists across boots and `bootout` does not, so both are needed: a\n * label left enabled comes back at the next login and fails forever against a deleted manifest.\n * 3. **Store, then logs, then the directory last.** Every earlier step is recoverable — an agent whose\n * rows are gone still loads and still runs. The directory is the only irreplaceable part, so it goes\n * when nothing else can fail; the reverse order leaves a manifest-less agent whose data is\n * unreachable and whose name nothing can name.\n */\nexport function removalSteps(facts: RemovalFacts): readonly Step[] {\n const steps: Step[] = []\n if (facts.running !== undefined) {\n steps.push({\n kind: \"stop\",\n detail: `stop pid ${facts.running.pid} (${facts.running.mode}) — gracefully, so anything it left running in the background is reaped`,\n })\n }\n if (!facts.filesOnly && facts.service !== undefined) {\n steps.push({\n kind: \"service\",\n detail: `disable and unload ${facts.service}`,\n })\n }\n if (!facts.filesOnly) {\n const f = facts.footprint\n steps.push({\n kind: \"store\",\n detail: `delete ${plural(f.sessions, \"conversation\")}, ${plural(f.messages, \"message\")}, ${plural(f.passages, \"memory passage\")}`,\n })\n if (facts.logs.length > 0) {\n steps.push({ kind: \"logs\", detail: `delete ${plural(facts.logs.length, \"log file\")}` })\n }\n }\n steps.push({ kind: \"directory\", detail: `delete ${facts.dir}` })\n return steps\n}\n\n/**\n * The listing shown before anything happens, and printed on its own by `--dry-run`.\n *\n * Every row is a number somebody might want to stop over. A zero row is still shown where its absence\n * would be ambiguous — `service not installed` is information, and omitting it invites the reading\n * that a service was quietly left behind.\n */\nexport function renderRemoval(facts: RemovalFacts): string {\n const f = facts.footprint\n const rows: Row[] = [\n {\n label: \"directory\",\n value: `${facts.dir}`,\n note: `${plural(facts.files.count, \"file\")}, ${bytes(facts.files.bytes)}`,\n },\n ]\n if (facts.agentId !== facts.ref) {\n // Worth its own row whenever they differ: everything except the directory is keyed by the id,\n // so a person who only knows the ref is reading a listing about a name they have not seen.\n rows.push({\n label: \"manifest id\",\n value: facts.agentId,\n note: \"keys the store, logs and service\",\n })\n }\n if (facts.filesOnly) {\n rows.push({\n label: \"keeping\",\n value: `${plural(f.sessions, \"conversation\")}, ${plural(f.passages, \"memory passage\")}, and the logs`,\n note: \"--files-only\",\n })\n } else {\n rows.push(\n {\n label: \"sessions\",\n value: `${plural(f.sessions, \"conversation\")}, ${plural(f.messages, \"message\")}, ${plural(f.turns, \"turn\")}`,\n },\n {\n label: \"memory\",\n value: `${plural(f.passages, \"passage\")} from ${plural(f.memorySources, \"source\")}`,\n },\n {\n label: \"outbox\",\n value:\n f.outbox === 0\n ? \"nothing queued\"\n : `${plural(f.outbox, \"delivery\")}${f.outboxPending === 0 ? \"\" : `, ${f.outboxPending} not yet sent`}`,\n // A pending delivery is a reply somebody is waiting for, and removal abandons it.\n ...(f.outboxPending === 0 ? {} : { note: \"abandoned\" }),\n },\n {\n label: \"schedules\",\n value: f.schedules === 0 ? \"none\" : plural(f.schedules, \"schedule\"),\n // A schedule is the one thing here that would keep *firing* if it survived, so its\n // removal is the part of this listing least likely to be regretted and most likely\n // to be missed if it were absent.\n ...(f.schedules === 0 ? {} : { note: \"stops firing\" }),\n },\n {\n label: \"logs\",\n value:\n facts.logs.length === 0\n ? \"none\"\n : `${plural(facts.logs.length, \"file\")}, ${bytes(facts.logs.reduce((n, l) => n + l.bytes, 0))}`,\n },\n { label: \"service\", value: facts.service ?? \"not installed\" },\n )\n }\n rows.push({\n label: \"running\",\n value:\n facts.running === undefined ? \"no\" : `pid ${facts.running.pid} (${facts.running.mode})`,\n })\n return keyValue(rows)\n}\n\n/** An agent id with rows or logs in the sandbox that no directory claims. */\nexport interface Orphan {\n readonly agentId: string\n readonly footprint: AgentFootprint\n readonly logs: readonly FileFacts[]\n}\n\n/**\n * The listing for `--prune`.\n *\n * Separate from `renderRemoval` because it answers a different question — not \"what does this agent\n * own\" but \"what is left over\" — and because an orphan has no directory, no ref and no manifest, so\n * most of the other rows would be empty or a lie.\n */\nexport function renderOrphans(orphans: readonly Orphan[]): string {\n if (orphans.length === 0) return \"\"\n return orphans\n .map((orphan) => {\n const f = orphan.footprint\n const parts: string[] = []\n if (f.sessions > 0) {\n parts.push(\n `${plural(f.sessions, \"conversation\")}, ${plural(f.messages, \"message\")}`,\n )\n }\n if (f.passages > 0) parts.push(`${plural(f.passages, \"memory passage\")}`)\n if (f.outbox > 0) parts.push(`${plural(f.outbox, \"queued delivery\")}`)\n if (f.schedules > 0) parts.push(`${plural(f.schedules, \"schedule\")}`)\n if (f.lease) parts.push(\"a stale lease\")\n if (orphan.logs.length > 0) {\n parts.push(\n `${plural(orphan.logs.length, \"log file\")}, ${bytes(orphan.logs.reduce((n, l) => n + l.bytes, 0))}`,\n )\n }\n // Never empty: an orphan is only listed because *something* references the id, so an empty\n // parts list would mean the caller found it by some route this cannot describe.\n return ` ${orphan.agentId} ${parts.length === 0 ? \"rows with no detail\" : parts.join(\" · \")}`\n })\n .join(\"\\n\")\n}\n\nfunction plural(count: number, noun: string): string {\n return `${count} ${noun}${count === 1 ? \"\" : \"s\"}`\n}\n",
25
25
  "/**\n * `stop [agent]` — the switch that turns everything off.\n *\n * Every other way to stop an agent needs you to know what is running first: `daemon stop` needs the\n * label, ctrl-c needs the terminal that started it, `kill` needs the pid. This one needs nothing —\n * it finds the services *and* the loose `serve` you left in a tab three days ago, stops both, and\n * says what it stopped. That is the whole design brief: a person reaching for this is not in a\n * position to go looking.\n *\n * **Stopped means stopped.** A service is disabled as well as unloaded, because `bootout` alone\n * comes back at the next login and \"I stopped it and it was running again after lunch\" is the exact\n * failure a safety switch may not have. Reversible, loudly: the output names `daemon start`.\n *\n * **SIGTERM first, always.** A graceful stop is the only path that runs `provider.stop()`, which\n * reaps the child processes `exec` backgrounded — so killing hard to be thorough is how you end up\n * with the orphans that took this machine to a load average of 351. SIGKILL is the last resort,\n * after a grace period, and it says out loud what may have been left behind.\n *\n * ## Naming an agent and naming nothing are different commands\n *\n * They were the same command with a filter until one process could host several agents, at which\n * point the filter became wrong: killing the process that holds `milo`'s lease takes `alpha` and\n * `beta` down with it. So:\n *\n * - **`stop <agent>`** writes that agent off in the store and asks its host to drop it. The host\n * keeps running, every other agent it holds keeps running, and the row is what makes it stay off\n * across a restart. It does **not** touch any service: a service hosting three agents is not\n * something to unload because one of them was switched off.\n * - **`stop`** is unchanged — the whole host goes down, services disabled so they stay down, and\n * nothing per-agent is written. That asymmetry is deliberate: `daemon start` should bring back\n * exactly what was running, and an agent stopped by name should still be off when it does.\n *\n * The per-agent path falls back to signalling the process when the lease carries no address, which\n * is a `run` REPL or an embedded runtime — real states that serve no HTTP, and the only ones where\n * \"stop this agent\" and \"stop that process\" are still the same thing.\n */\n\nimport { homedir } from \"node:os\"\nimport { BRAND, HarnessError, processAlive, readManifestHeader, SqliteStore } from \"@dispach/core\"\nimport { EXIT_FAILURE, EXIT_OK } from \"#lib/const\"\nimport { labelFor } from \"#lib/launchd\"\nimport { HOST_LEASE, liveHostOf, postToHost, writeAgentState } from \"#lib/lifecycle\"\nimport { bullet, keyValue, type Row } from \"#lib/render\"\nimport { storePath } from \"#lib/sandbox\"\nimport { type Exec, resolveServiceManager, type ServiceManager } from \"#lib/service\"\n\n/** How long a process gets to shut down cleanly before the last resort. */\nconst GRACE_MS = 12_000\nconst POLL_MS = 250\n\nexport interface StopOptions {\n /**\n * Absolute manifest path. Omitted means the whole host — see the file comment.\n *\n * Present and absent are two different commands rather than one with a filter: naming an agent\n * writes the durable switch and asks its host to drop it, and naming nothing takes the host\n * down. Conflating them is how stopping one agent stopped three.\n */\n readonly manifestPath?: string\n /** Why, recorded on the row and shown wherever the agent is reported as off. */\n readonly reason?: string\n /** The database to read leases and state from. Defaults to the sandbox's. */\n readonly store?: string\n readonly dryRun?: boolean\n readonly json?: boolean\n /** Test seams. Nothing in `src/` outside this file passes them. */\n readonly exec?: Exec\n readonly platform?: string\n}\n\ninterface Target {\n readonly agentId: string\n /** A LaunchAgent exists for it. */\n readonly service: boolean\n /** A live process holds its runtime lease. */\n readonly pid?: number\n readonly mode?: string\n}\n\ntype Outcome = Target & {\n readonly stopped: boolean\n /** Present when the graceful stop ran out of time. */\n readonly forced?: boolean\n readonly note: string\n}\n\nexport async function stopCommand(options: StopOptions): Promise<number> {\n if (options.manifestPath !== undefined) {\n return await stopOneAgent(options, options.manifestPath)\n }\n return await stopEverything(options)\n}\n\n/**\n * Switch one agent off and drop it from its host.\n *\n * The state is written **first**, and the order matters: a host told to drop an agent before the row\n * exists would come back hosting it at the next restart with nobody having asked, which is the\n * failure the row exists to prevent. This way round, a host that cannot be reached leaves the agent\n * marked off, and the next start honours it — so the command's promise holds even when the request\n * does not land.\n */\nasync function stopOneAgent(options: StopOptions, manifestPath: string): Promise<number> {\n const agentId = agentIdOf(manifestPath)\n const notes: string[] = []\n\n if (options.dryRun === true) {\n const host = await liveHostOf(agentId, options.store)\n process.stdout.write(\n `would stop 1 agent:\\n${bullet(\n `${agentId} — ${\n host === undefined\n ? \"not running; would be switched off for the next start\"\n : host.baseUrl === undefined\n ? `pid ${host.pid} (${host.mode}), which serves no HTTP — would be signalled`\n : `pid ${host.pid} (${host.mode}) at ${host.baseUrl}, which would drop it and keep serving`\n }`,\n )}\\n`,\n )\n return EXIT_OK\n }\n\n await writeAgentState(agentId, false, options.reason, options.store)\n notes.push(\"switched off for the next start\")\n\n const host = await liveHostOf(agentId, options.store)\n let stopped = true\n if (host === undefined) {\n notes.push(\"nothing was running\")\n } else if (host.baseUrl === undefined) {\n // A `run` REPL or an embedded runtime: no HTTP to ask, and stopping the agent really is\n // stopping the process, because that process is hosting exactly this conversation.\n const graceful = await signalAndWait(host.pid, \"SIGTERM\")\n stopped = graceful || (await signalAndWait(host.pid, \"SIGKILL\", true))\n notes.push(\n graceful\n ? `pid ${host.pid} stopped cleanly`\n : stopped\n ? `pid ${host.pid} had to be killed`\n : `pid ${host.pid} would not stop — check it by hand`,\n )\n } else {\n const reply = await postToHost(\n host,\n `/v1/agents/${encodeURIComponent(agentId)}/stop`,\n options.reason === undefined ? {} : { reason: options.reason },\n manifestPath,\n )\n if (reply.ok) {\n notes.push(`pid ${host.pid} dropped it and kept serving`)\n } else if (reply.status === 409) {\n // A turn is running. The row is already written, so the agent is off at the next start\n // either way — this is the one case where the command reports partial success, because\n // claiming it stopped while a turn is mid-generation would be a lie.\n stopped = false\n notes.push(reply.detail ?? \"a turn is running\")\n } else if (reply.status === 401) {\n stopped = false\n notes.push(\n `pid ${host.pid} refused the request — set ${BRAND.envPrefix}API_TOKEN to the server's token`,\n )\n } else {\n stopped = false\n notes.push(\n `pid ${host.pid} at ${host.baseUrl} could not be reached${\n reply.detail === undefined ? \"\" : `: ${reply.detail}`\n }`,\n )\n }\n }\n\n const outcome: Outcome = {\n agentId,\n service: false,\n ...(host === undefined ? {} : { pid: host.pid, mode: host.mode }),\n stopped,\n note: notes.join(\" · \"),\n }\n\n if (options.json === true) {\n process.stdout.write(`${JSON.stringify({ stopped: [outcome] }, null, 2)}\\n`)\n } else {\n process.stdout.write(\n `${keyValue([\n {\n label: agentId,\n value: stopped ? \"stopped\" : \"NOT FULLY STOPPED\",\n note: outcome.note,\n },\n ])}\\n`,\n )\n process.stdout.write(\n `\\nStays off across restarts. \\`${BRAND.slug} start ${agentId}\\` switches it back on.\\n`,\n )\n }\n return stopped ? EXIT_OK : EXIT_FAILURE\n}\n\nasync function stopEverything(options: StopOptions): Promise<number> {\n const platform = options.platform ?? process.platform\n // Only launchd is managed, but the lease half works everywhere — a `serve` in a terminal is a\n // process with a pid on any platform, and refusing to stop it because this is not macOS would\n // make the safety switch useless exactly where there is no service manager to fall back on.\n const manager =\n platform === \"darwin\"\n ? resolveServiceManager(platform, {\n home: homedir(),\n uid: process.getuid?.() ?? 0,\n envPrefix: BRAND.envPrefix,\n ...(options.exec === undefined ? {} : { exec: options.exec }),\n })\n : undefined\n\n // No filter any more: naming an agent takes the per-agent path above, and this one is the\n // whole host. A `stop <agent>` that unloaded a service hosting three agents would be the\n // failure 16.2a's shared process introduced.\n const targets = await findTargets(manager, options.store)\n\n if (targets.length === 0) {\n process.stdout.write(\n options.json === true\n ? `${JSON.stringify({ stopped: [] })}\\n`\n : \"Nothing is running — no service is installed and no process holds an agent.\\n\",\n )\n // Zero. For a command whose job is to reach a state, already being in it is success.\n return EXIT_OK\n }\n\n if (options.dryRun === true) {\n process.stdout.write(\n `would stop ${targets.length} ${targets.length === 1 ? \"agent\" : \"agents\"}:\\n${targets\n .map((target) => bullet(describe(target)))\n .join(\"\\n\")}\\n`,\n )\n return EXIT_OK\n }\n\n const outcomes: Outcome[] = []\n for (const target of targets) outcomes.push(await stopOne(target, manager))\n\n if (options.json === true) {\n process.stdout.write(`${JSON.stringify({ stopped: outcomes }, null, 2)}\\n`)\n } else {\n const rows: Row[] = outcomes.map((outcome) => ({\n label: nameOf(outcome.agentId),\n value: outcome.stopped ? \"stopped\" : \"STILL RUNNING\",\n note: outcome.note,\n }))\n process.stdout.write(`${keyValue(rows)}\\n`)\n\n if (outcomes.some((outcome) => outcome.service && outcome.stopped)) {\n process.stdout.write(\n `\\nServices are disabled as well as unloaded, so they stay stopped across a reboot.\\nStart one again with \\`${BRAND.slug} daemon start <agent>\\`.\\n`,\n )\n }\n if (outcomes.some((outcome) => outcome.forced === true)) {\n process.stdout.write(\n `\\nSomething had to be killed rather than asked. A forced stop skips the runtime's own\\ncleanup, so a command the agent had left running in the background may still be alive —\\n\\`ps\\` will show it if so.\\n`,\n )\n }\n }\n\n return outcomes.every((outcome) => outcome.stopped) ? EXIT_OK : EXIT_FAILURE\n}\n\n/**\n * Everything that could be running, from both sources.\n *\n * Two sources because neither is complete. `launchctl` knows about installed services and nothing\n * about the `serve` you started by hand; the lease table knows about any live process and nothing\n * about a service that is installed but currently down. A safety switch that consulted one of them\n * would leave the other running and report success.\n */\nasync function findTargets(\n manager: ServiceManager | undefined,\n storeFile?: string,\n): Promise<readonly Target[]> {\n const prefix = `${BRAND.slug}.agent.`\n const byId = new Map<string, Target>()\n\n for (const label of manager?.labels(prefix) ?? []) {\n const agentId = label.slice(prefix.length)\n byId.set(agentId, { agentId, service: true })\n }\n\n try {\n const store = await SqliteStore.open({ path: storeFile ?? storePath() })\n for (const lease of await store.leases.all()) {\n // Not this process, and not a row whose process is already gone — a stale lease is not\n // something to stop, and reporting it as one would make the command lie about its work.\n if (lease.pid === process.pid || !processAlive(lease.pid)) continue\n byId.set(lease.agentId, {\n agentId: lease.agentId,\n service: byId.get(lease.agentId)?.service === true,\n pid: lease.pid,\n mode: lease.mode,\n })\n }\n await store.close()\n } catch {\n // No store yet means nothing has ever run. Not an error for this command.\n }\n\n return [...byId.values()].sort((a, b) => a.agentId.localeCompare(b.agentId))\n}\n\nasync function stopOne(target: Target, manager: ServiceManager | undefined): Promise<Outcome> {\n const notes: string[] = []\n\n // The service first. Unloading it sends SIGTERM to the process itself, so doing this before the\n // direct signal avoids racing launchd's own restart policy — and disabling means it will not be\n // back at the next login.\n if (target.service && manager !== undefined) {\n try {\n manager.stop(labelFor(BRAND.slug, target.agentId))\n notes.push(\"service disabled and unloaded\")\n } catch (error) {\n notes.push(\n `service could not be unloaded: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n\n if (target.pid === undefined) {\n return { ...target, stopped: true, note: notes.join(\" · \") || \"no process was running\" }\n }\n\n // Already gone, most likely because unloading the service took it with it.\n if (!processAlive(target.pid)) {\n return { ...target, stopped: true, note: notes.join(\" · \") || `pid ${target.pid} exited` }\n }\n\n const graceful = await signalAndWait(target.pid, \"SIGTERM\")\n if (graceful) {\n notes.push(`pid ${target.pid} stopped cleanly`)\n return { ...target, stopped: true, note: notes.join(\" · \") }\n }\n\n // Last resort, and by process *group* — `sh -c \"a | b | c\"` killed by pid orphans two of three,\n // which is the shape decision 4.88 was written about.\n const forced = await signalAndWait(target.pid, \"SIGKILL\", true)\n notes.push(\n forced\n ? `pid ${target.pid} did not stop in ${Math.round(GRACE_MS / 1000)}s and was killed`\n : `pid ${target.pid} would not stop, even killed — check it by hand`,\n )\n return { ...target, stopped: forced, forced: true, note: notes.join(\" · \") }\n}\n\nasync function signalAndWait(pid: number, signal: NodeJS.Signals, group = false): Promise<boolean> {\n try {\n process.kill(group ? -pid : pid, signal)\n } catch (error) {\n // ESRCH means it went away between the check and the signal, which is the outcome we want.\n if ((error as NodeJS.ErrnoException).code === \"ESRCH\") return true\n // A group kill can fail where the single-pid kill would not; fall back rather than give up.\n if (group) {\n try {\n process.kill(pid, signal)\n } catch {\n return !processAlive(pid)\n }\n }\n }\n\n const deadline = Date.now() + (signal === \"SIGKILL\" ? 3_000 : GRACE_MS)\n while (Date.now() < deadline) {\n if (!processAlive(pid)) return true\n await new Promise((resolve) => setTimeout(resolve, POLL_MS))\n }\n return !processAlive(pid)\n}\n\nfunction describe(target: Target): string {\n const parts: string[] = []\n if (target.service) parts.push(\"background service\")\n if (target.pid !== undefined)\n parts.push(`pid ${target.pid}${target.mode === undefined ? \"\" : ` (${target.mode})`}`)\n return `${nameOf(target.agentId)} — ${parts.join(\", \")}`\n}\n\nfunction nameOf(agentId: string): string {\n return agentId === HOST_LEASE ? \"(host, no agents)\" : agentId\n}\n\nfunction agentIdOf(manifestPath: string): string {\n const header = readManifestHeader(manifestPath)\n if (header.id === undefined || header.id === \"\") {\n throw new HarnessError({\n code: \"cli_stop_agent_id_missing\",\n message: `${manifestPath} declares no id, so there is nothing to match a running agent against.`,\n hint: `Add \\`id: <name>\\` to the manifest, or run \\`${BRAND.slug} stop\\` with no argument to stop everything.`,\n })\n }\n return header.id\n}\n",
26
26
  "/**\n * `restart` — reload one agent where it is running, or restart the service that runs them all.\n *\n * Two different sizes of the same verb. Named an agent, this asks the host holding it to rebuild\n * that agent from disk (`POST /v1/agents/:id/reload`): the pairing written a moment ago, the token\n * added to `.env`, the edited `agent.yaml` — picked up without touching the other agents in the\n * process. Bare, it is `daemon restart`: the whole service, which is what you want when the *host*\n * is the thing that changed (a new version, a bad state).\n *\n * An agent nothing is hosting is adopted rather than refused, when a host exists to adopt it:\n * \"restart this\" on an agent that was never started means \"make it run\", and answering \"it is not\n * running\" to that is correct and useless.\n */\n\nimport { BRAND, HarnessError } from \"@dispach/core\"\nimport { daemonCommand } from \"#daemon\"\nimport { EXIT_FAILURE, EXIT_OK } from \"#lib/const\"\nimport { adoptOnHost, reloadOnHost } from \"#lib/host-actions\"\nimport { agentIdFor, anyLiveHost } from \"#lib/lifecycle\"\nimport { keyValue } from \"#lib/render\"\n\nexport interface RestartOptions {\n /** Absent restarts the background service. */\n readonly manifestPath?: string\n readonly store?: string\n readonly json?: boolean\n}\n\nexport async function restartCommand(options: RestartOptions): Promise<number> {\n if (options.manifestPath === undefined) {\n return await daemonCommand({\n action: \"restart\",\n ...(options.store === undefined ? {} : { store: options.store }),\n ...(options.json === undefined ? {} : { json: options.json }),\n })\n }\n\n const agentId = agentIdFor(options.manifestPath)\n const result = await reloadOnHost(options.manifestPath, options.store)\n\n let value: string\n let note: string\n let code = EXIT_OK\n switch (result.kind) {\n case \"reloaded\":\n value = \"reloaded\"\n note = `pid ${result.pid} rebuilt it from disk${\n result.adopted.length > 0 ? ` · adopted ${result.adopted.join(\", \")}` : \"\"\n }`\n break\n case \"pending\":\n value = \"reload pending\"\n note = `pid ${result.pid} applies it when its ${result.running} running turn(s) finish`\n break\n case \"busy\":\n value = \"not reloaded\"\n note = `pid ${result.pid} has a turn in flight — try again when it finishes`\n code = EXIT_FAILURE\n break\n case \"failed\":\n value = \"not reloaded\"\n note = `pid ${result.pid} answered ${result.status}${\n result.detail === undefined ? \"\" : `: ${result.detail}`\n }${result.hint === undefined ? \"\" : ` — ${result.hint}`}`\n code = EXIT_FAILURE\n break\n case \"no-host\": {\n // Nobody holds it. A host that exists can take it; none at all is the service's problem.\n const host = await anyLiveHost(options.store)\n if (host === undefined) {\n throw new HarnessError({\n code: \"cli_restart_nothing_running\",\n message: `Nothing is hosting ${agentId}, and no server is running to adopt it.`,\n hint: `\\`${BRAND.slug} serve ${agentId}\\` runs it in this terminal; \\`${BRAND.slug} daemon install\\` keeps a server running that hosts every agent. Then \\`${BRAND.slug} restart ${agentId}\\` reloads it in place.`,\n })\n }\n const adopted = await adoptOnHost(host, options.manifestPath, options.store)\n if (adopted.ok) {\n value = \"started\"\n note = `nothing was hosting it — adopted by pid ${host.pid}`\n } else {\n value = \"not started\"\n note = `pid ${host.pid} did not adopt it${\n adopted.detail === undefined ? \"\" : `: ${adopted.detail}`\n }`\n code = EXIT_FAILURE\n }\n break\n }\n }\n\n if (options.json === true) {\n process.stdout.write(\n `${JSON.stringify({ agentId, result, ok: code === EXIT_OK }, null, 2)}\\n`,\n )\n } else {\n process.stdout.write(`${keyValue([{ label: agentId, value, note }])}\\n`)\n }\n return code\n}\n",
27
- "/**\n * The `run` command. Two renderers, one setup.\n *\n * The rich path is the Ink app; the plain path is line-oriented and writes tokens to stdout as they\n * arrive. Which one runs is decided once, by `resolveMode`, and never re-decided mid-process.\n *\n * **Ink is imported lazily, and only on the rich path.** Measured: `react` + `ink` cost ~65 ms to\n * import under Bun and ~170-210 ms under Node, against a ~70 ms total runtime for `validate --json`.\n * A static import at the top of this file would be paid by every invocation of every command, so the\n * dynamic `import()` below is load-bearing rather than stylistic. A test asserts it stays that way.\n *\n * The plain path keeps Phase 1's behaviour deliberately unchanged, including the Ctrl-C contract and\n * the streaming writes, because both were verified against a real endpoint and a real SIGINT.\n */\n\nimport { randomBytes } from \"node:crypto\"\nimport { existsSync } from \"node:fs\"\nimport { createInterface, type Interface } from \"node:readline\"\nimport { createClient } from \"@dispach/client\"\nimport {\n type Agent,\n type AnyEvent,\n BRAND,\n defaultStorePath,\n describeWindowSource,\n type ErrorDetail,\n endedBadly,\n endNote,\n HarnessError,\n isChildSession,\n processAlive,\n Runtime as RuntimeClass,\n VERSION,\n windowReport,\n} from \"@dispach/core\"\nimport { fetchCatalogue } from \"#browse\"\nimport { initInteractive } from \"#init\"\nimport { ambientEnv, demotedKeys } from \"#lib/ambient\"\nimport { installReport } from \"#lib/browse\"\nimport {\n ENTER_ALT_SCREEN,\n EXIT_FAILURE,\n EXIT_OK,\n FALLBACK_COLUMNS,\n PROMPT,\n SESSION_PICKER_ROWS,\n} from \"#lib/const\"\nimport {\n flushOutput,\n markAltScreen,\n markMouse,\n markTerminalDirty,\n onExit,\n restoreTerminal,\n} from \"#lib/exit\"\nimport { negotiateKeyboard } from \"#lib/keyboard\"\nimport { agentIdFor, hostToken, liveHostOf } from \"#lib/lifecycle\"\nimport { ENABLE_MOUSE } from \"#lib/mouse\"\nimport { resolveModeFromProcess } from \"#lib/output\"\nimport { offeredCommands } from \"#lib/palette\"\nimport {\n BUILT_IN_PLUGINS,\n CHANNELS,\n MEDIA_PROVIDERS,\n MODEL_TRANSPORTS,\n scriptRunner,\n TOOL_PROVIDERS,\n} from \"#lib/providers\"\nimport { keyValue } from \"#lib/render\"\nimport { priorMessages, reopenNote, resumeNotice } from \"#lib/resume\"\nimport { listAgents, pluginRoot, storePath } from \"#lib/sandbox\"\nimport type { RunOptions } from \"#lib/schema\"\nimport { screenColumns } from \"#lib/screen\"\nimport {\n type ContextView,\n contextReport,\n resolveSessionCommand,\n sessionHelpText,\n toolsReport,\n unknownCommandText,\n} from \"#lib/session-commands\"\nimport { newSessionKey } from \"#lib/session-key\"\nimport {\n type AgentSource,\n embeddedSource,\n hostFrom,\n type LiveHost,\n remoteSource,\n type SourceSession,\n} from \"#lib/source\"\nimport type { CatalogueEntry } from \"#lib/source-cache\"\nimport { openTap } from \"#lib/stdin-tap\"\nimport type { RenderMode } from \"#lib/types\"\nimport { type InstallOutcome, skillsCommand } from \"#skills\"\nimport { type PriorMessage, seed, seedHistory } from \"#transcript\"\n\n/** Opening lines: what is loaded, what session, and whether the last turn finished. */\nasync function bannerLines(\n agent: Agent,\n sessionKey: string,\n storeLocation: string,\n bootMs: number,\n /**\n * Why this banner is being printed.\n *\n * A boolean answered \"is this the first one\" and there are now four answers: a `/restart` rebuilt the\n * agent, a session switch rebuilt it to move conversations, and `/new` rebuilt it onto a conversation\n * that did not exist a moment ago. They need different sentences — the restart note is about\n * configuration and would be a lie about a switch — and they agree about the boot number, because in\n * every case the process has been alive for however long the last conversation lasted and\n * time-since-process-start has stopped meaning anything.\n *\n * Closed on purpose: a new reason cannot be added without the compiler demanding a sentence for it.\n */\n reopened: \"first\" | \"restart\" | \"switch\" | \"new\",\n demoted: readonly string[] = [],\n /**\n * The conversation being left behind, for the one sentence that has to name it.\n *\n * Last, after the defaulted `demoted`: inserted next to `reopened` where it reads best, it would\n * have silently taken the argument the existing call site passes for `demoted`. A positional\n * parameter is added at the end or every caller is re-read.\n */\n previousKey?: string,\n) {\n const described = agent.describe()\n const [turns, resumed] = await Promise.all([\n agent.turns(sessionKey, 1),\n agent.store.messages.count(agent.id, sessionKey),\n ])\n\n // The title first, then the session. The rich path drops the title row — its one-line header restates\n // it, and the two together put the same brand, agent and model on screen twice — so anything that is\n // *not* in that header has to live below it. `window` moved down for exactly that reason: it is a fact\n // about this session's budget rather than part of the title.\n const lines = [\n `${BRAND.name} ${VERSION} · ${described.id} · ${described.model}`,\n `session ${sessionKey} · ${resumed} message(s) · window ${described.window} · store ${storeLocation}`,\n // Points at `/help` rather than listing commands: the list belongs to the table that\n // implements them, and a banner enumerating a subset is the drift this change removed.\n `ready in ${bootMs.toFixed(0)} ms · /help for commands and keys · /exit to leave`,\n ]\n\n // One function decides the sentence, and it is pure — see `lib/resume.ts`. Written inline here it\n // needed a live agent and a store to reach, so the only part of this banner a person reads was the\n // only part nothing could check.\n const note = reopenNote(reopened, previousKey)\n if (note !== undefined) lines.push(note)\n\n // Naming a reaped turn is the point of reaping it: the previous run died mid-generation, and the\n // person restarting is the one who needs to know.\n if (turns[0]?.errorCode === \"turn_abandoned\") {\n lines.push(\n \"note: the previous turn in this session did not finish — the process exited while it was generating.\",\n )\n }\n\n // Load warnings, read off the agent rather than caught on the bus.\n //\n // `Runtime.create` emits them as `agent.warning` during boot — which finishes *before* this\n // command subscribes to anything, so every one of them has been landing in an empty room: a\n // trimmed catalogue, a tool declared trusted by its provider, a shell that can only run once a\n // turn. Silent, and precisely the class of thing the loud resolution path exists to prevent.\n //\n // Reading the resolved state instead of racing the bus is also the more honest fix. These are\n // properties of the loaded agent, not events, and something that is true for the whole session\n // belongs where a person will still see it after scrolling.\n for (const warning of [...agent.warnings, ...agent.tools.warnings]) {\n lines.push(`note: ${warning.message}\\n ${warning.hint}`)\n }\n\n // The other half of the same honesty. Core warns when the environment *took* a variable from the\n // agent's own .env; this says when the CLI decided a .env in the current directory should not\n // have. Someone who just wrote MODEL_ID into a project file and finds their agent ignoring it\n // needs the sentence as much as the person who found their agent obeying it.\n if (demoted.length > 0) {\n lines.push(\n `note: ${demoted.join(\", \")} in the .env here ${demoted.length === 1 ? \"was\" : \"were\"} ignored — this agent's own .env sets ${demoted.length === 1 ? \"it\" : \"them\"}.\\n A .env in the directory you launched from configures that project, not an agent living somewhere else. Export the variable to override the agent's own file.`,\n )\n }\n\n return lines\n}\n\nexport async function runCommand(options: RunOptions): Promise<number> {\n const oneShot = options.once !== undefined\n const decision = resolveModeFromProcess({\n json: false,\n plain: options.plain === true,\n oneShot,\n })\n const { mode } = decision\n\n // No agent named: the sandbox decides. One agent auto-runs; several open the picker at a\n // terminal and list plainly everywhere else; none goes straight to the wizard (rich) or an\n // error naming `init` (plain) — an empty sandbox with no guidance is a dead end.\n if (options.manifestPath === undefined) {\n const picked = await pickFromSandbox(mode, decision.because, options)\n if (typeof picked === \"number\") return picked\n return runCommand({ ...options, manifestPath: picked })\n }\n\n // The CLI opts into persistence explicitly — core defaults to memory so that embedding the\n // library never writes to someone's working directory uninvited. The default store lives at\n // the sandbox root: one store for every agent, wherever `run` is invoked from — a cwd-relative\n // default gave the same agent a different session history in every directory.\n const legacy = defaultStorePath()\n if (options.store === undefined && options.ephemeral !== true && existsSync(legacy)) {\n process.stdout.write(\n `note: a session store exists at ${legacy} from an earlier version — pass --store ${legacy} to keep using it; the default is now ${storePath()}\\n`,\n )\n }\n // One teardown for however many runtimes this call goes through. Registering inside the loop\n // would hold a reference to every dead one; `Runtime.stop` is already idempotent, so the live\n // reference is the only thing that has to move.\n let current: RuntimeClass | undefined\n onExit(() => current?.stop(\"cli-exit\"))\n\n // Outlives every runtime this call builds. See `Wired.reader`.\n const reader: { current: Interface | undefined } = { current: undefined }\n // The unsent message, carried across a `/restart` for the same reason the reader is: both belong to\n // the command rather than to one mount, and the restart tears the mount down.\n const draft: { current: string } = { current: \"\" }\n\n // Resolved once per call and then carried, because `/restart` must not silently move the conversation.\n //\n // Empty rather than absent means a bare `--session`: \"ask me which one\". Resolution needs the store, so\n // it happens inside the loop once a runtime exists — and the box is what keeps a picked key stable\n // across a restart, the same reason the reader and the draft live out here.\n const session: { current: string | undefined } = { current: options.sessionKey }\n // Whether the splash stands in for the transcript. Carried beside the key, and both survive a\n // `/restart` — which is not new, so the restarted session goes straight to the conversation.\n const freshSession = { current: false }\n /** The key the last iteration was on, for the `/new` banner. Undefined on the first. */\n const leaving: { current: string | undefined } = { current: undefined }\n const quiet = options.quiet === true\n // Why the loop is on this iteration. `switch` is set by the in-session picker, which reaches the loop\n // the same way `/restart` does — by unmounting — because `useReducer`'s initial state only seeds on\n // mount, so a transcript cannot be re-keyed in place. Rebuilding is a hundred and fifty milliseconds\n // and it re-reads the store, which is exactly what moving to another conversation wants.\n let reopened: \"first\" | \"restart\" | \"switch\" | \"new\" = \"first\"\n /**\n * A conversation the running session asked to move to. Applied at the top of the next iteration.\n *\n * Carries its *reason* rather than sitting beside a second `mintedNew` boolean: two pieces of state\n * answering one question is how they come to disagree, and `reopened` is a closed union, so a reason\n * with no banner sentence is a compile error rather than a silent rebuild nobody explains.\n */\n const switchTo: { current: { key: string; reason: \"switch\" | \"new\" } | undefined } = {\n current: undefined,\n }\n\n /**\n * **Attach to a live host, or build a runtime — never both.**\n *\n * This is 17.1, and the sequence that makes it necessary is one command long: `run` declares\n * `needsServer`, so since 16.4 it already installs and starts a server — and then built a\n * *second* runtime for an agent that server was holding. Two processes on one SQLite file are\n * not two views of a conversation; they are two writers, and the runtime said so out loud, in\n * slot 2, to the model (`declined`, decision 5.17).\n *\n * `--ephemeral` is excluded by definition: it asks for an in-memory store, which is a request\n * for a runtime of one's own. Everything else attaches when something is there to attach to,\n * `--input` included — the plan's wording put one-shots on the embedded path, but its stated\n * reason was \"starts no channels or schedules\", and attaching starts none either. What a\n * one-shot gains is the thing the phase is about: one writer.\n *\n * Nothing here falls back *from* attached to embedded. If a host holds the lease and cannot be\n * reached, that is a fault to report rather than route around: quietly starting a second\n * runtime is exactly the state this removes, and it would look like success.\n */\n const attached =\n options.ephemeral === true\n ? undefined\n : hostFrom(await liveHostOf(agentIdFor(options.manifestPath), options.store))\n if (attached !== undefined) {\n return await runAttached({\n ...options,\n host: attached,\n mode: mode === \"rich\" ? \"rich\" : \"plain\",\n quiet,\n oneShot,\n reader,\n draft,\n session,\n random: randomBytes,\n })\n }\n\n // `/restart` rebuilds the agent in this process rather than replacing the process.\n //\n // The settings an agent booted with are fixed for its lifetime — the catalogue is resolved once,\n // and slot 1 is rendered once, both deliberately — so a configuration change genuinely needs a new\n // agent and there is no honest way to apply one in place. Re-execing would work and would throw\n // away the terminal; this keeps the scrollback, and the conversation was never in memory anyway.\n for (;;) {\n const runtime = await RuntimeClass.create({\n agents: [options.manifestPath],\n toolProviders: TOOL_PROVIDERS,\n modelTransports: MODEL_TRANSPORTS,\n mediaProviders: MEDIA_PROVIDERS,\n builtInPlugins: BUILT_IN_PLUGINS,\n pluginRoot: pluginRoot(),\n scriptRunner: scriptRunner(),\n channels: CHANNELS,\n // A `.env` in the directory this was launched from loses to the agent's own. See\n // `lib/ambient.ts` — core's \"real environment wins\" is untouched; this decides what\n // counts as the real environment.\n env: ambientEnv([options.manifestPath]),\n store: options.ephemeral === true ? \":memory:\" : (options.store ?? storePath()),\n })\n current = runtime\n\n const agent = runtime.list()[0]\n if (agent === undefined) throw new Error(\"The manifest produced no agent.\")\n\n // The conversation this run belongs to.\n //\n // After the runtime, because both interesting answers read the store: `--continue` wants the most\n // recent conversation and a bare `--session` wants the list. Once resolved it is carried, so a\n // `/restart` rebuilds the agent and stays in the same conversation.\n if (session.current === undefined || session.current === \"\") {\n const resolved = await resolveSession({\n // The store, not `source`: that is built below, once the session is known, and\n // reaching for it here threw `Cannot access 'source' before initialization` on every\n // `--continue` and bare `--session` with no host running (since 3f7fe85).\n list: async () => withoutChildren(await agent.store.sessions.list(agent.id)),\n mode,\n asked: session.current,\n wantsContinue: options.continueSession === true,\n random: randomBytes,\n })\n if (typeof resolved === \"number\") {\n await runtime.stop(\"cli-exit\")\n return resolved\n }\n session.current = resolved.sessionKey\n freshSession.current = resolved.fresh\n }\n const sessionKey = session.current\n\n // Reasoning is shown by default on a model that has any.\n //\n // It used to be opt-in behind --show-reasoning, which meant the normal experience of a\n // reasoning model was a cursor sitting still for thirty seconds with nothing to look at,\n // and no indication anything was happening. The thinking is the only signal there is\n // during that time, and it is already being streamed and thrown away. `--no-reasoning`\n // turns it off; `--show-reasoning` stays, and is now a no-op that harms nobody's scripts.\n const reasons = agent.roles.main.capabilities.thinking !== \"none\"\n const showReasoning = options.noReasoning === true ? false : reasons\n\n const banner =\n quiet || oneShot\n ? []\n : await bannerLines(\n agent,\n sessionKey,\n runtime.store.location,\n // After a restart the process has been alive for however long the conversation\n // lasted, so time-since-process-start stops meaning anything. The first boot\n // reports it because that is the number the sub-second claim is about.\n reopened === \"first\" ? runtime.boot.processMs : runtime.boot.bootMs,\n reopened,\n demotedKeys([options.manifestPath]),\n leaving.current,\n )\n\n // The conversation so far, for the rich path only. `history` is the same read `send` performs, so\n // what is painted is exactly what the model is conditioned on — minus the runtime's own messages,\n // which `origin` identifies and which are not part of the conversation a person is resuming.\n // Which origins and roles count, and why each exclusion is deliberate, is `lib/resume.ts` —\n // extracted so it can be tested without standing up a runtime, which is what let the previous\n // two versions of this be wrong in a way only a live resume would show.\n const prior: readonly PriorMessage[] =\n mode === \"rich\" && !quiet && !oneShot\n ? priorMessages(await agent.history(sessionKey), agent.describe().dialect)\n : []\n\n const source = embeddedSource({\n agent,\n bus: runtime.bus,\n send: (text, sendOptions) => agent.send(text, sendOptions),\n history: async (key) =>\n priorMessages(await agent.history(key), agent.describe().dialect),\n sessions: async () => await agent.store.sessions.list(agent.id),\n clearSession: async (key) => {\n await agent.clearSession(key)\n },\n context: async (key) => contextViewOf(agent, key),\n streamFilter: () => agent.streamFilter(),\n description: {\n agentId: agent.id,\n name: agent.describe().name,\n model: agent.describe().model,\n dialect: agent.describe().dialect,\n window: agent.describe().window,\n catalogueTokens: agent.describe().catalogueTokens,\n thinking: agent.roles.main.capabilities.thinking,\n // Read off the agent, never caught on the bus: `Runtime.create` emits\n // `agent.warning` during boot, which finishes before anything could subscribe.\n warnings: [...agent.warnings, ...agent.tools.warnings],\n },\n })\n\n const wired = {\n ...options,\n source,\n embedded: { agent, runtime },\n sessionKey,\n banner,\n prior,\n quiet,\n reader,\n draft,\n showReasoning,\n freshSession: freshSession.current,\n switchTo,\n random: randomBytes,\n }\n const outcome = mode === \"rich\" ? await runRich(wired) : await runPlain(wired)\n\n await runtime.stop(outcome === RESTART ? \"restart\" : \"cli-exit\")\n if (outcome !== RESTART) return outcome\n if (switchTo.current === undefined) {\n reopened = \"restart\"\n } else {\n reopened = switchTo.current.reason\n // Read before the key is replaced: the sentence a `/new` prints is about the conversation\n // being left, which is the one thing the next banner cannot derive from its own state.\n leaving.current = sessionKey\n session.current = switchTo.current.key\n switchTo.current = undefined\n }\n // The splash does not come back after a rebuild, even when the key is unchanged and nothing has\n // been sent. The reason for the rebuild is a line in the banner, and a welcome screen in front of it\n // would hide the one sentence explaining what just happened.\n freshSession.current = false\n }\n}\n\n/**\n * What a renderer returns when the answer is \"build it again\", not \"we are done\".\n *\n * A symbol rather than a magic exit code: every other value this returns is a process exit status, and\n * a status that secretly means something else is the kind of overload that survives until someone\n * returns it by accident.\n */\n/** One install per skill, so a partial failure keeps the successful ones with a reason for the rest. */\nfunction installSkills(\n skills: readonly CatalogueEntry[],\n manifestPath: string,\n): readonly InstallOutcome[] {\n const outcomes: InstallOutcome[] = []\n for (const entry of skills) {\n skillsCommand({\n action: \"install\",\n manifestPath,\n name: `${entry.source}/${entry.skill}`,\n quiet: true,\n collect: outcomes,\n })\n }\n return outcomes\n}\n\nconst RESTART = Symbol(\"restart\")\ntype RunOutcome = number | typeof RESTART\n\n/**\n * Bare `run`: resolve the sandbox into either a manifest path to run or an exit code.\n *\n * The picker is the third Ink surface, mounted the same lazy way; picking unmounts it before the\n * chat mounts, so the two screens stack naturally in scrollback. \"Create a new agent\" chains\n * through `initInteractive` — one wizard entry point — and straight into the chat with the result.\n */\nasync function pickFromSandbox(\n mode: string,\n because: string,\n options: RunOptions,\n): Promise<string | number> {\n const agents = listAgents()\n\n if (agents.length === 0) {\n if (mode === \"rich\") {\n // First run, empty sandbox: the wizard IS the answer to \"run what?\".\n const created = await initInteractive({ plain: options.plain === true })\n if (created.kind === \"aborted\") {\n process.stdout.write(\"nothing to run\\n\")\n return EXIT_OK\n }\n if (created.kind === \"failed\") return created.code\n return created.manifestPath\n }\n throw new HarnessError({\n code: \"cli_sandbox_empty\",\n message: \"No agent named, and the sandbox is empty.\",\n hint: `Create one with \\`${BRAND.slug} init\\`, or pass a path to an agent.yaml.`,\n })\n }\n\n if (agents.length === 1 && agents[0] !== undefined) {\n // The overwhelmingly common case costs zero keystrokes; saying so keeps it explicable.\n process.stdout.write(`running ${agents[0].ref} — the only agent in the sandbox\\n`)\n return agents[0].manifestPath\n }\n\n if (mode !== \"rich\") {\n // Scriptable contexts get the list and a non-zero exit: nothing ran.\n for (const agent of agents) {\n process.stdout.write(\n `${agent.ref}\\t${agent.problem ?? agent.modelId ?? \"?\"}\\t${agent.dir}\\n`,\n )\n }\n process.stderr.write(\n `pass an agent name or a manifest path — the picker needs a terminal (${because})\\n`,\n )\n return EXIT_FAILURE\n }\n\n const [{ render }, { createElement }, { Picker }] = await Promise.all([\n import(\"ink\"),\n import(\"react\"),\n import(\"#components/Picker\"),\n ])\n let result: { kind: \"run\"; manifestPath: string } | { kind: \"create\" } | { kind: \"quit\" } = {\n kind: \"quit\",\n }\n // eslint-free narrowing escape: the callback assignment below is invisible to control-flow\n // analysis, so the read after waitUntilExit goes through a widened alias.\n markTerminalDirty()\n const instance = render(\n createElement(Picker, {\n title: `${BRAND.name} ${VERSION}`,\n agents,\n onDone: (picked) => {\n result = picked\n },\n }),\n { exitOnCtrlC: false, ...negotiateKeyboard(options.noEnhancedKeys) },\n )\n onExit(() => instance.unmount())\n await instance.waitUntilExit()\n instance.unmount()\n\n const picked = result as\n | { kind: \"run\"; manifestPath: string }\n | { kind: \"create\" }\n | { kind: \"quit\" }\n if (picked.kind === \"quit\") {\n process.stdout.write(\"nothing run\\n\")\n return EXIT_OK\n }\n if (picked.kind === \"create\") {\n const created = await initInteractive({ plain: options.plain === true })\n if (created.kind === \"aborted\") {\n process.stdout.write(\"nothing to run\\n\")\n return EXIT_OK\n }\n if (created.kind === \"failed\") return created.code\n return created.manifestPath\n }\n return picked.manifestPath\n}\n\n/**\n * Which conversation this run belongs to, or an exit code if the answer is \"none\".\n *\n * Three inputs, and the contradictory pair is refused rather than ranked. `--continue --session x` says\n * both \"the most recent one\" and \"this one\"; picking a winner would silently ignore half of what was\n * typed, and there is no reading of it that is obviously intended.\n *\n * The default is a **new** key. That is the behaviour change: every run used to land in `local:default`,\n * so an agent's store was one unbroken transcript and this morning's question was conditioned on\n * yesterday's debugging. It applies to `--input` too, which makes a scripted one-shot stateless unless it\n * names a session — deliberately, because a one-shot that quietly accumulated history grows its own\n * context until compaction starts thrashing, and `--session` is right there for the case somebody wants\n * the thread.\n */\nexport interface ResolvedSession {\n readonly sessionKey: string\n /**\n * The key was generated for this run, so there is nothing behind it.\n *\n * Carried rather than re-derived from a message count, because the two answers differ: a conversation\n * that was resumed and then cleared has no messages and is not new. This is what puts the splash in\n * front of a new conversation and keeps it away from a resumed one.\n */\n readonly fresh: boolean\n}\n\nasync function resolveSession(input: {\n /**\n * How to list conversations — not an `Agent`.\n *\n * The only thing this ever wanted from one, and taking the list instead is what lets an\n * attached run reuse it verbatim: it asks the *host* for its sessions, where an embedded run\n * asks its own store. A second copy of this function for the attached path would be a second\n * set of answers to \"what does `--continue` mean when there is nothing stored\", and those are\n * the cases somebody gets wrong once and never notices.\n */\n readonly list: () => Promise<readonly SourceSession[]>\n readonly mode: RenderMode\n /** `\"\"` for a bare `--session`; `undefined` for not asked at all. */\n readonly asked: string | undefined\n readonly wantsContinue: boolean\n readonly random: (count: number) => Uint8Array\n}): Promise<ResolvedSession | number> {\n const fresh = (): ResolvedSession => ({\n sessionKey: newSessionKey(input.random),\n fresh: true,\n })\n\n if (input.wantsContinue && input.asked === \"\") {\n throw new HarnessError({\n code: \"cli_session_ambiguous\",\n message: \"--continue and a bare --session ask for different things.\",\n hint: \"--continue takes the most recent conversation without asking; --session on its own opens the list. Pass one.\",\n })\n }\n\n if (input.wantsContinue) {\n const stored = await input.list()\n const recent = mostRecent(stored)\n if (recent === undefined) {\n // Not an error: an agent you have never talked to has no most-recent conversation, and refusing\n // would make `-c` unusable as a habit — you would have to remember whether this is the first time.\n process.stdout.write(\n \"no stored conversation with this agent yet — starting a new one\\n\",\n )\n return fresh()\n }\n return { sessionKey: recent.sessionKey, fresh: false }\n }\n\n if (input.asked === \"\") {\n const stored = await input.list()\n if (stored.length === 0) {\n process.stdout.write(\n \"no stored conversation with this agent yet — starting a new one\\n\",\n )\n return fresh()\n }\n if (input.mode !== \"rich\") {\n // The plain path lists them and refuses, rather than guessing. Same shape as the agent picker:\n // a surface that needs a keyboard says so and prints what you would have chosen from.\n for (const row of [...stored].sort(byRecency)) {\n process.stdout.write(\n `${row.sessionKey}\\t${row.messages}\\t${row.turns}\\t${row.lastActivityAt}\\n`,\n )\n }\n process.stderr.write(\n \"pass --session <key> — the picker needs a terminal, and --continue takes the most recent without one\\n\",\n )\n return EXIT_FAILURE\n }\n const picked = await pickSession([...stored].sort(byRecency))\n // Esc means \"leave things as they are\", which for a run that has not started yet is a new\n // conversation rather than no conversation. Quitting would make esc a way to fail to launch.\n return picked === undefined ? fresh() : { sessionKey: picked, fresh: false }\n }\n\n return input.asked === undefined ? fresh() : { sessionKey: input.asked, fresh: false }\n}\n\n/** Most recently touched first. One comparator, so the picker and `--continue` agree about \"recent\". */\nfunction byRecency(left: SourceSession, right: SourceSession): number {\n return Date.parse(right.lastActivityAt) - Date.parse(left.lastActivityAt)\n}\n\nfunction mostRecent(sessions: readonly SourceSession[]): SourceSession | undefined {\n return [...sessions].sort(byRecency)[0]\n}\n\n/** The session picker, mounted the same lazy way as every other Ink surface. */\nasync function pickSession(sessions: readonly SourceSession[]): Promise<string | undefined> {\n const [{ render }, { createElement }, { SessionPicker }] = await Promise.all([\n import(\"ink\"),\n import(\"react\"),\n import(\"#components/SessionPicker\"),\n ])\n\n let picked: string | undefined\n markTerminalDirty()\n const instance = render(\n createElement(SessionPicker, {\n sessions: sessions.map((row) => ({\n sessionKey: row.sessionKey,\n messages: row.messages,\n turns: row.turns,\n lastActivityAt: row.lastActivityAt,\n phase: row.phase,\n })),\n now: Date.now(),\n columns: screenColumns(process.stdout.columns, FALLBACK_COLUMNS),\n maxRows: SESSION_PICKER_ROWS,\n onDone: (key) => {\n picked = key\n instance.unmount()\n },\n }),\n { exitOnCtrlC: false, ...negotiateKeyboard() },\n )\n onExit(() => instance.unmount())\n await instance.waitUntilExit()\n return picked\n}\n\n/**\n * The banner for an attached run. Shorter than the embedded one, and short for a reason.\n *\n * Three of `bannerLines`' facts are about a runtime *in this process* and would be lies here: the\n * boot figure (nothing booted), the store location (none is open), and any warning read off a live\n * agent at load. What replaces them is the one fact an attached run has and an embedded one does\n * not — **where the agent actually is** — because \"this is a view\" is only useful if it says a view\n * of *what*, and a pid plus an address is what somebody can act on.\n *\n * Synchronous, unlike its embedded twin: everything it prints came back with the description.\n */\nfunction attachedBanner(\n source: AgentSource,\n sessionKey: string,\n host: LiveHost,\n reopened: \"first\" | \"restart\" | \"switch\" | \"new\",\n previousKey?: string,\n): readonly string[] {\n const described = source.describe()\n const lines = [\n `${BRAND.name} ${VERSION} · ${described.agentId} · ${described.model}`,\n `session ${sessionKey} · window ${described.window} · attached to ${host.baseUrl} (pid ${host.pid})`,\n // The sentence that makes the mode legible. Without it, `/exit` leaving a bot answering\n // Telegram reads as a command that failed to stop something.\n `a view — the agent keeps running when you leave · /help for commands · /exit to detach`,\n ]\n const note = reopenNote(reopened, previousKey)\n if (note !== undefined) lines.push(note)\n // Read off the description rather than caught on the stream: these are emitted during the\n // host's boot, which finished long before this process subscribed to anything.\n for (const warning of described.warnings) lines.push(`warning: ${warning.message}`)\n return lines\n}\n\n/**\n * A run that is a **view**: no runtime, no store, no lease.\n *\n * The mirror of the loop below, and deliberately shorter, because most of what that loop does is\n * about owning a runtime. There is no rebuild here — `/restart` asks the host to replace the agent\n * and the screen stays up, since there is nothing in this process to rebuild — so the only reason\n * to go round again is a conversation switch.\n *\n * It opens no database on purpose. Reading history and sessions locally would make the store path a\n * second source of truth that can disagree with the host while both look correct: a stale `--store`\n * would show a different conversation than the one being appended to. The lease carries a\n * `baseUrl` (16.3) precisely so this does not have to guess a port either.\n */\nasync function runAttached(\n input: RunOptions & {\n readonly host: LiveHost\n readonly mode: \"rich\" | \"plain\"\n readonly quiet: boolean\n readonly oneShot: boolean\n readonly reader: { current: Interface | undefined }\n readonly draft: { current: string }\n readonly session: { current: string | undefined }\n readonly random: (count: number) => Uint8Array\n },\n): Promise<number> {\n const manifestPath = input.manifestPath ?? \"\"\n const agentId = agentIdFor(manifestPath)\n // The credential comes from the manifest's *layered* env, which is the same place `serve` read\n // it — never from `ambientEnv`, which answers \"what is in this process\" and made a token sitting\n // beside the manifest invisible once already.\n const token = hostToken(manifestPath)\n const client = createClient({\n baseUrl: input.host.baseUrl,\n ...(token === undefined ? {} : { token }),\n })\n\n const described = await client.agent(agentId).describe()\n // A stopped agent's resource answers with `status: \"disabled\"` since pilot.5 rather than 404. Only\n // reachable in a race (the lease was read, then the agent was stopped), since a stop releases the\n // lease and `run` attaches only to a holder. Refused here rather than attaching to an agent that\n // will 404 every send.\n if (described.status === \"disabled\") {\n throw new HarnessError({\n code: \"agent_disabled\",\n message: `${agentId} was stopped while this run was attaching.`,\n hint: `Start it with \\`${BRAND.slug} start ${agentId}\\`, then run again.`,\n })\n }\n const source = remoteSource({\n client,\n agentId,\n host: input.host,\n description: {\n agentId,\n name: described.name,\n model: described.model ?? \"unknown\",\n dialect: described.dialect ?? \"nlt\",\n window: described.window ?? 0,\n catalogueTokens: described.catalogueTokens ?? 0,\n // Not on the wire: a description says what the agent is, and whether a model reasons is\n // a capability the host resolved. Reasoning streams whenever the host sends it, which\n // is the honest default — `--no-reasoning` still turns it off.\n thinking: \"unknown\",\n // `WireError` is the client's name for the same `{code, message, hint, field?}`. A\n // cast rather than a remap: remapping four fields by hand is where a `field` goes\n // missing and nothing reports it.\n warnings: (described.warnings ?? []) as readonly ErrorDetail[],\n },\n })\n\n const switchTo: { current: { key: string; reason: \"switch\" | \"new\" } | undefined } = {\n current: undefined,\n }\n let reopened: \"first\" | \"restart\" | \"switch\" | \"new\" = \"first\"\n const leaving: { current: string | undefined } = { current: undefined }\n const freshSession = { current: false }\n\n for (;;) {\n if (input.session.current === undefined || input.session.current === \"\") {\n const resolved = await resolveSession({\n list: () => conversations(source),\n mode: input.mode,\n asked: input.session.current,\n wantsContinue: input.continueSession === true,\n random: input.random,\n })\n if (typeof resolved === \"number\") return resolved\n input.session.current = resolved.sessionKey\n freshSession.current = resolved.fresh\n }\n const sessionKey = input.session.current ?? \"\"\n\n const banner =\n input.quiet || input.oneShot\n ? []\n : attachedBanner(source, sessionKey, input.host, reopened, leaving.current)\n\n const prior =\n input.mode === \"rich\" && !input.quiet && !input.oneShot\n ? await source.history(sessionKey)\n : []\n\n const wired: Wired = {\n ...input,\n source,\n sessionKey,\n banner,\n prior,\n quiet: input.quiet,\n reader: input.reader,\n draft: input.draft,\n showReasoning: input.noReasoning !== true,\n freshSession: freshSession.current,\n switchTo,\n random: input.random,\n }\n const outcome = input.mode === \"rich\" ? await runRich(wired) : await runPlain(wired)\n if (outcome !== RESTART) {\n await source.close()\n return outcome\n }\n // The only way back round: a conversation switch. `/restart` never gets here, because\n // attached it is a request to the host and the screen never comes down.\n if (switchTo.current === undefined) {\n reopened = \"restart\"\n } else {\n reopened = switchTo.current.reason\n leaving.current = sessionKey\n input.session.current = switchTo.current.key\n switchTo.current = undefined\n }\n freshSession.current = false\n }\n}\n\ninterface Wired extends RunOptions {\n /**\n * Where the agent is. What the screen gets, and the only one of these two an attached run has.\n *\n * `agent` stays beside it for the helpers that genuinely need a live one — the banner's boot\n * figure, the manifest dump `/status` prints embedded. Those are facts about a runtime *in this\n * process*, so an attached run answers them differently rather than not at all.\n */\n readonly source: AgentSource\n /**\n * The live runtime, when this process is the one hosting.\n *\n * **Absent when attached**, which is the shape of the whole change: a view of somebody else's\n * agent has no `Agent` object and no store handle, and the compiler is what stops a helper\n * quietly reaching for one. Everything the screen needs goes through `source`; what is left\n * here are the facts that are only true of a runtime *in this process* — the boot figure, and\n * the manifest dump `/status` prints embedded.\n */\n readonly embedded?: { readonly agent: Agent; readonly runtime: RuntimeClass }\n /**\n * Resolved, not the raw flag: on by default for a model that reasons, off under\n * `--no-reasoning`. Narrowed to a required boolean here so no renderer has to re-decide.\n */\n readonly showReasoning: boolean\n readonly sessionKey: string\n readonly banner: readonly string[]\n readonly quiet: boolean\n /** The session key was generated for this run, so the splash stands in for an empty transcript. */\n readonly freshSession: boolean\n /**\n * The conversation as it already stands, for the rich path to paint.\n *\n * Read here rather than inside the component because the host owns the store. Empty on a fresh\n * session, and empty on the plain path deliberately: `--plain` has to match a pipe byte for byte,\n * and a piped REPL replaying its own history would change what every existing script reads.\n */\n readonly prior: readonly PriorMessage[]\n /**\n * Where the running session asked to move to, and why. Read by the loop, not by the renderer.\n *\n * The reason rides with the key because the loop has to tell a `/sessions` switch from a `/new`, and\n * a second boolean beside this box would be a second answer to one question.\n */\n readonly switchTo: { current: { key: string; reason: \"switch\" | \"new\" } | undefined }\n /** Six bytes, injected so a test gets the key it asked for. `randomBytes` in production. */\n readonly random: (count: number) => Uint8Array\n /**\n * The line reader, owned by `runCommand` so it survives a `/restart`.\n *\n * Rebuilding it per runtime is the obvious thing and it breaks: a second `createInterface` over a\n * pipe that the first one already read to EOF returns immediately, so everything after `/restart`\n * is silently dropped. A terminal probably tolerates it — and \"probably\" is the problem, since it\n * cannot be tested where there is no tty. Sharing one reader removes the difference rather than\n * betting on it.\n */\n readonly reader: { current: Interface | undefined }\n /** The unsent message, surviving a restart. Empty on a fresh run. */\n readonly draft: { current: string }\n}\n\n/**\n * The Ink app.\n *\n * `exitOnCtrlC: false` is not optional. Ink's default is to handle Ctrl-C itself and exit the\n * process, which would silently undo the contract Phase 1 established and measured — Ctrl-C cancels\n * the turn, not the process — and the failure would look like \"cancellation kills the session\".\n */\nasync function runRich(wired: Wired): Promise<RunOutcome> {\n const [{ render }, { createElement }, { App }] = await Promise.all([\n import(\"ink\"),\n import(\"react\"),\n import(\"#components/App\"),\n ])\n\n // The session takes the whole terminal.\n //\n // `markAltScreen` before the sequence, not after: it is what teaches every exit route — an explicit\n // `finish`, a signal, a crash guard, `process.on(\"exit\")` — to swap back out. Setting it and failing\n // to enter would be the worse order, because a `1049l` sent to a terminal that never entered the\n // buffer clears the output that was just written to it.\n //\n // The buffer is discarded on the way out and never joins the scrollback, which is the whole point and\n // also the cost: the conversation is gone from the screen the moment the session ends. That is what\n // the pointer line below exists for, and what makes `^C` take two presses.\n // Before `render`, which is the whole point: two listeners on one `data` event both receive the\n // chunk, ordering is registration order, and this one has to have parsed a sequence before Ink's\n // handler fires for it. `lib/csi.ts` says what it is for — Ink merges the super bit into `meta`, so\n // without this `cmd+←` is `⌥←`.\n const tap = openTap()\n onExit(() => {\n tap.close()\n })\n\n markAltScreen()\n // Tracking with the buffer swap, and only here: the chat is the one surface whose keymap claims every\n // mouse report, and a surface that asked for them without claiming them would have Ink type them into\n // it as text. `markMouse` is what teaches every exit route to switch it off again — including a crash,\n // because leaving it on hands the shell a terminal that reports clicks into its prompt.\n markMouse()\n process.stdout.write(`${ENTER_ALT_SCREEN}${ENABLE_MOUSE}`)\n\n let restart = false\n const instance = render(\n createElement(App, {\n source: wired.source,\n onSwitch: (sessionKey: string, draft: string) => {\n // The same route a `/restart` takes, for the reason stated at `reopened`: a transcript\n // cannot be re-keyed in place, so the conversation moves by rebuilding.\n restart = true\n wired.switchTo.current = { key: sessionKey, reason: \"switch\" }\n wired.draft.current = draft\n },\n onNew: (draft: string) => {\n // Identical to `onSwitch` but for a key that did not exist a moment ago. Minted here\n // rather than in the component: `run.ts` owns the randomness and its injection point,\n // and a component that reaches for crypto is one no test can pin to a known key.\n restart = true\n wired.switchTo.current = { key: newSessionKey(wired.random), reason: \"new\" }\n wired.draft.current = draft\n },\n sessions: async () => {\n // Through the source, so an attached view lists the conversations the *host* has\n // rather than whatever a local store happens to hold. That is the whole reason an\n // attached run opens no database: two readings of \"which conversations exist\" can\n // disagree while both look correct, and only one of them is being written to.\n const stored = await conversations(wired.source)\n return [...stored].sort(byRecency).map((row) => ({\n sessionKey: row.sessionKey,\n messages: row.messages,\n turns: row.turns,\n lastActivityAt: row.lastActivityAt,\n phase: row.phase,\n }))\n },\n onRestart: (draft: string) => {\n restart = true\n // Written into the box the loop owns, the same way the readline instance is carried.\n // A local would be lost the moment this function returns, which is exactly when the\n // next mount needs it.\n wired.draft.current = draft\n },\n sessionKey: wired.sessionKey,\n model: wired.source.describe().model,\n agentName: wired.source.describe().agentId,\n // Only before the first message, and only in a conversation with nothing behind it.\n freshSession: wired.freshSession,\n // The count in the one-line header. The messages themselves are in the banner, which scrolls;\n // on a surface with no scrollback a session-wide fact that has scrolled away is a fact nobody\n // has, so the header keeps the number and says where to find the text.\n warnings: wired.source.describe().warnings.map((warning) => warning.message),\n // Without the title row: `titleLine` above the transcript already carries the brand, the\n // agent and the model, and printing both put one sentence on screen twice — measured at 100\n // columns, rows 6 and 8 of a fresh session. The plain path keeps it, because there is no\n // header there and it is the only place the version appears.\n initial: seedHistory(seed(wired.banner.slice(1)), wired.prior),\n correctKeys: tap.correct,\n showReasoning: wired.showReasoning,\n quiet: wired.quiet,\n // So a slash command runs against *this* agent: without it a child would resolve whichever\n // agent the cwd suggests, which would not look wrong in the output.\n ...(wired.manifestPath === undefined ? {} : { manifestPath: wired.manifestPath }),\n // The host owns the filesystem and the network; the screen owns neither. Injected here rather\n // than imported by the component, which also keeps `browse.ts` out of its import graph.\n catalogue: {\n load: (onStatus: (line: string) => void) => fetchCatalogue({ onStatus }),\n install: async (skills, into) => installReport(installSkills(skills, into)),\n },\n // The same definition the plain REPL calls at its own `/status`, reached through a callback\n // rather than by handing the component a runtime — one function, two callers, so the two\n // paths cannot come to disagree about whether a channel is connected.\n // Two statuses, chosen by which kind of run this is — never one with half its\n // sentences blanked. See `attachedStatus`.\n status: () =>\n wired.embedded === undefined\n ? attachedStatus(wired.source)\n : sessionStatus(wired.embedded),\n contextView: () => sessionContext(wired, wired.sessionKey),\n ...(wired.draft.current === \"\" ? {} : { initialDraft: wired.draft.current }),\n }),\n { exitOnCtrlC: false, ...negotiateKeyboard(wired.noEnhancedKeys) },\n )\n onExit(() => instance.unmount())\n\n await instance.waitUntilExit()\n\n // Restore *before* writing, or the notice lands on the buffer that is about to be discarded.\n // `restoreTerminal` is idempotent and runs again from the exit hook, so doing it here costs nothing\n // and is the only way to get a byte onto the shell's own screen.\n restoreTerminal()\n if (!restart) {\n process.stdout.write(\n resumeNotice({\n ref: wired.source.describe().agentId,\n sessionKey: wired.sessionKey,\n }),\n )\n }\n return restart ? RESTART : EXIT_OK\n}\n\n/** Line-oriented, and byte-identical whether stdout is a terminal or a pipe. */\nasync function runPlain(wired: Wired): Promise<RunOutcome> {\n const { source, sessionKey, quiet } = wired\n\n let atLineStart = true\n const write = (text: string) => {\n if (text === \"\") return\n process.stdout.write(text)\n atLineStart = text.endsWith(\"\\n\")\n }\n /** A line of its own, whatever the reply was part-way through writing. */\n const row = (text: string) => {\n if (!atLineStart) write(\"\\n\")\n write(`${text}\\n`)\n }\n\n if (wired.banner.length > 0) write(`${wired.banner.join(\"\\n\")}\\n\\n`)\n\n // A one-shot run prints the answer and nothing else, because something is parsing it. Tool rows\n // are for a person watching, so they follow the same rule as the banner and the stats line.\n const showRows = !quiet && wired.once === undefined\n\n // Streaming goes through the bus rather than a callback: the CLI is a subscriber like any other,\n // which is what keeps the server and the CLI from needing different cores.\n let streaming = false\n let lastKind: \"text\" | \"reasoning\" | undefined\n\n // With a line-oriented dialect the invocation *is* text, so raw deltas would put `ACTION:` and\n // `END` in front of the person and run them into the answer. The filter comes from the agent\n // rather than being chosen here: which dialect is in play is config, and one place decides it.\n // One per turn, told where the steps end — it owns the paragraph break between them.\n let filter = source.streamFilter()\n\n const show = (text: string) => {\n if (text === \"\") return\n write(text)\n streaming = true\n }\n\n /**\n * One wildcard subscription, switching on type — not seven by name.\n *\n * Named subscriptions were right while this read a bus directly. They are not expressible over\n * a source, which hands out one stream, and that turns out to be the better shape for the same\n * reason `useTurn` already gives: a subscription list silently misses any event a later phase\n * adds, while a switch with no branch simply ignores it. `{ chunks: true }` is the source's\n * business now, which is where it belongs — this path has always needed per-token frames and\n * had to remember to ask.\n */\n const unsubscribe = wired.source.subscribe((event: AnyEvent) => {\n // This conversation's events only, as the rich path filters: a channel turn for another peer\n // shares the bus, and so does a subagent, whose own streamed text would otherwise print into\n // this reply. An event with no session key is runtime-wide.\n if (event.sessionKey !== undefined && event.sessionKey !== sessionKey) return\n switch (event.type) {\n case \"model.result\":\n show(filter.endStep())\n return\n\n case \"model.chunk\": {\n const { delta, kind } = event.data\n if (kind === \"reasoning\" && wired.showReasoning !== true) return\n\n // A reasoning model streams its scratchpad and then its answer with no separator of\n // its own, so the two run together mid-sentence. The label is worth two lines: the\n // whole point of showing reasoning is being able to tell it apart from the reply.\n if (kind !== lastKind) {\n if (lastKind !== undefined) write(\"\\n\\n\")\n if (wired.showReasoning === true) {\n write(kind === \"reasoning\" ? \"· reasoning ·\\n\" : \"· reply ·\\n\")\n }\n lastKind = kind\n }\n\n // Reasoning is not parsed for tool calls, so it is not filtered for them either.\n if (kind === \"reasoning\") {\n write(delta)\n streaming = true\n return\n }\n show(filter.push(delta))\n return\n }\n\n case \"tool.result\": {\n if (!showRows) return\n const { slug, ok, latencyMs, truncated } = event.data\n row(\n ` · ${slug} — ${ok ? \"ok\" : \"failed\"} · ${latencyMs} ms${truncated ? \" · observation trimmed\" : \"\"}`,\n )\n return\n }\n\n // Every warning, and exempt from `showRows` like a gated call. It used to be one code —\n // `manifest_changed` — so an agent that rewrote its own configuration was reported and\n // everything else was not: a truncated reply, a repeated call, a compactor that silently\n // fell back to a mechanical digest, a prompt over the window. `showRows` exists to keep a\n // one-shot run free of *progress* rows, and a warning is not progress.\n case \"agent.warning\":\n row(` · ${event.data.message}\\n ${event.data.hint}`)\n return\n\n case \"tool.repair\":\n // Worth a line of its own: a silent repair looks like a slow turn.\n if (showRows)\n row(` · ${event.data.slugs.join(\", \")} — could not be used, asking again`)\n return\n\n // Deliberately NOT gated on `showRows`. Every other row here is for a person watching,\n // and suppressing them in a one-shot run is right — but a blocked write is the run doing\n // less than it was asked to, and a scripted caller parsing the output needs to know that\n // even more than a person does.\n case \"tool.gated\":\n row(` · ${event.data.slug} — blocked: ${event.data.reason}`)\n return\n\n // Also not gated on `showRows`. The ladder ran and the budget was still short, so history\n // was cut anyway — the same class as a blocked write: the run did less than it was asked\n // to, and for six phases the only trace was a field on `AssembledContext` nothing read.\n case \"context.dropped\":\n row(\n ` · context: ${event.data.messages} older message(s) did not fit the ${event.data.budget}-token budget and were left out`,\n )\n return\n\n default:\n return\n }\n })\n\n /**\n * A typed line that was a command rather than a prompt.\n *\n * Shared by both input branches, and driven by the same table the rich path uses. Before this,\n * the banner advertised `/help` and this path had no case for it, so it went to the model as a\n * prompt — a billed call answering a question about the CLI it knows nothing about.\n */\n const dispatch = async (\n trimmed: string,\n ): Promise<\"exit\" | \"restart\" | \"handled\" | \"prompt\"> => {\n // With the offered list, as the rich path passes it. Without it only the session verbs\n // resolve, so `/config get model.main.id` or `/channels` typed at a `--plain` prompt went to\n // the model as prose — the exact drift `App.tsx` records having fixed on the other path.\n const command = resolveSessionCommand(trimmed, offeredCommands())\n if (command === undefined) return \"prompt\"\n switch (command.kind) {\n case \"exit\":\n return \"exit\"\n case \"restart\": {\n /**\n * Attached, this is a request to the host — and the loop does not go round.\n *\n * The same branch `App` takes, and it has to be here too for the reason the\n * both-paths guard exists one file over: a command handled on one output path and\n * not the other is invisible. Left alone, the plain path returned `\"restart\"`, the\n * attached loop re-banners, and it printed *\"the configuration on disk is now the\n * one in force\"* — a sentence about a rebuild that never happened, which is worse\n * than doing nothing because somebody would believe it.\n */\n const reload = source.reload\n if (reload === undefined) return \"restart\"\n try {\n const adopted = await reload()\n row(`reloaded ${adopted.join(\", \")} — this conversation continues`)\n } catch (error) {\n row(\n `could not reload: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n return \"handled\"\n }\n case \"new\":\n // The same outcome `/restart` returns, with a key in the box — which is exactly what the\n // rich path's `onNew` does. No new outcome value: the loop below already turns \"restart\"\n // into `RESTART`, and the box is what makes this a move rather than a rebuild in place.\n wired.switchTo.current = { key: newSessionKey(wired.random), reason: \"new\" }\n return \"restart\"\n case \"help\":\n row(sessionHelpText())\n return \"handled\"\n case \"tools\":\n row(toolsReport(await source.tools()))\n return \"handled\"\n case \"status\":\n row(\n wired.embedded === undefined\n ? await attachedStatus(source)\n : await sessionStatus(wired.embedded),\n )\n return \"handled\"\n case \"context\":\n row(await sessionContext(wired, sessionKey))\n return \"handled\"\n case \"reset\":\n await source.clearSession(sessionKey)\n row(\"session cleared — memory files on disk are untouched\")\n return \"handled\"\n case \"unknown\":\n row(unknownCommandText(command))\n return \"handled\"\n case \"command\":\n // A CLI command typed at the plain prompt. Not run here: the plain path is a pipe's\n // path, and a command that expects to own the terminal has no business in one. Named\n // rather than silently sent to the model, which is the failure this dispatch exists for.\n row(\n `${command.name} is a command, not a prompt — run it at a terminal, or in another shell as \\`${BRAND.slug} ${command.name}${command.rest === \"\" ? \"\" : ` ${command.rest}`}\\``,\n )\n return \"handled\"\n }\n }\n\n let controller: AbortController | undefined\n let cancelledAt = 0\n let exitCode: RunOutcome = EXIT_OK\n\n const onInterrupt = (rl = wired.reader.current): void => {\n if (controller !== undefined && !controller.signal.aborted) {\n cancelledAt = performance.now()\n controller.abort()\n return\n }\n // Closing the readline interface ends the `for await` loop, which returns through the\n // `finally` below. Calling process.exit here would discard a non-zero code set by an earlier\n // failed turn, and could truncate piped output mid-write.\n rl?.close()\n write(\"\\n\")\n }\n\n const runOne = async (input: string): Promise<void> => {\n controller = new AbortController()\n streaming = false\n lastKind = undefined\n filter = source.streamFilter()\n\n const result = await source.send(input, { sessionKey, signal: controller.signal })\n controller = undefined\n\n // The filter withholds a trailing line break, since it cannot know whether more follows.\n show(filter.end())\n if (streaming && !atLineStart) write(\"\\n\")\n else if (!streaming && result.text !== \"\") write(`${result.text}\\n`)\n\n // One formatter for every ending, shared with the transcript. The previous version had a\n // sentence for three of the six reasons and printed the `max_steps` one only when the reply was\n // empty — so an agent that stopped mid-task having produced prose said nothing at all.\n const note = endNote(result.reason, {\n steps: result.steps,\n durationMs: result.durationMs,\n ...(cancelledAt === 0 ? {} : { cancelledAfterMs: performance.now() - cancelledAt }),\n })\n if (note !== undefined) write(`\\n(${note})\\n`)\n if (result.reason === \"error\" && result.error !== undefined) {\n process.stderr.write(\n `\\n${result.error.code}: ${result.error.message}\\n hint: ${result.error.hint}\\n`,\n )\n }\n if (endedBadly(result.reason)) exitCode = EXIT_FAILURE\n\n if (!quiet && result.reason === \"final\") {\n write(\n ` ${result.tokens.prompt} prompt · ${result.tokens.output} output · ${result.durationMs} ms\\n\\n`,\n )\n }\n\n // Bound the memory a long piped session can hold: stdout to a pipe is asynchronous, and a\n // slow reader would otherwise let unwritten replies accumulate for the life of the process.\n await flushOutput()\n }\n\n const sigintHandler = () => onInterrupt()\n process.on(\"SIGINT\", sigintHandler)\n\n try {\n if (wired.once !== undefined) {\n await runOne(wired.once)\n return exitCode\n }\n\n if (process.stdin.isTTY !== true) {\n const rl = wired.reader.current ?? createInterface({ input: process.stdin })\n wired.reader.current = rl\n for await (const line of rl) {\n const trimmed = line.trim()\n if (trimmed === \"\") continue\n // Commands work in a pipe too. A script that pipes `/exit` means it — this branch\n // used to skip the word and keep reading, which is the one place the piped path\n // disagreed with the terminal about what a typed line meant.\n const outcome = await dispatch(trimmed)\n if (outcome === \"exit\") break\n if (outcome === \"restart\") {\n exitCode = RESTART\n break\n }\n if (outcome === \"handled\") continue\n await runOne(trimmed)\n }\n return exitCode\n }\n\n // `terminal: false` is the whole point of this branch.\n //\n // Node's readline decides for itself whether to run in terminal mode, by reading\n // `output.isTTY` — so at a terminal it repaints the prompt with cursor-control sequences\n // (`ESC[1G`, `ESC[0J`, `ESC[3G`) that the same command piped never emits. That silently\n // breaks the property plain mode exists for: `--plain` at a terminal must produce exactly\n // what a pipe produces. Only the rich path is allowed to move a cursor.\n //\n // The cost is that readline no longer echoes or edits: the tty driver does both, because\n // nothing here puts stdin in raw mode. Typing, backspace and Ctrl-D behave as they do in any\n // line-buffered program. Arrow-key history is lost on this path — the rich path owns that.\n const rl =\n wired.reader.current ??\n createInterface({\n input: process.stdin,\n output: process.stdout,\n prompt: PROMPT,\n terminal: false,\n })\n wired.reader.current = rl\n // Outside terminal mode readline never emits its own SIGINT, so the process-level handler\n // installed below is the only one that fires. It closes `reader`, which ends the loop.\n rl.prompt()\n for await (const line of rl) {\n const trimmed = line.trim()\n\n if (trimmed === \"\") {\n rl.prompt()\n continue\n }\n\n const outcome = await dispatch(trimmed)\n if (outcome === \"exit\") break\n if (outcome === \"restart\") {\n exitCode = RESTART\n break\n }\n if (outcome === \"handled\") {\n rl.prompt()\n continue\n }\n\n await runOne(trimmed)\n rl.prompt()\n }\n // Closed only when this really is the end. A restart hands the same reader to the next\n // runtime, and closing it here would end the session the restart was meant to continue.\n if (exitCode !== RESTART) {\n rl.close()\n wired.reader.current = undefined\n }\n return exitCode\n } finally {\n process.off(\"SIGINT\", sigintHandler)\n unsubscribe()\n }\n}\n\n/**\n * `/status` — what this agent is, and what is actually running.\n *\n * The human twin of context slot 2. That block tells the *model* its model, window, channels,\n * server and permissions on every turn; until this existed the person at the prompt could not see\n * any of it, which is the same asymmetry slot 2 was added to remove, pointed the other way.\n *\n * State, not configuration, for the same reason slot 2 is: told only what the manifest says, an\n * agent under `run` concluded its Telegram runtime had died and reported that nothing was listening\n * on its port — from inside the running process. Every statement was true of the file and false of\n * the moment. So a configured-but-not-started channel says exactly that, and names what does start\n * it.\n */\n/**\n * `/status` for a run that owns its runtime — the manifest, and what is actually running here.\n *\n * Takes the embedded pair rather than the whole `Wired` so the compiler decides where it can be\n * called from. Every sentence it prints is about *this process*: whether channels are connected in\n * this session, whether the port is bound here, which store file is open. An attached run answers\n * the same question about a different process and therefore has its own version — `attachedStatus`\n * — rather than this one with the interesting halves blanked out.\n */\nasync function sessionStatus(embedded: {\n readonly agent: Agent\n readonly runtime: RuntimeClass\n}): Promise<string> {\n const { agent, runtime } = embedded\n const described = agent.describe()\n const manifest = agent.manifest\n // `channels.started`, never \"are any registered\". A binding exists under `run` too, so reading\n // its presence as \"connected\" is decision 5.17's bug wearing a different hat — and it was,\n // until this screen was built and said so out loud.\n const configured = manifest.channels\n .filter((channel) => channel.enabled)\n .map((channel) => `${channel.id} (${channel.type})`)\n .join(\", \")\n const channels =\n configured === \"\"\n ? \"none — reached through this session and the HTTP API only\"\n : runtime.channels.started\n ? `${configured} — connected in this session`\n : `${configured} — configured, NOT running here; \\`serve\\` starts channels, \\`run\\` does not`\n\n const server = !manifest.server.enabled\n ? \"off\"\n : `enabled on ${manifest.server.host}:${manifest.server.port}, NOT bound here — \\`serve\\` binds it`\n\n // Per role, and only the roles carrying their own configuration: an agent can run three models on\n // three endpoints, and until this existed only main's window was reported anywhere at all — so a\n // compactor budgeting against the fallback's 8,192 had nothing that could say so.\n const windows = windowReport(manifest)\n const others = windows.filter(\n (entry) => entry.role !== \"main\" && entry.role === entry.configuredAs,\n )\n\n return keyValue([\n { label: \"agent\", value: `${described.id} (${described.name})` },\n {\n label: \"model\",\n value: `${described.model} · ${manifest.tools.dialect} · ${described.window} token window (${describeWindowSource(windows[0]?.window)})`,\n },\n ...others.map((entry) => ({\n label: entry.role,\n value: `${entry.modelId} · ${entry.window.contextWindow} token window (${describeWindowSource(entry.window)})`,\n })),\n { label: \"channels\", value: channels },\n { label: \"http api\", value: server },\n { label: \"store\", value: runtime.store.location },\n { label: \"background\", value: await supervision(runtime, described.id) },\n ])\n}\n\n/**\n * `/status` for a run that is a **view** — what it is attached to, and what the host says.\n *\n * Not `sessionStatus` with the runtime facts blanked out. The interesting sentences there are all\n * about the process rendering them — \"connected in this session\", \"NOT bound here\", which store\n * file is open — and every one of them would be a lie about an agent hosted somewhere else. The\n * question a person types `/status` to ask is the same; the true answer is different.\n *\n * Decision 5.17's failure, one process boundary out, is exactly what this exists to avoid: an agent\n * was told its Telegram channel was not running *in this session* while a `serve` in the next\n * terminal was polling it. The host's own view of its channels is the honest source, so that is\n * what is printed — with the pid and address, because \"somewhere else\" is not an answer somebody\n * can act on.\n */\n/** The sessions a person had, without the ones a delegation created (`isChildSession`). */\nfunction withoutChildren<T extends { readonly sessionKey: string }>(\n rows: readonly T[],\n): readonly T[] {\n return rows.filter((row) => !isChildSession(row.sessionKey))\n}\n\nasync function conversations(source: AgentSource): Promise<readonly SourceSession[]> {\n return withoutChildren(await source.sessions())\n}\n\nasync function attachedStatus(source: AgentSource): Promise<string> {\n const described = source.describe()\n const host = source.host\n const [tools, sessions] = await Promise.all([source.tools(), source.sessions()])\n return keyValue([\n { label: \"agent\", value: `${described.agentId} (${described.name})` },\n {\n label: \"attached to\",\n value: host === undefined ? \"a host\" : `${host.baseUrl} · pid ${host.pid}`,\n },\n {\n label: \"this session\",\n value: \"a view — the agent runs in the host, and stays running when this exits\",\n },\n { label: \"model\", value: `${described.model} · ${described.window} token window` },\n { label: \"dialect\", value: described.dialect },\n {\n label: \"tools\",\n value: `${tools.tools.length} pinned · ${tools.catalogueTokens} catalogue tokens per turn`,\n },\n { label: \"conversations\", value: `${sessions.length} on this agent` },\n {\n label: \"warnings\",\n value:\n described.warnings.length === 0\n ? \"none\"\n : described.warnings.map((warning) => warning.message).join(\"; \"),\n },\n ])\n}\n\n/**\n * `/context` — what is in the prompt right now, and what the percentage is a percentage of.\n *\n * Through `previewContext`, which calls `assembleContext` with the same arguments `send` does. A\n * second assembly here would answer a question about a prompt nothing sends, and would drift the\n * first time a slot moved — the rule the HTTP surface's context endpoint already follows.\n */\n/**\n * The view `/context` renders, from a live agent.\n *\n * Extracted from `sessionContext` so the source can hand one back without the formatter caring\n * where it came from. Everything but `windowSource` is `previewContext`'s own output — which is\n * exactly what `GET /v1/agents/:id/context` returns, because that route calls the same method with\n * the same arguments `send` does rather than rebuilding the argument list.\n */\nasync function contextViewOf(agent: Agent, sessionKey: string): Promise<ContextView> {\n const preview = await agent.previewContext({ sessionKey })\n const [main] = windowReport(agent.manifest)\n return {\n slots: preview.slots,\n history: preview.history,\n cache: preview.cache,\n total: preview.total,\n window: preview.window,\n windowSource: describeWindowSource(main?.window),\n wireTokens: preview.wireTokens,\n reserveOutput: preview.reserveOutput,\n calibration: preview.calibration,\n lastCompaction:\n preview.compactions === 0\n ? undefined\n : `${preview.compactions} stage${preview.compactions === 1 ? \"\" : \"s\"} run this session`,\n }\n}\n\nasync function sessionContext(wired: Wired, sessionKey: string): Promise<string> {\n return contextReport(await wired.source.context(sessionKey))\n}\n\n/**\n * Who, if anyone, is keeping this agent up — and the three answers are genuinely different.\n *\n * \"Not supervised\" was the first version, derived from this runtime not holding the lease. It was\n * wrong in the most misleading direction available: a REPL correctly *declines* the lease when a\n * service already holds it, so an agent that had been running as a daemon for a week reported\n * itself unsupervised to the person looking straight at it.\n */\nasync function supervision(runtime: RuntimeClass, agentId: string): Promise<string> {\n if (runtime.owned.includes(agentId)) return \"this session is serving this agent\"\n const lease = await runtime.store.leases.get(agentId)\n if (lease !== undefined && processAlive(lease.pid)) {\n return lease.mode === \"daemon\"\n ? `running as a background service · pid ${lease.pid} · \\`${BRAND.slug} daemon status ${agentId}\\``\n : `served by another session · pid ${lease.pid} (${lease.mode})`\n }\n return `not supervised — \\`${BRAND.slug} daemon install ${agentId}\\` keeps it running without a terminal`\n}\n",
27
+ "/**\n * The `run` command. Two renderers, one setup.\n *\n * The rich path is the Ink app; the plain path is line-oriented and writes tokens to stdout as they\n * arrive. Which one runs is decided once, by `resolveMode`, and never re-decided mid-process.\n *\n * **Ink is imported lazily, and only on the rich path.** Measured: `react` + `ink` cost ~65 ms to\n * import under Bun and ~170-210 ms under Node, against a ~70 ms total runtime for `validate --json`.\n * A static import at the top of this file would be paid by every invocation of every command, so the\n * dynamic `import()` below is load-bearing rather than stylistic. A test asserts it stays that way.\n *\n * The plain path keeps Phase 1's behaviour deliberately unchanged, including the Ctrl-C contract and\n * the streaming writes, because both were verified against a real endpoint and a real SIGINT.\n */\n\nimport { randomBytes } from \"node:crypto\"\nimport { existsSync } from \"node:fs\"\nimport { createInterface, type Interface } from \"node:readline\"\nimport { createClient } from \"@dispach/client\"\nimport {\n type Agent,\n type AnyEvent,\n BRAND,\n defaultStorePath,\n describeWindowSource,\n type ErrorDetail,\n endedBadly,\n endNote,\n HarnessError,\n isChildSession,\n processAlive,\n Runtime as RuntimeClass,\n VERSION,\n windowReport,\n} from \"@dispach/core\"\nimport { fetchCatalogue } from \"#browse\"\nimport { initInteractive } from \"#init\"\nimport { ambientEnv, demotedKeys } from \"#lib/ambient\"\nimport { installReport } from \"#lib/browse\"\nimport {\n ENTER_ALT_SCREEN,\n EXIT_FAILURE,\n EXIT_OK,\n FALLBACK_COLUMNS,\n PROMPT,\n SESSION_PICKER_ROWS,\n} from \"#lib/const\"\nimport {\n flushOutput,\n markAltScreen,\n markMouse,\n markTerminalDirty,\n onExit,\n restoreTerminal,\n} from \"#lib/exit\"\nimport { negotiateKeyboard } from \"#lib/keyboard\"\nimport { agentIdFor, hostToken, liveHostOf } from \"#lib/lifecycle\"\nimport { ENABLE_MOUSE } from \"#lib/mouse\"\nimport { resolveModeFromProcess } from \"#lib/output\"\nimport { offeredCommands } from \"#lib/palette\"\nimport {\n BUILT_IN_PLUGINS,\n CHANNELS,\n MEDIA_PROVIDERS,\n MODEL_TRANSPORTS,\n scriptRunner,\n TOOL_PROVIDERS,\n} from \"#lib/providers\"\nimport { keyValue } from \"#lib/render\"\nimport { priorMessages, reopenNote, resumeNotice } from \"#lib/resume\"\nimport { listAgents, pluginRoot, storePath } from \"#lib/sandbox\"\nimport type { RunOptions } from \"#lib/schema\"\nimport { screenColumns } from \"#lib/screen\"\nimport {\n type ContextView,\n contextReport,\n resolveSessionCommand,\n sessionHelpText,\n toolsReport,\n unknownCommandText,\n} from \"#lib/session-commands\"\nimport { newSessionKey } from \"#lib/session-key\"\nimport {\n type AgentSource,\n embeddedSource,\n hostFrom,\n type LiveHost,\n remoteSource,\n type SourceSession,\n} from \"#lib/source\"\nimport type { CatalogueEntry } from \"#lib/source-cache\"\nimport { openTap } from \"#lib/stdin-tap\"\nimport type { RenderMode } from \"#lib/types\"\nimport { type InstallOutcome, skillsCommand } from \"#skills\"\nimport { type PriorMessage, seed, seedHistory } from \"#transcript\"\n\n/** Opening lines: what is loaded, what session, and whether the last turn finished. */\nasync function bannerLines(\n agent: Agent,\n sessionKey: string,\n storeLocation: string,\n bootMs: number,\n /**\n * Why this banner is being printed.\n *\n * A boolean answered \"is this the first one\" and there are now four answers: a `/restart` rebuilt the\n * agent, a session switch rebuilt it to move conversations, and `/new` rebuilt it onto a conversation\n * that did not exist a moment ago. They need different sentences — the restart note is about\n * configuration and would be a lie about a switch — and they agree about the boot number, because in\n * every case the process has been alive for however long the last conversation lasted and\n * time-since-process-start has stopped meaning anything.\n *\n * Closed on purpose: a new reason cannot be added without the compiler demanding a sentence for it.\n */\n reopened: \"first\" | \"restart\" | \"switch\" | \"new\",\n demoted: readonly string[] = [],\n /**\n * The conversation being left behind, for the one sentence that has to name it.\n *\n * Last, after the defaulted `demoted`: inserted next to `reopened` where it reads best, it would\n * have silently taken the argument the existing call site passes for `demoted`. A positional\n * parameter is added at the end or every caller is re-read.\n */\n previousKey?: string,\n) {\n const described = agent.describe()\n const [turns, resumed] = await Promise.all([\n agent.turns(sessionKey, 1),\n agent.store.messages.count(agent.id, sessionKey),\n ])\n\n // The title first, then the session. The rich path drops the title row — its one-line header restates\n // it, and the two together put the same brand, agent and model on screen twice — so anything that is\n // *not* in that header has to live below it. `window` moved down for exactly that reason: it is a fact\n // about this session's budget rather than part of the title.\n const lines = [\n `${BRAND.name} ${VERSION} · ${described.id} · ${described.model}`,\n `session ${sessionKey} · ${resumed} message(s) · window ${described.window} · store ${storeLocation}`,\n // Points at `/help` rather than listing commands: the list belongs to the table that\n // implements them, and a banner enumerating a subset is the drift this change removed.\n `ready in ${bootMs.toFixed(0)} ms · /help for commands and keys · /exit to leave`,\n ]\n\n // One function decides the sentence, and it is pure — see `lib/resume.ts`. Written inline here it\n // needed a live agent and a store to reach, so the only part of this banner a person reads was the\n // only part nothing could check.\n const note = reopenNote(reopened, previousKey)\n if (note !== undefined) lines.push(note)\n\n // Naming a reaped turn is the point of reaping it: the previous run died mid-generation, and the\n // person restarting is the one who needs to know.\n if (turns[0]?.errorCode === \"turn_abandoned\") {\n lines.push(\n \"note: the previous turn in this session did not finish — the process exited while it was generating.\",\n )\n }\n\n // Load warnings, read off the agent rather than caught on the bus.\n //\n // `Runtime.create` emits them as `agent.warning` during boot — which finishes *before* this\n // command subscribes to anything, so every one of them has been landing in an empty room: a\n // trimmed catalogue, a tool declared trusted by its provider, a shell that can only run once a\n // turn. Silent, and precisely the class of thing the loud resolution path exists to prevent.\n //\n // Reading the resolved state instead of racing the bus is also the more honest fix. These are\n // properties of the loaded agent, not events, and something that is true for the whole session\n // belongs where a person will still see it after scrolling.\n for (const warning of [...agent.warnings, ...agent.tools.warnings]) {\n lines.push(`note: ${warning.message}\\n ${warning.hint}`)\n }\n\n // The other half of the same honesty. Core warns when the environment *took* a variable from the\n // agent's own .env; this says when the CLI decided a .env in the current directory should not\n // have. Someone who just wrote MODEL_ID into a project file and finds their agent ignoring it\n // needs the sentence as much as the person who found their agent obeying it.\n if (demoted.length > 0) {\n lines.push(\n `note: ${demoted.join(\", \")} in the .env here ${demoted.length === 1 ? \"was\" : \"were\"} ignored — this agent's own .env sets ${demoted.length === 1 ? \"it\" : \"them\"}.\\n A .env in the directory you launched from configures that project, not an agent living somewhere else. Export the variable to override the agent's own file.`,\n )\n }\n\n return lines\n}\n\nexport async function runCommand(options: RunOptions): Promise<number> {\n const oneShot = options.once !== undefined\n const decision = resolveModeFromProcess({\n json: false,\n plain: options.plain === true,\n oneShot,\n })\n const { mode } = decision\n\n // No agent named: the sandbox decides. One agent auto-runs; several open the picker at a\n // terminal and list plainly everywhere else; none goes straight to the wizard (rich) or an\n // error naming `init` (plain) — an empty sandbox with no guidance is a dead end.\n if (options.manifestPath === undefined) {\n const picked = await pickFromSandbox(mode, decision.because, options)\n if (typeof picked === \"number\") return picked\n return runCommand({ ...options, manifestPath: picked })\n }\n\n // The CLI opts into persistence explicitly — core defaults to memory so that embedding the\n // library never writes to someone's working directory uninvited. The default store lives at\n // the sandbox root: one store for every agent, wherever `run` is invoked from — a cwd-relative\n // default gave the same agent a different session history in every directory.\n const legacy = defaultStorePath()\n if (options.store === undefined && options.ephemeral !== true && existsSync(legacy)) {\n process.stdout.write(\n `note: a session store exists at ${legacy} from an earlier version — pass --store ${legacy} to keep using it; the default is now ${storePath()}\\n`,\n )\n }\n // One teardown for however many runtimes this call goes through. Registering inside the loop\n // would hold a reference to every dead one; `Runtime.stop` is already idempotent, so the live\n // reference is the only thing that has to move.\n let current: RuntimeClass | undefined\n onExit(() => current?.stop(\"cli-exit\"))\n\n // Outlives every runtime this call builds. See `Wired.reader`.\n const reader: { current: Interface | undefined } = { current: undefined }\n // The unsent message, carried across a `/restart` for the same reason the reader is: both belong to\n // the command rather than to one mount, and the restart tears the mount down.\n const draft: { current: string } = { current: \"\" }\n\n // Resolved once per call and then carried, because `/restart` must not silently move the conversation.\n //\n // Empty rather than absent means a bare `--session`: \"ask me which one\". Resolution needs the store, so\n // it happens inside the loop once a runtime exists — and the box is what keeps a picked key stable\n // across a restart, the same reason the reader and the draft live out here.\n const session: { current: string | undefined } = { current: options.sessionKey }\n // Whether the splash stands in for the transcript. Carried beside the key, and both survive a\n // `/restart` — which is not new, so the restarted session goes straight to the conversation.\n const freshSession = { current: false }\n /** The key the last iteration was on, for the `/new` banner. Undefined on the first. */\n const leaving: { current: string | undefined } = { current: undefined }\n const quiet = options.quiet === true\n // Why the loop is on this iteration. `switch` is set by the in-session picker, which reaches the loop\n // the same way `/restart` does — by unmounting — because `useReducer`'s initial state only seeds on\n // mount, so a transcript cannot be re-keyed in place. Rebuilding is a hundred and fifty milliseconds\n // and it re-reads the store, which is exactly what moving to another conversation wants.\n let reopened: \"first\" | \"restart\" | \"switch\" | \"new\" = \"first\"\n /**\n * A conversation the running session asked to move to. Applied at the top of the next iteration.\n *\n * Carries its *reason* rather than sitting beside a second `mintedNew` boolean: two pieces of state\n * answering one question is how they come to disagree, and `reopened` is a closed union, so a reason\n * with no banner sentence is a compile error rather than a silent rebuild nobody explains.\n */\n const switchTo: { current: { key: string; reason: \"switch\" | \"new\" } | undefined } = {\n current: undefined,\n }\n\n /**\n * **Attach to a live host, or build a runtime — never both.**\n *\n * This is 17.1, and the sequence that makes it necessary is one command long: `run` declares\n * `needsServer`, so since 16.4 it already installs and starts a server — and then built a\n * *second* runtime for an agent that server was holding. Two processes on one SQLite file are\n * not two views of a conversation; they are two writers, and the runtime said so out loud, in\n * slot 2, to the model (`declined`, decision 5.17).\n *\n * `--ephemeral` is excluded by definition: it asks for an in-memory store, which is a request\n * for a runtime of one's own. Everything else attaches when something is there to attach to,\n * `--input` included — the plan's wording put one-shots on the embedded path, but its stated\n * reason was \"starts no channels or schedules\", and attaching starts none either. What a\n * one-shot gains is the thing the phase is about: one writer.\n *\n * Nothing here falls back *from* attached to embedded. If a host holds the lease and cannot be\n * reached, that is a fault to report rather than route around: quietly starting a second\n * runtime is exactly the state this removes, and it would look like success.\n */\n const attached =\n options.ephemeral === true\n ? undefined\n : hostFrom(await liveHostOf(agentIdFor(options.manifestPath), options.store))\n if (attached !== undefined) {\n return await runAttached({\n ...options,\n host: attached,\n mode: mode === \"rich\" ? \"rich\" : \"plain\",\n quiet,\n oneShot,\n reader,\n draft,\n session,\n random: randomBytes,\n })\n }\n\n // `/restart` rebuilds the agent in this process rather than replacing the process.\n //\n // The settings an agent booted with are fixed for its lifetime — the catalogue is resolved once,\n // and slot 1 is rendered once, both deliberately — so a configuration change genuinely needs a new\n // agent and there is no honest way to apply one in place. Re-execing would work and would throw\n // away the terminal; this keeps the scrollback, and the conversation was never in memory anyway.\n for (;;) {\n const runtime = await RuntimeClass.create({\n agents: [options.manifestPath],\n toolProviders: TOOL_PROVIDERS,\n modelTransports: MODEL_TRANSPORTS,\n mediaProviders: MEDIA_PROVIDERS,\n builtInPlugins: BUILT_IN_PLUGINS,\n pluginRoot: pluginRoot(),\n scriptRunner: scriptRunner(),\n channels: CHANNELS,\n // A `.env` in the directory this was launched from loses to the agent's own. See\n // `lib/ambient.ts` — core's \"real environment wins\" is untouched; this decides what\n // counts as the real environment.\n env: ambientEnv([options.manifestPath]),\n store: options.ephemeral === true ? \":memory:\" : (options.store ?? storePath()),\n })\n current = runtime\n\n const agent = runtime.list()[0]\n if (agent === undefined) throw new Error(\"The manifest produced no agent.\")\n\n // The conversation this run belongs to.\n //\n // After the runtime, because both interesting answers read the store: `--continue` wants the most\n // recent conversation and a bare `--session` wants the list. Once resolved it is carried, so a\n // `/restart` rebuilds the agent and stays in the same conversation.\n if (session.current === undefined || session.current === \"\") {\n const resolved = await resolveSession({\n // The store, not `source`: that is built below, once the session is known, and\n // reaching for it here threw `Cannot access 'source' before initialization` on every\n // `--continue` and bare `--session` with no host running (since 3f7fe85).\n list: async () => withoutChildren(await agent.store.sessions.list(agent.id)),\n mode,\n asked: session.current,\n wantsContinue: options.continueSession === true,\n random: randomBytes,\n })\n if (typeof resolved === \"number\") {\n await runtime.stop(\"cli-exit\")\n return resolved\n }\n session.current = resolved.sessionKey\n freshSession.current = resolved.fresh\n }\n const sessionKey = session.current\n\n // Reasoning is shown by default on a model that has any.\n //\n // It used to be opt-in behind --show-reasoning, which meant the normal experience of a\n // reasoning model was a cursor sitting still for thirty seconds with nothing to look at,\n // and no indication anything was happening. The thinking is the only signal there is\n // during that time, and it is already being streamed and thrown away. `--no-reasoning`\n // turns it off; `--show-reasoning` stays, and is now a no-op that harms nobody's scripts.\n const reasons = agent.roles.main.capabilities.thinking !== \"none\"\n const showReasoning = options.noReasoning === true ? false : reasons\n\n const banner =\n quiet || oneShot\n ? []\n : await bannerLines(\n agent,\n sessionKey,\n runtime.store.location,\n // After a restart the process has been alive for however long the conversation\n // lasted, so time-since-process-start stops meaning anything. The first boot\n // reports it because that is the number the sub-second claim is about.\n reopened === \"first\" ? runtime.boot.processMs : runtime.boot.bootMs,\n reopened,\n demotedKeys([options.manifestPath]),\n leaving.current,\n )\n\n // The conversation so far, for the rich path only. `history` is the same read `send` performs, so\n // what is painted is exactly what the model is conditioned on — minus the runtime's own messages,\n // which `origin` identifies and which are not part of the conversation a person is resuming.\n // Which origins and roles count, and why each exclusion is deliberate, is `lib/resume.ts` —\n // extracted so it can be tested without standing up a runtime, which is what let the previous\n // two versions of this be wrong in a way only a live resume would show.\n const prior: readonly PriorMessage[] =\n mode === \"rich\" && !quiet && !oneShot\n ? priorMessages(await agent.history(sessionKey), agent.describe().dialect)\n : []\n\n const source = embeddedSource({\n agent,\n bus: runtime.bus,\n send: (text, sendOptions) => agent.send(text, sendOptions),\n history: async (key) =>\n priorMessages(await agent.history(key), agent.describe().dialect),\n sessions: async () => await agent.store.sessions.list(agent.id),\n clearSession: async (key) => {\n await agent.clearSession(key)\n },\n context: async (key) => contextViewOf(agent, key),\n streamFilter: () => agent.streamFilter(),\n description: {\n agentId: agent.id,\n name: agent.describe().name,\n model: agent.describe().model,\n dialect: agent.describe().dialect,\n window: agent.describe().window,\n catalogueTokens: agent.describe().catalogueTokens,\n thinking: agent.roles.main.capabilities.thinking,\n // Read off the agent, never caught on the bus: `Runtime.create` emits\n // `agent.warning` during boot, which finishes before anything could subscribe.\n warnings: [...agent.warnings, ...agent.tools.warnings],\n },\n })\n\n const wired = {\n ...options,\n source,\n embedded: { agent, runtime },\n sessionKey,\n banner,\n prior,\n quiet,\n reader,\n draft,\n showReasoning,\n freshSession: freshSession.current,\n switchTo,\n random: randomBytes,\n }\n const outcome = mode === \"rich\" ? await runRich(wired) : await runPlain(wired)\n\n await runtime.stop(outcome === RESTART ? \"restart\" : \"cli-exit\")\n if (outcome !== RESTART) return outcome\n if (switchTo.current === undefined) {\n reopened = \"restart\"\n } else {\n reopened = switchTo.current.reason\n // Read before the key is replaced: the sentence a `/new` prints is about the conversation\n // being left, which is the one thing the next banner cannot derive from its own state.\n leaving.current = sessionKey\n session.current = switchTo.current.key\n switchTo.current = undefined\n }\n // The splash does not come back after a rebuild, even when the key is unchanged and nothing has\n // been sent. The reason for the rebuild is a line in the banner, and a welcome screen in front of it\n // would hide the one sentence explaining what just happened.\n freshSession.current = false\n }\n}\n\n/**\n * What a renderer returns when the answer is \"build it again\", not \"we are done\".\n *\n * A symbol rather than a magic exit code: every other value this returns is a process exit status, and\n * a status that secretly means something else is the kind of overload that survives until someone\n * returns it by accident.\n */\n/** One install per skill, so a partial failure keeps the successful ones with a reason for the rest. */\nfunction installSkills(\n skills: readonly CatalogueEntry[],\n manifestPath: string,\n): readonly InstallOutcome[] {\n const outcomes: InstallOutcome[] = []\n for (const entry of skills) {\n skillsCommand({\n action: \"install\",\n manifestPath,\n name: `${entry.source}/${entry.skill}`,\n quiet: true,\n collect: outcomes,\n })\n }\n return outcomes\n}\n\nconst RESTART = Symbol(\"restart\")\ntype RunOutcome = number | typeof RESTART\n\n/**\n * Bare `run`: resolve the sandbox into either a manifest path to run or an exit code.\n *\n * The picker is the third Ink surface, mounted the same lazy way; picking unmounts it before the\n * chat mounts, so the two screens stack naturally in scrollback. \"Create a new agent\" chains\n * through `initInteractive` — one wizard entry point — and straight into the chat with the result.\n */\nasync function pickFromSandbox(\n mode: string,\n because: string,\n options: RunOptions,\n): Promise<string | number> {\n const agents = listAgents()\n\n if (agents.length === 0) {\n if (mode === \"rich\") {\n // First run, empty sandbox: the wizard IS the answer to \"run what?\".\n const created = await initInteractive({ plain: options.plain === true })\n if (created.kind === \"aborted\") {\n process.stdout.write(\"nothing to run\\n\")\n return EXIT_OK\n }\n if (created.kind === \"failed\") return created.code\n return created.manifestPath\n }\n throw new HarnessError({\n code: \"cli_sandbox_empty\",\n message: \"No agent named, and the sandbox is empty.\",\n hint: `Create one with \\`${BRAND.slug} init\\`, or pass a path to an agent.yaml.`,\n })\n }\n\n if (agents.length === 1 && agents[0] !== undefined) {\n // The overwhelmingly common case costs zero keystrokes; saying so keeps it explicable.\n process.stdout.write(`running ${agents[0].ref} — the only agent in the sandbox\\n`)\n return agents[0].manifestPath\n }\n\n if (mode !== \"rich\") {\n // Scriptable contexts get the list and a non-zero exit: nothing ran.\n for (const agent of agents) {\n process.stdout.write(\n `${agent.ref}\\t${agent.problem ?? agent.modelId ?? \"?\"}\\t${agent.dir}\\n`,\n )\n }\n process.stderr.write(\n `pass an agent name or a manifest path — the picker needs a terminal (${because})\\n`,\n )\n return EXIT_FAILURE\n }\n\n const [{ render }, { createElement }, { Picker }] = await Promise.all([\n import(\"ink\"),\n import(\"react\"),\n import(\"#components/Picker\"),\n ])\n let result: { kind: \"run\"; manifestPath: string } | { kind: \"create\" } | { kind: \"quit\" } = {\n kind: \"quit\",\n }\n // eslint-free narrowing escape: the callback assignment below is invisible to control-flow\n // analysis, so the read after waitUntilExit goes through a widened alias.\n markTerminalDirty()\n const instance = render(\n createElement(Picker, {\n title: `${BRAND.name} ${VERSION}`,\n agents,\n onDone: (picked) => {\n result = picked\n },\n }),\n { exitOnCtrlC: false, ...negotiateKeyboard(options.noEnhancedKeys) },\n )\n onExit(() => instance.unmount())\n await instance.waitUntilExit()\n instance.unmount()\n\n const picked = result as\n | { kind: \"run\"; manifestPath: string }\n | { kind: \"create\" }\n | { kind: \"quit\" }\n if (picked.kind === \"quit\") {\n process.stdout.write(\"nothing run\\n\")\n return EXIT_OK\n }\n if (picked.kind === \"create\") {\n const created = await initInteractive({ plain: options.plain === true })\n if (created.kind === \"aborted\") {\n process.stdout.write(\"nothing to run\\n\")\n return EXIT_OK\n }\n if (created.kind === \"failed\") return created.code\n return created.manifestPath\n }\n return picked.manifestPath\n}\n\n/**\n * Which conversation this run belongs to, or an exit code if the answer is \"none\".\n *\n * Three inputs, and the contradictory pair is refused rather than ranked. `--continue --session x` says\n * both \"the most recent one\" and \"this one\"; picking a winner would silently ignore half of what was\n * typed, and there is no reading of it that is obviously intended.\n *\n * The default is a **new** key. That is the behaviour change: every run used to land in `local:default`,\n * so an agent's store was one unbroken transcript and this morning's question was conditioned on\n * yesterday's debugging. It applies to `--input` too, which makes a scripted one-shot stateless unless it\n * names a session — deliberately, because a one-shot that quietly accumulated history grows its own\n * context until compaction starts thrashing, and `--session` is right there for the case somebody wants\n * the thread.\n */\nexport interface ResolvedSession {\n readonly sessionKey: string\n /**\n * The key was generated for this run, so there is nothing behind it.\n *\n * Carried rather than re-derived from a message count, because the two answers differ: a conversation\n * that was resumed and then cleared has no messages and is not new. This is what puts the splash in\n * front of a new conversation and keeps it away from a resumed one.\n */\n readonly fresh: boolean\n}\n\nasync function resolveSession(input: {\n /**\n * How to list conversations — not an `Agent`.\n *\n * The only thing this ever wanted from one, and taking the list instead is what lets an\n * attached run reuse it verbatim: it asks the *host* for its sessions, where an embedded run\n * asks its own store. A second copy of this function for the attached path would be a second\n * set of answers to \"what does `--continue` mean when there is nothing stored\", and those are\n * the cases somebody gets wrong once and never notices.\n */\n readonly list: () => Promise<readonly SourceSession[]>\n readonly mode: RenderMode\n /** `\"\"` for a bare `--session`; `undefined` for not asked at all. */\n readonly asked: string | undefined\n readonly wantsContinue: boolean\n readonly random: (count: number) => Uint8Array\n}): Promise<ResolvedSession | number> {\n const fresh = (): ResolvedSession => ({\n sessionKey: newSessionKey(input.random),\n fresh: true,\n })\n\n if (input.wantsContinue && input.asked === \"\") {\n throw new HarnessError({\n code: \"cli_session_ambiguous\",\n message: \"--continue and a bare --session ask for different things.\",\n hint: \"--continue takes the most recent conversation without asking; --session on its own opens the list. Pass one.\",\n })\n }\n\n if (input.wantsContinue) {\n const stored = await input.list()\n const recent = mostRecent(stored)\n if (recent === undefined) {\n // Not an error: an agent you have never talked to has no most-recent conversation, and refusing\n // would make `-c` unusable as a habit — you would have to remember whether this is the first time.\n process.stdout.write(\n \"no stored conversation with this agent yet — starting a new one\\n\",\n )\n return fresh()\n }\n return { sessionKey: recent.sessionKey, fresh: false }\n }\n\n if (input.asked === \"\") {\n const stored = await input.list()\n if (stored.length === 0) {\n process.stdout.write(\n \"no stored conversation with this agent yet — starting a new one\\n\",\n )\n return fresh()\n }\n if (input.mode !== \"rich\") {\n // The plain path lists them and refuses, rather than guessing. Same shape as the agent picker:\n // a surface that needs a keyboard says so and prints what you would have chosen from.\n for (const row of [...stored].sort(byRecency)) {\n process.stdout.write(\n `${row.sessionKey}\\t${row.messages}\\t${row.turns}\\t${row.lastActivityAt}\\n`,\n )\n }\n process.stderr.write(\n \"pass --session <key> — the picker needs a terminal, and --continue takes the most recent without one\\n\",\n )\n return EXIT_FAILURE\n }\n const picked = await pickSession([...stored].sort(byRecency))\n // Esc means \"leave things as they are\", which for a run that has not started yet is a new\n // conversation rather than no conversation. Quitting would make esc a way to fail to launch.\n return picked === undefined ? fresh() : { sessionKey: picked, fresh: false }\n }\n\n return input.asked === undefined ? fresh() : { sessionKey: input.asked, fresh: false }\n}\n\n/** Most recently touched first. One comparator, so the picker and `--continue` agree about \"recent\". */\nfunction byRecency(left: SourceSession, right: SourceSession): number {\n return Date.parse(right.lastActivityAt) - Date.parse(left.lastActivityAt)\n}\n\nfunction mostRecent(sessions: readonly SourceSession[]): SourceSession | undefined {\n return [...sessions].sort(byRecency)[0]\n}\n\n/** The session picker, mounted the same lazy way as every other Ink surface. */\nasync function pickSession(sessions: readonly SourceSession[]): Promise<string | undefined> {\n const [{ render }, { createElement }, { SessionPicker }] = await Promise.all([\n import(\"ink\"),\n import(\"react\"),\n import(\"#components/SessionPicker\"),\n ])\n\n let picked: string | undefined\n markTerminalDirty()\n const instance = render(\n createElement(SessionPicker, {\n sessions: sessions.map((row) => ({\n sessionKey: row.sessionKey,\n messages: row.messages,\n turns: row.turns,\n lastActivityAt: row.lastActivityAt,\n phase: row.phase,\n })),\n now: Date.now(),\n columns: screenColumns(process.stdout.columns, FALLBACK_COLUMNS),\n maxRows: SESSION_PICKER_ROWS,\n onDone: (key) => {\n picked = key\n instance.unmount()\n },\n }),\n { exitOnCtrlC: false, ...negotiateKeyboard() },\n )\n onExit(() => instance.unmount())\n await instance.waitUntilExit()\n return picked\n}\n\n/**\n * The banner for an attached run. Shorter than the embedded one, and short for a reason.\n *\n * Three of `bannerLines`' facts are about a runtime *in this process* and would be lies here: the\n * boot figure (nothing booted), the store location (none is open), and any warning read off a live\n * agent at load. What replaces them is the one fact an attached run has and an embedded one does\n * not — **where the agent actually is** — because \"this is a view\" is only useful if it says a view\n * of *what*, and a pid plus an address is what somebody can act on.\n *\n * Synchronous, unlike its embedded twin: everything it prints came back with the description.\n */\nfunction attachedBanner(\n source: AgentSource,\n sessionKey: string,\n host: LiveHost,\n reopened: \"first\" | \"restart\" | \"switch\" | \"new\",\n previousKey?: string,\n): readonly string[] {\n const described = source.describe()\n const lines = [\n `${BRAND.name} ${VERSION} · ${described.agentId} · ${described.model}`,\n `session ${sessionKey} · window ${described.window} · attached to ${host.baseUrl} (pid ${host.pid})`,\n // The sentence that makes the mode legible. Without it, `/exit` leaving a bot answering\n // Telegram reads as a command that failed to stop something.\n `a view — the agent keeps running when you leave · /help for commands · /exit to detach`,\n ]\n const note = reopenNote(reopened, previousKey)\n if (note !== undefined) lines.push(note)\n // Read off the description rather than caught on the stream: these are emitted during the\n // host's boot, which finished long before this process subscribed to anything.\n for (const warning of described.warnings) lines.push(`warning: ${warning.message}`)\n return lines\n}\n\n/**\n * A run that is a **view**: no runtime, no store, no lease.\n *\n * The mirror of the loop below, and deliberately shorter, because most of what that loop does is\n * about owning a runtime. There is no rebuild here — `/restart` asks the host to replace the agent\n * and the screen stays up, since there is nothing in this process to rebuild — so the only reason\n * to go round again is a conversation switch.\n *\n * It opens no database on purpose. Reading history and sessions locally would make the store path a\n * second source of truth that can disagree with the host while both look correct: a stale `--store`\n * would show a different conversation than the one being appended to. The lease carries a\n * `baseUrl` (16.3) precisely so this does not have to guess a port either.\n */\nasync function runAttached(\n input: RunOptions & {\n readonly host: LiveHost\n readonly mode: \"rich\" | \"plain\"\n readonly quiet: boolean\n readonly oneShot: boolean\n readonly reader: { current: Interface | undefined }\n readonly draft: { current: string }\n readonly session: { current: string | undefined }\n readonly random: (count: number) => Uint8Array\n },\n): Promise<number> {\n const manifestPath = input.manifestPath ?? \"\"\n const agentId = agentIdFor(manifestPath)\n // The credential comes from the manifest's *layered* env, which is the same place `serve` read\n // it — never from `ambientEnv`, which answers \"what is in this process\" and made a token sitting\n // beside the manifest invisible once already.\n const token = hostToken(manifestPath)\n const client = createClient({\n baseUrl: input.host.baseUrl,\n ...(token === undefined ? {} : { token }),\n })\n\n const described = await client.agent(agentId).describe()\n // A stopped agent's resource answers with `status: \"disabled\"` since pilot.5 rather than 404. Only\n // reachable in a race (the lease was read, then the agent was stopped), since a stop releases the\n // lease and `run` attaches only to a holder. Refused here rather than attaching to an agent that\n // will 404 every send.\n if (described.status === \"disabled\") {\n throw new HarnessError({\n code: \"agent_disabled\",\n message: `${agentId} was stopped while this run was attaching.`,\n hint: `Start it with \\`${BRAND.slug} start ${agentId}\\`, then run again.`,\n })\n }\n const source = remoteSource({\n client,\n agentId,\n host: input.host,\n description: {\n agentId,\n name: described.name,\n model: described.model ?? \"unknown\",\n dialect: described.dialect ?? \"nlt\",\n window: described.window ?? 0,\n catalogueTokens: described.catalogueTokens ?? 0,\n // Not on the wire: a description says what the agent is, and whether a model reasons is\n // a capability the host resolved. Reasoning streams whenever the host sends it, which\n // is the honest default — `--no-reasoning` still turns it off.\n thinking: \"unknown\",\n // `WireError` is the client's name for the same `{code, message, hint, field?}`. A\n // cast rather than a remap: remapping four fields by hand is where a `field` goes\n // missing and nothing reports it.\n warnings: (described.warnings ?? []) as readonly ErrorDetail[],\n },\n })\n\n const switchTo: { current: { key: string; reason: \"switch\" | \"new\" } | undefined } = {\n current: undefined,\n }\n let reopened: \"first\" | \"restart\" | \"switch\" | \"new\" = \"first\"\n const leaving: { current: string | undefined } = { current: undefined }\n const freshSession = { current: false }\n\n for (;;) {\n if (input.session.current === undefined || input.session.current === \"\") {\n const resolved = await resolveSession({\n list: () => conversations(source),\n mode: input.mode,\n asked: input.session.current,\n wantsContinue: input.continueSession === true,\n random: input.random,\n })\n if (typeof resolved === \"number\") return resolved\n input.session.current = resolved.sessionKey\n freshSession.current = resolved.fresh\n }\n const sessionKey = input.session.current ?? \"\"\n\n const banner =\n input.quiet || input.oneShot\n ? []\n : attachedBanner(source, sessionKey, input.host, reopened, leaving.current)\n\n const prior =\n input.mode === \"rich\" && !input.quiet && !input.oneShot\n ? await source.history(sessionKey)\n : []\n\n const wired: Wired = {\n ...input,\n source,\n sessionKey,\n banner,\n prior,\n quiet: input.quiet,\n reader: input.reader,\n draft: input.draft,\n showReasoning: input.noReasoning !== true,\n freshSession: freshSession.current,\n switchTo,\n random: input.random,\n }\n const outcome = input.mode === \"rich\" ? await runRich(wired) : await runPlain(wired)\n if (outcome !== RESTART) {\n await source.close()\n return outcome\n }\n // The only way back round: a conversation switch. `/restart` never gets here, because\n // attached it is a request to the host and the screen never comes down.\n if (switchTo.current === undefined) {\n reopened = \"restart\"\n } else {\n reopened = switchTo.current.reason\n leaving.current = sessionKey\n input.session.current = switchTo.current.key\n switchTo.current = undefined\n }\n freshSession.current = false\n }\n}\n\ninterface Wired extends RunOptions {\n /**\n * Where the agent is. What the screen gets, and the only one of these two an attached run has.\n *\n * `agent` stays beside it for the helpers that genuinely need a live one — the banner's boot\n * figure, the manifest dump `/status` prints embedded. Those are facts about a runtime *in this\n * process*, so an attached run answers them differently rather than not at all.\n */\n readonly source: AgentSource\n /**\n * The live runtime, when this process is the one hosting.\n *\n * **Absent when attached**, which is the shape of the whole change: a view of somebody else's\n * agent has no `Agent` object and no store handle, and the compiler is what stops a helper\n * quietly reaching for one. Everything the screen needs goes through `source`; what is left\n * here are the facts that are only true of a runtime *in this process* — the boot figure, and\n * the manifest dump `/status` prints embedded.\n */\n readonly embedded?: { readonly agent: Agent; readonly runtime: RuntimeClass }\n /**\n * Resolved, not the raw flag: on by default for a model that reasons, off under\n * `--no-reasoning`. Narrowed to a required boolean here so no renderer has to re-decide.\n */\n readonly showReasoning: boolean\n readonly sessionKey: string\n readonly banner: readonly string[]\n readonly quiet: boolean\n /** The session key was generated for this run, so the splash stands in for an empty transcript. */\n readonly freshSession: boolean\n /**\n * The conversation as it already stands, for the rich path to paint.\n *\n * Read here rather than inside the component because the host owns the store. Empty on a fresh\n * session, and empty on the plain path deliberately: `--plain` has to match a pipe byte for byte,\n * and a piped REPL replaying its own history would change what every existing script reads.\n */\n readonly prior: readonly PriorMessage[]\n /**\n * Where the running session asked to move to, and why. Read by the loop, not by the renderer.\n *\n * The reason rides with the key because the loop has to tell a `/sessions` switch from a `/new`, and\n * a second boolean beside this box would be a second answer to one question.\n */\n readonly switchTo: { current: { key: string; reason: \"switch\" | \"new\" } | undefined }\n /** Six bytes, injected so a test gets the key it asked for. `randomBytes` in production. */\n readonly random: (count: number) => Uint8Array\n /**\n * The line reader, owned by `runCommand` so it survives a `/restart`.\n *\n * Rebuilding it per runtime is the obvious thing and it breaks: a second `createInterface` over a\n * pipe that the first one already read to EOF returns immediately, so everything after `/restart`\n * is silently dropped. A terminal probably tolerates it — and \"probably\" is the problem, since it\n * cannot be tested where there is no tty. Sharing one reader removes the difference rather than\n * betting on it.\n */\n readonly reader: { current: Interface | undefined }\n /** The unsent message, surviving a restart. Empty on a fresh run. */\n readonly draft: { current: string }\n}\n\n/**\n * The Ink app.\n *\n * `exitOnCtrlC: false` is not optional. Ink's default is to handle Ctrl-C itself and exit the\n * process, which would silently undo the contract Phase 1 established and measured — Ctrl-C cancels\n * the turn, not the process — and the failure would look like \"cancellation kills the session\".\n */\nasync function runRich(wired: Wired): Promise<RunOutcome> {\n const [{ render }, { createElement }, { App }] = await Promise.all([\n import(\"ink\"),\n import(\"react\"),\n import(\"#components/App\"),\n ])\n\n // The session takes the whole terminal.\n //\n // `markAltScreen` before the sequence, not after: it is what teaches every exit route — an explicit\n // `finish`, a signal, a crash guard, `process.on(\"exit\")` — to swap back out. Setting it and failing\n // to enter would be the worse order, because a `1049l` sent to a terminal that never entered the\n // buffer clears the output that was just written to it.\n //\n // The buffer is discarded on the way out and never joins the scrollback, which is the whole point and\n // also the cost: the conversation is gone from the screen the moment the session ends. That is what\n // the pointer line below exists for, and what makes `^C` take two presses.\n // Before `render`, which is the whole point: two listeners on one `data` event both receive the\n // chunk, ordering is registration order, and this one has to have parsed a sequence before Ink's\n // handler fires for it. `lib/csi.ts` says what it is for — Ink merges the super bit into `meta`, so\n // without this `cmd+←` is `⌥←`.\n const tap = openTap()\n onExit(() => {\n tap.close()\n })\n\n markAltScreen()\n // Tracking with the buffer swap, and only here: the chat is the one surface whose keymap claims every\n // mouse report, and a surface that asked for them without claiming them would have Ink type them into\n // it as text. `markMouse` is what teaches every exit route to switch it off again — including a crash,\n // because leaving it on hands the shell a terminal that reports clicks into its prompt.\n markMouse()\n process.stdout.write(`${ENTER_ALT_SCREEN}${ENABLE_MOUSE}`)\n\n let restart = false\n const instance = render(\n createElement(App, {\n source: wired.source,\n onSwitch: (sessionKey: string, draft: string) => {\n // The same route a `/restart` takes, for the reason stated at `reopened`: a transcript\n // cannot be re-keyed in place, so the conversation moves by rebuilding.\n restart = true\n wired.switchTo.current = { key: sessionKey, reason: \"switch\" }\n wired.draft.current = draft\n },\n onNew: (draft: string) => {\n // Identical to `onSwitch` but for a key that did not exist a moment ago. Minted here\n // rather than in the component: `run.ts` owns the randomness and its injection point,\n // and a component that reaches for crypto is one no test can pin to a known key.\n restart = true\n wired.switchTo.current = { key: newSessionKey(wired.random), reason: \"new\" }\n wired.draft.current = draft\n },\n sessions: async () => {\n // Through the source, so an attached view lists the conversations the *host* has\n // rather than whatever a local store happens to hold. That is the whole reason an\n // attached run opens no database: two readings of \"which conversations exist\" can\n // disagree while both look correct, and only one of them is being written to.\n const stored = await conversations(wired.source)\n return [...stored].sort(byRecency).map((row) => ({\n sessionKey: row.sessionKey,\n messages: row.messages,\n turns: row.turns,\n lastActivityAt: row.lastActivityAt,\n phase: row.phase,\n }))\n },\n onRestart: (draft: string) => {\n restart = true\n // Written into the box the loop owns, the same way the readline instance is carried.\n // A local would be lost the moment this function returns, which is exactly when the\n // next mount needs it.\n wired.draft.current = draft\n },\n sessionKey: wired.sessionKey,\n model: wired.source.describe().model,\n agentName: wired.source.describe().agentId,\n // Only before the first message, and only in a conversation with nothing behind it.\n freshSession: wired.freshSession,\n // The count in the one-line header. The messages themselves are in the banner, which scrolls;\n // on a surface with no scrollback a session-wide fact that has scrolled away is a fact nobody\n // has, so the header keeps the number and says where to find the text.\n warnings: wired.source.describe().warnings.map((warning) => warning.message),\n // Without the title row: `titleLine` above the transcript already carries the brand, the\n // agent and the model, and printing both put one sentence on screen twice — measured at 100\n // columns, rows 6 and 8 of a fresh session. The plain path keeps it, because there is no\n // header there and it is the only place the version appears.\n initial: seedHistory(seed(wired.banner.slice(1)), wired.prior),\n correctKeys: tap.correct,\n showReasoning: wired.showReasoning,\n quiet: wired.quiet,\n // So a slash command runs against *this* agent: without it a child would resolve whichever\n // agent the cwd suggests, which would not look wrong in the output.\n ...(wired.manifestPath === undefined ? {} : { manifestPath: wired.manifestPath }),\n // The host owns the filesystem and the network; the screen owns neither. Injected here rather\n // than imported by the component, which also keeps `browse.ts` out of its import graph.\n catalogue: {\n load: (onStatus: (line: string) => void) => fetchCatalogue({ onStatus }),\n install: async (skills, into) => installReport(installSkills(skills, into)),\n },\n // The same definition the plain REPL calls at its own `/status`, reached through a callback\n // rather than by handing the component a runtime — one function, two callers, so the two\n // paths cannot come to disagree about whether a channel is connected.\n // Two statuses, chosen by which kind of run this is — never one with half its\n // sentences blanked. See `attachedStatus`.\n status: () =>\n wired.embedded === undefined\n ? attachedStatus(wired.source)\n : sessionStatus(wired.embedded),\n contextView: () => sessionContext(wired, wired.sessionKey),\n ...(wired.draft.current === \"\" ? {} : { initialDraft: wired.draft.current }),\n }),\n { exitOnCtrlC: false, ...negotiateKeyboard(wired.noEnhancedKeys) },\n )\n onExit(() => instance.unmount())\n\n await instance.waitUntilExit()\n\n // Restore *before* writing, or the notice lands on the buffer that is about to be discarded.\n // `restoreTerminal` is idempotent and runs again from the exit hook, so doing it here costs nothing\n // and is the only way to get a byte onto the shell's own screen.\n restoreTerminal()\n if (!restart) {\n process.stdout.write(\n resumeNotice({\n ref: wired.source.describe().agentId,\n sessionKey: wired.sessionKey,\n }),\n )\n }\n return restart ? RESTART : EXIT_OK\n}\n\n/** Line-oriented, and byte-identical whether stdout is a terminal or a pipe. */\nasync function runPlain(wired: Wired): Promise<RunOutcome> {\n const { source, sessionKey, quiet } = wired\n\n let atLineStart = true\n const write = (text: string) => {\n if (text === \"\") return\n process.stdout.write(text)\n atLineStart = text.endsWith(\"\\n\")\n }\n /** A line of its own, whatever the reply was part-way through writing. */\n const row = (text: string) => {\n if (!atLineStart) write(\"\\n\")\n write(`${text}\\n`)\n }\n\n if (wired.banner.length > 0) write(`${wired.banner.join(\"\\n\")}\\n\\n`)\n\n // A one-shot run prints the answer and nothing else, because something is parsing it. Tool rows\n // are for a person watching, so they follow the same rule as the banner and the stats line.\n const showRows = !quiet && wired.once === undefined\n\n // Streaming goes through the bus rather than a callback: the CLI is a subscriber like any other,\n // which is what keeps the server and the CLI from needing different cores.\n let streaming = false\n let lastKind: \"text\" | \"reasoning\" | undefined\n\n // With a line-oriented dialect the invocation *is* text, so raw deltas would put `ACTION:` and\n // `END` in front of the person and run them into the answer. The filter comes from the agent\n // rather than being chosen here: which dialect is in play is config, and one place decides it.\n // One per turn, told where the steps end — it owns the paragraph break between them.\n let filter = source.streamFilter()\n\n const show = (text: string) => {\n if (text === \"\") return\n write(text)\n streaming = true\n }\n\n /**\n * One wildcard subscription, switching on type — not seven by name.\n *\n * Named subscriptions were right while this read a bus directly. They are not expressible over\n * a source, which hands out one stream, and that turns out to be the better shape for the same\n * reason `useTurn` already gives: a subscription list silently misses any event a later phase\n * adds, while a switch with no branch simply ignores it. `{ chunks: true }` is the source's\n * business now, which is where it belongs — this path has always needed per-token frames and\n * had to remember to ask.\n */\n const unsubscribe = wired.source.subscribe((event: AnyEvent) => {\n // This conversation's events only, as the rich path filters: a channel turn for another peer\n // shares the bus, and so does a subagent, whose own streamed text would otherwise print into\n // this reply. An event with no session key is runtime-wide.\n if (event.sessionKey !== undefined && event.sessionKey !== sessionKey) return\n switch (event.type) {\n case \"model.result\":\n show(filter.endStep())\n return\n\n case \"model.chunk\": {\n const { delta, kind } = event.data\n if (kind === \"reasoning\" && wired.showReasoning !== true) return\n\n // A reasoning model streams its scratchpad and then its answer with no separator of\n // its own, so the two run together mid-sentence. The label is worth two lines: the\n // whole point of showing reasoning is being able to tell it apart from the reply.\n if (kind !== lastKind) {\n if (lastKind !== undefined) write(\"\\n\\n\")\n if (wired.showReasoning === true) {\n write(kind === \"reasoning\" ? \"· reasoning ·\\n\" : \"· reply ·\\n\")\n }\n lastKind = kind\n }\n\n // Reasoning is not parsed for tool calls, so it is not filtered for them either.\n if (kind === \"reasoning\") {\n write(delta)\n streaming = true\n return\n }\n show(filter.push(delta))\n return\n }\n\n case \"tool.result\": {\n if (!showRows) return\n const { slug, ok, latencyMs, truncated } = event.data\n row(\n ` · ${slug} — ${ok ? \"ok\" : \"failed\"} · ${latencyMs} ms${truncated ? \" · observation trimmed\" : \"\"}`,\n )\n return\n }\n\n // Every warning, and exempt from `showRows` like a gated call. It used to be one code —\n // `manifest_changed` — so an agent that rewrote its own configuration was reported and\n // everything else was not: a truncated reply, a repeated call, a compactor that silently\n // fell back to a mechanical digest, a prompt over the window. `showRows` exists to keep a\n // one-shot run free of *progress* rows, and a warning is not progress.\n case \"agent.warning\":\n row(` · ${event.data.message}\\n ${event.data.hint}`)\n return\n\n case \"tool.repair\":\n // Worth a line of its own: a silent repair looks like a slow turn.\n if (showRows)\n row(\n event.data.slugs.length === 0\n ? ` · reply stopped short (${event.data.errors.join(\"; \")}), asking again`\n : ` · ${event.data.slugs.join(\", \")} — could not be used, asking again`,\n )\n return\n\n // Deliberately NOT gated on `showRows`. Every other row here is for a person watching,\n // and suppressing them in a one-shot run is right — but a blocked write is the run doing\n // less than it was asked to, and a scripted caller parsing the output needs to know that\n // even more than a person does.\n case \"tool.gated\":\n row(` · ${event.data.slug} — blocked: ${event.data.reason}`)\n return\n\n // Also not gated on `showRows`. The ladder ran and the budget was still short, so history\n // was cut anyway — the same class as a blocked write: the run did less than it was asked\n // to, and for six phases the only trace was a field on `AssembledContext` nothing read.\n case \"context.dropped\":\n row(\n ` · context: ${event.data.messages} older message(s) did not fit the ${event.data.budget}-token budget and were left out`,\n )\n return\n\n default:\n return\n }\n })\n\n /**\n * A typed line that was a command rather than a prompt.\n *\n * Shared by both input branches, and driven by the same table the rich path uses. Before this,\n * the banner advertised `/help` and this path had no case for it, so it went to the model as a\n * prompt — a billed call answering a question about the CLI it knows nothing about.\n */\n const dispatch = async (\n trimmed: string,\n ): Promise<\"exit\" | \"restart\" | \"handled\" | \"prompt\"> => {\n // With the offered list, as the rich path passes it. Without it only the session verbs\n // resolve, so `/config get model.main.id` or `/channels` typed at a `--plain` prompt went to\n // the model as prose — the exact drift `App.tsx` records having fixed on the other path.\n const command = resolveSessionCommand(trimmed, offeredCommands())\n if (command === undefined) return \"prompt\"\n switch (command.kind) {\n case \"exit\":\n return \"exit\"\n case \"restart\": {\n /**\n * Attached, this is a request to the host — and the loop does not go round.\n *\n * The same branch `App` takes, and it has to be here too for the reason the\n * both-paths guard exists one file over: a command handled on one output path and\n * not the other is invisible. Left alone, the plain path returned `\"restart\"`, the\n * attached loop re-banners, and it printed *\"the configuration on disk is now the\n * one in force\"* — a sentence about a rebuild that never happened, which is worse\n * than doing nothing because somebody would believe it.\n */\n const reload = source.reload\n if (reload === undefined) return \"restart\"\n try {\n const adopted = await reload()\n row(`reloaded ${adopted.join(\", \")} — this conversation continues`)\n } catch (error) {\n row(\n `could not reload: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n return \"handled\"\n }\n case \"new\":\n // The same outcome `/restart` returns, with a key in the box — which is exactly what the\n // rich path's `onNew` does. No new outcome value: the loop below already turns \"restart\"\n // into `RESTART`, and the box is what makes this a move rather than a rebuild in place.\n wired.switchTo.current = { key: newSessionKey(wired.random), reason: \"new\" }\n return \"restart\"\n case \"help\":\n row(sessionHelpText())\n return \"handled\"\n case \"tools\":\n row(toolsReport(await source.tools()))\n return \"handled\"\n case \"status\":\n row(\n wired.embedded === undefined\n ? await attachedStatus(source)\n : await sessionStatus(wired.embedded),\n )\n return \"handled\"\n case \"context\":\n row(await sessionContext(wired, sessionKey))\n return \"handled\"\n case \"reset\":\n await source.clearSession(sessionKey)\n row(\"session cleared — memory files on disk are untouched\")\n return \"handled\"\n case \"unknown\":\n row(unknownCommandText(command))\n return \"handled\"\n case \"command\":\n // A CLI command typed at the plain prompt. Not run here: the plain path is a pipe's\n // path, and a command that expects to own the terminal has no business in one. Named\n // rather than silently sent to the model, which is the failure this dispatch exists for.\n row(\n `${command.name} is a command, not a prompt — run it at a terminal, or in another shell as \\`${BRAND.slug} ${command.name}${command.rest === \"\" ? \"\" : ` ${command.rest}`}\\``,\n )\n return \"handled\"\n }\n }\n\n let controller: AbortController | undefined\n let cancelledAt = 0\n let exitCode: RunOutcome = EXIT_OK\n\n const onInterrupt = (rl = wired.reader.current): void => {\n if (controller !== undefined && !controller.signal.aborted) {\n cancelledAt = performance.now()\n controller.abort()\n return\n }\n // Closing the readline interface ends the `for await` loop, which returns through the\n // `finally` below. Calling process.exit here would discard a non-zero code set by an earlier\n // failed turn, and could truncate piped output mid-write.\n rl?.close()\n write(\"\\n\")\n }\n\n const runOne = async (input: string): Promise<void> => {\n controller = new AbortController()\n streaming = false\n lastKind = undefined\n filter = source.streamFilter()\n\n const result = await source.send(input, { sessionKey, signal: controller.signal })\n controller = undefined\n\n // The filter withholds a trailing line break, since it cannot know whether more follows.\n show(filter.end())\n if (streaming && !atLineStart) write(\"\\n\")\n else if (!streaming && result.text !== \"\") write(`${result.text}\\n`)\n\n // One formatter for every ending, shared with the transcript. The previous version had a\n // sentence for three of the six reasons and printed the `max_steps` one only when the reply was\n // empty — so an agent that stopped mid-task having produced prose said nothing at all.\n const note = endNote(result.reason, {\n steps: result.steps,\n durationMs: result.durationMs,\n ...(cancelledAt === 0 ? {} : { cancelledAfterMs: performance.now() - cancelledAt }),\n })\n if (note !== undefined) write(`\\n(${note})\\n`)\n if (result.reason === \"error\" && result.error !== undefined) {\n process.stderr.write(\n `\\n${result.error.code}: ${result.error.message}\\n hint: ${result.error.hint}\\n`,\n )\n }\n if (endedBadly(result.reason)) exitCode = EXIT_FAILURE\n\n if (!quiet && result.reason === \"final\") {\n write(\n ` ${result.tokens.prompt} prompt · ${result.tokens.output} output · ${result.durationMs} ms\\n\\n`,\n )\n }\n\n // Bound the memory a long piped session can hold: stdout to a pipe is asynchronous, and a\n // slow reader would otherwise let unwritten replies accumulate for the life of the process.\n await flushOutput()\n }\n\n const sigintHandler = () => onInterrupt()\n process.on(\"SIGINT\", sigintHandler)\n\n try {\n if (wired.once !== undefined) {\n await runOne(wired.once)\n return exitCode\n }\n\n if (process.stdin.isTTY !== true) {\n const rl = wired.reader.current ?? createInterface({ input: process.stdin })\n wired.reader.current = rl\n for await (const line of rl) {\n const trimmed = line.trim()\n if (trimmed === \"\") continue\n // Commands work in a pipe too. A script that pipes `/exit` means it — this branch\n // used to skip the word and keep reading, which is the one place the piped path\n // disagreed with the terminal about what a typed line meant.\n const outcome = await dispatch(trimmed)\n if (outcome === \"exit\") break\n if (outcome === \"restart\") {\n exitCode = RESTART\n break\n }\n if (outcome === \"handled\") continue\n await runOne(trimmed)\n }\n return exitCode\n }\n\n // `terminal: false` is the whole point of this branch.\n //\n // Node's readline decides for itself whether to run in terminal mode, by reading\n // `output.isTTY` — so at a terminal it repaints the prompt with cursor-control sequences\n // (`ESC[1G`, `ESC[0J`, `ESC[3G`) that the same command piped never emits. That silently\n // breaks the property plain mode exists for: `--plain` at a terminal must produce exactly\n // what a pipe produces. Only the rich path is allowed to move a cursor.\n //\n // The cost is that readline no longer echoes or edits: the tty driver does both, because\n // nothing here puts stdin in raw mode. Typing, backspace and Ctrl-D behave as they do in any\n // line-buffered program. Arrow-key history is lost on this path — the rich path owns that.\n const rl =\n wired.reader.current ??\n createInterface({\n input: process.stdin,\n output: process.stdout,\n prompt: PROMPT,\n terminal: false,\n })\n wired.reader.current = rl\n // Outside terminal mode readline never emits its own SIGINT, so the process-level handler\n // installed below is the only one that fires. It closes `reader`, which ends the loop.\n rl.prompt()\n for await (const line of rl) {\n const trimmed = line.trim()\n\n if (trimmed === \"\") {\n rl.prompt()\n continue\n }\n\n const outcome = await dispatch(trimmed)\n if (outcome === \"exit\") break\n if (outcome === \"restart\") {\n exitCode = RESTART\n break\n }\n if (outcome === \"handled\") {\n rl.prompt()\n continue\n }\n\n await runOne(trimmed)\n rl.prompt()\n }\n // Closed only when this really is the end. A restart hands the same reader to the next\n // runtime, and closing it here would end the session the restart was meant to continue.\n if (exitCode !== RESTART) {\n rl.close()\n wired.reader.current = undefined\n }\n return exitCode\n } finally {\n process.off(\"SIGINT\", sigintHandler)\n unsubscribe()\n }\n}\n\n/**\n * `/status` — what this agent is, and what is actually running.\n *\n * The human twin of context slot 2. That block tells the *model* its model, window, channels,\n * server and permissions on every turn; until this existed the person at the prompt could not see\n * any of it, which is the same asymmetry slot 2 was added to remove, pointed the other way.\n *\n * State, not configuration, for the same reason slot 2 is: told only what the manifest says, an\n * agent under `run` concluded its Telegram runtime had died and reported that nothing was listening\n * on its port — from inside the running process. Every statement was true of the file and false of\n * the moment. So a configured-but-not-started channel says exactly that, and names what does start\n * it.\n */\n/**\n * `/status` for a run that owns its runtime — the manifest, and what is actually running here.\n *\n * Takes the embedded pair rather than the whole `Wired` so the compiler decides where it can be\n * called from. Every sentence it prints is about *this process*: whether channels are connected in\n * this session, whether the port is bound here, which store file is open. An attached run answers\n * the same question about a different process and therefore has its own version — `attachedStatus`\n * — rather than this one with the interesting halves blanked out.\n */\nasync function sessionStatus(embedded: {\n readonly agent: Agent\n readonly runtime: RuntimeClass\n}): Promise<string> {\n const { agent, runtime } = embedded\n const described = agent.describe()\n const manifest = agent.manifest\n // `channels.started`, never \"are any registered\". A binding exists under `run` too, so reading\n // its presence as \"connected\" is decision 5.17's bug wearing a different hat — and it was,\n // until this screen was built and said so out loud.\n const configured = manifest.channels\n .filter((channel) => channel.enabled)\n .map((channel) => `${channel.id} (${channel.type})`)\n .join(\", \")\n const channels =\n configured === \"\"\n ? \"none — reached through this session and the HTTP API only\"\n : runtime.channels.started\n ? `${configured} — connected in this session`\n : `${configured} — configured, NOT running here; \\`serve\\` starts channels, \\`run\\` does not`\n\n const server = !manifest.server.enabled\n ? \"off\"\n : `enabled on ${manifest.server.host}:${manifest.server.port}, NOT bound here — \\`serve\\` binds it`\n\n // Per role, and only the roles carrying their own configuration: an agent can run three models on\n // three endpoints, and until this existed only main's window was reported anywhere at all — so a\n // compactor budgeting against the fallback's 8,192 had nothing that could say so.\n const windows = windowReport(manifest)\n const others = windows.filter(\n (entry) => entry.role !== \"main\" && entry.role === entry.configuredAs,\n )\n\n return keyValue([\n { label: \"agent\", value: `${described.id} (${described.name})` },\n {\n label: \"model\",\n value: `${described.model} · ${manifest.tools.dialect} · ${described.window} token window (${describeWindowSource(windows[0]?.window)})`,\n },\n ...others.map((entry) => ({\n label: entry.role,\n value: `${entry.modelId} · ${entry.window.contextWindow} token window (${describeWindowSource(entry.window)})`,\n })),\n { label: \"channels\", value: channels },\n { label: \"http api\", value: server },\n { label: \"store\", value: runtime.store.location },\n { label: \"background\", value: await supervision(runtime, described.id) },\n ])\n}\n\n/**\n * `/status` for a run that is a **view** — what it is attached to, and what the host says.\n *\n * Not `sessionStatus` with the runtime facts blanked out. The interesting sentences there are all\n * about the process rendering them — \"connected in this session\", \"NOT bound here\", which store\n * file is open — and every one of them would be a lie about an agent hosted somewhere else. The\n * question a person types `/status` to ask is the same; the true answer is different.\n *\n * Decision 5.17's failure, one process boundary out, is exactly what this exists to avoid: an agent\n * was told its Telegram channel was not running *in this session* while a `serve` in the next\n * terminal was polling it. The host's own view of its channels is the honest source, so that is\n * what is printed — with the pid and address, because \"somewhere else\" is not an answer somebody\n * can act on.\n */\n/** The sessions a person had, without the ones a delegation created (`isChildSession`). */\nfunction withoutChildren<T extends { readonly sessionKey: string }>(\n rows: readonly T[],\n): readonly T[] {\n return rows.filter((row) => !isChildSession(row.sessionKey))\n}\n\nasync function conversations(source: AgentSource): Promise<readonly SourceSession[]> {\n return withoutChildren(await source.sessions())\n}\n\nasync function attachedStatus(source: AgentSource): Promise<string> {\n const described = source.describe()\n const host = source.host\n const [tools, sessions] = await Promise.all([source.tools(), source.sessions()])\n return keyValue([\n { label: \"agent\", value: `${described.agentId} (${described.name})` },\n {\n label: \"attached to\",\n value: host === undefined ? \"a host\" : `${host.baseUrl} · pid ${host.pid}`,\n },\n {\n label: \"this session\",\n value: \"a view — the agent runs in the host, and stays running when this exits\",\n },\n { label: \"model\", value: `${described.model} · ${described.window} token window` },\n { label: \"dialect\", value: described.dialect },\n {\n label: \"tools\",\n value: `${tools.tools.length} pinned · ${tools.catalogueTokens} catalogue tokens per turn`,\n },\n { label: \"conversations\", value: `${sessions.length} on this agent` },\n {\n label: \"warnings\",\n value:\n described.warnings.length === 0\n ? \"none\"\n : described.warnings.map((warning) => warning.message).join(\"; \"),\n },\n ])\n}\n\n/**\n * `/context` — what is in the prompt right now, and what the percentage is a percentage of.\n *\n * Through `previewContext`, which calls `assembleContext` with the same arguments `send` does. A\n * second assembly here would answer a question about a prompt nothing sends, and would drift the\n * first time a slot moved — the rule the HTTP surface's context endpoint already follows.\n */\n/**\n * The view `/context` renders, from a live agent.\n *\n * Extracted from `sessionContext` so the source can hand one back without the formatter caring\n * where it came from. Everything but `windowSource` is `previewContext`'s own output — which is\n * exactly what `GET /v1/agents/:id/context` returns, because that route calls the same method with\n * the same arguments `send` does rather than rebuilding the argument list.\n */\nasync function contextViewOf(agent: Agent, sessionKey: string): Promise<ContextView> {\n const preview = await agent.previewContext({ sessionKey })\n const [main] = windowReport(agent.manifest)\n return {\n slots: preview.slots,\n history: preview.history,\n cache: preview.cache,\n total: preview.total,\n window: preview.window,\n windowSource: describeWindowSource(main?.window),\n wireTokens: preview.wireTokens,\n reserveOutput: preview.reserveOutput,\n calibration: preview.calibration,\n lastCompaction:\n preview.compactions === 0\n ? undefined\n : `${preview.compactions} stage${preview.compactions === 1 ? \"\" : \"s\"} run this session`,\n }\n}\n\nasync function sessionContext(wired: Wired, sessionKey: string): Promise<string> {\n return contextReport(await wired.source.context(sessionKey))\n}\n\n/**\n * Who, if anyone, is keeping this agent up — and the three answers are genuinely different.\n *\n * \"Not supervised\" was the first version, derived from this runtime not holding the lease. It was\n * wrong in the most misleading direction available: a REPL correctly *declines* the lease when a\n * service already holds it, so an agent that had been running as a daemon for a week reported\n * itself unsupervised to the person looking straight at it.\n */\nasync function supervision(runtime: RuntimeClass, agentId: string): Promise<string> {\n if (runtime.owned.includes(agentId)) return \"this session is serving this agent\"\n const lease = await runtime.store.leases.get(agentId)\n if (lease !== undefined && processAlive(lease.pid)) {\n return lease.mode === \"daemon\"\n ? `running as a background service · pid ${lease.pid} · \\`${BRAND.slug} daemon status ${agentId}\\``\n : `served by another session · pid ${lease.pid} (${lease.mode})`\n }\n return `not supervised — \\`${BRAND.slug} daemon install ${agentId}\\` keeps it running without a terminal`\n}\n",
28
28
  "// src/errors.ts\nclass DispachError extends Error {\n code;\n hint;\n field;\n status;\n request;\n constructor(detail, context = {}) {\n super(detail.hint === undefined ? detail.message : `${detail.message}\n hint: ${detail.hint}`);\n this.name = \"DispachError\";\n this.code = detail.code;\n this.hint = detail.hint ?? \"\";\n this.field = detail.field;\n this.status = context.status;\n this.request = context.method === undefined || context.path === undefined ? undefined : { method: context.method, path: context.path };\n if (context.cause !== undefined)\n this.cause = context.cause;\n }\n}\nfunction transportError(error, context) {\n const because = error instanceof Error ? error.message : String(error);\n return new DispachError({\n code: \"transport_failed\",\n message: `${context.method} ${context.path} did not reach ${context.baseUrl}: ${because}`,\n hint: \"Check the base URL, that the server is running, and that nothing between you and it is refusing the connection. `GET /v1/health` needs no token and is the cheapest probe.\"\n }, { ...context, cause: error });\n}\nasync function errorFromResponse(response, context) {\n let detail;\n try {\n const body = await response.json();\n if (typeof body.error?.code === \"string\" && typeof body.error.message === \"string\") {\n detail = {\n code: body.error.code,\n message: body.error.message,\n ...body.error.hint === undefined ? {} : { hint: body.error.hint },\n ...body.error.field === undefined ? {} : { field: body.error.field }\n };\n }\n } catch {}\n return new DispachError(detail ?? {\n code: `http_${response.status}`,\n message: `${context.method} ${context.path} returned ${response.status} with no error body.`,\n hint: \"This is not a response this server produces, so something between you and it answered — a proxy, a gateway, or a load balancer. Check the URL and what is in front of it.\"\n }, { status: response.status, ...context });\n}\n\n// src/stream.ts\nimport { EVENT_TYPES, parseSSE } from \"@dispach/core/wire\";\nvar REAL_EVENTS = new Set(EVENT_TYPES);\nasync function* frames(body) {\n for await (const frame of parseSSE(streamToIterable(body))) {\n if (frame.event === undefined || frame.data === \"\")\n continue;\n let data;\n try {\n data = JSON.parse(frame.data);\n } catch {\n continue;\n }\n yield { name: frame.event, data };\n }\n}\nasync function* streamToIterable(stream) {\n const reader = stream.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done)\n return;\n if (value !== undefined)\n yield value;\n }\n } finally {\n reader.releaseLock();\n }\n}\nasync function* turnStreamItems(body) {\n for await (const { name, data } of frames(body)) {\n if (REAL_EVENTS.has(name)) {\n yield { kind: \"event\", event: data };\n continue;\n }\n const record = data ?? {};\n switch (name) {\n case \"turn.accepted\":\n yield {\n kind: \"accepted\",\n turnId: String(record.turnId ?? \"\"),\n sessionKey: String(record.sessionKey ?? \"\")\n };\n break;\n case \"stream.replay\":\n yield {\n kind: \"replay\",\n report: {\n state: record.state === \"ended\" ? \"ended\" : \"running\",\n events: Number(record.events ?? 0),\n truncated: record.truncated === true,\n dropped: Number(record.dropped ?? 0),\n chunks: record.chunks === \"start\" || record.chunks === \"partial\" ? record.chunks : \"none\"\n }\n };\n break;\n case \"stream.ended\":\n yield {\n kind: \"ended\",\n turnId: String(record.turnId ?? \"\"),\n status: String(record.status ?? \"unknown\"),\n steps: typeof record.steps === \"number\" ? record.steps : undefined,\n errorCode: typeof record.errorCode === \"string\" ? record.errorCode : undefined\n };\n break;\n case \"stream.unavailable\":\n yield {\n kind: \"unavailable\",\n turnId: String(record.turnId ?? \"\"),\n reason: String(record.reason ?? \"not observable from this process\")\n };\n break;\n default:\n break;\n }\n }\n}\nasync function* eventStreamItems(body) {\n for await (const { name, data } of frames(body)) {\n if (REAL_EVENTS.has(name)) {\n yield { kind: \"event\", event: data };\n continue;\n }\n if (name === \"stream.subscribed\") {\n const record = data ?? {};\n yield {\n kind: \"subscribed\",\n report: {\n agentId: typeof record.agentId === \"string\" ? record.agentId : null,\n types: Array.isArray(record.types) ? record.types : null,\n chunks: record.chunks === true,\n implied: typeof record.implied === \"string\" ? record.implied : undefined\n }\n };\n }\n }\n}\nasync function* textDeltas(items, options = {}) {\n for await (const item of items) {\n if (item.kind === \"replay\" && item.report.truncated && options.allowTruncated !== true) {\n throw new DispachError({\n code: \"replay_truncated\",\n message: `This turn's replay is missing its oldest ${item.report.dropped} event(s), so the text reconstructed from it would be incomplete.`,\n hint: \"Read the finished text from GET /v1/agents/:id/turns/:turnId, or pass { allowTruncated: true } to accept a fragment. Streaming from the start of a turn is never truncated — this only happens when reattaching to one that has already produced more events than the buffer holds.\"\n });\n }\n if (item.kind === \"unavailable\") {\n throw new DispachError({\n code: \"turn_not_observable\",\n message: `Turn ${item.turnId} is recorded as running but is not observable here: ${item.reason}.`,\n hint: \"Its events are buffered in whichever process is executing it. Poll GET /v1/agents/:id/turns/:turnId for the outcome.\"\n });\n }\n if (item.kind !== \"event\")\n continue;\n if (item.event.type !== \"model.chunk\")\n continue;\n const data = item.event.data;\n if (data.kind === \"reasoning\")\n continue;\n if (typeof data.delta === \"string\")\n yield data.delta;\n }\n}\n\n// src/index.ts\nfunction isEvent(event, type) {\n return event.type === type;\n}\nfunction createClient(options) {\n let end = options.baseUrl.length;\n while (end > 0 && options.baseUrl[end - 1] === \"/\")\n end -= 1;\n const base = options.baseUrl.slice(0, end);\n const doFetch = options.fetch ?? fetch;\n const headers = (extra = {}) => ({\n ...options.token === undefined ? {} : { authorization: `Bearer ${options.token}` },\n ...extra\n });\n async function request(method, path, init = {}) {\n let response;\n try {\n response = await doFetch(`${base}${path}`, {\n method,\n headers: headers({\n ...init.body === undefined ? {} : { \"content-type\": \"application/json\" },\n ...init.accept === undefined ? {} : { accept: init.accept },\n ...init.headers\n }),\n ...init.body === undefined ? {} : { body: JSON.stringify(init.body) },\n ...init.signal === undefined ? {} : { signal: init.signal }\n });\n } catch (error) {\n throw transportError(error, { method, path, baseUrl: base });\n }\n if (!response.ok)\n throw await errorFromResponse(response, { method, path });\n return response;\n }\n async function json(method, path, init) {\n return await (await request(method, path, init ?? {})).json();\n }\n async function streamBody(path, signal) {\n const response = await request(\"GET\", path, {\n accept: \"text/event-stream\",\n ...signal === undefined ? {} : { signal }\n });\n if (response.body === null) {\n throw new DispachError({\n code: \"no_response_body\",\n message: `GET ${path} returned ${response.status} with no body to read.`,\n hint: \"An SSE route always has a body. A missing one means something between you and the server buffered the response — commonly a proxy without streaming enabled.\"\n }, { status: response.status, method: \"GET\", path });\n }\n return response.body;\n }\n function turnHandle(agentId, turnId, sessionKey, facts = {}) {\n const query = (opts) => {\n const params = new URLSearchParams;\n if (opts?.chunks === true)\n params.set(\"chunks\", \"true\");\n if (opts?.children === true)\n params.set(\"children\", \"true\");\n const text = params.toString();\n return text === \"\" ? \"\" : `?${text}`;\n };\n const handle = {\n turnId,\n sessionKey,\n replayed: facts.replayed === true,\n async* stream(opts) {\n const body = await streamBody(`/v1/agents/${encodeURIComponent(agentId)}/turns/${encodeURIComponent(turnId)}/stream${query(opts)}`, opts?.signal);\n yield* turnStreamItems(body);\n },\n async* tokens(opts) {\n yield* textDeltas(handle.stream({ chunks: true, ...opts, children: false }), {\n ...opts?.allowTruncated === undefined ? {} : { allowTruncated: opts.allowTruncated }\n });\n },\n async text() {\n for await (const item of handle.stream()) {\n if (item.kind === \"ended\")\n break;\n if (item.kind === \"unavailable\")\n break;\n if (item.kind === \"event\" && item.event.type === \"turn.end\")\n break;\n }\n return (await handle.get()).text;\n },\n get: () => json(\"GET\", `/v1/agents/${encodeURIComponent(agentId)}/turns/${encodeURIComponent(turnId)}`),\n async stop() {\n await request(\"POST\", `/v1/agents/${encodeURIComponent(agentId)}/turns/${encodeURIComponent(turnId)}/stop`);\n }\n };\n return handle;\n }\n function agent(id) {\n const at = (suffix) => `/v1/agents/${encodeURIComponent(id)}${suffix}`;\n return {\n id,\n async send(text, opts) {\n const accepted = await json(\"POST\", at(\"/messages\"), {\n body: {\n text,\n ...opts?.sessionKey === undefined ? {} : { sessionKey: opts.sessionKey },\n ...opts?.deliver === undefined ? {} : { deliver: opts.deliver },\n ...opts?.from === undefined ? {} : { from: opts.from },\n ...opts?.images === undefined ? {} : { images: opts.images },\n ...opts?.runtimeNote === undefined ? {} : { runtimeNote: opts.runtimeNote },\n ...opts?.chunks === true ? { chunks: true } : {},\n ...opts?.role === undefined ? {} : { role: opts.role }\n },\n ...opts?.idempotencyKey === undefined ? {} : { headers: { \"idempotency-key\": opts.idempotencyKey } },\n ...opts?.signal === undefined ? {} : { signal: opts.signal }\n });\n return turnHandle(id, accepted.turnId, accepted.sessionKey, {\n replayed: accepted.replayed === true\n });\n },\n turn: (turnId) => turnHandle(id, turnId, \"\"),\n describe: () => json(\"GET\", at(\"\")),\n tools: () => json(\"GET\", at(\"/tools\")),\n skills: () => json(\"GET\", at(\"/skills\")),\n sessions: () => json(\"GET\", at(\"/sessions\")),\n messages: (sessionKey, options) => {\n const query = new URLSearchParams;\n if (options?.before !== undefined)\n query.set(\"before\", String(options.before));\n if (options?.limit !== undefined)\n query.set(\"limit\", String(options.limit));\n const suffix = query.size === 0 ? \"\" : `?${query.toString()}`;\n return json(\"GET\", at(`/sessions/${encodeURIComponent(sessionKey)}/messages${suffix}`));\n },\n clearSession: (sessionKey) => json(\"DELETE\", at(`/sessions/${encodeURIComponent(sessionKey)}`)),\n reload: () => json(\"POST\", at(\"/reload\"), {\n body: {}\n }),\n usage: (options) => json(\"GET\", at(`/usage${usageQuery(options)}`)),\n turns: (options) => {\n const params = new URLSearchParams;\n if (options?.limit !== undefined)\n params.set(\"limit\", String(options.limit));\n if (options?.before !== undefined)\n params.set(\"before\", String(options.before));\n const suffix = params.size === 0 ? \"\" : `?${params.toString()}`;\n return json(\"GET\", at(`/turns${suffix}`));\n },\n secrets: async () => (await json(\"GET\", at(\"/secrets\"))).secrets,\n setSecrets: (values) => json(\"PUT\", at(\"/secrets\"), { body: { values } }),\n schedules: async () => (await json(\"GET\", at(\"/schedules\"))).schedules,\n approvals: async () => (await json(\"GET\", at(\"/approvals\"))).approvals,\n createSchedule: (schedule) => json(\"POST\", at(\"/schedules\"), { body: schedule }),\n updateSchedule: (scheduleId, patch) => json(\"PATCH\", at(`/schedules/${encodeURIComponent(scheduleId)}`), {\n body: patch\n }),\n deleteSchedule: async (scheduleId) => {\n await json(\"DELETE\", at(`/schedules/${encodeURIComponent(scheduleId)}`));\n },\n runSchedule: (scheduleId) => json(\"POST\", at(`/schedules/${encodeURIComponent(scheduleId)}/run`), { body: {} }),\n config: () => json(\"GET\", at(\"/config\")),\n setConfig: (path, value, options) => json(\"PATCH\", at(\"/config\"), {\n body: {\n path,\n value,\n ...options?.confirm === undefined ? {} : { confirm: options.confirm }\n }\n }),\n removeConfig: (path, options) => json(\"PATCH\", at(\"/config\"), {\n body: {\n path,\n remove: true,\n ...options?.confirm === undefined ? {} : { confirm: options.confirm }\n }\n }),\n setConfigs: (changes) => json(\"PATCH\", at(\"/config\"), {\n body: { changes: changes.map((change) => ({ ...change })) }\n }),\n setChannel: (channelId, changes) => json(\"PATCH\", at(`/channels/${encodeURIComponent(channelId)}`), { body: { ...changes } }),\n unpairChannel: (channelId) => json(\"POST\", at(`/channels/${encodeURIComponent(channelId)}/unpair`)),\n session: (sessionKey) => json(\"GET\", at(`/sessions/${encodeURIComponent(sessionKey)}`)),\n setPhase: (sessionKey, phase) => json(\"POST\", at(`/sessions/${encodeURIComponent(sessionKey)}/phase`), { body: { phase } }),\n setRecall: (sessionKey, recall) => json(\"POST\", at(`/sessions/${encodeURIComponent(sessionKey)}/recall`), { body: { recall } }),\n approve: async (approvalId, granted) => {\n await json(\"POST\", at(`/approvals/${encodeURIComponent(approvalId)}`), {\n body: { granted }\n });\n },\n stop: (reason) => json(\"POST\", at(\"/stop\"), {\n body: reason === undefined ? {} : { reason }\n }),\n start: () => json(\"POST\", at(\"/start\"), { body: {} }),\n assign: (participantId) => json(\"PUT\", at(\"/assignee\"), { body: { participantId } }),\n unassign: () => json(\"DELETE\", at(\"/assignee\")),\n exportBundle: (paths) => json(\"GET\", at(`/export${paths === undefined ? \"\" : `?paths=${encodeURIComponent(paths.join(\",\"))}`}`)),\n importBundle: (bundle, mode) => json(\"POST\", at(\"/import\"), {\n body: { bundle, ...mode === undefined ? {} : { mode } }\n }),\n context: (opts) => {\n const params = new URLSearchParams;\n if (opts?.sessionKey !== undefined)\n params.set(\"sessionKey\", opts.sessionKey);\n if (opts?.input !== undefined)\n params.set(\"input\", opts.input);\n const query = params.size === 0 ? \"\" : `?${params.toString()}`;\n return json(\"GET\", at(`/context${query}`));\n }\n };\n }\n return {\n agent,\n agents: () => json(\"GET\", \"/v1/agents\"),\n health: () => json(\"GET\", \"/v1/health\"),\n async ready() {\n try {\n await request(\"GET\", \"/v1/ready\");\n return true;\n } catch (error) {\n if (error instanceof DispachError && error.status === 503)\n return false;\n throw error;\n }\n },\n provision: () => json(\"GET\", \"/v1/provision\"),\n keys: () => json(\"GET\", \"/v1/keys\"),\n createKey: (input) => json(\"POST\", \"/v1/keys\", { body: input }),\n revokeKey: (keyId) => json(\"DELETE\", `/v1/keys/${encodeURIComponent(keyId)}`),\n createAgent: (answers) => json(\"POST\", \"/v1/agents\", { body: { answers } }),\n usage: (options) => json(\"GET\", `/v1/usage${usageQuery(options)}`),\n activity: () => json(\"GET\", \"/v1/activity\"),\n participants: async () => (await json(\"GET\", \"/v1/participants\")).participants,\n registerParticipant: (input) => json(\"POST\", \"/v1/participants\", { body: input }),\n conversations: async () => (await json(\"GET\", \"/v1/conversations\")).conversations,\n createConversation: (input) => json(\"POST\", \"/v1/conversations\", { body: input }),\n conversation: (conversationId) => json(\"GET\", `/v1/conversations/${encodeURIComponent(conversationId)}`),\n setMembers: (conversationId, change) => json(\"PATCH\", `/v1/conversations/${encodeURIComponent(conversationId)}/members`, { body: change }),\n postMessage: (conversationId, message) => json(\"POST\", `/v1/conversations/${encodeURIComponent(conversationId)}/messages`, { body: message }),\n conversationMessages: (conversationId, options = {}) => {\n const query = new URLSearchParams;\n if (options.after !== undefined)\n query.set(\"after\", String(options.after));\n if (options.limit !== undefined)\n query.set(\"limit\", String(options.limit));\n const suffix = query.size === 0 ? \"\" : `?${query}`;\n return json(\"GET\", `/v1/conversations/${encodeURIComponent(conversationId)}/messages${suffix}`);\n },\n setPresence: (participantId, presence) => json(\"PUT\", `/v1/participants/${encodeURIComponent(participantId)}/presence`, { body: { presence } }),\n actions: async (options = {}) => (await json(\"GET\", `/v1/actions${options.status === undefined ? \"\" : `?status=${options.status}`}`)).actions,\n decideAction: (actionId, approve) => json(\"POST\", `/v1/actions/${encodeURIComponent(actionId)}`, {\n body: { approve }\n }),\n addNote: (input) => json(\"POST\", \"/v1/memory/notes\", { body: input }),\n notes: async (scope) => (await json(\"GET\", `/v1/memory/notes?scope=${encodeURIComponent(scope)}`)).notes,\n deleteNote: (noteId) => json(\"DELETE\", `/v1/memory/notes/${encodeURIComponent(noteId)}`),\n memoryReads: async (participantId) => (await json(\"GET\", `/v1/participants/${encodeURIComponent(participantId)}/memory/reads`)).reads,\n projects: async () => (await json(\"GET\", \"/v1/projects\")).projects,\n putProject: (projectId, input) => json(\"PUT\", `/v1/projects/${encodeURIComponent(projectId)}`, {\n body: input\n }),\n deleteProject: (projectId) => json(\"DELETE\", `/v1/projects/${encodeURIComponent(projectId)}`),\n setSpaceWriter: (writer) => json(\"PUT\", \"/v1/memory/space/writer\", { body: { writer } }),\n webhooks: async () => (await json(\"GET\", \"/v1/webhooks\")).webhooks,\n createWebhook: (input) => json(\"POST\", \"/v1/webhooks\", { body: input }),\n deleteWebhook: (subscriptionId) => json(\"DELETE\", `/v1/webhooks/${encodeURIComponent(subscriptionId)}`),\n templates: async () => (await json(\"GET\", \"/v1/templates\")).templates,\n createAgentFromTemplate: (input) => json(\"POST\", \"/v1/agents\", { body: input }),\n async* events(opts) {\n const params = new URLSearchParams;\n if (opts?.agentId !== undefined)\n params.set(\"agentId\", opts.agentId);\n if (opts?.types !== undefined && opts.types.length > 0) {\n params.set(\"types\", opts.types.join(\",\"));\n }\n if (opts?.chunks === true)\n params.set(\"chunks\", \"true\");\n const query = params.size === 0 ? \"\" : `?${params.toString()}`;\n const body = await streamBody(`/v1/events${query}`, opts?.signal);\n yield* eventStreamItems(body);\n }\n };\n}\nfunction usageQuery(options) {\n const params = new URLSearchParams;\n if (options?.by !== undefined)\n params.set(\"by\", options.by.join(\",\"));\n if (options?.from !== undefined)\n params.set(\"from\", options.from);\n if (options?.to !== undefined)\n params.set(\"to\", options.to);\n return params.size === 0 ? \"\" : `?${params.toString()}`;\n}\nexport {\n DispachError,\n createClient,\n isEvent\n};\n\n//# debugId=FD9B161A8EAC7F2B64756E2164756E21\n//# sourceMappingURL=index.js.map\n",
29
29
  "/**\n * The conversation a resumed session paints, out of the messages the store kept.\n *\n * Pure, and extracted from `run` for one reason: it was four chained lambdas inside a function that\n * needs a live runtime to call, so the only way to check it was to resume a real session and look. The\n * shape it decides has already been wrong twice — first painting nothing at all under a banner that\n * said `17 message(s)`, then painting every turn except the ones that called a tool — and both times\n * the layers around it were individually correct.\n *\n * What counts as part of the conversation:\n *\n * - No `origin` — a person's message, or a reply the model wrote as its final answer.\n * - `origin: \"call\"` — a tool-calling step. Its prose is narration the live session *did* show as it\n * streamed, so excluding the row made a resumed transcript differ from the one that had been on\n * screen. Under NLT the row also holds the ACTION block, which `proseOf` removes.\n *\n * What does not, and why each is deliberate rather than unhandled:\n *\n * - `origin: \"observation\"` — text a stranger wrote. It reaches the model inside a fence; painting it\n * as part of the conversation would present it as something the agent or the person said.\n * - `origin: \"repair\"` and `origin: \"digest\"` — the runtime talking to itself about a malformed call\n * or a compacted history. True of the prompt, not of anything anybody said.\n * - `role: \"system\"` and `role: \"tool\"` — the assembled prefix and native tool results, neither of\n * which was ever on screen.\n */\n\nimport type { ChatMessage, DialectId } from \"@dispach/core\"\nimport { BRAND, proseOf } from \"@dispach/core\"\nimport { DIM_STYLE, RESET_STYLE } from \"#lib/const\"\nimport type { PriorMessage } from \"#transcript\"\n\n/**\n * `history` in order, reduced to what a reader saw. Empty prose is dropped, not painted blank.\n *\n * A step that called a tool without narrating it produces no text at all, and a blank message row in a\n * resumed transcript reads as content that failed to load.\n */\nexport function priorMessages(\n history: readonly ChatMessage[],\n dialect: DialectId,\n): readonly PriorMessage[] {\n const shown: PriorMessage[] = []\n for (const message of history) {\n if (message.origin !== undefined && message.origin !== \"call\") continue\n if (message.role !== \"user\" && message.role !== \"assistant\") continue\n const text = proseOf(message, dialect)\n if (text === \"\") continue\n shown.push({ role: message.role, text })\n }\n return shown\n}\n\n/**\n * The note a clean exit leaves on the shell's own screen.\n *\n * Nothing else survives. That was the decision and the alternate screen enforces it whether we agree or\n * not — so the one thing worth printing is not the conversation, which is in the store, but the command\n * that reaches it again.\n *\n * Two lines and faint, which is a change from the one bright line this used to be. The old form led with\n * `session <key> ·` and buried the command behind `resume with:`, so the half a person needs to *copy*\n * sat at the end of a sentence they had to read first. The key is not lost by dropping the prefix — it is\n * inside the command, which is the only place it is any use. And faint because this is the epilogue: the\n * work is over, and a line as loud as the output above it reads as one more result.\n *\n * The agent is named by the ref `resolveAgentRef` accepts rather than by a path, because a line you\n * cannot paste is a line that reads as help and is not.\n */\nexport function resumeNotice(input: {\n readonly ref: string | undefined\n readonly sessionKey: string\n}): string {\n // Named rather than omitted when the id is missing: a command with a placeholder in it says what is\n // wanted where it is wanted, and a command silently missing its agent looks complete and is not.\n const ref = input.ref ?? \"<your agent>\"\n const command = `${BRAND.slug} run ${ref} --session ${input.sessionKey}`\n // The blank line above separates it from whatever the shell had on screen before the session took it.\n // The reset precedes the last newline so the prompt after it is not faint.\n return `\\n${DIM_STYLE}Resume this session with:\\n${command}${RESET_STYLE}\\n`\n}\n\n/**\n * Why a banner is being printed, as the one sentence a person reads.\n *\n * Four answers, and they are genuinely different things to say: a `/restart` is about *configuration*\n * and would be a lie about a switch; a `/new` opened a conversation that did not exist a moment ago,\n * and the only thing worth saying about it is what happened to the one being left.\n *\n * Extracted from `bannerLines` because that function needs a live agent and a store to call, so the\n * sentence selection — the only part a person actually reads — could not be checked without resuming a\n * real session and looking. Exactly the reason `priorMessages` above lives here.\n *\n * The return is `undefined` for a first run: nothing has happened yet that needs explaining.\n */\nexport function reopenNote(\n reopened: \"first\" | \"restart\" | \"switch\" | \"new\",\n previousKey?: string,\n): string | undefined {\n switch (reopened) {\n case \"first\":\n return undefined\n case \"restart\":\n return \"restarted — the configuration on disk is now the one in force; the conversation continues from the store.\"\n case \"switch\":\n // What was left behind is worth naming: the previous conversation is still in the store, and\n // the key in the banner above is the one that reaches this one again.\n return \"switched conversation — the one you left is still in the store, under its own key.\"\n case \"new\":\n // By name, unlike the switch sentence. After a `/new` the conversation you left is on screen\n // nowhere — the picker lists it, but only once you know to go looking — and the whole promise\n // of the command is that nothing was destroyed. Claiming that without naming the key is\n // asking to be taken on trust.\n return previousKey === undefined\n ? \"new conversation — the one you left is still in the store, under its own key.\"\n : `new conversation — the one you left is ${previousKey}, still in the store. /sessions goes back to it.`\n }\n}\n",
30
30
  "/**\n * What a chat view needs from an agent, and the two ways of supplying it.\n *\n * ## Why this exists\n *\n * `run` built a `Runtime` in its own process and handed the resulting `Agent` and `EventBus`\n * straight to the screen. That was right while the CLI *was* the product; it stopped being right\n * the moment a server is always on, because `run` then starts a **second** runtime for an agent\n * something else is already hosting. Two processes on one SQLite file is not two views of one\n * conversation — it is two writers, and slot 2 told the model as much (`declined`, decision 5.17),\n * which is the runtime being honest about a situation nobody wanted.\n *\n * So the screen takes an `AgentSource` instead. `embeddedSource` is today's behaviour, for the\n * cases where nothing else is hosting: a container, CI, `--ephemeral`, a machine whose bootstrap\n * was suppressed. `remoteSource` is the same shape over `/v1`, and is what a terminal gets when a\n * live host holds the agent.\n *\n * ## Why the two implementations are small\n *\n * Because the *views* were already projections. `toolsView` takes a structural `AgentToolsSource`\n * rather than an `Agent`, `ContextView` and `SessionRowSource` are plain data, and `endNote` lives\n * in core precisely so four callers cannot word a turn's ending four ways. Almost nothing here\n * formats anything; it fetches, and hands back the shapes the formatters already read.\n *\n * ## The one thing that is genuinely different\n *\n * **Cancellation.** Embedded, a turn is an in-process promise and an `AbortController` reaches it.\n * Attached, the turn belongs to the server — the recorded rule is that turns are detached from the\n * client connection and are never cancelled on disconnect — so stopping one is a *request*, naming\n * the turn. `send` takes a signal on both paths and each honours it its own way, so the caller\n * keeps one contract and `useTurn` never learns which it is talking to.\n */\n\nimport type { AnyEvent, ErrorDetail, StreamFilter, TurnEndReason } from \"@dispach/core\"\nimport { createNltStreamFilter, passThroughFilter } from \"@dispach/core/wire\"\nimport { priorMessages } from \"#lib/resume\"\nimport { type ContextView, type ToolsView, toolsView } from \"#lib/session-commands\"\nimport type { PriorMessage } from \"#transcript\"\n\n/** The facts a banner, a status line and a reasoning decision are made from. */\nexport interface SourceDescription {\n readonly agentId: string\n readonly name: string\n readonly model: string\n readonly dialect: string\n readonly window: number\n /** What the catalogue costs per turn — the figure `/tools` reports and a person trims against. */\n readonly catalogueTokens: number\n /** `\"none\"` when the model does not reason, which is what decides streaming it by default. */\n readonly thinking: string\n readonly warnings: readonly ErrorDetail[]\n}\n\n/** One conversation, as the session picker reads it. */\nexport interface SourceSession {\n readonly sessionKey: string\n readonly channel: string\n readonly turns: number\n readonly messages: number\n readonly lastActivityAt: string\n readonly phase?: string\n}\n\nexport interface SendOptions {\n readonly sessionKey: string\n readonly signal: AbortSignal\n}\n\n/**\n * How a turn ended, in the shape both renderers already read.\n *\n * `send` resolves with this rather than `void` because the plain path needs it: `endNote` takes a\n * reason and a step count, `endedBadly` decides the exit status, and the stats line is the one\n * thing a scripted run prints that is not the reply. Attached, every field comes off `turn.end`\n * and the `error` event rather than out of a returned object — which is the same information, and\n * is why this is a shape rather than core's `TurnResult`.\n */\nexport interface TurnOutcome {\n /** The reply. Empty on the streaming path, where it has already been written out. */\n readonly text: string\n readonly reason: TurnEndReason\n readonly steps: number\n readonly durationMs: number\n readonly tokens: { readonly prompt: number; readonly output: number }\n readonly error?: ErrorDetail\n}\n\nexport interface AgentSource {\n /**\n * Which of the two this is.\n *\n * Read by the banner and by `/status`, never to choose behaviour — a caller branching on this\n * is a caller that should have been given a method. The one legitimate use is telling somebody\n * what they are looking at, and that is exactly the sentence a person needs when the same\n * command does two things.\n */\n readonly kind: \"embedded\" | \"attached\"\n readonly agentId: string\n /** Where the agent actually runs, when it is somewhere else. */\n readonly host?: { readonly baseUrl: string; readonly pid: number }\n\n describe(): SourceDescription\n /**\n * Every event for this runtime, chunks included. Returns the unsubscribe.\n *\n * Chunks are not optional and never have been: this is the one wildcard subscriber in the tree\n * that genuinely wants per-token frames, which is why they are opt-in everywhere else. Dropping\n * the flag does not break anything loudly — the TUI simply stops streaming.\n */\n subscribe(handler: (event: AnyEvent) => void): () => void\n /** Resolves when the turn has ended, on both paths, so `busy` means the same thing. */\n send(text: string, options: SendOptions): Promise<TurnOutcome>\n /**\n * A fresh filter for the dialect in use.\n *\n * The wire carries **unfiltered** chunks — deliberately, since a stream nobody has filtered is\n * the one a debugger wants and the tool block is what the next model call sees. So an attached\n * view does the same work the embedded one does, from the dialect its description already\n * carries. Without it a chat bubble shows `ACTION: now / format: human / END`.\n */\n streamFilter(): StreamFilter\n history(sessionKey: string): Promise<readonly PriorMessage[]>\n sessions(): Promise<readonly SourceSession[]>\n clearSession(sessionKey: string): Promise<void>\n tools(): Promise<ToolsView>\n context(sessionKey: string): Promise<ContextView>\n /**\n * Ask the **host** to replace this agent. Present only when attached.\n *\n * Absent means the caller owns the runtime and rebuilds it itself, which is what `/restart` has\n * always done — the optional method is the capability, the same way `AppProps.catalogue` and\n * `status` are. Resolves with every agent that came back: replacing a supervisor replaces its\n * team, because they load from one manifest as one unit.\n */\n readonly reload?: () => Promise<readonly string[]>\n /** Release whatever this holds. Never stops the agent — an attached view owns nothing. */\n close(): Promise<void>\n}\n\n/** The parts of a live `Agent` this needs, structurally, so a test needs no runtime. */\nexport interface EmbeddedAgent {\n readonly id: string\n describe(): { readonly dialect: string; readonly catalogueTokens: number }\n readonly tools: {\n specs(): readonly {\n readonly slug: string\n readonly mutating: boolean\n readonly trust?: string\n readonly trustReason?: string\n readonly summary: string\n }[]\n }\n}\n\n/** The bus half, equally narrow. */\nexport interface EmbeddedBus {\n on(\n type: \"*\",\n handler: (event: AnyEvent) => void,\n options?: { readonly chunks?: boolean },\n ): () => void\n}\n\n/** `createNltStreamFilter` for `nlt`, a pass-through otherwise. One place decides it. */\nexport function filterFor(dialect: string): StreamFilter {\n return dialect === \"nlt\" ? createNltStreamFilter() : passThroughFilter()\n}\n\n/**\n * Today's behaviour, unchanged, behind the interface.\n *\n * Everything here is a one-liner over an object this process already holds, which is the point: the\n * embedded path must not get slower or subtler for the sake of the remote one, and a reader should\n * be able to see at a glance that nothing was smuggled in.\n */\nexport function embeddedSource(input: {\n readonly agent: EmbeddedAgent\n readonly bus: EmbeddedBus\n /** `agent.send`, narrowed — the loop's own signature, not re-declared here. */\n readonly send: (text: string, options: SendOptions & { source: \"repl\" }) => Promise<TurnOutcome>\n readonly history: (sessionKey: string) => Promise<readonly PriorMessage[]>\n readonly sessions: () => Promise<readonly SourceSession[]>\n readonly clearSession: (sessionKey: string) => Promise<void>\n readonly context: (sessionKey: string) => Promise<ContextView>\n readonly streamFilter: () => StreamFilter\n readonly description: SourceDescription\n}): AgentSource {\n return {\n kind: \"embedded\",\n agentId: input.agent.id,\n describe: () => input.description,\n // `{ chunks: true }` is not a tuning knob. Every other wildcard subscriber — `/v1/events`,\n // the WebSocket bridge, every plugin watcher — must stay off the per-token path, so the\n // flag is opt-in and this is the one caller that opts in.\n subscribe: (handler) => input.bus.on(\"*\", handler, { chunks: true }),\n send: (text, options) => input.send(text, { ...options, source: \"repl\" }),\n streamFilter: input.streamFilter,\n history: input.history,\n sessions: input.sessions,\n clearSession: input.clearSession,\n // Built from the live registry rather than fetched, and `toolsView` takes the structural\n // source rather than an `Agent`, which is why this is a projection and not a copy.\n tools: async () => toolsView(input.agent),\n context: input.context,\n // No `reload`: the caller owns the runtime and rebuilds it. `/restart` has always worked\n // that way, and an optional method is how this interface spells a capability.\n close: async () => {},\n }\n}\n\n/**\n * The same shape over `/v1`, for an agent something else is already hosting.\n *\n * Three things here are not translations of the embedded path, and each is a decision.\n *\n * **One subscription, not two.** The events come from `GET /v1/events` and the turn is followed on\n * that same stream. Using a turn's own `/stream` as well would deliver every chunk twice, because\n * the firehose already carries them — so `send` resolves by watching for its own `turn.end` rather\n * than by draining a second stream.\n *\n * **Cancellation is a request.** Turns are detached from the client connection by design and are\n * never cancelled on disconnect, so an abort here POSTs a stop naming the turn. It is best-effort\n * in one specific way worth knowing: the turn id only exists once the send has been accepted, so an\n * abort in the window before that is remembered and applied when the id arrives, rather than lost.\n *\n * **Filtering is ours.** The wire carries unfiltered chunks — deliberately, per the wire entry's\n * own docstring — so this rebuilds the dialect's filter from the description it already fetched.\n * Without it a reply renders as `ACTION: now / format: human / END`.\n */\n/**\n * The parts of the API client this needs, structurally.\n *\n * Narrow for the same two reasons `EmbeddedAgent` is — a fake is a plain object, and anything else\n * reached for is a type error rather than a surprise — and for a third: naming the client's own\n * exported type would put the product name in a `packages/cli` source file, which hard rule 3 and\n * a boundaries test both forbid. The real client satisfies this without being named.\n */\nexport interface ApiClient {\n agent(id: string): {\n send(\n text: string,\n options?: { readonly sessionKey?: string },\n ): Promise<{ readonly turnId: string }>\n turn(turnId: string): { stop(): Promise<void> }\n messages(sessionKey: string): Promise<{\n readonly messages: readonly {\n readonly role: string\n readonly content: string\n readonly origin?: string\n }[]\n }>\n clearSession(sessionKey: string): Promise<unknown>\n reload(): Promise<{ readonly adopted: readonly string[] }>\n tools(): Promise<\n readonly {\n readonly slug: string\n readonly summary: string\n readonly mutating: boolean\n readonly trust: string\n readonly trustReason?: string\n }[]\n >\n sessions(): Promise<readonly SourceSession[]>\n context(options: { readonly sessionKey: string }): Promise<unknown>\n }\n events(options: {\n readonly agentId?: string\n readonly chunks?: boolean\n readonly signal?: AbortSignal\n }): AsyncGenerator<{ readonly kind: string; readonly event?: AnyEvent }>\n}\n\nexport function remoteSource(input: {\n readonly client: ApiClient\n readonly agentId: string\n /** Fetched once at attach, so `describe()` can stay synchronous like the embedded one. */\n readonly description: SourceDescription\n readonly host: { readonly baseUrl: string; readonly pid: number }\n}): AgentSource {\n const agent = input.client.agent(input.agentId)\n /** Fans one SSE stream out to every subscriber, so attaching twice opens one connection. */\n const handlers = new Set<(event: AnyEvent) => void>()\n const abort = new AbortController()\n let pump: Promise<void> | undefined\n\n const start = (): void => {\n if (pump !== undefined) return\n pump = (async () => {\n for await (const item of input.client.events({\n agentId: input.agentId,\n // The one wildcard in the tree that genuinely wants tokens — see `AgentSource`.\n chunks: true,\n signal: abort.signal,\n })) {\n if (item.kind !== \"event\" || item.event === undefined) continue\n for (const handler of handlers) handler(item.event)\n }\n })().catch(() => {\n // A dropped stream is reported through the transcript by the turn that notices it, not\n // by throwing into a `for await` nobody is awaiting. Swallowing it here would be the\n // silent failure hard rule 8 forbids if this were the only signal — it is not: a send\n // whose `turn.end` never arrives rejects, which is where a person is actually looking.\n })\n }\n\n return {\n kind: \"attached\",\n agentId: input.agentId,\n host: input.host,\n describe: () => input.description,\n subscribe: (handler) => {\n handlers.add(handler)\n start()\n return () => handlers.delete(handler)\n },\n send: async (text, options) => {\n let stopped = false\n let turnId: string | undefined\n const onAbort = (): void => {\n stopped = true\n // Fire-and-forget: the abort is the caller saying stop, and a failed stop request\n // must not reject the send — the turn's own end is what resolves this.\n if (turnId !== undefined)\n void agent\n .turn(turnId)\n .stop()\n .catch(() => {})\n }\n options.signal.addEventListener(\"abort\", onAbort, { once: true })\n\n /**\n * The outcome, assembled from the stream rather than returned by the send.\n *\n * `POST /messages` answers 202 the moment the turn is accepted — turns are detached\n * from the client connection by design — so everything the plain path prints comes off\n * `turn.end`, and the failure detail off the `error` event that precedes it. Collected\n * here rather than by the caller because both renderers would otherwise assemble it,\n * and two assemblies of one fact is how they come to disagree.\n */\n let failure: ErrorDetail | undefined\n const ended = new Promise<TurnOutcome>((resolve) => {\n const off = (event: AnyEvent): void => {\n if (\n turnId !== undefined &&\n event.turnId !== undefined &&\n event.turnId !== turnId\n )\n return\n if (event.type === \"error\") {\n failure = event.data\n return\n }\n if (event.type !== \"turn.end\") return\n handlers.delete(off)\n resolve({\n // Empty on purpose: the chunks have already been written by whoever is\n // subscribed, and handing back a second copy would print the reply twice.\n text: \"\",\n reason: event.data.reason,\n steps: event.data.steps,\n durationMs: event.data.durationMs,\n tokens: event.data.tokens,\n ...(failure === undefined ? {} : { error: failure }),\n })\n }\n handlers.add(off)\n start()\n })\n\n try {\n const handle = await agent.send(text, { sessionKey: options.sessionKey })\n turnId = handle.turnId\n // Aborted while the request was in flight. The listener above had no id to name, so\n // it is applied here instead of being dropped — the window is small and a stop that\n // silently did nothing is the worst available outcome for a cancel key.\n if (stopped)\n void agent\n .turn(turnId)\n .stop()\n .catch(() => {})\n return await ended\n } finally {\n options.signal.removeEventListener(\"abort\", onAbort)\n }\n },\n streamFilter: () => filterFor(input.description.dialect),\n history: async (sessionKey) => {\n const page = await agent.messages(sessionKey)\n // Oldest-first for the screen; the API pages newest-first because that is how a UI\n // scrolls back. `priorMessages` decides what is shown — one rule, in `lib/resume.ts`,\n // because which origins count has been got wrong twice.\n return priorMessages(\n [...page.messages].reverse().map((message) => ({\n role: message.role as \"user\" | \"assistant\",\n content: message.content,\n ...(message.origin === undefined ? {} : { origin: message.origin }),\n })) as Parameters<typeof priorMessages>[0],\n input.description.dialect as Parameters<typeof priorMessages>[1],\n )\n },\n sessions: () => agent.sessions(),\n clearSession: async (sessionKey) => {\n await agent.clearSession(sessionKey)\n },\n tools: async () => {\n const tools = await agent.tools()\n return {\n dialect: input.description.dialect,\n catalogueTokens: input.description.catalogueTokens,\n tools: tools.map((tool) => ({\n slug: tool.slug,\n mutating: tool.mutating,\n trust: tool.trust,\n ...(tool.trustReason === undefined ? {} : { trustReason: tool.trustReason }),\n summary: tool.summary,\n })),\n }\n },\n context: async (sessionKey) => {\n // The route calls `previewContext` with the same arguments `send` does, so this is the\n // same object the embedded path builds — only `windowSource` is ours, because a\n // description carries the window and not where it came from.\n const preview = (await agent.context({ sessionKey })) as Omit<\n ContextView,\n \"windowSource\"\n > & {\n readonly compactions?: number\n }\n return {\n ...preview,\n windowSource: \"as the host resolved it\",\n ...(preview.lastCompaction === undefined && preview.compactions !== undefined\n ? {\n lastCompaction:\n preview.compactions === 0\n ? undefined\n : `${preview.compactions} stage${preview.compactions === 1 ? \"\" : \"s\"} run this session`,\n }\n : {}),\n }\n },\n reload: async () => (await agent.reload()).adopted,\n close: async () => {\n abort.abort()\n handlers.clear()\n },\n }\n}\n\n/**\n * Whether something else is already hosting this agent, and where.\n *\n * Both halves matter and neither is guessable. A lease says **who** is serving an agent right now;\n * its `base_url` — published after the bind, cleared on takeover — says where, because a manifest's\n * `server.port` is only what the file asked for and `--port 0` means the port does not exist until\n * the socket does. A host serving no HTTP has a lease and no address, and cannot be attached to.\n *\n * `processAlive` is checked inside `liveHostOf` for the recorded reason: a lease row is a claim,\n * not a fact, and a boot that failed *after* claiming leaves a fresh heartbeat with no process\n * under it. A dead pid outranks a recent timestamp.\n */\nexport interface LiveHost {\n readonly baseUrl: string\n readonly pid: number\n}\n\nexport function hostFrom(\n lease: { readonly pid: number; readonly baseUrl?: string } | undefined,\n): LiveHost | undefined {\n if (lease?.baseUrl === undefined || lease.baseUrl === \"\") return undefined\n return { baseUrl: lease.baseUrl, pid: lease.pid }\n}\n",
@@ -43,7 +43,7 @@
43
43
  "/**\n * The `workspace <manifest>` command — the authoring rules, checked.\n *\n * Deliberately a separate command from `validate`. That one answers \"does this load?\", which is a\n * question with a yes or a no; this one answers \"is this written well?\", which is a judgement. They\n * report differently because they are different: a budget bust stops the runtime, and a rule with no\n * stated reason is a note from a careful reader.\n *\n * So every finding here is a warning and the command exits 0 by default. `--strict` is for CI, where\n * \"warnings you have decided to live with\" and \"warnings nobody has read\" look identical and only a\n * non-zero exit tells them apart.\n */\n\nimport {\n checkAuthoring,\n type ErrorDetail,\n isHarnessError,\n loadManifest,\n resolveCapabilities,\n resolveWorkspace,\n ruleBudgetFailure,\n} from \"@dispach/core\"\nimport { ambientEnv } from \"#lib/ambient\"\nimport { EXIT_FAILURE, EXIT_OK } from \"#lib/const\"\n\nexport interface WorkspaceOptions {\n readonly manifestPath: string\n readonly json?: boolean\n readonly strict?: boolean\n}\n\nexport function workspaceCommand(options: WorkspaceOptions): number {\n try {\n const loaded = loadManifest(options.manifestPath, {\n // The same environment `run` will use, or this validates a different agent — the\n // failure that rule exists for is a validator that disagrees with the runtime.\n env: ambientEnv([options.manifestPath]),\n })\n const { manifest } = loaded\n const capabilities = resolveCapabilities(\n manifest.model.main.id,\n manifest.model.main.capabilities,\n )\n\n // The same resolution `run` uses, soul gate included — the file the gate selects is a file\n // someone wrote, and its writing deserves the same reading as any other identity file.\n const { workspace, warnings } = resolveWorkspace(loaded, capabilities.promptStyle)\n\n // The authoring checks read the *authored* text, never the rendered form. An author fixes\n // what they wrote, and telling them about a heading the renderer inserted would send them\n // looking for a line that is not in their file.\n const findings: ErrorDetail[] = [\n ...warnings,\n ...checkAuthoring(\n workspace.files.map((file) => ({\n name: file.name,\n authored: file.authored,\n tier: file.tier,\n field: file.field,\n })),\n ),\n ]\n const ruleFailure = ruleBudgetFailure(workspace, manifest.context.rules)\n if (ruleFailure !== undefined) findings.push(ruleFailure.toDetail())\n\n if (options.json === true) {\n process.stdout.write(\n `${JSON.stringify(\n {\n ok: findings.length === 0,\n path: loaded.path,\n promptStyle: capabilities.promptStyle,\n files: workspace.files.map((file) => ({\n name: file.name,\n tier: file.tier,\n editable: file.editable,\n tokens: file.tokens,\n budget: file.budget,\n })),\n tokens: workspace.tokens,\n findings,\n },\n null,\n 2,\n )}\\n`,\n )\n return options.strict === true && findings.length > 0 ? EXIT_FAILURE : EXIT_OK\n }\n\n const style = capabilities.promptStyle\n process.stdout.write(\n `${loaded.path}\\n` +\n ` rendering delimiters=${style.delimiters} intensity=${style.intensity} examplesIn=${style.examplesIn}\\n` +\n ` total ${workspace.tokens.total} tokens (static ${workspace.tokens.static}, volatile ${workspace.tokens.volatile}, reminder ${workspace.tokens.reminder})\\n`,\n )\n\n for (const file of workspace.files) {\n process.stdout.write(\n ` ${file.name.padEnd(14)} ${file.tier.padEnd(9)} ${String(file.tokens).padStart(5)}/${file.budget} tokens, editable=${file.editable}\\n`,\n )\n }\n\n if (findings.length === 0) {\n process.stdout.write(\"\\nno findings\\n\")\n return EXIT_OK\n }\n\n for (const finding of findings) {\n process.stdout.write(`\\n ${finding.code}: ${finding.message}\\n`)\n process.stdout.write(` hint: ${finding.hint}\\n`)\n }\n // Counted rather than merely listed: \"three findings\" is the sentence someone acts on, and\n // scrolling back to count them is how a fourth one goes unnoticed.\n process.stdout.write(`\\n${findings.length} finding(s)\\n`)\n\n return options.strict === true ? EXIT_FAILURE : EXIT_OK\n } catch (error) {\n if (options.json === true && isHarnessError(error)) {\n process.stdout.write(\n `${JSON.stringify({ ok: false, error: error.toDetail(), details: error.details }, null, 2)}\\n`,\n )\n return EXIT_FAILURE\n }\n throw error\n }\n}\n",
44
44
  "/**\n * The entry point: parse, dispatch, exit.\n *\n * No shebang here — the build prepends one via `--banner`. Two would be a syntax error, and the\n * source is never executed directly: `bun run src/index.ts` and `node dist/index.js` are the two\n * supported ways in.\n *\n * Three rules hold here and nowhere else.\n *\n * **It imports no Ink and no React.** The rich renderer is reached through a dynamic `import()` in\n * `run.ts`, because loading it costs ~170-210 ms under Node — more than the entire runtime of\n * `validate --json`. A static import anywhere on this path would be paid by every command.\n *\n * **Commands return exit codes; they never call `process.exit`.** Exiting mid-write discards buffered\n * stdout when the output is a pipe, which is how `--json` gets read. This file is the one exception,\n * on the last line, and only after `finish` has drained the output — a command that exits by itself\n * skips the teardowns and the drain both.\n *\n * **Asking for help is a success.** The previous entry point set exit code 1 for `--help` given\n * without a command, reporting failure for the one thing that had worked.\n */\n\nimport { BRAND, HarnessError, isHarnessError, VERSION } from \"@dispach/core\"\nimport { agentsCommand } from \"#agents\"\nimport { browseCommand } from \"#browse\"\nimport { daemonCommand } from \"#daemon\"\nimport { initCommand } from \"#init\"\nimport { keysCommand } from \"#keys\"\nimport { parse } from \"#lib/args\"\nimport { announce, ensureServer } from \"#lib/bootstrap\"\nimport { actionOrRef } from \"#lib/commands\"\nimport { askExactly, askYesNo } from \"#lib/confirm\"\nimport { EXIT_FAILURE, EXIT_OK } from \"#lib/const\"\nimport { readEnv } from \"#lib/env\"\nimport { finishNow, installGuards } from \"#lib/exit\"\nimport { helpText } from \"#lib/help\"\nimport { installServerUnit } from \"#lib/host-actions\"\nimport { missingInterface } from \"#lib/interface-missing\"\nimport { resolveAgentRef } from \"#lib/sandbox\"\nimport { loadSecretFiles } from \"#lib/secret-files\"\nimport { quietAcceptedWarnings } from \"#lib/warnings\"\nimport { memoryCommand } from \"#memory\"\nimport { modelCommand } from \"#model\"\nimport { pluginsCommand } from \"#plugins\"\nimport { removeCommand } from \"#remove\"\nimport { restartCommand } from \"#restart\"\nimport { runCommand } from \"#run\"\nimport { schedulesCommand } from \"#schedules\"\nimport { serveCommand } from \"#serve\"\nimport { sessionsCommand } from \"#sessions\"\nimport { skillsCommand } from \"#skills\"\nimport { soulCommand } from \"#soul\"\nimport { sourcesCommand } from \"#sources\"\nimport { startCommand } from \"#start\"\nimport { statusCommand } from \"#status\"\nimport { stopCommand } from \"#stop\"\nimport { terminalSetupCommand } from \"#terminal-setup\"\nimport { toolsCommand } from \"#tools\"\nimport { validateCommand } from \"#validate\"\nimport { workspaceCommand } from \"#workspace\"\n\nfunction report(error: unknown): number {\n const missing = missingInterface(error)\n if (missing !== undefined) {\n process.stderr.write(\n `cli_interface_missing: this command draws the terminal UI, and ${missing} is not installed.\\n` +\n ` hint: it is an optional dependency, left out by an install with --omit=optional. Reinstall without it (npm i -g ${BRAND.slug}), or pass --plain where the command has it.\\n`,\n )\n return EXIT_FAILURE\n }\n if (isHarnessError(error)) {\n // `format()` prints the code, the field, the hint, and every sub-failure — so a command line\n // with two mistakes in it reports both rather than one at a time.\n process.stderr.write(`${error.format()}\\n`)\n } else if (error instanceof Error) {\n process.stderr.write(`${error.message}\\n`)\n if (readEnv().debug && error.stack !== undefined) process.stderr.write(`${error.stack}\\n`)\n } else {\n process.stderr.write(`${String(error)}\\n`)\n }\n return EXIT_FAILURE\n}\n\nasync function dispatch(argv: readonly string[]): Promise<number> {\n const result = parse(argv)\n\n switch (result.kind) {\n case \"version\":\n process.stdout.write(`${VERSION}\\n`)\n return EXIT_OK\n\n case \"help\":\n process.stdout.write(helpText(result.command))\n return EXIT_OK\n\n case \"usage\":\n // Invoked with nothing to do. The help goes to stdout because it was not an error in the\n // arguments — but the code is non-zero, because nothing was accomplished.\n process.stdout.write(helpText())\n return EXIT_FAILURE\n\n case \"command\":\n break\n }\n\n const { command, positionals, flags } = result.parsed\n // Present when the command's first argument is required; `init` and `run` legitimately take\n // none. Each case knows which it is.\n const manifestPath = positionals[0] as string\n // Every manifest-taking command accepts a sandbox agent name too — one resolver, applied\n // here at the dispatch layer, so `sessions milo` works the moment `run milo` does. The\n // resolution throws with the candidate list and a nearest-match hint.\n const resolved = (): string => resolveAgentRef(manifestPath)\n\n /**\n * First run: if this command wants a host and none is up, put one up and say so in one line.\n *\n * Here rather than in each command, because \"does this want a host\" is declared on the spec\n * (`CommandSpec.needsServer`, required) and this is the one place that reads it — a hand-kept\n * list of command names would be the drift `session-commands.ts` was written to end, with a new\n * command silently absent from it or silently included in it.\n *\n * **Before the switch and after the parse**, which matters in both directions: `--help`,\n * `--version` and a usage error have already returned above, so asking for help never installs\n * anything; and an unparseable command line never gets this far either.\n *\n * The announcement goes to **stderr** so it cannot land in the middle of `--json` output\n * somebody is piping into `jq`. It never throws — see `ensureServer`.\n */\n // `--store` only when this command declares it. `flags.str` throws for an undeclared flag —\n // deliberately, since reading one is a CLI bug — and the bootstrap is global, so it cannot\n // assume a per-command flag exists. Asking the spec is the honest version of that question.\n const storeFlag = command.flags.some((flag) => flag.name === \"store\")\n ? flags.str(\"store\")\n : undefined\n const bootstrap = await ensureServer({\n needsServer: command.needsServer,\n disabled: flags.bool(\"no-bootstrap\"),\n install: () => installServerUnit(),\n ...(storeFlag === undefined ? {} : { store: storeFlag }),\n })\n const note = announce(bootstrap)\n if (note !== undefined) process.stderr.write(note)\n\n switch (command.name) {\n case \"init\": {\n // `--dir`, never a positional: `init milo` read as the agent's name and meant the\n // directory. The parser refuses a positional now, with the spec's own two-readings hint.\n const dir = flags.str(\"dir\")\n const user = flags.str(\"user\")\n const name = flags.str(\"name\")\n const purpose = flags.str(\"purpose\")\n const preset = flags.str(\"preset\")\n const model = flags.str(\"model\")\n const baseUrl = flags.str(\"base-url\")\n const apiKeyEnv = flags.str(\"api-key-env\")\n const system = flags.str(\"system\")\n const web = flags.str(\"web\")\n const webBackend = flags.str(\"web-backend\")\n const composio = flags.str(\"composio\")\n const telegram = flags.str(\"telegram\")\n const telegramAllow = flags.str(\"telegram-allow\")\n const whatsapp = flags.str(\"whatsapp\")\n const whatsappNumber = flags.str(\"whatsapp-number\")\n const server = flags.str(\"server\")\n const schedules = flags.str(\"schedules\")\n const skills = flags.str(\"skills\")\n const daemon = flags.str(\"daemon\")\n return await initCommand({\n ...(dir === undefined ? {} : { dir }),\n ...(user === undefined ? {} : { user }),\n ...(name === undefined ? {} : { name }),\n ...(purpose === undefined ? {} : { purpose }),\n ...(preset === undefined ? {} : { preset }),\n ...(model === undefined ? {} : { model }),\n ...(baseUrl === undefined ? {} : { baseUrl }),\n ...(apiKeyEnv === undefined ? {} : { apiKeyEnv }),\n ...(system === undefined ? {} : { system }),\n ...(web === undefined ? {} : { web }),\n ...(webBackend === undefined ? {} : { webBackend }),\n ...(composio === undefined ? {} : { composio }),\n ...(telegram === undefined ? {} : { telegram }),\n ...(schedules === undefined ? {} : { schedules }),\n ...(telegramAllow === undefined ? {} : { telegramAllow }),\n ...(whatsapp === undefined ? {} : { whatsapp }),\n ...(whatsappNumber === undefined ? {} : { whatsappNumber }),\n ...(server === undefined ? {} : { server }),\n ...(skills === undefined ? {} : { skills }),\n ...(daemon === undefined ? {} : { daemon }),\n yes: flags.bool(\"yes\"),\n plain: flags.bool(\"plain\"),\n measureWindow: flags.bool(\"measure-window\"),\n installServer: installServerUnit,\n })\n }\n\n case \"run\": {\n const session = flags.str(\"session\")\n const input = flags.str(\"input\")\n const store = flags.str(\"store\")\n return await runCommand({\n // Bare `run` hands the sandbox the decision; a given ref resolves path-or-name.\n ...(positionals[0] === undefined ? {} : { manifestPath: resolved() }),\n ...(session === undefined ? {} : { sessionKey: session }),\n continueSession: flags.bool(\"continue\"),\n ...(input === undefined ? {} : { once: input }),\n ...(store === undefined ? {} : { store }),\n ephemeral: flags.bool(\"ephemeral\"),\n quiet: flags.bool(\"quiet\"),\n showReasoning: flags.bool(\"show-reasoning\"),\n noReasoning: flags.bool(\"no-reasoning\"),\n // Only when actually written. `flags.bool` returns `false` for an absent boolean, and\n // passing that would turn \"no opinion\" into \"definitely on\" and override the env var.\n ...(flags.bool(\"no-enhanced-keys\") ? { noEnhancedKeys: true } : {}),\n plain: flags.bool(\"plain\"),\n })\n }\n\n case \"schedules\": {\n const store = flags.str(\"store\")\n const id = flags.str(\"id\")\n const enable = flags.str(\"enable\")\n const disable = flags.str(\"disable\")\n return await schedulesCommand({\n manifestPath: resolved(),\n ...(store === undefined ? {} : { store }),\n ...(id === undefined ? {} : { id }),\n ...(enable === undefined ? {} : { enable }),\n ...(disable === undefined ? {} : { disable }),\n recipients: flags.bool(\"recipients\"),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"sessions\": {\n const session = flags.str(\"session\")\n const store = flags.str(\"store\")\n const limit = flags.num(\"limit\")\n return await sessionsCommand({\n manifestPath: resolved(),\n ...(session === undefined ? {} : { sessionKey: session }),\n ...(store === undefined ? {} : { store }),\n ...(limit === undefined ? {} : { limit }),\n json: flags.bool(\"json\"),\n clear: flags.bool(\"clear\"),\n turns: flags.bool(\"turns\"),\n })\n }\n\n case \"memory\": {\n const limit = flags.num(\"limit\")\n const store = flags.str(\"store\")\n return await memoryCommand({\n // Positional 0 is the action, as for `soul` and `daemon` — so `resolved()` must not run\n // here; the manifest is positional 1.\n action: manifestPath,\n manifestPath: resolveAgentRef(positionals[1] ?? \"\"),\n ...(positionals[2] === undefined ? {} : { query: positionals[2] }),\n ...(limit === undefined ? {} : { limit }),\n ...(store === undefined ? {} : { store }),\n all: flags.bool(\"all\"),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"config\": {\n // As for `soul` and `daemon`, positional 0 is the action, so `resolved()` must not run —\n // the agent is positional 1 and this command resolves it itself.\n const { configCommand, readAction } = await import(\"#config\")\n // `config <agent>` with no action is the editor, so the split is not positional. The six\n // action words win and anything else is an agent — the same rule a slash command uses.\n const asked = readAction(manifestPath, positionals[1])\n return await configCommand({\n action: asked.action,\n ...(asked.ref === undefined ? {} : { ref: asked.ref }),\n ...(positionals[2] === undefined ? {} : { name: positionals[2] }),\n ...(positionals[3] === undefined ? {} : { value: positionals[3] }),\n ...(flags.str(\"channel\") === undefined\n ? {}\n : { channel: flags.str(\"channel\") as string }),\n remove: flags.bool(\"remove\"),\n yes: flags.bool(\"yes\"),\n ...(flags.str(\"store\") === undefined\n ? {}\n : { store: flags.str(\"store\") as string }),\n })\n }\n\n case \"validate\":\n return await validateCommand({ manifestPath: resolved(), json: flags.bool(\"json\") })\n\n case \"workspace\":\n return workspaceCommand({\n manifestPath: resolved(),\n json: flags.bool(\"json\"),\n strict: flags.bool(\"strict\"),\n })\n\n case \"soul\": {\n const out = flags.str(\"out\")\n return soulCommand({\n // For this command the first positional is the action, not a manifest.\n action: manifestPath,\n file: positionals[1] as string,\n ...(out === undefined ? {} : { out }),\n })\n }\n\n case \"skills\": {\n // Bare `skills` is the catalogue. Checked before the manifest is resolved, because browsing\n // is not about an agent — the agent is chosen on the second screen.\n if (positionals.length === 0) {\n return await browseCommand({\n plain: flags.bool(\"plain\"),\n json: flags.bool(\"json\"),\n })\n }\n // Positional 0 is the action, so the manifest is positional 1 — the same shape `soul` uses\n // and the reason `resolved()` is not called here.\n const skill = positionals[2]\n return skillsCommand({\n action: manifestPath,\n manifestPath: resolveAgentRef(positionals[1] ?? \"\"),\n ...(skill === undefined ? {} : { name: skill }),\n json: flags.bool(\"json\"),\n strict: flags.bool(\"strict\"),\n })\n }\n\n case \"sources\": {\n // Positional 0 is the action and there is no manifest, so `resolveAgentRef` never runs —\n // this command answers about the machine, not about an agent.\n const path = flags.str(\"path\")\n const ref = flags.str(\"ref\")\n return await sourcesCommand({\n action: manifestPath,\n rest: positionals.slice(1),\n ...(path === undefined ? {} : { path }),\n ...(ref === undefined ? {} : { ref }),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"channels\": {\n // The action is optional, so positional 0 is either an action word or the agent — the\n // same split `config` makes, resolved from the command's own spec rather than a second\n // copy of the action list.\n const split = actionOrRef(\"channels\", manifestPath)\n const ref = split.ref ?? positionals[1] ?? \"\"\n const { channelsCommand } = await import(\"#channels\")\n return await channelsCommand({\n ...(split.action === undefined ? {} : { action: split.action }),\n manifestPath: resolveAgentRef(ref),\n ...(positionals[2] === undefined ? {} : { channelId: positionals[2] }),\n json: flags.bool(\"json\"),\n installServer: installServerUnit,\n })\n }\n\n case \"plugins\": {\n const ref = flags.str(\"ref\")\n const name = flags.str(\"name\")\n return await pluginsCommand({\n action: manifestPath,\n manifestPath: resolveAgentRef(positionals[1] ?? \"\"),\n rest: positionals.slice(2),\n ...(ref === undefined ? {} : { ref }),\n ...(name === undefined ? {} : { name }),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"agents\": {\n const store = flags.str(\"store\")\n return await agentsCommand({\n // Bare lists the sandbox; names or paths describe those agents in full.\n manifestPaths: positionals.map((ref) => resolveAgentRef(ref)),\n ...(store === undefined ? {} : { store }),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"restart\": {\n const store = flags.str(\"store\")\n return await restartCommand({\n // Optional: bare restarts the service, named reloads that agent where it runs.\n ...(manifestPath === undefined ? {} : { manifestPath: resolved() }),\n ...(store === undefined ? {} : { store }),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"status\": {\n const store = flags.str(\"store\")\n return await statusCommand({\n ...(store === undefined ? {} : { store }),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"logs\": {\n // An alias for `daemon logs`, flags and all: `--lines`, `--follow`, `--truncate`.\n const lines = flags.num(\"lines\")\n const store = flags.str(\"store\")\n return await daemonCommand({\n action: \"logs\",\n ...(manifestPath === undefined ? {} : { manifestPath: resolved() }),\n ...(lines === undefined ? {} : { lines }),\n follow: flags.bool(\"follow\"),\n truncate: flags.bool(\"truncate\"),\n ...(store === undefined ? {} : { store }),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"serve\": {\n const port = flags.num(\"port\")\n const host = flags.str(\"host\")\n const store = flags.str(\"store\")\n return await serveCommand({\n manifestPaths: positionals.map((ref) => resolveAgentRef(ref)),\n ...(port === undefined ? {} : { port }),\n ...(host === undefined ? {} : { host }),\n ...(store === undefined ? {} : { store }),\n claim: flags.bool(\"claim\"),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"keys\":\n return await keysCommand({ noEnhancedKeys: flags.bool(\"no-enhanced-keys\") })\n\n case \"terminal-setup\":\n return await terminalSetupCommand({\n dryRun: flags.bool(\"dry-run\"),\n yes: flags.bool(\"yes\"),\n json: flags.bool(\"json\"),\n confirm: askYesNo,\n })\n\n case \"remove\":\n return await removeCommand({\n // A bare ref, never `resolved()`: removal is about a sandbox directory, and a resolved\n // manifest path would make `remove ./anything` look supported. `remove.ts` refuses a path.\n ...(manifestPath === undefined ? {} : { ref: manifestPath }),\n dryRun: flags.bool(\"dry-run\"),\n filesOnly: flags.bool(\"files-only\"),\n prune: flags.bool(\"prune\"),\n all: flags.bool(\"all\"),\n yes: flags.bool(\"yes\"),\n json: flags.bool(\"json\"),\n ...(flags.str(\"store\") === undefined\n ? {}\n : { store: flags.str(\"store\") as string }),\n confirm: askExactly,\n })\n\n case \"stop\": {\n const reason = flags.str(\"reason\")\n return await stopCommand({\n // Optional on purpose: bare `stop` is the whole host, and naming an agent is a\n // different command rather than the same one with a filter — see stop.ts.\n ...(manifestPath === undefined ? {} : { manifestPath: resolved() }),\n dryRun: flags.bool(\"dry-run\"),\n ...(reason === undefined ? {} : { reason }),\n ...(flags.str(\"store\") === undefined\n ? {}\n : { store: flags.str(\"store\") as string }),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"start\":\n return await startCommand({\n manifestPath: resolved(),\n ...(flags.str(\"store\") === undefined\n ? {}\n : { store: flags.str(\"store\") as string }),\n json: flags.bool(\"json\"),\n })\n\n case \"web\": {\n const { webCommand } = await import(\"#web\")\n return await webCommand({\n // The action is positional 0 and the agent positional 1 — the `daemon install\n // <agent>` shape, which `manifestIndex` already reads off this spec, so the parser\n // and the help needed no change for a nested verb.\n action: manifestPath as \"run\" | \"open\" | \"url\" | undefined,\n ...(positionals[1] === undefined\n ? {}\n : { manifestPath: resolveAgentRef(positionals[1]) }),\n noOpen: flags.bool(\"no-open\"),\n ...(flags.str(\"store\") === undefined\n ? {}\n : { store: flags.str(\"store\") as string }),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"credential\": {\n const { credentialCommand } = await import(\"#credential\")\n return await credentialCommand({\n // Action at positional 0 and the id at 1 — the `web run <agent>` shape, which\n // `manifestIndex` already reads off the spec, so the parser needed no change.\n action: manifestPath ?? \"\",\n ...(positionals[1] === undefined ? {} : { keyId: positionals[1] }),\n ...(flags.str(\"label\") === undefined\n ? {}\n : { label: flags.str(\"label\") as string }),\n ...(flags.str(\"agents\") === undefined\n ? {}\n : { agents: flags.str(\"agents\") as string }),\n ...(flags.str(\"sessions\") === undefined\n ? {}\n : { sessions: flags.str(\"sessions\") as string }),\n ...(flags.str(\"can\") === undefined ? {} : { can: flags.str(\"can\") as string }),\n ...(flags.str(\"expires\") === undefined\n ? {}\n : { expires: flags.str(\"expires\") as string }),\n ...(flags.str(\"store\") === undefined\n ? {}\n : { store: flags.str(\"store\") as string }),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"daemon\": {\n const lines = flags.num(\"lines\")\n return await daemonCommand({\n // As for `soul`, the first positional is the action rather than a manifest — so\n // `resolved()` must not run here. The agent is positional 1, and it is optional:\n // bare `daemon status` reports on every installed agent.\n action: manifestPath,\n ...(positionals[1] === undefined\n ? {}\n : { manifestPath: resolveAgentRef(positionals[1]) }),\n ...(lines === undefined ? {} : { lines }),\n follow: flags.bool(\"follow\"),\n truncate: flags.bool(\"truncate\"),\n dryRun: flags.bool(\"dry-run\"),\n ...(flags.str(\"store\") === undefined\n ? {}\n : { store: flags.str(\"store\") as string }),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"model\": {\n const price = flags.num(\"price\")\n return await modelCommand({\n manifestPath: resolveAgentRef(positionals[1] as string),\n window: flags.bool(\"window\"),\n ...(price === undefined ? {} : { price }),\n write: flags.bool(\"write\"),\n yes: flags.bool(\"yes\"),\n json: flags.bool(\"json\"),\n })\n }\n\n case \"tools\":\n return await toolsCommand({\n manifestPath: resolved(),\n warm: flags.bool(\"warm\"),\n json: flags.bool(\"json\"),\n })\n\n default:\n // Unreachable: `parse` refuses an unknown command with a suggestion. Present so that\n // adding a command to lib/commands.ts without wiring it fails loudly rather than\n // silently doing nothing and exiting 0.\n throw new HarnessError({\n code: \"cli_command_unwired\",\n message: `Command \"${command.name}\" is declared but not wired up.`,\n hint: \"Add a case for it in src/index.ts.\",\n })\n }\n}\n\n// Before anything opens a store, which is what makes Node emit its `node:sqlite` experimental\n// warning into the middle of a command's output. See `lib/warnings.ts` for what is filtered and why\n// the list is specific rather than \"every ExperimentalWarning\".\nquietAcceptedWarnings()\ninstallGuards()\n// Before anything reads the environment: `X_FILE` fills `X` for every reader (pilot.9).\nloadSecretFiles()\n\n// One way out for every route, so the terminal is restored and buffered output drains before the\n// process ends — and then the process actually ends.\n//\n// `finish` alone was the bug: it sets `process.exitCode` and lets the event loop empty, which assumes\n// the loop can empty. A runtime leaves a keep-alive socket to the tool provider in Node's global\n// `fetch` pool, so it does not — measured at 180 seconds still alive after `/exit`, and the `tools`\n// command killed at 30. `lib/exit.ts` carries the numbers.\nawait dispatch(process.argv.slice(2))\n .catch(report)\n .then((code) => finishNow(code))\n"
45
45
  ],
46
- "mappings": ";w3CAqCO,eAAe,EAAa,CAAC,EAAwD,CACxF,IAAM,EAAQ,MAAM,GAAU,CAAK,EAC7B,EAA4B,CAAC,EACnC,QAAW,KAAS,GAAW,EAAG,CAC9B,IAAM,EAAK,EAAM,IAAM,EAAM,IACvB,EAAS,MAAM,GAAa,EAAI,CAAK,GAAM,CAAE,QAAS,EAAK,EAC3D,EAAQ,EAAM,KAAK,CAAC,IAAQ,EAAI,UAAY,CAAE,EAC9C,EAAQ,IAA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