@camstack/system 1.2.180 → 1.2.182

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 (60) hide show
  1. package/dist/addon-runner.js +2 -2
  2. package/dist/addon-runner.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/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  15. package/dist/builtins/device-manager/device-manager.addon.js +235 -89
  16. package/dist/builtins/device-manager/device-manager.addon.mjs +235 -89
  17. package/dist/builtins/device-manager/device-meta-actions.d.ts +7 -18
  18. package/dist/builtins/device-manager/device-provider-context.d.ts +4 -0
  19. package/dist/builtins/device-manager/migrate-device.d.ts +14 -3
  20. package/dist/builtins/device-manager/migrate-guard.d.ts +39 -0
  21. package/dist/builtins/device-manager/migrate-reload.d.ts +8 -0
  22. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  23. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  24. package/dist/builtins/hub-forwarder/index.js +1 -1
  25. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  26. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  27. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  28. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  29. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  30. package/dist/builtins/local-network/local-network.addon.js +1 -1
  31. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  32. package/dist/builtins/loki-logging/index.js +1 -1
  33. package/dist/builtins/loki-logging/index.mjs +1 -1
  34. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  35. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  36. package/dist/builtins/platform-probe/index.js +1 -1
  37. package/dist/builtins/platform-probe/index.mjs +1 -1
  38. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  39. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  40. package/dist/builtins/snapshot/index.js +1 -1
  41. package/dist/builtins/snapshot/index.mjs +1 -1
  42. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  43. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  44. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  45. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  46. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  47. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  48. package/dist/builtins/system-config/system-config.addon.js +1 -1
  49. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  50. package/dist/builtins/winston-logging/index.js +1 -1
  51. package/dist/builtins/winston-logging/index.mjs +1 -1
  52. package/dist/{dist-DqNTelT4.mjs → dist-CVPtxkvV.mjs} +64 -2
  53. package/dist/{dist-TEwQZL3g.js → dist-D8VIyu_0.js} +64 -2
  54. package/dist/index.js +2 -2
  55. package/dist/index.mjs +2 -2
  56. package/dist/{manifest-system-deps-BVIr3MYJ.js → manifest-system-deps-BbP419V1.js} +1 -1
  57. package/dist/{manifest-system-deps-Ci-jhrxY.mjs → manifest-system-deps-Bdezdcd5.mjs} +1 -1
  58. package/dist/{retired-settings-keys-CeSITpIX.mjs → retired-settings-keys-qZHMIuI5.mjs} +1 -1
  59. package/dist/{retired-settings-keys-DauPtbFR.js → retired-settings-keys-wakiINPT.js} +1 -1
  60. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-DqNTelT4.mjs";
1
+ import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-CVPtxkvV.mjs";
2
2
  //#region src/builtins/loki-logging/loki-payload.ts
3
3
  /**
4
4
  * Loki rejects a label name that is not a valid Prometheus label
@@ -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-TEwQZL3g.js");
6
+ const require_dist = require("../../dist-D8VIyu_0.js");
7
7
  let node_fs_promises = require("node:fs/promises");
8
8
  let node_child_process = require("node:child_process");
9
9
  let node_util = require("node:util");
@@ -1,4 +1,4 @@
1
- import { Ft as BaseAddon, Jt as createEvent, Pt as errMsg, Q as foldSnapshotByFunction, _t as reducePoints, dt as metricsProviderCapability, sn as EventCategory, vt as resolveBucketMs } from "../../dist-DqNTelT4.mjs";
1
+ import { Ft as BaseAddon, Jt as createEvent, Pt as errMsg, Q as foldSnapshotByFunction, _t as reducePoints, dt as metricsProviderCapability, sn as EventCategory, vt as resolveBucketMs } from "../../dist-CVPtxkvV.mjs";
2
2
  import { readFile, readdir } from "node:fs/promises";
3
3
  import { execFile, execFileSync } from "node:child_process";
4
4
  import { promisify } from "node:util";
@@ -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-TEwQZL3g.js");
6
+ const require_dist = require("../../dist-D8VIyu_0.js");
7
7
  let node_child_process = require("node:child_process");
8
8
  let node_util = require("node:util");
9
9
  let node_fs = require("node:fs");
@@ -1,5 +1,5 @@
1
1
  import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
2
- import { Ft as BaseAddon, K as enumerateInferenceDevices, Pt as errMsg, Xt as emitReadiness, ht as platformProbeCapability, sn as EventCategory, wt as scoreRuntimes } from "../../dist-DqNTelT4.mjs";
2
+ import { Ft as BaseAddon, K as enumerateInferenceDevices, Pt as errMsg, Xt as emitReadiness, ht as platformProbeCapability, sn as EventCategory, wt as scoreRuntimes } from "../../dist-CVPtxkvV.mjs";
3
3
  import { execFile } from "node:child_process";
4
4
  import { promisify } from "node:util";
5
5
  import * as fs from "node:fs";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-TEwQZL3g.js");
6
+ const require_dist = require("../../dist-D8VIyu_0.js");
7
7
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
8
8
  /**
9
9
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -1,4 +1,4 @@
1
- import { Ft as BaseAddon, sn as EventCategory } from "../../dist-DqNTelT4.mjs";
1
+ import { Ft as BaseAddon, sn as EventCategory } from "../../dist-CVPtxkvV.mjs";
2
2
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
3
3
  /**
4
4
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -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-TEwQZL3g.js");
6
+ const require_dist = require("../../dist-D8VIyu_0.js");
7
7
  let zod = require("zod");
8
8
  let node_crypto = require("node:crypto");
9
9
  let _camstack_types_node = require("@camstack/types/node");
@@ -1,4 +1,4 @@
1
- import { At as streamQualityLabel, Et as snapshotCapability, Ft as BaseAddon, M as bareAddonId, N as batteryCapability, Pt as errMsg, V as deriveBatteryPresence, Vt as DeviceType, en as nodePin, i as BatteryStatusSchema, sn as EventCategory, zt as DeviceFeature } from "../../dist-DqNTelT4.mjs";
1
+ import { At as streamQualityLabel, Et as snapshotCapability, Ft as BaseAddon, M as bareAddonId, N as batteryCapability, Pt as errMsg, V as deriveBatteryPresence, Vt as DeviceType, en as nodePin, i as BatteryStatusSchema, sn as EventCategory, zt as DeviceFeature } from "../../dist-CVPtxkvV.mjs";
2
2
  import { z } from "zod";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { signExpiringUrl, verifyExpiringUrl } 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-TEwQZL3g.js");
6
+ const require_dist = require("../../dist-D8VIyu_0.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_fs_promises = require("node:fs/promises");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Ft as BaseAddon, Z as filesystemBrowseCapability, kt as storageProviderCapability } from "../../dist-DqNTelT4.mjs";
1
+ import { Ft as BaseAddon, Z as filesystemBrowseCapability, kt as storageProviderCapability } from "../../dist-CVPtxkvV.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
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-TEwQZL3g.js");
6
+ const require_dist = require("../../dist-D8VIyu_0.js");
7
7
  const require_hub_cap_forward = require("../../hub-cap-forward-DmHNjbB0.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { C as StorageLocationTypeSchema, Dt as storageCapability, F as collectSecretConfigKeys, Ft as BaseAddon, Ot as storageMigrationCapability, S as StorageCleanupJobSchema, Tt as settingsStoreCapability, h as REDACTED_SECRET, tn as parseJsonObject, w as StorageMigrationJobSchema } from "../../dist-DqNTelT4.mjs";
1
+ import { C as StorageLocationTypeSchema, Dt as storageCapability, F as collectSecretConfigKeys, Ft as BaseAddon, Ot as storageMigrationCapability, S as StorageCleanupJobSchema, Tt as settingsStoreCapability, h as REDACTED_SECRET, tn as parseJsonObject, w as StorageMigrationJobSchema } from "../../dist-CVPtxkvV.mjs";
2
2
  import { t as HUB_CAP_FWD_ACTION } from "../../hub-cap-forward-BdT320dq.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -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-TEwQZL3g.js");
6
+ const require_dist = require("../../dist-D8VIyu_0.js");
7
7
  //#region src/builtins/system-config/system-config.addon.ts
8
8
  /**
9
9
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -1,4 +1,4 @@
1
- import { Ft as BaseAddon, Pt as errMsg, Qt as hydrateSchema } from "../../dist-DqNTelT4.mjs";
1
+ import { Ft as BaseAddon, Pt as errMsg, Qt as hydrateSchema } from "../../dist-CVPtxkvV.mjs";
2
2
  //#region src/builtins/system-config/system-config.addon.ts
3
3
  /**
4
4
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -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-TEwQZL3g.js");
6
+ const require_dist = require("../../dist-D8VIyu_0.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-DqNTelT4.mjs";
1
+ import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-CVPtxkvV.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
@@ -10423,7 +10423,26 @@ var DiscoveryCandidateSchema = z.object({
10423
10423
  * identity ahead of adoption. Rendering metadata (unit, precision)
10424
10424
  * flows live through the cap STATUS SLICE after adoption.
10425
10425
  */
10426
- sourceInfo: SourceInfoSchema.optional()
10426
+ sourceInfo: SourceInfoSchema.optional(),
10427
+ /**
10428
+ * Set when this candidate is a device the provider ALREADY owns.
10429
+ *
10430
+ * A scan cannot generally produce the identity a device was onboarded under
10431
+ * (Reolink keys on `mac-<mac>`, learned at adopt time), so a stableId
10432
+ * comparison never matches and an owned device looks addable. Re-adopting one
10433
+ * overwrites its config with scan-derived values — that is how a Home Hub's
10434
+ * Baichuan port was overwritten with its ONVIF port, taking the hub and its
10435
+ * three child cameras offline for four hours.
10436
+ *
10437
+ * A provider that can recognise its own devices says so here. Absent means
10438
+ * "not recognised", which is not the same as "known to be new" — a provider
10439
+ * that cannot tell simply never sets it.
10440
+ */
10441
+ alreadyOnboarded: z.boolean().optional(),
10442
+ /** Numeric id of the device this candidate was matched to. Set with `alreadyOnboarded`. */
10443
+ onboardedDeviceId: z.number().optional(),
10444
+ /** Operator-facing name of the matched device, so the UI can say WHICH one it is. */
10445
+ onboardedName: z.string().optional()
10427
10446
  });
10428
10447
  /**
10429
10448
  * Flat device summary returned by `createDevice` / `adoptDiscoveredDevice`.
@@ -10479,6 +10498,35 @@ var deviceProviderCapability = {
10479
10498
  name: z.string(),
10480
10499
  type: z.string()
10481
10500
  }))),
10501
+ /**
10502
+ * Tear down and reconstruct ONE device in place from its persisted rows —
10503
+ * touching no other device this provider owns.
10504
+ *
10505
+ * The primitive `deviceManager.migrateDevice` uses to flush the two
10506
+ * migrated numbers: after `swapIds` the runner's live instance still
10507
+ * carries the PRE-swap numeric id (baked into the object, its native-cap
10508
+ * registrations and its log tags), and a live object cannot be renumbered.
10509
+ * Before this method the only flush was restarting the whole owning addon
10510
+ * — which took every camera the provider owns down with it (28 devices
10511
+ * for one migrated camera, measured 2026-09-04, and the morning of the
10512
+ * same day ~27 devices' native caps did not come back on their own).
10513
+ *
10514
+ * Keyed by `stableId`, deliberately: the numeric id is exactly the thing
10515
+ * that changes. The reply carries the id the device answers on NOW.
10516
+ * Implemented once in `BaseDeviceProvider` — decommission the live
10517
+ * instance (if any), then re-create from the persisted row: the same
10518
+ * teardown/rehydrate pair every graceful shutdown + boot already uses.
10519
+ * An RPC, never an event: a dropped event would leave the runner writing
10520
+ * against the wrong camera (D8).
10521
+ *
10522
+ * Construction can dial hardware, and the migrated source is
10523
+ * characteristically dead — the timeout covers a full activate window
10524
+ * rather than the 60 s default.
10525
+ */
10526
+ reloadDevice: method(z.object({ stableId: z.string() }), z.object({ deviceId: z.number() }), {
10527
+ kind: "mutation",
10528
+ timeoutMs: 3 * 6e4
10529
+ }),
10482
10530
  supportsDiscovery: method(z.object({}), z.boolean()),
10483
10531
  /**
10484
10532
  * Run a network scan. `params` carries optional provider-specific scan
@@ -10831,13 +10879,21 @@ var deviceManagerCapability = {
10831
10879
  * `sourceStillLive` names what stayed live; empty is the only value that
10832
10880
  * means the old hardware is quiet. The migration proceeds either way —
10833
10881
  * refusing would refuse the case this exists for.
10882
+ *
10883
+ * **Safe to retry.** A duplicate call while a migration involving either
10884
+ * device is in flight is REFUSED, never queued; a repeat of a swap that
10885
+ * already completed (matched against the `addonId`/`stableId` fingerprint
10886
+ * the swap left on the rows, within 15 min) is a no-op returning the
10887
+ * original report. A blind re-run can no longer silently undo the
10888
+ * migration it retried.
10834
10889
  */
10835
10890
  migrateDevice: method(z.object({
10836
10891
  sourceId: z.number(),
10837
10892
  targetId: z.number()
10838
10893
  }), MigrateDeviceResultSchema, {
10839
10894
  kind: "mutation",
10840
- auth: "admin"
10895
+ auth: "admin",
10896
+ timeoutMs: 12 * 6e4
10841
10897
  }),
10842
10898
  /** Register a device in the DB + in-memory registry. Called by DeviceManagerApi.register(). */
10843
10899
  registerDevice: method(DeviceRegisterPayloadSchema, z.void(), { kind: "mutation" }),
@@ -36330,6 +36386,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
36330
36386
  addonId: null,
36331
36387
  access: "view"
36332
36388
  },
36389
+ "deviceProvider.reloadDevice": {
36390
+ capName: "device-provider",
36391
+ capScope: "system",
36392
+ addonId: null,
36393
+ access: "create"
36394
+ },
36333
36395
  "deviceProvider.start": {
36334
36396
  capName: "device-provider",
36335
36397
  capScope: "system",
@@ -10423,7 +10423,26 @@ var DiscoveryCandidateSchema = zod.z.object({
10423
10423
  * identity ahead of adoption. Rendering metadata (unit, precision)
10424
10424
  * flows live through the cap STATUS SLICE after adoption.
10425
10425
  */
10426
- sourceInfo: SourceInfoSchema.optional()
10426
+ sourceInfo: SourceInfoSchema.optional(),
10427
+ /**
10428
+ * Set when this candidate is a device the provider ALREADY owns.
10429
+ *
10430
+ * A scan cannot generally produce the identity a device was onboarded under
10431
+ * (Reolink keys on `mac-<mac>`, learned at adopt time), so a stableId
10432
+ * comparison never matches and an owned device looks addable. Re-adopting one
10433
+ * overwrites its config with scan-derived values — that is how a Home Hub's
10434
+ * Baichuan port was overwritten with its ONVIF port, taking the hub and its
10435
+ * three child cameras offline for four hours.
10436
+ *
10437
+ * A provider that can recognise its own devices says so here. Absent means
10438
+ * "not recognised", which is not the same as "known to be new" — a provider
10439
+ * that cannot tell simply never sets it.
10440
+ */
10441
+ alreadyOnboarded: zod.z.boolean().optional(),
10442
+ /** Numeric id of the device this candidate was matched to. Set with `alreadyOnboarded`. */
10443
+ onboardedDeviceId: zod.z.number().optional(),
10444
+ /** Operator-facing name of the matched device, so the UI can say WHICH one it is. */
10445
+ onboardedName: zod.z.string().optional()
10427
10446
  });
10428
10447
  /**
10429
10448
  * Flat device summary returned by `createDevice` / `adoptDiscoveredDevice`.
@@ -10479,6 +10498,35 @@ var deviceProviderCapability = {
10479
10498
  name: zod.z.string(),
10480
10499
  type: zod.z.string()
10481
10500
  }))),
10501
+ /**
10502
+ * Tear down and reconstruct ONE device in place from its persisted rows —
10503
+ * touching no other device this provider owns.
10504
+ *
10505
+ * The primitive `deviceManager.migrateDevice` uses to flush the two
10506
+ * migrated numbers: after `swapIds` the runner's live instance still
10507
+ * carries the PRE-swap numeric id (baked into the object, its native-cap
10508
+ * registrations and its log tags), and a live object cannot be renumbered.
10509
+ * Before this method the only flush was restarting the whole owning addon
10510
+ * — which took every camera the provider owns down with it (28 devices
10511
+ * for one migrated camera, measured 2026-09-04, and the morning of the
10512
+ * same day ~27 devices' native caps did not come back on their own).
10513
+ *
10514
+ * Keyed by `stableId`, deliberately: the numeric id is exactly the thing
10515
+ * that changes. The reply carries the id the device answers on NOW.
10516
+ * Implemented once in `BaseDeviceProvider` — decommission the live
10517
+ * instance (if any), then re-create from the persisted row: the same
10518
+ * teardown/rehydrate pair every graceful shutdown + boot already uses.
10519
+ * An RPC, never an event: a dropped event would leave the runner writing
10520
+ * against the wrong camera (D8).
10521
+ *
10522
+ * Construction can dial hardware, and the migrated source is
10523
+ * characteristically dead — the timeout covers a full activate window
10524
+ * rather than the 60 s default.
10525
+ */
10526
+ reloadDevice: method(zod.z.object({ stableId: zod.z.string() }), zod.z.object({ deviceId: zod.z.number() }), {
10527
+ kind: "mutation",
10528
+ timeoutMs: 3 * 6e4
10529
+ }),
10482
10530
  supportsDiscovery: method(zod.z.object({}), zod.z.boolean()),
10483
10531
  /**
10484
10532
  * Run a network scan. `params` carries optional provider-specific scan
@@ -10831,13 +10879,21 @@ var deviceManagerCapability = {
10831
10879
  * `sourceStillLive` names what stayed live; empty is the only value that
10832
10880
  * means the old hardware is quiet. The migration proceeds either way —
10833
10881
  * refusing would refuse the case this exists for.
10882
+ *
10883
+ * **Safe to retry.** A duplicate call while a migration involving either
10884
+ * device is in flight is REFUSED, never queued; a repeat of a swap that
10885
+ * already completed (matched against the `addonId`/`stableId` fingerprint
10886
+ * the swap left on the rows, within 15 min) is a no-op returning the
10887
+ * original report. A blind re-run can no longer silently undo the
10888
+ * migration it retried.
10834
10889
  */
10835
10890
  migrateDevice: method(zod.z.object({
10836
10891
  sourceId: zod.z.number(),
10837
10892
  targetId: zod.z.number()
10838
10893
  }), MigrateDeviceResultSchema, {
10839
10894
  kind: "mutation",
10840
- auth: "admin"
10895
+ auth: "admin",
10896
+ timeoutMs: 12 * 6e4
10841
10897
  }),
10842
10898
  /** Register a device in the DB + in-memory registry. Called by DeviceManagerApi.register(). */
10843
10899
  registerDevice: method(DeviceRegisterPayloadSchema, zod.z.void(), { kind: "mutation" }),
@@ -36330,6 +36386,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
36330
36386
  addonId: null,
36331
36387
  access: "view"
36332
36388
  },
36389
+ "deviceProvider.reloadDevice": {
36390
+ capName: "device-provider",
36391
+ capScope: "system",
36392
+ addonId: null,
36393
+ access: "create"
36394
+ },
36333
36395
  "deviceProvider.start": {
36334
36396
  capName: "device-provider",
36335
36397
  capScope: "system",
package/dist/index.js CHANGED
@@ -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-TEwQZL3g.js");
3
+ const require_dist = require("./dist-D8VIyu_0.js");
4
4
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
5
5
  require("./builtins/alerts/index.js");
6
6
  const require_formatter = require("./formatter-DqAKDlvN.js");
@@ -27,7 +27,7 @@ require("./builtins/system-config/index.js");
27
27
  const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
28
28
  const require_file_data_plane = require("./file-data-plane-DO8KbxCe.js");
29
29
  const require_tls$1 = require("./tls-BxQlomxd.js");
30
- const require_manifest_system_deps = require("./manifest-system-deps-BVIr3MYJ.js");
30
+ const require_manifest_system_deps = require("./manifest-system-deps-BbP419V1.js");
31
31
  const require_resource_monitor = require("./resource-monitor-CdnzxBLP.js");
32
32
  const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
33
33
  let zod = require("zod");
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
2
- import { $ as isArrayOutputSchema, Ct as scopesAllowDeviceCap, D as addonSettingsCapability, Gt as asJsonObject$1, Ht as ReadinessRegistry, It as DATAPLANE_SECRET_HEADER$1, Jt as createEvent, Kt as asNumber, Lt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Pt as errMsg$1, Rt as DEVICE_STATUS_METHOD, St as scopesAllowAddon, Ut as ReadinessTimeoutError, X as extractNestedAddonId, Yt as emitDownForOwnedCaps, Zt as expandCapMethods, an as scopeKey, at as kebabToCamel, bt as resolveMethodAuth, et as isCollectionArrayMethod, g as RUNTIME_DEFAULTS, gt as procedureAuthKey, in as resolveCapMount, it as isVoidInput, lt as logLevelAtMost, m as METHOD_ACCESS_MAP, nn as parseJsonUnknown, ot as lifecycleJobSchema, p as LOG_LEVEL_RANK, pt as objectInputDeclaresAddonId, qt as asString$1, rn as readinessKey, sn as EventCategory$1, t as ALL_CAPABILITY_DEFINITIONS, tn as parseJsonObject, tt as isObjectInput, ut as looseSchema } from "./dist-DqNTelT4.mjs";
2
+ import { $ as isArrayOutputSchema, Ct as scopesAllowDeviceCap, D as addonSettingsCapability, Gt as asJsonObject$1, Ht as ReadinessRegistry, It as DATAPLANE_SECRET_HEADER$1, Jt as createEvent, Kt as asNumber, Lt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Pt as errMsg$1, Rt as DEVICE_STATUS_METHOD, St as scopesAllowAddon, Ut as ReadinessTimeoutError, X as extractNestedAddonId, Yt as emitDownForOwnedCaps, Zt as expandCapMethods, an as scopeKey, at as kebabToCamel, bt as resolveMethodAuth, et as isCollectionArrayMethod, g as RUNTIME_DEFAULTS, gt as procedureAuthKey, in as resolveCapMount, it as isVoidInput, lt as logLevelAtMost, m as METHOD_ACCESS_MAP, nn as parseJsonUnknown, ot as lifecycleJobSchema, p as LOG_LEVEL_RANK, pt as objectInputDeclaresAddonId, qt as asString$1, rn as readinessKey, sn as EventCategory$1, t as ALL_CAPABILITY_DEFINITIONS, tn as parseJsonObject, tt as isObjectInput, ut as looseSchema } from "./dist-CVPtxkvV.mjs";
3
3
  import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
4
4
  import "./builtins/alerts/index.mjs";
5
5
  import { t as formatLogLine } from "./formatter-B7qW8bPJ.mjs";
@@ -26,7 +26,7 @@ import "./builtins/system-config/index.mjs";
26
26
  import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
27
27
  import { a as parseTokenizedUrl, c as collectModelFiles, d as downloadModel, f as ensureModel, h as isModelDownloaded, i as parseRangeHeader, l as deleteModelFromDisk, m as getModelFilePath, n as contentTypeFor, o as resolveFilePath, p as fetchJson, r as createAuthenticatedFileServer, s as ModelDownloadService, t as createFileDataPlaneHandler, u as downloadFile } from "./file-data-plane-BhKdxJgf.mjs";
28
28
  import { C as registerLanHttpHandler, S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, b as bindPendingLanHttp, c as loadTlsCert, d as collectCertIdentity, f as CA_VALIDITY_DAYS, g as evaluateExistingCert, h as SERVER_AUTH_OID, i as writeExtraSans, l as reissueTlsLeaf, m as MAX_LEAF_VALIDITY_DAYS, n as readTlsAccessStatus, o as validateUploadedTls, p as LEAF_RENEWAL_WINDOW_DAYS, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, u as CA_COMMON_NAME, v as allFamiliesListenHost, x as closeLanHttp, y as applyLanHttp } from "./tls-DOTmtLCW.mjs";
29
- import { $ as buildUdsNativeCapProxy, $t as formatHeapSpaces, A as createUdsLoggerWithControl, At as HUB_MAIN_RSS_BUDGET_MB, B as readMoleculerFanoutMode, Bt as createV8Reclaimer, C as ipcParentLink, Ct as createAddonDataPlaneFacility, D as createUdsEventBus, Dt as HEAP_WATCH_INTERVAL_MS, E as createUdsEventBridge, Et as HEAP_RECLAIM_TRIGGER_MB, F as AGENT_CAP_FWD_SERVICE, Ft as RUNNER_RSS_BUDGET_ENV, G as createLocalTransport, Gt as reclaimIntervalMs, H as PARENT_ROUTED_PROVIDER_ADDON_ID, Ht as hubMainRssBudget, I as CapRouteResolver, It as ZERO_LOOP_DELAY, J as SocketChannel, Jt as startRunnerHeapWatch, K as UdsLocalTransportClient, Kt as shouldReclaim, L as CapRouteError, Lt as buildHeapSample, M as LocalChildRegistry, Mt as RSS_BUDGET_REANNOUNCE_MIN_MS, N as UDS_NO_ROUTE_PREFIX, Nt as RSS_BUDGET_RELEASE_RATIO, O as udsChildLogToWorkerEntry, Ot as HEAP_WATCH_WARN_RATIO, P as AGENT_CAP_FWD_ACTION, Pt as RUNNER_HEAP_WATCH_INTERVAL_MS, Q as buildNativeCapProxy, Qt as emitHeapDiagnosticReport, R as classifyCapRoute, Rt as createDeferredHeapWatchSink, S as buildLinkChain, St as runNpm, T as createParentUnownedCallHandler, Tt as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, U as __resetCapUsageRegistryForTests, Ut as nextRssBudgetState, V as CapUsageRegistry, Vt as describeRss, W as getCapUsageRegistry, Wt as parseRssBudgetMb, X as FrameDecoder, Xt as DECISIVE_HEAP_SPACES, Y as localEndpointPath, Yt as strandedMb, Z as encodeFrame, Zt as HEAP_SPACE_REPORT_MIN_MB, _ as AddonDepsManager, _n as createEventPlaneReader, _t as CapabilityUnavailableError, a as createUdsAddonContext, an as createSocketPlaneMeter, at as createAddonService, b as brokerCallForCap, bt as resolveAddonClass, c as getOrInitReadinessRegistryForClient, cn as formatSocketPlane, ct as capActionName, d as clusterEventTopic, dn as recordSocketFrame, dt as capServiceName, en as heapSpaceField, et as createBrokerDeviceManagerApi, f as getBrokerEventBus, fn as sampleSocketDirection, ft as parseCapAction, g as subscribePassthrough, gn as createEventPlaneMeter, gt as CapabilityHandle, h as setNodeEventInterest, hn as EVENT_PLANE_TOP_N, ht as DeviceRegistry, i as createAddonContext, in as SOCKET_PLANE_TOP_N, j as LocalChildClient, jt as HUB_RSS_BUDGET_ENV, k as createUdsLogger, kt as HUB_MAIN_HEAP_WATCH_LABEL, l as setHubConnected, ln as EMPTY_SOCKET_DIRECTION, lt as capActionSuffix, m as registerEventBusService, mn as socketDirectionMessages, mt as serializeTypedArrays, n as installManifestPythonDeps, nn as selectReportedSpaces, o as getWorkerDeviceRegistry, on as createSocketPlaneReader, ot as validateProviderRegistrations, p as getMoleculerEventStats, pn as socketDirectionBytes, pt as deserializeTypedArrays, q as UdsLocalTransportServer, qt as startHeapWatch, r as adaptBrokerToCluster, rn as EMPTY_SOCKET_PLANE_BASELINE, rt as mountNativeCapService, s as getOrInitReadinessRegistry, sn as diffSocketPlane, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestSystemDeps, tn as readHeapSpaces, u as EVENT_TOPIC_PREFIX, un as createSocketDirectionCounters, ut as capBareAction, v as createKernelHwAccel, vn as diffEventPlane, vt as copyBundledNativeModules, w as localProviderLink, wt as HEAP_RECLAIM_MIN_INTERVAL_MS, x as brokerTransportLink, xt as resolveNpmInvocation, y as resolveHwAccel, yn as formatEventPlane, yt as installManifestNativeDeps, z as callWithServiceDiscovery, zt as createLoopDelayMeter } from "./manifest-system-deps-Ci-jhrxY.mjs";
29
+ import { $ as buildUdsNativeCapProxy, $t as formatHeapSpaces, A as createUdsLoggerWithControl, At as HUB_MAIN_RSS_BUDGET_MB, B as readMoleculerFanoutMode, Bt as createV8Reclaimer, C as ipcParentLink, Ct as createAddonDataPlaneFacility, D as createUdsEventBus, Dt as HEAP_WATCH_INTERVAL_MS, E as createUdsEventBridge, Et as HEAP_RECLAIM_TRIGGER_MB, F as AGENT_CAP_FWD_SERVICE, Ft as RUNNER_RSS_BUDGET_ENV, G as createLocalTransport, Gt as reclaimIntervalMs, H as PARENT_ROUTED_PROVIDER_ADDON_ID, Ht as hubMainRssBudget, I as CapRouteResolver, It as ZERO_LOOP_DELAY, J as SocketChannel, Jt as startRunnerHeapWatch, K as UdsLocalTransportClient, Kt as shouldReclaim, L as CapRouteError, Lt as buildHeapSample, M as LocalChildRegistry, Mt as RSS_BUDGET_REANNOUNCE_MIN_MS, N as UDS_NO_ROUTE_PREFIX, Nt as RSS_BUDGET_RELEASE_RATIO, O as udsChildLogToWorkerEntry, Ot as HEAP_WATCH_WARN_RATIO, P as AGENT_CAP_FWD_ACTION, Pt as RUNNER_HEAP_WATCH_INTERVAL_MS, Q as buildNativeCapProxy, Qt as emitHeapDiagnosticReport, R as classifyCapRoute, Rt as createDeferredHeapWatchSink, S as buildLinkChain, St as runNpm, T as createParentUnownedCallHandler, Tt as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, U as __resetCapUsageRegistryForTests, Ut as nextRssBudgetState, V as CapUsageRegistry, Vt as describeRss, W as getCapUsageRegistry, Wt as parseRssBudgetMb, X as FrameDecoder, Xt as DECISIVE_HEAP_SPACES, Y as localEndpointPath, Yt as strandedMb, Z as encodeFrame, Zt as HEAP_SPACE_REPORT_MIN_MB, _ as AddonDepsManager, _n as createEventPlaneReader, _t as CapabilityUnavailableError, a as createUdsAddonContext, an as createSocketPlaneMeter, at as createAddonService, b as brokerCallForCap, bt as resolveAddonClass, c as getOrInitReadinessRegistryForClient, cn as formatSocketPlane, ct as capActionName, d as clusterEventTopic, dn as recordSocketFrame, dt as capServiceName, en as heapSpaceField, et as createBrokerDeviceManagerApi, f as getBrokerEventBus, fn as sampleSocketDirection, ft as parseCapAction, g as subscribePassthrough, gn as createEventPlaneMeter, gt as CapabilityHandle, h as setNodeEventInterest, hn as EVENT_PLANE_TOP_N, ht as DeviceRegistry, i as createAddonContext, in as SOCKET_PLANE_TOP_N, j as LocalChildClient, jt as HUB_RSS_BUDGET_ENV, k as createUdsLogger, kt as HUB_MAIN_HEAP_WATCH_LABEL, l as setHubConnected, ln as EMPTY_SOCKET_DIRECTION, lt as capActionSuffix, m as registerEventBusService, mn as socketDirectionMessages, mt as serializeTypedArrays, n as installManifestPythonDeps, nn as selectReportedSpaces, o as getWorkerDeviceRegistry, on as createSocketPlaneReader, ot as validateProviderRegistrations, p as getMoleculerEventStats, pn as socketDirectionBytes, pt as deserializeTypedArrays, q as UdsLocalTransportServer, qt as startHeapWatch, r as adaptBrokerToCluster, rn as EMPTY_SOCKET_PLANE_BASELINE, rt as mountNativeCapService, s as getOrInitReadinessRegistry, sn as diffSocketPlane, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestSystemDeps, tn as readHeapSpaces, u as EVENT_TOPIC_PREFIX, un as createSocketDirectionCounters, ut as capBareAction, v as createKernelHwAccel, vn as diffEventPlane, vt as copyBundledNativeModules, w as localProviderLink, wt as HEAP_RECLAIM_MIN_INTERVAL_MS, x as brokerTransportLink, xt as resolveNpmInvocation, y as resolveHwAccel, yn as formatEventPlane, yt as installManifestNativeDeps, z as callWithServiceDiscovery, zt as createLoopDelayMeter } from "./manifest-system-deps-Bdezdcd5.mjs";
30
30
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-BWmQ5i-o.mjs";
31
31
  import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
32
32
  import { z } from "zod";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- require("./dist-TEwQZL3g.js");
2
+ require("./dist-D8VIyu_0.js");
3
3
  require("./hub-cap-forward-DmHNjbB0.js");
4
4
  let node_crypto = require("node:crypto");
5
5
  node_crypto = require_chunk.__toESM(node_crypto);
@@ -1,4 +1,4 @@
1
- import "./dist-DqNTelT4.mjs";
1
+ import "./dist-CVPtxkvV.mjs";
2
2
  import "./hub-cap-forward-BdT320dq.mjs";
3
3
  import * as crypto$1 from "node:crypto";
4
4
  import { randomBytes, randomUUID } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import { Gt as asJsonObject } from "./dist-DqNTelT4.mjs";
1
+ import { Gt as asJsonObject } from "./dist-CVPtxkvV.mjs";
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-TEwQZL3g.js");
1
+ const require_dist = require("./dist-D8VIyu_0.js");
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.2.180",
3
+ "version": "1.2.182",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",