@camstack/server 1.2.893 → 1.2.895

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 (99) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/core/api-catalog.js +93 -0
  3. package/dist/api/core/api-catalog.router.js +74 -0
  4. package/dist/api/trpc/generated-cap-mounts.js +3 -1
  5. package/dist/api/trpc/generated-cap-routers.js +1528 -1499
  6. package/dist/api/trpc/trpc.middleware.js +17 -0
  7. package/dist/api/trpc/trpc.router.js +10 -3
  8. package/package.json +27 -13
  9. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  10. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  11. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  12. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  13. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  14. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  15. package/system/dist/builtins/autotrack/index.js +1 -1
  16. package/system/dist/builtins/autotrack/index.mjs +1 -1
  17. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  18. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  19. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  20. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  21. package/system/dist/builtins/camera-grid/index.js +1 -1
  22. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  23. package/system/dist/builtins/composer/composer.addon.js +5 -5
  24. package/system/dist/builtins/composer/composer.addon.mjs +5 -5
  25. package/system/dist/builtins/composer/graft-host.d.ts +1 -1
  26. package/system/dist/builtins/console-logging/index.js +1 -1
  27. package/system/dist/builtins/console-logging/index.mjs +1 -1
  28. package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  29. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  30. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  31. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  32. package/system/dist/builtins/device-manager/device-manager.addon.js +79 -8
  33. package/system/dist/builtins/device-manager/device-manager.addon.mjs +79 -8
  34. package/system/dist/builtins/device-manager/device-provider-context.d.ts +5 -0
  35. package/system/dist/builtins/device-manager/device-state-mirror.d.ts +10 -0
  36. package/system/dist/builtins/device-manager/runtime-state-persist-gate.d.ts +20 -1
  37. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  38. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  39. package/system/dist/builtins/keychain/index.js +4 -4
  40. package/system/dist/builtins/keychain/index.mjs +4 -4
  41. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  42. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  43. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  44. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  45. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  46. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  47. package/system/dist/builtins/loki-logging/index.js +1 -1
  48. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  49. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  50. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  51. package/system/dist/builtins/platform-probe/index.js +1 -1
  52. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  53. package/system/dist/builtins/record-entries/index.js +1 -1
  54. package/system/dist/builtins/record-entries/index.mjs +1 -1
  55. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  56. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  57. package/system/dist/builtins/snapshot/index.js +14 -12
  58. package/system/dist/builtins/snapshot/index.mjs +14 -12
  59. package/system/dist/builtins/snapshot/snapshot.addon.d.ts +6 -4
  60. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  61. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  62. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  63. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  64. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  65. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  66. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  67. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  68. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  69. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  70. package/system/dist/builtins/winston-logging/index.js +1 -1
  71. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  72. package/system/dist/{capture-engine-mZ2J-GD6.js → capture-engine-BgIjQWh6.js} +1 -1
  73. package/system/dist/{capture-engine-CIVKm_jN.mjs → capture-engine-DPn6JaPc.mjs} +1 -1
  74. package/system/dist/{composition-sources-bJP8_Z2o.mjs → composition-sources-B0rdPm85.mjs} +1 -1
  75. package/system/dist/{composition-sources-CGP5ZUYo.js → composition-sources-Bec_hQMM.js} +1 -1
  76. package/system/dist/{constants-BD8oSQro.js → constants-CsYMak6g.js} +1 -1
  77. package/system/dist/{constants-w-6vvTPp.mjs → constants-DsQsO8PD.mjs} +1 -1
  78. package/system/dist/{device-ca-CXxnQaff.js → device-ca-BeK8EI_7.js} +1 -1
  79. package/system/dist/{device-ca-DE_oetBE.mjs → device-ca-BuDqRFZd.mjs} +1 -1
  80. package/system/dist/{dist-B2-Uflhy.js → dist-CHC8tlB1.js} +351 -110
  81. package/system/dist/{dist-Be8yFd71.mjs → dist-DiknL6UU.mjs} +334 -99
  82. package/system/dist/file-host-worker.js +1 -1
  83. package/system/dist/file-host-worker.mjs +1 -1
  84. package/system/dist/{hub-identity-BjYvJU_v.js → hub-identity-BM26oLpK.js} +1 -1
  85. package/system/dist/{hub-identity-C3g7b58L.mjs → hub-identity-Dt-mbtkY.mjs} +1 -1
  86. package/system/dist/{hub-mdns-ciao-BRfv9GfW.js → hub-mdns-ciao-BDgSHCPM.js} +2 -2
  87. package/system/dist/{hub-mdns-ciao-v6X_SbWl.mjs → hub-mdns-ciao-CHq7b1FX.mjs} +2 -2
  88. package/system/dist/index.js +8 -8
  89. package/system/dist/index.mjs +8 -8
  90. package/system/dist/kernel/status-overlay.d.ts +1 -1
  91. package/system/dist/{legacy-integration-rows-door-DG35DG06.mjs → legacy-integration-rows-door-1WauJNCy.mjs} +1 -1
  92. package/system/dist/{legacy-integration-rows-door-B0q34gh3.js → legacy-integration-rows-door-BYJa0xPI.js} +1 -1
  93. package/system/dist/{rename-composition-block-LEbZ4oZE.mjs → rename-composition-block-BOoAElGp.mjs} +1 -1
  94. package/system/dist/{rename-composition-block-DNte3Cs9.js → rename-composition-block-fMaUic9d.js} +1 -1
  95. package/system/dist/{restore-archive-DpFPheMK.js → restore-archive-CeZV08vh.js} +1 -1
  96. package/system/dist/{restore-archive--4ENkU5f.mjs → restore-archive-DZDV10KN.mjs} +82 -82
  97. package/system/dist/{wal-maintenance-DQVDhuVJ.mjs → wal-maintenance-CekT_qH6.mjs} +0 -0
  98. package/system/dist/{wal-maintenance-BWUJktqT.js → wal-maintenance-CmCCUKZO.js} +0 -0
  99. package/system/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { $ as DEVICE_TEMPLATE_VALUES_CAP, $s as implementedMethodsOf$1, Bi as isKernelDerivedFeature, Br as deviceExtensionCapability, Ca as normalizeTags, Dn as WORKLOAD_TRANSITION_CATEGORY, Do as sameIdentifiers, Dr as createDeviceExtensionProvider, El as isDeviceConfigCap, Eo as runtimeStatePolicyFor, Fr as defineExtensionSlotProvider, Gi as isWorkloadSettled, Hc as SECRET_CLEAR, Ho as siteZoneKey, Hr as deviceManagerCapability, Io as settleDeviceFeatures, It as MINUTES_PER_DAY, Jc as WELL_KNOWN_TAB_MAP, Jl as resolveSecretMarkers, Kr as deviceStateCapability, Mo as searchRank, Nl as isSecretMarker, On as WorkloadStateSchema, Pl as isSecretMarkerLike, Qn as buildStreamParamsConfigSchema, Ri as isEmptyIdentifiers, Rs as canonicalStoredDeviceType, S as CAP_NAMES_WITH_STATUS, So as resolveTemplateRef, To as runtimeFieldUnit, Ts as workloadTransition, Ur as deviceOffersActions, W as DEVICE_IDENTIFIER_KEYS, X as DEVICE_TEMPLATE_MAX_LENGTH, Xa as reconcileReportedFeatures, Xr as enumerateItemArrayFields, Y as DEVICE_TEMPLATE_FILTERS, Yi as legacyAutoLinkIds, Z as DEVICE_TEMPLATE_MAX_OUTPUT, Zl as secretTreeFromPaths, Zr as enumerateSchemaFields, ai as extractSourceInfoFromMetadata, at as DeviceStatusSchema, au as vocabActionIdFor, b as CAMERA_SWITCH_ORDER, bt as FieldClaimSchema, cn as STREAM_PROFILE_META, dt as ExportNameRefusedError, du as DeviceType$1, eu as sleep$2, fa as mergeIdentifiers, fc as BaseAddon, fu as errMsg$1, hi as formatMinutes, iu as userError, j as ConditionMirror, ja as parseStreamParamsFormPatch, jl as isSecretClear, kl as isKeychainStoredField, lu as DeviceFeature, ml as defineRecordKinds, mu as EventCategory$1, ni as expandContainer, nr as canonicalIconKey, nu as toSecretFieldView, ol as collectZodSecretPaths$1, or as checkDeviceAlias, ot as DeviceTombstoneSchema, qr as deviceStatusCapability, rt as DeviceIdentifiersSchema, ru as transformSecretWrite, s as ALL_CAPABILITY_DEFINITIONS, sl as commandEffect, st as DiscoveryProposalBodySchema, ta as locationIconKey, tl as auditedFields, uu as DeviceRole, vi as generateDeviceAlias, vl as expandCapMethods$1, wa as normalizeUnit, wi as identifierStrength, wl as isCommand$1, ws as workloadCapability, yt as FieldClaimModeSchema, z as DAY_NAMES, zs as capAppliesToDeviceKind } from "../../dist-Be8yFd71.mjs";
1
+ import { A as ConditionMirror, Al as isKeychainStoredField, Bi as isKernelDerivedFeature, Bs as capAppliesToDeviceKind, Co as resolveTemplateRef, Dl as isDeviceConfigCap, Dn as WORKLOAD_TRANSITION_CATEGORY, Do as runtimeStatePolicyFor, Eo as runtimeFieldUnit, Er as createDeviceExtensionProvider, Es as workloadTransition, Fl as isSecretMarkerLike, Gi as isWorkloadSettled, Hr as deviceOffersActions, It as MINUTES_PER_DAY, J as DEVICE_TEMPLATE_FILTERS, Kr as deviceStateCapability, Lo as settleDeviceFeatures, Ma as parseStreamParamsFormPatch, Ml as isSecretClear, No as searchRank, On as WorkloadStateSchema, Oo as sameIdentifiers, Pl as isSecretMarker, Pr as defineExtensionSlotProvider, Q as DEVICE_TEMPLATE_VALUES_CAP, Ql as secretTreeFromPaths, R as DAY_NAMES, Ri as isEmptyIdentifiers, Ta as normalizeUnit, Tl as isCommand$1, Ts as workloadCapability, U as DEVICE_IDENTIFIER_KEYS, Uc as SECRET_CLEAR, Uo as siteZoneKey, Vr as deviceManagerCapability, X as DEVICE_TEMPLATE_MAX_OUTPUT, Xr as enumerateItemArrayFields, Y as DEVICE_TEMPLATE_MAX_LENGTH, Yc as WELL_KNOWN_TAB_MAP, Yi as legacyAutoLinkIds, Yl as resolveSecretMarkers, Za as reconcileReportedFeatures, Zn as buildStreamParamsConfigSchema, Zr as enumerateSchemaFields, ai as extractSourceInfoFromMetadata, ar as checkDeviceAlias, at as DeviceTombstoneSchema, au as userError, cl as commandEffect, cn as STREAM_PROFILE_META, du as DeviceRole, ec as implementedMethodsOf$1, fu as DeviceType$1, hi as formatMinutes, hl as defineRecordKinds, hu as EventCategory$1, it as DeviceStatusSchema, iu as transformSecretWrite, ni as expandContainer, nl as auditedFields, nt as DeviceIdentifiersSchema, ot as DiscoveryProposalBodySchema, ou as vocabActionIdFor, pa as mergeIdentifiers, pc as BaseAddon, pu as errMsg$1, qr as deviceStatusCapability, ru as toSecretFieldView, s as ALL_CAPABILITY_DEFINITIONS, sl as collectZodSecretPaths$1, ta as locationIconKey, tr as canonicalIconKey, tu as sleep$2, ut as ExportNameRefusedError, uu as DeviceFeature, vi as generateDeviceAlias, vt as FieldClaimModeSchema, wa as normalizeTags, wi as identifierStrength, x as CAP_NAMES_WITH_STATUS, y as CAMERA_SWITCH_ORDER, yl as expandCapMethods$1, yt as FieldClaimSchema, zr as deviceExtensionCapability, zs as canonicalStoredDeviceType } from "../../dist-DiknL6UU.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  import { a as redactLogText, i as redactLogMeta, n as isSecretArgumentKey } from "../../log-redactor-XLDrPzOi.mjs";
4
- import { n as renameCompositionBlock, t as composedBlockIdOf } from "../../rename-composition-block-LEbZ4oZE.mjs";
4
+ import { n as renameCompositionBlock, t as composedBlockIdOf } from "../../rename-composition-block-BOoAElGp.mjs";
5
5
  import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
6
6
  import { t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
7
7
  import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-u6xQA6r7.mjs";
@@ -8320,8 +8320,7 @@ async function loadRuntimeState(pctx, input) {
8320
8320
  const { deviceId } = input;
8321
8321
  if (!await pctx.metaStore.resolvePersistedById(deviceId)) return {};
8322
8322
  const data = await pctx.settings.readDeviceRuntimeState(deviceId);
8323
- pctx.host.seedMirror(deviceId, pctx.host.withResetSessionProbe(data));
8324
- return splitRuntimeBlob(data).native;
8323
+ return splitRuntimeBlob(pctx.host.seedMirrorFromRow(deviceId, data, pctx.settings)).native;
8325
8324
  }
8326
8325
  /**
8327
8326
  * Union of (1) operator-curated location registry and (2) labels
@@ -11586,17 +11585,62 @@ function persistableBlob(blob, policyFor) {
11586
11585
  /**
11587
11586
  * The part of a `restored` slice that may live on disk (D1024). A cap that
11588
11587
  * names `restoredFields` keeps only those; every other restored cap keeps the
11589
- * whole slice. One function for both directions — what is written and what the
11588
+ * whole slice; a renamed field is read under its new name. One function for both directions — what is written and what the
11590
11589
  * boot seed reads back — so the two cannot drift.
11591
11590
  */
11592
11591
  function restoredPart(slice, policy) {
11592
+ const current = withRenamedFields(slice, policy.renamedFields);
11593
11593
  const names = policy.restoredFields;
11594
- if (names === void 0) return { ...slice };
11594
+ if (names === void 0) return current;
11595
11595
  const out = {};
11596
- for (const name of names) if (name in slice) out[name] = slice[name];
11596
+ for (const name of names) if (name in current) out[name] = current[name];
11597
11597
  return out;
11598
11598
  }
11599
11599
  /**
11600
+ * A field the cap renamed (`restoredFieldRenames`, #459): a row persisted
11601
+ * before the rename carries the OLD key. It is read once into the new name —
11602
+ * only when the new one is absent, a value under the new name always wins — and
11603
+ * dropped, so no reader of the mirror ever meets the old key.
11604
+ */
11605
+ function withRenamedFields(slice, renames) {
11606
+ const out = { ...slice };
11607
+ if (renames === void 0) return out;
11608
+ for (const [from, to] of Object.entries(renames)) {
11609
+ if (!(from in out)) continue;
11610
+ if (!(to in out)) out[to] = out[from];
11611
+ delete out[from];
11612
+ }
11613
+ return out;
11614
+ }
11615
+ /**
11616
+ * Read a whole stored row under the current field names (`restoredFieldRenames`).
11617
+ * Only the renames are applied — nothing is trimmed — so the worker that loads
11618
+ * the row is handed the same fields it would have got, under their new names.
11619
+ * `renamed` names the slices that still carry an old key on disk: the row must
11620
+ * be rewritten once, or the rename could never be retired.
11621
+ */
11622
+ function upgradeRenamedFields(row, policyFor) {
11623
+ const blob = { ...row };
11624
+ const renamed = [];
11625
+ for (const [capName, slice] of Object.entries(row)) {
11626
+ if (capName === "$owned" || !isPlainRecord(slice)) continue;
11627
+ const renames = policyFor(capName).renamedFields;
11628
+ if (renames === void 0) continue;
11629
+ const legacy = {};
11630
+ for (const from of Object.keys(renames)) if (from in slice) legacy[from] = slice[from];
11631
+ if (Object.keys(legacy).length === 0) continue;
11632
+ blob[capName] = withRenamedFields(slice, renames);
11633
+ renamed.push({
11634
+ capName,
11635
+ legacy
11636
+ });
11637
+ }
11638
+ return {
11639
+ blob,
11640
+ renamed
11641
+ };
11642
+ }
11643
+ /**
11600
11644
  * Are two slices the same, ignoring the fields the cap declared volatile?
11601
11645
  *
11602
11646
  * A volatile field is still WRITTEN — it simply does not, on its own, justify
@@ -12426,7 +12470,7 @@ var DeviceStateMirror = class {
12426
12470
  const read = (async () => {
12427
12471
  try {
12428
12472
  const row = await settings.readDeviceRuntimeState(deviceId);
12429
- this.seedMirror(deviceId, this.withResetSessionProbe(row));
12473
+ this.seedMirrorFromRow(deviceId, row, settings);
12430
12474
  this.seedRefusalLogged.delete(deviceId);
12431
12475
  } catch (err) {
12432
12476
  if (!this.seedRefusalLogged.has(deviceId)) {
@@ -12546,6 +12590,32 @@ var DeviceStateMirror = class {
12546
12590
  this.writer.markPersisted(deviceId, persistableBlob(joinRuntimeBlob(split.native, split.owned, this.policyFor), this.policyFor));
12547
12591
  }
12548
12592
  /**
12593
+ * Seed from the device's STORED row (`fill`), and return the row read under
12594
+ * the current field names. A row that still carries a field under its
12595
+ * pre-rename name (`restoredFieldRenames`) is rewritten once: the baseline
12596
+ * keeps the old key — that is what disk holds — so the write is not skipped
12597
+ * as already persisted, and a write is armed even if nothing else changes.
12598
+ * Without it the old key would stay on disk and the rename could never be
12599
+ * retired.
12600
+ */
12601
+ seedMirrorFromRow(deviceId, row, settings) {
12602
+ const upgraded = upgradeRenamedFields(row, this.policyFor);
12603
+ this.seedMirror(deviceId, this.withResetSessionProbe(upgraded.blob));
12604
+ if (upgraded.renamed.length === 0) return upgraded.blob;
12605
+ const baseline = { ...this.writer.persisted(deviceId) };
12606
+ for (const { capName, legacy } of upgraded.renamed) baseline[capName] = {
12607
+ ...baseline[capName],
12608
+ ...legacy
12609
+ };
12610
+ this.writer.markPersisted(deviceId, baseline);
12611
+ this.ctx.logger.info("stored runtime state carries a renamed field — rewriting the row once", {
12612
+ tags: { deviceId },
12613
+ meta: { caps: upgraded.renamed.map((r) => r.capName) }
12614
+ });
12615
+ this.writer.armOrHold(deviceId, settings);
12616
+ return upgraded.blob;
12617
+ }
12618
+ /**
12549
12619
  * The hub mirror's `feature-probe.lastProbedAt` is a PER-SESSION liveness
12550
12620
  * signal — it means "this worker process completed a probe THIS session".
12551
12621
  * Persisted runtime state carries the PRE-RESTART timestamp, which is stale
@@ -14001,6 +14071,7 @@ var DeviceManagerAddon = class extends BaseAddon {
14001
14071
  },
14002
14072
  remoteNativeCaps: this.remoteNativeCaps,
14003
14073
  seedMirror: (deviceId, blob, mode) => this.stateMirror.seedMirror(deviceId, blob, mode),
14074
+ seedMirrorFromRow: (deviceId, row, settings) => this.stateMirror.seedMirrorFromRow(deviceId, row, settings),
14004
14075
  withResetSessionProbe: (blob) => this.stateMirror.withResetSessionProbe(blob),
14005
14076
  get fieldClaims() {
14006
14077
  return fieldClaims();
@@ -49,6 +49,11 @@ export interface ProviderHost {
49
49
  */
50
50
  seedMirror(deviceId: number, blob: Record<string, unknown>, mode?: SeedMode): void;
51
51
  /**
52
+ * Seed the mirror from a device's STORED row and return the row under the
53
+ * current field names; a row carrying a renamed field is rewritten once.
54
+ */
55
+ seedMirrorFromRow(deviceId: number, row: Record<string, unknown>, settings: DeviceManagerSettings): Record<string, unknown>;
56
+ /**
52
57
  * Drain the mirror's debounced writer on these devices and hold it off their
53
58
  * rows until `release` — a migration swapping the rows must not race a write
54
59
  * that read the pre-swap hardware's blob (D663).
@@ -199,6 +199,16 @@ export declare class DeviceStateMirror {
199
199
  */
200
200
  seedMirror(deviceId: number, blob: Record<string, unknown>, mode?: SeedMode): void;
201
201
  /**
202
+ * Seed from the device's STORED row (`fill`), and return the row read under
203
+ * the current field names. A row that still carries a field under its
204
+ * pre-rename name (`restoredFieldRenames`) is rewritten once: the baseline
205
+ * keeps the old key — that is what disk holds — so the write is not skipped
206
+ * as already persisted, and a write is armed even if nothing else changes.
207
+ * Without it the old key would stay on disk and the rename could never be
208
+ * retired.
209
+ */
210
+ seedMirrorFromRow(deviceId: number, row: Record<string, unknown>, settings: DeviceManagerSettings): Record<string, unknown>;
211
+ /**
202
212
  * The hub mirror's `feature-probe.lastProbedAt` is a PER-SESSION liveness
203
213
  * signal — it means "this worker process completed a probe THIS session".
204
214
  * Persisted runtime state carries the PRE-RESTART timestamp, which is stale
@@ -50,10 +50,29 @@ export declare function persistableBlob(blob: RuntimeStateBlob, policyFor: Runti
50
50
  /**
51
51
  * The part of a `restored` slice that may live on disk (D1024). A cap that
52
52
  * names `restoredFields` keeps only those; every other restored cap keeps the
53
- * whole slice. One function for both directions — what is written and what the
53
+ * whole slice; a renamed field is read under its new name. One function for both directions — what is written and what the
54
54
  * boot seed reads back — so the two cannot drift.
55
55
  */
56
56
  export declare function restoredPart(slice: Readonly<Record<string, unknown>>, policy: RuntimeStatePolicy): Record<string, unknown>;
57
+ /** A slice of a stored row that carried a field under its pre-rename name. */
58
+ export interface RenamedSlice {
59
+ readonly capName: string;
60
+ /** The old keys exactly as the row held them — what is still on disk. */
61
+ readonly legacy: Readonly<Record<string, unknown>>;
62
+ }
63
+ /** A stored row with every renamed field read under its new name. */
64
+ export interface UpgradedRow {
65
+ readonly blob: Record<string, unknown>;
66
+ readonly renamed: readonly RenamedSlice[];
67
+ }
68
+ /**
69
+ * Read a whole stored row under the current field names (`restoredFieldRenames`).
70
+ * Only the renames are applied — nothing is trimmed — so the worker that loads
71
+ * the row is handed the same fields it would have got, under their new names.
72
+ * `renamed` names the slices that still carry an old key on disk: the row must
73
+ * be rewritten once, or the rename could never be retired.
74
+ */
75
+ export declare function upgradeRenamedFields(row: Readonly<Record<string, unknown>>, policyFor: RuntimeStatePolicyLookup): UpgradedRow;
57
76
  /**
58
77
  * Are two slices the same, ignoring the fields the cap declared volatile?
59
78
  *
@@ -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-B2-Uflhy.js");
6
+ const require_dist = require("../../dist-CHC8tlB1.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.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 { fc as BaseAddon, ia as logDestinationCapability } from "../../dist-Be8yFd71.mjs";
1
+ import { ia as logDestinationCapability, pc as BaseAddon } from "../../dist-DiknL6UU.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
3
3
  //#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
4
4
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
@@ -3,11 +3,11 @@ 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-B2-Uflhy.js");
7
- const require_device_ca = require("../../device-ca-CXxnQaff.js");
6
+ const require_dist = require("../../dist-CHC8tlB1.js");
7
+ const require_device_ca = require("../../device-ca-BeK8EI_7.js");
8
8
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
9
- const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-B0q34gh3.js");
10
- const require_constants = require("../../constants-BD8oSQro.js");
9
+ const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-BYJa0xPI.js");
10
+ const require_constants = require("../../constants-CsYMak6g.js");
11
11
  const require_platform_key_source = require("../../platform-key-source-Di7HrlGR.js");
12
12
  let node_crypto = require("node:crypto");
13
13
  let _camstack_types_node = require("@camstack/types/node");
@@ -1,8 +1,8 @@
1
- import { At as KEYCHAIN_RESET_TRIGGER_ACTOR, Ji as keychainCapability, Mt as KeychainResetRecordSchema, Vl as normalizeSecretOwner, Wl as parseSecretRef, fc as BaseAddon, jt as KeychainAuditEntrySchema, ml as defineRecordKinds, mu as EventCategory, qi as keychainAdminCapability, yl as formatSecretScope } from "../../dist-Be8yFd71.mjs";
2
- import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-DE_oetBE.mjs";
1
+ import { At as KeychainAuditEntrySchema, Gl as parseSecretRef, Hl as normalizeSecretOwner, Ji as keychainCapability, bl as formatSecretScope, hl as defineRecordKinds, hu as EventCategory, jt as KeychainResetRecordSchema, kt as KEYCHAIN_RESET_TRIGGER_ACTOR, pc as BaseAddon, qi as keychainAdminCapability } from "../../dist-DiknL6UU.mjs";
2
+ import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-BuDqRFZd.mjs";
3
3
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
4
- import { t as LEGACY_INTEGRATION_ROWS_TABLE } from "../../legacy-integration-rows-door-DG35DG06.mjs";
5
- import { a as MESH_CA_KEY_REF } from "../../constants-w-6vvTPp.mjs";
4
+ import { t as LEGACY_INTEGRATION_ROWS_TABLE } from "../../legacy-integration-rows-door-1WauJNCy.mjs";
5
+ import { a as MESH_CA_KEY_REF } from "../../constants-DsQsO8PD.mjs";
6
6
  import { n as getPlatformKeychainKey } from "../../platform-key-source-BWlq0jjn.mjs";
7
7
  import { createCipheriv, createDecipheriv, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
8
8
  import { restrictDirToOwnerSync, restrictFileToOwnerSync, writeOwnerOnlyFileSync } from "@camstack/types/node";
@@ -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-B2-Uflhy.js");
3
+ const require_dist = require("../../dist-CHC8tlB1.js");
4
4
  let node_fs = require("node:fs");
5
5
  let node_path = require("node:path");
6
6
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { $t as RECORDING_SOURCE_CAMSTACK_ADDON, ca as mayWriteToLocation, fc as BaseAddon, fu as errMsg, ll as createEvent, mu as EventCategory, nn as RecordingStatusSchema } from "../../dist-Be8yFd71.mjs";
1
+ import { $t as RECORDING_SOURCE_CAMSTACK_ADDON, hu as EventCategory, la as mayWriteToLocation, nn as RecordingStatusSchema, pc as BaseAddon, pu as errMsg, ul as createEvent } from "../../dist-DiknL6UU.mjs";
2
2
  import { constants } from "node:fs";
3
3
  import path from "node:path";
4
4
  import * as fsp from "node:fs/promises";
@@ -3,10 +3,10 @@ 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-B2-Uflhy.js");
6
+ const require_dist = require("../../dist-CHC8tlB1.js");
7
7
  const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
8
8
  const require_ms$1 = require("../../ms-LB3giGoU.js");
9
- const require_device_ca = require("../../device-ca-CXxnQaff.js");
9
+ const require_device_ca = require("../../device-ca-BeK8EI_7.js");
10
10
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
11
11
  let zod = require("zod");
12
12
  let node_crypto = require("node:crypto");
@@ -1,8 +1,8 @@
1
1
  import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { En as UserRecordSchema, H as DEVICE_ENROLLMENT_TTL_MS, Hn as authProviderCapability, Ii as isCredentialTokenPayload, Il as makeSecretMarker, K as DEVICE_NONCE_TTL_MS, Nl as isSecretMarker, O as CREDENTIAL_TOKEN_AUDIENCE, P as CredentialTokenClaimsSchema, Wt as PREFERENCES_MAX_VALUE_BYTES, Xn as buildDeviceSignatureMessage, Xt as PreferenceNamespaceSchema, Yn as buildDeviceEnrollmentLink, Yt as PreferenceDeviceIdSchema, Zt as PreferenceValueSchema, fc as BaseAddon, fn as ScopedTokenSchema, hn as SsoBridgeClaimsSchema, iu as userError, mi as formatDeviceRevoker, ml as defineRecordKinds, ps as userManagementCapability, wn as TokenScopeSchema, zr as deviceCredentialsCapability } from "../../dist-Be8yFd71.mjs";
2
+ import { D as CREDENTIAL_TOKEN_AUDIENCE, En as UserRecordSchema, G as DEVICE_NONCE_TTL_MS, Hn as authProviderCapability, Ii as isCredentialTokenPayload, Jn as buildDeviceEnrollmentLink, Ll as makeSecretMarker, N as CredentialTokenClaimsSchema, Pl as isSecretMarker, Rr as deviceCredentialsCapability, V as DEVICE_ENROLLMENT_TTL_MS, Wt as PREFERENCES_MAX_VALUE_BYTES, Xt as PreferenceNamespaceSchema, Yn as buildDeviceSignatureMessage, Yt as PreferenceDeviceIdSchema, Zt as PreferenceValueSchema, au as userError, fn as ScopedTokenSchema, hl as defineRecordKinds, hn as SsoBridgeClaimsSchema, mi as formatDeviceRevoker, ms as userManagementCapability, pc as BaseAddon, wn as TokenScopeSchema } from "../../dist-DiknL6UU.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
4
  import { t as require_ms } from "../../ms-CgH2OFlD.mjs";
5
- import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-DE_oetBE.mjs";
5
+ import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-BuDqRFZd.mjs";
6
6
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
7
7
  import { z } from "zod";
8
8
  import * as crypto$1 from "node:crypto";
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-B2-Uflhy.js");
3
+ const require_dist = require("../../dist-CHC8tlB1.js");
4
4
  const require_dns_wire = require("../../dns-wire-B1BvF9Ao.js");
5
- const require_hub_identity = require("../../hub-identity-BjYvJU_v.js");
6
- const require_hub_mdns_ciao = require("../../hub-mdns-ciao-BRfv9GfW.js");
5
+ const require_hub_identity = require("../../hub-identity-BM26oLpK.js");
6
+ const require_hub_mdns_ciao = require("../../hub-mdns-ciao-BDgSHCPM.js");
7
7
  let zod = require("zod");
8
8
  let node_net = require("node:net");
9
9
  let node_fs = require("node:fs");
@@ -1,7 +1,7 @@
1
- import { Ba as preconditionOf, Bo as shortHostname, Ht as NetworkTunnelStartedDataSchema, Li as isDefaultAppConnectionEndpoint, Mi as isAppLinkBase, Pa as pickAppLinkHub, Tt as HUB_MDNS_TXT_KEYS, dl as defineAddonMigrations, ea as localNetworkCapability, fc as BaseAddon, fu as errMsg, hs as validateCustomAddress, lo as resolveAppConnections, mo as resolveHubAddressRoles, mu as EventCategory, sr as checkRoleAddress, vo as resolveNotificationTapAddress, wt as HUB_MDNS_SERVICE_TYPE, x as CAMSTACK_APP_LINK_ORIGIN } from "../../dist-Be8yFd71.mjs";
1
+ import { Ct as HUB_MDNS_SERVICE_TYPE, Fa as pickAppLinkHub, Ht as NetworkTunnelStartedDataSchema, Li as isDefaultAppConnectionEndpoint, Mi as isAppLinkBase, Va as preconditionOf, Vo as shortHostname, b as CAMSTACK_APP_LINK_ORIGIN, ea as localNetworkCapability, fl as defineAddonMigrations, gs as validateCustomAddress, ho as resolveHubAddressRoles, hu as EventCategory, or as checkRoleAddress, pc as BaseAddon, pu as errMsg, uo as resolveAppConnections, wt as HUB_MDNS_TXT_KEYS, yo as resolveNotificationTapAddress } from "../../dist-DiknL6UU.mjs";
2
2
  import { a as emptyMdnsRecords, c as parseMdnsMessage, i as buildRecordQuery, l as parseMdnsRecords, n as MDNS_PORT, o as mergeMdnsRecords, r as buildPtrQuery, s as normalizeServiceType, t as MDNS_GROUP } from "../../dns-wire-Dm3H_7ST.mjs";
3
- import { i as loadOrCreateHubId, r as isAnnouncedHubId } from "../../hub-identity-C3g7b58L.mjs";
4
- import { E as ensureTlsCert, I as readLanHttpState, N as applyLanHttp, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, d as servedHttpsLeafFingerprint, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, y as writeExtraSans } from "../../hub-mdns-ciao-v6X_SbWl.mjs";
3
+ import { i as loadOrCreateHubId, r as isAnnouncedHubId } from "../../hub-identity-Dt-mbtkY.mjs";
4
+ import { E as ensureTlsCert, I as readLanHttpState, N as applyLanHttp, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, d as servedHttpsLeafFingerprint, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, y as writeExtraSans } from "../../hub-mdns-ciao-CHq7b1FX.mjs";
5
5
  import { z } from "zod";
6
6
  import { isIP } from "node:net";
7
7
  import { readFileSync } from "node:fs";
@@ -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-B2-Uflhy.js");
6
+ const require_dist = require("../../dist-CHC8tlB1.js");
7
7
  const require_log_read_filter = require("../../log-read-filter-Bi066jwU.js");
8
8
  let zod = require("zod");
9
9
  //#region src/builtins/loki-logging/loki-payload.ts
@@ -1,4 +1,4 @@
1
- import { Ba as preconditionOf, Ei as integrationInstancesCapability, Ic as RecordIntegrationInstances, Ml as isSecretFieldView, Nl as isSecretMarker, Ol as isInstanceEnabled, Ui as isSameAddonId, Vc as RevConflictError, Wn as bareAddonId, dl as defineAddonMigrations, fc as BaseAddon, ia as logDestinationCapability, pl as defineEntryKind } from "../../dist-Be8yFd71.mjs";
1
+ import { Ei as integrationInstancesCapability, Hc as RevConflictError, Lc as RecordIntegrationInstances, Nl as isSecretFieldView, Pl as isSecretMarker, Ui as isSameAddonId, Va as preconditionOf, Wn as bareAddonId, fl as defineAddonMigrations, ia as logDestinationCapability, kl as isInstanceEnabled, ml as defineEntryKind, pc as BaseAddon } from "../../dist-DiknL6UU.mjs";
2
2
  import { n as compileLogFilter, o as lineMatches } from "../../log-read-filter-D7Ev3zm-.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/builtins/loki-logging/loki-payload.ts
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B2-Uflhy.js");
6
+ const require_dist = require("../../dist-CHC8tlB1.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_chunk.__toESM(node_fs);
9
9
  let node_fs_promises = require("node:fs/promises");
@@ -1,4 +1,4 @@
1
- import { $a as reducePoints, Tn as UNATTRIBUTED_BUCKET_KEY, fc as BaseAddon, fu as errMsg, ll as createEvent, ma as metricsProviderCapability, mu as EventCategory, pi as foldSnapshotByFunction, tn as ROOT_BUCKET_KEY, uo as resolveBucketMs } from "../../dist-Be8yFd71.mjs";
1
+ import { Tn as UNATTRIBUTED_BUCKET_KEY, do as resolveBucketMs, eo as reducePoints, ha as metricsProviderCapability, hu as EventCategory, pc as BaseAddon, pi as foldSnapshotByFunction, pu as errMsg, tn as ROOT_BUCKET_KEY, ul as createEvent } from "../../dist-DiknL6UU.mjs";
2
2
  import * as fs$1 from "node:fs";
3
3
  import { constants, readFileSync } from "node:fs";
4
4
  import { access, readFile, readdir } from "node:fs/promises";
@@ -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-B2-Uflhy.js");
6
+ const require_dist = require("../../dist-CHC8tlB1.js");
7
7
  const require_coral_accelerators = require("../../coral-accelerators-BSVsBVzt.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,5 +1,5 @@
1
1
  import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
2
- import { Ia as platformProbeCapability, Yr as enumerateInferenceDevices, fc as BaseAddon, fu as errMsg, gl as emitReadiness, jo as scoreRuntimes, ka as parseAcceleratorFactsJson, mu as EventCategory } from "../../dist-Be8yFd71.mjs";
2
+ import { Aa as parseAcceleratorFactsJson, La as platformProbeCapability, Mo as scoreRuntimes, Yr as enumerateInferenceDevices, _l as emitReadiness, hu as EventCategory, pc as BaseAddon, pu as errMsg } from "../../dist-DiknL6UU.mjs";
3
3
  import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-DBlgWB8k.mjs";
4
4
  import * as fs$1 from "node:fs";
5
5
  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-B2-Uflhy.js");
6
+ const require_dist = require("../../dist-CHC8tlB1.js");
7
7
  let zod = require("zod");
8
8
  let node_crypto = require("node:crypto");
9
9
  //#region src/builtins/record-entries/entries-service.ts
@@ -1,4 +1,4 @@
1
- import { $l as secretViewsOf, Cc as InvalidRecordError, Kc as UnknownRecordKindError, Za as recordEntriesCapability, fc as BaseAddon } from "../../dist-Be8yFd71.mjs";
1
+ import { Qa as recordEntriesCapability, eu as secretViewsOf, pc as BaseAddon, qc as UnknownRecordKindError, wc as InvalidRecordError } from "../../dist-DiknL6UU.mjs";
2
2
  import { z } from "zod";
3
3
  import { randomUUID } from "node:crypto";
4
4
  //#region src/builtins/record-entries/entries-service.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-B2-Uflhy.js");
6
+ const require_dist = require("../../dist-CHC8tlB1.js");
7
7
  let zod = require("zod");
8
8
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { fc as BaseAddon, mu as EventCategory } from "../../dist-Be8yFd71.mjs";
1
+ import { hu as EventCategory, pc as BaseAddon } from "../../dist-DiknL6UU.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.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-B2-Uflhy.js");
6
+ const require_dist = require("../../dist-CHC8tlB1.js");
7
7
  const require_snapshot_courtesy = require("../../snapshot-courtesy-D_C5-nC0.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1471,11 +1471,11 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
1471
1471
  const meta = await this.lookupDeviceMeta(deviceId);
1472
1472
  const state = await this.resolveSnapshotState(deviceId, meta);
1473
1473
  const hit = this.cache.latest(deviceId);
1474
- const batterySlice = await this.ctx.api.deviceState.getCapSlice.query({
1474
+ const sleepSlice = await this.ctx.api.deviceState.getCapSlice.query({
1475
1475
  deviceId,
1476
- capName: require_dist.batteryCapability.name
1476
+ capName: require_dist.lowPowerSleepCapability.name
1477
1477
  }).catch(() => null);
1478
- const parsed = require_dist.BatteryStatusSchema.safeParse(batterySlice);
1478
+ const parsed = require_dist.LowPowerSleepStatusSchema.safeParse(sleepSlice);
1479
1479
  return {
1480
1480
  battery: parsed.success ? {
1481
1481
  sleeping: parsed.data.sleeping,
@@ -2181,11 +2181,13 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
2181
2181
  * Resolve the state that must be visible on a snapshot.
2182
2182
  *
2183
2183
  * Uses the same two canonical sources as wake-on-play:
2184
- * 1. `deviceManager.getDevice` for the registry's BatteryOperated feature;
2185
- * 2. `deviceState.getCapSlice('battery')` for the durable runtime mirror.
2184
+ * 1. `deviceManager.getDevice` for the registry's `Sleeps` feature;
2185
+ * 2. `deviceState.getCapSlice('low-power-sleep')` for the durable mirror of
2186
+ * the sleep inputs.
2186
2187
  *
2187
- * A valid battery slice is itself positive evidence that the device is
2188
- * battery-operated. That closes the field failure where "Baby monitor" had a
2188
+ * A valid `low-power-sleep` slice is itself positive evidence that the device
2189
+ * sleeps. A `battery` slice is NOT: a battery sensor reports charge and never
2190
+ * sleeps (#459, Q2). That closes the field failure where "Baby monitor" had a
2189
2191
  * sleeping battery slice but a stale persisted feature projection, so the
2190
2192
  * snapshot wrapper classified it as mains and a Viewer thumbnail logged in
2191
2193
  * to the sleeping camera. The reverse is deliberately not guessed: no
@@ -2206,12 +2208,12 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
2206
2208
  try {
2207
2209
  const raw = await this.ctx.api.deviceState.getCapSlice.query({
2208
2210
  deviceId,
2209
- capName: require_dist.batteryCapability.name
2211
+ capName: require_dist.lowPowerSleepCapability.name
2210
2212
  });
2211
- const parsed = require_dist.BatteryStatusSchema.safeParse(raw);
2213
+ const parsed = require_dist.LowPowerSleepStatusSchema.safeParse(raw);
2212
2214
  if (parsed.success) batteryStatus = parsed.data;
2213
2215
  } catch (err) {
2214
- this.ctx.logger.debug("snapshot: battery runtime-state read failed", {
2216
+ this.ctx.logger.debug("snapshot: sleep runtime-state read failed", {
2215
2217
  tags: { deviceId },
2216
2218
  meta: { error: require_dist.errMsg(err) }
2217
2219
  });
@@ -2542,7 +2544,7 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
2542
2544
  const row = found;
2543
2545
  return {
2544
2546
  ...found.name ? { name: found.name } : {},
2545
- isBattery: features.includes(require_dist.DeviceFeature.BatteryOperated),
2547
+ isBattery: require_dist.deviceSleeps(features),
2546
2548
  ...rawType ? { type: rawType } : {},
2547
2549
  disabled: row.disabled === true,
2548
2550
  online: row.online !== false
@@ -1,4 +1,4 @@
1
- import { Gn as batteryCapability, Ir as deriveBatteryPresence, Qo as streamQualityLabel, Uo as snapshotCapability, Wn as bareAddonId, da as memoizePinnedFfmpeg, du as DeviceType, fc as BaseAddon, fu as errMsg, lu as DeviceFeature, mu as EventCategory, y as BatteryStatusSchema, zl as nodePin } from "../../dist-Be8yFd71.mjs";
1
+ import { $o as streamQualityLabel, Bl as nodePin, Fr as deriveBatteryPresence, Gr as deviceSleeps, Nt as LowPowerSleepStatusSchema, Wn as bareAddonId, Wo as snapshotCapability, fa as memoizePinnedFfmpeg, fu as DeviceType, hu as EventCategory, pc as BaseAddon, pu as errMsg, sa as lowPowerSleepCapability } from "../../dist-DiknL6UU.mjs";
2
2
  import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg } from "../../snapshot-courtesy-CyFs1M3I.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -1465,11 +1465,11 @@ var SnapshotAddon = class SnapshotAddon extends BaseAddon {
1465
1465
  const meta = await this.lookupDeviceMeta(deviceId);
1466
1466
  const state = await this.resolveSnapshotState(deviceId, meta);
1467
1467
  const hit = this.cache.latest(deviceId);
1468
- const batterySlice = await this.ctx.api.deviceState.getCapSlice.query({
1468
+ const sleepSlice = await this.ctx.api.deviceState.getCapSlice.query({
1469
1469
  deviceId,
1470
- capName: batteryCapability.name
1470
+ capName: lowPowerSleepCapability.name
1471
1471
  }).catch(() => null);
1472
- const parsed = BatteryStatusSchema.safeParse(batterySlice);
1472
+ const parsed = LowPowerSleepStatusSchema.safeParse(sleepSlice);
1473
1473
  return {
1474
1474
  battery: parsed.success ? {
1475
1475
  sleeping: parsed.data.sleeping,
@@ -2175,11 +2175,13 @@ var SnapshotAddon = class SnapshotAddon extends BaseAddon {
2175
2175
  * Resolve the state that must be visible on a snapshot.
2176
2176
  *
2177
2177
  * Uses the same two canonical sources as wake-on-play:
2178
- * 1. `deviceManager.getDevice` for the registry's BatteryOperated feature;
2179
- * 2. `deviceState.getCapSlice('battery')` for the durable runtime mirror.
2178
+ * 1. `deviceManager.getDevice` for the registry's `Sleeps` feature;
2179
+ * 2. `deviceState.getCapSlice('low-power-sleep')` for the durable mirror of
2180
+ * the sleep inputs.
2180
2181
  *
2181
- * A valid battery slice is itself positive evidence that the device is
2182
- * battery-operated. That closes the field failure where "Baby monitor" had a
2182
+ * A valid `low-power-sleep` slice is itself positive evidence that the device
2183
+ * sleeps. A `battery` slice is NOT: a battery sensor reports charge and never
2184
+ * sleeps (#459, Q2). That closes the field failure where "Baby monitor" had a
2183
2185
  * sleeping battery slice but a stale persisted feature projection, so the
2184
2186
  * snapshot wrapper classified it as mains and a Viewer thumbnail logged in
2185
2187
  * to the sleeping camera. The reverse is deliberately not guessed: no
@@ -2200,12 +2202,12 @@ var SnapshotAddon = class SnapshotAddon extends BaseAddon {
2200
2202
  try {
2201
2203
  const raw = await this.ctx.api.deviceState.getCapSlice.query({
2202
2204
  deviceId,
2203
- capName: batteryCapability.name
2205
+ capName: lowPowerSleepCapability.name
2204
2206
  });
2205
- const parsed = BatteryStatusSchema.safeParse(raw);
2207
+ const parsed = LowPowerSleepStatusSchema.safeParse(raw);
2206
2208
  if (parsed.success) batteryStatus = parsed.data;
2207
2209
  } catch (err) {
2208
- this.ctx.logger.debug("snapshot: battery runtime-state read failed", {
2210
+ this.ctx.logger.debug("snapshot: sleep runtime-state read failed", {
2209
2211
  tags: { deviceId },
2210
2212
  meta: { error: errMsg(err) }
2211
2213
  });
@@ -2536,7 +2538,7 @@ var SnapshotAddon = class SnapshotAddon extends BaseAddon {
2536
2538
  const row = found;
2537
2539
  return {
2538
2540
  ...found.name ? { name: found.name } : {},
2539
- isBattery: features.includes(DeviceFeature.BatteryOperated),
2541
+ isBattery: deviceSleeps(features),
2540
2542
  ...rawType ? { type: rawType } : {},
2541
2543
  disabled: row.disabled === true,
2542
2544
  online: row.online !== false
@@ -424,11 +424,13 @@ export declare class SnapshotAddon extends BaseAddon<SnapshotAddonConfig> {
424
424
  * Resolve the state that must be visible on a snapshot.
425
425
  *
426
426
  * Uses the same two canonical sources as wake-on-play:
427
- * 1. `deviceManager.getDevice` for the registry's BatteryOperated feature;
428
- * 2. `deviceState.getCapSlice('battery')` for the durable runtime mirror.
427
+ * 1. `deviceManager.getDevice` for the registry's `Sleeps` feature;
428
+ * 2. `deviceState.getCapSlice('low-power-sleep')` for the durable mirror of
429
+ * the sleep inputs.
429
430
  *
430
- * A valid battery slice is itself positive evidence that the device is
431
- * battery-operated. That closes the field failure where "Baby monitor" had a
431
+ * A valid `low-power-sleep` slice is itself positive evidence that the device
432
+ * sleeps. A `battery` slice is NOT: a battery sensor reports charge and never
433
+ * sleeps (#459, Q2). That closes the field failure where "Baby monitor" had a
432
434
  * sleeping battery slice but a stale persisted feature projection, so the
433
435
  * snapshot wrapper classified it as mains and a Viewer thumbnail logged in
434
436
  * to the sleeping camera. The reverse is deliberately not guessed: no
@@ -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-B2-Uflhy.js");
6
+ const require_dist = require("../../dist-CHC8tlB1.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { Xo as storageProviderCapability, di as filesystemBrowseCapability, fc as BaseAddon } from "../../dist-Be8yFd71.mjs";
1
+ import { Zo as storageProviderCapability, di as filesystemBrowseCapability, pc as BaseAddon } from "../../dist-DiknL6UU.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import * as fs$1 from "node:fs";
4
4
  import * as path$1 from "node:path";