import type { z } from "zod";
import type { AgentPermissionRequest, AgentPermissionResponse, AgentPersistenceHandle, AgentProvider, AgentSessionConfig } from "../server/agent/agent-sdk-types.js";
import type { AgentPermissionResolvedMessage, AgentSnapshotPayload, AgentStreamEventPayload, ArchiveWorkspaceResponseMessage, BranchSuggestionsResponse, CaptureTerminalResponse, CheckoutCommitResponse, CheckoutMergeFromBaseResponse, CheckoutMergeResponse, CheckoutPrCreateResponse, CheckoutPrStatusResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutStatusResponse, CheckoutSwitchBranchResponse, CloseItemsResponse, CreateAgentRequestMessage, CreateTerminalResponse, DirectorySuggestionsResponse, EditorTargetId, FetchAgentTimelineResponseMessage, FileDownloadTokenResponse, FileExplorerResponse, GetProvidersSnapshotResponseMessage, GitSetupOptions, KillTerminalResponse, ListAvailableEditorsResponseMessage, ListAvailableProvidersResponse, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListTerminalsResponse, MutableDaemonConfig, MutableDaemonConfigPatch, OpenInEditorResponseMessage, OpenProjectResponseMessage, PersistedAgentDescriptorPayload, ProjectIconResponse, ProjectPlacementPayload, ProviderDiagnosticResponseMessage, RefreshProvidersSnapshotResponseMessage, SeaworkWorktreeArchiveResponse, SeaworkWorktreeListResponse, SessionInboundMessage, SessionOutboundMessage, StashListResponse, StashPopResponse, StashSaveResponse, SubscribeTerminalResponse, TerminalInput, TerminalState, ValidateBranchResponse } from "../shared/messages.js";
import { AgentRefreshedStatusPayloadSchema, RestartRequestedStatusPayloadSchema, type ServerInfoStatusPayload, ShutdownRequestedStatusPayloadSchema } from "../shared/messages.js";
import { type DaemonTransportFactory, type WebSocketFactory } from "./daemon-client-transport.js";
export interface Logger {
    debug(obj: object, msg?: string): void;
    info(obj: object, msg?: string): void;
    warn(obj: object, msg?: string): void;
    error(obj: object, msg?: string): void;
}
export type { DaemonTransport, DaemonTransportFactory, WebSocketFactory, WebSocketLike, } from "./daemon-client-transport.js";
export type TerminalStreamEvent = {
    terminalId: string;
    type: "output";
    data: Uint8Array;
} | {
    terminalId: string;
    type: "snapshot";
    state: TerminalState;
};
export type ConnectionState = {
    status: "idle";
} | {
    status: "connecting";
    attempt: number;
} | {
    status: "connected";
} | {
    status: "disconnected";
    reason?: string;
} | {
    status: "disposed";
};
export type DaemonEvent = {
    type: "agent_update";
    agentId: string;
    payload: Extract<SessionOutboundMessage, {
        type: "agent_update";
    }>["payload"];
} | {
    type: "workspace_update";
    workspaceId: string;
    payload: Extract<SessionOutboundMessage, {
        type: "workspace_update";
    }>["payload"];
} | {
    type: "agent_stream";
    agentId: string;
    event: AgentStreamEventPayload;
    timestamp: string;
    seq?: number;
    epoch?: string;
} | {
    type: "status";
    payload: {
        status: string;
    } & Record<string, unknown>;
} | {
    type: "agent_deleted";
    agentId: string;
} | {
    type: "agent_permission_request";
    agentId: string;
    request: AgentPermissionRequest;
} | {
    type: "agent_permission_resolved";
    agentId: string;
    requestId: string;
    resolution: AgentPermissionResponse;
} | {
    type: "providers_snapshot_update";
    payload: Extract<SessionOutboundMessage, {
        type: "providers_snapshot_update";
    }>["payload"];
} | {
    type: "error";
    message: string;
};
export type DaemonEventHandler = (event: DaemonEvent) => void;
export type DaemonClientConfig = {
    url: string;
    clientId: string;
    clientType?: "mobile" | "browser" | "cli" | "mcp";
    appVersion?: string;
    runtimeGeneration?: number | null;
    authHeader?: string;
    suppressSendErrors?: boolean;
    transportFactory?: DaemonTransportFactory;
    webSocketFactory?: WebSocketFactory;
    logger?: Logger;
    connectTimeoutMs?: number;
    e2ee?: {
        enabled?: boolean;
        daemonPublicKeyB64?: string;
    };
    reconnect?: {
        enabled?: boolean;
        baseDelayMs?: number;
        maxDelayMs?: number;
    };
};
export type SendMessageOptions = {
    messageId?: string;
    images?: Array<{
        data: string;
        mimeType: string;
    }>;
    documents?: Array<{
        path: string;
        mimeType: string;
        fileName?: string | null;
    }>;
};
type AgentConfigOverrides = Partial<Omit<AgentSessionConfig, "provider" | "cwd">>;
export type CreateAgentRequestOptions = {
    config?: AgentSessionConfig;
    provider?: AgentProvider;
    cwd?: string;
    initialPrompt?: string;
    clientMessageId?: string;
    outputSchema?: Record<string, unknown>;
    images?: CreateAgentRequestMessage["images"];
    documents?: CreateAgentRequestMessage["documents"];
    git?: GitSetupOptions;
    worktreeName?: string;
    requestId?: string;
    labels?: Record<string, string>;
} & AgentConfigOverrides;
type CheckoutStatusPayload = CheckoutStatusResponse["payload"];
type SubscribeCheckoutDiffPayload = Extract<SessionOutboundMessage, {
    type: "subscribe_checkout_diff_response";
}>["payload"];
type CheckoutDiffPayload = Omit<SubscribeCheckoutDiffPayload, "subscriptionId">;
type CheckoutCommitPayload = CheckoutCommitResponse["payload"];
type CheckoutMergePayload = CheckoutMergeResponse["payload"];
type CheckoutMergeFromBasePayload = CheckoutMergeFromBaseResponse["payload"];
type CheckoutPullPayload = CheckoutPullResponse["payload"];
type CheckoutPushPayload = CheckoutPushResponse["payload"];
type CheckoutPrCreatePayload = CheckoutPrCreateResponse["payload"];
type CheckoutPrStatusPayload = CheckoutPrStatusResponse["payload"];
type CheckoutSwitchBranchPayload = CheckoutSwitchBranchResponse["payload"];
type StashSavePayload = StashSaveResponse["payload"];
type StashPopPayload = StashPopResponse["payload"];
type StashListPayload = StashListResponse["payload"];
type ValidateBranchPayload = ValidateBranchResponse["payload"];
type BranchSuggestionsPayload = BranchSuggestionsResponse["payload"];
type DirectorySuggestionsPayload = DirectorySuggestionsResponse["payload"];
type SeaworkWorktreeListPayload = SeaworkWorktreeListResponse["payload"];
type SeaworkWorktreeArchivePayload = SeaworkWorktreeArchiveResponse["payload"];
type CreateSeaworkWorktreePayload = Extract<SessionOutboundMessage, {
    type: "create_seawork_worktree_response";
}>["payload"];
type UpdateProjectSettingsPayload = Extract<SessionOutboundMessage, {
    type: "update_project_settings_response";
}>["payload"];
type GetProjectSettingsPayload = Extract<SessionOutboundMessage, {
    type: "get_project_settings_response";
}>["payload"];
type FileExplorerPayload = FileExplorerResponse["payload"];
type FileDownloadTokenPayload = FileDownloadTokenResponse["payload"];
type ListProviderFeaturesPayload = ListProviderFeaturesResponseMessage["payload"];
type ListProviderModelsPayload = ListProviderModelsResponseMessage["payload"];
type ListProviderModesPayload = ListProviderModesResponseMessage["payload"];
type ListAvailableProvidersPayload = ListAvailableProvidersResponse["payload"];
type GetProvidersSnapshotPayload = GetProvidersSnapshotResponseMessage["payload"];
type RefreshProvidersSnapshotPayload = RefreshProvidersSnapshotResponseMessage["payload"];
type ProviderDiagnosticPayload = ProviderDiagnosticResponseMessage["payload"];
type ListCommandsPayload = ListCommandsResponse["payload"];
type ListCommandsDraftConfig = Pick<AgentSessionConfig, "provider" | "cwd" | "modeId" | "model" | "thinkingOptionId" | "featureValues">;
type ListCommandsOptions = {
    requestId?: string;
    draftConfig?: ListCommandsDraftConfig;
};
type SetVoiceModePayload = Extract<SessionOutboundMessage, {
    type: "set_voice_mode_response";
}>["payload"];
type AgentPermissionResolvedPayload = AgentPermissionResolvedMessage["payload"];
type ListTerminalsPayload = ListTerminalsResponse["payload"];
type CreateTerminalPayload = CreateTerminalResponse["payload"];
type SubscribeTerminalPayload = SubscribeTerminalResponse["payload"];
type CloseItemsPayload = CloseItemsResponse["payload"];
type KillTerminalPayload = KillTerminalResponse["payload"];
type CaptureTerminalPayload = CaptureTerminalResponse["payload"];
type ChatCreatePayload = Extract<SessionOutboundMessage, {
    type: "chat/create/response";
}>["payload"];
type ChatListPayload = Extract<SessionOutboundMessage, {
    type: "chat/list/response";
}>["payload"];
type ChatInspectPayload = Extract<SessionOutboundMessage, {
    type: "chat/inspect/response";
}>["payload"];
type ChatDeletePayload = Extract<SessionOutboundMessage, {
    type: "chat/delete/response";
}>["payload"];
type ChatPostPayload = Extract<SessionOutboundMessage, {
    type: "chat/post/response";
}>["payload"];
type ChatReadPayload = Extract<SessionOutboundMessage, {
    type: "chat/read/response";
}>["payload"];
type ChatWaitPayload = Extract<SessionOutboundMessage, {
    type: "chat/wait/response";
}>["payload"];
type LoopRunPayload = Extract<SessionOutboundMessage, {
    type: "loop/run/response";
}>["payload"];
type LoopListPayload = Extract<SessionOutboundMessage, {
    type: "loop/list/response";
}>["payload"];
type LoopInspectPayload = Extract<SessionOutboundMessage, {
    type: "loop/inspect/response";
}>["payload"];
type LoopLogsPayload = Extract<SessionOutboundMessage, {
    type: "loop/logs/response";
}>["payload"];
type LoopStopPayload = Extract<SessionOutboundMessage, {
    type: "loop/stop/response";
}>["payload"];
type ScheduleCreatePayload = Extract<SessionOutboundMessage, {
    type: "schedule/create/response";
}>["payload"];
type ScheduleListPayload = Extract<SessionOutboundMessage, {
    type: "schedule/list/response";
}>["payload"];
type ScheduleInspectPayload = Extract<SessionOutboundMessage, {
    type: "schedule/inspect/response";
}>["payload"];
type ScheduleLogsPayload = Extract<SessionOutboundMessage, {
    type: "schedule/logs/response";
}>["payload"];
type SchedulePausePayload = Extract<SessionOutboundMessage, {
    type: "schedule/pause/response";
}>["payload"];
type ScheduleResumePayload = Extract<SessionOutboundMessage, {
    type: "schedule/resume/response";
}>["payload"];
type ScheduleDeletePayload = Extract<SessionOutboundMessage, {
    type: "schedule/delete/response";
}>["payload"];
export type FetchAgentTimelinePayload = FetchAgentTimelineResponseMessage["payload"];
export type FetchAgentTimelineDirection = FetchAgentTimelinePayload["direction"];
export type FetchAgentTimelineProjection = FetchAgentTimelinePayload["projection"];
export type FetchAgentTimelineCursor = NonNullable<FetchAgentTimelinePayload["startCursor"]>;
export type FetchAgentTimelineOptions = {
    direction?: FetchAgentTimelineDirection;
    cursor?: FetchAgentTimelineCursor;
    limit?: number;
    projection?: FetchAgentTimelineProjection;
    requestId?: string;
};
type AgentRefreshedStatusPayload = z.infer<typeof AgentRefreshedStatusPayloadSchema>;
type RestartRequestedStatusPayload = z.infer<typeof RestartRequestedStatusPayloadSchema>;
type ShutdownRequestedStatusPayload = z.infer<typeof ShutdownRequestedStatusPayloadSchema>;
type FetchAgentsPayload = Extract<SessionOutboundMessage, {
    type: "fetch_agents_response";
}>["payload"];
type FetchAgentsRequest = Extract<SessionInboundMessage, {
    type: "fetch_agents_request";
}>;
export type FetchAgentsOptions = Omit<FetchAgentsRequest, "type" | "requestId"> & {
    requestId?: string;
};
export type FetchAgentsEntry = FetchAgentsPayload["entries"][number];
export type FetchAgentsPageInfo = FetchAgentsPayload["pageInfo"];
type FetchWorkspacesPayload = Extract<SessionOutboundMessage, {
    type: "fetch_workspaces_response";
}>["payload"];
type FetchWorkspacesRequest = Extract<SessionInboundMessage, {
    type: "fetch_workspaces_request";
}>;
export type FetchWorkspacesOptions = Omit<FetchWorkspacesRequest, "type" | "requestId"> & {
    requestId?: string;
};
export type FetchWorkspacesEntry = FetchWorkspacesPayload["entries"][number];
export type FetchWorkspacesPageInfo = FetchWorkspacesPayload["pageInfo"];
export type CreateChatRoomOptions = {
    name: string;
    purpose?: string | null;
    requestId?: string;
};
export type InspectChatRoomOptions = {
    room: string;
    requestId?: string;
};
export type DeleteChatRoomOptions = {
    room: string;
    requestId?: string;
};
export type PostChatMessageOptions = {
    room: string;
    body: string;
    authorAgentId?: string;
    replyToMessageId?: string | null;
    requestId?: string;
};
export type ReadChatMessagesOptions = {
    room: string;
    limit?: number;
    since?: string;
    authorAgentId?: string;
    requestId?: string;
};
export type WaitForChatMessagesOptions = {
    room: string;
    afterMessageId?: string | null;
    timeoutMs?: number;
    requestId?: string;
};
export type RunLoopOptions = {
    prompt: string;
    cwd: string;
    verifyPrompt?: string | null;
    verifyChecks?: string[];
    name?: string | null;
    sleepMs?: number;
    maxIterations?: number;
    maxTimeMs?: number;
    requestId?: string;
};
export type InspectLoopOptions = {
    id: string;
    requestId?: string;
};
export type LoopLogsOptions = {
    id: string;
    afterSeq?: number;
    requestId?: string;
};
export type StopLoopOptions = {
    id: string;
    requestId?: string;
};
export type CreateScheduleOptions = {
    prompt: string;
    name?: string | null;
    cadence: {
        type: "every";
        everyMs: number;
    } | {
        type: "cron";
        expression: string;
    };
    target: {
        type: "self";
        agentId: string;
    } | {
        type: "agent";
        agentId: string;
    } | {
        type: "new-agent";
        config: {
            provider: AgentProvider;
            cwd: string;
            modeId?: string;
            model?: string;
            thinkingOptionId?: string;
            title?: string | null;
            approvalPolicy?: string;
            sandboxMode?: string;
            networkAccess?: boolean;
            webSearch?: boolean;
            extra?: AgentSessionConfig["extra"];
            systemPrompt?: string;
            mcpServers?: AgentSessionConfig["mcpServers"];
        };
    };
    maxRuns?: number;
    expiresAt?: string;
    requestId?: string;
};
export type InspectScheduleOptions = {
    id: string;
    requestId?: string;
};
type ListAvailableEditorsPayload = ListAvailableEditorsResponseMessage["payload"];
type OpenInEditorPayload = OpenInEditorResponseMessage["payload"];
type OpenProjectPayload = OpenProjectResponseMessage["payload"];
type ArchiveWorkspacePayload = ArchiveWorkspaceResponseMessage["payload"];
export type EditorTargetDescriptor = ListAvailableEditorsPayload["editors"][number];
export type FetchAgentResult = {
    agent: AgentSnapshotPayload;
    project: ProjectPlacementPayload | null;
};
export type WaitForFinishResult = {
    status: "idle" | "error" | "permission" | "timeout";
    final: AgentSnapshotPayload | null;
    error: string | null;
    lastMessage: string | null;
};
export declare class DaemonClient {
    private config;
    private transport;
    private transportCleanup;
    private rawMessageListeners;
    private messageHandlers;
    private eventListeners;
    private waiters;
    private checkoutStatusInFlight;
    private connectionListeners;
    private reconnectTimeout;
    private connectTimeout;
    private pendingGenericTransportErrorTimeout;
    private reconnectAttempt;
    private shouldReconnect;
    private connectPromise;
    private connectResolve;
    private connectReject;
    private lastErrorValue;
    private connectionState;
    private checkoutDiffSubscriptions;
    private terminalDirectorySubscriptions;
    private terminalSlots;
    private slotTerminals;
    private readonly terminalStreamListeners;
    private logger;
    private pendingSendQueue;
    private readonly logConnectionPath;
    private readonly logServerId;
    private readonly logClientIdHash;
    private readonly logGeneration;
    private lastServerInfoMessage;
    constructor(config: DaemonClientConfig);
    connect(): Promise<void>;
    private attemptConnect;
    private resolveConnect;
    private rejectConnect;
    close(): Promise<void>;
    ensureConnected(): void;
    getConnectionState(): ConnectionState;
    subscribeConnectionStatus(listener: (status: ConnectionState) => void): () => void;
    get isConnected(): boolean;
    get isConnecting(): boolean;
    get lastError(): string | null;
    subscribe(handler: DaemonEventHandler): () => void;
    subscribeRawMessages(handler: (message: SessionOutboundMessage) => void): () => void;
    on(type: SessionOutboundMessage["type"], handler: (message: SessionOutboundMessage) => void): () => void;
    on(handler: DaemonEventHandler): () => void;
    /**
     * Send a session message. For fire-and-forget messages (heartbeats, etc.),
     * failures are suppressed if `suppressSendErrors` is configured.
     * For RPC methods that wait for responses, use `sendSessionMessageOrThrow` instead.
     */
    private sendSessionMessage;
    private sendBinaryFrame;
    /**
     * Send a session message for RPC methods that create waiters.
     * If the connection is still being established ("connecting"), the message
     * is queued and will be sent once connected (or rejected after timeout).
     * This prevents waiters from hanging forever when called during connection.
     */
    private sendSessionMessageOrThrow;
    /**
     * Flush pending send queue - called when connection is established.
     */
    private flushPendingSendQueue;
    /**
     * Reject all pending sends - called when connection fails or is closed.
     */
    private rejectPendingSendQueue;
    private sendRequest;
    private sendCorrelatedRequest;
    private sendCorrelatedSessionRequest;
    private sendSessionMessageStrict;
    clearAgentAttention(agentId: string | string[]): void;
    sendHeartbeat(params: {
        deviceType: "web" | "mobile";
        focusedAgentId: string | null;
        lastActivityAt: string;
        appVisible: boolean;
        appVisibilityChangedAt?: string;
    }): void;
    registerPushToken(token: string): void;
    ping(params?: {
        requestId?: string;
        timeoutMs?: number;
    }): Promise<{
        requestId: string;
        clientSentAt: number;
        serverReceivedAt: number;
        serverSentAt: number;
        rttMs: number;
    }>;
    fetchAgents(options?: FetchAgentsOptions): Promise<FetchAgentsPayload>;
    fetchWorkspaces(options?: FetchWorkspacesOptions): Promise<FetchWorkspacesPayload>;
    openProject(cwd: string, requestId?: string): Promise<OpenProjectPayload>;
    listAvailableEditors(requestId?: string): Promise<ListAvailableEditorsPayload>;
    openInEditor(path: string, editorId: EditorTargetId, requestId?: string): Promise<OpenInEditorPayload>;
    archiveWorkspace(workspaceId: string, requestId?: string): Promise<ArchiveWorkspacePayload>;
    fetchAgent(agentId: string, requestId?: string): Promise<FetchAgentResult | null>;
    private resubscribeCheckoutDiffSubscriptions;
    private resubscribeTerminalDirectorySubscriptions;
    createAgent(options: CreateAgentRequestOptions): Promise<AgentSnapshotPayload>;
    deleteAgent(agentId: string): Promise<void>;
    submitBugReport(input: {
        title: string;
        description?: string;
        email: string;
        displayName: string;
        clientId?: string;
        appVersion?: string;
        device?: Record<string, unknown>;
        clientLogs?: {
            level: string;
            ts: number;
            msg: string;
        }[];
        attachmentIds?: string[];
        networkEnv?: "company-intranet" | "vpn" | "public" | "unknown";
        canReachPublicInternet?: "yes" | "no" | "unknown";
        desktopInstallAttempts?: {
            ts: number;
            agent: string;
            cmd: string;
            args: string[];
            code: number | null;
            reason: string;
            stderrTail: string;
            spawnError?: string;
        }[];
    }): Promise<{
        ok: boolean;
        issueNumber?: number;
        issueUrl?: string;
        error?: string;
    }>;
    listMyIssues(input: {
        email?: string;
        clientId?: string;
        limit?: number;
    }): Promise<{
        ok: boolean;
        issues?: import("../shared/messages.js").MyIssueSummary[];
        error?: string;
    }>;
    listPublicIssues(input: {
        sort?: "latest" | "top";
        limit?: number;
        offset?: number;
        email?: string;
        clientId?: string;
    }): Promise<{
        ok: boolean;
        issues?: import("../shared/messages.js").PublicIssueSummary[];
        total?: number;
        error?: string;
    }>;
    getPublicIssue(input: {
        issueNumber: number;
        email?: string;
        clientId?: string;
    }): Promise<{
        ok: boolean;
        issue?: import("../shared/messages.js").PublicIssueDetail;
        error?: string;
    }>;
    listIssueComments(input: {
        issueNumber: number;
    }): Promise<{
        ok: boolean;
        comments?: import("../shared/messages.js").PublicComment[];
        error?: string;
    }>;
    postIssueComment(input: {
        issueNumber: number;
        email: string;
        clientId: string;
        displayName: string;
        body: string;
    }): Promise<{
        ok: boolean;
        comment?: import("../shared/messages.js").PublicComment;
        error?: string;
    }>;
    toggleIssueReaction(input: {
        issueNumber: number;
        email: string;
        clientId: string;
        content?: "+1";
    }): Promise<{
        ok: boolean;
        total?: number;
        viewerHasReacted?: boolean;
        error?: string;
    }>;
    archiveAgent(agentId: string): Promise<{
        archivedAt: string;
    }>;
    updateAgent(agentId: string, updates: {
        name?: string;
        labels?: Record<string, string>;
    }): Promise<void>;
    resumeAgent(handle: AgentPersistenceHandle, overrides?: Partial<AgentSessionConfig>): Promise<AgentSnapshotPayload>;
    migrateAgentToCodex(input: {
        persistence: AgentPersistenceHandle;
        cwd?: string;
        title?: string | null;
    }): Promise<AgentSnapshotPayload>;
    listPersistedAgents(options?: {
        provider?: AgentProvider;
        limit?: number;
        cwd?: string;
        includeTimeline?: boolean;
    }): Promise<PersistedAgentDescriptorPayload[]>;
    refreshAgent(agentId: string, requestId?: string): Promise<AgentRefreshedStatusPayload>;
    fetchAgentTimeline(agentId: string, options?: FetchAgentTimelineOptions): Promise<FetchAgentTimelinePayload>;
    sendAgentMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<void>;
    sendMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<void>;
    cancelAgent(agentId: string): Promise<void>;
    setAgentMode(agentId: string, modeId: string): Promise<void>;
    setAgentModel(agentId: string, modelId: string | null): Promise<void>;
    setAgentFeature(agentId: string, featureId: string, value: unknown): Promise<void>;
    setAgentThinkingOption(agentId: string, thinkingOptionId: string | null): Promise<void>;
    restartServer(reason?: string, requestId?: string): Promise<RestartRequestedStatusPayload>;
    shutdownServer(requestId?: string): Promise<ShutdownRequestedStatusPayload>;
    setVoiceMode(enabled: boolean, agentId?: string): Promise<SetVoiceModePayload>;
    sendVoiceAudioChunk(audio: string, format: string, isLast?: boolean): Promise<void>;
    startDictationStream(dictationId: string, format: string): Promise<void>;
    sendDictationStreamChunk(dictationId: string, seq: number, audio: string, format: string): void;
    finishDictationStream(dictationId: string, finalSeq: number): Promise<{
        dictationId: string;
        text: string;
    }>;
    cancelDictationStream(dictationId: string): void;
    abortRequest(): Promise<void>;
    audioPlayed(id: string): Promise<void>;
    getCheckoutStatus(cwd: string, options?: {
        requestId?: string;
    }): Promise<CheckoutStatusPayload>;
    private normalizeCheckoutDiffCompare;
    getCheckoutDiff(cwd: string, compare: {
        mode: "uncommitted" | "base";
        baseRef?: string;
        ignoreWhitespace?: boolean;
    }, requestId?: string): Promise<CheckoutDiffPayload>;
    subscribeCheckoutDiff(cwd: string, compare: {
        mode: "uncommitted" | "base";
        baseRef?: string;
        ignoreWhitespace?: boolean;
    }, options?: {
        subscriptionId?: string;
        requestId?: string;
    }): Promise<SubscribeCheckoutDiffPayload>;
    unsubscribeCheckoutDiff(subscriptionId: string): void;
    checkoutCommit(cwd: string, input: {
        message?: string;
        addAll?: boolean;
    }, requestId?: string): Promise<CheckoutCommitPayload>;
    checkoutMerge(cwd: string, input: {
        baseRef?: string;
        strategy?: "merge" | "squash";
        requireCleanTarget?: boolean;
    }, requestId?: string): Promise<CheckoutMergePayload>;
    checkoutMergeFromBase(cwd: string, input: {
        baseRef?: string;
        requireCleanTarget?: boolean;
    }, requestId?: string): Promise<CheckoutMergeFromBasePayload>;
    checkoutPull(cwd: string, requestId?: string): Promise<CheckoutPullPayload>;
    checkoutPush(cwd: string, requestId?: string): Promise<CheckoutPushPayload>;
    checkoutPrCreate(cwd: string, input: {
        title?: string;
        body?: string;
        baseRef?: string;
    }, requestId?: string): Promise<CheckoutPrCreatePayload>;
    checkoutPrStatus(cwd: string, requestId?: string): Promise<CheckoutPrStatusPayload>;
    checkoutSwitchBranch(cwd: string, branch: string, requestId?: string): Promise<CheckoutSwitchBranchPayload>;
    stashSave(cwd: string, options?: {
        branch?: string;
    }, requestId?: string): Promise<StashSavePayload>;
    stashPop(cwd: string, stashIndex: number, requestId?: string): Promise<StashPopPayload>;
    stashList(cwd: string, options?: {
        seaworkOnly?: boolean;
    }, requestId?: string): Promise<StashListPayload>;
    getSeaworkWorktreeList(input: {
        cwd?: string;
        repoRoot?: string;
    }, requestId?: string): Promise<SeaworkWorktreeListPayload>;
    archiveSeaworkWorktree(input: {
        worktreePath?: string;
        repoRoot?: string;
        branchName?: string;
    }, requestId?: string): Promise<SeaworkWorktreeArchivePayload>;
    createSeaworkWorktree(input: {
        cwd: string;
        worktreeSlug?: string;
    }, requestId?: string): Promise<CreateSeaworkWorktreePayload>;
    updateProjectSettings(input: {
        projectId: string;
        worktreeParentDir: string | null;
    }, requestId?: string): Promise<UpdateProjectSettingsPayload>;
    getProjectSettings(input: {
        projectId: string;
    }, requestId?: string): Promise<GetProjectSettingsPayload>;
    validateBranch(options: {
        cwd: string;
        branchName: string;
    }, requestId?: string): Promise<ValidateBranchPayload>;
    getBranchSuggestions(options: {
        cwd: string;
        query?: string;
        limit?: number;
    }, requestId?: string): Promise<BranchSuggestionsPayload>;
    getDirectorySuggestions(options: {
        query: string;
        limit?: number;
        cwd?: string;
        includeFiles?: boolean;
        includeDirectories?: boolean;
    }, requestId?: string): Promise<DirectorySuggestionsPayload>;
    exploreFileSystem(cwd: string, path: string, mode?: "list" | "file", requestId?: string): Promise<FileExplorerPayload>;
    requestDownloadToken(cwd: string, path: string, requestId?: string): Promise<FileDownloadTokenPayload>;
    requestProjectIcon(cwd: string, requestId?: string): Promise<ProjectIconResponse["payload"]>;
    listProviderModels(provider: AgentProvider, options?: {
        cwd?: string;
        requestId?: string;
    }): Promise<ListProviderModelsPayload>;
    listProviderModes(provider: AgentProvider, options?: {
        cwd?: string;
        requestId?: string;
    }): Promise<ListProviderModesPayload>;
    listProviderFeatures(draftConfig: ListCommandsDraftConfig, options?: {
        requestId?: string;
    }): Promise<ListProviderFeaturesPayload>;
    listAvailableProviders(options?: {
        requestId?: string;
    }): Promise<ListAvailableProvidersPayload>;
    getProvidersSnapshot(options?: {
        cwd?: string;
        requestId?: string;
    }): Promise<GetProvidersSnapshotPayload>;
    getDaemonConfig(requestId?: string): Promise<{
        requestId: string;
        config: MutableDaemonConfig;
    }>;
    patchDaemonConfig(config: MutableDaemonConfigPatch, requestId?: string): Promise<{
        requestId: string;
        config: MutableDaemonConfig;
    }>;
    refreshProvidersSnapshot(options?: {
        cwd?: string;
        requestId?: string;
    }): Promise<RefreshProvidersSnapshotPayload>;
    getProviderDiagnostic(provider: AgentProvider, options?: {
        requestId?: string;
    }): Promise<ProviderDiagnosticPayload>;
    listCommands(agentId: string, requestId?: string): Promise<ListCommandsPayload>;
    listCommands(agentId: string, options?: ListCommandsOptions): Promise<ListCommandsPayload>;
    respondToPermission(agentId: string, requestId: string, response: AgentPermissionResponse): Promise<void>;
    respondToPermissionAndWait(agentId: string, requestId: string, response: AgentPermissionResponse, timeout?: number): Promise<AgentPermissionResolvedPayload>;
    waitForAgentUpsert(agentId: string, predicate: (snapshot: AgentSnapshotPayload) => boolean, timeout?: number): Promise<AgentSnapshotPayload>;
    waitForFinish(agentId: string, timeout?: number): Promise<WaitForFinishResult>;
    subscribeTerminals(input: {
        cwd: string;
    }): void;
    unsubscribeTerminals(input: {
        cwd: string;
    }): void;
    listTerminals(cwd?: string, requestId?: string): Promise<ListTerminalsPayload>;
    createTerminal(cwd: string, name?: string, requestId?: string): Promise<CreateTerminalPayload>;
    subscribeTerminal(terminalId: string, requestId?: string): Promise<SubscribeTerminalPayload>;
    unsubscribeTerminal(terminalId: string): void;
    sendTerminalInput(terminalId: string, message: TerminalInput["message"]): void;
    killTerminal(terminalId: string, requestId?: string): Promise<KillTerminalPayload>;
    closeItems(input: {
        agentIds?: string[];
        terminalIds?: string[];
    }, requestId?: string): Promise<CloseItemsPayload>;
    captureTerminal(terminalId: string, options?: {
        start?: number;
        end?: number;
        stripAnsi?: boolean;
    }, requestId?: string): Promise<CaptureTerminalPayload>;
    createChatRoom(options: CreateChatRoomOptions): Promise<ChatCreatePayload>;
    listChatRooms(requestId?: string): Promise<ChatListPayload>;
    inspectChatRoom(options: InspectChatRoomOptions): Promise<ChatInspectPayload>;
    deleteChatRoom(options: DeleteChatRoomOptions): Promise<ChatDeletePayload>;
    postChatMessage(options: PostChatMessageOptions): Promise<ChatPostPayload>;
    readChatMessages(options: ReadChatMessagesOptions): Promise<ChatReadPayload>;
    waitForChatMessages(options: WaitForChatMessagesOptions): Promise<ChatWaitPayload>;
    scheduleCreate(options: CreateScheduleOptions): Promise<ScheduleCreatePayload>;
    scheduleList(requestId?: string): Promise<ScheduleListPayload>;
    scheduleInspect(options: InspectScheduleOptions): Promise<ScheduleInspectPayload>;
    scheduleLogs(options: InspectScheduleOptions): Promise<ScheduleLogsPayload>;
    schedulePause(options: InspectScheduleOptions): Promise<SchedulePausePayload>;
    scheduleResume(options: InspectScheduleOptions): Promise<ScheduleResumePayload>;
    scheduleDelete(options: InspectScheduleOptions): Promise<ScheduleDeletePayload>;
    loopRun(options: RunLoopOptions): Promise<LoopRunPayload>;
    loopList(requestId?: string): Promise<LoopListPayload>;
    loopInspect(options: string | InspectLoopOptions): Promise<LoopInspectPayload>;
    loopLogs(options: string | LoopLogsOptions, afterSeq?: number): Promise<LoopLogsPayload>;
    loopStop(options: string | StopLoopOptions): Promise<LoopStopPayload>;
    onTerminalStreamEvent(handler: (event: TerminalStreamEvent) => void): () => void;
    waitForTerminalStreamEvent(predicate: (event: TerminalStreamEvent) => boolean, timeout?: number): Promise<TerminalStreamEvent>;
    private createRequestId;
    private setTerminalSlot;
    private removeTerminalSlot;
    private clearTerminalSlots;
    getLastServerInfoMessage(): ServerInfoStatusPayload | null;
    private resolveTransportUrlForAttempt;
    private sendHelloMessage;
    private disposeTransport;
    private cleanupTransport;
    private resetConnectTimeout;
    private handleTransportMessage;
    private handleBinaryFrame;
    private emitTerminalStreamEvent;
    private updateConnectionState;
    setReconnectEnabled(enabled: boolean): void;
    private scheduleReconnect;
    private handleSessionMessage;
    private resolveWaiters;
    private clearWaiters;
    private toEvent;
    private waitForWithCancel;
}
//# sourceMappingURL=daemon-client.d.ts.map