/** * The aggregate device accessor spanning every registered `DeviceSource` * (design.md D2; tasks 6.13, 6.13a–d). * * Exposed as `Engine.devices` — always present, never a `ServicePlugin`, and * never a registration point for a caller-supplied source: the source set is * fixed at five (Zigbee, Zigbee groups, Shelly, Nanoleaf, state toggles), * constructed and owned entirely by `createEngine()`. `DeviceSource` itself * is exported only for inspection and testing. * * Takes one dependency beyond its sources: `DeviceVisibility`, used to stamp * `hidden` onto every descriptor it yields (design.md D8) — the aggregate is * the one place all three delivery paths (`list()`, `get()`, and * subscription delivery via `notify()`) converge, so stamping here is the * only way to guarantee no consumer ever sees a descriptor with `hidden` * unset. `DeviceVisibility` itself depends only on `StateManager`, so this * stays acyclic. */ import type { Logger } from "pino"; import type { DeviceVisibility } from "../device-visibility.js"; import type { DeviceChangeListener, DeviceCommandOutcome, DeviceDescriptor, DeviceSource } from "./device-source.js"; /** Availability of one registered source, as reported by the aggregate. */ export interface DeviceSourceStatus { id: string; available: boolean; } export declare class AggregateDeviceSource { private readonly visibility; private readonly logger; private readonly byId; private readonly started; private readonly listeners; private readonly unsubscribers; private readonly allSources; constructor(sources: DeviceSource[], visibility: DeviceVisibility, logger: Logger); /** * Start every source. A source whose backing service or configuration is * absent, or which throws while starting, is logged and left out of the * running set without failing the others or this call. */ start(): Promise; /** Stop every source that was successfully started, in the same order. */ stop(): Promise; /** * Enumerate every device from every available source — total enumeration, * including hidden devices (design.md D9). This is the enumeration used * to reconcile which devices exist: appearances, disappearances, and room * membership. Never fails when a source is unavailable. */ list(): DeviceDescriptor[]; /** * Enumerate every visible device — the same set as {@link list}, minus * hidden devices (design.md D9). For consumers that present devices to a * person and take no part in reconciliation, such as the HomeKit bridge. */ listVisible(): DeviceDescriptor[]; /** Look up one device by qualified identifier. */ get(qualifiedId: string): DeviceDescriptor | undefined; /** Report which sources exist and whether each is currently available. */ sources(): DeviceSourceStatus[]; /** Dispatch a command to the device named by a qualified identifier. */ command(qualifiedId: string, properties: Record): Promise; /** Subscribe to device changes across every source. Returns an unsubscribe function. */ subscribe(listener: DeviceChangeListener): () => void; private notify; /** Stamps `hidden` onto a descriptor from the visibility store (design.md D8). */ private stamp; } //# sourceMappingURL=aggregate.d.ts.map