/**
 * @module        daemonClient
 * @description   守护进程客户端，通过 Unix 域套接字与 SessionDaemon 通信
 *
 * @author        eddy
 * @organization  wykj
 * @ownership     wykj/eddy
 *
 * @created       2026-03-31
 * @updated       2026-04-03
 *
 * @role          daemon
 * @layer         daemon
 * @boundedContext session-management
 */
import type { McpServerConfig } from '@coralai/claude-code-agent';
import type { ACPSessionRecord, ACPState, ACPTool } from '@coralai/claude-code-agent';
import type { DaemonEvent } from './sessionDaemon.js';
export interface EnsureSessionOpts {
    mcpServers?: McpServerConfig[];
    extraEnv?: Record<string, string>;
}
export interface StartRunOpts {
    extraEnv?: Record<string, string>;
}
export declare class DaemonClient {
    private socketPath;
    constructor(socketPath?: string);
    /** Check if daemon is reachable. */
    isRunning(): Promise<boolean>;
    ensureSession(slot: string, tool?: ACPTool, cwd?: string, opts?: EnsureSessionOpts): Promise<ACPSessionRecord>;
    startRun(slot: string, prompt: string, tool?: ACPTool, cwd?: string, opts?: StartRunOpts): Promise<ACPSessionRecord>;
    inspect(slot?: string): Promise<ACPState>;
    stopSession(slot: string): Promise<void>;
    clearRun(slot: string): Promise<void>;
    /** Cancel the in-flight run (prompt). Session stays alive for reuse. */
    cancelRun(slot: string): Promise<void>;
    shutdown(): Promise<void>;
    /**
     * Long-lived subscription: opens socket, sends subscribeRun, yields DaemonEvent
     * frames as async iterator. Terminates when daemon closes socket (run complete)
     * or when caller breaks out of loop (cancels via iterator.return).
     *
     * Usage:
     *   for await (const evt of client.subscribeRun(slot)) {
     *     if (evt.event === 'text') ...
     *     if (evt.event === 'complete') break;
     *   }
     */
    subscribeRun(slot: string): AsyncIterable<DaemonEvent> & {
        cancel: () => void;
    };
    /** Send a single NDJSON request, wait for response. */
    private request;
}
/** Get the default daemon socket path. */
export declare function getDaemonSocketPath(): string;
//# sourceMappingURL=daemonClient.d.ts.map