@camstack/addon-provider-tuya 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
@@ -819,7 +819,7 @@ async function discoverDevices(options = {}, binder = createDgramBinder()) {
819
819
  return [...byId.values()];
820
820
  }
821
821
  //#endregion
822
- //#region ../types/dist/event-category-ZyX6jcse.mjs
822
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
823
823
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
824
824
  EventCategory["SystemBoot"] = "system.boot";
825
825
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1436,6 +1436,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1436
1436
  * pull-reconcile from the provider's `getStatus` on reconnect. */
1437
1437
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
1438
1438
  EventCategory["BackupCompleted"] = "backup.completed";
1439
+ /**
1440
+ * A whole backup RUN finished — every destination attempted, win or lose.
1441
+ *
1442
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
1443
+ * a progress UI and the wrong one for a notification: an operator with three
1444
+ * destinations would be told three times. And a run where two of three
1445
+ * destinations succeeded is not a clean success — a single "backup
1446
+ * completed" that hid the failed one would be a lie, so the count of each is
1447
+ * carried here and the message says both.
1448
+ *
1449
+ * Emitted by the backup orchestrator only after the destination loop, so a
1450
+ * run that dies during the BUILD phase produces no completion at all.
1451
+ */
1452
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
1439
1453
  EventCategory["BackupRestored"] = "backup.restored";
1440
1454
  EventCategory["NotificationDispatched"] = "notification.dispatched";
1441
1455
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -6166,7 +6180,7 @@ var ZodIssueCode = {
6166
6180
  var ZodFirstPartyTypeKind;
6167
6181
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6168
6182
  //#endregion
6169
- //#region ../types/dist/sleep-DBKu2-U5.mjs
6183
+ //#region ../types/dist/sleep-DEuj7E3j.mjs
6170
6184
  /**
6171
6185
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6172
6186
  * window to float samples (D455).
@@ -12310,6 +12324,72 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
12310
12324
  auth: "admin"
12311
12325
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
12312
12326
  DeviceType.Camera;
12327
+ /**
12328
+ * The signals a device can emit to WAKE its own stream.
12329
+ *
12330
+ * A camera whose stream is built on demand sleeps until something asks for it,
12331
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
12332
+ * puller holds a session open for ever, and treating that as demand would keep
12333
+ * a battery camera awake for ever, which is the whole thing the battery is for
12334
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
12335
+ * itself, with no stream running.
12336
+ *
12337
+ * ## The vocabulary is the PROVIDER'S, not ours
12338
+ *
12339
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
12340
+ * names each signal with a `code` it chooses and a `label` an operator reads.
12341
+ * Reolink offers motion and camera-native detection; another provider may offer
12342
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
12343
+ * yet. A fixed enum here would mean every new signal is a framework release.
12344
+ *
12345
+ * It is deliberately NOT derived from the caps a device already binds. Whether
12346
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
12347
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
12348
+ * binding — but both answer "what drives the detection pipeline", which is a
12349
+ * different question from "what may wake a sleeping stream". A camera can do
12350
+ * the first and not be trusted with the second, and the operator picks per
12351
+ * camera. Two questions, two authorities.
12352
+ *
12353
+ * ## Availability is not permission
12354
+ *
12355
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
12356
+ * wakes the stream is the operator's per-camera choice, held by the broker
12357
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
12358
+ * provider declaring a signal is not a provider enabling it.
12359
+ */
12360
+ /** One signal a device can emit. */
12361
+ var StreamSignalSchema = object({
12362
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
12363
+ code: string().min(1),
12364
+ /** What an operator reads in the picker. The provider's own wording. */
12365
+ label: string().min(1),
12366
+ /**
12367
+ * Whether the provider recommends this signal ON when a camera is first set
12368
+ * up. A provider knows which of its signals are cheap and reliable; an
12369
+ * operator should not have to discover that by trial. Reolink recommends
12370
+ * both of its own.
12371
+ */
12372
+ recommended: boolean()
12373
+ });
12374
+ var StreamSignalsStatusSchema = object({
12375
+ signals: array(StreamSignalSchema),
12376
+ lastFetchedAt: number()
12377
+ });
12378
+ var streamSignalsCapability = {
12379
+ name: "stream-signals",
12380
+ scope: "device",
12381
+ deviceNative: true,
12382
+ mode: "singleton",
12383
+ deviceTypes: Object.values(DeviceType),
12384
+ runtimeState: StreamSignalsStatusSchema,
12385
+ methods: {
12386
+ /**
12387
+ * What this device can emit. Empty is a valid and common answer — most
12388
+ * cameras have nothing to offer here, and an empty list is what makes the
12389
+ * broker's picker show nothing rather than a false choice.
12390
+ */
12391
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
12392
+ };
12313
12393
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
12314
12394
  var StreamFormatSchema = _enum([
12315
12395
  "webrtc",
@@ -12706,6 +12786,22 @@ var EgressTranscodeSchema = object({
12706
12786
  camStreamId: string().nullable()
12707
12787
  });
12708
12788
  method(object({
12789
+ deviceId: number().int().nonnegative(),
12790
+ /** The provider's signal code. */
12791
+ code: string().min(1),
12792
+ /** Ms epoch. Absent ⇒ now. */
12793
+ at: number().optional()
12794
+ }), object({
12795
+ /** Whether the broker acted on it, and if not, why. */
12796
+ accepted: boolean(),
12797
+ reason: _enum([
12798
+ "woke",
12799
+ "hold-extended",
12800
+ "not-enabled",
12801
+ "no-consumer",
12802
+ "unknown-code"
12803
+ ])
12804
+ }), { kind: "mutation" }), method(object({
12709
12805
  deviceId: number().int().nonnegative(),
12710
12806
  camStreamId: string().min(1),
12711
12807
  kind: CamStreamKindSchema,
@@ -12960,6 +13056,16 @@ var PickStreamRequirementsSchema = object({
12960
13056
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12961
13057
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12962
13058
  minHeight: number().int().positive().optional(),
13059
+ /**
13060
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
13061
+ *
13062
+ * A consumer can have a ceiling as real as its floor: Alexa documents
13063
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
13064
+ * Without this the ceiling had to be re-implemented by every caller — and
13065
+ * one caller implementing it privately is how a second scoring authority
13066
+ * gets born.
13067
+ */
13068
+ maxHeight: number().int().positive().optional(),
12963
13069
  /** Minimum horizontal resolution. */
12964
13070
  minWidth: number().int().positive().optional(),
12965
13071
  /**
@@ -12976,7 +13082,22 @@ var PickStreamRequirementsSchema = object({
12976
13082
  * transcoded" guard: if the device is already serving the consumer's
12977
13083
  * codec end-to-end, there's nothing to optimise.
12978
13084
  */
12979
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
13085
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
13086
+ /**
13087
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
13088
+ * understanding that it will be transcoded.
13089
+ *
13090
+ * Default `false` — today's behaviour, and the right one for a bypass
13091
+ * question ("is there a stream I can forward untouched?"). Set `true` to
13092
+ * ask the larger question: "what is the best stream for me, transcoding if
13093
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
13094
+ * does not, so a passthrough is never lost to a transcode; the answer says
13095
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
13096
+ *
13097
+ * This is what lets one picker serve both the bypass and the full source
13098
+ * choice, instead of a consumer scoring privately when the bypass misses.
13099
+ */
13100
+ allowTranscode: boolean().optional()
12980
13101
  }).readonly();
12981
13102
  var PickStreamPreferencesSchema = object({
12982
13103
  /**
@@ -12990,12 +13111,32 @@ var PickStreamPreferencesSchema = object({
12990
13111
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12991
13112
  * memory-constrained consumers / Apple Home guest sessions).
12992
13113
  */
12993
- resolutionPreference: _enum(["highest", "lowest"]).optional()
13114
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
13115
+ /**
13116
+ * The height the consumer actually wants to DELIVER.
13117
+ *
13118
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
13119
+ * above the target wins, and only if nothing reaches it does the tallest
13120
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
13121
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
13122
+ * express that: it says "as big as possible", which is a different wish.
13123
+ *
13124
+ * Ignored when absent, so every existing caller keeps its ordering.
13125
+ */
13126
+ targetHeight: number().int().positive().optional()
12994
13127
  }).readonly();
12995
13128
  var PickedCamStreamSchema = object({
12996
13129
  camStreamId: string(),
12997
13130
  codec: string().optional(),
12998
13131
  resolution: CamStreamResolutionSchema.optional(),
13132
+ /**
13133
+ * Whether serving this stream requires a decode + re-encode.
13134
+ *
13135
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
13136
+ * when the caller asked for it with `allowTranscode`, so a caller that did
13137
+ * not ask cannot be handed a cost it never agreed to pay.
13138
+ */
13139
+ transcodes: boolean(),
12999
13140
  /** One-line explanation of why this stream won — for logs / debug UI. */
13000
13141
  reason: string()
13001
13142
  });
@@ -17529,6 +17670,8 @@ var NcSystemEventKindSchema = _enum([
17529
17670
  "device-enabled",
17530
17671
  "device-battery-low",
17531
17672
  "device-battery-normal",
17673
+ "device-consumable-low",
17674
+ "device-consumable-normal",
17532
17675
  "stream-online",
17533
17676
  "stream-offline",
17534
17677
  "node-online",
@@ -17547,6 +17690,7 @@ var NcSystemEventKindSchema = _enum([
17547
17690
  "addon-updated",
17548
17691
  "server-updated",
17549
17692
  "export-completed",
17693
+ "backup-completed",
17550
17694
  "camera-online",
17551
17695
  "camera-offline",
17552
17696
  "camera-disabled",
@@ -24828,10 +24972,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24828
24972
  }), boolean()), method(object({
24829
24973
  deviceId: number().int().nonnegative(),
24830
24974
  sessionId: string()
24831
- }), object({ pendingRenegotiation: object({
24832
- target: WebrtcStreamTargetSchema,
24833
- epoch: number()
24834
- }).nullable() }));
24975
+ }), object({
24976
+ pendingRenegotiation: object({
24977
+ target: WebrtcStreamTargetSchema,
24978
+ epoch: number()
24979
+ }).nullable(),
24980
+ /**
24981
+ * Whether the session still EXISTS.
24982
+ *
24983
+ * A consumer that holds a resource for the life of a session needs to
24984
+ * be able to ask, because a session does not always end the way it
24985
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24986
+ * sent `SessionDisconnected`, so the Alexa exporter's
24987
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24988
+ * H.264 transcode kept running for NOBODY for more than twenty
24989
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24990
+ * minutes earlier — the broker knew; the holder had no way to ask.
24991
+ *
24992
+ * `false` for a session id the provider has never heard of, which is
24993
+ * the same answer as "it ended": either way nothing is holding it up.
24994
+ */
24995
+ alive: boolean()
24996
+ }));
24835
24997
  object({
24836
24998
  /** All accessory children of the parent. */
24837
24999
  childDeviceIds: array(number()).readonly(),
@@ -34758,6 +34920,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34758
34920
  smoke: smokeCapability,
34759
34921
  streamCatalog: streamCatalogCapability,
34760
34922
  streamParams: streamParamsCapability,
34923
+ streamSignals: streamSignalsCapability,
34761
34924
  switch: switchCapability,
34762
34925
  tamper: tamperCapability,
34763
34926
  temperatureSensor: temperatureSensorCapability,
@@ -41331,6 +41494,12 @@ Object.freeze({
41331
41494
  addonId: null,
41332
41495
  access: "create"
41333
41496
  },
41497
+ "streamBroker.reportStreamSignal": {
41498
+ capName: "stream-broker",
41499
+ capScope: "system",
41500
+ addonId: null,
41501
+ access: "create"
41502
+ },
41334
41503
  "streamBroker.restartProfile": {
41335
41504
  capName: "stream-broker",
41336
41505
  capScope: "system",
@@ -41415,6 +41584,12 @@ Object.freeze({
41415
41584
  addonId: null,
41416
41585
  access: "create"
41417
41586
  },
41587
+ "streamSignals.listSignals": {
41588
+ capName: "stream-signals",
41589
+ capScope: "device",
41590
+ addonId: null,
41591
+ access: "view"
41592
+ },
41418
41593
  "switch.setState": {
41419
41594
  capName: "switch",
41420
41595
  capScope: "device",
@@ -43787,6 +43962,11 @@ Object.freeze({
43787
43962
  form: "single",
43788
43963
  optional: false
43789
43964
  }],
43965
+ "streamBroker.reportStreamSignal": [{
43966
+ name: "deviceId",
43967
+ form: "single",
43968
+ optional: false
43969
+ }],
43790
43970
  "streamBroker.restartProfile": [{
43791
43971
  name: "deviceId",
43792
43972
  form: "single",
package/dist/addon.mjs CHANGED
@@ -818,7 +818,7 @@ async function discoverDevices(options = {}, binder = createDgramBinder()) {
818
818
  return [...byId.values()];
819
819
  }
820
820
  //#endregion
821
- //#region ../types/dist/event-category-ZyX6jcse.mjs
821
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
822
822
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
823
823
  EventCategory["SystemBoot"] = "system.boot";
824
824
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1435,6 +1435,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1435
1435
  * pull-reconcile from the provider's `getStatus` on reconnect. */
1436
1436
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
1437
1437
  EventCategory["BackupCompleted"] = "backup.completed";
1438
+ /**
1439
+ * A whole backup RUN finished — every destination attempted, win or lose.
1440
+ *
1441
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
1442
+ * a progress UI and the wrong one for a notification: an operator with three
1443
+ * destinations would be told three times. And a run where two of three
1444
+ * destinations succeeded is not a clean success — a single "backup
1445
+ * completed" that hid the failed one would be a lie, so the count of each is
1446
+ * carried here and the message says both.
1447
+ *
1448
+ * Emitted by the backup orchestrator only after the destination loop, so a
1449
+ * run that dies during the BUILD phase produces no completion at all.
1450
+ */
1451
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
1438
1452
  EventCategory["BackupRestored"] = "backup.restored";
1439
1453
  EventCategory["NotificationDispatched"] = "notification.dispatched";
1440
1454
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -6165,7 +6179,7 @@ var ZodIssueCode = {
6165
6179
  var ZodFirstPartyTypeKind;
6166
6180
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6167
6181
  //#endregion
6168
- //#region ../types/dist/sleep-DBKu2-U5.mjs
6182
+ //#region ../types/dist/sleep-DEuj7E3j.mjs
6169
6183
  /**
6170
6184
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6171
6185
  * window to float samples (D455).
@@ -12309,6 +12323,72 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
12309
12323
  auth: "admin"
12310
12324
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
12311
12325
  DeviceType.Camera;
12326
+ /**
12327
+ * The signals a device can emit to WAKE its own stream.
12328
+ *
12329
+ * A camera whose stream is built on demand sleeps until something asks for it,
12330
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
12331
+ * puller holds a session open for ever, and treating that as demand would keep
12332
+ * a battery camera awake for ever, which is the whole thing the battery is for
12333
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
12334
+ * itself, with no stream running.
12335
+ *
12336
+ * ## The vocabulary is the PROVIDER'S, not ours
12337
+ *
12338
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
12339
+ * names each signal with a `code` it chooses and a `label` an operator reads.
12340
+ * Reolink offers motion and camera-native detection; another provider may offer
12341
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
12342
+ * yet. A fixed enum here would mean every new signal is a framework release.
12343
+ *
12344
+ * It is deliberately NOT derived from the caps a device already binds. Whether
12345
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
12346
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
12347
+ * binding — but both answer "what drives the detection pipeline", which is a
12348
+ * different question from "what may wake a sleeping stream". A camera can do
12349
+ * the first and not be trusted with the second, and the operator picks per
12350
+ * camera. Two questions, two authorities.
12351
+ *
12352
+ * ## Availability is not permission
12353
+ *
12354
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
12355
+ * wakes the stream is the operator's per-camera choice, held by the broker
12356
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
12357
+ * provider declaring a signal is not a provider enabling it.
12358
+ */
12359
+ /** One signal a device can emit. */
12360
+ var StreamSignalSchema = object({
12361
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
12362
+ code: string().min(1),
12363
+ /** What an operator reads in the picker. The provider's own wording. */
12364
+ label: string().min(1),
12365
+ /**
12366
+ * Whether the provider recommends this signal ON when a camera is first set
12367
+ * up. A provider knows which of its signals are cheap and reliable; an
12368
+ * operator should not have to discover that by trial. Reolink recommends
12369
+ * both of its own.
12370
+ */
12371
+ recommended: boolean()
12372
+ });
12373
+ var StreamSignalsStatusSchema = object({
12374
+ signals: array(StreamSignalSchema),
12375
+ lastFetchedAt: number()
12376
+ });
12377
+ var streamSignalsCapability = {
12378
+ name: "stream-signals",
12379
+ scope: "device",
12380
+ deviceNative: true,
12381
+ mode: "singleton",
12382
+ deviceTypes: Object.values(DeviceType),
12383
+ runtimeState: StreamSignalsStatusSchema,
12384
+ methods: {
12385
+ /**
12386
+ * What this device can emit. Empty is a valid and common answer — most
12387
+ * cameras have nothing to offer here, and an empty list is what makes the
12388
+ * broker's picker show nothing rather than a false choice.
12389
+ */
12390
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
12391
+ };
12312
12392
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
12313
12393
  var StreamFormatSchema = _enum([
12314
12394
  "webrtc",
@@ -12705,6 +12785,22 @@ var EgressTranscodeSchema = object({
12705
12785
  camStreamId: string().nullable()
12706
12786
  });
12707
12787
  method(object({
12788
+ deviceId: number().int().nonnegative(),
12789
+ /** The provider's signal code. */
12790
+ code: string().min(1),
12791
+ /** Ms epoch. Absent ⇒ now. */
12792
+ at: number().optional()
12793
+ }), object({
12794
+ /** Whether the broker acted on it, and if not, why. */
12795
+ accepted: boolean(),
12796
+ reason: _enum([
12797
+ "woke",
12798
+ "hold-extended",
12799
+ "not-enabled",
12800
+ "no-consumer",
12801
+ "unknown-code"
12802
+ ])
12803
+ }), { kind: "mutation" }), method(object({
12708
12804
  deviceId: number().int().nonnegative(),
12709
12805
  camStreamId: string().min(1),
12710
12806
  kind: CamStreamKindSchema,
@@ -12959,6 +13055,16 @@ var PickStreamRequirementsSchema = object({
12959
13055
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12960
13056
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12961
13057
  minHeight: number().int().positive().optional(),
13058
+ /**
13059
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
13060
+ *
13061
+ * A consumer can have a ceiling as real as its floor: Alexa documents
13062
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
13063
+ * Without this the ceiling had to be re-implemented by every caller — and
13064
+ * one caller implementing it privately is how a second scoring authority
13065
+ * gets born.
13066
+ */
13067
+ maxHeight: number().int().positive().optional(),
12962
13068
  /** Minimum horizontal resolution. */
12963
13069
  minWidth: number().int().positive().optional(),
12964
13070
  /**
@@ -12975,7 +13081,22 @@ var PickStreamRequirementsSchema = object({
12975
13081
  * transcoded" guard: if the device is already serving the consumer's
12976
13082
  * codec end-to-end, there's nothing to optimise.
12977
13083
  */
12978
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
13084
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
13085
+ /**
13086
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
13087
+ * understanding that it will be transcoded.
13088
+ *
13089
+ * Default `false` — today's behaviour, and the right one for a bypass
13090
+ * question ("is there a stream I can forward untouched?"). Set `true` to
13091
+ * ask the larger question: "what is the best stream for me, transcoding if
13092
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
13093
+ * does not, so a passthrough is never lost to a transcode; the answer says
13094
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
13095
+ *
13096
+ * This is what lets one picker serve both the bypass and the full source
13097
+ * choice, instead of a consumer scoring privately when the bypass misses.
13098
+ */
13099
+ allowTranscode: boolean().optional()
12979
13100
  }).readonly();
12980
13101
  var PickStreamPreferencesSchema = object({
12981
13102
  /**
@@ -12989,12 +13110,32 @@ var PickStreamPreferencesSchema = object({
12989
13110
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12990
13111
  * memory-constrained consumers / Apple Home guest sessions).
12991
13112
  */
12992
- resolutionPreference: _enum(["highest", "lowest"]).optional()
13113
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
13114
+ /**
13115
+ * The height the consumer actually wants to DELIVER.
13116
+ *
13117
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
13118
+ * above the target wins, and only if nothing reaches it does the tallest
13119
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
13120
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
13121
+ * express that: it says "as big as possible", which is a different wish.
13122
+ *
13123
+ * Ignored when absent, so every existing caller keeps its ordering.
13124
+ */
13125
+ targetHeight: number().int().positive().optional()
12993
13126
  }).readonly();
12994
13127
  var PickedCamStreamSchema = object({
12995
13128
  camStreamId: string(),
12996
13129
  codec: string().optional(),
12997
13130
  resolution: CamStreamResolutionSchema.optional(),
13131
+ /**
13132
+ * Whether serving this stream requires a decode + re-encode.
13133
+ *
13134
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
13135
+ * when the caller asked for it with `allowTranscode`, so a caller that did
13136
+ * not ask cannot be handed a cost it never agreed to pay.
13137
+ */
13138
+ transcodes: boolean(),
12998
13139
  /** One-line explanation of why this stream won — for logs / debug UI. */
12999
13140
  reason: string()
13000
13141
  });
@@ -17528,6 +17669,8 @@ var NcSystemEventKindSchema = _enum([
17528
17669
  "device-enabled",
17529
17670
  "device-battery-low",
17530
17671
  "device-battery-normal",
17672
+ "device-consumable-low",
17673
+ "device-consumable-normal",
17531
17674
  "stream-online",
17532
17675
  "stream-offline",
17533
17676
  "node-online",
@@ -17546,6 +17689,7 @@ var NcSystemEventKindSchema = _enum([
17546
17689
  "addon-updated",
17547
17690
  "server-updated",
17548
17691
  "export-completed",
17692
+ "backup-completed",
17549
17693
  "camera-online",
17550
17694
  "camera-offline",
17551
17695
  "camera-disabled",
@@ -24827,10 +24971,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24827
24971
  }), boolean()), method(object({
24828
24972
  deviceId: number().int().nonnegative(),
24829
24973
  sessionId: string()
24830
- }), object({ pendingRenegotiation: object({
24831
- target: WebrtcStreamTargetSchema,
24832
- epoch: number()
24833
- }).nullable() }));
24974
+ }), object({
24975
+ pendingRenegotiation: object({
24976
+ target: WebrtcStreamTargetSchema,
24977
+ epoch: number()
24978
+ }).nullable(),
24979
+ /**
24980
+ * Whether the session still EXISTS.
24981
+ *
24982
+ * A consumer that holds a resource for the life of a session needs to
24983
+ * be able to ask, because a session does not always end the way it
24984
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24985
+ * sent `SessionDisconnected`, so the Alexa exporter's
24986
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24987
+ * H.264 transcode kept running for NOBODY for more than twenty
24988
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24989
+ * minutes earlier — the broker knew; the holder had no way to ask.
24990
+ *
24991
+ * `false` for a session id the provider has never heard of, which is
24992
+ * the same answer as "it ended": either way nothing is holding it up.
24993
+ */
24994
+ alive: boolean()
24995
+ }));
24834
24996
  object({
24835
24997
  /** All accessory children of the parent. */
24836
24998
  childDeviceIds: array(number()).readonly(),
@@ -34757,6 +34919,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34757
34919
  smoke: smokeCapability,
34758
34920
  streamCatalog: streamCatalogCapability,
34759
34921
  streamParams: streamParamsCapability,
34922
+ streamSignals: streamSignalsCapability,
34760
34923
  switch: switchCapability,
34761
34924
  tamper: tamperCapability,
34762
34925
  temperatureSensor: temperatureSensorCapability,
@@ -41330,6 +41493,12 @@ Object.freeze({
41330
41493
  addonId: null,
41331
41494
  access: "create"
41332
41495
  },
41496
+ "streamBroker.reportStreamSignal": {
41497
+ capName: "stream-broker",
41498
+ capScope: "system",
41499
+ addonId: null,
41500
+ access: "create"
41501
+ },
41333
41502
  "streamBroker.restartProfile": {
41334
41503
  capName: "stream-broker",
41335
41504
  capScope: "system",
@@ -41414,6 +41583,12 @@ Object.freeze({
41414
41583
  addonId: null,
41415
41584
  access: "create"
41416
41585
  },
41586
+ "streamSignals.listSignals": {
41587
+ capName: "stream-signals",
41588
+ capScope: "device",
41589
+ addonId: null,
41590
+ access: "view"
41591
+ },
41417
41592
  "switch.setState": {
41418
41593
  capName: "switch",
41419
41594
  capScope: "device",
@@ -43786,6 +43961,11 @@ Object.freeze({
43786
43961
  form: "single",
43787
43962
  optional: false
43788
43963
  }],
43964
+ "streamBroker.reportStreamSignal": [{
43965
+ name: "deviceId",
43966
+ form: "single",
43967
+ optional: false
43968
+ }],
43789
43969
  "streamBroker.restartProfile": [{
43790
43970
  name: "deviceId",
43791
43971
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.101",
3
+ "version": "0.2.102",
4
4
  "description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
5
5
  "keywords": [
6
6
  "camstack",