camstack 1.2.60 → 1.2.61

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/cli.js CHANGED
@@ -38,7 +38,7 @@ async function runServe(args) {
38
38
  ...typeof values.data === "string" ? { data: values.data } : {}
39
39
  };
40
40
  Object.assign(process.env, buildServeEnv(opts));
41
- await import("./launcher-CL4LHR6D.js");
41
+ await import("./launcher-AZ7QXACO.js");
42
42
  }
43
43
 
44
44
  // src/commands/agent.ts
@@ -83,7 +83,7 @@ async function runAgent(args) {
83
83
  ...typeof values.port === "string" ? { port: values.port } : {}
84
84
  };
85
85
  Object.assign(process.env, buildAgentEnv(opts));
86
- await import("./launcher-CL4LHR6D.js");
86
+ await import("./launcher-AZ7QXACO.js");
87
87
  }
88
88
 
89
89
  // src/commands/setup.ts
@@ -114644,9 +114644,9 @@ var require_dist2 = __commonJS({
114644
114644
  }
114645
114645
  });
114646
114646
 
114647
- // ../system/dist/manifest-python-deps-COeSr7el.js
114648
- var require_manifest_python_deps_COeSr7el = __commonJS({
114649
- "../system/dist/manifest-python-deps-COeSr7el.js"(exports) {
114647
+ // ../system/dist/manifest-python-deps-w48vOhGR.js
114648
+ var require_manifest_python_deps_w48vOhGR = __commonJS({
114649
+ "../system/dist/manifest-python-deps-w48vOhGR.js"(exports) {
114650
114650
  "use strict";
114651
114651
  var require_chunk = require_chunk_Cek0wNdY();
114652
114652
  require_dist_BPlfW_CG();
@@ -114755,6 +114755,152 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
114755
114755
  const top = window2.top.map((d) => `${d.childId}:${d.sent}/${d.suppressed}`).join(",");
114756
114756
  return ` fanoutMode=uds:${window2.udsMode}/cross-node:${window2.crossNodeMode} children=${window2.childrenConnected} childrenUndeclared=${window2.childrenUndeclared} fanoutSent=${window2.fanoutSent} fanoutSuppressed=${window2.fanoutSuppressed} crossNodeDelivered=${window2.crossNodeDelivered} crossNodeSuppressed=${window2.crossNodeSuppressed}` + (top.length === 0 ? "" : ` fanoutTop=${top}`);
114757
114757
  }
114758
+ function createSocketDirectionCounters() {
114759
+ return {
114760
+ reqMessages: 0,
114761
+ reqBytes: 0,
114762
+ resMessages: 0,
114763
+ resBytes: 0,
114764
+ evtMessages: 0,
114765
+ evtBytes: 0
114766
+ };
114767
+ }
114768
+ function recordSocketFrame(counters, kind, bytes) {
114769
+ if (kind === "evt") {
114770
+ counters.evtMessages += 1;
114771
+ counters.evtBytes += bytes;
114772
+ return;
114773
+ }
114774
+ if (kind === "req") {
114775
+ counters.reqMessages += 1;
114776
+ counters.reqBytes += bytes;
114777
+ return;
114778
+ }
114779
+ counters.resMessages += 1;
114780
+ counters.resBytes += bytes;
114781
+ }
114782
+ function sampleSocketDirection(counters) {
114783
+ return {
114784
+ reqMessages: counters.reqMessages,
114785
+ reqBytes: counters.reqBytes,
114786
+ resMessages: counters.resMessages,
114787
+ resBytes: counters.resBytes,
114788
+ evtMessages: counters.evtMessages,
114789
+ evtBytes: counters.evtBytes
114790
+ };
114791
+ }
114792
+ var EMPTY_SOCKET_DIRECTION = {
114793
+ reqMessages: 0,
114794
+ reqBytes: 0,
114795
+ resMessages: 0,
114796
+ resBytes: 0,
114797
+ evtMessages: 0,
114798
+ evtBytes: 0
114799
+ };
114800
+ function socketDirectionMessages(sample) {
114801
+ return sample.reqMessages + sample.resMessages + sample.evtMessages;
114802
+ }
114803
+ function socketDirectionBytes(sample) {
114804
+ return sample.reqBytes + sample.resBytes + sample.evtBytes;
114805
+ }
114806
+ function createSocketPlaneReader(sources) {
114807
+ return () => {
114808
+ try {
114809
+ const registry = sources.registry();
114810
+ if (registry === null) return void 0;
114811
+ const listed = registry.listChildren();
114812
+ const peers = [];
114813
+ for (const child of listed) {
114814
+ const traffic = registry.getChildSocketTraffic(child.childId);
114815
+ if (traffic === null) continue;
114816
+ peers.push({
114817
+ peerId: child.childId,
114818
+ tx: traffic.tx,
114819
+ rx: traffic.rx
114820
+ });
114821
+ }
114822
+ return {
114823
+ peers,
114824
+ peersConnected: listed.length
114825
+ };
114826
+ } catch {
114827
+ return;
114828
+ }
114829
+ };
114830
+ }
114831
+ var SOCKET_PLANE_TOP_N = 5;
114832
+ var EMPTY_SOCKET_PLANE_BASELINE = { peers: /* @__PURE__ */ new Map() };
114833
+ function diffDirection(current, before) {
114834
+ const previous = before ?? EMPTY_SOCKET_DIRECTION;
114835
+ return {
114836
+ reqMessages: Math.max(0, current.reqMessages - previous.reqMessages),
114837
+ reqBytes: Math.max(0, current.reqBytes - previous.reqBytes),
114838
+ resMessages: Math.max(0, current.resMessages - previous.resMessages),
114839
+ resBytes: Math.max(0, current.resBytes - previous.resBytes),
114840
+ evtMessages: Math.max(0, current.evtMessages - previous.evtMessages),
114841
+ evtBytes: Math.max(0, current.evtBytes - previous.evtBytes)
114842
+ };
114843
+ }
114844
+ function addDirection(into, add) {
114845
+ return {
114846
+ reqMessages: into.reqMessages + add.reqMessages,
114847
+ reqBytes: into.reqBytes + add.reqBytes,
114848
+ resMessages: into.resMessages + add.resMessages,
114849
+ resBytes: into.resBytes + add.resBytes,
114850
+ evtMessages: into.evtMessages + add.evtMessages,
114851
+ evtBytes: into.evtBytes + add.evtBytes
114852
+ };
114853
+ }
114854
+ function peerMessages(delta) {
114855
+ return socketDirectionMessages(delta.tx) + socketDirectionMessages(delta.rx);
114856
+ }
114857
+ function diffSocketPlane(baseline, current, topN = 5) {
114858
+ const deltas = [];
114859
+ let tx = EMPTY_SOCKET_DIRECTION;
114860
+ let rx = EMPTY_SOCKET_DIRECTION;
114861
+ for (const sample of current.peers) {
114862
+ const before = baseline.peers.get(sample.peerId);
114863
+ const delta = {
114864
+ peerId: sample.peerId,
114865
+ tx: diffDirection(sample.tx, before?.tx),
114866
+ rx: diffDirection(sample.rx, before?.rx)
114867
+ };
114868
+ tx = addDirection(tx, delta.tx);
114869
+ rx = addDirection(rx, delta.rx);
114870
+ if (peerMessages(delta) > 0) deltas.push(delta);
114871
+ }
114872
+ return {
114873
+ peersConnected: current.peersConnected,
114874
+ peersMeasured: current.peers.length,
114875
+ tx,
114876
+ rx,
114877
+ top: deltas.toSorted((a, b) => peerMessages(b) - peerMessages(a) || a.peerId.localeCompare(b.peerId)).slice(0, topN)
114878
+ };
114879
+ }
114880
+ function createSocketPlaneMeter(reader, topN = 5) {
114881
+ let baseline = EMPTY_SOCKET_PLANE_BASELINE;
114882
+ return { read: () => {
114883
+ const current = reader();
114884
+ if (current === void 0) return void 0;
114885
+ const window2 = diffSocketPlane(baseline, current, topN);
114886
+ baseline = { peers: new Map(current.peers.map((p) => [p.peerId, p])) };
114887
+ return window2;
114888
+ } };
114889
+ }
114890
+ function kb(bytes) {
114891
+ return Math.round(bytes / 1024);
114892
+ }
114893
+ function formatDirection(sample) {
114894
+ return `req:${sample.reqMessages}/${kb(sample.reqBytes)}kB,res:${sample.resMessages}/${kb(sample.resBytes)}kB,evt:${sample.evtMessages}/${kb(sample.evtBytes)}kB`;
114895
+ }
114896
+ function formatPeer(delta) {
114897
+ return `${delta.peerId}:tx=${delta.tx.reqMessages}/${delta.tx.resMessages}/${delta.tx.evtMessages}:rx=${delta.rx.reqMessages}/${delta.rx.resMessages}/${delta.rx.evtMessages}:kB=${kb(socketDirectionBytes(delta.tx))}/${kb(socketDirectionBytes(delta.rx))}`;
114898
+ }
114899
+ function formatSocketPlane(window2) {
114900
+ if (window2 === void 0) return "";
114901
+ const top = window2.top.map(formatPeer).join(",");
114902
+ return ` socketPeers=${window2.peersMeasured}/${window2.peersConnected} socketTx=${formatDirection(window2.tx)} socketRx=${formatDirection(window2.rx)}` + (top.length === 0 ? "" : ` socketTop=${top}`);
114903
+ }
114758
114904
  var DECISIVE_HEAP_SPACES = ["old_space", "large_object_space"];
114759
114905
  var HEAP_SPACE_REPORT_MIN_MB = 32;
114760
114906
  var BYTES_PER_MB = 1048576;
@@ -114968,6 +115114,7 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
114968
115114
  function startHeapWatch(label = HUB_MAIN_HEAP_WATCH_LABEL, sink = consoleSink, intervalMs = HEAP_WATCH_INTERVAL_MS, reclaimOptions, loopDelay = createLoopDelayMeter(), execArgv = process.execArgv, announceCeilingOrigin = true, rssBudget, probes) {
114969
115115
  const readSpaces = probes?.readSpaces ?? readHeapSpaces;
114970
115116
  const eventPlane = probes?.eventPlane === void 0 ? void 0 : createEventPlaneMeter(probes.eventPlane);
115117
+ const socketPlane = probes?.socketPlane === void 0 ? void 0 : createSocketPlaneMeter(probes.socketPlane);
114971
115118
  const readMemory = reclaimOptions?.readMemory ?? (() => process.memoryUsage());
114972
115119
  const now = reclaimOptions?.now ?? (() => Date.now());
114973
115120
  const triggerMb = reclaimOptions?.triggerMb ?? 1024;
@@ -115003,7 +115150,7 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
115003
115150
  return;
115004
115151
  }
115005
115152
  const after = read();
115006
- sink.info(`[mem] reclaim ${label} stranded=${strandedMb(sample)}MB rss=${sample.rssMb}MB\u2192${after.rssMb}MB freed=${sample.rssMb - after.rssMb}MB arrayBuffers=${sample.arrayBuffersMb}MB\u2192${after.arrayBuffersMb}MB took=${now() - startedAt}ms`);
115153
+ sink.info(`[mem] reclaim ${label} stranded=${strandedMb(sample)}MB rss=${sample.rssMb}MB\u2192${after.rssMb}MB freed=${sample.rssMb - after.rssMb}MB arrayBuffers=${sample.arrayBuffersMb}MB\u2192${after.arrayBuffersMb}MB took=${now() - startedAt}ms heapUsed=${sample.heapUsedMb}MB\u2192${after.heapUsedMb}MB`);
115007
115154
  if (passesAtFloor >= 6 && !steadyStateAnnounced) {
115008
115155
  steadyStateAnnounced = true;
115009
115156
  const nextFloorMs = reclaimIntervalMs(passesAtFloor, minIntervalMs, steadyStateIntervalMs);
@@ -115045,7 +115192,7 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
115045
115192
  const due = at - lastLoggedAt >= intervalMs;
115046
115193
  if (mode === "escalated" || due) {
115047
115194
  lastLoggedAt = at;
115048
- const line = format2(label, sample, loopDelay?.read(), budgetMb, `${formatHeapSpaces(readSpaces())}${formatEventPlane(eventPlane?.read())}`);
115195
+ const line = format2(label, sample, loopDelay?.read(), budgetMb, `${formatHeapSpaces(readSpaces())}${formatEventPlane(eventPlane?.read())}` + formatSocketPlane(socketPlane?.read()));
115049
115196
  if (sample.nearLimit) sink.warn(`${line} \u2014 APPROACHING HEAP LIMIT`);
115050
115197
  else if (mode === "escalated") sink.warn(`${line} \u2014 heap elevated, sampling every ${probeIntervalMs}ms`);
115051
115198
  else sink.info(line);
@@ -118259,6 +118406,33 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
118259
118406
  chunks = [];
118260
118407
  /** Sum of `chunks[i].byteLength` — tracked so length checks cost nothing. */
118261
118408
  buffered = 0;
118409
+ /** Backing store for {@link lastFrameBytes}; see that getter. */
118410
+ sizes = [];
118411
+ /**
118412
+ * On-the-wire byte length (4-byte prefix included) of each frame returned by
118413
+ * the most recent {@link push}, index-aligned with the returned array.
118414
+ *
118415
+ * It exists because the frames come back DECODED, and a decoded value has no
118416
+ * memory of how many bytes it cost — so a caller counting received bytes per
118417
+ * message kind (`SocketChannel`, feeding the `[mem]` line's per-peer socket
118418
+ * attribution) could otherwise only charge a whole `data` chunk, which may
118419
+ * hold several frames of different kinds, or half of one.
118420
+ *
118421
+ * **Only the first `frames.length` entries are meaningful**, and the array is
118422
+ * never truncated. That is deliberate and it was measured on Node 24.17:
118423
+ * `sizes.length = 0` + `push` costs **35.1–35.9 ns** per call — V8 shrinks the
118424
+ * backing store and the next call re-grows it — which is 3 % of
118425
+ * `FrameDecoder.push` itself and 15× the counter it feeds. Writing in place
118426
+ * costs **0.06–0.13 ns**. On a path that runs ~22 000 times a second, an
118427
+ * instrument may not be the most expensive thing on the line it measures.
118428
+ *
118429
+ * Read it immediately after the `push` that produced it — it is a window onto
118430
+ * the decoder, not a value. Safe because `push` is only ever driven by a
118431
+ * socket `data` event, which Node never delivers re-entrantly.
118432
+ */
118433
+ get lastFrameBytes() {
118434
+ return this.sizes;
118435
+ }
118262
118436
  push(chunk) {
118263
118437
  if (chunk.byteLength > 0) {
118264
118438
  this.chunks.push(chunk);
@@ -118276,6 +118450,7 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
118276
118450
  body = Buffer.allocUnsafeSlow(len);
118277
118451
  frame.copy(body, 0, HEADER_BYTES);
118278
118452
  } else body = frame.subarray(HEADER_BYTES);
118453
+ this.sizes[frames.length] = total;
118279
118454
  frames.push(decode(body));
118280
118455
  }
118281
118456
  return frames;
@@ -118355,6 +118530,11 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
118355
118530
  };
118356
118531
  closed = false;
118357
118532
  closeFired = false;
118533
+ /** Frames written to the peer, cumulative, split by kind. See
118534
+ * {@link readTraffic} and `transport/socket-traffic.ts`. */
118535
+ txCounters = createSocketDirectionCounters();
118536
+ /** Frames read from the peer, cumulative, split by kind. */
118537
+ rxCounters = createSocketDirectionCounters();
118358
118538
  constructor(socket) {
118359
118539
  this.socket = socket;
118360
118540
  socket.on("data", (chunk) => this.onData(chunk));
@@ -118422,14 +118602,41 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
118422
118602
  this.closed = true;
118423
118603
  this.socket.destroy();
118424
118604
  }
118605
+ /**
118606
+ * This channel's cumulative traffic, both directions, split by frame kind.
118607
+ *
118608
+ * Cumulative for the life of the channel: the reporting layer subtracts the
118609
+ * previous reading, because the question is a RATE ("which peer receives the
118610
+ * 22 500 writes/s") and not a total since boot.
118611
+ */
118612
+ readTraffic() {
118613
+ return {
118614
+ tx: sampleSocketDirection(this.txCounters),
118615
+ rx: sampleSocketDirection(this.rxCounters)
118616
+ };
118617
+ }
118425
118618
  send(frame) {
118426
118619
  if (this.closed) return;
118427
- this.socket.write(encodeFrame(frame));
118620
+ const encoded = encodeFrame(frame);
118621
+ recordSocketFrame(this.txCounters, frame.k, encoded.byteLength);
118622
+ this.socket.write(encoded);
118428
118623
  }
118429
118624
  onData(chunk) {
118430
- for (const f of this.decoder.push(chunk)) this.handleFrame(f);
118625
+ const frames = this.decoder.push(chunk);
118626
+ const sizes = this.decoder.lastFrameBytes;
118627
+ for (let i = 0; i < frames.length; i += 1) this.handleFrame(frames[i], sizes[i] ?? 0);
118431
118628
  }
118432
- async handleFrame(frame) {
118629
+ /**
118630
+ * `wireBytes` is the frame's on-the-wire length, counted HERE rather than in
118631
+ * `onData` on purpose: a peer that sends a frame this decoder can parse but
118632
+ * whose shape is not a `Frame` throws on `frame.k`, and inside this async
118633
+ * method that stays the rejected promise it has always been. Reading `.k`
118634
+ * one frame earlier, synchronously in the socket's `data` handler, would
118635
+ * turn the same malformed frame into an uncaught exception on the transport
118636
+ * — a diagnostic that can crash the process it watches.
118637
+ */
118638
+ async handleFrame(frame, wireBytes) {
118639
+ recordSocketFrame(this.rxCounters, frame.k, wireBytes);
118433
118640
  if (frame.k === "req") {
118434
118641
  try {
118435
118642
  const result = await this.requestHandler(frame.body);
@@ -119150,6 +119357,22 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
119150
119357
  };
119151
119358
  }
119152
119359
  /**
119360
+ * This child's socket traffic — bytes and messages, both directions, split by
119361
+ * frame kind — or `null` when the child is gone or its channel keeps no
119362
+ * counters (an in-process or test transport).
119363
+ *
119364
+ * The event counters above cover ONE kind of frame and, once surfaced on
119365
+ * 2026-08-29, accounted for 4% of hub-main's ~44 000 socket syscalls/s. This
119366
+ * is the same question asked of every frame the channel moves, and it is the
119367
+ * only per-peer attribution that exists: `/proc` reports one `rchar`/`wchar`
119368
+ * pair for the whole process and has no per-socket breakdown.
119369
+ */
119370
+ getChildSocketTraffic(childId) {
119371
+ const entry = this.children.get(childId);
119372
+ if (entry === void 0) return null;
119373
+ return entry.channel.readTraffic?.() ?? null;
119374
+ }
119375
+ /**
119153
119376
  * The regime the counters above were produced under, read once from
119154
119377
  * `CAMSTACK_UDS_EVENT_FANOUT` at construction.
119155
119378
  *
@@ -121645,6 +121868,18 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
121645
121868
  return DeviceRegistry;
121646
121869
  }
121647
121870
  });
121871
+ Object.defineProperty(exports, "EMPTY_SOCKET_DIRECTION", {
121872
+ enumerable: true,
121873
+ get: function() {
121874
+ return EMPTY_SOCKET_DIRECTION;
121875
+ }
121876
+ });
121877
+ Object.defineProperty(exports, "EMPTY_SOCKET_PLANE_BASELINE", {
121878
+ enumerable: true,
121879
+ get: function() {
121880
+ return EMPTY_SOCKET_PLANE_BASELINE;
121881
+ }
121882
+ });
121648
121883
  Object.defineProperty(exports, "EVENT_PLANE_TOP_N", {
121649
121884
  enumerable: true,
121650
121885
  get: function() {
@@ -121777,6 +122012,12 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
121777
122012
  return RUNNER_RSS_BUDGET_ENV;
121778
122013
  }
121779
122014
  });
122015
+ Object.defineProperty(exports, "SOCKET_PLANE_TOP_N", {
122016
+ enumerable: true,
122017
+ get: function() {
122018
+ return SOCKET_PLANE_TOP_N;
122019
+ }
122020
+ });
121780
122021
  Object.defineProperty(exports, "SocketChannel", {
121781
122022
  enumerable: true,
121782
122023
  get: function() {
@@ -121975,6 +122216,24 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
121975
122216
  return createParentUnownedCallHandler;
121976
122217
  }
121977
122218
  });
122219
+ Object.defineProperty(exports, "createSocketDirectionCounters", {
122220
+ enumerable: true,
122221
+ get: function() {
122222
+ return createSocketDirectionCounters;
122223
+ }
122224
+ });
122225
+ Object.defineProperty(exports, "createSocketPlaneMeter", {
122226
+ enumerable: true,
122227
+ get: function() {
122228
+ return createSocketPlaneMeter;
122229
+ }
122230
+ });
122231
+ Object.defineProperty(exports, "createSocketPlaneReader", {
122232
+ enumerable: true,
122233
+ get: function() {
122234
+ return createSocketPlaneReader;
122235
+ }
122236
+ });
121978
122237
  Object.defineProperty(exports, "createUdsAddonContext", {
121979
122238
  enumerable: true,
121980
122239
  get: function() {
@@ -122029,6 +122288,12 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
122029
122288
  return diffEventPlane;
122030
122289
  }
122031
122290
  });
122291
+ Object.defineProperty(exports, "diffSocketPlane", {
122292
+ enumerable: true,
122293
+ get: function() {
122294
+ return diffSocketPlane;
122295
+ }
122296
+ });
122032
122297
  Object.defineProperty(exports, "emitHeapDiagnosticReport", {
122033
122298
  enumerable: true,
122034
122299
  get: function() {
@@ -122053,6 +122318,12 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
122053
122318
  return formatHeapSpaces;
122054
122319
  }
122055
122320
  });
122321
+ Object.defineProperty(exports, "formatSocketPlane", {
122322
+ enumerable: true,
122323
+ get: function() {
122324
+ return formatSocketPlane;
122325
+ }
122326
+ });
122056
122327
  Object.defineProperty(exports, "getBrokerEventBus", {
122057
122328
  enumerable: true,
122058
122329
  get: function() {
@@ -122191,6 +122462,12 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
122191
122462
  return reclaimIntervalMs;
122192
122463
  }
122193
122464
  });
122465
+ Object.defineProperty(exports, "recordSocketFrame", {
122466
+ enumerable: true,
122467
+ get: function() {
122468
+ return recordSocketFrame;
122469
+ }
122470
+ });
122194
122471
  Object.defineProperty(exports, "registerEventBusService", {
122195
122472
  enumerable: true,
122196
122473
  get: function() {
@@ -122221,6 +122498,12 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
122221
122498
  return runNpm;
122222
122499
  }
122223
122500
  });
122501
+ Object.defineProperty(exports, "sampleSocketDirection", {
122502
+ enumerable: true,
122503
+ get: function() {
122504
+ return sampleSocketDirection;
122505
+ }
122506
+ });
122224
122507
  Object.defineProperty(exports, "selectReportedSpaces", {
122225
122508
  enumerable: true,
122226
122509
  get: function() {
@@ -122257,6 +122540,18 @@ var require_manifest_python_deps_COeSr7el = __commonJS({
122257
122540
  return shouldReclaim;
122258
122541
  }
122259
122542
  });
122543
+ Object.defineProperty(exports, "socketDirectionBytes", {
122544
+ enumerable: true,
122545
+ get: function() {
122546
+ return socketDirectionBytes;
122547
+ }
122548
+ });
122549
+ Object.defineProperty(exports, "socketDirectionMessages", {
122550
+ enumerable: true,
122551
+ get: function() {
122552
+ return socketDirectionMessages;
122553
+ }
122554
+ });
122260
122555
  Object.defineProperty(exports, "startHeapWatch", {
122261
122556
  enumerable: true,
122262
122557
  get: function() {
@@ -126121,7 +126416,7 @@ var require_dist3 = __commonJS({
126121
126416
  var require_builtins_winston_logging_index = require_winston_logging();
126122
126417
  var require_file_data_plane = require_file_data_plane_DO8KbxCe();
126123
126418
  var require_tls$1 = require_tls_BxQlomxd();
126124
- var require_manifest_python_deps = require_manifest_python_deps_COeSr7el();
126419
+ var require_manifest_python_deps = require_manifest_python_deps_w48vOhGR();
126125
126420
  var require_resource_monitor = require_resource_monitor_CdnzxBLP();
126126
126421
  var require_custom_action_registry = require_custom_action_registry_jY0NOZK8();
126127
126422
  var zod = require_zod();
@@ -206502,6 +206797,8 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
206502
206797
  exports.DeviceManagerAddon = require_builtins_device_manager_device_manager_addon.DeviceManagerAddon;
206503
206798
  exports.DeviceRegistry = require_manifest_python_deps.DeviceRegistry;
206504
206799
  exports.DeviceStore = require_builtins_sqlite_storage_index.DeviceStore$1;
206800
+ exports.EMPTY_SOCKET_DIRECTION = require_manifest_python_deps.EMPTY_SOCKET_DIRECTION;
206801
+ exports.EMPTY_SOCKET_PLANE_BASELINE = require_manifest_python_deps.EMPTY_SOCKET_PLANE_BASELINE;
206505
206802
  exports.EVENT_PLANE_TOP_N = require_manifest_python_deps.EVENT_PLANE_TOP_N;
206506
206803
  exports.EVENT_TOPIC_PREFIX = require_manifest_python_deps.EVENT_TOPIC_PREFIX;
206507
206804
  exports.EngineManagerResolver = EngineManagerResolver;
@@ -206575,6 +206872,7 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
206575
206872
  exports.ReplEngine = ReplEngine;
206576
206873
  exports.RingBuffer = RingBuffer;
206577
206874
  exports.SERVER_AUTH_OID = require_tls$1.SERVER_AUTH_OID;
206875
+ exports.SOCKET_PLANE_TOP_N = require_manifest_python_deps.SOCKET_PLANE_TOP_N;
206578
206876
  exports.ScopedLogger = ScopedLogger;
206579
206877
  exports.ScopedTokenManager = require_builtins_local_auth_local_auth_addon.ScopedTokenManager;
206580
206878
  exports.SocketChannel = require_manifest_python_deps.SocketChannel;
@@ -206660,6 +206958,9 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
206660
206958
  exports.createReadinessService = createReadinessService;
206661
206959
  exports.createReadinessServiceForRegistry = createReadinessServiceForRegistry;
206662
206960
  exports.createScopedProcessManager = createScopedProcessManager;
206961
+ exports.createSocketDirectionCounters = require_manifest_python_deps.createSocketDirectionCounters;
206962
+ exports.createSocketPlaneMeter = require_manifest_python_deps.createSocketPlaneMeter;
206963
+ exports.createSocketPlaneReader = require_manifest_python_deps.createSocketPlaneReader;
206663
206964
  exports.createStreamProbeBrokerService = createStreamProbeBrokerService;
206664
206965
  exports.createUdsAddonContext = require_manifest_python_deps.createUdsAddonContext;
206665
206966
  exports.createUdsEventBridge = require_manifest_python_deps.createUdsEventBridge;
@@ -206673,6 +206974,7 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
206673
206974
  exports.describeRss = require_manifest_python_deps.describeRss;
206674
206975
  exports.detectWorkspacePackagesDir = detectWorkspacePackagesDir;
206675
206976
  exports.diffEventPlane = require_manifest_python_deps.diffEventPlane;
206977
+ exports.diffSocketPlane = require_manifest_python_deps.diffSocketPlane;
206676
206978
  Object.defineProperty(exports, "downloadBinary", {
206677
206979
  enumerable: true,
206678
206980
  get: function() {
@@ -206720,6 +207022,7 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
206720
207022
  exports.formatEventPlane = require_manifest_python_deps.formatEventPlane;
206721
207023
  exports.formatHeapSpaces = require_manifest_python_deps.formatHeapSpaces;
206722
207024
  exports.formatLogLine = require_formatter.formatLogLine;
207025
+ exports.formatSocketPlane = require_manifest_python_deps.formatSocketPlane;
206723
207026
  exports.getBrokerEventBus = require_manifest_python_deps.getBrokerEventBus;
206724
207027
  exports.getCapUsageRegistry = require_manifest_python_deps.getCapUsageRegistry;
206725
207028
  Object.defineProperty(exports, "getFfmpegDownloadUrl", {
@@ -206799,6 +207102,7 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
206799
207102
  exports.readTlsMode = require_tls$1.readTlsMode;
206800
207103
  exports.readinessKey = require_dist10.readinessKey;
206801
207104
  exports.reclaimIntervalMs = require_manifest_python_deps.reclaimIntervalMs;
207105
+ exports.recordSocketFrame = require_manifest_python_deps.recordSocketFrame;
206802
207106
  exports.registerEventBusService = require_manifest_python_deps.registerEventBusService;
206803
207107
  exports.registerLanHttpHandler = require_tls$1.registerLanHttpHandler;
206804
207108
  exports.reissueTlsLeaf = require_tls$1.reissueTlsLeaf;
@@ -206807,6 +207111,7 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
206807
207111
  exports.resolveNpmInvocation = require_manifest_python_deps.resolveNpmInvocation;
206808
207112
  exports.runHubAddonBoot = runHubAddonBoot;
206809
207113
  exports.runNpm = require_manifest_python_deps.runNpm;
207114
+ exports.sampleSocketDirection = require_manifest_python_deps.sampleSocketDirection;
206810
207115
  exports.scheduleSelfRestart = scheduleSelfRestart;
206811
207116
  exports.scopeKey = require_dist10.scopeKey;
206812
207117
  exports.scopesAllowAddon = require_dist10.scopesAllowAddon;
@@ -206817,6 +207122,8 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
206817
207122
  exports.setHubConnected = require_manifest_python_deps.setHubConnected;
206818
207123
  exports.setNodeEventInterest = require_manifest_python_deps.setNodeEventInterest;
206819
207124
  exports.shouldReclaim = require_manifest_python_deps.shouldReclaim;
207125
+ exports.socketDirectionBytes = require_manifest_python_deps.socketDirectionBytes;
207126
+ exports.socketDirectionMessages = require_manifest_python_deps.socketDirectionMessages;
206820
207127
  exports.startHeapWatch = require_manifest_python_deps.startHeapWatch;
206821
207128
  exports.startRunnerHeapWatch = require_manifest_python_deps.startRunnerHeapWatch;
206822
207129
  exports.strandedMb = require_manifest_python_deps.strandedMb;
@@ -421823,6 +422130,17 @@ var require_main4 = __commonJS({
421823
422130
  return broker === void 0 ? null : (0, system_1.getMoleculerEventStats)(broker);
421824
422131
  },
421825
422132
  crossNodeMode: () => (0, system_1.readMoleculerFanoutMode)()
422133
+ }),
422134
+ // The fan-out counters above answered their own question and sharpened
422135
+ // this one: the event plane is 4% of this process's ~44 000 socket
422136
+ // syscalls/s. The other 96% had no instrument — `/proc` reports one
422137
+ // rchar/wchar pair per PROCESS and has no per-socket breakdown, so the
422138
+ // best attribution available was a correlation with `hub/pipeline-
422139
+ // analytics` computed from a runner whose rchar also counts page-cache
422140
+ // reads. These counters live on the channel itself, so the attribution is
422141
+ // per peer and per frame kind. Same lazy registry, same reason.
422142
+ socketPlane: (0, system_1.createSocketPlaneReader)({
422143
+ registry: () => moleculerForEventPlane?.childRegistry ?? null
421826
422144
  })
421827
422145
  });
421828
422146
  cleanupOrphanProcesses();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstack",
3
- "version": "1.2.60",
3
+ "version": "1.2.61",
4
4
  "description": "CLI tool for managing and running CamStack server",
5
5
  "keywords": [
6
6
  "camstack",