/** * The pane's end of the mirror's wire: connect, attach, read lines, speak. * * The mirror may still be coming up when the pane starts - the split opens, * a shell starts, then this - so a refused connection is retried a few times * before it is given up on. Everything else is one JSON object per line. */ import type { MirrorIn, MirrorOut } from "../src/mirror.ts"; /** A connection to one subagent's mirror. */ export type MirrorClient = { /** Sends a steer or a stop. Dropped silently once the line is gone. */ send(input: MirrorIn): void; /** Hangs up. The subagent does not notice. */ close(): void; }; /** What the client needs, and what it reports. */ export type ClientOptions = { /** The mirror's socket path. */ socket: string; /** The subagent to attach to. */ id: string; /** One parsed line from the mirror. */ onLine(line: MirrorOut): void; /** The line went, or never came: `reason` says which. */ onEnd(reason?: string): void; /** Connection attempts before giving up. Defaults to 15, 200 ms apart. */ retries?: number; }; /** Attaches to `id` over `socket`. Never throws: what went wrong reaches `onEnd`. */ export declare function attachTo(options: ClientOptions): MirrorClient; //# sourceMappingURL=client.d.ts.map