@camstack/system 1.2.380 → 1.2.382

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 (117) hide show
  1. package/dist/addon-runner.js +4 -2
  2. package/dist/addon-runner.mjs +4 -2
  3. package/dist/addon-utils.js +1 -1
  4. package/dist/addon-utils.mjs +1 -1
  5. package/dist/auth/admin-token-manager.d.ts +75 -0
  6. package/dist/auth/api-key-manager.d.ts +1 -14
  7. package/dist/auth/auth-audit-log.d.ts +59 -0
  8. package/dist/auth/auth-manager.d.ts +28 -16
  9. package/dist/auth/cidr.d.ts +22 -0
  10. package/dist/auth/login-session-manager.d.ts +158 -0
  11. package/dist/auth/user-management-internal.d.ts +69 -0
  12. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  13. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  14. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  15. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  16. package/dist/builtins/alerts/alerts.addon.js +1 -1
  17. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  18. package/dist/builtins/autotrack/index.js +1 -1
  19. package/dist/builtins/autotrack/index.mjs +1 -1
  20. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +14 -0
  21. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +291 -3631
  22. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +284 -3617
  23. package/dist/builtins/backup-orchestrator/encryption-key-store.d.ts +36 -0
  24. package/dist/builtins/backup-orchestrator/manifest-store.d.ts +19 -1
  25. package/dist/builtins/backup-orchestrator/restore-archive.d.ts +24 -0
  26. package/dist/builtins/calendars/calendars.addon.js +1 -1
  27. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  28. package/dist/builtins/camera-grid/index.js +1 -1
  29. package/dist/builtins/camera-grid/index.mjs +1 -1
  30. package/dist/builtins/composer/composer.addon.js +2 -2
  31. package/dist/builtins/composer/composer.addon.mjs +2 -2
  32. package/dist/builtins/console-logging/index.js +1 -1
  33. package/dist/builtins/console-logging/index.mjs +1 -1
  34. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  35. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  36. package/dist/builtins/device-manager/device-aggregation.d.ts +12 -0
  37. package/dist/builtins/device-manager/device-form-secrets.d.ts +25 -0
  38. package/dist/builtins/device-manager/device-manager.addon.d.ts +2 -0
  39. package/dist/builtins/device-manager/device-manager.addon.js +165 -26
  40. package/dist/builtins/device-manager/device-manager.addon.mjs +165 -26
  41. package/dist/builtins/hub-forwarder/index.js +1 -1
  42. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  43. package/dist/builtins/keychain/index.js +1108 -733
  44. package/dist/builtins/keychain/index.mjs +1108 -733
  45. package/dist/builtins/keychain/keychain-reset-trigger.d.ts +25 -0
  46. package/dist/builtins/keychain/keychain-service.d.ts +36 -3
  47. package/dist/builtins/keychain/keychain-store.d.ts +24 -1
  48. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  49. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  50. package/dist/builtins/local-auth/local-auth.addon.d.ts +16 -0
  51. package/dist/builtins/local-auth/local-auth.addon.js +1021 -118
  52. package/dist/builtins/local-auth/local-auth.addon.mjs +1034 -141
  53. package/dist/builtins/local-network/local-network.addon.js +3 -3
  54. package/dist/builtins/local-network/local-network.addon.mjs +3 -3
  55. package/dist/builtins/loki-logging/index.js +97 -29
  56. package/dist/builtins/loki-logging/index.mjs +97 -29
  57. package/dist/builtins/loki-logging/loki-logging.addon.d.ts +7 -23
  58. package/dist/builtins/loki-logging/retire-enabled-flag.d.ts +23 -0
  59. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  60. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  61. package/dist/builtins/platform-probe/index.js +1 -1
  62. package/dist/builtins/platform-probe/index.mjs +1 -1
  63. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  64. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  65. package/dist/builtins/snapshot/index.js +1 -1
  66. package/dist/builtins/snapshot/index.mjs +1 -1
  67. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  68. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  69. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  70. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  71. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +2 -2
  72. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +2 -2
  73. package/dist/builtins/system-backup/backup-encryption.d.ts +57 -0
  74. package/dist/builtins/system-backup/system-backup.service.d.ts +16 -1
  75. package/dist/builtins/system-config/cluster-secret-keeper.d.ts +7 -0
  76. package/dist/builtins/system-config/system-config.addon.d.ts +13 -3
  77. package/dist/builtins/system-config/system-config.addon.js +324 -38
  78. package/dist/builtins/system-config/system-config.addon.mjs +312 -39
  79. package/dist/builtins/winston-logging/index.js +1 -1
  80. package/dist/builtins/winston-logging/index.mjs +1 -1
  81. package/dist/{child-cap-dispatch-CZeRUgYF.js → child-cap-dispatch-BrMdKHfp.js} +6 -3
  82. package/dist/{child-cap-dispatch-CpjohToR.mjs → child-cap-dispatch-WsYPNvnK.mjs} +10 -7
  83. package/dist/{cluster-secret-Dg0OOOSr.js → cluster-secret-BEPLh3LL.js} +1 -1
  84. package/dist/{cluster-secret-BDue-uJj.mjs → cluster-secret-DhPdZ0VA.mjs} +1 -1
  85. package/dist/{composition-sources-CHvLMrFI.js → composition-sources-C6ZynCZ2.js} +1 -1
  86. package/dist/{composition-sources-DT_uJwI3.mjs → composition-sources-XqRX51db.mjs} +1 -1
  87. package/dist/{dist-B9oFw2jh.mjs → dist-CP5TTjwd.mjs} +1713 -157
  88. package/dist/{dist-Cc6KOdY-.js → dist-tnAO12ak.js} +1754 -156
  89. package/dist/{event-loop-stall-monitor-mk6WGxir.js → event-loop-stall-monitor-9kR0sAPS.js} +15 -15
  90. package/dist/{event-loop-stall-monitor-anUH2IE1.mjs → event-loop-stall-monitor-WkssIXjq.mjs} +15 -15
  91. package/dist/{hub-cap-forward-CH6_VWVO.mjs → hub-cap-forward-CDiN1p98.mjs} +18 -2
  92. package/dist/{hub-cap-forward-COCmYaup.js → hub-cap-forward-W8oEm4ME.js} +23 -1
  93. package/dist/index.d.ts +16 -1
  94. package/dist/index.js +3341 -79
  95. package/dist/index.mjs +3567 -354
  96. package/dist/{jwt-signing-key-Qhde8r82.mjs → jwt-signing-key-CAbozwvF.mjs} +1 -1
  97. package/dist/{jwt-signing-key-C2rE3wH6.js → jwt-signing-key-Dgf8sIXY.js} +1 -1
  98. package/dist/kernel/index.d.ts +12 -0
  99. package/dist/kernel/moleculer/broker-factory.d.ts +8 -1
  100. package/dist/kernel/moleculer/child-addon-call-dispatch.d.ts +1 -0
  101. package/dist/kernel/moleculer/hub-service.d.ts +9 -0
  102. package/dist/kernel/moleculer/mesh-access-middleware.d.ts +28 -0
  103. package/dist/kernel/moleculer/mesh-auth-mode.d.ts +64 -0
  104. package/dist/kernel/moleculer/mesh-authenticator.d.ts +71 -0
  105. package/dist/kernel/moleculer/mesh-auto-enforce.d.ts +26 -0
  106. package/dist/kernel/moleculer/mesh-join-client.d.ts +51 -0
  107. package/dist/kernel/moleculer/mesh-join-proof.d.ts +39 -0
  108. package/dist/kernel/system-settings-policy.d.ts +4 -3
  109. package/dist/kernel/transport/hub-cap-forward.d.ts +14 -3
  110. package/dist/kernel/transport/index.d.ts +1 -1
  111. package/dist/restore-archive-BV39nY46.mjs +4045 -0
  112. package/dist/restore-archive-CbvrfPuB.js +4139 -0
  113. package/dist/{retired-settings-keys-YOOKLA3v.js → retired-settings-keys-4bHpL-0m.js} +1 -1
  114. package/dist/{retired-settings-keys-DlZ3VV6x.mjs → retired-settings-keys-CzpIkwS-.mjs} +1 -1
  115. package/dist/{tls-CJHogwTl.mjs → tls-4cRH24Id.mjs} +3 -3
  116. package/package.json +1 -1
  117. package/dist/{tls-CCMX7MjX.js → tls-CljF057D.js} +1 -1
@@ -1,5 +1,5 @@
1
- import { $ as buildStreamParamsConfigSchema, A as MINUTES_PER_DAY, C as FieldClaimModeSchema, Dn as runtimeStatePolicyFor, Hr as secretTreeFromPaths, Kr as transformSecretWrite, Kt as legacyAutoLinkIds, L as STREAM_PROFILE_META, Mn as siteZoneKey, Nt as formatMinutes, O as LocationIconIdSchema, Ot as expandContainer, Sr as collectZodSecretPaths, St as deviceStatusCapability, Tt as enumerateSchemaFields, Wr as sleep$1, Xt as locationIconKey, ar as DeviceFeature, bt as deviceManagerCapability, c as CAP_NAMES_WITH_STATUS, cn as normalizeUnit, cr as errMsg, dn as parseStreamParamsFormPatch, dt as createDeviceExtensionProvider, gr as WELL_KNOWN_TAB_MAP, gt as defineExtensionSlotProvider, kr as isDeviceConfigCap, lr as BaseAddon, o as CAMERA_SWITCH_ORDER, or as DeviceRole, qr as EventCategory, sr as DeviceType, t as ALL_CAPABILITY_DEFINITIONS, v as DAY_NAMES, w as FieldClaimSchema, wt as enumerateItemArrayFields, x as DeviceStatusSchema, xt as deviceStateCapability, yt as deviceExtensionCapability, zr as resolveSecretMarkers } from "../../dist-B9oFw2jh.mjs";
2
- import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-DlZ3VV6x.mjs";
1
+ import { $r as transformSecretWrite, C as FieldClaimModeSchema, Ct as deviceStatusCapability, Et as enumerateSchemaFields, Fr as isSecretMarker, Gr as resolveSecretMarkers, Ir as isSecretMarkerLike, Jr as secretTreeFromPaths, Nn as siteZoneKey, Nr as isKeychainStoredField, On as runtimeStatePolicyFor, Pr as isSecretClear, Pt as formatMinutes, Qr as toSecretFieldView, R as STREAM_PROFILE_META, St as deviceStateCapability, Tt as enumerateItemArrayFields, Xr as sleep$1, Zt as locationIconKey, _r as SECRET_CLEAR, _t as defineExtensionSlotProvider, bt as deviceExtensionCapability, c as CAP_NAMES_WITH_STATUS, cr as DeviceType, ei as EventCategory, et as buildStreamParamsConfigSchema, fn as parseStreamParamsFormPatch, ft as createDeviceExtensionProvider, j as MINUTES_PER_DAY, jr as isDeviceConfigCap, k as LocationIconIdSchema, kt as expandContainer, ln as normalizeUnit, lr as errMsg, o as CAMERA_SWITCH_ORDER, or as DeviceFeature, qt as legacyAutoLinkIds, sr as DeviceRole, t as ALL_CAPABILITY_DEFINITIONS, ur as BaseAddon, v as DAY_NAMES, vr as WELL_KNOWN_TAB_MAP, w as FieldClaimSchema, wr as collectZodSecretPaths, x as DeviceStatusSchema, xt as deviceManagerCapability } from "../../dist-CP5TTjwd.mjs";
2
+ import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-CzpIkwS-.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { canonicalDeviceFingerprint } from "@camstack/types/node";
@@ -1028,6 +1028,105 @@ function mergeAggregates(parts) {
1028
1028
  return out;
1029
1029
  }
1030
1030
  //#endregion
1031
+ //#region src/builtins/device-manager/device-form-secrets.ts
1032
+ /**
1033
+ * A driver's device-settings form, kept on the keychain side of the wire
1034
+ * (D787 / D789 for device forms).
1035
+ *
1036
+ * A driver hydrates its own form from the config `loadConfig` RESOLVED for it,
1037
+ * so a camera password reaches the form as plaintext even though the stored
1038
+ * blob holds a keychain marker. This module closes that in ONE place — the
1039
+ * device-manager aggregate every device form goes through — for every driver:
1040
+ *
1041
+ * - READ ({@link viewStoredSecrets}): a form field whose key names a stored
1042
+ * MARKER (a declared `secretConfigPaths` entry, or a field secret by type)
1043
+ * is handed the marker's VIEW instead of the driver's plaintext. A value
1044
+ * that is still inline plaintext in the blob (not migrated) is left as the
1045
+ * driver hydrated it: there is nothing to reveal it by.
1046
+ * - WRITE ({@link applyDriverFormPatch}): the form sends the view back for an
1047
+ * untouched field and `{ $secretClear: true }` for an explicit clear. The
1048
+ * driver understands neither (its schema wants a string), so a view is
1049
+ * dropped from the driver's patch (KEEP — the driver still holds the
1050
+ * resolved value) and a clear reaches the driver as `''` while the stored
1051
+ * marker is removed at the keychain door. A typed value passes through and
1052
+ * the driver's own persist stores it in the keychain.
1053
+ *
1054
+ * Top-level keys only: a driver form's field key is its config key for every
1055
+ * declared device secret today (`password`, `apiKey`, `localKey`). A nested or
1056
+ * per-row path (`connection.password`, `rows[].pin`) is not mapped onto a form
1057
+ * field and keeps the driver's hydration.
1058
+ */
1059
+ function isRecord$2(value) {
1060
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1061
+ }
1062
+ /** The declared paths that name a top-level config key. */
1063
+ function topLevelKeys(paths) {
1064
+ return new Set(paths.filter((p) => p.length > 0 && !p.includes(".") && !p.includes("[")));
1065
+ }
1066
+ function viewField(field, stored, declared) {
1067
+ if (!isRecord$2(field)) return field;
1068
+ const nested = field["fields"];
1069
+ if (Array.isArray(nested)) return {
1070
+ ...field,
1071
+ fields: nested.map((f) => viewField(f, stored, declared))
1072
+ };
1073
+ const tabs = field["tabs"];
1074
+ if (Array.isArray(tabs)) return {
1075
+ ...field,
1076
+ tabs: tabs.map((tab) => isRecord$2(tab) && Array.isArray(tab["fields"]) ? {
1077
+ ...tab,
1078
+ fields: tab["fields"].map((f) => viewField(f, stored, declared))
1079
+ } : tab)
1080
+ };
1081
+ const key = field["key"];
1082
+ if (typeof key !== "string" || !("value" in field)) return field;
1083
+ const marker = stored[key];
1084
+ if (!isSecretMarker(marker)) return field;
1085
+ const secretByType = isKeychainStoredField(field);
1086
+ if (!secretByType && !declared.has(key)) return field;
1087
+ const type = secretByType ? field["type"] : "password";
1088
+ return {
1089
+ ...field,
1090
+ type,
1091
+ value: toSecretFieldView(marker)
1092
+ };
1093
+ }
1094
+ /**
1095
+ * The driver's hydrated sections with every keychain-stored secret replaced
1096
+ * by its view. Returns the input unchanged when the blob holds no marker.
1097
+ */
1098
+ function viewStoredSecrets(sections, stored, declaredPaths) {
1099
+ if (!Object.values(stored).some(isSecretMarker)) return sections;
1100
+ const declared = topLevelKeys(declaredPaths);
1101
+ return sections.map((section) => ({
1102
+ ...section,
1103
+ fields: section.fields.map((f) => viewField(f, stored, declared))
1104
+ }));
1105
+ }
1106
+ /** Split a device-settings form patch (see the module doc). */
1107
+ function splitDriverFormPatch(patch) {
1108
+ const driverPatch = {};
1109
+ const clearKeys = [];
1110
+ for (const [key, value] of Object.entries(patch)) if (isSecretClear(value)) {
1111
+ driverPatch[key] = "";
1112
+ clearKeys.push(key);
1113
+ } else if (!isSecretMarkerLike(value)) driverPatch[key] = value;
1114
+ return {
1115
+ driverPatch,
1116
+ clearKeys
1117
+ };
1118
+ }
1119
+ /**
1120
+ * Apply a device-settings form patch: the driver gets plain values only, then
1121
+ * an explicit clear removes the stored secret at the keychain door (after the
1122
+ * driver's own persist, whose `''` the door reads as KEEP).
1123
+ */
1124
+ async function applyDriverFormPatch(input) {
1125
+ const { driverPatch, clearKeys } = splitDriverFormPatch(input.patch);
1126
+ if (Object.keys(driverPatch).length > 0) await input.applyToDriver(driverPatch);
1127
+ if (clearKeys.length > 0) await input.clearSecrets(clearKeys);
1128
+ }
1129
+ //#endregion
1031
1130
  //#region src/builtins/device-manager/stale-wrapper-activations.ts
1032
1131
  /**
1033
1132
  * A stored wrapper activation that names a cap with NO wrapper any more.
@@ -3446,6 +3545,25 @@ function refusedLinkedPicks(params) {
3446
3545
  //#endregion
3447
3546
  //#region src/builtins/device-manager/device-aggregation.ts
3448
3547
  /**
3548
+ * A driver's hydrated sections as the browser may see them: every secret the
3549
+ * keychain stores is its VIEW, never the plaintext the driver was handed by
3550
+ * `loadConfig`. An unreadable blob withholds nothing new — the non-admin
3551
+ * redaction still runs at the transport — but it is logged.
3552
+ */
3553
+ async function driverSectionsWithSecretViews(deps, deviceId, sections) {
3554
+ const door = deps.deviceFormSecrets;
3555
+ if (!door) return sections;
3556
+ try {
3557
+ return viewStoredSecrets(sections, await door.readStored(deviceId), door.declaredPaths(deviceId));
3558
+ } catch (err) {
3559
+ deps.ctx.logger.warn("device form: stored config unreadable — secret views not applied", {
3560
+ tags: { deviceId },
3561
+ meta: { error: errMsg(err) }
3562
+ });
3563
+ return sections;
3564
+ }
3565
+ }
3566
+ /**
3449
3567
  * One process-wide cache behind every device-details fan-out.
3450
3568
  *
3451
3569
  * Module-level on purpose: the page re-polls every 2.5 s and a per-call cache
@@ -3671,16 +3789,18 @@ async function buildBaseDeviceSection(deps, deviceId) {
3671
3789
  if (!hubLocal && !nativeOwner) return null;
3672
3790
  const sections = [];
3673
3791
  const driverResult = await resolveDriverConfigSchema(deps, deviceId, hubLocal);
3674
- if (driverResult.status === "ok") for (const section of driverResult.schema.sections) sections.push({
3675
- id: section.id,
3676
- title: section.title,
3677
- tab: section.tab ?? "general",
3678
- order: section.order ?? 1,
3679
- fields: [...section.fields],
3680
- ...section.description !== void 0 ? { description: section.description } : {},
3681
- ...section.columns !== void 0 ? { columns: section.columns } : {}
3682
- });
3683
- else if (driverResult.status === "unavailable") sections.push({
3792
+ if (driverResult.status === "ok") {
3793
+ const driverSections = await driverSectionsWithSecretViews(deps, deviceId, driverResult.schema.sections);
3794
+ for (const section of driverSections) sections.push({
3795
+ id: section.id,
3796
+ title: section.title,
3797
+ tab: section.tab ?? "general",
3798
+ order: section.order ?? 1,
3799
+ fields: [...section.fields],
3800
+ ...section.description !== void 0 ? { description: section.description } : {},
3801
+ ...section.columns !== void 0 ? { columns: section.columns } : {}
3802
+ });
3803
+ } else if (driverResult.status === "unavailable") sections.push({
3684
3804
  id: "driver-settings-unavailable",
3685
3805
  title: "Driver Settings",
3686
3806
  tab: "general",
@@ -4074,19 +4194,26 @@ async function applyGroupPatch(deps, deviceId, group) {
4074
4194
  });
4075
4195
  throw new Error(`[device-manager] ${retired.join(", ")} can no longer be saved from the settings section — reload the page and use the Extensions section`);
4076
4196
  }
4077
- const driverPatch = group.patch;
4078
- if (Object.keys(driverPatch).length === 0) return;
4079
- const hubRegistry = deps.ctx.kernel?.deviceRegistry;
4080
- const found = hubRegistry ? resolveDeviceById(hubRegistry, deviceId) : null;
4081
- if (found) {
4082
- await found.device.applySettingsPatch(driverPatch);
4083
- return;
4084
- }
4085
- const ops = deps.capabilityRegistry?.getNativeProvider("device-ops", deviceId);
4086
- if (!ops) throw new Error(`[device-manager] device "${deviceId}" not found (no hub-local entry, no device-ops native provider)`);
4087
- await ops.setConfig({
4088
- deviceId,
4089
- values: driverPatch
4197
+ await applyDriverFormPatch({
4198
+ patch: group.patch,
4199
+ applyToDriver: async (driverPatch) => {
4200
+ const hubRegistry = deps.ctx.kernel?.deviceRegistry;
4201
+ const found = hubRegistry ? resolveDeviceById(hubRegistry, deviceId) : null;
4202
+ if (found) {
4203
+ await found.device.applySettingsPatch(driverPatch);
4204
+ return;
4205
+ }
4206
+ const ops = deps.capabilityRegistry?.getNativeProvider("device-ops", deviceId);
4207
+ if (!ops) throw new Error(`[device-manager] device "${deviceId}" not found (no hub-local entry, no device-ops native provider)`);
4208
+ await ops.setConfig({
4209
+ deviceId,
4210
+ values: driverPatch
4211
+ });
4212
+ },
4213
+ clearSecrets: async (keys) => {
4214
+ if (!deps.deviceFormSecrets) throw new Error(`[device-manager] cannot clear ${keys.join(", ")}: no keychain door`);
4215
+ await deps.deviceFormSecrets.clear(deviceId, keys);
4216
+ }
4090
4217
  });
4091
4218
  return;
4092
4219
  }
@@ -9712,6 +9839,8 @@ var DeviceManagerAddon = class extends BaseAddon {
9712
9839
  removalFence = createRemovalFence();
9713
9840
  /** Declared secret config paths per device, as last registered (D783). */
9714
9841
  secretConfigPaths = createSecretConfigPathRegistry();
9842
+ /** The keychain side of driver device forms (D789), wired in onInitialize. */
9843
+ deviceFormSecrets;
9715
9844
  /** The runtime-state mirror, asserted present (constructed in onInitialize). */
9716
9845
  get stateMirror() {
9717
9846
  if (!this.stateMirrorImpl) throw new Error("DeviceManagerAddon: state mirror accessed before onInitialize");
@@ -9864,7 +9993,8 @@ var DeviceManagerAddon = class extends BaseAddon {
9864
9993
  ctx: this.ctx,
9865
9994
  capabilityRegistry: this.capabilityRegistry,
9866
9995
  remoteNativeCaps: this.remoteNativeCaps,
9867
- bindingsDeps: this.bindingsDeps
9996
+ bindingsDeps: this.bindingsDeps,
9997
+ ...this.deviceFormSecrets ? { deviceFormSecrets: this.deviceFormSecrets } : {}
9868
9998
  };
9869
9999
  }
9870
10000
  async getDeviceAggregate(deviceId, kind) {
@@ -9960,6 +10090,15 @@ var DeviceManagerAddon = class extends BaseAddon {
9960
10090
  return provider;
9961
10091
  }
9962
10092
  };
10093
+ this.deviceFormSecrets = {
10094
+ readStored: (deviceId) => settings.readDeviceStore(deviceId),
10095
+ declaredPaths: (deviceId) => this.secretConfigPaths.get(deviceId) ?? [],
10096
+ clear: (deviceId, keys) => persistConfig(pctx, {
10097
+ deviceId,
10098
+ data: Object.fromEntries(keys.map((key) => [key, SECRET_CLEAR])),
10099
+ secretConfigPaths: [...new Set([...this.secretConfigPaths.get(deviceId) ?? [], ...keys])]
10100
+ })
10101
+ };
9963
10102
  try {
9964
10103
  await runLocationBackfillAtBoot(pctx, bootRows);
9965
10104
  } catch (err) {
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-Cc6KOdY-.js");
6
+ const require_dist = require("../../dist-tnAO12ak.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 { Zt as logDestinationCapability, lr as BaseAddon } from "../../dist-B9oFw2jh.mjs";
1
+ import { Qt as logDestinationCapability, ur as BaseAddon } from "../../dist-CP5TTjwd.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;