gemi 0.122.0 → 0.123.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 (297) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai/index.js.map +1 -1
  3. package/dist/app/App.d.ts +9 -0
  4. package/dist/app/App.d.ts.map +1 -1
  5. package/dist/app/index.js +1 -1
  6. package/dist/auth/AuthController.d.ts.map +1 -1
  7. package/dist/bin/gemi.js +4 -1
  8. package/dist/bin/gemi.js.map +3 -3
  9. package/dist/bun/plugin.js +1 -1
  10. package/dist/bun/preload.js +1 -1
  11. package/dist/{chunk-dwedx1jb.js → chunk-08fcqny0.js} +3 -3
  12. package/dist/{chunk-dwedx1jb.js.map → chunk-08fcqny0.js.map} +1 -1
  13. package/dist/{chunk-vx7hvyvq.js → chunk-0qmc7snf.js} +2 -2
  14. package/dist/{chunk-vx7hvyvq.js.map → chunk-0qmc7snf.js.map} +1 -1
  15. package/dist/{chunk-qy8c0gzr.js → chunk-0tc0j3pf.js} +2 -2
  16. package/dist/{chunk-qy8c0gzr.js.map → chunk-0tc0j3pf.js.map} +1 -1
  17. package/dist/{chunk-meg8rtr6.js → chunk-1f1sb3w7.js} +2 -2
  18. package/dist/{chunk-meg8rtr6.js.map → chunk-1f1sb3w7.js.map} +1 -1
  19. package/dist/{chunk-d5f1m3d2.js → chunk-1kdga1b2.js} +2 -2
  20. package/dist/{chunk-d5f1m3d2.js.map → chunk-1kdga1b2.js.map} +1 -1
  21. package/dist/{chunk-48gmyaxc.js → chunk-2amj1eyp.js} +2 -2
  22. package/dist/{chunk-48gmyaxc.js.map → chunk-2amj1eyp.js.map} +1 -1
  23. package/dist/chunk-2vc72qez.js +9 -0
  24. package/dist/chunk-2vc72qez.js.map +10 -0
  25. package/dist/{chunk-9xyxbxgk.js → chunk-30xxc6r7.js} +2 -2
  26. package/dist/{chunk-9xyxbxgk.js.map → chunk-30xxc6r7.js.map} +1 -1
  27. package/dist/chunk-39dx7xrz.js +10 -0
  28. package/dist/{chunk-dyp0wg9e.js.map → chunk-39dx7xrz.js.map} +8 -4
  29. package/dist/{chunk-dhbgrv58.js → chunk-4qpypa3h.js} +1 -1
  30. package/dist/{chunk-wqe47c0j.js → chunk-52xkw2bs.js} +2 -2
  31. package/dist/{chunk-wqe47c0j.js.map → chunk-52xkw2bs.js.map} +1 -1
  32. package/dist/{chunk-3gsv1vv1.js → chunk-53hc0ah1.js} +2 -2
  33. package/dist/{chunk-3gsv1vv1.js.map → chunk-53hc0ah1.js.map} +1 -1
  34. package/dist/{chunk-qsz9241c.js → chunk-58ffbwdc.js} +2 -2
  35. package/dist/{chunk-qsz9241c.js.map → chunk-58ffbwdc.js.map} +1 -1
  36. package/dist/{chunk-0ejjgzwc.js → chunk-5a4qbtez.js} +2 -2
  37. package/dist/{chunk-0ejjgzwc.js.map → chunk-5a4qbtez.js.map} +1 -1
  38. package/dist/{chunk-7mmw0jr2.js → chunk-675kzd7z.js} +2 -2
  39. package/dist/{chunk-7mmw0jr2.js.map → chunk-675kzd7z.js.map} +1 -1
  40. package/dist/{chunk-dedqr5wb.js → chunk-6gjvqtcp.js} +2 -2
  41. package/dist/{chunk-dedqr5wb.js.map → chunk-6gjvqtcp.js.map} +1 -1
  42. package/dist/{chunk-6yhpprzs.js → chunk-6pxavyh3.js} +2 -2
  43. package/dist/{chunk-6yhpprzs.js.map → chunk-6pxavyh3.js.map} +1 -1
  44. package/dist/{chunk-h43jp8ws.js → chunk-73v34hw8.js} +2 -2
  45. package/dist/{chunk-h43jp8ws.js.map → chunk-73v34hw8.js.map} +1 -1
  46. package/dist/{chunk-wjkh2gem.js → chunk-8x73yyfs.js} +1 -1
  47. package/dist/{chunk-yds7zwc3.js → chunk-96a1459v.js} +2 -2
  48. package/dist/{chunk-yds7zwc3.js.map → chunk-96a1459v.js.map} +1 -1
  49. package/dist/{chunk-d2c3947c.js → chunk-9a9ef0f1.js} +2 -2
  50. package/dist/{chunk-d2c3947c.js.map → chunk-9a9ef0f1.js.map} +1 -1
  51. package/dist/{chunk-ep0baa9g.js → chunk-9p7eq7bz.js} +2 -2
  52. package/dist/{chunk-ep0baa9g.js.map → chunk-9p7eq7bz.js.map} +1 -1
  53. package/dist/chunk-9t08wbkd.js +58 -0
  54. package/dist/{chunk-3rvn9a76.js.map → chunk-9t08wbkd.js.map} +3 -3
  55. package/dist/{chunk-pn2x59ge.js → chunk-aafanq8n.js} +3 -3
  56. package/dist/{chunk-pn2x59ge.js.map → chunk-aafanq8n.js.map} +1 -1
  57. package/dist/{chunk-tewhms9w.js → chunk-ay8nat73.js} +2 -2
  58. package/dist/{chunk-tewhms9w.js.map → chunk-ay8nat73.js.map} +1 -1
  59. package/dist/{chunk-shfe0b22.js → chunk-bk2aheea.js} +2 -2
  60. package/dist/{chunk-shfe0b22.js.map → chunk-bk2aheea.js.map} +1 -1
  61. package/dist/{chunk-mr94nfp1.js → chunk-d0wr9jk4.js} +3 -3
  62. package/dist/{chunk-mr94nfp1.js.map → chunk-d0wr9jk4.js.map} +1 -1
  63. package/dist/chunk-d3ywmeb7.js +4 -0
  64. package/dist/chunk-d3ywmeb7.js.map +10 -0
  65. package/dist/{chunk-zefs2b6h.js → chunk-de7hxe73.js} +2 -2
  66. package/dist/{chunk-zefs2b6h.js.map → chunk-de7hxe73.js.map} +1 -1
  67. package/dist/{chunk-er8acmch.js → chunk-dmj6ysym.js} +2 -2
  68. package/dist/{chunk-er8acmch.js.map → chunk-dmj6ysym.js.map} +1 -1
  69. package/dist/{chunk-rhek27sj.js → chunk-ebx5hnqn.js} +3 -3
  70. package/dist/{chunk-rhek27sj.js.map → chunk-ebx5hnqn.js.map} +1 -1
  71. package/dist/chunk-eevna943.js +5 -0
  72. package/dist/chunk-eevna943.js.map +10 -0
  73. package/dist/{chunk-9rr5h818.js → chunk-enta97jb.js} +3 -3
  74. package/dist/{chunk-9rr5h818.js.map → chunk-enta97jb.js.map} +1 -1
  75. package/dist/{chunk-s5k3yq6t.js → chunk-f1thqe6j.js} +2 -2
  76. package/dist/{chunk-s5k3yq6t.js.map → chunk-f1thqe6j.js.map} +1 -1
  77. package/dist/{chunk-zrcd9hxr.js → chunk-fsy344zb.js} +2 -2
  78. package/dist/{chunk-zrcd9hxr.js.map → chunk-fsy344zb.js.map} +1 -1
  79. package/dist/{chunk-gemzbw7f.js → chunk-fxxbwyce.js} +2 -2
  80. package/dist/{chunk-gemzbw7f.js.map → chunk-fxxbwyce.js.map} +1 -1
  81. package/dist/{chunk-1wnnkde0.js → chunk-fyk07w01.js} +3 -3
  82. package/dist/{chunk-1wnnkde0.js.map → chunk-fyk07w01.js.map} +1 -1
  83. package/dist/chunk-gvp6brdt.js +57 -0
  84. package/dist/{chunk-3s21p9n2.js.map → chunk-gvp6brdt.js.map} +19 -9
  85. package/dist/{chunk-7g649j8h.js → chunk-gwnmgkq5.js} +2 -2
  86. package/dist/{chunk-7g649j8h.js.map → chunk-gwnmgkq5.js.map} +1 -1
  87. package/dist/{chunk-51w5ktv2.js → chunk-h76mddt3.js} +2 -2
  88. package/dist/{chunk-51w5ktv2.js.map → chunk-h76mddt3.js.map} +1 -1
  89. package/dist/{chunk-nz8z8jr1.js → chunk-hnrzm5pf.js} +3 -3
  90. package/dist/{chunk-nz8z8jr1.js.map → chunk-hnrzm5pf.js.map} +1 -1
  91. package/dist/{chunk-3wnghdsx.js → chunk-hs88b8gt.js} +2 -2
  92. package/dist/{chunk-3wnghdsx.js.map → chunk-hs88b8gt.js.map} +1 -1
  93. package/dist/{chunk-0k02tza1.js → chunk-j0cnsgjq.js} +1 -1
  94. package/dist/{chunk-pemhmjzp.js → chunk-j8vc3bze.js} +3 -3
  95. package/dist/{chunk-pemhmjzp.js.map → chunk-j8vc3bze.js.map} +1 -1
  96. package/dist/{chunk-471htqmz.js → chunk-k17wx7gz.js} +2 -2
  97. package/dist/{chunk-471htqmz.js.map → chunk-k17wx7gz.js.map} +1 -1
  98. package/dist/{chunk-m83zm86m.js → chunk-kc924zjz.js} +2 -2
  99. package/dist/{chunk-m83zm86m.js.map → chunk-kc924zjz.js.map} +1 -1
  100. package/dist/{chunk-5nj94s66.js → chunk-kdjhgtp9.js} +4 -4
  101. package/dist/{chunk-5nj94s66.js.map → chunk-kdjhgtp9.js.map} +1 -1
  102. package/dist/{chunk-32n8t8x6.js → chunk-kvas36p6.js} +2 -2
  103. package/dist/{chunk-32n8t8x6.js.map → chunk-kvas36p6.js.map} +1 -1
  104. package/dist/{chunk-4fx8p02c.js → chunk-kzstewtm.js} +2 -2
  105. package/dist/{chunk-4fx8p02c.js.map → chunk-kzstewtm.js.map} +1 -1
  106. package/dist/{chunk-gc2dz11k.js → chunk-mxbtcaed.js} +2 -2
  107. package/dist/{chunk-gc2dz11k.js.map → chunk-mxbtcaed.js.map} +1 -1
  108. package/dist/{chunk-cca0grq3.js → chunk-n1a2zj5z.js} +2 -2
  109. package/dist/{chunk-cca0grq3.js.map → chunk-n1a2zj5z.js.map} +1 -1
  110. package/dist/{chunk-0yj0s1pn.js → chunk-nf608sb1.js} +2 -2
  111. package/dist/{chunk-0yj0s1pn.js.map → chunk-nf608sb1.js.map} +1 -1
  112. package/dist/{chunk-19dpzp4y.js → chunk-nvngb4ed.js} +3 -3
  113. package/dist/{chunk-19dpzp4y.js.map → chunk-nvngb4ed.js.map} +1 -1
  114. package/dist/{chunk-cskqet01.js → chunk-pfm9ngch.js} +2 -2
  115. package/dist/{chunk-cskqet01.js.map → chunk-pfm9ngch.js.map} +1 -1
  116. package/dist/{chunk-fenc5tpv.js → chunk-q1e3q01h.js} +2 -2
  117. package/dist/{chunk-fenc5tpv.js.map → chunk-q1e3q01h.js.map} +1 -1
  118. package/dist/{chunk-2c0s0561.js → chunk-qen6587t.js} +2 -2
  119. package/dist/{chunk-2c0s0561.js.map → chunk-qen6587t.js.map} +1 -1
  120. package/dist/{chunk-r01aqf0q.js → chunk-r5tadf14.js} +2 -2
  121. package/dist/{chunk-r01aqf0q.js.map → chunk-r5tadf14.js.map} +1 -1
  122. package/dist/{chunk-cvr5624r.js → chunk-rjm1kj8n.js} +1 -1
  123. package/dist/{chunk-jaa6xkeh.js → chunk-rjtmgbay.js} +2 -2
  124. package/dist/{chunk-jaa6xkeh.js.map → chunk-rjtmgbay.js.map} +1 -1
  125. package/dist/{chunk-rhvc1axc.js → chunk-rkgsvsrj.js} +2 -2
  126. package/dist/{chunk-rhvc1axc.js.map → chunk-rkgsvsrj.js.map} +1 -1
  127. package/dist/{chunk-m53fgf20.js → chunk-s5jxc63j.js} +3 -3
  128. package/dist/{chunk-m53fgf20.js.map → chunk-s5jxc63j.js.map} +1 -1
  129. package/dist/{chunk-5tdxbwzg.js → chunk-sxa70wgn.js} +3 -3
  130. package/dist/{chunk-5tdxbwzg.js.map → chunk-sxa70wgn.js.map} +1 -1
  131. package/dist/chunk-tazvfppr.js +5 -0
  132. package/dist/{chunk-htgmy3x7.js.map → chunk-tazvfppr.js.map} +1 -1
  133. package/dist/{chunk-gy81nd9a.js → chunk-vd6zn8c4.js} +2 -2
  134. package/dist/{chunk-gy81nd9a.js.map → chunk-vd6zn8c4.js.map} +1 -1
  135. package/dist/chunk-vpgbn494.js +24 -0
  136. package/dist/{chunk-2yw4yezc.js.map → chunk-vpgbn494.js.map} +3 -3
  137. package/dist/{chunk-7ftj43vp.js → chunk-vwnd4jb5.js} +2 -2
  138. package/dist/{chunk-7ftj43vp.js.map → chunk-vwnd4jb5.js.map} +1 -1
  139. package/dist/{chunk-c0v61fp5.js → chunk-w0jfqnw9.js} +2 -2
  140. package/dist/{chunk-c0v61fp5.js.map → chunk-w0jfqnw9.js.map} +1 -1
  141. package/dist/{chunk-65beps2q.js → chunk-w61sphn5.js} +3 -3
  142. package/dist/{chunk-65beps2q.js.map → chunk-w61sphn5.js.map} +1 -1
  143. package/dist/{chunk-zg6hmc48.js → chunk-wqharhrp.js} +1 -1
  144. package/dist/{chunk-sx340k85.js → chunk-x0jahbqj.js} +2 -2
  145. package/dist/{chunk-sx340k85.js.map → chunk-x0jahbqj.js.map} +1 -1
  146. package/dist/{chunk-y6wt5b6t.js → chunk-xhmtph39.js} +1 -1
  147. package/dist/{chunk-c7qs1xp3.js → chunk-y67evsdy.js} +2 -2
  148. package/dist/{chunk-c7qs1xp3.js.map → chunk-y67evsdy.js.map} +1 -1
  149. package/dist/{chunk-krk7mcgm.js → chunk-ycsrpf47.js} +3 -3
  150. package/dist/{chunk-krk7mcgm.js.map → chunk-ycsrpf47.js.map} +1 -1
  151. package/dist/{chunk-9d2d08qm.js → chunk-ywgvxx35.js} +2 -2
  152. package/dist/{chunk-9d2d08qm.js.map → chunk-ywgvxx35.js.map} +1 -1
  153. package/dist/{chunk-4acpw92g.js → chunk-z23h4s1a.js} +3 -3
  154. package/dist/{chunk-4acpw92g.js.map → chunk-z23h4s1a.js.map} +1 -1
  155. package/dist/{chunk-tk135gmj.js → chunk-zjej5vqh.js} +3 -3
  156. package/dist/{chunk-tk135gmj.js.map → chunk-zjej5vqh.js.map} +1 -1
  157. package/dist/chunks/{ThemeProvider-BLI4zpLu.js → ThemeProvider-CgK2mmVV.js} +576 -2
  158. package/dist/chunks/ThemeProvider-CgK2mmVV.js.map +1 -0
  159. package/dist/client/auth/useEmailCode.d.ts.map +1 -1
  160. package/dist/client/auth/useSignIn.d.ts.map +1 -1
  161. package/dist/client/auth/useSignOut.d.ts.map +1 -1
  162. package/dist/client/index.d.ts +5 -1
  163. package/dist/client/index.d.ts.map +1 -1
  164. package/dist/client/index.js +216 -8
  165. package/dist/client/index.js.map +1 -1
  166. package/dist/client/init.d.ts +8 -0
  167. package/dist/client/init.d.ts.map +1 -1
  168. package/dist/client/realtime/FakeSocket.d.ts +47 -0
  169. package/dist/client/realtime/FakeSocket.d.ts.map +1 -0
  170. package/dist/client/realtime/RealtimeClient.d.ts +162 -0
  171. package/dist/client/realtime/RealtimeClient.d.ts.map +1 -0
  172. package/dist/client/realtime/RealtimeContext.d.ts +8 -0
  173. package/dist/client/realtime/RealtimeContext.d.ts.map +1 -0
  174. package/dist/client/realtime/useChannelSubscription.d.ts +32 -0
  175. package/dist/client/realtime/useChannelSubscription.d.ts.map +1 -0
  176. package/dist/client/rpc.d.ts +11 -0
  177. package/dist/client/rpc.d.ts.map +1 -1
  178. package/dist/client/useChannel.d.ts +87 -0
  179. package/dist/client/useChannel.d.ts.map +1 -0
  180. package/dist/client/useMutation.d.ts.map +1 -1
  181. package/dist/client/useQuery.d.ts +13 -0
  182. package/dist/client/useQuery.d.ts.map +1 -1
  183. package/dist/config/index.js +1 -1
  184. package/dist/console/run.js +2 -2
  185. package/dist/console/run.js.map +1 -1
  186. package/dist/container/index.js +2 -2
  187. package/dist/container/index.js.map +1 -1
  188. package/dist/database/index.js +2 -2
  189. package/dist/database/index.js.map +1 -1
  190. package/dist/email/index.js +2 -2
  191. package/dist/email/index.js.map +1 -1
  192. package/dist/facades/Broadcast.d.ts +68 -0
  193. package/dist/facades/Broadcast.d.ts.map +1 -0
  194. package/dist/facades/index.d.ts +1 -0
  195. package/dist/facades/index.d.ts.map +1 -1
  196. package/dist/facades/index.js +2 -2
  197. package/dist/facades/index.js.map +1 -1
  198. package/dist/foundation/index.js +2 -2
  199. package/dist/foundation/index.js.map +1 -1
  200. package/dist/gemi.d.ts +19 -6
  201. package/dist/http/ChannelRouter.d.ts +171 -0
  202. package/dist/http/ChannelRouter.d.ts.map +1 -0
  203. package/dist/http/index.d.ts +1 -0
  204. package/dist/http/index.d.ts.map +1 -1
  205. package/dist/http/index.js +2 -2
  206. package/dist/http/index.js.map +1 -1
  207. package/dist/i18n/dictionaryRuntime.js +2 -2
  208. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  209. package/dist/i18n/index.js +2 -2
  210. package/dist/i18n/index.js.map +1 -1
  211. package/dist/kernel/Kernel.d.ts +6 -0
  212. package/dist/kernel/Kernel.d.ts.map +1 -1
  213. package/dist/kernel/index.js +3 -3
  214. package/dist/kernel/index.js.map +5 -6
  215. package/dist/kernel/providers.d.ts +2 -2
  216. package/dist/kernel/providers.d.ts.map +1 -1
  217. package/dist/orm/context.d.ts.map +1 -1
  218. package/dist/orm/index.js +2 -2
  219. package/dist/orm/index.js.map +1 -1
  220. package/dist/server/Server.d.ts.map +1 -1
  221. package/dist/server/httpDev.d.ts +1 -2
  222. package/dist/server/httpDev.d.ts.map +1 -1
  223. package/dist/server/httpProd.d.ts +1 -1
  224. package/dist/server/httpProd.d.ts.map +1 -1
  225. package/dist/server/index.js +2 -2
  226. package/dist/server/index.js.map +3 -3
  227. package/dist/server/shutdown.d.ts +9 -0
  228. package/dist/server/shutdown.d.ts.map +1 -1
  229. package/dist/services/broadcast/BroadcastDriver.d.ts +73 -0
  230. package/dist/services/broadcast/BroadcastDriver.d.ts.map +1 -0
  231. package/dist/services/broadcast/BroadcastEvent.d.ts +67 -0
  232. package/dist/services/broadcast/BroadcastEvent.d.ts.map +1 -0
  233. package/dist/services/broadcast/BroadcastManager.d.ts +148 -0
  234. package/dist/services/broadcast/BroadcastManager.d.ts.map +1 -0
  235. package/dist/services/broadcast/BroadcastServiceProvider.d.ts +16 -0
  236. package/dist/services/broadcast/BroadcastServiceProvider.d.ts.map +1 -0
  237. package/dist/services/broadcast/FakeBroadcastManager.d.ts +45 -0
  238. package/dist/services/broadcast/FakeBroadcastManager.d.ts.map +1 -0
  239. package/dist/services/broadcast/MemoryBroadcastDriver.d.ts +23 -0
  240. package/dist/services/broadcast/MemoryBroadcastDriver.d.ts.map +1 -0
  241. package/dist/services/broadcast/SocketHub.d.ts +192 -0
  242. package/dist/services/broadcast/SocketHub.d.ts.map +1 -0
  243. package/dist/services/broadcast/brand.d.ts +16 -0
  244. package/dist/services/broadcast/brand.d.ts.map +1 -0
  245. package/dist/services/broadcast/channels.d.ts +77 -0
  246. package/dist/services/broadcast/channels.d.ts.map +1 -0
  247. package/dist/services/broadcast/config.d.ts +93 -0
  248. package/dist/services/broadcast/config.d.ts.map +1 -0
  249. package/dist/services/broadcast/protocol.d.ts +123 -0
  250. package/dist/services/broadcast/protocol.d.ts.map +1 -0
  251. package/dist/services/broadcast/socketTag.d.ts +17 -0
  252. package/dist/services/broadcast/socketTag.d.ts.map +1 -0
  253. package/dist/services/broadcast/types.d.ts +27 -0
  254. package/dist/services/broadcast/types.d.ts.map +1 -0
  255. package/dist/services/broadcast/wire.d.ts +35 -0
  256. package/dist/services/broadcast/wire.d.ts.map +1 -0
  257. package/dist/services/events/EventManager.d.ts +6 -0
  258. package/dist/services/events/EventManager.d.ts.map +1 -1
  259. package/dist/services/index.d.ts +9 -0
  260. package/dist/services/index.d.ts.map +1 -1
  261. package/dist/services/index.js +9 -9
  262. package/dist/services/index.js.map +4 -3
  263. package/dist/services/queue/work.js +2 -2
  264. package/dist/services/queue/work.js.map +1 -1
  265. package/dist/services/router/config.d.ts +7 -0
  266. package/dist/services/router/config.d.ts.map +1 -1
  267. package/dist/stats/route-table.js +1 -1
  268. package/dist/support/index.js +2 -2
  269. package/dist/support/index.js.map +1 -1
  270. package/dist/testing/Page.d.ts +8 -0
  271. package/dist/testing/Page.d.ts.map +1 -1
  272. package/dist/testing/index.d.ts +2 -0
  273. package/dist/testing/index.d.ts.map +1 -1
  274. package/dist/testing/index.js +174 -8
  275. package/dist/testing/index.js.map +1 -1
  276. package/dist/vitest/index.js +1 -1
  277. package/package.json +1 -1
  278. package/skills/gemi-react-best-practices/SKILL.md +3 -1
  279. package/skills/gemi-react-best-practices/rules/query-live-over-polling.md +56 -0
  280. package/dist/chunk-2n3pgfnb.js +0 -5
  281. package/dist/chunk-2n3pgfnb.js.map +0 -10
  282. package/dist/chunk-2yw4yezc.js +0 -24
  283. package/dist/chunk-3rvn9a76.js +0 -58
  284. package/dist/chunk-3s21p9n2.js +0 -57
  285. package/dist/chunk-dyp0wg9e.js +0 -10
  286. package/dist/chunk-htgmy3x7.js +0 -5
  287. package/dist/chunk-krtybgz1.js +0 -4
  288. package/dist/chunk-krtybgz1.js.map +0 -10
  289. package/dist/chunk-s07v65x6.js +0 -9
  290. package/dist/chunk-s07v65x6.js.map +0 -10
  291. package/dist/chunks/ThemeProvider-BLI4zpLu.js.map +0 -1
  292. /package/dist/{chunk-dhbgrv58.js.map → chunk-4qpypa3h.js.map} +0 -0
  293. /package/dist/{chunk-wjkh2gem.js.map → chunk-8x73yyfs.js.map} +0 -0
  294. /package/dist/{chunk-0k02tza1.js.map → chunk-j0cnsgjq.js.map} +0 -0
  295. /package/dist/{chunk-cvr5624r.js.map → chunk-rjm1kj8n.js.map} +0 -0
  296. /package/dist/{chunk-zg6hmc48.js.map → chunk-wqharhrp.js.map} +0 -0
  297. /package/dist/{chunk-y6wt5b6t.js.map → chunk-xhmtph39.js.map} +0 -0
@@ -726,6 +726,580 @@ function toVariantKey(search) {
726
726
  return searchParams.toString();
727
727
  }
728
728
  //#endregion
729
+ //#region services/broadcast/protocol.ts
730
+ /**
731
+ * The `gemi.v1` WebSocket protocol, shared by the server transport
732
+ * (`SocketHub`) and the browser client (`gemi/client`'s connection manager).
733
+ * Types and constants only: this module is imported by the browser bundle, so
734
+ * it must never import a server module.
735
+ *
736
+ * Every frame is a JSON text frame. Binary frames are refused.
737
+ *
738
+ * From the client:
739
+ *
740
+ * - `{op:"sub", id, ch, p?}`: subscribe `id` (chosen by the client, unique per
741
+ * socket) to the channel pattern `ch` with params `p`. The server builds
742
+ * the topic and authorizes it.
743
+ * - `{op:"unsub", id}`
744
+ * - `{op:"ping"}`: answered with `pong`. The client sends one every
745
+ * `heartbeatMs` and reconnects when it hears nothing for twice that.
746
+ *
747
+ * From the server:
748
+ *
749
+ * - `{op:"hello", socketId, tag, heartbeatMs}`: the first frame. `socketId`
750
+ * goes in the `X-Gemi-Socket` header of the client's own requests (for
751
+ * `Broadcast.toOthers`); it is never shown to anyone else. `tag` is what
752
+ * an event frame's `x` carries when it skips this socket.
753
+ * - `{op:"subscribed", id, t}`: `id` joined topic `t`. Sent only once this
754
+ * process receives the topic's events, so the resync the client runs on it
755
+ * cannot miss one.
756
+ * - `{op:"denied", id, code}`: `id` was refused, or later revoked.
757
+ * - `{op:"ev", t, ev, d?, x?}`: an event on topic `t`. Dropped by the socket
758
+ * whose `tag` is `x`.
759
+ * - `{op:"gap"}`: events may have been lost for this socket; resync all.
760
+ * - `{op:"pong"}`
761
+ * - `{op:"bye", code, retryAfter}`: the server is going away (a restart).
762
+ * Reconnect after `retryAfter` ms.
763
+ */
764
+ /** The WebSocket subprotocol. */
765
+ var BROADCAST_PROTOCOL = "gemi.v1";
766
+ /** The request header a client sends its socket id in, for `toOthers`. */
767
+ var SOCKET_ID_HEADER = "x-gemi-socket";
768
+ /**
769
+ * Close codes the server uses. 1012 and 1013 are the standard "restart" and
770
+ * "try again later"; the 4xxx ones are gemi's own.
771
+ */
772
+ var CloseCode = {
773
+ /** The client went away (tab closed, socket released). */
774
+ Normal: 1e3,
775
+ /** A frame that was not JSON text, or not a known op. */
776
+ UnsupportedData: 1003,
777
+ /** Too many frames, or a frame over the size limit. */
778
+ PolicyViolation: 1008,
779
+ /** The server is restarting; `bye` said when to come back. */
780
+ Restart: 1012,
781
+ /** The socket fell too far behind; reconnect and resync. */
782
+ TryAgainLater: 1013,
783
+ /** The socket's user was signed out or its access revoked. */
784
+ Revoked: 4001
785
+ };
786
+ /**
787
+ * Whether a refusal is final for this socket's session: resubscribing will
788
+ * get the same answer, so the client does not retry it on its own.
789
+ */
790
+ function isPermanentDenial(code) {
791
+ return code === "unknown_channel" || code === "invalid_params" || code === "invalid";
792
+ }
793
+ //#endregion
794
+ //#region client/realtime/RealtimeClient.ts
795
+ /** The minimum gap between two resyncs of one subscription. */
796
+ var RESYNC_COALESCE_MS = 2e3;
797
+ /** How long the socket stays open after its last subscription goes. */
798
+ var IDLE_CLOSE_MS = 5e3;
799
+ /**
800
+ * How long a subscription outlives its last listener. A hook that remounts
801
+ * within it (StrictMode's double mount, a route change back, a list that
802
+ * re-renders its rows) picks the same subscription up again: no `unsub`, no
803
+ * new `sub`, nothing counted against the server's rate limit.
804
+ */
805
+ var RELEASE_LINGER_MS = 1500;
806
+ /** The least wait before resending a `sub` denied with `rate_limited`. */
807
+ var RATE_LIMITED_RETRY_MS = 5e3;
808
+ var MIN_BACKOFF_MS = 1e3;
809
+ var MAX_BACKOFF_MS = 3e4;
810
+ var DEFAULT_HEARTBEAT_MS = 25e3;
811
+ var DEFAULT_HIDDEN_DISCONNECT_MS = 6e4;
812
+ /** `pattern` and its params, canonical: two hooks on one channel share a `sub`. */
813
+ function channelKey(pattern, params) {
814
+ const sorted = Object.keys(params).sort().map((key) => [key, String(params[key])]);
815
+ return `${pattern}\u0000${JSON.stringify(sorted)}`;
816
+ }
817
+ /**
818
+ * The tab's one WebSocket to the app (`gemi.v1`), multiplexing every channel
819
+ * the mounted hooks subscribe to.
820
+ *
821
+ * Opened by the first subscription and closed a few seconds after the last
822
+ * one goes. Reconnects with full-jitter backoff (1 to 30 s), or after the
823
+ * server's `bye.retryAfter`, at once on `online`; resubscribes everything
824
+ * then. A tab hidden for `hiddenDisconnectMs` disconnects, and reconnects
825
+ * when shown. Every `subscribed` ack and every `gap` resyncs the
826
+ * subscription (coalesced to one per 2 s), because events are volatile: a
827
+ * client that may have missed one refetches over HTTP.
828
+ */
829
+ var RealtimeClient = class {
830
+ options;
831
+ internals;
832
+ ws = null;
833
+ entries = /* @__PURE__ */ new Map();
834
+ byId = /* @__PURE__ */ new Map();
835
+ topics = /* @__PURE__ */ new Map();
836
+ nextId = 1;
837
+ attempt = 0;
838
+ tag = null;
839
+ socketIdValue = null;
840
+ heartbeatMs = DEFAULT_HEARTBEAT_MS;
841
+ reconnectTimer = null;
842
+ idleTimer = null;
843
+ hiddenTimer = null;
844
+ pingTimer = null;
845
+ livenessTimer = null;
846
+ retryAfter = null;
847
+ revoked = false;
848
+ pausedWhileHidden = false;
849
+ listening = false;
850
+ constructor(options = {}, internals = {}) {
851
+ this.options = withDefaults(options);
852
+ this.internals = internals;
853
+ }
854
+ configure(options) {
855
+ this.options = withDefaults({
856
+ ...this.options,
857
+ ...options
858
+ });
859
+ }
860
+ /** The id to send as `X-Gemi-Socket`, while the socket is open. */
861
+ get socketId() {
862
+ return this.socketIdValue;
863
+ }
864
+ subscribe(pattern, params, listener) {
865
+ const key = channelKey(pattern, params);
866
+ let entry = this.entries.get(key);
867
+ if (!entry) {
868
+ entry = {
869
+ key,
870
+ id: String(this.nextId++),
871
+ pattern,
872
+ params: { ...params },
873
+ listeners: /* @__PURE__ */ new Set(),
874
+ status: "closed",
875
+ code: null,
876
+ permanent: false,
877
+ topic: null,
878
+ lastResyncAt: 0,
879
+ resyncTimer: null,
880
+ lingerTimer: null,
881
+ retryTimer: null,
882
+ retries: 0
883
+ };
884
+ this.entries.set(key, entry);
885
+ this.byId.set(entry.id, entry);
886
+ if (this.isOpen()) this.sendSub(entry);
887
+ }
888
+ if (entry.lingerTimer) {
889
+ clearTimeout(entry.lingerTimer);
890
+ entry.lingerTimer = null;
891
+ }
892
+ entry.listeners.add(listener);
893
+ listener.onStatus?.(entry.status, entry.code);
894
+ this.cancelIdleClose();
895
+ this.listen();
896
+ if (!this.ws && !this.reconnectTimer && !this.pausedWhileHidden) this.connect();
897
+ let released = false;
898
+ return () => {
899
+ if (released) return;
900
+ released = true;
901
+ this.release(entry, listener);
902
+ };
903
+ }
904
+ release(entry, listener) {
905
+ entry.listeners.delete(listener);
906
+ if (entry.listeners.size > 0 || entry.lingerTimer) return;
907
+ entry.lingerTimer = setTimeout(() => {
908
+ entry.lingerTimer = null;
909
+ if (entry.listeners.size === 0) this.drop(entry);
910
+ }, RELEASE_LINGER_MS);
911
+ }
912
+ drop(entry) {
913
+ if (entry.resyncTimer) clearTimeout(entry.resyncTimer);
914
+ this.clearRetry(entry);
915
+ this.entries.delete(entry.key);
916
+ this.byId.delete(entry.id);
917
+ this.dropTopic(entry);
918
+ if (this.isOpen() && (entry.status === "open" || entry.status === "connecting")) this.send({
919
+ op: "unsub",
920
+ id: entry.id
921
+ });
922
+ if (this.entries.size === 0) this.scheduleIdleClose();
923
+ }
924
+ isOpen() {
925
+ return this.ws !== null && this.ws.readyState === 1;
926
+ }
927
+ connect() {
928
+ if (typeof window === "undefined") return;
929
+ if (this.entries.size === 0) return;
930
+ const Impl = this.internals.WebSocket ?? globalThis.WebSocket;
931
+ if (!Impl) return;
932
+ this.clearReconnect();
933
+ let ws;
934
+ try {
935
+ ws = new Impl(this.url(), [BROADCAST_PROTOCOL]);
936
+ } catch {
937
+ this.scheduleReconnect();
938
+ return;
939
+ }
940
+ this.ws = ws;
941
+ for (const entry of this.entries.values()) if (!entry.permanent) this.setStatus(entry, "connecting", null);
942
+ ws.onopen = () => {
943
+ if (this.ws !== ws) return;
944
+ this.touch();
945
+ for (const entry of this.entries.values()) if (!entry.permanent) this.sendSub(entry);
946
+ };
947
+ ws.onmessage = (event) => {
948
+ if (this.ws !== ws) return;
949
+ this.touch();
950
+ let frame;
951
+ try {
952
+ frame = JSON.parse(String(event.data));
953
+ } catch {
954
+ return;
955
+ }
956
+ this.handle(frame);
957
+ };
958
+ ws.onclose = (event) => {
959
+ if (this.ws !== ws) return;
960
+ this.onClosed(event.code);
961
+ };
962
+ ws.onerror = () => {};
963
+ }
964
+ url() {
965
+ if (this.internals.url) return this.internals.url;
966
+ const { protocol, host } = window.location;
967
+ return `${protocol === "https:" ? "wss:" : "ws:"}//${host}${this.options.path}`;
968
+ }
969
+ sendSub(entry) {
970
+ this.setStatus(entry, "connecting", null);
971
+ const frame = {
972
+ op: "sub",
973
+ id: entry.id,
974
+ ch: entry.pattern
975
+ };
976
+ if (Object.keys(entry.params).length > 0) frame.p = entry.params;
977
+ this.send(frame);
978
+ }
979
+ send(frame) {
980
+ if (!this.isOpen()) return;
981
+ try {
982
+ this.ws.send(JSON.stringify(frame));
983
+ } catch {}
984
+ }
985
+ handle(frame) {
986
+ switch (frame.op) {
987
+ case "hello":
988
+ this.socketIdValue = frame.socketId;
989
+ this.tag = frame.tag;
990
+ this.attempt = 0;
991
+ this.revoked = false;
992
+ if (frame.heartbeatMs > 0) this.heartbeatMs = frame.heartbeatMs;
993
+ this.startHeartbeat();
994
+ return;
995
+ case "subscribed": {
996
+ const entry = this.byId.get(frame.id);
997
+ if (!entry) return;
998
+ this.dropTopic(entry);
999
+ entry.topic = frame.t;
1000
+ let ids = this.topics.get(frame.t);
1001
+ if (!ids) this.topics.set(frame.t, ids = /* @__PURE__ */ new Set());
1002
+ ids.add(entry.id);
1003
+ this.clearRetry(entry);
1004
+ entry.retries = 0;
1005
+ this.setStatus(entry, "open", null);
1006
+ this.resync(entry);
1007
+ return;
1008
+ }
1009
+ case "denied": {
1010
+ const entry = this.byId.get(frame.id);
1011
+ if (!entry) return;
1012
+ this.dropTopic(entry);
1013
+ entry.permanent = isPermanentDenial(frame.code);
1014
+ this.setStatus(entry, "denied", frame.code);
1015
+ this.scheduleRetry(entry, frame.code);
1016
+ return;
1017
+ }
1018
+ case "ev": {
1019
+ if (frame.x !== void 0 && frame.x === this.tag) return;
1020
+ const ids = this.topics.get(frame.t);
1021
+ if (!ids) return;
1022
+ for (const id of Array.from(ids)) {
1023
+ const entry = this.byId.get(id);
1024
+ if (!entry) continue;
1025
+ for (const listener of Array.from(entry.listeners)) try {
1026
+ listener.onEvent?.(frame.ev, frame.d);
1027
+ } catch (error) {
1028
+ reportListenerError(error);
1029
+ }
1030
+ }
1031
+ return;
1032
+ }
1033
+ case "gap":
1034
+ for (const entry of this.entries.values()) if (entry.status === "open") this.resync(entry);
1035
+ return;
1036
+ case "bye":
1037
+ this.retryAfter = Math.max(0, Number(frame.retryAfter) || 0);
1038
+ return;
1039
+ case "pong": return;
1040
+ }
1041
+ }
1042
+ onClosed(code) {
1043
+ this.ws = null;
1044
+ this.socketIdValue = null;
1045
+ this.tag = null;
1046
+ this.stopHeartbeat();
1047
+ this.topics.clear();
1048
+ for (const entry of this.entries.values()) {
1049
+ entry.topic = null;
1050
+ this.clearRetry(entry);
1051
+ if (!entry.permanent) this.setStatus(entry, "closed", null);
1052
+ }
1053
+ if (code === CloseCode.Revoked) this.revoked = true;
1054
+ if (this.entries.size > 0 && !this.pausedWhileHidden) this.scheduleReconnect();
1055
+ }
1056
+ scheduleReconnect() {
1057
+ this.clearReconnect();
1058
+ let delay;
1059
+ if (this.retryAfter !== null) {
1060
+ delay = this.retryAfter;
1061
+ this.retryAfter = null;
1062
+ } else if (this.revoked) {
1063
+ this.revoked = false;
1064
+ delay = Math.floor(this.random() * 500);
1065
+ } else delay = backoffDelay(this.attempt, this.random());
1066
+ this.attempt++;
1067
+ this.reconnectTimer = setTimeout(() => {
1068
+ this.reconnectTimer = null;
1069
+ this.connect();
1070
+ }, delay);
1071
+ }
1072
+ clearReconnect() {
1073
+ if (this.reconnectTimer) clearTimeout(this.reconnectTimer);
1074
+ this.reconnectTimer = null;
1075
+ }
1076
+ random() {
1077
+ return (this.internals.random ?? Math.random)();
1078
+ }
1079
+ startHeartbeat() {
1080
+ this.stopHeartbeat();
1081
+ this.pingTimer = setInterval(() => this.send({ op: "ping" }), this.heartbeatMs);
1082
+ this.touch();
1083
+ }
1084
+ stopHeartbeat() {
1085
+ if (this.pingTimer) clearInterval(this.pingTimer);
1086
+ if (this.livenessTimer) clearTimeout(this.livenessTimer);
1087
+ this.pingTimer = null;
1088
+ this.livenessTimer = null;
1089
+ }
1090
+ /** Anything from the server proves the socket alive. */
1091
+ touch() {
1092
+ if (this.livenessTimer) clearTimeout(this.livenessTimer);
1093
+ const ws = this.ws;
1094
+ this.livenessTimer = setTimeout(() => {
1095
+ if (this.ws !== ws || !ws) return;
1096
+ try {
1097
+ ws.close();
1098
+ } catch {}
1099
+ this.onClosed(1006);
1100
+ }, this.heartbeatMs * 2);
1101
+ }
1102
+ setStatus(entry, status, code) {
1103
+ if (entry.status === status && entry.code === code) return;
1104
+ entry.status = status;
1105
+ entry.code = code;
1106
+ for (const listener of Array.from(entry.listeners)) try {
1107
+ listener.onStatus?.(status, code);
1108
+ } catch (error) {
1109
+ reportListenerError(error);
1110
+ }
1111
+ }
1112
+ /** At most one resync per subscription per 2 s; a later one is deferred, not dropped. */
1113
+ resync(entry) {
1114
+ if (entry.resyncTimer) return;
1115
+ const now = Date.now();
1116
+ const wait = entry.lastResyncAt + RESYNC_COALESCE_MS - now;
1117
+ const fire = () => {
1118
+ entry.resyncTimer = null;
1119
+ entry.lastResyncAt = Date.now();
1120
+ for (const listener of Array.from(entry.listeners)) try {
1121
+ listener.onResync?.();
1122
+ } catch (error) {
1123
+ reportListenerError(error);
1124
+ }
1125
+ };
1126
+ if (entry.lastResyncAt === 0 || wait <= 0) fire();
1127
+ else entry.resyncTimer = setTimeout(fire, wait);
1128
+ }
1129
+ /**
1130
+ * A transient denial (`rate_limited`, `error`, `limit`) is retried on the
1131
+ * same socket, with backoff: a healthy socket may never reconnect. `denied`
1132
+ * and `revoked` are the channel's answer for this session, so they wait for
1133
+ * the next connection (a sign-in reconnects), and a permanent one is never
1134
+ * resent.
1135
+ */
1136
+ scheduleRetry(entry, code) {
1137
+ if (code !== "rate_limited" && code !== "error" && code !== "limit") return;
1138
+ this.clearRetry(entry);
1139
+ const delay = Math.max(code === "rate_limited" ? RATE_LIMITED_RETRY_MS : MIN_BACKOFF_MS, backoffDelay(entry.retries, this.random()));
1140
+ entry.retries++;
1141
+ entry.retryTimer = setTimeout(() => {
1142
+ entry.retryTimer = null;
1143
+ if (this.entries.get(entry.key) !== entry || entry.status !== "denied") return;
1144
+ if (this.isOpen()) this.sendSub(entry);
1145
+ }, delay);
1146
+ }
1147
+ clearRetry(entry) {
1148
+ if (entry.retryTimer) clearTimeout(entry.retryTimer);
1149
+ entry.retryTimer = null;
1150
+ }
1151
+ dropTopic(entry) {
1152
+ if (!entry.topic) return;
1153
+ const ids = this.topics.get(entry.topic);
1154
+ ids?.delete(entry.id);
1155
+ if (ids && ids.size === 0) this.topics.delete(entry.topic);
1156
+ entry.topic = null;
1157
+ }
1158
+ scheduleIdleClose() {
1159
+ this.cancelIdleClose();
1160
+ this.idleTimer = setTimeout(() => {
1161
+ this.idleTimer = null;
1162
+ if (this.entries.size > 0) return;
1163
+ this.clearReconnect();
1164
+ this.close();
1165
+ }, IDLE_CLOSE_MS);
1166
+ }
1167
+ cancelIdleClose() {
1168
+ if (this.idleTimer) clearTimeout(this.idleTimer);
1169
+ this.idleTimer = null;
1170
+ }
1171
+ /** Closes the socket without reconnecting. */
1172
+ close() {
1173
+ const ws = this.ws;
1174
+ if (!ws) return;
1175
+ this.ws = null;
1176
+ try {
1177
+ ws.close(CloseCode.Normal);
1178
+ } catch {}
1179
+ this.onClosed(CloseCode.Normal);
1180
+ }
1181
+ listen() {
1182
+ if (this.listening || typeof window === "undefined") return;
1183
+ this.listening = true;
1184
+ window.addEventListener("online", this.onOnline);
1185
+ if (typeof document !== "undefined") document.addEventListener("visibilitychange", this.onVisibility);
1186
+ }
1187
+ onOnline = () => {
1188
+ if (this.entries.size === 0 || this.ws || this.pausedWhileHidden) return;
1189
+ this.attempt = 0;
1190
+ this.connect();
1191
+ };
1192
+ onVisibility = () => {
1193
+ if (document.visibilityState === "hidden") {
1194
+ if (this.hiddenTimer) return;
1195
+ this.hiddenTimer = setTimeout(() => {
1196
+ this.hiddenTimer = null;
1197
+ if (document.visibilityState !== "hidden") return;
1198
+ this.pausedWhileHidden = true;
1199
+ this.clearReconnect();
1200
+ this.close();
1201
+ }, this.options.hiddenDisconnectMs);
1202
+ return;
1203
+ }
1204
+ if (this.hiddenTimer) clearTimeout(this.hiddenTimer);
1205
+ this.hiddenTimer = null;
1206
+ if (this.pausedWhileHidden) {
1207
+ this.pausedWhileHidden = false;
1208
+ this.attempt = 0;
1209
+ this.connect();
1210
+ }
1211
+ };
1212
+ /**
1213
+ * Drops the socket and opens a new one at once, when anything is
1214
+ * subscribed. A socket keeps the session it was opened with (the upgrade's
1215
+ * cookies), so signing in or out in this tab reconnects it: every channel
1216
+ * is then authorized as the new session, and the acks resync.
1217
+ */
1218
+ reconnect() {
1219
+ this.close();
1220
+ this.clearReconnect();
1221
+ this.attempt = 0;
1222
+ if (this.entries.size > 0 && !this.pausedWhileHidden) this.connect();
1223
+ }
1224
+ /** For tests: drops the socket, timers and listeners. */
1225
+ dispose() {
1226
+ this.clearReconnect();
1227
+ this.cancelIdleClose();
1228
+ if (this.hiddenTimer) clearTimeout(this.hiddenTimer);
1229
+ for (const entry of this.entries.values()) {
1230
+ if (entry.resyncTimer) clearTimeout(entry.resyncTimer);
1231
+ if (entry.lingerTimer) clearTimeout(entry.lingerTimer);
1232
+ this.clearRetry(entry);
1233
+ }
1234
+ this.entries.clear();
1235
+ this.byId.clear();
1236
+ this.close();
1237
+ if (this.listening && typeof window !== "undefined") {
1238
+ window.removeEventListener("online", this.onOnline);
1239
+ document?.removeEventListener("visibilitychange", this.onVisibility);
1240
+ this.listening = false;
1241
+ }
1242
+ }
1243
+ };
1244
+ /** Full jitter, 1 to 30 s: `max(1 s, random × min(30 s, 1 s × 2^attempt))`. */
1245
+ function backoffDelay(attempt, random) {
1246
+ const cap = Math.min(MAX_BACKOFF_MS, MIN_BACKOFF_MS * 2 ** Math.min(attempt, 10));
1247
+ return Math.max(MIN_BACKOFF_MS, Math.floor(random * cap));
1248
+ }
1249
+ function withDefaults(options) {
1250
+ return {
1251
+ path: options.path ?? "/__gemi/socket",
1252
+ hiddenDisconnectMs: options.hiddenDisconnectMs ?? DEFAULT_HIDDEN_DISCONNECT_MS
1253
+ };
1254
+ }
1255
+ function reportListenerError(error) {
1256
+ setTimeout(() => {
1257
+ throw error;
1258
+ });
1259
+ }
1260
+ var configured = {};
1261
+ var instance = null;
1262
+ /**
1263
+ * Sets the socket options (`init({ realtime })` calls it). Takes effect on
1264
+ * the next connection.
1265
+ */
1266
+ function configureRealtime(options = {}) {
1267
+ configured = {
1268
+ ...configured,
1269
+ ...options
1270
+ };
1271
+ instance?.configure(configured);
1272
+ }
1273
+ /** The tab's client, created on first use. `null` on the server. */
1274
+ function getRealtimeClient() {
1275
+ if (typeof window === "undefined") return null;
1276
+ instance ??= new RealtimeClient(configured);
1277
+ return instance;
1278
+ }
1279
+ /**
1280
+ * Reconnects the tab's socket, if it has one, so its channels are authorized
1281
+ * as the current session. The auth hooks call it after signing in or out.
1282
+ * Never creates the client.
1283
+ */
1284
+ function reconnectRealtime() {
1285
+ instance?.reconnect();
1286
+ }
1287
+ /**
1288
+ * The open socket's id, for the `X-Gemi-Socket` header, or `null`. Never
1289
+ * creates the client.
1290
+ */
1291
+ function currentSocketId() {
1292
+ return instance?.socketId ?? null;
1293
+ }
1294
+ //#endregion
1295
+ //#region client/realtime/RealtimeContext.ts
1296
+ /**
1297
+ * The socket the channel hooks subscribe through. `null` (the default) is the
1298
+ * tab's own `RealtimeClient`, created on first use in the browser; `<Page>`
1299
+ * in `gemi/testing` provides a `FakeSocket`.
1300
+ */
1301
+ var RealtimeContext = createContext(null);
1302
+ //#endregion
729
1303
  //#region ../../node_modules/.bun/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/esm/extends.js
730
1304
  function _extends() {
731
1305
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
@@ -3408,6 +3982,6 @@ function useTheme() {
3408
3982
  return context;
3409
3983
  }
3410
3984
  //#endregion
3411
- export { useLocation as A, QueryManagerProvider as B, useRoute as C, I18nProvider as D, I18nContext as E, createMemoryHistory as F, retryDelayFor as G, pickDefined as H, toVariantKey as I, Subject as J, shouldRetryQuery as K, applyParams as L, isAbsoluteUrl as M, ProgressManager as N, ServerDataContext as O, Action as P, QueryConfigContext as R, routeDataUrl as S, useNavigate as T, DEFAULT_STALE_TIME as U, USER_QUERY_CONFIG_KEYS as V, isRetryableQueryError as W, loadDictionary as _, useRouteTransition as a, setActiveLocale as b, ComponentsContext as c, loadViewModule as d, subscribeViewModules as f, recoverFromChunkLoadError as g, isChunkLoadError as h, RouteTransitionProvider as i, domainUrl as j, ServerDataProvider as k, ComponentsProvider as l, configureChunkLoadRecovery as m, useTheme as n, ClientRouterContext as o, CHUNK_RELOAD_MARKER as p, QueryError as q, m as r, ClientRouterProvider as s, ThemeProvider as t, initialViewModulesReady as u, loadDictionaryForRender as v, useSearchParams as w, readRoutePayload as x, registerDictionary as y, QueryManagerContext as z };
3985
+ export { shouldRetryQuery as $, useLocation as A, getRealtimeClient as B, useRoute as C, I18nProvider as D, I18nContext as E, createMemoryHistory as F, QueryConfigContext as G, SOCKET_ID_HEADER as H, RealtimeContext as I, USER_QUERY_CONFIG_KEYS as J, QueryManagerContext as K, channelKey as L, isAbsoluteUrl as M, ProgressManager as N, ServerDataContext as O, Action as P, retryDelayFor as Q, configureRealtime as R, routeDataUrl as S, useNavigate as T, toVariantKey as U, reconnectRealtime as V, applyParams as W, DEFAULT_STALE_TIME as X, pickDefined as Y, isRetryableQueryError as Z, loadDictionary as _, useRouteTransition as a, setActiveLocale as b, ComponentsContext as c, loadViewModule as d, QueryError as et, subscribeViewModules as f, recoverFromChunkLoadError as g, isChunkLoadError as h, RouteTransitionProvider as i, domainUrl as j, ServerDataProvider as k, ComponentsProvider as l, configureChunkLoadRecovery as m, useTheme as n, ClientRouterContext as o, CHUNK_RELOAD_MARKER as p, QueryManagerProvider as q, m as r, ClientRouterProvider as s, ThemeProvider as t, Subject as tt, initialViewModulesReady as u, loadDictionaryForRender as v, useSearchParams as w, readRoutePayload as x, registerDictionary as y, currentSocketId as z };
3412
3986
 
3413
- //# sourceMappingURL=ThemeProvider-BLI4zpLu.js.map
3987
+ //# sourceMappingURL=ThemeProvider-CgK2mmVV.js.map