gemi 0.152.0 → 0.153.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 (135) hide show
  1. package/dist/ai/index.js +1 -1
  2. package/dist/app/index.js +1 -1
  3. package/dist/bun/plugin.js +1 -1
  4. package/dist/bun/preload.js +1 -1
  5. package/dist/{chunk-7txqv2qq.js → chunk-0fjn202c.js} +3 -3
  6. package/dist/{chunk-7txqv2qq.js.map → chunk-0fjn202c.js.map} +1 -1
  7. package/dist/{chunk-dxh8njb4.js → chunk-0hqg6ema.js} +2 -2
  8. package/dist/{chunk-dxh8njb4.js.map → chunk-0hqg6ema.js.map} +1 -1
  9. package/dist/{chunk-e06t0625.js → chunk-0mgswwbj.js} +2 -2
  10. package/dist/{chunk-e06t0625.js.map → chunk-0mgswwbj.js.map} +1 -1
  11. package/dist/{chunk-h8eawyhx.js → chunk-0t531zdt.js} +2 -2
  12. package/dist/{chunk-h8eawyhx.js.map → chunk-0t531zdt.js.map} +1 -1
  13. package/dist/{chunk-pq657qcp.js → chunk-198ywkt2.js} +1 -1
  14. package/dist/{chunk-fka28ceg.js → chunk-1a11x8ww.js} +1 -1
  15. package/dist/{chunk-nhdx7cpz.js → chunk-1q5eagpm.js} +1 -1
  16. package/dist/{chunk-xj9xd80t.js → chunk-2b6d1kaz.js} +3 -3
  17. package/dist/{chunk-xj9xd80t.js.map → chunk-2b6d1kaz.js.map} +1 -1
  18. package/dist/{chunk-1z619xe0.js → chunk-2r2j2nvq.js} +2 -2
  19. package/dist/{chunk-1z619xe0.js.map → chunk-2r2j2nvq.js.map} +1 -1
  20. package/dist/{chunk-4m0eqq80.js → chunk-2t61pc8v.js} +2 -2
  21. package/dist/{chunk-4m0eqq80.js.map → chunk-2t61pc8v.js.map} +1 -1
  22. package/dist/{chunk-65wy1r1a.js → chunk-3nf0nmpp.js} +1 -1
  23. package/dist/{chunk-ymdpt00k.js → chunk-403b2rfp.js} +2 -2
  24. package/dist/{chunk-ymdpt00k.js.map → chunk-403b2rfp.js.map} +1 -1
  25. package/dist/{chunk-bsa6b82q.js → chunk-41bvpent.js} +1 -1
  26. package/dist/{chunk-70yz9e7f.js → chunk-4ptz62pz.js} +2 -2
  27. package/dist/{chunk-70yz9e7f.js.map → chunk-4ptz62pz.js.map} +1 -1
  28. package/dist/{chunk-29jmaj16.js → chunk-4y74s15p.js} +1 -1
  29. package/dist/{chunk-9z8zq4rx.js → chunk-5gq41j99.js} +3 -3
  30. package/dist/{chunk-9z8zq4rx.js.map → chunk-5gq41j99.js.map} +1 -1
  31. package/dist/chunk-6tkkvaqg.js +5 -0
  32. package/dist/{chunk-fqqbnp0z.js.map → chunk-6tkkvaqg.js.map} +2 -2
  33. package/dist/{chunk-bykkqvd8.js → chunk-7j8x62yb.js} +2 -2
  34. package/dist/{chunk-bykkqvd8.js.map → chunk-7j8x62yb.js.map} +1 -1
  35. package/dist/{chunk-vm5t0j24.js → chunk-7jnawtcm.js} +2 -2
  36. package/dist/{chunk-vm5t0j24.js.map → chunk-7jnawtcm.js.map} +1 -1
  37. package/dist/{chunk-94hcjdbe.js → chunk-9xyd5r54.js} +2 -2
  38. package/dist/{chunk-94hcjdbe.js.map → chunk-9xyd5r54.js.map} +1 -1
  39. package/dist/{chunk-6vg2jvdp.js → chunk-ae5ycktd.js} +3 -3
  40. package/dist/{chunk-6vg2jvdp.js.map → chunk-ae5ycktd.js.map} +1 -1
  41. package/dist/{chunk-1ttd4rn9.js → chunk-afaff2se.js} +2 -2
  42. package/dist/{chunk-1ttd4rn9.js.map → chunk-afaff2se.js.map} +1 -1
  43. package/dist/{chunk-jzpbwvbt.js → chunk-baj76zja.js} +2 -2
  44. package/dist/{chunk-5yz684rw.js.map → chunk-baj76zja.js.map} +1 -1
  45. package/dist/{chunk-q9na1syb.js → chunk-c94a3qsx.js} +2 -2
  46. package/dist/{chunk-q9na1syb.js.map → chunk-c94a3qsx.js.map} +1 -1
  47. package/dist/{chunk-5yz684rw.js → chunk-dewn1kmd.js} +2 -2
  48. package/dist/{chunk-jzpbwvbt.js.map → chunk-dewn1kmd.js.map} +1 -1
  49. package/dist/{chunk-5q2pmve9.js → chunk-djyx6eyh.js} +2 -2
  50. package/dist/{chunk-5q2pmve9.js.map → chunk-djyx6eyh.js.map} +1 -1
  51. package/dist/{chunk-0mt7kqwx.js → chunk-f4hx69cr.js} +2 -2
  52. package/dist/{chunk-0mt7kqwx.js.map → chunk-f4hx69cr.js.map} +1 -1
  53. package/dist/chunk-fe9fvtvt.js +117 -0
  54. package/dist/{chunk-r52harpp.js.map → chunk-fe9fvtvt.js.map} +5 -4
  55. package/dist/{chunk-2k3935ke.js → chunk-h0kyymhv.js} +2 -2
  56. package/dist/{chunk-2k3935ke.js.map → chunk-h0kyymhv.js.map} +1 -1
  57. package/dist/{chunk-wq42t8jq.js → chunk-hk6mzz9n.js} +2 -2
  58. package/dist/{chunk-wq42t8jq.js.map → chunk-hk6mzz9n.js.map} +1 -1
  59. package/dist/{chunk-63xwah5k.js → chunk-ja1289jh.js} +1 -1
  60. package/dist/{chunk-tr9ynv3w.js → chunk-jgpbr2k1.js} +2 -2
  61. package/dist/{chunk-tr9ynv3w.js.map → chunk-jgpbr2k1.js.map} +1 -1
  62. package/dist/{chunk-z7tsh9qr.js → chunk-m5f6ksqe.js} +2 -2
  63. package/dist/{chunk-z7tsh9qr.js.map → chunk-m5f6ksqe.js.map} +1 -1
  64. package/dist/{chunk-1wz6kwjc.js → chunk-mp3ecfnh.js} +2 -2
  65. package/dist/{chunk-1wz6kwjc.js.map → chunk-mp3ecfnh.js.map} +1 -1
  66. package/dist/{chunk-4jd25v6d.js → chunk-nh01ncyy.js} +2 -2
  67. package/dist/{chunk-4jd25v6d.js.map → chunk-nh01ncyy.js.map} +1 -1
  68. package/dist/{chunk-hcw671mg.js → chunk-nhhnkv0e.js} +4 -4
  69. package/dist/{chunk-hcw671mg.js.map → chunk-nhhnkv0e.js.map} +1 -1
  70. package/dist/{chunk-j6ygdvj8.js → chunk-rb7518zz.js} +1 -1
  71. package/dist/{chunk-rkbwb3v5.js → chunk-rnd8s0n5.js} +2 -2
  72. package/dist/{chunk-rkbwb3v5.js.map → chunk-rnd8s0n5.js.map} +1 -1
  73. package/dist/{chunk-2djjs8f1.js → chunk-rnegd7ya.js} +3 -3
  74. package/dist/{chunk-2djjs8f1.js.map → chunk-rnegd7ya.js.map} +1 -1
  75. package/dist/{chunk-87y2nrjy.js → chunk-rq8b8pr5.js} +2 -2
  76. package/dist/{chunk-87y2nrjy.js.map → chunk-rq8b8pr5.js.map} +1 -1
  77. package/dist/{chunk-g22kph4n.js → chunk-rv751mxq.js} +2 -2
  78. package/dist/{chunk-g22kph4n.js.map → chunk-rv751mxq.js.map} +1 -1
  79. package/dist/{chunk-n9n4qt20.js → chunk-sbzqxtqg.js} +2 -2
  80. package/dist/{chunk-n9n4qt20.js.map → chunk-sbzqxtqg.js.map} +1 -1
  81. package/dist/{chunk-3x8zrsby.js → chunk-tdvjrftz.js} +2 -2
  82. package/dist/{chunk-3x8zrsby.js.map → chunk-tdvjrftz.js.map} +1 -1
  83. package/dist/{chunk-p27y4xrw.js → chunk-vfwpbveq.js} +2 -2
  84. package/dist/{chunk-p27y4xrw.js.map → chunk-vfwpbveq.js.map} +1 -1
  85. package/dist/{chunk-563ksar3.js → chunk-w6jff43c.js} +1 -1
  86. package/dist/{chunk-mtamgvf4.js → chunk-wckbrbzx.js} +2 -2
  87. package/dist/{chunk-mtamgvf4.js.map → chunk-wckbrbzx.js.map} +1 -1
  88. package/dist/{chunk-rma7afjd.js → chunk-wf4kywta.js} +3 -3
  89. package/dist/{chunk-rma7afjd.js.map → chunk-wf4kywta.js.map} +1 -1
  90. package/dist/{chunk-31c2vpq0.js → chunk-wwck0xwn.js} +2 -2
  91. package/dist/{chunk-31c2vpq0.js.map → chunk-wwck0xwn.js.map} +1 -1
  92. package/dist/{chunk-kmh402m4.js → chunk-yhgt9dxj.js} +2 -2
  93. package/dist/{chunk-kmh402m4.js.map → chunk-yhgt9dxj.js.map} +1 -1
  94. package/dist/{chunk-pwbm3x1y.js → chunk-z38m1nh5.js} +2 -2
  95. package/dist/{chunk-pwbm3x1y.js.map → chunk-z38m1nh5.js.map} +1 -1
  96. package/dist/client/index.d.ts +1 -1
  97. package/dist/client/index.d.ts.map +1 -1
  98. package/dist/client/types.d.ts +17 -1
  99. package/dist/client/types.d.ts.map +1 -1
  100. package/dist/config/index.js +1 -1
  101. package/dist/console/run.js +1 -1
  102. package/dist/container/index.js +1 -1
  103. package/dist/database/index.js +1 -1
  104. package/dist/email/index.js +1 -1
  105. package/dist/facades/Url.d.ts +29 -1
  106. package/dist/facades/Url.d.ts.map +1 -1
  107. package/dist/facades/index.js +1 -1
  108. package/dist/foundation/index.js +1 -1
  109. package/dist/http/index.js +1 -1
  110. package/dist/i18n/dictionaryRuntime.js +1 -1
  111. package/dist/i18n/index.js +1 -1
  112. package/dist/kernel/index.js +1 -1
  113. package/dist/orm/index.js +1 -1
  114. package/dist/server/index.js +2 -2
  115. package/dist/server/index.js.map +1 -1
  116. package/dist/services/index.js +2 -2
  117. package/dist/services/index.js.map +1 -1
  118. package/dist/services/queue/work.js +1 -1
  119. package/dist/stats/route-table.js +1 -1
  120. package/dist/support/index.js +1 -1
  121. package/dist/utils/apiUrl.d.ts +19 -0
  122. package/dist/utils/apiUrl.d.ts.map +1 -0
  123. package/dist/vitest/index.js +1 -1
  124. package/package.json +1 -1
  125. package/dist/chunk-fqqbnp0z.js +0 -5
  126. package/dist/chunk-r52harpp.js +0 -117
  127. /package/dist/{chunk-pq657qcp.js.map → chunk-198ywkt2.js.map} +0 -0
  128. /package/dist/{chunk-fka28ceg.js.map → chunk-1a11x8ww.js.map} +0 -0
  129. /package/dist/{chunk-nhdx7cpz.js.map → chunk-1q5eagpm.js.map} +0 -0
  130. /package/dist/{chunk-65wy1r1a.js.map → chunk-3nf0nmpp.js.map} +0 -0
  131. /package/dist/{chunk-bsa6b82q.js.map → chunk-41bvpent.js.map} +0 -0
  132. /package/dist/{chunk-29jmaj16.js.map → chunk-4y74s15p.js.map} +0 -0
  133. /package/dist/{chunk-63xwah5k.js.map → chunk-ja1289jh.js.map} +0 -0
  134. /package/dist/{chunk-j6ygdvj8.js.map → chunk-rb7518zz.js.map} +0 -0
  135. /package/dist/{chunk-563ksar3.js.map → chunk-w6jff43c.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Q as ne}from"./chunk-1wz6kwjc.js";import{_ as C}from"./chunk-dxh8njb4.js";import"./chunk-h8eawyhx.js";import{aa as _}from"./chunk-mtamgvf4.js";import{sl as c,wl as F}from"./chunk-jzpbwvbt.js";var x=c(_(),1),T=c(C(),1);var q=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var D=c(ne(),1);var u=c(_(),1),m=c(C(),1);var W=300000,h="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var j=async(e,o={},r)=>{let{SSOOIDCClient:t}=await import("./chunk-1ttd4rn9.js").then((m)=>c(m.default,1)),n=(f)=>o.clientConfig?.[f]??o.parentClientConfig?.[f]??r?.[f];return new t(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:n("logger"),userAgentAppId:n("userAgentAppId")}))};var X=async(e,o,r={},t)=>{let{CreateTokenCommand:n}=await import("./chunk-1ttd4rn9.js").then((m)=>c(m.default,1));return(await j(o,r,t)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var z=c(_(),1);var P=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new z.TokenProviderError(`Token is expired. ${h}`,!1)};var J=c(_(),1);var g=(e,o,r=!1)=>{if(typeof o>"u")throw new J.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${h}`,!1)};var V=c(C(),1);import{promises as re}from"fs";var{writeFile:te}=re,Y=(e,o)=>{let r=V.getSSOTokenFilepath(e),t=JSON.stringify(o,null,2);return te(r,t)};var B=new Date(0),Q=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let r=await m.parseKnownFiles(e),t=m.getProfileName({profile:e.profile??o?.profile}),n=r[t];if(!n)throw new u.TokenProviderError(`Profile '${t}' could not be found in shared credentials file.`,!1);else if(!n.sso_session)throw new u.TokenProviderError(`Profile '${t}' is missing required property 'sso_session'.`);let a=n.sso_session,p=(await m.loadSsoSessionData(e))[a];if(!p)throw new u.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let i of["sso_start_url","sso_region"])if(!p[i])throw new u.TokenProviderError(`Sso session '${a}' is missing required property '${i}'.`,!1);let{sso_start_url:S,sso_region:I}=p,s;try{s=await m.getSSOTokenFromFile(a)}catch(i){throw new u.TokenProviderError(`The SSO session token associated with profile=${t} was not found or is invalid. ${h}`,!1)}g("accessToken",s.accessToken),g("expiresAt",s.expiresAt);let{accessToken:y,expiresAt:E}=s,l={token:y,expiration:new Date(E)};if(l.expiration.getTime()-Date.now()>W)return l;if(Date.now()-B.getTime()<30000)return P(l),l;g("clientId",s.clientId,!0),g("clientSecret",s.clientSecret,!0),g("refreshToken",s.refreshToken,!0);try{B.setTime(Date.now());let i=await X(s,I,e,o);g("accessToken",i.accessToken),g("expiresIn",i.expiresIn);let O=new Date(Date.now()+i.expiresIn*1000);try{await Y(a,{...s,accessToken:i.accessToken,expiresAt:O.toISOString(),refreshToken:i.refreshToken})}catch(R){}return{token:i.accessToken,expiration:O}}catch(i){return P(l),l}};var k=c(_(),1),Z=c(C(),1),A=!1,$=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:r,ssoRegion:t,ssoRoleName:n,ssoClient:a,clientConfig:f,parentClientConfig:p,callerClientConfig:S,profile:I,filepath:s,configFilepath:y,ignoreCache:E,logger:l})=>{let i,O="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{let w=await Q({profile:I,filepath:s,configFilepath:y,ignoreCache:E})();i={accessToken:w.token,expiresAt:new Date(w.expiration).toISOString()}}catch(w){throw new k.CredentialsProviderError(w.message,{tryNextLink:A,logger:l})}else try{i=await Z.getSSOTokenFromFile(e)}catch(w){throw new k.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:A,logger:l})}if(new Date(i.expiresAt).getTime()-Date.now()<=0)throw new k.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:A,logger:l});let{accessToken:R}=i,{SSOClient:d,GetRoleCredentialsCommand:N}=await import("./chunk-rkbwb3v5.js"),se=a||new d(Object.assign({},f??{},{logger:f?.logger??S?.logger??p?.logger,region:f?.region??t,userAgentAppId:f?.userAgentAppId??S?.userAgentAppId??p?.userAgentAppId})),L;try{L=await se.send(new N({accountId:r,roleName:n,accessToken:R}))}catch(w){throw new k.CredentialsProviderError(w,{tryNextLink:A,logger:l})}let{roleCredentials:{accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:b,credentialScope:H,accountId:U}={}}=L;if(!M||!G||!K||!b)throw new k.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:A,logger:l});let v={accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:new Date(b),...H&&{credentialScope:H},...U&&{accountId:U}};if(o)D.setCredentialFeature(v,"CREDENTIALS_SSO","s");else D.setCredentialFeature(v,"CREDENTIALS_SSO_LEGACY","u");return v};var ee=c(_(),1),oe=(e,o)=>{let{sso_start_url:r,sso_account_id:t,sso_region:n,sso_role_name:a}=e;if(!r||!t||!n||!a)throw new ee.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
2
+ import{Q as ne}from"./chunk-mp3ecfnh.js";import{_ as C}from"./chunk-0hqg6ema.js";import"./chunk-0t531zdt.js";import{aa as _}from"./chunk-wckbrbzx.js";import{tl as c,xl as F}from"./chunk-baj76zja.js";var x=c(_(),1),T=c(C(),1);var q=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var D=c(ne(),1);var u=c(_(),1),m=c(C(),1);var W=300000,h="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var j=async(e,o={},r)=>{let{SSOOIDCClient:t}=await import("./chunk-afaff2se.js").then((m)=>c(m.default,1)),n=(f)=>o.clientConfig?.[f]??o.parentClientConfig?.[f]??r?.[f];return new t(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:n("logger"),userAgentAppId:n("userAgentAppId")}))};var X=async(e,o,r={},t)=>{let{CreateTokenCommand:n}=await import("./chunk-afaff2se.js").then((m)=>c(m.default,1));return(await j(o,r,t)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var z=c(_(),1);var P=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new z.TokenProviderError(`Token is expired. ${h}`,!1)};var J=c(_(),1);var g=(e,o,r=!1)=>{if(typeof o>"u")throw new J.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${h}`,!1)};var V=c(C(),1);import{promises as re}from"fs";var{writeFile:te}=re,Y=(e,o)=>{let r=V.getSSOTokenFilepath(e),t=JSON.stringify(o,null,2);return te(r,t)};var B=new Date(0),Q=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let r=await m.parseKnownFiles(e),t=m.getProfileName({profile:e.profile??o?.profile}),n=r[t];if(!n)throw new u.TokenProviderError(`Profile '${t}' could not be found in shared credentials file.`,!1);else if(!n.sso_session)throw new u.TokenProviderError(`Profile '${t}' is missing required property 'sso_session'.`);let a=n.sso_session,p=(await m.loadSsoSessionData(e))[a];if(!p)throw new u.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let i of["sso_start_url","sso_region"])if(!p[i])throw new u.TokenProviderError(`Sso session '${a}' is missing required property '${i}'.`,!1);let{sso_start_url:S,sso_region:I}=p,s;try{s=await m.getSSOTokenFromFile(a)}catch(i){throw new u.TokenProviderError(`The SSO session token associated with profile=${t} was not found or is invalid. ${h}`,!1)}g("accessToken",s.accessToken),g("expiresAt",s.expiresAt);let{accessToken:y,expiresAt:E}=s,l={token:y,expiration:new Date(E)};if(l.expiration.getTime()-Date.now()>W)return l;if(Date.now()-B.getTime()<30000)return P(l),l;g("clientId",s.clientId,!0),g("clientSecret",s.clientSecret,!0),g("refreshToken",s.refreshToken,!0);try{B.setTime(Date.now());let i=await X(s,I,e,o);g("accessToken",i.accessToken),g("expiresIn",i.expiresIn);let O=new Date(Date.now()+i.expiresIn*1000);try{await Y(a,{...s,accessToken:i.accessToken,expiresAt:O.toISOString(),refreshToken:i.refreshToken})}catch(R){}return{token:i.accessToken,expiration:O}}catch(i){return P(l),l}};var k=c(_(),1),Z=c(C(),1),A=!1,$=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:r,ssoRegion:t,ssoRoleName:n,ssoClient:a,clientConfig:f,parentClientConfig:p,callerClientConfig:S,profile:I,filepath:s,configFilepath:y,ignoreCache:E,logger:l})=>{let i,O="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{let w=await Q({profile:I,filepath:s,configFilepath:y,ignoreCache:E})();i={accessToken:w.token,expiresAt:new Date(w.expiration).toISOString()}}catch(w){throw new k.CredentialsProviderError(w.message,{tryNextLink:A,logger:l})}else try{i=await Z.getSSOTokenFromFile(e)}catch(w){throw new k.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:A,logger:l})}if(new Date(i.expiresAt).getTime()-Date.now()<=0)throw new k.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:A,logger:l});let{accessToken:R}=i,{SSOClient:d,GetRoleCredentialsCommand:N}=await import("./chunk-rnd8s0n5.js"),se=a||new d(Object.assign({},f??{},{logger:f?.logger??S?.logger??p?.logger,region:f?.region??t,userAgentAppId:f?.userAgentAppId??S?.userAgentAppId??p?.userAgentAppId})),L;try{L=await se.send(new N({accountId:r,roleName:n,accessToken:R}))}catch(w){throw new k.CredentialsProviderError(w,{tryNextLink:A,logger:l})}let{roleCredentials:{accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:b,credentialScope:H,accountId:U}={}}=L;if(!M||!G||!K||!b)throw new k.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:A,logger:l});let v={accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:new Date(b),...H&&{credentialScope:H},...U&&{accountId:U}};if(o)D.setCredentialFeature(v,"CREDENTIALS_SSO","s");else D.setCredentialFeature(v,"CREDENTIALS_SSO_LEGACY","u");return v};var ee=c(_(),1),oe=(e,o)=>{let{sso_start_url:r,sso_account_id:t,sso_region:n,sso_role_name:a}=e;if(!r||!t||!n||!a)throw new ee.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
3
3
  Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:o});return e};var Ce=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:r,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoSession:f}=e,{ssoClient:p}=e,S=T.getProfileName({profile:e.profile??o?.profile});if(!r&&!t&&!n&&!a&&!f){let s=(await T.parseKnownFiles(e))[S];if(!s)throw new x.CredentialsProviderError(`Profile ${S} was not found.`,{logger:e.logger});if(!q(s))throw new x.CredentialsProviderError(`Profile ${S} is not configured with SSO credentials.`,{logger:e.logger});if(s?.sso_session){let d=(await T.loadSsoSessionData(e))[s.sso_session],N=` configurations in profile ${S} and sso-session ${s.sso_session}`;if(n&&n!==d.sso_region)throw new x.CredentialsProviderError("Conflicting SSO region"+N,{tryNextLink:!1,logger:e.logger});if(r&&r!==d.sso_start_url)throw new x.CredentialsProviderError("Conflicting SSO start_url"+N,{tryNextLink:!1,logger:e.logger});s.sso_region=d.sso_region,s.sso_start_url=d.sso_start_url}let{sso_start_url:y,sso_account_id:E,sso_region:l,sso_role_name:i,sso_session:O}=oe(s,e.logger);return $({ssoStartUrl:y,ssoSession:O,ssoAccountId:E,ssoRegion:l,ssoRoleName:i,ssoClient:p,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:S,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}else if(!r||!t||!n||!a)throw new x.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return $({ssoStartUrl:r,ssoSession:f,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoClient:p,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:S,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})};export{oe as validateSsoProfile,q as isSsoProfile,Ce as fromSSO};
4
4
 
5
- //# debugId=836A89D74278297964756E2164756E21
5
+ //# debugId=7A8A4AF3C51B47AD64756E2164756E21
@@ -15,6 +15,6 @@
15
15
  "import { CredentialsProviderError } from \"@smithy/property-provider\";\nexport const validateSsoProfile = (profile, logger) => {\n const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;\n if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {\n throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters \"sso_account_id\", ` +\n `\"sso_region\", \"sso_role_name\", \"sso_start_url\". Got ${Object.keys(profile).join(\",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,EAAK,MACjB,CAAC,EAEA,QAAI,CAAC,GAAe,CAAC,GAAgB,CAAC,GAAa,CAAC,EACrD,MAAM,IAAI,2BAAyB,+HAC8B,CAAE,YAAa,GAAO,OAAQ,EAAK,MAAO,CAAC,EAG5G,YAAO,EAAsB,CACzB,cACA,aACA,eACA,YACA,cACA,YACA,aAAc,EAAK,aACnB,mBAAoB,EAAK,mBACzB,mBAAoB,EAAK,mBACzB,QAAS,EACT,SAAU,EAAK,SACf,eAAgB,EAAK,eACrB,YAAa,EAAK,YAClB,OAAQ,EAAK,MACjB,CAAC",
18
- "debugId": "836A89D74278297964756E2164756E21",
18
+ "debugId": "7A8A4AF3C51B47AD64756E2164756E21",
19
19
  "names": []
20
20
  }
@@ -45,7 +45,7 @@ export { isChunkLoadError, recoverFromChunkLoadError, CHUNK_RELOAD_MARKER, } fro
45
45
  export type { ChunkLoadErrorContext, ChunkLoadErrorSource, ChunkLoadRecoveryOptions, ChunkReloadBlock, } from "./chunkLoadRecovery";
46
46
  export { createRoot } from "./createRoot";
47
47
  export type { RPC, FileRPC, ViewRPC, I18nDictionary, BroadcastRPC, Features, FeatureKey, ClientFeatureKey, } from "./rpc";
48
- export type { ViewProps, LayoutProps, ViewPaths } from "./types";
48
+ export type { ViewProps, LayoutProps, ViewPaths, ApiPaths } from "./types";
49
49
  export type { CreateI18nDictionary } from "./I18nContext";
50
50
  export { Image } from "./Image";
51
51
  export { Head } from "./Head";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EA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E,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC3E,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { PropsWithChildren } from "react";
2
2
  import type { ViewHandler } from "../http";
3
3
  import type { Prettify, UnwrapPromise } from "../utils/type";
4
- import type { ViewRPC } from "./rpc";
4
+ import type { FileRPC, RPC, ViewRPC } from "./rpc";
5
5
  type ComponentBranch = [string, ComponentBranch[]];
6
6
  export type ComponentTree = ComponentBranch[];
7
7
  type RemoveDoubleSlash<T extends string> = T extends `${infer P}//${infer S}` ? RemoveDoubleSlash<`${P}/${S}`> : T;
@@ -31,6 +31,22 @@ export type RemoveGroupPrefix<T extends string> = T extends `${infer P}(${string
31
31
  * an `href`.
32
32
  */
33
33
  export type ViewPaths = ViewKeys<keyof ViewRPC>;
34
+ type ApiPathOf<K> = K extends `${"GET" | "POST" | "PUT" | "PATCH" | "DELETE"}:${infer P}` ? P : K extends `/${string}` ? K : never;
35
+ /**
36
+ * The api paths of an RPC map and a file-route map: each `"METHOD:/path"`
37
+ * key's path, each agent route's path, and each file route's path. What
38
+ * `ApiPaths` is built from; exported for type tests against a router of
39
+ * their own.
40
+ */
41
+ export type ApiPathsOf<R, F = {}> = ApiPathOf<keyof R> | (keyof F & string);
42
+ /**
43
+ * Every api route path the application declares, without the `/api` prefix
44
+ * (`/pages/:pageId/files/:fileId`): what `Url.api`, `Url.apiAbsolute` and
45
+ * `Url.matchApi` take. Like `ViewPaths`, its members are route patterns, and
46
+ * it holds only gemi's own routes (`/auth/...`) where the app's route
47
+ * augmentation does not resolve.
48
+ */
49
+ export type ApiPaths = ApiPathsOf<RPC, FileRPC>;
34
50
  export type ViewResult<T extends keyof ViewRPC> = ViewRPC[T] extends ViewHandler<infer I, infer O, infer P> ? {
35
51
  input: I;
36
52
  output: O;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../client/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErC,KAAK,eAAe,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;AACnD,MAAM,MAAM,aAAa,GAAG,eAAe,EAAE,CAAC;AAE9C,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,KAAK,M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C,IAAI,KAAK,GAAG,MAAM;CAAE,GACxB,CAAC,SAAS,GAAG,MAAM,MAAM,KAAK,MAAM,KAAK,GAAG,GAC1C;KAAG,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CAAE,GAClC,CAAC,SAAS,GAAG,MAAM,MAAM,KAAK,MAAM,KAAK,EAAE,GACzC;KAAG,CAAC,IAAI,KAAK,GAAG,MAAM,GAAG,MAAM;CAAE,GACjC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEtC,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC"}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import"../chunk-jzpbwvbt.js";function k(b){return b}function q(b){if((process.env.GEMI_REACT_COMPILER??"auto").toLowerCase()==="off")return!1;return b??!0}export{q as reactCompiler,k as defineConfig};
2
+ import"../chunk-baj76zja.js";function k(b){return b}function q(b){if((process.env.GEMI_REACT_COMPILER??"auto").toLowerCase()==="off")return!1;return b??!0}export{q as reactCompiler,k as defineConfig};
3
3
 
4
4
  //# debugId=2F7F86887FCF6F1A64756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ba as c}from"../chunk-j6ygdvj8.js";import{bb as f,cb as o}from"../chunk-fcqx2t0p.js";import{Bd as r,nd as A,qd as n,rd as u}from"../chunk-2b3hh9xw.js";import"../chunk-v9z4x5j2.js";import"../chunk-877yc341.js";import{Vi as g,Zi as v}from"../chunk-563ksar3.js";import{ij as h}from"../chunk-n9n4qt20.js";import"../chunk-xv58jnpb.js";import"../chunk-86zhngpg.js";import{Uj as t}from"../chunk-attr793y.js";import"../chunk-2ery6a75.js";import"../chunk-73rzf7ys.js";import{Yk as k}from"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-mzkzgp2j.js";import{nl as a}from"../chunk-apga49vp.js";import"../chunk-jzpbwvbt.js";function E(){let z=Promise.resolve(),J=Promise.resolve(),Y=(Q,G)=>new Promise(($)=>{Q.write(G,()=>$())});return{stdout:(Q)=>{z=Y(process.stdout,Q)},stderr:(Q)=>{J=Y(process.stderr,Q)},flush:async()=>{await Promise.all([z,J])}}}function x(z){let J=z.writers??E();return{args:z.args,options:z.options,argv:z.argv,line:(Y="")=>J.stdout(`${Y}
2
+ import{ba as c}from"../chunk-rb7518zz.js";import{bb as f,cb as o}from"../chunk-fcqx2t0p.js";import{Bd as r,nd as A,qd as n,rd as u}from"../chunk-2b3hh9xw.js";import"../chunk-v9z4x5j2.js";import"../chunk-877yc341.js";import{Vi as g,Zi as v}from"../chunk-w6jff43c.js";import{ij as h}from"../chunk-sbzqxtqg.js";import"../chunk-xv58jnpb.js";import"../chunk-86zhngpg.js";import{Uj as t}from"../chunk-attr793y.js";import"../chunk-2ery6a75.js";import"../chunk-73rzf7ys.js";import{Yk as k}from"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-mzkzgp2j.js";import{nl as a}from"../chunk-apga49vp.js";import"../chunk-baj76zja.js";function E(){let z=Promise.resolve(),J=Promise.resolve(),Y=(Q,G)=>new Promise(($)=>{Q.write(G,()=>$())});return{stdout:(Q)=>{z=Y(process.stdout,Q)},stderr:(Q)=>{J=Y(process.stderr,Q)},flush:async()=>{await Promise.all([z,J])}}}function x(z){let J=z.writers??E();return{args:z.args,options:z.options,argv:z.argv,line:(Y="")=>J.stdout(`${Y}
3
3
  `),error:(Y)=>J.stderr(`${Y}
4
4
  `),fail:(Y,Q=1)=>{throw new A(Y,Q)}}}import b from"path";var Gz=u("encryption:rotate").describe("Re-encrypt encrypted columns that are still under an older key").arg("model",{description:"The model to rotate. Omit to rotate every model with encrypted columns"}).option("batchSize",{type:"number",default:500,description:"Rows read and rewritten per batch"}).option("dryRun",{type:"boolean",description:"Count what would be re-encrypted, and write nothing"}).option("encryptPlaintext",{type:"boolean",description:"Also encrypt values that are not encrypted yet (a column just marked @gemi.encrypted)"}).handle(async({args:z,options:J,line:Y,fail:Q})=>{let G=z.model?[z.model]:[...new Set(h().map((B)=>B.split(".")[0]))],$=z.model?null:Jz();if(G.length===0&&!$){Y("No model has encrypted columns.");return}if($){let B=await $.rotateEncryption({dryRun:J.dryRun});Y(`OAuth connections: ${B.scanned} rows, ${B.rotated} ${J.dryRun?"to re-encrypt":"re-encrypted"}`)}let _=0;for(let B of G){let V=await c(B,{batchSize:J.batchSize,dryRun:J.dryRun,encryptPlaintext:J.encryptPlaintext});_+=V.plaintext,Y(`${V.model} (${V.fields.join(", ")}): ${V.scanned} rows, ${V.rotated} ${J.dryRun?"to re-encrypt":"re-encrypted"}`+(V.skipped>0?`, ${V.skipped} changed meanwhile (already current)`:"")+(V.plaintext>0?`, ${V.plaintext} not encrypted yet`:""))}if(_>0)Q(`${_} value${_===1?" is":"s are"} not encrypted. If the column was just marked @gemi.encrypted, run again with --encrypt-plaintext.`)});function Jz(){let z=k();if(!z.bound(v))return null;let J=z.make(v);if(Object.keys(J.providers).length===0)return null;let Y=J.store;return Y instanceof g?Y:null}var m=[Gz];function R(z){return z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function Qz(z){let J=new Map,Y=new Map;for(let Q of z){J.set(R(Q.name),Q),J.set(Q.name,Q);let G="alias"in Q?Q.alias:void 0;if(G)Y.set(G,Q)}return{byName:J,byAlias:Y}}function l(z){if(z==="--")return!0;if(!z.startsWith("-"))return!1;if(z==="-")return!1;if(/^-(\d|\.\d)/.test(z))return!1;return!0}function p(z,J){let{byName:Y,byAlias:Q}=Qz(z.options),G=[],$=[],_=new Map,B=!Y.has("help"),V=!Q.has("h"),F=!1,N=!1,W=(X)=>G.push(`Unknown option ${X} for command "${z.commandName}".`),T=(X,Z)=>{if(Z==="--help"||Z==="-h")N=!0;G.push(Z===void 0?`Option ${X} needs a value.`:`Option ${X} needs a value, but the next token is ${JSON.stringify(Z)}, which is another option. If that really is the value, write ${X}=${Z}.`)},j=0;while(j<J.length){let X=J[j];if(X==="--"){$.push(...J.slice(j+1));break}if(X.startsWith("--")){let Z=X.slice(2),K=Z.indexOf("="),M=K===-1?Z:Z.slice(0,K),O=K===-1?void 0:Z.slice(K+1),P=Y.get(M),D=!1;if(!P&&M.startsWith("no-")){let S=Y.get(M.slice(3));if(S&&S.type==="boolean")P=S,D=!0}if(!P&&M==="help"&&B){F=!0,j+=1;continue}if(!P){W(`--${M}`),j+=1;continue}if(P.type==="boolean"){if(O!==void 0&&O!=="true"&&O!=="false")G.push(`Option --${R(P.name)} is a flag and takes no value, but got ${JSON.stringify(O)}.`);else{let S=O===void 0?!0:O==="true";_.set(P.name,D?!S:S)}j+=1;continue}if(O!==void 0){_.set(P.name,O),j+=1;continue}let L=J[j+1];if(L===void 0||l(L)){T(`--${R(P.name)}`,L),j+=1;continue}_.set(P.name,L),j+=2;continue}if(X.startsWith("-")&&X.length>1){let Z=X.slice(1),K=!1;for(let M=0;M<Z.length;M+=1){let O=Q.get(Z[M]);if(!O){if(Z[M]==="h"&&V){F=!0;continue}W(`-${Z[M]}`);break}if(O.type==="boolean"){_.set(O.name,!0);continue}let P=Z.slice(M+1),D=P.startsWith("=")?P.slice(1):P;if(D!==""){_.set(O.name,D);break}let L=J[j+1];if(L===void 0||l(L)){T(`-${O.alias}`,L);break}_.set(O.name,L),K=!0;break}j+=K?2:1;continue}$.push(X),j+=1}let H={},I=0;for(let X of z.args){if(X.variadic){let K=$.slice(I);if(I=$.length,H[X.name]=K,X.required&&K.length===0)G.push(`Missing required argument <${X.name}...>. Command "${z.commandName}" needs at least one.`);continue}let Z=$[I];if(I+=1,Z!==void 0){H[X.name]=Z;continue}if(X.default!==void 0){H[X.name]=X.default;continue}if(X.required)G.push(`Missing required argument <${X.name}>.`);H[X.name]=void 0}if(I<$.length){let X=$.slice(I);G.push(`Unexpected argument${X.length===1?"":"s"} ${X.map((Z)=>JSON.stringify(Z)).join(", ")}. Command "${z.commandName}" takes ${z.args.length} argument${z.args.length===1?"":"s"}.`)}let U={};for(let X of z.options){let Z=_.get(X.name);if(X.type==="boolean"){U[X.name]=Z===void 0?X.default??!1:Boolean(Z);continue}if(Z===void 0){if(X.default!==void 0)U[X.name]=X.default;else if(X.required)G.push(`Missing required option --${R(X.name)}.`),U[X.name]=void 0;else U[X.name]=void 0;continue}let K=String(Z);if(X.type==="number"){let M=Number(K);if(K.trim()===""||!Number.isFinite(M))G.push(`Option --${R(X.name)} expects a number, but got ${JSON.stringify(K)}.`),U[X.name]=void 0;else U[X.name]=M;continue}U[X.name]=K}let q=F&&!N;if(G.length>0)return{ok:!1,help:q,errors:G};return{ok:!0,help:q,args:H,options:U}}function C(z,J=" "){let Y=z.reduce((Q,[G])=>Math.max(Q,G.length),0);return z.map(([Q,G])=>G===""?`${J}${Q}`:`${J}${Q.padEnd(Y)} ${G}`)}function d(z){let J=z.variadic?`${z.name}...`:z.name;return z.required?`<${J}>`:`[${J}]`}function Xz(z){let J=(G)=>z.options.some(G),Y=J((G)=>G.name==="help"||R(G.name)==="help"),Q=J((G)=>("alias"in G)&&G.alias==="h");if(Y&&Q)return[];if(Y)return[["-h","Show this message"]];return[[`${Q?"":"-h, "}--help`,"Show this message"]]}function w(z){let J=[],Y=z.args.map(d).join(" "),Q=["gemi run",z.commandName,z.options.length>0?"[options]":"",Y].filter(Boolean).join(" ");if(J.push(`Usage: ${Q}`),z.description)J.push("",z.description);if(z.args.length>0)J.push("","Arguments:"),J.push(...C(z.args.map((G)=>{let $=[G.description??"",G.default!==void 0?`(default: ${JSON.stringify(G.default)})`:""].filter(Boolean).join(" ");return[d(G),$]})));return J.push("","Options:"),J.push(...C([...z.options.map((G)=>{let $="alias"in G&&G.alias?`-${G.alias}, `:"",_=G.type==="boolean"?"":` <${G.type}>`,B=[G.description??"",G.default!==void 0?`(default: ${JSON.stringify(G.default)})`:"","required"in G&&G.required?"(required)":""].filter(Boolean).join(" ");return[`${$}--${R(G.name)}${_}`,B]}),...Xz(z)])),J.join(`
5
5
  `)}function i(z){return["Provided by gemi:","",...C(z.map((J)=>[J.commandName,J.description]))].join(`
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Zk as e,_k as o}from"../chunk-e9z8p2fy.js";import"../chunk-jzpbwvbt.js";export{o as Container,e as BindingResolutionError};
2
+ import{Zk as e,_k as o}from"../chunk-e9z8p2fy.js";import"../chunk-baj76zja.js";export{o as Container,e as BindingResolutionError};
3
3
 
4
4
  //# debugId=BB1ED1E26DFF0E5464756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Ea as N}from"../chunk-bstn00nx.js";import"../chunk-eqv7yxk7.js";import"../chunk-3csz8pfk.js";import"../chunk-xv58jnpb.js";import"../chunk-attr793y.js";import{kk as j,lk as k,nk as w,ok as x,pk as z,qk as A,rk as E,sk as F,tk as G,uk as H,vk as I,wk as J,xk as K,yk as L}from"../chunk-73rzf7ys.js";import"../chunk-jzpbwvbt.js";export{A as isSqlite,E as isMysqlFamily,z as inferDialect,j as defineDatabaseConfig,k as databaseConfigDefaults,w as UnknownDatabaseUrlError,H as UnknownConnectionError,I as ReservedConnectionNameError,x as MissingDatabaseUrlError,N as DatabaseServiceProvider,L as DatabaseManager,G as DEFAULT_CONNECTION,J as CrossConnectionTransactionError,K as Connection,F as AmbiguousSqlitePathError};
2
+ import{Ea as N}from"../chunk-bstn00nx.js";import"../chunk-eqv7yxk7.js";import"../chunk-3csz8pfk.js";import"../chunk-xv58jnpb.js";import"../chunk-attr793y.js";import{kk as j,lk as k,nk as w,ok as x,pk as z,qk as A,rk as E,sk as F,tk as G,uk as H,vk as I,wk as J,xk as K,yk as L}from"../chunk-73rzf7ys.js";import"../chunk-baj76zja.js";export{A as isSqlite,E as isMysqlFamily,z as inferDialect,j as defineDatabaseConfig,k as databaseConfigDefaults,w as UnknownDatabaseUrlError,H as UnknownConnectionError,I as ReservedConnectionNameError,x as MissingDatabaseUrlError,N as DatabaseServiceProvider,L as DatabaseManager,G as DEFAULT_CONNECTION,J as CrossConnectionTransactionError,K as Connection,F as AmbiguousSqlitePathError};
3
3
 
4
4
  //# debugId=FF3484E5B0CA29E964756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Nk as qS,Ok as JS}from"../chunk-z7tsh9qr.js";import{Uk as $S}from"../chunk-mr3szvr3.js";import{Yk as P}from"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-jzpbwvbt.js";import{render as s}from"jsx-email";import B from"process";import{Buffer as n}from"buffer";import r from"path";import{fileURLToPath as PS}from"url";import{promisify as yS}from"util";import o from"child_process";import wS,{constants as fS}from"fs/promises";import h from"process";import l,{constants as zS}from"fs/promises";import g from"process";import NS from"os";import W from"fs";import RS from"fs";import b from"fs";var F;function HS(){try{return b.statSync("/.dockerenv"),!0}catch{return!1}}function XS(){try{return b.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function L(){if(F===void 0)F=HS()||XS();return F}var O,US=()=>{try{return RS.statSync("/run/.containerenv"),!0}catch{return!1}};function R(){if(O===void 0)O=US()||L();return O}var u=()=>{if(g.platform!=="linux")return!1;if(NS.release().toLowerCase().includes("microsoft")){if(R())return!1;return!0}try{if(W.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!R()}catch{}if(W.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||W.existsSync("/run/WSL"))return!R();return!1},H=g.env.__IS_WSL_TEST__?u:u();var ES=(()=>{let S;return async function(){if(S)return S;let q="/etc/wsl.conf",J=!1;try{await l.access(q,zS.F_OK),J=!0}catch{}if(!J)return"/mnt/";let K=await l.readFile(q,{encoding:"utf8"}),Q=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(K);if(!Q)return"/mnt/";return S=Q.groups.mountPoint.trim(),S=S.endsWith("/")?S:`${S}/`,S}})(),MS=async()=>{return`${await ES()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},v=async()=>{if(H)return MS();return`${h.env.SYSTEMROOT||h.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`};function X($,S,q){let J=(K)=>Object.defineProperty($,S,{value:K,enumerable:!0,writable:!0});return Object.defineProperty($,S,{configurable:!0,enumerable:!0,get(){let K=q();return J(K),K},set(K){J(K)}}),$}import{promisify as jS}from"util";import j from"process";import{execFile as xS}from"child_process";import{promisify as _S}from"util";import kS from"process";import{execFile as DS}from"child_process";var FS=_S(DS);async function T(){if(kS.platform!=="darwin")throw Error("macOS only");let{stdout:$}=await FS("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),q=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec($)?.groups.id??"com.apple.Safari";if(q==="com.apple.safari")return"com.apple.Safari";return q}import LS from"process";import{promisify as OS}from"util";import{execFile as WS,execFileSync as H0}from"child_process";var vS=OS(WS);async function m($,{humanReadableOutput:S=!0,signal:q}={}){if(LS.platform!=="darwin")throw Error("macOS only");let J=S?[]:["-ss"],K={};if(q)K.signal=q;let{stdout:Q}=await vS("osascript",["-e",$,J],K);return Q.trim()}async function C($){return m(`tell application "Finder" to set app_path to application file id "${$}" as string
2
+ import{Nk as qS,Ok as JS}from"../chunk-m5f6ksqe.js";import{Uk as $S}from"../chunk-mr3szvr3.js";import{Yk as P}from"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-baj76zja.js";import{render as s}from"jsx-email";import B from"process";import{Buffer as n}from"buffer";import r from"path";import{fileURLToPath as PS}from"url";import{promisify as yS}from"util";import o from"child_process";import wS,{constants as fS}from"fs/promises";import h from"process";import l,{constants as zS}from"fs/promises";import g from"process";import NS from"os";import W from"fs";import RS from"fs";import b from"fs";var F;function HS(){try{return b.statSync("/.dockerenv"),!0}catch{return!1}}function XS(){try{return b.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function L(){if(F===void 0)F=HS()||XS();return F}var O,US=()=>{try{return RS.statSync("/run/.containerenv"),!0}catch{return!1}};function R(){if(O===void 0)O=US()||L();return O}var u=()=>{if(g.platform!=="linux")return!1;if(NS.release().toLowerCase().includes("microsoft")){if(R())return!1;return!0}try{if(W.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!R()}catch{}if(W.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||W.existsSync("/run/WSL"))return!R();return!1},H=g.env.__IS_WSL_TEST__?u:u();var ES=(()=>{let S;return async function(){if(S)return S;let q="/etc/wsl.conf",J=!1;try{await l.access(q,zS.F_OK),J=!0}catch{}if(!J)return"/mnt/";let K=await l.readFile(q,{encoding:"utf8"}),Q=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(K);if(!Q)return"/mnt/";return S=Q.groups.mountPoint.trim(),S=S.endsWith("/")?S:`${S}/`,S}})(),MS=async()=>{return`${await ES()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},v=async()=>{if(H)return MS();return`${h.env.SYSTEMROOT||h.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`};function X($,S,q){let J=(K)=>Object.defineProperty($,S,{value:K,enumerable:!0,writable:!0});return Object.defineProperty($,S,{configurable:!0,enumerable:!0,get(){let K=q();return J(K),K},set(K){J(K)}}),$}import{promisify as jS}from"util";import j from"process";import{execFile as xS}from"child_process";import{promisify as _S}from"util";import kS from"process";import{execFile as DS}from"child_process";var FS=_S(DS);async function T(){if(kS.platform!=="darwin")throw Error("macOS only");let{stdout:$}=await FS("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),q=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec($)?.groups.id??"com.apple.Safari";if(q==="com.apple.safari")return"com.apple.Safari";return q}import LS from"process";import{promisify as OS}from"util";import{execFile as WS,execFileSync as H0}from"child_process";var vS=OS(WS);async function m($,{humanReadableOutput:S=!0,signal:q}={}){if(LS.platform!=="darwin")throw Error("macOS only");let J=S?[]:["-ss"],K={};if(q)K.signal=q;let{stdout:Q}=await vS("osascript",["-e",$,J],K);return Q.trim()}async function C($){return m(`tell application "Finder" to set app_path to application file id "${$}" as string
3
3
  tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as TS}from"util";import{execFile as CS}from"child_process";var IS=TS(CS),_={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},E0=new Map(Object.entries(_));class c extends Error{}async function I($=IS){let{stdout:S}=await $("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),q=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(S);if(!q)throw new c(`Cannot find Windows browser in stdout: ${JSON.stringify(S)}`);let{id:J}=q.groups,K=J.lastIndexOf("."),Q=J.lastIndexOf("-"),Z=K===-1?void 0:J.slice(0,K),V=Q===-1?void 0:J.slice(0,Q);return _[J]??_[Z]??_[V]??{name:J,id:J}}var BS=jS(xS),AS=($)=>$.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(S)=>S.toUpperCase());async function x(){if(j.platform==="darwin"){let $=await T();return{name:await C($),id:$}}if(j.platform==="linux"){let{stdout:$}=await BS("xdg-mime",["query","default","x-scheme-handler/http"]),S=$.trim();return{name:AS(S.replace(/.desktop$/,"").replace("-"," ")),id:S}}if(j.platform==="win32")return I();throw Error("Only macOS, Linux, and Windows are supported")}var bS=yS(o.execFile),A=r.dirname(PS(import.meta.url)),d=r.join(A,"xdg-open"),{platform:N,arch:p}=B;async function uS(){let $=await v(),S=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,q=n.from(S,"utf16le").toString("base64"),{stdout:J}=await bS($,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",q],{encoding:"utf8"}),K=J.trim(),Q={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return Q[K]?{id:Q[K]}:{}}var t=async($,S)=>{let q;for(let J of $)try{return await S(J)}catch(K){q=K}throw q},k=async($)=>{if($={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...$},Array.isArray($.app))return t($.app,(V)=>k({...$,app:V}));let{name:S,arguments:q=[]}=$.app??{};if(q=[...q],Array.isArray(S))return t(S,(V)=>k({...$,app:{name:V,arguments:q}}));if(S==="browser"||S==="browserPrivate"){let V={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},Y={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},G=H?await uS():await x();if(G.id in V){let z=V[G.id];if(S==="browserPrivate")q.push(Y[z]);return k({...$,app:{name:U[z],arguments:q}})}throw Error(`${G.name} is not supported as a default browser`)}let J,K=[],Q={};if(N==="darwin"){if(J="open",$.wait)K.push("--wait-apps");if($.background)K.push("--background");if($.newInstance)K.push("--new");if(S)K.push("-a",S)}else if(N==="win32"||H&&!R()&&!S){if(J=await v(),K.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),!H)Q.windowsVerbatimArguments=!0;let V=["Start"];if($.wait)V.push("-Wait");if(S){if(V.push(`"\`"${S}\`""`),$.target)q.push($.target)}else if($.target)V.push(`"${$.target}"`);if(q.length>0)q=q.map((Y)=>`"\`"${Y}\`""`),V.push("-ArgumentList",q.join(","));$.target=n.from(V.join(" "),"utf16le").toString("base64")}else{if(S)J=S;else{let V=!A||A==="/",Y=!1;try{await wS.access(d,fS.X_OK),Y=!0}catch{}J=B.versions.electron??(N==="android"||V||!Y)?"xdg-open":d}if(q.length>0)K.push(...q);if(!$.wait)Q.stdio="ignore",Q.detached=!0}if(N==="darwin"&&q.length>0)K.push("--args",...q);if($.target)K.push($.target);let Z=o.spawn(J,K,Q);if($.wait)return new Promise((V,Y)=>{Z.once("error",Y),Z.once("close",(G)=>{if(!$.allowNonzeroExitCode&&G>0){Y(Error(`Exited with code ${G}`));return}V(Z)})});return Z.unref(),Z},gS=($,S)=>{if(typeof $!=="string")throw TypeError("Expected a `target`");return k({...S,target:$})};function i($){if(typeof $==="string"||Array.isArray($))return $;let{[p]:S}=$;if(!S)throw Error(`${p} is not supported`);return S}function D({[N]:$},{wsl:S}){if(S&&H)return i(S);if(!$)throw Error(`${N} is not supported`);return i($)}var U={};X(U,"chrome",()=>D({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));X(U,"brave",()=>D({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));X(U,"firefox",()=>D({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));X(U,"edge",()=>D({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));X(U,"browser",()=>"browser");X(U,"browserPrivate",()=>"browserPrivate");var a=gS;function hS($){return Array.from($,(S)=>{let q=S.charCodeAt(0);return S==="/"||S==="\\"||q<32||q===127?"_":S}).join("")}async function e($,S,q={}){let J=`${$}/${new Date().toISOString()}${hS(S.subject)}`,K={to:S.to,cc:S.cc,bcc:S.bcc,from:S.from,subject:S.subject,headers:S.headers??{},attachments:S.attachments.map((Q)=>({filename:Q.filename,bytes:Buffer.byteLength(Q.content)})),scheduledAt:S.scheduledAt??null,idempotencyKey:S.idempotencyKey??null,locale:q.locale??null,text:S.text??null};return await Bun.write(`${J}.json`,`${JSON.stringify(K,null,2)}
4
4
  `),await Bun.write(`${J}.html`,S.html),`${J}.html`}import{jsx as SS}from"react/jsx-runtime";class KS{from="";to=[];subject="No Subject";cc=[];bcc=[];attachments=[];template;headers={};static async send($){let S=new this,q=P($S).defaultLocale,J=P(JS),{to:K=S.to,from:Q=S.from,subject:Z=typeof S.subject==="string"?S.subject:S.subject[$.locale||q],cc:V=S.cc,bcc:Y=S.bcc,attachments:G=S.attachments,data:z,headers:QS={}}=$,VS={...J.headers??{},...S.headers??{},...QS??{}},y=process.env.EMAIL_DEBUG==="true",E=y?"debug":J.driver?.provider??"custom",w=await J.filterRecipients(K);if(!w.length)return{id:null,provider:E,status:"skipped"};let[YS,ZS]=await Promise.all([S.render({...z,locale:$.locale}),S.renderText({...z,locale:$.locale})]),f={bcc:Y,cc:V,from:Q,subject:Z,to:w,attachments:G,html:YS,headers:VS,text:ZS,scheduledAt:$.scheduledAt,idempotencyKey:$.idempotencyKey};if(y){let GS=await e(`${process.env.ROOT_DIR}/.debug/emails`,f,{locale:$.locale});if(process.env.CI!=="true")await a(GS);return{id:`debug_${crypto.randomUUID()}`,provider:E,status:"debug"}}let M=await qS(J,f);return M.ok?{id:M.id,provider:E,status:"sent"}:{id:M.id,provider:E,status:"failed",error:M.error}}static async preview($){return await new this().render({...$.data,locale:$.locale})}async render($){let S=this.template;return await s(SS(S,{...$}))}async renderText($){let S=this.template;return await s(SS(S,{...$}),{plainText:!0})}}export{KS as Email};
5
5
 
@@ -1,5 +1,9 @@
1
- import type { UrlParser, ViewPaths } from "../client/types";
1
+ import type { ApiPaths, UrlParser, ViewPaths } from "../client/types";
2
2
  import { type DomainTarget } from "../utils/domainUrl";
3
+ /** `UrlParser<T>` with every value a string, as a matched URL gives them. */
4
+ type MatchedParams<T extends string> = {
5
+ [K in keyof UrlParser<T>]: string;
6
+ };
3
7
  export declare class Url {
4
8
  /**
5
9
  * The app's public origin, e.g. `https://example.com`: `HOST_NAME`, else
@@ -21,5 +25,29 @@ export declare class Url {
21
25
  * an email — they come from `Url.origin()` (`HOST_NAME`, else `APP_URL`).
22
26
  */
23
27
  static forDomain<T extends ViewPaths>(target: DomainTarget, key: T, ...args: UrlParser<T> extends Record<string, never> ? [] : [params: UrlParser<T>]): import("../utils/domainUrl").AbsoluteUrl;
28
+ /**
29
+ * The URL of an api route, from its path in the app's `ApiRouter`, under
30
+ * `/api`: `Url.api("/pages/:pageId/files/:fileId", { pageId, fileId })` is
31
+ * `/api/pages/p1/files/f1`. The path is typed from the app's routes and the
32
+ * params from the path, so renaming a route is a type error here.
33
+ *
34
+ * Each param is `encodeURIComponent`-ed. A required param left out throws.
35
+ */
36
+ static api<T extends ApiPaths>(key: T, ...args: UrlParser<T> extends Record<string, never> ? [] : [params: UrlParser<T>]): string;
37
+ /**
38
+ * `Url.api` on the app's public origin (`Url.origin()`):
39
+ * `https://example.com/api/designer-files/f1`. Throws when neither
40
+ * `HOST_NAME` nor `APP_URL` is set.
41
+ */
42
+ static apiAbsolute<T extends ApiPaths>(key: T, ...args: UrlParser<T> extends Record<string, never> ? [] : [params: UrlParser<T>]): string;
43
+ /**
44
+ * The params of `url` when it is the URL of the api route `key`, decoded,
45
+ * or `null`: `Url.matchApi("/pages/:pageId/files/:fileId",
46
+ * "/api/pages/p1/files/f1")` is `{ pageId: "p1", fileId: "f1" }`. `url` may
47
+ * be a path or absolute (any host); its query and hash are ignored. The
48
+ * inverse of `Url.api`.
49
+ */
50
+ static matchApi<T extends ApiPaths>(key: T, url: string): MatchedParams<T> | null;
24
51
  }
52
+ export {};
25
53
  //# sourceMappingURL=Url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Url.d.ts","sourceRoot":"","sources":["../../facades/Url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAM5D,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElE,qBAAa,GAAG;IACd;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM;IAIxC,MAAM,CAAC,QAAQ,CAAC,CAAC,S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AAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI;CAGlF"}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{$e as j,Dg as v,Kf as q,Te as a,Vf as r,We as c,Wf as s,Xe as e,Xf as t,Ye as f,Yf as u,Ze as h,_e as i,gf as k,hf as l,if as m,jf as n,kf as o,uf as p}from"../chunk-r52harpp.js";import"../chunk-hh5bs656.js";import"../chunk-3csz8pfk.js";import{Bi as g,ai as b,zi as d}from"../chunk-1z619xe0.js";import"../chunk-cee5gq7t.js";import"../chunk-a8n9ec43.js";import"../chunk-563ksar3.js";import"../chunk-n9n4qt20.js";import"../chunk-xv58jnpb.js";import"../chunk-313593t3.js";import"../chunk-86zhngpg.js";import"../chunk-attr793y.js";import"../chunk-2ery6a75.js";import"../chunk-73rzf7ys.js";import"../chunk-2x6cv37t.js";import"../chunk-mr3szvr3.js";import"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-g8sh9btf.js";import"../chunk-mzkzgp2j.js";import"../chunk-apga49vp.js";import"../chunk-fqqbnp0z.js";import"../chunk-jzpbwvbt.js";export{f as Url,d as Storage,r as Runs,j as Redis,a as Redirect,l as RateLimiter,e as Query,h as Meta,g as Log,m as Lock,c as Lang,s as Features,b as Facade,u as DB,n as Crypt,i as Cookie,o as Connections,t as ConnectionQueries,p as ChangeFeed,k as Cache,q as Broadcast,v as Auth};
2
+ import{$e as j,Dg as v,Kf as q,Te as a,Vf as r,We as c,Wf as s,Xe as e,Xf as t,Ye as f,Yf as u,Ze as h,_e as i,gf as k,hf as l,if as m,jf as n,kf as o,uf as p}from"../chunk-fe9fvtvt.js";import"../chunk-hh5bs656.js";import"../chunk-3csz8pfk.js";import{Bi as g,ai as b,zi as d}from"../chunk-2r2j2nvq.js";import"../chunk-cee5gq7t.js";import"../chunk-a8n9ec43.js";import"../chunk-w6jff43c.js";import"../chunk-sbzqxtqg.js";import"../chunk-xv58jnpb.js";import"../chunk-313593t3.js";import"../chunk-86zhngpg.js";import"../chunk-attr793y.js";import"../chunk-2ery6a75.js";import"../chunk-73rzf7ys.js";import"../chunk-2x6cv37t.js";import"../chunk-mr3szvr3.js";import"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-g8sh9btf.js";import"../chunk-mzkzgp2j.js";import"../chunk-apga49vp.js";import"../chunk-6tkkvaqg.js";import"../chunk-baj76zja.js";export{f as Url,d as Storage,r as Runs,j as Redis,a as Redirect,l as RateLimiter,e as Query,h as Meta,g as Log,m as Lock,c as Lang,s as Features,b as Facade,u as DB,n as Crypt,i as Cookie,o as Connections,t as ConnectionQueries,p as ChangeFeed,k as Cache,q as Broadcast,v as Auth};
3
3
 
4
4
  //# debugId=CD0A8E02F664C90A64756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Xk as o,Yk as r}from"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-jzpbwvbt.js";export{r as app,o as Application};
2
+ import{Xk as o,Yk as r}from"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-baj76zja.js";export{r as app,o as Application};
3
3
 
4
4
  //# debugId=DCF97866EB76436D64756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Eg as $,Fg as aa,Gg as ba,Jg as ca,Kg as da,Lg as ea,Mg as fa,Ng as ga,Og as ha,Pg as ia,Qg as ja,Re as I,Rg as ka,Se as J,Sg as la,Tg as ma,Ue as K,Ug as na,Ve as L,Vg as oa,Wg as pa,Xg as qa,Yg as ra,Zg as sa,_g as ta,ae as q,be as r,ce as s,de as t,ee as u,eg as _,fe as v,ge as w,he as D,me as E,pe as F,qe as G,re as H}from"../chunk-r52harpp.js";import"../chunk-hh5bs656.js";import"../chunk-3csz8pfk.js";import{$h as C,Ah as d,Fh as e,Gh as f,Hh as g,Ih as h,Jh as i,Kh as j,Ph as n,Qh as o,Vh as p,Wh as x,Xh as y,Yh as z,Zh as A,_h as B,ji as M,ki as N,li as O,mi as P,ni as Q,oi as R,pi as S,qi as T,ri as U,si as V,ti as W,ui as X,vi as Y,wi as Z,yh as a,zh as b}from"../chunk-1z619xe0.js";import{Ji as c}from"../chunk-cee5gq7t.js";import{Oi as k,Pi as l,Qi as m}from"../chunk-a8n9ec43.js";import"../chunk-563ksar3.js";import"../chunk-n9n4qt20.js";import"../chunk-xv58jnpb.js";import"../chunk-313593t3.js";import"../chunk-86zhngpg.js";import"../chunk-attr793y.js";import"../chunk-2ery6a75.js";import"../chunk-73rzf7ys.js";import"../chunk-2x6cv37t.js";import"../chunk-mr3szvr3.js";import"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-g8sh9btf.js";import"../chunk-mzkzgp2j.js";import"../chunk-apga49vp.js";import"../chunk-fqqbnp0z.js";import"../chunk-jzpbwvbt.js";export{g as toRangeHeaderValue,s as toMiddlewareList,k as stateKey,Z as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,w as parseByteSize,ha as middlewareConfigDefaults,r as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,pa as defineResourcePolicy,ga as defineMiddlewareConfig,t as createUnsatisfiableResponse,u as createStreamResponse,K as createFileResponse,H as clientIp,X as classifyAddress,ba as authorizeChannel,L as ViewRouter,n as ValidationError,U as TooManyRedirectsError,S as TooLargeError,R as TimeoutError,qa as SitemapError,ra as Sitemap,J as SameSiteBounceMiddleware,Y as SafeResponse,M as SafeFetchError,I as SAME_SITE_BOUNCE_PARAM,sa as RobotsTxt,ta as Robots,oa as ResourcePolicy,b as ResourceController,m as RequestState,c as RequestBreakerError,G as RateLimitMiddleware,E as RateLimitExceededError,z as RangeNotSatisfiableError,ma as PoliciesServiceProvider,na as Policies,v as PayloadTooLargeError,A as NotFoundError,V as NetworkError,l as MissingRequestStateError,F as Middleware,ea as McpToolDeclaration,fa as McpRouter,da as McpRouteDeclaration,ca as McpModelParam,o as InvalidValidationRuleError,N as InvalidUrlError,y as InsufficientPermissionsError,W as HttpStatusError,q as HttpResponse,p as HttpRequest,B as FileNotFoundError,Q as DnsError,ka as CorsMiddleware,a as Controller,T as ContentTypeError,aa as ChannelRouter,$ as ChannelDeclaration,ja as CacheMiddleware,la as CSRFMiddleware,_ as BodyLimitMiddleware,O as BlockedHostError,P as BlockedAddressError,x as AuthorizationError,ia as AuthenticationMiddleware,C as AuthenticationError,D as ApiRouter};
2
+ import{Eg as $,Fg as aa,Gg as ba,Jg as ca,Kg as da,Lg as ea,Mg as fa,Ng as ga,Og as ha,Pg as ia,Qg as ja,Re as I,Rg as ka,Se as J,Sg as la,Tg as ma,Ue as K,Ug as na,Ve as L,Vg as oa,Wg as pa,Xg as qa,Yg as ra,Zg as sa,_g as ta,ae as q,be as r,ce as s,de as t,ee as u,eg as _,fe as v,ge as w,he as D,me as E,pe as F,qe as G,re as H}from"../chunk-fe9fvtvt.js";import"../chunk-hh5bs656.js";import"../chunk-3csz8pfk.js";import{$h as C,Ah as d,Fh as e,Gh as f,Hh as g,Ih as h,Jh as i,Kh as j,Ph as n,Qh as o,Vh as p,Wh as x,Xh as y,Yh as z,Zh as A,_h as B,ji as M,ki as N,li as O,mi as P,ni as Q,oi as R,pi as S,qi as T,ri as U,si as V,ti as W,ui as X,vi as Y,wi as Z,yh as a,zh as b}from"../chunk-2r2j2nvq.js";import{Ji as c}from"../chunk-cee5gq7t.js";import{Oi as k,Pi as l,Qi as m}from"../chunk-a8n9ec43.js";import"../chunk-w6jff43c.js";import"../chunk-sbzqxtqg.js";import"../chunk-xv58jnpb.js";import"../chunk-313593t3.js";import"../chunk-86zhngpg.js";import"../chunk-attr793y.js";import"../chunk-2ery6a75.js";import"../chunk-73rzf7ys.js";import"../chunk-2x6cv37t.js";import"../chunk-mr3szvr3.js";import"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-g8sh9btf.js";import"../chunk-mzkzgp2j.js";import"../chunk-apga49vp.js";import"../chunk-6tkkvaqg.js";import"../chunk-baj76zja.js";export{g as toRangeHeaderValue,s as toMiddlewareList,k as stateKey,Z as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,w as parseByteSize,ha as middlewareConfigDefaults,r as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,pa as defineResourcePolicy,ga as defineMiddlewareConfig,t as createUnsatisfiableResponse,u as createStreamResponse,K as createFileResponse,H as clientIp,X as classifyAddress,ba as authorizeChannel,L as ViewRouter,n as ValidationError,U as TooManyRedirectsError,S as TooLargeError,R as TimeoutError,qa as SitemapError,ra as Sitemap,J as SameSiteBounceMiddleware,Y as SafeResponse,M as SafeFetchError,I as SAME_SITE_BOUNCE_PARAM,sa as RobotsTxt,ta as Robots,oa as ResourcePolicy,b as ResourceController,m as RequestState,c as RequestBreakerError,G as RateLimitMiddleware,E as RateLimitExceededError,z as RangeNotSatisfiableError,ma as PoliciesServiceProvider,na as Policies,v as PayloadTooLargeError,A as NotFoundError,V as NetworkError,l as MissingRequestStateError,F as Middleware,ea as McpToolDeclaration,fa as McpRouter,da as McpRouteDeclaration,ca as McpModelParam,o as InvalidValidationRuleError,N as InvalidUrlError,y as InsufficientPermissionsError,W as HttpStatusError,q as HttpResponse,p as HttpRequest,B as FileNotFoundError,Q as DnsError,ka as CorsMiddleware,a as Controller,T as ContentTypeError,aa as ChannelRouter,$ as ChannelDeclaration,ja as CacheMiddleware,la as CSRFMiddleware,_ as BodyLimitMiddleware,O as BlockedHostError,P as BlockedAddressError,x as AuthorizationError,ia as AuthenticationMiddleware,C as AuthenticationError,D as ApiRouter};
3
3
 
4
4
  //# debugId=7CF986F83292315D64756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{ca as y,da as p}from"../chunk-4d4td4k9.js";import{ua as c,va as d,xa as l}from"../chunk-epvpmakp.js";import{Ak as e,Bk as i,Dk as t,Ek as r,Fk as o,Gk as n,Hk as a,Ik as s}from"../chunk-2x6cv37t.js";import"../chunk-jzpbwvbt.js";export{o as setActiveLocale,r as seedDictionaries,t as preloadDictionaries,d as localeStrings,i as loadDictionary,n as getActiveLocale,e as dictionaryRegistrationMark,c as dictionaryLocales,l as dictionaryId,y as defineDictionary,s as createDictionarySink,a as __resetDictionaryRegistry,p as __gemi_dict__};
2
+ import{ca as y,da as p}from"../chunk-4d4td4k9.js";import{ua as c,va as d,xa as l}from"../chunk-epvpmakp.js";import{Ak as e,Bk as i,Dk as t,Ek as r,Fk as o,Gk as n,Hk as a,Ik as s}from"../chunk-2x6cv37t.js";import"../chunk-baj76zja.js";export{o as setActiveLocale,r as seedDictionaries,t as preloadDictionaries,d as localeStrings,i as loadDictionary,n as getActiveLocale,e as dictionaryRegistrationMark,c as dictionaryLocales,l as dictionaryId,y as defineDictionary,s as createDictionarySink,a as __resetDictionaryRegistry,p as __gemi_dict__};
3
3
 
4
4
  //# debugId=A2BB4E55D83C935964756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{ca as T}from"../chunk-4d4td4k9.js";import"../chunk-epvpmakp.js";import{ab as D}from"../chunk-49s8wwp2.js";import{Zd as b,_d as w}from"../chunk-ydkv9e8w.js";import"../chunk-eqv7yxk7.js";import{We as j}from"../chunk-r52harpp.js";import"../chunk-hh5bs656.js";import"../chunk-3csz8pfk.js";import"../chunk-1z619xe0.js";import"../chunk-cee5gq7t.js";import"../chunk-a8n9ec43.js";import"../chunk-563ksar3.js";import"../chunk-n9n4qt20.js";import"../chunk-xv58jnpb.js";import"../chunk-313593t3.js";import"../chunk-86zhngpg.js";import"../chunk-attr793y.js";import"../chunk-2ery6a75.js";import"../chunk-73rzf7ys.js";import"../chunk-2x6cv37t.js";import{Pk as V,Qk as X,Rk as E,Sk as L,Tk as R,Uk as S}from"../chunk-mr3szvr3.js";import"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-g8sh9btf.js";import"../chunk-mzkzgp2j.js";import"../chunk-apga49vp.js";import"../chunk-fqqbnp0z.js";import"../chunk-jzpbwvbt.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{w as translationConfigDefaults,N as translate,V as resolveLocale,X as negotiateLocale,L as isValidTimeZone,b as defineTranslationConfig,T as defineDictionary,R as createFormatter,S as Translator,D as TranslationServiceProvider,P as Dictionary,E as DEFAULT_TIME_ZONE};
2
+ import{ca as T}from"../chunk-4d4td4k9.js";import"../chunk-epvpmakp.js";import{ab as D}from"../chunk-49s8wwp2.js";import{Zd as b,_d as w}from"../chunk-ydkv9e8w.js";import"../chunk-eqv7yxk7.js";import{We as j}from"../chunk-fe9fvtvt.js";import"../chunk-hh5bs656.js";import"../chunk-3csz8pfk.js";import"../chunk-2r2j2nvq.js";import"../chunk-cee5gq7t.js";import"../chunk-a8n9ec43.js";import"../chunk-w6jff43c.js";import"../chunk-sbzqxtqg.js";import"../chunk-xv58jnpb.js";import"../chunk-313593t3.js";import"../chunk-86zhngpg.js";import"../chunk-attr793y.js";import"../chunk-2ery6a75.js";import"../chunk-73rzf7ys.js";import"../chunk-2x6cv37t.js";import{Pk as V,Qk as X,Rk as E,Sk as L,Tk as R,Uk as S}from"../chunk-mr3szvr3.js";import"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-g8sh9btf.js";import"../chunk-mzkzgp2j.js";import"../chunk-apga49vp.js";import"../chunk-6tkkvaqg.js";import"../chunk-baj76zja.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{w as translationConfigDefaults,N as translate,V as resolveLocale,X as negotiateLocale,L as isValidTimeZone,b as defineTranslationConfig,T as defineDictionary,R as createFormatter,S as Translator,D as TranslationServiceProvider,P as Dictionary,E as DEFAULT_TIME_ZONE};
3
3
 
4
4
  //# debugId=6C726BA87AA78FDC64756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ea as E}from"../chunk-bstn00nx.js";import{$a as p}from"../chunk-fka28ceg.js";import{ab as H}from"../chunk-49s8wwp2.js";import{Bb as L,Cb as Q,Db as T,Hb as U,Ib as y,Jb as F,Kb as C,Nb as D,Ob as I,Rb as b,Ub as f,Vb as k,Wb as m,nb as g,ob as W,pb as _,qb as l,rb as P,sb as u,tb as $,ub as V,vb as q,wb as B,xb as K}from"../chunk-6vg2jvdp.js";import"../chunk-nhdx7cpz.js";import"../chunk-2b3hh9xw.js";import"../chunk-v9z4x5j2.js";import{Td as h}from"../chunk-877yc341.js";import"../chunk-ydkv9e8w.js";import"../chunk-eqv7yxk7.js";import{Bg as R,Pe as n,Qe as v,tg as w,we as a,xe as d,xg as A}from"../chunk-r52harpp.js";import"../chunk-hh5bs656.js";import"../chunk-3csz8pfk.js";import"../chunk-1z619xe0.js";import"../chunk-cee5gq7t.js";import"../chunk-a8n9ec43.js";import"../chunk-563ksar3.js";import{cj as M}from"../chunk-n9n4qt20.js";import"../chunk-xv58jnpb.js";import"../chunk-313593t3.js";import"../chunk-86zhngpg.js";import"../chunk-attr793y.js";import"../chunk-2ery6a75.js";import"../chunk-73rzf7ys.js";import"../chunk-2x6cv37t.js";import"../chunk-z7tsh9qr.js";import"../chunk-mr3szvr3.js";import{Vk as O,Xk as z}from"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-g8sh9btf.js";import"../chunk-mzkzgp2j.js";import"../chunk-apga49vp.js";import"../chunk-fqqbnp0z.js";import"../chunk-jzpbwvbt.js";var N=[C,I,E,T,L,k,B,Q,D,y,_,U,f,V,F,H,b,K,q,m,$];class S{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new z;boot(){if(this.models.length>0)p(...this.models);else s();this.app.config.merge(this.config),z.setInstance(this.app),this.app.registerMany([...N,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let G of this.services){let J=typeof G==="function"?new G:G,x=J.constructor;if(!x.token)throw Error(`Service [${x.name}] is listed in \`services\` but does not declare a \`static token\`.`);let Y=X.get(x.token);if(Y)throw Error(`Services [${Y}] and [${x.name}] both declare the token "${x.token}". Tokens are the container's keys, so they must be unique.`);X.set(x.token,x.name);let Z=x;if(!j.has(x.token)&&this.app.bound(Z))throw Error(`Service [${x.name}] declares the token "${x.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(Z,J),this.serviceInstances.push(J),this.serviceTokens.add(x.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),l(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return O.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(A)}viewRoutes(){return this.app.make(w)}domains(){return this.app.make(R)}queue(){return this.app.make(h)}mcpHttp(){return this.app.config.get("route.mcp.remote.enabled")===!0?this.app.make(g):null}sockets(){return this.app.config.get("route.channels")?this.app.make(u):null}globalMiddleware(j){return P(j)}destroy(){if(this.app.resolved(W))this.app.make(W).stop();if(this.app.flush(),z.getInstance()===this.app)z.setInstance(void 0);O.disable()}}function s(){if(Bun.env.NODE_ENV==="production")return;let j=M();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
2
+ import{Ea as E}from"../chunk-bstn00nx.js";import{$a as p}from"../chunk-1a11x8ww.js";import{ab as H}from"../chunk-49s8wwp2.js";import{Bb as L,Cb as Q,Db as T,Hb as U,Ib as y,Jb as F,Kb as C,Nb as D,Ob as I,Rb as b,Ub as f,Vb as k,Wb as m,nb as g,ob as W,pb as _,qb as l,rb as P,sb as u,tb as $,ub as V,vb as q,wb as B,xb as K}from"../chunk-ae5ycktd.js";import"../chunk-1q5eagpm.js";import"../chunk-2b3hh9xw.js";import"../chunk-v9z4x5j2.js";import{Td as h}from"../chunk-877yc341.js";import"../chunk-ydkv9e8w.js";import"../chunk-eqv7yxk7.js";import{Bg as R,Pe as n,Qe as v,tg as w,we as a,xe as d,xg as A}from"../chunk-fe9fvtvt.js";import"../chunk-hh5bs656.js";import"../chunk-3csz8pfk.js";import"../chunk-2r2j2nvq.js";import"../chunk-cee5gq7t.js";import"../chunk-a8n9ec43.js";import"../chunk-w6jff43c.js";import{cj as M}from"../chunk-sbzqxtqg.js";import"../chunk-xv58jnpb.js";import"../chunk-313593t3.js";import"../chunk-86zhngpg.js";import"../chunk-attr793y.js";import"../chunk-2ery6a75.js";import"../chunk-73rzf7ys.js";import"../chunk-2x6cv37t.js";import"../chunk-m5f6ksqe.js";import"../chunk-mr3szvr3.js";import{Vk as O,Xk as z}from"../chunk-1fyn63ka.js";import"../chunk-e9z8p2fy.js";import"../chunk-g8sh9btf.js";import"../chunk-mzkzgp2j.js";import"../chunk-apga49vp.js";import"../chunk-6tkkvaqg.js";import"../chunk-baj76zja.js";var N=[C,I,E,T,L,k,B,Q,D,y,_,U,f,V,F,H,b,K,q,m,$];class S{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new z;boot(){if(this.models.length>0)p(...this.models);else s();this.app.config.merge(this.config),z.setInstance(this.app),this.app.registerMany([...N,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let G of this.services){let J=typeof G==="function"?new G:G,x=J.constructor;if(!x.token)throw Error(`Service [${x.name}] is listed in \`services\` but does not declare a \`static token\`.`);let Y=X.get(x.token);if(Y)throw Error(`Services [${Y}] and [${x.name}] both declare the token "${x.token}". Tokens are the container's keys, so they must be unique.`);X.set(x.token,x.name);let Z=x;if(!j.has(x.token)&&this.app.bound(Z))throw Error(`Service [${x.name}] declares the token "${x.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(Z,J),this.serviceInstances.push(J),this.serviceTokens.add(x.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),l(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return O.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(A)}viewRoutes(){return this.app.make(w)}domains(){return this.app.make(R)}queue(){return this.app.make(h)}mcpHttp(){return this.app.config.get("route.mcp.remote.enabled")===!0?this.app.make(g):null}sockets(){return this.app.config.get("route.channels")?this.app.make(u):null}globalMiddleware(j){return P(j)}destroy(){if(this.app.resolved(W))this.app.make(W).stop();if(this.app.flush(),z.getInstance()===this.app)z.setInstance(void 0);O.disable()}}function s(){if(Bun.env.NODE_ENV==="production")return;let j=M();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
3
3
  Nested relation reads resolve a model by name, so a policy on a subclass that does not own its
4
4
  `+" name is skipped inside every include \u2014 scoped at the root, "+`unscoped in an include, with nothing
5
5
  to notice it. Declaring the modules registers each class under its own name and audits the set: