/** * The stdio shim: what MCP clients spawn. A raw bidirectional pump between the client's * stdio and the daemon's Streamable HTTP endpoint — no Client/Server protocol layer, frames * are forwarded verbatim so the daemon negotiates directly with the real client. The shim * process is disposable by design: the client may kill it at will; runs live in the daemon. * * The only frames the shim inspects: * - a legacy client's `initialize` request — cached for session recovery, and its response * sniffed to call setProtocolVersion() (there is no protocol layer in this proxy); * - the legacy `initialized` notification — forwarded before the standalone GET stream opens; * - client requests in either era — ids are tracked until their response arrives, so an * ambiguous request on a dead daemon is failed rather than replayed or left hanging. * * Legacy session recovery — the spec's 404 after eviction or a daemon restart, a 503 from a * superseded (lame-duck) daemon, a network error because the daemon died, or the standalone * GET stream failing for any of those reasons — always takes the same path: re-ensure the * daemon (it may have been replaced by a newer one on another port), re-initialize a fresh * session with the cached initialize, re-arm subscriptions, and drain the queue. The client * never notices an eviction, a daemon restart, or a version upgrade. Recovery is triggered * PROACTIVELY from the GET stream's failure (not only from the client's next frame) so that * server-push continuity resumes promptly after a migration. Modern traffic has no session: * recovery replaces only the upstream HTTP transport, fails ambiguous ordinary in-flight work, * reopens idempotent `subscriptions/listen` streams, and forwards later stateless requests * without inventing initialize or session state. */ export interface RunShimOptions { /** Entry file spawned with --daemon-run when no daemon is running (the shim's own bundle). */ bundlePath: string; port?: number; } export declare function runShim(options: RunShimOptions): Promise; //# sourceMappingURL=shim.d.ts.map