import type { PortableTool } from "../portable-tool.js";
export declare const STRUCTURED_OUTPUT_TOOL_NAME: "structured_output";
/** Maximum content size for structured output results. */
export declare const STRUCTURED_OUTPUT_MAX_CHARS = 100000;
export interface StructuredOutputToolParams {
    /** The structured data to return. Must conform to the session's output schema. */
    data: Record<string, unknown>;
}
/**
 * Base schema — accepts any object.
 * When used with createConfiguredStructuredOutputTool, the host overrides
 * this with the actual JSON Schema from `response_format.json_schema`.
 */
export declare const STRUCTURED_OUTPUT_TOOL_SCHEMA: {
    readonly type: "object";
    readonly properties: {
        readonly data: {
            readonly type: "object";
            readonly description: string;
            readonly additionalProperties: true;
        };
    };
    readonly required: readonly ["data"];
};
/** Schema validation error detail. */
export interface SchemaValidationError {
    path: string;
    message: string;
    keyword?: string;
}
/** Result of structured output validation. */
export interface StructuredOutputResult {
    valid: boolean;
    errors?: SchemaValidationError[];
}
/**
 * Whether the structured output tool should be enabled for this session.
 * CC equivalent: `isSyntheticOutputToolEnabled`.
 */
export declare function isStructuredOutputEnabled(opts: {
    isNonInteractiveSession: boolean;
}): boolean;
/**
 * Runtime dependencies injected by the host.
 *
 * The host provides:
 * 1. The JSON Schema to validate against (from session config)
 * 2. A validator function (host may use Ajv, Zod, or any validator)
 * 3. An output sink to deliver the validated data
 *
 * The tool is only available in non-interactive (SDK/API) sessions
 * where a `response_format.json_schema` has been specified.
 */
export interface StructuredOutputToolDeps {
    /**
     * Get the JSON Schema that the output must conform to.
     * Returns undefined if no schema is configured (tool should not be registered).
     */
    getOutputSchema(): Record<string, unknown> | undefined;
    /**
     * Validate data against the output schema.
     * Returns { valid: true } or { valid: false, errors: [...] }.
     */
    validateOutput(data: Record<string, unknown>): StructuredOutputResult;
    /**
     * Deliver the validated output to the caller.
     * Called only after successful validation.
     */
    deliverOutput(data: Record<string, unknown>): Promise<void>;
}
/**
 * Create the base structured output tool with DI-based validation.
 * This is the standard factory for runtime integration.
 */
export declare function createStructuredOutputTool(deps: StructuredOutputToolDeps): PortableTool<StructuredOutputToolParams>;
/**
 * Result of creating a configured structured output tool.
 * Success: { tool } — ready-to-use tool with compiled schema.
 * Failure: { error } — schema was invalid.
 */
export type ConfiguredToolResult = {
    tool: PortableTool<StructuredOutputToolParams>;
} | {
    error: string;
};
/**
 * Host-provided schema compilation interface.
 * Allows the host to use any validator (Ajv, Zod, custom).
 */
export interface SchemaCompiler {
    /**
     * Validate that the schema itself is a valid JSON Schema.
     * Returns null if valid, or an error message string if invalid.
     */
    validateSchema(schema: Record<string, unknown>): string | null;
    /**
     * Compile the schema into a reusable validator function.
     * Returns a function that validates data and returns StructuredOutputResult.
     */
    compile(schema: Record<string, unknown>): (data: Record<string, unknown>) => StructuredOutputResult;
}
/**
 * Create a StructuredOutputTool configured with a specific JSON Schema.
 * Mirrors CC's `createSyntheticOutputTool(jsonSchema)`.
 *
 * Features:
 * - Validates the schema itself at creation time
 * - Compiles the validator for reuse (cached via WeakMap)
 * - Overrides the tool's `parameters` with the provided schema (dynamic input)
 * - Returns { tool } on success or { error } if schema is invalid
 *
 * @param jsonSchema  The JSON Schema to validate output against.
 * @param compiler    Schema compiler/validator provided by the host.
 * @param deliver     Output delivery function (called after successful validation).
 */
export declare function createConfiguredStructuredOutputTool(jsonSchema: Record<string, unknown>, compiler: SchemaCompiler, deliver: (data: Record<string, unknown>) => Promise<void>): ConfiguredToolResult;
