dispach 0.1.0

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 (346) hide show
  1. package/README.md +596 -0
  2. package/dist/App-dxqm39zx.js +11 -0
  3. package/dist/App-dxqm39zx.js.map +25 -0
  4. package/dist/ConfigEditor-7v5nebvy.js +6 -0
  5. package/dist/ConfigEditor-7v5nebvy.js.map +11 -0
  6. package/dist/KeyProbe-vjhmdpx6.js +5 -0
  7. package/dist/KeyProbe-vjhmdpx6.js.map +11 -0
  8. package/dist/Picker-jxaesaxy.js +5 -0
  9. package/dist/Picker-jxaesaxy.js.map +10 -0
  10. package/dist/SessionPicker-z2t0p4b5.js +5 -0
  11. package/dist/SessionPicker-z2t0p4b5.js.map +11 -0
  12. package/dist/SkillBrowser-yyf2gy0q.js +5 -0
  13. package/dist/SkillBrowser-yyf2gy0q.js.map +11 -0
  14. package/dist/WizardApp-12ndxgqv.js +5 -0
  15. package/dist/WizardApp-12ndxgqv.js.map +13 -0
  16. package/dist/agents.d.ts +9 -0
  17. package/dist/agents.d.ts.map +1 -0
  18. package/dist/browse.d.ts +63 -0
  19. package/dist/browse.d.ts.map +1 -0
  20. package/dist/client.d.ts +25 -0
  21. package/dist/client.d.ts.map +1 -0
  22. package/dist/client.js +34 -0
  23. package/dist/client.js.map +11 -0
  24. package/dist/components/App.d.ts +28 -0
  25. package/dist/components/App.d.ts.map +1 -0
  26. package/dist/components/Banner.d.ts +16 -0
  27. package/dist/components/Banner.d.ts.map +1 -0
  28. package/dist/components/Brandmark.d.ts +31 -0
  29. package/dist/components/Brandmark.d.ts.map +1 -0
  30. package/dist/components/CheckList.d.ts +38 -0
  31. package/dist/components/CheckList.d.ts.map +1 -0
  32. package/dist/components/CommandOutput.d.ts +29 -0
  33. package/dist/components/CommandOutput.d.ts.map +1 -0
  34. package/dist/components/ConfigEditor.d.ts +64 -0
  35. package/dist/components/ConfigEditor.d.ts.map +1 -0
  36. package/dist/components/HistorySearch.d.ts +23 -0
  37. package/dist/components/HistorySearch.d.ts.map +1 -0
  38. package/dist/components/KeyProbe.d.ts +36 -0
  39. package/dist/components/KeyProbe.d.ts.map +1 -0
  40. package/dist/components/LineCursor.d.ts +55 -0
  41. package/dist/components/LineCursor.d.ts.map +1 -0
  42. package/dist/components/Live.d.ts +17 -0
  43. package/dist/components/Live.d.ts.map +1 -0
  44. package/dist/components/Palette.d.ts +21 -0
  45. package/dist/components/Palette.d.ts.map +1 -0
  46. package/dist/components/Picker.d.ts +23 -0
  47. package/dist/components/Picker.d.ts.map +1 -0
  48. package/dist/components/Prompt.d.ts +20 -0
  49. package/dist/components/Prompt.d.ts.map +1 -0
  50. package/dist/components/Screen.d.ts +39 -0
  51. package/dist/components/Screen.d.ts.map +1 -0
  52. package/dist/components/SelectList.d.ts +34 -0
  53. package/dist/components/SelectList.d.ts.map +1 -0
  54. package/dist/components/SessionPicker.d.ts +26 -0
  55. package/dist/components/SessionPicker.d.ts.map +1 -0
  56. package/dist/components/SkillBrowser.d.ts +39 -0
  57. package/dist/components/SkillBrowser.d.ts.map +1 -0
  58. package/dist/components/Spinner.d.ts +13 -0
  59. package/dist/components/Spinner.d.ts.map +1 -0
  60. package/dist/components/StatusBar.d.ts +11 -0
  61. package/dist/components/StatusBar.d.ts.map +1 -0
  62. package/dist/components/SummaryCard.d.ts +11 -0
  63. package/dist/components/SummaryCard.d.ts.map +1 -0
  64. package/dist/components/TextField.d.ts +39 -0
  65. package/dist/components/TextField.d.ts.map +1 -0
  66. package/dist/components/Transcript.d.ts +23 -0
  67. package/dist/components/Transcript.d.ts.map +1 -0
  68. package/dist/components/WizardApp.d.ts +18 -0
  69. package/dist/components/WizardApp.d.ts.map +1 -0
  70. package/dist/components/WizardFrame.d.ts +19 -0
  71. package/dist/components/WizardFrame.d.ts.map +1 -0
  72. package/dist/config-yz0nz51b.js +24 -0
  73. package/dist/config-yz0nz51b.js.map +10 -0
  74. package/dist/config.d.ts +71 -0
  75. package/dist/config.d.ts.map +1 -0
  76. package/dist/credential-wgt4gvcz.js +19 -0
  77. package/dist/credential-wgt4gvcz.js.map +10 -0
  78. package/dist/credential.d.ts +68 -0
  79. package/dist/credential.d.ts.map +1 -0
  80. package/dist/daemon.d.ts +47 -0
  81. package/dist/daemon.d.ts.map +1 -0
  82. package/dist/editor.d.ts +81 -0
  83. package/dist/editor.d.ts.map +1 -0
  84. package/dist/hooks/useElapsed.d.ts +10 -0
  85. package/dist/hooks/useElapsed.d.ts.map +1 -0
  86. package/dist/hooks/useTerminalSize.d.ts +14 -0
  87. package/dist/hooks/useTerminalSize.d.ts.map +1 -0
  88. package/dist/hooks/useTurn.d.ts +41 -0
  89. package/dist/hooks/useTurn.d.ts.map +1 -0
  90. package/dist/index-2cvtz0fy.js +903 -0
  91. package/dist/index-2cvtz0fy.js.map +194 -0
  92. package/dist/index-3nwfz9jq.js +12 -0
  93. package/dist/index-3nwfz9jq.js.map +11 -0
  94. package/dist/index-6b7qvh1x.js +6 -0
  95. package/dist/index-6b7qvh1x.js.map +10 -0
  96. package/dist/index-6z0yr17z.js +12 -0
  97. package/dist/index-6z0yr17z.js.map +11 -0
  98. package/dist/index-7da4fqcr.js +7 -0
  99. package/dist/index-7da4fqcr.js.map +11 -0
  100. package/dist/index-8bmhd2hj.js +6 -0
  101. package/dist/index-8bmhd2hj.js.map +10 -0
  102. package/dist/index-9d011p3q.js +6 -0
  103. package/dist/index-9d011p3q.js.map +10 -0
  104. package/dist/index-9f9pp2ef.js +6 -0
  105. package/dist/index-9f9pp2ef.js.map +10 -0
  106. package/dist/index-9nsfs0vy.js +6 -0
  107. package/dist/index-9nsfs0vy.js.map +10 -0
  108. package/dist/index-9pj1ws0p.js +77 -0
  109. package/dist/index-9pj1ws0p.js.map +12 -0
  110. package/dist/index-b5wwtxzk.js +66 -0
  111. package/dist/index-b5wwtxzk.js.map +12 -0
  112. package/dist/index-b8zwg8a3.js +6 -0
  113. package/dist/index-b8zwg8a3.js.map +10 -0
  114. package/dist/index-bry9bzt3.js +427 -0
  115. package/dist/index-bry9bzt3.js.map +11 -0
  116. package/dist/index-bwckzbf8.js +6 -0
  117. package/dist/index-bwckzbf8.js.map +10 -0
  118. package/dist/index-cx3vz7sf.js +6 -0
  119. package/dist/index-cx3vz7sf.js.map +11 -0
  120. package/dist/index-e8n70sgj.js +6 -0
  121. package/dist/index-e8n70sgj.js.map +11 -0
  122. package/dist/index-fvhg0xyd.js +167 -0
  123. package/dist/index-fvhg0xyd.js.map +19 -0
  124. package/dist/index-gbnc99j8.js +14 -0
  125. package/dist/index-gbnc99j8.js.map +13 -0
  126. package/dist/index-h2yds678.js +7 -0
  127. package/dist/index-h2yds678.js.map +11 -0
  128. package/dist/index-j97vttdt.js +10 -0
  129. package/dist/index-j97vttdt.js.map +10 -0
  130. package/dist/index-jk0def33.js +6 -0
  131. package/dist/index-jk0def33.js.map +12 -0
  132. package/dist/index-jym27m75.js +6 -0
  133. package/dist/index-jym27m75.js.map +10 -0
  134. package/dist/index-mgdgx22q.js +10 -0
  135. package/dist/index-mgdgx22q.js.map +10 -0
  136. package/dist/index-mrtb5y08.js +6 -0
  137. package/dist/index-mrtb5y08.js.map +11 -0
  138. package/dist/index-my5cjx00.js +6 -0
  139. package/dist/index-my5cjx00.js.map +10 -0
  140. package/dist/index-qc2vrq9z.js +7 -0
  141. package/dist/index-qc2vrq9z.js.map +11 -0
  142. package/dist/index-rqbtm761.js +6 -0
  143. package/dist/index-rqbtm761.js.map +10 -0
  144. package/dist/index-rqzg861g.js +6 -0
  145. package/dist/index-rqzg861g.js.map +10 -0
  146. package/dist/index-t1xvacym.js +6 -0
  147. package/dist/index-t1xvacym.js.map +11 -0
  148. package/dist/index-xgqzk5cq.js +9 -0
  149. package/dist/index-xgqzk5cq.js.map +12 -0
  150. package/dist/index-xqyms08r.js +6 -0
  151. package/dist/index-xqyms08r.js.map +10 -0
  152. package/dist/index-yr25dnf5.js +6 -0
  153. package/dist/index-yr25dnf5.js.map +10 -0
  154. package/dist/index.d.ts +23 -0
  155. package/dist/index.d.ts.map +1 -0
  156. package/dist/index.js +527 -0
  157. package/dist/index.js.map +48 -0
  158. package/dist/init.d.ts +34 -0
  159. package/dist/init.d.ts.map +1 -0
  160. package/dist/keymap.d.ts +126 -0
  161. package/dist/keymap.d.ts.map +1 -0
  162. package/dist/keys.d.ts +17 -0
  163. package/dist/keys.d.ts.map +1 -0
  164. package/dist/lib/ambient.d.ts +69 -0
  165. package/dist/lib/ambient.d.ts.map +1 -0
  166. package/dist/lib/args.d.ts +33 -0
  167. package/dist/lib/args.d.ts.map +1 -0
  168. package/dist/lib/bootstrap.d.ts +84 -0
  169. package/dist/lib/bootstrap.d.ts.map +1 -0
  170. package/dist/lib/browse.d.ts +89 -0
  171. package/dist/lib/browse.d.ts.map +1 -0
  172. package/dist/lib/browser.d.ts +55 -0
  173. package/dist/lib/browser.d.ts.map +1 -0
  174. package/dist/lib/chat-frame.d.ts +156 -0
  175. package/dist/lib/chat-frame.d.ts.map +1 -0
  176. package/dist/lib/clipboard.d.ts +32 -0
  177. package/dist/lib/clipboard.d.ts.map +1 -0
  178. package/dist/lib/commands.d.ts +26 -0
  179. package/dist/lib/commands.d.ts.map +1 -0
  180. package/dist/lib/composer.d.ts +85 -0
  181. package/dist/lib/composer.d.ts.map +1 -0
  182. package/dist/lib/config-apply.d.ts +51 -0
  183. package/dist/lib/config-apply.d.ts.map +1 -0
  184. package/dist/lib/config-editor.d.ts +113 -0
  185. package/dist/lib/config-editor.d.ts.map +1 -0
  186. package/dist/lib/config-env.d.ts +110 -0
  187. package/dist/lib/config-env.d.ts.map +1 -0
  188. package/dist/lib/config-rows.d.ts +37 -0
  189. package/dist/lib/config-rows.d.ts.map +1 -0
  190. package/dist/lib/config-view.d.ts +133 -0
  191. package/dist/lib/config-view.d.ts.map +1 -0
  192. package/dist/lib/confirm.d.ts +86 -0
  193. package/dist/lib/confirm.d.ts.map +1 -0
  194. package/dist/lib/const.d.ts +213 -0
  195. package/dist/lib/const.d.ts.map +1 -0
  196. package/dist/lib/csi.d.ts +70 -0
  197. package/dist/lib/csi.d.ts.map +1 -0
  198. package/dist/lib/curated.d.ts +44 -0
  199. package/dist/lib/curated.d.ts.map +1 -0
  200. package/dist/lib/daemon-plan.d.ts +151 -0
  201. package/dist/lib/daemon-plan.d.ts.map +1 -0
  202. package/dist/lib/dotenv-edit.d.ts +30 -0
  203. package/dist/lib/dotenv-edit.d.ts.map +1 -0
  204. package/dist/lib/env.d.ts +10 -0
  205. package/dist/lib/env.d.ts.map +1 -0
  206. package/dist/lib/exit.d.ts +170 -0
  207. package/dist/lib/exit.d.ts.map +1 -0
  208. package/dist/lib/help.d.ts +10 -0
  209. package/dist/lib/help.d.ts.map +1 -0
  210. package/dist/lib/init-flow.d.ts +539 -0
  211. package/dist/lib/init-flow.d.ts.map +1 -0
  212. package/dist/lib/init-skills.d.ts +46 -0
  213. package/dist/lib/init-skills.d.ts.map +1 -0
  214. package/dist/lib/keyboard.d.ts +76 -0
  215. package/dist/lib/keyboard.d.ts.map +1 -0
  216. package/dist/lib/keys-view.d.ts +57 -0
  217. package/dist/lib/keys-view.d.ts.map +1 -0
  218. package/dist/lib/launchd.d.ts +151 -0
  219. package/dist/lib/launchd.d.ts.map +1 -0
  220. package/dist/lib/lifecycle.d.ts +126 -0
  221. package/dist/lib/lifecycle.d.ts.map +1 -0
  222. package/dist/lib/log-follow.d.ts +71 -0
  223. package/dist/lib/log-follow.d.ts.map +1 -0
  224. package/dist/lib/mouse.d.ts +84 -0
  225. package/dist/lib/mouse.d.ts.map +1 -0
  226. package/dist/lib/multiselect.d.ts +37 -0
  227. package/dist/lib/multiselect.d.ts.map +1 -0
  228. package/dist/lib/origins.d.ts +40 -0
  229. package/dist/lib/origins.d.ts.map +1 -0
  230. package/dist/lib/output.d.ts +29 -0
  231. package/dist/lib/output.d.ts.map +1 -0
  232. package/dist/lib/palette.d.ts +69 -0
  233. package/dist/lib/palette.d.ts.map +1 -0
  234. package/dist/lib/probe.d.ts +158 -0
  235. package/dist/lib/probe.d.ts.map +1 -0
  236. package/dist/lib/providers.d.ts +63 -0
  237. package/dist/lib/providers.d.ts.map +1 -0
  238. package/dist/lib/provision.d.ts +163 -0
  239. package/dist/lib/provision.d.ts.map +1 -0
  240. package/dist/lib/remove-plan.d.ts +120 -0
  241. package/dist/lib/remove-plan.d.ts.map +1 -0
  242. package/dist/lib/render.d.ts +78 -0
  243. package/dist/lib/render.d.ts.map +1 -0
  244. package/dist/lib/resume.d.ts +69 -0
  245. package/dist/lib/resume.d.ts.map +1 -0
  246. package/dist/lib/rows.d.ts +69 -0
  247. package/dist/lib/rows.d.ts.map +1 -0
  248. package/dist/lib/sandbox.d.ts +101 -0
  249. package/dist/lib/sandbox.d.ts.map +1 -0
  250. package/dist/lib/schema.d.ts +491 -0
  251. package/dist/lib/schema.d.ts.map +1 -0
  252. package/dist/lib/screen.d.ts +102 -0
  253. package/dist/lib/screen.d.ts.map +1 -0
  254. package/dist/lib/scroll.d.ts +64 -0
  255. package/dist/lib/scroll.d.ts.map +1 -0
  256. package/dist/lib/select.d.ts +23 -0
  257. package/dist/lib/select.d.ts.map +1 -0
  258. package/dist/lib/service-env.d.ts +38 -0
  259. package/dist/lib/service-env.d.ts.map +1 -0
  260. package/dist/lib/service.d.ts +102 -0
  261. package/dist/lib/service.d.ts.map +1 -0
  262. package/dist/lib/session-commands.d.ts +229 -0
  263. package/dist/lib/session-commands.d.ts.map +1 -0
  264. package/dist/lib/session-key.d.ts +55 -0
  265. package/dist/lib/session-key.d.ts.map +1 -0
  266. package/dist/lib/sessions-view.d.ts +31 -0
  267. package/dist/lib/sessions-view.d.ts.map +1 -0
  268. package/dist/lib/source-cache.d.ts +105 -0
  269. package/dist/lib/source-cache.d.ts.map +1 -0
  270. package/dist/lib/source.d.ts +281 -0
  271. package/dist/lib/source.d.ts.map +1 -0
  272. package/dist/lib/sources.d.ts +107 -0
  273. package/dist/lib/sources.d.ts.map +1 -0
  274. package/dist/lib/spawn.d.ts +56 -0
  275. package/dist/lib/spawn.d.ts.map +1 -0
  276. package/dist/lib/stdin-tap.d.ts +41 -0
  277. package/dist/lib/stdin-tap.d.ts.map +1 -0
  278. package/dist/lib/subcommand.d.ts +57 -0
  279. package/dist/lib/subcommand.d.ts.map +1 -0
  280. package/dist/lib/systemd.d.ts +60 -0
  281. package/dist/lib/systemd.d.ts.map +1 -0
  282. package/dist/lib/templates.d.ts +35 -0
  283. package/dist/lib/templates.d.ts.map +1 -0
  284. package/dist/lib/terminal.d.ts +98 -0
  285. package/dist/lib/terminal.d.ts.map +1 -0
  286. package/dist/lib/text-selection.d.ts +75 -0
  287. package/dist/lib/text-selection.d.ts.map +1 -0
  288. package/dist/lib/theme.d.ts +90 -0
  289. package/dist/lib/theme.d.ts.map +1 -0
  290. package/dist/lib/types.d.ts +467 -0
  291. package/dist/lib/types.d.ts.map +1 -0
  292. package/dist/lib/warnings.d.ts +79 -0
  293. package/dist/lib/warnings.d.ts.map +1 -0
  294. package/dist/lib/width.d.ts +39 -0
  295. package/dist/lib/width.d.ts.map +1 -0
  296. package/dist/lib/wizard.d.ts +95 -0
  297. package/dist/lib/wizard.d.ts.map +1 -0
  298. package/dist/lib/wordmark.d.ts +60 -0
  299. package/dist/lib/wordmark.d.ts.map +1 -0
  300. package/dist/lib/wrap.d.ts +74 -0
  301. package/dist/lib/wrap.d.ts.map +1 -0
  302. package/dist/memory.d.ts +25 -0
  303. package/dist/memory.d.ts.map +1 -0
  304. package/dist/model.d.ts +47 -0
  305. package/dist/model.d.ts.map +1 -0
  306. package/dist/plugins.d.ts +15 -0
  307. package/dist/plugins.d.ts.map +1 -0
  308. package/dist/remove.d.ts +52 -0
  309. package/dist/remove.d.ts.map +1 -0
  310. package/dist/run.d.ts +42 -0
  311. package/dist/run.d.ts.map +1 -0
  312. package/dist/schedules.d.ts +41 -0
  313. package/dist/schedules.d.ts.map +1 -0
  314. package/dist/serve.d.ts +41 -0
  315. package/dist/serve.d.ts.map +1 -0
  316. package/dist/sessions.d.ts +13 -0
  317. package/dist/sessions.d.ts.map +1 -0
  318. package/dist/skills.d.ts +80 -0
  319. package/dist/skills.d.ts.map +1 -0
  320. package/dist/soul.d.ts +19 -0
  321. package/dist/soul.d.ts.map +1 -0
  322. package/dist/sources.d.ts +32 -0
  323. package/dist/sources.d.ts.map +1 -0
  324. package/dist/start.d.ts +26 -0
  325. package/dist/start.d.ts.map +1 -0
  326. package/dist/stop.d.ts +58 -0
  327. package/dist/stop.d.ts.map +1 -0
  328. package/dist/terminal-setup.d.ts +31 -0
  329. package/dist/terminal-setup.d.ts.map +1 -0
  330. package/dist/tools.d.ts +22 -0
  331. package/dist/tools.d.ts.map +1 -0
  332. package/dist/transcript.d.ts +124 -0
  333. package/dist/transcript.d.ts.map +1 -0
  334. package/dist/validate.d.ts +36 -0
  335. package/dist/validate.d.ts.map +1 -0
  336. package/dist/web-w7r68df1.js +14 -0
  337. package/dist/web-w7r68df1.js.map +11 -0
  338. package/dist/web.d.ts +36 -0
  339. package/dist/web.d.ts.map +1 -0
  340. package/dist/wire.d.ts +10 -0
  341. package/dist/wire.d.ts.map +1 -0
  342. package/dist/wire.js +33 -0
  343. package/dist/wire.js.map +10 -0
  344. package/dist/workspace.d.ts +19 -0
  345. package/dist/workspace.d.ts.map +1 -0
  346. package/package.json +78 -0
@@ -0,0 +1,95 @@
1
+ /**
2
+ * The init wizard as a pure reducer — a log of answers over `nextQuestion`'s forward-only flow.
3
+ *
4
+ * `nextQuestion` cannot go backwards, so back-navigation is an *answer log*: esc pops the tail
5
+ * and the next question is recomputed from what remains. Popping the tail is always consistent
6
+ * because the log is a prefix of the asking order — re-answering the preset re-derives every
7
+ * downstream default for free. Flag-given answers live in `given` and are never poppable: they
8
+ * were explicit, and backing over them would silently discard something the person typed into a
9
+ * shell.
10
+ *
11
+ * Renderer-free and process-free (PURE-listed): `WizardApp` is one consumer; a test driving the
12
+ * reducer with the same intents is another, and the two cannot diverge.
13
+ */
14
+ import type { ListIntent } from "#keymap";
15
+ import { type InitStep, type PartialAnswers, type Question, type QuestionDefaults } from "#lib/init-flow";
16
+ import { type SelectState } from "#lib/select";
17
+ import type { EditorState, Intent } from "#lib/types";
18
+ export type WizardPhase = "asking" | "confirm" | "done" | "aborted";
19
+ export interface WizardState {
20
+ /** Flag answers — explicit, never poppable. */
21
+ readonly given: PartialAnswers;
22
+ /** What the wizard collected, in asking order. Esc pops the tail. */
23
+ readonly log: readonly {
24
+ readonly step: InitStep;
25
+ readonly value: string;
26
+ }[];
27
+ readonly phase: WizardPhase;
28
+ /** The current text answer. Reuses the chat editor's state machine wholesale. */
29
+ readonly editor: EditorState;
30
+ /** The current select answer (preset step, and the confirm screen's yes/no). */
31
+ readonly select: SelectState;
32
+ /** Last validation failure; cleared on the next edit. */
33
+ readonly error: string | undefined;
34
+ readonly defaults: QuestionDefaults;
35
+ }
36
+ export declare function startWizard(given: PartialAnswers, defaults: QuestionDefaults): WizardState;
37
+ export declare function partialOf(state: WizardState): PartialAnswers;
38
+ export declare function currentQuestion(state: WizardState): Question | undefined;
39
+ /**
40
+ * Is the current question a fixed set of choices rather than a text field?
41
+ *
42
+ * Read off the question's own `options` rather than compared against a step name. The preset menu was
43
+ * the only select for three phases and "is this the preset step" ended up written into the reducer,
44
+ * the renderer and the cursor prefill — so adding a second one had to either repeat all three or
45
+ * generalise them. Generalising is what stops a third repeating them again.
46
+ */
47
+ export declare function isSelectStep(state: WizardState): boolean;
48
+ /** The choices on screen, empty when the question is a text field. */
49
+ export declare function selectOptions(state: WizardState): readonly {
50
+ readonly value: string;
51
+ readonly label: string;
52
+ readonly hint?: string;
53
+ }[];
54
+ /** Whether the question on screen is one whose answer must never be rendered. */
55
+ export declare function isSecretStep(state: WizardState): boolean;
56
+ /**
57
+ * Honest step numbering: walk the flow the same way it will actually be asked, so a keyless
58
+ * preset shrinks the total rather than leaving a count that quietly stops being true.
59
+ */
60
+ export declare function stepCounts(state: WizardState): {
61
+ readonly asked: number;
62
+ readonly total: number;
63
+ };
64
+ export type WizardAction = {
65
+ readonly kind: "edit";
66
+ readonly intent: Intent;
67
+ } | {
68
+ readonly kind: "list";
69
+ readonly intent: ListIntent;
70
+ } | {
71
+ readonly kind: "commit";
72
+ } | {
73
+ readonly kind: "back";
74
+ } | {
75
+ readonly kind: "abort";
76
+ };
77
+ export declare function reduceWizard(state: WizardState, action: WizardAction): WizardState;
78
+ /**
79
+ * What a secret looks like on screen.
80
+ *
81
+ * Enough to recognise a paste went in, never enough to reconstruct. Short values show nothing at
82
+ * all rather than most of themselves.
83
+ */
84
+ export declare function maskSecret(value: string): string;
85
+ /** The confirm screen's rows, shared with the plain path's wording. */
86
+ export declare function summaryRows(state: WizardState): readonly {
87
+ readonly label: string;
88
+ readonly value: string;
89
+ }[];
90
+ /** The ✓ lines above the current question. */
91
+ export declare function answeredRows(state: WizardState): readonly {
92
+ readonly label: string;
93
+ readonly value: string;
94
+ }[];
95
+ //# sourceMappingURL=wizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../../src/lib/wizard.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * The product name, drawn large, from a glyph grid.
3
+ *
4
+ * ## Why a grid and not a string
5
+ *
6
+ * Hard rule 3: no brand strings outside `brand.ts`, so that a rename is one commit. An ASCII wordmark is
7
+ * a brand string — a literal one would be the single largest violation in the tree. So this renders
8
+ * whatever `BRAND.name` happens to say, from a table of letters, and a rename changes nothing here.
9
+ *
10
+ * ## The research, and what it settled
11
+ *
12
+ * Three findings shaped this. **5×5 pixels is the floor** for a legible Latin glyph without
13
+ * anti-aliasing, so that is the grid. **A width-aware fallback is mandatory rather than polish** — the
14
+ * big figlet faces (`big`, `ansi-shadow`) pass 120 columns on a nine-letter word, and this CLI's floor is
15
+ * 40. And **half-blocks are the density trick**: one character cell per pixel renders a 5×5 glyph tall and
16
+ * thin, because a cell is roughly 1:2, while packing two pixel rows into one cell with `▀▄█` brings it
17
+ * back to nearly square.
18
+ *
19
+ * A third-party font was the obvious shortcut and is not taken: embedding `.flf` data or another
20
+ * project's bitmap into an Apache-2.0 repo buys a licence question, and 26 letters are verifiable by
21
+ * rendering them.
22
+ *
23
+ * ## One table, four renderings
24
+ *
25
+ * The tiers are parameter changes over the same grid — how many columns a pixel occupies, and whether
26
+ * rows are packed — not four codepaths:
27
+ *
28
+ * | tier | pixel | rows | nine letters |
29
+ * | --- | --- | --- | --- |
30
+ * | `wide` | 2 columns | 5 | 106 columns |
31
+ * | `block` | 1 column | 5 | 53 columns |
32
+ * | `half` | 1 column | 3 | 53 columns |
33
+ * | `plain` | — | 1 | as wide as the name |
34
+ *
35
+ * `plain` is the floor and always fits, because it is the name with spaces in it and gets clipped like
36
+ * any other line. A screen too small for that is a screen with no wordmark, which is a real answer.
37
+ *
38
+ * Pure: text and a size in, lines out. Colour is the component's business.
39
+ */
40
+ export type WordmarkTier = "wide" | "block" | "half" | "plain";
41
+ export interface Wordmark {
42
+ readonly lines: readonly string[];
43
+ readonly tier: WordmarkTier;
44
+ /** Code points in the widest line, so a caller can centre it without measuring. */
45
+ readonly width: number;
46
+ }
47
+ /** Letters this module can draw. A name containing anything else falls back to `plain`. */
48
+ export declare function drawable(text: string): boolean;
49
+ /**
50
+ * The largest wordmark that fits, and how it was drawn.
51
+ *
52
+ * Degrades on both axes, because a splash is constrained by both: a 40-column terminal has no room for the
53
+ * grid at any packing, and an 8-row one has no room for five rows of anything. Trailing blank space is
54
+ * trimmed from each line so a caller centring on `width` centres the ink rather than the padding.
55
+ */
56
+ export declare function wordmark(text: string, space: {
57
+ readonly columns: number;
58
+ readonly rows: number;
59
+ }): Wordmark;
60
+ //# sourceMappingURL=wordmark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordmark.d.ts","sourceRoot":"","sources":["../../src/lib/wordmark.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AA4DH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;AAE9D,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACzB;AAED,2FAA2F;AAC3F,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9C;AAyDD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACpB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC3D,QAAQ,CAwBV"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Breaking text into the rows a fixed-width window will draw.
3
+ *
4
+ * ## One wrapping, ours
5
+ *
6
+ * This module used to count rows the way a terminal does — divide the character count by the width — and
7
+ * hand the text to Ink to wrap. Those are two different answers to one question, and the difference is not
8
+ * academic: Ink breaks at spaces, so 240 characters at 80 columns is **four** rows to Ink and three to a
9
+ * division. Every cap built on the division was therefore one row short of what appeared on screen, which
10
+ * on the alternate buffer is a frame taller than the terminal.
11
+ *
12
+ * So the rule is that whoever owns a bounded window wraps the text itself and renders each row with
13
+ * `wrap="truncate"`. The count is then the count, by construction, and a frame test asserts it against a
14
+ * real render rather than trusting the arithmetic.
15
+ *
16
+ * Tabs are expanded to spaces on the way through. A tab's width is the terminal's business and not ours,
17
+ * so a row containing one cannot be measured — expanding it is the only way the number we counted is the
18
+ * number drawn. It changes bytes, never meaning, which is the line decision 4.27 draws.
19
+ */
20
+ /**
21
+ * One drawn row, and which source characters it drew.
22
+ *
23
+ * The offsets exist because a row's text is **not** a slice of its line. Breaking at a space consumes
24
+ * the space, a word longer than the window is cut, and a hanging indent is re-applied to rows that never
25
+ * contained it — so "which row is source offset 41 on, and at what column" cannot be recovered from the
26
+ * strings afterwards. Anything that draws a caret over wrapped text needs exactly that, and computing it
27
+ * a second time from the finished rows is how a cursor ends up a column out on the lines that wrapped.
28
+ */
29
+ export interface WrappedRow {
30
+ /** Exactly what is painted, the re-applied indent included. */
31
+ readonly text: string;
32
+ /** Columns of `text` that are indent. A caret never lands to the left of this. */
33
+ readonly lead: number;
34
+ /** Source code-point offset of this row's first drawn character. */
35
+ readonly from: number;
36
+ /** One past this row's last drawn character. A break at a space leaves a gap before the next `from`. */
37
+ readonly to: number;
38
+ }
39
+ /**
40
+ * One logical line, broken at spaces to fit `columns`, with the source offsets kept.
41
+ *
42
+ * A word longer than the whole width is cut rather than allowed to overflow — a URL or a base64 blob is
43
+ * the normal case for that, and there is nowhere better to break it. Returns one row for an empty line,
44
+ * because a blank line in a reply is a blank row on screen and dropping it would close up paragraphs the
45
+ * model deliberately separated.
46
+ */
47
+ export declare function wrapRows(line: string, columns: number): readonly WrappedRow[];
48
+ /** A code-point column in `line` translated into the tab-expanded coordinates `wrapRows` reports. */
49
+ export declare function expandColumn(line: string, column: number): number;
50
+ /** Every row `text` occupies at `columns`, newlines respected and long lines broken. */
51
+ export declare function wrapText(text: string, columns: number): readonly string[];
52
+ /**
53
+ * The live pane: the rows to draw, how tall that makes it, and how much was dropped.
54
+ *
55
+ * Height-capped on purpose. Ink erases and redraws its whole dynamic tree per frame, so an uncapped pane
56
+ * means redrawing the entire reply on every token — a cost that grows with the length of the answer,
57
+ * precisely when the terminal is busiest. The newest rows are the ones kept, because they are what the
58
+ * reader is looking at, and nothing is lost: the finished reply joins the transcript at `turn.end`.
59
+ *
60
+ * All three numbers from one wrap, because they were computed separately and disagreed. The component
61
+ * needs the rows and the dropped count; the chat frame needs the height to subtract from the terminal
62
+ * *before* the pane renders. Deriving them apart meant the notice's own row was counted by one caller and
63
+ * not the other, which is a layout one row taller than the screen.
64
+ */
65
+ export interface LivePane {
66
+ /** What to draw, newest last. Already wrapped, so each is one row. */
67
+ readonly lines: readonly string[];
68
+ /** Rows the pane occupies, the "… n hidden" notice included. Zero when there is nothing to show. */
69
+ readonly rows: number;
70
+ /** Rows dropped off the top. Non-zero is exactly the condition for drawing the notice. */
71
+ readonly hidden: number;
72
+ }
73
+ export declare function livePane(text: string, columns: number, maxRows: number): LivePane;
74
+ //# sourceMappingURL=wrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../../src/lib/wrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACvB,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,kFAAkF;IAClF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wGAAwG;IACxG,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,UAAU,EAAE,CAyG7E;AAMD,qGAAqG;AACrG,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOjE;AAED,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAEzE;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,QAAQ;IACrB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,oGAAoG;IACpG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,0FAA0F;IAC1F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAC1B;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,QAAQ,CAUjF"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `memory` — search what the agent remembers, or rebuild the index from the files.
3
+ *
4
+ * Both actions are questions about the **index**, not about the files: the files are canonical and a
5
+ * person can already read them with `cat`. What they cannot see is what the retriever would return for
6
+ * a given question, which is the only thing that decides whether a fact reaches the model.
7
+ *
8
+ * ## Why search does not apply the threshold
9
+ *
10
+ * A turn applies `memory.threshold` and injects what clears it. A person running this is usually asking
11
+ * the opposite question — *why did it not recall that?* — and a floor that hid the near-misses would
12
+ * make the command useless for exactly that. So everything ranked is printed, with the ones below the
13
+ * floor marked and excluded from the count. `--all` is therefore about *widening the candidate set*,
14
+ * not about revealing something withheld.
15
+ *
16
+ * The carried file is included for the same reason. A note saved a minute ago is still in `MEMORY.md`
17
+ * and is deliberately excluded from slot 7 — so "still in MEMORY.md, which is why it is not under
18
+ * Remembered" is a real and useful answer that a search hiding it could never give.
19
+ *
20
+ * Neither Ink nor React is imported here: this is a report, and the lazy-Ink boundary is what keeps
21
+ * every non-interactive command under a tenth of a second.
22
+ */
23
+ import type { MemoryOptions } from "#lib/schema";
24
+ export declare function memoryCommand(options: MemoryOptions): Promise<number>;
25
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAQH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAKhD,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CA6J3E"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * `model probe` — ask the endpoint what it can actually do, instead of guessing from its name.
3
+ *
4
+ * Every `init` preset's default model has an unverified context window and nothing has ever said so.
5
+ * `deepseek-v4-pro` is declared at 393,216 against a published 1,048,576, and `claude-*` is one
6
+ * registry row for every Claude model ever released.
7
+ *
8
+ * The third suspicion this was built on turned out to be wrong, which is worth keeping written down:
9
+ * `promptCache: "none"` on every `deepseek-*` row looked like a cost bug, and the registry comment
10
+ * beside those rows had already answered it — the field says the *runtime* places no breakpoints, not
11
+ * that the provider does not cache. The first live run measured 1024 of 1115 prompt tokens cached, so
12
+ * the comment was right and the alarm was not. Nothing in core reads the field at all today; its only
13
+ * consumer is a line of `validate`'s output.
14
+ *
15
+ * ## What it costs, and why the order is what it is
16
+ *
17
+ * Two of the four techniques are free. `GET /models` is a metadata read. The over-range `max_tokens`
18
+ * request is **refused before a token is generated**, so it is billed for nothing — which is what
19
+ * makes it the best technique here rather than merely a clever one: it asks the endpoint to state its
20
+ * own limit and the endpoint answers in the error message.
21
+ *
22
+ * The caching probe sends two small calls, and is the only way to answer a question no endpoint
23
+ * exposes directly. The window search is behind `--window` because it is the one that spends real
24
+ * money, and it prints what it will spend before it spends it.
25
+ *
26
+ * ## Every role, not just main
27
+ *
28
+ * An agent can run three models on three endpoints, and until Phase 7D only main's window was
29
+ * reported anywhere at all. A compactor quietly running on `CONSERVATIVE`'s 8,192 is the configuration
30
+ * decision 12.x calls *"the intended production shape and usually the biggest available cost win"*, so
31
+ * it is exactly the one that must not be silently wrong. Roles that fall back to main are skipped
32
+ * rather than probed twice — they are the same endpoint and the same model.
33
+ */
34
+ export interface ModelOptions {
35
+ readonly manifestPath: string;
36
+ readonly window: boolean;
37
+ /** Dollars per million input tokens, for the one arithmetic step this cannot know. */
38
+ readonly price?: number;
39
+ readonly write: boolean;
40
+ /** Skip the `--window` spend prompt. Never widens anything else. */
41
+ readonly yes: boolean;
42
+ readonly json: boolean;
43
+ /** Injected by tests. Production passes nothing and gets the global. */
44
+ readonly fetch?: typeof globalThis.fetch;
45
+ }
46
+ export declare function modelCommand(options: ModelOptions): Promise<number>;
47
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAoDH,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,sFAAsF;IACtF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,oEAAoE;IACpE,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,wEAAwE;IACxE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAC3C;AAiTD,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CA0HzE"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `plugins` — what an agent's `plugins:` actually loaded.
3
+ *
4
+ * The surface decision 7.5 promised: `permissions` is advisory vocabulary, recorded and **surfaced**,
5
+ * and a vocabulary nobody can read is a vocabulary nobody declares accurately. So this prints the
6
+ * declarations beside what each plugin registered, which together answer the only two questions
7
+ * worth asking of a plugin list — what did naming this buy me, and what did it ask for.
8
+ *
9
+ * Built as a command rather than a line in `validate` because the answer is per agent and includes
10
+ * timing: `plugin.loaded` fires during boot, before anything can subscribe, so the runtime carries
11
+ * the report and this reads it.
12
+ */
13
+ import type { PluginsOptions } from "#lib/schema";
14
+ export declare function pluginsCommand(options: PluginsOptions): Promise<number>;
15
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAeH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAgE7E"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * `remove <agent>` — the mirror of `init`.
3
+ *
4
+ * `init` creates a sandbox agent: a directory, a manifest, a workspace, an `.env`. Everything after
5
+ * that scatters — sessions and memory into one shared `store.db` keyed by manifest id, logs into
6
+ * `logs/<id>.*.log`, a LaunchAgent under `<slug>.agent.<id>`, a lease row while it runs. Nothing put
7
+ * those back together, so deleting an agent meant `rm -rf` plus knowledge nobody has, and the rows
8
+ * left behind were unreachable: `LeaseStore.orphans` sees ids with *running* turns and no lease, which
9
+ * cannot see an agent whose directory was deleted while it was idle.
10
+ *
11
+ * ## Only the sandbox
12
+ *
13
+ * A ref, never a path. `run` accepts `./somewhere/agent.yaml` because running a manifest in place is a
14
+ * real thing to want; deleting one is not — a directory somebody pointed at is theirs to remove, and a
15
+ * command that recursively deletes an arbitrary argument is one bad tab-completion from being the worst
16
+ * thing in this repository. A path is refused, by name, with `rm -rf` named as the honest alternative.
17
+ *
18
+ * ## Show, then require the name typed back
19
+ *
20
+ * `--dry-run` and the confirmation print the *same* listing from the same function, so what a dry run
21
+ * shows is what a real run does. The bar is the agent's name typed back rather than a keypress: `y`
22
+ * against the wrong listing is one keystroke from deleting conversations that cannot be recovered, and
23
+ * the listing exists on the assumption somebody reads it. Not a TTY means no, so a piped run without
24
+ * `--yes` deletes nothing and says so.
25
+ *
26
+ * ## The order is the safety
27
+ *
28
+ * Stop, then unload the service, then rows, then logs, then the directory — see `removalSteps` for why
29
+ * each of those is where it is. The short version: every step but the last is recoverable, and the
30
+ * directory is the only part that is not.
31
+ */
32
+ import { type Exec } from "#lib/service";
33
+ export interface RemoveOptions {
34
+ /** The sandbox directory name. Absent only with `--prune` or `--all`. */
35
+ readonly ref?: string;
36
+ readonly dryRun?: boolean;
37
+ /** Delete the directory only; leave the store, the logs and the service alone. */
38
+ readonly filesOnly?: boolean;
39
+ /** Rows and logs no sandbox directory claims. */
40
+ readonly prune?: boolean;
41
+ readonly all?: boolean;
42
+ readonly yes?: boolean;
43
+ readonly json?: boolean;
44
+ readonly store?: string;
45
+ /** Test seams. Nothing in `src/` outside this file passes them. */
46
+ readonly exec?: Exec;
47
+ readonly platform?: string;
48
+ /** Injected so the prompt is testable, and so `--yes` can bypass it without a fake TTY. */
49
+ readonly confirm?: (question: string, expected: string) => Promise<boolean>;
50
+ }
51
+ export declare function removeCommand(options: RemoveOptions): Promise<number>;
52
+ //# sourceMappingURL=remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../src/remove.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAmBH,OAAO,EAAE,KAAK,IAAI,EAA8C,MAAM,cAAc,CAAA;AAYpF,MAAM,WAAW,aAAa;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB,kFAAkF;IAClF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,mEAAmE;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;IACpB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,2FAA2F;IAC3F,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC9E;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB3E"}
package/dist/run.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The `run` command. Two renderers, one setup.
3
+ *
4
+ * The rich path is the Ink app; the plain path is line-oriented and writes tokens to stdout as they
5
+ * arrive. Which one runs is decided once, by `resolveMode`, and never re-decided mid-process.
6
+ *
7
+ * **Ink is imported lazily, and only on the rich path.** Measured: `react` + `ink` cost ~65 ms to
8
+ * import under Bun and ~170-210 ms under Node, against a ~70 ms total runtime for `validate --json`.
9
+ * A static import at the top of this file would be paid by every invocation of every command, so the
10
+ * dynamic `import()` below is load-bearing rather than stylistic. A test asserts it stays that way.
11
+ *
12
+ * The plain path keeps Phase 1's behaviour deliberately unchanged, including the Ctrl-C contract and
13
+ * the streaming writes, because both were verified against a real endpoint and a real SIGINT.
14
+ */
15
+ import type { RunOptions } from "#lib/schema";
16
+ export declare function runCommand(options: RunOptions): Promise<number>;
17
+ /**
18
+ * Which conversation this run belongs to, or an exit code if the answer is "none".
19
+ *
20
+ * Three inputs, and the contradictory pair is refused rather than ranked. `--continue --session x` says
21
+ * both "the most recent one" and "this one"; picking a winner would silently ignore half of what was
22
+ * typed, and there is no reading of it that is obviously intended.
23
+ *
24
+ * The default is a **new** key. That is the behaviour change: every run used to land in `local:default`,
25
+ * so an agent's store was one unbroken transcript and this morning's question was conditioned on
26
+ * yesterday's debugging. It applies to `--input` too, which makes a scripted one-shot stateless unless it
27
+ * names a session — deliberately, because a one-shot that quietly accumulated history grows its own
28
+ * context until compaction starts thrashing, and `--session` is right there for the case somebody wants
29
+ * the thread.
30
+ */
31
+ export interface ResolvedSession {
32
+ readonly sessionKey: string;
33
+ /**
34
+ * The key was generated for this run, so there is nothing behind it.
35
+ *
36
+ * Carried rather than re-derived from a message count, because the two answers differ: a conversation
37
+ * that was resumed and then cleared has no messages and is not new. This is what puts the splash in
38
+ * front of a new conversation and keeps it away from a resumed one.
39
+ */
40
+ readonly fresh: boolean;
41
+ }
42
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAiDH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAiH7C,wBAAsB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAwPrE;AA8HD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAC1B"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The `schedules` command — what is scheduled, when it fires next, and whether the last run worked.
3
+ *
4
+ * **It reads, enables and disables. It does not write a schedule.** Creating one here would be a
5
+ * third writer beside the manifest and the API, each with its own idea of a valid expression, and
6
+ * the manifest is where a schedule belongs — it survives a rebuild and shows up in a diff. What the
7
+ * CLI adds is the two questions a file cannot answer: when this actually fires next, and how the
8
+ * last run went.
9
+ *
10
+ * The distinction the listing exists to make is the one `status` had to learn: **running and working
11
+ * are different questions.** A schedule can be perfectly configured, listed, enabled, and silently
12
+ * failing every night — so `LAST` carries the outcome, not just the time.
13
+ */
14
+ import type { SchedulesOptions } from "#lib/schema";
15
+ /** One address this agent has actually been reached on, and can therefore deliver to. */
16
+ export interface Recipient {
17
+ readonly channelId: string;
18
+ readonly address: string;
19
+ readonly lastSeen: string;
20
+ }
21
+ /**
22
+ * Addresses `deliver.to` can name, derived from sessions this agent has actually had.
23
+ *
24
+ * **Observed, never guessed.** The alternative — asking the transport to resolve a handle — is the
25
+ * thing that cannot work: Telegram will not tell a bot the chat id behind an `@name`, and a private
26
+ * chat has no other address. What the store holds is the id a real inbound message arrived on, which
27
+ * is the one value known to route.
28
+ *
29
+ * Filtered to *declared channel ids*, so `local`, `api` and `schedule` sessions are left out. They
30
+ * are sessions and they are not places a reply can be sent, and listing them under a heading that
31
+ * says "what deliver.to takes" would be four wrong answers beside one right one.
32
+ *
33
+ * Pure, and takes plain rows rather than a store, so the shaping is testable without a runtime.
34
+ */
35
+ export declare function recipientsFrom(sessions: readonly {
36
+ readonly channel: string;
37
+ readonly peerId: string;
38
+ readonly lastActivityAt: string;
39
+ }[], channelIds: readonly string[]): readonly Recipient[];
40
+ export declare function schedulesCommand(options: SchedulesOptions): Promise<number>;
41
+ //# sourceMappingURL=schedules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../src/schedules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AA0FnD,yFAAyF;AACzF,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC1B,QAAQ,EAAE,SAAS;IACf,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAClC,EAAE,EACH,UAAU,EAAE,SAAS,MAAM,EAAE,GAC9B,SAAS,SAAS,EAAE,CAuBtB;AAkCD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoGjF"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The `serve` command: `<binary> serve <manifest> [--port N] [--host H]`.
3
+ *
4
+ * Boots a runtime with channels started, binds the HTTP surface, and stays up until interrupted.
5
+ * The only long-running command in the binary, and the only one that opens a listening socket.
6
+ *
7
+ * **Channels start here and nowhere else.** `run` constructs the same runtime with
8
+ * `startChannels: false`, because a REPL that silently began answering Telegram messages while you
9
+ * typed at it would be a surprise, and a one-shot `run --input` that opened a long-poll would hang
10
+ * on exit. The flag decides *whether*, never *when* — either way nothing connects before
11
+ * `runtime.ready`.
12
+ *
13
+ * No Ink. A server writes lines to stdout and is very often not attached to a terminal at all; a
14
+ * rendering framework on this path would cost more than the whole command and produce escape codes
15
+ * in a log file.
16
+ */
17
+ export interface ServeOptions {
18
+ /**
19
+ * Zero or more manifests. The process hosts every agent they produce.
20
+ *
21
+ * Plural since 16.2a: decision 8.5 has said "one process hosts N agents" since the beginning
22
+ * and core was built that way — `RuntimeOptions.agents` is already an array — so a single path
23
+ * here was the only thing pinning the product to one agent.
24
+ *
25
+ * **Empty means the sandbox's agents**, which is what the service unit runs and what makes the
26
+ * product always-on: a host that has to be told which agents to serve cannot serve one that was
27
+ * provisioned after it started. Naming manifests is the container's shape, where the agent
28
+ * arrives on a mount and the sandbox is not the inventory.
29
+ */
30
+ readonly manifestPaths: readonly string[];
31
+ readonly port?: number;
32
+ readonly host?: string;
33
+ readonly store?: string;
34
+ /** Print a one-time claim even when a key already exists. The lockout escape. */
35
+ readonly claim?: boolean;
36
+ readonly json?: boolean;
37
+ }
38
+ export declare function serveCommand(options: ServeOptions): Promise<number>;
39
+ /** Re-exported for the boundaries test, which asserts this module imports no renderer. */
40
+ export declare const SERVE_EXIT_FAILURE = 1;
41
+ //# sourceMappingURL=serve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAgCH,MAAM,WAAW,YAAY;IACzB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,iFAAiF;IACjF,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAC1B;AAcD,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CA0ezE;AAqBD,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,IAAe,CAAA"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The `sessions` command — inspect what the store holds.
3
+ *
4
+ * This exists to make persistence observable from outside the process that wrote it. A store you
5
+ * cannot look into is a store you cannot debug, and "the history is in there somewhere" is not a
6
+ * claim anyone should have to take on faith.
7
+ *
8
+ * It opens the same database the chat session uses, which is safe while a turn is running: the driver
9
+ * puts the file in WAL mode, so a reader does not block a writer.
10
+ */
11
+ import type { SessionsOptions } from "#lib/schema";
12
+ export declare function sessionsCommand(options: SessionsOptions): Promise<number>;
13
+ //# sourceMappingURL=sessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../src/sessions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAoIlD,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAqE/E"}