@camstack/addon-provider-gree 0.2.100 → 0.2.101

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
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let dgram = require("dgram");
3
3
  let crypto$1 = require("crypto");
4
4
  let events = require("events");
5
- //#region ../types/dist/event-category-ZyX6jcse.mjs
5
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -619,6 +619,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
619
619
  * pull-reconcile from the provider's `getStatus` on reconnect. */
620
620
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
621
621
  EventCategory["BackupCompleted"] = "backup.completed";
622
+ /**
623
+ * A whole backup RUN finished — every destination attempted, win or lose.
624
+ *
625
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
626
+ * a progress UI and the wrong one for a notification: an operator with three
627
+ * destinations would be told three times. And a run where two of three
628
+ * destinations succeeded is not a clean success — a single "backup
629
+ * completed" that hid the failed one would be a lie, so the count of each is
630
+ * carried here and the message says both.
631
+ *
632
+ * Emitted by the backup orchestrator only after the destination loop, so a
633
+ * run that dies during the BUILD phase produces no completion at all.
634
+ */
635
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
622
636
  EventCategory["BackupRestored"] = "backup.restored";
623
637
  EventCategory["NotificationDispatched"] = "notification.dispatched";
624
638
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5349,7 +5363,7 @@ var ZodIssueCode = {
5349
5363
  var ZodFirstPartyTypeKind;
5350
5364
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5351
5365
  //#endregion
5352
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5366
+ //#region ../types/dist/sleep-DEuj7E3j.mjs
5353
5367
  /**
5354
5368
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5355
5369
  * window to float samples (D455).
@@ -11493,6 +11507,72 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11493
11507
  auth: "admin"
11494
11508
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11495
11509
  DeviceType.Camera;
11510
+ /**
11511
+ * The signals a device can emit to WAKE its own stream.
11512
+ *
11513
+ * A camera whose stream is built on demand sleeps until something asks for it,
11514
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11515
+ * puller holds a session open for ever, and treating that as demand would keep
11516
+ * a battery camera awake for ever, which is the whole thing the battery is for
11517
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11518
+ * itself, with no stream running.
11519
+ *
11520
+ * ## The vocabulary is the PROVIDER'S, not ours
11521
+ *
11522
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11523
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11524
+ * Reolink offers motion and camera-native detection; another provider may offer
11525
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11526
+ * yet. A fixed enum here would mean every new signal is a framework release.
11527
+ *
11528
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11529
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11530
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11531
+ * binding — but both answer "what drives the detection pipeline", which is a
11532
+ * different question from "what may wake a sleeping stream". A camera can do
11533
+ * the first and not be trusted with the second, and the operator picks per
11534
+ * camera. Two questions, two authorities.
11535
+ *
11536
+ * ## Availability is not permission
11537
+ *
11538
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11539
+ * wakes the stream is the operator's per-camera choice, held by the broker
11540
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11541
+ * provider declaring a signal is not a provider enabling it.
11542
+ */
11543
+ /** One signal a device can emit. */
11544
+ var StreamSignalSchema = object({
11545
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11546
+ code: string().min(1),
11547
+ /** What an operator reads in the picker. The provider's own wording. */
11548
+ label: string().min(1),
11549
+ /**
11550
+ * Whether the provider recommends this signal ON when a camera is first set
11551
+ * up. A provider knows which of its signals are cheap and reliable; an
11552
+ * operator should not have to discover that by trial. Reolink recommends
11553
+ * both of its own.
11554
+ */
11555
+ recommended: boolean()
11556
+ });
11557
+ var StreamSignalsStatusSchema = object({
11558
+ signals: array(StreamSignalSchema),
11559
+ lastFetchedAt: number()
11560
+ });
11561
+ var streamSignalsCapability = {
11562
+ name: "stream-signals",
11563
+ scope: "device",
11564
+ deviceNative: true,
11565
+ mode: "singleton",
11566
+ deviceTypes: Object.values(DeviceType),
11567
+ runtimeState: StreamSignalsStatusSchema,
11568
+ methods: {
11569
+ /**
11570
+ * What this device can emit. Empty is a valid and common answer — most
11571
+ * cameras have nothing to offer here, and an empty list is what makes the
11572
+ * broker's picker show nothing rather than a false choice.
11573
+ */
11574
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11575
+ };
11496
11576
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11497
11577
  var StreamFormatSchema = _enum([
11498
11578
  "webrtc",
@@ -11889,6 +11969,22 @@ var EgressTranscodeSchema = object({
11889
11969
  camStreamId: string().nullable()
11890
11970
  });
11891
11971
  method(object({
11972
+ deviceId: number().int().nonnegative(),
11973
+ /** The provider's signal code. */
11974
+ code: string().min(1),
11975
+ /** Ms epoch. Absent ⇒ now. */
11976
+ at: number().optional()
11977
+ }), object({
11978
+ /** Whether the broker acted on it, and if not, why. */
11979
+ accepted: boolean(),
11980
+ reason: _enum([
11981
+ "woke",
11982
+ "hold-extended",
11983
+ "not-enabled",
11984
+ "no-consumer",
11985
+ "unknown-code"
11986
+ ])
11987
+ }), { kind: "mutation" }), method(object({
11892
11988
  deviceId: number().int().nonnegative(),
11893
11989
  camStreamId: string().min(1),
11894
11990
  kind: CamStreamKindSchema,
@@ -12143,6 +12239,16 @@ var PickStreamRequirementsSchema = object({
12143
12239
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12144
12240
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12145
12241
  minHeight: number().int().positive().optional(),
12242
+ /**
12243
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12244
+ *
12245
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12246
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12247
+ * Without this the ceiling had to be re-implemented by every caller — and
12248
+ * one caller implementing it privately is how a second scoring authority
12249
+ * gets born.
12250
+ */
12251
+ maxHeight: number().int().positive().optional(),
12146
12252
  /** Minimum horizontal resolution. */
12147
12253
  minWidth: number().int().positive().optional(),
12148
12254
  /**
@@ -12159,7 +12265,22 @@ var PickStreamRequirementsSchema = object({
12159
12265
  * transcoded" guard: if the device is already serving the consumer's
12160
12266
  * codec end-to-end, there's nothing to optimise.
12161
12267
  */
12162
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12268
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12269
+ /**
12270
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12271
+ * understanding that it will be transcoded.
12272
+ *
12273
+ * Default `false` — today's behaviour, and the right one for a bypass
12274
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12275
+ * ask the larger question: "what is the best stream for me, transcoding if
12276
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12277
+ * does not, so a passthrough is never lost to a transcode; the answer says
12278
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12279
+ *
12280
+ * This is what lets one picker serve both the bypass and the full source
12281
+ * choice, instead of a consumer scoring privately when the bypass misses.
12282
+ */
12283
+ allowTranscode: boolean().optional()
12163
12284
  }).readonly();
12164
12285
  var PickStreamPreferencesSchema = object({
12165
12286
  /**
@@ -12173,12 +12294,32 @@ var PickStreamPreferencesSchema = object({
12173
12294
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12174
12295
  * memory-constrained consumers / Apple Home guest sessions).
12175
12296
  */
12176
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12297
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12298
+ /**
12299
+ * The height the consumer actually wants to DELIVER.
12300
+ *
12301
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12302
+ * above the target wins, and only if nothing reaches it does the tallest
12303
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12304
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12305
+ * express that: it says "as big as possible", which is a different wish.
12306
+ *
12307
+ * Ignored when absent, so every existing caller keeps its ordering.
12308
+ */
12309
+ targetHeight: number().int().positive().optional()
12177
12310
  }).readonly();
12178
12311
  var PickedCamStreamSchema = object({
12179
12312
  camStreamId: string(),
12180
12313
  codec: string().optional(),
12181
12314
  resolution: CamStreamResolutionSchema.optional(),
12315
+ /**
12316
+ * Whether serving this stream requires a decode + re-encode.
12317
+ *
12318
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12319
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12320
+ * not ask cannot be handed a cost it never agreed to pay.
12321
+ */
12322
+ transcodes: boolean(),
12182
12323
  /** One-line explanation of why this stream won — for logs / debug UI. */
12183
12324
  reason: string()
12184
12325
  });
@@ -16695,6 +16836,8 @@ var NcSystemEventKindSchema = _enum([
16695
16836
  "device-enabled",
16696
16837
  "device-battery-low",
16697
16838
  "device-battery-normal",
16839
+ "device-consumable-low",
16840
+ "device-consumable-normal",
16698
16841
  "stream-online",
16699
16842
  "stream-offline",
16700
16843
  "node-online",
@@ -16713,6 +16856,7 @@ var NcSystemEventKindSchema = _enum([
16713
16856
  "addon-updated",
16714
16857
  "server-updated",
16715
16858
  "export-completed",
16859
+ "backup-completed",
16716
16860
  "camera-online",
16717
16861
  "camera-offline",
16718
16862
  "camera-disabled",
@@ -23994,10 +24138,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
23994
24138
  }), boolean()), method(object({
23995
24139
  deviceId: number().int().nonnegative(),
23996
24140
  sessionId: string()
23997
- }), object({ pendingRenegotiation: object({
23998
- target: WebrtcStreamTargetSchema,
23999
- epoch: number()
24000
- }).nullable() }));
24141
+ }), object({
24142
+ pendingRenegotiation: object({
24143
+ target: WebrtcStreamTargetSchema,
24144
+ epoch: number()
24145
+ }).nullable(),
24146
+ /**
24147
+ * Whether the session still EXISTS.
24148
+ *
24149
+ * A consumer that holds a resource for the life of a session needs to
24150
+ * be able to ask, because a session does not always end the way it
24151
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24152
+ * sent `SessionDisconnected`, so the Alexa exporter's
24153
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24154
+ * H.264 transcode kept running for NOBODY for more than twenty
24155
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24156
+ * minutes earlier — the broker knew; the holder had no way to ask.
24157
+ *
24158
+ * `false` for a session id the provider has never heard of, which is
24159
+ * the same answer as "it ended": either way nothing is holding it up.
24160
+ */
24161
+ alive: boolean()
24162
+ }));
24001
24163
  object({
24002
24164
  /** All accessory children of the parent. */
24003
24165
  childDeviceIds: array(number()).readonly(),
@@ -33916,6 +34078,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33916
34078
  smoke: smokeCapability,
33917
34079
  streamCatalog: streamCatalogCapability,
33918
34080
  streamParams: streamParamsCapability,
34081
+ streamSignals: streamSignalsCapability,
33919
34082
  switch: switchCapability,
33920
34083
  tamper: tamperCapability,
33921
34084
  temperatureSensor: temperatureSensorCapability,
@@ -40489,6 +40652,12 @@ Object.freeze({
40489
40652
  addonId: null,
40490
40653
  access: "create"
40491
40654
  },
40655
+ "streamBroker.reportStreamSignal": {
40656
+ capName: "stream-broker",
40657
+ capScope: "system",
40658
+ addonId: null,
40659
+ access: "create"
40660
+ },
40492
40661
  "streamBroker.restartProfile": {
40493
40662
  capName: "stream-broker",
40494
40663
  capScope: "system",
@@ -40573,6 +40742,12 @@ Object.freeze({
40573
40742
  addonId: null,
40574
40743
  access: "create"
40575
40744
  },
40745
+ "streamSignals.listSignals": {
40746
+ capName: "stream-signals",
40747
+ capScope: "device",
40748
+ addonId: null,
40749
+ access: "view"
40750
+ },
40576
40751
  "switch.setState": {
40577
40752
  capName: "switch",
40578
40753
  capScope: "device",
@@ -42945,6 +43120,11 @@ Object.freeze({
42945
43120
  form: "single",
42946
43121
  optional: false
42947
43122
  }],
43123
+ "streamBroker.reportStreamSignal": [{
43124
+ name: "deviceId",
43125
+ form: "single",
43126
+ optional: false
43127
+ }],
42948
43128
  "streamBroker.restartProfile": [{
42949
43129
  name: "deviceId",
42950
43130
  form: "single",
package/dist/addon.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createSocket } from "dgram";
2
2
  import { createCipheriv, createDecipheriv } from "crypto";
3
3
  import { EventEmitter } from "events";
4
- //#region ../types/dist/event-category-ZyX6jcse.mjs
4
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
5
5
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
6
6
  EventCategory["SystemBoot"] = "system.boot";
7
7
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -618,6 +618,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
618
618
  * pull-reconcile from the provider's `getStatus` on reconnect. */
619
619
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
620
620
  EventCategory["BackupCompleted"] = "backup.completed";
621
+ /**
622
+ * A whole backup RUN finished — every destination attempted, win or lose.
623
+ *
624
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
625
+ * a progress UI and the wrong one for a notification: an operator with three
626
+ * destinations would be told three times. And a run where two of three
627
+ * destinations succeeded is not a clean success — a single "backup
628
+ * completed" that hid the failed one would be a lie, so the count of each is
629
+ * carried here and the message says both.
630
+ *
631
+ * Emitted by the backup orchestrator only after the destination loop, so a
632
+ * run that dies during the BUILD phase produces no completion at all.
633
+ */
634
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
621
635
  EventCategory["BackupRestored"] = "backup.restored";
622
636
  EventCategory["NotificationDispatched"] = "notification.dispatched";
623
637
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5348,7 +5362,7 @@ var ZodIssueCode = {
5348
5362
  var ZodFirstPartyTypeKind;
5349
5363
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5350
5364
  //#endregion
5351
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5365
+ //#region ../types/dist/sleep-DEuj7E3j.mjs
5352
5366
  /**
5353
5367
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5354
5368
  * window to float samples (D455).
@@ -11492,6 +11506,72 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11492
11506
  auth: "admin"
11493
11507
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11494
11508
  DeviceType.Camera;
11509
+ /**
11510
+ * The signals a device can emit to WAKE its own stream.
11511
+ *
11512
+ * A camera whose stream is built on demand sleeps until something asks for it,
11513
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11514
+ * puller holds a session open for ever, and treating that as demand would keep
11515
+ * a battery camera awake for ever, which is the whole thing the battery is for
11516
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11517
+ * itself, with no stream running.
11518
+ *
11519
+ * ## The vocabulary is the PROVIDER'S, not ours
11520
+ *
11521
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11522
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11523
+ * Reolink offers motion and camera-native detection; another provider may offer
11524
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11525
+ * yet. A fixed enum here would mean every new signal is a framework release.
11526
+ *
11527
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11528
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11529
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11530
+ * binding — but both answer "what drives the detection pipeline", which is a
11531
+ * different question from "what may wake a sleeping stream". A camera can do
11532
+ * the first and not be trusted with the second, and the operator picks per
11533
+ * camera. Two questions, two authorities.
11534
+ *
11535
+ * ## Availability is not permission
11536
+ *
11537
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11538
+ * wakes the stream is the operator's per-camera choice, held by the broker
11539
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11540
+ * provider declaring a signal is not a provider enabling it.
11541
+ */
11542
+ /** One signal a device can emit. */
11543
+ var StreamSignalSchema = object({
11544
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11545
+ code: string().min(1),
11546
+ /** What an operator reads in the picker. The provider's own wording. */
11547
+ label: string().min(1),
11548
+ /**
11549
+ * Whether the provider recommends this signal ON when a camera is first set
11550
+ * up. A provider knows which of its signals are cheap and reliable; an
11551
+ * operator should not have to discover that by trial. Reolink recommends
11552
+ * both of its own.
11553
+ */
11554
+ recommended: boolean()
11555
+ });
11556
+ var StreamSignalsStatusSchema = object({
11557
+ signals: array(StreamSignalSchema),
11558
+ lastFetchedAt: number()
11559
+ });
11560
+ var streamSignalsCapability = {
11561
+ name: "stream-signals",
11562
+ scope: "device",
11563
+ deviceNative: true,
11564
+ mode: "singleton",
11565
+ deviceTypes: Object.values(DeviceType),
11566
+ runtimeState: StreamSignalsStatusSchema,
11567
+ methods: {
11568
+ /**
11569
+ * What this device can emit. Empty is a valid and common answer — most
11570
+ * cameras have nothing to offer here, and an empty list is what makes the
11571
+ * broker's picker show nothing rather than a false choice.
11572
+ */
11573
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11574
+ };
11495
11575
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11496
11576
  var StreamFormatSchema = _enum([
11497
11577
  "webrtc",
@@ -11888,6 +11968,22 @@ var EgressTranscodeSchema = object({
11888
11968
  camStreamId: string().nullable()
11889
11969
  });
11890
11970
  method(object({
11971
+ deviceId: number().int().nonnegative(),
11972
+ /** The provider's signal code. */
11973
+ code: string().min(1),
11974
+ /** Ms epoch. Absent ⇒ now. */
11975
+ at: number().optional()
11976
+ }), object({
11977
+ /** Whether the broker acted on it, and if not, why. */
11978
+ accepted: boolean(),
11979
+ reason: _enum([
11980
+ "woke",
11981
+ "hold-extended",
11982
+ "not-enabled",
11983
+ "no-consumer",
11984
+ "unknown-code"
11985
+ ])
11986
+ }), { kind: "mutation" }), method(object({
11891
11987
  deviceId: number().int().nonnegative(),
11892
11988
  camStreamId: string().min(1),
11893
11989
  kind: CamStreamKindSchema,
@@ -12142,6 +12238,16 @@ var PickStreamRequirementsSchema = object({
12142
12238
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12143
12239
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12144
12240
  minHeight: number().int().positive().optional(),
12241
+ /**
12242
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12243
+ *
12244
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12245
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12246
+ * Without this the ceiling had to be re-implemented by every caller — and
12247
+ * one caller implementing it privately is how a second scoring authority
12248
+ * gets born.
12249
+ */
12250
+ maxHeight: number().int().positive().optional(),
12145
12251
  /** Minimum horizontal resolution. */
12146
12252
  minWidth: number().int().positive().optional(),
12147
12253
  /**
@@ -12158,7 +12264,22 @@ var PickStreamRequirementsSchema = object({
12158
12264
  * transcoded" guard: if the device is already serving the consumer's
12159
12265
  * codec end-to-end, there's nothing to optimise.
12160
12266
  */
12161
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12267
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12268
+ /**
12269
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12270
+ * understanding that it will be transcoded.
12271
+ *
12272
+ * Default `false` — today's behaviour, and the right one for a bypass
12273
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12274
+ * ask the larger question: "what is the best stream for me, transcoding if
12275
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12276
+ * does not, so a passthrough is never lost to a transcode; the answer says
12277
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12278
+ *
12279
+ * This is what lets one picker serve both the bypass and the full source
12280
+ * choice, instead of a consumer scoring privately when the bypass misses.
12281
+ */
12282
+ allowTranscode: boolean().optional()
12162
12283
  }).readonly();
12163
12284
  var PickStreamPreferencesSchema = object({
12164
12285
  /**
@@ -12172,12 +12293,32 @@ var PickStreamPreferencesSchema = object({
12172
12293
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12173
12294
  * memory-constrained consumers / Apple Home guest sessions).
12174
12295
  */
12175
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12296
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12297
+ /**
12298
+ * The height the consumer actually wants to DELIVER.
12299
+ *
12300
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12301
+ * above the target wins, and only if nothing reaches it does the tallest
12302
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12303
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12304
+ * express that: it says "as big as possible", which is a different wish.
12305
+ *
12306
+ * Ignored when absent, so every existing caller keeps its ordering.
12307
+ */
12308
+ targetHeight: number().int().positive().optional()
12176
12309
  }).readonly();
12177
12310
  var PickedCamStreamSchema = object({
12178
12311
  camStreamId: string(),
12179
12312
  codec: string().optional(),
12180
12313
  resolution: CamStreamResolutionSchema.optional(),
12314
+ /**
12315
+ * Whether serving this stream requires a decode + re-encode.
12316
+ *
12317
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12318
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12319
+ * not ask cannot be handed a cost it never agreed to pay.
12320
+ */
12321
+ transcodes: boolean(),
12181
12322
  /** One-line explanation of why this stream won — for logs / debug UI. */
12182
12323
  reason: string()
12183
12324
  });
@@ -16694,6 +16835,8 @@ var NcSystemEventKindSchema = _enum([
16694
16835
  "device-enabled",
16695
16836
  "device-battery-low",
16696
16837
  "device-battery-normal",
16838
+ "device-consumable-low",
16839
+ "device-consumable-normal",
16697
16840
  "stream-online",
16698
16841
  "stream-offline",
16699
16842
  "node-online",
@@ -16712,6 +16855,7 @@ var NcSystemEventKindSchema = _enum([
16712
16855
  "addon-updated",
16713
16856
  "server-updated",
16714
16857
  "export-completed",
16858
+ "backup-completed",
16715
16859
  "camera-online",
16716
16860
  "camera-offline",
16717
16861
  "camera-disabled",
@@ -23993,10 +24137,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
23993
24137
  }), boolean()), method(object({
23994
24138
  deviceId: number().int().nonnegative(),
23995
24139
  sessionId: string()
23996
- }), object({ pendingRenegotiation: object({
23997
- target: WebrtcStreamTargetSchema,
23998
- epoch: number()
23999
- }).nullable() }));
24140
+ }), object({
24141
+ pendingRenegotiation: object({
24142
+ target: WebrtcStreamTargetSchema,
24143
+ epoch: number()
24144
+ }).nullable(),
24145
+ /**
24146
+ * Whether the session still EXISTS.
24147
+ *
24148
+ * A consumer that holds a resource for the life of a session needs to
24149
+ * be able to ask, because a session does not always end the way it
24150
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24151
+ * sent `SessionDisconnected`, so the Alexa exporter's
24152
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24153
+ * H.264 transcode kept running for NOBODY for more than twenty
24154
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24155
+ * minutes earlier — the broker knew; the holder had no way to ask.
24156
+ *
24157
+ * `false` for a session id the provider has never heard of, which is
24158
+ * the same answer as "it ended": either way nothing is holding it up.
24159
+ */
24160
+ alive: boolean()
24161
+ }));
24000
24162
  object({
24001
24163
  /** All accessory children of the parent. */
24002
24164
  childDeviceIds: array(number()).readonly(),
@@ -33915,6 +34077,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33915
34077
  smoke: smokeCapability,
33916
34078
  streamCatalog: streamCatalogCapability,
33917
34079
  streamParams: streamParamsCapability,
34080
+ streamSignals: streamSignalsCapability,
33918
34081
  switch: switchCapability,
33919
34082
  tamper: tamperCapability,
33920
34083
  temperatureSensor: temperatureSensorCapability,
@@ -40488,6 +40651,12 @@ Object.freeze({
40488
40651
  addonId: null,
40489
40652
  access: "create"
40490
40653
  },
40654
+ "streamBroker.reportStreamSignal": {
40655
+ capName: "stream-broker",
40656
+ capScope: "system",
40657
+ addonId: null,
40658
+ access: "create"
40659
+ },
40491
40660
  "streamBroker.restartProfile": {
40492
40661
  capName: "stream-broker",
40493
40662
  capScope: "system",
@@ -40572,6 +40741,12 @@ Object.freeze({
40572
40741
  addonId: null,
40573
40742
  access: "create"
40574
40743
  },
40744
+ "streamSignals.listSignals": {
40745
+ capName: "stream-signals",
40746
+ capScope: "device",
40747
+ addonId: null,
40748
+ access: "view"
40749
+ },
40575
40750
  "switch.setState": {
40576
40751
  capName: "switch",
40577
40752
  capScope: "device",
@@ -42944,6 +43119,11 @@ Object.freeze({
42944
43119
  form: "single",
42945
43120
  optional: false
42946
43121
  }],
43122
+ "streamBroker.reportStreamSignal": [{
43123
+ name: "deviceId",
43124
+ form: "single",
43125
+ optional: false
43126
+ }],
42947
43127
  "streamBroker.restartProfile": [{
42948
43128
  name: "deviceId",
42949
43129
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-gree",
3
- "version": "0.2.100",
3
+ "version": "0.2.101",
4
4
  "description": "Gree air-conditioner device-provider addon for CamStack — wraps the @apocaliss92/nodegree local-UDP client (LAN discovery + AES control), exposing climate-control and fan-control",
5
5
  "keywords": [
6
6
  "camstack",