@camstack/addon-terminal 0.1.106 → 0.1.107
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 +188 -8
- package/dist/addon.mjs +188 -8
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -31,7 +31,7 @@ let node_module = require("node:module");
|
|
|
31
31
|
let sharp = require("sharp");
|
|
32
32
|
sharp = __toESM(sharp);
|
|
33
33
|
let node_http = require("node:http");
|
|
34
|
-
//#region ../types/dist/event-category-
|
|
34
|
+
//#region ../types/dist/event-category-BVDXG4tB.mjs
|
|
35
35
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
36
36
|
EventCategory["SystemBoot"] = "system.boot";
|
|
37
37
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -648,6 +648,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
648
648
|
* pull-reconcile from the provider's `getStatus` on reconnect. */
|
|
649
649
|
EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
|
|
650
650
|
EventCategory["BackupCompleted"] = "backup.completed";
|
|
651
|
+
/**
|
|
652
|
+
* A whole backup RUN finished — every destination attempted, win or lose.
|
|
653
|
+
*
|
|
654
|
+
* `backup.completed` fires once per DESTINATION, which is the right grain for
|
|
655
|
+
* a progress UI and the wrong one for a notification: an operator with three
|
|
656
|
+
* destinations would be told three times. And a run where two of three
|
|
657
|
+
* destinations succeeded is not a clean success — a single "backup
|
|
658
|
+
* completed" that hid the failed one would be a lie, so the count of each is
|
|
659
|
+
* carried here and the message says both.
|
|
660
|
+
*
|
|
661
|
+
* Emitted by the backup orchestrator only after the destination loop, so a
|
|
662
|
+
* run that dies during the BUILD phase produces no completion at all.
|
|
663
|
+
*/
|
|
664
|
+
EventCategory["BackupRunCompleted"] = "backup.run-completed";
|
|
651
665
|
EventCategory["BackupRestored"] = "backup.restored";
|
|
652
666
|
EventCategory["NotificationDispatched"] = "notification.dispatched";
|
|
653
667
|
EventCategory["NotificationFailed"] = "notification.failed";
|
|
@@ -5378,7 +5392,7 @@ var ZodIssueCode = {
|
|
|
5378
5392
|
var ZodFirstPartyTypeKind;
|
|
5379
5393
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5380
5394
|
//#endregion
|
|
5381
|
-
//#region ../types/dist/sleep-
|
|
5395
|
+
//#region ../types/dist/sleep-DEuj7E3j.mjs
|
|
5382
5396
|
/**
|
|
5383
5397
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5384
5398
|
* window to float samples (D455).
|
|
@@ -11589,6 +11603,72 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
|
|
|
11589
11603
|
auth: "admin"
|
|
11590
11604
|
}), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
|
|
11591
11605
|
DeviceType.Camera;
|
|
11606
|
+
/**
|
|
11607
|
+
* The signals a device can emit to WAKE its own stream.
|
|
11608
|
+
*
|
|
11609
|
+
* A camera whose stream is built on demand sleeps until something asks for it,
|
|
11610
|
+
* and "something" cannot be a consumer that is merely attached — a Frigate-style
|
|
11611
|
+
* puller holds a session open for ever, and treating that as demand would keep
|
|
11612
|
+
* a battery camera awake for ever, which is the whole thing the battery is for
|
|
11613
|
+
* (D173). So the wake has to come from the CAMERA: an event it noticed by
|
|
11614
|
+
* itself, with no stream running.
|
|
11615
|
+
*
|
|
11616
|
+
* ## The vocabulary is the PROVIDER'S, not ours
|
|
11617
|
+
*
|
|
11618
|
+
* Like `consumables`, this cap declares no vocabulary of its own. A provider
|
|
11619
|
+
* names each signal with a `code` it chooses and a `label` an operator reads.
|
|
11620
|
+
* Reolink offers motion and camera-native detection; another provider may offer
|
|
11621
|
+
* a tamper, a doorbell press, a PIR, or something no camera in this fleet has
|
|
11622
|
+
* yet. A fixed enum here would mean every new signal is a framework release.
|
|
11623
|
+
*
|
|
11624
|
+
* It is deliberately NOT derived from the caps a device already binds. Whether
|
|
11625
|
+
* a camera CAN push firmware motion is expressed by `motionSources` containing
|
|
11626
|
+
* `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
|
|
11627
|
+
* binding — but both answer "what drives the detection pipeline", which is a
|
|
11628
|
+
* different question from "what may wake a sleeping stream". A camera can do
|
|
11629
|
+
* the first and not be trusted with the second, and the operator picks per
|
|
11630
|
+
* camera. Two questions, two authorities.
|
|
11631
|
+
*
|
|
11632
|
+
* ## Availability is not permission
|
|
11633
|
+
*
|
|
11634
|
+
* `listSignals` says what the device CAN emit. Whether a given signal actually
|
|
11635
|
+
* wakes the stream is the operator's per-camera choice, held by the broker
|
|
11636
|
+
* alongside the cooldown — see the stream-broker cap's wake settings. A
|
|
11637
|
+
* provider declaring a signal is not a provider enabling it.
|
|
11638
|
+
*/
|
|
11639
|
+
/** One signal a device can emit. */
|
|
11640
|
+
var StreamSignalSchema = object({
|
|
11641
|
+
/** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
|
|
11642
|
+
code: string().min(1),
|
|
11643
|
+
/** What an operator reads in the picker. The provider's own wording. */
|
|
11644
|
+
label: string().min(1),
|
|
11645
|
+
/**
|
|
11646
|
+
* Whether the provider recommends this signal ON when a camera is first set
|
|
11647
|
+
* up. A provider knows which of its signals are cheap and reliable; an
|
|
11648
|
+
* operator should not have to discover that by trial. Reolink recommends
|
|
11649
|
+
* both of its own.
|
|
11650
|
+
*/
|
|
11651
|
+
recommended: boolean()
|
|
11652
|
+
});
|
|
11653
|
+
var StreamSignalsStatusSchema = object({
|
|
11654
|
+
signals: array(StreamSignalSchema),
|
|
11655
|
+
lastFetchedAt: number()
|
|
11656
|
+
});
|
|
11657
|
+
var streamSignalsCapability = {
|
|
11658
|
+
name: "stream-signals",
|
|
11659
|
+
scope: "device",
|
|
11660
|
+
deviceNative: true,
|
|
11661
|
+
mode: "singleton",
|
|
11662
|
+
deviceTypes: Object.values(DeviceType),
|
|
11663
|
+
runtimeState: StreamSignalsStatusSchema,
|
|
11664
|
+
methods: {
|
|
11665
|
+
/**
|
|
11666
|
+
* What this device can emit. Empty is a valid and common answer — most
|
|
11667
|
+
* cameras have nothing to offer here, and an empty list is what makes the
|
|
11668
|
+
* broker's picker show nothing rather than a false choice.
|
|
11669
|
+
*/
|
|
11670
|
+
listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
|
|
11671
|
+
};
|
|
11592
11672
|
/** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
|
|
11593
11673
|
var StreamFormatSchema = _enum([
|
|
11594
11674
|
"webrtc",
|
|
@@ -11985,6 +12065,22 @@ var EgressTranscodeSchema = object({
|
|
|
11985
12065
|
camStreamId: string().nullable()
|
|
11986
12066
|
});
|
|
11987
12067
|
method(object({
|
|
12068
|
+
deviceId: number().int().nonnegative(),
|
|
12069
|
+
/** The provider's signal code. */
|
|
12070
|
+
code: string().min(1),
|
|
12071
|
+
/** Ms epoch. Absent ⇒ now. */
|
|
12072
|
+
at: number().optional()
|
|
12073
|
+
}), object({
|
|
12074
|
+
/** Whether the broker acted on it, and if not, why. */
|
|
12075
|
+
accepted: boolean(),
|
|
12076
|
+
reason: _enum([
|
|
12077
|
+
"woke",
|
|
12078
|
+
"hold-extended",
|
|
12079
|
+
"not-enabled",
|
|
12080
|
+
"no-consumer",
|
|
12081
|
+
"unknown-code"
|
|
12082
|
+
])
|
|
12083
|
+
}), { kind: "mutation" }), method(object({
|
|
11988
12084
|
deviceId: number().int().nonnegative(),
|
|
11989
12085
|
camStreamId: string().min(1),
|
|
11990
12086
|
kind: CamStreamKindSchema,
|
|
@@ -12239,6 +12335,16 @@ var PickStreamRequirementsSchema = object({
|
|
|
12239
12335
|
acceptCodecs: array(StreamCodecSchema).readonly().optional(),
|
|
12240
12336
|
/** Minimum vertical resolution. Streams shorter than this are dropped. */
|
|
12241
12337
|
minHeight: number().int().positive().optional(),
|
|
12338
|
+
/**
|
|
12339
|
+
* Maximum vertical resolution. Streams TALLER than this are dropped.
|
|
12340
|
+
*
|
|
12341
|
+
* A consumer can have a ceiling as real as its floor: Alexa documents
|
|
12342
|
+
* 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
|
|
12343
|
+
* Without this the ceiling had to be re-implemented by every caller — and
|
|
12344
|
+
* one caller implementing it privately is how a second scoring authority
|
|
12345
|
+
* gets born.
|
|
12346
|
+
*/
|
|
12347
|
+
maxHeight: number().int().positive().optional(),
|
|
12242
12348
|
/** Minimum horizontal resolution. */
|
|
12243
12349
|
minWidth: number().int().positive().optional(),
|
|
12244
12350
|
/**
|
|
@@ -12255,7 +12361,22 @@ var PickStreamRequirementsSchema = object({
|
|
|
12255
12361
|
* transcoded" guard: if the device is already serving the consumer's
|
|
12256
12362
|
* codec end-to-end, there's nothing to optimise.
|
|
12257
12363
|
*/
|
|
12258
|
-
requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
|
|
12364
|
+
requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
|
|
12365
|
+
/**
|
|
12366
|
+
* Whether a stream the consumer CANNOT decode may still be picked, on the
|
|
12367
|
+
* understanding that it will be transcoded.
|
|
12368
|
+
*
|
|
12369
|
+
* Default `false` — today's behaviour, and the right one for a bypass
|
|
12370
|
+
* question ("is there a stream I can forward untouched?"). Set `true` to
|
|
12371
|
+
* ask the larger question: "what is the best stream for me, transcoding if
|
|
12372
|
+
* I must?" A stream that satisfies `acceptCodecs` always outranks one that
|
|
12373
|
+
* does not, so a passthrough is never lost to a transcode; the answer says
|
|
12374
|
+
* which it is in {@link PickedCamStreamSchema.transcodes}.
|
|
12375
|
+
*
|
|
12376
|
+
* This is what lets one picker serve both the bypass and the full source
|
|
12377
|
+
* choice, instead of a consumer scoring privately when the bypass misses.
|
|
12378
|
+
*/
|
|
12379
|
+
allowTranscode: boolean().optional()
|
|
12259
12380
|
}).readonly();
|
|
12260
12381
|
var PickStreamPreferencesSchema = object({
|
|
12261
12382
|
/**
|
|
@@ -12269,12 +12390,32 @@ var PickStreamPreferencesSchema = object({
|
|
|
12269
12390
|
* picks the tallest stream; `'lowest'` picks the shortest (used by
|
|
12270
12391
|
* memory-constrained consumers / Apple Home guest sessions).
|
|
12271
12392
|
*/
|
|
12272
|
-
resolutionPreference: _enum(["highest", "lowest"]).optional()
|
|
12393
|
+
resolutionPreference: _enum(["highest", "lowest"]).optional(),
|
|
12394
|
+
/**
|
|
12395
|
+
* The height the consumer actually wants to DELIVER.
|
|
12396
|
+
*
|
|
12397
|
+
* Not a constraint — an ordering. With it set, the SMALLEST stream at or
|
|
12398
|
+
* above the target wins, and only if nothing reaches it does the tallest
|
|
12399
|
+
* take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
|
|
12400
|
+
* a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
|
|
12401
|
+
* express that: it says "as big as possible", which is a different wish.
|
|
12402
|
+
*
|
|
12403
|
+
* Ignored when absent, so every existing caller keeps its ordering.
|
|
12404
|
+
*/
|
|
12405
|
+
targetHeight: number().int().positive().optional()
|
|
12273
12406
|
}).readonly();
|
|
12274
12407
|
var PickedCamStreamSchema = object({
|
|
12275
12408
|
camStreamId: string(),
|
|
12276
12409
|
codec: string().optional(),
|
|
12277
12410
|
resolution: CamStreamResolutionSchema.optional(),
|
|
12411
|
+
/**
|
|
12412
|
+
* Whether serving this stream requires a decode + re-encode.
|
|
12413
|
+
*
|
|
12414
|
+
* `false` is a stream the consumer can take as it stands. Only ever `true`
|
|
12415
|
+
* when the caller asked for it with `allowTranscode`, so a caller that did
|
|
12416
|
+
* not ask cannot be handed a cost it never agreed to pay.
|
|
12417
|
+
*/
|
|
12418
|
+
transcodes: boolean(),
|
|
12278
12419
|
/** One-line explanation of why this stream won — for logs / debug UI. */
|
|
12279
12420
|
reason: string()
|
|
12280
12421
|
});
|
|
@@ -16710,6 +16851,8 @@ var NcSystemEventKindSchema = _enum([
|
|
|
16710
16851
|
"device-enabled",
|
|
16711
16852
|
"device-battery-low",
|
|
16712
16853
|
"device-battery-normal",
|
|
16854
|
+
"device-consumable-low",
|
|
16855
|
+
"device-consumable-normal",
|
|
16713
16856
|
"stream-online",
|
|
16714
16857
|
"stream-offline",
|
|
16715
16858
|
"node-online",
|
|
@@ -16728,6 +16871,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
16728
16871
|
"addon-updated",
|
|
16729
16872
|
"server-updated",
|
|
16730
16873
|
"export-completed",
|
|
16874
|
+
"backup-completed",
|
|
16731
16875
|
"camera-online",
|
|
16732
16876
|
"camera-offline",
|
|
16733
16877
|
"camera-disabled",
|
|
@@ -24157,10 +24301,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
|
|
|
24157
24301
|
}), boolean()), method(object({
|
|
24158
24302
|
deviceId: number().int().nonnegative(),
|
|
24159
24303
|
sessionId: string()
|
|
24160
|
-
}), object({
|
|
24161
|
-
|
|
24162
|
-
|
|
24163
|
-
|
|
24304
|
+
}), object({
|
|
24305
|
+
pendingRenegotiation: object({
|
|
24306
|
+
target: WebrtcStreamTargetSchema,
|
|
24307
|
+
epoch: number()
|
|
24308
|
+
}).nullable(),
|
|
24309
|
+
/**
|
|
24310
|
+
* Whether the session still EXISTS.
|
|
24311
|
+
*
|
|
24312
|
+
* A consumer that holds a resource for the life of a session needs to
|
|
24313
|
+
* be able to ask, because a session does not always end the way it
|
|
24314
|
+
* began. Measured on this hub 2026-09-13: an Echo that got stuck never
|
|
24315
|
+
* sent `SessionDisconnected`, so the Alexa exporter's
|
|
24316
|
+
* `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
|
|
24317
|
+
* H.264 transcode kept running for NOBODY for more than twenty
|
|
24318
|
+
* minutes. The WebRTC session had logged `WebRTC session closed`
|
|
24319
|
+
* minutes earlier — the broker knew; the holder had no way to ask.
|
|
24320
|
+
*
|
|
24321
|
+
* `false` for a session id the provider has never heard of, which is
|
|
24322
|
+
* the same answer as "it ended": either way nothing is holding it up.
|
|
24323
|
+
*/
|
|
24324
|
+
alive: boolean()
|
|
24325
|
+
}));
|
|
24164
24326
|
object({
|
|
24165
24327
|
/** All accessory children of the parent. */
|
|
24166
24328
|
childDeviceIds: array(number()).readonly(),
|
|
@@ -34079,6 +34241,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
34079
34241
|
smoke: smokeCapability,
|
|
34080
34242
|
streamCatalog: streamCatalogCapability,
|
|
34081
34243
|
streamParams: streamParamsCapability,
|
|
34244
|
+
streamSignals: streamSignalsCapability,
|
|
34082
34245
|
switch: switchCapability,
|
|
34083
34246
|
tamper: tamperCapability,
|
|
34084
34247
|
temperatureSensor: temperatureSensorCapability,
|
|
@@ -40234,6 +40397,12 @@ Object.freeze({
|
|
|
40234
40397
|
addonId: null,
|
|
40235
40398
|
access: "create"
|
|
40236
40399
|
},
|
|
40400
|
+
"streamBroker.reportStreamSignal": {
|
|
40401
|
+
capName: "stream-broker",
|
|
40402
|
+
capScope: "system",
|
|
40403
|
+
addonId: null,
|
|
40404
|
+
access: "create"
|
|
40405
|
+
},
|
|
40237
40406
|
"streamBroker.restartProfile": {
|
|
40238
40407
|
capName: "stream-broker",
|
|
40239
40408
|
capScope: "system",
|
|
@@ -40318,6 +40487,12 @@ Object.freeze({
|
|
|
40318
40487
|
addonId: null,
|
|
40319
40488
|
access: "create"
|
|
40320
40489
|
},
|
|
40490
|
+
"streamSignals.listSignals": {
|
|
40491
|
+
capName: "stream-signals",
|
|
40492
|
+
capScope: "device",
|
|
40493
|
+
addonId: null,
|
|
40494
|
+
access: "view"
|
|
40495
|
+
},
|
|
40321
40496
|
"switch.setState": {
|
|
40322
40497
|
capName: "switch",
|
|
40323
40498
|
capScope: "device",
|
|
@@ -42690,6 +42865,11 @@ Object.freeze({
|
|
|
42690
42865
|
form: "single",
|
|
42691
42866
|
optional: false
|
|
42692
42867
|
}],
|
|
42868
|
+
"streamBroker.reportStreamSignal": [{
|
|
42869
|
+
name: "deviceId",
|
|
42870
|
+
form: "single",
|
|
42871
|
+
optional: false
|
|
42872
|
+
}],
|
|
42693
42873
|
"streamBroker.restartProfile": [{
|
|
42694
42874
|
name: "deviceId",
|
|
42695
42875
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { createServer } from "node:http";
|
|
|
8
8
|
//#region \0rolldown/runtime.js
|
|
9
9
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
10
|
//#endregion
|
|
11
|
-
//#region ../types/dist/event-category-
|
|
11
|
+
//#region ../types/dist/event-category-BVDXG4tB.mjs
|
|
12
12
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
13
13
|
EventCategory["SystemBoot"] = "system.boot";
|
|
14
14
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -625,6 +625,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
625
625
|
* pull-reconcile from the provider's `getStatus` on reconnect. */
|
|
626
626
|
EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
|
|
627
627
|
EventCategory["BackupCompleted"] = "backup.completed";
|
|
628
|
+
/**
|
|
629
|
+
* A whole backup RUN finished — every destination attempted, win or lose.
|
|
630
|
+
*
|
|
631
|
+
* `backup.completed` fires once per DESTINATION, which is the right grain for
|
|
632
|
+
* a progress UI and the wrong one for a notification: an operator with three
|
|
633
|
+
* destinations would be told three times. And a run where two of three
|
|
634
|
+
* destinations succeeded is not a clean success — a single "backup
|
|
635
|
+
* completed" that hid the failed one would be a lie, so the count of each is
|
|
636
|
+
* carried here and the message says both.
|
|
637
|
+
*
|
|
638
|
+
* Emitted by the backup orchestrator only after the destination loop, so a
|
|
639
|
+
* run that dies during the BUILD phase produces no completion at all.
|
|
640
|
+
*/
|
|
641
|
+
EventCategory["BackupRunCompleted"] = "backup.run-completed";
|
|
628
642
|
EventCategory["BackupRestored"] = "backup.restored";
|
|
629
643
|
EventCategory["NotificationDispatched"] = "notification.dispatched";
|
|
630
644
|
EventCategory["NotificationFailed"] = "notification.failed";
|
|
@@ -5355,7 +5369,7 @@ var ZodIssueCode = {
|
|
|
5355
5369
|
var ZodFirstPartyTypeKind;
|
|
5356
5370
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5357
5371
|
//#endregion
|
|
5358
|
-
//#region ../types/dist/sleep-
|
|
5372
|
+
//#region ../types/dist/sleep-DEuj7E3j.mjs
|
|
5359
5373
|
/**
|
|
5360
5374
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5361
5375
|
* window to float samples (D455).
|
|
@@ -11566,6 +11580,72 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
|
|
|
11566
11580
|
auth: "admin"
|
|
11567
11581
|
}), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
|
|
11568
11582
|
DeviceType.Camera;
|
|
11583
|
+
/**
|
|
11584
|
+
* The signals a device can emit to WAKE its own stream.
|
|
11585
|
+
*
|
|
11586
|
+
* A camera whose stream is built on demand sleeps until something asks for it,
|
|
11587
|
+
* and "something" cannot be a consumer that is merely attached — a Frigate-style
|
|
11588
|
+
* puller holds a session open for ever, and treating that as demand would keep
|
|
11589
|
+
* a battery camera awake for ever, which is the whole thing the battery is for
|
|
11590
|
+
* (D173). So the wake has to come from the CAMERA: an event it noticed by
|
|
11591
|
+
* itself, with no stream running.
|
|
11592
|
+
*
|
|
11593
|
+
* ## The vocabulary is the PROVIDER'S, not ours
|
|
11594
|
+
*
|
|
11595
|
+
* Like `consumables`, this cap declares no vocabulary of its own. A provider
|
|
11596
|
+
* names each signal with a `code` it chooses and a `label` an operator reads.
|
|
11597
|
+
* Reolink offers motion and camera-native detection; another provider may offer
|
|
11598
|
+
* a tamper, a doorbell press, a PIR, or something no camera in this fleet has
|
|
11599
|
+
* yet. A fixed enum here would mean every new signal is a framework release.
|
|
11600
|
+
*
|
|
11601
|
+
* It is deliberately NOT derived from the caps a device already binds. Whether
|
|
11602
|
+
* a camera CAN push firmware motion is expressed by `motionSources` containing
|
|
11603
|
+
* `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
|
|
11604
|
+
* binding — but both answer "what drives the detection pipeline", which is a
|
|
11605
|
+
* different question from "what may wake a sleeping stream". A camera can do
|
|
11606
|
+
* the first and not be trusted with the second, and the operator picks per
|
|
11607
|
+
* camera. Two questions, two authorities.
|
|
11608
|
+
*
|
|
11609
|
+
* ## Availability is not permission
|
|
11610
|
+
*
|
|
11611
|
+
* `listSignals` says what the device CAN emit. Whether a given signal actually
|
|
11612
|
+
* wakes the stream is the operator's per-camera choice, held by the broker
|
|
11613
|
+
* alongside the cooldown — see the stream-broker cap's wake settings. A
|
|
11614
|
+
* provider declaring a signal is not a provider enabling it.
|
|
11615
|
+
*/
|
|
11616
|
+
/** One signal a device can emit. */
|
|
11617
|
+
var StreamSignalSchema = object({
|
|
11618
|
+
/** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
|
|
11619
|
+
code: string().min(1),
|
|
11620
|
+
/** What an operator reads in the picker. The provider's own wording. */
|
|
11621
|
+
label: string().min(1),
|
|
11622
|
+
/**
|
|
11623
|
+
* Whether the provider recommends this signal ON when a camera is first set
|
|
11624
|
+
* up. A provider knows which of its signals are cheap and reliable; an
|
|
11625
|
+
* operator should not have to discover that by trial. Reolink recommends
|
|
11626
|
+
* both of its own.
|
|
11627
|
+
*/
|
|
11628
|
+
recommended: boolean()
|
|
11629
|
+
});
|
|
11630
|
+
var StreamSignalsStatusSchema = object({
|
|
11631
|
+
signals: array(StreamSignalSchema),
|
|
11632
|
+
lastFetchedAt: number()
|
|
11633
|
+
});
|
|
11634
|
+
var streamSignalsCapability = {
|
|
11635
|
+
name: "stream-signals",
|
|
11636
|
+
scope: "device",
|
|
11637
|
+
deviceNative: true,
|
|
11638
|
+
mode: "singleton",
|
|
11639
|
+
deviceTypes: Object.values(DeviceType),
|
|
11640
|
+
runtimeState: StreamSignalsStatusSchema,
|
|
11641
|
+
methods: {
|
|
11642
|
+
/**
|
|
11643
|
+
* What this device can emit. Empty is a valid and common answer — most
|
|
11644
|
+
* cameras have nothing to offer here, and an empty list is what makes the
|
|
11645
|
+
* broker's picker show nothing rather than a false choice.
|
|
11646
|
+
*/
|
|
11647
|
+
listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
|
|
11648
|
+
};
|
|
11569
11649
|
/** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
|
|
11570
11650
|
var StreamFormatSchema = _enum([
|
|
11571
11651
|
"webrtc",
|
|
@@ -11962,6 +12042,22 @@ var EgressTranscodeSchema = object({
|
|
|
11962
12042
|
camStreamId: string().nullable()
|
|
11963
12043
|
});
|
|
11964
12044
|
method(object({
|
|
12045
|
+
deviceId: number().int().nonnegative(),
|
|
12046
|
+
/** The provider's signal code. */
|
|
12047
|
+
code: string().min(1),
|
|
12048
|
+
/** Ms epoch. Absent ⇒ now. */
|
|
12049
|
+
at: number().optional()
|
|
12050
|
+
}), object({
|
|
12051
|
+
/** Whether the broker acted on it, and if not, why. */
|
|
12052
|
+
accepted: boolean(),
|
|
12053
|
+
reason: _enum([
|
|
12054
|
+
"woke",
|
|
12055
|
+
"hold-extended",
|
|
12056
|
+
"not-enabled",
|
|
12057
|
+
"no-consumer",
|
|
12058
|
+
"unknown-code"
|
|
12059
|
+
])
|
|
12060
|
+
}), { kind: "mutation" }), method(object({
|
|
11965
12061
|
deviceId: number().int().nonnegative(),
|
|
11966
12062
|
camStreamId: string().min(1),
|
|
11967
12063
|
kind: CamStreamKindSchema,
|
|
@@ -12216,6 +12312,16 @@ var PickStreamRequirementsSchema = object({
|
|
|
12216
12312
|
acceptCodecs: array(StreamCodecSchema).readonly().optional(),
|
|
12217
12313
|
/** Minimum vertical resolution. Streams shorter than this are dropped. */
|
|
12218
12314
|
minHeight: number().int().positive().optional(),
|
|
12315
|
+
/**
|
|
12316
|
+
* Maximum vertical resolution. Streams TALLER than this are dropped.
|
|
12317
|
+
*
|
|
12318
|
+
* A consumer can have a ceiling as real as its floor: Alexa documents
|
|
12319
|
+
* 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
|
|
12320
|
+
* Without this the ceiling had to be re-implemented by every caller — and
|
|
12321
|
+
* one caller implementing it privately is how a second scoring authority
|
|
12322
|
+
* gets born.
|
|
12323
|
+
*/
|
|
12324
|
+
maxHeight: number().int().positive().optional(),
|
|
12219
12325
|
/** Minimum horizontal resolution. */
|
|
12220
12326
|
minWidth: number().int().positive().optional(),
|
|
12221
12327
|
/**
|
|
@@ -12232,7 +12338,22 @@ var PickStreamRequirementsSchema = object({
|
|
|
12232
12338
|
* transcoded" guard: if the device is already serving the consumer's
|
|
12233
12339
|
* codec end-to-end, there's nothing to optimise.
|
|
12234
12340
|
*/
|
|
12235
|
-
requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
|
|
12341
|
+
requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
|
|
12342
|
+
/**
|
|
12343
|
+
* Whether a stream the consumer CANNOT decode may still be picked, on the
|
|
12344
|
+
* understanding that it will be transcoded.
|
|
12345
|
+
*
|
|
12346
|
+
* Default `false` — today's behaviour, and the right one for a bypass
|
|
12347
|
+
* question ("is there a stream I can forward untouched?"). Set `true` to
|
|
12348
|
+
* ask the larger question: "what is the best stream for me, transcoding if
|
|
12349
|
+
* I must?" A stream that satisfies `acceptCodecs` always outranks one that
|
|
12350
|
+
* does not, so a passthrough is never lost to a transcode; the answer says
|
|
12351
|
+
* which it is in {@link PickedCamStreamSchema.transcodes}.
|
|
12352
|
+
*
|
|
12353
|
+
* This is what lets one picker serve both the bypass and the full source
|
|
12354
|
+
* choice, instead of a consumer scoring privately when the bypass misses.
|
|
12355
|
+
*/
|
|
12356
|
+
allowTranscode: boolean().optional()
|
|
12236
12357
|
}).readonly();
|
|
12237
12358
|
var PickStreamPreferencesSchema = object({
|
|
12238
12359
|
/**
|
|
@@ -12246,12 +12367,32 @@ var PickStreamPreferencesSchema = object({
|
|
|
12246
12367
|
* picks the tallest stream; `'lowest'` picks the shortest (used by
|
|
12247
12368
|
* memory-constrained consumers / Apple Home guest sessions).
|
|
12248
12369
|
*/
|
|
12249
|
-
resolutionPreference: _enum(["highest", "lowest"]).optional()
|
|
12370
|
+
resolutionPreference: _enum(["highest", "lowest"]).optional(),
|
|
12371
|
+
/**
|
|
12372
|
+
* The height the consumer actually wants to DELIVER.
|
|
12373
|
+
*
|
|
12374
|
+
* Not a constraint — an ordering. With it set, the SMALLEST stream at or
|
|
12375
|
+
* above the target wins, and only if nothing reaches it does the tallest
|
|
12376
|
+
* take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
|
|
12377
|
+
* a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
|
|
12378
|
+
* express that: it says "as big as possible", which is a different wish.
|
|
12379
|
+
*
|
|
12380
|
+
* Ignored when absent, so every existing caller keeps its ordering.
|
|
12381
|
+
*/
|
|
12382
|
+
targetHeight: number().int().positive().optional()
|
|
12250
12383
|
}).readonly();
|
|
12251
12384
|
var PickedCamStreamSchema = object({
|
|
12252
12385
|
camStreamId: string(),
|
|
12253
12386
|
codec: string().optional(),
|
|
12254
12387
|
resolution: CamStreamResolutionSchema.optional(),
|
|
12388
|
+
/**
|
|
12389
|
+
* Whether serving this stream requires a decode + re-encode.
|
|
12390
|
+
*
|
|
12391
|
+
* `false` is a stream the consumer can take as it stands. Only ever `true`
|
|
12392
|
+
* when the caller asked for it with `allowTranscode`, so a caller that did
|
|
12393
|
+
* not ask cannot be handed a cost it never agreed to pay.
|
|
12394
|
+
*/
|
|
12395
|
+
transcodes: boolean(),
|
|
12255
12396
|
/** One-line explanation of why this stream won — for logs / debug UI. */
|
|
12256
12397
|
reason: string()
|
|
12257
12398
|
});
|
|
@@ -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",
|
|
@@ -24134,10 +24278,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
|
|
|
24134
24278
|
}), boolean()), method(object({
|
|
24135
24279
|
deviceId: number().int().nonnegative(),
|
|
24136
24280
|
sessionId: string()
|
|
24137
|
-
}), object({
|
|
24138
|
-
|
|
24139
|
-
|
|
24140
|
-
|
|
24281
|
+
}), object({
|
|
24282
|
+
pendingRenegotiation: object({
|
|
24283
|
+
target: WebrtcStreamTargetSchema,
|
|
24284
|
+
epoch: number()
|
|
24285
|
+
}).nullable(),
|
|
24286
|
+
/**
|
|
24287
|
+
* Whether the session still EXISTS.
|
|
24288
|
+
*
|
|
24289
|
+
* A consumer that holds a resource for the life of a session needs to
|
|
24290
|
+
* be able to ask, because a session does not always end the way it
|
|
24291
|
+
* began. Measured on this hub 2026-09-13: an Echo that got stuck never
|
|
24292
|
+
* sent `SessionDisconnected`, so the Alexa exporter's
|
|
24293
|
+
* `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
|
|
24294
|
+
* H.264 transcode kept running for NOBODY for more than twenty
|
|
24295
|
+
* minutes. The WebRTC session had logged `WebRTC session closed`
|
|
24296
|
+
* minutes earlier — the broker knew; the holder had no way to ask.
|
|
24297
|
+
*
|
|
24298
|
+
* `false` for a session id the provider has never heard of, which is
|
|
24299
|
+
* the same answer as "it ended": either way nothing is holding it up.
|
|
24300
|
+
*/
|
|
24301
|
+
alive: boolean()
|
|
24302
|
+
}));
|
|
24141
24303
|
object({
|
|
24142
24304
|
/** All accessory children of the parent. */
|
|
24143
24305
|
childDeviceIds: array(number()).readonly(),
|
|
@@ -34056,6 +34218,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
34056
34218
|
smoke: smokeCapability,
|
|
34057
34219
|
streamCatalog: streamCatalogCapability,
|
|
34058
34220
|
streamParams: streamParamsCapability,
|
|
34221
|
+
streamSignals: streamSignalsCapability,
|
|
34059
34222
|
switch: switchCapability,
|
|
34060
34223
|
tamper: tamperCapability,
|
|
34061
34224
|
temperatureSensor: temperatureSensorCapability,
|
|
@@ -40211,6 +40374,12 @@ Object.freeze({
|
|
|
40211
40374
|
addonId: null,
|
|
40212
40375
|
access: "create"
|
|
40213
40376
|
},
|
|
40377
|
+
"streamBroker.reportStreamSignal": {
|
|
40378
|
+
capName: "stream-broker",
|
|
40379
|
+
capScope: "system",
|
|
40380
|
+
addonId: null,
|
|
40381
|
+
access: "create"
|
|
40382
|
+
},
|
|
40214
40383
|
"streamBroker.restartProfile": {
|
|
40215
40384
|
capName: "stream-broker",
|
|
40216
40385
|
capScope: "system",
|
|
@@ -40295,6 +40464,12 @@ Object.freeze({
|
|
|
40295
40464
|
addonId: null,
|
|
40296
40465
|
access: "create"
|
|
40297
40466
|
},
|
|
40467
|
+
"streamSignals.listSignals": {
|
|
40468
|
+
capName: "stream-signals",
|
|
40469
|
+
capScope: "device",
|
|
40470
|
+
addonId: null,
|
|
40471
|
+
access: "view"
|
|
40472
|
+
},
|
|
40298
40473
|
"switch.setState": {
|
|
40299
40474
|
capName: "switch",
|
|
40300
40475
|
capScope: "device",
|
|
@@ -42667,6 +42842,11 @@ Object.freeze({
|
|
|
42667
42842
|
form: "single",
|
|
42668
42843
|
optional: false
|
|
42669
42844
|
}],
|
|
42845
|
+
"streamBroker.reportStreamSignal": [{
|
|
42846
|
+
name: "deviceId",
|
|
42847
|
+
form: "single",
|
|
42848
|
+
optional: false
|
|
42849
|
+
}],
|
|
42670
42850
|
"streamBroker.restartProfile": [{
|
|
42671
42851
|
name: "deviceId",
|
|
42672
42852
|
form: "single",
|