gemi 0.111.0 → 0.112.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 (264) hide show
  1. package/dist/ai/Agent.d.ts +54 -1
  2. package/dist/ai/Agent.d.ts.map +1 -1
  3. package/dist/ai/AgentController.d.ts +41 -0
  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/contextCompaction.d.ts +247 -0
  8. package/dist/ai/contextCompaction.d.ts.map +1 -0
  9. package/dist/ai/contextWindow.d.ts +18 -0
  10. package/dist/ai/contextWindow.d.ts.map +1 -1
  11. package/dist/ai/index.d.ts +5 -1
  12. package/dist/ai/index.d.ts.map +1 -1
  13. package/dist/ai/index.js +93 -14
  14. package/dist/ai/index.js.map +16 -10
  15. package/dist/ai/jobs/AgentJob.d.ts +259 -0
  16. package/dist/ai/jobs/AgentJob.d.ts.map +1 -0
  17. package/dist/ai/jobs/AgentJobDeadlineSweep.d.ts +18 -0
  18. package/dist/ai/jobs/AgentJobDeadlineSweep.d.ts.map +1 -0
  19. package/dist/ai/jobs/AgentJobStore.d.ts +141 -0
  20. package/dist/ai/jobs/AgentJobStore.d.ts.map +1 -0
  21. package/dist/ai/jobs/DatabaseAgentJobStore.d.ts +82 -0
  22. package/dist/ai/jobs/DatabaseAgentJobStore.d.ts.map +1 -0
  23. package/dist/ai/jobs/contextBlock.d.ts +31 -0
  24. package/dist/ai/jobs/contextBlock.d.ts.map +1 -0
  25. package/dist/ai/jobs/index.d.ts +6 -0
  26. package/dist/ai/jobs/index.d.ts.map +1 -0
  27. package/dist/ai/jobs/overlay.d.ts +49 -0
  28. package/dist/ai/jobs/overlay.d.ts.map +1 -0
  29. package/dist/ai/providers/request.d.ts.map +1 -1
  30. package/dist/ai/store/Attachments.d.ts +6 -0
  31. package/dist/ai/store/Attachments.d.ts.map +1 -1
  32. package/dist/ai/store/MemoryAgentStore.d.ts +3 -0
  33. package/dist/ai/store/MemoryAgentStore.d.ts.map +1 -1
  34. package/dist/ai/types.d.ts +28 -0
  35. package/dist/ai/types.d.ts.map +1 -1
  36. package/dist/app/index.js +1 -1
  37. package/dist/bin/gemi.js +13 -2
  38. package/dist/bin/gemi.js.map +4 -4
  39. package/dist/bun/plugin.js +1 -1
  40. package/dist/bun/preload.js +1 -1
  41. package/dist/{chunk-30xjcyzh.js → chunk-0z2h35d7.js} +2 -2
  42. package/dist/{chunk-30xjcyzh.js.map → chunk-0z2h35d7.js.map} +1 -1
  43. package/dist/{chunk-358sdcx9.js → chunk-15a1mrdv.js} +2 -2
  44. package/dist/{chunk-358sdcx9.js.map → chunk-15a1mrdv.js.map} +1 -1
  45. package/dist/{chunk-hf7a51s3.js → chunk-18c3y8m3.js} +2 -2
  46. package/dist/{chunk-hf7a51s3.js.map → chunk-18c3y8m3.js.map} +1 -1
  47. package/dist/{chunk-tq85n8zh.js → chunk-1pvkw2pq.js} +2 -2
  48. package/dist/{chunk-tq85n8zh.js.map → chunk-1pvkw2pq.js.map} +1 -1
  49. package/dist/{chunk-8afxrmdc.js → chunk-2taa0brj.js} +2 -2
  50. package/dist/{chunk-8afxrmdc.js.map → chunk-2taa0brj.js.map} +1 -1
  51. package/dist/{chunk-5cygrbxv.js → chunk-30yg31sz.js} +2 -2
  52. package/dist/{chunk-5cygrbxv.js.map → chunk-30yg31sz.js.map} +1 -1
  53. package/dist/{chunk-3y8q8x11.js → chunk-3z9vhjd7.js} +2 -2
  54. package/dist/{chunk-3y8q8x11.js.map → chunk-3z9vhjd7.js.map} +1 -1
  55. package/dist/chunk-4sb1484x.js +46 -0
  56. package/dist/{chunk-h3864a8z.js.map → chunk-4sb1484x.js.map} +13 -4
  57. package/dist/{chunk-0sjh5v1n.js → chunk-53bek7sp.js} +1 -1
  58. package/dist/{chunk-xkc7ftnq.js → chunk-57edag57.js} +3 -3
  59. package/dist/{chunk-xkc7ftnq.js.map → chunk-57edag57.js.map} +1 -1
  60. package/dist/{chunk-ddr4qvvt.js → chunk-5az0mq4p.js} +3 -3
  61. package/dist/{chunk-ddr4qvvt.js.map → chunk-5az0mq4p.js.map} +1 -1
  62. package/dist/{chunk-nsvktvp4.js → chunk-5waxjsvv.js} +2 -2
  63. package/dist/{chunk-nsvktvp4.js.map → chunk-5waxjsvv.js.map} +1 -1
  64. package/dist/{chunk-rfcygmf5.js → chunk-6w79zajj.js} +3 -3
  65. package/dist/{chunk-rfcygmf5.js.map → chunk-6w79zajj.js.map} +1 -1
  66. package/dist/{chunk-gb37722w.js → chunk-75ptmewf.js} +3 -3
  67. package/dist/{chunk-gb37722w.js.map → chunk-75ptmewf.js.map} +1 -1
  68. package/dist/{chunk-pyj7cd9t.js → chunk-851k0b26.js} +2 -2
  69. package/dist/{chunk-pyj7cd9t.js.map → chunk-851k0b26.js.map} +1 -1
  70. package/dist/{chunk-m6ystvtk.js → chunk-8reepafh.js} +2 -2
  71. package/dist/{chunk-m6ystvtk.js.map → chunk-8reepafh.js.map} +1 -1
  72. package/dist/{chunk-nvv9wej6.js → chunk-9hr0bcfy.js} +3 -3
  73. package/dist/{chunk-nvv9wej6.js.map → chunk-9hr0bcfy.js.map} +1 -1
  74. package/dist/{chunk-yqavgpwd.js → chunk-a9q2cr4w.js} +2 -2
  75. package/dist/{chunk-yqavgpwd.js.map → chunk-a9q2cr4w.js.map} +1 -1
  76. package/dist/{chunk-cy5qp6mz.js → chunk-amvy4r59.js} +2 -2
  77. package/dist/{chunk-cy5qp6mz.js.map → chunk-amvy4r59.js.map} +1 -1
  78. package/dist/{chunk-twnn7r66.js → chunk-b1mk12xg.js} +2 -2
  79. package/dist/{chunk-twnn7r66.js.map → chunk-b1mk12xg.js.map} +1 -1
  80. package/dist/{chunk-a6453d9s.js → chunk-b7cqwcbm.js} +2 -2
  81. package/dist/{chunk-a6453d9s.js.map → chunk-b7cqwcbm.js.map} +1 -1
  82. package/dist/{chunk-nncz308h.js → chunk-b7qjp7r1.js} +2 -2
  83. package/dist/{chunk-nncz308h.js.map → chunk-b7qjp7r1.js.map} +1 -1
  84. package/dist/chunk-beks65me.js +19 -0
  85. package/dist/{chunk-mb7q7s0a.js.map → chunk-beks65me.js.map} +3 -4
  86. package/dist/chunk-bf1ets45.js +5 -0
  87. package/dist/{chunk-11fsn5mr.js.map → chunk-bf1ets45.js.map} +4 -3
  88. package/dist/{chunk-9rchedr4.js → chunk-bhw7k8vp.js} +2 -2
  89. package/dist/{chunk-9rchedr4.js.map → chunk-bhw7k8vp.js.map} +1 -1
  90. package/dist/{chunk-k1vw22t2.js → chunk-ck0v2kzw.js} +2 -2
  91. package/dist/{chunk-k1vw22t2.js.map → chunk-ck0v2kzw.js.map} +1 -1
  92. package/dist/{chunk-1bkr5wnt.js → chunk-cptzbdn6.js} +2 -2
  93. package/dist/{chunk-1bkr5wnt.js.map → chunk-cptzbdn6.js.map} +1 -1
  94. package/dist/{chunk-6vr7f5fq.js → chunk-csbc1fxa.js} +3 -3
  95. package/dist/{chunk-6vr7f5fq.js.map → chunk-csbc1fxa.js.map} +1 -1
  96. package/dist/{chunk-kf71mjxa.js → chunk-d0trs736.js} +3 -3
  97. package/dist/{chunk-kf71mjxa.js.map → chunk-d0trs736.js.map} +1 -1
  98. package/dist/{chunk-zhs1r1z0.js → chunk-d8ekyng4.js} +3 -3
  99. package/dist/{chunk-zhs1r1z0.js.map → chunk-d8ekyng4.js.map} +1 -1
  100. package/dist/chunk-d9an2nra.js +5 -0
  101. package/dist/{chunk-hn67spz6.js.map → chunk-d9an2nra.js.map} +1 -1
  102. package/dist/{chunk-0d9qsmx2.js → chunk-dan79jab.js} +2 -2
  103. package/dist/{chunk-0d9qsmx2.js.map → chunk-dan79jab.js.map} +1 -1
  104. package/dist/{chunk-1yx2e0bh.js → chunk-ddad3902.js} +2 -2
  105. package/dist/{chunk-1yx2e0bh.js.map → chunk-ddad3902.js.map} +1 -1
  106. package/dist/{chunk-3cg7y62b.js → chunk-dm59ze55.js} +2 -2
  107. package/dist/{chunk-3cg7y62b.js.map → chunk-dm59ze55.js.map} +1 -1
  108. package/dist/{chunk-wvsv1jgg.js → chunk-dx7wpz5b.js} +2 -2
  109. package/dist/{chunk-wvsv1jgg.js.map → chunk-dx7wpz5b.js.map} +1 -1
  110. package/dist/{chunk-q9s7kwgt.js → chunk-eazqda9z.js} +3 -3
  111. package/dist/{chunk-q9s7kwgt.js.map → chunk-eazqda9z.js.map} +1 -1
  112. package/dist/{chunk-td8tha3j.js → chunk-es487acc.js} +1 -1
  113. package/dist/{chunk-9s851qz8.js → chunk-et3vhkbf.js} +2 -2
  114. package/dist/{chunk-9s851qz8.js.map → chunk-et3vhkbf.js.map} +1 -1
  115. package/dist/{chunk-qd2v93y4.js → chunk-f1y8eggf.js} +2 -2
  116. package/dist/{chunk-qd2v93y4.js.map → chunk-f1y8eggf.js.map} +1 -1
  117. package/dist/{chunk-1pem26zc.js → chunk-ga7c7tq0.js} +3 -3
  118. package/dist/{chunk-1pem26zc.js.map → chunk-ga7c7tq0.js.map} +1 -1
  119. package/dist/{chunk-c098fzvk.js → chunk-gcs9ydjv.js} +2 -2
  120. package/dist/{chunk-c098fzvk.js.map → chunk-gcs9ydjv.js.map} +1 -1
  121. package/dist/{chunk-bn5yn731.js → chunk-hfyxvdjj.js} +2 -2
  122. package/dist/{chunk-bn5yn731.js.map → chunk-hfyxvdjj.js.map} +1 -1
  123. package/dist/chunk-j0sncgxc.js +14 -0
  124. package/dist/{chunk-mn5xw79b.js.map → chunk-j0sncgxc.js.map} +6 -5
  125. package/dist/{chunk-p7r2w4qw.js → chunk-j9jqxv1d.js} +3 -3
  126. package/dist/{chunk-p7r2w4qw.js.map → chunk-j9jqxv1d.js.map} +1 -1
  127. package/dist/{chunk-jbrwt3cs.js → chunk-jdtn0zk2.js} +4 -4
  128. package/dist/{chunk-jbrwt3cs.js.map → chunk-jdtn0zk2.js.map} +1 -1
  129. package/dist/{chunk-s6jjy4y9.js → chunk-jn59bsww.js} +2 -2
  130. package/dist/{chunk-s6jjy4y9.js.map → chunk-jn59bsww.js.map} +1 -1
  131. package/dist/{chunk-he7z7y9j.js → chunk-kk502yk2.js} +2 -2
  132. package/dist/{chunk-he7z7y9j.js.map → chunk-kk502yk2.js.map} +1 -1
  133. package/dist/{chunk-wsttx9rg.js → chunk-mrdarm2q.js} +2 -2
  134. package/dist/{chunk-wsttx9rg.js.map → chunk-mrdarm2q.js.map} +1 -1
  135. package/dist/chunk-mvtgx1mr.js +4 -0
  136. package/dist/{chunk-x78jrs4y.js.map → chunk-mvtgx1mr.js.map} +2 -2
  137. package/dist/{chunk-et4pv1b1.js → chunk-mx9y9mtx.js} +1 -1
  138. package/dist/chunk-nv7mv51r.js +6 -0
  139. package/dist/{chunk-tdsfke9q.js.map → chunk-nv7mv51r.js.map} +2 -2
  140. package/dist/{chunk-cttmy1jp.js → chunk-p2fhtf5r.js} +3 -3
  141. package/dist/{chunk-cttmy1jp.js.map → chunk-p2fhtf5r.js.map} +1 -1
  142. package/dist/{chunk-w7jsh3xd.js → chunk-qtbf3w6w.js} +2 -2
  143. package/dist/{chunk-w7jsh3xd.js.map → chunk-qtbf3w6w.js.map} +1 -1
  144. package/dist/chunk-qx87cdfg.js +5 -0
  145. package/dist/chunk-qx87cdfg.js.map +10 -0
  146. package/dist/{chunk-1kr25rcg.js → chunk-qyp652jz.js} +3 -3
  147. package/dist/{chunk-1kr25rcg.js.map → chunk-qyp652jz.js.map} +1 -1
  148. package/dist/{chunk-8b2tw2yp.js → chunk-rend2sbk.js} +1 -1
  149. package/dist/chunk-rx2shb3t.js +25 -0
  150. package/dist/chunk-rx2shb3t.js.map +19 -0
  151. package/dist/{chunk-mwqg079k.js → chunk-ryzcfxq7.js} +2 -2
  152. package/dist/{chunk-mwqg079k.js.map → chunk-ryzcfxq7.js.map} +1 -1
  153. package/dist/{chunk-7tx5y712.js → chunk-s9rfgxj5.js} +2 -2
  154. package/dist/{chunk-7tx5y712.js.map → chunk-s9rfgxj5.js.map} +1 -1
  155. package/dist/{chunk-1c1d0e60.js → chunk-scbvv2e4.js} +3 -3
  156. package/dist/{chunk-1c1d0e60.js.map → chunk-scbvv2e4.js.map} +1 -1
  157. package/dist/chunk-sj8jp4p9.js +24 -0
  158. package/dist/{chunk-wqvvjd5r.js.map → chunk-sj8jp4p9.js.map} +2 -2
  159. package/dist/{chunk-pwmgqq7z.js → chunk-teny6xkw.js} +2 -2
  160. package/dist/{chunk-pwmgqq7z.js.map → chunk-teny6xkw.js.map} +1 -1
  161. package/dist/{chunk-09ypnhjv.js → chunk-tmrmwthr.js} +2 -2
  162. package/dist/{chunk-09ypnhjv.js.map → chunk-tmrmwthr.js.map} +1 -1
  163. package/dist/{chunk-h4sw6nt3.js → chunk-vgdcz7tk.js} +3 -3
  164. package/dist/{chunk-h4sw6nt3.js.map → chunk-vgdcz7tk.js.map} +1 -1
  165. package/dist/{chunk-xk930yaw.js → chunk-wexs11yy.js} +2 -2
  166. package/dist/{chunk-xk930yaw.js.map → chunk-wexs11yy.js.map} +1 -1
  167. package/dist/{chunk-k1xt2tw7.js → chunk-xs4c2nvz.js} +2 -2
  168. package/dist/{chunk-k1xt2tw7.js.map → chunk-xs4c2nvz.js.map} +1 -1
  169. package/dist/{chunk-1va15sfq.js → chunk-xv74rhay.js} +2 -2
  170. package/dist/{chunk-1va15sfq.js.map → chunk-xv74rhay.js.map} +1 -1
  171. package/dist/{chunk-sq2wkynk.js → chunk-yv1psptb.js} +2 -2
  172. package/dist/{chunk-sq2wkynk.js.map → chunk-yv1psptb.js.map} +1 -1
  173. package/dist/{chunk-tk5q8hkv.js → chunk-zfter1x0.js} +4 -4
  174. package/dist/{chunk-tk5q8hkv.js.map → chunk-zfter1x0.js.map} +1 -1
  175. package/dist/client/index.d.ts +2 -0
  176. package/dist/client/index.d.ts.map +1 -1
  177. package/dist/client/index.js +214 -1
  178. package/dist/client/index.js.map +1 -1
  179. package/dist/client/useSubscription.d.ts +70 -0
  180. package/dist/client/useSubscription.d.ts.map +1 -0
  181. package/dist/config/index.js +1 -1
  182. package/dist/console/run.js +2 -2
  183. package/dist/console/run.js.map +2 -2
  184. package/dist/container/index.js +2 -2
  185. package/dist/container/index.js.map +1 -1
  186. package/dist/database/index.js +2 -2
  187. package/dist/database/index.js.map +1 -1
  188. package/dist/email/index.js +2 -2
  189. package/dist/email/index.js.map +1 -1
  190. package/dist/facades/ChangeFeed.d.ts +42 -0
  191. package/dist/facades/ChangeFeed.d.ts.map +1 -0
  192. package/dist/facades/index.d.ts +1 -0
  193. package/dist/facades/index.d.ts.map +1 -1
  194. package/dist/facades/index.js +2 -2
  195. package/dist/facades/index.js.map +1 -1
  196. package/dist/foundation/index.js +2 -2
  197. package/dist/foundation/index.js.map +1 -1
  198. package/dist/http/ResourcePolicy.d.ts +141 -0
  199. package/dist/http/ResourcePolicy.d.ts.map +1 -0
  200. package/dist/http/errors.d.ts +13 -0
  201. package/dist/http/errors.d.ts.map +1 -1
  202. package/dist/http/index.d.ts +2 -1
  203. package/dist/http/index.d.ts.map +1 -1
  204. package/dist/http/index.js +2 -2
  205. package/dist/http/index.js.map +1 -1
  206. package/dist/i18n/dictionaryRuntime.js +2 -2
  207. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  208. package/dist/i18n/index.js +2 -2
  209. package/dist/i18n/index.js.map +2 -2
  210. package/dist/kernel/index.js +3 -3
  211. package/dist/kernel/index.js.map +3 -3
  212. package/dist/kernel/providers.d.ts.map +1 -1
  213. package/dist/orm/index.js +2 -2
  214. package/dist/orm/index.js.map +1 -1
  215. package/dist/server/index.js +2 -2
  216. package/dist/server/index.js.map +1 -1
  217. package/dist/services/change-feed/ChangeFeedDriver.d.ts +94 -0
  218. package/dist/services/change-feed/ChangeFeedDriver.d.ts.map +1 -0
  219. package/dist/services/change-feed/ChangeFeedManager.d.ts +166 -0
  220. package/dist/services/change-feed/ChangeFeedManager.d.ts.map +1 -0
  221. package/dist/services/change-feed/ChangeFeedServiceProvider.d.ts +11 -0
  222. package/dist/services/change-feed/ChangeFeedServiceProvider.d.ts.map +1 -0
  223. package/dist/services/change-feed/DatabaseChangeFeedDriver.d.ts +84 -0
  224. package/dist/services/change-feed/DatabaseChangeFeedDriver.d.ts.map +1 -0
  225. package/dist/services/change-feed/MemoryChangeFeedDriver.d.ts +26 -0
  226. package/dist/services/change-feed/MemoryChangeFeedDriver.d.ts.map +1 -0
  227. package/dist/services/change-feed/changeFeedDriverContract.d.ts +8 -0
  228. package/dist/services/change-feed/changeFeedDriverContract.d.ts.map +1 -0
  229. package/dist/services/change-feed/config.d.ts +42 -0
  230. package/dist/services/change-feed/config.d.ts.map +1 -0
  231. package/dist/services/change-feed/cursor.d.ts +17 -0
  232. package/dist/services/change-feed/cursor.d.ts.map +1 -0
  233. package/dist/services/change-feed/postgresListen.d.ts +30 -0
  234. package/dist/services/change-feed/postgresListen.d.ts.map +1 -0
  235. package/dist/services/change-feed/stream.d.ts +16 -0
  236. package/dist/services/change-feed/stream.d.ts.map +1 -0
  237. package/dist/services/change-feed/wire.d.ts +20 -0
  238. package/dist/services/change-feed/wire.d.ts.map +1 -0
  239. package/dist/services/index.d.ts +9 -0
  240. package/dist/services/index.d.ts.map +1 -1
  241. package/dist/services/index.js +3 -3
  242. package/dist/services/index.js.map +2 -2
  243. package/dist/services/queue/work.js +2 -2
  244. package/dist/services/queue/work.js.map +1 -1
  245. package/dist/services/router/ViewRouteDispatcher.d.ts +16 -0
  246. package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
  247. package/dist/stats/route-table.js +1 -1
  248. package/dist/support/index.js +2 -2
  249. package/dist/support/index.js.map +1 -1
  250. package/dist/vitest/index.js +1 -1
  251. package/package.json +6 -2
  252. package/skills/gemi-react-best-practices/rules/controller-authorize-every-tenant-read.md +16 -1
  253. package/dist/chunk-11fsn5mr.js +0 -5
  254. package/dist/chunk-h3864a8z.js +0 -17
  255. package/dist/chunk-hn67spz6.js +0 -5
  256. package/dist/chunk-mb7q7s0a.js +0 -19
  257. package/dist/chunk-mn5xw79b.js +0 -9
  258. package/dist/chunk-tdsfke9q.js +0 -6
  259. package/dist/chunk-wqvvjd5r.js +0 -24
  260. package/dist/chunk-x78jrs4y.js +0 -4
  261. /package/dist/{chunk-0sjh5v1n.js.map → chunk-53bek7sp.js.map} +0 -0
  262. /package/dist/{chunk-td8tha3j.js.map → chunk-es487acc.js.map} +0 -0
  263. /package/dist/{chunk-et4pv1b1.js.map → chunk-mx9y9mtx.js.map} +0 -0
  264. /package/dist/{chunk-8b2tw2yp.js.map → chunk-rend2sbk.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{I as C}from"./chunk-ddr4qvvt.js";import{W as ne}from"./chunk-gb37722w.js";import"./chunk-8afxrmdc.js";import{aa as _}from"./chunk-a6453d9s.js";import{Ah as c,Eh as F}from"./chunk-1yx2e0bh.js";var x=c(_(),1),T=c(C(),1);var q=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var D=c(ne(),1);var u=c(_(),1),m=c(C(),1);var W=300000,h="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var j=async(e,o={},r)=>{let{SSOOIDCClient:t}=await import("./chunk-wsttx9rg.js").then((m)=>c(m.default,1)),n=(f)=>o.clientConfig?.[f]??o.parentClientConfig?.[f]??r?.[f];return new t(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:n("logger"),userAgentAppId:n("userAgentAppId")}))};var X=async(e,o,r={},t)=>{let{CreateTokenCommand:n}=await import("./chunk-wsttx9rg.js").then((m)=>c(m.default,1));return(await j(o,r,t)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var z=c(_(),1);var P=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new z.TokenProviderError(`Token is expired. ${h}`,!1)};var J=c(_(),1);var g=(e,o,r=!1)=>{if(typeof o>"u")throw new J.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${h}`,!1)};var V=c(C(),1);import{promises as re}from"fs";var{writeFile:te}=re,Y=(e,o)=>{let r=V.getSSOTokenFilepath(e),t=JSON.stringify(o,null,2);return te(r,t)};var B=new Date(0),Q=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let r=await m.parseKnownFiles(e),t=m.getProfileName({profile:e.profile??o?.profile}),n=r[t];if(!n)throw new u.TokenProviderError(`Profile '${t}' could not be found in shared credentials file.`,!1);else if(!n.sso_session)throw new u.TokenProviderError(`Profile '${t}' is missing required property 'sso_session'.`);let a=n.sso_session,p=(await m.loadSsoSessionData(e))[a];if(!p)throw new u.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let i of["sso_start_url","sso_region"])if(!p[i])throw new u.TokenProviderError(`Sso session '${a}' is missing required property '${i}'.`,!1);let{sso_start_url:S,sso_region:I}=p,s;try{s=await m.getSSOTokenFromFile(a)}catch(i){throw new u.TokenProviderError(`The SSO session token associated with profile=${t} was not found or is invalid. ${h}`,!1)}g("accessToken",s.accessToken),g("expiresAt",s.expiresAt);let{accessToken:y,expiresAt:E}=s,l={token:y,expiration:new Date(E)};if(l.expiration.getTime()-Date.now()>W)return l;if(Date.now()-B.getTime()<30000)return P(l),l;g("clientId",s.clientId,!0),g("clientSecret",s.clientSecret,!0),g("refreshToken",s.refreshToken,!0);try{B.setTime(Date.now());let i=await X(s,I,e,o);g("accessToken",i.accessToken),g("expiresIn",i.expiresIn);let O=new Date(Date.now()+i.expiresIn*1000);try{await Y(a,{...s,accessToken:i.accessToken,expiresAt:O.toISOString(),refreshToken:i.refreshToken})}catch(R){}return{token:i.accessToken,expiration:O}}catch(i){return P(l),l}};var k=c(_(),1),Z=c(C(),1),A=!1,$=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:r,ssoRegion:t,ssoRoleName:n,ssoClient:a,clientConfig:f,parentClientConfig:p,callerClientConfig:S,profile:I,filepath:s,configFilepath:y,ignoreCache:E,logger:l})=>{let i,O="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{let w=await Q({profile:I,filepath:s,configFilepath:y,ignoreCache:E})();i={accessToken:w.token,expiresAt:new Date(w.expiration).toISOString()}}catch(w){throw new k.CredentialsProviderError(w.message,{tryNextLink:A,logger:l})}else try{i=await Z.getSSOTokenFromFile(e)}catch(w){throw new k.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:A,logger:l})}if(new Date(i.expiresAt).getTime()-Date.now()<=0)throw new k.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:A,logger:l});let{accessToken:R}=i,{SSOClient:d,GetRoleCredentialsCommand:N}=await import("./chunk-hf7a51s3.js"),se=a||new d(Object.assign({},f??{},{logger:f?.logger??S?.logger??p?.logger,region:f?.region??t,userAgentAppId:f?.userAgentAppId??S?.userAgentAppId??p?.userAgentAppId})),L;try{L=await se.send(new N({accountId:r,roleName:n,accessToken:R}))}catch(w){throw new k.CredentialsProviderError(w,{tryNextLink:A,logger:l})}let{roleCredentials:{accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:b,credentialScope:H,accountId:U}={}}=L;if(!M||!G||!K||!b)throw new k.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:A,logger:l});let v={accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:new Date(b),...H&&{credentialScope:H},...U&&{accountId:U}};if(o)D.setCredentialFeature(v,"CREDENTIALS_SSO","s");else D.setCredentialFeature(v,"CREDENTIALS_SSO_LEGACY","u");return v};var ee=c(_(),1),oe=(e,o)=>{let{sso_start_url:r,sso_account_id:t,sso_region:n,sso_role_name:a}=e;if(!r||!t||!n||!a)throw new ee.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
2
+ import{Q as ne}from"./chunk-75ptmewf.js";import{_ as C}from"./chunk-5az0mq4p.js";import"./chunk-2taa0brj.js";import{aa as _}from"./chunk-b7cqwcbm.js";import{Sh as c,Wh as F}from"./chunk-ddad3902.js";var x=c(_(),1),T=c(C(),1);var q=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var D=c(ne(),1);var u=c(_(),1),m=c(C(),1);var W=300000,h="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var j=async(e,o={},r)=>{let{SSOOIDCClient:t}=await import("./chunk-mrdarm2q.js").then((m)=>c(m.default,1)),n=(f)=>o.clientConfig?.[f]??o.parentClientConfig?.[f]??r?.[f];return new t(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:n("logger"),userAgentAppId:n("userAgentAppId")}))};var X=async(e,o,r={},t)=>{let{CreateTokenCommand:n}=await import("./chunk-mrdarm2q.js").then((m)=>c(m.default,1));return(await j(o,r,t)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var z=c(_(),1);var P=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new z.TokenProviderError(`Token is expired. ${h}`,!1)};var J=c(_(),1);var g=(e,o,r=!1)=>{if(typeof o>"u")throw new J.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${h}`,!1)};var V=c(C(),1);import{promises as re}from"fs";var{writeFile:te}=re,Y=(e,o)=>{let r=V.getSSOTokenFilepath(e),t=JSON.stringify(o,null,2);return te(r,t)};var B=new Date(0),Q=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let r=await m.parseKnownFiles(e),t=m.getProfileName({profile:e.profile??o?.profile}),n=r[t];if(!n)throw new u.TokenProviderError(`Profile '${t}' could not be found in shared credentials file.`,!1);else if(!n.sso_session)throw new u.TokenProviderError(`Profile '${t}' is missing required property 'sso_session'.`);let a=n.sso_session,p=(await m.loadSsoSessionData(e))[a];if(!p)throw new u.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let i of["sso_start_url","sso_region"])if(!p[i])throw new u.TokenProviderError(`Sso session '${a}' is missing required property '${i}'.`,!1);let{sso_start_url:S,sso_region:I}=p,s;try{s=await m.getSSOTokenFromFile(a)}catch(i){throw new u.TokenProviderError(`The SSO session token associated with profile=${t} was not found or is invalid. ${h}`,!1)}g("accessToken",s.accessToken),g("expiresAt",s.expiresAt);let{accessToken:y,expiresAt:E}=s,l={token:y,expiration:new Date(E)};if(l.expiration.getTime()-Date.now()>W)return l;if(Date.now()-B.getTime()<30000)return P(l),l;g("clientId",s.clientId,!0),g("clientSecret",s.clientSecret,!0),g("refreshToken",s.refreshToken,!0);try{B.setTime(Date.now());let i=await X(s,I,e,o);g("accessToken",i.accessToken),g("expiresIn",i.expiresIn);let O=new Date(Date.now()+i.expiresIn*1000);try{await Y(a,{...s,accessToken:i.accessToken,expiresAt:O.toISOString(),refreshToken:i.refreshToken})}catch(R){}return{token:i.accessToken,expiration:O}}catch(i){return P(l),l}};var k=c(_(),1),Z=c(C(),1),A=!1,$=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:r,ssoRegion:t,ssoRoleName:n,ssoClient:a,clientConfig:f,parentClientConfig:p,callerClientConfig:S,profile:I,filepath:s,configFilepath:y,ignoreCache:E,logger:l})=>{let i,O="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{let w=await Q({profile:I,filepath:s,configFilepath:y,ignoreCache:E})();i={accessToken:w.token,expiresAt:new Date(w.expiration).toISOString()}}catch(w){throw new k.CredentialsProviderError(w.message,{tryNextLink:A,logger:l})}else try{i=await Z.getSSOTokenFromFile(e)}catch(w){throw new k.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:A,logger:l})}if(new Date(i.expiresAt).getTime()-Date.now()<=0)throw new k.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:A,logger:l});let{accessToken:R}=i,{SSOClient:d,GetRoleCredentialsCommand:N}=await import("./chunk-18c3y8m3.js"),se=a||new d(Object.assign({},f??{},{logger:f?.logger??S?.logger??p?.logger,region:f?.region??t,userAgentAppId:f?.userAgentAppId??S?.userAgentAppId??p?.userAgentAppId})),L;try{L=await se.send(new N({accountId:r,roleName:n,accessToken:R}))}catch(w){throw new k.CredentialsProviderError(w,{tryNextLink:A,logger:l})}let{roleCredentials:{accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:b,credentialScope:H,accountId:U}={}}=L;if(!M||!G||!K||!b)throw new k.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:A,logger:l});let v={accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:new Date(b),...H&&{credentialScope:H},...U&&{accountId:U}};if(o)D.setCredentialFeature(v,"CREDENTIALS_SSO","s");else D.setCredentialFeature(v,"CREDENTIALS_SSO_LEGACY","u");return v};var ee=c(_(),1),oe=(e,o)=>{let{sso_start_url:r,sso_account_id:t,sso_region:n,sso_role_name:a}=e;if(!r||!t||!n||!a)throw new ee.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
3
3
  Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:o});return e};var Ce=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:r,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoSession:f}=e,{ssoClient:p}=e,S=T.getProfileName({profile:e.profile??o?.profile});if(!r&&!t&&!n&&!a&&!f){let s=(await T.parseKnownFiles(e))[S];if(!s)throw new x.CredentialsProviderError(`Profile ${S} was not found.`,{logger:e.logger});if(!q(s))throw new x.CredentialsProviderError(`Profile ${S} is not configured with SSO credentials.`,{logger:e.logger});if(s?.sso_session){let d=(await T.loadSsoSessionData(e))[s.sso_session],N=` configurations in profile ${S} and sso-session ${s.sso_session}`;if(n&&n!==d.sso_region)throw new x.CredentialsProviderError("Conflicting SSO region"+N,{tryNextLink:!1,logger:e.logger});if(r&&r!==d.sso_start_url)throw new x.CredentialsProviderError("Conflicting SSO start_url"+N,{tryNextLink:!1,logger:e.logger});s.sso_region=d.sso_region,s.sso_start_url=d.sso_start_url}let{sso_start_url:y,sso_account_id:E,sso_region:l,sso_role_name:i,sso_session:O}=oe(s,e.logger);return $({ssoStartUrl:y,ssoSession:O,ssoAccountId:E,ssoRegion:l,ssoRoleName:i,ssoClient:p,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:S,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}else if(!r||!t||!n||!a)throw new x.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return $({ssoStartUrl:r,ssoSession:f,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoClient:p,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:S,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})};export{oe as validateSsoProfile,q as isSsoProfile,Ce as fromSSO};
4
4
 
5
- //# debugId=98BFC973E31DAF9B64756E2164756E21
5
+ //# debugId=BE0E7225D4D58D6C64756E2164756E21
@@ -15,6 +15,6 @@
15
15
  "import { CredentialsProviderError } from \"@smithy/property-provider\";\nexport const validateSsoProfile = (profile, logger) => {\n const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;\n if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {\n throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters \"sso_account_id\", ` +\n `\"sso_region\", \"sso_role_name\", \"sso_start_url\". Got ${Object.keys(profile).join(\", \")}\\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });\n }\n return profile;\n};\n"
16
16
  ],
17
17
  "mappings": ";+NAAA,SACA,KCDO,FAAM,JAAe,CAAC,IAAQ,IAChC,OAAO,EAAI,gBAAkB,UAC1B,OAAO,EAAI,iBAAmB,UAC9B,OAAO,EAAI,cAAgB,UAC3B,OAAO,EAAI,aAAe,UAC1B,OAAO,EAAI,gBAAkB,UCLrC,gBCAA,eACA,WCDO,IAAM,EAAmB,OACnB,EAAkB,kFCDxB,IAAM,EAAmB,MAAO,EAAW,EAAO,CAAC,EAAG,IAAuB,CAChF,IAAQ,iBAAkB,KAAa,yDACjC,EAAW,CAAC,IAAS,EAAK,eAAe,IAAS,EAAK,qBAAqB,IAAS,IAAqB,GAMhH,OALsB,IAAI,EAAc,OAAO,OAAO,CAAC,EAAG,EAAK,cAAgB,CAAC,EAAG,CAC/E,OAAQ,GAAa,EAAK,cAAc,OACxC,OAAQ,EAAS,QAAQ,EACzB,eAAgB,EAAS,gBAAgB,CAC7C,CAAC,CAAC,GCNC,IAAM,EAAqB,MAAO,EAAU,EAAW,EAAO,CAAC,EAAG,IAAuB,CAC5F,IAAQ,sBAAuB,KAAa,yDAE5C,OADsB,MAAM,EAAiB,EAAW,EAAM,CAAkB,GAC3D,KAAK,IAAI,EAAmB,CAC7C,SAAU,EAAS,SACnB,aAAc,EAAS,aACvB,aAAc,EAAS,aACvB,UAAW,eACf,CAAC,CAAC,GCTN,eAEO,IAAM,EAAsB,CAAC,IAAU,CAC1C,GAAI,EAAM,YAAc,EAAM,WAAW,QAAQ,EAAI,KAAK,IAAI,EAC1D,MAAM,IAAI,qBAAmB,qBAAqB,IAAmB,EAAK,GCJlF,eAEO,IAAM,EAAmB,CA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EAAK,aACnB,mBAAoB,EAAK,mBACzB,mBAAoB,EAAK,mBACzB,QAAS,EACT,SAAU,EAAK,SACf,eAAgB,EAAK,eACrB,YAAa,EAAK,YAClB,OAAQ,EAAK,MACjB,CAAC,EAEA,QAAI,CAAC,GAAe,CAAC,GAAgB,CAAC,GAAa,CAAC,EACrD,MAAM,IAAI,2BAAyB,+HAC8B,CAAE,YAAa,GAAO,OAAQ,EAAK,MAAO,CAAC,EAG5G,YAAO,EAAsB,CACzB,cACA,aACA,eACA,YACA,cACA,YACA,aAAc,EAAK,aACnB,mBAAoB,EAAK,mBACzB,mBAAoB,EAAK,mBACzB,QAAS,EACT,SAAU,EAAK,SACf,eAAgB,EAAK,eACrB,YAAa,EAAK,YAClB,OAAQ,EAAK,MACjB,CAAC",
18
- "debugId": "98BFC973E31DAF9B64756E2164756E21",
18
+ "debugId": "BE0E7225D4D58D6C64756E2164756E21",
19
19
  "names": []
20
20
  }
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ class m{name;cron;withoutOverlapping=!1;onOneServer=!1;shouldRun(){return!0}callback(f){}onTick(){}onComplete(){}static exp(f){return f}}
3
+ export{m as bc};
4
+
5
+ //# debugId=F5243EDFB1BD419864756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../services/cron/CronJob.ts"],
4
+ "sourcesContent": [
5
+ "// A cron expression accepted by `Bun.cron`: a 5-field expression\n// (`minute hour day-of-month month day-of-week`, interpreted in UTC) or one of\n// the nicknames below. The `string & {}` member keeps arbitrary expressions\n// assignable while still surfacing the nicknames in editor autocomplete.\nexport type CronExpression =\n | \"@yearly\"\n | \"@annually\"\n | \"@monthly\"\n | \"@weekly\"\n | \"@daily\"\n | \"@midnight\"\n | \"@hourly\"\n | (string & {});\n\nimport type { HeldLock } from \"../lock/LockManager\";\n\nexport type WithoutOverlapping =\n | boolean\n | {\n /**\n * The lock's lease, in milliseconds: how long it outlives an instance\n * that died holding it. Renewed every third of this while the tick\n * runs, so it does not limit how long a tick may take. Default five\n * minutes.\n */\n expiresAfter?: number;\n };\n\nexport class CronJob {\n name: string;\n cron: CronExpression;\n\n /**\n * Skips a tick while an earlier tick of this job is still running, on this\n * instance or any other sharing the queue's storage. With the database\n * queue driver that is a lock row in `gemi_locks`; with the memory driver\n * it only covers this process.\n *\n * The lock is held across `onTick`, `callback` and `onComplete`, and handed\n * to `callback` as its argument. If its lease is lost while the tick runs\n * (the instance stalled past `expiresAfter`), `lock.lost` aborts and the\n * scheduler logs it. Writes that must not land after that go through\n * `lock.fence(...)`.\n *\n * It does not stop a second instance from running the same tick after the\n * first one finished; `onOneServer` does.\n */\n withoutOverlapping: WithoutOverlapping = false;\n\n /**\n * Runs each tick on one instance only, across every instance sharing the\n * queue's storage: the first to claim the tick's minute runs it, the others\n * skip it. Assumes the instances' clocks agree to well within a minute.\n */\n onOneServer = false;\n\n /**\n * Decides whether this tick happens at all. Evaluated once per tick, before\n * anything else; returning `false` skips `onTick`, `callback` and\n * `onComplete` alike.\n *\n * ### Why this is a member and not a line the job writes for itself\n *\n * A job that reports outward — mails a digest, opens a Sentry issue, pings a\n * channel — must not fire from a laptop, and the guard for that has to cover\n * the whole tick. There was nowhere to write it. gemi calls `onTick` and\n * `onComplete` *outside* `callback`, so a guard placed in a lifecycle hook\n * only stops the hook it lives in: an early `return` at the top of `callback`\n * leaves the job still announcing that it started and still announcing that\n * it finished, which for an outward-reporting job is most of the damage.\n *\n * The only construct that covered every hook was an abstract base class that\n * shadowed `callback` with the guard and renamed the real body to `run()` —\n * and that costs the app the framework's own vocabulary. A job then reads\n * `async run()` while every page of the documentation reads `async\n * callback()`, so the next person to follow the docs writes a `callback` the\n * base class never calls: no error, no output, a job that silently does\n * nothing. Forgetting *this* member fails the other way round — the job runs,\n * which is what it did before anyone asked for a gate.\n *\n * ### What it gates\n *\n * Work, not registration. A job whose gate returns `false` is still\n * scheduled, still holds its `Bun.cron` handle, and still appears in\n * `app(Scheduler).jobs` — \"is it scheduled\" and \"will it do anything\" are\n * different questions and the second one is answered per tick. That is also\n * why this is a method: a field would be read once, when the scheduler\n * constructs the job at boot, and would freeze whatever it saw then.\n *\n * A gate that throws is logged and treated as `false`. Cron work recurs, so\n * a skipped tick is recovered by the next one, while an email sent from the\n * wrong machine is not recovered at all.\n *\n * ### Composing with a base class\n *\n * Nothing here calls `super` for you. A subclass that overrides `shouldRun`\n * for its own reason silently replaces whatever its base was gating on, so\n * narrow rather than redefine:\n *\n * ```typescript\n * async shouldRun() {\n * return (await super.shouldRun()) && this.hasSubscribers();\n * }\n * ```\n *\n * A shared base should annotate its return type as written here rather than\n * let it be inferred: a base returning a plain `boolean` narrows the\n * signature its subclasses inherit, and the `await super` above then does not\n * typecheck against it.\n */\n shouldRun(): Promise<boolean> | boolean {\n return true;\n }\n\n /**\n * The tick's work. `lock` is the `withoutOverlapping` lock when the job\n * declares one.\n */\n callback(_lock?: HeldLock): Promise<void> | void {}\n onTick(): Promise<void> | void {}\n onComplete(): Promise<void> | void {}\n\n static exp(expression: CronExpression) {\n return expression;\n }\n}\n"
6
+ ],
7
+ "mappings": ";AA4BO,MAAM,CAAQ,CACnB,KACA,KAiBA,mBAAyC,GAOzC,YAAc,GAwDd,SAAS,EAA+B,CACtC,MAAO,GAOT,QAAQ,CAAC,EAAwC,EACjD,MAAM,EAAyB,EAC/B,UAAU,EAAyB,QAE5B,IAAG,CAAC,EAA4B,CACrC,OAAO,EAEX",
8
+ "debugId": "F5243EDFB1BD419864756E2164756E21",
9
+ "names": []
10
+ }