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,21 @@
1
+ /**
2
+ * The slash-command list, above the prompt.
3
+ *
4
+ * Opens as soon as `/` is typed and narrows as the word is completed, which is what makes the whole
5
+ * command surface discoverable without a manual. Deliberately the same shape as `HistorySearch`: matches
6
+ * above the input, ↑↓ to move, tab to complete, enter to run, esc to close. One interaction learned once
7
+ * and used by both, because a terminal app that invents a second list idiom for its second list is the
8
+ * inconsistency this phase set out to remove.
9
+ *
10
+ * Controlled and presentational. The entries come from `lib/palette.ts` — generated from the CLI's own
11
+ * command table — and the cursor lives in the screen root; this owns no keyboard.
12
+ */
13
+ import type { Palette as PaletteModel } from "#lib/palette";
14
+ export interface PaletteProps {
15
+ readonly palette: PaletteModel;
16
+ readonly index: number;
17
+ readonly width: number;
18
+ readonly maxRows: number;
19
+ }
20
+ export declare function Palette({ palette, index, width, maxRows }: PaletteProps): import("react").JSX.Element;
21
+ //# sourceMappingURL=Palette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Palette.d.ts","sourceRoot":"","sources":["../../src/components/Palette.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,cAAc,CAAA;AAI3D,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAC3B;AAOD,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,YAAY,+BAgDvE"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The agent picker: bare `run` at a terminal, one keystroke from any sandbox agent.
3
+ *
4
+ * One `useInput` over the pure list keymap and select reducer; the kit renders. Broken agents
5
+ * are listed with their problem — dim, unselectable-looking but still runnable, because a person
6
+ * debugging a manifest wants to reach it, not to be protected from it.
7
+ */
8
+ import type { SandboxAgent } from "#lib/sandbox";
9
+ export type PickerResult = {
10
+ readonly kind: "run";
11
+ readonly manifestPath: string;
12
+ } | {
13
+ readonly kind: "create";
14
+ } | {
15
+ readonly kind: "quit";
16
+ };
17
+ export interface PickerProps {
18
+ readonly title: string;
19
+ readonly agents: readonly SandboxAgent[];
20
+ readonly onDone: (result: PickerResult) => void;
21
+ }
22
+ export declare function Picker({ title, agents, onDone }: PickerProps): import("react").JSX.Element;
23
+ //# sourceMappingURL=Picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../src/components/Picker.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAIhD,MAAM,MAAM,YAAY,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/B,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;IACxC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;CAClD;AAED,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,WAAW,+BAwD5D"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The composer — a rounded box that grows with the message, accent-bordered when ready and muted while
3
+ * a turn runs.
4
+ *
5
+ * Ink has no text field: it delivers keystrokes and nothing else, so the cursor is drawn rather than
6
+ * positioned. `LineCursor` owns that rendering for this component and the wizard's fields alike, which
7
+ * is why the prompt glyph is handed to it as a `gutter` rather than rendered here beside it — a glyph
8
+ * drawn here would sit next to the *block* of lines, leaving the second line of a message starting one
9
+ * column to its left and reading as a separate message.
10
+ *
11
+ * The box caps at `MAX_INPUT_ROWS` and scrolls to follow the cursor. Same reasoning as the live pane:
12
+ * this is Ink's dynamic region, erased and redrawn every frame, so an unbounded box redraws a pasted
13
+ * document on every keystroke — and a long paste would push the conversation off the screen.
14
+ *
15
+ * The border exists only where Ink renders: the plain path never mounts this, so plain parity is
16
+ * untouched by definition.
17
+ */
18
+ import type { PromptProps } from "#lib/schema";
19
+ export declare function Prompt({ editor, busy, placeholder, columns }: PromptProps): import("react").JSX.Element;
20
+ //# sourceMappingURL=Prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../src/components/Prompt.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAI9C,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,WAAW,+BA0CzE"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The frame every surface renders inside: header, body, footer.
3
+ *
4
+ * Replaces the three hand-rolled banners that came before it. `Banner` stays for what it is good at —
5
+ * a title and some dim lines — and this composes it with the two things every screen also needed and
6
+ * each solved separately: a live state row, and a footer saying what the keys do.
7
+ *
8
+ * ## It measures the terminal itself
9
+ *
10
+ * Width comes from `useTerminalSize()` rather than from a prop. The alternative was tried and is what
11
+ * shipped in Phase 5: the caller measured once, passed numbers down, and a resized terminal left
12
+ * every row laid out for a width that no longer existed. A component that reads the size cannot
13
+ * forget to, and there is exactly one hook doing it.
14
+ *
15
+ * The clamps stay the kit's rather than the measurement's, because they are policy — 40 columns is
16
+ * where a description column stops being worth having, 140 is where a description stops belonging on
17
+ * the same line as its name. They are applied to the *live* value here.
18
+ *
19
+ * ## No input, no exit
20
+ *
21
+ * Presentational, like every component in this kit: it renders what it is given and owns no keyboard.
22
+ * The focused surface owns the single `useInput`, and this is never it.
23
+ */
24
+ import type { ReactNode } from "react";
25
+ import { type KeyHint, type ScreenHeader } from "#lib/screen";
26
+ export interface ScreenProps {
27
+ readonly header: ScreenHeader;
28
+ readonly footer?: readonly KeyHint[];
29
+ /**
30
+ * Optional: a screen whose whole content is its header is a real screen — a one-line report, or a
31
+ * list that came back empty. Required, it also made `createElement(Screen, props, body)` a type
32
+ * error, because the third argument is not matched against a mandatory `children` prop.
33
+ */
34
+ readonly children?: ReactNode;
35
+ }
36
+ /** The live columns, clamped. Exported so a body lays its rows out against the same number. */
37
+ export declare function screenWidth(columns: number): number;
38
+ export declare function Screen({ header, footer, children }: ScreenProps): import("react").JSX.Element;
39
+ //# sourceMappingURL=Screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../src/components/Screen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,EAIH,KAAK,OAAO,EACZ,KAAK,YAAY,EAEpB,MAAM,aAAa,CAAA;AAGpB,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;IACpC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAChC;AAoBD,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW,+BA4D/D"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * An arrow-key select list: ❯ on the selected row, hints dim, optional numbering.
3
+ *
4
+ * Controlled and presentational — `index` comes from the parent's reducer (`lib/select.ts`), and values
5
+ * stay with the parent, which maps the index back to its own data. This component never listens to input;
6
+ * the screen root owns the single `useInput`.
7
+ *
8
+ * ## Windowing
9
+ *
10
+ * `maxRows` is not decoration. This rendered every item it was given, which was fine for a sandbox of
11
+ * three agents and is not fine for a store with fifty conversations: on the alternate screen a list taller
12
+ * than the terminal pushes the frame apart, and there is no scrollback to recover it from. It windows
13
+ * through `viewport` — the same function the composer and the catalogue use, because "keep the selected
14
+ * row visible" is one rule and not three.
15
+ *
16
+ * Numbering stays **absolute** while windowed. A digit jumps the cursor by absolute index, so numbering
17
+ * the visible rows 1..n would make `3` mean a different row depending on where the window sat. The
18
+ * consequence, stated: digits reach the first nine rows and the arrows reach the rest.
19
+ */
20
+ export interface SelectItem {
21
+ readonly label: string;
22
+ /** Dim, after the label — a model id, a relative time, a one-line description. */
23
+ readonly hint?: string;
24
+ }
25
+ export interface SelectListProps {
26
+ readonly items: readonly SelectItem[];
27
+ readonly index: number;
28
+ /** `1.`-style prefixes; digits then jump the cursor (they never choose). */
29
+ readonly numbered?: boolean;
30
+ /** Visible rows before the list scrolls to follow the selection. Unbounded when omitted. */
31
+ readonly maxRows?: number;
32
+ }
33
+ export declare function SelectList({ items, index, numbered, maxRows }: SelectListProps): import("react").JSX.Element;
34
+ //# sourceMappingURL=SelectList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectList.d.ts","sourceRoot":"","sources":["../../src/components/SelectList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,kFAAkF;IAClF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAA;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,eAAe,+BAoD9E"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Which conversation to pick up — a bare `--session`, and the in-session `/sessions` switcher.
3
+ *
4
+ * A view under the Phase 5.5 contract: it never mounts itself, never calls `useApp().exit()`, and reports
5
+ * through `onDone`. Two hosts use it, which is the point — `run` mounts it before the chat exists, and the
6
+ * chat opens it as a pane — and neither is visible from here.
7
+ *
8
+ * `focused` gates the `useInput`, because Ink fires **every** active hook: a picker over a live prompt
9
+ * would otherwise have two surfaces reading one keystroke, which is a wrong action rather than a
10
+ * rendering fault.
11
+ */
12
+ import { type SessionRowSource } from "#lib/sessions-view";
13
+ export interface SessionPickerProps {
14
+ readonly sessions: readonly SessionRowSource[];
15
+ /** Injected so the "3h ago" column is deterministic in a frame test. */
16
+ readonly now: number;
17
+ readonly columns: number;
18
+ readonly maxRows: number;
19
+ /** The session currently in use, marked so switching away from it is a deliberate choice. */
20
+ readonly current?: string;
21
+ readonly focused?: boolean;
22
+ /** A key to use, or `undefined` for "leave things as they are". */
23
+ readonly onDone: (sessionKey: string | undefined) => void;
24
+ }
25
+ export declare function SessionPicker({ sessions, now, columns, maxRows, current, focused, onDone, }: SessionPickerProps): import("react").JSX.Element;
26
+ //# sourceMappingURL=SessionPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SessionPicker.d.ts","sourceRoot":"","sources":["../../src/components/SessionPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,EAAmB,KAAK,gBAAgB,EAAe,MAAM,oBAAoB,CAAA;AAGxF,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAC9C,wEAAwE;IACxE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAA;CAC5D;AAED,wBAAgB,aAAa,CAAC,EAC1B,QAAQ,EACR,GAAG,EACH,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAc,EACd,MAAM,GACT,EAAE,kBAAkB,+BAsDpB"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The skills catalogue: fetch, tick, pick an agent, install, and say what happened — in one mount.
3
+ *
4
+ * ## Why the whole lifecycle is in here
5
+ *
6
+ * The first version did only the ticking. The command fetched the catalogue *before* mounting and
7
+ * printed the report *after* unmounting, so four of the five phases of the bare `skills` command were plain
8
+ * `process.stdout.write`: a twenty-second clone with no spinner, then a picker, then a wall of text.
9
+ * termheat's `App.tsx` is the shape this follows instead — mount, then load inside an effect, with the
10
+ * wait rendered rather than printed.
11
+ *
12
+ * `load` and `install` arrive as async props, so the view reaches no filesystem and starts no process.
13
+ * That is what keeps it renderable in a frame test; the host supplies both.
14
+ *
15
+ * ## The view contract
16
+ *
17
+ * It never mounts itself and never calls `useApp().exit()`. It reports through `onDone` and the host
18
+ * decides what that means — unmount, for a command; close the pane, for the chat. `focused` gates the
19
+ * one `useInput`, because Ink delivers input to *every* active hook, so a pane over a live prompt would
20
+ * otherwise have both reading the same keystroke.
21
+ */
22
+ import type { BrowseRow, InstallReport } from "#lib/browse";
23
+ import type { SandboxAgent } from "#lib/sandbox";
24
+ import type { CatalogueEntry } from "#lib/source-cache";
25
+ export interface SkillBrowserProps {
26
+ /** Fetch the catalogue, reporting progress. Called once, inside the mount. */
27
+ readonly load: (onStatus: (line: string) => void) => Promise<readonly BrowseRow[]>;
28
+ readonly install: (skills: readonly CatalogueEntry[], manifestPath: string) => Promise<InstallReport>;
29
+ readonly agents: readonly SandboxAgent[];
30
+ /** Install into this manifest and never ask which agent — for a host that already knows. */
31
+ readonly target?: string;
32
+ /** Whether this surface has the keyboard. A pane over a live prompt must not share it. */
33
+ readonly focused?: boolean;
34
+ /** Nothing left to do here. The host owns the exit. */
35
+ readonly onDone: (report: InstallReport | undefined) => void;
36
+ readonly title: string;
37
+ }
38
+ export declare function SkillBrowser({ load, install, agents, target, focused, onDone, title, }: SkillBrowserProps): import("react").JSX.Element;
39
+ //# sourceMappingURL=SkillBrowser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillBrowser.d.ts","sourceRoot":"","sources":["../../src/components/SkillBrowser.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAUH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAI3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGvD,MAAM,WAAW,iBAAiB;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,KAAK,OAAO,CAAC,SAAS,SAAS,EAAE,CAAC,CAAA;IAClF,QAAQ,CAAC,OAAO,EAAE,CACd,MAAM,EAAE,SAAS,cAAc,EAAE,EACjC,YAAY,EAAE,MAAM,KACnB,OAAO,CAAC,aAAa,CAAC,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;IACxC,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAA;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACzB;AAWD,wBAAgB,YAAY,CAAC,EACzB,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAc,EACd,MAAM,EACN,KAAK,GACR,EAAE,iBAAiB,+BAyPnB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A braille spinner with a label. Ten glyphs from the theme, not a dependency (decision 11.10).
3
+ *
4
+ * The one kit component with its own state — the frame index — because animation is presentation,
5
+ * not application state. Callers pair it with `useElapsed` when a count-up matters (the picker's
6
+ * boot transition); it is deliberately not used in the init wizard, whose write-and-validate
7
+ * completes in single-digit milliseconds and would only flash.
8
+ */
9
+ export interface SpinnerProps {
10
+ readonly label: string;
11
+ }
12
+ export declare function Spinner({ label }: SpinnerProps): import("react").JSX.Element;
13
+ //# sourceMappingURL=Spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/components/Spinner.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACzB;AAED,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,YAAY,+BAe9C"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * One line saying what the runtime is doing.
3
+ *
4
+ * It exists to answer a question the old REPL could not: is this slow or is it hung? A model that
5
+ * takes twelve seconds before its first token and a model that will never answer look identical
6
+ * without an elapsed counter, and "nothing is happening" is the least debuggable state a tool can
7
+ * present.
8
+ */
9
+ import type { StatusBarProps } from "#lib/schema";
10
+ export declare function StatusBar({ status, model, sessionKey, elapsedMs, last, quiet, armed, pressure, phase, }: StatusBarProps): import("react").JSX.Element;
11
+ //# sourceMappingURL=StatusBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusBar.d.ts","sourceRoot":"","sources":["../../src/components/StatusBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AA2CjD,wBAAgB,SAAS,CAAC,EACtB,MAAM,EACN,KAAK,EACL,UAAU,EACV,SAAS,EACT,IAAI,EACJ,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,GACR,EAAE,cAAc,+BA4ChB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The confirm screen's answer recap: labels dim and right-padded, values plain, in a card.
3
+ */
4
+ export interface SummaryCardProps {
5
+ readonly rows: readonly {
6
+ readonly label: string;
7
+ readonly value: string;
8
+ }[];
9
+ }
10
+ export declare function SummaryCard({ rows }: SummaryCardProps): import("react").JSX.Element;
11
+ //# sourceMappingURL=SummaryCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SummaryCard.d.ts","sourceRoot":"","sources":["../../src/components/SummaryCard.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC/E;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,gBAAgB,+BAkBrD"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * A labelled text input for wizard questions: label, caret, LineCursor, optional error line.
3
+ *
4
+ * The editing itself lives upstream — the screen root routes keys through `keyToIntent` into
5
+ * `applyIntent` and hands the resulting `EditorState` down — so every editing nicety the chat
6
+ * input has (^A/^E, ^W, code-point cursor) works here without a second implementation.
7
+ */
8
+ import type { EditorState } from "#lib/types";
9
+ export interface TextFieldProps {
10
+ readonly label: string;
11
+ readonly editor: EditorState;
12
+ /** The question's default, shown dim when the buffer is empty; enter accepts it. */
13
+ readonly placeholder?: string;
14
+ /** A validation failure, rendered beneath in the error colour. Cleared upstream on edit. */
15
+ readonly error?: string;
16
+ /** Mask the value as it is typed. Passed straight through to the cursor. */
17
+ readonly secret?: boolean;
18
+ /**
19
+ * Columns available for the value. **Not optional in practice.**
20
+ *
21
+ * `LineCursor`'s own docstring says it: omitted, nothing wraps and a line wider than whatever draws
22
+ * this is truncated by Ink at a width nobody chose. This component never passed it, and in the
23
+ * settings editor — which draws the field into an unbordered column — a value longer than the
24
+ * terminal was clipped at the right edge with the caret *past* the clip. You could not see what you
25
+ * were typing, and `tools.pinned` is 92 characters in a generated manifest, so it was the first long
26
+ * value anybody opened.
27
+ *
28
+ * **The wizard was not affected, and checking that mattered**: its bordered frame gives the `<Text>`
29
+ * a bounded width, so Ink wrapped it anyway. Measured, after the assumption that it must be broken
30
+ * too — the guard that would have "proved" it passed with the fix reverted. It is passed there now
31
+ * regardless, because whoever owns a bounded window should wrap the text itself rather than leave it
32
+ * to whatever happens to enclose it, and because `maxRows` genuinely bounds the height.
33
+ */
34
+ readonly columns?: number;
35
+ /** Rows the value may take before the view scrolls to follow the cursor. */
36
+ readonly maxRows?: number;
37
+ }
38
+ export declare function TextField({ label, editor, placeholder, error, secret, columns, maxRows, }: TextFieldProps): import("react").JSX.Element;
39
+ //# sourceMappingURL=TextField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../src/components/TextField.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,oFAAoF;IACpF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,4FAA4F;IAC5F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,wBAAgB,SAAS,CAAC,EACtB,KAAK,EACL,MAAM,EACN,WAAW,EACX,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,GACV,EAAE,cAAc,+BA0BhB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The finished conversation, as a window over rows we own.
3
+ *
4
+ * ## What replaced `<Static>`, and why it had to
5
+ *
6
+ * Through Phase 5 this rendered inside Ink's `<Static>`, which writes a node to the terminal once and
7
+ * never touches it again — so history cost nothing to keep and scrolling was the terminal's own
8
+ * scrollback. Phase 5.5 puts the session on the alternate screen buffer, and the two are incompatible
9
+ * rather than merely awkward: `<Static>` appends to the scrollback, and the alternate buffer is
10
+ * discarded on the way out with a scrollbar that reaches nothing. Everything Static wrote would be
11
+ * invisible from the moment it was written.
12
+ *
13
+ * So the conversation is a buffer this code owns and this component shows a slice of. That moves the
14
+ * transcript into the tree Ink redraws every frame, which is exactly the cost `<Static>` existed to
15
+ * avoid — and is why the window is bounded in rows. A frame redraws its window regardless of how long
16
+ * the conversation is, so the per-token cost stops growing with the answer.
17
+ *
18
+ * Controlled, like every component in this kit: the offset lives in the screen root, the rows come from
19
+ * `transcriptRows`, and this owns no keyboard and no state.
20
+ */
21
+ import type { TranscriptProps } from "#lib/schema";
22
+ export declare function Transcript({ rows, slice, selection }: TranscriptProps): import("react").JSX.Element;
23
+ //# sourceMappingURL=Transcript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transcript.d.ts","sourceRoot":"","sources":["../../src/components/Transcript.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAKlD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,eAAe,+BAgErE"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The init wizard's Ink root: one `useInput`, a pure reducer, and the kit.
3
+ *
4
+ * Deliberately NO `<Static>` anywhere here — answered lines are editable via esc-back, which is
5
+ * incompatible with Static's write-once contract, and the whole wizard is a couple of dozen
6
+ * dynamic rows with no streaming, so full-frame redraw is free. Do not "optimise" this into
7
+ * Static; the transcript's constraints do not apply to a form.
8
+ */
9
+ import type { PartialAnswers, QuestionDefaults } from "#lib/init-flow";
10
+ export interface WizardAppProps {
11
+ readonly title: string;
12
+ readonly given: PartialAnswers;
13
+ readonly defaults: QuestionDefaults;
14
+ /** The collected answers, or undefined when the person backed out. */
15
+ readonly onDone: (answers: PartialAnswers | undefined) => void;
16
+ }
17
+ export declare function WizardApp({ title, given, defaults, onDone }: WizardAppProps): import("react").JSX.Element | null;
18
+ //# sourceMappingURL=WizardApp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WizardApp.d.ts","sourceRoot":"","sources":["../../src/components/WizardApp.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAkBH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AA4BtE,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAA;IACnC,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,KAAK,IAAI,CAAA;CACjE;AA4BD,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,cAAc,sCA0S3E"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The wizard's chrome: answered lines above, the current question in a rounded box, a dim hint
3
+ * footer. The `step m of n` count is honest — a keyless preset shrinks `total`, and the frame
4
+ * shows whatever the reducer computed rather than a number that quietly stops being true.
5
+ */
6
+ import type { ReactNode } from "react";
7
+ export interface WizardFrameProps {
8
+ readonly step: number;
9
+ readonly total: number;
10
+ /** Already-answered questions, rendered ✓ label value. Esc pops the last one. */
11
+ readonly answered: readonly {
12
+ readonly label: string;
13
+ readonly value: string;
14
+ }[];
15
+ readonly hint: string;
16
+ readonly children: ReactNode;
17
+ }
18
+ export declare function WizardFrame({ step, total, answered, hint, children }: WizardFrameProps): import("react").JSX.Element;
19
+ //# sourceMappingURL=WizardFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WizardFrame.d.ts","sourceRoot":"","sources":["../../src/components/WizardFrame.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC/B;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BA0BtF"}
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import{E,t,Pt,fe,ze,T,vr,_,M}from"./index-2cvtz0fy.js";import"./index-bry9bzt3.js";import"./index-jk0def33.js";import{Ve,Ir}from"./index-j97vttdt.js";import{he,b,J,ue,Y,ie}from"./index-xgqzk5cq.js";import{w,te}from"./index-7da4fqcr.js";import{zn,Bn,Kn,ur,kt,io,ao,lo,co,uo,St,Hn,Wn,ot,Yt}from"./index-gbnc99j8.js";import{Et}from"./index-9f9pp2ef.js";import{Z}from"./index-9nsfs0vy.js";import{l,d}from"./index-mgdgx22q.js";import{we,U,Ge,n}from"./index-my5cjx00.js";import{readFileSync as A}from"node:fs";var C=["list","get","set","env","allow","edit"];function ne(e,r,o=(i)=>process.stderr.write(i)){let i=(e??"").trim();if(i==="")return{action:"edit",ref:void 0};if(!C.includes(i))return{action:"edit",ref:i};if(r!==void 0&&C.includes(r))o(`note: reading "${i}" as the action and "${r}" as the agent
3
+ `);if(r===void 0&&i!=="list")return{action:i,ref:void 0};return{action:i,ref:r}}async function re(e){let r=e.out??((a)=>process.stdout.write(a)),o=e.action??"";if(!C.includes(o)){let a=E(o,[...C]);throw new t({code:"cli_config_action_unknown",message:`"${o}" is not something config does.`,hint:`One of: ${C.join(", ")}.${a===void 0?"":` Did you mean ${a}?`}`})}let i=te(e.ref??"",e.sandboxEnv);switch(o){case"list":{r(`${io(Wn(i),i)}
4
+ `);let a=Hn(St(ze(A(i,"utf8"))),Et(i));for(let s of a)r(`
5
+ ${d(`${s.name} is not set — ${s.why}`)}
6
+ `),r(`${d(`\`config env <agent> ${s.name}\` fills it in`)}
7
+ `);return n}case"get":return x(i,e,r);case"set":return await N(i,e,r);case"env":return await R(i,e,r);case"edit":return await F(i,e,r);default:return await I(i,e,r)}}function x(e,r,o){let i=(r.name??"").trim(),a=k(i),s=Wn(e).find((c)=>c.setting.path===a.path);return o(`${ao(a,s?.value)}
8
+ `),n}function k(e){let r=vr(e);if(r!==void 0)return r;let o=E(e,[...uo()]);throw new t({code:"cli_config_path_unknown",message:`"${e}" is not a setting.`,hint:`\`config list <agent>\` shows every one with its current value.${o===void 0?"":` Did you mean ${o}?`}`,field:"path"})}async function N(e,r,o){let i=(r.name??"").trim(),a=k(i);if(a.via!==void 0)throw new t({code:"cli_config_needs_action",message:`${a.path} is not set by a dotted path.`,hint:`Use \`${a.via}\` — it lives inside a list entry, and it gets its value checked against the service that issues it rather than written verbatim.`,field:"path"});if(r.value===void 0)throw new t({code:"cli_config_value_missing",message:`No value given for ${i}.`,hint:`A bare word, a number, a list as ["a", "b"], or a map as {k: v}. \`config get <agent> ${i}\` shows what it is now.`,field:"value"});let s=Pt(r.value),c=lo(a,s);if(c!==void 0&&r.yes!==!0){if(o(`${d(c)}
9
+ `),!await(r.confirm??Ve)(`Change ${a.path} anyway?`))return o(`${l([{label:"unchanged",value:a.path}])}
10
+ `),n}let p=Et(e),f=Hn(St(ze(A(e,"utf8"))),p).map((u)=>u.name),g=await zn(e,i,r.value),m=Hn(St(ze(A(e,"utf8"))),p).filter((u)=>!f.includes(u.name)),v=await O(e,r);return o(`${co({path:i,before:g.before,after:s,file:e,reflowed:g.reflowed,...v===void 0?{}:{running:v},pending:m,restartHint:S(v?.mode)})}
11
+ `),n}function S(e){if(e==="daemon")return"`daemon restart <agent>`";if(e==="embedded")return"`/restart` in this session";if(e==="terminal")return"that process being started again";return"it is started again"}async function O(e,r){let o;try{o=T(e).id}catch{return}if(o===void 0)return;try{let i=await M.open({path:r.store??w(r.sandboxEnv)});try{for(let a of await i.leases.all()){if(a.agentId!==o)continue;if(!_(a.pid))continue;return{pid:a.pid,mode:a.mode}}}finally{await i.close()}}catch{return}return}async function R(e,r,o){let i=(r.name??"").trim();if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(i))throw new t({code:"cli_config_env_name_invalid",message:`"${i}" is not an environment variable name.`,hint:"Letters, digits and underscores, not starting with a digit — MODEL_API_KEY, TELEGRAM_BOT_TOKEN. `config list <agent>` shows which ones this agent names.",field:"name"});let s=await(r.secret??Ir)(`value for ${i} (not echoed):`);if(s===void 0)throw new t({code:"cli_config_env_no_value",message:`Nothing was written for ${i}.`,hint:"A secret is read from a prompt, never from an argument or a pipe — an argument is visible in `ps` and in shell history. Run this at a terminal, or edit the .env beside the manifest yourself."});if(s==="")throw new t({code:"cli_config_env_empty",message:`An empty value for ${i} would not start the agent.`,hint:"A variable set to nothing fails the load exactly as a missing one does. Nothing was written."});let c=Kn(e,i,s);return o(`${l([{label:"set",value:c.note}])}
12
+ `),o(`${d("takes effect the next time the agent starts")}
13
+ `),n}async function I(e,r,o){let i=fe(A(e,"utf8"),["channels"]);if(!Array.isArray(i)||i.length===0)throw new t({code:"cli_config_no_channels",message:"This agent has no channels, so there is nobody to allow.",hint:"`config set <agent> channels '[{type: telegram, id: tg, tokenEnv: TELEGRAM_BOT_TOKEN, mode: longpoll}]'` declares one first."});let a=i.filter((h)=>typeof h==="object"&&h!==null&&!Array.isArray(h)),s=a.map((h)=>String(h.id??"")).filter((h)=>h!==""),c=r.channel?.trim();if(c===void 0&&a.length>1)throw new t({code:"cli_config_channel_ambiguous",message:`This agent has ${a.length} channels, so --channel says which.`,hint:`One of: ${s.join(", ")}.`,field:"channel"});let p=c===void 0?0:a.findIndex((h)=>String(h.id??"")===c);if(p===-1)throw new t({code:"cli_config_channel_unknown",message:`No channel with id "${c}".`,hint:`Declared: ${s.join(", ")}.${E(c??"",s)===void 0?"":` Did you mean ${E(c??"",s)}?`}`,field:"channel"});let f=a[p],g=ur(r.name??"",String(f.type??"")),m=Array.isArray(f.allowFrom)?f.allowFrom.map(String):[],v=r.remove===!0?m.filter((h)=>h!==g):m.includes(g)?m:[...m,g];if(v.length===m.length&&r.remove===!0)return o(`${l([{label:"unchanged",value:`${g} was not on ${String(f.id)}`}])}
14
+ `),n;if(v.length===m.length)return o(`${l([{label:"already allowed",value:`${g} on ${String(f.id)}`}])}
15
+ `),n;let u=await Bn(e,String(f.id??""),v),y=await O(e,r);if(o(`${l([{label:r.remove===!0?"removed":"allowed",value:g},{label:"channel",value:String(f.id)},{label:"now",value:kt(v)},{label:"file",value:e}])}
16
+ `),u.reflowed)o(`${d("the file was re-serialised — it is valid, and comments may have moved")}
17
+ `);if(y!==void 0)o(`${d(`this agent is running (pid ${y.pid}, ${y.mode}) and holds its settings for its lifetime — the change applies after ${S(y.mode)}`)}
18
+ `);return n}async function F(e,r,o){let i=ie({plain:!1,json:!1,oneShot:!1});if(i.mode!=="rich")throw new t({code:"cli_config_edit_needs_terminal",message:"The settings editor needs a terminal.",hint:`Not one here (${i.because}). \`config list\` reads them and \`config set\` changes one, both of which work on a pipe.`});let[{render:a},{createElement:s},{ConfigEditor:c}]=await Promise.all([import("ink"),import("react"),import("./ConfigEditor-7v5nebvy.js")]),p=!1,f=()=>{},g=new Promise((u)=>{f=u});he(),process.stdout.write(we);let m=a(s(c,{rows:ot(e),apply:(u,y)=>Yt(e,u,y),reload:()=>ot(e),columns:Z(process.stdout.columns,U),window:Ge,onDone:(u)=>{p=u,f()}}),{exitOnCtrlC:!1,...Y()});b(()=>m.unmount()),await g,m.unmount(),J(),await ue();let v=await O(e,r);if(!p)return o(`${l([{label:"unchanged",value:e}])}
19
+ `),n;return o(`${l([{label:"changed",value:e}])}
20
+ `),o(`${d(`takes effect after ${S(v?.mode)}`)}
21
+ `),n}export{re as configCommand,ne as readAction};
22
+
23
+ //# debugId=CFD506B5F692CED764756E2164756E21
24
+ //# sourceMappingURL=config-yz0nz51b.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/config.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * `config` — a person changing an agent's settings without hand-editing YAML.\n *\n * ## Why this exists\n *\n * `config_read`/`config_set` shipped in Phase 3.6 and are the *agent's*. There was no equivalent for a\n * person, so the routes were editing `agent.yaml` by hand, re-running `init` into a fresh directory, or\n * asking the agent (which needs `config_set` pinned, a matching allow rule, and a restart).\n *\n * The inversion is the argument for the command. Decision 11.29 reserves `allowFrom`, `server.host`,\n * `server.tokenEnv` and `writeRoots` **for the person**, floored so the agent cannot widen its own\n * reach — and that is right. But the only editor ever built was the agent's, so the fields designated\n * as the person's had the worst ergonomics in the system: unvalidated YAML that fails at the next boot.\n * It compounds with `.env` being protected *precisely* so the agent cannot supply its own secrets,\n * which left the one actor who can fill in `MODEL_API_KEY` with no tool for doing it.\n *\n * ## What this does not own\n *\n * The write. `editManifest` places, validates against the real schema, checks that the providers still\n * resolve, and only then writes — one writer for every surface, because the three that existed made\n * the guarantee depend on which caller you happened to be.\n *\n * ## Why nothing here is floored\n *\n * The agent's floor exists because an agent that could widen its own inbound gate could be *talked\n * into* it by the message it is reading. A person at a terminal is not that threat. Two edits are\n * confirmed rather than refused — `tools.policy.deny` and `onMutate: allow` — and `lib/config-view.ts`\n * decides which, so \"what needs a confirmation\" is assertable without performing one.\n */\n\nimport { readFileSync } from \"node:fs\"\nimport {\n HarnessError,\n manifestDocument,\n manifestValueAt,\n nearest,\n parseSettingValue,\n processAlive,\n readManifestHeader,\n type Setting,\n SqliteStore,\n settingByPath,\n} from \"@dispach/core\"\nimport { applyAllow, applySecret, applySet, checkedHandle } from \"#lib/config-apply\"\nimport type { EditorRow } from \"#lib/config-editor\"\nimport { agentEnv } from \"#lib/config-env\"\nimport { applyEditorRow, currentValues, editorRowsFor } from \"#lib/config-rows\"\nimport {\n confirmationFor,\n envNeeds,\n renderChange,\n renderOne,\n renderSettings,\n settablePaths,\n showValue,\n unmet,\n} from \"#lib/config-view\"\nimport { askSecret, askYesNo } from \"#lib/confirm\"\nimport {\n ENTER_ALT_SCREEN,\n EXIT_FAILURE,\n EXIT_OK,\n FALLBACK_COLUMNS,\n MAX_SCREEN_ROWS,\n} from \"#lib/const\"\nimport { flushOutput, markAltScreen, onExit, restoreTerminal } from \"#lib/exit\"\nimport { negotiateKeyboard } from \"#lib/keyboard\"\nimport { resolveModeFromProcess } from \"#lib/output\"\nimport { bullet, keyValue } from \"#lib/render\"\nimport { resolveAgentRef, storePath } from \"#lib/sandbox\"\nimport { screenColumns } from \"#lib/screen\"\n\nexport interface ConfigCommandOptions {\n /** `list` | `get` | `set` | `env` | `allow`. */\n readonly action?: string\n /** A path or a sandbox agent name. */\n readonly ref?: string\n /** A setting path, an env variable name, or a handle, depending on the action. */\n readonly name?: string\n readonly value?: string\n readonly channel?: string\n readonly remove?: boolean\n readonly yes?: boolean\n readonly store?: string\n /** Injected by tests. */\n readonly confirm?: (question: string) => Promise<boolean>\n readonly secret?: (question: string) => Promise<string | undefined>\n /**\n * The `<ENVPREFIX>HOME` override that relocates the whole sandbox. **Not** the manifest\n * environment: that one is `ambientEnv`, computed from the resolved path, and answers \"is this\n * variable set\". Two env concepts in one options object want two names — conflating them has\n * already cost a round, where `skills install` consulted a different registry from `init`.\n */\n readonly sandboxEnv?: Readonly<Record<string, string | undefined>>\n readonly out?: (text: string) => void\n}\n\nconst ACTIONS = [\"list\", \"get\", \"set\", \"env\", \"allow\", \"edit\"] as const\n\n/**\n * Read the action and the agent out of the positionals, allowing `config <agent>` with no action.\n *\n * The editor is what most people want from this command, so typing its name and an agent has to work.\n * Disambiguated the way this repo already does it twice over: a slash command takes arguments only\n * after a token that is *exactly* a known command, and `resolveAgentRef` lets the filesystem win with a\n * note on genuine ambiguity. Here the six action words win, and anything else is an agent.\n *\n * The collision is an agent literally named after an action, and it gets the note rather than silence —\n * running the wrong thing quietly is the failure worth avoiding, and it does not look wrong in output.\n */\nexport function readAction(\n first: string | undefined,\n second: string | undefined,\n warn: (line: string) => void = (line) => process.stderr.write(line),\n): { readonly action: string; readonly ref: string | undefined } {\n const given = (first ?? \"\").trim()\n if (given === \"\") return { action: \"edit\", ref: undefined }\n if (!ACTIONS.includes(given as (typeof ACTIONS)[number])) {\n return { action: \"edit\", ref: given }\n }\n if (second !== undefined && ACTIONS.includes(second as (typeof ACTIONS)[number])) {\n // Both words are action names, so one of them is an agent and only the order says which. The\n // first wins, and the note is what stops a silently-wrong run — the same choice\n // `resolveAgentRef` makes for a bare name shadowed by a directory.\n warn(`note: reading \"${given}\" as the action and \"${second}\" as the agent\\n`)\n }\n if (second === undefined && given !== \"list\") {\n // A known action word with nothing after it. `config edit` alone is the editor with no agent,\n // which fails later with the usual missing-manifest error; anything else is ambiguous only if an\n // agent has that name, and `resolveAgentRef` is what finds out.\n return { action: given, ref: undefined }\n }\n return { action: given, ref: second }\n}\n\nexport async function configCommand(options: ConfigCommandOptions): Promise<number> {\n const out = options.out ?? ((text: string) => process.stdout.write(text))\n const action = options.action ?? \"\"\n if (!ACTIONS.includes(action as (typeof ACTIONS)[number])) {\n const suggestion = nearest(action, [...ACTIONS])\n throw new HarnessError({\n code: \"cli_config_action_unknown\",\n message: `\"${action}\" is not something config does.`,\n hint: `One of: ${ACTIONS.join(\", \")}.${\n suggestion === undefined ? \"\" : ` Did you mean ${suggestion}?`\n }`,\n })\n }\n\n const manifestPath = resolveAgentRef(options.ref ?? \"\", options.sandboxEnv)\n\n switch (action) {\n case \"list\": {\n out(`${renderSettings(currentValues(manifestPath), manifestPath)}\\n`)\n // What is currently missing belongs here rather than on every `set`: this is the command\n // whose job is the overview, and a note repeated on unrelated edits is one nobody reads.\n const missing = unmet(\n envNeeds(manifestDocument(readFileSync(manifestPath, \"utf8\"))),\n agentEnv(manifestPath),\n )\n for (const need of missing) {\n out(`\\n${bullet(`${need.name} is not set — ${need.why}`)}\\n`)\n out(`${bullet(`\\`config env <agent> ${need.name}\\` fills it in`)}\\n`)\n }\n return EXIT_OK\n }\n case \"get\":\n return get(manifestPath, options, out)\n case \"set\":\n return await set(manifestPath, options, out)\n case \"env\":\n return await env(manifestPath, options, out)\n case \"edit\":\n return await edit(manifestPath, options, out)\n default:\n return await allow(manifestPath, options, out)\n }\n}\n\nfunction get(\n manifestPath: string,\n options: ConfigCommandOptions,\n out: (text: string) => void,\n): number {\n const path = (options.name ?? \"\").trim()\n const setting = requireSetting(path)\n const row = currentValues(manifestPath).find((entry) => entry.setting.path === setting.path)\n out(`${renderOne(setting, row?.value)}\\n`)\n return EXIT_OK\n}\n\nfunction requireSetting(path: string): Setting {\n const found = settingByPath(path)\n if (found !== undefined) return found\n const suggestion = nearest(path, [...settablePaths()])\n throw new HarnessError({\n code: \"cli_config_path_unknown\",\n message: `\"${path}\" is not a setting.`,\n hint: `\\`config list <agent>\\` shows every one with its current value.${\n suggestion === undefined ? \"\" : ` Did you mean ${suggestion}?`\n }`,\n field: \"path\",\n })\n}\n\nasync function set(\n manifestPath: string,\n options: ConfigCommandOptions,\n out: (text: string) => void,\n): Promise<number> {\n const path = (options.name ?? \"\").trim()\n const setting = requireSetting(path)\n\n if (setting.via !== undefined) {\n throw new HarnessError({\n code: \"cli_config_needs_action\",\n message: `${setting.path} is not set by a dotted path.`,\n hint: `Use \\`${setting.via}\\` — it lives inside a list entry, and it gets its value checked against the service that issues it rather than written verbatim.`,\n field: \"path\",\n })\n }\n if (options.value === undefined) {\n throw new HarnessError({\n code: \"cli_config_value_missing\",\n message: `No value given for ${path}.`,\n hint: `A bare word, a number, a list as [\"a\", \"b\"], or a map as {k: v}. \\`config get <agent> ${path}\\` shows what it is now.`,\n field: \"value\",\n })\n }\n\n const value = parseSettingValue(options.value)\n\n // The confirmation, before anything is read or written. It is not a floor — these edits are the\n // person's to make — but both of them stop a check from running, and an edit whose whole effect is\n // invisible until something exploits it is worth one sentence and a keypress.\n const warning = confirmationFor(setting, value)\n if (warning !== undefined && options.yes !== true) {\n out(`${bullet(warning)}\\n`)\n const ask = options.confirm ?? askYesNo\n if (!(await ask(`Change ${setting.path} anyway?`))) {\n out(`${keyValue([{ label: \"unchanged\", value: setting.path }])}\\n`)\n return EXIT_OK\n }\n }\n\n // The agent's own layered environment, not this process's. `ambientEnv` alone does not do it: it\n // demotes a colliding cwd variable and never adds the agent's own file, so a token sitting beside\n // the manifest read as unset.\n const ambient = agentEnv(manifestPath)\n const before = unmet(\n envNeeds(manifestDocument(readFileSync(manifestPath, \"utf8\"))),\n ambient,\n ).map((need) => need.name)\n\n // `applySet` owns the write, so the editor and this command cannot validate a value differently.\n const result = await applySet(manifestPath, path, options.value)\n\n // Newly required only. Computed either side of the edit rather than guessed from the value, so\n // `server.enabled true` reports the token it has just made load-bearing and `limits.maxSteps 9`\n // reports nothing — which a live run got wrong in the other direction, warning that an agent with\n // a disabled server \"will refuse to start\".\n const pending = unmet(\n envNeeds(manifestDocument(readFileSync(manifestPath, \"utf8\"))),\n ambient,\n ).filter((need) => !before.includes(need.name))\n\n const held = await running(manifestPath, options)\n out(\n `${renderChange({\n path,\n before: result.before,\n after: value,\n file: manifestPath,\n reflowed: result.reflowed,\n ...(held === undefined ? {} : { running: held }),\n pending,\n restartHint: restartHint(held?.mode),\n })}\\n`,\n )\n return EXIT_OK\n}\n\n/**\n * How this agent comes back, phrased for how it is currently held.\n *\n * All three `RuntimeMode` values, because the generic sentence is useless for two of them. `embedded` is\n * the case that matters most and is easiest to miss: it is *this* session, so the answer is one word the\n * person can type — and a live run reported `pid 90050, embedded` under \"it is started again\", which is\n * true and gives them nothing.\n */\nfunction restartHint(mode: string | undefined): string {\n if (mode === \"daemon\") return \"`daemon restart <agent>`\"\n if (mode === \"embedded\") return \"`/restart` in this session\"\n if (mode === \"terminal\") return \"that process being started again\"\n return \"it is started again\"\n}\n\n/**\n * A live process holding this agent, or `undefined`.\n *\n * Never a refusal, only a note. Fixing a misconfiguration *while it is running and broken* is the main\n * thing this command is for, so refusing in that state would block the case it exists to serve.\n *\n * Liveness is re-checked rather than trusted: a lease row is a claim, and a boot that failed after\n * claiming leaves a row seconds old with no process under it — which once blocked every retry for\n * ninety seconds while naming a pid that no longer existed.\n */\nasync function running(\n manifestPath: string,\n options: ConfigCommandOptions,\n): Promise<{ readonly pid: number; readonly mode: string } | undefined> {\n let agentId: string | undefined\n try {\n agentId = readManifestHeader(manifestPath).id\n } catch {\n return undefined\n }\n if (agentId === undefined) return undefined\n\n try {\n const store = await SqliteStore.open({\n path: options.store ?? storePath(options.sandboxEnv),\n })\n try {\n for (const lease of await store.leases.all()) {\n if (lease.agentId !== agentId) continue\n if (!processAlive(lease.pid)) continue\n return { pid: lease.pid, mode: lease.mode }\n }\n } finally {\n await store.close()\n }\n } catch {\n // A missing or unreadable store is not a reason to refuse a manifest edit. The note is a\n // courtesy; the write is the command.\n return undefined\n }\n return undefined\n}\n\n/**\n * Put a secret in the `.env` beside the manifest.\n *\n * The value is prompted and never taken from an argument: an argument lands in shell history and in\n * `ps`, readable by every local process for the lifetime of the call. Not a TTY refuses rather than\n * reading a pipe, so a CI run is told nothing was written instead of a secret arriving from a source\n * the caller did not audit.\n *\n * Written 0600 whichever way the file arrived. Under a service manager this file is the *only* path\n * credentials take — launchd hands a job almost no environment and a plist carries none on purpose —\n * so tightening it is right even when this command did not create it.\n */\nasync function env(\n manifestPath: string,\n options: ConfigCommandOptions,\n out: (text: string) => void,\n): Promise<number> {\n const name = (options.name ?? \"\").trim()\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {\n throw new HarnessError({\n code: \"cli_config_env_name_invalid\",\n message: `\"${name}\" is not an environment variable name.`,\n hint: \"Letters, digits and underscores, not starting with a digit — MODEL_API_KEY, TELEGRAM_BOT_TOKEN. `config list <agent>` shows which ones this agent names.\",\n field: \"name\",\n })\n }\n\n // Statically imported, not `await import`. A module reached both ways makes `bun build\n // --splitting` emit its exports twice and the binary refuses to parse — and `bun test` sails\n // through it, because tests import source and the failure is in the bundle. `confirm.ts` pulls in\n // only `node:readline`, so there is nothing to defer.\n const ask = options.secret ?? askSecret\n const value = await ask(`value for ${name} (not echoed):`)\n if (value === undefined) {\n throw new HarnessError({\n code: \"cli_config_env_no_value\",\n message: `Nothing was written for ${name}.`,\n hint: \"A secret is read from a prompt, never from an argument or a pipe — an argument is visible in `ps` and in shell history. Run this at a terminal, or edit the .env beside the manifest yourself.\",\n })\n }\n if (value === \"\") {\n throw new HarnessError({\n code: \"cli_config_env_empty\",\n message: `An empty value for ${name} would not start the agent.`,\n hint: \"A variable set to nothing fails the load exactly as a missing one does. Nothing was written.\",\n })\n }\n\n // The write itself is `applySecret`, which the editor calls too — two callers deciding separately\n // whether to tighten the file's mode is the same class of split as two manifest writers.\n const applied = applySecret(manifestPath, name, value)\n out(`${keyValue([{ label: \"set\", value: applied.note }])}\\n`)\n out(`${bullet(\"takes effect the next time the agent starts\")}\\n`)\n return EXIT_OK\n}\n\n/**\n * Add or remove a handle on a channel's `allowFrom`.\n *\n * Its own action rather than a `config set` path for two reasons. The source editor matches `key:` at\n * an indent and cannot index a sequence, so the field is not addressable — and rewriting the whole\n * `channels` list to change one handle is the dead end this command exists to remove. The second is\n * better: a handle can be *checked against the service that issues it*, and an impossible one is\n * otherwise a bot that is connected, healthy and silently refusing the one person it was set up for.\n */\nasync function allow(\n manifestPath: string,\n options: ConfigCommandOptions,\n out: (text: string) => void,\n): Promise<number> {\n const channels = manifestValueAt(readFileSync(manifestPath, \"utf8\"), [\"channels\"])\n if (!Array.isArray(channels) || channels.length === 0) {\n throw new HarnessError({\n code: \"cli_config_no_channels\",\n message: \"This agent has no channels, so there is nobody to allow.\",\n hint: \"`config set <agent> channels '[{type: telegram, id: tg, tokenEnv: TELEGRAM_BOT_TOKEN, mode: longpoll}]'` declares one first.\",\n })\n }\n\n const entries = channels.filter(\n (entry): entry is Record<string, unknown> =>\n typeof entry === \"object\" && entry !== null && !Array.isArray(entry),\n )\n const ids = entries.map((entry) => String(entry.id ?? \"\")).filter((id) => id !== \"\")\n const wanted = options.channel?.trim()\n if (wanted === undefined && entries.length > 1) {\n throw new HarnessError({\n code: \"cli_config_channel_ambiguous\",\n message: `This agent has ${entries.length} channels, so --channel says which.`,\n hint: `One of: ${ids.join(\", \")}.`,\n field: \"channel\",\n })\n }\n const at =\n wanted === undefined ? 0 : entries.findIndex((entry) => String(entry.id ?? \"\") === wanted)\n if (at === -1) {\n throw new HarnessError({\n code: \"cli_config_channel_unknown\",\n message: `No channel with id \"${wanted}\".`,\n hint: `Declared: ${ids.join(\", \")}.${\n nearest(wanted ?? \"\", ids) === undefined\n ? \"\"\n : ` Did you mean ${nearest(wanted ?? \"\", ids)}?`\n }`,\n field: \"channel\",\n })\n }\n\n const target = entries[at] as Record<string, unknown>\n const handle = checkedHandle(options.name ?? \"\", String(target.type ?? \"\"))\n const current = Array.isArray(target.allowFrom) ? target.allowFrom.map(String) : []\n\n const next =\n options.remove === true\n ? current.filter((entry) => entry !== handle)\n : current.includes(handle)\n ? current\n : [...current, handle]\n\n if (next.length === current.length && options.remove === true) {\n out(\n `${keyValue([\n { label: \"unchanged\", value: `${handle} was not on ${String(target.id)}` },\n ])}\\n`,\n )\n return EXIT_OK\n }\n if (next.length === current.length) {\n // Idempotent on purpose: running it twice is what somebody does when they are not sure it\n // took, and reporting a second write they did not make would be a small lie.\n out(\n `${keyValue([{ label: \"already allowed\", value: `${handle} on ${String(target.id)}` }])}\\n`,\n )\n return EXIT_OK\n }\n\n // `applyAllow` owns the write and the handle check, so the editor cannot validate a handle\n // differently from this command. It takes the whole list, because the whole list is what gets\n // written: one entry's key is not addressable by the source editor.\n const result = await applyAllow(manifestPath, String(target.id ?? \"\"), next)\n const held = await running(manifestPath, options)\n\n out(\n `${keyValue([\n { label: options.remove === true ? \"removed\" : \"allowed\", value: handle },\n { label: \"channel\", value: String(target.id) },\n { label: \"now\", value: showValue(next) },\n { label: \"file\", value: manifestPath },\n ])}\\n`,\n )\n if (result.reflowed) {\n out(`${bullet(\"the file was re-serialised — it is valid, and comments may have moved\")}\\n`)\n }\n if (held !== undefined) {\n out(\n `${bullet(\n `this agent is running (pid ${held.pid}, ${held.mode}) and holds its settings for its lifetime — the change applies after ${restartHint(held.mode)}`,\n )}\\n`,\n )\n }\n return EXIT_OK\n}\n\nexport const CONFIG_EXIT_FAILURE = EXIT_FAILURE\n\n/**\n * The editor, standalone.\n *\n * Alternate screen, because it waits for keys: it takes the terminal and gives it back. A changed flag\n * comes back through `onDone` so the one line printed afterwards can say a restart is needed — printed\n * on the real screen after the restore, because hard rule 8 does not stop applying when a screen closes.\n */\nasync function edit(\n manifestPath: string,\n options: ConfigCommandOptions,\n out: (text: string) => void,\n): Promise<number> {\n // Refused rather than attempted without a terminal. Two things went wrong otherwise, and the second\n // is the serious one: the alternate-screen sequence was written into a *pipe*, and Ink's own \"raw\n // mode is not supported\" error left the command exiting **0** — a failure that reported success,\n // which hard rule 8 exists to prevent. `browse` and `init` already ask this question the same way.\n const decision = resolveModeFromProcess({ plain: false, json: false, oneShot: false })\n if (decision.mode !== \"rich\") {\n throw new HarnessError({\n code: \"cli_config_edit_needs_terminal\",\n message: \"The settings editor needs a terminal.\",\n hint: `Not one here (${decision.because}). \\`config list\\` reads them and \\`config set\\` changes one, both of which work on a pipe.`,\n })\n }\n\n const [{ render }, { createElement }, { ConfigEditor }] = await Promise.all([\n import(\"ink\"),\n import(\"react\"),\n import(\"#components/ConfigEditor\"),\n ])\n\n let changed = false\n let finish: () => void = () => {}\n const closed = new Promise<void>((resolve) => {\n finish = resolve\n })\n\n markAltScreen()\n process.stdout.write(ENTER_ALT_SCREEN)\n\n // No wrapper component: the editor is a *view*, so it owns its own state and its single `useInput`,\n // exactly as `SkillBrowser` and `SessionPicker` do. Holding it here needed `useState` in this file,\n // which is a shared command path — and a static React import there costs ~170-210 ms on every\n // command including `validate --json`, which a boundaries test refuses outright.\n const instance = render(\n createElement(ConfigEditor, {\n rows: editorRowsFor(manifestPath),\n apply: (row: EditorRow, raw: string) => applyEditorRow(manifestPath, row, raw),\n reload: () => editorRowsFor(manifestPath),\n // A pty can report `columns === 0`, which `?? fallback` does not cover — measured, and it\n // once laid a picker's rows out for half the terminal, uniformly, on every row.\n columns: screenColumns(process.stdout.columns, FALLBACK_COLUMNS),\n window: MAX_SCREEN_ROWS,\n onDone: (didChange: boolean) => {\n changed = didChange\n finish()\n },\n }),\n { exitOnCtrlC: false, ...negotiateKeyboard() },\n )\n onExit(() => instance.unmount())\n await closed\n instance.unmount()\n restoreTerminal()\n await flushOutput()\n\n const held = await running(manifestPath, options)\n if (!changed) {\n out(`${keyValue([{ label: \"unchanged\", value: manifestPath }])}\\n`)\n return EXIT_OK\n }\n out(`${keyValue([{ label: \"changed\", value: manifestPath }])}\\n`)\n out(`${bullet(`takes effect after ${restartHint(held?.mode)}`)}\\n`)\n return EXIT_OK\n}\n"
6
+ ],
7
+ "mappings": ";idA8BA,uBAAS,gBAmET,IAAM,EAAU,CAAC,OAAQ,MAAO,MAAO,MAAO,QAAS,MAAM,EA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AE,YAAa,MAAU,EAAkB,CAAE,CACjD,EACA,EAAO,IAAM,EAAS,QAAQ,CAAC,EAC/B,MAAM,EACN,EAAS,QAAQ,EACjB,EAAgB,EAChB,MAAM,GAAY,EAElB,IAAM,EAAO,MAAM,EAAQ,EAAc,CAAO,EAChD,GAAI,CAAC,EAED,OADA,EAAI,GAAG,EAAS,CAAC,CAAE,MAAO,YAAa,MAAO,CAAa,CAAC,CAAC;AAAA,CAAK,EAC3D,EAIX,OAFA,EAAI,GAAG,EAAS,CAAC,CAAE,MAAO,UAAW,MAAO,CAAa,CAAC,CAAC;AAAA,CAAK,EAChE,EAAI,GAAG,EAAO,sBAAsB,EAAY,GAAM,IAAI,GAAG;AAAA,CAAK,EAC3D",
8
+ "debugId": "CFD506B5F692CED764756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,71 @@
1
+ /**
2
+ * `config` — a person changing an agent's settings without hand-editing YAML.
3
+ *
4
+ * ## Why this exists
5
+ *
6
+ * `config_read`/`config_set` shipped in Phase 3.6 and are the *agent's*. There was no equivalent for a
7
+ * person, so the routes were editing `agent.yaml` by hand, re-running `init` into a fresh directory, or
8
+ * asking the agent (which needs `config_set` pinned, a matching allow rule, and a restart).
9
+ *
10
+ * The inversion is the argument for the command. Decision 11.29 reserves `allowFrom`, `server.host`,
11
+ * `server.tokenEnv` and `writeRoots` **for the person**, floored so the agent cannot widen its own
12
+ * reach — and that is right. But the only editor ever built was the agent's, so the fields designated
13
+ * as the person's had the worst ergonomics in the system: unvalidated YAML that fails at the next boot.
14
+ * It compounds with `.env` being protected *precisely* so the agent cannot supply its own secrets,
15
+ * which left the one actor who can fill in `MODEL_API_KEY` with no tool for doing it.
16
+ *
17
+ * ## What this does not own
18
+ *
19
+ * The write. `editManifest` places, validates against the real schema, checks that the providers still
20
+ * resolve, and only then writes — one writer for every surface, because the three that existed made
21
+ * the guarantee depend on which caller you happened to be.
22
+ *
23
+ * ## Why nothing here is floored
24
+ *
25
+ * The agent's floor exists because an agent that could widen its own inbound gate could be *talked
26
+ * into* it by the message it is reading. A person at a terminal is not that threat. Two edits are
27
+ * confirmed rather than refused — `tools.policy.deny` and `onMutate: allow` — and `lib/config-view.ts`
28
+ * decides which, so "what needs a confirmation" is assertable without performing one.
29
+ */
30
+ export interface ConfigCommandOptions {
31
+ /** `list` | `get` | `set` | `env` | `allow`. */
32
+ readonly action?: string;
33
+ /** A path or a sandbox agent name. */
34
+ readonly ref?: string;
35
+ /** A setting path, an env variable name, or a handle, depending on the action. */
36
+ readonly name?: string;
37
+ readonly value?: string;
38
+ readonly channel?: string;
39
+ readonly remove?: boolean;
40
+ readonly yes?: boolean;
41
+ readonly store?: string;
42
+ /** Injected by tests. */
43
+ readonly confirm?: (question: string) => Promise<boolean>;
44
+ readonly secret?: (question: string) => Promise<string | undefined>;
45
+ /**
46
+ * The `<ENVPREFIX>HOME` override that relocates the whole sandbox. **Not** the manifest
47
+ * environment: that one is `ambientEnv`, computed from the resolved path, and answers "is this
48
+ * variable set". Two env concepts in one options object want two names — conflating them has
49
+ * already cost a round, where `skills install` consulted a different registry from `init`.
50
+ */
51
+ readonly sandboxEnv?: Readonly<Record<string, string | undefined>>;
52
+ readonly out?: (text: string) => void;
53
+ }
54
+ /**
55
+ * Read the action and the agent out of the positionals, allowing `config <agent>` with no action.
56
+ *
57
+ * The editor is what most people want from this command, so typing its name and an agent has to work.
58
+ * Disambiguated the way this repo already does it twice over: a slash command takes arguments only
59
+ * after a token that is *exactly* a known command, and `resolveAgentRef` lets the filesystem win with a
60
+ * note on genuine ambiguity. Here the six action words win, and anything else is an agent.
61
+ *
62
+ * The collision is an agent literally named after an action, and it gets the note rather than silence —
63
+ * running the wrong thing quietly is the failure worth avoiding, and it does not look wrong in output.
64
+ */
65
+ export declare function readAction(first: string | undefined, second: string | undefined, warn?: (line: string) => void): {
66
+ readonly action: string;
67
+ readonly ref: string | undefined;
68
+ };
69
+ export declare function configCommand(options: ConfigCommandOptions): Promise<number>;
70
+ export declare const CONFIG_EXIT_FAILURE = 1;
71
+ //# sourceMappingURL=config.d.ts.map