import Database from "better-sqlite3";
import type { PolicyTraceRecord, PolicyTraceRecordInput } from "../policy.js";
export declare const POLICY_TRACES_JSONL_REL = ".workspace-kit/policy/traces.jsonl";
export declare const POLICY_TRACES_MIGRATED_SUFFIX = ".migrated";
export type PolicyTraceRow = PolicyTraceRecord & {
    id: number;
};
export declare function openKitPolicyTraceDatabase(workspacePath: string, effectiveConfig?: Record<string, unknown>): Database.Database;
/** Import legacy traces.jsonl once when the table is empty. */
export declare function importPolicyTracesJsonlIfNeeded(db: Database.Database, workspacePath: string): number;
export declare function appendPolicyTraceRow(db: Database.Database, record: PolicyTraceRecordInput): number;
export declare function listPolicyTracesAfterId(db: Database.Database, afterId: number): PolicyTraceRow[];
/** Map legacy line cursor (lines already ingested) to the last ingested trace row id. */
export declare function resolvePolicyTraceIdFromLineCursor(workspacePath: string, lineCursor: number, effectiveConfig?: Record<string, unknown>): number;
export declare function readPolicyTracesAfterId(workspacePath: string, afterId: number, effectiveConfig?: Record<string, unknown>): PolicyTraceRow[];
