/**
 * Chat-daemon lifecycle — start / stop / status (v0.7.1 Phase A).
 *
 * The daemon owns the single long-poll connection per chat platform so
 * multiple Claude Code projects sharing the same machine can run their
 * own opensquid MCP servers without colliding on the bot token (Telegram
 * returns 409 Conflict when two consumers long-poll the same token —
 * the v0.7 cause of "last-connected wins" behavior).
 *
 * Lifecycle is single-instance per machine: PID file at
 * ~/.opensquid/chat-daemon.pid, log at ~/.opensquid/chat-daemon.log.
 * A `start` call against a running daemon is a no-op (idempotent);
 * `stop` is also idempotent. `status` is read-only.
 *
 * Outbound RPC (Unix socket) lands in Phase B; routing config + inbox
 * write-out in Phase C; auto-spawn from MCP server in Phase D.
 */
export interface DaemonPaths {
    pidFile: string;
    logFile: string;
    sockFile: string;
}
export declare function daemonPaths(dataRoot?: string): DaemonPaths;
export type DaemonStatus = {
    running: true;
    pid: number;
    uptime_ms: number | null;
} | {
    running: false;
    stale_pid?: number;
};
/**
 * Read the pidfile and check whether the recorded process is alive.
 * A pidfile that points at a dead pid is treated as not-running (the
 * caller should clean it up if they want; status itself is read-only).
 */
export declare function status(dataRoot?: string): Promise<DaemonStatus>;
/**
 * Start the daemon by spawning a detached child that runs
 * `node dist/index.js chat-daemon-worker` (the actual long-poll loop
 * lives in worker.ts). Returns immediately once the child has either
 * forked successfully or failed.
 *
 * Idempotent: a start against an already-running daemon returns
 * `{ already_running: true, pid }` without launching a second process.
 *
 * Stale pidfile handling: if the pidfile points at a dead pid, it's
 * silently removed so this call can succeed.
 */
export declare function startDaemon(options?: {
    dataRoot?: string;
    nodeBin?: string;
    entrypoint?: string;
}): Promise<{
    already_running: boolean;
    pid: number;
}>;
/**
 * Stop a running daemon by sending SIGTERM, then waiting briefly for
 * the process to exit and the pidfile to disappear. Falls back to
 * SIGKILL after the grace period. Idempotent — a stop against a
 * not-running daemon returns `{ stopped: false }` without error.
 */
export declare function stopDaemon(options?: {
    dataRoot?: string;
    graceMs?: number;
}): Promise<{
    stopped: boolean;
    pid?: number;
}>;
//# sourceMappingURL=lifecycle.d.ts.map