@camstack/system 1.2.149 → 1.2.151
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 +1 -1
- package/dist/addon-runner.mjs +1 -1
- 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/core-blocks/core-blocks.addon.js +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.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/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.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 +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- 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-DdEXjTDo.js → dist-CImxMt5h.js} +183 -0
- package/dist/{dist-CZWAU40-.mjs → dist-CbRciAbu.mjs} +183 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -2
- package/dist/index.mjs +3 -3
- package/dist/kernel/heap-watch.d.ts +71 -0
- package/dist/{manifest-python-deps-CivtrAha.js → manifest-python-deps-BqWrDjSN.js} +72 -2
- package/dist/{manifest-python-deps-HFh_iE0E.mjs → manifest-python-deps-DuQ3Uqoq.mjs} +61 -3
- package/dist/{retired-settings-keys-BXaTgLyZ.js → retired-settings-keys-C7gLUS3x.js} +1 -1
- package/dist/{retired-settings-keys-BynPjBHV.mjs → retired-settings-keys-DhFPXIRD.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
require("./dist-
|
|
2
|
+
require("./dist-CImxMt5h.js");
|
|
3
3
|
let node_crypto = require("node:crypto");
|
|
4
4
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
5
5
|
let _camstack_types_node = require("@camstack/types/node");
|
|
@@ -45,6 +45,13 @@ let _trpc_client = require("@trpc/client");
|
|
|
45
45
|
* `addon-runner.ts`) — hub-main, the one process that actually OOMs, was the
|
|
46
46
|
* one process with no telemetry at all.
|
|
47
47
|
*
|
|
48
|
+
* **And for 27 days after that it still had none where anyone could read it.**
|
|
49
|
+
* The watch was started correctly and passed NO SINK, so it fell back to
|
|
50
|
+
* `console.log`, which is not an `ILogDestination` — 42 hours of Loki carried a
|
|
51
|
+
* line for every runner and none for hub-main. Read
|
|
52
|
+
* {@link createDeferredHeapWatchSink} before trusting anything below: a
|
|
53
|
+
* heartbeat with no destination is indistinguishable from no heartbeat (D285).
|
|
54
|
+
*
|
|
48
55
|
* ## What it gives
|
|
49
56
|
*
|
|
50
57
|
* A heartbeat carrying the numbers that separate the two possible stories, and
|
|
@@ -96,6 +103,30 @@ let _trpc_client = require("@trpc/client");
|
|
|
96
103
|
* `HEAP_RECLAIM_MIN_INTERVAL_MS`. The alternative, measured, is a ratchet to
|
|
97
104
|
* 7.8GB and the OOM that ends it.
|
|
98
105
|
*/
|
|
106
|
+
/**
|
|
107
|
+
* What hub-main calls itself in a `[mem]` line.
|
|
108
|
+
*
|
|
109
|
+
* ## Why not `hub/main`
|
|
110
|
+
*
|
|
111
|
+
* A runner's label is its nodeId, and a nodeId is built in exactly one place as
|
|
112
|
+
* `` `${parentNodeId}/${runnerId}` `` (`kernel/moleculer/addon-runner.ts:222`) —
|
|
113
|
+
* so every runner label contains a `/` and every hub-local one is `hub/<runner>`.
|
|
114
|
+
* A label with NO slash therefore cannot be produced by that rule, which makes
|
|
115
|
+
* `hub-main` unambiguous by construction rather than by convention: no future
|
|
116
|
+
* addon, group or agent can ever claim it.
|
|
117
|
+
*
|
|
118
|
+
* It also sorts where it belongs. `-` (0x2D) precedes `/` (0x2F), so a sorted
|
|
119
|
+
* `[mem]` census puts `hub-main` immediately before `hub/decoder`,
|
|
120
|
+
* `hub/recorder`, `hub/stream-broker` — the composition root first, then the
|
|
121
|
+
* runners it forked. `hub/main` would sort into the middle of its own children
|
|
122
|
+
* and would be one addon id away from a collision.
|
|
123
|
+
*
|
|
124
|
+
* And it is the name the rest of this repository already uses — the docblocks,
|
|
125
|
+
* {@link HUB_MAIN_RSS_BUDGET_MB}, {@link HUB_RSS_BUDGET_ENV}, every ADR. A log
|
|
126
|
+
* label that disagreed with the prose would be a second vocabulary for one
|
|
127
|
+
* process, which is the exact failure this telemetry exists to remove.
|
|
128
|
+
*/
|
|
129
|
+
var HUB_MAIN_HEAP_WATCH_LABEL = "hub-main";
|
|
99
130
|
/** Heartbeat period. Slow enough to be free, fast enough that the sample before
|
|
100
131
|
* a fatal is recent. */
|
|
101
132
|
var HEAP_WATCH_INTERVAL_MS = 6e4;
|
|
@@ -261,6 +292,33 @@ var consoleSink = {
|
|
|
261
292
|
warn: (line) => console.warn(line)
|
|
262
293
|
};
|
|
263
294
|
/**
|
|
295
|
+
* Build a {@link DeferredHeapWatchSink}.
|
|
296
|
+
*
|
|
297
|
+
* The handover announces itself, once, through the NEW target: that line is the
|
|
298
|
+
* only in-band evidence that hub-main's telemetry actually reached the log
|
|
299
|
+
* manager on a given boot. Its absence from Loki means the wiring is broken —
|
|
300
|
+
* which is precisely the state this module was in, undetected, for 42 hours.
|
|
301
|
+
*/
|
|
302
|
+
function createDeferredHeapWatchSink(label = HUB_MAIN_HEAP_WATCH_LABEL, fallback = consoleSink) {
|
|
303
|
+
let target = fallback;
|
|
304
|
+
const sink = {
|
|
305
|
+
info: (line) => {
|
|
306
|
+
target.info(line);
|
|
307
|
+
},
|
|
308
|
+
warn: (line) => {
|
|
309
|
+
target.warn(line);
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
const attach = (next) => {
|
|
313
|
+
target = next;
|
|
314
|
+
next.info(`[mem] ${label} heartbeat attached to the log manager — earlier lines went to stdout only and are not in the log buffer, the rotated file or Loki.`);
|
|
315
|
+
};
|
|
316
|
+
return {
|
|
317
|
+
sink,
|
|
318
|
+
attach
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
264
322
|
* RSS the process is holding but not using.
|
|
265
323
|
*
|
|
266
324
|
* The subtrahend is heapUSED, not heapTotal, deliberately: the pages V8
|
|
@@ -400,7 +458,7 @@ function format(label, s, loop, budgetMb) {
|
|
|
400
458
|
* `unref`ed so it can never hold the process open, and every read is wrapped:
|
|
401
459
|
* a diagnostic that can crash the process it watches is worse than none.
|
|
402
460
|
*/
|
|
403
|
-
function startHeapWatch(label =
|
|
461
|
+
function startHeapWatch(label = HUB_MAIN_HEAP_WATCH_LABEL, sink = consoleSink, intervalMs = HEAP_WATCH_INTERVAL_MS, reclaimOptions, loopDelay = createLoopDelayMeter(), execArgv = process.execArgv, announceCeilingOrigin = true, rssBudget) {
|
|
404
462
|
const readMemory = reclaimOptions?.readMemory ?? (() => process.memoryUsage());
|
|
405
463
|
const now = reclaimOptions?.now ?? (() => Date.now());
|
|
406
464
|
const triggerMb = reclaimOptions?.triggerMb ?? 1024;
|
|
@@ -8688,6 +8746,12 @@ Object.defineProperty(exports, "HUB_CAP_FWD_SERVICE", {
|
|
|
8688
8746
|
return HUB_CAP_FWD_SERVICE;
|
|
8689
8747
|
}
|
|
8690
8748
|
});
|
|
8749
|
+
Object.defineProperty(exports, "HUB_MAIN_HEAP_WATCH_LABEL", {
|
|
8750
|
+
enumerable: true,
|
|
8751
|
+
get: function() {
|
|
8752
|
+
return HUB_MAIN_HEAP_WATCH_LABEL;
|
|
8753
|
+
}
|
|
8754
|
+
});
|
|
8691
8755
|
Object.defineProperty(exports, "HUB_MAIN_RSS_BUDGET_MB", {
|
|
8692
8756
|
enumerable: true,
|
|
8693
8757
|
get: function() {
|
|
@@ -8886,6 +8950,12 @@ Object.defineProperty(exports, "createBrokerDeviceManagerApi", {
|
|
|
8886
8950
|
return createBrokerDeviceManagerApi;
|
|
8887
8951
|
}
|
|
8888
8952
|
});
|
|
8953
|
+
Object.defineProperty(exports, "createDeferredHeapWatchSink", {
|
|
8954
|
+
enumerable: true,
|
|
8955
|
+
get: function() {
|
|
8956
|
+
return createDeferredHeapWatchSink;
|
|
8957
|
+
}
|
|
8958
|
+
});
|
|
8889
8959
|
Object.defineProperty(exports, "createHubCapForwardService", {
|
|
8890
8960
|
enumerable: true,
|
|
8891
8961
|
get: function() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./dist-
|
|
1
|
+
import "./dist-CbRciAbu.mjs";
|
|
2
2
|
import * as crypto$1 from "node:crypto";
|
|
3
3
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
4
4
|
import { ensureBinary, ensureFfmpeg, ensurePython, installPythonPackages, installPythonRequirements } from "@camstack/types/node";
|
|
@@ -41,6 +41,13 @@ import { TRPCClientError, createTRPCClient } from "@trpc/client";
|
|
|
41
41
|
* `addon-runner.ts`) — hub-main, the one process that actually OOMs, was the
|
|
42
42
|
* one process with no telemetry at all.
|
|
43
43
|
*
|
|
44
|
+
* **And for 27 days after that it still had none where anyone could read it.**
|
|
45
|
+
* The watch was started correctly and passed NO SINK, so it fell back to
|
|
46
|
+
* `console.log`, which is not an `ILogDestination` — 42 hours of Loki carried a
|
|
47
|
+
* line for every runner and none for hub-main. Read
|
|
48
|
+
* {@link createDeferredHeapWatchSink} before trusting anything below: a
|
|
49
|
+
* heartbeat with no destination is indistinguishable from no heartbeat (D285).
|
|
50
|
+
*
|
|
44
51
|
* ## What it gives
|
|
45
52
|
*
|
|
46
53
|
* A heartbeat carrying the numbers that separate the two possible stories, and
|
|
@@ -92,6 +99,30 @@ import { TRPCClientError, createTRPCClient } from "@trpc/client";
|
|
|
92
99
|
* `HEAP_RECLAIM_MIN_INTERVAL_MS`. The alternative, measured, is a ratchet to
|
|
93
100
|
* 7.8GB and the OOM that ends it.
|
|
94
101
|
*/
|
|
102
|
+
/**
|
|
103
|
+
* What hub-main calls itself in a `[mem]` line.
|
|
104
|
+
*
|
|
105
|
+
* ## Why not `hub/main`
|
|
106
|
+
*
|
|
107
|
+
* A runner's label is its nodeId, and a nodeId is built in exactly one place as
|
|
108
|
+
* `` `${parentNodeId}/${runnerId}` `` (`kernel/moleculer/addon-runner.ts:222`) —
|
|
109
|
+
* so every runner label contains a `/` and every hub-local one is `hub/<runner>`.
|
|
110
|
+
* A label with NO slash therefore cannot be produced by that rule, which makes
|
|
111
|
+
* `hub-main` unambiguous by construction rather than by convention: no future
|
|
112
|
+
* addon, group or agent can ever claim it.
|
|
113
|
+
*
|
|
114
|
+
* It also sorts where it belongs. `-` (0x2D) precedes `/` (0x2F), so a sorted
|
|
115
|
+
* `[mem]` census puts `hub-main` immediately before `hub/decoder`,
|
|
116
|
+
* `hub/recorder`, `hub/stream-broker` — the composition root first, then the
|
|
117
|
+
* runners it forked. `hub/main` would sort into the middle of its own children
|
|
118
|
+
* and would be one addon id away from a collision.
|
|
119
|
+
*
|
|
120
|
+
* And it is the name the rest of this repository already uses — the docblocks,
|
|
121
|
+
* {@link HUB_MAIN_RSS_BUDGET_MB}, {@link HUB_RSS_BUDGET_ENV}, every ADR. A log
|
|
122
|
+
* label that disagreed with the prose would be a second vocabulary for one
|
|
123
|
+
* process, which is the exact failure this telemetry exists to remove.
|
|
124
|
+
*/
|
|
125
|
+
var HUB_MAIN_HEAP_WATCH_LABEL = "hub-main";
|
|
95
126
|
/** Heartbeat period. Slow enough to be free, fast enough that the sample before
|
|
96
127
|
* a fatal is recent. */
|
|
97
128
|
var HEAP_WATCH_INTERVAL_MS = 6e4;
|
|
@@ -257,6 +288,33 @@ var consoleSink = {
|
|
|
257
288
|
warn: (line) => console.warn(line)
|
|
258
289
|
};
|
|
259
290
|
/**
|
|
291
|
+
* Build a {@link DeferredHeapWatchSink}.
|
|
292
|
+
*
|
|
293
|
+
* The handover announces itself, once, through the NEW target: that line is the
|
|
294
|
+
* only in-band evidence that hub-main's telemetry actually reached the log
|
|
295
|
+
* manager on a given boot. Its absence from Loki means the wiring is broken —
|
|
296
|
+
* which is precisely the state this module was in, undetected, for 42 hours.
|
|
297
|
+
*/
|
|
298
|
+
function createDeferredHeapWatchSink(label = HUB_MAIN_HEAP_WATCH_LABEL, fallback = consoleSink) {
|
|
299
|
+
let target = fallback;
|
|
300
|
+
const sink = {
|
|
301
|
+
info: (line) => {
|
|
302
|
+
target.info(line);
|
|
303
|
+
},
|
|
304
|
+
warn: (line) => {
|
|
305
|
+
target.warn(line);
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
const attach = (next) => {
|
|
309
|
+
target = next;
|
|
310
|
+
next.info(`[mem] ${label} heartbeat attached to the log manager — earlier lines went to stdout only and are not in the log buffer, the rotated file or Loki.`);
|
|
311
|
+
};
|
|
312
|
+
return {
|
|
313
|
+
sink,
|
|
314
|
+
attach
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
260
318
|
* RSS the process is holding but not using.
|
|
261
319
|
*
|
|
262
320
|
* The subtrahend is heapUSED, not heapTotal, deliberately: the pages V8
|
|
@@ -396,7 +454,7 @@ function format(label, s, loop, budgetMb) {
|
|
|
396
454
|
* `unref`ed so it can never hold the process open, and every read is wrapped:
|
|
397
455
|
* a diagnostic that can crash the process it watches is worse than none.
|
|
398
456
|
*/
|
|
399
|
-
function startHeapWatch(label =
|
|
457
|
+
function startHeapWatch(label = HUB_MAIN_HEAP_WATCH_LABEL, sink = consoleSink, intervalMs = HEAP_WATCH_INTERVAL_MS, reclaimOptions, loopDelay = createLoopDelayMeter(), execArgv = process.execArgv, announceCeilingOrigin = true, rssBudget) {
|
|
400
458
|
const readMemory = reclaimOptions?.readMemory ?? (() => process.memoryUsage());
|
|
401
459
|
const now = reclaimOptions?.now ?? (() => Date.now());
|
|
402
460
|
const triggerMb = reclaimOptions?.triggerMb ?? 1024;
|
|
@@ -8582,4 +8640,4 @@ async function installManifestPythonDeps(declaration, addonDir, deps, logger) {
|
|
|
8582
8640
|
await deps.installPythonRequirements(reqAbs);
|
|
8583
8641
|
}
|
|
8584
8642
|
//#endregion
|
|
8585
|
-
export { buildUdsNativeCapProxy as $, createParentUnownedCallHandler as A,
|
|
8643
|
+
export { buildUdsNativeCapProxy as $, createParentUnownedCallHandler as A, HUB_RSS_BUDGET_ENV as At, AGENT_CAP_FWD_SERVICE as B, nextRssBudgetState as Bt, brokerTransportLink as C, createAddonDataPlaneFacility as Ct, HUB_CAP_FWD_ACTION as D, HEAP_WATCH_WARN_RATIO as Dt, localProviderLink as E, HEAP_WATCH_INTERVAL_MS as Et, createUdsLoggerWithControl as F, buildHeapSample as Ft, createLocalTransport as G, strandedMb as Gt, CapRouteError as H, shouldReclaim as Ht, LocalChildClient as I, createDeferredHeapWatchSink as It, SocketChannel as J, UdsLocalTransportClient as K, LocalChildRegistry as L, createV8Reclaimer as Lt, createUdsEventBus as M, RSS_BUDGET_RELEASE_RATIO as Mt, udsChildLogToWorkerEntry as N, RUNNER_HEAP_WATCH_INTERVAL_MS as Nt, HUB_CAP_FWD_SERVICE as O, HUB_MAIN_HEAP_WATCH_LABEL as Ot, createUdsLogger as P, RUNNER_RSS_BUDGET_ENV as Pt, buildNativeCapProxy as Q, UDS_NO_ROUTE_PREFIX as R, describeRss as Rt, brokerCallForCap as S, runNpm as St, ipcParentLink as T, HEAP_RECLAIM_TRIGGER_MB as Tt, classifyCapRoute as U, startHeapWatch as Ut, CapRouteResolver as V, parseRssBudgetMb as Vt, callWithServiceDiscovery as W, startRunnerHeapWatch as Wt, FrameDecoder as X, localEndpointPath as Y, encodeFrame as Z, createKernelHwAccel as _, CapabilityUnavailableError as _t, getWorkerDeviceRegistry as a, createAddonService as at, __resetCapUsageRegistryForTests as b, resolveAddonClass as bt, setHubConnected as c, capActionName as ct, getBrokerEventBus as d, capServiceName as dt, createBrokerDeviceManagerApi as et, getMoleculerEventStats as f, parseCapAction as ft, AddonDepsManager as g, CapabilityHandle as gt, subscribePassthrough as h, DeviceRegistry as ht, createUdsAddonContext as i, setWorkerNativeCapsChangeListener as it, createUdsEventBridge as j, RSS_BUDGET_REANNOUNCE_MIN_MS as jt, createHubCapForwardService as k, HUB_MAIN_RSS_BUDGET_MB as kt, EVENT_TOPIC_PREFIX as l, capActionSuffix as lt, setNodeEventInterest as m, serializeTypedArrays as mt, adaptBrokerToCluster as n, getWorkerNativeCapSnapshot as nt, getOrInitReadinessRegistry as o, validateProviderRegistrations as ot, registerEventBusService as p, deserializeTypedArrays as pt, UdsLocalTransportServer as q, createAddonContext as r, mountNativeCapService as rt, getOrInitReadinessRegistryForClient as s, NATIVE_PROVIDER_SERVICE_INFIX as st, installManifestPythonDeps as t, getWorkerNativeCapProvider as tt, clusterEventTopic as u, capBareAction as ut, resolveHwAccel as v, copyBundledNativeModules as vt, buildLinkChain as w, HEAP_RECLAIM_MIN_INTERVAL_MS as wt, getCapUsageRegistry as x, resolveNpmInvocation as xt, CapUsageRegistry as y, installManifestNativeDeps as yt, AGENT_CAP_FWD_ACTION as z, hubMainRssBudget as zt };
|