@camstack/system 1.2.15 → 1.2.16

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 (57) hide show
  1. package/dist/addon-runner.js +2 -2
  2. package/dist/addon-runner.mjs +2 -2
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +73 -2
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +73 -2
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  14. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  15. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  16. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  17. package/dist/builtins/hub-forwarder/index.js +1 -1
  18. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  19. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  20. package/dist/builtins/local-auth/local-auth.addon.mjs +3 -38
  21. package/dist/builtins/local-network/local-network.addon.js +1 -1
  22. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  23. package/dist/builtins/loki-logging/index.js +1 -1
  24. package/dist/builtins/loki-logging/index.mjs +1 -1
  25. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  26. package/dist/builtins/native-metrics/native-metrics.addon.mjs +2 -2
  27. package/dist/builtins/platform-probe/index.js +2 -2
  28. package/dist/builtins/platform-probe/index.mjs +3 -2
  29. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  30. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  31. package/dist/builtins/snapshot/index.js +1 -1
  32. package/dist/builtins/snapshot/index.mjs +1 -1
  33. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  34. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  35. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  36. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  37. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  38. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  39. package/dist/builtins/system-backup/system-backup.service.d.ts +14 -1
  40. package/dist/builtins/system-config/system-config.addon.js +1 -1
  41. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  42. package/dist/builtins/winston-logging/index.js +1 -1
  43. package/dist/builtins/winston-logging/index.mjs +1 -1
  44. package/dist/chunk-CNf5ZN-e.mjs +37 -0
  45. package/dist/{dist-yttC1aUI.js → dist-3AzhkmeY.js} +1325 -1129
  46. package/dist/{dist-eOaraBhT.mjs → dist-BU-QPlE8.mjs} +1325 -1129
  47. package/dist/framework-resolver-hook.mjs +2 -0
  48. package/dist/index.js +224 -32
  49. package/dist/index.mjs +227 -34
  50. package/dist/kernel/addon-installer.d.ts +86 -7
  51. package/dist/kernel/fs-utils.d.ts +18 -5
  52. package/dist/lib-5THG9eKz.mjs +15545 -0
  53. package/dist/lib-CZ3g2WTS.js +15549 -0
  54. package/dist/{manifest-python-deps-bn3qrsxR.mjs → manifest-python-deps-D7-WBIg_.mjs} +1 -1
  55. package/dist/{manifest-python-deps-DSrmih6E.js → manifest-python-deps-DRN3x53E.js} +1 -1
  56. package/dist/{resource-monitor-Le3l0qS2.mjs → resource-monitor-BkP504Vq.mjs} +1 -1
  57. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-yttC1aUI.js");
3
- const require_manifest_python_deps = require("./manifest-python-deps-DSrmih6E.js");
2
+ const require_dist = require("./dist-3AzhkmeY.js");
3
+ const require_manifest_python_deps = require("./manifest-python-deps-DRN3x53E.js");
4
4
  const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
5
5
  let node_fs = require("node:fs");
6
6
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,5 +1,5 @@
1
- import { N as isCollectionArrayMethod, t as ALL_CAPABILITY_DEFINITIONS } from "./dist-eOaraBhT.mjs";
2
- import { Ct as resolveAddonClass, I as createUdsLoggerWithControl, L as LocalChildClient, at as setWorkerNativeCapsChangeListener, bt as installManifestNativeDeps, i as createUdsAddonContext, nt as getWorkerNativeCapProvider, rt as getWorkerNativeCapSnapshot, st as validateProviderRegistrations, t as installManifestPythonDeps } from "./manifest-python-deps-bn3qrsxR.mjs";
1
+ import { N as isCollectionArrayMethod, t as ALL_CAPABILITY_DEFINITIONS } from "./dist-BU-QPlE8.mjs";
2
+ import { Ct as resolveAddonClass, I as createUdsLoggerWithControl, L as LocalChildClient, at as setWorkerNativeCapsChangeListener, bt as installManifestNativeDeps, i as createUdsAddonContext, nt as getWorkerNativeCapProvider, rt as getWorkerNativeCapSnapshot, st as validateProviderRegistrations, t as installManifestPythonDeps } from "./manifest-python-deps-D7-WBIg_.mjs";
3
3
  import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
4
4
  import { register } from "node:module";
5
5
  import * as fs from "node:fs";
@@ -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-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { Mt as EventCategory, ot as errMsg, p as addonPagesCapability, st as BaseAddon } from "../../dist-eOaraBhT.mjs";
1
+ import { Mt as EventCategory, ot as errMsg, p as addonPagesCapability, st as BaseAddon } from "../../dist-BU-QPlE8.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import * as fs from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -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-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { Mt as EventCategory, h as addonWidgetsCapability, ot as errMsg, st as BaseAddon } from "../../dist-eOaraBhT.mjs";
1
+ import { Mt as EventCategory, h as addonWidgetsCapability, ot as errMsg, st as BaseAddon } from "../../dist-BU-QPlE8.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import * as fs from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  //#region src/builtins/alerts/alerts.addon.ts
8
8
  var CATEGORY_MAPPINGS = {
9
9
  "addon.crashed": {
@@ -1,4 +1,4 @@
1
- import { Mt as EventCategory, bt as createEvent, g as alertsCapability, n as AlertSchema, ot as errMsg, st as BaseAddon } from "../../dist-eOaraBhT.mjs";
1
+ import { Mt as EventCategory, bt as createEvent, g as alertsCapability, n as AlertSchema, ot as errMsg, st as BaseAddon } from "../../dist-BU-QPlE8.mjs";
2
2
  //#region src/builtins/alerts/alerts.addon.ts
3
3
  var CATEGORY_MAPPINGS = {
4
4
  "addon.crashed": {
@@ -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-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  let node_fs = require("node:fs");
8
8
  let node_fs$1 = require_chunk.__toESM(node_fs, 1);
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -3102,6 +3102,7 @@ var SystemBackupService = class {
3102
3102
  }
3103
3103
  if (present.length === 0) throw new Error(`createArchive: no locations from {${requested.join(", ")}} exist under ${this.dataDir}`);
3104
3104
  node_fs.mkdirSync(node_path.dirname(opts.archivePath), { recursive: true });
3105
+ await this.checkpointDatabasesUnder(present);
3105
3106
  const entries = [];
3106
3107
  for (const loc of present) {
3107
3108
  const abs = node_path.join(this.dataDir, loc);
@@ -3156,7 +3157,48 @@ var SystemBackupService = class {
3156
3157
  };
3157
3158
  }
3158
3159
  /**
3159
- * Read the embedded manifest from a previously-created archive
3160
+ * Best-effort `wal_checkpoint(TRUNCATE)` on every live SQLite database
3161
+ * under the locations about to be archived. Discovers a DB by its
3162
+ * `-wal` sidecar (only WAL-mode DBs have one, and only those need
3163
+ * folding), opens a short-lived second connection — SQLite permits
3164
+ * concurrent connections, and a checkpoint is a supported concurrent
3165
+ * operation against the hub's live writer — checkpoints, and closes.
3166
+ *
3167
+ * Every failure is swallowed: a `SQLITE_BUSY`, a locked file, a
3168
+ * missing native binding, or a non-DB `.db` file must not fail the
3169
+ * backup. A residual WAL still restores correctly; the checkpoint is a
3170
+ * consistency *improvement*, not a precondition.
3171
+ */
3172
+ async checkpointDatabasesUnder(locations) {
3173
+ const dbPaths = /* @__PURE__ */ new Set();
3174
+ for (const loc of locations) await collectWalDatabases(node_path.isAbsolute(loc) ? loc : node_path.join(this.dataDir, loc), dbPaths);
3175
+ if (dbPaths.size === 0) return;
3176
+ let Database;
3177
+ try {
3178
+ Database = (await import("better-sqlite3")).default;
3179
+ } catch (err) {
3180
+ this.logger.warn("createArchive: better-sqlite3 unavailable — skipping WAL checkpoint", { meta: {
3181
+ error: err instanceof Error ? err.message : String(err),
3182
+ dbCount: dbPaths.size
3183
+ } });
3184
+ return;
3185
+ }
3186
+ for (const dbPath of dbPaths) try {
3187
+ const db = new Database(dbPath);
3188
+ try {
3189
+ db.pragma("wal_checkpoint(TRUNCATE)");
3190
+ } finally {
3191
+ db.close();
3192
+ }
3193
+ this.logger.debug("createArchive: checkpointed DB", { meta: { dbPath } });
3194
+ } catch (err) {
3195
+ this.logger.warn("createArchive: WAL checkpoint failed — archiving DB as-is", { meta: {
3196
+ dbPath,
3197
+ error: err instanceof Error ? err.message : String(err)
3198
+ } });
3199
+ }
3200
+ }
3201
+ /**
3160
3202
  * without extracting payload files. Streams the tar.gz, parses the
3161
3203
  * one entry we care about, then aborts.
3162
3204
  */
@@ -3276,6 +3318,35 @@ var SystemBackupService = class {
3276
3318
  }
3277
3319
  };
3278
3320
  /**
3321
+ * Recursively collect every SQLite database under `abs` that is in WAL
3322
+ * mode, identified by the presence of a `<db>-wal` sidecar. Only those
3323
+ * need a checkpoint; a rollback-journal DB has nothing to fold. Errors
3324
+ * (unreadable dir, broken symlink) are skipped silently — this feeds a
3325
+ * best-effort step.
3326
+ */
3327
+ async function collectWalDatabases(abs, out) {
3328
+ let stat;
3329
+ try {
3330
+ stat = await node_fs_promises.stat(abs);
3331
+ } catch {
3332
+ return;
3333
+ }
3334
+ if (stat.isDirectory()) {
3335
+ let children;
3336
+ try {
3337
+ children = await node_fs_promises.readdir(abs);
3338
+ } catch {
3339
+ return;
3340
+ }
3341
+ for (const child of children) await collectWalDatabases(node_path.join(abs, child), out);
3342
+ return;
3343
+ }
3344
+ if (abs.endsWith("-wal")) {
3345
+ const dbPath = abs.slice(0, -4);
3346
+ if (node_fs.existsSync(dbPath)) out.add(dbPath);
3347
+ }
3348
+ }
3349
+ /**
3279
3350
  * Recursively walk a directory and produce one `ArchiveEntry` per
3280
3351
  * filesystem node. `dataDir` is used to compute the archive-relative
3281
3352
  * path. Symlinks are dereferenced (matches the `follow: true` flag we
@@ -1,4 +1,4 @@
1
- import { Mt as EventCategory, st as BaseAddon, y as backupCapability } from "../../dist-eOaraBhT.mjs";
1
+ import { Mt as EventCategory, st as BaseAddon, y as backupCapability } from "../../dist-BU-QPlE8.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import Kt from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -3087,6 +3087,7 @@ var SystemBackupService = class {
3087
3087
  }
3088
3088
  if (present.length === 0) throw new Error(`createArchive: no locations from {${requested.join(", ")}} exist under ${this.dataDir}`);
3089
3089
  fs.mkdirSync(path$1.dirname(opts.archivePath), { recursive: true });
3090
+ await this.checkpointDatabasesUnder(present);
3090
3091
  const entries = [];
3091
3092
  for (const loc of present) {
3092
3093
  const abs = path$1.join(this.dataDir, loc);
@@ -3141,7 +3142,48 @@ var SystemBackupService = class {
3141
3142
  };
3142
3143
  }
3143
3144
  /**
3144
- * Read the embedded manifest from a previously-created archive
3145
+ * Best-effort `wal_checkpoint(TRUNCATE)` on every live SQLite database
3146
+ * under the locations about to be archived. Discovers a DB by its
3147
+ * `-wal` sidecar (only WAL-mode DBs have one, and only those need
3148
+ * folding), opens a short-lived second connection — SQLite permits
3149
+ * concurrent connections, and a checkpoint is a supported concurrent
3150
+ * operation against the hub's live writer — checkpoints, and closes.
3151
+ *
3152
+ * Every failure is swallowed: a `SQLITE_BUSY`, a locked file, a
3153
+ * missing native binding, or a non-DB `.db` file must not fail the
3154
+ * backup. A residual WAL still restores correctly; the checkpoint is a
3155
+ * consistency *improvement*, not a precondition.
3156
+ */
3157
+ async checkpointDatabasesUnder(locations) {
3158
+ const dbPaths = /* @__PURE__ */ new Set();
3159
+ for (const loc of locations) await collectWalDatabases(path$1.isAbsolute(loc) ? loc : path$1.join(this.dataDir, loc), dbPaths);
3160
+ if (dbPaths.size === 0) return;
3161
+ let Database;
3162
+ try {
3163
+ Database = (await import("better-sqlite3")).default;
3164
+ } catch (err) {
3165
+ this.logger.warn("createArchive: better-sqlite3 unavailable — skipping WAL checkpoint", { meta: {
3166
+ error: err instanceof Error ? err.message : String(err),
3167
+ dbCount: dbPaths.size
3168
+ } });
3169
+ return;
3170
+ }
3171
+ for (const dbPath of dbPaths) try {
3172
+ const db = new Database(dbPath);
3173
+ try {
3174
+ db.pragma("wal_checkpoint(TRUNCATE)");
3175
+ } finally {
3176
+ db.close();
3177
+ }
3178
+ this.logger.debug("createArchive: checkpointed DB", { meta: { dbPath } });
3179
+ } catch (err) {
3180
+ this.logger.warn("createArchive: WAL checkpoint failed — archiving DB as-is", { meta: {
3181
+ dbPath,
3182
+ error: err instanceof Error ? err.message : String(err)
3183
+ } });
3184
+ }
3185
+ }
3186
+ /**
3145
3187
  * without extracting payload files. Streams the tar.gz, parses the
3146
3188
  * one entry we care about, then aborts.
3147
3189
  */
@@ -3261,6 +3303,35 @@ var SystemBackupService = class {
3261
3303
  }
3262
3304
  };
3263
3305
  /**
3306
+ * Recursively collect every SQLite database under `abs` that is in WAL
3307
+ * mode, identified by the presence of a `<db>-wal` sidecar. Only those
3308
+ * need a checkpoint; a rollback-journal DB has nothing to fold. Errors
3309
+ * (unreadable dir, broken symlink) are skipped silently — this feeds a
3310
+ * best-effort step.
3311
+ */
3312
+ async function collectWalDatabases(abs, out) {
3313
+ let stat;
3314
+ try {
3315
+ stat = await fsp.stat(abs);
3316
+ } catch {
3317
+ return;
3318
+ }
3319
+ if (stat.isDirectory()) {
3320
+ let children;
3321
+ try {
3322
+ children = await fsp.readdir(abs);
3323
+ } catch {
3324
+ return;
3325
+ }
3326
+ for (const child of children) await collectWalDatabases(path$1.join(abs, child), out);
3327
+ return;
3328
+ }
3329
+ if (abs.endsWith("-wal")) {
3330
+ const dbPath = abs.slice(0, -4);
3331
+ if (fs.existsSync(dbPath)) out.add(dbPath);
3332
+ }
3333
+ }
3334
+ /**
3264
3335
  * Recursively walk a directory and produce one `ArchiveEntry` per
3265
3336
  * filesystem node. `dataDir` is used to compute the archive-relative
3266
3337
  * path. Symlinks are dereferenced (matches the `follow: true` flag we
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  //#region src/builtins/console-logging/console-destination.ts
9
9
  var LEVEL_RANK = {
@@ -1,4 +1,4 @@
1
- import { st as BaseAddon, z as logDestinationCapability } from "../../dist-eOaraBhT.mjs";
1
+ import { st as BaseAddon, z as logDestinationCapability } from "../../dist-BU-QPlE8.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  //#region src/builtins/console-logging/console-destination.ts
4
4
  var LEVEL_RANK = {
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  let _camstack_types_node = require("@camstack/types/node");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { C as deviceStatusCapability, D as enumerateSchemaFields, E as enumerateItemArrayFields, K as parseStreamParamsFormPatch, Mt as EventCategory, O as evaluateLinkExpression, S as deviceStateCapability, Tt as isDeviceConfigCap, W as normalizeUnit, Z as setByPath, _ as applyTransform, a as CAP_NAMES_WITH_STATUS, at as validateExpressionSource, b as buildStreamParamsConfigSchema, dt as DeviceFeature, ft as DeviceRole, gt as WELL_KNOWN_TAB_MAP, j as getByPath, jt as sleep, l as STREAM_PROFILE_META, o as DeviceStatusSchema, ot as errMsg, pt as DeviceType, rt as toExpressionValue, st as BaseAddon, t as ALL_CAPABILITY_DEFINITIONS, x as deviceManagerCapability } from "../../dist-eOaraBhT.mjs";
1
+ import { C as deviceStatusCapability, D as enumerateSchemaFields, E as enumerateItemArrayFields, K as parseStreamParamsFormPatch, Mt as EventCategory, O as evaluateLinkExpression, S as deviceStateCapability, Tt as isDeviceConfigCap, W as normalizeUnit, Z as setByPath, _ as applyTransform, a as CAP_NAMES_WITH_STATUS, at as validateExpressionSource, b as buildStreamParamsConfigSchema, dt as DeviceFeature, ft as DeviceRole, gt as WELL_KNOWN_TAB_MAP, j as getByPath, jt as sleep, l as STREAM_PROFILE_META, o as DeviceStatusSchema, ot as errMsg, pt as DeviceType, rt as toExpressionValue, st as BaseAddon, t as ALL_CAPABILITY_DEFINITIONS, x as deviceManagerCapability } from "../../dist-BU-QPlE8.mjs";
2
2
  import { canonicalDeviceFingerprint } from "@camstack/types/node";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  //#region src/builtins/doorbell/trigger-engine.ts
8
8
  /**
9
9
  * Pure trigger logic for the virtual-doorbell builtin — edge detection over
@@ -1,4 +1,4 @@
1
- import { Mt as EventCategory, bt as createEvent, ot as errMsg, pt as DeviceType, st as BaseAddon, w as doorbellCapability } from "../../dist-eOaraBhT.mjs";
1
+ import { Mt as EventCategory, bt as createEvent, ot as errMsg, pt as DeviceType, st as BaseAddon, w as doorbellCapability } from "../../dist-BU-QPlE8.mjs";
2
2
  //#region src/builtins/doorbell/trigger-engine.ts
3
3
  /**
4
4
  * Pure trigger logic for the virtual-doorbell builtin — edge detection over
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  //#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
9
9
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
@@ -1,4 +1,4 @@
1
- import { st as BaseAddon, z as logDestinationCapability } from "../../dist-eOaraBhT.mjs";
1
+ import { st as BaseAddon, z as logDestinationCapability } from "../../dist-BU-QPlE8.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  //#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
4
4
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
@@ -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-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  node_crypto = require_chunk.__toESM(node_crypto);
9
9
  let crypto$1 = require("crypto");
@@ -1,43 +1,8 @@
1
- import { f as UserRecordSchema, it as userManagementCapability, r as ApiKeyRecordSchema, st as BaseAddon, u as ScopedTokenSchema, v as authProviderCapability } from "../../dist-eOaraBhT.mjs";
2
- import { createRequire } from "node:module";
1
+ import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
+ import { f as UserRecordSchema, it as userManagementCapability, r as ApiKeyRecordSchema, st as BaseAddon, u as ScopedTokenSchema, v as authProviderCapability } from "../../dist-BU-QPlE8.mjs";
3
3
  import * as crypto$1 from "node:crypto";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import nodeCrypto from "crypto";
6
- //#region \0rolldown/runtime.js
7
- var __create = Object.create;
8
- var __defProp = Object.defineProperty;
9
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
- var __getOwnPropNames = Object.getOwnPropertyNames;
11
- var __getProtoOf = Object.getPrototypeOf;
12
- var __hasOwnProp = Object.prototype.hasOwnProperty;
13
- var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
14
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
15
- var __exportAll = (all, no_symbols) => {
16
- let target = {};
17
- for (var name in all) __defProp(target, name, {
18
- get: all[name],
19
- enumerable: true
20
- });
21
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
22
- return target;
23
- };
24
- var __copyProps = (to, from, except, desc) => {
25
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
26
- key = keys[i];
27
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
28
- get: ((k) => from[k]).bind(null, key),
29
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
30
- });
31
- }
32
- return to;
33
- };
34
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
35
- value: mod,
36
- enumerable: true
37
- }) : target, mod));
38
- var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
39
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
40
- //#endregion
41
6
  //#region ../../node_modules/safe-buffer/index.js
42
7
  var require_safe_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43
8
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
@@ -9575,4 +9540,4 @@ var LocalAuthAddon = class extends BaseAddon {
9575
9540
  }
9576
9541
  };
9577
9542
  //#endregion
9578
- export { LocalAuthAddon, LocalAuthAddon as default, require_ms as a, __esmMin as c, __toCommonJS as d, __toESM as f, AuthManager as i, __exportAll as l, ApiKeyManager as n, require_safe_buffer as o, UserManager as r, __commonJSMin as s, ScopedTokenManager as t, __require as u };
9543
+ export { LocalAuthAddon, LocalAuthAddon as default, require_ms as a, AuthManager as i, ApiKeyManager as n, require_safe_buffer as o, UserManager as r, ScopedTokenManager as t };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-yttC1aUI.js");
3
+ const require_dist = require("../../dist-3AzhkmeY.js");
4
4
  let node_os = require("node:os");
5
5
  node_os = require_chunk.__toESM(node_os);
6
6
  //#region src/builtins/local-network/local-network.addon.ts
@@ -1,4 +1,4 @@
1
- import { Mt as EventCategory, R as localNetworkCapability, st as BaseAddon } from "../../dist-eOaraBhT.mjs";
1
+ import { Mt as EventCategory, R as localNetworkCapability, st as BaseAddon } from "../../dist-BU-QPlE8.mjs";
2
2
  import * as os from "node:os";
3
3
  //#region src/builtins/local-network/local-network.addon.ts
4
4
  /**
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  //#region src/builtins/loki-logging/loki-payload.ts
8
8
  /**
9
9
  * Loki rejects a label name that is not a valid Prometheus label
@@ -1,4 +1,4 @@
1
- import { st as BaseAddon, z as logDestinationCapability } from "../../dist-eOaraBhT.mjs";
1
+ import { st as BaseAddon, z as logDestinationCapability } from "../../dist-BU-QPlE8.mjs";
2
2
  //#region src/builtins/loki-logging/loki-payload.ts
3
3
  /**
4
4
  * Loki rejects a label name that is not a valid Prometheus label
@@ -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-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_chunk.__toESM(node_fs);
9
9
  let node_child_process = require("node:child_process");
@@ -1,4 +1,4 @@
1
- import { H as metricsProviderCapability, Mt as EventCategory, bt as createEvent, st as BaseAddon } from "../../dist-eOaraBhT.mjs";
1
+ import { H as metricsProviderCapability, Mt as EventCategory, bt as createEvent, st as BaseAddon } from "../../dist-BU-QPlE8.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import { execFile, execFileSync } from "node:child_process";
4
4
  import { promisify } from "node:util";
@@ -116,7 +116,7 @@ var NativeMetricsProvider = class {
116
116
  return getCpuTemperatureInternal();
117
117
  }
118
118
  async getProcessStats(input) {
119
- const { getPidStats } = await import("../../resource-monitor-Le3l0qS2.mjs").then((n) => n.r);
119
+ const { getPidStats } = await import("../../resource-monitor-BkP504Vq.mjs").then((n) => n.r);
120
120
  const raw = await getPidStats(input.pids);
121
121
  const result = [];
122
122
  for (const [pid, s] of raw) result.push({
@@ -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-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_chunk.__toESM(node_fs);
9
9
  let node_child_process = require("node:child_process");
@@ -88,7 +88,7 @@ var noopLogger = {
88
88
  */
89
89
  async function getAvailableRAM_MB() {
90
90
  try {
91
- const mem = await (await import("systeminformation")).mem();
91
+ const mem = await (await Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require("../../lib-CZ3g2WTS.js").default))).mem();
92
92
  return Math.round(mem.available / 1024 / 1024);
93
93
  } catch (err) {
94
94
  console.debug(`systeminformation not available, using platform-specific RAM probe: ${require_dist.errMsg(err)}`);
@@ -1,4 +1,5 @@
1
- import { Mt as EventCategory, St as emitReadiness, T as enumerateInferenceDevices, X as scoreRuntimes, ot as errMsg, q as platformProbeCapability, st as BaseAddon } from "../../dist-eOaraBhT.mjs";
1
+ import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
2
+ import { Mt as EventCategory, St as emitReadiness, T as enumerateInferenceDevices, X as scoreRuntimes, ot as errMsg, q as platformProbeCapability, st as BaseAddon } from "../../dist-BU-QPlE8.mjs";
2
3
  import * as fs from "node:fs";
3
4
  import { execFile } from "node:child_process";
4
5
  import { promisify } from "node:util";
@@ -81,7 +82,7 @@ var noopLogger = {
81
82
  */
82
83
  async function getAvailableRAM_MB() {
83
84
  try {
84
- const mem = await (await import("systeminformation")).mem();
85
+ const mem = await (await import("../../lib-5THG9eKz.mjs").then((m) => /* @__PURE__ */ __toESM(m.default))).mem();
85
86
  return Math.round(mem.available / 1024 / 1024);
86
87
  } catch (err) {
87
88
  console.debug(`systeminformation not available, using platform-specific RAM probe: ${errMsg(err)}`);
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
8
8
  /**
9
9
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -1,4 +1,4 @@
1
- import { Mt as EventCategory, st as BaseAddon } from "../../dist-eOaraBhT.mjs";
1
+ import { Mt as EventCategory, st as BaseAddon } from "../../dist-BU-QPlE8.mjs";
2
2
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
3
3
  /**
4
4
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  let node_child_process = require("node:child_process");
8
8
  //#region src/builtins/snapshot/snapshot-coalescing.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { $ as snapshotCapability, U as nodePin, dt as DeviceFeature, i as BatteryStatusSchema, nt as streamQualityLabel, ot as errMsg, pt as DeviceType, st as BaseAddon } from "../../dist-eOaraBhT.mjs";
1
+ import { $ as snapshotCapability, U as nodePin, dt as DeviceFeature, i as BatteryStatusSchema, nt as streamQualityLabel, ot as errMsg, pt as DeviceType, st as BaseAddon } from "../../dist-BU-QPlE8.mjs";
2
2
  import { execFile } from "node:child_process";
3
3
  //#region src/builtins/snapshot/snapshot-coalescing.ts
4
4
  /**
@@ -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-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_chunk.__toESM(node_fs);
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { A as filesystemBrowseCapability, st as BaseAddon, tt as storageProviderCapability } from "../../dist-eOaraBhT.mjs";
1
+ import { A as filesystemBrowseCapability, st as BaseAddon, tt as storageProviderCapability } from "../../dist-BU-QPlE8.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import * as path$1 from "node:path";
4
4
  import { basename, dirname, join, resolve, sep } from "node:path";
@@ -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-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let better_sqlite3 = require("better-sqlite3");
9
9
  better_sqlite3 = require_chunk.__toESM(better_sqlite3);
@@ -1,4 +1,4 @@
1
- import { Dt as parseJsonUnknown, Q as settingsStoreCapability, _t as asJsonObject, c as RUNTIME_DEFAULTS, ot as errMsg, st as BaseAddon } from "../../dist-eOaraBhT.mjs";
1
+ import { Dt as parseJsonUnknown, Q as settingsStoreCapability, _t as asJsonObject, c as RUNTIME_DEFAULTS, ot as errMsg, st as BaseAddon } from "../../dist-BU-QPlE8.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import Database from "better-sqlite3";
4
4
  //#region src/builtins/sqlite-storage/sqlite-settings-backend.ts
@@ -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-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  let node_path = require("node:path");
8
8
  node_path = require_chunk.__toESM(node_path);
9
9
  let node_fs_promises = require("node:fs/promises");
@@ -1,4 +1,4 @@
1
- import { Et as parseJsonObject, d as StorageLocationTypeSchema, et as storageCapability, st as BaseAddon } from "../../dist-eOaraBhT.mjs";
1
+ import { Et as parseJsonObject, d as StorageLocationTypeSchema, et as storageCapability, st as BaseAddon } from "../../dist-BU-QPlE8.mjs";
2
2
  import * as path$1 from "node:path";
3
3
  import * as fs from "node:fs/promises";
4
4
  import { buildStorageLocationRegistry } from "@camstack/system";
@@ -115,7 +115,20 @@ export declare class SystemBackupService {
115
115
  locations?: readonly string[];
116
116
  }): Promise<CreateArchiveResult>;
117
117
  /**
118
- * Read the embedded manifest from a previously-created archive
118
+ * Best-effort `wal_checkpoint(TRUNCATE)` on every live SQLite database
119
+ * under the locations about to be archived. Discovers a DB by its
120
+ * `-wal` sidecar (only WAL-mode DBs have one, and only those need
121
+ * folding), opens a short-lived second connection — SQLite permits
122
+ * concurrent connections, and a checkpoint is a supported concurrent
123
+ * operation against the hub's live writer — checkpoints, and closes.
124
+ *
125
+ * Every failure is swallowed: a `SQLITE_BUSY`, a locked file, a
126
+ * missing native binding, or a non-DB `.db` file must not fail the
127
+ * backup. A residual WAL still restores correctly; the checkpoint is a
128
+ * consistency *improvement*, not a precondition.
129
+ */
130
+ private checkpointDatabasesUnder;
131
+ /**
119
132
  * without extracting payload files. Streams the tar.gz, parses the
120
133
  * one entry we care about, then aborts.
121
134
  */
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-yttC1aUI.js");
6
+ const require_dist = require("../../dist-3AzhkmeY.js");
7
7
  //#region src/builtins/system-config/system-config.addon.ts
8
8
  /**
9
9
  * Built-in `system-config` addon — Phase 4 of the settings redesign.