@camstack/addon-provider-unifi 0.2.72 → 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 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
@@ -7894,7 +7909,22 @@ var RecordingTriggersSchema = object({
7894
7909
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
7895
7910
  * registrare.
7896
7911
  */
7897
- sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7912
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
7913
+ /**
7914
+ * La camera registra per tutta la durata del SEGNALE che lei stessa
7915
+ * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
7916
+ * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
7917
+ * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
7918
+ * caduta, così una pulizia di quaranta minuti è UNA clip.
7919
+ *
7920
+ * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
7921
+ * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
7922
+ * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
7923
+ * segnale mai abbassato (un evento perso) non può tenere aperta una
7924
+ * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
7925
+ * (`holdTrigger` / `releaseTrigger`).
7926
+ */
7927
+ deviceSignal: boolean().optional()
7898
7928
  });
7899
7929
  /**
7900
7930
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -11358,6 +11388,8 @@ method(object({
11358
11388
  label: string().optional(),
11359
11389
  deviceFeatures: array(string()).optional(),
11360
11390
  autoEligible: boolean().optional(),
11391
+ /** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
11392
+ profileHint: CamProfileSchema.optional(),
11361
11393
  metadata: record(string(), unknown()).optional(),
11362
11394
  /** Required when kind === 'derived' — the source camStreamId the
11363
11395
  * derived broker reads its encoded plane from.
@@ -29900,6 +29932,77 @@ method(object({
29900
29932
  auth: "protected"
29901
29933
  });
29902
29934
  /**
29935
+ * A camera's own "record me NOW" LEVEL — a signal the device raises while
29936
+ * something it knows about is happening (a robot vacuum cleaning, a machine
29937
+ * running, a gate open) and lowers when it stops.
29938
+ *
29939
+ * It is a level, not an edge. The sensor triggers the recorder already listens
29940
+ * to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
29941
+ * post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
29942
+ * still happening" cannot be expressed as an edge plus a post-buffer without
29943
+ * either re-triggering on a timer (polling — D224 forbids the consumer keeping
29944
+ * the fact fresh) or picking a post-buffer long enough to cover every job,
29945
+ * which records the dock for that long after every short one. So the recorder
29946
+ * reads the LEVEL: it records for as long as `active` is true, plus the band's
29947
+ * own post-buffer once it falls.
29948
+ *
29949
+ * Who owns the fact: the PROVIDER of the device, which already reads the state
29950
+ * the signal is derived from (the vacuum's lifecycle state, for Dreame). It
29951
+ * writes this slice on every change; consumers subscribe to the kernel's
29952
+ * `DeviceStateChanged` for it and read it back through
29953
+ * `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
29954
+ * against the device (D224, D8/D11).
29955
+ *
29956
+ * Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
29957
+ * to Home Assistant, HomeKit and the sensor picker as a thing an operator can
29958
+ * bind, and "the camera wants to record" is not a room sensor. It is a fact
29959
+ * about the camera, on the camera.
29960
+ */
29961
+ var RecordingSignalStatusSchema = object({
29962
+ /** True while the device asks to be recorded. */
29963
+ active: boolean(),
29964
+ /**
29965
+ * Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
29966
+ * …). Free text for the log line and the UI badge; the recorder never
29967
+ * branches on it.
29968
+ */
29969
+ reason: string(),
29970
+ /** Ms epoch of the last `active` transition. 0 if never observed. */
29971
+ lastChangedAt: number()
29972
+ });
29973
+ /** The runtime-state slice: the status plus the clock every slice carries. */
29974
+ var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
29975
+ var recordingSignalCapability = {
29976
+ name: "recording-signal",
29977
+ scope: "device",
29978
+ deviceNative: true,
29979
+ mode: "singleton",
29980
+ deviceTypes: [DeviceType.Camera],
29981
+ methods: {
29982
+ /** The current level, straight from the slice the provider keeps fresh. */
29983
+ getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
29984
+ status: {
29985
+ schema: RecordingSignalStatusSchema,
29986
+ kind: "push",
29987
+ empty: {
29988
+ active: false,
29989
+ reason: "unknown",
29990
+ lastChangedAt: 0
29991
+ }
29992
+ },
29993
+ runtimeState: RecordingSignalRuntimeStateSchema,
29994
+ /**
29995
+ * Runtime-state durability: **session** — a restored `active: true` from
29996
+ * before a restart is exactly the stale level the recorder's reconcile bound
29997
+ * exists to end, and the provider re-derives the true level on activation
29998
+ * anyway. Nothing is lost by forgetting it; a lie is avoided.
29999
+ *
30000
+ * See `RuntimeStateDurability`. Enforced by
30001
+ * `scripts/check-runtime-state-durability.ts`.
30002
+ */
30003
+ durability: "session"
30004
+ };
30005
+ /**
29903
30006
  * scene-monitor — device-scoped reference-region state cap. An operator marks
29904
30007
  * a rect ROI on a camera frame and names one or more states; the engine
29905
30008
  * (pipeline-analytics, designated post-processing node) reports which state is
@@ -30397,6 +30500,8 @@ var CamStreamDescriptorSchema = object({
30397
30500
  deviceFeatures: array(string()).optional(),
30398
30501
  /** Eligible for automatic profile assignment. Absent = `true`. */
30399
30502
  autoEligible: boolean().optional(),
30503
+ /** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
30504
+ profileHint: CamProfileSchema.optional(),
30400
30505
  /** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
30401
30506
  metadata: record(string(), unknown()).optional()
30402
30507
  });
@@ -32536,6 +32641,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32536
32641
  pressureSensor: pressureSensorCapability,
32537
32642
  privacyMask: privacyMaskCapability,
32538
32643
  ptzAutotrack: ptzAutotrackCapability,
32644
+ recordingSignal: recordingSignalCapability,
32539
32645
  sceneMonitor: sceneMonitorCapability,
32540
32646
  scriptRunner: scriptRunnerCapability,
32541
32647
  smoke: smokeCapability,
@@ -38283,6 +38389,12 @@ Object.freeze({
38283
38389
  addonId: null,
38284
38390
  access: "view"
38285
38391
  },
38392
+ "recordingSignal.getStatus": {
38393
+ capName: "recording-signal",
38394
+ capScope: "device",
38395
+ addonId: null,
38396
+ access: "view"
38397
+ },
38286
38398
  "sceneMonitor.captureReference": {
38287
38399
  capName: "scene-monitor",
38288
38400
  capScope: "device",
@@ -41275,6 +41387,11 @@ Object.freeze({
41275
41387
  form: "single",
41276
41388
  optional: true
41277
41389
  }],
41390
+ "recordingSignal.getStatus": [{
41391
+ name: "deviceId",
41392
+ form: "single",
41393
+ optional: false
41394
+ }],
41278
41395
  "sceneMonitor.captureReference": [{
41279
41396
  name: "deviceId",
41280
41397
  form: "single",
package/dist/addon.mjs CHANGED
@@ -6444,6 +6444,21 @@ var CameraStreamSchema = object({
6444
6444
  */
6445
6445
  autoEligible: boolean().optional(),
6446
6446
  /**
6447
+ * The profile slot the PUBLISHER says this stream is: `low` for a stream
6448
+ * whose only sensible role is the low-bandwidth one, `high` for a main
6449
+ * stream. Consulted by the broker's automatic ranking
6450
+ * (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
6451
+ * an operator's manual assignment still wins, and an absent hint is the
6452
+ * pixel-ranked default every camera had before this field existed.
6453
+ *
6454
+ * Why it exists: a camera with ONE stream ranked to `mid` — the slot no
6455
+ * storage class is written for on its own (`recordings` is high|mid,
6456
+ * `recordingsLow` is low) and the one profile scrub does not read. The robot
6457
+ * camera's single 720p relay is a `low` in every respect except the slot the
6458
+ * heuristic put it in.
6459
+ */
6460
+ profileHint: CamProfileSchema.optional(),
6461
+ /**
6447
6462
  * Transport-specific opaque metadata. The broker passes it through to
6448
6463
  * the source reader without inspecting it. Currently used by
6449
6464
  * `pull-rfc4571` streams to carry the upstream SDP (so the reader can
@@ -7893,7 +7908,22 @@ var RecordingTriggersSchema = object({
7893
7908
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
7894
7909
  * registrare.
7895
7910
  */
7896
- sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7911
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
7912
+ /**
7913
+ * La camera registra per tutta la durata del SEGNALE che lei stessa
7914
+ * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
7915
+ * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
7916
+ * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
7917
+ * caduta, così una pulizia di quaranta minuti è UNA clip.
7918
+ *
7919
+ * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
7920
+ * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
7921
+ * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
7922
+ * segnale mai abbassato (un evento perso) non può tenere aperta una
7923
+ * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
7924
+ * (`holdTrigger` / `releaseTrigger`).
7925
+ */
7926
+ deviceSignal: boolean().optional()
7897
7927
  });
7898
7928
  /**
7899
7929
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -11357,6 +11387,8 @@ method(object({
11357
11387
  label: string().optional(),
11358
11388
  deviceFeatures: array(string()).optional(),
11359
11389
  autoEligible: boolean().optional(),
11390
+ /** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
11391
+ profileHint: CamProfileSchema.optional(),
11360
11392
  metadata: record(string(), unknown()).optional(),
11361
11393
  /** Required when kind === 'derived' — the source camStreamId the
11362
11394
  * derived broker reads its encoded plane from.
@@ -29899,6 +29931,77 @@ method(object({
29899
29931
  auth: "protected"
29900
29932
  });
29901
29933
  /**
29934
+ * A camera's own "record me NOW" LEVEL — a signal the device raises while
29935
+ * something it knows about is happening (a robot vacuum cleaning, a machine
29936
+ * running, a gate open) and lowers when it stops.
29937
+ *
29938
+ * It is a level, not an edge. The sensor triggers the recorder already listens
29939
+ * to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
29940
+ * post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
29941
+ * still happening" cannot be expressed as an edge plus a post-buffer without
29942
+ * either re-triggering on a timer (polling — D224 forbids the consumer keeping
29943
+ * the fact fresh) or picking a post-buffer long enough to cover every job,
29944
+ * which records the dock for that long after every short one. So the recorder
29945
+ * reads the LEVEL: it records for as long as `active` is true, plus the band's
29946
+ * own post-buffer once it falls.
29947
+ *
29948
+ * Who owns the fact: the PROVIDER of the device, which already reads the state
29949
+ * the signal is derived from (the vacuum's lifecycle state, for Dreame). It
29950
+ * writes this slice on every change; consumers subscribe to the kernel's
29951
+ * `DeviceStateChanged` for it and read it back through
29952
+ * `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
29953
+ * against the device (D224, D8/D11).
29954
+ *
29955
+ * Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
29956
+ * to Home Assistant, HomeKit and the sensor picker as a thing an operator can
29957
+ * bind, and "the camera wants to record" is not a room sensor. It is a fact
29958
+ * about the camera, on the camera.
29959
+ */
29960
+ var RecordingSignalStatusSchema = object({
29961
+ /** True while the device asks to be recorded. */
29962
+ active: boolean(),
29963
+ /**
29964
+ * Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
29965
+ * …). Free text for the log line and the UI badge; the recorder never
29966
+ * branches on it.
29967
+ */
29968
+ reason: string(),
29969
+ /** Ms epoch of the last `active` transition. 0 if never observed. */
29970
+ lastChangedAt: number()
29971
+ });
29972
+ /** The runtime-state slice: the status plus the clock every slice carries. */
29973
+ var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
29974
+ var recordingSignalCapability = {
29975
+ name: "recording-signal",
29976
+ scope: "device",
29977
+ deviceNative: true,
29978
+ mode: "singleton",
29979
+ deviceTypes: [DeviceType.Camera],
29980
+ methods: {
29981
+ /** The current level, straight from the slice the provider keeps fresh. */
29982
+ getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
29983
+ status: {
29984
+ schema: RecordingSignalStatusSchema,
29985
+ kind: "push",
29986
+ empty: {
29987
+ active: false,
29988
+ reason: "unknown",
29989
+ lastChangedAt: 0
29990
+ }
29991
+ },
29992
+ runtimeState: RecordingSignalRuntimeStateSchema,
29993
+ /**
29994
+ * Runtime-state durability: **session** — a restored `active: true` from
29995
+ * before a restart is exactly the stale level the recorder's reconcile bound
29996
+ * exists to end, and the provider re-derives the true level on activation
29997
+ * anyway. Nothing is lost by forgetting it; a lie is avoided.
29998
+ *
29999
+ * See `RuntimeStateDurability`. Enforced by
30000
+ * `scripts/check-runtime-state-durability.ts`.
30001
+ */
30002
+ durability: "session"
30003
+ };
30004
+ /**
29902
30005
  * scene-monitor — device-scoped reference-region state cap. An operator marks
29903
30006
  * a rect ROI on a camera frame and names one or more states; the engine
29904
30007
  * (pipeline-analytics, designated post-processing node) reports which state is
@@ -30396,6 +30499,8 @@ var CamStreamDescriptorSchema = object({
30396
30499
  deviceFeatures: array(string()).optional(),
30397
30500
  /** Eligible for automatic profile assignment. Absent = `true`. */
30398
30501
  autoEligible: boolean().optional(),
30502
+ /** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
30503
+ profileHint: CamProfileSchema.optional(),
30399
30504
  /** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
30400
30505
  metadata: record(string(), unknown()).optional()
30401
30506
  });
@@ -32535,6 +32640,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32535
32640
  pressureSensor: pressureSensorCapability,
32536
32641
  privacyMask: privacyMaskCapability,
32537
32642
  ptzAutotrack: ptzAutotrackCapability,
32643
+ recordingSignal: recordingSignalCapability,
32538
32644
  sceneMonitor: sceneMonitorCapability,
32539
32645
  scriptRunner: scriptRunnerCapability,
32540
32646
  smoke: smokeCapability,
@@ -38282,6 +38388,12 @@ Object.freeze({
38282
38388
  addonId: null,
38283
38389
  access: "view"
38284
38390
  },
38391
+ "recordingSignal.getStatus": {
38392
+ capName: "recording-signal",
38393
+ capScope: "device",
38394
+ addonId: null,
38395
+ access: "view"
38396
+ },
38285
38397
  "sceneMonitor.captureReference": {
38286
38398
  capName: "scene-monitor",
38287
38399
  capScope: "device",
@@ -41274,6 +41386,11 @@ Object.freeze({
41274
41386
  form: "single",
41275
41387
  optional: true
41276
41388
  }],
41389
+ "recordingSignal.getStatus": [{
41390
+ name: "deviceId",
41391
+ form: "single",
41392
+ optional: false
41393
+ }],
41277
41394
  "sceneMonitor.captureReference": [{
41278
41395
  name: "deviceId",
41279
41396
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-unifi",
3
- "version": "0.2.72",
3
+ "version": "0.2.73",
4
4
  "description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
5
5
  "keywords": [
6
6
  "camstack",