/**
 * Protocol message types for Coder Hub WebSocket and SSE communication.
 *
 * This module defines all message types exchanged between clients and the
 * Coder Hub server. Messages are validated using Zod schemas for type safety.
 *
 * @module coder/protocol
 *
 * @example Parsing server messages
 * ```typescript
 * import { parseServerMessage, type ServerMessage } from '@agentuity/core/coder';
 *
 * const raw = JSON.parse(websocketData);
 * const message = parseServerMessage(raw);
 * if (message?.type === 'broadcast') {
 *   console.log('Event:', message.event);
 * }
 * ```
 */
import { z } from 'zod/v4';
/** Connection role assigned by the server in the init message */
export declare const CoderHubInitRoleSchema: z.ZodEnum<{
    lead: "lead";
    sub_agent: "sub_agent";
    observer: "observer";
    controller: "controller";
}>;
export type CoderHubInitRole = z.infer<typeof CoderHubInitRoleSchema>;
export declare const CoderHubEventNames: readonly ["session_start", "session_complete", "session_error", "session_shutdown", "session_before_compact", "session_compact", "rpc_ready", "agent_start", "agent_end", "agent_progress", "before_agent_start", "turn_start", "turn_end", "tool_call", "tool_result", "tool_execution_start", "tool_execution_end", "tool_execution_update", "runtime_process_start", "runtime_process_output", "runtime_process_error", "runtime_process_stop", "runtime_preview_available", "task_start", "task_complete", "task_error", "message_start", "message_update", "message_end", "thinking_start", "thinking_end", "session_join", "session_leave", "session_label_updated", "presence_update", "loop_state_updated", "loop_started", "loop_resumed", "loop_paused", "loop_blocked", "loop_completed", "loop_cancelled", "coord_job_created", "coord_job_completed", "coord_job_failed", "coord_task_ready", "coord_task_claimed", "coord_task_completed", "coord_task_failed", "coord_task_discovered", "coord_file_reserved", "coord_file_released", "coord_file_conflict", "coord_contract_provided", "coord_worker_joined"];
export type CoderHubEventName = (typeof CoderHubEventNames)[number];
export declare const CoderHubEventNameSchema: z.ZodEnum<{
    tool_call: "tool_call";
    session_start: "session_start";
    session_complete: "session_complete";
    session_error: "session_error";
    session_shutdown: "session_shutdown";
    session_before_compact: "session_before_compact";
    session_compact: "session_compact";
    rpc_ready: "rpc_ready";
    agent_start: "agent_start";
    agent_end: "agent_end";
    agent_progress: "agent_progress";
    before_agent_start: "before_agent_start";
    turn_start: "turn_start";
    turn_end: "turn_end";
    tool_result: "tool_result";
    tool_execution_start: "tool_execution_start";
    tool_execution_end: "tool_execution_end";
    tool_execution_update: "tool_execution_update";
    runtime_process_start: "runtime_process_start";
    runtime_process_output: "runtime_process_output";
    runtime_process_error: "runtime_process_error";
    runtime_process_stop: "runtime_process_stop";
    runtime_preview_available: "runtime_preview_available";
    task_start: "task_start";
    task_complete: "task_complete";
    task_error: "task_error";
    message_start: "message_start";
    message_update: "message_update";
    message_end: "message_end";
    thinking_start: "thinking_start";
    thinking_end: "thinking_end";
    session_join: "session_join";
    session_leave: "session_leave";
    session_label_updated: "session_label_updated";
    presence_update: "presence_update";
    loop_state_updated: "loop_state_updated";
    loop_started: "loop_started";
    loop_resumed: "loop_resumed";
    loop_paused: "loop_paused";
    loop_blocked: "loop_blocked";
    loop_completed: "loop_completed";
    loop_cancelled: "loop_cancelled";
    coord_job_created: "coord_job_created";
    coord_job_completed: "coord_job_completed";
    coord_job_failed: "coord_job_failed";
    coord_task_ready: "coord_task_ready";
    coord_task_claimed: "coord_task_claimed";
    coord_task_completed: "coord_task_completed";
    coord_task_failed: "coord_task_failed";
    coord_task_discovered: "coord_task_discovered";
    coord_file_reserved: "coord_file_reserved";
    coord_file_released: "coord_file_released";
    coord_file_conflict: "coord_file_conflict";
    coord_contract_provided: "coord_contract_provided";
    coord_worker_joined: "coord_worker_joined";
}>;
export declare const CoderHubEvents: {
    readonly SESSION_START: "session_start";
    readonly SESSION_COMPLETE: "session_complete";
    readonly SESSION_ERROR: "session_error";
    readonly SESSION_SHUTDOWN: "session_shutdown";
    readonly SESSION_BEFORE_COMPACT: "session_before_compact";
    readonly SESSION_COMPACT: "session_compact";
    readonly RPC_READY: "rpc_ready";
    readonly AGENT_START: "agent_start";
    readonly AGENT_END: "agent_end";
    readonly AGENT_PROGRESS: "agent_progress";
    readonly BEFORE_AGENT_START: "before_agent_start";
    readonly TURN_START: "turn_start";
    readonly TURN_END: "turn_end";
    readonly TOOL_CALL: "tool_call";
    readonly TOOL_RESULT: "tool_result";
    readonly TOOL_EXECUTION_START: "tool_execution_start";
    readonly TOOL_EXECUTION_END: "tool_execution_end";
    readonly TOOL_EXECUTION_UPDATE: "tool_execution_update";
    readonly RUNTIME_PROCESS_START: "runtime_process_start";
    readonly RUNTIME_PROCESS_OUTPUT: "runtime_process_output";
    readonly RUNTIME_PROCESS_ERROR: "runtime_process_error";
    readonly RUNTIME_PROCESS_STOP: "runtime_process_stop";
    readonly RUNTIME_PREVIEW_AVAILABLE: "runtime_preview_available";
    readonly TASK_START: "task_start";
    readonly TASK_COMPLETE: "task_complete";
    readonly TASK_ERROR: "task_error";
    readonly MESSAGE_START: "message_start";
    readonly MESSAGE_UPDATE: "message_update";
    readonly MESSAGE_END: "message_end";
    readonly THINKING_START: "thinking_start";
    readonly THINKING_END: "thinking_end";
    readonly SESSION_JOIN: "session_join";
    readonly SESSION_LEAVE: "session_leave";
    readonly SESSION_LABEL_UPDATED: "session_label_updated";
    readonly PRESENCE_UPDATE: "presence_update";
    readonly LOOP_STATE_UPDATED: "loop_state_updated";
    readonly LOOP_STARTED: "loop_started";
    readonly LOOP_RESUMED: "loop_resumed";
    readonly LOOP_PAUSED: "loop_paused";
    readonly LOOP_BLOCKED: "loop_blocked";
    readonly LOOP_COMPLETED: "loop_completed";
    readonly LOOP_CANCELLED: "loop_cancelled";
    readonly COORD_JOB_CREATED: "coord_job_created";
    readonly COORD_JOB_COMPLETED: "coord_job_completed";
    readonly COORD_JOB_FAILED: "coord_job_failed";
    readonly COORD_TASK_READY: "coord_task_ready";
    readonly COORD_TASK_CLAIMED: "coord_task_claimed";
    readonly COORD_TASK_COMPLETED: "coord_task_completed";
    readonly COORD_TASK_FAILED: "coord_task_failed";
    readonly COORD_TASK_DISCOVERED: "coord_task_discovered";
    readonly COORD_FILE_RESERVED: "coord_file_reserved";
    readonly COORD_FILE_RELEASED: "coord_file_released";
    readonly COORD_FILE_CONFLICT: "coord_file_conflict";
    readonly COORD_CONTRACT_PROVIDED: "coord_contract_provided";
    readonly COORD_WORKER_JOINED: "coord_worker_joined";
};
/** Tool definition provided by the server to clients */
export declare const CoderHubToolDefinitionSchema: z.ZodObject<{
    name: z.ZodString;
    label: z.ZodString;
    description: z.ZodString;
    parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    promptSnippet: z.ZodOptional<z.ZodString>;
    promptGuidelines: z.ZodOptional<z.ZodString>;
    timeoutMs: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type CoderHubToolDefinition = z.infer<typeof CoderHubToolDefinitionSchema>;
export declare const CoderHubCommandDefinitionSchema: z.ZodObject<{
    name: z.ZodString;
    description: z.ZodString;
}, z.core.$strip>;
export type CoderHubCommandDefinition = z.infer<typeof CoderHubCommandDefinitionSchema>;
export declare const AgentDefinitionSchema: z.ZodObject<{
    name: z.ZodString;
    displayName: z.ZodOptional<z.ZodString>;
    source: z.ZodOptional<z.ZodEnum<{
        custom: "custom";
        builtin: "builtin";
    }>>;
    description: z.ZodString;
    systemPrompt: z.ZodString;
    model: z.ZodOptional<z.ZodString>;
    tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
    temperature: z.ZodOptional<z.ZodNumber>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    readOnly: z.ZodOptional<z.ZodBoolean>;
    hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
    strictToolSelection: z.ZodOptional<z.ZodBoolean>;
    status: z.ZodOptional<z.ZodEnum<{
        available: "available";
        busy: "busy";
        offline: "offline";
    }>>;
}, z.core.$strip>;
export type AgentDefinition = z.infer<typeof AgentDefinitionSchema>;
export declare const CoderHubConfigSchema: z.ZodObject<{
    systemPromptPrefix: z.ZodOptional<z.ZodString>;
    systemPromptSuffix: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type CoderHubConfig = z.infer<typeof CoderHubConfigSchema>;
export declare const CoderHubLeadResumeDescriptorSchema: z.ZodObject<{
    sessionFile: z.ZodString;
    piSessionId: z.ZodOptional<z.ZodString>;
    cwd: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type CoderHubLeadResumeDescriptor = z.infer<typeof CoderHubLeadResumeDescriptorSchema>;
export declare const CoderHubLeadInitMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"lead">;
}, z.core.$strip>;
export type CoderHubLeadInitMessage = z.infer<typeof CoderHubLeadInitMessageSchema>;
export declare const CoderHubSubAgentInitMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"sub_agent">;
}, z.core.$strip>;
export type CoderHubSubAgentInitMessage = z.infer<typeof CoderHubSubAgentInitMessageSchema>;
export declare const CoderHubControllerInitMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"controller">;
}, z.core.$strip>;
export type CoderHubControllerInitMessage = z.infer<typeof CoderHubControllerInitMessageSchema>;
export declare const CoderHubObserverInitMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"observer">;
}, z.core.$strip>;
export type CoderHubObserverInitMessage = z.infer<typeof CoderHubObserverInitMessageSchema>;
export declare const CoderHubInitMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"lead">;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"sub_agent">;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"observer">;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"controller">;
}, z.core.$strip>], "role">;
export type CoderHubInitMessage = z.infer<typeof CoderHubInitMessageSchema>;
export declare const CoderHubStreamReadyMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"session_stream_ready">;
    streamId: z.ZodString;
    streamUrl: z.ZodString;
}, z.core.$strip>;
export type CoderHubStreamReadyMessage = z.infer<typeof CoderHubStreamReadyMessageSchema>;
export declare const CoderHubSessionResumeMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"session_resume">;
    streamUrl: z.ZodString;
    streamId: z.ZodString;
    activePrdKey: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type CoderHubSessionResumeMessage = z.infer<typeof CoderHubSessionResumeMessageSchema>;
export declare const ConnectionRejectedMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"connection_rejected">;
    code: z.ZodString;
    message: z.ZodString;
    sessionId: z.ZodOptional<z.ZodString>;
    reconnectState: z.ZodOptional<z.ZodString>;
    expiredAt: z.ZodOptional<z.ZodNumber>;
    timestamp: z.ZodNumber;
}, z.core.$strip>;
export type ConnectionRejectedMessage = z.infer<typeof ConnectionRejectedMessageSchema>;
export declare const ProtocolErrorMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"protocol_error">;
    code: z.ZodString;
    message: z.ZodString;
    sessionId: z.ZodOptional<z.ZodString>;
    timestamp: z.ZodNumber;
}, z.core.$strip>;
export type ProtocolErrorMessage = z.infer<typeof ProtocolErrorMessageSchema>;
export declare const AckActionSchema: z.ZodObject<{
    action: z.ZodLiteral<"ACK">;
}, z.core.$strip>;
export type AckAction = z.infer<typeof AckActionSchema>;
export declare const BlockActionSchema: z.ZodObject<{
    action: z.ZodLiteral<"BLOCK">;
    reason: z.ZodString;
}, z.core.$strip>;
export type BlockAction = z.infer<typeof BlockActionSchema>;
export declare const ConfirmActionSchema: z.ZodObject<{
    action: z.ZodLiteral<"CONFIRM">;
    title: z.ZodString;
    message: z.ZodString;
    deny_reason: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ConfirmAction = z.infer<typeof ConfirmActionSchema>;
export declare const NotifyActionSchema: z.ZodObject<{
    action: z.ZodLiteral<"NOTIFY">;
    message: z.ZodString;
    level: z.ZodOptional<z.ZodEnum<{
        info: "info";
        error: "error";
        warning: "warning";
    }>>;
}, z.core.$strip>;
export type NotifyAction = z.infer<typeof NotifyActionSchema>;
export declare const ReturnActionSchema: z.ZodObject<{
    action: z.ZodLiteral<"RETURN">;
    result: z.ZodUnknown;
}, z.core.$strip>;
export type ReturnAction = z.infer<typeof ReturnActionSchema>;
export declare const StatusActionSchema: z.ZodObject<{
    action: z.ZodLiteral<"STATUS">;
    key: z.ZodString;
    text: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type StatusAction = z.infer<typeof StatusActionSchema>;
export declare const SystemPromptActionSchema: z.ZodObject<{
    action: z.ZodLiteral<"SYSTEM_PROMPT">;
    systemPrompt: z.ZodString;
    mode: z.ZodOptional<z.ZodEnum<{
        replace: "replace";
        prefix: "prefix";
        suffix: "suffix";
    }>>;
}, z.core.$strip>;
export type SystemPromptAction = z.infer<typeof SystemPromptActionSchema>;
export declare const InjectMessageActionSchema: z.ZodObject<{
    action: z.ZodLiteral<"INJECT_MESSAGE">;
    message: z.ZodObject<{
        role: z.ZodEnum<{
            user: "user";
            assistant: "assistant";
        }>;
        content: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>;
export type InjectMessageAction = z.infer<typeof InjectMessageActionSchema>;
export declare const CoderHubActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    action: z.ZodLiteral<"ACK">;
}, z.core.$strip>, z.ZodObject<{
    action: z.ZodLiteral<"BLOCK">;
    reason: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
    action: z.ZodLiteral<"CONFIRM">;
    title: z.ZodString;
    message: z.ZodString;
    deny_reason: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
    action: z.ZodLiteral<"NOTIFY">;
    message: z.ZodString;
    level: z.ZodOptional<z.ZodEnum<{
        info: "info";
        error: "error";
        warning: "warning";
    }>>;
}, z.core.$strip>, z.ZodObject<{
    action: z.ZodLiteral<"RETURN">;
    result: z.ZodUnknown;
}, z.core.$strip>, z.ZodObject<{
    action: z.ZodLiteral<"STATUS">;
    key: z.ZodString;
    text: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
    action: z.ZodLiteral<"SYSTEM_PROMPT">;
    systemPrompt: z.ZodString;
    mode: z.ZodOptional<z.ZodEnum<{
        replace: "replace";
        prefix: "prefix";
        suffix: "suffix";
    }>>;
}, z.core.$strip>, z.ZodObject<{
    action: z.ZodLiteral<"INJECT_MESSAGE">;
    message: z.ZodObject<{
        role: z.ZodEnum<{
            user: "user";
            assistant: "assistant";
        }>;
        content: z.ZodString;
    }, z.core.$strip>;
}, z.core.$strip>], "action">;
export type CoderHubAction = z.infer<typeof CoderHubActionSchema>;
export declare const CoderHubResponseSchema: z.ZodObject<{
    id: z.ZodString;
    actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
        action: z.ZodLiteral<"ACK">;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"BLOCK">;
        reason: z.ZodString;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"CONFIRM">;
        title: z.ZodString;
        message: z.ZodString;
        deny_reason: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"NOTIFY">;
        message: z.ZodString;
        level: z.ZodOptional<z.ZodEnum<{
            info: "info";
            error: "error";
            warning: "warning";
        }>>;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"RETURN">;
        result: z.ZodUnknown;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"STATUS">;
        key: z.ZodString;
        text: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"SYSTEM_PROMPT">;
        systemPrompt: z.ZodString;
        mode: z.ZodOptional<z.ZodEnum<{
            replace: "replace";
            prefix: "prefix";
            suffix: "suffix";
        }>>;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"INJECT_MESSAGE">;
        message: z.ZodObject<{
            role: z.ZodEnum<{
                user: "user";
                assistant: "assistant";
            }>;
            content: z.ZodString;
        }, z.core.$strip>;
    }, z.core.$strip>], "action">>;
}, z.core.$strip>;
export type CoderHubResponse = z.infer<typeof CoderHubResponseSchema>;
export declare const ConversationAuthorSchema: z.ZodObject<{
    userId: z.ZodOptional<z.ZodString>;
    displayName: z.ZodOptional<z.ZodString>;
    email: z.ZodOptional<z.ZodString>;
    avatarUrl: z.ZodOptional<z.ZodString>;
    actorType: z.ZodOptional<z.ZodEnum<{
        user: "user";
        api_key: "api_key";
        service: "service";
    }>>;
    apiKeyLabel: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ConversationAuthor = z.infer<typeof ConversationAuthorSchema>;
export declare const RuntimeProcessDescriptorSchema: z.ZodObject<{
    pid: z.ZodOptional<z.ZodNumber>;
    command: z.ZodOptional<z.ZodString>;
    args: z.ZodOptional<z.ZodArray<z.ZodString>>;
    cwd: z.ZodOptional<z.ZodString>;
    env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
    status: z.ZodOptional<z.ZodString>;
    exitCode: z.ZodOptional<z.ZodNumber>;
    signal: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type RuntimeProcessDescriptor = z.infer<typeof RuntimeProcessDescriptorSchema>;
export declare const RuntimePreviewDescriptorSchema: z.ZodObject<{
    url: z.ZodOptional<z.ZodString>;
    port: z.ZodOptional<z.ZodNumber>;
    protocol: z.ZodOptional<z.ZodString>;
    path: z.ZodOptional<z.ZodString>;
    status: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type RuntimePreviewDescriptor = z.infer<typeof RuntimePreviewDescriptorSchema>;
export declare const PromptAttachmentDescriptorSchema: z.ZodObject<{
    type: z.ZodString;
    name: z.ZodOptional<z.ZodString>;
    url: z.ZodOptional<z.ZodString>;
    content: z.ZodOptional<z.ZodString>;
    mimeType: z.ZodOptional<z.ZodString>;
    size: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type PromptAttachmentDescriptor = z.infer<typeof PromptAttachmentDescriptorSchema>;
export declare const ConversationEntrySchema: z.ZodObject<{
    type: z.ZodEnum<{
        message: "message";
        tool_call: "tool_call";
        thinking: "thinking";
        tool_result: "tool_result";
        task_result: "task_result";
        runtime_status: "runtime_status";
        runtime_output: "runtime_output";
        runtime_preview: "runtime_preview";
        turn: "turn";
        user_prompt: "user_prompt";
    }>;
    agent: z.ZodOptional<z.ZodString>;
    content: z.ZodOptional<z.ZodString>;
    thinking: z.ZodOptional<z.ZodString>;
    toolName: z.ZodOptional<z.ZodString>;
    toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    toolCallId: z.ZodOptional<z.ZodString>;
    runtime: z.ZodOptional<z.ZodObject<{
        pid: z.ZodOptional<z.ZodNumber>;
        command: z.ZodOptional<z.ZodString>;
        args: z.ZodOptional<z.ZodArray<z.ZodString>>;
        cwd: z.ZodOptional<z.ZodString>;
        env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
        status: z.ZodOptional<z.ZodString>;
        exitCode: z.ZodOptional<z.ZodNumber>;
        signal: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    preview: z.ZodOptional<z.ZodObject<{
        url: z.ZodOptional<z.ZodString>;
        port: z.ZodOptional<z.ZodNumber>;
        protocol: z.ZodOptional<z.ZodString>;
        path: z.ZodOptional<z.ZodString>;
        status: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
        type: z.ZodString;
        name: z.ZodOptional<z.ZodString>;
        url: z.ZodOptional<z.ZodString>;
        content: z.ZodOptional<z.ZodString>;
        mimeType: z.ZodOptional<z.ZodString>;
        size: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    author: z.ZodOptional<z.ZodObject<{
        userId: z.ZodOptional<z.ZodString>;
        displayName: z.ZodOptional<z.ZodString>;
        email: z.ZodOptional<z.ZodString>;
        avatarUrl: z.ZodOptional<z.ZodString>;
        actorType: z.ZodOptional<z.ZodEnum<{
            user: "user";
            api_key: "api_key";
            service: "service";
        }>>;
        apiKeyLabel: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    isError: z.ZodOptional<z.ZodBoolean>;
    taskId: z.ZodOptional<z.ZodString>;
    turnId: z.ZodOptional<z.ZodString>;
    replyId: z.ZodOptional<z.ZodString>;
    sequence: z.ZodOptional<z.ZodNumber>;
    elapsedMs: z.ZodOptional<z.ZodNumber>;
    timestamp: z.ZodNumber;
}, z.core.$strip>;
export type ConversationEntry = z.infer<typeof ConversationEntrySchema>;
export declare const SessionTaskStateSchema: z.ZodObject<{
    taskId: z.ZodString;
    agent: z.ZodString;
    status: z.ZodEnum<{
        failed: "failed";
        completed: "completed";
        running: "running";
    }>;
    prompt: z.ZodString;
    startedAt: z.ZodOptional<z.ZodString>;
    completedAt: z.ZodOptional<z.ZodString>;
    duration: z.ZodOptional<z.ZodNumber>;
    result: z.ZodOptional<z.ZodString>;
    error: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type SessionTaskState = z.infer<typeof SessionTaskStateSchema>;
export declare const SessionStreamBlockSchema: z.ZodObject<{
    output: z.ZodString;
    thinking: z.ZodString;
}, z.core.$strip>;
export type SessionStreamBlock = z.infer<typeof SessionStreamBlockSchema>;
export declare const SessionStreamProjectionSchema: z.ZodObject<{
    output: z.ZodString;
    thinking: z.ZodString;
    tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
        output: z.ZodString;
        thinking: z.ZodString;
    }, z.core.$strip>>;
}, z.core.$strip>;
export type SessionStreamProjection = z.infer<typeof SessionStreamProjectionSchema>;
export declare const SessionAgentActivitySchema: z.ZodObject<{
    name: z.ZodOptional<z.ZodString>;
    status: z.ZodString;
    currentTool: z.ZodOptional<z.ZodString>;
    currentToolArgs: z.ZodOptional<z.ZodString>;
    toolCallCount: z.ZodNumber;
    lastActivity: z.ZodNumber;
    totalElapsed: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type SessionAgentActivity = z.infer<typeof SessionAgentActivitySchema>;
export declare const CoderHubHydrationMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"session_hydration">;
    sessionId: z.ZodString;
    label: z.ZodOptional<z.ZodString>;
    resumedAt: z.ZodNumber;
    entries: z.ZodArray<z.ZodObject<{
        type: z.ZodEnum<{
            message: "message";
            tool_call: "tool_call";
            thinking: "thinking";
            tool_result: "tool_result";
            task_result: "task_result";
            runtime_status: "runtime_status";
            runtime_output: "runtime_output";
            runtime_preview: "runtime_preview";
            turn: "turn";
            user_prompt: "user_prompt";
        }>;
        agent: z.ZodOptional<z.ZodString>;
        content: z.ZodOptional<z.ZodString>;
        thinking: z.ZodOptional<z.ZodString>;
        toolName: z.ZodOptional<z.ZodString>;
        toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        toolCallId: z.ZodOptional<z.ZodString>;
        runtime: z.ZodOptional<z.ZodObject<{
            pid: z.ZodOptional<z.ZodNumber>;
            command: z.ZodOptional<z.ZodString>;
            args: z.ZodOptional<z.ZodArray<z.ZodString>>;
            cwd: z.ZodOptional<z.ZodString>;
            env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
            status: z.ZodOptional<z.ZodString>;
            exitCode: z.ZodOptional<z.ZodNumber>;
            signal: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        preview: z.ZodOptional<z.ZodObject<{
            url: z.ZodOptional<z.ZodString>;
            port: z.ZodOptional<z.ZodNumber>;
            protocol: z.ZodOptional<z.ZodString>;
            path: z.ZodOptional<z.ZodString>;
            status: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
            type: z.ZodString;
            name: z.ZodOptional<z.ZodString>;
            url: z.ZodOptional<z.ZodString>;
            content: z.ZodOptional<z.ZodString>;
            mimeType: z.ZodOptional<z.ZodString>;
            size: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        author: z.ZodOptional<z.ZodObject<{
            userId: z.ZodOptional<z.ZodString>;
            displayName: z.ZodOptional<z.ZodString>;
            email: z.ZodOptional<z.ZodString>;
            avatarUrl: z.ZodOptional<z.ZodString>;
            actorType: z.ZodOptional<z.ZodEnum<{
                user: "user";
                api_key: "api_key";
                service: "service";
            }>>;
            apiKeyLabel: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        isError: z.ZodOptional<z.ZodBoolean>;
        taskId: z.ZodOptional<z.ZodString>;
        turnId: z.ZodOptional<z.ZodString>;
        replyId: z.ZodOptional<z.ZodString>;
        sequence: z.ZodOptional<z.ZodNumber>;
        elapsedMs: z.ZodOptional<z.ZodNumber>;
        timestamp: z.ZodNumber;
    }, z.core.$strip>>;
    task: z.ZodOptional<z.ZodString>;
    leadConnected: z.ZodOptional<z.ZodBoolean>;
    stream: z.ZodOptional<z.ZodObject<{
        output: z.ZodString;
        thinking: z.ZodString;
        tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
            output: z.ZodString;
            thinking: z.ZodString;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
        taskId: z.ZodString;
        agent: z.ZodString;
        status: z.ZodEnum<{
            failed: "failed";
            completed: "completed";
            running: "running";
        }>;
        prompt: z.ZodString;
        startedAt: z.ZodOptional<z.ZodString>;
        completedAt: z.ZodOptional<z.ZodString>;
        duration: z.ZodOptional<z.ZodNumber>;
        result: z.ZodOptional<z.ZodString>;
        error: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>;
    streamingState: z.ZodOptional<z.ZodObject<{
        isStreaming: z.ZodOptional<z.ZodBoolean>;
        activeTasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
            taskId: z.ZodString;
            agent: z.ZodString;
        }, z.core.$strip>>>;
    }, z.core.$strip>>;
}, z.core.$strip>;
export type CoderHubHydrationMessage = z.infer<typeof CoderHubHydrationMessageSchema>;
export declare const BootstrapReadyMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"bootstrap_ready">;
}, z.core.$strip>;
export type BootstrapReadyMessage = z.infer<typeof BootstrapReadyMessageSchema>;
export declare const ObserverSubscribeMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"subscribe">;
    patterns: z.ZodArray<z.ZodString>;
}, z.core.$strip>;
export type ObserverSubscribeMessage = z.infer<typeof ObserverSubscribeMessageSchema>;
export declare const SessionEntryMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"session_entry">;
    path: z.ZodString;
    line: z.ZodString;
}, z.core.$strip>;
export type SessionEntryMessage = z.infer<typeof SessionEntryMessageSchema>;
export declare const SessionWriteMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"session_write">;
    path: z.ZodString;
    content: z.ZodString;
}, z.core.$strip>;
export type SessionWriteMessage = z.infer<typeof SessionWriteMessageSchema>;
export declare const SessionParticipantSchema: z.ZodObject<{
    id: z.ZodString;
    role: z.ZodEnum<{
        lead: "lead";
        observer: "observer";
        controller: "controller";
    }>;
    transport: z.ZodEnum<{
        ws: "ws";
        sse: "sse";
    }>;
    subscriptions: z.ZodArray<z.ZodString>;
    connectedAt: z.ZodNumber;
    lastActivity: z.ZodNumber;
    metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
export type SessionParticipant = z.infer<typeof SessionParticipantSchema>;
export declare const PresenceEventMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"presence">;
    event: z.ZodEnum<{
        session_join: "session_join";
        session_leave: "session_leave";
        presence_update: "presence_update";
    }>;
    participant: z.ZodOptional<z.ZodObject<{
        id: z.ZodString;
        role: z.ZodEnum<{
            lead: "lead";
            observer: "observer";
            controller: "controller";
        }>;
        transport: z.ZodEnum<{
            ws: "ws";
            sse: "sse";
        }>;
        subscriptions: z.ZodArray<z.ZodString>;
        connectedAt: z.ZodNumber;
        lastActivity: z.ZodNumber;
        metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$strip>>;
    participants: z.ZodOptional<z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        role: z.ZodEnum<{
            lead: "lead";
            observer: "observer";
            controller: "controller";
        }>;
        transport: z.ZodEnum<{
            ws: "ws";
            sse: "sse";
        }>;
        subscriptions: z.ZodArray<z.ZodString>;
        connectedAt: z.ZodNumber;
        lastActivity: z.ZodNumber;
        metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$strip>>>;
    sessionId: z.ZodString;
    timestamp: z.ZodNumber;
}, z.core.$strip>;
export type PresenceEventMessage = z.infer<typeof PresenceEventMessageSchema>;
export declare const BroadcastEventMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"broadcast">;
    event: z.ZodString;
    data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    category: z.ZodString;
    sessionId: z.ZodString;
    timestamp: z.ZodNumber;
}, z.core.$strip>;
export type BroadcastEventMessage = z.infer<typeof BroadcastEventMessageSchema>;
export declare const RpcCommandMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"rpc_command">;
    command: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
export type RpcCommandMessage = z.infer<typeof RpcCommandMessageSchema>;
export declare const RpcEventMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"rpc_event">;
    event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    timestamp: z.ZodNumber;
}, z.core.$strip>;
export type RpcEventMessage = z.infer<typeof RpcEventMessageSchema>;
export declare const RpcResponseMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"rpc_response">;
    response: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
export type RpcResponseMessage = z.infer<typeof RpcResponseMessageSchema>;
export declare const RpcUiRequestMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"rpc_ui_request">;
    id: z.ZodString;
    method: z.ZodString;
    params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
export type RpcUiRequestMessage = z.infer<typeof RpcUiRequestMessageSchema>;
export declare const RpcUiResponseMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"rpc_ui_response">;
    id: z.ZodString;
    result: z.ZodUnknown;
}, z.core.$strip>;
export type RpcUiResponseMessage = z.infer<typeof RpcUiResponseMessageSchema>;
export declare const PingMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"ping">;
    timestamp: z.ZodNumber;
}, z.core.$strip>;
export type PingMessage = z.infer<typeof PingMessageSchema>;
export declare const PongMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"pong">;
    timestamp: z.ZodNumber;
    echoedTimestamp: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type PongMessage = z.infer<typeof PongMessageSchema>;
export declare const EventRequestSchema: z.ZodObject<{
    id: z.ZodString;
    type: z.ZodLiteral<"event">;
    event: z.ZodString;
    data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
export type EventRequest = z.infer<typeof EventRequestSchema>;
export declare const ToolRequestSchema: z.ZodObject<{
    id: z.ZodString;
    type: z.ZodLiteral<"tool">;
    name: z.ZodString;
    toolCallId: z.ZodString;
    params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
export type ToolRequest = z.infer<typeof ToolRequestSchema>;
export declare const CommandRequestSchema: z.ZodObject<{
    id: z.ZodString;
    type: z.ZodLiteral<"command">;
    name: z.ZodString;
    args: z.ZodString;
}, z.core.$strip>;
export type CommandRequest = z.infer<typeof CommandRequestSchema>;
/**
 * All possible client-to-server message types.
 *
 * Messages the client can send to the Coder Hub server.
 */
export declare const ClientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    id: z.ZodString;
    type: z.ZodLiteral<"event">;
    event: z.ZodString;
    data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodString;
    type: z.ZodLiteral<"tool">;
    name: z.ZodString;
    toolCallId: z.ZodString;
    params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>, z.ZodObject<{
    id: z.ZodString;
    type: z.ZodLiteral<"command">;
    name: z.ZodString;
    args: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"session_entry">;
    path: z.ZodString;
    line: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"session_write">;
    path: z.ZodString;
    content: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"bootstrap_ready">;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"subscribe">;
    patterns: z.ZodArray<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"rpc_command">;
    command: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"rpc_ui_response">;
    id: z.ZodString;
    result: z.ZodUnknown;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"ping">;
    timestamp: z.ZodNumber;
}, z.core.$strip>], "type">;
export type ClientMessage = z.infer<typeof ClientMessageSchema>;
/**
 * All possible server-to-client message types.
 *
 * Messages the Coder Hub server can send to connected clients.
 */
export declare const ServerMessageSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"lead">;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"sub_agent">;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"observer">;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"init">;
    sessionId: z.ZodOptional<z.ZodString>;
    resume: z.ZodOptional<z.ZodObject<{
        sessionFile: z.ZodString;
        piSessionId: z.ZodOptional<z.ZodString>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        label: z.ZodString;
        description: z.ZodString;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        promptSnippet: z.ZodOptional<z.ZodString>;
        promptGuidelines: z.ZodOptional<z.ZodString>;
        timeoutMs: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>>;
    commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodString;
    }, z.core.$strip>>>;
    agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        displayName: z.ZodOptional<z.ZodString>;
        source: z.ZodOptional<z.ZodEnum<{
            custom: "custom";
            builtin: "builtin";
        }>>;
        description: z.ZodString;
        systemPrompt: z.ZodString;
        model: z.ZodOptional<z.ZodString>;
        tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        temperature: z.ZodOptional<z.ZodNumber>;
        thinkingLevel: z.ZodOptional<z.ZodString>;
        readOnly: z.ZodOptional<z.ZodBoolean>;
        hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            label: z.ZodString;
            description: z.ZodString;
            parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
            promptSnippet: z.ZodOptional<z.ZodString>;
            promptGuidelines: z.ZodOptional<z.ZodString>;
            timeoutMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
        strictToolSelection: z.ZodOptional<z.ZodBoolean>;
        status: z.ZodOptional<z.ZodEnum<{
            available: "available";
            busy: "busy";
            offline: "offline";
        }>>;
    }, z.core.$strip>>>;
    config: z.ZodOptional<z.ZodObject<{
        systemPromptPrefix: z.ZodOptional<z.ZodString>;
        systemPromptSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    model: z.ZodOptional<z.ZodObject<{
        provider: z.ZodString;
        id: z.ZodString;
    }, z.core.$strip>>;
    thinkingLevel: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    agentRole: z.ZodOptional<z.ZodString>;
    role: z.ZodLiteral<"controller">;
}, z.core.$strip>], "role">, z.ZodObject<{
    id: z.ZodString;
    actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
        action: z.ZodLiteral<"ACK">;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"BLOCK">;
        reason: z.ZodString;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"CONFIRM">;
        title: z.ZodString;
        message: z.ZodString;
        deny_reason: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"NOTIFY">;
        message: z.ZodString;
        level: z.ZodOptional<z.ZodEnum<{
            info: "info";
            error: "error";
            warning: "warning";
        }>>;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"RETURN">;
        result: z.ZodUnknown;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"STATUS">;
        key: z.ZodString;
        text: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"SYSTEM_PROMPT">;
        systemPrompt: z.ZodString;
        mode: z.ZodOptional<z.ZodEnum<{
            replace: "replace";
            prefix: "prefix";
            suffix: "suffix";
        }>>;
    }, z.core.$strip>, z.ZodObject<{
        action: z.ZodLiteral<"INJECT_MESSAGE">;
        message: z.ZodObject<{
            role: z.ZodEnum<{
                user: "user";
                assistant: "assistant";
            }>;
            content: z.ZodString;
        }, z.core.$strip>;
    }, z.core.$strip>], "action">>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"session_hydration">;
    sessionId: z.ZodString;
    label: z.ZodOptional<z.ZodString>;
    resumedAt: z.ZodNumber;
    entries: z.ZodArray<z.ZodObject<{
        type: z.ZodEnum<{
            message: "message";
            tool_call: "tool_call";
            thinking: "thinking";
            tool_result: "tool_result";
            task_result: "task_result";
            runtime_status: "runtime_status";
            runtime_output: "runtime_output";
            runtime_preview: "runtime_preview";
            turn: "turn";
            user_prompt: "user_prompt";
        }>;
        agent: z.ZodOptional<z.ZodString>;
        content: z.ZodOptional<z.ZodString>;
        thinking: z.ZodOptional<z.ZodString>;
        toolName: z.ZodOptional<z.ZodString>;
        toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        toolCallId: z.ZodOptional<z.ZodString>;
        runtime: z.ZodOptional<z.ZodObject<{
            pid: z.ZodOptional<z.ZodNumber>;
            command: z.ZodOptional<z.ZodString>;
            args: z.ZodOptional<z.ZodArray<z.ZodString>>;
            cwd: z.ZodOptional<z.ZodString>;
            env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
            status: z.ZodOptional<z.ZodString>;
            exitCode: z.ZodOptional<z.ZodNumber>;
            signal: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        preview: z.ZodOptional<z.ZodObject<{
            url: z.ZodOptional<z.ZodString>;
            port: z.ZodOptional<z.ZodNumber>;
            protocol: z.ZodOptional<z.ZodString>;
            path: z.ZodOptional<z.ZodString>;
            status: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
            type: z.ZodString;
            name: z.ZodOptional<z.ZodString>;
            url: z.ZodOptional<z.ZodString>;
            content: z.ZodOptional<z.ZodString>;
            mimeType: z.ZodOptional<z.ZodString>;
            size: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        author: z.ZodOptional<z.ZodObject<{
            userId: z.ZodOptional<z.ZodString>;
            displayName: z.ZodOptional<z.ZodString>;
            email: z.ZodOptional<z.ZodString>;
            avatarUrl: z.ZodOptional<z.ZodString>;
            actorType: z.ZodOptional<z.ZodEnum<{
                user: "user";
                api_key: "api_key";
                service: "service";
            }>>;
            apiKeyLabel: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        isError: z.ZodOptional<z.ZodBoolean>;
        taskId: z.ZodOptional<z.ZodString>;
        turnId: z.ZodOptional<z.ZodString>;
        replyId: z.ZodOptional<z.ZodString>;
        sequence: z.ZodOptional<z.ZodNumber>;
        elapsedMs: z.ZodOptional<z.ZodNumber>;
        timestamp: z.ZodNumber;
    }, z.core.$strip>>;
    task: z.ZodOptional<z.ZodString>;
    leadConnected: z.ZodOptional<z.ZodBoolean>;
    stream: z.ZodOptional<z.ZodObject<{
        output: z.ZodString;
        thinking: z.ZodString;
        tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
            output: z.ZodString;
            thinking: z.ZodString;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
        taskId: z.ZodString;
        agent: z.ZodString;
        status: z.ZodEnum<{
            failed: "failed";
            completed: "completed";
            running: "running";
        }>;
        prompt: z.ZodString;
        startedAt: z.ZodOptional<z.ZodString>;
        completedAt: z.ZodOptional<z.ZodString>;
        duration: z.ZodOptional<z.ZodNumber>;
        result: z.ZodOptional<z.ZodString>;
        error: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>;
    streamingState: z.ZodOptional<z.ZodObject<{
        isStreaming: z.ZodOptional<z.ZodBoolean>;
        activeTasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
            taskId: z.ZodString;
            agent: z.ZodString;
        }, z.core.$strip>>>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"session_stream_ready">;
    streamId: z.ZodString;
    streamUrl: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"session_resume">;
    streamUrl: z.ZodString;
    streamId: z.ZodString;
    activePrdKey: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"pong">;
    timestamp: z.ZodNumber;
    echoedTimestamp: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"connection_rejected">;
    code: z.ZodString;
    message: z.ZodString;
    sessionId: z.ZodOptional<z.ZodString>;
    reconnectState: z.ZodOptional<z.ZodString>;
    expiredAt: z.ZodOptional<z.ZodNumber>;
    timestamp: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"protocol_error">;
    code: z.ZodString;
    message: z.ZodString;
    sessionId: z.ZodOptional<z.ZodString>;
    timestamp: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"presence">;
    event: z.ZodEnum<{
        session_join: "session_join";
        session_leave: "session_leave";
        presence_update: "presence_update";
    }>;
    participant: z.ZodOptional<z.ZodObject<{
        id: z.ZodString;
        role: z.ZodEnum<{
            lead: "lead";
            observer: "observer";
            controller: "controller";
        }>;
        transport: z.ZodEnum<{
            ws: "ws";
            sse: "sse";
        }>;
        subscriptions: z.ZodArray<z.ZodString>;
        connectedAt: z.ZodNumber;
        lastActivity: z.ZodNumber;
        metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$strip>>;
    participants: z.ZodOptional<z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        role: z.ZodEnum<{
            lead: "lead";
            observer: "observer";
            controller: "controller";
        }>;
        transport: z.ZodEnum<{
            ws: "ws";
            sse: "sse";
        }>;
        subscriptions: z.ZodArray<z.ZodString>;
        connectedAt: z.ZodNumber;
        lastActivity: z.ZodNumber;
        metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$strip>>>;
    sessionId: z.ZodString;
    timestamp: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"broadcast">;
    event: z.ZodString;
    data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    category: z.ZodString;
    sessionId: z.ZodString;
    timestamp: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"rpc_event">;
    event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    timestamp: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"rpc_response">;
    response: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"rpc_ui_request">;
    id: z.ZodString;
    method: z.ZodString;
    params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>]>;
export type ServerMessage = z.infer<typeof ServerMessageSchema>;
/**
 * Initial session snapshot sent via SSE after connection.
 *
 * Contains the current session state, participants, and agent activity.
 */
export declare const SseSessionSnapshotMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"snapshot">;
    sessionId: z.ZodString;
    label: z.ZodString;
    status: z.ZodString;
    createdAt: z.ZodString;
    mode: z.ZodEnum<{
        sandbox: "sandbox";
        tui: "tui";
    }>;
    participants: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        role: z.ZodString;
        transport: z.ZodString;
        connectedAt: z.ZodString;
        idle: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>;
    taskCount: z.ZodNumber;
    agentActivity: z.ZodRecord<z.ZodString, z.ZodObject<{
        name: z.ZodOptional<z.ZodString>;
        status: z.ZodString;
        currentTool: z.ZodOptional<z.ZodString>;
        currentToolArgs: z.ZodOptional<z.ZodString>;
        toolCallCount: z.ZodNumber;
        lastActivity: z.ZodNumber;
        totalElapsed: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>;
    stream: z.ZodOptional<z.ZodObject<{
        output: z.ZodString;
        thinking: z.ZodString;
        tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
            output: z.ZodString;
            thinking: z.ZodString;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
}, z.core.$strip>;
export type SseSessionSnapshotMessage = z.infer<typeof SseSessionSnapshotMessageSchema>;
export declare const SseHydrationMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"hydration">;
    sessionId: z.ZodString;
    entries: z.ZodArray<z.ZodObject<{
        type: z.ZodEnum<{
            message: "message";
            tool_call: "tool_call";
            thinking: "thinking";
            tool_result: "tool_result";
            task_result: "task_result";
            runtime_status: "runtime_status";
            runtime_output: "runtime_output";
            runtime_preview: "runtime_preview";
            turn: "turn";
            user_prompt: "user_prompt";
        }>;
        agent: z.ZodOptional<z.ZodString>;
        content: z.ZodOptional<z.ZodString>;
        thinking: z.ZodOptional<z.ZodString>;
        toolName: z.ZodOptional<z.ZodString>;
        toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        toolCallId: z.ZodOptional<z.ZodString>;
        runtime: z.ZodOptional<z.ZodObject<{
            pid: z.ZodOptional<z.ZodNumber>;
            command: z.ZodOptional<z.ZodString>;
            args: z.ZodOptional<z.ZodArray<z.ZodString>>;
            cwd: z.ZodOptional<z.ZodString>;
            env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
            status: z.ZodOptional<z.ZodString>;
            exitCode: z.ZodOptional<z.ZodNumber>;
            signal: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        preview: z.ZodOptional<z.ZodObject<{
            url: z.ZodOptional<z.ZodString>;
            port: z.ZodOptional<z.ZodNumber>;
            protocol: z.ZodOptional<z.ZodString>;
            path: z.ZodOptional<z.ZodString>;
            status: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
            type: z.ZodString;
            name: z.ZodOptional<z.ZodString>;
            url: z.ZodOptional<z.ZodString>;
            content: z.ZodOptional<z.ZodString>;
            mimeType: z.ZodOptional<z.ZodString>;
            size: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        author: z.ZodOptional<z.ZodObject<{
            userId: z.ZodOptional<z.ZodString>;
            displayName: z.ZodOptional<z.ZodString>;
            email: z.ZodOptional<z.ZodString>;
            avatarUrl: z.ZodOptional<z.ZodString>;
            actorType: z.ZodOptional<z.ZodEnum<{
                user: "user";
                api_key: "api_key";
                service: "service";
            }>>;
            apiKeyLabel: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        isError: z.ZodOptional<z.ZodBoolean>;
        taskId: z.ZodOptional<z.ZodString>;
        turnId: z.ZodOptional<z.ZodString>;
        replyId: z.ZodOptional<z.ZodString>;
        sequence: z.ZodOptional<z.ZodNumber>;
        elapsedMs: z.ZodOptional<z.ZodNumber>;
        timestamp: z.ZodNumber;
    }, z.core.$strip>>;
    task: z.ZodOptional<z.ZodString>;
    stream: z.ZodOptional<z.ZodObject<{
        output: z.ZodString;
        thinking: z.ZodString;
        tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
            output: z.ZodString;
            thinking: z.ZodString;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
        taskId: z.ZodString;
        agent: z.ZodString;
        status: z.ZodEnum<{
            failed: "failed";
            completed: "completed";
            running: "running";
        }>;
        prompt: z.ZodString;
        startedAt: z.ZodOptional<z.ZodString>;
        completedAt: z.ZodOptional<z.ZodString>;
        duration: z.ZodOptional<z.ZodNumber>;
        result: z.ZodOptional<z.ZodString>;
        error: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>;
}, z.core.$strip>;
export type SseHydrationMessage = z.infer<typeof SseHydrationMessageSchema>;
/**
 * All possible SSE message types sent to observers.
 *
 * SSE connections receive a subset of server messages suitable for
 * read-only observation (snapshots, broadcasts, presence).
 */
export declare const ObserverSseMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    type: z.ZodLiteral<"snapshot">;
    sessionId: z.ZodString;
    label: z.ZodString;
    status: z.ZodString;
    createdAt: z.ZodString;
    mode: z.ZodEnum<{
        sandbox: "sandbox";
        tui: "tui";
    }>;
    participants: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        role: z.ZodString;
        transport: z.ZodString;
        connectedAt: z.ZodString;
        idle: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>;
    taskCount: z.ZodNumber;
    agentActivity: z.ZodRecord<z.ZodString, z.ZodObject<{
        name: z.ZodOptional<z.ZodString>;
        status: z.ZodString;
        currentTool: z.ZodOptional<z.ZodString>;
        currentToolArgs: z.ZodOptional<z.ZodString>;
        toolCallCount: z.ZodNumber;
        lastActivity: z.ZodNumber;
        totalElapsed: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>;
    stream: z.ZodOptional<z.ZodObject<{
        output: z.ZodString;
        thinking: z.ZodString;
        tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
            output: z.ZodString;
            thinking: z.ZodString;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"hydration">;
    sessionId: z.ZodString;
    entries: z.ZodArray<z.ZodObject<{
        type: z.ZodEnum<{
            message: "message";
            tool_call: "tool_call";
            thinking: "thinking";
            tool_result: "tool_result";
            task_result: "task_result";
            runtime_status: "runtime_status";
            runtime_output: "runtime_output";
            runtime_preview: "runtime_preview";
            turn: "turn";
            user_prompt: "user_prompt";
        }>;
        agent: z.ZodOptional<z.ZodString>;
        content: z.ZodOptional<z.ZodString>;
        thinking: z.ZodOptional<z.ZodString>;
        toolName: z.ZodOptional<z.ZodString>;
        toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        toolCallId: z.ZodOptional<z.ZodString>;
        runtime: z.ZodOptional<z.ZodObject<{
            pid: z.ZodOptional<z.ZodNumber>;
            command: z.ZodOptional<z.ZodString>;
            args: z.ZodOptional<z.ZodArray<z.ZodString>>;
            cwd: z.ZodOptional<z.ZodString>;
            env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
            status: z.ZodOptional<z.ZodString>;
            exitCode: z.ZodOptional<z.ZodNumber>;
            signal: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        preview: z.ZodOptional<z.ZodObject<{
            url: z.ZodOptional<z.ZodString>;
            port: z.ZodOptional<z.ZodNumber>;
            protocol: z.ZodOptional<z.ZodString>;
            path: z.ZodOptional<z.ZodString>;
            status: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
            type: z.ZodString;
            name: z.ZodOptional<z.ZodString>;
            url: z.ZodOptional<z.ZodString>;
            content: z.ZodOptional<z.ZodString>;
            mimeType: z.ZodOptional<z.ZodString>;
            size: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
        author: z.ZodOptional<z.ZodObject<{
            userId: z.ZodOptional<z.ZodString>;
            displayName: z.ZodOptional<z.ZodString>;
            email: z.ZodOptional<z.ZodString>;
            avatarUrl: z.ZodOptional<z.ZodString>;
            actorType: z.ZodOptional<z.ZodEnum<{
                user: "user";
                api_key: "api_key";
                service: "service";
            }>>;
            apiKeyLabel: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        isError: z.ZodOptional<z.ZodBoolean>;
        taskId: z.ZodOptional<z.ZodString>;
        turnId: z.ZodOptional<z.ZodString>;
        replyId: z.ZodOptional<z.ZodString>;
        sequence: z.ZodOptional<z.ZodNumber>;
        elapsedMs: z.ZodOptional<z.ZodNumber>;
        timestamp: z.ZodNumber;
    }, z.core.$strip>>;
    task: z.ZodOptional<z.ZodString>;
    stream: z.ZodOptional<z.ZodObject<{
        output: z.ZodString;
        thinking: z.ZodString;
        tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
            output: z.ZodString;
            thinking: z.ZodString;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
        taskId: z.ZodString;
        agent: z.ZodString;
        status: z.ZodEnum<{
            failed: "failed";
            completed: "completed";
            running: "running";
        }>;
        prompt: z.ZodString;
        startedAt: z.ZodOptional<z.ZodString>;
        completedAt: z.ZodOptional<z.ZodString>;
        duration: z.ZodOptional<z.ZodNumber>;
        result: z.ZodOptional<z.ZodString>;
        error: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"presence">;
    event: z.ZodEnum<{
        session_join: "session_join";
        session_leave: "session_leave";
        presence_update: "presence_update";
    }>;
    participant: z.ZodOptional<z.ZodObject<{
        id: z.ZodString;
        role: z.ZodEnum<{
            lead: "lead";
            observer: "observer";
            controller: "controller";
        }>;
        transport: z.ZodEnum<{
            ws: "ws";
            sse: "sse";
        }>;
        subscriptions: z.ZodArray<z.ZodString>;
        connectedAt: z.ZodNumber;
        lastActivity: z.ZodNumber;
        metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$strip>>;
    participants: z.ZodOptional<z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        role: z.ZodEnum<{
            lead: "lead";
            observer: "observer";
            controller: "controller";
        }>;
        transport: z.ZodEnum<{
            ws: "ws";
            sse: "sse";
        }>;
        subscriptions: z.ZodArray<z.ZodString>;
        connectedAt: z.ZodNumber;
        lastActivity: z.ZodNumber;
        metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$strip>>>;
    sessionId: z.ZodString;
    timestamp: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"broadcast">;
    event: z.ZodString;
    data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    category: z.ZodString;
    sessionId: z.ZodString;
    timestamp: z.ZodNumber;
}, z.core.$strip>], "type">;
export type ObserverSseMessage = z.infer<typeof ObserverSseMessageSchema>;
export declare const ConnectionParamsSchema: z.ZodObject<{
    agent: z.ZodOptional<z.ZodString>;
    parent: z.ZodOptional<z.ZodString>;
    sessionId: z.ZodOptional<z.ZodString>;
    task: z.ZodOptional<z.ZodString>;
    label: z.ZodOptional<z.ZodString>;
    orgId: z.ZodOptional<z.ZodString>;
    userId: z.ZodOptional<z.ZodString>;
    origin: z.ZodOptional<z.ZodEnum<{
        tui: "tui";
        web: "web";
        desktop: "desktop";
        sdk: "sdk";
    }>>;
    role: z.ZodOptional<z.ZodEnum<{
        lead: "lead";
        observer: "observer";
        controller: "controller";
    }>>;
    subscribe: z.ZodOptional<z.ZodString>;
    coordJobId: z.ZodOptional<z.ZodString>;
    coordRole: z.ZodOptional<z.ZodString>;
    driverMode: z.ZodOptional<z.ZodEnum<{
        rpc: "rpc";
    }>>;
    driverInstanceId: z.ZodOptional<z.ZodString>;
    driverVersion: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ConnectionParams = z.infer<typeof ConnectionParamsSchema>;
/**
 * Parse unknown data as a server message.
 *
 * @param data - The raw data to parse (typically from JSON.parse)
 * @returns The parsed server message, or null if invalid
 *
 * @example
 * ```typescript
 * const raw = JSON.parse(event.data);
 * const message = parseServerMessage(raw);
 * if (message?.type === 'init') {
 *   console.log('Connected to session:', message.sessionId);
 * }
 * ```
 */
export declare function parseServerMessage(data: unknown): ServerMessage | null;
/**
 * Parse unknown data as a client message.
 *
 * @param data - The raw data to parse (typically from JSON.parse)
 * @returns The parsed client message, or null if invalid
 */
export declare function parseClientMessage(data: unknown): ClientMessage | null;
/**
 * Parse unknown data as an SSE observer message.
 *
 * @param data - The raw data to parse (typically from SSE event data)
 * @returns The parsed SSE message, or null if invalid
 */
export declare function parseObserverSseMessage(data: unknown): ObserverSseMessage | null;
//# sourceMappingURL=protocol.d.ts.map