@camstack/addon-provider-unifi 0.2.101 → 0.2.102

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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-ZyX6jcse.mjs
2
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -616,6 +616,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
616
616
  * pull-reconcile from the provider's `getStatus` on reconnect. */
617
617
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
618
618
  EventCategory["BackupCompleted"] = "backup.completed";
619
+ /**
620
+ * A whole backup RUN finished — every destination attempted, win or lose.
621
+ *
622
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
623
+ * a progress UI and the wrong one for a notification: an operator with three
624
+ * destinations would be told three times. And a run where two of three
625
+ * destinations succeeded is not a clean success — a single "backup
626
+ * completed" that hid the failed one would be a lie, so the count of each is
627
+ * carried here and the message says both.
628
+ *
629
+ * Emitted by the backup orchestrator only after the destination loop, so a
630
+ * run that dies during the BUILD phase produces no completion at all.
631
+ */
632
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
619
633
  EventCategory["BackupRestored"] = "backup.restored";
620
634
  EventCategory["NotificationDispatched"] = "notification.dispatched";
621
635
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5346,7 +5360,7 @@ var ZodIssueCode = {
5346
5360
  var ZodFirstPartyTypeKind;
5347
5361
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5348
5362
  //#endregion
5349
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5363
+ //#region ../types/dist/sleep-DEuj7E3j.mjs
5350
5364
  /**
5351
5365
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5352
5366
  * window to float samples (D455).
@@ -11490,6 +11504,72 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11490
11504
  auth: "admin"
11491
11505
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11492
11506
  DeviceType.Camera;
11507
+ /**
11508
+ * The signals a device can emit to WAKE its own stream.
11509
+ *
11510
+ * A camera whose stream is built on demand sleeps until something asks for it,
11511
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11512
+ * puller holds a session open for ever, and treating that as demand would keep
11513
+ * a battery camera awake for ever, which is the whole thing the battery is for
11514
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11515
+ * itself, with no stream running.
11516
+ *
11517
+ * ## The vocabulary is the PROVIDER'S, not ours
11518
+ *
11519
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11520
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11521
+ * Reolink offers motion and camera-native detection; another provider may offer
11522
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11523
+ * yet. A fixed enum here would mean every new signal is a framework release.
11524
+ *
11525
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11526
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11527
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11528
+ * binding — but both answer "what drives the detection pipeline", which is a
11529
+ * different question from "what may wake a sleeping stream". A camera can do
11530
+ * the first and not be trusted with the second, and the operator picks per
11531
+ * camera. Two questions, two authorities.
11532
+ *
11533
+ * ## Availability is not permission
11534
+ *
11535
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11536
+ * wakes the stream is the operator's per-camera choice, held by the broker
11537
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11538
+ * provider declaring a signal is not a provider enabling it.
11539
+ */
11540
+ /** One signal a device can emit. */
11541
+ var StreamSignalSchema = object({
11542
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11543
+ code: string().min(1),
11544
+ /** What an operator reads in the picker. The provider's own wording. */
11545
+ label: string().min(1),
11546
+ /**
11547
+ * Whether the provider recommends this signal ON when a camera is first set
11548
+ * up. A provider knows which of its signals are cheap and reliable; an
11549
+ * operator should not have to discover that by trial. Reolink recommends
11550
+ * both of its own.
11551
+ */
11552
+ recommended: boolean()
11553
+ });
11554
+ var StreamSignalsStatusSchema = object({
11555
+ signals: array(StreamSignalSchema),
11556
+ lastFetchedAt: number()
11557
+ });
11558
+ var streamSignalsCapability = {
11559
+ name: "stream-signals",
11560
+ scope: "device",
11561
+ deviceNative: true,
11562
+ mode: "singleton",
11563
+ deviceTypes: Object.values(DeviceType),
11564
+ runtimeState: StreamSignalsStatusSchema,
11565
+ methods: {
11566
+ /**
11567
+ * What this device can emit. Empty is a valid and common answer — most
11568
+ * cameras have nothing to offer here, and an empty list is what makes the
11569
+ * broker's picker show nothing rather than a false choice.
11570
+ */
11571
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11572
+ };
11493
11573
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11494
11574
  var StreamFormatSchema = _enum([
11495
11575
  "webrtc",
@@ -11886,6 +11966,22 @@ var EgressTranscodeSchema = object({
11886
11966
  camStreamId: string().nullable()
11887
11967
  });
11888
11968
  method(object({
11969
+ deviceId: number().int().nonnegative(),
11970
+ /** The provider's signal code. */
11971
+ code: string().min(1),
11972
+ /** Ms epoch. Absent ⇒ now. */
11973
+ at: number().optional()
11974
+ }), object({
11975
+ /** Whether the broker acted on it, and if not, why. */
11976
+ accepted: boolean(),
11977
+ reason: _enum([
11978
+ "woke",
11979
+ "hold-extended",
11980
+ "not-enabled",
11981
+ "no-consumer",
11982
+ "unknown-code"
11983
+ ])
11984
+ }), { kind: "mutation" }), method(object({
11889
11985
  deviceId: number().int().nonnegative(),
11890
11986
  camStreamId: string().min(1),
11891
11987
  kind: CamStreamKindSchema,
@@ -12140,6 +12236,16 @@ var PickStreamRequirementsSchema = object({
12140
12236
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12141
12237
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12142
12238
  minHeight: number().int().positive().optional(),
12239
+ /**
12240
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12241
+ *
12242
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12243
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12244
+ * Without this the ceiling had to be re-implemented by every caller — and
12245
+ * one caller implementing it privately is how a second scoring authority
12246
+ * gets born.
12247
+ */
12248
+ maxHeight: number().int().positive().optional(),
12143
12249
  /** Minimum horizontal resolution. */
12144
12250
  minWidth: number().int().positive().optional(),
12145
12251
  /**
@@ -12156,7 +12262,22 @@ var PickStreamRequirementsSchema = object({
12156
12262
  * transcoded" guard: if the device is already serving the consumer's
12157
12263
  * codec end-to-end, there's nothing to optimise.
12158
12264
  */
12159
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12265
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12266
+ /**
12267
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12268
+ * understanding that it will be transcoded.
12269
+ *
12270
+ * Default `false` — today's behaviour, and the right one for a bypass
12271
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12272
+ * ask the larger question: "what is the best stream for me, transcoding if
12273
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12274
+ * does not, so a passthrough is never lost to a transcode; the answer says
12275
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12276
+ *
12277
+ * This is what lets one picker serve both the bypass and the full source
12278
+ * choice, instead of a consumer scoring privately when the bypass misses.
12279
+ */
12280
+ allowTranscode: boolean().optional()
12160
12281
  }).readonly();
12161
12282
  var PickStreamPreferencesSchema = object({
12162
12283
  /**
@@ -12170,12 +12291,32 @@ var PickStreamPreferencesSchema = object({
12170
12291
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12171
12292
  * memory-constrained consumers / Apple Home guest sessions).
12172
12293
  */
12173
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12294
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12295
+ /**
12296
+ * The height the consumer actually wants to DELIVER.
12297
+ *
12298
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12299
+ * above the target wins, and only if nothing reaches it does the tallest
12300
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12301
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12302
+ * express that: it says "as big as possible", which is a different wish.
12303
+ *
12304
+ * Ignored when absent, so every existing caller keeps its ordering.
12305
+ */
12306
+ targetHeight: number().int().positive().optional()
12174
12307
  }).readonly();
12175
12308
  var PickedCamStreamSchema = object({
12176
12309
  camStreamId: string(),
12177
12310
  codec: string().optional(),
12178
12311
  resolution: CamStreamResolutionSchema.optional(),
12312
+ /**
12313
+ * Whether serving this stream requires a decode + re-encode.
12314
+ *
12315
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12316
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12317
+ * not ask cannot be handed a cost it never agreed to pay.
12318
+ */
12319
+ transcodes: boolean(),
12179
12320
  /** One-line explanation of why this stream won — for logs / debug UI. */
12180
12321
  reason: string()
12181
12322
  });
@@ -16692,6 +16833,8 @@ var NcSystemEventKindSchema = _enum([
16692
16833
  "device-enabled",
16693
16834
  "device-battery-low",
16694
16835
  "device-battery-normal",
16836
+ "device-consumable-low",
16837
+ "device-consumable-normal",
16695
16838
  "stream-online",
16696
16839
  "stream-offline",
16697
16840
  "node-online",
@@ -16710,6 +16853,7 @@ var NcSystemEventKindSchema = _enum([
16710
16853
  "addon-updated",
16711
16854
  "server-updated",
16712
16855
  "export-completed",
16856
+ "backup-completed",
16713
16857
  "camera-online",
16714
16858
  "camera-offline",
16715
16859
  "camera-disabled",
@@ -23991,10 +24135,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
23991
24135
  }), boolean()), method(object({
23992
24136
  deviceId: number().int().nonnegative(),
23993
24137
  sessionId: string()
23994
- }), object({ pendingRenegotiation: object({
23995
- target: WebrtcStreamTargetSchema,
23996
- epoch: number()
23997
- }).nullable() }));
24138
+ }), object({
24139
+ pendingRenegotiation: object({
24140
+ target: WebrtcStreamTargetSchema,
24141
+ epoch: number()
24142
+ }).nullable(),
24143
+ /**
24144
+ * Whether the session still EXISTS.
24145
+ *
24146
+ * A consumer that holds a resource for the life of a session needs to
24147
+ * be able to ask, because a session does not always end the way it
24148
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24149
+ * sent `SessionDisconnected`, so the Alexa exporter's
24150
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24151
+ * H.264 transcode kept running for NOBODY for more than twenty
24152
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24153
+ * minutes earlier — the broker knew; the holder had no way to ask.
24154
+ *
24155
+ * `false` for a session id the provider has never heard of, which is
24156
+ * the same answer as "it ended": either way nothing is holding it up.
24157
+ */
24158
+ alive: boolean()
24159
+ }));
23998
24160
  object({
23999
24161
  /** All accessory children of the parent. */
24000
24162
  childDeviceIds: array(number()).readonly(),
@@ -33930,6 +34092,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33930
34092
  smoke: smokeCapability,
33931
34093
  streamCatalog: streamCatalogCapability,
33932
34094
  streamParams: streamParamsCapability,
34095
+ streamSignals: streamSignalsCapability,
33933
34096
  switch: switchCapability,
33934
34097
  tamper: tamperCapability,
33935
34098
  temperatureSensor: temperatureSensorCapability,
@@ -40503,6 +40666,12 @@ Object.freeze({
40503
40666
  addonId: null,
40504
40667
  access: "create"
40505
40668
  },
40669
+ "streamBroker.reportStreamSignal": {
40670
+ capName: "stream-broker",
40671
+ capScope: "system",
40672
+ addonId: null,
40673
+ access: "create"
40674
+ },
40506
40675
  "streamBroker.restartProfile": {
40507
40676
  capName: "stream-broker",
40508
40677
  capScope: "system",
@@ -40587,6 +40756,12 @@ Object.freeze({
40587
40756
  addonId: null,
40588
40757
  access: "create"
40589
40758
  },
40759
+ "streamSignals.listSignals": {
40760
+ capName: "stream-signals",
40761
+ capScope: "device",
40762
+ addonId: null,
40763
+ access: "view"
40764
+ },
40590
40765
  "switch.setState": {
40591
40766
  capName: "switch",
40592
40767
  capScope: "device",
@@ -42959,6 +43134,11 @@ Object.freeze({
42959
43134
  form: "single",
42960
43135
  optional: false
42961
43136
  }],
43137
+ "streamBroker.reportStreamSignal": [{
43138
+ name: "deviceId",
43139
+ form: "single",
43140
+ optional: false
43141
+ }],
42962
43142
  "streamBroker.restartProfile": [{
42963
43143
  name: "deviceId",
42964
43144
  form: "single",
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-ZyX6jcse.mjs
1
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -615,6 +615,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
615
615
  * pull-reconcile from the provider's `getStatus` on reconnect. */
616
616
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
617
617
  EventCategory["BackupCompleted"] = "backup.completed";
618
+ /**
619
+ * A whole backup RUN finished — every destination attempted, win or lose.
620
+ *
621
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
622
+ * a progress UI and the wrong one for a notification: an operator with three
623
+ * destinations would be told three times. And a run where two of three
624
+ * destinations succeeded is not a clean success — a single "backup
625
+ * completed" that hid the failed one would be a lie, so the count of each is
626
+ * carried here and the message says both.
627
+ *
628
+ * Emitted by the backup orchestrator only after the destination loop, so a
629
+ * run that dies during the BUILD phase produces no completion at all.
630
+ */
631
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
618
632
  EventCategory["BackupRestored"] = "backup.restored";
619
633
  EventCategory["NotificationDispatched"] = "notification.dispatched";
620
634
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5345,7 +5359,7 @@ var ZodIssueCode = {
5345
5359
  var ZodFirstPartyTypeKind;
5346
5360
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5347
5361
  //#endregion
5348
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5362
+ //#region ../types/dist/sleep-DEuj7E3j.mjs
5349
5363
  /**
5350
5364
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5351
5365
  * window to float samples (D455).
@@ -11489,6 +11503,72 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11489
11503
  auth: "admin"
11490
11504
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11491
11505
  DeviceType.Camera;
11506
+ /**
11507
+ * The signals a device can emit to WAKE its own stream.
11508
+ *
11509
+ * A camera whose stream is built on demand sleeps until something asks for it,
11510
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11511
+ * puller holds a session open for ever, and treating that as demand would keep
11512
+ * a battery camera awake for ever, which is the whole thing the battery is for
11513
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11514
+ * itself, with no stream running.
11515
+ *
11516
+ * ## The vocabulary is the PROVIDER'S, not ours
11517
+ *
11518
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11519
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11520
+ * Reolink offers motion and camera-native detection; another provider may offer
11521
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11522
+ * yet. A fixed enum here would mean every new signal is a framework release.
11523
+ *
11524
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11525
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11526
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11527
+ * binding — but both answer "what drives the detection pipeline", which is a
11528
+ * different question from "what may wake a sleeping stream". A camera can do
11529
+ * the first and not be trusted with the second, and the operator picks per
11530
+ * camera. Two questions, two authorities.
11531
+ *
11532
+ * ## Availability is not permission
11533
+ *
11534
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11535
+ * wakes the stream is the operator's per-camera choice, held by the broker
11536
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11537
+ * provider declaring a signal is not a provider enabling it.
11538
+ */
11539
+ /** One signal a device can emit. */
11540
+ var StreamSignalSchema = object({
11541
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11542
+ code: string().min(1),
11543
+ /** What an operator reads in the picker. The provider's own wording. */
11544
+ label: string().min(1),
11545
+ /**
11546
+ * Whether the provider recommends this signal ON when a camera is first set
11547
+ * up. A provider knows which of its signals are cheap and reliable; an
11548
+ * operator should not have to discover that by trial. Reolink recommends
11549
+ * both of its own.
11550
+ */
11551
+ recommended: boolean()
11552
+ });
11553
+ var StreamSignalsStatusSchema = object({
11554
+ signals: array(StreamSignalSchema),
11555
+ lastFetchedAt: number()
11556
+ });
11557
+ var streamSignalsCapability = {
11558
+ name: "stream-signals",
11559
+ scope: "device",
11560
+ deviceNative: true,
11561
+ mode: "singleton",
11562
+ deviceTypes: Object.values(DeviceType),
11563
+ runtimeState: StreamSignalsStatusSchema,
11564
+ methods: {
11565
+ /**
11566
+ * What this device can emit. Empty is a valid and common answer — most
11567
+ * cameras have nothing to offer here, and an empty list is what makes the
11568
+ * broker's picker show nothing rather than a false choice.
11569
+ */
11570
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11571
+ };
11492
11572
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11493
11573
  var StreamFormatSchema = _enum([
11494
11574
  "webrtc",
@@ -11885,6 +11965,22 @@ var EgressTranscodeSchema = object({
11885
11965
  camStreamId: string().nullable()
11886
11966
  });
11887
11967
  method(object({
11968
+ deviceId: number().int().nonnegative(),
11969
+ /** The provider's signal code. */
11970
+ code: string().min(1),
11971
+ /** Ms epoch. Absent ⇒ now. */
11972
+ at: number().optional()
11973
+ }), object({
11974
+ /** Whether the broker acted on it, and if not, why. */
11975
+ accepted: boolean(),
11976
+ reason: _enum([
11977
+ "woke",
11978
+ "hold-extended",
11979
+ "not-enabled",
11980
+ "no-consumer",
11981
+ "unknown-code"
11982
+ ])
11983
+ }), { kind: "mutation" }), method(object({
11888
11984
  deviceId: number().int().nonnegative(),
11889
11985
  camStreamId: string().min(1),
11890
11986
  kind: CamStreamKindSchema,
@@ -12139,6 +12235,16 @@ var PickStreamRequirementsSchema = object({
12139
12235
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12140
12236
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12141
12237
  minHeight: number().int().positive().optional(),
12238
+ /**
12239
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12240
+ *
12241
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12242
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12243
+ * Without this the ceiling had to be re-implemented by every caller — and
12244
+ * one caller implementing it privately is how a second scoring authority
12245
+ * gets born.
12246
+ */
12247
+ maxHeight: number().int().positive().optional(),
12142
12248
  /** Minimum horizontal resolution. */
12143
12249
  minWidth: number().int().positive().optional(),
12144
12250
  /**
@@ -12155,7 +12261,22 @@ var PickStreamRequirementsSchema = object({
12155
12261
  * transcoded" guard: if the device is already serving the consumer's
12156
12262
  * codec end-to-end, there's nothing to optimise.
12157
12263
  */
12158
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12264
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12265
+ /**
12266
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12267
+ * understanding that it will be transcoded.
12268
+ *
12269
+ * Default `false` — today's behaviour, and the right one for a bypass
12270
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12271
+ * ask the larger question: "what is the best stream for me, transcoding if
12272
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12273
+ * does not, so a passthrough is never lost to a transcode; the answer says
12274
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12275
+ *
12276
+ * This is what lets one picker serve both the bypass and the full source
12277
+ * choice, instead of a consumer scoring privately when the bypass misses.
12278
+ */
12279
+ allowTranscode: boolean().optional()
12159
12280
  }).readonly();
12160
12281
  var PickStreamPreferencesSchema = object({
12161
12282
  /**
@@ -12169,12 +12290,32 @@ var PickStreamPreferencesSchema = object({
12169
12290
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12170
12291
  * memory-constrained consumers / Apple Home guest sessions).
12171
12292
  */
12172
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12293
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12294
+ /**
12295
+ * The height the consumer actually wants to DELIVER.
12296
+ *
12297
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12298
+ * above the target wins, and only if nothing reaches it does the tallest
12299
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12300
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12301
+ * express that: it says "as big as possible", which is a different wish.
12302
+ *
12303
+ * Ignored when absent, so every existing caller keeps its ordering.
12304
+ */
12305
+ targetHeight: number().int().positive().optional()
12173
12306
  }).readonly();
12174
12307
  var PickedCamStreamSchema = object({
12175
12308
  camStreamId: string(),
12176
12309
  codec: string().optional(),
12177
12310
  resolution: CamStreamResolutionSchema.optional(),
12311
+ /**
12312
+ * Whether serving this stream requires a decode + re-encode.
12313
+ *
12314
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12315
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12316
+ * not ask cannot be handed a cost it never agreed to pay.
12317
+ */
12318
+ transcodes: boolean(),
12178
12319
  /** One-line explanation of why this stream won — for logs / debug UI. */
12179
12320
  reason: string()
12180
12321
  });
@@ -16691,6 +16832,8 @@ var NcSystemEventKindSchema = _enum([
16691
16832
  "device-enabled",
16692
16833
  "device-battery-low",
16693
16834
  "device-battery-normal",
16835
+ "device-consumable-low",
16836
+ "device-consumable-normal",
16694
16837
  "stream-online",
16695
16838
  "stream-offline",
16696
16839
  "node-online",
@@ -16709,6 +16852,7 @@ var NcSystemEventKindSchema = _enum([
16709
16852
  "addon-updated",
16710
16853
  "server-updated",
16711
16854
  "export-completed",
16855
+ "backup-completed",
16712
16856
  "camera-online",
16713
16857
  "camera-offline",
16714
16858
  "camera-disabled",
@@ -23990,10 +24134,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
23990
24134
  }), boolean()), method(object({
23991
24135
  deviceId: number().int().nonnegative(),
23992
24136
  sessionId: string()
23993
- }), object({ pendingRenegotiation: object({
23994
- target: WebrtcStreamTargetSchema,
23995
- epoch: number()
23996
- }).nullable() }));
24137
+ }), object({
24138
+ pendingRenegotiation: object({
24139
+ target: WebrtcStreamTargetSchema,
24140
+ epoch: number()
24141
+ }).nullable(),
24142
+ /**
24143
+ * Whether the session still EXISTS.
24144
+ *
24145
+ * A consumer that holds a resource for the life of a session needs to
24146
+ * be able to ask, because a session does not always end the way it
24147
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24148
+ * sent `SessionDisconnected`, so the Alexa exporter's
24149
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24150
+ * H.264 transcode kept running for NOBODY for more than twenty
24151
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24152
+ * minutes earlier — the broker knew; the holder had no way to ask.
24153
+ *
24154
+ * `false` for a session id the provider has never heard of, which is
24155
+ * the same answer as "it ended": either way nothing is holding it up.
24156
+ */
24157
+ alive: boolean()
24158
+ }));
23997
24159
  object({
23998
24160
  /** All accessory children of the parent. */
23999
24161
  childDeviceIds: array(number()).readonly(),
@@ -33929,6 +34091,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33929
34091
  smoke: smokeCapability,
33930
34092
  streamCatalog: streamCatalogCapability,
33931
34093
  streamParams: streamParamsCapability,
34094
+ streamSignals: streamSignalsCapability,
33932
34095
  switch: switchCapability,
33933
34096
  tamper: tamperCapability,
33934
34097
  temperatureSensor: temperatureSensorCapability,
@@ -40502,6 +40665,12 @@ Object.freeze({
40502
40665
  addonId: null,
40503
40666
  access: "create"
40504
40667
  },
40668
+ "streamBroker.reportStreamSignal": {
40669
+ capName: "stream-broker",
40670
+ capScope: "system",
40671
+ addonId: null,
40672
+ access: "create"
40673
+ },
40505
40674
  "streamBroker.restartProfile": {
40506
40675
  capName: "stream-broker",
40507
40676
  capScope: "system",
@@ -40586,6 +40755,12 @@ Object.freeze({
40586
40755
  addonId: null,
40587
40756
  access: "create"
40588
40757
  },
40758
+ "streamSignals.listSignals": {
40759
+ capName: "stream-signals",
40760
+ capScope: "device",
40761
+ addonId: null,
40762
+ access: "view"
40763
+ },
40589
40764
  "switch.setState": {
40590
40765
  capName: "switch",
40591
40766
  capScope: "device",
@@ -42958,6 +43133,11 @@ Object.freeze({
42958
43133
  form: "single",
42959
43134
  optional: false
42960
43135
  }],
43136
+ "streamBroker.reportStreamSignal": [{
43137
+ name: "deviceId",
43138
+ form: "single",
43139
+ optional: false
43140
+ }],
42961
43141
  "streamBroker.restartProfile": [{
42962
43142
  name: "deviceId",
42963
43143
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-unifi",
3
- "version": "0.2.101",
3
+ "version": "0.2.102",
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",