@classytic/arc 2.45.2 → 2.47.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 (333) hide show
  1. package/README.md +1 -1
  2. package/dist/{EventTransport-DHb1tpu-.mjs → EventTransport-BHKy4_Bi.mjs} +5 -6
  3. package/dist/{EventTransport-CiicKz2Z.d.mts → EventTransport-CYEoCJGe.d.mts} +0 -2
  4. package/dist/{HookSystem-C1u0EUnt.mjs → HookSystem-CAIDVoKC.mjs} +3 -4
  5. package/dist/{QueryCache--5uAuYPW.d.mts → QueryCache-DdvrGG8Q.d.mts} +1 -3
  6. package/dist/{ResourceRegistry-D2jXWVN_.mjs → ResourceRegistry-23Ml6FNe.mjs} +15 -4
  7. package/dist/{acquire-DTkA8Lme.mjs → acquire-DoFX06fm.mjs} +2 -3
  8. package/dist/{actionPermissions-DRVk6m7x.mjs → actionPermissions-DXrlWHHK.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-D48fUJv1.mjs → authorizationDecision-DYiubkYw.mjs} +5 -6
  18. package/dist/{base-CZyixEQR.d.mts → base-HXNgPQww.d.mts} +1 -7
  19. package/dist/{boundedMap-DkKiPifd.mjs → boundedMap-CtdzpJ3X.mjs} +2 -3
  20. package/dist/{buildHandler-BiZ4VATS.mjs → buildHandler-CARdmPNo.mjs} +5 -6
  21. package/dist/cache/index.d.mts +4 -10
  22. package/dist/cache/index.mjs +5 -6
  23. package/dist/{caching-Cj0as-P1.mjs → caching-QRiryDLs.mjs} +3 -4
  24. package/dist/{claimed-ChI13rUR.mjs → claimed-BLecr1j3.mjs} +2 -3
  25. package/dist/cleanup/index.d.mts +4 -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-D_aiew34.mjs → constants-Cx7BcnHT.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-QIZ2560Y.mjs → core-0WyMuo0f.mjs} +9 -12
  47. package/dist/{createActionRouter-CvH84dyx.mjs → createActionRouter-mLAGbpDV.mjs} +7 -8
  48. package/dist/{createAggregationRouter-DGyK2Hp6.mjs → createAggregationRouter-BEAjn3dA.mjs} +9 -10
  49. package/dist/{createApp-CKjZpmq9.mjs → createApp-QDP4vYWH.mjs} +49 -62
  50. package/dist/{createMcpServer-DSztofa9.d.mts → createMcpServer-DzXHX0SO.d.mts} +1 -3
  51. package/dist/{defineAggregation-BLza7Ca4.mjs → defineAggregation-CFNfvz-C.mjs} +2 -3
  52. package/dist/{defineResource-CEo0gDCb.mjs → defineResource-BROJmhzJ.mjs} +80 -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-BW2J3tNj.d.mts → elevation-DPD0hcU-.d.mts} +0 -2
  58. package/dist/{elevation-BJTsSnke.mjs → elevation-DrXeEWWk.mjs} +9 -10
  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-2p4SL5zm.mjs → errorHandler-BiBXtxj4.mjs} +16 -6
  63. package/dist/{errors-JYc9vwqE.d.mts → errors-DTo0me1o.d.mts} +0 -2
  64. package/dist/{errors-grZkIA8N.mjs → errors-DnrUChAy.mjs} +2 -3
  65. package/dist/{eventPlugin-BtmA4-3P.d.mts → eventPlugin-BY38F6yK.d.mts} +1 -7
  66. package/dist/{eventPlugin-ItcYBGUs.mjs → eventPlugin-BhKLUe7H.mjs} +10 -12
  67. package/dist/{eventTypes-Ck6fD3ne.mjs → eventTypes-CCIRGakw.mjs} +5 -8
  68. package/dist/events/index.d.mts +5 -17
  69. package/dist/events/index.mjs +9 -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-bzkWPt1f.d.mts} +4 -10
  78. package/dist/{fields-BRX0Krcj.mjs → fields-CYdpcV73.mjs} +2 -3
  79. package/dist/{fields-BBSpf8pS.d.mts → fields-JTkrtO-r.d.mts} +0 -2
  80. package/dist/{filter-merge-CDc7YMwX.mjs → filter-merge-6kasezRH.mjs} +2 -3
  81. package/dist/{generate-DCGuEbqI.d.mts → generate-C-g_KOkV.d.mts} +0 -4
  82. package/dist/{generate-hvg7V2g1.mjs → generate-DUkcbc4r.mjs} +7 -12
  83. package/dist/{headers-Cqkg4LzI.mjs → headers-KxhrKevA.mjs} +3 -4
  84. package/dist/{health-PVt0VjOx.mjs → health-CRJg3IIq.mjs} +2 -3
  85. package/dist/{health-DyeP3mTW.mjs → health-jkYNdobJ.mjs} +4 -7
  86. package/dist/hooks/index.d.mts +1 -1
  87. package/dist/hooks/index.mjs +2 -2
  88. package/dist/http-cache/index.d.mts +211 -0
  89. package/dist/http-cache/index.mjs +605 -0
  90. package/dist/http-cache/purgers/cloudflare.d.mts +13 -0
  91. package/dist/http-cache/purgers/cloudflare.mjs +46 -0
  92. package/dist/http-cache/purgers/fastly.d.mts +12 -0
  93. package/dist/http-cache/purgers/fastly.mjs +47 -0
  94. package/dist/http-cache/testing/index.d.mts +68 -0
  95. package/dist/http-cache/testing/index.mjs +168 -0
  96. package/dist/idempotency/index.d.mts +3 -9
  97. package/dist/idempotency/index.mjs +11 -14
  98. package/dist/idempotency/redis.d.mts +1 -1
  99. package/dist/idempotency/redis.mjs +3 -4
  100. package/dist/{index-Bxriq3so.d.mts → index-B5i9-vuP.d.mts} +4 -26
  101. package/dist/{index-Chgz3d0i.d.mts → index-BAXDo5eE.d.mts} +1 -7
  102. package/dist/{index-Beg3aNnK.d.mts → index-BxZS-8So.d.mts} +67 -25
  103. package/dist/{index-WH7xgvxS.d.mts → index-Cy2-QffW.d.mts} +40 -92
  104. package/dist/{index-uhkUA5-U.d.mts → index-D1X_C_qz.d.mts} +13 -23
  105. package/dist/{index-CUJvoyw3.d.mts → index-DFCCQ9AE.d.mts} +2 -24
  106. package/dist/index.d.mts +7 -9
  107. package/dist/index.mjs +12 -13
  108. package/dist/{init-jC3rMPzb.mjs → init-CACwpktI.mjs} +18 -35
  109. package/dist/{init-Cscs4lab.d.mts → init-CV2_Fw3H.d.mts} +0 -4
  110. package/dist/integrations/event-gateway.d.mts +3 -5
  111. package/dist/integrations/event-gateway.mjs +3 -4
  112. package/dist/integrations/index.d.mts +3 -3
  113. package/dist/integrations/index.mjs +1 -1
  114. package/dist/integrations/jobs/index.d.mts +1 -1
  115. package/dist/integrations/jobs/index.mjs +7 -11
  116. package/dist/integrations/mcp/index.d.mts +7 -39
  117. package/dist/integrations/mcp/index.mjs +8 -14
  118. package/dist/integrations/mcp/testing.d.mts +3 -5
  119. package/dist/integrations/mcp/testing.mjs +3 -4
  120. package/dist/integrations/streamline.d.mts +1 -3
  121. package/dist/integrations/streamline.mjs +4 -5
  122. package/dist/integrations/webhooks.d.mts +2 -4
  123. package/dist/integrations/webhooks.mjs +5 -5
  124. package/dist/integrations/websocket-pushref-redis.d.mts +2 -4
  125. package/dist/integrations/websocket-pushref-redis.mjs +2 -3
  126. package/dist/integrations/websocket-redis.d.mts +2 -4
  127. package/dist/integrations/websocket-redis.mjs +2 -3
  128. package/dist/integrations/websocket.d.mts +2 -2
  129. package/dist/integrations/websocket.mjs +13 -24
  130. package/dist/{interface-JJzwH4Ro.d.mts → interface-BmExzQRD.d.mts} +0 -2
  131. package/dist/{interface-BOk3YnTz.d.mts → interface-WR1U0K7t.d.mts} +0 -2
  132. package/dist/{jsonBody-ptwyzZQ-.mjs → jsonBody-CzDBkCme.mjs} +3 -4
  133. package/dist/{keys-C1vFuSbv.mjs → keys-Cbwf6r1B.mjs} +2 -3
  134. package/dist/{loadResources-CHPDyIPn.mjs → loadResources-Kr6vuljv.mjs} +4 -5
  135. package/dist/{loadResourcesFromEntry-BkHHTu_B.mjs → loadResourcesFromEntry-D2e0qoDR.mjs} +3 -4
  136. package/dist/logger/index.d.mts +1 -3
  137. package/dist/logger/index.mjs +2 -2
  138. package/dist/{logger-C5bvCiAK.mjs → logger-C110X5Yz.mjs} +3 -5
  139. package/dist/{mcpPlugin-C9qohJCF.mjs → mcpPlugin-4lIPr9OJ.mjs} +41 -60
  140. package/dist/{memory-CxiTwT0j.mjs → memory-D9qkhXiB.mjs} +4 -5
  141. package/dist/{metrics-Ckp2zRy-.mjs → metrics-B-qrrWfI.mjs} +4 -5
  142. package/dist/middleware/index.d.mts +1 -5
  143. package/dist/middleware/index.mjs +4 -5
  144. package/dist/migrations/index.d.mts +0 -2
  145. package/dist/migrations/index.mjs +3 -4
  146. package/dist/{module-CfnKuIuH.mjs → module-BD8xHgrz.mjs} +2 -3
  147. package/dist/{multiTenant-CAtYlW6H.d.mts → multiTenant-KZj8j1uJ.d.mts} +1 -5
  148. package/dist/{multipartBody-BFasGtP9.mjs → multipartBody-qU7KCn1l.mjs} +2 -3
  149. package/dist/observeSend-BnPtTotW.mjs +20 -0
  150. package/dist/{openapi-DAPxjYHX.mjs → openapi-DoVa5SVP.mjs} +18 -28
  151. package/dist/outbox-admin/index.d.mts +2 -4
  152. package/dist/outbox-admin/index.mjs +6 -7
  153. package/dist/{outbox-module-gZCHoE4H.d.mts → outbox-module-5Mnwcycy.d.mts} +3 -9
  154. package/dist/outbox-module-DyITEIop.mjs +297 -0
  155. package/dist/permissions/index.d.mts +4 -4
  156. package/dist/permissions/index.mjs +7 -7
  157. package/dist/{permissions-B14c3OMp.mjs → permissions-BBy4bOGi.mjs} +19 -29
  158. package/dist/{pipe-CQv7PsAK.mjs → pipe-BOm2o4UA.mjs} +3 -4
  159. package/dist/pipeline/index.d.mts +1 -9
  160. package/dist/pipeline/index.mjs +5 -8
  161. package/dist/{plan-CpnTykjb.mjs → plan-DDIGwuxr.mjs} +5 -9
  162. package/dist/{plugin-DXTjVg_Q.mjs → plugin-Bn4D_0XK.mjs} +156 -64
  163. package/dist/plugins/index.d.mts +8 -16
  164. package/dist/plugins/index.mjs +22 -26
  165. package/dist/plugins/response-cache.d.mts +2 -4
  166. package/dist/plugins/response-cache.mjs +10 -10
  167. package/dist/plugins/tracing-entry.d.mts +1 -1
  168. package/dist/plugins/tracing-entry.mjs +3 -4
  169. package/dist/{pluralize-C3VJKRGp.mjs → pluralize-ClEjcKlG.mjs} +2 -3
  170. package/dist/policy.types-DPqToKG1.d.mts +50 -0
  171. package/dist/presets/filesUpload.d.mts +4 -6
  172. package/dist/presets/filesUpload.mjs +6 -7
  173. package/dist/presets/index.d.mts +3 -19
  174. package/dist/presets/index.mjs +2 -2
  175. package/dist/presets/multiTenant.d.mts +1 -1
  176. package/dist/presets/multiTenant.mjs +7 -7
  177. package/dist/presets/search.d.mts +3 -5
  178. package/dist/presets/search.mjs +3 -4
  179. package/dist/{presets-CquqYJPy.mjs → presets-DK2jh5YR.mjs} +11 -18
  180. package/dist/{projection-CgfSLOSM.mjs → projection-BHH-sXyS.mjs} +3 -4
  181. package/dist/purger.types-2wNJK_89.mjs +24 -0
  182. package/dist/purger.types-DvPp4-yd.d.mts +26 -0
  183. package/dist/{pushref-registry-UxCkoA4C.d.mts → pushref-registry-d86QUaSq.d.mts} +0 -6
  184. package/dist/{queryCachePlugin-D0HUISHJ.mjs → queryCachePlugin-Ckqe98AM.mjs} +8 -10
  185. package/dist/{queryCachePlugin-C2lZjTxk.d.mts → queryCachePlugin-DYQUyeJ9.d.mts} +2 -4
  186. package/dist/{rateLimitKey-AvkBOMkl.mjs → rateLimitKey-CWAjlqcN.mjs} +2 -3
  187. package/dist/{realtime-CbWtVbqK.mjs → realtime-BIJi9USY.mjs} +17 -19
  188. package/dist/{redis-BDgv9Glw.d.mts → redis-RpDMemdm.d.mts} +2 -4
  189. package/dist/{redis-stream-BMk-bpQS.d.mts → redis-stream-CS1N9dwM.d.mts} +1 -3
  190. package/dist/{redisShapes-CQksY67q.d.mts → redisShapes-CqBXTn_s.d.mts} +0 -2
  191. package/dist/registry/index.d.mts +2 -12
  192. package/dist/registry/index.mjs +3 -3
  193. package/dist/{registry-BVwpAuFI.mjs → registry-y9ZA-R_J.mjs} +7 -12
  194. package/dist/{outbox-module-B4FAkx3A.mjs → relay-BNrC1CEP.mjs} +8 -306
  195. package/dist/{renewingLease-CykpeNcQ.mjs → renewingLease-CS43br5E.mjs} +2 -3
  196. package/dist/{replyHelpers-DA51IZio.mjs → replyHelpers-oZDzakGb.mjs} +3 -4
  197. package/dist/{requestContext-DIWHKDtQ.mjs → requestContext-fWb_YaV2.mjs} +2 -3
  198. package/dist/{requirement-Cp_fsMDL.mjs → requirement--2hWyyHi.mjs} +2 -3
  199. package/dist/{requirement-CbiLdQ1n.d.mts → requirement-CTRQjjQx.d.mts} +0 -2
  200. package/dist/{resourceRateLimit-BFuluodF.mjs → resourceRateLimit-1WbcyMZY.mjs} +3 -4
  201. package/dist/{resourceRateLimit-Wf6d6FL9.d.mts → resourceRateLimit-DCWglD7V.d.mts} +1 -3
  202. package/dist/{rolldown-runtime-D_lMdYOd.mjs → rolldown-runtime-yH2lHMo_.mjs} +2 -3
  203. package/dist/{routeValidator-DuLonYwr.mjs → routeValidator-BSlRIA5c.mjs} +2 -3
  204. package/dist/{runtimeCapabilities-CydRfm0i.mjs → runtimeCapabilities-CYCEtU1W.mjs} +2 -3
  205. package/dist/{schedules-B693KXxa.mjs → schedules-B5WGlYIT.mjs} +132 -9
  206. package/dist/{schemaConverter-DNvZWTV6.mjs → schemaConverter-DtNvts-6.mjs} +3 -4
  207. package/dist/{schemaIR-REV2y7Wd.mjs → schemaIR-uS_RHqa3.mjs} +3 -4
  208. package/dist/schemas/index.d.mts +0 -2
  209. package/dist/schemas/index.mjs +2 -3
  210. package/dist/scim/index.d.mts +0 -12
  211. package/dist/scim/index.mjs +10 -18
  212. package/dist/scope/index.d.mts +2 -6
  213. package/dist/scope/index.mjs +5 -5
  214. package/dist/{scope-Bevxy_ST.mjs → scope-BwVLSyNG.mjs} +5 -6
  215. package/dist/{sessionManager-qimlKV0P.d.mts → sessionManager-CdvDF04x.d.mts} +2 -4
  216. package/dist/{shutdown-CfrqPR7A.mjs → shutdown-BJiJN7FT.mjs} +2 -3
  217. package/dist/{simpleEqualityMatcher-BJwfuRKP.mjs → simpleEqualityMatcher-DGRLq-1k.mjs} +2 -3
  218. package/dist/{sse-CuNNWr2z.mjs → sse-B_50llZu.mjs} +8 -9
  219. package/dist/{sseStream-C_2ujAVY.mjs → sseStream-BjSo9Ult.mjs} +3 -4
  220. package/dist/{storage-Cx9Sz3Ou.d.mts → storage-odC5MNKN.d.mts} +0 -2
  221. package/dist/{store-helpers-C8uBGCbb.mjs → store-helpers-D-n5cwy5.mjs} +2 -3
  222. package/dist/{streaming-Bdq_M4d5.mjs → streaming-Dcgqa-hH.mjs} +2 -3
  223. package/dist/{subscriberIdentity-B-KpZkdl.mjs → subscriberIdentity-C9KhIXTF.mjs} +2 -3
  224. package/dist/{tenancy-C5PCvm1h.mjs → tenancy-COrhjPRZ.mjs} +3 -4
  225. package/dist/{tenantPreparation-dYvWrgNa.mjs → tenantPreparation-BElWHytd.mjs} +5 -6
  226. package/dist/testing/cleanupStoreContract.d.mts +2 -4
  227. package/dist/testing/cleanupStoreContract.mjs +2 -3
  228. package/dist/testing/index.d.mts +6 -32
  229. package/dist/testing/index.mjs +24 -37
  230. package/dist/testing/outboxStoreContract.d.mts +1 -3
  231. package/dist/testing/outboxStoreContract.mjs +3 -4
  232. package/dist/testing/requiredPorts.d.mts +2 -4
  233. package/dist/testing/requiredPorts.mjs +3 -4
  234. package/dist/testing/storageContract.d.mts +2 -4
  235. package/dist/testing/storageContract.mjs +2 -3
  236. package/dist/{timing-DCqsezX8.mjs → timing-CaxKbRk_.mjs} +3 -5
  237. package/dist/{tracing-Dro5eH6j.d.mts → tracing-JSFiBl5r.d.mts} +0 -2
  238. package/dist/{transactionContext-DrcNyjpv.mjs → transactionContext-8qKON0Nk.mjs} +2 -3
  239. package/dist/{typeGuards-CEl10KPy.mjs → typeGuards-DVjVSsXO.mjs} +2 -3
  240. package/dist/types/index.d.mts +4 -4
  241. package/dist/types/index.mjs +1 -1
  242. package/dist/types/storage.d.mts +1 -1
  243. package/dist/types/storage.mjs +1 -1
  244. package/dist/{types-ByHn9rEO.d.mts → types-0Dqlbgn8.d.mts} +0 -2
  245. package/dist/{types-BJ-2XqVF.d.mts → types-BeEJm-DV.d.mts} +114 -14
  246. package/dist/{types-DVLddu2q.d.mts → types-C0YJAiL0.d.mts} +0 -2
  247. package/dist/{types-D9NWjpYc.mjs → types-DZHqOuJE.mjs} +5 -6
  248. package/dist/{types-D3Ixsh00.d.mts → types-DeLiuaNv.d.mts} +2 -4
  249. package/dist/{types-Ddl9OjmE.d.mts → types-DnkIALZ8.d.mts} +0 -4
  250. package/dist/usage/index.d.mts +2 -10
  251. package/dist/usage/index.mjs +8 -12
  252. package/dist/{userHelpers-BHig1kHq.mjs → userHelpers-_eGj6kf0.mjs} +2 -3
  253. package/dist/utils/index.d.mts +5 -39
  254. package/dist/utils/index.mjs +12 -12
  255. package/dist/{utils-BG5P7_Vb.mjs → utils-Dd6MWpye.mjs} +20 -30
  256. package/dist/{validate-D_mdOCir.mjs → validate-BaF5wd0x.mjs} +5 -7
  257. package/dist/{versioning-DBGHjPh7.mjs → versioning-DyV7mwtK.mjs} +4 -5
  258. package/dist/{versioning-Bqm_57Qt.d.mts → versioning-S18y2-0C.d.mts} +1 -15
  259. package/dist/{websocket-Cs4awVyD.d.mts → websocket-BGuc-WVZ.d.mts} +1 -15
  260. package/dist/{workScope-DPPfM4m6.mjs → workScope-CmCBUmPR.mjs} +3 -4
  261. package/llms.txt +37 -30
  262. package/package.json +51 -22
  263. package/skills/arc/SKILL.md +65 -844
  264. package/skills/arc/references/agent-auth.md +82 -193
  265. package/skills/arc/references/api-reference.md +41 -245
  266. package/skills/arc/references/auth-api-keys.md +99 -0
  267. package/skills/arc/references/auth-better-auth-overlay.md +87 -0
  268. package/skills/arc/references/auth-better-auth.md +78 -0
  269. package/skills/arc/references/auth-permissions.md +100 -0
  270. package/skills/arc/references/auth-strategies.md +122 -0
  271. package/skills/arc/references/boot.md +80 -0
  272. package/skills/arc/references/enterprise-auth.md +65 -81
  273. package/skills/arc/references/events-outbox.md +90 -0
  274. package/skills/arc/references/events.md +75 -440
  275. package/skills/arc/references/integrations-jobs.md +74 -0
  276. package/skills/arc/references/integrations-realtime.md +84 -0
  277. package/skills/arc/references/integrations-webhooks.md +71 -0
  278. package/skills/arc/references/integrations-workflows.md +47 -0
  279. package/skills/arc/references/mcp-auth.md +83 -0
  280. package/skills/arc/references/mcp-custom-tools.md +125 -0
  281. package/skills/arc/references/mcp-setup.md +115 -0
  282. package/skills/arc/references/mcp-testing.md +63 -0
  283. package/skills/arc/references/multi-tenancy.md +56 -230
  284. package/skills/arc/references/permissions-scope.md +81 -0
  285. package/skills/arc/references/production-api.md +119 -0
  286. package/skills/arc/references/production-audit.md +101 -0
  287. package/skills/arc/references/production-boot.md +91 -0
  288. package/skills/arc/references/production-caching.md +63 -0
  289. package/skills/arc/references/production-distributed.md +75 -0
  290. package/skills/arc/references/production-idempotency.md +83 -0
  291. package/skills/arc/references/production-observability.md +83 -0
  292. package/skills/arc/references/production-realtime.md +70 -0
  293. package/skills/arc/references/production-reliability.md +100 -0
  294. package/skills/arc/references/production-shutdown.md +43 -0
  295. package/skills/arc/references/querying.md +76 -0
  296. package/skills/arc/references/resources.md +97 -0
  297. package/skills/arc/references/schedules.md +79 -0
  298. package/skills/arc/references/scim.md +61 -208
  299. package/skills/arc/references/tenancy-scope-install.md +82 -0
  300. package/skills/arc/references/testing.md +101 -144
  301. package/skills/arc/references/usage-cleanup-capabilities.md +45 -0
  302. package/skills/arc/references/validation.md +91 -0
  303. package/skills/arc/references/writes-hooks-errors.md +80 -0
  304. package/skills/arc-code-review/SKILL.md +67 -114
  305. package/skills/arc-code-review/references/arc-cheatsheet.md +68 -167
  306. package/skills/arc-code-review/references/mongokit-repositories.md +104 -0
  307. package/skills/arc-code-review/references/recipe-events-cache-jobs.md +112 -0
  308. package/skills/arc-code-review/references/recipe-resource.md +100 -0
  309. package/skills/arc-code-review/references/recipe-schemas-fields.md +93 -0
  310. package/skills/arc-code-review/references/recipe-scope-permissions.md +82 -0
  311. package/skills/arc-code-review/references/scaffolding.md +61 -198
  312. package/skills/arc-code-review/references/severity.md +49 -102
  313. package/skills/arc-code-review/references/smells-auth-scope.md +80 -0
  314. package/skills/arc-code-review/references/smells-data-events.md +66 -0
  315. package/skills/arc-code-review/references/smells-imports-style.md +59 -0
  316. package/skills/arc-code-review/references/smells-platform.md +89 -0
  317. package/skills/arc-code-review/references/smells-routes-schemas.md +66 -0
  318. package/skills/arc-module-publishing/SKILL.md +82 -208
  319. package/skills/arc-module-publishing/references/action-presets-and-plugins.md +87 -0
  320. package/skills/arc-module-publishing/references/build-and-types.md +73 -0
  321. package/skills/arc-module-publishing/references/module-lifecycle.md +101 -0
  322. package/skills/arc-module-publishing/references/package-manifest.md +34 -122
  323. package/skills/arc-module-publishing/references/publishing-workflow.md +44 -140
  324. package/skills/arc-module-publishing/references/resource-assembly.md +102 -0
  325. package/skills/arc-module-publishing/references/testing-packages.md +82 -0
  326. package/skills/arc/references/auth.md +0 -729
  327. package/skills/arc/references/integrations.md +0 -452
  328. package/skills/arc/references/mcp.md +0 -691
  329. package/skills/arc/references/production.md +0 -835
  330. package/skills/arc-code-review/references/anti-patterns.md +0 -1008
  331. package/skills/arc-code-review/references/migration-recipes.md +0 -649
  332. package/skills/arc-code-review/references/mongokit-migration.md +0 -360
  333. package/skills/arc-module-publishing/references/authoring-modules.md +0 -327
@@ -1,94 +1,78 @@
1
- # Enterprise Auth — what's in the box
1
+ # Enterprise auth map
2
2
 
3
- Arc 2.13 closes the enterprise-auth gaps without forcing a parallel infrastructure. Sessions / refresh / OAuth flows stay in Better Auth's hands; arc adds the three things arc actually owns: provisioning, agent-mandate gating, and audit chain.
3
+ What arc owns for enterprise auth, what it delegates, and the auth-event audit bridge. Sessions, refresh and OAuth/MFA/SSO stay in Better Auth.
4
4
 
5
- ## In-box (2.13)
5
+ ## In the box
6
6
 
7
- | Capability | Surface | Notes |
7
+ | Need | Surface | File |
8
8
  |---|---|---|
9
- | **SCIM 2.0 provisioning** | `@classytic/arc/scim` | Auto-derived `/scim/v2/Users` + `/scim/v2/Groups` from existing resources. Filter, PATCH, discovery endpoints. Bearer or `verify` callback. → [scim.md](scim.md) |
10
- | **Agent capability mandates** | `requireAgentScope`, `requireMandate`, `requireDPoP` from `@classytic/arc/permissions` | AP2 / Stripe x402 / MCP authorization. `RequestScope.service.mandate` + `.dpopJkt` are first-class. → [agent-auth.md](agent-auth.md) |
11
- | **Auth-event audit chain** | `wireBetterAuthAudit` from `@classytic/arc/auth/audit` | BA's `databaseHooks` + endpoint hooks routed through existing `auditPlugin`. One canonical row shape for resource AND auth events. |
12
- | **Sessions / refresh / OAuth / MFA / SSO providers** | Better Auth | Configure via BA's `secondaryStorage`, `plugins: [twoFactor(), bearer(), apiKey(), ...]`. Arc reads BA tables via the kit overlays. → [auth.md](auth.md) |
13
- | **Multi-role / multi-tenant / parent-child orgs** | `RequestScope` + presets | Pre-2.13. → [multi-tenancy.md](multi-tenancy.md) |
14
- | **Field-level redaction + dynamic ACL + role hierarchy** | `@classytic/arc/permissions` | Pre-2.13. |
15
- | **Resource-op audit + retention + per-resource opt-in** | `@classytic/arc/audit` | Pre-2.13. |
16
- | **API-key admin REST** | BA `apiKey()` plugin + arc overlay | Recipe in [auth.md](auth.md). |
17
-
18
- ## Out-of-box (deliberate)
19
-
20
- | Capability | Why arc doesn't ship it | What to use instead |
21
- |---|---|---|
22
- | **First-party SAML** | BA SAML plugin is the canonical path; arc can't compete with IdP edge cases | Better Auth SAML plugin (community, maturing) or `@node-saml/passport-saml` wrapped in arc's `authenticate` callback |
23
- | **Session storage / Redis sessions** | BA's `secondaryStorage` covers this — duplicating fragments truth | Configure BA's `secondaryStorage: { get, set, delete }` with `ioredis` directly |
24
- | **Refresh-token rotation** | BA owns the session model; arc would have to parallel-implement to add it | BA handles rotation in its session model; for JWT auth, use the existing `isRevoked` hook |
25
- | **DPoP cryptographic proof verification** | One `jose.dpop.verify()` call in your authenticate function — arc would force peer-dep `jose` | `jose` (already a peer of most apps using OAuth/JWT) |
26
- | **Mandate JWT/VC parsing** | Format varies per IdP/issuer; arc validates *what's verified*, not how it's verified | `jose` for JWTs, `did-jwt-vc` for Verifiable Credentials |
27
- | **Device trust / risk scoring** | Out of framework scope; vendor-specific | Castle, Stytch, Auth0 Risk, Persona |
28
- | **SOC2/HIPAA attestations** | Arc gives you the controls; certification is per-deployment | [`docs/compliance/soc2.md`](../../../docs/compliance/soc2.md) maps controls to arc primitives |
29
- | **First-party SSO discovery** (`/.well-known/openid-configuration` aggregation) | No real demand; BA exposes its own well-known paths | BA's `openAPI()` + `mcp()` plugins emit RFC 9728 metadata |
9
+ | IdP provisioning (Okta, Azure AD) | `scimPlugin` from `@classytic/arc/scim` | scim.md |
10
+ | Agent mandates, DPoP | `requireAgentScope`, `requireMandate`, `requireDPoP` from `@classytic/arc/permissions` | agent-auth.md |
11
+ | Auth-event audit | `wireBetterAuthAudit` from `@classytic/arc/auth/audit` | below |
12
+ | Sessions, OAuth, MFA, SSO | Better Auth plugins | auth-better-auth.md |
13
+ | Multi-role, multi-tenant, parent-child orgs | `RequestScope`, presets | multi-tenancy.md |
14
+ | Field redaction, dynamic ACL, role hierarchy | `@classytic/arc/permissions` | auth-permissions.md |
15
+ | Resource-op audit and retention | `@classytic/arc/audit` | production-audit.md |
16
+ | API-key admin | BA `apiKey()` plus overlay | auth-api-keys.md |
30
17
 
31
- ## Sequencing — how the three new pieces compose
18
+ ## Auth-event audit bridge
32
19
 
33
- ```
34
- IdP (Okta / Azure AD)
35
- │
36
- │ SCIM provisioning ──→ /scim/v2/Users ──→ arc user resource
37
- │
38
- │ SAML / OIDC SSO ──→ Better Auth ──→ scope.kind = 'member'
39
- │ │
40
- ▼ │
41
- end-user signs in │
42
- │ │
43
- │ → BA databaseHooks.session.create.after │
44
- │ → wireBetterAuthAudit dispatches │
45
- │ → audit row: { resource:'auth', action:'session.create' }
46
- ▼
47
- end-user delegates to AI agent
48
- │
49
- │ user authorizes mandate (cap, audience, ttl)
50
- │ IdP / your token endpoint mints mandate JWT
51
- ▼
52
- AI agent calls protected route
53
- │
54
- │ Authorization: Mandate <jwt>
55
- │ DPoP: <proof>
56
- │
57
- ▼
58
- arc authenticate fn:
59
- - jose.jwtVerify(mandate, JWKS)
60
- - jose.dpop.verify(proof)
61
- - sets scope = { kind:'service', mandate, dpopJkt, ... }
62
- │
63
- ▼
64
- requireAgentScope({ capability, audience, validateAmount, requireDPoP })
65
- │
66
- ├─ ✓ auditPlugin.custom('invoice','INV-7','pay', { mandate.id, dpopJkt })
67
- │ ↳ same store as session.create row above
68
- │
69
- └─ executes handler
70
- ```
20
+ Routes BA lifecycle events through arc's `auditPlugin`: `resource: 'auth'`, `action` = event name, `documentId` = subject id. One store for resource and auth events.
71
21
 
72
- ## Threat model — what each layer prevents
22
+ ```typescript
23
+ import { betterAuth } from 'better-auth';
24
+ import { organization } from 'better-auth/plugins/organization';
25
+ import { twoFactor } from 'better-auth/plugins/two-factor';
26
+ import { createBetterAuthAdapter } from '@classytic/arc/auth';
27
+ import { wireBetterAuthAudit } from '@classytic/arc/auth/audit';
73
28
 
74
- | Threat | Mitigation |
29
+ const audit = wireBetterAuthAudit({ events: ['session.*', 'user.create', 'mfa.*', 'org.invite.*'] });
30
+
31
+ const auth = betterAuth({
32
+ plugins: [organization(), twoFactor()],
33
+ hooks: audit.hooks, // endpoint hooks: MFA, OAuth, password reset
34
+ databaseHooks: audit.databaseHooks, // session/user create, update, delete
35
+ });
36
+
37
+ const app = await createApp({
38
+ auth: { type: 'betterAuth', betterAuth: createBetterAuthAdapter({ auth }) },
39
+ arcPlugins: { audit: { repository: auditRepo } },
40
+ });
41
+ audit.attach(app); // flush buffered boot events, connect live logger
42
+ ```
43
+
44
+ | Option | Purpose |
75
45
  |---|---|
76
- | Stale offboarded user keeps access | SCIM `DELETE /Users/:id` → resource soft-delete on connector trigger |
77
- | Stolen bearer token replay | `requireDPoP()` — token is bound to agent's keypair |
78
- | Agent overspends user authorization | `requireMandate({ validateAmount, cap })` — per-call ceiling |
79
- | Agent uses payment mandate against wrong invoice | `requireMandate({ audience: ctx => 'invoice:'+ctx.params.id })` |
80
- | Mandate replay after revocation | `expiresAt` (short TTL) + your IdP's revocation endpoint |
81
- | Untraceable agent action | Audit bridge stamps `mandate.id`, `dpopJkt`, `clientId` on every row |
82
- | Org admin abuses elevated scope | `noElevatedBypass: true` on regulated mandates; `arc.scope.elevated` audit event |
83
- | Failed sign-in / MFA flooding | `wireBetterAuthAudit` captures `mfa.failed` events; rate-limit on `clientId` |
46
+ | `events` | Glob patterns (`*` one segment, `**` deep). Default `['session.*', 'user.create', 'user.delete']` |
47
+ | `transform(event)` | Redact or rename; return `null` to drop |
48
+ | `resolveEndpointEvent(phase, ctx)` | Name unclassified endpoint hits; `null` drops |
49
+ | `bufferSize` | Pre-`attach` buffer (default 1000, FIFO drop) |
50
+
51
+ Event names: `session.create|delete|update`, `user.create|update|delete`, `mfa.enroll|verify|failed|disable`, `password.reset.request|complete`, `email.verify`, `org.create|delete`, `org.invite.create|accept|reject`, `org.member.add|remove|role.update`, `apikey.create|delete|failed`, plus `endpoint.before|after|error` for unclassified endpoints.
84
52
 
85
- ## Compliance
53
+ For a plugin author, `audit.asPluginHooks()` returns array-form hooks for `plugins: [{ id, hooks }]`.
86
54
 
87
- See [`docs/compliance/soc2.md`](../../../docs/compliance/soc2.md) and [`docs/compliance/hipaa.md`](../../../docs/compliance/hipaa.md) for the control matrix mapping each requirement (CC6.1 access provisioning, CC7.2 logging, §164.308 admin safeguards) to the specific arc primitive that satisfies it.
55
+ ## Not in arc
56
+
57
+ | Capability | Use instead |
58
+ |---|---|
59
+ | First-party SAML | BA SAML plugin, or `@node-saml/passport-saml` inside `authenticate` |
60
+ | Redis sessions, refresh rotation | BA `secondaryStorage` and session model; JWT auth uses `isRevoked` |
61
+ | DPoP proof or mandate JWT/VC verification | `jose`, `did-jwt-vc` in `authenticate` |
62
+ | Device trust, risk scoring | Vendor (Castle, Stytch, Auth0 Risk) |
63
+ | Compliance attestations | `docs/compliance/soc2.md`, `docs/compliance/hipaa.md` map controls to arc primitives |
88
64
 
89
- ## See also
65
+ ## Threats and mitigations
66
+
67
+ | Threat | Mitigation |
68
+ |---|---|
69
+ | Offboarded user keeps access | SCIM `DELETE /Users/:id` |
70
+ | Stolen bearer replay | `requireDPoP()` |
71
+ | Agent overspends | `requireMandate({ validateAmount })` |
72
+ | Mandate used on wrong resource | `requireMandate({ audience })` |
73
+ | Replay after revocation | Short `expiresAt` plus IdP revocation |
74
+ | Untraceable agent action | `audit.custom` with mandate id and `dpopJkt` |
75
+ | Elevated admin abuse | `noElevatedBypass: true` on regulated mandates; elevation `onElevation` hook |
76
+ | MFA or sign-in flooding | `mfa.failed` audit events; rate limit per client |
90
77
 
91
- - [scim.md](scim.md) — provisioning surface deep-dive
92
- - [agent-auth.md](agent-auth.md) — DPoP + mandate semantics
93
- - [auth.md](auth.md) — Better Auth + multi-plugin matrix
94
- - [`playground/enterprise-auth/`](../../../playground/enterprise-auth/) — full runnable smoke
78
+ Runnable smoke: `playground/enterprise-auth/`.
@@ -0,0 +1,90 @@
1
+ # Events: transactional outbox
2
+
3
+ Persist the event in the same DB transaction as the business write; a relay publishes it at-least-once. Store contract types (`OutboxStore`, `OutboxFailurePolicy`, `OutboxOwnershipError`) come from `@classytic/primitives/outbox`. Arc ships the runtime.
4
+
5
+ ## Outbox as a module (default path)
6
+
7
+ ```typescript
8
+ import { createOutboxModule, repositoryAsOutboxStore, exponentialBackoff } from '@classytic/arc/events';
9
+ import type { OutboxModuleExports } from '@classytic/arc/events';
10
+ import { defineModule, getModuleExports } from '@classytic/arc/factory';
11
+
12
+ const app = await createApp({
13
+ modules: [
14
+ createOutboxModule({
15
+ store: repositoryAsOutboxStore(outboxRepo), // or a factory (app) => store
16
+ relayEveryMs: 5000,
17
+ failurePolicy: ({ attempts }) =>
18
+ attempts >= 5 ? { deadLetter: true } : { retryAt: exponentialBackoff({ attempt: attempts }) },
19
+ }),
20
+ defineModule({
21
+ name: 'order',
22
+ dependsOn: ['outbox'], // missing outbox fails boot
23
+ bootstrap: (f) => makeOrders({ outbox: getModuleExports<OutboxModuleExports>(f, 'outbox').store }),
24
+ }),
25
+ ],
26
+ });
27
+ ```
28
+
29
+ | `createOutboxModule` option | Meaning |
30
+ |---|---|
31
+ | `store` | `OutboxStore` or `(fastify) => OutboxStore` |
32
+ | `transport` | Default: the app's raw event transport (not the `app.events` facade) |
33
+ | `name` | Module name and `dependsOn` key (default `'outbox'`) |
34
+ | `relayEveryMs` | Default 5000 |
35
+ | `batchSize`, `leaseMs`, `consumerId` | Relay tuning; `consumerId` defaults to a per-instance unique id |
36
+ | `failurePolicy` | `({ attempts, error }) => { retryAt } \| { deadLetter: true }`. Set one: without it failed rows retry every poll forever |
37
+ | `onError` | Per-event relay problems (default: structured logger) |
38
+ | `sessionProvider` | Default `() => transactionContext.get()`; `false` opts out |
39
+ | `runOnStart` | Drain backlog at boot (default true) |
40
+ | `health` | Readiness check `<name>.relay` + log alerts; `false` disables. `{ relayLagUnhealthyMs, probeCacheMs, alertEveryMs }` |
41
+
42
+ Exports at `getModuleExports<OutboxModuleExports>(app, 'outbox')`: `store`, `relay` (an `EventOutbox`), `requestDrain()` (coalesced, call after commit), `drain({ maxPasses })` (await in tests), `health()`.
43
+
44
+ ## Writing
45
+
46
+ ```typescript
47
+ await outbox.store(
48
+ createEvent('order.placed', { orderId }, { idempotencyKey: `order:${orderId}:placed` }),
49
+ { session }, // omit inside transactionContext
50
+ );
51
+ ```
52
+
53
+ - `meta.idempotencyKey` maps to `dedupeKey` (duplicates absorbed). Dedupe is scoped per event type.
54
+ - Inside a transactional write the ambient session is used, so the row commits with the domain write.
55
+ - Durable `defineEvent` definitions (money, stock) go through `store`; `app.events.publish` refuses them.
56
+
57
+ ## EventOutbox (standalone)
58
+
59
+ ```typescript
60
+ const outbox = new EventOutbox({ repository: repo, transport, failurePolicy, batchSize: 100, leaseMs: 30000 });
61
+ const r = await outbox.relayBatch();
62
+ // { relayed, attempted, publishFailed, ackFailed, ownershipMismatches, malformed, failHookErrors, deadLettered, usedPublishMany }
63
+ const dead = await outbox.getDeadLettered(100); // DeadLetteredEvent[]
64
+ await outbox.purge(olderThanMs); // delivered rows
65
+ ```
66
+
67
+ Options also include `store` (instead of `repository`), `consumerId`, `onError`, `onPublished`, `usePublishMany`, `sessionProvider`. `MemoryOutboxStore` is the in-memory store for tests.
68
+
69
+ ## Stores
70
+
71
+ `repositoryAsOutboxStore(repository, { visibleAtField? })` adapts any repo-core repository (create, getOne, getAll, deleteMany, findOneAndUpdate). It owns claim leases with a fence token, retry, dead letter, `requeue`, `countByStatus`, `oldestPendingAgeMs`, `purge`. The table needs columns: id (event id), `event`, `type`, `status` (`pending` | `delivered` | `dead_letter`), `attempts`, `visibleAt`, `leaseOwner`, `leaseExpiresAt`, `fenceToken`, `deliveredAt`, `firstFailedAt`, `lastFailedAt`, `lastError`, `dedupeKey` (unique, nullable), `partitionKey`, `headers`, `createdAt`. Index `{ status, visibleAt }`; add a TTL index on `deliveredAt` for retention. Prove a custom store with `runOutboxStoreContract` (see testing.md).
72
+
73
+ ## Operator surface
74
+
75
+ ```typescript
76
+ import { createOutboxAdminModule } from '@classytic/arc/outbox-admin';
77
+ import { requirePlatformRole } from '@classytic/arc/permissions';
78
+
79
+ createOutboxAdminModule({
80
+ store, // needs getDeadLettered, requeue, countByStatus, oldestPendingAgeMs
81
+ permissions: { view: requirePlatformRole('platform-ops'), replay: requirePlatformRole('platform-ops') },
82
+ prefix: '/admin/outbox', // default
83
+ });
84
+ ```
85
+
86
+ Routes: `GET {prefix}/health`, `GET {prefix}/dead-letter?limit=`, `POST {prefix}/dead-letter/:id/replay`. Depends on the outbox module. Gates must be platform-only or boot fails (`allowUnverifiedOperatorPermission` overrides). Payload and stack are hidden unless `exposePayload` / `exposeStack`. Also `readOutboxHealth`, `DEFAULT_RELAY_LAG_UNHEALTHY_MS` from `@classytic/arc/events`.
87
+
88
+ ## Durable webhooks
89
+
90
+ See integrations-webhooks.md (`createDurableWebhookModule`, `webhookPlugin({ durable })`).