@camstack/system 1.2.457 → 1.2.458

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 (89) hide show
  1. package/dist/addon-runner.js +163 -27
  2. package/dist/addon-runner.mjs +193 -57
  3. package/dist/{agent-https-CK9Z4sSR.mjs → agent-https-CQA3W-3e.mjs} +2 -2
  4. package/dist/{agent-https-CoyOZ3pC.js → agent-https-DOELEug8.js} +2 -2
  5. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/dist/builtins/alerts/alerts.addon.js +2 -2
  10. package/dist/builtins/alerts/alerts.addon.mjs +2 -2
  11. package/dist/builtins/autotrack/index.js +1 -1
  12. package/dist/builtins/autotrack/index.mjs +1 -1
  13. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  14. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  15. package/dist/builtins/calendars/calendars.addon.js +1 -1
  16. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  17. package/dist/builtins/camera-grid/index.js +1 -1
  18. package/dist/builtins/camera-grid/index.mjs +1 -1
  19. package/dist/builtins/composer/composer.addon.js +2 -2
  20. package/dist/builtins/composer/composer.addon.mjs +2 -2
  21. package/dist/builtins/console-logging/index.js +1 -1
  22. package/dist/builtins/console-logging/index.mjs +1 -1
  23. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  24. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  25. package/dist/builtins/device-history/device-history.addon.d.ts +13 -0
  26. package/dist/builtins/device-history/device-history.addon.js +296 -233
  27. package/dist/builtins/device-history/device-history.addon.mjs +296 -233
  28. package/dist/builtins/device-history/ingest/producer-ingest.d.ts +11 -1
  29. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  30. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  31. package/dist/builtins/hub-forwarder/index.js +1 -1
  32. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  33. package/dist/builtins/keychain/index.js +4 -4
  34. package/dist/builtins/keychain/index.mjs +4 -4
  35. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  36. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  37. package/dist/builtins/local-auth/local-auth.addon.js +3 -3
  38. package/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
  39. package/dist/builtins/local-network/local-network.addon.js +2 -2
  40. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  41. package/dist/builtins/loki-logging/index.js +1 -1
  42. package/dist/builtins/loki-logging/index.mjs +1 -1
  43. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  44. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  45. package/dist/builtins/platform-probe/coral-accelerators.d.ts +26 -9
  46. package/dist/builtins/platform-probe/index.js +11 -68
  47. package/dist/builtins/platform-probe/index.mjs +11 -68
  48. package/dist/builtins/record-entries/index.js +1 -1
  49. package/dist/builtins/record-entries/index.mjs +1 -1
  50. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  51. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  52. package/dist/builtins/snapshot/index.js +1 -1
  53. package/dist/builtins/snapshot/index.mjs +1 -1
  54. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  55. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  56. package/dist/builtins/sqlite-storage/index.js +1 -1
  57. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  58. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  59. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  60. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  61. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  62. package/dist/builtins/system-config/system-config.addon.js +3 -3
  63. package/dist/builtins/system-config/system-config.addon.mjs +3 -3
  64. package/dist/builtins/winston-logging/index.js +1 -1
  65. package/dist/builtins/winston-logging/index.mjs +1 -1
  66. package/dist/{composition-sources-B_jeZDRJ.mjs → composition-sources-BVguN7VV.mjs} +1 -1
  67. package/dist/{composition-sources-qKyvMAvc.js → composition-sources-DURQNDJ4.js} +1 -1
  68. package/dist/{constants-cxKcZRMi.mjs → constants-FGjnsE2x.mjs} +1 -1
  69. package/dist/{constants-B_X9cWEK.js → constants-Njka8Cv6.js} +1 -1
  70. package/dist/coral-accelerators-Bi_c3Rft.js +175 -0
  71. package/dist/coral-accelerators-DcnZvctM.mjs +162 -0
  72. package/dist/{device-ca-CVK3YcR_.js → device-ca-BrVK_5s3.js} +1 -1
  73. package/dist/{device-ca-BB6nHAL5.mjs → device-ca-lEaAQ9Xi.mjs} +1 -1
  74. package/dist/{dist-C89nqNnn.js → dist-BZQjLPiz.js} +55 -10
  75. package/dist/{dist-Dhux90yB.mjs → dist-B_GRPhnY.mjs} +55 -10
  76. package/dist/file-host-worker.js +1 -1
  77. package/dist/file-host-worker.mjs +1 -1
  78. package/dist/{hub-mdns-ciao-B8olZqqd.mjs → hub-mdns-ciao-Bg2HfTwP.mjs} +2 -2
  79. package/dist/{hub-mdns-ciao-DB1Y9agt.js → hub-mdns-ciao-nce3TXs_.js} +2 -2
  80. package/dist/index.js +12 -35
  81. package/dist/index.mjs +12 -35
  82. package/dist/kernel/hwaccel/hwaccel-resolver.d.ts +7 -3
  83. package/dist/{phase6-declare-gate-BO-_jLh_.js → phase6-declare-gate-Dag1_WR2.js} +1 -1
  84. package/dist/{phase6-declare-gate-x9ZCbQJP.mjs → phase6-declare-gate-Lb-mrVvz.mjs} +1 -1
  85. package/dist/{restore-archive-DyOaPeAr.mjs → restore-archive-C7kLDI_0.mjs} +1 -1
  86. package/dist/{restore-archive-4DOUR5Gu.js → restore-archive-FyfZ8YMC.js} +1 -1
  87. package/dist/{wal-maintenance-DVN-DiVP.js → wal-maintenance-DfSIOj24.js} +0 -0
  88. package/dist/{wal-maintenance-BMiX6UIa.mjs → wal-maintenance-Duejh7Lx.mjs} +0 -0
  89. package/package.json +1 -1
@@ -0,0 +1,175 @@
1
+ const require_chunk = require("./chunk-Cek0wNdY.js");
2
+ let node_fs = require("node:fs");
3
+ node_fs = require_chunk.__toESM(node_fs);
4
+ //#region src/builtins/platform-probe/coral-accelerators.ts
5
+ /**
6
+ * Coral USB Edge TPU USB identifiers.
7
+ *
8
+ * The device enumerates as `1a6e:089a` (Global Unichip) BEFORE the libedgetpu
9
+ * firmware loads, then re-enumerates as `18d1:9302` (Google) AFTER. Either id
10
+ * means a Coral is physically attached, so both count as a positive signal.
11
+ */
12
+ var CORAL_USB_IDS = [{
13
+ vendor: "1a6e",
14
+ product: "089a"
15
+ }, {
16
+ vendor: "18d1",
17
+ product: "9302"
18
+ }];
19
+ /** The PCIe / M.2 Coral's PCI function id (Global Unichip "Apex"). */
20
+ var CORAL_PCI_VENDOR = "0x1ac1";
21
+ var CORAL_PCI_DEVICE = "0x089a";
22
+ /** A unit the apex driver bound: `/sys/class/apex/apex_<N>` ↔ `/dev/apex_<N>`. */
23
+ var APEX_ENTRY = /^apex_(\d+)$/;
24
+ /**
25
+ * Default install path of the libedgetpu delegate on the hub, provisioned
26
+ * out-of-band by `/data/deps/edgetpu-install.sh` (it is a system shared
27
+ * library, not a pip package). Overridable via `CAMSTACK_EDGETPU_LIB` — kept in
28
+ * sync with the Python pool's own default in `inference_pool.py`.
29
+ */
30
+ var DEFAULT_EDGETPU_LIB = "/data/deps/edgetpu/lib/libedgetpu.so.1";
31
+ function countUsbCorals(fsx) {
32
+ let count = 0;
33
+ for (const device of fsx.listUsbDevices()) {
34
+ const vendor = fsx.readUsbAttr(device, "idVendor").toLowerCase();
35
+ const product = fsx.readUsbAttr(device, "idProduct").toLowerCase();
36
+ if (CORAL_USB_IDS.some((id) => id.vendor === vendor && id.product === product)) count++;
37
+ }
38
+ return count;
39
+ }
40
+ function countPciCorals(fsx) {
41
+ let count = 0;
42
+ for (const device of fsx.listPciDevices()) {
43
+ const vendor = fsx.readPciAttr(device, "vendor").toLowerCase();
44
+ const product = fsx.readPciAttr(device, "device").toLowerCase();
45
+ if (vendor === CORAL_PCI_VENDOR && product === CORAL_PCI_DEVICE) count++;
46
+ }
47
+ return count;
48
+ }
49
+ /**
50
+ * PCIe units: each `/sys/class/apex/apex_N` is a unit the driver bound; it is
51
+ * usable only when `/dev/apex_N` is in this process's view AND opens read/write.
52
+ * PCI functions with the Coral id beyond the bound units have no driver.
53
+ */
54
+ function classifyPci(fsx) {
55
+ let usable = 0;
56
+ let notAccessible = 0;
57
+ for (const entry of fsx.listApexClass()) {
58
+ const match = APEX_ENTRY.exec(entry);
59
+ if (match === null) continue;
60
+ const node = `/dev/apex_${match[1]}`;
61
+ if (fsx.exists(node) && fsx.canOpen(node)) usable++;
62
+ else notAccessible++;
63
+ }
64
+ const driverMissing = Math.max(0, countPciCorals(fsx) - usable - notAccessible);
65
+ return {
66
+ usable,
67
+ notAccessible,
68
+ driverMissing
69
+ };
70
+ }
71
+ /**
72
+ * Detect Coral Edge TPUs on USB and PCIe/M.2.
73
+ *
74
+ * - USB: every matching USB device counts (multiple Corals run concurrently).
75
+ * - PCIe: the apex driver's units, each usable only if its device node opens;
76
+ * a Coral PCI function the driver did not bind is `driver-missing`.
77
+ * - Fallback: when NO Coral signal of either bus is visible but the libedgetpu
78
+ * delegate is installed (a container whose `/sys` USB view is limited), one
79
+ * USB Coral is assumed — never when a PCI Coral was seen, since the delegate
80
+ * then says nothing about USB.
81
+ *
82
+ * Returns `null` only when no Coral was found at all; a present-but-unusable
83
+ * Coral is reported with its typed reason, never as absent (D393/D315).
84
+ */
85
+ function classifyCoralAccelerator(fsx) {
86
+ const usb = countUsbCorals(fsx);
87
+ const pci = classifyPci(fsx);
88
+ const units = [];
89
+ if (usb > 0) units.push({
90
+ bus: "usb",
91
+ count: usb
92
+ });
93
+ if (pci.usable > 0) units.push({
94
+ bus: "pci",
95
+ count: pci.usable
96
+ });
97
+ const unavailable = [];
98
+ if (pci.driverMissing > 0) unavailable.push({
99
+ bus: "pci",
100
+ count: pci.driverMissing,
101
+ reason: "driver-missing"
102
+ });
103
+ if (pci.notAccessible > 0) unavailable.push({
104
+ bus: "pci",
105
+ count: pci.notAccessible,
106
+ reason: "device-not-accessible"
107
+ });
108
+ if (units.length > 0 || unavailable.length > 0) return unavailable.length > 0 ? {
109
+ type: "coral-edgetpu",
110
+ units,
111
+ unavailable
112
+ } : {
113
+ type: "coral-edgetpu",
114
+ units
115
+ };
116
+ const libPath = process.env["CAMSTACK_EDGETPU_LIB"] ?? DEFAULT_EDGETPU_LIB;
117
+ if (fsx.exists(libPath)) return {
118
+ type: "coral-edgetpu",
119
+ units: [{
120
+ bus: "usb",
121
+ count: 1
122
+ }]
123
+ };
124
+ return null;
125
+ }
126
+ function safeList(dir) {
127
+ try {
128
+ return node_fs.default.readdirSync(dir);
129
+ } catch {
130
+ return [];
131
+ }
132
+ }
133
+ function safeRead(path) {
134
+ try {
135
+ return node_fs.default.readFileSync(path, "utf8").trim();
136
+ } catch {
137
+ return "";
138
+ }
139
+ }
140
+ /** The real filesystem view: `/sys` for enumeration, `/dev` for access. */
141
+ var nodeCoralFs = {
142
+ listUsbDevices: () => safeList("/sys/bus/usb/devices"),
143
+ readUsbAttr: (device, attr) => safeRead(`/sys/bus/usb/devices/${device}/${attr}`),
144
+ listPciDevices: () => safeList("/sys/bus/pci/devices"),
145
+ readPciAttr: (device, attr) => safeRead(`/sys/bus/pci/devices/${device}/${attr}`),
146
+ listApexClass: () => safeList("/sys/class/apex"),
147
+ canOpen: (path) => {
148
+ try {
149
+ node_fs.default.accessSync(path, node_fs.default.constants.R_OK | node_fs.default.constants.W_OK);
150
+ return true;
151
+ } catch {
152
+ return false;
153
+ }
154
+ },
155
+ exists: (path) => {
156
+ try {
157
+ return node_fs.default.existsSync(path);
158
+ } catch {
159
+ return false;
160
+ }
161
+ }
162
+ };
163
+ //#endregion
164
+ Object.defineProperty(exports, "classifyCoralAccelerator", {
165
+ enumerable: true,
166
+ get: function() {
167
+ return classifyCoralAccelerator;
168
+ }
169
+ });
170
+ Object.defineProperty(exports, "nodeCoralFs", {
171
+ enumerable: true,
172
+ get: function() {
173
+ return nodeCoralFs;
174
+ }
175
+ });
@@ -0,0 +1,162 @@
1
+ import Kt from "node:fs";
2
+ //#region src/builtins/platform-probe/coral-accelerators.ts
3
+ /**
4
+ * Coral USB Edge TPU USB identifiers.
5
+ *
6
+ * The device enumerates as `1a6e:089a` (Global Unichip) BEFORE the libedgetpu
7
+ * firmware loads, then re-enumerates as `18d1:9302` (Google) AFTER. Either id
8
+ * means a Coral is physically attached, so both count as a positive signal.
9
+ */
10
+ var CORAL_USB_IDS = [{
11
+ vendor: "1a6e",
12
+ product: "089a"
13
+ }, {
14
+ vendor: "18d1",
15
+ product: "9302"
16
+ }];
17
+ /** The PCIe / M.2 Coral's PCI function id (Global Unichip "Apex"). */
18
+ var CORAL_PCI_VENDOR = "0x1ac1";
19
+ var CORAL_PCI_DEVICE = "0x089a";
20
+ /** A unit the apex driver bound: `/sys/class/apex/apex_<N>` ↔ `/dev/apex_<N>`. */
21
+ var APEX_ENTRY = /^apex_(\d+)$/;
22
+ /**
23
+ * Default install path of the libedgetpu delegate on the hub, provisioned
24
+ * out-of-band by `/data/deps/edgetpu-install.sh` (it is a system shared
25
+ * library, not a pip package). Overridable via `CAMSTACK_EDGETPU_LIB` — kept in
26
+ * sync with the Python pool's own default in `inference_pool.py`.
27
+ */
28
+ var DEFAULT_EDGETPU_LIB = "/data/deps/edgetpu/lib/libedgetpu.so.1";
29
+ function countUsbCorals(fsx) {
30
+ let count = 0;
31
+ for (const device of fsx.listUsbDevices()) {
32
+ const vendor = fsx.readUsbAttr(device, "idVendor").toLowerCase();
33
+ const product = fsx.readUsbAttr(device, "idProduct").toLowerCase();
34
+ if (CORAL_USB_IDS.some((id) => id.vendor === vendor && id.product === product)) count++;
35
+ }
36
+ return count;
37
+ }
38
+ function countPciCorals(fsx) {
39
+ let count = 0;
40
+ for (const device of fsx.listPciDevices()) {
41
+ const vendor = fsx.readPciAttr(device, "vendor").toLowerCase();
42
+ const product = fsx.readPciAttr(device, "device").toLowerCase();
43
+ if (vendor === CORAL_PCI_VENDOR && product === CORAL_PCI_DEVICE) count++;
44
+ }
45
+ return count;
46
+ }
47
+ /**
48
+ * PCIe units: each `/sys/class/apex/apex_N` is a unit the driver bound; it is
49
+ * usable only when `/dev/apex_N` is in this process's view AND opens read/write.
50
+ * PCI functions with the Coral id beyond the bound units have no driver.
51
+ */
52
+ function classifyPci(fsx) {
53
+ let usable = 0;
54
+ let notAccessible = 0;
55
+ for (const entry of fsx.listApexClass()) {
56
+ const match = APEX_ENTRY.exec(entry);
57
+ if (match === null) continue;
58
+ const node = `/dev/apex_${match[1]}`;
59
+ if (fsx.exists(node) && fsx.canOpen(node)) usable++;
60
+ else notAccessible++;
61
+ }
62
+ const driverMissing = Math.max(0, countPciCorals(fsx) - usable - notAccessible);
63
+ return {
64
+ usable,
65
+ notAccessible,
66
+ driverMissing
67
+ };
68
+ }
69
+ /**
70
+ * Detect Coral Edge TPUs on USB and PCIe/M.2.
71
+ *
72
+ * - USB: every matching USB device counts (multiple Corals run concurrently).
73
+ * - PCIe: the apex driver's units, each usable only if its device node opens;
74
+ * a Coral PCI function the driver did not bind is `driver-missing`.
75
+ * - Fallback: when NO Coral signal of either bus is visible but the libedgetpu
76
+ * delegate is installed (a container whose `/sys` USB view is limited), one
77
+ * USB Coral is assumed — never when a PCI Coral was seen, since the delegate
78
+ * then says nothing about USB.
79
+ *
80
+ * Returns `null` only when no Coral was found at all; a present-but-unusable
81
+ * Coral is reported with its typed reason, never as absent (D393/D315).
82
+ */
83
+ function classifyCoralAccelerator(fsx) {
84
+ const usb = countUsbCorals(fsx);
85
+ const pci = classifyPci(fsx);
86
+ const units = [];
87
+ if (usb > 0) units.push({
88
+ bus: "usb",
89
+ count: usb
90
+ });
91
+ if (pci.usable > 0) units.push({
92
+ bus: "pci",
93
+ count: pci.usable
94
+ });
95
+ const unavailable = [];
96
+ if (pci.driverMissing > 0) unavailable.push({
97
+ bus: "pci",
98
+ count: pci.driverMissing,
99
+ reason: "driver-missing"
100
+ });
101
+ if (pci.notAccessible > 0) unavailable.push({
102
+ bus: "pci",
103
+ count: pci.notAccessible,
104
+ reason: "device-not-accessible"
105
+ });
106
+ if (units.length > 0 || unavailable.length > 0) return unavailable.length > 0 ? {
107
+ type: "coral-edgetpu",
108
+ units,
109
+ unavailable
110
+ } : {
111
+ type: "coral-edgetpu",
112
+ units
113
+ };
114
+ const libPath = process.env["CAMSTACK_EDGETPU_LIB"] ?? DEFAULT_EDGETPU_LIB;
115
+ if (fsx.exists(libPath)) return {
116
+ type: "coral-edgetpu",
117
+ units: [{
118
+ bus: "usb",
119
+ count: 1
120
+ }]
121
+ };
122
+ return null;
123
+ }
124
+ function safeList(dir) {
125
+ try {
126
+ return Kt.readdirSync(dir);
127
+ } catch {
128
+ return [];
129
+ }
130
+ }
131
+ function safeRead(path) {
132
+ try {
133
+ return Kt.readFileSync(path, "utf8").trim();
134
+ } catch {
135
+ return "";
136
+ }
137
+ }
138
+ /** The real filesystem view: `/sys` for enumeration, `/dev` for access. */
139
+ var nodeCoralFs = {
140
+ listUsbDevices: () => safeList("/sys/bus/usb/devices"),
141
+ readUsbAttr: (device, attr) => safeRead(`/sys/bus/usb/devices/${device}/${attr}`),
142
+ listPciDevices: () => safeList("/sys/bus/pci/devices"),
143
+ readPciAttr: (device, attr) => safeRead(`/sys/bus/pci/devices/${device}/${attr}`),
144
+ listApexClass: () => safeList("/sys/class/apex"),
145
+ canOpen: (path) => {
146
+ try {
147
+ Kt.accessSync(path, Kt.constants.R_OK | Kt.constants.W_OK);
148
+ return true;
149
+ } catch {
150
+ return false;
151
+ }
152
+ },
153
+ exists: (path) => {
154
+ try {
155
+ return Kt.existsSync(path);
156
+ } catch {
157
+ return false;
158
+ }
159
+ }
160
+ };
161
+ //#endregion
162
+ export { nodeCoralFs as n, classifyCoralAccelerator as t };
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-C89nqNnn.js");
1
+ const require_dist = require("./dist-BZQjLPiz.js");
2
2
  const require_x509_es = require("./x509.es-C4cOo48M.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1,4 +1,4 @@
1
- import { A as DEVICE_SAN_CREDENTIAL_PREFIX, Li as buildSecretRef, j as DEVICE_SAN_USER_PREFIX } from "./dist-Dhux90yB.mjs";
1
+ import { A as DEVICE_SAN_CREDENTIAL_PREFIX, Li as buildSecretRef, j as DEVICE_SAN_USER_PREFIX } from "./dist-B_GRPhnY.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
@@ -66843,9 +66843,24 @@ var NpuInfoSchema = zod.z.object({
66843
66843
  name: zod.z.string().optional(),
66844
66844
  generation: zod.z.enum(["xdna1", "xdna2"]).optional()
66845
66845
  });
66846
+ var CoralBusSchema = zod.z.enum(["usb", "pci"]);
66846
66847
  var CoralInfoSchema = zod.z.object({
66847
66848
  type: zod.z.literal("coral-edgetpu"),
66848
- bus: zod.z.string().optional()
66849
+ /** Legacy single-bus report (older nodes) — read via `coralUsableUnits`. */
66850
+ bus: zod.z.string().optional(),
66851
+ /** Legacy USB unit count (older nodes) — read via `coralUsableUnits`. */
66852
+ count: zod.z.number().int().nonnegative().optional(),
66853
+ /** Usable units per bus — each one is its own `edgetpu:<bus>[:N]` device. */
66854
+ units: zod.z.array(zod.z.object({
66855
+ bus: CoralBusSchema,
66856
+ count: zod.z.number().int().nonnegative()
66857
+ })).readonly().optional(),
66858
+ /** Present-but-unusable units, each with its typed reason (never "absent"). */
66859
+ unavailable: zod.z.array(zod.z.object({
66860
+ bus: CoralBusSchema,
66861
+ count: zod.z.number().int().nonnegative(),
66862
+ reason: zod.z.enum(["driver-missing", "device-not-accessible"])
66863
+ })).readonly().optional()
66849
66864
  });
66850
66865
  var HardwareInfoSchema = zod.z.object({
66851
66866
  platform: HardwarePlatformSchema,
@@ -88579,6 +88594,29 @@ function decodeVectorBase64(encoded) {
88579
88594
  function vectorDimFromBase64(encoded) {
88580
88595
  return Math.floor(Buffer.from(encoded, "base64").byteLength / 4);
88581
88596
  }
88597
+ /** Bus order of the enumeration: USB first (the historical key), then PCIe. */
88598
+ var BUS_ORDER = ["usb", "pci"];
88599
+ function unitDevice(bus, index) {
88600
+ return index === 0 ? bus : `${bus}:${index}`;
88601
+ }
88602
+ function countOn(coral, bus) {
88603
+ if (coral.units !== void 0) return coral.units.filter((u) => u.bus === bus).reduce((n, u) => n + Math.max(0, u.count), 0);
88604
+ return bus === (coral.bus === "pci" ? "pci" : "usb") ? Math.max(1, coral.count ?? 1) : 0;
88605
+ }
88606
+ /** Every usable Coral unit on a node, USB first then PCIe, in ordinal order. */
88607
+ function coralUsableUnits(coral) {
88608
+ if (coral == null) return [];
88609
+ const out = [];
88610
+ for (const bus of BUS_ORDER) {
88611
+ const count = countOn(coral, bus);
88612
+ for (let index = 0; index < count; index++) out.push({
88613
+ bus,
88614
+ index,
88615
+ device: unitDevice(bus, index)
88616
+ });
88617
+ }
88618
+ return out;
88619
+ }
88582
88620
  var AUTO = {
88583
88621
  value: "auto",
88584
88622
  label: "Auto"
@@ -88591,6 +88629,14 @@ var USB = {
88591
88629
  value: "usb",
88592
88630
  label: "Coral USB"
88593
88631
  };
88632
+ function coralUnitOption(unit) {
88633
+ const bus = unit.bus === "pci" ? "PCIe" : "USB";
88634
+ const label = unit.index === 0 ? `Coral ${bus}` : `Coral ${bus} ${unit.index + 1}`;
88635
+ return {
88636
+ value: unit.device,
88637
+ label
88638
+ };
88639
+ }
88594
88640
  var RUNTIMES = [
88595
88641
  {
88596
88642
  id: "onnx",
@@ -88657,8 +88703,11 @@ var RUNTIMES = [
88657
88703
  },
88658
88704
  {
88659
88705
  id: "edgetpu",
88660
- supports: (hw) => hw?.coral != null,
88661
- devices: () => [USB],
88706
+ supports: (hw) => coralUsableUnits(hw?.coral).length > 0,
88707
+ devices: (hw) => {
88708
+ const units = coralUsableUnits(hw?.coral);
88709
+ return units.length > 0 ? units.map(coralUnitOption) : [USB];
88710
+ },
88662
88711
  defaultDevice: "usb"
88663
88712
  }
88664
88713
  ];
@@ -88676,7 +88725,7 @@ function supportedRuntimes(hw) {
88676
88725
  * - coreml: score 95, darwin+arm64
88677
88726
  * - cuda: score 85, nvidia gpu
88678
88727
  * - openvino: score 90 if intel-npu present, else 80 if intel gpu
88679
- * - edgetpu: score 70, coral usb present
88728
+ * - edgetpu: score 70, a usable Coral unit (USB or PCIe)
88680
88729
  * - cpu: score 50 (universal floor, always included)
88681
88730
  *
88682
88731
  * All hardware-matched entries are `available: true`.
@@ -88730,7 +88779,7 @@ function scoreRuntimes(hw) {
88730
88779
  available: true
88731
88780
  });
88732
88781
  }
88733
- if (hw.coral != null) scores.push({
88782
+ if (coralUsableUnits(hw.coral).length > 0) scores.push({
88734
88783
  runtime: "python",
88735
88784
  backend: "edgetpu",
88736
88785
  format: "tflite",
@@ -88789,11 +88838,7 @@ function enumerateInferenceDevices(hw) {
88789
88838
  continue;
88790
88839
  }
88791
88840
  if (s.backend === "edgetpu") {
88792
- const coralCount = Math.max(1, hw.coral?.count ?? 1);
88793
- for (let i = 0; i < coralCount; i++) {
88794
- const dev = i === 0 ? "usb" : `usb:${i}`;
88795
- out.push(device("edgetpu", dev, s.format, s.score));
88796
- }
88841
+ for (const unit of coralUsableUnits(hw.coral)) out.push(device("edgetpu", unit.device, s.format, s.score));
88797
88842
  continue;
88798
88843
  }
88799
88844
  if (s.backend === "onnx" && s.reason.startsWith("ONNX WebGPU")) {
@@ -66843,9 +66843,24 @@ var NpuInfoSchema = z.object({
66843
66843
  name: z.string().optional(),
66844
66844
  generation: z.enum(["xdna1", "xdna2"]).optional()
66845
66845
  });
66846
+ var CoralBusSchema = z.enum(["usb", "pci"]);
66846
66847
  var CoralInfoSchema = z.object({
66847
66848
  type: z.literal("coral-edgetpu"),
66848
- bus: z.string().optional()
66849
+ /** Legacy single-bus report (older nodes) — read via `coralUsableUnits`. */
66850
+ bus: z.string().optional(),
66851
+ /** Legacy USB unit count (older nodes) — read via `coralUsableUnits`. */
66852
+ count: z.number().int().nonnegative().optional(),
66853
+ /** Usable units per bus — each one is its own `edgetpu:<bus>[:N]` device. */
66854
+ units: z.array(z.object({
66855
+ bus: CoralBusSchema,
66856
+ count: z.number().int().nonnegative()
66857
+ })).readonly().optional(),
66858
+ /** Present-but-unusable units, each with its typed reason (never "absent"). */
66859
+ unavailable: z.array(z.object({
66860
+ bus: CoralBusSchema,
66861
+ count: z.number().int().nonnegative(),
66862
+ reason: z.enum(["driver-missing", "device-not-accessible"])
66863
+ })).readonly().optional()
66849
66864
  });
66850
66865
  var HardwareInfoSchema = z.object({
66851
66866
  platform: HardwarePlatformSchema,
@@ -88579,6 +88594,29 @@ function decodeVectorBase64(encoded) {
88579
88594
  function vectorDimFromBase64(encoded) {
88580
88595
  return Math.floor(Buffer.from(encoded, "base64").byteLength / 4);
88581
88596
  }
88597
+ /** Bus order of the enumeration: USB first (the historical key), then PCIe. */
88598
+ var BUS_ORDER = ["usb", "pci"];
88599
+ function unitDevice(bus, index) {
88600
+ return index === 0 ? bus : `${bus}:${index}`;
88601
+ }
88602
+ function countOn(coral, bus) {
88603
+ if (coral.units !== void 0) return coral.units.filter((u) => u.bus === bus).reduce((n, u) => n + Math.max(0, u.count), 0);
88604
+ return bus === (coral.bus === "pci" ? "pci" : "usb") ? Math.max(1, coral.count ?? 1) : 0;
88605
+ }
88606
+ /** Every usable Coral unit on a node, USB first then PCIe, in ordinal order. */
88607
+ function coralUsableUnits(coral) {
88608
+ if (coral == null) return [];
88609
+ const out = [];
88610
+ for (const bus of BUS_ORDER) {
88611
+ const count = countOn(coral, bus);
88612
+ for (let index = 0; index < count; index++) out.push({
88613
+ bus,
88614
+ index,
88615
+ device: unitDevice(bus, index)
88616
+ });
88617
+ }
88618
+ return out;
88619
+ }
88582
88620
  var AUTO = {
88583
88621
  value: "auto",
88584
88622
  label: "Auto"
@@ -88591,6 +88629,14 @@ var USB = {
88591
88629
  value: "usb",
88592
88630
  label: "Coral USB"
88593
88631
  };
88632
+ function coralUnitOption(unit) {
88633
+ const bus = unit.bus === "pci" ? "PCIe" : "USB";
88634
+ const label = unit.index === 0 ? `Coral ${bus}` : `Coral ${bus} ${unit.index + 1}`;
88635
+ return {
88636
+ value: unit.device,
88637
+ label
88638
+ };
88639
+ }
88594
88640
  var RUNTIMES = [
88595
88641
  {
88596
88642
  id: "onnx",
@@ -88657,8 +88703,11 @@ var RUNTIMES = [
88657
88703
  },
88658
88704
  {
88659
88705
  id: "edgetpu",
88660
- supports: (hw) => hw?.coral != null,
88661
- devices: () => [USB],
88706
+ supports: (hw) => coralUsableUnits(hw?.coral).length > 0,
88707
+ devices: (hw) => {
88708
+ const units = coralUsableUnits(hw?.coral);
88709
+ return units.length > 0 ? units.map(coralUnitOption) : [USB];
88710
+ },
88662
88711
  defaultDevice: "usb"
88663
88712
  }
88664
88713
  ];
@@ -88676,7 +88725,7 @@ function supportedRuntimes(hw) {
88676
88725
  * - coreml: score 95, darwin+arm64
88677
88726
  * - cuda: score 85, nvidia gpu
88678
88727
  * - openvino: score 90 if intel-npu present, else 80 if intel gpu
88679
- * - edgetpu: score 70, coral usb present
88728
+ * - edgetpu: score 70, a usable Coral unit (USB or PCIe)
88680
88729
  * - cpu: score 50 (universal floor, always included)
88681
88730
  *
88682
88731
  * All hardware-matched entries are `available: true`.
@@ -88730,7 +88779,7 @@ function scoreRuntimes(hw) {
88730
88779
  available: true
88731
88780
  });
88732
88781
  }
88733
- if (hw.coral != null) scores.push({
88782
+ if (coralUsableUnits(hw.coral).length > 0) scores.push({
88734
88783
  runtime: "python",
88735
88784
  backend: "edgetpu",
88736
88785
  format: "tflite",
@@ -88789,11 +88838,7 @@ function enumerateInferenceDevices(hw) {
88789
88838
  continue;
88790
88839
  }
88791
88840
  if (s.backend === "edgetpu") {
88792
- const coralCount = Math.max(1, hw.coral?.count ?? 1);
88793
- for (let i = 0; i < coralCount; i++) {
88794
- const dev = i === 0 ? "usb" : `usb:${i}`;
88795
- out.push(device("edgetpu", dev, s.format, s.score));
88796
- }
88841
+ for (const unit of coralUsableUnits(hw.coral)) out.push(device("edgetpu", unit.device, s.format, s.score));
88797
88842
  continue;
88798
88843
  }
88799
88844
  if (s.backend === "onnx" && s.reason.startsWith("ONNX WebGPU")) {
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-DVN-DiVP.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-DfSIOj24.js");
3
3
  let node_worker_threads = require("node:worker_threads");
4
4
  //#region src/builtins/sqlite-storage/file-host-worker.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { C as RecordsEngine, D as callVector, E as callRecords, O as controlTargetOf, T as callData, _ as collectTransferables, a as WalMaintenance, b as isFileHostWorkerData, h as serializeError, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, w as callControl, x as trustInput, y as isFileHostRequest } from "./wal-maintenance-BMiX6UIa.mjs";
1
+ import { C as RecordsEngine, D as callVector, E as callRecords, O as controlTargetOf, T as callData, _ as collectTransferables, a as WalMaintenance, b as isFileHostWorkerData, h as serializeError, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, w as callControl, x as trustInput, y as isFileHostRequest } from "./wal-maintenance-Duejh7Lx.mjs";
2
2
  import { parentPort, threadId, workerData } from "node:worker_threads";
3
3
  //#region src/builtins/sqlite-storage/file-host-worker.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
2
- import { Ea as userError } from "./dist-Dhux90yB.mjs";
2
+ import { Ea as userError } from "./dist-B_GRPhnY.mjs";
3
3
  import { f as X509Certificate$1 } from "./x509.es-DK__ETIe.mjs";
4
- import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-CK9Z4sSR.mjs";
4
+ import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-CQA3W-3e.mjs";
5
5
  import { X509Certificate, createPrivateKey } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
7
7
  import { mkdir, writeFile } from "node:fs/promises";
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-C89nqNnn.js");
2
+ const require_dist = require("./dist-BZQjLPiz.js");
3
3
  const require_x509_es = require("./x509.es-C4cOo48M.js");
4
- const require_agent_https = require("./agent-https-CoyOZ3pC.js");
4
+ const require_agent_https = require("./agent-https-DOELEug8.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs_promises = require("node:fs/promises");