@classytic/arc 2.33.0 → 2.35.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 (184) hide show
  1. package/dist/{BaseController-CaQC5EXX.mjs → BaseController-C-pofd0v.mjs} +131 -16
  2. package/dist/{EventTransport-tq4CEB-q.mjs → EventTransport-BrPeGUil.mjs} +1 -1
  3. package/dist/{HookSystem-DqXkMXkB.mjs → HookSystem-LlPm3Anm.mjs} +6 -4
  4. package/dist/{ResourceRegistry-DoALUlOO.mjs → ResourceRegistry-yuD1Ra53.mjs} +2 -2
  5. package/dist/{pipeline-q69DZzgG.mjs → actionPermissions-LFuOra7W.mjs} +30 -7
  6. package/dist/audit/index.d.mts +2 -2
  7. package/dist/audit/index.mjs +2 -2
  8. package/dist/auth/audit.mjs +1 -1
  9. package/dist/auth/index.d.mts +2 -2
  10. package/dist/auth/index.mjs +6 -6
  11. package/dist/auth/redis-session.mjs +1 -1
  12. package/dist/{authorizationDecision-B3mP_QTy.mjs → authorizationDecision-DYXBBgtg.mjs} +6 -2
  13. package/dist/{base-Csjc2oF-.d.mts → base-GZU3LlzP.d.mts} +1 -1
  14. package/dist/{buildHandler-DLE9xX-V.mjs → buildHandler-Do9aMIvL.mjs} +4 -4
  15. package/dist/cache/index.mjs +4 -4
  16. package/dist/{caching-BcGmvnHh.mjs → caching-cN5X9VEL.mjs} +2 -2
  17. package/dist/cleanup/index.d.mts +2 -2
  18. package/dist/cleanup/index.mjs +4 -4
  19. package/dist/cli/commands/describe.d.mts +1 -1
  20. package/dist/cli/commands/describe.mjs +3 -3
  21. package/dist/cli/commands/docs.mjs +3 -3
  22. package/dist/cli/commands/doctor.mjs +1 -1
  23. package/dist/cli/commands/generate.mjs +2 -2
  24. package/dist/cli/commands/init.mjs +2 -2
  25. package/dist/cli/commands/introspect.mjs +2 -2
  26. package/dist/cli/index.mjs +3 -3
  27. package/dist/{constants-BxCoxmiN.mjs → constants-BhzLXCfN.mjs} +1 -1
  28. package/dist/context/index.d.mts +16 -1
  29. package/dist/context/index.mjs +64 -4
  30. package/dist/core/index.d.mts +3 -3
  31. package/dist/core/index.mjs +8 -8
  32. package/dist/{core-dxhcHhUD.mjs → core-DdEvmmkY.mjs} +3 -3
  33. package/dist/{createActionRouter-DVpoA0do.mjs → createActionRouter-EYWgd0ly.mjs} +27 -64
  34. package/dist/{createAggregationRouter-B_B48JZ-.mjs → createAggregationRouter-ByOK9Iev.mjs} +7 -7
  35. package/dist/defineAggregation-DoIijIFq.mjs +25 -0
  36. package/dist/{defineResource-DR9vsUYy.mjs → defineResource-BOrGeocE.mjs} +62 -66
  37. package/dist/discovery/index.mjs +1 -1
  38. package/dist/docs/index.d.mts +1 -1
  39. package/dist/docs/index.mjs +3 -3
  40. package/dist/{elevation-B0tlY8y1.mjs → elevation-tGIAldco.mjs} +4 -4
  41. package/dist/encryption/index.mjs +3 -3
  42. package/dist/{errorHandler-C7xBqHsI.mjs → errorHandler-BbQ1nQdk.mjs} +3 -3
  43. package/dist/{errors-Cd_yy7aW.mjs → errors-CLid6atr.mjs} +1 -1
  44. package/dist/{eventPlugin-DSNEZWfV.d.mts → eventPlugin-B47sfCJ8.d.mts} +1 -1
  45. package/dist/{eventPlugin-Dar8qRaj.mjs → eventPlugin-ClPn5kjn.mjs} +5 -5
  46. package/dist/events/index.d.mts +2 -2
  47. package/dist/events/index.mjs +5 -5
  48. package/dist/events/transports/redis-stream-entry.mjs +1 -1
  49. package/dist/events/transports/redis.mjs +1 -1
  50. package/dist/factory/index.d.mts +5 -5
  51. package/dist/factory/index.mjs +5 -6
  52. package/dist/{fastify-augmentation-DVsTAy6X.d.mts → fastify-augmentation-CMMTL3cj.d.mts} +3 -3
  53. package/dist/{fields-CojeUkS4.mjs → fields-UtpiJO5R.mjs} +1 -1
  54. package/dist/{generate-DiB0nHPR.mjs → generate-BoAVy3_b.mjs} +2 -2
  55. package/dist/{headers-CveNO9gR.mjs → headers-DODWf7aC.mjs} +2 -2
  56. package/dist/{health-CasG2A28.mjs → health-_Zs3R_Sb.mjs} +1 -1
  57. package/dist/hooks/index.d.mts +1 -1
  58. package/dist/hooks/index.mjs +2 -2
  59. package/dist/idempotency/index.mjs +23 -58
  60. package/dist/idempotency/redis.mjs +1 -1
  61. package/dist/{index-C5NnMEKF.d.mts → index-C50BUxKs.d.mts} +1 -1
  62. package/dist/{index-BcR2bFZQ.d.mts → index-C5K78SXo.d.mts} +33 -105
  63. package/dist/{index-ugr1tQlW.d.mts → index-CJCcbADG.d.mts} +1 -1
  64. package/dist/{index-B-DvUzsr.d.mts → index-K7auNNW0.d.mts} +2 -2
  65. package/dist/{index-Brin0ODU.d.mts → index-h-mTgMqy.d.mts} +21 -31
  66. package/dist/index.d.mts +6 -6
  67. package/dist/index.mjs +12 -12
  68. package/dist/{init-mdJ-v4Xp.mjs → init-Ce4R0ZGK.mjs} +1 -1
  69. package/dist/integrations/event-gateway.mjs +2 -2
  70. package/dist/integrations/index.d.mts +2 -2
  71. package/dist/integrations/index.mjs +1 -1
  72. package/dist/integrations/jobs/index.d.mts +1 -1
  73. package/dist/integrations/jobs/index.mjs +2 -2
  74. package/dist/integrations/mcp/index.d.mts +4 -4
  75. package/dist/integrations/mcp/index.mjs +2 -2
  76. package/dist/integrations/mcp/testing.d.mts +1 -1
  77. package/dist/integrations/mcp/testing.mjs +3 -3
  78. package/dist/integrations/streamline.mjs +3 -3
  79. package/dist/integrations/webhooks.d.mts +1 -1
  80. package/dist/integrations/webhooks.mjs +11 -24
  81. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  82. package/dist/integrations/websocket-redis.mjs +1 -1
  83. package/dist/integrations/websocket.mjs +1 -1
  84. package/dist/{interface-DznJrm9R.mjs → interface-my7sxjw5.mjs} +1 -1
  85. package/dist/{jsonBody-CfGH-GxO.mjs → jsonBody-CVKA7C5m.mjs} +2 -2
  86. package/dist/{keys-WeKvY1dE.mjs → keys-GlU7XpmG.mjs} +1 -1
  87. package/dist/{loadResources-Bj-aSsXi.mjs → loadResources-DdQb0qgV.mjs} +2 -2
  88. package/dist/{loadResourcesFromEntry-DwaxNcE2.mjs → loadResourcesFromEntry-s6aGs6-0.mjs} +2 -2
  89. package/dist/logger/index.d.mts +23 -4
  90. package/dist/logger/index.mjs +50 -7
  91. package/dist/{mcpPlugin-aJg5TqHi.mjs → mcpPlugin-DkzZ7Nfx.mjs} +15 -16
  92. package/dist/{memory-qYSB7rMQ.mjs → memory-BwedEXau.mjs} +2 -2
  93. package/dist/{metrics-D7uchLjN.mjs → metrics-5LNPvL3P.mjs} +2 -2
  94. package/dist/middleware/index.d.mts +1 -1
  95. package/dist/middleware/index.mjs +3 -3
  96. package/dist/migrations/index.mjs +7 -4
  97. package/dist/{module-CwKsgZXp.mjs → module-Bh5OC7ww.mjs} +1 -1
  98. package/dist/{multipartBody-4w-S3-PU.mjs → multipartBody-DjilSDAT.mjs} +1 -1
  99. package/dist/{openapi-BN5cQaO2.mjs → openapi-ItLH12_L.mjs} +6 -6
  100. package/dist/outbox-admin/index.d.mts +2 -2
  101. package/dist/outbox-admin/index.mjs +4 -4
  102. package/dist/{outbox-module-CXB79bvt.mjs → outbox-module-SGIZz6oS.mjs} +14 -5
  103. package/dist/{outbox-module-D-VFq37T.d.mts → outbox-module-b1TyDGGi.d.mts} +40 -3
  104. package/dist/permissions/index.d.mts +2 -2
  105. package/dist/permissions/index.mjs +5 -5
  106. package/dist/{permissions-BAfwgBxc.mjs → permissions-CpSBlFXZ.mjs} +6 -6
  107. package/dist/{pipe-BzzoEhHj.mjs → pipe-DNOuCfAs.mjs} +2 -2
  108. package/dist/pipeline/index.d.mts +1 -1
  109. package/dist/pipeline/index.mjs +2 -2
  110. package/dist/plugins/index.d.mts +92 -7
  111. package/dist/plugins/index.mjs +168 -17
  112. package/dist/plugins/response-cache.mjs +2 -2
  113. package/dist/plugins/tracing-entry.mjs +2 -2
  114. package/dist/{pluralize-B7xf8qZF.mjs → pluralize-DGAQQKL8.mjs} +1 -1
  115. package/dist/{preloadResources-g07ldtzh.d.mts → preloadResources--ZtY9pe9.d.mts} +54 -270
  116. package/dist/{createApp-CLGegqiG.mjs → preloadResources-DYMzmUk1.mjs} +112 -31
  117. package/dist/presets/filesUpload.d.mts +3 -3
  118. package/dist/presets/filesUpload.mjs +5 -5
  119. package/dist/presets/index.d.mts +2 -2
  120. package/dist/presets/index.mjs +2 -2
  121. package/dist/presets/multiTenant.d.mts +1 -1
  122. package/dist/presets/multiTenant.mjs +3 -3
  123. package/dist/presets/search.d.mts +9 -47
  124. package/dist/presets/search.mjs +2 -2
  125. package/dist/{presets-D-h0uWtP.mjs → presets-Bi0Z6Iq8.mjs} +4 -4
  126. package/dist/{projection-BKM0Ui-s.mjs → projection-aevMua7Q.mjs} +2 -2
  127. package/dist/{queryCachePlugin-DhsZ0ZIc.mjs → queryCachePlugin-BI7Z88Cx.mjs} +5 -5
  128. package/dist/{rateLimitKey-XngqVNEV.mjs → rateLimitKey-pyevMUVf.mjs} +1 -1
  129. package/dist/{realtime-CTkv3O59.mjs → realtime-Cfl2bVjj.mjs} +9 -9
  130. package/dist/{rateLimit-D4-ASwsI.mjs → registerRoute-u1opU66a.mjs} +114 -3
  131. package/dist/registry/index.d.mts +2 -2
  132. package/dist/registry/index.mjs +3 -3
  133. package/dist/{registry-CLxCR5LF.mjs → registry-B4sf9Rfm.mjs} +15 -56
  134. package/dist/{renewingLease-BnWtbA2U.mjs → renewingLease-5ESPMxp0.mjs} +14 -2
  135. package/dist/{replyHelpers-BSBVCwL3.mjs → replyHelpers-2jfmMnnV.mjs} +2 -2
  136. package/dist/{requestContext-uYE35JxI.mjs → requestContext-DzOUGNdY.mjs} +1 -1
  137. package/dist/{rolldown-runtime-DNg-KNCk.mjs → rolldown-runtime-CEvvVXTC.mjs} +1 -1
  138. package/dist/{runtimeCapabilities-Dm88DaTW.mjs → runtimeCapabilities-BagWc3TI.mjs} +1 -1
  139. package/dist/{schedules-CAcZgia0.mjs → schedules-BLpZLWGF.mjs} +6 -4
  140. package/dist/{schemaConverter-XH1RZRyu.mjs → schemaConverter-D2_bHGil.mjs} +19 -32
  141. package/dist/{schemaIR-CDvclAew.mjs → schemaIR-s3-ouZmP.mjs} +2 -2
  142. package/dist/schemas/index.mjs +1 -1
  143. package/dist/scim/index.mjs +2 -2
  144. package/dist/scope/index.d.mts +1 -1
  145. package/dist/scope/index.mjs +5 -5
  146. package/dist/{scope-BaWcqBvr.mjs → scope-DgepeCv6.mjs} +4 -4
  147. package/dist/simpleEqualityMatcher-BO-sFTQf.mjs +43 -0
  148. package/dist/{sse-Cf0jUHsh.mjs → sse-DUIP1XH6.mjs} +5 -5
  149. package/dist/{sseStream-Bvpi-UXQ.mjs → sseStream-ByFGyIVr.mjs} +2 -2
  150. package/dist/{store-helpers-B88p99Z2.mjs → store-helpers-kIJCY0wI.mjs} +1 -1
  151. package/dist/{streaming-DsT1B5zJ.mjs → streaming-DOpZVht6.mjs} +1 -1
  152. package/dist/{subscribe-helpers-CLIOHsOK.mjs → subscribe-helpers-Dh2BnzJf.mjs} +12 -46
  153. package/dist/sync/changelog.mjs +1 -1
  154. package/dist/testing/cleanupStoreContract.mjs +1 -1
  155. package/dist/testing/index.d.mts +6 -6
  156. package/dist/testing/index.mjs +10 -11
  157. package/dist/testing/outboxStoreContract.mjs +1 -1
  158. package/dist/testing/storageContract.mjs +1 -1
  159. package/dist/{transactionContext-BYtWnwAS.mjs → transactionContext-BTZzEcRo.mjs} +1 -1
  160. package/dist/{typeGuards-jjKJDN13.mjs → typeGuards-B-_jqaMi.mjs} +1 -1
  161. package/dist/types/index.d.mts +3 -3
  162. package/dist/types/index.mjs +1 -1
  163. package/dist/types/storage.mjs +1 -1
  164. package/dist/{types-BcTumAz_.d.mts → types-DDD5RKTu.d.mts} +30 -87
  165. package/dist/{types-BfC83KsP.d.mts → types-DSvHH0uR.d.mts} +1 -1
  166. package/dist/{types-ChuShpCP.d.mts → types-Ddl9OjmE.d.mts} +18 -121
  167. package/dist/{types-CoqIRrkY.mjs → types-GY4kATJb.mjs} +10 -53
  168. package/dist/usage/index.d.mts +2 -2
  169. package/dist/usage/index.mjs +0 -0
  170. package/dist/{userHelpers-CWF5pbZD.mjs → userHelpers-AKcB4V03.mjs} +1 -1
  171. package/dist/utils/index.d.mts +16 -42
  172. package/dist/utils/index.mjs +11 -11
  173. package/dist/{utils-h1V_sT-t.mjs → utils-CBK9HQOI.mjs} +3 -3
  174. package/dist/{validate-CdQlz52F.mjs → validate-dosAIvQU.mjs} +2 -2
  175. package/dist/{versioning-rZbyLVD-.mjs → versioning-BbTs4pwM.mjs} +3 -3
  176. package/package.json +8 -8
  177. package/skills/arc/SKILL.md +9 -9
  178. package/skills/arc/references/api-reference.md +1 -1
  179. package/dist/actionPermissions-CUeCmpUd.mjs +0 -25
  180. package/dist/defineAggregation-Nv-DwfOf.mjs +0 -48
  181. package/dist/preloadResources-BkyqeTDz.mjs +0 -46
  182. package/dist/registerRoute-DNnd3vkz.mjs +0 -113
  183. package/dist/repositoryFilter-DKny7PDn.mjs +0 -45
  184. package/dist/simpleEqualityMatcher-Se8VrsaP.mjs +0 -69
@@ -1,5 +1,5 @@
1
1
 
2
- import { c as McpAuthResult, u as McpPluginOptions } from "../../types-BfC83KsP.mjs";
2
+ import { c as McpAuthResult, u as McpPluginOptions } from "../../types-DSvHH0uR.mjs";
3
3
  //#region src/integrations/mcp/testing.d.ts
4
4
  interface TestMcpClientOptions {
5
5
  /** MCP plugin options (resources, overrides, etc.) — same as mcpPlugin config */
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { m as createMcpServer, r as resourceToTools, t as filterResourcesForMcp } from "../../mcpPlugin-aJg5TqHi.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { m as createMcpServer, r as resourceToTools, t as filterResourcesForMcp } from "../../mcpPlugin-DkzZ7Nfx.mjs";
3
3
  //#region src/integrations/mcp/testing.ts
4
4
  /**
5
5
  * @classytic/arc/mcp/testing — MCP Test Utilities
@@ -50,7 +50,7 @@ async function createTestMcpClient(options = {}) {
50
50
  resources: [],
51
51
  ...options.pluginOptions
52
52
  };
53
- const auth = options.auth ?? { userId: "test-user" };
53
+ const auth = options.auth === void 0 ? { userId: "test-user" } : options.auth;
54
54
  const serverName = options.serverName ?? "test-mcp";
55
55
  const overrides = pluginOpts.overrides ?? {};
56
56
  const tools = filterResourcesForMcp(pluginOpts.resources ?? [], {
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { f as createError, i as NotFoundError, r as ForbiddenError } from "../errors-Cd_yy7aW.mjs";
3
- import { a as promoteStreamTokenToHeader, n as forwardedStreamHeaders } from "../streaming-DsT1B5zJ.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { f as createError, i as NotFoundError, r as ForbiddenError } from "../errors-CLid6atr.mjs";
3
+ import { a as promoteStreamTokenToHeader, n as forwardedStreamHeaders } from "../streaming-DOpZVht6.mjs";
4
4
  import fp from "fastify-plugin";
5
5
  //#region src/integrations/streamline.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { a as EventTransport, n as DomainEvent } from "../EventTransport-BEVP50ka.mjs";
3
- import { n as OutboxModuleOptions, r as createOutboxModule } from "../outbox-module-D-VFq37T.mjs";
3
+ import { n as OutboxModuleOptions, r as createOutboxModule } from "../outbox-module-b1TyDGGi.mjs";
4
4
  import { FastifyPluginAsync } from "fastify";
5
5
  import { OutboxFailurePolicy, OutboxStore } from "@classytic/primitives/outbox";
6
6
  //#region src/integrations/webhooks.d.ts
@@ -1,37 +1,24 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-Dm88DaTW.mjs";
3
- import { i as exponentialBackoff, t as createOutboxModule } from "../outbox-module-CXB79bvt.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-BagWc3TI.mjs";
3
+ import { i as exponentialBackoff, t as createOutboxModule } from "../outbox-module-SGIZz6oS.mjs";
4
4
  import { createHmac, timingSafeEqual } from "node:crypto";
5
5
  import fp from "fastify-plugin";
6
6
  import { createChildEvent } from "@classytic/primitives/events";
7
7
  //#region src/integrations/webhooks.ts
8
8
  /**
9
- * @classytic/arc — Webhook Outbound Integration
9
+ * Outbound webhooks — auto-dispatch arc events to registered endpoints with
10
+ * HMAC-SHA256 signing, delivery logging, and a pluggable `WebhookStore`.
10
11
  *
11
- * Fastify plugin that auto-dispatches Arc events to registered webhook
12
- * endpoints with HMAC-SHA256 signing, delivery logging, and pluggable
13
- * persistence via WebhookStore.
14
- *
15
- * This is a SEPARATE subpath import — only loaded when explicitly used:
16
- * import { webhookPlugin } from '@classytic/arc/integrations/webhooks';
12
+ * A separate subpath, loaded only when used:
13
+ * `@classytic/arc/integrations/webhooks`. For at-least-once delivery use
14
+ * `durable: { store }` / `createDurableWebhookModule` — the in-process retry
15
+ * is explicitly best-effort.
17
16
  *
18
17
  * @example
19
18
  * ```typescript
20
- * import { webhookPlugin } from '@classytic/arc/integrations/webhooks';
21
- *
22
19
  * await fastify.register(webhookPlugin);
23
- *
24
- * // Register a customer webhook
25
- * app.webhooks.register({
26
- * id: 'wh-1',
27
- * url: 'https://customer.com/webhook',
28
- * events: ['order.created', 'order.shipped'],
29
- * secret: 'whsec_abc123',
30
- * });
31
- *
32
- * // Events auto-dispatch — no manual wiring needed
33
- * await app.events.publish('order.created', { orderId: '123' });
34
- * // → POST https://customer.com/webhook with HMAC signature
20
+ * app.webhooks.register({ id: 'wh-1', url, events: ['order.created'], secret });
21
+ * await app.events.publish('order.created', { orderId: '123' }); // → signed POST
35
22
  * ```
36
23
  */
37
24
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
2
  //#region src/integrations/websocket-pushref-redis.ts
3
3
  /**
4
4
  * Lua script for atomic claim. Runs server-side, single-roundtrip.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
2
  //#region src/integrations/websocket-redis.ts
3
3
  /**
4
4
  * Redis Pub/Sub adapter for cross-instance WebSocket broadcast.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
2
  import { randomUUID } from "node:crypto";
3
3
  import sjson from "secure-json-parse";
4
4
  import fp from "fastify-plugin";
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
2
  //#region src/idempotency/stores/interface.ts
3
3
  /**
4
4
  * Helper to create a result object
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { t as ArcError } from "./errors-Cd_yy7aW.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { t as ArcError } from "./errors-CLid6atr.mjs";
3
3
  import sjson from "secure-json-parse";
4
4
  //#region src/utils/jsonBody.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
2
  //#region src/cache/keys.ts
3
3
  /**
4
4
  * Cache Key Utilities
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DNg-KNCk.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
4
  import { readdir } from "node:fs/promises";
5
5
  import { dirname, join, resolve } from "node:path";
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { t as ResourceRegistry } from "./ResourceRegistry-DoALUlOO.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { t as ResourceRegistry } from "./ResourceRegistry-yuD1Ra53.mjs";
3
3
  import { resolve } from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
5
  //#region src/cli/utils/loadResourcesFromEntry.ts
@@ -54,10 +54,29 @@ interface ArcLogger {
54
54
  error: (...args: unknown[]) => void;
55
55
  }
56
56
  /**
57
- * Configure the Arc logger globally.
57
+ * Run `fn` with `options` as the active logger config.
58
58
  *
59
- * Called automatically by `createApp({ debug })`, but can also be
60
- * called manually for standalone usage outside of `createApp`.
59
+ * `options` is held BY REFERENCE deliberately: `createApp` enters the scope
60
+ * before Fastify exists, then fills in the pino writer once `fastify.log` is
61
+ * constructed. Copying here would freeze the pre-Fastify view and send every
62
+ * post-construction boot warning to the console instead of the app's logger.
63
+ */
64
+ declare function runWithArcLogger<T>(options: ArcLoggerOptions, fn: () => T): T;
65
+ /**
66
+ * Enter `options` for the remainder of the current async context.
67
+ *
68
+ * For Fastify's `onRequest` hook, where `run(store, done)` wraps the rest of
69
+ * the request lifecycle. Outside a hook, prefer {@link runWithArcLogger}.
70
+ */
71
+ declare function enterArcLoggerScope(options: ArcLoggerOptions, done: () => void): void;
72
+ /**
73
+ * Configure the PROCESS-GLOBAL Arc logger — the fallback used outside any app.
74
+ *
75
+ * `createApp` no longer routes its writer through here; each app carries its
76
+ * own scoped options (see {@link runWithArcLogger}) so two apps in one process
77
+ * cannot overwrite each other's. This remains the way to configure arcLog for
78
+ * standalone use — `defineResource()` at module import, CLI commands, and any
79
+ * code running before or outside a `createApp` boot.
61
80
  */
62
81
  declare function configureArcLogger(options: ArcLoggerOptions): void;
63
82
  /**
@@ -104,4 +123,4 @@ interface PinoLike {
104
123
  */
105
124
  declare function createPinoWriter(logger: PinoLike): ArcLogWriter;
106
125
  //#endregion
107
- export { ArcLogWriter, ArcLogger, ArcLoggerOptions, PinoLike, arcLog, configureArcLogger, createPinoWriter };
126
+ export { ArcLogWriter, ArcLogger, ArcLoggerOptions, PinoLike, arcLog, configureArcLogger, createPinoWriter, enterArcLoggerScope, runWithArcLogger };
@@ -1,11 +1,54 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { AsyncLocalStorage } from "node:async_hooks";
2
3
  //#region src/logger/index.ts
4
+ /**
5
+ * Per-app logger options, resolved from the async context.
6
+ *
7
+ * The process-global below is a FALLBACK, not the source of truth. It used to
8
+ * be both, and `configureArcLogger` overwrote it on every boot — so the
9
+ * last-created app owned the writer for every app in the process. One app's
10
+ * framework warnings then surfaced through another app's transports, level,
11
+ * and redaction config. Fine for one-app-per-process; wrong for multi-app test
12
+ * files and for serverless containers that reuse a warm process across apps.
13
+ *
14
+ * Follows the same shape as `requestContext`: the scope is entered once and
15
+ * wraps everything downstream, so the 23 `arcLog()` call sites keep their
16
+ * zero-argument signature and resolve correctly without threading a logger.
17
+ */
18
+ const scope = new AsyncLocalStorage();
3
19
  let globalOptions = {};
20
+ /** Active options: the app's if we're inside one, else the process fallback. */
21
+ function resolveOptions() {
22
+ return scope.getStore() ?? globalOptions;
23
+ }
24
+ /**
25
+ * Run `fn` with `options` as the active logger config.
26
+ *
27
+ * `options` is held BY REFERENCE deliberately: `createApp` enters the scope
28
+ * before Fastify exists, then fills in the pino writer once `fastify.log` is
29
+ * constructed. Copying here would freeze the pre-Fastify view and send every
30
+ * post-construction boot warning to the console instead of the app's logger.
31
+ */
32
+ function runWithArcLogger(options, fn) {
33
+ return scope.run(options, fn);
34
+ }
35
+ /**
36
+ * Enter `options` for the remainder of the current async context.
37
+ *
38
+ * For Fastify's `onRequest` hook, where `run(store, done)` wraps the rest of
39
+ * the request lifecycle. Outside a hook, prefer {@link runWithArcLogger}.
40
+ */
41
+ function enterArcLoggerScope(options, done) {
42
+ scope.run(options, done);
43
+ }
4
44
  /**
5
- * Configure the Arc logger globally.
45
+ * Configure the PROCESS-GLOBAL Arc logger — the fallback used outside any app.
6
46
  *
7
- * Called automatically by `createApp({ debug })`, but can also be
8
- * called manually for standalone usage outside of `createApp`.
47
+ * `createApp` no longer routes its writer through here; each app carries its
48
+ * own scoped options (see {@link runWithArcLogger}) so two apps in one process
49
+ * cannot overwrite each other's. This remains the way to configure arcLog for
50
+ * standalone use — `defineResource()` at module import, CLI commands, and any
51
+ * code running before or outside a `createApp` boot.
9
52
  */
10
53
  function configureArcLogger(options) {
11
54
  globalOptions = { ...options };
@@ -84,10 +127,10 @@ function createPinoWriter(logger) {
84
127
  };
85
128
  }
86
129
  function getWriter() {
87
- return globalOptions.writer ?? console;
130
+ return resolveOptions().writer ?? console;
88
131
  }
89
132
  function isDebugEnabled(module) {
90
- const configDebug = globalOptions.debug;
133
+ const configDebug = resolveOptions().debug;
91
134
  if (configDebug !== void 0 && configDebug !== false) return matchesModule(configDebug, module);
92
135
  const envDebug = typeof process !== "undefined" ? process.env?.ARC_DEBUG : void 0;
93
136
  if (envDebug) return matchesModule(envDebug, module);
@@ -107,4 +150,4 @@ function isSuppressed() {
107
150
  return env === "1" || env === "true";
108
151
  }
109
152
  //#endregion
110
- export { arcLog, configureArcLogger, createPinoWriter };
153
+ export { arcLog, configureArcLogger, createPinoWriter, enterArcLoggerScope, runWithArcLogger };
@@ -1,19 +1,18 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { r as evaluatePermissionDecision } from "./authorizationDecision-B3mP_QTy.mjs";
3
- import { p as isArcError, t as ArcError } from "./errors-Cd_yy7aW.mjs";
4
- import { n as requireSingleHeaderValue } from "./headers-CveNO9gR.mjs";
5
- import { b as isElevated, c as getOrgId, g as getUserId, x as isMember } from "./types-CoqIRrkY.mjs";
6
- import { t as BaseController } from "./BaseController-CaQC5EXX.mjs";
7
- import { i as resolveEffectiveRoles, t as applyFieldReadPermissions } from "./fields-CojeUkS4.mjs";
8
- import { t as executePipeline } from "./pipe-BzzoEhHj.mjs";
9
- import { t as buildRequestScopeProjection } from "./projection-BKM0Ui-s.mjs";
10
- import { r as resolvePipelineSteps } from "./pipeline-q69DZzgG.mjs";
11
- import { n as validateAggregations } from "./validate-CdQlz52F.mjs";
12
- import { n as executeAggregation } from "./buildHandler-DLE9xX-V.mjs";
13
- import { t as pluralize } from "./pluralize-B7xf8qZF.mjs";
14
- import { t as resolveActionPermission } from "./actionPermissions-CUeCmpUd.mjs";
15
- import { t as createIdempotencyResult } from "./interface-DznJrm9R.mjs";
16
- import { r as shouldRejectAdditionalProperties, t as normalizeSchemaIR } from "./schemaIR-CDvclAew.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { r as evaluatePermissionDecision } from "./authorizationDecision-DYXBBgtg.mjs";
3
+ import { p as isArcError, t as ArcError } from "./errors-CLid6atr.mjs";
4
+ import { n as requireSingleHeaderValue } from "./headers-DODWf7aC.mjs";
5
+ import { b as isElevated, c as getOrgId, g as getUserId, x as isMember } from "./types-GY4kATJb.mjs";
6
+ import { t as BaseController } from "./BaseController-C-pofd0v.mjs";
7
+ import { i as resolveEffectiveRoles, t as applyFieldReadPermissions } from "./fields-UtpiJO5R.mjs";
8
+ import { t as executePipeline } from "./pipe-DNOuCfAs.mjs";
9
+ import { t as buildRequestScopeProjection } from "./projection-aevMua7Q.mjs";
10
+ import { i as resolvePipelineSteps, t as resolveActionPermission } from "./actionPermissions-LFuOra7W.mjs";
11
+ import { n as validateAggregations } from "./validate-dosAIvQU.mjs";
12
+ import { n as executeAggregation } from "./buildHandler-Do9aMIvL.mjs";
13
+ import { t as pluralize } from "./pluralize-DGAQQKL8.mjs";
14
+ import { t as createIdempotencyResult } from "./interface-my7sxjw5.mjs";
15
+ import { r as shouldRejectAdditionalProperties, t as normalizeSchemaIR } from "./schemaIR-s3-ouZmP.mjs";
17
16
  import { isHttpError, toErrorContract } from "@classytic/repo-core/errors";
18
17
  import { createHash, randomUUID } from "node:crypto";
19
18
  import fp from "fastify-plugin";
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DNg-KNCk.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
3
3
  //#region src/cache/memory.ts
4
4
  var memory_exports = /* @__PURE__ */ __exportAll({ MemoryCacheStore: () => MemoryCacheStore });
5
5
  /**
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DNg-KNCk.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
3
3
  import fp from "fastify-plugin";
4
4
  //#region src/plugins/metrics.ts
5
5
  var metrics_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,5 @@
1
1
 
2
- import { I as MiddlewareHandler, L as RequestWithExtras, Q as MiddlewareConfig } from "../index-BcR2bFZQ.mjs";
2
+ import { I as MiddlewareHandler, L as RequestWithExtras, Q as MiddlewareConfig } from "../index-C5K78SXo.mjs";
3
3
  import { RouteHandlerMethod } from "fastify";
4
4
  //#region src/middleware/middleware.d.ts
5
5
  interface NamedMiddleware {
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "../constants-BxCoxmiN.mjs";
3
- import { t as multipartBody } from "../multipartBody-4w-S3-PU.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "../constants-BhzLXCfN.mjs";
3
+ import { t as multipartBody } from "../multipartBody-DjilSDAT.mjs";
4
4
  //#region src/middleware/middleware.ts
5
5
  /**
6
6
  * Named Middleware — Priority-based, conditional middleware execution.
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { t as startRenewingLease } from "../renewingLease-BnWtbA2U.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { t as startRenewingLease } from "../renewingLease-5ESPMxp0.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  //#region src/migrations/index.ts
5
5
  /**
@@ -160,12 +160,14 @@ var MigrationRunner = class {
160
160
  async withLock(fn) {
161
161
  const lock = this.lock;
162
162
  if (!lock) return fn(() => false);
163
- if (!await lock.tryAcquire(MIGRATION_LOCK_NAME, this.holderId, this.lockLeaseMs)) throw new Error(`MigrationRunner: another runner holds the migration lock — refusing to run concurrently. If a previous runner crashed, the lease expires on its own (leaseMs: ${this.lockLeaseMs}).`);
163
+ const fenced = await lock.tryAcquireFenced?.(MIGRATION_LOCK_NAME, this.holderId, this.lockLeaseMs);
164
+ if (!(fenced !== void 0 ? fenced !== null : await lock.tryAcquire(MIGRATION_LOCK_NAME, this.holderId, this.lockLeaseMs))) throw new Error(`MigrationRunner: another runner holds the migration lock — refusing to run concurrently. If a previous runner crashed, the lease expires on its own (leaseMs: ${this.lockLeaseMs}).`);
164
165
  const lease = startRenewingLease({
165
166
  lock,
166
167
  name: MIGRATION_LOCK_NAME,
167
168
  holderId: this.holderId,
168
169
  leaseMs: this.lockLeaseMs,
170
+ ...fenced ? { token: fenced.token } : {},
169
171
  onLost: () => this.log.error("MigrationRunner: lease renewal lost — another holder took the migration lock; no further migrations will start and this run will fail."),
170
172
  onError: (error) => this.log.error(`MigrationRunner: lease renewal errored (lease may lapse mid-run): ${error.message}`)
171
173
  });
@@ -230,7 +232,7 @@ var MigrationRunner = class {
230
232
  * Rollback last migration
231
233
  */
232
234
  async down(migrations) {
233
- await this.withLock(async () => {
235
+ await this.withLock(async (leaseLost) => {
234
236
  const applied = await this.store.getApplied();
235
237
  const last = applied[applied.length - 1];
236
238
  if (!last) {
@@ -239,6 +241,7 @@ var MigrationRunner = class {
239
241
  }
240
242
  const migration = migrations.find((m) => m.resource === last.resource && m.version === last.version);
241
243
  if (!migration) throw new Error(`Migration ${last.resource}:${last.version} not found in migration files`);
244
+ if (leaseLost()) throw new Error("MigrationRunner: refusing to roll back — lock ownership lost between acquiring the lease and starting the rollback.");
242
245
  this.log.info(`Rolling back ${migration.resource} v${migration.version}...`);
243
246
  await this.runMigration(migration, "down", true);
244
247
  this.log.info("Rollback completed");
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
2
  //#region src/factory/module/index.ts
3
3
  /**
4
4
  * Identity helper for authoring a typed module — mirrors `defineResource`.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
2
  import sjson from "secure-json-parse";
3
3
  //#region src/middleware/multipartBody.ts
4
4
  const DEFAULT_MAX_FILE_SIZE = 10485760;
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { n as getUserRoles } from "./userHelpers-CWF5pbZD.mjs";
3
- import { n as convertRouteSchema } from "./schemaConverter-XH1RZRyu.mjs";
4
- import { t as pluralize } from "./pluralize-B7xf8qZF.mjs";
5
- import { t as resolveActionPermission } from "./actionPermissions-CUeCmpUd.mjs";
6
- import { t as buildActionBodySchema } from "./createActionRouter-DVpoA0do.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { n as getUserRoles } from "./userHelpers-AKcB4V03.mjs";
3
+ import { n as convertRouteSchema } from "./schemaConverter-D2_bHGil.mjs";
4
+ import { t as resolveActionPermission } from "./actionPermissions-LFuOra7W.mjs";
5
+ import { t as pluralize } from "./pluralize-DGAQQKL8.mjs";
6
+ import { t as buildActionBodySchema } from "./createActionRouter-EYWgd0ly.mjs";
7
7
  import fp from "fastify-plugin";
8
8
  //#region src/docs/openapi/canonical-schemas.ts
9
9
  /**
@@ -1,6 +1,6 @@
1
1
 
2
- import { l as PermissionCheck } from "../base-Csjc2oF-.mjs";
3
- import { t as ArcModule } from "../types-BcTumAz_.mjs";
2
+ import { l as PermissionCheck } from "../base-GZU3LlzP.mjs";
3
+ import { t as ArcModule } from "../types-DDD5RKTu.mjs";
4
4
  import { OutboxStore } from "@classytic/primitives/outbox";
5
5
  //#region src/outbox-admin/module.d.ts
6
6
  /**
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { i as NotFoundError, u as ValidationError } from "../errors-Cd_yy7aW.mjs";
3
- import { t as defineResource } from "../defineResource-DR9vsUYy.mjs";
4
- import { n as getModuleExports, t as defineModule } from "../module-CwKsgZXp.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { i as NotFoundError, u as ValidationError } from "../errors-CLid6atr.mjs";
3
+ import { t as defineResource } from "../defineResource-BOrGeocE.mjs";
4
+ import { n as getModuleExports, t as defineModule } from "../module-Bh5OC7ww.mjs";
5
5
  //#region src/outbox-admin/module.ts
6
6
  /**
7
7
  * Strip the domain payload and the stack unless explicitly opted in.
@@ -1,6 +1,7 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { i as resolveEventTransport } from "./EventTransport-tq4CEB-q.mjs";
3
- import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "./store-helpers-B88p99Z2.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { t as transactionContext } from "./transactionContext-BTZzEcRo.mjs";
3
+ import { i as resolveEventTransport } from "./EventTransport-BrPeGUil.mjs";
4
+ import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "./store-helpers-kIJCY0wI.mjs";
4
5
  import { and, anyOf, eq, lte, ne, or } from "@classytic/repo-core/filter";
5
6
  import { randomBytes } from "node:crypto";
6
7
  import { InvalidOutboxEventError, OutboxOwnershipError } from "@classytic/primitives/outbox";
@@ -814,8 +815,16 @@ function createOutboxModule(options) {
814
815
  ...options.batchSize !== void 0 ? { batchSize: options.batchSize } : {},
815
816
  ...options.leaseMs !== void 0 ? { leaseMs: options.leaseMs } : {},
816
817
  consumerId: options.consumerId ?? mintConsumerId(name),
817
- ...options.onError !== void 0 ? { onError: options.onError } : {},
818
- ...options.failurePolicy !== void 0 ? { failurePolicy: options.failurePolicy } : {}
818
+ onError: options.onError ?? ((info) => {
819
+ fastify.log.error({
820
+ err: info.error,
821
+ kind: info.kind,
822
+ ...info.event?.meta.id !== void 0 ? { eventId: info.event.meta.id } : {},
823
+ ...info.event?.type !== void 0 ? { eventType: info.event.type } : {}
824
+ }, `outbox relay "${name}" failed`);
825
+ }),
826
+ ...options.failurePolicy !== void 0 ? { failurePolicy: options.failurePolicy } : {},
827
+ ...options.sessionProvider === false ? {} : { sessionProvider: options.sessionProvider ?? (() => transactionContext.get()) }
819
828
  })
820
829
  };
821
830
  return exports;
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { a as EventTransport, n as DomainEvent, t as DeadLetteredEvent } from "./EventTransport-BEVP50ka.mjs";
3
- import { t as ArcModule } from "./types-BcTumAz_.mjs";
3
+ import { t as ArcModule } from "./types-DDD5RKTu.mjs";
4
4
  import { FastifyInstance } from "fastify";
5
5
  import { MemoryOutboxStore } from "@classytic/primitives/memory-outbox";
6
6
  import { OutboxFailurePolicy, OutboxStore, OutboxWriteOptions } from "@classytic/primitives/outbox";
@@ -308,8 +308,22 @@ interface OutboxModuleOptions {
308
308
  * Called for every non-fatal relay problem — publish failures, ownership mismatches,
309
309
  * acknowledge failures.
310
310
  *
311
- * **Wire this.** Silence here is the failure mode that matters: the relay keeps ticking, rows
312
- * keep failing, and the only symptom is revenue that never posted.
311
+ * Omit to report through the Arc app's structured logger. Override for metrics, tracing, or
312
+ * external alerting. Silence here is the failure mode that matters: the relay keeps ticking,
313
+ * rows keep failing, and the only symptom is revenue that never posted.
314
+ *
315
+ * **Fires per EVENT, not per batch.** With the defaults (`batchSize: 100`,
316
+ * `relayEveryMs: 5000`) a transport outage emits up to 100 lines per tick —
317
+ * ~1,200/minute — and that is UNBOUNDED without a {@link
318
+ * OutboxModuleOptions.failurePolicy}: with no policy the row is failed with
319
+ * neither `retryAt` nor `deadLetter`, so it stays pending and is retried on
320
+ * every poll forever.
321
+ *
322
+ * Set a `failurePolicy` first — it bounds the retry loop and the logs
323
+ * together. Reach for a custom `onError` when you want a different SHAPE
324
+ * (aggregate per batch, sample, emit a metric); `() => {}` restores the
325
+ * pre-2.34 silence, which is a choice worth making explicitly rather than
326
+ * inheriting.
313
327
  */
314
328
  onError?: OutboxRelayErrorHandler;
315
329
  /**
@@ -322,6 +336,29 @@ interface OutboxModuleOptions {
322
336
  * shape is exponential backoff up to N attempts, then dead-letter.
323
337
  */
324
338
  failurePolicy?: OutboxFailurePolicy;
339
+ /**
340
+ * Unit-of-Work session provider. Defaults to `() => transactionContext.get()`.
341
+ *
342
+ * This is what makes the durable path the DEFAULT path rather than a
343
+ * discipline. `EventOutbox.store()` already auto-injects a session from this
344
+ * provider (explicit `options.session` still wins), and a `transactional:
345
+ * true` write now publishes its session on `transactionContext` — so with
346
+ * the default in place, `outbox.store(event)` inside a transactional write
347
+ * commits the event row atomically with the domain write. No threading the
348
+ * handle from the controller through every service layer to the call site.
349
+ *
350
+ * The default matters more than the capability: `auditPlugin` has defaulted
351
+ * its `sessionProvider` the same way since it shipped, while this module
352
+ * required every host to remember. A host that forgets does not get an
353
+ * error — it gets an event row written outside the transaction, which
354
+ * survives a rollback and reports something that never happened. That is
355
+ * precisely the guarantee an outbox exists to provide.
356
+ *
357
+ * Pass `false` (or `() => undefined`) to opt out — for a store whose
358
+ * writes must NOT join the caller's transaction (a separate connection,
359
+ * an external queue).
360
+ */
361
+ sessionProvider?: (() => unknown) | false;
325
362
  /**
326
363
  * Run one relay pass at boot. Default `true` — a process that restarts with a backlog should
327
364
  * drain it immediately rather than waiting a full interval, because that backlog is precisely
@@ -1,5 +1,5 @@
1
1
 
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-Csjc2oF-.mjs";
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-GZU3LlzP.mjs";
3
3
  import { a as applyFieldWritePermissions, i as applyFieldReadPermissions, n as FieldPermissionMap, o as fields, r as FieldPermissionType, s as resolveEffectiveRoles, t as FieldPermission } from "../fields-I_EeRWND.mjs";
4
- import { $ as requireAuth, A as RequireGrantOptions, B as ConnectEventsOptions, C as requireServiceScope, D as GRANT_MODES, E as createRoleHierarchy, F as PermissionRequirement, G as createOrgPermissions, H as DynamicPermissionMatrixConfig, I as collectPublicSurface, J as allowPublic, K as allOf, L as describePermission, M as requireGrant, N as conjoinPolicyFilters, O as GrantMode, P as AccessExplanation, Q as not, R as describePermissionMap, S as requireScopeContext, T as RoleHierarchy, U as PermissionEventBus, V as DynamicPermissionMatrix, W as createDynamicPermissionMatrix, X as deny, Y as anyOf, Z as denyAll, _ as publicReadAdminWrite, a as PermissionMatrixRegistry, at as scopeOf, b as requireOrgMembership, c as introspectModule, ct as evaluatePermissionDecision, d as authenticated, dt as RequireMandateOptions, et as requireOwnership, f as fullPublic, ft as requireAgentScope, g as publicRead, h as presets_d_exports, i as PermissionMatrixOptions, it as when, j as modeSatisfies, k as GrantResolution, l as introspectRegistry, lt as normalizeToDecision, m as permissionMatrix, mt as requireMandate, n as PermissionEntryType, nt as requireRoles, o as buildPermissionMatrix, ot as PermissionCheckReturn, p as ownerWithAdminBypass, pt as requireDPoP, q as allow, r as PermissionMatrix, rt as roles, s as introspectCheck, st as applyAuthorizationDecision, t as PermissionEntry, tt as requirePlatformRole, u as adminOnly, ut as RequireAgentScopeOptions, v as readOnly, w as requireTeamMembership, x as requireOrgRole, y as requireOrgInScope, z as explainAccess } from "../index-B-DvUzsr.mjs";
4
+ import { $ as requireAuth, A as RequireGrantOptions, B as ConnectEventsOptions, C as requireServiceScope, D as GRANT_MODES, E as createRoleHierarchy, F as PermissionRequirement, G as createOrgPermissions, H as DynamicPermissionMatrixConfig, I as collectPublicSurface, J as allowPublic, K as allOf, L as describePermission, M as requireGrant, N as conjoinPolicyFilters, O as GrantMode, P as AccessExplanation, Q as not, R as describePermissionMap, S as requireScopeContext, T as RoleHierarchy, U as PermissionEventBus, V as DynamicPermissionMatrix, W as createDynamicPermissionMatrix, X as deny, Y as anyOf, Z as denyAll, _ as publicReadAdminWrite, a as PermissionMatrixRegistry, at as scopeOf, b as requireOrgMembership, c as introspectModule, ct as evaluatePermissionDecision, d as authenticated, dt as RequireMandateOptions, et as requireOwnership, f as fullPublic, ft as requireAgentScope, g as publicRead, h as presets_d_exports, i as PermissionMatrixOptions, it as when, j as modeSatisfies, k as GrantResolution, l as introspectRegistry, lt as normalizeToDecision, m as permissionMatrix, mt as requireMandate, n as PermissionEntryType, nt as requireRoles, o as buildPermissionMatrix, ot as PermissionCheckReturn, p as ownerWithAdminBypass, pt as requireDPoP, q as allow, r as PermissionMatrix, rt as roles, s as introspectCheck, st as applyAuthorizationDecision, t as PermissionEntry, tt as requirePlatformRole, u as adminOnly, ut as RequireAgentScopeOptions, v as readOnly, w as requireTeamMembership, x as requireOrgRole, y as requireOrgInScope, z as explainAccess } from "../index-K7auNNW0.mjs";
5
5
  export { type AccessExplanation, type AuthorizationDecision, type ConnectEventsOptions, type DataPolicy, type DynamicPermissionMatrix, type DynamicPermissionMatrixConfig, type FieldPermission, type FieldPermissionMap, type FieldPermissionType, 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 PermissionRequirement, type RequireAgentScopeOptions, type RequireGrantOptions, type RequireMandateOptions, type RoleHierarchy, type UserBase, adminOnly, allOf, allow, allowPublic, anyOf, applyAuthorizationDecision, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, buildPermissionMatrix, collectPublicSurface, conjoinPolicyFilters, createDynamicPermissionMatrix, 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, roles, scopeOf, when };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { a as conjoinPolicyFilters, i as normalizeToDecision, r as evaluatePermissionDecision, t as applyAuthorizationDecision } from "../authorizationDecision-B3mP_QTy.mjs";
3
- import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-CWF5pbZD.mjs";
4
- import { i as resolveEffectiveRoles, n as applyFieldWritePermissions, r as fields, t as applyFieldReadPermissions } from "../fields-CojeUkS4.mjs";
5
- 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-BAfwgBxc.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { a as conjoinPolicyFilters, i as normalizeToDecision, r as evaluatePermissionDecision, t as applyAuthorizationDecision } from "../authorizationDecision-DYXBBgtg.mjs";
3
+ import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-AKcB4V03.mjs";
4
+ import { i as resolveEffectiveRoles, n as applyFieldWritePermissions, r as fields, t as applyFieldReadPermissions } from "../fields-UtpiJO5R.mjs";
5
+ 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-CpSBlFXZ.mjs";
6
6
  export { GRANT_MODES, adminOnly, allOf, allow, allowPublic, anyOf, applyAuthorizationDecision, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, buildPermissionMatrix, collectPublicSurface, conjoinPolicyFilters, createDynamicPermissionMatrix, 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, roles, scopeOf, when };
@@ -1,10 +1,10 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DNg-KNCk.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { a as conjoinPolicyFilters, i as normalizeToDecision } from "./authorizationDecision-B3mP_QTy.mjs";
5
- import { n as getUserRoles } from "./userHelpers-CWF5pbZD.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-CoqIRrkY.mjs";
7
- import { t as MemoryCacheStore } from "./memory-qYSB7rMQ.mjs";
4
+ import { a as conjoinPolicyFilters, i as normalizeToDecision } from "./authorizationDecision-DYXBBgtg.mjs";
5
+ import { n as getUserRoles } from "./userHelpers-AKcB4V03.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-GY4kATJb.mjs";
7
+ import { t as MemoryCacheStore } from "./memory-BwedEXau.mjs";
8
8
  import { randomUUID } from "node:crypto";
9
9
  //#region src/permissions/context.ts
10
10
  /**
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
2
- import { r as ForbiddenError } from "./errors-Cd_yy7aW.mjs";
1
+ /*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
2
+ import { r as ForbiddenError } from "./errors-CLid6atr.mjs";
3
3
  //#region src/pipeline/pipe.ts
4
4
  /**
5
5
  * Compose pipeline steps into an ordered array.