@classytic/arc 2.41.0 → 2.43.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 (230) hide show
  1. package/dist/{EventTransport-CbUKDzZZ.d.mts → EventTransport-CiicKz2Z.d.mts} +1 -1
  2. package/dist/{EventTransport-n7qO5Cz3.mjs → EventTransport-tzA7CAB4.mjs} +22 -17
  3. package/dist/{HookSystem-CxvZBo77.mjs → HookSystem-B6UaKRbF.mjs} +2 -2
  4. package/dist/{QueryCache-DFA-QrU9.d.mts → QueryCache--5uAuYPW.d.mts} +7 -3
  5. package/dist/{ResourceRegistry-Cu7uTJp9.mjs → ResourceRegistry-CuCARu2B.mjs} +44 -13
  6. package/dist/actionPermissions-BotX1YOa.mjs +776 -0
  7. package/dist/audit/index.d.mts +43 -5
  8. package/dist/audit/index.mjs +48 -26
  9. package/dist/auth/audit.mjs +1 -1
  10. package/dist/auth/index.d.mts +43 -13
  11. package/dist/auth/index.mjs +130 -155
  12. package/dist/auth/redis-session.mjs +1 -1
  13. package/dist/{authorizationDecision-2YY_Kaj1.mjs → authorizationDecision-DQYrkl5f.mjs} +7 -102
  14. package/dist/{base-CxrV1LmG.d.mts → base-CZyixEQR.d.mts} +27 -5
  15. package/dist/boundedMap-BULzfXYU.mjs +57 -0
  16. package/dist/{buildHandler-CUhjGHGZ.mjs → buildHandler-CRQ8EcX5.mjs} +4 -4
  17. package/dist/cache/index.d.mts +22 -34
  18. package/dist/cache/index.mjs +4 -4
  19. package/dist/{caching-DsWDjIxx.mjs → caching-Cc2M1DwO.mjs} +3 -3
  20. package/dist/claimed-B10RTfkM.mjs +8 -0
  21. package/dist/cleanup/index.d.mts +6 -10
  22. package/dist/cleanup/index.mjs +27 -73
  23. package/dist/cli/commands/describe.d.mts +4 -2
  24. package/dist/cli/commands/describe.mjs +7 -4
  25. package/dist/cli/commands/docs.mjs +3 -3
  26. package/dist/cli/commands/doctor.mjs +1 -1
  27. package/dist/cli/commands/generate.mjs +2 -2
  28. package/dist/cli/commands/init.mjs +2 -2
  29. package/dist/cli/commands/introspect.mjs +2 -2
  30. package/dist/cli/index.mjs +3 -3
  31. package/dist/{constants-BxLgNFF7.mjs → constants-Cu7Mx7_U.mjs} +4 -2
  32. package/dist/context/index.d.mts +2 -5
  33. package/dist/context/index.mjs +18 -38
  34. package/dist/core/index.d.mts +3 -3
  35. package/dist/core/index.mjs +8 -8
  36. package/dist/{core-iNGqYerO.mjs → core-Cb0LjccA.mjs} +5 -4
  37. package/dist/{createActionRouter-BBlbPs3k.mjs → createActionRouter-xjqonMRO.mjs} +87 -39
  38. package/dist/{createAggregationRouter-Dv5SuK2x.mjs → createAggregationRouter-zRYWw_5D.mjs} +11 -8
  39. package/dist/{preloadResources-Bbp4QJ8V.mjs → createApp-D-953ZAq.mjs} +299 -390
  40. package/dist/{createMcpServer-CbDWkZ1T.d.mts → createMcpServer-C9cxS8zt.d.mts} +1 -1
  41. package/dist/{defineAggregation-UyeurGkp.mjs → defineAggregation-Bm8RjMbq.mjs} +1 -1
  42. package/dist/{defineResource-DzGT-2LP.mjs → defineResource-DIC7JZGU.mjs} +118 -1024
  43. package/dist/discovery/index.mjs +1 -1
  44. package/dist/docs/index.d.mts +10 -4
  45. package/dist/docs/index.mjs +4 -4
  46. package/dist/{elevation-BXCfVcNG.d.mts → elevation-BW2J3tNj.d.mts} +1 -2
  47. package/dist/{elevation-BF-vhGxY.mjs → elevation-DG8SrLN-.mjs} +41 -12
  48. package/dist/encryption/index.mjs +3 -3
  49. package/dist/{errorHandler-CIMkCOWm.mjs → errorHandler-BnfDviL1.mjs} +26 -5
  50. package/dist/{errors-C_YhELhe.mjs → errors-CtrywMHP.mjs} +58 -23
  51. package/dist/{errors-BGdVwP25.d.mts → errors-JYc9vwqE.d.mts} +9 -0
  52. package/dist/{eventPlugin-B52abJ8W.d.mts → eventPlugin-BtmA4-3P.d.mts} +65 -9
  53. package/dist/{eventPlugin-CmXaPWLv.mjs → eventPlugin-Q6BhzHzs.mjs} +82 -21
  54. package/dist/{subscribe-helpers-AVYPgqTl.mjs → eventTypes-Cdhm6ZlV.mjs} +151 -17
  55. package/dist/events/index.d.mts +33 -8
  56. package/dist/events/index.mjs +49 -53
  57. package/dist/events/transports/redis-stream-entry.d.mts +1 -1
  58. package/dist/events/transports/redis-stream-entry.mjs +139 -157
  59. package/dist/events/transports/redis.d.mts +1 -1
  60. package/dist/events/transports/redis.mjs +2 -2
  61. package/dist/factory/index.d.mts +32 -17
  62. package/dist/factory/index.mjs +213 -32
  63. package/dist/{fastify-augmentation-Cq2nHVaW.d.mts → fastify-augmentation-DhUJ-mvo.d.mts} +11 -25
  64. package/dist/{fields-I_EeRWND.d.mts → fields-BBSpf8pS.d.mts} +1 -1
  65. package/dist/{fields-BTyPLHK0.mjs → fields-ToPYpMqS.mjs} +1 -1
  66. package/dist/filter-merge-IpGywvym.mjs +99 -0
  67. package/dist/{generate-D_YmiCNf.mjs → generate-DRTkLlIl.mjs} +2 -2
  68. package/dist/{headers-CNECDE6q.mjs → headers-BbkIF6vA.mjs} +2 -2
  69. package/dist/health-D-Ft6JM6.mjs +22 -0
  70. package/dist/{health-CxQzbJmr.mjs → health-DqbsG-_w.mjs} +115 -55
  71. package/dist/hooks/index.d.mts +2 -2
  72. package/dist/hooks/index.mjs +2 -2
  73. package/dist/idempotency/index.d.mts +31 -7
  74. package/dist/idempotency/index.mjs +155 -98
  75. package/dist/idempotency/redis.d.mts +1 -1
  76. package/dist/idempotency/redis.mjs +48 -11
  77. package/dist/{index-BHdZD8zK.d.mts → index-Bxriq3so.d.mts} +84 -21
  78. package/dist/{preloadResources-CjS2OfpU.d.mts → index-C8zVGYsk.d.mts} +37 -38
  79. package/dist/{index-D4u76eQW.d.mts → index-CRoPtISf.d.mts} +23 -73
  80. package/dist/{index-CbJiYrfv.d.mts → index-Chgz3d0i.d.mts} +1 -1
  81. package/dist/index-JdbZAIsm.d.mts +510 -0
  82. package/dist/{index-DHbyPo5j.d.mts → index-mqaqZNpe.d.mts} +253 -254
  83. package/dist/index.d.mts +8 -8
  84. package/dist/index.mjs +11 -11
  85. package/dist/{init-Y2MlSN9n.mjs → init-B_oUYDXI.mjs} +1 -1
  86. package/dist/integrations/event-gateway.d.mts +8 -3
  87. package/dist/integrations/event-gateway.mjs +4 -4
  88. package/dist/integrations/index.d.mts +3 -3
  89. package/dist/integrations/index.mjs +1 -1
  90. package/dist/integrations/jobs/index.d.mts +1 -1
  91. package/dist/integrations/jobs/index.mjs +18 -5
  92. package/dist/integrations/mcp/index.d.mts +72 -59
  93. package/dist/integrations/mcp/index.mjs +19 -4
  94. package/dist/integrations/mcp/testing.d.mts +2 -2
  95. package/dist/integrations/mcp/testing.mjs +2 -2
  96. package/dist/integrations/streamline.d.mts +78 -136
  97. package/dist/integrations/streamline.mjs +116 -54
  98. package/dist/integrations/webhooks.d.mts +60 -120
  99. package/dist/integrations/webhooks.mjs +36 -80
  100. package/dist/integrations/websocket-pushref-redis.d.mts +1 -1
  101. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  102. package/dist/integrations/websocket-redis.d.mts +1 -1
  103. package/dist/integrations/websocket-redis.mjs +1 -1
  104. package/dist/integrations/websocket.d.mts +3 -3
  105. package/dist/integrations/websocket.mjs +2 -2
  106. package/dist/{interface-DEWNOMza.d.mts → interface-C0395yUN.d.mts} +13 -1
  107. package/dist/{jsonBody-Cq9KYl2Z.mjs → jsonBody-B4YVGcql.mjs} +2 -2
  108. package/dist/{keys-Cmv4cBRa.mjs → keys-B2KtgMLJ.mjs} +7 -18
  109. package/dist/{loadResources-CblF7xt2.mjs → loadResources-Dn4lalw2.mjs} +3 -3
  110. package/dist/{loadResourcesFromEntry-99fIMC3p.mjs → loadResourcesFromEntry-3sLYbuse.mjs} +2 -2
  111. package/dist/logger/index.d.mts +1 -8
  112. package/dist/logger/index.mjs +3 -153
  113. package/dist/logger-DXjfIqjV.mjs +160 -0
  114. package/dist/{mcpPlugin-xF3Gw-HW.mjs → mcpPlugin-C08HalN5.mjs} +433 -170
  115. package/dist/{memory-CpDZ9NPw.mjs → memory-9Cp7611C.mjs} +36 -34
  116. package/dist/{metrics-BaKnq8ag.mjs → metrics-CWI11eRu.mjs} +39 -72
  117. package/dist/middleware/index.d.mts +2 -2
  118. package/dist/middleware/index.mjs +3 -3
  119. package/dist/migrations/index.mjs +2 -2
  120. package/dist/{module-BkQEesNQ.mjs → module-BSvOQC7E.mjs} +8 -8
  121. package/dist/multiTenant-cY0FkDiA.d.mts +104 -0
  122. package/dist/{multipartBody-C92aJ8am.mjs → multipartBody-CXM2a-Dy.mjs} +46 -7
  123. package/dist/{openapi-C3LFRzPq.mjs → openapi-DT_G4VhY.mjs} +48 -10
  124. package/dist/outbox-admin/index.d.mts +3 -3
  125. package/dist/outbox-admin/index.mjs +6 -18
  126. package/dist/{outbox-module-dsCyLxXH.mjs → outbox-module-Bjgzl6tg.mjs} +203 -33
  127. package/dist/{outbox-module-BHdUnuuK.d.mts → outbox-module-gZCHoE4H.d.mts} +79 -6
  128. package/dist/permissions/index.d.mts +5 -4
  129. package/dist/permissions/index.mjs +8 -6
  130. package/dist/{permissions-DiHXy8Ck.mjs → permissions-Cm0uYHvd.mjs} +149 -33
  131. package/dist/{pipe-CBVmUJ-j.mjs → pipe-BqeGT6UO.mjs} +2 -2
  132. package/dist/pipeline/index.d.mts +2 -2
  133. package/dist/pipeline/index.mjs +2 -2
  134. package/dist/plan-FVR6LP59.mjs +565 -0
  135. package/dist/{BaseController-DYJRZ0EJ.mjs → plugin-BccET1tL.mjs} +1256 -344
  136. package/dist/plugins/index.d.mts +14 -11
  137. package/dist/plugins/index.mjs +44 -22
  138. package/dist/plugins/response-cache.mjs +8 -14
  139. package/dist/plugins/tracing-entry.mjs +2 -2
  140. package/dist/{pluralize-2_U6QZQg.mjs → pluralize-CVIOcgMF.mjs} +1 -1
  141. package/dist/presets/filesUpload.d.mts +2 -2
  142. package/dist/presets/filesUpload.mjs +5 -5
  143. package/dist/presets/index.d.mts +26 -31
  144. package/dist/presets/index.mjs +4 -4
  145. package/dist/presets/multiTenant.d.mts +2 -107
  146. package/dist/presets/multiTenant.mjs +22 -162
  147. package/dist/presets/search.d.mts +2 -2
  148. package/dist/presets/search.mjs +2 -2
  149. package/dist/{presets-BdlugYTc.mjs → presets-Cpvj6fGO.mjs} +99 -107
  150. package/dist/{projection-Uvgp-EEj.mjs → projection-Ce4aQhQk.mjs} +2 -2
  151. package/dist/{pushref-registry-Dov9l4qE.d.mts → pushref-registry-UxCkoA4C.d.mts} +1 -1
  152. package/dist/{queryCachePlugin-BzqxconG.d.mts → queryCachePlugin-C2lZjTxk.d.mts} +1 -1
  153. package/dist/{queryCachePlugin-B5F09bYr.mjs → queryCachePlugin-CFWNH8aT.mjs} +12 -14
  154. package/dist/{rateLimitKey-CK-EU2L8.mjs → rateLimitKey-C4O-kPm0.mjs} +1 -1
  155. package/dist/{realtime-FnnD0n3Z.mjs → realtime-DmPE9S54.mjs} +25 -21
  156. package/dist/redis-stream-BMk-bpQS.d.mts +219 -0
  157. package/dist/{redis-Bzi1y3F9.d.mts → redis-vLvtcGy_.d.mts} +13 -24
  158. package/dist/redisShapes-CQksY67q.d.mts +55 -0
  159. package/dist/registry/index.d.mts +9 -4
  160. package/dist/registry/index.mjs +4 -4
  161. package/dist/{registry-D3y8VEJ1.mjs → registry-Bcz9G1bh.mjs} +10 -8
  162. package/dist/{renewingLease-B3VYh5aU.mjs → renewingLease-qODa7KJQ.mjs} +1 -1
  163. package/dist/{replyHelpers-DPHsdw-5.mjs → replyHelpers-CG_VtVgS.mjs} +2 -2
  164. package/dist/{requestContext-cSVKnYPk.mjs → requestContext-Dsu9P1bV.mjs} +1 -1
  165. package/dist/requirement-CbiLdQ1n.d.mts +22 -0
  166. package/dist/requirement-KDdoRcOP.mjs +35 -0
  167. package/dist/resourceRateLimit-Wf6d6FL9.d.mts +30 -0
  168. package/dist/resourceRateLimit-dSjVr1pk.mjs +180 -0
  169. package/dist/{rolldown-runtime-DjDuyglE.mjs → rolldown-runtime-D1w9Y1VJ.mjs} +1 -1
  170. package/dist/routeValidator-D36SW8qt.mjs +70 -0
  171. package/dist/{runtimeCapabilities-DSA_dH1_.mjs → runtimeCapabilities-0tccjRlj.mjs} +1 -1
  172. package/dist/{schedules-BktJb3Y3.mjs → schedules-C-OpmHBq.mjs} +46 -37
  173. package/dist/{schemaConverter-BLCSmNbr.mjs → schemaConverter-BORek3O-.mjs} +2 -2
  174. package/dist/{schemaIR-K16Bb5BX.mjs → schemaIR-C7Vbp71I.mjs} +2 -2
  175. package/dist/schemas/index.d.mts +10 -0
  176. package/dist/schemas/index.mjs +8 -3
  177. package/dist/scim/index.mjs +2 -2
  178. package/dist/scope/index.d.mts +2 -2
  179. package/dist/scope/index.mjs +6 -6
  180. package/dist/{scope-jSxuBTFM.mjs → scope-DQthe88b.mjs} +4 -4
  181. package/dist/shutdown-MqA81z_P.mjs +59 -0
  182. package/dist/{simpleEqualityMatcher-BiOnyflP.mjs → simpleEqualityMatcher-auW8QjXN.mjs} +1 -1
  183. package/dist/{sse-CH7Slxc1.mjs → sse-CYzQBVFe.mjs} +11 -15
  184. package/dist/{sseStream-CN-Lh1Tu.mjs → sseStream-B5_Afiqn.mjs} +2 -2
  185. package/dist/{store-helpers-9DX9-1j_.mjs → store-helpers-BOzk-CuX.mjs} +1 -1
  186. package/dist/{streaming-dvppnxsr.mjs → streaming-DjTQhZrN.mjs} +1 -1
  187. package/dist/subscriberIdentity-CW39uA8G.mjs +28 -0
  188. package/dist/tenancy--ed9eH_z.mjs +43 -0
  189. package/dist/tenantPreparation-BKon6Yox.mjs +67 -0
  190. package/dist/testing/cleanupStoreContract.mjs +1 -1
  191. package/dist/testing/index.d.mts +193 -175
  192. package/dist/testing/index.mjs +286 -212
  193. package/dist/testing/outboxStoreContract.mjs +137 -2
  194. package/dist/testing/requiredPorts.d.mts +17 -0
  195. package/dist/testing/requiredPorts.mjs +65 -0
  196. package/dist/testing/storageContract.mjs +1 -1
  197. package/dist/timing-qczZ0YC-.mjs +46 -0
  198. package/dist/{transactionContext-DCWMI6hV.mjs → transactionContext-DjFkrNG6.mjs} +1 -1
  199. package/dist/{typeGuards-D7tHFdH6.mjs → typeGuards-CySF12G-.mjs} +1 -1
  200. package/dist/types/index.d.mts +4 -4
  201. package/dist/types/index.mjs +1 -1
  202. package/dist/types/storage.mjs +1 -1
  203. package/dist/{types-CWQn9-IC.d.mts → types-B4Aq4Sdj.d.mts} +22 -9
  204. package/dist/{types-DfVDvkdP.d.mts → types-BJ-2XqVF.d.mts} +189 -204
  205. package/dist/{types-CDy3-zw1.mjs → types-Bk9NOgOC.mjs} +4 -4
  206. package/dist/usage/index.d.mts +2 -3
  207. package/dist/usage/index.mjs +5 -5
  208. package/dist/{userHelpers-DDMOZ_Pm.mjs → userHelpers-aklawRaK.mjs} +1 -1
  209. package/dist/utils/index.d.mts +84 -223
  210. package/dist/utils/index.mjs +13 -12
  211. package/dist/{utils-B-zj_b__.mjs → utils-ec1oTo1n.mjs} +315 -404
  212. package/dist/{validate-R0G_JrnK.mjs → validate-9yzHC1e2.mjs} +6 -14
  213. package/dist/{versioning-D6JIK8Tk.d.mts → versioning-Bsb51gGT.d.mts} +28 -13
  214. package/dist/{versioning-DuVWcu-F.mjs → versioning-fhhWHV74.mjs} +4 -4
  215. package/dist/{websocket-BOXVggMf.d.mts → websocket-Cs4awVyD.d.mts} +1 -1
  216. package/dist/{workScope-BhsWde4k.mjs → workScope-zpPyge4t.mjs} +2 -2
  217. package/package.json +578 -574
  218. package/skills/arc/SKILL.md +13 -4
  219. package/skills/arc/references/auth.md +8 -5
  220. package/skills/arc/references/integrations.md +1 -1
  221. package/skills/arc/references/mcp.md +8 -6
  222. package/skills/arc/references/multi-tenancy.md +19 -14
  223. package/skills/arc/references/production.md +27 -10
  224. package/dist/actionPermissions-DPwPWPOV.mjs +0 -350
  225. package/dist/index-CFfLKMH4.d.mts +0 -290
  226. package/dist/interface-BIpgzbZl.mjs +0 -17
  227. package/dist/redis-stream-BPKscsTB.d.mts +0 -260
  228. package/dist/registerRoute-DRsSHPSM.mjs +0 -364
  229. package/dist/sync/changelog.d.mts +0 -3
  230. package/dist/sync/changelog.mjs +0 -3
@@ -1,7 +1,8 @@
1
1
 
2
2
  import { n as CacheStats, r as CacheStore, t as CacheLogger } from "../interface-BOk3YnTz.mjs";
3
- import { a as QueryCacheConfig, i as QueryCache, n as CacheResult, r as CacheStatus, t as CacheEnvelope } from "../QueryCache-DFA-QrU9.mjs";
4
- import { i as queryCachePlugin, n as QueryCacheDefaults, r as QueryCachePluginOptions, t as CrossResourceRule } from "../queryCachePlugin-BzqxconG.mjs";
3
+ import { a as QueryCacheConfig, i as QueryCache, n as CacheResult, r as CacheStatus, t as CacheEnvelope } from "../QueryCache--5uAuYPW.mjs";
4
+ import { i as queryCachePlugin, n as QueryCacheDefaults, r as QueryCachePluginOptions, t as CrossResourceRule } from "../queryCachePlugin-C2lZjTxk.mjs";
5
+ import { n as UpstashKeyValueCommands, t as IoredisKeyValueCommands } from "../redisShapes-CQksY67q.mjs";
5
6
  //#region src/cache/keys.d.ts
6
7
  /**
7
8
  * Cache Key Utilities
@@ -17,9 +18,10 @@ declare function versionKey(resource: string): string;
17
18
  /** Tag version key — stored in CacheStore, bumped on cross-resource invalidation */
18
19
  declare function tagVersionKey(tag: string): string;
19
20
  /**
20
- * Stable hash for query params.
21
- * Sorts keys recursively, serializes to JSON, then applies djb2 hash.
22
- * Returns hex string.
21
+ * Digest of the query params for a cache key — repo-core's canonical serialiser (escaped,
22
+ * type-preserving, key-order-free) under SHA-256. Two different queries never share a key: a
23
+ * delimiter inside a value, `1` vs `"1"`, two dates or two regexes all stay distinct, and a
24
+ * cryptographic digest leaves no crafted collision onto another caller's cached result.
23
25
  */
24
26
  declare function hashParams(params: Record<string, unknown>): string;
25
27
  //#endregion
@@ -37,9 +39,11 @@ interface MemoryCacheStoreOptions {
37
39
  */
38
40
  maxEntryBytes?: number;
39
41
  /**
40
- * Total memory budget in bytes (default: 50 MiB).
41
- * When exceeded, LRU entries are evicted until usage drops below watermark.
42
- * Set to 0 to disable (rely on maxEntries only).
42
+ * Total budget in bytes (default: 50 MiB), counted as serialized value
43
+ * bytes plus key bytes — an estimate of payload, NOT a heap limit (Map
44
+ * and object overhead are not counted). When exceeded, LRU entries are
45
+ * evicted until usage drops to the watermark. Set to 0 to disable (rely
46
+ * on maxEntries only).
43
47
  */
44
48
  maxMemoryBytes?: number;
45
49
  /**
@@ -91,8 +95,8 @@ declare class MemoryCacheStore<TValue = unknown> implements CacheStore<TValue> {
91
95
  close(): Promise<void>;
92
96
  stats(): CacheStats;
93
97
  private removeEntry;
94
- private evictToLimit;
95
- private evictToMemoryLimit;
98
+ /** Every write path ends here, so no path can skip a limit. */
99
+ private enforceLimits;
96
100
  private cleanupExpired;
97
101
  private estimateSize;
98
102
  }
@@ -179,22 +183,16 @@ declare class RedisCacheStore<TValue = unknown> implements CacheStore<TValue> {
179
183
  private withPrefix;
180
184
  }
181
185
  /**
182
- * Minimal ioredis shape we depend on. We don't import ioredis itself so the
183
- * cache subpath stays peer-dep-free. The `scan` tail is `unknown[]` so a real
184
- * ioredis `Redis` (overloads with literal tokens + optional callback) is
185
- * assignable — see the same note on the idempotency `IoredisLike`.
186
+ * Minimal ioredis shape the cache depends on — the shared key/value commands
187
+ * (`utils/redisShapes.ts`, where the `unknown[]`-tail rule is explained) plus
188
+ * the cache's own extras. Not importing ioredis keeps the subpath peer-dep-free.
186
189
  */
187
- interface IoredisLike {
188
- get(key: string): Promise<string | null>;
189
- set(...args: unknown[]): Promise<string | null>;
190
- del(...keys: string[]): Promise<number>;
191
- scan(cursor: string | number, ...args: unknown[]): Promise<[string, string[]]>;
190
+ interface IoredisLike extends IoredisKeyValueCommands {
192
191
  pipeline?(): {
193
192
  del(key: string): unknown;
194
193
  exec(): Promise<unknown>;
195
194
  };
196
195
  incrby?(key: string, by: number): Promise<number>;
197
- eval?(script: string, numKeys: number, ...args: (string | number)[]): Promise<unknown>;
198
196
  }
199
197
  /**
200
198
  * Wrap an ioredis instance as a `RedisCacheClient`.
@@ -218,22 +216,12 @@ interface IoredisLike {
218
216
  */
219
217
  declare function ioredisAsCacheClient(client: IoredisLike): RedisCacheClient;
220
218
  /**
221
- * Minimal `@upstash/redis` REST SDK shape we depend on.
222
- *
223
- * `@upstash/redis` is HTTP-based and works on edge runtimes (Cloudflare
224
- * Workers, Vercel Edge, Deno Deploy) where TCP connections — and thus
225
- * ioredis — are unavailable.
219
+ * Minimal `@upstash/redis` REST SDK shape the cache depends on — the shared
220
+ * key/value commands (`utils/redisShapes.ts`) plus `incrby`. HTTP-based, so it
221
+ * works on edge runtimes where ioredis cannot.
226
222
  */
227
- interface UpstashRedisLike {
228
- get(key: string): Promise<string | null | unknown>;
229
- set(key: string, value: unknown, opts?: Record<string, unknown>): Promise<unknown>;
230
- del(...keys: string[]): Promise<number>;
231
- scan(cursor: number | string, opts?: {
232
- match?: string;
233
- count?: number;
234
- }): Promise<[number, string[]] | [string, string[]]>;
223
+ interface UpstashRedisLike extends UpstashKeyValueCommands {
235
224
  incrby?(key: string, by: number): Promise<number>;
236
- eval?(script: string, keys: string[], args: (string | number)[]): Promise<unknown>;
237
225
  }
238
226
  /**
239
227
  * Wrap an `@upstash/redis` REST client as a `RedisCacheClient`.
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-Cmv4cBRa.mjs";
3
- import { t as MemoryCacheStore } from "../memory-CpDZ9NPw.mjs";
4
- import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-B5F09bYr.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-B2KtgMLJ.mjs";
3
+ import { t as MemoryCacheStore } from "../memory-9Cp7611C.mjs";
4
+ import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-CFWNH8aT.mjs";
5
5
  //#region src/cache/redis.ts
6
6
  /**
7
7
  * Redis-backed cache store.
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DjDuyglE.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-D1w9Y1VJ.mjs";
3
3
  import fp from "fastify-plugin";
4
4
  //#region src/plugins/caching.ts
5
5
  var caching_exports = /* @__PURE__ */ __exportAll({
@@ -74,4 +74,4 @@ var caching_default = fp(cachingPlugin, {
74
74
  fastify: "5.x"
75
75
  });
76
76
  //#endregion
77
- export { caching_default as n, caching_exports as r, cachingPlugin as t };
77
+ export { caching_exports as n, caching_default as t };
@@ -0,0 +1,8 @@
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ //#region src/events/outbox/claimed.ts
3
+ function claimedAttempts(claimed) {
4
+ const value = claimed.attempts;
5
+ return typeof value === "number" && Number.isInteger(value) && value > 0 ? value : void 0;
6
+ }
7
+ //#endregion
8
+ export { claimedAttempts as t };
@@ -1,9 +1,8 @@
1
1
 
2
- import { L as RequestWithExtras } from "../index-DHbyPo5j.mjs";
2
+ import { A as RequestWithExtras } from "../index-mqaqZNpe.mjs";
3
3
  import { A as CleanupStepResult, B as VerificationResult, C as CleanupResult, D as CleanupRunStore, E as CleanupRunStatus, F as PurgeEvidence, I as PurgeResourceResult, L as PurgeStrategyKind, M as CleanupWriteFence, N as DEFAULT_CLEANUP_LIMITS, O as CleanupRunTransitionPatch, P as PurgeActor, R as PurgeVerificationSummary, S as CleanupRecipe, T as CleanupRunCreateResult, _ as CleanupPermissions, a as CleanupEvidenceStore, b as CleanupPlanItem, c as CleanupInput, d as CleanupLease, f as CleanupLimits, g as CleanupPermissionCheck, h as CleanupOutcomeStatus, i as CleanupContext, j as CleanupStepRunStatus, k as CleanupStepProgress, l as CleanupJob, m as CleanupManifest, n as CLEANUP_TERMINAL_STATUSES, o as CleanupExecutionContext, p as CleanupLogger, r as CleanupCancelRequest, s as CleanupFinalizationPayload, t as Availability, u as CleanupJobQueue, v as CleanupPlan, w as CleanupRun, x as CleanupProgressSummary, y as CleanupPlanDraft, z as VerificationCheck } from "../types-DVLddu2q.mjs";
4
- import { t as ArcModule } from "../types-DfVDvkdP.mjs";
4
+ import { n as ArcModule } from "../types-BJ-2XqVF.mjs";
5
5
  import { PurgeStrategyKind as PurgeStrategyKind$1 } from "@classytic/primitives/retention";
6
- import { canonicalJson } from "@classytic/primitives/canonical";
7
6
  import { CleanupStep } from "@classytic/repo-core/cleanup";
8
7
  //#region src/cleanup/compose.d.ts
9
8
  /** Metadata + steps for {@link recipeFromSteps}. */
@@ -203,12 +202,11 @@ interface CleanupServiceDeps {
203
202
  registry: CleanupRegistry;
204
203
  runStore: CleanupRunStore;
205
204
  evidenceStore: CleanupEvidenceStore;
206
- /** Optional write fence (§8). No-op when absent. */
205
+ /** Optional write fence. No-op when absent. */
207
206
  writeFence?: CleanupWriteFence | undefined;
208
207
  /**
209
- * Durable job queue (§8). Defaults to a microtask-deferred in-process queue
210
- * that calls `processRun` off the request path (single-process only). Inject
211
- * BullMQ / SQS / repo-backed for cross-process durability + restart recovery.
208
+ * Durable job queue. Default: an in-process microtask queue (single-process,
209
+ * no restart recovery) — inject BullMQ / SQS / repo-backed for durability.
212
210
  */
213
211
  jobQueue?: CleanupJobQueue | undefined;
214
212
  /** Framework size caps. Defaults to {@link DEFAULT_CLEANUP_LIMITS}. */
@@ -261,8 +259,6 @@ interface CleanupService {
261
259
  cancel(id: string, input?: CancelInput): Promise<CleanupRun>;
262
260
  retry(id: string): Promise<CleanupRun>;
263
261
  }
264
- /** Admission key serializing every destructive run behind one slot. */
265
- declare const GLOBAL_DESTRUCTIVE_KEY = "global-destructive";
266
262
  declare function createCleanupService(deps: CleanupServiceDeps): CleanupService;
267
263
  //#endregion
268
264
  //#region src/cleanup/module.d.ts
@@ -345,4 +341,4 @@ declare function computePlanDigest(plan: Omit<CleanupPlan, "digest">): string;
345
341
  */
346
342
  declare function computeManifestDigest(manifest: Record<string, unknown>): string;
347
343
  //#endregion
348
- export { type Availability, CLEANUP_TERMINAL_STATUSES, type CancelInput, type CleanupCancelRequest, CleanupCancelled, type CleanupContext, CleanupError, type CleanupErrorCode, CleanupErrors, type CleanupEvidenceStore, type CleanupExecutionContext, type CleanupFinalizationPayload, type CleanupInput, type CleanupJob, type CleanupJobQueue, type CleanupLease, type CleanupLimits, type CleanupLogger, type CleanupManifest, type CleanupOutcomeStatus, type CleanupPermissionCheck, type CleanupPermissions, type CleanupPlan, type CleanupPlanDraft, type CleanupPlanItem, type CleanupProgressSummary, type CleanupRecipe, type CleanupRecipeInfo, type CleanupRegistry, type CleanupResult, type CleanupRun, type CleanupRunCreateResult, type CleanupRunStatus, type CleanupRunStore, type CleanupRunTransitionPatch, type CleanupService, type CleanupServiceDeps, type CleanupStepProgress, type CleanupStepResult, type CleanupStepRunStatus, type CleanupWriteFence, DEFAULT_CLEANUP_LIMITS, type DataCleanupModuleDeps, type ExecuteInput, GLOBAL_DESTRUCTIVE_KEY, MemoryCleanupEvidenceStore, MemoryCleanupJobQueue, MemoryCleanupRunStore, type PreviewInput, type PurgeActor, type PurgeEvidence, type PurgeResourceResult, type PurgeStrategyKind, type PurgeVerificationSummary, type RecipeFromStepsInput, type VerificationCheck, type VerificationResult, canonicalJson, computeManifestDigest, computePlanDigest, createCleanupRegistry, createCleanupService, createDataCleanupModule, recipeFromSteps };
344
+ export { type Availability, CLEANUP_TERMINAL_STATUSES, type CancelInput, type CleanupCancelRequest, CleanupCancelled, type CleanupContext, CleanupError, type CleanupErrorCode, CleanupErrors, type CleanupEvidenceStore, type CleanupExecutionContext, type CleanupFinalizationPayload, type CleanupInput, type CleanupJob, type CleanupJobQueue, type CleanupLease, type CleanupLimits, type CleanupLogger, type CleanupManifest, type CleanupOutcomeStatus, type CleanupPermissionCheck, type CleanupPermissions, type CleanupPlan, type CleanupPlanDraft, type CleanupPlanItem, type CleanupProgressSummary, type CleanupRecipe, type CleanupRecipeInfo, type CleanupRegistry, type CleanupResult, type CleanupRun, type CleanupRunCreateResult, type CleanupRunStatus, type CleanupRunStore, type CleanupRunTransitionPatch, type CleanupService, type CleanupServiceDeps, type CleanupStepProgress, type CleanupStepResult, type CleanupStepRunStatus, type CleanupWriteFence, DEFAULT_CLEANUP_LIMITS, type DataCleanupModuleDeps, type ExecuteInput, MemoryCleanupEvidenceStore, MemoryCleanupJobQueue, MemoryCleanupRunStore, type PreviewInput, type PurgeActor, type PurgeEvidence, type PurgeResourceResult, type PurgeStrategyKind, type PurgeVerificationSummary, type RecipeFromStepsInput, type VerificationCheck, type VerificationResult, computeManifestDigest, computePlanDigest, createCleanupRegistry, createCleanupService, createDataCleanupModule, recipeFromSteps };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { g as getUserId } from "../types-CDy3-zw1.mjs";
3
- import { t as defineResource } from "../defineResource-DzGT-2LP.mjs";
4
- import { t as defineModule } from "../module-BkQEesNQ.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { g as getUserId } from "../types-Bk9NOgOC.mjs";
3
+ import { t as defineResource } from "../defineResource-DIC7JZGU.mjs";
4
+ import { t as defineModule } from "../module-BSvOQC7E.mjs";
5
5
  import { createPurgeEvidence } from "@classytic/primitives/retention";
6
6
  import { canonicalJson, sha256Hex } from "@classytic/primitives/canonical";
7
7
  //#region src/cleanup/errors.ts
@@ -612,8 +612,8 @@ function createCleanupRegistry(recipes) {
612
612
  * implementation (`Date`-explicit, strict-reject of `undefined`/`NaN`/`BigInt`/
613
613
  * `function`/`symbol`/`Map`/`Set`/cyclic). Two domains consume it — cleanup
614
614
  * manifests here + financial-close evidence manifests in arc-accounting — so it
615
- * lives in primitives, not duplicated per package. `canonicalJson` is re-exported
616
- * for existing importers; peer floor `@classytic/primitives >= 0.17.0`.
615
+ * lives in primitives, not duplicated per package — import `canonicalJson` from
616
+ * there; peer floor `@classytic/primitives >= 0.17.0`.
617
617
  */
618
618
  /**
619
619
  * The material content of a plan — everything an operator is consenting to.
@@ -656,33 +656,22 @@ function computeManifestDigest(manifest) {
656
656
  /**
657
657
  * Cleanup orchestration service — the framework's use-case core.
658
658
  *
659
- * Split into a REQUEST path and a WORKER path so the durability guarantees the
660
- * ports promise actually hold:
659
+ * REQUEST path vs WORKER path:
661
660
  *
662
- * preview() → re-plan, seal a digest, surface blockers/retains/confirmation
663
- * execute() → validate (availability, digest, confirmation, reason,
664
- * blockers, limits), ATOMICALLY create the run (admission
665
- * guard by concurrencyKey), persist the sealed operation,
666
- * ENQUEUE `{ runId }`, and RETURN. It does NOT run the recipe.
667
- * processRun() → the worker entrypoint. Takes an EXCLUSIVE LEASE on the run
668
- * (`claim` — a live lease refuses duplicate workers), then
669
- * branches: a `finalizing` run RECOVERS finalization from the
670
- * persisted payload (never re-executes); a `queued` run (or a
671
- * crashed `running` run whose lease expired) executes the
672
- * recipe with cooperative cancellation, verifies, persists
673
- * the finalization payload, and finalizes idempotently.
674
- * cancel() → durable cancel request (+ actor/reason audit) + CAS a
675
- * not-yet-running run straight to `cancelled` WITH evidence.
676
- * A running run stops cooperatively and leaves evidence of
677
- * the committed chunks.
678
- * retry() → reload the SAME sealed operation, re-check availability +
679
- * recipe version + digest against a fresh plan (refuse if the
680
- * world changed), re-arm ATOMICALLY under the same admission
681
- * guard as creation, re-enqueue.
661
+ * preview() → re-plan and seal a digest.
662
+ * execute() → validate, ATOMICALLY create the run (admission guard by
663
+ * concurrencyKey), ENQUEUE `{ runId }`, return. Never runs the recipe.
664
+ * processRun() → worker entrypoint. Takes an EXCLUSIVE lease; a `finalizing`
665
+ * run only replays finalization from the persisted payload
666
+ * (never re-executes); a `queued` or lease-expired `running`
667
+ * run executes, verifies, persists the payload, finalizes.
668
+ * cancel() → durable, audited request; a not-yet-running run goes straight
669
+ * to `cancelled` WITH evidence, a running one stops cooperatively.
670
+ * retry() → re-validate the SAME sealed operation against a fresh plan
671
+ * (refuse if it changed), re-arm atomically under the same guard.
682
672
  *
683
- * Every status change goes through `compareAndTransition` (CAS) carrying the
684
- * worker's lease token, so a late `completed` write from a stalled ex-owner can
685
- * never clobber the new owner's `cancelled`/`running` state.
673
+ * Every status change is a CAS carrying the lease token, so a stalled ex-owner's
674
+ * late write can never clobber the new owner's state.
686
675
  */
687
676
  const EMPTY_PROGRESS = {
688
677
  processed: 0,
@@ -724,20 +713,9 @@ function createCleanupService(deps) {
724
713
  const generateId = deps.generateId ?? (() => globalThis.crypto.randomUUID());
725
714
  const now = deps.now ?? (() => /* @__PURE__ */ new Date());
726
715
  /**
727
- * Undefined-valued keys are DROPPED, not spread.
728
- *
729
- * `limits` is `Partial<CleanupLimits>`, which permits an EXPLICIT `undefined`
730
- * — and a plain spread lets that overwrite the default rather than fall back
731
- * to it. Every limit is then read in a comparison, and `n > undefined` is
732
- * always `false`, so `{ limits: { maxPlanItems: undefined } }` did not raise
733
- * the cap: it silently REMOVED it, on a framework whose whole job is deleting
734
- * data. Same for `maxReasonLength` / `maxParamDepth`, and `maxResults` turned
735
- * `slice(0, undefined)` into "keep everything".
736
- *
737
- * A host reaches this by forwarding an optional config through
738
- * (`limits: { maxPlanItems: cfg.planCap }`) — no cast, no obvious mistake.
739
- * `permissions/presets.ts` already filters for exactly this reason; this is
740
- * the same rule applied to the destructive path.
716
+ * Undefined-valued keys are DROPPED, not spread: an explicit `undefined`
717
+ * would overwrite the default, and `n > undefined` is always false — so the
718
+ * cap would silently disappear on the path that deletes data.
741
719
  */
742
720
  const limits = {
743
721
  ...DEFAULT_CLEANUP_LIMITS,
@@ -772,14 +750,6 @@ function createCleanupService(deps) {
772
750
  }, ctx);
773
751
  const items = draft.items;
774
752
  if (items.length > limits.maxPlanItems) throw CleanupErrors.planTooLarge(`${items.length} items > maxPlanItems ${limits.maxPlanItems}`);
775
- /**
776
- * Partition by DISPOSITION — a protective guard's count is not damage.
777
- *
778
- * This was one `reduce` over every item, so a guard reporting the 173 posted
779
- * journal entries it defends pushed the "records to remove" headline to 540
780
- * on a plan that removes 367. Absent disposition means `'remove'`, so every
781
- * pre-existing recipe is unchanged.
782
- */
783
753
  const estimatedTotal = items.reduce((sum, i) => sum + ((i.disposition ?? "remove") === "remove" ? i.estimated : 0), 0);
784
754
  const protectedTotal = items.reduce((sum, i) => sum + (i.disposition === "protect" ? i.estimated : 0), 0);
785
755
  const blockers = new Set(draft.blockers ?? []);
@@ -907,13 +877,6 @@ function createCleanupService(deps) {
907
877
  let processed = 0;
908
878
  let steps = 0;
909
879
  let failed = 0;
910
- /**
911
- * Per-step lifecycle, keyed by `stepId` and ordered by first sight.
912
- *
913
- * Seeded from the run's existing progress so a RESUMED run (crash recovery,
914
- * retry) keeps the states it already recorded instead of presenting an
915
- * operator with a blank pipeline for work that demonstrably happened.
916
- */
917
880
  const stepStates = new Map((run.progress?.stepProgress ?? []).map((s) => [s.stepId, s]));
918
881
  let cancelled = false;
919
882
  let lastSummary = run.progress ?? EMPTY_PROGRESS;
@@ -960,18 +923,9 @@ function createCleanupService(deps) {
960
923
  }
961
924
  },
962
925
  /**
963
- * Upsert one step's lifecycle state, preserving FIRST-SEEN order.
964
- *
965
- * A `Map` keyed by `stepId` is what keeps this bounded and idempotent: a
966
- * step transitioning running → completed updates its entry rather than
967
- * appending, so the array length is the step count and never the
968
- * transition count. Insertion order is the execution order, which is what
969
- * an operator reads down the list.
970
- *
971
- * Persisted on the NEXT `onStep` (or the terminal write) rather than
972
- * immediately — a lifecycle transition is not itself a committed chunk,
973
- * and writing on every one would defeat the progress throttle that exists
974
- * to keep a long run from hammering the store.
926
+ * Upsert a step's state (bounded: one entry per step, first-seen order).
927
+ * Persisted with the NEXT `onStep` or terminal write, so transitions
928
+ * don't bypass the progress throttle.
975
929
  */
976
930
  async onStepState(state) {
977
931
  stepStates.set(state.stepId, state);
@@ -1525,4 +1479,4 @@ function createDataCleanupModule(deps) {
1525
1479
  });
1526
1480
  }
1527
1481
  //#endregion
1528
- export { CLEANUP_TERMINAL_STATUSES, CleanupCancelled, CleanupError, CleanupErrors, DEFAULT_CLEANUP_LIMITS, GLOBAL_DESTRUCTIVE_KEY, MemoryCleanupEvidenceStore, MemoryCleanupJobQueue, MemoryCleanupRunStore, canonicalJson, computeManifestDigest, computePlanDigest, createCleanupRegistry, createCleanupService, createDataCleanupModule, recipeFromSteps };
1482
+ export { CLEANUP_TERMINAL_STATUSES, CleanupCancelled, CleanupError, CleanupErrors, DEFAULT_CLEANUP_LIMITS, MemoryCleanupEvidenceStore, MemoryCleanupJobQueue, MemoryCleanupRunStore, computeManifestDigest, computePlanDigest, createCleanupRegistry, createCleanupService, createDataCleanupModule, recipeFromSteps };
@@ -1,5 +1,5 @@
1
1
 
2
- import { Nt as RateLimitConfig, V as ResourceDefinition, et as RouteSchemaOptions } from "../../index-DHbyPo5j.mjs";
2
+ import { F as ResourceDefinition, X as RouteSchemaOptions, kt as RateLimitConfig } from "../../index-mqaqZNpe.mjs";
3
3
  //#region src/cli/commands/describe.d.ts
4
4
  interface DescribedResource {
5
5
  name: string;
@@ -86,6 +86,8 @@ interface AggregationDescription {
86
86
  interface PermissionDescription {
87
87
  type: "public" | "requireAuth" | "requireRoles" | "custom";
88
88
  roles?: readonly string[];
89
+ /** `allowPublic({ policy })`: public, but a row policy narrows what anyone sees. */
90
+ rowFiltered?: true;
89
91
  }
90
92
  interface FieldDescription {
91
93
  type: string;
@@ -125,4 +127,4 @@ interface EventDescription {
125
127
  declare function describeResource(resource: ResourceDefinition<unknown>, module?: string): DescribedResource;
126
128
  declare function describe(args: string[]): Promise<void>;
127
129
  //#endregion
128
- export { describe, describeResource };
130
+ export { DescribedResource, describe, describeResource };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "../../constants-BxLgNFF7.mjs";
3
- import { n as stringifyMeasureMap } from "../../ResourceRegistry-Cu7uTJp9.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "../../constants-Cu7Mx7_U.mjs";
3
+ import { n as stringifyMeasureMap } from "../../ResourceRegistry-CuCARu2B.mjs";
4
4
  import { resolve } from "node:path";
5
5
  import { pathToFileURL } from "node:url";
6
6
  //#region src/cli/commands/describe.ts
@@ -21,7 +21,10 @@ import { pathToFileURL } from "node:url";
21
21
  function describePermission(check) {
22
22
  if (!check || typeof check !== "function") return { type: "custom" };
23
23
  const fn = check;
24
- if (fn._isPublic === true) return { type: "public" };
24
+ if (fn._isPublic === true) return fn._rowPolicy ? {
25
+ type: "public",
26
+ rowFiltered: true
27
+ } : { type: "public" };
25
28
  if (Array.isArray(fn._roles)) return {
26
29
  type: "requireRoles",
27
30
  roles: fn._roles
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { t as buildOpenApiSpec } from "../../openapi-C3LFRzPq.mjs";
3
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-99fIMC3p.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { t as buildOpenApiSpec } from "../../openapi-DT_G4VhY.mjs";
3
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-3sLYbuse.mjs";
4
4
  import { dirname, resolve } from "node:path";
5
5
  import { mkdirSync, writeFileSync } from "node:fs";
6
6
  //#region src/cli/commands/docs.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
2
  import { dirname, join, parse, resolve } from "node:path";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  //#region src/cli/commands/doctor.ts
@@ -1,3 +1,3 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { t as generate } from "../../generate-D_YmiCNf.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { t as generate } from "../../generate-DRTkLlIl.mjs";
3
3
  export { generate };
@@ -1,3 +1,3 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { t as init } from "../../init-Y2MlSN9n.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { t as init } from "../../init-B_oUYDXI.mjs";
3
3
  export { init };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-99fIMC3p.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-3sLYbuse.mjs";
3
3
  //#region src/cli/commands/introspect.ts
4
4
  function describePermission(value) {
5
5
  if (!value) return "none";
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
2
  import { describe } from "./commands/describe.mjs";
3
3
  import { exportDocs } from "./commands/docs.mjs";
4
4
  import { doctor } from "./commands/doctor.mjs";
5
- import { t as generate } from "../generate-D_YmiCNf.mjs";
6
- import { t as init } from "../init-Y2MlSN9n.mjs";
5
+ import { t as generate } from "../generate-DRTkLlIl.mjs";
6
+ import { t as init } from "../init-B_oUYDXI.mjs";
7
7
  import { introspect } from "./commands/introspect.mjs";
8
8
  export { describe, doctor, exportDocs, generate, init, introspect };
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
2
  //#region src/constants.ts
3
3
  /**
4
4
  * Arc Framework Constants — Single Source of Truth
@@ -50,6 +50,8 @@ const DEFAULT_ID_FIELD = "_id";
50
50
  const DEFAULT_TENANT_FIELD = "organizationId";
51
51
  /** Default HTTP method for update routes */
52
52
  const DEFAULT_UPDATE_METHOD = "PATCH";
53
+ /** Default version field under `concurrency: {}` (optimistic concurrency) */
54
+ const DEFAULT_VERSION_FIELD = "__v";
53
55
  /** System-managed fields that cannot be set via request body */
54
56
  const SYSTEM_FIELDS = Object.freeze([
55
57
  "_id",
@@ -88,4 +90,4 @@ const RESERVED_QUERY_PARAMS = Object.freeze(/* @__PURE__ */ new Set([
88
90
  "_policyFilters"
89
91
  ]));
90
92
  //#endregion
91
- export { DEFAULT_SORT as a, HOOK_OPERATIONS as c, MAX_REGEX_LENGTH as d, MAX_SEARCH_LENGTH as f, SYSTEM_FIELDS as h, DEFAULT_MAX_LIMIT as i, HOOK_PHASES as l, RESERVED_QUERY_PARAMS as m, DEFAULT_ID_FIELD as n, DEFAULT_TENANT_FIELD as o, MUTATION_OPERATIONS as p, DEFAULT_LIMIT as r, DEFAULT_UPDATE_METHOD as s, CRUD_OPERATIONS as t, MAX_FILTER_DEPTH as u };
93
+ export { DEFAULT_SORT as a, DEFAULT_VERSION_FIELD as c, MAX_FILTER_DEPTH as d, MAX_REGEX_LENGTH as f, SYSTEM_FIELDS as g, RESERVED_QUERY_PARAMS as h, DEFAULT_MAX_LIMIT as i, HOOK_OPERATIONS as l, MUTATION_OPERATIONS as m, DEFAULT_ID_FIELD as n, DEFAULT_TENANT_FIELD as o, MAX_SEARCH_LENGTH as p, DEFAULT_LIMIT as r, DEFAULT_UPDATE_METHOD as s, CRUD_OPERATIONS as t, HOOK_PHASES as u };
@@ -94,11 +94,8 @@ declare function getTraceHeaders(): Record<string, string> | undefined;
94
94
  //#endregion
95
95
  //#region src/context/requestScopedCache.d.ts
96
96
  /**
97
- * The cache for the CURRENT unit of work — a request, an event dispatch or a
98
- * job run (see `runWorkScope`) — or `undefined` outside one.
99
- *
100
- * Lazily created on first use, so a scope that never touches a cached
101
- * repository allocates nothing.
97
+ * The cache for the CURRENT unit of work (see `runWorkScope`), or `undefined`
98
+ * outside one. Lazily created on first use.
102
99
  */
103
100
  declare function requestScopedCache(): CacheAdapter | undefined;
104
101
  /**
@@ -1,34 +1,23 @@
1
- /*! @classytic/arc v2.41.0 | MIT | https://classytic.com */
2
- import { t as transactionContext } from "../transactionContext-DCWMI6hV.mjs";
3
- import { n as requestContext, t as getTraceHeaders } from "../requestContext-cSVKnYPk.mjs";
4
- import { n as scopedValue, r as workSeedFromEvent, t as runWorkScope } from "../workScope-BhsWde4k.mjs";
1
+ /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
+ import { t as transactionContext } from "../transactionContext-DjFkrNG6.mjs";
3
+ import { n as requestContext, t as getTraceHeaders } from "../requestContext-Dsu9P1bV.mjs";
4
+ import { n as evictToSize, r as touch } from "../boundedMap-BULzfXYU.mjs";
5
+ import { n as scopedValue, r as workSeedFromEvent, t as runWorkScope } from "../workScope-zpPyge4t.mjs";
5
6
  //#region src/context/requestScopedCache.ts
6
7
  /** The memo slot the per-scope store hangs off. */
7
8
  const SLOT = Symbol.for("arc.requestScopedCache");
8
- /**
9
- * Entry cap for one scope's cache. A request touching this many distinct keys
10
- * is already pathological; a JOB RUN reaching it is ordinary, and that is the
11
- * case this exists for (see the eviction note below).
12
- */
9
+ /** Entry cap for one scope's cache — sized for long job runs, not requests. */
13
10
  const MAX_ENTRIES = 1e4;
14
11
  /**
15
12
  * A `Map`-backed `CacheAdapter` with NO TTL and LRU eviction above
16
13
  * {@link MAX_ENTRIES}.
17
14
  *
18
- * TTL is accepted and ignored because repo-core stamps freshness INTO the
19
- * envelope and re-checks on read — honouring it here too would put two clocks
20
- * on one question.
15
+ * TTL is ignored: repo-core stamps freshness INTO the envelope and re-checks
16
+ * on read, so honouring it here would put two clocks on one question.
21
17
  *
22
- * Eviction is newer than the rest of this file and the reason is worth
23
- * keeping. Unbounded was correct while a scope meant an HTTP REQUEST: the
24
- * store is unreachable once that async context ends, so it was garbage in
25
- * milliseconds and bounded by what one request touched, and an LRU would have
26
- * guarded a lifetime that could not occur. 2.40 extended scopes to job runs
27
- * and event dispatches — and `schedulesPlugin` wraps the WHOLE handler in one
28
- * scope, so a nightly job sweeping a million rows holds a single cache for the
29
- * duration. That is now a lifetime that occurs, and the old premise no longer
30
- * holds. Evicting is always safe here: this is a cache, so the worst a miss
31
- * costs is the re-read it was avoiding.
18
+ * The cap matters because `schedulesPlugin` wraps a WHOLE job handler in one
19
+ * scope, so a long sweep holds a single cache throughout. Evicting is always
20
+ * safe — a miss costs only the re-read it was avoiding.
32
21
  */
33
22
  function createRequestCacheAdapter() {
34
23
  const map = /* @__PURE__ */ new Map();
@@ -36,25 +25,19 @@ function createRequestCacheAdapter() {
36
25
  async get(key) {
37
26
  if (!map.has(key)) return void 0;
38
27
  const value = map.get(key);
39
- map.delete(key);
40
- map.set(key, value);
28
+ touch(map, key, value);
41
29
  return value;
42
30
  },
43
31
  async set(key, value, _ttlSeconds) {
44
- map.delete(key);
45
- map.set(key, value);
46
- if (map.size > MAX_ENTRIES) {
47
- const oldest = map.keys().next();
48
- if (!oldest.done) map.delete(oldest.value);
49
- }
32
+ touch(map, key, value);
33
+ evictToSize(map, MAX_ENTRIES);
50
34
  },
51
35
  async delete(key) {
52
36
  map.delete(key);
53
37
  },
54
38
  /**
55
- * Ignores the pattern and wipes the whole store. Over-invalidating within
56
- * one request costs at most a re-read; pattern matching is complexity a
57
- * store that dies in milliseconds does not earn.
39
+ * Ignores the pattern and wipes the whole store — over-invalidating a
40
+ * short-lived store costs at most a re-read.
58
41
  */
59
42
  async clear(_pattern) {
60
43
  map.clear();
@@ -62,11 +45,8 @@ function createRequestCacheAdapter() {
62
45
  };
63
46
  }
64
47
  /**
65
- * The cache for the CURRENT unit of work — a request, an event dispatch or a
66
- * job run (see `runWorkScope`) — or `undefined` outside one.
67
- *
68
- * Lazily created on first use, so a scope that never touches a cached
69
- * repository allocates nothing.
48
+ * The cache for the CURRENT unit of work (see `runWorkScope`), or `undefined`
49
+ * outside one. Lazily created on first use.
70
50
  */
71
51
  function requestScopedCache() {
72
52
  return scopedValue(SLOT, createRequestCacheAdapter);
@@ -1,4 +1,4 @@
1
1
 
2
- import { $t as AccessControlConfig, B as defineResource, Bt as BaseController, Cn as ControllerConstructionOptions, En as BodySanitizerConfig, Gt as SlugExt, Ht as SoftDeleteMixin, Jt as BulkMixin, Kt as SlugMixin, Qt as AccessControl, Sn as ControllerConfigurableOptions, Tn as BodySanitizer, Ut as TreeExt, V as ResourceDefinition, Vt as SoftDeleteExt, Wt as TreeMixin, Xt as QueryResolver, Yt as BaseCrudController, Zt as QueryResolverConfig, ct as AggMeasureShorthand, dt as AggregationDateRangeRequirement, ft as AggregationIndexHint, gt as AggregationsMap, ht as AggregationRateLimit, lt as AggregationCacheConfig, mt as AggregationMaterializedResult, pt as AggregationMaterializedContext, qt as BulkExt, st as AggMeasureInput, ut as AggregationConfig, wn as ListResult, xn as BaseControllerOptions } from "../index-DHbyPo5j.mjs";
3
- import { A as CRUD_OPERATIONS, B as HookOperation, C as SeamedResourceConfig, D as createCrudRouter, E as defineAction, F as DEFAULT_SORT, G as MUTATION_OPERATIONS, H as MAX_FILTER_DEPTH, I as DEFAULT_TENANT_FIELD, J as SYSTEM_FIELDS, K as MutationOperation, L as DEFAULT_UPDATE_METHOD, M as DEFAULT_ID_FIELD, N as DEFAULT_LIMIT, O as createPermissionMiddleware, P as DEFAULT_MAX_LIMIT, R as HOOK_OPERATIONS, S as ResourceSeams, T as DefineActionConfig, U as MAX_REGEX_LENGTH, V as HookPhase, W as MAX_SEARCH_LENGTH, _ as getEntityId, a as formatValidationErrors, b as defineResourceVariants, c as nativePolicyFilter, d as createCrudHandlers, f as createFastifyHandler, g as sendControllerResponse, h as getControllerScope, i as assertValidConfig, j as CrudOperation, k as defineAggregation, l as collectReadBlockedFields, m as getControllerContext, n as ValidateOptions, o as validateResourceConfig, p as createRequestContext, q as RESERVED_QUERY_PARAMS, r as ValidationResult, s as NativePolicyFilter, t as ConfigError, u as isFieldReadable, v as getEntityIdField, w as mergeResourceConfig, x as AdapterLike, y as getEntityQuery, z as HOOK_PHASES } from "../index-D4u76eQW.mjs";
4
- export { AccessControl, type AccessControlConfig, type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DefineActionConfig, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, MutationOperation, type NativePolicyFilter, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, type ResourceSeams, SYSTEM_FIELDS, type SeamedResourceConfig, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type ValidateOptions, type ValidationResult, assertValidConfig, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, sendControllerResponse, validateResourceConfig };
2
+ import { Bt as TreeMixin, Cn as ControllerConstructionOptions, Dn as BodySanitizerConfig, En as BodySanitizer, F as ResourceDefinition, Gt as BaseCrudController, Ht as SlugMixin, It as BaseController, Jt as AccessControl, Kt as QueryResolver, Lt as SoftDeleteExt, P as defineResource, Qt as FetchResult, Rt as SoftDeleteMixin, Sn as ControllerConfigurableOptions, Tn as MixinConstructor, Ut as BulkExt, Vt as SlugExt, Wt as BulkMixin, Xt as AccessControlRepository, Yt as AccessControlConfig, Zt as FetchDenialReason, at as AggregationCacheConfig, ct as AggregationIndexHint, dt as AggregationRateLimit, ft as AggregationsMap, it as AggMeasureShorthand, lt as AggregationMaterializedContext, ot as AggregationConfig, qt as QueryResolverConfig, rt as AggMeasureInput, st as AggregationDateRangeRequirement, ut as AggregationMaterializedResult, wn as ListResult, xn as BaseControllerOptions, zt as TreeExt } from "../index-mqaqZNpe.mjs";
3
+ import { A as createPermissionMiddleware, B as DEFAULT_VERSION_FIELD, C as AdapterLike, D as DefineActionConfig, E as mergeResourceConfig, F as DEFAULT_LIMIT, G as MAX_FILTER_DEPTH, H as HOOK_PHASES, I as DEFAULT_MAX_LIMIT, J as MUTATION_OPERATIONS, K as MAX_REGEX_LENGTH, L as DEFAULT_SORT, M as CRUD_OPERATIONS, N as CrudOperation, O as defineAction, P as DEFAULT_ID_FIELD, R as DEFAULT_TENANT_FIELD, S as defineResourceVariants, T as SeamedResourceConfig, U as HookOperation, V as HOOK_OPERATIONS, W as HookPhase, X as RESERVED_QUERY_PARAMS, Y as MutationOperation, Z as SYSTEM_FIELDS, _ as getEntityIdField, a as formatValidationErrors, b as VariantsMap, c as nativePolicyFilter, d as createFastifyHandler, f as createRequestContext, g as getEntityId, h as sendControllerResponse, i as assertValidConfig, j as defineAggregation, k as createCrudRouter, l as collectReadBlockedFields, m as getControllerScope, n as ValidateOptions, o as validateResourceConfig, p as getControllerContext, q as MAX_SEARCH_LENGTH, r as ValidationResult, s as NativePolicyFilter, t as ConfigError, u as isFieldReadable, v as getEntityQuery, w as ResourceSeams, x as VariantsResult, y as VariantOverride, z as DEFAULT_UPDATE_METHOD } from "../index-CRoPtISf.mjs";
4
+ export { AccessControl, type AccessControlConfig, type AccessControlRepository, type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, DEFAULT_VERSION_FIELD, type DefineActionConfig, type FetchDenialReason, type FetchResult, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, type MixinConstructor, MutationOperation, type NativePolicyFilter, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, type ResourceSeams, SYSTEM_FIELDS, type SeamedResourceConfig, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type ValidateOptions, type ValidationResult, type VariantOverride, type VariantsMap, type VariantsResult, assertValidConfig, collectReadBlockedFields, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, sendControllerResponse, validateResourceConfig };