/** * Fastify route: `GET /health`. * * Returns a three-state readiness signal (`starting` | `ok` | `draining`) * suitable for load-balancer / Kubernetes liveness and readiness probes. * Also exposes per-runtime signal-queue depth for capacity planning. * * HTTP status: * - `200` when `status === "ok"`. * - `503` when `status === "starting"` or `"draining"` — load balancer * should stop routing new requests but the process is still alive. */ import type { FastifyInstance } from "fastify"; import type { Readiness } from "../readiness.js"; import type { RuntimeHandle } from "../../runtime/run.js"; /** * Dependencies injected into the `/health` route at registration time. */ export interface HealthRouteDeps { /** Live runtime handles maintained by the plugin, keyed by lowercased address. */ runtimeHandles: Map; /** Subset of `ApiConfig` needed for the response body. */ apiConfig: { host: string; port: number; }; /** * Three-state readiness flag. * S5 (lifecycle) flips it to `"ok"` after the server binds and to * `"draining"` during graceful shutdown. */ readiness: Readiness; /** * Plugin version string (read from `openclaw.plugin.json` at boot). * Included in the response so callers can correlate logs with deployments. */ version: string; /** Unix epoch ms timestamp recorded when `createApi()` was called. */ bootedAt: number; } /** * Register `GET /health` on the given Fastify instance. * * Response is never cached (`Cache-Control: no-store`). The shape is stable * across minor versions — callers may rely on `status`, `runtimes.count`, and * `runtimes.items[].signalQueueDepth` being present whenever the server is * reachable. * * @param fastify Fastify instance to register the route on. * @param deps Route dependencies injected at plugin start. */ export declare function registerHealthRoute(fastify: FastifyInstance, deps: HealthRouteDeps): void; //# sourceMappingURL=health.d.ts.map