/** * owner-alert.ts, reaching the owner when the thing that broke is a channel. * * The ordinary notice path takes a binding and sends on it. That is not enough * for an alert whose SUBJECT is a channel failing, because the obvious binding * to use is the one on the surface that just failed. Two facts from the * incident this exists for decide the ordering: * * 1. Inbound and outbound fail independently. Telegram's sends worked all day * while its receives were being dropped. So the failing surface's own * conversation is still the FIRST choice, it is where the owner is already * looking, and it usually still works. * 2. But it might not. So a refusal is not the end: the alert falls back to the * most recently used conversation on any OTHER surface, which is what "ntfy * exists as a fallback" means in practice without naming ntfy specifically, * whatever the owner actually has connected and has used most recently. * * Never silent: if nothing accepted it, that is logged at error with every * refusal reason, because an alert nobody received is the same failure one * level up. */ import type { AutomationRouteBinding } from '../automation/routes.js'; import type { RouteBindingManager } from '../channels/route-manager.js'; import type { ChannelSurface } from '../channels/types.js'; import type { DaemonSurfaceDeliveryHelper } from './surface-delivery.js'; import { ChannelIngressAlarm } from '../channels/ingress-alarm.js'; /** * THE per-surface ingress alarm for a daemon: one instance shared by every * inbound path there is, the Telegram poller, the shared webhook seam in * `ChannelPluginRegistry` (which covers the eleven webhook-delivered surfaces * at a stroke), the three streaming surfaces in * `ChannelProviderRuntimeManager`, and the two detached slash-command paths. * * One instance, because "have I already told the owner Telegram is failing" is a * question about the SURFACE, not about which of those mechanisms noticed. */ export declare function createChannelIngressAlarm(routeBindings: RouteBindingManager, delivery: Pick): ChannelIngressAlarm; /** * The conversations to try, in order: the failing surface's own newest first, * then every other surface's, newest first. * * `preferred` is null when the alert is not ABOUT a channel, the daemon * failing to update itself, for instance. There is no surface to try first * then, so the order is simply newest-used first, which is the same * "best available proxy for works" the rest of this file runs on. */ export declare function orderOwnerAlertRoutes(bindings: readonly AutomationRouteBinding[], preferred: ChannelSurface | null): AutomationRouteBinding[]; /** * Put one line in front of the owner, trying conversations until one accepts. * * Returns the binding it was delivered on, or null when nothing took it. */ export declare function deliverOwnerAlert(routeBindings: RouteBindingManager, delivery: Pick, preferred: ChannelSurface | null, text: string): Promise; //# sourceMappingURL=owner-alert.d.ts.map