@camstack/system 1.2.304 → 1.2.306

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 (72) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/addon-utils.d.ts +1 -1
  4. package/dist/addon-utils.js +3 -1
  5. package/dist/addon-utils.mjs +2 -2
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  10. package/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  12. package/dist/builtins/autotrack/index.js +1 -1
  13. package/dist/builtins/autotrack/index.mjs +1 -1
  14. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  15. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  16. package/dist/builtins/camera-grid/index.js +1 -1
  17. package/dist/builtins/camera-grid/index.mjs +1 -1
  18. package/dist/builtins/console-logging/index.js +1 -1
  19. package/dist/builtins/console-logging/index.mjs +1 -1
  20. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  21. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  22. package/dist/builtins/device-manager/device-extension-linked-slot.d.ts +27 -0
  23. package/dist/builtins/device-manager/device-linked-devices.d.ts +55 -13
  24. package/dist/builtins/device-manager/device-manager.addon.js +324 -136
  25. package/dist/builtins/device-manager/device-manager.addon.mjs +324 -136
  26. package/dist/builtins/doorbell/binding-mirror.d.ts +37 -7
  27. package/dist/builtins/doorbell/doorbell-extension-slot.d.ts +66 -0
  28. package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +17 -36
  29. package/dist/builtins/doorbell/virtual-doorbell.addon.js +320 -124
  30. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +320 -124
  31. package/dist/builtins/hub-forwarder/index.js +1 -1
  32. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  33. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  34. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  35. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  36. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  37. package/dist/builtins/local-network/local-network.addon.js +1 -1
  38. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  39. package/dist/builtins/loki-logging/index.js +1 -1
  40. package/dist/builtins/loki-logging/index.mjs +1 -1
  41. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  42. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  43. package/dist/builtins/platform-probe/index.js +1 -1
  44. package/dist/builtins/platform-probe/index.mjs +1 -1
  45. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  46. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  47. package/dist/builtins/snapshot/index.js +1 -1
  48. package/dist/builtins/snapshot/index.mjs +1 -1
  49. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  50. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  51. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  52. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  53. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  54. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  55. package/dist/builtins/system-config/system-config.addon.js +1 -1
  56. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  57. package/dist/builtins/winston-logging/index.js +1 -1
  58. package/dist/builtins/winston-logging/index.mjs +1 -1
  59. package/dist/{child-cap-dispatch-C1c3rWaX.mjs → child-cap-dispatch-BCJjUtXV.mjs} +9 -1
  60. package/dist/{child-cap-dispatch-De5_HcvR.js → child-cap-dispatch-Be8e2cBP.js} +9 -1
  61. package/dist/{dist-Duqf80QM.mjs → dist-CLfJMMdf.mjs} +1056 -349
  62. package/dist/{dist-C571Y95Z.js → dist-vecbhDzu.js} +1079 -354
  63. package/dist/download/model-downloader.d.ts +15 -0
  64. package/dist/{event-loop-stall-monitor-GPrVvx14.mjs → event-loop-stall-monitor-EXjzIxDz.mjs} +25 -3
  65. package/dist/{event-loop-stall-monitor-CAsHdMwP.js → event-loop-stall-monitor-ey4mbofz.js} +36 -2
  66. package/dist/index.js +21 -3
  67. package/dist/index.mjs +21 -3
  68. package/dist/kernel/config-manager.d.ts +3 -1
  69. package/dist/{retired-settings-keys-0j8rNoa8.js → retired-settings-keys-Bm2p0Rot.js} +1 -1
  70. package/dist/{retired-settings-keys-CeO_dBHU.mjs → retired-settings-keys-C1ODcdnr.mjs} +1 -1
  71. package/package.json +7 -1
  72. package/dist/builtins/device-manager/device-store-sections.d.ts +0 -26
@@ -0,0 +1,66 @@
1
+ import { ExtensionSlotActivation, IDeviceExtensionProvider, IScopedLogger } from '@camstack/types';
2
+ import { DoorbellBindingState, DurableBindingVerdict, RingVerdict } from './binding-mirror.js';
3
+ import { DoorbellSource } from './doorbell-settings.js';
4
+ /** The routing prefix of this owner's `slotRef`s. */
5
+ export declare const VIRTUAL_DOORBELL_EXTENSION_SOURCE = "virtual-doorbell";
6
+ /** The store the slot reads and writes, named (D62). */
7
+ export declare const DOORBELL_SOURCES_AUTHORITY = "virtual-doorbell:doorbellSources";
8
+ /** The authority that decides whether the wrapper serves a camera at all. */
9
+ export declare const WRAPPER_ACTIVATION_AUTHORITY = "device-manager:setWrapperActive";
10
+ /** The compact device row this slot needs from the device manager. */
11
+ export interface DoorbellSlotDevice {
12
+ readonly id: number;
13
+ readonly name: string;
14
+ readonly type: string;
15
+ readonly location: string | null;
16
+ readonly parentDeviceId: number | null;
17
+ }
18
+ /** What the slot needs from the addon — its store, its mirror, and the fleet's reads. */
19
+ export interface DoorbellSlotDeps {
20
+ readonly ownAddonId: string;
21
+ readonly logger: IScopedLogger;
22
+ readonly readSources: (deviceId: number) => Promise<readonly DoorbellSource[]>;
23
+ /** The addon's own settings-save path (normalise, store, invalidate). */
24
+ readonly persistSources: (deviceId: number, deviceIds: readonly number[]) => Promise<void>;
25
+ /** The host's own row — ONE read, for its type. */
26
+ readonly getDevice: (deviceId: number) => Promise<DoorbellSlotDevice | null>;
27
+ /** Several devices in ONE read. Ids no device has are simply absent. */
28
+ readonly listDevices: (deviceIds: readonly number[]) => Promise<readonly DoorbellSlotDevice[]>;
29
+ /** The D49 mirror's verdict for this camera, or undefined when it has none. */
30
+ readonly readBindingMirror: (deviceId: number) => DoorbellBindingState | undefined;
31
+ /**
32
+ * The DURABLE authority, read-only — the same read the ring gate makes
33
+ * before it drops a press. Never throws: a store that cannot answer is
34
+ * `unreadable`, which carries no information.
35
+ */
36
+ readonly readDurableBinding: (deviceId: number) => Promise<DurableBindingVerdict>;
37
+ readonly sourceCapableDeviceIds: () => Promise<readonly number[]>;
38
+ readonly listFleet: () => Promise<readonly DoorbellSlotDevice[]>;
39
+ }
40
+ /** How the card SAYS a verdict. The verdict itself is `ringVerdict`'s, never the card's. */
41
+ export declare function activationFromVerdict(verdict: RingVerdict): ExtensionSlotActivation;
42
+ /**
43
+ * The card's activation — READ-ONLY (D648 fix round 3).
44
+ *
45
+ * The verdict is `ringVerdict`, the function the ring gate decides with, fed
46
+ * the addon's mirror as it stands. The card never refreshes the mirror and
47
+ * never writes it: the mirror gates the ring, and a view that could move it
48
+ * would let a page refetch during a store blip silence a doorbell. The only
49
+ * read the card may make is the durable authority, and only where the ring
50
+ * gate would make it too (`needsDurableRead`: an `unbound` mirror). A camera
51
+ * the mirror has never seen costs nothing — the ring path errs open there and
52
+ * so does the card.
53
+ */
54
+ /** The card's durable read for one camera, shared by every view asking at once. */
55
+ type DurableReader = (deviceId: number) => Promise<DurableBindingVerdict>;
56
+ /**
57
+ * Concurrent card views of the same `unbound` camera share ONE durable read,
58
+ * per camera, for as long as it is in flight — a page with several viewers
59
+ * (or a refetch storm) must not multiply the store round trip. Only the
60
+ * CARD's reads are shared: the ring gate calls the addon's
61
+ * `readDurableAuthority` on its own path and never waits behind a card.
62
+ */
63
+ export declare function shareDurableReads(read: DurableReader): DurableReader;
64
+ /** Build the `device-extension` provider the virtual doorbell registers. */
65
+ export declare function createDoorbellExtensionProvider(deps: DoorbellSlotDeps): IDeviceExtensionProvider;
66
+ export {};
@@ -5,7 +5,7 @@ interface VirtualDoorbellAddonConfig {
5
5
  /**
6
6
  * Reload the camera→source assignment map (and the binding mirror) at
7
7
  * most this often — lazily, on trigger traffic. Covers devices/settings
8
- * appearing after boot without a settings save, and is the cadence on
8
+ * appearing after boot without a save, and is the cadence on
9
9
  * which an unbind gets corroborated.
10
10
  */
11
11
  readonly assignmentsTtlMs: number;
@@ -19,9 +19,9 @@ interface VirtualDoorbellAddonConfig {
19
19
  *
20
20
  * 1. The operator binds the wrapper to a camera in the bindings UI
21
21
  * (`defaultActive: false` — never auto-bound).
22
- * 2. In the camera's GENERAL settings (next to "Linked devices") the
23
- * operator picks one or more SOURCE devices from a searchable list —
24
- * that is the ONLY choice. The reaction is derived automatically per
22
+ * 2. In the camera's Extensions section (the `doorbell-source` slot,
23
+ * D648/D655) the operator picks one or more SOURCE devices — that is
24
+ * the ONLY choice. The reaction is derived automatically per
25
25
  * device type: a binary sensor rings when it goes active, a switch
26
26
  * rings when it turns on (see `trigger-engine.ts`). The persisted
27
27
  * shape (`doorbellSources: [{deviceId}]`) stays extensible for a
@@ -53,6 +53,11 @@ export declare class VirtualDoorbellAddon extends BaseAddon<VirtualDoorbellAddon
53
53
  private readonly bindingMirror;
54
54
  constructor();
55
55
  protected onInitialize(): Promise<ProviderRegistration[]>;
56
+ /**
57
+ * The `device-extension` provider: the only editor of a camera's trigger
58
+ * devices since D655 (see `doorbell-extension-slot.ts`).
59
+ */
60
+ private buildExtensionProvider;
56
61
  private handleStateChanged;
57
62
  /**
58
63
  * Say out loud every case where a rise did NOT become a ring. Silence
@@ -136,18 +141,11 @@ export declare class VirtualDoorbellAddon extends BaseAddon<VirtualDoorbellAddon
136
141
  * Returns `true` when the ring must proceed.
137
142
  */
138
143
  private ringsDespiteUnboundMirror;
139
- /**
140
- * Record a binding we observed FIRST-HAND. Both callers are cap methods
141
- * the router only reaches by resolving this wrapper for this device —
142
- * which it can only do through the binding — so a call is direct evidence
143
- * and outranks anything the store says.
144
- */
145
- private confirmBindingFromCapCall;
146
144
  /**
147
145
  * Lazily (re)build the camera→source assignment set from every
148
146
  * camera's device store. TTL-bounded so devices/settings appearing
149
- * after boot are picked up without a settings save; invalidated
150
- * eagerly by `applyDeviceSettingsPatch`.
147
+ * after boot are picked up without a save; invalidated eagerly by
148
+ * `persistDoorbellSources`.
151
149
  */
152
150
  private ensureAssignments;
153
151
  private loadAssignments;
@@ -164,29 +162,12 @@ export declare class VirtualDoorbellAddon extends BaseAddon<VirtualDoorbellAddon
164
162
  */
165
163
  private readDeviceSources;
166
164
  /**
167
- * Single-trip, non-throwing device lookup (mirrors snapshot's
168
- * `lookupDeviceMeta`). Null on any failure — callers fall back to
169
- * rendering the section (better a spurious section than a thrown
170
- * aggregator entry).
171
- */
172
- private lookupDevice;
173
- /**
174
- * Settings section for the device-detail page — contributed into the
175
- * GENERAL settings surface (no `tab`, so it lands in the same tab as
176
- * "Linked devices", ordered just after it). Camera-only: the doorbell
177
- * cap also applies to Button accessories (native providers) where a
178
- * virtual-source picker is meaningless.
179
- *
180
- * A SINGLE `device-multiselect` field carries only a declarative
181
- * `deviceFilter` — the admin-ui renders the SHARED searchable device
182
- * picker (same idiom as "Linked devices") whose options come from
183
- * `deviceManager.listAll` filtered CLIENT-SIDE. The addon NO LONGER
184
- * computes the option list server-side: the old path enumerated
185
- * `deviceManager.getAllBindings`, which returns an empty set on the live
186
- * cluster and left the picker blank. The reaction is still derived
187
- * automatically per device type — no trigger/eventType controls.
165
+ * THE write path for a camera's trigger sources — the `doorbell-source`
166
+ * extension slot lands here (D648; its only caller since D655): normalise
167
+ * to `doorbellSources: [{deviceId}]`, strip the legacy keys, and invalidate
168
+ * the assignment cache so the next rise (and the binding mirror's next
169
+ * refresh, off the ring path) sees the new wiring.
188
170
  */
189
- private buildDeviceSettingsContribution;
190
- private saveDeviceSettingsPatch;
171
+ private persistDoorbellSources;
191
172
  }
192
173
  export default VirtualDoorbellAddon;