@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.
- package/dist/addon-runner.js +2 -2
- package/dist/addon-runner.mjs +2 -2
- package/dist/addon-utils.d.ts +1 -0
- package/dist/addon-utils.js +2 -0
- package/dist/addon-utils.mjs +2 -2
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/device-manager/device-linked-devices.d.ts +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1608 -1589
- package/dist/builtins/device-manager/device-manager.addon.mjs +1608 -1589
- package/dist/builtins/device-manager/device-store-sections.d.ts +26 -0
- package/dist/builtins/doorbell/doorbell-settings.d.ts +58 -0
- package/dist/builtins/doorbell/trigger-engine.d.ts +32 -30
- package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +39 -22
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +207 -191
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +207 -191
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +11 -3
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +11 -3
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-BduBhv6N.js → dist-B5C4dVvO.js} +293 -23
- package/dist/{dist-B_PSvr-m.mjs → dist-DssImRC5.mjs} +293 -23
- package/dist/index.js +22 -5
- package/dist/index.mjs +22 -6
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/moleculer/readiness-context.d.ts +12 -8
- package/dist/kernel/moleculer/readiness-service.d.ts +16 -1
- package/dist/{manifest-python-deps-CIyvuHAB.mjs → manifest-python-deps-CWom-eqp.mjs} +35 -9
- package/dist/{manifest-python-deps-CPAMH5gV.js → manifest-python-deps-kkvku9yU.js} +35 -9
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as readNodePin } from "./dist-
|
|
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
|
-
* **
|
|
6691
|
-
* The
|
|
6692
|
-
*
|
|
6693
|
-
*
|
|
6694
|
-
* the
|
|
6695
|
-
*
|
|
6696
|
-
*
|
|
6697
|
-
*
|
|
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-
|
|
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
|
-
* **
|
|
6693
|
-
* The
|
|
6694
|
-
*
|
|
6695
|
-
*
|
|
6696
|
-
* the
|
|
6697
|
-
*
|
|
6698
|
-
*
|
|
6699
|
-
*
|
|
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.
|
|
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
|
|
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
|
{
|