@withbuddi/buddi 0.1.0-pre.25 → 0.1.0-pre.26

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 (334) hide show
  1. package/examples/agents/agent-father/agent.md +1 -0
  2. package/extension/manifest.json +2 -2
  3. package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
  4. package/node_modules/@buddi/cli/dist/doctor-probes.d.ts.map +1 -1
  5. package/node_modules/@buddi/cli/dist/doctor-probes.js +29 -8
  6. package/node_modules/@buddi/cli/dist/doctor-probes.js.map +1 -1
  7. package/node_modules/@buddi/cli/dist/doctor.d.ts +8 -1
  8. package/node_modules/@buddi/cli/dist/doctor.d.ts.map +1 -1
  9. package/node_modules/@buddi/cli/dist/doctor.js +19 -2
  10. package/node_modules/@buddi/cli/dist/doctor.js.map +1 -1
  11. package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
  12. package/node_modules/@buddi/core/dist/agents/catalog.d.ts.map +1 -1
  13. package/node_modules/@buddi/core/dist/agents/catalog.js +11 -2
  14. package/node_modules/@buddi/core/dist/agents/catalog.js.map +1 -1
  15. package/node_modules/@buddi/core/dist/agents/skills.d.ts +4 -4
  16. package/node_modules/@buddi/core/dist/notifications/agent.d.ts +54 -0
  17. package/node_modules/@buddi/core/dist/notifications/agent.d.ts.map +1 -0
  18. package/node_modules/@buddi/core/dist/notifications/agent.js +134 -0
  19. package/node_modules/@buddi/core/dist/notifications/agent.js.map +1 -0
  20. package/node_modules/@buddi/core/dist/notifications/index.d.ts +1 -0
  21. package/node_modules/@buddi/core/dist/notifications/index.d.ts.map +1 -1
  22. package/node_modules/@buddi/core/dist/notifications/index.js +1 -0
  23. package/node_modules/@buddi/core/dist/notifications/index.js.map +1 -1
  24. package/node_modules/@buddi/core/dist/notifications/notify.d.ts +4 -0
  25. package/node_modules/@buddi/core/dist/notifications/notify.d.ts.map +1 -1
  26. package/node_modules/@buddi/core/dist/notifications/notify.js +19 -7
  27. package/node_modules/@buddi/core/dist/notifications/notify.js.map +1 -1
  28. package/node_modules/@buddi/core/dist/notifications/store.d.ts +8 -1
  29. package/node_modules/@buddi/core/dist/notifications/store.d.ts.map +1 -1
  30. package/node_modules/@buddi/core/dist/notifications/store.js +55 -6
  31. package/node_modules/@buddi/core/dist/notifications/store.js.map +1 -1
  32. package/node_modules/@buddi/core/dist/notifications/types.d.ts +26 -2
  33. package/node_modules/@buddi/core/dist/notifications/types.d.ts.map +1 -1
  34. package/node_modules/@buddi/core/dist/notifications/types.js +1 -1
  35. package/node_modules/@buddi/core/dist/notifications/types.js.map +1 -1
  36. package/node_modules/@buddi/core/dist/vault/resolve.d.ts.map +1 -1
  37. package/node_modules/@buddi/core/dist/vault/resolve.js +0 -1
  38. package/node_modules/@buddi/core/dist/vault/resolve.js.map +1 -1
  39. package/node_modules/@buddi/core/migrations/054_agent_messages.sql +15 -0
  40. package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
  41. package/node_modules/@buddi/gateway/dist/agents/owner-tools.d.ts +34 -1
  42. package/node_modules/@buddi/gateway/dist/agents/owner-tools.d.ts.map +1 -1
  43. package/node_modules/@buddi/gateway/dist/agents/owner-tools.js +87 -4
  44. package/node_modules/@buddi/gateway/dist/agents/owner-tools.js.map +1 -1
  45. package/node_modules/@buddi/gateway/dist/bootstrap.js +3 -3
  46. package/node_modules/@buddi/gateway/dist/bootstrap.js.map +1 -1
  47. package/node_modules/@buddi/gateway/dist/owner-secrets.d.ts +77 -8
  48. package/node_modules/@buddi/gateway/dist/owner-secrets.d.ts.map +1 -1
  49. package/node_modules/@buddi/gateway/dist/owner-secrets.js +142 -14
  50. package/node_modules/@buddi/gateway/dist/owner-secrets.js.map +1 -1
  51. package/node_modules/@buddi/gateway/dist/serve.d.ts.map +1 -1
  52. package/node_modules/@buddi/gateway/dist/serve.js +24 -8
  53. package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
  54. package/node_modules/@buddi/gateway/dist/system-context.d.ts +2 -0
  55. package/node_modules/@buddi/gateway/dist/system-context.d.ts.map +1 -1
  56. package/node_modules/@buddi/gateway/dist/system-context.js +5 -1
  57. package/node_modules/@buddi/gateway/dist/system-context.js.map +1 -1
  58. package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts +7 -0
  59. package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts.map +1 -1
  60. package/node_modules/@buddi/gateway/dist/telegram/channel.js +14 -2
  61. package/node_modules/@buddi/gateway/dist/telegram/channel.js.map +1 -1
  62. package/node_modules/@buddi/gateway/dist/web/connections.d.ts +3 -0
  63. package/node_modules/@buddi/gateway/dist/web/connections.d.ts.map +1 -1
  64. package/node_modules/@buddi/gateway/dist/web/connections.js +48 -6
  65. package/node_modules/@buddi/gateway/dist/web/connections.js.map +1 -1
  66. package/node_modules/@buddi/gateway/dist/web/notifications.d.ts +6 -0
  67. package/node_modules/@buddi/gateway/dist/web/notifications.d.ts.map +1 -1
  68. package/node_modules/@buddi/gateway/dist/web/notifications.js +14 -1
  69. package/node_modules/@buddi/gateway/dist/web/notifications.js.map +1 -1
  70. package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts.map +1 -1
  71. package/node_modules/@buddi/gateway/dist/web/onboarding.js +5 -2
  72. package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
  73. package/node_modules/@buddi/gateway/dist/web/recovery.d.ts +10 -0
  74. package/node_modules/@buddi/gateway/dist/web/recovery.d.ts.map +1 -1
  75. package/node_modules/@buddi/gateway/dist/web/recovery.js +113 -33
  76. package/node_modules/@buddi/gateway/dist/web/recovery.js.map +1 -1
  77. package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
  78. package/node_modules/@buddi/gateway/dist/web/server.js +16 -5
  79. package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
  80. package/node_modules/@buddi/gateway/dist/web/sessions.d.ts +8 -0
  81. package/node_modules/@buddi/gateway/dist/web/sessions.d.ts.map +1 -1
  82. package/node_modules/@buddi/gateway/dist/web/sessions.js +24 -1
  83. package/node_modules/@buddi/gateway/dist/web/sessions.js.map +1 -1
  84. package/node_modules/@buddi/gateway/src/agents/starter/keeper/agent.md +2 -2
  85. package/node_modules/@buddi/gateway/src/agents/starter/planner/agent.md +1 -1
  86. package/node_modules/@buddi/gateway/src/agents/starter/scout/agent.md +1 -1
  87. package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
  88. package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
  89. package/node_modules/@buddi/runtime/dist/delegate.js +1 -1
  90. package/node_modules/@buddi/runtime/dist/delegate.js.map +1 -1
  91. package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
  92. package/node_modules/@buddi/tool-email/dist/config.d.ts +13 -9
  93. package/node_modules/@buddi/tool-email/dist/config.d.ts.map +1 -1
  94. package/node_modules/@buddi/tool-email/dist/config.js +33 -40
  95. package/node_modules/@buddi/tool-email/dist/config.js.map +1 -1
  96. package/node_modules/@buddi/tool-email/dist/index.d.ts +1 -1
  97. package/node_modules/@buddi/tool-email/dist/index.d.ts.map +1 -1
  98. package/node_modules/@buddi/tool-email/dist/index.js +1 -1
  99. package/node_modules/@buddi/tool-email/dist/index.js.map +1 -1
  100. package/node_modules/@buddi/tool-email/dist/pages/accounts.d.ts +1 -2
  101. package/node_modules/@buddi/tool-email/dist/pages/accounts.d.ts.map +1 -1
  102. package/node_modules/@buddi/tool-email/dist/pages/accounts.js +42 -18
  103. package/node_modules/@buddi/tool-email/dist/pages/accounts.js.map +1 -1
  104. package/node_modules/@buddi/tool-email/dist/pages/queries.d.ts.map +1 -1
  105. package/node_modules/@buddi/tool-email/dist/pages/queries.js +7 -5
  106. package/node_modules/@buddi/tool-email/dist/pages/queries.js.map +1 -1
  107. package/node_modules/@buddi/tool-email/dist/ports.d.ts +5 -1
  108. package/node_modules/@buddi/tool-email/dist/ports.d.ts.map +1 -1
  109. package/node_modules/@buddi/tool-email/dist/tools/shared.js +1 -1
  110. package/node_modules/@buddi/tool-email/dist/tools/shared.js.map +1 -1
  111. package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
  112. package/node_modules/@buddi/tool-web/dist/providers/index.d.ts +1 -2
  113. package/node_modules/@buddi/tool-web/dist/providers/index.d.ts.map +1 -1
  114. package/node_modules/@buddi/tool-web/dist/providers/index.js +1 -2
  115. package/node_modules/@buddi/tool-web/dist/providers/index.js.map +1 -1
  116. package/node_modules/hono/dist/cjs/jsx/utils.js +1 -1
  117. package/node_modules/hono/dist/cjs/middleware/combine/index.js +3 -1
  118. package/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -2
  119. package/node_modules/hono/dist/jsx/utils.js +1 -1
  120. package/node_modules/hono/dist/middleware/combine/index.js +3 -1
  121. package/node_modules/hono/dist/middleware/etag/index.js +2 -2
  122. package/node_modules/hono/dist/middleware/language/language.js +1 -1
  123. package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +2 -1
  124. package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +2 -1
  125. package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +2 -1
  126. package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +2 -1
  127. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +2 -1
  128. package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +2 -1
  129. package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +2 -1
  130. package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +2 -1
  131. package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +2 -1
  132. package/node_modules/hono/dist/types/client/types.d.ts +2 -1
  133. package/node_modules/hono/dist/types/context.d.ts +2 -1
  134. package/node_modules/hono/dist/types/helper/cookie/index.d.ts +2 -1
  135. package/node_modules/hono/dist/types/helper/css/common.d.ts +2 -1
  136. package/node_modules/hono/dist/types/helper/css/index.d.ts +2 -1
  137. package/node_modules/hono/dist/types/helper/dev/index.d.ts +2 -1
  138. package/node_modules/hono/dist/types/helper/factory/index.d.ts +2 -1
  139. package/node_modules/hono/dist/types/helper/proxy/index.d.ts +2 -1
  140. package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +2 -1
  141. package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +2 -1
  142. package/node_modules/hono/dist/types/helper/testing/index.d.ts +2 -1
  143. package/node_modules/hono/dist/types/hono-base.d.ts +2 -1
  144. package/node_modules/hono/dist/types/http-exception.d.ts +2 -1
  145. package/node_modules/hono/dist/types/jsx/base.d.ts +4 -3
  146. package/node_modules/hono/dist/types/jsx/context.d.ts +2 -1
  147. package/node_modules/hono/dist/types/jsx/dom/client.d.ts +2 -1
  148. package/node_modules/hono/dist/types/jsx/dom/css.d.ts +2 -1
  149. package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +2 -1
  150. package/node_modules/hono/dist/types/jsx/dom/index.d.ts +2 -1
  151. package/node_modules/hono/dist/types/jsx/dom/render.d.ts +2 -1
  152. package/node_modules/hono/dist/types/jsx/dom/server.d.ts +2 -1
  153. package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +2 -1
  154. package/node_modules/hono/dist/types/jsx/index.d.ts +2 -1
  155. package/node_modules/hono/dist/types/jsx/types.d.ts +2 -1
  156. package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +2 -1
  157. package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +2 -1
  158. package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +2 -1
  159. package/node_modules/hono/dist/types/middleware/combine/index.d.ts +2 -1
  160. package/node_modules/hono/dist/types/middleware/compress/index.d.ts +2 -1
  161. package/node_modules/hono/dist/types/middleware/cors/index.d.ts +2 -1
  162. package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +2 -1
  163. package/node_modules/hono/dist/types/middleware/etag/index.d.ts +2 -1
  164. package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +2 -1
  165. package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -1
  166. package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +2 -1
  167. package/node_modules/hono/dist/types/middleware/language/index.d.ts +2 -1
  168. package/node_modules/hono/dist/types/middleware/logger/index.d.ts +2 -1
  169. package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +2 -1
  170. package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +2 -1
  171. package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +2 -1
  172. package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +2 -1
  173. package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +2 -1
  174. package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +2 -1
  175. package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +2 -1
  176. package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +2 -1
  177. package/node_modules/hono/dist/types/middleware/timing/index.d.ts +2 -1
  178. package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +2 -1
  179. package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +2 -1
  180. package/node_modules/hono/dist/types/request.d.ts +2 -1
  181. package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +2 -1
  182. package/node_modules/hono/dist/types/types.d.ts +2 -1
  183. package/node_modules/hono/dist/types/utils/body.d.ts +2 -1
  184. package/node_modules/hono/dist/types/utils/buffer.d.ts +2 -1
  185. package/node_modules/hono/dist/types/utils/cookie.d.ts +2 -1
  186. package/node_modules/hono/dist/types/utils/crypto.d.ts +2 -1
  187. package/node_modules/hono/dist/types/utils/filepath.d.ts +2 -1
  188. package/node_modules/hono/dist/types/utils/html.d.ts +2 -1
  189. package/node_modules/hono/dist/types/utils/mime.d.ts +2 -1
  190. package/node_modules/hono/dist/types/utils/types.d.ts +2 -1
  191. package/node_modules/hono/dist/types/utils/url.d.ts +2 -1
  192. package/node_modules/hono/dist/types/validator/utils.d.ts +2 -1
  193. package/node_modules/hono/dist/types/validator/validator.d.ts +2 -1
  194. package/node_modules/hono/package.json +2 -2
  195. package/node_modules/pg/lib/client.js +18 -0
  196. package/node_modules/pg/lib/connection.js +8 -1
  197. package/node_modules/pg/lib/crypto/cert-signatures.js +1 -1
  198. package/node_modules/pg/lib/native/client.js +11 -3
  199. package/node_modules/pg/lib/native/query.js +3 -1
  200. package/node_modules/pg/lib/query.js +5 -1
  201. package/node_modules/pg/lib/utils.js +19 -1
  202. package/node_modules/pg/package.json +5 -5
  203. package/node_modules/pg-connection-string/index.js +1 -1
  204. package/node_modules/pg-connection-string/package.json +2 -3
  205. package/node_modules/pg-protocol/dist/buffer-writer.d.ts +5 -1
  206. package/node_modules/pg-protocol/dist/buffer-writer.js +10 -1
  207. package/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -1
  208. package/node_modules/pg-protocol/dist/serializer.js +20 -18
  209. package/node_modules/pg-protocol/dist/serializer.js.map +1 -1
  210. package/node_modules/pg-protocol/package.json +2 -2
  211. package/node_modules/pg-protocol/src/buffer-writer.ts +12 -2
  212. package/node_modules/pg-protocol/src/serializer.ts +26 -20
  213. package/package.json +2 -2
  214. package/packages/cli/dist/.tsbuildinfo +1 -1
  215. package/packages/cli/dist/doctor-probes.d.ts.map +1 -1
  216. package/packages/cli/dist/doctor-probes.js +29 -8
  217. package/packages/cli/dist/doctor-probes.js.map +1 -1
  218. package/packages/cli/dist/doctor.d.ts +8 -1
  219. package/packages/cli/dist/doctor.d.ts.map +1 -1
  220. package/packages/cli/dist/doctor.js +19 -2
  221. package/packages/cli/dist/doctor.js.map +1 -1
  222. package/packages/core/dist/.tsbuildinfo +1 -1
  223. package/packages/core/dist/agents/catalog.d.ts.map +1 -1
  224. package/packages/core/dist/agents/catalog.js +11 -2
  225. package/packages/core/dist/agents/catalog.js.map +1 -1
  226. package/packages/core/dist/agents/skills.d.ts +4 -4
  227. package/packages/core/dist/notifications/agent.d.ts +54 -0
  228. package/packages/core/dist/notifications/agent.d.ts.map +1 -0
  229. package/packages/core/dist/notifications/agent.js +134 -0
  230. package/packages/core/dist/notifications/agent.js.map +1 -0
  231. package/packages/core/dist/notifications/index.d.ts +1 -0
  232. package/packages/core/dist/notifications/index.d.ts.map +1 -1
  233. package/packages/core/dist/notifications/index.js +1 -0
  234. package/packages/core/dist/notifications/index.js.map +1 -1
  235. package/packages/core/dist/notifications/notify.d.ts +4 -0
  236. package/packages/core/dist/notifications/notify.d.ts.map +1 -1
  237. package/packages/core/dist/notifications/notify.js +19 -7
  238. package/packages/core/dist/notifications/notify.js.map +1 -1
  239. package/packages/core/dist/notifications/store.d.ts +8 -1
  240. package/packages/core/dist/notifications/store.d.ts.map +1 -1
  241. package/packages/core/dist/notifications/store.js +55 -6
  242. package/packages/core/dist/notifications/store.js.map +1 -1
  243. package/packages/core/dist/notifications/types.d.ts +26 -2
  244. package/packages/core/dist/notifications/types.d.ts.map +1 -1
  245. package/packages/core/dist/notifications/types.js +1 -1
  246. package/packages/core/dist/notifications/types.js.map +1 -1
  247. package/packages/core/dist/vault/resolve.d.ts.map +1 -1
  248. package/packages/core/dist/vault/resolve.js +0 -1
  249. package/packages/core/dist/vault/resolve.js.map +1 -1
  250. package/packages/core/migrations/054_agent_messages.sql +15 -0
  251. package/packages/gateway/dist/.tsbuildinfo +1 -1
  252. package/packages/gateway/dist/agents/owner-tools.d.ts +34 -1
  253. package/packages/gateway/dist/agents/owner-tools.d.ts.map +1 -1
  254. package/packages/gateway/dist/agents/owner-tools.js +87 -4
  255. package/packages/gateway/dist/agents/owner-tools.js.map +1 -1
  256. package/packages/gateway/dist/bootstrap.js +3 -3
  257. package/packages/gateway/dist/bootstrap.js.map +1 -1
  258. package/packages/gateway/dist/owner-secrets.d.ts +77 -8
  259. package/packages/gateway/dist/owner-secrets.d.ts.map +1 -1
  260. package/packages/gateway/dist/owner-secrets.js +142 -14
  261. package/packages/gateway/dist/owner-secrets.js.map +1 -1
  262. package/packages/gateway/dist/serve.d.ts.map +1 -1
  263. package/packages/gateway/dist/serve.js +24 -8
  264. package/packages/gateway/dist/serve.js.map +1 -1
  265. package/packages/gateway/dist/system-context.d.ts +2 -0
  266. package/packages/gateway/dist/system-context.d.ts.map +1 -1
  267. package/packages/gateway/dist/system-context.js +5 -1
  268. package/packages/gateway/dist/system-context.js.map +1 -1
  269. package/packages/gateway/dist/telegram/channel.d.ts +7 -0
  270. package/packages/gateway/dist/telegram/channel.d.ts.map +1 -1
  271. package/packages/gateway/dist/telegram/channel.js +14 -2
  272. package/packages/gateway/dist/telegram/channel.js.map +1 -1
  273. package/packages/gateway/dist/web/connections.d.ts +3 -0
  274. package/packages/gateway/dist/web/connections.d.ts.map +1 -1
  275. package/packages/gateway/dist/web/connections.js +48 -6
  276. package/packages/gateway/dist/web/connections.js.map +1 -1
  277. package/packages/gateway/dist/web/notifications.d.ts +6 -0
  278. package/packages/gateway/dist/web/notifications.d.ts.map +1 -1
  279. package/packages/gateway/dist/web/notifications.js +14 -1
  280. package/packages/gateway/dist/web/notifications.js.map +1 -1
  281. package/packages/gateway/dist/web/onboarding.d.ts.map +1 -1
  282. package/packages/gateway/dist/web/onboarding.js +5 -2
  283. package/packages/gateway/dist/web/onboarding.js.map +1 -1
  284. package/packages/gateway/dist/web/recovery.d.ts +10 -0
  285. package/packages/gateway/dist/web/recovery.d.ts.map +1 -1
  286. package/packages/gateway/dist/web/recovery.js +113 -33
  287. package/packages/gateway/dist/web/recovery.js.map +1 -1
  288. package/packages/gateway/dist/web/server.d.ts.map +1 -1
  289. package/packages/gateway/dist/web/server.js +16 -5
  290. package/packages/gateway/dist/web/server.js.map +1 -1
  291. package/packages/gateway/dist/web/sessions.d.ts +8 -0
  292. package/packages/gateway/dist/web/sessions.d.ts.map +1 -1
  293. package/packages/gateway/dist/web/sessions.js +24 -1
  294. package/packages/gateway/dist/web/sessions.js.map +1 -1
  295. package/packages/gateway/src/agents/starter/keeper/agent.md +2 -2
  296. package/packages/gateway/src/agents/starter/planner/agent.md +1 -1
  297. package/packages/gateway/src/agents/starter/scout/agent.md +1 -1
  298. package/packages/install/dist/.tsbuildinfo +1 -1
  299. package/packages/runtime/dist/.tsbuildinfo +1 -1
  300. package/packages/runtime/dist/delegate.js +1 -1
  301. package/packages/runtime/dist/delegate.js.map +1 -1
  302. package/packages/tools/email/dist/.tsbuildinfo +1 -1
  303. package/packages/tools/email/dist/config.d.ts +13 -9
  304. package/packages/tools/email/dist/config.d.ts.map +1 -1
  305. package/packages/tools/email/dist/config.js +33 -40
  306. package/packages/tools/email/dist/config.js.map +1 -1
  307. package/packages/tools/email/dist/index.d.ts +1 -1
  308. package/packages/tools/email/dist/index.d.ts.map +1 -1
  309. package/packages/tools/email/dist/index.js +1 -1
  310. package/packages/tools/email/dist/index.js.map +1 -1
  311. package/packages/tools/email/dist/pages/accounts.d.ts +1 -2
  312. package/packages/tools/email/dist/pages/accounts.d.ts.map +1 -1
  313. package/packages/tools/email/dist/pages/accounts.js +42 -18
  314. package/packages/tools/email/dist/pages/accounts.js.map +1 -1
  315. package/packages/tools/email/dist/pages/queries.d.ts.map +1 -1
  316. package/packages/tools/email/dist/pages/queries.js +7 -5
  317. package/packages/tools/email/dist/pages/queries.js.map +1 -1
  318. package/packages/tools/email/dist/ports.d.ts +5 -1
  319. package/packages/tools/email/dist/ports.d.ts.map +1 -1
  320. package/packages/tools/email/dist/tools/shared.js +1 -1
  321. package/packages/tools/email/dist/tools/shared.js.map +1 -1
  322. package/packages/tools/web/dist/.tsbuildinfo +1 -1
  323. package/packages/tools/web/dist/providers/index.d.ts +1 -2
  324. package/packages/tools/web/dist/providers/index.d.ts.map +1 -1
  325. package/packages/tools/web/dist/providers/index.js +1 -2
  326. package/packages/tools/web/dist/providers/index.js.map +1 -1
  327. package/packages/web/dist/assets/{index-DIXokQ4n.css → index-BxbiKNMS.css} +1 -1
  328. package/packages/web/dist/assets/index-Rrze3bGo.js +130 -0
  329. package/packages/web/dist/assets/{lottie_light-j3HICV9o.js → lottie_light-7wQnGwdw.js} +1 -1
  330. package/packages/web/dist/build.json +1 -1
  331. package/packages/web/dist/index.html +2 -2
  332. package/packages/web/dist/precache.json +4 -4
  333. package/packages/web/dist/sw.js +5 -3
  334. package/packages/web/dist/assets/index-uqQyuYjR.js +0 -128
@@ -35,6 +35,8 @@ const errorFieldMap = {
35
35
  sqlState: 'code',
36
36
  statementPosition: 'position',
37
37
  messagePrimary: 'message',
38
+ messageDetail: 'detail',
39
+ messageHint: 'hint',
38
40
  context: 'where',
39
41
  schemaName: 'schema',
40
42
  tableName: 'table',
@@ -137,7 +139,7 @@ NativeQuery.prototype.submit = function (client) {
137
139
 
138
140
  // check if the client has already executed this named query
139
141
  // if so...just execute it again - skip the planning phase
140
- if (client.namedQueries[this.name]) {
142
+ if (client.namedQueries[this.name] !== undefined) {
141
143
  if (this.text && client.namedQueries[this.name] !== this.text) {
142
144
  const err = new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`)
143
145
  return after(err)
@@ -183,7 +183,11 @@ class Query extends EventEmitter {
183
183
  }
184
184
 
185
185
  hasBeenParsed(connection) {
186
- return this.name && (connection.parsedStatements[this.name] || connection.submittedNamedStatements[this.name])
186
+ return (
187
+ this.name &&
188
+ (connection.parsedStatements[this.name] !== undefined ||
189
+ connection.submittedNamedStatements[this.name] !== undefined)
190
+ )
187
191
  }
188
192
 
189
193
  handlePortalSuspended(connection) {
@@ -1,9 +1,16 @@
1
1
  'use strict'
2
2
 
3
3
  const defaults = require('./defaults')
4
+ const nodeUtils = require('util')
4
5
 
5
6
  const { isDate } = require('util/types')
6
7
 
8
+ const invalidDateDeprecationNotice = nodeUtils.deprecate(
9
+ () => {},
10
+ 'Sending an invalid date to Postgres is deprecated and will throw an error in the next major version of pg. Ensure any Date object passed as a query parameter is valid.',
11
+ 'PG_INVALID_DATE'
12
+ )
13
+
7
14
  function escapeElement(elementRepresentation) {
8
15
  const escaped = elementRepresentation.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
9
16
 
@@ -54,6 +61,9 @@ const prepareValue = function (val, seen) {
54
61
  return Buffer.from(val.buffer, val.byteOffset, val.byteLength)
55
62
  }
56
63
  if (isDate(val)) {
64
+ if (isNaN(val.getTime())) {
65
+ invalidDateDeprecationNotice()
66
+ }
57
67
  if (defaults.parseInputDatesAsUTC) {
58
68
  return dateToStringUTC(val)
59
69
  } else {
@@ -143,7 +153,8 @@ function dateToStringUTC(date) {
143
153
 
144
154
  function normalizeQueryConfig(config, values, callback) {
145
155
  // can take in strings or config objects
146
- config = typeof config === 'string' ? { text: config } : config
156
+ // Copy config so normalization does not mutate the caller's object.
157
+ config = typeof config === 'string' ? { text: config } : cloneQueryConfig(config)
147
158
  if (values) {
148
159
  if (typeof values === 'function') {
149
160
  config.callback = values
@@ -157,6 +168,13 @@ function normalizeQueryConfig(config, values, callback) {
157
168
  return config
158
169
  }
159
170
 
171
+ function cloneQueryConfig(config) {
172
+ if (config == null) {
173
+ return config
174
+ }
175
+ return Object.defineProperties(Object.create(Object.getPrototypeOf(config)), Object.getOwnPropertyDescriptors(config))
176
+ }
177
+
160
178
  // Ported from PostgreSQL 9.2.4 source code in src/interfaces/libpq/fe-exec.c
161
179
  const escapeIdentifier = function (str) {
162
180
  return '"' + str.replace(/"/g, '""') + '"'
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg",
3
- "version": "8.23.0",
3
+ "version": "8.23.1",
4
4
  "description": "PostgreSQL client - pure javascript & libpq with the same API",
5
5
  "keywords": [
6
6
  "database",
@@ -32,9 +32,9 @@
32
32
  "./lib/*.js": "./lib/*.js"
33
33
  },
34
34
  "dependencies": {
35
- "pg-connection-string": "^2.14.0",
35
+ "pg-connection-string": "^2.14.1",
36
36
  "pg-pool": "^3.14.0",
37
- "pg-protocol": "^1.16.0",
37
+ "pg-protocol": "^1.16.1",
38
38
  "pg-types": "2.2.0",
39
39
  "pgpass": "1.0.5"
40
40
  },
@@ -50,7 +50,7 @@
50
50
  "wrangler": "^3.x"
51
51
  },
52
52
  "optionalDependencies": {
53
- "pg-cloudflare": "^1.4.0"
53
+ "pg-cloudflare": "^1.4.1"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "pg-native": ">=3.0.1"
@@ -72,5 +72,5 @@
72
72
  "engines": {
73
73
  "node": ">= 16.0.0"
74
74
  },
75
- "gitHead": "df274d1ba9ad9d11a8f1079314faeafde7208207"
75
+ "gitHead": "0980cefebe0ae461da8883703be049fe13ca96cf"
76
76
  }
@@ -50,7 +50,7 @@ function parse(str, options = {}) {
50
50
  config.client_encoding = result.searchParams.get('encoding')
51
51
  return config
52
52
  }
53
- const hostname = dummyHost ? '' : result.hostname
53
+ const hostname = (dummyHost ? '' : result.hostname).replace(/^\[(.+)\]$/, '$1')
54
54
  if (!config.host) {
55
55
  // Only set the host if there is no equivalent query param.
56
56
  config.host = decodeURIComponent(hostname)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-connection-string",
3
- "version": "2.14.0",
3
+ "version": "2.14.1",
4
4
  "description": "Functions for dealing with a PostgreSQL connection string",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -37,7 +37,6 @@
37
37
  "@types/pg": "^8.12.0",
38
38
  "chai": "^4.1.1",
39
39
  "coveralls": "^3.0.4",
40
- "istanbul": "^0.4.5",
41
40
  "mocha": "^11.7.5",
42
41
  "nyc": "^15",
43
42
  "tsx": "^4.19.4",
@@ -48,5 +47,5 @@
48
47
  "index.d.ts",
49
48
  "esm"
50
49
  ],
51
- "gitHead": "b617619f9fb6fbd231731823e2732a2927ded4be"
50
+ "gitHead": "0980cefebe0ae461da8883703be049fe13ca96cf"
52
51
  }
@@ -1,6 +1,6 @@
1
1
  export declare class Writer {
2
2
  private size;
3
- private buffer;
3
+ buffer: Buffer;
4
4
  private offset;
5
5
  private headerPosition;
6
6
  constructor(size?: number);
@@ -11,6 +11,10 @@ export declare class Writer {
11
11
  addString(string?: string): Writer;
12
12
  addInt32PrefixedString(string: string): Writer;
13
13
  add(otherBuffer: Buffer): Writer;
14
+ /**
15
+ * Appends an uninitialized block of {@link size} bytes to the buffer and returns its offset.
16
+ */
17
+ reserveUnsafe(size: number): number;
14
18
  private join;
15
19
  flush(code?: number): Buffer;
16
20
  clear(): void;
@@ -17,7 +17,7 @@ class Writer {
17
17
  // https://stackoverflow.com/questions/2269063/buffer-growth-strategy
18
18
  const newSize = oldBuffer.length + (oldBuffer.length >> 1) + size;
19
19
  this.buffer = Buffer.allocUnsafe(newSize);
20
- oldBuffer.copy(this.buffer);
20
+ oldBuffer.copy(this.buffer, 0, 0, this.offset);
21
21
  }
22
22
  }
23
23
  addInt32(num) {
@@ -79,6 +79,15 @@ class Writer {
79
79
  this.offset += otherBuffer.length;
80
80
  return this;
81
81
  }
82
+ /**
83
+ * Appends an uninitialized block of {@link size} bytes to the buffer and returns its offset.
84
+ */
85
+ reserveUnsafe(size) {
86
+ const offset = this.offset;
87
+ this.ensure(size);
88
+ this.offset += size;
89
+ return offset;
90
+ }
82
91
  join(code) {
83
92
  if (code) {
84
93
  this.buffer[this.headerPosition] = code;
@@ -1 +1 @@
1
- {"version":3,"file":"buffer-writer.js","sourceRoot":"","sources":["../src/buffer-writer.ts"],"names":[],"mappings":";AAAA,uFAAuF;;;AAEvF,MAAa,MAAM;IAIjB,YAAoB,OAAO,GAAG;QAAV,SAAI,GAAJ,IAAI,CAAM;QAFtB,WAAM,GAAW,CAAC,CAAA;QAClB,mBAAc,GAAW,CAAC,CAAA;QAEhC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;IAEO,MAAM,CAAC,IAAY;QACzB,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAClD,IAAI,SAAS,GAAG,IAAI,EAAE,CAAC;YACrB,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAA;YAC7B,4CAA4C;YAC5C,qEAAqE;YACrE,MAAM,OAAO,GAAG,SAAS,CAAC,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A;QACf,IAAI,CAAC,cAAc,GAAG,CAAC,CAAA;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3C,OAAO,MAAM,CAAA;IACf,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;QACf,IAAI,CAAC,cAAc,GAAG,CAAC,CAAA;IACzB,CAAC;CACF;AArHD,wBAqHC"}
@@ -59,29 +59,29 @@ const parse = (query) => {
59
59
  }
60
60
  return writer.flush(80 /* code.parse */);
61
61
  };
62
- const paramWriter = new buffer_writer_1.Writer();
63
- const writeValues = function (values, valueMapper) {
64
- for (let i = 0; i < values.length; i++) {
62
+ const writeValues = function (values, valueMapper, formatsOffset) {
63
+ const len = values.length;
64
+ for (let i = 0; i < len; i++) {
65
65
  const mappedVal = valueMapper ? valueMapper(values[i], i) : values[i];
66
+ let formatByte = 0 /* ParamType.STRING */;
66
67
  if (mappedVal == null) {
67
- // add the param type (string) to the writer
68
- writer.addInt16(0 /* ParamType.STRING */);
69
- // write -1 to the param writer to indicate null
70
- paramWriter.addInt32(-1);
68
+ // write -1 to indicate null
69
+ writer.addInt32(-1);
71
70
  }
72
71
  else if (mappedVal instanceof Buffer) {
73
- // add the param type (binary) to the writer
74
- writer.addInt16(1 /* ParamType.BINARY */);
72
+ formatByte = 1 /* ParamType.BINARY */;
75
73
  // add the buffer to the param writer
76
- paramWriter.addInt32(mappedVal.length);
77
- paramWriter.add(mappedVal);
74
+ writer.addInt32(mappedVal.length);
75
+ writer.add(mappedVal);
78
76
  }
79
77
  else {
80
- // add the param type (string) to the writer
81
- writer.addInt16(0 /* ParamType.STRING */);
82
78
  // length prefix + UTF-8 bytes in one pass (Buffer.byteLength computed once)
83
- paramWriter.addInt32PrefixedString(mappedVal);
79
+ writer.addInt32PrefixedString(mappedVal);
84
80
  }
81
+ // beware: `writer` operations can replace `writer.buffer` with a new buffer
82
+ const buf = writer.buffer;
83
+ buf[formatsOffset++] = 0;
84
+ buf[formatsOffset++] = formatByte;
85
85
  }
86
86
  };
87
87
  const bind = (config = {}) => {
@@ -92,17 +92,19 @@ const bind = (config = {}) => {
92
92
  const values = config.values || emptyArray;
93
93
  const len = values.length;
94
94
  writer.addCString(portal).addCString(statement);
95
+ // number of parameter format codes
96
+ writer.addInt16(len);
97
+ // space for those codes, filled by `writeValues`
98
+ const formatsOffset = writer.reserveUnsafe(len * 2);
99
+ // number of parameter values
95
100
  writer.addInt16(len);
96
101
  try {
97
- writeValues(values, config.valueMapper);
102
+ writeValues(values, config.valueMapper, formatsOffset);
98
103
  }
99
104
  catch (err) {
100
105
  writer.clear();
101
- paramWriter.clear();
102
106
  throw err;
103
107
  }
104
- writer.addInt16(len);
105
- writer.add(paramWriter.flush());
106
108
  // all results use the same format code
107
109
  writer.addInt16(1);
108
110
  // format code
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.js","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":";;;AAAA,mDAAwC;AAkBxC,MAAM,MAAM,GAAG,IAAI,sBAAM,EAAE,CAAA;AAE3B,MAAM,OAAO,GAAG,CAAC,IAA4B,EAAU,EAAE;IACvD,mBAAmB;IACnB,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC9B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IAC9C,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;IAEvD,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAA;IAChD,sCAAsC;IAEtC,MAAM,MAAM,GAAG,U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AM,UAAU,GAAG,cAAc,oBAAW,CAAA;AAC5C,MAAM,SAAS,GAAG,cAAc,mBAAU,CAAA;AAC1C,MAAM,cAAc,GAAG,cAAc,wBAAe,CAAA;AAEpD,MAAM,SAAS,GAAG;IAChB,OAAO;IACP,QAAQ;IACR,UAAU;IACV,8BAA8B;IAC9B,2BAA2B;IAC3B,KAAK;IACL,KAAK;IACL,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,KAAK;IACL,KAAK,EAAE,GAAG,EAAE,CAAC,WAAW;IACxB,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU;IACtB,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS;IACpB,QAAQ;IACR,QAAQ,EAAE,GAAG,EAAE,CAAC,cAAc;IAC9B,QAAQ;IACR,MAAM;CACP,CAAA;AAEQ,8BAAS"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-protocol",
3
- "version": "1.16.0",
3
+ "version": "1.16.1",
4
4
  "description": "The postgres client/server binary protocol, implemented in TypeScript",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -40,5 +40,5 @@
40
40
  "/src",
41
41
  "/esm"
42
42
  ],
43
- "gitHead": "df274d1ba9ad9d11a8f1079314faeafde7208207"
43
+ "gitHead": "0980cefebe0ae461da8883703be049fe13ca96cf"
44
44
  }
@@ -1,7 +1,7 @@
1
1
  //binary data writer tuned for encoding binary specific to the postgres binary protocol
2
2
 
3
3
  export class Writer {
4
- private buffer: Buffer
4
+ public buffer: Buffer
5
5
  private offset: number = 5
6
6
  private headerPosition: number = 0
7
7
  constructor(private size = 256) {
@@ -16,7 +16,7 @@ export class Writer {
16
16
  // https://stackoverflow.com/questions/2269063/buffer-growth-strategy
17
17
  const newSize = oldBuffer.length + (oldBuffer.length >> 1) + size
18
18
  this.buffer = Buffer.allocUnsafe(newSize)
19
- oldBuffer.copy(this.buffer)
19
+ oldBuffer.copy(this.buffer, 0, 0, this.offset)
20
20
  }
21
21
  }
22
22
 
@@ -85,6 +85,16 @@ export class Writer {
85
85
  return this
86
86
  }
87
87
 
88
+ /**
89
+ * Appends an uninitialized block of {@link size} bytes to the buffer and returns its offset.
90
+ */
91
+ public reserveUnsafe(size: number): number {
92
+ const offset = this.offset
93
+ this.ensure(size)
94
+ this.offset += size
95
+ return offset
96
+ }
97
+
88
98
  private join(code?: number): Buffer {
89
99
  if (code) {
90
100
  this.buffer[this.headerPosition] = code
@@ -110,34 +110,36 @@ type BindOpts = {
110
110
  valueMapper?: ValueMapper
111
111
  }
112
112
 
113
- const paramWriter = new Writer()
114
-
115
113
  // make this a const enum so typescript will inline the value
116
114
  const enum ParamType {
117
115
  STRING = 0,
118
116
  BINARY = 1,
119
117
  }
120
118
 
121
- const writeValues = function (values: any[], valueMapper?: ValueMapper): void {
122
- for (let i = 0; i < values.length; i++) {
119
+ const writeValues = function (values: any[], valueMapper: ValueMapper | undefined, formatsOffset: number): void {
120
+ const len = values.length
121
+ for (let i = 0; i < len; i++) {
123
122
  const mappedVal = valueMapper ? valueMapper(values[i], i) : values[i]
123
+ let formatByte = ParamType.STRING
124
+
124
125
  if (mappedVal == null) {
125
- // add the param type (string) to the writer
126
- writer.addInt16(ParamType.STRING)
127
- // write -1 to the param writer to indicate null
128
- paramWriter.addInt32(-1)
126
+ // write -1 to indicate null
127
+ writer.addInt32(-1)
129
128
  } else if (mappedVal instanceof Buffer) {
130
- // add the param type (binary) to the writer
131
- writer.addInt16(ParamType.BINARY)
129
+ formatByte = ParamType.BINARY
130
+
132
131
  // add the buffer to the param writer
133
- paramWriter.addInt32(mappedVal.length)
134
- paramWriter.add(mappedVal)
132
+ writer.addInt32(mappedVal.length)
133
+ writer.add(mappedVal)
135
134
  } else {
136
- // add the param type (string) to the writer
137
- writer.addInt16(ParamType.STRING)
138
135
  // length prefix + UTF-8 bytes in one pass (Buffer.byteLength computed once)
139
- paramWriter.addInt32PrefixedString(mappedVal)
136
+ writer.addInt32PrefixedString(mappedVal)
140
137
  }
138
+
139
+ // beware: `writer` operations can replace `writer.buffer` with a new buffer
140
+ const buf = writer.buffer
141
+ buf[formatsOffset++] = 0
142
+ buf[formatsOffset++] = formatByte
141
143
  }
142
144
  }
143
145
 
@@ -150,19 +152,23 @@ const bind = (config: BindOpts = {}): Buffer => {
150
152
  const len = values.length
151
153
 
152
154
  writer.addCString(portal).addCString(statement)
155
+
156
+ // number of parameter format codes
157
+ writer.addInt16(len)
158
+
159
+ // space for those codes, filled by `writeValues`
160
+ const formatsOffset = writer.reserveUnsafe(len * 2)
161
+
162
+ // number of parameter values
153
163
  writer.addInt16(len)
154
164
 
155
165
  try {
156
- writeValues(values, config.valueMapper)
166
+ writeValues(values, config.valueMapper, formatsOffset)
157
167
  } catch (err) {
158
168
  writer.clear()
159
- paramWriter.clear()
160
169
  throw err
161
170
  }
162
171
 
163
- writer.addInt16(len)
164
- writer.add(paramWriter.flush())
165
-
166
172
  // all results use the same format code
167
173
  writer.addInt16(1)
168
174
  // format code
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withbuddi/buddi",
3
- "version": "0.1.0-pre.25",
3
+ "version": "0.1.0-pre.26",
4
4
  "type": "module",
5
5
  "description": "Your personal agents, on your computer",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "buddi": "packages/install/dist/launcher.js"
18
18
  },
19
19
  "buddi": {
20
- "notes": "### Fixed\n\n- Right after a device-code sign-in, a connection could briefly read \"done\" beside \"not signed in\", because the page read the connection before the sign-in landed and its state after. The state is now taken first, and a stale read no longer overwrites a fresher cached connection.\n- A connection's idle clock started when a request began, so a slow first start or a long call could be stopped under itself. It now starts only when the last request ends.\n- Once a connection was given to agents there was no way to change who holds it. Its sheet now has Change beside \"Held by\": tick an agent to give it the tools, untick one to take them away, in one save.\n- The floating Buddi button covered the footer of sheets and dialogs. It steps aside while one is open.\n- A catalog service could be connected only once from the page. Its sheet now offers \"Add another account\" through the same sign-in, and rows with the same name show their name in buddi.\n- The approval on the canvas repeated the raw tool name three times, shouted its state, and wedged its buttons under it. It now reads like the dock: the action in words, a status pill and the expiry in a short head, the preview as its body, and the decision on the right with Approve last; the raw tool name is in the envelope's details.\n- The approval card for a connected service's tool showed its arguments as raw, cut-off JSON. It now says what the call does and where, then one short line per argument; the exact arguments stay on the envelope beside it.\n- A question that needed a link to answer (a sign-in page, an approval code) could reach the owner without the link, which sat in a tool result they never see. Agents are now told to put the link and the code in the question itself, and the question card makes https links clickable.\n- Agents on Claude Sonnet 5.5, Opus 5.5 and other current Claude models failed every run with \"provider rejected the request as invalid\", because thinking was still asked for with a token budget. buddi now sends adaptive thinking to Claude 4.6 and later, `between_tools` to turn it off on Sonnet 5.5, and nothing on models where it cannot be turned off.\n- A model account could not be removed while an agent that had since been deleted was still recorded against it. A deleted agent no longer counts as using an account, the account list stops counting it, and removing the account clears what it left behind.\n- Restoring a backup into a packaged install failed on the mail tables (a thread points at its last message, a message at its thread) because an ordinary database role cannot switch off foreign-key checks and no table order satisfies a cycle. The restore now holds those keys off during the load and adds them back before the commit, which re-checks every row.\n- The extension knocks on buddi's HTTP side before each reconnect and opens the socket only when something answers, so a buddi that is off or restarting no longer fills chrome://extensions' error list with refused connections.\n- Listing the models of an OpenAI-compatible account asked every model Ollama's capability question, which on mlxh made its manager load a worker for each one, image models and the largest included. Only a host that answers as Ollama is asked now.\n- Test connection gives an account on this computer two minutes instead of fifteen seconds, since a local model loads on its first request.\n- When a model's provider refuses a call because of the account (\"Third-party apps now draw from your extra usage…\"), the chat shows that sentence and points at Settings → Model accounts, instead of a generic line about the connection or a wrong one about the .env.\n- Giving a connection's tools to an agent failed with \"matches no registered tool\" whenever a chat or a run had happened between buddi starting and the review being kept, and worked again after a restart: the tools were being registered into that run's own copy of the registry. They now go to buddi's own registry, and every run started afterwards gets them.\n- Adding a service that was already added and never reviewed reuses that connection instead of making a second one.\n- The page a service sends you back to after a sign-in (`/connections/callback`) was blank: the dashboard's files are addressed relatively and the browser looked for them under `/connections/`. It now finishes the sign-in and closes itself as meant.\n\n### Added\n\n- Connections can be a program on this computer: **A program on this computer** in Settings → Connections (name, command, arguments, environment variables with a Secret switch) and `buddi connections add <name> [--env K=V]... [--secret K]... -- <command> <args…>`. Secret variables are kept in the vault; the review is the program's first run, shows its command line in full, and a changed command, arguments or variable name asks for another review. buddi starts it as you in its own process group with only the named variables, stops it after ten idle minutes and on shutdown, and keeps its last stderr lines on the row when it fails. The paste box and `--json` also read a `command` entry and a `claude mcp add … -- <command>` line.\n- The installed app claims links to its own address (`handle_links: preferred`) and reuses its open window (`launch_handler: navigate-existing`), so \"Open buddi\" in the extension and any buddi link land in the app once Chrome's \"Open supported links\" is on for it.\n- Each release attaches `buddi-extension-<version>.zip`, the Chrome Web Store upload of the extension (the unpacked folder in the tarball is unchanged), and the dashboard is ready to recognise the store's extension id once the listing exists.\n- mlxh, local MLX models on a Mac, as a model account: Settings → Model accounts has a **mlxh, local MLX models on this Mac** choice (address filled in, no key, the model list next), and first run's \"On this computer\" card finds mlxh beside Ollama and starts on its first language model. `GET /api/onboarding/mlxh` says whether mlxh answers here and what it serves.\n- An mlxh account's context window follows mlxh's `max_prompt_tokens` when the server reports it, else its 8,192 default, and Settings says how to raise it; image models on mlxh are flagged in the model list as belonging to the Image plugin.\n- First run's \"What should I take on for you?\": tick My days, My mail, My money, Voice, My code or Pictures, and buddi fetches their plugins from withbuddi.com and installs them in the background while you answer the next chapters. It approves on your behalf only plugins made by buddi whose download matches the hash withbuddi.com lists; anything else waits on its card in Settings → Plugins, and every install shows there with its hash as usual. `POST`/`GET /api/onboarding/take-on`.\n- GitHub connects with a code instead of a token: Settings → Connections and `buddi connections add github` show a code and open github.com/login/device, you type it and say yes, and buddi signs in with its own GitHub app (the OAuth device flow). Token and Client id stay available; `--token` still forces the token.\n- `buddi connections list|add|review|give|remove` connects an MCP service from the terminal, through the running buddi and the same four steps as Settings → Connections; a sign-in on the service's page lands in any dashboard session, once, within ten minutes.\n- A plugin that ships a settings tab has a Settings action on its row (in place of Open when it has no page of its own), in its ⋯ menu and in its detail sheet, so setting one up after an install is one click.\n- Connections sign in with a token: paste one on the sign-in screen and buddi tries it on the server before it keeps it, as one of your secrets sent only to that server's host. GitHub opens on Token, with a link to the page where you make one.\n- \"I have a config\" on Settings → Connections reads the `mcpServers` block another MCP client uses: it fills the address and name, and a header becomes the token. A local `command` and SSE-only servers are refused with a sentence.\n\n### Changed\n\n…"
20
+ "notes": "### Added\n\n- A message an agent sent you (`owner.notify`) opens on the canvas as the message itself, with where it went as a status (sent, held, in a summary, refused) and the call's details folded; its chat row says where it went.\n- The front desk holds `owner.notify` without a line in its file, the way every agent reads the time, so an installation whose Buddi file predates the tool can still be asked to \"send me that on my phone\". Other agents get it on their Tools tab.\n- Agents can message you themselves with the new `owner.notify` tool: asked \"send me a message on Telegram now\", an agent sends it and says truthfully where it went. It is shown as \"@agent: title\" in plain text, follows your notification routing (and skips the dashboard hold when you asked in the conversation), and is limited to 6 urgent messages an hour and 20 a day per agent. Settings → Notifications has a \"Messages from your agents\" section (on or off, the highest urgency, a mute per agent), and each agent's Tools tab has its mute. The front desk, your first assistant and the starter agents have it.\n- An agent's Setup → Tools now lists every connection with a switch for whether this agent holds it, saved as you flip it. A connection that needs review or a sign-in is shown with why and a link to Connections; the connection sheet's \"Held by\" shows the same.\n\n### Fixed\n\n- On Telegram, an agent's signature (\"@buddi: …\") was turned into a link to whoever owns that public username. It still reads the same, but is no longer a mention.\n- A forgotten tab, an unpaired Chrome extension or any poller with no sign-in could lock the owner out of the dashboard: every refused request counted as a failed sign-in, and all tailnet and SSH-tunnel traffic shares one address. Now only a request that presents a credential counts, and the same stale cookie counts once however often it is sent; guessing still locks the address.\n- The installed app showed the browser's error page when buddi answered with an empty \"too many requests\" or a server error. It now shows its own offline page for those too.\n- After a restore, the recovery checklist listed every working model account as a key to paste again, because it looked for the account's key under its own name while buddi keeps it as an owner secret. It now asks the way buddi reads the key, so only what is really missing is listed, in words (\"Gemini — API key\"). Each item has a Fix that opens that account, the Telegram setting, Keys and secrets, or the plugin's install, and the checklist reads itself again when you come back to it.\n\n### Changed\n\n- Telegram has its own page in Settings, beside Notifications: it is where you talk to buddi, not only how it reaches you. Notifications links to it while Telegram is not set up, and the recovery checklist's Telegram fix opens it.\n- An agent's connection tools that ask first are one folded group per connection, with how many ask and which are remembered in its summary; tools that delete or destroy are named once at the bottom instead of a disabled row and a sentence each.\n- An agent's Setup is four tabs instead of three: Identity, Brain, Tools (roles, tools and connections) and Team (who it may ask). The built-in context moved to Brain, and old links to Access open Tools.\n- The agents reference documents `{{today}}`, the one placeholder a persona can use.\n- Mailboxes now exist only as accounts added in Settings → Email; `GMAIL_USER` and `GMAIL_APP_PASSWORD` in `.env` are no longer read. On the first start after upgrading, a mailbox `.env` named is adopted once as a Settings → Email account, keeping its mail, its sync position and its triage (nothing is read or triaged again), and its password moves to that account's own secret; the log says the `GMAIL_*` lines can be deleted. If its password cannot be read, nothing is created and the log says to add the mailbox in Settings → Email, where adding it keeps its mail. `buddi doctor` warns while those lines are still in `.env`, and the start-up summary says how many mailboxes are configured.\n- `buddi doctor` finds a mailbox's password among the owner's secrets, where buddi keeps it, instead of reporting it missing."
21
21
  },
22
22
  "files": [
23
23
  "packages",