@camstack/system 1.2.470 → 1.2.471

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 (85) hide show
  1. package/dist/addon-runner.js +46 -11
  2. package/dist/addon-runner.mjs +46 -11
  3. package/dist/{agent-https-DmNQyAl7.mjs → agent-https-DHBvFZJS.mjs} +1 -1
  4. package/dist/{agent-https-D_oo3PNv.js → agent-https-bH6bKDeK.js} +1 -1
  5. package/dist/auth/user-manager.d.ts +2 -2
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  10. package/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  12. package/dist/builtins/autotrack/index.js +1 -1
  13. package/dist/builtins/autotrack/index.mjs +1 -1
  14. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  15. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  16. package/dist/builtins/calendars/calendars.addon.js +1 -1
  17. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  18. package/dist/builtins/camera-grid/index.js +1 -1
  19. package/dist/builtins/camera-grid/index.mjs +1 -1
  20. package/dist/builtins/composer/composer.addon.js +2 -2
  21. package/dist/builtins/composer/composer.addon.mjs +2 -2
  22. package/dist/builtins/console-logging/index.js +1 -1
  23. package/dist/builtins/console-logging/index.mjs +1 -1
  24. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  25. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  26. package/dist/builtins/device-history/device-history.addon.js +1 -1
  27. package/dist/builtins/device-history/device-history.addon.mjs +1 -1
  28. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  29. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  30. package/dist/builtins/hub-forwarder/index.js +1 -1
  31. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  32. package/dist/builtins/keychain/index.js +3 -3
  33. package/dist/builtins/keychain/index.mjs +3 -3
  34. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  35. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  36. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  37. package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  38. package/dist/builtins/local-network/local-network.addon.js +2 -2
  39. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  40. package/dist/builtins/loki-logging/index.js +1 -1
  41. package/dist/builtins/loki-logging/index.mjs +1 -1
  42. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  43. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  44. package/dist/builtins/platform-probe/coral-accelerators.d.ts +14 -4
  45. package/dist/builtins/platform-probe/index.js +9 -6
  46. package/dist/builtins/platform-probe/index.mjs +9 -6
  47. package/dist/builtins/record-entries/index.js +1 -1
  48. package/dist/builtins/record-entries/index.mjs +1 -1
  49. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  50. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  51. package/dist/builtins/snapshot/index.js +1 -1
  52. package/dist/builtins/snapshot/index.mjs +1 -1
  53. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  54. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  55. package/dist/builtins/sqlite-storage/index.js +1 -1
  56. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  57. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  58. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  59. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  60. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  61. package/dist/builtins/system-config/system-config.addon.js +3 -3
  62. package/dist/builtins/system-config/system-config.addon.mjs +3 -3
  63. package/dist/builtins/winston-logging/index.js +1 -1
  64. package/dist/builtins/winston-logging/index.mjs +1 -1
  65. package/dist/{composition-sources-CRJffEiB.js → composition-sources-B5uJZXZ1.js} +1 -1
  66. package/dist/{composition-sources-B0tqvf0t.mjs → composition-sources-DRw_vBKH.mjs} +1 -1
  67. package/dist/{constants--A505iuO.mjs → constants-5lA8Z9d8.mjs} +1 -1
  68. package/dist/{constants-WF1AqoKF.js → constants-CToE4OFp.js} +1 -1
  69. package/dist/{coral-accelerators-Cri32b7q.js → coral-accelerators-BSVsBVzt.js} +46 -11
  70. package/dist/{coral-accelerators-Dl-GnMHn.mjs → coral-accelerators-BW3OcrLD.mjs} +46 -11
  71. package/dist/{device-ca-DYmToMp8.mjs → device-ca-URrs1lxK.mjs} +1 -1
  72. package/dist/{device-ca-R4MZZtc0.js → device-ca-nOCYVFS4.js} +1 -1
  73. package/dist/{dist-X1r44BdF.mjs → dist-5XUG7iYJ.mjs} +6764 -1416
  74. package/dist/{dist-DRL3rEfN.js → dist-BjcWEfRy.js} +6764 -1416
  75. package/dist/file-host-worker.js +1 -1
  76. package/dist/file-host-worker.mjs +1 -1
  77. package/dist/{hub-mdns-ciao-DUoTS6jN.js → hub-mdns-ciao-vEWhJ_SD.js} +2 -2
  78. package/dist/{hub-mdns-ciao-CZV5Hion.mjs → hub-mdns-ciao-zD3JojB_.mjs} +2 -2
  79. package/dist/index.js +8 -8
  80. package/dist/index.mjs +8 -8
  81. package/dist/{restore-archive-Df6PsOHP.js → restore-archive-B64m2nAj.js} +1 -1
  82. package/dist/{restore-archive-X0ciGMmO.mjs → restore-archive-CN1pJTRn.mjs} +1 -1
  83. package/dist/{wal-maintenance-DYvzJiuK.js → wal-maintenance-BNXVX-ot.js} +0 -0
  84. package/dist/{wal-maintenance-D6J_MmZ8.mjs → wal-maintenance-Bl2I-ZcR.mjs} +0 -0
  85. package/package.json +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-DRL3rEfN.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.js");
7
7
  const require_log_read_filter = require("../../log-read-filter-Bi066jwU.js");
8
8
  let zod = require("zod");
9
9
  //#region src/builtins/loki-logging/loki-payload.ts
@@ -1,4 +1,4 @@
1
- import { Ln as logDestinationCapability, ei as BaseAddon } from "../../dist-X1r44BdF.mjs";
1
+ import { Ln as logDestinationCapability, ei as BaseAddon } from "../../dist-5XUG7iYJ.mjs";
2
2
  import { n as compileLogFilter, o as lineMatches } from "../../log-read-filter-D7Ev3zm-.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/builtins/loki-logging/loki-payload.ts
@@ -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-DRL3rEfN.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.js");
7
7
  let node_fs_promises = require("node:fs/promises");
8
8
  let node_util = require("node:util");
9
9
  let node_os = require("node:os");
@@ -1,4 +1,4 @@
1
- import { $r as errMsg, Da as EventCategory, Ui as createEvent, Un as metricsProviderCapability, ei as BaseAddon, ht as UNATTRIBUTED_BUCKET_KEY, ir as reducePoints, mn as foldSnapshotByFunction, rt as ROOT_BUCKET_KEY, sr as resolveBucketMs } from "../../dist-X1r44BdF.mjs";
1
+ import { $r as errMsg, Da as EventCategory, Ui as createEvent, Un as metricsProviderCapability, ei as BaseAddon, ht as UNATTRIBUTED_BUCKET_KEY, ir as reducePoints, mn as foldSnapshotByFunction, rt as ROOT_BUCKET_KEY, sr as resolveBucketMs } from "../../dist-5XUG7iYJ.mjs";
2
2
  import { access, readFile, readdir } from "node:fs/promises";
3
3
  import { promisify } from "node:util";
4
4
  import * as os$1 from "node:os";
@@ -12,7 +12,7 @@ export interface CoralFs {
12
12
  * `null` and an empty listing both mean "the bus is not observable".
13
13
  */
14
14
  listUsbDevices(): readonly string[] | null;
15
- /** Read a `<sysfsNode>/<attr>` value (idVendor / idProduct), trimmed. */
15
+ /** Read a `<sysfsNode>/<attr>` value (idVendor / idProduct / busnum / devnum), trimmed. */
16
16
  readUsbAttr(device: string, attr: string): string;
17
17
  /** PCI function names under `/sys/bus/pci/devices` (e.g. `0000:03:00.0`). */
18
18
  listPciDevices(): readonly string[];
@@ -20,7 +20,7 @@ export interface CoralFs {
20
20
  readPciAttr(device: string, attr: string): string;
21
21
  /** Entry names under `/sys/class/apex` (the gasket/apex driver: `apex_0`, …). */
22
22
  listApexClass(): readonly string[];
23
- /** Whether this process can open a device node for read AND write. */
23
+ /** Whether this process can open a device node (`/dev/apex_N`, `/dev/bus/usb/…`) for read AND write. */
24
24
  canOpen(path: string): boolean;
25
25
  /** Whether a filesystem path exists (the libedgetpu delegate, `/dev/apex_N`). */
26
26
  exists(path: string): boolean;
@@ -38,7 +38,8 @@ export type CoralUsbBusView = "observed" | "unobservable";
38
38
  /**
39
39
  * Which evidence decided the Coral answer — logged by the probe so a node
40
40
  * that reports (or stops reporting) a Coral says WHY:
41
- * - `usb-ids` — a Coral USB id is on the bus;
41
+ * - `usb-ids` — a Coral USB id is on the bus (usable or not: its device node
42
+ * decides, see {@link CoralDetection.inaccessibleUsbNodes});
42
43
  * - `pci` — a PCIe/M.2 Coral (usable or not) is on the PCI bus;
43
44
  * - `delegate-fallback` — the USB bus is not observable and the libedgetpu
44
45
  * delegate is installed, so one USB unit is ASSUMED;
@@ -49,6 +50,13 @@ export interface CoralDetection {
49
50
  readonly info: CoralInfo | null;
50
51
  readonly usbBus: CoralUsbBusView;
51
52
  readonly decidedBy: CoralDecision;
53
+ /**
54
+ * The device node of every USB Coral sysfs lists but this process cannot
55
+ * open read/write (`/dev/bus/usb/<BBB>/<DDD>`, or `<sysfs entry>` when
56
+ * sysfs gave no bus/device number) — the evidence behind a USB
57
+ * `device-not-accessible`. Empty when every listed stick is usable.
58
+ */
59
+ readonly inaccessibleUsbNodes: readonly string[];
52
60
  }
53
61
  /**
54
62
  * Detect Coral Edge TPUs on USB and PCIe/M.2 — the answer only. See
@@ -58,7 +66,9 @@ export declare function classifyCoralAccelerator(fsx: CoralFs, delegateHost?: Ed
58
66
  /**
59
67
  * Detect Coral Edge TPUs on USB and PCIe/M.2, with the evidence that decided.
60
68
  *
61
- * - USB: every matching USB device counts (multiple Corals run concurrently).
69
+ * - USB: every matching USB device counts (multiple Corals run concurrently),
70
+ * usable only if its `/dev/bus/usb/<BBB>/<DDD>` node opens read/write — a
71
+ * listed stick whose node is missing or refused is `device-not-accessible`.
62
72
  * - PCIe: the apex driver's units, each usable only if its device node opens;
63
73
  * a Coral PCI function the driver did not bind is `driver-missing`.
64
74
  * - Fallback: when the USB bus is NOT OBSERVABLE (`/sys/bus/usb/devices`
@@ -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-DRL3rEfN.js");
7
- const require_coral_accelerators = require("../../coral-accelerators-Cri32b7q.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.js");
7
+ const require_coral_accelerators = require("../../coral-accelerators-BSVsBVzt.js");
8
8
  let node_util = require("node:util");
9
9
  let node_os = require("node:os");
10
10
  node_os = require_chunk.__toESM(node_os);
@@ -591,7 +591,8 @@ var PlatformScorer = class {
591
591
  this.logger.info("Coral Edge TPU probe", { meta: {
592
592
  usbBus: detection.usbBus,
593
593
  decidedBy: detection.decidedBy,
594
- units: coral?.units ?? []
594
+ units: coral?.units ?? [],
595
+ inaccessibleUsbNodes: detection.inaccessibleUsbNodes
595
596
  } });
596
597
  if (coral) {
597
598
  if ((coral.units ?? []).length > 0) this.logger.info("Coral Edge TPU detected", { meta: {
@@ -601,7 +602,8 @@ var PlatformScorer = class {
601
602
  for (const unavailable of coral.unavailable ?? []) this.logger.warn("Coral Edge TPU present but unusable", { meta: {
602
603
  bus: unavailable.bus,
603
604
  count: unavailable.count,
604
- reason: unavailable.reason
605
+ reason: unavailable.reason,
606
+ ...unavailable.bus === "usb" ? { nodes: detection.inaccessibleUsbNodes } : {}
605
607
  } });
606
608
  }
607
609
  return detection;
@@ -629,7 +631,8 @@ var PlatformScorer = class {
629
631
  usbBus: detection.usbBus,
630
632
  decidedBy: detection.decidedBy,
631
633
  before: coralSignature(cached.hardware.coral),
632
- after: coralSignature(detection.info)
634
+ after: coralSignature(detection.info),
635
+ inaccessibleUsbNodes: detection.inaccessibleUsbNodes
633
636
  } });
634
637
  const next = withCoral(cached, detection.info);
635
638
  this.cached = next;
@@ -886,7 +889,7 @@ var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
886
889
  this.ctx.logger.debug("ensurePython unavailable for platform probe", { meta: { error: require_dist.errMsg(err) } });
887
890
  return null;
888
891
  });
889
- this.scorer = new PlatformScorer(this.ctx.logger, embeddedPython);
892
+ this.scorer = new PlatformScorer(this.ctx.logger.withTags({ nodeId: this.bareLocalNodeId() }), embeddedPython);
890
893
  const emitPhase = (phase, payload) => {
891
894
  this.ctx.eventBus?.emit({
892
895
  id: `platform-probe-${phase}-${Date.now()}`,
@@ -1,6 +1,6 @@
1
1
  import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
2
- import { $n as platformProbeCapability, $r as errMsg, Da as EventCategory, Ji as emitReadiness, _r as scoreRuntimes, an as enumerateInferenceDevices, ei as BaseAddon } from "../../dist-X1r44BdF.mjs";
3
- import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-Dl-GnMHn.mjs";
2
+ import { $n as platformProbeCapability, $r as errMsg, Da as EventCategory, Ji as emitReadiness, _r as scoreRuntimes, an as enumerateInferenceDevices, ei as BaseAddon } from "../../dist-5XUG7iYJ.mjs";
3
+ import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-BW3OcrLD.mjs";
4
4
  import { promisify } from "node:util";
5
5
  import * as os$1 from "node:os";
6
6
  import * as fs from "node:fs";
@@ -585,7 +585,8 @@ var PlatformScorer = class {
585
585
  this.logger.info("Coral Edge TPU probe", { meta: {
586
586
  usbBus: detection.usbBus,
587
587
  decidedBy: detection.decidedBy,
588
- units: coral?.units ?? []
588
+ units: coral?.units ?? [],
589
+ inaccessibleUsbNodes: detection.inaccessibleUsbNodes
589
590
  } });
590
591
  if (coral) {
591
592
  if ((coral.units ?? []).length > 0) this.logger.info("Coral Edge TPU detected", { meta: {
@@ -595,7 +596,8 @@ var PlatformScorer = class {
595
596
  for (const unavailable of coral.unavailable ?? []) this.logger.warn("Coral Edge TPU present but unusable", { meta: {
596
597
  bus: unavailable.bus,
597
598
  count: unavailable.count,
598
- reason: unavailable.reason
599
+ reason: unavailable.reason,
600
+ ...unavailable.bus === "usb" ? { nodes: detection.inaccessibleUsbNodes } : {}
599
601
  } });
600
602
  }
601
603
  return detection;
@@ -623,7 +625,8 @@ var PlatformScorer = class {
623
625
  usbBus: detection.usbBus,
624
626
  decidedBy: detection.decidedBy,
625
627
  before: coralSignature(cached.hardware.coral),
626
- after: coralSignature(detection.info)
628
+ after: coralSignature(detection.info),
629
+ inaccessibleUsbNodes: detection.inaccessibleUsbNodes
627
630
  } });
628
631
  const next = withCoral(cached, detection.info);
629
632
  this.cached = next;
@@ -880,7 +883,7 @@ var PlatformProbeNativeAddon = class extends BaseAddon {
880
883
  this.ctx.logger.debug("ensurePython unavailable for platform probe", { meta: { error: errMsg(err) } });
881
884
  return null;
882
885
  });
883
- this.scorer = new PlatformScorer(this.ctx.logger, embeddedPython);
886
+ this.scorer = new PlatformScorer(this.ctx.logger.withTags({ nodeId: this.bareLocalNodeId() }), embeddedPython);
884
887
  const emitPhase = (phase, payload) => {
885
888
  this.ctx.eventBus?.emit({
886
889
  id: `platform-probe-${phase}-${Date.now()}`,
@@ -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-DRL3rEfN.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.js");
7
7
  let zod = require("zod");
8
8
  let node_crypto = require("node:crypto");
9
9
  //#region src/builtins/record-entries/entries-service.ts
@@ -1,4 +1,4 @@
1
- import { ei as BaseAddon, ha as recordSecretRef, ji as UnknownRecordKindError, nr as recordEntriesCapability, sa as mapSecretLeaves, ui as InvalidRecordError } from "../../dist-X1r44BdF.mjs";
1
+ import { ei as BaseAddon, ha as recordSecretRef, ji as UnknownRecordKindError, nr as recordEntriesCapability, sa as mapSecretLeaves, ui as InvalidRecordError } from "../../dist-5XUG7iYJ.mjs";
2
2
  import { z } from "zod";
3
3
  import { randomUUID } from "node:crypto";
4
4
  //#region src/builtins/record-entries/entries-service.ts
@@ -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-DRL3rEfN.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.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 { Da as EventCategory, ei as BaseAddon } from "../../dist-X1r44BdF.mjs";
1
+ import { Da as EventCategory, ei as BaseAddon } from "../../dist-5XUG7iYJ.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-DRL3rEfN.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.js");
7
7
  const require_snapshot_courtesy = require("../../snapshot-courtesy-D_C5-nC0.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { $r as errMsg, Da as EventCategory, Dt as batteryCapability, Et as bareAddonId, Hn as memoizePinnedFfmpeg, Qr as DeviceType, Xr as DeviceFeature, Xt as deriveBatteryPresence, ca as nodePin, ei as BaseAddon, kr as streamQualityLabel, o as BatteryStatusSchema, xr as snapshotCapability } from "../../dist-X1r44BdF.mjs";
1
+ import { $r as errMsg, Da as EventCategory, Dt as batteryCapability, Et as bareAddonId, Hn as memoizePinnedFfmpeg, Qr as DeviceType, Xr as DeviceFeature, Xt as deriveBatteryPresence, ca as nodePin, ei as BaseAddon, kr as streamQualityLabel, o as BatteryStatusSchema, xr as snapshotCapability } from "../../dist-5XUG7iYJ.mjs";
2
2
  import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg } from "../../snapshot-courtesy-CyFs1M3I.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -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-DRL3rEfN.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.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 { Dr as storageProviderCapability, ei as BaseAddon, pn as filesystemBrowseCapability } from "../../dist-X1r44BdF.mjs";
1
+ import { Dr as storageProviderCapability, ei as BaseAddon, pn as filesystemBrowseCapability } from "../../dist-5XUG7iYJ.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";
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
6
  const require_builtins_sqlite_storage_filesystem_storage_addon = require("./filesystem-storage.addon.js");
7
- const require_wal_maintenance = require("../../wal-maintenance-DYvzJiuK.js");
7
+ const require_wal_maintenance = require("../../wal-maintenance-BNXVX-ot.js");
8
8
  const require_builtins_sqlite_storage_sqlite_settings_addon = require("./sqlite-settings.addon.js");
9
9
  //#region src/builtins/sqlite-storage/config-store.ts
10
10
  var ConfigStore = class {
@@ -1,5 +1,5 @@
1
1
  import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./filesystem-storage.addon.mjs";
2
- import { A as SQLITE_MMAP_CEILING_BYTES, B as SQLITE_SLOW_CALL_MS, F as sqlitePageCacheKibFor, H as sqliteEngineStorm, I as SQLITE_ENGINE_STORM_WALL_SHARE, L as SQLITE_PROFILE_REPORT_FLOOR_MS, M as SQLITE_PAGE_CACHE_CEILING_KIB, N as SQLITE_PAGE_CACHE_FLOOR_KIB, P as sqliteMmapSizeFor, R as SQLITE_PROFILE_REPORT_INTERVAL_MS, V as SqliteOpProfiler, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, j as SQLITE_MMAP_FLOOR_BYTES, k as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as SQLITE_PROFILE_TOP_N } from "../../wal-maintenance-D6J_MmZ8.mjs";
2
+ import { A as SQLITE_MMAP_CEILING_BYTES, B as SQLITE_SLOW_CALL_MS, F as sqlitePageCacheKibFor, H as sqliteEngineStorm, I as SQLITE_ENGINE_STORM_WALL_SHARE, L as SQLITE_PROFILE_REPORT_FLOOR_MS, M as SQLITE_PAGE_CACHE_CEILING_KIB, N as SQLITE_PAGE_CACHE_FLOOR_KIB, P as sqliteMmapSizeFor, R as SQLITE_PROFILE_REPORT_INTERVAL_MS, V as SqliteOpProfiler, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, j as SQLITE_MMAP_FLOOR_BYTES, k as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as SQLITE_PROFILE_TOP_N } from "../../wal-maintenance-Bl2I-ZcR.mjs";
3
3
  import { SqliteSettingsAddon } from "./sqlite-settings.addon.mjs";
4
4
  //#region src/builtins/sqlite-storage/config-store.ts
5
5
  var ConfigStore = class {
@@ -3,9 +3,9 @@ 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-DRL3rEfN.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.js");
7
7
  const require_retired_settings_keys = require("../../retired-settings-keys-CGUqX-Oz.js");
8
- const require_wal_maintenance = require("../../wal-maintenance-DYvzJiuK.js");
8
+ const require_wal_maintenance = require("../../wal-maintenance-BNXVX-ot.js");
9
9
  const require_sqlite_snapshot_protocol = require("../../sqlite-snapshot-protocol-B9OndqZv.js");
10
10
  const require_wal_checkpoint_policy = require("../../wal-checkpoint-policy-d2z2qPqx.js");
11
11
  let node_fs_promises = require("node:fs/promises");
@@ -1,6 +1,6 @@
1
- import { $r as errMsg, C as DATA_STORE_DATABASES, Cr as storageAdminCapability, Et as bareAddonId, Gt as dataStoreProviderCapability, Ir as vectorStoreCapability, Kt as databaseSnapshotCapability, S as DATABASE_SNAPSHOT_TIMEOUT_MS, Si as RecordKindDeclarationSchema, b as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, di as NoCallerError, ei as BaseAddon, gi as RECORD_SWEEP_INTERVAL_MS, ji as UnknownRecordKindError, ki as TransactRefusedError, oi as DeclarationRefusedError, rr as recordsCapability, ua as normalizeSecretOwner, ui as InvalidRecordError, x as DATABASE_SNAPSHOT_SUFFIX, yi as RUNTIME_DEFAULTS } from "../../dist-X1r44BdF.mjs";
1
+ import { $r as errMsg, C as DATA_STORE_DATABASES, Cr as storageAdminCapability, Et as bareAddonId, Gt as dataStoreProviderCapability, Ir as vectorStoreCapability, Kt as databaseSnapshotCapability, S as DATABASE_SNAPSHOT_TIMEOUT_MS, Si as RecordKindDeclarationSchema, b as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, di as NoCallerError, ei as BaseAddon, gi as RECORD_SWEEP_INTERVAL_MS, ji as UnknownRecordKindError, ki as TransactRefusedError, oi as DeclarationRefusedError, rr as recordsCapability, ua as normalizeSecretOwner, ui as InvalidRecordError, x as DATABASE_SNAPSHOT_SUFFIX, yi as RUNTIME_DEFAULTS } from "../../dist-5XUG7iYJ.mjs";
2
2
  import { r as retiredKeyStoreOf, t as purgeRetiredSettingsKeys } from "../../retired-settings-keys-C_Kjp-Bj.mjs";
3
- import { C as RecordsEngine, D as callVector, E as callRecords, O as controlTargetOf, S as trustResult, T as callData, _ as collectTransferables, a as WalMaintenance, c as vectorProviderOfOwnedFile, d as CrossDatabaseTransactError, f as DatabaseBusyError, l as SqliteSettingsBackend, m as rehydrateError, o as createVectorIndex, p as DuplicatePlacementError, s as vectorProviderOf, u as CollectionPlacementError, v as isFileHostMessage, w as callControl } from "../../wal-maintenance-D6J_MmZ8.mjs";
3
+ import { C as RecordsEngine, D as callVector, E as callRecords, O as controlTargetOf, S as trustResult, T as callData, _ as collectTransferables, a as WalMaintenance, c as vectorProviderOfOwnedFile, d as CrossDatabaseTransactError, f as DatabaseBusyError, l as SqliteSettingsBackend, m as rehydrateError, o as createVectorIndex, p as DuplicatePlacementError, s as vectorProviderOf, u as CollectionPlacementError, v as isFileHostMessage, w as callControl } from "../../wal-maintenance-Bl2I-ZcR.mjs";
4
4
  import { r as isSnapshotWorkerMessage } from "../../sqlite-snapshot-protocol-2QaTouWV.mjs";
5
5
  import { a as isWorkerMessage, t as WAL_CHECKPOINT_LARGE_PASS_FRAMES } from "../../wal-checkpoint-policy-BahrTtyD.mjs";
6
6
  import { createRequire } from "node:module";
@@ -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-DRL3rEfN.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { Bn as mayReadLocation, Da as EventCategory, En as isLocationEnabled, Ki as defineRecordKinds, Lr as withLocationMode, Nn as legacyModeOf, Tr as storageMigrationCapability, Vn as mayWriteToLocation, Wn as modeMayWrite, _a as resolveSecretMarkers, _i as REDACTED_SECRET, _n as gbToBytes, da as parseJsonObject, dr as resolveLocationMode, dt as StorageLocationModeSchema, ei as BaseAddon, ft as StorageLocationTypeSchema, la as normalizeNodeId, ln as evictionPolicyOfLocation, pt as StorageMigrationJobSchema, q as LegacyStorageLocationDefaultSchema, ra as isSecretMarker, ut as StorageCleanupJobSchema, vr as settingsStoreCapability, wa as transformSecretWrite, wr as storageCapability, ya as secretTreeFromPaths, zi as collectSecretConfigKeys } from "../../dist-X1r44BdF.mjs";
1
+ import { Bn as mayReadLocation, Da as EventCategory, En as isLocationEnabled, Ki as defineRecordKinds, Lr as withLocationMode, Nn as legacyModeOf, Tr as storageMigrationCapability, Vn as mayWriteToLocation, Wn as modeMayWrite, _a as resolveSecretMarkers, _i as REDACTED_SECRET, _n as gbToBytes, da as parseJsonObject, dr as resolveLocationMode, dt as StorageLocationModeSchema, ei as BaseAddon, ft as StorageLocationTypeSchema, la as normalizeNodeId, ln as evictionPolicyOfLocation, pt as StorageMigrationJobSchema, q as LegacyStorageLocationDefaultSchema, ra as isSecretMarker, ut as StorageCleanupJobSchema, vr as settingsStoreCapability, wa as transformSecretWrite, wr as storageCapability, ya as secretTreeFromPaths, zi as collectSecretConfigKeys } from "../../dist-5XUG7iYJ.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -3,11 +3,11 @@ 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-DRL3rEfN.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.js");
7
7
  const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
8
8
  const require_x509_es = require("../../x509.es-C4cOo48M.js");
9
- const require_agent_https = require("../../agent-https-D_oo3PNv.js");
10
- const require_constants$8 = require("../../constants-WF1AqoKF.js");
9
+ const require_agent_https = require("../../agent-https-bH6bKDeK.js");
10
+ const require_constants$8 = require("../../constants-CToE4OFp.js");
11
11
  const require_src$1 = require("../../src-CnAqG6EF.js");
12
12
  let zod = require("zod");
13
13
  let node_crypto = require("node:crypto");
@@ -1,9 +1,9 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { $r as errMsg, Gi as defineCustomActions, Qi as hydrateSchema, Wi as customAction, ct as ServerNameSchema, ei as BaseAddon, yr as shortHostname } from "../../dist-X1r44BdF.mjs";
2
+ import { $r as errMsg, Gi as defineCustomActions, Qi as hydrateSchema, Wi as customAction, ct as ServerNameSchema, ei as BaseAddon, yr as shortHostname } from "../../dist-5XUG7iYJ.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
4
  import { S as backdatedNotBefore, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension } from "../../x509.es-DK__ETIe.mjs";
5
- import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-DmNQyAl7.mjs";
6
- import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants--A505iuO.mjs";
5
+ import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-DHBvFZJS.mjs";
6
+ import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-5lA8Z9d8.mjs";
7
7
  import { t as require_src } from "../../src-hG4grMU4.mjs";
8
8
  import { z } from "zod";
9
9
  import { X509Certificate, createHash, createPrivateKey, randomBytes, randomInt, sign, timingSafeEqual, verify, webcrypto } from "node:crypto";
@@ -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-DRL3rEfN.js");
6
+ const require_dist = require("../../dist-BjcWEfRy.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  const require_log_file_read_protocol = require("../../log-file-read-protocol-D0WcLbIV.js");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Ln as logDestinationCapability, ei as BaseAddon } from "../../dist-X1r44BdF.mjs";
1
+ import { Ln as logDestinationCapability, ei as BaseAddon } from "../../dist-5XUG7iYJ.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-B7M3X3bT.mjs";
4
4
  import { createRequire } from "node:module";
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-DRL3rEfN.js");
1
+ const require_dist = require("./dist-BjcWEfRy.js");
2
2
  //#region src/builtins/core-blocks/composition-sources.ts
3
3
  /**
4
4
  * Describe what a composition reads and writes for SAVE-time validation
@@ -1,4 +1,4 @@
1
- import { $r as errMsg, Kr as compositionSourceKey } from "./dist-X1r44BdF.mjs";
1
+ import { $r as errMsg, Kr as compositionSourceKey } from "./dist-5XUG7iYJ.mjs";
2
2
  //#region src/builtins/core-blocks/composition-sources.ts
3
3
  /**
4
4
  * Describe what a composition reads and writes for SAVE-time validation
@@ -1,4 +1,4 @@
1
- import { Ri as buildSecretRef } from "./dist-X1r44BdF.mjs";
1
+ import { Ri as buildSecretRef } from "./dist-5XUG7iYJ.mjs";
2
2
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
3
3
  var MESH_CA_KEY_REF = buildSecretRef({
4
4
  owner: "system",
@@ -1,5 +1,5 @@
1
1
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
2
- var MESH_CA_KEY_REF = require("./dist-DRL3rEfN.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-BjcWEfRy.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -29,14 +29,34 @@ function currentDelegateHost() {
29
29
  override: process.env[_camstack_types_node.EDGETPU_LIB_ENV]
30
30
  };
31
31
  }
32
- function countUsbCorals(devices, fsx) {
33
- let count = 0;
32
+ /** usbfs names a device `/dev/bus/usb/<busnum>/<devnum>`, each zero-padded to three digits. */
33
+ function usbDeviceNode(device, fsx) {
34
+ const bus = Number.parseInt(fsx.readUsbAttr(device, "busnum"), 10);
35
+ const dev = Number.parseInt(fsx.readUsbAttr(device, "devnum"), 10);
36
+ if (!Number.isInteger(bus) || !Number.isInteger(dev) || bus <= 0 || dev <= 0) return null;
37
+ return `/dev/bus/usb/${String(bus).padStart(3, "0")}/${String(dev).padStart(3, "0")}`;
38
+ }
39
+ /**
40
+ * USB units: sysfs is the HOST's view — a container whose `/dev/bus/usb`
41
+ * mapping was removed still lists the stick under `/sys/bus/usb/devices`. A
42
+ * listed Coral is usable only when its usbfs device node is in this process's
43
+ * view AND opens read/write; otherwise it is present but not accessible.
44
+ */
45
+ function classifyUsb(devices, fsx) {
46
+ let usable = 0;
47
+ const inaccessibleNodes = [];
34
48
  for (const device of devices) {
35
49
  const vendor = fsx.readUsbAttr(device, "idVendor").toLowerCase();
36
50
  const product = fsx.readUsbAttr(device, "idProduct").toLowerCase();
37
- if (CORAL_USB_IDS.some((id) => id.vendor === vendor && id.product === product)) count++;
51
+ if (!CORAL_USB_IDS.some((id) => id.vendor === vendor && id.product === product)) continue;
52
+ const node = usbDeviceNode(device, fsx);
53
+ if (node !== null && fsx.exists(node) && fsx.canOpen(node)) usable++;
54
+ else inaccessibleNodes.push(node ?? `/sys/bus/usb/devices/${device}`);
38
55
  }
39
- return count;
56
+ return {
57
+ usable,
58
+ inaccessibleNodes
59
+ };
40
60
  }
41
61
  function countPciCorals(fsx) {
42
62
  let count = 0;
@@ -79,7 +99,9 @@ function classifyCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
79
99
  /**
80
100
  * Detect Coral Edge TPUs on USB and PCIe/M.2, with the evidence that decided.
81
101
  *
82
- * - USB: every matching USB device counts (multiple Corals run concurrently).
102
+ * - USB: every matching USB device counts (multiple Corals run concurrently),
103
+ * usable only if its `/dev/bus/usb/<BBB>/<DDD>` node opens read/write — a
104
+ * listed stick whose node is missing or refused is `device-not-accessible`.
83
105
  * - PCIe: the apex driver's units, each usable only if its device node opens;
84
106
  * a Coral PCI function the driver did not bind is `driver-missing`.
85
107
  * - Fallback: when the USB bus is NOT OBSERVABLE (`/sys/bus/usb/devices`
@@ -96,18 +118,28 @@ function classifyCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
96
118
  function detectCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
97
119
  const usbDevices = fsx.listUsbDevices();
98
120
  const usbBus = usbDevices !== null && usbDevices.length > 0 ? "observed" : "unobservable";
99
- const usb = usbDevices === null ? 0 : countUsbCorals(usbDevices, fsx);
121
+ const usb = usbDevices === null ? {
122
+ usable: 0,
123
+ inaccessibleNodes: []
124
+ } : classifyUsb(usbDevices, fsx);
125
+ const usbSeen = usb.usable + usb.inaccessibleNodes.length;
126
+ const inaccessibleUsbNodes = usb.inaccessibleNodes;
100
127
  const pci = classifyPci(fsx);
101
128
  const units = [];
102
- if (usb > 0) units.push({
129
+ if (usb.usable > 0) units.push({
103
130
  bus: "usb",
104
- count: usb
131
+ count: usb.usable
105
132
  });
106
133
  if (pci.usable > 0) units.push({
107
134
  bus: "pci",
108
135
  count: pci.usable
109
136
  });
110
137
  const unavailable = [];
138
+ if (usb.inaccessibleNodes.length > 0) unavailable.push({
139
+ bus: "usb",
140
+ count: usb.inaccessibleNodes.length,
141
+ reason: "device-not-accessible"
142
+ });
111
143
  if (pci.driverMissing > 0) unavailable.push({
112
144
  bus: "pci",
113
145
  count: pci.driverMissing,
@@ -128,7 +160,8 @@ function detectCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
128
160
  units
129
161
  },
130
162
  usbBus,
131
- decidedBy: usb > 0 ? "usb-ids" : "pci"
163
+ decidedBy: usbSeen > 0 ? "usb-ids" : "pci",
164
+ inaccessibleUsbNodes
132
165
  };
133
166
  if (usbBus === "unobservable" && (0, _camstack_types_node.chooseEdgetpuDelegate)({
134
167
  ...delegateHost,
@@ -142,12 +175,14 @@ function detectCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
142
175
  }]
143
176
  },
144
177
  usbBus,
145
- decidedBy: "delegate-fallback"
178
+ decidedBy: "delegate-fallback",
179
+ inaccessibleUsbNodes
146
180
  };
147
181
  return {
148
182
  info: null,
149
183
  usbBus,
150
- decidedBy: "none"
184
+ decidedBy: "none",
185
+ inaccessibleUsbNodes
151
186
  };
152
187
  }
153
188
  function safeListOrNull(dir) {
@@ -27,14 +27,34 @@ function currentDelegateHost() {
27
27
  override: process.env[EDGETPU_LIB_ENV]
28
28
  };
29
29
  }
30
- function countUsbCorals(devices, fsx) {
31
- let count = 0;
30
+ /** usbfs names a device `/dev/bus/usb/<busnum>/<devnum>`, each zero-padded to three digits. */
31
+ function usbDeviceNode(device, fsx) {
32
+ const bus = Number.parseInt(fsx.readUsbAttr(device, "busnum"), 10);
33
+ const dev = Number.parseInt(fsx.readUsbAttr(device, "devnum"), 10);
34
+ if (!Number.isInteger(bus) || !Number.isInteger(dev) || bus <= 0 || dev <= 0) return null;
35
+ return `/dev/bus/usb/${String(bus).padStart(3, "0")}/${String(dev).padStart(3, "0")}`;
36
+ }
37
+ /**
38
+ * USB units: sysfs is the HOST's view — a container whose `/dev/bus/usb`
39
+ * mapping was removed still lists the stick under `/sys/bus/usb/devices`. A
40
+ * listed Coral is usable only when its usbfs device node is in this process's
41
+ * view AND opens read/write; otherwise it is present but not accessible.
42
+ */
43
+ function classifyUsb(devices, fsx) {
44
+ let usable = 0;
45
+ const inaccessibleNodes = [];
32
46
  for (const device of devices) {
33
47
  const vendor = fsx.readUsbAttr(device, "idVendor").toLowerCase();
34
48
  const product = fsx.readUsbAttr(device, "idProduct").toLowerCase();
35
- if (CORAL_USB_IDS.some((id) => id.vendor === vendor && id.product === product)) count++;
49
+ if (!CORAL_USB_IDS.some((id) => id.vendor === vendor && id.product === product)) continue;
50
+ const node = usbDeviceNode(device, fsx);
51
+ if (node !== null && fsx.exists(node) && fsx.canOpen(node)) usable++;
52
+ else inaccessibleNodes.push(node ?? `/sys/bus/usb/devices/${device}`);
36
53
  }
37
- return count;
54
+ return {
55
+ usable,
56
+ inaccessibleNodes
57
+ };
38
58
  }
39
59
  function countPciCorals(fsx) {
40
60
  let count = 0;
@@ -77,7 +97,9 @@ function classifyCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
77
97
  /**
78
98
  * Detect Coral Edge TPUs on USB and PCIe/M.2, with the evidence that decided.
79
99
  *
80
- * - USB: every matching USB device counts (multiple Corals run concurrently).
100
+ * - USB: every matching USB device counts (multiple Corals run concurrently),
101
+ * usable only if its `/dev/bus/usb/<BBB>/<DDD>` node opens read/write — a
102
+ * listed stick whose node is missing or refused is `device-not-accessible`.
81
103
  * - PCIe: the apex driver's units, each usable only if its device node opens;
82
104
  * a Coral PCI function the driver did not bind is `driver-missing`.
83
105
  * - Fallback: when the USB bus is NOT OBSERVABLE (`/sys/bus/usb/devices`
@@ -94,18 +116,28 @@ function classifyCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
94
116
  function detectCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
95
117
  const usbDevices = fsx.listUsbDevices();
96
118
  const usbBus = usbDevices !== null && usbDevices.length > 0 ? "observed" : "unobservable";
97
- const usb = usbDevices === null ? 0 : countUsbCorals(usbDevices, fsx);
119
+ const usb = usbDevices === null ? {
120
+ usable: 0,
121
+ inaccessibleNodes: []
122
+ } : classifyUsb(usbDevices, fsx);
123
+ const usbSeen = usb.usable + usb.inaccessibleNodes.length;
124
+ const inaccessibleUsbNodes = usb.inaccessibleNodes;
98
125
  const pci = classifyPci(fsx);
99
126
  const units = [];
100
- if (usb > 0) units.push({
127
+ if (usb.usable > 0) units.push({
101
128
  bus: "usb",
102
- count: usb
129
+ count: usb.usable
103
130
  });
104
131
  if (pci.usable > 0) units.push({
105
132
  bus: "pci",
106
133
  count: pci.usable
107
134
  });
108
135
  const unavailable = [];
136
+ if (usb.inaccessibleNodes.length > 0) unavailable.push({
137
+ bus: "usb",
138
+ count: usb.inaccessibleNodes.length,
139
+ reason: "device-not-accessible"
140
+ });
109
141
  if (pci.driverMissing > 0) unavailable.push({
110
142
  bus: "pci",
111
143
  count: pci.driverMissing,
@@ -126,7 +158,8 @@ function detectCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
126
158
  units
127
159
  },
128
160
  usbBus,
129
- decidedBy: usb > 0 ? "usb-ids" : "pci"
161
+ decidedBy: usbSeen > 0 ? "usb-ids" : "pci",
162
+ inaccessibleUsbNodes
130
163
  };
131
164
  if (usbBus === "unobservable" && chooseEdgetpuDelegate({
132
165
  ...delegateHost,
@@ -140,12 +173,14 @@ function detectCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
140
173
  }]
141
174
  },
142
175
  usbBus,
143
- decidedBy: "delegate-fallback"
176
+ decidedBy: "delegate-fallback",
177
+ inaccessibleUsbNodes
144
178
  };
145
179
  return {
146
180
  info: null,
147
181
  usbBus,
148
- decidedBy: "none"
182
+ decidedBy: "none",
183
+ inaccessibleUsbNodes
149
184
  };
150
185
  }
151
186
  function safeListOrNull(dir) {
@@ -1,4 +1,4 @@
1
- import { A as DEVICE_SAN_USER_PREFIX, Ri as buildSecretRef, k as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-X1r44BdF.mjs";
1
+ import { A as DEVICE_SAN_USER_PREFIX, Ri as buildSecretRef, k as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-5XUG7iYJ.mjs";
2
2
  import { S as backdatedNotBefore, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-DK__ETIe.mjs";
3
3
  import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
4
4
  //#region src/auth/jwt-signing-key.ts