export interface CocoBridgeEvent {
    /** Synthetic uuid for dedup: `<absPath>:<byteOffset>` of the line start. */
    uuid: string;
    /** Wall-clock ms parsed from `created_at`, falling back to Date.now(). */
    timestampMs: number;
    /** 'user' starts a pending Lark turn; 'assistant_final' closes it. */
    kind: 'user' | 'assistant_final';
    /** Message text. */
    text: string;
}
export interface CocoDrainResult {
    events: CocoBridgeEvent[];
    newOffset: number;
    pendingTail: string;
}
export declare function cocoEventsPathForSession(sessionId: string): string;
/** Find which CoCo session a running CoCo process is bound to by scanning
 *  its open file handles. Unlike Codex (which keeps its rollout fd open
 *  continuously), CoCo opens-writes-closes `events.jsonl` per event, so we
 *  look for ANY open file under the session dir — `session.log` and
 *  `traces.jsonl` are held open for the session's lifetime and reveal the
 *  same `<sid>` segment.
 *
 *  Linux: `/proc/<pid>/fd` 快路径，procfs 会把 unlinked-but-open 的 fd 标
 *  ` (deleted)`，跳过它们以免读到失效 inode（曾被 e2e 清理触发）。
 *  macOS / BSD: `lsof -p <pid> -Fn` 兜底。macOS 上 lsof 不给 deleted 标记，
 *  但 worker 端在 `codexBridgeAttach` 之前还有 `existsSync(sessionDir)` 的
 *  二次校验，所以这里不会让一个失效 sid 跑死循环。 */
export declare function findCocoSessionByPid(pid: number): {
    sessionId: string;
    eventsPath: string;
} | undefined;
/** Increment-read a CoCo events.jsonl from `fromOffset`. */
export declare function drainCocoEvents(path: string, fromOffset: number): CocoDrainResult;
//# sourceMappingURL=coco-transcript.d.ts.map