/**
 * Server-side validation route handler factory.
 *
 * Creates a POST handler that executes validation rules against uploaded
 * documents or plain text using LLM analysis, and returns ClarificationItems
 * for any issues found.
 *
 * Usage:
 *   import { create_validation_route } from 'hazo_collab_forms/lib';
 *   export const POST = create_validation_route();
 *
 * Uses standard Web API Request/Response for portability.
 * hazo_llm_api is dynamically imported so it's only required at runtime.
 */
import 'server-only';
import type { ValidationIssue, ValidationRouteOptions, ValidationFileEntry } from '../types/validation.js';
/**
 * Parse the LLM response into a ValidationRuleResult.
 *
 * Expected shape (per validation/response_wrapper in hazo_prompts):
 *   {
 *     "summary": "...",                    // optional rule-level explanation
 *     "issues": [                          // empty = passed
 *       { "description": "...", "amount": "...", "date": "...", "reason": "...",
 *         "client_comment": "...", "confidence": 0.9 }
 *     ],
 *     "confidence": 0.95                   // optional rule-level confidence
 *   }
 *
 * Tolerates: direct JSON, fenced code block, regex-extracted object, and
 * top-level arrays (treated as the issues array).
 */
export declare function parse_response(text: string, rule_id: string): {
    summary?: string;
    issues: ValidationIssue[];
    confidence?: number;
    extracted_data?: Record<string, unknown>;
};
/**
 * Creates a POST route handler for document validation.
 *
 * The handler:
 * 1. Validates the request payload
 * 2. Fetches the file (inline or from URL)
 * 3. Executes each validation rule against the document via LLM
 * 4. Creates ClarificationItems for rules that find issues
 * 5. Returns the results
 */
export declare function create_validation_route(options?: ValidationRouteOptions): (request: Request) => Promise<Response>;
export type { ValidationFileEntry };
//# sourceMappingURL=validation_handler.d.ts.map