@camstack/system 1.2.354 → 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 +53 -12
- package/dist/builtins/composer/composer.addon.mjs +53 -12
- 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 +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- 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/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 +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/{child-cap-dispatch-CRqYKHAb.js → child-cap-dispatch-CqV-7-QZ.js} +27 -86
- package/dist/{child-cap-dispatch-C1x1kNJK.mjs → child-cap-dispatch-DMx2axev.mjs} +28 -81
- package/dist/{composition-sources-0nuWOdNd.js → composition-sources-Bk-MjK1D.js} +1 -1
- package/dist/{composition-sources-DzkEFd8q.mjs → composition-sources-Dpl1G0Gr.mjs} +1 -1
- package/dist/{dist-DePB7uwU.js → dist-BWicEEVA.js} +77 -47
- package/dist/{dist-DVyXxn41.mjs → dist-OCi0K-iM.mjs} +72 -48
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -46
- package/dist/index.mjs +19 -46
- 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-BTKZdPn6.js → retired-settings-keys-DLJ7MvIB.js} +1 -1
- package/dist/{retired-settings-keys-DFur4hJF.mjs → retired-settings-keys-TDzxE6GA.mjs} +1 -1
- package/package.json +1 -1
- package/dist/kernel/heap-allocation-sample.d.ts +0 -107
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cr as EventCategory, Qn as BaseAddon } from "../../dist-OCi0K-iM.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-
|
|
6
|
+
const require_dist = require("../../dist-BWicEEVA.js");
|
|
7
7
|
const require_snapshot_courtesy = require("../../snapshot-courtesy-D_C5-nC0.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cn as snapshotCapability, Cr as EventCategory, Jn as DeviceFeature, Qn as BaseAddon, X as batteryCapability, Xn as DeviceType, Xt as memoizePinnedFfmpeg, Y as bareAddonId, Zn as errMsg, a as BatteryStatusSchema, gt as deriveBatteryPresence, hr as nodePin, kn as streamQualityLabel } from "../../dist-OCi0K-iM.mjs";
|
|
2
2
|
import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg } from "../../snapshot-courtesy-CyFs1M3I.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -8,8 +8,6 @@ import { Database } from 'better-sqlite3';
|
|
|
8
8
|
* the cluster is serving before the engine goes quiet.
|
|
9
9
|
*/
|
|
10
10
|
export declare const ANALYZE_DELAY_MS = 120000;
|
|
11
|
-
/** Env var that disables the one-shot analysis. `off` is the only value read. */
|
|
12
|
-
export declare const ANALYZE_ENV_VAR = "CAMSTACK_SQLITE_ANALYZE";
|
|
13
11
|
/** What {@link runAnalyzeIfMissing} did, for the caller to log. */
|
|
14
12
|
export type AnalyzeOutcome = {
|
|
15
13
|
readonly kind: 'already-present';
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-BWicEEVA.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 {
|
|
1
|
+
import { At as filesystemBrowseCapability, Dn as storageProviderCapability, Qn as BaseAddon } from "../../dist-OCi0K-iM.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";
|
|
@@ -369,15 +369,6 @@ export declare class SqliteSettingsBackend implements ISettingsBackend {
|
|
|
369
369
|
* with a number yields 0, which `sqliteOccupancy` reads as "unknown" and
|
|
370
370
|
* reports as an empty file rather than inventing a ratio.
|
|
371
371
|
*/
|
|
372
|
-
/**
|
|
373
|
-
* Name the biggest tables, once, a minute after the connection opens.
|
|
374
|
-
*
|
|
375
|
-
* `dbSizeMb` says how big the file is and `freePct` says how much of it is
|
|
376
|
-
* live; neither says WHOSE. Per-addon scoped collections are created on first
|
|
377
|
-
* write and declared nowhere, so this is the only place the real set can be
|
|
378
|
-
* enumerated. `unref` so it can never hold the process open, and
|
|
379
|
-
* `CAMSTACK_SQLITE_STORAGE_REPORT=off` turns it off without a rebuild.
|
|
380
|
-
*/
|
|
381
372
|
/**
|
|
382
373
|
* Follow the file as it grows.
|
|
383
374
|
*
|
|
@@ -388,8 +379,7 @@ export declare class SqliteSettingsBackend implements ISettingsBackend {
|
|
|
388
379
|
* node escaped it only because 130 MB → 858 MB spanned seventeen days of
|
|
389
380
|
* restarts.
|
|
390
381
|
*
|
|
391
|
-
* `unref` so it never holds the process open
|
|
392
|
-
* storage report turns it off without a rebuild.
|
|
382
|
+
* `unref` so it never holds the process open.
|
|
393
383
|
*/
|
|
394
384
|
private scheduleMapGrowthCheck;
|
|
395
385
|
/**
|
|
@@ -402,6 +392,14 @@ export declare class SqliteSettingsBackend implements ISettingsBackend {
|
|
|
402
392
|
* one thread the cluster reads configuration through.
|
|
403
393
|
*/
|
|
404
394
|
private scheduleIndexAnalysis;
|
|
395
|
+
/**
|
|
396
|
+
* Name the biggest tables, once, a minute after the connection opens.
|
|
397
|
+
*
|
|
398
|
+
* `dbSizeMb` says how big the file is and `freePct` says how much of it is
|
|
399
|
+
* live; neither says WHOSE. Per-addon scoped collections are created on first
|
|
400
|
+
* write and declared nowhere, so this is the only place the real set can be
|
|
401
|
+
* enumerated. `unref` so it can never hold the process open.
|
|
402
|
+
*/
|
|
405
403
|
private scheduleStorageReport;
|
|
406
404
|
private logStorageReport;
|
|
407
405
|
private readPragmaNumber;
|
|
Binary file
|
|
Binary file
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-BWicEEVA.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 { B as StorageLocationTypeSchema,
|
|
1
|
+
import { B as StorageLocationTypeSchema, Cr as EventCategory, E as LegacyStorageLocationDefaultSchema, Et as evictionPolicyOfLocation, Fn as withLocationMode, It as isLocationEnabled, Jt as mayReadLocation, M as REDACTED_SECRET, Nt as gbToBytes, Qn as BaseAddon, Qt as modeMayWrite, R as StorageCleanupJobSchema, Tn as storageMigrationCapability, V as StorageMigrationJobSchema, Vt as legacyModeOf, Yt as mayWriteToLocation, gr as parseJsonObject, hn as resolveLocationMode, tt as collectSecretConfigKeys, wn as storageCapability, xn as settingsStoreCapability, z as StorageLocationModeSchema } from "../../dist-OCi0K-iM.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-
|
|
6
|
+
const require_dist = require("../../dist-BWicEEVA.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 {
|
|
1
|
+
import { Qn as BaseAddon, Zn as errMsg, fr as hydrateSchema } from "../../dist-OCi0K-iM.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-
|
|
6
|
+
const require_dist = require("../../dist-BWicEEVA.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 {
|
|
1
|
+
import { Gt as logDestinationCapability, Qn as BaseAddon } from "../../dist-OCi0K-iM.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";
|
|
@@ -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() {
|