camstack 1.2.140 → 1.2.141

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-TQKCEWPV.js");
41
+ await import("./launcher-VU6P7QP5.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-TQKCEWPV.js");
86
+ await import("./launcher-VU6P7QP5.js");
87
87
  }
88
88
 
89
89
  // src/commands/setup.ts
@@ -531,6 +531,7 @@ async function deployAddon(addonPath, opts) {
531
531
  targets.push({ label: "hub" });
532
532
  }
533
533
  const outcomes = [];
534
+ let propagating = false;
534
535
  for (const t of targets) {
535
536
  console.log(`[camstack] \u2192 Deploying ${path2.basename(tgzPath)} to ${t.label}...`);
536
537
  const result = await withNetworkRetry(
@@ -553,6 +554,7 @@ async function deployAddon(addonPath, opts) {
553
554
  console.error(`[camstack] \u2717 ${t.label}: ${misrouted}`);
554
555
  outcomes.push({ target: t.label, ok: false, detail: misrouted });
555
556
  } else if (result.success) {
557
+ if (result.propagatingToAgentsInBackground === true) propagating = true;
556
558
  const { detail, warning } = describeDeployOutcome(result, t.nodeId !== void 0);
557
559
  console.log(`[camstack] \u2713 ${t.label}: ${detail}`);
558
560
  if (warning) console.warn(`[camstack] \u26A0 ${t.label}: ${warning}`);
@@ -569,6 +571,14 @@ async function deployAddon(addonPath, opts) {
569
571
  process.exit(1);
570
572
  }
571
573
  console.log(`[camstack] \u2713 Deployed to ${outcomes.length} target(s)`);
574
+ if (propagating) {
575
+ console.log(
576
+ "[camstack] \u2026 agents are updated in the BACKGROUND and are NOT covered by the \u2713 above."
577
+ );
578
+ console.log(
579
+ "[camstack] Confirm with: hub log line `propagation done` (per-agent success/error)."
580
+ );
581
+ }
572
582
  if (opts.verify !== false) {
573
583
  process.stdout.write("[camstack] Verifying hub health");
574
584
  const healthy = await verifyHubHealthy(opts.serverUrl, { attempts: 20, delayMs: 1500 });
@@ -121242,9 +121242,9 @@ var require_dist2 = __commonJS({
121242
121242
  }
121243
121243
  });
121244
121244
 
121245
- // ../system/dist/manifest-system-deps-DfpwaXkh.js
121246
- var require_manifest_system_deps_DfpwaXkh = __commonJS({
121247
- "../system/dist/manifest-system-deps-DfpwaXkh.js"(exports) {
121245
+ // ../system/dist/manifest-system-deps-YYKKCKSF.js
121246
+ var require_manifest_system_deps_YYKKCKSF = __commonJS({
121247
+ "../system/dist/manifest-system-deps-YYKKCKSF.js"(exports) {
121248
121248
  "use strict";
121249
121249
  var require_chunk = require_chunk_Cek0wNdY();
121250
121250
  require_hub_cap_forward_DmHNjbB0();
@@ -121294,7 +121294,9 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
121294
121294
  childrenConnected: listed.length,
121295
121295
  childrenUndeclared: registry.undeclaredChildCount(),
121296
121296
  crossNodeDelivered: crossNode?.delivered ?? 0,
121297
- crossNodeSuppressed: crossNode?.suppressed ?? 0
121297
+ crossNodeSuppressed: crossNode?.suppressed ?? 0,
121298
+ categories: registry.categoryFanout(),
121299
+ categoryOverflow: registry.categoryCensusOverflow()
121298
121300
  };
121299
121301
  } catch {
121300
121302
  return;
@@ -121304,8 +121306,10 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
121304
121306
  var EVENT_PLANE_TOP_N = 5;
121305
121307
  var EMPTY_EVENT_PLANE_BASELINE = {
121306
121308
  children: /* @__PURE__ */ new Map(),
121309
+ categories: /* @__PURE__ */ new Map(),
121307
121310
  crossNodeDelivered: 0,
121308
- crossNodeSuppressed: 0
121311
+ crossNodeSuppressed: 0,
121312
+ categoryOverflow: 0
121309
121313
  };
121310
121314
  function diffEventPlane(baseline, current, topN = 5) {
121311
121315
  const deltas = [];
@@ -121323,6 +121327,23 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
121323
121327
  suppressed
121324
121328
  });
121325
121329
  }
121330
+ const categoryDeltas = [];
121331
+ let categoryBroadcasts = 0;
121332
+ let orphanBroadcasts = 0;
121333
+ for (const sample of current.categories) {
121334
+ const before = baseline.categories.get(sample.category);
121335
+ const broadcasts = Math.max(0, sample.broadcasts - (before?.broadcasts ?? 0));
121336
+ if (broadcasts === 0) continue;
121337
+ const wanted = Math.max(0, sample.wanted - (before?.wanted ?? 0));
121338
+ categoryBroadcasts += broadcasts;
121339
+ if (wanted === 0) orphanBroadcasts += broadcasts;
121340
+ categoryDeltas.push({
121341
+ category: sample.category,
121342
+ broadcasts,
121343
+ wanted
121344
+ });
121345
+ }
121346
+ const byBroadcasts = categoryDeltas.toSorted((a, b) => b.broadcasts - a.broadcasts || a.category.localeCompare(b.category));
121326
121347
  return {
121327
121348
  udsMode: current.udsMode,
121328
121349
  crossNodeMode: current.crossNodeMode,
@@ -121332,7 +121353,12 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
121332
121353
  fanoutSuppressed,
121333
121354
  crossNodeDelivered: Math.max(0, current.crossNodeDelivered - baseline.crossNodeDelivered),
121334
121355
  crossNodeSuppressed: Math.max(0, current.crossNodeSuppressed - baseline.crossNodeSuppressed),
121335
- top: deltas.toSorted((a, b) => b.sent - a.sent || a.childId.localeCompare(b.childId)).slice(0, topN)
121356
+ top: deltas.toSorted((a, b) => b.sent - a.sent || a.childId.localeCompare(b.childId)).slice(0, topN),
121357
+ categoryBroadcasts,
121358
+ orphanBroadcasts,
121359
+ topCategories: byBroadcasts.slice(0, topN),
121360
+ topOrphans: byBroadcasts.filter((c) => c.wanted === 0).slice(0, topN),
121361
+ categoryOverflow: Math.max(0, current.categoryOverflow - baseline.categoryOverflow)
121336
121362
  };
121337
121363
  }
121338
121364
  function createEventPlaneMeter(reader, topN = 5) {
@@ -121343,8 +121369,10 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
121343
121369
  const window2 = diffEventPlane(baseline, current, topN);
121344
121370
  baseline = {
121345
121371
  children: new Map(current.children.map((s) => [s.childId, s])),
121372
+ categories: new Map(current.categories.map((c) => [c.category, c])),
121346
121373
  crossNodeDelivered: current.crossNodeDelivered,
121347
- crossNodeSuppressed: current.crossNodeSuppressed
121374
+ crossNodeSuppressed: current.crossNodeSuppressed,
121375
+ categoryOverflow: current.categoryOverflow
121348
121376
  };
121349
121377
  return window2;
121350
121378
  } };
@@ -121352,7 +121380,9 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
121352
121380
  function formatEventPlane(window2) {
121353
121381
  if (window2 === void 0) return "";
121354
121382
  const top = window2.top.map((d) => `${d.childId}:${d.sent}/${d.suppressed}`).join(",");
121355
- 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}`);
121383
+ const cats = window2.topCategories.map((c) => `${c.category}:${c.broadcasts}/${c.wanted}`).join(",");
121384
+ const orphans = window2.topOrphans.map((c) => `${c.category}:${c.broadcasts}`).join(",");
121385
+ 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} fanoutEvents=${window2.categoryBroadcasts} fanoutOrphans=${window2.orphanBroadcasts} fanoutCatsDropped=${window2.categoryOverflow}` + (top.length === 0 ? "" : ` fanoutTop=${top}`) + (cats.length === 0 ? "" : ` fanoutCats=${cats}`) + (orphans.length === 0 ? "" : ` fanoutOrphanTop=${orphans}`);
121356
121386
  }
121357
121387
  var EMPTY_CAP_ACTION_READING = /* @__PURE__ */ new Map();
121358
121388
  var CAP_ACTION_UNLABELLED = "(unlabelled)";
@@ -126423,6 +126453,12 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
126423
126453
  fanoutMode = readFanoutMode();
126424
126454
  /** Per-child event fan-out counters (sent / suppressed). */
126425
126455
  childEventStats = /* @__PURE__ */ new Map();
126456
+ /** D467: per-category production census (cumulative). See {@link CategoryFanoutSample}. */
126457
+ categoryStats = /* @__PURE__ */ new Map();
126458
+ /** Broadcasts whose category did not fit in {@link CATEGORY_CENSUS_MAX}. */
126459
+ categoryOverflow = 0;
126460
+ /** One INFO line the first time the census cap trips, never per event. */
126461
+ categoryOverflowLogged = false;
126426
126462
  /** Last pattern-set string logged per child, to dedup the INFO line. */
126427
126463
  loggedPatternSet = /* @__PURE__ */ new Map();
126428
126464
  /**
@@ -126478,6 +126514,25 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
126478
126514
  };
126479
126515
  }
126480
126516
  /**
126517
+ * D467: every category this node has broadcast, with its emit count and how
126518
+ * many child subscriptions matched. Cumulative for the life of the process —
126519
+ * the heartbeat differences it, the same discipline as the per-child
126520
+ * counters. Largest `broadcasts` first.
126521
+ */
126522
+ categoryFanout() {
126523
+ const out = [];
126524
+ for (const [category, s] of this.categoryStats) out.push({
126525
+ category,
126526
+ broadcasts: s.broadcasts,
126527
+ wanted: s.wanted
126528
+ });
126529
+ return out.toSorted((a, b) => b.broadcasts - a.broadcasts || a.category.localeCompare(b.category));
126530
+ }
126531
+ /** Broadcasts the census could not attribute because it was full (cumulative). */
126532
+ categoryCensusOverflow() {
126533
+ return this.categoryOverflow;
126534
+ }
126535
+ /**
126481
126536
  * This child's socket traffic — bytes and messages, both directions, split by
126482
126537
  * frame kind — or `null` when the child is gone or its channel keeps no
126483
126538
  * counters (an in-process or test transport).
@@ -126568,6 +126623,17 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
126568
126623
  */
126569
126624
  childWantsEvent(entry, category) {
126570
126625
  if (this.fanoutMode === "broadcast") return true;
126626
+ return this.childSubscribesTo(entry, category);
126627
+ }
126628
+ /**
126629
+ * The SUBSCRIPTION answer alone, with no fan-out-mode override.
126630
+ *
126631
+ * {@link childWantsEvent} answers "will this child be sent the event", which
126632
+ * under `broadcast` is `true` for everything and therefore cannot say whether
126633
+ * anyone actually asked. The D467 census needs the second question, so the
126634
+ * two are separate functions and `broadcast` mode overrides only the first.
126635
+ */
126636
+ childSubscribesTo(entry, category) {
126571
126637
  if (entry.eventPatterns === null) return true;
126572
126638
  return entry.eventPatterns.some((p) => matchesPattern(p, category));
126573
126639
  }
@@ -126870,8 +126936,10 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
126870
126936
  event,
126871
126937
  sourceNodeId
126872
126938
  };
126939
+ let subscribed = 0;
126873
126940
  for (const entry of this.children.values()) {
126874
126941
  if (entry.childId === exceptChildId) continue;
126942
+ if (this.childSubscribesTo(entry, event.category)) subscribed += 1;
126875
126943
  const wants = this.childWantsEvent(entry, event.category);
126876
126944
  const stats = this.statsFor(entry.childId);
126877
126945
  if (!wants) stats.suppressed++;
@@ -126880,6 +126948,34 @@ var require_manifest_system_deps_DfpwaXkh = __commonJS({
126880
126948
  entry.channel.emit(msg);
126881
126949
  }
126882
126950
  }
126951
+ this.recordCategoryBroadcast(event.category, subscribed);
126952
+ }
126953
+ /**
126954
+ * Record one PRODUCED event against its category. Called once per broadcast,
126955
+ * outside the per-child loop, because production is what the census measures.
126956
+ */
126957
+ recordCategoryBroadcast(category, subscribed) {
126958
+ const existing = this.categoryStats.get(category);
126959
+ if (existing !== void 0) {
126960
+ existing.broadcasts += 1;
126961
+ existing.wanted += subscribed;
126962
+ return;
126963
+ }
126964
+ if (this.categoryStats.size >= 256) {
126965
+ this.categoryOverflow += 1;
126966
+ if (!this.categoryOverflowLogged) {
126967
+ this.categoryOverflowLogged = true;
126968
+ this.logger?.info("event category census full \u2014 further new categories are unattributed", {
126969
+ max: 256,
126970
+ firstDropped: category
126971
+ });
126972
+ }
126973
+ return;
126974
+ }
126975
+ this.categoryStats.set(category, {
126976
+ broadcasts: 1,
126977
+ wanted: subscribed
126978
+ });
126883
126979
  }
126884
126980
  /**
126885
126981
  * E2: Send a `set-log-level` control message to a specific child.
@@ -134414,7 +134510,7 @@ var require_dist3 = __commonJS({
134414
134510
  var require_builtins_winston_logging_index = require_winston_logging();
134415
134511
  var require_event_loop_stall_monitor = require_event_loop_stall_monitor_CAsHdMwP();
134416
134512
  var require_tls$1 = require_tls_BFs4PzoW();
134417
- var require_manifest_system_deps = require_manifest_system_deps_DfpwaXkh();
134513
+ var require_manifest_system_deps = require_manifest_system_deps_YYKKCKSF();
134418
134514
  var require_resource_monitor = require_resource_monitor_LVE1BoLs();
134419
134515
  var require_custom_action_registry = require_custom_action_registry_DvVMHLfJ();
134420
134516
  var zod = require_zod();
@@ -199117,8 +199213,9 @@ ${originalIndentation}`;
199117
199213
  const type2 = resolvePacketType(packet[5]);
199118
199214
  this.emit("data", type2, msg);
199119
199215
  const rest = packet.slice(length);
199120
- this.bufs = rest.length > 0 ? [rest] : [];
199121
- this.bufLen = rest.length;
199216
+ const carried = rest.length > 0 && rest.length * 8 < rest.buffer.byteLength ? Buffer.from(rest) : rest;
199217
+ this.bufs = carried.length > 0 ? [carried] : [];
199218
+ this.bufLen = carried.length;
199122
199219
  }
199123
199220
  cb();
199124
199221
  }
@@ -357688,8 +357785,10 @@ var require_parser2 = __commonJS({
357688
357785
  const type = resolvePacketType(packet[5]);
357689
357786
  this.emit("data", type, msg);
357690
357787
  const rest = packet.slice(length);
357691
- this.bufs = rest.length > 0 ? [rest] : [];
357692
- this.bufLen = rest.length;
357788
+ const pinsTooMuch = rest.length > 0 && rest.length * 8 < rest.buffer.byteLength;
357789
+ const carried = pinsTooMuch ? Buffer.from(rest) : rest;
357790
+ this.bufs = carried.length > 0 ? [carried] : [];
357791
+ this.bufLen = carried.length;
357693
357792
  }
357694
357793
  cb();
357695
357794
  }
@@ -414053,7 +414152,7 @@ var require_agent_addon_delivery = __commonJS({
414053
414152
  exports.AGENT_RELOAD_TIMEOUT_MS = exports.AGENT_DEPLOY_CONTROL_TIMEOUT_MS = void 0;
414054
414153
  exports.isAgentDeployResponse = isAgentDeployResponse;
414055
414154
  exports.deliverAddonToAgent = deliverAddonToAgent;
414056
- exports.AGENT_DEPLOY_CONTROL_TIMEOUT_MS = 3e4;
414155
+ exports.AGENT_DEPLOY_CONTROL_TIMEOUT_MS = 3e5;
414057
414156
  exports.AGENT_RELOAD_TIMEOUT_MS = 6e4;
414058
414157
  function isAgentDeployResponse(value) {
414059
414158
  if (value === null || typeof value !== "object")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstack",
3
- "version": "1.2.140",
3
+ "version": "1.2.141",
4
4
  "description": "CLI tool for managing and running CamStack server",
5
5
  "keywords": [
6
6
  "camstack",