gemi 0.190.0 → 0.192.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 (221) hide show
  1. package/dist/ai/Agent.d.ts +28 -1
  2. package/dist/ai/Agent.d.ts.map +1 -1
  3. package/dist/ai/AgentController.d.ts +143 -3
  4. package/dist/ai/AgentController.d.ts.map +1 -1
  5. package/dist/ai/client/index.d.ts +1 -1
  6. package/dist/ai/client/index.d.ts.map +1 -1
  7. package/dist/ai/client/index.js +59 -1
  8. package/dist/ai/client/index.js.map +1 -1
  9. package/dist/ai/index.d.ts +3 -3
  10. package/dist/ai/index.d.ts.map +1 -1
  11. package/dist/ai/index.js +91 -68
  12. package/dist/ai/index.js.map +5 -5
  13. package/dist/ai/jobs/AgentJob.d.ts +32 -0
  14. package/dist/ai/jobs/AgentJob.d.ts.map +1 -1
  15. package/dist/ai/jobs/index.d.ts +1 -1
  16. package/dist/ai/jobs/index.d.ts.map +1 -1
  17. package/dist/ai/store/DatabaseAgentStore.d.ts +66 -3
  18. package/dist/ai/store/DatabaseAgentStore.d.ts.map +1 -1
  19. package/dist/ai/store/MemoryAgentStore.d.ts +12 -0
  20. package/dist/ai/store/MemoryAgentStore.d.ts.map +1 -1
  21. package/dist/ai/types.d.ts +18 -0
  22. package/dist/ai/types.d.ts.map +1 -1
  23. package/dist/ai/useChat.d.ts +15 -0
  24. package/dist/ai/useChat.d.ts.map +1 -1
  25. package/dist/app/index.js +1 -1
  26. package/dist/bun/plugin.js +1 -1
  27. package/dist/bun/preload.js +1 -1
  28. package/dist/{chunk-6z3wv71t.js → chunk-0m1a636t.js} +2 -2
  29. package/dist/{chunk-6z3wv71t.js.map → chunk-0m1a636t.js.map} +1 -1
  30. package/dist/{chunk-00g20rfa.js → chunk-0mb77yd2.js} +2 -2
  31. package/dist/{chunk-00g20rfa.js.map → chunk-0mb77yd2.js.map} +1 -1
  32. package/dist/{chunk-qz6grt61.js → chunk-0p76bhy2.js} +2 -2
  33. package/dist/{chunk-qz6grt61.js.map → chunk-0p76bhy2.js.map} +1 -1
  34. package/dist/{chunk-zwj4w4zt.js → chunk-17mdszc3.js} +2 -2
  35. package/dist/{chunk-zwj4w4zt.js.map → chunk-17mdszc3.js.map} +1 -1
  36. package/dist/{chunk-yt5n62nj.js → chunk-199nvtrj.js} +2 -2
  37. package/dist/{chunk-yt5n62nj.js.map → chunk-199nvtrj.js.map} +1 -1
  38. package/dist/{chunk-w2z4jc4v.js → chunk-1mpwzjxa.js} +3 -3
  39. package/dist/{chunk-w2z4jc4v.js.map → chunk-1mpwzjxa.js.map} +1 -1
  40. package/dist/{chunk-dsgjdk94.js → chunk-24jgzc8y.js} +2 -2
  41. package/dist/{chunk-dsgjdk94.js.map → chunk-24jgzc8y.js.map} +1 -1
  42. package/dist/{chunk-fgk1e5xe.js → chunk-4s7st9y4.js} +3 -3
  43. package/dist/{chunk-fgk1e5xe.js.map → chunk-4s7st9y4.js.map} +1 -1
  44. package/dist/{chunk-epb0qfce.js → chunk-5zx4e2wa.js} +3 -3
  45. package/dist/{chunk-epb0qfce.js.map → chunk-5zx4e2wa.js.map} +1 -1
  46. package/dist/{chunk-s5z8qcdv.js → chunk-67ex6nem.js} +3 -3
  47. package/dist/{chunk-s5z8qcdv.js.map → chunk-67ex6nem.js.map} +1 -1
  48. package/dist/{chunk-790dx3s7.js → chunk-67zz58cw.js} +2 -2
  49. package/dist/{chunk-790dx3s7.js.map → chunk-67zz58cw.js.map} +1 -1
  50. package/dist/{chunk-kcg2znz2.js → chunk-6frbegay.js} +2 -2
  51. package/dist/{chunk-kcg2znz2.js.map → chunk-6frbegay.js.map} +1 -1
  52. package/dist/{chunk-0gvw46j0.js → chunk-6n44t4hn.js} +2 -2
  53. package/dist/{chunk-0gvw46j0.js.map → chunk-6n44t4hn.js.map} +1 -1
  54. package/dist/{chunk-baknm4tn.js → chunk-6rmz0mkm.js} +2 -2
  55. package/dist/{chunk-baknm4tn.js.map → chunk-6rmz0mkm.js.map} +1 -1
  56. package/dist/{chunk-k9f7gww2.js → chunk-6wsmdf51.js} +2 -2
  57. package/dist/{chunk-k9f7gww2.js.map → chunk-6wsmdf51.js.map} +1 -1
  58. package/dist/{chunk-2v7a5wv6.js → chunk-7k43y71n.js} +2 -2
  59. package/dist/{chunk-2v7a5wv6.js.map → chunk-7k43y71n.js.map} +1 -1
  60. package/dist/{chunk-er7xemh2.js → chunk-7ynahcy6.js} +2 -2
  61. package/dist/{chunk-er7xemh2.js.map → chunk-7ynahcy6.js.map} +1 -1
  62. package/dist/{chunk-7des5zys.js → chunk-7zpjdwfq.js} +3 -3
  63. package/dist/{chunk-7des5zys.js.map → chunk-7zpjdwfq.js.map} +1 -1
  64. package/dist/{chunk-yn2av14e.js → chunk-8em2ebj1.js} +2 -2
  65. package/dist/{chunk-yn2av14e.js.map → chunk-8em2ebj1.js.map} +1 -1
  66. package/dist/{chunk-nc37phkt.js → chunk-8pfy75y6.js} +3 -3
  67. package/dist/{chunk-nc37phkt.js.map → chunk-8pfy75y6.js.map} +1 -1
  68. package/dist/{chunk-8f8bp75w.js → chunk-8zeky0fj.js} +5 -5
  69. package/dist/{chunk-8f8bp75w.js.map → chunk-8zeky0fj.js.map} +3 -3
  70. package/dist/{chunk-khzss89b.js → chunk-9dfrsj4m.js} +2 -2
  71. package/dist/{chunk-khzss89b.js.map → chunk-9dfrsj4m.js.map} +1 -1
  72. package/dist/{chunk-fcj0e64h.js → chunk-9hmm8acy.js} +1 -1
  73. package/dist/{chunk-rp2h86ph.js → chunk-9m04tdzh.js} +1 -1
  74. package/dist/{chunk-71jcjnwk.js → chunk-bd14zwmj.js} +25 -21
  75. package/dist/{chunk-71jcjnwk.js.map → chunk-bd14zwmj.js.map} +4 -4
  76. package/dist/{chunk-g52hvs5q.js → chunk-bhfwp3gz.js} +2 -2
  77. package/dist/{chunk-g52hvs5q.js.map → chunk-bhfwp3gz.js.map} +1 -1
  78. package/dist/{chunk-2adfcfdw.js → chunk-bm7z4vj9.js} +2 -2
  79. package/dist/{chunk-2adfcfdw.js.map → chunk-bm7z4vj9.js.map} +1 -1
  80. package/dist/{chunk-e9nmsgnd.js → chunk-c36sbvnz.js} +2 -2
  81. package/dist/{chunk-e9nmsgnd.js.map → chunk-c36sbvnz.js.map} +1 -1
  82. package/dist/{chunk-x1ng1dnx.js → chunk-ccx7rt7y.js} +2 -2
  83. package/dist/{chunk-x1ng1dnx.js.map → chunk-ccx7rt7y.js.map} +1 -1
  84. package/dist/{chunk-xqzrd7st.js → chunk-ce73s4kh.js} +2 -2
  85. package/dist/{chunk-xqzrd7st.js.map → chunk-ce73s4kh.js.map} +1 -1
  86. package/dist/{chunk-3z55zyfe.js → chunk-cx3n8qyr.js} +2 -2
  87. package/dist/{chunk-3z55zyfe.js.map → chunk-cx3n8qyr.js.map} +1 -1
  88. package/dist/{chunk-xwa8vtg5.js → chunk-d0khszc9.js} +2 -2
  89. package/dist/{chunk-xwa8vtg5.js.map → chunk-d0khszc9.js.map} +1 -1
  90. package/dist/{chunk-frvca65w.js → chunk-efgemgbe.js} +2 -2
  91. package/dist/{chunk-frvca65w.js.map → chunk-efgemgbe.js.map} +1 -1
  92. package/dist/{chunk-6tsyk2mr.js → chunk-ejc0mbe3.js} +2 -2
  93. package/dist/{chunk-6tsyk2mr.js.map → chunk-ejc0mbe3.js.map} +1 -1
  94. package/dist/{chunk-hv6nbbty.js → chunk-etzd00a8.js} +2 -2
  95. package/dist/{chunk-hv6nbbty.js.map → chunk-etzd00a8.js.map} +1 -1
  96. package/dist/{chunk-6a3t825g.js → chunk-f02anz24.js} +2 -2
  97. package/dist/{chunk-6a3t825g.js.map → chunk-f02anz24.js.map} +1 -1
  98. package/dist/{chunk-qy678j5z.js → chunk-fbxnxze2.js} +1 -1
  99. package/dist/{chunk-j16ekp16.js → chunk-freerpzc.js} +1 -1
  100. package/dist/{chunk-h8knqrc5.js → chunk-fryj3asn.js} +2 -2
  101. package/dist/{chunk-h8knqrc5.js.map → chunk-fryj3asn.js.map} +1 -1
  102. package/dist/{chunk-vzzt4kpk.js → chunk-h688s2ba.js} +2 -2
  103. package/dist/{chunk-vzzt4kpk.js.map → chunk-h688s2ba.js.map} +1 -1
  104. package/dist/{chunk-bc1k2206.js → chunk-hwq0kk1d.js} +1 -1
  105. package/dist/{chunk-mvs6brkk.js → chunk-j34ektzj.js} +2 -2
  106. package/dist/{chunk-mvs6brkk.js.map → chunk-j34ektzj.js.map} +1 -1
  107. package/dist/{chunk-ds684s0w.js → chunk-jbee3n3p.js} +2 -2
  108. package/dist/{chunk-ds684s0w.js.map → chunk-jbee3n3p.js.map} +1 -1
  109. package/dist/{chunk-80kpxp4m.js → chunk-k1c0xd8r.js} +2 -2
  110. package/dist/{chunk-80kpxp4m.js.map → chunk-k1c0xd8r.js.map} +1 -1
  111. package/dist/{chunk-tmz3gf96.js → chunk-k8gn0q91.js} +1 -1
  112. package/dist/{chunk-8p7a2ctj.js → chunk-m3180wkp.js} +2 -2
  113. package/dist/{chunk-8p7a2ctj.js.map → chunk-m3180wkp.js.map} +1 -1
  114. package/dist/{chunk-s1wj0ff8.js → chunk-m37vvh99.js} +2 -2
  115. package/dist/{chunk-s1wj0ff8.js.map → chunk-m37vvh99.js.map} +1 -1
  116. package/dist/{chunk-mmzf9c2e.js → chunk-m4r8btey.js} +2 -2
  117. package/dist/{chunk-mmzf9c2e.js.map → chunk-m4r8btey.js.map} +1 -1
  118. package/dist/{chunk-8mgz2na4.js → chunk-mdrsec0r.js} +2 -2
  119. package/dist/{chunk-8mgz2na4.js.map → chunk-mdrsec0r.js.map} +1 -1
  120. package/dist/{chunk-nbhxm3sz.js → chunk-mx9zcq7w.js} +2 -2
  121. package/dist/{chunk-nbhxm3sz.js.map → chunk-mx9zcq7w.js.map} +1 -1
  122. package/dist/{chunk-t6ng9yxp.js → chunk-p00rd4ja.js} +2 -2
  123. package/dist/{chunk-t6ng9yxp.js.map → chunk-p00rd4ja.js.map} +1 -1
  124. package/dist/{chunk-rf4a3tnm.js → chunk-qfb6r3cq.js} +3 -3
  125. package/dist/{chunk-rf4a3tnm.js.map → chunk-qfb6r3cq.js.map} +1 -1
  126. package/dist/{chunk-352y2y3z.js → chunk-qg60pgve.js} +2 -2
  127. package/dist/{chunk-352y2y3z.js.map → chunk-qg60pgve.js.map} +1 -1
  128. package/dist/{chunk-2qqm3482.js → chunk-qnc840pb.js} +2 -2
  129. package/dist/{chunk-2qqm3482.js.map → chunk-qnc840pb.js.map} +1 -1
  130. package/dist/{chunk-mqvyhqa6.js → chunk-r7vnxqck.js} +2 -2
  131. package/dist/{chunk-mqvyhqa6.js.map → chunk-r7vnxqck.js.map} +1 -1
  132. package/dist/{chunk-bwmyd47e.js → chunk-rf9c6e49.js} +2 -2
  133. package/dist/{chunk-bwmyd47e.js.map → chunk-rf9c6e49.js.map} +1 -1
  134. package/dist/{chunk-1987f978.js → chunk-ryfty6mj.js} +3 -3
  135. package/dist/{chunk-1987f978.js.map → chunk-ryfty6mj.js.map} +1 -1
  136. package/dist/{chunk-6bhscseq.js → chunk-sqev442x.js} +4 -4
  137. package/dist/{chunk-6bhscseq.js.map → chunk-sqev442x.js.map} +1 -1
  138. package/dist/{chunk-npd1501w.js → chunk-t86nc1jd.js} +2 -2
  139. package/dist/{chunk-npd1501w.js.map → chunk-t86nc1jd.js.map} +1 -1
  140. package/dist/{chunk-qp1nzdjc.js → chunk-thq8tc9x.js} +3 -3
  141. package/dist/{chunk-qp1nzdjc.js.map → chunk-thq8tc9x.js.map} +1 -1
  142. package/dist/{chunk-cbw4676x.js → chunk-tngf3h1g.js} +2 -2
  143. package/dist/{chunk-cbw4676x.js.map → chunk-tngf3h1g.js.map} +1 -1
  144. package/dist/{chunk-n415vvxw.js → chunk-tt5qk0xt.js} +2 -2
  145. package/dist/{chunk-n415vvxw.js.map → chunk-tt5qk0xt.js.map} +1 -1
  146. package/dist/{chunk-b35mk5rd.js → chunk-tvsjq0my.js} +2 -2
  147. package/dist/{chunk-b35mk5rd.js.map → chunk-tvsjq0my.js.map} +1 -1
  148. package/dist/{chunk-2k948anx.js → chunk-vr48swd0.js} +2 -2
  149. package/dist/{chunk-2k948anx.js.map → chunk-vr48swd0.js.map} +1 -1
  150. package/dist/{chunk-sz0avnch.js → chunk-wa1xmvgr.js} +2 -2
  151. package/dist/{chunk-sz0avnch.js.map → chunk-wa1xmvgr.js.map} +1 -1
  152. package/dist/chunk-waq4kj7n.js +5 -0
  153. package/dist/{chunk-qv3y19h5.js.map → chunk-waq4kj7n.js.map} +1 -1
  154. package/dist/{chunk-8b897pc1.js → chunk-xsx69765.js} +2 -2
  155. package/dist/{chunk-8b897pc1.js.map → chunk-xsx69765.js.map} +1 -1
  156. package/dist/{chunk-eqnrk0p8.js → chunk-xwz5fmwy.js} +2 -2
  157. package/dist/{chunk-eqnrk0p8.js.map → chunk-xwz5fmwy.js.map} +1 -1
  158. package/dist/{chunk-ct2kqpv5.js → chunk-xzz6ps4z.js} +2 -2
  159. package/dist/{chunk-ct2kqpv5.js.map → chunk-xzz6ps4z.js.map} +1 -1
  160. package/dist/{chunk-s91xa67z.js → chunk-y67rmd3y.js} +2 -2
  161. package/dist/{chunk-s91xa67z.js.map → chunk-y67rmd3y.js.map} +1 -1
  162. package/dist/{chunk-1e7pnsx2.js → chunk-z1aeh05w.js} +3 -3
  163. package/dist/{chunk-1e7pnsx2.js.map → chunk-z1aeh05w.js.map} +1 -1
  164. package/dist/{chunk-070cacy8.js → chunk-z7mbhc68.js} +2 -2
  165. package/dist/{chunk-070cacy8.js.map → chunk-z7mbhc68.js.map} +1 -1
  166. package/dist/{chunk-pjjwbs2f.js → chunk-z8dxdqzm.js} +2 -2
  167. package/dist/{chunk-pjjwbs2f.js.map → chunk-z8dxdqzm.js.map} +1 -1
  168. package/dist/{chunk-9q5g3a9t.js → chunk-z9pq557m.js} +2 -2
  169. package/dist/{chunk-9q5g3a9t.js.map → chunk-z9pq557m.js.map} +1 -1
  170. package/dist/{chunk-dhwxcedm.js → chunk-zcrhagx5.js} +2 -2
  171. package/dist/{chunk-dhwxcedm.js.map → chunk-zcrhagx5.js.map} +1 -1
  172. package/dist/client/Head.d.ts +26 -1
  173. package/dist/client/Head.d.ts.map +1 -1
  174. package/dist/client/index.d.ts +1 -1
  175. package/dist/client/index.d.ts.map +1 -1
  176. package/dist/client/index.js +17 -2
  177. package/dist/client/index.js.map +1 -1
  178. package/dist/config/index.js +1 -1
  179. package/dist/console/run.js +2 -2
  180. package/dist/console/run.js.map +1 -1
  181. package/dist/container/index.js +2 -2
  182. package/dist/container/index.js.map +1 -1
  183. package/dist/database/index.js +2 -2
  184. package/dist/database/index.js.map +1 -1
  185. package/dist/email/index.js +2 -2
  186. package/dist/email/index.js.map +1 -1
  187. package/dist/facades/index.js +1 -1
  188. package/dist/foundation/index.js +2 -2
  189. package/dist/foundation/index.js.map +1 -1
  190. package/dist/http/ApiRouter.d.ts +1 -0
  191. package/dist/http/ApiRouter.d.ts.map +1 -1
  192. package/dist/http/index.js +2 -2
  193. package/dist/http/index.js.map +1 -1
  194. package/dist/i18n/dictionaryRuntime.js +2 -2
  195. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  196. package/dist/i18n/index.js +2 -2
  197. package/dist/i18n/index.js.map +1 -1
  198. package/dist/kernel/index.js +2 -2
  199. package/dist/kernel/index.js.map +1 -1
  200. package/dist/orm/index.js +2 -2
  201. package/dist/orm/index.js.map +1 -1
  202. package/dist/probe/index.js +2 -2
  203. package/dist/probe/index.js.map +1 -1
  204. package/dist/server/index.js +2 -2
  205. package/dist/server/index.js.map +1 -1
  206. package/dist/services/index.js +2 -2
  207. package/dist/services/index.js.map +1 -1
  208. package/dist/services/queue/work.js +2 -2
  209. package/dist/services/queue/work.js.map +1 -1
  210. package/dist/stats/route-table.js +1 -1
  211. package/dist/support/index.js +2 -2
  212. package/dist/support/index.js.map +1 -1
  213. package/dist/vitest/index.js +1 -1
  214. package/package.json +1 -1
  215. package/dist/chunk-qv3y19h5.js +0 -5
  216. /package/dist/{chunk-fcj0e64h.js.map → chunk-9hmm8acy.js.map} +0 -0
  217. /package/dist/{chunk-rp2h86ph.js.map → chunk-9m04tdzh.js.map} +0 -0
  218. /package/dist/{chunk-qy678j5z.js.map → chunk-fbxnxze2.js.map} +0 -0
  219. /package/dist/{chunk-j16ekp16.js.map → chunk-freerpzc.js.map} +0 -0
  220. /package/dist/{chunk-bc1k2206.js.map → chunk-hwq0kk1d.js.map} +0 -0
  221. /package/dist/{chunk-tmz3gf96.js.map → chunk-k8gn0q91.js.map} +0 -0
@@ -5,6 +5,6 @@
5
5
  "import { existsSync, readdirSync } from \"node:fs\";\nimport { join, relative } from \"node:path\";\n\n/**\n * Finding the classes an application declared and never imported — the walk\n * #322 and #323 both end at.\n *\n * ### Why it has to run the files\n *\n * A job that is written and not listed does not fail; it disappears.\n * `QueueManager.run` looks a dispatched name up in the map its config built and\n * drops what is not there, so the dispatch is simply lost. A cron drifts worse:\n * nothing is waiting on a tick, so a job that never fires reports nothing to\n * anyone. What both come down to is that `app/config/queue.ts` naming every\n * `Job` subclass is the *only* thing putting those classes in the module graph —\n * the list and the directory are two spellings of one set, kept in step by hand.\n *\n * The way out of that is to read the directory, and there is no static read that\n * will do: the class does not exist until its module has run. So **every file\n * walked here is imported**, and a file that *does something* when imported does\n * it here — at boot, in production, on every start. `gemi check models` makes\n * the same trade for the same reason and pays it once per CI run; a caller of\n * this pays it once per process.\n *\n * ### What that asks of a caller\n *\n * **Point it at a directory of class declarations, not at `app/`.** The skip\n * rules on `sourceFiles` drop what certainly is not one — tests, benchmarks,\n * `.d.ts`, vendored packages — and nothing else. Widening the guesses is how a\n * discovery pass ends up quietly covering less than the directory holds, which\n * is the same silence in a new place.\n *\n * **Let a broken file stop the boot.** `discoverClasses` rethrows an import\n * failure naming the file rather than dropping it and carrying on, for the same\n * reason: four classes found out of five looks exactly like five out of five.\n *\n * **Leave a way out.** Discovery is what should happen when an app said\n * nothing. An app that lists its classes explicitly must not reach this file at\n * all — that is the escape hatch for a directory holding something this cannot\n * import, and it is the sentence an error from here should point at.\n *\n * ### One more thing worth knowing\n *\n * This imports by absolute path, while the application imports the same files\n * through the `@/app/*` alias. Bun keys its module registry by the *resolved*\n * path, so those two specifiers land on one module: a job already reached from\n * a controller is not evaluated a second time here, and the class object is the\n * same one. `gemi build` leaves that true in production — `packages: \"external\"`\n * keeps the app's own code out of `dist/server/server.mjs` and resolves it from\n * source at runtime, exactly as `gemi dev` does.\n *\n * Nothing here depends on that holding, and deliberately: `QueueManager` and the\n * `Scheduler`'s cross-reload registry are both keyed by name rather than by\n * class identity, so a build that did inline the app's modules would produce a\n * duplicate class object and still register the right job. Worth knowing before\n * writing a registry keyed the other way.\n */\n\n/**\n * The files under `dir` that could declare a class.\n *\n * Everything underneath it, because apps do group classes into folders, minus\n * what cannot be one. Each of these is going to be *imported*, so the exclusions\n * are about what is certainly not source rather than about what is probably not:\n *\n * - **Declaration files.** `.d.ts` has no runtime module behind it.\n * - **Tests, type tests and benchmarks**, by the suffix a runner already\n * recognises.\n * - **Dot-directories and `node_modules`.**\n * - **Any directory holding a `package.json`.** That is a package that happens\n * to live here — a vendored client, a generated SDK — not this app's source,\n * and importing its entry point runs somebody else's module graph. The\n * template has two under `app/models`.\n *\n * `ignore` is the escape hatch for the rest: a path prefix, relative to `dir`,\n * naming a file or a directory of adjacent code that runs something on import.\n * Nothing is ignored by default.\n *\n * The order is the same on every run over the same tree, which matters because\n * the caller is going to import in it: entries are sorted per directory before\n * recursing, and `readdirSync` order is the filesystem's rather than\n * alphabetical — a tree written `A.ts` then `B.ts` reads back `B.ts` first on\n * the machines this was tested on. Sorting per directory rather than sorting the\n * finished list is deliberate: for a tree holding both `a.ts` and `a/b.ts`, this\n * emits `a/b.ts` first, because the directory sorts before the file.\n *\n * A directory that does not exist yields an empty list rather than throwing.\n * \"The app has no jobs yet\" is an ordinary state and not this function's to\n * complain about — but it is indistinguishable from \"the app's source did not\n * ship\", so a caller that boots on the answer owes the reader a word about which\n * one it got.\n */\nexport function sourceFiles(dir: string, ignore: string[] = []): string[] {\n const out: string[] = [];\n\n const ignored = (path: string) => {\n const rel = relative(dir, path).split(\"\\\\\").join(\"/\");\n return ignore.some(\n (pattern) => rel === pattern || rel.startsWith(`${pattern}/`),\n );\n };\n\n const walk = (current: string) => {\n for (const entry of readdirSync(current, { withFileTypes: true }).sort(\n (a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0),\n )) {\n const path = join(current, entry.name);\n if (ignored(path)) continue;\n\n if (entry.isDirectory()) {\n if (entry.name.startsWith(\".\") || entry.name === \"node_modules\")\n continue;\n if (existsSync(join(path, \"package.json\"))) continue;\n walk(path);\n continue;\n }\n\n if (!entry.name.endsWith(\".ts\") && !entry.name.endsWith(\".tsx\")) continue;\n if (entry.name.endsWith(\".d.ts\")) continue;\n if (/\\.(test|test-d|spec|bench)\\.tsx?$/.test(entry.name)) continue;\n\n out.push(path);\n }\n };\n\n if (!existsSync(dir)) return out;\n\n walk(dir);\n return out;\n}\n\n/**\n * A class, as much of one as this file can name. `abstract` so that a base an\n * app never instantiates directly is a legal argument.\n */\ntype ClassLike = abstract new (...args: never[]) => unknown;\n\n/**\n * A file that would not import, reported with the file that would not import.\n *\n * Separate from a bare rethrow because the stack of a failed dynamic import\n * names the module that failed to *resolve*, several frames deep, and says\n * nothing about the walk that asked for it — so the reader learns that some\n * `?raw` specifier is unresolvable without learning that discovery is what\n * imported it, or that listing the classes explicitly is how they get their boot\n * back.\n */\nexport class DiscoveryError extends Error {\n constructor(message: string, options?: { cause?: unknown }) {\n super(message, options);\n this.name = \"DiscoveryError\";\n }\n}\n\n/**\n * Every exported class under `dir` whose prototype chain reaches `base`.\n *\n * `base` is a parameter rather than an import so that this file names no\n * service and stays cheap to depend on — `bin/check-models.ts` uses the walker\n * above and is bundled into `dist/bin/gemi.js`, which is not somewhere gemi's\n * service layer should end up. It is also what lets a test hand in a base class\n * of its own instead of standing up a project that can resolve `gemi/services`.\n *\n * `base` itself is never returned. A directory whose files import their base\n * from a sibling — the shape an app reaches for when several jobs share a gate —\n * re-exports it as often as not, and a framework that scheduled the abstract\n * base along with its subclasses would be running a job nobody wrote.\n *\n * A class is returned once no matter how many exports name it. A barrel in the\n * directory re-exporting everything beside it is the ordinary case, and it makes\n * every class reachable twice.\n *\n * The order is the walk's, and within a file the module namespace's, which the\n * language sorts by name. So the answer is the same on every run — worth having\n * where the caller is a scheduler and the alternative is a boot order that\n * depends on the filesystem.\n *\n * `onSkipped` is handed every export that did *not* match, with the file it came\n * from. Discovery's characteristic failure is a thing the author wrote and this\n * walk cannot see, and by the time an export has been discarded here the\n * information about why is gone — the caller is left holding \"four classes\"\n * where the directory holds five. A caller that can recognise its own\n * near-misses, as `discoverCommands` recognises a builder chain that was never\n * finished, uses this to say so by name instead.\n *\n * @throws DiscoveryError if a walked file cannot be imported. Not a skip: a file\n * that will not load is a class the caller was going to be told about and now is\n * not, which is the failure discovery exists to remove.\n */\nexport async function discoverClasses<T extends ClassLike>(\n dir: string,\n base: T,\n ignore: string[] = [],\n onSkipped?: (value: unknown, file: string) => void,\n): Promise<T[]> {\n const found = new Set<T>();\n\n for (const path of sourceFiles(dir, ignore)) {\n let module: Record<string, unknown>;\n\n try {\n module = (await import(path)) as Record<string, unknown>;\n } catch (error) {\n throw new DiscoveryError(\n `${path} could not be imported, so the classes in it could not be ` +\n `discovered:\\n ${(error as Error).message}\\n` +\n `List the classes explicitly in the config slice for this directory ` +\n `to skip the walk.`,\n { cause: error },\n );\n }\n\n for (const value of Object.values(module)) {\n if (\n typeof value === \"function\" &&\n value !== base &&\n Object.prototype.isPrototypeOf.call(base, value)\n ) {\n found.add(value as unknown as T);\n continue;\n }\n\n onSkipped?.(value, path);\n }\n }\n\n return [...found];\n}\n\n/**\n * The directory an app's `app/` sits in, as the running process can know it.\n *\n * `ROOT_DIR` is the obvious answer and is not available: `Server.start` awaits\n * `waitForBoot()` — every provider's `register` and `boot` — and only then\n * imports the http layer that sets it. Anything resolving paths during boot is\n * earlier than the variable it would want.\n *\n * What it can use is the same rule `httpProd` computes `ROOT_DIR` with a moment\n * later, which is why that file now calls this instead of repeating it. `gemi\n * dev` and `gemi start` both spawn the server with no `cwd`, so the process\n * inherits the CLI's, and the CLI takes `process.cwd()` for the project root\n * itself — `bun/preload.ts` reads `gemi.config` from it on the same assumption.\n *\n * `httpDev` computes a bare `process.cwd()`, so it and `httpProd` already\n * disagree whenever `GEMI_PROJECT_DIR` is set. Nothing in this repo sets it and\n * `gemi start` ignores it when locating the built entry point, so the two rules\n * are the same rule for every configuration that runs today; the divergence is\n * older than this function and wants its own fix.\n */\nexport function projectRoot(): string {\n return join(process.cwd(), process.env.GEMI_PROJECT_DIR ?? \"\");\n}\n"
6
6
  ],
7
7
  "mappings": ";AAAA,qBAAS,iBAAY,WACrB,eAAS,cAAM,aA2FR,SAAS,CAAW,CAAC,EAAa,EAAmB,CAAC,EAAa,CACxE,IAAM,EAAgB,CAAC,EAEjB,EAAU,CAAC,IAAiB,CAChC,IAAM,EAAM,EAAS,EAAK,CAAI,EAAE,MAAM,IAAI,EAAE,KAAK,GAAG,EACpD,OAAO,EAAO,KACZ,CAAC,IAAY,IAAQ,GAAW,EAAI,WAAW,GAAG,IAAU,CAC9D,GAGI,EAAO,CAAC,IAAoB,CAChC,QAAW,KAAS,EAAY,EAAS,CAAE,cAAe,EAAK,CAAC,EAAE,KAChE,CAAC,EAAG,IAAO,EAAE,KAAO,EAAE,KAAO,GAAK,EAAE,KAAO,EAAE,KAAO,EAAI,CAC1D,EAAG,CACD,IAAM,EAAO,EAAK,EAAS,EAAM,IAAI,EACrC,GAAI,EAAQ,CAAI,EAAG,SAEnB,GAAI,EAAM,YAAY,EAAG,CACvB,GAAI,EAAM,KAAK,WAAW,GAAG,GAAK,EAAM,OAAS,eAC/C,SACF,GAAI,EAAW,EAAK,EAAM,cAAc,CAAC,EAAG,SAC5C,EAAK,CAAI,EACT,SAGF,GAAI,CAAC,EAAM,KAAK,SAAS,KAAK,GAAK,CAAC,EAAM,KAAK,SAAS,MAAM,EAAG,SACjE,GAAI,EAAM,KAAK,SAAS,OAAO,EAAG,SAClC,GAAI,oCAAoC,KAAK,EAAM,IAAI,EAAG,SAE1D,EAAI,KAAK,CAAI,IAIjB,GAAI,CAAC,EAAW,CAAG,EAAG,OAAO,EAG7B,OADA,EAAK,CAAG,EACD,EAmBF,MAAM,UAAuB,KAAM,CACxC,WAAW,CAAC,EAAiB,EAA+B,CAC1D,MAAM,EAAS,CAAO,EACtB,KAAK,KAAO,iBAEhB,CAqCA,eAAsB,CAAoC,CACxD,EACA,EACA,EAAmB,CAAC,EACpB,EACc,CACd,IAAM,EAAQ,IAAI,IAElB,QAAW,KAAQ,EAAY,EAAK,CAAM,EAAG,CAC3C,IAAI,EAEJ,GAAI,CACF,EAAU,MAAa,UACvB,MAAO,EAAO,CACd,MAAM,IAAI,EACR,GAAG;AAAA,MACoB,EAAgB;AAAA,sFAGvC,CAAE,MAAO,CAAM,CACjB,EAGF,QAAW,KAAS,OAAO,OAAO,CAAM,EAAG,CACzC,GACE,OAAO,IAAU,YACjB,IAAU,GACV,OAAO,UAAU,cAAc,KAAK,EAAM,CAAK,EAC/C,CACA,EAAM,IAAI,CAAqB,EAC/B,SAGF,IAAY,EAAO,CAAI,GAI3B,MAAO,CAAC,GAAG,CAAK,EAuBX,SAAS,CAAW,EAAW,CACpC,OAAO,EAAK,QAAQ,IAAI,EAAG,QAAQ,IAAI,kBAAoB,EAAE",
8
- "debugId": "44C94E4CD6DB521F64756E2164756E21",
8
+ "debugId": "DC6AAA6BDCEDA86564756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
2
  var j=globalThis.__GEMI_DICTIONARY_REGISTRY__??={registry:new Map,resolved:new Map,inFlight:new Map,renderThenables:new Map,order:[],warmed:new Map,activeLocale:null},{registry:W,resolved:Z,inFlight:V,renderThenables:I,order:E,warmed:X}=j;function N(q,x){return`${q}\x00${x}`}function D(q){if(W.has(q.id))return;W.set(q.id,q),E.push(q.id)}function H(){return E.length}function P(q,x){return Z.get(q)?.get(x)}function $(q,x,A){let z=Z.get(q);if(!z)z=new Map,Z.set(q,z);z.set(x,A)}function U(q,x){let A=P(q,x);if(A)return A;let z=N(q,x),C=V.get(z);if(C)return C;let B=W.get(q);if(!B)throw Error(`Unknown dictionary "${q}". A dictionary must be created with defineDictionary() and its module must have been evaluated before it is read.`);let J=B.load(x);if(!(J instanceof Promise))return $(q,x,J),J;let O=J.then((Q)=>{return $(q,x,Q),V.delete(z),Q},(Q)=>{throw V.delete(z),Q});return V.set(z,O),O}function K(q,x){let A=N(q,x),z=P(q,x),C=I.get(A);if(C&&!(C.degraded&&z))return C;if(z)return G(A,M(z,!C));let B=U(q,x);if(!(B instanceof Promise))return G(A,M(B,!0));let J=B.then((O)=>O,(O)=>{return console.error(`Failed to load dictionary ${q} for locale ${x}; rendering keys instead.`,O),J.degraded=!0,Y});return G(A,J)}function G(q,x){return I.set(q,x),x}function M(q,x){return Object.assign(Promise.resolve(q),{status:"fulfilled",value:q,inHand:x?q:void 0})}var Y={};async function S(q,x){let A=x??X.get(q)??0,z=E.slice(A);if(z.length===0)return;let C=await Promise.all(z.map(async(B)=>{try{return await U(B,_(B,q)),!0}catch{return!1}}));if(x===void 0){let B=C.indexOf(!1),J=B===-1?z.length:B;X.set(q,Math.max(X.get(q)??0,A+J))}}function _(q,x){if(x)return x;return W.get(q)?.locales[0]??x}function L(q,x){if(!q)return;for(let[A,z]of Object.entries(q))$(A,x,z)}function R(q){if(q)j.activeLocale=q}function w(){return j.activeLocale}if(typeof window<"u"){let q=window,x=([z,C,B])=>{$(z,C,B)},A=Array.isArray(q.__GEMI_DICT__)?q.__GEMI_DICT__:[];q.__GEMI_DICT__={push:x};for(let z of A)x(z)}function F(){W.clear(),Z.clear(),V.clear(),I.clear(),X.clear(),E.length=0,j.activeLocale=null}function f(){let q=new Set,x=[],A=[];return{use(z,C,B){let J=`${z} ${C}`;if(q.has(J))return;q.add(J);let O={id:z,locale:C,strings:B};if(x.length===0){A.push(O);return}for(let Q of x)Q(O)},onUse(z){x.push(z);while(A.length>0)z(A.shift())}}}
3
- export{D as Sk,H as Tk,U as Uk,K as Vk,S as Wk,L as Xk,R as Yk,w as Zk,F as _k,f as $k};
3
+ export{D as Tk,H as Uk,U as Vk,K as Wk,S as Xk,L as Yk,R as Zk,w as _k,F as $k,f as al};
4
4
 
5
- //# debugId=F1AEE58432C72C9B64756E2164756E21
5
+ //# debugId=8ECD444B1B085C3764756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "import type { LocaleStrings } from \"./dictionaryShape\";\n\n/**\n * Collects the dictionaries one SSR render actually read.\n *\n * Scoped per request by living in React context rather than in module state: a\n * streaming server has several renders in flight at once, so a module-level\n * collector would mix one page's dictionaries into another's payload. Context\n * is per render tree, which is exactly the boundary wanted, and it needs no\n * async-local storage to survive React's internal scheduling.\n *\n * Why stream these rather than put them in `__GEMI_DATA__`: that snapshot is\n * serialized before `renderToReadableStream` is even called, and which\n * dictionaries a page reads is only known once it has rendered. A suspended\n * segment reveals later still, long after the shell has flushed.\n *\n * The sink deliberately emits data, not markup — `streamQueryInjection` owns\n * script formatting and the `</script>`-safe encoding that goes with it.\n */\nexport interface DictionaryUse {\n id: string;\n locale: string;\n strings: LocaleStrings;\n}\n\nexport interface DictionarySink {\n /** Called during render, the first time a dictionary is read. */\n use(id: string, locale: string, strings: LocaleStrings): void;\n /** The response injector subscribes to receive uses as they happen. */\n onUse(cb: (use: DictionaryUse) => void): void;\n}\n\nexport function createDictionarySink(): DictionarySink {\n const seen = new Set<string>();\n const listeners: Array<(use: DictionaryUse) => void> = [];\n // Uses recorded before the injector subscribed — the render begins before the\n // response stream is wrapped.\n const pending: DictionaryUse[] = [];\n\n return {\n use(id, locale, strings) {\n const key = `${id} ${locale}`;\n if (seen.has(key)) return;\n seen.add(key);\n const entry: DictionaryUse = { id, locale, strings };\n if (listeners.length === 0) {\n pending.push(entry);\n return;\n }\n for (const listener of liste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nB,EAAK,IAAI,CAAG,EACZ,IAAM,EAAuB,CAAE,KAAI,SAAQ,SAAQ,EACnD,GAAI,EAAU,SAAW,EAAG,CAC1B,EAAQ,KAAK,CAAK,EAClB,OAEF,QAAW,KAAY,EAAW,EAAS,CAAK,GAElD,KAAK,CAAC,EAAI,CACR,EAAU,KAAK,CAAE,EACjB,MAAO,EAAQ,OAAS,EACtB,EAAG,EAAQ,MAAM,CAAE,EAGzB",
9
- "debugId": "F1AEE58432C72C9B64756E2164756E21",
9
+ "debugId": "8ECD444B1B085C3764756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{pa as w,qa as P,ra as R,sa as b}from"./chunk-bwg7genv.js";import{va as K,wa as _,xa as L,ya as A}from"./chunk-mvd4mc8p.js";import{za as I}from"./chunk-7txst143.js";import{Aa as T,Ba as E}from"./chunk-s1wj0ff8.js";var i=["gemi","gemi/client","gemi/http","gemi/app","gemi/facades","gemi/email","gemi/kernel","gemi/services","gemi/i18n","gemi/dictionary"];function O(q){return q==="gemi"||q.startsWith("gemi/")}import{parseAstAsync as h}from"vite";var V="virtual:gemi-dict/",x="\x00virtual:gemi-dict/",f=new Set(["gemi/dictionary","gemi/client","gemi/i18n"]),y="gemi/dictionary";function B(){let q=new Map;return{name:"gemi-plugin-dictionary",enforce:"post",resolveId(H){if(H.startsWith(V))return`\x00${H}`;return null},async load(H){if(!H.startsWith(x))return null;let Q=H.slice(x.length),W=Q.lastIndexOf("/"),J=Q.slice(0,W),Y=Q.slice(W+1),$=q.get(J);if(!$){let M=g(J);if(M){try{await this.load({id:M})}catch{}$=q.get(J)}}if(!$)return this.error(`No dictionary registered for "${J}". If this persists, restart the dev server.`),null;let G=_($.translations,Y,$.locales);return`export default ${JSON.stringify(G)};
2
+ import{pa as w,qa as P,ra as R,sa as b}from"./chunk-bwg7genv.js";import{va as K,wa as _,xa as L,ya as A}from"./chunk-mvd4mc8p.js";import{za as I}from"./chunk-7txst143.js";import{Aa as T,Ba as E}from"./chunk-m37vvh99.js";var i=["gemi","gemi/client","gemi/http","gemi/app","gemi/facades","gemi/email","gemi/kernel","gemi/services","gemi/i18n","gemi/dictionary"];function O(q){return q==="gemi"||q.startsWith("gemi/")}import{parseAstAsync as h}from"vite";var V="virtual:gemi-dict/",x="\x00virtual:gemi-dict/",f=new Set(["gemi/dictionary","gemi/client","gemi/i18n"]),y="gemi/dictionary";function B(){let q=new Map;return{name:"gemi-plugin-dictionary",enforce:"post",resolveId(H){if(H.startsWith(V))return`\x00${H}`;return null},async load(H){if(!H.startsWith(x))return null;let Q=H.slice(x.length),W=Q.lastIndexOf("/"),J=Q.slice(0,W),Y=Q.slice(W+1),$=q.get(J);if(!$){let M=g(J);if(M){try{await this.load({id:M})}catch{}$=q.get(J)}}if(!$)return this.error(`No dictionary registered for "${J}". If this persists, restart the dev server.`),null;let G=_($.translations,Y,$.locales);return`export default ${JSON.stringify(G)};
3
3
  `},async transform(H,Q){if(!H.includes("defineDictionary"))return null;if(Q.startsWith("\x00")||Q.includes("/node_modules/"))return null;let W=await h(H),J=new Set;for(let Z of W.body){if(Z.type!=="ImportDeclaration")continue;if(!f.has(Z.source?.value))continue;for(let z of Z.specifiers??[])if(z.type==="ImportSpecifier"&&z.imported?.name==="defineDictionary")J.add(z.local.name)}let Y=[],$=0;if(X(W,(Z)=>{if(Z.type!=="CallExpression")return;let z=Z.callee;if(z?.type==="Identifier"&&J.has(z.name)){Y.push(Z);return}if((z?.type==="Identifier"?z.name:z?.type==="MemberExpression"&&!z.computed?z.property?.name:void 0)==="defineDictionary")$++}),$>0&&p(W,"defineDictionary"))$=0;if($>0)this.warn(`${Q}: ${$} defineDictionary() call(s) could not be traced to an import of "gemi/dictionary", "gemi/client" or "gemi/i18n", so their locales were left inline and will all ship to the browser. Import defineDictionary directly by name rather than through a namespace import or a local re-export.`);if(Y.length===0)return null;let G=new T(H),M=!1;for(let Z of Y){if(Z.arguments?.length<1||Z.arguments?.length>2)this.error({message:"defineDictionary() takes an object literal and an optional options object.",pos:Z.start});let z=m(Z.arguments[0],(j)=>this.error({message:j,pos:Z.arguments[0]?.start??Z.start})),F=v(Z.arguments[1],(j)=>this.error({message:j,pos:Z.arguments[1]?.start??Z.start})),D=A(z),C=`${Buffer.from(Q).toString("base64url")}/${D}`,N=K(z,F);if(N.length===0)this.error({message:'defineDictionary() declares no locales \u2014 every key needs at least one "<locale>": "<string>" entry.',pos:Z.start});if(!F){let j=L(z);if(j)this.error({message:`defineDictionary() cannot infer a source language. Key "${j.againstKey}" lists "${j.againstFirst}" first but "${j.key}" lists "${j.first}" first, so the locale every key falls back to depends on the order `+"they are written in \u2014 moving one key would change what language a reader sees. "+'Pass { sourceLocale: "<locale>" } as the second argument to pin it.',pos:Z.start})}q.set(C,{id:D,locales:N,translations:z});let S=N.map((j)=>`${JSON.stringify(j)}:()=>import(${JSON.stringify(`${V}${C}/${j}`)})`).join(",");G.overwrite(Z.start,Z.end,`__gemi_dict__(${JSON.stringify(D)},{${S}})`),M=!0}if(!M)return null;return G.append(`
4
4
  import { __gemi_dict__ } from ${JSON.stringify(y)};
5
5
  `),{code:G.toString(),map:G.generateMap({hires:!0})}}}}function g(q){let H=q.indexOf("/");if(H===-1)return null;try{return Buffer.from(q.slice(0,H),"base64url").toString("utf8")}catch{return null}}function m(q,H){if(q?.type!=="ObjectExpression")H("defineDictionary() needs an inline object literal \u2014 it is read at build time, so a variable or spread cannot be resolved.");let Q={};for(let W of q.properties){let J=U(W);if(J===null)H("defineDictionary() keys must be plain string keys \u2014 computed keys and spreads cannot be read at build time.");if(W.value?.type!=="ObjectExpression")H(`defineDictionary() entry "${J}" must be an object of "<locale>": "<string>" pairs.`);let Y={};for(let $ of W.value.properties){let G=U($);if(G===null)H(`defineDictionary() entry "${J}" has a locale key that cannot be read at build time.`);let M=$.value;if(M?.type!=="Literal"||typeof M.value!=="string")H(`defineDictionary() entry "${J}" locale "${G}" must be a string literal. Use {{param}} interpolation instead of a template literal or a function.`);Y[G]=M.value}Q[J]=Y}return Q}function v(q,H){if(q===void 0)return;if(q.type!=="ObjectExpression")H("defineDictionary() options must be an inline object literal \u2014 it is read at build time.");for(let Q of q.properties){if(U(Q)!=="sourceLocale")continue;let W=Q.value;if(W?.type!=="Literal"||typeof W.value!=="string")H("defineDictionary() sourceLocale must be a string literal.");return W.value}return}function p(q,H){let Q=!1;return X(q,(W)=>{if(Q)return;if(W.type==="FunctionDeclaration"&&W.id?.name===H)Q=!0;if(W.type==="VariableDeclarator"&&W.id?.name===H)Q=!0}),Q}function U(q){if(q?.type!=="Property"||q.computed)return null;if(q.key?.type==="Identifier")return q.key.name;if(q.key?.type==="Literal"&&typeof q.key.value==="string")return q.key.value;return null}function X(q,H){if(q===null||typeof q!=="object")return;if(Array.isArray(q)){for(let Q of q)X(Q,H);return}if(typeof q.type==="string")H(q);for(let Q of Object.keys(q)){if(Q==="parent")continue;let W=q[Q];if(W&&typeof W==="object")X(W,H)}}import{mkdir as u,writeFile as c}from"fs/promises";import{dirname as r,join as t}from"path";function k(q){let H;return{name:"gemi-plugin-asset-base",config:(Q,W)=>W.command==="build"&&q?{base:q}:void 0,configResolved(Q){H=Q},async writeBundle(Q){if(!H||H.command!=="build"||H.build.ssr||!Q.dir)return;let W=t(Q.dir,P);await u(r(W),{recursive:!0}),await c(W,`${JSON.stringify({assetBase:d(H.base)})}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{S as A}from"./chunk-kcg2znz2.js";import"./chunk-k9f7gww2.js";import{U as T}from"./chunk-hv6nbbty.js";import{V as y}from"./chunk-n415vvxw.js";import{Ml as r}from"./chunk-80kpxp4m.js";var u=r(A(),1);var i=r(y(),1),E=r(A(),1);import{exec as d}from"child_process";import{promisify as I}from"util";var x=r(T(),1),_=(c,n,e)=>{if(n.Version!==1)throw Error(`Profile ${c} credential_process did not return Version 1.`);if(n.AccessKeyId===void 0||n.SecretAccessKey===void 0)throw Error(`Profile ${c} credential_process returned invalid credentials.`);if(n.Expiration){let w=new Date;if(new Date(n.Expiration)<w)throw Error(`Profile ${c} credential_process returned expired credentials.`)}let s=n.AccountId;if(!s&&e?.[c]?.aws_account_id)s=e[c].aws_account_id;let t={accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,...n.SessionToken&&{sessionToken:n.SessionToken},...n.Expiration&&{expiration:new Date(n.Expiration)},...n.CredentialScope&&{credentialScope:n.CredentialScope},...s&&{accountId:s}};return x.setCredentialFeature(t,"CREDENTIALS_PROCESS","w"),t};var K=async(c,n,e)=>{let s=n[c];if(n[c]){let t=s.credential_process;if(t!==void 0){let w=I(E.externalDataInterceptor?.getTokenRecord?.().exec??d);try{let{stdout:o}=await w(t),S;try{S=JSON.parse(o.trim())}catch{throw Error(`Profile ${c} credential_process returned invalid JSON.`)}return _(c,S,n)}catch(o){throw new i.CredentialsProviderError(o.message,{logger:e})}}else throw new i.CredentialsProviderError(`Profile ${c} did not contain credential_process.`,{logger:e})}else throw new i.CredentialsProviderError(`Profile ${c} could not be found in shared credentials file.`,{logger:e})};var R=(c={})=>async({callerClientConfig:n}={})=>{c.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let e=await u.parseKnownFiles(c);return K(u.getProfileName({profile:c.profile??n?.profile}),e,c.logger)};export{R as fromProcess};
2
+ import{S as A}from"./chunk-6frbegay.js";import"./chunk-6wsmdf51.js";import{U as T}from"./chunk-etzd00a8.js";import{V as y}from"./chunk-tt5qk0xt.js";import{Nl as r}from"./chunk-k1c0xd8r.js";var u=r(A(),1);var i=r(y(),1),E=r(A(),1);import{exec as d}from"child_process";import{promisify as I}from"util";var x=r(T(),1),_=(c,n,e)=>{if(n.Version!==1)throw Error(`Profile ${c} credential_process did not return Version 1.`);if(n.AccessKeyId===void 0||n.SecretAccessKey===void 0)throw Error(`Profile ${c} credential_process returned invalid credentials.`);if(n.Expiration){let w=new Date;if(new Date(n.Expiration)<w)throw Error(`Profile ${c} credential_process returned expired credentials.`)}let s=n.AccountId;if(!s&&e?.[c]?.aws_account_id)s=e[c].aws_account_id;let t={accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,...n.SessionToken&&{sessionToken:n.SessionToken},...n.Expiration&&{expiration:new Date(n.Expiration)},...n.CredentialScope&&{credentialScope:n.CredentialScope},...s&&{accountId:s}};return x.setCredentialFeature(t,"CREDENTIALS_PROCESS","w"),t};var K=async(c,n,e)=>{let s=n[c];if(n[c]){let t=s.credential_process;if(t!==void 0){let w=I(E.externalDataInterceptor?.getTokenRecord?.().exec??d);try{let{stdout:o}=await w(t),S;try{S=JSON.parse(o.trim())}catch{throw Error(`Profile ${c} credential_process returned invalid JSON.`)}return _(c,S,n)}catch(o){throw new i.CredentialsProviderError(o.message,{logger:e})}}else throw new i.CredentialsProviderError(`Profile ${c} did not contain credential_process.`,{logger:e})}else throw new i.CredentialsProviderError(`Profile ${c} could not be found in shared credentials file.`,{logger:e})};var R=(c={})=>async({callerClientConfig:n}={})=>{c.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let e=await u.parseKnownFiles(c);return K(u.getProfileName({profile:c.profile??n?.profile}),e,c.logger)};export{R as fromProcess};
3
3
 
4
- //# debugId=3F7C129F2DC2238764756E2164756E21
4
+ //# debugId=14C2D60D0A17CF2C64756E2164756E21
@@ -7,6 +7,6 @@
7
7
  "import { setCredentialFeature } from \"@aws-sdk/core/client\";\nexport const getValidatedProcessCredentials = (profileName, data, profiles) => {\n if (data.Version !== 1) {\n throw Error(`Profile ${profileName} credential_process did not return Version 1.`);\n }\n if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) {\n throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);\n }\n if (data.Expiration) {\n const currentTime = new Date();\n const expireTime = new Date(data.Expiration);\n if (expireTime < currentTime) {\n throw Error(`Profile ${profileName} credential_process returned expired credentials.`);\n }\n }\n let accountId = data.AccountId;\n if (!accountId && profiles?.[profileName]?.aws_account_id) {\n accountId = profiles[profileName].aws_account_id;\n }\n const credentials = {\n accessKeyId: data.AccessKeyId,\n secretAccessKey: data.SecretAccessKey,\n ...(data.SessionToken && { sessionToken: data.SessionToken }),\n ...(data.Expiration && { expiration: new Date(data.Expiration) }),\n ...(data.CredentialScope && { credentialScope: data.CredentialScope }),\n ...(accountId && { accountId }),\n };\n setCredentialFeature(credentials, \"CREDENTIALS_PROCESS\", \"w\");\n return credentials;\n};\n"
8
8
  ],
9
9
  "mappings": ";qNAAA,SCAA,SACA,KACA,SAAS,sBACT,oBAAS,aCHT,eACa,EAAiC,CAAC,EAAa,EAAM,IAAa,CAC3E,GAAI,EAAK,UAAY,EACjB,MAAM,MAAM,WAAW,gDAA0D,EAErF,GAAI,EAAK,cAAgB,QAAa,EAAK,kBAAoB,OAC3D,MAAM,MAAM,WAAW,oDAA8D,EAEzF,GAAI,EAAK,WAAY,CACjB,IAAM,EAAc,IAAI,KAExB,GADmB,IAAI,KAAK,EAAK,UAAU,EAC1B,EACb,MAAM,MAAM,WAAW,oDAA8D,EAG7F,IAAI,EAAY,EAAK,UACrB,GAAI,CAAC,GAAa,IAAW,IAAc,eACvC,EAAY,EAAS,GAAa,eAEtC,IAAM,EAAc,CAChB,YAAa,EAAK,YAClB,gBAAiB,EAAK,mBAClB,EAAK,cAAgB,CAAE,aAAc,EAAK,YAAa,KACvD,EAAK,YAAc,CAAE,WAAY,IAAI,KAAK,EAAK,UAAU,CAAE,KAC3D,EAAK,iBAAmB,CAAE,gBAAiB,EAAK,eAAgB,KAChE,GAAa,CAAE,WAAU,CACjC,EAEA,OADA,uBAAqB,EAAa,sBAAuB,GAAG,EACrD,GDvBJ,IAAM,EAA4B,MAAO,EAAa,EAAU,IAAW,CAC9E,IAAM,EAAU,EAAS,GACzB,GAAI,EAAS,GAAc,CACvB,IAAM,EAAoB,EAAQ,mBAClC,GAAI,IAAsB,OAAW,CACjC,IAAM,EAAc,EAAU,2BAAyB,iBAAiB,EAAE,MAAQ,CAAI,EACtF,GAAI,CACA,IAAQ,UAAW,MAAM,EAAY,CAAiB,EACl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