import { PersistentStore } from '../../state/persistent-store.js';
import type { DistributedApprovalBridge, DistributedAutomationBridge, DistributedNodeHostContract, DistributedPendingWork, DistributedPeerAuth, DistributedPeerKind, DistributedPeerRecord, DistributedPeerTokenRecord, DistributedRuntimeAuditRecord, DistributedRuntimeManagerState, DistributedRuntimePairRequest, DistributedRuntimeSnapshotStore, DistributedSessionBridge, DistributedWorkPriority, DistributedWorkType, StoredPairRequest, StoredPeerRecord, DistributedRuntimeWaiter } from './distributed-runtime-types.js';
export declare class DistributedRuntimeManager implements DistributedRuntimeManagerState {
    readonly store: PersistentStore<DistributedRuntimeSnapshotStore>;
    readonly pairRequests: Map<string, StoredPairRequest>;
    readonly peers: Map<string, StoredPeerRecord>;
    readonly work: Map<string, DistributedPendingWork>;
    readonly audit: DistributedRuntimeAuditRecord[];
    readonly waiters: Map<string, DistributedRuntimeWaiter[]>;
    sessionBridge: DistributedSessionBridge | null;
    approvalBridge: DistributedApprovalBridge | null;
    automationBridge: DistributedAutomationBridge | null;
    eventPublisher: ((event: string, payload: unknown) => void) | null;
    loaded: boolean;
    constructor(storeOrPath: PersistentStore<DistributedRuntimeSnapshotStore> | string);
    attachRuntime(input: {
        readonly sessionBridge?: DistributedSessionBridge | null | undefined;
        readonly approvalBridge?: DistributedApprovalBridge | null | undefined;
        readonly automationBridge?: DistributedAutomationBridge | null | undefined;
        readonly eventPublisher?: ((event: string, payload: unknown) => void) | null | undefined;
    }): void;
    start(): Promise<void>;
    listPairRequests(limit?: number): DistributedRuntimePairRequest[];
    listPeers(kind?: DistributedPeerKind, limit?: number): DistributedPeerRecord[];
    listWork(limit?: number, peerId?: string): DistributedPendingWork[];
    listAudit(limit?: number): DistributedRuntimeAuditRecord[];
    getSnapshot(): Record<string, unknown>;
    getNodeHostContract(): DistributedNodeHostContract;
    requestPairing(input: {
        readonly peerKind: DistributedPeerKind;
        readonly requestedId?: string | undefined;
        readonly label: string;
        readonly platform?: string | undefined;
        readonly deviceFamily?: string | undefined;
        readonly version?: string | undefined;
        readonly clientMode?: string | undefined;
        readonly capabilities?: readonly string[] | undefined;
        readonly commands?: readonly string[] | undefined;
        readonly metadata?: Record<string, unknown> | undefined;
        readonly requestedBy?: 'remote' | 'operator' | undefined;
        readonly remoteAddress?: string | undefined;
        readonly ttlMs?: number | undefined;
    }): Promise<{
        request: DistributedRuntimePairRequest;
        challenge: string;
    }>;
    approvePairRequest(requestId: string, input?: {
        readonly actor?: string | undefined;
        readonly note?: string | undefined;
        readonly label?: string | undefined;
        readonly metadata?: Record<string, unknown> | undefined;
    }): Promise<{
        request: DistributedRuntimePairRequest;
        peer: DistributedPeerRecord;
    } | null>;
    rejectPairRequest(requestId: string, input?: {
        readonly actor?: string | undefined;
        readonly note?: string | undefined;
    }): Promise<DistributedRuntimePairRequest | null>;
    verifyPairRequest(requestId: string, challenge: string, input?: {
        readonly remoteAddress?: string | undefined;
        readonly metadata?: Record<string, unknown> | undefined;
    }): Promise<{
        peer: DistributedPeerRecord;
        token: DistributedPeerTokenRecord & {
            value: string;
        };
    } | null>;
    rotatePeerToken(peerId: string, input?: {
        readonly actor?: string | undefined;
        readonly label?: string | undefined;
        readonly scopes?: readonly string[] | undefined;
    }): Promise<{
        peer: DistributedPeerRecord;
        token: DistributedPeerTokenRecord & {
            value: string;
        };
    } | null>;
    revokePeerToken(peerId: string, input?: {
        readonly actor?: string | undefined;
        readonly tokenId?: string | undefined;
        readonly note?: string | undefined;
    }): Promise<DistributedPeerRecord | null>;
    disconnectPeer(peerId: string, input?: {
        readonly actor?: string | undefined;
        readonly note?: string | undefined;
        readonly requeueClaimedWork?: boolean | undefined;
    }): Promise<DistributedPeerRecord | null>;
    enqueueWork(input: {
        readonly peerId: string;
        readonly type?: DistributedWorkType | undefined;
        readonly command: string;
        readonly payload?: unknown | undefined;
        readonly priority?: DistributedWorkPriority | undefined;
        readonly actor?: string | undefined;
        readonly timeoutMs?: number | undefined;
        readonly sessionId?: string | undefined;
        readonly routeId?: string | undefined;
        readonly automationRunId?: string | undefined;
        readonly automationJobId?: string | undefined;
        readonly approvalId?: string | undefined;
        readonly metadata?: Record<string, unknown> | undefined;
    }): Promise<DistributedPendingWork>;
    invokePeer(input: {
        readonly peerId: string;
        readonly command: string;
        readonly payload?: unknown | undefined;
        readonly priority?: DistributedWorkPriority | undefined;
        readonly actor?: string | undefined;
        readonly waitMs?: number | undefined;
        readonly timeoutMs?: number | undefined;
        readonly sessionId?: string | undefined;
        readonly routeId?: string | undefined;
        readonly automationRunId?: string | undefined;
        readonly automationJobId?: string | undefined;
        readonly approvalId?: string | undefined;
        readonly metadata?: Record<string, unknown> | undefined;
    }): Promise<{
        work: DistributedPendingWork;
        completed: boolean;
    }>;
    authenticatePeerToken(tokenValue: string, remoteAddress?: string): Promise<DistributedPeerAuth | null>;
    heartbeatPeer(auth: DistributedPeerAuth, input?: {
        readonly remoteAddress?: string | undefined;
        readonly capabilities?: readonly string[] | undefined;
        readonly commands?: readonly string[] | undefined;
        readonly version?: string | undefined;
        readonly clientMode?: string | undefined;
        readonly metadata?: Record<string, unknown> | undefined;
    }): Promise<DistributedPeerRecord>;
    claimWork(auth: DistributedPeerAuth, input?: {
        readonly maxItems?: number | undefined;
        readonly leaseMs?: number | undefined;
    }): Promise<DistributedPendingWork[]>;
    completeWork(auth: DistributedPeerAuth, workId: string, input?: {
        readonly status?: 'completed' | 'failed' | 'cancelled' | undefined;
        readonly result?: unknown | undefined;
        readonly error?: string | undefined;
        readonly telemetry?: DistributedPendingWork['telemetry'] | undefined;
        readonly metadata?: Record<string, unknown> | undefined;
    }): Promise<DistributedPendingWork | null>;
    cancelWork(workId: string, input?: {
        readonly actor?: string | undefined;
        readonly reason?: string | undefined;
    }): Promise<DistributedPendingWork | null>;
}
//# sourceMappingURL=distributed-runtime-manager.d.ts.map