dispach 0.1.2 → 0.2.0-pilot.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/README.md +196 -118
  2. package/dist/APEv2Parser-2wqk09q7.js +5 -0
  3. package/dist/APEv2Parser-2wqk09q7.js.map +9 -0
  4. package/dist/AiffParser-zw4g2bdd.js +5 -0
  5. package/dist/AiffParser-zw4g2bdd.js.map +12 -0
  6. package/dist/App-ez7ve0yp.js +11 -0
  7. package/dist/{App-b1yrwrcq.js.map → App-ez7ve0yp.js.map} +6 -7
  8. package/dist/AsfParser-2hfcf5z2.js +5 -0
  9. package/dist/AsfParser-2hfcf5z2.js.map +14 -0
  10. package/dist/ConfigEditor-aamadrx3.js +6 -0
  11. package/dist/{ConfigEditor-n8hdw6r7.js.map → ConfigEditor-aamadrx3.js.map} +2 -2
  12. package/dist/DsdiffParser-n8smktvb.js +5 -0
  13. package/dist/DsdiffParser-n8smktvb.js.map +11 -0
  14. package/dist/DsfParser-npmjp4vr.js +5 -0
  15. package/dist/DsfParser-npmjp4vr.js.map +11 -0
  16. package/dist/FlacParser-xpbs2zmb.js +5 -0
  17. package/dist/FlacParser-xpbs2zmb.js.map +9 -0
  18. package/dist/KeyProbe-4fp152yv.js +5 -0
  19. package/dist/{KeyProbe-9jjeze5r.js.map → KeyProbe-4fp152yv.js.map} +2 -2
  20. package/dist/MP4Parser-es3afcmw.js +5 -0
  21. package/dist/MP4Parser-es3afcmw.js.map +12 -0
  22. package/dist/MatroskaParser-kxysj649.js +5 -0
  23. package/dist/MatroskaParser-kxysj649.js.map +13 -0
  24. package/dist/MpegParser-b3rr7b0f.js +5 -0
  25. package/dist/MpegParser-b3rr7b0f.js.map +13 -0
  26. package/dist/MusepackParser-sgjzmq0r.js +5 -0
  27. package/dist/MusepackParser-sgjzmq0r.js.map +16 -0
  28. package/dist/OggParser-x8h54ynf.js +5 -0
  29. package/dist/OggParser-x8h54ynf.js.map +18 -0
  30. package/dist/Picker-rq015kzc.js +5 -0
  31. package/dist/{Picker-hfeh1g6m.js.map → Picker-rq015kzc.js.map} +2 -2
  32. package/dist/SessionPicker-03zyvd2f.js +5 -0
  33. package/dist/{SessionPicker-zyqkg4dn.js.map → SessionPicker-03zyvd2f.js.map} +2 -2
  34. package/dist/SkillBrowser-8s8rjv98.js +5 -0
  35. package/dist/{SkillBrowser-3qdp8080.js.map → SkillBrowser-8s8rjv98.js.map} +2 -2
  36. package/dist/WavPackParser-w515nnw2.js +5 -0
  37. package/dist/WavPackParser-w515nnw2.js.map +11 -0
  38. package/dist/WaveParser-sb0w9m20.js +5 -0
  39. package/dist/WaveParser-sb0w9m20.js.map +13 -0
  40. package/dist/WizardApp-wr1tftcr.js +5 -0
  41. package/dist/{WizardApp-vzpbydy3.js.map → WizardApp-wr1tftcr.js.map} +3 -3
  42. package/dist/agents.d.ts +19 -3
  43. package/dist/agents.d.ts.map +1 -1
  44. package/dist/channels-gx951qdp.js +31 -0
  45. package/dist/channels-gx951qdp.js.map +10 -0
  46. package/dist/channels.d.ts +26 -0
  47. package/dist/channels.d.ts.map +1 -0
  48. package/dist/client.js +11 -11
  49. package/dist/client.js.map +3 -3
  50. package/dist/config-wvjeejgd.js +24 -0
  51. package/dist/{config-g7za9x13.js.map → config-wvjeejgd.js.map} +2 -2
  52. package/dist/credential-10dn3fxj.js +19 -0
  53. package/dist/{credential-npr6z8c8.js.map → credential-10dn3fxj.js.map} +1 -1
  54. package/dist/daemon.d.ts.map +1 -1
  55. package/dist/index-10009hp8.js +11 -0
  56. package/dist/index-10009hp8.js.map +11 -0
  57. package/dist/index-1xwrkwh5.js +14 -0
  58. package/dist/index-1xwrkwh5.js.map +50 -0
  59. package/dist/index-34p39yfc.js +47 -0
  60. package/dist/index-34p39yfc.js.map +15 -0
  61. package/dist/index-3y96s740.js +6 -0
  62. package/dist/{index-hwpvhaza.js.map → index-3y96s740.js.map} +1 -1
  63. package/dist/index-4ybeefmn.js +6 -0
  64. package/dist/index-4ybeefmn.js.map +11 -0
  65. package/dist/index-59z88wrb.js +6 -0
  66. package/dist/{index-h9mw7b9d.js.map → index-59z88wrb.js.map} +2 -2
  67. package/dist/index-5fwzn21m.js +6 -0
  68. package/dist/{index-gz9x25tz.js.map → index-5fwzn21m.js.map} +2 -2
  69. package/dist/index-6dvnfk8y.js +6 -0
  70. package/dist/index-6dvnfk8y.js.map +10 -0
  71. package/dist/index-6p70fnb7.js +153 -0
  72. package/dist/index-6p70fnb7.js.map +20 -0
  73. package/dist/index-6s471ydn.js +12 -0
  74. package/dist/{index-j55s3ehk.js.map → index-6s471ydn.js.map} +2 -2
  75. package/dist/index-87wcawta.js +6 -0
  76. package/dist/{index-0d93hyfc.js.map → index-87wcawta.js.map} +2 -2
  77. package/dist/index-92gfcbw0.js +6 -0
  78. package/dist/index-92gfcbw0.js.map +9 -0
  79. package/dist/index-a0h0p20f.js +991 -0
  80. package/dist/{index-tv4yv7d2.js.map → index-a0h0p20f.js.map} +27 -23
  81. package/dist/index-bamw24xc.js +6 -0
  82. package/dist/{index-6q4wf8e3.js.map → index-bamw24xc.js.map} +1 -1
  83. package/dist/index-c8ge88a9.js +12 -0
  84. package/dist/{index-258d8bzg.js.map → index-c8ge88a9.js.map} +4 -3
  85. package/dist/index-cb2q8nae.js +6 -0
  86. package/dist/index-cb2q8nae.js.map +13 -0
  87. package/dist/index-ct6bw0a6.js +6 -0
  88. package/dist/{index-4z7axw4r.js.map → index-ct6bw0a6.js.map} +1 -1
  89. package/dist/index-cz6yjxyz.js +10 -0
  90. package/dist/index-cz6yjxyz.js.map +42 -0
  91. package/dist/index-d0c5abkw.js +6 -0
  92. package/dist/{index-vgc3y3rm.js.map → index-d0c5abkw.js.map} +3 -3
  93. package/dist/index-d0vagham.js +31 -0
  94. package/dist/index-d0vagham.js.map +188 -0
  95. package/dist/index-d0zxvr99.js +90 -0
  96. package/dist/index-d0zxvr99.js.map +13 -0
  97. package/dist/{index-s9mbq7h6.js → index-d9c97ver.js} +4 -4
  98. package/dist/{index-s9mbq7h6.js.map → index-d9c97ver.js.map} +1 -1
  99. package/dist/index-e508e0vt.js +6 -0
  100. package/dist/{index-tf71ap9v.js.map → index-e508e0vt.js.map} +1 -1
  101. package/dist/index-esq0knqx.js +6 -0
  102. package/dist/index-esq0knqx.js.map +10 -0
  103. package/dist/index-featyhps.js +6 -0
  104. package/dist/index-featyhps.js.map +10 -0
  105. package/dist/index-fnq44zdt.js +45 -0
  106. package/dist/index-fnq44zdt.js.map +74 -0
  107. package/dist/index-gmn80dwc.js +7 -0
  108. package/dist/{index-02dn6m2j.js.map → index-gmn80dwc.js.map} +2 -2
  109. package/dist/index-gwhx69qs.js +66 -0
  110. package/dist/index-gwhx69qs.js.map +12 -0
  111. package/dist/index-kjgzhf3w.js +9 -0
  112. package/dist/{index-6p999cx4.js.map → index-kjgzhf3w.js.map} +4 -6
  113. package/dist/index-m68cd91a.js +12 -0
  114. package/dist/index-m68cd91a.js.map +23 -0
  115. package/dist/{index-3g3ny01d.js → index-mhmgw54j.js} +4 -4
  116. package/dist/{index-3g3ny01d.js.map → index-mhmgw54j.js.map} +1 -1
  117. package/dist/{index-gme2egyq.js → index-qm612hwa.js} +4 -4
  118. package/dist/{index-gme2egyq.js.map → index-qm612hwa.js.map} +1 -1
  119. package/dist/{index-j7gyr5nx.js → index-qwntpbwe.js} +7 -7
  120. package/dist/{index-j7gyr5nx.js.map → index-qwntpbwe.js.map} +1 -1
  121. package/dist/index-qx3xdk4x.js +6 -0
  122. package/dist/{index-d4x6yvqh.js.map → index-qx3xdk4x.js.map} +3 -4
  123. package/dist/{index-4cf6v9nb.js → index-rh0meegk.js} +4 -4
  124. package/dist/{index-4cf6v9nb.js.map → index-rh0meegk.js.map} +1 -1
  125. package/dist/index-ryb159ff.js +9 -0
  126. package/dist/{index-ff514z3y.js.map → index-ryb159ff.js.map} +3 -5
  127. package/dist/{index-ammv5st7.js → index-s6zfpyqa.js} +6 -6
  128. package/dist/{index-ammv5st7.js.map → index-s6zfpyqa.js.map} +1 -1
  129. package/dist/index-s9va2kmc.js +429 -0
  130. package/dist/index-s9va2kmc.js.map +11 -0
  131. package/dist/index-v5dmsgpx.js +7 -0
  132. package/dist/index-v5dmsgpx.js.map +11 -0
  133. package/dist/index-vaj3mn3a.js +6 -0
  134. package/dist/index-vaj3mn3a.js.map +14 -0
  135. package/dist/index-vy0rbzws.js +6 -0
  136. package/dist/{index-fex44816.js.map → index-vy0rbzws.js.map} +2 -2
  137. package/dist/index-w0s77wfx.js +6 -0
  138. package/dist/{index-v8e92nfw.js.map → index-w0s77wfx.js.map} +1 -1
  139. package/dist/index-wx1jzjzr.js +6 -0
  140. package/dist/{index-qdbq8crg.js.map → index-wx1jzjzr.js.map} +2 -2
  141. package/dist/index-xbn26c8g.js +126 -0
  142. package/dist/index-xbn26c8g.js.map +14 -0
  143. package/dist/index-ytvwyp6k.js +6 -0
  144. package/dist/{index-9r0wyj6w.js.map → index-ytvwyp6k.js.map} +2 -2
  145. package/dist/{index-cqqb6gaq.js → index-yvnwpxbb.js} +5 -5
  146. package/dist/{index-cqqb6gaq.js.map → index-yvnwpxbb.js.map} +1 -1
  147. package/dist/index.js +379 -448
  148. package/dist/index.js.map +26 -28
  149. package/dist/init.d.ts.map +1 -1
  150. package/dist/lib/agent-secrets.d.ts +38 -0
  151. package/dist/lib/agent-secrets.d.ts.map +1 -0
  152. package/dist/lib/agent-template.d.ts +54 -0
  153. package/dist/lib/agent-template.d.ts.map +1 -0
  154. package/dist/lib/channel-actions.d.ts +103 -0
  155. package/dist/lib/channel-actions.d.ts.map +1 -0
  156. package/dist/lib/chat-frame.d.ts +12 -1
  157. package/dist/lib/chat-frame.d.ts.map +1 -1
  158. package/dist/lib/commands.d.ts +13 -0
  159. package/dist/lib/commands.d.ts.map +1 -1
  160. package/dist/lib/const.d.ts +1 -1
  161. package/dist/lib/daemon-plan.d.ts.map +1 -1
  162. package/dist/lib/help.d.ts.map +1 -1
  163. package/dist/lib/host-actions.d.ts +121 -0
  164. package/dist/lib/host-actions.d.ts.map +1 -0
  165. package/dist/lib/init-flow.d.ts +32 -0
  166. package/dist/lib/init-flow.d.ts.map +1 -1
  167. package/dist/lib/init-whatsapp.d.ts +52 -0
  168. package/dist/lib/init-whatsapp.d.ts.map +1 -0
  169. package/dist/lib/plugin-install.d.ts +120 -0
  170. package/dist/lib/plugin-install.d.ts.map +1 -0
  171. package/dist/lib/providers.d.ts.map +1 -1
  172. package/dist/lib/provision.d.ts +13 -0
  173. package/dist/lib/provision.d.ts.map +1 -1
  174. package/dist/lib/readme-table.d.ts +15 -0
  175. package/dist/lib/readme-table.d.ts.map +1 -0
  176. package/dist/lib/sandbox.d.ts +17 -0
  177. package/dist/lib/sandbox.d.ts.map +1 -1
  178. package/dist/lib/schema.d.ts +34 -1
  179. package/dist/lib/schema.d.ts.map +1 -1
  180. package/dist/lib/subcommand.d.ts.map +1 -1
  181. package/dist/lib/web-url.d.ts +15 -0
  182. package/dist/lib/web-url.d.ts.map +1 -0
  183. package/dist/lib/wizard.d.ts.map +1 -1
  184. package/dist/memory.d.ts.map +1 -1
  185. package/dist/model.d.ts.map +1 -1
  186. package/dist/plugins.d.ts +27 -8
  187. package/dist/plugins.d.ts.map +1 -1
  188. package/dist/restart.d.ts +21 -0
  189. package/dist/restart.d.ts.map +1 -0
  190. package/dist/run.d.ts.map +1 -1
  191. package/dist/schedules.d.ts.map +1 -1
  192. package/dist/serve.d.ts.map +1 -1
  193. package/dist/sessions.d.ts.map +1 -1
  194. package/dist/skills.d.ts.map +1 -1
  195. package/dist/status.d.ts +16 -0
  196. package/dist/status.d.ts.map +1 -0
  197. package/dist/tools.d.ts.map +1 -1
  198. package/dist/validate.d.ts.map +1 -1
  199. package/dist/web-61cjhpv2.js +14 -0
  200. package/dist/{web-vkb16r62.js.map → web-61cjhpv2.js.map} +3 -3
  201. package/dist/web.d.ts +2 -13
  202. package/dist/web.d.ts.map +1 -1
  203. package/dist/workspace.d.ts.map +1 -1
  204. package/dist/wrapper-9msjh1xg.js +5 -0
  205. package/dist/wrapper-9msjh1xg.js.map +9 -0
  206. package/package.json +6 -3
  207. package/dist/App-b1yrwrcq.js +0 -11
  208. package/dist/ConfigEditor-n8hdw6r7.js +0 -6
  209. package/dist/KeyProbe-9jjeze5r.js +0 -5
  210. package/dist/Picker-hfeh1g6m.js +0 -5
  211. package/dist/SessionPicker-zyqkg4dn.js +0 -5
  212. package/dist/SkillBrowser-3qdp8080.js +0 -5
  213. package/dist/WizardApp-vzpbydy3.js +0 -5
  214. package/dist/config-g7za9x13.js +0 -24
  215. package/dist/credential-npr6z8c8.js +0 -19
  216. package/dist/index-02dn6m2j.js +0 -7
  217. package/dist/index-0d93hyfc.js +0 -6
  218. package/dist/index-1c5113t4.js +0 -66
  219. package/dist/index-1c5113t4.js.map +0 -12
  220. package/dist/index-258d8bzg.js +0 -12
  221. package/dist/index-4z7axw4r.js +0 -6
  222. package/dist/index-6p999cx4.js +0 -9
  223. package/dist/index-6q4wf8e3.js +0 -6
  224. package/dist/index-9r0wyj6w.js +0 -6
  225. package/dist/index-d4x6yvqh.js +0 -6
  226. package/dist/index-fecm8xe7.js +0 -77
  227. package/dist/index-fecm8xe7.js.map +0 -12
  228. package/dist/index-fex44816.js +0 -6
  229. package/dist/index-ff514z3y.js +0 -14
  230. package/dist/index-gz9x25tz.js +0 -6
  231. package/dist/index-h9mw7b9d.js +0 -6
  232. package/dist/index-hwpvhaza.js +0 -6
  233. package/dist/index-j55s3ehk.js +0 -12
  234. package/dist/index-mtn0g9vc.js +0 -7
  235. package/dist/index-mtn0g9vc.js.map +0 -11
  236. package/dist/index-qdbq8crg.js +0 -6
  237. package/dist/index-tf71ap9v.js +0 -6
  238. package/dist/index-ttwyrdjs.js +0 -427
  239. package/dist/index-ttwyrdjs.js.map +0 -11
  240. package/dist/index-tv4yv7d2.js +0 -903
  241. package/dist/index-ty24n0jh.js +0 -167
  242. package/dist/index-ty24n0jh.js.map +0 -19
  243. package/dist/index-v8e92nfw.js +0 -6
  244. package/dist/index-vgc3y3rm.js +0 -6
  245. package/dist/index-whaw4b18.js +0 -6
  246. package/dist/index-whaw4b18.js.map +0 -10
  247. package/dist/web-vkb16r62.js +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAkCH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,iFAAiF;AAEjF,MAAM,MAAM,UAAU,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAQxD,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAOvE;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAE/E"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA4BH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAG9C,iFAAiF;AAEjF,MAAM,MAAM,UAAU,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAQxD,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAOvE;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAE/E"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * An agent's credentials, set over the API: which ones it reads, and writing them.
3
+ *
4
+ * **The variable is resolved from the manifest, never taken on trust from the caller.** A route that
5
+ * wrote whatever name it was sent would write any variable at all, the one this host authenticates
6
+ * with included. The set a caller may write is exactly the set the agent's own manifest reads, as
7
+ * `${VAR}` or through an `*Env` field. That rule is `ChannelAdmin.setCredential`'s, generalised
8
+ * from one channel to the whole manifest.
9
+ *
10
+ * **Minus the server's own token.** `server.tokenEnv` authenticates callers of the agent's API, and a
11
+ * caller able to set it could replace the credential it is checked against.
12
+ *
13
+ * Values are write-only. `secretStatus` says whether each is set, never what it is.
14
+ */
15
+ export interface SecretStatus {
16
+ readonly name: string;
17
+ /** Whether the agent will see a non-empty value: its `.env` layered under the real environment. */
18
+ readonly set: boolean;
19
+ /** The fields that read it, so a caller can tell `MODEL_API_KEY` for the model from one for a tool. */
20
+ readonly usedBy: readonly string[];
21
+ }
22
+ /** Every variable this agent's manifest reads that a caller may set, in first-use order. */
23
+ export declare function secretStatus(manifestPath: string): readonly SecretStatus[];
24
+ export interface SecretsWritten {
25
+ readonly written: readonly string[];
26
+ /**
27
+ * Written, and not what the agent will see, because the real environment sets the same variable
28
+ * and wins. Precedence is core's and deliberate (an operator's export must beat a file for a
29
+ * container to configure its own agents), so the route reports it rather than overriding it.
30
+ */
31
+ readonly shadowed: readonly string[];
32
+ }
33
+ /**
34
+ * Write values into the `.env` beside the manifest, at 0600. All or nothing: every name is checked
35
+ * before anything is written, so a request naming one wrong variable changes no file.
36
+ */
37
+ export declare function writeSecrets(manifestPath: string, values: Readonly<Record<string, string>>): SecretsWritten;
38
+ //# sourceMappingURL=agent-secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-secrets.d.ts","sourceRoot":"","sources":["../../src/lib/agent-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAWH,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,mGAAmG;IACnG,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB,uGAAuG;IACvG,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CACrC;AAED,4FAA4F;AAC5F,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,YAAY,EAAE,CAgB1E;AAED,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CACvC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CACxB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACzC,cAAc,CAgChB"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Agent templates on disk: listing them, and creating an agent from one.
3
+ *
4
+ * The rendering rules are core's (`manifest/template.ts`, which is pure and has the YAML parser this
5
+ * package deliberately does not). This module is the filesystem half, and it holds the one promise
6
+ * the route makes: **a request that fails leaves nothing behind, and a request that succeeds leaves
7
+ * an agent `run` would load.**
8
+ *
9
+ * So an agent is rendered into memory, written to a staging directory *outside* the agents
10
+ * directory, loaded there by the same check `init` runs, and only then renamed into place. The
11
+ * staging directory is a sibling rather than a dot-directory inside `agents/`, because `listAgents`
12
+ * reads any directory with an `agent.yaml` as an agent. A concurrent listing would otherwise see a
13
+ * half-validated one under a real id.
14
+ *
15
+ * Templates are written by the operator (baked into an image, mounted, copied onto a volume) and
16
+ * never uploaded through the API. A template decides what every agent made from it can do, so
17
+ * authoring one is the operator's act, the same line that keeps the agent's directory off the wire.
18
+ */
19
+ import { type ProvisionResult } from "#lib/provision";
20
+ /** One template, as a client picking one needs to see it. Never a value, and never a secret's. */
21
+ export interface TemplateSummary {
22
+ readonly name: string;
23
+ readonly description?: string;
24
+ readonly vars: readonly {
25
+ readonly name: string;
26
+ readonly description?: string;
27
+ readonly required: boolean;
28
+ readonly default?: string;
29
+ /** A secret is written to the agent's `.env` and never returned. */
30
+ readonly secret: boolean;
31
+ }[];
32
+ /**
33
+ * Why this template cannot be used, when it cannot.
34
+ *
35
+ * Listed rather than hidden, for the reason `listAgents` shows a broken directory: an operator
36
+ * who put a template in place and cannot see it has no way to learn it has a typo.
37
+ */
38
+ readonly problem?: {
39
+ readonly code: string;
40
+ readonly message: string;
41
+ readonly hint: string;
42
+ };
43
+ }
44
+ export declare function listTemplates(dir: string): readonly TemplateSummary[];
45
+ export interface TemplateRequest {
46
+ readonly templatesDir: string;
47
+ /** The sandbox's agents directory. Injected, never computed here, so a test can redirect it. */
48
+ readonly agentDirBase: string;
49
+ readonly template: string;
50
+ readonly name: string;
51
+ readonly vars: Readonly<Record<string, string>>;
52
+ }
53
+ export declare function provisionFromTemplate(input: TemplateRequest): ProvisionResult;
54
+ //# sourceMappingURL=agent-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-template.d.ts","sourceRoot":"","sources":["../../src/lib/agent-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAuBH,OAAO,EAAmB,KAAK,eAAe,EAAmB,MAAM,gBAAgB,CAAA;AAMvF,kGAAkG;AAClG,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS;QACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;QAC7B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;QAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;QACzB,oEAAoE;QACpE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;KAC3B,EAAE,CAAA;IACH;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAChG;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,eAAe,EAAE,CAoCrE;AAwDD,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,gGAAgG;IAChG,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAClD;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CA2E7E"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Connect, disconnect, re-credential and unpair a channel — the four things a person does to one.
3
+ *
4
+ * ## Why this is a module rather than four call sites
5
+ *
6
+ * Every one of these was *possible* already and reachable from nowhere obvious. Disabling a channel
7
+ * meant `config set <agent> channels '[{...the whole list again...}]'`; changing a token meant
8
+ * knowing that `tokenEnv` names a variable and that `config env` writes it; relinking WhatsApp meant
9
+ * finding a directory and deleting it. A capability reachable only by somebody who already knows the
10
+ * field names is a capability the surface is hiding — the standing rule that put every provider in
11
+ * `init`, and the same one applies to the thing a person touches most after creating an agent.
12
+ *
13
+ * So: one module, read by the `channels` command and by the HTTP routes the browser calls. Two
14
+ * surfaces over one implementation, which is the only way they cannot disagree — and the lesson this
15
+ * project has paid for repeatedly, most recently where `validate` and `run` disagreed about a cold
16
+ * Composio cache.
17
+ *
18
+ * ## What "connect" means, and what it cannot mean
19
+ *
20
+ * `enabled: true` in the manifest, and nothing more. A channel is constructed at boot and
21
+ * `Runtime.create` is what starts it, so flipping the flag on a running agent takes effect at its
22
+ * next start — `manifest_changed` already says so for every other setting and this is no different.
23
+ * Pretending otherwise by hot-starting a transport here would make "connected" mean two different
24
+ * things depending on which surface you asked.
25
+ */
26
+ import { type AgentManifest } from "@dispach/core";
27
+ /** One channel as every surface reports it, before any runtime state is layered on. */
28
+ export interface ChannelEntry {
29
+ readonly id: string;
30
+ readonly type: string;
31
+ readonly enabled: boolean;
32
+ /** The env var this channel's credential lives in, when it has one. */
33
+ readonly credentialEnv?: string;
34
+ /**
35
+ * Whether that variable currently has a value.
36
+ *
37
+ * The **name and whether it is set**, never the value. A surface that could read a credential
38
+ * back is one a leaked operator key turns into a credential dump, and nothing needs it: the only
39
+ * question anybody asks is "is this filled in".
40
+ */
41
+ readonly credentialSet?: boolean;
42
+ /**
43
+ * The WhatsApp account this channel links to, when one is configured.
44
+ *
45
+ * Its presence is what decides *how* pairing happens — a code typed into the phone rather than
46
+ * a QR — so a listing that did not carry it had to describe the method with a constant, and
47
+ * that constant said "paired by QR" for a channel that pairs by code and has never paired.
48
+ */
49
+ readonly pairWith?: string;
50
+ /**
51
+ * Whether a pairing already exists on disk.
52
+ *
53
+ * A fact about the filesystem rather than about a running process, which is exactly why it
54
+ * belongs in a manifest-reading listing: "is this linked" is answerable without a host, and
55
+ * answering it is the difference between "connected" and something true.
56
+ */
57
+ readonly paired?: boolean;
58
+ /** Where a WhatsApp session lives, as written. Relative paths are relative to the manifest. */
59
+ readonly authDir?: string;
60
+ /** Senders this channel accepts. Inbound only. */
61
+ readonly allowFrom: readonly string[];
62
+ }
63
+ export declare function channelsOf(manifestPath: string): readonly ChannelEntry[];
64
+ /**
65
+ * Flip one channel's `enabled`, leaving every other entry byte-identical.
66
+ *
67
+ * Read-modify-write through `editManifest`, the one manifest writer, rather than asking a caller to
68
+ * send the whole `channels` list back. Sending the list is what `config set` does and it is right
69
+ * for a person editing YAML; for a button it would mean the browser reconstructing an array it did
70
+ * not author, and two clients racing on that lose an entry rather than a flag.
71
+ */
72
+ export declare function setChannelEnabled(manifestPath: string, channelId: string, enabled: boolean): Promise<{
73
+ readonly note: string;
74
+ readonly changed: boolean;
75
+ }>;
76
+ /**
77
+ * Write a channel's credential into the `.env` beside the manifest.
78
+ *
79
+ * The variable is the one the *manifest* names, resolved here rather than taken from the caller: a
80
+ * surface that let a client name the variable would let it write any variable at all, including the
81
+ * API token this server authenticates with.
82
+ */
83
+ export declare function setChannelCredential(manifestPath: string, channelId: string, value: string): {
84
+ readonly note: string;
85
+ readonly variable: string;
86
+ };
87
+ /**
88
+ * Delete a stored pairing on disk.
89
+ *
90
+ * The on-disk path, used when no live transport can be asked — a stopped agent, or one whose
91
+ * channels a `run`-mode host never started. Both routes end in the same state, which is the state a
92
+ * first start produces.
93
+ */
94
+ export declare function unpairChannel(manifestPath: string, channelId: string): {
95
+ readonly note: string;
96
+ };
97
+ /** Where a channel that stores a pairing keeps it, so a stopped agent can be unpaired too. */
98
+ export declare function pairingDirOf(manifestPath: string, channel: {
99
+ readonly type: string;
100
+ readonly authDir?: unknown;
101
+ }): string | undefined;
102
+ export type { AgentManifest };
103
+ //# sourceMappingURL=channel-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel-actions.d.ts","sourceRoot":"","sources":["../../src/lib/channel-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EACH,KAAK,aAAa,EAKrB,MAAM,eAAe,CAAA;AAGtB,uFAAuF;AACvF,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,EAAE,EA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AAY,EAAE,MAAM,EACpB,OAAO,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/D,MAAM,GAAG,SAAS,CAIpB;AAED,YAAY,EAAE,aAAa,EAAE,CAAA"}
@@ -35,7 +35,6 @@ import type { EditorState, LiveTurn } from "#lib/types";
35
35
  * composer takes is a row of conversation, and this is the function that charges for them.
36
36
  */
37
37
  export declare function promptRows(editor: EditorState, columns: number): number;
38
- /** The slash-command list: its matches, its overflow notices, and the line naming its keys. */
39
38
  export declare function paletteRows(palette: Palette | undefined, maxRows: number): number;
40
39
  /** `^R`'s match list plus its query line. Zero when the search is closed. */
41
40
  export declare function searchRows(editor: EditorState, maxRows: number): number;
@@ -60,6 +59,18 @@ export interface ChatFrame {
60
59
  * Returned so the split happens once, in the caller that knows the mark's rendered height.
61
60
  */
62
61
  readonly body: number;
62
+ /**
63
+ * Rows the palette may actually use — its requested ceiling **clamped by the terminal**.
64
+ *
65
+ * `LANDING_LIST_ROWS` is what the landing screen would *like*, and the terminal wins, which is
66
+ * the rule `SkillBrowser` already follows and the chat frame did not. Twenty-three commands at
67
+ * 30 rows asked for 24 rows of palette plus every other piece of chrome, so the frame came out
68
+ * taller than the terminal — and an overflowing frame is corruption rather than a scrollbar:
69
+ * Ink's own output scrolled the buffer and the *first* command went off the top with no counter
70
+ * saying so. Returned rather than clamped silently, because the component has to render the
71
+ * "… N above/below" line against the same number the budget was computed from.
72
+ */
73
+ readonly paletteRows: number;
63
74
  /** Rows the conversation may draw if the mark takes none — its scroll counter already deducted. */
64
75
  readonly transcript: number;
65
76
  /** Rows a pane over the conversation may draw. It replaces the transcript rather than sharing. */
@@ -1 +1 @@
1
- {"version":3,"file":"chat-frame.d.ts","sourceRoot":"","sources":["../../src/lib/chat-frame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAUH,OAAO,KAAK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;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CACzB,GAAG,SAAS,CA4DZ;AAED;;;;;;GAMG;AACH;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CACzB,KAAK,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACxD,MAAM,EAAE;IACJ,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACtB,GACF;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAU/D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CACvB,KAAK,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACxD,MAAM,EAAE;IACJ,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CACzB,GACF,MAAM,GAAG,SAAS,CA8BpB;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAGrF"}
@@ -23,4 +23,17 @@ export declare function flagsFor(command: CommandSpec): readonly FlagSpec[];
23
23
  * that names where it does work.
24
24
  */
25
25
  export declare function commandsAccepting(flag: string, exclude: string): readonly string[];
26
+ /**
27
+ * Split "an action word, or an agent" for a command whose action is optional.
28
+ *
29
+ * `channels <agent>` and `channels list <agent>` are both meant, so the first positional is one or
30
+ * the other and only its *value* says which. The action words win, exactly as a slash command
31
+ * resolves and as `config`'s own reader does — the difference being that this one reads the
32
+ * **command's spec** for the words rather than holding a second copy of them, so an action added to
33
+ * the table is covered with nothing to remember.
34
+ */
35
+ export declare function actionOrRef(command: string, first: string | undefined): {
36
+ readonly action: string | undefined;
37
+ readonly ref: string | undefined;
38
+ };
26
39
  //# sourceMappingURL=commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/lib/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAW,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEjE,yFAAyF;AACzF,eAAO,MAAM,YAAY,EAAE,SAAS,QAAQ,EAgB3C,CAAA;AA6BD,eAAO,MAAM,QAAQ,EAAE,SAAS,WAAW,EAw+B1C,CAAA;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEjE;AAED,kEAAkE;AAClE,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,QAAQ,EAAE,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAIlF"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/lib/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAW,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEjE,yFAAyF;AACzF,eAAO,MAAM,YAAY,EAAE,SAAS,QAAQ,EAgB3C,CAAA;AA6BD,eAAO,MAAM,QAAQ,EAAE,SAAS,WAAW,EAkqC1C,CAAA;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEjE;AAED,kEAAkE;AAClE,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,QAAQ,EAAE,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAIlF;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACvB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GAAG,SAAS,GAC1B;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAS3E"}
@@ -167,7 +167,7 @@ export declare const MIN_BODY_ROWS = 3;
167
167
  * `… 1 below`. It is not derived from `COMMANDS` directly because `commands.ts` reads this module, and the
168
168
  * cycle would cost more than the assertion does.
169
169
  */
170
- export declare const LANDING_LIST_ROWS = 22;
170
+ export declare const LANDING_LIST_ROWS = 23;
171
171
  /**
172
172
  * Rows of conversation the landing screen keeps, whatever the brand mark would like.
173
173
  *
@@ -1 +1 @@
1
- {"version":3,"file":"daemon-plan.d.ts","sourceRoot":"","sources":["../../src/lib/daemon-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAA6B,KAAK,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjE,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;AAEvC,MAAM,WAAW,OAAO;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,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,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,SAAe,GAAG,MAAM,CAGrE;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,SAAS,EAAE,CA4BlE;AAED,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,CAAA;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;CACpC;AAKD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,YAAY,CA2DlF;AAsCD,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAEzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/lib/help.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAY,MAAM,aAAa,CAAA;AA8CxD,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAqCtD"}
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/lib/help.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAY,MAAM,aAAa,CAAA;AAgDxD,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAqCtD"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Getting an agent hosted, adopted and reloaded — the sequence three commands share.
3
+ *
4
+ * `init`, `channels pair` and `restart` each need the same three moves: make sure a host is up
5
+ * (the bootstrap), have it adopt the agent (`POST /start`), and have it pick up a change
6
+ * (`POST /reload`). Written once, because three copies is how one of them comes to do the middle
7
+ * step and skip the last — and a pairing whose session sits on disk unread by the process that is
8
+ * supposed to answer is exactly the "paired, now run `serve` by hand" dead end this exists to close.
9
+ *
10
+ * Everything here talks to a host through the lease table and HTTP, never through the service
11
+ * manager: a host started by hand, by launchd, by systemd or by a container is the same host once
12
+ * it holds a lease, and the lease is the one witness every surface already trusts.
13
+ */
14
+ import type { LeaseRecord } from "@dispach/core";
15
+ import { type BootstrapOutcome, type BootstrapResult } from "#lib/bootstrap";
16
+ import { type HostReply } from "#lib/lifecycle";
17
+ /**
18
+ * Install and start the server unit, as the bootstrap does it.
19
+ *
20
+ * Reuses `daemonCommand` rather than reaching into the service layer, so a bootstrapped unit and
21
+ * one installed by hand are byte-identical — a second plan builder is how the two come to differ in
22
+ * a way nobody notices until one of them will not start. Its output is swallowed: the bootstrap's
23
+ * whole contract is *one line*, and `daemon install`'s four-row report in front of `agents` would
24
+ * be the opposite.
25
+ */
26
+ export declare function installServerUnit(): Promise<BootstrapResult>;
27
+ export type Installer = () => Promise<BootstrapResult>;
28
+ export interface EnsureHostOptions {
29
+ /** How to start one when none is up. Absent means "do not try" — a test, or a caller that must not install. */
30
+ readonly install?: Installer;
31
+ readonly store?: string;
32
+ readonly env?: Readonly<Record<string, string | undefined>>;
33
+ /** How long to wait for a freshly started server to claim its lease. */
34
+ readonly waitMs?: number;
35
+ }
36
+ /**
37
+ * A host with an HTTP address, starting one if allowed and none is up.
38
+ *
39
+ * `host` is `undefined` when nothing could be reached — a platform we do not drive, a container,
40
+ * CI, no installer, or a unit that installed and did not come up in time. The outcome says which,
41
+ * and the caller prints `announce(outcome)` so the person sees the same one line the bootstrap
42
+ * prints everywhere else.
43
+ */
44
+ export declare function ensureHost(options?: EnsureHostOptions): Promise<{
45
+ readonly outcome: BootstrapOutcome;
46
+ readonly host: LeaseRecord | undefined;
47
+ }>;
48
+ /**
49
+ * Have `host` serve this agent, unless something already does.
50
+ *
51
+ * `POST /v1/agents/:id/start` is also what `start` posts; a running host that already holds the
52
+ * lease is left alone rather than asked to start what it is serving.
53
+ */
54
+ export declare function adoptOnHost(host: LeaseRecord, manifestPath: string, store?: string): Promise<HostReply & {
55
+ readonly already?: true;
56
+ }>;
57
+ export type ReloadResult = {
58
+ readonly kind: "reloaded";
59
+ readonly pid: number;
60
+ readonly adopted: readonly string[];
61
+ } | {
62
+ readonly kind: "busy";
63
+ readonly pid: number;
64
+ } | {
65
+ readonly kind: "failed";
66
+ readonly pid: number;
67
+ readonly status: number;
68
+ readonly detail?: string;
69
+ readonly hint?: string;
70
+ } | {
71
+ readonly kind: "no-host";
72
+ };
73
+ /**
74
+ * Ask the host holding this agent to rebuild it from disk.
75
+ *
76
+ * `POST /v1/agents/:id/reload` disposes and re-creates the agent from its manifest, so a pairing
77
+ * written beside it, a token added to `.env` or an edited `agent.yaml` take effect without a
78
+ * restart of the process that hosts every other agent too. `409` is a turn in flight and is
79
+ * reported as such rather than retried: the person asked for a reload, not for a turn to be cut.
80
+ */
81
+ export declare function reloadOnHost(manifestPath: string, store?: string): Promise<ReloadResult>;
82
+ export interface LiveChannel {
83
+ readonly id: string;
84
+ readonly status: string;
85
+ readonly detail?: string;
86
+ readonly input?: {
87
+ readonly kind: string;
88
+ readonly payload: string;
89
+ readonly expiresAt?: string;
90
+ };
91
+ }
92
+ /**
93
+ * The channel states the host holding this agent reports, or `undefined` when nothing does.
94
+ *
95
+ * Best effort throughout: a host that refuses, has no HTTP, or answers something unexpected leaves
96
+ * the caller with the manifest view rather than a failed command. Reading a file must not start
97
+ * depending on a socket.
98
+ */
99
+ export declare function liveChannels(manifestPath: string, store?: string): Promise<Map<string, LiveChannel> | undefined>;
100
+ export type HostPairOutcome = "paired" | "no-code" | "timeout";
101
+ export interface WaitForPairingOptions {
102
+ readonly manifestPath: string;
103
+ readonly channelId: string;
104
+ readonly store?: string;
105
+ readonly out?: (text: string) => void;
106
+ /** How long to wait for the host to offer a code. */
107
+ readonly codeWaitMs?: number;
108
+ /** How long to wait for the phone once the code is on screen. */
109
+ readonly pairWaitMs?: number;
110
+ readonly pollMs?: number;
111
+ }
112
+ /**
113
+ * Show the code the host is offering and wait for the phone.
114
+ *
115
+ * The host does the pairing — it holds the socket to WhatsApp, and when the phone accepts, the
116
+ * session is already in the process that will answer. Nothing to reload afterwards, which is the
117
+ * whole reason this path is preferred over pairing in this process and asking the host to pick it
118
+ * up. Bounded twice: for the code to appear and for the phone to act, each named on the way out.
119
+ */
120
+ export declare function waitForPairing(options: WaitForPairingOptions): Promise<HostPairOutcome>;
121
+ //# sourceMappingURL=host-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-actions.d.ts","sourceRoot":"","sources":["../../src/lib/host-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGhD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAgB,MAAM,gBAAgB,CAAA;AAE1F,OAAO,EAIH,KAAK,SAAS,EAGjB,MAAM,gBAAgB,CAAA;AAEvB;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,eAAe,CAAC,CAmBlE;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,CAAA;AAEtD,MAAM,WAAW,iBAAiB;IAC9B,+GAA+G;IAC/G,QAAQ,CAAC,OAAO,CAAC,EAA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AAO,CAAC,eAAe,CAAC,CAwB7F"}
@@ -130,6 +130,17 @@ export interface InitAnswers {
130
130
  * generated manifest hidden, which is why the rule is now standing rather than case by case.
131
131
  */
132
132
  readonly telegram: string;
133
+ /**
134
+ * WhatsApp, asked separately from Telegram rather than as one multi-select.
135
+ *
136
+ * Two independent single-selects is the cheapest correct shape and satisfies "both at once"
137
+ * naturally. The alternative — one `none | telegram | whatsapp | both` answer — would need the
138
+ * pure wizard reducer to store more than one value per question, and would need
139
+ * `ProvisionStep.requires` to name two values so a browser form kept the follow-up fields
140
+ * visible under `both`: a breaking wire change for nothing. It also matches how `system`, `web`
141
+ * and `composio` already work — one capability, one question.
142
+ */
143
+ readonly whatsapp: string;
133
144
  /**
134
145
  * The bot token, written to the gitignored `.env`. Same rule as every other secret: the
135
146
  * manifest names the variable, no flag accepts the value.
@@ -143,6 +154,8 @@ export interface InitAnswers {
143
154
  * into the file, because a wrong handle fails the same way an empty list does and says less.
144
155
  */
145
156
  readonly telegramAllow?: string;
157
+ /** A WhatsApp number in digits. There is no token: pairing is a QR, not a credential. */
158
+ readonly whatsappNumber?: string;
146
159
  /**
147
160
  * Whether to serve the HTTP API: `none` or `local`.
148
161
  *
@@ -352,6 +365,25 @@ export declare const TELEGRAM_CHOICES: readonly {
352
365
  readonly label: string;
353
366
  }[];
354
367
  export declare function telegramChoice(value: string): (typeof TELEGRAM_CHOICES)[number] | undefined;
368
+ /**
369
+ * WhatsApp, and the label carries the warning because this is where the choice is made.
370
+ *
371
+ * Baileys reverse-engineers WhatsApp Web with no appeal path when a number is banned, so the one
372
+ * sentence that matters — pair a spare number — belongs at the moment somebody says yes, not three
373
+ * files away in a README they will read afterwards if at all.
374
+ */
375
+ /**
376
+ * Where the plugin is published, and the name it installs under.
377
+ *
378
+ * Derived from the brand rather than written, because hard rule 3 puts the product name in exactly
379
+ * one file — and a rename that left a literal here would print an install command for a repository
380
+ * that does not exist. The owner is a person's GitHub handle, which a rename does not move.
381
+ */
382
+ export declare const WHATSAPP_CHOICES: readonly {
383
+ readonly value: string;
384
+ readonly label: string;
385
+ }[];
386
+ export declare function whatsappChoice(value: string): (typeof WHATSAPP_CHOICES)[number] | undefined;
355
387
  /**
356
388
  * Whether to serve the HTTP surface.
357
389
  *
@@ -1 +1 @@
1
- {"version":3,"file":"init-flow.d.ts","sourceRoot":"","sources":["../../src/lib/init-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAgBvF,CAAA;AAED,2FAA2F;AAC3F,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAA8C,CAAA;AAEjG,MAAM,MAAM,QAAQ,GACd,QAAQ,GACR,WAAW,GACX,UAAU,GACV,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,cAAc,GACd,QAAQ,CAAA;AAEd,MAAM,WAAW,MAAM;IACnB,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,uFAAuF;IACvF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,OAAO,EAAE,SAAS,MAAM,EAiE3B,CAAA;AAEV,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEzD;AAED,MAAM,WAAW,WAAW;IACxB,yBAAyB;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA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AC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM5C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAChC;AAED,wBAAgB,YAAY,CACxB,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,gBAAgB,GAC3B,QAAQ,GAAG,SAAS,CA4PtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAepD;AAED,MAAM,MAAM,QAAQ,GACd;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAIrD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAkOpE;AA+ID,yFAAyF;AACzF,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAE7D;AAED,kEAAkE;AAClE,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,MAAM,EAAE,CAEtE;AA6GD,MAAM,WAAW,aAAa;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,aAAa,EAAE,CA+CxE"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Pairing WhatsApp during `init`, between writing the files and finishing.
3
+ *
4
+ * ## Why here rather than "run these two commands afterwards"
5
+ *
6
+ * Somebody who has just typed their WhatsApp number has said what they want; sending them away to
7
+ * start a server and run a second command to collect a code is answering a question with homework.
8
+ * The catalogue interlude set the precedent — an answer that costs time gets its own screen inside
9
+ * the flow, not a paragraph of instructions after it.
10
+ *
11
+ * It sits **after the files are written** for the same reason the skills install does: the channel
12
+ * is constructed from the manifest that was just validated, so there is exactly one description of
13
+ * this channel rather than a second one assembled from the answers.
14
+ *
15
+ * ## What it must not do
16
+ *
17
+ * **It must never fail the init and must never hang.** The agent is already written and valid by the
18
+ * time this runs; a pairing that does not happen is a thing to do later, not a reason to have no
19
+ * agent. Every path here reports and returns, and the wait is bounded — which matters more than
20
+ * usual because the transport **does not pair under Bun**, where no code ever arrives and an
21
+ * unbounded wait would turn the last step of onboarding into a hang.
22
+ *
23
+ * **It is skipped without a terminal.** A scripted `--yes` run has nobody to read a code or hold a
24
+ * phone, and opening a socket to WhatsApp in CI is the expensive default the wizard's own fallback
25
+ * rule exists to prevent. The commands that do it later are named instead.
26
+ */
27
+ import { CHANNELS } from "#lib/providers";
28
+ export interface PairRequest {
29
+ readonly manifestPath: string;
30
+ readonly dir: string;
31
+ readonly number: string;
32
+ readonly channelId: string;
33
+ /** Where the manifest keeps the session. Defaults to the channel's own default. */
34
+ readonly authDir?: string;
35
+ /** Injected by tests, which never reach WhatsApp. */
36
+ readonly factory?: typeof CHANNELS.whatsapp;
37
+ readonly codeWaitMs?: number;
38
+ readonly pairWaitMs?: number;
39
+ readonly out?: (text: string) => void;
40
+ }
41
+ export type PairOutcome = "paired" | "code-shown" | "no-code" | "unavailable";
42
+ /**
43
+ * Offer a pairing code and wait for the phone. Never throws.
44
+ *
45
+ * Returns what happened so the caller's closing message can be honest about it — a "next steps"
46
+ * block that says "scan the code" after no code appeared is the kind of true-sounding wrong this
47
+ * project keeps finding.
48
+ */
49
+ export declare function pairWhatsApp(request: PairRequest): Promise<PairOutcome>;
50
+ /** What to tell somebody who did not finish pairing here. One sentence per route. */
51
+ export declare function pairLater(agentRef: string): string;
52
+ //# sourceMappingURL=init-whatsapp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-whatsapp.d.ts","sourceRoot":"","sources":["../../src/lib/init-whatsapp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAczC,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,mFAAmF;IACnF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,qDAAqD;IACrD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,QAAQ,CAAC,QAAQ,CAAA;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACxC;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,GAAG,aAAa,CAAA;AAE7E;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CA6F7E;AAOD,qFAAqF;AACrF,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElD"}