gemi 0.111.0 → 0.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/dist/ai/Agent.d.ts +54 -1
  2. package/dist/ai/Agent.d.ts.map +1 -1
  3. package/dist/ai/AgentController.d.ts +41 -0
  4. package/dist/ai/AgentController.d.ts.map +1 -1
  5. package/dist/ai/client/index.d.ts +1 -1
  6. package/dist/ai/client/index.d.ts.map +1 -1
  7. package/dist/ai/contextCompaction.d.ts +247 -0
  8. package/dist/ai/contextCompaction.d.ts.map +1 -0
  9. package/dist/ai/contextWindow.d.ts +18 -0
  10. package/dist/ai/contextWindow.d.ts.map +1 -1
  11. package/dist/ai/index.d.ts +5 -1
  12. package/dist/ai/index.d.ts.map +1 -1
  13. package/dist/ai/index.js +93 -14
  14. package/dist/ai/index.js.map +16 -10
  15. package/dist/ai/jobs/AgentJob.d.ts +259 -0
  16. package/dist/ai/jobs/AgentJob.d.ts.map +1 -0
  17. package/dist/ai/jobs/AgentJobDeadlineSweep.d.ts +18 -0
  18. package/dist/ai/jobs/AgentJobDeadlineSweep.d.ts.map +1 -0
  19. package/dist/ai/jobs/AgentJobStore.d.ts +141 -0
  20. package/dist/ai/jobs/AgentJobStore.d.ts.map +1 -0
  21. package/dist/ai/jobs/DatabaseAgentJobStore.d.ts +82 -0
  22. package/dist/ai/jobs/DatabaseAgentJobStore.d.ts.map +1 -0
  23. package/dist/ai/jobs/contextBlock.d.ts +31 -0
  24. package/dist/ai/jobs/contextBlock.d.ts.map +1 -0
  25. package/dist/ai/jobs/index.d.ts +6 -0
  26. package/dist/ai/jobs/index.d.ts.map +1 -0
  27. package/dist/ai/jobs/overlay.d.ts +49 -0
  28. package/dist/ai/jobs/overlay.d.ts.map +1 -0
  29. package/dist/ai/providers/request.d.ts.map +1 -1
  30. package/dist/ai/store/Attachments.d.ts +6 -0
  31. package/dist/ai/store/Attachments.d.ts.map +1 -1
  32. package/dist/ai/store/MemoryAgentStore.d.ts +3 -0
  33. package/dist/ai/store/MemoryAgentStore.d.ts.map +1 -1
  34. package/dist/ai/types.d.ts +28 -0
  35. package/dist/ai/types.d.ts.map +1 -1
  36. package/dist/app/index.js +1 -1
  37. package/dist/bin/gemi.js +13 -2
  38. package/dist/bin/gemi.js.map +4 -4
  39. package/dist/bun/plugin.js +1 -1
  40. package/dist/bun/preload.js +1 -1
  41. package/dist/{chunk-30xjcyzh.js → chunk-0z2h35d7.js} +2 -2
  42. package/dist/{chunk-30xjcyzh.js.map → chunk-0z2h35d7.js.map} +1 -1
  43. package/dist/{chunk-358sdcx9.js → chunk-15a1mrdv.js} +2 -2
  44. package/dist/{chunk-358sdcx9.js.map → chunk-15a1mrdv.js.map} +1 -1
  45. package/dist/{chunk-hf7a51s3.js → chunk-18c3y8m3.js} +2 -2
  46. package/dist/{chunk-hf7a51s3.js.map → chunk-18c3y8m3.js.map} +1 -1
  47. package/dist/{chunk-tq85n8zh.js → chunk-1pvkw2pq.js} +2 -2
  48. package/dist/{chunk-tq85n8zh.js.map → chunk-1pvkw2pq.js.map} +1 -1
  49. package/dist/{chunk-8afxrmdc.js → chunk-2taa0brj.js} +2 -2
  50. package/dist/{chunk-8afxrmdc.js.map → chunk-2taa0brj.js.map} +1 -1
  51. package/dist/{chunk-5cygrbxv.js → chunk-30yg31sz.js} +2 -2
  52. package/dist/{chunk-5cygrbxv.js.map → chunk-30yg31sz.js.map} +1 -1
  53. package/dist/{chunk-3y8q8x11.js → chunk-3z9vhjd7.js} +2 -2
  54. package/dist/{chunk-3y8q8x11.js.map → chunk-3z9vhjd7.js.map} +1 -1
  55. package/dist/chunk-4sb1484x.js +46 -0
  56. package/dist/{chunk-h3864a8z.js.map → chunk-4sb1484x.js.map} +13 -4
  57. package/dist/{chunk-0sjh5v1n.js → chunk-53bek7sp.js} +1 -1
  58. package/dist/{chunk-xkc7ftnq.js → chunk-57edag57.js} +3 -3
  59. package/dist/{chunk-xkc7ftnq.js.map → chunk-57edag57.js.map} +1 -1
  60. package/dist/{chunk-ddr4qvvt.js → chunk-5az0mq4p.js} +3 -3
  61. package/dist/{chunk-ddr4qvvt.js.map → chunk-5az0mq4p.js.map} +1 -1
  62. package/dist/{chunk-nsvktvp4.js → chunk-5waxjsvv.js} +2 -2
  63. package/dist/{chunk-nsvktvp4.js.map → chunk-5waxjsvv.js.map} +1 -1
  64. package/dist/{chunk-rfcygmf5.js → chunk-6w79zajj.js} +3 -3
  65. package/dist/{chunk-rfcygmf5.js.map → chunk-6w79zajj.js.map} +1 -1
  66. package/dist/{chunk-gb37722w.js → chunk-75ptmewf.js} +3 -3
  67. package/dist/{chunk-gb37722w.js.map → chunk-75ptmewf.js.map} +1 -1
  68. package/dist/{chunk-pyj7cd9t.js → chunk-851k0b26.js} +2 -2
  69. package/dist/{chunk-pyj7cd9t.js.map → chunk-851k0b26.js.map} +1 -1
  70. package/dist/{chunk-m6ystvtk.js → chunk-8reepafh.js} +2 -2
  71. package/dist/{chunk-m6ystvtk.js.map → chunk-8reepafh.js.map} +1 -1
  72. package/dist/{chunk-nvv9wej6.js → chunk-9hr0bcfy.js} +3 -3
  73. package/dist/{chunk-nvv9wej6.js.map → chunk-9hr0bcfy.js.map} +1 -1
  74. package/dist/{chunk-yqavgpwd.js → chunk-a9q2cr4w.js} +2 -2
  75. package/dist/{chunk-yqavgpwd.js.map → chunk-a9q2cr4w.js.map} +1 -1
  76. package/dist/{chunk-cy5qp6mz.js → chunk-amvy4r59.js} +2 -2
  77. package/dist/{chunk-cy5qp6mz.js.map → chunk-amvy4r59.js.map} +1 -1
  78. package/dist/{chunk-twnn7r66.js → chunk-b1mk12xg.js} +2 -2
  79. package/dist/{chunk-twnn7r66.js.map → chunk-b1mk12xg.js.map} +1 -1
  80. package/dist/{chunk-a6453d9s.js → chunk-b7cqwcbm.js} +2 -2
  81. package/dist/{chunk-a6453d9s.js.map → chunk-b7cqwcbm.js.map} +1 -1
  82. package/dist/{chunk-nncz308h.js → chunk-b7qjp7r1.js} +2 -2
  83. package/dist/{chunk-nncz308h.js.map → chunk-b7qjp7r1.js.map} +1 -1
  84. package/dist/chunk-beks65me.js +19 -0
  85. package/dist/{chunk-mb7q7s0a.js.map → chunk-beks65me.js.map} +3 -4
  86. package/dist/chunk-bf1ets45.js +5 -0
  87. package/dist/{chunk-11fsn5mr.js.map → chunk-bf1ets45.js.map} +4 -3
  88. package/dist/{chunk-9rchedr4.js → chunk-bhw7k8vp.js} +2 -2
  89. package/dist/{chunk-9rchedr4.js.map → chunk-bhw7k8vp.js.map} +1 -1
  90. package/dist/{chunk-k1vw22t2.js → chunk-ck0v2kzw.js} +2 -2
  91. package/dist/{chunk-k1vw22t2.js.map → chunk-ck0v2kzw.js.map} +1 -1
  92. package/dist/{chunk-1bkr5wnt.js → chunk-cptzbdn6.js} +2 -2
  93. package/dist/{chunk-1bkr5wnt.js.map → chunk-cptzbdn6.js.map} +1 -1
  94. package/dist/{chunk-6vr7f5fq.js → chunk-csbc1fxa.js} +3 -3
  95. package/dist/{chunk-6vr7f5fq.js.map → chunk-csbc1fxa.js.map} +1 -1
  96. package/dist/{chunk-kf71mjxa.js → chunk-d0trs736.js} +3 -3
  97. package/dist/{chunk-kf71mjxa.js.map → chunk-d0trs736.js.map} +1 -1
  98. package/dist/{chunk-zhs1r1z0.js → chunk-d8ekyng4.js} +3 -3
  99. package/dist/{chunk-zhs1r1z0.js.map → chunk-d8ekyng4.js.map} +1 -1
  100. package/dist/chunk-d9an2nra.js +5 -0
  101. package/dist/{chunk-hn67spz6.js.map → chunk-d9an2nra.js.map} +1 -1
  102. package/dist/{chunk-0d9qsmx2.js → chunk-dan79jab.js} +2 -2
  103. package/dist/{chunk-0d9qsmx2.js.map → chunk-dan79jab.js.map} +1 -1
  104. package/dist/{chunk-1yx2e0bh.js → chunk-ddad3902.js} +2 -2
  105. package/dist/{chunk-1yx2e0bh.js.map → chunk-ddad3902.js.map} +1 -1
  106. package/dist/{chunk-3cg7y62b.js → chunk-dm59ze55.js} +2 -2
  107. package/dist/{chunk-3cg7y62b.js.map → chunk-dm59ze55.js.map} +1 -1
  108. package/dist/{chunk-wvsv1jgg.js → chunk-dx7wpz5b.js} +2 -2
  109. package/dist/{chunk-wvsv1jgg.js.map → chunk-dx7wpz5b.js.map} +1 -1
  110. package/dist/{chunk-q9s7kwgt.js → chunk-eazqda9z.js} +3 -3
  111. package/dist/{chunk-q9s7kwgt.js.map → chunk-eazqda9z.js.map} +1 -1
  112. package/dist/{chunk-td8tha3j.js → chunk-es487acc.js} +1 -1
  113. package/dist/{chunk-9s851qz8.js → chunk-et3vhkbf.js} +2 -2
  114. package/dist/{chunk-9s851qz8.js.map → chunk-et3vhkbf.js.map} +1 -1
  115. package/dist/{chunk-qd2v93y4.js → chunk-f1y8eggf.js} +2 -2
  116. package/dist/{chunk-qd2v93y4.js.map → chunk-f1y8eggf.js.map} +1 -1
  117. package/dist/{chunk-1pem26zc.js → chunk-ga7c7tq0.js} +3 -3
  118. package/dist/{chunk-1pem26zc.js.map → chunk-ga7c7tq0.js.map} +1 -1
  119. package/dist/{chunk-c098fzvk.js → chunk-gcs9ydjv.js} +2 -2
  120. package/dist/{chunk-c098fzvk.js.map → chunk-gcs9ydjv.js.map} +1 -1
  121. package/dist/{chunk-bn5yn731.js → chunk-hfyxvdjj.js} +2 -2
  122. package/dist/{chunk-bn5yn731.js.map → chunk-hfyxvdjj.js.map} +1 -1
  123. package/dist/chunk-j0sncgxc.js +14 -0
  124. package/dist/{chunk-mn5xw79b.js.map → chunk-j0sncgxc.js.map} +6 -5
  125. package/dist/{chunk-p7r2w4qw.js → chunk-j9jqxv1d.js} +3 -3
  126. package/dist/{chunk-p7r2w4qw.js.map → chunk-j9jqxv1d.js.map} +1 -1
  127. package/dist/{chunk-jbrwt3cs.js → chunk-jdtn0zk2.js} +4 -4
  128. package/dist/{chunk-jbrwt3cs.js.map → chunk-jdtn0zk2.js.map} +1 -1
  129. package/dist/{chunk-s6jjy4y9.js → chunk-jn59bsww.js} +2 -2
  130. package/dist/{chunk-s6jjy4y9.js.map → chunk-jn59bsww.js.map} +1 -1
  131. package/dist/{chunk-he7z7y9j.js → chunk-kk502yk2.js} +2 -2
  132. package/dist/{chunk-he7z7y9j.js.map → chunk-kk502yk2.js.map} +1 -1
  133. package/dist/{chunk-wsttx9rg.js → chunk-mrdarm2q.js} +2 -2
  134. package/dist/{chunk-wsttx9rg.js.map → chunk-mrdarm2q.js.map} +1 -1
  135. package/dist/chunk-mvtgx1mr.js +4 -0
  136. package/dist/{chunk-x78jrs4y.js.map → chunk-mvtgx1mr.js.map} +2 -2
  137. package/dist/{chunk-et4pv1b1.js → chunk-mx9y9mtx.js} +1 -1
  138. package/dist/chunk-nv7mv51r.js +6 -0
  139. package/dist/{chunk-tdsfke9q.js.map → chunk-nv7mv51r.js.map} +2 -2
  140. package/dist/{chunk-cttmy1jp.js → chunk-p2fhtf5r.js} +3 -3
  141. package/dist/{chunk-cttmy1jp.js.map → chunk-p2fhtf5r.js.map} +1 -1
  142. package/dist/{chunk-w7jsh3xd.js → chunk-qtbf3w6w.js} +2 -2
  143. package/dist/{chunk-w7jsh3xd.js.map → chunk-qtbf3w6w.js.map} +1 -1
  144. package/dist/chunk-qx87cdfg.js +5 -0
  145. package/dist/chunk-qx87cdfg.js.map +10 -0
  146. package/dist/{chunk-1kr25rcg.js → chunk-qyp652jz.js} +3 -3
  147. package/dist/{chunk-1kr25rcg.js.map → chunk-qyp652jz.js.map} +1 -1
  148. package/dist/{chunk-8b2tw2yp.js → chunk-rend2sbk.js} +1 -1
  149. package/dist/chunk-rx2shb3t.js +25 -0
  150. package/dist/chunk-rx2shb3t.js.map +19 -0
  151. package/dist/{chunk-mwqg079k.js → chunk-ryzcfxq7.js} +2 -2
  152. package/dist/{chunk-mwqg079k.js.map → chunk-ryzcfxq7.js.map} +1 -1
  153. package/dist/{chunk-7tx5y712.js → chunk-s9rfgxj5.js} +2 -2
  154. package/dist/{chunk-7tx5y712.js.map → chunk-s9rfgxj5.js.map} +1 -1
  155. package/dist/{chunk-1c1d0e60.js → chunk-scbvv2e4.js} +3 -3
  156. package/dist/{chunk-1c1d0e60.js.map → chunk-scbvv2e4.js.map} +1 -1
  157. package/dist/chunk-sj8jp4p9.js +24 -0
  158. package/dist/{chunk-wqvvjd5r.js.map → chunk-sj8jp4p9.js.map} +2 -2
  159. package/dist/{chunk-pwmgqq7z.js → chunk-teny6xkw.js} +2 -2
  160. package/dist/{chunk-pwmgqq7z.js.map → chunk-teny6xkw.js.map} +1 -1
  161. package/dist/{chunk-09ypnhjv.js → chunk-tmrmwthr.js} +2 -2
  162. package/dist/{chunk-09ypnhjv.js.map → chunk-tmrmwthr.js.map} +1 -1
  163. package/dist/{chunk-h4sw6nt3.js → chunk-vgdcz7tk.js} +3 -3
  164. package/dist/{chunk-h4sw6nt3.js.map → chunk-vgdcz7tk.js.map} +1 -1
  165. package/dist/{chunk-xk930yaw.js → chunk-wexs11yy.js} +2 -2
  166. package/dist/{chunk-xk930yaw.js.map → chunk-wexs11yy.js.map} +1 -1
  167. package/dist/{chunk-k1xt2tw7.js → chunk-xs4c2nvz.js} +2 -2
  168. package/dist/{chunk-k1xt2tw7.js.map → chunk-xs4c2nvz.js.map} +1 -1
  169. package/dist/{chunk-1va15sfq.js → chunk-xv74rhay.js} +2 -2
  170. package/dist/{chunk-1va15sfq.js.map → chunk-xv74rhay.js.map} +1 -1
  171. package/dist/{chunk-sq2wkynk.js → chunk-yv1psptb.js} +2 -2
  172. package/dist/{chunk-sq2wkynk.js.map → chunk-yv1psptb.js.map} +1 -1
  173. package/dist/{chunk-tk5q8hkv.js → chunk-zfter1x0.js} +4 -4
  174. package/dist/{chunk-tk5q8hkv.js.map → chunk-zfter1x0.js.map} +1 -1
  175. package/dist/client/index.d.ts +2 -0
  176. package/dist/client/index.d.ts.map +1 -1
  177. package/dist/client/index.js +214 -1
  178. package/dist/client/index.js.map +1 -1
  179. package/dist/client/useSubscription.d.ts +70 -0
  180. package/dist/client/useSubscription.d.ts.map +1 -0
  181. package/dist/config/index.js +1 -1
  182. package/dist/console/run.js +2 -2
  183. package/dist/console/run.js.map +2 -2
  184. package/dist/container/index.js +2 -2
  185. package/dist/container/index.js.map +1 -1
  186. package/dist/database/index.js +2 -2
  187. package/dist/database/index.js.map +1 -1
  188. package/dist/email/index.js +2 -2
  189. package/dist/email/index.js.map +1 -1
  190. package/dist/facades/ChangeFeed.d.ts +42 -0
  191. package/dist/facades/ChangeFeed.d.ts.map +1 -0
  192. package/dist/facades/index.d.ts +1 -0
  193. package/dist/facades/index.d.ts.map +1 -1
  194. package/dist/facades/index.js +2 -2
  195. package/dist/facades/index.js.map +1 -1
  196. package/dist/foundation/index.js +2 -2
  197. package/dist/foundation/index.js.map +1 -1
  198. package/dist/http/ResourcePolicy.d.ts +141 -0
  199. package/dist/http/ResourcePolicy.d.ts.map +1 -0
  200. package/dist/http/errors.d.ts +13 -0
  201. package/dist/http/errors.d.ts.map +1 -1
  202. package/dist/http/index.d.ts +2 -1
  203. package/dist/http/index.d.ts.map +1 -1
  204. package/dist/http/index.js +2 -2
  205. package/dist/http/index.js.map +1 -1
  206. package/dist/i18n/dictionaryRuntime.js +2 -2
  207. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  208. package/dist/i18n/index.js +2 -2
  209. package/dist/i18n/index.js.map +2 -2
  210. package/dist/kernel/index.js +3 -3
  211. package/dist/kernel/index.js.map +3 -3
  212. package/dist/kernel/providers.d.ts.map +1 -1
  213. package/dist/orm/index.js +2 -2
  214. package/dist/orm/index.js.map +1 -1
  215. package/dist/server/index.js +2 -2
  216. package/dist/server/index.js.map +1 -1
  217. package/dist/services/change-feed/ChangeFeedDriver.d.ts +94 -0
  218. package/dist/services/change-feed/ChangeFeedDriver.d.ts.map +1 -0
  219. package/dist/services/change-feed/ChangeFeedManager.d.ts +166 -0
  220. package/dist/services/change-feed/ChangeFeedManager.d.ts.map +1 -0
  221. package/dist/services/change-feed/ChangeFeedServiceProvider.d.ts +11 -0
  222. package/dist/services/change-feed/ChangeFeedServiceProvider.d.ts.map +1 -0
  223. package/dist/services/change-feed/DatabaseChangeFeedDriver.d.ts +84 -0
  224. package/dist/services/change-feed/DatabaseChangeFeedDriver.d.ts.map +1 -0
  225. package/dist/services/change-feed/MemoryChangeFeedDriver.d.ts +26 -0
  226. package/dist/services/change-feed/MemoryChangeFeedDriver.d.ts.map +1 -0
  227. package/dist/services/change-feed/changeFeedDriverContract.d.ts +8 -0
  228. package/dist/services/change-feed/changeFeedDriverContract.d.ts.map +1 -0
  229. package/dist/services/change-feed/config.d.ts +42 -0
  230. package/dist/services/change-feed/config.d.ts.map +1 -0
  231. package/dist/services/change-feed/cursor.d.ts +17 -0
  232. package/dist/services/change-feed/cursor.d.ts.map +1 -0
  233. package/dist/services/change-feed/postgresListen.d.ts +30 -0
  234. package/dist/services/change-feed/postgresListen.d.ts.map +1 -0
  235. package/dist/services/change-feed/stream.d.ts +16 -0
  236. package/dist/services/change-feed/stream.d.ts.map +1 -0
  237. package/dist/services/change-feed/wire.d.ts +20 -0
  238. package/dist/services/change-feed/wire.d.ts.map +1 -0
  239. package/dist/services/index.d.ts +9 -0
  240. package/dist/services/index.d.ts.map +1 -1
  241. package/dist/services/index.js +3 -3
  242. package/dist/services/index.js.map +2 -2
  243. package/dist/services/queue/work.js +2 -2
  244. package/dist/services/queue/work.js.map +1 -1
  245. package/dist/services/router/ViewRouteDispatcher.d.ts +16 -0
  246. package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
  247. package/dist/stats/route-table.js +1 -1
  248. package/dist/support/index.js +2 -2
  249. package/dist/support/index.js.map +1 -1
  250. package/dist/vitest/index.js +1 -1
  251. package/package.json +6 -2
  252. package/skills/gemi-react-best-practices/rules/controller-authorize-every-tenant-read.md +16 -1
  253. package/dist/chunk-11fsn5mr.js +0 -5
  254. package/dist/chunk-h3864a8z.js +0 -17
  255. package/dist/chunk-hn67spz6.js +0 -5
  256. package/dist/chunk-mb7q7s0a.js +0 -19
  257. package/dist/chunk-mn5xw79b.js +0 -9
  258. package/dist/chunk-tdsfke9q.js +0 -6
  259. package/dist/chunk-wqvvjd5r.js +0 -24
  260. package/dist/chunk-x78jrs4y.js +0 -4
  261. /package/dist/{chunk-0sjh5v1n.js.map → chunk-53bek7sp.js.map} +0 -0
  262. /package/dist/{chunk-td8tha3j.js.map → chunk-es487acc.js.map} +0 -0
  263. /package/dist/{chunk-et4pv1b1.js.map → chunk-mx9y9mtx.js.map} +0 -0
  264. /package/dist/{chunk-8b2tw2yp.js.map → chunk-rend2sbk.js.map} +0 -0
@@ -0,0 +1,166 @@
1
+ import type { Application } from "../../foundation/Application";
2
+ import type { ChangeFeedDriver, ChangeFeedEvent } from "./ChangeFeedDriver";
3
+ import { type ChangeFeedConfig } from "./config";
4
+ import { type ChangeFeedResponse, type StreamOptions } from "./stream";
5
+ /** The longest channel name, in characters. */
6
+ export declare const MAX_CHANNEL_LENGTH = 255;
7
+ /** This process already holds `maxSubscriptions` subscriptions. */
8
+ export declare class ChangeFeedFullError extends Error {
9
+ readonly limit: number;
10
+ constructor(limit: number);
11
+ }
12
+ export type SubscribeOptions = {
13
+ /**
14
+ * Where to resume: a cursor string (an SSE event's `id`, or `cursor()`) or
15
+ * a map of channel to seq. A channel without a position starts at its head,
16
+ * so it delivers only what is published from now on.
17
+ */
18
+ cursor?: string | ReadonlyMap<string, number> | Record<string, number> | null;
19
+ /** Ends the subscription when it aborts. */
20
+ signal?: AbortSignal;
21
+ };
22
+ /**
23
+ * Change feeds: publish "channel K changed", and follow channels from a
24
+ * cursor, in this process or any other sharing the driver's store.
25
+ *
26
+ * ```ts
27
+ * await ChangeFeed.publish(`site:${site.id}`, { pages: ["/about"] });
28
+ *
29
+ * for await (const event of ChangeFeed.subscribe([`site:${site.id}`], { signal })) {
30
+ * // { type: "change", channel, seq, data } or { type: "reset", channel, seq }
31
+ * }
32
+ * ```
33
+ *
34
+ * The driver's log is the truth, and notifications only wake subscribers to
35
+ * read it. A subscription keeps no queue of its own, only which of its
36
+ * channels may have moved; it reads the log when its consumer asks for the
37
+ * next event. So a slow consumer costs nothing while it is behind, and one
38
+ * that fell further behind than the log keeps gets a `reset`.
39
+ */
40
+ export declare class ChangeFeedManager {
41
+ private readonly options;
42
+ static token: string;
43
+ readonly driver: ChangeFeedDriver;
44
+ readonly config: Required<ChangeFeedConfig>;
45
+ private readonly followers;
46
+ private readonly all;
47
+ private listenState;
48
+ private listening;
49
+ private retryTimer;
50
+ private backoffMs;
51
+ private pollTimer;
52
+ private polling;
53
+ constructor(config?: ChangeFeedConfig, options?: {
54
+ application?: Application;
55
+ });
56
+ /** How many subscriptions this process holds. */
57
+ get subscriptions(): number;
58
+ /** Whether this process is listening for other processes' publishes. */
59
+ get isListening(): boolean;
60
+ /**
61
+ * Appends `data` (JSON, or nothing) to `channel` and wakes its subscribers,
62
+ * here and on every instance sharing the store. Resolves to the new seq.
63
+ *
64
+ * Inside an ORM transaction nobody is woken before the commit, and nothing
65
+ * is published if it rolls back. The database driver on Postgres writes on
66
+ * the transaction itself; every other driver publishes after the commit,
67
+ * and then this resolves to `null`, since the seq does not exist yet.
68
+ */
69
+ publish(channel: string, data?: unknown): Promise<number | null>;
70
+ /** The latest seq of `channel`, `0` before its first publish. */
71
+ head(channel: string): Promise<number>;
72
+ /**
73
+ * A cursor at the channels' heads, for a view to hand its client so the
74
+ * client's subscription resumes from what the view showed rather than
75
+ * from whenever it connected.
76
+ */
77
+ cursor(channels: string | readonly string[]): Promise<string>;
78
+ /**
79
+ * Follows `channels` from `options.cursor`. Iterate it with `for await`;
80
+ * breaking out, `close()`, or `options.signal` ends it. Throws
81
+ * `ChangeFeedFullError` when this process holds `maxSubscriptions` already.
82
+ */
83
+ subscribe(channels: string | readonly string[], options?: SubscribeOptions): ChangeFeedSubscription;
84
+ /**
85
+ * An SSE response following `channels`, for a route handler that has
86
+ * already decided the caller may read them:
87
+ *
88
+ * ```ts
89
+ * "/sites/:siteId/changes": this.get(async (req: HttpRequest) => {
90
+ * const site = await Site.findUniqueOrThrow({ where: { publicId: req.params.siteId } });
91
+ * return ChangeFeed.stream(req, `site:${site.id}`);
92
+ * }),
93
+ * ```
94
+ *
95
+ * It resumes from the request's `Last-Event-ID`, ends when the client goes
96
+ * away or the server starts shutting down, and answers `503` with a
97
+ * `Retry-After` when this process holds `maxSubscriptions` already.
98
+ */
99
+ stream<T = unknown>(request: {
100
+ rawRequest: Request;
101
+ } | Request, channels: string | readonly string[], options?: StreamOptions): ChangeFeedResponse<T>;
102
+ /** Ends every subscription and stops listening. For shutdown and tests. */
103
+ close(): Promise<void>;
104
+ /** @internal */
105
+ forget(subscription: ChangeFeedSubscription): void;
106
+ /**
107
+ * Reads the heads of every channel this process follows, in one query per
108
+ * 500 channels, and wakes the subscribers that are behind. Runs every
109
+ * `pollInterval` while there are subscriptions, and at once whenever
110
+ * notifications may have been missed. Cheaper than each subscription
111
+ * re-reading its own log: one query per process, whatever the number of
112
+ * subscribers.
113
+ */
114
+ poll(): Promise<void>;
115
+ private startPolling;
116
+ private stopPolling;
117
+ /** Tells this process's subscribers of `channel` that it reached `seq`. */
118
+ private wake;
119
+ private resync;
120
+ private startListening;
121
+ private connect;
122
+ }
123
+ /**
124
+ * One subscriber's view of its channels: where it is in each, which may have
125
+ * moved, and the few events read from the log but not yet taken.
126
+ */
127
+ export declare class ChangeFeedSubscription implements AsyncIterableIterator<ChangeFeedEvent> {
128
+ private readonly manager;
129
+ private readonly config;
130
+ private readonly signal?;
131
+ readonly channels: readonly string[];
132
+ /** What was delivered: the cursor. */
133
+ private readonly positions;
134
+ /** What was read from the log, delivered or still in `pending`. */
135
+ private readonly readTo;
136
+ private readonly dirty;
137
+ private readonly pending;
138
+ private started;
139
+ private wakeUp;
140
+ private closed;
141
+ private readonly onAbort;
142
+ constructor(manager: ChangeFeedManager, channels: readonly string[], positions: Map<string, number>, config: Required<ChangeFeedConfig>, signal?: AbortSignal);
143
+ /** Where the subscription is, as a cursor string. Complete once `ready()` resolved. */
144
+ get cursor(): string;
145
+ get isClosed(): boolean;
146
+ /**
147
+ * Resolves once every channel has a position: the cursor's, or the head
148
+ * when it had none. Called by the first `next()`; call it yourself to
149
+ * read `cursor` before the first event.
150
+ */
151
+ ready(): Promise<void>;
152
+ next(): Promise<IteratorResult<ChangeFeedEvent>>;
153
+ return(): Promise<IteratorResult<ChangeFeedEvent>>;
154
+ [Symbol.asyncIterator](): this;
155
+ /** Ends the subscription. A pending `next()` resolves `done`. */
156
+ close(): void;
157
+ /**
158
+ * @internal `channel` reached `seq`. Before `ready()` set a position the
159
+ * channel is marked anyway, and read from its head once it has one.
160
+ */
161
+ moved(channel: string, seq: number): void;
162
+ private read;
163
+ private idle;
164
+ private wake;
165
+ }
166
+ //# sourceMappingURL=ChangeFeedManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeFeedManager.d.ts","sourceRoot":"","sources":["../../../services/change-feed/ChangeFeedManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAA4B,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI3E,OAAO,EAAoB,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzF,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAKtC,mEAAmE;AACnE,qBAAa,mBAAoB,SAAQ,KAAK;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM;CAInC;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAC9E,4CAA4C;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AC,EACb,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,EAClC,MAAM,CAAC,EAAE,WAAW;IAevC,uFAAuF;IACvF,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBhB,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAkBhD,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAKxD,CAAC,MAAM,CAAC,aAAa,CAAC;IAItB,iEAAiE;IACjE,KAAK;IASL;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;YAOpB,IAAI;IAkBlB,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,IAAI;CAKb"}
@@ -0,0 +1,11 @@
1
+ import { ServiceProvider } from "../../support/ServiceProvider";
2
+ export declare class ChangeFeedServiceProvider extends ServiceProvider {
3
+ register(): void;
4
+ /**
5
+ * Ends every subscription and closes the `LISTEN` connection. Streams have
6
+ * already ended by then: each stops at its next keepalive once the server
7
+ * starts shutting down, so the request drain does not wait on them.
8
+ */
9
+ shutdown(): Promise<void>;
10
+ }
11
+ //# sourceMappingURL=ChangeFeedServiceProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeFeedServiceProvider.d.ts","sourceRoot":"","sources":["../../../services/change-feed/ChangeFeedServiceProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAIhE,qBAAa,yBAA0B,SAAQ,eAAe;IAC5D,QAAQ;IAUR;;;;OAIG;IACG,QAAQ;CAIf"}
@@ -0,0 +1,84 @@
1
+ import type { DatabaseConnection } from "../../database/Connection";
2
+ import type { ChangeFeedDriver, ChangeFeedRead } from "./ChangeFeedDriver";
3
+ import { type PostgresListenerFactory } from "./postgresListen";
4
+ export type DatabaseChangeFeedDriverOptions = {
5
+ /** The heads table: one row per channel. Default `gemi_change_heads`. */
6
+ headsTable?: string;
7
+ /** The entries table: the kept log. Default `gemi_changes`. */
8
+ entriesTable?: string;
9
+ /** Entries kept per channel. Default `1000`. */
10
+ retain?: number;
11
+ /**
12
+ * The Postgres `NOTIFY` channel that wakes other instances. Default
13
+ * `gemi_changes`. Instances share a feed only when they use the same one.
14
+ */
15
+ notifyChannel?: string;
16
+ /**
17
+ * Opens the `LISTEN` connection. Default: Bun's `SQL` on Bun 1.4 and later,
18
+ * the `postgres` package (an optional peer dependency) before that.
19
+ */
20
+ listener?: PostgresListenerFactory;
21
+ };
22
+ type Connection = Pick<DatabaseConnection, "sql" | "dialect"> & Partial<Pick<DatabaseConnection, "name" | "url">>;
23
+ /**
24
+ * A change feed kept in two tables of the application's database: a head row
25
+ * per channel holding its latest seq, and the last `retain` entries of each
26
+ * channel. Works on Postgres and SQLite; MySQL is not supported yet.
27
+ *
28
+ * ### Publishing
29
+ *
30
+ * A publish raises the channel's head with an upsert and inserts the entry,
31
+ * in one transaction: the caller's ORM transaction when one is open on this
32
+ * driver's connection (Postgres only, see `transaction`), its own otherwise.
33
+ * The upsert locks the head row until that transaction ends, so publishers to
34
+ * one channel take turns and seqs become visible in order. Publishers to
35
+ * different channels do not wait for each other.
36
+ *
37
+ * ### Across instances
38
+ *
39
+ * On Postgres a publish also runs `pg_notify` in the same transaction, which
40
+ * Postgres delivers only on commit, and only if it commits. `listen` holds
41
+ * one `LISTEN` connection per process; a reconnect after a drop calls
42
+ * `onResync`, because notifications sent meanwhile are gone. On SQLite there
43
+ * is nobody else to tell: one process owns the file.
44
+ */
45
+ export declare class DatabaseChangeFeedDriver implements ChangeFeedDriver {
46
+ readonly headsTable: string;
47
+ readonly entriesTable: string;
48
+ readonly notifyChannel: string;
49
+ private readonly sql;
50
+ private readonly dialect;
51
+ private readonly connection;
52
+ private readonly url;
53
+ private readonly retain;
54
+ private readonly listener;
55
+ private sqliteTurn;
56
+ constructor(connection: Connection, options?: DatabaseChangeFeedDriverOptions);
57
+ /**
58
+ * Creates both tables if they do not exist, the same DDL Prisma generates
59
+ * for the models in the docs. For tests and apps that do not manage their
60
+ * schema with Prisma.
61
+ */
62
+ createTable(): Promise<void>;
63
+ joinsTransaction(): boolean;
64
+ publish(channel: string, data: unknown): Promise<number>;
65
+ private append;
66
+ heads(channels: readonly string[]): Promise<Map<string, number>>;
67
+ read(channel: string, after: number, limit: number): Promise<ChangeFeedRead>;
68
+ listen(onChange: (channel: string, seq: number) => void, onResync: () => void): Promise<{
69
+ close(): Promise<void>;
70
+ }>;
71
+ /**
72
+ * The ORM transaction a publish should be written on: one open on this
73
+ * driver's own connection, matched by name as the queue's database driver
74
+ * matches it. Never on SQLite, where Bun has one connection and a read on
75
+ * the pool runs inside the open transaction: a subscriber would deliver an
76
+ * entry that may still roll back, and whose seq would then be reused. There
77
+ * the manager publishes after the commit instead.
78
+ */
79
+ private transaction;
80
+ }
81
+ /** The DDL for both tables, Postgres and SQLite alike. */
82
+ export declare function createTableStatements(heads: string, entries: string): string[];
83
+ export {};
84
+ //# sourceMappingURL=DatabaseChangeFeedDriver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatabaseChangeFeedDriver.d.ts","sourceRoot":"","sources":["../../../services/change-feed/DatabaseChangeFeedDriver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAA2B,KAAK,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEzF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,MAAM,CAAC,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AM,GAAG,OAAO,CAAC,cAAc,CAAC;IAwB5E,MAAM,CACV,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,EAChD,QAAQ,EAAE,MAAM,IAAI,GACnB,OAAO,CAAC;QAAE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC;IA4BtC;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;CAMpB;AAED,0DAA0D;AAC1D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAc9E"}
@@ -0,0 +1,26 @@
1
+ import type { ChangeFeedDriver, ChangeFeedRead } from "./ChangeFeedDriver";
2
+ export type MemoryChangeFeedDriverOptions = {
3
+ /** Entries kept per channel. Default `1000`. */
4
+ retain?: number;
5
+ };
6
+ /**
7
+ * The default driver: each channel's log in this process's memory.
8
+ *
9
+ * **One process only.** Another instance publishes to its own memory, and a
10
+ * subscriber here never hears of it. A restart forgets every channel, and a
11
+ * client resuming with a cursor from before it gets a `reset`, which is the
12
+ * right answer: what it showed must be read again. Use the database driver
13
+ * once there is more than one instance.
14
+ *
15
+ * It has no `listen`: the manager wakes this process's subscribers itself
16
+ * after each publish, and there is nobody else to hear.
17
+ */
18
+ export declare class MemoryChangeFeedDriver implements ChangeFeedDriver {
19
+ private readonly logs;
20
+ private readonly retain;
21
+ constructor(options?: MemoryChangeFeedDriverOptions);
22
+ publish(channel: string, data: unknown): Promise<number>;
23
+ heads(channels: readonly string[]): Promise<Map<string, number>>;
24
+ read(channel: string, after: number, limit: number): Promise<ChangeFeedRead>;
25
+ }
26
+ //# sourceMappingURL=MemoryChangeFeedDriver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MemoryChangeFeedDriver.d.ts","sourceRoot":"","sources":["../../../services/change-feed/MemoryChangeFeedDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAmB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE5F,MAAM,MAAM,6BAA6B,GAAG;IAC1C,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,qBAAa,sBAAuB,YAAW,gBAAgB;IAC7D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmE;IACxF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,OAAO,GAAE,6BAAkC;IAQjD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAcxD,KAAK,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAIhE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;CAUnF"}
@@ -0,0 +1,8 @@
1
+ import type { ChangeFeedDriver } from "./ChangeFeedDriver";
2
+ /**
3
+ * What every `ChangeFeedDriver` promises, run against each by its own test
4
+ * file. `make` builds a fresh, empty driver keeping `retain` entries per
5
+ * channel.
6
+ */
7
+ export declare function changeFeedDriverContract(label: string, make: (retain: number) => Promise<ChangeFeedDriver>): void;
8
+ //# sourceMappingURL=changeFeedDriverContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changeFeedDriverContract.d.ts","sourceRoot":"","sources":["../../../services/change-feed/changeFeedDriverContract.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,QA2EpD"}
@@ -0,0 +1,42 @@
1
+ import type { Application } from "../../foundation/Application";
2
+ import type { ChangeFeedDriver } from "./ChangeFeedDriver";
3
+ export interface ChangeFeedConfig {
4
+ /**
5
+ * Where the log is kept: `"memory"`, `"database"`, a `ChangeFeedDriver`, or
6
+ * a function returning one, called once with the application.
7
+ *
8
+ * `"memory"` is the default and works for **one process only**: a
9
+ * subscriber on another instance never hears of a publish here. See
10
+ * `MemoryChangeFeedDriver`.
11
+ *
12
+ * `"database"` keeps it in the `gemi_change_heads` and `gemi_changes`
13
+ * tables of the default connection, which have to exist, and on Postgres
14
+ * wakes every instance with `LISTEN`/`NOTIFY`. See
15
+ * `DatabaseChangeFeedDriver`.
16
+ */
17
+ driver?: "memory" | "database" | ChangeFeedDriver | ((application: Application) => ChangeFeedDriver);
18
+ /**
19
+ * How often, in milliseconds, a subscription re-reads its channels even
20
+ * when nothing woke it. A safety net for a notification lost between
21
+ * instances, and the only way a driver without `listen` hears of other
22
+ * processes' publishes. Default `30000`.
23
+ */
24
+ pollInterval?: number;
25
+ /**
26
+ * How many subscriptions this process holds at once. One more is refused
27
+ * with `ChangeFeedFullError`, which `stream` answers with a `503` and a
28
+ * `Retry-After`. Default `10000`.
29
+ */
30
+ maxSubscriptions?: number;
31
+ /** How many entries a subscription reads from the log at a time. Default `100`. */
32
+ batchSize?: number;
33
+ /**
34
+ * How often, in milliseconds, `stream` writes a keepalive comment. Bun's
35
+ * idle timeout closes a silent connection after 10 seconds unless
36
+ * `SERVER_IDLE_TIMEOUT` says otherwise. Default `5000`.
37
+ */
38
+ keepaliveInterval?: number;
39
+ }
40
+ export declare function defineChangeFeedConfig(config: ChangeFeedConfig): ChangeFeedConfig;
41
+ export declare function changeFeedConfigDefaults(): Required<ChangeFeedConfig>;
42
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../services/change-feed/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,gBAAgB,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,KAAK,gBAAgB,CAAC,CAAC;IAErG;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAEjF;AAED,wBAAgB,wBAAwB,IAAI,QAAQ,CAAC,gBAAgB,CAAC,CAQrE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A subscription's position: the last seq it delivered of each channel,
3
+ * written as a query string, `site%3A42=17&site%3A43=4`.
4
+ *
5
+ * One string for every channel of a stream, because it travels as the SSE
6
+ * event `id`, and the browser sends back only the last one as
7
+ * `Last-Event-ID`. Readable in a network panel, and safe in a header.
8
+ */
9
+ export type ChangeFeedCursor = ReadonlyMap<string, number>;
10
+ export declare function encodeCursor(positions: ChangeFeedCursor): string;
11
+ /**
12
+ * The positions a cursor holds. A malformed one, or one whose seq is not a
13
+ * whole number of 0 or more, is left out: a channel without a position starts
14
+ * from its head, which is what a client with no usable cursor should get.
15
+ */
16
+ export declare function decodeCursor(cursor: string | null | undefined): Map<string, number>;
17
+ //# sourceMappingURL=cursor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../services/change-feed/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D,wBAAgB,YAAY,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAIhE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAcnF"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * One `LISTEN` connection: what the database change-feed driver needs from a
3
+ * Postgres client.
4
+ *
5
+ * Bun's `SQL` (1.4 and later) and the `postgres` package share this shape:
6
+ * `listen` resolves once the server acknowledged the `LISTEN`, and both
7
+ * reconnect by themselves after the connection drops and call `onListen`
8
+ * again, which is the moment notifications may have been missed. Measured on
9
+ * Bun 1.4.2 and postgres 3.4.9 with `pg_terminate_backend`.
10
+ */
11
+ export type PostgresListener = {
12
+ listen(channel: string, onNotify: (payload: string) => void, onListen?: () => void): Promise<unknown>;
13
+ close(): Promise<void>;
14
+ };
15
+ /** Opens a dedicated listening client for `url`. */
16
+ export type PostgresListenerFactory = (url: string) => Promise<PostgresListener>;
17
+ /** Whether this Bun's `SQL` can `LISTEN` (Bun 1.4 and later). */
18
+ export declare function bunCanListen(): boolean;
19
+ /** A one-connection Bun `SQL` client. Needs Bun 1.4 or later. */
20
+ export declare const bunListener: PostgresListenerFactory;
21
+ /**
22
+ * A one-connection client from the `postgres` package, for Bun 1.3, whose
23
+ * `SQL` cannot `LISTEN`. The package is an optional peer dependency: install
24
+ * it in the app (`bun add postgres`) to use the database driver across
25
+ * instances on Bun 1.3.
26
+ */
27
+ export declare const postgresPackageListener: PostgresListenerFactory;
28
+ /** Bun's own client when it can listen, the `postgres` package otherwise. */
29
+ export declare const defaultPostgresListener: PostgresListenerFactory;
30
+ //# sourceMappingURL=postgresListen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgresListen.d.ts","sourceRoot":"","sources":["../../../services/change-feed/postgresListen.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,GACpB,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,uBAAuB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEjF,iEAAiE;AACjE,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,iEAAiE;AACjE,eAAO,MAAM,WAAW,EAAE,uBAQzB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,uBAyBrC,CAAC;AAOF,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB,EAAE,uBAC4B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ChangeFeedMessage, ChangeFeedResponse } from "./wire";
2
+ import { type ChangeFeedManager } from "./ChangeFeedManager";
3
+ export type StreamOptions = {
4
+ /**
5
+ * Where to resume. Default: the request's `Last-Event-ID` header, then its
6
+ * `cursor` search parameter, then the channels' heads.
7
+ */
8
+ cursor?: string | null;
9
+ /** How long a client waits before retrying a `503`, in seconds. Default `5`. */
10
+ retryAfter?: number;
11
+ };
12
+ export type { ChangeFeedMessage, ChangeFeedResponse };
13
+ export declare function changeFeedStream<T>(manager: ChangeFeedManager, request: {
14
+ rawRequest: Request;
15
+ } | Request, channels: string[], options: StreamOptions): ChangeFeedResponse<T>;
16
+ //# sourceMappingURL=stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../services/change-feed/stream.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,EAAuB,KAAK,iBAAiB,EAA+B,MAAM,qBAAqB,CAAC;AAE/G,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAQF,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;AAEtD,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,EAC1C,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,EAAE,aAAa,GACrB,kBAAkB,CAAC,CAAC,CAAC,CA6EvB"}
@@ -0,0 +1,20 @@
1
+ import type { ChangeFeedEvent } from "./ChangeFeedDriver";
2
+ declare const changeFeedData: unique symbol;
3
+ /**
4
+ * The `Response` `ChangeFeed.stream` returns. `T` is the type of the
5
+ * published `data`, carried only in the type so `useSubscription` can infer
6
+ * it from the route.
7
+ */
8
+ export type ChangeFeedResponse<T = unknown> = Response & {
9
+ readonly [changeFeedData]?: T;
10
+ };
11
+ /**
12
+ * What a stream sends, one per SSE event. `ready` comes first, once the
13
+ * subscription knows where it is; its `id` is the cursor to resume from even
14
+ * if nothing changes before the connection drops.
15
+ */
16
+ export type ChangeFeedMessage<T = unknown> = ChangeFeedEvent<T> | {
17
+ type: "ready";
18
+ };
19
+ export {};
20
+ //# sourceMappingURL=wire.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../../services/change-feed/wire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAK1D,OAAO,CAAC,MAAM,cAAc,EAAE,OAAO,MAAM,CAAC;AAE5C;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,OAAO,IAAI,QAAQ,GAAG;IAAE,QAAQ,CAAC,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAE3F;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -36,6 +36,14 @@ export type { QueueDriver, EnqueueJob, ClaimOptions, ClaimedJob, JobFailure, Job
36
36
  export { Job, type JobThrottle, type JobConcurrency } from "./queue/Job";
37
37
  export { LockManager, HeldLock, type AcquireOptions, type LockRunResult, } from "./lock/LockManager";
38
38
  export { LockLostError, type LockStore } from "./lock/LockStore";
39
+ export { ChangeFeedServiceProvider } from "./change-feed/ChangeFeedServiceProvider";
40
+ export { ChangeFeedManager, ChangeFeedSubscription, ChangeFeedFullError, type SubscribeOptions, } from "./change-feed/ChangeFeedManager";
41
+ export type { ChangeFeedDriver, ChangeFeedEntry, ChangeFeedEvent, ChangeFeedRead, } from "./change-feed/ChangeFeedDriver";
42
+ export { MemoryChangeFeedDriver, type MemoryChangeFeedDriverOptions, } from "./change-feed/MemoryChangeFeedDriver";
43
+ export { DatabaseChangeFeedDriver, type DatabaseChangeFeedDriverOptions, } from "./change-feed/DatabaseChangeFeedDriver";
44
+ export type { PostgresListener, PostgresListenerFactory, } from "./change-feed/postgresListen";
45
+ export { decodeCursor, encodeCursor, type ChangeFeedCursor, } from "./change-feed/cursor";
46
+ export type { ChangeFeedMessage, ChangeFeedResponse, StreamOptions as ChangeFeedStreamOptions, } from "./change-feed/stream";
39
47
  export { MemoryLockStore } from "./lock/MemoryLockStore";
40
48
  export { DatabaseLockStore, type DatabaseLockStoreOptions, } from "./lock/DatabaseLockStore";
41
49
  export { EventServiceProvider } from "./events/EventServiceProvider";
@@ -86,6 +94,7 @@ export { defineMailConfig, mailConfigDefaults, type MailConfig, } from "./email/
86
94
  export { defineRouteConfig, apiRouteConfigDefaults, viewRouteConfigDefaults, type RouteConfig, type ApiRouteConfig, type McpRouteConfig, type ViewRouteConfig, } from "./router/config";
87
95
  export { defineLogConfig, logConfigDefaults, type LogConfig, } from "./logging/config";
88
96
  export { defineQueueConfig, queueConfigDefaults, type QueueConfig, } from "./queue/config";
97
+ export { defineChangeFeedConfig, changeFeedConfigDefaults, type ChangeFeedConfig, } from "./change-feed/config";
89
98
  export { defineEventConfig, eventConfigDefaults, type EventConfig, } from "./events/config";
90
99
  export { defineImageConfig, imageConfigDefaults, type ImageConfig, } from "./image-optimization/config";
91
100
  export { defineScheduleConfig, scheduleConfigDefaults, type ScheduleConfig, } from "./cron/config";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../services/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,GAC3B,MAAM,wCAAwC,CAAC;AAChD,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAG7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM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