@camstack/system 1.2.459 → 1.2.461
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 +26 -11
- package/dist/addon-runner.mjs +26 -11
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +3 -3
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +4 -4
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +4 -4
- package/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
- package/dist/builtins/native-metrics/native-metrics.addon.js +38 -3
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +47 -12
- package/dist/builtins/native-metrics/node-metrics-history-recorder.d.ts +15 -0
- package/dist/builtins/platform-probe/coral-accelerators.d.ts +10 -1
- package/dist/builtins/platform-probe/index.js +6 -3
- package/dist/builtins/platform-probe/index.mjs +12 -9
- package/dist/builtins/platform-probe/platform-scorer.d.ts +4 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +19 -19
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/records/records-plan.d.ts +9 -4
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +112 -112
- package/dist/{coral-accelerators-DcnZvctM.mjs → coral-accelerators-Qhn5TOYZ.mjs} +18 -15
- package/dist/{coral-accelerators-Bi_c3Rft.js → coral-accelerators-oUXmmbc2.js} +13 -10
- package/dist/{custom-action-registry-stpC3Zy-.mjs → custom-action-registry-DZSCLBuT.mjs} +39 -37
- package/dist/{custom-action-registry-COyb49zm.js → custom-action-registry-MRyes5j0.js} +2 -0
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +31 -3
- package/dist/index.mjs +248 -221
- package/dist/kernel/deps/addon-deps-manager.d.ts +9 -0
- package/dist/{restore-archive-CmP-iiG9.mjs → restore-archive-CM23Pq9B.mjs} +93 -93
- package/dist/{wal-maintenance-NKbwWovZ.mjs → wal-maintenance-Bj_MmDkr.mjs} +0 -0
- package/dist/{wal-maintenance-DUHEp_09.js → wal-maintenance-CaJjuLHq.js} +0 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { EDGETPU_LIB_ENV, chooseEdgetpuDelegate, nodeDataRootFromEnv } from "@camstack/types/node";
|
|
2
|
+
import fs from "node:fs";
|
|
2
3
|
//#region src/builtins/platform-probe/coral-accelerators.ts
|
|
3
4
|
/**
|
|
4
5
|
* Coral USB Edge TPU USB identifiers.
|
|
@@ -19,13 +20,13 @@ var CORAL_PCI_VENDOR = "0x1ac1";
|
|
|
19
20
|
var CORAL_PCI_DEVICE = "0x089a";
|
|
20
21
|
/** A unit the apex driver bound: `/sys/class/apex/apex_<N>` ↔ `/dev/apex_<N>`. */
|
|
21
22
|
var APEX_ENTRY = /^apex_(\d+)$/;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
function currentDelegateHost() {
|
|
24
|
+
return {
|
|
25
|
+
platform: process.platform,
|
|
26
|
+
dataDir: nodeDataRootFromEnv(process.env),
|
|
27
|
+
override: process.env[EDGETPU_LIB_ENV]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
29
30
|
function countUsbCorals(fsx) {
|
|
30
31
|
let count = 0;
|
|
31
32
|
for (const device of fsx.listUsbDevices()) {
|
|
@@ -80,7 +81,7 @@ function classifyPci(fsx) {
|
|
|
80
81
|
* Returns `null` only when no Coral was found at all; a present-but-unusable
|
|
81
82
|
* Coral is reported with its typed reason, never as absent (D393/D315).
|
|
82
83
|
*/
|
|
83
|
-
function classifyCoralAccelerator(fsx) {
|
|
84
|
+
function classifyCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
|
|
84
85
|
const usb = countUsbCorals(fsx);
|
|
85
86
|
const pci = classifyPci(fsx);
|
|
86
87
|
const units = [];
|
|
@@ -111,8 +112,10 @@ function classifyCoralAccelerator(fsx) {
|
|
|
111
112
|
type: "coral-edgetpu",
|
|
112
113
|
units
|
|
113
114
|
};
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
if (chooseEdgetpuDelegate({
|
|
116
|
+
...delegateHost,
|
|
117
|
+
exists: (p) => fsx.exists(p)
|
|
118
|
+
}) !== null) return {
|
|
116
119
|
type: "coral-edgetpu",
|
|
117
120
|
units: [{
|
|
118
121
|
bus: "usb",
|
|
@@ -123,14 +126,14 @@ function classifyCoralAccelerator(fsx) {
|
|
|
123
126
|
}
|
|
124
127
|
function safeList(dir) {
|
|
125
128
|
try {
|
|
126
|
-
return
|
|
129
|
+
return fs.readdirSync(dir);
|
|
127
130
|
} catch {
|
|
128
131
|
return [];
|
|
129
132
|
}
|
|
130
133
|
}
|
|
131
134
|
function safeRead(path) {
|
|
132
135
|
try {
|
|
133
|
-
return
|
|
136
|
+
return fs.readFileSync(path, "utf8").trim();
|
|
134
137
|
} catch {
|
|
135
138
|
return "";
|
|
136
139
|
}
|
|
@@ -144,7 +147,7 @@ var nodeCoralFs = {
|
|
|
144
147
|
listApexClass: () => safeList("/sys/class/apex"),
|
|
145
148
|
canOpen: (path) => {
|
|
146
149
|
try {
|
|
147
|
-
|
|
150
|
+
fs.accessSync(path, fs.constants.R_OK | fs.constants.W_OK);
|
|
148
151
|
return true;
|
|
149
152
|
} catch {
|
|
150
153
|
return false;
|
|
@@ -152,7 +155,7 @@ var nodeCoralFs = {
|
|
|
152
155
|
},
|
|
153
156
|
exists: (path) => {
|
|
154
157
|
try {
|
|
155
|
-
return
|
|
158
|
+
return fs.existsSync(path);
|
|
156
159
|
} catch {
|
|
157
160
|
return false;
|
|
158
161
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
+
let _camstack_types_node = require("@camstack/types/node");
|
|
2
3
|
let node_fs = require("node:fs");
|
|
3
4
|
node_fs = require_chunk.__toESM(node_fs);
|
|
4
5
|
//#region src/builtins/platform-probe/coral-accelerators.ts
|
|
@@ -21,13 +22,13 @@ var CORAL_PCI_VENDOR = "0x1ac1";
|
|
|
21
22
|
var CORAL_PCI_DEVICE = "0x089a";
|
|
22
23
|
/** A unit the apex driver bound: `/sys/class/apex/apex_<N>` ↔ `/dev/apex_<N>`. */
|
|
23
24
|
var APEX_ENTRY = /^apex_(\d+)$/;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
function currentDelegateHost() {
|
|
26
|
+
return {
|
|
27
|
+
platform: process.platform,
|
|
28
|
+
dataDir: (0, _camstack_types_node.nodeDataRootFromEnv)(process.env),
|
|
29
|
+
override: process.env[_camstack_types_node.EDGETPU_LIB_ENV]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
31
32
|
function countUsbCorals(fsx) {
|
|
32
33
|
let count = 0;
|
|
33
34
|
for (const device of fsx.listUsbDevices()) {
|
|
@@ -82,7 +83,7 @@ function classifyPci(fsx) {
|
|
|
82
83
|
* Returns `null` only when no Coral was found at all; a present-but-unusable
|
|
83
84
|
* Coral is reported with its typed reason, never as absent (D393/D315).
|
|
84
85
|
*/
|
|
85
|
-
function classifyCoralAccelerator(fsx) {
|
|
86
|
+
function classifyCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
|
|
86
87
|
const usb = countUsbCorals(fsx);
|
|
87
88
|
const pci = classifyPci(fsx);
|
|
88
89
|
const units = [];
|
|
@@ -113,8 +114,10 @@ function classifyCoralAccelerator(fsx) {
|
|
|
113
114
|
type: "coral-edgetpu",
|
|
114
115
|
units
|
|
115
116
|
};
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
if ((0, _camstack_types_node.chooseEdgetpuDelegate)({
|
|
118
|
+
...delegateHost,
|
|
119
|
+
exists: (p) => fsx.exists(p)
|
|
120
|
+
}) !== null) return {
|
|
118
121
|
type: "coral-edgetpu",
|
|
119
122
|
units: [{
|
|
120
123
|
bus: "usb",
|
|
@@ -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 from "node:fs";
|
|
6
|
+
import * as fs$1 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";
|
|
@@ -128,6 +128,8 @@ var HOSTED_MODEL_REVISIONS = {
|
|
|
128
128
|
"objectDetection/yolov9/openvino/camstack-yolov9t-320-int8.xml": "ee465e0ee5c6ad7c4edc481b506a076045b82236ada80efcf8601a6ba0a7ee86",
|
|
129
129
|
"objectDetection/yolov9/openvino/camstack-yolov9t-640-fp16.xml": "d4dd2278941ccb210d0763d822353f6d951c6a4f4f5a1604d7e3536ce6ffb954",
|
|
130
130
|
"objectDetection/yolov9/openvino/camstack-yolov9t-640-int8.xml": "be2c95951a9f3a6d408bbabd551c99b8a6190f9ff659ae614b9e58cf0e51202c",
|
|
131
|
+
"objectDetection/yolov9/tflite/yolov9-s-relu6-best_320_int8_edgetpu.tflite": "49a38e77439b475d0d259a6d9fe7ea32fcaa58de3748499dd120aceebad9c591",
|
|
132
|
+
"objectDetection/yolov9/tflite/yolov9-s-relu6-tpumax_512_int8_edgetpu.tflite": "f634f60259101556825fd69662f96282e74364b507f83e6382cc34d5d0e6170e",
|
|
131
133
|
"packageDetection/rfdetr-package/coreml/camstack-rfdetr-package.mlpackage": "73e42f03d66011a311bd83a0a3d1890e7eb1b9b2ba2b5688552a5d4fd60e0e72",
|
|
132
134
|
"packageDetection/rfdetr-package/onnx/camstack-rfdetr-package.onnx": "5af96c6b5936f179e317c9e3915b7c7f74ea3625355f97f6a071c3cd5af2475c",
|
|
133
135
|
"packageDetection/rfdetr-package/openvino/camstack-rfdetr-package.xml": "e2cb5bbccb7809d5c7e691a957bc5e008084119bdf29e2c95d6b6b0791e3061a",
|
|
@@ -157,7 +159,7 @@ var HOSTED_MODEL_REVISIONS = {
|
|
|
157
159
|
//#endregion
|
|
158
160
|
//#region src/download/model-downloader.ts
|
|
159
161
|
function isNonEmptyFile(filePath) {
|
|
160
|
-
return fs.existsSync(filePath) && fs.statSync(filePath).size > 0;
|
|
162
|
+
return fs$1.existsSync(filePath) && fs$1.statSync(filePath).size > 0;
|
|
161
163
|
}
|
|
162
164
|
/**
|
|
163
165
|
* Sibling files of a single-file (non-directory) format — extra files the
|
|
@@ -234,11 +236,11 @@ function resolveRedirectUrl(current, location) {
|
|
|
234
236
|
return new URL(location, current);
|
|
235
237
|
}
|
|
236
238
|
async function downloadFile(url, destPath, onProgressOrOptions) {
|
|
237
|
-
if (fs.existsSync(destPath)) return destPath;
|
|
239
|
+
if (fs$1.existsSync(destPath)) return destPath;
|
|
238
240
|
const opts = normalizeDownloadOptions(onProgressOrOptions);
|
|
239
241
|
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
240
242
|
const maxRedirects = opts.maxRedirects ?? DEFAULT_MAX_REDIRECTS;
|
|
241
|
-
fs.mkdirSync(path$1.dirname(destPath), { recursive: true });
|
|
243
|
+
fs$1.mkdirSync(path$1.dirname(destPath), { recursive: true });
|
|
242
244
|
const tmpPath = destPath + ".downloading";
|
|
243
245
|
try {
|
|
244
246
|
let current = url;
|
|
@@ -276,7 +278,7 @@ async function downloadFile(url, destPath, onProgressOrOptions) {
|
|
|
276
278
|
if (!response.body) throw new Error(`No response body from ${url}`);
|
|
277
279
|
const total = parseInt(response.headers.get("content-length") ?? "0", 10);
|
|
278
280
|
let downloaded = 0;
|
|
279
|
-
const fileStream = fs.createWriteStream(tmpPath);
|
|
281
|
+
const fileStream = fs$1.createWriteStream(tmpPath);
|
|
280
282
|
const reader = response.body.getReader();
|
|
281
283
|
try {
|
|
282
284
|
for (;;) {
|
|
@@ -294,11 +296,11 @@ async function downloadFile(url, destPath, onProgressOrOptions) {
|
|
|
294
296
|
fileStream.on("error", reject);
|
|
295
297
|
});
|
|
296
298
|
}
|
|
297
|
-
fs.renameSync(tmpPath, destPath);
|
|
299
|
+
fs$1.renameSync(tmpPath, destPath);
|
|
298
300
|
return destPath;
|
|
299
301
|
} catch (err) {
|
|
300
302
|
try {
|
|
301
|
-
fs.unlinkSync(tmpPath);
|
|
303
|
+
fs$1.unlinkSync(tmpPath);
|
|
302
304
|
} catch {}
|
|
303
305
|
throw err;
|
|
304
306
|
}
|
|
@@ -322,12 +324,12 @@ async function downloadModel(options) {
|
|
|
322
324
|
const { url, fallbackUrls = [], destDir, filename, expectedSha256, onProgress } = options;
|
|
323
325
|
const fname = filename ?? url.split("/").pop() ?? "model.bin";
|
|
324
326
|
const destPath = path$1.join(destDir, fname);
|
|
325
|
-
if (fs.existsSync(destPath)) return {
|
|
327
|
+
if (fs$1.existsSync(destPath)) return {
|
|
326
328
|
filePath: destPath,
|
|
327
329
|
downloadedBytes: 0,
|
|
328
330
|
fromCache: true
|
|
329
331
|
};
|
|
330
|
-
fs.mkdirSync(destDir, { recursive: true });
|
|
332
|
+
fs$1.mkdirSync(destDir, { recursive: true });
|
|
331
333
|
const urls = [url, ...fallbackUrls];
|
|
332
334
|
let lastError = null;
|
|
333
335
|
for (const tryUrl of urls) try {
|
|
@@ -335,25 +337,25 @@ async function downloadModel(options) {
|
|
|
335
337
|
if (expectedSha256) {
|
|
336
338
|
const hash = await computeSha256(destPath);
|
|
337
339
|
if (hash !== expectedSha256) {
|
|
338
|
-
fs.unlinkSync(destPath);
|
|
340
|
+
fs$1.unlinkSync(destPath);
|
|
339
341
|
throw new Error(`SHA256 mismatch: expected ${expectedSha256}, got ${hash}`);
|
|
340
342
|
}
|
|
341
343
|
}
|
|
342
344
|
return {
|
|
343
345
|
filePath: destPath,
|
|
344
|
-
downloadedBytes: fs.statSync(destPath).size,
|
|
346
|
+
downloadedBytes: fs$1.statSync(destPath).size,
|
|
345
347
|
fromCache: false
|
|
346
348
|
};
|
|
347
349
|
} catch (e) {
|
|
348
350
|
lastError = e;
|
|
349
|
-
if (fs.existsSync(destPath)) fs.unlinkSync(destPath);
|
|
351
|
+
if (fs$1.existsSync(destPath)) fs$1.unlinkSync(destPath);
|
|
350
352
|
}
|
|
351
353
|
throw lastError ?? /* @__PURE__ */ new Error(`Failed to download model from ${url}`);
|
|
352
354
|
}
|
|
353
355
|
async function computeSha256(filePath) {
|
|
354
356
|
return new Promise((resolve, reject) => {
|
|
355
357
|
const hash = createHash("sha256");
|
|
356
|
-
const stream = fs.createReadStream(filePath);
|
|
358
|
+
const stream = fs$1.createReadStream(filePath);
|
|
357
359
|
stream.on("data", (chunk) => hash.update(chunk));
|
|
358
360
|
stream.on("end", () => resolve(hash.digest("hex")));
|
|
359
361
|
stream.on("error", reject);
|
|
@@ -378,28 +380,28 @@ async function downloadDirectory(url, destDir, knownFiles, onProgress) {
|
|
|
378
380
|
fileUrl: `https://huggingface.co/${repo}/resolve/main/${dirPath}/${f}`
|
|
379
381
|
}));
|
|
380
382
|
const tmpDir = destDir + ".downloading";
|
|
381
|
-
fs.rmSync(tmpDir, {
|
|
383
|
+
fs$1.rmSync(tmpDir, {
|
|
382
384
|
recursive: true,
|
|
383
385
|
force: true
|
|
384
386
|
});
|
|
385
|
-
fs.mkdirSync(tmpDir, { recursive: true });
|
|
387
|
+
fs$1.mkdirSync(tmpDir, { recursive: true });
|
|
386
388
|
let totalDownloaded = 0;
|
|
387
389
|
try {
|
|
388
390
|
for (const file of files) {
|
|
389
391
|
const destPath = path$1.join(tmpDir, file.relativePath);
|
|
390
|
-
fs.mkdirSync(path$1.dirname(destPath), { recursive: true });
|
|
392
|
+
fs$1.mkdirSync(path$1.dirname(destPath), { recursive: true });
|
|
391
393
|
await downloadFile(file.fileUrl, destPath, (downloaded, _total) => {
|
|
392
394
|
onProgress?.(totalDownloaded + downloaded, void 0);
|
|
393
395
|
});
|
|
394
|
-
totalDownloaded += fs.statSync(destPath).size;
|
|
396
|
+
totalDownloaded += fs$1.statSync(destPath).size;
|
|
395
397
|
}
|
|
396
|
-
fs.rmSync(destDir, {
|
|
398
|
+
fs$1.rmSync(destDir, {
|
|
397
399
|
recursive: true,
|
|
398
400
|
force: true
|
|
399
401
|
});
|
|
400
|
-
fs.renameSync(tmpDir, destDir);
|
|
402
|
+
fs$1.renameSync(tmpDir, destDir);
|
|
401
403
|
} catch (err) {
|
|
402
|
-
fs.rmSync(tmpDir, {
|
|
404
|
+
fs$1.rmSync(tmpDir, {
|
|
403
405
|
recursive: true,
|
|
404
406
|
force: true
|
|
405
407
|
});
|
|
@@ -431,7 +433,7 @@ function revisionRecordPath(modelPath) {
|
|
|
431
433
|
}
|
|
432
434
|
function readRevisionRecord(modelPath) {
|
|
433
435
|
try {
|
|
434
|
-
return fs.readFileSync(revisionRecordPath(modelPath), "utf8").trim();
|
|
436
|
+
return fs$1.readFileSync(revisionRecordPath(modelPath), "utf8").trim();
|
|
435
437
|
} catch {
|
|
436
438
|
return null;
|
|
437
439
|
}
|
|
@@ -495,8 +497,8 @@ function writeRevisionRecord(modelPath, revision) {
|
|
|
495
497
|
if (revision === void 0) return;
|
|
496
498
|
const record = revisionRecordPath(modelPath);
|
|
497
499
|
const tmp = `${record}.tmp`;
|
|
498
|
-
fs.writeFileSync(tmp, `${revision}\n`);
|
|
499
|
-
fs.renameSync(tmp, record);
|
|
500
|
+
fs$1.writeFileSync(tmp, `${revision}\n`);
|
|
501
|
+
fs$1.renameSync(tmp, record);
|
|
500
502
|
}
|
|
501
503
|
/**
|
|
502
504
|
* Prove an unrecorded (or differently recorded) copy current by hashing its
|
|
@@ -516,9 +518,9 @@ async function adoptByHash(modelsDir, modelPath, formatEntry) {
|
|
|
516
518
|
}
|
|
517
519
|
/** True when every file of the format is on disk, whatever revision it holds. */
|
|
518
520
|
function isCompleteCopy(modelsDir, modelPath, formatEntry) {
|
|
519
|
-
if (!fs.existsSync(modelPath)) return false;
|
|
520
|
-
if (formatEntry.isDirectory) return fs.existsSync(path$1.join(modelPath, "Manifest.json"));
|
|
521
|
-
if (fs.statSync(modelPath).size <= 0) return false;
|
|
521
|
+
if (!fs$1.existsSync(modelPath)) return false;
|
|
522
|
+
if (formatEntry.isDirectory) return fs$1.existsSync(path$1.join(modelPath, "Manifest.json"));
|
|
523
|
+
if (fs$1.statSync(modelPath).size <= 0) return false;
|
|
522
524
|
return siblingFilesFor(formatEntry).every((f) => isNonEmptyFile(path$1.join(modelsDir, f)));
|
|
523
525
|
}
|
|
524
526
|
/**
|
|
@@ -540,14 +542,14 @@ async function replaceSingleFileFormat(url, modelPath, modelsDir, siblings, onPr
|
|
|
540
542
|
}));
|
|
541
543
|
try {
|
|
542
544
|
for (const [i, part] of parts.entries()) {
|
|
543
|
-
fs.rmSync(part.staged, { force: true });
|
|
545
|
+
fs$1.rmSync(part.staged, { force: true });
|
|
544
546
|
await downloadFile(part.url, part.staged, i === 0 ? (downloaded, total) => onProgress?.(downloaded, total === 0 ? void 0 : total) : void 0);
|
|
545
547
|
}
|
|
546
548
|
} catch (err) {
|
|
547
|
-
for (const part of parts) fs.rmSync(part.staged, { force: true });
|
|
549
|
+
for (const part of parts) fs$1.rmSync(part.staged, { force: true });
|
|
548
550
|
throw err;
|
|
549
551
|
}
|
|
550
|
-
for (const part of parts) fs.renameSync(part.staged, part.dest);
|
|
552
|
+
for (const part of parts) fs$1.renameSync(part.staged, part.dest);
|
|
551
553
|
}
|
|
552
554
|
/**
|
|
553
555
|
* Resolve a `ModelCatalogEntry` against `modelsDir`: download model file
|
|
@@ -562,14 +564,14 @@ async function ensureModel(modelsDir, entry, format, onProgress) {
|
|
|
562
564
|
const modelPath = path$1.join(modelsDir, filename);
|
|
563
565
|
const siblings = siblingFilesFor(formatEntry);
|
|
564
566
|
let outdated = false;
|
|
565
|
-
if (fs.existsSync(modelPath)) if (formatEntry.isDirectory && !fs.existsSync(path$1.join(modelPath, "Manifest.json"))) fs.rmSync(modelPath, {
|
|
567
|
+
if (fs$1.existsSync(modelPath)) if (formatEntry.isDirectory && !fs$1.existsSync(path$1.join(modelPath, "Manifest.json"))) fs$1.rmSync(modelPath, {
|
|
566
568
|
recursive: true,
|
|
567
569
|
force: true
|
|
568
570
|
});
|
|
569
571
|
else if (siblings.some((f) => !isNonEmptyFile(path$1.join(modelsDir, f)))) outdated = !isCurrentRevision(modelPath, formatEntry) && !await adoptByHash(modelsDir, modelPath, formatEntry);
|
|
570
572
|
else if (isCurrentRevision(modelPath, formatEntry) || await adoptByHash(modelsDir, modelPath, formatEntry)) return modelPath;
|
|
571
573
|
else outdated = true;
|
|
572
|
-
fs.mkdirSync(modelsDir, { recursive: true });
|
|
574
|
+
fs$1.mkdirSync(modelsDir, { recursive: true });
|
|
573
575
|
if (formatEntry.isDirectory) await downloadDirectory(formatEntry.url, modelPath, formatEntry.files, onProgress);
|
|
574
576
|
else if (outdated) await replaceSingleFileFormat(formatEntry.url, modelPath, modelsDir, siblings, onProgress);
|
|
575
577
|
else {
|
|
@@ -627,25 +629,25 @@ function isModelDownloaded(modelsDir, entry, format) {
|
|
|
627
629
|
const formatEntry = entry.formats[format];
|
|
628
630
|
if (!formatEntry) return false;
|
|
629
631
|
const modelPath = getModelFilePath(modelsDir, entry, format);
|
|
630
|
-
if (!modelPath || !fs.existsSync(modelPath)) return false;
|
|
632
|
+
if (!modelPath || !fs$1.existsSync(modelPath)) return false;
|
|
631
633
|
if (!isCurrentRevision(modelPath, formatEntry)) return false;
|
|
632
634
|
return isCompleteCopy(modelsDir, modelPath, formatEntry);
|
|
633
635
|
}
|
|
634
636
|
/** Remove the on-disk model file/directory. Returns true if something was deleted. */
|
|
635
637
|
function deleteModelFromDisk(modelsDir, entry, format) {
|
|
636
638
|
const modelPath = getModelFilePath(modelsDir, entry, format);
|
|
637
|
-
if (!modelPath || !fs.existsSync(modelPath)) return false;
|
|
638
|
-
fs.rmSync(revisionRecordPath(modelPath), { force: true });
|
|
639
|
+
if (!modelPath || !fs$1.existsSync(modelPath)) return false;
|
|
640
|
+
fs$1.rmSync(revisionRecordPath(modelPath), { force: true });
|
|
639
641
|
const formatEntry = entry.formats[format];
|
|
640
|
-
if (formatEntry?.isDirectory) fs.rmSync(modelPath, {
|
|
642
|
+
if (formatEntry?.isDirectory) fs$1.rmSync(modelPath, {
|
|
641
643
|
recursive: true,
|
|
642
644
|
force: true
|
|
643
645
|
});
|
|
644
646
|
else {
|
|
645
|
-
fs.unlinkSync(modelPath);
|
|
647
|
+
fs$1.unlinkSync(modelPath);
|
|
646
648
|
if (formatEntry) for (const sibling of siblingFilesFor(formatEntry)) {
|
|
647
649
|
const sibPath = path$1.join(modelsDir, sibling);
|
|
648
|
-
if (fs.existsSync(sibPath)) fs.unlinkSync(sibPath);
|
|
650
|
+
if (fs$1.existsSync(sibPath)) fs$1.unlinkSync(sibPath);
|
|
649
651
|
}
|
|
650
652
|
}
|
|
651
653
|
return true;
|
|
@@ -129,6 +129,8 @@ var HOSTED_MODEL_REVISIONS = {
|
|
|
129
129
|
"objectDetection/yolov9/openvino/camstack-yolov9t-320-int8.xml": "ee465e0ee5c6ad7c4edc481b506a076045b82236ada80efcf8601a6ba0a7ee86",
|
|
130
130
|
"objectDetection/yolov9/openvino/camstack-yolov9t-640-fp16.xml": "d4dd2278941ccb210d0763d822353f6d951c6a4f4f5a1604d7e3536ce6ffb954",
|
|
131
131
|
"objectDetection/yolov9/openvino/camstack-yolov9t-640-int8.xml": "be2c95951a9f3a6d408bbabd551c99b8a6190f9ff659ae614b9e58cf0e51202c",
|
|
132
|
+
"objectDetection/yolov9/tflite/yolov9-s-relu6-best_320_int8_edgetpu.tflite": "49a38e77439b475d0d259a6d9fe7ea32fcaa58de3748499dd120aceebad9c591",
|
|
133
|
+
"objectDetection/yolov9/tflite/yolov9-s-relu6-tpumax_512_int8_edgetpu.tflite": "f634f60259101556825fd69662f96282e74364b507f83e6382cc34d5d0e6170e",
|
|
132
134
|
"packageDetection/rfdetr-package/coreml/camstack-rfdetr-package.mlpackage": "73e42f03d66011a311bd83a0a3d1890e7eb1b9b2ba2b5688552a5d4fd60e0e72",
|
|
133
135
|
"packageDetection/rfdetr-package/onnx/camstack-rfdetr-package.onnx": "5af96c6b5936f179e317c9e3915b7c7f74ea3625355f97f6a071c3cd5af2475c",
|
|
134
136
|
"packageDetection/rfdetr-package/openvino/camstack-rfdetr-package.xml": "e2cb5bbccb7809d5c7e691a957bc5e008084119bdf29e2c95d6b6b0791e3061a",
|
package/dist/file-host-worker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
2
|
+
const require_wal_maintenance = require("./wal-maintenance-CaJjuLHq.js");
|
|
3
3
|
let node_worker_threads = require("node:worker_threads");
|
|
4
4
|
//#region src/builtins/sqlite-storage/file-host-worker.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as RecordsEngine, D as callVector, E as callRecords, O as controlTargetOf, T as callData, _ as collectTransferables, a as WalMaintenance, b as isFileHostWorkerData, h as serializeError, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, w as callControl, x as trustInput, y as isFileHostRequest } from "./wal-maintenance-
|
|
1
|
+
import { C as RecordsEngine, D as callVector, E as callRecords, O as controlTargetOf, T as callData, _ as collectTransferables, a as WalMaintenance, b as isFileHostWorkerData, h as serializeError, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, w as callControl, x as trustInput, y as isFileHostRequest } from "./wal-maintenance-Bj_MmDkr.mjs";
|
|
2
2
|
import { parentPort, threadId, workerData } from "node:worker_threads";
|
|
3
3
|
//#region src/builtins/sqlite-storage/file-host-worker.ts
|
|
4
4
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -141,6 +141,7 @@ export type { ClusterNodeHistoryBody } from "./builtins/cluster-agent/record-kin
|
|
|
141
141
|
export { storageOrchestratorRecordKinds, STORAGE_DRAIN_STATE_LEGACY } from "./builtins/storage-orchestrator/record-kinds.js";
|
|
142
142
|
export { backupOrchestratorRecordKinds, backupRecordStoresOf, type BackupRecordStores } from "./builtins/backup-orchestrator/record-kinds.js";
|
|
143
143
|
export { readAllRows } from "./records/read-all-rows.js";
|
|
144
|
+
export { RecordsEngine, type RecordsEngineOptions } from "./builtins/sqlite-storage/records/records-engine.js";
|
|
144
145
|
export { type EnsureAddonNativePrebuildsOptions, ensureAddonNativePrebuilds, type NativeEnsureOutcome, type NativeEnsureResult } from "./kernel/deps/ensure-addon-natives.js";
|
|
145
146
|
export { type EnsureNativePrebuildsOptions, ensureNativePrebuilds, hasDotNode, NATIVE_SCAN_DEPTH, type PrebuildFetchFn, type PrebuildTarget, TRADITIONAL_NATIVE_PACKAGES } from "./kernel/deps/ensure-native-prebuilds.js";
|
|
146
147
|
export { type NpmInvocation, type RunNpmOptions, buildNpmChildEnv, resolveNpmInvocation, runNpm } from "./kernel/deps/npm-command.js";
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
|
|
|
28
28
|
const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
|
|
29
29
|
const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
|
|
30
30
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
31
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
31
|
+
const require_wal_maintenance = require("./wal-maintenance-CaJjuLHq.js");
|
|
32
32
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
33
33
|
const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
|
|
34
34
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
@@ -38,12 +38,12 @@ const require_constants = require("./constants-6OeJiZgi.js");
|
|
|
38
38
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
39
39
|
require("./builtins/system-config/index.js");
|
|
40
40
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
41
|
-
const require_custom_action_registry = require("./custom-action-registry-
|
|
41
|
+
const require_custom_action_registry = require("./custom-action-registry-MRyes5j0.js");
|
|
42
42
|
const require_hub_mdns_ciao = require("./hub-mdns-ciao-CTBTlia4.js");
|
|
43
43
|
const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
|
|
44
44
|
const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
|
|
45
45
|
const require_restore_archive = require("./restore-archive-DM1OBYq4.js");
|
|
46
|
-
const require_coral_accelerators = require("./coral-accelerators-
|
|
46
|
+
const require_coral_accelerators = require("./coral-accelerators-oUXmmbc2.js");
|
|
47
47
|
let zod = require("zod");
|
|
48
48
|
let node_crypto = require("node:crypto");
|
|
49
49
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
@@ -6829,6 +6829,20 @@ var AddonLoader = class {
|
|
|
6829
6829
|
}
|
|
6830
6830
|
async loadDeclaration(addonDir, declaration, packageName, packageVersion, packageDisplayName, bundle) {
|
|
6831
6831
|
if (!declaration.entry) throw new Error(`Addon "${declaration.id}" has no entry point in package.json`);
|
|
6832
|
+
const owner = this.addons.get(declaration.id);
|
|
6833
|
+
if (owner !== void 0 && owner.packageName !== packageName) {
|
|
6834
|
+
this.logger.warn(`Skipped addon "${declaration.id}" from ${packageName}: already provided by ${owner.packageName}`, {
|
|
6835
|
+
tags: { addonId: declaration.id },
|
|
6836
|
+
meta: {
|
|
6837
|
+
skippedPackage: packageName,
|
|
6838
|
+
skippedVersion: packageVersion,
|
|
6839
|
+
skippedDir: addonDir,
|
|
6840
|
+
ownerPackage: owner.packageName,
|
|
6841
|
+
ownerVersion: owner.packageVersion
|
|
6842
|
+
}
|
|
6843
|
+
});
|
|
6844
|
+
return;
|
|
6845
|
+
}
|
|
6832
6846
|
const entryFile = declaration.entry.replace(/^\.\//, "").replace(/^src\//, "dist/").replace(/\.ts$/, ".js");
|
|
6833
6847
|
let entryPath = node_path.resolve(addonDir, entryFile);
|
|
6834
6848
|
if (!node_fs.existsSync(entryPath)) {
|
|
@@ -22556,6 +22570,19 @@ var AddonDepsManager = class {
|
|
|
22556
22570
|
const pythonPath = await this.ensurePython();
|
|
22557
22571
|
if (!pythonPath) throw new Error("Cannot install Python requirements: Python is not available");
|
|
22558
22572
|
await singleFlight(this.depsDir, "python-pip", () => (0, _camstack_types_node.installPythonRequirements)(pythonPath, requirementsFile, this.logger));
|
|
22573
|
+
await this.stageNativeDepsDeclaredBy(requirementsFile);
|
|
22574
|
+
}
|
|
22575
|
+
/**
|
|
22576
|
+
* The native library a requirements file says its packages need
|
|
22577
|
+
* (`# camstack-native-dep: edgetpu-delegate`), staged under this node's
|
|
22578
|
+
* deps dir. Runs on every call — not only the first pip install — so a
|
|
22579
|
+
* node whose pip marker predates the line still gets the library. A
|
|
22580
|
+
* platform without a build answers `unavailable` (logged, not thrown); a
|
|
22581
|
+
* failed or tampered download throws, and provisioning reports it.
|
|
22582
|
+
*/
|
|
22583
|
+
async stageNativeDepsDeclaredBy(requirementsFile) {
|
|
22584
|
+
if (!(0, _camstack_types_node.declaresEdgetpuDelegate)(node_fs.readFileSync(requirementsFile, "utf8"))) return;
|
|
22585
|
+
await singleFlight(this.depsDir, "edgetpu-delegate", () => (0, _camstack_types_node.ensureEdgetpuDelegate)(this.nodeRoot, this.logger));
|
|
22559
22586
|
}
|
|
22560
22587
|
getDepsDir() {
|
|
22561
22588
|
return this.depsDir;
|
|
@@ -27850,6 +27877,7 @@ exports.RUNNER_RSS_BUDGET_ENV = RUNNER_RSS_BUDGET_ENV;
|
|
|
27850
27877
|
exports.RUNTIME_DEFAULTS = require_dist.RUNTIME_DEFAULTS;
|
|
27851
27878
|
exports.ReadinessRegistry = require_dist.ReadinessRegistry;
|
|
27852
27879
|
exports.ReadinessTimeoutError = require_dist.ReadinessTimeoutError;
|
|
27880
|
+
exports.RecordsEngine = require_wal_maintenance.RecordsEngine;
|
|
27853
27881
|
exports.ReplEngine = ReplEngine;
|
|
27854
27882
|
exports.RingBuffer = RingBuffer;
|
|
27855
27883
|
exports.SERVER_AUTH_OID = require_agent_https.SERVER_AUTH_OID;
|