/** * Incremental JSON Schema learning — type union over observed samples. * * Used by the Screen Designer to build `generatedOutputSchema` from real MCP tool * responses when the server doesn't ship a native `outputSchema`. Each captured * response is merged into the running schema via {@link mergeSchema}; the result * converges as more samples arrive. * * Algorithm: * - Object properties: union of keys. A property present in one sample but missing * from another is marked optional (dropped from `required`). * - Array items: recursive merge across element schemas from all samples. * - Primitives of the same type: identity. * - `null` + any type: sets `nullable: true` on that type. * - Type conflicts (e.g. string + number): collapsed into `anyOf`. * * Pure — no I/O, no DB, no clock. Safe to call from Lambda, edge, or tests. */ import type { JsonSchema, JsonValue } from "../types/data-contract.js"; /** Infer a JSON Schema from a single JSON value. */ export declare function inferSchema(value: JsonValue): JsonSchema; /** * Merge a new observed sample into an existing schema. If `existing` is null, * returns the schema inferred from `sample` alone. */ export declare function mergeSchema(existing: JsonSchema | null | undefined, sample: JsonValue): JsonSchema; /** * Merge two schemas into one that accepts values satisfying either. Exported * for the seeder path (combining two known schemas without sampling). */ export declare function mergeTwoSchemas(a: JsonSchema, b: JsonSchema): JsonSchema; //# sourceMappingURL=merge.d.ts.map