@camstack/addon-mqtt-broker 1.2.24 → 1.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.
@@ -44,7 +44,7 @@ let crypto$10 = __toESM(crypto$1, 1);
44
44
  crypto$1 = __toESM(crypto$1);
45
45
  let node_fs = require("node:fs");
46
46
  let node_path = require("node:path");
47
- //#region ../types/dist/event-category-XfKNtfCc.mjs
47
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
48
48
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
49
49
  EventCategory["SystemBoot"] = "system.boot";
50
50
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -60,6 +60,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
60
60
  */
61
61
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
62
62
  /**
63
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
64
+ * Emitted only when the material on disk actually changed, so an
65
+ * operator who trusted the old certificate by hand is told rather than
66
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
67
+ *
68
+ * Rule: docs/decisions/adr-0227-*.md
69
+ */
70
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
71
+ /**
63
72
  * A newer addon or server-root package version was found by the
64
73
  * authoritative registry check. Emitted once when any observed
65
74
  * `latestVersion` changes (or a package/node first appears behind);
@@ -18736,6 +18745,12 @@ var CameraStatusSchema = object({
18736
18745
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
18737
18746
  fetchedAt: number()
18738
18747
  });
18748
+ var InferenceDeviceExclusionReasonSchema = _enum([
18749
+ "disabled",
18750
+ "unavailable",
18751
+ "cannot-host-camera-root",
18752
+ "accelerator-preferred"
18753
+ ]);
18739
18754
  var NodeInferenceDeviceSchema = object({
18740
18755
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
18741
18756
  key: string(),
@@ -18766,7 +18781,17 @@ var NodeInferenceDeviceSchema = object({
18766
18781
  * available per format; this is the stored selection that becomes the
18767
18782
  * default for EVERY camera landing on this accelerator.
18768
18783
  */
18769
- steps: record(string(), DeviceStepConfigSchema).optional()
18784
+ steps: record(string(), DeviceStepConfigSchema).optional(),
18785
+ /**
18786
+ * `null` when the device IS a camera-root candidate on this node; otherwise
18787
+ * the reason the dispatcher drops it. Computed by the SAME
18788
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
18789
+ * never disagree with the election — deriving it in the UI from
18790
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
18791
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
18792
+ * "an accelerator is serving" predicate).
18793
+ */
18794
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
18770
18795
  });
18771
18796
  var NodeInferenceDevicesSchema = object({
18772
18797
  nodeId: string(),
@@ -22524,7 +22549,12 @@ var ListResultSchema = object({
22524
22549
  probedAt: number()
22525
22550
  });
22526
22551
  var PreferredSchema = LocalInterfaceSchema.nullable();
22527
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22552
+ /**
22553
+ * Candidate base URL for the SDK to race on connect. Order matters —
22554
+ * the SDK should attempt these top-to-bottom with a short per-candidate
22555
+ * timeout (e.g. 1500ms) and cache the winner for the session.
22556
+ */
22557
+ var ConnectionEndpointSchema = object({
22528
22558
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
22529
22559
  label: string(),
22530
22560
  /** Fully-formed base URL with scheme + host + port. */
@@ -22567,7 +22597,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22567
22597
  * ordering between polls.
22568
22598
  */
22569
22599
  priority: number()
22570
- })).readonly() });
22600
+ });
22601
+ /**
22602
+ * Where the advertised local port came from. Ordered most → least
22603
+ * authoritative, and the whole point of returning it: a client must be able to
22604
+ * tell a FACT about the hub's socket from an echo of its own guess.
22605
+ */
22606
+ var LocalPortSourceEnum = _enum([
22607
+ "server-config",
22608
+ "server-env",
22609
+ "caller-hint",
22610
+ "default"
22611
+ ]);
22612
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
22613
+ var AdvertisedLocalPortSchema = object({
22614
+ port: number().int().min(1).max(65535),
22615
+ source: LocalPortSourceEnum
22616
+ });
22617
+ var GetConnectionEndpointsResultSchema = object({
22618
+ endpoints: array(ConnectionEndpointSchema).readonly(),
22619
+ /**
22620
+ * The port the hub built the LAN/loopback URLs with, and where that number
22621
+ * came from.
22622
+ *
22623
+ * Returned rather than merely applied, because "the URL is right" and "the
22624
+ * client can KNOW the URL is right" are different properties. A client that
22625
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
22626
+ * a hub that echoed the port the client sent, so it cannot decide whether to
22627
+ * race the candidate or discard it. With `source` it can: anything but
22628
+ * `caller-hint` is the hub's own socket.
22629
+ *
22630
+ * Absent on hubs predating this field — a client that finds it missing is
22631
+ * talking to an echoing hub and must degrade exactly as it does for
22632
+ * `caller-hint`.
22633
+ */
22634
+ localPort: AdvertisedLocalPortSchema
22635
+ });
22571
22636
  /**
22572
22637
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
22573
22638
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -22588,8 +22653,13 @@ var AllowedAddressesSchema = object({
22588
22653
  */
22589
22654
  addresses: array(string()).readonly() });
22590
22655
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
22591
- /** Local hub HTTP port to use in base URLs. */
22592
- port: number().int().min(1).max(65535),
22656
+ /**
22657
+ * LEGACY HINT — do not send from new code. Kept optional so clients
22658
+ * written against the echoing contract keep working; the hub uses it
22659
+ * only when it cannot read its own port, and says so via
22660
+ * `localPort.source === 'caller-hint'`.
22661
+ */
22662
+ port: number().int().min(1).max(65535).optional(),
22593
22663
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22594
22664
  * candidate. Default `true`. */
22595
22665
  includeLoopback: boolean().optional(),
@@ -39,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
39
39
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40
40
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
41
41
  //#endregion
42
- //#region ../types/dist/event-category-XfKNtfCc.mjs
42
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
43
43
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
44
44
  EventCategory["SystemBoot"] = "system.boot";
45
45
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -55,6 +55,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
55
55
  */
56
56
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
57
57
  /**
58
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
59
+ * Emitted only when the material on disk actually changed, so an
60
+ * operator who trusted the old certificate by hand is told rather than
61
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
62
+ *
63
+ * Rule: docs/decisions/adr-0227-*.md
64
+ */
65
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
66
+ /**
58
67
  * A newer addon or server-root package version was found by the
59
68
  * authoritative registry check. Emitted once when any observed
60
69
  * `latestVersion` changes (or a package/node first appears behind);
@@ -18731,6 +18740,12 @@ var CameraStatusSchema = object({
18731
18740
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
18732
18741
  fetchedAt: number()
18733
18742
  });
18743
+ var InferenceDeviceExclusionReasonSchema = _enum([
18744
+ "disabled",
18745
+ "unavailable",
18746
+ "cannot-host-camera-root",
18747
+ "accelerator-preferred"
18748
+ ]);
18734
18749
  var NodeInferenceDeviceSchema = object({
18735
18750
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
18736
18751
  key: string(),
@@ -18761,7 +18776,17 @@ var NodeInferenceDeviceSchema = object({
18761
18776
  * available per format; this is the stored selection that becomes the
18762
18777
  * default for EVERY camera landing on this accelerator.
18763
18778
  */
18764
- steps: record(string(), DeviceStepConfigSchema).optional()
18779
+ steps: record(string(), DeviceStepConfigSchema).optional(),
18780
+ /**
18781
+ * `null` when the device IS a camera-root candidate on this node; otherwise
18782
+ * the reason the dispatcher drops it. Computed by the SAME
18783
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
18784
+ * never disagree with the election — deriving it in the UI from
18785
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
18786
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
18787
+ * "an accelerator is serving" predicate).
18788
+ */
18789
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
18765
18790
  });
18766
18791
  var NodeInferenceDevicesSchema = object({
18767
18792
  nodeId: string(),
@@ -22519,7 +22544,12 @@ var ListResultSchema = object({
22519
22544
  probedAt: number()
22520
22545
  });
22521
22546
  var PreferredSchema = LocalInterfaceSchema.nullable();
22522
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22547
+ /**
22548
+ * Candidate base URL for the SDK to race on connect. Order matters —
22549
+ * the SDK should attempt these top-to-bottom with a short per-candidate
22550
+ * timeout (e.g. 1500ms) and cache the winner for the session.
22551
+ */
22552
+ var ConnectionEndpointSchema = object({
22523
22553
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
22524
22554
  label: string(),
22525
22555
  /** Fully-formed base URL with scheme + host + port. */
@@ -22562,7 +22592,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22562
22592
  * ordering between polls.
22563
22593
  */
22564
22594
  priority: number()
22565
- })).readonly() });
22595
+ });
22596
+ /**
22597
+ * Where the advertised local port came from. Ordered most → least
22598
+ * authoritative, and the whole point of returning it: a client must be able to
22599
+ * tell a FACT about the hub's socket from an echo of its own guess.
22600
+ */
22601
+ var LocalPortSourceEnum = _enum([
22602
+ "server-config",
22603
+ "server-env",
22604
+ "caller-hint",
22605
+ "default"
22606
+ ]);
22607
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
22608
+ var AdvertisedLocalPortSchema = object({
22609
+ port: number().int().min(1).max(65535),
22610
+ source: LocalPortSourceEnum
22611
+ });
22612
+ var GetConnectionEndpointsResultSchema = object({
22613
+ endpoints: array(ConnectionEndpointSchema).readonly(),
22614
+ /**
22615
+ * The port the hub built the LAN/loopback URLs with, and where that number
22616
+ * came from.
22617
+ *
22618
+ * Returned rather than merely applied, because "the URL is right" and "the
22619
+ * client can KNOW the URL is right" are different properties. A client that
22620
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
22621
+ * a hub that echoed the port the client sent, so it cannot decide whether to
22622
+ * race the candidate or discard it. With `source` it can: anything but
22623
+ * `caller-hint` is the hub's own socket.
22624
+ *
22625
+ * Absent on hubs predating this field — a client that finds it missing is
22626
+ * talking to an echoing hub and must degrade exactly as it does for
22627
+ * `caller-hint`.
22628
+ */
22629
+ localPort: AdvertisedLocalPortSchema
22630
+ });
22566
22631
  /**
22567
22632
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
22568
22633
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -22583,8 +22648,13 @@ var AllowedAddressesSchema = object({
22583
22648
  */
22584
22649
  addresses: array(string()).readonly() });
22585
22650
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
22586
- /** Local hub HTTP port to use in base URLs. */
22587
- port: number().int().min(1).max(65535),
22651
+ /**
22652
+ * LEGACY HINT — do not send from new code. Kept optional so clients
22653
+ * written against the echoing contract keep working; the hub uses it
22654
+ * only when it cannot read its own port, and says so via
22655
+ * `localPort.source === 'caller-hint'`.
22656
+ */
22657
+ port: number().int().min(1).max(65535).optional(),
22588
22658
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22589
22659
  * candidate. Default `true`. */
22590
22660
  includeLoopback: boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-mqtt-broker",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "MQTT broker registry addon for CamStack — manages external broker entries + an optional embedded aedes broker. Consumers spin up their own `mqtt.js` clients via the `mqtt-broker` cap.",
5
5
  "keywords": [
6
6
  "camstack",