@camstack/system 1.2.462 → 1.2.464

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 (82) hide show
  1. package/dist/addon-utils.mjs +1 -1
  2. package/dist/{agent-https-CC7jpktS.mjs → agent-https-B9gbXoJI.mjs} +1 -1
  3. package/dist/{agent-https-C6M6apPV.js → agent-https-DhFIbEwN.js} +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  5. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
  8. package/dist/builtins/alerts/alerts.addon.js +1 -1
  9. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  10. package/dist/builtins/autotrack/index.js +1 -1
  11. package/dist/builtins/autotrack/index.mjs +1 -1
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  13. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
  14. package/dist/builtins/calendars/calendars.addon.js +1 -1
  15. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  16. package/dist/builtins/camera-grid/index.js +1 -1
  17. package/dist/builtins/camera-grid/index.mjs +1 -1
  18. package/dist/builtins/composer/composer.addon.js +2 -2
  19. package/dist/builtins/composer/composer.addon.mjs +2 -2
  20. package/dist/builtins/console-logging/index.js +1 -1
  21. package/dist/builtins/console-logging/index.mjs +1 -1
  22. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  23. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  24. package/dist/builtins/device-history/device-history.addon.js +1 -1
  25. package/dist/builtins/device-history/device-history.addon.mjs +1 -1
  26. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  27. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  28. package/dist/builtins/hub-forwarder/index.js +1 -1
  29. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  30. package/dist/builtins/keychain/index.js +3 -3
  31. package/dist/builtins/keychain/index.mjs +3 -3
  32. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  33. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  34. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  35. package/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
  36. package/dist/builtins/local-network/local-network.addon.js +2 -2
  37. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  38. package/dist/builtins/loki-logging/index.js +1 -1
  39. package/dist/builtins/loki-logging/index.mjs +1 -1
  40. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  41. package/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
  42. package/dist/builtins/platform-probe/index.js +1 -1
  43. package/dist/builtins/platform-probe/index.mjs +8 -8
  44. package/dist/builtins/record-entries/index.js +1 -1
  45. package/dist/builtins/record-entries/index.mjs +1 -1
  46. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  47. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  48. package/dist/builtins/snapshot/index.js +1 -1
  49. package/dist/builtins/snapshot/index.mjs +1 -1
  50. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  51. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
  52. package/dist/builtins/sqlite-storage/index.js +1 -1
  53. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  54. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  55. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  56. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  57. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  58. package/dist/builtins/system-config/system-config.addon.js +3 -3
  59. package/dist/builtins/system-config/system-config.addon.mjs +282 -282
  60. package/dist/builtins/winston-logging/index.js +1 -1
  61. package/dist/builtins/winston-logging/index.mjs +1 -1
  62. package/dist/{composition-sources-BlcYzFwY.mjs → composition-sources-CGtooHSL.mjs} +1 -1
  63. package/dist/{composition-sources-BPnpB9XG.js → composition-sources-oXvmbMHX.js} +1 -1
  64. package/dist/{constants-7ZMxWr8Z.js → constants-5mrGZxwS.js} +1 -1
  65. package/dist/{constants-CH5UXe_G.mjs → constants-CdutnpL9.mjs} +1 -1
  66. package/dist/{coral-accelerators-Qhn5TOYZ.mjs → coral-accelerators-D_S1Fo5h.mjs} +5 -5
  67. package/dist/{custom-action-registry-DZSCLBuT.mjs → custom-action-registry-BGYDjTqY.mjs} +37 -37
  68. package/dist/{device-ca-CUEx7sti.js → device-ca-B3xUzps7.js} +1 -1
  69. package/dist/{device-ca-BU_gnd-q.mjs → device-ca-DZHKlZlD.mjs} +1 -1
  70. package/dist/{dist-8tWIDoWp.mjs → dist-C2OBCa-A.mjs} +25 -25
  71. package/dist/{dist-Ct-4tTeX.js → dist-D9aw_d0G.js} +25 -25
  72. package/dist/file-host-worker.js +1 -1
  73. package/dist/file-host-worker.mjs +1 -1
  74. package/dist/{hub-mdns-ciao-Cuy7LUdz.mjs → hub-mdns-ciao-Bm09NrMS.mjs} +2 -2
  75. package/dist/{hub-mdns-ciao-DJ-Amqd7.js → hub-mdns-ciao-CFlhVKK6.js} +2 -2
  76. package/dist/index.js +7 -7
  77. package/dist/index.mjs +225 -225
  78. package/dist/{restore-archive-HwOA83v3.js → restore-archive-6zkRREHO.js} +1 -1
  79. package/dist/{restore-archive-BDua3jO6.mjs → restore-archive-D6sS7Gt2.mjs} +146 -146
  80. package/dist/{wal-maintenance-BvzVehem.mjs → wal-maintenance-Dg6IzSgz.mjs} +0 -0
  81. package/dist/{wal-maintenance-DBvuVU9s.js → wal-maintenance-jXcOxm2T.js} +0 -0
  82. package/package.json +1 -1
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-Ct-4tTeX.js");
6
+ const require_dist = require("../../dist-D9aw_d0G.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  const require_log_file_read_protocol = require("../../log-file-read-protocol-D0WcLbIV.js");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Ln as logDestinationCapability, ei as BaseAddon } from "../../dist-8tWIDoWp.mjs";
1
+ import { Ln as logDestinationCapability, ei as BaseAddon } from "../../dist-C2OBCa-A.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-B7M3X3bT.mjs";
4
4
  import { createRequire } from "node:module";
@@ -1,4 +1,4 @@
1
- import { $r as errMsg, Kr as compositionSourceKey } from "./dist-8tWIDoWp.mjs";
1
+ import { $r as errMsg, Kr as compositionSourceKey } from "./dist-C2OBCa-A.mjs";
2
2
  //#region src/builtins/core-blocks/composition-sources.ts
3
3
  /**
4
4
  * Describe what a composition reads and writes for SAVE-time validation
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-Ct-4tTeX.js");
1
+ const require_dist = require("./dist-D9aw_d0G.js");
2
2
  //#region src/builtins/core-blocks/composition-sources.ts
3
3
  /**
4
4
  * Describe what a composition reads and writes for SAVE-time validation
@@ -1,5 +1,5 @@
1
1
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
2
- var MESH_CA_KEY_REF = require("./dist-Ct-4tTeX.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-D9aw_d0G.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- import { Fi as buildSecretRef } from "./dist-8tWIDoWp.mjs";
1
+ import { Fi as buildSecretRef } from "./dist-C2OBCa-A.mjs";
2
2
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
3
3
  var MESH_CA_KEY_REF = buildSecretRef({
4
4
  owner: "system",
@@ -1,5 +1,5 @@
1
1
  import { EDGETPU_LIB_ENV, chooseEdgetpuDelegate, nodeDataRootFromEnv } from "@camstack/types/node";
2
- import fs from "node:fs";
2
+ import Kt from "node:fs";
3
3
  //#region src/builtins/platform-probe/coral-accelerators.ts
4
4
  /**
5
5
  * Coral USB Edge TPU USB identifiers.
@@ -126,14 +126,14 @@ function classifyCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
126
126
  }
127
127
  function safeList(dir) {
128
128
  try {
129
- return fs.readdirSync(dir);
129
+ return Kt.readdirSync(dir);
130
130
  } catch {
131
131
  return [];
132
132
  }
133
133
  }
134
134
  function safeRead(path) {
135
135
  try {
136
- return fs.readFileSync(path, "utf8").trim();
136
+ return Kt.readFileSync(path, "utf8").trim();
137
137
  } catch {
138
138
  return "";
139
139
  }
@@ -147,7 +147,7 @@ var nodeCoralFs = {
147
147
  listApexClass: () => safeList("/sys/class/apex"),
148
148
  canOpen: (path) => {
149
149
  try {
150
- fs.accessSync(path, fs.constants.R_OK | fs.constants.W_OK);
150
+ Kt.accessSync(path, Kt.constants.R_OK | Kt.constants.W_OK);
151
151
  return true;
152
152
  } catch {
153
153
  return false;
@@ -155,7 +155,7 @@ var nodeCoralFs = {
155
155
  },
156
156
  exists: (path) => {
157
157
  try {
158
- return fs.existsSync(path);
158
+ return Kt.existsSync(path);
159
159
  } catch {
160
160
  return false;
161
161
  }
@@ -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$1 from "node: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$1.existsSync(filePath) && fs$1.statSync(filePath).size > 0;
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$1.existsSync(destPath)) return destPath;
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$1.mkdirSync(path$1.dirname(destPath), { recursive: true });
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$1.createWriteStream(tmpPath);
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$1.renameSync(tmpPath, destPath);
299
+ fs.renameSync(tmpPath, destPath);
300
300
  return destPath;
301
301
  } catch (err) {
302
302
  try {
303
- fs$1.unlinkSync(tmpPath);
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$1.existsSync(destPath)) return {
327
+ if (fs.existsSync(destPath)) return {
328
328
  filePath: destPath,
329
329
  downloadedBytes: 0,
330
330
  fromCache: true
331
331
  };
332
- fs$1.mkdirSync(destDir, { recursive: true });
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$1.unlinkSync(destPath);
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$1.statSync(destPath).size,
346
+ downloadedBytes: fs.statSync(destPath).size,
347
347
  fromCache: false
348
348
  };
349
349
  } catch (e) {
350
350
  lastError = e;
351
- if (fs$1.existsSync(destPath)) fs$1.unlinkSync(destPath);
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$1.createReadStream(filePath);
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$1.rmSync(tmpDir, {
383
+ fs.rmSync(tmpDir, {
384
384
  recursive: true,
385
385
  force: true
386
386
  });
387
- fs$1.mkdirSync(tmpDir, { recursive: true });
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$1.mkdirSync(path$1.dirname(destPath), { recursive: true });
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$1.statSync(destPath).size;
396
+ totalDownloaded += fs.statSync(destPath).size;
397
397
  }
398
- fs$1.rmSync(destDir, {
398
+ fs.rmSync(destDir, {
399
399
  recursive: true,
400
400
  force: true
401
401
  });
402
- fs$1.renameSync(tmpDir, destDir);
402
+ fs.renameSync(tmpDir, destDir);
403
403
  } catch (err) {
404
- fs$1.rmSync(tmpDir, {
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$1.readFileSync(revisionRecordPath(modelPath), "utf8").trim();
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$1.writeFileSync(tmp, `${revision}\n`);
501
- fs$1.renameSync(tmp, record);
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$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;
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$1.rmSync(part.staged, { force: true });
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$1.rmSync(part.staged, { force: true });
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$1.renameSync(part.staged, part.dest);
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$1.existsSync(modelPath)) if (formatEntry.isDirectory && !fs$1.existsSync(path$1.join(modelPath, "Manifest.json"))) fs$1.rmSync(modelPath, {
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$1.mkdirSync(modelsDir, { recursive: true });
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$1.existsSync(modelPath)) return false;
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$1.existsSync(modelPath)) return false;
640
- fs$1.rmSync(revisionRecordPath(modelPath), { force: true });
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$1.rmSync(modelPath, {
642
+ if (formatEntry?.isDirectory) fs.rmSync(modelPath, {
643
643
  recursive: true,
644
644
  force: true
645
645
  });
646
646
  else {
647
- fs$1.unlinkSync(modelPath);
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$1.existsSync(sibPath)) fs$1.unlinkSync(sibPath);
650
+ if (fs.existsSync(sibPath)) fs.unlinkSync(sibPath);
651
651
  }
652
652
  }
653
653
  return true;
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-Ct-4tTeX.js");
1
+ const require_dist = require("./dist-D9aw_d0G.js");
2
2
  const require_x509_es = require("./x509.es-C4cOo48M.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1,4 +1,4 @@
1
- import { A as DEVICE_SAN_CREDENTIAL_PREFIX, Fi as buildSecretRef, j as DEVICE_SAN_USER_PREFIX } from "./dist-8tWIDoWp.mjs";
1
+ import { A as DEVICE_SAN_CREDENTIAL_PREFIX, Fi as buildSecretRef, j as DEVICE_SAN_USER_PREFIX } from "./dist-C2OBCa-A.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
@@ -745,7 +745,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
745
745
  return EventCategory;
746
746
  }({});
747
747
  //#endregion
748
- //#region ../types/dist/sleep-CSuN0thG.mjs
748
+ //#region ../types/dist/sleep-_sV1BE2f.mjs
749
749
  /**
750
750
  * The audio chunk plane's byte format, and the ONE expansion from a coded
751
751
  * window to float samples (D455).
@@ -857,21 +857,21 @@ function collectSecretConfigKeys(schema) {
857
857
  for (const section of sectionsOf(schema)) for (const field of fieldsOf(section)) walkField(field, keys);
858
858
  return keys;
859
859
  }
860
- function isRecord$6(value) {
860
+ function isRecord$7(value) {
861
861
  return typeof value === "object" && value !== null && !Array.isArray(value);
862
862
  }
863
863
  function sectionsOf(schema) {
864
- if (!isRecord$6(schema)) return [];
864
+ if (!isRecord$7(schema)) return [];
865
865
  const sections = schema["sections"];
866
866
  return Array.isArray(sections) ? sections : [];
867
867
  }
868
868
  function fieldsOf(node) {
869
- if (!isRecord$6(node)) return [];
869
+ if (!isRecord$7(node)) return [];
870
870
  const fields = node["fields"];
871
871
  return Array.isArray(fields) ? fields : [];
872
872
  }
873
873
  function walkField(field, out) {
874
- if (!isRecord$6(field)) return;
874
+ if (!isRecord$7(field)) return;
875
875
  const type = field["type"];
876
876
  const key = field["key"];
877
877
  if ((type === "password" || field["secret"] === true) && typeof key === "string" && key.length > 0) out.add(key);
@@ -909,7 +909,7 @@ function walkField(field, out) {
909
909
  var SECRET_CLEAR = { $secretClear: true };
910
910
  /** The `'***'` token D634 redaction writes for non-admins. */
911
911
  var LEGACY_DEVICE_REDACTION = "***";
912
- function isRecord$5(value) {
912
+ function isRecord$6(value) {
913
913
  return typeof value === "object" && value !== null && !Array.isArray(value);
914
914
  }
915
915
  function makeSecretMarker(ref) {
@@ -920,16 +920,16 @@ function makeSecretMarker(ref) {
920
920
  }
921
921
  /** A stored marker: an object whose `$secret` is a non-empty string. */
922
922
  function isSecretMarker(value) {
923
- if (!isRecord$5(value)) return false;
923
+ if (!isRecord$6(value)) return false;
924
924
  const ref = value["$secret"];
925
925
  return typeof ref === "string" && ref.length > 0;
926
926
  }
927
927
  /** Anything carrying a `$secret` key — a stored marker or a UI view of one. */
928
928
  function isSecretMarkerLike(value) {
929
- return isRecord$5(value) && Object.prototype.hasOwnProperty.call(value, "$secret");
929
+ return isRecord$6(value) && Object.prototype.hasOwnProperty.call(value, "$secret");
930
930
  }
931
931
  function isSecretClear(value) {
932
- return isRecord$5(value) && value["$secretClear"] === true;
932
+ return isRecord$6(value) && value["$secretClear"] === true;
933
933
  }
934
934
  /**
935
935
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -1598,7 +1598,7 @@ var KeychainWriteRefusedError = class extends Error {
1598
1598
  }
1599
1599
  };
1600
1600
  var KEEP = { kind: "keep" };
1601
- function isRecord$4(value) {
1601
+ function isRecord$5(value) {
1602
1602
  return typeof value === "object" && value !== null && !Array.isArray(value);
1603
1603
  }
1604
1604
  function defaultMintId() {
@@ -1611,7 +1611,7 @@ function collectSecretMarkerRefs(value, out = []) {
1611
1611
  return out;
1612
1612
  }
1613
1613
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
1614
- else if (isRecord$4(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
1614
+ else if (isRecord$5(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
1615
1615
  return out;
1616
1616
  }
1617
1617
  async function storedValueEquals(secrets, marker, candidate) {
@@ -1666,7 +1666,7 @@ function rowId(row, idKey) {
1666
1666
  return null;
1667
1667
  }
1668
1668
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
1669
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$4) : [];
1669
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$5) : [];
1670
1670
  if (!Array.isArray(incoming)) {
1671
1671
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
1672
1672
  return {
@@ -1682,7 +1682,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
1682
1682
  const kept = /* @__PURE__ */ new Set();
1683
1683
  const rows = [];
1684
1684
  for (const row of incoming) {
1685
- if (!isRecord$4(row)) {
1685
+ if (!isRecord$5(row)) {
1686
1686
  rows.push(row);
1687
1687
  continue;
1688
1688
  }
@@ -1707,7 +1707,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
1707
1707
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
1708
1708
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
1709
1709
  case "object": {
1710
- if (!isRecord$4(incoming)) {
1710
+ if (!isRecord$5(incoming)) {
1711
1711
  if (incoming === void 0) return KEEP;
1712
1712
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
1713
1713
  return {
@@ -1715,7 +1715,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
1715
1715
  value: incoming
1716
1716
  };
1717
1717
  }
1718
- const storedObj = isRecord$4(stored) ? stored : {};
1718
+ const storedObj = isRecord$5(stored) ? stored : {};
1719
1719
  return {
1720
1720
  kind: "value",
1721
1721
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -1838,7 +1838,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
1838
1838
  value: items
1839
1839
  };
1840
1840
  }
1841
- if (isRecord$4(v)) {
1841
+ if (isRecord$5(v)) {
1842
1842
  const out = {};
1843
1843
  for (const [k, child] of Object.entries(v)) {
1844
1844
  const s = substitute(child);
@@ -1870,7 +1870,7 @@ var SecretOverwriteRefusedError = class extends Error {
1870
1870
  this.name = "SecretOverwriteRefusedError";
1871
1871
  }
1872
1872
  };
1873
- function isRecord$3(value) {
1873
+ function isRecord$4(value) {
1874
1874
  return typeof value === "object" && value !== null && !Array.isArray(value);
1875
1875
  }
1876
1876
  function resolvedValue(pass, marker) {
@@ -1899,7 +1899,7 @@ function inArray(pass, incoming, stored) {
1899
1899
  return incoming.map((item, index) => {
1900
1900
  const twin = stored[index];
1901
1901
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
1902
- if (isRecord$3(item) && isRecord$3(twin)) return inArrayRow(pass, item, twin);
1902
+ if (isRecord$4(item) && isRecord$4(twin)) return inArrayRow(pass, item, twin);
1903
1903
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
1904
1904
  return item;
1905
1905
  });
@@ -1910,7 +1910,7 @@ function inArrayRow(pass, incoming, stored) {
1910
1910
  const twin = stored[key];
1911
1911
  if (isSecretMarker(twin)) {
1912
1912
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
1913
- } else if (isRecord$3(value) && isRecord$3(twin)) out[key] = inArrayRow(pass, value, twin);
1913
+ } else if (isRecord$4(value) && isRecord$4(twin)) out[key] = inArrayRow(pass, value, twin);
1914
1914
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
1915
1915
  }
1916
1916
  return out;
@@ -1918,7 +1918,7 @@ function inArrayRow(pass, incoming, stored) {
1918
1918
  async function walk(pass, incoming, stored) {
1919
1919
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
1920
1920
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
1921
- if (!isRecord$3(incoming) || !isRecord$3(stored)) return incoming;
1921
+ if (!isRecord$4(incoming) || !isRecord$4(stored)) return incoming;
1922
1922
  const out = { ...incoming };
1923
1923
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
1924
1924
  return out;
@@ -1949,7 +1949,7 @@ async function restoreUnchangedSecrets(input) {
1949
1949
  function isJsonEqual(a, b) {
1950
1950
  if (Object.is(a, b)) return true;
1951
1951
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
1952
- if (isRecord$3(a) && isRecord$3(b)) {
1952
+ if (isRecord$4(a) && isRecord$4(b)) {
1953
1953
  const keys = Object.keys(a);
1954
1954
  if (keys.length !== Object.keys(b).length) return false;
1955
1955
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -1973,7 +1973,7 @@ function markerKeysOf(blob, owner) {
1973
1973
  }
1974
1974
  function nodeFromStored(value, owner) {
1975
1975
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
1976
- if (!isRecord$3(value)) return null;
1976
+ if (!isRecord$4(value)) return null;
1977
1977
  const children = /* @__PURE__ */ new Map();
1978
1978
  for (const [key, child] of Object.entries(value)) {
1979
1979
  const node = nodeFromStored(child, owner);
@@ -3507,11 +3507,11 @@ function secretArrayPrefixes(path) {
3507
3507
  }
3508
3508
  return prefixes;
3509
3509
  }
3510
- function isRecord$2(value) {
3510
+ function isRecord$3(value) {
3511
3511
  return typeof value === "object" && value !== null && !Array.isArray(value);
3512
3512
  }
3513
3513
  function elementId(element, idKey, declared, prefix) {
3514
- const id = isRecord$2(element) ? element[idKey] : void 0;
3514
+ const id = isRecord$3(element) ? element[idKey] : void 0;
3515
3515
  if (typeof id !== "string" || id.length === 0) throw new InvalidRecordError(`"${declared}": every element of "${prefix}" needs a non-empty string "${idKey}" to carry a secret`);
3516
3516
  return id;
3517
3517
  }
@@ -3522,7 +3522,7 @@ function elementId(element, idKey, declared, prefix) {
3522
3522
  */
3523
3523
  var REMOVE_LEAF = Symbol("remove-leaf");
3524
3524
  function mapAt(node, segments, index, walkedKeys, concretePrefix, declared, arrayKeys, visit) {
3525
- if (!isRecord$2(node)) return node;
3525
+ if (!isRecord$3(node)) return node;
3526
3526
  const segment = segments[index];
3527
3527
  if (segment === void 0) return node;
3528
3528
  if (!Object.prototype.hasOwnProperty.call(node, segment.key)) return node;