@camstack/addon-pipeline 1.2.136 → 1.2.137

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.
Files changed (41) hide show
  1. package/dist/{addon-utils-CKf8kbwh.js → addon-utils-C6b5Tnia.js} +3 -3
  2. package/dist/audio-analyzer/index.js +5 -5
  3. package/dist/audio-analyzer/index.mjs +4 -4
  4. package/dist/detection-pipeline/index.js +55 -17
  5. package/dist/detection-pipeline/index.mjs +53 -15
  6. package/dist/{dist-BzLiQ8Ue.js → dist-4EMKvxCp.js} +275 -25
  7. package/dist/{dist-C1dXLLQq.mjs → dist-g0Or5_pR.mjs} +270 -26
  8. package/dist/{event-loop-stall-monitor-CU-xxX5c.mjs → event-loop-stall-monitor-CskL9Lgu.mjs} +1 -1
  9. package/dist/{event-loop-stall-monitor-DjV4Bow7.js → event-loop-stall-monitor-DDm07Ei6.js} +1 -1
  10. package/dist/{lazy-sharp-DxWmhTqk.js → lazy-sharp-BlA9PxWk.js} +3 -3
  11. package/dist/motion-wasm/index.js +3 -3
  12. package/dist/motion-wasm/index.mjs +3 -3
  13. package/dist/node-BOHn8gpk.js +721 -0
  14. package/dist/node-Bo1g8hLO.mjs +690 -0
  15. package/dist/pipeline-runner/index.js +37 -11
  16. package/dist/pipeline-runner/index.mjs +37 -11
  17. package/dist/{process-memory-CZK3D3kM.js → process-memory-C3084DOt.js} +2 -2
  18. package/dist/{process-memory-CaEwi5Cd.mjs → process-memory-DmrHWybb.mjs} +2 -2
  19. package/dist/recorder/index.js +36 -4
  20. package/dist/recorder/index.mjs +36 -4
  21. package/dist/{segment-demux-js-BbpqygHL.js → segment-demux-js-BrQ_A0oi.js} +1 -1
  22. package/dist/{segment-demux-js-njRO85gd.mjs → segment-demux-js-C-a2pghM.mjs} +1 -1
  23. package/dist/session-decode/decode-worker-child.js +2 -2
  24. package/dist/session-decode/decode-worker-child.mjs +2 -2
  25. package/dist/stream-broker/_stub.js +2 -2
  26. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-CLtMmF1E.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-AH6OJ3hJ.mjs} +3 -3
  27. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CQyiEd0l.mjs +26 -0
  28. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BrTM_tsb.mjs +26 -0
  29. package/dist/stream-broker/demux-worker-child.js +1 -1
  30. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  31. package/dist/stream-broker/{hostInit-CP7Xhd8J.mjs → hostInit-XNyn-FTM.mjs} +3 -3
  32. package/dist/stream-broker/index.js +88 -515
  33. package/dist/stream-broker/index.mjs +85 -510
  34. package/dist/stream-broker/remoteEntry.js +1 -1
  35. package/dist/{worker-protocol-DvTZBvh2.js → worker-protocol-BLfaD5uC.js} +1 -1
  36. package/dist/{worker-protocol-DxsVx0G7.mjs → worker-protocol-vc8WWhjx.mjs} +1 -1
  37. package/package.json +13 -1
  38. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DqplWP1i.mjs +0 -26
  39. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DKMXG57X.mjs +0 -26
  40. package/dist/{addon-utils-CgBCF-mE.mjs → addon-utils-C8KTuPdE.mjs} +2 -2
  41. package/dist/{lazy-sharp-BtT5x-qP.mjs → lazy-sharp-DXsqwpph.mjs} +1 -1
@@ -1,9 +1,9 @@
1
- const require_dist = require("./dist-BzLiQ8Ue.js");
1
+ const require_dist = require("./dist-4EMKvxCp.js");
2
2
  require("node:crypto");
3
- let node_path = require("node:path");
4
- node_path = require_dist.__toESM(node_path, 1);
5
3
  let node_fs = require("node:fs");
6
4
  node_fs = require_dist.__toESM(node_fs, 1);
5
+ let node_path = require("node:path");
6
+ node_path = require_dist.__toESM(node_path, 1);
7
7
  let node_util = require("node:util");
8
8
  let node_zlib = require("node:zlib");
9
9
  //#region ../system/dist/file-data-plane-BhKdxJgf.mjs
@@ -2,13 +2,13 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-BzLiQ8Ue.js");
6
- const require_process_memory = require("../process-memory-CZK3D3kM.js");
7
- const require_addon_utils = require("../addon-utils-CKf8kbwh.js");
8
- let node_path = require("node:path");
9
- node_path = require_dist.__toESM(node_path);
5
+ const require_dist = require("../dist-4EMKvxCp.js");
6
+ const require_process_memory = require("../process-memory-C3084DOt.js");
7
+ const require_addon_utils = require("../addon-utils-C6b5Tnia.js");
10
8
  let node_fs = require("node:fs");
11
9
  node_fs = require_dist.__toESM(node_fs);
10
+ let node_path = require("node:path");
11
+ node_path = require_dist.__toESM(node_path);
12
12
  //#region src/audio-analyzer/audio-pipeline.ts
13
13
  /**
14
14
  * Create the appropriate audio pipeline.
@@ -1,9 +1,9 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { A as audioAnalysisCapability, Nt as hydrateSchema, Ot as BaseAddon, S as PoolMemoryWatchdog, St as errMsg, et as mapAudioLabelToMacro, ht as resolvePoolMemoryPolicy, j as audioAnalyzerCapability, n as AUDIO_BACKEND_CHOICES, s as DEFAULT_AUDIO_ANALYZER_CONFIG, v as HF_BASE_URL } from "../dist-C1dXLLQq.mjs";
3
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CaEwi5Cd.mjs";
4
- import { i as downloadFile } from "../addon-utils-CgBCF-mE.mjs";
5
- import * as path$1 from "node:path";
2
+ import { A as audioAnalysisCapability, Ct as errMsg, Pt as hydrateSchema, S as PoolMemoryWatchdog, gt as resolvePoolMemoryPolicy, j as audioAnalyzerCapability, kt as BaseAddon, n as AUDIO_BACKEND_CHOICES, s as DEFAULT_AUDIO_ANALYZER_CONFIG, tt as mapAudioLabelToMacro, v as HF_BASE_URL } from "../dist-g0Or5_pR.mjs";
3
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DmrHWybb.mjs";
4
+ import { i as downloadFile } from "../addon-utils-C8KTuPdE.mjs";
6
5
  import * as fs from "node:fs";
6
+ import * as path$1 from "node:path";
7
7
  //#region src/audio-analyzer/audio-pipeline.ts
8
8
  /**
9
9
  * Create the appropriate audio pipeline.
@@ -2,20 +2,21 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-BzLiQ8Ue.js");
6
- const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-DjV4Bow7.js");
7
- const require_lazy_sharp = require("../lazy-sharp-DxWmhTqk.js");
8
- const require_process_memory = require("../process-memory-CZK3D3kM.js");
9
- const require_addon_utils = require("../addon-utils-CKf8kbwh.js");
10
- let sharp = require("sharp");
11
- sharp = require_dist.__toESM(sharp);
12
- let node_child_process = require("node:child_process");
5
+ const require_dist = require("../dist-4EMKvxCp.js");
6
+ const require_node = require("../node-BOHn8gpk.js");
7
+ const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-DDm07Ei6.js");
8
+ const require_lazy_sharp = require("../lazy-sharp-BlA9PxWk.js");
9
+ const require_process_memory = require("../process-memory-C3084DOt.js");
10
+ const require_addon_utils = require("../addon-utils-C6b5Tnia.js");
11
+ let node_fs = require("node:fs");
12
+ node_fs = require_dist.__toESM(node_fs);
13
13
  let node_path = require("node:path");
14
14
  node_path = require_dist.__toESM(node_path);
15
+ let node_child_process = require("node:child_process");
16
+ let sharp = require("sharp");
17
+ sharp = require_dist.__toESM(sharp);
15
18
  let node_os = require("node:os");
16
19
  node_os = require_dist.__toESM(node_os);
17
- let node_fs = require("node:fs");
18
- node_fs = require_dist.__toESM(node_fs);
19
20
  //#region src/detection-pipeline/runtimes.ts
20
21
  var KNOWN_PLATFORMS = [
21
22
  "darwin",
@@ -6313,6 +6314,36 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
6313
6314
  * never mutates shared state, so concurrent multi-device sessions don't race.
6314
6315
  */
6315
6316
  factoriesByDevice = /* @__PURE__ */ new Map();
6317
+ /**
6318
+ * This addon's `load-contribution`: the shared inference pool, DECLARING
6319
+ * that it cannot be attributed to a camera.
6320
+ *
6321
+ * The renunciation is data, not a deduction. One python process per (node,
6322
+ * runtime, hardware device) serves every camera on the node, so no
6323
+ * `deviceId` is true of it — `deviceId: null` and
6324
+ * `attribution: 'unattributable'` say exactly that, and a consumer that
6325
+ * plots per-camera load must exclude it rather than apportion it. The pool's
6326
+ * pids are included so the node's process snapshot can mark those processes
6327
+ * CLAIMED-but-shared instead of unknown; without them a reader cannot tell
6328
+ * "shared cost, reported" from "process nobody knows about".
6329
+ *
6330
+ * Per-camera inference MILLISECONDS are counted elsewhere and are a
6331
+ * different quantity — how much of the pool a camera asked for, never how
6332
+ * many CPU seconds it cost. They are deliberately not smuggled in here.
6333
+ */
6334
+ async loadContributions() {
6335
+ const factories = [...this.engineFactory === null ? [] : [["default", this.engineFactory]], ...this.factoriesByDevice.entries()];
6336
+ const out = [];
6337
+ for (const [deviceKey, factory] of factories) for (const pid of factory.getPoolPids()) out.push({
6338
+ role: "detection",
6339
+ deviceId: null,
6340
+ attribution: "unattributable",
6341
+ unit: `inference pool ${deviceKey}`,
6342
+ pid,
6343
+ ...await require_node.readProcessCost(pid)
6344
+ });
6345
+ return out;
6346
+ }
6316
6347
  executor = null;
6317
6348
  currentSteps = null;
6318
6349
  currentEngine;
@@ -9884,13 +9915,20 @@ var DetectionPipelineAddon = class extends require_dist.BaseAddon {
9884
9915
  await this.provider.warmPool();
9885
9916
  this.engineMetricsTimer = setInterval(() => this.emitEngineMetricsSnapshot(), ENGINE_METRICS_SNAPSHOT_INTERVAL_MS);
9886
9917
  this.lastAppliedOverride = this.resolveOperatorOverride();
9887
- return [{
9888
- capability: require_dist.pipelineExecutorCapability,
9889
- provider: this.provider
9890
- }, {
9891
- capability: require_dist.detectionPipelineCapability,
9892
- provider: this.provider
9893
- }];
9918
+ return [
9919
+ {
9920
+ capability: require_dist.pipelineExecutorCapability,
9921
+ provider: this.provider
9922
+ },
9923
+ {
9924
+ capability: require_dist.detectionPipelineCapability,
9925
+ provider: this.provider
9926
+ },
9927
+ {
9928
+ capability: require_dist.loadContributionCapability,
9929
+ provider: { list: async () => await this.provider?.loadContributions() ?? [] }
9930
+ }
9931
+ ];
9894
9932
  }
9895
9933
  /**
9896
9934
  * Emit a single `pipeline.engine-metrics-snapshot` event with the
@@ -1,14 +1,15 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { $t as EventCategory, Lt as nodePin, Mt as createEvent, Nt as hydrateSchema, O as YAMNET_TO_MACRO, Ot as BaseAddon, Qt as union, Rt as parseJsonUnknown, S as PoolMemoryWatchdog, St as errMsg, Ut as array, Vt as sleep, W as detectionPipelineCapability, Y as evaluateZoneRules, Yt as object, Z as inferModelProvider, Zt as string, _t as runtimeDevices$1, at as pickClusterStepModels, bt as supportedRuntimes$1, c as DEFAULT_CLUSTER_STEP_MODELS, ht as resolvePoolMemoryPolicy, l as DEFAULT_CLUSTER_STEP_SETTINGS, lt as pipelineExecutorCapability, m as DEVICE_BACKEND_TO_FORMAT, ot as pickClusterStepSettings, pt as resolveClusterStepModelId, q as enumerateInferenceDevices, rt as overlayClusterStepSettings, t as APPLE_SA_TO_MACRO, z as defaultDeviceFor$1 } from "../dist-C1dXLLQq.mjs";
3
- import { a as ALL_PIPELINE_STEPS, c as getDefaultModelForFormatFromDef, d as resolveModelForFormat, f as landmarkPrecisionVerdict, l as getStep, n as startEventLoopStallMonitor, o as ALL_STEPS, r as localFrameRegistry, s as getDefaultModelForFormat, u as getStepDefinition } from "../event-loop-stall-monitor-CU-xxX5c.mjs";
4
- import { t as getSharp } from "../lazy-sharp-BtT5x-qP.mjs";
5
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-CaEwi5Cd.mjs";
6
- import { a as ensureModel, o as isModelDownloaded, r as deleteModelFromDisk } from "../addon-utils-CgBCF-mE.mjs";
7
- import sharp from "sharp";
8
- import { spawn } from "node:child_process";
2
+ import { $ as loadContributionCapability, $t as union, Ct as errMsg, Ht as sleep, Nt as createEvent, O as YAMNET_TO_MACRO, Pt as hydrateSchema, Qt as string, Rt as nodePin, S as PoolMemoryWatchdog, W as detectionPipelineCapability, Wt as array, Xt as object, Y as evaluateZoneRules, Z as inferModelProvider, c as DEFAULT_CLUSTER_STEP_MODELS, en as EventCategory, gt as resolvePoolMemoryPolicy, it as overlayClusterStepSettings, kt as BaseAddon, l as DEFAULT_CLUSTER_STEP_SETTINGS, m as DEVICE_BACKEND_TO_FORMAT, mt as resolveClusterStepModelId, ot as pickClusterStepModels, q as enumerateInferenceDevices, st as pickClusterStepSettings, t as APPLE_SA_TO_MACRO, ut as pipelineExecutorCapability, vt as runtimeDevices$1, xt as supportedRuntimes$1, z as defaultDeviceFor$1, zt as parseJsonUnknown } from "../dist-g0Or5_pR.mjs";
3
+ import { a as readProcessCost } from "../node-Bo1g8hLO.mjs";
4
+ import { a as ALL_PIPELINE_STEPS, c as getDefaultModelForFormatFromDef, d as resolveModelForFormat, f as landmarkPrecisionVerdict, l as getStep, n as startEventLoopStallMonitor, o as ALL_STEPS, r as localFrameRegistry, s as getDefaultModelForFormat, u as getStepDefinition } from "../event-loop-stall-monitor-CskL9Lgu.mjs";
5
+ import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DmrHWybb.mjs";
7
+ import { a as ensureModel, o as isModelDownloaded, r as deleteModelFromDisk } from "../addon-utils-C8KTuPdE.mjs";
8
+ import * as fs from "node:fs";
9
9
  import * as path$1 from "node:path";
10
+ import { spawn } from "node:child_process";
11
+ import sharp from "sharp";
10
12
  import * as os from "node:os";
11
- import * as fs from "node:fs";
12
13
  //#region src/detection-pipeline/runtimes.ts
13
14
  var KNOWN_PLATFORMS = [
14
15
  "darwin",
@@ -6306,6 +6307,36 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
6306
6307
  * never mutates shared state, so concurrent multi-device sessions don't race.
6307
6308
  */
6308
6309
  factoriesByDevice = /* @__PURE__ */ new Map();
6310
+ /**
6311
+ * This addon's `load-contribution`: the shared inference pool, DECLARING
6312
+ * that it cannot be attributed to a camera.
6313
+ *
6314
+ * The renunciation is data, not a deduction. One python process per (node,
6315
+ * runtime, hardware device) serves every camera on the node, so no
6316
+ * `deviceId` is true of it — `deviceId: null` and
6317
+ * `attribution: 'unattributable'` say exactly that, and a consumer that
6318
+ * plots per-camera load must exclude it rather than apportion it. The pool's
6319
+ * pids are included so the node's process snapshot can mark those processes
6320
+ * CLAIMED-but-shared instead of unknown; without them a reader cannot tell
6321
+ * "shared cost, reported" from "process nobody knows about".
6322
+ *
6323
+ * Per-camera inference MILLISECONDS are counted elsewhere and are a
6324
+ * different quantity — how much of the pool a camera asked for, never how
6325
+ * many CPU seconds it cost. They are deliberately not smuggled in here.
6326
+ */
6327
+ async loadContributions() {
6328
+ const factories = [...this.engineFactory === null ? [] : [["default", this.engineFactory]], ...this.factoriesByDevice.entries()];
6329
+ const out = [];
6330
+ for (const [deviceKey, factory] of factories) for (const pid of factory.getPoolPids()) out.push({
6331
+ role: "detection",
6332
+ deviceId: null,
6333
+ attribution: "unattributable",
6334
+ unit: `inference pool ${deviceKey}`,
6335
+ pid,
6336
+ ...await readProcessCost(pid)
6337
+ });
6338
+ return out;
6339
+ }
6309
6340
  executor = null;
6310
6341
  currentSteps = null;
6311
6342
  currentEngine;
@@ -9877,13 +9908,20 @@ var DetectionPipelineAddon = class extends BaseAddon {
9877
9908
  await this.provider.warmPool();
9878
9909
  this.engineMetricsTimer = setInterval(() => this.emitEngineMetricsSnapshot(), ENGINE_METRICS_SNAPSHOT_INTERVAL_MS);
9879
9910
  this.lastAppliedOverride = this.resolveOperatorOverride();
9880
- return [{
9881
- capability: pipelineExecutorCapability,
9882
- provider: this.provider
9883
- }, {
9884
- capability: detectionPipelineCapability,
9885
- provider: this.provider
9886
- }];
9911
+ return [
9912
+ {
9913
+ capability: pipelineExecutorCapability,
9914
+ provider: this.provider
9915
+ },
9916
+ {
9917
+ capability: detectionPipelineCapability,
9918
+ provider: this.provider
9919
+ },
9920
+ {
9921
+ capability: loadContributionCapability,
9922
+ provider: { list: async () => await this.provider?.loadContributions() ?? [] }
9923
+ }
9924
+ ];
9887
9925
  }
9888
9926
  /**
9889
9927
  * Emit a single `pipeline.engine-metrics-snapshot` event with the
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  }) : target, mod));
23
23
  //#endregion
24
24
  let node_crypto = require("node:crypto");
25
- //#region ../types/dist/event-category-CIa_iT6b.mjs
25
+ //#region ../types/dist/event-category-BZL-fdNj.mjs
26
26
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
27
27
  EventCategory["SystemBoot"] = "system.boot";
28
28
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -459,7 +459,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
459
459
  EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
460
460
  /**
461
461
  * Periodic per-node process-tree snapshot (camstack-related pids
462
- * with ghost / managed / root classification). Emitted ~0.2 Hz by
462
+ * with root / managed / system classification). Emitted ~0.2 Hz by
463
463
  * the metrics-provider addon. Drives the Cluster → Processes tab
464
464
  * without polling `metricsProvider.listNodeProcesses`.
465
465
  */
@@ -12891,6 +12891,19 @@ var SettingsRecordSchema = object({
12891
12891
  data: record(string(), unknown())
12892
12892
  });
12893
12893
  /**
12894
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
12895
+ * optional.
12896
+ *
12897
+ * A separate schema rather than loosening the shared one: every other method
12898
+ * on this cap addresses a row BY its id, and making that field optional
12899
+ * everywhere would turn a forgotten key into a silently generated one on
12900
+ * `update` and `delete` as well.
12901
+ */
12902
+ var BulkRecordSchema = object({
12903
+ id: string().optional(),
12904
+ data: record(string(), unknown())
12905
+ });
12906
+ /**
12894
12907
  * Column declaration for a structured (SQL-backed) collection.
12895
12908
  *
12896
12909
  * Logical types — the backend translates each to the matching SQLite
@@ -12947,6 +12960,10 @@ method(object({
12947
12960
  collection: string(),
12948
12961
  record: SettingsRecordSchema
12949
12962
  }), _void(), { kind: "mutation" }), method(object({
12963
+ namespace: string().optional(),
12964
+ collection: string(),
12965
+ records: array(BulkRecordSchema).readonly()
12966
+ }), object({ inserted: number().int() }), { kind: "mutation" }), method(object({
12950
12967
  namespace: string().optional(),
12951
12968
  collection: string(),
12952
12969
  id: string(),
@@ -13055,6 +13072,13 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
13055
13072
  }), _void(), {
13056
13073
  kind: "mutation",
13057
13074
  auth: "admin"
13075
+ }), method(object({
13076
+ namespace: string().optional(),
13077
+ collection: string(),
13078
+ records: array(BulkRecordSchema).readonly()
13079
+ }), object({ inserted: number().int() }), {
13080
+ kind: "mutation",
13081
+ auth: "admin"
13058
13082
  }), method(object({
13059
13083
  namespace: string().optional(),
13060
13084
  collection: string(),
@@ -14875,6 +14899,82 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
14875
14899
  limit: number().optional(),
14876
14900
  tags: record(string(), string()).optional()
14877
14901
  }), array(LogEntrySchema).readonly());
14902
+ var LoadContributionSchema = object({
14903
+ role: _enum([
14904
+ "decode",
14905
+ "transcode",
14906
+ "recording",
14907
+ "streaming",
14908
+ "detection"
14909
+ ]),
14910
+ /**
14911
+ * The NUMERIC device id — the same value every log line carries as
14912
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
14913
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
14914
+ * contributor that cannot name its camera must not emit the entry at all,
14915
+ * because an unnamed per-camera entry is indistinguishable from a shared one
14916
+ * and would quietly turn one camera's cost into everybody's.
14917
+ */
14918
+ deviceId: number().int().positive().nullable(),
14919
+ attribution: _enum([
14920
+ "measured",
14921
+ "accounted",
14922
+ "unattributable"
14923
+ ]),
14924
+ /**
14925
+ * What ONE entry is, in the contributor's own words — `615/high`,
14926
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
14927
+ * family and inventing a common one would lose the only information that
14928
+ * makes two entries for the same camera distinguishable.
14929
+ */
14930
+ unit: string(),
14931
+ /**
14932
+ * The OS process this cost lives in, when there is one. Present so a
14933
+ * consumer can (a) tell two generations of the same unit apart across a
14934
+ * restart, and (b) subtract claimed processes from the node's process
14935
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
14936
+ * process of its own.
14937
+ */
14938
+ pid: number().int().positive().optional(),
14939
+ /**
14940
+ * When this generation started. The pid's incarnation marker: a consumer
14941
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
14942
+ * window when this changes, because the counter restarted from zero in a new
14943
+ * process.
14944
+ */
14945
+ startedAtMs: number().optional(),
14946
+ /**
14947
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
14948
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
14949
+ * contribution is asked for.
14950
+ *
14951
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
14952
+ * needs a sampler, and a new per-node sampler is the defect half of
14953
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
14954
+ * by whoever already keeps a history; a rate cannot be un-averaged.
14955
+ *
14956
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
14957
+ * an entry with no process.
14958
+ */
14959
+ cpuSeconds: number().optional(),
14960
+ /** Resident bytes of this unit's process, same source and same rules. */
14961
+ rssBytes: number().optional()
14962
+ });
14963
+ var loadContributionCapability = {
14964
+ name: "load-contribution",
14965
+ scope: "system",
14966
+ mode: "collection",
14967
+ internal: true,
14968
+ methods: {
14969
+ /**
14970
+ * This addon's own cost entries, computed live from state it already
14971
+ * holds. Inert: no persistence, no sampling, no timer. It is answered on
14972
+ * whatever beat the caller already has.
14973
+ */
14974
+ list: method(_void(), array(LoadContributionSchema).readonly()) },
14975
+ /** In-process only — enumerated through `addons.listCapabilityProviders`. */
14976
+ mount: { kind: "skip" }
14977
+ };
14878
14978
  /**
14879
14979
  * `login-method` — collection cap through which auth addons contribute
14880
14980
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -15078,8 +15178,7 @@ var NodeProcessSchema = object({
15078
15178
  classification: _enum([
15079
15179
  "root",
15080
15180
  "managed",
15081
- "system",
15082
- "ghost"
15181
+ "system"
15083
15182
  ]),
15084
15183
  /** `$process` addon binding when `managed`, else null. */
15085
15184
  addonId: string().nullable(),
@@ -15087,22 +15186,39 @@ var NodeProcessSchema = object({
15087
15186
  nodeId: string().nullable(),
15088
15187
  /** Truncated command line. */
15089
15188
  command: string(),
15189
+ /**
15190
+ * `ps pcpu` — CPU averaged over the process's WHOLE LIFETIME, not a rate.
15191
+ * On a runner up for days it barely moves. Fine as a column, useless as a
15192
+ * series: use `cpuMainPercent + cpuGcPercent` for anything time-varying.
15193
+ */
15090
15194
  cpuPercent: number(),
15091
15195
  memoryRssBytes: number(),
15196
+ /**
15197
+ * Instantaneous CPU% of the process's own threads over the last
15198
+ * process-snapshot window, from a `/proc/<pid>/task/*` tick delta.
15199
+ *
15200
+ * `null` = UNKNOWN, never zero: no previous sample yet (first tick after
15201
+ * boot), the pid was recycled, or this node is not Linux.
15202
+ */
15203
+ cpuMainPercent: number().nullable(),
15204
+ /**
15205
+ * Instantaneous CPU% of V8's `V8Worker` platform pool over the same window.
15206
+ *
15207
+ * This is the number that rewrote the 2026-08-27 diagnosis — hub-main 73%,
15208
+ * `stream-broker` 61% (`docs/architecture/load-ledger.md`). A CPU chart that
15209
+ * does not separate it from `cpuMainPercent` shows "busy" where the truth is
15210
+ * "allocating too much".
15211
+ *
15212
+ * Concurrent GC is the dominant tenant of that pool but not the only one
15213
+ * (background compilation runs there too), so it is reported as
15214
+ * "GC / V8 helpers" rather than as pure collection time. `null` has the same
15215
+ * meaning as on `cpuMainPercent`.
15216
+ */
15217
+ cpuGcPercent: number().nullable(),
15218
+ /** Threads seen in the tick scan. `null` under the same conditions. */
15219
+ threadCount: number().nullable(),
15092
15220
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
15093
- uptimeSec: number(),
15094
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
15095
- orphaned: boolean()
15096
- });
15097
- var KillProcessInputSchema = object({
15098
- pid: number(),
15099
- /** Force = SIGKILL. Default is SIGTERM. */
15100
- force: boolean().optional()
15101
- });
15102
- var KillProcessResultSchema = object({
15103
- success: boolean(),
15104
- reason: string().optional(),
15105
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
15221
+ uptimeSec: number()
15106
15222
  });
15107
15223
  var DumpHeapSnapshotInputSchema = object({
15108
15224
  /** The addon whose runner should dump a heap snapshot. */
@@ -15115,6 +15231,104 @@ var DumpHeapSnapshotResultSchema = object({
15115
15231
  pid: number().optional(),
15116
15232
  reason: string().optional()
15117
15233
  });
15234
+ /**
15235
+ * One point of one function's series.
15236
+ *
15237
+ * The unsuffixed fields are the bucket's **MAXIMUM**, and that choice is the
15238
+ * point of the whole surface. The two obvious reductions both lie: a mean per
15239
+ * bucket smears a spike away, and taking every Nth sample skips it outright.
15240
+ * Either would give us a tool built to find peaks that does not show peaks.
15241
+ * `...Min` carries the other end, `samples` says how many raw snapshots folded
15242
+ * into the bucket, and a mean stays derivable where it is wanted.
15243
+ *
15244
+ * An UNREDUCED point is a one-sample bucket: `samples === 1` and each `...Min`
15245
+ * equals its unsuffixed twin. Reduced and unreduced are the same shape, so a
15246
+ * caller cannot tell which it received — which is what "one reader" means.
15247
+ */
15248
+ var LoadPointSchema = object({
15249
+ /** Bucket START, or the snapshot's own timestamp when unreduced. */
15250
+ atMs: number(),
15251
+ /** Raw snapshots in this bucket. Never 0 — AN EMPTY BUCKET IS ABSENT. */
15252
+ samples: number().int(),
15253
+ /**
15254
+ * `null` = UNKNOWN and it PROPAGATES: a bucket is null unless every process
15255
+ * of every snapshot in it reported a thread split. A partial sum is a
15256
+ * smaller number that looks exactly as real as a complete one.
15257
+ */
15258
+ cpuMainPercent: number().nullable(),
15259
+ cpuMainPercentMin: number().nullable(),
15260
+ cpuGcPercent: number().nullable(),
15261
+ cpuGcPercentMin: number().nullable(),
15262
+ /** Lifetime-average CPU%, summed. Always known — and never a rate. */
15263
+ cpuLifetimePercent: number(),
15264
+ cpuLifetimePercentMin: number(),
15265
+ memoryRssBytes: number(),
15266
+ memoryRssBytesMin: number(),
15267
+ processCount: number().int(),
15268
+ processCountMin: number().int()
15269
+ });
15270
+ /** One function's series. `key` is an addonId, `__root__` or `__unattributed__`. */
15271
+ var LoadFunctionSeriesSchema = object({
15272
+ key: string(),
15273
+ kind: _enum([
15274
+ "addon",
15275
+ "root",
15276
+ "unattributed"
15277
+ ]),
15278
+ /** Oldest-first. A missing interval is MISSING — never zero-filled. */
15279
+ points: array(LoadPointSchema).readonly()
15280
+ });
15281
+ var NodeLoadSeriesSchema = object({
15282
+ nodeId: string(),
15283
+ /** One entry per function seen in the window, heaviest-first. */
15284
+ series: array(LoadFunctionSeriesSchema).readonly(),
15285
+ /**
15286
+ * Width of one returned bucket, in ms. Equals the sampling cadence when no
15287
+ * reduction was needed — so a caller can always say what one point covers
15288
+ * without having to know whether it was reduced.
15289
+ */
15290
+ bucketMs: number(),
15291
+ /** Raw snapshots that went into this answer, across both tiers. */
15292
+ retainedSamples: number(),
15293
+ /** Oldest snapshot represented, or `null` when nothing is retained. */
15294
+ oldestAtMs: number().nullable(),
15295
+ /** The fixed sampling cadence in force on the cluster, in ms. */
15296
+ cadenceMs: number(),
15297
+ /**
15298
+ * Did the DURABLE tier contribute? `false` means the answer is the hot ring
15299
+ * alone — an agent (which holds no table), or a store that refused.
15300
+ * Reported because "the last hour" and "the last six hours" are different
15301
+ * questions and an operator must not have to guess which was answered.
15302
+ */
15303
+ durable: boolean()
15304
+ });
15305
+ var GetLoadSeriesInputSchema = object({
15306
+ /**
15307
+ * The node whose series is wanted.
15308
+ *
15309
+ * NOT named `nodeId`: the generated cap router strips a top-level
15310
+ * `nodeId` from every method input and uses it to ROUTE the call to
15311
+ * that node's provider (`generated-cap-routers.ts`). A series target
15312
+ * called `nodeId` would silently become a routing pin and never reach
15313
+ * the provider. The hub holds every node it hears from, so the
15314
+ * ordinary call is unpinned — answered by the hub, for any node.
15315
+ */
15316
+ forNodeId: string(),
15317
+ /**
15318
+ * EXCLUSIVE lower bound. A caller passes the newest `atMs` it already
15319
+ * holds and receives only what it is missing, so seeding a live chart
15320
+ * from this method cannot double a point already drawn.
15321
+ */
15322
+ sinceMs: number().optional(),
15323
+ /**
15324
+ * Most points the caller wants PER FUNCTION. The window is reduced to fit,
15325
+ * preserving min and max per bucket.
15326
+ *
15327
+ * Absent means NO reduction — legitimate for a short window and a trap for a
15328
+ * long one, which is why a chart passes its own pixel width.
15329
+ */
15330
+ maxPoints: number().int().positive().optional()
15331
+ });
15118
15332
  var SystemMetricsSchema = object({
15119
15333
  cpuPercent: number(),
15120
15334
  memoryPercent: number(),
@@ -15125,10 +15339,7 @@ var SystemMetricsSchema = object({
15125
15339
  gpuPercent: number().optional(),
15126
15340
  gpuMemoryPercent: number().optional()
15127
15341
  });
15128
- method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
15129
- kind: "mutation",
15130
- auth: "admin"
15131
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
15342
+ method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
15132
15343
  kind: "mutation",
15133
15344
  auth: "admin"
15134
15345
  });
@@ -29428,6 +29639,15 @@ var LoggingSettingsPatchSchema = object({
29428
29639
  * authority over the whole hierarchy and answers for every layer, so the
29429
29640
  * layer selector needs a name the transport does not already own.
29430
29641
  */
29642
+ /**
29643
+ * One contribution, plus WHO reported it.
29644
+ *
29645
+ * The addon and node are added by the hub as it enumerates providers, never by
29646
+ * the contributor: an addon reporting its own identity could report somebody
29647
+ * else's, and the whole point of this surface is that no claim is made by
29648
+ * anyone but its owner.
29649
+ */
29650
+ var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29431
29651
  var GetLoggingSettingsInputSchema = object({
29432
29652
  scopeNodeId: string().optional(),
29433
29653
  /**
@@ -29486,7 +29706,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29486
29706
  }), method(_void(), SiteLocationStatusSchema, {
29487
29707
  kind: "mutation",
29488
29708
  auth: "admin"
29489
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29709
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29490
29710
  kind: "mutation",
29491
29711
  auth: "admin"
29492
29712
  });
@@ -31261,6 +31481,12 @@ Object.freeze({
31261
31481
  addonId: null,
31262
31482
  access: "create"
31263
31483
  },
31484
+ "dataStoreProvider.insertMany": {
31485
+ capName: "data-store-provider",
31486
+ capScope: "system",
31487
+ addonId: null,
31488
+ access: "create"
31489
+ },
31264
31490
  "dataStoreProvider.isEmpty": {
31265
31491
  capName: "data-store-provider",
31266
31492
  capScope: "system",
@@ -32575,6 +32801,12 @@ Object.freeze({
32575
32801
  addonId: null,
32576
32802
  access: "create"
32577
32803
  },
32804
+ "loadContribution.list": {
32805
+ capName: "load-contribution",
32806
+ capScope: "system",
32807
+ addonId: null,
32808
+ access: "view"
32809
+ },
32578
32810
  "localNetwork.downloadCa": {
32579
32811
  capName: "local-network",
32580
32812
  capScope: "system",
@@ -32875,17 +33107,17 @@ Object.freeze({
32875
33107
  addonId: null,
32876
33108
  access: "view"
32877
33109
  },
32878
- "metricsProvider.getProcessStats": {
33110
+ "metricsProvider.getLoadSeries": {
32879
33111
  capName: "metrics-provider",
32880
33112
  capScope: "system",
32881
33113
  addonId: null,
32882
33114
  access: "view"
32883
33115
  },
32884
- "metricsProvider.killProcess": {
33116
+ "metricsProvider.getProcessStats": {
32885
33117
  capName: "metrics-provider",
32886
33118
  capScope: "system",
32887
33119
  addonId: null,
32888
- access: "create"
33120
+ access: "view"
32889
33121
  },
32890
33122
  "metricsProvider.listAddonInstances": {
32891
33123
  capName: "metrics-provider",
@@ -34897,6 +35129,12 @@ Object.freeze({
34897
35129
  addonId: null,
34898
35130
  access: "create"
34899
35131
  },
35132
+ "settingsStore.insertMany": {
35133
+ capName: "settings-store",
35134
+ capScope: "system",
35135
+ addonId: null,
35136
+ access: "create"
35137
+ },
34900
35138
  "settingsStore.isEmpty": {
34901
35139
  capName: "settings-store",
34902
35140
  capScope: "system",
@@ -35509,6 +35747,12 @@ Object.freeze({
35509
35747
  addonId: null,
35510
35748
  access: "create"
35511
35749
  },
35750
+ "system.getLoadContributions": {
35751
+ capName: "system",
35752
+ capScope: "system",
35753
+ addonId: null,
35754
+ access: "view"
35755
+ },
35512
35756
  "system.getLoggingSettings": {
35513
35757
  capName: "system",
35514
35758
  capScope: "system",
@@ -39934,6 +40178,12 @@ Object.defineProperty(exports, "literal", {
39934
40178
  return literal;
39935
40179
  }
39936
40180
  });
40181
+ Object.defineProperty(exports, "loadContributionCapability", {
40182
+ enumerable: true,
40183
+ get: function() {
40184
+ return loadContributionCapability;
40185
+ }
40186
+ });
39937
40187
  Object.defineProperty(exports, "logChannelsCapability", {
39938
40188
  enumerable: true,
39939
40189
  get: function() {