import type { NodeStatusDTO } from './common.js'; /** `GET /healthz` — substrate readiness probe. Versions are informational, never * a gate. Used by the provisioning ladder. */ export interface HealthDTO { ok: boolean; daemon_up: boolean; store_accessible: boolean; brokers_reconciled: boolean; } /** `GET /v1/status` — daemon status snapshot. Backs `crtr sys daemon status` * state and the `crtr canvas dashboard` header. Versions are informational. */ export interface StatusDTO { daemon_pid: number; tick_interval_ms: number; /** Node counts keyed by status. */ node_counts: Partial>; /** Bound listener addresses. `tcp` is null when the TCP listener is off. */ listeners: { socket_path: string; tcp: string | null; }; runtime_version: string; api_version: string; } /** `POST /v1/daemon/restart` — the ack for a daemon-owned handover. * * The daemon answers BEFORE it tears anything down: the caller is normally a * node's own bash tool, whose broker this handover will kill, so the ack must * be a settled tool result in that node's transcript before the SIGTERM lands. * `accepted` is therefore a promise about the future, not a completed action — * the successor daemon is spawned after `grace_ms`, and every node the * teardown interrupts is resumed by it. */ export interface DaemonRestartDTO { accepted: boolean; /** The daemon that took the request and is about to hand over. */ predecessor_pid: number; /** Its epoch id — the successor mints a new one. */ predecessor_epoch: string; /** How long the daemon waits after answering before teardown begins. */ grace_ms: number; }