@camstack/addon-provider-ecowitt 0.2.23 → 0.2.25

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