/**
 * remote/gateway/types — the multi-platform gateway ports.
 *
 * The gateway makes ONE running agent session reachable from several
 * messaging surfaces at once (Telegram, Discord, Slack — and the local CLI).
 * Each surface is a `GatewayAdapter`: it normalizes inbound platform messages
 * into the SDK's `InstructionInbox` and delivers the agent's rendered
 * `SessionEvent` stream back out.
 *
 * Transport-agnostic by design — the same port/transport split the SDK
 * already uses for HITL (`ApprovalChannel`) and remote-control
 * (`RemoteControlPort`). An adapter owns one platform's wire protocol; the
 * `Gateway` (see gateway.ts) owns the routing.
 *
 * @public @since 2.14.0 — preste remote-control T4
 */
/** One inbound message normalized from a platform-specific payload. */
export interface InboundMessage {
    /** Platform slug — "telegram" | "discord" | "slack" | "cli". */
    platform: string;
    /** Platform-specific conversation id (chat / channel). */
    chatId: string;
    /** Platform-specific sender id. */
    userId: string;
    /** The raw message text. */
    text: string;
    /** ISO8601 receive time. */
    ts: string;
}
/**
 * One messaging surface. An adapter owns a single platform's wire protocol:
 * it receives messages (`start`) and delivers agent output (`deliver`).
 */
export interface GatewayAdapter {
    /** Platform slug — unique per adapter instance. */
    readonly platform: string;
    /**
     * Begin receiving. `onMessage` is invoked for every inbound message that
     * passes the adapter's allowlist. Resolves once the adapter is live (the
     * receive loop runs in the background — it is NOT awaited here).
     */
    start(onMessage: (msg: InboundMessage) => void): Promise<void>;
    /** Deliver one rendered chunk of agent output to the platform. */
    deliver(text: string): Promise<void>;
    /** Stop receiving and release the transport. Idempotent. */
    stop(): Promise<void>;
}
/** A logging sink — the gateway and adapters report status here. */
export type GatewayLogger = (msg: string) => void;
/** Discard-everything logger — the default. */
export declare const NOOP_LOGGER: GatewayLogger;
/**
 * Minimal WHATWG-WebSocket surface. Node's global `WebSocket` (>=22), a
 * browser `WebSocket`, and a test fake all satisfy it. Injecting this keeps
 * the WS-based adapters (Discord, Slack) unit-testable without a network and
 * keeps the SDK free of a hard `ws` dependency.
 */
export interface WebSocketLike {
    send(data: string): void;
    close(): void;
    onopen: ((ev: unknown) => void) | null;
    onmessage: ((ev: {
        data: unknown;
    }) => void) | null;
    onclose: ((ev: unknown) => void) | null;
    onerror: ((ev: unknown) => void) | null;
}
/** Builds a `WebSocketLike` for a given URL. */
export type WebSocketFactory = (url: string) => WebSocketLike;
/**
 * Default WS factory — uses the runtime's global `WebSocket` (Node >=22,
 * browsers). Throws a clear message if none exists so a Node <22 consumer
 * knows to pass an explicit factory backed by the `ws` package.
 */
export declare function defaultWebSocketFactory(url: string): WebSocketLike;
//# sourceMappingURL=types.d.ts.map