/**
 * Playbook Operations for DatabaseService
 *
 * Provides CRUD operations for the playbooks table and clause comparison.
 * Playbooks define preferred contract terms for deviation detection.
 *
 * @module database/playbook-operations
 */
import type Database from 'better-sqlite3';
import type { ContractClause } from '../../clm/contract-schemas.js';
export type { ContractClause };
export interface Playbook {
    id: string;
    name: string;
    description: string | null;
    clauses_json: string;
    created_at: string;
    updated_at: string;
    created_by: string | null;
}
export interface PlaybookWithClauses extends Omit<Playbook, 'clauses_json'> {
    clauses: ContractClause[];
}
export interface ClauseComparisonResult {
    clause_name: string;
    severity: 'critical' | 'major' | 'minor';
    status: 'match' | 'alternative_match' | 'deviation' | 'missing';
    preferred_text: string;
    matched_text: string | null;
    matched_chunk_id: string | null;
    matched_page: number | null;
    details: string;
}
export interface PlaybookComparisonResult {
    playbook_id: string;
    playbook_name: string;
    document_id: string;
    total_clauses: number;
    matches: number;
    alternative_matches: number;
    deviations: number;
    missing: number;
    compliance_score: number;
    clause_results: ClauseComparisonResult[];
}
/**
 * Create a new playbook with clauses
 */
export declare function createPlaybook(db: Database.Database, params: {
    name: string;
    description?: string | null;
    clauses: ContractClause[];
    created_by?: string | null;
}): PlaybookWithClauses;
/**
 * Get a playbook by ID
 * @throws Error if not found
 */
export declare function getPlaybook(db: Database.Database, id: string): PlaybookWithClauses;
/**
 * List all playbooks
 */
export declare function listPlaybooks(db: Database.Database): PlaybookWithClauses[];
/**
 * Compare document text against a playbook's clauses.
 *
 * For each clause in the playbook, searches the document's chunks for matching
 * content using simple text matching (case-insensitive indexOf). Returns
 * deviations where neither preferred text nor alternatives are found.
 */
export declare function compareWithPlaybook(db: Database.Database, documentId: string, playbookId: string): PlaybookComparisonResult;
//# sourceMappingURL=playbook-operations.d.ts.map