import { z } from "zod/v4";
export declare const AckMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        ref_id: z.ZodString;
        status: z.ZodOptional<z.ZodString>;
        error: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const PingRequestMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        ref_id: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const PongMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        ref_id: z.ZodString;
        status: z.ZodOptional<z.ZodEnum<{
            error: "error";
            unknown: "unknown";
            idle: "idle";
            busy: "busy";
        }>>;
        current_task_id: z.ZodOptional<z.ZodString>;
        chrome_uptime_ms: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const TaskDispatchMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        task_run_id: z.ZodString;
        prompt: z.ZodString;
        randomized_delay_ms: z.ZodDefault<z.ZodNumber>;
        deadline_ms: z.ZodOptional<z.ZodNumber>;
        attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
            r2_object_key: z.ZodString;
            filename: z.ZodString;
            mime: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const ChatUserMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
            type: z.ZodString;
            text: z.ZodOptional<z.ZodString>;
            attachment_id: z.ZodOptional<z.ZodString>;
            filename: z.ZodOptional<z.ZodString>;
            mime: z.ZodOptional<z.ZodString>;
            size_bytes: z.ZodOptional<z.ZodNumber>;
            url: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>]>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const ConfigInvalidateMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        which: z.ZodArray<z.ZodEnum<{
            social_accounts: "social_accounts";
            telegram: "telegram";
            session: "session";
            proxy: "proxy";
            llm: "llm";
            persona: "persona";
        }>>;
        new_config_etag: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const CancelTaskMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        task_run_id: z.ZodString;
        reason: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const WorkerHelloMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_id: z.ZodString;
        version: z.ZodString;
        config_etag: z.ZodString;
        current_status: z.ZodEnum<{
            error: "error";
            unknown: "unknown";
            idle: "idle";
            busy: "busy";
        }>;
        current_task_id: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const StatusChangeMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        status: z.ZodEnum<{
            error: "error";
            unknown: "unknown";
            idle: "idle";
            busy: "busy";
        }>;
        current_task_id: z.ZodOptional<z.ZodString>;
        chrome_uptime_ms: z.ZodOptional<z.ZodNumber>;
        reason: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
/** Periodic 30s liveness ping from dp-worker to center. Empty payload —
 *  the envelope's arrival is the signal. */
export declare const WorkerHeartbeatMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{}, z.core.$strip>;
}, z.core.$strip>;
export declare const TaskEventMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        task_run_id: z.ZodString;
        event: z.ZodEnum<{
            dispatched_ack: "dispatched_ack";
            started: "started";
            step_log: "step_log";
            finished: "finished";
        }>;
        status: z.ZodOptional<z.ZodEnum<{
            running: "running";
            success: "success";
            failed: "failed";
            queued: "queued";
            dispatched: "dispatched";
            cancelled: "cancelled";
            timeout: "timeout";
        }>>;
        error: z.ZodOptional<z.ZodString>;
        result_summary: z.ZodOptional<z.ZodString>;
        step_index: z.ZodOptional<z.ZodNumber>;
        step_log: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const ChatMessageChunkMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        delta: z.ZodString;
        done: z.ZodBoolean;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const ChatMessageFinalizedMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        role: z.ZodString;
        content: z.ZodString;
        tool_traces: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
    }, z.core.$strip>;
}, z.core.$strip>;
/** Returned by dp-worker when a chat arrives while BrowserLock is held by a task. */
export declare const ChatMessageQueuedMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        queue_position: z.ZodNumber;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const AttachmentUploadRequestMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        request_id: z.ZodString;
        filename: z.ZodString;
        mime: z.ZodOptional<z.ZodString>;
        size_bytes: z.ZodNumber;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const ErrorReportMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        code: z.ZodString;
        message: z.ZodString;
        stack: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
export type TaskDispatchPayload = z.infer<typeof TaskDispatchMessage>["payload"];
export type ChatUserMessagePayload = z.infer<typeof ChatUserMessage>["payload"];
export type ConfigInvalidatePayload = z.infer<typeof ConfigInvalidateMessage>["payload"];
export type CancelTaskPayload = z.infer<typeof CancelTaskMessage>["payload"];
export type PingRequestPayload = z.infer<typeof PingRequestMessage>["payload"];
export type PongPayload = z.infer<typeof PongMessage>["payload"];
export type WorkerHelloPayload = z.infer<typeof WorkerHelloMessage>["payload"];
export type StatusChangePayload = z.infer<typeof StatusChangeMessage>["payload"];
export type TaskEventPayload = z.infer<typeof TaskEventMessage>["payload"];
export type ChatMessageChunkPayload = z.infer<typeof ChatMessageChunkMessage>["payload"];
export type ChatMessageFinalizedPayload = z.infer<typeof ChatMessageFinalizedMessage>["payload"];
export type ChatMessageQueuedPayload = z.infer<typeof ChatMessageQueuedMessage>["payload"];
export type WorkerHeartbeatPayload = z.infer<typeof WorkerHeartbeatMessage>["payload"];
/** Union of every message that may travel on a center↔dp-worker WebSocket. */
export declare const CenterWorkerWsMessage: z.ZodDiscriminatedUnion<[z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        ref_id: z.ZodString;
        status: z.ZodOptional<z.ZodString>;
        error: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        ref_id: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        ref_id: z.ZodString;
        status: z.ZodOptional<z.ZodEnum<{
            error: "error";
            unknown: "unknown";
            idle: "idle";
            busy: "busy";
        }>>;
        current_task_id: z.ZodOptional<z.ZodString>;
        chrome_uptime_ms: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        task_run_id: z.ZodString;
        prompt: z.ZodString;
        randomized_delay_ms: z.ZodDefault<z.ZodNumber>;
        deadline_ms: z.ZodOptional<z.ZodNumber>;
        attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
            r2_object_key: z.ZodString;
            filename: z.ZodString;
            mime: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
            type: z.ZodString;
            text: z.ZodOptional<z.ZodString>;
            attachment_id: z.ZodOptional<z.ZodString>;
            filename: z.ZodOptional<z.ZodString>;
            mime: z.ZodOptional<z.ZodString>;
            size_bytes: z.ZodOptional<z.ZodNumber>;
            url: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>]>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        which: z.ZodArray<z.ZodEnum<{
            social_accounts: "social_accounts";
            telegram: "telegram";
            session: "session";
            proxy: "proxy";
            llm: "llm";
            persona: "persona";
        }>>;
        new_config_etag: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        task_run_id: z.ZodString;
        reason: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_id: z.ZodString;
        version: z.ZodString;
        config_etag: z.ZodString;
        current_status: z.ZodEnum<{
            error: "error";
            unknown: "unknown";
            idle: "idle";
            busy: "busy";
        }>;
        current_task_id: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        status: z.ZodEnum<{
            error: "error";
            unknown: "unknown";
            idle: "idle";
            busy: "busy";
        }>;
        current_task_id: z.ZodOptional<z.ZodString>;
        chrome_uptime_ms: z.ZodOptional<z.ZodNumber>;
        reason: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{}, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        task_run_id: z.ZodString;
        event: z.ZodEnum<{
            dispatched_ack: "dispatched_ack";
            started: "started";
            step_log: "step_log";
            finished: "finished";
        }>;
        status: z.ZodOptional<z.ZodEnum<{
            running: "running";
            success: "success";
            failed: "failed";
            queued: "queued";
            dispatched: "dispatched";
            cancelled: "cancelled";
            timeout: "timeout";
        }>>;
        error: z.ZodOptional<z.ZodString>;
        result_summary: z.ZodOptional<z.ZodString>;
        step_index: z.ZodOptional<z.ZodNumber>;
        step_log: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        delta: z.ZodString;
        done: z.ZodBoolean;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        role: z.ZodString;
        content: z.ZodString;
        tool_traces: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        queue_position: z.ZodNumber;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        request_id: z.ZodString;
        filename: z.ZodString;
        mime: z.ZodOptional<z.ZodString>;
        size_bytes: z.ZodNumber;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        code: z.ZodString;
        message: z.ZodString;
        stack: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>], "type">;
export type CenterWorkerWsMessage = z.infer<typeof CenterWorkerWsMessage>;
export declare const SpawnWorkerMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_id: z.ZodString;
        api_key: z.ZodString;
        center_url: z.ZodString;
        version: z.ZodOptional<z.ZodString>;
        workspace_path: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const StopWorkerMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_id: z.ZodString;
        graceful: z.ZodDefault<z.ZodBoolean>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const RestartWorkerMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_id: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const UpgradeDpWorkerMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        request_id: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const QueryWorkerStatusMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_ids: z.ZodArray<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const ReconcileWorkersMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        generation: z.ZodString;
        workers: z.ZodArray<z.ZodObject<{
            worker_id: z.ZodString;
            api_key: z.ZodString;
            center_url: z.ZodString;
            workspace_path: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        stop_unlisted: z.ZodDefault<z.ZodBoolean>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const DirectorHelloMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        director_id: z.ZodString;
        host_label: z.ZodOptional<z.ZodString>;
        version: z.ZodString;
        worker_pids: z.ZodRecord<z.ZodString, z.ZodNumber>;
        capabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
        dp_worker_runtime_mode: z.ZodOptional<z.ZodEnum<{
            npm: "npm";
            "dev-dist": "dev-dist";
        }>>;
        dp_worker_version: z.ZodOptional<z.ZodString>;
        dp_worker_latest_version: z.ZodOptional<z.ZodString>;
        dp_worker_upgrade_status: z.ZodOptional<z.ZodEnum<{
            idle: "idle";
            checking: "checking";
            installing: "installing";
            building: "building";
            restarting: "restarting";
            success: "success";
            skipped: "skipped";
            failed: "failed";
        }>>;
    }, z.core.$strip>;
}, z.core.$strip>;
/**
 * Sent by DirectorConnection DO to the dp-director immediately after the WS upgrade so
 * the dp-director learns its own canonical director_id (the DO resolved it from the
 * api_key during the upgrade and knows the authoritative value). The dp-director
 * waits for this before sending `hello`.
 */
export declare const WelcomeMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        director_id: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const WorkerStateChangeMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_id: z.ZodString;
        state: z.ZodEnum<{
            running: "running";
            stopped: "stopped";
            crashed: "crashed";
            crashed_loop: "crashed_loop";
        }>;
        pid: z.ZodOptional<z.ZodNumber>;
        exit_code: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const DirectorHeartbeatMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        running_workers: z.ZodArray<z.ZodString>;
        cpu: z.ZodOptional<z.ZodNumber>;
        mem: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const DpWorkerUpgradeStatusMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        request_id: z.ZodString;
        status: z.ZodEnum<{
            idle: "idle";
            checking: "checking";
            installing: "installing";
            building: "building";
            restarting: "restarting";
            success: "success";
            skipped: "skipped";
            failed: "failed";
        }>;
        runtime_mode: z.ZodEnum<{
            npm: "npm";
            "dev-dist": "dev-dist";
        }>;
        current_version: z.ZodOptional<z.ZodString>;
        latest_version: z.ZodOptional<z.ZodString>;
        message: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
export type SpawnWorkerPayload = z.infer<typeof SpawnWorkerMessage>["payload"];
export type StopWorkerPayload = z.infer<typeof StopWorkerMessage>["payload"];
export type RestartWorkerPayload = z.infer<typeof RestartWorkerMessage>["payload"];
export type UpgradeDpWorkerPayload = z.infer<typeof UpgradeDpWorkerMessage>["payload"];
export type QueryWorkerStatusPayload = z.infer<typeof QueryWorkerStatusMessage>["payload"];
export type ReconcileWorkersPayload = z.infer<typeof ReconcileWorkersMessage>["payload"];
export type DirectorHelloPayload = z.infer<typeof DirectorHelloMessage>["payload"];
export type WorkerStateChangePayload = z.infer<typeof WorkerStateChangeMessage>["payload"];
export type DirectorHeartbeatPayload = z.infer<typeof DirectorHeartbeatMessage>["payload"];
export type WelcomePayload = z.infer<typeof WelcomeMessage>["payload"];
export type DpWorkerUpgradeStatusPayload = z.infer<typeof DpWorkerUpgradeStatusMessage>["payload"];
/** Union of every message that may travel on a center↔dp-director WebSocket. */
export declare const CenterDirectorWsMessage: z.ZodDiscriminatedUnion<[z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        ref_id: z.ZodString;
        status: z.ZodOptional<z.ZodString>;
        error: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        ref_id: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        ref_id: z.ZodString;
        status: z.ZodOptional<z.ZodEnum<{
            error: "error";
            unknown: "unknown";
            idle: "idle";
            busy: "busy";
        }>>;
        current_task_id: z.ZodOptional<z.ZodString>;
        chrome_uptime_ms: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_id: z.ZodString;
        api_key: z.ZodString;
        center_url: z.ZodString;
        version: z.ZodOptional<z.ZodString>;
        workspace_path: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_id: z.ZodString;
        graceful: z.ZodDefault<z.ZodBoolean>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_id: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        request_id: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_ids: z.ZodArray<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        generation: z.ZodString;
        workers: z.ZodArray<z.ZodObject<{
            worker_id: z.ZodString;
            api_key: z.ZodString;
            center_url: z.ZodString;
            workspace_path: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        stop_unlisted: z.ZodDefault<z.ZodBoolean>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        director_id: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        director_id: z.ZodString;
        host_label: z.ZodOptional<z.ZodString>;
        version: z.ZodString;
        worker_pids: z.ZodRecord<z.ZodString, z.ZodNumber>;
        capabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
        dp_worker_runtime_mode: z.ZodOptional<z.ZodEnum<{
            npm: "npm";
            "dev-dist": "dev-dist";
        }>>;
        dp_worker_version: z.ZodOptional<z.ZodString>;
        dp_worker_latest_version: z.ZodOptional<z.ZodString>;
        dp_worker_upgrade_status: z.ZodOptional<z.ZodEnum<{
            idle: "idle";
            checking: "checking";
            installing: "installing";
            building: "building";
            restarting: "restarting";
            success: "success";
            skipped: "skipped";
            failed: "failed";
        }>>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        worker_id: z.ZodString;
        state: z.ZodEnum<{
            running: "running";
            stopped: "stopped";
            crashed: "crashed";
            crashed_loop: "crashed_loop";
        }>;
        pid: z.ZodOptional<z.ZodNumber>;
        exit_code: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        running_workers: z.ZodArray<z.ZodString>;
        cpu: z.ZodOptional<z.ZodNumber>;
        mem: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        request_id: z.ZodString;
        status: z.ZodEnum<{
            idle: "idle";
            checking: "checking";
            installing: "installing";
            building: "building";
            restarting: "restarting";
            success: "success";
            skipped: "skipped";
            failed: "failed";
        }>;
        runtime_mode: z.ZodEnum<{
            npm: "npm";
            "dev-dist": "dev-dist";
        }>;
        current_version: z.ZodOptional<z.ZodString>;
        latest_version: z.ZodOptional<z.ZodString>;
        message: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>], "type">;
export type CenterDirectorWsMessage = z.infer<typeof CenterDirectorWsMessage>;
/** UI sends to subscribe to a chat (auth is via JWT in connect URL). */
export declare const ChatSubscribeMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        since_message_id: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
/** ChatBroadcast pushes the same chunks dp-worker emits, plus user-side echoes. */
export declare const ChatBroadcastChunkMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        delta: z.ZodString;
        done: z.ZodBoolean;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const ChatBroadcastFinalizedMessage: z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        role: z.ZodString;
        content: z.ZodString;
        tool_traces: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const CenterWebChatWsMessage: z.ZodDiscriminatedUnion<[z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        ref_id: z.ZodString;
        status: z.ZodOptional<z.ZodString>;
        error: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        since_message_id: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        delta: z.ZodString;
        done: z.ZodBoolean;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodOptional<z.ZodString>;
    type: z.ZodLiteral<string>;
    ts: z.ZodNumber;
    payload: z.ZodObject<{
        chat_id: z.ZodString;
        message_id: z.ZodString;
        role: z.ZodString;
        content: z.ZodString;
        tool_traces: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
    }, z.core.$strip>;
}, z.core.$strip>], "type">;
export type CenterWebChatWsMessage = z.infer<typeof CenterWebChatWsMessage>;
//# sourceMappingURL=ws-protocol.d.ts.map