@classytic/arc 2.41.1 → 2.44.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 (248) hide show
  1. package/dist/{EventTransport-CbUKDzZZ.d.mts → EventTransport-CiicKz2Z.d.mts} +1 -1
  2. package/dist/{EventTransport-DSqD_Xsg.mjs → EventTransport-DZWDsaPa.mjs} +22 -17
  3. package/dist/{HookSystem-CMF94SEA.mjs → HookSystem-yjEgn7Cm.mjs} +2 -2
  4. package/dist/{QueryCache-DFA-QrU9.d.mts → QueryCache--5uAuYPW.d.mts} +7 -3
  5. package/dist/{ResourceRegistry-MGpXoxHZ.mjs → ResourceRegistry-DJxHUpE4.mjs} +44 -13
  6. package/dist/acquire-BozJ-9yt.mjs +35 -0
  7. package/dist/actionPermissions-5N04zBL4.mjs +772 -0
  8. package/dist/audit/index.d.mts +46 -8
  9. package/dist/audit/index.mjs +48 -26
  10. package/dist/auth/audit.d.mts +8 -8
  11. package/dist/auth/audit.mjs +1 -1
  12. package/dist/auth/index.d.mts +46 -16
  13. package/dist/auth/index.mjs +134 -156
  14. package/dist/auth/redis-session.d.mts +4 -5
  15. package/dist/auth/redis-session.mjs +1 -1
  16. package/dist/{authorizationDecision-DawKGoXb.mjs → authorizationDecision-wX3SA9w_.mjs} +7 -102
  17. package/dist/{base-CxrV1LmG.d.mts → base-CZyixEQR.d.mts} +27 -5
  18. package/dist/boundedMap-DWiKW7lP.mjs +57 -0
  19. package/dist/{buildHandler-CvxKOc0m.mjs → buildHandler-Bswu_vNb.mjs} +4 -4
  20. package/dist/cache/index.d.mts +31 -43
  21. package/dist/cache/index.mjs +4 -4
  22. package/dist/{caching-DbCBxlgw.mjs → caching-Drp68DIS.mjs} +3 -3
  23. package/dist/claimed-DYvQoZLv.mjs +8 -0
  24. package/dist/cleanup/index.d.mts +18 -22
  25. package/dist/cleanup/index.mjs +27 -73
  26. package/dist/cli/commands/describe.d.mts +7 -5
  27. package/dist/cli/commands/describe.mjs +7 -4
  28. package/dist/cli/commands/docs.d.mts +2 -3
  29. package/dist/cli/commands/docs.mjs +3 -3
  30. package/dist/cli/commands/doctor.d.mts +2 -3
  31. package/dist/cli/commands/doctor.mjs +1 -1
  32. package/dist/cli/commands/generate.mjs +2 -3
  33. package/dist/cli/commands/init.mjs +2 -3
  34. package/dist/cli/commands/introspect.d.mts +2 -3
  35. package/dist/cli/commands/introspect.mjs +2 -2
  36. package/dist/cli/index.mjs +3 -3
  37. package/dist/{constants-D5Ubn1fe.mjs → constants-B2QHb6u6.mjs} +4 -2
  38. package/dist/context/index.d.mts +11 -14
  39. package/dist/context/index.mjs +18 -38
  40. package/dist/core/index.d.mts +3 -3
  41. package/dist/core/index.mjs +8 -8
  42. package/dist/{core-5lazhva9.mjs → core-COcqo0Cp.mjs} +15 -5
  43. package/dist/{createActionRouter-DNqoaK81.mjs → createActionRouter-zG13rpPJ.mjs} +97 -39
  44. package/dist/{createAggregationRouter-BcbQJf10.mjs → createAggregationRouter-CWRz96Vr.mjs} +11 -8
  45. package/dist/{preloadResources-f3boenVZ.mjs → createApp-BGLYtErt.mjs} +305 -394
  46. package/dist/{createMcpServer-CbDWkZ1T.d.mts → createMcpServer-DSztofa9.d.mts} +1 -1
  47. package/dist/{defineAggregation-D_eJjm5A.mjs → defineAggregation--3xguLkk.mjs} +1 -1
  48. package/dist/{defineResource-DxkMTjRn.mjs → defineResource-gUp9ug66.mjs} +118 -1024
  49. package/dist/discovery/index.d.mts +6 -7
  50. package/dist/discovery/index.mjs +1 -1
  51. package/dist/docs/index.d.mts +11 -5
  52. package/dist/docs/index.mjs +4 -4
  53. package/dist/{elevation-CkvG0LG2.mjs → elevation-BG4gnMsJ.mjs} +41 -12
  54. package/dist/{elevation-BXCfVcNG.d.mts → elevation-BW2J3tNj.d.mts} +1 -2
  55. package/dist/encryption/index.d.mts +5 -5
  56. package/dist/encryption/index.mjs +3 -3
  57. package/dist/{errorHandler-D1GHKGlV.mjs → errorHandler-COHw3N1b.mjs} +26 -5
  58. package/dist/{errors-BH7YU_9O.mjs → errors-CW4anJBy.mjs} +58 -23
  59. package/dist/{errors-BGdVwP25.d.mts → errors-JYc9vwqE.d.mts} +9 -0
  60. package/dist/{eventPlugin-B52abJ8W.d.mts → eventPlugin-BtmA4-3P.d.mts} +65 -9
  61. package/dist/{eventPlugin-zZY-unhr.mjs → eventPlugin-BweHAVws.mjs} +82 -21
  62. package/dist/{subscribe-helpers-DatDkcuG.mjs → eventTypes-N4-omQFR.mjs} +151 -17
  63. package/dist/events/index.d.mts +43 -18
  64. package/dist/events/index.mjs +49 -53
  65. package/dist/events/transports/redis-stream-entry.d.mts +1 -1
  66. package/dist/events/transports/redis-stream-entry.mjs +139 -157
  67. package/dist/events/transports/redis.d.mts +5 -6
  68. package/dist/events/transports/redis.mjs +2 -2
  69. package/dist/factory/index.d.mts +42 -27
  70. package/dist/factory/index.mjs +213 -32
  71. package/dist/{fastify-augmentation-Cq2nHVaW.d.mts → fastify-augmentation-DRlCIWE9.d.mts} +11 -25
  72. package/dist/{fields-BHrkoF5y.mjs → fields-A5crhsJb.mjs} +1 -1
  73. package/dist/{fields-I_EeRWND.d.mts → fields-BBSpf8pS.d.mts} +1 -1
  74. package/dist/filter-merge-DGM-GQ1J.mjs +99 -0
  75. package/dist/{generate-BLRf2m3y.mjs → generate-BXKo2Gc8.mjs} +2 -2
  76. package/dist/{headers-BIXWKrzQ.mjs → headers-DKZQKL-Z.mjs} +2 -2
  77. package/dist/health-BYAwA6YS.mjs +22 -0
  78. package/dist/{health-ZRHeDHXH.mjs → health-CrqUp3sz.mjs} +115 -55
  79. package/dist/hooks/index.d.mts +2 -2
  80. package/dist/hooks/index.mjs +2 -3
  81. package/dist/idempotency/index.d.mts +36 -10
  82. package/dist/idempotency/index.mjs +230 -111
  83. package/dist/idempotency/redis.d.mts +1 -1
  84. package/dist/idempotency/redis.mjs +77 -12
  85. package/dist/{index-D4u76eQW.d.mts → index-Beg3aNnK.d.mts} +23 -101
  86. package/dist/{preloadResources-CjS2OfpU.d.mts → index-BkV55WlV.d.mts} +37 -38
  87. package/dist/{index-BHdZD8zK.d.mts → index-Bxriq3so.d.mts} +84 -21
  88. package/dist/index-CUJvoyw3.d.mts +510 -0
  89. package/dist/{index-CbJiYrfv.d.mts → index-Chgz3d0i.d.mts} +1 -1
  90. package/dist/{index-DHbyPo5j.d.mts → index-WH7xgvxS.d.mts} +304 -254
  91. package/dist/index.d.mts +9 -9
  92. package/dist/index.mjs +11 -11
  93. package/dist/{init-CpLkjU18.mjs → init-BPzK5Lnr.mjs} +1 -1
  94. package/dist/integrations/event-gateway.d.mts +11 -7
  95. package/dist/integrations/event-gateway.mjs +4 -4
  96. package/dist/integrations/index.d.mts +3 -3
  97. package/dist/integrations/index.mjs +1 -1
  98. package/dist/integrations/jobs/index.d.mts +1 -1
  99. package/dist/integrations/jobs/index.mjs +18 -5
  100. package/dist/integrations/mcp/index.d.mts +102 -89
  101. package/dist/integrations/mcp/index.mjs +19 -4
  102. package/dist/integrations/mcp/testing.d.mts +8 -9
  103. package/dist/integrations/mcp/testing.mjs +2 -2
  104. package/dist/integrations/streamline.d.mts +85 -144
  105. package/dist/integrations/streamline.mjs +131 -55
  106. package/dist/integrations/webhooks.d.mts +83 -143
  107. package/dist/integrations/webhooks.mjs +36 -80
  108. package/dist/integrations/websocket-pushref-redis.d.mts +5 -6
  109. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  110. package/dist/integrations/websocket-redis.d.mts +5 -6
  111. package/dist/integrations/websocket-redis.mjs +1 -1
  112. package/dist/integrations/websocket.d.mts +3 -3
  113. package/dist/integrations/websocket.mjs +2 -2
  114. package/dist/{interface-DEWNOMza.d.mts → interface-JJzwH4Ro.d.mts} +34 -2
  115. package/dist/{jsonBody-ELR9lfeU.mjs → jsonBody-YIq-vGLv.mjs} +2 -2
  116. package/dist/{keys-cpZCtcIE.mjs → keys-CpoiZ8hU.mjs} +7 -18
  117. package/dist/{loadResources-BPfWiI5s.mjs → loadResources-6jO52-RR.mjs} +3 -3
  118. package/dist/{loadResourcesFromEntry-ixtfL3J2.mjs → loadResourcesFromEntry-MP8xEppu.mjs} +2 -2
  119. package/dist/logger/index.d.mts +9 -17
  120. package/dist/logger/index.mjs +2 -153
  121. package/dist/logger-D4V1zGLI.mjs +160 -0
  122. package/dist/{mcpPlugin-BX5PujI0.mjs → mcpPlugin-srPc7ItN.mjs} +446 -170
  123. package/dist/{memory-Iotz0cCx.mjs → memory-CTa5pOCW.mjs} +36 -34
  124. package/dist/{metrics-NMsmpRmY.mjs → metrics-DsZrvnpB.mjs} +39 -72
  125. package/dist/middleware/index.d.mts +5 -5
  126. package/dist/middleware/index.mjs +3 -3
  127. package/dist/migrations/index.d.mts +13 -13
  128. package/dist/migrations/index.mjs +2 -2
  129. package/dist/{module-DpLJG2_N.mjs → module--L0iBIZz.mjs} +8 -8
  130. package/dist/mongodb-memory-server-CHhYSq5y.mjs +35539 -0
  131. package/dist/mongoose-CYJCLyi-.mjs +67451 -0
  132. package/dist/multiTenant-CAtYlW6H.d.mts +104 -0
  133. package/dist/{multipartBody-DtRWM6_U.mjs → multipartBody-Cc7eZ9cq.mjs} +46 -7
  134. package/dist/node-D8UZv_8c.mjs +41236 -0
  135. package/dist/{openapi-CmFf3yq_.mjs → openapi-CMegfsm8.mjs} +48 -10
  136. package/dist/outbox-admin/index.d.mts +5 -5
  137. package/dist/outbox-admin/index.mjs +6 -18
  138. package/dist/{outbox-module-D2z5WkDY.mjs → outbox-module-Ryk270jd.mjs} +203 -33
  139. package/dist/{outbox-module-BHdUnuuK.d.mts → outbox-module-gZCHoE4H.d.mts} +79 -6
  140. package/dist/permissions/index.d.mts +5 -4
  141. package/dist/permissions/index.mjs +8 -6
  142. package/dist/{permissions-D8TBH44E.mjs → permissions-C5ijIz5Q.mjs} +149 -33
  143. package/dist/{pipe-FMWNheSO.mjs → pipe-D81zMtWs.mjs} +2 -2
  144. package/dist/pipeline/index.d.mts +7 -7
  145. package/dist/pipeline/index.mjs +2 -2
  146. package/dist/plan-CJGMKoui.mjs +565 -0
  147. package/dist/{BaseController-CYEwjyjN.mjs → plugin-DALd9dcF.mjs} +1269 -346
  148. package/dist/plugins/index.d.mts +17 -14
  149. package/dist/plugins/index.mjs +44 -22
  150. package/dist/plugins/response-cache.d.mts +5 -6
  151. package/dist/plugins/response-cache.mjs +8 -14
  152. package/dist/plugins/tracing-entry.mjs +2 -2
  153. package/dist/{pluralize-CXWZIzTv.mjs → pluralize-COUNYo3d.mjs} +1 -1
  154. package/dist/presets/filesUpload.d.mts +8 -8
  155. package/dist/presets/filesUpload.mjs +5 -5
  156. package/dist/presets/index.d.mts +35 -40
  157. package/dist/presets/index.mjs +4 -4
  158. package/dist/presets/multiTenant.d.mts +2 -107
  159. package/dist/presets/multiTenant.mjs +22 -162
  160. package/dist/presets/search.d.mts +9 -10
  161. package/dist/presets/search.mjs +2 -2
  162. package/dist/{presets-ZJSPgmT2.mjs → presets-CONf2Qem.mjs} +99 -107
  163. package/dist/{projection-BzIgzoKZ.mjs → projection-wFoLqdss.mjs} +2 -2
  164. package/dist/{pushref-registry-Dov9l4qE.d.mts → pushref-registry-UxCkoA4C.d.mts} +1 -1
  165. package/dist/{queryCachePlugin-DZHPOm9p.mjs → queryCachePlugin-BATECpyh.mjs} +12 -14
  166. package/dist/{queryCachePlugin-BzqxconG.d.mts → queryCachePlugin-C2lZjTxk.d.mts} +1 -1
  167. package/dist/{rateLimitKey-BvOvcBDi.mjs → rateLimitKey-DVEZ_UpV.mjs} +1 -1
  168. package/dist/{realtime-8tIQWZz4.mjs → realtime-xyubMKSB.mjs} +25 -21
  169. package/dist/{redis-Bzi1y3F9.d.mts → redis-BDgv9Glw.d.mts} +17 -24
  170. package/dist/redis-stream-BMk-bpQS.d.mts +219 -0
  171. package/dist/redisShapes-CQksY67q.d.mts +55 -0
  172. package/dist/registry/index.d.mts +15 -10
  173. package/dist/registry/index.mjs +4 -4
  174. package/dist/{registry-DNkgGQcK.mjs → registry-Bdzg-hdm.mjs} +13 -10
  175. package/dist/{renewingLease-yF8BdW4b.mjs → renewingLease-BFJxGPuh.mjs} +1 -1
  176. package/dist/{replyHelpers-CNdvMfM4.mjs → replyHelpers-Bnc6lJyy.mjs} +2 -2
  177. package/dist/{requestContext-cDkAUr-P.mjs → requestContext-C10UeFe5.mjs} +1 -1
  178. package/dist/requirement-Bu50QALH.mjs +35 -0
  179. package/dist/requirement-CbiLdQ1n.d.mts +22 -0
  180. package/dist/resourceRateLimit-Wf6d6FL9.d.mts +30 -0
  181. package/dist/resourceRateLimit-urWPJxrt.mjs +180 -0
  182. package/dist/rolldown-runtime-MYrLNGnq.mjs +45 -0
  183. package/dist/routeValidator-DHtpzrzk.mjs +70 -0
  184. package/dist/{runtimeCapabilities-CkhS6jn6.mjs → runtimeCapabilities-DIMKMV2G.mjs} +1 -1
  185. package/dist/{schedules-j6uXXAeJ.mjs → schedules-CKTs5ys8.mjs} +46 -37
  186. package/dist/{schemaConverter-BVA7cFRG.mjs → schemaConverter-BVjkQ5DD.mjs} +2 -2
  187. package/dist/{schemaIR-CTvPDoPB.mjs → schemaIR-BA0Hb21Y.mjs} +2 -2
  188. package/dist/schemas/index.d.mts +20 -10
  189. package/dist/schemas/index.mjs +8 -3
  190. package/dist/scim/index.d.mts +13 -13
  191. package/dist/scim/index.mjs +2 -2
  192. package/dist/scope/index.d.mts +4 -4
  193. package/dist/scope/index.mjs +6 -6
  194. package/dist/{scope-BUi1xV1I.mjs → scope-DINaj7Ax.mjs} +4 -4
  195. package/dist/shutdown-LpLMH8T1.mjs +59 -0
  196. package/dist/{simpleEqualityMatcher-C9bzq2gO.mjs → simpleEqualityMatcher-DbwIM1f1.mjs} +1 -1
  197. package/dist/{sse-BeqVKQKu.mjs → sse-BzJFPX_1.mjs} +11 -15
  198. package/dist/{sseStream-Ppzo-WUH.mjs → sseStream-DQChzGTs.mjs} +2 -2
  199. package/dist/{store-helpers-dW71XVWL.mjs → store-helpers-Coj9RhOZ.mjs} +1 -1
  200. package/dist/{streaming-IcRFjWQU.mjs → streaming-JzB5CAga.mjs} +1 -1
  201. package/dist/subscriberIdentity-DeyppIif.mjs +28 -0
  202. package/dist/tenancy-DxV8OuX2.mjs +43 -0
  203. package/dist/tenantPreparation-CBvvAcAj.mjs +67 -0
  204. package/dist/testing/cleanupStoreContract.d.mts +4 -5
  205. package/dist/testing/cleanupStoreContract.mjs +1 -1
  206. package/dist/testing/index.d.mts +215 -197
  207. package/dist/testing/index.mjs +289 -214
  208. package/dist/testing/outboxStoreContract.d.mts +4 -5
  209. package/dist/testing/outboxStoreContract.mjs +137 -2
  210. package/dist/testing/requiredPorts.d.mts +16 -0
  211. package/dist/testing/requiredPorts.mjs +65 -0
  212. package/dist/testing/storageContract.d.mts +4 -5
  213. package/dist/testing/storageContract.mjs +1 -1
  214. package/dist/timing-CntavTlR.mjs +46 -0
  215. package/dist/{transactionContext-CPbdlnVw.mjs → transactionContext-orvnGu4F.mjs} +1 -1
  216. package/dist/{typeGuards-BLjPgVBm.mjs → typeGuards-kEaP_WmO.mjs} +1 -1
  217. package/dist/types/index.d.mts +4 -4
  218. package/dist/types/index.mjs +1 -1
  219. package/dist/types/storage.mjs +1 -1
  220. package/dist/{types-DfVDvkdP.d.mts → types-BJ-2XqVF.d.mts} +189 -204
  221. package/dist/{types-CWQn9-IC.d.mts → types-D3Ixsh00.d.mts} +22 -9
  222. package/dist/{types-CgenB1gv.mjs → types-fvO6Ovzx.mjs} +4 -4
  223. package/dist/usage/index.d.mts +5 -6
  224. package/dist/usage/index.mjs +5 -5
  225. package/dist/{userHelpers-ChRvkuSZ.mjs → userHelpers-C76zD5pa.mjs} +1 -1
  226. package/dist/utils/index.d.mts +125 -264
  227. package/dist/utils/index.mjs +13 -12
  228. package/dist/{utils-CxcctrAh.mjs → utils-BpkVZ8rB.mjs} +315 -404
  229. package/dist/{validate-DrYWnOzI.mjs → validate-CWp-lsrm.mjs} +6 -14
  230. package/dist/{versioning-D6JIK8Tk.d.mts → versioning-Bsb51gGT.d.mts} +28 -13
  231. package/dist/{versioning-DKkT4hNJ.mjs → versioning-CHhL9P3o.mjs} +4 -4
  232. package/dist/{websocket-BOXVggMf.d.mts → websocket-Cs4awVyD.d.mts} +1 -1
  233. package/dist/{workScope-CxKqoIFn.mjs → workScope-n9a7d_lZ.mjs} +2 -2
  234. package/package.json +57 -59
  235. package/skills/arc/SKILL.md +13 -4
  236. package/skills/arc/references/auth.md +8 -5
  237. package/skills/arc/references/integrations.md +1 -1
  238. package/skills/arc/references/mcp.md +8 -6
  239. package/skills/arc/references/multi-tenancy.md +19 -14
  240. package/skills/arc/references/production.md +27 -10
  241. package/dist/actionPermissions-BoPGQ5-4.mjs +0 -350
  242. package/dist/index-CFfLKMH4.d.mts +0 -290
  243. package/dist/interface-YzIbF7Ii.mjs +0 -17
  244. package/dist/redis-stream-BPKscsTB.d.mts +0 -260
  245. package/dist/registerRoute-Bsnk6NiZ.mjs +0 -364
  246. package/dist/rolldown-runtime-eysyzFAF.mjs +0 -15
  247. package/dist/sync/changelog.d.mts +0 -3
  248. package/dist/sync/changelog.mjs +0 -3
@@ -0,0 +1,57 @@
1
+ /*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
2
+ //#region src/collections/boundedMap.ts
3
+ /**
4
+ * Insertion-order LRU on a plain `Map` — the two moves, written once.
5
+ *
6
+ * A `Map` iterates in insertion order, so "move to most-recent" is
7
+ * delete-then-set and "least-recent" is the first key. Seven places in arc
8
+ * hand-rolled that, and hand-rolled copies drifted into real bugs:
9
+ *
10
+ * - the response cache evicted with `while (size >= maxEntries)` BEFORE
11
+ * inserting, so `maxEntries: 0` spun forever on the first write — no key
12
+ * to evict, loop condition never changes, event loop frozen;
13
+ * - `maxEntries: NaN` made the same comparison always false: unbounded;
14
+ * - the MCP auth cache guarded eviction with `if (firstKey)`, a falsy check,
15
+ * so an empty-string key could never be evicted.
16
+ *
17
+ * These are functions over the caller's own `Map`, not a class, on purpose:
18
+ * each site keeps its TTL, byte accounting and stats, and borrows only the
19
+ * part that kept going wrong.
20
+ */
21
+ /** Move `key` to most-recent and set it. Use on read-hit (LRU) or on overwrite. */
22
+ function touch(map, key, value) {
23
+ map.delete(key);
24
+ map.set(key, value);
25
+ }
26
+ /**
27
+ * Evict least-recent entries until `map.size <= maxSize`; returns how many.
28
+ *
29
+ * Call AFTER inserting. That ordering is what makes it total: with
30
+ * `maxSize: 0` the just-inserted entry is evicted (a disabled cache), never an
31
+ * infinite loop, and the loop terminates on the iterator running dry rather
32
+ * than on the size comparison alone. A non-finite or negative `maxSize` is a
33
+ * configuration bug — {@link assertCapacity} it where the option is read.
34
+ */
35
+ function evictToSize(map, maxSize, onEvict) {
36
+ let evicted = 0;
37
+ while (map.size > maxSize) {
38
+ const oldest = map.entries().next();
39
+ if (oldest.done) break;
40
+ const [key, value] = oldest.value;
41
+ map.delete(key);
42
+ onEvict?.(key, value);
43
+ evicted++;
44
+ }
45
+ return evicted;
46
+ }
47
+ /**
48
+ * Validate a capacity option at construction: a non-negative integer. `0` is
49
+ * allowed and means "keep nothing". Throws with the option's name so the error
50
+ * points at the host's config, not at a hang or an unbounded map later.
51
+ */
52
+ function assertCapacity(name, value) {
53
+ if (!Number.isInteger(value) || value < 0) throw new Error(`[arc] ${name} must be a non-negative integer, got ${String(value)}.`);
54
+ return value;
55
+ }
56
+ //#endregion
57
+ export { evictToSize as n, touch as r, assertCapacity as t };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
- import { a as conjoinPolicyFilters } from "./authorizationDecision-DawKGoXb.mjs";
3
- import { g as toRepositoryFilter } from "./BaseController-CYEwjyjN.mjs";
4
- import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-DrYWnOzI.mjs";
1
+ /*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
2
+ import { t as conjoinPolicyFilters } from "./filter-merge-DGM-GQ1J.mjs";
3
+ import { C as toRepositoryFilter } from "./plugin-DALd9dcF.mjs";
4
+ import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-CWp-lsrm.mjs";
5
5
  //#region src/core/aggregation/buildHandler.ts
6
6
  /**
7
7
  * Framework-agnostic aggregation execution. Runs safety guards,
@@ -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
@@ -11,17 +12,18 @@ import { i as queryCachePlugin, n as QueryCacheDefaults, r as QueryCachePluginOp
11
12
  * to ensure multi-tenant isolation and O(1) version-based invalidation.
12
13
  */
13
14
  /** Build a deterministic cache key for a query */
14
- declare function buildQueryKey(resource: string, operation: string, resourceVersion: number, params: Record<string, unknown>, userId?: string, orgId?: string): string;
15
+ export declare function buildQueryKey(resource: string, operation: string, resourceVersion: number, params: Record<string, unknown>, userId?: string, orgId?: string): string;
15
16
  /** Resource version key — stored in CacheStore, bumped on mutations */
16
- declare function versionKey(resource: string): string;
17
+ export declare function versionKey(resource: string): string;
17
18
  /** Tag version key — stored in CacheStore, bumped on cross-resource invalidation */
18
- declare function tagVersionKey(tag: string): string;
19
+ export 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
- declare function hashParams(params: Record<string, unknown>): string;
26
+ export declare function hashParams(params: Record<string, unknown>): string;
25
27
  //#endregion
26
28
  //#region src/cache/memory.d.ts
27
29
  interface MemoryCacheStoreOptions {
@@ -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
  /**
@@ -57,7 +61,7 @@ interface MemoryCacheStoreOptions {
57
61
  * - Entry size guard to avoid runaway memory usage
58
62
  * - Stats tracking for observability
59
63
  */
60
- declare class MemoryCacheStore<TValue = unknown> implements CacheStore<TValue> {
64
+ export declare class MemoryCacheStore<TValue = unknown> implements CacheStore<TValue> {
61
65
  readonly name = "memory-cache";
62
66
  private readonly cache;
63
67
  private readonly defaultTtlSeconds;
@@ -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
  }
@@ -145,7 +149,7 @@ interface RedisCacheStoreOptions {
145
149
  * Suitable for multi-instance and horizontally scaled deployments.
146
150
  * Uses pipeline batching when available for bulk operations.
147
151
  */
148
- declare class RedisCacheStore<TValue = unknown> implements CacheStore<TValue> {
152
+ export declare class RedisCacheStore<TValue = unknown> implements CacheStore<TValue> {
149
153
  readonly name = "redis-cache";
150
154
  private readonly client;
151
155
  private readonly prefix;
@@ -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`.
@@ -216,24 +214,14 @@ interface IoredisLike {
216
214
  * });
217
215
  * ```
218
216
  */
219
- declare function ioredisAsCacheClient(client: IoredisLike): RedisCacheClient;
217
+ export 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`.
@@ -253,6 +241,6 @@ interface UpstashRedisLike {
253
241
  * });
254
242
  * ```
255
243
  */
256
- declare function upstashAsCacheClient(client: UpstashRedisLike): RedisCacheClient;
244
+ export declare function upstashAsCacheClient(client: UpstashRedisLike): RedisCacheClient;
257
245
  //#endregion
258
- export { type CacheEnvelope, type CacheLogger, type CacheResult, type CacheStats, type CacheStatus, type CacheStore, type CrossResourceRule, type IoredisLike, MemoryCacheStore, type MemoryCacheStoreOptions, QueryCache, type QueryCacheConfig, type QueryCacheDefaults, type QueryCachePluginOptions, type RedisCacheClient, RedisCacheStore, type RedisCacheStoreOptions, type RedisPipeline, type UpstashRedisLike, buildQueryKey, hashParams, ioredisAsCacheClient, queryCachePlugin, tagVersionKey, upstashAsCacheClient, versionKey };
246
+ export { type CacheEnvelope, type CacheLogger, type CacheResult, type CacheStats, type CacheStatus, type CacheStore, type CrossResourceRule, type IoredisLike, type MemoryCacheStoreOptions, QueryCache, type QueryCacheConfig, type QueryCacheDefaults, type QueryCachePluginOptions, type RedisCacheClient, type RedisCacheStoreOptions, type RedisPipeline, type UpstashRedisLike, queryCachePlugin };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
- import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-cpZCtcIE.mjs";
3
- import { t as MemoryCacheStore } from "../memory-Iotz0cCx.mjs";
4
- import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-DZHPOm9p.mjs";
1
+ /*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
2
+ import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-CpoiZ8hU.mjs";
3
+ import { t as MemoryCacheStore } from "../memory-CTa5pOCW.mjs";
4
+ import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-BATECpyh.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.1 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-eysyzFAF.mjs";
1
+ /*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
2
+ import { r as __exportAll } from "./rolldown-runtime-MYrLNGnq.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.44.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-WH7xgvxS.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}. */
@@ -39,7 +38,7 @@ interface RecipeFromStepsInput {
39
38
  /** Provider steps in EXECUTION ORDER. */
40
39
  readonly steps: readonly CleanupStep[];
41
40
  }
42
- declare function recipeFromSteps(input: RecipeFromStepsInput): CleanupRecipe;
41
+ export declare function recipeFromSteps(input: RecipeFromStepsInput): CleanupRecipe;
43
42
  //#endregion
44
43
  //#region src/cleanup/errors.d.ts
45
44
  /**
@@ -84,7 +83,7 @@ type CleanupErrorCode =
84
83
  * step 4 of its classifier — a numeric `statusCode` + a separatored domain
85
84
  * `code` maps to that exact status + code on the wire, never `arc.internal_error`).
86
85
  */
87
- declare class CleanupError extends Error {
86
+ export declare class CleanupError extends Error {
88
87
  readonly code: CleanupErrorCode;
89
88
  readonly status: number;
90
89
  /** Alias of {@link status} — the property arc's error handler classifies on. */
@@ -97,11 +96,11 @@ declare class CleanupError extends Error {
97
96
  * durable `cancelRequested` flag is set. NOT a wire error — `processRun`
98
97
  * catches it and CAS-transitions the run to `cancelled`.
99
98
  */
100
- declare class CleanupCancelled extends Error {
99
+ export declare class CleanupCancelled extends Error {
101
100
  readonly runId: string;
102
101
  constructor(runId: string);
103
102
  }
104
- declare const CleanupErrors: {
103
+ export declare const CleanupErrors: {
105
104
  readonly unknownRecipe: (id: string) => CleanupError;
106
105
  readonly duplicateRecipe: (id: string) => CleanupError;
107
106
  readonly unavailable: (id: string, reason: string) => CleanupError;
@@ -132,7 +131,7 @@ declare const CleanupErrors: {
132
131
  * In-memory {@link CleanupRunStore}. Single-process only — see the module
133
132
  * docblock for the production caveat.
134
133
  */
135
- declare class MemoryCleanupRunStore implements CleanupRunStore {
134
+ export declare class MemoryCleanupRunStore implements CleanupRunStore {
136
135
  #private;
137
136
  /** Live run state, keyed by run id. Exposed for tests/inspection. */
138
137
  readonly runs: Map<string, CleanupRun>;
@@ -149,7 +148,7 @@ declare class MemoryCleanupRunStore implements CleanupRunStore {
149
148
  * In-memory {@link CleanupEvidenceStore} — idempotent by
150
149
  * `evidence.operationId`, exactly as the port requires.
151
150
  */
152
- declare class MemoryCleanupEvidenceStore implements CleanupEvidenceStore {
151
+ export declare class MemoryCleanupEvidenceStore implements CleanupEvidenceStore {
153
152
  #private;
154
153
  readonly evidence: PurgeEvidence[];
155
154
  readonly manifests: CleanupManifest[];
@@ -167,7 +166,7 @@ declare class MemoryCleanupEvidenceStore implements CleanupEvidenceStore {
167
166
  * gives you a microtask-deferred in-process queue that DOES auto-run
168
167
  * `processRun` off the request path.
169
168
  */
170
- declare class MemoryCleanupJobQueue implements CleanupJobQueue {
169
+ export declare class MemoryCleanupJobQueue implements CleanupJobQueue {
171
170
  readonly jobs: CleanupJob[];
172
171
  enqueue(job: CleanupJob): Promise<void>;
173
172
  /** Take everything enqueued so far, clearing the buffer. */
@@ -196,19 +195,18 @@ interface CleanupRegistry {
196
195
  * construction if two recipes share an id — a boot-time failure, never a
197
196
  * silent last-wins overwrite.
198
197
  */
199
- declare function createCleanupRegistry(recipes: readonly CleanupRecipe[]): CleanupRegistry;
198
+ export declare function createCleanupRegistry(recipes: readonly CleanupRecipe[]): CleanupRegistry;
200
199
  //#endregion
201
200
  //#region src/cleanup/service.d.ts
202
201
  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,9 +259,7 @@ 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
- declare function createCleanupService(deps: CleanupServiceDeps): CleanupService;
262
+ export declare function createCleanupService(deps: CleanupServiceDeps): CleanupService;
267
263
  //#endregion
268
264
  //#region src/cleanup/module.d.ts
269
265
  interface DataCleanupModuleDeps {
@@ -334,15 +330,15 @@ interface DataCleanupModuleDeps {
334
330
  /** Injected clock (tests). */
335
331
  now?: () => Date;
336
332
  }
337
- declare function createDataCleanupModule(deps: DataCleanupModuleDeps): ArcModule<CleanupService>;
333
+ export declare function createDataCleanupModule(deps: DataCleanupModuleDeps): ArcModule<CleanupService>;
338
334
  //#endregion
339
335
  //#region src/cleanup/plan-digest.d.ts
340
336
  /** `sha256(canonical(planMaterial))` as a hex digest. */
341
- declare function computePlanDigest(plan: Omit<CleanupPlan, "digest">): string;
337
+ export declare function computePlanDigest(plan: Omit<CleanupPlan, "digest">): string;
342
338
  /**
343
339
  * Integrity checksum of a completed manifest (§5). Excludes the digest field
344
340
  * itself. Dates (e.g. `completedAt`) participate via the strict canonicalizer.
345
341
  */
346
- declare function computeManifestDigest(manifest: Record<string, unknown>): string;
342
+ export 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, type CleanupContext, type CleanupErrorCode, 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, type PreviewInput, type PurgeActor, type PurgeEvidence, type PurgeResourceResult, type PurgeStrategyKind, type PurgeVerificationSummary, type RecipeFromStepsInput, type VerificationCheck, type VerificationResult };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
- import { g as getUserId } from "../types-CgenB1gv.mjs";
3
- import { t as defineResource } from "../defineResource-DxkMTjRn.mjs";
4
- import { t as defineModule } from "../module-DpLJG2_N.mjs";
1
+ /*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
2
+ import { g as getUserId } from "../types-fvO6Ovzx.mjs";
3
+ import { t as defineResource } from "../defineResource-gUp9ug66.mjs";
4
+ import { t as defineModule } from "../module--L0iBIZz.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,7 +1,7 @@
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-WH7xgvxS.mjs";
3
3
  //#region src/cli/commands/describe.d.ts
4
- interface DescribedResource {
4
+ export interface DescribedResource {
5
5
  name: string;
6
6
  displayName: string;
7
7
  prefix: 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;
@@ -122,7 +124,7 @@ interface EventDescription {
122
124
  * Hosts that want a JSON dump of one resource without spawning the CLI
123
125
  * can call this directly.
124
126
  */
125
- declare function describeResource(resource: ResourceDefinition<unknown>, module?: string): DescribedResource;
126
- declare function describe(args: string[]): Promise<void>;
127
+ export declare function describeResource(resource: ResourceDefinition<unknown>, module?: string): DescribedResource;
128
+ export declare function describe(args: string[]): Promise<void>;
127
129
  //#endregion
128
- export { describe, describeResource };
130
+ export {};
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "../../constants-D5Ubn1fe.mjs";
3
- import { n as stringifyMeasureMap } from "../../ResourceRegistry-MGpXoxHZ.mjs";
1
+ /*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "../../constants-B2QHb6u6.mjs";
3
+ import { n as stringifyMeasureMap } from "../../ResourceRegistry-DJxHUpE4.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
@@ -6,6 +6,5 @@
6
6
  * Export OpenAPI specification from registered resources.
7
7
  * Requires an entry file that exports defineResource() results.
8
8
  */
9
- declare function exportDocs(args: string[]): Promise<void>;
10
- //#endregion
11
- export { exportDocs };
9
+ export declare function exportDocs(args: string[]): Promise<void>;
10
+ //#endregion
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
- import { t as buildOpenApiSpec } from "../../openapi-CmFf3yq_.mjs";
3
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-ixtfL3J2.mjs";
1
+ /*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
2
+ import { t as buildOpenApiSpec } from "../../openapi-CMegfsm8.mjs";
3
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-MP8xEppu.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
@@ -6,6 +6,5 @@
6
6
  * Health check utility that validates the development environment.
7
7
  * Checks Node.js version, dependencies, configuration, and env variables.
8
8
  */
9
- declare function doctor(_args?: string[]): Promise<void>;
10
- //#endregion
11
- export { doctor };
9
+ export declare function doctor(_args?: string[]): Promise<void>;
10
+ //#endregion
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.44.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,2 @@
1
- /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
- import { t as generate } from "../../generate-BLRf2m3y.mjs";
3
- export { generate };
1
+ /*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
2
+ export { t as generate } from "../../generate-BXKo2Gc8.mjs";