import { spawn, type ChildProcess } from 'node:child_process'; export interface WebLaunchSpec { file: string; args: readonly string[]; shell: boolean; } export interface ResolveWebLaunchOptions { action?: 'on' | 'off'; argv?: readonly string[]; execArgv?: readonly string[]; execPath?: string; env?: NodeJS.ProcessEnv; platform?: NodeJS.Platform; resolveManager?: (environment?: NodeJS.ProcessEnv) => string | undefined; } export type WebLaunchResult = { ok: true; command: string; running: () => boolean; stop: () => Promise; } | { ok: false; error: Error; }; /** Verify that an argv entry belongs to the main ChatCode CLI package. */ export declare function isMainCliEntry(entry: string): boolean; /** * Prefer the launcher that owns this TUI process so `/web` uses the exact * installed/source version. Standalone TUI launches fall back to the public * command family on PATH. */ export declare function resolveWebLaunchSpec(options?: ResolveWebLaunchOptions): WebLaunchSpec | undefined; export interface LaunchWebOptions extends ResolveWebLaunchOptions { spawnImpl?: typeof spawn; onError?: (error: Error) => void; /** The main launcher prints this URL only after readiness or verified instance reuse. */ onUrl?: (url: string) => void; /** Explicit off has confirmed the server's port is closed. */ onStopped?: () => void; /** The short request or TUI-owned server has finished, including cancellation. */ onExit?: () => void; terminateImpl?: (child: ChildProcess, platform: NodeJS.Platform, force: boolean) => void; } /** Start a Web Profile whose lifetime is owned by the active TUI. */ export declare function launchWebFrontend(cwd: string, options?: LaunchWebOptions): WebLaunchResult; //# sourceMappingURL=webLauncher.d.ts.map