import { type McpRuntimeStatus, type PeerHelloPayload, type SessionGetSkillsAck, type SourceRuntimeStatus, type ToolCallRequestPayload } from "../../hub/index.js";
import { SocketPeerClient, type SocketPeerClientOptions } from "../client/socket-client.js";
import { PeerAppState } from "../state/peer-app-state.js";
import { PeerUiState } from "../state/peer-ui-state.js";
import type { PeerThinkingLevel } from "../types.js";
export interface CreatePeerRuntimeOptions {
    hubUrl: string;
    /**
     * Hub agent to bind; omit or leave undefined to use the hub default (typically `main`).
     */
    agentId?: string;
    token?: string;
    peerId?: string;
    displayName?: string;
    version: string;
    clientKind?: "peer" | "guest";
    executorEnabled?: boolean;
    tools?: string[];
    cwd?: string;
    agentDir?: string;
    onHandshakeLog?: SocketPeerClientOptions["onHandshakeLog"];
    onToolCallRequest?: SocketPeerClientOptions["onToolCallRequest"];
    onGuestAgentMessage?: SocketPeerClientOptions["onGuestAgentMessage"];
}
export declare class PeerRuntime {
    readonly appState: PeerAppState;
    readonly uiState: PeerUiState;
    readonly client: SocketPeerClient;
    readonly hello: PeerHelloPayload;
    private readonly peerMcpRuntime;
    private readonly peerSourceRuntime;
    private readonly cwd;
    private readonly agentDir;
    private configSnapshot;
    private readonly baseTools;
    constructor(options: CreatePeerRuntimeOptions);
    start(): Promise<void>;
    stop(): Promise<void>;
    switchAgent(agentId: string): Promise<void>;
    /**
     * Effective hub agent for this peer: authoritative `hub:welcome.agentId` when connected,
     * otherwise the `agentId` from `peer:hello` if set, or `root`.
     */
    getBoundAgentId(): string;
    queueWrite(text: string): Promise<void>;
    queueFlush(): Promise<void>;
    abort(): Promise<boolean>;
    setModel(modelResourceId: string): Promise<void>;
    setThinkingLevel(level: PeerThinkingLevel): 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(name: string): Promise<McpRuntimeStatus[]>;
    restartMcpServer(name: string): Promise<McpRuntimeStatus[]>;
    removeMcpServer(name: string): Promise<McpRuntimeStatus[]>;
    retryConnection(): void;
    private createPeerConfigPayload;
    private restorePreviousAgentAfterFailedSwitch;
    getStatus(): {
        hello: PeerHelloPayload;
        app: import("../state/peer-app-state.js").PeerAppSnapshot;
        ui: import("../state/peer-ui-state.js").PeerUiSnapshot;
    };
}
export type { ToolCallRequestPayload };
//# sourceMappingURL=peer-runtime.d.ts.map