@classytic/arc 2.47.0 → 2.49.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/dist/{EventTransport-BHKy4_Bi.mjs → EventTransport-DbHZK230.mjs} +2 -2
- package/dist/{HookSystem-CAIDVoKC.mjs → HookSystem-DMoeJ6Do.mjs} +2 -2
- package/dist/{QueryCache-DdvrGG8Q.d.mts → QueryCache-BE47tmlO.d.mts} +36 -1
- package/dist/{ResourceRegistry-23Ml6FNe.mjs → ResourceRegistry-CP-iTcKy.mjs} +2 -2
- package/dist/{acquire-DoFX06fm.mjs → acquire-CB0va87C.mjs} +1 -1
- package/dist/audit/index.d.mts +1 -1
- package/dist/audit/index.mjs +4 -4
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +2 -2
- package/dist/auth/index.mjs +53 -15
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-DYiubkYw.mjs → authorizationDecision-DHO94aV2.mjs} +4 -4
- package/dist/{boundedMap-CtdzpJ3X.mjs → boundedMap-C51EUUOm.mjs} +1 -1
- package/dist/{buildHandler-CARdmPNo.mjs → buildHandler-9DuwEKvr.mjs} +23 -16
- package/dist/cache/index.d.mts +2 -2
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-QRiryDLs.mjs → caching-COTX3sDa.mjs} +3 -6
- package/dist/{claimed-BLecr1j3.mjs → claimed-C7T1nHlo.mjs} +1 -1
- package/dist/cleanup/index.d.mts +2 -2
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +1 -1
- package/dist/cli/commands/describe.mjs +3 -3
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.mjs +1 -1
- package/dist/cli/commands/generate.mjs +2 -2
- package/dist/cli/commands/init.mjs +2 -2
- package/dist/cli/commands/introspect.mjs +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-Cx7BcnHT.mjs → constants-DOnfMd7i.mjs} +1 -1
- package/dist/context/index.mjs +5 -5
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +7 -7
- package/dist/{core-0WyMuo0f.mjs → core-BoEdFDDw.mjs} +3 -3
- package/dist/{createActionRouter-mLAGbpDV.mjs → createActionRouter-CpTn15dm.mjs} +54 -18
- package/dist/{createAggregationRouter-BEAjn3dA.mjs → createAggregationRouter-CD_Hydp0.mjs} +13 -11
- package/dist/{createApp-QDP4vYWH.mjs → createApp-Be6XTGD9.mjs} +332 -40
- package/dist/{createMcpServer-DzXHX0SO.d.mts → createMcpServer-CS2KOVP6.d.mts} +9 -10
- package/dist/{defineAggregation-CFNfvz-C.mjs → defineAggregation-BI5pRb8c.mjs} +1 -1
- package/dist/{defineResource-BROJmhzJ.mjs → defineResource-BAzNu5Um.mjs} +8 -8
- package/dist/discovery/index.mjs +1 -1
- package/dist/docs/index.d.mts +1 -1
- package/dist/docs/index.mjs +3 -3
- package/dist/{elevation-DrXeEWWk.mjs → elevation-DupGuM41.mjs} +6 -9
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-BiBXtxj4.mjs → errorHandler-DA03vRqp.mjs} +4 -7
- package/dist/{errors-DnrUChAy.mjs → errors-BpYV859Y.mjs} +1 -1
- package/dist/{eventPlugin-BhKLUe7H.mjs → eventPlugin-D7LYtYzL.mjs} +9 -13
- package/dist/{eventTypes-CCIRGakw.mjs → eventTypes-BqA-N-Uz.mjs} +2 -2
- package/dist/events/index.d.mts +18 -5
- package/dist/events/index.mjs +8 -8
- package/dist/events/transports/redis-stream-entry.mjs +4 -4
- package/dist/events/transports/redis.d.mts +35 -0
- package/dist/events/transports/redis.mjs +87 -11
- package/dist/factory/index.d.mts +4 -4
- package/dist/factory/index.mjs +6 -6
- package/dist/{fastify-augmentation-bzkWPt1f.d.mts → fastify-augmentation-baQc3MaO.d.mts} +2 -2
- package/dist/fieldTypes-EFWxCkZ5.mjs +80 -0
- package/dist/{fields-CYdpcV73.mjs → fields-CT1Erg7o.mjs} +1 -1
- package/dist/{filter-merge-6kasezRH.mjs → filter-merge-B1eJ1pMx.mjs} +1 -1
- package/dist/{generate-DUkcbc4r.mjs → generate-Cr0ULavs.mjs} +2 -2
- package/dist/{headers-KxhrKevA.mjs → headers-D4bncIOf.mjs} +2 -2
- package/dist/{health-jkYNdobJ.mjs → health-BoFxrkJE.mjs} +1 -1
- package/dist/{health-CRJg3IIq.mjs → health-DN_pUVMX.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/http-cache/index.d.mts +2 -2
- package/dist/http-cache/index.mjs +4 -4
- package/dist/http-cache/purgers/cloudflare.mjs +2 -2
- package/dist/http-cache/purgers/fastly.mjs +2 -2
- package/dist/http-cache/testing/index.mjs +1 -1
- package/dist/idempotency/index.d.mts +1 -1
- package/dist/idempotency/index.mjs +10 -8
- package/dist/idempotency/redis.mjs +2 -2
- package/dist/{index-B5i9-vuP.d.mts → index-CMNpMBtW.d.mts} +1 -1
- package/dist/{index-BxZS-8So.d.mts → index-DKM2p5w5.d.mts} +48 -23
- package/dist/{index-Cy2-QffW.d.mts → index-DLCcLUQT.d.mts} +69 -6
- package/dist/{index-DFCCQ9AE.d.mts → index-DexdFs1a.d.mts} +1 -1
- package/dist/{index-D1X_C_qz.d.mts → index-Dhrks-hM.d.mts} +60 -10
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +11 -11
- package/dist/{init-CACwpktI.mjs → init-C4a24wD2.mjs} +1 -1
- package/dist/integrations/event-gateway.mjs +2 -2
- package/dist/integrations/index.d.mts +2 -2
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.mjs +3 -3
- package/dist/integrations/mcp/index.d.mts +6 -38
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +11 -15
- package/dist/integrations/mcp/testing.mjs +22 -42
- package/dist/integrations/streamline.mjs +3 -3
- package/dist/integrations/webhooks.d.mts +1 -1
- package/dist/integrations/webhooks.mjs +4 -4
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +2 -2
- package/dist/{jsonBody-CzDBkCme.mjs → jsonBody-DoTt5BS6.mjs} +2 -2
- package/dist/{keys-Cbwf6r1B.mjs → keys--l9n7aOC.mjs} +1 -1
- package/dist/{loadResources-Kr6vuljv.mjs → loadResources-rygByIQA.mjs} +3 -3
- package/dist/{loadResourcesFromEntry-D2e0qoDR.mjs → loadResourcesFromEntry-ItNBIQ5w.mjs} +2 -2
- package/dist/logger/index.mjs +2 -2
- package/dist/{logger-C110X5Yz.mjs → logger-UbknHqHy.mjs} +1 -1
- package/dist/{mcpPlugin-4lIPr9OJ.mjs → mcpPlugin-CTkk4RP8.mjs} +218 -378
- package/dist/{memory-D9qkhXiB.mjs → memory-C47xVsjX.mjs} +3 -3
- package/dist/{metrics-B-qrrWfI.mjs → metrics-TJyAb1Xk.mjs} +4 -7
- package/dist/middleware/index.d.mts +1 -1
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.mjs +2 -2
- package/dist/{module-BD8xHgrz.mjs → module-CWiqsXnh.mjs} +1 -1
- package/dist/{multiTenant-KZj8j1uJ.d.mts → multiTenant-QtDzxx_K.d.mts} +1 -1
- package/dist/{multipartBody-qU7KCn1l.mjs → multipartBody-BdG1qbn1.mjs} +1 -1
- package/dist/{observeSend-BnPtTotW.mjs → observeSend-DrA3ADFN.mjs} +1 -1
- package/dist/{openapi-DoVa5SVP.mjs → openapi-D6MAbYpv.mjs} +7 -7
- package/dist/outbox-admin/index.d.mts +1 -1
- package/dist/outbox-admin/index.mjs +5 -5
- package/dist/{outbox-module-DyITEIop.mjs → outbox-module-D5QABFQW.mjs} +197 -28
- package/dist/{outbox-module-5Mnwcycy.d.mts → outbox-module-DzW6zwWJ.d.mts} +103 -10
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-BBy4bOGi.mjs → permissions-CFsmdYUt.mjs} +9 -9
- package/dist/{pipe-BOm2o4UA.mjs → pipe-B_05AgGt.mjs} +2 -2
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/pipeline/index.mjs +2 -2
- package/dist/{plan-DDIGwuxr.mjs → plan-BnlNJhrj.mjs} +1 -1
- package/dist/{plugin-Bn4D_0XK.mjs → plugin-CrMPYbdj.mjs} +94 -50
- package/dist/plugins/index.d.mts +6 -5
- package/dist/plugins/index.mjs +19 -18
- package/dist/plugins/response-cache.mjs +4 -4
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-ClEjcKlG.mjs → pluralize-oVIxJ4CY.mjs} +1 -1
- package/dist/presets/filesUpload.d.mts +1 -1
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +2 -2
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +5 -5
- package/dist/presets/search.d.mts +1 -1
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-DK2jh5YR.mjs → presets-CUd3L7v6.mjs} +4 -4
- package/dist/{projection-BHH-sXyS.mjs → projection-DowJlIto.mjs} +2 -2
- package/dist/{purger.types-2wNJK_89.mjs → purger.types-BjKy8869.mjs} +1 -1
- package/dist/{queryCachePlugin-Ckqe98AM.mjs → queryCachePlugin-BvB3k_Fh.mjs} +114 -14
- package/dist/{queryCachePlugin-DYQUyeJ9.d.mts → queryCachePlugin-DrQNnGws.d.mts} +1 -1
- package/dist/{rateLimitKey-CWAjlqcN.mjs → rateLimitKey-56nH1cWN.mjs} +1 -1
- package/dist/{realtime-BIJi9USY.mjs → realtime-DXGBPtYK.mjs} +19 -22
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-y9ZA-R_J.mjs → registry-Biz-6sEZ.mjs} +2 -2
- package/dist/{relay-BNrC1CEP.mjs → relay-DEIoMntZ.mjs} +200 -99
- package/dist/{renewingLease-CS43br5E.mjs → renewingLease-BCJpW9-u.mjs} +1 -1
- package/dist/{replyHelpers-oZDzakGb.mjs → replyHelpers-DliJNb0-.mjs} +2 -2
- package/dist/{requestContext-fWb_YaV2.mjs → requestContext-tUgLt9Ky.mjs} +1 -1
- package/dist/{requirement--2hWyyHi.mjs → requirement-0l2DApiQ.mjs} +1 -1
- package/dist/{resourceRateLimit-DCWglD7V.d.mts → resourceRateLimit-BPiESPtG.d.mts} +4 -0
- package/dist/{resourceRateLimit-1WbcyMZY.mjs → resourceRateLimit-iSXF8rLH.mjs} +19 -4
- package/dist/{rolldown-runtime-yH2lHMo_.mjs → rolldown-runtime-gKJR3o-6.mjs} +1 -1
- package/dist/{routeValidator-BSlRIA5c.mjs → routeValidator-xNYA4rr1.mjs} +47 -5
- package/dist/{runtimeCapabilities-CYCEtU1W.mjs → runtimeCapabilities-BQK-GrYe.mjs} +1 -1
- package/dist/{schedules-B5WGlYIT.mjs → schedules-D9iMVFhF.mjs} +6 -9
- package/dist/{schemaConverter-DtNvts-6.mjs → schemaConverter-cIh4oX9a.mjs} +2 -2
- package/dist/{actionPermissions-DXrlWHHK.mjs → schemaIR-BsY4y9VP.mjs} +184 -16
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.d.mts +1 -1
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-BwVLSyNG.mjs → scope-QyhM9w8z.mjs} +4 -4
- package/dist/{shutdown-BJiJN7FT.mjs → shutdown-BM7Q0h4B.mjs} +1 -1
- package/dist/{sse-B_50llZu.mjs → sse-ofvlcTQQ.mjs} +9 -35
- package/dist/sseStats-DQqNN385.d.mts +112 -0
- package/dist/sseStream-BxQW7hPq.mjs +166 -0
- package/dist/{store-helpers-D-n5cwy5.mjs → store-helpers-_FRhHDyv.mjs} +1 -1
- package/dist/{simpleEqualityMatcher-DGRLq-1k.mjs → streamFrames-B3ZJfI02.mjs} +19 -2
- package/dist/{streaming-Dcgqa-hH.mjs → streaming-HZr63UiM.mjs} +1 -1
- package/dist/{subscriberIdentity-C9KhIXTF.mjs → subscriberIdentity-DSgnoT_D.mjs} +1 -1
- package/dist/{tenancy-COrhjPRZ.mjs → tenancy-_ukT0oBt.mjs} +2 -2
- package/dist/{tenantPreparation-BElWHytd.mjs → tenantPreparation-DSlQI53c.mjs} +4 -4
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +4 -4
- package/dist/testing/index.mjs +324 -17
- package/dist/testing/outboxStoreContract.mjs +2 -2
- package/dist/testing/requiredPorts.mjs +2 -2
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{timing-CaxKbRk_.mjs → timing-Z8p-Zlw1.mjs} +1 -1
- package/dist/{transactionContext-8qKON0Nk.mjs → transactionContext-DBbSTfY3.mjs} +1 -1
- package/dist/{typeGuards-DVjVSsXO.mjs → typeGuards-_6nNQqgq.mjs} +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-DeLiuaNv.d.mts → types-B4E0sc6D.d.mts} +20 -31
- package/dist/{types-DZHqOuJE.mjs → types-CrOlZ4rY.mjs} +4 -4
- package/dist/usage/index.d.mts +1 -1
- package/dist/usage/index.mjs +7 -7
- package/dist/{userHelpers-_eGj6kf0.mjs → userHelpers-CBKx3XJN.mjs} +1 -1
- package/dist/utils/index.d.mts +239 -34
- package/dist/utils/index.mjs +13 -13
- package/dist/{utils-Dd6MWpye.mjs → utils--HE8R8sH.mjs} +761 -8
- package/dist/{validate-BaF5wd0x.mjs → validate-BUeE2MLR.mjs} +3 -3
- package/dist/{versioning-S18y2-0C.d.mts → versioning-B07RgD27.d.mts} +2 -13
- package/dist/{versioning-DyV7mwtK.mjs → versioning-qYgqwOhL.mjs} +4 -7
- package/dist/{workScope-CmCBUmPR.mjs → workScope-C-1QHNmV.mjs} +2 -2
- package/llms.txt +2 -2
- package/package.json +42 -50
- package/skills/arc/references/api-reference.md +2 -2
- package/skills/arc/references/auth-better-auth.md +1 -0
- package/skills/arc/references/events-outbox.md +7 -4
- package/skills/arc/references/events.md +2 -2
- package/skills/arc/references/mcp-custom-tools.md +1 -1
- package/skills/arc/references/mcp-setup.md +11 -10
- package/skills/arc/references/mcp-testing.md +3 -3
- package/skills/arc/references/production-api.md +4 -0
- package/skills/arc/references/production-boot.md +2 -0
- package/skills/arc/references/production-idempotency.md +1 -1
- package/skills/arc/references/production-realtime.md +28 -2
- package/skills/arc/references/validation.md +4 -0
- package/skills/arc/references/writes-hooks-errors.md +1 -0
- package/dist/schemaIR-uS_RHqa3.mjs +0 -108
- package/dist/sseStream-BjSo9Ult.mjs +0 -57
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
-
import { o as toJsonSchema } from "./schemaConverter-DtNvts-6.mjs";
|
|
3
|
-
// src/core/schemaIR.ts
|
|
4
|
-
/**
|
|
5
|
-
* Schema IR — one canonical representation, two adapters.
|
|
6
|
-
*
|
|
7
|
-
* arc's action-schema handling used to live in two parallel translators:
|
|
8
|
-
* `normalizeActionSchema()` in [createActionRouter.ts](./createActionRouter.ts)
|
|
9
|
-
* produced JSON Schema for AJV, and `convertActionSchemaToZod()` in
|
|
10
|
-
* [../integrations/mcp/action-tools.ts](../integrations/mcp/action-tools.ts)
|
|
11
|
-
* produced Zod shapes for MCP. Same input shape, two implementations — the
|
|
12
|
-
* exact drift pattern routerShared exists to eliminate.
|
|
13
|
-
*
|
|
14
|
-
* This module is the single source of truth: every caller normalizes to
|
|
15
|
-
* `SchemaIR` first, then emits whichever surface they need. If a future
|
|
16
|
-
* refactor adds a field to the IR (e.g. `propertyOrder`, `examples`),
|
|
17
|
-
* both adapters pick it up automatically.
|
|
18
|
-
*
|
|
19
|
-
* **The IR preserves `additionalProperties`.** The previous implementation
|
|
20
|
-
* dropped the flag during normalization, so `additionalProperties: false`
|
|
21
|
-
* silently no-opped even though [createActionRouter.ts:425-428](./createActionRouter.ts#L425-L428)
|
|
22
|
-
* documented it as the opt-in escape hatch for strict validation. The IR
|
|
23
|
-
* carries the flag verbatim; both adapters honor it.
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Normalize anything the author handed us (Zod schema, plain JSON Schema,
|
|
27
|
-
* or `undefined`) into a canonical `SchemaIR`.
|
|
28
|
-
*
|
|
29
|
-
* Accepts:
|
|
30
|
-
* - `undefined` / non-object → empty IR (no properties, no required)
|
|
31
|
-
* - Zod v4 object schema — converted via `toJsonSchema` from the shared utility
|
|
32
|
-
* - Plain JSON Schema with `type: 'object'` or `properties`
|
|
33
|
-
*
|
|
34
|
-
* Anything that can't be read as an object schema collapses to an empty IR
|
|
35
|
-
* (no throw — the caller decides whether that's a validation error).
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* normalizeSchemaIR({
|
|
40
|
-
* type: 'object',
|
|
41
|
-
* properties: { carrier: { type: 'string' } },
|
|
42
|
-
* required: ['carrier'],
|
|
43
|
-
* additionalProperties: false,
|
|
44
|
-
* });
|
|
45
|
-
* // → { properties: { carrier: { type: 'string' } }, required: ['carrier'], additionalProperties: false }
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
function normalizeSchemaIR(raw) {
|
|
49
|
-
if (!raw || typeof raw !== "object") return {
|
|
50
|
-
properties: {},
|
|
51
|
-
required: []
|
|
52
|
-
};
|
|
53
|
-
const converted = toJsonSchema(raw, "draft-7", "throw");
|
|
54
|
-
if (!converted || typeof converted !== "object" || converted.type !== "object" && !("properties" in converted)) return {
|
|
55
|
-
properties: {},
|
|
56
|
-
required: []
|
|
57
|
-
};
|
|
58
|
-
const properties = converted.properties ?? {};
|
|
59
|
-
const required = (Array.isArray(converted.required) ? converted.required : []).filter((field) => !("default" in (properties[field] ?? {})));
|
|
60
|
-
const additionalProperties = converted.additionalProperties;
|
|
61
|
-
return {
|
|
62
|
-
properties,
|
|
63
|
-
required,
|
|
64
|
-
...additionalProperties !== void 0 ? { additionalProperties } : {}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Emit a JSON Schema branch from the IR, with optional extra properties
|
|
69
|
-
* merged in (e.g. the `action: { const: 'approve' }` discriminator added
|
|
70
|
-
* by `buildActionBodySchema`).
|
|
71
|
-
*
|
|
72
|
-
* Preserves `additionalProperties` verbatim — strict schemas (`false`)
|
|
73
|
-
* reach AJV intact, so HTTP validation rejects unknown fields before the
|
|
74
|
-
* handler runs. This closes the bug where the documented strict-mode
|
|
75
|
-
* escape hatch silently no-opped because normalization dropped the flag.
|
|
76
|
-
*
|
|
77
|
-
* `default` is stripped from each property schema. Zod v4's `z.toJSONSchema()`
|
|
78
|
-
* emits `default` for `.default()` fields, but AJV with `useDefaults: true`
|
|
79
|
-
* cannot apply defaults inside `oneOf` branches and throws a strict-mode error
|
|
80
|
-
* (`strict mode: default is ignored for: <path>`). Runtime defaults are applied
|
|
81
|
-
* by Zod parsing at the handler layer anyway, so the keyword is a no-op for AJV.
|
|
82
|
-
* The OpenAPI doc path uses a separate `openapi-3.0` target and is unaffected.
|
|
83
|
-
*/
|
|
84
|
-
function schemaIRToJsonSchemaBranch(ir, extras = {}) {
|
|
85
|
-
const mergedProperties = {};
|
|
86
|
-
for (const [key, prop] of Object.entries({
|
|
87
|
-
...extras.properties ?? {},
|
|
88
|
-
...ir.properties
|
|
89
|
-
})) if (typeof prop === "object" && prop !== null && "default" in prop) {
|
|
90
|
-
const { default: _dropped, ...rest } = prop;
|
|
91
|
-
mergedProperties[key] = rest;
|
|
92
|
-
} else mergedProperties[key] = prop;
|
|
93
|
-
return {
|
|
94
|
-
type: "object",
|
|
95
|
-
properties: mergedProperties,
|
|
96
|
-
required: [...extras.required ?? [], ...ir.required.filter((f) => !(extras.required ?? []).includes(f))],
|
|
97
|
-
...ir.additionalProperties !== void 0 ? { additionalProperties: ir.additionalProperties } : {}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Returns `true` when the IR declares `additionalProperties: false`. MCP
|
|
102
|
-
* tool handlers should reject inputs with unknown keys when this is true,
|
|
103
|
-
* matching HTTP's AJV-level strict enforcement.
|
|
104
|
-
*/
|
|
105
|
-
function shouldRejectAdditionalProperties(ir) {
|
|
106
|
-
return ir.additionalProperties === false;
|
|
107
|
-
}
|
|
108
|
-
export { schemaIRToJsonSchemaBranch as n, shouldRejectAdditionalProperties as r, normalizeSchemaIR as t };
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
-
import { n as forwardedStreamHeaders } from "./streaming-Dcgqa-hH.mjs";
|
|
3
|
-
// src/utils/sseStream.ts
|
|
4
|
-
/**
|
|
5
|
-
* Take over the reply socket and open an SSE stream. Call ONLY after every
|
|
6
|
-
* gate (auth, permissions, validation) has passed — after `hijack()` no
|
|
7
|
-
* JSON error can be sent.
|
|
8
|
-
*/
|
|
9
|
-
function openSseStream(request, reply, options = {}) {
|
|
10
|
-
const { heartbeatMs = 3e4, retryMs } = options;
|
|
11
|
-
reply.hijack();
|
|
12
|
-
reply.raw.writeHead(200, {
|
|
13
|
-
"content-type": "text/event-stream",
|
|
14
|
-
"cache-control": "no-cache",
|
|
15
|
-
connection: "keep-alive",
|
|
16
|
-
"x-accel-buffering": "no",
|
|
17
|
-
...forwardedStreamHeaders(reply)
|
|
18
|
-
});
|
|
19
|
-
reply.raw.flushHeaders();
|
|
20
|
-
if (retryMs !== void 0) reply.raw.write(`retry: ${retryMs}\n\n`);
|
|
21
|
-
const cleanups = [];
|
|
22
|
-
let closed = false;
|
|
23
|
-
const close = () => {
|
|
24
|
-
if (closed) return;
|
|
25
|
-
closed = true;
|
|
26
|
-
clearInterval(heartbeatTimer);
|
|
27
|
-
for (const fn of cleanups) try {
|
|
28
|
-
fn();
|
|
29
|
-
} catch {}
|
|
30
|
-
if (!reply.raw.writableEnded) reply.raw.end();
|
|
31
|
-
};
|
|
32
|
-
const destroyOnBackpressure = (context) => {
|
|
33
|
-
request.raw.destroy(/* @__PURE__ */ new Error(`SSE connection terminated: ${context} backpressure`));
|
|
34
|
-
close();
|
|
35
|
-
};
|
|
36
|
-
const heartbeatTimer = setInterval(() => {
|
|
37
|
-
if (closed) return;
|
|
38
|
-
if (!reply.raw.write(": heartbeat\n\n")) destroyOnBackpressure("heartbeat");
|
|
39
|
-
}, heartbeatMs);
|
|
40
|
-
request.raw.on("close", close);
|
|
41
|
-
return {
|
|
42
|
-
write(eventName, data, id) {
|
|
43
|
-
if (closed) return false;
|
|
44
|
-
const idField = id !== void 0 ? `id: ${id}\n` : "";
|
|
45
|
-
if (!reply.raw.write(`${idField}event: ${eventName}\ndata: ${data}\n\n`)) {
|
|
46
|
-
destroyOnBackpressure("slow client");
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
},
|
|
51
|
-
close,
|
|
52
|
-
onCleanup(fn) {
|
|
53
|
-
cleanups.push(fn);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export { openSseStream as t };
|