@camstack/addon-terminal 0.1.73 → 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 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-BZL-fdNj.mjs
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
@@ -19407,6 +19414,33 @@ var RecentTracksQueryInput = object({
19407
19414
  */
19408
19415
  classes: array(string()).optional()
19409
19416
  });
19417
+ /**
19418
+ * A Summary (D359): the per-camera session envelope that references tracks.
19419
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19420
+ * served by the event-media plane by key), null until the first frame with a
19421
+ * member visible has been materialised.
19422
+ */
19423
+ var SummarySchema = object({
19424
+ id: string(),
19425
+ deviceId: number(),
19426
+ openedAt: number(),
19427
+ lastActiveAt: number(),
19428
+ sealedAt: number().nullable(),
19429
+ memberCount: number().int().nonnegative(),
19430
+ groupShotKey: string().nullable()
19431
+ });
19432
+ var SummariesQueryInput = object({
19433
+ deviceIds: array(number()).min(1),
19434
+ since: number().optional(),
19435
+ until: number().optional(),
19436
+ limit: number().int().min(1).max(200).default(50)
19437
+ });
19438
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19439
+ var SummaryDetailSchema = object({
19440
+ summary: SummarySchema,
19441
+ /** Member track ids, in absorption order. */
19442
+ trackIds: array(string()).readonly()
19443
+ });
19410
19444
  var RecentTracksPageSchema = object({
19411
19445
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19412
19446
  tracks: array(TrackSchema).readonly(),
@@ -19807,7 +19841,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19807
19841
  * timeline would read as a camera that saw nothing.
19808
19842
  */
19809
19843
  classes: array(string()).optional()
19810
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19844
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19811
19845
  kind: "mutation",
19812
19846
  auth: "admin"
19813
19847
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -23888,6 +23922,88 @@ onStatusChanged: { data: object({
23888
23922
  volatileStateFields: ["lastUpdated"]
23889
23923
  };
23890
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
+ /**
23891
24007
  * Generic boolean sensor — last-resort fallback when no domain-
23892
24008
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23893
24009
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32272,6 +32388,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32272
32388
  motionTrigger: motionTriggerCapability,
32273
32389
  motionZones: motionZonesCapability,
32274
32390
  nativeObjectDetection: nativeObjectDetectionCapability,
32391
+ networkLink: networkLinkCapability,
32275
32392
  notifier: notifierCapability,
32276
32393
  numericSensor: numericSensorCapability,
32277
32394
  petFeeder: petFeederCapability,
@@ -36322,6 +36439,12 @@ Object.freeze({
36322
36439
  addonId: null,
36323
36440
  access: "view"
36324
36441
  },
36442
+ "pipelineAnalytics.getSummary": {
36443
+ capName: "pipeline-analytics",
36444
+ capScope: "device",
36445
+ addonId: null,
36446
+ access: "view"
36447
+ },
36325
36448
  "pipelineAnalytics.getTrack": {
36326
36449
  capName: "pipeline-analytics",
36327
36450
  capScope: "device",
@@ -36400,6 +36523,12 @@ Object.freeze({
36400
36523
  addonId: null,
36401
36524
  access: "view"
36402
36525
  },
36526
+ "pipelineAnalytics.listSummaries": {
36527
+ capName: "pipeline-analytics",
36528
+ capScope: "device",
36529
+ addonId: null,
36530
+ access: "view"
36531
+ },
36403
36532
  "pipelineAnalytics.listTrackMedia": {
36404
36533
  capName: "pipeline-analytics",
36405
36534
  capScope: "device",
@@ -40095,6 +40224,11 @@ Object.freeze({
40095
40224
  form: "array",
40096
40225
  optional: true
40097
40226
  }],
40227
+ "pipelineAnalytics.listSummaries": [{
40228
+ name: "deviceIds",
40229
+ form: "array",
40230
+ optional: false
40231
+ }],
40098
40232
  "pipelineAnalytics.listTrackMedia": [{
40099
40233
  name: "deviceId",
40100
40234
  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-BZL-fdNj.mjs
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
@@ -19384,6 +19391,33 @@ var RecentTracksQueryInput = object({
19384
19391
  */
19385
19392
  classes: array(string()).optional()
19386
19393
  });
19394
+ /**
19395
+ * A Summary (D359): the per-camera session envelope that references tracks.
19396
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19397
+ * served by the event-media plane by key), null until the first frame with a
19398
+ * member visible has been materialised.
19399
+ */
19400
+ var SummarySchema = object({
19401
+ id: string(),
19402
+ deviceId: number(),
19403
+ openedAt: number(),
19404
+ lastActiveAt: number(),
19405
+ sealedAt: number().nullable(),
19406
+ memberCount: number().int().nonnegative(),
19407
+ groupShotKey: string().nullable()
19408
+ });
19409
+ var SummariesQueryInput = object({
19410
+ deviceIds: array(number()).min(1),
19411
+ since: number().optional(),
19412
+ until: number().optional(),
19413
+ limit: number().int().min(1).max(200).default(50)
19414
+ });
19415
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19416
+ var SummaryDetailSchema = object({
19417
+ summary: SummarySchema,
19418
+ /** Member track ids, in absorption order. */
19419
+ trackIds: array(string()).readonly()
19420
+ });
19387
19421
  var RecentTracksPageSchema = object({
19388
19422
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19389
19423
  tracks: array(TrackSchema).readonly(),
@@ -19784,7 +19818,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19784
19818
  * timeline would read as a camera that saw nothing.
19785
19819
  */
19786
19820
  classes: array(string()).optional()
19787
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19821
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19788
19822
  kind: "mutation",
19789
19823
  auth: "admin"
19790
19824
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -23865,6 +23899,88 @@ onStatusChanged: { data: object({
23865
23899
  volatileStateFields: ["lastUpdated"]
23866
23900
  };
23867
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
+ /**
23868
23984
  * Generic boolean sensor — last-resort fallback when no domain-
23869
23985
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23870
23986
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32249,6 +32365,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32249
32365
  motionTrigger: motionTriggerCapability,
32250
32366
  motionZones: motionZonesCapability,
32251
32367
  nativeObjectDetection: nativeObjectDetectionCapability,
32368
+ networkLink: networkLinkCapability,
32252
32369
  notifier: notifierCapability,
32253
32370
  numericSensor: numericSensorCapability,
32254
32371
  petFeeder: petFeederCapability,
@@ -36299,6 +36416,12 @@ Object.freeze({
36299
36416
  addonId: null,
36300
36417
  access: "view"
36301
36418
  },
36419
+ "pipelineAnalytics.getSummary": {
36420
+ capName: "pipeline-analytics",
36421
+ capScope: "device",
36422
+ addonId: null,
36423
+ access: "view"
36424
+ },
36302
36425
  "pipelineAnalytics.getTrack": {
36303
36426
  capName: "pipeline-analytics",
36304
36427
  capScope: "device",
@@ -36377,6 +36500,12 @@ Object.freeze({
36377
36500
  addonId: null,
36378
36501
  access: "view"
36379
36502
  },
36503
+ "pipelineAnalytics.listSummaries": {
36504
+ capName: "pipeline-analytics",
36505
+ capScope: "device",
36506
+ addonId: null,
36507
+ access: "view"
36508
+ },
36380
36509
  "pipelineAnalytics.listTrackMedia": {
36381
36510
  capName: "pipeline-analytics",
36382
36511
  capScope: "device",
@@ -40072,6 +40201,11 @@ Object.freeze({
40072
40201
  form: "array",
40073
40202
  optional: true
40074
40203
  }],
40204
+ "pipelineAnalytics.listSummaries": [{
40205
+ name: "deviceIds",
40206
+ form: "array",
40207
+ optional: false
40208
+ }],
40075
40209
  "pipelineAnalytics.listTrackMedia": [{
40076
40210
  name: "deviceId",
40077
40211
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-terminal",
3
- "version": "0.1.73",
3
+ "version": "0.1.75",
4
4
  "description": "Interactive terminal sessions (pty + xterm) as a CamStack addon",
5
5
  "keywords": [
6
6
  "camstack",