@camstack/system 1.2.459 → 1.2.460

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/addon-runner.js +26 -11
  2. package/dist/addon-runner.mjs +26 -11
  3. package/dist/addon-utils.mjs +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +3 -3
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +4 -4
  6. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +4 -4
  7. package/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
  8. package/dist/builtins/native-metrics/native-metrics.addon.js +38 -3
  9. package/dist/builtins/native-metrics/native-metrics.addon.mjs +47 -12
  10. package/dist/builtins/native-metrics/node-metrics-history-recorder.d.ts +15 -0
  11. package/dist/builtins/platform-probe/coral-accelerators.d.ts +10 -1
  12. package/dist/builtins/platform-probe/index.js +6 -3
  13. package/dist/builtins/platform-probe/index.mjs +12 -9
  14. package/dist/builtins/platform-probe/platform-scorer.d.ts +4 -1
  15. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +19 -19
  16. package/dist/builtins/sqlite-storage/index.js +1 -1
  17. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  18. package/dist/builtins/sqlite-storage/records/records-plan.d.ts +9 -4
  19. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  20. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  21. package/dist/builtins/system-config/system-config.addon.mjs +112 -112
  22. package/dist/{coral-accelerators-DcnZvctM.mjs → coral-accelerators-Qhn5TOYZ.mjs} +18 -15
  23. package/dist/{coral-accelerators-Bi_c3Rft.js → coral-accelerators-oUXmmbc2.js} +13 -10
  24. package/dist/{custom-action-registry-stpC3Zy-.mjs → custom-action-registry-DStvrQKI.mjs} +37 -37
  25. package/dist/file-host-worker.js +1 -1
  26. package/dist/file-host-worker.mjs +1 -1
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +30 -2
  29. package/dist/index.mjs +248 -221
  30. package/dist/kernel/deps/addon-deps-manager.d.ts +9 -0
  31. package/dist/{restore-archive-CmP-iiG9.mjs → restore-archive-CM23Pq9B.mjs} +93 -93
  32. package/dist/{wal-maintenance-NKbwWovZ.mjs → wal-maintenance-Bj_MmDkr.mjs} +0 -0
  33. package/dist/{wal-maintenance-DUHEp_09.js → wal-maintenance-CaJjuLHq.js} +0 -0
  34. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
- import Kt from "node:fs";
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
- * Default install path of the libedgetpu delegate on the hub, provisioned
24
- * out-of-band by `/data/deps/edgetpu-install.sh` (it is a system shared
25
- * library, not a pip package). Overridable via `CAMSTACK_EDGETPU_LIB` — kept in
26
- * sync with the Python pool's own default in `inference_pool.py`.
27
- */
28
- var DEFAULT_EDGETPU_LIB = "/data/deps/edgetpu/lib/libedgetpu.so.1";
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
- const libPath = process.env["CAMSTACK_EDGETPU_LIB"] ?? DEFAULT_EDGETPU_LIB;
115
- if (fsx.exists(libPath)) return {
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 Kt.readdirSync(dir);
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 Kt.readFileSync(path, "utf8").trim();
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
- Kt.accessSync(path, Kt.constants.R_OK | Kt.constants.W_OK);
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 Kt.existsSync(path);
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
- * Default install path of the libedgetpu delegate on the hub, provisioned
26
- * out-of-band by `/data/deps/edgetpu-install.sh` (it is a system shared
27
- * library, not a pip package). Overridable via `CAMSTACK_EDGETPU_LIB` — kept in
28
- * sync with the Python pool's own default in `inference_pool.py`.
29
- */
30
- var DEFAULT_EDGETPU_LIB = "/data/deps/edgetpu/lib/libedgetpu.so.1";
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
- const libPath = process.env["CAMSTACK_EDGETPU_LIB"] ?? DEFAULT_EDGETPU_LIB;
117
- if (fsx.exists(libPath)) return {
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";
@@ -157,7 +157,7 @@ var HOSTED_MODEL_REVISIONS = {
157
157
  //#endregion
158
158
  //#region src/download/model-downloader.ts
159
159
  function isNonEmptyFile(filePath) {
160
- return fs.existsSync(filePath) && fs.statSync(filePath).size > 0;
160
+ return fs$1.existsSync(filePath) && fs$1.statSync(filePath).size > 0;
161
161
  }
162
162
  /**
163
163
  * Sibling files of a single-file (non-directory) format — extra files the
@@ -234,11 +234,11 @@ function resolveRedirectUrl(current, location) {
234
234
  return new URL(location, current);
235
235
  }
236
236
  async function downloadFile(url, destPath, onProgressOrOptions) {
237
- if (fs.existsSync(destPath)) return destPath;
237
+ if (fs$1.existsSync(destPath)) return destPath;
238
238
  const opts = normalizeDownloadOptions(onProgressOrOptions);
239
239
  const fetchImpl = opts.fetchImpl ?? fetch;
240
240
  const maxRedirects = opts.maxRedirects ?? DEFAULT_MAX_REDIRECTS;
241
- fs.mkdirSync(path$1.dirname(destPath), { recursive: true });
241
+ fs$1.mkdirSync(path$1.dirname(destPath), { recursive: true });
242
242
  const tmpPath = destPath + ".downloading";
243
243
  try {
244
244
  let current = url;
@@ -276,7 +276,7 @@ async function downloadFile(url, destPath, onProgressOrOptions) {
276
276
  if (!response.body) throw new Error(`No response body from ${url}`);
277
277
  const total = parseInt(response.headers.get("content-length") ?? "0", 10);
278
278
  let downloaded = 0;
279
- const fileStream = fs.createWriteStream(tmpPath);
279
+ const fileStream = fs$1.createWriteStream(tmpPath);
280
280
  const reader = response.body.getReader();
281
281
  try {
282
282
  for (;;) {
@@ -294,11 +294,11 @@ async function downloadFile(url, destPath, onProgressOrOptions) {
294
294
  fileStream.on("error", reject);
295
295
  });
296
296
  }
297
- fs.renameSync(tmpPath, destPath);
297
+ fs$1.renameSync(tmpPath, destPath);
298
298
  return destPath;
299
299
  } catch (err) {
300
300
  try {
301
- fs.unlinkSync(tmpPath);
301
+ fs$1.unlinkSync(tmpPath);
302
302
  } catch {}
303
303
  throw err;
304
304
  }
@@ -322,12 +322,12 @@ async function downloadModel(options) {
322
322
  const { url, fallbackUrls = [], destDir, filename, expectedSha256, onProgress } = options;
323
323
  const fname = filename ?? url.split("/").pop() ?? "model.bin";
324
324
  const destPath = path$1.join(destDir, fname);
325
- if (fs.existsSync(destPath)) return {
325
+ if (fs$1.existsSync(destPath)) return {
326
326
  filePath: destPath,
327
327
  downloadedBytes: 0,
328
328
  fromCache: true
329
329
  };
330
- fs.mkdirSync(destDir, { recursive: true });
330
+ fs$1.mkdirSync(destDir, { recursive: true });
331
331
  const urls = [url, ...fallbackUrls];
332
332
  let lastError = null;
333
333
  for (const tryUrl of urls) try {
@@ -335,25 +335,25 @@ async function downloadModel(options) {
335
335
  if (expectedSha256) {
336
336
  const hash = await computeSha256(destPath);
337
337
  if (hash !== expectedSha256) {
338
- fs.unlinkSync(destPath);
338
+ fs$1.unlinkSync(destPath);
339
339
  throw new Error(`SHA256 mismatch: expected ${expectedSha256}, got ${hash}`);
340
340
  }
341
341
  }
342
342
  return {
343
343
  filePath: destPath,
344
- downloadedBytes: fs.statSync(destPath).size,
344
+ downloadedBytes: fs$1.statSync(destPath).size,
345
345
  fromCache: false
346
346
  };
347
347
  } catch (e) {
348
348
  lastError = e;
349
- if (fs.existsSync(destPath)) fs.unlinkSync(destPath);
349
+ if (fs$1.existsSync(destPath)) fs$1.unlinkSync(destPath);
350
350
  }
351
351
  throw lastError ?? /* @__PURE__ */ new Error(`Failed to download model from ${url}`);
352
352
  }
353
353
  async function computeSha256(filePath) {
354
354
  return new Promise((resolve, reject) => {
355
355
  const hash = createHash("sha256");
356
- const stream = fs.createReadStream(filePath);
356
+ const stream = fs$1.createReadStream(filePath);
357
357
  stream.on("data", (chunk) => hash.update(chunk));
358
358
  stream.on("end", () => resolve(hash.digest("hex")));
359
359
  stream.on("error", reject);
@@ -378,28 +378,28 @@ async function downloadDirectory(url, destDir, knownFiles, onProgress) {
378
378
  fileUrl: `https://huggingface.co/${repo}/resolve/main/${dirPath}/${f}`
379
379
  }));
380
380
  const tmpDir = destDir + ".downloading";
381
- fs.rmSync(tmpDir, {
381
+ fs$1.rmSync(tmpDir, {
382
382
  recursive: true,
383
383
  force: true
384
384
  });
385
- fs.mkdirSync(tmpDir, { recursive: true });
385
+ fs$1.mkdirSync(tmpDir, { recursive: true });
386
386
  let totalDownloaded = 0;
387
387
  try {
388
388
  for (const file of files) {
389
389
  const destPath = path$1.join(tmpDir, file.relativePath);
390
- fs.mkdirSync(path$1.dirname(destPath), { recursive: true });
390
+ fs$1.mkdirSync(path$1.dirname(destPath), { recursive: true });
391
391
  await downloadFile(file.fileUrl, destPath, (downloaded, _total) => {
392
392
  onProgress?.(totalDownloaded + downloaded, void 0);
393
393
  });
394
- totalDownloaded += fs.statSync(destPath).size;
394
+ totalDownloaded += fs$1.statSync(destPath).size;
395
395
  }
396
- fs.rmSync(destDir, {
396
+ fs$1.rmSync(destDir, {
397
397
  recursive: true,
398
398
  force: true
399
399
  });
400
- fs.renameSync(tmpDir, destDir);
400
+ fs$1.renameSync(tmpDir, destDir);
401
401
  } catch (err) {
402
- fs.rmSync(tmpDir, {
402
+ fs$1.rmSync(tmpDir, {
403
403
  recursive: true,
404
404
  force: true
405
405
  });
@@ -431,7 +431,7 @@ function revisionRecordPath(modelPath) {
431
431
  }
432
432
  function readRevisionRecord(modelPath) {
433
433
  try {
434
- return fs.readFileSync(revisionRecordPath(modelPath), "utf8").trim();
434
+ return fs$1.readFileSync(revisionRecordPath(modelPath), "utf8").trim();
435
435
  } catch {
436
436
  return null;
437
437
  }
@@ -495,8 +495,8 @@ function writeRevisionRecord(modelPath, revision) {
495
495
  if (revision === void 0) return;
496
496
  const record = revisionRecordPath(modelPath);
497
497
  const tmp = `${record}.tmp`;
498
- fs.writeFileSync(tmp, `${revision}\n`);
499
- fs.renameSync(tmp, record);
498
+ fs$1.writeFileSync(tmp, `${revision}\n`);
499
+ fs$1.renameSync(tmp, record);
500
500
  }
501
501
  /**
502
502
  * Prove an unrecorded (or differently recorded) copy current by hashing its
@@ -516,9 +516,9 @@ async function adoptByHash(modelsDir, modelPath, formatEntry) {
516
516
  }
517
517
  /** True when every file of the format is on disk, whatever revision it holds. */
518
518
  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;
519
+ if (!fs$1.existsSync(modelPath)) return false;
520
+ if (formatEntry.isDirectory) return fs$1.existsSync(path$1.join(modelPath, "Manifest.json"));
521
+ if (fs$1.statSync(modelPath).size <= 0) return false;
522
522
  return siblingFilesFor(formatEntry).every((f) => isNonEmptyFile(path$1.join(modelsDir, f)));
523
523
  }
524
524
  /**
@@ -540,14 +540,14 @@ async function replaceSingleFileFormat(url, modelPath, modelsDir, siblings, onPr
540
540
  }));
541
541
  try {
542
542
  for (const [i, part] of parts.entries()) {
543
- fs.rmSync(part.staged, { force: true });
543
+ fs$1.rmSync(part.staged, { force: true });
544
544
  await downloadFile(part.url, part.staged, i === 0 ? (downloaded, total) => onProgress?.(downloaded, total === 0 ? void 0 : total) : void 0);
545
545
  }
546
546
  } catch (err) {
547
- for (const part of parts) fs.rmSync(part.staged, { force: true });
547
+ for (const part of parts) fs$1.rmSync(part.staged, { force: true });
548
548
  throw err;
549
549
  }
550
- for (const part of parts) fs.renameSync(part.staged, part.dest);
550
+ for (const part of parts) fs$1.renameSync(part.staged, part.dest);
551
551
  }
552
552
  /**
553
553
  * Resolve a `ModelCatalogEntry` against `modelsDir`: download model file
@@ -562,14 +562,14 @@ async function ensureModel(modelsDir, entry, format, onProgress) {
562
562
  const modelPath = path$1.join(modelsDir, filename);
563
563
  const siblings = siblingFilesFor(formatEntry);
564
564
  let outdated = false;
565
- if (fs.existsSync(modelPath)) if (formatEntry.isDirectory && !fs.existsSync(path$1.join(modelPath, "Manifest.json"))) fs.rmSync(modelPath, {
565
+ if (fs$1.existsSync(modelPath)) if (formatEntry.isDirectory && !fs$1.existsSync(path$1.join(modelPath, "Manifest.json"))) fs$1.rmSync(modelPath, {
566
566
  recursive: true,
567
567
  force: true
568
568
  });
569
569
  else if (siblings.some((f) => !isNonEmptyFile(path$1.join(modelsDir, f)))) outdated = !isCurrentRevision(modelPath, formatEntry) && !await adoptByHash(modelsDir, modelPath, formatEntry);
570
570
  else if (isCurrentRevision(modelPath, formatEntry) || await adoptByHash(modelsDir, modelPath, formatEntry)) return modelPath;
571
571
  else outdated = true;
572
- fs.mkdirSync(modelsDir, { recursive: true });
572
+ fs$1.mkdirSync(modelsDir, { recursive: true });
573
573
  if (formatEntry.isDirectory) await downloadDirectory(formatEntry.url, modelPath, formatEntry.files, onProgress);
574
574
  else if (outdated) await replaceSingleFileFormat(formatEntry.url, modelPath, modelsDir, siblings, onProgress);
575
575
  else {
@@ -627,25 +627,25 @@ function isModelDownloaded(modelsDir, entry, format) {
627
627
  const formatEntry = entry.formats[format];
628
628
  if (!formatEntry) return false;
629
629
  const modelPath = getModelFilePath(modelsDir, entry, format);
630
- if (!modelPath || !fs.existsSync(modelPath)) return false;
630
+ if (!modelPath || !fs$1.existsSync(modelPath)) return false;
631
631
  if (!isCurrentRevision(modelPath, formatEntry)) return false;
632
632
  return isCompleteCopy(modelsDir, modelPath, formatEntry);
633
633
  }
634
634
  /** Remove the on-disk model file/directory. Returns true if something was deleted. */
635
635
  function deleteModelFromDisk(modelsDir, entry, format) {
636
636
  const modelPath = getModelFilePath(modelsDir, entry, format);
637
- if (!modelPath || !fs.existsSync(modelPath)) return false;
638
- fs.rmSync(revisionRecordPath(modelPath), { force: true });
637
+ if (!modelPath || !fs$1.existsSync(modelPath)) return false;
638
+ fs$1.rmSync(revisionRecordPath(modelPath), { force: true });
639
639
  const formatEntry = entry.formats[format];
640
- if (formatEntry?.isDirectory) fs.rmSync(modelPath, {
640
+ if (formatEntry?.isDirectory) fs$1.rmSync(modelPath, {
641
641
  recursive: true,
642
642
  force: true
643
643
  });
644
644
  else {
645
- fs.unlinkSync(modelPath);
645
+ fs$1.unlinkSync(modelPath);
646
646
  if (formatEntry) for (const sibling of siblingFilesFor(formatEntry)) {
647
647
  const sibPath = path$1.join(modelsDir, sibling);
648
- if (fs.existsSync(sibPath)) fs.unlinkSync(sibPath);
648
+ if (fs$1.existsSync(sibPath)) fs$1.unlinkSync(sibPath);
649
649
  }
650
650
  }
651
651
  return true;
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-DUHEp_09.js");
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-NKbwWovZ.mjs";
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-DUHEp_09.js");
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");
@@ -43,7 +43,7 @@ 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-Bi_c3Rft.js");
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;