import type { BrokerToClient, ClientToBroker } from './broker-protocol.js'; /** The request never ESTABLISHED the broker connection — the liveness * heuristic said live (pid alive + socket file present) but the broker was * mid-revive and refused/closed before any protocol frame. This is a transport * race, NOT a broker-side rejection (which surfaces as a plain `Error` carrying * the broker's own message). Callers distinguish it to fall back to a durable * path rather than failing the operation. */ export declare class BrokerUnreachableError extends Error { constructor(message: string); } export interface OneShotRequestOptions { nodeId: string; /** Prose naming the operation, used verbatim in timeout/close errors — * e.g. `'the model switch'`, `'the interrupt'`. */ what: string; /** The `ack.for` value that settles this request. */ ackFor: string; /** Build the payload frame. `frameId` is a fresh uuid; use it for frames that * carry an `id` and set `correlated` so the ack is matched on it. */ frame: (frameId: string) => ClientToBroker; /** Match the ack on `frame.id === frameId` as well as `ack.for`. Only for * frames that actually carry an id — an uncorrelated frame's ack has none, * so requiring it would hang until the timeout. */ correlated?: boolean; /** Observe non-ack frames arriving before the ack (e.g. `model_changed`). * Never settles the request. */ observe?: (frame: BrokerToClient) => void; /** Compute the resolved value from the ack's `detail`. */ result: (detail: string | undefined) => T; } /** Run one controller round-trip and resolve with `result(ack.detail)`. * * Rejects with: the broker's message on an `error` frame or a `ok:false` ack; * `BrokerUnreachableError` when the socket fails BEFORE `connect` fires (a * mid-revive race the caller can fall back from); a plain `Error` when it fails * after (a genuine broker fault) or on timeout. */ export declare function oneShotControllerRequest(opts: OneShotRequestOptions): Promise;