@camstack/system 1.2.453 → 1.2.454

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 (95) hide show
  1. package/dist/{agent-https-DL2cFOQv.js → agent-https-B7IjRRzT.js} +2 -2
  2. package/dist/{agent-https-XAZFJjOS.mjs → agent-https-oXsR24R2.mjs} +2 -2
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alert-episode-policy.d.ts +39 -0
  8. package/dist/builtins/alerts/alerts.addon.d.ts +25 -38
  9. package/dist/builtins/alerts/alerts.addon.js +178 -423
  10. package/dist/builtins/alerts/alerts.addon.mjs +178 -423
  11. package/dist/builtins/alerts/emit-alert-policy.d.ts +3 -16
  12. package/dist/builtins/alerts/runner-alert.d.ts +0 -13
  13. package/dist/builtins/autotrack/index.js +1 -1
  14. package/dist/builtins/autotrack/index.mjs +1 -1
  15. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  16. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  17. package/dist/builtins/calendars/calendars.addon.js +1 -1
  18. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  19. package/dist/builtins/camera-grid/index.js +1 -1
  20. package/dist/builtins/camera-grid/index.mjs +1 -1
  21. package/dist/builtins/composer/composer.addon.js +2 -2
  22. package/dist/builtins/composer/composer.addon.mjs +2 -2
  23. package/dist/builtins/console-logging/index.js +1 -1
  24. package/dist/builtins/console-logging/index.mjs +1 -1
  25. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  26. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  27. package/dist/builtins/device-history/device-history.addon.js +1 -1
  28. package/dist/builtins/device-history/device-history.addon.mjs +1 -1
  29. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  30. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  31. package/dist/builtins/hub-forwarder/index.js +1 -1
  32. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  33. package/dist/builtins/keychain/index.js +4 -4
  34. package/dist/builtins/keychain/index.mjs +4 -4
  35. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  36. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  37. package/dist/builtins/local-auth/local-auth.addon.js +3 -3
  38. package/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
  39. package/dist/builtins/local-network/local-network.addon.js +2 -2
  40. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  41. package/dist/builtins/loki-logging/index.js +1 -1
  42. package/dist/builtins/loki-logging/index.mjs +1 -1
  43. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  44. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  45. package/dist/builtins/platform-probe/index.js +1 -1
  46. package/dist/builtins/platform-probe/index.mjs +1 -1
  47. package/dist/builtins/record-entries/index.js +22 -2
  48. package/dist/builtins/record-entries/index.mjs +22 -2
  49. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  50. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  51. package/dist/builtins/snapshot/index.js +1 -1
  52. package/dist/builtins/snapshot/index.mjs +1 -1
  53. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  54. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  55. package/dist/builtins/sqlite-storage/index.js +1 -1
  56. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  57. package/dist/builtins/sqlite-storage/records/records-engine.d.ts +13 -0
  58. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  59. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  60. package/dist/builtins/storage-orchestrator/location-class-paths.d.ts +13 -0
  61. package/dist/builtins/storage-orchestrator/location-repoint-move.d.ts +6 -1
  62. package/dist/builtins/storage-orchestrator/location-repointer.d.ts +97 -0
  63. package/dist/builtins/storage-orchestrator/location-store.d.ts +13 -2
  64. package/dist/builtins/storage-orchestrator/record-kinds.d.ts +5 -0
  65. package/dist/builtins/storage-orchestrator/storage-location-band-monitor.d.ts +38 -4
  66. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +8 -2
  67. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +486 -143
  68. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +486 -143
  69. package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +26 -1
  70. package/dist/builtins/system-config/system-config.addon.js +3 -3
  71. package/dist/builtins/system-config/system-config.addon.mjs +3 -3
  72. package/dist/builtins/winston-logging/index.js +1 -1
  73. package/dist/builtins/winston-logging/index.mjs +1 -1
  74. package/dist/{composition-sources-DwEvAg5Z.js → composition-sources-Cukc78eu.js} +1 -1
  75. package/dist/{composition-sources-jYNpYEhS.mjs → composition-sources-bt6IQDLu.mjs} +1 -1
  76. package/dist/{constants-B3fDUnJt.js → constants-DBGG6Zu5.js} +1 -1
  77. package/dist/{constants-DGBB3tNi.mjs → constants-DQcVrhVI.mjs} +1 -1
  78. package/dist/{device-ca-njpTMpJC.js → device-ca-B3hUVfYk.js} +1 -1
  79. package/dist/{device-ca-Dpkxg7px.mjs → device-ca-Utfvsx5x.mjs} +1 -1
  80. package/dist/{dist-B9C2v4SG.mjs → dist-7ZciHCIp.mjs} +315 -44
  81. package/dist/{dist-DyjNaeIj.js → dist-Bi4Ioxop.js} +338 -43
  82. package/dist/file-host-worker.js +1 -1
  83. package/dist/file-host-worker.mjs +1 -1
  84. package/dist/{hub-mdns-ciao-DpdFaLz-.js → hub-mdns-ciao-2FzLWfbD.js} +2 -2
  85. package/dist/{hub-mdns-ciao-B4wHDMvk.mjs → hub-mdns-ciao-BRs3DUT-.mjs} +2 -2
  86. package/dist/index.js +7 -7
  87. package/dist/index.mjs +7 -7
  88. package/dist/{phase6-declare-gate-CNxKbsvm.mjs → phase6-declare-gate-D-2LMw9o.mjs} +1 -1
  89. package/dist/{phase6-declare-gate-BlTDMI3t.js → phase6-declare-gate-DwYAep7y.js} +1 -1
  90. package/dist/{restore-archive-BeGP9IYs.js → restore-archive-C0ymYQk7.js} +1 -1
  91. package/dist/{restore-archive-D7HwsszI.mjs → restore-archive-UVZv_hmr.mjs} +1 -1
  92. package/dist/{wal-maintenance-i3GRvmQW.js → wal-maintenance-Bo_lo3Dh.js} +0 -0
  93. package/dist/{wal-maintenance-HEmw2Fik.mjs → wal-maintenance-Df89xxrK.mjs} +0 -0
  94. package/package.json +1 -1
  95. package/dist/builtins/alerts/critical-push.d.ts +0 -90
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-DyjNaeIj.js");
2
+ const require_dist = require("./dist-Bi4Ioxop.js");
3
3
  const require_x509_es = require("./x509.es-C4cOo48M.js");
4
- const require_constants = require("./constants-B3fDUnJt.js");
4
+ const require_constants = require("./constants-DBGG6Zu5.js");
5
5
  let zod = require("zod");
6
6
  let node_crypto = require("node:crypto");
7
7
  let _camstack_types_node = require("@camstack/types/node");
@@ -1,6 +1,6 @@
1
- import { Mi as defineRecordKinds } from "./dist-B9C2v4SG.mjs";
1
+ import { Ii as defineRecordKinds } from "./dist-7ZciHCIp.mjs";
2
2
  import { S as backdatedNotBefore, _ as NameConstraints, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, g as GeneralSubtrees, h as GeneralSubtree, i as Extension, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension, v as GeneralName, x as AsnConvert } from "./x509.es-DK__ETIe.mjs";
3
- import { c as SERVER_AUTH_OID$1, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "./constants-DGBB3tNi.mjs";
3
+ import { c as SERVER_AUTH_OID$1, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "./constants-DQcVrhVI.mjs";
4
4
  import { z } from "zod";
5
5
  import { X509Certificate, createHash, createPrivateKey, randomBytes, webcrypto } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-DyjNaeIj.js");
6
+ const require_dist = require("../../dist-Bi4Ioxop.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Hr as BaseAddon, Vr as errMsg, ma as EventCategory, ut as addonPagesCapability } from "../../dist-B9C2v4SG.mjs";
1
+ import { Gr as errMsg, Kr as BaseAddon, ut as addonPagesCapability, va as EventCategory } from "../../dist-7ZciHCIp.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-DyjNaeIj.js");
6
+ const require_dist = require("../../dist-Bi4Ioxop.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Hr as BaseAddon, Vr as errMsg, ft as addonWidgetsCapability, ma as EventCategory } from "../../dist-B9C2v4SG.mjs";
1
+ import { Gr as errMsg, Kr as BaseAddon, ft as addonWidgetsCapability, va as EventCategory } from "../../dist-7ZciHCIp.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as path$1 from "node:path";
@@ -0,0 +1,39 @@
1
+ /**
2
+ * When does an alert open a new EPISODE, and which edge of it is announced?
3
+ *
4
+ * The alert centre sends no notification. It stamps every alert it stores with
5
+ * an `episodeId` (`metadata.episodeId`) and announces the opening and the
6
+ * closing of critical and error episodes on the bus; Notification Center turns
7
+ * those into notifications (`alert-critical`, `alert-error`,
8
+ * `alert-critical-resolved`). The identity is what makes a notification
9
+ * once-per-episode: any number of re-emits of an open alert keep the id, a new
10
+ * episode after completion gets a new one.
11
+ */
12
+ import { type AlertSeverity, type AlertStatus } from "@camstack/types";
13
+ /** What the policy needs of a stored alert. */
14
+ export interface EpisodeView {
15
+ readonly status: AlertStatus;
16
+ readonly severity: AlertSeverity;
17
+ readonly episodeId: string;
18
+ /** The emitter's own episode marker (`metadata.episodeKey`), when it has one. */
19
+ readonly episodeKey?: string;
20
+ }
21
+ export interface NextEpisodeIdInput {
22
+ readonly alertId: string;
23
+ readonly previous: EpisodeView | null;
24
+ readonly incomingKey: string | undefined;
25
+ readonly now: number;
26
+ }
27
+ /**
28
+ * The previous episode continues while its alert is still open and the emitter
29
+ * did not mark a new one; anything else opens `<alertId>@<now>`.
30
+ */
31
+ export declare function nextEpisodeId(input: NextEpisodeIdInput): string;
32
+ export type EpisodeEdge = "raised" | "resolved";
33
+ /**
34
+ * The edge to announce for a write that took `previous` to `next`, or `null`.
35
+ * A re-emit that changes nothing about the episode announces nothing; an
36
+ * escalation from `error` to `critical` inside one episode is announced again
37
+ * (it is a different kind, and the operator opted into it separately).
38
+ */
39
+ export declare function episodeEdge(previous: EpisodeView | null, next: EpisodeView): EpisodeEdge | null;
@@ -3,23 +3,11 @@ import { BaseAddon, type ProviderRegistration } from "@camstack/types";
3
3
  interface AlertCenterConfig {
4
4
  readonly maxAlerts: number;
5
5
  readonly retentionDays: number;
6
- /** Push critical system alerts (runner failed/refused, runners degraded) straight to the notifiers (D877). */
7
- readonly criticalPushEnabled: boolean;
8
- /**
9
- * Notifier target ids for that push (`notification-target-multiselect`).
10
- * Empty = every enabled operator-level (shared) target. A legacy CSV string
11
- * still stored in the addon store is accepted at read time.
12
- */
13
- readonly criticalPushTargetIds: readonly string[];
14
6
  }
15
7
  export declare class AlertCenterAddon extends BaseAddon<AlertCenterConfig> {
16
8
  private alertStore;
17
9
  private unsubscribers;
18
- /** How long a burst of critical findings is gathered into one digest push. */
19
- private readonly pushCoalesceMs;
20
- constructor(options?: {
21
- readonly pushCoalesceMs?: number;
22
- });
10
+ constructor();
23
11
  /**
24
12
  * Per `(category, source.id)` counter used to rate-limit chatty
25
13
  * events. Entries are pruned lazily when they age out of
@@ -37,41 +25,25 @@ export declare class AlertCenterAddon extends BaseAddon<AlertCenterConfig> {
37
25
  markRead(alertId: string): Promise<void>;
38
26
  markAllRead(): Promise<void>;
39
27
  dismiss(alertId: string): Promise<void>;
28
+ /**
29
+ * Events are handled one at a time: every handler is a read-modify-write of
30
+ * an alert, and two concurrent events about one runner would both read "no
31
+ * alert yet" and open two episodes for it.
32
+ */
33
+ private eventChain;
40
34
  private handleEvent;
35
+ private processEvent;
41
36
  private readRunnerRecord;
42
37
  private handleRunnerEvent;
43
38
  /**
44
39
  * A runner reached `running`: its episode is over. Close the runner alert so a
45
- * later failure opens a NEW episode (new push key), instead of folding into a
46
- * stale `refused` record that would never push again.
40
+ * later failure opens a NEW episode, instead of folding into a stale
41
+ * `refused` record whose notification was already sent.
47
42
  */
48
43
  private handleRunnerStateChanged;
49
44
  /** The node's one-shot runner boot check: one alert, dismissed when the node is clean. */
50
45
  private handleRunnerCheck;
51
46
  private readAlertRaw;
52
- /** Pushes run one at a time so a burst can never send the same state twice. */
53
- private pushChain;
54
- /** Findings waiting for the next digest, by alert id. */
55
- private readonly pushQueue;
56
- private pushTimer;
57
- private pushPolicy;
58
- /** Rewrite a legacy CSV `criticalPushTargetIds` string into `string[]`. */
59
- private migrateCriticalPushTargetIds;
60
- private pushPorts;
61
- /**
62
- * Queue a critical finding for the next digest. A burst (every runner of a boot)
63
- * arrives within the coalesce window and leaves as ONE message per target.
64
- */
65
- private queuePush;
66
- /** Send the queued findings now (also the reconcile path). */
67
- private flushPushes;
68
- private storePushState;
69
- /**
70
- * Retry every critical alert whose push is still pending - at boot and when
71
- * the notifiers or notification-center start. An alert whose state was already
72
- * delivered is skipped by its key, so reconciling never sends twice.
73
- */
74
- private reconcilePendingPushes;
75
47
  private handleModelDownload;
76
48
  /**
77
49
  * `[ALERT-CENTER-EVENTS]` — rate limit a `(category, source.id)`
@@ -138,8 +110,23 @@ export declare class AlertCenterAddon extends BaseAddon<AlertCenterConfig> {
138
110
  * Read-merge-write: SettingsBackend.update() replaces the entire `data` blob,
139
111
  * so we must read the existing record, merge the patch, and write back.
140
112
  */
113
+ /** Alert writes (stamp + store + announce) from any caller, one at a time. */
114
+ private writeChain;
115
+ private serializedWrite;
141
116
  private mergeUpdate;
117
+ private mergeUpdateNow;
118
+ /**
119
+ * Store an alert, stamping its episode identity. The stored alert is what a
120
+ * caller must use afterwards, and the opening or closing of a critical/error
121
+ * episode is announced here, in the one place every write passes through.
122
+ */
142
123
  private persistAlert;
124
+ private persistAlertNow;
125
+ /**
126
+ * Announce an episode edge on the bus. Telemetry, and it may be dropped
127
+ * (D8): Notification Center reconciles from the alerts store (D11, D49).
128
+ */
129
+ private announceEpisode;
143
130
  private emitAlertCreatedEvent;
144
131
  private emitAlertUpdatedEvent;
145
132
  private enforceMaxAlerts;