@camstack/server 1.2.768 → 1.2.770

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 (100) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/api/core/cap-providers.js +4 -193
  3. package/dist/api/trpc/generated-cap-routers.js +40 -30
  4. package/dist/core/addon/integration-visibility.js +0 -5
  5. package/package.json +36 -12
  6. package/system/dist/addon-runner.js +7 -1
  7. package/system/dist/addon-runner.mjs +7 -1
  8. package/system/dist/{agent-https-D03iyjJk.mjs → agent-https-BGRPCKwT.mjs} +1 -1
  9. package/system/dist/{agent-https-D62iihRo.js → agent-https-mq6d71iq.js} +1 -1
  10. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  11. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  12. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  13. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  14. package/system/dist/builtins/alerts/alerts.addon.d.ts +15 -0
  15. package/system/dist/builtins/alerts/alerts.addon.js +104 -4
  16. package/system/dist/builtins/alerts/alerts.addon.mjs +104 -4
  17. package/system/dist/builtins/alerts/cluster-state-alerts.d.ts +32 -0
  18. package/system/dist/builtins/autotrack/index.js +1 -1
  19. package/system/dist/builtins/autotrack/index.mjs +1 -1
  20. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  21. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  22. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  23. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  24. package/system/dist/builtins/camera-grid/index.js +1 -1
  25. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  26. package/system/dist/builtins/composer/composer.addon.js +5 -4
  27. package/system/dist/builtins/composer/composer.addon.mjs +5 -4
  28. package/system/dist/builtins/console-logging/index.js +1 -1
  29. package/system/dist/builtins/console-logging/index.mjs +1 -1
  30. package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  31. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  32. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  33. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  34. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  35. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  36. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  37. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  38. package/system/dist/builtins/keychain/index.js +17 -10
  39. package/system/dist/builtins/keychain/index.mjs +17 -10
  40. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  41. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  42. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  43. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  44. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  45. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  46. package/system/dist/builtins/loki-logging/index.js +1 -1
  47. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  48. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  49. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  50. package/system/dist/builtins/platform-probe/index.js +1 -1
  51. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  52. package/system/dist/builtins/record-entries/index.js +1 -1
  53. package/system/dist/builtins/record-entries/index.mjs +1 -1
  54. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  55. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  56. package/system/dist/builtins/snapshot/index.js +1 -1
  57. package/system/dist/builtins/snapshot/index.mjs +1 -1
  58. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  59. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  60. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  61. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  62. package/system/dist/builtins/sqlite-storage/integration-record-kinds.d.ts +3 -10
  63. package/system/dist/builtins/sqlite-storage/integration-registry.d.ts +1 -11
  64. package/system/dist/builtins/sqlite-storage/integration-rows-ports.d.ts +13 -15
  65. package/system/dist/builtins/sqlite-storage/migrations/legacy-integration-rows-door.d.ts +31 -0
  66. package/system/dist/builtins/sqlite-storage/migrations/migrations-provider.d.ts +39 -1
  67. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +48 -5
  68. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +48 -5
  69. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  70. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  71. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  72. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  73. package/system/dist/builtins/winston-logging/index.js +1 -1
  74. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  75. package/system/dist/{capture-engine-BpoL1zQ0.js → capture-engine--FQ8NUHh.js} +1 -1
  76. package/system/dist/{capture-engine-CYmRx0Ce.mjs → capture-engine-Cmx7DIzV.mjs} +1 -1
  77. package/system/dist/{composition-sources-CknQxftO.mjs → composition-sources-Bd09D5f4.mjs} +1 -1
  78. package/system/dist/{composition-sources-B7VyYbEU.js → composition-sources-cvZAN87H.js} +1 -1
  79. package/system/dist/{constants-C9Gxs1jW.mjs → constants-Dce28BAx.mjs} +1 -1
  80. package/system/dist/{constants-DJqUggkW.js → constants-gM9xHjyj.js} +1 -1
  81. package/system/dist/{device-ca-9BTS4o-T.js → device-ca-BmeH6Y9E.js} +1 -1
  82. package/system/dist/{device-ca-D76OqRnW.mjs → device-ca-DcMuT-Yp.mjs} +1 -1
  83. package/system/dist/{dist-BhR34kF8.mjs → dist-C3WXy3Ix.mjs} +185 -84
  84. package/system/dist/{dist-DLVfdGSW.js → dist-Dtw1sIeQ.js} +185 -84
  85. package/system/dist/file-host-worker.js +1 -1
  86. package/system/dist/file-host-worker.mjs +1 -1
  87. package/system/dist/{hub-mdns-ciao-DimaT9WQ.js → hub-mdns-ciao-C49eqyby.js} +2 -2
  88. package/system/dist/{hub-mdns-ciao-i31GIYWP.mjs → hub-mdns-ciao-Dfue_0kR.mjs} +2 -2
  89. package/system/dist/index.d.ts +1 -1
  90. package/system/dist/index.js +49 -231
  91. package/system/dist/index.mjs +58 -240
  92. package/system/dist/legacy-integration-rows-door-B8_XCqUX.js +290 -0
  93. package/system/dist/legacy-integration-rows-door-DK42Bh2Q.mjs +255 -0
  94. package/system/dist/migrations/hub/2026-11-05-drop-integration-settings.d.ts +16 -0
  95. package/system/dist/{restore-archive-nWi73iy0.mjs → restore-archive-C0YDO-qd.mjs} +82 -82
  96. package/system/dist/{restore-archive-BkiXu43U.js → restore-archive-DuktQtye.js} +1 -1
  97. package/system/dist/{wal-maintenance-UQEtPem2.js → wal-maintenance-BEo-y-cQ.js} +0 -0
  98. package/system/dist/{wal-maintenance-DG2bwMif.mjs → wal-maintenance-DhuvKiGK.mjs} +0 -0
  99. package/system/package.json +1 -1
  100. package/dist/api/core/integration-secrets.js +0 -96
@@ -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-DLVfdGSW.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  //#region src/builtins/alerts/alert-episode-policy.ts
9
9
  /**
@@ -479,6 +479,39 @@ function planMigrationAlerts(ledger, open, now) {
479
479
  };
480
480
  }
481
481
  //#endregion
482
+ //#region src/builtins/alerts/cluster-state-alerts.ts
483
+ /** How often the centre re-reads the node list. An online event only hints. */
484
+ var CLUSTER_STATE_RECONCILE_MS = 3e4;
485
+ function text(value) {
486
+ return typeof value === "string" && value.length > 0 ? value : null;
487
+ }
488
+ /** The node an alert is about. `agent.offline` is keyed by `agentId` (older cards used `nodeId`). */
489
+ function subjectNodeId(alert) {
490
+ const meta = alert.metadata ?? {};
491
+ if (alert.category === "agent.offline") return text(meta["agentId"]) ?? text(meta["nodeId"]);
492
+ if (alert.category === "system.restarting") return text(meta["nodeId"]);
493
+ return null;
494
+ }
495
+ function requestedAtOf(alert) {
496
+ const raw = alert.metadata?.["requestedAt"];
497
+ return typeof raw === "number" ? raw : alert.createdAt;
498
+ }
499
+ function restartCompleted(alert, nodeId, completions) {
500
+ const requestedAt = requestedAtOf(alert);
501
+ return completions.some((completion) => completion.nodeId === nodeId && completion.requestedAt >= requestedAt);
502
+ }
503
+ function resolved(alert, online, completions) {
504
+ const nodeId = subjectNodeId(alert);
505
+ if (nodeId === null) return false;
506
+ if (alert.category === "agent.offline") return online.has(nodeId);
507
+ if (alert.category === "system.restarting") return online.has(nodeId) || restartCompleted(alert, nodeId, completions);
508
+ return false;
509
+ }
510
+ function planClusterStateDismissals(input) {
511
+ const online = new Set(input.nodes.filter((node) => node.isOnline).map((node) => node.id));
512
+ return input.alerts.filter((alert) => alert.status === "active" && resolved(alert, online, input.completions)).map((alert) => alert.id);
513
+ }
514
+ //#endregion
482
515
  //#region src/builtins/alerts/alerts.addon.ts
483
516
  var CATEGORY_MAPPINGS = {
484
517
  "addon.crashed": {
@@ -590,7 +623,8 @@ var SILENT_TRACKED_CATEGORIES = [
590
623
  "stream.online",
591
624
  "notification.rule-repaired",
592
625
  "migration.failed",
593
- "migration.applied"
626
+ "migration.applied",
627
+ "agent.online"
594
628
  ];
595
629
  /** The `stream.offline` reasons that are an outage (D883) — mirrors the broker's `isStreamOutageReason`. */
596
630
  var STREAM_OUTAGE_REASONS = [
@@ -727,6 +761,11 @@ var AlertCenterAddon = class extends require_dist.BaseAddon {
727
761
  this.unsubscribers = unsubs;
728
762
  this.dismissLegacyStreamCards(void 0);
729
763
  this.reconcileMigrationAlerts();
764
+ this.enqueue(() => this.reconcileClusterAlerts());
765
+ this.clusterReconcileTimer = setInterval(() => {
766
+ this.enqueue(() => this.reconcileClusterAlerts());
767
+ }, CLUSTER_STATE_RECONCILE_MS);
768
+ if (typeof this.clusterReconcileTimer.unref === "function") this.clusterReconcileTimer.unref();
730
769
  this.ctx.logger.info("Initialized", { meta: { trackedCategoriesCount: TRACKED_CATEGORIES.length } });
731
770
  return [{
732
771
  capability: require_dist.alertsCapability,
@@ -734,6 +773,10 @@ var AlertCenterAddon = class extends require_dist.BaseAddon {
734
773
  }];
735
774
  }
736
775
  async onShutdown() {
776
+ if (this.clusterReconcileTimer !== null) {
777
+ clearInterval(this.clusterReconcileTimer);
778
+ this.clusterReconcileTimer = null;
779
+ }
737
780
  for (const unsub of this.unsubscribers) unsub();
738
781
  this.unsubscribers = [];
739
782
  }
@@ -812,9 +855,16 @@ var AlertCenterAddon = class extends require_dist.BaseAddon {
812
855
  * alert yet" and open two episodes for it.
813
856
  */
814
857
  eventChain = Promise.resolve();
858
+ /** Restarts this process has heard completed. The node list covers a dropped one. */
859
+ restartCompletions = [];
860
+ clusterReconcileTimer = null;
861
+ enqueue(work) {
862
+ const run = this.eventChain.then(work, work);
863
+ this.eventChain = run;
864
+ return run;
865
+ }
815
866
  handleEvent(category, event) {
816
- this.eventChain = this.eventChain.then(() => this.processEvent(category, event));
817
- return this.eventChain;
867
+ return this.enqueue(() => this.processEvent(category, event));
818
868
  }
819
869
  async processEvent(category, event) {
820
870
  try {
@@ -870,6 +920,14 @@ var AlertCenterAddon = class extends require_dist.BaseAddon {
870
920
  await this.handleRuleRepaired(event);
871
921
  return;
872
922
  }
923
+ if (category === require_dist.EventCategory.AgentOnline) {
924
+ await this.reconcileClusterAlerts();
925
+ return;
926
+ }
927
+ if (category === require_dist.EventCategory.SystemRestartCompleted) {
928
+ this.noteRestartCompleted(event);
929
+ await this.reconcileClusterAlerts();
930
+ }
873
931
  const mapping = CATEGORY_MAPPINGS[category];
874
932
  if (!mapping) return;
875
933
  if (category === "addon.updated") {
@@ -1373,6 +1431,48 @@ var AlertCenterAddon = class extends require_dist.BaseAddon {
1373
1431
  };
1374
1432
  await this.emitAlert(alert);
1375
1433
  }
1434
+ /** A heard completion. An older one must not close a restart announced after it. */
1435
+ noteRestartCompleted(event) {
1436
+ const nodeId = typeof event.data["nodeId"] === "string" ? event.data["nodeId"] : null;
1437
+ if (nodeId === null || nodeId.length === 0) return;
1438
+ const requestedAt = typeof event.data["requestedAt"] === "number" ? event.data["requestedAt"] : Date.now();
1439
+ const next = [...this.restartCompletions, {
1440
+ nodeId,
1441
+ requestedAt
1442
+ }];
1443
+ this.restartCompletions = next.length > 64 ? next.slice(next.length - 64) : next;
1444
+ }
1445
+ /**
1446
+ * The node list says who is back (D49). A read that fails changes nothing.
1447
+ * Not called from the handler that opens `system.restarting` — that event
1448
+ * is emitted while the node is still up. The next read dismisses it once
1449
+ * the list says the node is online. A heard `system.restart-completed`
1450
+ * dismisses the matching alert even when the list has not flipped yet.
1451
+ */
1452
+ async reconcileClusterAlerts() {
1453
+ try {
1454
+ const nodes = await this.readClusterNodes();
1455
+ if (nodes === null) return;
1456
+ const ids = planClusterStateDismissals({
1457
+ alerts: await this.listAlerts({ limit: 1e3 }),
1458
+ nodes,
1459
+ completions: this.restartCompletions
1460
+ });
1461
+ for (const alertId of ids) await this.dismiss(alertId);
1462
+ if (ids.length === 0) return;
1463
+ this.ctx.logger?.info("cluster alerts resolved from the node list", { meta: { count: ids.length } });
1464
+ } catch (err) {
1465
+ this.ctx.logger?.warn("cluster alerts: reconcile failed", { meta: { error: require_dist.errMsg(err) } });
1466
+ }
1467
+ }
1468
+ async readClusterNodes() {
1469
+ try {
1470
+ return (await this.ctx.api.nodes.directory.query()).nodes;
1471
+ } catch (err) {
1472
+ this.ctx.logger?.warn("cluster alerts: reconcile skipped, the node list could not be read", { meta: { error: require_dist.errMsg(err) } });
1473
+ return null;
1474
+ }
1475
+ }
1376
1476
  /**
1377
1477
  * One card per faulted migration, from the ledger (D987, D11): the RPC read is
1378
1478
  * the authority and an event only says it may have changed. A read that fails
@@ -1,4 +1,4 @@
1
- import { Fr as isAlertEpisodeSeverity, Pr as isAlertEpisodeOpen, d as AlertSchema, dc as EventCategory, dn as alertEpisodeId, fn as alertEpisodePayload, ms as createEvent, pn as alertsCapability, uc as errMsg, wo as BaseAddon, ys as defineRecordKinds } from "../../dist-BhR34kF8.mjs";
1
+ import { Fr as isAlertEpisodeSeverity, Pr as isAlertEpisodeOpen, d as AlertSchema, dc as EventCategory, dn as alertEpisodeId, fn as alertEpisodePayload, ms as createEvent, pn as alertsCapability, uc as errMsg, wo as BaseAddon, ys as defineRecordKinds } from "../../dist-C3WXy3Ix.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  //#region src/builtins/alerts/alert-episode-policy.ts
4
4
  /**
@@ -473,6 +473,39 @@ function planMigrationAlerts(ledger, open, now) {
473
473
  };
474
474
  }
475
475
  //#endregion
476
+ //#region src/builtins/alerts/cluster-state-alerts.ts
477
+ /** How often the centre re-reads the node list. An online event only hints. */
478
+ var CLUSTER_STATE_RECONCILE_MS = 3e4;
479
+ function text(value) {
480
+ return typeof value === "string" && value.length > 0 ? value : null;
481
+ }
482
+ /** The node an alert is about. `agent.offline` is keyed by `agentId` (older cards used `nodeId`). */
483
+ function subjectNodeId(alert) {
484
+ const meta = alert.metadata ?? {};
485
+ if (alert.category === "agent.offline") return text(meta["agentId"]) ?? text(meta["nodeId"]);
486
+ if (alert.category === "system.restarting") return text(meta["nodeId"]);
487
+ return null;
488
+ }
489
+ function requestedAtOf(alert) {
490
+ const raw = alert.metadata?.["requestedAt"];
491
+ return typeof raw === "number" ? raw : alert.createdAt;
492
+ }
493
+ function restartCompleted(alert, nodeId, completions) {
494
+ const requestedAt = requestedAtOf(alert);
495
+ return completions.some((completion) => completion.nodeId === nodeId && completion.requestedAt >= requestedAt);
496
+ }
497
+ function resolved(alert, online, completions) {
498
+ const nodeId = subjectNodeId(alert);
499
+ if (nodeId === null) return false;
500
+ if (alert.category === "agent.offline") return online.has(nodeId);
501
+ if (alert.category === "system.restarting") return online.has(nodeId) || restartCompleted(alert, nodeId, completions);
502
+ return false;
503
+ }
504
+ function planClusterStateDismissals(input) {
505
+ const online = new Set(input.nodes.filter((node) => node.isOnline).map((node) => node.id));
506
+ return input.alerts.filter((alert) => alert.status === "active" && resolved(alert, online, input.completions)).map((alert) => alert.id);
507
+ }
508
+ //#endregion
476
509
  //#region src/builtins/alerts/alerts.addon.ts
477
510
  var CATEGORY_MAPPINGS = {
478
511
  "addon.crashed": {
@@ -584,7 +617,8 @@ var SILENT_TRACKED_CATEGORIES = [
584
617
  "stream.online",
585
618
  "notification.rule-repaired",
586
619
  "migration.failed",
587
- "migration.applied"
620
+ "migration.applied",
621
+ "agent.online"
588
622
  ];
589
623
  /** The `stream.offline` reasons that are an outage (D883) — mirrors the broker's `isStreamOutageReason`. */
590
624
  var STREAM_OUTAGE_REASONS = [
@@ -721,6 +755,11 @@ var AlertCenterAddon = class extends BaseAddon {
721
755
  this.unsubscribers = unsubs;
722
756
  this.dismissLegacyStreamCards(void 0);
723
757
  this.reconcileMigrationAlerts();
758
+ this.enqueue(() => this.reconcileClusterAlerts());
759
+ this.clusterReconcileTimer = setInterval(() => {
760
+ this.enqueue(() => this.reconcileClusterAlerts());
761
+ }, CLUSTER_STATE_RECONCILE_MS);
762
+ if (typeof this.clusterReconcileTimer.unref === "function") this.clusterReconcileTimer.unref();
724
763
  this.ctx.logger.info("Initialized", { meta: { trackedCategoriesCount: TRACKED_CATEGORIES.length } });
725
764
  return [{
726
765
  capability: alertsCapability,
@@ -728,6 +767,10 @@ var AlertCenterAddon = class extends BaseAddon {
728
767
  }];
729
768
  }
730
769
  async onShutdown() {
770
+ if (this.clusterReconcileTimer !== null) {
771
+ clearInterval(this.clusterReconcileTimer);
772
+ this.clusterReconcileTimer = null;
773
+ }
731
774
  for (const unsub of this.unsubscribers) unsub();
732
775
  this.unsubscribers = [];
733
776
  }
@@ -806,9 +849,16 @@ var AlertCenterAddon = class extends BaseAddon {
806
849
  * alert yet" and open two episodes for it.
807
850
  */
808
851
  eventChain = Promise.resolve();
852
+ /** Restarts this process has heard completed. The node list covers a dropped one. */
853
+ restartCompletions = [];
854
+ clusterReconcileTimer = null;
855
+ enqueue(work) {
856
+ const run = this.eventChain.then(work, work);
857
+ this.eventChain = run;
858
+ return run;
859
+ }
809
860
  handleEvent(category, event) {
810
- this.eventChain = this.eventChain.then(() => this.processEvent(category, event));
811
- return this.eventChain;
861
+ return this.enqueue(() => this.processEvent(category, event));
812
862
  }
813
863
  async processEvent(category, event) {
814
864
  try {
@@ -864,6 +914,14 @@ var AlertCenterAddon = class extends BaseAddon {
864
914
  await this.handleRuleRepaired(event);
865
915
  return;
866
916
  }
917
+ if (category === EventCategory.AgentOnline) {
918
+ await this.reconcileClusterAlerts();
919
+ return;
920
+ }
921
+ if (category === EventCategory.SystemRestartCompleted) {
922
+ this.noteRestartCompleted(event);
923
+ await this.reconcileClusterAlerts();
924
+ }
867
925
  const mapping = CATEGORY_MAPPINGS[category];
868
926
  if (!mapping) return;
869
927
  if (category === "addon.updated") {
@@ -1367,6 +1425,48 @@ var AlertCenterAddon = class extends BaseAddon {
1367
1425
  };
1368
1426
  await this.emitAlert(alert);
1369
1427
  }
1428
+ /** A heard completion. An older one must not close a restart announced after it. */
1429
+ noteRestartCompleted(event) {
1430
+ const nodeId = typeof event.data["nodeId"] === "string" ? event.data["nodeId"] : null;
1431
+ if (nodeId === null || nodeId.length === 0) return;
1432
+ const requestedAt = typeof event.data["requestedAt"] === "number" ? event.data["requestedAt"] : Date.now();
1433
+ const next = [...this.restartCompletions, {
1434
+ nodeId,
1435
+ requestedAt
1436
+ }];
1437
+ this.restartCompletions = next.length > 64 ? next.slice(next.length - 64) : next;
1438
+ }
1439
+ /**
1440
+ * The node list says who is back (D49). A read that fails changes nothing.
1441
+ * Not called from the handler that opens `system.restarting` — that event
1442
+ * is emitted while the node is still up. The next read dismisses it once
1443
+ * the list says the node is online. A heard `system.restart-completed`
1444
+ * dismisses the matching alert even when the list has not flipped yet.
1445
+ */
1446
+ async reconcileClusterAlerts() {
1447
+ try {
1448
+ const nodes = await this.readClusterNodes();
1449
+ if (nodes === null) return;
1450
+ const ids = planClusterStateDismissals({
1451
+ alerts: await this.listAlerts({ limit: 1e3 }),
1452
+ nodes,
1453
+ completions: this.restartCompletions
1454
+ });
1455
+ for (const alertId of ids) await this.dismiss(alertId);
1456
+ if (ids.length === 0) return;
1457
+ this.ctx.logger?.info("cluster alerts resolved from the node list", { meta: { count: ids.length } });
1458
+ } catch (err) {
1459
+ this.ctx.logger?.warn("cluster alerts: reconcile failed", { meta: { error: errMsg(err) } });
1460
+ }
1461
+ }
1462
+ async readClusterNodes() {
1463
+ try {
1464
+ return (await this.ctx.api.nodes.directory.query()).nodes;
1465
+ } catch (err) {
1466
+ this.ctx.logger?.warn("cluster alerts: reconcile skipped, the node list could not be read", { meta: { error: errMsg(err) } });
1467
+ return null;
1468
+ }
1469
+ }
1370
1470
  /**
1371
1471
  * One card per faulted migration, from the ledger (D987, D11): the RPC read is
1372
1472
  * the authority and an event only says it may have changed. A read that fails
@@ -0,0 +1,32 @@
1
+ /**
2
+ * `agent.offline` and `system.restarting` close from the node list, not from
3
+ * a one-shot online or restart-completed event (D8, D49). The list is the
4
+ * authority: a node it does not name stays as it is — absence is not "back".
5
+ * A restart completion this process heard dismisses the matching restarting
6
+ * alert even while the list still says offline. A completion older than the
7
+ * alert does not.
8
+ */
9
+ import type { AlertStatus } from "@camstack/types";
10
+ /** How often the centre re-reads the node list. An online event only hints. */
11
+ export declare const CLUSTER_STATE_RECONCILE_MS = 3e4;
12
+ export interface ClusterNodeRow {
13
+ readonly id: string;
14
+ readonly isOnline: boolean;
15
+ }
16
+ export interface RestartCompletion {
17
+ readonly nodeId: string;
18
+ readonly requestedAt: number;
19
+ }
20
+ export interface ClusterAlertView {
21
+ readonly id: string;
22
+ readonly status: AlertStatus;
23
+ readonly category: string;
24
+ readonly createdAt: number;
25
+ readonly metadata?: Readonly<Record<string, unknown>>;
26
+ }
27
+ export interface ClusterStateReconcileInput {
28
+ readonly alerts: readonly ClusterAlertView[];
29
+ readonly nodes: readonly ClusterNodeRow[];
30
+ readonly completions: readonly RestartCompletion[];
31
+ }
32
+ export declare function planClusterStateDismissals(input: ClusterStateReconcileInput): readonly string[];
@@ -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-DLVfdGSW.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
7
  //#region src/builtins/autotrack/autotrack-config.ts
8
8
  var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
9
9
  deadZoneFraction: .5,
@@ -1,4 +1,4 @@
1
- import { As as isEvent, Ri as ptzAutotrackCapability, dc as EventCategory, tt as FIRST_LEVEL_MACRO_CLASSES, uc as errMsg, vn as bareAddonId, wo as BaseAddon } from "../../dist-BhR34kF8.mjs";
1
+ import { As as isEvent, Ri as ptzAutotrackCapability, dc as EventCategory, tt as FIRST_LEVEL_MACRO_CLASSES, uc as errMsg, vn as bareAddonId, wo as BaseAddon } from "../../dist-C3WXy3Ix.mjs";
2
2
  //#region src/builtins/autotrack/autotrack-config.ts
3
3
  var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
4
4
  deadZoneFraction: .5,
@@ -3,9 +3,9 @@ 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-DLVfdGSW.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
- const require_restore_archive = require("../../restore-archive-BkiXu43U.js");
8
+ const require_restore_archive = require("../../restore-archive-DuktQtye.js");
9
9
  let node_crypto = require("node:crypto");
10
10
  let node_fs_promises = require("node:fs/promises");
11
11
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
@@ -1,6 +1,6 @@
1
- import { Sa as storageOccupancyCapability, Vs as nodePin, _n as backupCapability, dc as EventCategory, nc as toNodeId, si as mayWriteToLocation, wo as BaseAddon } from "../../dist-BhR34kF8.mjs";
1
+ import { Sa as storageOccupancyCapability, Vs as nodePin, _n as backupCapability, dc as EventCategory, nc as toNodeId, si as mayWriteToLocation, wo as BaseAddon } from "../../dist-C3WXy3Ix.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
- import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-nWi73iy0.mjs";
3
+ import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-C0YDO-qd.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import * as fsp from "node:fs/promises";
6
6
  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-DLVfdGSW.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let zod = require("zod");
9
9
  //#region src/builtins/calendars/calendar-color.ts
@@ -1,4 +1,4 @@
1
- import { En as calendarsCapability, T as CalendarPreferencesSchema, wo as BaseAddon, ys as defineRecordKinds } from "../../dist-BhR34kF8.mjs";
1
+ import { En as calendarsCapability, T as CalendarPreferencesSchema, wo as BaseAddon, ys as defineRecordKinds } from "../../dist-C3WXy3Ix.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/builtins/calendars/calendar-color.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-DLVfdGSW.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
7
  let zod = require("zod");
8
8
  let _camstack_types_node = require("@camstack/types/node");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { $a as buildFfmpegArgs, Dn as cameraGridLayoutCapability, Ds as hydrateSchema, K as DeclaredDevices, L as DERIVED_CAMERA_SILENCED_CAP_NAMES, St as MOTION_CLOSE_AFTER_MS, Zn as declarationOwnerNodeId, _a as snapshotCapability, dc as EventCategory, hi as motionCapability, lc as DeviceType, m as BaseDevice, ms as createEvent, sc as DeviceFeature, uc as errMsg, ui as memoizePinnedFfmpeg, vn as bareAddonId, wa as streamCatalogCapability, wo as BaseAddon } from "../../dist-BhR34kF8.mjs";
1
+ import { $a as buildFfmpegArgs, Dn as cameraGridLayoutCapability, Ds as hydrateSchema, K as DeclaredDevices, L as DERIVED_CAMERA_SILENCED_CAP_NAMES, St as MOTION_CLOSE_AFTER_MS, Zn as declarationOwnerNodeId, _a as snapshotCapability, dc as EventCategory, hi as motionCapability, lc as DeviceType, m as BaseDevice, ms as createEvent, sc as DeviceFeature, uc as errMsg, ui as memoizePinnedFfmpeg, vn as bareAddonId, wa as streamCatalogCapability, wo as BaseAddon } from "../../dist-C3WXy3Ix.mjs";
2
2
  import { z } from "zod";
3
3
  import { FfmpegProcess } from "@camstack/types/node";
4
4
  import { join } from "node:path";
@@ -3,9 +3,9 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-DLVfdGSW.js");
7
- const require_composition_sources = require("../../composition-sources-B7VyYbEU.js");
8
- const require_capture_engine = require("../../capture-engine-BpoL1zQ0.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
+ const require_composition_sources = require("../../composition-sources-cvZAN87H.js");
8
+ const require_capture_engine = require("../../capture-engine--FQ8NUHh.js");
9
9
  const require_retention = require("../../retention-BNONb5X_.js");
10
10
  let zod = require("zod");
11
11
  //#region src/builtins/composer/actuator-invoke.ts
@@ -2123,7 +2123,8 @@ function ownFieldReading(records, key) {
2123
2123
  };
2124
2124
  return {
2125
2125
  state: "fresh",
2126
- value: outcome.value
2126
+ value: outcome.value,
2127
+ ...outcome.transition === void 0 ? {} : { transition: outcome.transition }
2127
2128
  };
2128
2129
  }
2129
2130
  //#endregion
@@ -1,6 +1,6 @@
1
- import { $i as resolveMutate, Ai as planComposition, Ar as groupTemplate, Cr as featureForwards, Da as switchCapability, Di as parseColorInput, Fn as colorCapability, Gn as coverCapability, Ia as valveCapability, Ja as HISTORY_FAST_MS, K as DeclaredDevices, Kr as kebabToCamel, Ln as composerCapability, Ms as isReadingQuantity, Nn as climateControlCapability, Qa as MINUTE_MS, Qn as declaredSeriesKind, Rn as compositionFieldKey, Sn as buildCapabilityLookup, So as toExpressionValue, Wa as COMPOSER_ADDON_ID, Xa as HOUR_MS, Ya as HISTORY_SLOW_MS, _o as openReset, ao as compositionSliceKey, b as COMPOSED_ITEM_FIXED_FIELDS, bn as brightnessCapability, bo as planStatisticTier, br as fanControlCapability, ci as mediaPlayerCapability, co as disarmRoseMemory, da as sharedActuatorFeatures, dc as EventCategory, di as methodRefusal, eo as cloneStatefulExpressionMemory, fa as sharedActuatorMethods, fo as historyRetentionFromSettings, ft as HvacModeSchema, go as nextLocalMidnight, hi as motionCapability, ho as isHistoryHelper, io as compositionItemFieldPath, kr as groupCommandsCapability, lc as DeviceType, li as mediaPlayerFeaturesOfRoles, lo as evaluateDerivative, m as BaseDevice, mo as isForwardInputRef, mr as evaluateCompositionField, ms as createEvent, n as ACTUATOR_METHODS, no as composedDeviceStableId, o as ALL_CAPABILITY_DEFINITIONS, oo as compositionSourceKey, pa as sharedColorModes, po as integrateReading, qa as DEFAULT_HISTORY_RETENTION, r as ACTUATOR_TEMPLATE_IDS, ra as runFanOut, ro as compositionFeatureEnabled, rt as FanDirectionSchema, so as createStatefulExpressionMemory, st as GroupCommandResultSchema, ti as lockControlCapability, to as composedDeviceRef, uc as errMsg, uo as evaluateStatistic, vo as openStatistic, vr as expressionContainsBuiltinCall, wo as BaseAddon, xo as statisticCadenceMs, xr as fanOutTargets, yo as planResetTier } from "../../dist-BhR34kF8.mjs";
2
- import { i as parseDeviceStateChanged, n as normalizedNativeOwner, r as isRecord$4 } from "../../composition-sources-CknQxftO.mjs";
3
- import { i as capSeriesKey } from "../../capture-engine-CYmRx0Ce.mjs";
1
+ import { $i as resolveMutate, Ai as planComposition, Ar as groupTemplate, Cr as featureForwards, Da as switchCapability, Di as parseColorInput, Fn as colorCapability, Gn as coverCapability, Ia as valveCapability, Ja as HISTORY_FAST_MS, K as DeclaredDevices, Kr as kebabToCamel, Ln as composerCapability, Ms as isReadingQuantity, Nn as climateControlCapability, Qa as MINUTE_MS, Qn as declaredSeriesKind, Rn as compositionFieldKey, Sn as buildCapabilityLookup, So as toExpressionValue, Wa as COMPOSER_ADDON_ID, Xa as HOUR_MS, Ya as HISTORY_SLOW_MS, _o as openReset, ao as compositionSliceKey, b as COMPOSED_ITEM_FIXED_FIELDS, bn as brightnessCapability, bo as planStatisticTier, br as fanControlCapability, ci as mediaPlayerCapability, co as disarmRoseMemory, da as sharedActuatorFeatures, dc as EventCategory, di as methodRefusal, eo as cloneStatefulExpressionMemory, fa as sharedActuatorMethods, fo as historyRetentionFromSettings, ft as HvacModeSchema, go as nextLocalMidnight, hi as motionCapability, ho as isHistoryHelper, io as compositionItemFieldPath, kr as groupCommandsCapability, lc as DeviceType, li as mediaPlayerFeaturesOfRoles, lo as evaluateDerivative, m as BaseDevice, mo as isForwardInputRef, mr as evaluateCompositionField, ms as createEvent, n as ACTUATOR_METHODS, no as composedDeviceStableId, o as ALL_CAPABILITY_DEFINITIONS, oo as compositionSourceKey, pa as sharedColorModes, po as integrateReading, qa as DEFAULT_HISTORY_RETENTION, r as ACTUATOR_TEMPLATE_IDS, ra as runFanOut, ro as compositionFeatureEnabled, rt as FanDirectionSchema, so as createStatefulExpressionMemory, st as GroupCommandResultSchema, ti as lockControlCapability, to as composedDeviceRef, uc as errMsg, uo as evaluateStatistic, vo as openStatistic, vr as expressionContainsBuiltinCall, wo as BaseAddon, xo as statisticCadenceMs, xr as fanOutTargets, yo as planResetTier } from "../../dist-C3WXy3Ix.mjs";
2
+ import { i as parseDeviceStateChanged, n as normalizedNativeOwner, r as isRecord$4 } from "../../composition-sources-Bd09D5f4.mjs";
3
+ import { i as capSeriesKey } from "../../capture-engine-Cmx7DIzV.mjs";
4
4
  import { i as DAY_MS, t as DEFAULT_RETENTION } from "../../retention-B9l9TnGE.mjs";
5
5
  import { z } from "zod";
6
6
  //#region src/builtins/composer/actuator-invoke.ts
@@ -2118,7 +2118,8 @@ function ownFieldReading(records, key) {
2118
2118
  };
2119
2119
  return {
2120
2120
  state: "fresh",
2121
- value: outcome.value
2121
+ value: outcome.value,
2122
+ ...outcome.transition === void 0 ? {} : { transition: outcome.transition }
2122
2123
  };
2123
2124
  }
2124
2125
  //#endregion
@@ -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-DLVfdGSW.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  //#region src/builtins/console-logging/console-destination.ts
9
9
  var LEVEL_RANK = {
@@ -1,4 +1,4 @@
1
- import { ri as logDestinationCapability, wo as BaseAddon } from "../../dist-BhR34kF8.mjs";
1
+ import { ri as logDestinationCapability, wo as BaseAddon } from "../../dist-C3WXy3Ix.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
3
3
  //#region src/builtins/console-logging/console-destination.ts
4
4
  var LEVEL_RANK = {
@@ -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-DLVfdGSW.js");
3
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
4
4
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
5
- const require_composition_sources = require("../../composition-sources-B7VyYbEU.js");
6
- const require_capture_engine = require("../../capture-engine-BpoL1zQ0.js");
5
+ const require_composition_sources = require("../../composition-sources-cvZAN87H.js");
6
+ const require_capture_engine = require("../../capture-engine--FQ8NUHh.js");
7
7
  const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
8
8
  const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
9
9
  let zod = require("zod");
@@ -1,7 +1,7 @@
1
- import { $ as EMPTY_REMOTE_CONFIG, $s as secretTreeFromSchema, $t as SwitchStatusSchema, Aa as timedRunLimitOf, Ai as planComposition, Ba as vocabActionIdFor, Bn as coreBlockAddonId, Bt as RemoteConfigSchema, C as CORE_BLOCK_ADDON_PREFIX, Ct as MediaPlayerStatusSchema, D as ConditionMirror, Ds as hydrateSchema, Fa as validateSchedulerInput, Fi as problemsBlockSave, Fs as isSecretMarker, Ft as REMOTE_MEDIA_COMMANDS, Ga as CompositionSchema, Gi as resolveActionVariables, Gt as SchedulerSchema, Hi as remoteCapability, Hn as coreBlockIdFromAddonId, I as DEFAULT_HOLD_OVERRIDE, In as compileScalarOverride, Ji as resolveCoreBlockEntry, Jn as customRole, K as DeclaredDevices, Ka as DAY_MS, Kr as kebabToCamel, Li as proposeRunningThreshold, Ls as isSecretRefOwnedBy, Mi as powerSourceCapability, Mn as checkTemplatePayload, Mr as internalActionId, Na as validateComposition, Ni as powerSourceLinkOfComposition, Nt as QuantityUnitError, O as ControlStatusSchema, Oa as templateCapability, Pn as collectWhenMirrorSources, Q as EMPTY_REMOTE_ASSUMED_STATE, Qr as localDateOf, S as CORE_BLOCKS_ADDON_ID, Sn as buildCapabilityLookup, Sr as fanPresetsCapability, Ua as zoneOnlySite, Ui as remoteLayoutComponentsCapability, Un as coreBlockSourceKind, Va as weekdayOfLocalDate, Vn as coreBlockComposition, Vr as isInternalActionId, Vt as RunningStateStatusSchema, Wi as replacedFieldKeys, Wn as coreBlocksCapability, Wt as SchedulerError, Xs as resolveSecretMarkers, Yi as resolveCoreBlockFiles, Z as EMPTY_AUTOMATION_STATE, Za as HelperMemberSchema, _i as normalizeActionUnits, an as actionSourceCapability, bi as normalizeStepTargets, c as ActionStepSchema, dc as EventCategory$1, do as helperMembers, en as TemplateKindSchema, et as FAN_CAPTURE_FIELDS, f as AutomationStateDocSchema, fo as historyRetentionFromSettings, fs as collectSecretMarkerRefs, gi as nextOccurrence, gs as defineAddonMigrations, ha as siteFor, hr as evaluateWhenTree, ia as runSteps, ic as transformSecretWrite, in as actionEffect, it as FanPresetSchema, ja as timedRunSeconds, k as CoreBlockSchema, ka as timedRunCapability, kn as capUnitResolver, kt as PowerSourceInfoSchema, l as ActionTargetResolver, lc as DeviceType$1, mn as appendTrace, mt as INTERNAL_ACTION_PREFIX, na as resolveStepArgs, ni as lockDoorLinkOfComposition, nr as describeComposableCaps, nt as FanControlStatusSchema, o as ALL_CAPABILITY_DEFINITIONS, oa as schedulersCapability, on as actionsCapability, oo as compositionSourceKey, p as BUILTIN_REMOTE_COMPONENTS, pt as IDLE_ACTION_STATUS, qn as customKeyOfRole, s as ActionError, sn as addonIdOfActionId, t as ACTION_TARGET_INVALIDATION_EVENTS, to as composedDeviceRef, u as ActionVariableSchema, uc as errMsg$1, vi as normalizeCapStep, wi as occurrenceOn, wo as BaseAddon, x as COMPOSER_RUNNER_ID, xn as buildActionSteps, yi as normalizeCoreBlockWrite, ys as defineRecordKinds, zn as compositionSourceRefs, zt as RemoteAssumedStateSchema } from "../../dist-BhR34kF8.mjs";
1
+ import { $ as EMPTY_REMOTE_CONFIG, $s as secretTreeFromSchema, $t as SwitchStatusSchema, Aa as timedRunLimitOf, Ai as planComposition, Ba as vocabActionIdFor, Bn as coreBlockAddonId, Bt as RemoteConfigSchema, C as CORE_BLOCK_ADDON_PREFIX, Ct as MediaPlayerStatusSchema, D as ConditionMirror, Ds as hydrateSchema, Fa as validateSchedulerInput, Fi as problemsBlockSave, Fs as isSecretMarker, Ft as REMOTE_MEDIA_COMMANDS, Ga as CompositionSchema, Gi as resolveActionVariables, Gt as SchedulerSchema, Hi as remoteCapability, Hn as coreBlockIdFromAddonId, I as DEFAULT_HOLD_OVERRIDE, In as compileScalarOverride, Ji as resolveCoreBlockEntry, Jn as customRole, K as DeclaredDevices, Ka as DAY_MS, Kr as kebabToCamel, Li as proposeRunningThreshold, Ls as isSecretRefOwnedBy, Mi as powerSourceCapability, Mn as checkTemplatePayload, Mr as internalActionId, Na as validateComposition, Ni as powerSourceLinkOfComposition, Nt as QuantityUnitError, O as ControlStatusSchema, Oa as templateCapability, Pn as collectWhenMirrorSources, Q as EMPTY_REMOTE_ASSUMED_STATE, Qr as localDateOf, S as CORE_BLOCKS_ADDON_ID, Sn as buildCapabilityLookup, Sr as fanPresetsCapability, Ua as zoneOnlySite, Ui as remoteLayoutComponentsCapability, Un as coreBlockSourceKind, Va as weekdayOfLocalDate, Vn as coreBlockComposition, Vr as isInternalActionId, Vt as RunningStateStatusSchema, Wi as replacedFieldKeys, Wn as coreBlocksCapability, Wt as SchedulerError, Xs as resolveSecretMarkers, Yi as resolveCoreBlockFiles, Z as EMPTY_AUTOMATION_STATE, Za as HelperMemberSchema, _i as normalizeActionUnits, an as actionSourceCapability, bi as normalizeStepTargets, c as ActionStepSchema, dc as EventCategory$1, do as helperMembers, en as TemplateKindSchema, et as FAN_CAPTURE_FIELDS, f as AutomationStateDocSchema, fo as historyRetentionFromSettings, fs as collectSecretMarkerRefs, gi as nextOccurrence, gs as defineAddonMigrations, ha as siteFor, hr as evaluateWhenTree, ia as runSteps, ic as transformSecretWrite, in as actionEffect, it as FanPresetSchema, ja as timedRunSeconds, k as CoreBlockSchema, ka as timedRunCapability, kn as capUnitResolver, kt as PowerSourceInfoSchema, l as ActionTargetResolver, lc as DeviceType$1, mn as appendTrace, mt as INTERNAL_ACTION_PREFIX, na as resolveStepArgs, ni as lockDoorLinkOfComposition, nr as describeComposableCaps, nt as FanControlStatusSchema, o as ALL_CAPABILITY_DEFINITIONS, oa as schedulersCapability, on as actionsCapability, oo as compositionSourceKey, p as BUILTIN_REMOTE_COMPONENTS, pt as IDLE_ACTION_STATUS, qn as customKeyOfRole, s as ActionError, sn as addonIdOfActionId, t as ACTION_TARGET_INVALIDATION_EVENTS, to as composedDeviceRef, u as ActionVariableSchema, uc as errMsg$1, vi as normalizeCapStep, wi as occurrenceOn, wo as BaseAddon, x as COMPOSER_RUNNER_ID, xn as buildActionSteps, yi as normalizeCoreBlockWrite, ys as defineRecordKinds, zn as compositionSourceRefs, zt as RemoteAssumedStateSchema } from "../../dist-C3WXy3Ix.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
- import { i as parseDeviceStateChanged, t as describeCompositionSources } from "../../composition-sources-CknQxftO.mjs";
4
- import { i as capSeriesKey } from "../../capture-engine-CYmRx0Ce.mjs";
3
+ import { i as parseDeviceStateChanged, t as describeCompositionSources } from "../../composition-sources-Bd09D5f4.mjs";
4
+ import { i as capSeriesKey } from "../../capture-engine-Cmx7DIzV.mjs";
5
5
  import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
6
6
  import { n as unwrapStoredValue, t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
7
7
  import { createRequire } from "node:module";
@@ -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-DLVfdGSW.js");
7
- const require_capture_engine = require("../../capture-engine-BpoL1zQ0.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
+ const require_capture_engine = require("../../capture-engine--FQ8NUHh.js");
8
8
  const require_retention = require("../../retention-BNONb5X_.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 { Co as wattMillisecondsToKwh, Es as historyUnitFor, Ms as isReadingQuantity, ar as deviceHistoryCapability, cr as deviceRunsCapability, ct as HISTORY_CATALOG, dc as EventCategory, hn as armRemovalReconcile, lc as DeviceType, lt as HISTORY_ITEM_CATALOG, q as DeviceRunSchema, sr as deviceRemovalHookCapability, wo as BaseAddon, xs as emitReadiness, ys as defineRecordKinds, z as DEVICE_HISTORY_ENERGY_KEY } from "../../dist-BhR34kF8.mjs";
2
- import { a as catalogMetrics, c as DeviceDirectory, d as identityOf, f as subjectIdOf, i as capSeriesKey, l as isRealDeviceType, n as CaptureEngine, o as readPath, r as capItemSeriesKey, s as readUnit, t as CAP_KEY_PREFIX, u as SeriesRegistry } from "../../capture-engine-CYmRx0Ce.mjs";
1
+ import { Co as wattMillisecondsToKwh, Es as historyUnitFor, Ms as isReadingQuantity, ar as deviceHistoryCapability, cr as deviceRunsCapability, ct as HISTORY_CATALOG, dc as EventCategory, hn as armRemovalReconcile, lc as DeviceType, lt as HISTORY_ITEM_CATALOG, q as DeviceRunSchema, sr as deviceRemovalHookCapability, wo as BaseAddon, xs as emitReadiness, ys as defineRecordKinds, z as DEVICE_HISTORY_ENERGY_KEY } from "../../dist-C3WXy3Ix.mjs";
2
+ import { a as catalogMetrics, c as DeviceDirectory, d as identityOf, f as subjectIdOf, i as capSeriesKey, l as isRealDeviceType, n as CaptureEngine, o as readPath, r as capItemSeriesKey, s as readUnit, t as CAP_KEY_PREFIX, u as SeriesRegistry } from "../../capture-engine-Cmx7DIzV.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-B9l9TnGE.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  //#region src/builtins/device-history/capture/point-writer.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-DLVfdGSW.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
9
9
  const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
@@ -1,4 +1,4 @@
1
- import { Dr as formatMinutes, F as DAY_NAMES, Fs as isSecretMarker, Is as isSecretMarkerLike, J as DeviceStatusSchema, Kn as createDeviceExtensionProvider, Ns as isSecretClear, Oi as parseStreamParamsFormPatch, On as canonicalIconKey, Qo as SECRET_CLEAR, Qs as secretTreeFromPaths, Tn as buildStreamParamsConfigSchema, Ut as STREAM_PROFILE_META, X as DiscoveryProposalBodySchema, Xs as resolveSecretMarkers, Y as DeviceTombstoneSchema, Yr as legacyAutoLinkIds, _r as expandContainer, aa as runtimeStatePolicyFor, ac as userError, at as FieldClaimModeSchema, cc as DeviceRole, dc as EventCategory, ei as locationIconKey, er as defineExtensionSlotProvider, fr as enumerateItemArrayFields, g as CAMERA_SWITCH_ORDER, ga as siteZoneKey, ic as transformSecretWrite, ir as deviceExtensionCapability, js as isKeychainStoredField, ks as isDeviceConfigCap, lc as DeviceType, lr as deviceStateCapability, o as ALL_CAPABILITY_DEFINITIONS, or as deviceManagerCapability, ot as FieldClaimSchema, pr as enumerateSchemaFields, ps as collectZodSecretPaths, rc as toSecretFieldView, rs as WELL_KNOWN_TAB_MAP, sc as DeviceFeature, tc as sleep$1, uc as errMsg, ur as deviceStatusCapability, v as CAP_NAMES_WITH_STATUS, wo as BaseAddon, xi as normalizeUnit, xt as MINUTES_PER_DAY, ys as defineRecordKinds } from "../../dist-BhR34kF8.mjs";
1
+ import { Dr as formatMinutes, F as DAY_NAMES, Fs as isSecretMarker, Is as isSecretMarkerLike, J as DeviceStatusSchema, Kn as createDeviceExtensionProvider, Ns as isSecretClear, Oi as parseStreamParamsFormPatch, On as canonicalIconKey, Qo as SECRET_CLEAR, Qs as secretTreeFromPaths, Tn as buildStreamParamsConfigSchema, Ut as STREAM_PROFILE_META, X as DiscoveryProposalBodySchema, Xs as resolveSecretMarkers, Y as DeviceTombstoneSchema, Yr as legacyAutoLinkIds, _r as expandContainer, aa as runtimeStatePolicyFor, ac as userError, at as FieldClaimModeSchema, cc as DeviceRole, dc as EventCategory, ei as locationIconKey, er as defineExtensionSlotProvider, fr as enumerateItemArrayFields, g as CAMERA_SWITCH_ORDER, ga as siteZoneKey, ic as transformSecretWrite, ir as deviceExtensionCapability, js as isKeychainStoredField, ks as isDeviceConfigCap, lc as DeviceType, lr as deviceStateCapability, o as ALL_CAPABILITY_DEFINITIONS, or as deviceManagerCapability, ot as FieldClaimSchema, pr as enumerateSchemaFields, ps as collectZodSecretPaths, rc as toSecretFieldView, rs as WELL_KNOWN_TAB_MAP, sc as DeviceFeature, tc as sleep$1, uc as errMsg, ur as deviceStatusCapability, v as CAP_NAMES_WITH_STATUS, wo as BaseAddon, xi as normalizeUnit, xt as MINUTES_PER_DAY, ys as defineRecordKinds } from "../../dist-C3WXy3Ix.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
4
4
  import { t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
@@ -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-DLVfdGSW.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.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 { ri as logDestinationCapability, wo as BaseAddon } from "../../dist-BhR34kF8.mjs";
1
+ import { ri as logDestinationCapability, wo as BaseAddon } from "../../dist-C3WXy3Ix.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;