@camstack/system 1.1.52 → 1.1.54

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 (58) hide show
  1. package/dist/addon-runner.js +2 -2
  2. package/dist/addon-runner.mjs +2 -2
  3. package/dist/addon-utils.d.ts +1 -0
  4. package/dist/addon-utils.js +2 -0
  5. package/dist/addon-utils.mjs +2 -2
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  10. package/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  13. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  14. package/dist/builtins/console-logging/index.js +1 -1
  15. package/dist/builtins/console-logging/index.mjs +1 -1
  16. package/dist/builtins/device-manager/device-linked-devices.d.ts +1 -1
  17. package/dist/builtins/device-manager/device-manager.addon.js +1608 -1589
  18. package/dist/builtins/device-manager/device-manager.addon.mjs +1608 -1589
  19. package/dist/builtins/device-manager/device-store-sections.d.ts +26 -0
  20. package/dist/builtins/doorbell/doorbell-settings.d.ts +58 -0
  21. package/dist/builtins/doorbell/trigger-engine.d.ts +32 -30
  22. package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +39 -22
  23. package/dist/builtins/doorbell/virtual-doorbell.addon.js +207 -191
  24. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +207 -191
  25. package/dist/builtins/hub-forwarder/index.js +1 -1
  26. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  27. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  28. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  29. package/dist/builtins/local-network/local-network.addon.js +1 -1
  30. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  31. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  32. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  33. package/dist/builtins/platform-probe/index.js +1 -1
  34. package/dist/builtins/platform-probe/index.mjs +1 -1
  35. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  36. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  37. package/dist/builtins/snapshot/index.js +1 -1
  38. package/dist/builtins/snapshot/index.mjs +1 -1
  39. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  40. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  41. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +11 -3
  42. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +11 -3
  43. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  44. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  45. package/dist/builtins/system-config/system-config.addon.js +1 -1
  46. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  47. package/dist/builtins/winston-logging/index.js +1 -1
  48. package/dist/builtins/winston-logging/index.mjs +1 -1
  49. package/dist/{dist-BduBhv6N.js → dist-B5C4dVvO.js} +293 -23
  50. package/dist/{dist-B_PSvr-m.mjs → dist-DssImRC5.mjs} +293 -23
  51. package/dist/index.js +22 -5
  52. package/dist/index.mjs +22 -6
  53. package/dist/kernel/index.d.ts +1 -1
  54. package/dist/kernel/moleculer/readiness-context.d.ts +12 -8
  55. package/dist/kernel/moleculer/readiness-service.d.ts +16 -1
  56. package/dist/{manifest-python-deps-CIyvuHAB.mjs → manifest-python-deps-CWom-eqp.mjs} +35 -9
  57. package/dist/{manifest-python-deps-CPAMH5gV.js → manifest-python-deps-kkvku9yU.js} +35 -9
  58. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { K as readNodePin } from "./dist-B_PSvr-m.mjs";
1
+ import { K as readNodePin } from "./dist-DssImRC5.mjs";
2
2
  import { ensureBinary, ensureFfmpeg, ensurePython, installPythonPackages, installPythonRequirements } from "@camstack/types/node";
3
3
  import { createServer } from "node:http";
4
4
  import * as fs from "node:fs";
@@ -6619,6 +6619,20 @@ var brokerReadinessRegistries = /* @__PURE__ */ new WeakMap();
6619
6619
  */
6620
6620
  var clientReadinessRegistries = /* @__PURE__ */ new Map();
6621
6621
  /**
6622
+ * Fixed-period authoritative snapshot re-pull (D8 reconcile). Readiness
6623
+ * deltas are telemetry — lossy across the UDS/Moleculer hops — and the
6624
+ * on-(re)connect hydrate alone cannot repair a delta lost while
6625
+ * CONNECTED (2026-07-17: the agent's platform-probe `ready` never
6626
+ * reached the detection runner child; the child held `starting` forever
6627
+ * and every waiter wedged). With `ReadinessRegistry.hydrate` able to
6628
+ * ADVANCE stale records, this periodic re-pull bounds the damage of any
6629
+ * lost delta to one reconcile round. Not a retry backoff — a
6630
+ * steady-state reconcile against the authority. `unref()`d so the timer
6631
+ * never keeps a process alive; registries are process-lifetime, so the
6632
+ * interval is never cleared.
6633
+ */
6634
+ var READINESS_RECONCILE_INTERVAL_MS = 6e4;
6635
+ /**
6622
6636
  * Return the shared ReadinessRegistry for this broker — one per
6623
6637
  * process is enough. Every addon context on the same broker gets the
6624
6638
  * same instance via `ctx.kernel.readinessRegistry`.
@@ -6669,6 +6683,10 @@ function getOrInitReadinessRegistry(broker, eventBus, logger) {
6669
6683
  }, 200);
6670
6684
  };
6671
6685
  bkr.localBus.on("$services.changed", scheduleRehydrate);
6686
+ const reconcileTimer = setInterval(() => {
6687
+ hydrateFromHub();
6688
+ }, READINESS_RECONCILE_INTERVAL_MS);
6689
+ if (typeof reconcileTimer.unref === "function") reconcileTimer.unref();
6672
6690
  }
6673
6691
  return registry;
6674
6692
  }
@@ -6687,14 +6705,18 @@ function getOrInitReadinessRegistry(broker, eventBus, logger) {
6687
6705
  * (Phase C) — the registry ingests them through its own event-bus
6688
6706
  * subscription, exactly as in broker mode.
6689
6707
  *
6690
- * **No `$services.changed` reconcile signal needed:**
6691
- * The broker-mode `$services.changed` reconcile existed because Moleculer
6692
- * broadcasts can be dropped during the boot window. Over UDS the parent
6693
- * reliably forwards every `system.ready-state` delta to each child (via
6694
- * the event bridge wired in Phase C). Dropped deltas are not a concern;
6695
- * the initial snapshot + live event bus is sufficient. A new
6696
- * parent-to-child "topology changed, re-pull" signal is therefore NOT
6697
- * added it would be redundant and would complicate the protocol.
6708
+ * **Periodic reconcile (D8):**
6709
+ * The original design assumed the parent reliably forwards every
6710
+ * `system.ready-state` delta over UDS, so no reconcile signal beyond
6711
+ * the (re)connect hydrate was added. The 2026-07-17 incident disproved
6712
+ * the assumption end-to-end: a delta can be lost across the full
6713
+ * producer→parent→child path (restart churn, subscription races), and
6714
+ * a child that saw `starting` then never got `ready` wedged forever.
6715
+ * The registry therefore ALSO re-pulls the parent snapshot every
6716
+ * `READINESS_RECONCILE_INTERVAL_MS` while connected — combined with
6717
+ * `hydrate`'s advance semantics, a lost delta costs one reconcile
6718
+ * round, never forever. No new parent-to-child protocol message is
6719
+ * needed (the existing snapshot request is reused).
6698
6720
  *
6699
6721
  * **`awaitReady`/`acquireCapability`/`onReadyState` semantics unchanged.**
6700
6722
  *
@@ -6725,6 +6747,10 @@ function getOrInitReadinessRegistryForClient(client, eventBus, logger, nodeId) {
6725
6747
  hydrateFromParent();
6726
6748
  });
6727
6749
  if (client.isConnected) hydrateFromParent();
6750
+ const reconcileTimer = setInterval(() => {
6751
+ if (client.isConnected) hydrateFromParent();
6752
+ }, READINESS_RECONCILE_INTERVAL_MS);
6753
+ if (typeof reconcileTimer.unref === "function") reconcileTimer.unref();
6728
6754
  return registry;
6729
6755
  }
6730
6756
  //#endregion
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-BduBhv6N.js");
2
+ const require_dist = require("./dist-B5C4dVvO.js");
3
3
  let _camstack_types_node = require("@camstack/types/node");
4
4
  let node_http = require("node:http");
5
5
  let node_fs = require("node:fs");
@@ -6621,6 +6621,20 @@ var brokerReadinessRegistries = /* @__PURE__ */ new WeakMap();
6621
6621
  */
6622
6622
  var clientReadinessRegistries = /* @__PURE__ */ new Map();
6623
6623
  /**
6624
+ * Fixed-period authoritative snapshot re-pull (D8 reconcile). Readiness
6625
+ * deltas are telemetry — lossy across the UDS/Moleculer hops — and the
6626
+ * on-(re)connect hydrate alone cannot repair a delta lost while
6627
+ * CONNECTED (2026-07-17: the agent's platform-probe `ready` never
6628
+ * reached the detection runner child; the child held `starting` forever
6629
+ * and every waiter wedged). With `ReadinessRegistry.hydrate` able to
6630
+ * ADVANCE stale records, this periodic re-pull bounds the damage of any
6631
+ * lost delta to one reconcile round. Not a retry backoff — a
6632
+ * steady-state reconcile against the authority. `unref()`d so the timer
6633
+ * never keeps a process alive; registries are process-lifetime, so the
6634
+ * interval is never cleared.
6635
+ */
6636
+ var READINESS_RECONCILE_INTERVAL_MS = 6e4;
6637
+ /**
6624
6638
  * Return the shared ReadinessRegistry for this broker — one per
6625
6639
  * process is enough. Every addon context on the same broker gets the
6626
6640
  * same instance via `ctx.kernel.readinessRegistry`.
@@ -6671,6 +6685,10 @@ function getOrInitReadinessRegistry(broker, eventBus, logger) {
6671
6685
  }, 200);
6672
6686
  };
6673
6687
  bkr.localBus.on("$services.changed", scheduleRehydrate);
6688
+ const reconcileTimer = setInterval(() => {
6689
+ hydrateFromHub();
6690
+ }, READINESS_RECONCILE_INTERVAL_MS);
6691
+ if (typeof reconcileTimer.unref === "function") reconcileTimer.unref();
6674
6692
  }
6675
6693
  return registry;
6676
6694
  }
@@ -6689,14 +6707,18 @@ function getOrInitReadinessRegistry(broker, eventBus, logger) {
6689
6707
  * (Phase C) — the registry ingests them through its own event-bus
6690
6708
  * subscription, exactly as in broker mode.
6691
6709
  *
6692
- * **No `$services.changed` reconcile signal needed:**
6693
- * The broker-mode `$services.changed` reconcile existed because Moleculer
6694
- * broadcasts can be dropped during the boot window. Over UDS the parent
6695
- * reliably forwards every `system.ready-state` delta to each child (via
6696
- * the event bridge wired in Phase C). Dropped deltas are not a concern;
6697
- * the initial snapshot + live event bus is sufficient. A new
6698
- * parent-to-child "topology changed, re-pull" signal is therefore NOT
6699
- * added it would be redundant and would complicate the protocol.
6710
+ * **Periodic reconcile (D8):**
6711
+ * The original design assumed the parent reliably forwards every
6712
+ * `system.ready-state` delta over UDS, so no reconcile signal beyond
6713
+ * the (re)connect hydrate was added. The 2026-07-17 incident disproved
6714
+ * the assumption end-to-end: a delta can be lost across the full
6715
+ * producer→parent→child path (restart churn, subscription races), and
6716
+ * a child that saw `starting` then never got `ready` wedged forever.
6717
+ * The registry therefore ALSO re-pulls the parent snapshot every
6718
+ * `READINESS_RECONCILE_INTERVAL_MS` while connected — combined with
6719
+ * `hydrate`'s advance semantics, a lost delta costs one reconcile
6720
+ * round, never forever. No new parent-to-child protocol message is
6721
+ * needed (the existing snapshot request is reused).
6700
6722
  *
6701
6723
  * **`awaitReady`/`acquireCapability`/`onReadyState` semantics unchanged.**
6702
6724
  *
@@ -6727,6 +6749,10 @@ function getOrInitReadinessRegistryForClient(client, eventBus, logger, nodeId) {
6727
6749
  hydrateFromParent();
6728
6750
  });
6729
6751
  if (client.isConnected) hydrateFromParent();
6752
+ const reconcileTimer = setInterval(() => {
6753
+ if (client.isConnected) hydrateFromParent();
6754
+ }, READINESS_RECONCILE_INTERVAL_MS);
6755
+ if (typeof reconcileTimer.unref === "function") reconcileTimer.unref();
6730
6756
  return registry;
6731
6757
  }
6732
6758
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.1.52",
3
+ "version": "1.1.54",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",
@@ -156,7 +156,7 @@
156
156
  "id": "virtual-doorbell",
157
157
  "category": "system",
158
158
  "name": "Virtual Doorbell",
159
- "description": "Wrapper over the `doorbell` cap — turns any binary-ish device (contact sensor, switch, event emitter, flood/gas/CO sensor) into a per-camera doorbell. Operator binds it per camera and picks the source device + trigger in the camera's settings.",
159
+ "description": "Wrapper over the `doorbell` cap — turns any binary sensor or switch (contact, motion, flood/gas/CO/smoke, vibration, tamper, or a switch) into a per-camera doorbell. Operator binds it per camera and picks the trigger devices from a searchable list in the camera's general settings; the reaction is automatic (sensor active / switch on).",
160
160
  "entry": "./dist/builtins/doorbell/index.js",
161
161
  "capabilities": [
162
162
  {