@camstack/addon-provider-vesync 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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-XfKNtfCc.mjs
2
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -15,6 +15,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
15
15
  */
16
16
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
17
17
  /**
18
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
19
+ * Emitted only when the material on disk actually changed, so an
20
+ * operator who trusted the old certificate by hand is told rather than
21
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
22
+ *
23
+ * Rule: docs/decisions/adr-0227-*.md
24
+ */
25
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
26
+ /**
18
27
  * A newer addon or server-root package version was found by the
19
28
  * authoritative registry check. Emitted once when any observed
20
29
  * `latestVersion` changes (or a package/node first appears behind);
@@ -18981,6 +18990,12 @@ var CameraStatusSchema = object({
18981
18990
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
18982
18991
  fetchedAt: number()
18983
18992
  });
18993
+ var InferenceDeviceExclusionReasonSchema = _enum([
18994
+ "disabled",
18995
+ "unavailable",
18996
+ "cannot-host-camera-root",
18997
+ "accelerator-preferred"
18998
+ ]);
18984
18999
  var NodeInferenceDeviceSchema = object({
18985
19000
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
18986
19001
  key: string(),
@@ -19011,7 +19026,17 @@ var NodeInferenceDeviceSchema = object({
19011
19026
  * available per format; this is the stored selection that becomes the
19012
19027
  * default for EVERY camera landing on this accelerator.
19013
19028
  */
19014
- steps: record(string(), DeviceStepConfigSchema).optional()
19029
+ steps: record(string(), DeviceStepConfigSchema).optional(),
19030
+ /**
19031
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19032
+ * the reason the dispatcher drops it. Computed by the SAME
19033
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19034
+ * never disagree with the election — deriving it in the UI from
19035
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19036
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19037
+ * "an accelerator is serving" predicate).
19038
+ */
19039
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19015
19040
  });
19016
19041
  var NodeInferenceDevicesSchema = object({
19017
19042
  nodeId: string(),
@@ -23862,7 +23887,12 @@ var ListResultSchema = object({
23862
23887
  probedAt: number()
23863
23888
  });
23864
23889
  var PreferredSchema = LocalInterfaceSchema.nullable();
23865
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23890
+ /**
23891
+ * Candidate base URL for the SDK to race on connect. Order matters —
23892
+ * the SDK should attempt these top-to-bottom with a short per-candidate
23893
+ * timeout (e.g. 1500ms) and cache the winner for the session.
23894
+ */
23895
+ var ConnectionEndpointSchema = object({
23866
23896
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
23867
23897
  label: string(),
23868
23898
  /** Fully-formed base URL with scheme + host + port. */
@@ -23905,7 +23935,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23905
23935
  * ordering between polls.
23906
23936
  */
23907
23937
  priority: number()
23908
- })).readonly() });
23938
+ });
23939
+ /**
23940
+ * Where the advertised local port came from. Ordered most → least
23941
+ * authoritative, and the whole point of returning it: a client must be able to
23942
+ * tell a FACT about the hub's socket from an echo of its own guess.
23943
+ */
23944
+ var LocalPortSourceEnum = _enum([
23945
+ "server-config",
23946
+ "server-env",
23947
+ "caller-hint",
23948
+ "default"
23949
+ ]);
23950
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
23951
+ var AdvertisedLocalPortSchema = object({
23952
+ port: number().int().min(1).max(65535),
23953
+ source: LocalPortSourceEnum
23954
+ });
23955
+ var GetConnectionEndpointsResultSchema = object({
23956
+ endpoints: array(ConnectionEndpointSchema).readonly(),
23957
+ /**
23958
+ * The port the hub built the LAN/loopback URLs with, and where that number
23959
+ * came from.
23960
+ *
23961
+ * Returned rather than merely applied, because "the URL is right" and "the
23962
+ * client can KNOW the URL is right" are different properties. A client that
23963
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
23964
+ * a hub that echoed the port the client sent, so it cannot decide whether to
23965
+ * race the candidate or discard it. With `source` it can: anything but
23966
+ * `caller-hint` is the hub's own socket.
23967
+ *
23968
+ * Absent on hubs predating this field — a client that finds it missing is
23969
+ * talking to an echoing hub and must degrade exactly as it does for
23970
+ * `caller-hint`.
23971
+ */
23972
+ localPort: AdvertisedLocalPortSchema
23973
+ });
23909
23974
  /**
23910
23975
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23911
23976
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -23926,8 +23991,13 @@ var AllowedAddressesSchema = object({
23926
23991
  */
23927
23992
  addresses: array(string()).readonly() });
23928
23993
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
23929
- /** Local hub HTTP port to use in base URLs. */
23930
- port: number().int().min(1).max(65535),
23994
+ /**
23995
+ * LEGACY HINT — do not send from new code. Kept optional so clients
23996
+ * written against the echoing contract keep working; the hub uses it
23997
+ * only when it cannot read its own port, and says so via
23998
+ * `localPort.source === 'caller-hint'`.
23999
+ */
24000
+ port: number().int().min(1).max(65535).optional(),
23931
24001
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
23932
24002
  * candidate. Default `true`. */
23933
24003
  includeLoopback: boolean().optional(),
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-XfKNtfCc.mjs
1
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -14,6 +14,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
14
14
  */
15
15
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
16
16
  /**
17
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
18
+ * Emitted only when the material on disk actually changed, so an
19
+ * operator who trusted the old certificate by hand is told rather than
20
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
21
+ *
22
+ * Rule: docs/decisions/adr-0227-*.md
23
+ */
24
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
25
+ /**
17
26
  * A newer addon or server-root package version was found by the
18
27
  * authoritative registry check. Emitted once when any observed
19
28
  * `latestVersion` changes (or a package/node first appears behind);
@@ -18980,6 +18989,12 @@ var CameraStatusSchema = object({
18980
18989
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
18981
18990
  fetchedAt: number()
18982
18991
  });
18992
+ var InferenceDeviceExclusionReasonSchema = _enum([
18993
+ "disabled",
18994
+ "unavailable",
18995
+ "cannot-host-camera-root",
18996
+ "accelerator-preferred"
18997
+ ]);
18983
18998
  var NodeInferenceDeviceSchema = object({
18984
18999
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
18985
19000
  key: string(),
@@ -19010,7 +19025,17 @@ var NodeInferenceDeviceSchema = object({
19010
19025
  * available per format; this is the stored selection that becomes the
19011
19026
  * default for EVERY camera landing on this accelerator.
19012
19027
  */
19013
- steps: record(string(), DeviceStepConfigSchema).optional()
19028
+ steps: record(string(), DeviceStepConfigSchema).optional(),
19029
+ /**
19030
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19031
+ * the reason the dispatcher drops it. Computed by the SAME
19032
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19033
+ * never disagree with the election — deriving it in the UI from
19034
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19035
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19036
+ * "an accelerator is serving" predicate).
19037
+ */
19038
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19014
19039
  });
19015
19040
  var NodeInferenceDevicesSchema = object({
19016
19041
  nodeId: string(),
@@ -23861,7 +23886,12 @@ var ListResultSchema = object({
23861
23886
  probedAt: number()
23862
23887
  });
23863
23888
  var PreferredSchema = LocalInterfaceSchema.nullable();
23864
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23889
+ /**
23890
+ * Candidate base URL for the SDK to race on connect. Order matters —
23891
+ * the SDK should attempt these top-to-bottom with a short per-candidate
23892
+ * timeout (e.g. 1500ms) and cache the winner for the session.
23893
+ */
23894
+ var ConnectionEndpointSchema = object({
23865
23895
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
23866
23896
  label: string(),
23867
23897
  /** Fully-formed base URL with scheme + host + port. */
@@ -23904,7 +23934,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23904
23934
  * ordering between polls.
23905
23935
  */
23906
23936
  priority: number()
23907
- })).readonly() });
23937
+ });
23938
+ /**
23939
+ * Where the advertised local port came from. Ordered most → least
23940
+ * authoritative, and the whole point of returning it: a client must be able to
23941
+ * tell a FACT about the hub's socket from an echo of its own guess.
23942
+ */
23943
+ var LocalPortSourceEnum = _enum([
23944
+ "server-config",
23945
+ "server-env",
23946
+ "caller-hint",
23947
+ "default"
23948
+ ]);
23949
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
23950
+ var AdvertisedLocalPortSchema = object({
23951
+ port: number().int().min(1).max(65535),
23952
+ source: LocalPortSourceEnum
23953
+ });
23954
+ var GetConnectionEndpointsResultSchema = object({
23955
+ endpoints: array(ConnectionEndpointSchema).readonly(),
23956
+ /**
23957
+ * The port the hub built the LAN/loopback URLs with, and where that number
23958
+ * came from.
23959
+ *
23960
+ * Returned rather than merely applied, because "the URL is right" and "the
23961
+ * client can KNOW the URL is right" are different properties. A client that
23962
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
23963
+ * a hub that echoed the port the client sent, so it cannot decide whether to
23964
+ * race the candidate or discard it. With `source` it can: anything but
23965
+ * `caller-hint` is the hub's own socket.
23966
+ *
23967
+ * Absent on hubs predating this field — a client that finds it missing is
23968
+ * talking to an echoing hub and must degrade exactly as it does for
23969
+ * `caller-hint`.
23970
+ */
23971
+ localPort: AdvertisedLocalPortSchema
23972
+ });
23908
23973
  /**
23909
23974
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23910
23975
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -23925,8 +23990,13 @@ var AllowedAddressesSchema = object({
23925
23990
  */
23926
23991
  addresses: array(string()).readonly() });
23927
23992
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
23928
- /** Local hub HTTP port to use in base URLs. */
23929
- port: number().int().min(1).max(65535),
23993
+ /**
23994
+ * LEGACY HINT — do not send from new code. Kept optional so clients
23995
+ * written against the echoing contract keep working; the hub uses it
23996
+ * only when it cannot read its own port, and says so via
23997
+ * `localPort.source === 'caller-hint'`.
23998
+ */
23999
+ port: number().int().min(1).max(65535).optional(),
23930
24000
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
23931
24001
  * candidate. Default `true`. */
23932
24002
  includeLoopback: boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-vesync",
3
- "version": "0.2.24",
3
+ "version": "0.2.26",
4
4
  "description": "VeSync cloud-account device-provider addon for CamStack — Levoit / Cosori air purifiers as Fan devices (power, speed, preset, child-lock, display, air-quality + filter-life sensors)",
5
5
  "keywords": [
6
6
  "camstack",