@camstack/system 1.2.353 → 1.2.355
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/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.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/calendars/calendar-prefs-store.d.ts +7 -0
- package/dist/builtins/calendars/calendars.addon.js +3 -2
- package/dist/builtins/calendars/calendars.addon.mjs +3 -2
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +56 -5
- package/dist/builtins/composer/composer.addon.mjs +56 -5
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/block-settings-store.d.ts +5 -0
- package/dist/builtins/core-blocks/core-blocks.addon.js +7 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +7 -2
- package/dist/builtins/device-manager/device-manager.addon.js +3 -3
- package/dist/builtins/device-manager/device-manager.addon.mjs +3 -3
- 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.d.ts +21 -6
- package/dist/builtins/local-network/local-network.addon.js +81 -54
- package/dist/builtins/local-network/local-network.addon.mjs +81 -55
- 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/analyze-stats.d.ts +0 -2
- 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-backend.d.ts +9 -11
- 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 +2 -2
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +2 -2
- 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/{child-cap-dispatch-CvYlCq60.js → child-cap-dispatch-CqV-7-QZ.js} +27 -86
- package/dist/{child-cap-dispatch-C6IpRb4P.mjs → child-cap-dispatch-DMx2axev.mjs} +28 -81
- package/dist/{composition-sources-CAFDvTRs.js → composition-sources-Bk-MjK1D.js} +1 -1
- package/dist/{composition-sources-BGlDi3CT.mjs → composition-sources-Dpl1G0Gr.mjs} +1 -1
- package/dist/{dist-CXVXFdJX.js → dist-BWicEEVA.js} +233 -79
- package/dist/{dist-Cm556q2j.mjs → dist-OCi0K-iM.mjs} +216 -80
- package/dist/http/reverse-proxy.d.ts +11 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +71 -56
- package/dist/index.mjs +72 -56
- package/dist/kernel/config-schema.d.ts +1 -0
- package/dist/kernel/event-plane-report.d.ts +7 -36
- package/dist/kernel/fs-utils.d.ts +1 -5
- package/dist/kernel/heap-spaces.d.ts +2 -23
- package/dist/kernel/index.d.ts +0 -2
- package/dist/kernel/moleculer/event-bus-core.d.ts +6 -28
- package/dist/kernel/moleculer/process-service.d.ts +2 -5
- package/dist/kernel/moleculer/runner-native-allocator.d.ts +1 -6
- package/dist/kernel/transport/index.d.ts +1 -1
- package/dist/kernel/transport/local-child-registry.d.ts +8 -41
- package/dist/kernel/transport/uds-event-bridge.d.ts +2 -2
- package/dist/{retired-settings-keys-D24IW4qo.js → retired-settings-keys-DLJ7MvIB.js} +1 -1
- package/dist/{retired-settings-keys-DzkSqnH0.mjs → retired-settings-keys-TDzxE6GA.mjs} +1 -1
- package/package.json +1 -1
- package/dist/kernel/heap-allocation-sample.d.ts +0 -107
|
@@ -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-BWicEEVA.js");
|
|
3
3
|
const require_proc_stat = require("./proc-stat-DL-WUOhl.js");
|
|
4
4
|
require("./hub-cap-forward-DmHNjbB0.js");
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
@@ -56,8 +56,6 @@ function createEventPlaneReader(sources) {
|
|
|
56
56
|
}
|
|
57
57
|
const crossNode = sources.crossNodeStats();
|
|
58
58
|
return {
|
|
59
|
-
udsMode: registry.eventFanoutMode,
|
|
60
|
-
crossNodeMode: sources.crossNodeMode(),
|
|
61
59
|
children,
|
|
62
60
|
childrenConnected: listed.length,
|
|
63
61
|
childrenUndeclared: registry.undeclaredChildCount(),
|
|
@@ -132,8 +130,6 @@ function diffEventPlane(baseline, current, topN = 5) {
|
|
|
132
130
|
}
|
|
133
131
|
const byBroadcasts = categoryDeltas.toSorted((a, b) => b.broadcasts - a.broadcasts || a.category.localeCompare(b.category));
|
|
134
132
|
return {
|
|
135
|
-
udsMode: current.udsMode,
|
|
136
|
-
crossNodeMode: current.crossNodeMode,
|
|
137
133
|
childrenConnected: current.childrenConnected,
|
|
138
134
|
childrenUndeclared: current.childrenUndeclared,
|
|
139
135
|
fanoutSent,
|
|
@@ -185,7 +181,7 @@ function formatEventPlane(window) {
|
|
|
185
181
|
const top = window.top.map((d) => `${d.childId}:${d.sent}/${d.suppressed}`).join(",");
|
|
186
182
|
const cats = window.topCategories.map((c) => `${c.category}:${c.broadcasts}/${c.wanted}`).join(",");
|
|
187
183
|
const orphans = window.topOrphans.map((c) => `${c.category}:${c.broadcasts}`).join(",");
|
|
188
|
-
return `
|
|
184
|
+
return ` children=${window.childrenConnected} childrenUndeclared=${window.childrenUndeclared} fanoutSent=${window.fanoutSent} fanoutSuppressed=${window.fanoutSuppressed} crossNodeDelivered=${window.crossNodeDelivered} crossNodeSuppressed=${window.crossNodeSuppressed} fanoutEvents=${window.categoryBroadcasts} fanoutOrphans=${window.orphanBroadcasts} fanoutCatsDropped=${window.categoryOverflow}` + (top.length === 0 ? "" : ` fanoutTop=${top}`) + (cats.length === 0 ? "" : ` fanoutCats=${cats}`) + (orphans.length === 0 ? "" : ` fanoutOrphanTop=${orphans}`);
|
|
189
185
|
}
|
|
190
186
|
//#endregion
|
|
191
187
|
//#region src/kernel/transport/cap-action-census.ts
|
|
@@ -1084,21 +1080,16 @@ function formatHeapSpaces(spaces, minMb = 32) {
|
|
|
1084
1080
|
}
|
|
1085
1081
|
var defaultDeps = {
|
|
1086
1082
|
readMemory: () => process.memoryUsage(),
|
|
1087
|
-
readSpaces: readHeapSpaces
|
|
1088
|
-
env: process.env
|
|
1083
|
+
readSpaces: readHeapSpaces
|
|
1089
1084
|
};
|
|
1090
1085
|
/**
|
|
1091
|
-
* The SIGUSR2 report — memory + the FULL per-space breakdown
|
|
1092
|
-
* snapshot
|
|
1086
|
+
* The SIGUSR2 report — memory + the FULL per-space breakdown; never a heap
|
|
1087
|
+
* snapshot (D718) — see the note in the body.
|
|
1093
1088
|
*
|
|
1094
1089
|
* The breakdown here keeps every non-empty space at 0.1 MB, unlike the
|
|
1095
1090
|
* heartbeat's filtered whole-MB pair: this is a hand-fired diagnostic read once
|
|
1096
1091
|
* by a human who asked for it, so completeness costs nothing. The heartbeat runs
|
|
1097
1092
|
* unattended on every runner forever, so it pays for every field it prints.
|
|
1098
|
-
*
|
|
1099
|
-
* A refused snapshot SAYS SO. A branch that drops work silently reads as "it was
|
|
1100
|
-
* never requested", and this one is fired by an operator who is standing there
|
|
1101
|
-
* waiting for a file.
|
|
1102
1093
|
*/
|
|
1103
1094
|
function emitHeapDiagnosticReport(request, deps = defaultDeps) {
|
|
1104
1095
|
try {
|
|
@@ -7942,25 +7933,16 @@ function isHighFrequencyCategory(category) {
|
|
|
7942
7933
|
for (const pattern of RING_BUFFER_DENY_PATTERNS) if (matchesPattern(pattern, category)) return true;
|
|
7943
7934
|
return false;
|
|
7944
7935
|
}
|
|
7945
|
-
function readMoleculerFanoutMode() {
|
|
7946
|
-
const raw = process.env.CAMSTACK_MOLECULER_EVENT_FANOUT;
|
|
7947
|
-
if (raw === "shadow" || raw === "broadcast") return raw;
|
|
7948
|
-
return "filter";
|
|
7949
|
-
}
|
|
7950
7936
|
/**
|
|
7951
7937
|
* Does this node want to accept an inbound cross-node event in `category`?
|
|
7952
7938
|
* The receiving-side mirror of `LocalChildRegistry.childWantsEvent`:
|
|
7953
|
-
* - `broadcast` mode → always (gate disabled).
|
|
7954
7939
|
* - a retaining bus (hub main) → always (it serves `getRecent` + admin-ui;
|
|
7955
7940
|
* its interest is genuinely everything).
|
|
7956
7941
|
* - undeclared interest (`null`) → always (fail-open).
|
|
7957
7942
|
* - else the declared union must match via `matchesPattern` — the SAME
|
|
7958
7943
|
* function the local subscriber map-key gate uses, giving delivery parity.
|
|
7959
|
-
* `shadow` is handled by the caller (it counts the would-suppress but still
|
|
7960
|
-
* delivers), exactly like the UDS fan-out.
|
|
7961
7944
|
*/
|
|
7962
|
-
function crossNodeAcceptsCategory(
|
|
7963
|
-
if (mode === "broadcast") return true;
|
|
7945
|
+
function crossNodeAcceptsCategory(snapshot, category) {
|
|
7964
7946
|
if (snapshot.retainRecent) return true;
|
|
7965
7947
|
if (snapshot.interest === null) return true;
|
|
7966
7948
|
return snapshot.interest.some((p) => matchesPattern(p, category));
|
|
@@ -8533,11 +8515,6 @@ var LIFECYCLE_SOURCE = {
|
|
|
8533
8515
|
type: "core",
|
|
8534
8516
|
id: "local-child-registry"
|
|
8535
8517
|
};
|
|
8536
|
-
function readFanoutMode() {
|
|
8537
|
-
const raw = process.env.CAMSTACK_UDS_EVENT_FANOUT;
|
|
8538
|
-
if (raw === "shadow" || raw === "broadcast") return raw;
|
|
8539
|
-
return "filter";
|
|
8540
|
-
}
|
|
8541
8518
|
/**
|
|
8542
8519
|
* Sentinel prefix used in the no-route error thrown when `cap-call-out` has no
|
|
8543
8520
|
* local sibling and no `onUnownedCall` fallback. `ipcParentLink` detects this
|
|
@@ -8600,8 +8577,6 @@ var LocalChildRegistry = class {
|
|
|
8600
8577
|
capUsageObserver;
|
|
8601
8578
|
/** Tracks capNames already logged as UDS-routed; one INFO line per capName per process. */
|
|
8602
8579
|
egressRoutedCaps = /* @__PURE__ */ new Set();
|
|
8603
|
-
/** Active event fan-out mode, read once from `CAMSTACK_UDS_EVENT_FANOUT`. */
|
|
8604
|
-
fanoutMode = readFanoutMode();
|
|
8605
8580
|
/** Per-child event fan-out counters (sent / suppressed). */
|
|
8606
8581
|
childEventStats = /* @__PURE__ */ new Map();
|
|
8607
8582
|
/** D467: per-category production census (cumulative). See {@link CategoryFanoutSample}. */
|
|
@@ -8650,14 +8625,13 @@ var LocalChildRegistry = class {
|
|
|
8650
8625
|
}
|
|
8651
8626
|
}
|
|
8652
8627
|
async start() {
|
|
8653
|
-
this.logger?.info("UDS event fan-out mode", { mode: this.fanoutMode });
|
|
8654
8628
|
this.server.onConnection((channel) => this.onConnection(channel));
|
|
8655
8629
|
await this.server.listen();
|
|
8656
8630
|
}
|
|
8657
8631
|
/**
|
|
8658
8632
|
* Per-child event fan-out counters (`{ sent, suppressed }`) or `null` if the
|
|
8659
8633
|
* child has no recorded events yet. Exposed for the starvation-verification
|
|
8660
|
-
* surface (
|
|
8634
|
+
* surface (operator debug).
|
|
8661
8635
|
*/
|
|
8662
8636
|
getChildEventStats(childId) {
|
|
8663
8637
|
const s = this.childEventStats.get(childId);
|
|
@@ -8735,18 +8709,6 @@ var LocalChildRegistry = class {
|
|
|
8735
8709
|
return this.actionCensus.read();
|
|
8736
8710
|
}
|
|
8737
8711
|
/**
|
|
8738
|
-
* The regime the counters above were produced under, read once from
|
|
8739
|
-
* `CAMSTACK_UDS_EVENT_FANOUT` at construction.
|
|
8740
|
-
*
|
|
8741
|
-
* A suppressed count means "nothing WAS dropped" under `filter` and "nothing
|
|
8742
|
-
* WOULD have been dropped" under `shadow`. Those are different claims, and
|
|
8743
|
-
* until this getter existed the mode was invisible at runtime — the counters
|
|
8744
|
-
* were readable and the regime that produced them was not.
|
|
8745
|
-
*/
|
|
8746
|
-
get eventFanoutMode() {
|
|
8747
|
-
return this.fanoutMode;
|
|
8748
|
-
}
|
|
8749
|
-
/**
|
|
8750
8712
|
* Connected children that never declared a subscription pattern set.
|
|
8751
8713
|
*
|
|
8752
8714
|
* Each one is a fail-open on BOTH planes: `childWantsEvent` returns true for
|
|
@@ -8763,30 +8725,18 @@ var LocalChildRegistry = class {
|
|
|
8763
8725
|
return count;
|
|
8764
8726
|
}
|
|
8765
8727
|
/**
|
|
8766
|
-
* Does `entry` want to receive an event in `category`?
|
|
8767
|
-
*
|
|
8768
|
-
*
|
|
8769
|
-
*
|
|
8770
|
-
*
|
|
8771
|
-
*
|
|
8728
|
+
* Does `entry` want to receive an event in `category`? Undeclared patterns
|
|
8729
|
+
* (`null`) → always (fail-open, counted by {@link undeclaredChildCount});
|
|
8730
|
+
* else the child's declared set must match via `matchesPattern` — the SAME
|
|
8731
|
+
* function the child's own `deliverShared` map-key gate uses, giving provable
|
|
8732
|
+
* delivery parity. The parent always filters: the `CAMSTACK_UDS_EVENT_FANOUT`
|
|
8733
|
+
* shadow/broadcast modes were removed on 2026-10-06.
|
|
8772
8734
|
*
|
|
8773
8735
|
* NOTE: this gate must NOT consult `RING_BUFFER_DENY_PATTERNS` /
|
|
8774
8736
|
* `isHighFrequencyCategory` — those are ring-buffer STORAGE policy; a child
|
|
8775
8737
|
* that explicitly subscribes to a ring-denied category must still RECEIVE it.
|
|
8776
8738
|
*/
|
|
8777
8739
|
childWantsEvent(entry, category) {
|
|
8778
|
-
if (this.fanoutMode === "broadcast") return true;
|
|
8779
|
-
return this.childSubscribesTo(entry, category);
|
|
8780
|
-
}
|
|
8781
|
-
/**
|
|
8782
|
-
* The SUBSCRIPTION answer alone, with no fan-out-mode override.
|
|
8783
|
-
*
|
|
8784
|
-
* {@link childWantsEvent} answers "will this child be sent the event", which
|
|
8785
|
-
* under `broadcast` is `true` for everything and therefore cannot say whether
|
|
8786
|
-
* anyone actually asked. The D467 census needs the second question, so the
|
|
8787
|
-
* two are separate functions and `broadcast` mode overrides only the first.
|
|
8788
|
-
*/
|
|
8789
|
-
childSubscribesTo(entry, category) {
|
|
8790
8740
|
if (entry.eventPatterns === null) return true;
|
|
8791
8741
|
return entry.eventPatterns.some((p) => matchesPattern(p, category));
|
|
8792
8742
|
}
|
|
@@ -9091,14 +9041,15 @@ var LocalChildRegistry = class {
|
|
|
9091
9041
|
let subscribed = 0;
|
|
9092
9042
|
for (const entry of this.children.values()) {
|
|
9093
9043
|
if (entry.childId === exceptChildId) continue;
|
|
9094
|
-
if (this.childSubscribesTo(entry, event.category)) subscribed += 1;
|
|
9095
9044
|
const wants = this.childWantsEvent(entry, event.category);
|
|
9096
9045
|
const stats = this.statsFor(entry.childId);
|
|
9097
|
-
if (!wants)
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
entry.channel.emit(msg);
|
|
9046
|
+
if (!wants) {
|
|
9047
|
+
stats.suppressed++;
|
|
9048
|
+
continue;
|
|
9101
9049
|
}
|
|
9050
|
+
subscribed += 1;
|
|
9051
|
+
stats.sent++;
|
|
9052
|
+
entry.channel.emit(msg);
|
|
9102
9053
|
}
|
|
9103
9054
|
this.recordCategoryBroadcast(event.category, subscribed);
|
|
9104
9055
|
}
|
|
@@ -11034,19 +10985,16 @@ function nodeInterestSnapshot(broker) {
|
|
|
11034
10985
|
}
|
|
11035
10986
|
/**
|
|
11036
10987
|
* Decide + account for an inbound cross-node event on `broker`. Returns whether
|
|
11037
|
-
* the event should be delivered to the local bus
|
|
11038
|
-
*
|
|
11039
|
-
* but records the would-suppress; in `filter` it drops unwanted categories.
|
|
11040
|
-
* The interest is the UNION of forked-child AND in-process subscribers — the
|
|
10988
|
+
* the event should be delivered to the local bus: unwanted categories are
|
|
10989
|
+
* dropped and counted as `suppressed`. The interest is the UNION of forked-child AND in-process subscribers — the
|
|
11041
10990
|
* gate never starves a live local subscriber of either kind.
|
|
11042
10991
|
*/
|
|
11043
|
-
function acceptInboundCrossNode(broker,
|
|
11044
|
-
const wants = crossNodeAcceptsCategory(
|
|
10992
|
+
function acceptInboundCrossNode(broker, category) {
|
|
10993
|
+
const wants = crossNodeAcceptsCategory(nodeInterestSnapshot(broker), category);
|
|
11045
10994
|
const stats = crossNodeStatsFor(broker);
|
|
11046
|
-
if (
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
return deliver;
|
|
10995
|
+
if (wants) stats.delivered++;
|
|
10996
|
+
else stats.suppressed++;
|
|
10997
|
+
return wants;
|
|
11050
10998
|
}
|
|
11051
10999
|
/**
|
|
11052
11000
|
* Register the `$event-bus` service on a broker. MUST be called BEFORE
|
|
@@ -11072,7 +11020,6 @@ function registerEventBusService(broker) {
|
|
|
11072
11020
|
if (eventBusServiceInstalled.has(broker)) return;
|
|
11073
11021
|
eventBusServiceInstalled.add(broker);
|
|
11074
11022
|
const bkr = broker;
|
|
11075
|
-
const fanoutMode = readMoleculerFanoutMode();
|
|
11076
11023
|
try {
|
|
11077
11024
|
bkr.createService({
|
|
11078
11025
|
name: "$event-bus",
|
|
@@ -11080,7 +11027,7 @@ function registerEventBusService(broker) {
|
|
|
11080
11027
|
const event = ctx.params;
|
|
11081
11028
|
if (!event) return;
|
|
11082
11029
|
if (event.sourceNodeId === bkr.nodeID) return;
|
|
11083
|
-
if (!acceptInboundCrossNode(broker,
|
|
11030
|
+
if (!acceptInboundCrossNode(broker, event.category)) return;
|
|
11084
11031
|
deliverShared(getSharedBusState(broker), event);
|
|
11085
11032
|
} }
|
|
11086
11033
|
});
|
|
@@ -13646,12 +13593,6 @@ Object.defineProperty(exports, "readHeapSpaces", {
|
|
|
13646
13593
|
return readHeapSpaces;
|
|
13647
13594
|
}
|
|
13648
13595
|
});
|
|
13649
|
-
Object.defineProperty(exports, "readMoleculerFanoutMode", {
|
|
13650
|
-
enumerable: true,
|
|
13651
|
-
get: function() {
|
|
13652
|
-
return readMoleculerFanoutMode;
|
|
13653
|
-
}
|
|
13654
|
-
});
|
|
13655
13596
|
Object.defineProperty(exports, "readSocketQueues", {
|
|
13656
13597
|
enumerable: true,
|
|
13657
13598
|
get: function() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cr as EventCategory$1, cr as createEvent } from "./dist-OCi0K-iM.mjs";
|
|
2
2
|
import { a as parseProcStat, i as nodeProcReader } from "./proc-stat-CbC55Kqi.mjs";
|
|
3
3
|
import "./hub-cap-forward-BdT320dq.mjs";
|
|
4
4
|
import * as crypto$1 from "node:crypto";
|
|
@@ -53,8 +53,6 @@ function createEventPlaneReader(sources) {
|
|
|
53
53
|
}
|
|
54
54
|
const crossNode = sources.crossNodeStats();
|
|
55
55
|
return {
|
|
56
|
-
udsMode: registry.eventFanoutMode,
|
|
57
|
-
crossNodeMode: sources.crossNodeMode(),
|
|
58
56
|
children,
|
|
59
57
|
childrenConnected: listed.length,
|
|
60
58
|
childrenUndeclared: registry.undeclaredChildCount(),
|
|
@@ -129,8 +127,6 @@ function diffEventPlane(baseline, current, topN = 5) {
|
|
|
129
127
|
}
|
|
130
128
|
const byBroadcasts = categoryDeltas.toSorted((a, b) => b.broadcasts - a.broadcasts || a.category.localeCompare(b.category));
|
|
131
129
|
return {
|
|
132
|
-
udsMode: current.udsMode,
|
|
133
|
-
crossNodeMode: current.crossNodeMode,
|
|
134
130
|
childrenConnected: current.childrenConnected,
|
|
135
131
|
childrenUndeclared: current.childrenUndeclared,
|
|
136
132
|
fanoutSent,
|
|
@@ -182,7 +178,7 @@ function formatEventPlane(window) {
|
|
|
182
178
|
const top = window.top.map((d) => `${d.childId}:${d.sent}/${d.suppressed}`).join(",");
|
|
183
179
|
const cats = window.topCategories.map((c) => `${c.category}:${c.broadcasts}/${c.wanted}`).join(",");
|
|
184
180
|
const orphans = window.topOrphans.map((c) => `${c.category}:${c.broadcasts}`).join(",");
|
|
185
|
-
return `
|
|
181
|
+
return ` children=${window.childrenConnected} childrenUndeclared=${window.childrenUndeclared} fanoutSent=${window.fanoutSent} fanoutSuppressed=${window.fanoutSuppressed} crossNodeDelivered=${window.crossNodeDelivered} crossNodeSuppressed=${window.crossNodeSuppressed} fanoutEvents=${window.categoryBroadcasts} fanoutOrphans=${window.orphanBroadcasts} fanoutCatsDropped=${window.categoryOverflow}` + (top.length === 0 ? "" : ` fanoutTop=${top}`) + (cats.length === 0 ? "" : ` fanoutCats=${cats}`) + (orphans.length === 0 ? "" : ` fanoutOrphanTop=${orphans}`);
|
|
186
182
|
}
|
|
187
183
|
//#endregion
|
|
188
184
|
//#region src/kernel/transport/cap-action-census.ts
|
|
@@ -1081,21 +1077,16 @@ function formatHeapSpaces(spaces, minMb = 32) {
|
|
|
1081
1077
|
}
|
|
1082
1078
|
var defaultDeps = {
|
|
1083
1079
|
readMemory: () => process.memoryUsage(),
|
|
1084
|
-
readSpaces: readHeapSpaces
|
|
1085
|
-
env: process.env
|
|
1080
|
+
readSpaces: readHeapSpaces
|
|
1086
1081
|
};
|
|
1087
1082
|
/**
|
|
1088
|
-
* The SIGUSR2 report — memory + the FULL per-space breakdown
|
|
1089
|
-
* snapshot
|
|
1083
|
+
* The SIGUSR2 report — memory + the FULL per-space breakdown; never a heap
|
|
1084
|
+
* snapshot (D718) — see the note in the body.
|
|
1090
1085
|
*
|
|
1091
1086
|
* The breakdown here keeps every non-empty space at 0.1 MB, unlike the
|
|
1092
1087
|
* heartbeat's filtered whole-MB pair: this is a hand-fired diagnostic read once
|
|
1093
1088
|
* by a human who asked for it, so completeness costs nothing. The heartbeat runs
|
|
1094
1089
|
* unattended on every runner forever, so it pays for every field it prints.
|
|
1095
|
-
*
|
|
1096
|
-
* A refused snapshot SAYS SO. A branch that drops work silently reads as "it was
|
|
1097
|
-
* never requested", and this one is fired by an operator who is standing there
|
|
1098
|
-
* waiting for a file.
|
|
1099
1090
|
*/
|
|
1100
1091
|
function emitHeapDiagnosticReport(request, deps = defaultDeps) {
|
|
1101
1092
|
try {
|
|
@@ -7939,25 +7930,16 @@ function isHighFrequencyCategory(category) {
|
|
|
7939
7930
|
for (const pattern of RING_BUFFER_DENY_PATTERNS) if (matchesPattern(pattern, category)) return true;
|
|
7940
7931
|
return false;
|
|
7941
7932
|
}
|
|
7942
|
-
function readMoleculerFanoutMode() {
|
|
7943
|
-
const raw = process.env.CAMSTACK_MOLECULER_EVENT_FANOUT;
|
|
7944
|
-
if (raw === "shadow" || raw === "broadcast") return raw;
|
|
7945
|
-
return "filter";
|
|
7946
|
-
}
|
|
7947
7933
|
/**
|
|
7948
7934
|
* Does this node want to accept an inbound cross-node event in `category`?
|
|
7949
7935
|
* The receiving-side mirror of `LocalChildRegistry.childWantsEvent`:
|
|
7950
|
-
* - `broadcast` mode → always (gate disabled).
|
|
7951
7936
|
* - a retaining bus (hub main) → always (it serves `getRecent` + admin-ui;
|
|
7952
7937
|
* its interest is genuinely everything).
|
|
7953
7938
|
* - undeclared interest (`null`) → always (fail-open).
|
|
7954
7939
|
* - else the declared union must match via `matchesPattern` — the SAME
|
|
7955
7940
|
* function the local subscriber map-key gate uses, giving delivery parity.
|
|
7956
|
-
* `shadow` is handled by the caller (it counts the would-suppress but still
|
|
7957
|
-
* delivers), exactly like the UDS fan-out.
|
|
7958
7941
|
*/
|
|
7959
|
-
function crossNodeAcceptsCategory(
|
|
7960
|
-
if (mode === "broadcast") return true;
|
|
7942
|
+
function crossNodeAcceptsCategory(snapshot, category) {
|
|
7961
7943
|
if (snapshot.retainRecent) return true;
|
|
7962
7944
|
if (snapshot.interest === null) return true;
|
|
7963
7945
|
return snapshot.interest.some((p) => matchesPattern(p, category));
|
|
@@ -8530,11 +8512,6 @@ var LIFECYCLE_SOURCE = {
|
|
|
8530
8512
|
type: "core",
|
|
8531
8513
|
id: "local-child-registry"
|
|
8532
8514
|
};
|
|
8533
|
-
function readFanoutMode() {
|
|
8534
|
-
const raw = process.env.CAMSTACK_UDS_EVENT_FANOUT;
|
|
8535
|
-
if (raw === "shadow" || raw === "broadcast") return raw;
|
|
8536
|
-
return "filter";
|
|
8537
|
-
}
|
|
8538
8515
|
/**
|
|
8539
8516
|
* Sentinel prefix used in the no-route error thrown when `cap-call-out` has no
|
|
8540
8517
|
* local sibling and no `onUnownedCall` fallback. `ipcParentLink` detects this
|
|
@@ -8597,8 +8574,6 @@ var LocalChildRegistry = class {
|
|
|
8597
8574
|
capUsageObserver;
|
|
8598
8575
|
/** Tracks capNames already logged as UDS-routed; one INFO line per capName per process. */
|
|
8599
8576
|
egressRoutedCaps = /* @__PURE__ */ new Set();
|
|
8600
|
-
/** Active event fan-out mode, read once from `CAMSTACK_UDS_EVENT_FANOUT`. */
|
|
8601
|
-
fanoutMode = readFanoutMode();
|
|
8602
8577
|
/** Per-child event fan-out counters (sent / suppressed). */
|
|
8603
8578
|
childEventStats = /* @__PURE__ */ new Map();
|
|
8604
8579
|
/** D467: per-category production census (cumulative). See {@link CategoryFanoutSample}. */
|
|
@@ -8647,14 +8622,13 @@ var LocalChildRegistry = class {
|
|
|
8647
8622
|
}
|
|
8648
8623
|
}
|
|
8649
8624
|
async start() {
|
|
8650
|
-
this.logger?.info("UDS event fan-out mode", { mode: this.fanoutMode });
|
|
8651
8625
|
this.server.onConnection((channel) => this.onConnection(channel));
|
|
8652
8626
|
await this.server.listen();
|
|
8653
8627
|
}
|
|
8654
8628
|
/**
|
|
8655
8629
|
* Per-child event fan-out counters (`{ sent, suppressed }`) or `null` if the
|
|
8656
8630
|
* child has no recorded events yet. Exposed for the starvation-verification
|
|
8657
|
-
* surface (
|
|
8631
|
+
* surface (operator debug).
|
|
8658
8632
|
*/
|
|
8659
8633
|
getChildEventStats(childId) {
|
|
8660
8634
|
const s = this.childEventStats.get(childId);
|
|
@@ -8732,18 +8706,6 @@ var LocalChildRegistry = class {
|
|
|
8732
8706
|
return this.actionCensus.read();
|
|
8733
8707
|
}
|
|
8734
8708
|
/**
|
|
8735
|
-
* The regime the counters above were produced under, read once from
|
|
8736
|
-
* `CAMSTACK_UDS_EVENT_FANOUT` at construction.
|
|
8737
|
-
*
|
|
8738
|
-
* A suppressed count means "nothing WAS dropped" under `filter` and "nothing
|
|
8739
|
-
* WOULD have been dropped" under `shadow`. Those are different claims, and
|
|
8740
|
-
* until this getter existed the mode was invisible at runtime — the counters
|
|
8741
|
-
* were readable and the regime that produced them was not.
|
|
8742
|
-
*/
|
|
8743
|
-
get eventFanoutMode() {
|
|
8744
|
-
return this.fanoutMode;
|
|
8745
|
-
}
|
|
8746
|
-
/**
|
|
8747
8709
|
* Connected children that never declared a subscription pattern set.
|
|
8748
8710
|
*
|
|
8749
8711
|
* Each one is a fail-open on BOTH planes: `childWantsEvent` returns true for
|
|
@@ -8760,30 +8722,18 @@ var LocalChildRegistry = class {
|
|
|
8760
8722
|
return count;
|
|
8761
8723
|
}
|
|
8762
8724
|
/**
|
|
8763
|
-
* Does `entry` want to receive an event in `category`?
|
|
8764
|
-
*
|
|
8765
|
-
*
|
|
8766
|
-
*
|
|
8767
|
-
*
|
|
8768
|
-
*
|
|
8725
|
+
* Does `entry` want to receive an event in `category`? Undeclared patterns
|
|
8726
|
+
* (`null`) → always (fail-open, counted by {@link undeclaredChildCount});
|
|
8727
|
+
* else the child's declared set must match via `matchesPattern` — the SAME
|
|
8728
|
+
* function the child's own `deliverShared` map-key gate uses, giving provable
|
|
8729
|
+
* delivery parity. The parent always filters: the `CAMSTACK_UDS_EVENT_FANOUT`
|
|
8730
|
+
* shadow/broadcast modes were removed on 2026-10-06.
|
|
8769
8731
|
*
|
|
8770
8732
|
* NOTE: this gate must NOT consult `RING_BUFFER_DENY_PATTERNS` /
|
|
8771
8733
|
* `isHighFrequencyCategory` — those are ring-buffer STORAGE policy; a child
|
|
8772
8734
|
* that explicitly subscribes to a ring-denied category must still RECEIVE it.
|
|
8773
8735
|
*/
|
|
8774
8736
|
childWantsEvent(entry, category) {
|
|
8775
|
-
if (this.fanoutMode === "broadcast") return true;
|
|
8776
|
-
return this.childSubscribesTo(entry, category);
|
|
8777
|
-
}
|
|
8778
|
-
/**
|
|
8779
|
-
* The SUBSCRIPTION answer alone, with no fan-out-mode override.
|
|
8780
|
-
*
|
|
8781
|
-
* {@link childWantsEvent} answers "will this child be sent the event", which
|
|
8782
|
-
* under `broadcast` is `true` for everything and therefore cannot say whether
|
|
8783
|
-
* anyone actually asked. The D467 census needs the second question, so the
|
|
8784
|
-
* two are separate functions and `broadcast` mode overrides only the first.
|
|
8785
|
-
*/
|
|
8786
|
-
childSubscribesTo(entry, category) {
|
|
8787
8737
|
if (entry.eventPatterns === null) return true;
|
|
8788
8738
|
return entry.eventPatterns.some((p) => matchesPattern(p, category));
|
|
8789
8739
|
}
|
|
@@ -9088,14 +9038,15 @@ var LocalChildRegistry = class {
|
|
|
9088
9038
|
let subscribed = 0;
|
|
9089
9039
|
for (const entry of this.children.values()) {
|
|
9090
9040
|
if (entry.childId === exceptChildId) continue;
|
|
9091
|
-
if (this.childSubscribesTo(entry, event.category)) subscribed += 1;
|
|
9092
9041
|
const wants = this.childWantsEvent(entry, event.category);
|
|
9093
9042
|
const stats = this.statsFor(entry.childId);
|
|
9094
|
-
if (!wants)
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
entry.channel.emit(msg);
|
|
9043
|
+
if (!wants) {
|
|
9044
|
+
stats.suppressed++;
|
|
9045
|
+
continue;
|
|
9098
9046
|
}
|
|
9047
|
+
subscribed += 1;
|
|
9048
|
+
stats.sent++;
|
|
9049
|
+
entry.channel.emit(msg);
|
|
9099
9050
|
}
|
|
9100
9051
|
this.recordCategoryBroadcast(event.category, subscribed);
|
|
9101
9052
|
}
|
|
@@ -11031,19 +10982,16 @@ function nodeInterestSnapshot(broker) {
|
|
|
11031
10982
|
}
|
|
11032
10983
|
/**
|
|
11033
10984
|
* Decide + account for an inbound cross-node event on `broker`. Returns whether
|
|
11034
|
-
* the event should be delivered to the local bus
|
|
11035
|
-
*
|
|
11036
|
-
* but records the would-suppress; in `filter` it drops unwanted categories.
|
|
11037
|
-
* The interest is the UNION of forked-child AND in-process subscribers — the
|
|
10985
|
+
* the event should be delivered to the local bus: unwanted categories are
|
|
10986
|
+
* dropped and counted as `suppressed`. The interest is the UNION of forked-child AND in-process subscribers — the
|
|
11038
10987
|
* gate never starves a live local subscriber of either kind.
|
|
11039
10988
|
*/
|
|
11040
|
-
function acceptInboundCrossNode(broker,
|
|
11041
|
-
const wants = crossNodeAcceptsCategory(
|
|
10989
|
+
function acceptInboundCrossNode(broker, category) {
|
|
10990
|
+
const wants = crossNodeAcceptsCategory(nodeInterestSnapshot(broker), category);
|
|
11042
10991
|
const stats = crossNodeStatsFor(broker);
|
|
11043
|
-
if (
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
return deliver;
|
|
10992
|
+
if (wants) stats.delivered++;
|
|
10993
|
+
else stats.suppressed++;
|
|
10994
|
+
return wants;
|
|
11047
10995
|
}
|
|
11048
10996
|
/**
|
|
11049
10997
|
* Register the `$event-bus` service on a broker. MUST be called BEFORE
|
|
@@ -11069,7 +11017,6 @@ function registerEventBusService(broker) {
|
|
|
11069
11017
|
if (eventBusServiceInstalled.has(broker)) return;
|
|
11070
11018
|
eventBusServiceInstalled.add(broker);
|
|
11071
11019
|
const bkr = broker;
|
|
11072
|
-
const fanoutMode = readMoleculerFanoutMode();
|
|
11073
11020
|
try {
|
|
11074
11021
|
bkr.createService({
|
|
11075
11022
|
name: "$event-bus",
|
|
@@ -11077,7 +11024,7 @@ function registerEventBusService(broker) {
|
|
|
11077
11024
|
const event = ctx.params;
|
|
11078
11025
|
if (!event) return;
|
|
11079
11026
|
if (event.sourceNodeId === bkr.nodeID) return;
|
|
11080
|
-
if (!acceptInboundCrossNode(broker,
|
|
11027
|
+
if (!acceptInboundCrossNode(broker, event.category)) return;
|
|
11081
11028
|
deliverShared(getSharedBusState(broker), event);
|
|
11082
11029
|
} }
|
|
11083
11030
|
});
|
|
@@ -12803,4 +12750,4 @@ function createChildCapDispatch(deps) {
|
|
|
12803
12750
|
};
|
|
12804
12751
|
}
|
|
12805
12752
|
//#endregion
|
|
12806
|
-
export { CapRouteError as $,
|
|
12753
|
+
export { CapRouteError as $, EMPTY_CAP_ACTION_READING as $n, RUNNER_RSS_BUDGET_ENV as $t, resolveHwAccel as A, OUTBOUND_QUEUE_SUSTAIN_MS as An, DeviceRegistry as At, udsChildLogToWorkerEntry as B, createSocketPlaneMeter as Bn, hostNodeIdOf as Bt, getBrokerEventBus as C, HEAP_SPACE_REPORT_MIN_MB as Cn, capActionName as Ct, subscribePassthrough as D, readHeapSpaces as Dn, parseCapAction as Dt, setNodeEventInterest as E, heapSpaceField as En, capServiceName as Et, ipcParentLink as F, createMeshQueueReader as Fn, resolveAddonClass as Ft, UDS_NO_ROUTE_PREFIX as G, EMPTY_SOCKET_DIRECTION as Gn, HEAP_WATCH_INTERVAL_MS as Gt, createUdsLoggerWithControl as H, diffSocketPlane as Hn, HEAP_RECLAIM_MIN_INTERVAL_MS as Ht, localProviderLink as I, formatMeshQueue as In, buildNpmChildEnv as It, answerClaimedGetStatus as J, sampleSocketDirection as Jn, HUB_MAIN_RSS_BUDGET_MB as Jt, afterWorkerOnlineAnnounce as K, createSocketDirectionCounters as Kn, HEAP_WATCH_WARN_RATIO as Kt, createParentUnownedCallHandler as L, EMPTY_SOCKET_PLANE_BASELINE as Ln, resolveNpmInvocation as Lt, brokerTransportLink as M, createOutboundQueueGate as Mn, CapabilityUnavailableError as Mt, buildLinkChain as N, formatOutboundQueueVerdict as Nn, copyBundledNativeModules as Nt, AddonDepsManager as O, selectReportedSpaces as On, deserializeTypedArrays as Ot, deviceCapResolverLink as P, MESH_QUEUE_TOP_N as Pn, installManifestNativeDeps as Pt, CapRouteResolver as Q, CAP_ACTION_UNLABELLED as Qn, RUNNER_HEAP_WATCH_INTERVAL_MS as Qt, createUdsEventBridge as R, SOCKET_PLANE_TOP_N as Rn, runNpm as Rt, clusterEventTopic as S, DECISIVE_HEAP_SPACES as Sn, NATIVE_PROVIDER_SERVICE_INFIX as St, registerEventBusService as T, formatHeapSpaces as Tn, capBareAction as Tt, LocalChildClient as U, formatSocketPlane as Un, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS as Ut, createUdsLogger as V, createSocketPlaneReader as Vn, createAddonDataPlaneFacility as Vt, LocalChildRegistry as W, readSocketQueues as Wn, HEAP_RECLAIM_TRIGGER_MB as Wt, AGENT_CAP_FWD_ACTION as X, socketDirectionMessages as Xn, RSS_BUDGET_REANNOUNCE_MIN_MS as Xt, deviceOfGetStatus as Y, socketDirectionBytes as Yn, HUB_RSS_BUDGET_ENV as Yt, AGENT_CAP_FWD_SERVICE as Z, CAP_ACTION_OVERFLOW_LABEL as Zn, RSS_BUDGET_RELEASE_RATIO as Zt, getWorkerDeviceRegistry as _, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO as _n, getWorkerNativeCapSnapshot as _t, reapProcessGroup as a, describeRss as an, createEventPlaneMeter as ar, getCapUsageRegistry as at, setHubConnected as b, formatArrayBufferCensus as bn, createAddonService as bt, runnerOwnsProcessGroup as c, parseRssBudgetMb as cn, formatEventPlane as cr, UdsLocalTransportServer as ct, summarizeMembers as d, startHeapWatch as dn, localEndpointPath as dt, ZERO_LOOP_DELAY as en, MAX_CAP_ACTIONS_PER_PEER as er, classifyCapRoute as et, installManifestSystemDeps as f, startRunnerHeapWatch as fn, FrameDecoder as ft, createUdsAddonContext as g, ARRAY_BUFFER_CENSUS_THRESHOLD_MB as gn, getWorkerNativeCapProvider as gt, createAddonContext as h, ARRAY_BUFFER_CENSUS_SUSTAIN_MS as hn, createBrokerDeviceManagerApi as ht, killOwnRunnerGroupAfterParentLoss as i, createV8Reclaimer as in, EVENT_PLANE_TOP_N as ir, __resetCapUsageRegistryForTests as it, brokerCallForCap as j, OUTBOUND_QUEUE_THRESHOLD_BYTES as jn, CapabilityHandle as jt, createKernelHwAccel as k, OUTBOUND_QUEUE_COOLDOWN_MS as kn, serializeTypedArrays as kt, signalAllRunnerGroups as l, reclaimIntervalMs as ln, SocketChannel as lt, adaptBrokerToCluster as m, ARRAY_BUFFER_CENSUS_COOLDOWN_MS as mn, buildNativeCapProxy as mt, createChildCapDispatch as n, createDeferredHeapWatchSink as nn, createCapActionCensus as nr, CapUsageRegistry as nt, registerRunnerGroup as o, hubMainRssBudget as on, createEventPlaneReader as or, createLocalTransport as ot, installManifestPythonDeps as p, strandedMb as pn, encodeFrame as pt, GET_STATUS_METHOD as q, recordSocketFrame as qn, HUB_MAIN_HEAP_WATCH_LABEL as qt, defaultProcessGroupOps as r, createLoopDelayMeter as rn, diffCapActionCensus as rr, PARENT_ROUTED_PROVIDER_ADDON_ID as rt, releaseRunnerGroup as s, nextRssBudgetState as sn, diffEventPlane as sr, UdsLocalTransportClient as st, CAP_METHOD_NOT_IMPLEMENTED as t, buildHeapSample as tn, capActionLabel as tr, callWithServiceDiscovery as tt, startRunnerParentDeathWatchdog as u, shouldReclaim as un, PeerAnsweredError as ut, getOrInitReadinessRegistry as v, createArrayBufferCensusGate as vn, mountNativeCapService as vt, getMoleculerEventStats as w, emitHeapDiagnosticReport as wn, capActionSuffix as wt, EVENT_TOPIC_PREFIX as x, isArrayBufferCensusReport as xn, validateProviderRegistrations as xt, getOrInitReadinessRegistryForClient as y, createInspectorArrayBufferCensus as yn, setWorkerNativeCapsChangeListener as yt, createUdsEventBus as z, SOCKET_QUEUE_TOP_N as zn, createAddonPeerBytesFacility as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Wn as compositionSourceKey, Zn as errMsg } from "./dist-OCi0K-iM.mjs";
|
|
2
2
|
//#region src/builtins/core-blocks/composition-sources.ts
|
|
3
3
|
/**
|
|
4
4
|
* Describe what a composition reads and writes for SAVE-time validation
|