@camstack/addon-provider-dreo 0.2.24 → 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
@@ -19034,6 +19034,12 @@ var CameraStatusSchema = object({
19034
19034
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19035
19035
  fetchedAt: number()
19036
19036
  });
19037
+ var InferenceDeviceExclusionReasonSchema = _enum([
19038
+ "disabled",
19039
+ "unavailable",
19040
+ "cannot-host-camera-root",
19041
+ "accelerator-preferred"
19042
+ ]);
19037
19043
  var NodeInferenceDeviceSchema = object({
19038
19044
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
19039
19045
  key: string(),
@@ -19064,7 +19070,17 @@ var NodeInferenceDeviceSchema = object({
19064
19070
  * available per format; this is the stored selection that becomes the
19065
19071
  * default for EVERY camera landing on this accelerator.
19066
19072
  */
19067
- steps: record(string(), DeviceStepConfigSchema).optional()
19073
+ steps: record(string(), DeviceStepConfigSchema).optional(),
19074
+ /**
19075
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19076
+ * the reason the dispatcher drops it. Computed by the SAME
19077
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19078
+ * never disagree with the election — deriving it in the UI from
19079
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19080
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19081
+ * "an accelerator is serving" predicate).
19082
+ */
19083
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19068
19084
  });
19069
19085
  var NodeInferenceDevicesSchema = object({
19070
19086
  nodeId: string(),
@@ -23923,7 +23939,12 @@ var ListResultSchema = object({
23923
23939
  probedAt: number()
23924
23940
  });
23925
23941
  var PreferredSchema = LocalInterfaceSchema.nullable();
23926
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23942
+ /**
23943
+ * Candidate base URL for the SDK to race on connect. Order matters —
23944
+ * the SDK should attempt these top-to-bottom with a short per-candidate
23945
+ * timeout (e.g. 1500ms) and cache the winner for the session.
23946
+ */
23947
+ var ConnectionEndpointSchema = object({
23927
23948
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
23928
23949
  label: string(),
23929
23950
  /** Fully-formed base URL with scheme + host + port. */
@@ -23966,7 +23987,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23966
23987
  * ordering between polls.
23967
23988
  */
23968
23989
  priority: number()
23969
- })).readonly() });
23990
+ });
23991
+ /**
23992
+ * Where the advertised local port came from. Ordered most → least
23993
+ * authoritative, and the whole point of returning it: a client must be able to
23994
+ * tell a FACT about the hub's socket from an echo of its own guess.
23995
+ */
23996
+ var LocalPortSourceEnum = _enum([
23997
+ "server-config",
23998
+ "server-env",
23999
+ "caller-hint",
24000
+ "default"
24001
+ ]);
24002
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
24003
+ var AdvertisedLocalPortSchema = object({
24004
+ port: number().int().min(1).max(65535),
24005
+ source: LocalPortSourceEnum
24006
+ });
24007
+ var GetConnectionEndpointsResultSchema = object({
24008
+ endpoints: array(ConnectionEndpointSchema).readonly(),
24009
+ /**
24010
+ * The port the hub built the LAN/loopback URLs with, and where that number
24011
+ * came from.
24012
+ *
24013
+ * Returned rather than merely applied, because "the URL is right" and "the
24014
+ * client can KNOW the URL is right" are different properties. A client that
24015
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
24016
+ * a hub that echoed the port the client sent, so it cannot decide whether to
24017
+ * race the candidate or discard it. With `source` it can: anything but
24018
+ * `caller-hint` is the hub's own socket.
24019
+ *
24020
+ * Absent on hubs predating this field — a client that finds it missing is
24021
+ * talking to an echoing hub and must degrade exactly as it does for
24022
+ * `caller-hint`.
24023
+ */
24024
+ localPort: AdvertisedLocalPortSchema
24025
+ });
23970
24026
  /**
23971
24027
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23972
24028
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -23987,8 +24043,13 @@ var AllowedAddressesSchema = object({
23987
24043
  */
23988
24044
  addresses: array(string()).readonly() });
23989
24045
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
23990
- /** Local hub HTTP port to use in base URLs. */
23991
- port: number().int().min(1).max(65535),
24046
+ /**
24047
+ * LEGACY HINT — do not send from new code. Kept optional so clients
24048
+ * written against the echoing contract keep working; the hub uses it
24049
+ * only when it cannot read its own port, and says so via
24050
+ * `localPort.source === 'caller-hint'`.
24051
+ */
24052
+ port: number().int().min(1).max(65535).optional(),
23992
24053
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
23993
24054
  * candidate. Default `true`. */
23994
24055
  includeLoopback: boolean().optional(),
package/dist/addon.mjs CHANGED
@@ -19035,6 +19035,12 @@ var CameraStatusSchema = object({
19035
19035
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19036
19036
  fetchedAt: number()
19037
19037
  });
19038
+ var InferenceDeviceExclusionReasonSchema = _enum([
19039
+ "disabled",
19040
+ "unavailable",
19041
+ "cannot-host-camera-root",
19042
+ "accelerator-preferred"
19043
+ ]);
19038
19044
  var NodeInferenceDeviceSchema = object({
19039
19045
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
19040
19046
  key: string(),
@@ -19065,7 +19071,17 @@ var NodeInferenceDeviceSchema = object({
19065
19071
  * available per format; this is the stored selection that becomes the
19066
19072
  * default for EVERY camera landing on this accelerator.
19067
19073
  */
19068
- steps: record(string(), DeviceStepConfigSchema).optional()
19074
+ steps: record(string(), DeviceStepConfigSchema).optional(),
19075
+ /**
19076
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19077
+ * the reason the dispatcher drops it. Computed by the SAME
19078
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19079
+ * never disagree with the election — deriving it in the UI from
19080
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19081
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19082
+ * "an accelerator is serving" predicate).
19083
+ */
19084
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19069
19085
  });
19070
19086
  var NodeInferenceDevicesSchema = object({
19071
19087
  nodeId: string(),
@@ -23924,7 +23940,12 @@ var ListResultSchema = object({
23924
23940
  probedAt: number()
23925
23941
  });
23926
23942
  var PreferredSchema = LocalInterfaceSchema.nullable();
23927
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23943
+ /**
23944
+ * Candidate base URL for the SDK to race on connect. Order matters —
23945
+ * the SDK should attempt these top-to-bottom with a short per-candidate
23946
+ * timeout (e.g. 1500ms) and cache the winner for the session.
23947
+ */
23948
+ var ConnectionEndpointSchema = object({
23928
23949
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
23929
23950
  label: string(),
23930
23951
  /** Fully-formed base URL with scheme + host + port. */
@@ -23967,7 +23988,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
23967
23988
  * ordering between polls.
23968
23989
  */
23969
23990
  priority: number()
23970
- })).readonly() });
23991
+ });
23992
+ /**
23993
+ * Where the advertised local port came from. Ordered most → least
23994
+ * authoritative, and the whole point of returning it: a client must be able to
23995
+ * tell a FACT about the hub's socket from an echo of its own guess.
23996
+ */
23997
+ var LocalPortSourceEnum = _enum([
23998
+ "server-config",
23999
+ "server-env",
24000
+ "caller-hint",
24001
+ "default"
24002
+ ]);
24003
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
24004
+ var AdvertisedLocalPortSchema = object({
24005
+ port: number().int().min(1).max(65535),
24006
+ source: LocalPortSourceEnum
24007
+ });
24008
+ var GetConnectionEndpointsResultSchema = object({
24009
+ endpoints: array(ConnectionEndpointSchema).readonly(),
24010
+ /**
24011
+ * The port the hub built the LAN/loopback URLs with, and where that number
24012
+ * came from.
24013
+ *
24014
+ * Returned rather than merely applied, because "the URL is right" and "the
24015
+ * client can KNOW the URL is right" are different properties. A client that
24016
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
24017
+ * a hub that echoed the port the client sent, so it cannot decide whether to
24018
+ * race the candidate or discard it. With `source` it can: anything but
24019
+ * `caller-hint` is the hub's own socket.
24020
+ *
24021
+ * Absent on hubs predating this field — a client that finds it missing is
24022
+ * talking to an echoing hub and must degrade exactly as it does for
24023
+ * `caller-hint`.
24024
+ */
24025
+ localPort: AdvertisedLocalPortSchema
24026
+ });
23971
24027
  /**
23972
24028
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
23973
24029
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -23988,8 +24044,13 @@ var AllowedAddressesSchema = object({
23988
24044
  */
23989
24045
  addresses: array(string()).readonly() });
23990
24046
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
23991
- /** Local hub HTTP port to use in base URLs. */
23992
- port: number().int().min(1).max(65535),
24047
+ /**
24048
+ * LEGACY HINT — do not send from new code. Kept optional so clients
24049
+ * written against the echoing contract keep working; the hub uses it
24050
+ * only when it cannot read its own port, and says so via
24051
+ * `localPort.source === 'caller-hint'`.
24052
+ */
24053
+ port: number().int().min(1).max(65535).optional(),
23993
24054
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
23994
24055
  * candidate. Default `true`. */
23995
24056
  includeLoopback: boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-dreo",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "description": "Dreo smart-device (fan / air-circulator / purifier / heater / humidifier) device-provider addon for CamStack — wraps the @apocaliss92/nodedreo Dreo cloud client (REST + WebSocket)",
5
5
  "keywords": [
6
6
  "camstack",