@classytic/arc 2.40.0 → 2.41.1

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 (187) hide show
  1. package/dist/{BaseController-BqJtbiUA.mjs → BaseController-CYEwjyjN.mjs} +20 -13
  2. package/dist/{EventTransport-BPOQsEer.d.mts → EventTransport-CbUKDzZZ.d.mts} +25 -0
  3. package/dist/{EventTransport-BUkTwY_x.mjs → EventTransport-DSqD_Xsg.mjs} +11 -2
  4. package/dist/{HookSystem-96nzZLmk.mjs → HookSystem-CMF94SEA.mjs} +2 -2
  5. package/dist/{ResourceRegistry-B9WnuG2Q.mjs → ResourceRegistry-MGpXoxHZ.mjs} +2 -2
  6. package/dist/{actionPermissions-4OGbe3Hf.mjs → actionPermissions-BoPGQ5-4.mjs} +7 -6
  7. package/dist/audit/index.d.mts +2 -2
  8. package/dist/audit/index.mjs +10 -3
  9. package/dist/auth/audit.mjs +1 -1
  10. package/dist/auth/index.d.mts +2 -2
  11. package/dist/auth/index.mjs +12 -6
  12. package/dist/auth/redis-session.mjs +1 -1
  13. package/dist/{authorizationDecision-D_LFvMlm.mjs → authorizationDecision-DawKGoXb.mjs} +2 -2
  14. package/dist/{base-C-NL2fTi.d.mts → base-CxrV1LmG.d.mts} +10 -0
  15. package/dist/{buildHandler-BG_CHXqQ.mjs → buildHandler-CvxKOc0m.mjs} +4 -4
  16. package/dist/cache/index.d.mts +4 -2
  17. package/dist/cache/index.mjs +4 -4
  18. package/dist/{caching-Bqcn3Brl.mjs → caching-DbCBxlgw.mjs} +2 -2
  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-BQ2FbhPB.mjs → constants-D5Ubn1fe.mjs} +1 -1
  30. package/dist/context/index.mjs +36 -11
  31. package/dist/core/index.d.mts +2 -2
  32. package/dist/core/index.mjs +7 -7
  33. package/dist/{core-CsZR037F.mjs → core-5lazhva9.mjs} +3 -3
  34. package/dist/{createActionRouter-BR93gCKg.mjs → createActionRouter-DNqoaK81.mjs} +7 -7
  35. package/dist/{createAggregationRouter-CF40Aw95.mjs → createAggregationRouter-BcbQJf10.mjs} +7 -7
  36. package/dist/{createMcpServer-BVTs2S5G.d.mts → createMcpServer-CbDWkZ1T.d.mts} +1 -1
  37. package/dist/{defineAggregation-BDA2Tw7v.mjs → defineAggregation-D_eJjm5A.mjs} +1 -1
  38. package/dist/{defineResource-DaIySrQr.mjs → defineResource-DxkMTjRn.mjs} +18 -18
  39. package/dist/discovery/index.mjs +1 -1
  40. package/dist/docs/index.d.mts +1 -1
  41. package/dist/docs/index.mjs +3 -3
  42. package/dist/{elevation-CZy6n50b.mjs → elevation-CkvG0LG2.mjs} +4 -4
  43. package/dist/encryption/index.mjs +3 -3
  44. package/dist/{errorHandler-By9keRvX.mjs → errorHandler-D1GHKGlV.mjs} +3 -3
  45. package/dist/{errors-BHD3L8of.mjs → errors-BH7YU_9O.mjs} +1 -1
  46. package/dist/{eventPlugin-DfHaKEWQ.d.mts → eventPlugin-B52abJ8W.d.mts} +1 -1
  47. package/dist/{eventPlugin-DB26V7uX.mjs → eventPlugin-zZY-unhr.mjs} +5 -5
  48. package/dist/events/index.d.mts +4 -4
  49. package/dist/events/index.mjs +5 -5
  50. package/dist/events/transports/redis-stream-entry.d.mts +1 -1
  51. package/dist/events/transports/redis-stream-entry.mjs +15 -6
  52. package/dist/events/transports/redis.d.mts +1 -1
  53. package/dist/events/transports/redis.mjs +2 -2
  54. package/dist/factory/index.d.mts +5 -5
  55. package/dist/factory/index.mjs +5 -5
  56. package/dist/{fastify-augmentation-HncZMmze.d.mts → fastify-augmentation-Cq2nHVaW.d.mts} +3 -3
  57. package/dist/{fields-fA-Dkou5.mjs → fields-BHrkoF5y.mjs} +1 -1
  58. package/dist/{generate-BSSdtiOy.mjs → generate-BLRf2m3y.mjs} +2 -2
  59. package/dist/{headers-BFEEshDS.mjs → headers-BIXWKrzQ.mjs} +2 -2
  60. package/dist/{health-BlGHjkqZ.mjs → health-ZRHeDHXH.mjs} +10 -2
  61. package/dist/hooks/index.d.mts +1 -1
  62. package/dist/hooks/index.mjs +2 -2
  63. package/dist/idempotency/index.d.mts +1 -1
  64. package/dist/idempotency/index.mjs +4 -4
  65. package/dist/idempotency/redis.d.mts +1 -1
  66. package/dist/idempotency/redis.mjs +1 -1
  67. package/dist/{index-BtYoMip1.d.mts → index-BHdZD8zK.d.mts} +10 -2
  68. package/dist/{index-DbMglURO.d.mts → index-CFfLKMH4.d.mts} +1 -1
  69. package/dist/{index-eyg5WEcy.d.mts → index-CbJiYrfv.d.mts} +1 -1
  70. package/dist/{index-SCsOJxWB.d.mts → index-D4u76eQW.d.mts} +3 -3
  71. package/dist/{index-D3sIPcD4.d.mts → index-DHbyPo5j.d.mts} +6 -2
  72. package/dist/index.d.mts +5 -5
  73. package/dist/index.mjs +11 -11
  74. package/dist/{init-pl88PHzb.mjs → init-CpLkjU18.mjs} +1 -1
  75. package/dist/integrations/event-gateway.d.mts +1 -1
  76. package/dist/integrations/event-gateway.mjs +2 -2
  77. package/dist/integrations/index.d.mts +2 -2
  78. package/dist/integrations/index.mjs +1 -1
  79. package/dist/integrations/jobs/index.d.mts +1 -1
  80. package/dist/integrations/jobs/index.mjs +2 -2
  81. package/dist/integrations/mcp/index.d.mts +4 -4
  82. package/dist/integrations/mcp/index.mjs +2 -2
  83. package/dist/integrations/mcp/testing.d.mts +2 -2
  84. package/dist/integrations/mcp/testing.mjs +2 -2
  85. package/dist/integrations/streamline.mjs +3 -3
  86. package/dist/integrations/webhooks.d.mts +2 -2
  87. package/dist/integrations/webhooks.mjs +3 -3
  88. package/dist/integrations/websocket-pushref-redis.d.mts +1 -1
  89. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  90. package/dist/integrations/websocket-redis.mjs +1 -1
  91. package/dist/integrations/websocket.mjs +12 -1
  92. package/dist/{interface-DjtFnZxH.mjs → interface-YzIbF7Ii.mjs} +1 -1
  93. package/dist/{jsonBody-Dx6jH_Nb.mjs → jsonBody-ELR9lfeU.mjs} +2 -2
  94. package/dist/{keys-Ds3ekBiu.mjs → keys-cpZCtcIE.mjs} +1 -1
  95. package/dist/{loadResources-E5UFlRrT.mjs → loadResources-BPfWiI5s.mjs} +2 -2
  96. package/dist/{loadResourcesFromEntry-C2jrJbWG.mjs → loadResourcesFromEntry-ixtfL3J2.mjs} +2 -2
  97. package/dist/logger/index.mjs +1 -1
  98. package/dist/{mcpPlugin-D-3OLxNz.mjs → mcpPlugin-BX5PujI0.mjs} +15 -15
  99. package/dist/{memory-CNvjxzB2.mjs → memory-Iotz0cCx.mjs} +2 -2
  100. package/dist/{metrics-P37sNV5H.mjs → metrics-NMsmpRmY.mjs} +2 -2
  101. package/dist/middleware/index.d.mts +1 -1
  102. package/dist/middleware/index.mjs +3 -3
  103. package/dist/migrations/index.mjs +2 -2
  104. package/dist/{module-CNcwCKUJ.mjs → module-DpLJG2_N.mjs} +1 -1
  105. package/dist/{multipartBody-Bl_gU3Wg.mjs → multipartBody-DtRWM6_U.mjs} +1 -1
  106. package/dist/{openapi-BYrL8zvY.mjs → openapi-CmFf3yq_.mjs} +6 -6
  107. package/dist/outbox-admin/index.d.mts +2 -2
  108. package/dist/outbox-admin/index.mjs +4 -4
  109. package/dist/{outbox-module-CzsKRBvO.d.mts → outbox-module-BHdUnuuK.d.mts} +6 -2
  110. package/dist/{outbox-module-6DMC_WNu.mjs → outbox-module-D2z5WkDY.mjs} +9 -6
  111. package/dist/permissions/index.d.mts +2 -2
  112. package/dist/permissions/index.mjs +5 -5
  113. package/dist/{permissions-C0GpDsB_.mjs → permissions-D8TBH44E.mjs} +12 -6
  114. package/dist/{pipe-4_XamfxI.mjs → pipe-FMWNheSO.mjs} +2 -2
  115. package/dist/pipeline/index.d.mts +1 -1
  116. package/dist/pipeline/index.mjs +2 -2
  117. package/dist/plugins/index.d.mts +6 -36
  118. package/dist/plugins/index.mjs +33 -22
  119. package/dist/plugins/response-cache.mjs +9 -2
  120. package/dist/plugins/tracing-entry.mjs +2 -2
  121. package/dist/{pluralize-BaQ62hOW.mjs → pluralize-CXWZIzTv.mjs} +1 -1
  122. package/dist/{preloadResources-DVgPCNcD.d.mts → preloadResources-CjS2OfpU.d.mts} +13 -8
  123. package/dist/{preloadResources-BAx5s9EF.mjs → preloadResources-f3boenVZ.mjs} +33 -26
  124. package/dist/presets/filesUpload.d.mts +2 -2
  125. package/dist/presets/filesUpload.mjs +5 -5
  126. package/dist/presets/index.d.mts +2 -2
  127. package/dist/presets/index.mjs +2 -2
  128. package/dist/presets/multiTenant.d.mts +38 -1
  129. package/dist/presets/multiTenant.mjs +24 -6
  130. package/dist/presets/search.d.mts +2 -2
  131. package/dist/presets/search.mjs +2 -2
  132. package/dist/{presets-CAaqVVcW.mjs → presets-ZJSPgmT2.mjs} +4 -4
  133. package/dist/{projection-qbCOEvsh.mjs → projection-BzIgzoKZ.mjs} +2 -2
  134. package/dist/{queryCachePlugin-2Pp9w-8D.mjs → queryCachePlugin-DZHPOm9p.mjs} +11 -5
  135. package/dist/{rateLimitKey-umrS6-vu.mjs → rateLimitKey-BvOvcBDi.mjs} +1 -1
  136. package/dist/{realtime-zzoNLDtj.mjs → realtime-8tIQWZz4.mjs} +9 -9
  137. package/dist/{redis-CduhKsJi.d.mts → redis-Bzi1y3F9.d.mts} +10 -2
  138. package/dist/{redis-stream-DSsPyYzd.d.mts → redis-stream-BPKscsTB.d.mts} +6 -6
  139. package/dist/{registerRoute-_6zHiz0x.mjs → registerRoute-Bsnk6NiZ.mjs} +6 -6
  140. package/dist/registry/index.d.mts +2 -2
  141. package/dist/registry/index.mjs +3 -3
  142. package/dist/{registry-CEpoRpLP.mjs → registry-DNkgGQcK.mjs} +2 -2
  143. package/dist/{renewingLease-B5Grm0pI.mjs → renewingLease-yF8BdW4b.mjs} +1 -1
  144. package/dist/{replyHelpers-9h-a592u.mjs → replyHelpers-CNdvMfM4.mjs} +2 -2
  145. package/dist/{requestContext-D4PuGhEw.mjs → requestContext-cDkAUr-P.mjs} +1 -1
  146. package/dist/{rolldown-runtime-DzE6ikSH.mjs → rolldown-runtime-eysyzFAF.mjs} +1 -1
  147. package/dist/{runtimeCapabilities-Bo7rSKjm.mjs → runtimeCapabilities-CkhS6jn6.mjs} +31 -5
  148. package/dist/{schedules-Dm21pqHU.mjs → schedules-j6uXXAeJ.mjs} +4 -4
  149. package/dist/{schemaConverter-DENbixyA.mjs → schemaConverter-BVA7cFRG.mjs} +1 -1
  150. package/dist/{schemaIR-C2qUNzC6.mjs → schemaIR-CTvPDoPB.mjs} +2 -2
  151. package/dist/schemas/index.mjs +1 -1
  152. package/dist/scim/index.mjs +2 -2
  153. package/dist/scope/index.mjs +5 -5
  154. package/dist/{scope-CdYxQVxt.mjs → scope-BUi1xV1I.mjs} +4 -4
  155. package/dist/{simpleEqualityMatcher-Cldubvul.mjs → simpleEqualityMatcher-C9bzq2gO.mjs} +1 -1
  156. package/dist/{sse-DbyXoQun.mjs → sse-BeqVKQKu.mjs} +5 -5
  157. package/dist/{sseStream-BfZtL5-m.mjs → sseStream-Ppzo-WUH.mjs} +2 -2
  158. package/dist/{store-helpers-BfyOd5i6.mjs → store-helpers-dW71XVWL.mjs} +1 -1
  159. package/dist/{streaming-CFwCzEvU.mjs → streaming-IcRFjWQU.mjs} +1 -1
  160. package/dist/{subscribe-helpers-KgVEcn8L.mjs → subscribe-helpers-DatDkcuG.mjs} +2 -2
  161. package/dist/sync/changelog.mjs +1 -1
  162. package/dist/testing/cleanupStoreContract.mjs +1 -1
  163. package/dist/testing/index.d.mts +5 -5
  164. package/dist/testing/index.mjs +10 -10
  165. package/dist/testing/outboxStoreContract.mjs +1 -1
  166. package/dist/testing/storageContract.mjs +1 -1
  167. package/dist/{transactionContext-46KyUADP.mjs → transactionContext-CPbdlnVw.mjs} +1 -1
  168. package/dist/{typeGuards-t_CVgRXN.mjs → typeGuards-BLjPgVBm.mjs} +1 -1
  169. package/dist/types/index.d.mts +2 -2
  170. package/dist/types/index.mjs +1 -1
  171. package/dist/types/storage.mjs +1 -1
  172. package/dist/{types-9rvxn5Ym.d.mts → types-CWQn9-IC.d.mts} +1 -1
  173. package/dist/{types-CNQyOrLk.mjs → types-CgenB1gv.mjs} +4 -4
  174. package/dist/{types-BVlowlm7.d.mts → types-DfVDvkdP.d.mts} +19 -1
  175. package/dist/usage/index.d.mts +58 -2
  176. package/dist/usage/index.mjs +55 -4
  177. package/dist/{userHelpers-DLueLQdQ.mjs → userHelpers-ChRvkuSZ.mjs} +1 -1
  178. package/dist/utils/index.d.mts +107 -5
  179. package/dist/utils/index.mjs +12 -12
  180. package/dist/{utils-CUFBrhq-.mjs → utils-CxcctrAh.mjs} +50 -9
  181. package/dist/{validate-DV3hRbsz.mjs → validate-DrYWnOzI.mjs} +2 -2
  182. package/dist/{versioning-P3V6ATyC.d.mts → versioning-D6JIK8Tk.d.mts} +58 -2
  183. package/dist/{versioning-BXwmj5SD.mjs → versioning-DKkT4hNJ.mjs} +3 -3
  184. package/dist/{workScope-CoGpuzDX.mjs → workScope-CxKqoIFn.mjs} +3 -4
  185. package/package.json +5 -5
  186. package/skills/arc/SKILL.md +8 -4
  187. package/skills/arc/references/production.md +94 -9
@@ -1,8 +1,9 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
3
- import { i as versionKey, r as tagVersionKey } from "./keys-Ds3ekBiu.mjs";
4
- import { t as hasEvents } from "./typeGuards-t_CVgRXN.mjs";
5
- import { t as MemoryCacheStore } from "./memory-CNvjxzB2.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-eysyzFAF.mjs";
3
+ import { i as versionKey, r as tagVersionKey } from "./keys-cpZCtcIE.mjs";
4
+ import { n as declareRuntimeCapability } from "./runtimeCapabilities-CkhS6jn6.mjs";
5
+ import { t as hasEvents } from "./typeGuards-BLjPgVBm.mjs";
6
+ import { t as MemoryCacheStore } from "./memory-Iotz0cCx.mjs";
6
7
  import fp from "fastify-plugin";
7
8
  //#region src/cache/QueryCache.ts
8
9
  var QueryCache = class {
@@ -113,6 +114,11 @@ const queryCachePluginImpl = async (fastify, opts = {}) => {
113
114
  const ownsStore = opts.store === void 0;
114
115
  const store = opts.store ?? new MemoryCacheStore();
115
116
  const queryCache = new QueryCache(store);
117
+ declareRuntimeCapability(fastify, {
118
+ subsystem: "cache.query",
119
+ durability: store instanceof MemoryCacheStore ? "memory" : "shared",
120
+ detail: "MemoryCacheStore: entries and version bumps are replica-local"
121
+ });
116
122
  const defaults = {
117
123
  staleTime: opts.defaults?.staleTime ?? 0,
118
124
  gcTime: opts.defaults?.gcTime ?? 60
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  //#region src/scope/rateLimitKey.ts
3
3
  /**
4
4
  * Marks a key generator as SCOPE-AWARE, so `buildRateLimitOpts` can place the rate-limit
@@ -1,13 +1,13 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-eysyzFAF.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { n as evaluateAndApplyPermission } from "./authorizationDecision-D_LFvMlm.mjs";
5
- import { n as getUserRoles } from "./userHelpers-DLueLQdQ.mjs";
6
- import { c as getOrgId } from "./types-CNQyOrLk.mjs";
7
- import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-Cldubvul.mjs";
8
- import { t as applyFieldReadPermissions } from "./fields-fA-Dkou5.mjs";
9
- import { a as promoteStreamTokenToHeader } from "./streaming-CFwCzEvU.mjs";
10
- import { t as openSseStream } from "./sseStream-BfZtL5-m.mjs";
4
+ import { n as evaluateAndApplyPermission } from "./authorizationDecision-DawKGoXb.mjs";
5
+ import { n as getUserRoles } from "./userHelpers-ChRvkuSZ.mjs";
6
+ import { c as getOrgId } from "./types-CgenB1gv.mjs";
7
+ import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-C9bzq2gO.mjs";
8
+ import { t as applyFieldReadPermissions } from "./fields-BHrkoF5y.mjs";
9
+ import { a as promoteStreamTokenToHeader } from "./streaming-IcRFjWQU.mjs";
10
+ import { t as openSseStream } from "./sseStream-Ppzo-WUH.mjs";
11
11
  import fp from "fastify-plugin";
12
12
  //#region src/plugins/realtime.ts
13
13
  var realtime_exports = /* @__PURE__ */ __exportAll({
@@ -45,13 +45,21 @@ declare class RedisIdempotencyStore implements IdempotencyStore {
45
45
  private scanByPrefix;
46
46
  close(): Promise<void>;
47
47
  }
48
- /** Minimal ioredis shape we depend on — keeps this file peer-dep-free. */
48
+ /**
49
+ * Minimal ioredis shape we depend on — keeps this file peer-dep-free.
50
+ *
51
+ * Variadic tails are `unknown[]`, not `(string | number)[]`: ioredis types
52
+ * every command as overloads whose tails mix literal tokens (`'MATCH'`),
53
+ * `Buffer` and an optional callback, and a narrower tail matches NONE of
54
+ * them — a real `Redis` instance then fails to assign (TS2345). Pinned by
55
+ * `tests/types/ioredis-assignability.test.ts`.
56
+ */
49
57
  interface IoredisLike {
50
58
  get(key: string): Promise<string | null>;
51
59
  set(...args: unknown[]): Promise<string | null>;
52
60
  del(...keys: string[]): Promise<number>;
53
61
  exists(...keys: string[]): Promise<number>;
54
- scan(cursor: string | number, ...args: (string | number)[]): Promise<[string, string[]]>;
62
+ scan(cursor: string | number, ...args: unknown[]): Promise<[string, string[]]>;
55
63
  eval?(script: string, numKeys: number, ...args: (string | number)[]): Promise<unknown>;
56
64
  quit?(): Promise<string>;
57
65
  disconnect?(): void;
@@ -1,13 +1,13 @@
1
1
 
2
- import { a as EventTransport, i as EventLogger, n as DomainEvent, r as EventHandler } from "./EventTransport-BPOQsEer.mjs";
2
+ import { a as EventTransport, i as EventLogger, n as DomainEvent, r as EventHandler } from "./EventTransport-CbUKDzZZ.mjs";
3
3
  //#region src/events/transports/redis-stream.d.ts
4
4
  interface RedisStreamLike {
5
5
  xadd(key: string, id: string, ...fieldValues: string[]): Promise<string | null>;
6
- xreadgroup(command: "GROUP", group: string, consumer: string, ...args: (string | number)[]): Promise<Array<[string, Array<[string, string[]]>]> | null>;
7
- xack(key: string, group: string, ...ids: string[]): Promise<number>;
8
- xgroup(command: string, key: string, group: string, ...args: string[]): Promise<unknown>;
9
- xpending(key: string, group: string, ...args: (string | number)[]): Promise<Array<[string, string, number, number]>>;
10
- xclaim(key: string, group: string, consumer: string, minIdleTime: number, ...ids: string[]): Promise<Array<[string, string[]]>>;
6
+ xreadgroup(command: "GROUP", group: string, consumer: string, ...args: unknown[]): Promise<Array<[string, Array<[string, string[] | null]>]> | null>;
7
+ xack(key: string, group: string, ...ids: unknown[]): Promise<number>;
8
+ xgroup(command: string, key: string, group: string, ...args: unknown[]): Promise<unknown>;
9
+ xpending(key: string, group: string, ...args: unknown[]): Promise<unknown[]>;
10
+ xclaim(key: string, group: string, consumer: string, minIdleTime: number, ...ids: unknown[]): Promise<unknown[]>;
11
11
  xlen(key: string): Promise<number>;
12
12
  /**
13
13
  * Read a range of entries by id. When present, the DLQ writer uses this
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { n as evaluateAndApplyPermission } from "./authorizationDecision-D_LFvMlm.mjs";
3
- import { f as createError } from "./errors-BHD3L8of.mjs";
4
- import { u as getRequestScope } from "./types-CNQyOrLk.mjs";
5
- import { r as deriveHiddenFieldPermissions } from "./fields-fA-Dkou5.mjs";
6
- import { n as requestContext } from "./requestContext-D4PuGhEw.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { n as evaluateAndApplyPermission } from "./authorizationDecision-DawKGoXb.mjs";
3
+ import { f as createError } from "./errors-BH7YU_9O.mjs";
4
+ import { u as getRequestScope } from "./types-CgenB1gv.mjs";
5
+ import { r as deriveHiddenFieldPermissions } from "./fields-BHrkoF5y.mjs";
6
+ import { n as requestContext } from "./requestContext-cDkAUr-P.mjs";
7
7
  //#region src/core/middlewares/arcDecorator.ts
8
8
  /**
9
9
  * Build the `arcDecorator` preHandler for a resource.
@@ -1,6 +1,6 @@
1
1
 
2
- import { K as ResolvedTenantPurge, R as RegisterOptions, V as ResourceDefinition, X as CrudRouteKey, k as IntrospectionPluginOptions, p as RegistryEntry, z as ResourceRegistry } from "../index-D3sIPcD4.mjs";
3
- import "../fastify-augmentation-HncZMmze.mjs";
2
+ import { K as ResolvedTenantPurge, R as RegisterOptions, V as ResourceDefinition, X as CrudRouteKey, k as IntrospectionPluginOptions, p as RegistryEntry, z as ResourceRegistry } from "../index-DHbyPo5j.mjs";
3
+ import "../fastify-augmentation-Cq2nHVaW.mjs";
4
4
  import { TenantPurgeProgress, TenantPurgeStrategy } from "@classytic/repo-core/repository";
5
5
  import { FastifyPluginAsync } from "fastify";
6
6
  //#region src/registry/assertNoTenantData.d.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { a as cascadeDeleteForOrganization, c as assertNoTenantData, i as introspectionPlugin_default, n as buildResourceManifestFromRegistry, o as getCascadingResources, r as introspectionPlugin, s as getCascadingResourcesWithMetadata, t as buildResourceManifest } from "../registry-CEpoRpLP.mjs";
3
- import { t as ResourceRegistry } from "../ResourceRegistry-B9WnuG2Q.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { a as cascadeDeleteForOrganization, c as assertNoTenantData, i as introspectionPlugin_default, n as buildResourceManifestFromRegistry, o as getCascadingResources, r as introspectionPlugin, s as getCascadingResourcesWithMetadata, t as buildResourceManifest } from "../registry-DNkgGQcK.mjs";
3
+ import { t as ResourceRegistry } from "../ResourceRegistry-MGpXoxHZ.mjs";
4
4
  export { ResourceRegistry, assertNoTenantData, buildResourceManifest, buildResourceManifestFromRegistry, cascadeDeleteForOrganization, getCascadingResources, getCascadingResourcesWithMetadata, introspectionPlugin_default as introspectionPlugin, introspectionPlugin as introspectionPluginFn };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "./constants-BQ2FbhPB.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "./constants-D5Ubn1fe.mjs";
3
3
  import fp from "fastify-plugin";
4
4
  //#region src/registry/assertNoTenantData.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  //#region src/lock/renewingLease.ts
3
3
  /**
4
4
  * Start renewing an ALREADY-ACQUIRED lease. The caller performed the
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-eysyzFAF.mjs";
3
3
  import { toCanonicalList } from "@classytic/repo-core/pagination";
4
4
  import fp from "fastify-plugin";
5
5
  //#region src/plugins/replyHelpers.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  //#region src/context/requestContext.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import "node:module";
3
3
  //#region \0rolldown/runtime.js
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  //#region src/utils/runtimeCapabilities.ts
3
3
  /**
4
4
  * `Symbol.for` so declarations from two arc copies in one dependency graph
@@ -6,6 +6,29 @@
6
6
  * public `fastify.arc` surface; the audit result is the product, not the list.
7
7
  */
8
8
  const ARC_RUNTIME_CAPABILITIES = Symbol.for("arc.runtimeCapabilities");
9
+ /**
10
+ * Seed the registry on the ROOT instance. `createApp` calls this the moment the
11
+ * instance exists, before any registration — and that ordering is load-bearing,
12
+ * not tidiness.
13
+ *
14
+ * A Fastify child (`register` with an un-`fp`-wrapped plugin) is
15
+ * `Object.create(parent)`, so a symbol READ reaches the parent's array through
16
+ * the prototype chain but a symbol WRITE always lands on the child. Created
17
+ * lazily, the first declarant therefore decides where the registry lives: seeded
18
+ * first, every child pushes into the root's one array; declared first from
19
+ * inside an encapsulated child, that child gets an own array the root audit
20
+ * never sees — a silent pass from the mechanism whose entire job is to refuse to
21
+ * boot. Arc's own declarants are all `fp`-wrapped and both host `plugins()` and
22
+ * module `plugins()` receive the root, so nothing internal hit this; a host
23
+ * declaring from inside its own `fastify.register(async (child) => …)` would.
24
+ *
25
+ * Idempotent, and never clobbers an existing array — re-seeding an instance that
26
+ * already collected declarations would discard them.
27
+ */
28
+ function initRuntimeCapabilityRegistry(fastify) {
29
+ const holder = fastify;
30
+ if (!Object.hasOwn(holder, ARC_RUNTIME_CAPABILITIES)) holder[ARC_RUNTIME_CAPABILITIES] = holder[ARC_RUNTIME_CAPABILITIES] ?? [];
31
+ }
9
32
  function registryOf(fastify) {
10
33
  const holder = fastify;
11
34
  if (!holder[ARC_RUNTIME_CAPABILITIES]) holder[ARC_RUNTIME_CAPABILITIES] = [];
@@ -13,14 +36,17 @@ function registryOf(fastify) {
13
36
  }
14
37
  /**
15
38
  * Declare a runtime capability. Callable from ANY registration context —
16
- * arc's own plugins, host `plugins()` callbacks, module `plugins` phases —
17
- * which is the point: the audit sees what the constructor-time guard cannot.
39
+ * arc's own plugins, host `plugins()` callbacks, module `plugins` phases,
40
+ * and encapsulated children of any of them — which is the point: the audit
41
+ * sees what the constructor-time guard cannot.
18
42
  */
19
43
  function declareRuntimeCapability(fastify, decl) {
20
44
  registryOf(fastify).push(decl);
21
45
  }
22
46
  /**
23
- * The boot audit. Runs once at the end of `buildApp`, after every declarant.
47
+ * The boot audit. Runs once at the end of `buildApp`, after every declarant —
48
+ * on the SAME instance `initRuntimeCapabilityRegistry` seeded, which is what
49
+ * makes declarations from encapsulated children visible here.
24
50
  *
25
51
  * - `runtime: 'distributed'` + `durability: 'memory'` + not `accepted` →
26
52
  * collected and THROWN as one error naming every violator (fixing them one
@@ -46,4 +72,4 @@ function auditRuntimeCapabilities(fastify, runtime) {
46
72
  }
47
73
  }
48
74
  //#endregion
49
- export { declareRuntimeCapability as n, auditRuntimeCapabilities as t };
75
+ export { declareRuntimeCapability as n, initRuntimeCapabilityRegistry as r, auditRuntimeCapabilities as t };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
3
- import { t as runWorkScope } from "./workScope-CoGpuzDX.mjs";
4
- import { t as startRenewingLease } from "./renewingLease-B5Grm0pI.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-eysyzFAF.mjs";
3
+ import { t as runWorkScope } from "./workScope-CxKqoIFn.mjs";
4
+ import { t as startRenewingLease } from "./renewingLease-yF8BdW4b.mjs";
5
5
  import fp from "fastify-plugin";
6
6
  //#region src/plugins/schedules.ts
7
7
  var schedules_exports = /* @__PURE__ */ __exportAll({
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { arcLog } from "./logger/index.mjs";
3
3
  //#region src/utils/schemaConverter.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { o as toJsonSchema } from "./schemaConverter-DENbixyA.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { o as toJsonSchema } from "./schemaConverter-BVA7cFRG.mjs";
3
3
  //#region src/core/schemaIR.ts
4
4
  /**
5
5
  * Schema IR — one canonical representation, two adapters.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { errorContractSchema, errorDetailSchema } from "@classytic/repo-core/errors";
3
3
  import { Type, Type as Type$1 } from "typebox";
4
4
  //#region src/schemas/index.ts
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as parseJsonBody } from "../jsonBody-Dx6jH_Nb.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as parseJsonBody } from "../jsonBody-ELR9lfeU.mjs";
3
3
  import fp from "fastify-plugin";
4
4
  //#region src/scim/errors.ts
5
5
  var ScimError = class extends Error {
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { C as isService, D as requireUserId, E as requireTeamId, O as scopeFirstCtx, S as isOrgInScope, T as requireOrgId, _ as getUserRoles, a as getDPoPJkt, b as isElevated, c as getOrgId, d as getScopeContext, f as getScopeContextMap, g as getUserId, h as getTenantFromRequest, i as getClientId, l as getOrgRoles, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, r as getAncestorOrgIds, s as getOrgContext, t as AUTHENTICATED_SCOPE, u as getRequestScope, v as hasOrgAccess, w as requireClientId, x as isMember, y as isAuthenticated } from "../types-CNQyOrLk.mjs";
3
- import { n as elevation_default, t as elevationPlugin } from "../elevation-CZy6n50b.mjs";
4
- import { t as createTenantKeyGenerator } from "../rateLimitKey-umrS6-vu.mjs";
5
- import { t as resolveOrgFromHeader } from "../scope-CdYxQVxt.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { C as isService, D as requireUserId, E as requireTeamId, O as scopeFirstCtx, S as isOrgInScope, T as requireOrgId, _ as getUserRoles, a as getDPoPJkt, b as isElevated, c as getOrgId, d as getScopeContext, f as getScopeContextMap, g as getUserId, h as getTenantFromRequest, i as getClientId, l as getOrgRoles, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, r as getAncestorOrgIds, s as getOrgContext, t as AUTHENTICATED_SCOPE, u as getRequestScope, v as hasOrgAccess, w as requireClientId, x as isMember, y as isAuthenticated } from "../types-CgenB1gv.mjs";
3
+ import { n as elevation_default, t as elevationPlugin } from "../elevation-CkvG0LG2.mjs";
4
+ import { t as createTenantKeyGenerator } from "../rateLimitKey-BvOvcBDi.mjs";
5
+ import { t as resolveOrgFromHeader } from "../scope-BUi1xV1I.mjs";
6
6
  export { AUTHENTICATED_SCOPE, PUBLIC_SCOPE, createTenantKeyGenerator, elevation_default as elevationPlugin, elevationPlugin as elevationPluginFn, getAncestorOrgIds, getClientId, getDPoPJkt, getMandate, getOrgContext, getOrgId, getOrgRoles, getRequestScope, getScopeContext, getScopeContextMap, getServiceScopes, getTeamId, getTenantFromRequest, getUserId, getUserRoles, hasOrgAccess, isAuthenticated, isElevated, isMember, isOrgInScope, isService, requireClientId, requireOrgId, requireTeamId, requireUserId, resolveOrgFromHeader, scopeFirstCtx };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-BHD3L8of.mjs";
3
- import { n as requireSingleHeaderValue } from "./headers-BFEEshDS.mjs";
4
- import { n as getUserRoles } from "./userHelpers-DLueLQdQ.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-BH7YU_9O.mjs";
3
+ import { n as requireSingleHeaderValue } from "./headers-BIXWKrzQ.mjs";
4
+ import { n as getUserRoles } from "./userHelpers-ChRvkuSZ.mjs";
5
5
  //#region src/scope/resolveOrgFromHeader.ts
6
6
  /**
7
7
  * Create a preHandler hook that resolves org scope from a header.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  //#region src/utils/simpleEqualityMatcher.ts
3
3
  /**
4
4
  * `simpleEqualityMatcher` — a minimal, dialect-agnostic flat-key equality
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-eysyzFAF.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-CNQyOrLk.mjs";
5
- import { a as promoteStreamTokenToHeader } from "./streaming-CFwCzEvU.mjs";
6
- import { t as openSseStream } from "./sseStream-BfZtL5-m.mjs";
4
+ import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-CgenB1gv.mjs";
5
+ import { a as promoteStreamTokenToHeader } from "./streaming-IcRFjWQU.mjs";
6
+ import { t as openSseStream } from "./sseStream-Ppzo-WUH.mjs";
7
7
  import fp from "fastify-plugin";
8
8
  //#region src/plugins/sse.ts
9
9
  var sse_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { n as forwardedStreamHeaders } from "./streaming-CFwCzEvU.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { n as forwardedStreamHeaders } from "./streaming-IcRFjWQU.mjs";
3
3
  //#region src/utils/sseStream.ts
4
4
  /**
5
5
  * Take over the reply socket and open an SSE stream. Call ONLY after every
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  //#region src/utils/store-helpers.ts
3
3
  /**
4
4
  * Classify an error thrown by `getOne` / `getById` / `update` as a
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { Readable } from "node:stream";
3
3
  //#region src/utils/streaming.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { r as createEvent } from "./EventTransport-BUkTwY_x.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { r as createEvent } from "./EventTransport-DSqD_Xsg.mjs";
3
3
  //#region src/events/defineEvent.ts
4
4
  /**
5
5
  * Typed event declarations, a registry for introspection, and `.create()` to
@@ -1,3 +1,3 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { CursorExpiredError, MemoryChangeLogStore } from "@classytic/repo-core/sync";
3
3
  export { CursorExpiredError, MemoryChangeLogStore };
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { afterAll, beforeAll, describe, expect, it } from "vitest";
3
3
  //#region src/testing/cleanupStoreContract.ts
4
4
  /**
@@ -1,10 +1,10 @@
1
1
 
2
2
  import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
3
- import { l as PermissionCheck, t as AnyRecord } from "../base-C-NL2fTi.mjs";
4
- import { V as ResourceDefinition } from "../index-D3sIPcD4.mjs";
5
- import { n as ArcModuleInput, o as ModuleDisposer, s as ModuleSetupContext } from "../types-BVlowlm7.mjs";
6
- import "../index-DbMglURO.mjs";
7
- import { n as preloadResourcesAsync, r as CreateAppOptions, t as preloadResources } from "../preloadResources-DVgPCNcD.mjs";
3
+ import { l as PermissionCheck, t as AnyRecord } from "../base-CxrV1LmG.mjs";
4
+ import { V as ResourceDefinition } from "../index-DHbyPo5j.mjs";
5
+ import { n as ArcModuleInput, o as ModuleDisposer, s as ModuleSetupContext } from "../types-DfVDvkdP.mjs";
6
+ import "../index-CFfLKMH4.mjs";
7
+ import { n as preloadResourcesAsync, r as CreateAppOptions, t as preloadResources } from "../preloadResources-CjS2OfpU.mjs";
8
8
  import { StorageContractSetup, StorageContractSetupResult, runStorageContract } from "./storageContract.mjs";
9
9
  import { StandardRepo } from "@classytic/repo-core/repository";
10
10
  import { FastifyInstance, FastifyServerOptions } from "fastify";
@@ -1,12 +1,12 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "../constants-BQ2FbhPB.mjs";
3
- import { g as getUserId } from "../types-CNQyOrLk.mjs";
4
- import { t as BaseController } from "../BaseController-BqJtbiUA.mjs";
5
- import { t as defineAggregation } from "../defineAggregation-BDA2Tw7v.mjs";
6
- import { t as defineResource } from "../defineResource-DaIySrQr.mjs";
7
- import { E as requireOrgRole } from "../permissions-C0GpDsB_.mjs";
8
- import { a as createApp, n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-BAx5s9EF.mjs";
9
- import { n as getModuleExports } from "../module-CNcwCKUJ.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "../constants-D5Ubn1fe.mjs";
3
+ import { g as getUserId } from "../types-CgenB1gv.mjs";
4
+ import { t as BaseController } from "../BaseController-CYEwjyjN.mjs";
5
+ import { t as defineAggregation } from "../defineAggregation-D_eJjm5A.mjs";
6
+ import { t as defineResource } from "../defineResource-DxkMTjRn.mjs";
7
+ import { E as requireOrgRole } from "../permissions-D8TBH44E.mjs";
8
+ import { a as createApp, n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-f3boenVZ.mjs";
9
+ import { n as getModuleExports } from "../module-DpLJG2_N.mjs";
10
10
  import { runStorageContract } from "./storageContract.mjs";
11
11
  import Fastify from "fastify";
12
12
  import { afterAll, describe, expect, it, vi } from "vitest";
@@ -1504,7 +1504,7 @@ function pickDefaultAuth(authMode, callerAuth) {
1504
1504
  };
1505
1505
  }
1506
1506
  async function createTestApp(options = {}) {
1507
- const { createApp } = await import("../preloadResources-BAx5s9EF.mjs").then((n) => n.o);
1507
+ const { createApp } = await import("../preloadResources-f3boenVZ.mjs").then((n) => n.o);
1508
1508
  const { resources = [], db = "in-memory", connectMongoose = false, authMode = "jwt", defaultOrgId, plugins, auth: callerAuth, ...appOptions } = options;
1509
1509
  let dbHandle;
1510
1510
  let dbUri;
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { OutboxOwnershipError } from "@classytic/primitives/outbox";
3
3
  import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
4
4
  //#region src/testing/outboxStoreContract.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { afterAll, beforeAll, describe, expect, it } from "vitest";
3
3
  //#region src/testing/storageContract.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  //#region src/context/transactionContext.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  //#region src/utils/typeGuards.ts
3
3
  /** Check if fastify has the events plugin registered */
4
4
  function hasEvents(instance) {
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
3
- import { a as UserLike, c as DataPolicy, d as UserBase, i as ObjectId, l as PermissionCheck, n as ArcRequest, o as UserOrganization, r as JWTPayload, s as AuthorizationDecision, t as AnyRecord, u as PermissionContext } from "../base-C-NL2fTi.mjs";
4
- import { $ as OpenApiSchemas, A as RequestIdOptions, An as WriteVerbKey, At as RouteDefinition, C as RequestContext, D as HealthCheck, Dn as MutationWriteContext, Dt as ActionEntry, E as GracefulShutdownOptions, Et as ActionDefinition, F as FastifyWithDecorators, Fn as IControllerResponse, Ft as AuthPluginOptions, G as OnTenantDeleteConfig, H as CrudController, I as MiddlewareHandler, In as IRequestContext, It as Authenticator, J as PresetHook, K as ResolvedTenantPurge, L as RequestWithExtras, Ln as RawRouteHandler, Lt as AuthenticatorContext, M as EventsDecorator, Mn as ControllerLike, Mt as RouteMethod, N as FastifyRequestExtras, Nn as FastifyHandler, Nt as RateLimitConfig, O as HealthOptions, On as ResourceWrites, Ot as ActionHandlerFn, P as FastifyWithAuth, Pn as IController, Pt as AuthHelpers, Q as MiddlewareConfig, Rn as RouteHandler, Rt as JwtContext, S as QueryParserInterface, T as CrudRouterOptions, Tt as ResourceCacheConfig, U as ResourceConfig, W as ResourcePermissions, X as CrudRouteKey, Y as PresetResult, Z as CrudSchemas, _ as ControllerQueryOptions, a as InferAdapterDoc, at as ResourceExtensions, b as ParsedQuery, c as TypedController, d as PaginationResult, et as RouteSchemaOptions, f as IntrospectionData, g as ArcInternalMetadata, h as ResourceMetadata, i as ValidationResult, it as ResourceHooks, j as ArcDecorator, jn as ControllerHandler, jt as RouteMcpConfig, k as IntrospectionPluginOptions, kn as WriteContext, kt as ActionsMap, l as TypedRepository, m as RegistryStats, n as ConfigError, nt as FieldRule, o as InferDocType, ot as EventDefinition, p as RegistryEntry, q as PresetFunction, r as ValidateOptions, rt as ResourceHookContext, s as InferResourceDoc, t as RouteHandlerMethod, tt as ArcFieldRule, u as TypedResourceConfig, v as LookupOption, w as ServiceContext, x as PopulateOption, xn as BaseControllerOptions, y as OwnershipCheck, zt as TokenPair } from "../index-D3sIPcD4.mjs";
3
+ import { a as UserLike, c as DataPolicy, d as UserBase, i as ObjectId, l as PermissionCheck, n as ArcRequest, o as UserOrganization, r as JWTPayload, s as AuthorizationDecision, t as AnyRecord, u as PermissionContext } from "../base-CxrV1LmG.mjs";
4
+ import { $ as OpenApiSchemas, A as RequestIdOptions, An as WriteVerbKey, At as RouteDefinition, C as RequestContext, D as HealthCheck, Dn as MutationWriteContext, Dt as ActionEntry, E as GracefulShutdownOptions, Et as ActionDefinition, F as FastifyWithDecorators, Fn as IControllerResponse, Ft as AuthPluginOptions, G as OnTenantDeleteConfig, H as CrudController, I as MiddlewareHandler, In as IRequestContext, It as Authenticator, J as PresetHook, K as ResolvedTenantPurge, L as RequestWithExtras, Ln as RawRouteHandler, Lt as AuthenticatorContext, M as EventsDecorator, Mn as ControllerLike, Mt as RouteMethod, N as FastifyRequestExtras, Nn as FastifyHandler, Nt as RateLimitConfig, O as HealthOptions, On as ResourceWrites, Ot as ActionHandlerFn, P as FastifyWithAuth, Pn as IController, Pt as AuthHelpers, Q as MiddlewareConfig, Rn as RouteHandler, Rt as JwtContext, S as QueryParserInterface, T as CrudRouterOptions, Tt as ResourceCacheConfig, U as ResourceConfig, W as ResourcePermissions, X as CrudRouteKey, Y as PresetResult, Z as CrudSchemas, _ as ControllerQueryOptions, a as InferAdapterDoc, at as ResourceExtensions, b as ParsedQuery, c as TypedController, d as PaginationResult, et as RouteSchemaOptions, f as IntrospectionData, g as ArcInternalMetadata, h as ResourceMetadata, i as ValidationResult, it as ResourceHooks, j as ArcDecorator, jn as ControllerHandler, jt as RouteMcpConfig, k as IntrospectionPluginOptions, kn as WriteContext, kt as ActionsMap, l as TypedRepository, m as RegistryStats, n as ConfigError, nt as FieldRule, o as InferDocType, ot as EventDefinition, p as RegistryEntry, q as PresetFunction, r as ValidateOptions, rt as ResourceHookContext, s as InferResourceDoc, t as RouteHandlerMethod, tt as ArcFieldRule, u as TypedResourceConfig, v as LookupOption, w as ServiceContext, x as PopulateOption, xn as BaseControllerOptions, y as OwnershipCheck, zt as TokenPair } from "../index-DHbyPo5j.mjs";
5
5
  import { n as ElevationOptions, t as ElevationEvent } from "../elevation-BXCfVcNG.mjs";
6
6
  export type { ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AnyRecord, ArcDecorator, ArcFieldRule, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, AuthorizationDecision, BaseControllerOptions, ConfigError, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRouteKey, CrudRouterOptions, CrudSchemas, DataPolicy, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, LookupOption, MiddlewareConfig, MiddlewareHandler, MutationWriteContext, ObjectId, OnTenantDeleteConfig, OpenApiSchemas, OwnershipCheck, PaginationResult, ParsedQuery, PermissionCheck, PermissionContext, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryParserInterface, RateLimitConfig, RawRouteHandler, RegistryEntry, RegistryStats, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResolvedTenantPurge, ResourceCacheConfig, ResourceConfig, ResourceExtensions, ResourceHookContext, ResourceHooks, ResourceMetadata, ResourcePermissions, ResourceWrites, RouteDefinition, RouteHandler, RouteHandlerMethod, RouteMcpConfig, RouteMethod, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult, WriteContext, WriteVerbKey };
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  export {};
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  export {};
@@ -1,5 +1,5 @@
1
1
 
2
- import { V as ResourceDefinition } from "./index-D3sIPcD4.mjs";
2
+ import { V as ResourceDefinition } from "./index-DHbyPo5j.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/integrations/mcp/types.d.ts
5
5
  /** Behavioral hints for MCP clients (tool annotations per MCP spec) */
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-BHD3L8of.mjs";
3
- import { n as requireSingleHeaderValue } from "./headers-BFEEshDS.mjs";
4
- import { t as getUserId$1 } from "./userHelpers-DLueLQdQ.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-BH7YU_9O.mjs";
3
+ import { n as requireSingleHeaderValue } from "./headers-BIXWKrzQ.mjs";
4
+ import { t as getUserId$1 } from "./userHelpers-ChRvkuSZ.mjs";
5
5
  //#region src/scope/types.ts
6
6
  /**
7
7
  * Request Scope — The One Standard
@@ -1,5 +1,5 @@
1
1
 
2
- import { n as DomainEvent, r as EventHandler } from "./EventTransport-BPOQsEer.mjs";
2
+ import { n as DomainEvent, r as EventHandler } from "./EventTransport-CbUKDzZZ.mjs";
3
3
  import { n as ErrorMapper } from "./errorHandler--4rSMMvq.mjs";
4
4
  import { FastifyInstance, FastifyPluginAsync } from "fastify";
5
5
  import { LockAdapter } from "@classytic/repo-core/lock";
@@ -90,6 +90,24 @@ interface SchedulesPluginOptions {
90
90
  * environments), same pattern as `idempotencyPlugin`.
91
91
  */
92
92
  enabled?: boolean;
93
+ /**
94
+ * States that exactly ONE replica of this deployment arms schedules, so no
95
+ * lock is needed. Same idiom as `eventPlugin, { singleProcess: true }`.
96
+ *
97
+ * Under `runtime: 'distributed'`, schedules with neither `lock` nor this
98
+ * flag FAIL the boot. Without one of them arc cannot tell a deliberately
99
+ * single-armed deployment — the `role: 'scheduler'` process pinned to one
100
+ * replica, which is the recommended topology — from the accidental default,
101
+ * where every replica in a fleet fires every tick. The accidental case is
102
+ * duplicate side effects: two invoices, two dunning emails, two charges.
103
+ * That is a worse failure than the replica-local stores arc already refuses
104
+ * to boot on, so it is held to the same standard rather than warned about.
105
+ *
106
+ * Set it only when the replica count for the process that arms schedules is
107
+ * genuinely one. It is a claim about your deployment, not a silencer — if
108
+ * you scale that deployment past one replica, remove it and pass a `lock`.
109
+ */
110
+ singleReplica?: boolean;
93
111
  /**
94
112
  * How long `onClose` waits for in-flight runs before abandoning them.
95
113
  * Default: 5000.