@camstack/server 1.2.901 → 1.2.902
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.
- package/CHANGELOG.md +6 -0
- package/package.json +16 -12
- package/system/dist/addon-runner.js +9 -4
- package/system/dist/addon-runner.mjs +10 -5
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +4 -4
- package/system/dist/builtins/composer/composer.addon.mjs +4 -4
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/command-holds.d.ts +2 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +18 -4
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +18 -4
- package/system/dist/builtins/device-manager/device-state-mirror.d.ts +2 -0
- package/system/dist/builtins/device-manager/state-refresh-scheduler.d.ts +5 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +46 -19
- package/system/dist/builtins/platform-probe/index.mjs +46 -19
- package/system/dist/builtins/platform-probe/platform-scorer.d.ts +7 -0
- package/system/dist/builtins/platform-probe/windows-hardware.d.ts +11 -6
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-B3csK2sW.js → capture-engine-BsGVKjld.js} +1 -1
- package/system/dist/{capture-engine-CCAzcezv.mjs → capture-engine-D0FpnENM.mjs} +1 -1
- package/system/dist/{composition-sources-Bkbk5Oh5.js → composition-sources-75AgWPIR.js} +1 -1
- package/system/dist/{composition-sources-BX7u-Hdf.mjs → composition-sources-B3anVC1t.mjs} +1 -1
- package/system/dist/{constants-BqxCksdV.js → constants-BhN1jHcJ.js} +1 -1
- package/system/dist/{constants-_bOm_ae5.mjs → constants-CjGZCAun.mjs} +1 -1
- package/system/dist/{device-ca-KNx_DazP.js → device-ca-D0-IU1v8.js} +1 -1
- package/system/dist/{device-ca-DRqN1P5Y.mjs → device-ca-rg3jkL9j.mjs} +1 -1
- package/system/dist/{dist-BNrIzdrJ.js → dist-Cadmv3rL.js} +372 -276
- package/system/dist/{dist-S-zGcCEr.mjs → dist-DFRmPXTo.mjs} +361 -271
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-pN0LtUhx.js → hub-identity-CYU8a0Hk.js} +1 -1
- package/system/dist/{hub-identity-DSdbZxeR.mjs → hub-identity-D5hgkkLm.mjs} +1 -1
- package/system/dist/{hub-mdns-ciao-wAcv5VBY.mjs → hub-mdns-ciao-BkD9s5Bz.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-GafEbDm8.js → hub-mdns-ciao-CDCn7uUo.js} +2 -2
- package/system/dist/index.js +20 -14
- package/system/dist/index.mjs +21 -15
- package/system/dist/kernel/inference/inference-resolver.d.ts +4 -2
- package/system/dist/{legacy-integration-rows-door-B1swGb0r.js → legacy-integration-rows-door-C_l9jAFJ.js} +1 -1
- package/system/dist/{legacy-integration-rows-door--186Wij_.mjs → legacy-integration-rows-door-mF8pNWEV.mjs} +1 -1
- package/system/dist/{rename-composition-block-Cf5syiM4.mjs → rename-composition-block-CyULF94b.mjs} +1 -1
- package/system/dist/{rename-composition-block-gJ_4GdHr.js → rename-composition-block-lHaoyeuW.js} +1 -1
- package/system/dist/{restore-archive-DScscuGI.mjs → restore-archive-BZhn64U7.mjs} +1 -1
- package/system/dist/{restore-archive-DXi9iBay.js → restore-archive-IDxQg4bp.js} +1 -1
- package/system/dist/{wal-maintenance-s3KdED98.mjs → wal-maintenance-BFe0hYbV.mjs} +0 -0
- package/system/dist/{wal-maintenance-BA9XNPvt.js → wal-maintenance-Cj1dmAUb.js} +0 -0
- package/system/package.json +1 -1
|
@@ -846,7 +846,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
846
846
|
return EventCategory;
|
|
847
847
|
}({});
|
|
848
848
|
//#endregion
|
|
849
|
-
//#region ../types/dist/composed-stable-id-
|
|
849
|
+
//#region ../types/dist/composed-stable-id-DIeNz933.mjs
|
|
850
850
|
/**
|
|
851
851
|
import { errMsg } from '@camstack/types'
|
|
852
852
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -1303,6 +1303,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1303
1303
|
/** A machine that runs workloads or is an appliance with its own OS: a
|
|
1304
1304
|
* server, a hypervisor, a gateway console, a CCU. */
|
|
1305
1305
|
DeviceRole["Host"] = "host";
|
|
1306
|
+
/** An uninterruptible power supply: battery charge, mains status and load. A
|
|
1307
|
+
* `DeviceType.Sensor` device. */
|
|
1308
|
+
DeviceRole["Ups"] = "ups";
|
|
1306
1309
|
return DeviceRole;
|
|
1307
1310
|
}({});
|
|
1308
1311
|
/**
|
|
@@ -1312,7 +1315,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1312
1315
|
*/
|
|
1313
1316
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
1314
1317
|
//#endregion
|
|
1315
|
-
//#region ../types/dist/
|
|
1318
|
+
//#region ../types/dist/runtime-capabilities-Bgt5QBvO.mjs
|
|
1316
1319
|
/**
|
|
1317
1320
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1318
1321
|
* window to float samples (D455).
|
|
@@ -18692,6 +18695,10 @@ Object.freeze({
|
|
|
18692
18695
|
"path": "power",
|
|
18693
18696
|
"valueType": "number"
|
|
18694
18697
|
},
|
|
18698
|
+
{
|
|
18699
|
+
"path": "deliveredPower",
|
|
18700
|
+
"valueType": "number"
|
|
18701
|
+
},
|
|
18695
18702
|
{
|
|
18696
18703
|
"path": "energy",
|
|
18697
18704
|
"valueType": "number"
|
|
@@ -19758,8 +19765,294 @@ function parseJsonObject(text) {
|
|
|
19758
19765
|
function sleep(ms) {
|
|
19759
19766
|
return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
19760
19767
|
}
|
|
19768
|
+
/** Bus order of the enumeration: USB first (the historical key), then PCIe. */
|
|
19769
|
+
var BUS_ORDER = ["usb", "pci"];
|
|
19770
|
+
function unitDevice(bus, index) {
|
|
19771
|
+
return index === 0 ? bus : `${bus}:${index}`;
|
|
19772
|
+
}
|
|
19773
|
+
function countOn(coral, bus) {
|
|
19774
|
+
if (coral.units !== void 0) return coral.units.filter((u) => u.bus === bus).reduce((n, u) => n + Math.max(0, u.count), 0);
|
|
19775
|
+
return bus === (coral.bus === "pci" ? "pci" : "usb") ? Math.max(1, coral.count ?? 1) : 0;
|
|
19776
|
+
}
|
|
19777
|
+
/** Every usable Coral unit on a node, USB first then PCIe, in ordinal order. */
|
|
19778
|
+
function coralUsableUnits(coral) {
|
|
19779
|
+
if (coral == null) return [];
|
|
19780
|
+
const out = [];
|
|
19781
|
+
for (const bus of BUS_ORDER) {
|
|
19782
|
+
const count = countOn(coral, bus);
|
|
19783
|
+
for (let index = 0; index < count; index++) out.push({
|
|
19784
|
+
bus,
|
|
19785
|
+
index,
|
|
19786
|
+
device: unitDevice(bus, index)
|
|
19787
|
+
});
|
|
19788
|
+
}
|
|
19789
|
+
return out;
|
|
19790
|
+
}
|
|
19791
|
+
var AUTO = {
|
|
19792
|
+
value: "auto",
|
|
19793
|
+
label: "Auto"
|
|
19794
|
+
};
|
|
19795
|
+
var CPU = {
|
|
19796
|
+
value: "cpu",
|
|
19797
|
+
label: "CPU"
|
|
19798
|
+
};
|
|
19799
|
+
var USB = {
|
|
19800
|
+
value: "usb",
|
|
19801
|
+
label: "Coral USB"
|
|
19802
|
+
};
|
|
19803
|
+
function coralUnitOption(unit) {
|
|
19804
|
+
const bus = unit.bus === "pci" ? "PCIe" : "USB";
|
|
19805
|
+
const label = unit.index === 0 ? `Coral ${bus}` : `Coral ${bus} ${unit.index + 1}`;
|
|
19806
|
+
return {
|
|
19807
|
+
value: unit.device,
|
|
19808
|
+
label
|
|
19809
|
+
};
|
|
19810
|
+
}
|
|
19811
|
+
var ONNX_CUDA_EP = "CUDAExecutionProvider";
|
|
19812
|
+
/**
|
|
19813
|
+
* The `HardwareInfo.nvidia` slot for a found card. Usable only when the node's
|
|
19814
|
+
* ONNX Runtime lists the CUDA execution provider (`ort.get_available_providers()`,
|
|
19815
|
+
* the signal the inference pool binds on); `null` = not reported = not usable.
|
|
19816
|
+
*/
|
|
19817
|
+
function describeNvidia(probe, onnxExecutionProviders) {
|
|
19818
|
+
const base = {
|
|
19819
|
+
type: "nvidia",
|
|
19820
|
+
name: probe.name,
|
|
19821
|
+
...probe.memoryMB === void 0 ? {} : { memoryMB: probe.memoryMB }
|
|
19822
|
+
};
|
|
19823
|
+
return onnxExecutionProviders?.includes(ONNX_CUDA_EP) === true ? {
|
|
19824
|
+
...base,
|
|
19825
|
+
usable: true
|
|
19826
|
+
} : {
|
|
19827
|
+
...base,
|
|
19828
|
+
usable: false,
|
|
19829
|
+
reason: "no-cuda-execution-provider"
|
|
19830
|
+
};
|
|
19831
|
+
}
|
|
19832
|
+
/**
|
|
19833
|
+
* CUDA is offered only for a USABLE NVIDIA slot. An NVIDIA GPU alone is not
|
|
19834
|
+
* enough: without the EP the pool binds the CPU provider and a `cuda` device
|
|
19835
|
+
* would be the CPU under another name. `gpu.type === 'nvidia'` (older nodes)
|
|
19836
|
+
* never counts.
|
|
19837
|
+
*/
|
|
19838
|
+
function onnxCudaAvailable(hw) {
|
|
19839
|
+
return hw?.nvidia?.usable === true;
|
|
19840
|
+
}
|
|
19841
|
+
var RUNTIMES = [
|
|
19842
|
+
{
|
|
19843
|
+
id: "onnx",
|
|
19844
|
+
supports: () => true,
|
|
19845
|
+
devices: (hw) => {
|
|
19846
|
+
if (!hw) return [CPU];
|
|
19847
|
+
const out = [CPU];
|
|
19848
|
+
if (onnxCudaAvailable(hw)) out.push({
|
|
19849
|
+
value: "cuda",
|
|
19850
|
+
label: "CUDA"
|
|
19851
|
+
});
|
|
19852
|
+
if (hw.gpu?.type === "amd" && hw.platform === "linux") out.push({
|
|
19853
|
+
value: "webgpu",
|
|
19854
|
+
label: "WebGPU (AMD iGPU)"
|
|
19855
|
+
});
|
|
19856
|
+
if (hw.npu?.type === "apple-ane") out.push({
|
|
19857
|
+
value: "coreml",
|
|
19858
|
+
label: "CoreML EP"
|
|
19859
|
+
});
|
|
19860
|
+
return out;
|
|
19861
|
+
},
|
|
19862
|
+
defaultDevice: "cpu"
|
|
19863
|
+
},
|
|
19864
|
+
{
|
|
19865
|
+
id: "openvino",
|
|
19866
|
+
supports: (hw) => hw?.arch === "x64" && hw.platform !== "darwin" && (hw.gpu?.type === "intel" || hw.gpu?.type === "amd"),
|
|
19867
|
+
devices: (hw) => {
|
|
19868
|
+
if (!hw) return [AUTO];
|
|
19869
|
+
if (hw.gpu?.type === "amd") return [CPU];
|
|
19870
|
+
const out = [AUTO, CPU];
|
|
19871
|
+
if (hw.gpu?.type === "intel") out.push({
|
|
19872
|
+
value: "gpu",
|
|
19873
|
+
label: "GPU"
|
|
19874
|
+
});
|
|
19875
|
+
if (hw.npu?.type === "intel-npu") out.push({
|
|
19876
|
+
value: "npu",
|
|
19877
|
+
label: "NPU"
|
|
19878
|
+
});
|
|
19879
|
+
return out;
|
|
19880
|
+
},
|
|
19881
|
+
defaultDevice: "auto"
|
|
19882
|
+
},
|
|
19883
|
+
{
|
|
19884
|
+
id: "coreml",
|
|
19885
|
+
supports: (hw) => hw?.platform === "darwin",
|
|
19886
|
+
devices: (hw) => {
|
|
19887
|
+
const all = {
|
|
19888
|
+
value: "all",
|
|
19889
|
+
label: "All (ANE + GPU + CPU)"
|
|
19890
|
+
};
|
|
19891
|
+
if (!hw) return [all];
|
|
19892
|
+
const out = [all];
|
|
19893
|
+
if (hw.npu?.type === "apple-ane") out.push({
|
|
19894
|
+
value: "ane",
|
|
19895
|
+
label: "Apple Neural Engine"
|
|
19896
|
+
});
|
|
19897
|
+
out.push({
|
|
19898
|
+
value: "gpu",
|
|
19899
|
+
label: "GPU"
|
|
19900
|
+
}, CPU);
|
|
19901
|
+
return out;
|
|
19902
|
+
},
|
|
19903
|
+
defaultDevice: "all"
|
|
19904
|
+
},
|
|
19905
|
+
{
|
|
19906
|
+
id: "edgetpu",
|
|
19907
|
+
supports: (hw) => coralUsableUnits(hw?.coral).length > 0,
|
|
19908
|
+
devices: (hw) => {
|
|
19909
|
+
const units = coralUsableUnits(hw?.coral);
|
|
19910
|
+
return units.length > 0 ? units.map(coralUnitOption) : [USB];
|
|
19911
|
+
},
|
|
19912
|
+
defaultDevice: "usb"
|
|
19913
|
+
}
|
|
19914
|
+
];
|
|
19915
|
+
/**
|
|
19916
|
+
* Returns the list of supported runtime IDs for given hardware.
|
|
19917
|
+
* onnx is always included (universal floor); accelerators added when hw matches.
|
|
19918
|
+
*/
|
|
19919
|
+
function supportedRuntimes(hw) {
|
|
19920
|
+
return RUNTIMES.filter((r) => r.supports(hw)).map((r) => r.id);
|
|
19921
|
+
}
|
|
19922
|
+
/**
|
|
19923
|
+
* Scores all applicable inference backends for the given hardware.
|
|
19924
|
+
*
|
|
19925
|
+
* Rules (hardware-driven only — no Python import probes):
|
|
19926
|
+
* - coreml: score 95, darwin+arm64
|
|
19927
|
+
* - cuda: score 85, only for a usable `nvidia` slot (the CUDA EP exists)
|
|
19928
|
+
* - openvino: score 90 if intel-npu present, else 80 if intel gpu
|
|
19929
|
+
* - edgetpu: score 70, a usable Coral unit (USB or PCIe)
|
|
19930
|
+
* - cpu: score 50 (universal floor, always included)
|
|
19931
|
+
*
|
|
19932
|
+
* All hardware-matched entries are `available: true`.
|
|
19933
|
+
* Scores are sorted descending; `best` is the first available entry
|
|
19934
|
+
* (or last entry as fallback).
|
|
19935
|
+
*/
|
|
19936
|
+
function scoreRuntimes(hw) {
|
|
19937
|
+
const scores = [];
|
|
19938
|
+
if (hw.platform === "darwin" && hw.arch === "arm64") scores.push({
|
|
19939
|
+
runtime: "python",
|
|
19940
|
+
backend: "coreml",
|
|
19941
|
+
format: "coreml",
|
|
19942
|
+
score: 95,
|
|
19943
|
+
reason: "Apple Neural Engine (Python CoreML)",
|
|
19944
|
+
available: true
|
|
19945
|
+
});
|
|
19946
|
+
if (onnxCudaAvailable(hw)) scores.push({
|
|
19947
|
+
runtime: "python",
|
|
19948
|
+
backend: "cuda",
|
|
19949
|
+
format: "onnx",
|
|
19950
|
+
score: 85,
|
|
19951
|
+
reason: "NVIDIA CUDA (Python ONNX Runtime)",
|
|
19952
|
+
available: true
|
|
19953
|
+
});
|
|
19954
|
+
if (hw.gpu?.type === "intel") {
|
|
19955
|
+
const score = hw.npu?.type === "intel-npu" ? 90 : 80;
|
|
19956
|
+
scores.push({
|
|
19957
|
+
runtime: "python",
|
|
19958
|
+
backend: "openvino",
|
|
19959
|
+
format: "openvino",
|
|
19960
|
+
score,
|
|
19961
|
+
reason: "Intel OpenVINO",
|
|
19962
|
+
available: true
|
|
19963
|
+
});
|
|
19964
|
+
}
|
|
19965
|
+
if (hw.gpu?.type === "amd") {
|
|
19966
|
+
if (hw.platform === "linux") scores.push({
|
|
19967
|
+
runtime: "python",
|
|
19968
|
+
backend: "onnx",
|
|
19969
|
+
format: "onnx",
|
|
19970
|
+
score: 75,
|
|
19971
|
+
reason: "ONNX WebGPU (AMD iGPU)",
|
|
19972
|
+
available: true
|
|
19973
|
+
});
|
|
19974
|
+
scores.push({
|
|
19975
|
+
runtime: "python",
|
|
19976
|
+
backend: "openvino",
|
|
19977
|
+
format: "openvino",
|
|
19978
|
+
score: 65,
|
|
19979
|
+
reason: "OpenVINO CPU (AMD x64)",
|
|
19980
|
+
available: true
|
|
19981
|
+
});
|
|
19982
|
+
}
|
|
19983
|
+
if (coralUsableUnits(hw.coral).length > 0) scores.push({
|
|
19984
|
+
runtime: "python",
|
|
19985
|
+
backend: "edgetpu",
|
|
19986
|
+
format: "tflite",
|
|
19987
|
+
score: 70,
|
|
19988
|
+
reason: "Coral Edge TPU (Python LiteRT)",
|
|
19989
|
+
available: true
|
|
19990
|
+
});
|
|
19991
|
+
scores.push({
|
|
19992
|
+
runtime: "python",
|
|
19993
|
+
backend: "cpu",
|
|
19994
|
+
format: "onnx",
|
|
19995
|
+
score: 50,
|
|
19996
|
+
reason: "CPU (Python ONNX Runtime)",
|
|
19997
|
+
available: true
|
|
19998
|
+
});
|
|
19999
|
+
const sorted = scores.toSorted((a, b) => b.score - a.score);
|
|
20000
|
+
return {
|
|
20001
|
+
scores: sorted,
|
|
20002
|
+
best: sorted.find((s) => s.available) ?? sorted[sorted.length - 1]
|
|
20003
|
+
};
|
|
20004
|
+
}
|
|
20005
|
+
var DEVICE_FOR_BACKEND = {
|
|
20006
|
+
cuda: "gpu",
|
|
20007
|
+
edgetpu: "usb",
|
|
20008
|
+
coreml: "all",
|
|
20009
|
+
cpu: "cpu"
|
|
20010
|
+
};
|
|
20011
|
+
function device(backend, dev, format, score) {
|
|
20012
|
+
return {
|
|
20013
|
+
key: backend === "cpu" ? "cpu" : `${backend}:${dev}`,
|
|
20014
|
+
backend,
|
|
20015
|
+
device: dev,
|
|
20016
|
+
format,
|
|
20017
|
+
runtime: "python",
|
|
20018
|
+
score,
|
|
20019
|
+
available: true
|
|
20020
|
+
};
|
|
20021
|
+
}
|
|
20022
|
+
/**
|
|
20023
|
+
* Enumerate every usable inference device on a node — one descriptor PER PHYSICAL
|
|
20024
|
+
* ACCELERATOR, so the orchestrator can run and balance across all of them
|
|
20025
|
+
* CONCURRENTLY (each device is its own pool). Critically, OpenVINO is expanded
|
|
20026
|
+
* into its distinct devices (NPU / iGPU / CPU) rather than a single AUTO entry:
|
|
20027
|
+
* the Intel NPU ("AI Boost") and the iGPU are separate accelerators and run in
|
|
20028
|
+
* parallel — collapsing them to AUTO would leave one idle. NPU is scored above
|
|
20029
|
+
* the iGPU (faster for int8 detection AND frees the GPU).
|
|
20030
|
+
*/
|
|
20031
|
+
function enumerateInferenceDevices(hw) {
|
|
20032
|
+
const { scores } = scoreRuntimes(hw);
|
|
20033
|
+
const out = [];
|
|
20034
|
+
for (const s of scores) {
|
|
20035
|
+
if (s.backend === "openvino") {
|
|
20036
|
+
if (hw.npu?.type === "intel-npu") out.push(device("openvino", "npu", s.format, s.score + 2));
|
|
20037
|
+
if (hw.gpu?.type === "intel") out.push(device("openvino", "gpu", s.format, s.score));
|
|
20038
|
+
if (hw.gpu?.type === "amd") out.push(device("openvino", "cpu", s.format, s.score));
|
|
20039
|
+
continue;
|
|
20040
|
+
}
|
|
20041
|
+
if (s.backend === "edgetpu") {
|
|
20042
|
+
for (const unit of coralUsableUnits(hw.coral)) out.push(device("edgetpu", unit.device, s.format, s.score));
|
|
20043
|
+
continue;
|
|
20044
|
+
}
|
|
20045
|
+
if (s.backend === "onnx" && s.reason.startsWith("ONNX WebGPU")) {
|
|
20046
|
+
out.push(device("onnx", "webgpu", s.format, s.score));
|
|
20047
|
+
continue;
|
|
20048
|
+
}
|
|
20049
|
+
const dev = DEVICE_FOR_BACKEND[s.backend] ?? s.backend;
|
|
20050
|
+
out.push(device(s.backend, dev, s.format, s.score));
|
|
20051
|
+
}
|
|
20052
|
+
return out;
|
|
20053
|
+
}
|
|
19761
20054
|
//#endregion
|
|
19762
|
-
//#region ../types/dist/implemented-methods-
|
|
20055
|
+
//#region ../types/dist/implemented-methods-wFScvZ40.mjs
|
|
19763
20056
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
19764
20057
|
opus: "libopus",
|
|
19765
20058
|
aac: "aac",
|
|
@@ -65081,7 +65374,8 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
65081
65374
|
DeviceType.Dishwasher,
|
|
65082
65375
|
DeviceType.Vacuum,
|
|
65083
65376
|
DeviceType.LawnMower,
|
|
65084
|
-
DeviceType.PetFeeder
|
|
65377
|
+
DeviceType.PetFeeder,
|
|
65378
|
+
DeviceType.Workload
|
|
65085
65379
|
],
|
|
65086
65380
|
apply: "add",
|
|
65087
65381
|
vocabularyCap: "power-meter",
|
|
@@ -65119,7 +65413,8 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
65119
65413
|
DeviceType.Dishwasher,
|
|
65120
65414
|
DeviceType.Vacuum,
|
|
65121
65415
|
DeviceType.LawnMower,
|
|
65122
|
-
DeviceType.PetFeeder
|
|
65416
|
+
DeviceType.PetFeeder,
|
|
65417
|
+
DeviceType.Workload
|
|
65123
65418
|
],
|
|
65124
65419
|
apply: "add",
|
|
65125
65420
|
vocabularyCap: "power-meter",
|
|
@@ -65157,7 +65452,8 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
65157
65452
|
DeviceType.Dishwasher,
|
|
65158
65453
|
DeviceType.Vacuum,
|
|
65159
65454
|
DeviceType.LawnMower,
|
|
65160
|
-
DeviceType.PetFeeder
|
|
65455
|
+
DeviceType.PetFeeder,
|
|
65456
|
+
DeviceType.Workload
|
|
65161
65457
|
],
|
|
65162
65458
|
apply: "add",
|
|
65163
65459
|
vocabularyCap: "power-meter",
|
|
@@ -65195,7 +65491,8 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
65195
65491
|
DeviceType.Dishwasher,
|
|
65196
65492
|
DeviceType.Vacuum,
|
|
65197
65493
|
DeviceType.LawnMower,
|
|
65198
|
-
DeviceType.PetFeeder
|
|
65494
|
+
DeviceType.PetFeeder,
|
|
65495
|
+
DeviceType.Workload
|
|
65199
65496
|
],
|
|
65200
65497
|
apply: "add",
|
|
65201
65498
|
vocabularyCap: "power-meter",
|
|
@@ -65953,6 +66250,7 @@ var CAP_RUNTIME_FIELD_UNITS = {
|
|
|
65953
66250
|
"humidity-sensor": { humidity: "%" },
|
|
65954
66251
|
"power-meter": {
|
|
65955
66252
|
power: "W",
|
|
66253
|
+
deliveredPower: "W",
|
|
65956
66254
|
energy: "kWh",
|
|
65957
66255
|
voltage: "V",
|
|
65958
66256
|
current: "A"
|
|
@@ -75221,8 +75519,24 @@ function effectiveRefreshIntervalMs(policy) {
|
|
|
75221
75519
|
const setting = policy.intervalMs ?? 0;
|
|
75222
75520
|
return Math.max(policy.minIntervalMs, setting);
|
|
75223
75521
|
}
|
|
75224
|
-
/** The
|
|
75522
|
+
/** The first reads after a command on a read (non-push) device: offsets from the command, in ms. */
|
|
75225
75523
|
var COMMAND_BURST_OFFSETS_MS = [3e3, 1e4];
|
|
75524
|
+
/** After the first reads, a pending hold is re-read this often. */
|
|
75525
|
+
var COMMAND_BURST_STEP_MS = 1e4;
|
|
75526
|
+
/** The last read of a hold lands this long before it expires. */
|
|
75527
|
+
var COMMAND_BURST_TAIL_MS = 2e3;
|
|
75528
|
+
function commandBurstOffsets(holdMs) {
|
|
75529
|
+
const out = COMMAND_BURST_OFFSETS_MS.filter((offset) => offset < holdMs);
|
|
75530
|
+
const tail = holdMs - COMMAND_BURST_TAIL_MS;
|
|
75531
|
+
let next = (out[out.length - 1] ?? 0) + COMMAND_BURST_STEP_MS;
|
|
75532
|
+
while (next < tail) {
|
|
75533
|
+
out.push(next);
|
|
75534
|
+
next += COMMAND_BURST_STEP_MS;
|
|
75535
|
+
}
|
|
75536
|
+
const last = out[out.length - 1];
|
|
75537
|
+
if (last === void 0 ? tail > 0 : tail - last >= 1e3) out.push(tail);
|
|
75538
|
+
return out;
|
|
75539
|
+
}
|
|
75226
75540
|
/** How long the core waits for a push device to confirm a command before reading it once. */
|
|
75227
75541
|
var PUSH_CONFIRM_WINDOW_MS = 2500;
|
|
75228
75542
|
/**
|
|
@@ -79920,7 +80234,8 @@ var HERO_SCENE_BY_ROLE = {
|
|
|
79920
80234
|
[DeviceRole.AppContainer]: "inherit",
|
|
79921
80235
|
[DeviceRole.Lxc]: "inherit",
|
|
79922
80236
|
[DeviceRole.App]: "inherit",
|
|
79923
|
-
[DeviceRole.Host]: "inherit"
|
|
80237
|
+
[DeviceRole.Host]: "inherit",
|
|
80238
|
+
[DeviceRole.Ups]: "inherit"
|
|
79924
80239
|
};
|
|
79925
80240
|
function isDeviceType$3(type) {
|
|
79926
80241
|
return Object.values(DeviceType).includes(type);
|
|
@@ -100864,6 +101179,16 @@ var CoralInfoSchema = zod.z.object({
|
|
|
100864
101179
|
reason: zod.z.enum(["driver-missing", "device-not-accessible"])
|
|
100865
101180
|
})).readonly().optional()
|
|
100866
101181
|
});
|
|
101182
|
+
var NvidiaInfoBaseSchema = zod.z.object({
|
|
101183
|
+
type: zod.z.literal("nvidia"),
|
|
101184
|
+
name: zod.z.string(),
|
|
101185
|
+
memoryMB: zod.z.number().optional()
|
|
101186
|
+
});
|
|
101187
|
+
/** An NVIDIA GPU: usable ⇔ the CUDA execution provider exists; otherwise the reason. */
|
|
101188
|
+
var NvidiaInfoSchema = zod.z.discriminatedUnion("usable", [NvidiaInfoBaseSchema.extend({ usable: zod.z.literal(true) }), NvidiaInfoBaseSchema.extend({
|
|
101189
|
+
usable: zod.z.literal(false),
|
|
101190
|
+
reason: zod.z.enum(["no-cuda-execution-provider"])
|
|
101191
|
+
})]);
|
|
100867
101192
|
var HardwareInfoSchema = zod.z.object({
|
|
100868
101193
|
platform: HardwarePlatformSchema,
|
|
100869
101194
|
arch: HardwareArchSchema,
|
|
@@ -100874,6 +101199,7 @@ var HardwareInfoSchema = zod.z.object({
|
|
|
100874
101199
|
gpu: GpuInfoSchema.nullable(),
|
|
100875
101200
|
npu: NpuInfoSchema.nullable(),
|
|
100876
101201
|
coral: CoralInfoSchema.nullable().optional(),
|
|
101202
|
+
nvidia: NvidiaInfoSchema.nullable().optional(),
|
|
100877
101203
|
/**
|
|
100878
101204
|
* Per-accelerator compute (D930). Omitted by a node that has not probed it.
|
|
100879
101205
|
* `null` fields inside an entry are a failed query, never a zero.
|
|
@@ -100980,8 +101306,14 @@ var platformProbeCapability = {
|
|
|
100980
101306
|
* in real-world devices.
|
|
100981
101307
|
*/
|
|
100982
101308
|
var PowerMeterStatusSchema = zod.z.object({
|
|
100983
|
-
/** Instantaneous power draw (watts). */
|
|
101309
|
+
/** Instantaneous TOTAL power draw of the device (watts), when known. */
|
|
100984
101310
|
power: zod.z.number().optional().meta(readingMeta("power", { label: "Power" })),
|
|
101311
|
+
/**
|
|
101312
|
+
* Power the device passes on to downstream loads (watts), e.g. the PoE a switch delivers to
|
|
101313
|
+
* its ports. When `power` is known it already includes this (the own draw is `netPowerOf`);
|
|
101314
|
+
* a device that reports no total (a UniFi switch) carries this field alone.
|
|
101315
|
+
*/
|
|
101316
|
+
deliveredPower: zod.z.number().optional().meta(readingMeta("power", { label: "Delivered" })),
|
|
100985
101317
|
/** Cumulative energy in kilowatt-hours since the meter was reset. */
|
|
100986
101318
|
energy: zod.z.number().optional().meta(readingMeta("energy", { label: "Energy" })),
|
|
100987
101319
|
/** Voltage (volts). */
|
|
@@ -101016,7 +101348,8 @@ var POWER_METER_DEVICE_TYPES = [
|
|
|
101016
101348
|
DeviceType.Dishwasher,
|
|
101017
101349
|
DeviceType.Vacuum,
|
|
101018
101350
|
DeviceType.LawnMower,
|
|
101019
|
-
DeviceType.PetFeeder
|
|
101351
|
+
DeviceType.PetFeeder,
|
|
101352
|
+
DeviceType.Workload
|
|
101020
101353
|
];
|
|
101021
101354
|
/** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
|
|
101022
101355
|
var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== DeviceType.Sensor);
|
|
@@ -121822,7 +122155,19 @@ var runningStateContribution = contribution("running-state", RunningStateStatusS
|
|
|
121822
122155
|
};
|
|
121823
122156
|
});
|
|
121824
122157
|
var powerMeterContribution = contribution("power-meter", PowerMeterStatusSchema, (slice) => {
|
|
121825
|
-
if (slice?.power === void 0)
|
|
122158
|
+
if (slice?.power === void 0) {
|
|
122159
|
+
if (slice?.deliveredPower === void 0) return { measurement: emptyMeasurement("power") };
|
|
122160
|
+
const delivered = Math.round(slice.deliveredPower);
|
|
122161
|
+
const deliveredText = t(`${delivered} W`, `${delivered} W`);
|
|
122162
|
+
return measured({
|
|
122163
|
+
facts: [fact("power", "zap", t(`Delivered ${delivered} W`, `Erogata ${delivered} W`), delivered > 0 ? "primary" : "muted")],
|
|
122164
|
+
tilesFallback: true,
|
|
122165
|
+
tiles: { right: [{
|
|
122166
|
+
label: t("Delivered", "Erogata"),
|
|
122167
|
+
value: deliveredText
|
|
122168
|
+
}] }
|
|
122169
|
+
}, powerMeasurement(slice.deliveredPower, slice.lastFetchedAt));
|
|
122170
|
+
}
|
|
121826
122171
|
const detail = [];
|
|
121827
122172
|
if (slice.energy !== void 0) detail.push({
|
|
121828
122173
|
label: t("Energy", "Energia"),
|
|
@@ -123227,7 +123572,8 @@ var HERO_LOOK_BY_ROLE = {
|
|
|
123227
123572
|
[DeviceRole.AppContainer]: "inherit",
|
|
123228
123573
|
[DeviceRole.Lxc]: "inherit",
|
|
123229
123574
|
[DeviceRole.App]: "inherit",
|
|
123230
|
-
[DeviceRole.Host]: "inherit"
|
|
123575
|
+
[DeviceRole.Host]: "inherit",
|
|
123576
|
+
[DeviceRole.Ups]: "inherit"
|
|
123231
123577
|
};
|
|
123232
123578
|
function isDeviceType$1(type) {
|
|
123233
123579
|
return Object.values(DeviceType).includes(type);
|
|
@@ -134511,7 +134857,7 @@ function offered(received) {
|
|
|
134511
134857
|
}
|
|
134512
134858
|
offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
|
|
134513
134859
|
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
134514
|
-
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
|
|
134860
|
+
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host, DeviceRole.Ups;
|
|
134515
134861
|
new Set(Object.values(DeviceType));
|
|
134516
134862
|
new Set(Object.values(DeviceRole));
|
|
134517
134863
|
/**
|
|
@@ -139818,262 +140164,6 @@ function processTimeZoneOr(fallback, logger, probe = {}) {
|
|
|
139818
140164
|
}
|
|
139819
140165
|
return fallback;
|
|
139820
140166
|
}
|
|
139821
|
-
/** Bus order of the enumeration: USB first (the historical key), then PCIe. */
|
|
139822
|
-
var BUS_ORDER = ["usb", "pci"];
|
|
139823
|
-
function unitDevice(bus, index) {
|
|
139824
|
-
return index === 0 ? bus : `${bus}:${index}`;
|
|
139825
|
-
}
|
|
139826
|
-
function countOn(coral, bus) {
|
|
139827
|
-
if (coral.units !== void 0) return coral.units.filter((u) => u.bus === bus).reduce((n, u) => n + Math.max(0, u.count), 0);
|
|
139828
|
-
return bus === (coral.bus === "pci" ? "pci" : "usb") ? Math.max(1, coral.count ?? 1) : 0;
|
|
139829
|
-
}
|
|
139830
|
-
/** Every usable Coral unit on a node, USB first then PCIe, in ordinal order. */
|
|
139831
|
-
function coralUsableUnits(coral) {
|
|
139832
|
-
if (coral == null) return [];
|
|
139833
|
-
const out = [];
|
|
139834
|
-
for (const bus of BUS_ORDER) {
|
|
139835
|
-
const count = countOn(coral, bus);
|
|
139836
|
-
for (let index = 0; index < count; index++) out.push({
|
|
139837
|
-
bus,
|
|
139838
|
-
index,
|
|
139839
|
-
device: unitDevice(bus, index)
|
|
139840
|
-
});
|
|
139841
|
-
}
|
|
139842
|
-
return out;
|
|
139843
|
-
}
|
|
139844
|
-
var AUTO = {
|
|
139845
|
-
value: "auto",
|
|
139846
|
-
label: "Auto"
|
|
139847
|
-
};
|
|
139848
|
-
var CPU = {
|
|
139849
|
-
value: "cpu",
|
|
139850
|
-
label: "CPU"
|
|
139851
|
-
};
|
|
139852
|
-
var USB = {
|
|
139853
|
-
value: "usb",
|
|
139854
|
-
label: "Coral USB"
|
|
139855
|
-
};
|
|
139856
|
-
function coralUnitOption(unit) {
|
|
139857
|
-
const bus = unit.bus === "pci" ? "PCIe" : "USB";
|
|
139858
|
-
const label = unit.index === 0 ? `Coral ${bus}` : `Coral ${bus} ${unit.index + 1}`;
|
|
139859
|
-
return {
|
|
139860
|
-
value: unit.device,
|
|
139861
|
-
label
|
|
139862
|
-
};
|
|
139863
|
-
}
|
|
139864
|
-
var RUNTIMES = [
|
|
139865
|
-
{
|
|
139866
|
-
id: "onnx",
|
|
139867
|
-
supports: () => true,
|
|
139868
|
-
devices: (hw) => {
|
|
139869
|
-
if (!hw) return [CPU];
|
|
139870
|
-
const out = [CPU];
|
|
139871
|
-
if (hw.gpu?.type === "nvidia") out.push({
|
|
139872
|
-
value: "cuda",
|
|
139873
|
-
label: "CUDA"
|
|
139874
|
-
});
|
|
139875
|
-
if (hw.gpu?.type === "amd" && hw.platform === "linux") out.push({
|
|
139876
|
-
value: "webgpu",
|
|
139877
|
-
label: "WebGPU (AMD iGPU)"
|
|
139878
|
-
});
|
|
139879
|
-
if (hw.npu?.type === "apple-ane") out.push({
|
|
139880
|
-
value: "coreml",
|
|
139881
|
-
label: "CoreML EP"
|
|
139882
|
-
});
|
|
139883
|
-
return out;
|
|
139884
|
-
},
|
|
139885
|
-
defaultDevice: "cpu"
|
|
139886
|
-
},
|
|
139887
|
-
{
|
|
139888
|
-
id: "openvino",
|
|
139889
|
-
supports: (hw) => hw?.arch === "x64" && hw.platform !== "darwin" && (hw.gpu?.type === "intel" || hw.gpu?.type === "amd"),
|
|
139890
|
-
devices: (hw) => {
|
|
139891
|
-
if (!hw) return [AUTO];
|
|
139892
|
-
if (hw.gpu?.type === "amd") return [CPU];
|
|
139893
|
-
const out = [AUTO, CPU];
|
|
139894
|
-
if (hw.gpu?.type === "intel") out.push({
|
|
139895
|
-
value: "gpu",
|
|
139896
|
-
label: "GPU"
|
|
139897
|
-
});
|
|
139898
|
-
if (hw.npu?.type === "intel-npu") out.push({
|
|
139899
|
-
value: "npu",
|
|
139900
|
-
label: "NPU"
|
|
139901
|
-
});
|
|
139902
|
-
return out;
|
|
139903
|
-
},
|
|
139904
|
-
defaultDevice: "auto"
|
|
139905
|
-
},
|
|
139906
|
-
{
|
|
139907
|
-
id: "coreml",
|
|
139908
|
-
supports: (hw) => hw?.platform === "darwin",
|
|
139909
|
-
devices: (hw) => {
|
|
139910
|
-
const all = {
|
|
139911
|
-
value: "all",
|
|
139912
|
-
label: "All (ANE + GPU + CPU)"
|
|
139913
|
-
};
|
|
139914
|
-
if (!hw) return [all];
|
|
139915
|
-
const out = [all];
|
|
139916
|
-
if (hw.npu?.type === "apple-ane") out.push({
|
|
139917
|
-
value: "ane",
|
|
139918
|
-
label: "Apple Neural Engine"
|
|
139919
|
-
});
|
|
139920
|
-
out.push({
|
|
139921
|
-
value: "gpu",
|
|
139922
|
-
label: "GPU"
|
|
139923
|
-
}, CPU);
|
|
139924
|
-
return out;
|
|
139925
|
-
},
|
|
139926
|
-
defaultDevice: "all"
|
|
139927
|
-
},
|
|
139928
|
-
{
|
|
139929
|
-
id: "edgetpu",
|
|
139930
|
-
supports: (hw) => coralUsableUnits(hw?.coral).length > 0,
|
|
139931
|
-
devices: (hw) => {
|
|
139932
|
-
const units = coralUsableUnits(hw?.coral);
|
|
139933
|
-
return units.length > 0 ? units.map(coralUnitOption) : [USB];
|
|
139934
|
-
},
|
|
139935
|
-
defaultDevice: "usb"
|
|
139936
|
-
}
|
|
139937
|
-
];
|
|
139938
|
-
/**
|
|
139939
|
-
* Returns the list of supported runtime IDs for given hardware.
|
|
139940
|
-
* onnx is always included (universal floor); accelerators added when hw matches.
|
|
139941
|
-
*/
|
|
139942
|
-
function supportedRuntimes(hw) {
|
|
139943
|
-
return RUNTIMES.filter((r) => r.supports(hw)).map((r) => r.id);
|
|
139944
|
-
}
|
|
139945
|
-
/**
|
|
139946
|
-
* Scores all applicable inference backends for the given hardware.
|
|
139947
|
-
*
|
|
139948
|
-
* Rules (hardware-driven only — no Python import probes):
|
|
139949
|
-
* - coreml: score 95, darwin+arm64
|
|
139950
|
-
* - cuda: score 85, nvidia gpu
|
|
139951
|
-
* - openvino: score 90 if intel-npu present, else 80 if intel gpu
|
|
139952
|
-
* - edgetpu: score 70, a usable Coral unit (USB or PCIe)
|
|
139953
|
-
* - cpu: score 50 (universal floor, always included)
|
|
139954
|
-
*
|
|
139955
|
-
* All hardware-matched entries are `available: true`.
|
|
139956
|
-
* Scores are sorted descending; `best` is the first available entry
|
|
139957
|
-
* (or last entry as fallback).
|
|
139958
|
-
*/
|
|
139959
|
-
function scoreRuntimes(hw) {
|
|
139960
|
-
const scores = [];
|
|
139961
|
-
if (hw.platform === "darwin" && hw.arch === "arm64") scores.push({
|
|
139962
|
-
runtime: "python",
|
|
139963
|
-
backend: "coreml",
|
|
139964
|
-
format: "coreml",
|
|
139965
|
-
score: 95,
|
|
139966
|
-
reason: "Apple Neural Engine (Python CoreML)",
|
|
139967
|
-
available: true
|
|
139968
|
-
});
|
|
139969
|
-
if (hw.gpu?.type === "nvidia") scores.push({
|
|
139970
|
-
runtime: "python",
|
|
139971
|
-
backend: "cuda",
|
|
139972
|
-
format: "onnx",
|
|
139973
|
-
score: 85,
|
|
139974
|
-
reason: "NVIDIA CUDA (Python ONNX Runtime)",
|
|
139975
|
-
available: true
|
|
139976
|
-
});
|
|
139977
|
-
if (hw.gpu?.type === "intel") {
|
|
139978
|
-
const score = hw.npu?.type === "intel-npu" ? 90 : 80;
|
|
139979
|
-
scores.push({
|
|
139980
|
-
runtime: "python",
|
|
139981
|
-
backend: "openvino",
|
|
139982
|
-
format: "openvino",
|
|
139983
|
-
score,
|
|
139984
|
-
reason: "Intel OpenVINO",
|
|
139985
|
-
available: true
|
|
139986
|
-
});
|
|
139987
|
-
}
|
|
139988
|
-
if (hw.gpu?.type === "amd") {
|
|
139989
|
-
if (hw.platform === "linux") scores.push({
|
|
139990
|
-
runtime: "python",
|
|
139991
|
-
backend: "onnx",
|
|
139992
|
-
format: "onnx",
|
|
139993
|
-
score: 75,
|
|
139994
|
-
reason: "ONNX WebGPU (AMD iGPU)",
|
|
139995
|
-
available: true
|
|
139996
|
-
});
|
|
139997
|
-
scores.push({
|
|
139998
|
-
runtime: "python",
|
|
139999
|
-
backend: "openvino",
|
|
140000
|
-
format: "openvino",
|
|
140001
|
-
score: 65,
|
|
140002
|
-
reason: "OpenVINO CPU (AMD x64)",
|
|
140003
|
-
available: true
|
|
140004
|
-
});
|
|
140005
|
-
}
|
|
140006
|
-
if (coralUsableUnits(hw.coral).length > 0) scores.push({
|
|
140007
|
-
runtime: "python",
|
|
140008
|
-
backend: "edgetpu",
|
|
140009
|
-
format: "tflite",
|
|
140010
|
-
score: 70,
|
|
140011
|
-
reason: "Coral Edge TPU (Python LiteRT)",
|
|
140012
|
-
available: true
|
|
140013
|
-
});
|
|
140014
|
-
scores.push({
|
|
140015
|
-
runtime: "python",
|
|
140016
|
-
backend: "cpu",
|
|
140017
|
-
format: "onnx",
|
|
140018
|
-
score: 50,
|
|
140019
|
-
reason: "CPU (Python ONNX Runtime)",
|
|
140020
|
-
available: true
|
|
140021
|
-
});
|
|
140022
|
-
const sorted = scores.toSorted((a, b) => b.score - a.score);
|
|
140023
|
-
return {
|
|
140024
|
-
scores: sorted,
|
|
140025
|
-
best: sorted.find((s) => s.available) ?? sorted[sorted.length - 1]
|
|
140026
|
-
};
|
|
140027
|
-
}
|
|
140028
|
-
var DEVICE_FOR_BACKEND = {
|
|
140029
|
-
cuda: "gpu",
|
|
140030
|
-
edgetpu: "usb",
|
|
140031
|
-
coreml: "all",
|
|
140032
|
-
cpu: "cpu"
|
|
140033
|
-
};
|
|
140034
|
-
function device(backend, dev, format, score) {
|
|
140035
|
-
return {
|
|
140036
|
-
key: backend === "cpu" ? "cpu" : `${backend}:${dev}`,
|
|
140037
|
-
backend,
|
|
140038
|
-
device: dev,
|
|
140039
|
-
format,
|
|
140040
|
-
runtime: "python",
|
|
140041
|
-
score,
|
|
140042
|
-
available: true
|
|
140043
|
-
};
|
|
140044
|
-
}
|
|
140045
|
-
/**
|
|
140046
|
-
* Enumerate every usable inference device on a node — one descriptor PER PHYSICAL
|
|
140047
|
-
* ACCELERATOR, so the orchestrator can run and balance across all of them
|
|
140048
|
-
* CONCURRENTLY (each device is its own pool). Critically, OpenVINO is expanded
|
|
140049
|
-
* into its distinct devices (NPU / iGPU / CPU) rather than a single AUTO entry:
|
|
140050
|
-
* the Intel NPU ("AI Boost") and the iGPU are separate accelerators and run in
|
|
140051
|
-
* parallel — collapsing them to AUTO would leave one idle. NPU is scored above
|
|
140052
|
-
* the iGPU (faster for int8 detection AND frees the GPU).
|
|
140053
|
-
*/
|
|
140054
|
-
function enumerateInferenceDevices(hw) {
|
|
140055
|
-
const { scores } = scoreRuntimes(hw);
|
|
140056
|
-
const out = [];
|
|
140057
|
-
for (const s of scores) {
|
|
140058
|
-
if (s.backend === "openvino") {
|
|
140059
|
-
if (hw.npu?.type === "intel-npu") out.push(device("openvino", "npu", s.format, s.score + 2));
|
|
140060
|
-
if (hw.gpu?.type === "intel") out.push(device("openvino", "gpu", s.format, s.score));
|
|
140061
|
-
if (hw.gpu?.type === "amd") out.push(device("openvino", "cpu", s.format, s.score));
|
|
140062
|
-
continue;
|
|
140063
|
-
}
|
|
140064
|
-
if (s.backend === "edgetpu") {
|
|
140065
|
-
for (const unit of coralUsableUnits(hw.coral)) out.push(device("edgetpu", unit.device, s.format, s.score));
|
|
140066
|
-
continue;
|
|
140067
|
-
}
|
|
140068
|
-
if (s.backend === "onnx" && s.reason.startsWith("ONNX WebGPU")) {
|
|
140069
|
-
out.push(device("onnx", "webgpu", s.format, s.score));
|
|
140070
|
-
continue;
|
|
140071
|
-
}
|
|
140072
|
-
const dev = DEVICE_FOR_BACKEND[s.backend] ?? s.backend;
|
|
140073
|
-
out.push(device(s.backend, dev, s.format, s.score));
|
|
140074
|
-
}
|
|
140075
|
-
return out;
|
|
140076
|
-
}
|
|
140077
140167
|
/** How often an implementer re-asks for tombstones after its start-up pass. */
|
|
140078
140168
|
var REMOVAL_RECONCILE_INTERVAL_MS = 360 * 60 * 1e3;
|
|
140079
140169
|
/** One reconcile pass over every tombstone inside the retention window. */
|
|
@@ -140487,12 +140577,6 @@ Object.defineProperty(exports, "CATALOG_LANGS", {
|
|
|
140487
140577
|
return CATALOG_LANGS;
|
|
140488
140578
|
}
|
|
140489
140579
|
});
|
|
140490
|
-
Object.defineProperty(exports, "COMMAND_BURST_OFFSETS_MS", {
|
|
140491
|
-
enumerable: true,
|
|
140492
|
-
get: function() {
|
|
140493
|
-
return COMMAND_BURST_OFFSETS_MS;
|
|
140494
|
-
}
|
|
140495
|
-
});
|
|
140496
140580
|
Object.defineProperty(exports, "COMPOSED_DEVICE_STABLE_ID_PREFIX", {
|
|
140497
140581
|
enumerable: true,
|
|
140498
140582
|
get: function() {
|
|
@@ -141819,6 +141903,12 @@ Object.defineProperty(exports, "colorCapability", {
|
|
|
141819
141903
|
return colorCapability;
|
|
141820
141904
|
}
|
|
141821
141905
|
});
|
|
141906
|
+
Object.defineProperty(exports, "commandBurstOffsets", {
|
|
141907
|
+
enumerable: true,
|
|
141908
|
+
get: function() {
|
|
141909
|
+
return commandBurstOffsets;
|
|
141910
|
+
}
|
|
141911
|
+
});
|
|
141822
141912
|
Object.defineProperty(exports, "commandEffect", {
|
|
141823
141913
|
enumerable: true,
|
|
141824
141914
|
get: function() {
|
|
@@ -142059,6 +142149,12 @@ Object.defineProperty(exports, "describeComposableCaps", {
|
|
|
142059
142149
|
return describeComposableCaps;
|
|
142060
142150
|
}
|
|
142061
142151
|
});
|
|
142152
|
+
Object.defineProperty(exports, "describeNvidia", {
|
|
142153
|
+
enumerable: true,
|
|
142154
|
+
get: function() {
|
|
142155
|
+
return describeNvidia;
|
|
142156
|
+
}
|
|
142157
|
+
});
|
|
142062
142158
|
Object.defineProperty(exports, "describeUnmet", {
|
|
142063
142159
|
enumerable: true,
|
|
142064
142160
|
get: function() {
|