import type { ReceivingIdentity, ReceivingLease } from "./comms-receiving-types.js"; declare const SCHEMA = "humanish.comms-lease-journal.v1"; type PhysicalIdentity = { path: string; dev: number; ino: number; }; type Owner = { pid: number; host: string; token: string; active: boolean; }; export type CommsLeaseState = "planned" | "intent" | "active" | "closing" | "not-created" | "absent" | "deleting" | "unresolved"; export interface CommsLeaseRecord { participantId: string; leaseId: string; clientId: string; ownership: "fresh"; state: CommsLeaseState; lease?: ReceivingLease; } export interface CommsLeaseJournal { schema: typeof SCHEMA; project: PhysicalIdentity; runId: string; incarnation: string; connectionName: string; apiKeyEnv: string; identity: ReceivingIdentity; owner: Owner; state: "active" | "closed" | "unresolved"; createdAt: string; updatedAt: string; leases: CommsLeaseRecord[]; } export interface CommsRecoveryEntry { id: string; runId: string; connectionName: string; status: "active" | "closed" | "unresolved"; participantCount: number; unresolvedCount: number; activeOwner: boolean | null; } export declare class CommsAuthorityError extends Error { readonly code: "authority_unavailable" | "authority_changed" | "owner_active" | "owner_unknown" | "binding_mismatch"; constructor(code: "authority_unavailable" | "authority_changed" | "owner_active" | "owner_unknown" | "binding_mismatch"); } export declare function sameReceivingIdentity(a: ReceivingIdentity, b: ReceivingIdentity): boolean; export declare function validReceivingIdentity(value: unknown): value is ReceivingIdentity; export declare function validReceivingLease(value: unknown, clientId: string): value is ReceivingLease; export declare class CommsLeaseStore { private readonly dir; private readonly name; private readonly lock; private journal; private text; private serial; private released; private constructor(); snapshot(): CommsLeaseJournal; assertOwnership(): Promise; private update; bind(participantId: string, lease: ReceivingLease): Promise; setState(participantId: string, state: CommsLeaseState): Promise; close(): Promise; releaseLock(): Promise; static create(options: { cwd: string; runId: string; connectionName: string; apiKeyEnv: string; identity: ReceivingIdentity; participants: string[]; stateDir?: string; }): Promise; static recover(options: { cwd: string; runId: string; connectionName: string; apiKeyEnv: string; stateDir?: string; }): Promise; } export declare function inspectCommsLeaseStore(options: { cwd: string; stateDir?: string; }): Promise; export {};