import type { SKYKOIConfig } from "../config/config.js"; import type { RuntimeEnv } from "../runtime.js"; import { type HeartbeatSummary } from "../infra/heartbeat-runner.js"; export type ChannelAccountHealthSummary = { accountId: string; configured?: boolean; linked?: boolean; authAgeMs?: number | null; probe?: unknown; lastProbeAt?: number | null; [key: string]: unknown; }; export type ChannelHealthSummary = ChannelAccountHealthSummary & { accounts?: Record; }; export type KoiHeartbeatSummary = HeartbeatSummary; export type KoiHealthSummary = { koiId: string; name?: string; isDefault: boolean; heartbeat: KoiHeartbeatSummary; sessions: HealthSummary["sessions"]; }; export type HealthSummary = { /** * Convenience top-level flag for UIs (e.g. WebChat) that only need a binary * "can talk to the gateway" signal. If this payload exists, the gateway RPC * succeeded, so this is always `true`. */ ok: true; ts: number; durationMs: number; channels: Record; channelOrder: string[]; channelLabels: Record; /** Legacy: default koi heartbeat seconds (rounded). */ heartbeatSeconds: number; defaultKoiId: string; kois: KoiHealthSummary[]; sessions: { path: string; count: number; recent: Array<{ key: string; updatedAt: number | null; age: number | null; }>; }; }; export declare const formatHealthChannelLines: (summary: HealthSummary, opts?: { accountMode?: "default" | "all"; accountIdsByChannel?: Record; }) => string[]; export declare function getHealthSnapshot(params?: { timeoutMs?: number; probe?: boolean; }): Promise; export declare function healthCommand(opts: { json?: boolean; timeoutMs?: number; verbose?: boolean; config?: SKYKOIConfig; }, runtime: RuntimeEnv): Promise;