/** * What each built-in surface can be SEEN to be doing. * * Split by how the surface actually receives, because that is what decides * whether liveness is knowable at all: * * - Telegram runs a supervisor on this node, which already tracks its own mode * and the named reason it is not receiving. That supervisor's status is the * answer to "is Telegram working", and until this file existed nothing read * it, `BuiltinChannelRuntime.telegramIngressStatus()` had no caller while * the reported state was computed from the token's presence instead. * - Slack, Discord and ntfy hold a long-lived connection managed by * `ChannelProviderRuntimeManager`, which knows whether it is up and what * last broke it. * - Every other built-in surface receives by having an HTTP route registered * and waiting to be called. Nothing on this node distinguishes "the provider * is delivering" from "the provider stopped delivering", so those surfaces * report `unknown` and say that configuration is all they know. */ import type { ProviderRuntimeStatus, ProviderRuntimeSurface } from '../provider-runtime.js'; import type { TelegramIngressStatus } from '../telegram/ingress.js'; import type { ChannelAccountRecord, ChannelRuntimeObservation, ChannelStatusSnapshot, ChannelSurface } from '../types.js'; /** * Telegram's supervisor state, read as health. * * `running` is false in webhook mode by design, the supervisor runs no loop * once Telegram has been told where to POST, so mode, not the loop flag, * decides. Reading the flag alone would report a correctly armed webhook as * dead, which is the same class of wrong answer in the other direction. * * `status.lastError` is carried into every RUNNING branch, and that is the * whole point of it. A poll loop can be turning over perfectly while every * update it hands on fails to be processed, which is precisely what happened: * mode 'polling', running true, reason "long-polling", reported healthy, and * every message the owner sent was being skipped. Running is not the same * question as working, so a supervisor that is receiving but not processing now * reports `degraded` with the reason attached. */ export declare function observeTelegramRuntime(status: TelegramIngressStatus | null): ChannelRuntimeObservation; /** * A provider connection this node holds open. * * A host that wired no provider runtime at all gets `unknown`, not `dead`: the * connection is not down, it is unwatched, and those are different sentences. */ export declare function observeProviderRuntime(surface: ProviderRuntimeSurface, status: ProviderRuntimeStatus | null): ChannelRuntimeObservation; export interface BuiltinRuntimeObservers { /** The Telegram supervisor's current state, or null when it was never built. */ readonly telegramIngressStatus: () => TelegramIngressStatus | null; /** The provider connection manager's state, or null when none is wired. */ readonly providerRuntimeStatus: (surface: ProviderRuntimeSurface) => ProviderRuntimeStatus | null; } /** The live observation for one built-in surface. */ export declare function observeBuiltinRuntime(observers: BuiltinRuntimeObservers, surface: ChannelSurface): ChannelRuntimeObservation; export interface BuiltinSnapshotInput { readonly surface: ChannelSurface; readonly label: string; readonly enabled: boolean; /** The account record, read for credential presence, never for health. */ readonly account: ChannelAccountRecord; readonly runtime: ChannelRuntimeObservation; readonly metadata: Record; } /** One snapshot, built the same way for every built-in surface. */ export declare function buildBuiltinStatusSnapshot(input: BuiltinSnapshotInput): ChannelStatusSnapshot; //# sourceMappingURL=health.d.ts.map