@classytic/arc 2.45.2 → 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-DHb1tpu-.mjs → EventTransport-DNgD9NP4.mjs} +3 -4
  4. package/dist/{HookSystem-C1u0EUnt.mjs → HookSystem-DRbPzEcP.mjs} +3 -4
  5. package/dist/{QueryCache--5uAuYPW.d.mts → QueryCache-DdvrGG8Q.d.mts} +1 -3
  6. package/dist/{ResourceRegistry-D2jXWVN_.mjs → ResourceRegistry-Douk51fa.mjs} +15 -4
  7. package/dist/{acquire-DTkA8Lme.mjs → acquire-RbtvDg9s.mjs} +2 -3
  8. package/dist/{actionPermissions-DRVk6m7x.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-D48fUJv1.mjs → authorizationDecision-DeZMrHcm.mjs} +5 -6
  18. package/dist/{base-CZyixEQR.d.mts → base-HXNgPQww.d.mts} +1 -7
  19. package/dist/{boundedMap-DkKiPifd.mjs → boundedMap-2WBh3gM9.mjs} +2 -3
  20. package/dist/{buildHandler-BiZ4VATS.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-Cj0as-P1.mjs → caching-BYRwYrUo.mjs} +3 -4
  24. package/dist/{claimed-ChI13rUR.mjs → claimed-DYlELdnm.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-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-QIZ2560Y.mjs → core-D9rS2BxO.mjs} +9 -12
  47. package/dist/{createActionRouter-CvH84dyx.mjs → createActionRouter-0qkCRzTL.mjs} +7 -8
  48. package/dist/{createAggregationRouter-DGyK2Hp6.mjs → createAggregationRouter-CUf5Esd9.mjs} +9 -10
  49. package/dist/{createApp-CKjZpmq9.mjs → createApp-DZIXfDKD.mjs} +49 -62
  50. package/dist/{createMcpServer-DSztofa9.d.mts → createMcpServer-DeVpqQF-.d.mts} +1 -3
  51. package/dist/{defineAggregation-BLza7Ca4.mjs → defineAggregation-bmKQ4NmC.mjs} +2 -3
  52. package/dist/{defineResource-CEo0gDCb.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-BJTsSnke.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-2p4SL5zm.mjs → errorHandler-dFyGOEoB.mjs} +16 -6
  63. package/dist/{errors-grZkIA8N.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-ItcYBGUs.mjs → eventPlugin-eMhAPtQA.mjs} +10 -12
  67. package/dist/{eventTypes-Ck6fD3ne.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-BRX0Krcj.mjs → fields-LnbCcvsw.mjs} +2 -3
  80. package/dist/{filter-merge-CDc7YMwX.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-hvg7V2g1.mjs → generate-oXoDnpJf.mjs} +7 -12
  83. package/dist/{headers-Cqkg4LzI.mjs → headers-DBd3Qheo.mjs} +3 -4
  84. package/dist/{health-PVt0VjOx.mjs → health-BlJu9GXS.mjs} +2 -3
  85. package/dist/{health-DyeP3mTW.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-jC3rMPzb.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-ptwyzZQ-.mjs → jsonBody-DpRpKR_K.mjs} +3 -4
  125. package/dist/{keys-C1vFuSbv.mjs → keys-FBz6Ull-.mjs} +2 -3
  126. package/dist/{loadResources-CHPDyIPn.mjs → loadResources-Bx1sKPnF.mjs} +4 -5
  127. package/dist/{loadResourcesFromEntry-BkHHTu_B.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-C5bvCiAK.mjs → logger-CbFcIEBZ.mjs} +3 -5
  131. package/dist/{mcpPlugin-C9qohJCF.mjs → mcpPlugin-yix548XX.mjs} +41 -60
  132. package/dist/{memory-CxiTwT0j.mjs → memory-Bgw5dn8N.mjs} +4 -5
  133. package/dist/{metrics-Ckp2zRy-.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-CfnKuIuH.mjs → module-Dsc_nKL5.mjs} +2 -3
  139. package/dist/{multiTenant-CAtYlW6H.d.mts → multiTenant-XCxAUlru.d.mts} +1 -5
  140. package/dist/{multipartBody-BFasGtP9.mjs → multipartBody-B85ek8Kj.mjs} +2 -3
  141. package/dist/observeSend-BK-JN1jK.mjs +20 -0
  142. package/dist/{openapi-DAPxjYHX.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-B4FAkx3A.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-B14c3OMp.mjs → permissions-A1oKtpiC.mjs} +19 -29
  150. package/dist/{pipe-CQv7PsAK.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-CpnTykjb.mjs → plan-KVseuBCL.mjs} +5 -9
  154. package/dist/{plugin-DXTjVg_Q.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-C3VJKRGp.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-CquqYJPy.mjs → presets-qKCehiJM.mjs} +11 -18
  171. package/dist/{projection-CgfSLOSM.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-D0HUISHJ.mjs → queryCachePlugin-3gJj5Rbz.mjs} +8 -10
  174. package/dist/{queryCachePlugin-C2lZjTxk.d.mts → queryCachePlugin-DYQUyeJ9.d.mts} +2 -4
  175. package/dist/{rateLimitKey-AvkBOMkl.mjs → rateLimitKey-Kro---xl.mjs} +2 -3
  176. package/dist/{realtime-CbWtVbqK.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-BVwpAuFI.mjs → registry-BA-_vFYk.mjs} +7 -12
  183. package/dist/{renewingLease-CykpeNcQ.mjs → renewingLease-CMY8YOcc.mjs} +2 -3
  184. package/dist/{replyHelpers-DA51IZio.mjs → replyHelpers-DK9P_XSz.mjs} +3 -4
  185. package/dist/{requestContext-DIWHKDtQ.mjs → requestContext-GYO_0gEw.mjs} +2 -3
  186. package/dist/{requirement-CbiLdQ1n.d.mts → requirement-CTRQjjQx.d.mts} +0 -2
  187. package/dist/{requirement-Cp_fsMDL.mjs → requirement-DeNjZIH3.mjs} +2 -3
  188. package/dist/{resourceRateLimit-Wf6d6FL9.d.mts → resourceRateLimit-DCWglD7V.d.mts} +1 -3
  189. package/dist/{resourceRateLimit-BFuluodF.mjs → resourceRateLimit-tHLbrtWc.mjs} +3 -4
  190. package/dist/{rolldown-runtime-D_lMdYOd.mjs → rolldown-runtime-Kv1fZdLg.mjs} +2 -3
  191. package/dist/{routeValidator-DuLonYwr.mjs → routeValidator-C_H5NanI.mjs} +2 -3
  192. package/dist/{runtimeCapabilities-CydRfm0i.mjs → runtimeCapabilities-DWqbxkyw.mjs} +2 -3
  193. package/dist/{schedules-B693KXxa.mjs → schedules-eO_RzhCU.mjs} +132 -9
  194. package/dist/{schemaConverter-DNvZWTV6.mjs → schemaConverter-DBJrPZN4.mjs} +3 -4
  195. package/dist/{schemaIR-REV2y7Wd.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-Bevxy_ST.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-CfrqPR7A.mjs → shutdown-DzLFbe27.mjs} +2 -3
  205. package/dist/{simpleEqualityMatcher-BJwfuRKP.mjs → simpleEqualityMatcher-DOJhwQ8g.mjs} +2 -3
  206. package/dist/{sse-CuNNWr2z.mjs → sse-2972pVwV.mjs} +8 -9
  207. package/dist/{sseStream-C_2ujAVY.mjs → sseStream-AWLEeNV-.mjs} +3 -4
  208. package/dist/{storage-Cx9Sz3Ou.d.mts → storage-odC5MNKN.d.mts} +0 -2
  209. package/dist/{store-helpers-C8uBGCbb.mjs → store-helpers-VzjgVTkM.mjs} +2 -3
  210. package/dist/{streaming-Bdq_M4d5.mjs → streaming-DvraWW6x.mjs} +2 -3
  211. package/dist/{subscriberIdentity-B-KpZkdl.mjs → subscriberIdentity-Bya56jsg.mjs} +2 -3
  212. package/dist/{tenancy-C5PCvm1h.mjs → tenancy-DSa_0hhw.mjs} +3 -4
  213. package/dist/{tenantPreparation-dYvWrgNa.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-DCqsezX8.mjs → timing-6rQTuCwg.mjs} +3 -5
  225. package/dist/{tracing-Dro5eH6j.d.mts → tracing-JSFiBl5r.d.mts} +0 -2
  226. package/dist/{transactionContext-DrcNyjpv.mjs → transactionContext-DaxYUEgH.mjs} +2 -3
  227. package/dist/{typeGuards-CEl10KPy.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-D9NWjpYc.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-BHig1kHq.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-BG5P7_Vb.mjs → utils-CjjGOT4E.mjs} +20 -30
  244. package/dist/{validate-D_mdOCir.mjs → validate-4RlTKOJb.mjs} +5 -7
  245. package/dist/{versioning-DBGHjPh7.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-DPPfM4m6.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
@@ -1,360 +0,0 @@
1
- # Mongoose → @classytic/mongokit Migration
2
-
3
- For projects that have arc installed but still use raw Mongoose models with hand-rolled repository classes, manual pagination, scattered `pre`/`post` hooks, and per-schema `toJSON` transforms.
4
-
5
- Mongokit is a Mongoose enhancement layer that:
6
- - Wraps a `mongoose.Model` in a `Repository<TDoc>` that implements `MinimalRepo` + `Partial<StandardRepo>` from `@classytic/repo-core` (so it plugs into the arc adapter with no casts).
7
- - Ships the **arc adapter itself** at `@classytic/mongokit/adapter` (since 3.13.0 / arc 2.12). Through arc 2.12 the adapter lived in arc; in arc 2.12 every kit-specific adapter moved out (Mongoose to mongokit, Drizzle to sqlitekit, Prisma to prismakit) so arc no longer pulls a DB driver into any consumer's resolution graph.
8
- - Provides 15+ plugins: `timestampPlugin`, `softDeletePlugin`, `multiTenantPlugin`, `validationChainPlugin`, `cachePlugin`, `auditTrailPlugin`, `auditLogPlugin`, `cascadePlugin`, `customIdPlugin`, `observabilityPlugin`, `elasticSearchPlugin`, `mongoOperationsPlugin`, `aggregateHelpersPlugin`, `fieldFilterPlugin`, `batchOperationsPlugin`.
9
- - Ships `QueryParser`, `AggregationBuilder`, `LookupBuilder`, `PaginationEngine` (offset + keyset auto-detect).
10
- - Provides `withTransaction` helper with auto-retry and standalone fallback.
11
-
12
- **It does NOT**:
13
- - Set `schema.set('toJSON', ...)` — read transforms are framework/controller responsibility (arc handles it via `fieldRules.hidden`).
14
- - Own connection lifecycle — `mongoose.connect()` stays in your bootstrap.
15
-
16
- ---
17
-
18
- ## Detection — is mongokit migration needed?
19
-
20
- Add to the audit detection sweep:
21
-
22
- | Signal | Detection |
23
- |---|---|
24
- | Mongoose without mongokit | `package.json`: `mongoose` present, `@classytic/mongokit` absent |
25
- | Per-model repo class | `Grep "class \\w+Repository\\b"` — count classes |
26
- | Manual `pre`/`post` hooks | `Grep "schema\\.(pre\\|post)\\(['\"]"` |
27
- | Hand-rolled `toJSON` | `Grep "schema\\.set\\(['\"]toJSON\\|toJSON\\s*=\\s*function"` |
28
- | Manual pagination | `Grep "skip\\(.*page\\|countDocuments\\("` |
29
- | Per-method tenant filter | `Grep "organizationId.*req\\.user\\|orgId.*scope"` (paired with `find` / `findOne`) |
30
- | Manual `findByIdAndUpdate(..., { runValidators: true })` | `Grep "runValidators"` |
31
- | Manual transaction session threading | `Grep "session.*startSession\\|session\\.commitTransaction"` |
32
-
33
- If `mongoose` deps + `@classytic/mongokit` absent → every model is a candidate. Estimate: a typical 150 LOC repo class shrinks to ~30 LOC with mongokit + plugins.
34
-
35
- ---
36
-
37
- ## Mapping table — Mongoose pattern → mongokit replacement
38
-
39
- | Hand-rolled Mongoose | Mongokit replacement |
40
- |---|---|
41
- | `class UserRepository { async create(d) { return User.create(d) } /* + 15 more */ }` | `new Repository(User)` (or extend for domain verbs) |
42
- | `userSchema.pre('save', function(next) { this.updatedAt = new Date(); next(); })` | `timestampPlugin()` |
43
- | `userSchema.set('toJSON', { transform: (_, ret) => { delete ret.password; ... } })` | Arc `fieldRules: { password: { hidden: true } }` (mongokit doesn't do this) |
44
- | `Model.find({ deletedAt: null, ...filters })` everywhere | `softDeletePlugin({ deletedField: 'deletedAt' })` |
45
- | `Model.find({ ...filters, organizationId: orgId })` everywhere | `multiTenantPlugin({ tenantField: 'organizationId', contextKey: 'organizationId' })` |
46
- | Manual pagination wrappers (skip/limit + countDocuments) | `repo.getAll({ page, limit, sort })` (offset) or `repo.getAll({ sort, after: cursor })` (keyset auto-detect) |
47
- | `Model.findOne({ email })` for unique check before create | `validationChainPlugin([uniqueField('email')])` |
48
- | Manual `findOneAndUpdate(..., { new: true, runValidators: true })` | `repo.update(id, data)` (validators on by default) |
49
- | Manual `mongoose.startSession()` + `withTransaction` boilerplate | `repo.withTransaction(async (session) => { ... })` |
50
- | Manual cache invalidation around `Model.find` | `cachePlugin({ adapter, ttl, byIdTtl })` |
51
- | Manual audit-log writes on every mutation | `auditTrailPlugin()` + `auditLogPlugin()` |
52
- | Hand-coded URL → query parsing | `new QueryParser({ schema, allowedFilterFields, ... })` |
53
- | Manual `$lookup`/`$match` aggregation building | `AggregationBuilder` / `LookupBuilder` |
54
- | Stripe-style prefixed IDs (`cus_xxx`, `ord_xxx`) | `customIdPlugin({ strategy, publicIdField })` |
55
-
56
- Hooks fire with priority ordering: `POLICY` (100, multi-tenant + soft-delete pre-filtering) → `CACHE` (200) → `OBSERVABILITY` (300) → `DEFAULT` (500, user hooks).
57
-
58
- ---
59
-
60
- ## Recipe — User model migration
61
-
62
- ### Before — Mongoose only (~140 LOC)
63
-
64
- ```typescript
65
- // models/user.ts
66
- import { Schema, model, Document } from 'mongoose';
67
-
68
- export interface UserDoc extends Document {
69
- name: string;
70
- email: string;
71
- password: string;
72
- organizationId: Types.ObjectId;
73
- deletedAt: Date | null;
74
- createdAt: Date;
75
- updatedAt: Date;
76
- }
77
-
78
- const userSchema = new Schema<UserDoc>({
79
- name: { type: String, required: true },
80
- email: { type: String, required: true, unique: true },
81
- password: { type: String, required: true },
82
- organizationId: { type: Schema.Types.ObjectId, required: true, ref: 'Organization' },
83
- deletedAt: { type: Date, default: null },
84
- createdAt: { type: Date },
85
- updatedAt: { type: Date },
86
- });
87
-
88
- userSchema.pre('save', function (next) {
89
- if (this.isNew) this.createdAt = new Date();
90
- this.updatedAt = new Date();
91
- next();
92
- });
93
-
94
- userSchema.set('toJSON', {
95
- transform: (_doc, ret) => {
96
- delete ret.password;
97
- delete ret.__v;
98
- return ret;
99
- },
100
- });
101
-
102
- export const User = model<UserDoc>('User', userSchema);
103
- ```
104
-
105
- ```typescript
106
- // repositories/userRepository.ts
107
- import { User, UserDoc } from '../models/user.js';
108
-
109
- export class UserRepository {
110
- async create(data: Partial<UserDoc>, orgId: string) {
111
- const exists = await User.findOne({ email: data.email });
112
- if (exists) throw new Error('Email taken');
113
- return User.create({ ...data, organizationId: orgId });
114
- }
115
-
116
- async getById(id: string, orgId: string) {
117
- return User.findOne({ _id: id, organizationId: orgId, deletedAt: null }).lean();
118
- }
119
-
120
- async list(orgId: string, page: number, limit: number, filters: Record<string, unknown>) {
121
- const query = { ...filters, organizationId: orgId, deletedAt: null };
122
- const skip = (page - 1) * limit;
123
- const docs = await User.find(query).skip(skip).limit(limit).sort({ createdAt: -1 }).lean();
124
- const total = await User.countDocuments(query);
125
- return { docs, total, page, pages: Math.ceil(total / limit) };
126
- }
127
-
128
- async update(id: string, data: Partial<UserDoc>, orgId: string) {
129
- return User.findOneAndUpdate(
130
- { _id: id, organizationId: orgId, deletedAt: null },
131
- { ...data, updatedAt: new Date() },
132
- { new: true, runValidators: true },
133
- ).lean();
134
- }
135
-
136
- async softDelete(id: string, orgId: string) {
137
- return User.findOneAndUpdate(
138
- { _id: id, organizationId: orgId, deletedAt: null },
139
- { deletedAt: new Date() },
140
- { new: true },
141
- ).lean();
142
- }
143
-
144
- async restore(id: string, orgId: string) {
145
- return User.findOneAndUpdate(
146
- { _id: id, organizationId: orgId, deletedAt: { $ne: null } },
147
- { deletedAt: null },
148
- { new: true },
149
- ).lean();
150
- }
151
- }
152
- ```
153
-
154
- ### After — Mongoose + mongokit (~50 LOC)
155
-
156
- ```typescript
157
- // models/user.ts (unchanged structure — drop pre('save') and toJSON transform)
158
- import { Schema, model, Document } from 'mongoose';
159
-
160
- export interface UserDoc extends Document {
161
- name: string;
162
- email: string;
163
- password: string;
164
- organizationId: Types.ObjectId;
165
- deletedAt: Date | null;
166
- createdAt: Date;
167
- updatedAt: Date;
168
- }
169
-
170
- const userSchema = new Schema<UserDoc>({
171
- name: { type: String, required: true },
172
- email: { type: String, required: true, unique: true },
173
- password: { type: String, required: true },
174
- organizationId: { type: Schema.Types.ObjectId, required: true, ref: 'Organization' },
175
- deletedAt: { type: Date, default: null },
176
- createdAt: { type: Date },
177
- updatedAt: { type: Date },
178
- });
179
-
180
- export const User = model<UserDoc>('User', userSchema);
181
- ```
182
-
183
- ```typescript
184
- // repositories/userRepository.ts
185
- import { Repository, methodRegistryPlugin, timestampPlugin, softDeletePlugin,
186
- multiTenantPlugin, validationChainPlugin } from '@classytic/mongokit';
187
- import { uniqueField } from '@classytic/mongokit/plugins/validators';
188
- import { User, UserDoc } from '../models/user.js';
189
-
190
- export const userRepo = new Repository<UserDoc>(User, [
191
- methodRegistryPlugin(),
192
- timestampPlugin(),
193
- multiTenantPlugin({ tenantField: 'organizationId', contextKey: 'organizationId', required: true }),
194
- softDeletePlugin({ deletedField: 'deletedAt' }),
195
- validationChainPlugin([uniqueField('email', 'Email already in use')]),
196
- ]);
197
- ```
198
-
199
- ```typescript
200
- // resources/user/user.resource.ts — arc resource consuming the mongokit repo
201
- import { defineResource, requireRoles, allowPublic, fields } from '@classytic/arc';
202
- import { createMongooseAdapter } from '@classytic/mongokit/adapter'; // arc 2.12+: from the kit
203
- import { User } from '../../models/user.js';
204
- import { userRepo } from '../../repositories/userRepository.js';
205
-
206
- export const userResource = defineResource({
207
- name: 'user',
208
- // mongokit >=3.21 defaults schemaGenerator to buildCrudSchemasFromModel
209
- // (pre-3.21: wire it explicitly, or OpenAPI/MCP bodies come out null)
210
- adapter: createMongooseAdapter({ model: User, repository: userRepo }),
211
- presets: ['softDelete'], // multiTenant is at the repo layer (mongokit), so we don't need the arc preset too — pick one
212
- permissions: {
213
- list: requireRoles(['admin']),
214
- get: allowPublic(),
215
- create: requireRoles(['admin']),
216
- update: requireRoles(['admin']),
217
- delete: requireRoles(['admin']),
218
- },
219
- schemaOptions: {
220
- fieldRules: {
221
- password: fields.hidden(),
222
- organizationId: { systemManaged: true },
223
- },
224
- },
225
- });
226
- ```
227
-
228
- **What changed:**
229
- - Repository class: 80 LOC → 8 LOC.
230
- - `pre('save')` for timestamps → `timestampPlugin()` (1 line).
231
- - Tenant scoping: 5 duplicated places → 1 plugin.
232
- - Soft-delete with `restore`/`getDeleted`: ~30 LOC → 1 plugin.
233
- - Email uniqueness: hand-coded `findOne` race → `validationChainPlugin([uniqueField(...)])`.
234
- - `toJSON` transform → arc `fields.hidden()` (works on `.lean()` too).
235
- - `findByIdAndUpdate(..., { runValidators: true })` boilerplate → `repo.update(id, data)`.
236
-
237
- ---
238
-
239
- ## Where to put multi-tenant scoping — repo or resource?
240
-
241
- **Decision rule:** put it in **one** layer, not both. Two recommended patterns:
242
-
243
- **Option A — at the repo layer (mongokit plugin):**
244
- ```typescript
245
- new Repository(User, [multiTenantPlugin({ tenantField: 'organizationId', contextKey: 'organizationId' })]);
246
- ```
247
- - Pros: works for non-HTTP callers (jobs, CLI, hooks). Centralized.
248
- - Cons: requires passing a `RepositoryContext` with `organizationId` to every call.
249
-
250
- **Option B — at the arc resource layer (preset):**
251
- ```typescript
252
- defineResource({ presets: [{ name: 'multiTenant', tenantField: 'organizationId' }] });
253
- ```
254
- - Pros: arc handles context threading from `request.scope` automatically.
255
- - Cons: scoped only to HTTP/MCP entry points; jobs/CLI need to thread context themselves.
256
-
257
- **For new code:** prefer (B) — arc is the boundary. If you have non-HTTP entrypoints that hit the same repo, layer (A) on top of (B) and let the repo plugin be a defense-in-depth check (it'll no-op when arc has already injected the filter).
258
-
259
- ---
260
-
261
- ## Hook system parity
262
-
263
- Mongoose `schema.pre('save', ...)` is per-model and per-method. Mongokit hooks are per-repo and per-event with priority ordering:
264
-
265
- ```typescript
266
- repo.on('before:create', async (ctx) => { /* validate, mutate ctx.data */ });
267
- repo.on('after:create', async (event) => { /* event = { context, result } */ });
268
- repo.on('error:create', async (event) => { /* event = { context, error } */ });
269
- ```
270
-
271
- **Events:** `before:{create|update|delete|findAll|getById|...}`, `after:*`, `error:*`.
272
- **Priorities:** `POLICY = 100` (filter injection runs first) → `CACHE = 200` → `OBSERVABILITY = 300` → `DEFAULT = 500`.
273
-
274
- User hooks default to `DEFAULT` (500). Override with `repo.on('before:create', fn, { priority: HOOK_PRIORITY.POLICY })`.
275
-
276
- Migrating Mongoose hooks:
277
- - `schema.pre('save', ...)` (insert + update both) → split into `before:create` and `before:update`.
278
- - `schema.pre('findOneAndUpdate', ...)` → `before:update`.
279
- - `schema.pre('remove', ...)` → `before:delete`.
280
- - `schema.post('save', ...)` → `after:create` / `after:update`.
281
-
282
- ---
283
-
284
- ## Pagination
285
-
286
- Auto-detected by `getAll`:
287
- ```typescript
288
- // Offset (page-based)
289
- await repo.getAll({ page: 2, limit: 20, sort: { createdAt: -1 } });
290
- // → { method: 'offset', docs, total, pages, hasNext, hasPrev }
291
-
292
- // Keyset (cursor)
293
- const p1 = await repo.getAll({ sort: { createdAt: -1 }, limit: 20 });
294
- const p2 = await repo.getAll({ sort: { createdAt: -1 }, limit: 20, after: p1.next });
295
- // → { method: 'keyset', docs, hasMore, next }
296
-
297
- // Aggregate paginate (with $near rewriting handled)
298
- await repo.aggregatePipelinePaginate(pipeline, { page, limit });
299
- ```
300
-
301
- Drop hand-rolled `Math.ceil(total / limit)` and pagination DTOs — mongokit returns the envelope.
302
-
303
- ---
304
-
305
- ## Transactions
306
-
307
- ```typescript
308
- await repo.withTransaction(async (session) => {
309
- await repo.update(id, { status: 'paid' }, { session });
310
- await invoiceRepo.create(invoiceData, { session });
311
- });
312
- // Auto-retries on TransientTransactionError / UnknownTransactionCommitResult
313
- // Falls back to non-transactional when running on standalone Mongo (with allowFallback: true)
314
- ```
315
-
316
- Cross-repo transaction:
317
- ```typescript
318
- import { withTransaction } from '@classytic/mongokit';
319
- await withTransaction(mongoose.connection, async (session) => {
320
- await orderRepo.update(id, ..., { session });
321
- await invoiceRepo.create(..., { session });
322
- });
323
- ```
324
-
325
- ---
326
-
327
- ## Per-resource adoption order
328
-
329
- For each Mongoose model in the project:
330
-
331
- 1. Drop `pre('save')` for timestamps; add `timestampPlugin()` to the repo.
332
- 2. Drop `schema.set('toJSON', ...)`; declare sensitive fields in arc `fieldRules: { password: fields.hidden() }`.
333
- 3. Replace the per-model repository class with `new Repository(Model, [...plugins])`.
334
- 4. Convert Mongoose hooks (`schema.pre/post`) to `repo.on('before:*'/'after:*', ...)`.
335
- 5. If multi-tenant: pick repo-layer or resource-layer scoping (one, not both).
336
- 6. If soft-delete: add `softDeletePlugin` (drops the manual `deletedAt: null` filter scattered across reads).
337
- 7. Replace pagination wrappers with `repo.getAll(...)`.
338
- 8. Wire the repo into the arc resource via `createMongooseAdapter({ model, repository: repo, schemaGenerator: buildCrudSchemasFromModel })`.
339
- 9. Run the existing test suite — should pass with no logic changes (mongokit's defaults match Mongoose semantics).
340
- 10. Add `npm run typecheck:tests` step in CI to lock conformance with `@classytic/repo-core`'s `StandardRepo`.
341
-
342
- ---
343
-
344
- ## Conformance gate
345
-
346
- If consumers see `as unknown as RepositoryLike<T>` casts when wiring a repo into the mongoose adapter, that's drift. Mongokit's `tests/unit/standard-repo-assignment.test-d.ts` proves whole-interface assignment via TypeScript. Run `npm run typecheck:tests` in mongokit; if it fails, the published version drifted from the contract — pin to a known-good version or open a PR.
347
-
348
- In the client project, prefer `createMongooseAdapter({ model, repository })` from `@classytic/mongokit/adapter` over manual `RepositoryLike` shaping — it accepts mongokit-native repos with no casts, and since mongokit 3.21 `schemaGenerator` defaults to `buildCrudSchemasFromModel` (`schemaGenerator: false` opts out — see anti-patterns §32f before recommending that).
349
-
350
-
351
- ## What mongokit does NOT do
352
-
353
- Be explicit so the audit doesn't recommend it for the wrong job:
354
-
355
- - **Connection management.** `mongoose.connect()` stays in your bootstrap.
356
- - **Response transforms.** No `_id` → `id` rewriting, no field stripping. Use arc `fieldRules.hidden` or controller-level mapping.
357
- - **Type generation.** No runtime codegen. Declare `interface UserDoc extends Document` manually (or use Mongoose's `InferSchemaType`).
358
- - **Versioning.** Use `mongoOperationsPlugin` + `$inc` on `__v`, or external `mongoose-version`.
359
- - **CLI scaffolding.** Mongokit ships no CLI — use `arc generate resource <name>` which creates a mongokit-style repo.
360
- - **Vector/Atlas Search.** Mentioned in roadmap; not shipped in 3.12.x. Use `elasticSearchPlugin` for ES, or wire your own.