gemi 0.127.0 → 0.129.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 (253) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai/index.js.map +1 -1
  3. package/dist/app/index.js +1 -1
  4. package/dist/bun/plugin.js +1 -1
  5. package/dist/bun/preload.js +1 -1
  6. package/dist/{chunk-bghxdjqv.js → chunk-03wc6em7.js} +1 -1
  7. package/dist/{chunk-56ryda9y.js → chunk-0m2fyw7g.js} +2 -2
  8. package/dist/{chunk-56ryda9y.js.map → chunk-0m2fyw7g.js.map} +1 -1
  9. package/dist/chunk-0ryswty9.js +120 -0
  10. package/dist/{chunk-6c8pn6hj.js.map → chunk-0ryswty9.js.map} +10 -4
  11. package/dist/{chunk-ecb8qggy.js → chunk-0vxwrc4t.js} +2 -2
  12. package/dist/{chunk-ecb8qggy.js.map → chunk-0vxwrc4t.js.map} +1 -1
  13. package/dist/{chunk-1v368y9a.js → chunk-1gdzajwb.js} +2 -2
  14. package/dist/{chunk-1v368y9a.js.map → chunk-1gdzajwb.js.map} +1 -1
  15. package/dist/{chunk-h4755p9h.js → chunk-1rq53cb0.js} +2 -2
  16. package/dist/{chunk-h4755p9h.js.map → chunk-1rq53cb0.js.map} +1 -1
  17. package/dist/{chunk-v7nw1g2n.js → chunk-1yttk239.js} +2 -2
  18. package/dist/{chunk-v7nw1g2n.js.map → chunk-1yttk239.js.map} +1 -1
  19. package/dist/{chunk-28bby5pp.js → chunk-1z311hyj.js} +2 -2
  20. package/dist/{chunk-28bby5pp.js.map → chunk-1z311hyj.js.map} +1 -1
  21. package/dist/{chunk-n8mxsfc2.js → chunk-2869cbhd.js} +3 -3
  22. package/dist/{chunk-n8mxsfc2.js.map → chunk-2869cbhd.js.map} +1 -1
  23. package/dist/{chunk-dm7mada7.js → chunk-2bmk0fzm.js} +3 -3
  24. package/dist/{chunk-dm7mada7.js.map → chunk-2bmk0fzm.js.map} +1 -1
  25. package/dist/{chunk-ych1dv5q.js → chunk-2epj17ac.js} +3 -3
  26. package/dist/{chunk-ych1dv5q.js.map → chunk-2epj17ac.js.map} +1 -1
  27. package/dist/{chunk-0arss2xy.js → chunk-2z1gd231.js} +2 -2
  28. package/dist/{chunk-0arss2xy.js.map → chunk-2z1gd231.js.map} +1 -1
  29. package/dist/{chunk-xe2cfmyb.js → chunk-3dyd4z06.js} +2 -2
  30. package/dist/{chunk-xe2cfmyb.js.map → chunk-3dyd4z06.js.map} +1 -1
  31. package/dist/{chunk-p0ccxfkq.js → chunk-43vjbd6n.js} +1 -1
  32. package/dist/{chunk-nv2t87c3.js → chunk-4yp84g2y.js} +2 -2
  33. package/dist/{chunk-nv2t87c3.js.map → chunk-4yp84g2y.js.map} +1 -1
  34. package/dist/{chunk-bhbxhk9e.js → chunk-5bk7767a.js} +2 -2
  35. package/dist/{chunk-bhbxhk9e.js.map → chunk-5bk7767a.js.map} +1 -1
  36. package/dist/{chunk-k6gvbvyw.js → chunk-5nkvpc0a.js} +1 -1
  37. package/dist/{chunk-gxp48t81.js → chunk-5ym464xx.js} +4 -4
  38. package/dist/{chunk-gxp48t81.js.map → chunk-5ym464xx.js.map} +1 -1
  39. package/dist/{chunk-v80890xx.js → chunk-7321qjgb.js} +3 -3
  40. package/dist/{chunk-v80890xx.js.map → chunk-7321qjgb.js.map} +1 -1
  41. package/dist/{chunk-0f0xxqhy.js → chunk-87rtxv9n.js} +3 -3
  42. package/dist/{chunk-0f0xxqhy.js.map → chunk-87rtxv9n.js.map} +1 -1
  43. package/dist/{chunk-avfntxm1.js → chunk-8jqve5dr.js} +2 -2
  44. package/dist/{chunk-avfntxm1.js.map → chunk-8jqve5dr.js.map} +1 -1
  45. package/dist/{chunk-5vvfcdpk.js → chunk-9122838b.js} +2 -2
  46. package/dist/{chunk-5vvfcdpk.js.map → chunk-9122838b.js.map} +1 -1
  47. package/dist/{chunk-jg3kg55f.js → chunk-9701fx4z.js} +2 -2
  48. package/dist/{chunk-jg3kg55f.js.map → chunk-9701fx4z.js.map} +1 -1
  49. package/dist/{chunk-mj7h1dgh.js → chunk-b7wmssj5.js} +2 -2
  50. package/dist/{chunk-mj7h1dgh.js.map → chunk-b7wmssj5.js.map} +1 -1
  51. package/dist/{chunk-etf6h5m1.js → chunk-bg5qb9hm.js} +2 -2
  52. package/dist/{chunk-etf6h5m1.js.map → chunk-bg5qb9hm.js.map} +1 -1
  53. package/dist/{chunk-w4111j5d.js → chunk-bnp6wpzd.js} +2 -2
  54. package/dist/{chunk-w4111j5d.js.map → chunk-bnp6wpzd.js.map} +1 -1
  55. package/dist/{chunk-yg8se4vs.js → chunk-cp84b0ev.js} +3 -3
  56. package/dist/{chunk-yg8se4vs.js.map → chunk-cp84b0ev.js.map} +1 -1
  57. package/dist/{chunk-hye22tpt.js → chunk-dak8txaw.js} +2 -2
  58. package/dist/{chunk-hye22tpt.js.map → chunk-dak8txaw.js.map} +1 -1
  59. package/dist/{chunk-7x2n788t.js → chunk-er5ed5pg.js} +3 -3
  60. package/dist/{chunk-7x2n788t.js.map → chunk-er5ed5pg.js.map} +1 -1
  61. package/dist/{chunk-s2y2b8tz.js → chunk-f8ce6e9c.js} +2 -2
  62. package/dist/{chunk-s2y2b8tz.js.map → chunk-f8ce6e9c.js.map} +1 -1
  63. package/dist/{chunk-7eerqsg2.js → chunk-fezaxj28.js} +2 -2
  64. package/dist/{chunk-7eerqsg2.js.map → chunk-fezaxj28.js.map} +1 -1
  65. package/dist/{chunk-q9mxjh10.js → chunk-fv53h1q2.js} +2 -2
  66. package/dist/{chunk-q9mxjh10.js.map → chunk-fv53h1q2.js.map} +1 -1
  67. package/dist/{chunk-62zn06wb.js → chunk-gpdsxwkt.js} +2 -2
  68. package/dist/{chunk-62zn06wb.js.map → chunk-gpdsxwkt.js.map} +1 -1
  69. package/dist/{chunk-15bmfr7f.js → chunk-gzaaspe7.js} +2 -2
  70. package/dist/{chunk-15bmfr7f.js.map → chunk-gzaaspe7.js.map} +1 -1
  71. package/dist/{chunk-3fyhd641.js → chunk-h55c9bdf.js} +1 -1
  72. package/dist/{chunk-x5vpjzpp.js → chunk-ja41ts8v.js} +2 -2
  73. package/dist/{chunk-x5vpjzpp.js.map → chunk-ja41ts8v.js.map} +1 -1
  74. package/dist/{chunk-1dzs05dc.js → chunk-jcps2gpp.js} +2 -2
  75. package/dist/{chunk-1dzs05dc.js.map → chunk-jcps2gpp.js.map} +1 -1
  76. package/dist/chunk-jj1ppnnk.js +10 -0
  77. package/dist/{chunk-3p9vj0h6.js.map → chunk-jj1ppnnk.js.map} +5 -4
  78. package/dist/{chunk-psdyfaf1.js → chunk-jm1f9cas.js} +2 -2
  79. package/dist/{chunk-psdyfaf1.js.map → chunk-jm1f9cas.js.map} +1 -1
  80. package/dist/{chunk-99z9d0sa.js → chunk-k107vw69.js} +2 -2
  81. package/dist/{chunk-99z9d0sa.js.map → chunk-k107vw69.js.map} +1 -1
  82. package/dist/{chunk-7dzprr9b.js → chunk-k10vbrjx.js} +3 -3
  83. package/dist/{chunk-7dzprr9b.js.map → chunk-k10vbrjx.js.map} +1 -1
  84. package/dist/{chunk-c48gag78.js → chunk-kmcnfk2s.js} +1 -1
  85. package/dist/{chunk-yffm8nxa.js → chunk-mc8mxx2a.js} +2 -2
  86. package/dist/{chunk-yffm8nxa.js.map → chunk-mc8mxx2a.js.map} +1 -1
  87. package/dist/{chunk-ewv1m1sv.js → chunk-n1t4ea9g.js} +3 -3
  88. package/dist/{chunk-ewv1m1sv.js.map → chunk-n1t4ea9g.js.map} +1 -1
  89. package/dist/{chunk-9hhxy88x.js → chunk-n4dk0dc9.js} +2 -2
  90. package/dist/{chunk-9hhxy88x.js.map → chunk-n4dk0dc9.js.map} +1 -1
  91. package/dist/{chunk-rvdsaqdv.js → chunk-nh9ewam0.js} +1 -1
  92. package/dist/{chunk-84rbdyhe.js → chunk-njaxnv6c.js} +2 -2
  93. package/dist/{chunk-84rbdyhe.js.map → chunk-njaxnv6c.js.map} +1 -1
  94. package/dist/{chunk-7nfprr9v.js → chunk-np73p641.js} +2 -2
  95. package/dist/{chunk-7nfprr9v.js.map → chunk-np73p641.js.map} +1 -1
  96. package/dist/{chunk-87jj7n9q.js → chunk-nvfhx9d1.js} +2 -2
  97. package/dist/{chunk-87jj7n9q.js.map → chunk-nvfhx9d1.js.map} +1 -1
  98. package/dist/{chunk-qmcjh6de.js → chunk-nwzsgzvy.js} +2 -2
  99. package/dist/{chunk-qmcjh6de.js.map → chunk-nwzsgzvy.js.map} +1 -1
  100. package/dist/{chunk-43faxwf5.js → chunk-p528pvmm.js} +2 -2
  101. package/dist/{chunk-43faxwf5.js.map → chunk-p528pvmm.js.map} +1 -1
  102. package/dist/{chunk-kzk5r6v4.js → chunk-peng31np.js} +3 -3
  103. package/dist/{chunk-kzk5r6v4.js.map → chunk-peng31np.js.map} +1 -1
  104. package/dist/{chunk-mj4n5mar.js → chunk-pgddb43b.js} +2 -2
  105. package/dist/{chunk-mj4n5mar.js.map → chunk-pgddb43b.js.map} +1 -1
  106. package/dist/{chunk-s2krqtwj.js → chunk-pgh7gsag.js} +2 -2
  107. package/dist/{chunk-s2krqtwj.js.map → chunk-pgh7gsag.js.map} +1 -1
  108. package/dist/chunk-pqn9j5s8.js +5 -0
  109. package/dist/{chunk-87bmhng2.js.map → chunk-pqn9j5s8.js.map} +1 -1
  110. package/dist/{chunk-m63v6aze.js → chunk-pxsq9841.js} +2 -2
  111. package/dist/{chunk-m63v6aze.js.map → chunk-pxsq9841.js.map} +1 -1
  112. package/dist/{chunk-1eb4p352.js → chunk-py1twqh8.js} +2 -2
  113. package/dist/{chunk-1eb4p352.js.map → chunk-py1twqh8.js.map} +1 -1
  114. package/dist/{chunk-nrf23yan.js → chunk-qjmcn5m5.js} +2 -2
  115. package/dist/{chunk-nrf23yan.js.map → chunk-qjmcn5m5.js.map} +1 -1
  116. package/dist/{chunk-t8kzaxaa.js → chunk-qpwb3gnh.js} +2 -2
  117. package/dist/{chunk-t8kzaxaa.js.map → chunk-qpwb3gnh.js.map} +1 -1
  118. package/dist/{chunk-c65rh4k8.js → chunk-qv8sj2z3.js} +2 -2
  119. package/dist/{chunk-c65rh4k8.js.map → chunk-qv8sj2z3.js.map} +1 -1
  120. package/dist/{chunk-3hndrc5z.js → chunk-sbdm4enk.js} +2 -2
  121. package/dist/{chunk-3hndrc5z.js.map → chunk-sbdm4enk.js.map} +1 -1
  122. package/dist/{chunk-v1eeh7a7.js → chunk-sh39q44t.js} +3 -3
  123. package/dist/{chunk-v1eeh7a7.js.map → chunk-sh39q44t.js.map} +1 -1
  124. package/dist/{chunk-b2pdqxj3.js → chunk-t7gvgz20.js} +3 -3
  125. package/dist/{chunk-b2pdqxj3.js.map → chunk-t7gvgz20.js.map} +1 -1
  126. package/dist/{chunk-gv59djt3.js → chunk-tn3y2qkj.js} +2 -2
  127. package/dist/{chunk-gv59djt3.js.map → chunk-tn3y2qkj.js.map} +1 -1
  128. package/dist/{chunk-9x0pgkns.js → chunk-ty5sp1ym.js} +2 -2
  129. package/dist/{chunk-9x0pgkns.js.map → chunk-ty5sp1ym.js.map} +1 -1
  130. package/dist/{chunk-8df7fn7f.js → chunk-v09w6pr2.js} +3 -3
  131. package/dist/{chunk-8df7fn7f.js.map → chunk-v09w6pr2.js.map} +1 -1
  132. package/dist/{chunk-s0kns9q1.js → chunk-vc5kpxdk.js} +3 -3
  133. package/dist/{chunk-s0kns9q1.js.map → chunk-vc5kpxdk.js.map} +1 -1
  134. package/dist/{chunk-1gd1ykgj.js → chunk-vjpby5sf.js} +3 -3
  135. package/dist/{chunk-1gd1ykgj.js.map → chunk-vjpby5sf.js.map} +1 -1
  136. package/dist/{chunk-p7abyc0b.js → chunk-wf3qe12c.js} +2 -2
  137. package/dist/{chunk-p7abyc0b.js.map → chunk-wf3qe12c.js.map} +1 -1
  138. package/dist/{chunk-yhxjhrvp.js → chunk-wmkrb1qv.js} +2 -2
  139. package/dist/{chunk-yhxjhrvp.js.map → chunk-wmkrb1qv.js.map} +1 -1
  140. package/dist/{chunk-094m8mj3.js → chunk-wn437678.js} +2 -2
  141. package/dist/{chunk-094m8mj3.js.map → chunk-wn437678.js.map} +1 -1
  142. package/dist/{chunk-rtb64x14.js → chunk-wv3nnq8c.js} +3 -3
  143. package/dist/{chunk-rtb64x14.js.map → chunk-wv3nnq8c.js.map} +1 -1
  144. package/dist/{chunk-wat33wxh.js → chunk-ww86zqbw.js} +2 -2
  145. package/dist/{chunk-wat33wxh.js.map → chunk-ww86zqbw.js.map} +1 -1
  146. package/dist/{chunk-ebdkmzm9.js → chunk-x92g4x4w.js} +2 -2
  147. package/dist/{chunk-ebdkmzm9.js.map → chunk-x92g4x4w.js.map} +1 -1
  148. package/dist/{chunk-qy3s6pwz.js → chunk-xhm5wgfe.js} +2 -2
  149. package/dist/{chunk-qy3s6pwz.js.map → chunk-xhm5wgfe.js.map} +1 -1
  150. package/dist/{chunk-89swy5aq.js → chunk-xtnbcbkf.js} +2 -2
  151. package/dist/{chunk-89swy5aq.js.map → chunk-xtnbcbkf.js.map} +1 -1
  152. package/dist/{chunk-pxstrw29.js → chunk-zw5z1k84.js} +2 -2
  153. package/dist/{chunk-pxstrw29.js.map → chunk-zw5z1k84.js.map} +1 -1
  154. package/dist/chunks/RealtimeClient-CqGve6h8.js +545 -0
  155. package/dist/chunks/RealtimeClient-CqGve6h8.js.map +1 -0
  156. package/dist/chunks/{ThemeProvider-BIrCSrFY.js → ThemeProvider-DaX0eyqs.js} +155 -539
  157. package/dist/chunks/ThemeProvider-DaX0eyqs.js.map +1 -0
  158. package/dist/chunks/live-DIUDdLrA.js +69 -0
  159. package/dist/chunks/live-DIUDdLrA.js.map +1 -0
  160. package/dist/chunks/subscriptionStream-CULcRbx0.js +166 -0
  161. package/dist/chunks/subscriptionStream-CULcRbx0.js.map +1 -0
  162. package/dist/client/index.d.ts +1 -1
  163. package/dist/client/index.d.ts.map +1 -1
  164. package/dist/client/index.js +118 -330
  165. package/dist/client/index.js.map +1 -1
  166. package/dist/client/init.d.ts +1 -1
  167. package/dist/client/init.d.ts.map +1 -1
  168. package/dist/client/realtime/FakeSocket.d.ts +1 -1
  169. package/dist/client/realtime/FakeSocket.d.ts.map +1 -1
  170. package/dist/client/realtime/RealtimeClient.d.ts +4 -20
  171. package/dist/client/realtime/RealtimeClient.d.ts.map +1 -1
  172. package/dist/client/realtime/live.d.ts +25 -0
  173. package/dist/client/realtime/live.d.ts.map +1 -0
  174. package/dist/client/realtime/loader.d.ts +59 -0
  175. package/dist/client/realtime/loader.d.ts.map +1 -0
  176. package/dist/client/realtime/useChannelSubscription.d.ts +1 -1
  177. package/dist/client/realtime/useChannelSubscription.d.ts.map +1 -1
  178. package/dist/client/subscriptionStream.d.ts +36 -0
  179. package/dist/client/subscriptionStream.d.ts.map +1 -0
  180. package/dist/client/useChannel.d.ts +1 -13
  181. package/dist/client/useChannel.d.ts.map +1 -1
  182. package/dist/client/useQuery.d.ts +1 -1
  183. package/dist/client/useQuery.d.ts.map +1 -1
  184. package/dist/client/useSubscription.d.ts +5 -10
  185. package/dist/client/useSubscription.d.ts.map +1 -1
  186. package/dist/config/index.js +1 -1
  187. package/dist/console/run.js +2 -2
  188. package/dist/console/run.js.map +1 -1
  189. package/dist/container/index.js +2 -2
  190. package/dist/container/index.js.map +1 -1
  191. package/dist/database/index.js +2 -2
  192. package/dist/database/index.js.map +1 -1
  193. package/dist/email/index.js +2 -2
  194. package/dist/email/index.js.map +1 -1
  195. package/dist/facades/Runs.d.ts +64 -0
  196. package/dist/facades/Runs.d.ts.map +1 -0
  197. package/dist/facades/index.d.ts +1 -0
  198. package/dist/facades/index.d.ts.map +1 -1
  199. package/dist/facades/index.js +2 -2
  200. package/dist/facades/index.js.map +1 -1
  201. package/dist/foundation/index.js +2 -2
  202. package/dist/foundation/index.js.map +1 -1
  203. package/dist/http/index.js +2 -2
  204. package/dist/http/index.js.map +1 -1
  205. package/dist/i18n/dictionaryRuntime.js +2 -2
  206. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  207. package/dist/i18n/index.js +2 -2
  208. package/dist/i18n/index.js.map +1 -1
  209. package/dist/kernel/index.js +3 -3
  210. package/dist/kernel/index.js.map +3 -3
  211. package/dist/kernel/providers.d.ts.map +1 -1
  212. package/dist/orm/index.js +2 -2
  213. package/dist/orm/index.js.map +1 -1
  214. package/dist/server/index.js +2 -2
  215. package/dist/server/index.js.map +1 -1
  216. package/dist/services/broadcast/protocol.d.ts +1 -2
  217. package/dist/services/broadcast/protocol.d.ts.map +1 -1
  218. package/dist/services/broadcast/socketHeader.d.ts +9 -0
  219. package/dist/services/broadcast/socketHeader.d.ts.map +1 -0
  220. package/dist/services/index.d.ts +5 -0
  221. package/dist/services/index.d.ts.map +1 -1
  222. package/dist/services/index.js +3 -3
  223. package/dist/services/index.js.map +2 -2
  224. package/dist/services/queue/work.js +2 -2
  225. package/dist/services/queue/work.js.map +1 -1
  226. package/dist/services/runs/DatabaseRunStore.d.ts +62 -0
  227. package/dist/services/runs/DatabaseRunStore.d.ts.map +1 -0
  228. package/dist/services/runs/RunManager.d.ts +200 -0
  229. package/dist/services/runs/RunManager.d.ts.map +1 -0
  230. package/dist/services/runs/RunStore.d.ts +163 -0
  231. package/dist/services/runs/RunStore.d.ts.map +1 -0
  232. package/dist/services/runs/RunsServiceProvider.d.ts +5 -0
  233. package/dist/services/runs/RunsServiceProvider.d.ts.map +1 -0
  234. package/dist/services/runs/config.d.ts +20 -0
  235. package/dist/services/runs/config.d.ts.map +1 -0
  236. package/dist/stats/route-table.js +1 -1
  237. package/dist/support/index.js +2 -2
  238. package/dist/support/index.js.map +1 -1
  239. package/dist/testing/Page.d.ts.map +1 -1
  240. package/dist/testing/index.js +3 -1
  241. package/dist/testing/index.js.map +1 -1
  242. package/dist/vitest/index.js +1 -1
  243. package/package.json +1 -1
  244. package/dist/chunk-3p9vj0h6.js +0 -10
  245. package/dist/chunk-6c8pn6hj.js +0 -57
  246. package/dist/chunk-87bmhng2.js +0 -5
  247. package/dist/chunks/ThemeProvider-BIrCSrFY.js.map +0 -1
  248. /package/dist/{chunk-bghxdjqv.js.map → chunk-03wc6em7.js.map} +0 -0
  249. /package/dist/{chunk-p0ccxfkq.js.map → chunk-43vjbd6n.js.map} +0 -0
  250. /package/dist/{chunk-k6gvbvyw.js.map → chunk-5nkvpc0a.js.map} +0 -0
  251. /package/dist/{chunk-3fyhd641.js.map → chunk-h55c9bdf.js.map} +0 -0
  252. /package/dist/{chunk-c48gag78.js.map → chunk-kmcnfk2s.js.map} +0 -0
  253. /package/dist/{chunk-rvdsaqdv.js.map → chunk-nh9ewam0.js.map} +0 -0
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Ed as H,Hd as _}from"../../chunk-b2pdqxj3.js";import{jj as O}from"../../chunk-s2krqtwj.js";import"../../chunk-0arss2xy.js";import"../../chunk-nv2t87c3.js";import"../../chunk-kzk5r6v4.js";import"../../chunk-v7nw1g2n.js";import"../../chunk-yg8se4vs.js";import"../../chunk-84rbdyhe.js";import{Ck as U,Dk as V,Hk as Z}from"../../chunk-7nfprr9v.js";import{Lk as Y}from"../../chunk-9x0pgkns.js";import"../../chunk-89swy5aq.js";import X from"path";function T(z){if(!z.config.get("route.channels"))return null;let C=z.config.get("broadcast",{}).driver;if(!(C===void 0||C==="memory"||C instanceof O))return null;return'[gemi] Broadcasts from this worker reach no one: the broadcast driver is "memory", which delivers to the sockets of the process that emits, and a worker has none. Set `driver: "redis"` in app/config/broadcast.ts.'}class J extends Error{name="QueueWorkerRefused"}class N{kernel;stopping;keepAlive;settings;constructor(z,C={}){this.kernel=z;this.settings={...V(),...C}}async start(){if(await this.kernel.waitForBoot(),this.stopping)return;let z=this.kernel.app;if(!z.bound(H))throw new J("[gemi] `gemi queue:work` has no queue to claim from: this application does not register QueueServiceProvider.");let C=z.make(H);if(!C.durable)throw new J('[gemi] `gemi queue:work` refuses to start: the queue uses the memory driver, which keeps each job in the process that dispatched it, so a worker never sees one. Set `driver: "database"` (or another driver every process can reach) in app/config/queue.ts, or run jobs in the server and drop the worker.');C.start(),this.keepAlive=setInterval(()=>{},1073741824),console.log(`[gemi] Queue worker started: claiming up to ${C.config.concurrency} job(s) at a time.`);let E=T(z);if(E)console.warn(E)}stop(z={}){return this.stopping??=this.drain({...this.settings,...z}),this.stopping}async drain(z){U();let C=this.kernel.app,E=C.resolved(H)?C.make(H):void 0;if(E)console.log(`[gemi] Shutting down: waiting for ${E.running} running job(s) (up to ${z.timeoutMs/1000}s).`),await E.drain(z.timeoutMs);let F=await this.kernel.shutdown({timeoutMs:z.providerTimeoutMs});clearInterval(this.keepAlive);let G=(E?.running??0)===0&&F.failed.length===0&&F.timedOut.length===0;return console.log(`[gemi] Shutdown ${G?"complete":"finished with errors"}.`),G?0:1}}async function $(){let z=Y();process.env.ROOT_DIR=z,process.env.APP_DIR=X.join(z,"app"),_();let C=X.join(z,"app/kernel/Kernel.ts"),{default:E}=await import(C);if(typeof E!=="function")return console.error(`[gemi] ${C} has no default export to boot the worker from.`),1;let F=new E;F.boot();let G=new N(F);Z(()=>G.stop());try{await G.start()}catch(L){if(!(L instanceof J))throw L;return console.error(L.message),1}return}$().then((z)=>{if(z!==void 0)process.exit(z)},(z)=>{console.error("[gemi] The queue worker failed to start:",z),process.exit(1)});
2
+ import{Fd as H,Id as _}from"../../chunk-t7gvgz20.js";import{vj as O}from"../../chunk-pgh7gsag.js";import"../../chunk-2z1gd231.js";import"../../chunk-4yp84g2y.js";import"../../chunk-peng31np.js";import"../../chunk-1yttk239.js";import"../../chunk-cp84b0ev.js";import"../../chunk-njaxnv6c.js";import{Ok as U,Pk as V,Tk as Z}from"../../chunk-np73p641.js";import{Xk as Y}from"../../chunk-ty5sp1ym.js";import"../../chunk-xtnbcbkf.js";import X from"path";function T(z){if(!z.config.get("route.channels"))return null;let C=z.config.get("broadcast",{}).driver;if(!(C===void 0||C==="memory"||C instanceof O))return null;return'[gemi] Broadcasts from this worker reach no one: the broadcast driver is "memory", which delivers to the sockets of the process that emits, and a worker has none. Set `driver: "redis"` in app/config/broadcast.ts.'}class J extends Error{name="QueueWorkerRefused"}class N{kernel;stopping;keepAlive;settings;constructor(z,C={}){this.kernel=z;this.settings={...V(),...C}}async start(){if(await this.kernel.waitForBoot(),this.stopping)return;let z=this.kernel.app;if(!z.bound(H))throw new J("[gemi] `gemi queue:work` has no queue to claim from: this application does not register QueueServiceProvider.");let C=z.make(H);if(!C.durable)throw new J('[gemi] `gemi queue:work` refuses to start: the queue uses the memory driver, which keeps each job in the process that dispatched it, so a worker never sees one. Set `driver: "database"` (or another driver every process can reach) in app/config/queue.ts, or run jobs in the server and drop the worker.');C.start(),this.keepAlive=setInterval(()=>{},1073741824),console.log(`[gemi] Queue worker started: claiming up to ${C.config.concurrency} job(s) at a time.`);let E=T(z);if(E)console.warn(E)}stop(z={}){return this.stopping??=this.drain({...this.settings,...z}),this.stopping}async drain(z){U();let C=this.kernel.app,E=C.resolved(H)?C.make(H):void 0;if(E)console.log(`[gemi] Shutting down: waiting for ${E.running} running job(s) (up to ${z.timeoutMs/1000}s).`),await E.drain(z.timeoutMs);let F=await this.kernel.shutdown({timeoutMs:z.providerTimeoutMs});clearInterval(this.keepAlive);let G=(E?.running??0)===0&&F.failed.length===0&&F.timedOut.length===0;return console.log(`[gemi] Shutdown ${G?"complete":"finished with errors"}.`),G?0:1}}async function $(){let z=Y();process.env.ROOT_DIR=z,process.env.APP_DIR=X.join(z,"app"),_();let C=X.join(z,"app/kernel/Kernel.ts"),{default:E}=await import(C);if(typeof E!=="function")return console.error(`[gemi] ${C} has no default export to boot the worker from.`),1;let F=new E;F.boot();let G=new N(F);Z(()=>G.stop());try{await G.start()}catch(L){if(!(L instanceof J))throw L;return console.error(L.message),1}return}$().then((z)=>{if(z!==void 0)process.exit(z)},(z)=>{console.error("[gemi] The queue worker failed to start:",z),process.exit(1)});
3
3
 
4
- //# debugId=945B6EFFA750EB7864756E2164756E21
4
+ //# debugId=DDC2C5523D47685664756E2164756E21
@@ -7,6 +7,6 @@
7
7
  "import type { Application, ShutdownReport } from \"../../foundation/Application\";\nimport { markShuttingDown, shutdownSettings, type ShutdownSettings } from \"../../server/shutdown\";\nimport { memoryBroadcastInWorker } from \"../broadcast/workerWarning\";\nimport { QueueManager } from \"./QueueManager\";\n\n/** The part of a `Kernel` a worker drives. */\nexport type WorkerKernel = {\n readonly app: Application;\n waitForBoot(): Promise<void>;\n shutdown(options?: { timeoutMs?: number }): Promise<ShutdownReport>;\n};\n\n/**\n * A worker that was told to start in an application it cannot claim for. The\n * message is written for the operator reading the deploy's logs.\n */\nexport class QueueWorkerRefused extends Error {\n name = \"QueueWorkerRefused\";\n}\n\n/**\n * The process `gemi queue:work` runs: the application booted as a server boots\n * it, claiming from the queue, and no `Bun.serve`. It exists so job capacity\n * can be scaled apart from request traffic, which needs a driver both kinds of\n * process can reach; see `start` for why the memory driver is refused.\n *\n * The caller marks the process as a worker (`markQueueWorker`) before the\n * kernel registers, so every claim rule that asks `claimsInThisProcess` sees a\n * process that claims, whatever `GEMI_QUEUE_CLAIM` says.\n */\nexport class QueueWorker {\n private stopping: Promise<number> | undefined;\n private keepAlive: ReturnType<typeof setInterval> | undefined;\n private readonly settings: ShutdownSettings;\n\n /**\n * `settings` default to the `GEMI_SHUTDOWN_*` variables, read here rather\n * than at the signal so a bad value is warned about while the deploy is\n * being watched, as `Server.start` does.\n */\n constructor(\n private readonly kernel: WorkerKernel,\n settings: Partial<ShutdownSettings> = {},\n ) {\n this.settings = { ...shutdownSettings(), ...settings };\n }\n\n /**\n * Boots the application and starts claiming. Rejects with\n * `QueueWorkerRefused` when the application has no queue, or its queue uses\n * the memory driver.\n *\n * Refused rather than warned about, because a memory worker can never do\n * anything: its jobs live in a `Map` in the process that dispatched them,\n * so a worker's is always empty. Left running, it looks like a healthy\n * deploy — a process up, no errors — that runs nothing, and scaling it out\n * adds no capacity. An exit the platform reports as a crash loop is a form\n * of the mistake someone will see.\n */\n async start(): Promise<void> {\n await this.kernel.waitForBoot();\n // A signal during the boot has already drained and cleared the handle\n // below. Going on would start the loop again and arm a handle nothing\n // clears, holding open a worker that has finished shutting down.\n if (this.stopping) return;\n\n const application = this.kernel.app;\n // `bound`, not `make` in a try: an application built without the queue\n // provider is a configuration to name, not an unbound-token stack trace.\n if (!application.bound(QueueManager)) {\n throw new QueueWorkerRefused(\n \"[gemi] `gemi queue:work` has no queue to claim from: this application \" +\n \"does not register QueueServiceProvider.\",\n );\n }\n const queue = application.make(QueueManager);\n if (!queue.durable) {\n throw new QueueWorkerRefused(\n \"[gemi] `gemi queue:work` refuses to start: the queue uses the memory \" +\n \"driver, which keeps each job in the process that dispatched it, so \" +\n 'a worker never sees one. Set `driver: \"database\"` (or another driver ' +\n \"every process can reach) in app/config/queue.ts, or run jobs in the \" +\n \"server and drop the worker.\",\n );\n }\n\n // Idempotent: a production boot with a durable driver has already started\n // it (`startClaimingIfServing`). Development has not, and a worker claims\n // in either.\n queue.start();\n // The queue's poll timer is unref'd, so that a script's queue does not\n // hold it open; here the queue is the process, and without a handle of its\n // own an idle worker would exit 0 as soon as it booted.\n this.keepAlive = setInterval(() => {}, 1 << 30);\n console.log(\n `[gemi] Queue worker started: claiming up to ${queue.config.concurrency} job(s) at a time.`,\n );\n const broadcastWarning = memoryBroadcastInWorker(application);\n if (broadcastWarning) console.warn(broadcastWarning);\n }\n\n /**\n * Stops claiming, waits for the running jobs, runs every provider's\n * `shutdown()`, and resolves with the exit code: 0 when no job was left\n * running and every provider finished in time, 1 otherwise. Idempotent.\n *\n * `gemi start`'s drain, with the jobs where the requests were:\n * `isShuttingDown()` turns true, which stops a durable queue claiming;\n * running jobs get `timeoutMs` (`GEMI_SHUTDOWN_TIMEOUT`), which a server\n * spends on requests; then `Application.shutdown` gets `providerTimeoutMs`,\n * and in it the queue provider waits for whatever is still running and\n * names it. The two budgets add up as they do for a server, so a worker\n * fits the same grace period. `delayMs` is not waited: it is for a load\n * balancer, and nothing routes to a worker.\n */\n stop(settings: Partial<ShutdownSettings> = {}): Promise<number> {\n this.stopping ??= this.drain({ ...this.settings, ...settings });\n return this.stopping;\n }\n\n private async drain(settings: ShutdownSettings): Promise<number> {\n markShuttingDown();\n const application = this.kernel.app;\n // Resolving the manager now would build a driver only to stop it, which\n // is what a signal during the boot, before the provider resolved it, finds.\n const queue = application.resolved(QueueManager) ? application.make(QueueManager) : undefined;\n if (queue) {\n console.log(\n `[gemi] Shutting down: waiting for ${queue.running} running job(s) ` +\n `(up to ${settings.timeoutMs / 1000}s).`,\n );\n await queue.drain(settings.timeoutMs);\n }\n\n const report = await this.kernel.shutdown({ timeoutMs: settings.providerTimeoutMs });\n clearInterval(this.keepAlive);\n const clean =\n (queue?.running ?? 0) === 0 && report.failed.length === 0 && report.timedOut.length === 0;\n console.log(`[gemi] Shutdown ${clean ? \"complete\" : \"finished with errors\"}.`);\n return clean ? 0 : 1;\n }\n}\n"
8
8
  ],
9
9
  "mappings": ";gcAYA,kBCDO,OAAS,DAAuB,DAAC,AAAyC,DAC/E,CAAI,DAAC,AAAY,KAAO,IAAI,gBAAgB,EAAG,OAAO,KACtD,IAAM,EAAS,EAAY,OAAO,IAAqB,YAAa,CAAC,CAAC,EAAE,OAGxE,GAAI,EADF,IAAW,QAAa,IAAW,UAAY,aAAkB,GACtD,OAAO,KACpB,MACE,uNCFG,MAAM,UAA2B,KAAM,CAC5C,KAAO,oBACT,CAYO,MAAM,CAAY,CAWJ,OAVX,SACA,UACS,SAOjB,WAAW,CACQ,EACjB,EAAsC,CAAC,EACvC,CAFiB,cAGjB,KAAK,SAAW,IAAK,EAAiB,KAAM,CAAS,OAejD,MAAK,EAAkB,CAK3B,GAJA,MAAM,KAAK,OAAO,YAAY,EAI1B,KAAK,SAAU,OAEnB,IAAM,EAAc,KAAK,OAAO,IAGhC,GAAI,CAAC,EAAY,MAAM,CAAY,EACjC,MAAM,IAAI,EACR,+GAEF,EAEF,IAAM,EAAQ,EAAY,KAAK,CAAY,EAC3C,GAAI,CAAC,EAAM,QACT,MAAM,IAAI,EACR,8SAKF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O,MAAM,EACnB,MAAO,EAAO,CACd,GAAI,EAAE,aAAiB,GAAqB,MAAM,EAElD,OADA,QAAQ,MAAM,EAAM,OAAO,EACpB,EAGT,OAGF,EAAK,EAAE,KACL,CAAC,IAAS,CACR,GAAI,IAAS,OAAW,QAAQ,KAAK,CAAI,GAE3C,CAAC,IAAU,CACT,QAAQ,MAAM,2CAA4C,CAAK,EAC/D,QAAQ,KAAK,CAAC,EAElB",
10
- "debugId": "945B6EFFA750EB7864756E2164756E21",
10
+ "debugId": "DDC2C5523D47685664756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -0,0 +1,62 @@
1
+ import type { DatabaseConnection } from "../../database/Connection";
2
+ import type { Dialect } from "../../database/dialect";
3
+ import { type NewRunRecord, type RunFilter, type RunRecord, type RunStatus, type RunStore, type RunUpdate } from "./RunStore";
4
+ export type DatabaseRunStoreOptions = {
5
+ /**
6
+ * The table. Default `gemi_runs`. A plain identifier (letters, digits and
7
+ * underscores), because it is spliced into every statement.
8
+ */
9
+ table?: string;
10
+ };
11
+ type Connection = Pick<DatabaseConnection, "sql" | "dialect"> & Partial<Pick<DatabaseConnection, "name">>;
12
+ /**
13
+ * Runs (#908) in a table of the app's own database, so a run outlives the
14
+ * process that started it and every instance sees the same state.
15
+ *
16
+ * Written for SQLite, Postgres and MySQL 8 / MariaDB 10.6+ in raw SQL. The
17
+ * table is the app's to create: add the Prisma model from the docs, or call
18
+ * `createTable()`.
19
+ *
20
+ * - **Compare-and-set** is `UPDATE … WHERE id = ? AND status IN (…)`, so two
21
+ * instances settling one run cannot both win.
22
+ * - **Time** is epoch milliseconds from the database's clock, so every
23
+ * instance agrees on when a run is overdue.
24
+ * - **Transactions.** Inside an ORM transaction on this store's connection,
25
+ * the store writes on it, so `Runs.create` and a database-queue
26
+ * `Job.dispatch` in one transaction commit together, or not at all.
27
+ */
28
+ export declare class DatabaseRunStore implements RunStore {
29
+ readonly table: string;
30
+ private readonly sql;
31
+ private readonly dialect;
32
+ private readonly connection;
33
+ constructor(connection: Connection, options?: DatabaseRunStoreOptions);
34
+ /**
35
+ * Creates the table and its indexes if they do not exist: the DDL Prisma
36
+ * generates for the model in the docs. For tests and for an app that does
37
+ * not manage its schema with Prisma.
38
+ */
39
+ createTable(): Promise<void>;
40
+ create(run: NewRunRecord): Promise<RunRecord>;
41
+ get(id: string): Promise<RunRecord | null>;
42
+ list(filter: RunFilter): Promise<RunRecord[]>;
43
+ transition(id: string, from: readonly RunStatus[], to: RunUpdate): Promise<RunRecord | null>;
44
+ overdue(now: number, limit: number): Promise<RunRecord[]>;
45
+ now(): Promise<number>;
46
+ prune(olderThanMs: number): Promise<number>;
47
+ /** The open ORM transaction, when it is on this store's connection. */
48
+ private joinable;
49
+ /** Read at each call and never kept: a stored transaction handle outlives its transaction. */
50
+ private q;
51
+ private name;
52
+ /** The database's clock, in epoch milliseconds. As in `DatabaseQueueDriver`. */
53
+ private clock;
54
+ private ms;
55
+ }
56
+ /**
57
+ * The table as Prisma generates it for the model in the docs, with
58
+ * `IF NOT EXISTS` added.
59
+ */
60
+ export declare function createRunsTableStatements(dialect: Dialect, table: string): string[];
61
+ export {};
62
+ //# sourceMappingURL=DatabaseRunStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatabaseRunStore.d.ts","sourceRoot":"","sources":["../../../services/runs/DatabaseRunStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAIL,KAAK,YAAY,EAGjB,KAAK,SAAS,EAEd,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAIF,KAAK,UAAU,GAAG,I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ACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAmDnF"}
@@ -0,0 +1,200 @@
1
+ import type { Application } from "../../foundation/Application";
2
+ import { ChangeFeedManager } from "../change-feed/ChangeFeedManager";
3
+ import type { ChangeFeedResponse, StreamOptions } from "../change-feed/stream";
4
+ import { type Duration } from "../queue/workflow/duration";
5
+ import { type RunsConfig } from "./config";
6
+ import { type RunError, type RunFilter, type RunProgress, type RunRecord, type RunStore } from "./RunStore";
7
+ /** The longest run id or kind, in characters (a `VARCHAR(191)` column). */
8
+ export declare const MAX_RUN_ID_LENGTH = 191;
9
+ /** What `Runs.create` takes. */
10
+ export type CreateRunOptions = {
11
+ /** What kind of work it is: `"page-build"`. */
12
+ kind: string;
13
+ /** The run's id. Default: a new `run_…` id. */
14
+ id?: string;
15
+ /** What it works on, to find it again with `list`: `"site:42"`. */
16
+ subject?: string | null;
17
+ /** Who started it, as the app names them: `"user:7"`. */
18
+ owner?: string | null;
19
+ /** What the starter says about it, as JSON. Fixed once created. */
20
+ meta?: unknown;
21
+ /** How long it may take before it times out. Default: no deadline. */
22
+ deadline?: Duration | null;
23
+ /** Record it as `running` rather than `pending`. Default `false`. */
24
+ start?: boolean;
25
+ };
26
+ /** What `Runs.wait` takes. */
27
+ export type WaitOptions = {
28
+ /**
29
+ * How long to wait. When it passes, `wait` resolves to the run as it is
30
+ * then, which may still be open. Default: until the run ends.
31
+ */
32
+ timeout?: Duration;
33
+ /** Rejects `wait` with the signal's reason when it aborts. */
34
+ signal?: AbortSignal;
35
+ };
36
+ /** What `Runs.execute` hands its function. */
37
+ export type RunHandle<P = unknown> = {
38
+ readonly id: string;
39
+ /** The run as `execute` found it, once started. */
40
+ readonly record: RunRecord<unknown, P>;
41
+ /**
42
+ * Aborts when the run ends while the function is still working: it was
43
+ * cancelled, or it passed its deadline. Hand it to whatever can stop early.
44
+ */
45
+ readonly signal: AbortSignal;
46
+ /** Reports progress. Does nothing once the run has ended. */
47
+ progress(progress: RunProgress<P>): Promise<void>;
48
+ };
49
+ /** No run has this id. */
50
+ export declare class RunNotFoundError extends Error {
51
+ readonly id: string;
52
+ constructor(id: string);
53
+ }
54
+ /**
55
+ * Throw it from `Runs.execute`'s function to fail the run with this message
56
+ * and code. They go on the record as they are, and the record is streamed to
57
+ * whoever follows the run, so say only what a user may read. Any other error
58
+ * fails the run with a generic message, and is logged.
59
+ */
60
+ export declare class RunFailure extends Error {
61
+ readonly code: string | undefined;
62
+ readonly data: unknown;
63
+ constructor(message: string, options?: {
64
+ code?: string;
65
+ data?: unknown;
66
+ cause?: unknown;
67
+ });
68
+ }
69
+ /**
70
+ * Tracked background runs (#908): a record with a status machine, written by
71
+ * whoever does the work and read, waited on or streamed by whoever needs the
72
+ * outcome. Every change is published to the run's ChangeFeed channel, so a
73
+ * waiter is woken, on any instance sharing the feed, instead of polling.
74
+ *
75
+ * ```ts
76
+ * const run = await Runs.create({ kind: "page-build", subject: `site:${id}`, deadline: "10m" });
77
+ * await PageBuildJob.dispatch({ runId: run.id });
78
+ *
79
+ * // In the job:
80
+ * await Runs.execute(runId, async (run) => {
81
+ * await run.progress({ fraction: 0.5, message: "Writing copy" });
82
+ * return { pageId };
83
+ * });
84
+ *
85
+ * // Anywhere:
86
+ * const done = await Runs.wait(run.id, { timeout: "2m" });
87
+ * ```
88
+ */
89
+ export declare class RunManager {
90
+ private readonly options;
91
+ static token: string;
92
+ readonly store: RunStore;
93
+ readonly config: Required<RunsConfig>;
94
+ private ownFeed;
95
+ constructor(config?: RunsConfig, options?: {
96
+ application?: Application;
97
+ feed?: ChangeFeedManager;
98
+ });
99
+ /** The change feed runs are published to: the app's, or one of its own without an app. */
100
+ get feed(): ChangeFeedManager;
101
+ /** The ChangeFeed channel a run's changes are published to. */
102
+ channel(id: string): string;
103
+ /** Records a new run, `pending` unless `start` says otherwise. */
104
+ create<R = unknown, P = unknown>(options: CreateRunOptions): Promise<RunRecord<R, P>>;
105
+ /** The run, or `null`. */
106
+ get<R = unknown, P = unknown>(id: string): Promise<RunRecord<R, P> | null>;
107
+ /** Runs matching `filter`, newest first; at most `filter.limit` (default 50). */
108
+ list(filter?: RunFilter): Promise<RunRecord[]>;
109
+ /** `pending` → `running`. Resolves to the run, or `null` when it was not pending. */
110
+ start(id: string): Promise<RunRecord | null>;
111
+ /**
112
+ * Replaces the run's progress, and starts it if it was pending. Resolves to
113
+ * the run, or `null` when it has ended (or does not exist).
114
+ */
115
+ progress<P = unknown>(id: string, progress: RunProgress<P>): Promise<RunRecord | null>;
116
+ /** Ends the run as `completed` with `result`. `null` when it had ended already. */
117
+ complete(id: string, result?: unknown): Promise<RunRecord | null>;
118
+ /**
119
+ * Ends the run as `failed`. A string or a `RunError` is recorded as it is,
120
+ * an `Error` by its message. The record is streamed to whoever follows the
121
+ * run, so pass only what a user may read. `null` when it had ended already.
122
+ */
123
+ fail(id: string, error: string | RunError | Error): Promise<RunRecord | null>;
124
+ /**
125
+ * Ends the run as `cancelled`. A `Runs.execute` working on it sees its
126
+ * `signal` abort. `null` when it had ended already.
127
+ */
128
+ cancel(id: string, reason?: string): Promise<RunRecord | null>;
129
+ /**
130
+ * Runs `fn` as the work of run `id`: starts the run, settles it from what
131
+ * `fn` returns or throws, and aborts `run.signal` when the run is
132
+ * cancelled or passes its deadline meanwhile. Resolves to the run as it
133
+ * ended. It does not rethrow: a thrown `RunFailure` fails the run with its
134
+ * message, any other error fails it with a generic one and is logged.
135
+ *
136
+ * A run that had already ended (cancelled before the job got to it) is
137
+ * resolved as it is, without calling `fn`. A run that is already
138
+ * `running` (a retry of a job that died) is taken up again.
139
+ */
140
+ execute<R, P = unknown>(id: string, fn: (run: RunHandle<P>) => Promise<R> | R): Promise<RunRecord<R, P>>;
141
+ /**
142
+ * Resolves once run `id` has ended, to the run as it ended. With
143
+ * `timeout`, resolves when it passes to the run as it is then, which may
144
+ * still be open. A run past its deadline is timed out here, so a waiter
145
+ * never hangs on a worker that died. Rejects with `RunNotFoundError` for
146
+ * an unknown run.
147
+ */
148
+ wait<R = unknown, P = unknown>(id: string, options?: WaitOptions): Promise<RunRecord<R, P>>;
149
+ /**
150
+ * Follows run `id`: yields the run as it is now, then each newer version
151
+ * of it, and ends after the one that ended it. Iterate it with
152
+ * `for await`; breaking out or `options.signal` ends it.
153
+ */
154
+ subscribe<R = unknown, P = unknown>(id: string, options?: {
155
+ signal?: AbortSignal;
156
+ }): AsyncGenerator<RunRecord<R, P>, void, undefined>;
157
+ /**
158
+ * An SSE response following run `id`: each event's `data` is the run as
159
+ * it was published (`RunRecord`), for a route that has already decided the
160
+ * caller may read it. Resumes from `Last-Event-ID`, or `options.cursor`
161
+ * (`Runs.cursor(id)`, read when the page read the run).
162
+ */
163
+ stream(request: {
164
+ rawRequest: Request;
165
+ } | Request, id: string, options?: StreamOptions): ChangeFeedResponse<RunRecord>;
166
+ /** A cursor at the run's channel head, for a page that read the run to hand its client. */
167
+ cursor(id: string): Promise<string>;
168
+ /**
169
+ * Times out open runs past their deadline, at most `sweepLimit` of them,
170
+ * and resolves to how many. Schedule it, every minute say, so a run whose
171
+ * worker died ends even when nobody waits for it.
172
+ */
173
+ sweep(): Promise<number>;
174
+ /**
175
+ * Deletes runs that ended more than `olderThan` ago, and resolves to how
176
+ * many. Open runs are never pruned. Resolves to `0` for a store without
177
+ * `prune`.
178
+ */
179
+ prune(olderThan: Duration): Promise<number>;
180
+ /** Ends the own feed, when it made one. For tests. */
181
+ close(): Promise<void>;
182
+ private now;
183
+ /** Milliseconds until the run's deadline, on the store's clock, or `null`. */
184
+ private untilDeadline;
185
+ /** Times the run out if it is open and past its deadline. */
186
+ private expire;
187
+ /**
188
+ * Aborts `controller` once the run ends, from the feed or its deadline,
189
+ * and settles when `controller` aborts for any reason.
190
+ */
191
+ private watch;
192
+ private change;
193
+ /**
194
+ * Publishes the run to its channel. The store is the truth, so a publish
195
+ * that fails is logged rather than thrown: waiters re-read the run every
196
+ * 30 seconds whatever they hear.
197
+ */
198
+ private publish;
199
+ }
200
+ //# sourceMappingURL=RunManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RunManager.d.ts","sourceRoot":"","sources":["../../../services/runs/RunManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EAAE,iBAAiB,EAA+B,MAAM,kCAAkC,CAAC;AAClG,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,SAAS,EAEd,KAAK,QAAQ,EAEd,MAAM,YAAY,CAAC;AAEpB,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAQrC,gCAAgC;AAChC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,mEAAmE;IACnE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sEAAsE;IACtE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,WAAW,CAAC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AOtB"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Tracked background runs (#908): the record, and where it is kept.
3
+ *
4
+ * A run is a small record with a status machine. Whoever does the work (a
5
+ * queue job, a webhook, an agent job) moves it along; whoever waits for it (a
6
+ * route, an MCP tool, another job, the browser) reads it. `RunManager` builds
7
+ * the API on a store and publishes every change to the run's ChangeFeed
8
+ * channel; a store only keeps records.
9
+ */
10
+ /**
11
+ * Where a run stands.
12
+ *
13
+ * - `pending`: recorded, and nothing has started it yet.
14
+ * - `running`: started, or it reported progress.
15
+ * - `completed`, `failed`, `cancelled`, `timed_out`: final. A run that ended
16
+ * never changes again.
17
+ */
18
+ export type RunStatus = "pending" | "running" | "completed" | "failed" | "cancelled" | "timed_out";
19
+ /** The statuses a run ends in. */
20
+ export declare const FINAL_RUN_STATUSES: readonly RunStatus[];
21
+ /** The statuses a run can still move out of. */
22
+ export declare const OPEN_RUN_STATUSES: readonly RunStatus[];
23
+ /** Whether `status` is final. */
24
+ export declare function isFinalRunStatus(status: RunStatus): boolean;
25
+ /**
26
+ * What a run last said about how far it got. Each report replaces the one
27
+ * before it. Everything in it is JSON, and it is streamed to whoever follows
28
+ * the run, so keep it small.
29
+ */
30
+ export type RunProgress<P = unknown> = {
31
+ /** 0 to 1. */
32
+ fraction?: number;
33
+ /** A line for a person: "Writing copy". */
34
+ message?: string;
35
+ /** Anything else, as JSON. */
36
+ data?: P;
37
+ };
38
+ /**
39
+ * Why a run did not complete. It is part of the record, which is streamed to
40
+ * whoever follows the run, so it holds only what a user may read.
41
+ */
42
+ export type RunError = {
43
+ message: string;
44
+ /** A machine-readable reason: `"deadline"`, `"cancelled"`, `"not_found"`… */
45
+ code?: string;
46
+ data?: unknown;
47
+ };
48
+ /** One run, as the store keeps it. Times are epoch milliseconds on the store's clock. */
49
+ export type RunRecord<R = unknown, P = unknown> = {
50
+ /** `run_…`, unless `create` was given one. */
51
+ id: string;
52
+ /** What kind of work it is: `"page-build"`, `"site-import"`. */
53
+ kind: string;
54
+ /** What it works on, to find it again: `"site:42"`. */
55
+ subject: string | null;
56
+ /** Who started it, as the app names them: `"user:7"`. */
57
+ owner: string | null;
58
+ status: RunStatus;
59
+ /** What the starter said about it, as JSON. Fixed once created. */
60
+ meta: unknown;
61
+ progress: RunProgress<P> | null;
62
+ /** What it produced, once `completed`. */
63
+ result: R | null;
64
+ /** Why it ended, once `failed`, `cancelled` or `timed_out`. */
65
+ error: RunError | null;
66
+ /**
67
+ * 1 when created, and one more for each change. Changes can reach a
68
+ * follower out of order (two instances publishing at once), so a follower
69
+ * keeps the record with the highest version it saw.
70
+ */
71
+ version: number;
72
+ createdAt: number;
73
+ startedAt: number | null;
74
+ updatedAt: number;
75
+ finishedAt: number | null;
76
+ /** When the run times out if it has not ended, or `null` for never. */
77
+ deadlineAt: number | null;
78
+ };
79
+ /** What a store's `create` is given. */
80
+ export type NewRunRecord = {
81
+ id: string;
82
+ kind: string;
83
+ subject: string | null;
84
+ owner: string | null;
85
+ meta: unknown;
86
+ /** `pending`, or `running` for a run recorded by the work itself. */
87
+ status: "pending" | "running";
88
+ /** How long from now the run may take, in milliseconds, or `null`. */
89
+ deadlineMs: number | null;
90
+ };
91
+ /** The fields a transition may write. */
92
+ export type RunUpdate = {
93
+ status?: RunStatus;
94
+ progress?: RunProgress | null;
95
+ result?: unknown;
96
+ error?: RunError | null;
97
+ };
98
+ /** What `list` filters on. Every given field must match. */
99
+ export type RunFilter = {
100
+ kind?: string;
101
+ subject?: string;
102
+ owner?: string;
103
+ statuses?: readonly RunStatus[];
104
+ /** At most this many, newest first. Default 50. */
105
+ limit?: number;
106
+ };
107
+ /**
108
+ * Where runs live.
109
+ *
110
+ * `MemoryRunStore` is the default and is not durable. `DatabaseRunStore`
111
+ * keeps them in a table. An app may implement this over a table of its own.
112
+ */
113
+ export interface RunStore {
114
+ /** Writes a new run and returns it as stored. Rejects for an id already used. */
115
+ create(run: NewRunRecord): Promise<RunRecord>;
116
+ get(id: string): Promise<RunRecord | null>;
117
+ /** Runs matching `filter`, newest first. */
118
+ list(filter: RunFilter): Promise<RunRecord[]>;
119
+ /**
120
+ * Compare-and-set: applies `to` only when the run's status is one of
121
+ * `from`, and resolves to the run as it is afterwards, or `null` when it
122
+ * applied nothing. Bumps `version` and `updatedAt`; stamps `startedAt` the
123
+ * first time the status becomes `running` (or final without having run),
124
+ * and `finishedAt` when it becomes final.
125
+ */
126
+ transition(id: string, from: readonly RunStatus[], to: RunUpdate): Promise<RunRecord | null>;
127
+ /** Open runs whose `deadlineAt` is at or before `now`, oldest deadline first. */
128
+ overdue(now: number, limit: number): Promise<RunRecord[]>;
129
+ /**
130
+ * The store's clock, in epoch milliseconds, which `deadlineAt` is on.
131
+ * Optional: a store without one is compared against `Date.now()`.
132
+ */
133
+ now?(): Promise<number>;
134
+ /** Deletes runs that ended more than `olderThanMs` ago, and resolves to how many. */
135
+ prune?(olderThanMs: number): Promise<number>;
136
+ }
137
+ /**
138
+ * Runs in a map, for as long as the process lives.
139
+ *
140
+ * NOT DURABLE: a restart loses every run. It is the default so that runs
141
+ * work in development and tests without a table; use `DatabaseRunStore` in
142
+ * production. It only works when the work runs in this same process (the
143
+ * memory queue driver), since a worker in another process has a map of its
144
+ * own.
145
+ */
146
+ export declare class MemoryRunStore implements RunStore {
147
+ private readonly runs;
148
+ private clock;
149
+ /** How many runs it holds. */
150
+ get size(): number;
151
+ create(run: NewRunRecord): Promise<RunRecord>;
152
+ get(id: string): Promise<RunRecord | null>;
153
+ list(filter: RunFilter): Promise<RunRecord[]>;
154
+ transition(id: string, from: readonly RunStatus[], to: RunUpdate): Promise<RunRecord | null>;
155
+ overdue(now: number, limit: number): Promise<RunRecord[]>;
156
+ now(): Promise<number>;
157
+ prune(olderThanMs: number): Promise<number>;
158
+ /** `Date.now()`, never behind the last time it answered. */
159
+ private tick;
160
+ }
161
+ /** `filter.limit`, bounded: 50 when absent, never negative. */
162
+ export declare function listLimit(limit: number | undefined): number;
163
+ //# sourceMappingURL=RunStore.d.ts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,MAAM,EACV,IAAI,EAAE,SAAS,SAAS,EAAE,EAC1B,EAAE,EAAE,SAAS,GACZ,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAoBtB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAezD,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAItB,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYjD,4DAA4D;IAC5D,OAAO,CAAC,IAAI;CAIb;AAED,+DAA+D;AAC/D,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG3D"}
@@ -0,0 +1,5 @@
1
+ import { ServiceProvider } from "../../support/ServiceProvider";
2
+ export declare class RunsServiceProvider extends ServiceProvider {
3
+ register(): void;
4
+ }
5
+ //# sourceMappingURL=RunsServiceProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RunsServiceProvider.d.ts","sourceRoot":"","sources":["../../../services/runs/RunsServiceProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAIhE,qBAAa,mBAAoB,SAAQ,eAAe;IACtD,QAAQ;CAST"}
@@ -0,0 +1,20 @@
1
+ import type { Application } from "../../foundation/Application";
2
+ import type { RunStore } from "./RunStore";
3
+ export interface RunsConfig {
4
+ /**
5
+ * Where runs are kept: `"memory"`, `"database"`, a `RunStore`, or a
6
+ * function returning one, called once with the application.
7
+ *
8
+ * `"memory"` is the default. It is NOT durable and works for one process
9
+ * only. `"database"` keeps them in the `gemi_runs` table of the default
10
+ * connection, which has to exist. See `DatabaseRunStore`.
11
+ */
12
+ store?: "memory" | "database" | RunStore | ((application: Application) => RunStore);
13
+ /**
14
+ * How many overdue runs one `Runs.sweep()` times out at most. Default `500`.
15
+ */
16
+ sweepLimit?: number;
17
+ }
18
+ export declare function defineRunsConfig(config: RunsConfig): RunsConfig;
19
+ export declare function runsConfigDefaults(): Required<RunsConfig>;
20
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../services/runs/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,MAAM,WAAW,UAAU;IACzB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,KAAK,QAAQ,CAAC,CAAC;IAEpF;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAE/D;AAED,wBAAgB,kBAAkB,IAAI,QAAQ,CAAC,UAAU,CAAC,CAEzD"}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import"../chunk-89swy5aq.js";import M from"path";import{writeFileSync as Q}from"fs";var L=new Set(["FILE","REDIRECT"]);function H(j){return j.run(()=>{let x=[];for(let{group:z,view:D}of j.domains().viewGroups())for(let[G,B]of Object.entries(D.flatViewRoutes)){let C=D.routeManifest[G]??B.segments.map((K)=>K.viewPath);if(C.length===0||L.has(C.at(-1)))continue;x.push({path:G,group:z,views:C,...B.static?{static:{...B.static.layout?{layout:B.static.layout}:{},...B.static.navigation?{navigation:!0}:{}}}:{}})}return x})}var J=process.argv[2];async function U(){if(!J)throw Error("usage: route-table <out.json>");let j=M.resolve(process.cwd(),"app/kernel/Kernel.ts"),x=await import(j);if(typeof x.default!=="function")throw Error(`${j} has no default export (the Kernel subclass).`);let z=new x.default;z.boot();try{Q(J,JSON.stringify(H(z)))}finally{z.destroy()}}U().then(()=>process.exit(0),(j)=>{console.error(j?.stack??String(j)),process.exit(1)});
2
+ import"../chunk-xtnbcbkf.js";import M from"path";import{writeFileSync as Q}from"fs";var L=new Set(["FILE","REDIRECT"]);function H(j){return j.run(()=>{let x=[];for(let{group:z,view:D}of j.domains().viewGroups())for(let[G,B]of Object.entries(D.flatViewRoutes)){let C=D.routeManifest[G]??B.segments.map((K)=>K.viewPath);if(C.length===0||L.has(C.at(-1)))continue;x.push({path:G,group:z,views:C,...B.static?{static:{...B.static.layout?{layout:B.static.layout}:{},...B.static.navigation?{navigation:!0}:{}}}:{}})}return x})}var J=process.argv[2];async function U(){if(!J)throw Error("usage: route-table <out.json>");let j=M.resolve(process.cwd(),"app/kernel/Kernel.ts"),x=await import(j);if(typeof x.default!=="function")throw Error(`${j} has no default export (the Kernel subclass).`);let z=new x.default;z.boot();try{Q(J,JSON.stringify(H(z)))}finally{z.destroy()}}U().then(()=>process.exit(0),(j)=>{console.error(j?.stack??String(j)),process.exit(1)});
3
3
 
4
4
  //# debugId=05EB0087C5A2060D64756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Md as Y}from"../chunk-1eb4p352.js";import{oj as M}from"../chunk-nv2t87c3.js";import{qk as P,sk as R}from"../chunk-yg8se4vs.js";import"../chunk-84rbdyhe.js";import{Ik as Q,Jk as U,Kk as V,Lk as W}from"../chunk-9x0pgkns.js";import"../chunk-89swy5aq.js";class S{static token;async boot(){}static inject(){if(!this.token)throw Error(`Service [${this.name}] does not declare a \`static token\`, so the container has no key to resolve it by.`);try{return R(this)}catch(x){throw Error(`Could not inject [${this.name}]. Services are constructed when the kernel boots, so `+"inject() only works from code that runs after that \u2014 a constructor default or a method "+`body, never module top level. Check that [${this.name}] is listed in \`services\` on your Kernel.`,{cause:x})}}static with(x){let f=new this;for(let[C,g]of Object.entries(x))if(g!==void 0)f[C]=g;return f}}import{readdir as z}from"fs/promises";import{join as B,parse as j}from"path";var H=[".ts",".tsx",".js",".mjs",".jsx"];function J(x={}){let f={};for(let[C,g]of Object.entries(x))f[C]=q(g);return new P(f)}async function L(x,f=new P){let C=[];try{C=await z(x)}catch(D){return f}let g=C.filter((D)=>{let{ext:v,name:F}=j(D);return H.includes(v)&&!F.startsWith(".")}).sort();for(let D of g){let{name:v}=j(D),F=await import(B(x,D));f.set(v,q(F))}return f}function q(x){if(x&&typeof x==="object"&&"default"in x)return x.default;return x}export{M as withDefaults,Q as sourceFiles,W as projectRoot,L as loadConfigFrom,V as discoverClasses,J as createConfigRepository,Y as ServiceProvider,S as Service,P as Repository,U as DiscoveryError};
2
+ import{Nd as Y}from"../chunk-py1twqh8.js";import{Aj as M}from"../chunk-4yp84g2y.js";import{Ck as P,Ek as R}from"../chunk-cp84b0ev.js";import"../chunk-njaxnv6c.js";import{Uk as Q,Vk as U,Wk as V,Xk as W}from"../chunk-ty5sp1ym.js";import"../chunk-xtnbcbkf.js";class S{static token;async boot(){}static inject(){if(!this.token)throw Error(`Service [${this.name}] does not declare a \`static token\`, so the container has no key to resolve it by.`);try{return R(this)}catch(x){throw Error(`Could not inject [${this.name}]. Services are constructed when the kernel boots, so `+"inject() only works from code that runs after that \u2014 a constructor default or a method "+`body, never module top level. Check that [${this.name}] is listed in \`services\` on your Kernel.`,{cause:x})}}static with(x){let f=new this;for(let[C,g]of Object.entries(x))if(g!==void 0)f[C]=g;return f}}import{readdir as z}from"fs/promises";import{join as B,parse as j}from"path";var H=[".ts",".tsx",".js",".mjs",".jsx"];function J(x={}){let f={};for(let[C,g]of Object.entries(x))f[C]=q(g);return new P(f)}async function L(x,f=new P){let C=[];try{C=await z(x)}catch(D){return f}let g=C.filter((D)=>{let{ext:v,name:F}=j(D);return H.includes(v)&&!F.startsWith(".")}).sort();for(let D of g){let{name:v}=j(D),F=await import(B(x,D));f.set(v,q(F))}return f}function q(x){if(x&&typeof x==="object"&&"default"in x)return x.default;return x}export{M as withDefaults,Q as sourceFiles,W as projectRoot,L as loadConfigFrom,V as discoverClasses,J as createConfigRepository,Y as ServiceProvider,S as Service,P as Repository,U as DiscoveryError};
3
3
 
4
- //# debugId=13034064929A5E4F64756E2164756E21
4
+ //# debugId=D730E9098CDA427664756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "import { readdir } from \"node:fs/promises\";\nimport { join, parse } from \"node:path\";\n\nimport { Repository } from \"./Repository\";\n\nconst CONFIG_EXTENSIONS = [\".ts\", \".tsx\", \".js\", \".mjs\", \".jsx\"];\n\n// Builds a Repository from an already-imported map of config modules. The map\n// key becomes the top-level config key, so `{ mail: mailModule }` is readable\n// as `config.get(\"mail.driver\")`. Each entry may be either the module namespace\n// (its `default` export is unwrapped) or the config object itself.\nexport function createConfigRepository(\n modules: Record<string, any> = {},\n): Repository {\n const items: Record<string, any> = {};\n\n for (const [key, mod] of Object.entries(modules)) {\n items[key] = unwrap(mod);\n }\n\n return new Repository(items);\n}\n\n// Reads every config module in an app's `app/config` directory into a\n// Repository. The file's basename is the top-level key: `app/config/mail.ts`\n// populates `mail.*`. A missing directory yields an empty Repository so apps\n// that declare no config still boot.\nexport async function loadConfigFrom(\n directory: string,\n repository = new Repository(),\n): Promise<Repository> {\n let entries: string[] = [];\n\n try {\n entries = await readdir(directory);\n } catch (err) {\n return repository;\n }\n\n const files = entries\n .filter((entry) => {\n const { ext, name } = parse(entry);\n return CONFIG_EXTENSIONS.includes(ext) && !name.startsWith(\".\");\n })\n .sort();\n\n for (const file of files) {\n const { name } = parse(file);\n const mod = await import(join(directory, file));\n repository.set(name, unwrap(mod));\n }\n\n return repository;\n}\n\nfunction unwrap(mod: any) {\n if (mod && typeof mod === \"object\" && \"default\" in mod) {\n return mod.default;\n }\n return mod;\n}\n"
7
7
  ],
8
8
  "mappings": ";2RAgCO,CAAe,JAAQ,EAOrB,OAMD,AAAI,EAAkB,QAmBrB,OAAS,EAKX,CACH,GAAI,CAAC,KAAK,MACR,MAAU,MACR,YAAY,KAAK,0FACnB,EAGF,GAAI,CACF,OAAO,EAAI,IAAuB,EAClC,MAAO,EAAO,CACd,MAAU,MACR,qBAAqB,KAAK,6DACxB,+FACA,6CAA6C,KAAK,kDAEpD,CAAE,OAAM,CACV,SAoBG,KAAuB,CAAoB,EAA0B,CAC1E,IAAM,EAAW,IAAI,KACrB,QAAY,EAAK,KAAU,OAAO,QAAQ,CAAS,EACjD,GAAI,IAAU,OAAW,EAAS,GAAO,EAE3C,OAAO,EAEX,CChHA,kBAAS,oBACT,eAAS,WAAM,aAIf,IAAM,EAAoB,CAAC,MAAO,OAAQ,MAAO,OAAQ,MAAM,EAMxD,SAAS,CAAsB,CACpC,EAA+B,CAAC,EACpB,CACZ,IAAM,EAA6B,CAAC,EAEpC,QAAY,EAAK,KAAQ,OAAO,QAAQ,CAAO,EAC7C,EAAM,GAAO,EAAO,CAAG,EAGzB,OAAO,IAAI,EAAW,CAAK,EAO7B,eAAsB,CAAc,CAClC,EACA,EAAa,IAAI,EACI,CACrB,IAAI,EAAoB,CAAC,EAEzB,GAAI,CACF,EAAU,MAAM,EAAQ,CAAS,EACjC,MAAO,EAAK,CACZ,OAAO,EAGT,IAAM,EAAQ,EACX,OAAO,CAAC,IAAU,CACjB,IAAQ,MAAK,QAAS,EAAM,CAAK,EACjC,OAAO,EAAkB,SAAS,CAAG,GAAK,CAAC,EAAK,WAAW,GAAG,EAC/D,EACA,KAAK,EAER,QAAW,KAAQ,EAAO,CACxB,IAAQ,QAAS,EAAM,CAAI,EACrB,EAAM,MAAa,SAAK,EAAW,CAAI,GAC7C,EAAW,IAAI,EAAM,EAAO,CAAG,CAAC,EAGlC,OAAO,EAGT,SAAS,CAAM,CAAC,EAAU,CACxB,GAAI,GAAO,OAAO,IAAQ,UAAY,YAAa,EACjD,OAAO,EAAI,QAEb,OAAO",
9
- "debugId": "13034064929A5E4F64756E2164756E21",
9
+ "debugId": "D730E9098CDA427664756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../testing/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EACl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;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,iBAAiB,CAAC,SAAS,CAAC,4CA4RvD,CAAC"}
@@ -1,4 +1,5 @@
1
- import { D as I18nProvider, F as createMemoryHistory, I as RealtimeContext, K as QueryManagerContext, L as channelKey, N as ProgressManager, O as ServerDataContext, P as Action, U as toVariantKey, W as applyParams, i as RouteTransitionProvider, nt as Subject, o as ClientRouterContext, q as QueryManagerProvider, r as m, t as ThemeProvider } from "../chunks/ThemeProvider-BIrCSrFY.js";
1
+ import { t as live_exports } from "../chunks/live-DIUDdLrA.js";
2
+ import { A as ServerDataContext, F as ProgressManager, I as Action, K as toVariantKey, L as createMemoryHistory, R as RealtimeContext, W as provideLiveModule, X as QueryManagerProvider, Y as QueryManagerContext, at as Subject, c as ClientRouterContext, i as RouteTransitionProvider, k as I18nProvider, q as applyParams, r as m, t as ThemeProvider, z as channelKey } from "../chunks/ThemeProvider-DaX0eyqs.js";
2
3
  import { r as RouteStateProvider } from "../chunks/useParams-BN3XXfmG.js";
3
4
  import { Suspense, createElement, useContext, useMemo, useRef, useState } from "react";
4
5
  import { jsx } from "react/jsx-runtime";
@@ -166,6 +167,7 @@ function fakeSocket() {
166
167
  }
167
168
  //#endregion
168
169
  //#region testing/Page.tsx
170
+ provideLiveModule(live_exports);
169
171
  /** `"?a=b"` (or `""`) from any of the shapes `searchParams` accepts. */
170
172
  function toSearchString(search) {
171
173
  if (!search) return "";