import { spawn } from "node:child_process";
//#region packages/server/src/auth.d.ts
interface TokenOptions {
  tokenDir?: string;
}
/**
 * Read token from ~/.aikit/token.
 */
declare function readToken(options?: TokenOptions): string | undefined;
//#endregion
//#region packages/server/src/proxy.d.ts
interface ProxyOptions {
  port?: number;
  autoStart?: boolean;
}
interface ProxyRuntime {
  input: NodeJS.ReadableStream;
  output: NodeJS.WritableStream;
  error: NodeJS.WritableStream;
  fetchImpl: typeof fetch;
  spawnImpl: typeof spawn;
  readTokenImpl: typeof readToken;
  sleep: (ms: number) => Promise<void>;
}
/**
 * Run the stdio-to-HTTP proxy.
 * Reads JSON-RPC from stdin, POSTs to the HTTP daemon, and writes responses to stdout.
 */
declare function runProxy(options?: ProxyOptions, runtimeOverrides?: Partial<ProxyRuntime>): Promise<void>;
declare function isDaemonAlive(baseUrl: string, fetchImpl?: typeof fetch): Promise<boolean>;
//#endregion
export { ProxyOptions, ProxyRuntime, isDaemonAlive, runProxy };