@camstack/addon-cloudflare 1.2.23 → 1.2.24

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.
@@ -18661,6 +18661,12 @@ var CameraStatusSchema = object({
18661
18661
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
18662
18662
  fetchedAt: number()
18663
18663
  });
18664
+ var InferenceDeviceExclusionReasonSchema = _enum([
18665
+ "disabled",
18666
+ "unavailable",
18667
+ "cannot-host-camera-root",
18668
+ "accelerator-preferred"
18669
+ ]);
18664
18670
  var NodeInferenceDeviceSchema = object({
18665
18671
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
18666
18672
  key: string(),
@@ -18691,7 +18697,17 @@ var NodeInferenceDeviceSchema = object({
18691
18697
  * available per format; this is the stored selection that becomes the
18692
18698
  * default for EVERY camera landing on this accelerator.
18693
18699
  */
18694
- steps: record(string(), DeviceStepConfigSchema).optional()
18700
+ steps: record(string(), DeviceStepConfigSchema).optional(),
18701
+ /**
18702
+ * `null` when the device IS a camera-root candidate on this node; otherwise
18703
+ * the reason the dispatcher drops it. Computed by the SAME
18704
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
18705
+ * never disagree with the election — deriving it in the UI from
18706
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
18707
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
18708
+ * "an accelerator is serving" predicate).
18709
+ */
18710
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
18695
18711
  });
18696
18712
  var NodeInferenceDevicesSchema = object({
18697
18713
  nodeId: string(),
@@ -22472,7 +22488,12 @@ var ListResultSchema = object({
22472
22488
  probedAt: number()
22473
22489
  });
22474
22490
  var PreferredSchema = LocalInterfaceSchema.nullable();
22475
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22491
+ /**
22492
+ * Candidate base URL for the SDK to race on connect. Order matters —
22493
+ * the SDK should attempt these top-to-bottom with a short per-candidate
22494
+ * timeout (e.g. 1500ms) and cache the winner for the session.
22495
+ */
22496
+ var ConnectionEndpointSchema = object({
22476
22497
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
22477
22498
  label: string(),
22478
22499
  /** Fully-formed base URL with scheme + host + port. */
@@ -22515,7 +22536,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22515
22536
  * ordering between polls.
22516
22537
  */
22517
22538
  priority: number()
22518
- })).readonly() });
22539
+ });
22540
+ /**
22541
+ * Where the advertised local port came from. Ordered most → least
22542
+ * authoritative, and the whole point of returning it: a client must be able to
22543
+ * tell a FACT about the hub's socket from an echo of its own guess.
22544
+ */
22545
+ var LocalPortSourceEnum = _enum([
22546
+ "server-config",
22547
+ "server-env",
22548
+ "caller-hint",
22549
+ "default"
22550
+ ]);
22551
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
22552
+ var AdvertisedLocalPortSchema = object({
22553
+ port: number().int().min(1).max(65535),
22554
+ source: LocalPortSourceEnum
22555
+ });
22556
+ var GetConnectionEndpointsResultSchema = object({
22557
+ endpoints: array(ConnectionEndpointSchema).readonly(),
22558
+ /**
22559
+ * The port the hub built the LAN/loopback URLs with, and where that number
22560
+ * came from.
22561
+ *
22562
+ * Returned rather than merely applied, because "the URL is right" and "the
22563
+ * client can KNOW the URL is right" are different properties. A client that
22564
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
22565
+ * a hub that echoed the port the client sent, so it cannot decide whether to
22566
+ * race the candidate or discard it. With `source` it can: anything but
22567
+ * `caller-hint` is the hub's own socket.
22568
+ *
22569
+ * Absent on hubs predating this field — a client that finds it missing is
22570
+ * talking to an echoing hub and must degrade exactly as it does for
22571
+ * `caller-hint`.
22572
+ */
22573
+ localPort: AdvertisedLocalPortSchema
22574
+ });
22519
22575
  /**
22520
22576
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
22521
22577
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -22536,8 +22592,13 @@ var AllowedAddressesSchema = object({
22536
22592
  */
22537
22593
  addresses: array(string()).readonly() });
22538
22594
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
22539
- /** Local hub HTTP port to use in base URLs. */
22540
- port: number().int().min(1).max(65535),
22595
+ /**
22596
+ * LEGACY HINT — do not send from new code. Kept optional so clients
22597
+ * written against the echoing contract keep working; the hub uses it
22598
+ * only when it cannot read its own port, and says so via
22599
+ * `localPort.source === 'caller-hint'`.
22600
+ */
22601
+ port: number().int().min(1).max(65535).optional(),
22541
22602
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22542
22603
  * candidate. Default `true`. */
22543
22604
  includeLoopback: boolean().optional(),
@@ -18661,6 +18661,12 @@ var CameraStatusSchema = object({
18661
18661
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
18662
18662
  fetchedAt: number()
18663
18663
  });
18664
+ var InferenceDeviceExclusionReasonSchema = _enum([
18665
+ "disabled",
18666
+ "unavailable",
18667
+ "cannot-host-camera-root",
18668
+ "accelerator-preferred"
18669
+ ]);
18664
18670
  var NodeInferenceDeviceSchema = object({
18665
18671
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
18666
18672
  key: string(),
@@ -18691,7 +18697,17 @@ var NodeInferenceDeviceSchema = object({
18691
18697
  * available per format; this is the stored selection that becomes the
18692
18698
  * default for EVERY camera landing on this accelerator.
18693
18699
  */
18694
- steps: record(string(), DeviceStepConfigSchema).optional()
18700
+ steps: record(string(), DeviceStepConfigSchema).optional(),
18701
+ /**
18702
+ * `null` when the device IS a camera-root candidate on this node; otherwise
18703
+ * the reason the dispatcher drops it. Computed by the SAME
18704
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
18705
+ * never disagree with the election — deriving it in the UI from
18706
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
18707
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
18708
+ * "an accelerator is serving" predicate).
18709
+ */
18710
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
18695
18711
  });
18696
18712
  var NodeInferenceDevicesSchema = object({
18697
18713
  nodeId: string(),
@@ -22472,7 +22488,12 @@ var ListResultSchema = object({
22472
22488
  probedAt: number()
22473
22489
  });
22474
22490
  var PreferredSchema = LocalInterfaceSchema.nullable();
22475
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22491
+ /**
22492
+ * Candidate base URL for the SDK to race on connect. Order matters —
22493
+ * the SDK should attempt these top-to-bottom with a short per-candidate
22494
+ * timeout (e.g. 1500ms) and cache the winner for the session.
22495
+ */
22496
+ var ConnectionEndpointSchema = object({
22476
22497
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
22477
22498
  label: string(),
22478
22499
  /** Fully-formed base URL with scheme + host + port. */
@@ -22515,7 +22536,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22515
22536
  * ordering between polls.
22516
22537
  */
22517
22538
  priority: number()
22518
- })).readonly() });
22539
+ });
22540
+ /**
22541
+ * Where the advertised local port came from. Ordered most → least
22542
+ * authoritative, and the whole point of returning it: a client must be able to
22543
+ * tell a FACT about the hub's socket from an echo of its own guess.
22544
+ */
22545
+ var LocalPortSourceEnum = _enum([
22546
+ "server-config",
22547
+ "server-env",
22548
+ "caller-hint",
22549
+ "default"
22550
+ ]);
22551
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
22552
+ var AdvertisedLocalPortSchema = object({
22553
+ port: number().int().min(1).max(65535),
22554
+ source: LocalPortSourceEnum
22555
+ });
22556
+ var GetConnectionEndpointsResultSchema = object({
22557
+ endpoints: array(ConnectionEndpointSchema).readonly(),
22558
+ /**
22559
+ * The port the hub built the LAN/loopback URLs with, and where that number
22560
+ * came from.
22561
+ *
22562
+ * Returned rather than merely applied, because "the URL is right" and "the
22563
+ * client can KNOW the URL is right" are different properties. A client that
22564
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
22565
+ * a hub that echoed the port the client sent, so it cannot decide whether to
22566
+ * race the candidate or discard it. With `source` it can: anything but
22567
+ * `caller-hint` is the hub's own socket.
22568
+ *
22569
+ * Absent on hubs predating this field — a client that finds it missing is
22570
+ * talking to an echoing hub and must degrade exactly as it does for
22571
+ * `caller-hint`.
22572
+ */
22573
+ localPort: AdvertisedLocalPortSchema
22574
+ });
22519
22575
  /**
22520
22576
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
22521
22577
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -22536,8 +22592,13 @@ var AllowedAddressesSchema = object({
22536
22592
  */
22537
22593
  addresses: array(string()).readonly() });
22538
22594
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
22539
- /** Local hub HTTP port to use in base URLs. */
22540
- port: number().int().min(1).max(65535),
22595
+ /**
22596
+ * LEGACY HINT — do not send from new code. Kept optional so clients
22597
+ * written against the echoing contract keep working; the hub uses it
22598
+ * only when it cannot read its own port, and says so via
22599
+ * `localPort.source === 'caller-hint'`.
22600
+ */
22601
+ port: number().int().min(1).max(65535).optional(),
22541
22602
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22542
22603
  * candidate. Default `true`. */
22543
22604
  includeLoopback: boolean().optional(),
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_dist = require("../dist-B3Wo-Mb6.js");
24
+ const require_dist = require("../dist-j7oMFwvU.js");
25
25
  let node_crypto = require("node:crypto");
26
26
  let node_path = require("node:path");
27
27
  node_path = __toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { a as BaseAddon, c as boolean, d as number, f as object, m as EventCategory, n as defineCustomActions, o as _enum, p as string, r as networkAccessCapability, s as array, t as customAction, u as literal } from "../dist-If1V2ljI.mjs";
1
+ import { a as BaseAddon, c as boolean, d as number, f as object, m as EventCategory, n as defineCustomActions, o as _enum, p as string, r as networkAccessCapability, s as array, t as customAction, u as literal } from "../dist-CCB3dnL3.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import * as path from "node:path";
4
4
  import { spawn } from "node:child_process";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("../dist-B3Wo-Mb6.js");
2
+ const require_dist = require("../dist-j7oMFwvU.js");
3
3
  //#region src/turn/cloudflare-turn.ts
4
4
  /**
5
5
  * Cloudflare returns ICE servers in several flavours depending on which
@@ -1,4 +1,4 @@
1
- import { a as BaseAddon, c as boolean, d as number, f as object, i as turnProviderCapability, l as discriminatedUnion, n as defineCustomActions, p as string, t as customAction, u as literal } from "../dist-If1V2ljI.mjs";
1
+ import { a as BaseAddon, c as boolean, d as number, f as object, i as turnProviderCapability, l as discriminatedUnion, n as defineCustomActions, p as string, t as customAction, u as literal } from "../dist-CCB3dnL3.mjs";
2
2
  //#region src/turn/cloudflare-turn.ts
3
3
  /**
4
4
  * Cloudflare returns ICE servers in several flavours depending on which
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-cloudflare",
3
- "version": "1.2.23",
3
+ "version": "1.2.24",
4
4
  "description": "Cloudflare bundle — Tunnel (network-access) + TURN relay (turn-provider). Multi-entry npm package shipping 2 addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",