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

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 (480) 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 +36 -9
  6. package/node_modules/@buddi/cli/dist/doctor-probes.js.map +1 -1
  7. package/node_modules/@buddi/cli/dist/doctor.d.ts +23 -1
  8. package/node_modules/@buddi/cli/dist/doctor.d.ts.map +1 -1
  9. package/node_modules/@buddi/cli/dist/doctor.js +37 -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/backup/index.d.ts +1 -0
  17. package/node_modules/@buddi/core/dist/backup/index.d.ts.map +1 -1
  18. package/node_modules/@buddi/core/dist/backup/index.js +1 -0
  19. package/node_modules/@buddi/core/dist/backup/index.js.map +1 -1
  20. package/node_modules/@buddi/core/dist/backup/load.d.ts +18 -0
  21. package/node_modules/@buddi/core/dist/backup/load.d.ts.map +1 -1
  22. package/node_modules/@buddi/core/dist/backup/load.js +3 -2
  23. package/node_modules/@buddi/core/dist/backup/load.js.map +1 -1
  24. package/node_modules/@buddi/core/dist/backup/pending.d.ts +101 -0
  25. package/node_modules/@buddi/core/dist/backup/pending.d.ts.map +1 -0
  26. package/node_modules/@buddi/core/dist/backup/pending.js +340 -0
  27. package/node_modules/@buddi/core/dist/backup/pending.js.map +1 -0
  28. package/node_modules/@buddi/core/dist/backup/restore.d.ts.map +1 -1
  29. package/node_modules/@buddi/core/dist/backup/restore.js +54 -1
  30. package/node_modules/@buddi/core/dist/backup/restore.js.map +1 -1
  31. package/node_modules/@buddi/core/dist/home.d.ts +24 -0
  32. package/node_modules/@buddi/core/dist/home.d.ts.map +1 -1
  33. package/node_modules/@buddi/core/dist/home.js +3 -0
  34. package/node_modules/@buddi/core/dist/home.js.map +1 -1
  35. package/node_modules/@buddi/core/dist/notifications/agent.d.ts +54 -0
  36. package/node_modules/@buddi/core/dist/notifications/agent.d.ts.map +1 -0
  37. package/node_modules/@buddi/core/dist/notifications/agent.js +134 -0
  38. package/node_modules/@buddi/core/dist/notifications/agent.js.map +1 -0
  39. package/node_modules/@buddi/core/dist/notifications/index.d.ts +1 -0
  40. package/node_modules/@buddi/core/dist/notifications/index.d.ts.map +1 -1
  41. package/node_modules/@buddi/core/dist/notifications/index.js +1 -0
  42. package/node_modules/@buddi/core/dist/notifications/index.js.map +1 -1
  43. package/node_modules/@buddi/core/dist/notifications/notify.d.ts +4 -0
  44. package/node_modules/@buddi/core/dist/notifications/notify.d.ts.map +1 -1
  45. package/node_modules/@buddi/core/dist/notifications/notify.js +19 -7
  46. package/node_modules/@buddi/core/dist/notifications/notify.js.map +1 -1
  47. package/node_modules/@buddi/core/dist/notifications/store.d.ts +8 -1
  48. package/node_modules/@buddi/core/dist/notifications/store.d.ts.map +1 -1
  49. package/node_modules/@buddi/core/dist/notifications/store.js +55 -6
  50. package/node_modules/@buddi/core/dist/notifications/store.js.map +1 -1
  51. package/node_modules/@buddi/core/dist/notifications/types.d.ts +26 -2
  52. package/node_modules/@buddi/core/dist/notifications/types.d.ts.map +1 -1
  53. package/node_modules/@buddi/core/dist/notifications/types.js +1 -1
  54. package/node_modules/@buddi/core/dist/notifications/types.js.map +1 -1
  55. package/node_modules/@buddi/core/dist/plugin/index.d.ts +2 -2
  56. package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
  57. package/node_modules/@buddi/core/dist/plugin/index.js +1 -1
  58. package/node_modules/@buddi/core/dist/plugin/index.js.map +1 -1
  59. package/node_modules/@buddi/core/dist/postgres/binaries.d.ts +3 -1
  60. package/node_modules/@buddi/core/dist/postgres/binaries.d.ts.map +1 -1
  61. package/node_modules/@buddi/core/dist/postgres/binaries.js +15 -23
  62. package/node_modules/@buddi/core/dist/postgres/binaries.js.map +1 -1
  63. package/node_modules/@buddi/core/dist/postgres/cluster.js +1 -1
  64. package/node_modules/@buddi/core/dist/postgres/cluster.js.map +1 -1
  65. package/node_modules/@buddi/core/dist/postgres/index.d.ts +1 -0
  66. package/node_modules/@buddi/core/dist/postgres/index.d.ts.map +1 -1
  67. package/node_modules/@buddi/core/dist/postgres/index.js +1 -0
  68. package/node_modules/@buddi/core/dist/postgres/index.js.map +1 -1
  69. package/node_modules/@buddi/core/dist/postgres/links.d.ts +15 -0
  70. package/node_modules/@buddi/core/dist/postgres/links.d.ts.map +1 -0
  71. package/node_modules/@buddi/core/dist/postgres/links.js +98 -0
  72. package/node_modules/@buddi/core/dist/postgres/links.js.map +1 -0
  73. package/node_modules/@buddi/core/dist/vault/resolve.d.ts.map +1 -1
  74. package/node_modules/@buddi/core/dist/vault/resolve.js +0 -1
  75. package/node_modules/@buddi/core/dist/vault/resolve.js.map +1 -1
  76. package/node_modules/@buddi/core/migrations/054_agent_messages.sql +15 -0
  77. package/node_modules/@buddi/core/migrations/055_pending_plugin_data.sql +24 -0
  78. package/node_modules/@buddi/core/package.json +4 -0
  79. package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
  80. package/node_modules/@buddi/gateway/dist/agents/owner-tools.d.ts +34 -1
  81. package/node_modules/@buddi/gateway/dist/agents/owner-tools.d.ts.map +1 -1
  82. package/node_modules/@buddi/gateway/dist/agents/owner-tools.js +87 -4
  83. package/node_modules/@buddi/gateway/dist/agents/owner-tools.js.map +1 -1
  84. package/node_modules/@buddi/gateway/dist/bootstrap.js +3 -3
  85. package/node_modules/@buddi/gateway/dist/bootstrap.js.map +1 -1
  86. package/node_modules/@buddi/gateway/dist/owner-secrets.d.ts +77 -8
  87. package/node_modules/@buddi/gateway/dist/owner-secrets.d.ts.map +1 -1
  88. package/node_modules/@buddi/gateway/dist/owner-secrets.js +142 -14
  89. package/node_modules/@buddi/gateway/dist/owner-secrets.js.map +1 -1
  90. package/node_modules/@buddi/gateway/dist/plugins/approve.d.ts.map +1 -1
  91. package/node_modules/@buddi/gateway/dist/plugins/approve.js +9 -1
  92. package/node_modules/@buddi/gateway/dist/plugins/approve.js.map +1 -1
  93. package/node_modules/@buddi/gateway/dist/plugins/migrate.d.ts.map +1 -1
  94. package/node_modules/@buddi/gateway/dist/plugins/migrate.js +11 -1
  95. package/node_modules/@buddi/gateway/dist/plugins/migrate.js.map +1 -1
  96. package/node_modules/@buddi/gateway/dist/serve.d.ts.map +1 -1
  97. package/node_modules/@buddi/gateway/dist/serve.js +24 -8
  98. package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
  99. package/node_modules/@buddi/gateway/dist/system-context.d.ts +2 -0
  100. package/node_modules/@buddi/gateway/dist/system-context.d.ts.map +1 -1
  101. package/node_modules/@buddi/gateway/dist/system-context.js +5 -1
  102. package/node_modules/@buddi/gateway/dist/system-context.js.map +1 -1
  103. package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts +7 -0
  104. package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts.map +1 -1
  105. package/node_modules/@buddi/gateway/dist/telegram/channel.js +14 -2
  106. package/node_modules/@buddi/gateway/dist/telegram/channel.js.map +1 -1
  107. package/node_modules/@buddi/gateway/dist/telegram/main.d.ts.map +1 -1
  108. package/node_modules/@buddi/gateway/dist/telegram/main.js +2 -0
  109. package/node_modules/@buddi/gateway/dist/telegram/main.js.map +1 -1
  110. package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts +26 -1
  111. package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts.map +1 -1
  112. package/node_modules/@buddi/gateway/dist/telegram/surface.js +106 -3
  113. package/node_modules/@buddi/gateway/dist/telegram/surface.js.map +1 -1
  114. package/node_modules/@buddi/gateway/dist/web/agents.d.ts +4 -0
  115. package/node_modules/@buddi/gateway/dist/web/agents.d.ts.map +1 -1
  116. package/node_modules/@buddi/gateway/dist/web/agents.js +12 -0
  117. package/node_modules/@buddi/gateway/dist/web/agents.js.map +1 -1
  118. package/node_modules/@buddi/gateway/dist/web/connections.d.ts +3 -0
  119. package/node_modules/@buddi/gateway/dist/web/connections.d.ts.map +1 -1
  120. package/node_modules/@buddi/gateway/dist/web/connections.js +48 -6
  121. package/node_modules/@buddi/gateway/dist/web/connections.js.map +1 -1
  122. package/node_modules/@buddi/gateway/dist/web/notifications.d.ts +6 -0
  123. package/node_modules/@buddi/gateway/dist/web/notifications.d.ts.map +1 -1
  124. package/node_modules/@buddi/gateway/dist/web/notifications.js +14 -1
  125. package/node_modules/@buddi/gateway/dist/web/notifications.js.map +1 -1
  126. package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts.map +1 -1
  127. package/node_modules/@buddi/gateway/dist/web/onboarding.js +5 -2
  128. package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
  129. package/node_modules/@buddi/gateway/dist/web/read.d.ts +17 -0
  130. package/node_modules/@buddi/gateway/dist/web/read.d.ts.map +1 -1
  131. package/node_modules/@buddi/gateway/dist/web/read.js +36 -1
  132. package/node_modules/@buddi/gateway/dist/web/read.js.map +1 -1
  133. package/node_modules/@buddi/gateway/dist/web/recovery.d.ts +31 -0
  134. package/node_modules/@buddi/gateway/dist/web/recovery.d.ts.map +1 -1
  135. package/node_modules/@buddi/gateway/dist/web/recovery.js +179 -43
  136. package/node_modules/@buddi/gateway/dist/web/recovery.js.map +1 -1
  137. package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
  138. package/node_modules/@buddi/gateway/dist/web/server.js +16 -5
  139. package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
  140. package/node_modules/@buddi/gateway/dist/web/sessions.d.ts +8 -0
  141. package/node_modules/@buddi/gateway/dist/web/sessions.d.ts.map +1 -1
  142. package/node_modules/@buddi/gateway/dist/web/sessions.js +24 -1
  143. package/node_modules/@buddi/gateway/dist/web/sessions.js.map +1 -1
  144. package/node_modules/@buddi/gateway/src/agents/starter/keeper/agent.md +2 -2
  145. package/node_modules/@buddi/gateway/src/agents/starter/planner/agent.md +1 -1
  146. package/node_modules/@buddi/gateway/src/agents/starter/scout/agent.md +1 -1
  147. package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
  148. package/node_modules/@buddi/install/dist/postgres-check.d.ts +18 -0
  149. package/node_modules/@buddi/install/dist/postgres-check.d.ts.map +1 -0
  150. package/node_modules/@buddi/install/dist/postgres-check.js +66 -0
  151. package/node_modules/@buddi/install/dist/postgres-check.js.map +1 -0
  152. package/node_modules/@buddi/install/dist/upgrade.d.ts +3 -0
  153. package/node_modules/@buddi/install/dist/upgrade.d.ts.map +1 -1
  154. package/node_modules/@buddi/install/dist/upgrade.js +30 -0
  155. package/node_modules/@buddi/install/dist/upgrade.js.map +1 -1
  156. package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
  157. package/node_modules/@buddi/runtime/dist/delegate.js +1 -1
  158. package/node_modules/@buddi/runtime/dist/delegate.js.map +1 -1
  159. package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
  160. package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
  161. package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
  162. package/node_modules/@buddi/tool-email/dist/config.d.ts +13 -9
  163. package/node_modules/@buddi/tool-email/dist/config.d.ts.map +1 -1
  164. package/node_modules/@buddi/tool-email/dist/config.js +33 -40
  165. package/node_modules/@buddi/tool-email/dist/config.js.map +1 -1
  166. package/node_modules/@buddi/tool-email/dist/index.d.ts +1 -1
  167. package/node_modules/@buddi/tool-email/dist/index.d.ts.map +1 -1
  168. package/node_modules/@buddi/tool-email/dist/index.js +1 -1
  169. package/node_modules/@buddi/tool-email/dist/index.js.map +1 -1
  170. package/node_modules/@buddi/tool-email/dist/pages/accounts.d.ts +1 -2
  171. package/node_modules/@buddi/tool-email/dist/pages/accounts.d.ts.map +1 -1
  172. package/node_modules/@buddi/tool-email/dist/pages/accounts.js +42 -18
  173. package/node_modules/@buddi/tool-email/dist/pages/accounts.js.map +1 -1
  174. package/node_modules/@buddi/tool-email/dist/pages/queries.d.ts.map +1 -1
  175. package/node_modules/@buddi/tool-email/dist/pages/queries.js +7 -5
  176. package/node_modules/@buddi/tool-email/dist/pages/queries.js.map +1 -1
  177. package/node_modules/@buddi/tool-email/dist/ports.d.ts +5 -1
  178. package/node_modules/@buddi/tool-email/dist/ports.d.ts.map +1 -1
  179. package/node_modules/@buddi/tool-email/dist/tools/shared.js +1 -1
  180. package/node_modules/@buddi/tool-email/dist/tools/shared.js.map +1 -1
  181. package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
  182. package/node_modules/@buddi/tool-mcp/dist/.tsbuildinfo +1 -1
  183. package/node_modules/@buddi/tool-memory/dist/.tsbuildinfo +1 -1
  184. package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
  185. package/node_modules/@buddi/tool-web/dist/providers/index.d.ts +1 -2
  186. package/node_modules/@buddi/tool-web/dist/providers/index.d.ts.map +1 -1
  187. package/node_modules/@buddi/tool-web/dist/providers/index.js +1 -2
  188. package/node_modules/@buddi/tool-web/dist/providers/index.js.map +1 -1
  189. package/node_modules/hono/dist/cjs/jsx/utils.js +1 -1
  190. package/node_modules/hono/dist/cjs/middleware/combine/index.js +3 -1
  191. package/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -2
  192. package/node_modules/hono/dist/jsx/utils.js +1 -1
  193. package/node_modules/hono/dist/middleware/combine/index.js +3 -1
  194. package/node_modules/hono/dist/middleware/etag/index.js +2 -2
  195. package/node_modules/hono/dist/middleware/language/language.js +1 -1
  196. package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +2 -1
  197. package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +2 -1
  198. package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +2 -1
  199. package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +2 -1
  200. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +2 -1
  201. package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +2 -1
  202. package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +2 -1
  203. package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +2 -1
  204. package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +2 -1
  205. package/node_modules/hono/dist/types/client/types.d.ts +2 -1
  206. package/node_modules/hono/dist/types/context.d.ts +2 -1
  207. package/node_modules/hono/dist/types/helper/cookie/index.d.ts +2 -1
  208. package/node_modules/hono/dist/types/helper/css/common.d.ts +2 -1
  209. package/node_modules/hono/dist/types/helper/css/index.d.ts +2 -1
  210. package/node_modules/hono/dist/types/helper/dev/index.d.ts +2 -1
  211. package/node_modules/hono/dist/types/helper/factory/index.d.ts +2 -1
  212. package/node_modules/hono/dist/types/helper/proxy/index.d.ts +2 -1
  213. package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +2 -1
  214. package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +2 -1
  215. package/node_modules/hono/dist/types/helper/testing/index.d.ts +2 -1
  216. package/node_modules/hono/dist/types/hono-base.d.ts +2 -1
  217. package/node_modules/hono/dist/types/http-exception.d.ts +2 -1
  218. package/node_modules/hono/dist/types/jsx/base.d.ts +4 -3
  219. package/node_modules/hono/dist/types/jsx/context.d.ts +2 -1
  220. package/node_modules/hono/dist/types/jsx/dom/client.d.ts +2 -1
  221. package/node_modules/hono/dist/types/jsx/dom/css.d.ts +2 -1
  222. package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +2 -1
  223. package/node_modules/hono/dist/types/jsx/dom/index.d.ts +2 -1
  224. package/node_modules/hono/dist/types/jsx/dom/render.d.ts +2 -1
  225. package/node_modules/hono/dist/types/jsx/dom/server.d.ts +2 -1
  226. package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +2 -1
  227. package/node_modules/hono/dist/types/jsx/index.d.ts +2 -1
  228. package/node_modules/hono/dist/types/jsx/types.d.ts +2 -1
  229. package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +2 -1
  230. package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +2 -1
  231. package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +2 -1
  232. package/node_modules/hono/dist/types/middleware/combine/index.d.ts +2 -1
  233. package/node_modules/hono/dist/types/middleware/compress/index.d.ts +2 -1
  234. package/node_modules/hono/dist/types/middleware/cors/index.d.ts +2 -1
  235. package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +2 -1
  236. package/node_modules/hono/dist/types/middleware/etag/index.d.ts +2 -1
  237. package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +2 -1
  238. package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -1
  239. package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +2 -1
  240. package/node_modules/hono/dist/types/middleware/language/index.d.ts +2 -1
  241. package/node_modules/hono/dist/types/middleware/logger/index.d.ts +2 -1
  242. package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +2 -1
  243. package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +2 -1
  244. package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +2 -1
  245. package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +2 -1
  246. package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +2 -1
  247. package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +2 -1
  248. package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +2 -1
  249. package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +2 -1
  250. package/node_modules/hono/dist/types/middleware/timing/index.d.ts +2 -1
  251. package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +2 -1
  252. package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +2 -1
  253. package/node_modules/hono/dist/types/request.d.ts +2 -1
  254. package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +2 -1
  255. package/node_modules/hono/dist/types/types.d.ts +2 -1
  256. package/node_modules/hono/dist/types/utils/body.d.ts +2 -1
  257. package/node_modules/hono/dist/types/utils/buffer.d.ts +2 -1
  258. package/node_modules/hono/dist/types/utils/cookie.d.ts +2 -1
  259. package/node_modules/hono/dist/types/utils/crypto.d.ts +2 -1
  260. package/node_modules/hono/dist/types/utils/filepath.d.ts +2 -1
  261. package/node_modules/hono/dist/types/utils/html.d.ts +2 -1
  262. package/node_modules/hono/dist/types/utils/mime.d.ts +2 -1
  263. package/node_modules/hono/dist/types/utils/types.d.ts +2 -1
  264. package/node_modules/hono/dist/types/utils/url.d.ts +2 -1
  265. package/node_modules/hono/dist/types/validator/utils.d.ts +2 -1
  266. package/node_modules/hono/dist/types/validator/validator.d.ts +2 -1
  267. package/node_modules/hono/package.json +2 -2
  268. package/node_modules/pg/lib/client.js +18 -0
  269. package/node_modules/pg/lib/connection.js +8 -1
  270. package/node_modules/pg/lib/crypto/cert-signatures.js +1 -1
  271. package/node_modules/pg/lib/native/client.js +11 -3
  272. package/node_modules/pg/lib/native/query.js +3 -1
  273. package/node_modules/pg/lib/query.js +5 -1
  274. package/node_modules/pg/lib/utils.js +19 -1
  275. package/node_modules/pg/package.json +5 -5
  276. package/node_modules/pg-connection-string/index.js +1 -1
  277. package/node_modules/pg-connection-string/package.json +2 -3
  278. package/node_modules/pg-protocol/dist/buffer-writer.d.ts +5 -1
  279. package/node_modules/pg-protocol/dist/buffer-writer.js +10 -1
  280. package/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -1
  281. package/node_modules/pg-protocol/dist/serializer.js +20 -18
  282. package/node_modules/pg-protocol/dist/serializer.js.map +1 -1
  283. package/node_modules/pg-protocol/package.json +2 -2
  284. package/node_modules/pg-protocol/src/buffer-writer.ts +12 -2
  285. package/node_modules/pg-protocol/src/serializer.ts +26 -20
  286. package/package.json +2 -2
  287. package/packages/cli/dist/.tsbuildinfo +1 -1
  288. package/packages/cli/dist/doctor-probes.d.ts.map +1 -1
  289. package/packages/cli/dist/doctor-probes.js +36 -9
  290. package/packages/cli/dist/doctor-probes.js.map +1 -1
  291. package/packages/cli/dist/doctor.d.ts +23 -1
  292. package/packages/cli/dist/doctor.d.ts.map +1 -1
  293. package/packages/cli/dist/doctor.js +37 -2
  294. package/packages/cli/dist/doctor.js.map +1 -1
  295. package/packages/core/dist/.tsbuildinfo +1 -1
  296. package/packages/core/dist/agents/catalog.d.ts.map +1 -1
  297. package/packages/core/dist/agents/catalog.js +11 -2
  298. package/packages/core/dist/agents/catalog.js.map +1 -1
  299. package/packages/core/dist/agents/skills.d.ts +4 -4
  300. package/packages/core/dist/backup/index.d.ts +1 -0
  301. package/packages/core/dist/backup/index.d.ts.map +1 -1
  302. package/packages/core/dist/backup/index.js +1 -0
  303. package/packages/core/dist/backup/index.js.map +1 -1
  304. package/packages/core/dist/backup/load.d.ts +18 -0
  305. package/packages/core/dist/backup/load.d.ts.map +1 -1
  306. package/packages/core/dist/backup/load.js +3 -2
  307. package/packages/core/dist/backup/load.js.map +1 -1
  308. package/packages/core/dist/backup/pending.d.ts +101 -0
  309. package/packages/core/dist/backup/pending.d.ts.map +1 -0
  310. package/packages/core/dist/backup/pending.js +340 -0
  311. package/packages/core/dist/backup/pending.js.map +1 -0
  312. package/packages/core/dist/backup/restore.d.ts.map +1 -1
  313. package/packages/core/dist/backup/restore.js +54 -1
  314. package/packages/core/dist/backup/restore.js.map +1 -1
  315. package/packages/core/dist/home.d.ts +24 -0
  316. package/packages/core/dist/home.d.ts.map +1 -1
  317. package/packages/core/dist/home.js +3 -0
  318. package/packages/core/dist/home.js.map +1 -1
  319. package/packages/core/dist/notifications/agent.d.ts +54 -0
  320. package/packages/core/dist/notifications/agent.d.ts.map +1 -0
  321. package/packages/core/dist/notifications/agent.js +134 -0
  322. package/packages/core/dist/notifications/agent.js.map +1 -0
  323. package/packages/core/dist/notifications/index.d.ts +1 -0
  324. package/packages/core/dist/notifications/index.d.ts.map +1 -1
  325. package/packages/core/dist/notifications/index.js +1 -0
  326. package/packages/core/dist/notifications/index.js.map +1 -1
  327. package/packages/core/dist/notifications/notify.d.ts +4 -0
  328. package/packages/core/dist/notifications/notify.d.ts.map +1 -1
  329. package/packages/core/dist/notifications/notify.js +19 -7
  330. package/packages/core/dist/notifications/notify.js.map +1 -1
  331. package/packages/core/dist/notifications/store.d.ts +8 -1
  332. package/packages/core/dist/notifications/store.d.ts.map +1 -1
  333. package/packages/core/dist/notifications/store.js +55 -6
  334. package/packages/core/dist/notifications/store.js.map +1 -1
  335. package/packages/core/dist/notifications/types.d.ts +26 -2
  336. package/packages/core/dist/notifications/types.d.ts.map +1 -1
  337. package/packages/core/dist/notifications/types.js +1 -1
  338. package/packages/core/dist/notifications/types.js.map +1 -1
  339. package/packages/core/dist/plugin/index.d.ts +2 -2
  340. package/packages/core/dist/plugin/index.d.ts.map +1 -1
  341. package/packages/core/dist/plugin/index.js +1 -1
  342. package/packages/core/dist/plugin/index.js.map +1 -1
  343. package/packages/core/dist/postgres/binaries.d.ts +3 -1
  344. package/packages/core/dist/postgres/binaries.d.ts.map +1 -1
  345. package/packages/core/dist/postgres/binaries.js +15 -23
  346. package/packages/core/dist/postgres/binaries.js.map +1 -1
  347. package/packages/core/dist/postgres/cluster.js +1 -1
  348. package/packages/core/dist/postgres/cluster.js.map +1 -1
  349. package/packages/core/dist/postgres/index.d.ts +1 -0
  350. package/packages/core/dist/postgres/index.d.ts.map +1 -1
  351. package/packages/core/dist/postgres/index.js +1 -0
  352. package/packages/core/dist/postgres/index.js.map +1 -1
  353. package/packages/core/dist/postgres/links.d.ts +15 -0
  354. package/packages/core/dist/postgres/links.d.ts.map +1 -0
  355. package/packages/core/dist/postgres/links.js +98 -0
  356. package/packages/core/dist/postgres/links.js.map +1 -0
  357. package/packages/core/dist/vault/resolve.d.ts.map +1 -1
  358. package/packages/core/dist/vault/resolve.js +0 -1
  359. package/packages/core/dist/vault/resolve.js.map +1 -1
  360. package/packages/core/migrations/054_agent_messages.sql +15 -0
  361. package/packages/core/migrations/055_pending_plugin_data.sql +24 -0
  362. package/packages/core/package.json +4 -0
  363. package/packages/gateway/dist/.tsbuildinfo +1 -1
  364. package/packages/gateway/dist/agents/owner-tools.d.ts +34 -1
  365. package/packages/gateway/dist/agents/owner-tools.d.ts.map +1 -1
  366. package/packages/gateway/dist/agents/owner-tools.js +87 -4
  367. package/packages/gateway/dist/agents/owner-tools.js.map +1 -1
  368. package/packages/gateway/dist/bootstrap.js +3 -3
  369. package/packages/gateway/dist/bootstrap.js.map +1 -1
  370. package/packages/gateway/dist/owner-secrets.d.ts +77 -8
  371. package/packages/gateway/dist/owner-secrets.d.ts.map +1 -1
  372. package/packages/gateway/dist/owner-secrets.js +142 -14
  373. package/packages/gateway/dist/owner-secrets.js.map +1 -1
  374. package/packages/gateway/dist/plugins/approve.d.ts.map +1 -1
  375. package/packages/gateway/dist/plugins/approve.js +9 -1
  376. package/packages/gateway/dist/plugins/approve.js.map +1 -1
  377. package/packages/gateway/dist/plugins/migrate.d.ts.map +1 -1
  378. package/packages/gateway/dist/plugins/migrate.js +11 -1
  379. package/packages/gateway/dist/plugins/migrate.js.map +1 -1
  380. package/packages/gateway/dist/serve.d.ts.map +1 -1
  381. package/packages/gateway/dist/serve.js +24 -8
  382. package/packages/gateway/dist/serve.js.map +1 -1
  383. package/packages/gateway/dist/system-context.d.ts +2 -0
  384. package/packages/gateway/dist/system-context.d.ts.map +1 -1
  385. package/packages/gateway/dist/system-context.js +5 -1
  386. package/packages/gateway/dist/system-context.js.map +1 -1
  387. package/packages/gateway/dist/telegram/channel.d.ts +7 -0
  388. package/packages/gateway/dist/telegram/channel.d.ts.map +1 -1
  389. package/packages/gateway/dist/telegram/channel.js +14 -2
  390. package/packages/gateway/dist/telegram/channel.js.map +1 -1
  391. package/packages/gateway/dist/telegram/main.d.ts.map +1 -1
  392. package/packages/gateway/dist/telegram/main.js +2 -0
  393. package/packages/gateway/dist/telegram/main.js.map +1 -1
  394. package/packages/gateway/dist/telegram/surface.d.ts +26 -1
  395. package/packages/gateway/dist/telegram/surface.d.ts.map +1 -1
  396. package/packages/gateway/dist/telegram/surface.js +106 -3
  397. package/packages/gateway/dist/telegram/surface.js.map +1 -1
  398. package/packages/gateway/dist/web/agents.d.ts +4 -0
  399. package/packages/gateway/dist/web/agents.d.ts.map +1 -1
  400. package/packages/gateway/dist/web/agents.js +12 -0
  401. package/packages/gateway/dist/web/agents.js.map +1 -1
  402. package/packages/gateway/dist/web/connections.d.ts +3 -0
  403. package/packages/gateway/dist/web/connections.d.ts.map +1 -1
  404. package/packages/gateway/dist/web/connections.js +48 -6
  405. package/packages/gateway/dist/web/connections.js.map +1 -1
  406. package/packages/gateway/dist/web/notifications.d.ts +6 -0
  407. package/packages/gateway/dist/web/notifications.d.ts.map +1 -1
  408. package/packages/gateway/dist/web/notifications.js +14 -1
  409. package/packages/gateway/dist/web/notifications.js.map +1 -1
  410. package/packages/gateway/dist/web/onboarding.d.ts.map +1 -1
  411. package/packages/gateway/dist/web/onboarding.js +5 -2
  412. package/packages/gateway/dist/web/onboarding.js.map +1 -1
  413. package/packages/gateway/dist/web/read.d.ts +17 -0
  414. package/packages/gateway/dist/web/read.d.ts.map +1 -1
  415. package/packages/gateway/dist/web/read.js +36 -1
  416. package/packages/gateway/dist/web/read.js.map +1 -1
  417. package/packages/gateway/dist/web/recovery.d.ts +31 -0
  418. package/packages/gateway/dist/web/recovery.d.ts.map +1 -1
  419. package/packages/gateway/dist/web/recovery.js +179 -43
  420. package/packages/gateway/dist/web/recovery.js.map +1 -1
  421. package/packages/gateway/dist/web/server.d.ts.map +1 -1
  422. package/packages/gateway/dist/web/server.js +16 -5
  423. package/packages/gateway/dist/web/server.js.map +1 -1
  424. package/packages/gateway/dist/web/sessions.d.ts +8 -0
  425. package/packages/gateway/dist/web/sessions.d.ts.map +1 -1
  426. package/packages/gateway/dist/web/sessions.js +24 -1
  427. package/packages/gateway/dist/web/sessions.js.map +1 -1
  428. package/packages/gateway/src/agents/starter/keeper/agent.md +2 -2
  429. package/packages/gateway/src/agents/starter/planner/agent.md +1 -1
  430. package/packages/gateway/src/agents/starter/scout/agent.md +1 -1
  431. package/packages/install/dist/.tsbuildinfo +1 -1
  432. package/packages/install/dist/postgres-check.d.ts +18 -0
  433. package/packages/install/dist/postgres-check.d.ts.map +1 -0
  434. package/packages/install/dist/postgres-check.js +66 -0
  435. package/packages/install/dist/postgres-check.js.map +1 -0
  436. package/packages/install/dist/upgrade.d.ts +3 -0
  437. package/packages/install/dist/upgrade.d.ts.map +1 -1
  438. package/packages/install/dist/upgrade.js +30 -0
  439. package/packages/install/dist/upgrade.js.map +1 -1
  440. package/packages/runtime/dist/.tsbuildinfo +1 -1
  441. package/packages/runtime/dist/delegate.js +1 -1
  442. package/packages/runtime/dist/delegate.js.map +1 -1
  443. package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
  444. package/packages/tools/browser/dist/.tsbuildinfo +1 -1
  445. package/packages/tools/email/dist/.tsbuildinfo +1 -1
  446. package/packages/tools/email/dist/config.d.ts +13 -9
  447. package/packages/tools/email/dist/config.d.ts.map +1 -1
  448. package/packages/tools/email/dist/config.js +33 -40
  449. package/packages/tools/email/dist/config.js.map +1 -1
  450. package/packages/tools/email/dist/index.d.ts +1 -1
  451. package/packages/tools/email/dist/index.d.ts.map +1 -1
  452. package/packages/tools/email/dist/index.js +1 -1
  453. package/packages/tools/email/dist/index.js.map +1 -1
  454. package/packages/tools/email/dist/pages/accounts.d.ts +1 -2
  455. package/packages/tools/email/dist/pages/accounts.d.ts.map +1 -1
  456. package/packages/tools/email/dist/pages/accounts.js +42 -18
  457. package/packages/tools/email/dist/pages/accounts.js.map +1 -1
  458. package/packages/tools/email/dist/pages/queries.d.ts.map +1 -1
  459. package/packages/tools/email/dist/pages/queries.js +7 -5
  460. package/packages/tools/email/dist/pages/queries.js.map +1 -1
  461. package/packages/tools/email/dist/ports.d.ts +5 -1
  462. package/packages/tools/email/dist/ports.d.ts.map +1 -1
  463. package/packages/tools/email/dist/tools/shared.js +1 -1
  464. package/packages/tools/email/dist/tools/shared.js.map +1 -1
  465. package/packages/tools/host/dist/.tsbuildinfo +1 -1
  466. package/packages/tools/mcp/dist/.tsbuildinfo +1 -1
  467. package/packages/tools/memory/dist/.tsbuildinfo +1 -1
  468. package/packages/tools/web/dist/.tsbuildinfo +1 -1
  469. package/packages/tools/web/dist/providers/index.d.ts +1 -2
  470. package/packages/tools/web/dist/providers/index.d.ts.map +1 -1
  471. package/packages/tools/web/dist/providers/index.js +1 -2
  472. package/packages/tools/web/dist/providers/index.js.map +1 -1
  473. package/packages/web/dist/assets/index-Cn-3X1OI.js +130 -0
  474. package/packages/web/dist/assets/{index-DIXokQ4n.css → index-bdj791NB.css} +1 -1
  475. package/packages/web/dist/assets/{lottie_light-j3HICV9o.js → lottie_light-DmJaDM4A.js} +1 -1
  476. package/packages/web/dist/build.json +1 -1
  477. package/packages/web/dist/index.html +2 -2
  478. package/packages/web/dist/precache.json +4 -4
  479. package/packages/web/dist/sw.js +5 -3
  480. 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,MAAM,GAAG,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,IAAI,CAAA;YACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YACzC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IAEM,QAAQ,CAAC,GAAW;QACzB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACd,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;QAChD,IAAI,CAAC,MAAM,CAAC,IAAI,C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AG,IAAI,CAAC,MAAM,CAAA;QAC1B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACjB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAA;QACnB,OAAO,MAAM,CAAA;IACf,CAAC;IAEO,IAAI,CAAC,IAAa;QACxB,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,IAAI,CAAA;YACvC,oDAAoD;YACpD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,CAAA;YACtD,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,CAAA;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IACrD,CAAC;IAEM,KAAK,CAAC,IAAa;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;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,UAAU,CAAC,MAAM,GAAG,CAAC,CAAA;IAEpC,OAAO,IAAI,sBAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAA;AAC9D,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,GAAW,EAAE;IAC9B,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;IACtC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAC3B,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IAClC,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAED,MAA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AAC,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.27",
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 reply that stops because it used all its steps now offers **Continue**: a button on the \"Turn budget reached\" line under the conversation's latest reply (while nothing is running), and a Continue button under the answer on Telegram. Either sends \"continue\" as you into the same conversation, once, and the agent picks up with the whole history.\n\n### Changed\n\n- The agent's Setup → Brain shows \"Steps per reply\" (was \"Max turns\"), with the built-in default of 40 named when the file sets none, a 10 to 500 range, and a hint that each tool call is a step. It saves through the same path as `buddi agents set --max-turns`.\n- The Developer agent the developer plugin proposes asks for 150 steps per reply instead of the default 40. An agent already installed keeps its file as it is.\n\n- Home opens on a glance: the date, a large greeting and what needs you as one line of counts, each a link to its list (failed jobs, urgent alerts, proposals; approvals and messages scroll to \"Needs you\"). On the right, the Weather plugin's card — now, sky and place, the next twelve hours as a small line, high and low — with the Blob in it; without the plugin the Blob stands there alone. The composer moved under the glance and is one line that grows as you type, with the Continue chips under it. On a phone it stacks.\n- The \"Keep buddi one click away\" card left the top of Home. Home now shows one quiet line at the foot, \"Install buddi as an app, one click from your dock\", only when the browser has offered an install; the owner menu has \"Install the app\" whenever it does, and Settings → System has \"The dashboard as an app\" with the bookmark tip and, on the Mac, `buddi dashboard --install-app`.\n- A plugin's Home glance can carry a card (a figure, one line, a run of numbers drawn as a sparkline, a foot); Home draws the first one on the right of the greeting. The Weather plugin sends one from its next release, and its glance opens the Weather page.\n\n### Fixed\n\n- Restoring a backup before reinstalling its plugins (the normal order on a new machine) skipped those plugins' data, and installing them afterwards gave empty tables. The restore now keeps each missing plugin's data under the data dir and loads it when the plugin is installed (or at the next start), into empty tables only; the recovery checklist says \"finance — 1,544 rows waiting, loaded when you install it\", a table that already had rows stays aside and is listed on its own, and `buddi doctor` shows what is still waiting.\n- An upgrade could leave Postgres unable to start (\"Library not loaded: …libicuuc.77.dylib\"), because npm did not run the Postgres package's script that makes its library links and buddi's own copy pointed back into npm's folder. buddi now makes the missing links itself before every Postgres start and keeps its copy self-contained, and an upgrade first checks that the new version's Postgres starts; if it does not, buddi puts the previous version back, keeps running, and the upgrade result says why.\n- A message an agent sent you repeated its \"@handle:\" at the start of the title on the dashboard, right under the agent's name. Home's Needs you, Settings → Notifications and the toasts now leave the signature off; Telegram keeps it."
21
21
  },
22
22
  "files": [
23
23
  "packages",