import type { Disposable, HostApi } from "./host-api.js"; /** * Transport-agnostic RPC. The same wire contract works over: * - extension-host process stdio (Node) — extension logic * - webview postMessage (sandboxed iframe) — extension UI * * The host implements the other end of these messages against its DaemonClient. */ export interface RpcTransport { post(message: unknown): void; /** Register an inbound-message handler. Returns a Disposable. */ subscribe(handler: (message: unknown) => void): Disposable; } export interface CallMessage { kind: "call"; id: number; path: string[]; args: unknown[]; } export interface ResultMessage { kind: "result"; id: number; ok: boolean; value?: unknown; error?: string; } export interface EventMessage { kind: "event"; channel: string; payload: unknown; } export type HostInboundMessage = ResultMessage | EventMessage; /** * Build a HostApi proxy backed by an RpcTransport. Outbound method calls become * `call` messages; the host replies with `result`; `onStatus` subscribes to an * `event` channel. No host code is linked — only the wire shapes above. */ export declare function createHostApi(transport: RpcTransport): HostApi; //# sourceMappingURL=rpc.d.ts.map