/**
 * `supervisor-ipc` v1.0 — FROZEN message contract (Zod schemas).
 *
 * This is the byte-for-byte TypeScript mirror of the Rust serde types in
 * `crates/cleo-supervisor/src/ipc.rs`. The wire format is newline-delimited
 * JSON (NDJSON): one {@link SupervisorIpcEnvelope} per line. The supervisor
 * (Rust) is the server; CLEO/Studio (TypeScript) are clients that send
 * {@link SupervisorIpcRequest}s and receive {@link SupervisorIpcResponse}s and
 * unsolicited {@link LifecycleEvent}s.
 *
 * Wire-shape contract (snake_case keys — matches serde defaults):
 *
 * ```jsonc
 * // request
 * { "protocol_version": "1.0.0", "id": "abc", "direction": "request",
 *   "request": { "kind": "spawn", "child_id": "w1", "program": "/bin/node",
 *                "args": [], "env": [] } }
 * // response
 * { "protocol_version": "1.0.0", "id": "abc", "direction": "response",
 *   "response": { "kind": "spawned", "child_id": "w1", "pid": 4242 } }
 * ```
 *
 * FROZEN v1.0: R2 (T11253) consumes this exact set. Do not add/rename/remove
 * fields in place — see {@link SUPERVISOR_IPC_PROTOCOL_VERSION}.
 *
 * @task T11339
 * @packageDocumentation
 */
import { z } from 'zod';
/**
 * A single environment key/value override applied to a spawned child, layered
 * on top of the supervisor's own environment. Mirrors `EnvPair` in Rust.
 */
export declare const EnvPairSchema: z.ZodObject<{
    key: z.ZodString;
    value: z.ZodString;
}, z.core.$strict>;
/** A single environment key/value override (inferred from {@link EnvPairSchema}). */
export type EnvPair = z.infer<typeof EnvPairSchema>;
/**
 * Liveness state of a supervised child. Mirrors `ChildState` in Rust.
 *
 * - `running`    — the child process is alive.
 * - `restarting` — the child exited and a backoff-delayed restart is pending.
 * - `stopped`    — the child exited and will not be restarted.
 */
export declare const ChildStateSchema: z.ZodEnum<{
    running: "running";
    restarting: "restarting";
    stopped: "stopped";
}>;
/** Liveness state of a supervised child (inferred). */
export type ChildState = z.infer<typeof ChildStateSchema>;
/**
 * A single child's status row in a monitor snapshot. Mirrors `ChildStatus`.
 */
export declare const ChildStatusSchema: z.ZodObject<{
    child_id: z.ZodString;
    pid: z.ZodNumber;
    state: z.ZodEnum<{
        running: "running";
        restarting: "restarting";
        stopped: "stopped";
    }>;
    restart_count: z.ZodNumber;
}, z.core.$strict>;
/** A single child's status row (inferred from {@link ChildStatusSchema}). */
export type ChildStatus = z.infer<typeof ChildStatusSchema>;
/**
 * Ask the supervisor to spawn a new child worker. Mirrors `SpawnRequest`.
 */
export declare const SpawnRequestSchema: z.ZodObject<{
    kind: z.ZodLiteral<"spawn">;
    child_id: z.ZodString;
    program: z.ZodString;
    args: z.ZodDefault<z.ZodArray<z.ZodString>>;
    env: z.ZodDefault<z.ZodArray<z.ZodObject<{
        key: z.ZodString;
        value: z.ZodString;
    }, z.core.$strict>>>;
    cwd: z.ZodOptional<z.ZodString>;
}, z.core.$strict>;
/** Spawn request payload (inferred from {@link SpawnRequestSchema}). */
export type SpawnRequest = z.infer<typeof SpawnRequestSchema>;
/**
 * Ask the supervisor to restart an existing child by id. Mirrors `RestartRequest`.
 */
export declare const RestartRequestSchema: z.ZodObject<{
    kind: z.ZodLiteral<"restart">;
    child_id: z.ZodString;
}, z.core.$strict>;
/** Restart request payload (inferred from {@link RestartRequestSchema}). */
export type RestartRequest = z.infer<typeof RestartRequestSchema>;
/**
 * Ask the supervisor for the status of one or all children. Mirrors `MonitorRequest`.
 */
export declare const MonitorRequestSchema: z.ZodObject<{
    kind: z.ZodLiteral<"monitor">;
    child_id: z.ZodOptional<z.ZodString>;
}, z.core.$strict>;
/** Monitor request payload (inferred from {@link MonitorRequestSchema}). */
export type MonitorRequest = z.infer<typeof MonitorRequestSchema>;
/**
 * Ask the supervisor for its own health. Mirrors `HealthRequest` (no fields
 * beyond the discriminator).
 */
export declare const HealthRequestSchema: z.ZodObject<{
    kind: z.ZodLiteral<"health">;
}, z.core.$strict>;
/** Health request payload (inferred from {@link HealthRequestSchema}). */
export type HealthRequest = z.infer<typeof HealthRequestSchema>;
/**
 * The discriminated union of all client → supervisor requests. The `kind`
 * field selects the variant, matching the serde `#[serde(tag = "kind")]`
 * tagging on the Rust `IpcRequest` enum.
 */
export declare const SupervisorIpcRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    kind: z.ZodLiteral<"spawn">;
    child_id: z.ZodString;
    program: z.ZodString;
    args: z.ZodDefault<z.ZodArray<z.ZodString>>;
    env: z.ZodDefault<z.ZodArray<z.ZodObject<{
        key: z.ZodString;
        value: z.ZodString;
    }, z.core.$strict>>>;
    cwd: z.ZodOptional<z.ZodString>;
}, z.core.$strict>, z.ZodObject<{
    kind: z.ZodLiteral<"restart">;
    child_id: z.ZodString;
}, z.core.$strict>, z.ZodObject<{
    kind: z.ZodLiteral<"monitor">;
    child_id: z.ZodOptional<z.ZodString>;
}, z.core.$strict>, z.ZodObject<{
    kind: z.ZodLiteral<"health">;
}, z.core.$strict>], "kind">;
/** Any supervisor IPC request (inferred from {@link SupervisorIpcRequestSchema}). */
export type SupervisorIpcRequest = z.infer<typeof SupervisorIpcRequestSchema>;
/**
 * Result of a {@link SpawnRequest}. Mirrors `SpawnResult` carried by the
 * `spawned` response variant.
 */
export declare const SpawnedResponseSchema: z.ZodObject<{
    kind: z.ZodLiteral<"spawned">;
    child_id: z.ZodString;
    pid: z.ZodNumber;
}, z.core.$strict>;
/** Spawned response payload (inferred from {@link SpawnedResponseSchema}). */
export type SpawnedResponse = z.infer<typeof SpawnedResponseSchema>;
/**
 * Result of a {@link RestartRequest}. Mirrors `RestartResult`.
 */
export declare const RestartedResponseSchema: z.ZodObject<{
    kind: z.ZodLiteral<"restarted">;
    child_id: z.ZodString;
    pid: z.ZodNumber;
    restart_count: z.ZodNumber;
}, z.core.$strict>;
/** Restarted response payload (inferred from {@link RestartedResponseSchema}). */
export type RestartedResponse = z.infer<typeof RestartedResponseSchema>;
/**
 * A monitor snapshot for one or more children. Mirrors `MonitorResult`.
 */
export declare const MonitorResponseSchema: z.ZodObject<{
    kind: z.ZodLiteral<"monitor">;
    children: z.ZodArray<z.ZodObject<{
        child_id: z.ZodString;
        pid: z.ZodNumber;
        state: z.ZodEnum<{
            running: "running";
            restarting: "restarting";
            stopped: "stopped";
        }>;
        restart_count: z.ZodNumber;
    }, z.core.$strict>>;
}, z.core.$strict>;
/** Monitor response payload (inferred from {@link MonitorResponseSchema}). */
export type MonitorResponse = z.infer<typeof MonitorResponseSchema>;
/**
 * A health snapshot for the supervisor itself. Mirrors `HealthResult`.
 */
export declare const HealthResponseSchema: z.ZodObject<{
    kind: z.ZodLiteral<"health">;
    pid: z.ZodNumber;
    child_count: z.ZodNumber;
    uptime_secs: z.ZodNumber;
    protocol_version: z.ZodString;
}, z.core.$strict>;
/** Health response payload (inferred from {@link HealthResponseSchema}). */
export type HealthResponse = z.infer<typeof HealthResponseSchema>;
/**
 * Lifecycle event kind. Mirrors `LifecycleEventKind`.
 *
 * - `child_exited`    — a child process exited.
 * - `child_restarted` — a child was restarted after a crash.
 */
export declare const LifecycleEventKindSchema: z.ZodEnum<{
    child_exited: "child_exited";
    child_restarted: "child_restarted";
}>;
/** Lifecycle event kind (inferred from {@link LifecycleEventKindSchema}). */
export type LifecycleEventKind = z.infer<typeof LifecycleEventKindSchema>;
/**
 * An unsolicited lifecycle event broadcast to all connected clients. Mirrors
 * the `event` response variant wrapping `LifecycleEvent`.
 */
export declare const LifecycleEventResponseSchema: z.ZodObject<{
    kind: z.ZodLiteral<"event">;
    event: z.ZodEnum<{
        child_exited: "child_exited";
        child_restarted: "child_restarted";
    }>;
    child_id: z.ZodString;
    exit_code: z.ZodOptional<z.ZodNumber>;
    signal: z.ZodOptional<z.ZodString>;
    restart_delay_ms: z.ZodOptional<z.ZodNumber>;
}, z.core.$strict>;
/** Lifecycle event response payload (inferred from {@link LifecycleEventResponseSchema}). */
export type LifecycleEventResponse = z.infer<typeof LifecycleEventResponseSchema>;
/**
 * An error response correlated to a request. Mirrors `ErrorResult`.
 */
export declare const ErrorResponseSchema: z.ZodObject<{
    kind: z.ZodLiteral<"error">;
    code: z.ZodString;
    message: z.ZodString;
}, z.core.$strict>;
/** Error response payload (inferred from {@link ErrorResponseSchema}). */
export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
/**
 * The discriminated union of all supervisor → client responses and events. The
 * `kind` field selects the variant, matching the serde `#[serde(tag = "kind")]`
 * tagging on the Rust `IpcResponse` enum.
 */
export declare const SupervisorIpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    kind: z.ZodLiteral<"spawned">;
    child_id: z.ZodString;
    pid: z.ZodNumber;
}, z.core.$strict>, z.ZodObject<{
    kind: z.ZodLiteral<"restarted">;
    child_id: z.ZodString;
    pid: z.ZodNumber;
    restart_count: z.ZodNumber;
}, z.core.$strict>, z.ZodObject<{
    kind: z.ZodLiteral<"monitor">;
    children: z.ZodArray<z.ZodObject<{
        child_id: z.ZodString;
        pid: z.ZodNumber;
        state: z.ZodEnum<{
            running: "running";
            restarting: "restarting";
            stopped: "stopped";
        }>;
        restart_count: z.ZodNumber;
    }, z.core.$strict>>;
}, z.core.$strict>, z.ZodObject<{
    kind: z.ZodLiteral<"health">;
    pid: z.ZodNumber;
    child_count: z.ZodNumber;
    uptime_secs: z.ZodNumber;
    protocol_version: z.ZodString;
}, z.core.$strict>, z.ZodObject<{
    kind: z.ZodLiteral<"event">;
    event: z.ZodEnum<{
        child_exited: "child_exited";
        child_restarted: "child_restarted";
    }>;
    child_id: z.ZodString;
    exit_code: z.ZodOptional<z.ZodNumber>;
    signal: z.ZodOptional<z.ZodString>;
    restart_delay_ms: z.ZodOptional<z.ZodNumber>;
}, z.core.$strict>, z.ZodObject<{
    kind: z.ZodLiteral<"error">;
    code: z.ZodString;
    message: z.ZodString;
}, z.core.$strict>], "kind">;
/** Any supervisor IPC response (inferred from {@link SupervisorIpcResponseSchema}). */
export type SupervisorIpcResponse = z.infer<typeof SupervisorIpcResponseSchema>;
/**
 * A client → supervisor request envelope.
 *
 * The `direction` discriminator + flattened `request` payload mirror the serde
 * `#[serde(tag = "direction")]` `IpcPayload::Request { request }` variant.
 */
export declare const SupervisorIpcRequestEnvelopeSchema: z.ZodObject<{
    protocol_version: z.ZodString;
    id: z.ZodString;
    direction: z.ZodLiteral<"request">;
    request: z.ZodDiscriminatedUnion<[z.ZodObject<{
        kind: z.ZodLiteral<"spawn">;
        child_id: z.ZodString;
        program: z.ZodString;
        args: z.ZodDefault<z.ZodArray<z.ZodString>>;
        env: z.ZodDefault<z.ZodArray<z.ZodObject<{
            key: z.ZodString;
            value: z.ZodString;
        }, z.core.$strict>>>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"restart">;
        child_id: z.ZodString;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"monitor">;
        child_id: z.ZodOptional<z.ZodString>;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"health">;
    }, z.core.$strict>], "kind">;
}, z.core.$strict>;
/** Request envelope (inferred from {@link SupervisorIpcRequestEnvelopeSchema}). */
export type SupervisorIpcRequestEnvelope = z.infer<typeof SupervisorIpcRequestEnvelopeSchema>;
/**
 * A supervisor → client response/event envelope.
 *
 * The `direction` discriminator + flattened `response` payload mirror the serde
 * `IpcPayload::Response { response }` variant.
 */
export declare const SupervisorIpcResponseEnvelopeSchema: z.ZodObject<{
    protocol_version: z.ZodString;
    id: z.ZodString;
    direction: z.ZodLiteral<"response">;
    response: z.ZodDiscriminatedUnion<[z.ZodObject<{
        kind: z.ZodLiteral<"spawned">;
        child_id: z.ZodString;
        pid: z.ZodNumber;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"restarted">;
        child_id: z.ZodString;
        pid: z.ZodNumber;
        restart_count: z.ZodNumber;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"monitor">;
        children: z.ZodArray<z.ZodObject<{
            child_id: z.ZodString;
            pid: z.ZodNumber;
            state: z.ZodEnum<{
                running: "running";
                restarting: "restarting";
                stopped: "stopped";
            }>;
            restart_count: z.ZodNumber;
        }, z.core.$strict>>;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"health">;
        pid: z.ZodNumber;
        child_count: z.ZodNumber;
        uptime_secs: z.ZodNumber;
        protocol_version: z.ZodString;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"event">;
        event: z.ZodEnum<{
            child_exited: "child_exited";
            child_restarted: "child_restarted";
        }>;
        child_id: z.ZodString;
        exit_code: z.ZodOptional<z.ZodNumber>;
        signal: z.ZodOptional<z.ZodString>;
        restart_delay_ms: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"error">;
        code: z.ZodString;
        message: z.ZodString;
    }, z.core.$strict>], "kind">;
}, z.core.$strict>;
/** Response envelope (inferred from {@link SupervisorIpcResponseEnvelopeSchema}). */
export type SupervisorIpcResponseEnvelope = z.infer<typeof SupervisorIpcResponseEnvelopeSchema>;
/**
 * The top-level IPC envelope: a versioned, correlated wrapper that is either a
 * request or a response, discriminated by `direction`. One envelope per NDJSON
 * line. Mirrors the Rust `IpcEnvelope`.
 */
export declare const SupervisorIpcEnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    protocol_version: z.ZodString;
    id: z.ZodString;
    direction: z.ZodLiteral<"request">;
    request: z.ZodDiscriminatedUnion<[z.ZodObject<{
        kind: z.ZodLiteral<"spawn">;
        child_id: z.ZodString;
        program: z.ZodString;
        args: z.ZodDefault<z.ZodArray<z.ZodString>>;
        env: z.ZodDefault<z.ZodArray<z.ZodObject<{
            key: z.ZodString;
            value: z.ZodString;
        }, z.core.$strict>>>;
        cwd: z.ZodOptional<z.ZodString>;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"restart">;
        child_id: z.ZodString;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"monitor">;
        child_id: z.ZodOptional<z.ZodString>;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"health">;
    }, z.core.$strict>], "kind">;
}, z.core.$strict>, z.ZodObject<{
    protocol_version: z.ZodString;
    id: z.ZodString;
    direction: z.ZodLiteral<"response">;
    response: z.ZodDiscriminatedUnion<[z.ZodObject<{
        kind: z.ZodLiteral<"spawned">;
        child_id: z.ZodString;
        pid: z.ZodNumber;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"restarted">;
        child_id: z.ZodString;
        pid: z.ZodNumber;
        restart_count: z.ZodNumber;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"monitor">;
        children: z.ZodArray<z.ZodObject<{
            child_id: z.ZodString;
            pid: z.ZodNumber;
            state: z.ZodEnum<{
                running: "running";
                restarting: "restarting";
                stopped: "stopped";
            }>;
            restart_count: z.ZodNumber;
        }, z.core.$strict>>;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"health">;
        pid: z.ZodNumber;
        child_count: z.ZodNumber;
        uptime_secs: z.ZodNumber;
        protocol_version: z.ZodString;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"event">;
        event: z.ZodEnum<{
            child_exited: "child_exited";
            child_restarted: "child_restarted";
        }>;
        child_id: z.ZodString;
        exit_code: z.ZodOptional<z.ZodNumber>;
        signal: z.ZodOptional<z.ZodString>;
        restart_delay_ms: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strict>, z.ZodObject<{
        kind: z.ZodLiteral<"error">;
        code: z.ZodString;
        message: z.ZodString;
    }, z.core.$strict>], "kind">;
}, z.core.$strict>], "direction">;
/** Any supervisor IPC envelope (inferred from {@link SupervisorIpcEnvelopeSchema}). */
export type SupervisorIpcEnvelope = z.infer<typeof SupervisorIpcEnvelopeSchema>;
/**
 * The FROZEN v1.0 request `kind` values. The schema-drift guard test pins this
 * tuple; any addition/removal is a contract-breaking change.
 */
export declare const SUPERVISOR_IPC_REQUEST_KINDS: readonly ["spawn", "restart", "monitor", "health"];
/**
 * The FROZEN v1.0 response `kind` values. The schema-drift guard test pins this
 * tuple; any addition/removal is a contract-breaking change.
 */
export declare const SUPERVISOR_IPC_RESPONSE_KINDS: readonly ["spawned", "restarted", "monitor", "health", "event", "error"];
/**
 * The complete FROZEN v1.0 message kind set (requests + responses), used by the
 * drift guard on both the TS and Rust sides.
 */
export declare const SUPERVISOR_IPC_MESSAGE_KINDS: readonly ["spawn", "restart", "monitor", "health", "spawned", "restarted", "monitor", "health", "event", "error"];
//# sourceMappingURL=messages.d.ts.map