@camstack/addon-import-alexa 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 +188 -8
- package/dist/addon.mjs +188 -8
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -38,7 +38,7 @@ let node_os = require("node:os");
|
|
|
38
38
|
let node_fs = require("node:fs");
|
|
39
39
|
let node_path = require("node:path");
|
|
40
40
|
node_path = __toESM(node_path);
|
|
41
|
-
//#region ../types/dist/event-category-
|
|
41
|
+
//#region ../types/dist/event-category-BVDXG4tB.mjs
|
|
42
42
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
43
43
|
EventCategory["SystemBoot"] = "system.boot";
|
|
44
44
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -655,6 +655,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
655
655
|
* pull-reconcile from the provider's `getStatus` on reconnect. */
|
|
656
656
|
EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
|
|
657
657
|
EventCategory["BackupCompleted"] = "backup.completed";
|
|
658
|
+
/**
|
|
659
|
+
* A whole backup RUN finished — every destination attempted, win or lose.
|
|
660
|
+
*
|
|
661
|
+
* `backup.completed` fires once per DESTINATION, which is the right grain for
|
|
662
|
+
* a progress UI and the wrong one for a notification: an operator with three
|
|
663
|
+
* destinations would be told three times. And a run where two of three
|
|
664
|
+
* destinations succeeded is not a clean success — a single "backup
|
|
665
|
+
* completed" that hid the failed one would be a lie, so the count of each is
|
|
666
|
+
* carried here and the message says both.
|
|
667
|
+
*
|
|
668
|
+
* Emitted by the backup orchestrator only after the destination loop, so a
|
|
669
|
+
* run that dies during the BUILD phase produces no completion at all.
|
|
670
|
+
*/
|
|
671
|
+
EventCategory["BackupRunCompleted"] = "backup.run-completed";
|
|
658
672
|
EventCategory["BackupRestored"] = "backup.restored";
|
|
659
673
|
EventCategory["NotificationDispatched"] = "notification.dispatched";
|
|
660
674
|
EventCategory["NotificationFailed"] = "notification.failed";
|
|
@@ -5385,7 +5399,7 @@ var ZodIssueCode = {
|
|
|
5385
5399
|
var ZodFirstPartyTypeKind;
|
|
5386
5400
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5387
5401
|
//#endregion
|
|
5388
|
-
//#region ../types/dist/sleep-
|
|
5402
|
+
//#region ../types/dist/sleep-DEuj7E3j.mjs
|
|
5389
5403
|
/**
|
|
5390
5404
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5391
5405
|
* window to float samples (D455).
|
|
@@ -11714,6 +11728,72 @@ var brokerCapability = {
|
|
|
11714
11728
|
}
|
|
11715
11729
|
};
|
|
11716
11730
|
DeviceType.Camera;
|
|
11731
|
+
/**
|
|
11732
|
+
* The signals a device can emit to WAKE its own stream.
|
|
11733
|
+
*
|
|
11734
|
+
* A camera whose stream is built on demand sleeps until something asks for it,
|
|
11735
|
+
* and "something" cannot be a consumer that is merely attached — a Frigate-style
|
|
11736
|
+
* puller holds a session open for ever, and treating that as demand would keep
|
|
11737
|
+
* a battery camera awake for ever, which is the whole thing the battery is for
|
|
11738
|
+
* (D173). So the wake has to come from the CAMERA: an event it noticed by
|
|
11739
|
+
* itself, with no stream running.
|
|
11740
|
+
*
|
|
11741
|
+
* ## The vocabulary is the PROVIDER'S, not ours
|
|
11742
|
+
*
|
|
11743
|
+
* Like `consumables`, this cap declares no vocabulary of its own. A provider
|
|
11744
|
+
* names each signal with a `code` it chooses and a `label` an operator reads.
|
|
11745
|
+
* Reolink offers motion and camera-native detection; another provider may offer
|
|
11746
|
+
* a tamper, a doorbell press, a PIR, or something no camera in this fleet has
|
|
11747
|
+
* yet. A fixed enum here would mean every new signal is a framework release.
|
|
11748
|
+
*
|
|
11749
|
+
* It is deliberately NOT derived from the caps a device already binds. Whether
|
|
11750
|
+
* a camera CAN push firmware motion is expressed by `motionSources` containing
|
|
11751
|
+
* `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
|
|
11752
|
+
* binding — but both answer "what drives the detection pipeline", which is a
|
|
11753
|
+
* different question from "what may wake a sleeping stream". A camera can do
|
|
11754
|
+
* the first and not be trusted with the second, and the operator picks per
|
|
11755
|
+
* camera. Two questions, two authorities.
|
|
11756
|
+
*
|
|
11757
|
+
* ## Availability is not permission
|
|
11758
|
+
*
|
|
11759
|
+
* `listSignals` says what the device CAN emit. Whether a given signal actually
|
|
11760
|
+
* wakes the stream is the operator's per-camera choice, held by the broker
|
|
11761
|
+
* alongside the cooldown — see the stream-broker cap's wake settings. A
|
|
11762
|
+
* provider declaring a signal is not a provider enabling it.
|
|
11763
|
+
*/
|
|
11764
|
+
/** One signal a device can emit. */
|
|
11765
|
+
var StreamSignalSchema = object({
|
|
11766
|
+
/** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
|
|
11767
|
+
code: string().min(1),
|
|
11768
|
+
/** What an operator reads in the picker. The provider's own wording. */
|
|
11769
|
+
label: string().min(1),
|
|
11770
|
+
/**
|
|
11771
|
+
* Whether the provider recommends this signal ON when a camera is first set
|
|
11772
|
+
* up. A provider knows which of its signals are cheap and reliable; an
|
|
11773
|
+
* operator should not have to discover that by trial. Reolink recommends
|
|
11774
|
+
* both of its own.
|
|
11775
|
+
*/
|
|
11776
|
+
recommended: boolean()
|
|
11777
|
+
});
|
|
11778
|
+
var StreamSignalsStatusSchema = object({
|
|
11779
|
+
signals: array(StreamSignalSchema),
|
|
11780
|
+
lastFetchedAt: number()
|
|
11781
|
+
});
|
|
11782
|
+
var streamSignalsCapability = {
|
|
11783
|
+
name: "stream-signals",
|
|
11784
|
+
scope: "device",
|
|
11785
|
+
deviceNative: true,
|
|
11786
|
+
mode: "singleton",
|
|
11787
|
+
deviceTypes: Object.values(DeviceType),
|
|
11788
|
+
runtimeState: StreamSignalsStatusSchema,
|
|
11789
|
+
methods: {
|
|
11790
|
+
/**
|
|
11791
|
+
* What this device can emit. Empty is a valid and common answer — most
|
|
11792
|
+
* cameras have nothing to offer here, and an empty list is what makes the
|
|
11793
|
+
* broker's picker show nothing rather than a false choice.
|
|
11794
|
+
*/
|
|
11795
|
+
listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
|
|
11796
|
+
};
|
|
11717
11797
|
/** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
|
|
11718
11798
|
var StreamFormatSchema = _enum([
|
|
11719
11799
|
"webrtc",
|
|
@@ -12110,6 +12190,22 @@ var EgressTranscodeSchema = object({
|
|
|
12110
12190
|
camStreamId: string().nullable()
|
|
12111
12191
|
});
|
|
12112
12192
|
method(object({
|
|
12193
|
+
deviceId: number().int().nonnegative(),
|
|
12194
|
+
/** The provider's signal code. */
|
|
12195
|
+
code: string().min(1),
|
|
12196
|
+
/** Ms epoch. Absent ⇒ now. */
|
|
12197
|
+
at: number().optional()
|
|
12198
|
+
}), object({
|
|
12199
|
+
/** Whether the broker acted on it, and if not, why. */
|
|
12200
|
+
accepted: boolean(),
|
|
12201
|
+
reason: _enum([
|
|
12202
|
+
"woke",
|
|
12203
|
+
"hold-extended",
|
|
12204
|
+
"not-enabled",
|
|
12205
|
+
"no-consumer",
|
|
12206
|
+
"unknown-code"
|
|
12207
|
+
])
|
|
12208
|
+
}), { kind: "mutation" }), method(object({
|
|
12113
12209
|
deviceId: number().int().nonnegative(),
|
|
12114
12210
|
camStreamId: string().min(1),
|
|
12115
12211
|
kind: CamStreamKindSchema,
|
|
@@ -12364,6 +12460,16 @@ var PickStreamRequirementsSchema = object({
|
|
|
12364
12460
|
acceptCodecs: array(StreamCodecSchema).readonly().optional(),
|
|
12365
12461
|
/** Minimum vertical resolution. Streams shorter than this are dropped. */
|
|
12366
12462
|
minHeight: number().int().positive().optional(),
|
|
12463
|
+
/**
|
|
12464
|
+
* Maximum vertical resolution. Streams TALLER than this are dropped.
|
|
12465
|
+
*
|
|
12466
|
+
* A consumer can have a ceiling as real as its floor: Alexa documents
|
|
12467
|
+
* 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
|
|
12468
|
+
* Without this the ceiling had to be re-implemented by every caller — and
|
|
12469
|
+
* one caller implementing it privately is how a second scoring authority
|
|
12470
|
+
* gets born.
|
|
12471
|
+
*/
|
|
12472
|
+
maxHeight: number().int().positive().optional(),
|
|
12367
12473
|
/** Minimum horizontal resolution. */
|
|
12368
12474
|
minWidth: number().int().positive().optional(),
|
|
12369
12475
|
/**
|
|
@@ -12380,7 +12486,22 @@ var PickStreamRequirementsSchema = object({
|
|
|
12380
12486
|
* transcoded" guard: if the device is already serving the consumer's
|
|
12381
12487
|
* codec end-to-end, there's nothing to optimise.
|
|
12382
12488
|
*/
|
|
12383
|
-
requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
|
|
12489
|
+
requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
|
|
12490
|
+
/**
|
|
12491
|
+
* Whether a stream the consumer CANNOT decode may still be picked, on the
|
|
12492
|
+
* understanding that it will be transcoded.
|
|
12493
|
+
*
|
|
12494
|
+
* Default `false` — today's behaviour, and the right one for a bypass
|
|
12495
|
+
* question ("is there a stream I can forward untouched?"). Set `true` to
|
|
12496
|
+
* ask the larger question: "what is the best stream for me, transcoding if
|
|
12497
|
+
* I must?" A stream that satisfies `acceptCodecs` always outranks one that
|
|
12498
|
+
* does not, so a passthrough is never lost to a transcode; the answer says
|
|
12499
|
+
* which it is in {@link PickedCamStreamSchema.transcodes}.
|
|
12500
|
+
*
|
|
12501
|
+
* This is what lets one picker serve both the bypass and the full source
|
|
12502
|
+
* choice, instead of a consumer scoring privately when the bypass misses.
|
|
12503
|
+
*/
|
|
12504
|
+
allowTranscode: boolean().optional()
|
|
12384
12505
|
}).readonly();
|
|
12385
12506
|
var PickStreamPreferencesSchema = object({
|
|
12386
12507
|
/**
|
|
@@ -12394,12 +12515,32 @@ var PickStreamPreferencesSchema = object({
|
|
|
12394
12515
|
* picks the tallest stream; `'lowest'` picks the shortest (used by
|
|
12395
12516
|
* memory-constrained consumers / Apple Home guest sessions).
|
|
12396
12517
|
*/
|
|
12397
|
-
resolutionPreference: _enum(["highest", "lowest"]).optional()
|
|
12518
|
+
resolutionPreference: _enum(["highest", "lowest"]).optional(),
|
|
12519
|
+
/**
|
|
12520
|
+
* The height the consumer actually wants to DELIVER.
|
|
12521
|
+
*
|
|
12522
|
+
* Not a constraint — an ordering. With it set, the SMALLEST stream at or
|
|
12523
|
+
* above the target wins, and only if nothing reaches it does the tallest
|
|
12524
|
+
* take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
|
|
12525
|
+
* a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
|
|
12526
|
+
* express that: it says "as big as possible", which is a different wish.
|
|
12527
|
+
*
|
|
12528
|
+
* Ignored when absent, so every existing caller keeps its ordering.
|
|
12529
|
+
*/
|
|
12530
|
+
targetHeight: number().int().positive().optional()
|
|
12398
12531
|
}).readonly();
|
|
12399
12532
|
var PickedCamStreamSchema = object({
|
|
12400
12533
|
camStreamId: string(),
|
|
12401
12534
|
codec: string().optional(),
|
|
12402
12535
|
resolution: CamStreamResolutionSchema.optional(),
|
|
12536
|
+
/**
|
|
12537
|
+
* Whether serving this stream requires a decode + re-encode.
|
|
12538
|
+
*
|
|
12539
|
+
* `false` is a stream the consumer can take as it stands. Only ever `true`
|
|
12540
|
+
* when the caller asked for it with `allowTranscode`, so a caller that did
|
|
12541
|
+
* not ask cannot be handed a cost it never agreed to pay.
|
|
12542
|
+
*/
|
|
12543
|
+
transcodes: boolean(),
|
|
12403
12544
|
/** One-line explanation of why this stream won — for logs / debug UI. */
|
|
12404
12545
|
reason: string()
|
|
12405
12546
|
});
|
|
@@ -16933,6 +17074,8 @@ var NcSystemEventKindSchema = _enum([
|
|
|
16933
17074
|
"device-enabled",
|
|
16934
17075
|
"device-battery-low",
|
|
16935
17076
|
"device-battery-normal",
|
|
17077
|
+
"device-consumable-low",
|
|
17078
|
+
"device-consumable-normal",
|
|
16936
17079
|
"stream-online",
|
|
16937
17080
|
"stream-offline",
|
|
16938
17081
|
"node-online",
|
|
@@ -16951,6 +17094,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
16951
17094
|
"addon-updated",
|
|
16952
17095
|
"server-updated",
|
|
16953
17096
|
"export-completed",
|
|
17097
|
+
"backup-completed",
|
|
16954
17098
|
"camera-online",
|
|
16955
17099
|
"camera-offline",
|
|
16956
17100
|
"camera-disabled",
|
|
@@ -24232,10 +24376,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
|
|
|
24232
24376
|
}), boolean()), method(object({
|
|
24233
24377
|
deviceId: number().int().nonnegative(),
|
|
24234
24378
|
sessionId: string()
|
|
24235
|
-
}), object({
|
|
24236
|
-
|
|
24237
|
-
|
|
24238
|
-
|
|
24379
|
+
}), object({
|
|
24380
|
+
pendingRenegotiation: object({
|
|
24381
|
+
target: WebrtcStreamTargetSchema,
|
|
24382
|
+
epoch: number()
|
|
24383
|
+
}).nullable(),
|
|
24384
|
+
/**
|
|
24385
|
+
* Whether the session still EXISTS.
|
|
24386
|
+
*
|
|
24387
|
+
* A consumer that holds a resource for the life of a session needs to
|
|
24388
|
+
* be able to ask, because a session does not always end the way it
|
|
24389
|
+
* began. Measured on this hub 2026-09-13: an Echo that got stuck never
|
|
24390
|
+
* sent `SessionDisconnected`, so the Alexa exporter's
|
|
24391
|
+
* `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
|
|
24392
|
+
* H.264 transcode kept running for NOBODY for more than twenty
|
|
24393
|
+
* minutes. The WebRTC session had logged `WebRTC session closed`
|
|
24394
|
+
* minutes earlier — the broker knew; the holder had no way to ask.
|
|
24395
|
+
*
|
|
24396
|
+
* `false` for a session id the provider has never heard of, which is
|
|
24397
|
+
* the same answer as "it ended": either way nothing is holding it up.
|
|
24398
|
+
*/
|
|
24399
|
+
alive: boolean()
|
|
24400
|
+
}));
|
|
24239
24401
|
object({
|
|
24240
24402
|
/** All accessory children of the parent. */
|
|
24241
24403
|
childDeviceIds: array(number()).readonly(),
|
|
@@ -34171,6 +34333,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
34171
34333
|
smoke: smokeCapability,
|
|
34172
34334
|
streamCatalog: streamCatalogCapability,
|
|
34173
34335
|
streamParams: streamParamsCapability,
|
|
34336
|
+
streamSignals: streamSignalsCapability,
|
|
34174
34337
|
switch: switchCapability,
|
|
34175
34338
|
tamper: tamperCapability,
|
|
34176
34339
|
temperatureSensor: temperatureSensorCapability,
|
|
@@ -40744,6 +40907,12 @@ Object.freeze({
|
|
|
40744
40907
|
addonId: null,
|
|
40745
40908
|
access: "create"
|
|
40746
40909
|
},
|
|
40910
|
+
"streamBroker.reportStreamSignal": {
|
|
40911
|
+
capName: "stream-broker",
|
|
40912
|
+
capScope: "system",
|
|
40913
|
+
addonId: null,
|
|
40914
|
+
access: "create"
|
|
40915
|
+
},
|
|
40747
40916
|
"streamBroker.restartProfile": {
|
|
40748
40917
|
capName: "stream-broker",
|
|
40749
40918
|
capScope: "system",
|
|
@@ -40828,6 +40997,12 @@ Object.freeze({
|
|
|
40828
40997
|
addonId: null,
|
|
40829
40998
|
access: "create"
|
|
40830
40999
|
},
|
|
41000
|
+
"streamSignals.listSignals": {
|
|
41001
|
+
capName: "stream-signals",
|
|
41002
|
+
capScope: "device",
|
|
41003
|
+
addonId: null,
|
|
41004
|
+
access: "view"
|
|
41005
|
+
},
|
|
40831
41006
|
"switch.setState": {
|
|
40832
41007
|
capName: "switch",
|
|
40833
41008
|
capScope: "device",
|
|
@@ -43200,6 +43375,11 @@ Object.freeze({
|
|
|
43200
43375
|
form: "single",
|
|
43201
43376
|
optional: false
|
|
43202
43377
|
}],
|
|
43378
|
+
"streamBroker.reportStreamSignal": [{
|
|
43379
|
+
name: "deviceId",
|
|
43380
|
+
form: "single",
|
|
43381
|
+
optional: false
|
|
43382
|
+
}],
|
|
43203
43383
|
"streamBroker.restartProfile": [{
|
|
43204
43384
|
name: "deviceId",
|
|
43205
43385
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -38,7 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
38
38
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
39
39
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
40
40
|
//#endregion
|
|
41
|
-
//#region ../types/dist/event-category-
|
|
41
|
+
//#region ../types/dist/event-category-BVDXG4tB.mjs
|
|
42
42
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
43
43
|
EventCategory["SystemBoot"] = "system.boot";
|
|
44
44
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -655,6 +655,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
655
655
|
* pull-reconcile from the provider's `getStatus` on reconnect. */
|
|
656
656
|
EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
|
|
657
657
|
EventCategory["BackupCompleted"] = "backup.completed";
|
|
658
|
+
/**
|
|
659
|
+
* A whole backup RUN finished — every destination attempted, win or lose.
|
|
660
|
+
*
|
|
661
|
+
* `backup.completed` fires once per DESTINATION, which is the right grain for
|
|
662
|
+
* a progress UI and the wrong one for a notification: an operator with three
|
|
663
|
+
* destinations would be told three times. And a run where two of three
|
|
664
|
+
* destinations succeeded is not a clean success — a single "backup
|
|
665
|
+
* completed" that hid the failed one would be a lie, so the count of each is
|
|
666
|
+
* carried here and the message says both.
|
|
667
|
+
*
|
|
668
|
+
* Emitted by the backup orchestrator only after the destination loop, so a
|
|
669
|
+
* run that dies during the BUILD phase produces no completion at all.
|
|
670
|
+
*/
|
|
671
|
+
EventCategory["BackupRunCompleted"] = "backup.run-completed";
|
|
658
672
|
EventCategory["BackupRestored"] = "backup.restored";
|
|
659
673
|
EventCategory["NotificationDispatched"] = "notification.dispatched";
|
|
660
674
|
EventCategory["NotificationFailed"] = "notification.failed";
|
|
@@ -5385,7 +5399,7 @@ var ZodIssueCode = {
|
|
|
5385
5399
|
var ZodFirstPartyTypeKind;
|
|
5386
5400
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5387
5401
|
//#endregion
|
|
5388
|
-
//#region ../types/dist/sleep-
|
|
5402
|
+
//#region ../types/dist/sleep-DEuj7E3j.mjs
|
|
5389
5403
|
/**
|
|
5390
5404
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5391
5405
|
* window to float samples (D455).
|
|
@@ -11714,6 +11728,72 @@ var brokerCapability = {
|
|
|
11714
11728
|
}
|
|
11715
11729
|
};
|
|
11716
11730
|
DeviceType.Camera;
|
|
11731
|
+
/**
|
|
11732
|
+
* The signals a device can emit to WAKE its own stream.
|
|
11733
|
+
*
|
|
11734
|
+
* A camera whose stream is built on demand sleeps until something asks for it,
|
|
11735
|
+
* and "something" cannot be a consumer that is merely attached — a Frigate-style
|
|
11736
|
+
* puller holds a session open for ever, and treating that as demand would keep
|
|
11737
|
+
* a battery camera awake for ever, which is the whole thing the battery is for
|
|
11738
|
+
* (D173). So the wake has to come from the CAMERA: an event it noticed by
|
|
11739
|
+
* itself, with no stream running.
|
|
11740
|
+
*
|
|
11741
|
+
* ## The vocabulary is the PROVIDER'S, not ours
|
|
11742
|
+
*
|
|
11743
|
+
* Like `consumables`, this cap declares no vocabulary of its own. A provider
|
|
11744
|
+
* names each signal with a `code` it chooses and a `label` an operator reads.
|
|
11745
|
+
* Reolink offers motion and camera-native detection; another provider may offer
|
|
11746
|
+
* a tamper, a doorbell press, a PIR, or something no camera in this fleet has
|
|
11747
|
+
* yet. A fixed enum here would mean every new signal is a framework release.
|
|
11748
|
+
*
|
|
11749
|
+
* It is deliberately NOT derived from the caps a device already binds. Whether
|
|
11750
|
+
* a camera CAN push firmware motion is expressed by `motionSources` containing
|
|
11751
|
+
* `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
|
|
11752
|
+
* binding — but both answer "what drives the detection pipeline", which is a
|
|
11753
|
+
* different question from "what may wake a sleeping stream". A camera can do
|
|
11754
|
+
* the first and not be trusted with the second, and the operator picks per
|
|
11755
|
+
* camera. Two questions, two authorities.
|
|
11756
|
+
*
|
|
11757
|
+
* ## Availability is not permission
|
|
11758
|
+
*
|
|
11759
|
+
* `listSignals` says what the device CAN emit. Whether a given signal actually
|
|
11760
|
+
* wakes the stream is the operator's per-camera choice, held by the broker
|
|
11761
|
+
* alongside the cooldown — see the stream-broker cap's wake settings. A
|
|
11762
|
+
* provider declaring a signal is not a provider enabling it.
|
|
11763
|
+
*/
|
|
11764
|
+
/** One signal a device can emit. */
|
|
11765
|
+
var StreamSignalSchema = object({
|
|
11766
|
+
/** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
|
|
11767
|
+
code: string().min(1),
|
|
11768
|
+
/** What an operator reads in the picker. The provider's own wording. */
|
|
11769
|
+
label: string().min(1),
|
|
11770
|
+
/**
|
|
11771
|
+
* Whether the provider recommends this signal ON when a camera is first set
|
|
11772
|
+
* up. A provider knows which of its signals are cheap and reliable; an
|
|
11773
|
+
* operator should not have to discover that by trial. Reolink recommends
|
|
11774
|
+
* both of its own.
|
|
11775
|
+
*/
|
|
11776
|
+
recommended: boolean()
|
|
11777
|
+
});
|
|
11778
|
+
var StreamSignalsStatusSchema = object({
|
|
11779
|
+
signals: array(StreamSignalSchema),
|
|
11780
|
+
lastFetchedAt: number()
|
|
11781
|
+
});
|
|
11782
|
+
var streamSignalsCapability = {
|
|
11783
|
+
name: "stream-signals",
|
|
11784
|
+
scope: "device",
|
|
11785
|
+
deviceNative: true,
|
|
11786
|
+
mode: "singleton",
|
|
11787
|
+
deviceTypes: Object.values(DeviceType),
|
|
11788
|
+
runtimeState: StreamSignalsStatusSchema,
|
|
11789
|
+
methods: {
|
|
11790
|
+
/**
|
|
11791
|
+
* What this device can emit. Empty is a valid and common answer — most
|
|
11792
|
+
* cameras have nothing to offer here, and an empty list is what makes the
|
|
11793
|
+
* broker's picker show nothing rather than a false choice.
|
|
11794
|
+
*/
|
|
11795
|
+
listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
|
|
11796
|
+
};
|
|
11717
11797
|
/** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
|
|
11718
11798
|
var StreamFormatSchema = _enum([
|
|
11719
11799
|
"webrtc",
|
|
@@ -12110,6 +12190,22 @@ var EgressTranscodeSchema = object({
|
|
|
12110
12190
|
camStreamId: string().nullable()
|
|
12111
12191
|
});
|
|
12112
12192
|
method(object({
|
|
12193
|
+
deviceId: number().int().nonnegative(),
|
|
12194
|
+
/** The provider's signal code. */
|
|
12195
|
+
code: string().min(1),
|
|
12196
|
+
/** Ms epoch. Absent ⇒ now. */
|
|
12197
|
+
at: number().optional()
|
|
12198
|
+
}), object({
|
|
12199
|
+
/** Whether the broker acted on it, and if not, why. */
|
|
12200
|
+
accepted: boolean(),
|
|
12201
|
+
reason: _enum([
|
|
12202
|
+
"woke",
|
|
12203
|
+
"hold-extended",
|
|
12204
|
+
"not-enabled",
|
|
12205
|
+
"no-consumer",
|
|
12206
|
+
"unknown-code"
|
|
12207
|
+
])
|
|
12208
|
+
}), { kind: "mutation" }), method(object({
|
|
12113
12209
|
deviceId: number().int().nonnegative(),
|
|
12114
12210
|
camStreamId: string().min(1),
|
|
12115
12211
|
kind: CamStreamKindSchema,
|
|
@@ -12364,6 +12460,16 @@ var PickStreamRequirementsSchema = object({
|
|
|
12364
12460
|
acceptCodecs: array(StreamCodecSchema).readonly().optional(),
|
|
12365
12461
|
/** Minimum vertical resolution. Streams shorter than this are dropped. */
|
|
12366
12462
|
minHeight: number().int().positive().optional(),
|
|
12463
|
+
/**
|
|
12464
|
+
* Maximum vertical resolution. Streams TALLER than this are dropped.
|
|
12465
|
+
*
|
|
12466
|
+
* A consumer can have a ceiling as real as its floor: Alexa documents
|
|
12467
|
+
* 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
|
|
12468
|
+
* Without this the ceiling had to be re-implemented by every caller — and
|
|
12469
|
+
* one caller implementing it privately is how a second scoring authority
|
|
12470
|
+
* gets born.
|
|
12471
|
+
*/
|
|
12472
|
+
maxHeight: number().int().positive().optional(),
|
|
12367
12473
|
/** Minimum horizontal resolution. */
|
|
12368
12474
|
minWidth: number().int().positive().optional(),
|
|
12369
12475
|
/**
|
|
@@ -12380,7 +12486,22 @@ var PickStreamRequirementsSchema = object({
|
|
|
12380
12486
|
* transcoded" guard: if the device is already serving the consumer's
|
|
12381
12487
|
* codec end-to-end, there's nothing to optimise.
|
|
12382
12488
|
*/
|
|
12383
|
-
requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
|
|
12489
|
+
requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
|
|
12490
|
+
/**
|
|
12491
|
+
* Whether a stream the consumer CANNOT decode may still be picked, on the
|
|
12492
|
+
* understanding that it will be transcoded.
|
|
12493
|
+
*
|
|
12494
|
+
* Default `false` — today's behaviour, and the right one for a bypass
|
|
12495
|
+
* question ("is there a stream I can forward untouched?"). Set `true` to
|
|
12496
|
+
* ask the larger question: "what is the best stream for me, transcoding if
|
|
12497
|
+
* I must?" A stream that satisfies `acceptCodecs` always outranks one that
|
|
12498
|
+
* does not, so a passthrough is never lost to a transcode; the answer says
|
|
12499
|
+
* which it is in {@link PickedCamStreamSchema.transcodes}.
|
|
12500
|
+
*
|
|
12501
|
+
* This is what lets one picker serve both the bypass and the full source
|
|
12502
|
+
* choice, instead of a consumer scoring privately when the bypass misses.
|
|
12503
|
+
*/
|
|
12504
|
+
allowTranscode: boolean().optional()
|
|
12384
12505
|
}).readonly();
|
|
12385
12506
|
var PickStreamPreferencesSchema = object({
|
|
12386
12507
|
/**
|
|
@@ -12394,12 +12515,32 @@ var PickStreamPreferencesSchema = object({
|
|
|
12394
12515
|
* picks the tallest stream; `'lowest'` picks the shortest (used by
|
|
12395
12516
|
* memory-constrained consumers / Apple Home guest sessions).
|
|
12396
12517
|
*/
|
|
12397
|
-
resolutionPreference: _enum(["highest", "lowest"]).optional()
|
|
12518
|
+
resolutionPreference: _enum(["highest", "lowest"]).optional(),
|
|
12519
|
+
/**
|
|
12520
|
+
* The height the consumer actually wants to DELIVER.
|
|
12521
|
+
*
|
|
12522
|
+
* Not a constraint — an ordering. With it set, the SMALLEST stream at or
|
|
12523
|
+
* above the target wins, and only if nothing reaches it does the tallest
|
|
12524
|
+
* take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
|
|
12525
|
+
* a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
|
|
12526
|
+
* express that: it says "as big as possible", which is a different wish.
|
|
12527
|
+
*
|
|
12528
|
+
* Ignored when absent, so every existing caller keeps its ordering.
|
|
12529
|
+
*/
|
|
12530
|
+
targetHeight: number().int().positive().optional()
|
|
12398
12531
|
}).readonly();
|
|
12399
12532
|
var PickedCamStreamSchema = object({
|
|
12400
12533
|
camStreamId: string(),
|
|
12401
12534
|
codec: string().optional(),
|
|
12402
12535
|
resolution: CamStreamResolutionSchema.optional(),
|
|
12536
|
+
/**
|
|
12537
|
+
* Whether serving this stream requires a decode + re-encode.
|
|
12538
|
+
*
|
|
12539
|
+
* `false` is a stream the consumer can take as it stands. Only ever `true`
|
|
12540
|
+
* when the caller asked for it with `allowTranscode`, so a caller that did
|
|
12541
|
+
* not ask cannot be handed a cost it never agreed to pay.
|
|
12542
|
+
*/
|
|
12543
|
+
transcodes: boolean(),
|
|
12403
12544
|
/** One-line explanation of why this stream won — for logs / debug UI. */
|
|
12404
12545
|
reason: string()
|
|
12405
12546
|
});
|
|
@@ -16933,6 +17074,8 @@ var NcSystemEventKindSchema = _enum([
|
|
|
16933
17074
|
"device-enabled",
|
|
16934
17075
|
"device-battery-low",
|
|
16935
17076
|
"device-battery-normal",
|
|
17077
|
+
"device-consumable-low",
|
|
17078
|
+
"device-consumable-normal",
|
|
16936
17079
|
"stream-online",
|
|
16937
17080
|
"stream-offline",
|
|
16938
17081
|
"node-online",
|
|
@@ -16951,6 +17094,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
16951
17094
|
"addon-updated",
|
|
16952
17095
|
"server-updated",
|
|
16953
17096
|
"export-completed",
|
|
17097
|
+
"backup-completed",
|
|
16954
17098
|
"camera-online",
|
|
16955
17099
|
"camera-offline",
|
|
16956
17100
|
"camera-disabled",
|
|
@@ -24232,10 +24376,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
|
|
|
24232
24376
|
}), boolean()), method(object({
|
|
24233
24377
|
deviceId: number().int().nonnegative(),
|
|
24234
24378
|
sessionId: string()
|
|
24235
|
-
}), object({
|
|
24236
|
-
|
|
24237
|
-
|
|
24238
|
-
|
|
24379
|
+
}), object({
|
|
24380
|
+
pendingRenegotiation: object({
|
|
24381
|
+
target: WebrtcStreamTargetSchema,
|
|
24382
|
+
epoch: number()
|
|
24383
|
+
}).nullable(),
|
|
24384
|
+
/**
|
|
24385
|
+
* Whether the session still EXISTS.
|
|
24386
|
+
*
|
|
24387
|
+
* A consumer that holds a resource for the life of a session needs to
|
|
24388
|
+
* be able to ask, because a session does not always end the way it
|
|
24389
|
+
* began. Measured on this hub 2026-09-13: an Echo that got stuck never
|
|
24390
|
+
* sent `SessionDisconnected`, so the Alexa exporter's
|
|
24391
|
+
* `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
|
|
24392
|
+
* H.264 transcode kept running for NOBODY for more than twenty
|
|
24393
|
+
* minutes. The WebRTC session had logged `WebRTC session closed`
|
|
24394
|
+
* minutes earlier — the broker knew; the holder had no way to ask.
|
|
24395
|
+
*
|
|
24396
|
+
* `false` for a session id the provider has never heard of, which is
|
|
24397
|
+
* the same answer as "it ended": either way nothing is holding it up.
|
|
24398
|
+
*/
|
|
24399
|
+
alive: boolean()
|
|
24400
|
+
}));
|
|
24239
24401
|
object({
|
|
24240
24402
|
/** All accessory children of the parent. */
|
|
24241
24403
|
childDeviceIds: array(number()).readonly(),
|
|
@@ -34171,6 +34333,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
34171
34333
|
smoke: smokeCapability,
|
|
34172
34334
|
streamCatalog: streamCatalogCapability,
|
|
34173
34335
|
streamParams: streamParamsCapability,
|
|
34336
|
+
streamSignals: streamSignalsCapability,
|
|
34174
34337
|
switch: switchCapability,
|
|
34175
34338
|
tamper: tamperCapability,
|
|
34176
34339
|
temperatureSensor: temperatureSensorCapability,
|
|
@@ -40744,6 +40907,12 @@ Object.freeze({
|
|
|
40744
40907
|
addonId: null,
|
|
40745
40908
|
access: "create"
|
|
40746
40909
|
},
|
|
40910
|
+
"streamBroker.reportStreamSignal": {
|
|
40911
|
+
capName: "stream-broker",
|
|
40912
|
+
capScope: "system",
|
|
40913
|
+
addonId: null,
|
|
40914
|
+
access: "create"
|
|
40915
|
+
},
|
|
40747
40916
|
"streamBroker.restartProfile": {
|
|
40748
40917
|
capName: "stream-broker",
|
|
40749
40918
|
capScope: "system",
|
|
@@ -40828,6 +40997,12 @@ Object.freeze({
|
|
|
40828
40997
|
addonId: null,
|
|
40829
40998
|
access: "create"
|
|
40830
40999
|
},
|
|
41000
|
+
"streamSignals.listSignals": {
|
|
41001
|
+
capName: "stream-signals",
|
|
41002
|
+
capScope: "device",
|
|
41003
|
+
addonId: null,
|
|
41004
|
+
access: "view"
|
|
41005
|
+
},
|
|
40831
41006
|
"switch.setState": {
|
|
40832
41007
|
capName: "switch",
|
|
40833
41008
|
capScope: "device",
|
|
@@ -43200,6 +43375,11 @@ Object.freeze({
|
|
|
43200
43375
|
form: "single",
|
|
43201
43376
|
optional: false
|
|
43202
43377
|
}],
|
|
43378
|
+
"streamBroker.reportStreamSignal": [{
|
|
43379
|
+
name: "deviceId",
|
|
43380
|
+
form: "single",
|
|
43381
|
+
optional: false
|
|
43382
|
+
}],
|
|
43203
43383
|
"streamBroker.restartProfile": [{
|
|
43204
43384
|
name: "deviceId",
|
|
43205
43385
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-import-alexa",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.101",
|
|
4
4
|
"description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|