import type { Attachment, BridgeOptions } from "@mulmobridge/protocol"; import type { BridgeClient, PushEvent } from "./client.js"; /** Shape of `chat-service`'s `RelayResult`, restated so this package does not * import the server package. Kept structural on purpose: the host passes its * own function and TypeScript checks the two agree. */ export type InProcessRelayResult = { kind: "ok"; reply: string; } | { kind: "error"; status: number; message: string; }; export type InProcessRelayFn = (params: { transportId: string; externalChatId: string; text: string; attachments?: Attachment[] | undefined; bridgeOptions?: Readonly> | undefined; onChunk?: ((text: string) => void) | undefined; }) => Promise; /** Registers this bridge to receive server → bridge pushes. Returns the * unregister function, which `close()` calls. */ export type RegisterInProcessPush = (transportId: string, handler: (event: PushEvent) => void) => () => void; export interface InProcessBridgeClientOptions { transportId: string; relay: InProcessRelayFn; registerPush: RegisterInProcessPush; /** Forwarded to the host's `startChat` exactly as the handshake bag is on the * socket path. Defaults to `{}` — an in-process bridge is configured by the * host, so there is no env to scrape on its behalf. */ options?: BridgeOptions; } export declare function createInProcessBridgeClient(opts: InProcessBridgeClientOptions): BridgeClient;