import type { DatabaseSync } from 'node:sqlite'; import type { TeamCodexEvent, TeamCodexTask } from './team-codex-contract.js'; export interface CloudEvent { event_id: string; version: number; turn_id: string; turn_seq: number; kind: TeamCodexEvent['kind']; text: string; at: number; truncated: boolean; } export interface CloudTask { task_id: string; version: number; project_key: string; project_name: string; task_title: string; branch: string; events: CloudEvent[]; } export interface CloudBatch extends Record { expected_owner_ref: string; team_ref: string; source_id: string; source_name: string; tasks: CloudTask[]; } interface Source { id: string; owner: number; local_team: string; local_source: string; team: string; name: string; } export declare const DEFAULT_CODEX_SOURCE_NAME = "\u672C\u673A Codex"; export declare function validCodexSourceName(value: unknown): value is string; export declare function clipUtf8(text: string, limit: number): string; /** Durable identity/version/ACK ledger. No credentials, queue snapshots, paths or tool logs. */ export declare class TeamCodexCloudJournal { private readonly db; private previousSource; constructor(db: DatabaseSync); source(owner: number, localTeam: string, team: string, localSource: string, sourceName?: string): Source; confirmationDue(source: string, now: number): boolean; confirmSource(source: string, now: number): void; failConfirmation(source: string, now: number, blocked: string): void; retryConfirmations(owner: number, localTeam: string): void; mapping(owner: number, team: string, localId: string): { taskId: string; sourceId: string; sourceName: string; } | undefined; forget(owner: number, team: string, localId: string): void; reconcile(owner: number, localTeam: string, team: string, tasks: readonly TeamCodexTask[], events: (task: TeamCodexTask) => TeamCodexEvent[], sourceName?: string): void; private rows; counts(owner: number, team: string, eligible: ReadonlySet): { pending: number; blocked: number; }; batch(owner: number, localTeam: string, eligible: ReadonlySet): CloudBatch | undefined; acknowledge(batch: CloudBatch, data: unknown): void; } export {}; //# sourceMappingURL=team-codex-cloud-journal.d.ts.map