@camstack/addon-cloudflare 1.2.23 → 1.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.
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-XfKNtfCc.mjs
1
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -14,6 +14,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
14
14
  */
15
15
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
16
16
  /**
17
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
18
+ * Emitted only when the material on disk actually changed, so an
19
+ * operator who trusted the old certificate by hand is told rather than
20
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
21
+ *
22
+ * Rule: docs/decisions/adr-0227-*.md
23
+ */
24
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
25
+ /**
17
26
  * A newer addon or server-root package version was found by the
18
27
  * authoritative registry check. Emitted once when any observed
19
28
  * `latestVersion` changes (or a package/node first appears behind);
@@ -18661,6 +18670,12 @@ var CameraStatusSchema = object({
18661
18670
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
18662
18671
  fetchedAt: number()
18663
18672
  });
18673
+ var InferenceDeviceExclusionReasonSchema = _enum([
18674
+ "disabled",
18675
+ "unavailable",
18676
+ "cannot-host-camera-root",
18677
+ "accelerator-preferred"
18678
+ ]);
18664
18679
  var NodeInferenceDeviceSchema = object({
18665
18680
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
18666
18681
  key: string(),
@@ -18691,7 +18706,17 @@ var NodeInferenceDeviceSchema = object({
18691
18706
  * available per format; this is the stored selection that becomes the
18692
18707
  * default for EVERY camera landing on this accelerator.
18693
18708
  */
18694
- steps: record(string(), DeviceStepConfigSchema).optional()
18709
+ steps: record(string(), DeviceStepConfigSchema).optional(),
18710
+ /**
18711
+ * `null` when the device IS a camera-root candidate on this node; otherwise
18712
+ * the reason the dispatcher drops it. Computed by the SAME
18713
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
18714
+ * never disagree with the election — deriving it in the UI from
18715
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
18716
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
18717
+ * "an accelerator is serving" predicate).
18718
+ */
18719
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
18695
18720
  });
18696
18721
  var NodeInferenceDevicesSchema = object({
18697
18722
  nodeId: string(),
@@ -22472,7 +22497,12 @@ var ListResultSchema = object({
22472
22497
  probedAt: number()
22473
22498
  });
22474
22499
  var PreferredSchema = LocalInterfaceSchema.nullable();
22475
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22500
+ /**
22501
+ * Candidate base URL for the SDK to race on connect. Order matters —
22502
+ * the SDK should attempt these top-to-bottom with a short per-candidate
22503
+ * timeout (e.g. 1500ms) and cache the winner for the session.
22504
+ */
22505
+ var ConnectionEndpointSchema = object({
22476
22506
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
22477
22507
  label: string(),
22478
22508
  /** Fully-formed base URL with scheme + host + port. */
@@ -22515,7 +22545,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22515
22545
  * ordering between polls.
22516
22546
  */
22517
22547
  priority: number()
22518
- })).readonly() });
22548
+ });
22549
+ /**
22550
+ * Where the advertised local port came from. Ordered most → least
22551
+ * authoritative, and the whole point of returning it: a client must be able to
22552
+ * tell a FACT about the hub's socket from an echo of its own guess.
22553
+ */
22554
+ var LocalPortSourceEnum = _enum([
22555
+ "server-config",
22556
+ "server-env",
22557
+ "caller-hint",
22558
+ "default"
22559
+ ]);
22560
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
22561
+ var AdvertisedLocalPortSchema = object({
22562
+ port: number().int().min(1).max(65535),
22563
+ source: LocalPortSourceEnum
22564
+ });
22565
+ var GetConnectionEndpointsResultSchema = object({
22566
+ endpoints: array(ConnectionEndpointSchema).readonly(),
22567
+ /**
22568
+ * The port the hub built the LAN/loopback URLs with, and where that number
22569
+ * came from.
22570
+ *
22571
+ * Returned rather than merely applied, because "the URL is right" and "the
22572
+ * client can KNOW the URL is right" are different properties. A client that
22573
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
22574
+ * a hub that echoed the port the client sent, so it cannot decide whether to
22575
+ * race the candidate or discard it. With `source` it can: anything but
22576
+ * `caller-hint` is the hub's own socket.
22577
+ *
22578
+ * Absent on hubs predating this field — a client that finds it missing is
22579
+ * talking to an echoing hub and must degrade exactly as it does for
22580
+ * `caller-hint`.
22581
+ */
22582
+ localPort: AdvertisedLocalPortSchema
22583
+ });
22519
22584
  /**
22520
22585
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
22521
22586
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -22536,8 +22601,13 @@ var AllowedAddressesSchema = object({
22536
22601
  */
22537
22602
  addresses: array(string()).readonly() });
22538
22603
  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),
22604
+ /**
22605
+ * LEGACY HINT — do not send from new code. Kept optional so clients
22606
+ * written against the echoing contract keep working; the hub uses it
22607
+ * only when it cannot read its own port, and says so via
22608
+ * `localPort.source === 'caller-hint'`.
22609
+ */
22610
+ port: number().int().min(1).max(65535).optional(),
22541
22611
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22542
22612
  * candidate. Default `true`. */
22543
22613
  includeLoopback: boolean().optional(),
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-XfKNtfCc.mjs
1
+ //#region ../types/dist/event-category-CIa_iT6b.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -14,6 +14,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
14
14
  */
15
15
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
16
16
  /**
17
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
18
+ * Emitted only when the material on disk actually changed, so an
19
+ * operator who trusted the old certificate by hand is told rather than
20
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
21
+ *
22
+ * Rule: docs/decisions/adr-0227-*.md
23
+ */
24
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
25
+ /**
17
26
  * A newer addon or server-root package version was found by the
18
27
  * authoritative registry check. Emitted once when any observed
19
28
  * `latestVersion` changes (or a package/node first appears behind);
@@ -18661,6 +18670,12 @@ var CameraStatusSchema = object({
18661
18670
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
18662
18671
  fetchedAt: number()
18663
18672
  });
18673
+ var InferenceDeviceExclusionReasonSchema = _enum([
18674
+ "disabled",
18675
+ "unavailable",
18676
+ "cannot-host-camera-root",
18677
+ "accelerator-preferred"
18678
+ ]);
18664
18679
  var NodeInferenceDeviceSchema = object({
18665
18680
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
18666
18681
  key: string(),
@@ -18691,7 +18706,17 @@ var NodeInferenceDeviceSchema = object({
18691
18706
  * available per format; this is the stored selection that becomes the
18692
18707
  * default for EVERY camera landing on this accelerator.
18693
18708
  */
18694
- steps: record(string(), DeviceStepConfigSchema).optional()
18709
+ steps: record(string(), DeviceStepConfigSchema).optional(),
18710
+ /**
18711
+ * `null` when the device IS a camera-root candidate on this node; otherwise
18712
+ * the reason the dispatcher drops it. Computed by the SAME
18713
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
18714
+ * never disagree with the election — deriving it in the UI from
18715
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
18716
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
18717
+ * "an accelerator is serving" predicate).
18718
+ */
18719
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
18695
18720
  });
18696
18721
  var NodeInferenceDevicesSchema = object({
18697
18722
  nodeId: string(),
@@ -22472,7 +22497,12 @@ var ListResultSchema = object({
22472
22497
  probedAt: number()
22473
22498
  });
22474
22499
  var PreferredSchema = LocalInterfaceSchema.nullable();
22475
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22500
+ /**
22501
+ * Candidate base URL for the SDK to race on connect. Order matters —
22502
+ * the SDK should attempt these top-to-bottom with a short per-candidate
22503
+ * timeout (e.g. 1500ms) and cache the winner for the session.
22504
+ */
22505
+ var ConnectionEndpointSchema = object({
22476
22506
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
22477
22507
  label: string(),
22478
22508
  /** Fully-formed base URL with scheme + host + port. */
@@ -22515,7 +22545,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22515
22545
  * ordering between polls.
22516
22546
  */
22517
22547
  priority: number()
22518
- })).readonly() });
22548
+ });
22549
+ /**
22550
+ * Where the advertised local port came from. Ordered most → least
22551
+ * authoritative, and the whole point of returning it: a client must be able to
22552
+ * tell a FACT about the hub's socket from an echo of its own guess.
22553
+ */
22554
+ var LocalPortSourceEnum = _enum([
22555
+ "server-config",
22556
+ "server-env",
22557
+ "caller-hint",
22558
+ "default"
22559
+ ]);
22560
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
22561
+ var AdvertisedLocalPortSchema = object({
22562
+ port: number().int().min(1).max(65535),
22563
+ source: LocalPortSourceEnum
22564
+ });
22565
+ var GetConnectionEndpointsResultSchema = object({
22566
+ endpoints: array(ConnectionEndpointSchema).readonly(),
22567
+ /**
22568
+ * The port the hub built the LAN/loopback URLs with, and where that number
22569
+ * came from.
22570
+ *
22571
+ * Returned rather than merely applied, because "the URL is right" and "the
22572
+ * client can KNOW the URL is right" are different properties. A client that
22573
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
22574
+ * a hub that echoed the port the client sent, so it cannot decide whether to
22575
+ * race the candidate or discard it. With `source` it can: anything but
22576
+ * `caller-hint` is the hub's own socket.
22577
+ *
22578
+ * Absent on hubs predating this field — a client that finds it missing is
22579
+ * talking to an echoing hub and must degrade exactly as it does for
22580
+ * `caller-hint`.
22581
+ */
22582
+ localPort: AdvertisedLocalPortSchema
22583
+ });
22519
22584
  /**
22520
22585
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
22521
22586
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -22536,8 +22601,13 @@ var AllowedAddressesSchema = object({
22536
22601
  */
22537
22602
  addresses: array(string()).readonly() });
22538
22603
  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),
22604
+ /**
22605
+ * LEGACY HINT — do not send from new code. Kept optional so clients
22606
+ * written against the echoing contract keep working; the hub uses it
22607
+ * only when it cannot read its own port, and says so via
22608
+ * `localPort.source === 'caller-hint'`.
22609
+ */
22610
+ port: number().int().min(1).max(65535).optional(),
22541
22611
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22542
22612
  * candidate. Default `true`. */
22543
22613
  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-bN2ruooH.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-C55lXXNr.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-bN2ruooH.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-C55lXXNr.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.25",
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",