@camstack/addon-provider-petkit 0.2.72 → 0.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
|
@@ -7547,6 +7547,21 @@ var CameraStreamSchema = object({
|
|
|
7547
7547
|
*/
|
|
7548
7548
|
autoEligible: boolean().optional(),
|
|
7549
7549
|
/**
|
|
7550
|
+
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
7551
|
+
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
7552
|
+
* stream. Consulted by the broker's automatic ranking
|
|
7553
|
+
* (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
|
|
7554
|
+
* an operator's manual assignment still wins, and an absent hint is the
|
|
7555
|
+
* pixel-ranked default every camera had before this field existed.
|
|
7556
|
+
*
|
|
7557
|
+
* Why it exists: a camera with ONE stream ranked to `mid` — the slot no
|
|
7558
|
+
* storage class is written for on its own (`recordings` is high|mid,
|
|
7559
|
+
* `recordingsLow` is low) and the one profile scrub does not read. The robot
|
|
7560
|
+
* camera's single 720p relay is a `low` in every respect except the slot the
|
|
7561
|
+
* heuristic put it in.
|
|
7562
|
+
*/
|
|
7563
|
+
profileHint: CamProfileSchema.optional(),
|
|
7564
|
+
/**
|
|
7550
7565
|
* Transport-specific opaque metadata. The broker passes it through to
|
|
7551
7566
|
* the source reader without inspecting it. Currently used by
|
|
7552
7567
|
* `pull-rfc4571` streams to carry the upstream SDP (so the reader can
|
|
@@ -8996,7 +9011,22 @@ var RecordingTriggersSchema = object({
|
|
|
8996
9011
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
8997
9012
|
* registrare.
|
|
8998
9013
|
*/
|
|
8999
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
9014
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
|
|
9015
|
+
/**
|
|
9016
|
+
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
9017
|
+
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
9018
|
+
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
9019
|
+
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
9020
|
+
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
9021
|
+
*
|
|
9022
|
+
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
9023
|
+
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
9024
|
+
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
9025
|
+
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
9026
|
+
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
9027
|
+
* (`holdTrigger` / `releaseTrigger`).
|
|
9028
|
+
*/
|
|
9029
|
+
deviceSignal: boolean().optional()
|
|
9000
9030
|
});
|
|
9001
9031
|
/**
|
|
9002
9032
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -12460,6 +12490,8 @@ method(object({
|
|
|
12460
12490
|
label: string().optional(),
|
|
12461
12491
|
deviceFeatures: array(string()).optional(),
|
|
12462
12492
|
autoEligible: boolean().optional(),
|
|
12493
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
12494
|
+
profileHint: CamProfileSchema.optional(),
|
|
12463
12495
|
metadata: record(string(), unknown()).optional(),
|
|
12464
12496
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
12465
12497
|
* derived broker reads its encoded plane from.
|
|
@@ -31010,6 +31042,77 @@ method(object({
|
|
|
31010
31042
|
auth: "protected"
|
|
31011
31043
|
});
|
|
31012
31044
|
/**
|
|
31045
|
+
* A camera's own "record me NOW" LEVEL — a signal the device raises while
|
|
31046
|
+
* something it knows about is happening (a robot vacuum cleaning, a machine
|
|
31047
|
+
* running, a gate open) and lowers when it stops.
|
|
31048
|
+
*
|
|
31049
|
+
* It is a level, not an edge. The sensor triggers the recorder already listens
|
|
31050
|
+
* to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
|
|
31051
|
+
* post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
|
|
31052
|
+
* still happening" cannot be expressed as an edge plus a post-buffer without
|
|
31053
|
+
* either re-triggering on a timer (polling — D224 forbids the consumer keeping
|
|
31054
|
+
* the fact fresh) or picking a post-buffer long enough to cover every job,
|
|
31055
|
+
* which records the dock for that long after every short one. So the recorder
|
|
31056
|
+
* reads the LEVEL: it records for as long as `active` is true, plus the band's
|
|
31057
|
+
* own post-buffer once it falls.
|
|
31058
|
+
*
|
|
31059
|
+
* Who owns the fact: the PROVIDER of the device, which already reads the state
|
|
31060
|
+
* the signal is derived from (the vacuum's lifecycle state, for Dreame). It
|
|
31061
|
+
* writes this slice on every change; consumers subscribe to the kernel's
|
|
31062
|
+
* `DeviceStateChanged` for it and read it back through
|
|
31063
|
+
* `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
|
|
31064
|
+
* against the device (D224, D8/D11).
|
|
31065
|
+
*
|
|
31066
|
+
* Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
|
|
31067
|
+
* to Home Assistant, HomeKit and the sensor picker as a thing an operator can
|
|
31068
|
+
* bind, and "the camera wants to record" is not a room sensor. It is a fact
|
|
31069
|
+
* about the camera, on the camera.
|
|
31070
|
+
*/
|
|
31071
|
+
var RecordingSignalStatusSchema = object({
|
|
31072
|
+
/** True while the device asks to be recorded. */
|
|
31073
|
+
active: boolean(),
|
|
31074
|
+
/**
|
|
31075
|
+
* Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
|
|
31076
|
+
* …). Free text for the log line and the UI badge; the recorder never
|
|
31077
|
+
* branches on it.
|
|
31078
|
+
*/
|
|
31079
|
+
reason: string(),
|
|
31080
|
+
/** Ms epoch of the last `active` transition. 0 if never observed. */
|
|
31081
|
+
lastChangedAt: number()
|
|
31082
|
+
});
|
|
31083
|
+
/** The runtime-state slice: the status plus the clock every slice carries. */
|
|
31084
|
+
var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
|
|
31085
|
+
var recordingSignalCapability = {
|
|
31086
|
+
name: "recording-signal",
|
|
31087
|
+
scope: "device",
|
|
31088
|
+
deviceNative: true,
|
|
31089
|
+
mode: "singleton",
|
|
31090
|
+
deviceTypes: [DeviceType.Camera],
|
|
31091
|
+
methods: {
|
|
31092
|
+
/** The current level, straight from the slice the provider keeps fresh. */
|
|
31093
|
+
getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
|
|
31094
|
+
status: {
|
|
31095
|
+
schema: RecordingSignalStatusSchema,
|
|
31096
|
+
kind: "push",
|
|
31097
|
+
empty: {
|
|
31098
|
+
active: false,
|
|
31099
|
+
reason: "unknown",
|
|
31100
|
+
lastChangedAt: 0
|
|
31101
|
+
}
|
|
31102
|
+
},
|
|
31103
|
+
runtimeState: RecordingSignalRuntimeStateSchema,
|
|
31104
|
+
/**
|
|
31105
|
+
* Runtime-state durability: **session** — a restored `active: true` from
|
|
31106
|
+
* before a restart is exactly the stale level the recorder's reconcile bound
|
|
31107
|
+
* exists to end, and the provider re-derives the true level on activation
|
|
31108
|
+
* anyway. Nothing is lost by forgetting it; a lie is avoided.
|
|
31109
|
+
*
|
|
31110
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
31111
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
31112
|
+
*/
|
|
31113
|
+
durability: "session"
|
|
31114
|
+
};
|
|
31115
|
+
/**
|
|
31013
31116
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
31014
31117
|
* a rect ROI on a camera frame and names one or more states; the engine
|
|
31015
31118
|
* (pipeline-analytics, designated post-processing node) reports which state is
|
|
@@ -31507,6 +31610,8 @@ var CamStreamDescriptorSchema = object({
|
|
|
31507
31610
|
deviceFeatures: array(string()).optional(),
|
|
31508
31611
|
/** Eligible for automatic profile assignment. Absent = `true`. */
|
|
31509
31612
|
autoEligible: boolean().optional(),
|
|
31613
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
31614
|
+
profileHint: CamProfileSchema.optional(),
|
|
31510
31615
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
31511
31616
|
metadata: record(string(), unknown()).optional()
|
|
31512
31617
|
});
|
|
@@ -33646,6 +33751,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
33646
33751
|
pressureSensor: pressureSensorCapability,
|
|
33647
33752
|
privacyMask: privacyMaskCapability,
|
|
33648
33753
|
ptzAutotrack: ptzAutotrackCapability,
|
|
33754
|
+
recordingSignal: recordingSignalCapability,
|
|
33649
33755
|
sceneMonitor: sceneMonitorCapability,
|
|
33650
33756
|
scriptRunner: scriptRunnerCapability,
|
|
33651
33757
|
smoke: smokeCapability,
|
|
@@ -34489,6 +34595,53 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
34489
34595
|
const ids = [...this._permanentRestoreFailures.keys()].join(", ");
|
|
34490
34596
|
return `${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${ids}) — restart the ${this.providerName} provider to retry`;
|
|
34491
34597
|
}
|
|
34598
|
+
/**
|
|
34599
|
+
* A top-level persisted row with NO configuration is a leftover, not a
|
|
34600
|
+
* device — quarantine it instead of dialling it.
|
|
34601
|
+
*
|
|
34602
|
+
* Device 614 was deleted, resurrected as a config-less shell by a write
|
|
34603
|
+
* already in flight (D376), and then dialled at every single boot: eight
|
|
34604
|
+
* `Failed to restore device — bounded retry scheduled` lines in one day,
|
|
34605
|
+
* each one the same Zod refusal on `host` and `password`. The bound was
|
|
34606
|
+
* real, but it is a bound PER PROCESS, and the runner restarts — so nothing
|
|
34607
|
+
* about the row ever stopped costing attempts and log lines.
|
|
34608
|
+
*
|
|
34609
|
+
* No retry can add a configuration that is not there. The row is reported
|
|
34610
|
+
* once, with its `deviceId`, and set aside.
|
|
34611
|
+
*
|
|
34612
|
+
* Top-level only: an accessory child legitimately carries an empty blob (it
|
|
34613
|
+
* lives off its parent), and a hub-adopted child with an emptied blob is
|
|
34614
|
+
* repaired by `healSavedConfig` from its parent instead. Providers that
|
|
34615
|
+
* genuinely create configuration-free top-level devices turn this off.
|
|
34616
|
+
*/
|
|
34617
|
+
quarantineConfiglessTopLevelRestores = true;
|
|
34618
|
+
isUnrestorableShell(saved) {
|
|
34619
|
+
if (!this.quarantineConfiglessTopLevelRestores) return false;
|
|
34620
|
+
if (saved.parentDeviceId !== null) return false;
|
|
34621
|
+
const config = saved.config;
|
|
34622
|
+
if (config === void 0) return false;
|
|
34623
|
+
return Object.keys(config).length === 0;
|
|
34624
|
+
}
|
|
34625
|
+
quarantineShell(saved) {
|
|
34626
|
+
this._permanentRestoreFailures.set(saved.id, {
|
|
34627
|
+
deviceId: saved.id,
|
|
34628
|
+
stableId: saved.stableId,
|
|
34629
|
+
type: saved.type,
|
|
34630
|
+
attempts: 0,
|
|
34631
|
+
lastError: "persisted row has no configuration",
|
|
34632
|
+
failedAt: Date.now()
|
|
34633
|
+
});
|
|
34634
|
+
this.ctx.logger.error("Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.", {
|
|
34635
|
+
tags: {
|
|
34636
|
+
deviceId: saved.id,
|
|
34637
|
+
stableId: saved.stableId
|
|
34638
|
+
},
|
|
34639
|
+
meta: {
|
|
34640
|
+
type: saved.type,
|
|
34641
|
+
provider: this.providerName
|
|
34642
|
+
}
|
|
34643
|
+
});
|
|
34644
|
+
}
|
|
34492
34645
|
cancelRestoreRetries() {
|
|
34493
34646
|
this._restoreRetryScheduler?.cancel();
|
|
34494
34647
|
this._restoreRetryScheduler = null;
|
|
@@ -34673,6 +34826,10 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
34673
34826
|
});
|
|
34674
34827
|
return;
|
|
34675
34828
|
}
|
|
34829
|
+
if (this.isUnrestorableShell(saved)) {
|
|
34830
|
+
this.quarantineShell(saved);
|
|
34831
|
+
return;
|
|
34832
|
+
}
|
|
34676
34833
|
try {
|
|
34677
34834
|
await attemptRestore(saved);
|
|
34678
34835
|
} catch (err) {
|
|
@@ -39393,6 +39550,12 @@ Object.freeze({
|
|
|
39393
39550
|
addonId: null,
|
|
39394
39551
|
access: "view"
|
|
39395
39552
|
},
|
|
39553
|
+
"recordingSignal.getStatus": {
|
|
39554
|
+
capName: "recording-signal",
|
|
39555
|
+
capScope: "device",
|
|
39556
|
+
addonId: null,
|
|
39557
|
+
access: "view"
|
|
39558
|
+
},
|
|
39396
39559
|
"sceneMonitor.captureReference": {
|
|
39397
39560
|
capName: "scene-monitor",
|
|
39398
39561
|
capScope: "device",
|
|
@@ -42385,6 +42548,11 @@ Object.freeze({
|
|
|
42385
42548
|
form: "single",
|
|
42386
42549
|
optional: true
|
|
42387
42550
|
}],
|
|
42551
|
+
"recordingSignal.getStatus": [{
|
|
42552
|
+
name: "deviceId",
|
|
42553
|
+
form: "single",
|
|
42554
|
+
optional: false
|
|
42555
|
+
}],
|
|
42388
42556
|
"sceneMonitor.captureReference": [{
|
|
42389
42557
|
name: "deviceId",
|
|
42390
42558
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -7546,6 +7546,21 @@ var CameraStreamSchema = object({
|
|
|
7546
7546
|
*/
|
|
7547
7547
|
autoEligible: boolean().optional(),
|
|
7548
7548
|
/**
|
|
7549
|
+
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
7550
|
+
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
7551
|
+
* stream. Consulted by the broker's automatic ranking
|
|
7552
|
+
* (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
|
|
7553
|
+
* an operator's manual assignment still wins, and an absent hint is the
|
|
7554
|
+
* pixel-ranked default every camera had before this field existed.
|
|
7555
|
+
*
|
|
7556
|
+
* Why it exists: a camera with ONE stream ranked to `mid` — the slot no
|
|
7557
|
+
* storage class is written for on its own (`recordings` is high|mid,
|
|
7558
|
+
* `recordingsLow` is low) and the one profile scrub does not read. The robot
|
|
7559
|
+
* camera's single 720p relay is a `low` in every respect except the slot the
|
|
7560
|
+
* heuristic put it in.
|
|
7561
|
+
*/
|
|
7562
|
+
profileHint: CamProfileSchema.optional(),
|
|
7563
|
+
/**
|
|
7549
7564
|
* Transport-specific opaque metadata. The broker passes it through to
|
|
7550
7565
|
* the source reader without inspecting it. Currently used by
|
|
7551
7566
|
* `pull-rfc4571` streams to carry the upstream SDP (so the reader can
|
|
@@ -8995,7 +9010,22 @@ var RecordingTriggersSchema = object({
|
|
|
8995
9010
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
8996
9011
|
* registrare.
|
|
8997
9012
|
*/
|
|
8998
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
9013
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
|
|
9014
|
+
/**
|
|
9015
|
+
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
9016
|
+
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
9017
|
+
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
9018
|
+
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
9019
|
+
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
9020
|
+
*
|
|
9021
|
+
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
9022
|
+
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
9023
|
+
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
9024
|
+
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
9025
|
+
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
9026
|
+
* (`holdTrigger` / `releaseTrigger`).
|
|
9027
|
+
*/
|
|
9028
|
+
deviceSignal: boolean().optional()
|
|
8999
9029
|
});
|
|
9000
9030
|
/**
|
|
9001
9031
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -12459,6 +12489,8 @@ method(object({
|
|
|
12459
12489
|
label: string().optional(),
|
|
12460
12490
|
deviceFeatures: array(string()).optional(),
|
|
12461
12491
|
autoEligible: boolean().optional(),
|
|
12492
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
12493
|
+
profileHint: CamProfileSchema.optional(),
|
|
12462
12494
|
metadata: record(string(), unknown()).optional(),
|
|
12463
12495
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
12464
12496
|
* derived broker reads its encoded plane from.
|
|
@@ -31009,6 +31041,77 @@ method(object({
|
|
|
31009
31041
|
auth: "protected"
|
|
31010
31042
|
});
|
|
31011
31043
|
/**
|
|
31044
|
+
* A camera's own "record me NOW" LEVEL — a signal the device raises while
|
|
31045
|
+
* something it knows about is happening (a robot vacuum cleaning, a machine
|
|
31046
|
+
* running, a gate open) and lowers when it stops.
|
|
31047
|
+
*
|
|
31048
|
+
* It is a level, not an edge. The sensor triggers the recorder already listens
|
|
31049
|
+
* to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
|
|
31050
|
+
* post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
|
|
31051
|
+
* still happening" cannot be expressed as an edge plus a post-buffer without
|
|
31052
|
+
* either re-triggering on a timer (polling — D224 forbids the consumer keeping
|
|
31053
|
+
* the fact fresh) or picking a post-buffer long enough to cover every job,
|
|
31054
|
+
* which records the dock for that long after every short one. So the recorder
|
|
31055
|
+
* reads the LEVEL: it records for as long as `active` is true, plus the band's
|
|
31056
|
+
* own post-buffer once it falls.
|
|
31057
|
+
*
|
|
31058
|
+
* Who owns the fact: the PROVIDER of the device, which already reads the state
|
|
31059
|
+
* the signal is derived from (the vacuum's lifecycle state, for Dreame). It
|
|
31060
|
+
* writes this slice on every change; consumers subscribe to the kernel's
|
|
31061
|
+
* `DeviceStateChanged` for it and read it back through
|
|
31062
|
+
* `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
|
|
31063
|
+
* against the device (D224, D8/D11).
|
|
31064
|
+
*
|
|
31065
|
+
* Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
|
|
31066
|
+
* to Home Assistant, HomeKit and the sensor picker as a thing an operator can
|
|
31067
|
+
* bind, and "the camera wants to record" is not a room sensor. It is a fact
|
|
31068
|
+
* about the camera, on the camera.
|
|
31069
|
+
*/
|
|
31070
|
+
var RecordingSignalStatusSchema = object({
|
|
31071
|
+
/** True while the device asks to be recorded. */
|
|
31072
|
+
active: boolean(),
|
|
31073
|
+
/**
|
|
31074
|
+
* Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
|
|
31075
|
+
* …). Free text for the log line and the UI badge; the recorder never
|
|
31076
|
+
* branches on it.
|
|
31077
|
+
*/
|
|
31078
|
+
reason: string(),
|
|
31079
|
+
/** Ms epoch of the last `active` transition. 0 if never observed. */
|
|
31080
|
+
lastChangedAt: number()
|
|
31081
|
+
});
|
|
31082
|
+
/** The runtime-state slice: the status plus the clock every slice carries. */
|
|
31083
|
+
var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
|
|
31084
|
+
var recordingSignalCapability = {
|
|
31085
|
+
name: "recording-signal",
|
|
31086
|
+
scope: "device",
|
|
31087
|
+
deviceNative: true,
|
|
31088
|
+
mode: "singleton",
|
|
31089
|
+
deviceTypes: [DeviceType.Camera],
|
|
31090
|
+
methods: {
|
|
31091
|
+
/** The current level, straight from the slice the provider keeps fresh. */
|
|
31092
|
+
getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
|
|
31093
|
+
status: {
|
|
31094
|
+
schema: RecordingSignalStatusSchema,
|
|
31095
|
+
kind: "push",
|
|
31096
|
+
empty: {
|
|
31097
|
+
active: false,
|
|
31098
|
+
reason: "unknown",
|
|
31099
|
+
lastChangedAt: 0
|
|
31100
|
+
}
|
|
31101
|
+
},
|
|
31102
|
+
runtimeState: RecordingSignalRuntimeStateSchema,
|
|
31103
|
+
/**
|
|
31104
|
+
* Runtime-state durability: **session** — a restored `active: true` from
|
|
31105
|
+
* before a restart is exactly the stale level the recorder's reconcile bound
|
|
31106
|
+
* exists to end, and the provider re-derives the true level on activation
|
|
31107
|
+
* anyway. Nothing is lost by forgetting it; a lie is avoided.
|
|
31108
|
+
*
|
|
31109
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
31110
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
31111
|
+
*/
|
|
31112
|
+
durability: "session"
|
|
31113
|
+
};
|
|
31114
|
+
/**
|
|
31012
31115
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
31013
31116
|
* a rect ROI on a camera frame and names one or more states; the engine
|
|
31014
31117
|
* (pipeline-analytics, designated post-processing node) reports which state is
|
|
@@ -31506,6 +31609,8 @@ var CamStreamDescriptorSchema = object({
|
|
|
31506
31609
|
deviceFeatures: array(string()).optional(),
|
|
31507
31610
|
/** Eligible for automatic profile assignment. Absent = `true`. */
|
|
31508
31611
|
autoEligible: boolean().optional(),
|
|
31612
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
31613
|
+
profileHint: CamProfileSchema.optional(),
|
|
31509
31614
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
31510
31615
|
metadata: record(string(), unknown()).optional()
|
|
31511
31616
|
});
|
|
@@ -33645,6 +33750,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
33645
33750
|
pressureSensor: pressureSensorCapability,
|
|
33646
33751
|
privacyMask: privacyMaskCapability,
|
|
33647
33752
|
ptzAutotrack: ptzAutotrackCapability,
|
|
33753
|
+
recordingSignal: recordingSignalCapability,
|
|
33648
33754
|
sceneMonitor: sceneMonitorCapability,
|
|
33649
33755
|
scriptRunner: scriptRunnerCapability,
|
|
33650
33756
|
smoke: smokeCapability,
|
|
@@ -34488,6 +34594,53 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
34488
34594
|
const ids = [...this._permanentRestoreFailures.keys()].join(", ");
|
|
34489
34595
|
return `${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${ids}) — restart the ${this.providerName} provider to retry`;
|
|
34490
34596
|
}
|
|
34597
|
+
/**
|
|
34598
|
+
* A top-level persisted row with NO configuration is a leftover, not a
|
|
34599
|
+
* device — quarantine it instead of dialling it.
|
|
34600
|
+
*
|
|
34601
|
+
* Device 614 was deleted, resurrected as a config-less shell by a write
|
|
34602
|
+
* already in flight (D376), and then dialled at every single boot: eight
|
|
34603
|
+
* `Failed to restore device — bounded retry scheduled` lines in one day,
|
|
34604
|
+
* each one the same Zod refusal on `host` and `password`. The bound was
|
|
34605
|
+
* real, but it is a bound PER PROCESS, and the runner restarts — so nothing
|
|
34606
|
+
* about the row ever stopped costing attempts and log lines.
|
|
34607
|
+
*
|
|
34608
|
+
* No retry can add a configuration that is not there. The row is reported
|
|
34609
|
+
* once, with its `deviceId`, and set aside.
|
|
34610
|
+
*
|
|
34611
|
+
* Top-level only: an accessory child legitimately carries an empty blob (it
|
|
34612
|
+
* lives off its parent), and a hub-adopted child with an emptied blob is
|
|
34613
|
+
* repaired by `healSavedConfig` from its parent instead. Providers that
|
|
34614
|
+
* genuinely create configuration-free top-level devices turn this off.
|
|
34615
|
+
*/
|
|
34616
|
+
quarantineConfiglessTopLevelRestores = true;
|
|
34617
|
+
isUnrestorableShell(saved) {
|
|
34618
|
+
if (!this.quarantineConfiglessTopLevelRestores) return false;
|
|
34619
|
+
if (saved.parentDeviceId !== null) return false;
|
|
34620
|
+
const config = saved.config;
|
|
34621
|
+
if (config === void 0) return false;
|
|
34622
|
+
return Object.keys(config).length === 0;
|
|
34623
|
+
}
|
|
34624
|
+
quarantineShell(saved) {
|
|
34625
|
+
this._permanentRestoreFailures.set(saved.id, {
|
|
34626
|
+
deviceId: saved.id,
|
|
34627
|
+
stableId: saved.stableId,
|
|
34628
|
+
type: saved.type,
|
|
34629
|
+
attempts: 0,
|
|
34630
|
+
lastError: "persisted row has no configuration",
|
|
34631
|
+
failedAt: Date.now()
|
|
34632
|
+
});
|
|
34633
|
+
this.ctx.logger.error("Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.", {
|
|
34634
|
+
tags: {
|
|
34635
|
+
deviceId: saved.id,
|
|
34636
|
+
stableId: saved.stableId
|
|
34637
|
+
},
|
|
34638
|
+
meta: {
|
|
34639
|
+
type: saved.type,
|
|
34640
|
+
provider: this.providerName
|
|
34641
|
+
}
|
|
34642
|
+
});
|
|
34643
|
+
}
|
|
34491
34644
|
cancelRestoreRetries() {
|
|
34492
34645
|
this._restoreRetryScheduler?.cancel();
|
|
34493
34646
|
this._restoreRetryScheduler = null;
|
|
@@ -34672,6 +34825,10 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
34672
34825
|
});
|
|
34673
34826
|
return;
|
|
34674
34827
|
}
|
|
34828
|
+
if (this.isUnrestorableShell(saved)) {
|
|
34829
|
+
this.quarantineShell(saved);
|
|
34830
|
+
return;
|
|
34831
|
+
}
|
|
34675
34832
|
try {
|
|
34676
34833
|
await attemptRestore(saved);
|
|
34677
34834
|
} catch (err) {
|
|
@@ -39392,6 +39549,12 @@ Object.freeze({
|
|
|
39392
39549
|
addonId: null,
|
|
39393
39550
|
access: "view"
|
|
39394
39551
|
},
|
|
39552
|
+
"recordingSignal.getStatus": {
|
|
39553
|
+
capName: "recording-signal",
|
|
39554
|
+
capScope: "device",
|
|
39555
|
+
addonId: null,
|
|
39556
|
+
access: "view"
|
|
39557
|
+
},
|
|
39395
39558
|
"sceneMonitor.captureReference": {
|
|
39396
39559
|
capName: "scene-monitor",
|
|
39397
39560
|
capScope: "device",
|
|
@@ -42384,6 +42547,11 @@ Object.freeze({
|
|
|
42384
42547
|
form: "single",
|
|
42385
42548
|
optional: true
|
|
42386
42549
|
}],
|
|
42550
|
+
"recordingSignal.getStatus": [{
|
|
42551
|
+
name: "deviceId",
|
|
42552
|
+
form: "single",
|
|
42553
|
+
optional: false
|
|
42554
|
+
}],
|
|
42387
42555
|
"sceneMonitor.captureReference": [{
|
|
42388
42556
|
name: "deviceId",
|
|
42389
42557
|
form: "single",
|
package/package.json
CHANGED