gemi 0.57.0 → 0.58.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 (223) hide show
  1. package/dist/app/index.js +1 -1
  2. package/dist/broadcasting/index.js +1 -1
  3. package/dist/bun/plugin.js +1 -1
  4. package/dist/bun/preload.js +1 -1
  5. package/dist/{chunk-msyqr4y7.js → chunk-0a2xgcj3.js} +2 -2
  6. package/dist/{chunk-msyqr4y7.js.map → chunk-0a2xgcj3.js.map} +1 -1
  7. package/dist/{chunk-64bq12j3.js → chunk-3337e5g0.js} +2 -2
  8. package/dist/{chunk-64bq12j3.js.map → chunk-3337e5g0.js.map} +1 -1
  9. package/dist/{chunk-5fmbsy4q.js → chunk-3aa287k7.js} +2 -2
  10. package/dist/{chunk-5fmbsy4q.js.map → chunk-3aa287k7.js.map} +1 -1
  11. package/dist/{chunk-f233yzxf.js → chunk-3g5bjvdf.js} +2 -2
  12. package/dist/{chunk-f233yzxf.js.map → chunk-3g5bjvdf.js.map} +1 -1
  13. package/dist/{chunk-rc2asvyf.js → chunk-3xadx444.js} +2 -2
  14. package/dist/{chunk-rc2asvyf.js.map → chunk-3xadx444.js.map} +1 -1
  15. package/dist/{chunk-7pn0bnsc.js → chunk-3zxwscmf.js} +2 -2
  16. package/dist/{chunk-4f69ygc8.js.map → chunk-3zxwscmf.js.map} +1 -1
  17. package/dist/{chunk-jzatvtjd.js → chunk-437085pe.js} +2 -2
  18. package/dist/{chunk-jzatvtjd.js.map → chunk-437085pe.js.map} +1 -1
  19. package/dist/{chunk-17m5wxv0.js → chunk-4yt5x8s2.js} +2 -2
  20. package/dist/{chunk-17m5wxv0.js.map → chunk-4yt5x8s2.js.map} +1 -1
  21. package/dist/{chunk-dxxak51x.js → chunk-5athahgr.js} +2 -2
  22. package/dist/{chunk-dxxak51x.js.map → chunk-5athahgr.js.map} +1 -1
  23. package/dist/{chunk-dcwjwfjc.js → chunk-5n2rvfh3.js} +2 -2
  24. package/dist/{chunk-dcwjwfjc.js.map → chunk-5n2rvfh3.js.map} +1 -1
  25. package/dist/{chunk-r8637cqv.js → chunk-6235kb30.js} +3 -3
  26. package/dist/{chunk-r8637cqv.js.map → chunk-6235kb30.js.map} +1 -1
  27. package/dist/{chunk-67zyjx0c.js → chunk-7b0x860b.js} +2 -2
  28. package/dist/{chunk-67zyjx0c.js.map → chunk-7b0x860b.js.map} +1 -1
  29. package/dist/{chunk-q8k3gh8k.js → chunk-7ef5n8k2.js} +2 -2
  30. package/dist/{chunk-q8k3gh8k.js.map → chunk-7ef5n8k2.js.map} +1 -1
  31. package/dist/{chunk-n2zmg475.js → chunk-7j6wbv12.js} +2 -2
  32. package/dist/{chunk-n2zmg475.js.map → chunk-7j6wbv12.js.map} +1 -1
  33. package/dist/{chunk-g5pj95dz.js → chunk-86jebsm4.js} +3 -3
  34. package/dist/{chunk-g5pj95dz.js.map → chunk-86jebsm4.js.map} +1 -1
  35. package/dist/chunk-87qab82w.js +5 -0
  36. package/dist/{chunk-9j9wqrb2.js.map → chunk-87qab82w.js.map} +7 -3
  37. package/dist/{chunk-dwz0wbhj.js → chunk-8gew8b9a.js} +2 -2
  38. package/dist/{chunk-dwz0wbhj.js.map → chunk-8gew8b9a.js.map} +1 -1
  39. package/dist/{chunk-74aj8ms2.js → chunk-9m2tbf3n.js} +2 -2
  40. package/dist/{chunk-74aj8ms2.js.map → chunk-9m2tbf3n.js.map} +1 -1
  41. package/dist/{chunk-bw8kt7ps.js → chunk-a2sgjpvq.js} +2 -2
  42. package/dist/{chunk-bw8kt7ps.js.map → chunk-a2sgjpvq.js.map} +1 -1
  43. package/dist/chunk-b35e128b.js +5 -0
  44. package/dist/{chunk-r9as9htn.js.map → chunk-b35e128b.js.map} +1 -1
  45. package/dist/{chunk-1esnvq2z.js → chunk-cyaz97p5.js} +2 -2
  46. package/dist/{chunk-1esnvq2z.js.map → chunk-cyaz97p5.js.map} +1 -1
  47. package/dist/{chunk-mqwrmbh4.js → chunk-d125j8t0.js} +3 -3
  48. package/dist/{chunk-mqwrmbh4.js.map → chunk-d125j8t0.js.map} +1 -1
  49. package/dist/{chunk-yhzb9qpk.js → chunk-dgsgjg53.js} +2 -2
  50. package/dist/{chunk-yhzb9qpk.js.map → chunk-dgsgjg53.js.map} +1 -1
  51. package/dist/{chunk-6c14bexh.js → chunk-eejmhtnc.js} +2 -2
  52. package/dist/{chunk-6c14bexh.js.map → chunk-eejmhtnc.js.map} +1 -1
  53. package/dist/{chunk-vdzb29p5.js → chunk-fjm4y8bn.js} +2 -2
  54. package/dist/{chunk-vdzb29p5.js.map → chunk-fjm4y8bn.js.map} +1 -1
  55. package/dist/{chunk-ma5rj4st.js → chunk-grdahng8.js} +2 -2
  56. package/dist/{chunk-ma5rj4st.js.map → chunk-grdahng8.js.map} +1 -1
  57. package/dist/{chunk-5txddtaa.js → chunk-gw6agevz.js} +3 -3
  58. package/dist/{chunk-5txddtaa.js.map → chunk-gw6agevz.js.map} +1 -1
  59. package/dist/{chunk-ba0rkpk5.js → chunk-hppagzz4.js} +4 -4
  60. package/dist/{chunk-ba0rkpk5.js.map → chunk-hppagzz4.js.map} +1 -1
  61. package/dist/chunk-hwa5sqw5.js +19 -0
  62. package/dist/{chunk-r9h6aj7g.js.map → chunk-hwa5sqw5.js.map} +12 -6
  63. package/dist/chunk-hxf1re93.js +4 -0
  64. package/dist/{chunk-6fc909z5.js.map → chunk-hxf1re93.js.map} +6 -5
  65. package/dist/{chunk-d6kgxmp7.js → chunk-j0c6ytkj.js} +3 -3
  66. package/dist/{chunk-d6kgxmp7.js.map → chunk-j0c6ytkj.js.map} +1 -1
  67. package/dist/{chunk-4f69ygc8.js → chunk-jhkjz9jr.js} +2 -2
  68. package/dist/{chunk-7pn0bnsc.js.map → chunk-jhkjz9jr.js.map} +1 -1
  69. package/dist/{chunk-e9zz0zfv.js → chunk-k0fvsyeh.js} +1 -1
  70. package/dist/{chunk-j21tm6jf.js → chunk-keehyx51.js} +2 -2
  71. package/dist/{chunk-j21tm6jf.js.map → chunk-keehyx51.js.map} +1 -1
  72. package/dist/{chunk-a70s8pz4.js → chunk-m3xy5xyf.js} +2 -2
  73. package/dist/{chunk-a70s8pz4.js.map → chunk-m3xy5xyf.js.map} +1 -1
  74. package/dist/{chunk-swe2b6rv.js → chunk-mkfpnymy.js} +1 -1
  75. package/dist/{chunk-qkrba9c2.js → chunk-mwpdp09e.js} +2 -2
  76. package/dist/{chunk-qkrba9c2.js.map → chunk-mwpdp09e.js.map} +1 -1
  77. package/dist/{chunk-tzsnadg1.js → chunk-pmhd6zfc.js} +3 -3
  78. package/dist/{chunk-tzsnadg1.js.map → chunk-pmhd6zfc.js.map} +1 -1
  79. package/dist/chunk-qb5mv6pj.js +5 -0
  80. package/dist/chunk-qb5mv6pj.js.map +12 -0
  81. package/dist/{chunk-nqk3cx97.js → chunk-qgxr0g36.js} +2 -2
  82. package/dist/{chunk-nqk3cx97.js.map → chunk-qgxr0g36.js.map} +1 -1
  83. package/dist/{chunk-btr9kyqh.js → chunk-sy7jbdeb.js} +2 -2
  84. package/dist/{chunk-btr9kyqh.js.map → chunk-sy7jbdeb.js.map} +1 -1
  85. package/dist/{chunk-5z5xskg1.js → chunk-szss069z.js} +2 -2
  86. package/dist/{chunk-5z5xskg1.js.map → chunk-szss069z.js.map} +1 -1
  87. package/dist/{chunk-rxsmwbxv.js → chunk-tss5svjr.js} +2 -2
  88. package/dist/{chunk-rxsmwbxv.js.map → chunk-tss5svjr.js.map} +1 -1
  89. package/dist/{chunk-32d510cd.js → chunk-vr90r27j.js} +2 -2
  90. package/dist/{chunk-32d510cd.js.map → chunk-vr90r27j.js.map} +1 -1
  91. package/dist/{chunk-jny4f23c.js → chunk-w62m5f0n.js} +3 -3
  92. package/dist/{chunk-jny4f23c.js.map → chunk-w62m5f0n.js.map} +1 -1
  93. package/dist/{chunk-k5bjfhz8.js → chunk-w7rf99w6.js} +2 -2
  94. package/dist/{chunk-k5bjfhz8.js.map → chunk-w7rf99w6.js.map} +1 -1
  95. package/dist/{chunk-fck5yw2s.js → chunk-wbrj0gya.js} +2 -2
  96. package/dist/{chunk-fck5yw2s.js.map → chunk-wbrj0gya.js.map} +1 -1
  97. package/dist/{chunk-11dkjm1r.js → chunk-xdv1b8mr.js} +2 -2
  98. package/dist/{chunk-11dkjm1r.js.map → chunk-xdv1b8mr.js.map} +1 -1
  99. package/dist/{chunk-katt90qz.js → chunk-xey9cbap.js} +2 -2
  100. package/dist/{chunk-katt90qz.js.map → chunk-xey9cbap.js.map} +1 -1
  101. package/dist/{chunk-ae6xz52s.js → chunk-xzk827r3.js} +2 -2
  102. package/dist/{chunk-ae6xz52s.js.map → chunk-xzk827r3.js.map} +1 -1
  103. package/dist/{chunk-8v81dvje.js → chunk-y6a8r2bn.js} +3 -3
  104. package/dist/{chunk-8v81dvje.js.map → chunk-y6a8r2bn.js.map} +1 -1
  105. package/dist/{chunk-nkbreczg.js → chunk-yed5whgs.js} +3 -3
  106. package/dist/{chunk-nkbreczg.js.map → chunk-yed5whgs.js.map} +1 -1
  107. package/dist/{chunk-cecq6q1b.js → chunk-yf7vz71n.js} +1 -1
  108. package/dist/{chunk-knvxwrwh.js → chunk-yjzs247s.js} +2 -2
  109. package/dist/{chunk-knvxwrwh.js.map → chunk-yjzs247s.js.map} +1 -1
  110. package/dist/{chunk-ka4tdhm8.js → chunk-yy0eb9wn.js} +2 -2
  111. package/dist/{chunk-ka4tdhm8.js.map → chunk-yy0eb9wn.js.map} +1 -1
  112. package/dist/{chunk-1nqdzmvm.js → chunk-zbxgbr12.js} +2 -2
  113. package/dist/{chunk-1nqdzmvm.js.map → chunk-zbxgbr12.js.map} +1 -1
  114. package/dist/{chunk-wrypq618.js → chunk-zh2egcyb.js} +2 -2
  115. package/dist/{chunk-wrypq618.js.map → chunk-zh2egcyb.js.map} +1 -1
  116. package/dist/chunks/ThemeProvider-li1J_igh.js.map +1 -1
  117. package/dist/client/ClientRouter.d.ts.map +1 -1
  118. package/dist/client/ProgressManager.d.ts +1 -1
  119. package/dist/client/RouteStateContext.d.ts +9 -0
  120. package/dist/client/RouteStateContext.d.ts.map +1 -1
  121. package/dist/client/ServerDataProvider.d.ts +7 -0
  122. package/dist/client/ServerDataProvider.d.ts.map +1 -1
  123. package/dist/client/index.d.ts +2 -1
  124. package/dist/client/index.d.ts.map +1 -1
  125. package/dist/client/index.js +68 -10
  126. package/dist/client/index.js.map +1 -1
  127. package/dist/client/rpc.d.ts +42 -0
  128. package/dist/client/rpc.d.ts.map +1 -1
  129. package/dist/client/useFeature.d.ts +40 -0
  130. package/dist/client/useFeature.d.ts.map +1 -0
  131. package/dist/config/index.js +1 -1
  132. package/dist/console/run.js +2 -2
  133. package/dist/console/run.js.map +1 -1
  134. package/dist/container/index.js +2 -2
  135. package/dist/container/index.js.map +1 -1
  136. package/dist/database/index.js +2 -2
  137. package/dist/database/index.js.map +1 -1
  138. package/dist/email/index.js +2 -2
  139. package/dist/email/index.js.map +1 -1
  140. package/dist/facades/Features.d.ts +57 -0
  141. package/dist/facades/Features.d.ts.map +1 -0
  142. package/dist/facades/index.d.ts +1 -0
  143. package/dist/facades/index.d.ts.map +1 -1
  144. package/dist/facades/index.js +2 -2
  145. package/dist/facades/index.js.map +1 -1
  146. package/dist/foundation/index.js +2 -2
  147. package/dist/foundation/index.js.map +1 -1
  148. package/dist/gemi.d.ts +13 -5
  149. package/dist/http/ApiRouter.d.ts +3 -2
  150. package/dist/http/ApiRouter.d.ts.map +1 -1
  151. package/dist/http/HttpRequest.d.ts +4 -0
  152. package/dist/http/HttpRequest.d.ts.map +1 -1
  153. package/dist/http/ViewRouter.d.ts +127 -4
  154. package/dist/http/ViewRouter.d.ts.map +1 -1
  155. package/dist/http/index.d.ts +1 -0
  156. package/dist/http/index.d.ts.map +1 -1
  157. package/dist/http/index.js +2 -2
  158. package/dist/http/index.js.map +1 -1
  159. package/dist/http/middlewareList.d.ts +25 -0
  160. package/dist/http/middlewareList.d.ts.map +1 -0
  161. package/dist/http/requestContext.d.ts +57 -0
  162. package/dist/http/requestContext.d.ts.map +1 -1
  163. package/dist/i18n/dictionaryRuntime.js +2 -2
  164. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  165. package/dist/i18n/index.js +2 -2
  166. package/dist/i18n/index.js.map +1 -1
  167. package/dist/kernel/index.js +3 -3
  168. package/dist/kernel/index.js.map +3 -3
  169. package/dist/kernel/providers.d.ts +2 -2
  170. package/dist/kernel/providers.d.ts.map +1 -1
  171. package/dist/orm/index.js +2 -2
  172. package/dist/orm/index.js.map +1 -1
  173. package/dist/server/index.js +2 -2
  174. package/dist/server/index.js.map +1 -1
  175. package/dist/services/features/FeatureFlagStore.d.ts +60 -0
  176. package/dist/services/features/FeatureFlagStore.d.ts.map +1 -0
  177. package/dist/services/features/FeatureManager.d.ts +82 -0
  178. package/dist/services/features/FeatureManager.d.ts.map +1 -0
  179. package/dist/services/features/FeaturesServiceProvider.d.ts +6 -0
  180. package/dist/services/features/FeaturesServiceProvider.d.ts.map +1 -0
  181. package/dist/services/features/bucket.d.ts +57 -0
  182. package/dist/services/features/bucket.d.ts.map +1 -0
  183. package/dist/services/features/config.d.ts +57 -0
  184. package/dist/services/features/config.d.ts.map +1 -0
  185. package/dist/services/features/context.d.ts +31 -0
  186. package/dist/services/features/context.d.ts.map +1 -0
  187. package/dist/services/features/defineFeature.d.ts +145 -0
  188. package/dist/services/features/defineFeature.d.ts.map +1 -0
  189. package/dist/services/features/evaluate.d.ts +74 -0
  190. package/dist/services/features/evaluate.d.ts.map +1 -0
  191. package/dist/services/features/sources/DatabaseFeatureFlagSource.d.ts +19 -0
  192. package/dist/services/features/sources/DatabaseFeatureFlagSource.d.ts.map +1 -0
  193. package/dist/services/features/sources/FeatureFlagSource.d.ts +30 -0
  194. package/dist/services/features/sources/FeatureFlagSource.d.ts.map +1 -0
  195. package/dist/services/features/sources/StaticFeatureFlagSource.d.ts +24 -0
  196. package/dist/services/features/sources/StaticFeatureFlagSource.d.ts.map +1 -0
  197. package/dist/services/features/types.d.ts +63 -0
  198. package/dist/services/features/types.d.ts.map +1 -0
  199. package/dist/services/index.d.ts +12 -0
  200. package/dist/services/index.d.ts.map +1 -1
  201. package/dist/services/index.js +8 -8
  202. package/dist/services/index.js.map +6 -4
  203. package/dist/services/router/ViewRouteDispatcher.d.ts +8 -0
  204. package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
  205. package/dist/services/router/createFlatViewRoutes.d.ts +14 -0
  206. package/dist/services/router/createFlatViewRoutes.d.ts.map +1 -1
  207. package/dist/services/router/streamQueryInjection.d.ts.map +1 -1
  208. package/dist/support/index.js +2 -2
  209. package/dist/support/index.js.map +1 -1
  210. package/dist/testing/Page.d.ts +12 -0
  211. package/dist/testing/Page.d.ts.map +1 -1
  212. package/dist/testing/index.js +7 -3
  213. package/dist/testing/index.js.map +1 -1
  214. package/package.json +1 -1
  215. package/dist/chunk-6fc909z5.js +0 -4
  216. package/dist/chunk-9j9wqrb2.js +0 -5
  217. package/dist/chunk-qfzyym5h.js +0 -5
  218. package/dist/chunk-qfzyym5h.js.map +0 -12
  219. package/dist/chunk-r9as9htn.js +0 -5
  220. package/dist/chunk-r9h6aj7g.js +0 -19
  221. /package/dist/{chunk-e9zz0zfv.js.map → chunk-k0fvsyeh.js.map} +0 -0
  222. /package/dist/{chunk-swe2b6rv.js.map → chunk-mkfpnymy.js.map} +0 -0
  223. /package/dist/{chunk-cecq6q1b.js.map → chunk-yf7vz71n.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{w as r}from"./chunk-fck5yw2s.js";import{N as mc}from"./chunk-ma5rj4st.js";import"./chunk-32d510cd.js";import"./chunk-rxsmwbxv.js";import{Y as _}from"./chunk-katt90qz.js";import{lf as u,of as O}from"./chunk-4f69ygc8.js";import{Buffer as hc}from"buffer";import{request as Yc}from"http";function E(c){return new Promise((I,x)=>{let N=Yc({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});N.on("error",(T)=>{x(Object.assign(new K.ProviderError("Unable to connect to instance metadata service"),T)),N.destroy()}),N.on("timeout",()=>{x(new K.ProviderError("TimeoutError from instance metadata service")),N.destroy()}),N.on("response",(T)=>{let{statusCode:y=400}=T;if(y<200||300<=y)x(Object.assign(new K.ProviderError("Error response received from instance metadata service"),{statusCode:y})),N.destroy();let $=[];T.on("data",(w)=>{$.push(w)}),T.on("end",()=>{I(hc.concat($)),N.destroy()})}),N.end()})}var K;var D=O(()=>{K=u(_(),1)});var G=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",L=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var W=()=>{};var Hc=1000,qc=0,Q=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var X=()=>{};var v=(c,I)=>{let x=c();for(let N=0;N<I;N++)x=x.catch(c);return x};var b=()=>{};import{parse as Sc}from"url";var z,H="AWS_CONTAINER_CREDENTIALS_FULL_URI",q="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",M="AWS_CONTAINER_AUTHORIZATION_TOKEN",kc=(c={})=>{let{timeout:I,maxRetries:x}=Q(c);return()=>v(async()=>{let N=await jc({logger:c.logger}),T=JSON.parse(await fc(I,N));if(!G(T))throw new z.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:c.logger});return L(T)},x)},fc=async(c,I)=>{if(process.env[M])I.headers={...I.headers,Authorization:process.env[M]};return(await E({...I,timeout:c})).toString()},uc="169.254.170.2",Ec,$c,jc=async({logger:c})=>{if(process.env[q])return{hostname:uc,path:process.env[q]};if(process.env[H]){let I=Sc(process.env[H]);if(!I.hostname||!(I.hostname in Ec))throw new z.CredentialsProviderError(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in $c))throw new z.CredentialsProviderError(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new z.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${q} or ${H} environment variable is set`,{tryNextLink:!1,logger:c})};var p=O(()=>{D();W();X();b();z=u(_(),1),Ec={localhost:!0,"127.0.0.1":!0},$c={"http:":!0,"https:":!0}});var C,Z;var a=O(()=>{C=u(_(),1);Z=class Z extends C.CredentialsProviderError{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(c,I=!0){super(c,I);this.tryNextLink=I,Object.setPrototypeOf(this,Z.prototype)}}});var J;var B=O(()=>{(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(J||(J={}))});var n;var o=O(()=>{n={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0}});var f;var t=O(()=>{(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(f||(f={}))});var Ac="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",Jc="ec2_metadata_service_endpoint_mode",s;var g=O(()=>{t();s={environmentVariableSelector:(c)=>c[Ac],configFileSelector:(c)=>c[Jc],default:f.IPv4}});var U,l,F=async()=>l.parseUrl(await vc()||await zc()),vc=async()=>U.loadConfig(n)(),zc=async()=>{let c=await U.loadConfig(s)();switch(c){case f.IPv4:return J.IPv4;case f.IPv6:return J.IPv6;default:throw Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(f)}`)}};var P=O(()=>{B();o();t();g();U=u(r(),1),l=u(mc(),1)});var V=(c,I)=>{let x=300+Math.floor(Math.random()*300),N=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(N)}.
2
+ import{w as r}from"./chunk-wbrj0gya.js";import{N as mc}from"./chunk-grdahng8.js";import"./chunk-vr90r27j.js";import"./chunk-tss5svjr.js";import{Y as _}from"./chunk-xey9cbap.js";import{Df as u,Gf as O}from"./chunk-jhkjz9jr.js";import{Buffer as hc}from"buffer";import{request as Yc}from"http";function E(c){return new Promise((I,x)=>{let N=Yc({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});N.on("error",(T)=>{x(Object.assign(new K.ProviderError("Unable to connect to instance metadata service"),T)),N.destroy()}),N.on("timeout",()=>{x(new K.ProviderError("TimeoutError from instance metadata service")),N.destroy()}),N.on("response",(T)=>{let{statusCode:y=400}=T;if(y<200||300<=y)x(Object.assign(new K.ProviderError("Error response received from instance metadata service"),{statusCode:y})),N.destroy();let $=[];T.on("data",(w)=>{$.push(w)}),T.on("end",()=>{I(hc.concat($)),N.destroy()})}),N.end()})}var K;var D=O(()=>{K=u(_(),1)});var G=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",L=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var W=()=>{};var Hc=1000,qc=0,Q=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var X=()=>{};var v=(c,I)=>{let x=c();for(let N=0;N<I;N++)x=x.catch(c);return x};var b=()=>{};import{parse as Sc}from"url";var z,H="AWS_CONTAINER_CREDENTIALS_FULL_URI",q="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",M="AWS_CONTAINER_AUTHORIZATION_TOKEN",kc=(c={})=>{let{timeout:I,maxRetries:x}=Q(c);return()=>v(async()=>{let N=await jc({logger:c.logger}),T=JSON.parse(await fc(I,N));if(!G(T))throw new z.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:c.logger});return L(T)},x)},fc=async(c,I)=>{if(process.env[M])I.headers={...I.headers,Authorization:process.env[M]};return(await E({...I,timeout:c})).toString()},uc="169.254.170.2",Ec,$c,jc=async({logger:c})=>{if(process.env[q])return{hostname:uc,path:process.env[q]};if(process.env[H]){let I=Sc(process.env[H]);if(!I.hostname||!(I.hostname in Ec))throw new z.CredentialsProviderError(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in $c))throw new z.CredentialsProviderError(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new z.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${q} or ${H} environment variable is set`,{tryNextLink:!1,logger:c})};var p=O(()=>{D();W();X();b();z=u(_(),1),Ec={localhost:!0,"127.0.0.1":!0},$c={"http:":!0,"https:":!0}});var C,Z;var a=O(()=>{C=u(_(),1);Z=class Z extends C.CredentialsProviderError{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(c,I=!0){super(c,I);this.tryNextLink=I,Object.setPrototypeOf(this,Z.prototype)}}});var J;var B=O(()=>{(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(J||(J={}))});var n;var o=O(()=>{n={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0}});var f;var t=O(()=>{(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(f||(f={}))});var Ac="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",Jc="ec2_metadata_service_endpoint_mode",s;var g=O(()=>{t();s={environmentVariableSelector:(c)=>c[Ac],configFileSelector:(c)=>c[Jc],default:f.IPv4}});var U,l,F=async()=>l.parseUrl(await vc()||await zc()),vc=async()=>U.loadConfig(n)(),zc=async()=>{let c=await U.loadConfig(s)();switch(c){case f.IPv4:return J.IPv4;case f.IPv6:return J.IPv6;default:throw Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(f)}`)}};var P=O(()=>{B();o();t();g();U=u(r(),1),l=u(mc(),1)});var V=(c,I)=>{let x=300+Math.floor(Math.random()*300),N=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(N)}.
3
3
  For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let T=c.originalExpiration??c.expiration;return{...c,...T?{originalExpiration:T}:{},expiration:N}};var d=()=>{};var e=(c,I={})=>{let x=I?.logger||console,N;return async()=>{let T;try{if(T=await c(),T.expiration&&T.expiration.getTime()<Date.now())T=V(T,x)}catch(y){if(N)x.warn("Credential renew failed: ",y),T=V(N,x);else throw y}return N=T,T}};var i=O(()=>{d()});var Nc,k,Tc="/latest/meta-data/iam/security-credentials/",Kc="/latest/api/token",R="AWS_EC2_METADATA_V1_DISABLED",cc="ec2_metadata_v1_disabled",Ic="x-aws-ec2-metadata-token",YI=(c={})=>e(_c(c),{logger:c.logger}),_c=(c={})=>{let I=!1,{logger:x,profile:N}=c,{timeout:T,maxRetries:y}=Q(c),$=async(w,j)=>{if(I||j.headers?.[Ic]==null){let h=!1,Y=!1,wc=await Nc.loadConfig({environmentVariableSelector:(S)=>{let A=S[R];if(Y=!!A&&A!=="false",A===void 0)throw new k.CredentialsProviderError(`${R} not set in env, checking config file next.`,{logger:c.logger});return Y},configFileSelector:(S)=>{let A=S[cc];return h=!!A&&A!=="false",h},default:!1},{profile:N})();if(c.ec2MetadataV1Disabled||wc){let S=[];if(c.ec2MetadataV1Disabled)S.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(h)S.push(`config file profile (${cc})`);if(Y)S.push(`process environment variable (${R})`);throw new Z(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${S.join(", ")}].`)}}let yc=(await v(async()=>{let h;try{h=await Gc(j)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)).trim();return v(async()=>{let h;try{h=await Lc(yc,j,c)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)};return async()=>{let w=await F();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),$(y,{...w,timeout:T});else{let j;try{j=(await Dc({...w,timeout:T})).toString()}catch(m){if(m?.statusCode===400)throw Object.assign(m,{message:"EC2 Metadata token request returned error"});else if(m.message==="TimeoutError"||[403,404,405].includes(m.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),$(y,{...w,timeout:T})}return $(y,{...w,headers:{[Ic]:j},timeout:T})}}},Dc=async(c)=>E({...c,path:Kc,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Gc=async(c)=>(await E({...c,path:Tc})).toString(),Lc=async(c,I,x)=>{let N=JSON.parse((await E({...I,path:Tc+c})).toString());if(!G(N))throw new k.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:x.logger});return L(N)};var xc=O(()=>{a();D();W();X();b();P();i();Nc=u(r(),1),k=u(_(),1)});var Oc=()=>{};var Qc=O(()=>{D();P();B();p();xc();X();Oc()});Qc();export{Q as providerConfigFromInit,E as httpRequest,F as getInstanceMetadataEndpoint,YI as fromInstanceMetadata,kc as fromContainerMetadata,J as Endpoint,q as ENV_CMDS_RELATIVE_URI,H as ENV_CMDS_FULL_URI,M as ENV_CMDS_AUTH_TOKEN,Hc as DEFAULT_TIMEOUT,qc as DEFAULT_MAX_RETRIES};
4
4
 
5
- //# debugId=677810D7E798908D64756E2164756E21
5
+ //# debugId=ACB727322E86353964756E2164756E21
@@ -19,6 +19,6 @@
19
19
  "export * from \"./fromContainerMetadata\";\nexport * from \"./fromInstanceMetadata\";\nexport * from \"./remoteProvider/RemoteProviderInit\";\nexport * from \"./types\";\nexport { httpRequest } from \"./remoteProvider/httpRequest\";\nexport { getInstanceMetadataEndpoint } from \"./utils/getInstanceMetadataEndpoint\";\nexport { Endpoint } from \"./config/Endpoint\";\n"
20
20
  ],
21
21
  "mappings": ";gQACA,WAAS,UACT,YAAS,QACF,GAAS,CAAW,CAAC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EAAoB,GAGxB,OADA,GAAQ,MAAM,4BAA6B,6BAA6B,EACjE,EAAe,EAAY,IAAK,EAAU,SAAQ,CAAC,EAE9D,OAAO,EAAe,EAAY,IAC3B,EACH,QAAS,EACJ,IAA2B,CAChC,EACA,SACJ,CAAC,KAIP,GAAmB,MAAO,IAAY,EAAY,IACjD,EACH,KAAM,GACN,OAAQ,MACR,QAAS,CACL,uCAAwC,OAC5C,CACJ,CAAC,EACK,GAAa,MAAO,KAAa,MAAM,EAAY,IAAK,EAAS,KAAM,EAAU,CAAC,GAAG,SAAS,EAC9F,GAA4B,MAAO,EAAS,EAAS,IAAS,CAChE,IAAM,EAAsB,KAAK,OAAO,MAAM,EAAY,IACnD,EACH,KAAM,GAAY,CACtB,CAAC,GAAG,SAAS,CAAC,EACd,GAAI,CAAC,EAAkB,CAAmB,EACtC,MAAM,IAAI,2BAAyB,4DAA6D,CAC5F,OAAQ,EAAK,MACjB,CAAC,EAEL,OAAO,EAAoB,CAAmB,iBAlIlD,IACA,IACA,IACA,IACA,IACA,IACA,IARA,YACA,yCCGA,IACA,IACA,IANA,IACA,KACA,IACA",
22
- "debugId": "677810D7E798908D64756E2164756E21",
22
+ "debugId": "ACB727322E86353964756E2164756E21",
23
23
  "names": []
24
24
  }
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{M}from"./chunk-74aj8ms2.js";import{of as E}from"./chunk-4f69ygc8.js";class x{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:i,serializer:n,deserializer:o,serdeContext:c,defaultContentType:y}){this.marshaller=i,this.serializer=n,this.deserializer=o,this.serdeContext=c,this.defaultContentType=y}async serializeEventStream({eventStream:i,requestSchema:n,initialRequest:o}){let c=this.marshaller,y=n.getEventStreamMember(),p=n.getMemberSchema(y),d=this.serializer,f=this.defaultContentType,h=Symbol("initialRequestMarker"),S={async*[Symbol.asyncIterator](){if(o){let r={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:f}};d.write(n,o);let t=d.flush();yield{[h]:!0,headers:r,body:t}}for await(let r of i)yield r}};return c.serialize(S,(r)=>{if(r[h])return{headers:r.headers,body:r.body};let t=Object.keys(r).find((s)=>{return s!=="__type"})??"",{additionalHeaders:e,body:a,eventType:l,explicitPayloadContentType:m}=this.writeEventBody(t,p,r);return{headers:{":event-type":{type:"string",value:l},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:m??f},...e},body:a}})}async deserializeEventStream({response:i,responseSchema:n,initialResponseContainer:o}){let c=this.marshaller,y=n.getEventStreamMember(),d=n.getMemberSchema(y).getMemberSchemas(),f=Symbol("initialResponseMarker"),h=c.deserialize(i.body,async(t)=>{let e=Object.keys(t).find((l)=>{return l!=="__type"})??"",a=t[e].body;if(e==="initial-response"){let l=await this.deserializer.read(n,a);return delete l[y],{[f]:!0,...l}}else if(e in d){let l=d[e];if(l.isStructSchema()){let m={},u=!1;for(let[s,g]of l.structIterator()){let{eventHeader:v,eventPayload:w}=g.getMergedTraits();if(u=u||Boolean(v||w),w){if(g.isBlobSchema())m[s]=a;else if(g.isStringSchema())m[s]=(this.serdeContext?.utf8Encoder??z.toUtf8)(a);else if(g.isStructSchema())m[s]=await this.deserializer.read(g,a)}else if(v){let b=t[e].headers[s]?.value;if(b!=null)if(g.isNumericSchema())if(b&&typeof b==="object"&&"bytes"in b)m[s]=BigInt(b.toString());else m[s]=Number(b);else m[s]=b}}if(u)return{[e]:m};if(a.byteLength===0)return{[e]:{}}}return{[e]:await this.deserializer.read(l,a)}}else return{$unknown:t}}),S=h[Symbol.asyncIterator](),r=await S.next();if(r.done)return h;if(r.value?.[f]){if(!n)throw Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(let[t,e]of Object.entries(r.value))o[t]=e}return{async*[Symbol.asyncIterator](){if(!r?.value?.[f])yield r.value;while(!0){let{done:t,value:e}=await S.next();if(t)break;yield e}}}}writeEventBody(i,n,o){let c=this.serializer,y=i,p=null,d,f=(()=>{return n.getSchema()[4].includes(i)})(),h={};if(!f){let[t,e]=o[i];y=t,c.write(15,e)}else{let t=n.getMemberSchema(i);if(t.isStructSchema()){for(let[e,a]of t.structIterator()){let{eventHeader:l,eventPayload:m}=a.getMergedTraits();if(m)p=e;else if(l){let u=o[i][e],s="binary";if(a.isNumericSchema())if(-2147483648<=u&&u<=2147483647)s="integer";else s="long";else if(a.isTimestampSchema())s="timestamp";else if(a.isStringSchema())s="string";else if(a.isBooleanSchema())s="boolean";if(u!=null)h[e]={type:s,value:u},delete o[i][e]}}if(p!==null){let e=t.getMemberSchema(p);if(e.isBlobSchema())d="application/octet-stream";else if(e.isStringSchema())d="text/plain";c.write(e,o[i][p])}else c.write(t,o[i])}else if(t.isUnitSchema())c.write(t,{});else throw Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}let S=c.flush()??new Uint8Array;return{body:typeof S==="string"?(this.serdeContext?.utf8Decoder??z.fromUtf8)(S):S,eventType:y,explicitPayloadContentType:d,additionalHeaders:h}}}var z,T;var C=E(()=>{z=M();T=x});C();export{T as EventStreamSerde};export default {get EventStreamSerde(){return T}};
2
+ import{M}from"./chunk-9m2tbf3n.js";import{Gf as E}from"./chunk-jhkjz9jr.js";class x{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:i,serializer:n,deserializer:o,serdeContext:c,defaultContentType:y}){this.marshaller=i,this.serializer=n,this.deserializer=o,this.serdeContext=c,this.defaultContentType=y}async serializeEventStream({eventStream:i,requestSchema:n,initialRequest:o}){let c=this.marshaller,y=n.getEventStreamMember(),p=n.getMemberSchema(y),d=this.serializer,f=this.defaultContentType,h=Symbol("initialRequestMarker"),S={async*[Symbol.asyncIterator](){if(o){let r={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:f}};d.write(n,o);let t=d.flush();yield{[h]:!0,headers:r,body:t}}for await(let r of i)yield r}};return c.serialize(S,(r)=>{if(r[h])return{headers:r.headers,body:r.body};let t=Object.keys(r).find((s)=>{return s!=="__type"})??"",{additionalHeaders:e,body:a,eventType:l,explicitPayloadContentType:m}=this.writeEventBody(t,p,r);return{headers:{":event-type":{type:"string",value:l},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:m??f},...e},body:a}})}async deserializeEventStream({response:i,responseSchema:n,initialResponseContainer:o}){let c=this.marshaller,y=n.getEventStreamMember(),d=n.getMemberSchema(y).getMemberSchemas(),f=Symbol("initialResponseMarker"),h=c.deserialize(i.body,async(t)=>{let e=Object.keys(t).find((l)=>{return l!=="__type"})??"",a=t[e].body;if(e==="initial-response"){let l=await this.deserializer.read(n,a);return delete l[y],{[f]:!0,...l}}else if(e in d){let l=d[e];if(l.isStructSchema()){let m={},u=!1;for(let[s,g]of l.structIterator()){let{eventHeader:v,eventPayload:w}=g.getMergedTraits();if(u=u||Boolean(v||w),w){if(g.isBlobSchema())m[s]=a;else if(g.isStringSchema())m[s]=(this.serdeContext?.utf8Encoder??z.toUtf8)(a);else if(g.isStructSchema())m[s]=await this.deserializer.read(g,a)}else if(v){let b=t[e].headers[s]?.value;if(b!=null)if(g.isNumericSchema())if(b&&typeof b==="object"&&"bytes"in b)m[s]=BigInt(b.toString());else m[s]=Number(b);else m[s]=b}}if(u)return{[e]:m};if(a.byteLength===0)return{[e]:{}}}return{[e]:await this.deserializer.read(l,a)}}else return{$unknown:t}}),S=h[Symbol.asyncIterator](),r=await S.next();if(r.done)return h;if(r.value?.[f]){if(!n)throw Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(let[t,e]of Object.entries(r.value))o[t]=e}return{async*[Symbol.asyncIterator](){if(!r?.value?.[f])yield r.value;while(!0){let{done:t,value:e}=await S.next();if(t)break;yield e}}}}writeEventBody(i,n,o){let c=this.serializer,y=i,p=null,d,f=(()=>{return n.getSchema()[4].includes(i)})(),h={};if(!f){let[t,e]=o[i];y=t,c.write(15,e)}else{let t=n.getMemberSchema(i);if(t.isStructSchema()){for(let[e,a]of t.structIterator()){let{eventHeader:l,eventPayload:m}=a.getMergedTraits();if(m)p=e;else if(l){let u=o[i][e],s="binary";if(a.isNumericSchema())if(-2147483648<=u&&u<=2147483647)s="integer";else s="long";else if(a.isTimestampSchema())s="timestamp";else if(a.isStringSchema())s="string";else if(a.isBooleanSchema())s="boolean";if(u!=null)h[e]={type:s,value:u},delete o[i][e]}}if(p!==null){let e=t.getMemberSchema(p);if(e.isBlobSchema())d="application/octet-stream";else if(e.isStringSchema())d="text/plain";c.write(e,o[i][p])}else c.write(t,o[i])}else if(t.isUnitSchema())c.write(t,{});else throw Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}let S=c.flush()??new Uint8Array;return{body:typeof S==="string"?(this.serdeContext?.utf8Decoder??z.fromUtf8)(S):S,eventType:y,explicitPayloadContentType:d,additionalHeaders:h}}}var z,T;var C=E(()=>{z=M();T=x});C();export{T as EventStreamSerde};export default {get EventStreamSerde(){return T}};
3
3
 
4
- //# debugId=56FF429BB9792A4464756E2164756E21
4
+ //# debugId=539E7A834F9F9CB364756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "'use strict';\n\nvar utilUtf8 = require('@smithy/util-utf8');\n\nclass EventStreamSerde {\n marshaller;\n serializer;\n deserializer;\n serdeContext;\n defaultContentType;\n constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, }) {\n this.marshaller = marshaller;\n this.serializer = serializer;\n this.deserializer = deserializer;\n this.serdeContext = serdeContext;\n this.defaultContentType = defaultContentType;\n }\n async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {\n const marshaller = this.marshaller;\n const eventStreamMember = requestSchema.getEventStreamMember();\n const unionSchema = requestSchema.getMemberSchema(eventStreamMember);\n const serializer = this.serializer;\n const defaultContentType = this.defaultContentType;\n const initialRequestMarker = Symbol(\"initialRequestMarker\");\n const eventStreamIterable = {\n async *[Symbol.asyncIterator]() {\n if (initialRequest) {\n const headers = {\n \":event-type\": { type: \"string\", value: \"initial-request\" },\n \":message-type\": { type: \"string\", value: \"event\" },\n \":content-type\": { type: \"string\", value: defaultContentType },\n };\n serializer.write(requestSchema, initialRequest);\n const body = serializer.flush();\n yield {\n [initialRequestMarker]: true,\n headers,\n body,\n };\n }\n for await (const page of eventStream) {\n yield page;\n }\n },\n };\n return marshaller.serialize(eventStreamIterable, (event) => {\n if (event[initialRequestMarker]) {\n return {\n headers: event.headers,\n body: event.body,\n };\n }\n const unionMember = Object.keys(event).find((key) => {\n return key !== \"__type\";\n }) ?? \"\";\n const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event);\n const headers = {\n \":event-type\": { type: \"string\", value: eventType },\n \":message-type\": { type: \"string\", value: \"event\" },\n \":content-type\": { type: \"string\", value: explicitPayloadContentType ?? defaultContentType },\n ...additionalHeaders,\n };\n return {\n headers,\n body,\n };\n });\n }\n async deserializeEventStream({ response, responseSchema, initialResponseContainer, }) {\n const marshaller = this.marshaller;\n const eventStreamMember = responseSchema.getEventStreamMember();\n const unionSchema = responseSchema.getMemberSchema(eventStreamMember);\n const memberSchemas = unionSchema.getMemberSchemas();\n const initialResponseMarker = Symbol(\"initialResponseMarker\");\n const asyncIterable = marshaller.deserialize(response.body, async (event) => {\n const unionMember = Object.keys(event).find((key) => {\n return key !== \"__type\";\n }) ?? \"\";\n const body = event[unionMember].body;\n if (unionMember === \"initial-response\") {\n const dataObject = await this.deserializer.read(responseSchema, body);\n delete dataObject[eventStreamMember];\n return {\n [initialResponseMarker]: true,\n ...dataObject,\n };\n }\n else if (unionMember in memberSchemas) {\n const eventStreamSchema = memberSchemas[unionMember];\n if (eventStreamSchema.isStructSchema()) {\n const out = {};\n let hasBindings = false;\n for (const [name, member] of eventStreamSchema.structIterator()) {\n const { eventHeader, eventPayload } = member.getMergedTraits();\n hasBindings = hasBindings || Boolean(eventHeader || eventPayload);\n if (eventPayload) {\n if (member.isBlobSchema()) {\n out[name] = body;\n }\n else if (member.isStringSchema()) {\n out[name] = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(body);\n }\n else if (member.isStructSchema()) {\n out[name] = await this.deserializer.read(member, body);\n }\n }\n else if (eventHeader) {\n const value = event[unionMember].headers[name]?.value;\n if (value != null) {\n if (member.isNumericSchema()) {\n if (value && typeof value === \"object\" && \"bytes\" in value) {\n out[name] = BigInt(value.toString());\n }\n else {\n out[name] = Number(value);\n }\n }\n else {\n out[name] = value;\n }\n }\n }\n }\n if (hasBindings) {\n return {\n [unionMember]: out,\n };\n }\n if (body.byteLength === 0) {\n return {\n [unionMember]: {},\n };\n }\n }\n return {\n [unionMember]: await this.deserializer.read(eventStreamSchema, body),\n };\n }\n else {\n return {\n $unknown: event,\n };\n }\n });\n const asyncIterator = asyncIterable[Symbol.asyncIterator]();\n const firstEvent = await asyncIterator.next();\n if (firstEvent.done) {\n return asyncIterable;\n }\n if (firstEvent.value?.[initialResponseMarker]) {\n if (!responseSchema) {\n throw new Error(\"@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.\");\n }\n for (const [key, value] of Object.entries(firstEvent.value)) {\n initialResponseContainer[key] = value;\n }\n }\n return {\n async *[Symbol.asyncIterator]() {\n if (!firstEvent?.value?.[initialResponseMarker]) {\n yield firstEvent.value;\n }\n while (true) {\n const { done, value } = await asyncIterator.next();\n if (done) {\n break;\n }\n yield value;\n }\n },\n };\n }\n writeEventBody(unionMember, unionSchema, event) {\n const serializer = this.serializer;\n let eventType = unionMember;\n let explicitPayloadMember = null;\n let explicitPayloadContentType;\n const isKnownSchema = (() => {\n const struct = unionSchema.getSchema();\n return struct[4].includes(unionMember);\n })();\n const additionalHeaders = {};\n if (!isKnownSchema) {\n const [type, value] = event[unionMember];\n eventType = type;\n serializer.write(15, value);\n }\n else {\n const eventSchema = unionSchema.getMemberSchema(unionMember);\n if (eventSchema.isStructSchema()) {\n for (const [memberName, memberSchema] of eventSchema.structIterator()) {\n const { eventHeader, eventPayload } = memberSchema.getMergedTraits();\n if (eventPayload) {\n explicitPayloadMember = memberName;\n }\n else if (eventHeader) {\n const value = event[unionMember][memberName];\n let type = \"binary\";\n if (memberSchema.isNumericSchema()) {\n if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) {\n type = \"integer\";\n }\n else {\n type = \"long\";\n }\n }\n else if (memberSchema.isTimestampSchema()) {\n type = \"timestamp\";\n }\n else if (memberSchema.isStringSchema()) {\n type = \"string\";\n }\n else if (memberSchema.isBooleanSchema()) {\n type = \"boolean\";\n }\n if (value != null) {\n additionalHeaders[memberName] = {\n type,\n value,\n };\n delete event[unionMember][memberName];\n }\n }\n }\n if (explicitPayloadMember !== null) {\n const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember);\n if (payloadSchema.isBlobSchema()) {\n explicitPayloadContentType = \"application/octet-stream\";\n }\n else if (payloadSchema.isStringSchema()) {\n explicitPayloadContentType = \"text/plain\";\n }\n serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]);\n }\n else {\n serializer.write(eventSchema, event[unionMember]);\n }\n }\n else if (eventSchema.isUnitSchema()) {\n serializer.write(eventSchema, {});\n }\n else {\n throw new Error(\"@smithy/core/event-streams - non-struct member not supported in event stream union.\");\n }\n }\n const messageSerialization = serializer.flush() ?? new Uint8Array();\n const body = typeof messageSerialization === \"string\"\n ? (this.serdeContext?.utf8Decoder ?? utilUtf8.fromUtf8)(messageSerialization)\n : messageSerialization;\n return {\n body,\n eventType,\n explicitPayloadContentType,\n additionalHeaders,\n };\n }\n}\n\nexports.EventStreamSerde = EventStreamSerde;\n"
6
6
  ],
7
7
  "mappings": ";kFAIA,AAAM,CAAiB,CACnB,WACA,WACA,aACA,aACA,mBACA,WAAW,EAAG,aAAY,aAAY,eAAc,eAAc,sBAAuB,CACrF,KAAK,WAAa,EAClB,KAAK,WAAa,EAClB,KAAK,aAAe,EACpB,KAAK,aAAe,EACpB,KAAK,mBAAqB,OAExB,qBAAoB,EAAG,cAAa,gBAAe,kBAAmB,CACxE,IAAM,EAAa,KAAK,WAClB,EAAoB,EAAc,qBAAqB,EACvD,EAAc,EAAc,gBAAgB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OAAW,MAAM,EAAa,EAAM,EAAY,EAGnD,QAAI,EAAY,aAAa,EAC9B,EAAW,MAAM,EAAa,CAAC,CAAC,EAGhC,WAAU,MAAM,qFAAqF,EAG7G,IAAM,EAAuB,EAAW,MAAM,GAAK,IAAI,WAIvD,MAAO,CACH,KAJS,OAAO,IAAyB,UACtC,KAAK,cAAc,aAAe,EAAS,UAAU,CAAoB,EAC1E,EAGF,YACA,6BACA,mBACJ,EAER,KA9PI,EAgQI,eAhQJ,MAgQI,EAAmB",
8
- "debugId": "56FF429BB9792A4464756E2164756E21",
8
+ "debugId": "539E7A834F9F9CB364756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
2
  var $=globalThis.__GEMI_DICTIONARY_REGISTRY__??={registry:new Map,resolved:new Map,inFlight:new Map,degraded:new Map,order:[],warmed:new Map,activeLocale:null},{registry:V,resolved:X,inFlight:Q,degraded:E,order:j,warmed:W}=$;function G(q,x){return`${q}\x00${x}`}function U(q){if(V.has(q.id))return;V.set(q.id,q),j.push(q.id)}function Y(){return j.length}function I(q,x){return X.get(q)?.get(x)}function Z(q,x,A){let z=X.get(q);if(!z)z=new Map,X.set(q,z);z.set(x,A)}function M(q,x){let A=I(q,x);if(A)return A;let z=G(q,x),C=Q.get(z);if(C)return C;let B=V.get(q);if(!B)throw Error(`Unknown dictionary "${q}". A dictionary must be created with defineDictionary() and its module must have been evaluated before it is read.`);let H=B.load(x);if(!(H instanceof Promise))return Z(q,x,H),H;let J=H.then((O)=>{return Z(q,x,O),Q.delete(z),O},(O)=>{throw Q.delete(z),O});return Q.set(z,J),J}function _(q,x){let A=I(q,x);if(A)return A;let z=G(q,x),C=E.get(z);if(C)return C;let B=M(q,x);if(!(B instanceof Promise))return B;let H=B.then((J)=>J,(J)=>{return console.error(`Failed to load dictionary ${q} for locale ${x}; rendering keys instead.`,J),N});return E.set(z,H),H}var N={};async function D(q,x){let A=x??W.get(q)??0,z=j.slice(A);if(z.length===0)return;let C=await Promise.all(z.map(async(B)=>{try{return await M(B,P(B,q)),!0}catch{return!1}}));if(x===void 0){let B=C.indexOf(!1),H=B===-1?z.length:B;W.set(q,Math.max(W.get(q)??0,A+H))}}function P(q,x){if(x)return x;return V.get(q)?.locales[0]??x}function K(q,x){if(!q)return;for(let[A,z]of Object.entries(q))Z(A,x,z)}function S(q){if(q)$.activeLocale=q}function T(){return $.activeLocale}if(typeof window<"u"){let q=window,x=([z,C,B])=>{Z(z,C,B)},A=Array.isArray(q.__GEMI_DICT__)?q.__GEMI_DICT__:[];q.__GEMI_DICT__={push:x};for(let z of A)x(z)}function L(){V.clear(),X.clear(),Q.clear(),E.clear(),W.clear(),j.length=0,$.activeLocale=null}function w(){let q=new Set,x=[],A=[];return{use(z,C,B){let H=`${z} ${C}`;if(q.has(H))return;q.add(H);let J={id:z,locale:C,strings:B};if(x.length===0){A.push(J);return}for(let O of x)O(J)},onUse(z){x.push(z);while(A.length>0)z(A.shift())}}}
3
- export{U as yd,Y as zd,M as Ad,_ as Bd,D as Cd,K as Dd,S as Ed,T as Fd,L as Gd,w as Hd};
3
+ export{U as Nd,Y as Od,M as Pd,_ as Qd,D as Rd,K as Sd,S as Td,T as Ud,L as Vd,w as Wd};
4
4
 
5
- //# debugId=895B5063417B5C3164756E2164756E21
5
+ //# debugId=50334249C8DBF76664756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "import type { LocaleStrings } from \"./dictionaryShape\";\n\n/**\n * Collects the dictionaries one SSR render actually read.\n *\n * Scoped per request by living in React context rather than in module state: a\n * streaming server has several renders in flight at once, so a module-level\n * collector would mix one page's dictionaries into another's payload. Context\n * is per render tree, which is exactly the boundary wanted, and it needs no\n * async-local storage to survive React's internal scheduling.\n *\n * Why stream these rather than put them in `__GEMI_DATA__`: that snapshot is\n * serialized before `renderToReadableStream` is even called, and which\n * dictionaries a page reads is only known once it has rendered. A suspended\n * segment reveals later still, long after the shell has flushed.\n *\n * The sink deliberately emits data, not markup — `streamQueryInjection` owns\n * script formatting and the `</script>`-safe encoding that goes with it.\n */\nexport interface DictionaryUse {\n id: string;\n locale: string;\n strings: LocaleStrings;\n}\n\nexport interface DictionarySink {\n /** Called during render, the first time a dictionary is read. */\n use(id: string, locale: string, strings: LocaleStrings): void;\n /** The response injector subscribes to receive uses as they happen. */\n onUse(cb: (use: DictionaryUse) => void): void;\n}\n\nexport function createDictionarySink(): DictionarySink {\n const seen = new Set<string>();\n const listeners: Array<(use: DictionaryUse) => void> = [];\n // Uses recorded before the injector subscribed — the render begins before the\n // response stream is wrapped.\n const pending: DictionaryUse[] = [];\n\n return {\n use(id, locale, strings) {\n const key = `${id} ${locale}`;\n if (seen.has(key)) return;\n seen.add(key);\n const entry: DictionaryUse = { id, locale, strings };\n if (listeners.length === 0) {\n pending.push(entry);\n return;\n }\n for (const listener of listeners) listener(entry);\n },\n onUse(cb) {\n listeners.push(cb);\n while (pending.length > 0) {\n cb(pending.shift()!);\n }\n },\n };\n}\n"
7
7
  ],
8
8
  "mappings": ";AA4EA,IAAM,EAAyB,WAFZ,+BAE+C,CAChE,SAAU,IAAI,IACd,SAAU,IAAI,IACd,SAAU,IAAI,IACd,SAAU,IAAI,IACd,MAAO,CAAC,EACR,OAAQ,IAAI,IACZ,aAAc,IAChB,GAEQ,WAAU,WAAU,WAAU,WAAU,QAAO,UAAW,EAElE,SAAS,CAAQ,CAAC,EAAY,EAAgB,CAC5C,MAAO,GAAG,QAAO,IAGZ,SAAS,CAAkB,CAAC,EAA6B,CAM9D,GAAI,EAAS,IAAI,EAAM,EAAE,EACvB,OAEF,EAAS,IAAI,EAAM,GAAI,CAAK,EAC5B,EAAM,KAAK,EAAM,EAAE,EAId,SAAS,CAA0B,EAAW,CACnD,OAAO,EAAM,OAGR,SAAS,CAAW,CACzB,EACA,EAC2B,CAC3B,OAAO,EAAS,IAAI,CAAE,GAAG,IAAI,CAAM,EAGrC,SAAS,CAAW,CAAC,EAAY,EAAgB,EAAwB,CACvE,IAAI,EAAW,E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AI,IACX,EAAiD,CAAC,EAGlD,EAA2B,CAAC,EAElC,MAAO,CACL,GAAG,CAAC,EAAI,EAAQ,EAAS,CACvB,IAAM,EAAM,GAAG,KAAM,IACrB,GAAI,EAAK,IAAI,CAAG,EAAG,OACnB,EAAK,IAAI,CAAG,EACZ,IAAM,EAAuB,CAAE,KAAI,SAAQ,SAAQ,EACnD,GAAI,EAAU,SAAW,EAAG,CAC1B,EAAQ,KAAK,CAAK,EAClB,OAEF,QAAW,KAAY,EAAW,EAAS,CAAK,GAElD,KAAK,CAAC,EAAI,CACR,EAAU,KAAK,CAAE,EACjB,MAAO,EAAQ,OAAS,EACtB,EAAG,EAAQ,MAAM,CAAE,EAGzB",
9
- "debugId": "895B5063417B5C3164756E2164756E21",
9
+ "debugId": "50334249C8DBF76664756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import{Xc as M,_c as P,dd as W,fd as O,gd as D,hd as w,id as j,jd as L,kd as y,ld as b,md as A,sd as F}from"./chunk-8v81dvje.js";import{Ee as S,Fe as Y}from"./chunk-f233yzxf.js";import{AsyncLocalStorage as E}from"async_hooks";var J=new E;function o(){return J.getStore()?.tx}function T(){return J.getStore()?.connection??M}function n(q,z){let B=J.getStore();if(T()===q)return z();return U(q),J.run({...B,depth:B?.depth??0,connection:q===M?void 0:q},z)}function U(q){let z=J.getStore();if(z?.tx===void 0)return;let B=z.connection??M;if(B===q)return;throw new P(B,q)}function t(q){let z=J.getStore();if(z?.tx===void 0||z.afterCommit===void 0)return!1;return z.afterCommit.push(q),!0}function a(){let q=J.getStore();return q?.tx===void 0?null:q.depth}function r(){return J.getStore()?.system===!0}function e(q){let z=J.getStore();return J.run({...z,depth:z?.depth??0,system:!0},q)}function qq(){return J.getStore()?.actor}function zq(q,z){let B=J.getStore();return J.run({...B,depth:B?.depth??0,system:!1,actor:{user:q??null}},z)}function x(q){if(Bun.env.NODE_ENV!=="development")return null;if(q===!1)return null;if(q===void 0)return W;if(!Number.isFinite(q)||q<=0)return W;return q}function C(q){let z=x(q);if(z===null)return()=>{};let B=Error("transaction opened here"),X=setTimeout(()=>{let Z=B.stack?.split(`
2
+ import{Ad as b,Bd as A,Hd as F,kd as M,nd as P,sd as W,ud as O,vd as D,wd as w,xd as j,yd as L,zd as y}from"./chunk-y6a8r2bn.js";import{We as S,Xe as Y}from"./chunk-3g5bjvdf.js";import{AsyncLocalStorage as E}from"async_hooks";var J=new E;function o(){return J.getStore()?.tx}function T(){return J.getStore()?.connection??M}function n(q,z){let B=J.getStore();if(T()===q)return z();return U(q),J.run({...B,depth:B?.depth??0,connection:q===M?void 0:q},z)}function U(q){let z=J.getStore();if(z?.tx===void 0)return;let B=z.connection??M;if(B===q)return;throw new P(B,q)}function t(q){let z=J.getStore();if(z?.tx===void 0||z.afterCommit===void 0)return!1;return z.afterCommit.push(q),!0}function a(){let q=J.getStore();return q?.tx===void 0?null:q.depth}function r(){return J.getStore()?.system===!0}function e(q){let z=J.getStore();return J.run({...z,depth:z?.depth??0,system:!0},q)}function qq(){return J.getStore()?.actor}function zq(q,z){let B=J.getStore();return J.run({...B,depth:B?.depth??0,system:!1,actor:{user:q??null}},z)}function x(q){if(Bun.env.NODE_ENV!=="development")return null;if(q===!1)return null;if(q===void 0)return W;if(!Number.isFinite(q)||q<=0)return W;return q}function C(q){let z=x(q);if(z===null)return()=>{};let B=Error("transaction opened here"),X=setTimeout(()=>{let Z=B.stack?.split(`
3
3
  `).slice(1).join(`
4
4
  `)??"";console.warn(`[gemi] A database transaction has not settled after ${z}ms. It `+"reserves a pooled connection until it does \u2014 check for network or "+`filesystem I/O inside the callback, and move it outside the transaction if you find any.
5
5
  ${Z}
6
6
  (development only; set database.slowTransactionThreshold to change the threshold, or false to switch this off)`)},z);return X.unref?.(),()=>clearTimeout(X)}async function v(q,z){if(q.length===0)return;await J.run({...z,tx:void 0,afterCommit:void 0,depth:z?.depth??0},async()=>{for(let B of q)try{await B()}catch(X){console.error("An after-commit callback threw. The transaction it was waiting on had already committed and stays committed, and the callbacks after it still ran.",X)}})}function Bq(q,z,B){let X=J.getStore(),Z=B?.connection??M;if(U(Z),X?.tx){let Q=X.afterCommit,G=Q?.length??0;return X.tx.savepoint((K)=>{let k=K;return J.run({...X,tx:k,depth:X.depth+1},()=>z(k))}).catch((K)=>{if(Q)Q.length=G;throw K})}let $=C(B?.slowTransactionThreshold),V=[];try{return q.begin((Q)=>J.run({...X,tx:Q,depth:0,connection:Z===M?void 0:Z,afterCommit:V},()=>z(Q))).finally($).then(async(Q)=>{return await v(V,X),Q})}catch(Q){throw $(),Q}}var f=/^\s*::\s*(?:text\s*::\s*)?(jsonb|json)\b(?!\s*\[)/i,g=/^\s*as\s+(jsonb|json)\s*\)/i,p=/\bcast\s*\(\s*$/i,c=new Set;function _(q,z){if(!z.typesParametersFromStatement)return{fragment:q,jsonParameters:c};let B=j(q),X=new Set,Z;for(let $=0;$<B.length-1;$++){let V=B[$+1],Q=f.exec(V);if(Q){Z??=[...B],Z[$+1]=`::text::${Q[1]}${V.slice(Q[0].length)}`,X.add($);continue}let G=g.exec(V);if(G&&p.test((Z??B)[$]))Z??=[...B],Z[$+1]=` as text)::${G[1]}${V.slice(G[0].length)}`,X.add($)}if(!Z)return{fragment:q,jsonParameters:X};return{fragment:L(Z,q.binders),jsonParameters:X}}function I(q,z){if(q===null||q===void 0)return null;let B=F(q);if(B==="db")return null;if(B==="json")return"null";if(B==="any")throw new Y(z,"DB",z,"Prisma.AnyNull is a filter operand \u2014 it asks for a SQL NULL *or* a JSON "+"null \u2014 so it has no single value to bind. Write the one you mean: "+"Prisma.DbNull for the column being NULL, Prisma.JsonNull for the JSON value.");if(typeof q==="string")return q;let X;try{X=JSON.stringify(q)}catch(Z){throw new Y(z,"DB",z,`A parameter cast to json could not be serialised: ${Z instanceof Error?Z.message:String(Z)}. `+"Bind text you have serialised yourself if the value is not JSON \u2014 a "+"bigint has no JSON form, and neither does a cycle.")}if(X===void 0)throw new Y(z,"DB",z,`A ${typeof q} was bound to a parameter cast to json, and has no JSON form. Bind the value it stands for.`);return X}var h=new WeakSet;function H(q){return h.add(q),q}function R(q){return typeof q==="object"&&q!==null&&h.has(q)}function Gq(q,...z){if(!Array.isArray(q)||!("raw"in q))throw new S("sql","DB","sql","'sql' is a tagged template \u2014 write sql`select 1`, not sql(\"select 1\"). "+"To put text that is not a value into a statement, use 'unsafeSql', and read what it says first.");let B=[];for(let X=0;X<q.length;X++)if(B.push(D(q[X])),X<z.length)B.push(N(z[X]));return H(y(...B))}function Hq(q,z=", "){if(!Array.isArray(q))throw new Y("join","DB","sql",`Expected an array of fragments or values, got ${typeof q}.`);if(q.length===0)return u;let B=q.map(N);if(R(z)){let X=[];for(let Z=0;Z<B.length;Z++){if(Z>0)X.push(z);X.push(B[Z])}return H(y(...X))}return m(z),H(b(B,z))}var d=/^[\s,]*$|^\s*(?:and|or)\s*$/i;function m(q){if(typeof q==="string"&&d.test(q))return;throw new Y("join","DB","sql",typeof q==="string"?`A separator is written into the SQL text, so it may only be glue: whitespace, commas, or 'and' / 'or'. Got ${JSON.stringify(q)}. If that is deliberate, say so with `+"unsafeSql(...) \u2014 and never build one from anything that came from "+"outside the program.":`Expected a separator string or a fragment, got ${q===null?"null":typeof q}.`)}var u=H(Object.freeze({text:"",binders:Object.freeze([])}));function Kq(q){if(typeof q!=="string")throw new Y("unsafeSql","DB","sql",`Expected a string literal, got ${Array.isArray(q)?"an array":typeof q}. 'unsafeSql' is a plain call, not a tagged template \u2014 a template would `+"interpolate values into the SQL text, which is the one thing it must never do.");return H(D(q))}function Wq(q,z,B="query"){if(!R(q))throw new Y(B,"DB",B,`Expected a fragment built with 'sql', got ${q===null?"null":typeof q}. A plain string is not accepted here on purpose \u2014 it would be the one `+"path into the SQL text that nobody had to think about.");let X=_(q,z),Z=A(X.fragment,z,{model:"DB",operation:B});return{text:Z.text,values:O(Z.binders)(void 0).map(($,V)=>X.jsonParameters.has(V)?I($,B):$===null||$===void 0?$??null:z.encodeUntyped($))}}function N(q){if(R(q))return q;return w(()=>q)}
7
- export{J as Bc,o as Cc,T as Dc,n as Ec,U as Fc,t as Gc,a as Hc,r as Ic,e as Jc,qq as Kc,zq as Lc,Bq as Mc,Gq as Nc,Hq as Oc,u as Pc,Kq as Qc,Wq as Rc};
7
+ export{J as Qc,o as Rc,T as Sc,n as Tc,U as Uc,t as Vc,a as Wc,r as Xc,e as Yc,qq as Zc,zq as _c,Bq as $c,Gq as ad,Hq as bd,u as cd,Kq as dd,Wq as ed};
8
8
 
9
- //# debugId=2A5BE62B4FD6BA0D64756E2164756E21
9
+ //# debugId=14B2E80CDD7EF77E64756E2164756E21
@@ -7,6 +7,6 @@
7
7
  "import type { SqlDialect } from \"./dialect\";\nimport {\n InvalidArgumentError,\n UnsupportedQueryError,\n} from \"./errors\";\nimport {\n type Fragment,\n bindValues,\n concat,\n joinFragments,\n param,\n render,\n sql as text,\n} from \"./compile/fragment\";\nimport { jsonTextParameter, retypeJsonParameters } from \"./json-param\";\n\n/**\n * SQL fragments as first-class values: `sql`, `join`, `empty`, and one door out.\n *\n * The ORM deliberately does not implement every SQL shape — `distinct`, cursor\n * pagination, window functions, recursive CTEs. That is the right call, but it\n * is only half a decision: the shapes it declines have to have somewhere to go,\n * and \"drop to raw SQL\" is not an answer if raw SQL cannot be *composed*.\n *\n * `DB.sql` — Bun's tagged template — covers a single self-contained statement,\n * and that is genuinely all it covers. The shape it cannot express is the common\n * one: a predicate list built conditionally, passed around as a value, and\n * interpolated into a larger statement.\n *\n * ```ts\n * const filters = []\n * if (q) filters.push(sql`name ilike ${`%${q}%`}`)\n * if (organizationId) filters.push(sql`\"organizationId\" = ${organizationId}`)\n *\n * const where = filters.length ? sql`where ${join(filters, \" and \")}` : empty\n * const rows = await DB.query(sql`select * from \"Product\" ${where} limit ${20}`)\n * ```\n *\n * ## This is the compiler's own `Fragment`, made public\n *\n * Not a parallel mechanism. `compile/fragment.ts` has held exactly this shape\n * since iteration 1 — text plus positional binders, composable, never\n * concatenating a value into the text — because that is what invariant 2 needs\n * internally. Reusing it means a public fragment binds by the same rule the\n * compiler's own SQL does, and it means the parameter ceiling, the placeholder\n * numbering and the dialect split are all already handled rather than\n * reimplemented one door down.\n *\n * **Placeholders are assigned at assembly, not at authoring.** SQLite writes\n * `?` and Postgres writes `$1`, `$2`, and a fragment does not know where in the\n * final statement it will land — so `sql` records a *position* and `render`\n * turns it into a placeholder once the whole statement exists. That is what lets\n * the same fragment be nested, reused twice in one statement, or built before\n * the dialect is even known.\n */\n\n/**\n * A composable piece of SQL. Its values are bound parameters, never text.\n *\n * Opaque on purpose: an application builds one with `sql`, combines it with\n * `join`, and hands it to `DB.query` / `DB.execute`. Reading `.text` off it is\n * not part of the contract — it holds parameter *markers* rather than the\n * dialect's placeholders, so it is not the statement that runs.\n */\nexport type SqlFragment = Fragment;\n\n/**\n * Every fragment this module has produced.\n *\n * **Identity, not shape, and the difference is a SQL injection.** `interpolate`\n * splices a fragment as text and binds everything else, so \"is this a fragment\"\n * decides whether a value reaches the statement or a parameter. Asking the\n * *shape* — a `text` string and a `binders` array — makes that decision\n * answerable by anything that can name two properties, and `{\"text\": \"…\",\n * \"binders\": []}` is two lines of JSON:\n *\n * ```ts\n * const body = await request.json()\n * await DB.query(sql`select \"email\" from \"User\" where \"email\" = ${body.email}`)\n * // body.email = { text: `'' union select \"password\" from \"User\"`, binders: [] }\n * // -> select \"email\" from \"User\" where \"email\" = '' union select \"password\" from \"User\"\n * ```\n *\n * That is the intended call site with the intended safe value, and it returned\n * the password column out of a statement selecting only `email`. The internal\n * `Fragment` never had the problem because nothing outside `compile/` could\n * construct one; making the type public is what turned \"text plus binders\" from\n * an implementation detail into a shape an attacker can name. `unsafeSql` is\n * built so that reaching for the escape hatch is a decision — a structural check\n * is a second, unmarked door beside it.\n *\n * A `WeakSet` the module owns cannot be forged: membership is granted only by\n * the constructors below. It registers the *returned* object rather than\n * stamping a property, because `concat` and `joinFragments` return fresh objects\n * — a marker property on the inputs would not survive them, and the version that\n * cannot drift is the one that brands what actually comes out.\n */\nconst FRAGMENTS = new WeakSet<object>();\n\nfunction brand(fragment: Fragment): SqlFragment {\n FRAGMENTS.add(fragment);\n return fragment;\n}\n\n/** Whether a value is a fragment *this module made*, so it splices rather than binds. */\nfunction isFragment(value: unknown): value is Fragment {\n return typeof value === \"object\" && value !== null && FRAGMENTS.has(value);\n}\n\n/**\n * A SQL fragment. Every `${value}` is bound as a parameter; a `${fragment}` is\n * spliced in, carrying its own parameters with it.\n *\n * ```ts\n * sql`where \"id\" = ${id}` // \"id\" = $1, with id bound\n * sql`where ${sql`\"a\" = ${1}`} and ${sql`\"b\" = ${2}`}` // nests to any depth\n * ```\n *\n * An interpolated **array** is bound as one value, not expanded — that is what\n * Postgres's `= any($1)` wants, and it is the only reading that does not depend\n * on the dialect. For a comma-separated list of placeholders, say so with\n * `join`.\n *\n * A value at a `::jsonb` cast the caller wrote is the one parameter with a type\n * behind it, and it is bound as **JSON text** so that the statement means what\n * the same statement meant under Prisma's `$executeRaw`:\n *\n * ```ts\n * sql`… set payload = payload || ${JSON.stringify(patch)}::jsonb` // merges\n * ```\n *\n * Without that the driver would JSON-encode the string and the column would\n * hold the document as a jsonb *string* — which `||` appends as an array\n * element rather than merging. `json-param.ts` has the measurements.\n */\nexport function sql(\n strings: TemplateStringsArray,\n ...values: unknown[]\n): SqlFragment {\n // A defensive check rather than a type error, because the interesting misuse\n // is `sql(userInput)` — a plain call with a string, which would otherwise\n // reach `strings.raw` as `undefined` and produce a fragment of `undefined`\n // text rather than an error. It is also the shape somebody reaches for when\n // they want the escape hatch and have not found `unsafeSql`.\n if (!Array.isArray(strings) || !(\"raw\" in (strings as object))) {\n throw new UnsupportedQueryError(\n \"sql\",\n \"DB\",\n \"sql\",\n `'sql' is a tagged template — write sql\\`select 1\\`, not sql(\"select 1\"). ` +\n `To put text that is not a value into a statement, use 'unsafeSql', ` +\n `and read what it says first.`,\n );\n }\n\n const parts: Fragment[] = [];\n\n for (let i = 0; i < strings.length; i++) {\n parts.push(text(strings[i]));\n if (i < values.length) parts.push(interpolate(values[i]));\n }\n\n return brand(concat(...parts));\n}\n\n/**\n * Fragments — or values — joined by a separator, the way `Array.join` reads.\n *\n * ```ts\n * join(filters, \" and \") // a and b and c\n * join([sql`\"a\" asc`, sql`\"b\" desc`]) // \"a\" asc, \"b\" desc\n * join(ids) // $1, $2, $3 — each bound\n * ```\n *\n * An **empty list produces `empty`**, not a separator and not a syntax error, so\n * `join` composes with a list that turned out to have nothing in it. That is the\n * case a caller forgets, and it is the one that would otherwise emit `where ` and\n * fail at the database rather than here.\n *\n * ## The separator is text, so it is not a free string\n *\n * It goes between the fragments *in the statement*, which makes it the one other\n * place a string could reach the SQL — and this module's whole claim is that\n * `unsafeSql` is **the** door. So a plain-string separator has to be glue and\n * nothing else: whitespace, commas, or a boolean connective. Anything more\n * expressive is legitimate and has to say so:\n *\n * ```ts\n * join(filters, \" and \") // fine\n * join(parts, unsafeSql(\") and (\")) // fine, and visibly a decision\n * join(ids, request.query.sep) // refused\n * ```\n *\n * A **blocklist would not do**, which is why this is an allowlist. The obvious\n * one — reject quotes, semicolons and comment markers — lets this through:\n *\n * join([1, 2], \") or 1=1 union select password from Users where 1=(1\")\n *\n * No quote, no `--`, still an injection. There is no sound way to say \"this\n * arbitrary text is safe glue\", so the rule is that glue is a small closed set\n * and everything else is a fragment somebody built on purpose.\n */\nexport function join(\n values: readonly unknown[],\n separator: string | SqlFragment = \", \",\n): SqlFragment {\n if (!Array.isArray(values)) {\n throw new InvalidArgumentError(\n \"join\",\n \"DB\",\n \"sql\",\n `Expected an array of fragments or values, got ${typeof values}.`,\n );\n }\n if (values.length === 0) return empty;\n\n const parts = values.map(interpolate);\n\n if (isFragment(separator)) {\n const woven: Fragment[] = [];\n for (let i = 0; i < parts.length; i++) {\n if (i > 0) woven.push(separator);\n woven.push(parts[i]);\n }\n return brand(concat(...woven));\n }\n\n assertGlue(separator);\n return brand(joinFragments(parts, separator));\n}\n\n/**\n * Whitespace and commas, or a boolean connective surrounded by whitespace.\n *\n * Deliberately small. Every separator a composed statement actually needs is in\n * here — `\", \"`, `\" and \"`, `\" or \"`, `\" \"` — and everything outside it is\n * expressive enough to change what the statement *does*, which is the property\n * that makes it a `unsafeSql` decision rather than a string argument.\n */\nconst GLUE = /^[\\s,]*$|^\\s*(?:and|or)\\s*$/i;\n\nfunction assertGlue(separator: unknown): void {\n if (typeof separator === \"string\" && GLUE.test(separator)) return;\n\n throw new InvalidArgumentError(\n \"join\",\n \"DB\",\n \"sql\",\n typeof separator === \"string\"\n ? `A separator is written into the SQL text, so it may only be glue: ` +\n `whitespace, commas, or 'and' / 'or'. Got ` +\n `${JSON.stringify(separator)}. If that is deliberate, say so with ` +\n `unsafeSql(...) — and never build one from anything that came from ` +\n `outside the program.`\n : `Expected a separator string or a fragment, got ${\n separator === null ? \"null\" : typeof separator\n }.`,\n );\n}\n\n/**\n * The fragment that contributes nothing.\n *\n * The point of it is that `where ${empty}` and `where ${filter}` are the same\n * expression — a conditional predicate is a value, not a branch around the\n * statement. Frozen, because it is shared by every caller and a fragment is read\n * as immutable everywhere else.\n */\nexport const empty: SqlFragment = brand(\n Object.freeze({ text: \"\", binders: Object.freeze([]) as [] }),\n);\n\n/**\n * **Text straight into the SQL, with no parameter around it.** The one door in\n * this ORM through which a value reaches the statement text.\n *\n * Everything else in the compiler exists to make this impossible — identifiers\n * come from the generated schema, values are bound — so reaching for it should\n * feel like reaching for it. **Never give it a value that came from a request, a\n * form, a URL, a header, a queue payload or a database row.** There is no\n * escaping here and there will not be: escaping that is \"usually right\" is worse\n * than none, because it survives review.\n *\n * ## Why it exists at all, since that is the fair question\n *\n * Plan quality can depend on *not* parameterising. A partial index declared as\n *\n * ```sql\n * create index … on \"Job\" (…) where \"name\" is distinct from 'reaper'\n * ```\n *\n * is only usable if the planner can prove the query's predicate matches the\n * index's. A bound parameter is opaque at plan time, so `where \"name\" is\n * distinct from $1` does not match — and the query falls back to a sequential\n * scan over the whole table. The constant has to be *in the text*:\n *\n * ```ts\n * const REAPER = unsafeSql(`'reaper'`) // a literal in this file, never input\n * await DB.query(sql`\n * select … from \"Job\" where \"name\" is distinct from ${REAPER} …\n * `)\n * ```\n *\n * A builder with no escape hatch cannot express that at any price, and the\n * workaround — hand-writing the whole statement — loses composition for every\n * other part of it.\n *\n * The same applies to the other things that cannot be parameters in SQL:\n * identifiers, a sort direction, a table name chosen from a fixed set in code.\n * All of them share the rule above — the value is written in the source file, or\n * chosen from a set written in the source file, never passed in.\n */\nexport function unsafeSql(literal: string): SqlFragment {\n if (typeof literal !== \"string\") {\n throw new InvalidArgumentError(\n \"unsafeSql\",\n \"DB\",\n \"sql\",\n `Expected a string literal, got ${\n Array.isArray(literal) ? \"an array\" : typeof literal\n }. 'unsafeSql' is a plain call, not a tagged template — a template would ` +\n `interpolate values into the SQL text, which is the one thing it must ` +\n `never do.`,\n );\n }\n return brand(text(literal));\n}\n\n/**\n * A fragment as the statement a driver can run: the dialect's placeholders in\n * the text, and the values in the order they appear.\n *\n * Separate from the executing, and exported, because it is the half that is a\n * pure function of `(fragment, dialect)` — so a test can assert what a\n * composition emits on both dialects without a database anywhere near it, which\n * is exactly how the rest of the compiler is tested.\n *\n * `render` also applies the parameter ceiling here, which matters more for a\n * hand-built fragment than for a compiled plan: `join(ids)` over a\n * request-derived list is one placeholder per element on SQLite, and 40 000 of\n * them is a driver error rather than a clear one.\n */\nexport function renderFragment(\n fragment: SqlFragment,\n dialect: SqlDialect,\n operation = \"query\",\n): { text: string; values: unknown[] } {\n if (!isFragment(fragment)) {\n throw new InvalidArgumentError(\n operation,\n \"DB\",\n operation,\n `Expected a fragment built with 'sql', got ${\n fragment === null ? \"null\" : typeof fragment\n }. A plain string is not accepted here on purpose — it would be the one ` +\n `path into the SQL text that nobody had to think about.`,\n );\n }\n\n // The one thing a raw parameter can be *told* about its type: a `::jsonb` the\n // caller wrote onto their own placeholder. Where there is one, the parameter\n // is retyped through `text` and its value serialised, because Bun otherwise\n // JSON-encodes a string bound to a `jsonb` parameter and stores the document\n // as a jsonb *string* where Prisma stored the object. See `json-param.ts` —\n // the mechanism, the measurements, and why a string is not serialised here\n // while `fieldParam` serialises one.\n //\n // The dialect is passed because this is not universal, and the reason is\n // narrower than it looks: `::` is Postgres-only syntax, but `cast(? as json)`\n // *parses and runs* on SQLite, where it means NUMERIC affinity — so retyping\n // it would rewrite a working statement into `cast(? as text)::json`, which\n // SQLite cannot parse. `typesParametersFromStatement` is false there.\n const json = retypeJsonParameters(fragment, dialect);\n\n const rendered = render(json.fragment, dialect, { model: \"DB\", operation });\n return {\n text: rendered.text,\n // `encodeUntyped` and not `encode`: there is no field here to ask, which is\n // the whole difference between a fragment's parameters and a compiled\n // plan's. It normalises the two JavaScript types whose SQL form the ORM has\n // already decided — a `Date` and a boolean — so a raw statement compares\n // against ORM-written rows on both dialects rather than only on Postgres.\n values: bindValues(rendered.binders)(undefined).map((value, index) =>\n json.jsonParameters.has(index)\n ? jsonTextParameter(value, operation)\n : value === null || value === undefined\n ? (value ?? null)\n : dialect.encodeUntyped(value),\n ),\n };\n}\n\n/**\n * One interpolated slot: a fragment splices, anything else binds.\n *\n * The binder ignores both its arguments. A compiled plan's binders read the\n * *call's* argument tree, because one plan serves many calls; a fragment is\n * built per call and closes over the value it was given, which is the whole\n * difference between the compiler's fragments and these.\n */\nfunction interpolate(value: unknown): Fragment {\n if (isFragment(value)) return value;\n return param(() => value);\n}\n"
8
8
  ],
9
9
  "mappings": ";wLACA,sBAAS,oBA0HF,IAAM,EAAa,IAAI,EAavB,SAAS,CAAkB,EAA+B,CAC/D,OAAO,EAAW,SAAS,GAAG,GAUzB,SAAS,CAAqB,EAAW,CAC9C,OAAO,EAAW,SAAS,GAAG,YAAc,EAgBvC,SAAS,CAAkB,CAChC,EACA,EACY,CACZ,IAAM,EAAU,EAAW,SAAS,EACpC,GAAI,EAAsB,IAAM,EAAM,OAAO,EAAG,EAehD,OAFA,EAAuB,CAAI,EAEp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B,OAAO,EAAM,IAAM,CAAK",
10
- "debugId": "2A5BE62B4FD6BA0D64756E2164756E21",
10
+ "debugId": "14B2E80CDD7EF77E64756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{Ab as a,Bb as O,Jb as M,Lb as Q,Nb as l,Ob as t,Pb as w,Rb as s}from"./chunk-pmhd6zfc.js";import{Yb as X}from"./chunk-4yt5x8s2.js";import{Cc as E,Ec as q,Fc as L,Kc as g,_b as f,gc as S,mc as D,nc as J,oc as k,tc as U,uc as j}from"./chunk-hwa5sqw5.js";import{Vc as i}from"./chunk-86jebsm4.js";import{De as T,He as v,ye as r}from"./chunk-hxf1re93.js";import{Se as c,Te as h}from"./chunk-qb5mv6pj.js";import{qf as Z}from"./chunk-sy7jbdeb.js";import{vf as N}from"./chunk-w62m5f0n.js";import{Af as W,xf as b}from"./chunk-d125j8t0.js";async function Hx(x){try{if(!await x.shouldRun.call(x))return}catch(B){console.error(`Error evaluating shouldRun for cron job ${x.name}:`,B);return}try{await x.onTick.call(x)}catch(B){console.error(`Error executing cron job ${x.name}:`,B)}try{await x.callback.call(x)}catch(B){console.error(`Error in cron job ${x.name}:`,B)}try{await x.onComplete.call(x)}catch(B){console.error(`Error completing cron job ${x.name}:`,B)}}class I{static token="scheduler";handles=[];resolved;constructor(x){this.resolved=x.jobs}get jobs(){return[...this.resolved]}useJobs(x){this.resolved=x}start(x=(B)=>B()){if(this.resolved.length===0)return;let B=globalThis.__gemiCronJobs??=new Map,C=new Map;for(let G of this.resolved){let H=new G;if(!H.name){console.error(`Cron job must have a name \u2014 ${G.name||"an anonymous class"} has none, so it is not scheduled. If this is a base class that other jobs extend, move it out of the discovered directory: \`abstract\` does not survive to runtime, so a class under app/cron is indistinguishable from a job.`);continue}if(!H.cron){console.error(`Cron job must have an expression. Job: ${H.name}`);continue}let Y=C.get(H.name);if(Y!==void 0){console.error(`Two cron jobs claim the name "${H.name}" \u2014 ${Y} is scheduled and ${G.name||"an anonymous class"} is not. A name is the scheduler's key, so only one job can hold it. Rename one.`);continue}C.set(H.name,G.name||"an anonymous class"),B.get(H.name)?.stop();let _=Bun.cron(H.cron,()=>x(()=>Hx(H)));B.set(H.name,_),this.handles.push(_)}}stop(){for(let x of this.handles)x.stop();this.handles=[]}}class Xx extends X{register(){this.app.singleton(T,()=>new T(this.app.config.get("auth",{})))}}class Yx extends X{register(){this.app.singleton(I,()=>new I(Z(M(),this.app.config.get("schedule",{}))))}async boot(){let x=this.app.make(I),B=this.app.config.get("schedule",{});if(B.jobs===void 0){let{jobsDir:G}=Z(M(),B);x.useJobs(await w(G))}if(process.env.GEMI_NO_SCHEDULE==="1")return;let C=this.app;x.start((G)=>b.run(C,G))}}class R{}class F extends Error{modelName;kind="FeatureModelMissing";constructor(x){super(`No "${x}" model is registered, so every feature stays off. Add the model to prisma/schema.prisma and export it from app/models \u2014 see docs/feature-flags.md.`);this.modelName=x}}class A extends R{modelName;constructor(x="FeatureFlag"){super();this.modelName=x}get available(){return c(this.modelName)}async load(){if(!this.available)throw new F(this.modelName);let x=h(this.modelName);return await x.asSystem(()=>x.findMany())}}function cx(x){return x}function u(){return{features:void 0,enabled:!0,source:new A,model:"FeatureFlag",ttl:30,context:void 0,onEvaluate:void 0,maxClientFlags:200}}class Zx extends X{register(){this.app.singleton(E,()=>{let x=this.app.config.get("features",{}),B=Z(u(),x);if(x?.model!==void 0&&x?.source===void 0)B.source=new A(x.model);else if(x?.model!==void 0&&x.source instanceof A&&x.source.modelName!==x.model)U.warning(`app/config/features.ts sets \`model: "${x.model}"\` and a source reading "${x.source.modelName}". The source wins; drop \`model\` to silence this.`);return new E(B,(C)=>U.warning(C))})}async boot(){let x=this.app.make(E);if(!x.config.enabled)return;try{await x.refresh()}catch(B){U.error(`Could not warm the feature flag cache at boot. ${B instanceof Error?B.message:String(B)}`)}}}class _x extends X{register(){this.app.singleton(N,()=>new N(this.app.config.get("mail",{})))}}function $x(x){return`listener:${x}`}function d(x,B){Px(x);let{maxAttempts:C,worker:G}=B,H=x.event.name,Y=class extends l{maxAttempts=C;worker=G;async run(..._){let[$,P]=Ox(_),z=W(V).rehydrate($,P);await new x().handle(z)}onFail(_){console.error(`The listener ${x.name} threw while handling ${H} off the queue. The queue will retry it up to ${C} times in total; nothing the dispatcher did is waiting on it.`,_)}onDeadletter(_){console.error(`The listener ${x.name} failed every one of its ${C} attempts at ${H} and has been dead-lettered, so this side effect did not happen and will not be retried.`,_)}};return Object.defineProperty(Y,"name",{value:$x(x.name),writable:!0}),Y}function Px(x){if(Object.getOwnPropertyDescriptor(x,"name")?.writable)return;throw Error(`The listener ${x.name} sets \`queued = true\` but does not declare \`static name\`, so it would be registered with the queue `+"under its class name \u2014 which a production build renames while the "+`payload that names it does not. Add: static name = "${x.name}";`)}function Ox(x){return typeof x[0]==="string"?x:x[0]}class V{static token="events";listeners={};events={};warnedFor=new Set;warnedAboutWaiting=new Set;config;constructor(x={}){this.config=Z(Q(),x),this.useListeners(this.config.listeners)}useListeners(x){this.config.listeners=x,this.listeners={},this.events={};let B=new Set;for(let C of x){if(!C.event){console.error(`Listener ${C.name} does not declare \`static event\`, so there is no event name to register it under and its handle will never run. Add: static event = SomeEvent;`);continue}if(B.has(C.name)){console.error(`Two event listeners are named "${C.name}" \u2014 the first is `+"registered and this one is not. A listener's name identifies it across the framework, so only one class can hold it. Rename one.");continue}B.add(C.name);let G=C.event.name,H=new C;this.events[G]??=C.event,(this.listeners[G]??=[]).push({listener:C,job:H.queued?d(C,H):null})}}get queuedListenerJobs(){return Object.values(this.listeners).flat().flatMap(({job:x})=>x?[x]:[])}get registeredListeners(){return[...this.config.listeners]}dispatch(x,B){if(this.deferToCommit(x,B,!1))return;this.runListeners(x,B)}async dispatchAndWait(x,B){if(this.deferToCommit(x,B,!0))return;return this.runListeners(x,B)}deferToCommit(x,B,C){let{name:G,afterCommit:H}=x.constructor;if(!H)return!1;let Y=i(()=>this.runListeners(x,B));if(Y&&C)this.warnNothingIsWaitedFor(G);return Y}async runListeners(x,B){let C=x.constructor.name,G=this.listeners[C];if(!G?.length){this.warnNothingIsListening(C);return}for(let{listener:H,job:Y}of G){if(Y){this.enqueue(Y,H,C,B);continue}try{await new H().handle(x)}catch(_){console.error(`The listener ${H.name} threw while handling ${C}. The `+"listeners after it still ran \u2014 a listener's failure is its own.",_)}}}rehydrate(x,B=[]){let C=this.events[x];if(!C)throw Error(`Cannot rebuild the event "${x}" that came off the queue: no registered listener binds to an event of that name, so there is no class to construct. A queued listener runs in an application that `+"discovered its own listeners \u2014 check that this process sees the "+`same app/listeners as the one that dispatched, and that the event declares \`static name = "${x}"\`.`);return new C(...B)}enqueue(x,B,C,G){if(G===void 0){console.error(`The listener ${B.name} is queued, but ${C} reached the dispatcher without its constructor arguments, so there is nothing for the queue to rebuild it from and the listener was skipped. Dispatch through ${C}.dispatch(...) or ${C}.dispatchAndWait(...), which carry them.`);return}try{W(O).push(x,JSON.stringify([C,G]))}catch(H){console.error(`The listener ${B.name} could not be queued for ${C}, so it did not run and will not be retried. The listeners after it still ran.`,H)}}warnNothingIsWaitedFor(x){if(Bun.env.NODE_ENV==="production")return;if(this.warnedAboutWaiting.has(x))return;this.warnedAboutWaiting.add(x),console.warn(`[gemi] ${x}.dispatchAndWait() was called inside a transaction and ${x} declares \`static afterCommit = true\`, so it resolved `+"immediately with no listener having run \u2014 they run when the "+"transaction commits. Await the transaction instead, or drop afterCommit if the caller needs the side effects first. Development only.")}warnNothingIsListening(x){if(Bun.env.NODE_ENV==="production")return;if(this.warnedFor.has(x))return;this.warnedFor.add(x),console.warn(`[gemi] ${x} was dispatched and nothing is listening for it. A listener registers under the name its event declares, so check that app/listeners holds a Listener with \`static event = ${x}\` and that ${x} declares \`static name = "${x}"\`. Development only.`)}}class zx extends X{register(){this.app.singleton(V,()=>new V(this.app.config.get("events",{})))}async boot(){let x=this.app.make(V),B=this.app.config.get("events",{});if(B.listeners===void 0){let{listenersDir:H}=Z(Q(),B);x.useListeners(await s(H))}let C=x.queuedListenerJobs;if(C.length===0)return;let G=this.app.make(O);for(let H of C)G.registerJob(H)}}class Kx extends X{register(){this.app.singleton(S,()=>new S(this.app.config.get("filesystem",{})))}}class Vx extends X{register(){this.app.singleton(D,()=>new D(this.app.config.get("image",{})))}}class Ax extends X{register(){this.app.instance(j,new j)}}function FB(x){return x}function o(){return{maxFileSize:10485760,onLogFileClosed:()=>{},onLogCreated:()=>{}}}class Ix extends X{register(){this.app.singleton(J,()=>new J(Z(o(),this.app.config.get("log",{}))))}async boot(){await this.app.make(J).boot()}}class Ux extends X{register(){this.app.singleton(k,()=>new k(Z(r(),this.app.config.get("middleware",{}))))}}function bB(x){return x}function n(){return{channels:{}}}class Ex extends X{register(){this.app.singleton(f,()=>new f(Z(n(),this.app.config.get("broadcast",{}))))}}class Wx extends X{register(){this.app.singleton(O,()=>new O(this.app.config.get("queue",{})))}async boot(){let x=this.app.config.get("queue",{});if(x.jobs!==void 0)return;let{jobsDir:B}=Z(a(),x);this.app.make(O).useJobs(await t(B))}}class y{}function e(x,B){return Math.floor(x/B)*B}function Qx(x,B){if(B<=0)return 0;return Math.min(1,Math.max(0,(B-x)/B))}function p(x,B,C,G){return B*Qx(C,G)+x}function Jx(x){let{current:B,previous:C,elapsed:G,window:H,limit:Y,cost:_}=x,$=Y-_;if($<0)return H;let P=Math.max(0,H-G);if(C>0){let K=H*(1-($-B)/C);if(K<=H)return Math.max(0,Math.ceil(K-G))}if(B<=$)return P;if(B<=0)return P;let z=H*(1-$/B);return P+Math.max(0,Math.ceil(z))}function xx(x){let{allowed:B,current:C,previous:G,now:H,elapsed:Y,window:_,limit:$,cost:P}=x;if(B){let K=p(C,G,Y,_);return{allowed:!0,limit:$,remaining:Math.max(0,Math.floor($-K)),resetAt:H-Y+_,retryAfter:0}}let z=Jx({current:C,previous:G,elapsed:Y,window:_,limit:$,cost:P});return{allowed:!1,limit:$,remaining:0,resetAt:H+z,retryAfter:z}}class m extends y{buckets=new Map;maxKeys;constructor(x={}){super();this.maxKeys=Math.max(1,x.maxKeys??1e5)}consume(x){let{key:B,limit:C,window:G}=x,H=x.cost??1,Y=Date.now(),_=e(Y,G),$=Y-_,P=this.roll(B,G,_),K=p(P.current,P.previous,$,G)+H<=C;if(K)P.current+=H;if(this.buckets.delete(B),this.buckets.set(B,P),this.buckets.size>this.maxKeys)this.evict(Y);return xx({allowed:K,current:P.current,previous:P.previous,now:Y,elapsed:$,window:G,limit:C,cost:H})}clear(){this.buckets.clear()}get size(){return this.buckets.size}roll(x,B,C){let G=this.buckets.get(x);if(!G||G.window!==B)return{window:B,windowStart:C,current:0,previous:0};if(G.windowStart===C)return G;if(G.windowStart+B===C)return G.previous=G.current,G.current=0,G.windowStart=C,G;return G.previous=0,G.current=0,G.windowStart=C,G}evict(x){for(let[B,C]of this.buckets)if(x-C.windowStart>=C.window*2)this.buckets.delete(B);for(let B of this.buckets.keys()){if(this.buckets.size<=this.maxKeys)break;this.buckets.delete(B)}}}function HC(x){return x}function Bx(){return{driver:new m,limit:1000,window:60}}class qx extends X{register(){this.app.singleton(v,()=>new v(Z(Bx(),this.app.config.get("ratelimiter",{}))))}}function OC(x){return x}function Cx(){return{url:process.env.REDIS_URL,options:void 0}}class Lx extends X{register(){this.app.singleton(g,()=>new g(Z(Cx(),this.app.config.get("redis",{}))))}}function Gx(x,B){let C=x.get(B);if(!C)throw Error(`Missing "${B}" configuration. Route dispatching needs a root router \u2014 declare it in "app/config/route.ts".`);return C}class Tx extends X{register(){this.app.singleton(L,()=>new L(Gx(this.app.config,"route.api"))),this.app.singleton(q,()=>new q(Gx(this.app.config,"route.view")))}boot(){this.app.make(L),this.app.make(q)}}
3
+ export{I as Ta,Xx as Ua,Yx as Va,R as Wa,F as Xa,A as Ya,cx as Za,u as _a,Zx as $a,_x as ab,V as bb,zx as cb,Kx as db,Vx as eb,Ax as fb,FB as gb,o as hb,Ix as ib,Ux as jb,bB as kb,n as lb,Ex as mb,Wx as nb,e as ob,xx as pb,y as qb,m as rb,HC as sb,Bx as tb,qx as ub,OC as vb,Cx as wb,Lx as xb,Tx as yb};
4
+
5
+ //# debugId=5D03A6748D65150C64756E2164756E21
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../services/cron/Scheduler.ts", "../auth/AuthServiceProvider.ts", "../services/cron/ScheduleServiceProvider.ts", "../services/email/MailServiceProvider.ts", "../services/events/listenerJob.ts", "../services/events/EventManager.ts", "../services/events/EventServiceProvider.ts", "../services/file-storage/FilesystemServiceProvider.ts", "../services/image-optimization/ImageServiceProvider.ts", "../services/kernel-id/KernelIdServiceProvider.ts", "../services/logging/config.ts", "../services/logging/LogServiceProvider.ts", "../services/middleware/MiddlewareServiceProvider.ts", "../services/pubsub/config.ts", "../services/pubsub/BroadcastServiceProvider.ts", "../services/queue/QueueServiceProvider.ts", "../services/rate-limiter/drivers/RateLimiterDriver.ts", "../services/rate-limiter/slidingWindow.ts", "../services/rate-limiter/drivers/InMemoryRateLimiterDriver.ts", "../services/rate-limiter/config.ts", "../services/rate-limiter/RateLimiterServiceProvider.ts", "../services/redis/config.ts", "../services/redis/RedisServiceProvider.ts", "../services/router/RouteServiceProvider.ts"],
3
+ "sources": ["../services/cron/Scheduler.ts", "../auth/AuthServiceProvider.ts", "../services/cron/ScheduleServiceProvider.ts", "../services/features/sources/FeatureFlagSource.ts", "../services/features/sources/DatabaseFeatureFlagSource.ts", "../services/features/config.ts", "../services/features/FeaturesServiceProvider.ts", "../services/email/MailServiceProvider.ts", "../services/events/listenerJob.ts", "../services/events/EventManager.ts", "../services/events/EventServiceProvider.ts", "../services/file-storage/FilesystemServiceProvider.ts", "../services/image-optimization/ImageServiceProvider.ts", "../services/kernel-id/KernelIdServiceProvider.ts", "../services/logging/config.ts", "../services/logging/LogServiceProvider.ts", "../services/middleware/MiddlewareServiceProvider.ts", "../services/pubsub/config.ts", "../services/pubsub/BroadcastServiceProvider.ts", "../services/queue/QueueServiceProvider.ts", "../services/rate-limiter/drivers/RateLimiterDriver.ts", "../services/rate-limiter/slidingWindow.ts", "../services/rate-limiter/drivers/InMemoryRateLimiterDriver.ts", "../services/rate-limiter/config.ts", "../services/rate-limiter/RateLimiterServiceProvider.ts", "../services/redis/config.ts", "../services/redis/RedisServiceProvider.ts", "../services/router/RouteServiceProvider.ts"],
4
4
  "sourcesContent": [
5
5
  "import type { CronJob } from \"./CronJob\";\nimport type { ScheduleConfig } from \"./config\";\n\n// The handle the in-process `Bun.cron(schedule, callback)` overload returns\n// (has `.stop()`). `ReturnType<typeof Bun.cron>` can't be used — it resolves to\n// the module-path overload's `Promise<void>` instead.\ntype BunCronHandle = Bun.CronJob;\n\n// Runs a tick inside whatever async context the framework needs, so a job body\n// can resolve services exactly like a request handler can.\nexport type ScheduleRunner = <T>(cb: () => T | Promise<T>) => Promise<T> | T;\n\ndeclare global {\n // Registered cron jobs keyed by name, kept on `globalThis` so it survives\n // `bun --hot` reloads. Re-registering a name stops the previous schedule\n // first, so a reload *updates* the job in place instead of stacking a\n // duplicate. (Bun also stops all in-process cron jobs before re-evaluating on\n // hot reload; this makes the intent explicit and covers any re-construction.)\n var __gemiCronJobs: Map<string, BunCronHandle> | undefined;\n}\n\n/**\n * One tick of one job: the gate, then the three hooks in order.\n *\n * Named and exported rather than left inline in `start()` because otherwise the\n * only way to reach it is to wait — the tightest schedule `Bun.cron` accepts is\n * once a minute, which is not a thing a test can honestly sit through. What a\n * caller gives up by calling this directly is Bun's clock; what it keeps is\n * everything the scheduler puts between the clock and the job, which is the\n * part that has behaviour.\n *\n * The three hooks each catch and log, so one throwing does not stop the next —\n * `onComplete` in particular runs whether `callback` returned or threw, closer\n * to a `finally` than to a success handler.\n */\nexport async function runTick(job: CronJob): Promise<void> {\n try {\n // Plain truthiness, not `!== false`. The sloppy gate an app writes is\n // `if (!isProduction) return false;`, which returns `undefined` on the path\n // that was meant to run — and between the two readings of that, the one\n // that skips a recurring tick is recoverable and the one that mails a\n // customer from a developer's laptop is not. The declared return type makes\n // that method a compile error anyway, so the type system catches it while\n // it is still being written and the runtime stays on the safe side.\n if (!(await job.shouldRun.call(job))) {\n return;\n }\n } catch (error) {\n // Fail closed, for the same reason. A gate that throws has told us nothing\n // about whether the job may run, and the framework already refuses to\n // schedule a job whose name or expression it cannot read rather than run\n // something half-declared. The throw is logged, so this is loud; the missed\n // tick comes back on the next one.\n console.error(\n `Error evaluating shouldRun for cron job ${job.name}:`,\n error,\n );\n return;\n }\n\n try {\n await job.onTick.call(job);\n } catch (error) {\n console.error(`Error executing cron job ${job.name}:`, error);\n }\n try {\n await job.callback.call(job);\n } catch (error) {\n console.error(`Error in cron job ${job.name}:`, error);\n }\n try {\n await job.onComplete.call(job);\n } catch (error) {\n console.error(`Error completing cron job ${job.name}:`, error);\n }\n}\n\nexport class Scheduler {\n static token = \"scheduler\";\n\n private handles: BunCronHandle[] = [];\n private resolved: Array<new () => CronJob>;\n\n constructor(config: Required<ScheduleConfig>) {\n this.resolved = config.jobs;\n }\n\n /**\n * The jobs this scheduler will run, or ran — declared in the config slice or\n * discovered under `app/cron`, whichever the slice asked for.\n *\n * #323 turned an application's schedule from an array it could import into a\n * directory it cannot, and an app that had a test walking that array —\n * asserting every report has an owner, that no two share an expression — was\n * about to lose it. This is where that test goes instead, and it is the\n * better question anyway: the config slice says what was asked for, this says\n * what the scheduler took.\n *\n * It lists what `start()` iterates, not what `Bun.cron` accepted. A job with\n * no name, no expression, or a name another job already claimed is logged and\n * skipped, and still appears here — a test walking this should see the\n * problem rather than have it tidied away.\n *\n * A copy, so that walk cannot edit the set the scheduler is running from.\n */\n get jobs(): ReadonlyArray<new () => CronJob> {\n return [...this.resolved];\n }\n\n /**\n * Replaces the job set, for the provider to hand over what it found under\n * `app/cron` before it calls `start()`.\n *\n * The scheduler is constructed in `register()`, where reading a directory and\n * importing what is in it is not allowed to happen — that phase is\n * synchronous and resolves nothing. So it is built from whatever the slice\n * declared and corrected in `boot()`, one line before it starts. Calling this\n * after `start()` changes what `jobs` reports and nothing else; the schedules\n * are already registered.\n */\n useJobs(jobs: Array<new () => CronJob>) {\n this.resolved = jobs;\n }\n\n /**\n * Schedules every configured job. Called from `ScheduleServiceProvider.boot()`\n * — never from the constructor — so a job body may resolve any service the\n * container holds by the time it first ticks. That ordering is what replaced\n * the old `kernel.waitForBoot()` handshake.\n */\n start(run: ScheduleRunner = (cb) => cb()) {\n if (this.resolved.length === 0) {\n return;\n }\n\n const registry = (globalThis.__gemiCronJobs ??= new Map());\n\n // Names claimed during *this* pass, which is a different question from what\n // `registry` holds. `registry` spans hot reloads and is supposed to already\n // contain the previous reload's handle under the same name; this starts\n // empty every time and is how a name claimed twice in one schedule is told\n // apart from the same job coming back after an edit.\n const claimed = new Map<string, string>();\n\n for (const Job of this.resolved) {\n const job = new Job();\n if (!job.name) {\n // Named by its class, because under discovery nobody wrote this job\n // down anywhere and `JSON.stringify(job)` on a nameless one prints\n // `{}`. The overwhelmingly common cause is the second sentence: a\n // shared base class sitting in the walked directory. `abstract` is\n // erased before this code runs, so there is nothing here that could\n // tell a base class from a job — only the message can.\n console.error(\n `Cron job must have a name — ${Job.name || \"an anonymous class\"} ` +\n `has none, so it is not scheduled. If this is a base class that ` +\n `other jobs extend, move it out of the discovered directory: ` +\n `\\`abstract\\` does not survive to runtime, so a class under ` +\n `app/cron is indistinguishable from a job.`,\n );\n continue;\n }\n if (!job.cron) {\n console.error(`Cron job must have an expression. Job: ${job.name}`);\n continue;\n }\n const taken = claimed.get(job.name);\n if (taken !== undefined) {\n // Refusing the second one, rather than letting it through to the\n // `registry.get(...).stop()` below — which is what used to happen, and\n // it stopped the *first* job's schedule while leaving both classes in\n // `jobs`. That is the failure #323 exists to remove wearing a disguise:\n // a report that silently stops arriving, and a test walking `jobs` that\n // sees two healthy entries and passes.\n console.error(\n `Two cron jobs claim the name \"${job.name}\" — ${taken} is ` +\n `scheduled and ${Job.name || \"an anonymous class\"} is not. A name ` +\n `is the scheduler's key, so only one job can hold it. Rename one.`,\n );\n continue;\n }\n claimed.set(job.name, Job.name || \"an anonymous class\");\n\n // Update in place: stop any schedule previously registered under this name\n // before re-registering, so a hot reload replaces rather than duplicates.\n registry.get(job.name)?.stop();\n\n // Inside `run`, gate included: a `shouldRun` that resolves a service to\n // decide is the ordinary case, and evaluating it out here would leave it\n // without the application context every other line of the tick has.\n const handle = Bun.cron(job.cron, () => run(() => runTick(job)));\n\n registry.set(job.name, handle);\n this.handles.push(handle);\n }\n }\n\n stop() {\n for (const handle of this.handles) {\n handle.stop();\n }\n this.handles = [];\n }\n}\n",
6
6
  "import { ServiceProvider } from \"../support/ServiceProvider\";\nimport type { AuthConfig } from \"./config\";\nimport { AuthManager } from \"./AuthManager\";\n\nexport class AuthServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n AuthManager,\n () => new AuthManager(this.app.config.get<AuthConfig>(\"auth\", {})),\n );\n }\n}\n",
7
7
  "import { kernelContext } from \"../../kernel/context\";\nimport { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { withDefaults } from \"../../support/withDefaults\";\nimport { discoverCronJobs } from \"../discovery\";\nimport { scheduleConfigDefaults, type ScheduleConfig } from \"./config\";\nimport { Scheduler } from \"./Scheduler\";\n\nexport class ScheduleServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n Scheduler,\n () =>\n new Scheduler(\n withDefaults(\n scheduleConfigDefaults(),\n this.app.config.get<ScheduleConfig>(\"schedule\", {}),\n ),\n ),\n );\n }\n\n /**\n * Resolves the schedule, then starts it.\n *\n * Cron jobs are scheduled in phase two, not in `register()`: a job body is\n * free to resolve any service, and by the time `boot()` runs every provider\n * has registered. Each tick re-enters the application context so the job sees\n * the same container a request handler would.\n *\n * ### Why the raw slice and not the scheduler's config\n *\n * The decision here is whether the app said anything, and by the time the\n * scheduler holds a config it can no longer tell: `withDefaults` treats an\n * absent key and an `undefined` one alike and substitutes the default `[]`,\n * which is the same value an app writes when it means \"nothing scheduled, and\n * I mean it\". Reading the slice before defaults are applied is the only place\n * that difference still exists.\n *\n * So: `jobs` present, including `jobs: []`, is used verbatim and no directory\n * is read. Absent or `undefined` — which includes an app with no `schedule`\n * slice at all — the classes under `jobsDir` are, which is the case #323 is\n * about: a cron job that is written and never listed fires never, and nothing\n * downstream is waiting to notice.\n */\n async boot() {\n const scheduler = this.app.make(Scheduler);\n const slice = this.app.config.get<ScheduleConfig>(\"schedule\", {});\n\n if (slice.jobs === undefined) {\n const { jobsDir } = withDefaults(scheduleConfigDefaults(), slice);\n scheduler.useJobs(await discoverCronJobs(jobsDir));\n }\n\n // Resolved, listed, and not started.\n //\n // `gemi run` sets this on the process it spawns. Booting the application is\n // how a console command reaches the container, and starting the schedule is\n // a side effect of that which nobody asked for: a `gemi run backfill` that\n // takes four minutes would otherwise fire the application's whole cron\n // schedule in a process no operator is watching, and `Bun.cron` handles hold\n // the loop open besides.\n //\n // Deliberately above `start` and below `useJobs`, so `app(Scheduler).jobs`\n // still answers honestly — a command that wants to fire a tick by hand can,\n // and a test asking what this application schedules gets the same answer\n // either way.\n //\n // An environment variable rather than a config field, because this is a\n // property of *this process* and not of the application: the same variable\n // is how a deploy runs one cron dyno beside several web ones, and a config\n // slice would have to know which command started it.\n if (process.env.GEMI_NO_SCHEDULE === \"1\") return;\n\n const app = this.app;\n scheduler.start((cb) => kernelContext.run(app, cb));\n }\n}\n",
8
+ "/**\n * Where the on/off switches come from.\n *\n * A seam rather than a hardcoded query for two reasons that already exist: the\n * database source cannot run in a unit test without a schema and a connection,\n * and an application that outgrows a table — a control plane, a config service —\n * should not have to fork the evaluator to move.\n *\n * `load()` returns **raw rows**, not booleans. A source fetches; the store\n * interprets, because the store is the half that knows which keys are declared.\n */\nexport abstract class FeatureFlagSource {\n /**\n * Every row.\n *\n * Returning `[]` means \"nothing is switched on\", which is a normal state — it\n * is what a fresh database looks like, and every feature is correctly off.\n * **Throwing** means \"I could not tell you\", which is different: the store\n * keeps serving whatever it last had rather than treating an outage as a mass\n * switch-off.\n */\n abstract load(): Promise<Record<string, unknown>[]>;\n}\n\n/** Raised when the application never added the model this source reads. */\nexport class FeatureModelMissingError extends Error {\n readonly kind = \"FeatureModelMissing\";\n\n constructor(readonly modelName: string) {\n super(\n `No \"${modelName}\" model is registered, so every feature stays off. Add the model to prisma/schema.prisma and export it from app/models — see docs/feature-flags.md.`,\n );\n }\n}\n",
9
+ "import * as registry from \"../../../orm/registry\";\nimport { FeatureFlagSource, FeatureModelMissingError } from \"./FeatureFlagSource\";\n\n/**\n * Reads the application's `FeatureFlag` table — one row per feature, carrying\n * one meaningful column.\n *\n * The model is resolved from the ORM registry **by name, at call time**, the way\n * `auth/UserProvider` resolves `User`. The framework cannot import a class the\n * application generates, and resolving lazily also means constructing this\n * source does not require the app's models to have been imported yet — only\n * loading does.\n */\nexport class DatabaseFeatureFlagSource extends FeatureFlagSource {\n constructor(readonly modelName: string = \"FeatureFlag\") {\n super();\n }\n\n /** Whether the application has registered the model at all. */\n get available(): boolean {\n return registry.has(this.modelName);\n }\n\n async load(): Promise<Record<string, unknown>[]> {\n if (!this.available) {\n throw new FeatureModelMissingError(this.modelName);\n }\n\n const model = registry.get<any>(this.modelName);\n\n // `asSystem` for the same reason auth uses it: features are read before\n // there is a user — on an anonymous page load, in a cron tick — and a policy\n // that denies by default would turn \"nobody is signed in\" into \"no rows\",\n // which silently switches every feature off for logged-out traffic.\n return await model.asSystem(() => model.findMany());\n }\n}\n",
10
+ "import type { HttpRequest } from \"../../http/HttpRequest\";\nimport type { FeatureRegistry } from \"./defineFeature\";\nimport { DatabaseFeatureFlagSource } from \"./sources/DatabaseFeatureFlagSource\";\nimport type { FeatureFlagSource } from \"./sources/FeatureFlagSource\";\nimport type { FeatureContext, FeatureEvaluation } from \"./types\";\n\n// Config key: `features`. Derived from `FeaturesServiceProvider`.\nexport interface FeaturesConfig {\n /**\n * The application's declarations — the default export of\n * `app/features/index.ts`.\n *\n * Named here as well as in the framework's `gemi.d.ts` because the two layers\n * cannot share one reference: the type augmentation resolves `@/app/features`\n * through the app's tsconfig paths, which exists only at compile time. This is\n * the runtime half. They should point at the same object.\n */\n features?: FeatureRegistry;\n\n /**\n * Master switch. `false` skips loading and evaluation entirely: every feature\n * reads off and the SSR payload carries `{}`.\n */\n enabled?: boolean;\n\n /** Where the on/off switches come from. The database by default. */\n source?: FeatureFlagSource;\n\n /** ORM registry name of the model, when using the database source. */\n model?: string;\n\n /**\n * Snapshot lifetime in **seconds**.\n *\n * This is the propagation delay: switching a feature on or off is live on\n * every instance within this window. Lower it if that matters more than the\n * query volume — there is no cross-instance invalidation.\n */\n ttl?: number;\n\n /**\n * Extra attributes for every evaluation — country, cohort, build, plan.\n * Reachable in a `when` as `ctx.attributes`.\n *\n * Runs on every request inside the render path, so keep it cheap and free of\n * I/O. If it throws, evaluation degrades to no attributes rather than failing\n * the page.\n */\n context?: (req: HttpRequest | null) => Record<string, unknown> | Promise<Record<string, unknown>>;\n\n /**\n * Called once per key per request after evaluation — the hook an analytics or\n * experiment pipeline reads exposures from. Errors are caught and logged.\n */\n onEvaluate?: (key: string, evaluation: FeatureEvaluation, ctx: FeatureContext) => void;\n\n /** Warn once per boot above this many client-visible features. */\n maxClientFlags?: number;\n}\n\nexport function defineFeaturesConfig(config: FeaturesConfig): FeaturesConfig {\n return config;\n}\n\nexport function featuresConfigDefaults(): Required<\n Omit<FeaturesConfig, \"features\" | \"context\" | \"onEvaluate\">\n> & {\n features: FeaturesConfig[\"features\"];\n context: FeaturesConfig[\"context\"];\n onEvaluate: FeaturesConfig[\"onEvaluate\"];\n} {\n return {\n features: undefined,\n enabled: true,\n source: new DatabaseFeatureFlagSource(),\n model: \"FeatureFlag\",\n ttl: 30,\n context: undefined,\n onEvaluate: undefined,\n maxClientFlags: 200,\n };\n}\n\nexport type ResolvedFeaturesConfig = ReturnType<typeof featuresConfigDefaults>;\n",
11
+ "import { Log } from \"../../facades/Log\";\nimport { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { withDefaults } from \"../../support/withDefaults\";\nimport { featuresConfigDefaults, type FeaturesConfig } from \"./config\";\nimport { FeatureManager } from \"./FeatureManager\";\nimport { DatabaseFeatureFlagSource } from \"./sources/DatabaseFeatureFlagSource\";\n\nexport class FeaturesServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(FeatureManager, () => {\n const declared = this.app.config.get<FeaturesConfig>(\"features\", {});\n const config = withDefaults(featuresConfigDefaults(), declared);\n\n // The default source is constructed by `featuresConfigDefaults()` with the\n // default model name, so a `model` override would otherwise be ignored\n // unless the app also replaced the source. Rebuild it here instead of\n // making every app that renames the table also know about the source.\n //\n // Keyed on what the *application* wrote, not on the merged values. The\n // merged `model` is always set — it defaults to `\"FeatureFlag\"` — so\n // comparing it against the source's name would fire for an app that\n // configured only `source: new DatabaseFeatureFlagSource(\"Flags\")`,\n // throwing that source away and pointing the replacement at a table the\n // app never mentioned. Every feature would then read off with nothing to\n // explain why.\n //\n // An explicit `source` always wins: it is the more specific statement, and\n // it is the only one of the two that can name something other than the\n // local table.\n if (declared?.model !== undefined && declared?.source === undefined) {\n config.source = new DatabaseFeatureFlagSource(declared.model);\n } else if (\n declared?.model !== undefined &&\n declared.source instanceof DatabaseFeatureFlagSource &&\n declared.source.modelName !== declared.model\n ) {\n Log.warning(\n `app/config/features.ts sets \\`model: \"${declared.model}\"\\` and a source reading \"${declared.source.modelName}\". The source wins; drop \\`model\\` to silence this.`,\n );\n }\n\n return new FeatureManager(config, (message) => Log.warning(message));\n });\n }\n\n async boot() {\n const features = this.app.make(FeatureManager);\n if (!features.config.enabled) return;\n\n // Warmed at boot so the first request is served from memory rather than\n // paying for the cold load. Wrapped because a database that is not up yet\n // must not fail the boot — the store fails closed, every feature reads off,\n // and it recovers on its own once the next TTL elapses.\n try {\n await features.refresh();\n } catch (error) {\n Log.error(\n `Could not warm the feature flag cache at boot. ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n }\n }\n}\n",
8
12
  "import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport type { MailConfig } from \"./config\";\nimport { MailManager } from \"./MailManager\";\n\nexport class MailServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n MailManager,\n () => new MailManager(this.app.config.get<MailConfig>(\"mail\", {})),\n );\n }\n}\n",
9
13
  "import { app } from \"../../foundation/app\";\nimport { Job } from \"../queue/Job\";\nimport { EventManager } from \"./EventManager\";\nimport type { Listener, ListenerClass } from \"./Listener\";\n\n/**\n * The adapter that lets `queued = true` be one line: a `Job` subclass, built at\n * registration, that runs exactly one listener.\n *\n * Retries, `maxAttempts`, dead-lettering, `concurrency` and worker-thread\n * execution are four features the queue already has, already documents for\n * applications, and is already tested on. A second queue for listeners would be\n * four features that are almost the same as those, differing in ways nobody\n * decided. So a queued listener is not queued by anything written here — it is\n * a job, and everything after `push` is the queue's.\n */\n\n/**\n * The name a listener's synthetic job is registered under.\n *\n * Prefixed, and visibly so. The synthetic jobs land in\n * `QueueManager.registeredJobs` alongside the app's own, because that getter is\n * documented as reporting what the manager was handed and a queued listener\n * genuinely is something the queue will run — hiding them would make a queue\n * introspection tool lie about what is about to execute. The prefix is what\n * keeps an author from reading `SendWelcomeEmail` there and looking for a job\n * file they never wrote.\n */\nexport function listenerJobName(listenerName: string): string {\n return `listener:${listenerName}`;\n}\n\n/**\n * Builds the `Job` subclass that runs one queued listener.\n *\n * `instance` is the listener the caller already constructed to read `queued`\n * off; the three fields that decide where the work runs are read from that one\n * instance rather than from a fresh one per attempt, so a listener's\n * constructor runs once at boot instead of once per retry.\n *\n * What crosses the queue is `[eventName, constructorArguments]` as JSON — a\n * name and the arguments, never the event instance and never the classes. That\n * is invariant 1 at its second boundary: the class objects on the pushing side\n * and the running side can come from two different module graphs (a minified\n * bundle and a source-side discovery walk), so a name declared as a string\n * literal is the only thing both ends agree on. `EventManager.rehydrate` turns\n * it back into an event.\n */\nexport function jobForListener(\n listener: ListenerClass,\n instance: Listener,\n): new () => Job {\n refuseImplicitName(listener);\n\n const attempts = instance.maxAttempts;\n const inWorker = instance.worker;\n const boundTo = listener.event.name;\n\n const job = class extends Job {\n maxAttempts = attempts;\n worker = inWorker;\n\n async run(...payload: unknown[]) {\n const [eventName, args] = readPayload(payload);\n const event = app(EventManager).rehydrate(eventName, args);\n await new listener().handle(event);\n }\n\n // The queue's failure path is silent unless a job writes to it: `onFail`\n // and `onDeadletter` on `Job` are empty bodies, and `QueueManager.run`\n // routes every rejection into exactly those two. Without these overrides a\n // queued listener that throws produces no output anywhere — `dispatch`\n // returned long ago, the sync path's \"the listener X threw while handling\n // Y\" line is on a branch this listener never takes, and the last thing that\n // happens is the entry leaving the queue. A welcome email that stopped\n // being sent in production would look exactly like one that was never\n // dispatched.\n //\n // That is also what makes `rehydrate`'s throw the informative failure it is\n // documented as: a payload naming an event this process does not know is\n // the shape a `worker = true` listener hits when its thread booted a\n // different build of the application, and it is unreachable from the\n // dispatcher's stack.\n //\n // Both hooks, not one. `onFail` carries the error and fires per attempt, so\n // a listener failing differently on each is visible; `onDeadletter` fires\n // once and reports the fact no attempt is left, which is a different thing\n // to know and the only line that means the work is gone. The final attempt\n // logs both, deliberately.\n //\n // The event is named from `static event` rather than from the payload:\n // reading the payload here means parsing it, and a throw out of either hook\n // would escape through `QueueManager.run`'s `catch` into a `run()` nobody\n // awaits.\n onFail(error: Error) {\n console.error(\n `The listener ${listener.name} threw while handling ${boundTo} off ` +\n `the queue. The queue will retry it up to ${attempts} times in ` +\n `total; nothing the dispatcher did is waiting on it.`,\n error,\n );\n }\n\n onDeadletter(error: Error) {\n console.error(\n `The listener ${listener.name} failed every one of its ${attempts} ` +\n `attempts at ${boundTo} and has been dead-lettered, so this side ` +\n `effect did not happen and will not be retried.`,\n error,\n );\n }\n };\n\n // The `value` is load-bearing: the queue keys its registry off `job.name`,\n // so without it the entry would be named after whatever binding this class\n // expression picked up. `writable: true` is the other half, and nothing\n // reads it today — it is here so the descriptor matches the one a declared\n // `static name = \"...\"` field produces. Every \"was this name declared?\"\n // check in the framework is a descriptor read rather than a value read\n // (`discovery.ts`, and `refuseImplicitName` below), because in development\n // the declared and the implicit spelling read the same string; and\n // redefining `name` without the flag leaves the class's own non-writable\n // descriptor in place. So a check later pointed at a *registered* job rather\n // than a discovered one — the queue's registry is the obvious place to move\n // one — would report every synthetic entry as a job the author never wrote,\n // under a fix they cannot apply. Cheap to keep, wrong to drop.\n Object.defineProperty(job, \"name\", {\n value: listenerJobName(listener.name),\n writable: true,\n });\n\n return job;\n}\n\n/**\n * Refuses to queue a listener whose name is the implicit class binding.\n *\n * A sync listener's name is only ever read inside one module graph, so\n * discovery warns about this and moves on. A queued one puts the name on the\n * wire: the push side looks the job up by `listener:<name>` in its registry and\n * the running side looks it up in *its* registry, and those two can be\n * different builds of the same application — the main process discovering\n * `app/listeners` from source while a `worker = true` listener runs in a thread\n * that imported `dist/server/bootstrap.mjs`, where minification renamed the\n * class. The names then disagree, `dispatchJob` resolves nothing, the worker\n * reports success, and the side effect silently stops happening in production.\n *\n * A throw rather than a warning because the failure is invisible from every\n * side once it happens, and because the fix is one line the author can read in\n * the message.\n */\nfunction refuseImplicitName(listener: ListenerClass): void {\n if (Object.getOwnPropertyDescriptor(listener, \"name\")?.writable) return;\n\n throw new Error(\n `The listener ${listener.name} sets \\`queued = true\\` but does not ` +\n `declare \\`static name\\`, so it would be registered with the queue ` +\n `under its class name — which a production build renames while the ` +\n `payload that names it does not. Add: static name = \"${listener.name}\";`,\n );\n}\n\n/**\n * The payload, whichever of the two shapes the queue handed it over in.\n *\n * The queue calls `run` two different ways and this is the only place that has\n * to know. In-process, `QueueManager.run` spreads the parsed arguments:\n * `run(\"UserRegistered\", [7, \"ada@example.com\"])`. Through a worker thread the\n * far side is `QueueManager.dispatchJob`, which passes the parsed array whole:\n * `run([\"UserRegistered\", [7, \"ada@example.com\"]])`. Reading only the first\n * shape would make `worker = true` a listener that receives an event named\n * `undefined` — a throw out of `rehydrate`, in a worker thread, retried to\n * dead-letter.\n *\n * The two are told apart by what is in the first slot rather than by counting\n * arguments, because the payload's own first element is always the event name\n * and a name is always a string.\n */\nfunction readPayload(payload: unknown[]): [string, unknown[]] {\n return (typeof payload[0] === \"string\" ? payload : payload[0]) as [\n string,\n unknown[],\n ];\n}\n",
10
14
  "import { app } from \"../../foundation/app\";\nimport { deferUntilCommit } from \"../../orm/context\";\nimport { withDefaults } from \"../../support/withDefaults\";\nimport type { Job } from \"../queue/Job\";\nimport { QueueManager } from \"../queue/QueueManager\";\nimport { eventConfigDefaults, type EventConfig } from \"./config\";\nimport type { Event, EventClass } from \"./Event\";\nimport { jobForListener } from \"./listenerJob\";\nimport type { ListenerClass } from \"./Listener\";\n\n/**\n * One listener, and where it runs.\n *\n * `queued` is an instance field, so answering \"does this one go on the queue?\"\n * means constructing the listener — done once here, at registration, rather\n * than once per dispatch. The synthetic job is built at the same moment for the\n * same reason: `EventServiceProvider.boot()` has to hand it to the queue before\n * the first dispatch, and a job built per dispatch would be a different class\n * object each time under the same registry key.\n */\ntype Registration = {\n listener: ListenerClass;\n /** The job a queued listener is pushed as, or `null` when it runs inline. */\n job: (new () => Job) | null;\n};\n\n/**\n * The registry a dispatch fans out through: event name -> the listeners bound\n * to it.\n *\n * Shaped after `QueueManager` deliberately — constructed in `register()` from\n * whatever the config slice declared, handed the discovered set in `boot()`,\n * and reporting through a `registered*` getter what it was *given* rather than\n * what it accepted, so a test can see a collision instead of having it tidied\n * away.\n *\n * Three things are not `QueueManager`'s, and each is a decision rather than a\n * detail:\n *\n * **Many listeners per key.** Two listeners for one event is the normal case\n * here, where two jobs for one name is the pathological one. So the map holds\n * arrays and `useListeners` appends. The collision it does refuse is two\n * *listener classes* claiming one `static name`.\n *\n * **Registration order is the walk's order, and means nothing.** It is stable —\n * `discoverClasses` sorts per directory and the module namespace sorts by name\n * — so it is reproducible, but no listener may depend on running before\n * another, because nothing about a filesystem layout was chosen to express\n * that. What makes it safe to say is the rule below: nothing a listener does\n * can stop the next one.\n *\n * **A dispatch nobody handles warns.** That is the entire early-warning system\n * for the subsystem, and it is why it is not optional; see `dispatchAndWait`.\n *\n * A `queued` listener is not run here at all. It is registered with the\n * `QueueManager` as a synthetic job and pushed to it on dispatch, so retries,\n * `maxAttempts`, dead-lettering and worker threads are the queue's rather than\n * a second implementation of the queue's — and nothing the request had (the\n * current actor, the ambient transaction) is still promised by the time it\n * runs. See `Listener.queued`.\n *\n * **A dispatch does not always fan out at the dispatch.** An event declaring\n * `static afterCommit` has the whole of it — queued listeners included — held\n * on the ORM's transaction scope and drained when that transaction commits, or\n * dropped when it rolls back. That is the only thing in this file that reads\n * ambient state, and `deferToCommit` is where it happens.\n */\nexport class EventManager {\n static token = \"events\";\n\n /** Event name -> every listener bound to it, in registration order. */\n private listeners: Record<string, Registration[]> = {};\n\n /**\n * Event name -> the class to rebuild it from, for a listener coming back off\n * the queue.\n *\n * Read from each listener's `static event` at registration, which is the one\n * place in the subsystem an event class is dereferenced. An event nobody\n * listens for is never in here, and that is exactly right: nothing can have\n * been queued for it.\n */\n private events: Record<string, EventClass> = {};\n\n /**\n * Event names already warned about. Per-manager, and the manager is per\n * application, so a test that builds a fresh kernel gets a fresh set.\n */\n private warnedFor = new Set<string>();\n\n /**\n * Event names already warned about for the `dispatchAndWait` + `afterCommit`\n * pairing. A second set rather than a second entry in the one above: the two\n * warnings are about different mistakes, and sharing the set would mean a\n * dispatch that legitimately has no listeners silences the one that says a\n * caller is awaiting nothing.\n */\n private warnedAboutWaiting = new Set<string>();\n\n readonly config: Required<EventConfig>;\n\n constructor(config: EventConfig = {}) {\n this.config = withDefaults(eventConfigDefaults(), config);\n this.useListeners(this.config.listeners);\n }\n\n /**\n * Replaces the registered set, for the provider to hand over what it found\n * under `app/listeners`.\n *\n * Two phases, for the reason `QueueManager.useJobs` documents: the manager is\n * constructed in `register()`, which is synchronous and must resolve nothing,\n * while reading a directory and importing what is in it is neither. So the\n * manager is built from whatever the config slice declared — nothing, when\n * the app left `listeners` out — and the discovered set arrives in `boot()`.\n *\n * The consequence worth knowing: anything that constructs an application and\n * skips phase two dispatches into an empty registry, and an empty registry is\n * a legal steady state rather than an error. The development-only warning\n * below is the only thing that says so.\n *\n * Every listener is **constructed once here**, to read the fields that decide\n * where it runs — `queued`, and through it `maxAttempts` and `worker`. A\n * listener's constructor therefore runs at boot as well as on every dispatch,\n * so it wants to assign fields and nothing else. A queued one also has its\n * synthetic job built here; `EventServiceProvider` hands those to the queue\n * once boot reaches it, so calling this again *after* boot would leave the\n * queue holding jobs for listeners this registry no longer has.\n */\n useListeners(listeners: ListenerClass[]) {\n this.config.listeners = listeners;\n\n this.listeners = {};\n this.events = {};\n const claimed = new Set<string>();\n\n for (const listener of listeners) {\n // Declared as required on the base class and still checked here: every\n // subclass inherits the declaration whether or not it assigns to it, so\n // `typeof SomeListener` satisfies `ListenerClass` either way and the\n // compiler cannot see the omission. Refused rather than registered under\n // some fallback, because there is no fallback — a listener with no event\n // is a file the author wrote that nothing will ever call.\n if (!listener.event) {\n console.error(\n `Listener ${listener.name} does not declare \\`static event\\`, so ` +\n `there is no event name to register it under and its handle will ` +\n `never run. Add: static event = SomeEvent;`,\n );\n continue;\n }\n\n // Two classes with one name, refused here and nowhere else — which is\n // what keeps the queue from being handed two jobs called\n // `listener:NotifyAdmins` and having to decide between them one layer\n // down, where the loser is a side effect that reports success. A\n // directory walk is what makes the clash ordinary, since nothing forces\n // the import alias a hand-written list would have demanded.\n if (claimed.has(listener.name)) {\n console.error(\n `Two event listeners are named \"${listener.name}\" — the first is ` +\n `registered and this one is not. A listener's name identifies it ` +\n `across the framework, so only one class can hold it. Rename one.`,\n );\n continue;\n }\n claimed.add(listener.name);\n\n // The one place the event class is dereferenced, and deliberately the\n // only one: this runs in the module graph that declared the class, so the\n // name it yields is the source-side one that discovery and a minified\n // dispatcher both agree on. Nothing downstream keeps the class object —\n // except `this.events`, which keeps it under that same string so a\n // listener coming back off the queue has something to rebuild from. First\n // claim wins there too: a name is what identifies an event to everything\n // downstream, so two classes declaring one are one event already.\n const name = listener.event.name;\n const instance = new listener();\n\n this.events[name] ??= listener.event;\n (this.listeners[name] ??= []).push({\n listener,\n job: instance.queued ? jobForListener(listener, instance) : null,\n });\n }\n }\n\n /**\n * The synthetic jobs the queue has to be told about — one per queued\n * listener, named `listener:<name>`.\n *\n * `EventServiceProvider.boot()` is the only caller. It reads this rather than\n * having the manager reach for the `QueueManager` itself, because\n * registration happens in `register()`, where resolving another service is\n * exactly what a provider must not do. A copy, so the caller cannot edit what\n * a dispatch pushes.\n */\n get queuedListenerJobs(): ReadonlyArray<new () => Job> {\n return Object.values(this.listeners)\n .flat()\n .flatMap(({ job }) => (job ? [job] : []));\n }\n\n /**\n * What the manager was handed, discovered or declared.\n *\n * \"Is this listener registered?\" is a question with a silent wrong answer —\n * an unregistered listener is a side effect that does not happen, and nothing\n * is waiting on it to notice. This is where a test asks it out loud.\n *\n * It reports what came in, not what the registry accepted, so a name claimed\n * twice appears twice here — deliberately, the same way `QueueManager` and\n * `Scheduler` do. A copy, so a walk over it cannot edit what dispatch reads.\n */\n get registeredListeners(): ReadonlyArray<ListenerClass> {\n return [...this.config.listeners];\n }\n\n /**\n * Fires the event and returns. The sync listeners run to completion after the\n * caller has moved on.\n *\n * Nothing is awaited and nothing can reject: `runListeners` catches every\n * listener's failure itself, so the floating promise here has no rejection to\n * float.\n *\n * `args` is the event's constructor arguments; see `dispatchAndWait`.\n *\n * On an `afterCommit` event inside a transaction, \"after the caller has moved\n * on\" becomes \"after that transaction commits\" — see `deferToCommit`.\n */\n dispatch(event: Event, args?: readonly unknown[]): void {\n if (this.deferToCommit(event, args, false)) return;\n void this.runListeners(event, args);\n }\n\n /**\n * Fires the event and resolves once every **sync** listener has settled.\n *\n * On an `afterCommit` event inside an open transaction it resolves\n * **immediately, having run nothing** — there is no listener to wait for yet,\n * and the transaction it would be waiting on is the caller's own. That is the\n * sharp edge `Event.afterCommit` documents and the reason the flag ships\n * opt-in; it warns once per event name in development, because nothing else\n * about the call site can show it.\n */\n async dispatchAndWait(\n event: Event,\n args?: readonly unknown[],\n ): Promise<void> {\n if (this.deferToCommit(event, args, true)) return;\n return this.runListeners(event, args);\n }\n\n /**\n * Queues the fan-out on the open transaction when the event asked for that,\n * and reports whether it did — `false` means the caller runs it now.\n *\n * Three cases, and only the third defers: an event without\n * `static afterCommit` behaves exactly as it did before this existed; one\n * with it, dispatched outside a transaction, has nothing to wait for; one\n * with it, inside a transaction, runs when that transaction commits and not\n * at all if it rolls back.\n *\n * `currentTransaction()` is not consulted directly, and the difference\n * matters: `deferUntilCommit` also answers `false` for a scope carrying a\n * handle that `withTransaction` did not open, which has no commit hook and\n * therefore no list that will ever be drained. Reading the handle alone would\n * queue the dispatch onto nothing and lose it silently.\n *\n * The whole fan-out is deferred, sync listeners and queued ones alike. A\n * queued listener is *pushed* at commit rather than at dispatch, which is the\n * only correct reading of `afterCommit`: the queue drains in-process and\n * often synchronously from `push`, so pushing early is running early.\n */\n private deferToCommit(\n event: Event,\n args: readonly unknown[] | undefined,\n awaited: boolean,\n ): boolean {\n // Read off the constructor, the same way the registry key is, and typed\n // structurally for the same reason: `Event` arrives here as a type-only\n // import, and the class object an application dispatches may have come from\n // a different module graph than the one this file was compiled against.\n const { name, afterCommit } = event.constructor as {\n name: string;\n afterCommit?: boolean;\n };\n if (!afterCommit) return false;\n\n const deferred = deferUntilCommit(() => this.runListeners(event, args));\n if (deferred && awaited) this.warnNothingIsWaitedFor(name);\n return deferred;\n }\n\n /**\n * Runs every **sync** listener bound to this event, in registration order,\n * and resolves when the last of them has settled. Every queued one is handed\n * to the `QueueManager` on the way past and is not waited for.\n *\n * The dispatch itself is `dispatch` and `dispatchAndWait` above; this is what\n * they run, and what an `afterCommit` event's transaction runs later. Split\n * out so that \"when does the fan-out happen\" is decided in exactly one place\n * rather than in each entry point.\n *\n * ### Sync and queued in one pass\n *\n * A queued listener is pushed at the point in the order it occupies, so its\n * *dispatch* is ordered with the rest and its *execution* is not: the queue\n * decides when. What that costs is worth knowing — `dispatchAndWait`\n * resolving says every sync listener has finished and says nothing at all\n * about a queued one, which may not have started or may already have failed\n * twice. Whether a listener is queued is therefore a decision about what the\n * caller can rely on having happened, not only about latency.\n *\n * @param args the arguments the event's constructor was called with, which\n * `Event.dispatch` forwards. Only a queued listener needs them: the event\n * instance itself never crosses the queue, and what is rebuilt on the other\n * side is `new EventClass(...args)`. Dispatching a hand-built instance\n * straight at the manager therefore cannot queue, and says so on stderr\n * rather than pushing a payload that would rehydrate into an event with\n * `undefined` fields.\n *\n * ### One at a time, deliberately\n *\n * Each listener is awaited before the next one starts, rather than started\n * together under a `Promise.allSettled`. Concurrency would make \"registration\n * order\" a claim about start order only, and the order it is a claim about is\n * the one `registeredListeners` reports and the discovery tests assert on.\n *\n * What it costs is worth knowing, because it is the one way listener\n * independence is not total: a listener that *hangs* — an un-timed-out\n * `fetch` to a host that never answers — delays every listener after it for\n * as long as it hangs, and under `dispatch` the caller has already moved on,\n * so an audit row a later listener writes simply is not there yet. A throw is\n * not this: that is caught below and the next listener runs immediately. A\n * listener that can block indefinitely is a listener that wants its own\n * timeout, or a `Job`.\n *\n * ### Errors\n *\n * Each listener runs inside its own `try`. A throw is logged with the event\n * name, the listener name, and the error, and the loop continues — listeners\n * are independent side effects, and letting listener 2 cancel 3 through 5\n * would make a filesystem walk's order load-bearing. Neither this nor\n * `dispatch` ever rejects, for the same reason from the caller's side: a\n * rejection would make listener 1's failure the dispatcher's problem while\n * listener 5's silently is not.\n *\n * ### Why zero listeners is worth a line on stderr\n *\n * A registry keyed by the wrong string, a `static name` that does not survive\n * a production build, a typo, and a listener directory that was never walked\n * all produce the same single symptom: nobody handled it. Zero listeners is\n * also a perfectly legal steady state, so the warning is development-only and\n * fires once per event name — a dispatch in a loop would otherwise bury the\n * terminal.\n */\n protected async runListeners(\n event: Event,\n args?: readonly unknown[],\n ): Promise<void> {\n const name = (event.constructor as { name: string }).name;\n const handlers = this.listeners[name];\n\n if (!handlers?.length) {\n this.warnNothingIsListening(name);\n return;\n }\n\n for (const { listener: Listener, job } of handlers) {\n if (job) {\n this.enqueue(job, Listener, name, args);\n continue;\n }\n\n try {\n await new Listener().handle(event);\n } catch (error) {\n console.error(\n `The listener ${Listener.name} threw while handling ${name}. The ` +\n `listeners after it still ran — a listener's failure is its own.`,\n error,\n );\n }\n }\n }\n\n /**\n * Rebuilds an event from what crossed the queue.\n *\n * The queue carries a name and an argument array, because that is all JSON\n * can carry: **the constructor arguments are what is serialized, not the\n * instance** — the same bargain `Job.dispatch` makes. So an event whose\n * constructor does work beyond assigning fields does that work a second time\n * here, in the worker, with none of the dispatching request around it.\n *\n * A name that resolves to nothing throws, and is the one place in this file\n * that does. The payload is already off the queue by the time this runs and\n * the listener is one line away from being handed `undefined`, so the\n * alternative is a `handle` reading `event.email` off nothing, several frames\n * further on, with the name that would have explained it no longer in scope.\n * A throw here is caught by `QueueManager.run` and takes the queue's ordinary\n * retry-then-dead-letter path.\n */\n rehydrate(eventName: string, args: readonly unknown[] = []): Event {\n const EventClass = this.events[eventName];\n\n if (!EventClass) {\n throw new Error(\n `Cannot rebuild the event \"${eventName}\" that came off the queue: no ` +\n `registered listener binds to an event of that name, so there is no ` +\n `class to construct. A queued listener runs in an application that ` +\n `discovered its own listeners — check that this process sees the ` +\n `same app/listeners as the one that dispatched, and that the event ` +\n `declares \\`static name = \"${eventName}\"\\`.`,\n );\n }\n\n return new EventClass(...args);\n }\n\n /**\n * Hands one queued listener to the queue, as `[eventName, args]`.\n *\n * Nothing is awaited: `push` returns as soon as the entry is on the queue,\n * which is the whole of what `queued = true` buys. The event instance the\n * sync listeners share does not go with it — only the name and the arguments\n * do, so nothing that was resolved from the request's context can be smuggled\n * across into an application that does not have it.\n *\n * Failing to queue is caught for the same reason a listener's throw is: it is\n * one listener's problem, and the listeners after it in the walk did not do\n * anything to deserve it. Two things reach that catch — an argument JSON\n * cannot serialise, and an application with no queue bound — and both would\n * otherwise reject `dispatchAndWait`, which is documented never to.\n */\n private enqueue(\n job: new () => Job,\n listener: ListenerClass,\n eventName: string,\n args?: readonly unknown[],\n ) {\n if (args === undefined) {\n console.error(\n `The listener ${listener.name} is queued, but ${eventName} reached ` +\n `the dispatcher without its constructor arguments, so there is ` +\n `nothing for the queue to rebuild it from and the listener was ` +\n `skipped. Dispatch through ${eventName}.dispatch(...) or ` +\n `${eventName}.dispatchAndWait(...), which carry them.`,\n );\n return;\n }\n\n try {\n app(QueueManager).push(job, JSON.stringify([eventName, args]));\n } catch (error) {\n console.error(\n `The listener ${listener.name} could not be queued for ${eventName}, ` +\n `so it did not run and will not be retried. The listeners after it ` +\n `still ran.`,\n error,\n );\n }\n }\n\n /**\n * The one warning for the pairing that reads as doing something and does not.\n *\n * `await UserRegistered.dispatchAndWait(...)` inside a transaction, on an\n * event that defers to commit, resolves with nothing having run — the\n * listeners are queued on a transaction the caller has not finished. There is\n * no other symptom: the promise resolves, the listeners do run later, and the\n * only thing that is wrong is that the caller's `await` bought it nothing.\n * Code that reads what a listener wrote on the next line finds it missing,\n * and nothing connects the two.\n *\n * Development only and once per event name, on the same terms as the\n * zero-listener warning: both are legal steady states that are usually a\n * mistake, and a dispatch in a loop must not bury the terminal.\n */\n private warnNothingIsWaitedFor(name: string) {\n if (process.env.NODE_ENV === \"production\") return;\n if (this.warnedAboutWaiting.has(name)) return;\n this.warnedAboutWaiting.add(name);\n\n console.warn(\n `[gemi] ${name}.dispatchAndWait() was called inside a transaction and ` +\n `${name} declares \\`static afterCommit = true\\`, so it resolved ` +\n `immediately with no listener having run — they run when the ` +\n `transaction commits. Await the transaction instead, or drop ` +\n `afterCommit if the caller needs the side effects first. Development ` +\n `only.`,\n );\n }\n\n private warnNothingIsListening(name: string) {\n if (process.env.NODE_ENV === \"production\") return;\n if (this.warnedFor.has(name)) return;\n this.warnedFor.add(name);\n\n console.warn(\n `[gemi] ${name} was dispatched and nothing is listening for it. A ` +\n `listener registers under the name its event declares, so check that ` +\n `app/listeners holds a Listener with \\`static event = ${name}\\` and ` +\n `that ${name} declares \\`static name = \"${name}\"\\`. Development only.`,\n );\n }\n}\n",
@@ -27,7 +31,7 @@
27
31
  "import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { withDefaults } from \"../../support/withDefaults\";\nimport { redisConfigDefaults, type RedisConfig } from \"./config\";\nimport { RedisManager } from \"./RedisManager\";\n\nexport class RedisServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n RedisManager,\n () =>\n new RedisManager(\n withDefaults(\n redisConfigDefaults(),\n this.app.config.get<RedisConfig>(\"redis\", {}),\n ),\n ),\n );\n }\n}\n",
28
32
  "import { ServiceProvider } from \"../../support/ServiceProvider\";\nimport { ApiRouteDispatcher } from \"./ApiRouteDispatcher\";\nimport { ViewRouteDispatcher } from \"./ViewRouteDispatcher\";\nimport type { ApiRouteConfig, ViewRouteConfig } from \"./config\";\nimport type { Repository } from \"../../support/Repository\";\n\nfunction readConfig<T>(config: Repository, key: string): T {\n const slice = config.get<T>(key);\n if (!slice) {\n throw new Error(\n `Missing \"${key}\" configuration. Route dispatching needs a root router — declare it in \"app/config/route.ts\".`,\n );\n }\n return slice;\n}\n\n/**\n * Owns both route dispatchers. Laravel ships a single RouteServiceProvider for\n * every route file it loads; the api/view split is a config slice, not a\n * separate provider.\n */\nexport class RouteServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n ApiRouteDispatcher,\n () =>\n new ApiRouteDispatcher(\n readConfig<ApiRouteConfig>(this.app.config, \"route.api\"),\n ),\n );\n\n this.app.singleton(\n ViewRouteDispatcher,\n () =>\n new ViewRouteDispatcher(\n readConfig<ViewRouteConfig>(this.app.config, \"route.view\"),\n ),\n );\n }\n\n /**\n * The two dispatchers are the one pair of services that must not be built\n * lazily: constructing them flattens the route tables and runs\n * `assertNoReservedRoutePaths`, so a missing `route` config or a route under\n * a reserved prefix has to fail the boot rather than the first request that\n * happens to hit it.\n */\n boot() {\n this.app.make(ApiRouteDispatcher);\n this.app.make(ViewRouteDispatcher);\n }\n}\n"
29
33
  ],
30
- "mappings": ";kgBAmCA,SAAsB,LAAO,LAAC,JAA6B,LACzD,HAAI,LAQF,GAAI,CAA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,CACxD,QAAQ,EAAG,CACT,KAAK,IAAI,UACP,EACA,IACE,IAAI,EACF,GAA2B,KAAK,IAAI,OAAQ,WAAW,CACzD,CACJ,EAEA,KAAK,IAAI,UACP,EACA,IACE,IAAI,EACF,GAA4B,KAAK,IAAI,OAAQ,YAAY,CAC3D,CACJ,EAUF,IAAI,EAAG,CACL,KAAK,IAAI,KAAK,CAAkB,EAChC,KAAK,IAAI,KAAK,CAAmB,EAErC",
35
+ "debugId": "5D03A6748D65150C64756E2164756E21",
32
36
  "names": []
33
37
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{$ as v,_ as D}from"./chunk-5fmbsy4q.js";import"./chunk-tkdxv6cq.js";import{Pb as q}from"./chunk-vdzb29p5.js";import{mc as P,pc as V}from"./chunk-r9h6aj7g.js";import"./chunk-g5pj95dz.js";import"./chunk-8v81dvje.js";import"./chunk-n2zmg475.js";import"./chunk-6fc909z5.js";import"./chunk-qfzyym5h.js";import"./chunk-f233yzxf.js";import"./chunk-btr9kyqh.js";import"./chunk-1esnvq2z.js";import"./chunk-mqwrmbh4.js";import"./chunk-yhzb9qpk.js";import"./chunk-4f69ygc8.js";import{join as E}from"path";import{Duplex as o}from"stream";import{constants as T,createBrotliCompress as l,createGzip as n}from"zlib";var i=["br","gzip"],t=1024,a=5,s=19,r=6;function e($){if($===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test($.trim()))return 1;let J=Number($.trim());return Number.isFinite(J)?Math.min(J,1):1}function JJ($){if($===null||$===void 0)return null;let J=new Map;for(let H of $.split(",")){let[Z,...X]=H.split(";"),j=Z.trim().toLowerCase();if(j==="")continue;let x=1;for(let K of X){let O=K.indexOf("=");if(O===-1)continue;if(K.slice(0,O).trim().toLowerCase()==="q"){x=e(K.slice(O+1));break}}J.set(j,x)}return J}function $J($,J=i){let H=JJ($);if(!H)return null;let Z=H.get("*"),X=null,j=0;for(let x of J){let K=H.get(x)??Z??0;if(K>j)X=x,j=K}return X}function HJ($,J){if(!$)return!1;return $.split(",").some((H)=>H.trim().toLowerCase().split("=")[0].trim()===J)}function UJ($,J){if($==="HEAD")return!1;if(!J.body)return!1;if(J.status<200||J.status===204||J.status===206||J.status===304)return!1;if(J.headers.has("Content-Range"))return!1;let H=J.headers.get("Content-Type");if(!H||!/^\s*text\/html\s*(;|$)/i.test(H))return!1;let Z=J.headers.get("Content-Encoding");if(Z&&Z.trim().toLowerCase()!=="identity")return!1;if(HJ(J.headers.get("Cache-Control"),"no-transform"))return!1;let X=J.headers.get("Content-Length");if(X!==null&&Number(X)<t)return!1;return!0}function ZJ($){let J=$==="br"?l({params:{[T.BROTLI_PARAM_QUALITY]:a,[T.BROTLI_PARAM_LGWIN]:s},flush:T.BROTLI_OPERATION_FLUSH}):n({level:r,flush:T.Z_SYNC_FLUSH});return o.toWeb(J)}function zJ($){let J=$.get("Vary");if(!J){$.set("Vary","Accept-Encoding");return}let H=J.split(",").map((Z)=>Z.trim().toLowerCase());if(H.includes("*")||H.includes("accept-encoding"))return;$.append("Vary","Accept-Encoding")}function F($,J){if(!UJ($.method,J))return J;let H=new Headers(J.headers);zJ(H);let Z=$J($.headers.get("Accept-Encoding"));if(!Z)return new Response(J.body,{status:J.status,statusText:J.statusText,headers:H});let X;try{X=ZJ(Z)}catch{return new Response(J.body,{status:J.status,statusText:J.statusText,headers:H})}return H.set("Content-Encoding",Z),H.delete("Content-Length"),new Response(J.body.pipeThrough(X),{status:J.status,statusText:J.statusText,headers:H})}function y($){let J=$.toString(),H=new Bun.CryptoHasher("sha1");return H.update(J),H.digest("hex")}if(!globalThis.URLPattern)globalThis.URLPattern=P;import{exists as GJ}from"fs/promises";var g="app/client.tsx";function w($){let J=$["app/client.tsx"]?.file;if(!J)return;return{module:`/${J}`,preload:S($,"app/client.tsx")}}function S($,J){let H=[],Z=new Set,X=(j)=>{if(Z.has(j))return;Z.add(j);let x=$[j];if(!x?.file)return;H.push(`/${x.file}`);for(let K of x.imports??[])X(K)};return X(J),H}var I=q(),XJ=E(I,"app"),L=E(I,"dist");async function VJ($,J){let H=await import(`${L}/client/.vite/manifest.json`),Z=await import(`${L}/server/.vite/manifest.json`);process.env.ROOT_DIR=I,process.env.APP_DIR=XJ,process.env.DIST_DIR=L;let X={},j={},x={},K={},O={},f=(U,G)=>`"${U}": () => import("${G}")`,k=[];for(let U of["404",...$.getFlatComponentTree.call($)]){let G=Z[`app/views/${U}.tsx`];if(!G?.file){console.log(`Server file not found for ${U}`),console.log(G);let W=Object.keys(Z),A=`app/views/${U}.tsx`;console.log(`${A} not found in server manifest`),console.log(W)}let Q=await import(`${process.env.DIST_DIR}/server/${G?.file}`);X[U]=Q.default,j[U]=Q.OpenGraph,x[U]=Q;let z=H[`app/views/${U}.tsx`];if(z?.css&&z?.css.length>0)K[U]=z?.css;if(z)k.push(f(U,`/${z?.file}`)),O[U]=S(H,`app/views/${U}.tsx`)}let u=`{${k.join(",")}}`,N=w(H);if(!N)console.error(`Client manifest has no "${g}" entry \u2014 dist/client is incomplete, so documents will render but never hydrate.`);let m=H["app/client.tsx"]?.css??[],h=(await Promise.all(m.map((U)=>Bun.file(`${L}/client/${U}`).text()))).join(`
2
+ import{$ as v,_ as D}from"./chunk-3aa287k7.js";import"./chunk-tkdxv6cq.js";import{Vb as q}from"./chunk-fjm4y8bn.js";import{Dc as V,sc as P}from"./chunk-hwa5sqw5.js";import"./chunk-86jebsm4.js";import"./chunk-y6a8r2bn.js";import"./chunk-7j6wbv12.js";import"./chunk-hxf1re93.js";import"./chunk-qb5mv6pj.js";import"./chunk-3g5bjvdf.js";import"./chunk-sy7jbdeb.js";import"./chunk-cyaz97p5.js";import"./chunk-d125j8t0.js";import"./chunk-dgsgjg53.js";import"./chunk-jhkjz9jr.js";import{join as E}from"path";import{Duplex as o}from"stream";import{constants as T,createBrotliCompress as l,createGzip as n}from"zlib";var i=["br","gzip"],t=1024,a=5,s=19,r=6;function e($){if($===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test($.trim()))return 1;let J=Number($.trim());return Number.isFinite(J)?Math.min(J,1):1}function JJ($){if($===null||$===void 0)return null;let J=new Map;for(let H of $.split(",")){let[Z,...X]=H.split(";"),j=Z.trim().toLowerCase();if(j==="")continue;let x=1;for(let K of X){let O=K.indexOf("=");if(O===-1)continue;if(K.slice(0,O).trim().toLowerCase()==="q"){x=e(K.slice(O+1));break}}J.set(j,x)}return J}function $J($,J=i){let H=JJ($);if(!H)return null;let Z=H.get("*"),X=null,j=0;for(let x of J){let K=H.get(x)??Z??0;if(K>j)X=x,j=K}return X}function HJ($,J){if(!$)return!1;return $.split(",").some((H)=>H.trim().toLowerCase().split("=")[0].trim()===J)}function UJ($,J){if($==="HEAD")return!1;if(!J.body)return!1;if(J.status<200||J.status===204||J.status===206||J.status===304)return!1;if(J.headers.has("Content-Range"))return!1;let H=J.headers.get("Content-Type");if(!H||!/^\s*text\/html\s*(;|$)/i.test(H))return!1;let Z=J.headers.get("Content-Encoding");if(Z&&Z.trim().toLowerCase()!=="identity")return!1;if(HJ(J.headers.get("Cache-Control"),"no-transform"))return!1;let X=J.headers.get("Content-Length");if(X!==null&&Number(X)<t)return!1;return!0}function ZJ($){let J=$==="br"?l({params:{[T.BROTLI_PARAM_QUALITY]:a,[T.BROTLI_PARAM_LGWIN]:s},flush:T.BROTLI_OPERATION_FLUSH}):n({level:r,flush:T.Z_SYNC_FLUSH});return o.toWeb(J)}function zJ($){let J=$.get("Vary");if(!J){$.set("Vary","Accept-Encoding");return}let H=J.split(",").map((Z)=>Z.trim().toLowerCase());if(H.includes("*")||H.includes("accept-encoding"))return;$.append("Vary","Accept-Encoding")}function F($,J){if(!UJ($.method,J))return J;let H=new Headers(J.headers);zJ(H);let Z=$J($.headers.get("Accept-Encoding"));if(!Z)return new Response(J.body,{status:J.status,statusText:J.statusText,headers:H});let X;try{X=ZJ(Z)}catch{return new Response(J.body,{status:J.status,statusText:J.statusText,headers:H})}return H.set("Content-Encoding",Z),H.delete("Content-Length"),new Response(J.body.pipeThrough(X),{status:J.status,statusText:J.statusText,headers:H})}function y($){let J=$.toString(),H=new Bun.CryptoHasher("sha1");return H.update(J),H.digest("hex")}if(!globalThis.URLPattern)globalThis.URLPattern=P;import{exists as GJ}from"fs/promises";var g="app/client.tsx";function w($){let J=$["app/client.tsx"]?.file;if(!J)return;return{module:`/${J}`,preload:S($,"app/client.tsx")}}function S($,J){let H=[],Z=new Set,X=(j)=>{if(Z.has(j))return;Z.add(j);let x=$[j];if(!x?.file)return;H.push(`/${x.file}`);for(let K of x.imports??[])X(K)};return X(J),H}var I=q(),XJ=E(I,"app"),L=E(I,"dist");async function VJ($,J){let H=await import(`${L}/client/.vite/manifest.json`),Z=await import(`${L}/server/.vite/manifest.json`);process.env.ROOT_DIR=I,process.env.APP_DIR=XJ,process.env.DIST_DIR=L;let X={},j={},x={},K={},O={},f=(U,G)=>`"${U}": () => import("${G}")`,k=[];for(let U of["404",...$.getFlatComponentTree.call($)]){let G=Z[`app/views/${U}.tsx`];if(!G?.file){console.log(`Server file not found for ${U}`),console.log(G);let W=Object.keys(Z),A=`app/views/${U}.tsx`;console.log(`${A} not found in server manifest`),console.log(W)}let Q=await import(`${process.env.DIST_DIR}/server/${G?.file}`);X[U]=Q.default,j[U]=Q.OpenGraph,x[U]=Q;let z=H[`app/views/${U}.tsx`];if(z?.css&&z?.css.length>0)K[U]=z?.css;if(z)k.push(f(U,`/${z?.file}`)),O[U]=S(H,`app/views/${U}.tsx`)}let u=`{${k.join(",")}}`,N=w(H);if(!N)console.error(`Client manifest has no "${g}" entry \u2014 dist/client is incomplete, so documents will render but never hydrate.`);let m=H["app/client.tsx"]?.css??[],h=(await Promise.all(m.map((U)=>Bun.file(`${L}/client/${U}`).text()))).join(`
3
3
  `),c=new P({pathname:"/*.:filetype(png|txt|js|css|jpg|svg|jpeg|avif|webp|ico|ttf|map)"});async function p(U){let{pathname:G}=new URL(U.url),Q=G.startsWith("/.well-known"),z=c.test({pathname:G})||Q,W=G.startsWith("/api");if(z&&!W){let A=new URL(U.url),b=U.url.replace(A.origin,"").split("?")[0],B=`${L}/client${b.replace("/assets/assets","/assets")}`,C=await GJ(B);if(!C&&A.pathname.includes(".js"))return new Response(`if(caches){caches?.delete("${B}")}window.location.reload();export {}`,{headers:{"Content-Type":"application/javascript"}});if(!C){if(G===V||G.startsWith(`${V}/`))return new Response("Not found",{status:404});return await R(U,G)}try{let Y=Bun.file(B),_=y(Y.lastModified);return new Response(Y.stream(),{headers:{"Content-Type":Y.type,"Cache-Control":"public, max-age=31536000, must-revalidate","Content-Length":String(Y.size),ETag:_}})}catch(Y){return $.onException?.(Y),new Response("Not found",{status:404})}}return await R(U,G)}async function R(U,G){let Q=$.fetch.bind($);try{let z=await Q(U);if(z instanceof Response)return z;else{let W=[];return W.push({content:h}),await z({getStyles:async(b)=>{if(!b)return D([]);for(let B of b){let C=H[`app/views/${B}.tsx`];for(let Y of C?.css??[]){let _=Bun.file(`${process.env.DIST_DIR}/client/${Y}`);W.push({id:Y,content:await _.text()})}}return D(W)},clientEntry:N,modulePreloadManifest:O,loaders:u,viewImportMap:X,viewModules:x,ogMap:j,cssManifest:K})}}catch(z){if(console.error(z),G.startsWith("/api"))return new Response(JSON.stringify({error:z.message}),{status:500,headers:{"Content-Type":"application/json"}});return $.onException?.(z),new Response(z.stack,{status:500})}}let d=(process.env.GEMI_COMPRESSION??"auto").toLowerCase()!=="off",M=Bun.serve({maxRequestBodySize:10737418240,fetch:async(U,G)=>{if(!U.headers.get("x-forwarded-for")){let z=G.requestIP(U);if(z)U.headers.set("x-forwarded-for",z.address)}let Q=await J(U,p);return d?F(U,Q):Q},idleTimeout:Number(process.env.SERVER_IDLE_TIMEOUT??10),port:process.env.PORT||5173});return v({port:M.port,rootDir:I}),M}export{VJ as httpProd};
4
4
 
5
- //# debugId=5F6500B824B8302F64756E2164756E21
5
+ //# debugId=5BD3C85C09F63E1D64756E2164756E21
@@ -9,6 +9,6 @@
9
9
  "/** The subset of a Vite manifest entry this module reads. */\nexport interface ViteManifestChunk {\n file: string;\n imports?: string[];\n dynamicImports?: string[];\n}\n\nexport type ViteManifest = Record<string, ViteManifestChunk>;\n\n/** Vite's manifest key for the module that boots hydration. */\nexport const CLIENT_ENTRY_KEY = \"app/client.tsx\";\n\n/**\n * How the shell boots hydration in production: `module` is imported from the\n * bootstrap script, `preload` is every chunk that import pulls in — see\n * `clientEntry` in `ViewRouteDispatcher` for why the entry does not go through\n * React's `bootstrapModules`.\n *\n * `undefined` when the manifest has no client entry, which means a `dist/`\n * interrupted between the server and client build passes. Degrading beats\n * throwing here: this runs at boot, so a deref would take down API routes,\n * static assets and health checks over what is only a document concern, and\n * the dispatcher already renders a shell that simply does not hydrate.\n */\nexport function createClientEntry(\n manifest: ViteManifest,\n): { module: string; preload: string[] } | undefined {\n const file = manifest[CLIENT_ENTRY_KEY]?.file;\n if (!file) {\n return undefined;\n }\n return {\n module: `/${file}`,\n preload: collectModulePreloads(manifest, CLIENT_ENTRY_KEY),\n };\n}\n\n/**\n * Every chunk URL that importing `entryKey` pulls in, itself first.\n *\n * The browser can only discover these one parse at a time — it learns about a\n * chunk's static imports after the chunk has arrived and been parsed — so a\n * `layout -> view -> child component` graph costs one round trip per level.\n * Handing the whole list to the shell as `modulepreload` hints turns that\n * chain into one parallel fetch (#352).\n *\n * `dynamicImports` are deliberately left out: those are the pieces the app\n * asked to load lazily, and preloading them would download code the current\n * route may never render.\n */\nexport function collectModulePreloads(manifest: ViteManifest, entryKey: string): string[] {\n const urls: string[] = [];\n // Chunk graphs are cyclic often enough (two chunks importing each other\n // through a shared module) that walking them without a visited set hangs.\n const visited = new Set<string>();\n\n const walk = (key: string) => {\n if (visited.has(key)) return;\n visited.add(key);\n const chunk = manifest[key];\n if (!chunk?.file) return;\n urls.push(`/${chunk.file}`);\n for (const imported of chunk.imports ?? []) {\n walk(imported);\n }\n };\n\n walk(entryKey);\n\n return urls;\n}\n"
10
10
  ],
11
11
  "mappings": ";6iBAAA,SAAS,OCkBT,WAAS,SACT,cAAS,oBAAW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