@classytic/arc 2.48.0 → 2.50.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 (213) hide show
  1. package/dist/{EventTransport-BWwg5YAU.mjs → EventTransport-B18mcj_M.mjs} +2 -2
  2. package/dist/{HookSystem-B9x-Y_k7.mjs → HookSystem-FUBaLTRm.mjs} +2 -2
  3. package/dist/{QueryCache-DdvrGG8Q.d.mts → QueryCache-BE47tmlO.d.mts} +36 -1
  4. package/dist/{ResourceRegistry-BcvEJoZd.mjs → ResourceRegistry-C5NM07fZ.mjs} +2 -2
  5. package/dist/{acquire-D2yj6Zzl.mjs → acquire-MHCnbDtH.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-BZSJcPNE.mjs → authorizationDecision-BD8K4jdQ.mjs} +4 -4
  13. package/dist/{boundedMap-o2KZDCWy.mjs → boundedMap-CuCwos_X.mjs} +1 -1
  14. package/dist/{buildHandler-G3k59KY2.mjs → buildHandler-BttjNkTM.mjs} +23 -16
  15. package/dist/cache/index.d.mts +2 -2
  16. package/dist/cache/index.mjs +4 -4
  17. package/dist/{caching-CJIDPZOv.mjs → caching-CxUQLHfR.mjs} +3 -6
  18. package/dist/{claimed-D0A43wjT.mjs → claimed-CQ4ZpD8K.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-D-faL5SX.mjs → constants-BZFsZwJh.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-NSu1peyq.mjs → core-DWA1-5IE.mjs} +3 -3
  34. package/dist/{createActionRouter-DTSVv1VK.mjs → createActionRouter-fP3l2xVF.mjs} +54 -18
  35. package/dist/{createAggregationRouter-zEasm-ax.mjs → createAggregationRouter-BJZeOmBa.mjs} +13 -11
  36. package/dist/{createApp-CjqhkX1x.mjs → createApp-Db9JRumw.mjs} +332 -40
  37. package/dist/{createMcpServer-hSFeqRUb.d.mts → createMcpServer-CS2KOVP6.d.mts} +1 -1
  38. package/dist/{defineAggregation-DH2L6_v9.mjs → defineAggregation-BskqRz8M.mjs} +1 -1
  39. package/dist/{defineResource-zYCrhNaN.mjs → defineResource-B2vTvKzW.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-z--rFcZ5.mjs → elevation-XoY0C73T.mjs} +6 -9
  44. package/dist/encryption/index.mjs +3 -3
  45. package/dist/{errorHandler-3_3oN-Uc.mjs → errorHandler-BYI-JQMm.mjs} +4 -7
  46. package/dist/{errors-DyY48oRi.mjs → errors-3xaK0i9n.mjs} +1 -1
  47. package/dist/{eventPlugin-Co9sABCg.mjs → eventPlugin-CVQ9ddnL.mjs} +9 -13
  48. package/dist/{eventTypes-HmAFyJmJ.mjs → eventTypes-UPYg7gW1.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-CxRvCaaZ.mjs +80 -0
  58. package/dist/{fields-rfsl26Ov.mjs → fields-DLFcJiDe.mjs} +1 -1
  59. package/dist/{filter-merge-8glLr7Dk.mjs → filter-merge-Bvjk_8dV.mjs} +1 -1
  60. package/dist/{generate-BOfBueRt.mjs → generate-0OpCUjUv.mjs} +2 -2
  61. package/dist/{headers-CHSOqpcY.mjs → headers-BROW65-r.mjs} +2 -2
  62. package/dist/{health-ezwTHQh2.mjs → health-Cfh-kYI_.mjs} +1 -1
  63. package/dist/{health-DHvAIVmM.mjs → health-Cy6aOg1i.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-MoE3eZNR.mjs → init-D7PQcvvL.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 +5 -5
  87. package/dist/integrations/mcp/index.mjs +2 -2
  88. package/dist/integrations/mcp/testing.d.mts +2 -2
  89. package/dist/integrations/mcp/testing.mjs +2 -2
  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-DZGiCawf.mjs → jsonBody-C0oREwUc.mjs} +2 -2
  97. package/dist/{keys-CrMOZuk6.mjs → keys-CGlPoVSn.mjs} +1 -1
  98. package/dist/{loadResources-CVQvYUhN.mjs → loadResources-Oi47dogA.mjs} +3 -3
  99. package/dist/{loadResourcesFromEntry-D0naccV2.mjs → loadResourcesFromEntry-BW-LexBz.mjs} +2 -2
  100. package/dist/logger/index.mjs +2 -2
  101. package/dist/{logger-VyMcSmVG.mjs → logger-BagW7_YA.mjs} +1 -1
  102. package/dist/{mcpPlugin-DQACaqVu.mjs → mcpPlugin-C6-wFsOX.mjs} +29 -26
  103. package/dist/{memory-Lpfu8Hga.mjs → memory-Bl7kv6TS.mjs} +3 -3
  104. package/dist/{metrics-DjVj1sg5.mjs → metrics-CqnMJKrJ.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-BqPJpZ_L.mjs → module-lbEbHUfI.mjs} +1 -1
  109. package/dist/{multiTenant-KZj8j1uJ.d.mts → multiTenant-QtDzxx_K.d.mts} +1 -1
  110. package/dist/{multipartBody-BNgNv7r0.mjs → multipartBody-CqNezaB3.mjs} +1 -1
  111. package/dist/{observeSend-BKJHibJz.mjs → observeSend-BjilzlYl.mjs} +1 -1
  112. package/dist/{openapi-T90KrPR6.mjs → openapi-DXNbadgd.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-5Mnwcycy.d.mts → outbox-module-DzW6zwWJ.d.mts} +103 -10
  116. package/dist/{outbox-module-C874VgBr.mjs → outbox-module-k5rIszQ4.mjs} +197 -28
  117. package/dist/permissions/index.d.mts +2 -2
  118. package/dist/permissions/index.mjs +7 -7
  119. package/dist/{permissions-R9T2G1PH.mjs → permissions-BJylQopQ.mjs} +9 -9
  120. package/dist/{pipe-DzqbsZy-.mjs → pipe-D1cq8hET.mjs} +2 -2
  121. package/dist/pipeline/index.d.mts +1 -1
  122. package/dist/pipeline/index.mjs +2 -2
  123. package/dist/{plan-C0gkeABY.mjs → plan-iEgaS5_H.mjs} +1 -1
  124. package/dist/{plugin-BJcVOX5r.mjs → plugin-DsLr6L4O.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-CrCpyoZs.mjs → pluralize-CX4ZvwCa.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-CNDvNYsz.mjs → presets-D_suT4OY.mjs} +4 -4
  139. package/dist/{projection-CIUe8b59.mjs → projection-CmjGjFih.mjs} +2 -2
  140. package/dist/{purger.types-f83fTzGy.mjs → purger.types-CZwkTZ7B.mjs} +1 -1
  141. package/dist/{queryCachePlugin-B2jpwFcv.mjs → queryCachePlugin-BDOPEAmH.mjs} +114 -14
  142. package/dist/{queryCachePlugin-DYQUyeJ9.d.mts → queryCachePlugin-DrQNnGws.d.mts} +1 -1
  143. package/dist/{rateLimitKey-BWx-qep0.mjs → rateLimitKey-igF1x64n.mjs} +1 -1
  144. package/dist/{realtime-D2tqi3d2.mjs → realtime-Cq_ugiWw.mjs} +75 -22
  145. package/dist/registry/index.d.mts +2 -2
  146. package/dist/registry/index.mjs +3 -3
  147. package/dist/{registry-Dl0k6UXy.mjs → registry-DmF9Akvn.mjs} +2 -2
  148. package/dist/{relay-ZYvS4xyW.mjs → relay-DA89IhFt.mjs} +200 -99
  149. package/dist/{renewingLease-DT4yLb29.mjs → renewingLease-DBtGUt8T.mjs} +1 -1
  150. package/dist/{replyHelpers-BJFN5AW7.mjs → replyHelpers-CUbeUc5q.mjs} +2 -2
  151. package/dist/{requestContext-Ct5la-SA.mjs → requestContext-DO9Qv0gw.mjs} +1 -1
  152. package/dist/{requirement-CxDxjB6V.mjs → requirement-C3GaQmkR.mjs} +1 -1
  153. package/dist/{resourceRateLimit-DCWglD7V.d.mts → resourceRateLimit-BPiESPtG.d.mts} +4 -0
  154. package/dist/{resourceRateLimit-D1oH2obv.mjs → resourceRateLimit-KKn-sFhb.mjs} +19 -4
  155. package/dist/{rolldown-runtime-BdTN42uL.mjs → rolldown-runtime-Ck1Tj4Ax.mjs} +1 -1
  156. package/dist/{routeValidator-DclDl5WJ.mjs → routeValidator-BF7n34xV.mjs} +47 -5
  157. package/dist/{runtimeCapabilities-ClWr60El.mjs → runtimeCapabilities-D0A4kkrC.mjs} +1 -1
  158. package/dist/{schedules-gVkRcs-9.mjs → schedules-CLrQRSTt.mjs} +6 -9
  159. package/dist/{schemaConverter-CIwB5wPO.mjs → schemaConverter-JEmU21fu.mjs} +2 -2
  160. package/dist/{actionPermissions-Dha8sAz2.mjs → schemaIR-wOffQlbq.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-VMZhdkbT.mjs → scope-CcTMRd7s.mjs} +4 -4
  166. package/dist/{shutdown-Bi19vH0z.mjs → shutdown-BIR-QBYM.mjs} +1 -1
  167. package/dist/{simpleEqualityMatcher-CaCS09fh.mjs → simpleEqualityMatcher-DqqJqovq.mjs} +1 -1
  168. package/dist/{sse-BqM359f1.mjs → sse-OEuPpgss.mjs} +9 -35
  169. package/dist/sseStats-DQqNN385.d.mts +112 -0
  170. package/dist/sseStream-DknHE2K5.mjs +166 -0
  171. package/dist/{store-helpers-rx-F2ZGR.mjs → store-helpers-D4vtEXt2.mjs} +1 -1
  172. package/dist/{streaming-CPChx3A7.mjs → streaming-CcIpcx02.mjs} +1 -1
  173. package/dist/{subscriberIdentity-CYNYw8p_.mjs → subscriberIdentity-PO6kimAl.mjs} +1 -1
  174. package/dist/{tenancy-BoWImS3K.mjs → tenancy-CH2Kuksc.mjs} +2 -2
  175. package/dist/{tenantPreparation-oqKCZQZM.mjs → tenantPreparation-BTGpblQW.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-Dsteq59c.mjs → timing-Dii5X7AP.mjs} +1 -1
  183. package/dist/{transactionContext-C1OgH-hW.mjs → transactionContext-DMPhYEOt.mjs} +1 -1
  184. package/dist/{typeGuards-DNlpASzd.mjs → typeGuards-C1o_XEyp.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-DduBiYaI.d.mts → types-B4E0sc6D.d.mts} +2 -2
  189. package/dist/{types-HFFSwF_K.mjs → types-BuV_cFqT.mjs} +4 -4
  190. package/dist/usage/index.d.mts +1 -1
  191. package/dist/usage/index.mjs +7 -7
  192. package/dist/{userHelpers-N-k-8dNF.mjs → userHelpers-D4m_pLSC.mjs} +1 -1
  193. package/dist/utils/index.d.mts +193 -34
  194. package/dist/utils/index.mjs +13 -13
  195. package/dist/{utils-C7w_RVlx.mjs → utils-CxLMXGn5.mjs} +761 -8
  196. package/dist/{validate-Brr4b_fH.mjs → validate-CZ975J8N.mjs} +3 -3
  197. package/dist/{versioning-S18y2-0C.d.mts → versioning-B07RgD27.d.mts} +2 -13
  198. package/dist/{versioning-CE5kdWOY.mjs → versioning-B2_8SBZo.mjs} +4 -7
  199. package/dist/{workScope-A3XBpYTa.mjs → workScope-B3W3r35s.mjs} +2 -2
  200. package/llms.txt +2 -2
  201. package/package.json +34 -34
  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/production-api.md +4 -0
  207. package/skills/arc/references/production-boot.md +2 -0
  208. package/skills/arc/references/production-idempotency.md +1 -1
  209. package/skills/arc/references/production-realtime.md +28 -2
  210. package/skills/arc/references/validation.md +4 -0
  211. package/skills/arc/references/writes-hooks-errors.md +1 -0
  212. package/dist/schemaIR-A0IoD05P.mjs +0 -108
  213. package/dist/sseStream-qSa-F2Qm.mjs +0 -57
@@ -1,10 +1,10 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as transactionContext } from "./transactionContext-C1OgH-hW.mjs";
3
- import { n as requestContext } from "./requestContext-Ct5la-SA.mjs";
4
- import { i as resolveEventTransport } from "./EventTransport-BWwg5YAU.mjs";
5
- import { t as EventOutbox } from "./relay-ZYvS4xyW.mjs";
6
- import { t as emitObserved } from "./eventPlugin-Co9sABCg.mjs";
7
- import { n as canReportHealth, r as readOutboxHealth } from "./health-DHvAIVmM.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { n as requestContext } from "./requestContext-DO9Qv0gw.mjs";
3
+ import { t as transactionContext } from "./transactionContext-DMPhYEOt.mjs";
4
+ import { i as resolveEventTransport } from "./EventTransport-B18mcj_M.mjs";
5
+ import { t as emitObserved } from "./eventPlugin-CVQ9ddnL.mjs";
6
+ import { n as canReportHealth, r as readOutboxHealth } from "./health-Cy6aOg1i.mjs";
7
+ import { t as EventOutbox } from "./relay-DA89IhFt.mjs";
8
8
  import { randomBytes } from "node:crypto";
9
9
  import { hostname } from "node:os";
10
10
  // src/events/outbox-module.ts
@@ -47,6 +47,9 @@ const DEFAULT_RELAY_EVERY_MS = 5e3;
47
47
  const DEFAULT_PROBE_CACHE_MS = 5e3;
48
48
  /** How often an unhealthy outbox is logged. See `health.alertEveryMs`. */
49
49
  const DEFAULT_HEALTH_ALERT_EVERY_MS = 3e5;
50
+ /** First pause after a pass that lost leases; doubles per consecutive losing pass. */
51
+ const LEASE_LOSS_BACKOFF_BASE_MS = 1e3;
52
+ const LEASE_LOSS_BACKOFF_MAX_MS = 3e4;
50
53
  /**
51
54
  * One relay identity per RELAY INSTANCE — `<name>:<hostname>:<pid>:<random>`.
52
55
  *
@@ -101,6 +104,8 @@ function mintConsumerId(name) {
101
104
  function createOutboxModule(options) {
102
105
  const name = options.name ?? "outbox";
103
106
  const relayEveryMs = options.relayEveryMs ?? DEFAULT_RELAY_EVERY_MS;
107
+ const maxPassesPerTick = options.maxPassesPerTick ?? 1;
108
+ if (!Number.isInteger(maxPassesPerTick) || maxPassesPerTick < 1) throw new Error(`Outbox module "${name}": maxPassesPerTick must be an integer >= 1, got ${String(options.maxPassesPerTick)}.`);
104
109
  const lagUnhealthyMs = (options.health === false ? void 0 : options.health?.relayLagUnhealthyMs) ?? 3e5;
105
110
  const probeCacheMs = (options.health === false ? void 0 : options.health?.probeCacheMs) ?? DEFAULT_PROBE_CACHE_MS;
106
111
  if (!Number.isFinite(probeCacheMs) || probeCacheMs < 0) throw new Error(`Outbox module "${name}": health.probeCacheMs must be a non-negative number, got ${String(probeCacheMs)}.`);
@@ -138,6 +143,8 @@ function createOutboxModule(options) {
138
143
  * depends on for exactly-once publishing.
139
144
  */
140
145
  let exports;
146
+ /** The untyped single-flight lane, built at bootstrap; the schedule runs in it too. */
147
+ let backlogLane;
141
148
  /** Passes THIS module started (nudge, schedule) that have not settled — `drain()` waits on them. */
142
149
  const inFlightPasses = /* @__PURE__ */ new Set();
143
150
  const trackPass = (pass) => {
@@ -148,6 +155,72 @@ function createOutboxModule(options) {
148
155
  pass.then(untrack, untrack);
149
156
  return pass;
150
157
  };
158
+ /**
159
+ * Up to `maxPassesPerTick` `relayBatch()` calls, continuing while the previous pass
160
+ * claimed rows AND relayed something. A pass of only failures stops the loop: those rows
161
+ * are backing off, and another pass would only re-claim the next batch into the same
162
+ * outage. A pass that claimed nothing ends it.
163
+ *
164
+ * "Fewer than `batchSize`" does NOT end it: a store may cap one claim below
165
+ * `batchSize` (a repository's page `maxLimit`, 100 by default in mongokit), and a
166
+ * clamped page would read as "backlog empty" and strand the rest until the next tick.
167
+ * The price is one empty claim after the backlog clears.
168
+ */
169
+ const relayPasses = async (relay, types) => {
170
+ if (backingOff()) return false;
171
+ let passes = 0;
172
+ for (;;) {
173
+ const r = await relay.relayBatch(types ? { types } : void 0);
174
+ passes++;
175
+ if (observeLeaseLoss(r)) return true;
176
+ if (passes >= maxPassesPerTick || !(r.attempted > 0) || r.relayed === 0) return true;
177
+ }
178
+ };
179
+ /**
180
+ * Lease-loss back-off. A pass whose ack or fail met an ownership mismatch lost
181
+ * rows to another claimant: relaying again at once only re-claims into the same
182
+ * contention. Passes pause for 1 s, doubling per consecutive losing pass up to
183
+ * 30 s, and the loss is logged ONCE per pass with counts — the default `onError`
184
+ * no longer logs it per row.
185
+ */
186
+ let leaseLossStreak = 0;
187
+ let backoffUntil = 0;
188
+ const backingOff = () => Date.now() < backoffUntil;
189
+ const observeLeaseLoss = (r) => {
190
+ const lost = r.ownershipMismatches ?? 0;
191
+ if (lost > 0) {
192
+ leaseLossStreak++;
193
+ const backoffMs = Math.min(LEASE_LOSS_BACKOFF_BASE_MS * 2 ** (leaseLossStreak - 1), LEASE_LOSS_BACKOFF_MAX_MS);
194
+ backoffUntil = Date.now() + backoffMs;
195
+ log?.warn({
196
+ marker: "OUTBOX_LEASE_LOST",
197
+ outbox: name,
198
+ ownershipMismatches: lost,
199
+ attempted: r.attempted,
200
+ relayed: r.relayed,
201
+ leaseDeferred: r.leaseDeferred ?? 0,
202
+ consecutivePasses: leaseLossStreak,
203
+ backoffMs
204
+ }, `outbox relay "${name}" lost ${lost} lease(s) to another claimant; backing off ${backoffMs} ms`);
205
+ return true;
206
+ }
207
+ if (r.attempted > 0) leaseLossStreak = 0;
208
+ return false;
209
+ };
210
+ /** A requested pass that met the back-off reruns when it ends (one timer per lane). */
211
+ const retryTimers = /* @__PURE__ */ new Set();
212
+ let closed = false;
213
+ const retryAfterBackoff = (lane, armed) => {
214
+ if (closed || armed.timer) return;
215
+ armed.timer = true;
216
+ const timer = setTimeout(() => {
217
+ retryTimers.delete(timer);
218
+ armed.timer = false;
219
+ lane.request();
220
+ }, Math.max(0, backoffUntil - Date.now()));
221
+ timer.unref?.();
222
+ retryTimers.add(timer);
223
+ };
151
224
  return {
152
225
  name,
153
226
  bootstrap: (fastify) => {
@@ -180,6 +253,13 @@ function createOutboxModule(options) {
180
253
  ...options.leaseMs !== void 0 ? { leaseMs: options.leaseMs } : {},
181
254
  consumerId: options.consumerId ?? mintConsumerId(name),
182
255
  onError: options.onError ?? ((info) => {
256
+ if (info.kind === "ownership_mismatch") {
257
+ fastify.log.debug({
258
+ kind: info.kind,
259
+ eventId: info.event?.meta.id
260
+ }, `outbox relay "${name}" lost a lease`);
261
+ return;
262
+ }
183
263
  fastify.log.error({
184
264
  err: info.error,
185
265
  kind: info.kind,
@@ -191,25 +271,52 @@ function createOutboxModule(options) {
191
271
  ...options.sessionProvider === false ? {} : { sessionProvider: options.sessionProvider ?? (() => transactionContext.get()) }
192
272
  });
193
273
  /**
194
- * One pass per burst of requests. `drainQueued` stays true from the
195
- * first request until the pass STARTS, so a request landing mid-pass
196
- * schedules the next one — a row written during a pass is never left
197
- * waiting for the interval.
274
+ * Two single-flight lanes: `backlog` (untyped nudges, the scheduled tick,
275
+ * `drain()`) and `priority` (typed nudges, so an alarm never waits behind
276
+ * a slow backlog pass). Each runs at most ONE pass at a time; a request
277
+ * during a pass queues exactly one follow-up that starts after it ends.
278
+ * Overlapping passes were the livelock: the newer one re-claimed the older
279
+ * one's expired rows, both ran the handlers, and the older ack failed.
280
+ *
281
+ * `exit` — NOT merely cosmetic. The lane's `setImmediate` preserves the
282
+ * caller's AsyncLocalStorage store, and the caller is a REQUEST (that is the
283
+ * documented use: drain the row I just committed). A pass drains whatever is
284
+ * pending, so without this every event in the batch — including rows written
285
+ * by other requests, for other tenants — dispatches inside the triggering
286
+ * request's scope: `runWorkScope` inherits it rather than opening the
287
+ * event's own, handlers read that request's `user`/`organizationId`/
288
+ * `requestScopedCache`, and a child event published from one is stamped
289
+ * with its `requestId` as `correlationId`. A relay pass belongs to no
290
+ * request; say so.
198
291
  */
199
- let drainQueued = false;
200
- const requestDrain = () => {
201
- if (drainQueued) return;
202
- drainQueued = true;
203
- let passDone = () => {};
204
- trackPass(new Promise((resolve) => passDone = resolve));
205
- setImmediate(() => {
206
- drainQueued = false;
207
- requestContext.storage.exit(() => {
208
- relay.relayBatch().catch((err) => {
209
- fastify.log.error({ err }, `outbox relay "${name}" requested drain failed`);
210
- }).finally(passDone);
211
- });
212
- });
292
+ const scopeFree = (fn) => requestContext.storage.exit(fn).catch((err) => {
293
+ fastify.log.error({ err }, `outbox relay "${name}" requested drain failed`);
294
+ });
295
+ const backlogArmed = { timer: false };
296
+ const backlog = createPassLane(() => scopeFree(async () => {
297
+ if (!await relayPasses(relay)) retryAfterBackoff(backlog, backlogArmed);
298
+ }), trackPass);
299
+ /** Types asked for by typed requests not yet taken by a priority pass. */
300
+ let typesQueued = null;
301
+ const priorityArmed = { timer: false };
302
+ const priority = createPassLane(() => scopeFree(async () => {
303
+ const typed = typesQueued ? [...typesQueued] : void 0;
304
+ typesQueued = null;
305
+ if (!typed) return;
306
+ if (!await relayPasses(relay, typed)) {
307
+ typesQueued ??= /* @__PURE__ */ new Set();
308
+ for (const t of typed) typesQueued.add(t);
309
+ retryAfterBackoff(priority, priorityArmed);
310
+ }
311
+ }), trackPass);
312
+ backlogLane = backlog;
313
+ const requestDrain = (options) => {
314
+ const types = Array.isArray(options?.types) ? options.types.filter((t) => typeof t === "string" && t.length > 0) : [];
315
+ if (types.length > 0) {
316
+ typesQueued ??= /* @__PURE__ */ new Set();
317
+ for (const t of types) typesQueued.add(t);
318
+ priority.request();
319
+ } else backlog.request();
213
320
  };
214
321
  const drain = ({ maxPasses = 100 } = {}) => requestContext.storage.exit(async () => {
215
322
  const total = {
@@ -219,15 +326,18 @@ function createOutboxModule(options) {
219
326
  deadLettered: 0,
220
327
  drained: false
221
328
  };
329
+ let deferred = false;
222
330
  while (total.passes < maxPasses) {
223
331
  if (inFlightPasses.size > 0) await Promise.allSettled([...inFlightPasses]);
224
- const r = await relay.relayBatch();
332
+ const r = await backlog.exclusive(() => relay.relayBatch());
333
+ observeLeaseLoss(r);
225
334
  total.passes++;
226
335
  total.relayed += r.relayed;
227
336
  total.publishFailed += r.publishFailed;
228
337
  total.deadLettered += r.deadLettered;
338
+ if ((r.leaseDeferred ?? 0) > 0) deferred = true;
229
339
  if (r.attempted === 0 && inFlightPasses.size === 0) {
230
- total.drained = true;
340
+ total.drained = !deferred;
231
341
  break;
232
342
  }
233
343
  }
@@ -246,6 +356,12 @@ function createOutboxModule(options) {
246
356
  };
247
357
  return exports;
248
358
  },
359
+ /** Stop back-off retries; a timer firing after close would relay into a closed store. */
360
+ onClose: () => {
361
+ closed = true;
362
+ for (const timer of retryTimers) clearTimeout(timer);
363
+ retryTimers.clear();
364
+ },
249
365
  ...options.health === false ? {} : { healthChecks: [{
250
366
  name: `${name}.relay`,
251
367
  critical: false,
@@ -261,7 +377,10 @@ function createOutboxModule(options) {
261
377
  every: relayEveryMs,
262
378
  runOnStart: options.runOnStart ?? true,
263
379
  handler: async () => {
264
- if (exports) await trackPass(exports.relay.relay());
380
+ if (exports && backlogLane) {
381
+ const relay = exports.relay;
382
+ await trackPass(backlogLane.exclusive(() => relayPasses(relay)));
383
+ }
265
384
  }
266
385
  }, ...alertEveryMs > 0 ? [{
267
386
  name: `${name}.health`,
@@ -294,4 +413,54 @@ function createOutboxModule(options) {
294
413
  }] : []]
295
414
  };
296
415
  }
416
+ /**
417
+ * `run` must not reject. A requested pass is tracked from the REQUEST, not from
418
+ * its start, so `drain()` called right after a nudge waits for that pass.
419
+ */
420
+ function createPassLane(run, track) {
421
+ let busy;
422
+ /** Resolves the tracked promise of the queued (not yet started) pass. */
423
+ let queuedDone;
424
+ let scheduled = false;
425
+ const schedule = () => {
426
+ if (scheduled) return;
427
+ scheduled = true;
428
+ setImmediate(start);
429
+ };
430
+ const release = () => {
431
+ busy = void 0;
432
+ if (queuedDone) schedule();
433
+ };
434
+ function start() {
435
+ scheduled = false;
436
+ if (busy !== void 0 || !queuedDone) return;
437
+ const done = queuedDone;
438
+ queuedDone = void 0;
439
+ busy = run().finally(() => {
440
+ done();
441
+ release();
442
+ });
443
+ }
444
+ return {
445
+ request() {
446
+ if (!queuedDone) {
447
+ let resolve = () => {};
448
+ track(new Promise((r) => resolve = r));
449
+ queuedDone = resolve;
450
+ }
451
+ if (busy === void 0) schedule();
452
+ },
453
+ async exclusive(fn) {
454
+ while (busy !== void 0) await busy.catch(() => {});
455
+ let done = () => {};
456
+ busy = new Promise((r) => done = r);
457
+ try {
458
+ return await fn();
459
+ } finally {
460
+ done();
461
+ release();
462
+ }
463
+ }
464
+ };
465
+ }
297
466
  export { createOutboxModule as t };
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { c as DataPolicy, d as UserBase, l as PermissionCheck, m as normalizeRoles, p as getUserRoles, s as AuthorizationDecision, u as PermissionContext } from "../base-HXNgPQww.mjs";
3
3
  import { a as applyFieldReadPermissions, c as resolveEffectiveRoles, i as FieldWritePermissionResult, n as FieldPermissionMap, o as applyFieldWritePermissions, r as FieldPermissionType, s as fields, t as FieldPermission } from "../fields-JTkrtO-r.mjs";
4
- import { $ as deny, A as GrantResolution, B as explainAccess, C as requireScopeContext, D as createRoleHierarchy, E as RoleHierarchy, F as AccessExplanation, G as createDynamicPermissionMatrix, H as DynamicPermissionMatrix, I as PermissionRequirement, J as PublicPolicy, K as createOrgPermissions, L as collectPublicSurface, M as modeSatisfies, N as requireGrant, O as GRANT_MODES, P as conjoinPolicyFilters, Q as anyOf, R as describePermission, S as requireOrgRole, T as requireTeamMembership, U as DynamicPermissionMatrixConfig, V as ConnectEventsOptions, W as PermissionEventBus, X as allow, Y as allOf, Z as allowPublic, _ as publicRead, _t as requireMandate, a as PermissionMatrixRegistry, at as requireRoles, b as requireOrgInScope, c as introspectModule, ct as scopeOf, d as adminOnly, dt as evaluatePermissionDecision, et as denyAll, f as authenticated, ft as normalizeToDecision, g as presets_d_exports, gt as requireDPoP, h as permissionMatrix, ht as requireAgentScope, i as PermissionMatrixOptions, it as requirePlatformRole, j as RequireGrantOptions, k as GrantMode, l as introspectRegistry, lt as PermissionCheckReturn, m as ownerWithAdminBypass, mt as RequireMandateOptions, n as PermissionEntryType, nt as requireAuth, o as buildPermissionMatrix, ot as roles, p as fullPublic, pt as RequireAgentScopeOptions, q as AllowPublicOptions, r as PermissionMatrix, rt as requireOwnership, s as introspectCheck, st as when, t as PermissionEntry, tt as not, u as PermissionOverrides, ut as applyAuthorizationDecision, v as publicReadAdminWrite, w as requireServiceScope, x as requireOrgMembership, y as readOnly, z as describePermissionMap } from "../index-B5i9-vuP.mjs";
5
- import { a as createMemoryResourceRateLimiter, i as ResourceRateLimiter, n as ResourceRateLimitDecision, o as resolveResourceRateLimiter, r as ResourceRateLimitPolicy, t as ResourceRateLimitContext } from "../resourceRateLimit-DCWglD7V.mjs";
4
+ import { $ as deny, A as GrantResolution, B as explainAccess, C as requireScopeContext, D as createRoleHierarchy, E as RoleHierarchy, F as AccessExplanation, G as createDynamicPermissionMatrix, H as DynamicPermissionMatrix, I as PermissionRequirement, J as PublicPolicy, K as createOrgPermissions, L as collectPublicSurface, M as modeSatisfies, N as requireGrant, O as GRANT_MODES, P as conjoinPolicyFilters, Q as anyOf, R as describePermission, S as requireOrgRole, T as requireTeamMembership, U as DynamicPermissionMatrixConfig, V as ConnectEventsOptions, W as PermissionEventBus, X as allow, Y as allOf, Z as allowPublic, _ as publicRead, _t as requireMandate, a as PermissionMatrixRegistry, at as requireRoles, b as requireOrgInScope, c as introspectModule, ct as scopeOf, d as adminOnly, dt as evaluatePermissionDecision, et as denyAll, f as authenticated, ft as normalizeToDecision, g as presets_d_exports, gt as requireDPoP, h as permissionMatrix, ht as requireAgentScope, i as PermissionMatrixOptions, it as requirePlatformRole, j as RequireGrantOptions, k as GrantMode, l as introspectRegistry, lt as PermissionCheckReturn, m as ownerWithAdminBypass, mt as RequireMandateOptions, n as PermissionEntryType, nt as requireAuth, o as buildPermissionMatrix, ot as roles, p as fullPublic, pt as RequireAgentScopeOptions, q as AllowPublicOptions, r as PermissionMatrix, rt as requireOwnership, s as introspectCheck, st as when, t as PermissionEntry, tt as not, u as PermissionOverrides, ut as applyAuthorizationDecision, v as publicReadAdminWrite, w as requireServiceScope, x as requireOrgMembership, y as readOnly, z as describePermissionMap } from "../index-CMNpMBtW.mjs";
5
+ import { a as createMemoryResourceRateLimiter, i as ResourceRateLimiter, n as ResourceRateLimitDecision, o as resolveResourceRateLimiter, r as ResourceRateLimitPolicy, t as ResourceRateLimitContext } from "../resourceRateLimit-BPiESPtG.mjs";
6
6
  export { type AccessExplanation, type AllowPublicOptions, type AuthorizationDecision, type ConnectEventsOptions, type DataPolicy, type DynamicPermissionMatrix, type DynamicPermissionMatrixConfig, type FieldPermission, type FieldPermissionMap, type FieldPermissionType, type FieldWritePermissionResult, GRANT_MODES, type GrantMode, type GrantResolution, type PermissionCheck, type PermissionCheckReturn, type PermissionContext, type PermissionEntry, type PermissionEntryType, type PermissionEventBus, type PermissionMatrix, type PermissionMatrixOptions, type PermissionMatrixRegistry, type PermissionOverrides, type PermissionRequirement, type PublicPolicy, type RequireAgentScopeOptions, type RequireGrantOptions, type RequireMandateOptions, type ResourceRateLimitContext, type ResourceRateLimitDecision, type ResourceRateLimitPolicy, type ResourceRateLimiter, type RoleHierarchy, type UserBase, adminOnly, allOf, allow, allowPublic, anyOf, applyAuthorizationDecision, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, buildPermissionMatrix, collectPublicSurface, conjoinPolicyFilters, createDynamicPermissionMatrix, createMemoryResourceRateLimiter, createOrgPermissions, createRoleHierarchy, deny, denyAll, describePermission, describePermissionMap, evaluatePermissionDecision, explainAccess, fields, fullPublic, getUserRoles, introspectCheck, introspectModule, introspectRegistry, modeSatisfies, normalizeRoles, normalizeToDecision, not, ownerWithAdminBypass, permissionMatrix, presets_d_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAgentScope, requireAuth, requireDPoP, requireGrant, requireMandate, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requirePlatformRole, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, resolveEffectiveRoles, resolveResourceRateLimiter, roles, scopeOf, when };
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as conjoinPolicyFilters } from "../filter-merge-8glLr7Dk.mjs";
3
- import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-N-k-8dNF.mjs";
4
- import { a as resolveEffectiveRoles, i as fields, n as applyFieldWritePermissions, t as applyFieldReadPermissions } from "../fields-rfsl26Ov.mjs";
5
- import { i as normalizeToDecision, r as evaluatePermissionDecision, t as applyAuthorizationDecision } from "../authorizationDecision-BZSJcPNE.mjs";
6
- import { i as resolveResourceRateLimiter, t as createMemoryResourceRateLimiter } from "../resourceRateLimit-D1oH2obv.mjs";
7
- import { A as requireAgentScope, B as requireAuth, C as createOrgPermissions, D as requireScopeContext, E as requireOrgRole, F as allowPublic, G as when, H as requirePlatformRole, I as anyOf, K as scopeOf, L as deny, M as requireMandate, N as allOf, O as requireServiceScope, P as allow, R as denyAll, S as createDynamicPermissionMatrix, T as requireOrgMembership, U as requireRoles, V as requireOwnership, W as roles, _ as requireGrant, a as adminOnly, b as describePermissionMap, c as ownerWithAdminBypass, d as publicRead, f as publicReadAdminWrite, g as modeSatisfies, h as GRANT_MODES, i as introspectRegistry, j as requireDPoP, k as requireTeamMembership, l as permissionMatrix, m as createRoleHierarchy, n as introspectCheck, o as authenticated, p as readOnly, r as introspectModule, s as fullPublic, t as buildPermissionMatrix, u as presets_exports, v as collectPublicSurface, w as requireOrgInScope, x as explainAccess, y as describePermission, z as not } from "../permissions-R9T2G1PH.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { t as conjoinPolicyFilters } from "../filter-merge-Bvjk_8dV.mjs";
3
+ import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-D4m_pLSC.mjs";
4
+ import { a as resolveEffectiveRoles, i as fields, n as applyFieldWritePermissions, t as applyFieldReadPermissions } from "../fields-DLFcJiDe.mjs";
5
+ import { i as normalizeToDecision, r as evaluatePermissionDecision, t as applyAuthorizationDecision } from "../authorizationDecision-BD8K4jdQ.mjs";
6
+ import { i as resolveResourceRateLimiter, t as createMemoryResourceRateLimiter } from "../resourceRateLimit-KKn-sFhb.mjs";
7
+ import { A as requireAgentScope, B as requireAuth, C as createOrgPermissions, D as requireScopeContext, E as requireOrgRole, F as allowPublic, G as when, H as requirePlatformRole, I as anyOf, K as scopeOf, L as deny, M as requireMandate, N as allOf, O as requireServiceScope, P as allow, R as denyAll, S as createDynamicPermissionMatrix, T as requireOrgMembership, U as requireRoles, V as requireOwnership, W as roles, _ as requireGrant, a as adminOnly, b as describePermissionMap, c as ownerWithAdminBypass, d as publicRead, f as publicReadAdminWrite, g as modeSatisfies, h as GRANT_MODES, i as introspectRegistry, j as requireDPoP, k as requireTeamMembership, l as permissionMatrix, m as createRoleHierarchy, n as introspectCheck, o as authenticated, p as readOnly, r as introspectModule, s as fullPublic, t as buildPermissionMatrix, u as presets_exports, v as collectPublicSurface, w as requireOrgInScope, x as explainAccess, y as describePermission, z as not } from "../permissions-BJylQopQ.mjs";
8
8
  export { GRANT_MODES, adminOnly, allOf, allow, allowPublic, anyOf, applyAuthorizationDecision, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, buildPermissionMatrix, collectPublicSurface, conjoinPolicyFilters, createDynamicPermissionMatrix, createMemoryResourceRateLimiter, createOrgPermissions, createRoleHierarchy, deny, denyAll, describePermission, describePermissionMap, evaluatePermissionDecision, explainAccess, fields, fullPublic, getUserRoles, introspectCheck, introspectModule, introspectRegistry, modeSatisfies, normalizeRoles, normalizeToDecision, not, ownerWithAdminBypass, permissionMatrix, presets_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAgentScope, requireAuth, requireDPoP, requireGrant, requireMandate, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requirePlatformRole, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, resolveEffectiveRoles, resolveResourceRateLimiter, roles, scopeOf, when };
@@ -1,12 +1,12 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-BdTN42uL.mjs";
3
- import { t as arcLog } from "./logger-VyMcSmVG.mjs";
4
- import { t as conjoinPolicyFilters } from "./filter-merge-8glLr7Dk.mjs";
5
- import { n as getUserRoles } from "./userHelpers-N-k-8dNF.mjs";
6
- import { C as isService, S as isOrgInScope, a as getDPoPJkt, b as isElevated, d as getScopeContext, f as getScopeContextMap, g as getUserId, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, u as getRequestScope, v as hasOrgAccess, x as isMember } from "./types-HFFSwF_K.mjs";
7
- import { i as normalizeToDecision } from "./authorizationDecision-BZSJcPNE.mjs";
8
- import { n as declareRuntimeCapability } from "./runtimeCapabilities-ClWr60El.mjs";
9
- import { t as MemoryCacheStore } from "./memory-Lpfu8Hga.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-Ck1Tj4Ax.mjs";
3
+ import { C as isService, S as isOrgInScope, a as getDPoPJkt, b as isElevated, d as getScopeContext, f as getScopeContextMap, g as getUserId, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, u as getRequestScope, v as hasOrgAccess, x as isMember } from "./types-BuV_cFqT.mjs";
4
+ import { i as normalizeToDecision } from "./authorizationDecision-BD8K4jdQ.mjs";
5
+ import { t as conjoinPolicyFilters } from "./filter-merge-Bvjk_8dV.mjs";
6
+ import { n as getUserRoles } from "./userHelpers-D4m_pLSC.mjs";
7
+ import { t as MemoryCacheStore } from "./memory-Bl7kv6TS.mjs";
8
+ import { t as arcLog } from "./logger-BagW7_YA.mjs";
9
+ import { n as declareRuntimeCapability } from "./runtimeCapabilities-D0A4kkrC.mjs";
10
10
  import { randomUUID } from "node:crypto";
11
11
  // src/permissions/context.ts
12
12
  /**
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { r as ForbiddenError } from "./errors-DyY48oRi.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { r as ForbiddenError } from "./errors-3xaK0i9n.mjs";
3
3
  // src/pipeline/pipe.ts
4
4
  /**
5
5
  * Compose pipeline steps into an ordered array.
@@ -1,5 +1,5 @@
1
1
 
2
- import { Vn as IControllerResponse, _t as PipelineConfig, bt as Transform, gt as OperationFilter, ht as NextFunction, mt as Interceptor, pt as Guard, vt as PipelineContext, yt as PipelineStep } from "../index-Cy2-QffW.mjs";
2
+ import { St as Transform, Un as IControllerResponse, _t as NextFunction, bt as PipelineContext, gt as Interceptor, ht as Guard, vt as OperationFilter, xt as PipelineStep, yt as PipelineConfig } from "../index-DLCcLUQT.mjs";
3
3
  interface GuardOptions {
4
4
  operations?: OperationFilter;
5
5
  handler: (ctx: PipelineContext) => boolean | Promise<boolean>;
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { n as pipe, t as executePipeline } from "../pipe-DzqbsZy-.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { n as pipe, t as executePipeline } from "../pipe-D1cq8hET.mjs";
3
3
  // src/pipeline/guard.ts
4
4
  /**
5
5
  * Create a named guard.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
2
  import { createEventRouter, matchEventPattern } from "@classytic/primitives/events";
3
3
  // src/factory/module/graph.ts
4
4
  /**