gemi 0.84.1 → 0.86.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 (280) hide show
  1. package/dist/ai/Agent.d.ts +41 -3
  2. package/dist/ai/Agent.d.ts.map +1 -1
  3. package/dist/ai/AgentController.d.ts +238 -0
  4. package/dist/ai/AgentController.d.ts.map +1 -1
  5. package/dist/ai/AgentProvider.d.ts +15 -0
  6. package/dist/ai/AgentProvider.d.ts.map +1 -1
  7. package/dist/ai/client/index.d.ts +2 -2
  8. package/dist/ai/client/index.d.ts.map +1 -1
  9. package/dist/ai/client/index.js +138 -35
  10. package/dist/ai/client/index.js.map +1 -1
  11. package/dist/ai/client/reducer.d.ts +7 -1
  12. package/dist/ai/client/reducer.d.ts.map +1 -1
  13. package/dist/ai/generate.d.ts.map +1 -1
  14. package/dist/ai/index.d.ts +4 -2
  15. package/dist/ai/index.d.ts.map +1 -1
  16. package/dist/ai/index.js +12 -12
  17. package/dist/ai/index.js.map +19 -16
  18. package/dist/ai/providers/call.d.ts +4 -0
  19. package/dist/ai/providers/call.d.ts.map +1 -1
  20. package/dist/ai/providers/fileRejection.d.ts +84 -0
  21. package/dist/ai/providers/fileRejection.d.ts.map +1 -0
  22. package/dist/ai/providers/request.d.ts.map +1 -1
  23. package/dist/ai/redact.d.ts +70 -0
  24. package/dist/ai/redact.d.ts.map +1 -0
  25. package/dist/ai/signing.d.ts +33 -4
  26. package/dist/ai/signing.d.ts.map +1 -1
  27. package/dist/ai/store/Attachments.d.ts +5 -3
  28. package/dist/ai/store/Attachments.d.ts.map +1 -1
  29. package/dist/ai/store/FileOwners.d.ts +59 -0
  30. package/dist/ai/store/FileOwners.d.ts.map +1 -0
  31. package/dist/ai/store/LiveRuns.d.ts +25 -0
  32. package/dist/ai/store/LiveRuns.d.ts.map +1 -1
  33. package/dist/ai/store/MemoryAgentStore.d.ts +1 -0
  34. package/dist/ai/store/MemoryAgentStore.d.ts.map +1 -1
  35. package/dist/ai/store/Nonces.d.ts +109 -0
  36. package/dist/ai/store/Nonces.d.ts.map +1 -0
  37. package/dist/ai/store/index.d.ts +2 -0
  38. package/dist/ai/store/index.d.ts.map +1 -1
  39. package/dist/ai/types.d.ts +30 -1
  40. package/dist/ai/types.d.ts.map +1 -1
  41. package/dist/ai/useChat.d.ts +62 -3
  42. package/dist/ai/useChat.d.ts.map +1 -1
  43. package/dist/app/index.js +1 -1
  44. package/dist/bun/plugin.js +1 -1
  45. package/dist/bun/preload.js +1 -1
  46. package/dist/{chunk-82nn71zs.js → chunk-09sr33ff.js} +2 -2
  47. package/dist/{chunk-82nn71zs.js.map → chunk-09sr33ff.js.map} +1 -1
  48. package/dist/chunk-174jkg6d.js +7 -0
  49. package/dist/{chunk-302mkqeq.js.map → chunk-174jkg6d.js.map} +9 -8
  50. package/dist/{chunk-87x692j7.js → chunk-1b5s4w5f.js} +2 -2
  51. package/dist/{chunk-87x692j7.js.map → chunk-1b5s4w5f.js.map} +1 -1
  52. package/dist/{chunk-rmv1jp9p.js → chunk-1jcp8m8h.js} +2 -2
  53. package/dist/{chunk-rmv1jp9p.js.map → chunk-1jcp8m8h.js.map} +1 -1
  54. package/dist/{chunk-g6qe6wyb.js → chunk-1w5a11cd.js} +2 -2
  55. package/dist/{chunk-g6qe6wyb.js.map → chunk-1w5a11cd.js.map} +1 -1
  56. package/dist/chunk-1wby1sr2.js +5 -0
  57. package/dist/{chunk-e43drft2.js.map → chunk-1wby1sr2.js.map} +3 -3
  58. package/dist/{chunk-vmpzg4z5.js → chunk-1yq1e6sb.js} +3 -3
  59. package/dist/{chunk-vmpzg4z5.js.map → chunk-1yq1e6sb.js.map} +1 -1
  60. package/dist/chunk-1yzdxv2a.js +5 -0
  61. package/dist/{chunk-tmwsvf02.js.map → chunk-1yzdxv2a.js.map} +1 -1
  62. package/dist/chunk-2dzqrf0z.js +55 -0
  63. package/dist/{chunk-rp5j1mgk.js.map → chunk-2dzqrf0z.js.map} +3 -3
  64. package/dist/{chunk-ah9ajys0.js → chunk-2gdhcswa.js} +1 -1
  65. package/dist/{chunk-1evk2pma.js → chunk-2yw23zhn.js} +4 -4
  66. package/dist/{chunk-1evk2pma.js.map → chunk-2yw23zhn.js.map} +1 -1
  67. package/dist/{chunk-3z6wkvwj.js → chunk-4ysar3ev.js} +2 -2
  68. package/dist/{chunk-3z6wkvwj.js.map → chunk-4ysar3ev.js.map} +1 -1
  69. package/dist/{chunk-z409rk5j.js → chunk-4zj05vry.js} +2 -2
  70. package/dist/{chunk-z409rk5j.js.map → chunk-4zj05vry.js.map} +1 -1
  71. package/dist/{chunk-1cebv3h8.js → chunk-55x9kkdt.js} +2 -2
  72. package/dist/{chunk-1cebv3h8.js.map → chunk-55x9kkdt.js.map} +1 -1
  73. package/dist/{chunk-3zb2ycxj.js → chunk-7c33ngqs.js} +2 -2
  74. package/dist/{chunk-3zb2ycxj.js.map → chunk-7c33ngqs.js.map} +1 -1
  75. package/dist/{chunk-en3mtnsg.js → chunk-7n5775qx.js} +2 -2
  76. package/dist/{chunk-en3mtnsg.js.map → chunk-7n5775qx.js.map} +1 -1
  77. package/dist/{chunk-bn9pzgww.js → chunk-7nj2t2gm.js} +2 -2
  78. package/dist/{chunk-bn9pzgww.js.map → chunk-7nj2t2gm.js.map} +1 -1
  79. package/dist/{chunk-kfavcgv2.js → chunk-81k26w39.js} +2 -2
  80. package/dist/{chunk-kfavcgv2.js.map → chunk-81k26w39.js.map} +1 -1
  81. package/dist/{chunk-cg4k40zy.js → chunk-81v4c4b1.js} +2 -2
  82. package/dist/{chunk-cg4k40zy.js.map → chunk-81v4c4b1.js.map} +1 -1
  83. package/dist/{chunk-wh728wd6.js → chunk-8gexb1gt.js} +2 -2
  84. package/dist/{chunk-wh728wd6.js.map → chunk-8gexb1gt.js.map} +1 -1
  85. package/dist/{chunk-zfch4da5.js → chunk-9tsw1bmt.js} +2 -2
  86. package/dist/{chunk-8mmfpqgs.js.map → chunk-9tsw1bmt.js.map} +1 -1
  87. package/dist/{chunk-m0zba09s.js → chunk-9tv5j3b2.js} +3 -3
  88. package/dist/{chunk-m0zba09s.js.map → chunk-9tv5j3b2.js.map} +1 -1
  89. package/dist/{chunk-jg9eqd3r.js → chunk-c3gzpjba.js} +1 -1
  90. package/dist/{chunk-r5e4vpa1.js → chunk-cbycz5z3.js} +2 -2
  91. package/dist/{chunk-r5e4vpa1.js.map → chunk-cbycz5z3.js.map} +1 -1
  92. package/dist/{chunk-cfvq30n4.js → chunk-cfykfnqx.js} +2 -2
  93. package/dist/{chunk-cfvq30n4.js.map → chunk-cfykfnqx.js.map} +1 -1
  94. package/dist/{chunk-eysexnqb.js → chunk-ct7wxm98.js} +2 -2
  95. package/dist/{chunk-eysexnqb.js.map → chunk-ct7wxm98.js.map} +1 -1
  96. package/dist/{chunk-v27a4se1.js → chunk-d3jkypc7.js} +3 -3
  97. package/dist/{chunk-v27a4se1.js.map → chunk-d3jkypc7.js.map} +1 -1
  98. package/dist/{chunk-vfrrzr10.js → chunk-dadygfkf.js} +2 -2
  99. package/dist/{chunk-vfrrzr10.js.map → chunk-dadygfkf.js.map} +1 -1
  100. package/dist/{chunk-m4xw99vm.js → chunk-dwqh79e5.js} +2 -2
  101. package/dist/{chunk-m4xw99vm.js.map → chunk-dwqh79e5.js.map} +1 -1
  102. package/dist/chunk-eptv0nvv.js +24 -0
  103. package/dist/chunk-eptv0nvv.js.map +17 -0
  104. package/dist/{chunk-ng8pp9k2.js → chunk-fbwe0agk.js} +2 -2
  105. package/dist/{chunk-ng8pp9k2.js.map → chunk-fbwe0agk.js.map} +1 -1
  106. package/dist/{chunk-495qwteq.js → chunk-fc2je244.js} +3 -3
  107. package/dist/{chunk-495qwteq.js.map → chunk-fc2je244.js.map} +1 -1
  108. package/dist/{chunk-gr61ymse.js → chunk-gx0x772p.js} +2 -2
  109. package/dist/{chunk-gr61ymse.js.map → chunk-gx0x772p.js.map} +1 -1
  110. package/dist/{chunk-tdnfhe7x.js → chunk-ha705bcz.js} +3 -3
  111. package/dist/{chunk-tdnfhe7x.js.map → chunk-ha705bcz.js.map} +1 -1
  112. package/dist/chunk-jhe0t7yj.js +5 -0
  113. package/dist/chunk-jhe0t7yj.js.map +11 -0
  114. package/dist/{chunk-d0qwdeza.js → chunk-k5j65f2c.js} +2 -2
  115. package/dist/{chunk-d0qwdeza.js.map → chunk-k5j65f2c.js.map} +1 -1
  116. package/dist/{chunk-pt59xjfc.js → chunk-kmsrzbx1.js} +2 -2
  117. package/dist/{chunk-pt59xjfc.js.map → chunk-kmsrzbx1.js.map} +1 -1
  118. package/dist/{chunk-v1nm4tcq.js → chunk-m7y8d3k7.js} +2 -2
  119. package/dist/{chunk-v1nm4tcq.js.map → chunk-m7y8d3k7.js.map} +1 -1
  120. package/dist/{chunk-k2qh3hvd.js → chunk-mk8m3ffx.js} +2 -2
  121. package/dist/{chunk-k2qh3hvd.js.map → chunk-mk8m3ffx.js.map} +1 -1
  122. package/dist/{chunk-z7442w3q.js → chunk-mszy6cfw.js} +2 -2
  123. package/dist/{chunk-z7442w3q.js.map → chunk-mszy6cfw.js.map} +1 -1
  124. package/dist/{chunk-kb3xk9r8.js → chunk-ndat0nf0.js} +2 -2
  125. package/dist/{chunk-kb3xk9r8.js.map → chunk-ndat0nf0.js.map} +1 -1
  126. package/dist/{chunk-j9wqzemf.js → chunk-p0m3qgs5.js} +2 -2
  127. package/dist/{chunk-j9wqzemf.js.map → chunk-p0m3qgs5.js.map} +1 -1
  128. package/dist/{chunk-8mmfpqgs.js → chunk-p7r3ecpk.js} +2 -2
  129. package/dist/{chunk-zfch4da5.js.map → chunk-p7r3ecpk.js.map} +1 -1
  130. package/dist/{chunk-zp971jp2.js → chunk-pmmrhak1.js} +3 -3
  131. package/dist/{chunk-zp971jp2.js.map → chunk-pmmrhak1.js.map} +1 -1
  132. package/dist/{chunk-0agfx93f.js → chunk-ptkt4h2j.js} +2 -2
  133. package/dist/{chunk-0agfx93f.js.map → chunk-ptkt4h2j.js.map} +1 -1
  134. package/dist/{chunk-nvj1z2rs.js → chunk-pzwyg474.js} +2 -2
  135. package/dist/{chunk-nvj1z2rs.js.map → chunk-pzwyg474.js.map} +1 -1
  136. package/dist/{chunk-73dk6k4p.js → chunk-qje4kdff.js} +3 -3
  137. package/dist/{chunk-73dk6k4p.js.map → chunk-qje4kdff.js.map} +1 -1
  138. package/dist/{chunk-yk8s5egf.js → chunk-rdnm6rem.js} +2 -2
  139. package/dist/{chunk-yk8s5egf.js.map → chunk-rdnm6rem.js.map} +1 -1
  140. package/dist/{chunk-enf9mdac.js → chunk-s046a984.js} +2 -2
  141. package/dist/{chunk-enf9mdac.js.map → chunk-s046a984.js.map} +1 -1
  142. package/dist/{chunk-1s914cdj.js → chunk-saqfc6vp.js} +3 -3
  143. package/dist/{chunk-1s914cdj.js.map → chunk-saqfc6vp.js.map} +1 -1
  144. package/dist/{chunk-pgpqsgzx.js → chunk-sejnmn1q.js} +1 -1
  145. package/dist/{chunk-xhha1gb3.js → chunk-sjckrbr2.js} +2 -2
  146. package/dist/{chunk-xhha1gb3.js.map → chunk-sjckrbr2.js.map} +1 -1
  147. package/dist/{chunk-r8nhndzb.js → chunk-swhyp0yw.js} +2 -2
  148. package/dist/{chunk-r8nhndzb.js.map → chunk-swhyp0yw.js.map} +1 -1
  149. package/dist/{chunk-wkdzz0rx.js → chunk-trdwxm5x.js} +3 -3
  150. package/dist/{chunk-wkdzz0rx.js.map → chunk-trdwxm5x.js.map} +1 -1
  151. package/dist/{chunk-aztkrzvf.js → chunk-v2hvnxsf.js} +2 -2
  152. package/dist/{chunk-aztkrzvf.js.map → chunk-v2hvnxsf.js.map} +1 -1
  153. package/dist/{chunk-57ryyhh3.js → chunk-v4ngf77f.js} +2 -2
  154. package/dist/{chunk-57ryyhh3.js.map → chunk-v4ngf77f.js.map} +1 -1
  155. package/dist/{chunk-159hyeng.js → chunk-v8nf45gt.js} +2 -2
  156. package/dist/{chunk-159hyeng.js.map → chunk-v8nf45gt.js.map} +1 -1
  157. package/dist/{chunk-ys4fejmx.js → chunk-vwp1g8wh.js} +2 -2
  158. package/dist/{chunk-ys4fejmx.js.map → chunk-vwp1g8wh.js.map} +1 -1
  159. package/dist/chunk-w312e9nx.js +5 -0
  160. package/dist/{chunk-ash9e6fn.js.map → chunk-w312e9nx.js.map} +4 -3
  161. package/dist/{chunk-wwdaswxh.js → chunk-wwzg4dmy.js} +3 -3
  162. package/dist/{chunk-wwdaswxh.js.map → chunk-wwzg4dmy.js.map} +1 -1
  163. package/dist/{chunk-wsx3j5ws.js → chunk-xckeyg3v.js} +2 -2
  164. package/dist/{chunk-wsx3j5ws.js.map → chunk-xckeyg3v.js.map} +1 -1
  165. package/dist/chunk-xx2zg6sk.js +17 -0
  166. package/dist/{chunk-49akdtfe.js.map → chunk-xx2zg6sk.js.map} +11 -12
  167. package/dist/{chunk-rqh2wdhb.js → chunk-y7qnx8vm.js} +2 -2
  168. package/dist/{chunk-rqh2wdhb.js.map → chunk-y7qnx8vm.js.map} +1 -1
  169. package/dist/{chunk-rv7da58g.js → chunk-z4k18gnp.js} +2 -2
  170. package/dist/{chunk-rv7da58g.js.map → chunk-z4k18gnp.js.map} +1 -1
  171. package/dist/{chunk-w099t7zj.js → chunk-zf4r4kat.js} +2 -2
  172. package/dist/{chunk-w099t7zj.js.map → chunk-zf4r4kat.js.map} +1 -1
  173. package/dist/{chunk-dvpxkzms.js → chunk-zs90w6ke.js} +2 -2
  174. package/dist/{chunk-dvpxkzms.js.map → chunk-zs90w6ke.js.map} +1 -1
  175. package/dist/chunks/{ThemeProvider-Dn3UREDn.js → ThemeProvider-D1kDfCwY.js} +59 -2
  176. package/dist/chunks/ThemeProvider-D1kDfCwY.js.map +1 -0
  177. package/dist/client/Link.d.ts.map +1 -1
  178. package/dist/client/MutationError.d.ts +60 -50
  179. package/dist/client/MutationError.d.ts.map +1 -1
  180. package/dist/client/ProgressManager.d.ts +1 -1
  181. package/dist/client/QueryResource.d.ts +20 -0
  182. package/dist/client/QueryResource.d.ts.map +1 -1
  183. package/dist/client/auth/useForgotPassword.d.ts +2 -1
  184. package/dist/client/auth/useForgotPassword.d.ts.map +1 -1
  185. package/dist/client/auth/useResetPassword.d.ts +2 -1
  186. package/dist/client/auth/useResetPassword.d.ts.map +1 -1
  187. package/dist/client/auth/useSignIn.d.ts +11 -1
  188. package/dist/client/auth/useSignIn.d.ts.map +1 -1
  189. package/dist/client/auth/useSignOut.d.ts +2 -1
  190. package/dist/client/auth/useSignOut.d.ts.map +1 -1
  191. package/dist/client/auth/useSignUp.d.ts +2 -1
  192. package/dist/client/auth/useSignUp.d.ts.map +1 -1
  193. package/dist/client/index.d.ts +3 -1
  194. package/dist/client/index.d.ts.map +1 -1
  195. package/dist/client/index.js +169 -65
  196. package/dist/client/index.js.map +1 -1
  197. package/dist/client/useMutation.d.ts +33 -6
  198. package/dist/client/useMutation.d.ts.map +1 -1
  199. package/dist/client/useQuery.d.ts.map +1 -1
  200. package/dist/config/index.js +1 -1
  201. package/dist/console/run.js +2 -2
  202. package/dist/console/run.js.map +1 -1
  203. package/dist/container/index.js +2 -2
  204. package/dist/container/index.js.map +1 -1
  205. package/dist/database/index.js +2 -2
  206. package/dist/database/index.js.map +1 -1
  207. package/dist/email/Email.d.ts.map +1 -1
  208. package/dist/email/debugEmail.d.ts +40 -0
  209. package/dist/email/debugEmail.d.ts.map +1 -0
  210. package/dist/email/index.js +4 -3
  211. package/dist/email/index.js.map +6 -5
  212. package/dist/facades/index.js +2 -2
  213. package/dist/facades/index.js.map +1 -1
  214. package/dist/foundation/index.js +2 -2
  215. package/dist/foundation/index.js.map +1 -1
  216. package/dist/http/ApiRouter.d.ts +12 -0
  217. package/dist/http/ApiRouter.d.ts.map +1 -1
  218. package/dist/http/CSRFMiddleware.d.ts +1 -1
  219. package/dist/http/CSRFMiddleware.d.ts.map +1 -1
  220. package/dist/http/Error.d.ts +50 -0
  221. package/dist/http/Error.d.ts.map +1 -1
  222. package/dist/http/HttpRequest.d.ts +26 -0
  223. package/dist/http/HttpRequest.d.ts.map +1 -1
  224. package/dist/http/RateLimitMiddleware.d.ts +6 -3
  225. package/dist/http/RateLimitMiddleware.d.ts.map +1 -1
  226. package/dist/http/Router.d.ts.map +1 -1
  227. package/dist/http/errors.d.ts.map +1 -1
  228. package/dist/http/index.d.ts +2 -1
  229. package/dist/http/index.d.ts.map +1 -1
  230. package/dist/http/index.js +2 -2
  231. package/dist/http/index.js.map +1 -1
  232. package/dist/http/mediaType.d.ts +16 -0
  233. package/dist/http/mediaType.d.ts.map +1 -0
  234. package/dist/http/refusal.d.ts +52 -0
  235. package/dist/http/refusal.d.ts.map +1 -0
  236. package/dist/i18n/dictionaryRuntime.js +2 -2
  237. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  238. package/dist/i18n/index.js +2 -2
  239. package/dist/i18n/index.js.map +2 -2
  240. package/dist/kernel/index.js +2 -2
  241. package/dist/kernel/index.js.map +2 -2
  242. package/dist/orm/index.js +2 -2
  243. package/dist/orm/index.js.map +1 -1
  244. package/dist/server/devFetch.d.ts.map +1 -1
  245. package/dist/server/forwardedFor.d.ts +42 -0
  246. package/dist/server/forwardedFor.d.ts.map +1 -0
  247. package/dist/server/httpProd.d.ts.map +1 -1
  248. package/dist/server/index.js +2 -2
  249. package/dist/server/index.js.map +1 -1
  250. package/dist/server/staticFile.d.ts +33 -0
  251. package/dist/server/staticFile.d.ts.map +1 -0
  252. package/dist/server/unhandledError.d.ts.map +1 -1
  253. package/dist/services/index.js +2 -2
  254. package/dist/services/index.js.map +2 -2
  255. package/dist/services/mcp/McpRegistry.d.ts +2 -1
  256. package/dist/services/mcp/McpRegistry.d.ts.map +1 -1
  257. package/dist/services/mcp/toAgentTools.d.ts +1 -1
  258. package/dist/services/mcp/toAgentTools.d.ts.map +1 -1
  259. package/dist/services/queue/work.js +2 -2
  260. package/dist/services/queue/work.js.map +1 -1
  261. package/dist/services/router/notFound.d.ts.map +1 -1
  262. package/dist/services/router/policyDenied.d.ts.map +1 -1
  263. package/dist/services/router/serverQueryFetcher.d.ts.map +1 -1
  264. package/dist/support/index.js +2 -2
  265. package/dist/support/index.js.map +1 -1
  266. package/dist/testing/index.js +1 -1
  267. package/package.json +1 -1
  268. package/skills/gemi-react-best-practices/rules/controller-throw-framework-errors.md +5 -0
  269. package/dist/chunk-302mkqeq.js +0 -7
  270. package/dist/chunk-49akdtfe.js +0 -17
  271. package/dist/chunk-ash9e6fn.js +0 -5
  272. package/dist/chunk-e43drft2.js +0 -5
  273. package/dist/chunk-j5xcfeqx.js +0 -24
  274. package/dist/chunk-j5xcfeqx.js.map +0 -16
  275. package/dist/chunk-rp5j1mgk.js +0 -55
  276. package/dist/chunk-tmwsvf02.js +0 -5
  277. package/dist/chunks/ThemeProvider-Dn3UREDn.js.map +0 -1
  278. /package/dist/{chunk-ah9ajys0.js.map → chunk-2gdhcswa.js.map} +0 -0
  279. /package/dist/{chunk-jg9eqd3r.js.map → chunk-c3gzpjba.js.map} +0 -0
  280. /package/dist/{chunk-pgpqsgzx.js.map → chunk-sejnmn1q.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { A as Action, B as isRetryableQueryError, C as I18nProvider, D as domainUrl, E as useLocation, F as QueryManagerContext, H as shouldRetryQuery, I as QueryManagerProvider, L as USER_QUERY_CONFIG_KEYS, M as toVariantKey, N as applyParams$1, O as isAbsoluteUrl, P as QueryConfigContext, R as pickDefined, S as I18nContext, T as ServerDataProvider, U as QueryError, V as retryDelayFor, W as Subject, _ as readRoutePayload, a as useRouteTransition, b as useSearchParams, c as ComponentsContext, d as loadViewModule, f as subscribeViewModules, g as setActiveLocale, h as registerDictionary, i as RouteTransitionProvider, l as ComponentsProvider, m as loadDictionaryForRender, n as useTheme, o as ClientRouterContext, p as loadDictionary, r as m, s as ClientRouterProvider, t as ThemeProvider, u as initialViewModulesReady, v as routeDataUrl, w as ServerDataContext, x as useNavigate, y as useRoute, z as DEFAULT_STALE_TIME } from "../chunks/ThemeProvider-Dn3UREDn.js";
1
+ import { A as Action, B as isRetryableQueryError, C as I18nProvider, D as domainUrl, E as useLocation, F as QueryManagerContext, H as shouldRetryQuery, I as QueryManagerProvider, L as USER_QUERY_CONFIG_KEYS, M as toVariantKey, N as applyParams$1, O as isAbsoluteUrl, P as QueryConfigContext, R as pickDefined, S as I18nContext, T as ServerDataProvider, U as QueryError, V as retryDelayFor, W as Subject, _ as readRoutePayload, a as useRouteTransition, b as useSearchParams, c as ComponentsContext, d as loadViewModule, f as subscribeViewModules, g as setActiveLocale, h as registerDictionary, i as RouteTransitionProvider, l as ComponentsProvider, m as loadDictionaryForRender, n as useTheme, o as ClientRouterContext, p as loadDictionary, r as m, s as ClientRouterProvider, t as ThemeProvider, u as initialViewModulesReady, v as routeDataUrl, w as ServerDataContext, x as useNavigate, y as useRoute, z as DEFAULT_STALE_TIME } from "../chunks/ThemeProvider-D1kDfCwY.js";
2
2
  import { n as RouteStateContext, r as RouteStateProvider, t as useParams } from "../chunks/useParams-BN3XXfmG.js";
3
3
  import { Fragment, StrictMode, Suspense, createContext, createElement, isValidElement, memo, use, useCallback, useContext, useDeferredValue, useEffect, useMemo, useRef, useState, useSyncExternalStore, useTransition } from "react";
4
4
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -151,6 +151,17 @@ function useFrameworkQuery(url, ...args) {
151
151
  const searchHint = variantKey ? `, { search: ${JSON.stringify(Object.fromEntries(new URLSearchParams(variantKey)))} }` : "";
152
152
  console.warn(`[gemi] useQuery("${url}") rendered on the server without data. The server never fetches, so this page ships without it and the client suspends after hydration. Add \`Query.prefetch("${url}"${searchHint})\` to the route's view handler.`);
153
153
  }
154
+ useEffect(() => {
155
+ if (!isDeferred) return;
156
+ const targetSeed = configRef.current.fallbackData != null ? { [currentVariantKey]: configRef.current.fallbackData } : prefetchedData?.[currentPath];
157
+ return getResource(currentPath, targetSeed ?? void 0).retain(currentVariantKey);
158
+ }, [
159
+ isDeferred,
160
+ getResource,
161
+ currentPath,
162
+ currentVariantKey,
163
+ prefetchedData
164
+ ]);
154
165
  useEffect(() => {
155
166
  if (fetchedRef.current) resource.getVariant(variantKey, configRef.current.staleTime);
156
167
  }, [variantKey, resource]);
@@ -485,33 +496,82 @@ function useInfiniteQuery(url, options, config) {
485
496
  };
486
497
  }
487
498
  //#endregion
499
+ //#region http/refusal.ts
500
+ /**
501
+ * The kind a status stands for, for a refusal that does not name one: an app's
502
+ * own `RequestBreakerError`, or an older server's `{ message }`. Any other 4xx
503
+ * is a `form_error`, a message about this request for `<FormError>` to show.
504
+ */
505
+ function refusalKindForStatus(status) {
506
+ if (status === 401) return "authentication";
507
+ if (status === 403) return "permission";
508
+ if (status === 404) return "not_found";
509
+ if (status === 416) return "range_not_satisfiable";
510
+ if (status === 429) return "rate_limit";
511
+ if (status >= 500) return "server_error";
512
+ return "form_error";
513
+ }
514
+ //#endregion
488
515
  //#region client/MutationError.ts
489
- var AUTHENTICATION = "Authentication error";
490
- var PERMISSION = ["Insufficient permissions", "Not authorized"];
491
- var CSRF = "Invalid CSRF token";
492
- var SERVER = "Internal Server Error";
516
+ var LEGACY_MESSAGES = {
517
+ "Authentication error": "authentication",
518
+ "Not authorized": "authorization",
519
+ "Insufficient permissions": "permission",
520
+ "Invalid CSRF token": "csrf",
521
+ "Internal Server Error": "server_error",
522
+ Forbidden: "permission",
523
+ "Not found": "not_found",
524
+ "Rate limit exceeded": "rate_limit"
525
+ };
493
526
  function isObject(error) {
494
527
  return typeof error === "object" && error !== null;
495
528
  }
496
- function bodyMessage(error) {
497
- return isObject(error) && !(error instanceof Error) && !("kind" in error) ? error.message : void 0;
529
+ function legacyKind(message, status) {
530
+ return LEGACY_MESSAGES[message] ?? (status === 401 ? "authorization" : refusalKindForStatus(status));
498
531
  }
499
532
  /**
500
533
  * The `MutationError` a non-2xx response's parsed body stands for.
501
534
  *
502
535
  * gemi's own error bodies are `{ error }`, and the value under `error` is what
503
- * the guards above read, so that is what is handed over. An app's body without
504
- * one — `HttpResponse.json({ message: "Taken" }, { status: 409 })` — is handed
505
- * over whole: read as `body.error` it was `undefined`, and a failed request
506
- * left `error` looking like no error at all. A body with no content to hand
507
- * over (`null`) becomes a `{ message }` naming the status.
536
+ * is handed over. An app's body without one —
537
+ * `HttpResponse.json({ message: "Taken" }, { status: 409 })` — is handed over
538
+ * whole. A body with no content (`null`) becomes a refusal naming the status.
539
+ *
540
+ * What is handed over carries `status`, and a `kind` when it has a `message`:
541
+ * a bare string, which servers before 0.85 sent for most refusals, becomes
542
+ * `{ kind, message, status }`, and so does a `{ message }` without a kind.
508
543
  *
509
544
  * @internal
510
545
  */
511
546
  function mutationErrorFromBody(body, status) {
512
- if (isObject(body) && "error" in body && body.error != null) return body.error;
513
- if (body == null) return { message: `Request failed with status ${status}` };
514
- return body;
547
+ const error = isObject(body) && "error" in body && body.error != null ? body.error : body;
548
+ if (error == null) return {
549
+ kind: refusalKindForStatus(status),
550
+ message: `Request failed with status ${status}`,
551
+ status
552
+ };
553
+ if (typeof error === "string") return {
554
+ kind: legacyKind(error, status),
555
+ message: error,
556
+ status
557
+ };
558
+ if (!isObject(error) || error instanceof Error) return error;
559
+ const withStatus = {
560
+ ...error,
561
+ status: typeof error.status === "number" ? error.status : status
562
+ };
563
+ if (typeof error.kind !== "string" && typeof error.message === "string") return {
564
+ ...withStatus,
565
+ kind: refusalKindForStatus(withStatus.status)
566
+ };
567
+ return withStatus;
568
+ }
569
+ function kindOf(error) {
570
+ if (typeof error === "string") return LEGACY_MESSAGES[error];
571
+ if (!isObject(error) || error instanceof Error) return void 0;
572
+ if (typeof error.kind === "string") return error.kind;
573
+ if (typeof error.status === "number") return refusalKindForStatus(error.status);
574
+ return typeof error.message === "string" ? LEGACY_MESSAGES[error.message] : void 0;
515
575
  }
516
576
  /** Field messages, as `<ValidationErrors>` renders them. */
517
577
  function isValidationError(error) {
@@ -523,35 +583,35 @@ function isFormError(error) {
523
583
  }
524
584
  /** No signed-in user: `AuthenticationError` (401). */
525
585
  function isAuthenticationError(error) {
526
- return error === AUTHENTICATION;
586
+ return kindOf(error) === "authentication";
527
587
  }
528
588
  /**
529
589
  * A signed-in user who may not do this: `InsufficientPermissionsError` (403),
530
- * `AuthorizationError` (401) or a policy denial (403, `{ message:
531
- * "Forbidden" }`). Recognised by the framework's default messages.
590
+ * `AuthorizationError` (401) or a policy denial (403), whatever message it was
591
+ * thrown with.
532
592
  */
533
593
  function isPermissionError(error) {
534
- return typeof error === "string" && PERMISSION.includes(error) || bodyMessage(error) === "Forbidden";
594
+ const kind = kindOf(error);
595
+ return kind === "permission" || kind === "authorization";
535
596
  }
536
597
  /** The CSRF cookie is missing or stale (403). A reload fixes it. */
537
598
  function isCsrfError(error) {
538
- return error === CSRF;
599
+ return kindOf(error) === "csrf";
539
600
  }
540
601
  /** A missing record, file or route (404). */
541
602
  function isNotFoundError(error) {
542
- return bodyMessage(error) === "Not found";
603
+ return kindOf(error) === "not_found";
543
604
  }
544
605
  /** `RateLimitMiddleware` refused the request (429). */
545
606
  function isRateLimitError(error) {
546
- return bodyMessage(error) === "Rate limit exceeded";
607
+ return kindOf(error) === "rate_limit";
547
608
  }
548
609
  /**
549
- * The server failed (a production 500), or answered something that is not
550
- * JSON. Under `gemi dev` a 500 carries the exception's message instead, which
551
- * is `"unknown"`.
610
+ * The server failed (a 500, under `gemi dev` too), or answered something that
611
+ * is not JSON.
552
612
  */
553
613
  function isServerError(error) {
554
- return error === SERVER || isObject(error) && error.kind === "server_error" || error instanceof SyntaxError;
614
+ return kindOf(error) === "server_error" || error instanceof SyntaxError;
555
615
  }
556
616
  /** The request got no answer: offline, DNS, CORS, a dropped connection. */
557
617
  function isNetworkError(error) {
@@ -559,8 +619,7 @@ function isNetworkError(error) {
559
619
  }
560
620
  /**
561
621
  * Which of the guards above `error` passes, for a `switch` over all of them.
562
- * `"unknown"` is everything else: a refusal thrown with a message of its own,
563
- * a 500 under `gemi dev`, an error body of the app's own shape.
622
+ * `"unknown"` is everything else: a 416, an error body of the app's own shape.
564
623
  */
565
624
  function mutationErrorKind(error) {
566
625
  if (isValidationError(error)) return "validation";
@@ -593,26 +652,49 @@ function useMutation(method, url, ...args) {
593
652
  const [state, setState] = useState({
594
653
  data: null,
595
654
  error: null,
596
- loading: false
655
+ loading: false,
656
+ pending: 0
597
657
  });
598
658
  const abortController = useRef(new AbortController());
599
659
  const latestRequest = useRef(0);
660
+ const inFlight = useRef(/* @__PURE__ */ new Set());
600
661
  const formData = useRef(new FormData());
601
662
  const [inputs = {}, config] = args ?? [];
602
663
  const options = {
603
664
  ...defaultOptions,
604
665
  ...config
605
666
  };
606
- async function trigger(input) {
667
+ const parallel = options.concurrency === "parallel";
668
+ async function trigger(input, call = {}) {
607
669
  const controller = new AbortController();
608
670
  abortController.current = controller;
671
+ if (parallel) inFlight.current.add(controller);
609
672
  const requestId = ++latestRequest.current;
610
- const isLatest = () => latestRequest.current === requestId;
673
+ const isSuperseded = () => !parallel && latestRequest.current !== requestId;
611
674
  setState((prev) => ({
612
675
  data: prev.data,
613
- error: null,
614
- loading: true
676
+ error: parallel ? prev.error : null,
677
+ loading: true,
678
+ pending: prev.pending + 1
615
679
  }));
680
+ let left = false;
681
+ const settle = (update, superseded = false) => {
682
+ inFlight.current.delete(controller);
683
+ const leaving = !left;
684
+ left = true;
685
+ setState((prev) => {
686
+ const pending = leaving ? prev.pending - 1 : prev.pending;
687
+ return {
688
+ ...update(prev),
689
+ pending,
690
+ loading: parallel ? pending > 0 : superseded ? prev.loading : false
691
+ };
692
+ });
693
+ };
694
+ const sentFormData = typeof input === "undefined" ? formData.current : null;
695
+ const resetFormData = () => {
696
+ if (!parallel || formData.current === sentFormData) formData.current = new FormData();
697
+ };
616
698
  const params = "params" in inputs ? {
617
699
  ..._params,
618
700
  ...inputs.params
@@ -633,42 +715,45 @@ function useMutation(method, url, ...args) {
633
715
  signal: controller.signal
634
716
  });
635
717
  const data = await response.json();
636
- if (!isLatest()) return;
637
- formData.current = new FormData();
718
+ if (isSuperseded()) {
719
+ settle((prev) => prev, true);
720
+ return;
721
+ }
722
+ resetFormData();
638
723
  if (!response.ok) {
639
724
  const error = mutationErrorFromBody(data, response.status);
640
- setState((prev) => ({
725
+ settle((prev) => ({
641
726
  data: prev.data,
642
- error,
643
- loading: false
727
+ error
644
728
  }));
645
729
  options.onError(error);
730
+ call.onError?.(error);
646
731
  return;
647
732
  }
648
733
  clearPrefetchCache?.();
649
734
  options.onSuccess(data);
650
- setState({
735
+ call.onSuccess?.(data);
736
+ settle(() => ({
651
737
  data,
652
- error: null,
653
- loading: false
654
- });
738
+ error: null
739
+ }));
655
740
  return data;
656
741
  } catch (error) {
657
- if (!isLatest()) return;
658
- formData.current = new FormData();
742
+ if (isSuperseded()) {
743
+ settle((prev) => prev, true);
744
+ return;
745
+ }
746
+ resetFormData();
659
747
  if (error?.name === "AbortError") {
660
- setState((prev) => ({
661
- ...prev,
662
- loading: false
663
- }));
748
+ settle((prev) => prev);
664
749
  return;
665
750
  }
666
751
  options.onError(error);
667
- setState({
668
- data: null,
669
- error,
670
- loading: false
671
- });
752
+ call.onError?.(error);
753
+ settle((prev) => ({
754
+ data: parallel ? prev.data : null,
755
+ error
756
+ }));
672
757
  }
673
758
  }
674
759
  trigger.formData = (formData) => {
@@ -678,13 +763,17 @@ function useMutation(method, url, ...args) {
678
763
  data: state.data,
679
764
  error: state.error,
680
765
  loading: state.loading,
766
+ pending: state.pending,
681
767
  formData: formData.current,
682
768
  cancel: () => {
683
- abortController.current.abort();
684
- setState((prev) => ({
685
- ...prev,
686
- loading: false
687
- }));
769
+ if (parallel) for (const controller of inFlight.current) controller.abort();
770
+ else {
771
+ abortController.current.abort();
772
+ setState((prev) => ({
773
+ ...prev,
774
+ loading: false
775
+ }));
776
+ }
688
777
  formData.current = new FormData();
689
778
  options.onCanceled?.();
690
779
  },
@@ -773,7 +862,8 @@ function useUpload(url, ...args) {
773
862
  if (outcome.status < 200 || outcome.status > 299) {
774
863
  let error = {
775
864
  kind: "server_error",
776
- message: outcome.statusText
865
+ message: outcome.statusText,
866
+ status: outcome.status
777
867
  };
778
868
  try {
779
869
  error = mutationErrorFromBody(JSON.parse(outcome.body), outcome.status);
@@ -1135,6 +1225,21 @@ var Link = memo((props) => {
1135
1225
  }
1136
1226
  return /* @__PURE__ */ jsx(RouteLink, { ...props });
1137
1227
  });
1228
+ /**
1229
+ * Clicks the router must not take over, so the browser does what it would for a
1230
+ * plain anchor: a new tab or window for `target="_blank"` and for cmd/ctrl/
1231
+ * shift/alt-clicks, the context action for a middle click, a file for
1232
+ * `download`, and nothing at all when a handler has already cancelled the click.
1233
+ */
1234
+ function leaveClickToBrowser(event) {
1235
+ if (event.defaultPrevented) return true;
1236
+ if (event.button !== 0) return true;
1237
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return true;
1238
+ const anchor = event.currentTarget;
1239
+ const target = anchor.getAttribute("target");
1240
+ if (target && target !== "_self") return true;
1241
+ return anchor.hasAttribute("download");
1242
+ }
1138
1243
  var RouteLink = memo((props) => {
1139
1244
  const _params = useParams();
1140
1245
  const { isTransitioning, targetPath } = useRouteTransition();
@@ -1227,15 +1332,14 @@ var RouteLink = memo((props) => {
1227
1332
  "data-pending": isTransitioning && resolvedPath === targetPath,
1228
1333
  href: targetHref === "" ? "/" : targetHref,
1229
1334
  onClick: (e) => {
1230
- if (typeof window !== "undefined") {
1231
- if (currentHref === targetHref) {
1232
- e.preventDefault();
1233
- return;
1234
- }
1335
+ onClick?.(e);
1336
+ if (leaveClickToBrowser(e)) return;
1337
+ if (currentHref === targetHref) {
1338
+ e.preventDefault();
1339
+ return;
1235
1340
  }
1236
1341
  let currentPath = window.location.pathname.replace(localeSegment, "");
1237
1342
  currentPath = currentPath === "" ? "/" : currentPath;
1238
- onClick?.(e);
1239
1343
  if (hash === "") e.preventDefault();
1240
1344
  push(href, {
1241
1345
  hash,