@camstack/addon-provider-wyze 0.2.28 → 0.2.30

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 net = require("net");
31
31
  net = __toESM(net, 1);
32
32
  let node_child_process = require("node:child_process");
33
33
  let node_tls = require("node:tls");
34
- //#region ../types/dist/event-category-XfKNtfCc.mjs
34
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
35
35
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
36
36
  EventCategory["SystemBoot"] = "system.boot";
37
37
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -47,6 +47,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
47
47
  */
48
48
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
49
49
  /**
50
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
51
+ * Emitted only when the material on disk actually changed, so an
52
+ * operator who trusted the old certificate by hand is told rather than
53
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
54
+ *
55
+ * Rule: docs/decisions/adr-0227-*.md
56
+ */
57
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
58
+ /**
50
59
  * A newer addon or server-root package version was found by the
51
60
  * authoritative registry check. Emitted once when any observed
52
61
  * `latestVersion` changes (or a package/node first appears behind);
@@ -19030,6 +19039,12 @@ var CameraStatusSchema = object({
19030
19039
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19031
19040
  fetchedAt: number()
19032
19041
  });
19042
+ var InferenceDeviceExclusionReasonSchema = _enum([
19043
+ "disabled",
19044
+ "unavailable",
19045
+ "cannot-host-camera-root",
19046
+ "accelerator-preferred"
19047
+ ]);
19033
19048
  var NodeInferenceDeviceSchema = object({
19034
19049
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
19035
19050
  key: string(),
@@ -19060,7 +19075,17 @@ var NodeInferenceDeviceSchema = object({
19060
19075
  * available per format; this is the stored selection that becomes the
19061
19076
  * default for EVERY camera landing on this accelerator.
19062
19077
  */
19063
- steps: record(string(), DeviceStepConfigSchema).optional()
19078
+ steps: record(string(), DeviceStepConfigSchema).optional(),
19079
+ /**
19080
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19081
+ * the reason the dispatcher drops it. Computed by the SAME
19082
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19083
+ * never disagree with the election — deriving it in the UI from
19084
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19085
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19086
+ * "an accelerator is serving" predicate).
19087
+ */
19088
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19064
19089
  });
19065
19090
  var NodeInferenceDevicesSchema = object({
19066
19091
  nodeId: string(),
@@ -24023,7 +24048,12 @@ var ListResultSchema = object({
24023
24048
  probedAt: number()
24024
24049
  });
24025
24050
  var PreferredSchema = LocalInterfaceSchema.nullable();
24026
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
24051
+ /**
24052
+ * Candidate base URL for the SDK to race on connect. Order matters —
24053
+ * the SDK should attempt these top-to-bottom with a short per-candidate
24054
+ * timeout (e.g. 1500ms) and cache the winner for the session.
24055
+ */
24056
+ var ConnectionEndpointSchema = object({
24027
24057
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
24028
24058
  label: string(),
24029
24059
  /** Fully-formed base URL with scheme + host + port. */
@@ -24066,7 +24096,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
24066
24096
  * ordering between polls.
24067
24097
  */
24068
24098
  priority: number()
24069
- })).readonly() });
24099
+ });
24100
+ /**
24101
+ * Where the advertised local port came from. Ordered most → least
24102
+ * authoritative, and the whole point of returning it: a client must be able to
24103
+ * tell a FACT about the hub's socket from an echo of its own guess.
24104
+ */
24105
+ var LocalPortSourceEnum = _enum([
24106
+ "server-config",
24107
+ "server-env",
24108
+ "caller-hint",
24109
+ "default"
24110
+ ]);
24111
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
24112
+ var AdvertisedLocalPortSchema = object({
24113
+ port: number().int().min(1).max(65535),
24114
+ source: LocalPortSourceEnum
24115
+ });
24116
+ var GetConnectionEndpointsResultSchema = object({
24117
+ endpoints: array(ConnectionEndpointSchema).readonly(),
24118
+ /**
24119
+ * The port the hub built the LAN/loopback URLs with, and where that number
24120
+ * came from.
24121
+ *
24122
+ * Returned rather than merely applied, because "the URL is right" and "the
24123
+ * client can KNOW the URL is right" are different properties. A client that
24124
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
24125
+ * a hub that echoed the port the client sent, so it cannot decide whether to
24126
+ * race the candidate or discard it. With `source` it can: anything but
24127
+ * `caller-hint` is the hub's own socket.
24128
+ *
24129
+ * Absent on hubs predating this field — a client that finds it missing is
24130
+ * talking to an echoing hub and must degrade exactly as it does for
24131
+ * `caller-hint`.
24132
+ */
24133
+ localPort: AdvertisedLocalPortSchema
24134
+ });
24070
24135
  /**
24071
24136
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
24072
24137
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -24087,8 +24152,13 @@ var AllowedAddressesSchema = object({
24087
24152
  */
24088
24153
  addresses: array(string()).readonly() });
24089
24154
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24090
- /** Local hub HTTP port to use in base URLs. */
24091
- port: number().int().min(1).max(65535),
24155
+ /**
24156
+ * LEGACY HINT — do not send from new code. Kept optional so clients
24157
+ * written against the echoing contract keep working; the hub uses it
24158
+ * only when it cannot read its own port, and says so via
24159
+ * `localPort.source === 'caller-hint'`.
24160
+ */
24161
+ port: number().int().min(1).max(65535).optional(),
24092
24162
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24093
24163
  * candidate. Default `true`. */
24094
24164
  includeLoopback: boolean().optional(),
package/dist/addon.mjs CHANGED
@@ -10,7 +10,7 @@ import { getCACertificates, setDefaultCACertificates } from "node:tls";
10
10
  //#region \0rolldown/runtime.js
11
11
  var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
12
12
  //#endregion
13
- //#region ../types/dist/event-category-XfKNtfCc.mjs
13
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
14
14
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
15
15
  EventCategory["SystemBoot"] = "system.boot";
16
16
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -26,6 +26,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
26
26
  */
27
27
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
28
28
  /**
29
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
30
+ * Emitted only when the material on disk actually changed, so an
31
+ * operator who trusted the old certificate by hand is told rather than
32
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
33
+ *
34
+ * Rule: docs/decisions/adr-0227-*.md
35
+ */
36
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
37
+ /**
29
38
  * A newer addon or server-root package version was found by the
30
39
  * authoritative registry check. Emitted once when any observed
31
40
  * `latestVersion` changes (or a package/node first appears behind);
@@ -19009,6 +19018,12 @@ var CameraStatusSchema = object({
19009
19018
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19010
19019
  fetchedAt: number()
19011
19020
  });
19021
+ var InferenceDeviceExclusionReasonSchema = _enum([
19022
+ "disabled",
19023
+ "unavailable",
19024
+ "cannot-host-camera-root",
19025
+ "accelerator-preferred"
19026
+ ]);
19012
19027
  var NodeInferenceDeviceSchema = object({
19013
19028
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
19014
19029
  key: string(),
@@ -19039,7 +19054,17 @@ var NodeInferenceDeviceSchema = object({
19039
19054
  * available per format; this is the stored selection that becomes the
19040
19055
  * default for EVERY camera landing on this accelerator.
19041
19056
  */
19042
- steps: record(string(), DeviceStepConfigSchema).optional()
19057
+ steps: record(string(), DeviceStepConfigSchema).optional(),
19058
+ /**
19059
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19060
+ * the reason the dispatcher drops it. Computed by the SAME
19061
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19062
+ * never disagree with the election — deriving it in the UI from
19063
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19064
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19065
+ * "an accelerator is serving" predicate).
19066
+ */
19067
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19043
19068
  });
19044
19069
  var NodeInferenceDevicesSchema = object({
19045
19070
  nodeId: string(),
@@ -24002,7 +24027,12 @@ var ListResultSchema = object({
24002
24027
  probedAt: number()
24003
24028
  });
24004
24029
  var PreferredSchema = LocalInterfaceSchema.nullable();
24005
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
24030
+ /**
24031
+ * Candidate base URL for the SDK to race on connect. Order matters —
24032
+ * the SDK should attempt these top-to-bottom with a short per-candidate
24033
+ * timeout (e.g. 1500ms) and cache the winner for the session.
24034
+ */
24035
+ var ConnectionEndpointSchema = object({
24006
24036
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
24007
24037
  label: string(),
24008
24038
  /** Fully-formed base URL with scheme + host + port. */
@@ -24045,7 +24075,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
24045
24075
  * ordering between polls.
24046
24076
  */
24047
24077
  priority: number()
24048
- })).readonly() });
24078
+ });
24079
+ /**
24080
+ * Where the advertised local port came from. Ordered most → least
24081
+ * authoritative, and the whole point of returning it: a client must be able to
24082
+ * tell a FACT about the hub's socket from an echo of its own guess.
24083
+ */
24084
+ var LocalPortSourceEnum = _enum([
24085
+ "server-config",
24086
+ "server-env",
24087
+ "caller-hint",
24088
+ "default"
24089
+ ]);
24090
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
24091
+ var AdvertisedLocalPortSchema = object({
24092
+ port: number().int().min(1).max(65535),
24093
+ source: LocalPortSourceEnum
24094
+ });
24095
+ var GetConnectionEndpointsResultSchema = object({
24096
+ endpoints: array(ConnectionEndpointSchema).readonly(),
24097
+ /**
24098
+ * The port the hub built the LAN/loopback URLs with, and where that number
24099
+ * came from.
24100
+ *
24101
+ * Returned rather than merely applied, because "the URL is right" and "the
24102
+ * client can KNOW the URL is right" are different properties. A client that
24103
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
24104
+ * a hub that echoed the port the client sent, so it cannot decide whether to
24105
+ * race the candidate or discard it. With `source` it can: anything but
24106
+ * `caller-hint` is the hub's own socket.
24107
+ *
24108
+ * Absent on hubs predating this field — a client that finds it missing is
24109
+ * talking to an echoing hub and must degrade exactly as it does for
24110
+ * `caller-hint`.
24111
+ */
24112
+ localPort: AdvertisedLocalPortSchema
24113
+ });
24049
24114
  /**
24050
24115
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
24051
24116
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -24066,8 +24131,13 @@ var AllowedAddressesSchema = object({
24066
24131
  */
24067
24132
  addresses: array(string()).readonly() });
24068
24133
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24069
- /** Local hub HTTP port to use in base URLs. */
24070
- port: number().int().min(1).max(65535),
24134
+ /**
24135
+ * LEGACY HINT — do not send from new code. Kept optional so clients
24136
+ * written against the echoing contract keep working; the hub uses it
24137
+ * only when it cannot read its own port, and says so via
24138
+ * `localPort.source === 'caller-hint'`.
24139
+ */
24140
+ port: number().int().min(1).max(65535).optional(),
24071
24141
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24072
24142
  * candidate. Default `true`. */
24073
24143
  includeLoopback: boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-wyze",
3
- "version": "0.2.28",
3
+ "version": "0.2.30",
4
4
  "description": "Wyze camera device-provider addon for CamStack — wraps the @apocaliss92/wyze-bridge-js P2P/DTLS client, feeding the stream-broker via the pull-rfc4571 lazy-publish path (a structural twin of addon-provider-reolink)",
5
5
  "keywords": [
6
6
  "camstack",