@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,9 +1,8 @@
1
1
 
2
- import { F as ResourceDefinition, G as CrudRouteKey, M as ResourceRegistry, N as RouteRow, S as IntrospectionPluginOptions, V as ResolvedTenantPurge, j as RegisterOptions, o as RegistryEntry } from "../index-WH7xgvxS.mjs";
3
- import "../fastify-augmentation-DRlCIWE9.mjs";
2
+ import { F as ResourceDefinition, G as CrudRouteKey, M as ResourceRegistry, N as RouteRow, S as IntrospectionPluginOptions, V as ResolvedTenantPurge, j as RegisterOptions, o as RegistryEntry } from "../index-Cy2-QffW.mjs";
3
+ import "../fastify-augmentation-bzkWPt1f.mjs";
4
4
  import { TenantPurgeProgress, TenantPurgeStrategy } from "@classytic/repo-core/repository";
5
5
  import { FastifyPluginAsync } from "fastify";
6
- //#region src/registry/assertNoTenantData.d.ts
7
6
  interface AssertNoTenantDataOptions {
8
7
  readonly organizationId: string;
9
8
  /**
@@ -61,8 +60,6 @@ interface AssertNoTenantDataReport {
61
60
  * ```
62
61
  */
63
62
  export declare function assertNoTenantData(registry: ResourceRegistry, options: AssertNoTenantDataOptions): Promise<AssertNoTenantDataReport>;
64
- //#endregion
65
- //#region src/registry/purgeResource.d.ts
66
63
  /**
67
64
  * Outcome for one resource. Wider than `TenantPurgeResult` because it
68
65
  * carries the resource name + tenantField for the aggregate report,
@@ -90,8 +87,6 @@ interface PurgeResourceOutcome {
90
87
  };
91
88
  readonly durationMs?: number;
92
89
  }
93
- //#endregion
94
- //#region src/registry/cascadeOrgDelete.d.ts
95
90
  /**
96
91
  * Per-resource result row. One entry for every resource Arc attempted to
97
92
  * cascade-delete for the given org. `deletedCount: -1` means the adapter
@@ -275,11 +270,7 @@ export declare function getCascadingResourcesWithMetadata(registry: ResourceRegi
275
270
  * @param options Org id + filters + logger + progress + signal.
276
271
  */
277
272
  export declare function cascadeDeleteForOrganization(registry: ResourceRegistry, options: CascadeOptions): Promise<CascadeReport>;
278
- //#endregion
279
- //#region src/registry/introspectionPlugin.d.ts
280
273
  declare const _default: FastifyPluginAsync<IntrospectionPluginOptions>;
281
- //#endregion
282
- //#region src/registry/manifest.d.ts
283
274
  /** Mount-point string the FE uses to derive the URL for an action call. */
284
275
  type ActionMount = "/:id/action" | "/action";
285
276
  /**
@@ -349,5 +340,4 @@ export declare function buildResourceManifest(resource: ResourceDefinition): Res
349
340
  * module into the codegen path.
350
341
  */
351
342
  export declare function buildResourceManifestFromRegistry(entry: RegistryEntry): ResourceManifest;
352
- //#endregion
353
343
  export { type ActionManifestEntry, type ActionMount, type AggregationManifestEntry, type AssertNoTenantDataOptions, type AssertNoTenantDataReport, type CascadeCheckpoint, type CascadeCheckpointState, type CascadeOptions, type CascadeReport, type CascadeResourceReport, type CustomRouteManifestEntry, type IntrospectionPluginOptions, type RegisterOptions, type ResourceManifest, ResourceRegistry, type RouteRow, type TenantDataLeak, _default as introspectionPlugin };
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
2
- import { a as getCascadingResources, i as cascadeDeleteForOrganization, n as buildResourceManifestFromRegistry, o as getCascadingResourcesWithMetadata, r as introspectionPlugin_default, s as assertNoTenantData, t as buildResourceManifest } from "../registry-BVwpAuFI.mjs";
3
- import { t as ResourceRegistry } from "../ResourceRegistry-D2jXWVN_.mjs";
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
+ import { a as getCascadingResources, i as cascadeDeleteForOrganization, n as buildResourceManifestFromRegistry, o as getCascadingResourcesWithMetadata, r as introspectionPlugin_default, s as assertNoTenantData, t as buildResourceManifest } from "../registry-y9ZA-R_J.mjs";
3
+ import { t as ResourceRegistry } from "../ResourceRegistry-23Ml6FNe.mjs";
4
4
  export { ResourceRegistry, assertNoTenantData, buildResourceManifest, buildResourceManifestFromRegistry, cascadeDeleteForOrganization, getCascadingResources, getCascadingResourcesWithMetadata, introspectionPlugin_default as introspectionPlugin };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "./constants-D_aiew34.mjs";
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "./constants-Cx7BcnHT.mjs";
3
3
  import fp from "fastify-plugin";
4
- //#region src/registry/assertNoTenantData.ts
4
+ // src/registry/assertNoTenantData.ts
5
5
  /**
6
6
  * Walk every cascading resource, run a tenant-scoped count, compare
7
7
  * against the strategy's expected outcome.
@@ -73,8 +73,7 @@ async function assertNoTenantData(registry, options) {
73
73
  leaks
74
74
  };
75
75
  }
76
- //#endregion
77
- //#region src/registry/purgeResource.ts
76
+ // src/registry/purgeResource.ts
78
77
  /**
79
78
  * Run the resolved strategy against one resource's repository.
80
79
  *
@@ -179,8 +178,7 @@ async function purgeResource(resourceName, tenantField, organizationId, resolved
179
178
  };
180
179
  }
181
180
  }
182
- //#endregion
183
- //#region src/registry/cascadeOrgDelete.ts
181
+ // src/registry/cascadeOrgDelete.ts
184
182
  /**
185
183
  * Names of resources flagged for cascade — used by audit scripts.
186
184
  * A resource is cascading when its resolved strategy isn't `disabled`
@@ -394,8 +392,7 @@ async function runWithConcurrency(items, concurrency, fn) {
394
392
  await Promise.all(workers);
395
393
  return results;
396
394
  }
397
- //#endregion
398
- //#region src/registry/introspectionPlugin.ts
395
+ // src/registry/introspectionPlugin.ts
399
396
  const introspectionPlugin = async (fastify, opts = {}) => {
400
397
  const { prefix = "/_resources", authRoles = ["superadmin"], enabled = true } = opts;
401
398
  if (!enabled) {
@@ -439,8 +436,7 @@ const introspectionPlugin = async (fastify, opts = {}) => {
439
436
  fastify.log?.debug?.(`Introspection API at ${prefix}`);
440
437
  };
441
438
  var introspectionPlugin_default = fp(introspectionPlugin, { name: "arc-introspection" });
442
- //#endregion
443
- //#region src/registry/manifest.ts
439
+ // src/registry/manifest.ts
444
440
  /**
445
441
  * Resource metadata for frontend code generators — `{ name, prefix, idField,
446
442
  * versionField?, crudOps, actions[] }`, where each action carries its `mount`
@@ -556,5 +552,4 @@ function buildResourceManifestFromRegistry(entry) {
556
552
  ...entry.versionField !== void 0 ? { versionField: entry.versionField } : {}
557
553
  };
558
554
  }
559
- //#endregion
560
555
  export { getCascadingResources as a, cascadeDeleteForOrganization as i, buildResourceManifestFromRegistry as n, getCascadingResourcesWithMetadata as o, introspectionPlugin_default as r, assertNoTenantData as s, buildResourceManifest as t };
@@ -1,18 +1,11 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
2
- import { t as transactionContext } from "./transactionContext-DrcNyjpv.mjs";
3
- import { n as requestContext } from "./requestContext-DIWHKDtQ.mjs";
4
- import { n as evictToSize, r as touch } from "./boundedMap-DkKiPifd.mjs";
5
- import { i as resolveEventTransport } from "./EventTransport-DHb1tpu-.mjs";
6
- import { t as emitObserved } from "./eventPlugin-ItcYBGUs.mjs";
7
- import { n as canReportHealth, r as readOutboxHealth } from "./health-PVt0VjOx.mjs";
8
- import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "./store-helpers-C8uBGCbb.mjs";
9
- import { t as claimedAttempts } from "./claimed-ChI13rUR.mjs";
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
+ import { n as evictToSize, r as touch } from "./boundedMap-CtdzpJ3X.mjs";
3
+ import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "./store-helpers-D-n5cwy5.mjs";
4
+ import { t as claimedAttempts } from "./claimed-BLecr1j3.mjs";
10
5
  import { and, anyOf, eq, lte, ne, or } from "@classytic/repo-core/filter";
11
- import { randomBytes } from "node:crypto";
12
6
  import { InvalidOutboxEventError, OutboxConflictError, OutboxOwnershipError, outboxPayloadFingerprint } from "@classytic/primitives/outbox";
13
7
  import { update } from "@classytic/repo-core/update";
14
- import { hostname } from "node:os";
15
- //#region src/events/outbox/backoff.ts
8
+ // src/events/outbox/backoff.ts
16
9
  /**
17
10
  * Compute a `retryAt` `Date` using exponential backoff with jitter.
18
11
  *
@@ -56,8 +49,7 @@ function exponentialBackoff(options) {
56
49
  const jittered = jitter > 0 ? capped * (1 + Math.random() * jitter) : capped;
57
50
  return new Date(now + jittered);
58
51
  }
59
- //#endregion
60
- //#region src/events/repository-outbox-adapter.ts
52
+ // src/events/repository-outbox-adapter.ts
61
53
  /** A row read back from the repository that carries its event. */
62
54
  function isStoredRow(value) {
63
55
  if (typeof value !== "object" || value === null) return false;
@@ -387,8 +379,7 @@ function repositoryAsOutboxStore(repository, options) {
387
379
  }
388
380
  };
389
381
  }
390
- //#endregion
391
- //#region src/events/outbox/relay.ts
382
+ // src/events/outbox/relay.ts
392
383
  /** Default outbox retention — delivered events older than this are eligible for purge */
393
384
  const DEFAULT_OUTBOX_RETENTION_MS = 6048e5;
394
385
  const DEFAULT_LEASE_MS = 3e4;
@@ -748,293 +739,4 @@ function normalizeError(err) {
748
739
  };
749
740
  return { message: String(err) };
750
741
  }
751
- //#endregion
752
- //#region src/events/outbox-module.ts
753
- /**
754
- * The OUTBOX as a module — so the store is a SLOT other modules depend on, not a value the host
755
- * threads by hand.
756
- *
757
- * ## The failure this exists to make impossible
758
- *
759
- * A durable store passed as a constructor argument to N consumers will eventually miss one, and
760
- * the miss is silent. Observed in two independent ERP hosts on the same fleet:
761
- *
762
- * - one passed an outbox to its revenue-attach seam and **not** to `createOrder`, so
763
- * `order:created` published fire-and-forget — a failed publish discarded the revenue trigger
764
- * entirely: no attach, no dead-letter, no log. Cash collected, nothing recorded.
765
- * - the other had the identical gap, written independently.
766
- *
767
- * Six consumers had to be wired by hand in each host (order kernel, revenue kernel, access
768
- * kernel, revenue-attach durability, line-activation dead letters, promo-commit dead letters).
769
- * That is not a discipline problem; it is a design problem.
770
- *
771
- * As a module the store is registered ONCE and read from the registry. A consumer declares
772
- * `dependsOn: ['outbox']` and arc refuses to boot without it — the omission becomes a startup
773
- * failure instead of a quiet data-loss window.
774
- *
775
- * ## What this module does NOT do
776
- *
777
- * It does not build a store. Store construction is store-specific (a mongo model, a SQL table),
778
- * and arc is deliberately storage-agnostic — `repositoryAsOutboxStore` already adapts any
779
- * repository, and kits own their own schema (e.g. `@classytic/mongokit/outbox`). This module owns
780
- * the three things that are genuinely arc's: the module SLOT, the relay SCHEDULE, and shutdown.
781
- */
782
- /**
783
- * The store contract is `@classytic/primitives/outbox`'s, not arc's — arc adapts to it rather
784
- * than owning it, which is why a kit (mongokit) can supply a store with no arc dependency.
785
- */
786
- /** Default relay cadence. Frequent enough that a retry is not a user-visible delay. */
787
- const DEFAULT_RELAY_EVERY_MS = 5e3;
788
- /** How long the readiness check reuses a relay-health reading. See `health.probeCacheMs`. */
789
- const DEFAULT_PROBE_CACHE_MS = 5e3;
790
- /** How often an unhealthy outbox is logged. See `health.alertEveryMs`. */
791
- const DEFAULT_HEALTH_ALERT_EVERY_MS = 3e5;
792
- /**
793
- * One relay identity per RELAY INSTANCE — `<name>:<hostname>:<pid>:<random>`.
794
- *
795
- * A lease identifies an independently executing CLAIMANT, not a crash domain.
796
- * Arc lets two outbox modules coexist (`name` is the `dependsOn` key), each
797
- * with its own schedule arm, and nothing stops two of them pointing at the
798
- * same store: they tick independently, so they are two claimants and must be
799
- * two identities. Scoping this per-process instead would have made the module
800
- * WEAKER than the primitive it wraps — `EventOutbox`'s own fallback is already
801
- * per-instance — and would leave the store unable to tell the two apart after
802
- * a lease expiry, which is exactly the stale-owner hole this replaced.
803
- *
804
- * Every component earns its place: `name` distinguishes co-resident modules,
805
- * `hostname:pid` makes a lease row legible in ops tooling, and the random
806
- * suffix breaks the tie a container restart creates — same hostname, often the
807
- * same pid, and the restarted process must not inherit a predecessor's
808
- * identity while that predecessor's lease is still live.
809
- *
810
- * Called once per `bootstrap()`, so the id is stable across every tick of the
811
- * relay it belongs to — which the lease depends on.
812
- */
813
- function mintConsumerId(name) {
814
- return `${name}:${hostname()}:${process.pid}:${randomBytes(4).toString("hex")}`;
815
- }
816
- /**
817
- * Compose the outbox as a module.
818
- *
819
- * ```ts
820
- * // host
821
- * const model = createOutboxModel(connection, { visibleAtField: 'nextVisibleAt' });
822
- * createApp({ modules: [
823
- * createOutboxModule({
824
- * store: repositoryAsOutboxStore(new Repository(model), { visibleAtField: 'nextVisibleAt' }),
825
- * onError: (err, ctx) => app.log.error({ err, ...ctx }, 'outbox relay'),
826
- * }),
827
- * …
828
- * ]});
829
- *
830
- * // consumer module
831
- * defineModule({
832
- * name: 'order',
833
- * dependsOn: ['outbox'],
834
- * bootstrap: (f) => createOrder({
835
- * outbox: getModuleExports<OutboxModuleExports>(f, 'outbox').store,
836
- * }),
837
- * });
838
- * ```
839
- *
840
- * `dependsOn` is doing real work there: it both orders the bootstraps and makes a missing outbox a
841
- * boot error naming the module that needed it.
842
- */
843
- function createOutboxModule(options) {
844
- const name = options.name ?? "outbox";
845
- const relayEveryMs = options.relayEveryMs ?? DEFAULT_RELAY_EVERY_MS;
846
- const lagUnhealthyMs = (options.health === false ? void 0 : options.health?.relayLagUnhealthyMs) ?? 3e5;
847
- const probeCacheMs = (options.health === false ? void 0 : options.health?.probeCacheMs) ?? DEFAULT_PROBE_CACHE_MS;
848
- if (!Number.isFinite(probeCacheMs) || probeCacheMs < 0) throw new Error(`Outbox module "${name}": health.probeCacheMs must be a non-negative number, got ${String(probeCacheMs)}.`);
849
- const alertEveryMs = options.health === false ? 0 : options.health?.alertEveryMs ?? DEFAULT_HEALTH_ALERT_EVERY_MS;
850
- if (!Number.isFinite(alertEveryMs) || alertEveryMs < 0) throw new Error(`Outbox module "${name}": health.alertEveryMs must be a non-negative number, got ${String(alertEveryMs)}.`);
851
- let log;
852
- /** The unmeasurable-store warning is said once, not every alert tick. */
853
- let warnedUnmeasurable = false;
854
- /**
855
- * The readiness probe's reading, reused for `probeCacheMs` and shared by
856
- * concurrent probes (single-flight). A failed or unmeasurable reading is
857
- * cached as unhealthy for the same window — retrying a failing store on
858
- * every probe is load on the thing that is already failing.
859
- */
860
- let probeReading;
861
- let probeInFlight;
862
- const probeHealthy = (read) => {
863
- if (probeReading && Date.now() - probeReading.at < probeCacheMs) return Promise.resolve(probeReading.healthy);
864
- probeInFlight ??= read().then((h) => h.healthy, () => false).then((healthy) => {
865
- probeReading = {
866
- at: Date.now(),
867
- healthy
868
- };
869
- return healthy;
870
- }).finally(() => {
871
- probeInFlight = void 0;
872
- });
873
- return probeInFlight;
874
- };
875
- /**
876
- * Built at bootstrap and reused by the schedule.
877
- *
878
- * Not rebuilt per tick: `EventOutbox` carries the consumer id the lease is keyed on, and a fresh
879
- * instance per tick would be a fresh claimant every few seconds — which defeats the lease it
880
- * depends on for exactly-once publishing.
881
- */
882
- let exports;
883
- /** Passes THIS module started (nudge, schedule) that have not settled — `drain()` waits on them. */
884
- const inFlightPasses = /* @__PURE__ */ new Set();
885
- const trackPass = (pass) => {
886
- inFlightPasses.add(pass);
887
- const untrack = () => {
888
- inFlightPasses.delete(pass);
889
- };
890
- pass.then(untrack, untrack);
891
- return pass;
892
- };
893
- return {
894
- name,
895
- bootstrap: (fastify) => {
896
- log = fastify.log;
897
- const store = typeof options.store === "function" ? options.store(fastify) : options.store;
898
- /**
899
- * The RAW transport, never `fastify.events`.
900
- *
901
- * This read used to be `(fastify as { events?: EventTransport }).events` — a cast across
902
- * two INCOMPATIBLE shapes. The facade's `publish(type, payload, meta?)` took the relayed
903
- * `DomainEvent` as its `type` argument and failed the non-empty-string guard, so the
904
- * documented default path published NOTHING: subscribers saw nothing and every tick
905
- * reported `publishFailed: 1` until the row dead-lettered. The cast is what let two
906
- * mismatched signatures typecheck.
907
- */
908
- const transport = options.transport === void 0 ? resolveEventTransport(fastify) : typeof options.transport === "function" ? options.transport(fastify) : options.transport;
909
- /**
910
- * No transport is BOOT-FATAL, because the alternative is invisible:
911
- * `EventOutbox.relayBatch()` returns an empty result when it has none, so the
912
- * module's schedule would tick forever, publish nothing, and let the store grow —
913
- * a durable backlog nobody is draining, reported as healthy. The failure this
914
- * module exists to prevent, arrived at from the other side.
915
- */
916
- if (transport === void 0) throw new Error(`Outbox module "${name}" could not resolve an event transport, so its relay would tick forever without publishing while the store grows. Register arc's events plugin (it is on by default — check \`arcPlugins.events !== false\`), or pass an explicit \`transport\` to \`createOutboxModule\`. Note the outbox needs the RAW EventTransport, not the \`fastify.events\` facade: the facade takes \`(type, payload, meta?)\` and fails open, which would acknowledge rows whose publish actually failed.`);
917
- const relay = new EventOutbox({
918
- store,
919
- transport,
920
- onPublished: (event) => emitObserved(fastify.events, event),
921
- ...options.batchSize !== void 0 ? { batchSize: options.batchSize } : {},
922
- ...options.leaseMs !== void 0 ? { leaseMs: options.leaseMs } : {},
923
- consumerId: options.consumerId ?? mintConsumerId(name),
924
- onError: options.onError ?? ((info) => {
925
- fastify.log.error({
926
- err: info.error,
927
- kind: info.kind,
928
- ...info.event?.meta.id !== void 0 ? { eventId: info.event.meta.id } : {},
929
- ...info.event?.type !== void 0 ? { eventType: info.event.type } : {}
930
- }, `outbox relay "${name}" failed`);
931
- }),
932
- ...options.failurePolicy !== void 0 ? { failurePolicy: options.failurePolicy } : {},
933
- ...options.sessionProvider === false ? {} : { sessionProvider: options.sessionProvider ?? (() => transactionContext.get()) }
934
- });
935
- /**
936
- * One pass per burst of requests. `drainQueued` stays true from the
937
- * first request until the pass STARTS, so a request landing mid-pass
938
- * schedules the next one — a row written during a pass is never left
939
- * waiting for the interval.
940
- */
941
- let drainQueued = false;
942
- const requestDrain = () => {
943
- if (drainQueued) return;
944
- drainQueued = true;
945
- let passDone = () => {};
946
- trackPass(new Promise((resolve) => passDone = resolve));
947
- setImmediate(() => {
948
- drainQueued = false;
949
- requestContext.storage.exit(() => {
950
- relay.relayBatch().catch((err) => {
951
- fastify.log.error({ err }, `outbox relay "${name}" requested drain failed`);
952
- }).finally(passDone);
953
- });
954
- });
955
- };
956
- const drain = ({ maxPasses = 100 } = {}) => requestContext.storage.exit(async () => {
957
- const total = {
958
- passes: 0,
959
- relayed: 0,
960
- publishFailed: 0,
961
- deadLettered: 0,
962
- drained: false
963
- };
964
- while (total.passes < maxPasses) {
965
- if (inFlightPasses.size > 0) await Promise.allSettled([...inFlightPasses]);
966
- const r = await relay.relayBatch();
967
- total.passes++;
968
- total.relayed += r.relayed;
969
- total.publishFailed += r.publishFailed;
970
- total.deadLettered += r.deadLettered;
971
- if (r.attempted === 0 && inFlightPasses.size === 0) {
972
- total.drained = true;
973
- break;
974
- }
975
- }
976
- return total;
977
- });
978
- const health = async () => {
979
- if (!canReportHealth(store)) throw new Error(`Outbox module "${name}": relay health needs BOTH countByStatus and oldestPendingAgeMs on the store, and it is missing at least one.`);
980
- return readOutboxHealth(store, lagUnhealthyMs);
981
- };
982
- exports = {
983
- store,
984
- relay,
985
- requestDrain,
986
- drain,
987
- health
988
- };
989
- return exports;
990
- },
991
- ...options.health === false ? {} : { healthChecks: [{
992
- name: `${name}.relay`,
993
- critical: false,
994
- check: () => exports ? probeHealthy(exports.health) : Promise.resolve(false)
995
- }] },
996
- /**
997
- * The relay runs on the module's OWN schedule arm, so the host stops owning the tick — and
998
- * a host that forgets to start one cannot exist.
999
- */
1000
- scheduledJobs: () => [{
1001
- name: `${name}.relay`,
1002
- kind: "relay",
1003
- every: relayEveryMs,
1004
- runOnStart: options.runOnStart ?? true,
1005
- handler: async () => {
1006
- if (exports) await trackPass(exports.relay.relay());
1007
- }
1008
- }, ...alertEveryMs > 0 ? [{
1009
- name: `${name}.health`,
1010
- kind: "relay",
1011
- every: alertEveryMs,
1012
- handler: async () => {
1013
- if (!exports || !log) return;
1014
- if (!canReportHealth(exports.store)) {
1015
- if (!warnedUnmeasurable) {
1016
- warnedUnmeasurable = true;
1017
- log.warn({
1018
- marker: "OUTBOX_HEALTH_UNMEASURABLE",
1019
- outbox: name
1020
- }, `outbox "${name}" store lacks countByStatus or oldestPendingAgeMs — relay stalls cannot be alerted on`);
1021
- }
1022
- return;
1023
- }
1024
- const h = await exports.health();
1025
- if (h.deadLetter > 0) log.warn({
1026
- marker: "OUTBOX_DEAD_LETTER",
1027
- outbox: name,
1028
- ...h
1029
- }, `outbox "${name}" has dead-lettered events — inspect and replay them`);
1030
- if (h.relayLagMs !== null && h.relayLagMs >= lagUnhealthyMs) log.error({
1031
- marker: "OUTBOX_RELAY_LAG",
1032
- outbox: name,
1033
- ...h
1034
- }, `outbox "${name}" relay is behind — events are committed but not delivered`);
1035
- }
1036
- }] : []]
1037
- };
1038
- }
1039
- //#endregion
1040
- export { exponentialBackoff as i, EventOutbox as n, repositoryAsOutboxStore as r, createOutboxModule as t };
742
+ export { repositoryAsOutboxStore as n, exponentialBackoff as r, EventOutbox as t };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
2
- //#region src/lock/renewingLease.ts
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
+ // src/lock/renewingLease.ts
3
3
  /**
4
4
  * Start renewing an ALREADY-ACQUIRED lease. The caller performed the
5
5
  * initial `tryAcquire` (its contention policy differs per consumer); this
@@ -53,5 +53,4 @@ function startRenewingLease(options) {
53
53
  }
54
54
  };
55
55
  }
56
- //#endregion
57
56
  export { startRenewingLease as t };
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-D_lMdYOd.mjs";
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-yH2lHMo_.mjs";
3
3
  import { toCanonicalList } from "@classytic/repo-core/pagination";
4
4
  import fp from "fastify-plugin";
5
- //#region src/plugins/replyHelpers.ts
5
+ // src/plugins/replyHelpers.ts
6
6
  var replyHelpers_exports = /* @__PURE__ */ __exportAll({ replyHelpersPlugin: () => replyHelpersPlugin });
7
7
  async function replyHelpersPluginFn(fastify) {
8
8
  fastify.decorateReply("sendList", function(input) {
@@ -19,5 +19,4 @@ const replyHelpersPlugin = fp(replyHelpersPluginFn, {
19
19
  name: "arc-reply-helpers",
20
20
  fastify: "5.x"
21
21
  });
22
- //#endregion
23
22
  export { replyHelpers_exports as n, replyHelpersPlugin as t };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
- //#region src/context/requestContext.ts
3
+ // src/context/requestContext.ts
4
4
  /**
5
5
  * Request Context via AsyncLocalStorage
6
6
  *
@@ -90,5 +90,4 @@ function getTraceHeaders() {
90
90
  if (store.tracestate) headers.tracestate = store.tracestate;
91
91
  return Object.keys(headers).length > 0 ? headers : void 0;
92
92
  }
93
- //#endregion
94
93
  export { requestContext as n, getTraceHeaders as t };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
2
- //#region src/idempotency/requirement.ts
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
+ // src/idempotency/requirement.ts
3
3
  /** What is wrong with a route's idempotency declaration, or `undefined` when it is sound. */
4
4
  function idempotencyConfigProblem(config) {
5
5
  const idem = config?.idempotency;
@@ -31,5 +31,4 @@ function requestRequiresIdempotencyKey(request) {
31
31
  const action = request.body?.action;
32
32
  return typeof action === "string" && idem.requiredActions.includes(action);
33
33
  }
34
- //#endregion
35
34
  export { requestRequiresIdempotencyKey as i, idempotencyConfigProblem as n, requestDedupedByHandler as r, declaresIdempotencyFence as t };
@@ -1,6 +1,5 @@
1
1
 
2
2
  import { FastifyRequest } from "fastify";
3
- //#region src/idempotency/requirement.d.ts
4
3
  /** The `config.idempotency` slot of a Fastify route. */
5
4
  interface RouteIdempotencyConfig {
6
5
  /** Every call needs a key — any method, DELETE included. */
@@ -18,5 +17,4 @@ interface RouteIdempotencyConfig {
18
17
  /** Action route only: action name -> owner, for actions in `requiredActions` that dedupe themselves. */
19
18
  readonly handlerDedup?: Readonly<Record<string, string>>;
20
19
  }
21
- //#endregion
22
20
  export { RouteIdempotencyConfig as t };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
2
- import { t as createTenantKeyGenerator } from "./rateLimitKey-AvkBOMkl.mjs";
3
- //#region src/permissions/resourceRateLimit.ts
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
+ import { t as createTenantKeyGenerator } from "./rateLimitKey-CWAjlqcN.mjs";
3
+ // src/permissions/resourceRateLimit.ts
4
4
  function decision(allowed, max, remaining, ttlSeconds) {
5
5
  const reset = Math.max(1, ttlSeconds);
6
6
  return {
@@ -176,5 +176,4 @@ function resourceRateLimitWindowMs(window) {
176
176
  if (!Number.isSafeInteger(value) || value <= 0) throw new Error(`rateLimit.timeWindow '${window}' must be a positive duration in milliseconds.`);
177
177
  return value;
178
178
  }
179
- //#endregion
180
179
  export { resourceRateLimitWindowMs as a, resolveResourceRateLimiter as i, markRateLimitingDisabled as n, recordUnenforcedRateLimit as r, createMemoryResourceRateLimiter as t };
@@ -1,7 +1,6 @@
1
1
 
2
- import { i as RequestScope } from "./types-Ddl9OjmE.mjs";
2
+ import { i as RequestScope } from "./types-DnkIALZ8.mjs";
3
3
  import { FastifyInstance } from "fastify";
4
- //#region src/permissions/resourceRateLimit.d.ts
5
4
  interface ResourceRateLimitPolicy {
6
5
  max: number;
7
6
  timeWindow: string;
@@ -26,5 +25,4 @@ interface ResourceRateLimiter {
26
25
  declare function resolveResourceRateLimiter(app: FastifyInstance, durability?: ResourceRateLimiter["durability"]): ResourceRateLimiter | undefined;
27
26
  /** Standalone tools may use memory; wired distributed apps use the host's shared store. */
28
27
  declare function createMemoryResourceRateLimiter(capacity?: number): ResourceRateLimiter;
29
- //#endregion
30
28
  export { createMemoryResourceRateLimiter as a, ResourceRateLimiter as i, ResourceRateLimitDecision as n, resolveResourceRateLimiter as o, ResourceRateLimitPolicy as r, ResourceRateLimitContext as t };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
2
  import "node:module";
3
- //#region \0rolldown/runtime.js
3
+ // \0rolldown/runtime.js
4
4
  var __defProp = Object.defineProperty;
5
5
  var __exportAll = (all, no_symbols) => {
6
6
  let target = {};
@@ -11,5 +11,4 @@ var __exportAll = (all, no_symbols) => {
11
11
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
12
12
  return target;
13
13
  };
14
- //#endregion
15
14
  export { __exportAll as t };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
2
  import { AjvCompiler } from "@fastify/ajv-compiler";
3
- //#region src/core/routeValidator.ts
3
+ // src/core/routeValidator.ts
4
4
  /**
5
5
  * Arc's request validator — the AJV settings every route arc builds is validated with, on ANY host.
6
6
  *
@@ -66,5 +66,4 @@ function lowerCaseHeaderSchema(schema) {
66
66
  function isPlainObject(value) {
67
67
  return typeof value === "object" && value !== null && Object.getPrototypeOf(value) === Object.prototype;
68
68
  }
69
- //#endregion
70
69
  export { arcRouteValidatorCompiler as n, markArcRootValidator as r, arcAjvCustomOptions as t };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.45.2 | MIT | https://classytic.com */
2
- //#region src/utils/runtimeCapabilities.ts
1
+ /*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
2
+ // src/utils/runtimeCapabilities.ts
3
3
  /**
4
4
  * `Symbol.for` so declarations from two arc copies in one dependency graph
5
5
  * land in ONE registry — same reasoning as `ARC_EVENT_TRANSPORT`. Not on the
@@ -71,5 +71,4 @@ function auditRuntimeCapabilities(fastify, runtime) {
71
71
  throw new Error(`runtime: 'distributed' — ${violations.length} subsystem(s) hold PER-PROCESS state that multi-replica deployment breaks:\n${lines}\nWire a shared store for each, or — where per-process is genuinely intended — have the declarant pass \`accepted: true\` with a reason.`);
72
72
  }
73
73
  }
74
- //#endregion
75
74
  export { declareRuntimeCapability as n, initRuntimeCapabilityRegistry as r, auditRuntimeCapabilities as t };