@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.
- package/dist/addon-runner.js +97 -31
- package/dist/addon-runner.mjs +97 -31
- package/dist/addon-utils.mjs +1 -1
- package/dist/{agent-https-b-zX78oB.mjs → agent-https-DHBvFZJS.mjs} +1 -1
- package/dist/{agent-https-5OgOR-eF.js → agent-https-bH6bKDeK.js} +1 -1
- package/dist/auth/user-manager.d.ts +2 -2
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-history/device-history.addon.js +1 -1
- package/dist/builtins/device-history/device-history.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
- package/dist/builtins/platform-probe/accelerator-reprobe.d.ts +23 -0
- package/dist/builtins/platform-probe/coral-accelerators.d.ts +50 -11
- package/dist/builtins/platform-probe/index.d.ts +17 -1
- package/dist/builtins/platform-probe/index.js +196 -12
- package/dist/builtins/platform-probe/index.mjs +202 -19
- package/dist/builtins/platform-probe/platform-scorer.d.ts +14 -0
- package/dist/builtins/record-entries/index.js +1 -1
- package/dist/builtins/record-entries/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +3 -3
- package/dist/builtins/system-config/system-config.addon.mjs +115 -115
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-BGXTiUZm.js → composition-sources-B5uJZXZ1.js} +1 -1
- package/dist/{composition-sources-DTdzzyf0.mjs → composition-sources-DRw_vBKH.mjs} +1 -1
- package/dist/{constants-md_POijo.mjs → constants-5lA8Z9d8.mjs} +1 -1
- package/dist/{constants-2mPqJjkR.js → constants-CToE4OFp.js} +1 -1
- package/dist/{coral-accelerators-oUXmmbc2.js → coral-accelerators-BSVsBVzt.js} +102 -30
- package/dist/coral-accelerators-BW3OcrLD.mjs +231 -0
- package/dist/{custom-action-registry-DZSCLBuT.mjs → custom-action-registry-BGYDjTqY.mjs} +37 -37
- package/dist/{device-ca-CFdyrqeJ.mjs → device-ca-URrs1lxK.mjs} +1 -1
- package/dist/{device-ca-CC58lmNV.js → device-ca-nOCYVFS4.js} +1 -1
- package/dist/{dist-CtVVtyTX.mjs → dist-5XUG7iYJ.mjs} +6839 -1416
- package/dist/{dist-DuBtzSCh.js → dist-BjcWEfRy.js} +6839 -1416
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-BLsX_2cL.js → hub-mdns-ciao-vEWhJ_SD.js} +2 -2
- package/dist/{hub-mdns-ciao-CmuWLPci.mjs → hub-mdns-ciao-zD3JojB_.mjs} +2 -2
- package/dist/index.js +8 -8
- package/dist/index.mjs +225 -225
- package/dist/{restore-archive-CxPAuaNs.js → restore-archive-B64m2nAj.js} +1 -1
- package/dist/{restore-archive-D2w3z_ob.mjs → restore-archive-CN1pJTRn.mjs} +94 -94
- package/dist/{wal-maintenance-EK28XXnc.js → wal-maintenance-BNXVX-ot.js} +0 -0
- package/dist/{wal-maintenance-DeluFl_1.mjs → wal-maintenance-Bl2I-ZcR.mjs} +0 -0
- package/package.json +1 -1
- package/dist/coral-accelerators-Qhn5TOYZ.mjs +0 -165
|
@@ -3,7 +3,7 @@ import * as path$1 from "node:path";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
import { HF_REPO, MODEL_FORMATS, describeCustomActions, hfModelUrl } from "@camstack/types/addon";
|
|
6
|
-
import * as fs
|
|
6
|
+
import * as fs from "node:fs";
|
|
7
7
|
import { createReadStream, promises } from "node:fs";
|
|
8
8
|
import { createServer } from "node:http";
|
|
9
9
|
import { brotliCompress, constants as constants$1, gzip } from "node:zlib";
|
|
@@ -159,7 +159,7 @@ var HOSTED_MODEL_REVISIONS = {
|
|
|
159
159
|
//#endregion
|
|
160
160
|
//#region src/download/model-downloader.ts
|
|
161
161
|
function isNonEmptyFile(filePath) {
|
|
162
|
-
return fs
|
|
162
|
+
return fs.existsSync(filePath) && fs.statSync(filePath).size > 0;
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Sibling files of a single-file (non-directory) format — extra files the
|
|
@@ -236,11 +236,11 @@ function resolveRedirectUrl(current, location) {
|
|
|
236
236
|
return new URL(location, current);
|
|
237
237
|
}
|
|
238
238
|
async function downloadFile(url, destPath, onProgressOrOptions) {
|
|
239
|
-
if (fs
|
|
239
|
+
if (fs.existsSync(destPath)) return destPath;
|
|
240
240
|
const opts = normalizeDownloadOptions(onProgressOrOptions);
|
|
241
241
|
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
242
242
|
const maxRedirects = opts.maxRedirects ?? DEFAULT_MAX_REDIRECTS;
|
|
243
|
-
fs
|
|
243
|
+
fs.mkdirSync(path$1.dirname(destPath), { recursive: true });
|
|
244
244
|
const tmpPath = destPath + ".downloading";
|
|
245
245
|
try {
|
|
246
246
|
let current = url;
|
|
@@ -278,7 +278,7 @@ async function downloadFile(url, destPath, onProgressOrOptions) {
|
|
|
278
278
|
if (!response.body) throw new Error(`No response body from ${url}`);
|
|
279
279
|
const total = parseInt(response.headers.get("content-length") ?? "0", 10);
|
|
280
280
|
let downloaded = 0;
|
|
281
|
-
const fileStream = fs
|
|
281
|
+
const fileStream = fs.createWriteStream(tmpPath);
|
|
282
282
|
const reader = response.body.getReader();
|
|
283
283
|
try {
|
|
284
284
|
for (;;) {
|
|
@@ -296,11 +296,11 @@ async function downloadFile(url, destPath, onProgressOrOptions) {
|
|
|
296
296
|
fileStream.on("error", reject);
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
fs
|
|
299
|
+
fs.renameSync(tmpPath, destPath);
|
|
300
300
|
return destPath;
|
|
301
301
|
} catch (err) {
|
|
302
302
|
try {
|
|
303
|
-
fs
|
|
303
|
+
fs.unlinkSync(tmpPath);
|
|
304
304
|
} catch {}
|
|
305
305
|
throw err;
|
|
306
306
|
}
|
|
@@ -324,12 +324,12 @@ async function downloadModel(options) {
|
|
|
324
324
|
const { url, fallbackUrls = [], destDir, filename, expectedSha256, onProgress } = options;
|
|
325
325
|
const fname = filename ?? url.split("/").pop() ?? "model.bin";
|
|
326
326
|
const destPath = path$1.join(destDir, fname);
|
|
327
|
-
if (fs
|
|
327
|
+
if (fs.existsSync(destPath)) return {
|
|
328
328
|
filePath: destPath,
|
|
329
329
|
downloadedBytes: 0,
|
|
330
330
|
fromCache: true
|
|
331
331
|
};
|
|
332
|
-
fs
|
|
332
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
333
333
|
const urls = [url, ...fallbackUrls];
|
|
334
334
|
let lastError = null;
|
|
335
335
|
for (const tryUrl of urls) try {
|
|
@@ -337,25 +337,25 @@ async function downloadModel(options) {
|
|
|
337
337
|
if (expectedSha256) {
|
|
338
338
|
const hash = await computeSha256(destPath);
|
|
339
339
|
if (hash !== expectedSha256) {
|
|
340
|
-
fs
|
|
340
|
+
fs.unlinkSync(destPath);
|
|
341
341
|
throw new Error(`SHA256 mismatch: expected ${expectedSha256}, got ${hash}`);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
return {
|
|
345
345
|
filePath: destPath,
|
|
346
|
-
downloadedBytes: fs
|
|
346
|
+
downloadedBytes: fs.statSync(destPath).size,
|
|
347
347
|
fromCache: false
|
|
348
348
|
};
|
|
349
349
|
} catch (e) {
|
|
350
350
|
lastError = e;
|
|
351
|
-
if (fs
|
|
351
|
+
if (fs.existsSync(destPath)) fs.unlinkSync(destPath);
|
|
352
352
|
}
|
|
353
353
|
throw lastError ?? /* @__PURE__ */ new Error(`Failed to download model from ${url}`);
|
|
354
354
|
}
|
|
355
355
|
async function computeSha256(filePath) {
|
|
356
356
|
return new Promise((resolve, reject) => {
|
|
357
357
|
const hash = createHash("sha256");
|
|
358
|
-
const stream = fs
|
|
358
|
+
const stream = fs.createReadStream(filePath);
|
|
359
359
|
stream.on("data", (chunk) => hash.update(chunk));
|
|
360
360
|
stream.on("end", () => resolve(hash.digest("hex")));
|
|
361
361
|
stream.on("error", reject);
|
|
@@ -380,28 +380,28 @@ async function downloadDirectory(url, destDir, knownFiles, onProgress) {
|
|
|
380
380
|
fileUrl: `https://huggingface.co/${repo}/resolve/main/${dirPath}/${f}`
|
|
381
381
|
}));
|
|
382
382
|
const tmpDir = destDir + ".downloading";
|
|
383
|
-
fs
|
|
383
|
+
fs.rmSync(tmpDir, {
|
|
384
384
|
recursive: true,
|
|
385
385
|
force: true
|
|
386
386
|
});
|
|
387
|
-
fs
|
|
387
|
+
fs.mkdirSync(tmpDir, { recursive: true });
|
|
388
388
|
let totalDownloaded = 0;
|
|
389
389
|
try {
|
|
390
390
|
for (const file of files) {
|
|
391
391
|
const destPath = path$1.join(tmpDir, file.relativePath);
|
|
392
|
-
fs
|
|
392
|
+
fs.mkdirSync(path$1.dirname(destPath), { recursive: true });
|
|
393
393
|
await downloadFile(file.fileUrl, destPath, (downloaded, _total) => {
|
|
394
394
|
onProgress?.(totalDownloaded + downloaded, void 0);
|
|
395
395
|
});
|
|
396
|
-
totalDownloaded += fs
|
|
396
|
+
totalDownloaded += fs.statSync(destPath).size;
|
|
397
397
|
}
|
|
398
|
-
fs
|
|
398
|
+
fs.rmSync(destDir, {
|
|
399
399
|
recursive: true,
|
|
400
400
|
force: true
|
|
401
401
|
});
|
|
402
|
-
fs
|
|
402
|
+
fs.renameSync(tmpDir, destDir);
|
|
403
403
|
} catch (err) {
|
|
404
|
-
fs
|
|
404
|
+
fs.rmSync(tmpDir, {
|
|
405
405
|
recursive: true,
|
|
406
406
|
force: true
|
|
407
407
|
});
|
|
@@ -433,7 +433,7 @@ function revisionRecordPath(modelPath) {
|
|
|
433
433
|
}
|
|
434
434
|
function readRevisionRecord(modelPath) {
|
|
435
435
|
try {
|
|
436
|
-
return fs
|
|
436
|
+
return fs.readFileSync(revisionRecordPath(modelPath), "utf8").trim();
|
|
437
437
|
} catch {
|
|
438
438
|
return null;
|
|
439
439
|
}
|
|
@@ -497,8 +497,8 @@ function writeRevisionRecord(modelPath, revision) {
|
|
|
497
497
|
if (revision === void 0) return;
|
|
498
498
|
const record = revisionRecordPath(modelPath);
|
|
499
499
|
const tmp = `${record}.tmp`;
|
|
500
|
-
fs
|
|
501
|
-
fs
|
|
500
|
+
fs.writeFileSync(tmp, `${revision}\n`);
|
|
501
|
+
fs.renameSync(tmp, record);
|
|
502
502
|
}
|
|
503
503
|
/**
|
|
504
504
|
* Prove an unrecorded (or differently recorded) copy current by hashing its
|
|
@@ -518,9 +518,9 @@ async function adoptByHash(modelsDir, modelPath, formatEntry) {
|
|
|
518
518
|
}
|
|
519
519
|
/** True when every file of the format is on disk, whatever revision it holds. */
|
|
520
520
|
function isCompleteCopy(modelsDir, modelPath, formatEntry) {
|
|
521
|
-
if (!fs
|
|
522
|
-
if (formatEntry.isDirectory) return fs
|
|
523
|
-
if (fs
|
|
521
|
+
if (!fs.existsSync(modelPath)) return false;
|
|
522
|
+
if (formatEntry.isDirectory) return fs.existsSync(path$1.join(modelPath, "Manifest.json"));
|
|
523
|
+
if (fs.statSync(modelPath).size <= 0) return false;
|
|
524
524
|
return siblingFilesFor(formatEntry).every((f) => isNonEmptyFile(path$1.join(modelsDir, f)));
|
|
525
525
|
}
|
|
526
526
|
/**
|
|
@@ -542,14 +542,14 @@ async function replaceSingleFileFormat(url, modelPath, modelsDir, siblings, onPr
|
|
|
542
542
|
}));
|
|
543
543
|
try {
|
|
544
544
|
for (const [i, part] of parts.entries()) {
|
|
545
|
-
fs
|
|
545
|
+
fs.rmSync(part.staged, { force: true });
|
|
546
546
|
await downloadFile(part.url, part.staged, i === 0 ? (downloaded, total) => onProgress?.(downloaded, total === 0 ? void 0 : total) : void 0);
|
|
547
547
|
}
|
|
548
548
|
} catch (err) {
|
|
549
|
-
for (const part of parts) fs
|
|
549
|
+
for (const part of parts) fs.rmSync(part.staged, { force: true });
|
|
550
550
|
throw err;
|
|
551
551
|
}
|
|
552
|
-
for (const part of parts) fs
|
|
552
|
+
for (const part of parts) fs.renameSync(part.staged, part.dest);
|
|
553
553
|
}
|
|
554
554
|
/**
|
|
555
555
|
* Resolve a `ModelCatalogEntry` against `modelsDir`: download model file
|
|
@@ -564,14 +564,14 @@ async function ensureModel(modelsDir, entry, format, onProgress) {
|
|
|
564
564
|
const modelPath = path$1.join(modelsDir, filename);
|
|
565
565
|
const siblings = siblingFilesFor(formatEntry);
|
|
566
566
|
let outdated = false;
|
|
567
|
-
if (fs
|
|
567
|
+
if (fs.existsSync(modelPath)) if (formatEntry.isDirectory && !fs.existsSync(path$1.join(modelPath, "Manifest.json"))) fs.rmSync(modelPath, {
|
|
568
568
|
recursive: true,
|
|
569
569
|
force: true
|
|
570
570
|
});
|
|
571
571
|
else if (siblings.some((f) => !isNonEmptyFile(path$1.join(modelsDir, f)))) outdated = !isCurrentRevision(modelPath, formatEntry) && !await adoptByHash(modelsDir, modelPath, formatEntry);
|
|
572
572
|
else if (isCurrentRevision(modelPath, formatEntry) || await adoptByHash(modelsDir, modelPath, formatEntry)) return modelPath;
|
|
573
573
|
else outdated = true;
|
|
574
|
-
fs
|
|
574
|
+
fs.mkdirSync(modelsDir, { recursive: true });
|
|
575
575
|
if (formatEntry.isDirectory) await downloadDirectory(formatEntry.url, modelPath, formatEntry.files, onProgress);
|
|
576
576
|
else if (outdated) await replaceSingleFileFormat(formatEntry.url, modelPath, modelsDir, siblings, onProgress);
|
|
577
577
|
else {
|
|
@@ -629,25 +629,25 @@ function isModelDownloaded(modelsDir, entry, format) {
|
|
|
629
629
|
const formatEntry = entry.formats[format];
|
|
630
630
|
if (!formatEntry) return false;
|
|
631
631
|
const modelPath = getModelFilePath(modelsDir, entry, format);
|
|
632
|
-
if (!modelPath || !fs
|
|
632
|
+
if (!modelPath || !fs.existsSync(modelPath)) return false;
|
|
633
633
|
if (!isCurrentRevision(modelPath, formatEntry)) return false;
|
|
634
634
|
return isCompleteCopy(modelsDir, modelPath, formatEntry);
|
|
635
635
|
}
|
|
636
636
|
/** Remove the on-disk model file/directory. Returns true if something was deleted. */
|
|
637
637
|
function deleteModelFromDisk(modelsDir, entry, format) {
|
|
638
638
|
const modelPath = getModelFilePath(modelsDir, entry, format);
|
|
639
|
-
if (!modelPath || !fs
|
|
640
|
-
fs
|
|
639
|
+
if (!modelPath || !fs.existsSync(modelPath)) return false;
|
|
640
|
+
fs.rmSync(revisionRecordPath(modelPath), { force: true });
|
|
641
641
|
const formatEntry = entry.formats[format];
|
|
642
|
-
if (formatEntry?.isDirectory) fs
|
|
642
|
+
if (formatEntry?.isDirectory) fs.rmSync(modelPath, {
|
|
643
643
|
recursive: true,
|
|
644
644
|
force: true
|
|
645
645
|
});
|
|
646
646
|
else {
|
|
647
|
-
fs
|
|
647
|
+
fs.unlinkSync(modelPath);
|
|
648
648
|
if (formatEntry) for (const sibling of siblingFilesFor(formatEntry)) {
|
|
649
649
|
const sibPath = path$1.join(modelsDir, sibling);
|
|
650
|
-
if (fs
|
|
650
|
+
if (fs.existsSync(sibPath)) fs.unlinkSync(sibPath);
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
return true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as DEVICE_SAN_USER_PREFIX, Ri as buildSecretRef, k as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-
|
|
1
|
+
import { A as DEVICE_SAN_USER_PREFIX, Ri as buildSecretRef, k as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-5XUG7iYJ.mjs";
|
|
2
2
|
import { S as backdatedNotBefore, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-DK__ETIe.mjs";
|
|
3
3
|
import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
|
|
4
4
|
//#region src/auth/jwt-signing-key.ts
|