@camstack/addon-provider-amcrest 0.2.74 → 0.2.76
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
|
@@ -6452,6 +6452,21 @@ var CameraStreamSchema = object({
|
|
|
6452
6452
|
*/
|
|
6453
6453
|
autoEligible: boolean().optional(),
|
|
6454
6454
|
/**
|
|
6455
|
+
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
6456
|
+
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
6457
|
+
* stream. Consulted by the broker's automatic ranking
|
|
6458
|
+
* (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
|
|
6459
|
+
* an operator's manual assignment still wins, and an absent hint is the
|
|
6460
|
+
* pixel-ranked default every camera had before this field existed.
|
|
6461
|
+
*
|
|
6462
|
+
* Why it exists: a camera with ONE stream ranked to `mid` — the slot no
|
|
6463
|
+
* storage class is written for on its own (`recordings` is high|mid,
|
|
6464
|
+
* `recordingsLow` is low) and the one profile scrub does not read. The robot
|
|
6465
|
+
* camera's single 720p relay is a `low` in every respect except the slot the
|
|
6466
|
+
* heuristic put it in.
|
|
6467
|
+
*/
|
|
6468
|
+
profileHint: CamProfileSchema.optional(),
|
|
6469
|
+
/**
|
|
6455
6470
|
* Transport-specific opaque metadata. The broker passes it through to
|
|
6456
6471
|
* the source reader without inspecting it. Currently used by
|
|
6457
6472
|
* `pull-rfc4571` streams to carry the upstream SDP (so the reader can
|
|
@@ -7889,7 +7904,22 @@ var RecordingTriggersSchema = object({
|
|
|
7889
7904
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
7890
7905
|
* registrare.
|
|
7891
7906
|
*/
|
|
7892
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
7907
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
|
|
7908
|
+
/**
|
|
7909
|
+
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
7910
|
+
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
7911
|
+
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
7912
|
+
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
7913
|
+
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
7914
|
+
*
|
|
7915
|
+
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
7916
|
+
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
7917
|
+
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
7918
|
+
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
7919
|
+
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
7920
|
+
* (`holdTrigger` / `releaseTrigger`).
|
|
7921
|
+
*/
|
|
7922
|
+
deviceSignal: boolean().optional()
|
|
7893
7923
|
});
|
|
7894
7924
|
/**
|
|
7895
7925
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -11353,6 +11383,8 @@ method(object({
|
|
|
11353
11383
|
label: string().optional(),
|
|
11354
11384
|
deviceFeatures: array(string()).optional(),
|
|
11355
11385
|
autoEligible: boolean().optional(),
|
|
11386
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
11387
|
+
profileHint: CamProfileSchema.optional(),
|
|
11356
11388
|
metadata: record(string(), unknown()).optional(),
|
|
11357
11389
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
11358
11390
|
* derived broker reads its encoded plane from.
|
|
@@ -30090,6 +30122,77 @@ method(object({
|
|
|
30090
30122
|
auth: "protected"
|
|
30091
30123
|
});
|
|
30092
30124
|
/**
|
|
30125
|
+
* A camera's own "record me NOW" LEVEL — a signal the device raises while
|
|
30126
|
+
* something it knows about is happening (a robot vacuum cleaning, a machine
|
|
30127
|
+
* running, a gate open) and lowers when it stops.
|
|
30128
|
+
*
|
|
30129
|
+
* It is a level, not an edge. The sensor triggers the recorder already listens
|
|
30130
|
+
* to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
|
|
30131
|
+
* post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
|
|
30132
|
+
* still happening" cannot be expressed as an edge plus a post-buffer without
|
|
30133
|
+
* either re-triggering on a timer (polling — D224 forbids the consumer keeping
|
|
30134
|
+
* the fact fresh) or picking a post-buffer long enough to cover every job,
|
|
30135
|
+
* which records the dock for that long after every short one. So the recorder
|
|
30136
|
+
* reads the LEVEL: it records for as long as `active` is true, plus the band's
|
|
30137
|
+
* own post-buffer once it falls.
|
|
30138
|
+
*
|
|
30139
|
+
* Who owns the fact: the PROVIDER of the device, which already reads the state
|
|
30140
|
+
* the signal is derived from (the vacuum's lifecycle state, for Dreame). It
|
|
30141
|
+
* writes this slice on every change; consumers subscribe to the kernel's
|
|
30142
|
+
* `DeviceStateChanged` for it and read it back through
|
|
30143
|
+
* `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
|
|
30144
|
+
* against the device (D224, D8/D11).
|
|
30145
|
+
*
|
|
30146
|
+
* Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
|
|
30147
|
+
* to Home Assistant, HomeKit and the sensor picker as a thing an operator can
|
|
30148
|
+
* bind, and "the camera wants to record" is not a room sensor. It is a fact
|
|
30149
|
+
* about the camera, on the camera.
|
|
30150
|
+
*/
|
|
30151
|
+
var RecordingSignalStatusSchema = object({
|
|
30152
|
+
/** True while the device asks to be recorded. */
|
|
30153
|
+
active: boolean(),
|
|
30154
|
+
/**
|
|
30155
|
+
* Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
|
|
30156
|
+
* …). Free text for the log line and the UI badge; the recorder never
|
|
30157
|
+
* branches on it.
|
|
30158
|
+
*/
|
|
30159
|
+
reason: string(),
|
|
30160
|
+
/** Ms epoch of the last `active` transition. 0 if never observed. */
|
|
30161
|
+
lastChangedAt: number()
|
|
30162
|
+
});
|
|
30163
|
+
/** The runtime-state slice: the status plus the clock every slice carries. */
|
|
30164
|
+
var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
|
|
30165
|
+
var recordingSignalCapability = {
|
|
30166
|
+
name: "recording-signal",
|
|
30167
|
+
scope: "device",
|
|
30168
|
+
deviceNative: true,
|
|
30169
|
+
mode: "singleton",
|
|
30170
|
+
deviceTypes: [DeviceType.Camera],
|
|
30171
|
+
methods: {
|
|
30172
|
+
/** The current level, straight from the slice the provider keeps fresh. */
|
|
30173
|
+
getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
|
|
30174
|
+
status: {
|
|
30175
|
+
schema: RecordingSignalStatusSchema,
|
|
30176
|
+
kind: "push",
|
|
30177
|
+
empty: {
|
|
30178
|
+
active: false,
|
|
30179
|
+
reason: "unknown",
|
|
30180
|
+
lastChangedAt: 0
|
|
30181
|
+
}
|
|
30182
|
+
},
|
|
30183
|
+
runtimeState: RecordingSignalRuntimeStateSchema,
|
|
30184
|
+
/**
|
|
30185
|
+
* Runtime-state durability: **session** — a restored `active: true` from
|
|
30186
|
+
* before a restart is exactly the stale level the recorder's reconcile bound
|
|
30187
|
+
* exists to end, and the provider re-derives the true level on activation
|
|
30188
|
+
* anyway. Nothing is lost by forgetting it; a lie is avoided.
|
|
30189
|
+
*
|
|
30190
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
30191
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
30192
|
+
*/
|
|
30193
|
+
durability: "session"
|
|
30194
|
+
};
|
|
30195
|
+
/**
|
|
30093
30196
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
30094
30197
|
* a rect ROI on a camera frame and names one or more states; the engine
|
|
30095
30198
|
* (pipeline-analytics, designated post-processing node) reports which state is
|
|
@@ -30587,6 +30690,8 @@ var CamStreamDescriptorSchema = object({
|
|
|
30587
30690
|
deviceFeatures: array(string()).optional(),
|
|
30588
30691
|
/** Eligible for automatic profile assignment. Absent = `true`. */
|
|
30589
30692
|
autoEligible: boolean().optional(),
|
|
30693
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
30694
|
+
profileHint: CamProfileSchema.optional(),
|
|
30590
30695
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
30591
30696
|
metadata: record(string(), unknown()).optional()
|
|
30592
30697
|
});
|
|
@@ -32924,6 +33029,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32924
33029
|
pressureSensor: pressureSensorCapability,
|
|
32925
33030
|
privacyMask: privacyMaskCapability,
|
|
32926
33031
|
ptzAutotrack: ptzAutotrackCapability,
|
|
33032
|
+
recordingSignal: recordingSignalCapability,
|
|
32927
33033
|
sceneMonitor: sceneMonitorCapability,
|
|
32928
33034
|
scriptRunner: scriptRunnerCapability,
|
|
32929
33035
|
smoke: smokeCapability,
|
|
@@ -33767,6 +33873,53 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33767
33873
|
const ids = [...this._permanentRestoreFailures.keys()].join(", ");
|
|
33768
33874
|
return `${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${ids}) — restart the ${this.providerName} provider to retry`;
|
|
33769
33875
|
}
|
|
33876
|
+
/**
|
|
33877
|
+
* A top-level persisted row with NO configuration is a leftover, not a
|
|
33878
|
+
* device — quarantine it instead of dialling it.
|
|
33879
|
+
*
|
|
33880
|
+
* Device 614 was deleted, resurrected as a config-less shell by a write
|
|
33881
|
+
* already in flight (D376), and then dialled at every single boot: eight
|
|
33882
|
+
* `Failed to restore device — bounded retry scheduled` lines in one day,
|
|
33883
|
+
* each one the same Zod refusal on `host` and `password`. The bound was
|
|
33884
|
+
* real, but it is a bound PER PROCESS, and the runner restarts — so nothing
|
|
33885
|
+
* about the row ever stopped costing attempts and log lines.
|
|
33886
|
+
*
|
|
33887
|
+
* No retry can add a configuration that is not there. The row is reported
|
|
33888
|
+
* once, with its `deviceId`, and set aside.
|
|
33889
|
+
*
|
|
33890
|
+
* Top-level only: an accessory child legitimately carries an empty blob (it
|
|
33891
|
+
* lives off its parent), and a hub-adopted child with an emptied blob is
|
|
33892
|
+
* repaired by `healSavedConfig` from its parent instead. Providers that
|
|
33893
|
+
* genuinely create configuration-free top-level devices turn this off.
|
|
33894
|
+
*/
|
|
33895
|
+
quarantineConfiglessTopLevelRestores = true;
|
|
33896
|
+
isUnrestorableShell(saved) {
|
|
33897
|
+
if (!this.quarantineConfiglessTopLevelRestores) return false;
|
|
33898
|
+
if (saved.parentDeviceId !== null) return false;
|
|
33899
|
+
const config = saved.config;
|
|
33900
|
+
if (config === void 0) return false;
|
|
33901
|
+
return Object.keys(config).length === 0;
|
|
33902
|
+
}
|
|
33903
|
+
quarantineShell(saved) {
|
|
33904
|
+
this._permanentRestoreFailures.set(saved.id, {
|
|
33905
|
+
deviceId: saved.id,
|
|
33906
|
+
stableId: saved.stableId,
|
|
33907
|
+
type: saved.type,
|
|
33908
|
+
attempts: 0,
|
|
33909
|
+
lastError: "persisted row has no configuration",
|
|
33910
|
+
failedAt: Date.now()
|
|
33911
|
+
});
|
|
33912
|
+
this.ctx.logger.error("Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.", {
|
|
33913
|
+
tags: {
|
|
33914
|
+
deviceId: saved.id,
|
|
33915
|
+
stableId: saved.stableId
|
|
33916
|
+
},
|
|
33917
|
+
meta: {
|
|
33918
|
+
type: saved.type,
|
|
33919
|
+
provider: this.providerName
|
|
33920
|
+
}
|
|
33921
|
+
});
|
|
33922
|
+
}
|
|
33770
33923
|
cancelRestoreRetries() {
|
|
33771
33924
|
this._restoreRetryScheduler?.cancel();
|
|
33772
33925
|
this._restoreRetryScheduler = null;
|
|
@@ -33951,6 +34104,10 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33951
34104
|
});
|
|
33952
34105
|
return;
|
|
33953
34106
|
}
|
|
34107
|
+
if (this.isUnrestorableShell(saved)) {
|
|
34108
|
+
this.quarantineShell(saved);
|
|
34109
|
+
return;
|
|
34110
|
+
}
|
|
33954
34111
|
try {
|
|
33955
34112
|
await attemptRestore(saved);
|
|
33956
34113
|
} catch (err) {
|
|
@@ -38877,6 +39034,12 @@ Object.freeze({
|
|
|
38877
39034
|
addonId: null,
|
|
38878
39035
|
access: "view"
|
|
38879
39036
|
},
|
|
39037
|
+
"recordingSignal.getStatus": {
|
|
39038
|
+
capName: "recording-signal",
|
|
39039
|
+
capScope: "device",
|
|
39040
|
+
addonId: null,
|
|
39041
|
+
access: "view"
|
|
39042
|
+
},
|
|
38880
39043
|
"sceneMonitor.captureReference": {
|
|
38881
39044
|
capName: "scene-monitor",
|
|
38882
39045
|
capScope: "device",
|
|
@@ -41869,6 +42032,11 @@ Object.freeze({
|
|
|
41869
42032
|
form: "single",
|
|
41870
42033
|
optional: true
|
|
41871
42034
|
}],
|
|
42035
|
+
"recordingSignal.getStatus": [{
|
|
42036
|
+
name: "deviceId",
|
|
42037
|
+
form: "single",
|
|
42038
|
+
optional: false
|
|
42039
|
+
}],
|
|
41872
42040
|
"sceneMonitor.captureReference": [{
|
|
41873
42041
|
name: "deviceId",
|
|
41874
42042
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -6453,6 +6453,21 @@ var CameraStreamSchema = object({
|
|
|
6453
6453
|
*/
|
|
6454
6454
|
autoEligible: boolean().optional(),
|
|
6455
6455
|
/**
|
|
6456
|
+
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
6457
|
+
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
6458
|
+
* stream. Consulted by the broker's automatic ranking
|
|
6459
|
+
* (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
|
|
6460
|
+
* an operator's manual assignment still wins, and an absent hint is the
|
|
6461
|
+
* pixel-ranked default every camera had before this field existed.
|
|
6462
|
+
*
|
|
6463
|
+
* Why it exists: a camera with ONE stream ranked to `mid` — the slot no
|
|
6464
|
+
* storage class is written for on its own (`recordings` is high|mid,
|
|
6465
|
+
* `recordingsLow` is low) and the one profile scrub does not read. The robot
|
|
6466
|
+
* camera's single 720p relay is a `low` in every respect except the slot the
|
|
6467
|
+
* heuristic put it in.
|
|
6468
|
+
*/
|
|
6469
|
+
profileHint: CamProfileSchema.optional(),
|
|
6470
|
+
/**
|
|
6456
6471
|
* Transport-specific opaque metadata. The broker passes it through to
|
|
6457
6472
|
* the source reader without inspecting it. Currently used by
|
|
6458
6473
|
* `pull-rfc4571` streams to carry the upstream SDP (so the reader can
|
|
@@ -7890,7 +7905,22 @@ var RecordingTriggersSchema = object({
|
|
|
7890
7905
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
7891
7906
|
* registrare.
|
|
7892
7907
|
*/
|
|
7893
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
7908
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
|
|
7909
|
+
/**
|
|
7910
|
+
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
7911
|
+
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
7912
|
+
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
7913
|
+
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
7914
|
+
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
7915
|
+
*
|
|
7916
|
+
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
7917
|
+
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
7918
|
+
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
7919
|
+
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
7920
|
+
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
7921
|
+
* (`holdTrigger` / `releaseTrigger`).
|
|
7922
|
+
*/
|
|
7923
|
+
deviceSignal: boolean().optional()
|
|
7894
7924
|
});
|
|
7895
7925
|
/**
|
|
7896
7926
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -11354,6 +11384,8 @@ method(object({
|
|
|
11354
11384
|
label: string().optional(),
|
|
11355
11385
|
deviceFeatures: array(string()).optional(),
|
|
11356
11386
|
autoEligible: boolean().optional(),
|
|
11387
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
11388
|
+
profileHint: CamProfileSchema.optional(),
|
|
11357
11389
|
metadata: record(string(), unknown()).optional(),
|
|
11358
11390
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
11359
11391
|
* derived broker reads its encoded plane from.
|
|
@@ -30091,6 +30123,77 @@ method(object({
|
|
|
30091
30123
|
auth: "protected"
|
|
30092
30124
|
});
|
|
30093
30125
|
/**
|
|
30126
|
+
* A camera's own "record me NOW" LEVEL — a signal the device raises while
|
|
30127
|
+
* something it knows about is happening (a robot vacuum cleaning, a machine
|
|
30128
|
+
* running, a gate open) and lowers when it stops.
|
|
30129
|
+
*
|
|
30130
|
+
* It is a level, not an edge. The sensor triggers the recorder already listens
|
|
30131
|
+
* to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
|
|
30132
|
+
* post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
|
|
30133
|
+
* still happening" cannot be expressed as an edge plus a post-buffer without
|
|
30134
|
+
* either re-triggering on a timer (polling — D224 forbids the consumer keeping
|
|
30135
|
+
* the fact fresh) or picking a post-buffer long enough to cover every job,
|
|
30136
|
+
* which records the dock for that long after every short one. So the recorder
|
|
30137
|
+
* reads the LEVEL: it records for as long as `active` is true, plus the band's
|
|
30138
|
+
* own post-buffer once it falls.
|
|
30139
|
+
*
|
|
30140
|
+
* Who owns the fact: the PROVIDER of the device, which already reads the state
|
|
30141
|
+
* the signal is derived from (the vacuum's lifecycle state, for Dreame). It
|
|
30142
|
+
* writes this slice on every change; consumers subscribe to the kernel's
|
|
30143
|
+
* `DeviceStateChanged` for it and read it back through
|
|
30144
|
+
* `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
|
|
30145
|
+
* against the device (D224, D8/D11).
|
|
30146
|
+
*
|
|
30147
|
+
* Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
|
|
30148
|
+
* to Home Assistant, HomeKit and the sensor picker as a thing an operator can
|
|
30149
|
+
* bind, and "the camera wants to record" is not a room sensor. It is a fact
|
|
30150
|
+
* about the camera, on the camera.
|
|
30151
|
+
*/
|
|
30152
|
+
var RecordingSignalStatusSchema = object({
|
|
30153
|
+
/** True while the device asks to be recorded. */
|
|
30154
|
+
active: boolean(),
|
|
30155
|
+
/**
|
|
30156
|
+
* Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
|
|
30157
|
+
* …). Free text for the log line and the UI badge; the recorder never
|
|
30158
|
+
* branches on it.
|
|
30159
|
+
*/
|
|
30160
|
+
reason: string(),
|
|
30161
|
+
/** Ms epoch of the last `active` transition. 0 if never observed. */
|
|
30162
|
+
lastChangedAt: number()
|
|
30163
|
+
});
|
|
30164
|
+
/** The runtime-state slice: the status plus the clock every slice carries. */
|
|
30165
|
+
var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
|
|
30166
|
+
var recordingSignalCapability = {
|
|
30167
|
+
name: "recording-signal",
|
|
30168
|
+
scope: "device",
|
|
30169
|
+
deviceNative: true,
|
|
30170
|
+
mode: "singleton",
|
|
30171
|
+
deviceTypes: [DeviceType.Camera],
|
|
30172
|
+
methods: {
|
|
30173
|
+
/** The current level, straight from the slice the provider keeps fresh. */
|
|
30174
|
+
getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
|
|
30175
|
+
status: {
|
|
30176
|
+
schema: RecordingSignalStatusSchema,
|
|
30177
|
+
kind: "push",
|
|
30178
|
+
empty: {
|
|
30179
|
+
active: false,
|
|
30180
|
+
reason: "unknown",
|
|
30181
|
+
lastChangedAt: 0
|
|
30182
|
+
}
|
|
30183
|
+
},
|
|
30184
|
+
runtimeState: RecordingSignalRuntimeStateSchema,
|
|
30185
|
+
/**
|
|
30186
|
+
* Runtime-state durability: **session** — a restored `active: true` from
|
|
30187
|
+
* before a restart is exactly the stale level the recorder's reconcile bound
|
|
30188
|
+
* exists to end, and the provider re-derives the true level on activation
|
|
30189
|
+
* anyway. Nothing is lost by forgetting it; a lie is avoided.
|
|
30190
|
+
*
|
|
30191
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
30192
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
30193
|
+
*/
|
|
30194
|
+
durability: "session"
|
|
30195
|
+
};
|
|
30196
|
+
/**
|
|
30094
30197
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
30095
30198
|
* a rect ROI on a camera frame and names one or more states; the engine
|
|
30096
30199
|
* (pipeline-analytics, designated post-processing node) reports which state is
|
|
@@ -30588,6 +30691,8 @@ var CamStreamDescriptorSchema = object({
|
|
|
30588
30691
|
deviceFeatures: array(string()).optional(),
|
|
30589
30692
|
/** Eligible for automatic profile assignment. Absent = `true`. */
|
|
30590
30693
|
autoEligible: boolean().optional(),
|
|
30694
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
30695
|
+
profileHint: CamProfileSchema.optional(),
|
|
30591
30696
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
30592
30697
|
metadata: record(string(), unknown()).optional()
|
|
30593
30698
|
});
|
|
@@ -32925,6 +33030,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32925
33030
|
pressureSensor: pressureSensorCapability,
|
|
32926
33031
|
privacyMask: privacyMaskCapability,
|
|
32927
33032
|
ptzAutotrack: ptzAutotrackCapability,
|
|
33033
|
+
recordingSignal: recordingSignalCapability,
|
|
32928
33034
|
sceneMonitor: sceneMonitorCapability,
|
|
32929
33035
|
scriptRunner: scriptRunnerCapability,
|
|
32930
33036
|
smoke: smokeCapability,
|
|
@@ -33768,6 +33874,53 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33768
33874
|
const ids = [...this._permanentRestoreFailures.keys()].join(", ");
|
|
33769
33875
|
return `${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${ids}) — restart the ${this.providerName} provider to retry`;
|
|
33770
33876
|
}
|
|
33877
|
+
/**
|
|
33878
|
+
* A top-level persisted row with NO configuration is a leftover, not a
|
|
33879
|
+
* device — quarantine it instead of dialling it.
|
|
33880
|
+
*
|
|
33881
|
+
* Device 614 was deleted, resurrected as a config-less shell by a write
|
|
33882
|
+
* already in flight (D376), and then dialled at every single boot: eight
|
|
33883
|
+
* `Failed to restore device — bounded retry scheduled` lines in one day,
|
|
33884
|
+
* each one the same Zod refusal on `host` and `password`. The bound was
|
|
33885
|
+
* real, but it is a bound PER PROCESS, and the runner restarts — so nothing
|
|
33886
|
+
* about the row ever stopped costing attempts and log lines.
|
|
33887
|
+
*
|
|
33888
|
+
* No retry can add a configuration that is not there. The row is reported
|
|
33889
|
+
* once, with its `deviceId`, and set aside.
|
|
33890
|
+
*
|
|
33891
|
+
* Top-level only: an accessory child legitimately carries an empty blob (it
|
|
33892
|
+
* lives off its parent), and a hub-adopted child with an emptied blob is
|
|
33893
|
+
* repaired by `healSavedConfig` from its parent instead. Providers that
|
|
33894
|
+
* genuinely create configuration-free top-level devices turn this off.
|
|
33895
|
+
*/
|
|
33896
|
+
quarantineConfiglessTopLevelRestores = true;
|
|
33897
|
+
isUnrestorableShell(saved) {
|
|
33898
|
+
if (!this.quarantineConfiglessTopLevelRestores) return false;
|
|
33899
|
+
if (saved.parentDeviceId !== null) return false;
|
|
33900
|
+
const config = saved.config;
|
|
33901
|
+
if (config === void 0) return false;
|
|
33902
|
+
return Object.keys(config).length === 0;
|
|
33903
|
+
}
|
|
33904
|
+
quarantineShell(saved) {
|
|
33905
|
+
this._permanentRestoreFailures.set(saved.id, {
|
|
33906
|
+
deviceId: saved.id,
|
|
33907
|
+
stableId: saved.stableId,
|
|
33908
|
+
type: saved.type,
|
|
33909
|
+
attempts: 0,
|
|
33910
|
+
lastError: "persisted row has no configuration",
|
|
33911
|
+
failedAt: Date.now()
|
|
33912
|
+
});
|
|
33913
|
+
this.ctx.logger.error("Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.", {
|
|
33914
|
+
tags: {
|
|
33915
|
+
deviceId: saved.id,
|
|
33916
|
+
stableId: saved.stableId
|
|
33917
|
+
},
|
|
33918
|
+
meta: {
|
|
33919
|
+
type: saved.type,
|
|
33920
|
+
provider: this.providerName
|
|
33921
|
+
}
|
|
33922
|
+
});
|
|
33923
|
+
}
|
|
33771
33924
|
cancelRestoreRetries() {
|
|
33772
33925
|
this._restoreRetryScheduler?.cancel();
|
|
33773
33926
|
this._restoreRetryScheduler = null;
|
|
@@ -33952,6 +34105,10 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33952
34105
|
});
|
|
33953
34106
|
return;
|
|
33954
34107
|
}
|
|
34108
|
+
if (this.isUnrestorableShell(saved)) {
|
|
34109
|
+
this.quarantineShell(saved);
|
|
34110
|
+
return;
|
|
34111
|
+
}
|
|
33955
34112
|
try {
|
|
33956
34113
|
await attemptRestore(saved);
|
|
33957
34114
|
} catch (err) {
|
|
@@ -38878,6 +39035,12 @@ Object.freeze({
|
|
|
38878
39035
|
addonId: null,
|
|
38879
39036
|
access: "view"
|
|
38880
39037
|
},
|
|
39038
|
+
"recordingSignal.getStatus": {
|
|
39039
|
+
capName: "recording-signal",
|
|
39040
|
+
capScope: "device",
|
|
39041
|
+
addonId: null,
|
|
39042
|
+
access: "view"
|
|
39043
|
+
},
|
|
38881
39044
|
"sceneMonitor.captureReference": {
|
|
38882
39045
|
capName: "scene-monitor",
|
|
38883
39046
|
capScope: "device",
|
|
@@ -41870,6 +42033,11 @@ Object.freeze({
|
|
|
41870
42033
|
form: "single",
|
|
41871
42034
|
optional: true
|
|
41872
42035
|
}],
|
|
42036
|
+
"recordingSignal.getStatus": [{
|
|
42037
|
+
name: "deviceId",
|
|
42038
|
+
form: "single",
|
|
42039
|
+
optional: false
|
|
42040
|
+
}],
|
|
41873
42041
|
"sceneMonitor.captureReference": [{
|
|
41874
42042
|
name: "deviceId",
|
|
41875
42043
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-amcrest",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.76",
|
|
4
4
|
"description": "Amcrest/Dahua camera device provider addon for CamStack — Dahua CGI over HTTP(S) with digest auth (snapshot, RTSP catalog, PTZ, image/day-night config)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|