import type { Invoke, JsonValue } from "./protocol.js"; import type { ServeOptions } from "./serve.js"; export interface NativeEmit { native(event: JsonValue): void; text(chunk: string): void; } export type NativeHandler = (invoke: Invoke, emit: NativeEmit) => Promise | string | void; export interface NativeServeInfo { framework: string; sdkName?: string | null; /** Installed SDK version for the hello handshake. When OMITTED (the * template default), it is resolved at runtime from `sdkName`'s installed * package.json — works for unbundled workers with a real node_modules; * degrades to null inside a self-contained bundle (nothing to resolve). */ sdkVersion?: string | null; } /** * Resolve `pkgName`'s installed version by walking up from its resolved main * entry (a `require.resolve(pkg + "/package.json")` throws * ERR_PACKAGE_PATH_NOT_EXPORTED for SDKs whose exports map omits the * subpath — the claude/openai SDKs both do). Never throws: null when the * package can't be resolved (bundled worker, absent dep). */ export declare function resolveInstalledVersion(pkgName: string): string | null; export declare function serveNativeOn(handler: NativeHandler, info: NativeServeInfo, opts: ServeOptions): Promise; /** The public entry: wire stdin (fd 0) + an fd-3 Writable, then run the loop. */ export declare function serveNative(handler: NativeHandler, info: NativeServeInfo, opts?: { idleMs?: number; }): Promise; //# sourceMappingURL=serve-native.d.ts.map