@camstack/server 1.2.884 → 1.2.885
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 +4 -4
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +3 -3
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +4 -4
- package/system/dist/builtins/alerts/alerts.addon.mjs +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +4 -4
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +9 -9
- package/system/dist/builtins/platform-probe/index.mjs +9 -9
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +19 -19
- package/system/dist/builtins/system-config/system-config.addon.mjs +113 -113
- package/system/dist/{coral-accelerators-DBlgWB8k.mjs → coral-accelerators-BW3OcrLD.mjs} +6 -6
- package/system/dist/{custom-action-registry-B9zFBNVa.mjs → custom-action-registry-N7flBDwT.mjs} +37 -37
- package/system/dist/{hub-identity-Dd-T60Rd.mjs → hub-identity-DWpZuOni.mjs} +9 -9
- package/system/dist/{hub-mdns-ciao-CJlJ0skx.mjs → hub-mdns-ciao-DwnPlf4P.mjs} +1 -1
- package/system/dist/index.js +31 -5
- package/system/dist/index.mjs +243 -217
- package/system/dist/kernel/unsupported-addon-tracker.d.ts +10 -2
- package/system/dist/{restore-archive-DSHgzPzG.mjs → restore-archive-B4f1EeXn.mjs} +93 -93
- package/system/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.885] - 2026-11-15
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- An addon's 'version unsupported' alert now clears after the node restarts on a server that supports it.
|
|
15
|
+
|
|
10
16
|
## [1.2.884] - 2026-11-15
|
|
11
17
|
|
|
12
18
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.885",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
],
|
|
67
67
|
"requires": {
|
|
68
68
|
"addons": {
|
|
69
|
-
"@camstack/addon-
|
|
70
|
-
"@camstack/addon-
|
|
69
|
+
"@camstack/addon-pipeline-orchestrator": ">=1.2.692",
|
|
70
|
+
"@camstack/addon-provider-homematic": ">=1.2.203"
|
|
71
71
|
},
|
|
72
72
|
"wrapper": {
|
|
73
73
|
"desktop": ">=0.0.1",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@camstack/addon-decoder-nodeav": "1.2.149",
|
|
84
84
|
"@camstack/addon-notifiers": "1.2.639",
|
|
85
85
|
"@camstack/addon-pipeline": "1.2.655",
|
|
86
|
-
"@camstack/addon-pipeline-orchestrator": "1.2.
|
|
86
|
+
"@camstack/addon-pipeline-orchestrator": "1.2.692",
|
|
87
87
|
"@camstack/addon-post-analysis": "1.2.709",
|
|
88
88
|
"@camstack/develop": "0.1.53",
|
|
89
89
|
"@camstack/sdk": "1.2.158",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as readCurrentCommandOrigin } from "./cap-call-scope-Bic6Ekfw.mjs";
|
|
2
|
-
import { C as isModelDownloaded, S as isModelDownloadHttpError, _ as downloadFile, a as startEventLoopStallMonitor, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, p as ModelDownloadHttpError, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-
|
|
2
|
+
import { C as isModelDownloaded, S as isModelDownloadHttpError, _ as downloadFile, a as startEventLoopStallMonitor, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, p as ModelDownloadHttpError, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-N7flBDwT.mjs";
|
|
3
3
|
import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg, t as COURTESY_DEFAULT_WIDTH } from "./snapshot-courtesy-CyFs1M3I.mjs";
|
|
4
4
|
export { COURTESY_DEFAULT_WIDTH, CustomActionRegistry, ModelDownloadHttpError, ModelDownloadService, STALL_REPORT_MS, STALL_TICK_MS, adoptModelRevisions, attributeStall, collectModelFiles, contentTypeFor, courtesyCacheKey, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloadHttpError, isModelDownloaded, parseRangeHeader, readCurrentCommandOrigin, renderCourtesyJpeg, renderCourtesyOverlayJpeg, resolveFormatRevision, startEventLoopStallMonitor };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { En as addonPagesCapability, Jl as EventCategory, Kl as errMsg, Ks as BaseAddon } from "../../dist-BDoMdUU3.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
|
-
import * as fs
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
//#region src/builtins/addon-pages-aggregator/dedupe-pages.ts
|
|
7
7
|
/** Stable identity for an addon page, independent of which node reported it. */
|
|
@@ -211,11 +211,11 @@ var AddonPagesAggregatorAddon = class extends BaseAddon {
|
|
|
211
211
|
const bundlePath = this.resolveBundlePath(addonId, bundle);
|
|
212
212
|
if (bundlePath === null) return `/api/addon-pages/${addonId}/${bundle}?v=${Math.floor(Date.now())}`;
|
|
213
213
|
try {
|
|
214
|
-
const stat = fs
|
|
214
|
+
const stat = fs.statSync(bundlePath);
|
|
215
215
|
const cacheKey = `${bundlePath}:${stat.size}:${stat.mtimeMs}`;
|
|
216
216
|
let v = this.bundleHashCache.get(cacheKey);
|
|
217
217
|
if (v === void 0) {
|
|
218
|
-
v = createHash("sha1").update(fs
|
|
218
|
+
v = createHash("sha1").update(fs.readFileSync(bundlePath)).digest("hex").slice(0, 12);
|
|
219
219
|
this.bundleHashCache.set(cacheKey, v);
|
|
220
220
|
}
|
|
221
221
|
return `/api/addon-pages/${addonId}/${bundle}?v=${v}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Jl as EventCategory, Kl as errMsg, Ks as BaseAddon, On as addonWidgetsCapability } from "../../dist-BDoMdUU3.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
|
-
import * as fs
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
//#region src/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.ts
|
|
7
7
|
/**
|
|
@@ -204,9 +204,9 @@ var AddonWidgetsAggregatorAddon = class extends BaseAddon {
|
|
|
204
204
|
if (entryPath === null) return String(Math.floor(Date.now()));
|
|
205
205
|
try {
|
|
206
206
|
const dir = path$1.dirname(entryPath);
|
|
207
|
-
const files = fs
|
|
207
|
+
const files = fs.readdirSync(dir).filter((f) => fs.statSync(path$1.join(dir, f)).isFile()).sort();
|
|
208
208
|
const cacheKey = `${dir}#${files.map((f) => {
|
|
209
|
-
const s = fs
|
|
209
|
+
const s = fs.statSync(path$1.join(dir, f));
|
|
210
210
|
return `${f}:${s.size}:${s.mtimeMs}`;
|
|
211
211
|
}).join("|")}`;
|
|
212
212
|
const cached = this.bundleHashCache.get(cacheKey);
|
|
@@ -214,7 +214,7 @@ var AddonWidgetsAggregatorAddon = class extends BaseAddon {
|
|
|
214
214
|
const hash = createHash("sha1");
|
|
215
215
|
for (const f of files) {
|
|
216
216
|
hash.update(f);
|
|
217
|
-
hash.update(fs
|
|
217
|
+
hash.update(fs.readFileSync(path$1.join(dir, f)));
|
|
218
218
|
}
|
|
219
219
|
const digest = hash.digest("hex").slice(0, 12);
|
|
220
220
|
this.bundleHashCache.set(cacheKey, digest);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { An as alertEpisodePayload, D as CORE_BLOCK_ADDON_PREFIX, Jc as defineRecordKinds, Jl as EventCategory, Kl as errMsg, Ks as BaseAddon, Uc as createEvent, bi as isAlertEpisodeOpen, jn as alertsCapability, kn as alertEpisodeId, p as AlertSchema, xi as isAlertEpisodeSeverity } from "../../dist-BDoMdUU3.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
import { a as redactLogText } from "../../log-redactor-XLDrPzOi.mjs";
|
|
4
|
-
import * as fs
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
//#region src/builtins/alerts/alert-episode-policy.ts
|
|
7
7
|
/**
|
|
@@ -148,7 +148,7 @@ function lastCauseAfterChunk(previous, chunk) {
|
|
|
148
148
|
function readRunnerDisplayName(addonDirs, runnerId) {
|
|
149
149
|
const names = [];
|
|
150
150
|
for (const dir of addonDirs) try {
|
|
151
|
-
const raw = JSON.parse(fs
|
|
151
|
+
const raw = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
152
152
|
const camstack = typeof raw === "object" && raw !== null ? Reflect.get(raw, "camstack") : null;
|
|
153
153
|
const addons = typeof camstack === "object" && camstack !== null ? Reflect.get(camstack, "addons") : null;
|
|
154
154
|
if (!Array.isArray(addons)) continue;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fl as toNodeId, In as backupCapability, Jl as EventCategory, Ks as BaseAddon, No as storageOccupancyCapability, Yi as mayWriteToLocation, yl as nodePin } from "../../dist-BDoMdUU3.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
-
import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-
|
|
3
|
+
import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-B4f1EeXn.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
|
-
import * as fs
|
|
5
|
+
import * as fs from "node:fs";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
7
7
|
import * as fsp from "node:fs/promises";
|
|
8
8
|
//#region src/builtins/backup-orchestrator/backup-databases.ts
|
|
@@ -1018,7 +1018,7 @@ async function downloadArchiveToCache(input) {
|
|
|
1018
1018
|
location: input.locationId,
|
|
1019
1019
|
relativePath: input.filename
|
|
1020
1020
|
});
|
|
1021
|
-
const writeStream = fs
|
|
1021
|
+
const writeStream = fs.createWriteStream(input.cachePath);
|
|
1022
1022
|
let offset = 0;
|
|
1023
1023
|
try {
|
|
1024
1024
|
while (offset < sizeBytes) {
|
|
@@ -2502,7 +2502,7 @@ var BackupOrchestratorAddon = class extends BaseAddon {
|
|
|
2502
2502
|
});
|
|
2503
2503
|
try {
|
|
2504
2504
|
let offset = 0;
|
|
2505
|
-
const stream = fs
|
|
2505
|
+
const stream = fs.createReadStream(input.cachePath, { highWaterMark: UPLOAD_CHUNK_BYTES });
|
|
2506
2506
|
for await (const rawChunk of stream) {
|
|
2507
2507
|
if (input.signal?.aborted) {
|
|
2508
2508
|
stream.destroy();
|
|
@@ -8,7 +8,7 @@ import { z } from "zod";
|
|
|
8
8
|
import * as crypto$1 from "node:crypto";
|
|
9
9
|
import { X509Certificate, createHash, randomUUID, timingSafeEqual } from "node:crypto";
|
|
10
10
|
import nodeCrypto from "crypto";
|
|
11
|
-
import * as fs
|
|
11
|
+
import * as fs from "node:fs";
|
|
12
12
|
import * as path$1 from "node:path";
|
|
13
13
|
//#region ../../node_modules/bcryptjs/index.js
|
|
14
14
|
/**
|
|
@@ -11925,8 +11925,8 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
11925
11925
|
users: this.userManager,
|
|
11926
11926
|
dataDir: this.ctx.nodeDataDir,
|
|
11927
11927
|
fs: {
|
|
11928
|
-
exists: (filePath) => fs
|
|
11929
|
-
remove: (filePath) => fs
|
|
11928
|
+
exists: (filePath) => fs.existsSync(filePath),
|
|
11929
|
+
remove: (filePath) => fs.rmSync(filePath, { force: true })
|
|
11930
11930
|
},
|
|
11931
11931
|
logger: this.ctx.logger
|
|
11932
11932
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ct as HUB_MDNS_TXT_KEYS, Di as isDefaultAppConnectionEndpoint, Ea as preconditionOf, Gc as defineAddonMigrations, Jl as EventCategory, Kl as errMsg, Ks as BaseAddon, Qo as validateCustomAddress, Rt as NetworkTunnelStartedDataSchema, Si as isAppLinkBase, St as HUB_MDNS_SERVICE_TYPE, Vi as localNetworkCapability, Ya as resolveAppConnections, ba as pickAppLinkHub, eo as resolveHubAddressRoles, er as checkRoleAddress, io as resolveNotificationTapAddress, wo as shortHostname, x as CAMSTACK_APP_LINK_ORIGIN } from "../../dist-BDoMdUU3.mjs";
|
|
2
2
|
import { a as emptyMdnsRecords, c as parseMdnsMessage, i as buildRecordQuery, l as parseMdnsRecords, n as MDNS_PORT, o as mergeMdnsRecords, r as buildPtrQuery, s as normalizeServiceType, t as MDNS_GROUP } from "../../dns-wire-Dm3H_7ST.mjs";
|
|
3
|
-
import { i as loadOrCreateHubId, r as isAnnouncedHubId } from "../../hub-identity-
|
|
4
|
-
import { E as ensureTlsCert, I as readLanHttpState, N as applyLanHttp, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, d as servedHttpsLeafFingerprint, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, y as writeExtraSans } from "../../hub-mdns-ciao-
|
|
3
|
+
import { i as loadOrCreateHubId, r as isAnnouncedHubId } from "../../hub-identity-DWpZuOni.mjs";
|
|
4
|
+
import { E as ensureTlsCert, I as readLanHttpState, N as applyLanHttp, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, d as servedHttpsLeafFingerprint, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, y as writeExtraSans } from "../../hub-mdns-ciao-DwnPlf4P.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { isIP } from "node:net";
|
|
7
7
|
import { readFileSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Jl as EventCategory, Kl as errMsg, Ks as BaseAddon, Uc as createEvent, Xa as resolveBucketMs, Zt as ROOT_BUCKET_KEY, ai as foldSnapshotByFunction, bn as UNATTRIBUTED_BUCKET_KEY, ea as metricsProviderCapability, za as reducePoints } from "../../dist-BDoMdUU3.mjs";
|
|
2
|
-
import * as fs
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
3
|
import { constants, readFileSync } from "node:fs";
|
|
4
4
|
import { access, readFile, readdir } from "node:fs/promises";
|
|
5
5
|
import { promisify } from "node:util";
|
|
@@ -1686,7 +1686,7 @@ var NativeMetricsProvider = class {
|
|
|
1686
1686
|
let swapUsedBytes = 0;
|
|
1687
1687
|
let swapTotalBytes = 0;
|
|
1688
1688
|
if (IS_LINUX) try {
|
|
1689
|
-
const meminfo = fs
|
|
1689
|
+
const meminfo = fs.readFileSync("/proc/meminfo", "utf-8");
|
|
1690
1690
|
const availKb = meminfo.match(/MemAvailable:\s+(\d+)/)?.[1];
|
|
1691
1691
|
if (availKb !== void 0) available = parseInt(availKb, 10) * 1024;
|
|
1692
1692
|
const swapTotal = parseInt(meminfo.match(/SwapTotal:\s+(\d+)/)?.[1] ?? "0", 10) * 1024;
|
|
@@ -1779,7 +1779,7 @@ async function sampleMacMemory(provider) {
|
|
|
1779
1779
|
}
|
|
1780
1780
|
function getDiskSpaceInternal(dirPath) {
|
|
1781
1781
|
return new Promise((resolve, reject) => {
|
|
1782
|
-
fs
|
|
1782
|
+
fs.statfs(dirPath, (err, stats) => {
|
|
1783
1783
|
if (err) return reject(err);
|
|
1784
1784
|
const totalBytes = stats.blocks * stats.bsize;
|
|
1785
1785
|
const availableBytes = stats.bavail * stats.bsize;
|
|
@@ -1797,7 +1797,7 @@ function getDiskSpaceInternal(dirPath) {
|
|
|
1797
1797
|
async function takeDiskIoSnapshot() {
|
|
1798
1798
|
const now = Date.now();
|
|
1799
1799
|
if (IS_LINUX) try {
|
|
1800
|
-
const data = fs
|
|
1800
|
+
const data = fs.readFileSync("/proc/diskstats", "utf-8");
|
|
1801
1801
|
let readOps = 0, readBytes = 0, writeOps = 0, writeBytes = 0;
|
|
1802
1802
|
for (const line of data.split("\n")) {
|
|
1803
1803
|
const parts = line.trim().split(/\s+/);
|
|
@@ -1828,7 +1828,7 @@ async function takeDiskIoSnapshot() {
|
|
|
1828
1828
|
async function takeNetworkIoSnapshot() {
|
|
1829
1829
|
const now = Date.now();
|
|
1830
1830
|
if (IS_LINUX) try {
|
|
1831
|
-
const data = fs
|
|
1831
|
+
const data = fs.readFileSync("/proc/net/dev", "utf-8");
|
|
1832
1832
|
let rxBytes = 0, txBytes = 0, rxPackets = 0, txPackets = 0, rxErrors = 0, txErrors = 0;
|
|
1833
1833
|
for (const line of data.split("\n")) {
|
|
1834
1834
|
const match = line.match(/^\s*(\w+):\s+(.+)$/);
|
|
@@ -1889,7 +1889,7 @@ async function takeNetworkIoSnapshot() {
|
|
|
1889
1889
|
}
|
|
1890
1890
|
async function getCpuTemperatureInternal() {
|
|
1891
1891
|
if (IS_LINUX) for (const p of ["/sys/class/thermal/thermal_zone0/temp", "/sys/class/hwmon/hwmon0/temp1_input"]) try {
|
|
1892
|
-
const raw = fs
|
|
1892
|
+
const raw = fs.readFileSync(p, "utf-8").trim();
|
|
1893
1893
|
const millideg = parseInt(raw, 10);
|
|
1894
1894
|
if (!isNaN(millideg)) return Math.round(millideg / 100) / 10;
|
|
1895
1895
|
} catch {
|
|
@@ -1940,10 +1940,10 @@ function getProcessResources() {
|
|
|
1940
1940
|
let threadCount = 0;
|
|
1941
1941
|
if (IS_LINUX) {
|
|
1942
1942
|
try {
|
|
1943
|
-
openFds = fs
|
|
1943
|
+
openFds = fs.readdirSync(`/proc/${process.pid}/fd`).length;
|
|
1944
1944
|
} catch {}
|
|
1945
1945
|
try {
|
|
1946
|
-
const match = fs
|
|
1946
|
+
const match = fs.readFileSync(`/proc/${process.pid}/status`, "utf-8").match(/Threads:\s+(\d+)/);
|
|
1947
1947
|
if (match) threadCount = parseInt(match[1], 10);
|
|
1948
1948
|
} catch {}
|
|
1949
1949
|
}
|
|
@@ -1958,7 +1958,7 @@ function getProcessResources() {
|
|
|
1958
1958
|
function getPressure(resource) {
|
|
1959
1959
|
if (!IS_LINUX) return null;
|
|
1960
1960
|
try {
|
|
1961
|
-
const data = fs
|
|
1961
|
+
const data = fs.readFileSync(`/proc/pressure/${resource}`, "utf-8");
|
|
1962
1962
|
const parseLine = (prefix) => {
|
|
1963
1963
|
const match = data.match(new RegExp(`${prefix} avg10=(\\d+\\.\\d+) avg60=(\\d+\\.\\d+) avg300=(\\d+\\.\\d+)`));
|
|
1964
1964
|
if (!match) return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
2
|
import { Jl as EventCategory, Kl as errMsg, Ks as BaseAddon, Sa as platformProbeCapability, Vr as enumerateInferenceDevices, Xc as emitReadiness, go as scoreRuntimes, ha as parseAcceleratorFactsJson } from "../../dist-BDoMdUU3.mjs";
|
|
3
|
-
import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-
|
|
4
|
-
import * as fs
|
|
3
|
+
import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-BW3OcrLD.mjs";
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
7
|
import * as os$1 from "node:os";
|
|
@@ -492,14 +492,14 @@ var PlatformScorer = class {
|
|
|
492
492
|
if (nvidia) gpu = nvidia;
|
|
493
493
|
const listRenderNodes = () => {
|
|
494
494
|
try {
|
|
495
|
-
return fs
|
|
495
|
+
return fs.readdirSync("/dev/dri").filter((n) => n.startsWith("renderD")).map((n) => `/dev/dri/${n}`);
|
|
496
496
|
} catch {
|
|
497
497
|
return [];
|
|
498
498
|
}
|
|
499
499
|
};
|
|
500
500
|
const readDrmAttr = (node, attr) => {
|
|
501
501
|
try {
|
|
502
|
-
return fs
|
|
502
|
+
return fs.readFileSync(`/sys/class/drm/${node.split("/").pop()}/device/${attr}`, "utf8");
|
|
503
503
|
} catch {
|
|
504
504
|
return "";
|
|
505
505
|
}
|
|
@@ -525,12 +525,12 @@ var PlatformScorer = class {
|
|
|
525
525
|
}
|
|
526
526
|
const listDir = (p) => {
|
|
527
527
|
try {
|
|
528
|
-
return fs
|
|
528
|
+
return fs.readdirSync(p);
|
|
529
529
|
} catch {
|
|
530
530
|
return [];
|
|
531
531
|
}
|
|
532
532
|
};
|
|
533
|
-
const exists = (p) => fs
|
|
533
|
+
const exists = (p) => fs.existsSync(p);
|
|
534
534
|
if (!npu) {
|
|
535
535
|
const { classifyIntelNpu } = await import("../../intel-npu-C8HKvRQF.mjs");
|
|
536
536
|
npu = classifyIntelNpu({
|
|
@@ -558,7 +558,7 @@ var PlatformScorer = class {
|
|
|
558
558
|
exists,
|
|
559
559
|
readFile: (p) => {
|
|
560
560
|
try {
|
|
561
|
-
return fs
|
|
561
|
+
return fs.readFileSync(p, "utf8");
|
|
562
562
|
} catch {
|
|
563
563
|
return "";
|
|
564
564
|
}
|
|
@@ -844,7 +844,7 @@ function jsonValue(text) {
|
|
|
844
844
|
function readPublishedAcceleratorFacts(filePath) {
|
|
845
845
|
let text;
|
|
846
846
|
try {
|
|
847
|
-
text = fs
|
|
847
|
+
text = fs.readFileSync(filePath, "utf8");
|
|
848
848
|
} catch {
|
|
849
849
|
return null;
|
|
850
850
|
}
|
|
@@ -859,7 +859,7 @@ function findAcceleratorFactsScript(dataDir, cwd = process.cwd()) {
|
|
|
859
859
|
const candidates = [];
|
|
860
860
|
if (typeof dataDir === "string" && dataDir !== "") candidates.push(path$1.join(dataDir, "addons", "@camstack", "addon-pipeline", "python", "accelerator_facts.py"));
|
|
861
861
|
candidates.push(path$1.join(cwd, "packages", "addon-pipeline", "python", "accelerator_facts.py"));
|
|
862
|
-
for (const candidate of candidates) if (fs
|
|
862
|
+
for (const candidate of candidates) if (fs.existsSync(candidate)) return candidate;
|
|
863
863
|
return null;
|
|
864
864
|
}
|
|
865
865
|
async function defaultExec(command, args, timeoutMs) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ks as BaseAddon, Po as storageProviderCapability, ri as filesystemBrowseCapability } from "../../dist-BDoMdUU3.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
import * as fs
|
|
3
|
+
import * as fs from "node:fs";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
5
5
|
import { basename, dirname, isAbsolute, join, resolve, sep } from "node:path";
|
|
6
6
|
import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
|
|
@@ -169,16 +169,16 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
169
169
|
error: "config.basePath must be a non-empty string"
|
|
170
170
|
};
|
|
171
171
|
try {
|
|
172
|
-
const stat = await fs
|
|
172
|
+
const stat = await fs.promises.stat(basePath).catch(() => null);
|
|
173
173
|
if (stat) {
|
|
174
174
|
if (!stat.isDirectory()) return {
|
|
175
175
|
ok: false,
|
|
176
176
|
error: `Path "${basePath}" exists but is not a directory`
|
|
177
177
|
};
|
|
178
|
-
await fs
|
|
178
|
+
await fs.promises.access(basePath, fs.constants.W_OK);
|
|
179
179
|
return { ok: true };
|
|
180
180
|
}
|
|
181
|
-
await fs
|
|
181
|
+
await fs.promises.mkdir(basePath, { recursive: true });
|
|
182
182
|
return { ok: true };
|
|
183
183
|
} catch (err) {
|
|
184
184
|
return {
|
|
@@ -192,12 +192,12 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
192
192
|
}
|
|
193
193
|
async write({ location, relativePath, data }) {
|
|
194
194
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
195
|
-
await fs
|
|
196
|
-
await fs
|
|
195
|
+
await fs.promises.mkdir(path$1.dirname(filePath), { recursive: true });
|
|
196
|
+
await fs.promises.writeFile(filePath, data);
|
|
197
197
|
}
|
|
198
198
|
async read({ location, relativePath }) {
|
|
199
199
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
200
|
-
const buf = await fs
|
|
200
|
+
const buf = await fs.promises.readFile(filePath);
|
|
201
201
|
const out = new Uint8Array(new ArrayBuffer(buf.byteLength));
|
|
202
202
|
out.set(buf);
|
|
203
203
|
return out;
|
|
@@ -205,7 +205,7 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
205
205
|
async exists({ location, relativePath }) {
|
|
206
206
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
207
207
|
try {
|
|
208
|
-
await fs
|
|
208
|
+
await fs.promises.access(filePath);
|
|
209
209
|
return true;
|
|
210
210
|
} catch {
|
|
211
211
|
return false;
|
|
@@ -215,25 +215,25 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
215
215
|
const base = getBasePath(location);
|
|
216
216
|
const dir = prefix ? safeResolve(base, prefix) : path$1.resolve(base);
|
|
217
217
|
try {
|
|
218
|
-
return (await fs
|
|
218
|
+
return (await fs.promises.readdir(dir, { withFileTypes: true })).map((e) => prefix ? `${prefix}/${e.name}` : e.name);
|
|
219
219
|
} catch {
|
|
220
220
|
return [];
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
async delete({ location, relativePath }) {
|
|
224
224
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
225
|
-
await fs
|
|
225
|
+
await fs.promises.rm(filePath, { force: true });
|
|
226
226
|
}
|
|
227
227
|
async getAvailableSpace({ location }) {
|
|
228
228
|
const base = path$1.resolve(getBasePath(location));
|
|
229
229
|
try {
|
|
230
230
|
let target = base;
|
|
231
|
-
while (!fs
|
|
231
|
+
while (!fs.existsSync(target)) {
|
|
232
232
|
const parent = path$1.dirname(target);
|
|
233
233
|
if (!parent || parent === target) return null;
|
|
234
234
|
target = parent;
|
|
235
235
|
}
|
|
236
|
-
const stats = await fs
|
|
236
|
+
const stats = await fs.promises.statfs(target);
|
|
237
237
|
return stats.bavail * stats.bsize;
|
|
238
238
|
} catch {
|
|
239
239
|
return null;
|
|
@@ -242,9 +242,9 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
242
242
|
async beginUpload({ location, relativePath }) {
|
|
243
243
|
const target = safeResolve(getBasePath(location), relativePath);
|
|
244
244
|
const partial = `${target}.partial`;
|
|
245
|
-
await fs
|
|
246
|
-
await fs
|
|
247
|
-
const stream = fs
|
|
245
|
+
await fs.promises.mkdir(path$1.dirname(target), { recursive: true });
|
|
246
|
+
await fs.promises.unlink(partial).catch(() => {});
|
|
247
|
+
const stream = fs.createWriteStream(partial);
|
|
248
248
|
const uploadId = randomUUID();
|
|
249
249
|
const session = {
|
|
250
250
|
stream,
|
|
@@ -285,7 +285,7 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
285
285
|
session.stream.end(() => resolve());
|
|
286
286
|
session.stream.on("error", reject);
|
|
287
287
|
});
|
|
288
|
-
await fs
|
|
288
|
+
await fs.promises.rename(session.partial, session.target);
|
|
289
289
|
clearTimeout(session.timer);
|
|
290
290
|
this.uploads.delete(uploadId);
|
|
291
291
|
}
|
|
@@ -295,14 +295,14 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
295
295
|
try {
|
|
296
296
|
session.stream.destroy();
|
|
297
297
|
} catch {}
|
|
298
|
-
await fs
|
|
298
|
+
await fs.promises.unlink(session.partial).catch(() => {});
|
|
299
299
|
clearTimeout(session.timer);
|
|
300
300
|
this.uploads.delete(uploadId);
|
|
301
301
|
}
|
|
302
302
|
async beginDownload({ location, relativePath }) {
|
|
303
303
|
const target = safeResolve(getBasePath(location), relativePath);
|
|
304
|
-
const stat = await fs
|
|
305
|
-
const fd = await fs
|
|
304
|
+
const stat = await fs.promises.stat(target);
|
|
305
|
+
const fd = await fs.promises.open(target, "r");
|
|
306
306
|
const downloadId = randomUUID();
|
|
307
307
|
const session = {
|
|
308
308
|
fd,
|