@camstack/system 1.2.55 → 1.2.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  2. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  3. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/alerts/alerts.addon.js +1 -1
  6. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  7. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  8. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  9. package/dist/builtins/console-logging/index.js +1 -1
  10. package/dist/builtins/console-logging/index.mjs +1 -1
  11. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  12. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  13. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  14. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  15. package/dist/builtins/doorbell/binding-mirror.d.ts +50 -0
  16. package/dist/builtins/doorbell/trigger-engine.d.ts +85 -8
  17. package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +53 -11
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.js +243 -42
  19. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +243 -42
  20. package/dist/builtins/hub-forwarder/index.js +1 -1
  21. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  22. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  23. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  24. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  25. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  26. package/dist/builtins/local-network/local-network.addon.js +1 -1
  27. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  28. package/dist/builtins/loki-logging/index.js +1 -1
  29. package/dist/builtins/loki-logging/index.mjs +1 -1
  30. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  31. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  32. package/dist/builtins/platform-probe/index.js +1 -1
  33. package/dist/builtins/platform-probe/index.mjs +1 -1
  34. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  35. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  36. package/dist/builtins/snapshot/index.js +1 -1
  37. package/dist/builtins/snapshot/index.mjs +1 -1
  38. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  39. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  40. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  41. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  42. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  43. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  44. package/dist/builtins/system-config/system-config.addon.js +1 -1
  45. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  46. package/dist/builtins/winston-logging/index.js +1 -1
  47. package/dist/builtins/winston-logging/index.mjs +1 -1
  48. package/dist/{dist-CblJsHb-.js → dist-BupxnZOi.js} +66 -14
  49. package/dist/{dist-BOpRqInW.mjs → dist-DhL_zGRT.mjs} +66 -14
  50. package/dist/index.js +1 -1
  51. package/dist/index.mjs +1 -1
  52. package/package.json +1 -1
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CblJsHb-.js");
6
+ const require_dist = require("../../dist-BupxnZOi.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { Lt as EventCategory, dt as BaseAddon, m as addonPagesCapability, ut as errMsg } from "../../dist-BOpRqInW.mjs";
1
+ import { Lt as EventCategory, dt as BaseAddon, m as addonPagesCapability, ut as errMsg } from "../../dist-DhL_zGRT.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import * as fs from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CblJsHb-.js");
6
+ const require_dist = require("../../dist-BupxnZOi.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { Lt as EventCategory, dt as BaseAddon, g as addonWidgetsCapability, ut as errMsg } from "../../dist-BOpRqInW.mjs";
1
+ import { Lt as EventCategory, dt as BaseAddon, g as addonWidgetsCapability, ut as errMsg } from "../../dist-DhL_zGRT.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import * as fs from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CblJsHb-.js");
6
+ const require_dist = require("../../dist-BupxnZOi.js");
7
7
  //#region src/builtins/alerts/prune-policy.ts
8
8
  /**
9
9
  * Ids older than `cutoffMs`, oldest first.
@@ -1,4 +1,4 @@
1
- import { Lt as EventCategory, _ as alertsCapability, dt as BaseAddon, n as AlertSchema, ut as errMsg, wt as createEvent } from "../../dist-BOpRqInW.mjs";
1
+ import { Lt as EventCategory, _ as alertsCapability, dt as BaseAddon, n as AlertSchema, ut as errMsg, wt as createEvent } from "../../dist-DhL_zGRT.mjs";
2
2
  //#region src/builtins/alerts/prune-policy.ts
3
3
  /**
4
4
  * Ids older than `cutoffMs`, oldest first.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CblJsHb-.js");
6
+ const require_dist = require("../../dist-BupxnZOi.js");
7
7
  let node_fs = require("node:fs");
8
8
  let node_fs$1 = require_chunk.__toESM(node_fs, 1);
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { Lt as EventCategory, b as backupCapability, dt as BaseAddon } from "../../dist-BOpRqInW.mjs";
1
+ import { Lt as EventCategory, b as backupCapability, dt as BaseAddon } from "../../dist-DhL_zGRT.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import Kt from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CblJsHb-.js");
6
+ const require_dist = require("../../dist-BupxnZOi.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  //#region src/builtins/console-logging/console-destination.ts
9
9
  var LEVEL_RANK = {
@@ -1,4 +1,4 @@
1
- import { U as logDestinationCapability, dt as BaseAddon } from "../../dist-BOpRqInW.mjs";
1
+ import { U as logDestinationCapability, dt as BaseAddon } from "../../dist-DhL_zGRT.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  //#region src/builtins/console-logging/console-destination.ts
4
4
  var LEVEL_RANK = {
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-CblJsHb-.js");
3
+ const require_dist = require("../../dist-BupxnZOi.js");
4
4
  let node_path = require("node:path");
5
5
  node_path = require_chunk.__toESM(node_path);
6
6
  let node_crypto = require("node:crypto");
@@ -1,5 +1,5 @@
1
1
  import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
2
- import { S as coreBlocksCapability, dt as BaseAddon, o as CoreBlockSchema } from "../../dist-BOpRqInW.mjs";
2
+ import { S as coreBlocksCapability, dt as BaseAddon, o as CoreBlockSchema } from "../../dist-DhL_zGRT.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import * as fs from "node:fs/promises";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CblJsHb-.js");
6
+ const require_dist = require("../../dist-BupxnZOi.js");
7
7
  let _camstack_types_node = require("@camstack/types/node");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { $ as setByPath, A as enumerateItemArrayFields, D as deviceStatusCapability, E as deviceStateCapability, F as getByPath, It as sleep, Lt as EventCategory, M as evaluateLinkExpression, T as deviceManagerCapability, Y as parseStreamParamsFormPatch, _t as DeviceType, a as CAP_NAMES_WITH_STATUS, at as toExpressionValue, bt as WELL_KNOWN_TAB_MAP, dt as BaseAddon, gt as DeviceRole, ht as DeviceFeature, j as enumerateSchemaFields, kt as isDeviceConfigCap, q as normalizeUnit, s as DeviceStatusSchema, st as validateExpressionSource, t as ALL_CAPABILITY_DEFINITIONS, u as STREAM_PROFILE_META, ut as errMsg, v as applyTransform, x as buildStreamParamsConfigSchema } from "../../dist-BOpRqInW.mjs";
1
+ import { $ as setByPath, A as enumerateItemArrayFields, D as deviceStatusCapability, E as deviceStateCapability, F as getByPath, It as sleep, Lt as EventCategory, M as evaluateLinkExpression, T as deviceManagerCapability, Y as parseStreamParamsFormPatch, _t as DeviceType, a as CAP_NAMES_WITH_STATUS, at as toExpressionValue, bt as WELL_KNOWN_TAB_MAP, dt as BaseAddon, gt as DeviceRole, ht as DeviceFeature, j as enumerateSchemaFields, kt as isDeviceConfigCap, q as normalizeUnit, s as DeviceStatusSchema, st as validateExpressionSource, t as ALL_CAPABILITY_DEFINITIONS, u as STREAM_PROFILE_META, ut as errMsg, v as applyTransform, x as buildStreamParamsConfigSchema } from "../../dist-DhL_zGRT.mjs";
2
2
  import { canonicalDeviceFingerprint } from "@camstack/types/node";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The virtual-doorbell wrapper's in-memory mirror of ONE durable fact per
3
+ * camera: is this wrapper still the active `doorbell` binding for it?
4
+ *
5
+ * WHY A MIRROR AND NOT A READ. A doorbell press is a one-shot event: there
6
+ * is no retry, no reconcile, nothing downstream that can notice it went
7
+ * missing. The wrapper used to re-derive the binding on the ring path via
8
+ * `deviceManager.getBindings` and treat ANY answer that omitted its own
9
+ * activation as "the operator unbound this". On 2026-08-04/05 camera 615
10
+ * rang zero times out of three real presses: the binding was persisted (a
11
+ * same-day backup taken before the presses proves it, and the same process
12
+ * later returned it correctly to a tRPC query), but the store answered
13
+ * transiently without it — `getBindings` reads the device-manager addon
14
+ * store, which is exactly the surface that can silently answer `{}` (D44,
15
+ * `addon-registry.service.ts`). Three presses, three drops, at `debug`.
16
+ *
17
+ * WHY CORROBORATION AND NOT A BETTER DISCRIMINATOR. There isn't one. A
18
+ * genuinely unbound pure-wrapper cap and a store answering from an empty
19
+ * snapshot produce the SAME `getBindings` response — no `doorbell` entry,
20
+ * with the camera's native entries (snapshot, motion, …) still present in
21
+ * both cases because those come from the capability registry, not the
22
+ * store. The response cannot be graded. What CAN be graded is repetition: a
23
+ * real unbind is permanent and every later read agrees, a store blip does
24
+ * not survive the next read. So a negative read ARMS the revocation and a
25
+ * second consecutive negative applies it.
26
+ *
27
+ * ERRING. `undefined` (never read) and `unbind-pending` both ring. Reaching
28
+ * the ring path at all means the camera has a configured trigger source,
29
+ * and a source can only be configured through this wrapper's own
30
+ * binding-gated settings surface — so a configured source is itself
31
+ * evidence the wrapper was bound. The cost of erring open is a spurious
32
+ * ring on a camera the operator unbound but left configured, for at most
33
+ * two reload cycles. The cost of erring closed is the press.
34
+ */
35
+ /**
36
+ * `bound` — a read saw the wrapper's activation.
37
+ * `unbind-pending` — one read did not; NOT yet believed, still rings.
38
+ * `unbound` — two consecutive reads did not; believed, silences the camera.
39
+ */
40
+ export type DoorbellBindingState = 'bound' | 'unbind-pending' | 'unbound';
41
+ /**
42
+ * Fold one SUCCESSFUL bindings read into the mirror. A read that failed must
43
+ * never reach this function — an unanswerable store carries no information
44
+ * and must leave the mirror exactly as it was.
45
+ */
46
+ export declare function nextBindingState(previous: DoorbellBindingState | undefined, boundNow: boolean): DoorbellBindingState;
47
+ /** May a ring proceed? Only a corroborated unbind stops one. */
48
+ export declare function allowsRing(state: DoorbellBindingState | undefined): boolean;
49
+ /** True only when a read has positively confirmed the binding. */
50
+ export declare function hasConfirmedBinding(state: DoorbellBindingState | undefined): boolean;
@@ -19,6 +19,19 @@
19
19
  * reconnect is not a doorbell press.
20
20
  */
21
21
  export declare const SOURCE_CAP_ACTIVE_FIELD: Readonly<Record<string, string>>;
22
+ /**
23
+ * The same caps → the slice field carrying the ms-epoch timestamp of the
24
+ * last transition. Every source cap MUST appear here (guarded by a spec):
25
+ * without a transition timestamp the engine cannot tell a genuine press
26
+ * from a boot-time hydration when the FIRST slice it ever sees is already
27
+ * active, and errs towards silence — swallowing the press.
28
+ *
29
+ * These timestamps are UPSTREAM ones, not ingest ones: the Home Assistant
30
+ * provider derives them from `state.last_changed`, so they survive our own
31
+ * restarts and correctly read as "hours ago" for a state that has been
32
+ * active for hours. `motion` names its rise timestamp `lastDetectedAt`.
33
+ */
34
+ export declare const SOURCE_CAP_CHANGED_AT_FIELD: Readonly<Record<string, string>>;
22
35
  /** Cap names whose presence in a device's bindings qualify it as a source. */
23
36
  export declare const SOURCE_CAPS: readonly string[];
24
37
  /**
@@ -41,6 +54,45 @@ export declare const SOURCE_CAPS: readonly string[];
41
54
  export declare const SOURCE_DEVICE_TYPES: readonly string[];
42
55
  /** True when a cap is a recognised binary/switch doorbell source. */
43
56
  export declare function isSourceCap(capName: string): boolean;
57
+ /**
58
+ * Why a slice produced no ring. Every value names a DROPPED evaluation, so
59
+ * the addon can log the ones that may have cost a real press instead of
60
+ * returning an empty array that reads as "nothing happened".
61
+ */
62
+ export type DoorbellIgnoreReason =
63
+ /** Not a recognised binary/switch source cap. */
64
+ 'unknown-cap'
65
+ /** Recognised cap, but its active field is missing or not a boolean. */
66
+ | 'non-boolean-value'
67
+ /** First sighting, INACTIVE — nothing can have been lost. */
68
+ | 'baseline-seeded-inactive'
69
+ /** First sighting, ALREADY ACTIVE, and we could not prove it is a fresh
70
+ * transition. A genuine press MAY have been swallowed here. */
71
+ | 'baseline-seeded-stale-active'
72
+ /** Re-emission carrying the same binary value. */
73
+ | 'no-change'
74
+ /** The falling edge — switch-off / contact-close never rings. */
75
+ | 'falling-edge'
76
+ /** A real rise, but no camera is wired to this source. */
77
+ | 'no-assignment';
78
+ /**
79
+ * The outcome of feeding one slice. `fired` is what rings; `debounced` and
80
+ * `ignored` exist so that no suppression is invisible.
81
+ */
82
+ export interface DoorbellTriggerResult {
83
+ /** Cameras to ring now. */
84
+ readonly fired: readonly number[];
85
+ /** Cameras that WOULD have rung but are inside their debounce window. */
86
+ readonly debounced: readonly number[];
87
+ /** Set when the slice carried no ring at all; null once a rise was matched. */
88
+ readonly ignored: DoorbellIgnoreReason | null;
89
+ }
90
+ /**
91
+ * How recent a source's own transition timestamp must be for a FIRST
92
+ * sighting that is already active to count as a genuine press rather than a
93
+ * hydration of long-standing state.
94
+ */
95
+ export declare const DEFAULT_FIRST_SIGHTING_FRESHNESS_MS = 30000;
44
96
  /**
45
97
  * One camera's virtual-doorbell wiring: a source device that rings it. A
46
98
  * camera with several sources produces several assignments (one per source).
@@ -57,9 +109,25 @@ export declare const DEFAULT_DEBOUNCE_MS = 2000;
57
109
  *
58
110
  * Tracks the last observed binary value per (sourceDevice, cap) so a
59
111
  * `DeviceStateChanged` re-emission (the slice's `lastChangedAt` moves while
60
- * the binary value does not) never double-fires, and the FIRST observation
61
- * after boot only seeds the baseline — a state hydration at startup must not
62
- * ring anybody's doorbell.
112
+ * the binary value does not) never double-fires.
113
+ *
114
+ * FIRST SIGHTINGS. Seeding the baseline and never firing was wrong for the
115
+ * one case that matters: a momentary source (a button wired to a Home
116
+ * Assistant switch) is NOT re-pushed in its resting `off` state after a hub
117
+ * restart, so after every restart — several a day — the first slice the
118
+ * engine ever sees for it is the PRESS ITSELF, already active. That press
119
+ * was eaten whole; a real one on 2026-08-05 left no trace anywhere.
120
+ *
121
+ * The discriminator is the source's own transition timestamp. A first
122
+ * sighting that is already active rings only when its transition can be
123
+ * proved to have happened AFTER this engine started watching AND within
124
+ * `firstSightingFreshnessMs`. Both halves earn their keep: freshness alone
125
+ * would ring on a boot hydration of a state that flipped seconds before the
126
+ * restart, and "after we started" alone would ring, on a long-lived
127
+ * process, for a source adopted today whose state flipped yesterday. An
128
+ * undateable first sighting (no timestamp, or a zero sentinel) does NOT
129
+ * ring — the ambiguous case errs towards silence, but reports
130
+ * `baseline-seeded-stale-active` so the caller can say so out loud.
63
131
  */
64
132
  export declare class DoorbellTriggerEngine {
65
133
  private assignments;
@@ -69,9 +137,13 @@ export declare class DoorbellTriggerEngine {
69
137
  private readonly lastFiredAt;
70
138
  private readonly debounceMs;
71
139
  private readonly now;
140
+ private readonly firstSightingFreshnessMs;
141
+ /** When this engine started watching — the floor for a first-sighting rise. */
142
+ private readonly startedAt;
72
143
  constructor(options?: {
73
144
  readonly debounceMs?: number;
74
145
  readonly now?: () => number;
146
+ readonly firstSightingFreshnessMs?: number;
75
147
  });
76
148
  /** Replace the full assignment set (rebuilt whenever settings change). */
77
149
  setAssignments(assignments: readonly DoorbellAssignment[]): void;
@@ -79,11 +151,16 @@ export declare class DoorbellTriggerEngine {
79
151
  /** True when any assignment references `deviceId` as its source. */
80
152
  hasSource(deviceId: number): boolean;
81
153
  /**
82
- * Feed one `DeviceStateChanged` slice. Returns the camera ids whose
83
- * doorbell should ring (already debounced). Only a false→true rise on a
84
- * recognised source cap fires; baseline-only sightings, re-emissions, and
85
- * the falling edge return an empty array.
154
+ * Feed one `DeviceStateChanged` slice. Reports which cameras should ring,
155
+ * which were suppressed by the debounce window, and when nothing was
156
+ * matched at all WHY. Only a rise to active on a recognised source cap
157
+ * can ring; re-emissions and the falling edge never do.
158
+ */
159
+ onStateSlice(deviceId: number, capName: string, slice: Record<string, unknown>): DoorbellTriggerResult;
160
+ /**
161
+ * Can this slice PROVE its active state is a transition we would have
162
+ * witnessed had we been listening — i.e. recent, and after we started?
86
163
  */
87
- onStateSlice(deviceId: number, capName: string, slice: Record<string, unknown>): number[];
164
+ private roseAfterWeStartedWatching;
88
165
  private matchAndDebounce;
89
166
  }
@@ -2,6 +2,13 @@ import { ProviderRegistration, BaseAddon } from '@camstack/types';
2
2
  interface VirtualDoorbellAddonConfig {
3
3
  /** Per-camera debounce window (ms) against sensor chatter. */
4
4
  readonly debounceMs: number;
5
+ /**
6
+ * Reload the camera→source assignment map (and the binding mirror) at
7
+ * most this often — lazily, on trigger traffic. Covers devices/settings
8
+ * appearing after boot without a settings save, and is the cadence on
9
+ * which an unbind gets corroborated.
10
+ */
11
+ readonly assignmentsTtlMs: number;
5
12
  }
6
13
  /**
7
14
  * VirtualDoorbellAddon — WRAPPER over the `doorbell` capability.
@@ -27,28 +34,63 @@ interface VirtualDoorbellAddonConfig {
27
34
  * bumps the camera's `doorbell` runtime-state counters via the
28
35
  * standard `deviceState.setCapSlice` plumbing.
29
36
  *
30
- * Fires ONLY for cameras where the wrapper is BOUND (checked against
31
- * `deviceManager.getBindings`) and at least one source device is configured.
37
+ * Fires ONLY for cameras with at least one configured source device that
38
+ * this wrapper is BOUND to. The binding is NOT re-derived on the ring path:
39
+ * it is mirrored in memory (`binding-mirror.ts`) and refreshed on the
40
+ * assignment-reload cadence, because a fallible read must never be able to
41
+ * destroy a one-shot press.
32
42
  */
33
43
  export declare class VirtualDoorbellAddon extends BaseAddon<VirtualDoorbellAddonConfig> {
34
- private readonly engine;
44
+ private engine;
35
45
  /** Monotonic guard: assignments are reloaded lazily on trigger traffic. */
36
46
  private assignmentsLoadedAt;
37
47
  private assignmentsLoading;
48
+ /**
49
+ * Per-camera mirror of "is this wrapper still the active doorbell
50
+ * binding". Written ONLY off the ring path; read on it. See
51
+ * `binding-mirror.ts` for why a single negative read is not believed.
52
+ */
53
+ private readonly bindingMirror;
38
54
  constructor();
39
55
  protected onInitialize(): Promise<ProviderRegistration[]>;
40
56
  private handleStateChanged;
41
57
  /**
42
- * Ring the camera's virtual doorbell: verify the wrapper is BOUND to
43
- * the camera, bump the `doorbell` runtime-state counters through the
44
- * canonical `deviceState.setCapSlice` write, and emit the typed
45
- * `DoorbellOnPressed` event with the CAMERA as source — byte-shaped
46
- * like a native firmware ring so every downstream consumer (UI
47
- * toast, notifier rules, exporters) is agnostic to the origin.
58
+ * Say out loud every case where a rise did NOT become a ring. Silence
59
+ * reads as "never happened": three real presses on camera 615 produced
60
+ * zero operator-visible lines because the drop logged at `debug`.
61
+ */
62
+ private logSuppressions;
63
+ /**
64
+ * Ring the camera's virtual doorbell: bump the `doorbell` runtime-state
65
+ * counters through the canonical `deviceState.setCapSlice` write, and
66
+ * emit the typed `DoorbellOnPressed` event with the CAMERA as source —
67
+ * byte-shaped like a native firmware ring so every downstream consumer
68
+ * (UI toast, notifier rules, exporters) is agnostic to the origin.
69
+ *
70
+ * The binding gate here is a pure in-memory read. It performs NO I/O and
71
+ * cannot fail: the whole point of the mirror is that the ring path can no
72
+ * longer be talked out of ringing by a store that answered badly.
48
73
  */
49
74
  private fireDoorbell;
50
- /** True when THIS wrapper is the active `doorbell` binding for the camera. */
51
- private isWrapperBound;
75
+ /**
76
+ * Fold one bindings read for `cameraId` into the mirror. Runs on the
77
+ * assignment-reload cadence, never while firing.
78
+ *
79
+ * A read that THROWS carries no information and leaves the mirror exactly
80
+ * as it was — the previous verdict keeps standing. A read that succeeds
81
+ * but omits our activation only ARMS a revocation; `nextBindingState`
82
+ * requires a second consecutive negative before the camera goes silent,
83
+ * because a genuine unbind and a store answering from an empty snapshot
84
+ * (D44) are indistinguishable in a single response.
85
+ */
86
+ private refreshBindingMirror;
87
+ /**
88
+ * Record a binding we observed FIRST-HAND. Both callers are cap methods
89
+ * the router only reaches by resolving this wrapper for this device —
90
+ * which it can only do through the binding — so a call is direct evidence
91
+ * and outranks anything the store says.
92
+ */
93
+ private confirmBindingFromCapCall;
52
94
  /**
53
95
  * Lazily (re)build the camera→source assignment set from every
54
96
  * camera's device store. TTL-bounded so devices/settings appearing