@camstack/addon-tailscale 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.
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  enumerable: true
25
25
  }) : target, mod));
26
26
  //#endregion
27
- const require_dist = require("../dist-Of54y7eC.js");
27
+ const require_dist = require("../dist-CByJkMGY.js");
28
28
  let node_child_process = require("node:child_process");
29
29
  let node_util = require("node:util");
30
30
  let node_fs = require("node:fs");
@@ -1,4 +1,4 @@
1
- import { a as EventCategory, i as BaseAddon, n as networkAccessCapability, r as BOOT_RECOVERY_BACKOFF_MS, t as meshNetworkCapability } from "../dist-9AnjWRPW.mjs";
1
+ import { a as EventCategory, i as BaseAddon, n as networkAccessCapability, r as BOOT_RECOVERY_BACKOFF_MS, t as meshNetworkCapability } from "../dist-C8q1YCua.mjs";
2
2
  import { execFile, spawn } from "node:child_process";
3
3
  import { promisify } from "node:util";
4
4
  import * as fs from "node:fs";
@@ -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);
@@ -18673,6 +18682,12 @@ var CameraStatusSchema = object({
18673
18682
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
18674
18683
  fetchedAt: number()
18675
18684
  });
18685
+ var InferenceDeviceExclusionReasonSchema = _enum([
18686
+ "disabled",
18687
+ "unavailable",
18688
+ "cannot-host-camera-root",
18689
+ "accelerator-preferred"
18690
+ ]);
18676
18691
  var NodeInferenceDeviceSchema = object({
18677
18692
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
18678
18693
  key: string(),
@@ -18703,7 +18718,17 @@ var NodeInferenceDeviceSchema = object({
18703
18718
  * available per format; this is the stored selection that becomes the
18704
18719
  * default for EVERY camera landing on this accelerator.
18705
18720
  */
18706
- steps: record(string(), DeviceStepConfigSchema).optional()
18721
+ steps: record(string(), DeviceStepConfigSchema).optional(),
18722
+ /**
18723
+ * `null` when the device IS a camera-root candidate on this node; otherwise
18724
+ * the reason the dispatcher drops it. Computed by the SAME
18725
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
18726
+ * never disagree with the election — deriving it in the UI from
18727
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
18728
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
18729
+ * "an accelerator is serving" predicate).
18730
+ */
18731
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
18707
18732
  });
18708
18733
  var NodeInferenceDevicesSchema = object({
18709
18734
  nodeId: string(),
@@ -22461,7 +22486,12 @@ var ListResultSchema = object({
22461
22486
  probedAt: number()
22462
22487
  });
22463
22488
  var PreferredSchema = LocalInterfaceSchema.nullable();
22464
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22489
+ /**
22490
+ * Candidate base URL for the SDK to race on connect. Order matters —
22491
+ * the SDK should attempt these top-to-bottom with a short per-candidate
22492
+ * timeout (e.g. 1500ms) and cache the winner for the session.
22493
+ */
22494
+ var ConnectionEndpointSchema = object({
22465
22495
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
22466
22496
  label: string(),
22467
22497
  /** Fully-formed base URL with scheme + host + port. */
@@ -22504,7 +22534,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22504
22534
  * ordering between polls.
22505
22535
  */
22506
22536
  priority: number()
22507
- })).readonly() });
22537
+ });
22538
+ /**
22539
+ * Where the advertised local port came from. Ordered most → least
22540
+ * authoritative, and the whole point of returning it: a client must be able to
22541
+ * tell a FACT about the hub's socket from an echo of its own guess.
22542
+ */
22543
+ var LocalPortSourceEnum = _enum([
22544
+ "server-config",
22545
+ "server-env",
22546
+ "caller-hint",
22547
+ "default"
22548
+ ]);
22549
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
22550
+ var AdvertisedLocalPortSchema = object({
22551
+ port: number().int().min(1).max(65535),
22552
+ source: LocalPortSourceEnum
22553
+ });
22554
+ var GetConnectionEndpointsResultSchema = object({
22555
+ endpoints: array(ConnectionEndpointSchema).readonly(),
22556
+ /**
22557
+ * The port the hub built the LAN/loopback URLs with, and where that number
22558
+ * came from.
22559
+ *
22560
+ * Returned rather than merely applied, because "the URL is right" and "the
22561
+ * client can KNOW the URL is right" are different properties. A client that
22562
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
22563
+ * a hub that echoed the port the client sent, so it cannot decide whether to
22564
+ * race the candidate or discard it. With `source` it can: anything but
22565
+ * `caller-hint` is the hub's own socket.
22566
+ *
22567
+ * Absent on hubs predating this field — a client that finds it missing is
22568
+ * talking to an echoing hub and must degrade exactly as it does for
22569
+ * `caller-hint`.
22570
+ */
22571
+ localPort: AdvertisedLocalPortSchema
22572
+ });
22508
22573
  /**
22509
22574
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
22510
22575
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -22525,8 +22590,13 @@ var AllowedAddressesSchema = object({
22525
22590
  */
22526
22591
  addresses: array(string()).readonly() });
22527
22592
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
22528
- /** Local hub HTTP port to use in base URLs. */
22529
- port: number().int().min(1).max(65535),
22593
+ /**
22594
+ * LEGACY HINT — do not send from new code. Kept optional so clients
22595
+ * written against the echoing contract keep working; the hub uses it
22596
+ * only when it cannot read its own port, and says so via
22597
+ * `localPort.source === 'caller-hint'`.
22598
+ */
22599
+ port: number().int().min(1).max(65535).optional(),
22530
22600
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22531
22601
  * candidate. Default `true`. */
22532
22602
  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);
@@ -18673,6 +18682,12 @@ var CameraStatusSchema = object({
18673
18682
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
18674
18683
  fetchedAt: number()
18675
18684
  });
18685
+ var InferenceDeviceExclusionReasonSchema = _enum([
18686
+ "disabled",
18687
+ "unavailable",
18688
+ "cannot-host-camera-root",
18689
+ "accelerator-preferred"
18690
+ ]);
18676
18691
  var NodeInferenceDeviceSchema = object({
18677
18692
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
18678
18693
  key: string(),
@@ -18703,7 +18718,17 @@ var NodeInferenceDeviceSchema = object({
18703
18718
  * available per format; this is the stored selection that becomes the
18704
18719
  * default for EVERY camera landing on this accelerator.
18705
18720
  */
18706
- steps: record(string(), DeviceStepConfigSchema).optional()
18721
+ steps: record(string(), DeviceStepConfigSchema).optional(),
18722
+ /**
18723
+ * `null` when the device IS a camera-root candidate on this node; otherwise
18724
+ * the reason the dispatcher drops it. Computed by the SAME
18725
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
18726
+ * never disagree with the election — deriving it in the UI from
18727
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
18728
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
18729
+ * "an accelerator is serving" predicate).
18730
+ */
18731
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
18707
18732
  });
18708
18733
  var NodeInferenceDevicesSchema = object({
18709
18734
  nodeId: string(),
@@ -22461,7 +22486,12 @@ var ListResultSchema = object({
22461
22486
  probedAt: number()
22462
22487
  });
22463
22488
  var PreferredSchema = LocalInterfaceSchema.nullable();
22464
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22489
+ /**
22490
+ * Candidate base URL for the SDK to race on connect. Order matters —
22491
+ * the SDK should attempt these top-to-bottom with a short per-candidate
22492
+ * timeout (e.g. 1500ms) and cache the winner for the session.
22493
+ */
22494
+ var ConnectionEndpointSchema = object({
22465
22495
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
22466
22496
  label: string(),
22467
22497
  /** Fully-formed base URL with scheme + host + port. */
@@ -22504,7 +22534,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
22504
22534
  * ordering between polls.
22505
22535
  */
22506
22536
  priority: number()
22507
- })).readonly() });
22537
+ });
22538
+ /**
22539
+ * Where the advertised local port came from. Ordered most → least
22540
+ * authoritative, and the whole point of returning it: a client must be able to
22541
+ * tell a FACT about the hub's socket from an echo of its own guess.
22542
+ */
22543
+ var LocalPortSourceEnum = _enum([
22544
+ "server-config",
22545
+ "server-env",
22546
+ "caller-hint",
22547
+ "default"
22548
+ ]);
22549
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
22550
+ var AdvertisedLocalPortSchema = object({
22551
+ port: number().int().min(1).max(65535),
22552
+ source: LocalPortSourceEnum
22553
+ });
22554
+ var GetConnectionEndpointsResultSchema = object({
22555
+ endpoints: array(ConnectionEndpointSchema).readonly(),
22556
+ /**
22557
+ * The port the hub built the LAN/loopback URLs with, and where that number
22558
+ * came from.
22559
+ *
22560
+ * Returned rather than merely applied, because "the URL is right" and "the
22561
+ * client can KNOW the URL is right" are different properties. A client that
22562
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
22563
+ * a hub that echoed the port the client sent, so it cannot decide whether to
22564
+ * race the candidate or discard it. With `source` it can: anything but
22565
+ * `caller-hint` is the hub's own socket.
22566
+ *
22567
+ * Absent on hubs predating this field — a client that finds it missing is
22568
+ * talking to an echoing hub and must degrade exactly as it does for
22569
+ * `caller-hint`.
22570
+ */
22571
+ localPort: AdvertisedLocalPortSchema
22572
+ });
22508
22573
  /**
22509
22574
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
22510
22575
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -22525,8 +22590,13 @@ var AllowedAddressesSchema = object({
22525
22590
  */
22526
22591
  addresses: array(string()).readonly() });
22527
22592
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
22528
- /** Local hub HTTP port to use in base URLs. */
22529
- port: number().int().min(1).max(65535),
22593
+ /**
22594
+ * LEGACY HINT — do not send from new code. Kept optional so clients
22595
+ * written against the echoing contract keep working; the hub uses it
22596
+ * only when it cannot read its own port, and says so via
22597
+ * `localPort.source === 'caller-hint'`.
22598
+ */
22599
+ port: number().int().min(1).max(65535).optional(),
22530
22600
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22531
22601
  * candidate. Default `true`. */
22532
22602
  includeLoopback: boolean().optional(),
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-Of54y7eC.js");
5
+ const require_dist = require("../dist-CByJkMGY.js");
6
6
  let node_crypto = require("node:crypto");
7
7
  let node_child_process = require("node:child_process");
8
8
  //#region src/ingress/tailscale-cli.ts
@@ -1,4 +1,4 @@
1
- import { a as EventCategory, i as BaseAddon, n as networkAccessCapability } from "../dist-9AnjWRPW.mjs";
1
+ import { a as EventCategory, i as BaseAddon, n as networkAccessCapability } from "../dist-C8q1YCua.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { execFile } from "node:child_process";
4
4
  import { promisify } from "node:util";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-tailscale",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "Tailscale bundle for CamStack — joins the host to a tailnet (client) and exposes the hub via Serve/Funnel (ingress). Multi-entry npm package shipping 2 addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",