/** * Output schema contracts (`expect`) — a zero-dependency structural validator. * * A phase may declare `expect`: a small JSON-Schema-like contract its parsed * JSON output must satisfy. The runtime validates the output the moment the * subagent finishes; a violation fails the phase with a precise diagnostic * (eligible for the phase's explicit `retry` policy) instead of letting a * mis-shaped output propagate downstream and break interpolation silently. * * Supported contract surface (deliberately small, statically checkable): * type: "object" | "array" | "string" | "number" | "integer" | "boolean" | "null" * properties: { key: } (object) * required: ["key", …] (object) * items: (array) * enum: [literal, …] (any) */ export interface OutputContract { type?: "object" | "array" | "string" | "number" | "integer" | "boolean" | "null"; properties?: Record; required?: string[]; items?: OutputContract; enum?: unknown[]; } /** Max violations reported per validation (diagnostics stay readable). */ export declare const CONTRACT_MAX_VIOLATIONS = 8; /** * Statically check that an author-written `expect` value is a well-formed * contract. Returns human-readable shape errors ([] = valid). Total: never * throws on arbitrary JSON-valid input. */ export declare function contractShapeErrors(schema: unknown, path?: string): string[]; /** * Validate a parsed JSON value against a contract. Returns violation messages * with JSON-path-ish locations ([] = the value satisfies the contract). Total: * a malformed contract never throws — unknown constructs are skipped (the * shape is validated separately at flow-validation time). */ export declare function contractViolations(value: unknown, schema: unknown, path?: string): string[]; //# sourceMappingURL=contract.d.ts.map