@camstack/system 1.2.125 → 1.2.127

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 (59) hide show
  1. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  2. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  3. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/alerts/alerts.addon.js +1 -1
  6. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  7. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  8. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  9. package/dist/builtins/console-logging/index.js +1 -1
  10. package/dist/builtins/console-logging/index.mjs +1 -1
  11. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  12. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  13. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  14. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  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/liveness-monitor/liveness-monitor.addon.js +1 -1
  20. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  21. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  22. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  23. package/dist/builtins/local-network/local-network.addon.js +1 -1
  24. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  25. package/dist/builtins/loki-logging/index.js +1 -1
  26. package/dist/builtins/loki-logging/index.mjs +1 -1
  27. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  28. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  29. package/dist/builtins/platform-probe/index.js +1 -1
  30. package/dist/builtins/platform-probe/index.mjs +1 -1
  31. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  32. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  33. package/dist/builtins/snapshot/index.js +1 -1
  34. package/dist/builtins/snapshot/index.mjs +1 -1
  35. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  36. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  37. package/dist/builtins/sqlite-storage/index.d.ts +3 -1
  38. package/dist/builtins/sqlite-storage/index.js +11 -2
  39. package/dist/builtins/sqlite-storage/index.mjs +2 -2
  40. package/dist/builtins/sqlite-storage/query-profiler.d.ts +138 -0
  41. package/dist/builtins/sqlite-storage/sqlite-pragmas.d.ts +23 -2
  42. package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +31 -0
  43. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  44. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  45. package/dist/builtins/sqlite-storage/vector-index-vec.d.ts +10 -0
  46. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  47. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  48. package/dist/builtins/system-config/system-config.addon.js +1 -1
  49. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  50. package/dist/builtins/winston-logging/index.js +1 -1
  51. package/dist/builtins/winston-logging/index.mjs +1 -1
  52. package/dist/{dist-CvJrtLkw.mjs → dist-BUEU7B1V.mjs} +26 -4
  53. package/dist/{dist-CIDgcxPk.js → dist-DqcaE-k1.js} +26 -4
  54. package/dist/index.js +3 -2
  55. package/dist/index.mjs +3 -2
  56. package/dist/kernel/moleculer/runner-native-allocator.d.ts +1 -1
  57. package/dist/{retired-settings-keys-B1aZcoS0.mjs → retired-settings-keys-BhPleRL7.mjs} +1 -1
  58. package/dist/{retired-settings-keys-D7c0n9jO.js → retired-settings-keys-KZnmtfsh.js} +1 -1
  59. 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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Gt as EventCategory, v as addonPagesCapability, vt as errMsg, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { Gt as EventCategory, v as addonPagesCapability, vt as errMsg, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Gt as EventCategory, b as addonWidgetsCapability, vt as errMsg, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { Gt as EventCategory, b as addonWidgetsCapability, vt as errMsg, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
7
  //#region src/builtins/alerts/prune-policy.ts
8
8
  /**
9
9
  * Ids older than `cutoffMs`, oldest first.
@@ -1,4 +1,4 @@
1
- import { Gt as EventCategory, Mt as createEvent, n as AlertSchema, vt as errMsg, x as alertsCapability, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { Gt as EventCategory, Mt as createEvent, n as AlertSchema, vt as errMsg, x as alertsCapability, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  //#region src/builtins/alerts/prune-policy.ts
3
3
  /**
4
4
  * Ids older than `cutoffMs`, oldest first.
@@ -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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let buffer = require("buffer");
9
9
  let node_fs_promises = require("node:fs/promises");
@@ -1,4 +1,4 @@
1
- import { C as backupCapability, Gt as EventCategory, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { C as backupCapability, Gt as EventCategory, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  import { randomBytes, randomUUID } from "node:crypto";
3
3
  import { Buffer as Buffer$1 } from "buffer";
4
4
  import * as fsp from "node:fs/promises";
@@ -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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.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 { X as logDestinationCapability, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { X as logDestinationCapability, yt as BaseAddon } from "../../dist-BUEU7B1V.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 = {
@@ -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-CIDgcxPk.js");
3
+ const require_dist = require("../../dist-DqcaE-k1.js");
4
4
  let node_crypto = require("node:crypto");
5
5
  let node_fs_promises = require("node:fs/promises");
6
6
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
@@ -1,4 +1,4 @@
1
- import { D as coreBlockAddonId, O as coreBlockIdFromAddonId, c as CoreBlockSchema, k as coreBlocksCapability, l as DeclaredDevices, o as CORE_BLOCKS_ADDON_ID, s as CORE_BLOCK_ADDON_PREFIX, vt as errMsg, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { D as coreBlockAddonId, O as coreBlockIdFromAddonId, c as CoreBlockSchema, k as coreBlocksCapability, l as DeclaredDevices, o as CORE_BLOCKS_ADDON_ID, s as CORE_BLOCK_ADDON_PREFIX, vt as errMsg, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import * as fs from "node:fs/promises";
4
4
  import * as path$1 from "node:path";
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CIDgcxPk.js");
7
- const require_retired_settings_keys = require("../../retired-settings-keys-D7c0n9jO.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
+ const require_retired_settings_keys = require("../../retired-settings-keys-KZnmtfsh.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let _camstack_types_node = require("@camstack/types/node");
10
10
  //#region src/builtins/device-manager/adoption-job-engine.ts
@@ -1,5 +1,5 @@
1
- import { Ct as DeviceFeature, E as buildStreamParamsConfigSchema, F as deviceStatusCapability, Gt as EventCategory, Lt as isDeviceConfigCap, N as deviceManagerCapability, Ot as WELL_KNOWN_TAB_MAP, P as deviceStateCapability, R as enumerateItemArrayFields, Tt as DeviceType, Wt as sleep, a as CAP_NAMES_WITH_STATUS, at as runtimeStatePolicyFor, et as normalizeUnit, nt as parseStreamParamsFormPatch, p as STREAM_PROFILE_META, t as ALL_CAPABILITY_DEFINITIONS, u as DeviceStatusSchema, vt as errMsg, wt as DeviceRole, yt as BaseAddon, z as enumerateSchemaFields } from "../../dist-CvJrtLkw.mjs";
2
- import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-B1aZcoS0.mjs";
1
+ import { Ct as DeviceFeature, E as buildStreamParamsConfigSchema, F as deviceStatusCapability, Gt as EventCategory, Lt as isDeviceConfigCap, N as deviceManagerCapability, Ot as WELL_KNOWN_TAB_MAP, P as deviceStateCapability, R as enumerateItemArrayFields, Tt as DeviceType, Wt as sleep, a as CAP_NAMES_WITH_STATUS, at as runtimeStatePolicyFor, et as normalizeUnit, nt as parseStreamParamsFormPatch, p as STREAM_PROFILE_META, t as ALL_CAPABILITY_DEFINITIONS, u as DeviceStatusSchema, vt as errMsg, wt as DeviceRole, yt as BaseAddon, z as enumerateSchemaFields } from "../../dist-BUEU7B1V.mjs";
2
+ import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-BhPleRL7.mjs";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { canonicalDeviceFingerprint } from "@camstack/types/node";
5
5
  //#region src/builtins/device-manager/adoption-job-engine.ts
@@ -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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.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 { G as isSameAddonId, Gt as EventCategory, I as doorbellCapability, Mt as createEvent, Tt as DeviceType, vt as errMsg, w as bareAddonId, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { G as isSameAddonId, Gt as EventCategory, I as doorbellCapability, Mt as createEvent, Tt as DeviceType, vt as errMsg, w as bareAddonId, yt as BaseAddon } from "../../dist-BUEU7B1V.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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.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 { X as logDestinationCapability, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { X as logDestinationCapability, yt as BaseAddon } from "../../dist-BUEU7B1V.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;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-CIDgcxPk.js");
3
+ const require_dist = require("../../dist-DqcaE-k1.js");
4
4
  //#region src/builtins/liveness-monitor/liveness-checks.ts
5
5
  var NO_DEVICES = "liveness:no-devices";
6
6
  var ALL_OFFLINE = "liveness:all-devices-offline";
@@ -1,4 +1,4 @@
1
- import { Gt as EventCategory, Mt as createEvent, vt as errMsg, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { Gt as EventCategory, Mt as createEvent, vt as errMsg, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  //#region src/builtins/liveness-monitor/liveness-checks.ts
3
3
  var NO_DEVICES = "liveness:no-devices";
4
4
  var ALL_OFFLINE = "liveness:all-devices-offline";
@@ -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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.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,5 +1,5 @@
1
1
  import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { S as authProviderCapability, _ as UserRecordSchema, ht as userManagementCapability, m as ScopedTokenSchema, r as ApiKeyRecordSchema, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
2
+ import { S as authProviderCapability, _ as UserRecordSchema, ht as userManagementCapability, m as ScopedTokenSchema, r as ApiKeyRecordSchema, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
3
3
  import * as crypto$2 from "node:crypto";
4
4
  import { createHash, randomUUID, timingSafeEqual } from "node:crypto";
5
5
  import nodeCrypto from "crypto";
@@ -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-CIDgcxPk.js");
3
+ const require_dist = require("../../dist-DqcaE-k1.js");
4
4
  const require_lan_http_bind = require("../../lan-http-bind-DmgpFP6_.js");
5
5
  let node_fs_promises = require("node:fs/promises");
6
6
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Gt as EventCategory, Y as localNetworkCapability, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { Gt as EventCategory, Y as localNetworkCapability, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  import { c as readExtraSans, d as writeExtraSans, f as writeTlsMode, g as reissueTlsLeaf, l as readTlsAccessStatus, m as ensureTlsCert, o as readLanHttpState, p as validateUploadedTls, r as applyLanHttp, t as DEFAULT_LAN_HTTP_PORT, u as readTlsMode } from "../../lan-http-bind-jKrj6OjQ.mjs";
3
3
  import { mkdir, writeFile } from "node:fs/promises";
4
4
  import { join } 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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.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 { X as logDestinationCapability, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { X as logDestinationCapability, yt as BaseAddon } from "../../dist-BUEU7B1V.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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
7
  let node_child_process = require("node:child_process");
8
8
  let node_util = require("node:util");
9
9
  let node_os = require("node:os");
@@ -1,4 +1,4 @@
1
- import { $ as metricsProviderCapability, Gt as EventCategory, Mt as createEvent, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { $ as metricsProviderCapability, Gt as EventCategory, Mt as createEvent, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  import { execFile, execFileSync } from "node:child_process";
3
3
  import { promisify } from "node:util";
4
4
  import * as os from "node:os";
@@ -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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
7
  let node_child_process = require("node:child_process");
8
8
  let node_util = require("node:util");
9
9
  let node_os = require("node:os");
@@ -1,5 +1,5 @@
1
1
  import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
2
- import { Gt as EventCategory, L as enumerateInferenceDevices, Pt as emitReadiness, ct as scoreRuntimes, rt as platformProbeCapability, vt as errMsg, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
2
+ import { Gt as EventCategory, L as enumerateInferenceDevices, Pt as emitReadiness, ct as scoreRuntimes, rt as platformProbeCapability, vt as errMsg, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
3
3
  import { execFile } from "node:child_process";
4
4
  import { promisify } from "node:util";
5
5
  import * as os from "node:os";
@@ -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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.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 { Gt as EventCategory, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { Gt as EventCategory, yt as BaseAddon } from "../../dist-BUEU7B1V.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
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
7
  let zod = require("zod");
8
8
  let node_crypto = require("node:crypto");
9
9
  let _camstack_types_node = require("@camstack/types/node");
@@ -1,4 +1,4 @@
1
- import { Ct as DeviceFeature, Gt as EventCategory, M as deriveBatteryPresence, Rt as nodePin, T as batteryCapability, Tt as DeviceType, i as BatteryStatusSchema, mt as streamQualityLabel, ut as snapshotCapability, vt as errMsg, w as bareAddonId, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { Ct as DeviceFeature, Gt as EventCategory, M as deriveBatteryPresence, Rt as nodePin, T as batteryCapability, Tt as DeviceType, i as BatteryStatusSchema, mt as streamQualityLabel, ut as snapshotCapability, vt as errMsg, w as bareAddonId, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  import { z } from "zod";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { signExpiringUrl, verifyExpiringUrl } from "@camstack/types/node";
@@ -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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_fs_promises = require("node:fs/promises");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { V as filesystemBrowseCapability, pt as storageProviderCapability, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { V as filesystemBrowseCapability, pt as storageProviderCapability, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,9 @@ export type { DeviceRow } from './device-store.js';
3
3
  export { DeviceStore } from './device-store.js';
4
4
  export { FilesystemStorageAddon, FilesystemStorageAddon as default, } from './filesystem-storage.addon.js';
5
5
  export { FilesystemStorageProvider } from './filesystem-storage-provider.js';
6
- export { SQLITE_JOURNAL_SIZE_LIMIT_BYTES, SQLITE_MMAP_SIZE_BYTES, SQLITE_PAGE_CACHE_KIB, } from './sqlite-pragmas.js';
6
+ export type { SqliteOpLabel, SqliteOpSample, SqliteOpStat } from './query-profiler.js';
7
+ export { SQLITE_PROFILE_REPORT_FLOOR_MS, SQLITE_PROFILE_REPORT_INTERVAL_MS, SQLITE_PROFILE_TOP_N, SQLITE_SLOW_CALL_MS, SqliteOpProfiler, } from './query-profiler.js';
8
+ export { SQLITE_JOURNAL_SIZE_LIMIT_BYTES, SQLITE_MMAP_CEILING_BYTES, SQLITE_MMAP_FLOOR_BYTES, SQLITE_PAGE_CACHE_CEILING_KIB, SQLITE_PAGE_CACHE_FLOOR_KIB, sqliteMmapSizeFor, sqlitePageCacheKibFor, } from './sqlite-pragmas.js';
7
9
  export { SqliteSettingsAddon } from './sqlite-settings.addon.js';
8
10
  export { SqliteSettingsBackend } from './sqlite-settings-backend.js';
9
11
  export type { WalMaintenanceOptions, WalMaintenanceOutcome } from './wal-maintenance.js';
@@ -58,8 +58,15 @@ exports.DeviceStore$1 = DeviceStore;
58
58
  exports.FilesystemStorageAddon = require_builtins_sqlite_storage_filesystem_storage_addon.FilesystemStorageAddon;
59
59
  exports.FilesystemStorageProvider = require_builtins_sqlite_storage_filesystem_storage_addon.FilesystemStorageProvider;
60
60
  exports.SQLITE_JOURNAL_SIZE_LIMIT_BYTES = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_JOURNAL_SIZE_LIMIT_BYTES;
61
- exports.SQLITE_MMAP_SIZE_BYTES = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_MMAP_SIZE_BYTES;
62
- exports.SQLITE_PAGE_CACHE_KIB = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_PAGE_CACHE_KIB;
61
+ exports.SQLITE_MMAP_CEILING_BYTES = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_MMAP_CEILING_BYTES;
62
+ exports.SQLITE_MMAP_FLOOR_BYTES = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_MMAP_FLOOR_BYTES;
63
+ exports.SQLITE_PAGE_CACHE_CEILING_KIB = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_PAGE_CACHE_CEILING_KIB;
64
+ exports.SQLITE_PAGE_CACHE_FLOOR_KIB = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_PAGE_CACHE_FLOOR_KIB;
65
+ exports.SQLITE_PROFILE_REPORT_FLOOR_MS = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_PROFILE_REPORT_FLOOR_MS;
66
+ exports.SQLITE_PROFILE_REPORT_INTERVAL_MS = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_PROFILE_REPORT_INTERVAL_MS;
67
+ exports.SQLITE_PROFILE_TOP_N = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_PROFILE_TOP_N;
68
+ exports.SQLITE_SLOW_CALL_MS = require_builtins_sqlite_storage_sqlite_settings_addon.SQLITE_SLOW_CALL_MS;
69
+ exports.SqliteOpProfiler = require_builtins_sqlite_storage_sqlite_settings_addon.SqliteOpProfiler;
63
70
  exports.SqliteSettingsAddon = require_builtins_sqlite_storage_sqlite_settings_addon.SqliteSettingsAddon;
64
71
  exports.SqliteSettingsBackend = require_builtins_sqlite_storage_sqlite_settings_addon.SqliteSettingsBackend;
65
72
  exports.WAL_CHECKPOINT_BUSY_TIMEOUT_MS = require_builtins_sqlite_storage_sqlite_settings_addon.WAL_CHECKPOINT_BUSY_TIMEOUT_MS;
@@ -68,3 +75,5 @@ exports.WAL_IDLE_QUIET_MS = require_builtins_sqlite_storage_sqlite_settings_addo
68
75
  exports.WAL_MAINTENANCE_INTERVAL_MS = require_builtins_sqlite_storage_sqlite_settings_addon.WAL_MAINTENANCE_INTERVAL_MS;
69
76
  exports.WalMaintenance = require_builtins_sqlite_storage_sqlite_settings_addon.WalMaintenance;
70
77
  exports.default = require_builtins_sqlite_storage_filesystem_storage_addon.FilesystemStorageAddon;
78
+ exports.sqliteMmapSizeFor = require_builtins_sqlite_storage_sqlite_settings_addon.sqliteMmapSizeFor;
79
+ exports.sqlitePageCacheKibFor = require_builtins_sqlite_storage_sqlite_settings_addon.sqlitePageCacheKibFor;
@@ -1,5 +1,5 @@
1
1
  import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./filesystem-storage.addon.mjs";
2
- import { SqliteSettingsAddon, a as WalMaintenance, c as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, i as WAL_MAINTENANCE_INTERVAL_MS, l as SQLITE_MMAP_SIZE_BYTES, n as WAL_HIGH_WATER_BYTES, o as SqliteSettingsBackend, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, u as SQLITE_PAGE_CACHE_KIB } from "./sqlite-settings.addon.mjs";
2
+ import { SqliteSettingsAddon, _ as SQLITE_PROFILE_TOP_N, a as WalMaintenance, c as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, d as SQLITE_PAGE_CACHE_CEILING_KIB, f as SQLITE_PAGE_CACHE_FLOOR_KIB, g as SQLITE_PROFILE_REPORT_INTERVAL_MS, h as SQLITE_PROFILE_REPORT_FLOOR_MS, i as WAL_MAINTENANCE_INTERVAL_MS, l as SQLITE_MMAP_CEILING_BYTES, m as sqlitePageCacheKibFor, n as WAL_HIGH_WATER_BYTES, o as SqliteSettingsBackend, p as sqliteMmapSizeFor, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, u as SQLITE_MMAP_FLOOR_BYTES, v as SQLITE_SLOW_CALL_MS, y as SqliteOpProfiler } from "./sqlite-settings.addon.mjs";
3
3
  //#region src/builtins/sqlite-storage/config-store.ts
4
4
  var ConfigStore = class {
5
5
  db;
@@ -46,4 +46,4 @@ var DeviceStore = class {
46
46
  }
47
47
  };
48
48
  //#endregion
49
- export { ConfigStore, DeviceStore, FilesystemStorageAddon, FilesystemStorageAddon as default, FilesystemStorageProvider, SQLITE_JOURNAL_SIZE_LIMIT_BYTES, SQLITE_MMAP_SIZE_BYTES, SQLITE_PAGE_CACHE_KIB, SqliteSettingsAddon, SqliteSettingsBackend, WAL_CHECKPOINT_BUSY_TIMEOUT_MS, WAL_HIGH_WATER_BYTES, WAL_IDLE_QUIET_MS, WAL_MAINTENANCE_INTERVAL_MS, WalMaintenance };
49
+ export { ConfigStore, DeviceStore, FilesystemStorageAddon, FilesystemStorageAddon as default, FilesystemStorageProvider, SQLITE_JOURNAL_SIZE_LIMIT_BYTES, SQLITE_MMAP_CEILING_BYTES, SQLITE_MMAP_FLOOR_BYTES, SQLITE_PAGE_CACHE_CEILING_KIB, SQLITE_PAGE_CACHE_FLOOR_KIB, SQLITE_PROFILE_REPORT_FLOOR_MS, SQLITE_PROFILE_REPORT_INTERVAL_MS, SQLITE_PROFILE_TOP_N, SQLITE_SLOW_CALL_MS, SqliteOpProfiler, SqliteSettingsAddon, SqliteSettingsBackend, WAL_CHECKPOINT_BUSY_TIMEOUT_MS, WAL_HIGH_WATER_BYTES, WAL_IDLE_QUIET_MS, WAL_MAINTENANCE_INTERVAL_MS, WalMaintenance, sqliteMmapSizeFor, sqlitePageCacheKibFor };
@@ -0,0 +1,138 @@
1
+ import { IScopedLogger } from '@camstack/types';
2
+ /**
3
+ * Per-operation timing for the synchronous SQLite engine.
4
+ *
5
+ * ## Why this exists
6
+ *
7
+ * `hub/sqlite-settings` is a forked runner with ONE JS thread and a
8
+ * **synchronous** SQLite binding: every statement it executes stops the event
9
+ * loop for the whole of its duration, and every configuration read in the
10
+ * cluster queues behind it. On 2026-08-25 that runner reported
11
+ * `loopMax=68283ms` while the container had zero memory pressure
12
+ * (`memory.events max` 0/min, cgroup 16-20 GB of 24) and the NVMe was idle
13
+ * (`%util` 1.5-8%, `r_await` 0.14 ms) — so neither of the two previously known
14
+ * causes applied, and there was **not one line in the log saying what the
15
+ * runner was doing**. Diagnosis fell back to sampling `/proc/<pid>/syscall`
16
+ * from the host, which is not a thing an operator can be asked to do.
17
+ *
18
+ * A 120 s census of the runner's main thread (2 216 samples at 54 ms) read
19
+ * `D=41% R=50% S=9%` against 13.9 s of CPU: the thread was blocked in
20
+ * `pread64 → filemap_read → folio_wait_bit_common` — synchronous 4 KiB page-ins
21
+ * on `camstack.db` — for two fifths of wall-clock, at a sustained 418 read
22
+ * syscalls per second. What it could NOT say is which query issued them.
23
+ *
24
+ * ## Why an aggregate, and not only a slow-query log
25
+ *
26
+ * The 68 s stall was **not** one 68 s statement. At 418 page reads per second
27
+ * the cost is spread across many statements that are each individually
28
+ * unremarkable, so a threshold-only log would have reported nothing at all
29
+ * while the loop sat still. {@link SqliteOpProfiler.report} therefore prints
30
+ * the window's busiest `(op, collection)` pairs and the share of wall-clock
31
+ * the engine spent inside SQLite — the number that says "this runner is
32
+ * saturated" even when no single call is.
33
+ *
34
+ * The slow-call WARN is kept for the other shape of the same failure: one
35
+ * statement that really does take seconds. Both are needed; neither is
36
+ * sufficient.
37
+ *
38
+ * ## Cost
39
+ *
40
+ * Two `Date.now()` calls and one `Map` lookup per statement. At the measured
41
+ * live rate (a few hundred statements/s) that is far below the noise floor of
42
+ * the work being measured — and unlike a sampling profiler it is always on,
43
+ * which is the point: the stall that matters is the one nobody was watching.
44
+ */
45
+ /**
46
+ * A single statement whose duration is being recorded.
47
+ *
48
+ * `rows` is "rows touched" — returned by a read, affected by a write. It is
49
+ * what separates "this query is slow because it is scanning" from "this query
50
+ * is slow because the disk is".
51
+ */
52
+ export interface SqliteOpSample {
53
+ /** Backend method that ran the statement: `query`, `count`, `set`, … */
54
+ readonly op: string;
55
+ /** Scoped table name (`<namespace>:<collection>`), never a device name. */
56
+ readonly collection: string;
57
+ readonly durationMs: number;
58
+ readonly rows: number;
59
+ /**
60
+ * Numeric device id when the statement was issued on behalf of one. Every
61
+ * log line about a device carries `tags: { deviceId }` — a stall is always
62
+ * asked per-camera, and a line without the tag cannot answer it.
63
+ */
64
+ readonly deviceId?: number;
65
+ }
66
+ /** One `(op, collection)` pair's totals over a report window. */
67
+ export interface SqliteOpStat {
68
+ readonly op: string;
69
+ readonly collection: string;
70
+ readonly calls: number;
71
+ readonly totalMs: number;
72
+ readonly maxMs: number;
73
+ readonly rows: number;
74
+ }
75
+ /**
76
+ * Duration at which one statement is worth a WARN on its own, in ms.
77
+ *
78
+ * 1 000 ms is a full second of every cluster-wide configuration read queued
79
+ * behind one statement. Below that the aggregate report is the right place to
80
+ * see it; above it, the statement is the story and deserves its own line.
81
+ */
82
+ export declare const SQLITE_SLOW_CALL_MS = 1000;
83
+ /** How often the aggregate report is emitted, in ms. Matched to the runner's
84
+ * own `[mem]` heartbeat so the two lines can be read side by side. */
85
+ export declare const SQLITE_PROFILE_REPORT_INTERVAL_MS = 60000;
86
+ /**
87
+ * Engine-busy time below which a window is not worth a line, in ms.
88
+ *
89
+ * 250 ms in a 60 s window is 0.4% — an engine doing its job. Reporting below
90
+ * this would be a line a minute forever describing a runner that is fine,
91
+ * which is how a log stops being read.
92
+ */
93
+ export declare const SQLITE_PROFILE_REPORT_FLOOR_MS = 250;
94
+ /** Pairs named in one report line. Enough to see the shape, short enough to read. */
95
+ export declare const SQLITE_PROFILE_TOP_N = 5;
96
+ export interface SqliteOpProfilerOptions {
97
+ readonly logger: IScopedLogger;
98
+ /** Injected for tests; production reads the wall clock. */
99
+ readonly now?: () => number;
100
+ readonly slowCallMs?: number;
101
+ readonly reportIntervalMs?: number;
102
+ readonly reportFloorMs?: number;
103
+ readonly topN?: number;
104
+ }
105
+ /** Identity of a measured call, without the numbers `measure` supplies itself. */
106
+ export interface SqliteOpLabel {
107
+ readonly op: string;
108
+ readonly collection: string;
109
+ readonly deviceId?: number;
110
+ }
111
+ export declare class SqliteOpProfiler {
112
+ private readonly logger;
113
+ private readonly now;
114
+ private readonly slowCallMs;
115
+ private readonly reportIntervalMs;
116
+ private readonly reportFloorMs;
117
+ private readonly topN;
118
+ private readonly stats;
119
+ private windowStartedAt;
120
+ private timer;
121
+ constructor(options: SqliteOpProfilerOptions);
122
+ /**
123
+ * Time a synchronous SQLite call.
124
+ *
125
+ * The elapsed time is recorded on the way out of BOTH exits. A statement
126
+ * that threw still held the event loop for as long as it ran, and a
127
+ * profiler that only counts successes reports an idle engine during exactly
128
+ * the incident worth explaining.
129
+ */
130
+ measure<T>(label: SqliteOpLabel, run: () => T): T;
131
+ record(sample: SqliteOpSample): void;
132
+ /** Totals for the window, busiest first, and reset. */
133
+ drain(): readonly SqliteOpStat[];
134
+ /** Emit one aggregate line for the window, unless the engine was idle. */
135
+ report(): void;
136
+ start(): void;
137
+ stop(): void;
138
+ }
@@ -34,7 +34,7 @@
34
34
  * does not move V8's heap ceiling — the thing that produced the hub's previous
35
35
  * OOM.
36
36
  */
37
- export declare const SQLITE_PAGE_CACHE_KIB = -65536;
37
+ export declare const SQLITE_PAGE_CACHE_FLOOR_KIB = -65536;
38
38
  /**
39
39
  * Memory-mapped I/O window, in bytes. 268435456 = **256 MiB**.
40
40
  *
@@ -55,7 +55,7 @@ export declare const SQLITE_PAGE_CACHE_KIB = -65536;
55
55
  * ignores it (`SQLITE_MAX_MMAP_SIZE=0`) fails loudly instead of quietly
56
56
  * doing nothing.
57
57
  */
58
- export declare const SQLITE_MMAP_SIZE_BYTES = 268435456;
58
+ export declare const SQLITE_MMAP_FLOOR_BYTES = 268435456;
59
59
  /**
60
60
  * Upper bound on the WAL file left on disk after a checkpoint resets it, in
61
61
  * bytes. 67108864 = **64 MiB**.
@@ -95,3 +95,24 @@ export declare const SQLITE_JOURNAL_SIZE_LIMIT_BYTES = 67108864;
95
95
  * journal mode reports FULL and looks exactly like a regression in this file.
96
96
  */
97
97
  export declare const SQLITE_SYNCHRONOUS_IS_BUILD_DEFAULT = true;
98
+ /**
99
+ * Hard ceiling on the map, in bytes. 2 GiB.
100
+ *
101
+ * Not a memory budget — mapped pages are reclaimable — but a bound on how far
102
+ * an unattended database may drift before somebody has to look at it. A file
103
+ * past this is a retention problem and should be reported as one, not absorbed
104
+ * silently by a wider window.
105
+ */
106
+ export declare const SQLITE_MMAP_CEILING_BYTES: number;
107
+ /**
108
+ * Ceiling on SQLite's page cache, in KiB (negative — see
109
+ * {@link SQLITE_PAGE_CACHE_FLOOR_KIB} for why the sign matters). 256 MiB.
110
+ *
111
+ * This is the number bounding unreclaimable growth, so it is the one that must
112
+ * not be generous. Past it the answer is retention, not RAM.
113
+ */
114
+ export declare const SQLITE_PAGE_CACHE_CEILING_KIB = -262144;
115
+ /** The `mmap_size` to apply for a database of this size, in bytes. */
116
+ export declare function sqliteMmapSizeFor(fileSizeBytes: number): number;
117
+ /** The `cache_size` to apply for a database of this size, in KiB (negative). */
118
+ export declare function sqlitePageCacheKibFor(fileSizeBytes: number): number;
@@ -1,6 +1,7 @@
1
1
  import { CollectionColumn, CollectionIndex, DataStoreEngineInfo, HistogramBucket, IScopedLogger, ISettingsBackend, SettingsCountInput, SettingsDeleteInput, SettingsGetInput, SettingsHistogramInput, SettingsInsertInput, SettingsIsEmptyInput, SettingsQueryInput, SettingsRecord, SettingsSetInput, SettingsUpdateInput } from '@camstack/types';
2
2
  import { default as Database } from 'better-sqlite3';
3
3
  import { MutationFilterInput } from './filter-compiler.js';
4
+ import { SqliteOpProfiler } from './query-profiler.js';
4
5
  /** Input for {@link SqliteSettingsBackend.deleteWhere}. */
5
6
  interface SettingsDeleteWhereInput {
6
7
  readonly namespace?: string;
@@ -77,6 +78,13 @@ export declare class SqliteSettingsBackend implements ISettingsBackend {
77
78
  * avoid replacing.
78
79
  */
79
80
  private readonly logger;
81
+ /**
82
+ * Per-statement timing. Absent only where the backend is constructed without
83
+ * a logger (migrations, one-shot tools, most specs) — production always has
84
+ * one, because a runner that stalls with no record of what it was executing
85
+ * is the failure this was built for (`query-profiler.ts`).
86
+ */
87
+ private readonly profiler;
80
88
  constructor(dbPath: string, runtimeDefaults?: Record<string, unknown>, logger?: IScopedLogger);
81
89
  initialize(): Promise<void>;
82
90
  private requireDeclared;
@@ -89,6 +97,12 @@ export declare class SqliteSettingsBackend implements ISettingsBackend {
89
97
  */
90
98
  private decodeColumnValue;
91
99
  shutdown(): Promise<void>;
100
+ /**
101
+ * The statement profiler, so an addon sharing this handle (the sqlite-vec
102
+ * index) reports into the SAME window. Two profilers on one thread would
103
+ * each describe a fraction of the stall and neither would add up to it.
104
+ */
105
+ getProfiler(): SqliteOpProfiler | undefined;
92
106
  /**
93
107
  * `data-store-provider` self-description — how the orchestrator names
94
108
  * this engine in a log line, and (once collections declare an engine)
@@ -188,6 +202,23 @@ export declare class SqliteSettingsBackend implements ISettingsBackend {
188
202
  * Returns null if the backend has not been initialized yet.
189
203
  */
190
204
  getDatabase(): Database.Database | null;
205
+ /**
206
+ * Run one synchronous statement under the profiler.
207
+ *
208
+ * A thin pass-through when no profiler exists, so the specs that construct
209
+ * this backend without a logger keep exercising the SAME code path as
210
+ * production. The alternative — two call shapes — is how a fix gets tested
211
+ * on a branch production never takes.
212
+ */
213
+ private measured;
214
+ /**
215
+ * Size of the database file, or 0 when it cannot be read.
216
+ *
217
+ * 0 is the honest answer for a first boot (no file yet) and for an
218
+ * unreadable `stat`, and both callers treat it as "unknown" and fall back to
219
+ * the floor — never to a smaller setting than the one already argued for.
220
+ */
221
+ private measureDbSizeBytes;
191
222
  private getDb;
192
223
  /**
193
224
  * `WHERE` fragment selecting every key that starts with `prefix`, plus its
@@ -1,4 +1,5 @@
1
1
  import { IScopedLogger, VectorFilter, VectorMetadata, VectorMetric, encodeVectorBase64 } from '@camstack/types';
2
+ import { SqliteOpProfiler } from './query-profiler.js';
2
3
  import { VectorIndexStats, VectorMatchRow } from './vector-index-shared.js';
3
4
  /** The raw statement surface this index needs from better-sqlite3. */
4
5
  export interface RawSqliteDatabase {
@@ -34,12 +35,21 @@ export declare const VEC_KNN_MAX_K = 4096;
34
35
  export interface SqliteVecIndexDeps {
35
36
  readonly db: RawSqliteDatabase;
36
37
  readonly logger: IScopedLogger;
38
+ /**
39
+ * The relational engine's profiler, so a KNN lands in the SAME report
40
+ * window as the queries it competes with. Optional because the specs
41
+ * construct this index against a raw handle with no engine behind it.
42
+ */
43
+ readonly profiler?: SqliteOpProfiler;
37
44
  }
38
45
  export declare class SqliteVecVectorIndex {
39
46
  private readonly db;
40
47
  private readonly logger;
48
+ private readonly profiler;
41
49
  private readonly specs;
42
50
  constructor(deps: SqliteVecIndexDeps);
51
+ /** Run one synchronous statement under the shared profiler, if there is one. */
52
+ private measured;
43
53
  /** Recover index declarations so an existing table is usable from boot. */
44
54
  loadIndexRegistry(): Promise<void>;
45
55
  declareIndex(index: string, dim: number, metric: VectorMetric): Promise<void>;
@@ -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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_fs_promises = require("node:fs/promises");
9
9
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
@@ -1,4 +1,4 @@
1
- import { dt as storageCapability, ft as storageMigrationCapability, g as StorageMigrationJobSchema, h as StorageLocationTypeSchema, lt as settingsStoreCapability, yt as BaseAddon, zt as parseJsonObject } from "../../dist-CvJrtLkw.mjs";
1
+ import { dt as storageCapability, ft as storageMigrationCapability, g as StorageMigrationJobSchema, h as StorageLocationTypeSchema, lt as settingsStoreCapability, yt as BaseAddon, zt as parseJsonObject } from "../../dist-BUEU7B1V.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import * as fs from "node:fs/promises";
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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.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.
@@ -1,4 +1,4 @@
1
- import { It as hydrateSchema, vt as errMsg, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { It as hydrateSchema, vt as errMsg, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  //#region src/builtins/system-config/system-config.addon.ts
3
3
  /**
4
4
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -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-CIDgcxPk.js");
6
+ const require_dist = require("../../dist-DqcaE-k1.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { X as logDestinationCapability, yt as BaseAddon } from "../../dist-CvJrtLkw.mjs";
1
+ import { X as logDestinationCapability, yt as BaseAddon } from "../../dist-BUEU7B1V.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
@@ -26138,8 +26138,10 @@ var PlateInfoSchema = z.object({
26138
26138
  keyFrameMediaKey: z.string().optional(),
26139
26139
  base64: z.string().optional(),
26140
26140
  /**
26141
- * Same crop as a data-plane URL. `getPlateByTrack` returns this and
26142
- * never inlines JPEG; `listPlates` still inlines for the admin-ui.
26141
+ * Same crop as a data-plane URL, always present when the plate has a stored
26142
+ * crop. `getPlateByTrack` returns this and never inlines JPEG; `listPlates`
26143
+ * and `searchPlates` inline the crop only when their `includeCrops` input is
26144
+ * left at its `true` default.
26143
26145
  */
26144
26146
  cropUrl: z.string().optional()
26145
26147
  });
@@ -26172,7 +26174,25 @@ var plateGalleryCapability = {
26172
26174
  methods: {
26173
26175
  listPlates: method(z.object({
26174
26176
  deviceId: z.number().int().optional(),
26175
- limit: z.number().int().positive().optional()
26177
+ limit: z.number().int().positive().optional(),
26178
+ /**
26179
+ * Inline the base64 crop on every row. Default `true` — the existing
26180
+ * behaviour, kept so no caller breaks.
26181
+ *
26182
+ * Set `false` once the caller renders {@link PlateInfo.cropUrl}.
26183
+ * Measured on the live hub at the 500 rows the Plates view asks for:
26184
+ * 879,403 B and 27.7 s with the crops inline, against a few KiB of
26185
+ * metadata without them — and the browser then caches the images.
26186
+ *
26187
+ * This is the plate twin of `faceGallery.listRecentFaces`'s option;
26188
+ * plates were the one gallery list left without it.
26189
+ *
26190
+ * **This is an INPUT field, so it does not reach the addon until the
26191
+ * next train.** The hub router validates cap inputs against its own
26192
+ * compiled Zod and strips a key it does not know. Until the train
26193
+ * ships, sending `false` is harmless and keeps the crops inline.
26194
+ */
26195
+ includeCrops: z.boolean().optional()
26176
26196
  }).optional(), z.array(PlateInfoSchema).readonly()),
26177
26197
  getPlateByTrack: method(z.object({
26178
26198
  deviceId: z.number().int(),
@@ -26183,7 +26203,9 @@ var plateGalleryCapability = {
26183
26203
  searchPlates: method(z.object({
26184
26204
  text: z.string().min(1),
26185
26205
  maxDistance: z.number().int().min(0).optional(),
26186
- limit: z.number().int().positive().optional()
26206
+ limit: z.number().int().positive().optional(),
26207
+ /** See `listPlates.includeCrops`. Default `true`. */
26208
+ includeCrops: z.boolean().optional()
26187
26209
  }), z.array(PlateInfoSchema).readonly()),
26188
26210
  /** Suggest groups of near-identical reads (same physical plate) for review/merge. */
26189
26211
  suggestPlateClusters: method(z.object({
@@ -26138,8 +26138,10 @@ var PlateInfoSchema = zod.z.object({
26138
26138
  keyFrameMediaKey: zod.z.string().optional(),
26139
26139
  base64: zod.z.string().optional(),
26140
26140
  /**
26141
- * Same crop as a data-plane URL. `getPlateByTrack` returns this and
26142
- * never inlines JPEG; `listPlates` still inlines for the admin-ui.
26141
+ * Same crop as a data-plane URL, always present when the plate has a stored
26142
+ * crop. `getPlateByTrack` returns this and never inlines JPEG; `listPlates`
26143
+ * and `searchPlates` inline the crop only when their `includeCrops` input is
26144
+ * left at its `true` default.
26143
26145
  */
26144
26146
  cropUrl: zod.z.string().optional()
26145
26147
  });
@@ -26172,7 +26174,25 @@ var plateGalleryCapability = {
26172
26174
  methods: {
26173
26175
  listPlates: method(zod.z.object({
26174
26176
  deviceId: zod.z.number().int().optional(),
26175
- limit: zod.z.number().int().positive().optional()
26177
+ limit: zod.z.number().int().positive().optional(),
26178
+ /**
26179
+ * Inline the base64 crop on every row. Default `true` — the existing
26180
+ * behaviour, kept so no caller breaks.
26181
+ *
26182
+ * Set `false` once the caller renders {@link PlateInfo.cropUrl}.
26183
+ * Measured on the live hub at the 500 rows the Plates view asks for:
26184
+ * 879,403 B and 27.7 s with the crops inline, against a few KiB of
26185
+ * metadata without them — and the browser then caches the images.
26186
+ *
26187
+ * This is the plate twin of `faceGallery.listRecentFaces`'s option;
26188
+ * plates were the one gallery list left without it.
26189
+ *
26190
+ * **This is an INPUT field, so it does not reach the addon until the
26191
+ * next train.** The hub router validates cap inputs against its own
26192
+ * compiled Zod and strips a key it does not know. Until the train
26193
+ * ships, sending `false` is harmless and keeps the crops inline.
26194
+ */
26195
+ includeCrops: zod.z.boolean().optional()
26176
26196
  }).optional(), zod.z.array(PlateInfoSchema).readonly()),
26177
26197
  getPlateByTrack: method(zod.z.object({
26178
26198
  deviceId: zod.z.number().int(),
@@ -26183,7 +26203,9 @@ var plateGalleryCapability = {
26183
26203
  searchPlates: method(zod.z.object({
26184
26204
  text: zod.z.string().min(1),
26185
26205
  maxDistance: zod.z.number().int().min(0).optional(),
26186
- limit: zod.z.number().int().positive().optional()
26206
+ limit: zod.z.number().int().positive().optional(),
26207
+ /** See `listPlates.includeCrops`. Default `true`. */
26208
+ includeCrops: zod.z.boolean().optional()
26187
26209
  }), zod.z.array(PlateInfoSchema).readonly()),
26188
26210
  /** Suggest groups of near-identical reads (same physical plate) for review/merge. */
26189
26211
  suggestPlateClusters: method(zod.z.object({
package/dist/index.js CHANGED
@@ -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-CIDgcxPk.js");
3
+ const require_dist = require("./dist-DqcaE-k1.js");
4
4
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
5
5
  require("./builtins/alerts/index.js");
6
6
  const require_formatter = require("./formatter-DqAKDlvN.js");
@@ -93991,7 +93991,8 @@ var CrashSupervisor = class {
93991
93991
  * glibc reads `MALLOC_ARENA_MAX=0` as "unbounded", which is the very state this
93992
93992
  * exists to leave.
93993
93993
  */
93994
- function runnerNativeAllocatorEnv(parentEnv) {
93994
+ function runnerNativeAllocatorEnv(parentEnv, platform = process.platform) {
93995
+ if (platform !== "linux") return {};
93995
93996
  if (parentEnv["CAMSTACK_RUNNER_NATIVE_ALLOCATOR"] === "off") return {};
93996
93997
  return {
93997
93998
  MALLOC_ARENA_MAX: parentEnv["MALLOC_ARENA_MAX"] ?? String(positiveInt(parentEnv["CAMSTACK_RUNNER_MALLOC_ARENA_MAX"], 2)),
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
2
- import { At as asNumber, B as extractNestedAddonId, Bt as parseJsonUnknown$1, Dt as ReadinessTimeoutError, Et as ReadinessRegistry, Ft as expandCapMethods, Gt as EventCategory$1, H as isArrayOutputSchema, Ht as resolveCapMount, J as lifecycleJobSchema, K as isVoidInput, Mt as createEvent, Nt as emitDownForOwnedCaps, Q as looseSchema, St as DEVICE_STATUS_METHOD, U as isCollectionArrayMethod, Ut as scopeKey, Vt as readinessKey, W as isObjectInput, Z as logLevelAtMost, bt as DATAPLANE_SECRET_HEADER$1, d as METHOD_ACCESS_MAP, f as RUNTIME_DEFAULTS, it as procedureAuthKey, jt as asString$1, kt as asJsonObject$1, ot as scopesAllowAddon, q as kebabToCamel, st as scopesAllowDeviceCap, t as ALL_CAPABILITY_DEFINITIONS, tt as objectInputDeclaresAddonId, vt as errMsg$1, xt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, y as addonSettingsCapability, zt as parseJsonObject } from "./dist-CvJrtLkw.mjs";
2
+ import { At as asNumber, B as extractNestedAddonId, Bt as parseJsonUnknown$1, Dt as ReadinessTimeoutError, Et as ReadinessRegistry, Ft as expandCapMethods, Gt as EventCategory$1, H as isArrayOutputSchema, Ht as resolveCapMount, J as lifecycleJobSchema, K as isVoidInput, Mt as createEvent, Nt as emitDownForOwnedCaps, Q as looseSchema, St as DEVICE_STATUS_METHOD, U as isCollectionArrayMethod, Ut as scopeKey, Vt as readinessKey, W as isObjectInput, Z as logLevelAtMost, bt as DATAPLANE_SECRET_HEADER$1, d as METHOD_ACCESS_MAP, f as RUNTIME_DEFAULTS, it as procedureAuthKey, jt as asString$1, kt as asJsonObject$1, ot as scopesAllowAddon, q as kebabToCamel, st as scopesAllowDeviceCap, t as ALL_CAPABILITY_DEFINITIONS, tt as objectInputDeclaresAddonId, vt as errMsg$1, xt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, y as addonSettingsCapability, zt as parseJsonObject } from "./dist-BUEU7B1V.mjs";
3
3
  import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
4
4
  import "./builtins/alerts/index.mjs";
5
5
  import { t as formatLogLine } from "./formatter-B7qW8bPJ.mjs";
@@ -93984,7 +93984,8 @@ var CrashSupervisor = class {
93984
93984
  * glibc reads `MALLOC_ARENA_MAX=0` as "unbounded", which is the very state this
93985
93985
  * exists to leave.
93986
93986
  */
93987
- function runnerNativeAllocatorEnv(parentEnv) {
93987
+ function runnerNativeAllocatorEnv(parentEnv, platform = process.platform) {
93988
+ if (platform !== "linux") return {};
93988
93989
  if (parentEnv["CAMSTACK_RUNNER_NATIVE_ALLOCATOR"] === "off") return {};
93989
93990
  return {
93990
93991
  MALLOC_ARENA_MAX: parentEnv["MALLOC_ARENA_MAX"] ?? String(positiveInt(parentEnv["CAMSTACK_RUNNER_MALLOC_ARENA_MAX"], 2)),
@@ -92,4 +92,4 @@ export interface RunnerNativeAllocatorEnv {
92
92
  * glibc reads `MALLOC_ARENA_MAX=0` as "unbounded", which is the very state this
93
93
  * exists to leave.
94
94
  */
95
- export declare function runnerNativeAllocatorEnv(parentEnv: NodeJS.ProcessEnv): RunnerNativeAllocatorEnv;
95
+ export declare function runnerNativeAllocatorEnv(parentEnv: NodeJS.ProcessEnv, platform?: NodeJS.Platform): RunnerNativeAllocatorEnv;
@@ -1,4 +1,4 @@
1
- import { kt as asJsonObject } from "./dist-CvJrtLkw.mjs";
1
+ import { kt as asJsonObject } from "./dist-BUEU7B1V.mjs";
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-CIDgcxPk.js");
1
+ const require_dist = require("./dist-DqcaE-k1.js");
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.2.125",
3
+ "version": "1.2.127",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",