@camstack/system 1.2.179 → 1.2.180

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 (64) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  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/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +56 -10
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +657 -62
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +658 -63
  12. package/dist/builtins/backup-orchestrator/run-queue.d.ts +103 -0
  13. package/dist/builtins/backup-orchestrator/staging-paths.d.ts +36 -0
  14. package/dist/builtins/console-logging/index.js +1 -1
  15. package/dist/builtins/console-logging/index.mjs +1 -1
  16. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  17. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  18. package/dist/builtins/device-manager/device-manager.addon.js +146 -5
  19. package/dist/builtins/device-manager/device-manager.addon.mjs +146 -5
  20. package/dist/builtins/device-manager/device-meta-actions.d.ts +1 -1
  21. package/dist/builtins/device-manager/migrate-device.d.ts +33 -0
  22. package/dist/builtins/device-manager/migrate-hardware-state.d.ts +24 -0
  23. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  24. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  25. package/dist/builtins/hub-forwarder/index.js +1 -1
  26. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  27. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  28. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  29. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  30. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  31. package/dist/builtins/local-network/local-network.addon.js +1 -1
  32. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  33. package/dist/builtins/loki-logging/index.js +1 -1
  34. package/dist/builtins/loki-logging/index.mjs +1 -1
  35. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  36. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  37. package/dist/builtins/platform-probe/index.js +1 -1
  38. package/dist/builtins/platform-probe/index.mjs +1 -1
  39. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  40. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  41. package/dist/builtins/snapshot/index.js +1 -1
  42. package/dist/builtins/snapshot/index.mjs +1 -1
  43. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  44. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  45. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  46. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  47. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  48. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  49. package/dist/builtins/system-backup/system-backup.service.d.ts +55 -2
  50. package/dist/builtins/system-config/system-config.addon.js +1 -1
  51. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  52. package/dist/builtins/winston-logging/index.js +1 -1
  53. package/dist/builtins/winston-logging/index.mjs +1 -1
  54. package/dist/{dist-L_39vRmH.mjs → dist-DqNTelT4.mjs} +167 -1
  55. package/dist/{dist-C7qWwrK1.js → dist-TEwQZL3g.js} +167 -1
  56. package/dist/index.js +530 -2
  57. package/dist/index.mjs +533 -5
  58. package/dist/kernel/addon-installer.d.ts +69 -0
  59. package/dist/kernel/deps/closure-dedupe.d.ts +105 -0
  60. package/dist/{manifest-system-deps-PAIfmNun.js → manifest-system-deps-BVIr3MYJ.js} +1 -1
  61. package/dist/{manifest-system-deps-CMOGc5nC.mjs → manifest-system-deps-Ci-jhrxY.mjs} +1 -1
  62. package/dist/{retired-settings-keys-CnbKAxmX.mjs → retired-settings-keys-CeSITpIX.mjs} +1 -1
  63. package/dist/{retired-settings-keys-3soU9pfP.js → retired-settings-keys-DauPtbFR.js} +1 -1
  64. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_manifest_system_deps = require("./manifest-system-deps-PAIfmNun.js");
2
+ const require_manifest_system_deps = require("./manifest-system-deps-BVIr3MYJ.js");
3
3
  const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
4
4
  let node_path = require("node:path");
5
5
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { A as createUdsLoggerWithControl, Ft as RUNNER_RSS_BUDGET_ENV, Jt as startRunnerHeapWatch, Qt as emitHeapDiagnosticReport, a as createUdsAddonContext, bt as resolveAddonClass, it as setWorkerNativeCapsChangeListener, j as LocalChildClient, n as installManifestPythonDeps, nt as getWorkerNativeCapSnapshot, ot as validateProviderRegistrations, t as installManifestSystemDeps, tt as getWorkerNativeCapProvider, yt as installManifestNativeDeps } from "./manifest-system-deps-CMOGc5nC.mjs";
1
+ import { A as createUdsLoggerWithControl, Ft as RUNNER_RSS_BUDGET_ENV, Jt as startRunnerHeapWatch, Qt as emitHeapDiagnosticReport, a as createUdsAddonContext, bt as resolveAddonClass, it as setWorkerNativeCapsChangeListener, j as LocalChildClient, n as installManifestPythonDeps, nt as getWorkerNativeCapSnapshot, ot as validateProviderRegistrations, t as installManifestSystemDeps, tt as getWorkerNativeCapProvider, yt as installManifestNativeDeps } from "./manifest-system-deps-Ci-jhrxY.mjs";
2
2
  import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
3
3
  import { register } from "node:module";
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-C7qWwrK1.js");
6
+ const require_dist = require("../../dist-TEwQZL3g.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 { E as addonPagesCapability, Ft as BaseAddon, Pt as errMsg, sn as EventCategory } from "../../dist-L_39vRmH.mjs";
1
+ import { E as addonPagesCapability, Ft as BaseAddon, Pt as errMsg, sn as EventCategory } from "../../dist-DqNTelT4.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-C7qWwrK1.js");
6
+ const require_dist = require("../../dist-TEwQZL3g.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 { Ft as BaseAddon, O as addonWidgetsCapability, Pt as errMsg, sn as EventCategory } from "../../dist-L_39vRmH.mjs";
1
+ import { Ft as BaseAddon, O as addonWidgetsCapability, Pt as errMsg, sn as EventCategory } from "../../dist-DqNTelT4.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
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-C7qWwrK1.js");
6
+ const require_dist = require("../../dist-TEwQZL3g.js");
7
7
  //#region src/builtins/alerts/prune-policy.ts
8
8
  /**
9
9
  * Ids older than `cutoffMs`, oldest first.
@@ -1,4 +1,4 @@
1
- import { Ft as BaseAddon, Jt as createEvent, Pt as errMsg, k as alertsCapability, n as AlertSchema, sn as EventCategory } from "../../dist-L_39vRmH.mjs";
1
+ import { Ft as BaseAddon, Jt as createEvent, Pt as errMsg, k as alertsCapability, n as AlertSchema, sn as EventCategory } from "../../dist-DqNTelT4.mjs";
2
2
  //#region src/builtins/alerts/prune-policy.ts
3
3
  /**
4
4
  * Ids older than `cutoffMs`, oldest first.
@@ -7,10 +7,12 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
7
7
  /**
8
8
  * Transient build buffer for archive fan-out. The tar is built here
9
9
  * ONCE, streamed to every destination via the storage cap's chunked
10
- * upload, then removed. Lives in the addon's private `ctx.dataDir`
11
- * (never `api.storage.resolve`, per the AddonContext contract) — a
12
- * `cache` storage location is never declared, so resolving one threw
13
- * and aborted every run before a byte was written.
10
+ * upload, then removed. Lives at `<nodeDataDir>/backup-staging` —
11
+ * OUTSIDE every backed-up location, so a backup can never contain a
12
+ * backup (the old `ctx.dataDir/staging` sat inside `addons-data` and
13
+ * compounded 175M → 4.5G before Jul 28), and distinct from
14
+ * `<nodeDataDir>/backups` where the default `backups` destination
15
+ * seeds when `CAMSTACK_BACKUP_ROOT` is unset. See staging-paths.ts.
14
16
  */
15
17
  private stagingDir;
16
18
  private scheduleTimer;
@@ -22,6 +24,15 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
22
24
  */
23
25
  private scheduleBaselineAt;
24
26
  private readonly manifestLock;
27
+ /**
28
+ * Global execution queue — at most ONE archive build at a time,
29
+ * cluster-node-wide (D342). Replaces the earlier invisible
30
+ * single-flight `buildLock`: same serialisation guarantee (two
31
+ * schedules due one tick apart built 8.2 GB + 3.7 GB side by side on
32
+ * the hub, 2026-09-04), but every run is now observable via
33
+ * `listRuns`, joinable when identical, and cancellable mid-stream.
34
+ */
35
+ private runQueue;
25
36
  constructor();
26
37
  protected onInitialize(): Promise<ProviderRegistration[]>;
27
38
  protected onShutdown(): Promise<void>;
@@ -59,14 +70,49 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
59
70
  private aggregatedList;
60
71
  private stagingPath;
61
72
  /**
62
- * Build a single archive in the private staging dir, then push
63
- * it to every selected destination via the storage cap's chunked
64
- * upload protocol. Per-destination errors are logged and counted
65
- * via allSettled semantics — one bad sink doesn't kill the run. The
66
- * staging file is deleted in `finally` so a crash mid-fanout doesn't
67
- * leak.
73
+ * Boot-time staging hygiene. Sweeps the staging dir (sparing an
74
+ * archive a pending-restore marker references — the boot hook has
75
+ * not consumed it yet), then reports — without touching — the LEGACY
76
+ * staging dir inside `addons-data`, where pre-move leaks live. The
77
+ * legacy dir held 5.1 GB on the hub; deleting operator-visible
78
+ * gigabytes silently is not this addon's call, so it warns with the
79
+ * footprint instead.
80
+ */
81
+ private cleanStagingArea;
82
+ /**
83
+ * Trigger a backup run through the global execution queue (D342):
84
+ * at most one archive build at a time, a trigger that arrives while
85
+ * one is in flight WAITS (or joins an identical queued run), and the
86
+ * result says which happened. The call still resolves when the run
87
+ * terminates; a cancelled run resolves with `cancelled: true` and
88
+ * whatever entries landed before the stop — a deliberate operator
89
+ * cancel is an outcome, not an error.
68
90
  */
69
91
  private triggerBackup;
92
+ /** Wire `backup.listRuns` — queued + active + bounded history. */
93
+ private listRuns;
94
+ /**
95
+ * Wire `backup.cancel`. Delegates to the queue: a queued run is
96
+ * removed before it starts; the running run's abort signal fires and
97
+ * `runBackupBuild` stops the tar/upload streams and deletes its
98
+ * staging archive on the way out.
99
+ */
100
+ private cancelRun;
101
+ /**
102
+ * Execute ONE backup run — only ever called by the queue, never
103
+ * directly (the queue is the single serialisation authority).
104
+ * Builds the archive in the private staging dir, then pushes it to
105
+ * every selected destination via the storage cap's chunked upload
106
+ * protocol. Per-destination errors are logged and recorded on the
107
+ * run — one bad sink doesn't kill the run.
108
+ *
109
+ * Cleanup contract (D342): the staging file is deleted in `finally`,
110
+ * which covers success, per-destination failure, build failure AND
111
+ * cancellation alike. The only leak this cannot cover — the process
112
+ * dying inside the run — is reclaimed by the boot sweep in
113
+ * `cleanStagingArea`.
114
+ */
115
+ private runBackupBuild;
70
116
  /**
71
117
  * Push the staged archive to a single destination via chunked
72
118
  * upload, then update the per-location manifest. Applies the