import type { DatabaseAdapter } from "../db.js";
/**
 * Cursor does not store chat sessions as JSON/JSONL files like the other clients. Instead each
 * root (global storage, and each workspace storage folder) contains a single SQLite file named
 * literally `state.vscdb`, with a generic key/value table `cursorDiskKV` (key TEXT PRIMARY KEY,
 * value TEXT holding JSON). Sessions live under `composerData:<composerId>` keys and individual
 * messages under `bubbleId:<composerId>:<bubbleId>` keys.
 *
 * IMPORTANT: this shape is reverse-engineered from public community sources, not an official
 * Cursor API/schema. It is known to have shifted across Cursor releases in the past and may shift
 * again. Every read in this file must degrade gracefully (skip the row/file, emit a warning) when
 * a field is missing or has an unexpected type -- never throw on unexpected shapes.
 *
 * Token usage does not appear to be available from this local storage, so `token_available`
 * always reports 0/false for Cursor sessions and messages, the same way other adapters behave
 * when their source has no usable token counters.
 *
 * We intentionally do not reuse `SqliteAdapter` from ../db.ts here: that class always opens its
 * database read-write (and db.ts is out of scope for this change), whereas the Cursor `state.vscdb`
 * file may be open live in the running Cursor app, so we need `sqlite3.OPEN_READONLY` to avoid
 * corrupting it or failing to open it due to an exclusive lock. This is the same `sqlite3` package
 * dependency and callback-to-promise wrapping style used by db.ts, just opened in read-only mode.
 */
interface ImportCounters {
    sessions_upserted: number;
    messages_upserted: number;
    runtime_events_upserted: number;
}
interface WarningEntry {
    code: string;
    message_code: string;
    severity: "info" | "warning" | "error";
    source_file_id?: string;
    details?: Record<string, number | string | boolean>;
}
export declare function importCursorFile(context: {
    db: DatabaseAdapter;
    sourceFileId: string;
    machineId: string;
    hmacSalt: string;
}, absolutePath: string): Promise<{
    counters: ImportCounters;
    warnings: WarningEntry[];
}>;
export {};
