gemi 0.218.0 → 0.220.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 (238) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai/index.js.map +2 -2
  3. package/dist/ai/testing/index.js +2 -2
  4. package/dist/ai/testing/index.js.map +1 -1
  5. package/dist/app/index.js +1 -1
  6. package/dist/bun/plugin.js +1 -1
  7. package/dist/bun/preload.js +1 -1
  8. package/dist/{chunk-xyv3y476.js → chunk-0av1gyns.js} +3 -3
  9. package/dist/{chunk-xyv3y476.js.map → chunk-0av1gyns.js.map} +1 -1
  10. package/dist/{chunk-yxtfg4wy.js → chunk-0k2r6bep.js} +2 -2
  11. package/dist/{chunk-yxtfg4wy.js.map → chunk-0k2r6bep.js.map} +1 -1
  12. package/dist/chunk-169e9dg7.js +517 -0
  13. package/dist/chunk-169e9dg7.js.map +25 -0
  14. package/dist/{chunk-xp5mmgfp.js → chunk-2vv04thj.js} +2 -2
  15. package/dist/{chunk-xp5mmgfp.js.map → chunk-2vv04thj.js.map} +1 -1
  16. package/dist/{chunk-gxfyd8wr.js → chunk-2y0nr525.js} +3 -3
  17. package/dist/{chunk-gxfyd8wr.js.map → chunk-2y0nr525.js.map} +1 -1
  18. package/dist/{chunk-aes0ecnp.js → chunk-37209psn.js} +3 -3
  19. package/dist/{chunk-aes0ecnp.js.map → chunk-37209psn.js.map} +1 -1
  20. package/dist/{chunk-yedb5vvg.js → chunk-3dkv4989.js} +2 -2
  21. package/dist/{chunk-5gp49wph.js.map → chunk-3dkv4989.js.map} +1 -1
  22. package/dist/{chunk-5wh3cw2x.js → chunk-3y91vexx.js} +3 -3
  23. package/dist/{chunk-5wh3cw2x.js.map → chunk-3y91vexx.js.map} +1 -1
  24. package/dist/{chunk-4s72m6zx.js → chunk-4v5nwqw6.js} +3 -3
  25. package/dist/{chunk-4s72m6zx.js.map → chunk-4v5nwqw6.js.map} +1 -1
  26. package/dist/{chunk-v0sgcy87.js → chunk-4wh4dfgf.js} +1 -1
  27. package/dist/{chunk-1nw9jhpt.js → chunk-50791bmz.js} +2 -2
  28. package/dist/{chunk-1nw9jhpt.js.map → chunk-50791bmz.js.map} +1 -1
  29. package/dist/{chunk-rp2f9mq1.js → chunk-55btq9c7.js} +2 -2
  30. package/dist/{chunk-rp2f9mq1.js.map → chunk-55btq9c7.js.map} +1 -1
  31. package/dist/{chunk-w3ks9nz7.js → chunk-5h2xj3cx.js} +2 -2
  32. package/dist/{chunk-w3ks9nz7.js.map → chunk-5h2xj3cx.js.map} +1 -1
  33. package/dist/{chunk-at6zjajz.js → chunk-5jvbr0e5.js} +2 -2
  34. package/dist/{chunk-at6zjajz.js.map → chunk-5jvbr0e5.js.map} +1 -1
  35. package/dist/{chunk-hmtn7996.js → chunk-5mrtgr7q.js} +2 -2
  36. package/dist/{chunk-hmtn7996.js.map → chunk-5mrtgr7q.js.map} +1 -1
  37. package/dist/{chunk-9g5qh1ya.js → chunk-6d67a1d4.js} +2 -2
  38. package/dist/{chunk-9g5qh1ya.js.map → chunk-6d67a1d4.js.map} +1 -1
  39. package/dist/{chunk-q0d45r2j.js → chunk-6r7956dh.js} +2 -2
  40. package/dist/{chunk-q0d45r2j.js.map → chunk-6r7956dh.js.map} +1 -1
  41. package/dist/{chunk-ee7xb9qr.js → chunk-6ttbhhnn.js} +1 -1
  42. package/dist/{chunk-w85wrer7.js → chunk-726gd69z.js} +2 -2
  43. package/dist/{chunk-w85wrer7.js.map → chunk-726gd69z.js.map} +1 -1
  44. package/dist/{chunk-dgna0e7g.js → chunk-79wjkaa4.js} +2 -2
  45. package/dist/{chunk-dgna0e7g.js.map → chunk-79wjkaa4.js.map} +1 -1
  46. package/dist/{chunk-gxd1388t.js → chunk-7etvj6w2.js} +2 -2
  47. package/dist/{chunk-gxd1388t.js.map → chunk-7etvj6w2.js.map} +1 -1
  48. package/dist/chunk-7sjzgme6.js +88 -0
  49. package/dist/{chunk-sxxkkx75.js.map → chunk-7sjzgme6.js.map} +3 -10
  50. package/dist/chunk-89egc0h3.js +5 -0
  51. package/dist/{chunk-d6bgh2nr.js.map → chunk-89egc0h3.js.map} +1 -1
  52. package/dist/{chunk-4k3r37be.js → chunk-8a3fqcf0.js} +2 -2
  53. package/dist/{chunk-4k3r37be.js.map → chunk-8a3fqcf0.js.map} +1 -1
  54. package/dist/{chunk-3r7z4kc0.js → chunk-8ddt5fa2.js} +2 -2
  55. package/dist/{chunk-3r7z4kc0.js.map → chunk-8ddt5fa2.js.map} +1 -1
  56. package/dist/chunk-8gnbc9dg.js +8 -0
  57. package/dist/{chunk-xese0rng.js.map → chunk-8gnbc9dg.js.map} +4 -5
  58. package/dist/{chunk-c95ds04p.js → chunk-8nctfg18.js} +2 -2
  59. package/dist/{chunk-c95ds04p.js.map → chunk-8nctfg18.js.map} +1 -1
  60. package/dist/{chunk-17agj0r3.js → chunk-8vpe54ek.js} +2 -2
  61. package/dist/{chunk-17agj0r3.js.map → chunk-8vpe54ek.js.map} +1 -1
  62. package/dist/{chunk-9c8e4nkz.js → chunk-97tj0d7v.js} +2 -2
  63. package/dist/{chunk-9c8e4nkz.js.map → chunk-97tj0d7v.js.map} +1 -1
  64. package/dist/{chunk-7081awrd.js → chunk-9yascc81.js} +2 -2
  65. package/dist/{chunk-7081awrd.js.map → chunk-9yascc81.js.map} +1 -1
  66. package/dist/{chunk-9pvxexh1.js → chunk-adw279ge.js} +2 -2
  67. package/dist/{chunk-9pvxexh1.js.map → chunk-adw279ge.js.map} +1 -1
  68. package/dist/{chunk-ncw3zjxm.js → chunk-anc5v266.js} +2 -2
  69. package/dist/{chunk-ncw3zjxm.js.map → chunk-anc5v266.js.map} +1 -1
  70. package/dist/{chunk-6b7z5h54.js → chunk-ax042w6k.js} +2 -2
  71. package/dist/{chunk-6b7z5h54.js.map → chunk-ax042w6k.js.map} +1 -1
  72. package/dist/{chunk-b1pps9bj.js → chunk-b87wvmsz.js} +2 -2
  73. package/dist/{chunk-b1pps9bj.js.map → chunk-b87wvmsz.js.map} +1 -1
  74. package/dist/{chunk-xn7azkgd.js → chunk-bqm79ar0.js} +3 -3
  75. package/dist/{chunk-xn7azkgd.js.map → chunk-bqm79ar0.js.map} +1 -1
  76. package/dist/{chunk-5gp49wph.js → chunk-cf8bztwq.js} +2 -2
  77. package/dist/{chunk-yedb5vvg.js.map → chunk-cf8bztwq.js.map} +1 -1
  78. package/dist/{chunk-kggwk7hz.js → chunk-dj0nvj66.js} +1 -1
  79. package/dist/{chunk-xf3wke41.js → chunk-e4zxacxd.js} +2 -2
  80. package/dist/{chunk-xf3wke41.js.map → chunk-e4zxacxd.js.map} +1 -1
  81. package/dist/{chunk-b8tmmpcf.js → chunk-fp9yn4k8.js} +2 -2
  82. package/dist/{chunk-b8tmmpcf.js.map → chunk-fp9yn4k8.js.map} +1 -1
  83. package/dist/{chunk-sba3s380.js → chunk-fqhkkpq3.js} +2 -2
  84. package/dist/{chunk-sba3s380.js.map → chunk-fqhkkpq3.js.map} +1 -1
  85. package/dist/{chunk-nhebjh6n.js → chunk-fxa72ppw.js} +1 -1
  86. package/dist/{chunk-w9sw2kn7.js → chunk-gyszenps.js} +3 -3
  87. package/dist/{chunk-w9sw2kn7.js.map → chunk-gyszenps.js.map} +1 -1
  88. package/dist/{chunk-eh3ktv8k.js → chunk-h1wmpa03.js} +2 -2
  89. package/dist/{chunk-eh3ktv8k.js.map → chunk-h1wmpa03.js.map} +1 -1
  90. package/dist/{chunk-5vdkqv17.js → chunk-h9nt7hm6.js} +2 -2
  91. package/dist/{chunk-5vdkqv17.js.map → chunk-h9nt7hm6.js.map} +1 -1
  92. package/dist/{chunk-s7jwsbfd.js → chunk-j9abwrkv.js} +3 -3
  93. package/dist/{chunk-s7jwsbfd.js.map → chunk-j9abwrkv.js.map} +1 -1
  94. package/dist/{chunk-m68cxnbv.js → chunk-jf2dr481.js} +2 -2
  95. package/dist/{chunk-m68cxnbv.js.map → chunk-jf2dr481.js.map} +1 -1
  96. package/dist/{chunk-h6knw9f0.js → chunk-k16phdjv.js} +1 -1
  97. package/dist/{chunk-vewxnk3g.js → chunk-k6af7qek.js} +2 -2
  98. package/dist/{chunk-vewxnk3g.js.map → chunk-k6af7qek.js.map} +1 -1
  99. package/dist/{chunk-bcfwa370.js → chunk-kp7wcpx7.js} +2 -2
  100. package/dist/{chunk-bcfwa370.js.map → chunk-kp7wcpx7.js.map} +1 -1
  101. package/dist/{chunk-d6056zme.js → chunk-mt82209n.js} +2 -2
  102. package/dist/{chunk-d6056zme.js.map → chunk-mt82209n.js.map} +1 -1
  103. package/dist/{chunk-vawqmdh4.js → chunk-ncnygh0s.js} +2 -2
  104. package/dist/{chunk-vawqmdh4.js.map → chunk-ncnygh0s.js.map} +1 -1
  105. package/dist/{chunk-g178aect.js → chunk-nqgeny8m.js} +4 -4
  106. package/dist/{chunk-g178aect.js.map → chunk-nqgeny8m.js.map} +1 -1
  107. package/dist/{chunk-zy6hj5cc.js → chunk-nqqyn3cx.js} +2 -2
  108. package/dist/{chunk-zy6hj5cc.js.map → chunk-nqqyn3cx.js.map} +1 -1
  109. package/dist/{chunk-ppdfwnqw.js → chunk-nzd7z4s6.js} +1 -1
  110. package/dist/{chunk-m0pfdc1n.js → chunk-p4v71qfx.js} +3 -3
  111. package/dist/{chunk-m0pfdc1n.js.map → chunk-p4v71qfx.js.map} +1 -1
  112. package/dist/{chunk-vck02shp.js → chunk-ps5rpy9n.js} +2 -2
  113. package/dist/{chunk-vck02shp.js.map → chunk-ps5rpy9n.js.map} +1 -1
  114. package/dist/{chunk-gt6eq1p2.js → chunk-pxjkxhf9.js} +3 -3
  115. package/dist/{chunk-gt6eq1p2.js.map → chunk-pxjkxhf9.js.map} +1 -1
  116. package/dist/{chunk-r90djdx6.js → chunk-pxjptskr.js} +2 -2
  117. package/dist/{chunk-r90djdx6.js.map → chunk-pxjptskr.js.map} +1 -1
  118. package/dist/{chunk-6ncn8rdn.js → chunk-q5xcjm5z.js} +2 -2
  119. package/dist/{chunk-6ncn8rdn.js.map → chunk-q5xcjm5z.js.map} +1 -1
  120. package/dist/{chunk-ww62b10k.js → chunk-qs2xvc8g.js} +2 -2
  121. package/dist/{chunk-ww62b10k.js.map → chunk-qs2xvc8g.js.map} +1 -1
  122. package/dist/{chunk-sqqh78tf.js → chunk-qy0k2s5f.js} +2 -2
  123. package/dist/{chunk-sqqh78tf.js.map → chunk-qy0k2s5f.js.map} +1 -1
  124. package/dist/{chunk-jzqywxpj.js → chunk-rat2827k.js} +2 -2
  125. package/dist/{chunk-jzqywxpj.js.map → chunk-rat2827k.js.map} +1 -1
  126. package/dist/{chunk-ykshxc5k.js → chunk-s3gn68dy.js} +2 -2
  127. package/dist/{chunk-ykshxc5k.js.map → chunk-s3gn68dy.js.map} +1 -1
  128. package/dist/{chunk-8524ejgk.js → chunk-sfrjkysf.js} +2 -2
  129. package/dist/{chunk-8524ejgk.js.map → chunk-sfrjkysf.js.map} +1 -1
  130. package/dist/{chunk-fq7wkefg.js → chunk-snmyjq03.js} +2 -2
  131. package/dist/{chunk-fq7wkefg.js.map → chunk-snmyjq03.js.map} +1 -1
  132. package/dist/{chunk-cwm5x7rf.js → chunk-swmf6w3z.js} +2 -2
  133. package/dist/{chunk-cwm5x7rf.js.map → chunk-swmf6w3z.js.map} +1 -1
  134. package/dist/{chunk-evgs2tr8.js → chunk-t0ke72e9.js} +2 -2
  135. package/dist/{chunk-evgs2tr8.js.map → chunk-t0ke72e9.js.map} +2 -2
  136. package/dist/{chunk-snt0523y.js → chunk-t586p2g2.js} +2 -2
  137. package/dist/{chunk-snt0523y.js.map → chunk-t586p2g2.js.map} +1 -1
  138. package/dist/{chunk-zyvmbqcx.js → chunk-t8ygf6zj.js} +3 -3
  139. package/dist/{chunk-zyvmbqcx.js.map → chunk-t8ygf6zj.js.map} +1 -1
  140. package/dist/chunk-tac25cnj.js +39 -0
  141. package/dist/chunk-tac25cnj.js.map +20 -0
  142. package/dist/{chunk-7t13vyzg.js → chunk-vcw98sp6.js} +3 -3
  143. package/dist/{chunk-7t13vyzg.js.map → chunk-vcw98sp6.js.map} +1 -1
  144. package/dist/{chunk-tw338bbv.js → chunk-vcy1y0ta.js} +2 -2
  145. package/dist/{chunk-tw338bbv.js.map → chunk-vcy1y0ta.js.map} +1 -1
  146. package/dist/{chunk-fhb00fjx.js → chunk-vmmjq9fn.js} +2 -2
  147. package/dist/{chunk-fhb00fjx.js.map → chunk-vmmjq9fn.js.map} +1 -1
  148. package/dist/{chunk-prc4bcgp.js → chunk-wt4ekzp9.js} +2 -2
  149. package/dist/{chunk-prc4bcgp.js.map → chunk-wt4ekzp9.js.map} +1 -1
  150. package/dist/{chunk-k8nsefzb.js → chunk-wy82t7mz.js} +2 -2
  151. package/dist/{chunk-k8nsefzb.js.map → chunk-wy82t7mz.js.map} +1 -1
  152. package/dist/{chunk-7rmb1v9c.js → chunk-x3pbssy4.js} +2 -2
  153. package/dist/{chunk-7rmb1v9c.js.map → chunk-x3pbssy4.js.map} +1 -1
  154. package/dist/chunk-xjgfmefy.js +19 -0
  155. package/dist/{chunk-4sbrvmz9.js.map → chunk-xjgfmefy.js.map} +3 -3
  156. package/dist/{chunk-qstjm3cb.js → chunk-yj7pbbnm.js} +2 -2
  157. package/dist/{chunk-qstjm3cb.js.map → chunk-yj7pbbnm.js.map} +1 -1
  158. package/dist/{chunk-qa528feb.js → chunk-zmt5kdpb.js} +2 -2
  159. package/dist/{chunk-qa528feb.js.map → chunk-zmt5kdpb.js.map} +1 -1
  160. package/dist/client/index.d.ts +2 -0
  161. package/dist/client/index.d.ts.map +1 -1
  162. package/dist/client/index.js +54 -1
  163. package/dist/client/index.js.map +1 -1
  164. package/dist/client/useWorkflow.d.ts +51 -0
  165. package/dist/client/useWorkflow.d.ts.map +1 -0
  166. package/dist/config/index.js +1 -1
  167. package/dist/console/run.js +2 -2
  168. package/dist/console/run.js.map +1 -1
  169. package/dist/container/index.js +2 -2
  170. package/dist/container/index.js.map +1 -1
  171. package/dist/database/index.js +2 -2
  172. package/dist/database/index.js.map +1 -1
  173. package/dist/email/index.js +2 -2
  174. package/dist/email/index.js.map +1 -1
  175. package/dist/facades/index.js +2 -2
  176. package/dist/facades/index.js.map +1 -1
  177. package/dist/foundation/index.js +2 -2
  178. package/dist/foundation/index.js.map +1 -1
  179. package/dist/http/index.js +2 -2
  180. package/dist/http/index.js.map +1 -1
  181. package/dist/i18n/dictionaryRuntime.js +2 -2
  182. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  183. package/dist/i18n/index.js +2 -2
  184. package/dist/i18n/index.js.map +1 -1
  185. package/dist/kernel/index.js +2 -2
  186. package/dist/kernel/index.js.map +1 -1
  187. package/dist/orm/index.js +2 -2
  188. package/dist/orm/index.js.map +1 -1
  189. package/dist/probe/index.js +2 -2
  190. package/dist/probe/index.js.map +1 -1
  191. package/dist/server/index.js +2 -2
  192. package/dist/server/index.js.map +1 -1
  193. package/dist/services/index.d.ts +4 -2
  194. package/dist/services/index.d.ts.map +1 -1
  195. package/dist/services/index.js +3 -3
  196. package/dist/services/index.js.map +2 -2
  197. package/dist/services/queue/DatabaseQueueDriver.d.ts +8 -1
  198. package/dist/services/queue/DatabaseQueueDriver.d.ts.map +1 -1
  199. package/dist/services/queue/QueueManager.d.ts +2 -0
  200. package/dist/services/queue/QueueManager.d.ts.map +1 -1
  201. package/dist/services/queue/work.js +2 -2
  202. package/dist/services/queue/work.js.map +1 -1
  203. package/dist/services/queue/workflow/DatabaseWorkflowStore.d.ts +21 -0
  204. package/dist/services/queue/workflow/DatabaseWorkflowStore.d.ts.map +1 -1
  205. package/dist/services/queue/workflow/ItemSource.d.ts +68 -0
  206. package/dist/services/queue/workflow/ItemSource.d.ts.map +1 -0
  207. package/dist/services/queue/workflow/MemoryWorkflowStore.d.ts +12 -0
  208. package/dist/services/queue/workflow/MemoryWorkflowStore.d.ts.map +1 -1
  209. package/dist/services/queue/workflow/Step.d.ts +30 -10
  210. package/dist/services/queue/workflow/Step.d.ts.map +1 -1
  211. package/dist/services/queue/workflow/Workflow.d.ts +26 -38
  212. package/dist/services/queue/workflow/Workflow.d.ts.map +1 -1
  213. package/dist/services/queue/workflow/WorkflowRuntime.d.ts +45 -0
  214. package/dist/services/queue/workflow/WorkflowRuntime.d.ts.map +1 -1
  215. package/dist/services/queue/workflow/WorkflowStore.d.ts +25 -17
  216. package/dist/services/queue/workflow/WorkflowStore.d.ts.map +1 -1
  217. package/dist/services/queue/workflow/wire.d.ts +71 -0
  218. package/dist/services/queue/workflow/wire.d.ts.map +1 -0
  219. package/dist/services/queue/workflow/workflowContract.d.ts.map +1 -1
  220. package/dist/stats/route-table.js +1 -1
  221. package/dist/support/index.js +2 -2
  222. package/dist/support/index.js.map +1 -1
  223. package/dist/vitest/index.js +1 -1
  224. package/package.json +1 -1
  225. package/dist/chunk-4sbrvmz9.js +0 -19
  226. package/dist/chunk-d6bgh2nr.js +0 -5
  227. package/dist/chunk-ktee4gy4.js +0 -484
  228. package/dist/chunk-ktee4gy4.js.map +0 -23
  229. package/dist/chunk-sxxkkx75.js +0 -117
  230. package/dist/chunk-xb0evp2m.js +0 -5
  231. package/dist/chunk-xb0evp2m.js.map +0 -12
  232. package/dist/chunk-xese0rng.js +0 -13
  233. /package/dist/{chunk-v0sgcy87.js.map → chunk-4wh4dfgf.js.map} +0 -0
  234. /package/dist/{chunk-ee7xb9qr.js.map → chunk-6ttbhhnn.js.map} +0 -0
  235. /package/dist/{chunk-kggwk7hz.js.map → chunk-dj0nvj66.js.map} +0 -0
  236. /package/dist/{chunk-nhebjh6n.js.map → chunk-fxa72ppw.js.map} +0 -0
  237. /package/dist/{chunk-h6knw9f0.js.map → chunk-k16phdjv.js.map} +0 -0
  238. /package/dist/{chunk-ppdfwnqw.js.map → chunk-nzd7z4s6.js.map} +0 -0
@@ -14,6 +14,7 @@
14
14
  * a workflow sleeps) is decided by the runtime, in the `decide` callback of
15
15
  * `update`, while the store holds the workflow exclusively.
16
16
  */
17
+ import type { StepRunStatus, WorkflowRunStatus } from "./wire";
17
18
  import type { EnqueueBatch } from "../QueueDriver";
18
19
  /** The registered name the internal tick job runs under. */
19
20
  export declare const WORKFLOW_TICK_JOB = "gemi.WorkflowTick";
@@ -22,22 +23,7 @@ export declare const WORKFLOW_TICK_JOB = "gemi.WorkflowTick";
22
23
  * as JSON, in bytes. Store an id for anything larger.
23
24
  */
24
25
  export declare const WORKFLOW_OUTPUT_LIMIT: number;
25
- /**
26
- * Where a workflow stands.
27
- *
28
- * - `running`: a tick is running it, or one is queued to.
29
- * - `sleeping`: waiting for a `step.sleep` or a step's retry backoff.
30
- * - `waiting`: waiting for a signal (`step.waitFor`) or a batch (`step.batch`).
31
- * - `cancelling`: `cancel` was accepted, and `onCancel` has not finished yet.
32
- * - `completed`, `failed`, `cancelled`: final.
33
- */
34
- export type WorkflowRunStatus = "running" | "sleeping" | "waiting" | "completed" | "failed" | "cancelling" | "cancelled";
35
- /**
36
- * Where one step stands. `signalled` is a signal that arrived before its
37
- * `step.waitFor`, kept until the workflow gets there. `iterating` is a
38
- * `step.each` that has items left.
39
- */
40
- export type StepRunStatus = "running" | "retrying" | "completed" | "failed" | "sleeping" | "waiting" | "signalled" | "timed_out" | "batching" | "iterating";
26
+ export type { StepRunStatus, WorkflowRunStatus } from "./wire";
41
27
  /** A workflow's row. Times are epoch milliseconds. */
42
28
  export type WorkflowRecord = {
43
29
  id: string;
@@ -239,9 +225,31 @@ export interface WorkflowStore {
239
225
  after?: number;
240
226
  limit: number;
241
227
  }): Promise<ItemRecord[]>;
228
+ /**
229
+ * Adds rows to the item source `sourceId` (`ItemSource`, `step.source`),
230
+ * owned by `workflowId` (deleted with it by `prune`) or by nobody. A store
231
+ * that has it supports item sources, with `readSource` and `deleteSource`.
232
+ */
233
+ writeSource?(sourceId: string, workflowId: string | null, rows: Array<{
234
+ index: number;
235
+ payload: string;
236
+ }>): Promise<void>;
237
+ /** The rows of `sourceId` whose index is from `from` up to, not including, `to`, by index. */
238
+ readSource?(sourceId: string, from: number, to: number): Promise<Array<{
239
+ index: number;
240
+ payload: string;
241
+ }>>;
242
+ /** Deletes the rows of `sourceId`, and resolves to how many there were. */
243
+ deleteSource?(sourceId: string): Promise<number>;
244
+ /**
245
+ * Deletes the sources that belong to no workflow and were written more
246
+ * than `olderThanMs` ago, and resolves to how many rows.
247
+ */
248
+ pruneSources?(olderThanMs: number): Promise<number>;
242
249
  /**
243
250
  * Deletes workflows that ended (completed, failed or cancelled) more than
244
- * `olderThanMs` ago, with their steps and items, and resolves to how many.
251
+ * `olderThanMs` ago, with their steps, items and item sources, and resolves
252
+ * to how many.
245
253
  */
246
254
  prune?(olderThanMs: number): Promise<number>;
247
255
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WorkflowStore.d.ts","sourceRoot":"","sources":["../../../../services/queue/workflow/WorkflowStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,4DAA4D;AAC5D,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAa,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,UAAU,GACV,SAAS,GACT,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,WAAW,CAAC;AAEhB;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,UAAU,GACV,WAAW,GACX,QAAQ,GACR,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,GACX,UAAU,GACV,WAAW,CAAC;AAEhB,sDAAsD;AACtD,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,+CAA+C;IAC/C,WAAW,EAAE,MAAM,GA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SAAS,CAAC,CACR,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GACpE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAEzB;;;;OAIG;IACH,WAAW,CAAC,CACV,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,IAAI,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,8FAA8F;IAC9F,UAAU,CAAC,CACT,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAEtD,2EAA2E;IAC3E,YAAY,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjD;;;OAGG;IACH,YAAY,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEpD;;;;OAIG;IACH,KAAK,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9C"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Where a workflow stands.
3
+ *
4
+ * - `running`: a tick is running it, or one is queued to.
5
+ * - `sleeping`: waiting for a `step.sleep` or a step's retry backoff.
6
+ * - `waiting`: waiting for a signal (`step.waitFor`) or a batch (`step.batch`).
7
+ * - `cancelling`: `cancel` was accepted, and `onCancel` has not finished yet.
8
+ * - `completed`, `failed`, `cancelled`: final.
9
+ */
10
+ export type WorkflowRunStatus = "running" | "sleeping" | "waiting" | "completed" | "failed" | "cancelling" | "cancelled";
11
+ /**
12
+ * Where one step stands. `signalled` is a signal that arrived before its
13
+ * `step.waitFor`, kept until the workflow gets there. `iterating` is a
14
+ * `step.each` that has items left.
15
+ */
16
+ export type StepRunStatus = "running" | "retrying" | "completed" | "failed" | "sleeping" | "waiting" | "signalled" | "timed_out" | "batching" | "iterating";
17
+ /** How far a `step.each` is. */
18
+ export type EachProgress = {
19
+ total: number;
20
+ /** Items that ended: `succeeded + skipped + failed`. */
21
+ done: number;
22
+ succeeded: number;
23
+ skipped: number;
24
+ failed: number;
25
+ };
26
+ /** One step, as `Workflow.find` and the workflow's stream show it. Times are epoch milliseconds. */
27
+ export type WorkflowStepStatus = {
28
+ key: string;
29
+ status: StepRunStatus;
30
+ /** Attempts started; `step.run` only. */
31
+ attempt: number;
32
+ error: string | null;
33
+ /** The batch a `step.batch` dispatched. */
34
+ batchId: string | null;
35
+ /**
36
+ * 0 to 1: the batch's progress for a `step.batch`, or the share of items
37
+ * that have ended for a `step.each`.
38
+ */
39
+ progress?: number;
40
+ /** How far a `step.each` is. */
41
+ items?: EachProgress;
42
+ /** When a sleep ends, a wait times out, or a retry is due. */
43
+ wakeAt: number | null;
44
+ startedAt: number | null;
45
+ finishedAt: number | null;
46
+ };
47
+ /**
48
+ * What a workflow's channel publishes on every change, and what
49
+ * `useWorkflow` returns: its status without `args` and `result`, which can
50
+ * hold what a browser must not see.
51
+ */
52
+ export type WorkflowUpdate = {
53
+ id: string;
54
+ /** The workflow class's `static name`. */
55
+ name: string;
56
+ status: WorkflowRunStatus;
57
+ /** The key of the step it is on, or `null`. */
58
+ currentStep: string | null;
59
+ /** 0 to 1, as `step.progress` or a running `step.each` last set it; 1 once completed. */
60
+ progress: number;
61
+ /** Why it failed; for a cancelled one, why `onCancel` failed. */
62
+ error: string | null;
63
+ /** Every step recorded so far, in the order they were first reached. */
64
+ steps: WorkflowStepStatus[];
65
+ createdAt: number;
66
+ /** When it last changed: of two updates, the later one has the larger `updatedAt`. */
67
+ updatedAt: number;
68
+ };
69
+ /** Whether a workflow has ended: `completed`, `failed` or `cancelled`. */
70
+ export declare function workflowEnded(status: WorkflowRunStatus): boolean;
71
+ //# sourceMappingURL=wire.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../../../services/queue/workflow/wire.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,UAAU,GACV,SAAS,GACT,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,WAAW,CAAC;AAEhB;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,UAAU,GACV,WAAW,GACX,QAAQ,GACR,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,GACX,UAAU,GACV,WAAW,CAAC;AAEhB,gCAAgC;AAChC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oGAAoG;AACpG,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;IACtB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,8DAA8D;IAC9D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,+CAA+C;IAC/C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,wEAAwE;IACxE,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,sFAAsF;IACtF,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAEhE"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflowContract.d.ts","sourceRoot":"","sources":["../../../../services/queue/workflow/workflowContract.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMlD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,OAAO,CAAC;IAAE,MAAM,IAAI,WAAW,CAAC;IAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,EAC3E,QAAQ,GAAE;IACR;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC;CACS,QA+4BhC"}
1
+ {"version":3,"file":"workflowContract.d.ts","sourceRoot":"","sources":["../../../../services/queue/workflow/workflowContract.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQlD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,OAAO,CAAC;IAAE,MAAM,IAAI,WAAW,CAAC;IAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,EAC3E,QAAQ,GAAE;IACR;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC;CACS,QAijChC"}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import"../chunk-yedb5vvg.js";import M from"path";import{writeFileSync as Q}from"fs";var L=new Set(["FILE","REDIRECT"]);function H(j){return j.run(()=>{let x=[];for(let{group:z,view:D}of j.domains().viewGroups())for(let[G,B]of Object.entries(D.flatViewRoutes)){let C=D.routeManifest[G]??B.segments.map((K)=>K.viewPath);if(C.length===0||L.has(C.at(-1)))continue;x.push({path:G,group:z,views:C,...B.static?{static:{...B.static.layout?{layout:B.static.layout}:{},...B.static.navigation?{navigation:!0}:{}}}:{}})}return x})}var J=process.argv[2];async function U(){if(!J)throw Error("usage: route-table <out.json>");let j=M.resolve(process.cwd(),"app/kernel/Kernel.ts"),x=await import(j);if(typeof x.default!=="function")throw Error(`${j} has no default export (the Kernel subclass).`);let z=new x.default;z.boot();try{Q(J,JSON.stringify(H(z)))}finally{z.destroy()}}U().then(()=>process.exit(0),(j)=>{console.error(j?.stack??String(j)),process.exit(1)});
2
+ import"../chunk-3dkv4989.js";import M from"path";import{writeFileSync as Q}from"fs";var L=new Set(["FILE","REDIRECT"]);function H(j){return j.run(()=>{let x=[];for(let{group:z,view:D}of j.domains().viewGroups())for(let[G,B]of Object.entries(D.flatViewRoutes)){let C=D.routeManifest[G]??B.segments.map((K)=>K.viewPath);if(C.length===0||L.has(C.at(-1)))continue;x.push({path:G,group:z,views:C,...B.static?{static:{...B.static.layout?{layout:B.static.layout}:{},...B.static.navigation?{navigation:!0}:{}}}:{}})}return x})}var J=process.argv[2];async function U(){if(!J)throw Error("usage: route-table <out.json>");let j=M.resolve(process.cwd(),"app/kernel/Kernel.ts"),x=await import(j);if(typeof x.default!=="function")throw Error(`${j} has no default export (the Kernel subclass).`);let z=new x.default;z.boot();try{Q(J,JSON.stringify(H(z)))}finally{z.destroy()}}U().then(()=>process.exit(0),(j)=>{console.error(j?.stack??String(j)),process.exit(1)});
3
3
 
4
4
  //# debugId=05EB0087C5A2060D64756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Pe as Y}from"../chunk-sqqh78tf.js";import{al as M}from"../chunk-yxtfg4wy.js";import{hm as P,jm as R}from"../chunk-aes0ecnp.js";import"../chunk-sba3s380.js";import{Dm as Q,Em as U,Fm as V,Gm as W}from"../chunk-hmtn7996.js";import"../chunk-yedb5vvg.js";class S{static token;async boot(){}onShutdown(x){}static inject(){if(!this.token)throw Error(`Service [${this.name}] does not declare a \`static token\`, so the container has no key to resolve it by.`);try{return R(this)}catch(x){throw Error(`Could not inject [${this.name}]. Services are constructed when the kernel boots, so `+"inject() only works from code that runs after that \u2014 a constructor default or a method "+`body, never module top level. Check that [${this.name}] is listed in \`services\` on your Kernel.`,{cause:x})}}static with(x){let f=new this;for(let[C,g]of Object.entries(x))if(g!==void 0)f[C]=g;return f}}import{readdir as z}from"fs/promises";import{join as B,parse as j}from"path";var H=[".ts",".tsx",".js",".mjs",".jsx"];function J(x={}){let f={};for(let[C,g]of Object.entries(x))f[C]=q(g);return new P(f)}async function L(x,f=new P){let C=[];try{C=await z(x)}catch(D){return f}let g=C.filter((D)=>{let{ext:v,name:F}=j(D);return H.includes(v)&&!F.startsWith(".")}).sort();for(let D of g){let{name:v}=j(D),F=await import(B(x,D));f.set(v,q(F))}return f}function q(x){if(x&&typeof x==="object"&&"default"in x)return x.default;return x}export{M as withDefaults,Q as sourceFiles,W as projectRoot,L as loadConfigFrom,V as discoverClasses,J as createConfigRepository,Y as ServiceProvider,S as Service,P as Repository,U as DiscoveryError};
2
+ import{Se as Y}from"../chunk-qy0k2s5f.js";import{cl as M}from"../chunk-0k2r6bep.js";import{jm as P,lm as R}from"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import{Fm as Q,Gm as U,Hm as V,Im as W}from"../chunk-5mrtgr7q.js";import"../chunk-3dkv4989.js";class S{static token;async boot(){}onShutdown(x){}static inject(){if(!this.token)throw Error(`Service [${this.name}] does not declare a \`static token\`, so the container has no key to resolve it by.`);try{return R(this)}catch(x){throw Error(`Could not inject [${this.name}]. Services are constructed when the kernel boots, so `+"inject() only works from code that runs after that \u2014 a constructor default or a method "+`body, never module top level. Check that [${this.name}] is listed in \`services\` on your Kernel.`,{cause:x})}}static with(x){let f=new this;for(let[C,g]of Object.entries(x))if(g!==void 0)f[C]=g;return f}}import{readdir as z}from"fs/promises";import{join as B,parse as j}from"path";var H=[".ts",".tsx",".js",".mjs",".jsx"];function J(x={}){let f={};for(let[C,g]of Object.entries(x))f[C]=q(g);return new P(f)}async function L(x,f=new P){let C=[];try{C=await z(x)}catch(D){return f}let g=C.filter((D)=>{let{ext:v,name:F}=j(D);return H.includes(v)&&!F.startsWith(".")}).sort();for(let D of g){let{name:v}=j(D),F=await import(B(x,D));f.set(v,q(F))}return f}function q(x){if(x&&typeof x==="object"&&"default"in x)return x.default;return x}export{M as withDefaults,Q as sourceFiles,W as projectRoot,L as loadConfigFrom,V as discoverClasses,J as createConfigRepository,Y as ServiceProvider,S as Service,P as Repository,U as DiscoveryError};
3
3
 
4
- //# debugId=6359932777B8C99064756E2164756E21
4
+ //# debugId=AB19AE6711A46B3F64756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "import { readdir } from \"node:fs/promises\";\nimport { join, parse } from \"node:path\";\n\nimport { Repository } from \"./Repository\";\n\nconst CONFIG_EXTENSIONS = [\".ts\", \".tsx\", \".js\", \".mjs\", \".jsx\"];\n\n// Builds a Repository from an already-imported map of config modules. The map\n// key becomes the top-level config key, so `{ mail: mailModule }` is readable\n// as `config.get(\"mail.driver\")`. Each entry may be either the module namespace\n// (its `default` export is unwrapped) or the config object itself.\nexport function createConfigRepository(\n modules: Record<string, any> = {},\n): Repository {\n const items: Record<string, any> = {};\n\n for (const [key, mod] of Object.entries(modules)) {\n items[key] = unwrap(mod);\n }\n\n return new Repository(items);\n}\n\n// Reads every config module in an app's `app/config` directory into a\n// Repository. The file's basename is the top-level key: `app/config/mail.ts`\n// populates `mail.*`. A missing directory yields an empty Repository so apps\n// that declare no config still boot.\nexport async function loadConfigFrom(\n directory: string,\n repository = new Repository(),\n): Promise<Repository> {\n let entries: string[] = [];\n\n try {\n entries = await readdir(directory);\n } catch (err) {\n return repository;\n }\n\n const files = entries\n .filter((entry) => {\n const { ext, name } = parse(entry);\n return CONFIG_EXTENSIONS.includes(ext) && !name.startsWith(\".\");\n })\n .sort();\n\n for (const file of files) {\n const { name } = parse(file);\n const mod = await import(join(directory, file));\n repository.set(name, unwrap(mod));\n }\n\n return repository;\n}\n\nfunction unwrap(mod: any) {\n if (mod && typeof mod === \"object\" && \"default\" in mod) {\n return mod.default;\n }\n return mod;\n}\n"
7
7
  ],
8
8
  "mappings": ";2RAiCO,CAAe,JAAQ,EAOrB,OAMD,AAAI,EAAkB,EAmB5B,UAAU,CAAC,EAEkD,QAmBtD,OAAS,EAKX,CACH,GAAI,CAAC,KAAK,MACR,MAAU,MACR,YAAY,KAAK,0FACnB,EAGF,GAAI,CACF,OAAO,EAAI,IAAuB,EAClC,MAAO,EAAO,CACd,MAAU,MACR,qBAAqB,KAAK,6DACxB,+FACA,6CAA6C,KAAK,kDAEpD,CAAE,OAAM,CACV,SAoBG,KAAuB,CAAoB,EAA0B,CAC1E,IAAM,EAAW,IAAI,KACrB,QAAY,EAAK,KAAU,OAAO,QAAQ,CAAS,EACjD,GAAI,IAAU,OAAW,EAAS,GAAO,EAE3C,OAAO,EAEX,CCtIA,kBAAS,oBACT,eAAS,WAAM,aAIf,IAAM,EAAoB,CAAC,MAAO,OAAQ,MAAO,OAAQ,MAAM,EAMxD,SAAS,CAAsB,CACpC,EAA+B,CAAC,EACpB,CACZ,IAAM,EAA6B,CAAC,EAEpC,QAAY,EAAK,KAAQ,OAAO,QAAQ,CAAO,EAC7C,EAAM,GAAO,EAAO,CAAG,EAGzB,OAAO,IAAI,EAAW,CAAK,EAO7B,eAAsB,CAAc,CAClC,EACA,EAAa,IAAI,EACI,CACrB,IAAI,EAAoB,CAAC,EAEzB,GAAI,CACF,EAAU,MAAM,EAAQ,CAAS,EACjC,MAAO,EAAK,CACZ,OAAO,EAGT,IAAM,EAAQ,EACX,OAAO,CAAC,IAAU,CACjB,IAAQ,MAAK,QAAS,EAAM,CAAK,EACjC,OAAO,EAAkB,SAAS,CAAG,GAAK,CAAC,EAAK,WAAW,GAAG,EAC/D,EACA,KAAK,EAER,QAAW,KAAQ,EAAO,CACxB,IAAQ,QAAS,EAAM,CAAI,EACrB,EAAM,MAAa,SAAK,EAAW,CAAI,GAC7C,EAAW,IAAI,EAAM,EAAO,CAAG,CAAC,EAGlC,OAAO,EAGT,SAAS,CAAM,CAAC,EAAU,CACxB,GAAI,GAAO,OAAO,IAAQ,UAAY,YAAa,EACjD,OAAO,EAAI,QAEb,OAAO",
9
- "debugId": "6359932777B8C99064756E2164756E21",
9
+ "debugId": "AB19AE6711A46B3F64756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{ua as B,va as D}from"../chunk-w9sw2kn7.js";import"../chunk-9pvxexh1.js";import"../chunk-zy6hj5cc.js";import{Pa as J}from"../chunk-5vdkqv17.js";import"../chunk-cwm5x7rf.js";import"../chunk-yedb5vvg.js";function N(){return{name:"gemi-custom-request",enforce:"pre",async transform(G,H){let j=H.split("?",1)[0];if(j.includes("/node_modules/")||!B.test(j))return null;return{code:await D(G),map:null}}}}export{N as gemiRequestPlugin,J as gemiIslandPlugin};
2
+ import{ua as B,va as D}from"../chunk-gyszenps.js";import"../chunk-adw279ge.js";import"../chunk-nqqyn3cx.js";import{Pa as J}from"../chunk-h9nt7hm6.js";import"../chunk-swmf6w3z.js";import"../chunk-3dkv4989.js";function N(){return{name:"gemi-custom-request",enforce:"pre",async transform(G,H){let j=H.split("?",1)[0];if(j.includes("/node_modules/")||!B.test(j))return null;return{code:await D(G),map:null}}}}export{N as gemiRequestPlugin,J as gemiIslandPlugin};
3
3
 
4
4
  //# debugId=54630B516034F10064756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemi",
3
- "version": "0.218.0",
3
+ "version": "0.220.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Enes Tufekci <enes@gemijs.dev>",
@@ -1,19 +0,0 @@
1
- // @bun
2
- import{re as R}from"./chunk-7xe5vd4w.js";import{He as J,Me as M,ye as C}from"./chunk-ktee4gy4.js";import{jm as $}from"./chunk-aes0ecnp.js";import{Em as A,Fm as K,Gm as E}from"./chunk-hmtn7996.js";class j extends Error{code;constructor(q,z=1){super(q);this.code=z;this.name="CommandFailed"}}class S{static commandName="unset";static description="";static args=[];static options=[];run(q){}}function p(q){return q}function L(){return{commands:[],commandsDir:"app/commands"}}var I=Symbol.for("gemi.console.builder");function k(q){if(q.trim()==="")throw Error("A command name cannot be empty.");if(/[{}]/.test(q)||/\s/.test(q))throw Error(`Invalid command name ${JSON.stringify(q)}. gemi does not parse a signature string; the name is the whole of it. Declare arguments with .arg() and flags with .option():
3
-
4
- defineCommand("mail:send")
5
- .arg("user", { required: true })
6
- .option("queue", { type: "boolean" })
7
- .handle(async ({ args, options }) => { ... })`)}function c(q){k(q);let z=[],F=[],P="",X={[I]:q,describe(G){return P=G,X},arg(G,H={}){if(H.required&&H.default!==void 0)throw Error(`Argument "${G}" of command "${q}" is both required and has a default. An argument that is supplied when absent cannot also be `+"absent \u2014 drop one.");if(H.variadic&&H.default!==void 0)throw Error(`Argument "${G}" of command "${q}" is variadic and has a default. A variadic argument collects the remaining values and is an empty list when there are none, so the default could never `+"apply \u2014 drop it, or drop `variadic`.");let V=z.find((O)=>O.variadic);if(V)throw Error(`Argument "${G}" of command "${q}" is declared after the variadic argument "${V.name}", which collects everything that follows, so "${G}" could never receive a value. A variadic argument must be declared last.`);if(z.some((O)=>O.name===G))throw Error(`Command "${q}" declares the argument "${G}" twice.`);return z.push({...H,name:G}),X},option(G,H){if(F.some((Y)=>Y.name===G))throw Error(`Command "${q}" declares the option "${G}" twice.`);let V="alias"in H?H.alias:void 0,O=V===void 0?void 0:F.find((Y)=>("alias"in Y)&&Y.alias===V);if(O)throw Error(`Options "${O.name}" and "${G}" of command "${q}" both use the alias "-${V}".`);return F.push({...H,name:G}),X},handle(G){let H=q,V=P,O=class extends S{static commandName=H;static description=V;static args=[...z];static options=[...F];run(Y){return G(Y)}};return delete X[I],Object.defineProperty(O,"name",{value:H,configurable:!0}),O}};return X}function Q(q){return typeof q==="object"&&q!==null&&typeof q[I]==="string"}function o(q){return q}function T(){return{jobs:[],jobsDir:"app/cron"}}function i(q){return q}function B(){return{listeners:[],listenersDir:"app/listeners"}}class U{static name="unset";static event;queued=!1;maxAttempts=3;backoff=0;worker=!1}class W{static name="unset";run(q,...z){throw Error(`The workflow ${this.constructor.name} has no run method.`)}onCancel(q,...z){return}static start(...q){return $(J).workflows.start(this,q)}static signal(q,z,F){return $(J).workflows.signal(q,z,F)}static items(q,z,F={}){return $(J).workflows.items(q,z,F)}static find(q){return $(J).workflows.find(q)}static cancel(q){return $(J).workflows.cancel(q)}}import{existsSync as D}from"fs";import{dirname as x,isAbsolute as N,join as y}from"path";function Z(q){return N(q)?q:y(E(),q)}function _(q,z,F){if(D(q)||D(x(q)))return;console.warn(`No ${z} were discovered: neither ${q} nor the directory above it exists, so this process cannot see the application's source. If this is a deploy that ships only the build output, list the classes explicitly in app/config/${F}.ts so they travel with it.`)}async function Sq(q=C().jobsDir){let z=Z(q);_(z,"queue jobs","queue");let F=await K(z,M);return w(F),F}async function Zq(q=C().workflowsDir){let z=Z(q);_(z,"workflows","queue");let F=await K(z,W);for(let P of F){if(Object.getOwnPropertyDescriptor(P,"name")?.writable)continue;console.warn(`Workflow ${P.name} does not declare \`static name\`. A workflow is stored under its name, and a production build renames the class. Add: static name = "${P.name}";`)}return F}function w(q){for(let z of q){if(Object.getOwnPropertyDescriptor(z,"name")?.writable)continue;console.warn(`Queued job ${z.name} does not declare \`static name\`, so it is registered under its class name. A production build minifies the class that dispatches it and renames it, while discovery reads this `+"file from source and does not \u2014 so the dispatch would be dropped in "+`production and nowhere else. Add: static name = "${z.name}";`)}}async function _q(q=T().jobsDir){let z=Z(q);return _(z,"cron jobs","schedule"),await K(z,R)}async function Iq(q=L().commandsDir){let z=Z(q);_(z,"commands","command");let F=[],P=await K(z,S,[],(X,G)=>{if(Q(X))F.push(G)});return b(F),P}function b(q){if(q.length===0)return;let z=q.length===1?`${q[0]} exports a command builder that never called \`.handle()\``:`${q.length} files export a command builder that never called \`.handle()\`:
8
- ${q.join(`
9
- `)}`;throw new A(`${z}, so there is no command to run. \`.handle()\` is what turns `+`the chain into a command \u2014 finish it:
10
-
11
- `+` export default defineCommand("my-command")
12
- .handle(async ({ line }) => { line("hello") })`)}async function Uq(q=B().listenersDir){let z=Z(q);_(z,"event listeners","events");let F=await K(z,U);return f(F),v(F),u(F),F}function f(q){let z=q.filter((F)=>!F.event);if(z.length===0)return;throw new A(`${z.map((F)=>F.name).join(", ")} declare no \`static event\`, so there is no event name to register them under and their \`handle\` would never run. Every listener binds to exactly one event:
13
-
14
- static event = UserRegistered;
15
-
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(q){for(let z of q){if(Object.getOwnPropertyDescriptor(z,"name")?.writable)continue;console.warn(`Event listener ${z.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 = "${z.name}";`)}}function u(q){let z=new Set;for(let{event:F}of q){if(z.has(F))continue;if(Object.getOwnPropertyDescriptor(F,"name")?.writable)continue;z.add(F),console.warn(`Event ${F.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 = "${F.name}";`)}}
17
- export{j as be,S as ce,p as de,L as ee,c as fe,o as ge,T as he,i as ie,B as je,U as ke,W as le,Sq as me,Zq as ne,_q as oe,Iq as pe,Uq as qe};
18
-
19
- //# debugId=F367297EE566131364756E2164756E21
@@ -1,5 +0,0 @@
1
- // @bun
2
- import{Oe as o}from"./chunk-7t13vyzg.js";import{Pe as i}from"./chunk-sqqh78tf.js";import{al as t}from"./chunk-yxtfg4wy.js";import{fm as r}from"./chunk-qstjm3cb.js";class n extends i{register(){this.app.singleton(r,()=>new r(t(o(),this.app.config.get("translation",{}))))}}
3
- export{n as pb};
4
-
5
- //# debugId=1BE1A2F1C892D74064756E2164756E21