/** * Health Error Propagation, HealthStoreWiring * * Wires together the RuntimeHealthAggregator, CascadeEngine, and RuntimeEventBus * to form a complete error-propagation pipeline. When a domain health status * changes, the wiring evaluates cascade rules and applies their effects. * * Lifecycle: * 1. Call `start()` to subscribe to aggregator health changes. * 2. Call `evaluateDomain()` to push a domain health update and trigger cascades. * 3. Call `stop()` to unsubscribe and release all listeners. * * @module health/wiring */ import type { HealthDomain, HealthStatus } from './types.js'; import type { RuntimeHealthAggregator } from './aggregator.js'; import type { CascadeEngine } from './cascade-engine.js'; import type { RuntimeEventBus } from '../events/index.js'; /** * Wires the health aggregator, cascade engine, and event bus together. * * Orchestrates the full error-propagation pipeline: * domain health change → cascade evaluation → effect application → event emission. */ export declare class HealthStoreWiring { private readonly aggregator; private readonly cascadeEngine; private readonly eventBus; private unsubscribe; /** * @param aggregator - Tracks per-domain health; source of health change events. * @param cascadeEngine - Evaluates declarative cascade rules against domain health. * @param eventBus - Receives CASCADE_APPLIED and synthetic domain events. */ constructor(aggregator: RuntimeHealthAggregator, cascadeEngine: CascadeEngine, eventBus: RuntimeEventBus); /** * Start listening to aggregator health changes. * * When any domain health changes (detected via aggregator subscribers), * the cascade engine is not automatically re-evaluated for subscriber-driven * changes, callers should use `evaluateDomain()` for explicit cascade evaluation. * * Calling `start()` on an already-started wiring replaces the existing * subscription without leaking the previous one. */ start(): void; /** * Stop listening to aggregator health changes and release all resources. * * Safe to call multiple times, subsequent calls are no-ops. */ stop(): void; /** * Update a domain's health status and evaluate cascade rules. * * Pipeline: * 1. Update the domain health in the aggregator. * 2. Evaluate cascade rules for the new domain + status. * 3. Apply all actionable cascade effects via effect handlers. * Pending-recovery effects are NOT applied, they await recovery exhaustion. * * @param domain - The domain whose health has changed. * @param status - The new health status for the domain. * @param sourceContext - Optional context identifying the triggering entity * (e.g. `{ pluginId: 'my-plugin' }`). Propagated into CascadeResult. */ evaluateDomain(domain: HealthDomain, status: HealthStatus, sourceContext?: Record): void; } //# sourceMappingURL=wiring.d.ts.map