@camstack/system 1.2.469 → 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 (91) hide show
  1. package/dist/addon-runner.js +97 -31
  2. package/dist/addon-runner.mjs +97 -31
  3. package/dist/addon-utils.mjs +1 -1
  4. package/dist/{agent-https-b-zX78oB.mjs → agent-https-DHBvFZJS.mjs} +1 -1
  5. package/dist/{agent-https-5OgOR-eF.js → agent-https-bH6bKDeK.js} +1 -1
  6. package/dist/auth/user-manager.d.ts +2 -2
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  8. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  10. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
  11. package/dist/builtins/alerts/alerts.addon.js +1 -1
  12. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  13. package/dist/builtins/autotrack/index.js +1 -1
  14. package/dist/builtins/autotrack/index.mjs +1 -1
  15. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  16. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
  17. package/dist/builtins/calendars/calendars.addon.js +1 -1
  18. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  19. package/dist/builtins/camera-grid/index.js +1 -1
  20. package/dist/builtins/camera-grid/index.mjs +1 -1
  21. package/dist/builtins/composer/composer.addon.js +2 -2
  22. package/dist/builtins/composer/composer.addon.mjs +2 -2
  23. package/dist/builtins/console-logging/index.js +1 -1
  24. package/dist/builtins/console-logging/index.mjs +1 -1
  25. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  26. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  27. package/dist/builtins/device-history/device-history.addon.js +1 -1
  28. package/dist/builtins/device-history/device-history.addon.mjs +1 -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 +3 -3
  34. package/dist/builtins/keychain/index.mjs +3 -3
  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 +2 -2
  38. package/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
  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 +10 -10
  45. package/dist/builtins/platform-probe/accelerator-reprobe.d.ts +23 -0
  46. package/dist/builtins/platform-probe/coral-accelerators.d.ts +50 -11
  47. package/dist/builtins/platform-probe/index.d.ts +17 -1
  48. package/dist/builtins/platform-probe/index.js +196 -12
  49. package/dist/builtins/platform-probe/index.mjs +202 -19
  50. package/dist/builtins/platform-probe/platform-scorer.d.ts +14 -0
  51. package/dist/builtins/record-entries/index.js +1 -1
  52. package/dist/builtins/record-entries/index.mjs +1 -1
  53. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  54. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  55. package/dist/builtins/snapshot/index.js +1 -1
  56. package/dist/builtins/snapshot/index.mjs +1 -1
  57. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  58. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
  59. package/dist/builtins/sqlite-storage/index.js +1 -1
  60. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  61. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  62. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  63. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  64. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  65. package/dist/builtins/system-config/system-config.addon.js +3 -3
  66. package/dist/builtins/system-config/system-config.addon.mjs +115 -115
  67. package/dist/builtins/winston-logging/index.js +1 -1
  68. package/dist/builtins/winston-logging/index.mjs +1 -1
  69. package/dist/{composition-sources-BGXTiUZm.js → composition-sources-B5uJZXZ1.js} +1 -1
  70. package/dist/{composition-sources-DTdzzyf0.mjs → composition-sources-DRw_vBKH.mjs} +1 -1
  71. package/dist/{constants-md_POijo.mjs → constants-5lA8Z9d8.mjs} +1 -1
  72. package/dist/{constants-2mPqJjkR.js → constants-CToE4OFp.js} +1 -1
  73. package/dist/{coral-accelerators-oUXmmbc2.js → coral-accelerators-BSVsBVzt.js} +102 -30
  74. package/dist/coral-accelerators-BW3OcrLD.mjs +231 -0
  75. package/dist/{custom-action-registry-DZSCLBuT.mjs → custom-action-registry-BGYDjTqY.mjs} +37 -37
  76. package/dist/{device-ca-CFdyrqeJ.mjs → device-ca-URrs1lxK.mjs} +1 -1
  77. package/dist/{device-ca-CC58lmNV.js → device-ca-nOCYVFS4.js} +1 -1
  78. package/dist/{dist-CtVVtyTX.mjs → dist-5XUG7iYJ.mjs} +6839 -1416
  79. package/dist/{dist-DuBtzSCh.js → dist-BjcWEfRy.js} +6839 -1416
  80. package/dist/file-host-worker.js +1 -1
  81. package/dist/file-host-worker.mjs +1 -1
  82. package/dist/{hub-mdns-ciao-BLsX_2cL.js → hub-mdns-ciao-vEWhJ_SD.js} +2 -2
  83. package/dist/{hub-mdns-ciao-CmuWLPci.mjs → hub-mdns-ciao-zD3JojB_.mjs} +2 -2
  84. package/dist/index.js +8 -8
  85. package/dist/index.mjs +225 -225
  86. package/dist/{restore-archive-CxPAuaNs.js → restore-archive-B64m2nAj.js} +1 -1
  87. package/dist/{restore-archive-D2w3z_ob.mjs → restore-archive-CN1pJTRn.mjs} +94 -94
  88. package/dist/{wal-maintenance-EK28XXnc.js → wal-maintenance-BNXVX-ot.js} +0 -0
  89. package/dist/{wal-maintenance-DeluFl_1.mjs → wal-maintenance-Bl2I-ZcR.mjs} +0 -0
  90. package/package.json +1 -1
  91. package/dist/coral-accelerators-Qhn5TOYZ.mjs +0 -165
@@ -1,165 +0,0 @@
1
- import { EDGETPU_LIB_ENV, chooseEdgetpuDelegate, nodeDataRootFromEnv } from "@camstack/types/node";
2
- import fs from "node:fs";
3
- //#region src/builtins/platform-probe/coral-accelerators.ts
4
- /**
5
- * Coral USB Edge TPU USB identifiers.
6
- *
7
- * The device enumerates as `1a6e:089a` (Global Unichip) BEFORE the libedgetpu
8
- * firmware loads, then re-enumerates as `18d1:9302` (Google) AFTER. Either id
9
- * means a Coral is physically attached, so both count as a positive signal.
10
- */
11
- var CORAL_USB_IDS = [{
12
- vendor: "1a6e",
13
- product: "089a"
14
- }, {
15
- vendor: "18d1",
16
- product: "9302"
17
- }];
18
- /** The PCIe / M.2 Coral's PCI function id (Global Unichip "Apex"). */
19
- var CORAL_PCI_VENDOR = "0x1ac1";
20
- var CORAL_PCI_DEVICE = "0x089a";
21
- /** A unit the apex driver bound: `/sys/class/apex/apex_<N>` ↔ `/dev/apex_<N>`. */
22
- var APEX_ENTRY = /^apex_(\d+)$/;
23
- function currentDelegateHost() {
24
- return {
25
- platform: process.platform,
26
- dataDir: nodeDataRootFromEnv(process.env),
27
- override: process.env[EDGETPU_LIB_ENV]
28
- };
29
- }
30
- function countUsbCorals(fsx) {
31
- let count = 0;
32
- for (const device of fsx.listUsbDevices()) {
33
- const vendor = fsx.readUsbAttr(device, "idVendor").toLowerCase();
34
- const product = fsx.readUsbAttr(device, "idProduct").toLowerCase();
35
- if (CORAL_USB_IDS.some((id) => id.vendor === vendor && id.product === product)) count++;
36
- }
37
- return count;
38
- }
39
- function countPciCorals(fsx) {
40
- let count = 0;
41
- for (const device of fsx.listPciDevices()) {
42
- const vendor = fsx.readPciAttr(device, "vendor").toLowerCase();
43
- const product = fsx.readPciAttr(device, "device").toLowerCase();
44
- if (vendor === CORAL_PCI_VENDOR && product === CORAL_PCI_DEVICE) count++;
45
- }
46
- return count;
47
- }
48
- /**
49
- * PCIe units: each `/sys/class/apex/apex_N` is a unit the driver bound; it is
50
- * usable only when `/dev/apex_N` is in this process's view AND opens read/write.
51
- * PCI functions with the Coral id beyond the bound units have no driver.
52
- */
53
- function classifyPci(fsx) {
54
- let usable = 0;
55
- let notAccessible = 0;
56
- for (const entry of fsx.listApexClass()) {
57
- const match = APEX_ENTRY.exec(entry);
58
- if (match === null) continue;
59
- const node = `/dev/apex_${match[1]}`;
60
- if (fsx.exists(node) && fsx.canOpen(node)) usable++;
61
- else notAccessible++;
62
- }
63
- const driverMissing = Math.max(0, countPciCorals(fsx) - usable - notAccessible);
64
- return {
65
- usable,
66
- notAccessible,
67
- driverMissing
68
- };
69
- }
70
- /**
71
- * Detect Coral Edge TPUs on USB and PCIe/M.2.
72
- *
73
- * - USB: every matching USB device counts (multiple Corals run concurrently).
74
- * - PCIe: the apex driver's units, each usable only if its device node opens;
75
- * a Coral PCI function the driver did not bind is `driver-missing`.
76
- * - Fallback: when NO Coral signal of either bus is visible but the libedgetpu
77
- * delegate is installed (a container whose `/sys` USB view is limited), one
78
- * USB Coral is assumed — never when a PCI Coral was seen, since the delegate
79
- * then says nothing about USB.
80
- *
81
- * Returns `null` only when no Coral was found at all; a present-but-unusable
82
- * Coral is reported with its typed reason, never as absent (D393/D315).
83
- */
84
- function classifyCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
85
- const usb = countUsbCorals(fsx);
86
- const pci = classifyPci(fsx);
87
- const units = [];
88
- if (usb > 0) units.push({
89
- bus: "usb",
90
- count: usb
91
- });
92
- if (pci.usable > 0) units.push({
93
- bus: "pci",
94
- count: pci.usable
95
- });
96
- const unavailable = [];
97
- if (pci.driverMissing > 0) unavailable.push({
98
- bus: "pci",
99
- count: pci.driverMissing,
100
- reason: "driver-missing"
101
- });
102
- if (pci.notAccessible > 0) unavailable.push({
103
- bus: "pci",
104
- count: pci.notAccessible,
105
- reason: "device-not-accessible"
106
- });
107
- if (units.length > 0 || unavailable.length > 0) return unavailable.length > 0 ? {
108
- type: "coral-edgetpu",
109
- units,
110
- unavailable
111
- } : {
112
- type: "coral-edgetpu",
113
- units
114
- };
115
- if (chooseEdgetpuDelegate({
116
- ...delegateHost,
117
- exists: (p) => fsx.exists(p)
118
- }) !== null) return {
119
- type: "coral-edgetpu",
120
- units: [{
121
- bus: "usb",
122
- count: 1
123
- }]
124
- };
125
- return null;
126
- }
127
- function safeList(dir) {
128
- try {
129
- return fs.readdirSync(dir);
130
- } catch {
131
- return [];
132
- }
133
- }
134
- function safeRead(path) {
135
- try {
136
- return fs.readFileSync(path, "utf8").trim();
137
- } catch {
138
- return "";
139
- }
140
- }
141
- /** The real filesystem view: `/sys` for enumeration, `/dev` for access. */
142
- var nodeCoralFs = {
143
- listUsbDevices: () => safeList("/sys/bus/usb/devices"),
144
- readUsbAttr: (device, attr) => safeRead(`/sys/bus/usb/devices/${device}/${attr}`),
145
- listPciDevices: () => safeList("/sys/bus/pci/devices"),
146
- readPciAttr: (device, attr) => safeRead(`/sys/bus/pci/devices/${device}/${attr}`),
147
- listApexClass: () => safeList("/sys/class/apex"),
148
- canOpen: (path) => {
149
- try {
150
- fs.accessSync(path, fs.constants.R_OK | fs.constants.W_OK);
151
- return true;
152
- } catch {
153
- return false;
154
- }
155
- },
156
- exists: (path) => {
157
- try {
158
- return fs.existsSync(path);
159
- } catch {
160
- return false;
161
- }
162
- }
163
- };
164
- //#endregion
165
- export { nodeCoralFs as n, classifyCoralAccelerator as t };