@camstack/system 1.2.113 → 1.2.115

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.
Files changed (62) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.d.ts +1 -1
  8. package/dist/builtins/alerts/alerts.addon.js +6 -1
  9. package/dist/builtins/alerts/alerts.addon.mjs +6 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  12. package/dist/builtins/console-logging/index.js +1 -1
  13. package/dist/builtins/console-logging/index.mjs +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  15. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  16. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  17. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  19. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  20. package/dist/builtins/hub-forwarder/index.js +1 -1
  21. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  22. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  23. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  24. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  25. package/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
  26. package/dist/builtins/local-network/local-network.addon.d.ts +33 -1
  27. package/dist/builtins/local-network/local-network.addon.js +87 -2
  28. package/dist/builtins/local-network/local-network.addon.mjs +87 -3
  29. package/dist/builtins/loki-logging/index.js +1 -1
  30. package/dist/builtins/loki-logging/index.mjs +1 -1
  31. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  32. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  33. package/dist/builtins/platform-probe/index.js +1 -1
  34. package/dist/builtins/platform-probe/index.mjs +1 -1
  35. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  36. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  37. package/dist/builtins/snapshot/index.js +1 -1
  38. package/dist/builtins/snapshot/index.mjs +1 -1
  39. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  40. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  41. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  42. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  43. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  44. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  45. package/dist/builtins/system-config/system-config.addon.js +1 -1
  46. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  47. package/dist/builtins/winston-logging/index.js +1 -1
  48. package/dist/builtins/winston-logging/index.mjs +1 -1
  49. package/dist/{dist-Duz_uJSQ.mjs → dist-Drb54SZD.mjs} +89 -5
  50. package/dist/{dist-B2CtwVW2.js → dist-iAwSA2_f.js} +89 -5
  51. package/dist/index.js +438 -47
  52. package/dist/index.mjs +435 -50
  53. package/dist/{retired-settings-keys-BtVT2f6O.mjs → retired-settings-keys-Dz5-7gjt.mjs} +1 -1
  54. package/dist/{retired-settings-keys-CYDGGkyM.js → retired-settings-keys-OfhqQio4.js} +1 -1
  55. package/dist/tls/cert-evaluation.d.ts +41 -0
  56. package/dist/tls/cert-identity.d.ts +37 -0
  57. package/dist/tls/cert-manager.d.ts +60 -6
  58. package/dist/tls/cert-openssl.d.ts +23 -0
  59. package/dist/tls/index.d.ts +3 -1
  60. package/package.json +1 -1
  61. package/dist/{manifest-python-deps-MA_BZGBz.js → manifest-python-deps-CwBbX4Ut.js} +1 -1
  62. package/dist/{manifest-python-deps-Cb1ANt3i.mjs → manifest-python-deps-SGdbr9D5.mjs} +1 -1
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B2CtwVW2.js");
6
+ const require_dist = require("../../dist-iAwSA2_f.js");
7
7
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
8
8
  /**
9
9
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -1,4 +1,4 @@
1
- import { Gt as EventCategory, yt as BaseAddon } from "../../dist-Duz_uJSQ.mjs";
1
+ import { Gt as EventCategory, yt as BaseAddon } from "../../dist-Drb54SZD.mjs";
2
2
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
3
3
  /**
4
4
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B2CtwVW2.js");
6
+ const require_dist = require("../../dist-iAwSA2_f.js");
7
7
  let zod = require("zod");
8
8
  let node_crypto = require("node:crypto");
9
9
  let _camstack_types_node = require("@camstack/types/node");
@@ -1,4 +1,4 @@
1
- import { Ct as DeviceFeature, Gt as EventCategory, M as deriveBatteryPresence, Rt as nodePin, T as batteryCapability, Tt as DeviceType, i as BatteryStatusSchema, mt as streamQualityLabel, ut as snapshotCapability, vt as errMsg, w as bareAddonId, yt as BaseAddon } from "../../dist-Duz_uJSQ.mjs";
1
+ import { Ct as DeviceFeature, Gt as EventCategory, M as deriveBatteryPresence, Rt as nodePin, T as batteryCapability, Tt as DeviceType, i as BatteryStatusSchema, mt as streamQualityLabel, ut as snapshotCapability, vt as errMsg, w as bareAddonId, yt as BaseAddon } from "../../dist-Drb54SZD.mjs";
2
2
  import { z } from "zod";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { signExpiringUrl, verifyExpiringUrl } from "@camstack/types/node";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B2CtwVW2.js");
6
+ const require_dist = require("../../dist-iAwSA2_f.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_fs_promises = require("node:fs/promises");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { V as filesystemBrowseCapability, pt as storageProviderCapability, yt as BaseAddon } from "../../dist-Duz_uJSQ.mjs";
1
+ import { V as filesystemBrowseCapability, pt as storageProviderCapability, yt as BaseAddon } from "../../dist-Drb54SZD.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
4
4
  import * as path$1 from "node:path";
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B2CtwVW2.js");
7
- const require_retired_settings_keys = require("../../retired-settings-keys-CYDGGkyM.js");
6
+ const require_dist = require("../../dist-iAwSA2_f.js");
7
+ const require_retired_settings_keys = require("../../retired-settings-keys-OfhqQio4.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_fs = require("node:fs");
10
10
  let node_module = require("node:module");
@@ -1,5 +1,5 @@
1
- import { A as dataStoreProviderCapability, Bt as parseJsonUnknown, _t as vectorStoreCapability, f as RUNTIME_DEFAULTS, gt as vectorDimFromBase64, j as decodeVectorBase64, kt as asJsonObject, vt as errMsg, w as bareAddonId, yt as BaseAddon } from "../../dist-Duz_uJSQ.mjs";
2
- import { r as retiredKeyStoreOf, t as purgeRetiredSettingsKeys } from "../../retired-settings-keys-BtVT2f6O.mjs";
1
+ import { A as dataStoreProviderCapability, Bt as parseJsonUnknown, _t as vectorStoreCapability, f as RUNTIME_DEFAULTS, gt as vectorDimFromBase64, j as decodeVectorBase64, kt as asJsonObject, vt as errMsg, w as bareAddonId, yt as BaseAddon } from "../../dist-Drb54SZD.mjs";
2
+ import { r as retiredKeyStoreOf, t as purgeRetiredSettingsKeys } from "../../retired-settings-keys-Dz5-7gjt.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { statSync } from "node:fs";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B2CtwVW2.js");
6
+ const require_dist = require("../../dist-iAwSA2_f.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_fs_promises = require("node:fs/promises");
9
9
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
@@ -1,4 +1,4 @@
1
- import { dt as storageCapability, ft as storageMigrationCapability, g as StorageMigrationJobSchema, h as StorageLocationTypeSchema, lt as settingsStoreCapability, yt as BaseAddon, zt as parseJsonObject } from "../../dist-Duz_uJSQ.mjs";
1
+ import { dt as storageCapability, ft as storageMigrationCapability, g as StorageMigrationJobSchema, h as StorageLocationTypeSchema, lt as settingsStoreCapability, yt as BaseAddon, zt as parseJsonObject } from "../../dist-Drb54SZD.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import * as fs from "node:fs/promises";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B2CtwVW2.js");
6
+ const require_dist = require("../../dist-iAwSA2_f.js");
7
7
  //#region src/builtins/system-config/system-config.addon.ts
8
8
  /**
9
9
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -1,4 +1,4 @@
1
- import { It as hydrateSchema, vt as errMsg, yt as BaseAddon } from "../../dist-Duz_uJSQ.mjs";
1
+ import { It as hydrateSchema, vt as errMsg, yt as BaseAddon } from "../../dist-Drb54SZD.mjs";
2
2
  //#region src/builtins/system-config/system-config.addon.ts
3
3
  /**
4
4
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B2CtwVW2.js");
6
+ const require_dist = require("../../dist-iAwSA2_f.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { X as logDestinationCapability, yt as BaseAddon } from "../../dist-Duz_uJSQ.mjs";
1
+ import { X as logDestinationCapability, yt as BaseAddon } from "../../dist-Drb54SZD.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
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);
@@ -17709,6 +17718,12 @@ var CameraStatusSchema = z.object({
17709
17718
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
17710
17719
  fetchedAt: z.number()
17711
17720
  });
17721
+ var InferenceDeviceExclusionReasonSchema = z.enum([
17722
+ "disabled",
17723
+ "unavailable",
17724
+ "cannot-host-camera-root",
17725
+ "accelerator-preferred"
17726
+ ]);
17712
17727
  var NodeInferenceDeviceSchema = z.object({
17713
17728
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
17714
17729
  key: z.string(),
@@ -17739,7 +17754,17 @@ var NodeInferenceDeviceSchema = z.object({
17739
17754
  * available per format; this is the stored selection that becomes the
17740
17755
  * default for EVERY camera landing on this accelerator.
17741
17756
  */
17742
- steps: z.record(z.string(), DeviceStepConfigSchema).optional()
17757
+ steps: z.record(z.string(), DeviceStepConfigSchema).optional(),
17758
+ /**
17759
+ * `null` when the device IS a camera-root candidate on this node; otherwise
17760
+ * the reason the dispatcher drops it. Computed by the SAME
17761
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
17762
+ * never disagree with the election — deriving it in the UI from
17763
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
17764
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
17765
+ * "an accelerator is serving" predicate).
17766
+ */
17767
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
17743
17768
  });
17744
17769
  var NodeInferenceDevicesSchema = z.object({
17745
17770
  nodeId: z.string(),
@@ -23840,7 +23865,41 @@ var ConnectionEndpointSchema = z.object({
23840
23865
  */
23841
23866
  priority: z.number()
23842
23867
  });
23843
- var GetConnectionEndpointsResultSchema = z.object({ endpoints: z.array(ConnectionEndpointSchema).readonly() });
23868
+ /**
23869
+ * Where the advertised local port came from. Ordered most → least
23870
+ * authoritative, and the whole point of returning it: a client must be able to
23871
+ * tell a FACT about the hub's socket from an echo of its own guess.
23872
+ */
23873
+ var LocalPortSourceEnum = z.enum([
23874
+ "server-config",
23875
+ "server-env",
23876
+ "caller-hint",
23877
+ "default"
23878
+ ]);
23879
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
23880
+ var AdvertisedLocalPortSchema = z.object({
23881
+ port: z.number().int().min(1).max(65535),
23882
+ source: LocalPortSourceEnum
23883
+ });
23884
+ var GetConnectionEndpointsResultSchema = z.object({
23885
+ endpoints: z.array(ConnectionEndpointSchema).readonly(),
23886
+ /**
23887
+ * The port the hub built the LAN/loopback URLs with, and where that number
23888
+ * came from.
23889
+ *
23890
+ * Returned rather than merely applied, because "the URL is right" and "the
23891
+ * client can KNOW the URL is right" are different properties. A client that
23892
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
23893
+ * a hub that echoed the port the client sent, so it cannot decide whether to
23894
+ * race the candidate or discard it. With `source` it can: anything but
23895
+ * `caller-hint` is the hub's own socket.
23896
+ *
23897
+ * Absent on hubs predating this field — a client that finds it missing is
23898
+ * talking to an echoing hub and must degrade exactly as it does for
23899
+ * `caller-hint`.
23900
+ */
23901
+ localPort: AdvertisedLocalPortSchema
23902
+ });
23844
23903
  /**
23845
23904
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23846
23905
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -23886,10 +23945,35 @@ var localNetworkCapability = {
23886
23945
  * Honours `getAllowedAddresses()` when set — addresses outside
23887
23946
  * the allowlist are dropped (the public tunnel + loopback are
23888
23947
  * always included as escape hatches).
23948
+ *
23949
+ * **The port is the hub's, not the caller's** (D62 — a function's fact
23950
+ * belongs to whoever already owns it). This method used to take a `port`
23951
+ * and echo it onto every LAN and loopback URL it advertised, which made
23952
+ * every client a second authority on a socket only the hub binds. A viewer
23953
+ * configured with a port-less public URL (`https://camstack.example.top`)
23954
+ * infers 443 from the scheme, asks with 443, and was handed
23955
+ * `https://192.168.1.9:443` for a hub listening on 4443. That candidate
23956
+ * cannot ever answer, and losing its race reads in the log exactly like
23957
+ * "the LAN was tried and it was slower" — so an operator sitting on his own
23958
+ * WiFi stayed on the public tunnel for weeks, with the LAN candidate born
23959
+ * dead on every single connect.
23960
+ *
23961
+ * The hub now resolves its own listen port and reports it as `localPort`,
23962
+ * with the SOURCE of the number, so a client can tell a fact from an echo.
23963
+ *
23964
+ * Out of scope on purpose: a LAN URL that is not the hub's own socket (a
23965
+ * reverse proxy in front of it on another port) is not this method's to
23966
+ * invent either — pin it with `setNotificationEndpoint` / a configured
23967
+ * origin, which is an operator statement rather than a guess.
23889
23968
  */
23890
23969
  getConnectionEndpoints: method(z.object({
23891
- /** Local hub HTTP port to use in base URLs. */
23892
- port: z.number().int().min(1).max(65535),
23970
+ /**
23971
+ * LEGACY HINT — do not send from new code. Kept optional so clients
23972
+ * written against the echoing contract keep working; the hub uses it
23973
+ * only when it cannot read its own port, and says so via
23974
+ * `localPort.source === 'caller-hint'`.
23975
+ */
23976
+ port: z.number().int().min(1).max(65535).optional(),
23893
23977
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
23894
23978
  * candidate. Default `true`. */
23895
23979
  includeLoopback: z.boolean().optional(),
@@ -1,5 +1,5 @@
1
1
  let zod = require("zod");
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);
@@ -17709,6 +17718,12 @@ var CameraStatusSchema = zod.z.object({
17709
17718
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
17710
17719
  fetchedAt: zod.z.number()
17711
17720
  });
17721
+ var InferenceDeviceExclusionReasonSchema = zod.z.enum([
17722
+ "disabled",
17723
+ "unavailable",
17724
+ "cannot-host-camera-root",
17725
+ "accelerator-preferred"
17726
+ ]);
17712
17727
  var NodeInferenceDeviceSchema = zod.z.object({
17713
17728
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
17714
17729
  key: zod.z.string(),
@@ -17739,7 +17754,17 @@ var NodeInferenceDeviceSchema = zod.z.object({
17739
17754
  * available per format; this is the stored selection that becomes the
17740
17755
  * default for EVERY camera landing on this accelerator.
17741
17756
  */
17742
- steps: zod.z.record(zod.z.string(), DeviceStepConfigSchema).optional()
17757
+ steps: zod.z.record(zod.z.string(), DeviceStepConfigSchema).optional(),
17758
+ /**
17759
+ * `null` when the device IS a camera-root candidate on this node; otherwise
17760
+ * the reason the dispatcher drops it. Computed by the SAME
17761
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
17762
+ * never disagree with the election — deriving it in the UI from
17763
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
17764
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
17765
+ * "an accelerator is serving" predicate).
17766
+ */
17767
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
17743
17768
  });
17744
17769
  var NodeInferenceDevicesSchema = zod.z.object({
17745
17770
  nodeId: zod.z.string(),
@@ -23840,7 +23865,41 @@ var ConnectionEndpointSchema = zod.z.object({
23840
23865
  */
23841
23866
  priority: zod.z.number()
23842
23867
  });
23843
- var GetConnectionEndpointsResultSchema = zod.z.object({ endpoints: zod.z.array(ConnectionEndpointSchema).readonly() });
23868
+ /**
23869
+ * Where the advertised local port came from. Ordered most → least
23870
+ * authoritative, and the whole point of returning it: a client must be able to
23871
+ * tell a FACT about the hub's socket from an echo of its own guess.
23872
+ */
23873
+ var LocalPortSourceEnum = zod.z.enum([
23874
+ "server-config",
23875
+ "server-env",
23876
+ "caller-hint",
23877
+ "default"
23878
+ ]);
23879
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
23880
+ var AdvertisedLocalPortSchema = zod.z.object({
23881
+ port: zod.z.number().int().min(1).max(65535),
23882
+ source: LocalPortSourceEnum
23883
+ });
23884
+ var GetConnectionEndpointsResultSchema = zod.z.object({
23885
+ endpoints: zod.z.array(ConnectionEndpointSchema).readonly(),
23886
+ /**
23887
+ * The port the hub built the LAN/loopback URLs with, and where that number
23888
+ * came from.
23889
+ *
23890
+ * Returned rather than merely applied, because "the URL is right" and "the
23891
+ * client can KNOW the URL is right" are different properties. A client that
23892
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
23893
+ * a hub that echoed the port the client sent, so it cannot decide whether to
23894
+ * race the candidate or discard it. With `source` it can: anything but
23895
+ * `caller-hint` is the hub's own socket.
23896
+ *
23897
+ * Absent on hubs predating this field — a client that finds it missing is
23898
+ * talking to an echoing hub and must degrade exactly as it does for
23899
+ * `caller-hint`.
23900
+ */
23901
+ localPort: AdvertisedLocalPortSchema
23902
+ });
23844
23903
  /**
23845
23904
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23846
23905
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -23886,10 +23945,35 @@ var localNetworkCapability = {
23886
23945
  * Honours `getAllowedAddresses()` when set — addresses outside
23887
23946
  * the allowlist are dropped (the public tunnel + loopback are
23888
23947
  * always included as escape hatches).
23948
+ *
23949
+ * **The port is the hub's, not the caller's** (D62 — a function's fact
23950
+ * belongs to whoever already owns it). This method used to take a `port`
23951
+ * and echo it onto every LAN and loopback URL it advertised, which made
23952
+ * every client a second authority on a socket only the hub binds. A viewer
23953
+ * configured with a port-less public URL (`https://camstack.example.top`)
23954
+ * infers 443 from the scheme, asks with 443, and was handed
23955
+ * `https://192.168.1.9:443` for a hub listening on 4443. That candidate
23956
+ * cannot ever answer, and losing its race reads in the log exactly like
23957
+ * "the LAN was tried and it was slower" — so an operator sitting on his own
23958
+ * WiFi stayed on the public tunnel for weeks, with the LAN candidate born
23959
+ * dead on every single connect.
23960
+ *
23961
+ * The hub now resolves its own listen port and reports it as `localPort`,
23962
+ * with the SOURCE of the number, so a client can tell a fact from an echo.
23963
+ *
23964
+ * Out of scope on purpose: a LAN URL that is not the hub's own socket (a
23965
+ * reverse proxy in front of it on another port) is not this method's to
23966
+ * invent either — pin it with `setNotificationEndpoint` / a configured
23967
+ * origin, which is an operator statement rather than a guess.
23889
23968
  */
23890
23969
  getConnectionEndpoints: method(zod.z.object({
23891
- /** Local hub HTTP port to use in base URLs. */
23892
- port: zod.z.number().int().min(1).max(65535),
23970
+ /**
23971
+ * LEGACY HINT — do not send from new code. Kept optional so clients
23972
+ * written against the echoing contract keep working; the hub uses it
23973
+ * only when it cannot read its own port, and says so via
23974
+ * `localPort.source === 'caller-hint'`.
23975
+ */
23976
+ port: zod.z.number().int().min(1).max(65535).optional(),
23893
23977
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
23894
23978
  * candidate. Default `true`. */
23895
23979
  includeLoopback: zod.z.boolean().optional(),