@camstack/addon-provider-rademacher 0.2.71 → 0.2.73
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
|
@@ -7430,6 +7430,21 @@ var CameraStreamSchema = object({
|
|
|
7430
7430
|
*/
|
|
7431
7431
|
autoEligible: boolean().optional(),
|
|
7432
7432
|
/**
|
|
7433
|
+
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
7434
|
+
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
7435
|
+
* stream. Consulted by the broker's automatic ranking
|
|
7436
|
+
* (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
|
|
7437
|
+
* an operator's manual assignment still wins, and an absent hint is the
|
|
7438
|
+
* pixel-ranked default every camera had before this field existed.
|
|
7439
|
+
*
|
|
7440
|
+
* Why it exists: a camera with ONE stream ranked to `mid` — the slot no
|
|
7441
|
+
* storage class is written for on its own (`recordings` is high|mid,
|
|
7442
|
+
* `recordingsLow` is low) and the one profile scrub does not read. The robot
|
|
7443
|
+
* camera's single 720p relay is a `low` in every respect except the slot the
|
|
7444
|
+
* heuristic put it in.
|
|
7445
|
+
*/
|
|
7446
|
+
profileHint: CamProfileSchema.optional(),
|
|
7447
|
+
/**
|
|
7433
7448
|
* Transport-specific opaque metadata. The broker passes it through to
|
|
7434
7449
|
* the source reader without inspecting it. Currently used by
|
|
7435
7450
|
* `pull-rfc4571` streams to carry the upstream SDP (so the reader can
|
|
@@ -8879,7 +8894,22 @@ var RecordingTriggersSchema = object({
|
|
|
8879
8894
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
8880
8895
|
* registrare.
|
|
8881
8896
|
*/
|
|
8882
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
8897
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
|
|
8898
|
+
/**
|
|
8899
|
+
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
8900
|
+
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
8901
|
+
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
8902
|
+
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
8903
|
+
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
8904
|
+
*
|
|
8905
|
+
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
8906
|
+
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
8907
|
+
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
8908
|
+
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
8909
|
+
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
8910
|
+
* (`holdTrigger` / `releaseTrigger`).
|
|
8911
|
+
*/
|
|
8912
|
+
deviceSignal: boolean().optional()
|
|
8883
8913
|
});
|
|
8884
8914
|
/**
|
|
8885
8915
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -12343,6 +12373,8 @@ method(object({
|
|
|
12343
12373
|
label: string().optional(),
|
|
12344
12374
|
deviceFeatures: array(string()).optional(),
|
|
12345
12375
|
autoEligible: boolean().optional(),
|
|
12376
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
12377
|
+
profileHint: CamProfileSchema.optional(),
|
|
12346
12378
|
metadata: record(string(), unknown()).optional(),
|
|
12347
12379
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
12348
12380
|
* derived broker reads its encoded plane from.
|
|
@@ -30868,6 +30900,77 @@ method(object({
|
|
|
30868
30900
|
auth: "protected"
|
|
30869
30901
|
});
|
|
30870
30902
|
/**
|
|
30903
|
+
* A camera's own "record me NOW" LEVEL — a signal the device raises while
|
|
30904
|
+
* something it knows about is happening (a robot vacuum cleaning, a machine
|
|
30905
|
+
* running, a gate open) and lowers when it stops.
|
|
30906
|
+
*
|
|
30907
|
+
* It is a level, not an edge. The sensor triggers the recorder already listens
|
|
30908
|
+
* to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
|
|
30909
|
+
* post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
|
|
30910
|
+
* still happening" cannot be expressed as an edge plus a post-buffer without
|
|
30911
|
+
* either re-triggering on a timer (polling — D224 forbids the consumer keeping
|
|
30912
|
+
* the fact fresh) or picking a post-buffer long enough to cover every job,
|
|
30913
|
+
* which records the dock for that long after every short one. So the recorder
|
|
30914
|
+
* reads the LEVEL: it records for as long as `active` is true, plus the band's
|
|
30915
|
+
* own post-buffer once it falls.
|
|
30916
|
+
*
|
|
30917
|
+
* Who owns the fact: the PROVIDER of the device, which already reads the state
|
|
30918
|
+
* the signal is derived from (the vacuum's lifecycle state, for Dreame). It
|
|
30919
|
+
* writes this slice on every change; consumers subscribe to the kernel's
|
|
30920
|
+
* `DeviceStateChanged` for it and read it back through
|
|
30921
|
+
* `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
|
|
30922
|
+
* against the device (D224, D8/D11).
|
|
30923
|
+
*
|
|
30924
|
+
* Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
|
|
30925
|
+
* to Home Assistant, HomeKit and the sensor picker as a thing an operator can
|
|
30926
|
+
* bind, and "the camera wants to record" is not a room sensor. It is a fact
|
|
30927
|
+
* about the camera, on the camera.
|
|
30928
|
+
*/
|
|
30929
|
+
var RecordingSignalStatusSchema = object({
|
|
30930
|
+
/** True while the device asks to be recorded. */
|
|
30931
|
+
active: boolean(),
|
|
30932
|
+
/**
|
|
30933
|
+
* Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
|
|
30934
|
+
* …). Free text for the log line and the UI badge; the recorder never
|
|
30935
|
+
* branches on it.
|
|
30936
|
+
*/
|
|
30937
|
+
reason: string(),
|
|
30938
|
+
/** Ms epoch of the last `active` transition. 0 if never observed. */
|
|
30939
|
+
lastChangedAt: number()
|
|
30940
|
+
});
|
|
30941
|
+
/** The runtime-state slice: the status plus the clock every slice carries. */
|
|
30942
|
+
var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
|
|
30943
|
+
var recordingSignalCapability = {
|
|
30944
|
+
name: "recording-signal",
|
|
30945
|
+
scope: "device",
|
|
30946
|
+
deviceNative: true,
|
|
30947
|
+
mode: "singleton",
|
|
30948
|
+
deviceTypes: [DeviceType.Camera],
|
|
30949
|
+
methods: {
|
|
30950
|
+
/** The current level, straight from the slice the provider keeps fresh. */
|
|
30951
|
+
getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
|
|
30952
|
+
status: {
|
|
30953
|
+
schema: RecordingSignalStatusSchema,
|
|
30954
|
+
kind: "push",
|
|
30955
|
+
empty: {
|
|
30956
|
+
active: false,
|
|
30957
|
+
reason: "unknown",
|
|
30958
|
+
lastChangedAt: 0
|
|
30959
|
+
}
|
|
30960
|
+
},
|
|
30961
|
+
runtimeState: RecordingSignalRuntimeStateSchema,
|
|
30962
|
+
/**
|
|
30963
|
+
* Runtime-state durability: **session** — a restored `active: true` from
|
|
30964
|
+
* before a restart is exactly the stale level the recorder's reconcile bound
|
|
30965
|
+
* exists to end, and the provider re-derives the true level on activation
|
|
30966
|
+
* anyway. Nothing is lost by forgetting it; a lie is avoided.
|
|
30967
|
+
*
|
|
30968
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
30969
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
30970
|
+
*/
|
|
30971
|
+
durability: "session"
|
|
30972
|
+
};
|
|
30973
|
+
/**
|
|
30871
30974
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
30872
30975
|
* a rect ROI on a camera frame and names one or more states; the engine
|
|
30873
30976
|
* (pipeline-analytics, designated post-processing node) reports which state is
|
|
@@ -31365,6 +31468,8 @@ var CamStreamDescriptorSchema = object({
|
|
|
31365
31468
|
deviceFeatures: array(string()).optional(),
|
|
31366
31469
|
/** Eligible for automatic profile assignment. Absent = `true`. */
|
|
31367
31470
|
autoEligible: boolean().optional(),
|
|
31471
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
31472
|
+
profileHint: CamProfileSchema.optional(),
|
|
31368
31473
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
31369
31474
|
metadata: record(string(), unknown()).optional()
|
|
31370
31475
|
});
|
|
@@ -33504,6 +33609,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
33504
33609
|
pressureSensor: pressureSensorCapability,
|
|
33505
33610
|
privacyMask: privacyMaskCapability,
|
|
33506
33611
|
ptzAutotrack: ptzAutotrackCapability,
|
|
33612
|
+
recordingSignal: recordingSignalCapability,
|
|
33507
33613
|
sceneMonitor: sceneMonitorCapability,
|
|
33508
33614
|
scriptRunner: scriptRunnerCapability,
|
|
33509
33615
|
smoke: smokeCapability,
|
|
@@ -34347,6 +34453,53 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
34347
34453
|
const ids = [...this._permanentRestoreFailures.keys()].join(", ");
|
|
34348
34454
|
return `${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${ids}) — restart the ${this.providerName} provider to retry`;
|
|
34349
34455
|
}
|
|
34456
|
+
/**
|
|
34457
|
+
* A top-level persisted row with NO configuration is a leftover, not a
|
|
34458
|
+
* device — quarantine it instead of dialling it.
|
|
34459
|
+
*
|
|
34460
|
+
* Device 614 was deleted, resurrected as a config-less shell by a write
|
|
34461
|
+
* already in flight (D376), and then dialled at every single boot: eight
|
|
34462
|
+
* `Failed to restore device — bounded retry scheduled` lines in one day,
|
|
34463
|
+
* each one the same Zod refusal on `host` and `password`. The bound was
|
|
34464
|
+
* real, but it is a bound PER PROCESS, and the runner restarts — so nothing
|
|
34465
|
+
* about the row ever stopped costing attempts and log lines.
|
|
34466
|
+
*
|
|
34467
|
+
* No retry can add a configuration that is not there. The row is reported
|
|
34468
|
+
* once, with its `deviceId`, and set aside.
|
|
34469
|
+
*
|
|
34470
|
+
* Top-level only: an accessory child legitimately carries an empty blob (it
|
|
34471
|
+
* lives off its parent), and a hub-adopted child with an emptied blob is
|
|
34472
|
+
* repaired by `healSavedConfig` from its parent instead. Providers that
|
|
34473
|
+
* genuinely create configuration-free top-level devices turn this off.
|
|
34474
|
+
*/
|
|
34475
|
+
quarantineConfiglessTopLevelRestores = true;
|
|
34476
|
+
isUnrestorableShell(saved) {
|
|
34477
|
+
if (!this.quarantineConfiglessTopLevelRestores) return false;
|
|
34478
|
+
if (saved.parentDeviceId !== null) return false;
|
|
34479
|
+
const config = saved.config;
|
|
34480
|
+
if (config === void 0) return false;
|
|
34481
|
+
return Object.keys(config).length === 0;
|
|
34482
|
+
}
|
|
34483
|
+
quarantineShell(saved) {
|
|
34484
|
+
this._permanentRestoreFailures.set(saved.id, {
|
|
34485
|
+
deviceId: saved.id,
|
|
34486
|
+
stableId: saved.stableId,
|
|
34487
|
+
type: saved.type,
|
|
34488
|
+
attempts: 0,
|
|
34489
|
+
lastError: "persisted row has no configuration",
|
|
34490
|
+
failedAt: Date.now()
|
|
34491
|
+
});
|
|
34492
|
+
this.ctx.logger.error("Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.", {
|
|
34493
|
+
tags: {
|
|
34494
|
+
deviceId: saved.id,
|
|
34495
|
+
stableId: saved.stableId
|
|
34496
|
+
},
|
|
34497
|
+
meta: {
|
|
34498
|
+
type: saved.type,
|
|
34499
|
+
provider: this.providerName
|
|
34500
|
+
}
|
|
34501
|
+
});
|
|
34502
|
+
}
|
|
34350
34503
|
cancelRestoreRetries() {
|
|
34351
34504
|
this._restoreRetryScheduler?.cancel();
|
|
34352
34505
|
this._restoreRetryScheduler = null;
|
|
@@ -34531,6 +34684,10 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
34531
34684
|
});
|
|
34532
34685
|
return;
|
|
34533
34686
|
}
|
|
34687
|
+
if (this.isUnrestorableShell(saved)) {
|
|
34688
|
+
this.quarantineShell(saved);
|
|
34689
|
+
return;
|
|
34690
|
+
}
|
|
34534
34691
|
try {
|
|
34535
34692
|
await attemptRestore(saved);
|
|
34536
34693
|
} catch (err) {
|
|
@@ -39251,6 +39408,12 @@ Object.freeze({
|
|
|
39251
39408
|
addonId: null,
|
|
39252
39409
|
access: "view"
|
|
39253
39410
|
},
|
|
39411
|
+
"recordingSignal.getStatus": {
|
|
39412
|
+
capName: "recording-signal",
|
|
39413
|
+
capScope: "device",
|
|
39414
|
+
addonId: null,
|
|
39415
|
+
access: "view"
|
|
39416
|
+
},
|
|
39254
39417
|
"sceneMonitor.captureReference": {
|
|
39255
39418
|
capName: "scene-monitor",
|
|
39256
39419
|
capScope: "device",
|
|
@@ -42243,6 +42406,11 @@ Object.freeze({
|
|
|
42243
42406
|
form: "single",
|
|
42244
42407
|
optional: true
|
|
42245
42408
|
}],
|
|
42409
|
+
"recordingSignal.getStatus": [{
|
|
42410
|
+
name: "deviceId",
|
|
42411
|
+
form: "single",
|
|
42412
|
+
optional: false
|
|
42413
|
+
}],
|
|
42246
42414
|
"sceneMonitor.captureReference": [{
|
|
42247
42415
|
name: "deviceId",
|
|
42248
42416
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -7429,6 +7429,21 @@ var CameraStreamSchema = object({
|
|
|
7429
7429
|
*/
|
|
7430
7430
|
autoEligible: boolean().optional(),
|
|
7431
7431
|
/**
|
|
7432
|
+
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
7433
|
+
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
7434
|
+
* stream. Consulted by the broker's automatic ranking
|
|
7435
|
+
* (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
|
|
7436
|
+
* an operator's manual assignment still wins, and an absent hint is the
|
|
7437
|
+
* pixel-ranked default every camera had before this field existed.
|
|
7438
|
+
*
|
|
7439
|
+
* Why it exists: a camera with ONE stream ranked to `mid` — the slot no
|
|
7440
|
+
* storage class is written for on its own (`recordings` is high|mid,
|
|
7441
|
+
* `recordingsLow` is low) and the one profile scrub does not read. The robot
|
|
7442
|
+
* camera's single 720p relay is a `low` in every respect except the slot the
|
|
7443
|
+
* heuristic put it in.
|
|
7444
|
+
*/
|
|
7445
|
+
profileHint: CamProfileSchema.optional(),
|
|
7446
|
+
/**
|
|
7432
7447
|
* Transport-specific opaque metadata. The broker passes it through to
|
|
7433
7448
|
* the source reader without inspecting it. Currently used by
|
|
7434
7449
|
* `pull-rfc4571` streams to carry the upstream SDP (so the reader can
|
|
@@ -8878,7 +8893,22 @@ var RecordingTriggersSchema = object({
|
|
|
8878
8893
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
8879
8894
|
* registrare.
|
|
8880
8895
|
*/
|
|
8881
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
8896
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
|
|
8897
|
+
/**
|
|
8898
|
+
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
8899
|
+
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
8900
|
+
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
8901
|
+
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
8902
|
+
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
8903
|
+
*
|
|
8904
|
+
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
8905
|
+
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
8906
|
+
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
8907
|
+
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
8908
|
+
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
8909
|
+
* (`holdTrigger` / `releaseTrigger`).
|
|
8910
|
+
*/
|
|
8911
|
+
deviceSignal: boolean().optional()
|
|
8882
8912
|
});
|
|
8883
8913
|
/**
|
|
8884
8914
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -12342,6 +12372,8 @@ method(object({
|
|
|
12342
12372
|
label: string().optional(),
|
|
12343
12373
|
deviceFeatures: array(string()).optional(),
|
|
12344
12374
|
autoEligible: boolean().optional(),
|
|
12375
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
12376
|
+
profileHint: CamProfileSchema.optional(),
|
|
12345
12377
|
metadata: record(string(), unknown()).optional(),
|
|
12346
12378
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
12347
12379
|
* derived broker reads its encoded plane from.
|
|
@@ -30867,6 +30899,77 @@ method(object({
|
|
|
30867
30899
|
auth: "protected"
|
|
30868
30900
|
});
|
|
30869
30901
|
/**
|
|
30902
|
+
* A camera's own "record me NOW" LEVEL — a signal the device raises while
|
|
30903
|
+
* something it knows about is happening (a robot vacuum cleaning, a machine
|
|
30904
|
+
* running, a gate open) and lowers when it stops.
|
|
30905
|
+
*
|
|
30906
|
+
* It is a level, not an edge. The sensor triggers the recorder already listens
|
|
30907
|
+
* to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
|
|
30908
|
+
* post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
|
|
30909
|
+
* still happening" cannot be expressed as an edge plus a post-buffer without
|
|
30910
|
+
* either re-triggering on a timer (polling — D224 forbids the consumer keeping
|
|
30911
|
+
* the fact fresh) or picking a post-buffer long enough to cover every job,
|
|
30912
|
+
* which records the dock for that long after every short one. So the recorder
|
|
30913
|
+
* reads the LEVEL: it records for as long as `active` is true, plus the band's
|
|
30914
|
+
* own post-buffer once it falls.
|
|
30915
|
+
*
|
|
30916
|
+
* Who owns the fact: the PROVIDER of the device, which already reads the state
|
|
30917
|
+
* the signal is derived from (the vacuum's lifecycle state, for Dreame). It
|
|
30918
|
+
* writes this slice on every change; consumers subscribe to the kernel's
|
|
30919
|
+
* `DeviceStateChanged` for it and read it back through
|
|
30920
|
+
* `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
|
|
30921
|
+
* against the device (D224, D8/D11).
|
|
30922
|
+
*
|
|
30923
|
+
* Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
|
|
30924
|
+
* to Home Assistant, HomeKit and the sensor picker as a thing an operator can
|
|
30925
|
+
* bind, and "the camera wants to record" is not a room sensor. It is a fact
|
|
30926
|
+
* about the camera, on the camera.
|
|
30927
|
+
*/
|
|
30928
|
+
var RecordingSignalStatusSchema = object({
|
|
30929
|
+
/** True while the device asks to be recorded. */
|
|
30930
|
+
active: boolean(),
|
|
30931
|
+
/**
|
|
30932
|
+
* Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
|
|
30933
|
+
* …). Free text for the log line and the UI badge; the recorder never
|
|
30934
|
+
* branches on it.
|
|
30935
|
+
*/
|
|
30936
|
+
reason: string(),
|
|
30937
|
+
/** Ms epoch of the last `active` transition. 0 if never observed. */
|
|
30938
|
+
lastChangedAt: number()
|
|
30939
|
+
});
|
|
30940
|
+
/** The runtime-state slice: the status plus the clock every slice carries. */
|
|
30941
|
+
var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
|
|
30942
|
+
var recordingSignalCapability = {
|
|
30943
|
+
name: "recording-signal",
|
|
30944
|
+
scope: "device",
|
|
30945
|
+
deviceNative: true,
|
|
30946
|
+
mode: "singleton",
|
|
30947
|
+
deviceTypes: [DeviceType.Camera],
|
|
30948
|
+
methods: {
|
|
30949
|
+
/** The current level, straight from the slice the provider keeps fresh. */
|
|
30950
|
+
getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
|
|
30951
|
+
status: {
|
|
30952
|
+
schema: RecordingSignalStatusSchema,
|
|
30953
|
+
kind: "push",
|
|
30954
|
+
empty: {
|
|
30955
|
+
active: false,
|
|
30956
|
+
reason: "unknown",
|
|
30957
|
+
lastChangedAt: 0
|
|
30958
|
+
}
|
|
30959
|
+
},
|
|
30960
|
+
runtimeState: RecordingSignalRuntimeStateSchema,
|
|
30961
|
+
/**
|
|
30962
|
+
* Runtime-state durability: **session** — a restored `active: true` from
|
|
30963
|
+
* before a restart is exactly the stale level the recorder's reconcile bound
|
|
30964
|
+
* exists to end, and the provider re-derives the true level on activation
|
|
30965
|
+
* anyway. Nothing is lost by forgetting it; a lie is avoided.
|
|
30966
|
+
*
|
|
30967
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
30968
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
30969
|
+
*/
|
|
30970
|
+
durability: "session"
|
|
30971
|
+
};
|
|
30972
|
+
/**
|
|
30870
30973
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
30871
30974
|
* a rect ROI on a camera frame and names one or more states; the engine
|
|
30872
30975
|
* (pipeline-analytics, designated post-processing node) reports which state is
|
|
@@ -31364,6 +31467,8 @@ var CamStreamDescriptorSchema = object({
|
|
|
31364
31467
|
deviceFeatures: array(string()).optional(),
|
|
31365
31468
|
/** Eligible for automatic profile assignment. Absent = `true`. */
|
|
31366
31469
|
autoEligible: boolean().optional(),
|
|
31470
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
31471
|
+
profileHint: CamProfileSchema.optional(),
|
|
31367
31472
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
31368
31473
|
metadata: record(string(), unknown()).optional()
|
|
31369
31474
|
});
|
|
@@ -33503,6 +33608,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
33503
33608
|
pressureSensor: pressureSensorCapability,
|
|
33504
33609
|
privacyMask: privacyMaskCapability,
|
|
33505
33610
|
ptzAutotrack: ptzAutotrackCapability,
|
|
33611
|
+
recordingSignal: recordingSignalCapability,
|
|
33506
33612
|
sceneMonitor: sceneMonitorCapability,
|
|
33507
33613
|
scriptRunner: scriptRunnerCapability,
|
|
33508
33614
|
smoke: smokeCapability,
|
|
@@ -34346,6 +34452,53 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
34346
34452
|
const ids = [...this._permanentRestoreFailures.keys()].join(", ");
|
|
34347
34453
|
return `${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${ids}) — restart the ${this.providerName} provider to retry`;
|
|
34348
34454
|
}
|
|
34455
|
+
/**
|
|
34456
|
+
* A top-level persisted row with NO configuration is a leftover, not a
|
|
34457
|
+
* device — quarantine it instead of dialling it.
|
|
34458
|
+
*
|
|
34459
|
+
* Device 614 was deleted, resurrected as a config-less shell by a write
|
|
34460
|
+
* already in flight (D376), and then dialled at every single boot: eight
|
|
34461
|
+
* `Failed to restore device — bounded retry scheduled` lines in one day,
|
|
34462
|
+
* each one the same Zod refusal on `host` and `password`. The bound was
|
|
34463
|
+
* real, but it is a bound PER PROCESS, and the runner restarts — so nothing
|
|
34464
|
+
* about the row ever stopped costing attempts and log lines.
|
|
34465
|
+
*
|
|
34466
|
+
* No retry can add a configuration that is not there. The row is reported
|
|
34467
|
+
* once, with its `deviceId`, and set aside.
|
|
34468
|
+
*
|
|
34469
|
+
* Top-level only: an accessory child legitimately carries an empty blob (it
|
|
34470
|
+
* lives off its parent), and a hub-adopted child with an emptied blob is
|
|
34471
|
+
* repaired by `healSavedConfig` from its parent instead. Providers that
|
|
34472
|
+
* genuinely create configuration-free top-level devices turn this off.
|
|
34473
|
+
*/
|
|
34474
|
+
quarantineConfiglessTopLevelRestores = true;
|
|
34475
|
+
isUnrestorableShell(saved) {
|
|
34476
|
+
if (!this.quarantineConfiglessTopLevelRestores) return false;
|
|
34477
|
+
if (saved.parentDeviceId !== null) return false;
|
|
34478
|
+
const config = saved.config;
|
|
34479
|
+
if (config === void 0) return false;
|
|
34480
|
+
return Object.keys(config).length === 0;
|
|
34481
|
+
}
|
|
34482
|
+
quarantineShell(saved) {
|
|
34483
|
+
this._permanentRestoreFailures.set(saved.id, {
|
|
34484
|
+
deviceId: saved.id,
|
|
34485
|
+
stableId: saved.stableId,
|
|
34486
|
+
type: saved.type,
|
|
34487
|
+
attempts: 0,
|
|
34488
|
+
lastError: "persisted row has no configuration",
|
|
34489
|
+
failedAt: Date.now()
|
|
34490
|
+
});
|
|
34491
|
+
this.ctx.logger.error("Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.", {
|
|
34492
|
+
tags: {
|
|
34493
|
+
deviceId: saved.id,
|
|
34494
|
+
stableId: saved.stableId
|
|
34495
|
+
},
|
|
34496
|
+
meta: {
|
|
34497
|
+
type: saved.type,
|
|
34498
|
+
provider: this.providerName
|
|
34499
|
+
}
|
|
34500
|
+
});
|
|
34501
|
+
}
|
|
34349
34502
|
cancelRestoreRetries() {
|
|
34350
34503
|
this._restoreRetryScheduler?.cancel();
|
|
34351
34504
|
this._restoreRetryScheduler = null;
|
|
@@ -34530,6 +34683,10 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
34530
34683
|
});
|
|
34531
34684
|
return;
|
|
34532
34685
|
}
|
|
34686
|
+
if (this.isUnrestorableShell(saved)) {
|
|
34687
|
+
this.quarantineShell(saved);
|
|
34688
|
+
return;
|
|
34689
|
+
}
|
|
34533
34690
|
try {
|
|
34534
34691
|
await attemptRestore(saved);
|
|
34535
34692
|
} catch (err) {
|
|
@@ -39250,6 +39407,12 @@ Object.freeze({
|
|
|
39250
39407
|
addonId: null,
|
|
39251
39408
|
access: "view"
|
|
39252
39409
|
},
|
|
39410
|
+
"recordingSignal.getStatus": {
|
|
39411
|
+
capName: "recording-signal",
|
|
39412
|
+
capScope: "device",
|
|
39413
|
+
addonId: null,
|
|
39414
|
+
access: "view"
|
|
39415
|
+
},
|
|
39253
39416
|
"sceneMonitor.captureReference": {
|
|
39254
39417
|
capName: "scene-monitor",
|
|
39255
39418
|
capScope: "device",
|
|
@@ -42242,6 +42405,11 @@ Object.freeze({
|
|
|
42242
42405
|
form: "single",
|
|
42243
42406
|
optional: true
|
|
42244
42407
|
}],
|
|
42408
|
+
"recordingSignal.getStatus": [{
|
|
42409
|
+
name: "deviceId",
|
|
42410
|
+
form: "single",
|
|
42411
|
+
optional: false
|
|
42412
|
+
}],
|
|
42245
42413
|
"sceneMonitor.captureReference": [{
|
|
42246
42414
|
name: "deviceId",
|
|
42247
42415
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-rademacher",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.73",
|
|
4
4
|
"description": "Rademacher HomePilot device-provider addon for CamStack — wraps the @apocaliss92/noderademacher local-hub client (roller shutters over the cover cap)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|