@camstack/addon-provider-amcrest 0.2.103 → 0.2.104

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
@@ -6,7 +6,7 @@ let node_crypto = require("node:crypto");
6
6
  let node_http = require("node:http");
7
7
  let node_https = require("node:https");
8
8
  let node_os = require("node:os");
9
- //#region ../types/dist/event-category-ZyX6jcse.mjs
9
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
10
10
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
11
11
  EventCategory["SystemBoot"] = "system.boot";
12
12
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -623,6 +623,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
623
623
  * pull-reconcile from the provider's `getStatus` on reconnect. */
624
624
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
625
625
  EventCategory["BackupCompleted"] = "backup.completed";
626
+ /**
627
+ * A whole backup RUN finished — every destination attempted, win or lose.
628
+ *
629
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
630
+ * a progress UI and the wrong one for a notification: an operator with three
631
+ * destinations would be told three times. And a run where two of three
632
+ * destinations succeeded is not a clean success — a single "backup
633
+ * completed" that hid the failed one would be a lie, so the count of each is
634
+ * carried here and the message says both.
635
+ *
636
+ * Emitted by the backup orchestrator only after the destination loop, so a
637
+ * run that dies during the BUILD phase produces no completion at all.
638
+ */
639
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
626
640
  EventCategory["BackupRestored"] = "backup.restored";
627
641
  EventCategory["NotificationDispatched"] = "notification.dispatched";
628
642
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5353,7 +5367,7 @@ var ZodIssueCode = {
5353
5367
  var ZodFirstPartyTypeKind;
5354
5368
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5355
5369
  //#endregion
5356
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5370
+ //#region ../types/dist/sleep-DEuj7E3j.mjs
5357
5371
  /**
5358
5372
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5359
5373
  * window to float samples (D455).
@@ -11485,6 +11499,72 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11485
11499
  auth: "admin"
11486
11500
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11487
11501
  DeviceType.Camera;
11502
+ /**
11503
+ * The signals a device can emit to WAKE its own stream.
11504
+ *
11505
+ * A camera whose stream is built on demand sleeps until something asks for it,
11506
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11507
+ * puller holds a session open for ever, and treating that as demand would keep
11508
+ * a battery camera awake for ever, which is the whole thing the battery is for
11509
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11510
+ * itself, with no stream running.
11511
+ *
11512
+ * ## The vocabulary is the PROVIDER'S, not ours
11513
+ *
11514
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11515
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11516
+ * Reolink offers motion and camera-native detection; another provider may offer
11517
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11518
+ * yet. A fixed enum here would mean every new signal is a framework release.
11519
+ *
11520
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11521
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11522
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11523
+ * binding — but both answer "what drives the detection pipeline", which is a
11524
+ * different question from "what may wake a sleeping stream". A camera can do
11525
+ * the first and not be trusted with the second, and the operator picks per
11526
+ * camera. Two questions, two authorities.
11527
+ *
11528
+ * ## Availability is not permission
11529
+ *
11530
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11531
+ * wakes the stream is the operator's per-camera choice, held by the broker
11532
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11533
+ * provider declaring a signal is not a provider enabling it.
11534
+ */
11535
+ /** One signal a device can emit. */
11536
+ var StreamSignalSchema = object({
11537
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11538
+ code: string().min(1),
11539
+ /** What an operator reads in the picker. The provider's own wording. */
11540
+ label: string().min(1),
11541
+ /**
11542
+ * Whether the provider recommends this signal ON when a camera is first set
11543
+ * up. A provider knows which of its signals are cheap and reliable; an
11544
+ * operator should not have to discover that by trial. Reolink recommends
11545
+ * both of its own.
11546
+ */
11547
+ recommended: boolean()
11548
+ });
11549
+ var StreamSignalsStatusSchema = object({
11550
+ signals: array(StreamSignalSchema),
11551
+ lastFetchedAt: number()
11552
+ });
11553
+ var streamSignalsCapability = {
11554
+ name: "stream-signals",
11555
+ scope: "device",
11556
+ deviceNative: true,
11557
+ mode: "singleton",
11558
+ deviceTypes: Object.values(DeviceType),
11559
+ runtimeState: StreamSignalsStatusSchema,
11560
+ methods: {
11561
+ /**
11562
+ * What this device can emit. Empty is a valid and common answer — most
11563
+ * cameras have nothing to offer here, and an empty list is what makes the
11564
+ * broker's picker show nothing rather than a false choice.
11565
+ */
11566
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11567
+ };
11488
11568
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11489
11569
  var StreamFormatSchema = _enum([
11490
11570
  "webrtc",
@@ -11881,6 +11961,22 @@ var EgressTranscodeSchema = object({
11881
11961
  camStreamId: string().nullable()
11882
11962
  });
11883
11963
  method(object({
11964
+ deviceId: number().int().nonnegative(),
11965
+ /** The provider's signal code. */
11966
+ code: string().min(1),
11967
+ /** Ms epoch. Absent ⇒ now. */
11968
+ at: number().optional()
11969
+ }), object({
11970
+ /** Whether the broker acted on it, and if not, why. */
11971
+ accepted: boolean(),
11972
+ reason: _enum([
11973
+ "woke",
11974
+ "hold-extended",
11975
+ "not-enabled",
11976
+ "no-consumer",
11977
+ "unknown-code"
11978
+ ])
11979
+ }), { kind: "mutation" }), method(object({
11884
11980
  deviceId: number().int().nonnegative(),
11885
11981
  camStreamId: string().min(1),
11886
11982
  kind: CamStreamKindSchema,
@@ -12135,6 +12231,16 @@ var PickStreamRequirementsSchema = object({
12135
12231
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12136
12232
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12137
12233
  minHeight: number().int().positive().optional(),
12234
+ /**
12235
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12236
+ *
12237
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12238
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12239
+ * Without this the ceiling had to be re-implemented by every caller — and
12240
+ * one caller implementing it privately is how a second scoring authority
12241
+ * gets born.
12242
+ */
12243
+ maxHeight: number().int().positive().optional(),
12138
12244
  /** Minimum horizontal resolution. */
12139
12245
  minWidth: number().int().positive().optional(),
12140
12246
  /**
@@ -12151,7 +12257,22 @@ var PickStreamRequirementsSchema = object({
12151
12257
  * transcoded" guard: if the device is already serving the consumer's
12152
12258
  * codec end-to-end, there's nothing to optimise.
12153
12259
  */
12154
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12260
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12261
+ /**
12262
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12263
+ * understanding that it will be transcoded.
12264
+ *
12265
+ * Default `false` — today's behaviour, and the right one for a bypass
12266
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12267
+ * ask the larger question: "what is the best stream for me, transcoding if
12268
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12269
+ * does not, so a passthrough is never lost to a transcode; the answer says
12270
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12271
+ *
12272
+ * This is what lets one picker serve both the bypass and the full source
12273
+ * choice, instead of a consumer scoring privately when the bypass misses.
12274
+ */
12275
+ allowTranscode: boolean().optional()
12155
12276
  }).readonly();
12156
12277
  var PickStreamPreferencesSchema = object({
12157
12278
  /**
@@ -12165,12 +12286,32 @@ var PickStreamPreferencesSchema = object({
12165
12286
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12166
12287
  * memory-constrained consumers / Apple Home guest sessions).
12167
12288
  */
12168
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12289
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12290
+ /**
12291
+ * The height the consumer actually wants to DELIVER.
12292
+ *
12293
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12294
+ * above the target wins, and only if nothing reaches it does the tallest
12295
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12296
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12297
+ * express that: it says "as big as possible", which is a different wish.
12298
+ *
12299
+ * Ignored when absent, so every existing caller keeps its ordering.
12300
+ */
12301
+ targetHeight: number().int().positive().optional()
12169
12302
  }).readonly();
12170
12303
  var PickedCamStreamSchema = object({
12171
12304
  camStreamId: string(),
12172
12305
  codec: string().optional(),
12173
12306
  resolution: CamStreamResolutionSchema.optional(),
12307
+ /**
12308
+ * Whether serving this stream requires a decode + re-encode.
12309
+ *
12310
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12311
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12312
+ * not ask cannot be handed a cost it never agreed to pay.
12313
+ */
12314
+ transcodes: boolean(),
12174
12315
  /** One-line explanation of why this stream won — for logs / debug UI. */
12175
12316
  reason: string()
12176
12317
  });
@@ -16687,6 +16828,8 @@ var NcSystemEventKindSchema = _enum([
16687
16828
  "device-enabled",
16688
16829
  "device-battery-low",
16689
16830
  "device-battery-normal",
16831
+ "device-consumable-low",
16832
+ "device-consumable-normal",
16690
16833
  "stream-online",
16691
16834
  "stream-offline",
16692
16835
  "node-online",
@@ -16705,6 +16848,7 @@ var NcSystemEventKindSchema = _enum([
16705
16848
  "addon-updated",
16706
16849
  "server-updated",
16707
16850
  "export-completed",
16851
+ "backup-completed",
16708
16852
  "camera-online",
16709
16853
  "camera-offline",
16710
16854
  "camera-disabled",
@@ -24090,10 +24234,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24090
24234
  }), boolean()), method(object({
24091
24235
  deviceId: number().int().nonnegative(),
24092
24236
  sessionId: string()
24093
- }), object({ pendingRenegotiation: object({
24094
- target: WebrtcStreamTargetSchema,
24095
- epoch: number()
24096
- }).nullable() }));
24237
+ }), object({
24238
+ pendingRenegotiation: object({
24239
+ target: WebrtcStreamTargetSchema,
24240
+ epoch: number()
24241
+ }).nullable(),
24242
+ /**
24243
+ * Whether the session still EXISTS.
24244
+ *
24245
+ * A consumer that holds a resource for the life of a session needs to
24246
+ * be able to ask, because a session does not always end the way it
24247
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24248
+ * sent `SessionDisconnected`, so the Alexa exporter's
24249
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24250
+ * H.264 transcode kept running for NOBODY for more than twenty
24251
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24252
+ * minutes earlier — the broker knew; the holder had no way to ask.
24253
+ *
24254
+ * `false` for a session id the provider has never heard of, which is
24255
+ * the same answer as "it ended": either way nothing is holding it up.
24256
+ */
24257
+ alive: boolean()
24258
+ }));
24097
24259
  object({
24098
24260
  /** All accessory children of the parent. */
24099
24261
  childDeviceIds: array(number()).readonly(),
@@ -34343,6 +34505,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34343
34505
  smoke: smokeCapability,
34344
34506
  streamCatalog: streamCatalogCapability,
34345
34507
  streamParams: streamParamsCapability,
34508
+ streamSignals: streamSignalsCapability,
34346
34509
  switch: switchCapability,
34347
34510
  tamper: tamperCapability,
34348
34511
  temperatureSensor: temperatureSensorCapability,
@@ -41122,6 +41285,12 @@ Object.freeze({
41122
41285
  addonId: null,
41123
41286
  access: "create"
41124
41287
  },
41288
+ "streamBroker.reportStreamSignal": {
41289
+ capName: "stream-broker",
41290
+ capScope: "system",
41291
+ addonId: null,
41292
+ access: "create"
41293
+ },
41125
41294
  "streamBroker.restartProfile": {
41126
41295
  capName: "stream-broker",
41127
41296
  capScope: "system",
@@ -41206,6 +41375,12 @@ Object.freeze({
41206
41375
  addonId: null,
41207
41376
  access: "create"
41208
41377
  },
41378
+ "streamSignals.listSignals": {
41379
+ capName: "stream-signals",
41380
+ capScope: "device",
41381
+ addonId: null,
41382
+ access: "view"
41383
+ },
41209
41384
  "switch.setState": {
41210
41385
  capName: "switch",
41211
41386
  capScope: "device",
@@ -43578,6 +43753,11 @@ Object.freeze({
43578
43753
  form: "single",
43579
43754
  optional: false
43580
43755
  }],
43756
+ "streamBroker.reportStreamSignal": [{
43757
+ name: "deviceId",
43758
+ form: "single",
43759
+ optional: false
43760
+ }],
43581
43761
  "streamBroker.restartProfile": [{
43582
43762
  name: "deviceId",
43583
43763
  form: "single",
package/dist/addon.mjs CHANGED
@@ -7,7 +7,7 @@ import { networkInterfaces } from "node:os";
7
7
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
8
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
9
9
  //#endregion
10
- //#region ../types/dist/event-category-ZyX6jcse.mjs
10
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
11
11
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
12
12
  EventCategory["SystemBoot"] = "system.boot";
13
13
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -624,6 +624,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
624
624
  * pull-reconcile from the provider's `getStatus` on reconnect. */
625
625
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
626
626
  EventCategory["BackupCompleted"] = "backup.completed";
627
+ /**
628
+ * A whole backup RUN finished — every destination attempted, win or lose.
629
+ *
630
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
631
+ * a progress UI and the wrong one for a notification: an operator with three
632
+ * destinations would be told three times. And a run where two of three
633
+ * destinations succeeded is not a clean success — a single "backup
634
+ * completed" that hid the failed one would be a lie, so the count of each is
635
+ * carried here and the message says both.
636
+ *
637
+ * Emitted by the backup orchestrator only after the destination loop, so a
638
+ * run that dies during the BUILD phase produces no completion at all.
639
+ */
640
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
627
641
  EventCategory["BackupRestored"] = "backup.restored";
628
642
  EventCategory["NotificationDispatched"] = "notification.dispatched";
629
643
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5354,7 +5368,7 @@ var ZodIssueCode = {
5354
5368
  var ZodFirstPartyTypeKind;
5355
5369
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5356
5370
  //#endregion
5357
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5371
+ //#region ../types/dist/sleep-DEuj7E3j.mjs
5358
5372
  /**
5359
5373
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5360
5374
  * window to float samples (D455).
@@ -11486,6 +11500,72 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11486
11500
  auth: "admin"
11487
11501
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11488
11502
  DeviceType.Camera;
11503
+ /**
11504
+ * The signals a device can emit to WAKE its own stream.
11505
+ *
11506
+ * A camera whose stream is built on demand sleeps until something asks for it,
11507
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11508
+ * puller holds a session open for ever, and treating that as demand would keep
11509
+ * a battery camera awake for ever, which is the whole thing the battery is for
11510
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11511
+ * itself, with no stream running.
11512
+ *
11513
+ * ## The vocabulary is the PROVIDER'S, not ours
11514
+ *
11515
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11516
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11517
+ * Reolink offers motion and camera-native detection; another provider may offer
11518
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11519
+ * yet. A fixed enum here would mean every new signal is a framework release.
11520
+ *
11521
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11522
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11523
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11524
+ * binding — but both answer "what drives the detection pipeline", which is a
11525
+ * different question from "what may wake a sleeping stream". A camera can do
11526
+ * the first and not be trusted with the second, and the operator picks per
11527
+ * camera. Two questions, two authorities.
11528
+ *
11529
+ * ## Availability is not permission
11530
+ *
11531
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11532
+ * wakes the stream is the operator's per-camera choice, held by the broker
11533
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11534
+ * provider declaring a signal is not a provider enabling it.
11535
+ */
11536
+ /** One signal a device can emit. */
11537
+ var StreamSignalSchema = object({
11538
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11539
+ code: string().min(1),
11540
+ /** What an operator reads in the picker. The provider's own wording. */
11541
+ label: string().min(1),
11542
+ /**
11543
+ * Whether the provider recommends this signal ON when a camera is first set
11544
+ * up. A provider knows which of its signals are cheap and reliable; an
11545
+ * operator should not have to discover that by trial. Reolink recommends
11546
+ * both of its own.
11547
+ */
11548
+ recommended: boolean()
11549
+ });
11550
+ var StreamSignalsStatusSchema = object({
11551
+ signals: array(StreamSignalSchema),
11552
+ lastFetchedAt: number()
11553
+ });
11554
+ var streamSignalsCapability = {
11555
+ name: "stream-signals",
11556
+ scope: "device",
11557
+ deviceNative: true,
11558
+ mode: "singleton",
11559
+ deviceTypes: Object.values(DeviceType),
11560
+ runtimeState: StreamSignalsStatusSchema,
11561
+ methods: {
11562
+ /**
11563
+ * What this device can emit. Empty is a valid and common answer — most
11564
+ * cameras have nothing to offer here, and an empty list is what makes the
11565
+ * broker's picker show nothing rather than a false choice.
11566
+ */
11567
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11568
+ };
11489
11569
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11490
11570
  var StreamFormatSchema = _enum([
11491
11571
  "webrtc",
@@ -11882,6 +11962,22 @@ var EgressTranscodeSchema = object({
11882
11962
  camStreamId: string().nullable()
11883
11963
  });
11884
11964
  method(object({
11965
+ deviceId: number().int().nonnegative(),
11966
+ /** The provider's signal code. */
11967
+ code: string().min(1),
11968
+ /** Ms epoch. Absent ⇒ now. */
11969
+ at: number().optional()
11970
+ }), object({
11971
+ /** Whether the broker acted on it, and if not, why. */
11972
+ accepted: boolean(),
11973
+ reason: _enum([
11974
+ "woke",
11975
+ "hold-extended",
11976
+ "not-enabled",
11977
+ "no-consumer",
11978
+ "unknown-code"
11979
+ ])
11980
+ }), { kind: "mutation" }), method(object({
11885
11981
  deviceId: number().int().nonnegative(),
11886
11982
  camStreamId: string().min(1),
11887
11983
  kind: CamStreamKindSchema,
@@ -12136,6 +12232,16 @@ var PickStreamRequirementsSchema = object({
12136
12232
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12137
12233
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12138
12234
  minHeight: number().int().positive().optional(),
12235
+ /**
12236
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12237
+ *
12238
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12239
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12240
+ * Without this the ceiling had to be re-implemented by every caller — and
12241
+ * one caller implementing it privately is how a second scoring authority
12242
+ * gets born.
12243
+ */
12244
+ maxHeight: number().int().positive().optional(),
12139
12245
  /** Minimum horizontal resolution. */
12140
12246
  minWidth: number().int().positive().optional(),
12141
12247
  /**
@@ -12152,7 +12258,22 @@ var PickStreamRequirementsSchema = object({
12152
12258
  * transcoded" guard: if the device is already serving the consumer's
12153
12259
  * codec end-to-end, there's nothing to optimise.
12154
12260
  */
12155
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12261
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12262
+ /**
12263
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12264
+ * understanding that it will be transcoded.
12265
+ *
12266
+ * Default `false` — today's behaviour, and the right one for a bypass
12267
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12268
+ * ask the larger question: "what is the best stream for me, transcoding if
12269
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12270
+ * does not, so a passthrough is never lost to a transcode; the answer says
12271
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12272
+ *
12273
+ * This is what lets one picker serve both the bypass and the full source
12274
+ * choice, instead of a consumer scoring privately when the bypass misses.
12275
+ */
12276
+ allowTranscode: boolean().optional()
12156
12277
  }).readonly();
12157
12278
  var PickStreamPreferencesSchema = object({
12158
12279
  /**
@@ -12166,12 +12287,32 @@ var PickStreamPreferencesSchema = object({
12166
12287
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12167
12288
  * memory-constrained consumers / Apple Home guest sessions).
12168
12289
  */
12169
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12290
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12291
+ /**
12292
+ * The height the consumer actually wants to DELIVER.
12293
+ *
12294
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12295
+ * above the target wins, and only if nothing reaches it does the tallest
12296
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12297
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12298
+ * express that: it says "as big as possible", which is a different wish.
12299
+ *
12300
+ * Ignored when absent, so every existing caller keeps its ordering.
12301
+ */
12302
+ targetHeight: number().int().positive().optional()
12170
12303
  }).readonly();
12171
12304
  var PickedCamStreamSchema = object({
12172
12305
  camStreamId: string(),
12173
12306
  codec: string().optional(),
12174
12307
  resolution: CamStreamResolutionSchema.optional(),
12308
+ /**
12309
+ * Whether serving this stream requires a decode + re-encode.
12310
+ *
12311
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12312
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12313
+ * not ask cannot be handed a cost it never agreed to pay.
12314
+ */
12315
+ transcodes: boolean(),
12175
12316
  /** One-line explanation of why this stream won — for logs / debug UI. */
12176
12317
  reason: string()
12177
12318
  });
@@ -16688,6 +16829,8 @@ var NcSystemEventKindSchema = _enum([
16688
16829
  "device-enabled",
16689
16830
  "device-battery-low",
16690
16831
  "device-battery-normal",
16832
+ "device-consumable-low",
16833
+ "device-consumable-normal",
16691
16834
  "stream-online",
16692
16835
  "stream-offline",
16693
16836
  "node-online",
@@ -16706,6 +16849,7 @@ var NcSystemEventKindSchema = _enum([
16706
16849
  "addon-updated",
16707
16850
  "server-updated",
16708
16851
  "export-completed",
16852
+ "backup-completed",
16709
16853
  "camera-online",
16710
16854
  "camera-offline",
16711
16855
  "camera-disabled",
@@ -24091,10 +24235,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24091
24235
  }), boolean()), method(object({
24092
24236
  deviceId: number().int().nonnegative(),
24093
24237
  sessionId: string()
24094
- }), object({ pendingRenegotiation: object({
24095
- target: WebrtcStreamTargetSchema,
24096
- epoch: number()
24097
- }).nullable() }));
24238
+ }), object({
24239
+ pendingRenegotiation: object({
24240
+ target: WebrtcStreamTargetSchema,
24241
+ epoch: number()
24242
+ }).nullable(),
24243
+ /**
24244
+ * Whether the session still EXISTS.
24245
+ *
24246
+ * A consumer that holds a resource for the life of a session needs to
24247
+ * be able to ask, because a session does not always end the way it
24248
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24249
+ * sent `SessionDisconnected`, so the Alexa exporter's
24250
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24251
+ * H.264 transcode kept running for NOBODY for more than twenty
24252
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24253
+ * minutes earlier — the broker knew; the holder had no way to ask.
24254
+ *
24255
+ * `false` for a session id the provider has never heard of, which is
24256
+ * the same answer as "it ended": either way nothing is holding it up.
24257
+ */
24258
+ alive: boolean()
24259
+ }));
24098
24260
  object({
24099
24261
  /** All accessory children of the parent. */
24100
24262
  childDeviceIds: array(number()).readonly(),
@@ -34344,6 +34506,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34344
34506
  smoke: smokeCapability,
34345
34507
  streamCatalog: streamCatalogCapability,
34346
34508
  streamParams: streamParamsCapability,
34509
+ streamSignals: streamSignalsCapability,
34347
34510
  switch: switchCapability,
34348
34511
  tamper: tamperCapability,
34349
34512
  temperatureSensor: temperatureSensorCapability,
@@ -41123,6 +41286,12 @@ Object.freeze({
41123
41286
  addonId: null,
41124
41287
  access: "create"
41125
41288
  },
41289
+ "streamBroker.reportStreamSignal": {
41290
+ capName: "stream-broker",
41291
+ capScope: "system",
41292
+ addonId: null,
41293
+ access: "create"
41294
+ },
41126
41295
  "streamBroker.restartProfile": {
41127
41296
  capName: "stream-broker",
41128
41297
  capScope: "system",
@@ -41207,6 +41376,12 @@ Object.freeze({
41207
41376
  addonId: null,
41208
41377
  access: "create"
41209
41378
  },
41379
+ "streamSignals.listSignals": {
41380
+ capName: "stream-signals",
41381
+ capScope: "device",
41382
+ addonId: null,
41383
+ access: "view"
41384
+ },
41210
41385
  "switch.setState": {
41211
41386
  capName: "switch",
41212
41387
  capScope: "device",
@@ -43579,6 +43754,11 @@ Object.freeze({
43579
43754
  form: "single",
43580
43755
  optional: false
43581
43756
  }],
43757
+ "streamBroker.reportStreamSignal": [{
43758
+ name: "deviceId",
43759
+ form: "single",
43760
+ optional: false
43761
+ }],
43582
43762
  "streamBroker.restartProfile": [{
43583
43763
  name: "deviceId",
43584
43764
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-amcrest",
3
- "version": "0.2.103",
3
+ "version": "0.2.104",
4
4
  "description": "Amcrest/Dahua camera device provider addon for CamStack — Dahua CGI over HTTP(S) with digest auth (snapshot, RTSP catalog, PTZ, image/day-night config)",
5
5
  "keywords": [
6
6
  "camstack",