@camstack/server 1.2.923 → 1.2.925

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 (103) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +8 -9
  3. package/system/assets/core-notifier/icon.svg +5 -0
  4. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  5. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  6. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  7. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  8. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  9. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  10. package/system/dist/builtins/autotrack/index.js +1 -1
  11. package/system/dist/builtins/autotrack/index.mjs +1 -1
  12. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  13. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  14. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  15. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  16. package/system/dist/builtins/camera-grid/index.js +1 -1
  17. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  18. package/system/dist/builtins/composer/composer.addon.js +4 -4
  19. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  20. package/system/dist/builtins/console-logging/index.js +1 -1
  21. package/system/dist/builtins/console-logging/index.mjs +1 -1
  22. package/system/dist/builtins/core-blocks/core-blocks.addon.js +4 -4
  23. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +4 -4
  24. package/system/dist/builtins/core-notifier/core-notifier.addon.d.ts +7 -0
  25. package/system/dist/builtins/core-notifier/core-notifier.addon.js +549 -0
  26. package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +543 -0
  27. package/system/dist/builtins/core-notifier/group-descriptor.d.ts +16 -0
  28. package/system/dist/builtins/core-notifier/group-instances.d.ts +20 -0
  29. package/system/dist/builtins/core-notifier/group-notification-output.d.ts +63 -0
  30. package/system/dist/builtins/core-notifier/index.d.ts +1 -0
  31. package/system/dist/builtins/core-notifier/index.js +8 -0
  32. package/system/dist/builtins/core-notifier/index.mjs +2 -0
  33. package/system/dist/builtins/core-notifier/member-kinds.d.ts +22 -0
  34. package/system/dist/builtins/core-notifier/member-ledger.d.ts +40 -0
  35. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  36. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  37. package/system/dist/builtins/device-manager/device-manager.addon.js +104 -21
  38. package/system/dist/builtins/device-manager/device-manager.addon.mjs +104 -21
  39. package/system/dist/builtins/device-manager/state-refresh-scheduler.d.ts +34 -1
  40. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  41. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  42. package/system/dist/builtins/keychain/index.js +4 -4
  43. package/system/dist/builtins/keychain/index.mjs +4 -4
  44. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  45. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  46. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  47. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  48. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  49. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  50. package/system/dist/builtins/loki-logging/index.js +1 -1
  51. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  52. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  53. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  54. package/system/dist/builtins/platform-probe/index.js +1 -1
  55. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  56. package/system/dist/builtins/record-entries/index.js +1 -1
  57. package/system/dist/builtins/record-entries/index.mjs +1 -1
  58. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  59. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  60. package/system/dist/builtins/snapshot/index.js +1 -1
  61. package/system/dist/builtins/snapshot/index.mjs +1 -1
  62. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  63. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  64. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  65. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  66. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  67. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  68. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  69. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  70. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  71. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  72. package/system/dist/builtins/winston-logging/index.js +1 -1
  73. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  74. package/system/dist/{capture-engine-Cm7ZL3jx.js → capture-engine-BEXh051r.js} +1 -1
  75. package/system/dist/{capture-engine-Bjuf7szh.mjs → capture-engine-CWfylyT8.mjs} +1 -1
  76. package/system/dist/{composition-sources-DFRtvVCC.js → composition-sources-B3_FuKde.js} +1 -1
  77. package/system/dist/{composition-sources-CMa04YwQ.mjs → composition-sources-CcpMUxus.mjs} +1 -1
  78. package/system/dist/{constants-ttjAKMDn.js → constants-B0tqNa2l.js} +1 -1
  79. package/system/dist/{constants-B_z2KueR.mjs → constants-fPesBGmF.mjs} +1 -1
  80. package/system/dist/{device-ca-B4U-0_tL.mjs → device-ca-B98SR8Xf.mjs} +1 -1
  81. package/system/dist/{device-ca-DLbha6bn.js → device-ca-Bh0GEstW.js} +1 -1
  82. package/system/dist/{device-row-store-n7N6WKAJ.mjs → device-row-store-BBByy029.mjs} +1 -1
  83. package/system/dist/{device-row-store-BPvPzZXw.js → device-row-store-CfWN8mLZ.js} +1 -1
  84. package/system/dist/{dist-D4OoBk4J.mjs → dist-CH-iCceM.mjs} +719 -11
  85. package/system/dist/{dist-DyPraj2b.js → dist-CVjsCA7D.js} +796 -10
  86. package/system/dist/file-host-worker.js +1 -1
  87. package/system/dist/file-host-worker.mjs +1 -1
  88. package/system/dist/{hub-identity-DTe2rzm0.js → hub-identity-BU4XzogT.js} +1 -1
  89. package/system/dist/{hub-identity-DKSKuA9T.mjs → hub-identity-DCqJbSVn.mjs} +1 -1
  90. package/system/dist/{hub-mdns-ciao-cwf2mysq.js → hub-mdns-ciao-BNzmwsIH.js} +2 -2
  91. package/system/dist/{hub-mdns-ciao-C3S8zMoF.mjs → hub-mdns-ciao-IOM82NRd.mjs} +2 -2
  92. package/system/dist/index.d.ts +1 -0
  93. package/system/dist/index.js +11 -8
  94. package/system/dist/index.mjs +11 -9
  95. package/system/dist/{legacy-integration-rows-door-BVTSfMBP.js → legacy-integration-rows-door-CRcvhOWb.js} +1 -1
  96. package/system/dist/{legacy-integration-rows-door-DNXKIchh.mjs → legacy-integration-rows-door-nQzjUyPU.mjs} +1 -1
  97. package/system/dist/{rename-composition-block-DbDlfizP.mjs → rename-composition-block-CJ-C9HoY.mjs} +1 -1
  98. package/system/dist/{rename-composition-block-B0vOvO8o.js → rename-composition-block-oOfXrUWs.js} +1 -1
  99. package/system/dist/{restore-archive-DTgUyT_Z.js → restore-archive-BSdudYif.js} +1 -1
  100. package/system/dist/{restore-archive-BSMhMFzE.mjs → restore-archive-WK8ttFhW.mjs} +82 -82
  101. package/system/dist/{wal-maintenance-BrO5LKDF.js → wal-maintenance-BRc_MNtZ.js} +0 -0
  102. package/system/dist/{wal-maintenance-DTAHv1Ih.mjs → wal-maintenance-CyOVe3E1.mjs} +0 -0
  103. package/system/package.json +22 -1
@@ -0,0 +1,40 @@
1
+ /** How long a delivered member is remembered: longer than any outbox retry horizon. */
2
+ export declare const DELIVERED_TTL_MS: number;
3
+ /** The most entries either map holds; the oldest go first. */
4
+ export declare const LEDGER_MAX_ENTRIES: number;
5
+ export interface MemberLedgerOptions {
6
+ readonly now: () => number;
7
+ readonly ttlMs?: number;
8
+ readonly maxEntries?: number;
9
+ }
10
+ export declare class MemberLedger {
11
+ private readonly options;
12
+ private readonly delivered;
13
+ private readonly lastSent;
14
+ private readonly ttlMs;
15
+ private readonly maxEntries;
16
+ constructor(options: MemberLedgerOptions);
17
+ /**
18
+ * The key a retry of one send is recognised by. The rule id (`metadata.ruleId`) is part of it when
19
+ * the notification carries one, so two rules on the same event never share a key. With an event id
20
+ * or tag the key is that id; with neither it is a hash of the content (title, body, device).
21
+ */
22
+ static notificationKey(input: {
23
+ readonly eventId?: string | undefined;
24
+ readonly tag?: string | undefined;
25
+ readonly title?: string | undefined;
26
+ readonly body: string;
27
+ readonly deviceId?: number | undefined;
28
+ readonly metadata?: Readonly<Record<string, unknown>> | undefined;
29
+ }): string;
30
+ wasDelivered(groupId: string, notificationKey: string, memberId: string): boolean;
31
+ markDelivered(groupId: string, notificationKey: string, memberId: string): void;
32
+ /** Whether `memberId` already got something inside its throttle window. */
33
+ isThrottled(groupId: string, memberId: string, throttleSec: number | undefined): boolean;
34
+ markSent(groupId: string, memberId: string): void;
35
+ /** Forget everything of a deleted group. */
36
+ forgetGroup(groupId: string): void;
37
+ private deliveredKey;
38
+ private remember;
39
+ private sweep;
40
+ }
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-DyPraj2b.js");
7
- const require_capture_engine = require("../../capture-engine-Cm7ZL3jx.js");
6
+ const require_dist = require("../../dist-CVjsCA7D.js");
7
+ const require_capture_engine = require("../../capture-engine-BEXh051r.js");
8
8
  const require_retention = require("../../retention-BcOSL6b9.js");
9
9
  let node_crypto = require("node:crypto");
10
10
  //#region src/builtins/device-history/capture/point-writer.ts
@@ -1,5 +1,5 @@
1
- import { Cc as wattMillisecondsToKwh, Ct as HISTORY_ITEM_CATALOG, El as defineRecordKinds, Fc as InvalidRecordError, Gn as armRemovalReconcile, H as DEVICE_HISTORY_ENERGY_KEY, Il as historyUnitFor, Ou as DeviceType, Qr as deviceRunsCapability, St as HISTORY_CATALOG, Wl as isReadingQuantity, Zc as RecordTooLargeError, Zr as deviceRemovalHookCapability, it as DeviceRunSchema, jc as DeviceTransitionSchema, ju as EventCategory, kl as emitReadiness, ni as deviceTransitionsCapability, qr as deviceHistoryCapability, wc as BaseAddon } from "../../dist-D4OoBk4J.mjs";
2
- import { a as catalogMetrics, c as DeviceDirectory, d as identityOf, f as subjectIdOf, i as capSeriesKey, l as isRealDeviceType, m as parseConfirmedStateChanged, n as CaptureEngine, o as readPath, r as capItemSeriesKey, s as readUnit, t as CAP_KEY_PREFIX, u as SeriesRegistry } from "../../capture-engine-Bjuf7szh.mjs";
1
+ import { Hl as emitReadiness, Ic as wattMillisecondsToKwh, Jc as InvalidRecordError, Lc as BaseAddon, Tt as HISTORY_ITEM_CATALOG, U as DEVICE_HISTORY_ENERGY_KEY, Vu as DeviceType, Wc as DeviceTransitionSchema, Wu as EventCategory, Xn as armRemovalReconcile, Yl as historyUnitFor, ai as deviceRemovalHookCapability, at as DeviceRunSchema, oi as deviceRunsCapability, ru as isReadingQuantity, ti as deviceHistoryCapability, ui as deviceTransitionsCapability, ul as RecordTooLargeError, wt as HISTORY_CATALOG, zl as defineRecordKinds } from "../../dist-CH-iCceM.mjs";
2
+ import { a as catalogMetrics, c as DeviceDirectory, d as identityOf, f as subjectIdOf, i as capSeriesKey, l as isRealDeviceType, m as parseConfirmedStateChanged, n as CaptureEngine, o as readPath, r as capItemSeriesKey, s as readUnit, t as CAP_KEY_PREFIX, u as SeriesRegistry } from "../../capture-engine-CWfylyT8.mjs";
3
3
  import { a as FIVE_MINUTES_MS, c as bucketEndOf, i as DAY_MS, l as bucketStartOf, n as RetentionJob, o as HOUR_MS, r as DepartureTracker, s as ROLLUP_GRACE_MS, t as DEFAULT_RETENTION, u as floorTo } from "../../retention-CUOVI1p7.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  //#region src/builtins/device-history/capture/point-writer.ts
@@ -3,14 +3,14 @@ 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-DyPraj2b.js");
6
+ const require_dist = require("../../dist-CVjsCA7D.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  const require_log_redactor = require("../../log-redactor-BhIEMaG9.js");
9
- const require_rename_composition_block = require("../../rename-composition-block-B0vOvO8o.js");
9
+ const require_rename_composition_block = require("../../rename-composition-block-oOfXrUWs.js");
10
10
  const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
11
11
  const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
12
12
  const require_retired_settings_keys = require("../../retired-settings-keys-C8nOOr5H.js");
13
- const require_device_row_store = require("../../device-row-store-BPvPzZXw.js");
13
+ const require_device_row_store = require("../../device-row-store-CfWN8mLZ.js");
14
14
  const require_template_protocol = require("../../template-protocol-D5ogm1rj.js");
15
15
  const require_dns_wire = require("../../dns-wire-B1BvF9Ao.js");
16
16
  let zod = require("zod");
@@ -13112,6 +13112,17 @@ function __resetStateRefreshPolicyRegistryForTests() {
13112
13112
  */
13113
13113
  /** The longest a command waits for a read already in flight on its device. */
13114
13114
  var COMMAND_WAIT_BOUND_MS = 5e3;
13115
+ /** The longest a device that keeps failing waits between two scheduled reads. */
13116
+ var FAILURE_BACKOFF_CAP_MS = 3e5;
13117
+ /**
13118
+ * The wait before the next scheduled read of a device that failed `failures`
13119
+ * reads in a row: the interval doubled per failure, capped, and never below
13120
+ * the interval itself.
13121
+ */
13122
+ function failureBackoffMs(intervalMs, failures) {
13123
+ if (failures <= 0) return intervalMs;
13124
+ return Math.max(intervalMs, Math.min(FAILURE_BACKOFF_CAP_MS, intervalMs * 2 ** failures));
13125
+ }
13115
13126
  function groupKeyOf(entry) {
13116
13127
  return `${entry.addonId}::${entry.policy.integrationId}`;
13117
13128
  }
@@ -13122,6 +13133,8 @@ var StateRefreshScheduler = class {
13122
13133
  deps;
13123
13134
  devices = /* @__PURE__ */ new Map();
13124
13135
  groups = /* @__PURE__ */ new Map();
13136
+ /** The latest connection epoch seen per integration, kept while its group is gone. */
13137
+ epochs = /* @__PURE__ */ new Map();
13125
13138
  unsubscribe;
13126
13139
  disposed = false;
13127
13140
  constructor(deps) {
@@ -13171,6 +13184,7 @@ var StateRefreshScheduler = class {
13171
13184
  for (const group of this.groups.values()) this.clearGroupTimers(group);
13172
13185
  this.devices.clear();
13173
13186
  this.groups.clear();
13187
+ this.epochs.clear();
13174
13188
  }
13175
13189
  reconcile() {
13176
13190
  if (this.disposed) return;
@@ -13193,7 +13207,8 @@ var StateRefreshScheduler = class {
13193
13207
  inFlight: null,
13194
13208
  scheduledInFlight: null,
13195
13209
  burst: [],
13196
- pushWindow: null
13210
+ pushWindow: null,
13211
+ failures: 0
13197
13212
  });
13198
13213
  else {
13199
13214
  if (require_dist.effectiveRefreshIntervalMs(existing.entry.policy) !== interval) existing.dueAt = now + interval;
@@ -13207,16 +13222,24 @@ var StateRefreshScheduler = class {
13207
13222
  this.refreshGroup(key, "schedule");
13208
13223
  }
13209
13224
  }
13210
- /** Track the group's connection epoch; `true` when it moved past a known one. */
13225
+ /**
13226
+ * Track an integration's connection epoch; `true` when it CHANGED. Any change
13227
+ * is a reconnect, a restart that comes back with a lower value included (a
13228
+ * provider's counter restarts with its process while this scheduler keeps
13229
+ * running). The first registration and an unchanged epoch read nothing.
13230
+ *
13231
+ * The value is kept across a gap on purpose, and NOT dropped when the last
13232
+ * device of an integration leaves: a provider re-registers its cap to publish
13233
+ * the new epoch, which removes the device for a moment, and the comparison
13234
+ * must still see the epoch from before. It is forgotten in `dispose()`.
13235
+ */
13211
13236
  noteEpoch(entry) {
13212
13237
  const epoch = entry.policy.connectionEpoch;
13213
13238
  if (epoch === void 0) return false;
13214
13239
  const key = groupKeyOf(entry);
13215
- const group = this.groups.get(key);
13216
- if (group === void 0) return false;
13217
- const previous = group.epoch;
13218
- if (previous === void 0 || epoch > previous) group.epoch = epoch;
13219
- return previous !== void 0 && epoch > previous;
13240
+ const previous = this.epochs.get(key);
13241
+ this.epochs.set(key, epoch);
13242
+ return previous !== void 0 && epoch !== previous;
13220
13243
  }
13221
13244
  rebuildGroups(now) {
13222
13245
  const members = /* @__PURE__ */ new Map();
@@ -13243,8 +13266,7 @@ var StateRefreshScheduler = class {
13243
13266
  intervalMs,
13244
13267
  scheduleTimer: null,
13245
13268
  heartbeatTimer: null,
13246
- lastReportAt: now,
13247
- epoch: first?.entry.policy.connectionEpoch
13269
+ lastReportAt: now
13248
13270
  });
13249
13271
  } else {
13250
13272
  existing.devices = devices;
@@ -13443,15 +13465,10 @@ var StateRefreshScheduler = class {
13443
13465
  busy.push(deviceId);
13444
13466
  prior.push(tail);
13445
13467
  }
13446
- const settled = this.afterPrior(prior, busy, waitBoundMs).then(() => this.deps.refresh(route, deviceIds, reason)).catch((err) => {
13447
- for (const deviceId of deviceIds) this.deps.logger.warn("state refresh failed", {
13448
- tags: { deviceId },
13449
- meta: {
13450
- reason,
13451
- error: errorMessage$1(err)
13452
- }
13453
- });
13454
- }).finally(() => {
13468
+ const settled = this.afterPrior(prior, busy, waitBoundMs).then(async () => {
13469
+ await this.deps.refresh(route, deviceIds, reason);
13470
+ this.noteSuccess(deviceIds);
13471
+ }).catch((err) => this.noteFailure(deviceIds, reason, err)).finally(() => {
13455
13472
  for (const deviceId of deviceIds) {
13456
13473
  const device = this.devices.get(deviceId);
13457
13474
  if (device !== void 0 && device.inFlight === settled) device.inFlight = null;
@@ -13463,6 +13480,72 @@ var StateRefreshScheduler = class {
13463
13480
  }
13464
13481
  await settled;
13465
13482
  }
13483
+ /**
13484
+ * A read that succeeded ends a backoff: the device is due at the declared
13485
+ * interval from now, whichever read (schedule, command, burst) proved it.
13486
+ */
13487
+ noteSuccess(deviceIds) {
13488
+ const now = Date.now();
13489
+ const keys = /* @__PURE__ */ new Set();
13490
+ for (const deviceId of deviceIds) {
13491
+ const device = this.devices.get(deviceId);
13492
+ if (device === void 0 || device.failures === 0) continue;
13493
+ this.deps.logger.info("state refresh recovered: back to the declared interval", {
13494
+ tags: { deviceId },
13495
+ meta: { failedReads: device.failures }
13496
+ });
13497
+ device.failures = 0;
13498
+ const intervalMs = require_dist.effectiveRefreshIntervalMs(device.entry.policy);
13499
+ if (!device.entry.policy.batch) device.dueAt = now + intervalMs;
13500
+ keys.add(groupKeyOf(device.entry));
13501
+ }
13502
+ for (const key of keys) {
13503
+ const group = this.groups.get(key);
13504
+ const policy = group === void 0 ? void 0 : this.groupPolicy(group);
13505
+ if (group !== void 0 && policy?.batch === true) group.dueAt = now + require_dist.effectiveRefreshIntervalMs(policy);
13506
+ this.armSchedule(key);
13507
+ }
13508
+ }
13509
+ /**
13510
+ * A failed read is a warn per device. Only a SCHEDULED read that failed backs
13511
+ * the device off (doubling from the interval, capped, reset by the next
13512
+ * success): a command or burst read has its own cadence and says nothing
13513
+ * about the scheduled one. A batched group backs off only when the failed
13514
+ * read covered the whole group.
13515
+ */
13516
+ noteFailure(deviceIds, reason, err) {
13517
+ const now = Date.now();
13518
+ const scheduled = reason === "schedule";
13519
+ const keys = /* @__PURE__ */ new Set();
13520
+ let groupFailures = 0;
13521
+ for (const deviceId of deviceIds) {
13522
+ const device = this.devices.get(deviceId);
13523
+ if (device === void 0) continue;
13524
+ if (scheduled) device.failures += 1;
13525
+ groupFailures = Math.max(groupFailures, device.failures);
13526
+ const retryInMs = failureBackoffMs(require_dist.effectiveRefreshIntervalMs(device.entry.policy), device.failures);
13527
+ if (scheduled && !device.entry.policy.batch) device.dueAt = Math.max(device.dueAt, now + retryInMs);
13528
+ keys.add(groupKeyOf(device.entry));
13529
+ this.deps.logger.warn("state refresh failed", {
13530
+ tags: { deviceId },
13531
+ meta: {
13532
+ reason,
13533
+ error: errorMessage$1(err),
13534
+ consecutiveFailures: device.failures,
13535
+ retryInMs: scheduled && device.entry.policy.push !== "full" ? retryInMs : void 0
13536
+ }
13537
+ });
13538
+ }
13539
+ if (!scheduled) return;
13540
+ for (const key of keys) {
13541
+ const group = this.groups.get(key);
13542
+ const policy = group === void 0 ? void 0 : this.groupPolicy(group);
13543
+ if (group !== void 0 && policy?.batch === true) {
13544
+ if ([...group.devices].every((id) => deviceIds.includes(id))) group.dueAt = Math.max(group.dueAt, now + failureBackoffMs(require_dist.effectiveRefreshIntervalMs(policy), groupFailures));
13545
+ }
13546
+ this.armSchedule(key);
13547
+ }
13548
+ }
13466
13549
  /** Resolves when every `prior` read ended, or after `waitBoundMs` (logged per busy device). */
13467
13550
  async afterPrior(prior, busy, waitBoundMs) {
13468
13551
  if (prior.length === 0) return;
@@ -1,11 +1,11 @@
1
- import { A as ConditionMirror, Bl as isDeviceConfigCap, Bo as runtimeStatePolicyFor, Ca as mergeIdentifiers, Ci as formatMinutes, Du as DeviceRole, Ei as generateDeviceAlias, Eu as DeviceFeature, Fa as normalizeTags, Gl as isSecretClear, Go as searchRank, Ia as normalizeUnit, Io as resolveTemplateRef, Is as workloadCapability, J as DEVICE_TEMPLATE_FILTERS, Ji as isEmptyIdentifiers, Jl as isSecretMarkerLike, Kr as deviceExtensionCapability, Ls as workloadTransition, Mi as identifierStrength, Ml as expandCapMethods$1, Mn as WORKLOAD_TRANSITION_CATEGORY, Ni as identityLinkId, Nn as WorkloadStateSchema, Nr as createDeviceExtensionProvider, Ou as DeviceType$1, Pi as identityLinkSidesRefusal, Q as DEVICE_TEMPLATE_VALUES_CAP, R as DAY_NAMES, Rl as isCommand$1, Su as vocabActionIdFor, U as DEVICE_IDENTIFIER_KEYS, Ua as parseStreamParamsFormPatch, Ul as isKeychainStoredField, Vo as sameIdentifiers, Vr as defineExtensionSlotProvider, X as DEVICE_TEMPLATE_MAX_OUTPUT, Xi as isKernelDerivedFeature, Xr as deviceOffersActions, Xt as PUSH_CONFIRM_WINDOW_MS, Y as DEVICE_TEMPLATE_MAX_LENGTH, Yo as settleDeviceFeatures, Yr as deviceManagerCapability, Zs as capAppliesToDeviceKind, _r as commandBurstOffsets, aa as legacyAutoLinkIds, ai as enumerateSchemaFields, at as DeviceStatusSchema, bt as FieldClaimSchema, bu as transformSecretWrite, co as reconcileReportedFeatures, da as locationIconKey, dc as implementedMethodsOf$1, dt as ExportNameRefusedError, ei as deviceStateCapability, el as SECRET_CLEAR, gu as sleep$2, ii as enumerateItemArrayFields, ju as EventCategory$1, ku as errMsg$1, lu as resolveSecretMarkers, nr as buildStreamParamsConfigSchema, ol as WELL_KNOWN_TAB_MAP, or as canonicalIconKey, pi as extractSourceInfoFromMetadata, pl as auditedFields, pn as STREAM_PROFILE_META, pu as secretTreeFromPaths, ql as isSecretMarker, ri as effectiveRefreshIntervalMs, rt as DeviceIdentifiersSchema, s as ALL_CAPABILITY_DEFINITIONS, ta as isWorkloadSettled, ti as deviceStatusCapability, ts as siteZoneKey, ui as expandContainer, ur as checkDeviceAlias, vl as collectZodSecretPaths$1, wc as BaseAddon, wo as resolveCommandHold, x as CAP_NAMES_WITH_STATUS, xu as userError, y as CAMERA_SWITCH_ORDER, yl as commandEffect, yt as FieldClaimModeSchema, yu as toSecretFieldView, zo as runtimeFieldUnit, zt as MINUTES_PER_DAY } from "../../dist-D4OoBk4J.mjs";
1
+ import { $ as DEVICE_TEMPLATE_VALUES_CAP, $l as isDeviceConfigCap, $o as sameIdentifiers, Br as createDeviceExtensionProvider, Bu as DeviceRole, El as auditedFields, Eu as secretTreeFromPaths, Fu as vocabActionIdFor, Ga as normalizeTags, Gl as expandCapMethods$1, Hi as identityLinkId, Hu as errMsg$1, Io as resolveCommandHold, Jo as resolveTemplateRef, Ka as normalizeUnit, Lc as BaseAddon, Ln as WORKLOAD_TRANSITION_CATEGORY, Ml as commandEffect, Mu as toSecretFieldView, Na as mergeIdentifiers, Nu as transformSecretWrite, Pi as generateDeviceAlias, Pu as userError, Qo as runtimeStatePolicyFor, Rn as WorkloadStateSchema, S as CAP_NAMES_WITH_STATUS, Su as resolveSecretMarkers, Ui as identityLinkSidesRefusal, Vi as identifierStrength, Vt as MINUTES_PER_DAY, Vu as DeviceType$1, W as DEVICE_IDENTIFIER_KEYS, Wu as EventCategory$1, X as DEVICE_TEMPLATE_MAX_LENGTH, Xs as workloadTransition, Y as DEVICE_TEMPLATE_FILTERS, Yr as defineExtensionSlotProvider, Ys as workloadCapability, Z as DEVICE_TEMPLATE_MAX_OUTPUT, Zl as isCommand$1, Zo as runtimeFieldUnit, aa as isKernelDerivedFeature, b as CAMERA_SWITCH_ORDER, bo as reconcileReportedFeatures, bt as FieldClaimModeSchema, ci as deviceStateCapability, cr as buildStreamParamsConfigSchema, di as effectiveRefreshIntervalMs, ei as deviceExtensionCapability, fi as enumerateItemArrayFields, fr as canonicalIconKey, ft as ExportNameRefusedError, gr as checkDeviceAlias, ii as deviceOffersActions, it as DeviceIdentifiersSchema, iu as isSecretClear, j as ConditionMirror, ji as formatMinutes, jl as collectZodSecretPaths$1, ku as sleep$2, li as deviceStatusCapability, ma as legacyAutoLinkIds, ms as siteZoneKey, nu as isKeychainStoredField, ot as DeviceStatusSchema, ou as isSecretMarker, pi as enumerateSchemaFields, pl as SECRET_CLEAR, ra as isEmptyIdentifiers, ri as deviceManagerCapability, rs as searchRank, s as ALL_CAPABILITY_DEFINITIONS, ss as settleDeviceFeatures, su as isSecretMarkerLike, tn as PUSH_CONFIRM_WINDOW_MS, to as parseStreamParamsFormPatch, ua as isWorkloadSettled, uc as capAppliesToDeviceKind, vi as expandContainer, vn as STREAM_PROFILE_META, wc as implementedMethodsOf$1, wr as commandBurstOffsets, xa as locationIconKey, xi as extractSourceInfoFromMetadata, xt as FieldClaimSchema, yl as WELL_KNOWN_TAB_MAP, z as DAY_NAMES, zu as DeviceFeature } from "../../dist-CH-iCceM.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-DbDlfizP.mjs";
4
+ import { n as renameCompositionBlock, t as composedBlockIdOf } from "../../rename-composition-block-CJ-C9HoY.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";
8
- import { a as MigrationRefusedError, i as deviceManagerRecordKinds, n as DeviceRowStore, r as deviceRowBackendOf } from "../../device-row-store-n7N6WKAJ.mjs";
8
+ import { a as MigrationRefusedError, i as deviceManagerRecordKinds, n as DeviceRowStore, r as deviceRowBackendOf } from "../../device-row-store-BBByy029.mjs";
9
9
  import { n as isRenderResponse, r as analyzeTemplate } from "../../template-protocol-SgPDx3Hw.mjs";
10
10
  import { s as normalizeServiceType } from "../../dns-wire-Dm3H_7ST.mjs";
11
11
  import { createRequire } from "node:module";
@@ -13106,6 +13106,17 @@ function __resetStateRefreshPolicyRegistryForTests() {
13106
13106
  */
13107
13107
  /** The longest a command waits for a read already in flight on its device. */
13108
13108
  var COMMAND_WAIT_BOUND_MS = 5e3;
13109
+ /** The longest a device that keeps failing waits between two scheduled reads. */
13110
+ var FAILURE_BACKOFF_CAP_MS = 3e5;
13111
+ /**
13112
+ * The wait before the next scheduled read of a device that failed `failures`
13113
+ * reads in a row: the interval doubled per failure, capped, and never below
13114
+ * the interval itself.
13115
+ */
13116
+ function failureBackoffMs(intervalMs, failures) {
13117
+ if (failures <= 0) return intervalMs;
13118
+ return Math.max(intervalMs, Math.min(FAILURE_BACKOFF_CAP_MS, intervalMs * 2 ** failures));
13119
+ }
13109
13120
  function groupKeyOf(entry) {
13110
13121
  return `${entry.addonId}::${entry.policy.integrationId}`;
13111
13122
  }
@@ -13116,6 +13127,8 @@ var StateRefreshScheduler = class {
13116
13127
  deps;
13117
13128
  devices = /* @__PURE__ */ new Map();
13118
13129
  groups = /* @__PURE__ */ new Map();
13130
+ /** The latest connection epoch seen per integration, kept while its group is gone. */
13131
+ epochs = /* @__PURE__ */ new Map();
13119
13132
  unsubscribe;
13120
13133
  disposed = false;
13121
13134
  constructor(deps) {
@@ -13165,6 +13178,7 @@ var StateRefreshScheduler = class {
13165
13178
  for (const group of this.groups.values()) this.clearGroupTimers(group);
13166
13179
  this.devices.clear();
13167
13180
  this.groups.clear();
13181
+ this.epochs.clear();
13168
13182
  }
13169
13183
  reconcile() {
13170
13184
  if (this.disposed) return;
@@ -13187,7 +13201,8 @@ var StateRefreshScheduler = class {
13187
13201
  inFlight: null,
13188
13202
  scheduledInFlight: null,
13189
13203
  burst: [],
13190
- pushWindow: null
13204
+ pushWindow: null,
13205
+ failures: 0
13191
13206
  });
13192
13207
  else {
13193
13208
  if (effectiveRefreshIntervalMs(existing.entry.policy) !== interval) existing.dueAt = now + interval;
@@ -13201,16 +13216,24 @@ var StateRefreshScheduler = class {
13201
13216
  this.refreshGroup(key, "schedule");
13202
13217
  }
13203
13218
  }
13204
- /** Track the group's connection epoch; `true` when it moved past a known one. */
13219
+ /**
13220
+ * Track an integration's connection epoch; `true` when it CHANGED. Any change
13221
+ * is a reconnect, a restart that comes back with a lower value included (a
13222
+ * provider's counter restarts with its process while this scheduler keeps
13223
+ * running). The first registration and an unchanged epoch read nothing.
13224
+ *
13225
+ * The value is kept across a gap on purpose, and NOT dropped when the last
13226
+ * device of an integration leaves: a provider re-registers its cap to publish
13227
+ * the new epoch, which removes the device for a moment, and the comparison
13228
+ * must still see the epoch from before. It is forgotten in `dispose()`.
13229
+ */
13205
13230
  noteEpoch(entry) {
13206
13231
  const epoch = entry.policy.connectionEpoch;
13207
13232
  if (epoch === void 0) return false;
13208
13233
  const key = groupKeyOf(entry);
13209
- const group = this.groups.get(key);
13210
- if (group === void 0) return false;
13211
- const previous = group.epoch;
13212
- if (previous === void 0 || epoch > previous) group.epoch = epoch;
13213
- return previous !== void 0 && epoch > previous;
13234
+ const previous = this.epochs.get(key);
13235
+ this.epochs.set(key, epoch);
13236
+ return previous !== void 0 && epoch !== previous;
13214
13237
  }
13215
13238
  rebuildGroups(now) {
13216
13239
  const members = /* @__PURE__ */ new Map();
@@ -13237,8 +13260,7 @@ var StateRefreshScheduler = class {
13237
13260
  intervalMs,
13238
13261
  scheduleTimer: null,
13239
13262
  heartbeatTimer: null,
13240
- lastReportAt: now,
13241
- epoch: first?.entry.policy.connectionEpoch
13263
+ lastReportAt: now
13242
13264
  });
13243
13265
  } else {
13244
13266
  existing.devices = devices;
@@ -13437,15 +13459,10 @@ var StateRefreshScheduler = class {
13437
13459
  busy.push(deviceId);
13438
13460
  prior.push(tail);
13439
13461
  }
13440
- const settled = this.afterPrior(prior, busy, waitBoundMs).then(() => this.deps.refresh(route, deviceIds, reason)).catch((err) => {
13441
- for (const deviceId of deviceIds) this.deps.logger.warn("state refresh failed", {
13442
- tags: { deviceId },
13443
- meta: {
13444
- reason,
13445
- error: errorMessage$1(err)
13446
- }
13447
- });
13448
- }).finally(() => {
13462
+ const settled = this.afterPrior(prior, busy, waitBoundMs).then(async () => {
13463
+ await this.deps.refresh(route, deviceIds, reason);
13464
+ this.noteSuccess(deviceIds);
13465
+ }).catch((err) => this.noteFailure(deviceIds, reason, err)).finally(() => {
13449
13466
  for (const deviceId of deviceIds) {
13450
13467
  const device = this.devices.get(deviceId);
13451
13468
  if (device !== void 0 && device.inFlight === settled) device.inFlight = null;
@@ -13457,6 +13474,72 @@ var StateRefreshScheduler = class {
13457
13474
  }
13458
13475
  await settled;
13459
13476
  }
13477
+ /**
13478
+ * A read that succeeded ends a backoff: the device is due at the declared
13479
+ * interval from now, whichever read (schedule, command, burst) proved it.
13480
+ */
13481
+ noteSuccess(deviceIds) {
13482
+ const now = Date.now();
13483
+ const keys = /* @__PURE__ */ new Set();
13484
+ for (const deviceId of deviceIds) {
13485
+ const device = this.devices.get(deviceId);
13486
+ if (device === void 0 || device.failures === 0) continue;
13487
+ this.deps.logger.info("state refresh recovered: back to the declared interval", {
13488
+ tags: { deviceId },
13489
+ meta: { failedReads: device.failures }
13490
+ });
13491
+ device.failures = 0;
13492
+ const intervalMs = effectiveRefreshIntervalMs(device.entry.policy);
13493
+ if (!device.entry.policy.batch) device.dueAt = now + intervalMs;
13494
+ keys.add(groupKeyOf(device.entry));
13495
+ }
13496
+ for (const key of keys) {
13497
+ const group = this.groups.get(key);
13498
+ const policy = group === void 0 ? void 0 : this.groupPolicy(group);
13499
+ if (group !== void 0 && policy?.batch === true) group.dueAt = now + effectiveRefreshIntervalMs(policy);
13500
+ this.armSchedule(key);
13501
+ }
13502
+ }
13503
+ /**
13504
+ * A failed read is a warn per device. Only a SCHEDULED read that failed backs
13505
+ * the device off (doubling from the interval, capped, reset by the next
13506
+ * success): a command or burst read has its own cadence and says nothing
13507
+ * about the scheduled one. A batched group backs off only when the failed
13508
+ * read covered the whole group.
13509
+ */
13510
+ noteFailure(deviceIds, reason, err) {
13511
+ const now = Date.now();
13512
+ const scheduled = reason === "schedule";
13513
+ const keys = /* @__PURE__ */ new Set();
13514
+ let groupFailures = 0;
13515
+ for (const deviceId of deviceIds) {
13516
+ const device = this.devices.get(deviceId);
13517
+ if (device === void 0) continue;
13518
+ if (scheduled) device.failures += 1;
13519
+ groupFailures = Math.max(groupFailures, device.failures);
13520
+ const retryInMs = failureBackoffMs(effectiveRefreshIntervalMs(device.entry.policy), device.failures);
13521
+ if (scheduled && !device.entry.policy.batch) device.dueAt = Math.max(device.dueAt, now + retryInMs);
13522
+ keys.add(groupKeyOf(device.entry));
13523
+ this.deps.logger.warn("state refresh failed", {
13524
+ tags: { deviceId },
13525
+ meta: {
13526
+ reason,
13527
+ error: errorMessage$1(err),
13528
+ consecutiveFailures: device.failures,
13529
+ retryInMs: scheduled && device.entry.policy.push !== "full" ? retryInMs : void 0
13530
+ }
13531
+ });
13532
+ }
13533
+ if (!scheduled) return;
13534
+ for (const key of keys) {
13535
+ const group = this.groups.get(key);
13536
+ const policy = group === void 0 ? void 0 : this.groupPolicy(group);
13537
+ if (group !== void 0 && policy?.batch === true) {
13538
+ if ([...group.devices].every((id) => deviceIds.includes(id))) group.dueAt = Math.max(group.dueAt, now + failureBackoffMs(effectiveRefreshIntervalMs(policy), groupFailures));
13539
+ }
13540
+ this.armSchedule(key);
13541
+ }
13542
+ }
13460
13543
  /** Resolves when every `prior` read ended, or after `waitBoundMs` (logged per busy device). */
13461
13544
  async afterPrior(prior, busy, waitBoundMs) {
13462
13545
  if (prior.length === 0) return;
@@ -51,10 +51,20 @@ export interface StateRefreshSchedulerDeps {
51
51
  }
52
52
  /** The longest a command waits for a read already in flight on its device. */
53
53
  export declare const COMMAND_WAIT_BOUND_MS = 5e3;
54
+ /** The longest a device that keeps failing waits between two scheduled reads. */
55
+ export declare const FAILURE_BACKOFF_CAP_MS = 3e5;
56
+ /**
57
+ * The wait before the next scheduled read of a device that failed `failures`
58
+ * reads in a row: the interval doubled per failure, capped, and never below
59
+ * the interval itself.
60
+ */
61
+ export declare function failureBackoffMs(intervalMs: number, failures: number): number;
54
62
  export declare class StateRefreshScheduler {
55
63
  private readonly deps;
56
64
  private readonly devices;
57
65
  private readonly groups;
66
+ /** The latest connection epoch seen per integration, kept while its group is gone. */
67
+ private readonly epochs;
58
68
  private readonly unsubscribe;
59
69
  private disposed;
60
70
  constructor(deps: StateRefreshSchedulerDeps);
@@ -64,7 +74,17 @@ export declare class StateRefreshScheduler {
64
74
  onReport(deviceId: number): void;
65
75
  dispose(): void;
66
76
  private reconcile;
67
- /** Track the group's connection epoch; `true` when it moved past a known one. */
77
+ /**
78
+ * Track an integration's connection epoch; `true` when it CHANGED. Any change
79
+ * is a reconnect, a restart that comes back with a lower value included (a
80
+ * provider's counter restarts with its process while this scheduler keeps
81
+ * running). The first registration and an unchanged epoch read nothing.
82
+ *
83
+ * The value is kept across a gap on purpose, and NOT dropped when the last
84
+ * device of an integration leaves: a provider re-registers its cap to publish
85
+ * the new epoch, which removes the device for a moment, and the comparison
86
+ * must still see the epoch from before. It is forgotten in `dispose()`.
87
+ */
68
88
  private noteEpoch;
69
89
  private rebuildGroups;
70
90
  private groupPolicy;
@@ -90,6 +110,19 @@ export declare class StateRefreshScheduler {
90
110
  * still busy). The read becomes the devices' new tail.
91
111
  */
92
112
  private runRefresh;
113
+ /**
114
+ * A read that succeeded ends a backoff: the device is due at the declared
115
+ * interval from now, whichever read (schedule, command, burst) proved it.
116
+ */
117
+ private noteSuccess;
118
+ /**
119
+ * A failed read is a warn per device. Only a SCHEDULED read that failed backs
120
+ * the device off (doubling from the interval, capped, reset by the next
121
+ * success): a command or burst read has its own cadence and says nothing
122
+ * about the scheduled one. A batched group backs off only when the failed
123
+ * read covered the whole group.
124
+ */
125
+ private noteFailure;
93
126
  /** Resolves when every `prior` read ended, or after `waitBoundMs` (logged per busy device). */
94
127
  private afterPrior;
95
128
  private clearGroupTimers;
@@ -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-DyPraj2b.js");
6
+ const require_dist = require("../../dist-CVjsCA7D.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 { ma as logDestinationCapability, wc as BaseAddon } from "../../dist-D4OoBk4J.mjs";
1
+ import { Lc as BaseAddon, wa as logDestinationCapability } from "../../dist-CH-iCceM.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-DyPraj2b.js");
7
- const require_device_ca = require("../../device-ca-DLbha6bn.js");
6
+ const require_dist = require("../../dist-CVjsCA7D.js");
7
+ const require_device_ca = require("../../device-ca-Bh0GEstW.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-BVTSfMBP.js");
10
- const require_constants = require("../../constants-ttjAKMDn.js");
9
+ const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-CRcvhOWb.js");
10
+ const require_constants = require("../../constants-B0tqNa2l.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 { El as defineRecordKinds, Mt as KEYCHAIN_RESET_TRIGGER_ACTOR, Nl as formatSecretScope, Nt as KeychainAuditEntrySchema, Pt as KeychainResetRecordSchema, au as parseSecretRef, ia as keychainCapability, ju as EventCategory, ra as keychainAdminCapability, tu as normalizeSecretOwner, wc as BaseAddon } from "../../dist-D4OoBk4J.mjs";
2
- import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-B4U-0_tL.mjs";
1
+ import { Ft as KeychainAuditEntrySchema, It as KeychainResetRecordSchema, Kl as formatSecretScope, Lc as BaseAddon, Pt as KEYCHAIN_RESET_TRIGGER_ACTOR, Wu as EventCategory, fa as keychainAdminCapability, mu as normalizeSecretOwner, pa as keychainCapability, vu as parseSecretRef, zl as defineRecordKinds } from "../../dist-CH-iCceM.mjs";
2
+ import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-B98SR8Xf.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-DNXKIchh.mjs";
5
- import { a as MESH_CA_KEY_REF } from "../../constants-B_z2KueR.mjs";
4
+ import { t as LEGACY_INTEGRATION_ROWS_TABLE } from "../../legacy-integration-rows-door-nQzjUyPU.mjs";
5
+ import { a as MESH_CA_KEY_REF } from "../../constants-fPesBGmF.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-DyPraj2b.js");
3
+ const require_dist = require("../../dist-CVjsCA7D.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 { in as RECORDING_SOURCE_CAMSTACK_ADDON, ju as EventCategory, ku as errMsg, sn as RecordingStatusSchema, wc as BaseAddon, xl as createEvent, ya as mayWriteToLocation } from "../../dist-D4OoBk4J.mjs";
1
+ import { Hu as errMsg, Lc as BaseAddon, Pl as createEvent, Wu as EventCategory, fn as RecordingStatusSchema, ka as mayWriteToLocation, ln as RECORDING_SOURCE_CAMSTACK_ADDON } from "../../dist-CH-iCceM.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-DyPraj2b.js");
6
+ const require_dist = require("../../dist-CVjsCA7D.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-DLbha6bn.js");
9
+ const require_device_ca = require("../../device-ca-Bh0GEstW.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 { $n as buildDeviceEnrollmentLink, D as CREDENTIAL_TOKEN_AUDIENCE, El as defineRecordKinds, G as DEVICE_NONCE_TTL_MS, Gr as deviceCredentialsCapability, Jt as PREFERENCES_MAX_VALUE_BYTES, Ki as isCredentialTokenPayload, N as CredentialTokenClaimsSchema, Si as formatDeviceRevoker, Ts as userManagementCapability, V as DEVICE_ENROLLMENT_TTL_MS, Xl as makeSecretMarker, _n as ScopedTokenSchema, bn as SsoBridgeClaimsSchema, en as PreferenceDeviceIdSchema, er as buildDeviceSignatureMessage, jn as UserRecordSchema, kn as TokenScopeSchema, nn as PreferenceValueSchema, ql as isSecretMarker, qn as authProviderCapability, tn as PreferenceNamespaceSchema, wc as BaseAddon, xu as userError } from "../../dist-D4OoBk4J.mjs";
2
+ import { $r as deviceCredentialsCapability, $t as PREFERENCES_MAX_VALUE_BYTES, Ai as formatDeviceRevoker, H as DEVICE_ENROLLMENT_TTL_MS, In as UserRecordSchema, K as DEVICE_NONCE_TTL_MS, Lc as BaseAddon, O as CREDENTIAL_TOKEN_AUDIENCE, P as CredentialTokenClaimsSchema, Pn as TokenScopeSchema, Pu as userError, Qn as authProviderCapability, Rs as userManagementCapability, Sn as ScopedTokenSchema, Tn as SsoBridgeClaimsSchema, an as PreferenceDeviceIdSchema, ar as buildDeviceSignatureMessage, ir as buildDeviceEnrollmentLink, lu as makeSecretMarker, on as PreferenceNamespaceSchema, ou as isSecretMarker, sn as PreferenceValueSchema, ta as isCredentialTokenPayload, zl as defineRecordKinds } from "../../dist-CH-iCceM.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-B4U-0_tL.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-B98SR8Xf.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-DyPraj2b.js");
3
+ const require_dist = require("../../dist-CVjsCA7D.js");
4
4
  const require_dns_wire = require("../../dns-wire-B1BvF9Ao.js");
5
- const require_hub_identity = require("../../hub-identity-DTe2rzm0.js");
6
- const require_hub_mdns_ciao = require("../../hub-mdns-ciao-cwf2mysq.js");
5
+ const require_hub_identity = require("../../hub-identity-BU4XzogT.js");
6
+ const require_hub_mdns_ciao = require("../../hub-mdns-ciao-BNzmwsIH.js");
7
7
  let zod = require("zod");
8
8
  let node_net = require("node:net");
9
9
  let node_fs = require("node:fs");