/**
 * ActionPeer — symmetric send/receive for JSON-RPC actions.
 *
 * Wraps a `Transports` registry and `ActionEventEnvironment` to provide
 * bidirectional action dispatch via JSON-RPC 2.0.
 *
 * @module
 */
import { JsonrpcMessageFromServerToClient, JsonrpcNotification, JsonrpcRequest, JsonrpcResponseOrError, JsonrpcErrorResponse } from '../http/jsonrpc.js';
import { Transports, type TransportName, type TransportSendOptions } from './transports.js';
import type { ActionEventEnvironment } from './action_event_types.js';
/**
 * Per-call options for `ActionPeer.send`. Extends `TransportSendOptions`
 * with `transport_name` for per-call transport selection. The peer-wide
 * default for any field lives on `ActionPeerOptions.default_send_options` —
 * set `queue: true` there once for client-authoritative peers and override
 * per-call for exceptions (e.g. high-frequency position sync where stale
 * replays are wrong).
 */
export interface ActionPeerSendOptions extends TransportSendOptions {
    transport_name?: TransportName;
}
export interface ActionPeerOptions {
    environment: ActionEventEnvironment;
    transports?: Transports;
    default_send_options?: Omit<ActionPeerSendOptions, 'signal'>;
}
export declare class ActionPeer {
    #private;
    readonly environment: ActionEventEnvironment;
    readonly transports: Transports;
    default_send_options: Omit<ActionPeerSendOptions, 'signal'>;
    constructor(options: ActionPeerOptions);
    /**
     * Resolve a transport (per-call name → default name → registry default)
     * and forward the message. Catches unexpected throws and converts them
     * to JSON-RPC error responses — this method never throws.
     *
     * @returns the response envelope for requests, or `null` for successful
     *   notifications (`JsonrpcErrorResponse` if the notification's transport
     *   send failed)
     */
    send(message: JsonrpcRequest, options?: ActionPeerSendOptions): Promise<JsonrpcResponseOrError>;
    send(message: JsonrpcNotification, options?: ActionPeerSendOptions): Promise<JsonrpcErrorResponse | null>;
    /**
     * Dispatch an inbound JSON-RPC message — request, notification, or
     * malformed envelope. Never throws; unexpected failures become
     * JSON-RPC error responses.
     *
     * @returns response message for requests, `null` for notifications, or
     *   an `invalid_request` error for malformed input
     */
    receive(message: unknown): Promise<JsonrpcMessageFromServerToClient | null>;
}
//# sourceMappingURL=action_peer.d.ts.map