@classytic/arc 2.47.0 → 2.49.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 (216) hide show
  1. package/dist/{EventTransport-BHKy4_Bi.mjs → EventTransport-DbHZK230.mjs} +2 -2
  2. package/dist/{HookSystem-CAIDVoKC.mjs → HookSystem-DMoeJ6Do.mjs} +2 -2
  3. package/dist/{QueryCache-DdvrGG8Q.d.mts → QueryCache-BE47tmlO.d.mts} +36 -1
  4. package/dist/{ResourceRegistry-23Ml6FNe.mjs → ResourceRegistry-CP-iTcKy.mjs} +2 -2
  5. package/dist/{acquire-DoFX06fm.mjs → acquire-CB0va87C.mjs} +1 -1
  6. package/dist/audit/index.d.mts +1 -1
  7. package/dist/audit/index.mjs +4 -4
  8. package/dist/auth/audit.mjs +1 -1
  9. package/dist/auth/index.d.mts +2 -2
  10. package/dist/auth/index.mjs +53 -15
  11. package/dist/auth/redis-session.mjs +1 -1
  12. package/dist/{authorizationDecision-DYiubkYw.mjs → authorizationDecision-DHO94aV2.mjs} +4 -4
  13. package/dist/{boundedMap-CtdzpJ3X.mjs → boundedMap-C51EUUOm.mjs} +1 -1
  14. package/dist/{buildHandler-CARdmPNo.mjs → buildHandler-9DuwEKvr.mjs} +23 -16
  15. package/dist/cache/index.d.mts +2 -2
  16. package/dist/cache/index.mjs +4 -4
  17. package/dist/{caching-QRiryDLs.mjs → caching-COTX3sDa.mjs} +3 -6
  18. package/dist/{claimed-BLecr1j3.mjs → claimed-C7T1nHlo.mjs} +1 -1
  19. package/dist/cleanup/index.d.mts +2 -2
  20. package/dist/cleanup/index.mjs +4 -4
  21. package/dist/cli/commands/describe.d.mts +1 -1
  22. package/dist/cli/commands/describe.mjs +3 -3
  23. package/dist/cli/commands/docs.mjs +3 -3
  24. package/dist/cli/commands/doctor.mjs +1 -1
  25. package/dist/cli/commands/generate.mjs +2 -2
  26. package/dist/cli/commands/init.mjs +2 -2
  27. package/dist/cli/commands/introspect.mjs +2 -2
  28. package/dist/cli/index.mjs +3 -3
  29. package/dist/{constants-Cx7BcnHT.mjs → constants-DOnfMd7i.mjs} +1 -1
  30. package/dist/context/index.mjs +5 -5
  31. package/dist/core/index.d.mts +3 -3
  32. package/dist/core/index.mjs +7 -7
  33. package/dist/{core-0WyMuo0f.mjs → core-BoEdFDDw.mjs} +3 -3
  34. package/dist/{createActionRouter-mLAGbpDV.mjs → createActionRouter-CpTn15dm.mjs} +54 -18
  35. package/dist/{createAggregationRouter-BEAjn3dA.mjs → createAggregationRouter-CD_Hydp0.mjs} +13 -11
  36. package/dist/{createApp-QDP4vYWH.mjs → createApp-Be6XTGD9.mjs} +332 -40
  37. package/dist/{createMcpServer-DzXHX0SO.d.mts → createMcpServer-CS2KOVP6.d.mts} +9 -10
  38. package/dist/{defineAggregation-CFNfvz-C.mjs → defineAggregation-BI5pRb8c.mjs} +1 -1
  39. package/dist/{defineResource-BROJmhzJ.mjs → defineResource-BAzNu5Um.mjs} +8 -8
  40. package/dist/discovery/index.mjs +1 -1
  41. package/dist/docs/index.d.mts +1 -1
  42. package/dist/docs/index.mjs +3 -3
  43. package/dist/{elevation-DrXeEWWk.mjs → elevation-DupGuM41.mjs} +6 -9
  44. package/dist/encryption/index.mjs +3 -3
  45. package/dist/{errorHandler-BiBXtxj4.mjs → errorHandler-DA03vRqp.mjs} +4 -7
  46. package/dist/{errors-DnrUChAy.mjs → errors-BpYV859Y.mjs} +1 -1
  47. package/dist/{eventPlugin-BhKLUe7H.mjs → eventPlugin-D7LYtYzL.mjs} +9 -13
  48. package/dist/{eventTypes-CCIRGakw.mjs → eventTypes-BqA-N-Uz.mjs} +2 -2
  49. package/dist/events/index.d.mts +18 -5
  50. package/dist/events/index.mjs +8 -8
  51. package/dist/events/transports/redis-stream-entry.mjs +4 -4
  52. package/dist/events/transports/redis.d.mts +35 -0
  53. package/dist/events/transports/redis.mjs +87 -11
  54. package/dist/factory/index.d.mts +4 -4
  55. package/dist/factory/index.mjs +6 -6
  56. package/dist/{fastify-augmentation-bzkWPt1f.d.mts → fastify-augmentation-baQc3MaO.d.mts} +2 -2
  57. package/dist/fieldTypes-EFWxCkZ5.mjs +80 -0
  58. package/dist/{fields-CYdpcV73.mjs → fields-CT1Erg7o.mjs} +1 -1
  59. package/dist/{filter-merge-6kasezRH.mjs → filter-merge-B1eJ1pMx.mjs} +1 -1
  60. package/dist/{generate-DUkcbc4r.mjs → generate-Cr0ULavs.mjs} +2 -2
  61. package/dist/{headers-KxhrKevA.mjs → headers-D4bncIOf.mjs} +2 -2
  62. package/dist/{health-jkYNdobJ.mjs → health-BoFxrkJE.mjs} +1 -1
  63. package/dist/{health-CRJg3IIq.mjs → health-DN_pUVMX.mjs} +1 -1
  64. package/dist/hooks/index.d.mts +1 -1
  65. package/dist/hooks/index.mjs +2 -2
  66. package/dist/http-cache/index.d.mts +2 -2
  67. package/dist/http-cache/index.mjs +4 -4
  68. package/dist/http-cache/purgers/cloudflare.mjs +2 -2
  69. package/dist/http-cache/purgers/fastly.mjs +2 -2
  70. package/dist/http-cache/testing/index.mjs +1 -1
  71. package/dist/idempotency/index.d.mts +1 -1
  72. package/dist/idempotency/index.mjs +10 -8
  73. package/dist/idempotency/redis.mjs +2 -2
  74. package/dist/{index-B5i9-vuP.d.mts → index-CMNpMBtW.d.mts} +1 -1
  75. package/dist/{index-BxZS-8So.d.mts → index-DKM2p5w5.d.mts} +48 -23
  76. package/dist/{index-Cy2-QffW.d.mts → index-DLCcLUQT.d.mts} +69 -6
  77. package/dist/{index-DFCCQ9AE.d.mts → index-DexdFs1a.d.mts} +1 -1
  78. package/dist/{index-D1X_C_qz.d.mts → index-Dhrks-hM.d.mts} +60 -10
  79. package/dist/index.d.mts +4 -4
  80. package/dist/index.mjs +11 -11
  81. package/dist/{init-CACwpktI.mjs → init-C4a24wD2.mjs} +1 -1
  82. package/dist/integrations/event-gateway.mjs +2 -2
  83. package/dist/integrations/index.d.mts +2 -2
  84. package/dist/integrations/index.mjs +1 -1
  85. package/dist/integrations/jobs/index.mjs +3 -3
  86. package/dist/integrations/mcp/index.d.mts +6 -38
  87. package/dist/integrations/mcp/index.mjs +2 -2
  88. package/dist/integrations/mcp/testing.d.mts +11 -15
  89. package/dist/integrations/mcp/testing.mjs +22 -42
  90. package/dist/integrations/streamline.mjs +3 -3
  91. package/dist/integrations/webhooks.d.mts +1 -1
  92. package/dist/integrations/webhooks.mjs +4 -4
  93. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  94. package/dist/integrations/websocket-redis.mjs +1 -1
  95. package/dist/integrations/websocket.mjs +2 -2
  96. package/dist/{jsonBody-CzDBkCme.mjs → jsonBody-DoTt5BS6.mjs} +2 -2
  97. package/dist/{keys-Cbwf6r1B.mjs → keys--l9n7aOC.mjs} +1 -1
  98. package/dist/{loadResources-Kr6vuljv.mjs → loadResources-rygByIQA.mjs} +3 -3
  99. package/dist/{loadResourcesFromEntry-D2e0qoDR.mjs → loadResourcesFromEntry-ItNBIQ5w.mjs} +2 -2
  100. package/dist/logger/index.mjs +2 -2
  101. package/dist/{logger-C110X5Yz.mjs → logger-UbknHqHy.mjs} +1 -1
  102. package/dist/{mcpPlugin-4lIPr9OJ.mjs → mcpPlugin-CTkk4RP8.mjs} +218 -378
  103. package/dist/{memory-D9qkhXiB.mjs → memory-C47xVsjX.mjs} +3 -3
  104. package/dist/{metrics-B-qrrWfI.mjs → metrics-TJyAb1Xk.mjs} +4 -7
  105. package/dist/middleware/index.d.mts +1 -1
  106. package/dist/middleware/index.mjs +3 -3
  107. package/dist/migrations/index.mjs +2 -2
  108. package/dist/{module-BD8xHgrz.mjs → module-CWiqsXnh.mjs} +1 -1
  109. package/dist/{multiTenant-KZj8j1uJ.d.mts → multiTenant-QtDzxx_K.d.mts} +1 -1
  110. package/dist/{multipartBody-qU7KCn1l.mjs → multipartBody-BdG1qbn1.mjs} +1 -1
  111. package/dist/{observeSend-BnPtTotW.mjs → observeSend-DrA3ADFN.mjs} +1 -1
  112. package/dist/{openapi-DoVa5SVP.mjs → openapi-D6MAbYpv.mjs} +7 -7
  113. package/dist/outbox-admin/index.d.mts +1 -1
  114. package/dist/outbox-admin/index.mjs +5 -5
  115. package/dist/{outbox-module-DyITEIop.mjs → outbox-module-D5QABFQW.mjs} +197 -28
  116. package/dist/{outbox-module-5Mnwcycy.d.mts → outbox-module-DzW6zwWJ.d.mts} +103 -10
  117. package/dist/permissions/index.d.mts +2 -2
  118. package/dist/permissions/index.mjs +7 -7
  119. package/dist/{permissions-BBy4bOGi.mjs → permissions-CFsmdYUt.mjs} +9 -9
  120. package/dist/{pipe-BOm2o4UA.mjs → pipe-B_05AgGt.mjs} +2 -2
  121. package/dist/pipeline/index.d.mts +1 -1
  122. package/dist/pipeline/index.mjs +2 -2
  123. package/dist/{plan-DDIGwuxr.mjs → plan-BnlNJhrj.mjs} +1 -1
  124. package/dist/{plugin-Bn4D_0XK.mjs → plugin-CrMPYbdj.mjs} +94 -50
  125. package/dist/plugins/index.d.mts +6 -5
  126. package/dist/plugins/index.mjs +19 -18
  127. package/dist/plugins/response-cache.mjs +4 -4
  128. package/dist/plugins/tracing-entry.mjs +2 -2
  129. package/dist/{pluralize-ClEjcKlG.mjs → pluralize-oVIxJ4CY.mjs} +1 -1
  130. package/dist/presets/filesUpload.d.mts +1 -1
  131. package/dist/presets/filesUpload.mjs +5 -5
  132. package/dist/presets/index.d.mts +2 -2
  133. package/dist/presets/index.mjs +2 -2
  134. package/dist/presets/multiTenant.d.mts +1 -1
  135. package/dist/presets/multiTenant.mjs +5 -5
  136. package/dist/presets/search.d.mts +1 -1
  137. package/dist/presets/search.mjs +2 -2
  138. package/dist/{presets-DK2jh5YR.mjs → presets-CUd3L7v6.mjs} +4 -4
  139. package/dist/{projection-BHH-sXyS.mjs → projection-DowJlIto.mjs} +2 -2
  140. package/dist/{purger.types-2wNJK_89.mjs → purger.types-BjKy8869.mjs} +1 -1
  141. package/dist/{queryCachePlugin-Ckqe98AM.mjs → queryCachePlugin-BvB3k_Fh.mjs} +114 -14
  142. package/dist/{queryCachePlugin-DYQUyeJ9.d.mts → queryCachePlugin-DrQNnGws.d.mts} +1 -1
  143. package/dist/{rateLimitKey-CWAjlqcN.mjs → rateLimitKey-56nH1cWN.mjs} +1 -1
  144. package/dist/{realtime-BIJi9USY.mjs → realtime-DXGBPtYK.mjs} +19 -22
  145. package/dist/registry/index.d.mts +2 -2
  146. package/dist/registry/index.mjs +3 -3
  147. package/dist/{registry-y9ZA-R_J.mjs → registry-Biz-6sEZ.mjs} +2 -2
  148. package/dist/{relay-BNrC1CEP.mjs → relay-DEIoMntZ.mjs} +200 -99
  149. package/dist/{renewingLease-CS43br5E.mjs → renewingLease-BCJpW9-u.mjs} +1 -1
  150. package/dist/{replyHelpers-oZDzakGb.mjs → replyHelpers-DliJNb0-.mjs} +2 -2
  151. package/dist/{requestContext-fWb_YaV2.mjs → requestContext-tUgLt9Ky.mjs} +1 -1
  152. package/dist/{requirement--2hWyyHi.mjs → requirement-0l2DApiQ.mjs} +1 -1
  153. package/dist/{resourceRateLimit-DCWglD7V.d.mts → resourceRateLimit-BPiESPtG.d.mts} +4 -0
  154. package/dist/{resourceRateLimit-1WbcyMZY.mjs → resourceRateLimit-iSXF8rLH.mjs} +19 -4
  155. package/dist/{rolldown-runtime-yH2lHMo_.mjs → rolldown-runtime-gKJR3o-6.mjs} +1 -1
  156. package/dist/{routeValidator-BSlRIA5c.mjs → routeValidator-xNYA4rr1.mjs} +47 -5
  157. package/dist/{runtimeCapabilities-CYCEtU1W.mjs → runtimeCapabilities-BQK-GrYe.mjs} +1 -1
  158. package/dist/{schedules-B5WGlYIT.mjs → schedules-D9iMVFhF.mjs} +6 -9
  159. package/dist/{schemaConverter-DtNvts-6.mjs → schemaConverter-cIh4oX9a.mjs} +2 -2
  160. package/dist/{actionPermissions-DXrlWHHK.mjs → schemaIR-BsY4y9VP.mjs} +184 -16
  161. package/dist/schemas/index.mjs +1 -1
  162. package/dist/scim/index.mjs +2 -2
  163. package/dist/scope/index.d.mts +1 -1
  164. package/dist/scope/index.mjs +5 -5
  165. package/dist/{scope-BwVLSyNG.mjs → scope-QyhM9w8z.mjs} +4 -4
  166. package/dist/{shutdown-BJiJN7FT.mjs → shutdown-BM7Q0h4B.mjs} +1 -1
  167. package/dist/{sse-B_50llZu.mjs → sse-ofvlcTQQ.mjs} +9 -35
  168. package/dist/sseStats-DQqNN385.d.mts +112 -0
  169. package/dist/sseStream-BxQW7hPq.mjs +166 -0
  170. package/dist/{store-helpers-D-n5cwy5.mjs → store-helpers-_FRhHDyv.mjs} +1 -1
  171. package/dist/{simpleEqualityMatcher-DGRLq-1k.mjs → streamFrames-B3ZJfI02.mjs} +19 -2
  172. package/dist/{streaming-Dcgqa-hH.mjs → streaming-HZr63UiM.mjs} +1 -1
  173. package/dist/{subscriberIdentity-C9KhIXTF.mjs → subscriberIdentity-DSgnoT_D.mjs} +1 -1
  174. package/dist/{tenancy-COrhjPRZ.mjs → tenancy-_ukT0oBt.mjs} +2 -2
  175. package/dist/{tenantPreparation-BElWHytd.mjs → tenantPreparation-DSlQI53c.mjs} +4 -4
  176. package/dist/testing/cleanupStoreContract.mjs +1 -1
  177. package/dist/testing/index.d.mts +4 -4
  178. package/dist/testing/index.mjs +324 -17
  179. package/dist/testing/outboxStoreContract.mjs +2 -2
  180. package/dist/testing/requiredPorts.mjs +2 -2
  181. package/dist/testing/storageContract.mjs +1 -1
  182. package/dist/{timing-CaxKbRk_.mjs → timing-Z8p-Zlw1.mjs} +1 -1
  183. package/dist/{transactionContext-8qKON0Nk.mjs → transactionContext-DBbSTfY3.mjs} +1 -1
  184. package/dist/{typeGuards-DVjVSsXO.mjs → typeGuards-_6nNQqgq.mjs} +1 -1
  185. package/dist/types/index.d.mts +1 -1
  186. package/dist/types/index.mjs +1 -1
  187. package/dist/types/storage.mjs +1 -1
  188. package/dist/{types-DeLiuaNv.d.mts → types-B4E0sc6D.d.mts} +20 -31
  189. package/dist/{types-DZHqOuJE.mjs → types-CrOlZ4rY.mjs} +4 -4
  190. package/dist/usage/index.d.mts +1 -1
  191. package/dist/usage/index.mjs +7 -7
  192. package/dist/{userHelpers-_eGj6kf0.mjs → userHelpers-CBKx3XJN.mjs} +1 -1
  193. package/dist/utils/index.d.mts +239 -34
  194. package/dist/utils/index.mjs +13 -13
  195. package/dist/{utils-Dd6MWpye.mjs → utils--HE8R8sH.mjs} +761 -8
  196. package/dist/{validate-BaF5wd0x.mjs → validate-BUeE2MLR.mjs} +3 -3
  197. package/dist/{versioning-S18y2-0C.d.mts → versioning-B07RgD27.d.mts} +2 -13
  198. package/dist/{versioning-DyV7mwtK.mjs → versioning-qYgqwOhL.mjs} +4 -7
  199. package/dist/{workScope-CmCBUmPR.mjs → workScope-C-1QHNmV.mjs} +2 -2
  200. package/llms.txt +2 -2
  201. package/package.json +42 -50
  202. package/skills/arc/references/api-reference.md +2 -2
  203. package/skills/arc/references/auth-better-auth.md +1 -0
  204. package/skills/arc/references/events-outbox.md +7 -4
  205. package/skills/arc/references/events.md +2 -2
  206. package/skills/arc/references/mcp-custom-tools.md +1 -1
  207. package/skills/arc/references/mcp-setup.md +11 -10
  208. package/skills/arc/references/mcp-testing.md +3 -3
  209. package/skills/arc/references/production-api.md +4 -0
  210. package/skills/arc/references/production-boot.md +2 -0
  211. package/skills/arc/references/production-idempotency.md +1 -1
  212. package/skills/arc/references/production-realtime.md +28 -2
  213. package/skills/arc/references/validation.md +4 -0
  214. package/skills/arc/references/writes-hooks-errors.md +1 -0
  215. package/dist/schemaIR-uS_RHqa3.mjs +0 -108
  216. package/dist/sseStream-BjSo9Ult.mjs +0 -57
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-yH2lHMo_.mjs";
3
- import { m as statusToArcCode, p as isArcError } from "./errors-DnrUChAy.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-gKJR3o-6.mjs";
3
+ import { m as statusToArcCode, p as isArcError } from "./errors-BpYV859Y.mjs";
4
4
  import { isHttpError, toErrorContract } from "@classytic/repo-core/errors";
5
5
  import { isProductionEnv } from "@classytic/primitives/environment";
6
6
  import fp from "fastify-plugin";
@@ -30,10 +30,7 @@ import fp from "fastify-plugin";
30
30
  * onError: (err) => Sentry.captureException(err),
31
31
  * });
32
32
  */
33
- var errorHandler_exports = /* @__PURE__ */ __exportAll({
34
- defaultIsDuplicateKeyError: () => defaultIsDuplicateKeyError,
35
- errorHandlerPlugin: () => errorHandlerPlugin
36
- });
33
+ var errorHandler_exports = /* @__PURE__ */ __exportAll({ errorHandlerPlugin: () => errorHandlerPlugin });
37
34
  /** Canonical 404 body for a request that matched no route. */
38
35
  function notFoundContract(request) {
39
36
  const correlationId = request.id;
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  import { ARC_ERROR_CODES } from "@classytic/repo-core/errors";
3
3
  // src/utils/errors.ts
4
4
  /**
@@ -1,11 +1,11 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-yH2lHMo_.mjs";
3
- import { t as arcLog } from "./logger-C110X5Yz.mjs";
4
- import { d as createDomainError } from "./errors-DnrUChAy.mjs";
5
- import { n as requestContext } from "./requestContext-fWb_YaV2.mjs";
6
- import { i as runAdmittedWork, n as isAdmittedWork, r as registerShutdownParticipant } from "./shutdown-BJiJN7FT.mjs";
7
- import { n as MemoryEventTransport, r as createEvent, t as ARC_EVENT_TRANSPORT } from "./EventTransport-BHKy4_Bi.mjs";
8
- import { n as preserveSubscriberIdentity } from "./subscriberIdentity-C9KhIXTF.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-gKJR3o-6.mjs";
3
+ import { n as requestContext } from "./requestContext-tUgLt9Ky.mjs";
4
+ import { t as arcLog } from "./logger-UbknHqHy.mjs";
5
+ import { d as createDomainError } from "./errors-BpYV859Y.mjs";
6
+ import { i as runAdmittedWork, n as isAdmittedWork, r as registerShutdownParticipant } from "./shutdown-BM7Q0h4B.mjs";
7
+ import { n as MemoryEventTransport, r as createEvent, t as ARC_EVENT_TRANSPORT } from "./EventTransport-DbHZK230.mjs";
8
+ import { n as preserveSubscriberIdentity } from "./subscriberIdentity-DSgnoT_D.mjs";
9
9
  import { isProductionEnv } from "@classytic/primitives/environment";
10
10
  import fp from "fastify-plugin";
11
11
  import { NonDurablePublishError } from "@classytic/primitives/durable-events";
@@ -135,11 +135,7 @@ function sleep(ms) {
135
135
  * transport: new RedisEventTransport({ url: process.env.REDIS_URL }),
136
136
  * });
137
137
  */
138
- var eventPlugin_exports = /* @__PURE__ */ __exportAll({
139
- default: () => eventPlugin_default,
140
- emitObserved: () => emitObserved,
141
- eventPlugin: () => eventPlugin
142
- });
138
+ var eventPlugin_exports = /* @__PURE__ */ __exportAll({ default: () => eventPlugin_default });
143
139
  const OBSERVERS = Symbol.for("arc.events.observers");
144
140
  /** Notify `fastify.events.observe` listeners. Internal: the plugin and the outbox relay call it. */
145
141
  function emitObserved(events, event) {
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { r as createEvent } from "./EventTransport-BHKy4_Bi.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { r as createEvent } from "./EventTransport-DbHZK230.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { durableEventMeta } from "@classytic/primitives/durable-events";
5
5
  // src/events/defineEvent.ts
@@ -1,7 +1,7 @@
1
1
 
2
- import { i as EventLogger, n as DomainEvent, o as MemoryEventTransport, r as EventHandler, s as MemoryEventTransportOptions } from "../EventTransport-CYEoCJGe.mjs";
3
2
  import { a as withRetry, c as EventDefinitionOutput, d as EventSchema, f as ValidationResult, i as createDeadLetterPublisher, l as EventRegistry, m as defineEvent, n as eventPlugin, o as CustomValidator, p as createEventRegistry, r as RetryOptions, s as EventDefinitionInput, t as EventPluginOptions, u as EventRegistryOptions } from "../eventPlugin-BY38F6yK.mjs";
4
- import { a as MemoryOutboxStore, c as OutboxRelayErrorHandler, d as DEFAULT_RELAY_LAG_UNHEALTHY_MS, f as OutboxHealth, i as createOutboxModule, l as OutboxRelayErrorKind, m as readOutboxHealth, n as OutboxModuleExports, o as EventOutbox, p as OutboxHealthStore, r as OutboxModuleOptions, s as EventOutboxOptions, t as OutboxDrainResult, u as RelayResult } from "../outbox-module-5Mnwcycy.mjs";
3
+ import { i as EventLogger, n as DomainEvent, o as MemoryEventTransport, r as EventHandler, s as MemoryEventTransportOptions } from "../EventTransport-CYEoCJGe.mjs";
4
+ import { a as createOutboxModule, c as EventOutboxOptions, d as RelayBatchOptions, f as RelayResult, g as readOutboxHealth, h as OutboxHealthStore, i as OutboxModuleOptions, l as OutboxRelayErrorHandler, m as OutboxHealth, n as OutboxDrainResult, o as MemoryOutboxStore, p as DEFAULT_RELAY_LAG_UNHEALTHY_MS, r as OutboxModuleExports, s as EventOutbox, t as OutboxDrainRequest, u as OutboxRelayErrorKind } from "../outbox-module-DzW6zwWJ.mjs";
5
5
  import { RedisEventTransportOptions, RedisLike } from "./transports/redis.mjs";
6
6
  import { r as RedisStreamTransportOptions, t as RedisStreamLike } from "../redis-stream-CS1N9dwM.mjs";
7
7
  import { OutboxStore } from "@classytic/primitives/outbox";
@@ -61,7 +61,12 @@ interface InboxOptions {
61
61
  readonly store: IdempotencyClaimStore;
62
62
  /** Must exceed the handler's worst-case run time. Default: the store's lease default. */
63
63
  readonly leaseMs?: number;
64
- /** Commit or roll back ALL work, including claim completion; external effects need their own key. */
64
+ /**
65
+ * Commit or roll back ALL work, including claim completion; external effects need their own key.
66
+ * Covers only writes made with the handler's `context.session`. A write outside it runs while this
67
+ * transaction stays open (a database-wide lock can then deadlock on it): omit `transaction` for
68
+ * such a handler and dedupe by `context.eventId`.
69
+ */
65
70
  readonly transaction?: <T>(work: (session: unknown) => Promise<T>) => Promise<T>;
66
71
  }
67
72
  interface InboxHandlerContext {
@@ -156,7 +161,15 @@ interface RepositoryOutboxStoreOptions {
156
161
  * evaluates to `undefined` if the method ever disappears — an operator's replay that
157
162
  * quietly does nothing and reports success.
158
163
  */
159
- type RepositoryOutboxStore = OutboxStore & Required<Pick<OutboxStore, "fail" | "getDeadLettered" | "purge" | "requeue" | "countByStatus" | "oldestPendingAgeMs">>;
164
+ type RepositoryOutboxStore = OutboxStore & Required<Pick<OutboxStore, "fail" | "getDeadLettered" | "purge" | "requeue" | "countByStatus" | "oldestPendingAgeMs">> & {
165
+ /**
166
+ * The most rows the repository returned for one claim read, once a read came back
167
+ * clamped (its page `limit` below the one asked, e.g. a page `maxLimit`); `undefined`
168
+ * until then. `EventOutbox` lowers its effective `batchSize` to it, so a clamped page
169
+ * never reads as "backlog empty". Warned once (`OUTBOX_CLAIM_CAPPED`).
170
+ */
171
+ readonly claimCap?: number | undefined;
172
+ };
160
173
  export declare function repositoryAsOutboxStore(repository: RepositoryLike, options?: RepositoryOutboxStoreOptions): RepositoryOutboxStore;
161
174
  /**
162
175
  * Extract the payload type from an `EventDefinitionOutput<T>`.
@@ -317,4 +330,4 @@ interface FastifyEventBus {
317
330
  }
318
331
  /** Assign a deployment-stable identity for durable per-handler progress; never use an index. */
319
332
  export declare function withSubscriberId<T>(id: string, handler: EventHandler<T>): EventHandler<T>;
320
- export { type ArcLifecycleEvent, type CacheEvent, type CrudEventSuffix, type CustomValidator, DEFAULT_RELAY_LAG_UNHEALTHY_MS, type EventDefinitionInput, type EventDefinitionOutput, EventOutbox, type EventOutboxOptions, type EventPluginOptions, type EventRegistry, type EventRegistryOptions, type EventSchema, type ExponentialBackoffOptions, type FastifyEventBus, type InboxHandler, type InboxHandlerContext, type InboxOptions, MemoryEventTransport, type MemoryEventTransportOptions, MemoryOutboxStore, type OutboxDrainResult, type OutboxHealth, type OutboxHealthStore, type OutboxModuleExports, type OutboxModuleOptions, type OutboxRelayErrorHandler, type OutboxRelayErrorKind, type PayloadOf, type RedisEventTransportOptions, type RedisLike, type RedisStreamLike, type RedisStreamTransportOptions, type RelayResult, type RepositoryOutboxStore, type RepositoryOutboxStoreOptions, type RetryOptions, type ValidationResult, type WrapWithBoundaryOptions, type WrapWithSchemaOptions, createDeadLetterPublisher, createEventRegistry, createOutboxModule, defineEvent, eventPlugin, readOutboxHealth, withRetry };
333
+ export { type ArcLifecycleEvent, type CacheEvent, type CrudEventSuffix, type CustomValidator, DEFAULT_RELAY_LAG_UNHEALTHY_MS, type EventDefinitionInput, type EventDefinitionOutput, EventOutbox, type EventOutboxOptions, type EventPluginOptions, type EventRegistry, type EventRegistryOptions, type EventSchema, type ExponentialBackoffOptions, type FastifyEventBus, type InboxHandler, type InboxHandlerContext, type InboxOptions, MemoryEventTransport, type MemoryEventTransportOptions, MemoryOutboxStore, type OutboxDrainRequest, type OutboxDrainResult, type OutboxHealth, type OutboxHealthStore, type OutboxModuleExports, type OutboxModuleOptions, type OutboxRelayErrorHandler, type OutboxRelayErrorKind, type PayloadOf, type RedisEventTransportOptions, type RedisLike, type RedisStreamLike, type RedisStreamTransportOptions, type RelayBatchOptions, type RelayResult, type RepositoryOutboxStore, type RepositoryOutboxStoreOptions, type RetryOptions, type ValidationResult, type WrapWithBoundaryOptions, type WrapWithSchemaOptions, createDeadLetterPublisher, createEventRegistry, createOutboxModule, defineEvent, eventPlugin, readOutboxHealth, withRetry };
@@ -1,11 +1,11 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { n as MemoryEventTransport } from "../EventTransport-BHKy4_Bi.mjs";
3
- import { a as crudEventType, d as createEventRegistry, f as defineEvent, i as CRUD_EVENT_SUFFIXES, l as wrapWithBoundary, n as CACHE_EVENTS, o as subscribeWithBoundary, s as subscribeWithSchema, t as ARC_LIFECYCLE_EVENTS, u as wrapWithSchema } from "../eventTypes-CCIRGakw.mjs";
4
- import { r as withSubscriberId } from "../subscriberIdentity-C9KhIXTF.mjs";
5
- import { n as repositoryAsOutboxStore, r as exponentialBackoff, t as EventOutbox } from "../relay-BNrC1CEP.mjs";
6
- import { a as withRetry, i as createDeadLetterPublisher, n as eventPlugin } from "../eventPlugin-BhKLUe7H.mjs";
7
- import { r as readOutboxHealth, t as DEFAULT_RELAY_LAG_UNHEALTHY_MS } from "../health-CRJg3IIq.mjs";
8
- import { t as createOutboxModule } from "../outbox-module-DyITEIop.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { a as crudEventType, d as createEventRegistry, f as defineEvent, i as CRUD_EVENT_SUFFIXES, l as wrapWithBoundary, n as CACHE_EVENTS, o as subscribeWithBoundary, s as subscribeWithSchema, t as ARC_LIFECYCLE_EVENTS, u as wrapWithSchema } from "../eventTypes-BqA-N-Uz.mjs";
3
+ import { n as MemoryEventTransport } from "../EventTransport-DbHZK230.mjs";
4
+ import { a as withRetry, i as createDeadLetterPublisher, n as eventPlugin } from "../eventPlugin-D7LYtYzL.mjs";
5
+ import { r as withSubscriberId } from "../subscriberIdentity-DSgnoT_D.mjs";
6
+ import { r as readOutboxHealth, t as DEFAULT_RELAY_LAG_UNHEALTHY_MS } from "../health-DN_pUVMX.mjs";
7
+ import { t as createOutboxModule } from "../outbox-module-D5QABFQW.mjs";
8
+ import { n as repositoryAsOutboxStore, r as exponentialBackoff, t as EventOutbox } from "../relay-DEIoMntZ.mjs";
9
9
  import { fingerprintRequest, runIdempotent } from "@classytic/repo-core/idempotency";
10
10
  import { MemoryOutboxStore } from "@classytic/primitives/memory-outbox";
11
11
  // src/events/inbox.ts
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { n as evictToSize } from "../../boundedMap-CtdzpJ3X.mjs";
3
- import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-CmCBUmPR.mjs";
4
- import { t as getSubscriberId } from "../../subscriberIdentity-C9KhIXTF.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { n as evictToSize } from "../../boundedMap-C51EUUOm.mjs";
3
+ import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-C-1QHNmV.mjs";
4
+ import { t as getSubscriberId } from "../../subscriberIdentity-DSgnoT_D.mjs";
5
5
  import sjson from "secure-json-parse";
6
6
  import { createEventRouter } from "@classytic/primitives/events";
7
7
  // src/events/transports/redis-stream.ts
@@ -26,7 +26,29 @@ export interface RedisEventTransportOptions {
26
26
  * Pass `fastify.log` to integrate with your application logger.
27
27
  */
28
28
  logger?: EventLogger;
29
+ /**
30
+ * Longest `subscribe()` waits for Redis to confirm a subscription (ms). Past it the
31
+ * handler is registered anyway and the SUBSCRIBE stays queued on the client (ioredis
32
+ * sends it once connected and re-subscribes after every reconnect), so an app BOOTS
33
+ * while Redis is down instead of hanging until it returns. One warning per outage;
34
+ * while the subscriber is not connected, later subscriptions do not wait at all.
35
+ * @default 2000
36
+ */
37
+ subscribeTimeoutMs?: number;
38
+ /**
39
+ * Longest `publish()` waits for Redis (ms) before it rejects, so a caller with a retry
40
+ * (the outbox relay) retries later instead of hanging on a client that queues while
41
+ * disconnected. A publish that timed out may still be sent when the client reconnects:
42
+ * handlers must be idempotent by event id (they already must be for at-least-once).
43
+ * @default 5000
44
+ */
45
+ publishTimeoutMs?: number;
29
46
  }
47
+ /**
48
+ * `error.code` of a publish refused because Redis did not answer (never a bad event): an outbox
49
+ * `failurePolicy` can keep retrying it instead of counting it toward dead-lettering.
50
+ */
51
+ export declare const TRANSPORT_UNAVAILABLE = "arc.transport_unavailable";
30
52
  export declare class RedisEventTransport implements EventTransport {
31
53
  readonly name = "redis";
32
54
  /** Publish-side client (the original client or a duplicate). */
@@ -43,10 +65,23 @@ export declare class RedisEventTransport implements EventTransport {
43
65
  private handlers;
44
66
  /** Tracks whether the pmessage listener has been attached. */
45
67
  private listenerAttached;
68
+ private subscribeTimeoutMs;
69
+ private publishTimeoutMs;
70
+ /** A subscription timed out and the subscriber has not been ready since: do not wait again. */
71
+ private subscriberDown;
72
+ /** A publish timed out and the publisher has not been ready since: refuse at once. */
73
+ private publisherDown;
46
74
  constructor(redis: RedisLike, options?: RedisEventTransportOptions);
47
75
  publish(event: DomainEvent): Promise<void>;
48
76
  subscribe(pattern: string, handler: EventHandler): Promise<() => void>;
49
77
  close(): Promise<void>;
78
+ /**
79
+ * QUIT waits for Redis like any command (queued while disconnected): bounded, then the socket is
80
+ * dropped (`disconnect()` when the client has one), so an app can shut down during an outage.
81
+ */
82
+ private quitOrDrop;
83
+ /** A queued subscription that Redis refused once it answered (logged; the handler stays registered). */
84
+ private subscribeFailed;
50
85
  /**
51
86
  * Attach the Redis message listeners exactly once.
52
87
  */
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-CmCBUmPR.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-C-1QHNmV.mjs";
3
3
  import sjson from "secure-json-parse";
4
4
  // src/events/transports/redis.ts
5
5
  /**
@@ -17,6 +17,33 @@ import sjson from "secure-json-parse";
17
17
  *
18
18
  * await app.register(eventPlugin, { transport });
19
19
  */
20
+ /** Settle `promise` within `ms`: `'timeout'` when it did not. The promise keeps running. */
21
+ function within(promise, ms) {
22
+ return new Promise((resolve, reject) => {
23
+ const timer = setTimeout(() => resolve("timeout"), ms);
24
+ timer.unref?.();
25
+ promise.then((value) => {
26
+ clearTimeout(timer);
27
+ resolve({ value });
28
+ }, (err) => {
29
+ clearTimeout(timer);
30
+ reject(err);
31
+ });
32
+ });
33
+ }
34
+ /**
35
+ * `error.code` of a publish refused because Redis did not answer (never a bad event): an outbox
36
+ * `failurePolicy` can keep retrying it instead of counting it toward dead-lettering.
37
+ */
38
+ const TRANSPORT_UNAVAILABLE = "arc.transport_unavailable";
39
+ function unavailable(message) {
40
+ return Object.assign(new Error(message), { code: TRANSPORT_UNAVAILABLE });
41
+ }
42
+ function positiveMs(name, value, fallback) {
43
+ if (value === void 0) return fallback;
44
+ if (!Number.isFinite(value) || value <= 0) throw new Error(`[RedisEventTransport] ${name} must be a positive number of milliseconds.`);
45
+ return value;
46
+ }
20
47
  /**
21
48
  * DomainEvent contains a `Date` in `meta.timestamp`. We serialize it as an
22
49
  * ISO string and revive it on the other end so subscribers always receive a
@@ -50,27 +77,59 @@ var RedisEventTransport = class {
50
77
  handlers = /* @__PURE__ */ new Map();
51
78
  /** Tracks whether the pmessage listener has been attached. */
52
79
  listenerAttached = false;
80
+ subscribeTimeoutMs;
81
+ publishTimeoutMs;
82
+ /** A subscription timed out and the subscriber has not been ready since: do not wait again. */
83
+ subscriberDown = false;
84
+ /** A publish timed out and the publisher has not been ready since: refuse at once. */
85
+ publisherDown = false;
53
86
  constructor(redis, options = {}) {
54
87
  const { channel = "arc-events", externalLifecycle = false, logger = console } = options;
55
88
  this.channel = channel;
56
89
  this.externalLifecycle = externalLifecycle;
57
90
  this.logger = logger;
91
+ this.subscribeTimeoutMs = positiveMs("subscribeTimeoutMs", options.subscribeTimeoutMs, 2e3);
92
+ this.publishTimeoutMs = positiveMs("publishTimeoutMs", options.publishTimeoutMs, 5e3);
58
93
  this.pub = redis;
59
94
  this.sub = redis.duplicate();
95
+ if (typeof this.pub.on === "function") this.pub.on("ready", () => {
96
+ this.publisherDown = false;
97
+ });
98
+ let reported = false;
99
+ this.sub.on("error", (err) => {
100
+ if (reported) return;
101
+ reported = true;
102
+ this.logger.warn(`[RedisEventTransport] subscriber connection error: ${err instanceof Error ? err.message : String(err)}`);
103
+ });
104
+ this.sub.on("ready", () => {
105
+ reported = false;
106
+ });
60
107
  }
61
108
  async publish(event) {
62
109
  const redisChannel = `${this.channel}:${event.type}`;
63
- await this.pub.publish(redisChannel, serialize(event));
110
+ if (this.publisherDown) throw unavailable(`[RedisEventTransport] publish of ${event.type} refused: Redis unavailable`);
111
+ if (await within(this.pub.publish(redisChannel, serialize(event)), this.publishTimeoutMs) === "timeout") {
112
+ this.publisherDown = true;
113
+ throw unavailable(`[RedisEventTransport] publish of ${event.type} not confirmed within ${this.publishTimeoutMs} ms (Redis unavailable?)`);
114
+ }
64
115
  }
65
116
  async subscribe(pattern, handler) {
66
117
  this.ensureListener();
67
118
  const redisPattern = this.toRedisPattern(pattern);
68
- if (!this.handlers.has(redisPattern)) {
69
- this.handlers.set(redisPattern, /* @__PURE__ */ new Set());
70
- if (this.isGlob(redisPattern)) await this.sub.psubscribe(redisPattern);
71
- else await this.sub.subscribe(redisPattern);
119
+ const known = this.handlers.get(redisPattern);
120
+ this.handlers.set(redisPattern, (known ?? /* @__PURE__ */ new Set()).add(handler));
121
+ if (!known) {
122
+ const confirmed = this.isGlob(redisPattern) ? this.sub.psubscribe(redisPattern) : this.sub.subscribe(redisPattern);
123
+ if (this.subscriberDown) confirmed.catch((err) => this.subscribeFailed(redisPattern, err));
124
+ else if (await within(confirmed, this.subscribeTimeoutMs).catch((err) => {
125
+ this.handlers.delete(redisPattern);
126
+ throw err;
127
+ }) === "timeout") {
128
+ this.subscriberDown = true;
129
+ confirmed.catch((err) => this.subscribeFailed(redisPattern, err));
130
+ this.logger.warn(`[RedisEventTransport] Redis did not confirm a subscription within ${this.subscribeTimeoutMs} ms: continuing; subscriptions are sent when it connects (no cross-instance events until then)`);
131
+ }
72
132
  }
73
- this.handlers.get(redisPattern)?.add(handler);
74
133
  return () => {
75
134
  const set = this.handlers.get(redisPattern);
76
135
  if (set) set.delete(handler);
@@ -78,8 +137,22 @@ var RedisEventTransport = class {
78
137
  }
79
138
  async close() {
80
139
  this.handlers.clear();
81
- if (!this.externalLifecycle) await Promise.all([this.sub.quit(), this.pub.quit()]);
82
- else await this.sub.quit();
140
+ if (!this.externalLifecycle) await Promise.all([this.quitOrDrop(this.sub), this.quitOrDrop(this.pub)]);
141
+ else await this.quitOrDrop(this.sub);
142
+ }
143
+ /**
144
+ * QUIT waits for Redis like any command (queued while disconnected): bounded, then the socket is
145
+ * dropped (`disconnect()` when the client has one), so an app can shut down during an outage.
146
+ */
147
+ async quitOrDrop(client) {
148
+ const quit = client.quit();
149
+ quit.catch(() => {});
150
+ const outcome = await within(quit, this.publishTimeoutMs).catch(() => "failed");
151
+ if (outcome === "timeout" || outcome === "failed") client.disconnect?.();
152
+ }
153
+ /** A queued subscription that Redis refused once it answered (logged; the handler stays registered). */
154
+ subscribeFailed(redisPattern, err) {
155
+ this.logger.error(`[RedisEventTransport] Subscription to ${redisPattern} failed:`, err);
83
156
  }
84
157
  /**
85
158
  * Attach the Redis message listeners exactly once.
@@ -87,6 +160,9 @@ var RedisEventTransport = class {
87
160
  ensureListener() {
88
161
  if (this.listenerAttached) return;
89
162
  this.listenerAttached = true;
163
+ this.sub.on("ready", () => {
164
+ this.subscriberDown = false;
165
+ });
90
166
  this.sub.on("pmessage", (...args) => {
91
167
  const [redisPattern, , message] = args;
92
168
  this.dispatch(redisPattern, message);
@@ -139,4 +215,4 @@ var RedisEventTransport = class {
139
215
  return pattern.includes("*") || pattern.includes("?") || pattern.includes("[");
140
216
  }
141
217
  };
142
- export { RedisEventTransport };
218
+ export { RedisEventTransport, TRANSPORT_UNAVAILABLE };
@@ -1,8 +1,8 @@
1
1
 
2
+ import { a as ResolvedModuleDescriptor, o as ResolvedModuleLifecycle, s as ResolvedResourceDescriptor } from "../fastify-augmentation-baQc3MaO.mjs";
3
+ import { a as RawBodyOptions, c as BetterAuthOption, d as JwtAuthOption, i as MultipartOptions, l as CustomAuthenticatorOption, n as CreateAppHttpOptions, o as UnderPressureOptions, r as CreateAppOptions, s as AuthOption, t as BootDisposer, u as CustomPluginAuthOption } from "../index-Dhrks-hM.mjs";
2
4
  import { F as HealthCheck, _ as ResourceLike, a as ArcPortRegistry, c as LazyBridge, d as ModulePorts, f as ModuleRequirements, g as LoadResourcesOptions, h as ModuleSetupContext, i as ArcModuleRegistry, l as ModuleContribution, m as ModuleDisposer, n as ArcModule, o as ArcPorts, p as PortName, r as ArcModuleInput, s as EventHandlerDefinition, t as ArcCompositionConfig, u as ModuleName, v as ResourceModule, y as loadResources } from "../types-BeEJm-DV.mjs";
3
- import { $ as verifyModuleGraph, A as AsyncApiCatalogEntry, B as ModuleGraphMode, C as planModules, D as ModuleExtension, E as subscribeModuleEventHandlers, F as DurabilityFacts, G as activateBridges, H as ModuleGraphOptions, I as HandlerDurabilityFact, J as crudEventsOf, K as analyzeModuleGraph, L as ModuleGraph, M as toAsyncApi, N as CrudSurface, O as extendModule, P as DerivedPublishes, Q as verifyEventDurability, R as ModuleGraphAnalysis, S as compositionProblems, T as orderModules, U as ModuleKind, V as ModuleGraphNode, W as SkippedBridge, X as eventTopology, Y as dependentsOf, Z as renderModuleGraph, _ as ClosureNode, a as lazyModuleExports, b as PlanModulesOptions, c as getModuleResources, d as resolveContribution, f as resolveModule, g as withRelayNudge, h as createRelayNudge, i as hasModuleExports, j as AsyncApiInfo, k as collectModuleWorkflows, l as getModuleState, m as RelayOption, n as getModuleExports, o as lazyRequiredModuleExports, p as RelayNudge, q as buildModuleGraph, r as getOptionalModuleExports, s as ModuleState, t as defineModule, u as hasModule, v as CompositionProblem, w as resolveModuleClosure, x as assertComposable, y as ModulePlan, z as ModuleGraphIssue } from "../index-DFCCQ9AE.mjs";
4
- import { a as ResolvedModuleDescriptor, o as ResolvedModuleLifecycle, s as ResolvedResourceDescriptor } from "../fastify-augmentation-bzkWPt1f.mjs";
5
- import { a as UnderPressureOptions, c as CustomAuthenticatorOption, i as RawBodyOptions, l as CustomPluginAuthOption, n as CreateAppOptions, o as AuthOption, r as MultipartOptions, s as BetterAuthOption, t as BootDisposer, u as JwtAuthOption } from "../index-D1X_C_qz.mjs";
5
+ import { $ as verifyModuleGraph, A as AsyncApiCatalogEntry, B as ModuleGraphMode, C as planModules, D as ModuleExtension, E as subscribeModuleEventHandlers, F as DurabilityFacts, G as activateBridges, H as ModuleGraphOptions, I as HandlerDurabilityFact, J as crudEventsOf, K as analyzeModuleGraph, L as ModuleGraph, M as toAsyncApi, N as CrudSurface, O as extendModule, P as DerivedPublishes, Q as verifyEventDurability, R as ModuleGraphAnalysis, S as compositionProblems, T as orderModules, U as ModuleKind, V as ModuleGraphNode, W as SkippedBridge, X as eventTopology, Y as dependentsOf, Z as renderModuleGraph, _ as ClosureNode, a as lazyModuleExports, b as PlanModulesOptions, c as getModuleResources, d as resolveContribution, f as resolveModule, g as withRelayNudge, h as createRelayNudge, i as hasModuleExports, j as AsyncApiInfo, k as collectModuleWorkflows, l as getModuleState, m as RelayOption, n as getModuleExports, o as lazyRequiredModuleExports, p as RelayNudge, q as buildModuleGraph, r as getOptionalModuleExports, s as ModuleState, t as defineModule, u as hasModule, v as CompositionProblem, w as resolveModuleClosure, x as assertComposable, y as ModulePlan, z as ModuleGraphIssue } from "../index-DexdFs1a.mjs";
6
6
  import { FastifyInstance, FastifyServerOptions } from "fastify";
7
7
  /**
8
8
  * Default pino redact paths (auth/cookie/API-key headers, nested
@@ -157,4 +157,4 @@ export declare const testingPreset: Partial<CreateAppOptions>;
157
157
  */
158
158
  export declare const edgePreset: Partial<CreateAppOptions>;
159
159
  export declare function getPreset(name: "production" | "development" | "testing" | "edge" | "worker"): Partial<CreateAppOptions>;
160
- export { type ArcCompositionConfig, type ArcModule, type ArcModuleInput, type ArcModuleRegistry, type ArcPortRegistry, type ArcPorts, type ArcWorker, type AsyncApiCatalogEntry, type AsyncApiInfo, type AuthOption, type BetterAuthOption, type BootDisposer, type ClosureNode, type CompositionProblem, type CreateAppOptions, type CreateWorkerOptions, type CrudSurface, type CustomAuthenticatorOption, type CustomPluginAuthOption, type DerivedPublishes, type DurabilityFacts, type EagerGlobResult, type EventHandlerDefinition, type FetchHandlerOptions, type HandlerDurabilityFact, type JwtAuthOption, type LazyBridge, type LazyGlobResult, type LoadResourcesOptions, type ModuleContribution, type ModuleDisposer, type ModuleExtension, type ModuleGraph, type ModuleGraphAnalysis, type ModuleGraphIssue, type ModuleGraphMode, type ModuleGraphNode, type ModuleGraphOptions, type ModuleKind, type ModuleName, type ModulePlan, type ModulePorts, type ModuleRequirements, type ModuleSetupContext, type ModuleState, type MultipartOptions, type PlanModulesOptions, type PortName, type RawBodyOptions, type RelayNudge, type RelayOption, type ResolvedModuleDescriptor, type ResolvedModuleLifecycle, type ResolvedResourceDescriptor, type ResourceLike, type ResourceModule, type SkippedBridge, type UnderPressureOptions, type WorkerHealthOptions, activateBridges, analyzeModuleGraph, assertComposable, buildModuleGraph, collectModuleWorkflows, compositionProblems, createRelayNudge, crudEventsOf, defineModule, dependentsOf, eventTopology, extendModule, getModuleExports, getModuleResources, getModuleState, getOptionalModuleExports, hasModule, hasModuleExports, lazyModuleExports, lazyRequiredModuleExports, loadResources, orderModules, planModules, renderModuleGraph, resolveContribution, resolveModule, resolveModuleClosure, subscribeModuleEventHandlers, toAsyncApi, verifyEventDurability, verifyModuleGraph, withRelayNudge };
160
+ export { type ArcCompositionConfig, type ArcModule, type ArcModuleInput, type ArcModuleRegistry, type ArcPortRegistry, type ArcPorts, type ArcWorker, type AsyncApiCatalogEntry, type AsyncApiInfo, type AuthOption, type BetterAuthOption, type BootDisposer, type ClosureNode, type CompositionProblem, type CreateAppHttpOptions, type CreateAppOptions, type CreateWorkerOptions, type CrudSurface, type CustomAuthenticatorOption, type CustomPluginAuthOption, type DerivedPublishes, type DurabilityFacts, type EagerGlobResult, type EventHandlerDefinition, type FetchHandlerOptions, type HandlerDurabilityFact, type JwtAuthOption, type LazyBridge, type LazyGlobResult, type LoadResourcesOptions, type ModuleContribution, type ModuleDisposer, type ModuleExtension, type ModuleGraph, type ModuleGraphAnalysis, type ModuleGraphIssue, type ModuleGraphMode, type ModuleGraphNode, type ModuleGraphOptions, type ModuleKind, type ModuleName, type ModulePlan, type ModulePorts, type ModuleRequirements, type ModuleSetupContext, type ModuleState, type MultipartOptions, type PlanModulesOptions, type PortName, type RawBodyOptions, type RelayNudge, type RelayOption, type ResolvedModuleDescriptor, type ResolvedModuleLifecycle, type ResolvedResourceDescriptor, type ResourceLike, type ResourceModule, type SkippedBridge, type UnderPressureOptions, type WorkerHealthOptions, activateBridges, analyzeModuleGraph, assertComposable, buildModuleGraph, collectModuleWorkflows, compositionProblems, createRelayNudge, crudEventsOf, defineModule, dependentsOf, eventTopology, extendModule, getModuleExports, getModuleResources, getModuleState, getOptionalModuleExports, hasModule, hasModuleExports, lazyModuleExports, lazyRequiredModuleExports, loadResources, orderModules, planModules, renderModuleGraph, resolveContribution, resolveModule, resolveModuleClosure, subscribeModuleEventHandlers, toAsyncApi, verifyEventDurability, verifyModuleGraph, withRelayNudge };
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { r as mergeHealthChecks, t as healthPlugin } from "../health-jkYNdobJ.mjs";
3
- import { a as developmentPreset, c as productionPreset, d as getModuleResources, f as getModuleState, g as collectModuleWorkflows, l as testingPreset, m as subscribeModuleEventHandlers, n as DEFAULT_LOGGER_REDACT_PATHS, o as edgePreset, p as hasModule, r as createApp, s as getPreset, t as ArcFactory, u as workerPreset } from "../createApp-QDP4vYWH.mjs";
4
- import { _ as dependentsOf, b as verifyEventDurability, d as resolveModule, g as crudEventsOf, h as buildModuleGraph, i as planModules, m as analyzeModuleGraph, o as resolveModuleClosure, p as activateBridges, r as compositionProblems, s as orderModules, t as assertComposable, u as resolveContribution, v as eventTopology, x as verifyModuleGraph, y as renderModuleGraph } from "../plan-DDIGwuxr.mjs";
5
- import { a as lazyModuleExports, i as hasModuleExports, n as getModuleExports, o as lazyRequiredModuleExports, r as getOptionalModuleExports, t as defineModule } from "../module-BD8xHgrz.mjs";
6
- import { t as loadResources } from "../loadResources-Kr6vuljv.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { a as developmentPreset, c as productionPreset, d as getModuleResources, f as getModuleState, g as collectModuleWorkflows, l as testingPreset, m as subscribeModuleEventHandlers, n as DEFAULT_LOGGER_REDACT_PATHS, o as edgePreset, p as hasModule, r as createApp, s as getPreset, t as ArcFactory, u as workerPreset } from "../createApp-Be6XTGD9.mjs";
3
+ import { r as mergeHealthChecks, t as healthPlugin } from "../health-BoFxrkJE.mjs";
4
+ import { a as lazyModuleExports, i as hasModuleExports, n as getModuleExports, o as lazyRequiredModuleExports, r as getOptionalModuleExports, t as defineModule } from "../module-CWiqsXnh.mjs";
5
+ import { t as loadResources } from "../loadResources-rygByIQA.mjs";
6
+ import { _ as dependentsOf, b as verifyEventDurability, d as resolveModule, g as crudEventsOf, h as buildModuleGraph, i as planModules, m as analyzeModuleGraph, o as resolveModuleClosure, p as activateBridges, r as compositionProblems, s as orderModules, t as assertComposable, u as resolveContribution, v as eventTopology, x as verifyModuleGraph, y as renderModuleGraph } from "../plan-BnlNJhrj.mjs";
7
7
  // src/factory/module/asyncapi.ts
8
8
  /**
9
9
  * The module graph as an AsyncAPI 3.0 document — one channel per event (addressed by the event
@@ -1,8 +1,8 @@
1
1
 
2
- import { M as ResourceRegistry, dn as HookSystem } from "./index-Cy2-QffW.mjs";
2
+ import { M as ResourceRegistry, pn as HookSystem } from "./index-DLCcLUQT.mjs";
3
3
  import { t as ExternalOpenApiPaths } from "./externalPaths-BOqdq5wr.mjs";
4
4
  import { F as HealthCheck, i as ArcModuleRegistry, n as ArcModule, x as ScheduleDefinition } from "./types-BeEJm-DV.mjs";
5
- import { L as ModuleGraph, s as ModuleState } from "./index-DFCCQ9AE.mjs";
5
+ import { L as ModuleGraph, s as ModuleState } from "./index-DexdFs1a.mjs";
6
6
  import { FastifyPluginAsync } from "fastify";
7
7
  /**
8
8
  * Resolved module introspection — what a module ACTUALLY composed to.
@@ -0,0 +1,80 @@
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-gKJR3o-6.mjs";
3
+ // src/core/aggregation/fieldTypes.ts
4
+ var fieldTypes_exports = /* @__PURE__ */ __exportAll({
5
+ coerceByType: () => coerceByType,
6
+ fieldTypesFromOpenApiSchemas: () => fieldTypesFromOpenApiSchemas,
7
+ guessDate: () => guessDate
8
+ });
9
+ const isRecord = (v) => !!v && typeof v === "object" && !Array.isArray(v);
10
+ /** One JSON Schema property → a field type, or `undefined` when ambiguous / not scalar. */
11
+ function typeOfProperty(prop) {
12
+ if (!isRecord(prop)) return void 0;
13
+ for (const key of ["anyOf", "oneOf"]) {
14
+ const branches = prop[key];
15
+ if (Array.isArray(branches)) {
16
+ const nonNull = branches.filter((b) => !(isRecord(b) && b.type === "null"));
17
+ return nonNull.length === 1 ? typeOfProperty(nonNull[0]) : void 0;
18
+ }
19
+ }
20
+ const declared = Array.isArray(prop.type) ? prop.type.filter((t) => t !== "null") : [prop.type];
21
+ if (declared.length !== 1) return void 0;
22
+ switch (declared[0]) {
23
+ case "string":
24
+ if (prop.format === "date-time") return "date";
25
+ if (prop.format === "date") return void 0;
26
+ return "string";
27
+ case "number":
28
+ case "integer": return "number";
29
+ case "boolean": return "boolean";
30
+ default: return;
31
+ }
32
+ }
33
+ function collect(schema, prefix, out) {
34
+ if (!isRecord(schema) || !isRecord(schema.properties)) return;
35
+ for (const [name, prop] of Object.entries(schema.properties)) {
36
+ const path = prefix ? `${prefix}.${name}` : name;
37
+ if (path in out) continue;
38
+ const type = typeOfProperty(prop);
39
+ if (type) out[path] = type;
40
+ else if (isRecord(prop) && isRecord(prop.properties)) collect(prop, path, out);
41
+ }
42
+ }
43
+ /**
44
+ * Field types from a resource's generated OpenAPI schemas. Reads `entity`, then `response`, then
45
+ * `createBody` (the first that declares a field wins). Returns `{}` when none is available.
46
+ */
47
+ function fieldTypesFromOpenApiSchemas(schemas) {
48
+ const out = {};
49
+ if (!isRecord(schemas)) return out;
50
+ for (const key of [
51
+ "entity",
52
+ "response",
53
+ "createBody"
54
+ ]) collect(schemas[key], "", out);
55
+ return out;
56
+ }
57
+ const ISO_DATE_RE = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?)?$/;
58
+ /** The legacy shape guess, kept for fields with no declared type. */
59
+ function guessDate(v) {
60
+ if (typeof v !== "string" || !ISO_DATE_RE.test(v)) return v;
61
+ const d = new Date(v);
62
+ return Number.isNaN(d.getTime()) ? v : d;
63
+ }
64
+ /** Coerce one URL operand by the field's declared type. Unparseable input is returned unchanged. */
65
+ function coerceByType(v, type) {
66
+ if (typeof v !== "string") return v;
67
+ switch (type) {
68
+ case "string": return v;
69
+ case "date": {
70
+ const d = new Date(v);
71
+ return v.trim() === "" || Number.isNaN(d.getTime()) ? v : d;
72
+ }
73
+ case "number": {
74
+ const n = Number(v);
75
+ return v.trim() === "" || !Number.isFinite(n) ? v : n;
76
+ }
77
+ case "boolean": return v === "true" ? true : v === "false" ? false : v;
78
+ }
79
+ }
80
+ export { guessDate as i, fieldTypesFromOpenApiSchemas as n, fieldTypes_exports as r, coerceByType as t };
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/permissions/fields.ts
3
3
  /**
4
4
  * Field-Level Permissions
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/permissions/filter-merge.ts
3
3
  /**
4
4
  * Policy-filter composition — logical AND, never last-writer-wins.
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { t as pluralize } from "./pluralize-ClEjcKlG.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as pluralize } from "./pluralize-oVIxJ4CY.mjs";
3
3
  import { join } from "node:path";
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
5
  // src/cli/commands/generate/name-helpers.ts
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { u as ValidationError } from "./errors-DnrUChAy.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { u as ValidationError } from "./errors-BpYV859Y.mjs";
3
3
  // src/utils/headers.ts
4
4
  /**
5
5
  * Canonical header typing + accessor.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  import { randomUUID } from "node:crypto";
3
3
  import fp from "fastify-plugin";
4
4
  // src/plugins/requestId.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/events/outbox/health.ts
3
3
  /** Pending age past which the relay counts as stalled. */
4
4
  const DEFAULT_RELAY_LAG_UNHEALTHY_MS = 3e5;
@@ -1,3 +1,3 @@
1
1
 
2
- import { _n as beforeDelete, an as DefineHookOptions, bn as defineHook, cn as HookOperation, dn as HookSystem, fn as HookSystemOptions, gn as beforeCreate, hn as afterUpdate, in as AroundHookHandler, ln as HookPhase, mn as afterDelete, on as HookContext, pn as afterCreate, sn as HookHandler, un as HookRegistration, vn as beforeUpdate, yn as createHookSystem } from "../index-Cy2-QffW.mjs";
2
+ import { Sn as defineHook, _n as afterUpdate, bn as beforeUpdate, cn as HookContext, dn as HookPhase, fn as HookRegistration, gn as afterDelete, hn as afterCreate, ln as HookHandler, mn as HookSystemOptions, on as AroundHookHandler, pn as HookSystem, sn as DefineHookOptions, un as HookOperation, vn as beforeCreate, xn as createHookSystem, yn as beforeDelete } from "../index-DLCcLUQT.mjs";
3
3
  export { type AroundHookHandler, type DefineHookOptions, type HookContext, type HookHandler, type HookOperation, type HookPhase, type HookRegistration, HookSystem, type HookSystemOptions, afterCreate, afterDelete, afterUpdate, beforeCreate, beforeDelete, beforeUpdate, createHookSystem, defineHook };
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- export { t as HookSystem, n as afterCreate, r as afterDelete, i as afterUpdate, a as beforeCreate, o as beforeDelete, s as beforeUpdate, c as createHookSystem, l as defineHook } from "../HookSystem-CAIDVoKC.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ export { t as HookSystem, n as afterCreate, r as afterDelete, i as afterUpdate, a as beforeCreate, o as beforeDelete, s as beforeUpdate, c as createHookSystem, l as defineHook } from "../HookSystem-DMoeJ6Do.mjs";
@@ -1,7 +1,7 @@
1
1
 
2
- import { a as PrivacyDecision, c as RouteHttpCacheConfig, i as NonCacheableReason, l as TagSpec, n as HttpCachePolicy, o as PrivacyReason, r as HttpCacheRule, s as ResourceHttpCacheConfig, t as DocumentTags } from "../policy.types-DPqToKG1.mjs";
3
- import { n as DomainEvent } from "../EventTransport-CYEoCJGe.mjs";
4
2
  import { i as PurgerCapabilities, n as CachePurger, r as PurgeMode, t as CachePurgeError } from "../purger.types-DvPp4-yd.mjs";
3
+ import { n as DomainEvent } from "../EventTransport-CYEoCJGe.mjs";
4
+ import { a as PrivacyDecision, c as RouteHttpCacheConfig, i as NonCacheableReason, l as TagSpec, n as HttpCachePolicy, o as PrivacyReason, r as HttpCacheRule, s as ResourceHttpCacheConfig, t as DocumentTags } from "../policy.types-DPqToKG1.mjs";
5
5
  import { FastifyInstance, FastifyPluginAsync, FastifyRequest } from "fastify";
6
6
  import { OutboxStore } from "@classytic/primitives/outbox";
7
7
  interface InvalidationBatch {
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { t as hasEvents } from "../typeGuards-DVjVSsXO.mjs";
3
- import { n as chunkTags, t as CachePurgeError } from "../purger.types-2wNJK_89.mjs";
4
- import { r as exponentialBackoff, t as EventOutbox } from "../relay-BNrC1CEP.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { n as chunkTags, t as CachePurgeError } from "../purger.types-BjKy8869.mjs";
3
+ import { t as hasEvents } from "../typeGuards-_6nNQqgq.mjs";
4
+ import { r as exponentialBackoff, t as EventOutbox } from "../relay-DEIoMntZ.mjs";
5
5
  import fp from "fastify-plugin";
6
6
  import { createEvent } from "@classytic/primitives/events";
7
7
  // src/http-cache/invalidation/delivery.ts
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { t as CachePurgeError } from "../../purger.types-2wNJK_89.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as CachePurgeError } from "../../purger.types-BjKy8869.mjs";
3
3
  // src/http-cache/purgers/cloudflare.ts
4
4
  /**
5
5
  * Cloudflare purge-by-tag (`Cache-Tag`). Needs an API token scoped to Zone > Cache Purge only.
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
- import { t as CachePurgeError } from "../../purger.types-2wNJK_89.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as CachePurgeError } from "../../purger.types-BjKy8869.mjs";
3
3
  // src/http-cache/purgers/fastly.ts
4
4
  /**
5
5
  * Fastly surrogate-key purge, with soft purge (`Fastly-Soft-Purge: 1`). Responses must carry the tags in
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/http-cache/testing/assertions.ts
3
3
  const header = (res, name) => {
4
4
  const v = res.headers[name];