@camstack/server 1.2.726 → 1.2.728

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 (88) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/trpc/generated-cap-routers.js +25 -9
  3. package/package.json +17 -11
  4. package/system/dist/addon-utils.mjs +1 -1
  5. package/system/dist/{agent-https-BnvFHfIE.js → agent-https-B1XLr4nm.js} +1 -1
  6. package/system/dist/{agent-https-D0cOTQNv.mjs → agent-https-BsedJhrb.mjs} +1 -1
  7. package/system/dist/auth/user-manager.d.ts +9 -0
  8. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  9. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
  10. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  11. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
  12. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  13. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  14. package/system/dist/builtins/autotrack/index.js +1 -1
  15. package/system/dist/builtins/autotrack/index.mjs +1 -1
  16. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  17. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
  18. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  19. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  20. package/system/dist/builtins/camera-grid/index.js +1 -1
  21. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  22. package/system/dist/builtins/composer/composer.addon.js +3 -3
  23. package/system/dist/builtins/composer/composer.addon.mjs +3 -3
  24. package/system/dist/builtins/console-logging/index.js +1 -1
  25. package/system/dist/builtins/console-logging/index.mjs +1 -1
  26. package/system/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  27. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  28. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  29. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  30. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  31. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  32. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  33. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  34. package/system/dist/builtins/keychain/index.js +3 -3
  35. package/system/dist/builtins/keychain/index.mjs +3 -3
  36. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  37. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  38. package/system/dist/builtins/local-auth/local-auth.addon.js +20 -2
  39. package/system/dist/builtins/local-auth/local-auth.addon.mjs +23 -5
  40. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  41. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  42. package/system/dist/builtins/loki-logging/index.js +1 -1
  43. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  44. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  45. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
  46. package/system/dist/builtins/platform-probe/index.js +1 -1
  47. package/system/dist/builtins/platform-probe/index.mjs +10 -10
  48. package/system/dist/builtins/record-entries/index.js +1 -1
  49. package/system/dist/builtins/record-entries/index.mjs +1 -1
  50. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  51. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  52. package/system/dist/builtins/snapshot/index.js +1 -1
  53. package/system/dist/builtins/snapshot/index.mjs +1 -1
  54. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  55. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
  56. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  57. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  58. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +11 -3
  59. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +11 -3
  60. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  61. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  62. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  63. package/system/dist/builtins/system-config/system-config.addon.mjs +115 -115
  64. package/system/dist/builtins/winston-logging/index.js +1 -1
  65. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  66. package/system/dist/{composition-sources-9gWI1PaJ.mjs → composition-sources-BjuQ3xot.mjs} +1 -1
  67. package/system/dist/{composition-sources-Csn9vigy.js → composition-sources-C5r8i46e.js} +1 -1
  68. package/system/dist/{constants-BUBTFwBx.js → constants-Bh5wQoTg.js} +1 -1
  69. package/system/dist/{constants-DXemqoYD.mjs → constants-GnxjCxT3.mjs} +1 -1
  70. package/system/dist/{coral-accelerators-BW3OcrLD.mjs → coral-accelerators-DBlgWB8k.mjs} +6 -6
  71. package/system/dist/{custom-action-registry-BIJZBObd.mjs → custom-action-registry-oHl1xltx.mjs} +37 -37
  72. package/system/dist/{device-ca-mHcd1YH_.mjs → device-ca-OWEYAYaG.mjs} +1 -1
  73. package/system/dist/{device-ca-BBWsIjrt.js → device-ca-oM-nuINR.js} +1 -1
  74. package/system/dist/{dist-D4jIqIYT.js → dist-B9xpybTG.js} +113 -1
  75. package/system/dist/{dist-AYmnm-Kz.mjs → dist-Cw8KtuQY.mjs} +113 -1
  76. package/system/dist/file-host-worker.js +1 -1
  77. package/system/dist/file-host-worker.mjs +1 -1
  78. package/system/dist/{hub-mdns-ciao-Cl258gjr.js → hub-mdns-ciao-BPENkOKX.js} +2 -2
  79. package/system/dist/{hub-mdns-ciao-Cx91p2V7.mjs → hub-mdns-ciao-C3qMZFP0.mjs} +2 -2
  80. package/system/dist/index.js +7 -7
  81. package/system/dist/index.mjs +224 -224
  82. package/system/dist/{restore-archive-DIU_NCSx.js → restore-archive-BiN1yKZV.js} +1 -1
  83. package/system/dist/{restore-archive-DebhY_Mj.mjs → restore-archive-DJv5ATV8.mjs} +94 -94
  84. package/system/dist/{retention-D0GH1QcS.js → retention-BT7TgsUn.js} +1 -1
  85. package/system/dist/{retention-CI5_Tvdn.mjs → retention-DQje-V4I.mjs} +1 -1
  86. package/system/dist/{wal-maintenance-BA0MvGtU.js → wal-maintenance-BLwgOIXb.js} +0 -0
  87. package/system/dist/{wal-maintenance-CJKZ2zXS.mjs → wal-maintenance-DM08Htuy.mjs} +0 -0
  88. package/system/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-D4jIqIYT.js");
6
+ const require_dist = require("../../dist-B9xpybTG.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.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 { Br as logDestinationCapability, Qa as BaseAddon } from "../../dist-AYmnm-Kz.mjs";
1
+ import { Br as logDestinationCapability, Qa as BaseAddon } from "../../dist-Cw8KtuQY.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.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 { Fa as compositionSourceKey, js as errMsg } from "./dist-AYmnm-Kz.mjs";
1
+ import { Fa as compositionSourceKey, js as errMsg } from "./dist-Cw8KtuQY.mjs";
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-D4jIqIYT.js");
1
+ const require_dist = require("./dist-B9xpybTG.js");
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -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-D4jIqIYT.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-B9xpybTG.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- import { Lo as buildSecretRef } from "./dist-AYmnm-Kz.mjs";
1
+ import { Lo as buildSecretRef } from "./dist-Cw8KtuQY.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 Kt from "node:fs";
2
+ import fs from "node:fs";
3
3
  //#region src/builtins/platform-probe/coral-accelerators.ts
4
4
  /**
5
5
  * Coral USB Edge TPU USB identifiers.
@@ -185,21 +185,21 @@ function detectCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
185
185
  }
186
186
  function safeListOrNull(dir) {
187
187
  try {
188
- return Kt.readdirSync(dir);
188
+ return fs.readdirSync(dir);
189
189
  } catch {
190
190
  return null;
191
191
  }
192
192
  }
193
193
  function safeList(dir) {
194
194
  try {
195
- return Kt.readdirSync(dir);
195
+ return fs.readdirSync(dir);
196
196
  } catch {
197
197
  return [];
198
198
  }
199
199
  }
200
200
  function safeRead(path) {
201
201
  try {
202
- return Kt.readFileSync(path, "utf8").trim();
202
+ return fs.readFileSync(path, "utf8").trim();
203
203
  } catch {
204
204
  return "";
205
205
  }
@@ -213,7 +213,7 @@ var nodeCoralFs = {
213
213
  listApexClass: () => safeList("/sys/class/apex"),
214
214
  canOpen: (path) => {
215
215
  try {
216
- Kt.accessSync(path, Kt.constants.R_OK | Kt.constants.W_OK);
216
+ fs.accessSync(path, fs.constants.R_OK | fs.constants.W_OK);
217
217
  return true;
218
218
  } catch {
219
219
  return false;
@@ -221,7 +221,7 @@ var nodeCoralFs = {
221
221
  },
222
222
  exists: (path) => {
223
223
  try {
224
- return Kt.existsSync(path);
224
+ return fs.existsSync(path);
225
225
  } catch {
226
226
  return false;
227
227
  }
@@ -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";
@@ -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.existsSync(filePath) && fs.statSync(filePath).size > 0;
162
+ return fs$1.existsSync(filePath) && fs$1.statSync(filePath).size > 0;
163
163
  }
164
164
  /**
165
165
  * Sibling files of a single-file (non-directory) format — extra files the
@@ -269,11 +269,11 @@ function resolveRedirectUrl(current, location) {
269
269
  return new URL(location, current);
270
270
  }
271
271
  async function downloadFile(url, destPath, onProgressOrOptions) {
272
- if (fs.existsSync(destPath)) return destPath;
272
+ if (fs$1.existsSync(destPath)) return destPath;
273
273
  const opts = normalizeDownloadOptions(onProgressOrOptions);
274
274
  const fetchImpl = opts.fetchImpl ?? fetch;
275
275
  const maxRedirects = opts.maxRedirects ?? DEFAULT_MAX_REDIRECTS;
276
- fs.mkdirSync(path$1.dirname(destPath), { recursive: true });
276
+ fs$1.mkdirSync(path$1.dirname(destPath), { recursive: true });
277
277
  const tmpPath = destPath + ".downloading";
278
278
  try {
279
279
  let current = url;
@@ -315,7 +315,7 @@ async function downloadFile(url, destPath, onProgressOrOptions) {
315
315
  if (!response.body) throw new Error(`No response body from ${url}`);
316
316
  const total = parseInt(response.headers.get("content-length") ?? "0", 10);
317
317
  let downloaded = 0;
318
- const fileStream = fs.createWriteStream(tmpPath);
318
+ const fileStream = fs$1.createWriteStream(tmpPath);
319
319
  const reader = response.body.getReader();
320
320
  try {
321
321
  for (;;) {
@@ -333,11 +333,11 @@ async function downloadFile(url, destPath, onProgressOrOptions) {
333
333
  fileStream.on("error", reject);
334
334
  });
335
335
  }
336
- fs.renameSync(tmpPath, destPath);
336
+ fs$1.renameSync(tmpPath, destPath);
337
337
  return destPath;
338
338
  } catch (err) {
339
339
  try {
340
- fs.unlinkSync(tmpPath);
340
+ fs$1.unlinkSync(tmpPath);
341
341
  } catch {}
342
342
  throw err;
343
343
  }
@@ -368,12 +368,12 @@ async function downloadModel(options) {
368
368
  const { url, fallbackUrls = [], destDir, filename, expectedSha256, onProgress } = options;
369
369
  const fname = filename ?? url.split("/").pop() ?? "model.bin";
370
370
  const destPath = path$1.join(destDir, fname);
371
- if (fs.existsSync(destPath)) return {
371
+ if (fs$1.existsSync(destPath)) return {
372
372
  filePath: destPath,
373
373
  downloadedBytes: 0,
374
374
  fromCache: true
375
375
  };
376
- fs.mkdirSync(destDir, { recursive: true });
376
+ fs$1.mkdirSync(destDir, { recursive: true });
377
377
  const urls = [url, ...fallbackUrls];
378
378
  let lastError = null;
379
379
  for (const tryUrl of urls) try {
@@ -381,25 +381,25 @@ async function downloadModel(options) {
381
381
  if (expectedSha256) {
382
382
  const hash = await computeSha256(destPath);
383
383
  if (hash !== expectedSha256) {
384
- fs.unlinkSync(destPath);
384
+ fs$1.unlinkSync(destPath);
385
385
  throw new Error(`SHA256 mismatch: expected ${expectedSha256}, got ${hash}`);
386
386
  }
387
387
  }
388
388
  return {
389
389
  filePath: destPath,
390
- downloadedBytes: fs.statSync(destPath).size,
390
+ downloadedBytes: fs$1.statSync(destPath).size,
391
391
  fromCache: false
392
392
  };
393
393
  } catch (e) {
394
394
  lastError = e;
395
- if (fs.existsSync(destPath)) fs.unlinkSync(destPath);
395
+ if (fs$1.existsSync(destPath)) fs$1.unlinkSync(destPath);
396
396
  }
397
397
  throw lastError ?? /* @__PURE__ */ new Error(`Failed to download model from ${url}`);
398
398
  }
399
399
  async function computeSha256(filePath) {
400
400
  return new Promise((resolve, reject) => {
401
401
  const hash = createHash("sha256");
402
- const stream = fs.createReadStream(filePath);
402
+ const stream = fs$1.createReadStream(filePath);
403
403
  stream.on("data", (chunk) => hash.update(chunk));
404
404
  stream.on("end", () => resolve(hash.digest("hex")));
405
405
  stream.on("error", reject);
@@ -424,28 +424,28 @@ async function downloadDirectory(url, destDir, knownFiles, onProgress) {
424
424
  fileUrl: `https://huggingface.co/${repo}/resolve/main/${dirPath}/${f}`
425
425
  }));
426
426
  const tmpDir = destDir + ".downloading";
427
- fs.rmSync(tmpDir, {
427
+ fs$1.rmSync(tmpDir, {
428
428
  recursive: true,
429
429
  force: true
430
430
  });
431
- fs.mkdirSync(tmpDir, { recursive: true });
431
+ fs$1.mkdirSync(tmpDir, { recursive: true });
432
432
  let totalDownloaded = 0;
433
433
  try {
434
434
  for (const file of files) {
435
435
  const destPath = path$1.join(tmpDir, file.relativePath);
436
- fs.mkdirSync(path$1.dirname(destPath), { recursive: true });
436
+ fs$1.mkdirSync(path$1.dirname(destPath), { recursive: true });
437
437
  await downloadFile(file.fileUrl, destPath, (downloaded, _total) => {
438
438
  onProgress?.(totalDownloaded + downloaded, void 0);
439
439
  });
440
- totalDownloaded += fs.statSync(destPath).size;
440
+ totalDownloaded += fs$1.statSync(destPath).size;
441
441
  }
442
- fs.rmSync(destDir, {
442
+ fs$1.rmSync(destDir, {
443
443
  recursive: true,
444
444
  force: true
445
445
  });
446
- fs.renameSync(tmpDir, destDir);
446
+ fs$1.renameSync(tmpDir, destDir);
447
447
  } catch (err) {
448
- fs.rmSync(tmpDir, {
448
+ fs$1.rmSync(tmpDir, {
449
449
  recursive: true,
450
450
  force: true
451
451
  });
@@ -477,7 +477,7 @@ function revisionRecordPath(modelPath) {
477
477
  }
478
478
  function readRevisionRecord(modelPath) {
479
479
  try {
480
- return fs.readFileSync(revisionRecordPath(modelPath), "utf8").trim();
480
+ return fs$1.readFileSync(revisionRecordPath(modelPath), "utf8").trim();
481
481
  } catch {
482
482
  return null;
483
483
  }
@@ -541,8 +541,8 @@ function writeRevisionRecord(modelPath, revision) {
541
541
  if (revision === void 0) return;
542
542
  const record = revisionRecordPath(modelPath);
543
543
  const tmp = `${record}.tmp`;
544
- fs.writeFileSync(tmp, `${revision}\n`);
545
- fs.renameSync(tmp, record);
544
+ fs$1.writeFileSync(tmp, `${revision}\n`);
545
+ fs$1.renameSync(tmp, record);
546
546
  }
547
547
  /**
548
548
  * Prove an unrecorded (or differently recorded) copy current by hashing its
@@ -562,9 +562,9 @@ async function adoptByHash(modelsDir, modelPath, formatEntry) {
562
562
  }
563
563
  /** True when every file of the format is on disk, whatever revision it holds. */
564
564
  function isCompleteCopy(modelsDir, modelPath, formatEntry) {
565
- if (!fs.existsSync(modelPath)) return false;
566
- if (formatEntry.isDirectory) return fs.existsSync(path$1.join(modelPath, "Manifest.json"));
567
- if (fs.statSync(modelPath).size <= 0) return false;
565
+ if (!fs$1.existsSync(modelPath)) return false;
566
+ if (formatEntry.isDirectory) return fs$1.existsSync(path$1.join(modelPath, "Manifest.json"));
567
+ if (fs$1.statSync(modelPath).size <= 0) return false;
568
568
  return siblingFilesFor(formatEntry).every((f) => isNonEmptyFile(path$1.join(modelsDir, f)));
569
569
  }
570
570
  /**
@@ -586,14 +586,14 @@ async function replaceSingleFileFormat(url, modelPath, modelsDir, siblings, onPr
586
586
  }));
587
587
  try {
588
588
  for (const [i, part] of parts.entries()) {
589
- fs.rmSync(part.staged, { force: true });
589
+ fs$1.rmSync(part.staged, { force: true });
590
590
  await downloadFile(part.url, part.staged, i === 0 ? (downloaded, total) => onProgress?.(downloaded, total === 0 ? void 0 : total) : void 0);
591
591
  }
592
592
  } catch (err) {
593
- for (const part of parts) fs.rmSync(part.staged, { force: true });
593
+ for (const part of parts) fs$1.rmSync(part.staged, { force: true });
594
594
  throw err;
595
595
  }
596
- for (const part of parts) fs.renameSync(part.staged, part.dest);
596
+ for (const part of parts) fs$1.renameSync(part.staged, part.dest);
597
597
  }
598
598
  /**
599
599
  * Resolve a `ModelCatalogEntry` against `modelsDir`: download model file
@@ -608,14 +608,14 @@ async function ensureModel(modelsDir, entry, format, onProgress) {
608
608
  const modelPath = path$1.join(modelsDir, filename);
609
609
  const siblings = siblingFilesFor(formatEntry);
610
610
  let outdated = false;
611
- if (fs.existsSync(modelPath)) if (formatEntry.isDirectory && !fs.existsSync(path$1.join(modelPath, "Manifest.json"))) fs.rmSync(modelPath, {
611
+ if (fs$1.existsSync(modelPath)) if (formatEntry.isDirectory && !fs$1.existsSync(path$1.join(modelPath, "Manifest.json"))) fs$1.rmSync(modelPath, {
612
612
  recursive: true,
613
613
  force: true
614
614
  });
615
615
  else if (siblings.some((f) => !isNonEmptyFile(path$1.join(modelsDir, f)))) outdated = !isCurrentRevision(modelPath, formatEntry) && !await adoptByHash(modelsDir, modelPath, formatEntry);
616
616
  else if (isCurrentRevision(modelPath, formatEntry) || await adoptByHash(modelsDir, modelPath, formatEntry)) return modelPath;
617
617
  else outdated = true;
618
- fs.mkdirSync(modelsDir, { recursive: true });
618
+ fs$1.mkdirSync(modelsDir, { recursive: true });
619
619
  if (formatEntry.isDirectory) await downloadDirectory(formatEntry.url, modelPath, formatEntry.files, onProgress);
620
620
  else if (outdated) await replaceSingleFileFormat(formatEntry.url, modelPath, modelsDir, siblings, onProgress);
621
621
  else {
@@ -673,25 +673,25 @@ function isModelDownloaded(modelsDir, entry, format) {
673
673
  const formatEntry = entry.formats[format];
674
674
  if (!formatEntry) return false;
675
675
  const modelPath = getModelFilePath(modelsDir, entry, format);
676
- if (!modelPath || !fs.existsSync(modelPath)) return false;
676
+ if (!modelPath || !fs$1.existsSync(modelPath)) return false;
677
677
  if (!isCurrentRevision(modelPath, formatEntry)) return false;
678
678
  return isCompleteCopy(modelsDir, modelPath, formatEntry);
679
679
  }
680
680
  /** Remove the on-disk model file/directory. Returns true if something was deleted. */
681
681
  function deleteModelFromDisk(modelsDir, entry, format) {
682
682
  const modelPath = getModelFilePath(modelsDir, entry, format);
683
- if (!modelPath || !fs.existsSync(modelPath)) return false;
684
- fs.rmSync(revisionRecordPath(modelPath), { force: true });
683
+ if (!modelPath || !fs$1.existsSync(modelPath)) return false;
684
+ fs$1.rmSync(revisionRecordPath(modelPath), { force: true });
685
685
  const formatEntry = entry.formats[format];
686
- if (formatEntry?.isDirectory) fs.rmSync(modelPath, {
686
+ if (formatEntry?.isDirectory) fs$1.rmSync(modelPath, {
687
687
  recursive: true,
688
688
  force: true
689
689
  });
690
690
  else {
691
- fs.unlinkSync(modelPath);
691
+ fs$1.unlinkSync(modelPath);
692
692
  if (formatEntry) for (const sibling of siblingFilesFor(formatEntry)) {
693
693
  const sibPath = path$1.join(modelsDir, sibling);
694
- if (fs.existsSync(sibPath)) fs.unlinkSync(sibPath);
694
+ if (fs$1.existsSync(sibPath)) fs$1.unlinkSync(sibPath);
695
695
  }
696
696
  }
697
697
  return true;
@@ -1,4 +1,4 @@
1
- import { H as DEVICE_SAN_USER_PREFIX, Lo as buildSecretRef, V as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-AYmnm-Kz.mjs";
1
+ import { H as DEVICE_SAN_USER_PREFIX, Lo as buildSecretRef, V as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-Cw8KtuQY.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, 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-BRiJgOvu.mjs";
3
3
  import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-D4jIqIYT.js");
1
+ const require_dist = require("./dist-B9xpybTG.js");
2
2
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -12083,7 +12083,13 @@ var MigrationLedgerEntrySchema = zod.z.object({
12083
12083
  /** Why it is `blocked` or `held` (`dependency-failed`, `snapshot-refused`, …). */
12084
12084
  reason: zod.z.string().nullable(),
12085
12085
  nodeId: zod.z.string().nullable(),
12086
- bootId: zod.z.string().nullable()
12086
+ bootId: zod.z.string().nullable(),
12087
+ /**
12088
+ * The catalogued meta of this id (description, body kind, store, `dependsOn`…),
12089
+ * joined by the engine from the catalogues it knows this boot. Absent when no
12090
+ * catalogue lists the id (a newer database).
12091
+ */
12092
+ meta: MigrationMetaSchema.optional()
12087
12093
  });
12088
12094
  /** A catalogued migration that is not applied, with where it stands. */
12089
12095
  var MigrationPendingEntrySchema = zod.z.object({
@@ -88780,6 +88786,12 @@ var userManagementCapability = {
88780
88786
  mode: "singleton",
88781
88787
  methods: {
88782
88788
  listUsers: method(zod.z.void(), zod.z.array(UserSummarySchema), { auth: "admin" }),
88789
+ /**
88790
+ * Read-only: does an admin account still carry the first-boot password
88791
+ * (D728, D797)? One typed boolean; the password and its hash never leave
88792
+ * the hub. Backs the `setup_wizard` admin step.
88793
+ */
88794
+ getAdminBootstrapStatus: method(zod.z.void(), zod.z.object({ defaultPasswordInUse: zod.z.boolean() }), { auth: "admin" }),
88783
88795
  createUser: method(CreateUserInputSchema, UserSummarySchema, {
88784
88796
  kind: "mutation",
88785
88797
  auth: "admin",
@@ -102184,6 +102196,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
102184
102196
  access: "view",
102185
102197
  role: "admin"
102186
102198
  },
102199
+ "userManagement.getAdminBootstrapStatus": {
102200
+ capName: "user-management",
102201
+ capScope: "system",
102202
+ addonId: null,
102203
+ access: "view",
102204
+ role: "admin"
102205
+ },
102187
102206
  "userManagement.getTotpStatus": {
102188
102207
  capName: "user-management",
102189
102208
  capScope: "system",
@@ -106804,6 +106823,98 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
106804
106823
  return [[descriptor.kind, field]];
106805
106824
  })));
106806
106825
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
106826
+ Object.freeze({
106827
+ contact: {
106828
+ starts: {
106829
+ en: "opened",
106830
+ it: "si apre"
106831
+ },
106832
+ finishes: {
106833
+ en: "closed",
106834
+ it: "si chiude"
106835
+ }
106836
+ },
106837
+ "motion-sensor": {
106838
+ starts: {
106839
+ en: "motion detected",
106840
+ it: "movimento rilevato"
106841
+ },
106842
+ finishes: {
106843
+ en: "motion stopped",
106844
+ it: "movimento terminato"
106845
+ }
106846
+ },
106847
+ smoke: {
106848
+ starts: {
106849
+ en: "smoke detected",
106850
+ it: "fumo rilevato"
106851
+ },
106852
+ finishes: {
106853
+ en: "smoke gone",
106854
+ it: "fumo scomparso"
106855
+ }
106856
+ },
106857
+ flood: {
106858
+ starts: {
106859
+ en: "water detected",
106860
+ it: "acqua rilevata"
106861
+ },
106862
+ finishes: {
106863
+ en: "dry again",
106864
+ it: "di nuovo asciutto"
106865
+ }
106866
+ },
106867
+ gas: {
106868
+ starts: {
106869
+ en: "gas detected",
106870
+ it: "gas rilevato"
106871
+ },
106872
+ finishes: {
106873
+ en: "gas gone",
106874
+ it: "gas scomparso"
106875
+ }
106876
+ },
106877
+ "carbon-monoxide": {
106878
+ starts: {
106879
+ en: "carbon monoxide detected",
106880
+ it: "monossido rilevato"
106881
+ },
106882
+ finishes: {
106883
+ en: "carbon monoxide gone",
106884
+ it: "monossido scomparso"
106885
+ }
106886
+ },
106887
+ vibration: {
106888
+ starts: {
106889
+ en: "vibration detected",
106890
+ it: "vibrazione rilevata"
106891
+ },
106892
+ finishes: {
106893
+ en: "vibration stopped",
106894
+ it: "vibrazione terminata"
106895
+ }
106896
+ },
106897
+ tamper: {
106898
+ starts: {
106899
+ en: "tampered with",
106900
+ it: "manomesso"
106901
+ },
106902
+ finishes: {
106903
+ en: "tamper cleared",
106904
+ it: "manomissione rientrata"
106905
+ }
106906
+ },
106907
+ "appliance-cycle": {
106908
+ starts: {
106909
+ en: "the cycle started",
106910
+ it: "il ciclo parte"
106911
+ },
106912
+ finishes: {
106913
+ en: "the cycle finished",
106914
+ it: "il ciclo è terminato"
106915
+ }
106916
+ }
106917
+ });
106807
106918
  zod.z.object({
106808
106919
  phase: zod.z.enum(["raised", "resolved"]),
106809
106920
  episodeId: zod.z.string().min(1),
@@ -107069,6 +107180,7 @@ var STATE_SUMMARY_VARS = [
107069
107180
  [...RULE_TEXT],
107070
107181
  [...RULE_TEXT],
107071
107182
  [...RULE_TEXT],
107183
+ [...RULE_TEXT],
107072
107184
  ([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
107073
107185
  [...RULE_TEXT],
107074
107186
  [...RULE_TEXT],
@@ -12083,7 +12083,13 @@ var MigrationLedgerEntrySchema = z.object({
12083
12083
  /** Why it is `blocked` or `held` (`dependency-failed`, `snapshot-refused`, …). */
12084
12084
  reason: z.string().nullable(),
12085
12085
  nodeId: z.string().nullable(),
12086
- bootId: z.string().nullable()
12086
+ bootId: z.string().nullable(),
12087
+ /**
12088
+ * The catalogued meta of this id (description, body kind, store, `dependsOn`…),
12089
+ * joined by the engine from the catalogues it knows this boot. Absent when no
12090
+ * catalogue lists the id (a newer database).
12091
+ */
12092
+ meta: MigrationMetaSchema.optional()
12087
12093
  });
12088
12094
  /** A catalogued migration that is not applied, with where it stands. */
12089
12095
  var MigrationPendingEntrySchema = z.object({
@@ -88780,6 +88786,12 @@ var userManagementCapability = {
88780
88786
  mode: "singleton",
88781
88787
  methods: {
88782
88788
  listUsers: method(z.void(), z.array(UserSummarySchema), { auth: "admin" }),
88789
+ /**
88790
+ * Read-only: does an admin account still carry the first-boot password
88791
+ * (D728, D797)? One typed boolean; the password and its hash never leave
88792
+ * the hub. Backs the `setup_wizard` admin step.
88793
+ */
88794
+ getAdminBootstrapStatus: method(z.void(), z.object({ defaultPasswordInUse: z.boolean() }), { auth: "admin" }),
88783
88795
  createUser: method(CreateUserInputSchema, UserSummarySchema, {
88784
88796
  kind: "mutation",
88785
88797
  auth: "admin",
@@ -102184,6 +102196,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
102184
102196
  access: "view",
102185
102197
  role: "admin"
102186
102198
  },
102199
+ "userManagement.getAdminBootstrapStatus": {
102200
+ capName: "user-management",
102201
+ capScope: "system",
102202
+ addonId: null,
102203
+ access: "view",
102204
+ role: "admin"
102205
+ },
102187
102206
  "userManagement.getTotpStatus": {
102188
102207
  capName: "user-management",
102189
102208
  capScope: "system",
@@ -106804,6 +106823,98 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
106804
106823
  return [[descriptor.kind, field]];
106805
106824
  })));
106806
106825
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
106826
+ Object.freeze({
106827
+ contact: {
106828
+ starts: {
106829
+ en: "opened",
106830
+ it: "si apre"
106831
+ },
106832
+ finishes: {
106833
+ en: "closed",
106834
+ it: "si chiude"
106835
+ }
106836
+ },
106837
+ "motion-sensor": {
106838
+ starts: {
106839
+ en: "motion detected",
106840
+ it: "movimento rilevato"
106841
+ },
106842
+ finishes: {
106843
+ en: "motion stopped",
106844
+ it: "movimento terminato"
106845
+ }
106846
+ },
106847
+ smoke: {
106848
+ starts: {
106849
+ en: "smoke detected",
106850
+ it: "fumo rilevato"
106851
+ },
106852
+ finishes: {
106853
+ en: "smoke gone",
106854
+ it: "fumo scomparso"
106855
+ }
106856
+ },
106857
+ flood: {
106858
+ starts: {
106859
+ en: "water detected",
106860
+ it: "acqua rilevata"
106861
+ },
106862
+ finishes: {
106863
+ en: "dry again",
106864
+ it: "di nuovo asciutto"
106865
+ }
106866
+ },
106867
+ gas: {
106868
+ starts: {
106869
+ en: "gas detected",
106870
+ it: "gas rilevato"
106871
+ },
106872
+ finishes: {
106873
+ en: "gas gone",
106874
+ it: "gas scomparso"
106875
+ }
106876
+ },
106877
+ "carbon-monoxide": {
106878
+ starts: {
106879
+ en: "carbon monoxide detected",
106880
+ it: "monossido rilevato"
106881
+ },
106882
+ finishes: {
106883
+ en: "carbon monoxide gone",
106884
+ it: "monossido scomparso"
106885
+ }
106886
+ },
106887
+ vibration: {
106888
+ starts: {
106889
+ en: "vibration detected",
106890
+ it: "vibrazione rilevata"
106891
+ },
106892
+ finishes: {
106893
+ en: "vibration stopped",
106894
+ it: "vibrazione terminata"
106895
+ }
106896
+ },
106897
+ tamper: {
106898
+ starts: {
106899
+ en: "tampered with",
106900
+ it: "manomesso"
106901
+ },
106902
+ finishes: {
106903
+ en: "tamper cleared",
106904
+ it: "manomissione rientrata"
106905
+ }
106906
+ },
106907
+ "appliance-cycle": {
106908
+ starts: {
106909
+ en: "the cycle started",
106910
+ it: "il ciclo parte"
106911
+ },
106912
+ finishes: {
106913
+ en: "the cycle finished",
106914
+ it: "il ciclo è terminato"
106915
+ }
106916
+ }
106917
+ });
106807
106918
  z.object({
106808
106919
  phase: z.enum(["raised", "resolved"]),
106809
106920
  episodeId: z.string().min(1),
@@ -107069,6 +107180,7 @@ var STATE_SUMMARY_VARS = [
107069
107180
  [...RULE_TEXT],
107070
107181
  [...RULE_TEXT],
107071
107182
  [...RULE_TEXT],
107183
+ [...RULE_TEXT],
107072
107184
  ([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
107073
107185
  [...RULE_TEXT],
107074
107186
  [...RULE_TEXT],
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-BA0MvGtU.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-BLwgOIXb.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 { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-CJKZ2zXS.mjs";
1
+ import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-DM08Htuy.mjs";
2
2
  import { parentPort, threadId, workerData } from "node:worker_threads";
3
3
  //#region src/builtins/sqlite-storage/file-host-worker.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-D4jIqIYT.js");
2
+ const require_dist = require("./dist-B9xpybTG.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
- const require_agent_https = require("./agent-https-BnvFHfIE.js");
4
+ const require_agent_https = require("./agent-https-B1XLr4nm.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs_promises = require("node:fs/promises");
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
2
- import { Es as userError } from "./dist-AYmnm-Kz.mjs";
2
+ import { Es as userError } from "./dist-Cw8KtuQY.mjs";
3
3
  import { f as X509Certificate$1 } from "./x509.es-BRiJgOvu.mjs";
4
- import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-D0cOTQNv.mjs";
4
+ import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-BsedJhrb.mjs";
5
5
  import { X509Certificate, createPrivateKey } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
7
7
  import { mkdir, writeFile } from "node:fs/promises";