@camstack/system 1.2.230 → 1.2.232

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 (60) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/addon-utils.d.ts +1 -0
  4. package/dist/addon-utils.js +6 -1
  5. package/dist/addon-utils.mjs +3 -2
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  10. package/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +17 -1
  13. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +17 -1
  14. package/dist/builtins/console-logging/index.js +1 -1
  15. package/dist/builtins/console-logging/index.mjs +1 -1
  16. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  17. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  18. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  19. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  20. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  21. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  22. package/dist/builtins/hub-forwarder/index.js +1 -1
  23. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  24. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  25. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  26. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  27. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  28. package/dist/builtins/local-network/local-network.addon.js +1 -1
  29. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  30. package/dist/builtins/loki-logging/index.js +1 -1
  31. package/dist/builtins/loki-logging/index.mjs +1 -1
  32. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  33. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  34. package/dist/builtins/platform-probe/index.js +1 -1
  35. package/dist/builtins/platform-probe/index.mjs +1 -1
  36. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  37. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  38. package/dist/builtins/snapshot/index.js +5 -140
  39. package/dist/builtins/snapshot/index.mjs +2 -137
  40. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  41. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  42. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  43. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  44. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  45. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  46. package/dist/builtins/system-config/system-config.addon.js +1 -1
  47. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  48. package/dist/builtins/winston-logging/index.js +1 -1
  49. package/dist/builtins/winston-logging/index.mjs +1 -1
  50. package/dist/{custom-action-registry-YD6rwIuz.js → custom-action-registry-YHpAdksL.js} +1 -1
  51. package/dist/{custom-action-registry-zTQXMaNb.mjs → custom-action-registry-gaO1AlT2.mjs} +1 -1
  52. package/dist/{dist-C0M6CBhV.mjs → dist-BX6SpI0i.mjs} +235 -11
  53. package/dist/{dist-zr6q3Aad.js → dist-CEIkHEdy.js} +235 -11
  54. package/dist/index.js +2 -2
  55. package/dist/index.mjs +2 -2
  56. package/dist/{retired-settings-keys-DFwQTxAT.mjs → retired-settings-keys-DDV06eUr.mjs} +1 -1
  57. package/dist/{retired-settings-keys-BqKPfC0_.js → retired-settings-keys-FLZlwa2U.js} +1 -1
  58. package/dist/snapshot-courtesy-LoJNgHHZ.mjs +140 -0
  59. package/dist/snapshot-courtesy-oeTWCXPv.js +165 -0
  60. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
2
  const require_manifest_system_deps = require("./manifest-system-deps-CrSP0Kkp.js");
3
- const require_custom_action_registry = require("./custom-action-registry-YD6rwIuz.js");
3
+ const require_custom_action_registry = require("./custom-action-registry-YHpAdksL.js");
4
4
  let node_path = require("node:path");
5
5
  node_path = require_chunk.__toESM(node_path);
6
6
  let node_fs = require("node:fs");
@@ -1,5 +1,5 @@
1
1
  import { A as createUdsLoggerWithControl, It as RUNNER_RSS_BUDGET_ENV, L as LocalChildClient, Yt as startRunnerHeapWatch, a as createUdsAddonContext, bt as resolveAddonClass, it as setWorkerNativeCapsChangeListener, n as installManifestPythonDeps, nt as getWorkerNativeCapSnapshot, ot as validateProviderRegistrations, sn as emitHeapDiagnosticReport, t as installManifestSystemDeps, tt as getWorkerNativeCapProvider, yt as installManifestNativeDeps } from "./manifest-system-deps-BEj9Dpu1.mjs";
2
- import { t as CustomActionRegistry } from "./custom-action-registry-zTQXMaNb.mjs";
2
+ import { t as CustomActionRegistry } from "./custom-action-registry-gaO1AlT2.mjs";
3
3
  import { register } from "node:module";
4
4
  import * as path$1 from "node:path";
5
5
  import * as fs from "node:fs";
@@ -20,3 +20,4 @@ export { createFileDataPlaneHandler } from './http/file-data-plane.js';
20
20
  export { parseRangeHeader, contentTypeFor, type ByteRange, } from './http/authenticated-file-server.js';
21
21
  export { CustomActionRegistry } from './kernel/custom-action-registry.js';
22
22
  export { attributeStall, STALL_REPORT_MS, STALL_TICK_MS, startEventLoopStallMonitor, type StallVerdict, } from './kernel/event-loop-stall-monitor.js';
23
+ export { renderCourtesyJpeg, renderCourtesyOverlayJpeg, courtesyCacheKey, COURTESY_DEFAULT_WIDTH, type CourtesyReason, type CourtesyFrameSpec, } from './builtins/snapshot/snapshot-courtesy.js';
@@ -1,7 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./chunk-Cek0wNdY.js");
3
3
  const require_event_loop_stall_monitor = require("./event-loop-stall-monitor-CAsHdMwP.js");
4
- const require_custom_action_registry = require("./custom-action-registry-YD6rwIuz.js");
4
+ const require_custom_action_registry = require("./custom-action-registry-YHpAdksL.js");
5
+ const require_snapshot_courtesy = require("./snapshot-courtesy-oeTWCXPv.js");
6
+ exports.COURTESY_DEFAULT_WIDTH = require_snapshot_courtesy.COURTESY_DEFAULT_WIDTH;
5
7
  exports.CustomActionRegistry = require_custom_action_registry.CustomActionRegistry;
6
8
  exports.ModelDownloadService = require_event_loop_stall_monitor.ModelDownloadService;
7
9
  exports.STALL_REPORT_MS = require_event_loop_stall_monitor.STALL_REPORT_MS;
@@ -9,6 +11,7 @@ exports.STALL_TICK_MS = require_event_loop_stall_monitor.STALL_TICK_MS;
9
11
  exports.attributeStall = require_event_loop_stall_monitor.attributeStall;
10
12
  exports.collectModelFiles = require_event_loop_stall_monitor.collectModelFiles;
11
13
  exports.contentTypeFor = require_event_loop_stall_monitor.contentTypeFor;
14
+ exports.courtesyCacheKey = require_snapshot_courtesy.courtesyCacheKey;
12
15
  exports.createFileDataPlaneHandler = require_event_loop_stall_monitor.createFileDataPlaneHandler;
13
16
  exports.deleteModelFromDisk = require_event_loop_stall_monitor.deleteModelFromDisk;
14
17
  exports.downloadFile = require_event_loop_stall_monitor.downloadFile;
@@ -16,4 +19,6 @@ exports.ensureModel = require_event_loop_stall_monitor.ensureModel;
16
19
  exports.getModelFilePath = require_event_loop_stall_monitor.getModelFilePath;
17
20
  exports.isModelDownloaded = require_event_loop_stall_monitor.isModelDownloaded;
18
21
  exports.parseRangeHeader = require_event_loop_stall_monitor.parseRangeHeader;
22
+ exports.renderCourtesyJpeg = require_snapshot_courtesy.renderCourtesyJpeg;
23
+ exports.renderCourtesyOverlayJpeg = require_snapshot_courtesy.renderCourtesyOverlayJpeg;
19
24
  exports.startEventLoopStallMonitor = require_event_loop_stall_monitor.startEventLoopStallMonitor;
@@ -1,3 +1,4 @@
1
1
  import { a as createFileDataPlaneHandler, c as parseRangeHeader, d as ModelDownloadService, f as collectModelFiles, g as ensureModel, i as startEventLoopStallMonitor, m as downloadFile, n as STALL_TICK_MS, o as contentTypeFor, p as deleteModelFromDisk, r as attributeStall, t as STALL_REPORT_MS, v as getModelFilePath, y as isModelDownloaded } from "./event-loop-stall-monitor-GPrVvx14.mjs";
2
- import { t as CustomActionRegistry } from "./custom-action-registry-zTQXMaNb.mjs";
3
- export { CustomActionRegistry, ModelDownloadService, STALL_REPORT_MS, STALL_TICK_MS, attributeStall, collectModelFiles, contentTypeFor, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloaded, parseRangeHeader, startEventLoopStallMonitor };
2
+ import { t as CustomActionRegistry } from "./custom-action-registry-gaO1AlT2.mjs";
3
+ import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg, t as COURTESY_DEFAULT_WIDTH } from "./snapshot-courtesy-LoJNgHHZ.mjs";
4
+ export { COURTESY_DEFAULT_WIDTH, CustomActionRegistry, ModelDownloadService, STALL_REPORT_MS, STALL_TICK_MS, attributeStall, collectModelFiles, contentTypeFor, courtesyCacheKey, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloaded, parseRangeHeader, renderCourtesyJpeg, renderCourtesyOverlayJpeg, startEventLoopStallMonitor };
@@ -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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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 { Jt as errMsg, Yt as BaseAddon, k as addonPagesCapability, xn as EventCategory } from "../../dist-C0M6CBhV.mjs";
1
+ import { Jt as errMsg, Yt as BaseAddon, k as addonPagesCapability, xn as EventCategory } from "../../dist-BX6SpI0i.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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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 { Jt as errMsg, Yt as BaseAddon, j as addonWidgetsCapability, xn as EventCategory } from "../../dist-C0M6CBhV.mjs";
1
+ import { Jt as errMsg, Yt as BaseAddon, j as addonWidgetsCapability, xn as EventCategory } from "../../dist-BX6SpI0i.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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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 { Jt as errMsg, M as alertsCapability, Yt as BaseAddon, cn as createEvent, n as AlertSchema, xn as EventCategory } from "../../dist-C0M6CBhV.mjs";
1
+ import { Jt as errMsg, M as alertsCapability, Yt as BaseAddon, cn as createEvent, n as AlertSchema, xn as EventCategory } from "../../dist-BX6SpI0i.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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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");
@@ -5849,6 +5849,22 @@ var BackupOrchestratorAddon = class extends require_dist.BaseAddon {
5849
5849
  await this.recordDestinationOutcome(dest.id, Date.now(), message);
5850
5850
  }
5851
5851
  }
5852
+ this.ctx.eventBus.emit({
5853
+ id: (0, node_crypto.randomUUID)(),
5854
+ timestamp: /* @__PURE__ */ new Date(),
5855
+ source: {
5856
+ type: "addon",
5857
+ id: "backup-orchestrator"
5858
+ },
5859
+ category: require_dist.EventCategory.BackupRunCompleted,
5860
+ data: {
5861
+ destinationsOk: entries.length,
5862
+ destinationsFailed: Math.max(0, targets.length - entries.length),
5863
+ destinationsTotal: targets.length,
5864
+ sizeMB: Math.round(entries.reduce((acc, e) => acc + (e.sizeBytes ?? 0), 0) / (1024 * 1024)),
5865
+ ...entries[0]?.id === void 0 ? {} : { backupId: entries[0].id }
5866
+ }
5867
+ });
5852
5868
  return entries;
5853
5869
  } finally {
5854
5870
  try {
@@ -1,4 +1,4 @@
1
- import { P as backupCapability, Vt as storageOccupancyCapability, Yt as BaseAddon, bt as mayWriteToLocation, xn as EventCategory } from "../../dist-C0M6CBhV.mjs";
1
+ import { P as backupCapability, Vt as storageOccupancyCapability, Yt as BaseAddon, bt as mayWriteToLocation, xn as EventCategory } from "../../dist-BX6SpI0i.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";
@@ -5834,6 +5834,22 @@ var BackupOrchestratorAddon = class extends BaseAddon {
5834
5834
  await this.recordDestinationOutcome(dest.id, Date.now(), message);
5835
5835
  }
5836
5836
  }
5837
+ this.ctx.eventBus.emit({
5838
+ id: randomUUID(),
5839
+ timestamp: /* @__PURE__ */ new Date(),
5840
+ source: {
5841
+ type: "addon",
5842
+ id: "backup-orchestrator"
5843
+ },
5844
+ category: EventCategory.BackupRunCompleted,
5845
+ data: {
5846
+ destinationsOk: entries.length,
5847
+ destinationsFailed: Math.max(0, targets.length - entries.length),
5848
+ destinationsTotal: targets.length,
5849
+ sizeMB: Math.round(entries.reduce((acc, e) => acc + (e.sizeBytes ?? 0), 0) / (1024 * 1024)),
5850
+ ...entries[0]?.id === void 0 ? {} : { backupId: entries[0].id }
5851
+ }
5852
+ });
5837
5853
  return entries;
5838
5854
  } finally {
5839
5855
  try {
@@ -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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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 { Yt as BaseAddon, gt as logDestinationCapability } from "../../dist-C0M6CBhV.mjs";
1
+ import { Yt as BaseAddon, gt as logDestinationCapability } from "../../dist-BX6SpI0i.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-zr6q3Aad.js");
3
+ const require_dist = require("../../dist-CEIkHEdy.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 { B as coreBlockIdFromAddonId, Jt as errMsg, V as coreBlocksCapability, Yt as BaseAddon, c as CORE_BLOCK_ADDON_PREFIX, d as DeclaredDevices, l as CoreBlockSchema, s as CORE_BLOCKS_ADDON_ID, z as coreBlockAddonId } from "../../dist-C0M6CBhV.mjs";
1
+ import { B as coreBlockIdFromAddonId, Jt as errMsg, V as coreBlocksCapability, Yt as BaseAddon, c as CORE_BLOCK_ADDON_PREFIX, d as DeclaredDevices, l as CoreBlockSchema, s as CORE_BLOCKS_ADDON_ID, z as coreBlockAddonId } from "../../dist-BX6SpI0i.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-zr6q3Aad.js");
7
- const require_retired_settings_keys = require("../../retired-settings-keys-BqKPfC0_.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.js");
7
+ const require_retired_settings_keys = require("../../retired-settings-keys-FLZlwa2U.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 { $t as DeviceFeature, At as resolveContainerPrimaryChild, Ct as normalizeUnit, J as deviceStatusCapability, Jt as errMsg, K as deviceManagerCapability, L as buildStreamParamsConfigSchema, Nt as runtimeStatePolicyFor, Q as enumerateSchemaFields, S as STREAM_PROFILE_META, Tt as parseStreamParamsFormPatch, Yt as BaseAddon, Z as enumerateItemArrayFields, a as CAMERA_SWITCH_ORDER, bn as sleep, en as DeviceRole, f as DeviceStatusSchema, in as WELL_KNOWN_TAB_MAP, o as CAP_NAMES_WITH_STATUS, pn as isDeviceConfigCap, q as deviceStateCapability, t as ALL_CAPABILITY_DEFINITIONS, tn as DeviceType, xn as EventCategory } from "../../dist-C0M6CBhV.mjs";
2
- import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-DFwQTxAT.mjs";
1
+ import { $t as DeviceFeature, At as resolveContainerPrimaryChild, Ct as normalizeUnit, J as deviceStatusCapability, Jt as errMsg, K as deviceManagerCapability, L as buildStreamParamsConfigSchema, Nt as runtimeStatePolicyFor, Q as enumerateSchemaFields, S as STREAM_PROFILE_META, Tt as parseStreamParamsFormPatch, Yt as BaseAddon, Z as enumerateItemArrayFields, a as CAMERA_SWITCH_ORDER, bn as sleep, en as DeviceRole, f as DeviceStatusSchema, in as WELL_KNOWN_TAB_MAP, o as CAP_NAMES_WITH_STATUS, pn as isDeviceConfigCap, q as deviceStateCapability, t as ALL_CAPABILITY_DEFINITIONS, tn as DeviceType, xn as EventCategory } from "../../dist-BX6SpI0i.mjs";
2
+ import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-DDV06eUr.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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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 { $ as evaluateSensorEdge, F as bareAddonId, Jt as errMsg, Y as doorbellCapability, Yt as BaseAddon, b as SOURCE_DEVICE_TYPES, cn as createEvent, lt as isSameAddonId, tn as DeviceType, ut as isSourceCap, xn as EventCategory, y as SOURCE_CAPS } from "../../dist-C0M6CBhV.mjs";
1
+ import { $ as evaluateSensorEdge, F as bareAddonId, Jt as errMsg, Y as doorbellCapability, Yt as BaseAddon, b as SOURCE_DEVICE_TYPES, cn as createEvent, lt as isSameAddonId, tn as DeviceType, ut as isSourceCap, xn as EventCategory, y as SOURCE_CAPS } from "../../dist-BX6SpI0i.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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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 { Yt as BaseAddon, gt as logDestinationCapability } from "../../dist-C0M6CBhV.mjs";
1
+ import { Yt as BaseAddon, gt as logDestinationCapability } from "../../dist-BX6SpI0i.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-zr6q3Aad.js");
3
+ const require_dist = require("../../dist-CEIkHEdy.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 { Jt as errMsg, Yt as BaseAddon, cn as createEvent, v as RecordingStatusSchema, xn as EventCategory } from "../../dist-C0M6CBhV.mjs";
1
+ import { Jt as errMsg, Yt as BaseAddon, cn as createEvent, v as RecordingStatusSchema, xn as EventCategory } from "../../dist-BX6SpI0i.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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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 { C as ScopedTokenSchema, N as authProviderCapability, O as UserRecordSchema, Wt as userManagementCapability, Yt as BaseAddon, r as ApiKeyRecordSchema } from "../../dist-C0M6CBhV.mjs";
2
+ import { C as ScopedTokenSchema, N as authProviderCapability, O as UserRecordSchema, Wt as userManagementCapability, Yt as BaseAddon, r as ApiKeyRecordSchema } from "../../dist-BX6SpI0i.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-zr6q3Aad.js");
3
+ const require_dist = require("../../dist-CEIkHEdy.js");
4
4
  const require_tls = require("../../tls-BFs4PzoW.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 { Yt as BaseAddon, ht as localNetworkCapability, xn as EventCategory } from "../../dist-C0M6CBhV.mjs";
1
+ import { Yt as BaseAddon, ht as localNetworkCapability, xn as EventCategory } from "../../dist-BX6SpI0i.mjs";
2
2
  import { S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, i as writeExtraSans, l as reissueTlsLeaf, n as readTlsAccessStatus, o as validateUploadedTls, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, y as applyLanHttp } from "../../tls-2xbgg78V.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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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 { Yt as BaseAddon, gt as logDestinationCapability } from "../../dist-C0M6CBhV.mjs";
1
+ import { Yt as BaseAddon, gt as logDestinationCapability } from "../../dist-BX6SpI0i.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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.js");
7
7
  let node_fs_promises = require("node:fs/promises");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { Jt as errMsg, Ot as reducePoints, Yt as BaseAddon, cn as createEvent, kt as resolveBucketMs, rt as foldSnapshotByFunction, xn as EventCategory, xt as metricsProviderCapability } from "../../dist-C0M6CBhV.mjs";
1
+ import { Jt as errMsg, Ot as reducePoints, Yt as BaseAddon, cn as createEvent, kt as resolveBucketMs, rt as foldSnapshotByFunction, xn as EventCategory, xt as metricsProviderCapability } from "../../dist-BX6SpI0i.mjs";
2
2
  import { access, readFile, readdir } from "node:fs/promises";
3
3
  import * as fs from "node:fs";
4
4
  import { constants, readFileSync } 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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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,5 +1,5 @@
1
1
  import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
2
- import { Et as platformProbeCapability, It as scoreRuntimes, Jt as errMsg, X as enumerateInferenceDevices, Yt as BaseAddon, un as emitReadiness, xn as EventCategory } from "../../dist-C0M6CBhV.mjs";
2
+ import { Et as platformProbeCapability, It as scoreRuntimes, Jt as errMsg, X as enumerateInferenceDevices, Yt as BaseAddon, un as emitReadiness, xn as EventCategory } from "../../dist-BX6SpI0i.mjs";
3
3
  import * as fs from "node:fs";
4
4
  import { execFile } from "node:child_process";
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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.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 { Yt as BaseAddon, xn as EventCategory } from "../../dist-C0M6CBhV.mjs";
1
+ import { Yt as BaseAddon, xn as EventCategory } from "../../dist-BX6SpI0i.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,8 @@ 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-zr6q3Aad.js");
6
+ const require_dist = require("../../dist-CEIkHEdy.js");
7
+ const require_snapshot_courtesy = require("../../snapshot-courtesy-oeTWCXPv.js");
7
8
  let zod = require("zod");
8
9
  let node_crypto = require("node:crypto");
9
10
  let _camstack_types_node = require("@camstack/types/node");
@@ -322,142 +323,6 @@ function raceForResult(promise, timeoutMs) {
322
323
  if (timer) clearTimeout(timer);
323
324
  });
324
325
  }
325
- //#endregion
326
- //#region src/builtins/snapshot/snapshot-courtesy.ts
327
- /**
328
- * State treatment for a camera that cannot produce a current frame.
329
- *
330
- * ── Why this exists ───────────────────────────────────────────────────────
331
- * A disabled, offline or sleeping camera has no frame, and until 2026-08-11 the
332
- * snapshot service simply had nothing to say about it: the media route answered
333
- * **404** and the client painted "Unavailable". Measured on the live grid that
334
- * day, 10 of 26 tiles were 404s — one genuinely disabled camera plus nine dead
335
- * legacy rows. A 404 is indistinguishable from a broken camera, so an operator
336
- * who deliberately switched a camera off saw the same thing as a fault ([D62]:
337
- * "an off switch is REPORTED off; disabled must never look like broken").
338
- *
339
- * So the service answers with an image that SAYS what is going on, carrying
340
- * the camera's own name. When a real cached frame exists it remains visible
341
- * under the treatment; otherwise the generated courtesy background is used.
342
- *
343
- * ── Why sharp and not ffmpeg ──────────────────────────────────────────────
344
- * The first draft of this file shelled out to `ffmpeg` with a `drawtext`
345
- * filter. That was written before the resize path was measured, and it was the
346
- * wrong call for the same reason: this runs in the snapshot wrapper, a system
347
- * builtin loaded in the hub's ROOT process, so every render was a fork + exec
348
- * on the loop that serves the API — 52 ms against sharp's 4.8 ms in that
349
- * container, to draw two lines of text.
350
- *
351
- * `terminal-frame-renderer.ts` already renders text this way (SVG → sharp), so
352
- * this is the house pattern rather than a new one. It also drops the font-PATH
353
- * probing the ffmpeg version needed: an SVG names a font FAMILY and fontconfig
354
- * resolves it — verified in the hub image, where `fc-match "DejaVu Sans Mono"`
355
- * answers with the real file.
356
- *
357
- * Rendering is pure input → bytes with no I/O of its own, and the geometry and
358
- * escaping are separated out so they stay testable without rasterizing.
359
- */
360
- /**
361
- * Font stack for the rendered text. Family names, not paths — librsvg resolves
362
- * them through fontconfig, and the trailing generics keep a host without DejaVu
363
- * rendering something legible instead of nothing.
364
- */
365
- var COURTESY_FONT_STACK = "DejaVu Sans,DejaVu Sans Mono,Helvetica,Arial,sans-serif";
366
- /** The word the frame carries. Deliberately the operator's vocabulary. */
367
- function courtesyLabel(reason) {
368
- switch (reason) {
369
- case "disabled": return "Disabled";
370
- case "offline": return "Offline";
371
- case "sleeping": return "Sleeping";
372
- case "unreachable": return "Unreachable";
373
- case "waking": return "Waking";
374
- }
375
- }
376
- /**
377
- * Background per reason. A disabled camera is a DELIBERATE state and must not
378
- * read as an alarm, so it is neutral grey; offline is a fault and is warmer.
379
- */
380
- function courtesyBackground(reason) {
381
- switch (reason) {
382
- case "disabled": return "#2b2b31";
383
- case "offline": return "#3a2b2b";
384
- case "sleeping": return "#232b3a";
385
- case "waking": return "#243247";
386
- case "unreachable": return "#3a2b2b";
387
- }
388
- }
389
- /** XML escaping for text placed inside an SVG `<text>` node. */
390
- function escapeCourtesyText(value) {
391
- return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;");
392
- }
393
- /**
394
- * The SVG the frame is rasterized from: the state large and centred, the
395
- * camera's name under it, smaller and dimmer.
396
- *
397
- * Sizes derive from the width so a 240 px grid tile and a 1920 px full-bleed
398
- * frame read the same, with a floor so a thumbnail stays legible.
399
- */
400
- function buildCourtesySvg(spec) {
401
- return buildStateSvg(spec, false);
402
- }
403
- /**
404
- * The same state treatment as a courtesy frame, but translucent so the last
405
- * real camera frame remains visible underneath it.
406
- */
407
- function buildCourtesyOverlaySvg(spec) {
408
- return buildStateSvg(spec, true);
409
- }
410
- function buildStateSvg(spec, overlay) {
411
- const stateSize = Math.max(12, Math.round(spec.width / 12));
412
- const nameSize = Math.max(9, Math.round(spec.width / 26));
413
- const state = escapeCourtesyText(courtesyLabel(spec.reason));
414
- const name = escapeCourtesyText(spec.deviceName);
415
- const midY = spec.height / 2;
416
- const washOpacity = overlay ? "0.62" : "1";
417
- const textStroke = Math.max(1, Math.round(spec.width / 320));
418
- return [
419
- `<svg xmlns="http://www.w3.org/2000/svg" width="${String(spec.width)}" height="${String(spec.height)}">`,
420
- `<rect width="100%" height="100%" fill="${courtesyBackground(spec.reason)}" fill-opacity="${washOpacity}"/>`,
421
- `<g font-family="${COURTESY_FONT_STACK}" text-anchor="middle" paint-order="stroke" stroke="#111118" stroke-width="${String(textStroke)}">`,
422
- `<text x="50%" y="${String(Math.round(midY))}" font-size="${String(stateSize)}" fill="#e8e8ee">${state}</text>`,
423
- `<text x="50%" y="${String(Math.round(midY + stateSize))}" font-size="${String(nameSize)}" fill="#9a9aa8">${name}</text>`,
424
- `</g></svg>`
425
- ].join("");
426
- }
427
- /** Cache key — a courtesy frame is a pure function of these four. */
428
- function courtesyCacheKey(spec) {
429
- return `${spec.reason}:${String(spec.width)}x${String(spec.height)}:${spec.deviceName}`;
430
- }
431
- /**
432
- * Render the frame.
433
- *
434
- * Rejects on failure — the caller decides what to do, exactly as `resizeJpeg`
435
- * does, so a broken courtesy path is never mistaken for a broken camera.
436
- */
437
- function renderCourtesyJpeg(spec) {
438
- return (0, sharp.default)(Buffer.from(buildCourtesySvg(spec))).jpeg({ quality: 82 }).toBuffer().then((bytes) => {
439
- if (bytes.length === 0) throw new Error("courtesy frame produced no bytes");
440
- return bytes;
441
- });
442
- }
443
- /**
444
- * Paint the state treatment over a real cached frame.
445
- *
446
- * The source dimensions are authoritative: overlays preserve the original
447
- * frame rather than resizing it to the generated courtesy-frame default.
448
- */
449
- async function renderCourtesyOverlayJpeg(background, spec) {
450
- const metadata = await (0, sharp.default)(background).metadata();
451
- if (!metadata.width || !metadata.height) throw new Error("cached snapshot has no renderable dimensions");
452
- const overlay = Buffer.from(buildCourtesyOverlaySvg({
453
- ...spec,
454
- width: metadata.width,
455
- height: metadata.height
456
- }));
457
- const bytes = await (0, sharp.default)(background).composite([{ input: overlay }]).jpeg({ quality: 82 }).toBuffer();
458
- if (bytes.length === 0) throw new Error("courtesy overlay produced no bytes");
459
- return bytes;
460
- }
461
326
  var NativeSnapshotFatigue = class {
462
327
  baseMs;
463
328
  maxMs;
@@ -2346,7 +2211,7 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
2346
2211
  async courtesyFrame(deviceId, reason, deviceName) {
2347
2212
  const width = 640;
2348
2213
  const height = Math.round(width * 9 / 16);
2349
- const key = courtesyCacheKey({
2214
+ const key = require_snapshot_courtesy.courtesyCacheKey({
2350
2215
  deviceName,
2351
2216
  reason,
2352
2217
  width,
@@ -2355,7 +2220,7 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
2355
2220
  const cached = this.courtesyFrames.get(key);
2356
2221
  if (cached !== void 0) return cached;
2357
2222
  try {
2358
- const bytes = await renderCourtesyJpeg({
2223
+ const bytes = await require_snapshot_courtesy.renderCourtesyJpeg({
2359
2224
  deviceName,
2360
2225
  reason,
2361
2226
  width,
@@ -2425,7 +2290,7 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
2425
2290
  contentType: "image/jpeg"
2426
2291
  };
2427
2292
  try {
2428
- const bytes = await renderCourtesyOverlayJpeg(Buffer.from(hit.data.base64, "base64"), {
2293
+ const bytes = await require_snapshot_courtesy.renderCourtesyOverlayJpeg(Buffer.from(hit.data.base64, "base64"), {
2429
2294
  deviceName: resolvedName,
2430
2295
  reason
2431
2296
  });