import type { CodexBridgeEvent } from './codex-transcript.js';
/** Default `~/.cursor/projects` root. Overridable by callers (tests) so the
 *  scan doesn't depend on a real home directory. */
export declare function cursorProjectsRoot(): string;
/** Extract the chatId encoded in a Cursor store.db path of the shape
 *  `.../.cursor/chats/<projectHash>/<chatId>/store.db` (also matches the
 *  `-wal` / `-shm` sidecar files SQLite keeps open). The chatId is the same
 *  UUID used to name the agent-transcript JSONL, so it's the bridge between
 *  the open fd and the transcript file. Returns undefined for non-matching
 *  paths. */
export declare function cursorChatIdFromStoreDbPath(path: string): string | undefined;
/** Find the chatId of an externally-running cursor-agent process by reading
 *  the store.db file it keeps open. cursor-agent holds an fd on its current
 *  chat's SQLite store for the whole session lifetime, which makes this the
 *  authoritative pid→chatId binding — far more reliable than scanning chat
 *  dirs by mtime (which would race with sibling cursor-agent panes).
 *
 *  Linux: `/proc/<pid>/fd/*` fast path. macOS / BSD: `lsof -p <pid> -Fn`
 *  fallback (same shape as codex-transcript.findCodexRolloutByPid). */
export declare function findCursorChatIdByPid(pid: number): string | undefined;
/** Locate the agent-transcript JSONL for a given chatId. The chatId is a
 *  globally-unique UUID, so a one-shot scan of the (small) projects root for
 *  `<slug>/agent-transcripts/<chatId>/<chatId>.jsonl` is unambiguous and
 *  avoids having to reproduce Cursor's opaque cwd→slug hashing. */
export declare function findCursorTranscriptByChatId(chatId: string, projectsRoot?: string): string | undefined;
/** Resolve the transcript path for an externally-running cursor-agent pid:
 *  pid → open store.db → chatId → agent-transcript JSONL. Returns both the
 *  path and the chatId so the caller can remember the chatId for a later
 *  retry if the JSONL isn't on disk yet. */
export declare function findCursorTranscriptByPid(pid: number, projectsRoot?: string): {
    path: string;
    chatId: string;
} | undefined;
export interface CursorDrainResult {
    events: CodexBridgeEvent[];
    /** Byte offset of the last fully-parsed line + its trailing \n. The next
     *  drain should pass this back as fromOffset. */
    newOffset: number;
    /** A line written without its terminating \n yet — informational; only
     *  complete lines produce events. */
    pendingTail: string;
}
/** Increment-read the transcript from `fromOffset`. Mirrors the byte-offset
 *  contract of codex-transcript.drainCodexRollout so the worker can reuse the
 *  same fs.watch / poll wakeup machinery and the shared CodexBridgeQueue. */
export declare function drainCursorTranscript(path: string, fromOffset: number): CursorDrainResult;
//# sourceMappingURL=cursor-transcript.d.ts.map