import { type JsonLineReply } from "../subprocess/jsonl-server.js"; import type { TinyWorkerRequest, TinyWorkerResponse } from "./title-protocol.js"; export interface TinyWorkerServerOptions { /** Launch identity echoed in `pong`; clients replace a worker whose tag differs. */ tag: string; /** Idle window (nothing in flight, no request received) after which the process exits. */ idleMs: number; /** Serve one `load`/`chat`; `reply.send` reaches only the requesting client. Errors become `error` replies. */ handle(request: Extract, reply: JsonLineReply): Promise; } /** The ONNX worker's endpoint: answers `ping`/`shutdown` inline and serializes `load`/`chat` through one queue. */ export declare class TinyWorkerServer { #private; constructor(options: TinyWorkerServerOptions); /** Bind `endpoint` and serve until idle exit or `shutdown`; resolves once the socket is released. */ serve(endpoint: string): Promise; }