/** * A deliberately tiny JSON Schema validator — just the subset used by * schemas/openlore-manifest-v1.json. Avoids pulling in Ajv (a large dep) for a * single internal schema, per spec-05's acceptance criteria. * * It is no longer single-purpose: `tool-guard.ts` runs every inbound MCP tool * call's arguments through it on BOTH transports, and those arguments come from a * model that may be under an attacker's influence. A keyword this file ignores is * therefore a bound the whole tool surface only *advertises* — a `maxLength: 4096` * that nothing enforces. So the size/shape keywords the tool schemas actually * declare are implemented here, and `SUPPORTED_SCHEMA_KEYWORDS` is exported so a * CI guard can fail the build if a schema ever declares one this file does not * enforce (see schema-validator.test.ts). * * Supported keywords: type (string or array incl. "null"), const, enum, * required, dependentRequired, properties, additionalProperties (false, or a * subschema applied to the remaining properties), items, oneOf, minLength, * maxLength, minimum, maximum, minItems, maxItems, maxProperties. The * `integer` type is distinguished from `number`. */ export interface ValidationError { path: string; message: string; } type JsonSchema = Record; /** * Every keyword `validateNode` acts on, plus the pure annotations it may safely * ignore. A keyword absent from BOTH lists is one a schema can declare and this * validator will silently drop — which is exactly the failure the CI guard exists * to prevent, so keep the lists in step with the code below. */ export declare const SUPPORTED_SCHEMA_KEYWORDS: readonly string[]; /** Keywords that carry no constraint: ignoring them enforces nothing away. */ export declare const ANNOTATION_SCHEMA_KEYWORDS: readonly string[]; /** Validate a parsed JSON value against a parsed JSON Schema. */ export declare function validateAgainstSchema(value: unknown, schema: JsonSchema): ValidationError[]; export {}; //# sourceMappingURL=schema-validator.d.ts.map