/**
 * Shared utilities for JSON Schema providers (OpenAI, Anthropic, Gemini).
 *
 * Contains constants, types, convert output pipeline, definition pooling,
 * and schema inspection helpers used identically across providers.
 */
import type { JTDSchemaJson, SignalDescriptorJson, SignalFormatJson } from './api';
export declare const MAX_REF_DEPTH = 32;
export declare const INTEGER_BOUNDS: Record<string, {
    minimum: number;
    maximum: number;
}>;
export declare const FLOAT32_BOUNDS: {
    minimum: number;
    maximum: number;
};
export declare const UNSTRUCTURED_DESC: string;
export declare const UNSTRUCTURED_VARIANT_DESC: string;
export declare const VALUES_ARRAY_DESC: string;
export declare function nullableType(baseType: string, nullable: boolean): string | string[];
export declare function deepEqual(a: unknown, b: unknown): boolean;
export declare function isUnstructuredSchema(schema: JTDSchemaJson): boolean;
export declare function isRootUnstructured(schema: JTDSchemaJson, defs: Record<string, JTDSchemaJson> | undefined): boolean;
export interface ConvertSuccessJson {
    success: true;
    kind: 'json';
    data: unknown;
}
export interface ConvertSuccessBinary {
    success: true;
    kind: 'binary';
    mimeType: string;
    data: Uint8Array;
    filename?: string;
}
export interface ConvertSuccessSignals {
    success: true;
    kind: 'signals';
    signals: Record<string, unknown>;
}
export interface ConvertFailure {
    success: false;
    errors: string[];
}
export type ConvertSuccess = ConvertSuccessJson | ConvertSuccessBinary | ConvertSuccessSignals;
export type ConvertResult = ConvertSuccess | ConvertFailure;
export declare function convertJTDOutput(jtdSchema: JTDSchemaJson, json: unknown, coerce: (value: unknown, schema: JTDSchemaJson, defs: Record<string, JTDSchemaJson> | undefined, depth: number) => unknown): ConvertResult;
export declare function convertMimeOutput(mimeType: string, json: unknown): ConvertResult;
export declare function convertSingleFormatOutput(fmt: SignalFormatJson, json: unknown, coerce: (value: unknown, schema: JTDSchemaJson, defs: Record<string, JTDSchemaJson> | undefined, depth: number) => unknown): ConvertResult;
export declare function convertSignalOutput(descriptor: SignalDescriptorJson, json: unknown, coerce: (value: unknown, schema: JTDSchemaJson, defs: Record<string, JTDSchemaJson> | undefined, depth: number) => unknown): ConvertResult;
export declare function convertSignalsOutput(descriptors: SignalDescriptorJson[], json: unknown, coerce: (value: unknown, schema: JTDSchemaJson, defs: Record<string, JTDSchemaJson> | undefined, depth: number) => unknown): ConvertResult;
/** Minimal shape for $ref-bearing schemas (satisfied by OpenAISchema and AnthropicSchema). */
interface RefNode {
    properties?: Record<string, RefNode>;
    items?: RefNode;
    anyOf?: RefNode[];
    $defs?: Record<string, RefNode>;
    $ref?: string;
}
export declare function walkSchema<T extends RefNode>(schema: T, fn: (node: T) => void): void;
/**
 * Pre-scan all signal descriptors, pool their JTD definitions.
 * Deduplicates identical definition SETS; renames conflicts with `_N` suffix.
 *
 * Equivalence is checked per-format: all definitions within a single format's
 * `definitions` block are treated as a unit. Two formats with the same set of
 * definition names and identical schemas (deep-equal) share their defs.
 * If ANY definition name conflicts (same name, different schema), ALL defs
 * from that format get their own namespace to preserve internal cross-references.
 *
 * Returns the merged JTD definitions and signal copies with:
 * - refs rewritten to match merged names
 * - definitions stripped (they live in the merged pool now)
 */
export declare function poolSignalDefinitions(signals: SignalDescriptorJson[]): {
    mergedDefs: Record<string, JTDSchemaJson>;
    signalsCopy: SignalDescriptorJson[];
};
/**
 * Build a human-readable description of a JTD definition for use as a
 * fallback at recursive ref break points. Used by both Anthropic and Gemini
 * converters when a cycle is detected.
 */
export declare function describeDefinitionForCycle(defName: string, def: JTDSchemaJson): string;
export {};
//# sourceMappingURL=schema-utils.d.ts.map