/** * `gjc daemon` command handler. * * Generic over the static built-in daemon controller map: lists/inspects * daemons and drives cooperative stop/reload. Telegram is the only kind today. */ import { Settings } from "../config/settings"; import type { BuiltInDaemonController, DaemonKind } from "../daemon/control-types"; export type DaemonCliAction = "list" | "status" | "stop" | "restart"; export type DaemonInternalCliAction = "discord-internal" | "slack-internal"; export type DaemonCommandAction = DaemonCliAction | DaemonInternalCliAction; export declare class UnknownDaemonKindError extends Error { readonly kinds: readonly string[]; readonly knownKinds: readonly DaemonKind[]; constructor(kinds: readonly string[], knownKinds: readonly DaemonKind[]); } export declare function isDaemonInternalAction(action: DaemonCommandAction): action is DaemonInternalCliAction; export interface DaemonCommandArgs { action: DaemonCommandAction; kinds: DaemonKind[]; all: boolean; json: boolean; force: boolean; gracefulTimeoutMs?: number; killTimeoutMs?: number; spawnIfStopped?: boolean; allowDisabledNoop?: boolean; smoke?: boolean; ownerId?: string; agentDir?: string; /** Show runtime detail and the full roots list in human output. */ verbose?: boolean; } export interface DaemonCommandDeps { settings?: Settings; controllers?: BuiltInDaemonController[]; setExitCode?: (code: number) => void; } export declare function parseDaemonArgs(argv: string[]): DaemonCommandArgs | undefined; export declare function runDaemonCommand(cmd: DaemonCommandArgs, deps?: DaemonCommandDeps): Promise;