import { type Socket } from "socket.io-client";
import type { ClientToServerEvents, GuestAgentMessagePayload, McpRuntimeStatus, PeerConfigPayload, PeerHelloPayload, ServerToClientEvents, SessionGetSkillsAck, SourceMessagePayload, SourceRuntimeStatus, ToolCallRequestPayload } from "../../hub/index.js";
import type { PeerAppState } from "../state/peer-app-state.js";
import type { PeerUiState } from "../state/peer-ui-state.js";
export interface SocketPeerClientOptions {
    hubUrl: string;
    hello: PeerHelloPayload;
    appState: PeerAppState;
    uiState: PeerUiState;
    reconnectDelayMs?: number;
    handshakeStageTimeoutMs?: number;
    onHandshakeLog?: (message: string) => void;
    reconnection?: boolean;
    onToolCallRequest?: (payload: ToolCallRequestPayload, socket: Socket<ServerToClientEvents, ClientToServerEvents>) => Promise<void> | void;
    onGuestAgentMessage?: (payload: GuestAgentMessagePayload) => Promise<void> | void;
}
export declare class SocketPeerClient {
    private readonly options;
    private socket;
    private manualDisconnect;
    /** Deduplicate concurrent REST image fetches per `imageId` until the response returns. */
    private readonly inFlightImageGetIds;
    /** Ids to fetch again after the current in-flight REST request returns. */
    private readonly deferredImageGetIds;
    private readonly failedImageGetIds;
    private readonly pendingCrdtSyncMessages;
    private scheduledCrdtSyncDrain;
    private initialCrdtSynced;
    private readonly initialCrdtSyncWaiters;
    constructor(options: SocketPeerClientOptions);
    connect(): Promise<void>;
    uploadConfig(config: PeerConfigPayload): Promise<void>;
    waitForInitialSync(): Promise<void>;
    disconnect(): Promise<void>;
    retryConnectionNow(): void;
    queueWrite(text: string, images?: import("../../hub/transport/protocol.js").QueueWriteImage[], streamingBehavior?: "steer" | "followUp"): Promise<void>;
    queueFlush(): Promise<void>;
    sendSourceMessage(payload: SourceMessagePayload): Promise<void>;
    abort(): Promise<boolean>;
    setModel(modelResourceId: string): Promise<void>;
    setThinkingLevel(level: string): Promise<void>;
    invokeCommand(commandName: string, args?: string): Promise<void>;
    getSessionSources(): Promise<SourceRuntimeStatus[]>;
    pauseSource(resourceId: string): Promise<SourceRuntimeStatus[]>;
    restartSource(resourceId: string): Promise<SourceRuntimeStatus[]>;
    removeSource(resourceId: string): Promise<SourceRuntimeStatus[]>;
    getMcpServers(): Promise<{
        servers: McpRuntimeStatus[];
        configError?: string;
    }>;
    getSkills(): Promise<Extract<SessionGetSkillsAck, {
        ok: true;
    }>>;
    pauseMcpServer(resourceId: string): Promise<McpRuntimeStatus[]>;
    restartMcpServer(resourceId: string): Promise<McpRuntimeStatus[]>;
    removeMcpServer(resourceId: string): Promise<McpRuntimeStatus[]>;
    private installEventHandlers;
    private enqueueCrdtSyncMessage;
    private scheduleCrdtSyncDrain;
    private drainAllCrdtSyncMessages;
    private resolveInitialCrdtSyncWaiters;
    private logHandshake;
    private clearPendingCrdtSyncMessages;
    /** In-flight and deferred image resource keys only; does not clear `PeerAppState` image cache. */
    private clearImageGetTransportState;
    private requestMissingImages;
    private fetchImageResource;
    private emitAcked;
    private emitMutateSource;
    private emitMutateMcpServer;
    private requireSocket;
}
//# sourceMappingURL=socket-client.d.ts.map