export declare const LLM_JSON_PARSER_VERSION = "1.0.0";
export interface LlmJsonSchema<T> {
    name: string;
    validate: (value: unknown) => value is T;
}
declare class LlmJsonError extends Error {
    readonly parserVersion = "1.0.0";
    constructor(message: string);
}
export declare class LlmJsonParseError extends LlmJsonError {
    constructor(message: string);
}
export declare class LlmJsonSchemaError extends LlmJsonError {
    constructor(schemaName: string, message: string);
}
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
export declare function isStringArray(value: unknown): value is string[];
export declare function stripOuterMarkdownCodeFence(text: string): string;
/**
 * Extract the first JSON object/array substring from a (possibly messy) LLM response.
 * Uses a small state machine to handle nested braces/brackets and quoted strings.
 */
export declare function extractFirstJsonValue(text: string): string | null;
export declare function parseLlmJson<T = unknown>(text: string, schema?: LlmJsonSchema<T>): T;
export declare function tryParseLlmJson<T = unknown>(text: string, schema?: LlmJsonSchema<T>): {
    ok: true;
    value: T;
} | {
    ok: false;
    error: Error;
};
export {};
//# sourceMappingURL=llmJson.d.ts.map