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;
        readonly approvalBridge?: DistributedApprovalBridge | null;
        readonly automationBridge?: DistributedAutomationBridge | null;
        readonly eventPublisher?: ((event: string, payload: unknown) => void) | null;
    }): 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;
        readonly label: string;
        readonly platform?: string;
        readonly deviceFamily?: string;
        readonly version?: string;
        readonly clientMode?: string;
        readonly capabilities?: readonly string[];
        readonly commands?: readonly string[];
        readonly metadata?: Record<string, unknown>;
        readonly requestedBy?: 'remote' | 'operator';
        readonly remoteAddress?: string;
        readonly ttlMs?: number;
    }): Promise<{
        request: DistributedRuntimePairRequest;
        challenge: string;
    }>;
    approvePairRequest(requestId: string, input?: {
        readonly actor?: string;
        readonly note?: string;
        readonly label?: string;
        readonly metadata?: Record<string, unknown>;
    }): Promise<{
        request: DistributedRuntimePairRequest;
        peer: DistributedPeerRecord;
    } | null>;
    rejectPairRequest(requestId: string, input?: {
        readonly actor?: string;
        readonly note?: string;
    }): Promise<DistributedRuntimePairRequest | null>;
    verifyPairRequest(requestId: string, challenge: string, input?: {
        readonly remoteAddress?: string;
        readonly metadata?: Record<string, unknown>;
    }): Promise<{
        peer: DistributedPeerRecord;
        token: DistributedPeerTokenRecord & {
            value: string;
        };
    } | null>;
    rotatePeerToken(peerId: string, input?: {
        readonly actor?: string;
        readonly label?: string;
        readonly scopes?: readonly string[];
    }): Promise<{
        peer: DistributedPeerRecord;
        token: DistributedPeerTokenRecord & {
            value: string;
        };
    } | null>;
    revokePeerToken(peerId: string, input?: {
        readonly actor?: string;
        readonly tokenId?: string;
        readonly note?: string;
    }): Promise<DistributedPeerRecord | null>;
    disconnectPeer(peerId: string, input?: {
        readonly actor?: string;
        readonly note?: string;
        readonly requeueClaimedWork?: boolean;
    }): Promise<DistributedPeerRecord | null>;
    enqueueWork(input: {
        readonly peerId: string;
        readonly type?: DistributedWorkType;
        readonly command: string;
        readonly payload?: unknown;
        readonly priority?: DistributedWorkPriority;
        readonly actor?: string;
        readonly timeoutMs?: number;
        readonly sessionId?: string;
        readonly routeId?: string;
        readonly automationRunId?: string;
        readonly automationJobId?: string;
        readonly approvalId?: string;
        readonly metadata?: Record<string, unknown>;
    }): Promise<DistributedPendingWork>;
    invokePeer(input: {
        readonly peerId: string;
        readonly command: string;
        readonly payload?: unknown;
        readonly priority?: DistributedWorkPriority;
        readonly actor?: string;
        readonly waitMs?: number;
        readonly timeoutMs?: number;
        readonly sessionId?: string;
        readonly routeId?: string;
        readonly automationRunId?: string;
        readonly automationJobId?: string;
        readonly approvalId?: string;
        readonly metadata?: Record<string, unknown>;
    }): Promise<{
        work: DistributedPendingWork;
        completed: boolean;
    }>;
    authenticatePeerToken(tokenValue: string, remoteAddress?: string): Promise<DistributedPeerAuth | null>;
    heartbeatPeer(auth: DistributedPeerAuth, input?: {
        readonly remoteAddress?: string;
        readonly capabilities?: readonly string[];
        readonly commands?: readonly string[];
        readonly version?: string;
        readonly clientMode?: string;
        readonly metadata?: Record<string, unknown>;
    }): Promise<DistributedPeerRecord>;
    claimWork(auth: DistributedPeerAuth, input?: {
        readonly maxItems?: number;
        readonly leaseMs?: number;
    }): Promise<DistributedPendingWork[]>;
    completeWork(auth: DistributedPeerAuth, workId: string, input?: {
        readonly status?: 'completed' | 'failed' | 'cancelled';
        readonly result?: unknown;
        readonly error?: string;
        readonly telemetry?: DistributedPendingWork['telemetry'];
        readonly metadata?: Record<string, unknown>;
    }): Promise<DistributedPendingWork | null>;
    cancelWork(workId: string, input?: {
        readonly actor?: string;
        readonly reason?: string;
    }): Promise<DistributedPendingWork | null>;
}
//# sourceMappingURL=distributed-runtime-manager.d.ts.map