@camstack/system 1.2.8 → 1.2.10

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 (56) hide show
  1. package/dist/addon-runner.js +6 -6
  2. package/dist/addon-runner.mjs +6 -6
  3. package/dist/addon-utils.js +1 -1
  4. package/dist/addon-utils.mjs +1 -1
  5. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/dist/builtins/alerts/alerts.addon.js +1 -1
  10. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  13. package/dist/builtins/console-logging/index.js +1 -1
  14. package/dist/builtins/console-logging/index.mjs +1 -1
  15. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  16. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  17. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  19. package/dist/builtins/hub-forwarder/index.js +1 -1
  20. package/dist/builtins/hub-forwarder/index.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/native-metrics/native-metrics.addon.js +1 -1
  26. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  27. package/dist/builtins/platform-probe/index.js +1 -1
  28. package/dist/builtins/platform-probe/index.mjs +1 -1
  29. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  30. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  31. package/dist/builtins/snapshot/index.js +29 -1
  32. package/dist/builtins/snapshot/index.mjs +29 -1
  33. package/dist/builtins/snapshot/snapshot.addon.d.ts +6 -0
  34. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  35. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  36. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  37. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  38. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +12 -0
  39. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +48 -7
  40. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +48 -7
  41. package/dist/builtins/storage-orchestrator/storage-pressure-manager.d.ts +27 -0
  42. package/dist/builtins/system-config/system-config.addon.js +1 -1
  43. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  44. package/dist/builtins/winston-logging/index.js +1 -1
  45. package/dist/builtins/winston-logging/index.mjs +1 -1
  46. package/dist/{custom-action-registry-BEXwC-oo.mjs → custom-action-registry-F__gp_VX.mjs} +1 -1
  47. package/dist/{custom-action-registry-vLYEFTtv.js → custom-action-registry-jY0NOZK8.js} +1 -1
  48. package/dist/{dist-CdgScQ3H.js → dist-BQOCTD5b.js} +1664 -1434
  49. package/dist/{dist-CxM20CkF.mjs → dist-DpKeSZel.mjs} +1659 -1435
  50. package/dist/index.js +3 -3
  51. package/dist/index.mjs +3 -3
  52. package/dist/kernel/custom-action-registry.d.ts +3 -3
  53. package/dist/kernel/transport/child-cap-protocol.d.ts +11 -1
  54. package/dist/{manifest-python-deps-CUHn5wqq.js → manifest-python-deps-1I7WdPDD.js} +5 -3
  55. package/dist/{manifest-python-deps-CcW0WpfS.mjs → manifest-python-deps-I2MGvDvo.mjs} +5 -3
  56. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-CdgScQ3H.js");
3
- const require_manifest_python_deps = require("./manifest-python-deps-CUHn5wqq.js");
4
- const require_custom_action_registry = require("./custom-action-registry-vLYEFTtv.js");
2
+ const require_dist = require("./dist-BQOCTD5b.js");
3
+ const require_manifest_python_deps = require("./manifest-python-deps-1I7WdPDD.js");
4
+ const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
5
5
  let node_fs = require("node:fs");
6
6
  node_fs = require_chunk.__toESM(node_fs);
7
7
  let node_path = require("node:path");
@@ -274,7 +274,7 @@ function createChildAddonCallDispatch(deps) {
274
274
  if (typeof action !== "string" || action.length === 0) throw new Error(`child-addon-call: addon "${addonId}" custom call missing action name`);
275
275
  const entry = deps.customActions.resolve(addonId, action);
276
276
  if (entry === null) throw new Error(`child-addon-call: addon "${addonId}" has no custom action "${action}"`);
277
- return entry.handler(call.args);
277
+ return entry.handler(call.args, call.caller);
278
278
  }
279
279
  case "settings": {
280
280
  const method = call.method;
@@ -608,10 +608,10 @@ async function main() {
608
608
  }
609
609
  if (initResult?.customActions && initResult.actionHandlers) {
610
610
  const handlers = initResult.actionHandlers;
611
- customActionRegistry.registerAddon(spec.addonId, initResult.customActions, (action, input) => {
611
+ customActionRegistry.registerAddon(spec.addonId, initResult.customActions, (action, input, caller) => {
612
612
  const fn = handlers[action];
613
613
  if (!fn) throw new Error(`addon '${spec.addonId}' has no handler for custom action '${action}'`);
614
- return fn(input);
614
+ return fn(input, caller);
615
615
  });
616
616
  }
617
617
  require_manifest_python_deps.validateProviderRegistrations(spec.addonId, declaration, registeredProviders, context.logger);
@@ -1,6 +1,6 @@
1
- import { M as isCollectionArrayMethod, t as ALL_CAPABILITY_DEFINITIONS } from "./dist-CxM20CkF.mjs";
2
- import { Ct as resolveAddonClass, I as createUdsLoggerWithControl, L as LocalChildClient, at as setWorkerNativeCapsChangeListener, bt as installManifestNativeDeps, i as createUdsAddonContext, nt as getWorkerNativeCapProvider, rt as getWorkerNativeCapSnapshot, st as validateProviderRegistrations, t as installManifestPythonDeps } from "./manifest-python-deps-CcW0WpfS.mjs";
3
- import { t as CustomActionRegistry } from "./custom-action-registry-BEXwC-oo.mjs";
1
+ import { N as isCollectionArrayMethod, t as ALL_CAPABILITY_DEFINITIONS } from "./dist-DpKeSZel.mjs";
2
+ import { Ct as resolveAddonClass, I as createUdsLoggerWithControl, L as LocalChildClient, at as setWorkerNativeCapsChangeListener, bt as installManifestNativeDeps, i as createUdsAddonContext, nt as getWorkerNativeCapProvider, rt as getWorkerNativeCapSnapshot, st as validateProviderRegistrations, t as installManifestPythonDeps } from "./manifest-python-deps-I2MGvDvo.mjs";
3
+ import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
4
4
  import { register } from "node:module";
5
5
  import * as fs from "node:fs";
6
6
  import * as path$1 from "node:path";
@@ -270,7 +270,7 @@ function createChildAddonCallDispatch(deps) {
270
270
  if (typeof action !== "string" || action.length === 0) throw new Error(`child-addon-call: addon "${addonId}" custom call missing action name`);
271
271
  const entry = deps.customActions.resolve(addonId, action);
272
272
  if (entry === null) throw new Error(`child-addon-call: addon "${addonId}" has no custom action "${action}"`);
273
- return entry.handler(call.args);
273
+ return entry.handler(call.args, call.caller);
274
274
  }
275
275
  case "settings": {
276
276
  const method = call.method;
@@ -604,10 +604,10 @@ async function main() {
604
604
  }
605
605
  if (initResult?.customActions && initResult.actionHandlers) {
606
606
  const handlers = initResult.actionHandlers;
607
- customActionRegistry.registerAddon(spec.addonId, initResult.customActions, (action, input) => {
607
+ customActionRegistry.registerAddon(spec.addonId, initResult.customActions, (action, input, caller) => {
608
608
  const fn = handlers[action];
609
609
  if (!fn) throw new Error(`addon '${spec.addonId}' has no handler for custom action '${action}'`);
610
- return fn(input);
610
+ return fn(input, caller);
611
611
  });
612
612
  }
613
613
  validateProviderRegistrations(spec.addonId, declaration, registeredProviders, context.logger);
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./chunk-Cek0wNdY.js");
3
3
  const require_model_download_service = require("./model-download-service-hf0ookyy.js");
4
- const require_custom_action_registry = require("./custom-action-registry-vLYEFTtv.js");
4
+ const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
5
5
  exports.CustomActionRegistry = require_custom_action_registry.CustomActionRegistry;
6
6
  exports.ModelDownloadService = require_model_download_service.ModelDownloadService;
7
7
  exports.collectModelFiles = require_model_download_service.collectModelFiles;
@@ -1,3 +1,3 @@
1
1
  import { c as getModelFilePath, d as contentTypeFor, i as downloadFile, l as isModelDownloaded, n as collectModelFiles, o as ensureModel, p as parseRangeHeader, r as deleteModelFromDisk, t as ModelDownloadService, u as createFileDataPlaneHandler } from "./model-download-service-Cp9f4dk6.mjs";
2
- import { t as CustomActionRegistry } from "./custom-action-registry-BEXwC-oo.mjs";
2
+ import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
3
3
  export { CustomActionRegistry, ModelDownloadService, collectModelFiles, contentTypeFor, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloaded, parseRangeHeader };
@@ -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-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, at as BaseAddon, f as addonPagesCapability, it as errMsg } from "../../dist-CxM20CkF.mjs";
1
+ import { at as errMsg, jt as EventCategory, ot as BaseAddon, p as addonPagesCapability } from "../../dist-DpKeSZel.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import * as fs from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, at as BaseAddon, it as errMsg, m as addonWidgetsCapability } from "../../dist-CxM20CkF.mjs";
1
+ import { at as errMsg, h as addonWidgetsCapability, jt as EventCategory, ot as BaseAddon } from "../../dist-DpKeSZel.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import * as fs from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  //#region src/builtins/alerts/alerts.addon.ts
8
8
  var CATEGORY_MAPPINGS = {
9
9
  "addon.crashed": {
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, at as BaseAddon, h as alertsCapability, it as errMsg, n as AlertSchema, vt as createEvent } from "../../dist-CxM20CkF.mjs";
1
+ import { at as errMsg, g as alertsCapability, jt as EventCategory, n as AlertSchema, ot as BaseAddon, yt as createEvent } from "../../dist-DpKeSZel.mjs";
2
2
  //#region src/builtins/alerts/alerts.addon.ts
3
3
  var CATEGORY_MAPPINGS = {
4
4
  "addon.crashed": {
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  let node_fs = require("node:fs");
8
8
  let node_fs$1 = require_chunk.__toESM(node_fs, 1);
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, at as BaseAddon, v as backupCapability } from "../../dist-CxM20CkF.mjs";
1
+ import { jt as EventCategory, ot as BaseAddon, y as backupCapability } from "../../dist-DpKeSZel.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import Kt from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -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-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.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 { R as logDestinationCapability, at as BaseAddon } from "../../dist-CxM20CkF.mjs";
1
+ import { ot as BaseAddon, z as logDestinationCapability } from "../../dist-DpKeSZel.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  //#region src/builtins/console-logging/console-destination.ts
4
4
  var LEVEL_RANK = {
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  let _camstack_types_node = require("@camstack/types/node");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { A as getByPath, At as EventCategory, Ct as isDeviceConfigCap, D as evaluateLinkExpression, E as enumerateSchemaFields, H as normalizeUnit, S as deviceStatusCapability, T as enumerateItemArrayFields, W as parseStreamParamsFormPatch, Y as setByPath, a as DeviceStatusSchema, at as BaseAddon, b as deviceManagerCapability, c as STREAM_PROFILE_META, dt as DeviceType, g as applyTransform, i as CAP_NAMES_WITH_STATUS, it as errMsg, kt as sleep, lt as DeviceFeature, mt as WELL_KNOWN_TAB_MAP, rt as validateExpressionSource, t as ALL_CAPABILITY_DEFINITIONS, tt as toExpressionValue, ut as DeviceRole, x as deviceStateCapability, y as buildStreamParamsConfigSchema } from "../../dist-CxM20CkF.mjs";
1
+ import { At as sleep, C as deviceStatusCapability, D as enumerateSchemaFields, E as enumerateItemArrayFields, G as parseStreamParamsFormPatch, O as evaluateLinkExpression, S as deviceStateCapability, U as normalizeUnit, X as setByPath, _ as applyTransform, a as CAP_NAMES_WITH_STATUS, at as errMsg, b as buildStreamParamsConfigSchema, dt as DeviceRole, ft as DeviceType, ht as WELL_KNOWN_TAB_MAP, it as validateExpressionSource, j as getByPath, jt as EventCategory, l as STREAM_PROFILE_META, nt as toExpressionValue, o as DeviceStatusSchema, ot as BaseAddon, t as ALL_CAPABILITY_DEFINITIONS, ut as DeviceFeature, wt as isDeviceConfigCap, x as deviceManagerCapability } from "../../dist-DpKeSZel.mjs";
2
2
  import { canonicalDeviceFingerprint } from "@camstack/types/node";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.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 { At as EventCategory, C as doorbellCapability, at as BaseAddon, dt as DeviceType, it as errMsg, vt as createEvent } from "../../dist-CxM20CkF.mjs";
1
+ import { at as errMsg, ft as DeviceType, jt as EventCategory, ot as BaseAddon, w as doorbellCapability, yt as createEvent } from "../../dist-DpKeSZel.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-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.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 { R as logDestinationCapability, at as BaseAddon } from "../../dist-CxM20CkF.mjs";
1
+ import { ot as BaseAddon, z as logDestinationCapability } from "../../dist-DpKeSZel.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  //#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
4
4
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.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,4 +1,4 @@
1
- import { _ as authProviderCapability, at as BaseAddon, d as UserRecordSchema, l as ScopedTokenSchema, nt as userManagementCapability, r as ApiKeyRecordSchema } from "../../dist-CxM20CkF.mjs";
1
+ import { f as UserRecordSchema, ot as BaseAddon, r as ApiKeyRecordSchema, rt as userManagementCapability, u as ScopedTokenSchema, v as authProviderCapability } from "../../dist-DpKeSZel.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import * as crypto$1 from "node:crypto";
4
4
  import { randomUUID } from "node: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-CdgScQ3H.js");
3
+ const require_dist = require("../../dist-BQOCTD5b.js");
4
4
  let node_os = require("node:os");
5
5
  node_os = require_chunk.__toESM(node_os);
6
6
  //#region src/builtins/local-network/local-network.addon.ts
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, L as localNetworkCapability, at as BaseAddon } from "../../dist-CxM20CkF.mjs";
1
+ import { R as localNetworkCapability, jt as EventCategory, ot as BaseAddon } from "../../dist-DpKeSZel.mjs";
2
2
  import * as os from "node:os";
3
3
  //#region src/builtins/local-network/local-network.addon.ts
4
4
  /**
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_chunk.__toESM(node_fs);
9
9
  let node_child_process = require("node:child_process");
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, B as metricsProviderCapability, at as BaseAddon, vt as createEvent } from "../../dist-CxM20CkF.mjs";
1
+ import { V as metricsProviderCapability, jt as EventCategory, ot as BaseAddon, yt as createEvent } from "../../dist-DpKeSZel.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import { execFile, execFileSync } from "node:child_process";
4
4
  import { promisify } from "node:util";
@@ -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-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_chunk.__toESM(node_fs);
9
9
  let node_child_process = require("node:child_process");
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, G as platformProbeCapability, J as scoreRuntimes, at as BaseAddon, bt as emitReadiness, it as errMsg, w as enumerateInferenceDevices } from "../../dist-CxM20CkF.mjs";
1
+ import { K as platformProbeCapability, T as enumerateInferenceDevices, Y as scoreRuntimes, at as errMsg, jt as EventCategory, ot as BaseAddon, xt as emitReadiness } from "../../dist-DpKeSZel.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import { execFile } from "node:child_process";
4
4
  import { promisify } from "node:util";
@@ -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-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.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 { At as EventCategory, at as BaseAddon } from "../../dist-CxM20CkF.mjs";
1
+ import { jt as EventCategory, ot as BaseAddon } from "../../dist-DpKeSZel.mjs";
2
2
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
3
3
  /**
4
4
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  let node_child_process = require("node:child_process");
8
8
  //#region src/builtins/snapshot/snapshot-coalescing.ts
9
9
  /**
@@ -485,6 +485,16 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
485
485
  });
486
486
  return hit ? hit.data : null;
487
487
  }
488
+ if (!force && isBatteryDevice && await this.isDeviceSleeping(deviceId)) {
489
+ log.debug("snapshot: sleeping battery cam and no force — serving cache, not capturing", {
490
+ tags: { deviceId },
491
+ meta: {
492
+ hasCache: hit !== void 0,
493
+ ageMs: hit ? now - hit.ts : null
494
+ }
495
+ });
496
+ return hit ? hit.data : null;
497
+ }
488
498
  const flightKey = `${deviceId}:${effectiveStreamId ?? "auto"}`;
489
499
  const flight = this.captureFlight.run(flightKey, () => this.captureFresh({
490
500
  deviceId,
@@ -755,7 +765,25 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
755
765
  * missing, RPC timeout) is swallowed and treated as "awake" — we'd
756
766
  * rather pay a wake-up than strand the caller on a cache that's
757
767
  * semantically stale. Debug-logged for observability.
768
+ *
769
+ * Cheap: a battery provider serves this from its runtime-state slice,
770
+ * so the probe costs one RPC and zero camera traffic. Only consulted
771
+ * on the path that would otherwise CAPTURE — a fresh cache hit
772
+ * returns before we get here.
758
773
  */
774
+ async isDeviceSleeping(deviceId) {
775
+ try {
776
+ const raw = await this.ctx.api.battery.getStatus.query({ deviceId });
777
+ const parsed = require_dist.BatteryStatusSchema.safeParse(raw);
778
+ return parsed.success && parsed.data.sleeping;
779
+ } catch (err) {
780
+ this.ctx.logger.debug("snapshot: battery sleep probe failed — assuming awake", {
781
+ tags: { deviceId },
782
+ meta: { error: require_dist.errMsg(err) }
783
+ });
784
+ return false;
785
+ }
786
+ }
759
787
  /**
760
788
  * True when at least one of the device's brokers is actively
761
789
  * streaming (status === 'streaming'). Used by the battery-cam guard
@@ -1,4 +1,4 @@
1
- import { V as nodePin, Z as snapshotCapability, at as BaseAddon, dt as DeviceType, et as streamQualityLabel, it as errMsg, lt as DeviceFeature } from "../../dist-CxM20CkF.mjs";
1
+ import { H as nodePin, Q as snapshotCapability, at as errMsg, ft as DeviceType, i as BatteryStatusSchema, ot as BaseAddon, tt as streamQualityLabel, ut as DeviceFeature } from "../../dist-DpKeSZel.mjs";
2
2
  import { execFile } from "node:child_process";
3
3
  //#region src/builtins/snapshot/snapshot-coalescing.ts
4
4
  /**
@@ -480,6 +480,16 @@ var SnapshotAddon = class SnapshotAddon extends BaseAddon {
480
480
  });
481
481
  return hit ? hit.data : null;
482
482
  }
483
+ if (!force && isBatteryDevice && await this.isDeviceSleeping(deviceId)) {
484
+ log.debug("snapshot: sleeping battery cam and no force — serving cache, not capturing", {
485
+ tags: { deviceId },
486
+ meta: {
487
+ hasCache: hit !== void 0,
488
+ ageMs: hit ? now - hit.ts : null
489
+ }
490
+ });
491
+ return hit ? hit.data : null;
492
+ }
483
493
  const flightKey = `${deviceId}:${effectiveStreamId ?? "auto"}`;
484
494
  const flight = this.captureFlight.run(flightKey, () => this.captureFresh({
485
495
  deviceId,
@@ -750,7 +760,25 @@ var SnapshotAddon = class SnapshotAddon extends BaseAddon {
750
760
  * missing, RPC timeout) is swallowed and treated as "awake" — we'd
751
761
  * rather pay a wake-up than strand the caller on a cache that's
752
762
  * semantically stale. Debug-logged for observability.
763
+ *
764
+ * Cheap: a battery provider serves this from its runtime-state slice,
765
+ * so the probe costs one RPC and zero camera traffic. Only consulted
766
+ * on the path that would otherwise CAPTURE — a fresh cache hit
767
+ * returns before we get here.
753
768
  */
769
+ async isDeviceSleeping(deviceId) {
770
+ try {
771
+ const raw = await this.ctx.api.battery.getStatus.query({ deviceId });
772
+ const parsed = BatteryStatusSchema.safeParse(raw);
773
+ return parsed.success && parsed.data.sleeping;
774
+ } catch (err) {
775
+ this.ctx.logger.debug("snapshot: battery sleep probe failed — assuming awake", {
776
+ tags: { deviceId },
777
+ meta: { error: errMsg(err) }
778
+ });
779
+ return false;
780
+ }
781
+ }
754
782
  /**
755
783
  * True when at least one of the device's brokers is actively
756
784
  * streaming (status === 'streaming'). Used by the battery-cam guard
@@ -176,7 +176,13 @@ export declare class SnapshotAddon extends BaseAddon<SnapshotAddonConfig> {
176
176
  * missing, RPC timeout) is swallowed and treated as "awake" — we'd
177
177
  * rather pay a wake-up than strand the caller on a cache that's
178
178
  * semantically stale. Debug-logged for observability.
179
+ *
180
+ * Cheap: a battery provider serves this from its runtime-state slice,
181
+ * so the probe costs one RPC and zero camera traffic. Only consulted
182
+ * on the path that would otherwise CAPTURE — a fresh cache hit
183
+ * returns before we get here.
179
184
  */
185
+ private isDeviceSleeping;
180
186
  /**
181
187
  * True when at least one of the device's brokers is actively
182
188
  * streaming (status === 'streaming'). Used by the battery-cam guard
@@ -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-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_chunk.__toESM(node_fs);
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { $ as storageProviderCapability, at as BaseAddon, k as filesystemBrowseCapability } from "../../dist-CxM20CkF.mjs";
1
+ import { A as filesystemBrowseCapability, et as storageProviderCapability, ot as BaseAddon } from "../../dist-DpKeSZel.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import * as path$1 from "node:path";
4
4
  import { basename, dirname, join, resolve, sep } from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let better_sqlite3 = require("better-sqlite3");
9
9
  better_sqlite3 = require_chunk.__toESM(better_sqlite3);
@@ -1,4 +1,4 @@
1
- import { Tt as parseJsonUnknown, X as settingsStoreCapability, at as BaseAddon, ht as asJsonObject, it as errMsg, s as RUNTIME_DEFAULTS } from "../../dist-CxM20CkF.mjs";
1
+ import { Et as parseJsonUnknown, Z as settingsStoreCapability, at as errMsg, c as RUNTIME_DEFAULTS, gt as asJsonObject, ot as BaseAddon } from "../../dist-DpKeSZel.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import Database from "better-sqlite3";
4
4
  //#region src/builtins/sqlite-storage/sqlite-settings-backend.ts
@@ -65,6 +65,18 @@ export declare class StorageOrchestratorAddon extends BaseAddon<StorageOrchestra
65
65
  */
66
66
  private resolveLocationThresholds;
67
67
  private locationBasePath;
68
+ /**
69
+ * A stable key for the PHYSICAL storage device behind a location — the
70
+ * `realpath` of its `basePath`, so symlinked / bind-mounted aliases and
71
+ * same-root managed locations (`recordings:default` + `recordingsLow:default`,
72
+ * both at `/recordings`) collapse to one key. Feeds the pressure manager's
73
+ * in-sweep dedup so a shared disk is relieved at most once per tick (closing
74
+ * the bounded over-eviction window; see `getLocationDeviceKey`). Falls back to
75
+ * the lexically-resolved path when realpath throws (root missing at boot),
76
+ * `null` when the location has no basePath — either way dedup degrades to
77
+ * per-location, never merging two distinct disks.
78
+ */
79
+ private locationDeviceKey;
68
80
  /** Free capacity (%) on a location's volume via `statfs`; 100 (guard inert) when unstattable. */
69
81
  private locationFreePercent;
70
82
  /** Total bytes on a location's volume via `statfs`; 0 when unstattable. */
@@ -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-CdgScQ3H.js");
6
+ const require_dist = require("../../dist-BQOCTD5b.js");
7
7
  let node_path = require("node:path");
8
8
  node_path = require_chunk.__toESM(node_path);
9
9
  let node_fs_promises = require("node:fs/promises");
@@ -614,10 +614,19 @@ var StoragePressureManager = class {
614
614
  /** Relieve every managed location currently under its threshold. */
615
615
  async sweep() {
616
616
  const thresholds = await this.deps.getLocationThresholds();
617
+ const relievedDevices = /* @__PURE__ */ new Set();
617
618
  for (const [locationId, threshold] of thresholds) {
618
619
  if (threshold <= 0) continue;
620
+ const deviceKey = await this.deps.getLocationDeviceKey?.(locationId) ?? null;
621
+ if (deviceKey !== null && relievedDevices.has(deviceKey)) {
622
+ this.deps.logger.debug("storage pressure: skipping location — physical device already relieved this sweep", { meta: {
623
+ locationId,
624
+ deviceKey
625
+ } });
626
+ continue;
627
+ }
619
628
  try {
620
- await this.relieveLocation(locationId, threshold);
629
+ if (await this.relieveLocation(locationId, threshold) && deviceKey !== null) relievedDevices.add(deviceKey);
621
630
  } catch (err) {
622
631
  this.deps.logger.warn("storage pressure: relief failed for location", { meta: {
623
632
  locationId,
@@ -626,16 +635,25 @@ var StoragePressureManager = class {
626
635
  }
627
636
  }
628
637
  }
638
+ /**
639
+ * Relieve one location until it recovers, nothing is evictable, or a round
640
+ * makes no progress. Returns `true` when at least one relief round actually
641
+ * reclaimed bytes (so the caller marks the location's physical device relieved
642
+ * for this sweep — the trigger for the over-eviction dedup: freed bytes mean a
643
+ * sibling alias may re-read a not-yet-settled `statfs`), `false` when nothing
644
+ * was freed (never breached, or breached with no evictable data).
645
+ */
629
646
  async relieveLocation(locationId, threshold) {
630
647
  const maxRounds = this.deps.maxRounds ?? DEFAULT_MAX_ROUNDS;
631
648
  const hysteresis = this.deps.hysteresisPercent ?? DEFAULT_HYSTERESIS_PERCENT;
649
+ let reclaimedAny = false;
632
650
  for (let round = 0; round < maxRounds; round++) {
633
651
  const free = await this.deps.getFreePercent(locationId);
634
- if (free >= threshold) return;
652
+ if (free >= threshold) return reclaimedAny;
635
653
  const total = await this.deps.getVolumeTotalBytes(locationId);
636
654
  const deficitPercent = threshold - free + hysteresis;
637
655
  const targetBytes = Math.ceil(total * deficitPercent / 100);
638
- if (targetBytes <= 0) return;
656
+ if (targetBytes <= 0) return reclaimedAny;
639
657
  const providers = this.deps.getEvictableProviders();
640
658
  const usages = await Promise.all(providers.map(async (p) => ({
641
659
  p,
@@ -648,7 +666,7 @@ var StoragePressureManager = class {
648
666
  freePercent: free,
649
667
  threshold
650
668
  } });
651
- return;
669
+ return reclaimedAny;
652
670
  }
653
671
  let reclaimed = 0;
654
672
  for (const u of usages) {
@@ -660,6 +678,7 @@ var StoragePressureManager = class {
660
678
  });
661
679
  reclaimed += res.reclaimedBytes;
662
680
  }
681
+ if (reclaimed > 0) reclaimedAny = true;
663
682
  this.deps.logger.info("storage pressure: relief round", { meta: {
664
683
  locationId,
665
684
  round,
@@ -668,8 +687,9 @@ var StoragePressureManager = class {
668
687
  targetBytes,
669
688
  reclaimedBytes: reclaimed
670
689
  } });
671
- if (reclaimed <= 0) return;
690
+ if (reclaimed <= 0) return reclaimedAny;
672
691
  }
692
+ return reclaimedAny;
673
693
  }
674
694
  };
675
695
  //#endregion
@@ -923,7 +943,8 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
923
943
  getFreePercent: (id) => this.locationFreePercent(id),
924
944
  getVolumeTotalBytes: (id) => this.locationVolumeTotalBytes(id),
925
945
  getEvictableProviders: () => this.ctx.kernel.capabilityRegistry?.getCollection(STORAGE_EVICTABLE_CAP_NAME) ?? [],
926
- getLocationThresholds: () => this.resolveLocationThresholds()
946
+ getLocationThresholds: () => this.resolveLocationThresholds(),
947
+ getLocationDeviceKey: (id) => this.locationDeviceKey(id)
927
948
  });
928
949
  this.pressureTimer = setInterval(() => {
929
950
  this.runPressureSweep();
@@ -1036,6 +1057,26 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
1036
1057
  const bp = (this.service?.listLocations().find((l) => l.id === locationId))?.config["basePath"];
1037
1058
  return typeof bp === "string" && bp.length > 0 ? bp : null;
1038
1059
  }
1060
+ /**
1061
+ * A stable key for the PHYSICAL storage device behind a location — the
1062
+ * `realpath` of its `basePath`, so symlinked / bind-mounted aliases and
1063
+ * same-root managed locations (`recordings:default` + `recordingsLow:default`,
1064
+ * both at `/recordings`) collapse to one key. Feeds the pressure manager's
1065
+ * in-sweep dedup so a shared disk is relieved at most once per tick (closing
1066
+ * the bounded over-eviction window; see `getLocationDeviceKey`). Falls back to
1067
+ * the lexically-resolved path when realpath throws (root missing at boot),
1068
+ * `null` when the location has no basePath — either way dedup degrades to
1069
+ * per-location, never merging two distinct disks.
1070
+ */
1071
+ async locationDeviceKey(locationId) {
1072
+ const bp = this.locationBasePath(locationId);
1073
+ if (!bp) return null;
1074
+ try {
1075
+ return await node_fs_promises.realpath(bp);
1076
+ } catch {
1077
+ return node_path.resolve(bp);
1078
+ }
1079
+ }
1039
1080
  /** Free capacity (%) on a location's volume via `statfs`; 100 (guard inert) when unstattable. */
1040
1081
  async locationFreePercent(locationId) {
1041
1082
  const bp = this.locationBasePath(locationId);