@camstack/addon-matter-broker 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
@@ -13,7 +13,7 @@ let node_stream_promises = require("node:stream/promises");
13
13
  let node_net = require("node:net");
14
14
  let node_dgram = require("node:dgram");
15
15
  node_dgram = require_esm.__toESM(node_dgram, 1);
16
- //#region ../types/dist/event-category-XfKNtfCc.mjs
16
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
17
17
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
18
18
  EventCategory["SystemBoot"] = "system.boot";
19
19
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -29,6 +29,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
29
29
  */
30
30
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
31
31
  /**
32
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
33
+ * Emitted only when the material on disk actually changed, so an
34
+ * operator who trusted the old certificate by hand is told rather than
35
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
36
+ *
37
+ * Rule: docs/decisions/adr-0227-*.md
38
+ */
39
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
40
+ /**
32
41
  * A newer addon or server-root package version was found by the
33
42
  * authoritative registry check. Emitted once when any observed
34
43
  * `latestVersion` changes (or a package/node first appears behind);
@@ -19061,6 +19070,12 @@ var CameraStatusSchema = object({
19061
19070
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19062
19071
  fetchedAt: number()
19063
19072
  });
19073
+ var InferenceDeviceExclusionReasonSchema = _enum([
19074
+ "disabled",
19075
+ "unavailable",
19076
+ "cannot-host-camera-root",
19077
+ "accelerator-preferred"
19078
+ ]);
19064
19079
  var NodeInferenceDeviceSchema = object({
19065
19080
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
19066
19081
  key: string$2(),
@@ -19091,7 +19106,17 @@ var NodeInferenceDeviceSchema = object({
19091
19106
  * available per format; this is the stored selection that becomes the
19092
19107
  * default for EVERY camera landing on this accelerator.
19093
19108
  */
19094
- steps: record(string$2(), DeviceStepConfigSchema).optional()
19109
+ steps: record(string$2(), DeviceStepConfigSchema).optional(),
19110
+ /**
19111
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19112
+ * the reason the dispatcher drops it. Computed by the SAME
19113
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19114
+ * never disagree with the election — deriving it in the UI from
19115
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19116
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19117
+ * "an accelerator is serving" predicate).
19118
+ */
19119
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19095
19120
  });
19096
19121
  var NodeInferenceDevicesSchema = object({
19097
19122
  nodeId: string$2(),
@@ -23959,7 +23984,12 @@ var ListResultSchema = object({
23959
23984
  probedAt: number()
23960
23985
  });
23961
23986
  var PreferredSchema = LocalInterfaceSchema.nullable();
23962
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23987
+ /**
23988
+ * Candidate base URL for the SDK to race on connect. Order matters —
23989
+ * the SDK should attempt these top-to-bottom with a short per-candidate
23990
+ * timeout (e.g. 1500ms) and cache the winner for the session.
23991
+ */
23992
+ var ConnectionEndpointSchema = object({
23963
23993
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
23964
23994
  label: string$2(),
23965
23995
  /** Fully-formed base URL with scheme + host + port. */
@@ -24002,7 +24032,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
24002
24032
  * ordering between polls.
24003
24033
  */
24004
24034
  priority: number()
24005
- })).readonly() });
24035
+ });
24036
+ /**
24037
+ * Where the advertised local port came from. Ordered most → least
24038
+ * authoritative, and the whole point of returning it: a client must be able to
24039
+ * tell a FACT about the hub's socket from an echo of its own guess.
24040
+ */
24041
+ var LocalPortSourceEnum = _enum([
24042
+ "server-config",
24043
+ "server-env",
24044
+ "caller-hint",
24045
+ "default"
24046
+ ]);
24047
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
24048
+ var AdvertisedLocalPortSchema = object({
24049
+ port: number().int().min(1).max(65535),
24050
+ source: LocalPortSourceEnum
24051
+ });
24052
+ var GetConnectionEndpointsResultSchema = object({
24053
+ endpoints: array(ConnectionEndpointSchema).readonly(),
24054
+ /**
24055
+ * The port the hub built the LAN/loopback URLs with, and where that number
24056
+ * came from.
24057
+ *
24058
+ * Returned rather than merely applied, because "the URL is right" and "the
24059
+ * client can KNOW the URL is right" are different properties. A client that
24060
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
24061
+ * a hub that echoed the port the client sent, so it cannot decide whether to
24062
+ * race the candidate or discard it. With `source` it can: anything but
24063
+ * `caller-hint` is the hub's own socket.
24064
+ *
24065
+ * Absent on hubs predating this field — a client that finds it missing is
24066
+ * talking to an echoing hub and must degrade exactly as it does for
24067
+ * `caller-hint`.
24068
+ */
24069
+ localPort: AdvertisedLocalPortSchema
24070
+ });
24006
24071
  /**
24007
24072
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
24008
24073
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -24023,8 +24088,13 @@ var AllowedAddressesSchema = object({
24023
24088
  */
24024
24089
  addresses: array(string$2()).readonly() });
24025
24090
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24026
- /** Local hub HTTP port to use in base URLs. */
24027
- port: number().int().min(1).max(65535),
24091
+ /**
24092
+ * LEGACY HINT — do not send from new code. Kept optional so clients
24093
+ * written against the echoing contract keep working; the hub uses it
24094
+ * only when it cannot read its own port, and says so via
24095
+ * `localPort.source === 'caller-hint'`.
24096
+ */
24097
+ port: number().int().min(1).max(65535).optional(),
24028
24098
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24029
24099
  * candidate. Default `true`. */
24030
24100
  includeLoopback: boolean().optional(),
package/dist/addon.mjs CHANGED
@@ -11,7 +11,7 @@ import { networkInterfaces, tmpdir, uptime } from "node:os";
11
11
  import { finished } from "node:stream/promises";
12
12
  import { createConnection, createServer as createServer$2 } from "node:net";
13
13
  import * as dgram from "node:dgram";
14
- //#region ../types/dist/event-category-XfKNtfCc.mjs
14
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
15
15
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
16
16
  EventCategory["SystemBoot"] = "system.boot";
17
17
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -27,6 +27,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
27
27
  */
28
28
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
29
29
  /**
30
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
31
+ * Emitted only when the material on disk actually changed, so an
32
+ * operator who trusted the old certificate by hand is told rather than
33
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
34
+ *
35
+ * Rule: docs/decisions/adr-0227-*.md
36
+ */
37
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
38
+ /**
30
39
  * A newer addon or server-root package version was found by the
31
40
  * authoritative registry check. Emitted once when any observed
32
41
  * `latestVersion` changes (or a package/node first appears behind);
@@ -19059,6 +19068,12 @@ var CameraStatusSchema = object({
19059
19068
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19060
19069
  fetchedAt: number()
19061
19070
  });
19071
+ var InferenceDeviceExclusionReasonSchema = _enum([
19072
+ "disabled",
19073
+ "unavailable",
19074
+ "cannot-host-camera-root",
19075
+ "accelerator-preferred"
19076
+ ]);
19062
19077
  var NodeInferenceDeviceSchema = object({
19063
19078
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
19064
19079
  key: string$2(),
@@ -19089,7 +19104,17 @@ var NodeInferenceDeviceSchema = object({
19089
19104
  * available per format; this is the stored selection that becomes the
19090
19105
  * default for EVERY camera landing on this accelerator.
19091
19106
  */
19092
- steps: record(string$2(), DeviceStepConfigSchema).optional()
19107
+ steps: record(string$2(), DeviceStepConfigSchema).optional(),
19108
+ /**
19109
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19110
+ * the reason the dispatcher drops it. Computed by the SAME
19111
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19112
+ * never disagree with the election — deriving it in the UI from
19113
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19114
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19115
+ * "an accelerator is serving" predicate).
19116
+ */
19117
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19093
19118
  });
19094
19119
  var NodeInferenceDevicesSchema = object({
19095
19120
  nodeId: string$2(),
@@ -23957,7 +23982,12 @@ var ListResultSchema = object({
23957
23982
  probedAt: number()
23958
23983
  });
23959
23984
  var PreferredSchema = LocalInterfaceSchema.nullable();
23960
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23985
+ /**
23986
+ * Candidate base URL for the SDK to race on connect. Order matters —
23987
+ * the SDK should attempt these top-to-bottom with a short per-candidate
23988
+ * timeout (e.g. 1500ms) and cache the winner for the session.
23989
+ */
23990
+ var ConnectionEndpointSchema = object({
23961
23991
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
23962
23992
  label: string$2(),
23963
23993
  /** Fully-formed base URL with scheme + host + port. */
@@ -24000,7 +24030,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
24000
24030
  * ordering between polls.
24001
24031
  */
24002
24032
  priority: number()
24003
- })).readonly() });
24033
+ });
24034
+ /**
24035
+ * Where the advertised local port came from. Ordered most → least
24036
+ * authoritative, and the whole point of returning it: a client must be able to
24037
+ * tell a FACT about the hub's socket from an echo of its own guess.
24038
+ */
24039
+ var LocalPortSourceEnum = _enum([
24040
+ "server-config",
24041
+ "server-env",
24042
+ "caller-hint",
24043
+ "default"
24044
+ ]);
24045
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
24046
+ var AdvertisedLocalPortSchema = object({
24047
+ port: number().int().min(1).max(65535),
24048
+ source: LocalPortSourceEnum
24049
+ });
24050
+ var GetConnectionEndpointsResultSchema = object({
24051
+ endpoints: array(ConnectionEndpointSchema).readonly(),
24052
+ /**
24053
+ * The port the hub built the LAN/loopback URLs with, and where that number
24054
+ * came from.
24055
+ *
24056
+ * Returned rather than merely applied, because "the URL is right" and "the
24057
+ * client can KNOW the URL is right" are different properties. A client that
24058
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
24059
+ * a hub that echoed the port the client sent, so it cannot decide whether to
24060
+ * race the candidate or discard it. With `source` it can: anything but
24061
+ * `caller-hint` is the hub's own socket.
24062
+ *
24063
+ * Absent on hubs predating this field — a client that finds it missing is
24064
+ * talking to an echoing hub and must degrade exactly as it does for
24065
+ * `caller-hint`.
24066
+ */
24067
+ localPort: AdvertisedLocalPortSchema
24068
+ });
24004
24069
  /**
24005
24070
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
24006
24071
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -24021,8 +24086,13 @@ var AllowedAddressesSchema = object({
24021
24086
  */
24022
24087
  addresses: array(string$2()).readonly() });
24023
24088
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24024
- /** Local hub HTTP port to use in base URLs. */
24025
- port: number().int().min(1).max(65535),
24089
+ /**
24090
+ * LEGACY HINT — do not send from new code. Kept optional so clients
24091
+ * written against the echoing contract keep working; the hub uses it
24092
+ * only when it cannot read its own port, and says so via
24093
+ * `localPort.source === 'caller-hint'`.
24094
+ */
24095
+ port: number().int().min(1).max(65535).optional(),
24026
24096
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24027
24097
  * candidate. Default `true`. */
24028
24098
  includeLoopback: boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-matter-broker",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
5
5
  "keywords": [
6
6
  "camstack",