import type { PeerRecord, PeerWriteReceipt } from "../pairing/storage.js"; import type { QRSession } from "../pairing/qr.js"; import type { ClientFrame, ServerFrame } from "../protocol/v2/index.js"; import type { RelayClient } from "../transport/relay_client.js"; import { V2PeerChannel, type HostRouteIdentity } from "../transport/peer_channel.js"; type PairRequest = Extract; type PairOk = Extract; export interface PairingBinding { readonly channel: V2PeerChannel; } export interface PairingCoordinatorDependencies { readonly qrSession: QRSession; readonly routeIdentity: () => HostRouteIdentity; readonly isRelayCurrent: (relay: RelayClient) => boolean; readonly attachOwner: (relay: RelayClient, ownerId: string) => PairingBinding | null; readonly activeBinding: (ownerId: string) => PairingBinding | undefined; readonly addPeer: (record: PeerRecord) => Promise; readonly rollbackPeer: (receipt: PeerWriteReceipt) => Promise; readonly updateEndpoint: (relay: RelayClient) => Promise; readonly refreshCurrentEndpoint: () => Promise; readonly buildPairOk: (frame: PairRequest) => PairOk; } /** Coordinates one-process pairing retries across storage and Relay lifecycles. */ export declare class PairingCoordinator { private readonly deps; private readonly attempts; constructor(deps: PairingCoordinatorDependencies); handle(relay: RelayClient, ownerId: string, frame: PairRequest): Promise; abandonInactive(): void; private run; private rollback; private lifecycleIsCurrent; private canCommit; private reject; private sendError; private attemptKey; } export {};