@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.
- package/README.md +1 -1
- package/dist/{EventTransport-CiicKz2Z.d.mts → EventTransport-CYEoCJGe.d.mts} +0 -2
- package/dist/{EventTransport-DHb1tpu-.mjs → EventTransport-DNgD9NP4.mjs} +3 -4
- package/dist/{HookSystem-C1u0EUnt.mjs → HookSystem-DRbPzEcP.mjs} +3 -4
- package/dist/{QueryCache--5uAuYPW.d.mts → QueryCache-DdvrGG8Q.d.mts} +1 -3
- package/dist/{ResourceRegistry-D2jXWVN_.mjs → ResourceRegistry-Douk51fa.mjs} +15 -4
- package/dist/{acquire-DTkA8Lme.mjs → acquire-RbtvDg9s.mjs} +2 -3
- package/dist/{actionPermissions-DRVk6m7x.mjs → actionPermissions-De0AJ7hm.mjs} +37 -42
- package/dist/audit/index.d.mts +2 -10
- package/dist/audit/index.mjs +8 -12
- package/dist/auth/audit.d.mts +0 -2
- package/dist/auth/audit.mjs +2 -3
- package/dist/auth/index.d.mts +9 -17
- package/dist/auth/index.mjs +26 -29
- package/dist/auth/redis-session.d.mts +2 -4
- package/dist/auth/redis-session.mjs +2 -3
- package/dist/{authorizationDecision-D48fUJv1.mjs → authorizationDecision-DeZMrHcm.mjs} +5 -6
- package/dist/{base-CZyixEQR.d.mts → base-HXNgPQww.d.mts} +1 -7
- package/dist/{boundedMap-DkKiPifd.mjs → boundedMap-2WBh3gM9.mjs} +2 -3
- package/dist/{buildHandler-BiZ4VATS.mjs → buildHandler-DxVOOBpw.mjs} +5 -6
- package/dist/cache/index.d.mts +4 -10
- package/dist/cache/index.mjs +5 -6
- package/dist/{caching-Cj0as-P1.mjs → caching-BYRwYrUo.mjs} +3 -4
- package/dist/{claimed-ChI13rUR.mjs → claimed-DYlELdnm.mjs} +2 -3
- package/dist/cleanup/index.d.mts +4 -18
- package/dist/cleanup/index.mjs +12 -20
- package/dist/cli/commands/describe.d.mts +1 -3
- package/dist/cli/commands/describe.mjs +4 -5
- package/dist/cli/commands/docs.d.mts +1 -3
- package/dist/cli/commands/docs.mjs +4 -5
- package/dist/cli/commands/doctor.d.mts +1 -3
- package/dist/cli/commands/doctor.mjs +2 -3
- package/dist/cli/commands/generate.d.mts +1 -1
- package/dist/cli/commands/generate.mjs +2 -2
- package/dist/cli/commands/init.d.mts +1 -1
- package/dist/cli/commands/init.mjs +2 -2
- package/dist/cli/commands/introspect.d.mts +1 -3
- package/dist/cli/commands/introspect.mjs +3 -4
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-D_aiew34.mjs → constants-CHZMUwBW.mjs} +2 -3
- package/dist/context/index.d.mts +0 -8
- package/dist/context/index.mjs +6 -7
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +8 -8
- package/dist/{core-QIZ2560Y.mjs → core-D9rS2BxO.mjs} +9 -12
- package/dist/{createActionRouter-CvH84dyx.mjs → createActionRouter-0qkCRzTL.mjs} +7 -8
- package/dist/{createAggregationRouter-DGyK2Hp6.mjs → createAggregationRouter-CUf5Esd9.mjs} +9 -10
- package/dist/{createApp-CKjZpmq9.mjs → createApp-DZIXfDKD.mjs} +49 -62
- package/dist/{createMcpServer-DSztofa9.d.mts → createMcpServer-DeVpqQF-.d.mts} +1 -3
- package/dist/{defineAggregation-BLza7Ca4.mjs → defineAggregation-bmKQ4NmC.mjs} +2 -3
- package/dist/{defineResource-CEo0gDCb.mjs → defineResource-CGmdmGwh.mjs} +78 -29
- package/dist/discovery/index.d.mts +1 -3
- package/dist/discovery/index.mjs +2 -3
- package/dist/docs/index.d.mts +8 -8
- package/dist/docs/index.mjs +4 -5
- package/dist/{elevation-BJTsSnke.mjs → elevation-CzhqAyVN.mjs} +9 -10
- package/dist/{elevation-BW2J3tNj.d.mts → elevation-DPD0hcU-.d.mts} +0 -2
- package/dist/encryption/index.d.mts +1 -7
- package/dist/encryption/index.mjs +8 -13
- package/dist/{errorHandler--4rSMMvq.d.mts → errorHandler-B9r88jZV.d.mts} +8 -3
- package/dist/{errorHandler-2p4SL5zm.mjs → errorHandler-dFyGOEoB.mjs} +16 -6
- package/dist/{errors-grZkIA8N.mjs → errors-BY8vzlP4.mjs} +2 -3
- package/dist/{errors-JYc9vwqE.d.mts → errors-DTo0me1o.d.mts} +0 -2
- package/dist/{eventPlugin-BtmA4-3P.d.mts → eventPlugin-BY38F6yK.d.mts} +1 -7
- package/dist/{eventPlugin-ItcYBGUs.mjs → eventPlugin-eMhAPtQA.mjs} +10 -12
- package/dist/{eventTypes-Ck6fD3ne.mjs → eventTypes-Do2KYeJx.mjs} +5 -8
- package/dist/events/index.d.mts +4 -16
- package/dist/events/index.mjs +8 -9
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis-stream-entry.mjs +5 -6
- package/dist/events/transports/redis.d.mts +2 -4
- package/dist/events/transports/redis.mjs +3 -4
- package/dist/{externalPaths-CmGOxOtD.d.mts → externalPaths-BOqdq5wr.d.mts} +0 -2
- package/dist/factory/index.d.mts +4 -14
- package/dist/factory/index.mjs +12 -18
- package/dist/{fastify-augmentation-DRlCIWE9.d.mts → fastify-augmentation-Dtn0IIRn.d.mts} +4 -10
- package/dist/{fields-BBSpf8pS.d.mts → fields-JTkrtO-r.d.mts} +0 -2
- package/dist/{fields-BRX0Krcj.mjs → fields-LnbCcvsw.mjs} +2 -3
- package/dist/{filter-merge-CDc7YMwX.mjs → filter-merge-BAWi019Q.mjs} +2 -3
- package/dist/{generate-DCGuEbqI.d.mts → generate-C-g_KOkV.d.mts} +0 -4
- package/dist/{generate-hvg7V2g1.mjs → generate-oXoDnpJf.mjs} +7 -12
- package/dist/{headers-Cqkg4LzI.mjs → headers-DBd3Qheo.mjs} +3 -4
- package/dist/{health-PVt0VjOx.mjs → health-BlJu9GXS.mjs} +2 -3
- package/dist/{health-DyeP3mTW.mjs → health-Dp-3EC9o.mjs} +4 -7
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/idempotency/index.d.mts +3 -9
- package/dist/idempotency/index.mjs +10 -13
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/idempotency/redis.mjs +3 -4
- package/dist/{index-Bxriq3so.d.mts → index-B5i9-vuP.d.mts} +4 -26
- package/dist/{index-Chgz3d0i.d.mts → index-BAXDo5eE.d.mts} +1 -7
- package/dist/{index-Beg3aNnK.d.mts → index-BTxzJ_MN.d.mts} +67 -25
- package/dist/{index-CUJvoyw3.d.mts → index-Bqfo8hLz.d.mts} +2 -24
- package/dist/{index-uhkUA5-U.d.mts → index-CUdaoCYt.d.mts} +13 -23
- package/dist/{index-WH7xgvxS.d.mts → index-DyJFTJLA.d.mts} +31 -92
- package/dist/index.d.mts +7 -9
- package/dist/index.mjs +12 -13
- package/dist/{init-jC3rMPzb.mjs → init-BOaNkLYb.mjs} +18 -35
- package/dist/{init-Cscs4lab.d.mts → init-CV2_Fw3H.d.mts} +0 -4
- package/dist/integrations/event-gateway.d.mts +3 -5
- package/dist/integrations/event-gateway.mjs +3 -4
- package/dist/integrations/index.d.mts +3 -3
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.d.mts +1 -1
- package/dist/integrations/jobs/index.mjs +7 -11
- package/dist/integrations/mcp/index.d.mts +7 -39
- package/dist/integrations/mcp/index.mjs +8 -14
- package/dist/integrations/mcp/testing.d.mts +3 -5
- package/dist/integrations/mcp/testing.mjs +3 -4
- package/dist/integrations/streamline.d.mts +1 -3
- package/dist/integrations/streamline.mjs +4 -5
- package/dist/integrations/webhooks.d.mts +2 -4
- package/dist/integrations/webhooks.mjs +4 -5
- package/dist/integrations/websocket-pushref-redis.d.mts +2 -4
- package/dist/integrations/websocket-pushref-redis.mjs +2 -3
- package/dist/integrations/websocket-redis.d.mts +2 -4
- package/dist/integrations/websocket-redis.mjs +2 -3
- package/dist/integrations/websocket.d.mts +2 -2
- package/dist/integrations/websocket.mjs +13 -24
- package/dist/{interface-JJzwH4Ro.d.mts → interface-BmExzQRD.d.mts} +0 -2
- package/dist/{interface-BOk3YnTz.d.mts → interface-WR1U0K7t.d.mts} +0 -2
- package/dist/{jsonBody-ptwyzZQ-.mjs → jsonBody-DpRpKR_K.mjs} +3 -4
- package/dist/{keys-C1vFuSbv.mjs → keys-FBz6Ull-.mjs} +2 -3
- package/dist/{loadResources-CHPDyIPn.mjs → loadResources-Bx1sKPnF.mjs} +4 -5
- package/dist/{loadResourcesFromEntry-BkHHTu_B.mjs → loadResourcesFromEntry-b_jcqbxh.mjs} +3 -4
- package/dist/logger/index.d.mts +1 -3
- package/dist/logger/index.mjs +2 -2
- package/dist/{logger-C5bvCiAK.mjs → logger-CbFcIEBZ.mjs} +3 -5
- package/dist/{mcpPlugin-C9qohJCF.mjs → mcpPlugin-yix548XX.mjs} +41 -60
- package/dist/{memory-CxiTwT0j.mjs → memory-Bgw5dn8N.mjs} +4 -5
- package/dist/{metrics-Ckp2zRy-.mjs → metrics-CZDQWVjS.mjs} +4 -5
- package/dist/middleware/index.d.mts +1 -5
- package/dist/middleware/index.mjs +4 -5
- package/dist/migrations/index.d.mts +0 -2
- package/dist/migrations/index.mjs +3 -4
- package/dist/{module-CfnKuIuH.mjs → module-Dsc_nKL5.mjs} +2 -3
- package/dist/{multiTenant-CAtYlW6H.d.mts → multiTenant-XCxAUlru.d.mts} +1 -5
- package/dist/{multipartBody-BFasGtP9.mjs → multipartBody-B85ek8Kj.mjs} +2 -3
- package/dist/observeSend-BK-JN1jK.mjs +20 -0
- package/dist/{openapi-DAPxjYHX.mjs → openapi-Co7hl073.mjs} +18 -28
- package/dist/outbox-admin/index.d.mts +2 -4
- package/dist/outbox-admin/index.mjs +6 -7
- package/dist/{outbox-module-gZCHoE4H.d.mts → outbox-module-XvUThpqn.d.mts} +2 -8
- package/dist/{outbox-module-B4FAkx3A.mjs → outbox-module-mg9kDYkd.mjs} +13 -17
- package/dist/permissions/index.d.mts +4 -4
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-B14c3OMp.mjs → permissions-A1oKtpiC.mjs} +19 -29
- package/dist/{pipe-CQv7PsAK.mjs → pipe-Czpw9U2n.mjs} +3 -4
- package/dist/pipeline/index.d.mts +1 -9
- package/dist/pipeline/index.mjs +5 -8
- package/dist/{plan-CpnTykjb.mjs → plan-KVseuBCL.mjs} +5 -9
- package/dist/{plugin-DXTjVg_Q.mjs → plugin-DTWt_8C3.mjs} +130 -62
- package/dist/plugins/index.d.mts +8 -16
- package/dist/plugins/index.mjs +22 -26
- package/dist/plugins/response-cache.d.mts +2 -4
- package/dist/plugins/response-cache.mjs +10 -10
- package/dist/plugins/tracing-entry.d.mts +1 -1
- package/dist/plugins/tracing-entry.mjs +3 -4
- package/dist/{pluralize-C3VJKRGp.mjs → pluralize-msB9X3yw.mjs} +2 -3
- package/dist/presets/filesUpload.d.mts +4 -6
- package/dist/presets/filesUpload.mjs +6 -7
- package/dist/presets/index.d.mts +3 -19
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +7 -7
- package/dist/presets/search.d.mts +3 -5
- package/dist/presets/search.mjs +3 -4
- package/dist/{presets-CquqYJPy.mjs → presets-qKCehiJM.mjs} +11 -18
- package/dist/{projection-CgfSLOSM.mjs → projection-ClBqtsIw.mjs} +3 -4
- package/dist/{pushref-registry-UxCkoA4C.d.mts → pushref-registry-d86QUaSq.d.mts} +0 -6
- package/dist/{queryCachePlugin-D0HUISHJ.mjs → queryCachePlugin-3gJj5Rbz.mjs} +8 -10
- package/dist/{queryCachePlugin-C2lZjTxk.d.mts → queryCachePlugin-DYQUyeJ9.d.mts} +2 -4
- package/dist/{rateLimitKey-AvkBOMkl.mjs → rateLimitKey-Kro---xl.mjs} +2 -3
- package/dist/{realtime-CbWtVbqK.mjs → realtime-Ber8uJN2.mjs} +17 -19
- package/dist/{redis-BDgv9Glw.d.mts → redis-RpDMemdm.d.mts} +2 -4
- package/dist/{redis-stream-BMk-bpQS.d.mts → redis-stream-CS1N9dwM.d.mts} +1 -3
- package/dist/{redisShapes-CQksY67q.d.mts → redisShapes-CqBXTn_s.d.mts} +0 -2
- package/dist/registry/index.d.mts +2 -12
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-BVwpAuFI.mjs → registry-BA-_vFYk.mjs} +7 -12
- package/dist/{renewingLease-CykpeNcQ.mjs → renewingLease-CMY8YOcc.mjs} +2 -3
- package/dist/{replyHelpers-DA51IZio.mjs → replyHelpers-DK9P_XSz.mjs} +3 -4
- package/dist/{requestContext-DIWHKDtQ.mjs → requestContext-GYO_0gEw.mjs} +2 -3
- package/dist/{requirement-CbiLdQ1n.d.mts → requirement-CTRQjjQx.d.mts} +0 -2
- package/dist/{requirement-Cp_fsMDL.mjs → requirement-DeNjZIH3.mjs} +2 -3
- package/dist/{resourceRateLimit-Wf6d6FL9.d.mts → resourceRateLimit-DCWglD7V.d.mts} +1 -3
- package/dist/{resourceRateLimit-BFuluodF.mjs → resourceRateLimit-tHLbrtWc.mjs} +3 -4
- package/dist/{rolldown-runtime-D_lMdYOd.mjs → rolldown-runtime-Kv1fZdLg.mjs} +2 -3
- package/dist/{routeValidator-DuLonYwr.mjs → routeValidator-C_H5NanI.mjs} +2 -3
- package/dist/{runtimeCapabilities-CydRfm0i.mjs → runtimeCapabilities-DWqbxkyw.mjs} +2 -3
- package/dist/{schedules-B693KXxa.mjs → schedules-eO_RzhCU.mjs} +132 -9
- package/dist/{schemaConverter-DNvZWTV6.mjs → schemaConverter-DBJrPZN4.mjs} +3 -4
- package/dist/{schemaIR-REV2y7Wd.mjs → schemaIR-CEScKT2v.mjs} +3 -4
- package/dist/schemas/index.d.mts +0 -2
- package/dist/schemas/index.mjs +2 -3
- package/dist/scim/index.d.mts +0 -12
- package/dist/scim/index.mjs +10 -18
- package/dist/scope/index.d.mts +2 -6
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-Bevxy_ST.mjs → scope-B-Sm9m_E.mjs} +5 -6
- package/dist/{sessionManager-qimlKV0P.d.mts → sessionManager-CdvDF04x.d.mts} +2 -4
- package/dist/{shutdown-CfrqPR7A.mjs → shutdown-DzLFbe27.mjs} +2 -3
- package/dist/{simpleEqualityMatcher-BJwfuRKP.mjs → simpleEqualityMatcher-DOJhwQ8g.mjs} +2 -3
- package/dist/{sse-CuNNWr2z.mjs → sse-2972pVwV.mjs} +8 -9
- package/dist/{sseStream-C_2ujAVY.mjs → sseStream-AWLEeNV-.mjs} +3 -4
- package/dist/{storage-Cx9Sz3Ou.d.mts → storage-odC5MNKN.d.mts} +0 -2
- package/dist/{store-helpers-C8uBGCbb.mjs → store-helpers-VzjgVTkM.mjs} +2 -3
- package/dist/{streaming-Bdq_M4d5.mjs → streaming-DvraWW6x.mjs} +2 -3
- package/dist/{subscriberIdentity-B-KpZkdl.mjs → subscriberIdentity-Bya56jsg.mjs} +2 -3
- package/dist/{tenancy-C5PCvm1h.mjs → tenancy-DSa_0hhw.mjs} +3 -4
- package/dist/{tenantPreparation-dYvWrgNa.mjs → tenantPreparation-BrpkQre3.mjs} +5 -6
- package/dist/testing/cleanupStoreContract.d.mts +2 -4
- package/dist/testing/cleanupStoreContract.mjs +2 -3
- package/dist/testing/index.d.mts +6 -32
- package/dist/testing/index.mjs +24 -37
- package/dist/testing/outboxStoreContract.d.mts +1 -3
- package/dist/testing/outboxStoreContract.mjs +3 -4
- package/dist/testing/requiredPorts.d.mts +2 -4
- package/dist/testing/requiredPorts.mjs +3 -4
- package/dist/testing/storageContract.d.mts +2 -4
- package/dist/testing/storageContract.mjs +2 -3
- package/dist/{timing-DCqsezX8.mjs → timing-6rQTuCwg.mjs} +3 -5
- package/dist/{tracing-Dro5eH6j.d.mts → tracing-JSFiBl5r.d.mts} +0 -2
- package/dist/{transactionContext-DrcNyjpv.mjs → transactionContext-DaxYUEgH.mjs} +2 -3
- package/dist/{typeGuards-CEl10KPy.mjs → typeGuards-UKnX8wPX.mjs} +2 -3
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.d.mts +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-ByHn9rEO.d.mts → types-0Dqlbgn8.d.mts} +0 -2
- package/dist/{types-D3Ixsh00.d.mts → types-BYEb_dLW.d.mts} +2 -4
- package/dist/{types-BJ-2XqVF.d.mts → types-BeEJm-DV.d.mts} +114 -14
- package/dist/{types-DVLddu2q.d.mts → types-C0YJAiL0.d.mts} +0 -2
- package/dist/{types-D9NWjpYc.mjs → types-CuGjhn83.mjs} +5 -6
- package/dist/{types-Ddl9OjmE.d.mts → types-DnkIALZ8.d.mts} +0 -4
- package/dist/usage/index.d.mts +2 -10
- package/dist/usage/index.mjs +8 -12
- package/dist/{userHelpers-BHig1kHq.mjs → userHelpers-oX5_mOVs.mjs} +2 -3
- package/dist/utils/index.d.mts +5 -39
- package/dist/utils/index.mjs +12 -12
- package/dist/{utils-BG5P7_Vb.mjs → utils-CjjGOT4E.mjs} +20 -30
- package/dist/{validate-D_mdOCir.mjs → validate-4RlTKOJb.mjs} +5 -7
- package/dist/{versioning-DBGHjPh7.mjs → versioning-Dk2-19La.mjs} +4 -5
- package/dist/{versioning-Bqm_57Qt.d.mts → versioning-S18y2-0C.d.mts} +1 -15
- package/dist/{websocket-Cs4awVyD.d.mts → websocket-BGuc-WVZ.d.mts} +1 -15
- package/dist/{workScope-DPPfM4m6.mjs → workScope-DoBsoVo4.mjs} +3 -4
- package/llms.txt +37 -30
- package/package.json +9 -8
- package/skills/arc/SKILL.md +65 -844
- package/skills/arc/references/agent-auth.md +82 -193
- package/skills/arc/references/api-reference.md +41 -245
- package/skills/arc/references/auth-api-keys.md +99 -0
- package/skills/arc/references/auth-better-auth-overlay.md +87 -0
- package/skills/arc/references/auth-better-auth.md +78 -0
- package/skills/arc/references/auth-permissions.md +100 -0
- package/skills/arc/references/auth-strategies.md +122 -0
- package/skills/arc/references/boot.md +80 -0
- package/skills/arc/references/enterprise-auth.md +65 -81
- package/skills/arc/references/events-outbox.md +90 -0
- package/skills/arc/references/events.md +75 -440
- package/skills/arc/references/integrations-jobs.md +74 -0
- package/skills/arc/references/integrations-realtime.md +84 -0
- package/skills/arc/references/integrations-webhooks.md +71 -0
- package/skills/arc/references/integrations-workflows.md +47 -0
- package/skills/arc/references/mcp-auth.md +83 -0
- package/skills/arc/references/mcp-custom-tools.md +125 -0
- package/skills/arc/references/mcp-setup.md +115 -0
- package/skills/arc/references/mcp-testing.md +63 -0
- package/skills/arc/references/multi-tenancy.md +56 -230
- package/skills/arc/references/permissions-scope.md +81 -0
- package/skills/arc/references/production-api.md +119 -0
- package/skills/arc/references/production-audit.md +101 -0
- package/skills/arc/references/production-boot.md +91 -0
- package/skills/arc/references/production-caching.md +63 -0
- package/skills/arc/references/production-distributed.md +75 -0
- package/skills/arc/references/production-idempotency.md +83 -0
- package/skills/arc/references/production-observability.md +83 -0
- package/skills/arc/references/production-realtime.md +70 -0
- package/skills/arc/references/production-reliability.md +100 -0
- package/skills/arc/references/production-shutdown.md +43 -0
- package/skills/arc/references/querying.md +76 -0
- package/skills/arc/references/resources.md +97 -0
- package/skills/arc/references/schedules.md +79 -0
- package/skills/arc/references/scim.md +61 -208
- package/skills/arc/references/tenancy-scope-install.md +82 -0
- package/skills/arc/references/testing.md +101 -144
- package/skills/arc/references/usage-cleanup-capabilities.md +45 -0
- package/skills/arc/references/validation.md +91 -0
- package/skills/arc/references/writes-hooks-errors.md +80 -0
- package/skills/arc-code-review/SKILL.md +67 -114
- package/skills/arc-code-review/references/arc-cheatsheet.md +68 -167
- package/skills/arc-code-review/references/mongokit-repositories.md +104 -0
- package/skills/arc-code-review/references/recipe-events-cache-jobs.md +112 -0
- package/skills/arc-code-review/references/recipe-resource.md +100 -0
- package/skills/arc-code-review/references/recipe-schemas-fields.md +93 -0
- package/skills/arc-code-review/references/recipe-scope-permissions.md +82 -0
- package/skills/arc-code-review/references/scaffolding.md +61 -198
- package/skills/arc-code-review/references/severity.md +49 -102
- package/skills/arc-code-review/references/smells-auth-scope.md +80 -0
- package/skills/arc-code-review/references/smells-data-events.md +66 -0
- package/skills/arc-code-review/references/smells-imports-style.md +59 -0
- package/skills/arc-code-review/references/smells-platform.md +89 -0
- package/skills/arc-code-review/references/smells-routes-schemas.md +66 -0
- package/skills/arc-module-publishing/SKILL.md +82 -208
- package/skills/arc-module-publishing/references/action-presets-and-plugins.md +87 -0
- package/skills/arc-module-publishing/references/build-and-types.md +73 -0
- package/skills/arc-module-publishing/references/module-lifecycle.md +101 -0
- package/skills/arc-module-publishing/references/package-manifest.md +34 -122
- package/skills/arc-module-publishing/references/publishing-workflow.md +44 -140
- package/skills/arc-module-publishing/references/resource-assembly.md +102 -0
- package/skills/arc-module-publishing/references/testing-packages.md +82 -0
- package/skills/arc/references/auth.md +0 -729
- package/skills/arc/references/integrations.md +0 -452
- package/skills/arc/references/mcp.md +0 -691
- package/skills/arc/references/production.md +0 -835
- package/skills/arc-code-review/references/anti-patterns.md +0 -1008
- package/skills/arc-code-review/references/migration-recipes.md +0 -649
- package/skills/arc-code-review/references/mongokit-migration.md +0 -360
- package/skills/arc-module-publishing/references/authoring-modules.md +0 -327
|
@@ -1,238 +1,127 @@
|
|
|
1
|
-
# Agent
|
|
1
|
+
# Agent auth: DPoP and capability mandates
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Gate AI-agent and machine actions on a verified mandate and sender-bound credential (AP2, x402, MCP authorization, RFC 9449, RFC 9728). Arc does NOT parse JWTs or verify DPoP proofs: your `authenticate` verifies, populates scope, and arc checks the verified claims against the action.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## The two new scope fields
|
|
8
|
-
|
|
9
|
-
`RequestScope.service` gains two optional fields (additive, no breaking change):
|
|
5
|
+
## Scope fields (service kind)
|
|
10
6
|
|
|
11
7
|
```typescript
|
|
12
8
|
{
|
|
13
|
-
kind: 'service',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
scopes,
|
|
17
|
-
// ── new in 2.13 ──
|
|
18
|
-
mandate?: Mandate, // capability mandate (AP2 / x402 / MCP)
|
|
19
|
-
dpopJkt?: string, // DPoP key thumbprint (RFC 7638)
|
|
20
|
-
// existing fields preserved
|
|
9
|
+
kind: 'service', clientId, organizationId, scopes,
|
|
10
|
+
mandate?: Mandate, // capability mandate
|
|
11
|
+
dpopJkt?: string, // DPoP key thumbprint (RFC 7638)
|
|
21
12
|
}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
The `Mandate` type:
|
|
25
13
|
|
|
26
|
-
```typescript
|
|
27
14
|
interface Mandate {
|
|
28
|
-
id: string;
|
|
29
|
-
capability: string;
|
|
30
|
-
cap?: number;
|
|
31
|
-
currency?: string;
|
|
32
|
-
expiresAt?: number;
|
|
33
|
-
parent?: string;
|
|
34
|
-
audience?: string;
|
|
35
|
-
meta?: Record<string, unknown>;
|
|
15
|
+
id: string; // jti
|
|
16
|
+
capability: string; // 'payment.charge', 'data.export', 'inbox.send'
|
|
17
|
+
cap?: number; // numeric ceiling (meaning per capability)
|
|
18
|
+
currency?: string; // ISO 4217 when monetary
|
|
19
|
+
expiresAt?: number; // epoch ms
|
|
20
|
+
parent?: string; // delegation chain
|
|
21
|
+
audience?: string; // resource binding, e.g. 'invoice:INV-7'
|
|
22
|
+
meta?: Record<string, unknown>; // verifier extras
|
|
36
23
|
}
|
|
37
24
|
```
|
|
38
25
|
|
|
39
|
-
Read with `getMandate(scope)
|
|
40
|
-
|
|
41
|
-
## Permission helpers
|
|
42
|
-
|
|
43
|
-
Three new combinators in `@classytic/arc/permissions`:
|
|
44
|
-
|
|
45
|
-
### `requireDPoP()` — sender-constrained credentials
|
|
26
|
+
Read with `getMandate(scope)`, `getDPoPJkt(scope)` from `@classytic/arc/scope`.
|
|
46
27
|
|
|
47
|
-
|
|
28
|
+
## Permission helpers (`@classytic/arc/permissions`)
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
```
|
|
30
|
+
| Helper | Passes when |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `requireDPoP()` | Service scope with `dpopJkt`, or elevated |
|
|
33
|
+
| `requireMandate(capability, opts?)` | Mandate capability matches, not expired, audience bound, `validateAmount` ok |
|
|
34
|
+
| `requireAgentScope(opts)` | Service identity + OAuth scope + mandate + DPoP, in one call |
|
|
56
35
|
|
|
57
|
-
|
|
36
|
+
`requireMandate` options:
|
|
58
37
|
|
|
59
|
-
|
|
38
|
+
| Option | Meaning |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `audience` | String or `(ctx) => string`; mandate must carry the same `audience` (a missing audience is denied) |
|
|
41
|
+
| `validateAmount(ctx, mandate)` | Return `true` or a denial string |
|
|
42
|
+
| `ttlGraceMs` | Clock-skew grace after `expiresAt` (default 30000) |
|
|
43
|
+
| `noElevatedBypass` | `true` makes elevated admins present a mandate too (break-glass flows) |
|
|
60
44
|
|
|
61
|
-
|
|
62
|
-
1. Authorize the requested `capability`
|
|
63
|
-
2. Not be expired (with optional grace window)
|
|
64
|
-
3. Be bound to the right resource (when `audience` opt is set)
|
|
65
|
-
4. Pass `validateAmount(ctx, mandate)` (when set)
|
|
45
|
+
`requireAgentScope` takes the `requireMandate` options plus `capability` (required), `scopes` (the service must hold ANY listed), `requireDPoP` (default true). Prefer it over hand-composing `allOf(requireServiceScope, requireMandate, requireDPoP)`: fewer misconfigurations and one tag for MCP/OpenAPI/audit tooling.
|
|
66
46
|
|
|
67
47
|
```typescript
|
|
68
|
-
import {
|
|
69
|
-
|
|
70
|
-
permissions: {
|
|
71
|
-
pay: requireMandate("payment.charge", {
|
|
72
|
-
audience: (ctx) => `invoice:${ctx.params?.id}`,
|
|
73
|
-
validateAmount: (ctx, mandate) => {
|
|
74
|
-
const amount = (ctx.data as { amount?: number })?.amount ?? 0;
|
|
75
|
-
if (amount <= (mandate.cap ?? 0)) return true;
|
|
76
|
-
return `Amount ${amount} exceeds mandate cap ${mandate.cap}`;
|
|
77
|
-
},
|
|
78
|
-
ttlGraceMs: 30_000, // default: 30s clock skew
|
|
79
|
-
noElevatedBypass: false, // platform admins normally bypass; set true for break-glass audit flows
|
|
80
|
-
}),
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### `requireAgentScope(opts)` — composite gate
|
|
85
|
-
|
|
86
|
-
Bundles the three things every high-value agent endpoint needs (service identity + capability mandate + DPoP binding) into one call:
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
import { requireAgentScope } from "@classytic/arc/permissions";
|
|
48
|
+
import { requireAgentScope } from '@classytic/arc/permissions';
|
|
90
49
|
|
|
91
50
|
defineResource({
|
|
92
|
-
name:
|
|
51
|
+
name: 'invoice',
|
|
93
52
|
actions: {
|
|
94
53
|
pay: {
|
|
95
54
|
handler: payInvoice,
|
|
96
55
|
permissions: requireAgentScope({
|
|
97
|
-
capability:
|
|
98
|
-
scopes: [
|
|
99
|
-
requireDPoP: true, // default true
|
|
56
|
+
capability: 'payment.charge',
|
|
57
|
+
scopes: ['payment.write'],
|
|
100
58
|
audience: (ctx) => `invoice:${ctx.params?.id}`,
|
|
101
|
-
validateAmount: (ctx, m) =>
|
|
59
|
+
validateAmount: (ctx, m) => {
|
|
60
|
+
const amount = (ctx.data as { amount?: number })?.amount ?? 0;
|
|
61
|
+
return amount <= (m.cap ?? 0) || `Amount ${amount} exceeds mandate cap ${m.cap}`;
|
|
62
|
+
},
|
|
102
63
|
}),
|
|
103
64
|
},
|
|
104
65
|
},
|
|
105
66
|
});
|
|
106
67
|
```
|
|
107
68
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
## Wiring — the authenticate callback
|
|
111
|
-
|
|
112
|
-
Arc takes no position on which credential format you use. Whatever your verifier produces — JWT, JWT-VC mandate, opaque API key with metadata sidecar — populates `RequestScope.service`:
|
|
69
|
+
## Wiring `authenticate`
|
|
113
70
|
|
|
114
71
|
```typescript
|
|
115
|
-
import { jwtVerify, createRemoteJWKSet } from
|
|
116
|
-
|
|
117
|
-
const JWKS = createRemoteJWKSet(new URL(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
audience: payload.aud as string | undefined,
|
|
150
|
-
parent: payload.parent as string | undefined,
|
|
151
|
-
},
|
|
152
|
-
dpopJkt,
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
return { id: payload.iss as string };
|
|
156
|
-
},
|
|
72
|
+
import { jwtVerify, createRemoteJWKSet } from 'jose';
|
|
73
|
+
|
|
74
|
+
const JWKS = createRemoteJWKSet(new URL('https://idp.example.com/.well-known/jwks.json'));
|
|
75
|
+
|
|
76
|
+
auth: {
|
|
77
|
+
type: 'authenticator',
|
|
78
|
+
authenticate: async (request, reply) => {
|
|
79
|
+
const [scheme, credential] = request.headers.authorization?.split(' ') ?? [];
|
|
80
|
+
if (scheme !== 'Mandate' || !credential) return reply.code(401).send({ code: 'arc.unauthorized', message: 'Unauthorized', status: 401 });
|
|
81
|
+
|
|
82
|
+
const { payload } = await jwtVerify(credential, JWKS, {
|
|
83
|
+
issuer: 'https://idp.example.com',
|
|
84
|
+
audience: 'https://api.example.com',
|
|
85
|
+
});
|
|
86
|
+
const dpopJkt = await verifyDPoPProof(request, payload.cnf?.jkt); // your DPoP verifier
|
|
87
|
+
if (!dpopJkt) return reply.code(401).send({ code: 'arc.unauthorized', message: 'DPoP proof invalid', status: 401 });
|
|
88
|
+
|
|
89
|
+
request.scope = {
|
|
90
|
+
kind: 'service',
|
|
91
|
+
clientId: String(payload.iss),
|
|
92
|
+
organizationId: String(payload.org ?? ''),
|
|
93
|
+
scopes: String(payload.scope ?? '').split(' ').filter(Boolean),
|
|
94
|
+
mandate: {
|
|
95
|
+
id: String(payload.jti),
|
|
96
|
+
capability: String(payload.cap),
|
|
97
|
+
cap: payload.amount as number | undefined,
|
|
98
|
+
currency: payload.currency as string | undefined,
|
|
99
|
+
expiresAt: (payload.exp as number) * 1000,
|
|
100
|
+
audience: payload.aud as string | undefined,
|
|
101
|
+
parent: payload.parent as string | undefined,
|
|
102
|
+
},
|
|
103
|
+
dpopJkt,
|
|
104
|
+
};
|
|
105
|
+
request.user = { id: String(payload.iss) };
|
|
157
106
|
},
|
|
158
|
-
}
|
|
107
|
+
}
|
|
159
108
|
```
|
|
160
109
|
|
|
161
|
-
|
|
110
|
+
Arc takes no position on credential format (JWT, JWT-VC, opaque key plus sidecar). Anything that fills `scope.mandate` and `scope.dpopJkt` works.
|
|
162
111
|
|
|
163
|
-
|
|
164
|
-
┌──────────────┐
|
|
165
|
-
user grants │ │
|
|
166
|
-
"charge up to │ Customer │
|
|
167
|
-
$50 on inv 7" │ │
|
|
168
|
-
└──────┬───────┘
|
|
169
|
-
│
|
|
170
|
-
┌─────────▼──────────┐
|
|
171
|
-
│ Issues mandate │
|
|
172
|
-
│ - cap: 50 USD │
|
|
173
|
-
│ - audience: │
|
|
174
|
-
│ "invoice:INV-7" │
|
|
175
|
-
│ - exp: now + 60s │
|
|
176
|
-
│ - cnf.jkt: agent │
|
|
177
|
-
└─────────┬──────────┘
|
|
178
|
-
│
|
|
179
|
-
▼
|
|
180
|
-
┌──────────────────────┐
|
|
181
|
-
│ AI Agent │
|
|
182
|
-
│ signs + presents │
|
|
183
|
-
│ mandate via DPoP │
|
|
184
|
-
└──────────┬───────────┘
|
|
185
|
-
│
|
|
186
|
-
▼
|
|
187
|
-
┌──────────────────────┐
|
|
188
|
-
│ Arc app │
|
|
189
|
-
│ authenticate fn: │
|
|
190
|
-
│ - verify mandate │
|
|
191
|
-
│ - verify DPoP │
|
|
192
|
-
│ - set scope.mandate │
|
|
193
|
-
│ + scope.dpopJkt │
|
|
194
|
-
└──────────┬───────────┘
|
|
195
|
-
│
|
|
196
|
-
▼
|
|
197
|
-
┌──────────────────────┐
|
|
198
|
-
│ requireAgentScope: │
|
|
199
|
-
│ - cap satisfied? │
|
|
200
|
-
│ - audience match? │
|
|
201
|
-
│ - DPoP bound? │
|
|
202
|
-
│ - not expired? │
|
|
203
|
-
└──────────┬───────────┘
|
|
204
|
-
│
|
|
205
|
-
✓ allow / ✗ deny
|
|
206
|
-
```
|
|
112
|
+
Flow: user grants a limited mandate (cap, audience, short TTL, key binding) => IdP mints it => agent presents it with a DPoP proof => `authenticate` verifies and fills scope => `requireAgentScope` checks cap, audience, expiry, binding.
|
|
207
113
|
|
|
208
|
-
## Audit
|
|
114
|
+
## Audit
|
|
209
115
|
|
|
210
|
-
|
|
116
|
+
Audit rows take the actor from the validated scope (`userId`, else `clientId`). Record mandate details explicitly through the audit logger:
|
|
211
117
|
|
|
212
118
|
```typescript
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
? {
|
|
217
|
-
kind: "service",
|
|
218
|
-
clientId: getClientId(request.scope),
|
|
219
|
-
mandateId: getMandate(request.scope)?.id,
|
|
220
|
-
dpopJkt: getDPoPJkt(request.scope),
|
|
221
|
-
}
|
|
222
|
-
: { kind: "user", userId: getUserId(request.scope) },
|
|
119
|
+
await app.audit.custom('invoice', id, 'pay', {
|
|
120
|
+
mandateId: getMandate(request.scope)?.id,
|
|
121
|
+
dpopJkt: getDPoPJkt(request.scope),
|
|
223
122
|
});
|
|
224
123
|
```
|
|
225
124
|
|
|
226
|
-
##
|
|
227
|
-
|
|
228
|
-
- **DPoP proof verification** — one `jose.dpop.verify()` call in your authenticate function. Arc would have to peer-dep `jose`; the host already has it.
|
|
229
|
-
- **JWT-VC mandate parser** — host's verifier (your IdP / AP2 issuer / custom).
|
|
230
|
-
- **Mandate issuance** — that's the IdP's job (or your token endpoint when you mint per-action mandates).
|
|
231
|
-
- **Risk scoring / device trust** — out of framework scope. Layer Castle / Stytch / Auth0 Risk separately.
|
|
232
|
-
|
|
233
|
-
## See also
|
|
125
|
+
## Not in arc
|
|
234
126
|
|
|
235
|
-
|
|
236
|
-
- [scim.md](scim.md) — IdP provisioning (the user-creation path agents authenticate against)
|
|
237
|
-
- [auth.md](auth.md) — Better Auth + service identity setup
|
|
238
|
-
- [`playground/enterprise-auth/`](../../../playground/enterprise-auth/) — runnable smoke
|
|
127
|
+
DPoP proof verification, mandate JWT/VC parsing, mandate issuance, risk scoring and device trust. These belong to your verifier, IdP or a vendor.
|
|
@@ -1,248 +1,44 @@
|
|
|
1
|
-
# Subpath
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
FieldMetadata,
|
|
39
|
-
RelationMetadata,
|
|
40
|
-
} from '@classytic/repo-core/adapter';
|
|
41
|
-
import { asRepositoryLike, isRepository } from '@classytic/repo-core/adapter';
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
`MinimalRepo` / `StandardRepo` import directly from `@classytic/repo-core/repository`.
|
|
45
|
-
|
|
46
|
-
## Auth
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
import { createBetterAuthAdapter, extractBetterAuthOpenApi } from '@classytic/arc/auth';
|
|
50
|
-
|
|
51
|
-
// Kit-owned BA overlays:
|
|
52
|
-
import { createBetterAuthOverlay, registerBetterAuthStubs } from '@classytic/mongokit/better-auth';
|
|
53
|
-
import { resolveBetterAuthCollections, BA_COLLECTIONS_BY_PLUGIN } from '@classytic/repo-core/better-auth';
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Permissions + scope
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
import {
|
|
60
|
-
allowPublic, requireAuth, requireRoles, requireOwnership,
|
|
61
|
-
requireOrgMembership, requireOrgRole, requireTeamMembership,
|
|
62
|
-
requireServiceScope, requireScopeContext, requireOrgInScope,
|
|
63
|
-
// Platform-only role gate — an ORG role can never satisfy it. Required by
|
|
64
|
-
// globally-scoped surfaces (jobsPlugin managementRoutes) that cannot filter by tenant.
|
|
65
|
-
requirePlatformRole,
|
|
66
|
-
|
|
67
|
-
// Agent-auth (2.13) — DPoP + capability mandates (AP2 / x402 / MCP)
|
|
68
|
-
requireAgentScope, requireMandate, requireDPoP,
|
|
69
|
-
type RequireAgentScopeOptions, type RequireMandateOptions,
|
|
70
|
-
allOf, anyOf, when, denyAll,
|
|
71
|
-
permissionMatrix, // 2.21: { read, write, delete? } → full CRUD map
|
|
72
|
-
createDynamicPermissionMatrix, createRoleHierarchy,
|
|
73
|
-
fields, roles,
|
|
74
|
-
} from '@classytic/arc/permissions';
|
|
75
|
-
|
|
76
|
-
import {
|
|
77
|
-
isMember, isService, isElevated, isAuthenticated, hasOrgAccess,
|
|
78
|
-
getUserId, getUserRoles, getOrgId, getOrgRoles, getTeamId, getClientId,
|
|
79
|
-
getServiceScopes, getScopeContext, getScopeContextMap,
|
|
80
|
-
getAncestorOrgIds, isOrgInScope, getRequestScope,
|
|
81
|
-
// Agent-auth scope accessors (2.13)
|
|
82
|
-
getMandate, getDPoPJkt, type Mandate,
|
|
83
|
-
requireUserId, requireClientId, // throw 401 (UnauthorizedError) if absent
|
|
84
|
-
requireOrgId, requireTeamId, // throw 403 (OrgRequiredError) if absent
|
|
85
|
-
createTenantKeyGenerator,
|
|
86
|
-
} from '@classytic/arc/scope';
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Cache
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
// HOST-LEVEL cache (action results, custom routes — NOT repo-bound paths)
|
|
93
|
-
import { MemoryCacheStore, RedisCacheStore, QueryCache } from '@classytic/arc/cache';
|
|
94
|
-
|
|
95
|
-
// REPO-BOUND cache (canonical) — getById/getAll/aggregate/count/etc
|
|
96
|
-
// Install once on the kit's repo; arc forwards declarative `cache:`
|
|
97
|
-
// config to req.cache automatically.
|
|
98
|
-
import { cachePlugin, type CacheOptions } from '@classytic/repo-core/cache';
|
|
99
|
-
// Per-call shape (TanStack-shaped):
|
|
100
|
-
// { staleTime, gcTime, swr, tags, bypass, enabled, key }
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Events
|
|
104
|
-
|
|
105
|
-
```typescript
|
|
106
|
-
import { eventPlugin, EventOutbox, MemoryOutboxStore } from '@classytic/arc/events';
|
|
107
|
-
import { RedisEventTransport } from '@classytic/arc/events/redis';
|
|
108
|
-
import { RedisStreamEventTransport } from '@classytic/arc/events/redis-stream';
|
|
109
|
-
|
|
110
|
-
// Event types live in primitives, NOT arc:
|
|
111
|
-
import type { EventMeta, DomainEvent, EventTransport, EventHandler } from '@classytic/primitives/events';
|
|
112
|
-
import { createEvent, createChildEvent, matchEventPattern } from '@classytic/primitives/events';
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Plugins
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
import {
|
|
119
|
-
healthPlugin, gracefulShutdownPlugin, ssePlugin,
|
|
120
|
-
metricsPlugin, versioningPlugin,
|
|
121
|
-
schedulesPlugin, // 2.21: interval jobs, optional LockAdapter leader lease, no Redis
|
|
122
|
-
type ScheduleDefinition,
|
|
123
|
-
} from '@classytic/arc/plugins';
|
|
124
|
-
// Lock contract (schedules.lock / MigrationRunner.lock) — one ecosystem standard:
|
|
125
|
-
// import type { LockAdapter } from '@classytic/repo-core/lock';
|
|
126
|
-
import { tracingPlugin } from '@classytic/arc/plugins/tracing';
|
|
127
|
-
import { auditPlugin } from '@classytic/arc/audit';
|
|
128
|
-
import { idempotencyPlugin } from '@classytic/arc/idempotency';
|
|
129
|
-
// Runtime capability registry (2.33) — declare process-local state so a
|
|
130
|
-
// `runtime: 'distributed'` boot fails on undeclared memory state:
|
|
131
|
-
import { declareRuntimeCapability } from '@classytic/arc/utils';
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
**Idempotency store — the one schema mistake that matters.** Backing the store
|
|
135
|
-
with a repository requires the key path to survive the filter. A Mongoose
|
|
136
|
-
schema with NO declared paths under a global `strictQuery: true` has EVERY
|
|
137
|
-
filter key stripped, so `getOne({ _id: key })` becomes `getOne({})`: one row
|
|
138
|
-
absorbs every key and responses replay across keys AND users. Declare the path
|
|
139
|
-
and pin the option on the schema:
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
new Schema({ _id: String }, { strict: false, strictQuery: false, timestamps: false })
|
|
143
|
-
// NOT `new Schema({}, { _id: false, strict: false })`
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
The plugin's boot self-check (default on, `selfCheck: false` to disable) probes
|
|
147
|
-
for exactly this and refuses to register; the adapter also throws
|
|
148
|
-
`IdempotencyStoreMisconfiguredError` on any cross-key read at runtime.
|
|
149
|
-
|
|
150
|
-
## Integrations
|
|
151
|
-
|
|
152
|
-
```typescript
|
|
153
|
-
import { jobsPlugin } from '@classytic/arc/integrations/jobs';
|
|
154
|
-
import { websocketPlugin } from '@classytic/arc/integrations/websocket';
|
|
155
|
-
import { eventGatewayPlugin } from '@classytic/arc/integrations/event-gateway';
|
|
156
|
-
import { webhookPlugin } from '@classytic/arc/integrations/webhooks';
|
|
157
|
-
import { mcpPlugin, defineTool, definePrompt, fieldRulesToZod, resourceToTools } from '@classytic/arc/mcp';
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Enterprise auth (2.13)
|
|
161
|
-
|
|
162
|
-
```typescript
|
|
163
|
-
// SCIM 2.0 — IdP provisioning
|
|
164
|
-
import {
|
|
165
|
-
scimPlugin,
|
|
166
|
-
type ScimPluginOptions,
|
|
167
|
-
type ScimResourceMapping,
|
|
168
|
-
parseScimFilter, parseScimPatch,
|
|
169
|
-
DEFAULT_USER_MAPPING, DEFAULT_GROUP_MAPPING,
|
|
170
|
-
SCIM_USER_SCHEMA, SCIM_GROUP_SCHEMA,
|
|
171
|
-
ScimError,
|
|
172
|
-
} from '@classytic/arc/scim';
|
|
173
|
-
|
|
174
|
-
// Better Auth → arc audit bridge
|
|
175
|
-
import {
|
|
176
|
-
wireBetterAuthAudit,
|
|
177
|
-
type AuthEvent, type AuthEventName,
|
|
178
|
-
type WireBetterAuthAuditOptions,
|
|
179
|
-
} from '@classytic/arc/auth/audit';
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## Hooks + presets
|
|
183
|
-
|
|
184
|
-
```typescript
|
|
185
|
-
import { createHookSystem, beforeCreate, afterCreate, beforeUpdate, afterUpdate } from '@classytic/arc/hooks';
|
|
186
|
-
import {
|
|
187
|
-
bulkPreset, softDeletePreset, slugLookupPreset, treePreset,
|
|
188
|
-
ownedByUserPreset, multiTenantPreset, auditedPreset, searchPreset,
|
|
189
|
-
filesUploadPreset,
|
|
190
|
-
type TenantFieldSpec,
|
|
191
|
-
} from '@classytic/arc/presets';
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
## Usage (2.22)
|
|
195
|
-
|
|
196
|
-
```typescript
|
|
197
|
-
// Per-actor, per-period (UTC YYYY-MM) usage counters — the accounting layer for
|
|
198
|
-
// quotas, plan enforcement, and usage-based billing. Decorates `fastify.usage`.
|
|
199
|
-
// requireQuota = the enforcement half: PermissionCheck gating on counters
|
|
200
|
-
// (429 quota.exceeded with { kind, used, limit, period, resetsAt }; limit may
|
|
201
|
-
// be a number, false = unlimited, or a plan-aware resolver; fail-open default).
|
|
202
|
-
import { usagePlugin, MemoryUsageStore, usagePeriod, requireQuota } from '@classytic/arc/usage';
|
|
203
|
-
import type { UsageStore, UsageBucket, UsagePluginOptions, UsageMeter, QuotaOptions } from '@classytic/arc/usage';
|
|
204
|
-
// Canonical store contract + cross-kit conformance: @classytic/repo-core/usage +
|
|
205
|
-
// runUsageStoreContract from @classytic/repo-core/testing; Mongo adapter:
|
|
206
|
-
// createMongoUsageStore from @classytic/mongokit/usage (>=3.22).
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
## Testing
|
|
210
|
-
|
|
211
|
-
```typescript
|
|
212
|
-
import {
|
|
213
|
-
createTestApp, expectArc, createHttpTestHarness,
|
|
214
|
-
TestAuthSession, TestAuthProvider, TestFixtures,
|
|
215
|
-
runStorageContract,
|
|
216
|
-
bootModuleApp, // 2.22: real app around modules ("boots green ⇒ composes");
|
|
217
|
-
// t.exports<T>(name) typed accessor; DB via `database` seam —
|
|
218
|
-
// mongoMemoryDatabase default, any kit injectable
|
|
219
|
-
mongoMemoryDatabase,
|
|
220
|
-
} from '@classytic/arc/testing';
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
## Utilities
|
|
224
|
-
|
|
225
|
-
```typescript
|
|
226
|
-
import {
|
|
227
|
-
createStateMachine, CircuitBreaker, withCompensation, defineGuard,
|
|
228
|
-
retry, queryParser,
|
|
229
|
-
// AI SDK / OpenAI streams → Fastify reply (no JsonToSseTransformStream boilerplate)
|
|
230
|
-
pipeUIMessageStreamToReply, UI_MESSAGE_STREAM_HEADERS, isReadableStream,
|
|
231
|
-
} from '@classytic/arc/utils';
|
|
232
|
-
import { defineMigration, MigrationRunner } from '@classytic/arc/migrations';
|
|
233
|
-
import { Type, ArcListResponse } from '@classytic/arc/schemas';
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
## Type-only barrel
|
|
237
|
-
|
|
238
|
-
```typescript
|
|
239
|
-
// Type-only — produces `export {}` at runtime; this is correct
|
|
240
|
-
import type { ArcRequest, IRequestContext, IControllerResponse } from '@classytic/arc/types';
|
|
241
|
-
```
|
|
1
|
+
# Subpath import map
|
|
2
|
+
|
|
3
|
+
Import only from these subpaths (tree-shaken, no deep imports). Authoritative list: `api-surface.json`. Adapters live in kits (`@classytic/mongokit/adapter`, `@classytic/sqlitekit/adapter`, `@classytic/prismakit/adapter`); adapter and repository types come from `@classytic/repo-core/adapter` and `@classytic/repo-core/repository`. Event types come from `@classytic/primitives/events`, the outbox contract from `@classytic/primitives/outbox`. `@classytic/arc/types` and `@classytic/arc/types/storage` are type-only.
|
|
4
|
+
|
|
5
|
+
| Subpath | Main exports |
|
|
6
|
+
|---|---|
|
|
7
|
+
| `@classytic/arc` | `defineResource`, `defineAction`, `defineAggregation`, `defineResourceVariants`, `mergeResourceConfig`, `BaseController`, `BaseCrudController`, `BulkMixin`, `SlugMixin`, `SoftDeleteMixin`, `TreeMixin`, permission helpers, `ArcError`, `NotFoundError`, `ValidationError`, `createDomainError`, constants (`CRUD_OPERATIONS`, `DEFAULT_LIMIT` ...) |
|
|
8
|
+
| `/core` | Same resource and controller API plus `routeInput`, `crudInput`, `parsed`, `noPayloadSchema`, `createCrudRouter`, `QueryResolver`, `AccessControl`, `BodySanitizer`, `validateResourceConfig` |
|
|
9
|
+
| `/factory` | `createApp`, `createWorker`, `loadResources`, `defineModule`, `extendModule`, `getModuleExports`, `orderModules`, `planModules`, `verifyModuleGraph`, `renderModuleGraph`, `toAsyncApi`, `toFetchHandler`, `eventTopology`, `verifyEventDurability`, `createRelayNudge`, presets (`productionPreset`, `developmentPreset`, `testingPreset`, `edgePreset`) |
|
|
10
|
+
| `/permissions` | `allowPublic`, `requireAuth`, `requireRoles`, `requireOwnership`, `requireOrgMembership`, `requireOrgRole`, `requireTeamMembership`, `requireServiceScope`, `requireScopeContext`, `requireOrgInScope`, `requirePlatformRole`, `requireGrant`, `requireAgentScope`, `requireMandate`, `requireDPoP`, `allOf`, `anyOf`, `not`, `when`, `allow`, `deny`, `denyAll`, `permissionMatrix`, `createDynamicPermissionMatrix`, `createRoleHierarchy`, `fields`, `roles`, `introspectModule` |
|
|
11
|
+
| `/scope` | `getUserId`, `getOrgId`, `getOrgRoles`, `getTeamId`, `getClientId`, `getScopeContext`, `getRequestScope`, `getServiceScopes`, `getMandate`, `getDPoPJkt`, `isMember`, `isService`, `isElevated`, `isAuthenticated`, `hasOrgAccess`, `isOrgInScope`, `requireUserId`, `requireOrgId`, `requireTeamId`, `requireClientId`, `elevationPlugin`, `createTenantKeyGenerator`, `PUBLIC_SCOPE`, `AUTHENTICATED_SCOPE` |
|
|
12
|
+
| `/presets` (+ `/presets/tenant`, `/files-upload`, `/search`) | `multiTenantPreset`, `softDeletePreset`, `bulkPreset`, `slugLookupPreset`, `treePreset`, `ownedByUserPreset`, `auditedPreset`, `searchPreset`, `filesUploadPreset`, `registerPreset`, `applyPresets` |
|
|
13
|
+
| `/auth` (+ `/auth/redis`, `/auth/audit`) | `authPlugin`, `createBetterAuthAdapter`, `extractBetterAuthOpenApi`, `createSessionManager`, `MemorySessionStore`, `RedisSessionStore`, `wireBetterAuthAudit` |
|
|
14
|
+
| `/scim` | `scimPlugin`, `parseScimFilter`, `parseScimPatch`, `ScimError`, `DEFAULT_USER_MAPPING`, `DEFAULT_GROUP_MAPPING`, `SCIM_USER_SCHEMA`, `SCIM_GROUP_SCHEMA` |
|
|
15
|
+
| `/cache` | `QueryCache`, `queryCachePlugin`, `MemoryCacheStore`, `RedisCacheStore`, `ioredisAsCacheClient`, `upstashAsCacheClient`. Repo-bound cache: `cachePlugin` from `@classytic/repo-core/cache` |
|
|
16
|
+
| `/events` | `eventPlugin`, `MemoryEventTransport`, `defineEvent`, `createEventRegistry`, `withRetry`, `withInbox`, `withSubscriberId`, `wrapWithSchema`, `subscribeWithSchema`, `wrapWithBoundary`, `subscribeWithBoundary`, `createDeadLetterPublisher`, `EventOutbox`, `MemoryOutboxStore`, `repositoryAsOutboxStore`, `createOutboxModule`, `exponentialBackoff`, `readOutboxHealth`, `crudEventType`, `ARC_LIFECYCLE_EVENTS` |
|
|
17
|
+
| `/events/redis`, `/events/redis-stream` | `RedisEventTransport`, `RedisStreamTransport` |
|
|
18
|
+
| `/outbox-admin` | `createOutboxAdminModule` |
|
|
19
|
+
| `/plugins` | `healthPlugin`, `gracefulShutdownPlugin`, `ssePlugin`, `metricsPlugin`, `versioningPlugin`, `schedulesPlugin`, `cachingPlugin`, `pressurePlugin`, `realtimePlugin`, `requestIdPlugin`, `errorHandlerPlugin`, `createPlugin`, `createDailyGate`, `createMemoryDailyLedger`; types `DailyLedger`, `DailyScheduleOptions`, `ScheduleRunContext`, `ScheduleDefinition` |
|
|
20
|
+
| `/plugins/tracing`, `/plugins/response-cache` | `tracingPlugin`, `traced`, `createSpan`; `responseCachePlugin` |
|
|
21
|
+
| `/audit` | `auditPlugin`, `MemoryAuditStore`, `repositoryAsAuditStore`, `createAuditEntry` |
|
|
22
|
+
| `/idempotency` (+ `/idempotency/redis`) | `idempotencyPlugin`, `MemoryIdempotencyStore`, `repositoryAsIdempotencyStore`, `IdempotencyStoreMisconfiguredError`; `RedisIdempotencyStore` |
|
|
23
|
+
| `/usage` | `usagePlugin`, `MemoryUsageStore`, `RedisUsageStore`, `usagePeriod`, `requireQuota` |
|
|
24
|
+
| `/hooks`, `/pipeline`, `/middleware` | `createHookSystem`, `beforeCreate`, `afterCreate`, `beforeUpdate` ...; `pipe`, `guard`, `transform`, `intercept`; `multipartBody` |
|
|
25
|
+
| `/context`, `/logger` | `requestContext`, `transactionContext`, `runWorkScope`; `arcLog`, `configureArcLogger` |
|
|
26
|
+
| `/registry`, `/discovery`, `/docs` | `ResourceRegistry`, `introspectionPlugin`; `discoverResources`; `openApiPlugin`, `scalarPlugin`, `buildOpenApiSpec` |
|
|
27
|
+
| `/schemas` | `Type`, `ArcListResponse`, `ArcErrorResponse`, `ArcPaginationQuery` |
|
|
28
|
+
| `/utils` | `createStateMachine`, `CircuitBreaker`, `withCompensation`, `defineGuard`, `declareRuntimeCapability`, `createQueryParser`, `ArcQueryParser`, `createError`, `pipeUIMessageStreamToReply`, `listResponse`, `errorContractSchema`, error classes |
|
|
29
|
+
| `/migrations` | `defineMigration`, `MigrationRunner`, `MigrationRegistry`, `MongoMigrationStore` |
|
|
30
|
+
| `/cleanup` | `createDataCleanupModule`, `createCleanupService`, `createCleanupRegistry`, `recipeFromSteps` |
|
|
31
|
+
| `/encryption` | `encryptionPlugin`, `encryptField`, `decryptField`, `createStaticKeyProvider` |
|
|
32
|
+
| `/mcp` (+ `/mcp/testing`) | `mcpPlugin`, `defineTool`, `definePrompt`, `resourceToTools`, `fieldRulesToZod`, `createMcpServer`; `createTestMcpClient` |
|
|
33
|
+
| `/integrations/jobs` | `jobsPlugin`, `defineJob` |
|
|
34
|
+
| `/integrations/websocket` (+ `-redis`, `-pushref-redis`) | `websocketPlugin`, `RoomManager`, `GeoRoom`; `RedisWebSocketAdapter`; `RedisPushRefStore` |
|
|
35
|
+
| `/integrations/event-gateway`, `/streamline`, `/webhooks` | `eventGatewayPlugin`; `streamlinePlugin`; `webhookPlugin`, `verifyWebhook`, `createDurableWebhookModule` |
|
|
36
|
+
| `/testing` (+ `/testing/storage`, `/cleanup`, `/outbox`, `/ports`) | `createTestApp`, `expectArc`, `createHttpTestHarness`, `bootModuleApp`, `createTestFixtures`, `runStorageContract`, `runOutboxStoreContract`, `assertRequiresPorts` |
|
|
37
|
+
| `/cli` | `describe`, `doctor`, `generate`, `init`, `introspect`, `exportDocs` |
|
|
242
38
|
|
|
243
39
|
## Notes
|
|
244
40
|
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
41
|
+
- No default exports except `fp()`-wrapped plugin entry files.
|
|
42
|
+
- Type-only subpaths compile to `export {}`.
|
|
43
|
+
- Idempotency backed by a repository: the key path must survive query filtering. A Mongoose schema with no declared paths under global `strictQuery: true` strips every filter key, so one row absorbs all keys. Use `new Schema({ _id: String }, { strict: false, strictQuery: false, timestamps: false })`. The plugin's boot self-check (`selfCheck: false` disables) refuses to start on this.
|
|
44
|
+
- Lock contract for `schedules.lock` and `MigrationRunner.lock`: `LockAdapter` from `@classytic/repo-core/lock`.
|