gemi 0.86.1 → 0.87.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 (182) hide show
  1. package/dist/ai/Agent.d.ts +44 -2
  2. package/dist/ai/Agent.d.ts.map +1 -1
  3. package/dist/ai/AgentController.d.ts +5 -0
  4. package/dist/ai/AgentController.d.ts.map +1 -1
  5. package/dist/ai/Schema.d.ts +102 -0
  6. package/dist/ai/Schema.d.ts.map +1 -1
  7. package/dist/ai/index.d.ts +3 -3
  8. package/dist/ai/index.d.ts.map +1 -1
  9. package/dist/ai/index.js +12 -12
  10. package/dist/ai/index.js.map +5 -5
  11. package/dist/ai/signing.d.ts +34 -1
  12. package/dist/ai/signing.d.ts.map +1 -1
  13. package/dist/app/index.js +1 -1
  14. package/dist/bun/plugin.js +1 -1
  15. package/dist/bun/preload.js +1 -1
  16. package/dist/{chunk-9tv5j3b2.js → chunk-04ebkq8a.js} +3 -3
  17. package/dist/{chunk-9tv5j3b2.js.map → chunk-04ebkq8a.js.map} +1 -1
  18. package/dist/{chunk-6nnq3rjj.js → chunk-08qvtx8v.js} +2 -2
  19. package/dist/{chunk-6nnq3rjj.js.map → chunk-08qvtx8v.js.map} +1 -1
  20. package/dist/{chunk-fc2je244.js → chunk-0ms02b96.js} +3 -3
  21. package/dist/{chunk-fc2je244.js.map → chunk-0ms02b96.js.map} +1 -1
  22. package/dist/{chunk-55x9kkdt.js → chunk-0w95nc15.js} +2 -2
  23. package/dist/{chunk-55x9kkdt.js.map → chunk-0w95nc15.js.map} +1 -1
  24. package/dist/{chunk-k5j65f2c.js → chunk-165mrqab.js} +2 -2
  25. package/dist/{chunk-k5j65f2c.js.map → chunk-165mrqab.js.map} +1 -1
  26. package/dist/{chunk-xckeyg3v.js → chunk-27k2zsq8.js} +2 -2
  27. package/dist/{chunk-xckeyg3v.js.map → chunk-27k2zsq8.js.map} +1 -1
  28. package/dist/{chunk-saqfc6vp.js → chunk-2zsfntsf.js} +3 -3
  29. package/dist/{chunk-saqfc6vp.js.map → chunk-2zsfntsf.js.map} +1 -1
  30. package/dist/{chunk-9tsw1bmt.js → chunk-3bjj31n9.js} +2 -2
  31. package/dist/{chunk-9tsw1bmt.js.map → chunk-3bjj31n9.js.map} +1 -1
  32. package/dist/{chunk-swhyp0yw.js → chunk-3epp751c.js} +2 -2
  33. package/dist/{chunk-swhyp0yw.js.map → chunk-3epp751c.js.map} +1 -1
  34. package/dist/{chunk-7c33ngqs.js → chunk-3k2ykvez.js} +2 -2
  35. package/dist/{chunk-7c33ngqs.js.map → chunk-3k2ykvez.js.map} +1 -1
  36. package/dist/{chunk-4ysar3ev.js → chunk-41mz2fs2.js} +2 -2
  37. package/dist/{chunk-4ysar3ev.js.map → chunk-41mz2fs2.js.map} +1 -1
  38. package/dist/{chunk-fbwe0agk.js → chunk-4f48z676.js} +2 -2
  39. package/dist/{chunk-fbwe0agk.js.map → chunk-4f48z676.js.map} +1 -1
  40. package/dist/{chunk-ndat0nf0.js → chunk-4mynkrv4.js} +2 -2
  41. package/dist/{chunk-ndat0nf0.js.map → chunk-4mynkrv4.js.map} +1 -1
  42. package/dist/{chunk-v8nf45gt.js → chunk-70ha7xye.js} +2 -2
  43. package/dist/{chunk-v8nf45gt.js.map → chunk-70ha7xye.js.map} +1 -1
  44. package/dist/{chunk-pmmrhak1.js → chunk-71vjxehx.js} +3 -3
  45. package/dist/{chunk-pmmrhak1.js.map → chunk-71vjxehx.js.map} +1 -1
  46. package/dist/{chunk-81k26w39.js → chunk-76ar9z69.js} +2 -2
  47. package/dist/{chunk-81k26w39.js.map → chunk-76ar9z69.js.map} +1 -1
  48. package/dist/{chunk-4zj05vry.js → chunk-7bynhyt1.js} +2 -2
  49. package/dist/{chunk-4zj05vry.js.map → chunk-7bynhyt1.js.map} +1 -1
  50. package/dist/{chunk-cfykfnqx.js → chunk-7g90me53.js} +2 -2
  51. package/dist/{chunk-cfykfnqx.js.map → chunk-7g90me53.js.map} +1 -1
  52. package/dist/{chunk-wwzg4dmy.js → chunk-97bt619e.js} +3 -3
  53. package/dist/{chunk-wwzg4dmy.js.map → chunk-97bt619e.js.map} +1 -1
  54. package/dist/{chunk-2yw23zhn.js → chunk-9yd5d1ff.js} +4 -4
  55. package/dist/{chunk-2yw23zhn.js.map → chunk-9yd5d1ff.js.map} +1 -1
  56. package/dist/{chunk-mk8m3ffx.js → chunk-9zkgvggh.js} +2 -2
  57. package/dist/{chunk-mk8m3ffx.js.map → chunk-9zkgvggh.js.map} +1 -1
  58. package/dist/{chunk-09sr33ff.js → chunk-bjd9wr4t.js} +2 -2
  59. package/dist/{chunk-09sr33ff.js.map → chunk-bjd9wr4t.js.map} +1 -1
  60. package/dist/{chunk-trdwxm5x.js → chunk-brd6tb1s.js} +3 -3
  61. package/dist/{chunk-trdwxm5x.js.map → chunk-brd6tb1s.js.map} +1 -1
  62. package/dist/{chunk-gx0x772p.js → chunk-c8bjqw07.js} +2 -2
  63. package/dist/{chunk-gx0x772p.js.map → chunk-c8bjqw07.js.map} +1 -1
  64. package/dist/{chunk-sejnmn1q.js → chunk-ebbft1yj.js} +1 -1
  65. package/dist/{chunk-z6cgama8.js → chunk-es6gxzyf.js} +2 -2
  66. package/dist/{chunk-z6cgama8.js.map → chunk-es6gxzyf.js.map} +1 -1
  67. package/dist/{chunk-ha705bcz.js → chunk-f32t2eny.js} +3 -3
  68. package/dist/{chunk-ha705bcz.js.map → chunk-f32t2eny.js.map} +1 -1
  69. package/dist/{chunk-81v4c4b1.js → chunk-f6qhsdsn.js} +2 -2
  70. package/dist/{chunk-81v4c4b1.js.map → chunk-f6qhsdsn.js.map} +1 -1
  71. package/dist/{chunk-v2hvnxsf.js → chunk-fev2yjmb.js} +2 -2
  72. package/dist/{chunk-v2hvnxsf.js.map → chunk-fev2yjmb.js.map} +1 -1
  73. package/dist/{chunk-ct7wxm98.js → chunk-fsad7g9c.js} +2 -2
  74. package/dist/{chunk-ct7wxm98.js.map → chunk-fsad7g9c.js.map} +1 -1
  75. package/dist/{chunk-2gdhcswa.js → chunk-grtmy031.js} +1 -1
  76. package/dist/{chunk-rdnm6rem.js → chunk-gsv1syg3.js} +2 -2
  77. package/dist/{chunk-rdnm6rem.js.map → chunk-gsv1syg3.js.map} +1 -1
  78. package/dist/{chunk-qje4kdff.js → chunk-h5mz3zdr.js} +3 -3
  79. package/dist/{chunk-qje4kdff.js.map → chunk-h5mz3zdr.js.map} +1 -1
  80. package/dist/chunk-hj93em1r.js +7 -0
  81. package/dist/chunk-hj93em1r.js.map +11 -0
  82. package/dist/{chunk-174jkg6d.js → chunk-hp96c8hp.js} +3 -3
  83. package/dist/{chunk-174jkg6d.js.map → chunk-hp96c8hp.js.map} +1 -1
  84. package/dist/{chunk-dwqh79e5.js → chunk-m0kbpywd.js} +2 -2
  85. package/dist/{chunk-dwqh79e5.js.map → chunk-m0kbpywd.js.map} +1 -1
  86. package/dist/{chunk-mszy6cfw.js → chunk-m4fg0k5f.js} +2 -2
  87. package/dist/{chunk-mszy6cfw.js.map → chunk-m4fg0k5f.js.map} +1 -1
  88. package/dist/{chunk-7n5775qx.js → chunk-ma2zdn5s.js} +2 -2
  89. package/dist/{chunk-7n5775qx.js.map → chunk-ma2zdn5s.js.map} +1 -1
  90. package/dist/{chunk-1b5s4w5f.js → chunk-mdpm06cg.js} +2 -2
  91. package/dist/{chunk-1b5s4w5f.js.map → chunk-mdpm06cg.js.map} +1 -1
  92. package/dist/{chunk-v4ngf77f.js → chunk-mjrxyvwr.js} +2 -2
  93. package/dist/{chunk-v4ngf77f.js.map → chunk-mjrxyvwr.js.map} +1 -1
  94. package/dist/{chunk-zf4r4kat.js → chunk-mxmw42c1.js} +2 -2
  95. package/dist/{chunk-zf4r4kat.js.map → chunk-mxmw42c1.js.map} +1 -1
  96. package/dist/{chunk-vwp1g8wh.js → chunk-n9n3sqx5.js} +2 -2
  97. package/dist/{chunk-vwp1g8wh.js.map → chunk-n9n3sqx5.js.map} +1 -1
  98. package/dist/{chunk-7nj2t2gm.js → chunk-ngqgm026.js} +2 -2
  99. package/dist/{chunk-7nj2t2gm.js.map → chunk-ngqgm026.js.map} +1 -1
  100. package/dist/{chunk-hmh79ezn.js → chunk-p4125aj9.js} +2 -2
  101. package/dist/{chunk-hmh79ezn.js.map → chunk-p4125aj9.js.map} +1 -1
  102. package/dist/{chunk-d3jkypc7.js → chunk-q9g7g995.js} +3 -3
  103. package/dist/{chunk-d3jkypc7.js.map → chunk-q9g7g995.js.map} +1 -1
  104. package/dist/{chunk-1jcp8m8h.js → chunk-r8ak7k9b.js} +2 -2
  105. package/dist/{chunk-1jcp8m8h.js.map → chunk-r8ak7k9b.js.map} +1 -1
  106. package/dist/{chunk-m7y8d3k7.js → chunk-rj81ysxm.js} +2 -2
  107. package/dist/{chunk-m7y8d3k7.js.map → chunk-rj81ysxm.js.map} +1 -1
  108. package/dist/{chunk-y7qnx8vm.js → chunk-ryj4wqcp.js} +2 -2
  109. package/dist/{chunk-y7qnx8vm.js.map → chunk-ryj4wqcp.js.map} +1 -1
  110. package/dist/{chunk-gs8x0k68.js → chunk-smtcmc20.js} +2 -2
  111. package/dist/{chunk-gs8x0k68.js.map → chunk-smtcmc20.js.map} +1 -1
  112. package/dist/{chunk-kmsrzbx1.js → chunk-t70a927z.js} +2 -2
  113. package/dist/{chunk-kmsrzbx1.js.map → chunk-t70a927z.js.map} +1 -1
  114. package/dist/{chunk-zs90w6ke.js → chunk-tkhrvd30.js} +2 -2
  115. package/dist/{chunk-zs90w6ke.js.map → chunk-tkhrvd30.js.map} +1 -1
  116. package/dist/{chunk-s046a984.js → chunk-tqzddk5e.js} +2 -2
  117. package/dist/{chunk-s046a984.js.map → chunk-tqzddk5e.js.map} +1 -1
  118. package/dist/{chunk-8gexb1gt.js → chunk-tx51rqct.js} +2 -2
  119. package/dist/{chunk-8gexb1gt.js.map → chunk-tx51rqct.js.map} +1 -1
  120. package/dist/{chunk-1w5a11cd.js → chunk-v36ey99b.js} +2 -2
  121. package/dist/{chunk-1w5a11cd.js.map → chunk-v36ey99b.js.map} +1 -1
  122. package/dist/{chunk-z4k18gnp.js → chunk-vemwqxx2.js} +2 -2
  123. package/dist/{chunk-z4k18gnp.js.map → chunk-vemwqxx2.js.map} +1 -1
  124. package/dist/chunk-vme0xdf4.js +5 -0
  125. package/dist/{chunk-1yzdxv2a.js.map → chunk-vme0xdf4.js.map} +1 -1
  126. package/dist/{chunk-jhe0t7yj.js → chunk-w8cf1kqd.js} +2 -2
  127. package/dist/{chunk-jhe0t7yj.js.map → chunk-w8cf1kqd.js.map} +1 -1
  128. package/dist/{chunk-p0m3qgs5.js → chunk-x02whwn3.js} +2 -2
  129. package/dist/{chunk-p0m3qgs5.js.map → chunk-x02whwn3.js.map} +1 -1
  130. package/dist/{chunk-c3gzpjba.js → chunk-x2ds4xaj.js} +1 -1
  131. package/dist/{chunk-p7r3ecpk.js → chunk-x74r8j5k.js} +2 -2
  132. package/dist/{chunk-p7r3ecpk.js.map → chunk-x74r8j5k.js.map} +1 -1
  133. package/dist/{chunk-1yq1e6sb.js → chunk-xcqw162y.js} +3 -3
  134. package/dist/{chunk-1yq1e6sb.js.map → chunk-xcqw162y.js.map} +1 -1
  135. package/dist/{chunk-dadygfkf.js → chunk-y3trr7xh.js} +2 -2
  136. package/dist/{chunk-dadygfkf.js.map → chunk-y3trr7xh.js.map} +1 -1
  137. package/dist/{chunk-pzwyg474.js → chunk-yd04n99w.js} +2 -2
  138. package/dist/{chunk-pzwyg474.js.map → chunk-yd04n99w.js.map} +1 -1
  139. package/dist/{chunk-sjckrbr2.js → chunk-yr51wvkr.js} +2 -2
  140. package/dist/{chunk-sjckrbr2.js.map → chunk-yr51wvkr.js.map} +1 -1
  141. package/dist/{chunk-tag4fdmj.js → chunk-z61sdvb0.js} +4 -4
  142. package/dist/{chunk-tag4fdmj.js.map → chunk-z61sdvb0.js.map} +1 -1
  143. package/dist/{chunk-cbycz5z3.js → chunk-zgy7jtcq.js} +2 -2
  144. package/dist/{chunk-cbycz5z3.js.map → chunk-zgy7jtcq.js.map} +1 -1
  145. package/dist/config/index.js +1 -1
  146. package/dist/console/run.js +2 -2
  147. package/dist/console/run.js.map +1 -1
  148. package/dist/container/index.js +2 -2
  149. package/dist/container/index.js.map +1 -1
  150. package/dist/database/index.js +2 -2
  151. package/dist/database/index.js.map +1 -1
  152. package/dist/email/index.js +2 -2
  153. package/dist/email/index.js.map +1 -1
  154. package/dist/facades/index.js +2 -2
  155. package/dist/facades/index.js.map +1 -1
  156. package/dist/foundation/index.js +2 -2
  157. package/dist/foundation/index.js.map +1 -1
  158. package/dist/http/index.js +2 -2
  159. package/dist/http/index.js.map +1 -1
  160. package/dist/i18n/dictionaryRuntime.js +2 -2
  161. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  162. package/dist/i18n/index.js +2 -2
  163. package/dist/i18n/index.js.map +1 -1
  164. package/dist/kernel/index.js +2 -2
  165. package/dist/kernel/index.js.map +1 -1
  166. package/dist/orm/index.js +2 -2
  167. package/dist/orm/index.js.map +1 -1
  168. package/dist/server/index.js +2 -2
  169. package/dist/server/index.js.map +1 -1
  170. package/dist/services/index.js +2 -2
  171. package/dist/services/index.js.map +1 -1
  172. package/dist/services/queue/work.js +2 -2
  173. package/dist/services/queue/work.js.map +1 -1
  174. package/dist/support/index.js +2 -2
  175. package/dist/support/index.js.map +1 -1
  176. package/package.json +1 -1
  177. package/dist/chunk-1yzdxv2a.js +0 -5
  178. package/dist/chunk-w312e9nx.js +0 -5
  179. package/dist/chunk-w312e9nx.js.map +0 -11
  180. /package/dist/{chunk-sejnmn1q.js.map → chunk-ebbft1yj.js.map} +0 -0
  181. /package/dist/{chunk-2gdhcswa.js.map → chunk-grtmy031.js.map} +0 -0
  182. /package/dist/{chunk-c3gzpjba.js.map → chunk-x2ds4xaj.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  // @bun
2
2
  function E(z){return z}function f(){return{url:process.env.DATABASE_URL,dialect:void 0,options:void 0,slowTransactionThreshold:b,connections:void 0}}var b=2000;class Q extends Error{constructor(z){super(`Could not infer a database dialect from "${z}". Expected a URL starting with postgres://, postgresql://, mysql://, mariadb://, `+"sqlite://, or file: \u2014 or a SQLite path such as ./dev.db or :memory:.");this.name="UnknownDatabaseUrlError"}}class j extends Error{constructor(z){super(z===void 0||z==="default"?"No database URL configured. Set the DATABASE_URL environment variable, or set `url` in app/config/database.ts.":`The "${z}" database connection has no \`url\`. Set one under \`connections.${z}\` in app/config/database.ts.`);this.name="MissingDatabaseUrlError"}}var L={"postgres:":"postgres","postgresql:":"postgres","mysql:":"mysql","mariadb:":"mariadb","sqlite:":"sqlite","file:":"sqlite"},D=[".db",".sqlite",".sqlite3"];function F(z){let B=z.trim();if(B==="")throw new Q(z);if(B===":memory:")return"sqlite";let G=B.indexOf(":");if(G!==-1){let J=B.slice(0,G+1).toLowerCase(),K=L[J];if(K)return K}if(S(B))return"sqlite";throw new Q(z)}function S(z){if(z.startsWith("./")||z.startsWith("../")||z.startsWith("/"))return!0;let B=z.toLowerCase();return D.some((G)=>B.endsWith(G))}function p(z){return z==="sqlite"}function m(z){return z==="mysql"||z==="mariadb"}import{existsSync as g,readFileSync as y,realpathSync as I,statSync as U}from"fs";import{isAbsolute as w,join as H,resolve as q}from"path";var O=H("prisma","schema.prisma");class R extends Error{constructor(z,B,G){super(`"${z}" now resolves to ${B}, which is where Prisma migrates it. gemi used to open ${G} instead, and that file holds data \u2014 so `+`opening the resolved one would quietly leave it behind. gemi will not choose. Move ${G} onto ${B} if it is the database you want, or point DATABASE_URL at an absolute path to say so explicitly.`);this.name="AmbiguousSqlitePathError"}}function C(z){let B=z.trim(),G="",J=B;for(let K of["file://","file:","sqlite://","sqlite:"])if(B.slice(0,K.length).toLowerCase()===K){G=B.slice(0,K.length),J=B.slice(K.length);break}if(J===":memory:"||J.startsWith(":memory:?"))return null;return{prefix:G,file:J}}function _(z,B,G=process.cwd()){if(B!=="sqlite")return{url:z};let J=C(z);if(!J||J.file==="")return{url:z};if(w(J.file))return{url:z};let K=J.file.indexOf("?"),Z=K===-1?J.file:J.file.slice(0,K),$=K===-1?"":J.file.slice(K),X=H(G,"prisma");if(!T(G,z))return{url:z};let W=q(G,Z),Y=q(X,Z);if(W===Y)return{url:z};return{url:`${J.prefix}${Y}${$}`,moved:{from:W,to:Y}}}function T(z,B){let G=H(z,O);if(!g(G))return!1;let J;try{J=y(G,"utf8")}catch{return!1}let Z=J.replace(/^\s*\/\/.*$/gm,"").match(/datasource\s+\w+\s*\{([\s\S]*?)\}/);if(!Z)return!1;let $=Z[1];if(!/provider\s*=\s*["']sqlite["']/.test($))return!1;let X=$.match(/url\s*=\s*env\(\s*["']([^"']+)["']\s*\)/);if(X){let Y=process.env[X[1]];return typeof Y==="string"&&Y.trim()===B.trim()}let W=$.match(/url\s*=\s*["']([^"']+)["']/);return W?W[1].trim()===B.trim():!1}function k(z){try{if(I(z.from)===I(z.to))return null}catch{}try{let B=U(z.from);return B.isFile()&&B.size>0?z.from:null}catch{return null}}var{SQL:A}=globalThis.Bun;var V="default";class P extends Error{constructor(z,B){super(`No database connection named "${z}". Configured: ${B.map((G)=>`"${G}"`).join(", ")}. Declare it under \`connections\` in app/config/database.ts.`);this.name="UnknownConnectionError"}}class x extends Error{constructor(z){super(`"${z}" is the name of the connection declared by the top-level \`url\` and \`options\`, so it cannot also appear under \`connections\`. Rename it, or move its settings up to the top level.`);this.name="ReservedConnectionNameError"}}class N extends Error{open;requested;constructor(z,B){super(`A transaction is open on the "${z}" connection, and this statement names "${B}". A transaction cannot span two connections: the statement would run outside it and stay committed when the transaction rolls back. Move this query outside the transaction, or run the whole unit on one connection.`);this.open=z;this.requested=B;this.name="CrossConnectionTransactionError"}}class M{name;config;sql;dialect;url;ready;constructor(z,B={}){this.name=z;this.config=B;let G=B.url;if(!G)throw new j(z);this.dialect=B.dialect??F(G);let J=_(G,this.dialect);if(J.moved){let K=k(J.moved);if(K)throw new R(G,J.moved.to,K)}this.url=J.url,this.sql=B.options?new A(this.url,B.options):new A(this.url),this.ready=this.configure()}async configure(){if(this.dialect!=="sqlite")return;await this.sql.unsafe("pragma foreign_keys = ON")}get query(){return this.sql}async close(){this.ready.catch(()=>{}),await this.sql.close()}}class h{config;static token="database";name=V;pools=new Map;ready;constructor(z={}){this.config=z;let{connections:B={},...G}=z;this.pools.set(V,new M(V,G));try{this.build(B,G.slowTransactionThreshold)}catch(J){for(let K of this.pools.values())K.ready.catch(()=>{}),K.close().catch(()=>{});throw J}this.ready=Promise.all([...this.pools.values()].map((J)=>J.ready)).then(()=>{return})}build(z,B){for(let[G,J]of Object.entries(z)){if(G===V)throw new x(G);this.pools.set(G,new M(G,{slowTransactionThreshold:B,...J}))}}connection(z=V){if(z===V)return this;let B=this.pools.get(z);if(!B)throw new P(z,this.connectionNames);return B}get connectionNames(){return[...this.pools.keys()]}get sql(){return this.default.sql}get dialect(){return this.default.dialect}get url(){return this.default.url}get query(){return this.sql}async close(){this.ready.catch(()=>{}),await Promise.all([...this.pools.values()].map((z)=>z.close()))}get default(){return this.pools.get(V)}}
3
- export{E as Mf,f as Nf,b as Of,Q as Pf,j as Qf,F as Rf,p as Sf,m as Tf,R as Uf,V as Vf,P as Wf,x as Xf,N as Yf,M as Zf,h as _f};
3
+ export{E as Nf,f as Of,b as Pf,Q as Qf,j as Rf,F as Sf,p as Tf,m as Uf,R as Vf,V as Wf,P as Xf,x as Yf,N as Zf,M as _f,h as $f};
4
4
 
5
- //# debugId=6A214A44E59F865964756E2164756E21
5
+ //# debugId=0BA03D7F0F42F6C364756E2164756E21
@@ -9,6 +9,6 @@
9
9
  "import type { SQL } from \"bun\";\nimport type { ConnectionConfig, DatabaseConfig } from \"./config\";\nimport {\n Connection,\n DEFAULT_CONNECTION,\n ReservedConnectionNameError,\n UnknownConnectionError,\n type DatabaseConnection,\n} from \"./Connection\";\nimport type { Dialect } from \"./dialect\";\n\n// Wraps Bun's `SQL` client. Bun ships one client that speaks SQLite, Postgres,\n// MySQL and MariaDB, so gemi does not need a driver per database — it needs to\n// know *which* one is in use, which is what `dialect` carries.\n//\n// Safe to build eagerly: Bun's client connects on the first query, not at\n// construction. (`RedisManager` used to be cited here as the parallel case. As\n// of #403 it builds its client in a memoizing getter instead — not because\n// eager construction was unsafe, but because naming Bun's `RedisClient` at\n// module scope is what made `gemi/services` unloadable off Bun. `Connection`\n// still imports `SQL` as a value for the same reason, which is the remaining\n// half of #396.) It is still bound as a lazy singleton,\n// so an app that never touches the database never resolves it and never has to\n// have DATABASE_URL set.\n//\n// Since #327 it holds *connections*, plural: the top-level `url` and `options`\n// build the one called `\"default\"`, and each key under `connections` builds\n// another. What it does not do is decide which one a query uses — that is the\n// ORM's ambient scope and the `DB` facade, because the choice is per query\n// rather than per application. See `connection` below.\nexport class DatabaseManager implements DatabaseConnection {\n static token = \"database\";\n\n /**\n * This object *is* the default connection, so it answers to the name.\n *\n * Not a formality: `connection(\"default\")` returns `this` rather than the\n * `Connection` in the map, which is what keeps every existing reader —\n * `DB.sql`, `db.dialect`, and the test harnesses that wrap the manager in a\n * Proxy to count statements — looking at the same object the ORM executes\n * through. A second object for the default pool would have quietly bypassed\n * all of them while every test still passed.\n */\n public readonly name = DEFAULT_CONNECTION;\n\n /**\n * Every pool this manager owns, keyed by name and including the default one.\n *\n * Private because the map is the manager's bookkeeping — `connection()` is\n * the way in, and it is the only path that knows the default is `this`.\n */\n private readonly pools = new Map<string, Connection>();\n\n /**\n * Resolves once **every** connection has been configured, or rejects if one\n * could not be. Only SQLite has anything to do; elsewhere it is already\n * resolved.\n *\n * All of them rather than the default alone, because the thing a caller waits\n * on this for — SQLite's `pragma foreign_keys` — is per client, so a second\n * SQLite connection has its own and a caller awaiting one manager-level\n * promise means all of them.\n */\n public readonly ready: Promise<void>;\n\n constructor(public config: DatabaseConfig = {}) {\n const { connections = {}, ...primary } = config;\n\n // The default first, so a `MissingDatabaseUrlError` from a missing\n // `DATABASE_URL` still comes out of construction the way it always has,\n // rather than after a named connection has already opened a client.\n this.pools.set(\n DEFAULT_CONNECTION,\n new Connection(DEFAULT_CONNECTION, primary),\n );\n\n // A connection that is built before the one whose config is wrong is still\n // a live client with an open handle, and on the throwing path nothing else\n // will ever hold it: the manager never becomes a value, so nobody can call\n // `close`. Left alone, the pragma this constructor issues for a SQLite\n // connection settles against a client being torn down and surfaces as an\n // unhandled rejection with no configuration error anywhere near it.\n try {\n this.build(connections, primary.slowTransactionThreshold);\n } catch (error) {\n for (const pool of this.pools.values()) {\n // The in-flight configuration first: it is what rejects when the client\n // under it goes away, and this is the only place that can say the\n // rejection was expected.\n pool.ready.catch(() => {});\n pool.close().catch(() => {});\n }\n throw error;\n }\n\n // Built once here rather than derived per read, so that a connection whose\n // configuration rejects produces one unhandled rejection at most instead of\n // a fresh one per access.\n this.ready = Promise.all(\n [...this.pools.values()].map((pool) => pool.ready),\n ).then(() => undefined);\n }\n\n private build(\n connections: Record<string, ConnectionConfig>,\n slowTransactionThreshold: number | false | undefined,\n ): void {\n for (const [name, connection] of Object.entries(connections)) {\n if (name === DEFAULT_CONNECTION)\n throw new ReservedConnectionNameError(name);\n\n this.pools.set(\n name,\n new Connection(name, {\n // The threshold is the one setting a named connection is likely to\n // want *unchanged*: it is a development diagnostic about holding a\n // pooled connection, and that concern does not stop applying because\n // the pool has a name. `url`, `options` and `dialect` are deliberately\n // not inherited — a connection that borrowed the default's URL by\n // omission would be a second pool onto the same database created by a\n // typo in a key.\n slowTransactionThreshold,\n ...connection,\n }),\n );\n }\n }\n\n /**\n * The connection called `name`, or the default one when called with nothing.\n *\n * Throws rather than falling back to the default for an unknown name, and\n * that is the important half. A fallback would make `Model.on(\"analitycs\")`\n * run on the hot path — the exact pool the caller was trying to stay off —\n * and the only symptom would be the incident it was meant to prevent,\n * arriving weeks later with nothing pointing back at the typo.\n */\n connection(name: string = DEFAULT_CONNECTION): DatabaseConnection {\n // `this`, not `pools.get(DEFAULT_CONNECTION)` — see `name` above.\n if (name === DEFAULT_CONNECTION) return this;\n\n const found = this.pools.get(name);\n if (!found) throw new UnknownConnectionError(name, this.connectionNames);\n return found;\n }\n\n /** Every configured name, default first. For error messages and diagnostics. */\n get connectionNames(): string[] {\n return [...this.pools.keys()];\n }\n\n /**\n * The default connection's client. Unchanged in meaning: an application that\n * never names a connection sees exactly what it saw before #327.\n */\n get sql(): SQL {\n return this.default.sql;\n }\n\n get dialect(): Dialect {\n return this.default.dialect;\n }\n\n get url(): string {\n return this.default.url;\n }\n\n // Escape hatch matching Bun's own API, so `db.query` reads like `sql` does in\n // Bun's docs: db.query`select * from users where id = ${id}`\n get query(): SQL {\n return this.sql;\n }\n\n /** Closes every connection, not only the default one. */\n async close(): Promise<void> {\n // The aggregate promise needs the same treatment each connection's own\n // `ready` gets in `Connection.close` — it is derived from them, so a\n // rejection there arrives here as a second, separately unhandled one.\n this.ready.catch(() => {});\n await Promise.all([...this.pools.values()].map((pool) => pool.close()));\n }\n\n private get default(): Connection {\n return this.pools.get(DEFAULT_CONNECTION)!;\n }\n}\n"
10
10
  ],
11
11
  "mappings": ";AA6FO,SAAS,CAAoB,CAAC,EAAwC,CAC3E,OAAO,EAGF,SAAS,CAAsB,EAAmB,CACvD,MAAO,CACL,IAAK,QAAQ,IAAI,aACjB,QAAS,OACT,QAAS,OACT,yBAA0B,EAC1B,YAAa,MACf,EAOK,IAAM,EAA6B,KCxGnC,MAAM,UAAgC,KAAM,CACjD,WAAW,CAAC,EAAa,CACvB,MACE,4CAA4C,sFAE1C,2EACJ,EACA,KAAK,KAAO,0BAEhB,CAEO,MAAM,UAAgC,KAAM,CAKjD,WAAW,CAAC,EAAqB,CAC/B,MACE,IAAe,QAAa,IAAe,UACvC,iHAEA,QAAQ,sEACiB,gCAC/B,EACA,KAAK,KAAO,0BAEhB,CAEA,IAAM,EAAqC,CACzC,YAAa,WACb,cAAe,WACf,SAAU,QACV,WAAY,UACZ,UAAW,SACX,QAAS,QACX,EAEM,EAAyB,CAAC,MAAO,UAAW,UAAU,EAUrD,SAAS,CAAY,CAAC,EAAsB,CACjD,IAAM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KAExC,IAAM,EAAQ,KAAK,MAAM,IAAI,CAAI,EACjC,GAAI,CAAC,EAAO,MAAM,IAAI,EAAuB,EAAM,KAAK,eAAe,EACvE,OAAO,KAIL,gBAAe,EAAa,CAC9B,MAAO,CAAC,GAAG,KAAK,MAAM,KAAK,CAAC,KAO1B,IAAG,EAAQ,CACb,OAAO,KAAK,QAAQ,OAGlB,QAAO,EAAY,CACrB,OAAO,KAAK,QAAQ,WAGlB,IAAG,EAAW,CAChB,OAAO,KAAK,QAAQ,OAKlB,MAAK,EAAQ,CACf,OAAO,KAAK,SAIR,MAAK,EAAkB,CAI3B,KAAK,MAAM,MAAM,IAAM,EAAE,EACzB,MAAM,QAAQ,IAAI,CAAC,GAAG,KAAK,MAAM,OAAO,CAAC,EAAE,IAAI,CAAC,IAAS,EAAK,MAAM,CAAC,CAAC,KAG5D,QAAO,EAAe,CAChC,OAAO,KAAK,MAAM,IAAI,CAAkB,EAE5C",
12
- "debugId": "6A214A44E59F865964756E2164756E21",
12
+ "debugId": "0BA03D7F0F42F6C364756E2164756E21",
13
13
  "names": []
14
14
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
2
  class B{app;constructor(z){this.app=z}register(){}boot(){}shutdown(z){}}
3
- export{B as jc};
3
+ export{B as kc};
4
4
 
5
- //# debugId=801D2768CDEBA56664756E2164756E21
5
+ //# debugId=DB3AE624FD1CC06864756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { Application } from \"../foundation/Application\";\n\n/**\n * What a provider's `shutdown()` may resolve: nothing, or whether it\n * abandoned work at the deadline. See `ServiceProvider` below.\n */\nexport type ProviderShutdownResult = void | { abandoned: boolean };\n\n/**\n * Every hook defaults to a no-op. `register()` binds services into the\n * container and must not resolve any of them; `boot()` runs after every\n * provider has registered, so it may resolve freely.\n *\n * `shutdown()` runs once when a production server is told to stop (`SIGTERM`\n * or `SIGINT`), after it has stopped accepting requests and the in-flight ones\n * have finished or run out of grace — so nothing a request needs is torn down\n * under it. Providers shut down in reverse registration order, so one\n * registered after another may still use it. Each is awaited, but under a\n * shared deadline (`GEMI_SHUTDOWN_PROVIDER_TIMEOUT`): one that overruns is\n * abandoned and the next begins, and one that throws is logged and does not\n * stop the rest. See `Application.shutdown`.\n *\n * Under `gemi dev` it also runs on every `bun --hot` reload, for the\n * application the reload replaced, once the new one is serving and the old\n * one's requests have finished (see `server/devReload.ts`). A hook that closes\n * something kept on `globalThis` across reloads would close it for the new\n * application too.\n *\n * `timeoutMs` is what is left of that shared deadline when this provider is\n * reached. A provider that waits for something — jobs finishing, a queue\n * draining — should bound its own wait by a little less than this, so that it\n * is still the one to report what it gave up on. Ignoring it is fine; the\n * provider is then simply abandoned at the deadline, with only a generic line\n * from `Application` to say so.\n *\n * A provider that bounds its own wait and gives up on work it was waiting for\n * resolves `{ abandoned: true }`. `Application` then reports it in `timedOut`\n * as if it had overrun, and the process exits `1` — the work was cut off just\n * the same, and an orchestrator or a log alert has to be able to see that from\n * the exit code. The provider names what it abandoned in its own log line.\n */\nexport abstract class ServiceProvider {\n constructor(protected app: Application) {}\n\n register(): void {}\n\n boot(): void | Promise<void> {}\n\n shutdown(options?: {\n timeoutMs: number;\n }): ProviderShutdownResult | Promise<ProviderShutdownResult> {}\n}\n"
6
6
  ],
7
7
  "mappings": ";AAyCO,MAAe,CAAgB,CACd,IAAtB,WAAW,CAAW,EAAkB,CAAlB,WAEtB,QAAQ,EAAS,EAEjB,IAAI,EAAyB,EAE7B,QAAQ,CAAC,EAEoD,EAC/D",
8
- "debugId": "801D2768CDEBA56664756E2164756E21",
8
+ "debugId": "DB3AE624FD1CC06864756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{jc as o}from"./chunk-x02whwn3.js";import{kc as i}from"./chunk-vemwqxx2.js";import{kg as t}from"./chunk-m0kbpywd.js";import{rg as r}from"./chunk-ma2zdn5s.js";class n extends i{register(){this.app.singleton(r,()=>new r(t(o(),this.app.config.get("translation",{}))))}}
3
+ export{n as Wa};
4
+
5
+ //# debugId=0B1F8E310934FD5E64756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import { ServiceProvider } from \"../support/ServiceProvider\";\nimport { withDefaults } from \"../support/withDefaults\";\nimport { Translator } from \"./Translator\";\nimport { translationConfigDefaults, type TranslationConfig } from \"./config\";\n\nexport class TranslationServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n Translator,\n () =>\n new Translator(\n withDefaults(\n translationConfigDefaults(),\n this.app.config.get<TranslationConfig>(\"translation\", {}),\n ),\n ),\n );\n }\n}\n"
6
6
  ],
7
7
  "mappings": ";sLAKO,AAAM,IAAmC,LAAgB,CAC9D,QAAQ,EAAG,CACT,KAAK,IAAI,UACP,EACA,IACE,IAAI,EACF,EACE,EAA0B,EAC1B,KAAK,IAAI,OAAO,IAAuB,cAAe,CAAC,CAAC,CAC1D,CACF,CACJ,EAEJ",
8
- "debugId": "C7F9A362F4A7A46664756E2164756E21",
8
+ "debugId": "0B1F8E310934FD5E64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
2
  function H(z){if(z===401)return"authentication";if(z===403)return"permission";if(z===404)return"not_found";if(z===416)return"range_not_satisfiable";if(z===429)return"rate_limit";if(z>=500)return"server_error";return"form_error"}var N="GEMI_REQUEST_BREAKER_ERROR";class J extends Error{static legacyStringPayload=!1;kind=N;payload;constructor(z,C={}){super(z);let D=C.status??400;this.payload={api:{status:D,data:{error:L(C.kind??H(D),z??"",D)},...C.headers?{headers:C.headers}:{}},view:{status:D}}}}function L(z,C,D){return{kind:z,message:C,status:D}}function X(z,C,D){return J.legacyStringPayload?C:L(z,C,D)}
3
- export{H as qf,N as rf,J as sf,L as tf,X as uf};
3
+ export{H as rf,N as sf,J as tf,L as uf,X as vf};
4
4
 
5
- //# debugId=31AC53A509B4390164756E2164756E21
5
+ //# debugId=067FB08CEC8DA4A564756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "import { refusalKindForStatus, type Refusal, type RefusalKind } from \"./refusal\";\n\nexport const GEMI_REQUEST_BREAKER_ERROR = \"GEMI_REQUEST_BREAKER_ERROR\";\n\nexport type RequestBreakerOptions = {\n /** The answer's status. 400 when absent. */\n status?: number;\n /**\n * What the client's guards classify it as. Absent, it follows from\n * `status`: 401 `authentication`, 403 `permission`, 404 `not_found`, 429\n * `rate_limit`, 5xx `server_error`, any other status `form_error`.\n */\n kind?: Exclude<RefusalKind, \"validation_error\">;\n /** Extra headers for the API answer. */\n headers?: Record<string, string>;\n};\n\nexport class RequestBreakerError extends Error {\n /**\n * Answer the refusals that were bare strings before 0.85 — authentication,\n * authorization, permission, CSRF and a 500 — with that string again,\n * instead of `{ kind, message, status }`.\n *\n * For a shipped native client that reads `body.error` as a string and cannot\n * be rolled forward in the same deploy as the server. Set it once at boot,\n * and remove the line when the clients read `body.error.message`:\n *\n * ```ts\n * RequestBreakerError.legacyStringPayload = true;\n * ```\n *\n * gemi's own web client reads either shape. Refusals that were already\n * objects (404, 429, a policy 403) stay objects.\n */\n static legacyStringPayload = false;\n\n public kind = GEMI_REQUEST_BREAKER_ERROR;\n public payload: {\n api: Record<string, any>;\n view: Record<string, any>;\n /**\n * What a `.json` view navigation answers, when that differs from `api`.\n * Absent, it gets `api` — right for most breakers, but not for one that\n * must be a 401 to an API client and a redirect to the client router.\n */\n viewData?: Record<string, any>;\n };\n\n /**\n * A refusal that answers `{ error: { kind, message, status } }` with\n * `status`, so the client's guards classify it without a payload of your\n * own. A subclass that sets `payload` itself replaces this.\n *\n * ```ts\n * throw new RequestBreakerError(\"This slug is taken\", { status: 409 });\n * // → 409 { error: { kind: \"form_error\", message: \"This slug is taken\", status: 409 } }\n * ```\n */\n constructor(message?: string, options: RequestBreakerOptions = {}) {\n super(message);\n const status = options.status ?? 400;\n this.payload = {\n api: {\n status,\n data: {\n error: refusal(options.kind ?? refusalKindForStatus(status), message ?? \"\", status),\n },\n ...(options.headers ? { headers: options.headers } : {}),\n },\n view: { status },\n };\n }\n}\n\n/** A refusal's `error` field. */\nexport function refusal<K extends Exclude<RefusalKind, \"validation_error\">>(\n kind: K,\n message: string,\n status: number,\n): Refusal<K> {\n return { kind, message, status };\n}\n\n/**\n * A refusal that was a bare string before 0.85: the object, or the string\n * under `RequestBreakerError.legacyStringPayload`.\n *\n * @internal\n */\nexport function stringEraRefusal<K extends Exclude<RefusalKind, \"validation_error\">>(\n kind: K,\n message: string,\n status: number,\n): Refusal<K> | string {\n return RequestBreakerError.legacyStringPayload ? message : refusal(kind, message, status);\n}\n"
7
7
  ],
8
8
  "mappings": ";AAqDO,SAAS,CAAoB,CAAC,EAA0D,CAC7F,GAAI,IAAW,IAAK,MAAO,iBAC3B,GAAI,IAAW,IAAK,MAAO,aAC3B,GAAI,IAAW,IAAK,MAAO,YAC3B,GAAI,IAAW,IAAK,MAAO,wBAC3B,GAAI,IAAW,IAAK,MAAO,aAC3B,GAAI,GAAU,IAAK,MAAO,eAC1B,MAAO,aC1DF,IAAM,EAA6B,6BAenC,MAAM,UAA4B,KAAM,OAiBtC,qBAAsB,GAEtB,KAAO,EACP,QAqBP,WAAW,CAAC,EAAkB,EAAiC,CAAC,EAAG,CACjE,MAAM,CAAO,EACb,IAAM,EAAS,EAAQ,QAAU,IACjC,KAAK,QAAU,CACb,IAAK,CACH,SACA,KAAM,CACJ,MAAO,EAAQ,EAAQ,MAAQ,EAAqB,CAAM,EAAG,GAAW,GAAI,CAAM,CACpF,KACI,EAAQ,QAAU,CAAE,QAAS,EAAQ,OAAQ,EAAI,CAAC,CACxD,EACA,KAAM,CAAE,QAAO,CACjB,EAEJ,CAGO,SAAS,CAA2D,CACzE,EACA,EACA,EACY,CACZ,MAAO,CAAE,OAAM,UAAS,QAAO,EAS1B,SAAS,CAAoE,CAClF,EACA,EACA,EACqB,CACrB,OAAO,EAAoB,oBAAsB,EAAU,EAAQ,EAAM,EAAS,CAAM",
9
- "debugId": "31AC53A509B4390164756E2164756E21",
9
+ "debugId": "067FB08CEC8DA4A564756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
2
  function j(h){return h}function p(){return{supportedLocales:[],defaultLocale:"en-US",prefetch:{},components:{},detectLocale:()=>null,onLocaleChange:(h)=>{console.log(`Locale changed to ${h}`)}}}
3
- export{j as hc,p as ic};
3
+ export{j as ic,p as jc};
4
4
 
5
- //# debugId=D4C044C0C33F961964756E2164756E21
5
+ //# debugId=3452A8410674819664756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { Dictionary } from \"./Dictionary\";\nimport type { HttpRequest } from \"../http/HttpRequest\";\n\n// Config key: `translation`. Derived from `I18nServiceProvider`.\nexport interface TranslationConfig {\n supportedLocales?: string[];\n defaultLocale?: string;\n /**\n * @deprecated Only for `Dictionary.create` dictionaries. A `defineDictionary`\n * dictionary needs no entry here — the component that reads it pulls it in,\n * and the bundler ships only the active locale.\n */\n prefetch?: Record<string, Array<Dictionary<any>>>;\n /** @deprecated Only for `Dictionary.create` dictionaries. See `prefetch`. */\n components?: Record<string, Dictionary<any>>;\n\n // Returning `null` falls back to gemi's own locale detection.\n detectLocale?: (req: HttpRequest) => string | null;\n onLocaleChange?: (locale: string) => Promise<void> | void;\n}\n\nexport function defineTranslationConfig(\n config: TranslationConfig,\n): TranslationConfig {\n return config;\n}\n\nexport function translationConfigDefaults(): Required<TranslationConfig> {\n return {\n supportedLocales: [],\n defaultLocale: \"en-US\",\n prefetch: {},\n components: {},\n detectLocale: () => null,\n onLocaleChange: (locale) => {\n console.log(`Locale changed to ${locale}`);\n },\n };\n}\n"
6
6
  ],
7
7
  "mappings": ";AAqBO,SAAS,CAAuB,CACrC,EACmB,CACnB,OAAO,EAGF,SAAS,CAAyB,EAAgC,CACvE,MAAO,CACL,iBAAkB,CAAC,EACnB,cAAe,QACf,SAAU,CAAC,EACX,WAAY,CAAC,EACb,aAAc,IAAM,KACpB,eAAgB,CAAC,IAAW,CAC1B,QAAQ,IAAI,qBAAqB,GAAQ,EAE7C",
8
- "debugId": "D4C044C0C33F961964756E2164756E21",
8
+ "debugId": "3452A8410674819664756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-9tsw1bmt.js";function R(f,D){let P=new Map;for(let p of[...D.tables].sort())P.set(p,{name:p,columns:[],primaryKey:[],relations:[]});for(let{table:p,...s}of D.columns)P.get(p)?.columns.push(s);for(let{table:p,column:s}of D.primaryKeys)P.get(p)?.primaryKey.push(s);let d=new Map;for(let p of D.foreignKeys){let s=P.get(p.table);if(!s)continue;let M=`${p.table}\x00${p.key}`,q=d.get(M);if(!q)q={name:p.name,columns:[],referencedTable:p.referencedTable,referencedColumns:[],onDelete:p.onDelete,onUpdate:p.onUpdate},d.set(M,q),s.relations.push(q);q.columns.push(p.column),q.referencedColumns.push(p.referencedColumn)}return{dialect:f,tables:[...P.values()]}}async function h(f,D){let P=await f.unsafe(`
2
+ import"./chunk-3bjj31n9.js";function R(f,D){let P=new Map;for(let p of[...D.tables].sort())P.set(p,{name:p,columns:[],primaryKey:[],relations:[]});for(let{table:p,...s}of D.columns)P.get(p)?.columns.push(s);for(let{table:p,column:s}of D.primaryKeys)P.get(p)?.primaryKey.push(s);let d=new Map;for(let p of D.foreignKeys){let s=P.get(p.table);if(!s)continue;let M=`${p.table}\x00${p.key}`,q=d.get(M);if(!q)q={name:p.name,columns:[],referencedTable:p.referencedTable,referencedColumns:[],onDelete:p.onDelete,onUpdate:p.onUpdate},d.set(M,q),s.relations.push(q);q.columns.push(p.column),q.referencedColumns.push(p.referencedColumn)}return{dialect:f,tables:[...P.values()]}}async function h(f,D){let P=await f.unsafe(`
3
3
  select TABLE_NAME as name
4
4
  from information_schema.TABLES
5
5
  where TABLE_SCHEMA = database() and TABLE_TYPE = 'BASE TABLE'
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Kg as s}from"./chunk-9tsw1bmt.js";var i=s((t,e)=>{e.exports={name:"@aws-sdk/nested-clients",version:"3.996.14",description:"Nested clients for AWS SDK packages.",main:"./dist-cjs/index.js",module:"./dist-es/index.js",types:"./dist-types/index.d.ts",scripts:{build:"yarn lint && concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline nested-clients","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",lint:"node ../../scripts/validation/submodules-linter.js --pkg nested-clients",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},engines:{node:">=20.0.0"},sideEffects:!1,author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"^3.973.24","@aws-sdk/middleware-host-header":"^3.972.8","@aws-sdk/middleware-logger":"^3.972.8","@aws-sdk/middleware-recursion-detection":"^3.972.8","@aws-sdk/middleware-user-agent":"^3.972.25","@aws-sdk/region-config-resolver":"^3.972.9","@aws-sdk/types":"^3.973.6","@aws-sdk/util-endpoints":"^3.996.5","@aws-sdk/util-user-agent-browser":"^3.972.8","@aws-sdk/util-user-agent-node":"^3.973.11","@smithy/config-resolver":"^4.4.13","@smithy/core":"^3.23.12","@smithy/fetch-http-handler":"^5.3.15","@smithy/hash-node":"^4.2.12","@smithy/invalid-dependency":"^4.2.12","@smithy/middleware-content-length":"^4.2.12","@smithy/middleware-endpoint":"^4.4.27","@smithy/middleware-retry":"^4.4.44","@smithy/middleware-serde":"^4.2.15","@smithy/middleware-stack":"^4.2.12","@smithy/node-config-provider":"^4.3.12","@smithy/node-http-handler":"^4.5.0","@smithy/protocol-http":"^5.3.12","@smithy/smithy-client":"^4.12.7","@smithy/types":"^4.13.1","@smithy/url-parser":"^4.2.12","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.43","@smithy/util-defaults-mode-node":"^4.2.47","@smithy/util-endpoints":"^3.3.3","@smithy/util-middleware":"^4.2.12","@smithy/util-retry":"^4.2.12","@smithy/util-utf8":"^4.2.2",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3"},typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["./cognito-identity.d.ts","./cognito-identity.js","./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sso.d.ts","./sso.js","./sts.d.ts","./sts.js","dist-*/**"],browser:{"./dist-es/submodules/cognito-identity/runtimeConfig":"./dist-es/submodules/cognito-identity/runtimeConfig.browser","./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sso/runtimeConfig":"./dist-es/submodules/sso/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/nested-clients"},exports:{"./package.json":"./package.json","./sso-oidc":{types:"./dist-types/submodules/sso-oidc/index.d.ts",module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{types:"./dist-types/submodules/sts/index.d.ts",module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js"},"./signin":{types:"./dist-types/submodules/signin/index.d.ts",module:"./dist-es/submodules/signin/index.js",node:"./dist-cjs/submodules/signin/index.js",import:"./dist-es/submodules/signin/index.js",require:"./dist-cjs/submodules/signin/index.js"},"./cognito-identity":{types:"./dist-types/submodules/cognito-identity/index.d.ts",module:"./dist-es/submodules/cognito-identity/index.js",node:"./dist-cjs/submodules/cognito-identity/index.js",import:"./dist-es/submodules/cognito-identity/index.js",require:"./dist-cjs/submodules/cognito-identity/index.js"},"./sso":{types:"./dist-types/submodules/sso/index.d.ts",module:"./dist-es/submodules/sso/index.js",node:"./dist-cjs/submodules/sso/index.js",import:"./dist-es/submodules/sso/index.js",require:"./dist-cjs/submodules/sso/index.js"}}}});
2
+ import{Lg as s}from"./chunk-3bjj31n9.js";var i=s((t,e)=>{e.exports={name:"@aws-sdk/nested-clients",version:"3.996.14",description:"Nested clients for AWS SDK packages.",main:"./dist-cjs/index.js",module:"./dist-es/index.js",types:"./dist-types/index.d.ts",scripts:{build:"yarn lint && concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline nested-clients","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",lint:"node ../../scripts/validation/submodules-linter.js --pkg nested-clients",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},engines:{node:">=20.0.0"},sideEffects:!1,author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"^3.973.24","@aws-sdk/middleware-host-header":"^3.972.8","@aws-sdk/middleware-logger":"^3.972.8","@aws-sdk/middleware-recursion-detection":"^3.972.8","@aws-sdk/middleware-user-agent":"^3.972.25","@aws-sdk/region-config-resolver":"^3.972.9","@aws-sdk/types":"^3.973.6","@aws-sdk/util-endpoints":"^3.996.5","@aws-sdk/util-user-agent-browser":"^3.972.8","@aws-sdk/util-user-agent-node":"^3.973.11","@smithy/config-resolver":"^4.4.13","@smithy/core":"^3.23.12","@smithy/fetch-http-handler":"^5.3.15","@smithy/hash-node":"^4.2.12","@smithy/invalid-dependency":"^4.2.12","@smithy/middleware-content-length":"^4.2.12","@smithy/middleware-endpoint":"^4.4.27","@smithy/middleware-retry":"^4.4.44","@smithy/middleware-serde":"^4.2.15","@smithy/middleware-stack":"^4.2.12","@smithy/node-config-provider":"^4.3.12","@smithy/node-http-handler":"^4.5.0","@smithy/protocol-http":"^5.3.12","@smithy/smithy-client":"^4.12.7","@smithy/types":"^4.13.1","@smithy/url-parser":"^4.2.12","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.43","@smithy/util-defaults-mode-node":"^4.2.47","@smithy/util-endpoints":"^3.3.3","@smithy/util-middleware":"^4.2.12","@smithy/util-retry":"^4.2.12","@smithy/util-utf8":"^4.2.2",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3"},typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["./cognito-identity.d.ts","./cognito-identity.js","./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sso.d.ts","./sso.js","./sts.d.ts","./sts.js","dist-*/**"],browser:{"./dist-es/submodules/cognito-identity/runtimeConfig":"./dist-es/submodules/cognito-identity/runtimeConfig.browser","./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sso/runtimeConfig":"./dist-es/submodules/sso/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/nested-clients"},exports:{"./package.json":"./package.json","./sso-oidc":{types:"./dist-types/submodules/sso-oidc/index.d.ts",module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{types:"./dist-types/submodules/sts/index.d.ts",module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js"},"./signin":{types:"./dist-types/submodules/signin/index.d.ts",module:"./dist-es/submodules/signin/index.js",node:"./dist-cjs/submodules/signin/index.js",import:"./dist-es/submodules/signin/index.js",require:"./dist-cjs/submodules/signin/index.js"},"./cognito-identity":{types:"./dist-types/submodules/cognito-identity/index.d.ts",module:"./dist-es/submodules/cognito-identity/index.js",node:"./dist-cjs/submodules/cognito-identity/index.js",import:"./dist-es/submodules/cognito-identity/index.js",require:"./dist-cjs/submodules/cognito-identity/index.js"},"./sso":{types:"./dist-types/submodules/sso/index.d.ts",module:"./dist-es/submodules/sso/index.js",node:"./dist-cjs/submodules/sso/index.js",import:"./dist-es/submodules/sso/index.js",require:"./dist-cjs/submodules/sso/index.js"}}}});
3
3
  export{i as k};
4
4
 
5
- //# debugId=4799095E7F2CDE9B64756E2164756E21
5
+ //# debugId=5DAC98B6072122CF64756E2164756E21
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "4799095E7F2CDE9B64756E2164756E21",
7
+ "debugId": "5DAC98B6072122CF64756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ac as T,cc as D}from"./chunk-saqfc6vp.js";import{tg as C}from"./chunk-d3jkypc7.js";import{Eg as I,Fg as Z,Gg as A}from"./chunk-cbycz5z3.js";class R extends Error{code;constructor(G,H=1){super(G);this.code=H;this.name="CommandFailed"}}class K{static commandName="unset";static description="";static args=[];static options=[];run(G){}}function p(G){return G}function S(){return{commands:[],commandsDir:"app/commands"}}var Q=Symbol.for("gemi.console.builder");function x(G){if(G.trim()==="")throw Error("A command name cannot be empty.");if(/[{}]/.test(G)||/\s/.test(G))throw Error(`Invalid command name ${JSON.stringify(G)}. gemi does not parse a signature string; the name is the whole of it. Declare arguments with .arg() and flags with .option():
2
+ import{bc as T,dc as D}from"./chunk-2zsfntsf.js";import{ug as C}from"./chunk-q9g7g995.js";import{Fg as I,Gg as Z,Hg as A}from"./chunk-zgy7jtcq.js";class R extends Error{code;constructor(G,H=1){super(G);this.code=H;this.name="CommandFailed"}}class K{static commandName="unset";static description="";static args=[];static options=[];run(G){}}function p(G){return G}function S(){return{commands:[],commandsDir:"app/commands"}}var Q=Symbol.for("gemi.console.builder");function x(G){if(G.trim()==="")throw Error("A command name cannot be empty.");if(/[{}]/.test(G)||/\s/.test(G))throw Error(`Invalid command name ${JSON.stringify(G)}. gemi does not parse a signature string; the name is the whole of it. Declare arguments with .arg() and flags with .option():
3
3
 
4
4
  defineCommand("mail:send")
5
5
  .arg("user", { required: true })
@@ -14,6 +14,6 @@ import{ac as T,cc as D}from"./chunk-saqfc6vp.js";import{tg as C}from"./chunk-d3j
14
14
  static event = UserRegistered;
15
15
 
16
16
  If this is an abstract base its subclasses extend, move it out of the `+"listeners directory \u2014 the walk excludes gemi's `Listener` and "+"nothing else, so a base sitting beside its subclasses is registered and run like one of them.")}function v(G){for(let H of G){if(Object.getOwnPropertyDescriptor(H,"name")?.writable)continue;console.warn(`Event listener ${H.name} does not declare \`static name\`, so it is registered under its class name, which a production build renames. Nothing reads that name across a build boundary while the `+"listener is sync, which is why this is a warning \u2014 but adding "+`\`queued = true\` to it is refused at boot for the same reason, because the queue's key is that string. Add: static name = "${H.name}";`)}}function b(G){let H=new Set;for(let{event:P}of G){if(H.has(P))continue;if(Object.getOwnPropertyDescriptor(P,"name")?.writable)continue;H.add(P),console.warn(`Event ${P.name} does not declare \`static name\`, so it is dispatched under its class name. A production build minifies the code that dispatches it and renames the class, while discovery reads `+"the listener's copy from source and does not \u2014 so the dispatch would "+`reach no listener in production and nowhere else. Add: static name = "${P.name}";`)}}
17
- export{R as Kb,K as Lb,p as Mb,S as Nb,c as Ob,_ as Pb,o as Qb,W as Rb,i as Sb,B as Tb,M as Ub,U as Vb,JG as Wb,OG as Xb,QG as Yb,_G as Zb};
17
+ export{R as Lb,K as Mb,p as Nb,S as Ob,c as Pb,_ as Qb,o as Rb,W as Sb,i as Tb,B as Ub,M as Vb,U as Wb,JG as Xb,OG as Yb,QG as Zb,_G as _b};
18
18
 
19
- //# debugId=049BB65C0E77316F64756E2164756E21
19
+ //# debugId=4E9F5A519A2F139064756E2164756E21
@@ -13,6 +13,6 @@
13
13
  "import { existsSync } from \"node:fs\";\nimport { dirname, isAbsolute, join } from \"node:path\";\n\nimport {\n discoverClasses,\n DiscoveryError,\n projectRoot,\n} from \"../support/discover\";\nimport { Command, type CommandClass } from \"../console/Command\";\nimport { commandConfigDefaults } from \"../console/config\";\nimport { isUnfinishedBuilder } from \"../console/builder\";\nimport { CronJob } from \"./cron/CronJob\";\nimport { scheduleConfigDefaults } from \"./cron/config\";\nimport { eventConfigDefaults } from \"./events/config\";\nimport type { EventClass } from \"./events/Event\";\nimport { Listener, type ListenerClass } from \"./events/Listener\";\nimport { Job } from \"./queue/Job\";\nimport { queueConfigDefaults } from \"./queue/config\";\n\n/**\n * Reading an application's jobs off the filesystem, for the two subsystems that\n * were asking every app to write its job list twice.\n *\n * Both functions here are the same call to `discoverClasses` with a different\n * base class, which is deliberate: one walk, one set of skip rules, one answer\n * to \"what does this app have\". They are exported from `gemi/services` rather\n * than kept private to the providers because the list stopped being something\n * an app could import — a test that used to walk the exported `jobs` array\n * needs somewhere to ask the same question, and so does a script.\n *\n * What the providers add on top of these is the decision of *whether* to ask,\n * which is the config's to make and not this file's.\n */\n\n/**\n * A directory the app named, resolved the way the app meant it.\n *\n * Relative paths hang off the project root rather than `process.cwd()` at the\n * moment of the call, because a config slice saying `app/jobs` means the app's\n * `app/jobs` and not whatever directory somebody happened to launch a script\n * from. Absolute paths are taken as given, which is what makes these callable\n * from a test that has no project around it.\n */\nfunction resolveDir(dir: string): string {\n return isAbsolute(dir) ? dir : join(projectRoot(), dir);\n}\n\n/**\n * Says something when the directory is missing *and so is the tree it lives in*.\n *\n * A missing directory has two readings and they want opposite responses. An app\n * that has never written a cron job has no `app/cron`, and warning about that on\n * every boot for the rest of its life is noise — the answer \"you have no cron\n * jobs\" is correct and uninteresting. But a deploy that ships `dist/` and\n * `node_modules/` without the source has no `app/cron` *and no `app/`*, and\n * there discovery quietly returns nothing while the app very much does have\n * jobs: the exact silence #322 and #323 exist to remove, reintroduced one layer\n * down and in production only.\n *\n * The parent directory is what tells them apart. If neither the directory nor\n * the one above it is there, the tree this was pointed into is not there\n * either, and that is worth a sentence.\n */\nfunction warnIfSourceIsMissing(\n resolved: string,\n subject: string,\n slice: string,\n) {\n if (existsSync(resolved) || existsSync(dirname(resolved))) return;\n\n console.warn(\n `No ${subject} were discovered: neither ${resolved} nor the directory ` +\n `above it exists, so this process cannot see the application's source. ` +\n `If this is a deploy that ships only the build output, list the classes ` +\n `explicitly in app/config/${slice}.ts so they travel with it.`,\n );\n}\n\n/**\n * The `Job` subclasses under `dir`, defaulting to the config slice's `app/jobs`.\n *\n * This is what a `queue` config slice with no `jobs` key resolves to. Call it\n * directly to ask the question a test used to answer by importing the array:\n * every job this application would register, in the order it would register\n * them.\n *\n * Every file underneath is imported, so calling this runs the app's job modules\n * — the cost `discoverClasses` documents at length, paid once per call.\n */\nexport async function discoverJobs(\n dir: string = queueConfigDefaults().jobsDir,\n): Promise<Array<new () => Job>> {\n const resolved = resolveDir(dir);\n warnIfSourceIsMissing(resolved, \"queue jobs\", \"queue\");\n const jobs = await discoverClasses(resolved, Job);\n warnIfNameWillNotSurviveTheBuild(jobs);\n return jobs;\n}\n\n/**\n * Says something about a discovered job that never declared `static name`.\n *\n * This is the one hazard discovery introduces rather than removes, and it is\n * production-only. `gemi build` minifies the server entry, and app code\n * reachable from it — a controller, and every job class that controller\n * imports to dispatch — is bundled and minified with it. Minification renames\n * the class binding, and a class's implicit `.name` is that binding: a\n * `TestJob` in the bundle reports `\"D\"`. Discovery, meanwhile, imports\n * `app/jobs/TestJob.ts` from source at runtime, where it is still `\"TestJob\"`.\n * The queue is keyed by that name, so the two halves stop agreeing and the\n * dispatch is dropped — in production, and only there.\n *\n * A declared `static name = \"TestJob\"` is a string literal, which survives\n * minification intact, and the two halves agree again. `docs/jobs-and-queues.md`\n * has always called it required; before discovery an app could get away without\n * it, because the explicit `jobs` array was bundled too and both sides were\n * wrong in the same way.\n *\n * The check is exact rather than a guess: a `static name = \"...\"` class field\n * defines a *writable* own property, while the implicit class name is\n * non-writable. Cron is unaffected — `CronJob.name` is an instance field\n * holding a string literal, not the class binding.\n */\nfunction warnIfNameWillNotSurviveTheBuild(jobs: Array<new () => Job>) {\n for (const job of jobs) {\n if (Object.getOwnPropertyDescriptor(job, \"name\")?.writable) continue;\n\n console.warn(\n `Queued job ${job.name} does not declare \\`static name\\`, so it is ` +\n `registered under its class name. A production build minifies the ` +\n `class that dispatches it and renames it, while discovery reads this ` +\n `file from source and does not — so the dispatch would be dropped in ` +\n `production and nowhere else. Add: static name = \"${job.name}\";`,\n );\n }\n}\n\n/**\n * The `CronJob` subclasses under `dir`, defaulting to the config slice's\n * `app/cron`.\n *\n * This is what a `schedule` config slice with no `jobs` key resolves to. Call it\n * directly to ask the question a test used to answer by importing the array —\n * though after boot `app(Scheduler).jobs` is the better one, because it is what\n * the scheduler actually took rather than what this would find if asked again.\n *\n * Every file underneath is imported, so calling this runs the app's cron\n * modules — the cost `discoverClasses` documents at length, paid once per call.\n */\nexport async function discoverCronJobs(\n dir: string = scheduleConfigDefaults().jobsDir,\n): Promise<Array<new () => CronJob>> {\n const resolved = resolveDir(dir);\n warnIfSourceIsMissing(resolved, \"cron jobs\", \"schedule\");\n return await discoverClasses(resolved, CronJob);\n}\n\n/**\n * The `Command` subclasses under `dir`, defaulting to the config slice's\n * `app/commands`.\n *\n * This is what a `commands`-less `command` slice resolves to, and what\n * `gemi run` lists. Unlike the two above it is not called during boot — a\n * command registry has one consumer, and importing every file under\n * `app/commands` into every server process would be a cost paid on every start\n * for code no request reaches.\n *\n * Every file underneath is imported, so calling this runs the app's command\n * modules — the cost `discoverClasses` documents at length, paid once per call.\n */\nexport async function discoverCommands(\n dir: string = commandConfigDefaults().commandsDir,\n): Promise<CommandClass[]> {\n const resolved = resolveDir(dir);\n warnIfSourceIsMissing(resolved, \"commands\", \"command\");\n\n const unfinished: string[] = [];\n\n const commands = await discoverClasses(\n resolved,\n Command,\n [],\n (value, file) => {\n if (isUnfinishedBuilder(value)) unfinished.push(file);\n },\n );\n\n refuseUnfinishedBuilders(unfinished);\n\n return commands as CommandClass[];\n}\n\n/**\n * Stops the walk for a builder chain that was never finished.\n *\n * This is the one silence the builder introduces, and it is the exact shape\n * #322 and #323 exist to remove. `defineCommand(...).arg(...)` without a\n * trailing `.handle(...)` is a plain object rather than a class, so\n * `discoverClasses` discards it along with every constant and helper a command\n * file happens to export — and the command disappears from `gemi run` with\n * nothing raised. The author sees a listing containing every command except the\n * one they just wrote.\n *\n * A throw rather than a warning, because there is no reading of an unfinished\n * builder under which the author meant it: the chain builds a description of a\n * command and then discards it.\n *\n * \"Unfinished\" is decided by `.handle()` clearing the brand, not by the export\n * still being a builder object. Those differ for the natural way to share\n * declarations —\n *\n * export const base = defineCommand(\"reindex\").option(\"verbose\", …);\n * export default base.handle(async () => {});\n *\n * — where `base` is a builder that *did* produce a command. Keying off the shape\n * alone made that file abort the whole of `gemi run`, taking every other command\n * in the project down with it, under a message that was untrue for it.\n */\nfunction refuseUnfinishedBuilders(files: string[]): void {\n if (files.length === 0) return;\n\n const subject =\n files.length === 1\n ? `${files[0]} exports a command builder that never called \\`.handle()\\``\n : `${files.length} files export a command builder that never called ` +\n `\\`.handle()\\`:\\n ${files.join(\"\\n \")}`;\n\n throw new DiscoveryError(\n `${subject}, so there is no command to run. \\`.handle()\\` is what turns ` +\n `the chain into a command — finish it:\\n\\n` +\n ` export default defineCommand(\"my-command\")\\n` +\n ` .handle(async ({ line }) => { line(\"hello\") })`,\n );\n}\n\n/**\n * The `Listener` subclasses under `dir`, defaulting to the config slice's\n * `app/listeners`.\n *\n * This is what an `events` config slice with no `listeners` key resolves to.\n * Call it directly to ask what an application would register: every listener,\n * in the order it would register them.\n *\n * Only listeners are walked. Event classes are never discovered — each is\n * imported by the listener that binds to it and by the code that dispatches it,\n * so there is nothing a walk over them would find that is not already in the\n * module graph.\n *\n * **Known residual, matching jobs and cron.** `discoverClasses` excludes the\n * `base` it is handed and not intermediates, so an abstract listener base\n * written in `listenersDir` and extended by its siblings is discovered and\n * registered alongside them — constructed, with its `handle` called, on every\n * dispatch of whatever event it declares. Keep shared bases outside the\n * directory.\n *\n * Every file underneath is imported, so calling this runs the app's listener\n * modules — the cost `discoverClasses` documents at length, paid once per call.\n *\n * @throws DiscoveryError if a discovered listener declares no `static event`.\n */\nexport async function discoverListeners(\n dir: string = eventConfigDefaults().listenersDir,\n): Promise<ListenerClass[]> {\n const resolved = resolveDir(dir);\n warnIfSourceIsMissing(resolved, \"event listeners\", \"events\");\n\n const listeners = (await discoverClasses(\n resolved,\n Listener,\n )) as ListenerClass[];\n\n refuseListenersWithNoEvent(listeners);\n warnIfListenerNameWillNotSurviveTheBuild(listeners);\n warnIfEventNameWillNotSurviveTheBuild(listeners);\n\n return listeners;\n}\n\n/**\n * Stops the walk for a listener that binds to nothing.\n *\n * `static event` is declared as required on the base and the compiler still\n * cannot see it missing: every subclass inherits the declaration whether or not\n * it assigns to one, so `typeof SomeListener` type-checks either way. What the\n * author gets instead is a file that is imported, registered under no name, and\n * never called — the silence this whole module is arranged against.\n *\n * A throw rather than a warning, because there is no reading of a listener with\n * no event under which the author meant it. The usual cause is the residual\n * above: an abstract base sharing a gate between two listeners, sitting in\n * `listenersDir` where the walk finds it. Moving it out is the fix, and the\n * message says so — the alternative, excluding it by some guess about\n * abstractness, is how a discovery pass ends up quietly covering less than the\n * directory holds.\n */\nfunction refuseListenersWithNoEvent(listeners: ListenerClass[]): void {\n const orphans = listeners.filter((listener) => !listener.event);\n if (orphans.length === 0) return;\n\n throw new DiscoveryError(\n `${orphans\n .map((listener) => listener.name)\n .join(\", \")} declare no \\`static event\\`, so there is no event name to ` +\n `register them under and their \\`handle\\` would never run. Every ` +\n `listener binds to exactly one event:\\n\\n` +\n ` static event = UserRegistered;\\n\\n` +\n `If this is an abstract base its subclasses extend, move it out of the ` +\n `listeners directory — the walk excludes gemi's \\`Listener\\` and ` +\n `nothing else, so a base sitting beside its subclasses is registered ` +\n `and run like one of them.`,\n );\n}\n\n/**\n * Says something about a discovered listener that never declared `static name`.\n *\n * The hazard is `warnIfNameWillNotSurviveTheBuild`'s, one subsystem over: a\n * `static name = \"...\"` class field defines a *writable* own property while the\n * implicit class binding does not, and a minifier renames the binding while\n * leaving the string literal alone. The two spellings are indistinguishable by\n * value — both read `\"SendWelcomeEmail\"` in development — so the descriptor is\n * the only thing that tells them apart, and the difference only becomes visible\n * in a production build.\n *\n * A warning rather than a refusal, because a *sync* listener's name has no\n * second half to disagree with: every reader of it comes from this same\n * source-side walk, so a minified build and this walk cannot produce two\n * different strings for it. A **queued** listener does have one — the name is\n * the queue's key and it crosses a JSON boundary — and that case is refused\n * outright, by `jobForListener`, at the point the listener is registered with\n * the queue rather than here. This walk cannot tell the two apart without\n * constructing every listener it found; the registry constructs them anyway.\n */\nfunction warnIfListenerNameWillNotSurviveTheBuild(listeners: ListenerClass[]) {\n for (const listener of listeners) {\n if (Object.getOwnPropertyDescriptor(listener, \"name\")?.writable) continue;\n\n console.warn(\n `Event listener ${listener.name} does not declare \\`static name\\`, so ` +\n `it is registered under its class name, which a production build ` +\n `renames. Nothing reads that name across a build boundary while the ` +\n `listener is sync, which is why this is a warning — but adding ` +\n `\\`queued = true\\` to it is refused at boot for the same reason, ` +\n `because the queue's key is that string. Add: static name = ` +\n `\"${listener.name}\";`,\n );\n }\n}\n\n/**\n * Says something about the *event* a discovered listener binds to, when that\n * event's name is the implicit class binding.\n *\n * This is the check that matters from the first dispatch, and it is the reason\n * `discoverListeners` reads `static event` at all. The registry is keyed by the\n * event's name; the dispatcher supplies that name from the class it constructs.\n * A production build minifies the server entry and the app code reachable from\n * it — the controller, and the event class it imports in order to dispatch —\n * while discovery imports `app/listeners/*.ts` from source, and those files\n * import `app/events/*.ts` from source too. Two module graphs, two class\n * objects, and an implicit `.name` that reads `\"UserRegistered\"` on one side\n * and `\"D\"` on the other. The dispatch then finds no listeners, which is legal,\n * normal, and completely silent.\n *\n * A declared `static name` is a string literal, which survives minification\n * intact, and the two halves agree again.\n *\n * Checked through the descriptor rather than the string, and not by comparing\n * `event.name` to anything: in development the two spellings produce the same\n * value, so a check on the string would be a tautology that passes forever.\n */\nfunction warnIfEventNameWillNotSurviveTheBuild(listeners: ListenerClass[]) {\n const warned = new Set<EventClass>();\n\n for (const { event } of listeners) {\n if (warned.has(event)) continue;\n if (Object.getOwnPropertyDescriptor(event, \"name\")?.writable) continue;\n warned.add(event);\n\n console.warn(\n `Event ${event.name} does not declare \\`static name\\`, so it is ` +\n `dispatched under its class name. A production build minifies the ` +\n `code that dispatches it and renames the class, while discovery reads ` +\n `the listener's copy from source and does not — so the dispatch would ` +\n `reach no listener in production and nowhere else. Add: ` +\n `static name = \"${event.name}\";`,\n );\n }\n}\n"
14
14
  ],
15
15
  "mappings": ";+JA4GO,AAAM,IAAsB,KAAM,CAG5B,K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AAqC,CAAC,EAA4B,CACzE,IAAM,EAAS,IAAI,IAEnB,QAAa,WAAW,EAAW,CACjC,GAAI,EAAO,IAAI,CAAK,EAAG,SACvB,GAAI,OAAO,yBAAyB,EAAO,MAAM,GAAG,SAAU,SAC9D,EAAO,IAAI,CAAK,EAEhB,QAAQ,KACN,SAAS,EAAM,yLAGb,6EACA,yEACkB,EAAM,QAC5B",
16
- "debugId": "049BB65C0E77316F64756E2164756E21",
16
+ "debugId": "4E9F5A519A2F139064756E2164756E21",
17
17
  "names": []
18
18
  }
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Hg as I}from"./chunk-ndat0nf0.js";class J{kernel;onException;constructor(f){this.kernel=new f.kernel,this.kernel.boot.call(this.kernel),this.onException=f.onException??((A)=>{console.error("Unhandled exception in App:",A)})}async waitForBoot(){await this.kernel.waitForBoot()}getComponentTree(){return this.kernel.viewRoutes().componentTree}getFlatComponentTree(){let f=new Set;for(let A of this.kernel.domains().viewDispatchers())for(let B of A.flatComponentTree)f.add(B);return Array.from(f)}devAllowedHosts(){let f=this.kernel.domains();if(!f.resolver)return[];return f.acceptsCustomDomains?!0:[`.${f.resolver.root}`]}getRouteManifest(){return this.kernel.viewRoutes().routeManifest}globallyGated=new WeakMap;async withGlobalMiddleware(f,A,B){let z;try{z=await this.kernel.run.call(this.kernel,()=>this.kernel.globalMiddleware(f))}catch(D){return await B(D)}if(z.refusal)return z.refusal;return this.globallyGated.set(f,z.carried),z.apply(await A(f))}async fetch(f){let A=new URL(f.url);return this.kernel.run.call(this.kernel,async()=>{let B=this.globallyGated.has(f),z=B?null:await this.kernel.globalMiddleware(f),D=B?this.globallyGated.get(f):z.carried;if(z?.refusal)return z.refusal;let H=this.kernel.domains(),C=await H.ask(f)??await H.route(f);if(C instanceof Response)return z?z.apply(C):C;if(!C){let G=new Response("Unknown host",{status:404});return z?z.apply(G):G}let F=I(A.pathname)?await C.api.handleApiRequest(f,D):await C.view.handleViewRequest(f,D);if(!z)return F;if(typeof F==="function"){let G=F;return async(...L)=>z.apply(await G(...L))}return z.apply(F)})}dispatchJob(f,A){return this.kernel.run.bind(this.kernel)(()=>{return this.kernel.queue().dispatchJob(f,A)})}shutdown(f){return this.kernel.shutdown(f)}destroy(){this.kernel.destroy()}clone(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)}}export{J as xa};
2
+ import{Ig as I}from"./chunk-4mynkrv4.js";class J{kernel;onException;constructor(f){this.kernel=new f.kernel,this.kernel.boot.call(this.kernel),this.onException=f.onException??((A)=>{console.error("Unhandled exception in App:",A)})}async waitForBoot(){await this.kernel.waitForBoot()}getComponentTree(){return this.kernel.viewRoutes().componentTree}getFlatComponentTree(){let f=new Set;for(let A of this.kernel.domains().viewDispatchers())for(let B of A.flatComponentTree)f.add(B);return Array.from(f)}devAllowedHosts(){let f=this.kernel.domains();if(!f.resolver)return[];return f.acceptsCustomDomains?!0:[`.${f.resolver.root}`]}getRouteManifest(){return this.kernel.viewRoutes().routeManifest}globallyGated=new WeakMap;async withGlobalMiddleware(f,A,B){let z;try{z=await this.kernel.run.call(this.kernel,()=>this.kernel.globalMiddleware(f))}catch(D){return await B(D)}if(z.refusal)return z.refusal;return this.globallyGated.set(f,z.carried),z.apply(await A(f))}async fetch(f){let A=new URL(f.url);return this.kernel.run.call(this.kernel,async()=>{let B=this.globallyGated.has(f),z=B?null:await this.kernel.globalMiddleware(f),D=B?this.globallyGated.get(f):z.carried;if(z?.refusal)return z.refusal;let H=this.kernel.domains(),C=await H.ask(f)??await H.route(f);if(C instanceof Response)return z?z.apply(C):C;if(!C){let G=new Response("Unknown host",{status:404});return z?z.apply(G):G}let F=I(A.pathname)?await C.api.handleApiRequest(f,D):await C.view.handleViewRequest(f,D);if(!z)return F;if(typeof F==="function"){let G=F;return async(...L)=>z.apply(await G(...L))}return z.apply(F)})}dispatchJob(f,A){return this.kernel.run.bind(this.kernel)(()=>{return this.kernel.queue().dispatchJob(f,A)})}shutdown(f){return this.kernel.shutdown(f)}destroy(){this.kernel.destroy()}clone(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)}}export{J as xa};
3
3
 
4
- //# debugId=770C74BA90540D4964756E2164756E21
4
+ //# debugId=15A22E94F811B85764756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { Kernel } from \"../kernel\";\nimport type { CarriedContext } from \"../http/requestContext\";\nimport { isApiPath } from \"../services/router/apiPath\";\n\ninterface AppParams {\n kernel: new () => Kernel;\n onException?: (error: Error) => void;\n}\n\nexport class App {\n private kernel: Kernel;\n public onException?: (error: Error) => void;\n\n constructor(params: AppParams) {\n this.kernel = new params.kernel();\n this.kernel.boot.call(this.kernel);\n this.onException =\n params.onException ??\n ((error: Error) => {\n console.error(\"Unhandled exception in App:\", error);\n });\n }\n\n // Every service this class touches is resolved through a `this.kernel.*`\n // accessor rather than by importing the service class and calling `app()`\n // here. That is deliberate: the built bin (`dist/bin/gemi.js`) bundles its own\n // copy of gemi, while the app's Kernel is loaded from source and resolves\n // `gemi/*` to the source modules — so the two copies have *different*\n // `kernelContext` AsyncLocalStorage instances and different `Application`\n // class objects. A method call on the Kernel executes in the app's copy and\n // reads the app's container; a resolution attempted here would not. Service\n // *tokens* still cross the boundary safely (they are plain strings), which is\n // why `kernel.resolve()` works from either side.\n public async waitForBoot() {\n await this.kernel.waitForBoot();\n }\n\n public getComponentTree() {\n return this.kernel.viewRoutes().componentTree;\n }\n\n // Every host group's views, not just the root's: the servers load these\n // modules up front, and a view only an `admin.` group routes to still has\n // to be among them.\n public getFlatComponentTree() {\n const views = new Set<string>();\n for (const dispatcher of this.kernel.domains().viewDispatchers()) {\n for (const view of dispatcher.flatComponentTree) {\n views.add(view);\n }\n }\n return Array.from(views);\n }\n\n /**\n * The hosts the dev server's Vite may answer: the `route.domains` root and\n * its subdomains, or any host when custom domains are on, since those are\n * only known to the app's resolver.\n */\n public devAllowedHosts(): true | string[] {\n const domains = this.kernel.domains();\n if (!domains.resolver) {\n return [];\n }\n return domains.acceptsCustomDomains ? true : [`.${domains.resolver.root}`];\n }\n\n public getRouteManifest() {\n return this.kernel.viewRoutes().routeManifest;\n }\n\n // Requests `withGlobalMiddleware` already ran the global middleware for, so\n // `fetch` inside it does not run the list a second time, and can still hand\n // the route what the list carried. Keyed by the Request object: the servers\n // hand `fetch` the same one they gated.\n private globallyGated = new WeakMap<Request, CarriedContext | null>();\n\n /**\n * Runs the `global` middleware list, then `next` — what the servers put in\n * front of everything they serve, so the list covers static files, which\n * never reach `fetch`, as well as routes. A refusal is answered without\n * calling `next`. A global middleware that throws something other than a\n * break is answered by `onError` rather than by `next`, since a gate that\n * failed must not let a static file through.\n */\n public async withGlobalMiddleware(\n req: Request,\n next: (req: Request) => Promise<Response>,\n onError: (err: unknown) => Response | Promise<Response>,\n ): Promise<Response> {\n let outcome: Awaited<ReturnType<Kernel[\"globalMiddleware\"]>>;\n try {\n outcome = await this.kernel.run.call(this.kernel, () => this.kernel.globalMiddleware(req));\n } catch (err) {\n return await onError(err);\n }\n if (outcome.refusal) {\n return outcome.refusal;\n }\n this.globallyGated.set(req, outcome.carried);\n return outcome.apply(await next(req));\n }\n\n public async fetch(req: Request): Promise<Response> {\n const url = new URL(req.url);\n return this.kernel.run.call(this.kernel, async () => {\n // Run here too for a caller that is not one of the servers, a test or an\n // app's own `Bun.serve`, so the list is not skipped by calling `fetch`.\n const gated = this.globallyGated.has(req);\n const outcome = gated ? null : await this.kernel.globalMiddleware(req);\n const carried = gated ? this.globallyGated.get(req) : outcome.carried;\n if (outcome?.refusal) {\n return outcome.refusal;\n }\n const domains = this.kernel.domains();\n const dispatchers = (await domains.ask(req)) ?? (await domains.route(req));\n if (dispatchers instanceof Response) {\n return outcome ? outcome.apply(dispatchers) : dispatchers;\n }\n if (!dispatchers) {\n const unknown = new Response(\"Unknown host\", { status: 404 });\n return outcome ? outcome.apply(unknown) : unknown;\n }\n const result = isApiPath(url.pathname)\n ? await dispatchers.api.handleApiRequest(req, carried)\n : await dispatchers.view.handleViewRequest(req, carried);\n if (!outcome) {\n return result;\n }\n // A document comes back as a render function the server calls with its\n // manifests, and the Response only exists once it has.\n if (typeof result === \"function\") {\n const render = result as (...args: any[]) => Promise<Response>;\n return (async (...args: any[]) => outcome.apply(await render(...args))) as any;\n }\n return outcome.apply(result);\n });\n }\n\n public dispatchJob(jobName: string, args: string) {\n const kernelRun = this.kernel.run.bind(this.kernel);\n return kernelRun(() => {\n return this.kernel.queue().dispatchJob(jobName, args);\n });\n }\n\n /** Every provider's `shutdown()`; see `Kernel.shutdown`. */\n public shutdown(options?: { timeoutMs?: number }) {\n return this.kernel.shutdown(options);\n }\n\n public destroy() {\n this.kernel.destroy();\n }\n\n public clone() {\n return Object.assign(Object.create(Object.getPrototypeOf(this)), this);\n }\n}\n\nexport type FetchHandler = InstanceType<typeof App>[\"fetch\"];\n"
6
6
  ],
7
7
  "mappings": ";yCASO,MAAM,CAAI,CACP,OACD,YAEP,WAAW,CAAC,EAAmB,CAC7B,KAAK,OAAS,IAAI,EAAO,OACzB,KAAK,OAAO,KAAK,KAAK,KAAK,MAAM,EACjC,KAAK,YACH,EAAO,cACN,CAAC,IAAiB,CACjB,QAAQ,MAAM,8BAA+B,CAAK,SAc3C,YAAW,EAAG,CACzB,MAAM,KAAK,OAAO,YAAY,EAGzB,gBAAgB,EAAG,CACxB,OAAO,KAAK,OAAO,WAAW,EAAE,cAM3B,oBAAoB,EAAG,CAC5B,IAAM,EAAQ,IAAI,IAClB,QAAW,KAAc,KAAK,OAAO,QAAQ,EAAE,gBAAgB,EAC7D,QAAW,KAAQ,EAAW,kBAC5B,EAAM,IAAI,CAAI,EAGlB,OAAO,MAAM,KAAK,CAAK,EAQlB,eAAe,EAAoB,CACxC,IAAM,EAAU,KAAK,OAAO,QAAQ,EACpC,GAAI,CAAC,EAAQ,SACX,MAAO,CAAC,EAEV,OAAO,EAAQ,qBAAuB,GAAO,CAAC,IAAI,EAAQ,SAAS,MAAM,EAGpE,gBAAgB,EAAG,CACxB,OAAO,KAAK,OAAO,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AM,MAAM,EAAO,GAAG,CAAI,CAAC,EAEvE,OAAO,EAAQ,MAAM,CAAM,EAC5B,EAGI,WAAW,CAAC,EAAiB,EAAc,CAEhD,OADkB,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM,EACjC,IAAM,CACrB,OAAO,KAAK,OAAO,MAAM,EAAE,YAAY,EAAS,CAAI,EACrD,EAII,QAAQ,CAAC,EAAkC,CAChD,OAAO,KAAK,OAAO,SAAS,CAAO,EAG9B,OAAO,EAAG,CACf,KAAK,OAAO,QAAQ,EAGf,KAAK,EAAG,CACb,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,eAAe,IAAI,CAAC,EAAG,IAAI,EAEzE",
8
- "debugId": "770C74BA90540D4964756E2164756E21",
8
+ "debugId": "15A22E94F811B85764756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Kg as a}from"./chunk-9tsw1bmt.js";var i=a((f)=>{function u(t){let r={};if(t=t.replace(/^\?/,""),t)for(let n of t.split("&")){let[e,s=null]=n.split("=");if(e=decodeURIComponent(e),s)s=decodeURIComponent(s);if(!(e in r))r[e]=s;else if(Array.isArray(r[e]))r[e].push(s);else r[e]=[r[e],s]}return r}f.parseQueryString=u});var U=a((d)=>{var y=i(),c=(t)=>{if(typeof t==="string")return c(new URL(t));let{hostname:r,pathname:n,port:e,protocol:s,search:o}=t,p;if(o)p=y.parseQueryString(o);return{hostname:r,port:e?parseInt(e):void 0,protocol:s,path:n,query:p}};d.parseUrl=c});
2
+ import{Lg as a}from"./chunk-3bjj31n9.js";var i=a((f)=>{function u(t){let r={};if(t=t.replace(/^\?/,""),t)for(let n of t.split("&")){let[e,s=null]=n.split("=");if(e=decodeURIComponent(e),s)s=decodeURIComponent(s);if(!(e in r))r[e]=s;else if(Array.isArray(r[e]))r[e].push(s);else r[e]=[r[e],s]}return r}f.parseQueryString=u});var U=a((d)=>{var y=i(),c=(t)=>{if(typeof t==="string")return c(new URL(t));let{hostname:r,pathname:n,port:e,protocol:s,search:o}=t,p;if(o)p=y.parseQueryString(o);return{hostname:r,port:e?parseInt(e):void 0,protocol:s,path:n,query:p}};d.parseUrl=c});
3
3
  export{U as Z};
4
4
 
5
- //# debugId=CF8E270DE3BDC11864756E2164756E21
5
+ //# debugId=6AAC1FA792FDAEC264756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "'use strict';\n\nvar querystringParser = require('@smithy/querystring-parser');\n\nconst parseUrl = (url) => {\n if (typeof url === \"string\") {\n return parseUrl(new URL(url));\n }\n const { hostname, pathname, port, protocol, search } = url;\n let query;\n if (search) {\n query = querystringParser.parseQueryString(search);\n }\n return {\n hostname,\n port: port ? parseInt(port) : undefined,\n protocol,\n path: pathname,\n query,\n };\n};\n\nexports.parseUrl = parseUrl;\n"
7
7
  ],
8
8
  "mappings": ";uDAEA,SAAS,CAAgB,CAAC,EAAa,CACnC,IAAM,EAAQ,CAAC,EAEf,GADA,EAAc,EAAY,QAAQ,MAAO,EAAE,EACvC,EACA,QAAW,KAAQ,EAAY,MAAM,GAAG,EAAG,CACvC,IAAK,EAAK,EAAQ,MAAQ,EAAK,MAAM,GAAG,EAExC,GADA,EAAM,mBAAmB,CAAG,EACxB,EACA,EAAQ,mBAAmB,CAAK,EAEpC,GAAI,EAAE,KAAO,GACT,EAAM,GAAO,EAEZ,QAAI,MAAM,QAAQ,EAAM,EAAI,EAC7B,EAAM,GAAK,KAAK,CAAK,EAGrB,OAAM,GAAO,CAAC,EAAM,GAAM,CAAK,EAI3C,OAAO,EAGH,mBAAmB,kBCxB3B,IAAI,MAEE,EAAW,CAAC,IAAQ,CACtB,GAAI,OAAO,IAAQ,SACf,OAAO,EAAS,IAAI,IAAI,CAAG,CAAC,EAEhC,IAAQ,WAAU,WAAU,OAAM,WAAU,UAAW,EACnD,EACJ,GAAI,EACA,EAAQ,EAAkB,iBAAiB,CAAM,EAErD,MAAO,CACH,WACA,KAAM,EAAO,SAAS,CAAI,EAAI,OAC9B,WACA,KAAM,EACN,OACJ,GAGI,WAAW",
9
- "debugId": "CF8E270DE3BDC11864756E2164756E21",
9
+ "debugId": "6AAC1FA792FDAEC264756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{H as A}from"./chunk-xckeyg3v.js";import{V as I}from"./chunk-zf4r4kat.js";import"./chunk-y7qnx8vm.js";import{$ as f}from"./chunk-81v4c4b1.js";import{Jg as t,Ng as T}from"./chunk-9tsw1bmt.js";var N=t(I(),1),a=t(f(),1),d=t(A(),1);import{readFileSync as g}from"fs";var c=(e)=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:o,roleSessionName:r,webIdentityToken:i,providerId:n,policyArns:m,policy:S,durationSeconds:l}=e,{roleAssumerWithWebIdentity:E}=e;if(!E){let{getDefaultRoleAssumerWithWebIdentity:p}=await import("./chunk-zs90w6ke.js").then((m)=>t(m.default,1));E=p({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...s?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return E({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:n,PolicyArns:m,Policy:S,DurationSeconds:l})};var _="AWS_WEB_IDENTITY_TOKEN_FILE",O="AWS_ROLE_ARN",k="AWS_ROLE_SESSION_NAME",L=(e={})=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[_],r=e?.roleArn??process.env[O],i=e?.roleSessionName??process.env[k];if(!o||!r)throw new a.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});let n=await c({...e,webIdentityToken:d.externalDataInterceptor?.getTokenRecord?.()[o]??g(o,{encoding:"ascii"}),roleArn:r,roleSessionName:i})(s);if(o===process.env[_])N.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{c as fromWebToken,L as fromTokenFile};
2
+ import{H as A}from"./chunk-27k2zsq8.js";import{V as I}from"./chunk-mxmw42c1.js";import"./chunk-ryj4wqcp.js";import{$ as f}from"./chunk-f6qhsdsn.js";import{Kg as t,Og as T}from"./chunk-3bjj31n9.js";var N=t(I(),1),a=t(f(),1),d=t(A(),1);import{readFileSync as g}from"fs";var c=(e)=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:o,roleSessionName:r,webIdentityToken:i,providerId:n,policyArns:m,policy:S,durationSeconds:l}=e,{roleAssumerWithWebIdentity:E}=e;if(!E){let{getDefaultRoleAssumerWithWebIdentity:p}=await import("./chunk-tkhrvd30.js").then((m)=>t(m.default,1));E=p({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...s?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return E({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:n,PolicyArns:m,Policy:S,DurationSeconds:l})};var _="AWS_WEB_IDENTITY_TOKEN_FILE",O="AWS_ROLE_ARN",k="AWS_ROLE_SESSION_NAME",L=(e={})=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[_],r=e?.roleArn??process.env[O],i=e?.roleSessionName??process.env[k];if(!o||!r)throw new a.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});let n=await c({...e,webIdentityToken:d.externalDataInterceptor?.getTokenRecord?.()[o]??g(o,{encoding:"ascii"}),roleArn:r,roleSessionName:i})(s);if(o===process.env[_])N.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{c as fromWebToken,L as fromTokenFile};
3
3
 
4
- //# debugId=D29AAFB5BB53983F64756E2164756E21
4
+ //# debugId=08D8CA6AC890CF0C64756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "export const fromWebToken = (init) => async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-web-identity - fromWebToken\");\n const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;\n let { roleAssumerWithWebIdentity } = init;\n if (!roleAssumerWithWebIdentity) {\n const { getDefaultRoleAssumerWithWebIdentity } = await import(\"@aws-sdk/nested-clients/sts\");\n roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({\n ...init.clientConfig,\n credentialProviderLogger: init.logger,\n parentClientConfig: {\n ...awsIdentityProperties?.callerClientConfig,\n ...init.parentClientConfig,\n },\n }, init.clientPlugins);\n }\n return roleAssumerWithWebIdentity({\n RoleArn: roleArn,\n RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,\n WebIdentityToken: webIdentityToken,\n ProviderId: providerId,\n PolicyArns: policyArns,\n Policy: policy,\n DurationSeconds: durationSeconds,\n });\n};\n"
7
7
  ],
8
8
  "mappings": ";6NAAA,SACA,KACA,KACA,iBAAS,WCHF,IAAM,EAAe,CAAC,IAAS,MAAO,IAA0B,CACnE,EAAK,QAAQ,MAAM,0DAA0D,EAC7E,IAAQ,UAAS,kBAAiB,mBAAkB,aAAY,aAAY,SAAQ,mBAAoB,GAClG,8BAA+B,EACrC,GAAI,CAAC,EAA4B,CAC7B,IAAQ,wCAAyC,KAAa,yDAC9D,EAA6B,EAAqC,IAC3D,EAAK,aACR,yBAA0B,EAAK,OAC/B,mBAAoB,IACb,GAAuB,sBACvB,EAAK,kBACZ,CACJ,EAAG,EAAK,aAAa,EAEzB,OAAO,EAA2B,CAC9B,QAAS,EACT,gBAAiB,GAAmB,sBAAsB,KAAK,IAAI,IACnE,iBAAkB,EAClB,WAAY,EACZ,WAAY,EACZ,OAAQ,EACR,gBAAiB,CACrB,CAAC,GDlBL,IAAM,EAAiB,8BACjB,EAAe,eACf,EAAwB,wBACjB,EAAgB,CAAC,EAAO,CAAC,IAAM,MAAO,IAA0B,CACzE,EAAK,QAAQ,MAAM,2DAA2D,EAC9E,IAAM,E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