@camstack/addon-terminal 0.1.74 → 0.1.75
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 +91 -1
- package/dist/addon.mjs +91 -1
- 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-zAv7pMUz.mjs
|
|
35
35
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
36
36
|
EventCategory["SystemBoot"] = "system.boot";
|
|
37
37
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -403,6 +403,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
403
403
|
*/
|
|
404
404
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
405
405
|
/**
|
|
406
|
+
* Cap event fired by every device that registers the `network-link`
|
|
407
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
408
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
409
|
+
* reading that moved.
|
|
410
|
+
*/
|
|
411
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
412
|
+
/**
|
|
406
413
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
407
414
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
408
415
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23915,6 +23922,88 @@ onStatusChanged: { data: object({
|
|
|
23915
23922
|
volatileStateFields: ["lastUpdated"]
|
|
23916
23923
|
};
|
|
23917
23924
|
/**
|
|
23925
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23926
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23927
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23928
|
+
* one Home Assistant projection.
|
|
23929
|
+
*/
|
|
23930
|
+
var NetworkLinkStatusSchema = object({
|
|
23931
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23932
|
+
type: _enum([
|
|
23933
|
+
"wifi",
|
|
23934
|
+
"ethernet",
|
|
23935
|
+
"cellular",
|
|
23936
|
+
"unknown"
|
|
23937
|
+
]),
|
|
23938
|
+
/**
|
|
23939
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23940
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23941
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23942
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23943
|
+
* SKIP a null rather than coerce it.
|
|
23944
|
+
*/
|
|
23945
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23946
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23947
|
+
rssiDbm: number().optional(),
|
|
23948
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23949
|
+
ssid: string().optional(),
|
|
23950
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23951
|
+
lastUpdated: number()
|
|
23952
|
+
});
|
|
23953
|
+
var networkLinkCapability = {
|
|
23954
|
+
name: "network-link",
|
|
23955
|
+
scope: "device",
|
|
23956
|
+
deviceNative: true,
|
|
23957
|
+
mode: "singleton",
|
|
23958
|
+
deviceTypes: [
|
|
23959
|
+
DeviceType.Camera,
|
|
23960
|
+
DeviceType.Sensor,
|
|
23961
|
+
DeviceType.Button,
|
|
23962
|
+
DeviceType.Switch,
|
|
23963
|
+
DeviceType.Light,
|
|
23964
|
+
DeviceType.Lock,
|
|
23965
|
+
DeviceType.Siren
|
|
23966
|
+
],
|
|
23967
|
+
methods: {},
|
|
23968
|
+
events: {
|
|
23969
|
+
/**
|
|
23970
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
23971
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
23972
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
23973
|
+
*/
|
|
23974
|
+
onStatusChanged: { data: object({
|
|
23975
|
+
deviceId: number(),
|
|
23976
|
+
status: NetworkLinkStatusSchema
|
|
23977
|
+
}) } },
|
|
23978
|
+
status: {
|
|
23979
|
+
schema: NetworkLinkStatusSchema,
|
|
23980
|
+
kind: "push",
|
|
23981
|
+
empty: {
|
|
23982
|
+
type: "unknown",
|
|
23983
|
+
signalPercent: null,
|
|
23984
|
+
lastUpdated: 0
|
|
23985
|
+
}
|
|
23986
|
+
},
|
|
23987
|
+
/**
|
|
23988
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
23989
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
23990
|
+
* Home Assistant projector regardless of the driver.
|
|
23991
|
+
*/
|
|
23992
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
23993
|
+
/**
|
|
23994
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
23995
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
23996
|
+
* restored slice is what the badge shows until the next read.
|
|
23997
|
+
*
|
|
23998
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23999
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
24000
|
+
*/
|
|
24001
|
+
durability: "restored",
|
|
24002
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
24003
|
+
* whether persisting is worth a SQLite commit. */
|
|
24004
|
+
volatileStateFields: ["lastUpdated"]
|
|
24005
|
+
};
|
|
24006
|
+
/**
|
|
23918
24007
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
23919
24008
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
23920
24009
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -32299,6 +32388,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32299
32388
|
motionTrigger: motionTriggerCapability,
|
|
32300
32389
|
motionZones: motionZonesCapability,
|
|
32301
32390
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32391
|
+
networkLink: networkLinkCapability,
|
|
32302
32392
|
notifier: notifierCapability,
|
|
32303
32393
|
numericSensor: numericSensorCapability,
|
|
32304
32394
|
petFeeder: petFeederCapability,
|
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-zAv7pMUz.mjs
|
|
12
12
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
13
13
|
EventCategory["SystemBoot"] = "system.boot";
|
|
14
14
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -380,6 +380,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
380
380
|
*/
|
|
381
381
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
382
382
|
/**
|
|
383
|
+
* Cap event fired by every device that registers the `network-link`
|
|
384
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
385
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
386
|
+
* reading that moved.
|
|
387
|
+
*/
|
|
388
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
389
|
+
/**
|
|
383
390
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
384
391
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
385
392
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23892,6 +23899,88 @@ onStatusChanged: { data: object({
|
|
|
23892
23899
|
volatileStateFields: ["lastUpdated"]
|
|
23893
23900
|
};
|
|
23894
23901
|
/**
|
|
23902
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23903
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23904
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23905
|
+
* one Home Assistant projection.
|
|
23906
|
+
*/
|
|
23907
|
+
var NetworkLinkStatusSchema = object({
|
|
23908
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23909
|
+
type: _enum([
|
|
23910
|
+
"wifi",
|
|
23911
|
+
"ethernet",
|
|
23912
|
+
"cellular",
|
|
23913
|
+
"unknown"
|
|
23914
|
+
]),
|
|
23915
|
+
/**
|
|
23916
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23917
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23918
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23919
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23920
|
+
* SKIP a null rather than coerce it.
|
|
23921
|
+
*/
|
|
23922
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23923
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23924
|
+
rssiDbm: number().optional(),
|
|
23925
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23926
|
+
ssid: string().optional(),
|
|
23927
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23928
|
+
lastUpdated: number()
|
|
23929
|
+
});
|
|
23930
|
+
var networkLinkCapability = {
|
|
23931
|
+
name: "network-link",
|
|
23932
|
+
scope: "device",
|
|
23933
|
+
deviceNative: true,
|
|
23934
|
+
mode: "singleton",
|
|
23935
|
+
deviceTypes: [
|
|
23936
|
+
DeviceType.Camera,
|
|
23937
|
+
DeviceType.Sensor,
|
|
23938
|
+
DeviceType.Button,
|
|
23939
|
+
DeviceType.Switch,
|
|
23940
|
+
DeviceType.Light,
|
|
23941
|
+
DeviceType.Lock,
|
|
23942
|
+
DeviceType.Siren
|
|
23943
|
+
],
|
|
23944
|
+
methods: {},
|
|
23945
|
+
events: {
|
|
23946
|
+
/**
|
|
23947
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
23948
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
23949
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
23950
|
+
*/
|
|
23951
|
+
onStatusChanged: { data: object({
|
|
23952
|
+
deviceId: number(),
|
|
23953
|
+
status: NetworkLinkStatusSchema
|
|
23954
|
+
}) } },
|
|
23955
|
+
status: {
|
|
23956
|
+
schema: NetworkLinkStatusSchema,
|
|
23957
|
+
kind: "push",
|
|
23958
|
+
empty: {
|
|
23959
|
+
type: "unknown",
|
|
23960
|
+
signalPercent: null,
|
|
23961
|
+
lastUpdated: 0
|
|
23962
|
+
}
|
|
23963
|
+
},
|
|
23964
|
+
/**
|
|
23965
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
23966
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
23967
|
+
* Home Assistant projector regardless of the driver.
|
|
23968
|
+
*/
|
|
23969
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
23970
|
+
/**
|
|
23971
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
23972
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
23973
|
+
* restored slice is what the badge shows until the next read.
|
|
23974
|
+
*
|
|
23975
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23976
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
23977
|
+
*/
|
|
23978
|
+
durability: "restored",
|
|
23979
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
23980
|
+
* whether persisting is worth a SQLite commit. */
|
|
23981
|
+
volatileStateFields: ["lastUpdated"]
|
|
23982
|
+
};
|
|
23983
|
+
/**
|
|
23895
23984
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
23896
23985
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
23897
23986
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -32276,6 +32365,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32276
32365
|
motionTrigger: motionTriggerCapability,
|
|
32277
32366
|
motionZones: motionZonesCapability,
|
|
32278
32367
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32368
|
+
networkLink: networkLinkCapability,
|
|
32279
32369
|
notifier: notifierCapability,
|
|
32280
32370
|
numericSensor: numericSensorCapability,
|
|
32281
32371
|
petFeeder: petFeederCapability,
|