@camstack/addon-provider-rtsp 1.2.72 → 1.2.74
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.
- package/dist/addon.js +169 -1
- package/dist/addon.mjs +169 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -6469,6 +6469,21 @@ var CameraStreamSchema = object({
|
|
|
6469
6469
|
*/
|
|
6470
6470
|
autoEligible: boolean().optional(),
|
|
6471
6471
|
/**
|
|
6472
|
+
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
6473
|
+
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
6474
|
+
* stream. Consulted by the broker's automatic ranking
|
|
6475
|
+
* (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
|
|
6476
|
+
* an operator's manual assignment still wins, and an absent hint is the
|
|
6477
|
+
* pixel-ranked default every camera had before this field existed.
|
|
6478
|
+
*
|
|
6479
|
+
* Why it exists: a camera with ONE stream ranked to `mid` — the slot no
|
|
6480
|
+
* storage class is written for on its own (`recordings` is high|mid,
|
|
6481
|
+
* `recordingsLow` is low) and the one profile scrub does not read. The robot
|
|
6482
|
+
* camera's single 720p relay is a `low` in every respect except the slot the
|
|
6483
|
+
* heuristic put it in.
|
|
6484
|
+
*/
|
|
6485
|
+
profileHint: CamProfileSchema.optional(),
|
|
6486
|
+
/**
|
|
6472
6487
|
* Transport-specific opaque metadata. The broker passes it through to
|
|
6473
6488
|
* the source reader without inspecting it. Currently used by
|
|
6474
6489
|
* `pull-rfc4571` streams to carry the upstream SDP (so the reader can
|
|
@@ -7950,7 +7965,22 @@ var RecordingTriggersSchema = object({
|
|
|
7950
7965
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
7951
7966
|
* registrare.
|
|
7952
7967
|
*/
|
|
7953
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
7968
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
|
|
7969
|
+
/**
|
|
7970
|
+
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
7971
|
+
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
7972
|
+
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
7973
|
+
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
7974
|
+
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
7975
|
+
*
|
|
7976
|
+
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
7977
|
+
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
7978
|
+
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
7979
|
+
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
7980
|
+
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
7981
|
+
* (`holdTrigger` / `releaseTrigger`).
|
|
7982
|
+
*/
|
|
7983
|
+
deviceSignal: boolean().optional()
|
|
7954
7984
|
});
|
|
7955
7985
|
/**
|
|
7956
7986
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -11414,6 +11444,8 @@ method(object({
|
|
|
11414
11444
|
label: string().optional(),
|
|
11415
11445
|
deviceFeatures: array(string()).optional(),
|
|
11416
11446
|
autoEligible: boolean().optional(),
|
|
11447
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
11448
|
+
profileHint: CamProfileSchema.optional(),
|
|
11417
11449
|
metadata: record(string(), unknown()).optional(),
|
|
11418
11450
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
11419
11451
|
* derived broker reads its encoded plane from.
|
|
@@ -30051,6 +30083,77 @@ method(object({
|
|
|
30051
30083
|
auth: "protected"
|
|
30052
30084
|
});
|
|
30053
30085
|
/**
|
|
30086
|
+
* A camera's own "record me NOW" LEVEL — a signal the device raises while
|
|
30087
|
+
* something it knows about is happening (a robot vacuum cleaning, a machine
|
|
30088
|
+
* running, a gate open) and lowers when it stops.
|
|
30089
|
+
*
|
|
30090
|
+
* It is a level, not an edge. The sensor triggers the recorder already listens
|
|
30091
|
+
* to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
|
|
30092
|
+
* post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
|
|
30093
|
+
* still happening" cannot be expressed as an edge plus a post-buffer without
|
|
30094
|
+
* either re-triggering on a timer (polling — D224 forbids the consumer keeping
|
|
30095
|
+
* the fact fresh) or picking a post-buffer long enough to cover every job,
|
|
30096
|
+
* which records the dock for that long after every short one. So the recorder
|
|
30097
|
+
* reads the LEVEL: it records for as long as `active` is true, plus the band's
|
|
30098
|
+
* own post-buffer once it falls.
|
|
30099
|
+
*
|
|
30100
|
+
* Who owns the fact: the PROVIDER of the device, which already reads the state
|
|
30101
|
+
* the signal is derived from (the vacuum's lifecycle state, for Dreame). It
|
|
30102
|
+
* writes this slice on every change; consumers subscribe to the kernel's
|
|
30103
|
+
* `DeviceStateChanged` for it and read it back through
|
|
30104
|
+
* `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
|
|
30105
|
+
* against the device (D224, D8/D11).
|
|
30106
|
+
*
|
|
30107
|
+
* Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
|
|
30108
|
+
* to Home Assistant, HomeKit and the sensor picker as a thing an operator can
|
|
30109
|
+
* bind, and "the camera wants to record" is not a room sensor. It is a fact
|
|
30110
|
+
* about the camera, on the camera.
|
|
30111
|
+
*/
|
|
30112
|
+
var RecordingSignalStatusSchema = object({
|
|
30113
|
+
/** True while the device asks to be recorded. */
|
|
30114
|
+
active: boolean(),
|
|
30115
|
+
/**
|
|
30116
|
+
* Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
|
|
30117
|
+
* …). Free text for the log line and the UI badge; the recorder never
|
|
30118
|
+
* branches on it.
|
|
30119
|
+
*/
|
|
30120
|
+
reason: string(),
|
|
30121
|
+
/** Ms epoch of the last `active` transition. 0 if never observed. */
|
|
30122
|
+
lastChangedAt: number()
|
|
30123
|
+
});
|
|
30124
|
+
/** The runtime-state slice: the status plus the clock every slice carries. */
|
|
30125
|
+
var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
|
|
30126
|
+
var recordingSignalCapability = {
|
|
30127
|
+
name: "recording-signal",
|
|
30128
|
+
scope: "device",
|
|
30129
|
+
deviceNative: true,
|
|
30130
|
+
mode: "singleton",
|
|
30131
|
+
deviceTypes: [DeviceType.Camera],
|
|
30132
|
+
methods: {
|
|
30133
|
+
/** The current level, straight from the slice the provider keeps fresh. */
|
|
30134
|
+
getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
|
|
30135
|
+
status: {
|
|
30136
|
+
schema: RecordingSignalStatusSchema,
|
|
30137
|
+
kind: "push",
|
|
30138
|
+
empty: {
|
|
30139
|
+
active: false,
|
|
30140
|
+
reason: "unknown",
|
|
30141
|
+
lastChangedAt: 0
|
|
30142
|
+
}
|
|
30143
|
+
},
|
|
30144
|
+
runtimeState: RecordingSignalRuntimeStateSchema,
|
|
30145
|
+
/**
|
|
30146
|
+
* Runtime-state durability: **session** — a restored `active: true` from
|
|
30147
|
+
* before a restart is exactly the stale level the recorder's reconcile bound
|
|
30148
|
+
* exists to end, and the provider re-derives the true level on activation
|
|
30149
|
+
* anyway. Nothing is lost by forgetting it; a lie is avoided.
|
|
30150
|
+
*
|
|
30151
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
30152
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
30153
|
+
*/
|
|
30154
|
+
durability: "session"
|
|
30155
|
+
};
|
|
30156
|
+
/**
|
|
30054
30157
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
30055
30158
|
* a rect ROI on a camera frame and names one or more states; the engine
|
|
30056
30159
|
* (pipeline-analytics, designated post-processing node) reports which state is
|
|
@@ -30548,6 +30651,8 @@ var CamStreamDescriptorSchema = object({
|
|
|
30548
30651
|
deviceFeatures: array(string()).optional(),
|
|
30549
30652
|
/** Eligible for automatic profile assignment. Absent = `true`. */
|
|
30550
30653
|
autoEligible: boolean().optional(),
|
|
30654
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
30655
|
+
profileHint: CamProfileSchema.optional(),
|
|
30551
30656
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
30552
30657
|
metadata: record(string(), unknown()).optional()
|
|
30553
30658
|
});
|
|
@@ -32687,6 +32792,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32687
32792
|
pressureSensor: pressureSensorCapability,
|
|
32688
32793
|
privacyMask: privacyMaskCapability,
|
|
32689
32794
|
ptzAutotrack: ptzAutotrackCapability,
|
|
32795
|
+
recordingSignal: recordingSignalCapability,
|
|
32690
32796
|
sceneMonitor: sceneMonitorCapability,
|
|
32691
32797
|
scriptRunner: scriptRunnerCapability,
|
|
32692
32798
|
smoke: smokeCapability,
|
|
@@ -33530,6 +33636,53 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33530
33636
|
const ids = [...this._permanentRestoreFailures.keys()].join(", ");
|
|
33531
33637
|
return `${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${ids}) — restart the ${this.providerName} provider to retry`;
|
|
33532
33638
|
}
|
|
33639
|
+
/**
|
|
33640
|
+
* A top-level persisted row with NO configuration is a leftover, not a
|
|
33641
|
+
* device — quarantine it instead of dialling it.
|
|
33642
|
+
*
|
|
33643
|
+
* Device 614 was deleted, resurrected as a config-less shell by a write
|
|
33644
|
+
* already in flight (D376), and then dialled at every single boot: eight
|
|
33645
|
+
* `Failed to restore device — bounded retry scheduled` lines in one day,
|
|
33646
|
+
* each one the same Zod refusal on `host` and `password`. The bound was
|
|
33647
|
+
* real, but it is a bound PER PROCESS, and the runner restarts — so nothing
|
|
33648
|
+
* about the row ever stopped costing attempts and log lines.
|
|
33649
|
+
*
|
|
33650
|
+
* No retry can add a configuration that is not there. The row is reported
|
|
33651
|
+
* once, with its `deviceId`, and set aside.
|
|
33652
|
+
*
|
|
33653
|
+
* Top-level only: an accessory child legitimately carries an empty blob (it
|
|
33654
|
+
* lives off its parent), and a hub-adopted child with an emptied blob is
|
|
33655
|
+
* repaired by `healSavedConfig` from its parent instead. Providers that
|
|
33656
|
+
* genuinely create configuration-free top-level devices turn this off.
|
|
33657
|
+
*/
|
|
33658
|
+
quarantineConfiglessTopLevelRestores = true;
|
|
33659
|
+
isUnrestorableShell(saved) {
|
|
33660
|
+
if (!this.quarantineConfiglessTopLevelRestores) return false;
|
|
33661
|
+
if (saved.parentDeviceId !== null) return false;
|
|
33662
|
+
const config = saved.config;
|
|
33663
|
+
if (config === void 0) return false;
|
|
33664
|
+
return Object.keys(config).length === 0;
|
|
33665
|
+
}
|
|
33666
|
+
quarantineShell(saved) {
|
|
33667
|
+
this._permanentRestoreFailures.set(saved.id, {
|
|
33668
|
+
deviceId: saved.id,
|
|
33669
|
+
stableId: saved.stableId,
|
|
33670
|
+
type: saved.type,
|
|
33671
|
+
attempts: 0,
|
|
33672
|
+
lastError: "persisted row has no configuration",
|
|
33673
|
+
failedAt: Date.now()
|
|
33674
|
+
});
|
|
33675
|
+
this.ctx.logger.error("Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.", {
|
|
33676
|
+
tags: {
|
|
33677
|
+
deviceId: saved.id,
|
|
33678
|
+
stableId: saved.stableId
|
|
33679
|
+
},
|
|
33680
|
+
meta: {
|
|
33681
|
+
type: saved.type,
|
|
33682
|
+
provider: this.providerName
|
|
33683
|
+
}
|
|
33684
|
+
});
|
|
33685
|
+
}
|
|
33533
33686
|
cancelRestoreRetries() {
|
|
33534
33687
|
this._restoreRetryScheduler?.cancel();
|
|
33535
33688
|
this._restoreRetryScheduler = null;
|
|
@@ -33714,6 +33867,10 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33714
33867
|
});
|
|
33715
33868
|
return;
|
|
33716
33869
|
}
|
|
33870
|
+
if (this.isUnrestorableShell(saved)) {
|
|
33871
|
+
this.quarantineShell(saved);
|
|
33872
|
+
return;
|
|
33873
|
+
}
|
|
33717
33874
|
try {
|
|
33718
33875
|
await attemptRestore(saved);
|
|
33719
33876
|
} catch (err) {
|
|
@@ -38500,6 +38657,12 @@ Object.freeze({
|
|
|
38500
38657
|
addonId: null,
|
|
38501
38658
|
access: "view"
|
|
38502
38659
|
},
|
|
38660
|
+
"recordingSignal.getStatus": {
|
|
38661
|
+
capName: "recording-signal",
|
|
38662
|
+
capScope: "device",
|
|
38663
|
+
addonId: null,
|
|
38664
|
+
access: "view"
|
|
38665
|
+
},
|
|
38503
38666
|
"sceneMonitor.captureReference": {
|
|
38504
38667
|
capName: "scene-monitor",
|
|
38505
38668
|
capScope: "device",
|
|
@@ -41492,6 +41655,11 @@ Object.freeze({
|
|
|
41492
41655
|
form: "single",
|
|
41493
41656
|
optional: true
|
|
41494
41657
|
}],
|
|
41658
|
+
"recordingSignal.getStatus": [{
|
|
41659
|
+
name: "deviceId",
|
|
41660
|
+
form: "single",
|
|
41661
|
+
optional: false
|
|
41662
|
+
}],
|
|
41495
41663
|
"sceneMonitor.captureReference": [{
|
|
41496
41664
|
name: "deviceId",
|
|
41497
41665
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -6445,6 +6445,21 @@ var CameraStreamSchema = object({
|
|
|
6445
6445
|
*/
|
|
6446
6446
|
autoEligible: boolean().optional(),
|
|
6447
6447
|
/**
|
|
6448
|
+
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
6449
|
+
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
6450
|
+
* stream. Consulted by the broker's automatic ranking
|
|
6451
|
+
* (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
|
|
6452
|
+
* an operator's manual assignment still wins, and an absent hint is the
|
|
6453
|
+
* pixel-ranked default every camera had before this field existed.
|
|
6454
|
+
*
|
|
6455
|
+
* Why it exists: a camera with ONE stream ranked to `mid` — the slot no
|
|
6456
|
+
* storage class is written for on its own (`recordings` is high|mid,
|
|
6457
|
+
* `recordingsLow` is low) and the one profile scrub does not read. The robot
|
|
6458
|
+
* camera's single 720p relay is a `low` in every respect except the slot the
|
|
6459
|
+
* heuristic put it in.
|
|
6460
|
+
*/
|
|
6461
|
+
profileHint: CamProfileSchema.optional(),
|
|
6462
|
+
/**
|
|
6448
6463
|
* Transport-specific opaque metadata. The broker passes it through to
|
|
6449
6464
|
* the source reader without inspecting it. Currently used by
|
|
6450
6465
|
* `pull-rfc4571` streams to carry the upstream SDP (so the reader can
|
|
@@ -7926,7 +7941,22 @@ var RecordingTriggersSchema = object({
|
|
|
7926
7941
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
7927
7942
|
* registrare.
|
|
7928
7943
|
*/
|
|
7929
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
7944
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
|
|
7945
|
+
/**
|
|
7946
|
+
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
7947
|
+
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
7948
|
+
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
7949
|
+
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
7950
|
+
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
7951
|
+
*
|
|
7952
|
+
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
7953
|
+
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
7954
|
+
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
7955
|
+
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
7956
|
+
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
7957
|
+
* (`holdTrigger` / `releaseTrigger`).
|
|
7958
|
+
*/
|
|
7959
|
+
deviceSignal: boolean().optional()
|
|
7930
7960
|
});
|
|
7931
7961
|
/**
|
|
7932
7962
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -11390,6 +11420,8 @@ method(object({
|
|
|
11390
11420
|
label: string().optional(),
|
|
11391
11421
|
deviceFeatures: array(string()).optional(),
|
|
11392
11422
|
autoEligible: boolean().optional(),
|
|
11423
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
11424
|
+
profileHint: CamProfileSchema.optional(),
|
|
11393
11425
|
metadata: record(string(), unknown()).optional(),
|
|
11394
11426
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
11395
11427
|
* derived broker reads its encoded plane from.
|
|
@@ -30027,6 +30059,77 @@ method(object({
|
|
|
30027
30059
|
auth: "protected"
|
|
30028
30060
|
});
|
|
30029
30061
|
/**
|
|
30062
|
+
* A camera's own "record me NOW" LEVEL — a signal the device raises while
|
|
30063
|
+
* something it knows about is happening (a robot vacuum cleaning, a machine
|
|
30064
|
+
* running, a gate open) and lowers when it stops.
|
|
30065
|
+
*
|
|
30066
|
+
* It is a level, not an edge. The sensor triggers the recorder already listens
|
|
30067
|
+
* to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
|
|
30068
|
+
* post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
|
|
30069
|
+
* still happening" cannot be expressed as an edge plus a post-buffer without
|
|
30070
|
+
* either re-triggering on a timer (polling — D224 forbids the consumer keeping
|
|
30071
|
+
* the fact fresh) or picking a post-buffer long enough to cover every job,
|
|
30072
|
+
* which records the dock for that long after every short one. So the recorder
|
|
30073
|
+
* reads the LEVEL: it records for as long as `active` is true, plus the band's
|
|
30074
|
+
* own post-buffer once it falls.
|
|
30075
|
+
*
|
|
30076
|
+
* Who owns the fact: the PROVIDER of the device, which already reads the state
|
|
30077
|
+
* the signal is derived from (the vacuum's lifecycle state, for Dreame). It
|
|
30078
|
+
* writes this slice on every change; consumers subscribe to the kernel's
|
|
30079
|
+
* `DeviceStateChanged` for it and read it back through
|
|
30080
|
+
* `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
|
|
30081
|
+
* against the device (D224, D8/D11).
|
|
30082
|
+
*
|
|
30083
|
+
* Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
|
|
30084
|
+
* to Home Assistant, HomeKit and the sensor picker as a thing an operator can
|
|
30085
|
+
* bind, and "the camera wants to record" is not a room sensor. It is a fact
|
|
30086
|
+
* about the camera, on the camera.
|
|
30087
|
+
*/
|
|
30088
|
+
var RecordingSignalStatusSchema = object({
|
|
30089
|
+
/** True while the device asks to be recorded. */
|
|
30090
|
+
active: boolean(),
|
|
30091
|
+
/**
|
|
30092
|
+
* Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
|
|
30093
|
+
* …). Free text for the log line and the UI badge; the recorder never
|
|
30094
|
+
* branches on it.
|
|
30095
|
+
*/
|
|
30096
|
+
reason: string(),
|
|
30097
|
+
/** Ms epoch of the last `active` transition. 0 if never observed. */
|
|
30098
|
+
lastChangedAt: number()
|
|
30099
|
+
});
|
|
30100
|
+
/** The runtime-state slice: the status plus the clock every slice carries. */
|
|
30101
|
+
var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
|
|
30102
|
+
var recordingSignalCapability = {
|
|
30103
|
+
name: "recording-signal",
|
|
30104
|
+
scope: "device",
|
|
30105
|
+
deviceNative: true,
|
|
30106
|
+
mode: "singleton",
|
|
30107
|
+
deviceTypes: [DeviceType.Camera],
|
|
30108
|
+
methods: {
|
|
30109
|
+
/** The current level, straight from the slice the provider keeps fresh. */
|
|
30110
|
+
getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
|
|
30111
|
+
status: {
|
|
30112
|
+
schema: RecordingSignalStatusSchema,
|
|
30113
|
+
kind: "push",
|
|
30114
|
+
empty: {
|
|
30115
|
+
active: false,
|
|
30116
|
+
reason: "unknown",
|
|
30117
|
+
lastChangedAt: 0
|
|
30118
|
+
}
|
|
30119
|
+
},
|
|
30120
|
+
runtimeState: RecordingSignalRuntimeStateSchema,
|
|
30121
|
+
/**
|
|
30122
|
+
* Runtime-state durability: **session** — a restored `active: true` from
|
|
30123
|
+
* before a restart is exactly the stale level the recorder's reconcile bound
|
|
30124
|
+
* exists to end, and the provider re-derives the true level on activation
|
|
30125
|
+
* anyway. Nothing is lost by forgetting it; a lie is avoided.
|
|
30126
|
+
*
|
|
30127
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
30128
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
30129
|
+
*/
|
|
30130
|
+
durability: "session"
|
|
30131
|
+
};
|
|
30132
|
+
/**
|
|
30030
30133
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
30031
30134
|
* a rect ROI on a camera frame and names one or more states; the engine
|
|
30032
30135
|
* (pipeline-analytics, designated post-processing node) reports which state is
|
|
@@ -30524,6 +30627,8 @@ var CamStreamDescriptorSchema = object({
|
|
|
30524
30627
|
deviceFeatures: array(string()).optional(),
|
|
30525
30628
|
/** Eligible for automatic profile assignment. Absent = `true`. */
|
|
30526
30629
|
autoEligible: boolean().optional(),
|
|
30630
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
30631
|
+
profileHint: CamProfileSchema.optional(),
|
|
30527
30632
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
30528
30633
|
metadata: record(string(), unknown()).optional()
|
|
30529
30634
|
});
|
|
@@ -32663,6 +32768,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32663
32768
|
pressureSensor: pressureSensorCapability,
|
|
32664
32769
|
privacyMask: privacyMaskCapability,
|
|
32665
32770
|
ptzAutotrack: ptzAutotrackCapability,
|
|
32771
|
+
recordingSignal: recordingSignalCapability,
|
|
32666
32772
|
sceneMonitor: sceneMonitorCapability,
|
|
32667
32773
|
scriptRunner: scriptRunnerCapability,
|
|
32668
32774
|
smoke: smokeCapability,
|
|
@@ -33506,6 +33612,53 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33506
33612
|
const ids = [...this._permanentRestoreFailures.keys()].join(", ");
|
|
33507
33613
|
return `${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${ids}) — restart the ${this.providerName} provider to retry`;
|
|
33508
33614
|
}
|
|
33615
|
+
/**
|
|
33616
|
+
* A top-level persisted row with NO configuration is a leftover, not a
|
|
33617
|
+
* device — quarantine it instead of dialling it.
|
|
33618
|
+
*
|
|
33619
|
+
* Device 614 was deleted, resurrected as a config-less shell by a write
|
|
33620
|
+
* already in flight (D376), and then dialled at every single boot: eight
|
|
33621
|
+
* `Failed to restore device — bounded retry scheduled` lines in one day,
|
|
33622
|
+
* each one the same Zod refusal on `host` and `password`. The bound was
|
|
33623
|
+
* real, but it is a bound PER PROCESS, and the runner restarts — so nothing
|
|
33624
|
+
* about the row ever stopped costing attempts and log lines.
|
|
33625
|
+
*
|
|
33626
|
+
* No retry can add a configuration that is not there. The row is reported
|
|
33627
|
+
* once, with its `deviceId`, and set aside.
|
|
33628
|
+
*
|
|
33629
|
+
* Top-level only: an accessory child legitimately carries an empty blob (it
|
|
33630
|
+
* lives off its parent), and a hub-adopted child with an emptied blob is
|
|
33631
|
+
* repaired by `healSavedConfig` from its parent instead. Providers that
|
|
33632
|
+
* genuinely create configuration-free top-level devices turn this off.
|
|
33633
|
+
*/
|
|
33634
|
+
quarantineConfiglessTopLevelRestores = true;
|
|
33635
|
+
isUnrestorableShell(saved) {
|
|
33636
|
+
if (!this.quarantineConfiglessTopLevelRestores) return false;
|
|
33637
|
+
if (saved.parentDeviceId !== null) return false;
|
|
33638
|
+
const config = saved.config;
|
|
33639
|
+
if (config === void 0) return false;
|
|
33640
|
+
return Object.keys(config).length === 0;
|
|
33641
|
+
}
|
|
33642
|
+
quarantineShell(saved) {
|
|
33643
|
+
this._permanentRestoreFailures.set(saved.id, {
|
|
33644
|
+
deviceId: saved.id,
|
|
33645
|
+
stableId: saved.stableId,
|
|
33646
|
+
type: saved.type,
|
|
33647
|
+
attempts: 0,
|
|
33648
|
+
lastError: "persisted row has no configuration",
|
|
33649
|
+
failedAt: Date.now()
|
|
33650
|
+
});
|
|
33651
|
+
this.ctx.logger.error("Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.", {
|
|
33652
|
+
tags: {
|
|
33653
|
+
deviceId: saved.id,
|
|
33654
|
+
stableId: saved.stableId
|
|
33655
|
+
},
|
|
33656
|
+
meta: {
|
|
33657
|
+
type: saved.type,
|
|
33658
|
+
provider: this.providerName
|
|
33659
|
+
}
|
|
33660
|
+
});
|
|
33661
|
+
}
|
|
33509
33662
|
cancelRestoreRetries() {
|
|
33510
33663
|
this._restoreRetryScheduler?.cancel();
|
|
33511
33664
|
this._restoreRetryScheduler = null;
|
|
@@ -33690,6 +33843,10 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33690
33843
|
});
|
|
33691
33844
|
return;
|
|
33692
33845
|
}
|
|
33846
|
+
if (this.isUnrestorableShell(saved)) {
|
|
33847
|
+
this.quarantineShell(saved);
|
|
33848
|
+
return;
|
|
33849
|
+
}
|
|
33693
33850
|
try {
|
|
33694
33851
|
await attemptRestore(saved);
|
|
33695
33852
|
} catch (err) {
|
|
@@ -38476,6 +38633,12 @@ Object.freeze({
|
|
|
38476
38633
|
addonId: null,
|
|
38477
38634
|
access: "view"
|
|
38478
38635
|
},
|
|
38636
|
+
"recordingSignal.getStatus": {
|
|
38637
|
+
capName: "recording-signal",
|
|
38638
|
+
capScope: "device",
|
|
38639
|
+
addonId: null,
|
|
38640
|
+
access: "view"
|
|
38641
|
+
},
|
|
38479
38642
|
"sceneMonitor.captureReference": {
|
|
38480
38643
|
capName: "scene-monitor",
|
|
38481
38644
|
capScope: "device",
|
|
@@ -41468,6 +41631,11 @@ Object.freeze({
|
|
|
41468
41631
|
form: "single",
|
|
41469
41632
|
optional: true
|
|
41470
41633
|
}],
|
|
41634
|
+
"recordingSignal.getStatus": [{
|
|
41635
|
+
name: "deviceId",
|
|
41636
|
+
form: "single",
|
|
41637
|
+
optional: false
|
|
41638
|
+
}],
|
|
41471
41639
|
"sceneMonitor.captureReference": [{
|
|
41472
41640
|
name: "deviceId",
|
|
41473
41641
|
form: "single",
|