@camstack/addon-provider-dreo 0.2.24 → 0.2.26

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
@@ -35,7 +35,7 @@ var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["modu
35
35
  //#endregion
36
36
  let crypto$1 = require("crypto");
37
37
  let events = require("events");
38
- //#region ../types/dist/event-category-XfKNtfCc.mjs
38
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
39
39
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
40
40
  EventCategory["SystemBoot"] = "system.boot";
41
41
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -51,6 +51,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
51
51
  */
52
52
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
53
53
  /**
54
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
55
+ * Emitted only when the material on disk actually changed, so an
56
+ * operator who trusted the old certificate by hand is told rather than
57
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
58
+ *
59
+ * Rule: docs/decisions/adr-0227-*.md
60
+ */
61
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
62
+ /**
54
63
  * A newer addon or server-root package version was found by the
55
64
  * authoritative registry check. Emitted once when any observed
56
65
  * `latestVersion` changes (or a package/node first appears behind);
@@ -19034,6 +19043,12 @@ var CameraStatusSchema = object({
19034
19043
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19035
19044
  fetchedAt: number()
19036
19045
  });
19046
+ var InferenceDeviceExclusionReasonSchema = _enum([
19047
+ "disabled",
19048
+ "unavailable",
19049
+ "cannot-host-camera-root",
19050
+ "accelerator-preferred"
19051
+ ]);
19037
19052
  var NodeInferenceDeviceSchema = object({
19038
19053
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
19039
19054
  key: string(),
@@ -19064,7 +19079,17 @@ var NodeInferenceDeviceSchema = object({
19064
19079
  * available per format; this is the stored selection that becomes the
19065
19080
  * default for EVERY camera landing on this accelerator.
19066
19081
  */
19067
- steps: record(string(), DeviceStepConfigSchema).optional()
19082
+ steps: record(string(), DeviceStepConfigSchema).optional(),
19083
+ /**
19084
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19085
+ * the reason the dispatcher drops it. Computed by the SAME
19086
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19087
+ * never disagree with the election — deriving it in the UI from
19088
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19089
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19090
+ * "an accelerator is serving" predicate).
19091
+ */
19092
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19068
19093
  });
19069
19094
  var NodeInferenceDevicesSchema = object({
19070
19095
  nodeId: string(),
@@ -23923,7 +23948,12 @@ var ListResultSchema = object({
23923
23948
  probedAt: number()
23924
23949
  });
23925
23950
  var PreferredSchema = LocalInterfaceSchema.nullable();
23926
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23951
+ /**
23952
+ * Candidate base URL for the SDK to race on connect. Order matters —
23953
+ * the SDK should attempt these top-to-bottom with a short per-candidate
23954
+ * timeout (e.g. 1500ms) and cache the winner for the session.
23955
+ */
23956
+ var ConnectionEndpointSchema = object({
23927
23957
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
23928
23958
  label: string(),
23929
23959
  /** Fully-formed base URL with scheme + host + port. */
@@ -23966,7 +23996,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23966
23996
  * ordering between polls.
23967
23997
  */
23968
23998
  priority: number()
23969
- })).readonly() });
23999
+ });
24000
+ /**
24001
+ * Where the advertised local port came from. Ordered most → least
24002
+ * authoritative, and the whole point of returning it: a client must be able to
24003
+ * tell a FACT about the hub's socket from an echo of its own guess.
24004
+ */
24005
+ var LocalPortSourceEnum = _enum([
24006
+ "server-config",
24007
+ "server-env",
24008
+ "caller-hint",
24009
+ "default"
24010
+ ]);
24011
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
24012
+ var AdvertisedLocalPortSchema = object({
24013
+ port: number().int().min(1).max(65535),
24014
+ source: LocalPortSourceEnum
24015
+ });
24016
+ var GetConnectionEndpointsResultSchema = object({
24017
+ endpoints: array(ConnectionEndpointSchema).readonly(),
24018
+ /**
24019
+ * The port the hub built the LAN/loopback URLs with, and where that number
24020
+ * came from.
24021
+ *
24022
+ * Returned rather than merely applied, because "the URL is right" and "the
24023
+ * client can KNOW the URL is right" are different properties. A client that
24024
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
24025
+ * a hub that echoed the port the client sent, so it cannot decide whether to
24026
+ * race the candidate or discard it. With `source` it can: anything but
24027
+ * `caller-hint` is the hub's own socket.
24028
+ *
24029
+ * Absent on hubs predating this field — a client that finds it missing is
24030
+ * talking to an echoing hub and must degrade exactly as it does for
24031
+ * `caller-hint`.
24032
+ */
24033
+ localPort: AdvertisedLocalPortSchema
24034
+ });
23970
24035
  /**
23971
24036
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23972
24037
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -23987,8 +24052,13 @@ var AllowedAddressesSchema = object({
23987
24052
  */
23988
24053
  addresses: array(string()).readonly() });
23989
24054
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
23990
- /** Local hub HTTP port to use in base URLs. */
23991
- port: number().int().min(1).max(65535),
24055
+ /**
24056
+ * LEGACY HINT — do not send from new code. Kept optional so clients
24057
+ * written against the echoing contract keep working; the hub uses it
24058
+ * only when it cannot read its own port, and says so via
24059
+ * `localPort.source === 'caller-hint'`.
24060
+ */
24061
+ port: number().int().min(1).max(65535).optional(),
23992
24062
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
23993
24063
  * candidate. Default `true`. */
23994
24064
  includeLoopback: boolean().optional(),
package/dist/addon.mjs CHANGED
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
37
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
38
38
  //#endregion
39
- //#region ../types/dist/event-category-XfKNtfCc.mjs
39
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
40
40
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
41
41
  EventCategory["SystemBoot"] = "system.boot";
42
42
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -52,6 +52,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
52
52
  */
53
53
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
54
54
  /**
55
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
56
+ * Emitted only when the material on disk actually changed, so an
57
+ * operator who trusted the old certificate by hand is told rather than
58
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
59
+ *
60
+ * Rule: docs/decisions/adr-0227-*.md
61
+ */
62
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
63
+ /**
55
64
  * A newer addon or server-root package version was found by the
56
65
  * authoritative registry check. Emitted once when any observed
57
66
  * `latestVersion` changes (or a package/node first appears behind);
@@ -19035,6 +19044,12 @@ var CameraStatusSchema = object({
19035
19044
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19036
19045
  fetchedAt: number()
19037
19046
  });
19047
+ var InferenceDeviceExclusionReasonSchema = _enum([
19048
+ "disabled",
19049
+ "unavailable",
19050
+ "cannot-host-camera-root",
19051
+ "accelerator-preferred"
19052
+ ]);
19038
19053
  var NodeInferenceDeviceSchema = object({
19039
19054
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
19040
19055
  key: string(),
@@ -19065,7 +19080,17 @@ var NodeInferenceDeviceSchema = object({
19065
19080
  * available per format; this is the stored selection that becomes the
19066
19081
  * default for EVERY camera landing on this accelerator.
19067
19082
  */
19068
- steps: record(string(), DeviceStepConfigSchema).optional()
19083
+ steps: record(string(), DeviceStepConfigSchema).optional(),
19084
+ /**
19085
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19086
+ * the reason the dispatcher drops it. Computed by the SAME
19087
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19088
+ * never disagree with the election — deriving it in the UI from
19089
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19090
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19091
+ * "an accelerator is serving" predicate).
19092
+ */
19093
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19069
19094
  });
19070
19095
  var NodeInferenceDevicesSchema = object({
19071
19096
  nodeId: string(),
@@ -23924,7 +23949,12 @@ var ListResultSchema = object({
23924
23949
  probedAt: number()
23925
23950
  });
23926
23951
  var PreferredSchema = LocalInterfaceSchema.nullable();
23927
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23952
+ /**
23953
+ * Candidate base URL for the SDK to race on connect. Order matters —
23954
+ * the SDK should attempt these top-to-bottom with a short per-candidate
23955
+ * timeout (e.g. 1500ms) and cache the winner for the session.
23956
+ */
23957
+ var ConnectionEndpointSchema = object({
23928
23958
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
23929
23959
  label: string(),
23930
23960
  /** Fully-formed base URL with scheme + host + port. */
@@ -23967,7 +23997,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23967
23997
  * ordering between polls.
23968
23998
  */
23969
23999
  priority: number()
23970
- })).readonly() });
24000
+ });
24001
+ /**
24002
+ * Where the advertised local port came from. Ordered most → least
24003
+ * authoritative, and the whole point of returning it: a client must be able to
24004
+ * tell a FACT about the hub's socket from an echo of its own guess.
24005
+ */
24006
+ var LocalPortSourceEnum = _enum([
24007
+ "server-config",
24008
+ "server-env",
24009
+ "caller-hint",
24010
+ "default"
24011
+ ]);
24012
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
24013
+ var AdvertisedLocalPortSchema = object({
24014
+ port: number().int().min(1).max(65535),
24015
+ source: LocalPortSourceEnum
24016
+ });
24017
+ var GetConnectionEndpointsResultSchema = object({
24018
+ endpoints: array(ConnectionEndpointSchema).readonly(),
24019
+ /**
24020
+ * The port the hub built the LAN/loopback URLs with, and where that number
24021
+ * came from.
24022
+ *
24023
+ * Returned rather than merely applied, because "the URL is right" and "the
24024
+ * client can KNOW the URL is right" are different properties. A client that
24025
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
24026
+ * a hub that echoed the port the client sent, so it cannot decide whether to
24027
+ * race the candidate or discard it. With `source` it can: anything but
24028
+ * `caller-hint` is the hub's own socket.
24029
+ *
24030
+ * Absent on hubs predating this field — a client that finds it missing is
24031
+ * talking to an echoing hub and must degrade exactly as it does for
24032
+ * `caller-hint`.
24033
+ */
24034
+ localPort: AdvertisedLocalPortSchema
24035
+ });
23971
24036
  /**
23972
24037
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23973
24038
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -23988,8 +24053,13 @@ var AllowedAddressesSchema = object({
23988
24053
  */
23989
24054
  addresses: array(string()).readonly() });
23990
24055
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
23991
- /** Local hub HTTP port to use in base URLs. */
23992
- port: number().int().min(1).max(65535),
24056
+ /**
24057
+ * LEGACY HINT — do not send from new code. Kept optional so clients
24058
+ * written against the echoing contract keep working; the hub uses it
24059
+ * only when it cannot read its own port, and says so via
24060
+ * `localPort.source === 'caller-hint'`.
24061
+ */
24062
+ port: number().int().min(1).max(65535).optional(),
23993
24063
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
23994
24064
  * candidate. Default `true`. */
23995
24065
  includeLoopback: boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-dreo",
3
- "version": "0.2.24",
3
+ "version": "0.2.26",
4
4
  "description": "Dreo smart-device (fan / air-circulator / purifier / heater / humidifier) device-provider addon for CamStack — wraps the @apocaliss92/nodedreo Dreo cloud client (REST + WebSocket)",
5
5
  "keywords": [
6
6
  "camstack",