import type { DatabaseAdapter } from "../db.js";
import { type FileImportWarning } from "./file-import-contract.js";
/**
 * Cursor keeps no token usage in its local storage (bubble `tokenCount` fields are always zero),
 * but the Cursor dashboard exports per-request usage events as CSV ("Usage" -> export). An export
 * dropped in `<analytics dir>/imports/cursor/*.csv` is imported as telemetry rows:
 * - input_tokens = "Input (w/o Cache Write)", cache_write_tokens = "Input (w/ Cache Write)",
 *   cache_read_tokens = "Cache Read", output_tokens = "Output Tokens";
 * - each event is attached to the local Cursor session whose message is closest in time (events
 *   are written 1-3 s after the local bubble); events without a local conversation go to one
 *   technical `task` session per export file, so their tokens are still counted;
 * - rows are keyed by the event values, so overlapping exports never count an event twice.
 * Only technical columns are read: the user column is used solely to refuse multi-user team
 * exports and is never stored; cost, repository, PR and agent identifiers are ignored.
 */
interface ImportContext {
    db: DatabaseAdapter;
    sourceFileId: string;
    machineId: string;
    hmacSalt: string;
}
interface ImportCounters {
    sessions_upserted: number;
    messages_upserted: number;
    runtime_events_upserted: number;
}
/** Minimal RFC 4180 parser: quoted fields, escaped quotes, commas and newlines inside quotes. */
export declare function parseCsv(raw: string): string[][];
export declare function isCursorUsageExportPath(fullPath: string): boolean;
export declare function importCursorUsageExport(context: ImportContext, absolutePath: string): Promise<{
    counters: ImportCounters;
    warnings: FileImportWarning[];
}>;
export {};
