@classytic/arc 2.30.0 → 2.32.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 (242) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +7 -0
  3. package/TRADEMARK.md +22 -0
  4. package/dist/{BaseController-B5DwufbB.mjs → BaseController-Dk34dxhI.mjs} +21 -19
  5. package/dist/{EventTransport-QmY7A258.d.mts → EventTransport-2uVV34WU.d.mts} +1 -0
  6. package/dist/{EventTransport-C6YA8xY9.mjs → EventTransport-BV10D0oG.mjs} +1 -0
  7. package/dist/{HookSystem-WkIougo6.mjs → HookSystem-vimw5D7Z.mjs} +2 -1
  8. package/dist/{QueryCache-DOMT_iq7.d.mts → QueryCache-DFA-QrU9.d.mts} +2 -1
  9. package/dist/{ResourceRegistry-y9Hnypus.mjs → ResourceRegistry-BVr7PgA0.mjs} +18 -15
  10. package/dist/{actionPermissions-CAphcmUG.mjs → actionPermissions-Dti7ebyv.mjs} +1 -0
  11. package/dist/audit/index.d.mts +3 -2
  12. package/dist/audit/index.mjs +2 -1
  13. package/dist/auth/audit.d.mts +1 -0
  14. package/dist/auth/audit.mjs +1 -0
  15. package/dist/auth/index.d.mts +5 -4
  16. package/dist/auth/index.mjs +11 -9
  17. package/dist/auth/redis-session.d.mts +2 -1
  18. package/dist/auth/redis-session.mjs +1 -0
  19. package/dist/{applyPermissionResult-Cf6zUCvb.mjs → authorizationDecision-__T3EJDA.mjs} +19 -10
  20. package/dist/{buildHandler-BYS3Vkfz.mjs → buildHandler-Dn7rzUJo.mjs} +6 -4
  21. package/dist/cache/index.d.mts +4 -3
  22. package/dist/cache/index.mjs +4 -3
  23. package/dist/{caching-_NJeDd1_.mjs → caching-DFJqHyFs.mjs} +2 -1
  24. package/dist/cleanup/index.d.mts +39 -16
  25. package/dist/cleanup/index.mjs +50 -38
  26. package/dist/cli/commands/describe.d.mts +2 -1
  27. package/dist/cli/commands/describe.mjs +4 -5
  28. package/dist/cli/commands/docs.d.mts +1 -0
  29. package/dist/cli/commands/docs.mjs +3 -2
  30. package/dist/cli/commands/doctor.d.mts +1 -0
  31. package/dist/cli/commands/doctor.mjs +1 -0
  32. package/dist/cli/commands/generate.d.mts +2 -1
  33. package/dist/cli/commands/generate.mjs +2 -1
  34. package/dist/cli/commands/init.d.mts +2 -1
  35. package/dist/cli/commands/init.mjs +2 -1
  36. package/dist/cli/commands/introspect.d.mts +1 -0
  37. package/dist/cli/commands/introspect.mjs +2 -1
  38. package/dist/cli/index.d.mts +3 -2
  39. package/dist/cli/index.mjs +3 -2
  40. package/dist/{constants-DNre0wRg.mjs → constants-J99LGTJI.mjs} +1 -0
  41. package/dist/context/index.d.mts +1 -0
  42. package/dist/context/index.mjs +3 -2
  43. package/dist/core/index.d.mts +3 -2
  44. package/dist/core/index.mjs +7 -6
  45. package/dist/{core-poalJLvp.mjs → core-BwwmNSp7.mjs} +3 -2
  46. package/dist/{createActionRouter-BxuywVRB.mjs → createActionRouter-DkJZWo0m.mjs} +14 -10
  47. package/dist/{createAggregationRouter-BiY-lGdY.mjs → createAggregationRouter-B1exOVD8.mjs} +10 -7
  48. package/dist/{createApp-CXrKFciH.mjs → createApp-Bv0m-Q6_.mjs} +625 -229
  49. package/dist/{defineAggregation-ufWjUwml.mjs → defineAggregation-gX4No1gt.mjs} +1 -0
  50. package/dist/{defineResource-CxWqDCAy.mjs → defineResource-XFPPUu2c.mjs} +84 -50
  51. package/dist/discovery/index.d.mts +1 -0
  52. package/dist/discovery/index.mjs +1 -0
  53. package/dist/docs/index.d.mts +3 -2
  54. package/dist/docs/index.mjs +3 -2
  55. package/dist/{elevation-C9s5hFP_.d.mts → elevation-BXCfVcNG.d.mts} +1 -0
  56. package/dist/{elevation-CIz1GjGm.mjs → elevation-DNXXxgjl.mjs} +4 -3
  57. package/dist/encryption/index.d.mts +2 -1
  58. package/dist/encryption/index.mjs +5 -3
  59. package/dist/{errorHandler-Bq2OeEQL.mjs → errorHandler-B2AZUJUj.mjs} +3 -2
  60. package/dist/{errorHandler-C6yv4ZTW.d.mts → errorHandler-CpYUJmPA.d.mts} +1 -0
  61. package/dist/{errors-DHcHVAgk.d.mts → errors-BGdVwP25.d.mts} +1 -0
  62. package/dist/{errors-DkO8Nk6-.mjs → errors-Bh1KK5ps.mjs} +1 -0
  63. package/dist/{eventPlugin-D2NNR4py.mjs → eventPlugin-Dk_TyXeE.mjs} +8 -6
  64. package/dist/{eventPlugin-Bg3cP2_u.d.mts → eventPlugin-GF5nnBIq.d.mts} +2 -1
  65. package/dist/events/index.d.mts +112 -44
  66. package/dist/events/index.mjs +177 -141
  67. package/dist/events/transports/redis-stream-entry.d.mts +2 -1
  68. package/dist/events/transports/redis-stream-entry.mjs +14 -9
  69. package/dist/events/transports/redis.d.mts +2 -1
  70. package/dist/events/transports/redis.mjs +1 -0
  71. package/dist/{externalPaths-BE6wFpYv.d.mts → externalPaths-CmGOxOtD.d.mts} +1 -0
  72. package/dist/factory/index.d.mts +9 -5
  73. package/dist/factory/index.mjs +131 -7
  74. package/dist/fastify-augmentation-BppG5bMT.d.mts +179 -0
  75. package/dist/{fields-CQ_7KQWw.mjs → fields-DEi65pGj.mjs} +6 -10
  76. package/dist/{fields-D3lhgzhD.d.mts → fields-I_EeRWND.d.mts} +1 -0
  77. package/dist/{generate-D0wZupBg.mjs → generate-CRSG0jTv.mjs} +2 -1
  78. package/dist/{generate-BnsL9GBm.d.mts → generate-DCGuEbqI.d.mts} +1 -0
  79. package/dist/{headers-BvlQSDMB.mjs → headers-BXjQYbeC.mjs} +2 -1
  80. package/dist/{health-CB_m4S32.mjs → health-5XnTa2uo.mjs} +1 -0
  81. package/dist/hooks/index.d.mts +2 -1
  82. package/dist/hooks/index.mjs +2 -1
  83. package/dist/idempotency/index.d.mts +3 -2
  84. package/dist/idempotency/index.mjs +8 -5
  85. package/dist/idempotency/redis.d.mts +2 -1
  86. package/dist/idempotency/redis.mjs +1 -0
  87. package/dist/{index-CG4yqMDB.d.mts → index-C-481Zf2.d.mts} +74 -18
  88. package/dist/{index-Q5gzEIWY.d.mts → index-CpzxqePp.d.mts} +107 -32
  89. package/dist/{index-Cx7bro4R.d.mts → index-DXlHwvuE.d.mts} +5 -4
  90. package/dist/index-ZWhLTp_s.d.mts +290 -0
  91. package/dist/{index-Ch16aAah.d.mts → index-zq6VrjaB.d.mts} +122 -15
  92. package/dist/index.d.mts +9 -8
  93. package/dist/index.mjs +11 -10
  94. package/dist/{init-tlRSt667.mjs → init-BbfP8aky.mjs} +25 -27
  95. package/dist/{init-BPEu8cs-.d.mts → init-Cscs4lab.d.mts} +1 -0
  96. package/dist/integrations/event-gateway.d.mts +3 -2
  97. package/dist/integrations/event-gateway.mjs +2 -1
  98. package/dist/integrations/index.d.mts +4 -3
  99. package/dist/integrations/index.mjs +1 -0
  100. package/dist/integrations/jobs/index.d.mts +2 -1
  101. package/dist/integrations/jobs/index.mjs +109 -33
  102. package/dist/integrations/mcp/index.d.mts +6 -6
  103. package/dist/integrations/mcp/index.mjs +2 -1
  104. package/dist/integrations/mcp/testing.d.mts +3 -2
  105. package/dist/integrations/mcp/testing.mjs +2 -2
  106. package/dist/integrations/streamline.d.mts +1 -0
  107. package/dist/integrations/streamline.mjs +3 -2
  108. package/dist/integrations/webhooks.d.mts +1 -0
  109. package/dist/integrations/webhooks.mjs +1 -0
  110. package/dist/integrations/websocket-pushref-redis.d.mts +2 -1
  111. package/dist/integrations/websocket-pushref-redis.mjs +1 -0
  112. package/dist/integrations/websocket-redis.d.mts +2 -1
  113. package/dist/integrations/websocket-redis.mjs +1 -0
  114. package/dist/integrations/websocket.d.mts +3 -2
  115. package/dist/integrations/websocket.mjs +38 -34
  116. package/dist/{interface-BGZCzOGL.d.mts → interface-BOk3YnTz.d.mts} +1 -0
  117. package/dist/{interface-n5hpKg1d.mjs → interface-BP4IJCBO.mjs} +1 -0
  118. package/dist/{interface-Uk8ONJv7.d.mts → interface-DEWNOMza.d.mts} +1 -0
  119. package/dist/{jsonBody-BlzAoGCe.mjs → jsonBody-DDSR2HFl.mjs} +2 -1
  120. package/dist/{keys-Cd316u_y.mjs → keys-B-HBTGXl.mjs} +1 -0
  121. package/dist/{loadResources-DpU8pfjV.mjs → loadResources-DisEAmkm.mjs} +4 -2
  122. package/dist/{loadResourcesFromEntry-kvGT6EcO.mjs → loadResourcesFromEntry-D1MJp13f.mjs} +2 -1
  123. package/dist/logger/index.d.mts +1 -0
  124. package/dist/logger/index.mjs +1 -0
  125. package/dist/{mcpPlugin-nRzm5g2s.mjs → mcpPlugin-CpfVpKHE.mjs} +38 -38
  126. package/dist/{memory-CmnzXE5Z.mjs → memory-DsuWnj4T.mjs} +5 -4
  127. package/dist/{metrics-fdxI5mn_.mjs → metrics-DdQL8syd.mjs} +2 -1
  128. package/dist/middleware/index.d.mts +2 -1
  129. package/dist/middleware/index.mjs +3 -2
  130. package/dist/migrations/index.d.mts +1 -0
  131. package/dist/migrations/index.mjs +3 -2
  132. package/dist/module-Br81am6m.mjs +78 -0
  133. package/dist/{multipartBody-D0eBvkeq.mjs → multipartBody-BnkBLN7v.mjs} +3 -2
  134. package/dist/{openapi-B8Vkbxbn.mjs → openapi-DIRzvxC0.mjs} +6 -5
  135. package/dist/outbox-admin/index.d.mts +85 -0
  136. package/dist/outbox-admin/index.mjs +115 -0
  137. package/dist/permissions/index.d.mts +5 -4
  138. package/dist/permissions/index.mjs +6 -5
  139. package/dist/{permissions-Bfu_8y1U.mjs → permissions-Dl_m0NCe.mjs} +308 -42
  140. package/dist/{pipe-BOLmGIxa.mjs → pipe-ELHCP3zj.mjs} +3 -4
  141. package/dist/pipeline/index.d.mts +2 -1
  142. package/dist/pipeline/index.mjs +2 -1
  143. package/dist/{pipeline-BJnpkY9i.mjs → pipeline-CPA-jx0M.mjs} +17 -14
  144. package/dist/plugins/index.d.mts +8 -7
  145. package/dist/plugins/index.mjs +16 -15
  146. package/dist/plugins/response-cache.d.mts +1 -0
  147. package/dist/plugins/response-cache.mjs +2 -1
  148. package/dist/plugins/tracing-entry.d.mts +2 -1
  149. package/dist/plugins/tracing-entry.mjs +2 -1
  150. package/dist/{pluralize-BhrgwZb9.mjs → pluralize-C2ZkKbsn.mjs} +1 -0
  151. package/dist/{preloadResources-DSY5HGpS.mjs → preloadResources-CDs87fTw.mjs} +1 -0
  152. package/dist/{preloadResources-DCfa2egz.d.mts → preloadResources-T1hmlTEZ.d.mts} +117 -12
  153. package/dist/presets/filesUpload.d.mts +6 -5
  154. package/dist/presets/filesUpload.mjs +10 -12
  155. package/dist/presets/index.d.mts +3 -2
  156. package/dist/presets/index.mjs +2 -1
  157. package/dist/presets/multiTenant.d.mts +2 -1
  158. package/dist/presets/multiTenant.mjs +3 -2
  159. package/dist/presets/search.d.mts +3 -2
  160. package/dist/presets/search.mjs +2 -1
  161. package/dist/{presets-CJOEXLuk.mjs → presets-Dntd_pUO.mjs} +6 -4
  162. package/dist/{projection-UBDgfMwu.mjs → projection-CjHhM5W1.mjs} +2 -1
  163. package/dist/{pushref-registry-BbcnpNTm.d.mts → pushref-registry-Dov9l4qE.d.mts} +1 -0
  164. package/dist/{queryCachePlugin-br4otiqF.d.mts → queryCachePlugin-BzqxconG.d.mts} +3 -2
  165. package/dist/{queryCachePlugin-DSGuSVLW.mjs → queryCachePlugin-Dhps-Ldt.mjs} +6 -5
  166. package/dist/{rateLimit-DrED-C4v.mjs → rateLimit-C7mmAGs3.mjs} +7 -3
  167. package/dist/{rateLimitKey-BoWRH3e7.mjs → rateLimitKey-CccEFBfk.mjs} +1 -0
  168. package/dist/{realtime-B9nmIY5V.mjs → realtime-DVvVZZFz.mjs} +20 -9
  169. package/dist/{redis-UDtLaNj6.d.mts → redis-CduhKsJi.d.mts} +2 -1
  170. package/dist/{redis-stream-uIaauNpZ.d.mts → redis-stream-qN6A-RFv.d.mts} +2 -1
  171. package/dist/{registerRoute-JkxIEBJq.mjs → registerRoute-B_QrjYZS.mjs} +10 -7
  172. package/dist/registry/index.d.mts +3 -2
  173. package/dist/registry/index.mjs +3 -2
  174. package/dist/{registry-BYXUUg21.mjs → registry-DqUmzA9W.mjs} +2 -1
  175. package/dist/{renewingLease-3cuQH7h8.mjs → renewingLease-BpP9wwj7.mjs} +1 -0
  176. package/dist/{replyHelpers-67tRawQZ.mjs → replyHelpers-DS-P0b32.mjs} +2 -1
  177. package/dist/{repositoryFilter-Dz8k3S4P.mjs → repositoryFilter-DotlxG3L.mjs} +1 -0
  178. package/dist/{requestContext-MrlJwECf.mjs → requestContext-B6vQF-sy.mjs} +1 -0
  179. package/dist/{rolldown-runtime-8H4AJuhK.mjs → rolldown-runtime-BhflRrBs.mjs} +1 -0
  180. package/dist/{schedules-CjOd2MG9.mjs → schedules-C2Q3uv2d.mjs} +3 -2
  181. package/dist/{schemaConverter-DJvodiHj.mjs → schemaConverter-Crjvczi_.mjs} +70 -17
  182. package/dist/{schemaIR-Ca7ySNPx.mjs → schemaIR-CnyKK_1j.mjs} +2 -1
  183. package/dist/schemas/index.d.mts +1 -0
  184. package/dist/schemas/index.mjs +1 -0
  185. package/dist/scim/index.d.mts +1 -0
  186. package/dist/scim/index.mjs +2 -1
  187. package/dist/scope/index.d.mts +3 -2
  188. package/dist/scope/index.mjs +5 -4
  189. package/dist/{scope-DfaPntpo.mjs → scope-afz_Ieek.mjs} +4 -3
  190. package/dist/{sessionManager-BHOM3N_0.d.mts → sessionManager-qimlKV0P.d.mts} +1 -0
  191. package/dist/{simpleEqualityMatcher-Cg05HPsn.mjs → simpleEqualityMatcher-C4KiMWUa.mjs} +1 -0
  192. package/dist/{sse-BQ1w0dfl.mjs → sse-B9P4Y-UI.mjs} +7 -5
  193. package/dist/{sseStream-BQ7Qaynp.mjs → sseStream-B3zb_d1h.mjs} +2 -1
  194. package/dist/{storage-DLUZ04kK.d.mts → storage-Cx9Sz3Ou.d.mts} +1 -0
  195. package/dist/{store-helpers-DY6xq4sM.mjs → store-helpers-DmEMHlPQ.mjs} +1 -0
  196. package/dist/{streaming-BQcW6_Kq.mjs → streaming-DPZdQmDz.mjs} +1 -0
  197. package/dist/{subscribe-helpers-DfzsivM6.mjs → subscribe-helpers-sp5xTDVA.mjs} +2 -1
  198. package/dist/sync/changelog.d.mts +1 -0
  199. package/dist/sync/changelog.mjs +1 -0
  200. package/dist/testing/cleanupStoreContract.d.mts +2 -1
  201. package/dist/testing/cleanupStoreContract.mjs +10 -5
  202. package/dist/testing/index.d.mts +166 -12
  203. package/dist/testing/index.mjs +315 -43
  204. package/dist/testing/outboxStoreContract.d.mts +12 -2
  205. package/dist/testing/outboxStoreContract.mjs +110 -20
  206. package/dist/testing/storageContract.d.mts +2 -1
  207. package/dist/testing/storageContract.mjs +11 -5
  208. package/dist/{tracing-CsGKQJGg.d.mts → tracing-Dro5eH6j.d.mts} +1 -0
  209. package/dist/{transactionContext-PNdoyLLm.mjs → transactionContext-BvLKvOIL.mjs} +1 -0
  210. package/dist/{typeGuards-C9KXUly6.mjs → typeGuards-B_5-hKjJ.mjs} +1 -0
  211. package/dist/types/index.d.mts +6 -5
  212. package/dist/types/index.mjs +1 -0
  213. package/dist/types/storage.d.mts +2 -1
  214. package/dist/types/storage.mjs +1 -0
  215. package/dist/{types-ChvvVNP8.d.mts → types-B7XeLEgK.d.mts} +34 -2
  216. package/dist/{types-Cc91nXuA.d.mts → types-ByHn9rEO.d.mts} +1 -0
  217. package/dist/{types-C_ZZRcD6.d.mts → types-C4QE8qnm.d.mts} +1 -0
  218. package/dist/{types-D_n8L6VY.d.mts → types-CT5vu6M0.d.mts} +132 -17
  219. package/dist/{types-DjC-KUCz.d.mts → types-ChuShpCP.d.mts} +1 -0
  220. package/dist/{types-Bmmn-fO0.d.mts → types-CwcUQ610.d.mts} +2 -6
  221. package/dist/{types-CSyCxl2V.mjs → types-DXYX7dIR.mjs} +4 -3
  222. package/dist/usage/index.d.mts +3 -2
  223. package/dist/usage/index.mjs +0 -0
  224. package/dist/{userHelpers-Cg_y3fBz.mjs → userHelpers-BNsOXzOd.mjs} +1 -0
  225. package/dist/utils/index.d.mts +16 -7
  226. package/dist/utils/index.mjs +10 -9
  227. package/dist/{utils-taUVD4p3.mjs → utils-BtOha_Sp.mjs} +3 -2
  228. package/dist/{validate-Bk44F2yT.mjs → validate-PMCPR9El.mjs} +2 -1
  229. package/dist/{versioning-gKWyryT3.mjs → versioning-CKv2jz_U.mjs} +4 -3
  230. package/dist/{versioning-DXgY5BUm.d.mts → versioning-D_rhHfZm.d.mts} +5 -2
  231. package/dist/{websocket-_Pd0CgR0.d.mts → websocket-BOXVggMf.d.mts} +2 -1
  232. package/package.json +557 -539
  233. package/skills/arc/SKILL.md +22 -8
  234. package/skills/arc/references/api-reference.md +4 -0
  235. package/skills/arc/references/auth.md +3 -0
  236. package/skills/arc/references/integrations.md +33 -0
  237. package/skills/arc/references/mcp.md +6 -7
  238. package/skills/arc/references/production.md +24 -25
  239. package/skills/arc-code-review/references/anti-patterns.md +3 -3
  240. package/dist/fastify-augmentation-0WhPnUH7.d.mts +0 -76
  241. package/dist/index-CCzVR-N3.d.mts +0 -107
  242. package/dist/module-_-M7C5ES.mjs +0 -29
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Classytic
3
+ Copyright (c) 2025 Classytic LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -324,3 +324,10 @@ arc doctor # diagnose env
324
324
  ## License
325
325
 
326
326
  MIT
327
+
328
+
329
+ ## Trademark
330
+
331
+ The code is MIT-licensed. **"Classytic", "arc", and the logos are trademarks of
332
+ Classytic LLC** and are **not** licensed under MIT — see [TRADEMARK.md](TRADEMARK.md).
333
+ Forks must be renamed; the license covers the code, not the brand.
package/TRADEMARK.md ADDED
@@ -0,0 +1,22 @@
1
+ # Trademark Notice
2
+
3
+ The **source code** in this package is licensed under the MIT License (see
4
+ [LICENSE](LICENSE)). Trademarks are **not** part of that license.
5
+
6
+ **"Classytic", "arc", the Classytic and arc logos**, and related names and marks
7
+ are trademarks of **Classytic LLC** (Wyoming, USA). The MIT License covers the
8
+ code only — it grants **no right** to use Classytic LLC's names, logos, or brand.
9
+
10
+ ## You may
11
+ - use, fork, modify, and redistribute the **code** under the MIT License;
12
+ - state truthfully that your product "uses" or "is built on" arc / Classytic
13
+ software, without implying endorsement.
14
+
15
+ ## You may not (without written permission from Classytic LLC)
16
+ - use "Classytic", "arc", or confusingly similar names as the name of your own
17
+ product, package, company, or service;
18
+ - use the Classytic / arc logos or brand styling;
19
+ - imply sponsorship, affiliation, or endorsement by Classytic LLC.
20
+
21
+ Forks or redistributions must be **renamed** so they are not confused with the
22
+ official project. Permission / questions: **trademark@classytic.com**.
@@ -1,14 +1,15 @@
1
- import { h as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD } from "./constants-DNre0wRg.mjs";
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
2
+ import { h as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD } from "./constants-J99LGTJI.mjs";
2
3
  import { arcLog } from "./logger/index.mjs";
3
- import { d as createDomainError, f as createError, i as NotFoundError, p as isArcError, r as ForbiddenError } from "./errors-DkO8Nk6-.mjs";
4
- import { n as getUserRoles, t as getUserId } from "./userHelpers-Cg_y3fBz.mjs";
5
- import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-CSyCxl2V.mjs";
6
- import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-Cg05HPsn.mjs";
7
- import { t as toRepositoryFilter } from "./repositoryFilter-Dz8k3S4P.mjs";
8
- import { o as conjoinPolicyFilters } from "./applyPermissionResult-Cf6zUCvb.mjs";
9
- import { i as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-CQ_7KQWw.mjs";
10
- import { g as ArcQueryParser, n as scheduleBackground } from "./utils-taUVD4p3.mjs";
11
- import { t as buildQueryKey } from "./keys-Cd316u_y.mjs";
4
+ import { a as conjoinPolicyFilters } from "./authorizationDecision-__T3EJDA.mjs";
5
+ import { d as createDomainError, f as createError, i as NotFoundError, p as isArcError, r as ForbiddenError } from "./errors-Bh1KK5ps.mjs";
6
+ import { n as getUserRoles, t as getUserId } from "./userHelpers-BNsOXzOd.mjs";
7
+ import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-DXYX7dIR.mjs";
8
+ import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-C4KiMWUa.mjs";
9
+ import { t as toRepositoryFilter } from "./repositoryFilter-DotlxG3L.mjs";
10
+ import { i as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-DEi65pGj.mjs";
11
+ import { g as ArcQueryParser, n as scheduleBackground } from "./utils-BtOha_Sp.mjs";
12
+ import { t as buildQueryKey } from "./keys-B-HBTGXl.mjs";
12
13
  //#region src/core/AccessControl.ts
13
14
  const log$1 = arcLog("access-control");
14
15
  var AccessControl = class {
@@ -33,13 +34,13 @@ var AccessControl = class {
33
34
  * Combines ID filter with policy/org filters for proper security enforcement
34
35
  */
35
36
  buildIdFilter(id, req) {
36
- const filter = { [this.idField]: id };
37
+ let filter = { [this.idField]: id };
37
38
  const arcContext = this._meta(req);
38
39
  const policyFilters = arcContext?._policyFilters;
39
- if (policyFilters) Object.assign(filter, policyFilters);
40
+ if (policyFilters) filter = conjoinPolicyFilters(filter, policyFilters);
40
41
  const scope = arcContext?._scope;
41
42
  const orgId = scope ? getOrgId(scope) : void 0;
42
- if (this.tenantField && orgId && !policyFilters?.[this.tenantField]) filter[this.tenantField] = orgId;
43
+ if (this.tenantField && orgId) filter = conjoinPolicyFilters(filter, { [this.tenantField]: orgId });
43
44
  return toRepositoryFilter(filter);
44
45
  }
45
46
  /**
@@ -286,7 +287,9 @@ var BodySanitizer = class {
286
287
  if (!isElevated(scope)) {
287
288
  const fieldPerms = arcContext?.arc?.fields;
288
289
  if (fieldPerms) {
289
- const effectiveRoles = resolveEffectiveRoles(getUserRoles(req.user), isMember(scope) ? scope.orgRoles : []);
290
+ const globalRoles = getUserRoles(req.user);
291
+ const orgRoles = isMember(scope) ? scope.orgRoles : [];
292
+ const effectiveRoles = resolveEffectiveRoles(globalRoles, orgRoles);
290
293
  const { body: filtered, deniedFields } = applyFieldWritePermissions(sanitized, fieldPerms, effectiveRoles);
291
294
  if (deniedFields.length > 0 && this.onFieldWriteDenied === "reject") throw new ForbiddenError(`Not permitted to write field${deniedFields.length === 1 ? "" : "s"}: ${deniedFields.join(", ")}`);
292
295
  sanitized = filtered;
@@ -1488,10 +1491,8 @@ function BulkMixin(Base) {
1488
1491
  * Returns the merged filter, or `null` when access must be denied.
1489
1492
  */
1490
1493
  buildBulkFilter(userFilter, req) {
1491
- const filter = { ...userFilter };
1492
1494
  const arcContext = this.meta(req);
1493
- const policyFilters = arcContext?._policyFilters;
1494
- if (policyFilters) Object.assign(filter, policyFilters);
1495
+ let filter = conjoinPolicyFilters(userFilter, arcContext?._policyFilters);
1495
1496
  if (this.tenantField) {
1496
1497
  const scope = arcContext?._scope;
1497
1498
  if (!scope) return filter;
@@ -1499,7 +1500,7 @@ function BulkMixin(Base) {
1499
1500
  if (isElevated(scope)) return filter;
1500
1501
  const orgId = getOrgId(scope);
1501
1502
  if (!orgId) return null;
1502
- filter[this.tenantField] = orgId;
1503
+ filter = conjoinPolicyFilters(filter, { [this.tenantField]: orgId });
1503
1504
  }
1504
1505
  return filter;
1505
1506
  }
@@ -1639,7 +1640,8 @@ function SlugMixin(Base) {
1639
1640
  } else throw createError(501, "Slug lookup not implemented — repository needs getBySlug() or getOne()");
1640
1641
  if (!this.accessControl.validateItemAccess(item, req)) {
1641
1642
  const code = item ? "POLICY_FILTERED" : "NOT_FOUND";
1642
- const err = new NotFoundError(this.resourceName ?? "Resource");
1643
+ const resource = this.resourceName ?? "Resource";
1644
+ const err = new NotFoundError(resource);
1643
1645
  err.details = {
1644
1646
  ...err.details ?? {},
1645
1647
  code
@@ -1,3 +1,4 @@
1
+
1
2
  import { DeadLetteredEvent, DomainEvent, DomainEvent as DomainEvent$1, EventHandler, EventHandler as EventHandler$1, EventLogger, EventLogger as EventLogger$1, EventTransport, EventTransport as EventTransport$1, PublishManyResult } from "@classytic/primitives/events";
2
3
  //#region src/events/EventTransport.d.ts
3
4
  interface MemoryEventTransportOptions {
@@ -1,3 +1,4 @@
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
1
2
  import { createEvent, matchEventPattern } from "@classytic/primitives/events";
2
3
  //#region src/events/EventTransport.ts
3
4
  /**
@@ -1,4 +1,5 @@
1
- import { t as buildRequestScopeProjection } from "./projection-UBDgfMwu.mjs";
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
2
+ import { t as buildRequestScopeProjection } from "./projection-CjHhM5W1.mjs";
2
3
  //#region src/hooks/HookSystem.ts
3
4
  /**
4
5
  * Hook System
@@ -1,4 +1,5 @@
1
- import { r as CacheStore } from "./interface-BGZCzOGL.mjs";
1
+
2
+ import { r as CacheStore } from "./interface-BOk3YnTz.mjs";
2
3
  //#region src/cache/QueryCache.d.ts
3
4
  /** Metadata wrapper stored in CacheStore */
4
5
  interface CacheEnvelope<T = unknown> {
@@ -1,4 +1,5 @@
1
- import "./constants-DNre0wRg.mjs";
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
2
+ import "./constants-J99LGTJI.mjs";
2
3
  //#region src/registry/ResourceRegistry.ts
3
4
  /**
4
5
  * Resource Registry
@@ -59,7 +60,7 @@ var ResourceRegistry = class {
59
60
  summary: r.summary,
60
61
  description: r.description,
61
62
  permissions: r.permissions,
62
- raw: r.raw,
63
+ raw: r.rawHandler !== void 0,
63
64
  schema: r.schema
64
65
  })),
65
66
  events: Object.keys(resource.events ?? {}),
@@ -215,22 +216,24 @@ var ResourceRegistry = class {
215
216
  path: r.prefix,
216
217
  operation: "create"
217
218
  });
218
- if (!disabled.has("update")) if (updateMethod === "both") {
219
- routes.push({
220
- method: "PUT",
219
+ if (!disabled.has("update")) {
220
+ if (updateMethod === "both") {
221
+ routes.push({
222
+ method: "PUT",
223
+ path: `${r.prefix}/:id`,
224
+ operation: "update"
225
+ });
226
+ routes.push({
227
+ method: "PATCH",
228
+ path: `${r.prefix}/:id`,
229
+ operation: "update"
230
+ });
231
+ } else routes.push({
232
+ method: updateMethod,
221
233
  path: `${r.prefix}/:id`,
222
234
  operation: "update"
223
235
  });
224
- routes.push({
225
- method: "PATCH",
226
- path: `${r.prefix}/:id`,
227
- operation: "update"
228
- });
229
- } else routes.push({
230
- method: updateMethod,
231
- path: `${r.prefix}/:id`,
232
- operation: "update"
233
- });
236
+ }
234
237
  if (!disabled.has("delete")) routes.push({
235
238
  method: "DELETE",
236
239
  path: `${r.prefix}/:id`,
@@ -1,3 +1,4 @@
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
1
2
  //#region src/core/actionPermissions.ts
2
3
  /**
3
4
  * Return the effective `PermissionCheck` for a single action, or `undefined`
@@ -1,5 +1,6 @@
1
- import "../index-Q5gzEIWY.mjs";
2
- import { a as UserBase } from "../types-ChvvVNP8.mjs";
1
+
2
+ import "../index-CpzxqePp.mjs";
3
+ import { a as UserBase } from "../types-B7XeLEgK.mjs";
3
4
  import { FastifyPluginAsync } from "fastify";
4
5
  import { RepositoryLike } from "@classytic/repo-core/adapter";
5
6
  //#region src/audit/stores/interface.d.ts
@@ -1,4 +1,5 @@
1
- import { t as transactionContext } from "../transactionContext-PNdoyLLm.mjs";
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
2
+ import { t as transactionContext } from "../transactionContext-BvLKvOIL.mjs";
2
3
  import { and, anyOf, eq, gte, lt, lte } from "@classytic/repo-core/filter";
3
4
  import fp from "fastify-plugin";
4
5
  //#region src/audit/repository-audit-adapter.ts
@@ -1,3 +1,4 @@
1
+
1
2
  import { FastifyInstance } from "fastify";
2
3
  //#region src/auth/audit.d.ts
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
1
2
  //#region src/auth/audit.ts
2
3
  function compileGlobs(patterns) {
3
4
  if (patterns.length === 0) return () => false;
@@ -1,7 +1,8 @@
1
- import { Ht as AuthHelpers, Ut as AuthPluginOptions } from "../index-Q5gzEIWY.mjs";
2
- import { r as PermissionCheck } from "../types-ChvvVNP8.mjs";
3
- import { t as ExternalOpenApiPaths } from "../externalPaths-BE6wFpYv.mjs";
4
- import { a as SessionManagerOptions, c as createSessionManager, i as SessionData, n as MemorySessionStoreOptions, o as SessionManagerResult, r as SessionCookieOptions, s as SessionStore, t as MemorySessionStore } from "../sessionManager-BHOM3N_0.mjs";
1
+
2
+ import { Ut as AuthHelpers, Wt as AuthPluginOptions } from "../index-CpzxqePp.mjs";
3
+ import { r as PermissionCheck } from "../types-B7XeLEgK.mjs";
4
+ import { t as ExternalOpenApiPaths } from "../externalPaths-CmGOxOtD.mjs";
5
+ import { a as SessionManagerOptions, c as createSessionManager, i as SessionData, n as MemorySessionStoreOptions, o as SessionManagerResult, r as SessionCookieOptions, s as SessionStore, t as MemorySessionStore } from "../sessionManager-qimlKV0P.mjs";
5
6
  import { FastifyPluginAsync, FastifyReply as FastifyReply$1, FastifyRequest } from "fastify";
6
7
  //#region src/auth/authPlugin.d.ts
7
8
  declare module "fastify" {
@@ -1,8 +1,9 @@
1
- import { d as createDomainError, l as UnauthorizedError, p as isArcError, t as ArcError } from "../errors-DkO8Nk6-.mjs";
2
- import { n as requireSingleHeaderValue } from "../headers-BvlQSDMB.mjs";
3
- import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-Cg_y3fBz.mjs";
4
- import { o as toJsonSchema } from "../schemaConverter-DJvodiHj.mjs";
5
- import { S as requireOrgRole, T as requireTeamMembership, x as requireOrgMembership } from "../permissions-Bfu_8y1U.mjs";
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
2
+ import { d as createDomainError, l as UnauthorizedError, p as isArcError, t as ArcError } from "../errors-Bh1KK5ps.mjs";
3
+ import { n as requireSingleHeaderValue } from "../headers-BXjQYbeC.mjs";
4
+ import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-BNsOXzOd.mjs";
5
+ import { o as toJsonSchema } from "../schemaConverter-Crjvczi_.mjs";
6
+ import { E as requireOrgRole, T as requireOrgMembership, k as requireTeamMembership } from "../permissions-Dl_m0NCe.mjs";
6
7
  import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
7
8
  import fp from "fastify-plugin";
8
9
  //#region src/auth/authPlugin.ts
@@ -345,9 +346,10 @@ function extractBetterAuthOpenApi(authApi, options = {}) {
345
346
  if (excludeServerOnly && endpointOpts.metadata?.SERVER_ONLY) continue;
346
347
  const fullPath = toOpenApiPath(`${normalizedBase}${endpointPath}`);
347
348
  const methods = [];
348
- if (endpointOpts.method) if (Array.isArray(endpointOpts.method)) methods.push(...endpointOpts.method.map((m) => m.toLowerCase()));
349
- else methods.push(endpointOpts.method.toLowerCase());
350
- else methods.push(endpointOpts.body ? "post" : "get");
349
+ if (endpointOpts.method) {
350
+ if (Array.isArray(endpointOpts.method)) methods.push(...endpointOpts.method.map((m) => m.toLowerCase()));
351
+ else methods.push(endpointOpts.method.toLowerCase());
352
+ } else methods.push(endpointOpts.body ? "post" : "get");
351
353
  const openApiMeta = endpointOpts.metadata?.openapi;
352
354
  for (const method of methods) {
353
355
  const operation = {
@@ -1148,7 +1150,7 @@ var MemorySessionStore = class {
1148
1150
  * ```
1149
1151
  */
1150
1152
  function createSessionManager(options) {
1151
- const { store, secret, maxAge: maxAgeSeconds = 10080 * 60, updateAge: updateAgeSeconds = 1440 * 60, freshAge: freshAgeSeconds = 600, cookieName = "arc.session", cookie: cookieOptions = {} } = options;
1153
+ const { store, secret, maxAge: maxAgeSeconds = 604800, updateAge: updateAgeSeconds = 86400, freshAge: freshAgeSeconds = 600, cookieName = "arc.session", cookie: cookieOptions = {} } = options;
1152
1154
  if (secret.length < 32) throw new Error(`Session secret must be at least 32 characters (current: ${secret.length}). Use a strong random secret for production.`);
1153
1155
  const maxAgeMs = maxAgeSeconds * 1e3;
1154
1156
  const updateAgeMs = updateAgeSeconds * 1e3;
@@ -1,4 +1,5 @@
1
- import { i as SessionData, s as SessionStore } from "../sessionManager-BHOM3N_0.mjs";
1
+
2
+ import { i as SessionData, s as SessionStore } from "../sessionManager-qimlKV0P.mjs";
2
3
  //#region src/auth/redis-session.d.ts
3
4
  /** Minimal Redis client interface — compatible with ioredis */
4
5
  interface RedisLike {
@@ -1,3 +1,4 @@
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
1
2
  import sjson from "secure-json-parse";
2
3
  //#region src/auth/redis-session.ts
3
4
  /**
@@ -1,5 +1,6 @@
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
1
2
  import { arcLog } from "./logger/index.mjs";
2
- import { t as ArcError } from "./errors-DkO8Nk6-.mjs";
3
+ import { t as ArcError } from "./errors-Bh1KK5ps.mjs";
3
4
  //#region src/permissions/filter-merge.ts
4
5
  /**
5
6
  * Policy-filter composition — logical AND, never last-writer-wins.
@@ -93,7 +94,7 @@ function conjoinPolicyFilters(base, incoming) {
93
94
  return result;
94
95
  }
95
96
  //#endregion
96
- //#region src/permissions/applyPermissionResult.ts
97
+ //#region src/permissions/authorizationDecision.ts
97
98
  const log = arcLog("permissions:enforce");
98
99
  /**
99
100
  * Normalize a check return into the canonical {@link AuthorizationDecision}.
@@ -102,7 +103,21 @@ const log = arcLog("permissions:enforce");
102
103
  * pipeline only ever handles decisions.
103
104
  */
104
105
  function normalizeToDecision(result) {
105
- return typeof result === "boolean" ? { effect: result ? "allow" : "deny" } : result;
106
+ if (typeof result === "boolean") return { effect: result ? "allow" : "deny" };
107
+ /**
108
+ * A returned object MUST carry an `effect`. Without this guard a foreign shape — the
109
+ * pre-2.30 `{ granted: true }`, a hand-rolled `{ allowed: true }`, a stray Promise
110
+ * someone forgot to await — passed through as a decision with no effect and was read
111
+ * as DENY. A gate that says yes and is silently overruled is the worst available
112
+ * failure: nine `@classytic/arc-*` test suites went red at once and every symptom
113
+ * pointed at authentication rather than at the return shape.
114
+ *
115
+ * Throwing lands in `failed` (fail-closed, still a denial), so behaviour is unchanged
116
+ * for anything already correct — but the reason now names itself instead of hiding.
117
+ */
118
+ const effect = result?.effect;
119
+ if (result === null || typeof result !== "object" || effect !== "allow" && effect !== "deny") throw new Error(`[arc] a permission check returned an unrecognized shape: ${JSON.stringify(result)}. Return a boolean or an AuthorizationDecision ({ effect: 'allow' | 'deny', ... }). The pre-2.30 { granted } shape is no longer accepted — it normalized to a silent deny.`);
120
+ return result;
106
121
  }
107
122
  /**
108
123
  * Run a permission check once and classify the result. The single source of the
@@ -184,12 +199,6 @@ function applyAuthorizationDecision(decision, request) {
184
199
  }
185
200
  }
186
201
  /**
187
- * @deprecated Renamed to {@link applyAuthorizationDecision} — the contract is an
188
- * `AuthorizationDecision`, not a `PermissionResult`. This alias is kept for
189
- * back-compat and will be removed in a future major.
190
- */
191
- const applyPermissionResult = applyAuthorizationDecision;
192
- /**
193
202
  * Max length of a decision `reason` string before we fall back to the
194
203
  * generic default message. Upstream checks can return arbitrary strings; we
195
204
  * clamp to prevent accidental leakage of internal diagnostics or oversized
@@ -254,4 +263,4 @@ async function evaluateAndApplyPermission(check, context, request, reply, opts)
254
263
  return true;
255
264
  }
256
265
  //#endregion
257
- export { normalizeToDecision as a, evaluatePermissionDecision as i, applyPermissionResult as n, conjoinPolicyFilters as o, evaluateAndApplyPermission as r, applyAuthorizationDecision as t };
266
+ export { conjoinPolicyFilters as a, normalizeToDecision as i, evaluateAndApplyPermission as n, evaluatePermissionDecision as r, applyAuthorizationDecision as t };
@@ -1,6 +1,7 @@
1
- import { t as toRepositoryFilter } from "./repositoryFilter-Dz8k3S4P.mjs";
2
- import { o as conjoinPolicyFilters } from "./applyPermissionResult-Cf6zUCvb.mjs";
3
- import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-Bk44F2yT.mjs";
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
2
+ import { a as conjoinPolicyFilters } from "./authorizationDecision-__T3EJDA.mjs";
3
+ import { t as toRepositoryFilter } from "./repositoryFilter-DotlxG3L.mjs";
4
+ import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-PMCPR9El.mjs";
4
5
  //#region src/core/aggregation/buildHandler.ts
5
6
  /**
6
7
  * Framework-agnostic aggregation execution. Runs safety guards,
@@ -26,7 +27,8 @@ async function executeAggregation(normalized, deps, ctx) {
26
27
  status: 400,
27
28
  body: guardError
28
29
  };
29
- const aggReq = compileAggRequest(normalized, conjoinPolicyFilters(extractCallerFilter(query), policyFilter), tenantOptions, query);
30
+ const callerFilter = conjoinPolicyFilters(extractCallerFilter(query), policyFilter);
31
+ const aggReq = compileAggRequest(normalized, callerFilter, tenantOptions, query);
30
32
  if (config.materialized) {
31
33
  const matCtx = {
32
34
  filter: aggReq.filter,
@@ -1,6 +1,7 @@
1
- import { n as CacheStats, r as CacheStore, t as CacheLogger } from "../interface-BGZCzOGL.mjs";
2
- import { a as QueryCacheConfig, i as QueryCache, n as CacheResult, r as CacheStatus, t as CacheEnvelope } from "../QueryCache-DOMT_iq7.mjs";
3
- import { i as queryCachePlugin, n as QueryCacheDefaults, r as QueryCachePluginOptions, t as CrossResourceRule } from "../queryCachePlugin-br4otiqF.mjs";
1
+
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";
4
5
  //#region src/cache/keys.d.ts
5
6
  /**
6
7
  * Cache Key Utilities
@@ -1,6 +1,7 @@
1
- import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-Cd316u_y.mjs";
2
- import { t as MemoryCacheStore } from "../memory-CmnzXE5Z.mjs";
3
- import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-DSGuSVLW.mjs";
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
2
+ import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-B-HBTGXl.mjs";
3
+ import { t as MemoryCacheStore } from "../memory-DsuWnj4T.mjs";
4
+ import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-Dhps-Ldt.mjs";
4
5
  //#region src/cache/redis.ts
5
6
  /**
6
7
  * Redis-backed cache store.
@@ -1,4 +1,5 @@
1
- import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
1
+ /*! @classytic/arc v2.32.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-BhflRrBs.mjs";
2
3
  import fp from "fastify-plugin";
3
4
  //#region src/plugins/caching.ts
4
5
  var caching_exports = /* @__PURE__ */ __exportAll({
@@ -1,6 +1,7 @@
1
- import { L as RequestWithExtras } from "../index-Q5gzEIWY.mjs";
2
- import { A as CleanupWriteFence, C as CleanupResult, D as CleanupRunStore, E as CleanupRunStatus, F as PurgeStrategyKind, I as PurgeVerificationSummary, L as VerificationCheck, M as PurgeActor, N as PurgeEvidence, O as CleanupRunTransitionPatch, P as PurgeResourceResult, R as VerificationResult, 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 DEFAULT_CLEANUP_LIMITS, k as CleanupStepResult, 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 } from "../types-C_ZZRcD6.mjs";
3
- import { t as ArcModule } from "../types-D_n8L6VY.mjs";
1
+
2
+ import { L as RequestWithExtras } from "../index-CpzxqePp.mjs";
3
+ import { A as CleanupWriteFence, C as CleanupResult, D as CleanupRunStore, E as CleanupRunStatus, F as PurgeStrategyKind, I as PurgeVerificationSummary, L as VerificationCheck, M as PurgeActor, N as PurgeEvidence, O as CleanupRunTransitionPatch, P as PurgeResourceResult, R as VerificationResult, 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 DEFAULT_CLEANUP_LIMITS, k as CleanupStepResult, 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 } from "../types-C4QE8qnm.mjs";
4
+ import { t as ArcModule } from "../types-CT5vu6M0.mjs";
4
5
  import { PurgeStrategyKind as PurgeStrategyKind$1 } from "@classytic/primitives/retention";
5
6
  import { canonicalJson } from "@classytic/primitives/canonical";
6
7
  import { CleanupStep } from "@classytic/repo-core/cleanup";
@@ -254,18 +255,44 @@ declare function createCleanupService(deps: CleanupServiceDeps): CleanupService;
254
255
  //#endregion
255
256
  //#region src/cleanup/module.d.ts
256
257
  interface DataCleanupModuleDeps {
257
- /** The recipes this deployment exposes. Ids must be unique (boot-checked). */
258
- recipes: readonly CleanupRecipe[];
259
- /** Durable run store — host-owned persistence (atomic create + CAS transitions). */
260
- runStore: CleanupRunStore;
258
+ /**
259
+ * The recipes this deployment exposes. Ids must be unique (boot-checked).
260
+ *
261
+ * May be a THUNK, and for any host whose recipes are built from live engines it
262
+ * should be. Resolved once, inside `bootstrap` — i.e. after arc has validated the
263
+ * module graph and run every module's bootstrap — instead of while this factory
264
+ * runs during composition.
265
+ *
266
+ * Why that matters beyond tidiness: a host assembles cleanup recipes by folding
267
+ * over its composed modules and calling their `preLivePurge()` / `cleanupSteps()`
268
+ * arms, and those arms read `engine.repositories`. An array forces that fold at
269
+ * composition time, which in turn forces every contributing domain to allocate its
270
+ * engine before arc owns the lifecycle — so a graph that then fails validation
271
+ * leaks every engine built up to that point. A thunk breaks that chain.
272
+ */
273
+ recipes: readonly CleanupRecipe[] | (() => readonly CleanupRecipe[] | Promise<readonly CleanupRecipe[]>);
274
+ /**
275
+ * Durable run store — host-owned persistence (atomic create + CAS transitions).
276
+ *
277
+ * Accepts a THUNK for the same reason `recipes` does. A store is backed by a
278
+ * model, and constructing it registers that model — so an eager value forces
279
+ * the host to register `CleanupRun` (and its siblings below) while the module
280
+ * graph is still being composed, before arc has validated it or opened the
281
+ * connection. Everything here is read inside `service()`, which is built on
282
+ * first use at `bootstrap`, so deferral costs nothing.
283
+ */
284
+ runStore: CleanupRunStore | (() => CleanupRunStore | Promise<CleanupRunStore>);
261
285
  /** Durable evidence + manifest store — host-owned, idempotent by operationId. */
262
- evidenceStore: CleanupEvidenceStore;
286
+ evidenceStore: CleanupEvidenceStore | (() => CleanupEvidenceStore | Promise<CleanupEvidenceStore>);
263
287
  /** Permission checks for view / execute / manage. */
264
288
  permissions: CleanupPermissions;
265
- /** Optional write fence (§8). */
266
- writeFence?: CleanupWriteFence | undefined;
267
- /** Optional durable job queue (§8) — defaults to microtask-deferred in-process. */
268
- jobQueue?: CleanupJobQueue | undefined;
289
+ /** Optional write fence (§8). Thunk-friendly — see {@link runStore}. */
290
+ writeFence?: CleanupWriteFence | (() => CleanupWriteFence | Promise<CleanupWriteFence>) | undefined;
291
+ /**
292
+ * Optional durable job queue (§8) — defaults to microtask-deferred in-process.
293
+ * Thunk-friendly — see {@link runStore}.
294
+ */
295
+ jobQueue?: CleanupJobQueue | (() => CleanupJobQueue | Promise<CleanupJobQueue>) | undefined;
269
296
  /** Framework size caps. */
270
297
  limits?: Partial<CleanupLimits> | undefined;
271
298
  /** Exclusive worker-lease duration (ms). Default 5 minutes. */
@@ -295,10 +322,6 @@ interface DataCleanupModuleDeps {
295
322
  /** Injected clock (tests). */
296
323
  now?: () => Date;
297
324
  }
298
- /**
299
- * Build the Data Cleanup Center Arc module. The module's public export is the
300
- * live {@link CleanupService} (so other modules / tests can drive it directly).
301
- */
302
325
  declare function createDataCleanupModule(deps: DataCleanupModuleDeps): ArcModule<CleanupService>;
303
326
  //#endregion
304
327
  //#region src/cleanup/plan-digest.d.ts