import { type ChatDaemonCommandBindInput, type ChatDaemonCommandOutcome } from "./chat-daemon-command-channel"; import { type ChatDaemonKind, renewChatDaemonHeartbeat } from "./chat-daemon-control"; import { type ChatDaemonRuntimeConfig } from "./chat-daemon-runtime"; export interface ChatDaemonRuntimeHandle { start(): Promise; stop(): Promise; transportHealthy?(): boolean; /** Executes operator commands that must run inside the owning daemon. */ bindExistingRoot?(request: ChatDaemonCommandBindInput): Promise; } export interface RunChatDaemonInternalDeps { processPid?: number; pidAlive?: (pid: number) => boolean; pidIncarnation?: (pid: number) => string | undefined; createRuntime?: (input: { kind: ChatDaemonKind; agentDir: string; config: ChatDaemonConfig; }) => Promise | ChatDaemonRuntimeHandle; renewHeartbeat?: (input: Parameters[0]) => Promise; setInterval?: typeof setInterval; clearInterval?: typeof clearInterval; } export type ChatDaemonConfig = ChatDaemonRuntimeConfig; /** Hidden worker entrypoint. It owns only lock/state/control lifecycle; transport creation remains injectable. */ export declare function runChatDaemonInternal(kind: ChatDaemonKind, argv: string[], deps?: RunChatDaemonInternalDeps): Promise;