import { spawnSync, type ChildProcess } from "node:child_process"; import { spawnProcess } from "@bytetrue/server"; export interface DaemonStartOptions { port?: string; listen?: string; home?: string; foreground?: boolean; relay?: boolean; relayUseTls?: boolean; mcp?: boolean; injectMcp?: boolean; hostnames?: string; } export interface LocalDaemonPidInfo { pid: number; startedAt?: string; hostname?: string; uid?: number; listen?: string; desktopManaged?: boolean; } export interface LocalDaemonState { home: string; listen: string; relayEnabled: boolean; relayEndpoint: string; relayUseTls: boolean; relayPublicUseTls: boolean; logPath: string; pidPath: string; pidInfo: LocalDaemonPidInfo | null; running: boolean; stalePidFile: boolean; } export interface DetachedStartResult { pid: number | null; logPath: string; } export interface StopLocalDaemonOptions { home?: string; timeoutMs?: number; killTimeoutMs?: number; force?: boolean; } export interface StopLocalDaemonResult { action: "stopped" | "not_running"; home: string; pid: number | null; forced: boolean; message: string; } export interface DetachedDaemonProcess extends Pick { } export interface ForegroundDaemonProcessResult { status: number | null; error?: Error; } export interface DaemonLaunchRuntime { resolveRunnerEntry(): string; resolveHome(env: NodeJS.ProcessEnv): string; spawnDetached(command: string, args: string[], options: Parameters[2]): DetachedDaemonProcess; spawnForeground(command: string, args: string[], options: Parameters[2]): ForegroundDaemonProcessResult; } export declare const DEFAULT_STOP_TIMEOUT_MS = 15000; export declare const DEFAULT_KILL_TIMEOUT_MS = 3000; export declare function resolveLocalPaseoHome(home?: string): string; export declare function resolveTcpHostFromListen(listen: string): string | null; export declare function resolveLocalDaemonState(options?: { home?: string; }): LocalDaemonState; export declare function tailDaemonLog(home?: string, lines?: number): string | null; export declare function startLocalDaemonDetached(options: DaemonStartOptions, runtime?: DaemonLaunchRuntime): Promise; export declare function startLocalDaemonForeground(options: DaemonStartOptions, runtime?: DaemonLaunchRuntime): number; export declare function stopLocalDaemon(options?: StopLocalDaemonOptions): Promise; //# sourceMappingURL=local-daemon.d.ts.map