@classytic/arc 2.45.1 → 2.46.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 (321) hide show
  1. package/README.md +1 -1
  2. package/dist/{EventTransport-CiicKz2Z.d.mts → EventTransport-CYEoCJGe.d.mts} +0 -2
  3. package/dist/{EventTransport-4b0noGwa.mjs → EventTransport-DNgD9NP4.mjs} +3 -4
  4. package/dist/{HookSystem-4pABQnGn.mjs → HookSystem-DRbPzEcP.mjs} +3 -4
  5. package/dist/{QueryCache--5uAuYPW.d.mts → QueryCache-DdvrGG8Q.d.mts} +1 -3
  6. package/dist/{ResourceRegistry-BBaN_Ne-.mjs → ResourceRegistry-Douk51fa.mjs} +15 -4
  7. package/dist/{acquire-kiZzy5bX.mjs → acquire-RbtvDg9s.mjs} +2 -3
  8. package/dist/{actionPermissions-BLnbDA6g.mjs → actionPermissions-De0AJ7hm.mjs} +37 -42
  9. package/dist/audit/index.d.mts +2 -10
  10. package/dist/audit/index.mjs +8 -12
  11. package/dist/auth/audit.d.mts +0 -2
  12. package/dist/auth/audit.mjs +2 -3
  13. package/dist/auth/index.d.mts +9 -17
  14. package/dist/auth/index.mjs +26 -29
  15. package/dist/auth/redis-session.d.mts +2 -4
  16. package/dist/auth/redis-session.mjs +2 -3
  17. package/dist/{authorizationDecision-CVlaTjAX.mjs → authorizationDecision-DeZMrHcm.mjs} +5 -6
  18. package/dist/{base-CZyixEQR.d.mts → base-HXNgPQww.d.mts} +1 -7
  19. package/dist/{boundedMap-DSy7KkeX.mjs → boundedMap-2WBh3gM9.mjs} +2 -3
  20. package/dist/{buildHandler-B4IhILv9.mjs → buildHandler-DxVOOBpw.mjs} +5 -6
  21. package/dist/cache/index.d.mts +4 -10
  22. package/dist/cache/index.mjs +5 -6
  23. package/dist/{caching-DqakP2vY.mjs → caching-BYRwYrUo.mjs} +3 -4
  24. package/dist/{claimed-XoiVrWZ2.mjs → claimed-DYlELdnm.mjs} +2 -3
  25. package/dist/cleanup/index.d.mts +9 -18
  26. package/dist/cleanup/index.mjs +12 -20
  27. package/dist/cli/commands/describe.d.mts +1 -3
  28. package/dist/cli/commands/describe.mjs +4 -5
  29. package/dist/cli/commands/docs.d.mts +1 -3
  30. package/dist/cli/commands/docs.mjs +4 -5
  31. package/dist/cli/commands/doctor.d.mts +1 -3
  32. package/dist/cli/commands/doctor.mjs +2 -3
  33. package/dist/cli/commands/generate.d.mts +1 -1
  34. package/dist/cli/commands/generate.mjs +2 -2
  35. package/dist/cli/commands/init.d.mts +1 -1
  36. package/dist/cli/commands/init.mjs +2 -2
  37. package/dist/cli/commands/introspect.d.mts +1 -3
  38. package/dist/cli/commands/introspect.mjs +3 -4
  39. package/dist/cli/index.d.mts +2 -2
  40. package/dist/cli/index.mjs +3 -3
  41. package/dist/{constants-CtWkmWn3.mjs → constants-CHZMUwBW.mjs} +2 -3
  42. package/dist/context/index.d.mts +0 -8
  43. package/dist/context/index.mjs +6 -7
  44. package/dist/core/index.d.mts +3 -3
  45. package/dist/core/index.mjs +8 -8
  46. package/dist/{core-Cro2v5a7.mjs → core-D9rS2BxO.mjs} +9 -12
  47. package/dist/{createActionRouter-k-gwiPv6.mjs → createActionRouter-0qkCRzTL.mjs} +7 -8
  48. package/dist/{createAggregationRouter-BqWqhAPG.mjs → createAggregationRouter-CUf5Esd9.mjs} +9 -10
  49. package/dist/{createApp-Dw7L72Hz.mjs → createApp-DZIXfDKD.mjs} +49 -62
  50. package/dist/{createMcpServer-DSztofa9.d.mts → createMcpServer-DeVpqQF-.d.mts} +1 -3
  51. package/dist/{defineAggregation-pxbd7BBK.mjs → defineAggregation-bmKQ4NmC.mjs} +2 -3
  52. package/dist/{defineResource-DwgEjLCO.mjs → defineResource-CGmdmGwh.mjs} +78 -29
  53. package/dist/discovery/index.d.mts +1 -3
  54. package/dist/discovery/index.mjs +2 -3
  55. package/dist/docs/index.d.mts +8 -8
  56. package/dist/docs/index.mjs +4 -5
  57. package/dist/{elevation-B9wF2Z1F.mjs → elevation-CzhqAyVN.mjs} +9 -10
  58. package/dist/{elevation-BW2J3tNj.d.mts → elevation-DPD0hcU-.d.mts} +0 -2
  59. package/dist/encryption/index.d.mts +1 -7
  60. package/dist/encryption/index.mjs +8 -13
  61. package/dist/{errorHandler--4rSMMvq.d.mts → errorHandler-B9r88jZV.d.mts} +8 -3
  62. package/dist/{errorHandler-Dr2nG0Ui.mjs → errorHandler-dFyGOEoB.mjs} +16 -6
  63. package/dist/{errors-BtHzrSA6.mjs → errors-BY8vzlP4.mjs} +2 -3
  64. package/dist/{errors-JYc9vwqE.d.mts → errors-DTo0me1o.d.mts} +0 -2
  65. package/dist/{eventPlugin-BtmA4-3P.d.mts → eventPlugin-BY38F6yK.d.mts} +1 -7
  66. package/dist/{eventPlugin-Dvs7OBw8.mjs → eventPlugin-eMhAPtQA.mjs} +10 -12
  67. package/dist/{eventTypes-BVoCTG5c.mjs → eventTypes-Do2KYeJx.mjs} +5 -8
  68. package/dist/events/index.d.mts +4 -16
  69. package/dist/events/index.mjs +8 -9
  70. package/dist/events/transports/redis-stream-entry.d.mts +1 -1
  71. package/dist/events/transports/redis-stream-entry.mjs +5 -6
  72. package/dist/events/transports/redis.d.mts +2 -4
  73. package/dist/events/transports/redis.mjs +3 -4
  74. package/dist/{externalPaths-CmGOxOtD.d.mts → externalPaths-BOqdq5wr.d.mts} +0 -2
  75. package/dist/factory/index.d.mts +4 -14
  76. package/dist/factory/index.mjs +12 -18
  77. package/dist/{fastify-augmentation-DRlCIWE9.d.mts → fastify-augmentation-Dtn0IIRn.d.mts} +4 -10
  78. package/dist/{fields-BBSpf8pS.d.mts → fields-JTkrtO-r.d.mts} +0 -2
  79. package/dist/{fields-C1e_7Fwi.mjs → fields-LnbCcvsw.mjs} +2 -3
  80. package/dist/{filter-merge-xaiEKtz8.mjs → filter-merge-BAWi019Q.mjs} +2 -3
  81. package/dist/{generate-DCGuEbqI.d.mts → generate-C-g_KOkV.d.mts} +0 -4
  82. package/dist/{generate-DJiJMaXN.mjs → generate-oXoDnpJf.mjs} +7 -12
  83. package/dist/{headers-Dr-wt6Tr.mjs → headers-DBd3Qheo.mjs} +3 -4
  84. package/dist/{health-DkkWbJtQ.mjs → health-BlJu9GXS.mjs} +2 -3
  85. package/dist/{health-BLYn_Hds.mjs → health-Dp-3EC9o.mjs} +4 -7
  86. package/dist/hooks/index.d.mts +1 -1
  87. package/dist/hooks/index.mjs +2 -2
  88. package/dist/idempotency/index.d.mts +3 -9
  89. package/dist/idempotency/index.mjs +10 -13
  90. package/dist/idempotency/redis.d.mts +1 -1
  91. package/dist/idempotency/redis.mjs +3 -4
  92. package/dist/{index-Bxriq3so.d.mts → index-B5i9-vuP.d.mts} +4 -26
  93. package/dist/{index-Chgz3d0i.d.mts → index-BAXDo5eE.d.mts} +1 -7
  94. package/dist/{index-Beg3aNnK.d.mts → index-BTxzJ_MN.d.mts} +67 -25
  95. package/dist/{index-CUJvoyw3.d.mts → index-Bqfo8hLz.d.mts} +2 -24
  96. package/dist/{index-uhkUA5-U.d.mts → index-CUdaoCYt.d.mts} +13 -23
  97. package/dist/{index-WH7xgvxS.d.mts → index-DyJFTJLA.d.mts} +31 -92
  98. package/dist/index.d.mts +7 -9
  99. package/dist/index.mjs +12 -13
  100. package/dist/{init-CW3kJqNW.mjs → init-BOaNkLYb.mjs} +18 -35
  101. package/dist/{init-Cscs4lab.d.mts → init-CV2_Fw3H.d.mts} +0 -4
  102. package/dist/integrations/event-gateway.d.mts +3 -5
  103. package/dist/integrations/event-gateway.mjs +3 -4
  104. package/dist/integrations/index.d.mts +3 -3
  105. package/dist/integrations/index.mjs +1 -1
  106. package/dist/integrations/jobs/index.d.mts +1 -1
  107. package/dist/integrations/jobs/index.mjs +7 -11
  108. package/dist/integrations/mcp/index.d.mts +7 -39
  109. package/dist/integrations/mcp/index.mjs +8 -14
  110. package/dist/integrations/mcp/testing.d.mts +3 -5
  111. package/dist/integrations/mcp/testing.mjs +3 -4
  112. package/dist/integrations/streamline.d.mts +1 -3
  113. package/dist/integrations/streamline.mjs +4 -5
  114. package/dist/integrations/webhooks.d.mts +2 -4
  115. package/dist/integrations/webhooks.mjs +4 -5
  116. package/dist/integrations/websocket-pushref-redis.d.mts +2 -4
  117. package/dist/integrations/websocket-pushref-redis.mjs +2 -3
  118. package/dist/integrations/websocket-redis.d.mts +2 -4
  119. package/dist/integrations/websocket-redis.mjs +2 -3
  120. package/dist/integrations/websocket.d.mts +2 -2
  121. package/dist/integrations/websocket.mjs +13 -24
  122. package/dist/{interface-JJzwH4Ro.d.mts → interface-BmExzQRD.d.mts} +0 -2
  123. package/dist/{interface-BOk3YnTz.d.mts → interface-WR1U0K7t.d.mts} +0 -2
  124. package/dist/{jsonBody-DPU8yYwA.mjs → jsonBody-DpRpKR_K.mjs} +3 -4
  125. package/dist/{keys-Dgn6OYhl.mjs → keys-FBz6Ull-.mjs} +2 -3
  126. package/dist/{loadResources-BtKj6P1P.mjs → loadResources-Bx1sKPnF.mjs} +4 -5
  127. package/dist/{loadResourcesFromEntry-Bmq6TnB7.mjs → loadResourcesFromEntry-b_jcqbxh.mjs} +3 -4
  128. package/dist/logger/index.d.mts +1 -3
  129. package/dist/logger/index.mjs +2 -2
  130. package/dist/{logger-qQNLlOAU.mjs → logger-CbFcIEBZ.mjs} +3 -5
  131. package/dist/{mcpPlugin-DDfe8jAP.mjs → mcpPlugin-yix548XX.mjs} +41 -60
  132. package/dist/{memory-C0Blueoh.mjs → memory-Bgw5dn8N.mjs} +4 -5
  133. package/dist/{metrics-DYka72iN.mjs → metrics-CZDQWVjS.mjs} +4 -5
  134. package/dist/middleware/index.d.mts +1 -5
  135. package/dist/middleware/index.mjs +4 -5
  136. package/dist/migrations/index.d.mts +0 -2
  137. package/dist/migrations/index.mjs +3 -4
  138. package/dist/{module-BszSyWbd.mjs → module-Dsc_nKL5.mjs} +2 -3
  139. package/dist/{multiTenant-CAtYlW6H.d.mts → multiTenant-XCxAUlru.d.mts} +1 -5
  140. package/dist/{multipartBody-RHvIkNmc.mjs → multipartBody-B85ek8Kj.mjs} +2 -3
  141. package/dist/observeSend-BK-JN1jK.mjs +20 -0
  142. package/dist/{openapi-BrFPc3Ny.mjs → openapi-Co7hl073.mjs} +18 -28
  143. package/dist/outbox-admin/index.d.mts +2 -4
  144. package/dist/outbox-admin/index.mjs +6 -7
  145. package/dist/{outbox-module-gZCHoE4H.d.mts → outbox-module-XvUThpqn.d.mts} +2 -8
  146. package/dist/{outbox-module-DF4Bu_Qa.mjs → outbox-module-mg9kDYkd.mjs} +13 -17
  147. package/dist/permissions/index.d.mts +4 -4
  148. package/dist/permissions/index.mjs +7 -7
  149. package/dist/{permissions-DN1CWH56.mjs → permissions-A1oKtpiC.mjs} +19 -29
  150. package/dist/{pipe-B8uq865o.mjs → pipe-Czpw9U2n.mjs} +3 -4
  151. package/dist/pipeline/index.d.mts +1 -9
  152. package/dist/pipeline/index.mjs +5 -8
  153. package/dist/{plan-DUGfynNg.mjs → plan-KVseuBCL.mjs} +5 -9
  154. package/dist/{plugin-ByU3h-bR.mjs → plugin-DTWt_8C3.mjs} +130 -62
  155. package/dist/plugins/index.d.mts +8 -16
  156. package/dist/plugins/index.mjs +22 -26
  157. package/dist/plugins/response-cache.d.mts +2 -4
  158. package/dist/plugins/response-cache.mjs +10 -10
  159. package/dist/plugins/tracing-entry.d.mts +1 -1
  160. package/dist/plugins/tracing-entry.mjs +3 -4
  161. package/dist/{pluralize-Cdya8zYt.mjs → pluralize-msB9X3yw.mjs} +2 -3
  162. package/dist/presets/filesUpload.d.mts +4 -6
  163. package/dist/presets/filesUpload.mjs +6 -7
  164. package/dist/presets/index.d.mts +3 -19
  165. package/dist/presets/index.mjs +2 -2
  166. package/dist/presets/multiTenant.d.mts +1 -1
  167. package/dist/presets/multiTenant.mjs +7 -7
  168. package/dist/presets/search.d.mts +3 -5
  169. package/dist/presets/search.mjs +3 -4
  170. package/dist/{presets-CCOlKTZw.mjs → presets-qKCehiJM.mjs} +11 -18
  171. package/dist/{projection-BGty6ie4.mjs → projection-ClBqtsIw.mjs} +3 -4
  172. package/dist/{pushref-registry-UxCkoA4C.d.mts → pushref-registry-d86QUaSq.d.mts} +0 -6
  173. package/dist/{queryCachePlugin-B7itTkWu.mjs → queryCachePlugin-3gJj5Rbz.mjs} +8 -10
  174. package/dist/{queryCachePlugin-C2lZjTxk.d.mts → queryCachePlugin-DYQUyeJ9.d.mts} +2 -4
  175. package/dist/{rateLimitKey-DBWO59H9.mjs → rateLimitKey-Kro---xl.mjs} +2 -3
  176. package/dist/{realtime-_59Rlje8.mjs → realtime-Ber8uJN2.mjs} +17 -19
  177. package/dist/{redis-BDgv9Glw.d.mts → redis-RpDMemdm.d.mts} +2 -4
  178. package/dist/{redis-stream-BMk-bpQS.d.mts → redis-stream-CS1N9dwM.d.mts} +1 -3
  179. package/dist/{redisShapes-CQksY67q.d.mts → redisShapes-CqBXTn_s.d.mts} +0 -2
  180. package/dist/registry/index.d.mts +2 -12
  181. package/dist/registry/index.mjs +3 -3
  182. package/dist/{registry-uG4wr541.mjs → registry-BA-_vFYk.mjs} +7 -12
  183. package/dist/{renewingLease-CiU3ZynH.mjs → renewingLease-CMY8YOcc.mjs} +2 -3
  184. package/dist/{replyHelpers-Dr2pnXZg.mjs → replyHelpers-DK9P_XSz.mjs} +3 -4
  185. package/dist/{requestContext-DBKIdmDi.mjs → requestContext-GYO_0gEw.mjs} +2 -3
  186. package/dist/{requirement-CbiLdQ1n.d.mts → requirement-CTRQjjQx.d.mts} +0 -2
  187. package/dist/{requirement-DxOaghWD.mjs → requirement-DeNjZIH3.mjs} +2 -3
  188. package/dist/{resourceRateLimit-Wf6d6FL9.d.mts → resourceRateLimit-DCWglD7V.d.mts} +1 -3
  189. package/dist/{resourceRateLimit-BBdj5yRq.mjs → resourceRateLimit-tHLbrtWc.mjs} +3 -4
  190. package/dist/{rolldown-runtime-DpVPUeXF.mjs → rolldown-runtime-Kv1fZdLg.mjs} +2 -3
  191. package/dist/{routeValidator-BNTqM1Eh.mjs → routeValidator-C_H5NanI.mjs} +2 -3
  192. package/dist/{runtimeCapabilities-D_3eUO6V.mjs → runtimeCapabilities-DWqbxkyw.mjs} +2 -3
  193. package/dist/{schedules-CVS7c1nv.mjs → schedules-eO_RzhCU.mjs} +132 -9
  194. package/dist/{schemaConverter-BQbg7loK.mjs → schemaConverter-DBJrPZN4.mjs} +3 -4
  195. package/dist/{schemaIR-CUI3hPQR.mjs → schemaIR-CEScKT2v.mjs} +3 -4
  196. package/dist/schemas/index.d.mts +0 -2
  197. package/dist/schemas/index.mjs +2 -3
  198. package/dist/scim/index.d.mts +0 -12
  199. package/dist/scim/index.mjs +10 -18
  200. package/dist/scope/index.d.mts +2 -6
  201. package/dist/scope/index.mjs +5 -5
  202. package/dist/{scope-DFXngazv.mjs → scope-B-Sm9m_E.mjs} +5 -6
  203. package/dist/{sessionManager-qimlKV0P.d.mts → sessionManager-CdvDF04x.d.mts} +2 -4
  204. package/dist/{shutdown-BCXCwghd.mjs → shutdown-DzLFbe27.mjs} +2 -3
  205. package/dist/{simpleEqualityMatcher-5jOzYQ_L.mjs → simpleEqualityMatcher-DOJhwQ8g.mjs} +2 -3
  206. package/dist/{sse-BilBz766.mjs → sse-2972pVwV.mjs} +8 -9
  207. package/dist/{sseStream-BG_uJL6J.mjs → sseStream-AWLEeNV-.mjs} +3 -4
  208. package/dist/{storage-Cx9Sz3Ou.d.mts → storage-odC5MNKN.d.mts} +0 -2
  209. package/dist/{store-helpers-CzLZdVa1.mjs → store-helpers-VzjgVTkM.mjs} +2 -3
  210. package/dist/{streaming-DgUvMWlv.mjs → streaming-DvraWW6x.mjs} +2 -3
  211. package/dist/{subscriberIdentity-EWnIZ-U8.mjs → subscriberIdentity-Bya56jsg.mjs} +2 -3
  212. package/dist/{tenancy-CVMvO5DH.mjs → tenancy-DSa_0hhw.mjs} +3 -4
  213. package/dist/{tenantPreparation-DIH-GX4g.mjs → tenantPreparation-BrpkQre3.mjs} +5 -6
  214. package/dist/testing/cleanupStoreContract.d.mts +2 -4
  215. package/dist/testing/cleanupStoreContract.mjs +2 -3
  216. package/dist/testing/index.d.mts +6 -32
  217. package/dist/testing/index.mjs +24 -37
  218. package/dist/testing/outboxStoreContract.d.mts +1 -3
  219. package/dist/testing/outboxStoreContract.mjs +3 -4
  220. package/dist/testing/requiredPorts.d.mts +2 -4
  221. package/dist/testing/requiredPorts.mjs +3 -4
  222. package/dist/testing/storageContract.d.mts +2 -4
  223. package/dist/testing/storageContract.mjs +2 -3
  224. package/dist/{timing-q9NITK04.mjs → timing-6rQTuCwg.mjs} +3 -5
  225. package/dist/{tracing-Dro5eH6j.d.mts → tracing-JSFiBl5r.d.mts} +0 -2
  226. package/dist/{transactionContext-NHmhDIOF.mjs → transactionContext-DaxYUEgH.mjs} +2 -3
  227. package/dist/{typeGuards-CPYR9RCg.mjs → typeGuards-UKnX8wPX.mjs} +2 -3
  228. package/dist/types/index.d.mts +4 -4
  229. package/dist/types/index.mjs +1 -1
  230. package/dist/types/storage.d.mts +1 -1
  231. package/dist/types/storage.mjs +1 -1
  232. package/dist/{types-ByHn9rEO.d.mts → types-0Dqlbgn8.d.mts} +0 -2
  233. package/dist/{types-D3Ixsh00.d.mts → types-BYEb_dLW.d.mts} +2 -4
  234. package/dist/{types-BJ-2XqVF.d.mts → types-BeEJm-DV.d.mts} +114 -14
  235. package/dist/{types-DVLddu2q.d.mts → types-C0YJAiL0.d.mts} +0 -2
  236. package/dist/{types-BI4sbUJ3.mjs → types-CuGjhn83.mjs} +5 -6
  237. package/dist/{types-Ddl9OjmE.d.mts → types-DnkIALZ8.d.mts} +0 -4
  238. package/dist/usage/index.d.mts +2 -10
  239. package/dist/usage/index.mjs +8 -12
  240. package/dist/{userHelpers-oBTU3a_k.mjs → userHelpers-oX5_mOVs.mjs} +2 -3
  241. package/dist/utils/index.d.mts +5 -39
  242. package/dist/utils/index.mjs +12 -12
  243. package/dist/{utils-BmE8zRrh.mjs → utils-CjjGOT4E.mjs} +20 -30
  244. package/dist/{validate-Dby08LhR.mjs → validate-4RlTKOJb.mjs} +5 -7
  245. package/dist/{versioning-P6JMNcJr.mjs → versioning-Dk2-19La.mjs} +4 -5
  246. package/dist/{versioning-Bqm_57Qt.d.mts → versioning-S18y2-0C.d.mts} +1 -15
  247. package/dist/{websocket-Cs4awVyD.d.mts → websocket-BGuc-WVZ.d.mts} +1 -15
  248. package/dist/{workScope-BcMLKa3G.mjs → workScope-DoBsoVo4.mjs} +3 -4
  249. package/llms.txt +37 -30
  250. package/package.json +9 -8
  251. package/skills/arc/SKILL.md +65 -844
  252. package/skills/arc/references/agent-auth.md +82 -193
  253. package/skills/arc/references/api-reference.md +41 -245
  254. package/skills/arc/references/auth-api-keys.md +99 -0
  255. package/skills/arc/references/auth-better-auth-overlay.md +87 -0
  256. package/skills/arc/references/auth-better-auth.md +78 -0
  257. package/skills/arc/references/auth-permissions.md +100 -0
  258. package/skills/arc/references/auth-strategies.md +122 -0
  259. package/skills/arc/references/boot.md +80 -0
  260. package/skills/arc/references/enterprise-auth.md +65 -81
  261. package/skills/arc/references/events-outbox.md +90 -0
  262. package/skills/arc/references/events.md +75 -440
  263. package/skills/arc/references/integrations-jobs.md +74 -0
  264. package/skills/arc/references/integrations-realtime.md +84 -0
  265. package/skills/arc/references/integrations-webhooks.md +71 -0
  266. package/skills/arc/references/integrations-workflows.md +47 -0
  267. package/skills/arc/references/mcp-auth.md +83 -0
  268. package/skills/arc/references/mcp-custom-tools.md +125 -0
  269. package/skills/arc/references/mcp-setup.md +115 -0
  270. package/skills/arc/references/mcp-testing.md +63 -0
  271. package/skills/arc/references/multi-tenancy.md +56 -230
  272. package/skills/arc/references/permissions-scope.md +81 -0
  273. package/skills/arc/references/production-api.md +119 -0
  274. package/skills/arc/references/production-audit.md +101 -0
  275. package/skills/arc/references/production-boot.md +91 -0
  276. package/skills/arc/references/production-caching.md +63 -0
  277. package/skills/arc/references/production-distributed.md +75 -0
  278. package/skills/arc/references/production-idempotency.md +83 -0
  279. package/skills/arc/references/production-observability.md +83 -0
  280. package/skills/arc/references/production-realtime.md +70 -0
  281. package/skills/arc/references/production-reliability.md +100 -0
  282. package/skills/arc/references/production-shutdown.md +43 -0
  283. package/skills/arc/references/querying.md +76 -0
  284. package/skills/arc/references/resources.md +97 -0
  285. package/skills/arc/references/schedules.md +79 -0
  286. package/skills/arc/references/scim.md +61 -208
  287. package/skills/arc/references/tenancy-scope-install.md +82 -0
  288. package/skills/arc/references/testing.md +101 -144
  289. package/skills/arc/references/usage-cleanup-capabilities.md +45 -0
  290. package/skills/arc/references/validation.md +91 -0
  291. package/skills/arc/references/writes-hooks-errors.md +80 -0
  292. package/skills/arc-code-review/SKILL.md +67 -114
  293. package/skills/arc-code-review/references/arc-cheatsheet.md +68 -167
  294. package/skills/arc-code-review/references/mongokit-repositories.md +104 -0
  295. package/skills/arc-code-review/references/recipe-events-cache-jobs.md +112 -0
  296. package/skills/arc-code-review/references/recipe-resource.md +100 -0
  297. package/skills/arc-code-review/references/recipe-schemas-fields.md +93 -0
  298. package/skills/arc-code-review/references/recipe-scope-permissions.md +82 -0
  299. package/skills/arc-code-review/references/scaffolding.md +61 -198
  300. package/skills/arc-code-review/references/severity.md +49 -102
  301. package/skills/arc-code-review/references/smells-auth-scope.md +80 -0
  302. package/skills/arc-code-review/references/smells-data-events.md +66 -0
  303. package/skills/arc-code-review/references/smells-imports-style.md +59 -0
  304. package/skills/arc-code-review/references/smells-platform.md +89 -0
  305. package/skills/arc-code-review/references/smells-routes-schemas.md +66 -0
  306. package/skills/arc-module-publishing/SKILL.md +82 -208
  307. package/skills/arc-module-publishing/references/action-presets-and-plugins.md +87 -0
  308. package/skills/arc-module-publishing/references/build-and-types.md +73 -0
  309. package/skills/arc-module-publishing/references/module-lifecycle.md +101 -0
  310. package/skills/arc-module-publishing/references/package-manifest.md +34 -122
  311. package/skills/arc-module-publishing/references/publishing-workflow.md +44 -140
  312. package/skills/arc-module-publishing/references/resource-assembly.md +102 -0
  313. package/skills/arc-module-publishing/references/testing-packages.md +82 -0
  314. package/skills/arc/references/auth.md +0 -729
  315. package/skills/arc/references/integrations.md +0 -452
  316. package/skills/arc/references/mcp.md +0 -691
  317. package/skills/arc/references/production.md +0 -835
  318. package/skills/arc-code-review/references/anti-patterns.md +0 -1008
  319. package/skills/arc-code-review/references/migration-recipes.md +0 -649
  320. package/skills/arc-code-review/references/mongokit-migration.md +0 -360
  321. package/skills/arc-module-publishing/references/authoring-modules.md +0 -327
package/README.md CHANGED
@@ -240,7 +240,7 @@ auth: { type: 'custom', plugin: myAuthPlugin }
240
240
  auth: false
241
241
  ```
242
242
 
243
- Better Auth + arc resources over BA tables: the kit owns the bridge. `@classytic/mongokit/better-auth` ships `createBetterAuthOverlay()` (per-collection `DataAdapter` for `defineResource`) and `registerBetterAuthStubs()` (bulk stub models for `populate()`). Sqlitekit users hand-roll the Drizzle table — see [auth.md](skills/arc/references/auth.md).
243
+ Better Auth + arc resources over BA tables: the kit owns the bridge. `@classytic/mongokit/better-auth` ships `createBetterAuthOverlay()` (per-collection `DataAdapter` for `defineResource`) and `registerBetterAuthStubs()` (bulk stub models for `populate()`). Sqlitekit users hand-roll the Drizzle table — see [auth-better-auth-overlay.md](skills/arc/references/auth-better-auth-overlay.md).
244
244
 
245
245
  ---
246
246
 
@@ -1,6 +1,5 @@
1
1
 
2
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";
3
- //#region src/events/EventTransport.d.ts
4
3
  interface MemoryEventTransportOptions {
5
4
  /** Logger for error/warning messages (default: console) */
6
5
  logger?: EventLogger;
@@ -116,5 +115,4 @@ declare class MemoryEventTransport implements EventTransport {
116
115
  subscribe(pattern: string, handler: EventHandler): Promise<() => void>;
117
116
  close(): Promise<void>;
118
117
  }
119
- //#endregion
120
118
  export { EventTransport$1 as a, EventLogger$1 as i, DomainEvent$1 as n, MemoryEventTransport as o, EventHandler$1 as r, MemoryEventTransportOptions as s, DeadLetteredEvent as t };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.45.1 | MIT | https://classytic.com */
2
- import { r as workSeedFromEvent, t as runWorkScope } from "./workScope-BcMLKa3G.mjs";
1
+ /*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
2
+ import { r as workSeedFromEvent, t as runWorkScope } from "./workScope-DoBsoVo4.mjs";
3
3
  import { createEvent, createEventRouter } from "@classytic/primitives/events";
4
- //#region src/events/EventTransport.ts
4
+ // src/events/EventTransport.ts
5
5
  /**
6
6
  * Internal arc events module — concrete in-memory transport.
7
7
  *
@@ -194,5 +194,4 @@ function describeFailures(failures) {
194
194
  }).join("; ");
195
195
  return joined.length > FAILURES_MESSAGE_MAX ? `${joined.slice(0, FAILURES_MESSAGE_MAX)}… (${failures.length} causes)` : joined;
196
196
  }
197
- //#endregion
198
197
  export { resolveEventTransport as i, MemoryEventTransport as n, createEvent as r, ARC_EVENT_TRANSPORT as t };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.45.1 | MIT | https://classytic.com */
2
- import { t as buildRequestScopeProjection } from "./projection-BGty6ie4.mjs";
3
- //#region src/hooks/HookSystem.ts
1
+ /*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
2
+ import { t as buildRequestScopeProjection } from "./projection-ClBqtsIw.mjs";
3
+ // src/hooks/HookSystem.ts
4
4
  /**
5
5
  * Hook System
6
6
  *
@@ -387,5 +387,4 @@ function beforeDelete(hooks, resource, handler, priority = 10) {
387
387
  function afterDelete(hooks, resource, handler, priority = 10) {
388
388
  return hooks.after(resource, "delete", handler, priority);
389
389
  }
390
- //#endregion
391
390
  export { beforeCreate as a, createHookSystem as c, afterUpdate as i, defineHook as l, afterCreate as n, beforeDelete as o, afterDelete as r, beforeUpdate as s, HookSystem as t };
@@ -1,6 +1,5 @@
1
1
 
2
- import { r as CacheStore } from "./interface-BOk3YnTz.mjs";
3
- //#region src/cache/QueryCache.d.ts
2
+ import { r as CacheStore } from "./interface-WR1U0K7t.mjs";
4
3
  /** Metadata wrapper stored in CacheStore */
5
4
  interface CacheEnvelope<T = unknown> {
6
5
  data: T;
@@ -73,5 +72,4 @@ declare class QueryCache {
73
72
  */
74
73
  private bumpVersion;
75
74
  }
76
- //#endregion
77
75
  export { QueryCacheConfig as a, QueryCache as i, CacheResult as n, CacheStatus as r, CacheEnvelope as t };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.45.1 | MIT | https://classytic.com */
2
- import "./constants-CtWkmWn3.mjs";
3
- //#region src/registry/ResourceRegistry.ts
1
+ /*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
2
+ import "./constants-CHZMUwBW.mjs";
3
+ // src/registry/ResourceRegistry.ts
4
4
  /**
5
5
  * Resource Registry
6
6
  *
@@ -112,6 +112,7 @@ var ResourceRegistry = class {
112
112
  pipelineSteps: extractPipelineSteps(resource.pipe),
113
113
  rateLimit: resource.rateLimit,
114
114
  idempotency: resource.idempotency,
115
+ queryContract: readQueryContract(resource.queryParser),
115
116
  audit: resource.audit,
116
117
  actionPermissions: resource.actionPermissions,
117
118
  actions: resource.actions ? Object.entries(resource.actions).map(([name, entry]) => {
@@ -416,5 +417,15 @@ function stringifyMeasureMap(measures) {
416
417
  }
417
418
  return out;
418
419
  }
419
- //#endregion
420
+ /** The allow-lists a query parser declares, or undefined when it declares none. */
421
+ function readQueryContract(parser) {
422
+ if (!parser) return void 0;
423
+ const { allowedFilterFields, allowedOperators, allowedSortFields } = parser;
424
+ const contract = {
425
+ ...allowedFilterFields && { filterFields: [...allowedFilterFields] },
426
+ ...allowedOperators && { operators: [...allowedOperators] },
427
+ ...allowedSortFields && { sortFields: [...allowedSortFields] }
428
+ };
429
+ return Object.keys(contract).length > 0 ? contract : void 0;
430
+ }
420
431
  export { stringifyMeasureMap as n, ResourceRegistry as t };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.45.1 | MIT | https://classytic.com */
2
- //#region src/idempotency/acquire.ts
1
+ /*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
2
+ // src/idempotency/acquire.ts
3
3
  async function acquireIdempotencyKey(store, key, requestId, lockTtlMs) {
4
4
  if (typeof store.acquire === "function") return store.acquire(key, requestId, lockTtlMs);
5
5
  return acquireBySteps(store, key, requestId, lockTtlMs);
@@ -31,5 +31,4 @@ async function releaseIdempotencyLock(store, key, requestId, completed) {
31
31
  if (completed && store.completionReleasesLock === true) return;
32
32
  await store.unlock(key, requestId);
33
33
  }
34
- //#endregion
35
34
  export { acquireIdempotencyKey as n, releaseIdempotencyLock as r, acquireBySteps as t };
@@ -1,18 +1,18 @@
1
- /*! @classytic/arc v2.45.1 | MIT | https://classytic.com */
2
- import { f as createError } from "./errors-BtHzrSA6.mjs";
3
- import { n as getUserRoles } from "./userHelpers-oBTU3a_k.mjs";
4
- import { b as isElevated, n as PUBLIC_SCOPE, u as getRequestScope, x as isMember } from "./types-BI4sbUJ3.mjs";
5
- import { a as resolveEffectiveRoles, r as deriveHiddenFieldPermissions, t as applyFieldReadPermissions } from "./fields-C1e_7Fwi.mjs";
6
- import { t as buildRequestScopeProjection } from "./projection-BGty6ie4.mjs";
7
- import { n as requestContext } from "./requestContext-DBKIdmDi.mjs";
8
- import { n as isTenantPreparation } from "./tenantPreparation-DIH-GX4g.mjs";
9
- import { n as evaluateAndApplyPermission } from "./authorizationDecision-CVlaTjAX.mjs";
10
- import { t as executePipeline } from "./pipe-B8uq865o.mjs";
11
- import { n as idempotencyConfigProblem, t as declaresIdempotencyFence } from "./requirement-DxOaghWD.mjs";
12
- import { i as resolveResourceRateLimiter, r as recordUnenforcedRateLimit } from "./resourceRateLimit-BBdj5yRq.mjs";
13
- import { n as arcRouteValidatorCompiler } from "./routeValidator-BNTqM1Eh.mjs";
1
+ /*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
2
+ import { f as createError } from "./errors-BY8vzlP4.mjs";
3
+ import { n as getUserRoles } from "./userHelpers-oX5_mOVs.mjs";
4
+ import { b as isElevated, n as PUBLIC_SCOPE, u as getRequestScope, x as isMember } from "./types-CuGjhn83.mjs";
5
+ import { a as resolveEffectiveRoles, r as deriveHiddenFieldPermissions, t as applyFieldReadPermissions } from "./fields-LnbCcvsw.mjs";
6
+ import { t as buildRequestScopeProjection } from "./projection-ClBqtsIw.mjs";
7
+ import { n as requestContext } from "./requestContext-GYO_0gEw.mjs";
8
+ import { n as isTenantPreparation } from "./tenantPreparation-BrpkQre3.mjs";
9
+ import { n as evaluateAndApplyPermission } from "./authorizationDecision-DeZMrHcm.mjs";
10
+ import { t as executePipeline } from "./pipe-Czpw9U2n.mjs";
11
+ import { n as idempotencyConfigProblem, t as declaresIdempotencyFence } from "./requirement-DeNjZIH3.mjs";
12
+ import { i as resolveResourceRateLimiter, r as recordUnenforcedRateLimit } from "./resourceRateLimit-tHLbrtWc.mjs";
13
+ import { n as arcRouteValidatorCompiler } from "./routeValidator-C_H5NanI.mjs";
14
14
  import { isPaginatedResult, toCanonicalList } from "@classytic/repo-core/pagination";
15
- //#region src/core/fastifyAdapter.ts
15
+ // src/core/fastifyAdapter.ts
16
16
  /** Type guard for Mongoose-like documents with toObject() */
17
17
  function isMongooseDoc(obj) {
18
18
  return !!obj && typeof obj === "object" && "toObject" in obj && typeof obj.toObject === "function";
@@ -235,8 +235,7 @@ function createCrudHandlers(controller) {
235
235
  delete: createFastifyHandler(controller.delete.bind(controller))
236
236
  };
237
237
  }
238
- //#endregion
239
- //#region src/core/middlewares/arcDecorator.ts
238
+ // src/core/middlewares/arcDecorator.ts
240
239
  /**
241
240
  * Build the `arcDecorator` preHandler for a resource.
242
241
  *
@@ -261,8 +260,7 @@ function buildArcDecorator(meta) {
261
260
  if (store) store.resourceName = frozen.resourceName;
262
261
  };
263
262
  }
264
- //#endregion
265
- //#region src/core/middlewares/auth.ts
263
+ // src/core/middlewares/auth.ts
266
264
  /**
267
265
  * A permission requires authentication unless it carries the `_isPublic`
268
266
  * marker set by `allowPublic()`. Absence of a permission is treated as
@@ -316,8 +314,7 @@ function buildAuthMiddlewareForPermissions(fastify, permissions) {
316
314
  if (hasProtected && !hasPublic) return fastify.authenticate ?? null;
317
315
  return fastify.optionalAuthenticate ?? null;
318
316
  }
319
- //#endregion
320
- //#region src/core/middlewares/chain.ts
317
+ // src/core/middlewares/chain.ts
321
318
  const validationGates = /* @__PURE__ */ new WeakSet();
322
319
  const replayBoundaries = /* @__PURE__ */ new WeakSet();
323
320
  /** Rate limiting belongs before a response cache or idempotency replay can return. */
@@ -337,7 +334,9 @@ function buildValidationGate(format) {
337
334
  const gate = async function arcValidationGate(req, reply) {
338
335
  const parked = req.validationError;
339
336
  if (!parked) return;
340
- if (format) await format.call(this, req, reply);
337
+ if (format) {
338
+ if (await format.call(this, req, reply) === reply) return reply;
339
+ }
341
340
  if (reply.sent) return;
342
341
  throw parked;
343
342
  };
@@ -452,8 +451,7 @@ function describeValue(v) {
452
451
  if (Array.isArray(v)) return `an array of length ${v.length}`;
453
452
  return `${typeof v} (${JSON.stringify(v).slice(0, 80)})`;
454
453
  }
455
- //#endregion
456
- //#region src/core/middlewares/permissions.ts
454
+ // src/core/middlewares/permissions.ts
457
455
  /**
458
456
  * Build a PermissionContext from a Fastify request. Extracted so the CRUD
459
457
  * permission middleware and the dynamic action-permission check use the same
@@ -487,7 +485,7 @@ function buildCrudPermissionMw(permissionCheck, resourceName, action) {
487
485
  resource: resourceName,
488
486
  action
489
487
  });
490
- await evaluateAndApplyPermission(permissionCheck, context, req, reply);
488
+ return await evaluateAndApplyPermission(permissionCheck, context, req, reply) ? void 0 : reply;
491
489
  };
492
490
  }
493
491
  /**
@@ -513,7 +511,7 @@ function buildActionPermissionMw(actionEnum, actionPermissions, globalAuth, reso
513
511
  const action = body.action;
514
512
  if (!action || !enumSet.has(action)) throw createError(400, `Invalid action '${action ?? ""}'. Valid actions: ${validActions.join(", ")}`, { validActions });
515
513
  const permissionCheck = actionPermissions[action] ?? globalAuth;
516
- if (!permissionCheck) return;
514
+ if (!permissionCheck) return void 0;
517
515
  const { action: _discard, ...data } = body;
518
516
  const params = req.params;
519
517
  const context = buildPermissionContext(req, {
@@ -522,11 +520,10 @@ function buildActionPermissionMw(actionEnum, actionPermissions, globalAuth, reso
522
520
  resourceId: params?.id,
523
521
  data
524
522
  });
525
- await evaluateAndApplyPermission(permissionCheck, context, req, reply, { defaultDenialMessage: (user) => user ? `Permission denied for '${action}'` : "Authentication required" });
523
+ return await evaluateAndApplyPermission(permissionCheck, context, req, reply, { defaultDenialMessage: (user) => user ? `Permission denied for '${action}'` : "Authentication required" }) ? void 0 : reply;
526
524
  };
527
525
  }
528
- //#endregion
529
- //#region src/core/middlewares/pipeline.ts
526
+ // src/core/middlewares/pipeline.ts
530
527
  /**
531
528
  * Resolve pipeline steps for a specific operation.
532
529
  * Flat-array config applies to every op; map config applies per-op.
@@ -584,8 +581,7 @@ function buildActionPipelineHandler(handler, steps, operation, resourceName) {
584
581
  }), operation);
585
582
  };
586
583
  }
587
- //#endregion
588
- //#region src/core/middlewares/pluginMw.ts
584
+ // src/core/middlewares/pluginMw.ts
589
585
  /**
590
586
  * Pick the request-lifecycle plugin middleware for an HTTP method:
591
587
  * - GET / HEAD → response cache (if present)
@@ -613,8 +609,7 @@ function resolveRouterPluginMw(fastify, resourceHasQueryCache) {
613
609
  idempotencyMw: fastify.hasDecorator("idempotency") ? fastify.idempotency.middleware : null
614
610
  };
615
611
  }
616
- //#endregion
617
- //#region src/core/middlewares/rateLimit.ts
612
+ // src/core/middlewares/rateLimit.ts
618
613
  /**
619
614
  * Build the per-route Fastify `config` object shared by the CRUD, custom, and
620
615
  * action routers. Two independent concerns ride on `routeOptions.config`:
@@ -654,8 +649,7 @@ function buildRateLimitConfig(rateLimit) {
654
649
  timeWindow: rateLimit.timeWindow
655
650
  } };
656
651
  }
657
- //#endregion
658
- //#region src/core/middlewares/registerRoute.ts
652
+ // src/core/middlewares/registerRoute.ts
659
653
  /**
660
654
  * Register a route with friendly handling of `FST_ERR_DUPLICATED_ROUTE`.
661
655
  *
@@ -692,11 +686,14 @@ function tryRegisterRoute(fastify, opts, context) {
692
686
  ip: req.ip
693
687
  });
694
688
  for (const [header, value] of Object.entries(decision.headers)) reply.header(header, value);
695
- if (!decision.allowed) await reply.code(429).send({
696
- code: "arc.rate_limited",
697
- message: "Too many calls to this resource — retry later.",
698
- status: 429
699
- });
689
+ if (!decision.allowed) {
690
+ await reply.code(429).send({
691
+ code: "arc.rate_limited",
692
+ message: "Too many calls to this resource — retry later.",
693
+ status: 429
694
+ });
695
+ return reply;
696
+ }
700
697
  };
701
698
  const replayIndex = handlers.findIndex(isReplayBoundary);
702
699
  const at = replayIndex < 0 ? handlers.length : replayIndex;
@@ -745,8 +742,7 @@ function tryRegisterRoute(fastify, opts, context) {
745
742
  throw enhanced;
746
743
  }
747
744
  }
748
- //#endregion
749
- //#region src/core/actionPermissions.ts
745
+ // src/core/actionPermissions.ts
750
746
  /**
751
747
  * Return the effective `PermissionCheck` for a single action, or `undefined`
752
748
  * when the resource declares no gate at any level.
@@ -768,5 +764,4 @@ function resolveActionPermission(input) {
768
764
  const updateFallback = resourcePermissions?.update;
769
765
  if (updateFallback) return updateFallback;
770
766
  }
771
- //#endregion
772
767
  export { sendControllerResponse as C, getControllerScope as S, buildArcDecorator as _, resolveRouterPluginMw as a, createRequestContext as b, buildPipelineHandler as c, buildCrudPermissionMw as d, buildRouteHooks as f, buildAuthMiddlewareForPermissions as g, buildAuthMiddleware as h, buildRouteConfig as i, resolvePipelineSteps as l, routeHookOptions as m, tryRegisterRoute as n, selectPluginMw as o, resolveRoutePreHandlers as p, buildRateLimitConfig as r, buildActionPipelineHandler as s, resolveActionPermission as t, buildActionPermissionMw as u, createCrudHandlers as v, getControllerContext as x, createFastifyHandler as y };
@@ -1,9 +1,8 @@
1
1
 
2
- import { d as UserBase } from "../base-CZyixEQR.mjs";
3
- import "../index-WH7xgvxS.mjs";
2
+ import { d as UserBase } from "../base-HXNgPQww.mjs";
3
+ import "../index-DyJFTJLA.mjs";
4
4
  import { FastifyPluginAsync } from "fastify";
5
5
  import { RepositoryLike } from "@classytic/repo-core/adapter";
6
- //#region src/audit/stores/interface.d.ts
7
6
  type AuditAction = "create" | "update" | "delete" | "restore" | "custom";
8
7
  interface AuditEntry {
9
8
  /** Unique audit log ID */
@@ -93,8 +92,6 @@ export declare function createAuditEntry(resource: string, documentId: string, a
93
92
  after?: Record<string, unknown>;
94
93
  metadata?: Record<string, unknown>;
95
94
  }): AuditEntry;
96
- //#endregion
97
- //#region src/audit/auditPlugin.d.ts
98
95
  interface AuditPluginOptions {
99
96
  /** Enable audit logging (default: false) */
100
97
  enabled?: boolean;
@@ -255,8 +252,6 @@ interface AuditRequestLike {
255
252
  */
256
253
  export declare function auditContextOf(request: AuditRequestLike): AuditContext;
257
254
  declare const _default: FastifyPluginAsync<AuditPluginOptions>;
258
- //#endregion
259
- //#region src/audit/repository-audit-adapter.d.ts
260
255
  /** Options for {@link repositoryAsAuditStore}. */
261
256
  interface RepositoryAuditStoreOptions {
262
257
  /**
@@ -276,8 +271,6 @@ interface RepositoryAuditStoreOptions {
276
271
  readonly sessionProvider?: () => unknown;
277
272
  }
278
273
  export declare function repositoryAsAuditStore(repository: RepositoryLike, options?: RepositoryAuditStoreOptions): AuditStore;
279
- //#endregion
280
- //#region src/audit/stores/memory.d.ts
281
274
  interface MemoryAuditStoreOptions {
282
275
  /** Maximum entries to keep (default: 1000) */
283
276
  maxEntries?: number;
@@ -296,5 +289,4 @@ export declare class MemoryAuditStore implements AuditStore {
296
289
  /** Clear all entries (for testing) */
297
290
  clear(): void;
298
291
  }
299
- //#endregion
300
292
  export { type AuditAction, type AuditContext, type AuditEntry, type AuditLogger, type AuditPluginOptions, type AuditQueryOptions, type AuditRequestLike, type AuditStore, type AuditStoreOptions, type MemoryAuditStoreOptions, type RepositoryAuditStoreOptions, type RequestAuditLogger, _default as auditPlugin };
@@ -1,10 +1,10 @@
1
- /*! @classytic/arc v2.45.1 | MIT | https://classytic.com */
2
- import { g as getUserId, i as getClientId } from "../types-BI4sbUJ3.mjs";
3
- import { t as transactionContext } from "../transactionContext-NHmhDIOF.mjs";
4
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-D_3eUO6V.mjs";
1
+ /*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
2
+ import { g as getUserId, i as getClientId } from "../types-CuGjhn83.mjs";
3
+ import { t as transactionContext } from "../transactionContext-DaxYUEgH.mjs";
4
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-DWqbxkyw.mjs";
5
5
  import { and, anyOf, eq, gte, lt, lte } from "@classytic/repo-core/filter";
6
6
  import fp from "fastify-plugin";
7
- //#region src/audit/repository-audit-adapter.ts
7
+ // src/audit/repository-audit-adapter.ts
8
8
  function repositoryAsAuditStore(repository, options = {}) {
9
9
  const idField = repository.idField ?? "_id";
10
10
  const { sessionProvider } = options;
@@ -75,8 +75,7 @@ function repositoryAsAuditStore(repository, options = {}) {
75
75
  }
76
76
  };
77
77
  }
78
- //#endregion
79
- //#region src/audit/stores/interface.ts
78
+ // src/audit/stores/interface.ts
80
79
  /**
81
80
  * Create audit entry from context
82
81
  */
@@ -127,8 +126,7 @@ function detectChanges(before, after) {
127
126
  function generateAuditId() {
128
127
  return `aud_${Date.now().toString(36)}${Math.random().toString(36).substring(2, 10)}`;
129
128
  }
130
- //#endregion
131
- //#region src/audit/stores/memory.ts
129
+ // src/audit/stores/memory.ts
132
130
  var MemoryAuditStore = class {
133
131
  name = "memory";
134
132
  entries = [];
@@ -176,8 +174,7 @@ var MemoryAuditStore = class {
176
174
  this.entries = [];
177
175
  }
178
176
  };
179
- //#endregion
180
- //#region src/audit/auditPlugin.ts
177
+ // src/audit/auditPlugin.ts
181
178
  const auditPlugin = async (fastify, opts = {}) => {
182
179
  const { enabled = false, repository, customStores = [], sessionProvider = () => transactionContext.get() } = opts;
183
180
  if (!enabled) {
@@ -393,5 +390,4 @@ var auditPlugin_default = fp(auditPlugin, {
393
390
  fastify: "5.x",
394
391
  dependencies: ["arc-core"]
395
392
  });
396
- //#endregion
397
393
  export { MemoryAuditStore, auditContextOf, auditPlugin_default as auditPlugin, createAuditEntry, repositoryAsAuditStore };
@@ -1,6 +1,5 @@
1
1
 
2
2
  import { FastifyInstance } from "fastify";
3
- //#region src/auth/audit.d.ts
4
3
  /**
5
4
  * Canonical auth event names emitted by the bridge. Hosts pattern-match
6
5
  * with glob (`session.*`, `mfa.*`, `*.failed`) when listing `events`.
@@ -199,5 +198,4 @@ interface SessionLike {
199
198
  impersonatedBy?: string;
200
199
  }
201
200
  export declare function wireBetterAuthAudit(opts?: WireBetterAuthAuditOptions): BetterAuthAuditBridge;
202
- //#endregion
203
201
  export {};
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.45.1 | MIT | https://classytic.com */
2
- //#region src/auth/audit.ts
1
+ /*! @classytic/arc v2.46.0 | MIT | https://classytic.com */
2
+ // src/auth/audit.ts
3
3
  function compileGlobs(patterns) {
4
4
  if (patterns.length === 0) return () => false;
5
5
  const regexes = patterns.map((p) => new RegExp(`^${globToRegexBody(p)}$`));
@@ -290,5 +290,4 @@ function wireBetterAuthAudit(opts = {}) {
290
290
  }
291
291
  };
292
292
  }
293
- //#endregion
294
293
  export { wireBetterAuthAudit };
@@ -1,26 +1,23 @@
1
1
 
2
- import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
3
- import { l as PermissionCheck } from "../base-CZyixEQR.mjs";
4
- import { At as AuthHelpers, jt as AuthPluginOptions } from "../index-WH7xgvxS.mjs";
5
- import { t as ExternalOpenApiPaths } from "../externalPaths-CmGOxOtD.mjs";
6
- 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";
2
+ import { i as RequestScope } from "../types-DnkIALZ8.mjs";
3
+ import { l as PermissionCheck } from "../base-HXNgPQww.mjs";
4
+ import { At as AuthHelpers, jt as AuthPluginOptions } from "../index-DyJFTJLA.mjs";
5
+ import { t as ExternalOpenApiPaths } from "../externalPaths-BOqdq5wr.mjs";
6
+ 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-CdvDF04x.mjs";
7
7
  import { FastifyPluginAsync, FastifyReply as FastifyReply$1, FastifyRequest } from "fastify";
8
- //#region src/auth/authPlugin.d.ts
9
8
  declare module "fastify" {
10
9
  interface FastifyInstance {
11
10
  /** Authenticate middleware - use in preHandler for protected routes */
12
- authenticate: (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
11
+ authenticate: (request: FastifyRequest, reply: FastifyReply) => Promise<void | FastifyReply>;
13
12
  /** Optional authenticate - parses JWT if present, doesn't fail if absent */
14
13
  optionalAuthenticate: (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
15
14
  /** Authorize middleware factory - checks if user has required roles */
16
- authorize: (...roles: string[]) => (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
15
+ authorize: (...roles: string[]) => (request: FastifyRequest, reply: FastifyReply) => Promise<void | FastifyReply>;
17
16
  /** Auth helpers - issueTokens, jwt utilities */
18
17
  auth: AuthHelpers;
19
18
  }
20
19
  }
21
20
  declare const _default: FastifyPluginAsync<AuthPluginOptions>;
22
- //#endregion
23
- //#region src/auth/betterAuth.d.ts
24
21
  declare module "fastify" {
25
22
  interface FastifyRequest {
26
23
  /** Raw request body (from @fastify/raw-body plugin, if registered) */
@@ -146,7 +143,7 @@ interface BetterAuthAdapterResult {
146
143
  /** Fastify plugin that registers catch-all auth routes */
147
144
  plugin: FastifyPluginAsync;
148
145
  /** Authenticate preHandler -- validates session via Better Auth */
149
- authenticate: (request: FastifyRequest, reply: FastifyReply$1) => Promise<void>;
146
+ authenticate: (request: FastifyRequest, reply: FastifyReply$1) => Promise<void | FastifyReply$1>;
150
147
  /** Optional authenticate -- resolves session silently, continues as unauthenticated on failure */
151
148
  optionalAuthenticate: (request: FastifyRequest, reply: FastifyReply$1) => Promise<void>;
152
149
  /** Permission helpers bound to this auth adapter (available when orgContext is enabled) */
@@ -165,7 +162,7 @@ declare module "fastify" {
165
162
  * Validates session by calling Better Auth's session endpoint internally.
166
163
  * Set by the Better Auth adapter plugin.
167
164
  */
168
- authenticate: (request: FastifyRequest, reply: FastifyReply$1) => Promise<void>;
165
+ authenticate: (request: FastifyRequest, reply: FastifyReply$1) => Promise<void | FastifyReply$1>;
169
166
  /**
170
167
  * Optional authenticate middleware (Better Auth variant).
171
168
  * Tries to resolve session silently — populates request.user if valid,
@@ -204,8 +201,6 @@ declare module "fastify" {
204
201
  /** Verifies one credential scheme's value; the scope to install, or `null` when it is not valid. */
205
202
  type CredentialVerifier = (credentials: string, request: FastifyRequest) => Promise<RequestScope | null>;
206
203
  export declare function createBetterAuthAdapter(options: BetterAuthAdapterOptions): BetterAuthAdapterResult;
207
- //#endregion
208
- //#region src/auth/betterAuthOpenApi.d.ts
209
204
  interface BetterAuthOpenApiOptions {
210
205
  /** Base path prefix for auth routes (default: '/api/auth') */
211
206
  basePath?: string;
@@ -242,8 +237,6 @@ interface BetterAuthOpenApiOptions {
242
237
  * and returns a complete `ExternalOpenApiPaths` object ready for Arc's spec builder.
243
238
  */
244
239
  export declare function extractBetterAuthOpenApi(authApi: Record<string, unknown>, options?: BetterAuthOpenApiOptions): ExternalOpenApiPaths;
245
- //#endregion
246
- //#region src/auth/trustedOrigins.d.ts
247
240
  /**
248
241
  * `trustedOrigins` ↔ CORS-allowlist union helper.
249
242
  *
@@ -319,5 +312,4 @@ interface MirrorTrustedOriginsOptions {
319
312
  * - `[canonicalUrl]` when `corsOrigins` is `false` / `undefined`.
320
313
  */
321
314
  export declare function mirrorTrustedOriginsFromCors(options: MirrorTrustedOriginsOptions): string[];
322
- //#endregion
323
315
  export { type AuthPluginOptions, type BetterAuthAdapterOptions, type BetterAuthAdapterResult, type BetterAuthHandler, type BetterAuthOpenApiOptions, type CorsOriginsConfig, type CredentialVerifier, MemorySessionStore, type MemorySessionStoreOptions, type MirrorTrustedOriginsOptions, type SessionCookieOptions, type SessionData, type SessionManagerOptions, type SessionManagerResult, type SessionStore, _default as authPlugin, createSessionManager };