@camstack/system 1.2.79 → 1.2.81

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 (55) 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-bindings-store.d.ts +21 -0
  14. package/dist/builtins/device-manager/device-manager.addon.js +23 -2
  15. package/dist/builtins/device-manager/device-manager.addon.mjs +23 -2
  16. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  17. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  18. package/dist/builtins/hub-forwarder/index.js +1 -1
  19. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  20. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  21. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  22. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  23. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  24. package/dist/builtins/local-network/local-network.addon.js +1 -1
  25. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  26. package/dist/builtins/loki-logging/index.js +1 -1
  27. package/dist/builtins/loki-logging/index.mjs +1 -1
  28. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  29. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  30. package/dist/builtins/platform-probe/index.js +1 -1
  31. package/dist/builtins/platform-probe/index.mjs +1 -1
  32. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  33. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  34. package/dist/builtins/snapshot/index.js +557 -533
  35. package/dist/builtins/snapshot/index.mjs +556 -533
  36. package/dist/builtins/snapshot/snapshot-coalescing.d.ts +6 -1
  37. package/dist/builtins/snapshot/snapshot-courtesy.d.ts +36 -0
  38. package/dist/builtins/snapshot/snapshot-resize.d.ts +43 -11
  39. package/dist/builtins/snapshot/snapshot.addon.d.ts +52 -45
  40. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  41. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  42. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  43. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  44. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  45. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  46. package/dist/builtins/system-config/system-config.addon.js +1 -1
  47. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  48. package/dist/builtins/winston-logging/index.js +1 -1
  49. package/dist/builtins/winston-logging/index.mjs +1 -1
  50. package/dist/{dist-cINpngi1.js → dist-CA2mim74.js} +48 -16
  51. package/dist/{dist-CIIFhXqm.mjs → dist-DZOZtn-0.mjs} +48 -16
  52. package/dist/index.js +1 -1
  53. package/dist/index.mjs +1 -1
  54. package/package.json +1 -1
  55. package/dist/builtins/snapshot/snapshot-keep-warm.d.ts +0 -86
@@ -1,86 +0,0 @@
1
- /**
2
- * Subscription bookkeeping for the snapshot keep-warm loop.
3
- *
4
- * The snapshot cache has exactly one writer — a successful capture — and every
5
- * capture is triggered by somebody asking. Nothing refreshes a frame on its own,
6
- * so with no viewer open every thumbnail in the system is as old as the last
7
- * time somebody looked. Measured on the live hub: 15 of 16 cameras cached, all
8
- * captured in one 55 ms burst, all 10 minutes old and not moving.
9
- *
10
- * The fix is a warm loop — but a blind one would dial 16 cameras forever for
11
- * nobody. This module holds the thing that makes it bounded: a warm tick only
12
- * touches cameras SOMEBODY IS LOOKING AT, and "looking at" is inferred from the
13
- * requests themselves. One data-plane request for a device makes it an observer
14
- * for {@link WARM_WINDOW_MS}; when the last viewer closes, the loop goes quiet
15
- * on its own after that window and costs exactly nothing.
16
- *
17
- * Pure and side-effect-free (no timer, no I/O, `now` injected) — the addon owns
18
- * the timer, this owns the decision. Unit-tested in
19
- * `__tests__/snapshot-keep-warm.spec.ts`.
20
- */
21
- /**
22
- * How often the warm loop runs. Chosen so a tile is perceptibly fresh while
23
- * watched; it is also the single biggest cost lever in the design (16 cameras ×
24
- * 12 ticks/min against a pool of 3 ffmpeg). A chained timer, not `setInterval` —
25
- * the next tick is scheduled only after the previous one settles, so a slow
26
- * fleet cannot stack ticks on top of each other.
27
- */
28
- export declare const WARM_INTERVAL_MS = 5000;
29
- /**
30
- * How long one request keeps a device warm. Two minutes of inertia after the
31
- * last observer goes away: long enough that flipping between screens (or a
32
- * phone locking briefly) does not go cold, short enough that a closed app stops
33
- * costing captures well before anyone notices.
34
- */
35
- export declare const WARM_WINDOW_MS = 120000;
36
- /**
37
- * Hard bound on tracked subscriptions. The map is keyed by whatever device ids
38
- * arrive over HTTP, so it is attacker-influenced: a sweep over ids must not be
39
- * able to grow it without limit, nor make a warm tick dial an unbounded fleet.
40
- * Well above any real install's simultaneously-watched camera count.
41
- */
42
- export declare const MAX_WARM_TARGETS = 64;
43
- /** One (device, stream) the warm loop should refresh, plus the widths a client
44
- * actually asked for — so the tick can pre-derive exactly those variants and
45
- * leave the next real request a hit at BOTH cache levels. */
46
- export interface SnapshotWarmTarget {
47
- readonly deviceId: number;
48
- readonly streamId: string | undefined;
49
- /** Requested widths still inside the window, ascending. Empty = full frame only. */
50
- readonly widths: readonly number[];
51
- }
52
- /**
53
- * Who is being watched right now, and at what sizes.
54
- *
55
- * `note` on every data-plane request; `active` on every warm tick. `active`
56
- * PRUNES as it walks rather than merely filtering — the map is fed by request
57
- * traffic, so a filter-only read would leave every device ever requested in
58
- * memory for the life of the process.
59
- */
60
- export declare class SnapshotSubscriptions {
61
- private readonly entries;
62
- /** Record that somebody asked for this (device, stream) — at `width`, when the
63
- * request carried one. */
64
- note(deviceId: number, streamId: string | undefined, width: number | undefined, nowMs: number): void;
65
- /**
66
- * Refresh the window on subscriptions that ALREADY exist. Never creates one.
67
- *
68
- * This is what stops the design deadlocking, and the deadlock was measured on
69
- * the live hub before it existed. The client re-requests an image only when
70
- * the frame identity changes, and the identity changes only because the warm
71
- * loop captured — so 120 s after the last image request the subscription
72
- * expired, warming stopped, the identity froze, the client never asked again,
73
- * and the tile was stuck. Ages went 13 s → 49.7 s at exactly t+120 s.
74
- *
75
- * The client's `getSnapshotOverview` poll is the heartbeat: asking "what is
76
- * the state of these cameras" IS the statement that somebody is looking. It
77
- * deliberately cannot CREATE a subscription, because that poll is app-wide —
78
- * if it did, opening the app would warm every camera on the install, which is
79
- * the blind poll this whole design avoids. Only a rendered surface subscribes.
80
- */
81
- renew(deviceIds: readonly number[], nowMs: number): void;
82
- /** The (device, stream) pairs still inside the warm window, dropping the rest. */
83
- active(nowMs: number, windowMs?: number): readonly SnapshotWarmTarget[];
84
- get size(): number;
85
- clear(): void;
86
- }