@withbuddi/buddi 0.1.0-pre.16 → 0.1.0-pre.18

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 (816) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +27 -26
  3. package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
  4. package/node_modules/@buddi/cli/dist/args.d.ts +9 -3
  5. package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
  6. package/node_modules/@buddi/cli/dist/args.js +25 -89
  7. package/node_modules/@buddi/cli/dist/args.js.map +1 -1
  8. package/node_modules/@buddi/cli/dist/backup/index.d.ts +2 -0
  9. package/node_modules/@buddi/cli/dist/backup/index.d.ts.map +1 -1
  10. package/node_modules/@buddi/cli/dist/backup/index.js +13 -4
  11. package/node_modules/@buddi/cli/dist/backup/index.js.map +1 -1
  12. package/node_modules/@buddi/cli/dist/commands.d.ts +94 -0
  13. package/node_modules/@buddi/cli/dist/commands.d.ts.map +1 -0
  14. package/node_modules/@buddi/cli/dist/commands.js +993 -0
  15. package/node_modules/@buddi/cli/dist/commands.js.map +1 -0
  16. package/node_modules/@buddi/cli/dist/index.d.ts +3 -1
  17. package/node_modules/@buddi/cli/dist/index.d.ts.map +1 -1
  18. package/node_modules/@buddi/cli/dist/index.js +3 -1
  19. package/node_modules/@buddi/cli/dist/index.js.map +1 -1
  20. package/node_modules/@buddi/cli/dist/jobs-cmd.d.ts +4 -0
  21. package/node_modules/@buddi/cli/dist/jobs-cmd.d.ts.map +1 -1
  22. package/node_modules/@buddi/cli/dist/jobs-cmd.js +26 -7
  23. package/node_modules/@buddi/cli/dist/jobs-cmd.js.map +1 -1
  24. package/node_modules/@buddi/cli/dist/main.d.ts +9 -2
  25. package/node_modules/@buddi/cli/dist/main.d.ts.map +1 -1
  26. package/node_modules/@buddi/cli/dist/main.js +246 -30
  27. package/node_modules/@buddi/cli/dist/main.js.map +1 -1
  28. package/node_modules/@buddi/cli/dist/mcp/gateway-client.d.ts +1 -1
  29. package/node_modules/@buddi/cli/dist/mcp/gateway-client.js +1 -1
  30. package/node_modules/@buddi/cli/dist/mcp/secrets.d.ts +1 -1
  31. package/node_modules/@buddi/cli/dist/mcp/secrets.js +1 -1
  32. package/node_modules/@buddi/cli/dist/mcp/server.d.ts +1 -1
  33. package/node_modules/@buddi/cli/dist/mcp/server.js +1 -1
  34. package/node_modules/@buddi/cli/dist/mcp/tools.d.ts +1 -1
  35. package/node_modules/@buddi/cli/dist/mcp/tools.js +1 -1
  36. package/node_modules/@buddi/cli/dist/paths.d.ts +8 -5
  37. package/node_modules/@buddi/cli/dist/paths.d.ts.map +1 -1
  38. package/node_modules/@buddi/cli/dist/paths.js +36 -10
  39. package/node_modules/@buddi/cli/dist/paths.js.map +1 -1
  40. package/node_modules/@buddi/cli/dist/status.d.ts +70 -0
  41. package/node_modules/@buddi/cli/dist/status.d.ts.map +1 -0
  42. package/node_modules/@buddi/cli/dist/status.js +122 -0
  43. package/node_modules/@buddi/cli/dist/status.js.map +1 -0
  44. package/node_modules/@buddi/cli/dist/style.d.ts +13 -0
  45. package/node_modules/@buddi/cli/dist/style.d.ts.map +1 -0
  46. package/node_modules/@buddi/cli/dist/style.js +10 -0
  47. package/node_modules/@buddi/cli/dist/style.js.map +1 -0
  48. package/node_modules/@buddi/cli/dist/telegram-cmd.d.ts +1 -1
  49. package/node_modules/@buddi/cli/dist/telegram-cmd.d.ts.map +1 -1
  50. package/node_modules/@buddi/cli/dist/telegram-cmd.js +23 -6
  51. package/node_modules/@buddi/cli/dist/telegram-cmd.js.map +1 -1
  52. package/node_modules/@buddi/cli/dist/vault-cmd.js +3 -3
  53. package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
  54. package/node_modules/@buddi/core/dist/actions/approvals.d.ts +0 -17
  55. package/node_modules/@buddi/core/dist/actions/approvals.d.ts.map +1 -1
  56. package/node_modules/@buddi/core/dist/actions/approvals.js +21 -0
  57. package/node_modules/@buddi/core/dist/actions/approvals.js.map +1 -1
  58. package/node_modules/@buddi/core/dist/actions/execute.d.ts +1 -1
  59. package/node_modules/@buddi/core/dist/actions/jobs.d.ts +1 -1
  60. package/node_modules/@buddi/core/dist/actions/types.js +1 -1
  61. package/node_modules/@buddi/core/dist/agents/provider-from-env.d.ts +1 -1
  62. package/node_modules/@buddi/core/dist/agents/provider-from-env.js +1 -1
  63. package/node_modules/@buddi/core/dist/agents/skills.js +1 -1
  64. package/node_modules/@buddi/core/dist/goals/types.d.ts +1 -1
  65. package/node_modules/@buddi/core/dist/goals/types.js +1 -1
  66. package/node_modules/@buddi/core/dist/host/build.d.ts +15 -1
  67. package/node_modules/@buddi/core/dist/host/build.d.ts.map +1 -1
  68. package/node_modules/@buddi/core/dist/host/build.js +101 -3
  69. package/node_modules/@buddi/core/dist/host/build.js.map +1 -1
  70. package/node_modules/@buddi/core/dist/host/http.d.ts +1 -1
  71. package/node_modules/@buddi/core/dist/host/http.d.ts.map +1 -1
  72. package/node_modules/@buddi/core/dist/host/http.js +1 -1
  73. package/node_modules/@buddi/core/dist/host/http.js.map +1 -1
  74. package/node_modules/@buddi/core/dist/host/types.d.ts +92 -5
  75. package/node_modules/@buddi/core/dist/host/types.d.ts.map +1 -1
  76. package/node_modules/@buddi/core/dist/index.d.ts +1 -0
  77. package/node_modules/@buddi/core/dist/index.d.ts.map +1 -1
  78. package/node_modules/@buddi/core/dist/index.js +1 -0
  79. package/node_modules/@buddi/core/dist/index.js.map +1 -1
  80. package/node_modules/@buddi/core/dist/learning/echoes.d.ts +1 -1
  81. package/node_modules/@buddi/core/dist/learning/echoes.js +1 -1
  82. package/node_modules/@buddi/core/dist/learning/policies.d.ts +1 -1
  83. package/node_modules/@buddi/core/dist/learning/skill-files.js +1 -1
  84. package/node_modules/@buddi/core/dist/learning/types.d.ts +2 -2
  85. package/node_modules/@buddi/core/dist/notifications/channels.d.ts +37 -0
  86. package/node_modules/@buddi/core/dist/notifications/channels.d.ts.map +1 -0
  87. package/node_modules/@buddi/core/dist/notifications/channels.js +87 -0
  88. package/node_modules/@buddi/core/dist/notifications/channels.js.map +1 -0
  89. package/node_modules/@buddi/core/dist/notifications/index.d.ts +5 -0
  90. package/node_modules/@buddi/core/dist/notifications/index.d.ts.map +1 -0
  91. package/node_modules/@buddi/core/dist/notifications/index.js +5 -0
  92. package/node_modules/@buddi/core/dist/notifications/index.js.map +1 -0
  93. package/node_modules/@buddi/core/dist/notifications/notify.d.ts +35 -0
  94. package/node_modules/@buddi/core/dist/notifications/notify.d.ts.map +1 -0
  95. package/node_modules/@buddi/core/dist/notifications/notify.js +262 -0
  96. package/node_modules/@buddi/core/dist/notifications/notify.js.map +1 -0
  97. package/node_modules/@buddi/core/dist/notifications/store.d.ts +48 -0
  98. package/node_modules/@buddi/core/dist/notifications/store.d.ts.map +1 -0
  99. package/node_modules/@buddi/core/dist/notifications/store.js +207 -0
  100. package/node_modules/@buddi/core/dist/notifications/store.js.map +1 -0
  101. package/node_modules/@buddi/core/dist/notifications/types.d.ts +136 -0
  102. package/node_modules/@buddi/core/dist/notifications/types.d.ts.map +1 -0
  103. package/node_modules/@buddi/core/dist/notifications/types.js +5 -0
  104. package/node_modules/@buddi/core/dist/notifications/types.js.map +1 -0
  105. package/node_modules/@buddi/core/dist/owner.js +1 -1
  106. package/node_modules/@buddi/core/dist/pages/__fixtures__/demo.js +1 -1
  107. package/node_modules/@buddi/core/dist/pages.d.ts +4 -4
  108. package/node_modules/@buddi/core/dist/pages.js +1 -1
  109. package/node_modules/@buddi/core/dist/plugin/index.d.ts +2 -2
  110. package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
  111. package/node_modules/@buddi/core/dist/plugin/index.js +1 -1
  112. package/node_modules/@buddi/core/dist/plugin/search.d.ts +1 -1
  113. package/node_modules/@buddi/core/dist/plugin/search.js +1 -1
  114. package/node_modules/@buddi/core/dist/plugin/url.js +1 -1
  115. package/node_modules/@buddi/core/dist/plugin/uses.d.ts +2 -2
  116. package/node_modules/@buddi/core/dist/plugin/uses.d.ts.map +1 -1
  117. package/node_modules/@buddi/core/dist/plugin/uses.js +5 -1
  118. package/node_modules/@buddi/core/dist/plugin/uses.js.map +1 -1
  119. package/node_modules/@buddi/core/dist/plugin/version.d.ts +2 -2
  120. package/node_modules/@buddi/core/dist/plugin/version.js +2 -2
  121. package/node_modules/@buddi/core/dist/provider.d.ts +1 -1
  122. package/node_modules/@buddi/core/dist/provider.js +1 -1
  123. package/node_modules/@buddi/core/dist/queue/retry-policy.d.ts +1 -1
  124. package/node_modules/@buddi/core/dist/queue/retry-policy.js +1 -1
  125. package/node_modules/@buddi/core/dist/registry.d.ts.map +1 -1
  126. package/node_modules/@buddi/core/dist/registry.js +4 -5
  127. package/node_modules/@buddi/core/dist/registry.js.map +1 -1
  128. package/node_modules/@buddi/core/dist/reminders/store.d.ts +1 -1
  129. package/node_modules/@buddi/core/dist/reminders/store.js +1 -1
  130. package/node_modules/@buddi/core/dist/reminders/types.d.ts +1 -1
  131. package/node_modules/@buddi/core/dist/reminders/types.js +1 -1
  132. package/node_modules/@buddi/core/dist/secrets/approval.d.ts +1 -1
  133. package/node_modules/@buddi/core/dist/secrets/approval.js +1 -1
  134. package/node_modules/@buddi/core/dist/secrets/destinations.d.ts +1 -1
  135. package/node_modules/@buddi/core/dist/secrets/scrub.js +1 -1
  136. package/node_modules/@buddi/core/dist/secrets/settings.js +1 -1
  137. package/node_modules/@buddi/core/dist/secrets/store.d.ts +1 -1
  138. package/node_modules/@buddi/core/dist/secrets/totp.js +1 -1
  139. package/node_modules/@buddi/core/dist/secrets/use.d.ts +1 -1
  140. package/node_modules/@buddi/core/dist/sentinels/types.d.ts +1 -1
  141. package/node_modules/@buddi/core/dist/testing/index.d.ts +1 -1
  142. package/node_modules/@buddi/core/dist/testing/index.js +1 -1
  143. package/node_modules/@buddi/core/dist/time.d.ts +12 -0
  144. package/node_modules/@buddi/core/dist/time.d.ts.map +1 -1
  145. package/node_modules/@buddi/core/dist/time.js +46 -0
  146. package/node_modules/@buddi/core/dist/time.js.map +1 -1
  147. package/node_modules/@buddi/core/dist/tools.d.ts +10 -10
  148. package/node_modules/@buddi/core/dist/vault/file.js +2 -2
  149. package/node_modules/@buddi/core/dist/vault/keychain.js +1 -1
  150. package/node_modules/@buddi/core/dist/vault/keychain.js.map +1 -1
  151. package/node_modules/@buddi/core/dist/vault/resolve.d.ts +3 -3
  152. package/node_modules/@buddi/core/dist/vault/resolve.js +3 -3
  153. package/node_modules/@buddi/core/dist/vault/types.d.ts +1 -1
  154. package/node_modules/@buddi/core/dist/vault/types.js +2 -2
  155. package/node_modules/@buddi/core/migrations/003_owner_surfaces.sql +1 -1
  156. package/node_modules/@buddi/core/migrations/005_artifacts.sql +1 -1
  157. package/node_modules/@buddi/core/migrations/009_queue.sql +1 -2
  158. package/node_modules/@buddi/core/migrations/010_actions.sql +1 -1
  159. package/node_modules/@buddi/core/migrations/043_owner_notifications.sql +77 -0
  160. package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
  161. package/node_modules/@buddi/gateway/dist/agents/catalog.d.ts.map +1 -1
  162. package/node_modules/@buddi/gateway/dist/agents/catalog.js +5 -6
  163. package/node_modules/@buddi/gateway/dist/agents/catalog.js.map +1 -1
  164. package/node_modules/@buddi/gateway/dist/agents/learned-skills.js +1 -1
  165. package/node_modules/@buddi/gateway/dist/agents/learning-digest.d.ts +1 -1
  166. package/node_modules/@buddi/gateway/dist/agents/learning-digest.js +1 -1
  167. package/node_modules/@buddi/gateway/dist/agents/learning.d.ts +1 -1
  168. package/node_modules/@buddi/gateway/dist/agents/learning.js +1 -1
  169. package/node_modules/@buddi/gateway/dist/agents-cli.d.ts +25 -1
  170. package/node_modules/@buddi/gateway/dist/agents-cli.d.ts.map +1 -1
  171. package/node_modules/@buddi/gateway/dist/agents-cli.js +91 -27
  172. package/node_modules/@buddi/gateway/dist/agents-cli.js.map +1 -1
  173. package/node_modules/@buddi/gateway/dist/bootstrap.d.ts.map +1 -1
  174. package/node_modules/@buddi/gateway/dist/bootstrap.js +10 -2
  175. package/node_modules/@buddi/gateway/dist/bootstrap.js.map +1 -1
  176. package/node_modules/@buddi/gateway/dist/channels/local-notification.d.ts +39 -0
  177. package/node_modules/@buddi/gateway/dist/channels/local-notification.d.ts.map +1 -0
  178. package/node_modules/@buddi/gateway/dist/channels/local-notification.js +154 -0
  179. package/node_modules/@buddi/gateway/dist/channels/local-notification.js.map +1 -0
  180. package/node_modules/@buddi/gateway/dist/chat/approvals.d.ts +3 -3
  181. package/node_modules/@buddi/gateway/dist/chat/approvals.js +3 -3
  182. package/node_modules/@buddi/gateway/dist/cli.d.ts +14 -0
  183. package/node_modules/@buddi/gateway/dist/cli.d.ts.map +1 -1
  184. package/node_modules/@buddi/gateway/dist/cli.js +208 -37
  185. package/node_modules/@buddi/gateway/dist/cli.js.map +1 -1
  186. package/node_modules/@buddi/gateway/dist/db-ready.d.ts +2 -1
  187. package/node_modules/@buddi/gateway/dist/db-ready.d.ts.map +1 -1
  188. package/node_modules/@buddi/gateway/dist/db-ready.js +3 -2
  189. package/node_modules/@buddi/gateway/dist/db-ready.js.map +1 -1
  190. package/node_modules/@buddi/gateway/dist/index.d.ts +4 -1
  191. package/node_modules/@buddi/gateway/dist/index.d.ts.map +1 -1
  192. package/node_modules/@buddi/gateway/dist/index.js +5 -1
  193. package/node_modules/@buddi/gateway/dist/index.js.map +1 -1
  194. package/node_modules/@buddi/gateway/dist/mcp/requests.d.ts +1 -1
  195. package/node_modules/@buddi/gateway/dist/mcp/requests.js +1 -1
  196. package/node_modules/@buddi/gateway/dist/missions/agent-run.d.ts.map +1 -1
  197. package/node_modules/@buddi/gateway/dist/missions/agent-run.js +10 -1
  198. package/node_modules/@buddi/gateway/dist/missions/agent-run.js.map +1 -1
  199. package/node_modules/@buddi/gateway/dist/missions/execute.d.ts +16 -2
  200. package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
  201. package/node_modules/@buddi/gateway/dist/missions/execute.js +6 -1
  202. package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
  203. package/node_modules/@buddi/gateway/dist/missions/goals-page.d.ts +1 -1
  204. package/node_modules/@buddi/gateway/dist/missions/goals-page.js +1 -1
  205. package/node_modules/@buddi/gateway/dist/missions/goals.d.ts +1 -1
  206. package/node_modules/@buddi/gateway/dist/missions/goals.js +1 -1
  207. package/node_modules/@buddi/gateway/dist/missions/watcher-mail.d.ts +1 -1
  208. package/node_modules/@buddi/gateway/dist/missions/watcher-mail.js +1 -1
  209. package/node_modules/@buddi/gateway/dist/missions-cli.d.ts +2 -0
  210. package/node_modules/@buddi/gateway/dist/missions-cli.d.ts.map +1 -1
  211. package/node_modules/@buddi/gateway/dist/missions-cli.js +53 -8
  212. package/node_modules/@buddi/gateway/dist/missions-cli.js.map +1 -1
  213. package/node_modules/@buddi/gateway/dist/owner-notify.d.ts +43 -0
  214. package/node_modules/@buddi/gateway/dist/owner-notify.d.ts.map +1 -0
  215. package/node_modules/@buddi/gateway/dist/owner-notify.js +87 -0
  216. package/node_modules/@buddi/gateway/dist/owner-notify.js.map +1 -0
  217. package/node_modules/@buddi/gateway/dist/owner-secrets.d.ts +3 -3
  218. package/node_modules/@buddi/gateway/dist/owner-secrets.js +3 -3
  219. package/node_modules/@buddi/gateway/dist/plugins/load.d.ts +1 -1
  220. package/node_modules/@buddi/gateway/dist/plugins/load.js +1 -1
  221. package/node_modules/@buddi/gateway/dist/plugins/scaffold.js +1 -1
  222. package/node_modules/@buddi/gateway/dist/plugins/stage.d.ts +2 -2
  223. package/node_modules/@buddi/gateway/dist/plugins/stage.js +1 -1
  224. package/node_modules/@buddi/gateway/dist/plugins-cli.d.ts +3 -1
  225. package/node_modules/@buddi/gateway/dist/plugins-cli.d.ts.map +1 -1
  226. package/node_modules/@buddi/gateway/dist/plugins-cli.js +11 -4
  227. package/node_modules/@buddi/gateway/dist/plugins-cli.js.map +1 -1
  228. package/node_modules/@buddi/gateway/dist/provider-accounts.js +1 -1
  229. package/node_modules/@buddi/gateway/dist/provider-accounts.js.map +1 -1
  230. package/node_modules/@buddi/gateway/dist/reminders-cli.d.ts +3 -1
  231. package/node_modules/@buddi/gateway/dist/reminders-cli.d.ts.map +1 -1
  232. package/node_modules/@buddi/gateway/dist/reminders-cli.js +21 -2
  233. package/node_modules/@buddi/gateway/dist/reminders-cli.js.map +1 -1
  234. package/node_modules/@buddi/gateway/dist/serve.d.ts +2 -0
  235. package/node_modules/@buddi/gateway/dist/serve.d.ts.map +1 -1
  236. package/node_modules/@buddi/gateway/dist/serve.js +62 -15
  237. package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
  238. package/node_modules/@buddi/gateway/dist/telegram/approvals.d.ts +3 -3
  239. package/node_modules/@buddi/gateway/dist/telegram/approvals.js +3 -3
  240. package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts +30 -0
  241. package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts.map +1 -0
  242. package/node_modules/@buddi/gateway/dist/telegram/channel.js +49 -0
  243. package/node_modules/@buddi/gateway/dist/telegram/channel.js.map +1 -0
  244. package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts.map +1 -1
  245. package/node_modules/@buddi/gateway/dist/telegram/surface.js +4 -1
  246. package/node_modules/@buddi/gateway/dist/telegram/surface.js.map +1 -1
  247. package/node_modules/@buddi/gateway/dist/web/config.js +3 -3
  248. package/node_modules/@buddi/gateway/dist/web/http.d.ts +16 -3
  249. package/node_modules/@buddi/gateway/dist/web/http.d.ts.map +1 -1
  250. package/node_modules/@buddi/gateway/dist/web/http.js +39 -3
  251. package/node_modules/@buddi/gateway/dist/web/http.js.map +1 -1
  252. package/node_modules/@buddi/gateway/dist/web/notifications.d.ts +36 -0
  253. package/node_modules/@buddi/gateway/dist/web/notifications.d.ts.map +1 -0
  254. package/node_modules/@buddi/gateway/dist/web/notifications.js +63 -0
  255. package/node_modules/@buddi/gateway/dist/web/notifications.js.map +1 -0
  256. package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts +1 -1
  257. package/node_modules/@buddi/gateway/dist/web/onboarding.js +1 -1
  258. package/node_modules/@buddi/gateway/dist/web/pages.js +1 -1
  259. package/node_modules/@buddi/gateway/dist/web/read.js +3 -3
  260. package/node_modules/@buddi/gateway/dist/web/secrets.d.ts +1 -1
  261. package/node_modules/@buddi/gateway/dist/web/server.d.ts +1 -1
  262. package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
  263. package/node_modules/@buddi/gateway/dist/web/server.js +37 -25
  264. package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
  265. package/node_modules/@buddi/gateway/dist/web/version.d.ts +1 -0
  266. package/node_modules/@buddi/gateway/dist/web/version.d.ts.map +1 -1
  267. package/node_modules/@buddi/gateway/dist/web/version.js +2 -1
  268. package/node_modules/@buddi/gateway/dist/web/version.js.map +1 -1
  269. package/node_modules/@buddi/gateway/dist/web/write.js +1 -1
  270. package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
  271. package/node_modules/@buddi/install/dist/environment.d.ts +29 -0
  272. package/node_modules/@buddi/install/dist/environment.d.ts.map +1 -1
  273. package/node_modules/@buddi/install/dist/environment.js +50 -1
  274. package/node_modules/@buddi/install/dist/environment.js.map +1 -1
  275. package/node_modules/@buddi/install/dist/launcher.d.ts +3 -1
  276. package/node_modules/@buddi/install/dist/launcher.d.ts.map +1 -1
  277. package/node_modules/@buddi/install/dist/launcher.js +93 -12
  278. package/node_modules/@buddi/install/dist/launcher.js.map +1 -1
  279. package/node_modules/@buddi/install/dist/upgrade.d.ts +16 -3
  280. package/node_modules/@buddi/install/dist/upgrade.d.ts.map +1 -1
  281. package/node_modules/@buddi/install/dist/upgrade.js +21 -7
  282. package/node_modules/@buddi/install/dist/upgrade.js.map +1 -1
  283. package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
  284. package/node_modules/@buddi/runtime/dist/anthropic.d.ts +35 -2
  285. package/node_modules/@buddi/runtime/dist/anthropic.d.ts.map +1 -1
  286. package/node_modules/@buddi/runtime/dist/anthropic.js +36 -12
  287. package/node_modules/@buddi/runtime/dist/anthropic.js.map +1 -1
  288. package/node_modules/@buddi/runtime/dist/delegate.js +1 -1
  289. package/node_modules/@buddi/runtime/dist/loop.d.ts +13 -1
  290. package/node_modules/@buddi/runtime/dist/loop.d.ts.map +1 -1
  291. package/node_modules/@buddi/runtime/dist/loop.js +70 -3
  292. package/node_modules/@buddi/runtime/dist/loop.js.map +1 -1
  293. package/node_modules/@buddi/runtime/dist/openai.d.ts.map +1 -1
  294. package/node_modules/@buddi/runtime/dist/openai.js +9 -6
  295. package/node_modules/@buddi/runtime/dist/openai.js.map +1 -1
  296. package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
  297. package/node_modules/@buddi/tool-artifacts/dist/index.d.ts +1 -1
  298. package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
  299. package/node_modules/@buddi/tool-browser/dist/availability.d.ts +34 -8
  300. package/node_modules/@buddi/tool-browser/dist/availability.d.ts.map +1 -1
  301. package/node_modules/@buddi/tool-browser/dist/availability.js +44 -5
  302. package/node_modules/@buddi/tool-browser/dist/availability.js.map +1 -1
  303. package/node_modules/@buddi/tool-browser/dist/controller.d.ts +2 -2
  304. package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
  305. package/node_modules/@buddi/tool-browser/dist/controller.js +7 -6
  306. package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
  307. package/node_modules/@buddi/tool-browser/dist/extension.d.ts +1 -1
  308. package/node_modules/@buddi/tool-browser/dist/extension.js +1 -1
  309. package/node_modules/@buddi/tool-browser/dist/host.d.ts +3 -1
  310. package/node_modules/@buddi/tool-browser/dist/host.d.ts.map +1 -1
  311. package/node_modules/@buddi/tool-browser/dist/host.js +5 -1
  312. package/node_modules/@buddi/tool-browser/dist/host.js.map +1 -1
  313. package/node_modules/@buddi/tool-browser/dist/index.d.ts +1 -1
  314. package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
  315. package/node_modules/@buddi/tool-browser/dist/index.js +1 -1
  316. package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
  317. package/node_modules/@buddi/tool-browser/dist/secrets.d.ts +2 -2
  318. package/node_modules/@buddi/tool-browser/dist/service.d.ts +4 -4
  319. package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
  320. package/node_modules/@buddi/tool-browser/dist/service.js +1 -1
  321. package/node_modules/@buddi/tool-browser/dist/types.d.ts +1 -1
  322. package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
  323. package/node_modules/@buddi/tool-email/dist/attachments/safety.d.ts +1 -1
  324. package/node_modules/@buddi/tool-email/dist/attachments/safety.js +1 -1
  325. package/node_modules/@buddi/tool-email/dist/channel.d.ts +43 -0
  326. package/node_modules/@buddi/tool-email/dist/channel.d.ts.map +1 -0
  327. package/node_modules/@buddi/tool-email/dist/channel.js +99 -0
  328. package/node_modules/@buddi/tool-email/dist/channel.js.map +1 -0
  329. package/node_modules/@buddi/tool-email/dist/credentials.d.ts +1 -1
  330. package/node_modules/@buddi/tool-email/dist/dates.d.ts +1 -1
  331. package/node_modules/@buddi/tool-email/dist/dates.js +1 -1
  332. package/node_modules/@buddi/tool-email/dist/drafts.d.ts +2 -2
  333. package/node_modules/@buddi/tool-email/dist/drafts.js +1 -1
  334. package/node_modules/@buddi/tool-email/dist/index.d.ts +1 -0
  335. package/node_modules/@buddi/tool-email/dist/index.d.ts.map +1 -1
  336. package/node_modules/@buddi/tool-email/dist/index.js +13 -6
  337. package/node_modules/@buddi/tool-email/dist/index.js.map +1 -1
  338. package/node_modules/@buddi/tool-email/dist/mail.d.ts +4 -4
  339. package/node_modules/@buddi/tool-email/dist/mail.js +4 -4
  340. package/node_modules/@buddi/tool-email/dist/pages/accounts.d.ts +2 -2
  341. package/node_modules/@buddi/tool-email/dist/pages/descriptors.js +7 -7
  342. package/node_modules/@buddi/tool-email/dist/pages/descriptors.js.map +1 -1
  343. package/node_modules/@buddi/tool-email/dist/pages/drafts-tools.d.ts +1 -1
  344. package/node_modules/@buddi/tool-email/dist/pages/index.d.ts +1 -1
  345. package/node_modules/@buddi/tool-email/dist/pages/policies-tools.d.ts +2 -2
  346. package/node_modules/@buddi/tool-email/dist/pages/policies-tools.js +1 -1
  347. package/node_modules/@buddi/tool-email/dist/pages/queries.d.ts +2 -2
  348. package/node_modules/@buddi/tool-email/dist/pages/queries.d.ts.map +1 -1
  349. package/node_modules/@buddi/tool-email/dist/pages/queries.js +3 -3
  350. package/node_modules/@buddi/tool-email/dist/pages/queries.js.map +1 -1
  351. package/node_modules/@buddi/tool-email/dist/phrases.d.ts +2 -2
  352. package/node_modules/@buddi/tool-email/dist/phrases.js +2 -2
  353. package/node_modules/@buddi/tool-email/dist/policies/gate.js +2 -2
  354. package/node_modules/@buddi/tool-email/dist/policies/learn.d.ts +3 -3
  355. package/node_modules/@buddi/tool-email/dist/policies/learn.js +1 -1
  356. package/node_modules/@buddi/tool-email/dist/policies/learned.d.ts +1 -1
  357. package/node_modules/@buddi/tool-email/dist/ports.d.ts +4 -4
  358. package/node_modules/@buddi/tool-email/dist/ports.js +1 -1
  359. package/node_modules/@buddi/tool-email/dist/rows.d.ts +1 -1
  360. package/node_modules/@buddi/tool-email/dist/rows.js +1 -1
  361. package/node_modules/@buddi/tool-email/dist/search.js +2 -2
  362. package/node_modules/@buddi/tool-email/dist/sentinels/date-stated.d.ts +1 -1
  363. package/node_modules/@buddi/tool-email/dist/sentinels/index.d.ts +1 -1
  364. package/node_modules/@buddi/tool-email/dist/sentinels/index.js +1 -1
  365. package/node_modules/@buddi/tool-email/dist/sentinels/index.js.map +1 -1
  366. package/node_modules/@buddi/tool-email/dist/sentinels/promised-reply.d.ts +1 -1
  367. package/node_modules/@buddi/tool-email/dist/sentinels/receipt-or-bill.d.ts +1 -1
  368. package/node_modules/@buddi/tool-email/dist/sentinels/suspicious-sender.d.ts +1 -1
  369. package/node_modules/@buddi/tool-email/dist/sentinels/unanswered-by-them.d.ts +1 -1
  370. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.d.ts +2 -2
  371. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.d.ts.map +1 -1
  372. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.js +1 -1
  373. package/node_modules/@buddi/tool-email/dist/sources/inbox-poll.js +5 -5
  374. package/node_modules/@buddi/tool-email/dist/sources/inbox-poll.js.map +1 -1
  375. package/node_modules/@buddi/tool-email/dist/sources/retention.js +1 -1
  376. package/node_modules/@buddi/tool-email/dist/sources/retention.js.map +1 -1
  377. package/node_modules/@buddi/tool-email/dist/suspicions-store.d.ts +1 -1
  378. package/node_modules/@buddi/tool-email/dist/tools/attachments.d.ts +1 -1
  379. package/node_modules/@buddi/tool-email/dist/tools/attachments.js +1 -1
  380. package/node_modules/@buddi/tool-email/dist/tools/drafts.d.ts +1 -1
  381. package/node_modules/@buddi/tool-email/dist/tools/drafts.js +3 -3
  382. package/node_modules/@buddi/tool-email/dist/tools/drafts.js.map +1 -1
  383. package/node_modules/@buddi/tool-email/dist/tools/policies.d.ts +1 -1
  384. package/node_modules/@buddi/tool-email/dist/tools/send.d.ts +1 -1
  385. package/node_modules/@buddi/tool-email/dist/tools/send.js +4 -4
  386. package/node_modules/@buddi/tool-email/dist/tools/send.js.map +1 -1
  387. package/node_modules/@buddi/tool-email/dist/tools/settings.d.ts +1 -1
  388. package/node_modules/@buddi/tool-email/dist/tools/triage.js +2 -2
  389. package/node_modules/@buddi/tool-email/dist/watchers.d.ts +1 -1
  390. package/node_modules/@buddi/tool-email/dist/watchers.js +1 -1
  391. package/node_modules/@buddi/tool-email/dist/watchers.js.map +1 -1
  392. package/node_modules/@buddi/tool-email/migrations/001_email.sql +3 -2
  393. package/node_modules/@buddi/tool-email/package.json +2 -1
  394. package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
  395. package/node_modules/@buddi/tool-memory/dist/.tsbuildinfo +1 -1
  396. package/node_modules/@buddi/tool-memory/dist/index.js +1 -1
  397. package/node_modules/@buddi/tool-memory/migrations/001_memory.sql +1 -1
  398. package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
  399. package/node_modules/@buddi/tool-web/dist/guard.d.ts +1 -1
  400. package/node_modules/@buddi/tool-web/dist/guard.js +1 -1
  401. package/package.json +6 -2
  402. package/packages/cli/dist/.tsbuildinfo +1 -1
  403. package/packages/cli/dist/args.d.ts +9 -3
  404. package/packages/cli/dist/args.d.ts.map +1 -1
  405. package/packages/cli/dist/args.js +25 -89
  406. package/packages/cli/dist/args.js.map +1 -1
  407. package/packages/cli/dist/backup/index.d.ts +2 -0
  408. package/packages/cli/dist/backup/index.d.ts.map +1 -1
  409. package/packages/cli/dist/backup/index.js +13 -4
  410. package/packages/cli/dist/backup/index.js.map +1 -1
  411. package/packages/cli/dist/commands.d.ts +94 -0
  412. package/packages/cli/dist/commands.d.ts.map +1 -0
  413. package/packages/cli/dist/commands.js +993 -0
  414. package/packages/cli/dist/commands.js.map +1 -0
  415. package/packages/cli/dist/index.d.ts +3 -1
  416. package/packages/cli/dist/index.d.ts.map +1 -1
  417. package/packages/cli/dist/index.js +3 -1
  418. package/packages/cli/dist/index.js.map +1 -1
  419. package/packages/cli/dist/jobs-cmd.d.ts +4 -0
  420. package/packages/cli/dist/jobs-cmd.d.ts.map +1 -1
  421. package/packages/cli/dist/jobs-cmd.js +26 -7
  422. package/packages/cli/dist/jobs-cmd.js.map +1 -1
  423. package/packages/cli/dist/main.d.ts +9 -2
  424. package/packages/cli/dist/main.d.ts.map +1 -1
  425. package/packages/cli/dist/main.js +246 -30
  426. package/packages/cli/dist/main.js.map +1 -1
  427. package/packages/cli/dist/mcp/gateway-client.d.ts +1 -1
  428. package/packages/cli/dist/mcp/gateway-client.js +1 -1
  429. package/packages/cli/dist/mcp/secrets.d.ts +1 -1
  430. package/packages/cli/dist/mcp/secrets.js +1 -1
  431. package/packages/cli/dist/mcp/server.d.ts +1 -1
  432. package/packages/cli/dist/mcp/server.js +1 -1
  433. package/packages/cli/dist/mcp/tools.d.ts +1 -1
  434. package/packages/cli/dist/mcp/tools.js +1 -1
  435. package/packages/cli/dist/paths.d.ts +8 -5
  436. package/packages/cli/dist/paths.d.ts.map +1 -1
  437. package/packages/cli/dist/paths.js +36 -10
  438. package/packages/cli/dist/paths.js.map +1 -1
  439. package/packages/cli/dist/status.d.ts +70 -0
  440. package/packages/cli/dist/status.d.ts.map +1 -0
  441. package/packages/cli/dist/status.js +122 -0
  442. package/packages/cli/dist/status.js.map +1 -0
  443. package/packages/cli/dist/style.d.ts +13 -0
  444. package/packages/cli/dist/style.d.ts.map +1 -0
  445. package/packages/cli/dist/style.js +10 -0
  446. package/packages/cli/dist/style.js.map +1 -0
  447. package/packages/cli/dist/telegram-cmd.d.ts +1 -1
  448. package/packages/cli/dist/telegram-cmd.d.ts.map +1 -1
  449. package/packages/cli/dist/telegram-cmd.js +23 -6
  450. package/packages/cli/dist/telegram-cmd.js.map +1 -1
  451. package/packages/cli/dist/vault-cmd.js +3 -3
  452. package/packages/core/dist/.tsbuildinfo +1 -1
  453. package/packages/core/dist/actions/approvals.d.ts +0 -17
  454. package/packages/core/dist/actions/approvals.d.ts.map +1 -1
  455. package/packages/core/dist/actions/approvals.js +21 -0
  456. package/packages/core/dist/actions/approvals.js.map +1 -1
  457. package/packages/core/dist/actions/execute.d.ts +1 -1
  458. package/packages/core/dist/actions/jobs.d.ts +1 -1
  459. package/packages/core/dist/actions/types.js +1 -1
  460. package/packages/core/dist/agents/provider-from-env.d.ts +1 -1
  461. package/packages/core/dist/agents/provider-from-env.js +1 -1
  462. package/packages/core/dist/agents/skills.js +1 -1
  463. package/packages/core/dist/goals/types.d.ts +1 -1
  464. package/packages/core/dist/goals/types.js +1 -1
  465. package/packages/core/dist/host/build.d.ts +15 -1
  466. package/packages/core/dist/host/build.d.ts.map +1 -1
  467. package/packages/core/dist/host/build.js +101 -3
  468. package/packages/core/dist/host/build.js.map +1 -1
  469. package/packages/core/dist/host/http.d.ts +1 -1
  470. package/packages/core/dist/host/http.d.ts.map +1 -1
  471. package/packages/core/dist/host/http.js +1 -1
  472. package/packages/core/dist/host/http.js.map +1 -1
  473. package/packages/core/dist/host/types.d.ts +92 -5
  474. package/packages/core/dist/host/types.d.ts.map +1 -1
  475. package/packages/core/dist/index.d.ts +1 -0
  476. package/packages/core/dist/index.d.ts.map +1 -1
  477. package/packages/core/dist/index.js +1 -0
  478. package/packages/core/dist/index.js.map +1 -1
  479. package/packages/core/dist/learning/echoes.d.ts +1 -1
  480. package/packages/core/dist/learning/echoes.js +1 -1
  481. package/packages/core/dist/learning/policies.d.ts +1 -1
  482. package/packages/core/dist/learning/skill-files.js +1 -1
  483. package/packages/core/dist/learning/types.d.ts +2 -2
  484. package/packages/core/dist/notifications/channels.d.ts +37 -0
  485. package/packages/core/dist/notifications/channels.d.ts.map +1 -0
  486. package/packages/core/dist/notifications/channels.js +87 -0
  487. package/packages/core/dist/notifications/channels.js.map +1 -0
  488. package/packages/core/dist/notifications/index.d.ts +5 -0
  489. package/packages/core/dist/notifications/index.d.ts.map +1 -0
  490. package/packages/core/dist/notifications/index.js +5 -0
  491. package/packages/core/dist/notifications/index.js.map +1 -0
  492. package/packages/core/dist/notifications/notify.d.ts +35 -0
  493. package/packages/core/dist/notifications/notify.d.ts.map +1 -0
  494. package/packages/core/dist/notifications/notify.js +262 -0
  495. package/packages/core/dist/notifications/notify.js.map +1 -0
  496. package/packages/core/dist/notifications/store.d.ts +48 -0
  497. package/packages/core/dist/notifications/store.d.ts.map +1 -0
  498. package/packages/core/dist/notifications/store.js +207 -0
  499. package/packages/core/dist/notifications/store.js.map +1 -0
  500. package/packages/core/dist/notifications/types.d.ts +136 -0
  501. package/packages/core/dist/notifications/types.d.ts.map +1 -0
  502. package/packages/core/dist/notifications/types.js +5 -0
  503. package/packages/core/dist/notifications/types.js.map +1 -0
  504. package/packages/core/dist/owner.js +1 -1
  505. package/packages/core/dist/pages/__fixtures__/demo.js +1 -1
  506. package/packages/core/dist/pages.d.ts +4 -4
  507. package/packages/core/dist/pages.js +1 -1
  508. package/packages/core/dist/plugin/index.d.ts +2 -2
  509. package/packages/core/dist/plugin/index.d.ts.map +1 -1
  510. package/packages/core/dist/plugin/index.js +1 -1
  511. package/packages/core/dist/plugin/search.d.ts +1 -1
  512. package/packages/core/dist/plugin/search.js +1 -1
  513. package/packages/core/dist/plugin/url.js +1 -1
  514. package/packages/core/dist/plugin/uses.d.ts +2 -2
  515. package/packages/core/dist/plugin/uses.d.ts.map +1 -1
  516. package/packages/core/dist/plugin/uses.js +5 -1
  517. package/packages/core/dist/plugin/uses.js.map +1 -1
  518. package/packages/core/dist/plugin/version.d.ts +2 -2
  519. package/packages/core/dist/plugin/version.js +2 -2
  520. package/packages/core/dist/provider.d.ts +1 -1
  521. package/packages/core/dist/provider.js +1 -1
  522. package/packages/core/dist/queue/retry-policy.d.ts +1 -1
  523. package/packages/core/dist/queue/retry-policy.js +1 -1
  524. package/packages/core/dist/registry.d.ts.map +1 -1
  525. package/packages/core/dist/registry.js +4 -5
  526. package/packages/core/dist/registry.js.map +1 -1
  527. package/packages/core/dist/reminders/store.d.ts +1 -1
  528. package/packages/core/dist/reminders/store.js +1 -1
  529. package/packages/core/dist/reminders/types.d.ts +1 -1
  530. package/packages/core/dist/reminders/types.js +1 -1
  531. package/packages/core/dist/secrets/approval.d.ts +1 -1
  532. package/packages/core/dist/secrets/approval.js +1 -1
  533. package/packages/core/dist/secrets/destinations.d.ts +1 -1
  534. package/packages/core/dist/secrets/scrub.js +1 -1
  535. package/packages/core/dist/secrets/settings.js +1 -1
  536. package/packages/core/dist/secrets/store.d.ts +1 -1
  537. package/packages/core/dist/secrets/totp.js +1 -1
  538. package/packages/core/dist/secrets/use.d.ts +1 -1
  539. package/packages/core/dist/sentinels/types.d.ts +1 -1
  540. package/packages/core/dist/testing/index.d.ts +1 -1
  541. package/packages/core/dist/testing/index.js +1 -1
  542. package/packages/core/dist/time.d.ts +12 -0
  543. package/packages/core/dist/time.d.ts.map +1 -1
  544. package/packages/core/dist/time.js +46 -0
  545. package/packages/core/dist/time.js.map +1 -1
  546. package/packages/core/dist/tools.d.ts +10 -10
  547. package/packages/core/dist/vault/file.js +2 -2
  548. package/packages/core/dist/vault/keychain.js +1 -1
  549. package/packages/core/dist/vault/keychain.js.map +1 -1
  550. package/packages/core/dist/vault/resolve.d.ts +3 -3
  551. package/packages/core/dist/vault/resolve.js +3 -3
  552. package/packages/core/dist/vault/types.d.ts +1 -1
  553. package/packages/core/dist/vault/types.js +2 -2
  554. package/packages/core/migrations/003_owner_surfaces.sql +1 -1
  555. package/packages/core/migrations/005_artifacts.sql +1 -1
  556. package/packages/core/migrations/009_queue.sql +1 -2
  557. package/packages/core/migrations/010_actions.sql +1 -1
  558. package/packages/core/migrations/043_owner_notifications.sql +77 -0
  559. package/packages/gateway/dist/.tsbuildinfo +1 -1
  560. package/packages/gateway/dist/agents/catalog.d.ts.map +1 -1
  561. package/packages/gateway/dist/agents/catalog.js +5 -6
  562. package/packages/gateway/dist/agents/catalog.js.map +1 -1
  563. package/packages/gateway/dist/agents/learned-skills.js +1 -1
  564. package/packages/gateway/dist/agents/learning-digest.d.ts +1 -1
  565. package/packages/gateway/dist/agents/learning-digest.js +1 -1
  566. package/packages/gateway/dist/agents/learning.d.ts +1 -1
  567. package/packages/gateway/dist/agents/learning.js +1 -1
  568. package/packages/gateway/dist/agents-cli.d.ts +25 -1
  569. package/packages/gateway/dist/agents-cli.d.ts.map +1 -1
  570. package/packages/gateway/dist/agents-cli.js +91 -27
  571. package/packages/gateway/dist/agents-cli.js.map +1 -1
  572. package/packages/gateway/dist/bootstrap.d.ts.map +1 -1
  573. package/packages/gateway/dist/bootstrap.js +10 -2
  574. package/packages/gateway/dist/bootstrap.js.map +1 -1
  575. package/packages/gateway/dist/channels/local-notification.d.ts +39 -0
  576. package/packages/gateway/dist/channels/local-notification.d.ts.map +1 -0
  577. package/packages/gateway/dist/channels/local-notification.js +154 -0
  578. package/packages/gateway/dist/channels/local-notification.js.map +1 -0
  579. package/packages/gateway/dist/chat/approvals.d.ts +3 -3
  580. package/packages/gateway/dist/chat/approvals.js +3 -3
  581. package/packages/gateway/dist/cli.d.ts +14 -0
  582. package/packages/gateway/dist/cli.d.ts.map +1 -1
  583. package/packages/gateway/dist/cli.js +208 -37
  584. package/packages/gateway/dist/cli.js.map +1 -1
  585. package/packages/gateway/dist/db-ready.d.ts +2 -1
  586. package/packages/gateway/dist/db-ready.d.ts.map +1 -1
  587. package/packages/gateway/dist/db-ready.js +3 -2
  588. package/packages/gateway/dist/db-ready.js.map +1 -1
  589. package/packages/gateway/dist/index.d.ts +4 -1
  590. package/packages/gateway/dist/index.d.ts.map +1 -1
  591. package/packages/gateway/dist/index.js +5 -1
  592. package/packages/gateway/dist/index.js.map +1 -1
  593. package/packages/gateway/dist/mcp/requests.d.ts +1 -1
  594. package/packages/gateway/dist/mcp/requests.js +1 -1
  595. package/packages/gateway/dist/missions/agent-run.d.ts.map +1 -1
  596. package/packages/gateway/dist/missions/agent-run.js +10 -1
  597. package/packages/gateway/dist/missions/agent-run.js.map +1 -1
  598. package/packages/gateway/dist/missions/execute.d.ts +16 -2
  599. package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
  600. package/packages/gateway/dist/missions/execute.js +6 -1
  601. package/packages/gateway/dist/missions/execute.js.map +1 -1
  602. package/packages/gateway/dist/missions/goals-page.d.ts +1 -1
  603. package/packages/gateway/dist/missions/goals-page.js +1 -1
  604. package/packages/gateway/dist/missions/goals.d.ts +1 -1
  605. package/packages/gateway/dist/missions/goals.js +1 -1
  606. package/packages/gateway/dist/missions/watcher-mail.d.ts +1 -1
  607. package/packages/gateway/dist/missions/watcher-mail.js +1 -1
  608. package/packages/gateway/dist/missions-cli.d.ts +2 -0
  609. package/packages/gateway/dist/missions-cli.d.ts.map +1 -1
  610. package/packages/gateway/dist/missions-cli.js +53 -8
  611. package/packages/gateway/dist/missions-cli.js.map +1 -1
  612. package/packages/gateway/dist/owner-notify.d.ts +43 -0
  613. package/packages/gateway/dist/owner-notify.d.ts.map +1 -0
  614. package/packages/gateway/dist/owner-notify.js +87 -0
  615. package/packages/gateway/dist/owner-notify.js.map +1 -0
  616. package/packages/gateway/dist/owner-secrets.d.ts +3 -3
  617. package/packages/gateway/dist/owner-secrets.js +3 -3
  618. package/packages/gateway/dist/plugins/load.d.ts +1 -1
  619. package/packages/gateway/dist/plugins/load.js +1 -1
  620. package/packages/gateway/dist/plugins/scaffold.js +1 -1
  621. package/packages/gateway/dist/plugins/stage.d.ts +2 -2
  622. package/packages/gateway/dist/plugins/stage.js +1 -1
  623. package/packages/gateway/dist/plugins-cli.d.ts +3 -1
  624. package/packages/gateway/dist/plugins-cli.d.ts.map +1 -1
  625. package/packages/gateway/dist/plugins-cli.js +11 -4
  626. package/packages/gateway/dist/plugins-cli.js.map +1 -1
  627. package/packages/gateway/dist/provider-accounts.js +1 -1
  628. package/packages/gateway/dist/provider-accounts.js.map +1 -1
  629. package/packages/gateway/dist/reminders-cli.d.ts +3 -1
  630. package/packages/gateway/dist/reminders-cli.d.ts.map +1 -1
  631. package/packages/gateway/dist/reminders-cli.js +21 -2
  632. package/packages/gateway/dist/reminders-cli.js.map +1 -1
  633. package/packages/gateway/dist/serve.d.ts +2 -0
  634. package/packages/gateway/dist/serve.d.ts.map +1 -1
  635. package/packages/gateway/dist/serve.js +62 -15
  636. package/packages/gateway/dist/serve.js.map +1 -1
  637. package/packages/gateway/dist/telegram/approvals.d.ts +3 -3
  638. package/packages/gateway/dist/telegram/approvals.js +3 -3
  639. package/packages/gateway/dist/telegram/channel.d.ts +30 -0
  640. package/packages/gateway/dist/telegram/channel.d.ts.map +1 -0
  641. package/packages/gateway/dist/telegram/channel.js +49 -0
  642. package/packages/gateway/dist/telegram/channel.js.map +1 -0
  643. package/packages/gateway/dist/telegram/surface.d.ts.map +1 -1
  644. package/packages/gateway/dist/telegram/surface.js +4 -1
  645. package/packages/gateway/dist/telegram/surface.js.map +1 -1
  646. package/packages/gateway/dist/web/config.js +3 -3
  647. package/packages/gateway/dist/web/http.d.ts +16 -3
  648. package/packages/gateway/dist/web/http.d.ts.map +1 -1
  649. package/packages/gateway/dist/web/http.js +39 -3
  650. package/packages/gateway/dist/web/http.js.map +1 -1
  651. package/packages/gateway/dist/web/notifications.d.ts +36 -0
  652. package/packages/gateway/dist/web/notifications.d.ts.map +1 -0
  653. package/packages/gateway/dist/web/notifications.js +63 -0
  654. package/packages/gateway/dist/web/notifications.js.map +1 -0
  655. package/packages/gateway/dist/web/onboarding.d.ts +1 -1
  656. package/packages/gateway/dist/web/onboarding.js +1 -1
  657. package/packages/gateway/dist/web/pages.js +1 -1
  658. package/packages/gateway/dist/web/read.js +3 -3
  659. package/packages/gateway/dist/web/secrets.d.ts +1 -1
  660. package/packages/gateway/dist/web/server.d.ts +1 -1
  661. package/packages/gateway/dist/web/server.d.ts.map +1 -1
  662. package/packages/gateway/dist/web/server.js +37 -25
  663. package/packages/gateway/dist/web/server.js.map +1 -1
  664. package/packages/gateway/dist/web/version.d.ts +1 -0
  665. package/packages/gateway/dist/web/version.d.ts.map +1 -1
  666. package/packages/gateway/dist/web/version.js +2 -1
  667. package/packages/gateway/dist/web/version.js.map +1 -1
  668. package/packages/gateway/dist/web/write.js +1 -1
  669. package/packages/install/dist/.tsbuildinfo +1 -1
  670. package/packages/install/dist/environment.d.ts +29 -0
  671. package/packages/install/dist/environment.d.ts.map +1 -1
  672. package/packages/install/dist/environment.js +50 -1
  673. package/packages/install/dist/environment.js.map +1 -1
  674. package/packages/install/dist/launcher.d.ts +3 -1
  675. package/packages/install/dist/launcher.d.ts.map +1 -1
  676. package/packages/install/dist/launcher.js +93 -12
  677. package/packages/install/dist/launcher.js.map +1 -1
  678. package/packages/install/dist/upgrade.d.ts +16 -3
  679. package/packages/install/dist/upgrade.d.ts.map +1 -1
  680. package/packages/install/dist/upgrade.js +21 -7
  681. package/packages/install/dist/upgrade.js.map +1 -1
  682. package/packages/runtime/dist/.tsbuildinfo +1 -1
  683. package/packages/runtime/dist/anthropic.d.ts +35 -2
  684. package/packages/runtime/dist/anthropic.d.ts.map +1 -1
  685. package/packages/runtime/dist/anthropic.js +36 -12
  686. package/packages/runtime/dist/anthropic.js.map +1 -1
  687. package/packages/runtime/dist/delegate.js +1 -1
  688. package/packages/runtime/dist/loop.d.ts +13 -1
  689. package/packages/runtime/dist/loop.d.ts.map +1 -1
  690. package/packages/runtime/dist/loop.js +70 -3
  691. package/packages/runtime/dist/loop.js.map +1 -1
  692. package/packages/runtime/dist/openai.d.ts.map +1 -1
  693. package/packages/runtime/dist/openai.js +9 -6
  694. package/packages/runtime/dist/openai.js.map +1 -1
  695. package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
  696. package/packages/tools/artifacts/dist/index.d.ts +1 -1
  697. package/packages/tools/browser/dist/.tsbuildinfo +1 -1
  698. package/packages/tools/browser/dist/availability.d.ts +34 -8
  699. package/packages/tools/browser/dist/availability.d.ts.map +1 -1
  700. package/packages/tools/browser/dist/availability.js +44 -5
  701. package/packages/tools/browser/dist/availability.js.map +1 -1
  702. package/packages/tools/browser/dist/controller.d.ts +2 -2
  703. package/packages/tools/browser/dist/controller.d.ts.map +1 -1
  704. package/packages/tools/browser/dist/controller.js +7 -6
  705. package/packages/tools/browser/dist/controller.js.map +1 -1
  706. package/packages/tools/browser/dist/extension.d.ts +1 -1
  707. package/packages/tools/browser/dist/extension.js +1 -1
  708. package/packages/tools/browser/dist/host.d.ts +3 -1
  709. package/packages/tools/browser/dist/host.d.ts.map +1 -1
  710. package/packages/tools/browser/dist/host.js +5 -1
  711. package/packages/tools/browser/dist/host.js.map +1 -1
  712. package/packages/tools/browser/dist/index.d.ts +1 -1
  713. package/packages/tools/browser/dist/index.d.ts.map +1 -1
  714. package/packages/tools/browser/dist/index.js +1 -1
  715. package/packages/tools/browser/dist/index.js.map +1 -1
  716. package/packages/tools/browser/dist/secrets.d.ts +2 -2
  717. package/packages/tools/browser/dist/service.d.ts +4 -4
  718. package/packages/tools/browser/dist/service.d.ts.map +1 -1
  719. package/packages/tools/browser/dist/service.js +1 -1
  720. package/packages/tools/browser/dist/types.d.ts +1 -1
  721. package/packages/tools/email/dist/.tsbuildinfo +1 -1
  722. package/packages/tools/email/dist/attachments/safety.d.ts +1 -1
  723. package/packages/tools/email/dist/attachments/safety.js +1 -1
  724. package/packages/tools/email/dist/channel.d.ts +43 -0
  725. package/packages/tools/email/dist/channel.d.ts.map +1 -0
  726. package/packages/tools/email/dist/channel.js +99 -0
  727. package/packages/tools/email/dist/channel.js.map +1 -0
  728. package/packages/tools/email/dist/credentials.d.ts +1 -1
  729. package/packages/tools/email/dist/dates.d.ts +1 -1
  730. package/packages/tools/email/dist/dates.js +1 -1
  731. package/packages/tools/email/dist/drafts.d.ts +2 -2
  732. package/packages/tools/email/dist/drafts.js +1 -1
  733. package/packages/tools/email/dist/index.d.ts +1 -0
  734. package/packages/tools/email/dist/index.d.ts.map +1 -1
  735. package/packages/tools/email/dist/index.js +13 -6
  736. package/packages/tools/email/dist/index.js.map +1 -1
  737. package/packages/tools/email/dist/mail.d.ts +4 -4
  738. package/packages/tools/email/dist/mail.js +4 -4
  739. package/packages/tools/email/dist/pages/accounts.d.ts +2 -2
  740. package/packages/tools/email/dist/pages/descriptors.js +7 -7
  741. package/packages/tools/email/dist/pages/descriptors.js.map +1 -1
  742. package/packages/tools/email/dist/pages/drafts-tools.d.ts +1 -1
  743. package/packages/tools/email/dist/pages/index.d.ts +1 -1
  744. package/packages/tools/email/dist/pages/policies-tools.d.ts +2 -2
  745. package/packages/tools/email/dist/pages/policies-tools.js +1 -1
  746. package/packages/tools/email/dist/pages/queries.d.ts +2 -2
  747. package/packages/tools/email/dist/pages/queries.d.ts.map +1 -1
  748. package/packages/tools/email/dist/pages/queries.js +3 -3
  749. package/packages/tools/email/dist/pages/queries.js.map +1 -1
  750. package/packages/tools/email/dist/phrases.d.ts +2 -2
  751. package/packages/tools/email/dist/phrases.js +2 -2
  752. package/packages/tools/email/dist/policies/gate.js +2 -2
  753. package/packages/tools/email/dist/policies/learn.d.ts +3 -3
  754. package/packages/tools/email/dist/policies/learn.js +1 -1
  755. package/packages/tools/email/dist/policies/learned.d.ts +1 -1
  756. package/packages/tools/email/dist/ports.d.ts +4 -4
  757. package/packages/tools/email/dist/ports.js +1 -1
  758. package/packages/tools/email/dist/rows.d.ts +1 -1
  759. package/packages/tools/email/dist/rows.js +1 -1
  760. package/packages/tools/email/dist/search.js +2 -2
  761. package/packages/tools/email/dist/sentinels/date-stated.d.ts +1 -1
  762. package/packages/tools/email/dist/sentinels/index.d.ts +1 -1
  763. package/packages/tools/email/dist/sentinels/index.js +1 -1
  764. package/packages/tools/email/dist/sentinels/index.js.map +1 -1
  765. package/packages/tools/email/dist/sentinels/promised-reply.d.ts +1 -1
  766. package/packages/tools/email/dist/sentinels/receipt-or-bill.d.ts +1 -1
  767. package/packages/tools/email/dist/sentinels/suspicious-sender.d.ts +1 -1
  768. package/packages/tools/email/dist/sentinels/unanswered-by-them.d.ts +1 -1
  769. package/packages/tools/email/dist/sentinels/waiting-on-me.d.ts +2 -2
  770. package/packages/tools/email/dist/sentinels/waiting-on-me.d.ts.map +1 -1
  771. package/packages/tools/email/dist/sentinels/waiting-on-me.js +1 -1
  772. package/packages/tools/email/dist/sources/inbox-poll.js +5 -5
  773. package/packages/tools/email/dist/sources/inbox-poll.js.map +1 -1
  774. package/packages/tools/email/dist/sources/retention.js +1 -1
  775. package/packages/tools/email/dist/sources/retention.js.map +1 -1
  776. package/packages/tools/email/dist/suspicions-store.d.ts +1 -1
  777. package/packages/tools/email/dist/tools/attachments.d.ts +1 -1
  778. package/packages/tools/email/dist/tools/attachments.js +1 -1
  779. package/packages/tools/email/dist/tools/drafts.d.ts +1 -1
  780. package/packages/tools/email/dist/tools/drafts.js +3 -3
  781. package/packages/tools/email/dist/tools/drafts.js.map +1 -1
  782. package/packages/tools/email/dist/tools/policies.d.ts +1 -1
  783. package/packages/tools/email/dist/tools/send.d.ts +1 -1
  784. package/packages/tools/email/dist/tools/send.js +4 -4
  785. package/packages/tools/email/dist/tools/send.js.map +1 -1
  786. package/packages/tools/email/dist/tools/settings.d.ts +1 -1
  787. package/packages/tools/email/dist/tools/triage.js +2 -2
  788. package/packages/tools/email/dist/watchers.d.ts +1 -1
  789. package/packages/tools/email/dist/watchers.js +1 -1
  790. package/packages/tools/email/dist/watchers.js.map +1 -1
  791. package/packages/tools/email/migrations/001_email.sql +3 -2
  792. package/packages/tools/email/package.json +2 -1
  793. package/packages/tools/host/dist/.tsbuildinfo +1 -1
  794. package/packages/tools/memory/dist/.tsbuildinfo +1 -1
  795. package/packages/tools/memory/dist/index.js +1 -1
  796. package/packages/tools/memory/migrations/001_memory.sql +1 -1
  797. package/packages/tools/web/dist/.tsbuildinfo +1 -1
  798. package/packages/tools/web/dist/guard.d.ts +1 -1
  799. package/packages/tools/web/dist/guard.js +1 -1
  800. package/packages/web/dist/assets/dm-mono-latin-400-normal--0xN8mdc.woff +0 -0
  801. package/packages/web/dist/assets/dm-mono-latin-400-normal-4GdczIuU.woff2 +0 -0
  802. package/packages/web/dist/assets/dm-mono-latin-500-normal-CN8Miw6E.woff +0 -0
  803. package/packages/web/dist/assets/dm-mono-latin-500-normal-DRMDZjhP.woff2 +0 -0
  804. package/packages/web/dist/assets/dm-mono-latin-ext-400-normal-1aZr6b2b.woff +0 -0
  805. package/packages/web/dist/assets/dm-mono-latin-ext-400-normal-C2zvOubV.woff2 +0 -0
  806. package/packages/web/dist/assets/dm-mono-latin-ext-500-normal-BtRyHRi6.woff2 +0 -0
  807. package/packages/web/dist/assets/dm-mono-latin-ext-500-normal-Dw3M13d8.woff +0 -0
  808. package/packages/web/dist/assets/dm-sans-latin-ext-standard-italic-DNX9AbKj.woff2 +0 -0
  809. package/packages/web/dist/assets/dm-sans-latin-ext-standard-normal-oos9povj.woff2 +0 -0
  810. package/packages/web/dist/assets/dm-sans-latin-standard-italic-C8i6y2Ft.woff2 +0 -0
  811. package/packages/web/dist/assets/dm-sans-latin-standard-normal-Bf69Tn_J.woff2 +0 -0
  812. package/packages/web/dist/assets/index-BRkIoT-q.js +123 -0
  813. package/packages/web/dist/assets/index-DCn0vN58.css +1 -0
  814. package/packages/web/dist/index.html +2 -2
  815. package/packages/web/dist/assets/index-CxaF2koC.js +0 -122
  816. package/packages/web/dist/assets/index-DEho_xyR.css +0 -1
@@ -0,0 +1,993 @@
1
+ /**
2
+ * Every `buddi` command, in one table.
3
+ *
4
+ * `buddi help`, `buddi help <command>`, `buddi <command> --help` and the
5
+ * reference page (`docs/cli.md`, rendered by `scripts/docs/cli.mjs`) are all
6
+ * drawn from this array, and a test walks it against the parser, so the words
7
+ * an owner reads cannot drift from the words the binary accepts.
8
+ *
9
+ * The same tree answers in a source checkout and in a packaged install. What
10
+ * does not apply where it runs is left out of the help and, when typed anyway,
11
+ * answers with `elsewhere`: one sentence saying what to do instead.
12
+ *
13
+ * Pure data and pure functions: nothing here imports the gateway, so the
14
+ * reference script can load it without an installation behind it.
15
+ */
16
+ export const GROUPS = ['Everyday', 'Agents', 'Reach', 'Operate', 'Develop'];
17
+ const JSON_FLAG = { flag: '--json', meaning: 'Print JSON instead of text. BUDDI_JSON=1 does the same.' };
18
+ const NEEDS_DATABASE = { code: 3, meaning: 'The database is not reachable, or not configured.' };
19
+ const CHECKOUT_ONLY = (what, instead) => `buddi ${what} is for a source checkout. ${instead}`;
20
+ export const COMMANDS = [
21
+ /* ---------------------------------------------------------------- Everyday */
22
+ {
23
+ name: '',
24
+ group: 'Everyday',
25
+ summary: 'Open the dashboard. In a packaged install the first run sets everything up.',
26
+ usage: 'buddi',
27
+ flags: [],
28
+ example: 'buddi',
29
+ applies: 'both',
30
+ },
31
+ {
32
+ name: 'status',
33
+ group: 'Everyday',
34
+ summary: 'One screen: version, service, database, agents, what needs you, and whether a newer buddi is out.',
35
+ usage: 'buddi status [--json]',
36
+ flags: [JSON_FLAG],
37
+ example: 'buddi status',
38
+ exitCodes: [{ code: 3, meaning: 'The database is not reachable. The rest of the report is still printed.' }],
39
+ applies: 'both',
40
+ json: '{ version, install, service: { state, detail }, database: { reachable, error? }, ' +
41
+ 'agents: { ready: [{ handle, id }], unavailable: [{ handle, id, reason }] }, ' +
42
+ 'needsYou: { approvals, questions } | null, lastRecapAt | null, ' +
43
+ 'update: { available, latest? } }. service.state is running, stopped, not-installed or unknown.',
44
+ },
45
+ {
46
+ name: 'ask',
47
+ group: 'Everyday',
48
+ summary: 'Ask one question, print the answer, and exit. Made for scripts.',
49
+ usage: 'buddi ask "<question>" [--agent <handle>] [--resume <id> | --last] [--file <path>] [--wait <seconds>] [--json]',
50
+ flags: [
51
+ { flag: '--agent <handle>', meaning: 'Ask this agent, by handle or id, instead of the default one.' },
52
+ { flag: '--resume <id>', meaning: 'Continue that conversation. With no question, it finishes a run that stopped for an approval you have since given.' },
53
+ { flag: '--last', meaning: 'Continue the most recent conversation with that agent.' },
54
+ { flag: '--file <path>', meaning: 'Attach a file. It is kept in the library like a file dropped on the dashboard.' },
55
+ { flag: '--wait <seconds>', meaning: 'When the run stops for an approval, wait this long for you to give it elsewhere, then finish.' },
56
+ JSON_FLAG,
57
+ ],
58
+ example: 'buddi ask "what did I spend on food last month?" --agent ledger',
59
+ exitCodes: [
60
+ { code: 3, meaning: 'The run stopped for an approval, the agent does not exist or cannot run, or the database is not reachable.' },
61
+ ],
62
+ applies: 'both',
63
+ json: '{ text, runId, conversationId, artifacts: [{ id, filename }] }, plus pendingActionId when the run stopped for an approval. ' +
64
+ 'With no question as an argument and stdin not a terminal, stdin is the question.',
65
+ },
66
+ {
67
+ name: 'chat',
68
+ group: 'Everyday',
69
+ summary: 'Talk with an agent in the terminal. /help inside lists what you can type.',
70
+ usage: 'buddi chat [--agent <handle>] [--resume <id> | --last] [--quiet]',
71
+ flags: [
72
+ { flag: '--agent <handle>', meaning: 'Talk to this agent, by handle or id.' },
73
+ { flag: '--resume <id>', meaning: 'Continue that conversation.' },
74
+ { flag: '--last', meaning: 'Continue the most recent conversation with that agent.' },
75
+ { flag: '--quiet', meaning: 'No footer after each answer.' },
76
+ ],
77
+ example: 'buddi chat --agent ledger --last',
78
+ exitCodes: [NEEDS_DATABASE],
79
+ applies: 'both',
80
+ },
81
+ {
82
+ name: 'dashboard',
83
+ group: 'Everyday',
84
+ summary: 'Open the dashboard with a sign-in link that is good for five minutes.',
85
+ usage: 'buddi dashboard [--token | --off | --install-app | --uninstall-app]',
86
+ flags: [
87
+ { flag: '--token', meaning: 'Print only the five-minute ticket.' },
88
+ { flag: '--off', meaning: 'Say how to turn the dashboard off.' },
89
+ { flag: '--install-app', meaning: 'Put a double-clickable Buddi Dashboard in ~/Applications.' },
90
+ { flag: '--uninstall-app', meaning: 'Remove it.' },
91
+ ],
92
+ example: 'buddi dashboard --token',
93
+ applies: 'both',
94
+ },
95
+ /* ------------------------------------------------------------------ Agents */
96
+ {
97
+ name: 'agents',
98
+ group: 'Agents',
99
+ summary: 'List every agent, its engine, and whether it can run.',
100
+ usage: 'buddi agents [list] [--json]',
101
+ flags: [JSON_FLAG],
102
+ example: 'buddi agents',
103
+ applies: 'both',
104
+ json: '[{ handle, id, isDefault, provider, model, credential, available, unavailableReason?, roles, source }]',
105
+ },
106
+ {
107
+ name: 'agents show',
108
+ group: 'Agents',
109
+ summary: 'Show one agent in full: engine, tools, skills and its last run.',
110
+ usage: 'buddi agents show <handle> [--json]',
111
+ flags: [JSON_FLAG],
112
+ example: 'buddi agents show ledger',
113
+ exitCodes: [{ code: 3, meaning: 'No agent has that handle or id.' }],
114
+ applies: 'both',
115
+ json: '{ handle, id, name, description, isDefault, source, file, provider, model, accountId?, ' +
116
+ 'credential: { kind, env }, available, unavailableReason?, maxTurns, language, roles, tools, ' +
117
+ 'skills: [{ name, provenance }], capabilities, lastRun: { at, provider, model, servedModel?, turns, stopped, input, output } | null }',
118
+ },
119
+ {
120
+ name: 'agents set',
121
+ group: 'Agents',
122
+ summary: "Change an agent's account, model, turn budget or language.",
123
+ usage: 'buddi agents set <handle> [--account <id>] [--model <id>] [--max-turns <n>] [--language mirror|en|fr]',
124
+ flags: [
125
+ { flag: '--account <id>', meaning: 'Run it on this provider account, from the dashboard\'s Providers page.' },
126
+ { flag: '--provider anthropic|openai', meaning: 'Where its conversations go, on an agent without an account.' },
127
+ { flag: '--model <id>', meaning: "Checked against that provider's models." },
128
+ { flag: '--max-turns <n>', meaning: 'How many steps one run may take.' },
129
+ { flag: '--language mirror|en|fr', meaning: 'Which language it answers in.' },
130
+ ],
131
+ example: 'buddi agents set ledger --max-turns 20',
132
+ exitCodes: [{ code: 3, meaning: 'No agent has that handle or id.' }],
133
+ applies: 'both',
134
+ },
135
+ {
136
+ name: 'agents models',
137
+ group: 'Agents',
138
+ summary: 'List the models this build knows, and which of them this machine can reach.',
139
+ usage: 'buddi agents models [--provider anthropic|openai] [--json]',
140
+ flags: [{ flag: '--provider anthropic|openai', meaning: 'Only that provider.' }, JSON_FLAG],
141
+ example: 'buddi agents models --provider anthropic',
142
+ applies: 'both',
143
+ json: '[{ kind, credentialEnv, credentialKind, usable, problem?, defaultModel, defaultFrom, defaultEnv, prefixes, models: [{ id, note }] }]',
144
+ },
145
+ {
146
+ name: 'agents test',
147
+ group: 'Agents',
148
+ summary: "Run one cheap live turn on an agent's provider, to prove it answers.",
149
+ usage: 'buddi agents test <handle> [--prompt "<text>"]',
150
+ flags: [{ flag: '--prompt "<text>"', meaning: 'Ask this instead of the one-word default.' }],
151
+ example: 'buddi agents test ledger',
152
+ exitCodes: [{ code: 3, meaning: 'No agent has that handle or id.' }],
153
+ applies: 'both',
154
+ },
155
+ {
156
+ name: 'agents migrate',
157
+ group: 'Agents',
158
+ summary: 'Move agents/ and skills/ out of the checkout and into your private directory.',
159
+ usage: 'buddi agents migrate [--dry-run]',
160
+ flags: [{ flag: '--dry-run', meaning: 'Say what would move, and move nothing.' }],
161
+ example: 'buddi agents migrate --dry-run',
162
+ applies: 'checkout',
163
+ elsewhere: CHECKOUT_ONLY('agents migrate', 'A packaged install keeps its agents in its data directory already.'),
164
+ },
165
+ {
166
+ name: 'missions list',
167
+ group: 'Agents',
168
+ summary: 'List every scheduled mission, its schedule, its next run and its last one.',
169
+ usage: 'buddi missions list [--json]',
170
+ flags: [JSON_FLAG],
171
+ example: 'buddi missions list',
172
+ exitCodes: [NEEDS_DATABASE],
173
+ applies: 'both',
174
+ json: '[{ id, name, agentId, enabled, alwaysDeliver, proposedBy, schedule: { cron, timezone, revision, misfirePolicy } | null, ' +
175
+ 'nextRunAt | null, lastOccurrence: { scheduledAt, state, error } | null, lastNotification: { kind, at, reason?, chars? } | null }]',
176
+ },
177
+ {
178
+ name: 'missions add-defaults',
179
+ group: 'Agents',
180
+ summary: 'Register every mission the installed plugins suggest.',
181
+ usage: 'buddi missions add-defaults',
182
+ flags: [],
183
+ exitCodes: [NEEDS_DATABASE],
184
+ applies: 'both',
185
+ },
186
+ {
187
+ name: 'missions add-recap',
188
+ group: 'Agents',
189
+ summary: 'Register the recap mission, or refresh it.',
190
+ usage: 'buddi missions add-recap',
191
+ flags: [],
192
+ exitCodes: [NEEDS_DATABASE],
193
+ applies: 'both',
194
+ },
195
+ {
196
+ name: 'missions add-friday-recap',
197
+ group: 'Agents',
198
+ summary: 'The same as buddi missions add-recap, under its older name.',
199
+ usage: 'buddi missions add-friday-recap',
200
+ flags: [],
201
+ exitCodes: [NEEDS_DATABASE],
202
+ applies: 'both',
203
+ },
204
+ {
205
+ name: 'missions run-now',
206
+ group: 'Agents',
207
+ summary: 'Queue a run of a mission for now, or run it here with --inline.',
208
+ usage: 'buddi missions run-now <id> [--inline]',
209
+ flags: [{ flag: '--inline', meaning: 'Run it in this terminal and print what it would deliver.' }],
210
+ example: 'buddi missions run-now recap --inline',
211
+ exitCodes: [NEEDS_DATABASE],
212
+ applies: 'both',
213
+ },
214
+ {
215
+ name: 'missions enable',
216
+ group: 'Agents',
217
+ summary: 'Turn a mission back on.',
218
+ usage: 'buddi missions enable <id>',
219
+ flags: [],
220
+ exitCodes: [NEEDS_DATABASE],
221
+ applies: 'both',
222
+ },
223
+ {
224
+ name: 'missions disable',
225
+ group: 'Agents',
226
+ summary: 'Turn a mission off. Its schedule is kept.',
227
+ usage: 'buddi missions disable <id>',
228
+ flags: [],
229
+ exitCodes: [NEEDS_DATABASE],
230
+ applies: 'both',
231
+ },
232
+ {
233
+ name: 'reminders',
234
+ group: 'Agents',
235
+ summary: 'List the one-off reminders the agents have set, soonest first.',
236
+ usage: 'buddi reminders [--agent <id>] [--all] [--json]',
237
+ flags: [
238
+ { flag: '--agent <id>', meaning: "Only that agent's." },
239
+ { flag: '--all', meaning: 'Include the ones that fired, were cancelled or expired.' },
240
+ JSON_FLAG,
241
+ ],
242
+ example: 'buddi reminders --all',
243
+ exitCodes: [NEEDS_DATABASE],
244
+ applies: 'both',
245
+ json: '[{ id, state, dueAt, agentId, text, cancelReason? }]',
246
+ },
247
+ {
248
+ name: 'reminders cancel',
249
+ group: 'Agents',
250
+ summary: 'Cancel a pending reminder.',
251
+ usage: 'buddi reminders cancel <id>',
252
+ flags: [],
253
+ exitCodes: [NEEDS_DATABASE],
254
+ applies: 'both',
255
+ },
256
+ {
257
+ name: 'nudges',
258
+ group: 'Agents',
259
+ summary: 'Say what the first-run arc has sent, and whether it is still running.',
260
+ usage: 'buddi nudges [status]',
261
+ flags: [],
262
+ exitCodes: [NEEDS_DATABASE],
263
+ applies: 'both',
264
+ },
265
+ {
266
+ name: 'nudges stop',
267
+ group: 'Agents',
268
+ summary: 'Stop the first-run arc until you ask for it back.',
269
+ usage: 'buddi nudges stop',
270
+ flags: [],
271
+ exitCodes: [NEEDS_DATABASE],
272
+ applies: 'both',
273
+ },
274
+ {
275
+ name: 'nudges resume',
276
+ group: 'Agents',
277
+ summary: 'Start the first-run arc again.',
278
+ usage: 'buddi nudges resume',
279
+ flags: [],
280
+ exitCodes: [NEEDS_DATABASE],
281
+ applies: 'both',
282
+ },
283
+ {
284
+ name: 'plugins list',
285
+ group: 'Agents',
286
+ summary: 'List what is installed, its version, and whether it is healthy.',
287
+ usage: 'buddi plugins list [--json]',
288
+ flags: [JSON_FLAG],
289
+ example: 'buddi plugins list',
290
+ applies: 'both',
291
+ json: '[{ name, version, origin, health, detail }]. origin is built-in or installed; health is ok, warn or fail.',
292
+ },
293
+ {
294
+ name: 'plugins info',
295
+ group: 'Agents',
296
+ summary: 'Show what a plugin is, what it brought, and what it proposes.',
297
+ usage: 'buddi plugins info <name>',
298
+ flags: [],
299
+ applies: 'both',
300
+ },
301
+ {
302
+ name: 'plugins install',
303
+ group: 'Agents',
304
+ summary: 'Stage a plugin and read what it claims, then approve it with --yes.',
305
+ usage: 'buddi plugins install <spec> [--yes --integrity <hash>] [--registry <url>]',
306
+ flags: [
307
+ { flag: '--yes', meaning: 'Approve it: import it, plan it, install it.' },
308
+ { flag: '--integrity <hash>', meaning: 'The hash the staged card printed. A package from npm or a .tgz is never approved without it.' },
309
+ { flag: '--registry <url>', meaning: 'Fetch from this npm registry.' },
310
+ ],
311
+ example: 'buddi plugins install @you/buddi-plugin-finance',
312
+ exitCodes: [{ code: 3, meaning: 'Staged, not installed: approve it with --yes --integrity <hash>.' }],
313
+ applies: 'both',
314
+ },
315
+ {
316
+ name: 'plugins update',
317
+ group: 'Agents',
318
+ summary: 'Stage the next version of a plugin; --yes --integrity approves it.',
319
+ usage: 'buddi plugins update <name> [--version <v>] [--yes --integrity <hash>]',
320
+ flags: [
321
+ { flag: '--version <v>', meaning: 'This version instead of the newest.' },
322
+ { flag: '--yes', meaning: 'Approve it.' },
323
+ { flag: '--integrity <hash>', meaning: 'The hash the staged card printed.' },
324
+ ],
325
+ applies: 'both',
326
+ },
327
+ {
328
+ name: 'plugins staged',
329
+ group: 'Agents',
330
+ summary: 'List what is staged and waiting for you.',
331
+ usage: 'buddi plugins staged',
332
+ flags: [],
333
+ applies: 'both',
334
+ },
335
+ {
336
+ name: 'plugins approve',
337
+ group: 'Agents',
338
+ summary: 'Approve a staged plugin by its staging id.',
339
+ usage: 'buddi plugins approve <id> [--integrity <hash>] [--acknowledge-drift]',
340
+ flags: [
341
+ { flag: '--integrity <hash>', meaning: 'The hash the staged card printed.' },
342
+ { flag: '--acknowledge-drift', meaning: 'Approve it although what is on disk changed since it was staged.' },
343
+ ],
344
+ applies: 'both',
345
+ },
346
+ {
347
+ name: 'plugins reject',
348
+ group: 'Agents',
349
+ summary: 'Delete a stage and everything it fetched.',
350
+ usage: 'buddi plugins reject <id>',
351
+ flags: [],
352
+ applies: 'both',
353
+ },
354
+ {
355
+ name: 'plugins uninstall',
356
+ group: 'Agents',
357
+ summary: 'Say what removing a plugin would do; --yes removes it and keeps its data.',
358
+ usage: 'buddi plugins uninstall <name> [--yes] [--detach-agents] [--purge --confirm <name>]',
359
+ flags: [
360
+ { flag: '--yes', meaning: 'Remove it. Its database schema is kept.' },
361
+ { flag: '--detach-agents', meaning: 'Also take its tools out of the agents that were given them.' },
362
+ { flag: '--purge --confirm <name>', meaning: 'Also drop its schema and everything in it. This cannot be undone.' },
363
+ ],
364
+ applies: 'both',
365
+ },
366
+ {
367
+ name: 'plugins init',
368
+ group: 'Agents',
369
+ summary: 'Write a new plugin you can build and install.',
370
+ usage: 'buddi plugins init <name> [--dir <path>]',
371
+ flags: [{ flag: '--dir <path>', meaning: 'Write it here instead of ./<name>.' }],
372
+ example: 'buddi plugins init weather',
373
+ applies: 'both',
374
+ },
375
+ {
376
+ name: 'plugins dev',
377
+ group: 'Agents',
378
+ summary: "Watch a plugin's dist/ and restart buddi when it changes.",
379
+ usage: 'buddi plugins dev <dir>',
380
+ flags: [],
381
+ example: 'buddi plugins dev ./weather',
382
+ applies: 'both',
383
+ },
384
+ /* ------------------------------------------------------------------- Reach */
385
+ {
386
+ name: 'telegram pair',
387
+ group: 'Reach',
388
+ summary: 'Show a QR code and a link that pair a phone with your agents.',
389
+ usage: 'buddi telegram pair',
390
+ flags: [],
391
+ exitCodes: [{ code: 3, meaning: 'The database is not reachable, or no Telegram bot is configured.' }],
392
+ applies: 'both',
393
+ },
394
+ {
395
+ name: 'telegram devices',
396
+ group: 'Reach',
397
+ summary: 'List every paired device.',
398
+ usage: 'buddi telegram devices [--json]',
399
+ flags: [JSON_FLAG],
400
+ exitCodes: [NEEDS_DATABASE],
401
+ applies: 'both',
402
+ json: '[{ id, surface, label, externalUserId, externalChatId, pairedAt, lastSeenAt }]',
403
+ },
404
+ {
405
+ name: 'telegram unpair',
406
+ group: 'Reach',
407
+ summary: 'Unpair a device, so it can no longer reach your agents.',
408
+ usage: 'buddi telegram unpair <id>',
409
+ flags: [],
410
+ exitCodes: [NEEDS_DATABASE],
411
+ applies: 'both',
412
+ },
413
+ {
414
+ name: 'mcp',
415
+ group: 'Reach',
416
+ summary: 'Run buddi as an MCP server over stdio, for Claude Code or any MCP client.',
417
+ usage: 'buddi mcp',
418
+ flags: [],
419
+ example: 'claude mcp add buddi -- buddi mcp',
420
+ applies: 'both',
421
+ },
422
+ /* ----------------------------------------------------------------- Operate */
423
+ {
424
+ name: 'doctor',
425
+ group: 'Operate',
426
+ summary: 'Check every moving part and say what is wrong.',
427
+ usage: 'buddi doctor',
428
+ flags: [],
429
+ example: 'buddi doctor',
430
+ applies: 'both',
431
+ },
432
+ {
433
+ name: 'upgrade',
434
+ group: 'Operate',
435
+ summary: 'Back up, move to the new version, migrate, and restart.',
436
+ usage: 'buddi upgrade [--no-backup]',
437
+ flags: [{ flag: '--no-backup', meaning: 'In a source checkout, skip the archive it takes first. A packaged upgrade always takes one.' }],
438
+ example: 'buddi upgrade',
439
+ applies: 'both',
440
+ },
441
+ {
442
+ name: 'version',
443
+ group: 'Operate',
444
+ summary: 'Print the version, with the commit in a source checkout.',
445
+ usage: 'buddi version',
446
+ flags: [],
447
+ applies: 'both',
448
+ },
449
+ {
450
+ name: 'service status',
451
+ group: 'Operate',
452
+ summary: 'Say whether the background service is running.',
453
+ usage: 'buddi service status [--json]',
454
+ flags: [JSON_FLAG],
455
+ exitCodes: [{ code: 1, meaning: 'It is not running.' }],
456
+ applies: 'both',
457
+ json: "The service's state. Packaged: { phase, supervisorPid, installRoot, nodePath, database, databasePid, gateway, gatewayPid, current?, upgrading? }. " +
458
+ 'Source checkout: { installed, running, pid?, unitPath, detail }.',
459
+ },
460
+ {
461
+ name: 'service start',
462
+ group: 'Operate',
463
+ summary: 'Start the background service.',
464
+ usage: 'buddi service start [--json]',
465
+ flags: [JSON_FLAG],
466
+ applies: 'both',
467
+ json: "The service's state. Packaged: { phase, supervisorPid, installRoot, nodePath, database, databasePid, gateway, gatewayPid, current?, upgrading? }. " +
468
+ 'Source checkout: { installed, running, pid?, unitPath, detail }.',
469
+ },
470
+ {
471
+ name: 'service stop',
472
+ group: 'Operate',
473
+ summary: 'Stop the background service. Running work finishes first.',
474
+ usage: 'buddi service stop [--json]',
475
+ flags: [JSON_FLAG],
476
+ applies: 'both',
477
+ json: "The service's state. Packaged: { phase, supervisorPid, installRoot, nodePath, database, databasePid, gateway, gatewayPid, current?, upgrading? }. " +
478
+ 'Source checkout: { installed, running, pid?, unitPath, detail }.',
479
+ },
480
+ {
481
+ name: 'service restart',
482
+ group: 'Operate',
483
+ summary: 'Restart the background service, to load a change.',
484
+ usage: 'buddi service restart [--json]',
485
+ flags: [JSON_FLAG],
486
+ applies: 'both',
487
+ json: "The service's state. Packaged: { phase, supervisorPid, installRoot, nodePath, database, databasePid, gateway, gatewayPid, current?, upgrading? }. " +
488
+ 'Source checkout: { installed, running, pid?, unitPath, detail }.',
489
+ },
490
+ {
491
+ name: 'service logs',
492
+ group: 'Operate',
493
+ summary: "Follow the service's log. Ctrl-C stops following.",
494
+ usage: 'buddi service logs',
495
+ flags: [],
496
+ applies: 'both',
497
+ },
498
+ {
499
+ name: 'service install',
500
+ group: 'Operate',
501
+ summary: 'Install the background service, started at login.',
502
+ usage: 'buddi service install',
503
+ flags: [],
504
+ applies: 'checkout',
505
+ elsewhere: CHECKOUT_ONLY('service install', 'A packaged install sets up its service the first time you run buddi.'),
506
+ },
507
+ {
508
+ name: 'service uninstall',
509
+ group: 'Operate',
510
+ summary: 'Remove the background service. Your data stays.',
511
+ usage: 'buddi service uninstall',
512
+ flags: [],
513
+ applies: 'checkout',
514
+ elsewhere: CHECKOUT_ONLY('service uninstall', 'A packaged install stops with buddi service stop; docs/install.md says how to remove it.'),
515
+ },
516
+ {
517
+ name: 'backup create',
518
+ group: 'Operate',
519
+ summary: 'Write one archive of this installation: the database, your agents and skills, and your files.',
520
+ usage: 'buddi backup create [--encrypt] [--out <dir>] [--no-artifacts] [--prune [n]]',
521
+ flags: [
522
+ { flag: '--encrypt', meaning: 'Seal it with your backup passphrase from the vault. A packaged install always does.' },
523
+ { flag: '--out <dir>', meaning: 'Write it here instead of the backups directory. Source checkout only.' },
524
+ { flag: '--no-artifacts', meaning: 'Leave the files out. Source checkout only.' },
525
+ { flag: '--prune [n]', meaning: 'Then keep only the newest n archives.' },
526
+ ],
527
+ example: 'buddi backup create --encrypt',
528
+ exitCodes: [NEEDS_DATABASE],
529
+ applies: 'both',
530
+ },
531
+ {
532
+ name: 'backup list',
533
+ group: 'Operate',
534
+ summary: 'List every archive, newest first.',
535
+ usage: 'buddi backup list [--json]',
536
+ flags: [JSON_FLAG],
537
+ example: 'buddi backup list',
538
+ applies: 'both',
539
+ json: '{ dir, archives: [{ name, bytes, at }] }, newest first; at is an ISO time.',
540
+ },
541
+ {
542
+ name: 'backup verify',
543
+ group: 'Operate',
544
+ summary: 'Check that an archive is whole and can be restored.',
545
+ usage: 'buddi backup verify <archive> [--passphrase "<words>"]',
546
+ flags: [{ flag: '--passphrase "<words>"', meaning: 'For an encrypted archive from another machine.' }],
547
+ example: 'buddi backup verify buddi-backup-20260914-033000.tar.gz.age',
548
+ applies: 'both',
549
+ },
550
+ {
551
+ name: 'backup restore',
552
+ group: 'Operate',
553
+ summary: 'Put an archive back. It asks you to type a word first.',
554
+ usage: 'buddi backup restore <archive> [--into <db>] [--files] [--yes] [--force] [--passphrase "<words>"]',
555
+ flags: [
556
+ { flag: '--into <db>', meaning: 'Restore the database only, into this one.' },
557
+ { flag: '--files', meaning: 'Also restore agents, skills and files.' },
558
+ { flag: '--yes', meaning: 'Do not ask.' },
559
+ { flag: '--force', meaning: 'Restore over a database that has data in it.' },
560
+ { flag: '--passphrase "<words>"', meaning: 'For an encrypted archive. Without it: the vault, then a prompt.' },
561
+ ],
562
+ applies: 'both',
563
+ },
564
+ {
565
+ name: 'backup prune',
566
+ group: 'Operate',
567
+ summary: 'Delete old archives and keep the newest ones.',
568
+ usage: 'buddi backup prune [--keep <n>]',
569
+ flags: [{ flag: '--keep <n>', meaning: 'How many to keep.' }],
570
+ applies: 'both',
571
+ },
572
+ {
573
+ name: 'backup schedule',
574
+ group: 'Operate',
575
+ summary: 'The nightly backup at 03:30, prune included: status, install or uninstall.',
576
+ usage: 'buddi backup schedule [status | install | uninstall] [--keep <n>]',
577
+ flags: [{ flag: '--keep <n>', meaning: 'How many archives the nightly prune keeps.' }],
578
+ applies: 'checkout',
579
+ elsewhere: CHECKOUT_ONLY('backup schedule', 'A packaged install sets its nightly backup on the dashboard, in Settings → Backup.'),
580
+ },
581
+ {
582
+ name: 'vault set',
583
+ group: 'Operate',
584
+ summary: 'Keep a secret in the vault. It asks for the value with the typing hidden.',
585
+ usage: 'buddi vault set <NAME>',
586
+ flags: [],
587
+ example: 'buddi vault set ANTHROPIC_API_KEY',
588
+ applies: 'both',
589
+ },
590
+ {
591
+ name: 'vault get',
592
+ group: 'Operate',
593
+ summary: 'Print a secret from the vault.',
594
+ usage: 'buddi vault get <NAME>',
595
+ flags: [],
596
+ applies: 'both',
597
+ },
598
+ {
599
+ name: 'vault delete',
600
+ group: 'Operate',
601
+ summary: 'Remove a secret from the vault.',
602
+ usage: 'buddi vault delete <NAME>',
603
+ flags: [],
604
+ applies: 'both',
605
+ },
606
+ {
607
+ name: 'vault list',
608
+ group: 'Operate',
609
+ summary: 'List the names of the secrets in the vault, never their values.',
610
+ usage: 'buddi vault list',
611
+ flags: [],
612
+ applies: 'both',
613
+ },
614
+ {
615
+ name: 'vault import-env',
616
+ group: 'Operate',
617
+ summary: 'Move the secrets in .env into the vault.',
618
+ usage: 'buddi vault import-env',
619
+ flags: [],
620
+ applies: 'both',
621
+ },
622
+ {
623
+ name: 'browser',
624
+ group: 'Operate',
625
+ summary: "Say which browser the agents' own browser uses here.",
626
+ usage: 'buddi browser [status]',
627
+ flags: [],
628
+ applies: 'both',
629
+ },
630
+ {
631
+ name: 'browser install',
632
+ group: 'Operate',
633
+ summary: "Download Chromium for the agents' own browser, about 150 MB.",
634
+ usage: 'buddi browser install',
635
+ flags: [],
636
+ applies: 'both',
637
+ },
638
+ {
639
+ name: 'jobs',
640
+ group: 'Operate',
641
+ summary: 'List the work queue: what is waiting, running and failed.',
642
+ usage: 'buddi jobs [--state <state>] [--kind <kind>] [--limit <n>] [--json]',
643
+ flags: [
644
+ { flag: '--state <state>', meaning: 'Only pending, leased, succeeded, failed, suspended or cancelled jobs.' },
645
+ { flag: '--kind <kind>', meaning: 'Only jobs of this kind.' },
646
+ { flag: '--limit <n>', meaning: 'At most n jobs. The default is 20.' },
647
+ JSON_FLAG,
648
+ ],
649
+ example: 'buddi jobs --state failed',
650
+ exitCodes: [NEEDS_DATABASE],
651
+ applies: 'both',
652
+ json: '{ paused, counts: { pending, leased, succeeded, failed, suspended, cancelled }, ' +
653
+ 'jobs: [{ id, state, kind, attempts, maxAttempts, createdAt, runAfter, leaseOwner, suspendedReason, lastError }] }',
654
+ },
655
+ {
656
+ name: 'jobs retry',
657
+ group: 'Operate',
658
+ summary: 'Run a failed job again, or every failed job with --all.',
659
+ usage: 'buddi jobs retry <id> | --all [--kind <kind>] [--state <state>] [--limit <n>]',
660
+ flags: [
661
+ { flag: '--all', meaning: 'Every dead job, not one.' },
662
+ { flag: '--kind <kind>', meaning: 'With --all: only jobs of this kind.' },
663
+ ],
664
+ example: 'buddi jobs retry --all --kind mission-run',
665
+ exitCodes: [NEEDS_DATABASE],
666
+ applies: 'both',
667
+ },
668
+ {
669
+ name: 'jobs cancel',
670
+ group: 'Operate',
671
+ summary: 'Cancel a job that has not run yet.',
672
+ usage: 'buddi jobs cancel <id>',
673
+ flags: [],
674
+ exitCodes: [NEEDS_DATABASE],
675
+ applies: 'both',
676
+ },
677
+ {
678
+ name: 'pause',
679
+ group: 'Operate',
680
+ summary: 'Stop taking new work. What is running finishes.',
681
+ usage: 'buddi pause',
682
+ flags: [],
683
+ exitCodes: [NEEDS_DATABASE],
684
+ applies: 'both',
685
+ },
686
+ {
687
+ name: 'resume',
688
+ group: 'Operate',
689
+ summary: 'Start taking work again.',
690
+ usage: 'buddi resume',
691
+ flags: [],
692
+ exitCodes: [NEEDS_DATABASE],
693
+ applies: 'both',
694
+ },
695
+ /* ----------------------------------------------------------------- Develop */
696
+ {
697
+ name: 'init',
698
+ group: 'Develop',
699
+ summary: 'Set a source checkout up: .env, the database, the service. Safe to run again.',
700
+ usage: 'buddi init [--yes]',
701
+ flags: [{ flag: '--yes', meaning: 'Ask nothing and take every default, for scripts and CI.' }],
702
+ example: 'buddi init --yes',
703
+ applies: 'checkout',
704
+ elsewhere: CHECKOUT_ONLY('init', 'A packaged install sets itself up the first time you run buddi.'),
705
+ },
706
+ {
707
+ name: 'db up',
708
+ group: 'Develop',
709
+ summary: 'Start the Postgres container of a source checkout.',
710
+ usage: 'buddi db up',
711
+ flags: [],
712
+ applies: 'checkout',
713
+ elsewhere: CHECKOUT_ONLY('db', 'A packaged install runs its own database; buddi status says whether it is up.'),
714
+ },
715
+ {
716
+ name: 'db down',
717
+ group: 'Develop',
718
+ summary: 'Stop the Postgres container.',
719
+ usage: 'buddi db down',
720
+ flags: [],
721
+ applies: 'checkout',
722
+ elsewhere: CHECKOUT_ONLY('db', 'A packaged install runs its own database; buddi status says whether it is up.'),
723
+ },
724
+ {
725
+ name: 'db status',
726
+ group: 'Develop',
727
+ summary: 'Say whether the Postgres container is running.',
728
+ usage: 'buddi db status',
729
+ flags: [],
730
+ applies: 'checkout',
731
+ elsewhere: CHECKOUT_ONLY('db', 'A packaged install runs its own database; buddi status says whether it is up.'),
732
+ },
733
+ {
734
+ name: 'db secure',
735
+ group: 'Develop',
736
+ summary: 'Give the database a generated password, kept in the vault.',
737
+ usage: 'buddi db secure',
738
+ flags: [],
739
+ applies: 'checkout',
740
+ elsewhere: CHECKOUT_ONLY('db', 'A packaged install runs its own database; buddi status says whether it is up.'),
741
+ },
742
+ {
743
+ name: 'migrate',
744
+ group: 'Develop',
745
+ summary: "Apply core's migrations and every installed plugin's.",
746
+ usage: 'buddi migrate',
747
+ flags: [],
748
+ exitCodes: [NEEDS_DATABASE],
749
+ applies: 'checkout',
750
+ elsewhere: CHECKOUT_ONLY('migrate', 'A packaged install migrates when it starts and when it upgrades.'),
751
+ },
752
+ {
753
+ name: 'serve',
754
+ group: 'Develop',
755
+ summary: 'Run the gateway in this terminal instead of the service.',
756
+ usage: 'buddi serve',
757
+ flags: [],
758
+ applies: 'checkout',
759
+ elsewhere: CHECKOUT_ONLY('serve', 'A packaged install runs in the background; buddi service status says how it is.'),
760
+ },
761
+ ];
762
+ /* ------------------------------------------------------------------ *
763
+ * Where this buddi runs
764
+ * ------------------------------------------------------------------ */
765
+ /**
766
+ * A packaged install or a source checkout.
767
+ *
768
+ * The launcher (`@buddi/install`'s `environment()`) writes
769
+ * `BUDDI_INSTALL_ROOT` before it hands anything to this package, and nothing
770
+ * else does; a checkout finds its root from `pnpm-workspace.yaml` instead.
771
+ */
772
+ export function installKind(env = process.env) {
773
+ const root = env.BUDDI_INSTALL_ROOT?.trim();
774
+ return root ? 'packaged' : 'checkout';
775
+ }
776
+ export function appliesHere(entry, kind) {
777
+ return entry.applies === 'both' || entry.applies === kind;
778
+ }
779
+ /** `BUDDI_JSON=1` is `--json` for a cron line. */
780
+ export function jsonFromEnv(env = process.env) {
781
+ const raw = env.BUDDI_JSON?.trim().toLowerCase();
782
+ return raw === '1' || raw === 'true' || raw === 'yes';
783
+ }
784
+ /* ------------------------------------------------------------------ *
785
+ * Finding the entry an argv means
786
+ * ------------------------------------------------------------------ */
787
+ const WORD = /^[a-z][a-z0-9-]*$/;
788
+ /** The command words at the front of an argv: `backup create` out of `backup create --encrypt`. */
789
+ export function commandWords(argv) {
790
+ const words = [];
791
+ for (const arg of argv) {
792
+ if (!WORD.test(arg) || words.length === 3)
793
+ break;
794
+ words.push(arg);
795
+ }
796
+ return words;
797
+ }
798
+ /** The entry an argv is for: the longest run of leading words that names one. */
799
+ export function entryFor(argv, table = COMMANDS) {
800
+ const words = commandWords(argv);
801
+ // Unknown words never fall back to the bare command: only no words at all is `buddi`.
802
+ for (let n = words.length; n >= (words.length === 0 ? 0 : 1); n -= 1) {
803
+ const name = words.slice(0, n).join(' ');
804
+ const hit = table.find((e) => e.name === name);
805
+ if (hit)
806
+ return hit;
807
+ }
808
+ return undefined;
809
+ }
810
+ /** The entries under a first word, when that word is a group like `backup`. */
811
+ export function entriesUnder(prefix, table = COMMANDS) {
812
+ return table.filter((e) => e.name.startsWith(`${prefix} `));
813
+ }
814
+ /* ------------------------------------------------------------------ *
815
+ * Did you mean
816
+ * ------------------------------------------------------------------ */
817
+ /** Edits between two words, a swap of neighbours counting as one (`stauts`). */
818
+ export function editDistance(a, b) {
819
+ const d = Array.from({ length: a.length + 1 }, (_, i) => Array.from({ length: b.length + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0)));
820
+ for (let i = 1; i <= a.length; i += 1) {
821
+ for (let j = 1; j <= b.length; j += 1) {
822
+ const cost = a[i - 1] === b[j - 1] ? 0 : 1;
823
+ const row = d[i];
824
+ const up = d[i - 1];
825
+ row[j] = Math.min(up[j] + 1, row[j - 1] + 1, up[j - 1] + cost);
826
+ if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
827
+ row[j] = Math.min(row[j], d[i - 2][j - 2] + 1);
828
+ }
829
+ }
830
+ }
831
+ return d[a.length][b.length];
832
+ }
833
+ /**
834
+ * The command nearest to what was typed, when one is near enough to be worth
835
+ * saying. Compared against the first word alone and the first two, so both
836
+ * `buddi stauts` and `buddi backup craete` find their way.
837
+ */
838
+ export function nearestCommand(argv, kind, table = COMMANDS) {
839
+ const words = argv.filter((a) => !a.startsWith('-')).slice(0, 2);
840
+ if (words.length === 0)
841
+ return undefined;
842
+ // Two words first (`backup craete`), then the first alone (`stauts`, `bakup`).
843
+ const attempts = words.length > 1 ? [words.join(' '), words[0]] : [words[0]];
844
+ for (const typed of attempts) {
845
+ let best;
846
+ for (const entry of table) {
847
+ if (entry.name === '' || !appliesHere(entry, kind))
848
+ continue;
849
+ const parts = entry.name.split(' ');
850
+ // A single typed word is measured against the command's first word, so
851
+ // `bakup` finds the backup group and answers with its first command.
852
+ const target = typed.includes(' ') ? entry.name : parts[0];
853
+ if (typed.includes(' ') && parts.length < 2)
854
+ continue;
855
+ const score = editDistance(typed, target);
856
+ if (best === undefined || score < best.score)
857
+ best = { name: entry.name, score };
858
+ }
859
+ if (best !== undefined && best.score <= Math.max(1, Math.floor(typed.length / 3)))
860
+ return best.name;
861
+ }
862
+ return undefined;
863
+ }
864
+ /* ------------------------------------------------------------------ *
865
+ * Rendering
866
+ * ------------------------------------------------------------------ */
867
+ /** `buddi backup verify <archive>`: the usage up to its first option. */
868
+ export function shortUsage(entry) {
869
+ const out = [];
870
+ for (const token of entry.usage.split(' ')) {
871
+ if (token.startsWith('[') || token.startsWith('-') || token === '|')
872
+ break;
873
+ out.push(token);
874
+ }
875
+ return out.join(' ');
876
+ }
877
+ const PLAIN = { bold: (t) => t, dim: (t) => t };
878
+ /** `buddi help`: every command that applies here, grouped, one line each. */
879
+ export function renderHelp(table, kind, style = PLAIN) {
880
+ const shown = table.filter((e) => appliesHere(e, kind));
881
+ const width = Math.max(...shown.map((e) => shortUsage(e).length));
882
+ const out = ['buddi: your personal agents, one command.'];
883
+ for (const group of GROUPS) {
884
+ const entries = shown.filter((e) => e.group === group);
885
+ if (entries.length === 0)
886
+ continue;
887
+ out.push('', style.bold(group));
888
+ for (const entry of entries) {
889
+ out.push(` ${shortUsage(entry).padEnd(width)} ${style.dim(entry.summary)}`);
890
+ }
891
+ }
892
+ out.push('', 'buddi help <command> prints its flags, an example and its exit codes.');
893
+ return out.join('\n');
894
+ }
895
+ const BASE_EXIT_CODES = [
896
+ { code: 0, meaning: 'Done.' },
897
+ { code: 1, meaning: 'It failed; the message says why.' },
898
+ { code: 2, meaning: 'The command was not typed right.' },
899
+ ];
900
+ export function exitCodesOf(entry) {
901
+ const merged = new Map(BASE_EXIT_CODES.map((c) => [c.code, c.meaning]));
902
+ for (const extra of entry.exitCodes ?? [])
903
+ merged.set(extra.code, extra.meaning);
904
+ return [...merged.entries()].sort((a, b) => a[0] - b[0]).map(([code, meaning]) => ({ code, meaning }));
905
+ }
906
+ /** `buddi help <command>` and `buddi <command> --help`. */
907
+ export function renderCommandHelp(entry, table = COMMANDS, kind = 'checkout', style = PLAIN) {
908
+ const out = [style.bold(entry.usage === 'buddi' ? 'buddi' : shortUsage(entry)), '', entry.summary];
909
+ if (!appliesHere(entry, kind) && entry.elsewhere)
910
+ out.push('', entry.elsewhere);
911
+ out.push('', style.bold('Usage'), ` ${entry.usage}`);
912
+ if (entry.flags.length > 0) {
913
+ const width = Math.max(...entry.flags.map((f) => f.flag.length));
914
+ out.push('', style.bold('Flags'));
915
+ for (const f of entry.flags)
916
+ out.push(` ${f.flag.padEnd(width)} ${f.meaning}`);
917
+ }
918
+ if (entry.example)
919
+ out.push('', style.bold('Example'), ` ${entry.example}`);
920
+ if (entry.json)
921
+ out.push('', style.bold('JSON'), ` ${entry.json}`);
922
+ out.push('', style.bold('Exit codes'));
923
+ for (const c of exitCodesOf(entry))
924
+ out.push(` ${c.code} ${c.meaning}`);
925
+ const related = entry.name === '' ? [] : entriesUnder(entry.name, table).filter((e) => appliesHere(e, kind));
926
+ if (related.length > 0) {
927
+ out.push('', style.bold('See also'));
928
+ for (const r of related)
929
+ out.push(` ${shortUsage(r)}`);
930
+ }
931
+ return out.join('\n');
932
+ }
933
+ /** `buddi help backup`: the commands under a word that is not a command itself. */
934
+ export function renderGroupHelp(prefix, table, kind, style = PLAIN) {
935
+ const entries = entriesUnder(prefix, table).filter((e) => appliesHere(e, kind));
936
+ const width = Math.max(...entries.map((e) => shortUsage(e).length));
937
+ return [
938
+ ...entries.map((e) => ` ${shortUsage(e).padEnd(width)} ${style.dim(e.summary)}`),
939
+ '',
940
+ `buddi help ${prefix} <command> prints one of them in full.`,
941
+ ].join('\n');
942
+ }
943
+ /* ------------------------------------------------------------------ *
944
+ * The reference page
945
+ * ------------------------------------------------------------------ */
946
+ const GROUP_NOTES = {
947
+ Everyday: 'What you type most days.',
948
+ Agents: 'Your agents, what they have scheduled, and the plugins they use.',
949
+ Reach: 'The ways your agents reach you, and the ways you reach them.',
950
+ Operate: 'Keeping buddi running: the service, upgrades, backups, secrets and the work queue.',
951
+ Develop: 'Only in a source checkout. A packaged install does not list them.',
952
+ };
953
+ /**
954
+ * `docs/cli.md`, without its frontmatter: the script adds that, and the test
955
+ * compares what follows it.
956
+ */
957
+ export function renderReference(table = COMMANDS) {
958
+ const out = [
959
+ '# The buddi command line',
960
+ '',
961
+ 'Every command, grouped the way `buddi help` groups them. The same words work in a',
962
+ 'packaged install and in a source checkout; what does not apply where you run it is',
963
+ 'left out of `buddi help`, and says what to do instead when typed. `buddi help <command>`',
964
+ 'and `buddi <command> --help` print one command with an example and its exit codes.',
965
+ '',
966
+ 'This page is generated from the command table (`packages/cli/src/commands.ts`) by',
967
+ '`pnpm docs:cli`; a test fails when the two differ.',
968
+ '',
969
+ '## Exit codes and output',
970
+ '',
971
+ '- `0` done, `1` failed, `2` the command was not typed right, `3` it needs something',
972
+ ' first: the database is not reachable, the agent does not exist, an approval is',
973
+ ' waiting.',
974
+ '- Answers go to stdout and diagnostics to stderr. Colour only on a terminal, and',
975
+ ' never with `NO_COLOR` set.',
976
+ '- `--json` on the commands that read prints one object or one array with the',
977
+ ' fields listed below. `BUDDI_JSON=1` does the same, for a cron line; commands that',
978
+ ' change something ignore it.',
979
+ ];
980
+ for (const group of GROUPS) {
981
+ out.push('', `## ${group}`, '', GROUP_NOTES[group], '');
982
+ for (const entry of table.filter((e) => e.group === group)) {
983
+ const only = entry.applies === 'checkout' && group !== 'Develop' ? ' Source checkout only.' : '';
984
+ out.push(`- \`${entry.usage}\`: ${entry.summary}${only}`);
985
+ for (const f of entry.flags)
986
+ out.push(` - \`${f.flag}\`: ${f.meaning}`);
987
+ if (entry.json)
988
+ out.push(` - JSON: ${entry.json}`);
989
+ }
990
+ }
991
+ return `${out.join('\n')}\n`;
992
+ }
993
+ //# sourceMappingURL=commands.js.map