import type { WorkspaceContext } from '../engines/workspace-resolver.js';
import { type DaemonLockRecord } from './lock.js';
export declare const DEFAULT_DAEMON_READY_TIMEOUT_MS = 60000;
export interface DaemonHealthResponse {
    ok: boolean;
    ready?: boolean;
    pid: number;
    port: number;
    stateKey: string;
    workspaceRoot: string;
    repoRoot: string;
    dashboardUrl?: string | null;
    startedAt: number;
}
export interface DaemonStatus {
    running: boolean;
    healthy: boolean;
    stale: boolean;
    record?: DaemonLockRecord;
    health?: DaemonHealthResponse;
}
export interface DaemonStopResult {
    stopped: boolean;
    stale: boolean;
    forced: boolean;
    record?: DaemonLockRecord;
}
export interface DaemonRpcResult<T = unknown> {
    queued: boolean;
    runId?: string;
    result?: T;
}
export declare function pingDaemonHealth(record: DaemonLockRecord, timeoutMs?: number): Promise<DaemonHealthResponse>;
export declare function daemonRequest<T>(record: DaemonLockRecord, pathname: string, body?: unknown, timeoutMs?: number): Promise<T>;
export declare function ensureDaemonReady(workspace: WorkspaceContext, options?: {
    timeoutMs?: number;
    entrypoint?: string;
    spawnIfMissing?: boolean;
}): Promise<DaemonLockRecord>;
export declare function getDaemonStatus(workspace: WorkspaceContext): Promise<DaemonStatus>;
export declare function stopDaemon(workspace: WorkspaceContext, options?: {
    force?: boolean;
}): Promise<DaemonStopResult>;
