@camstack/addon-pipeline 1.2.267 → 1.2.269

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 (35) hide show
  1. package/dist/audio-analyzer/index.js +2 -2
  2. package/dist/audio-analyzer/index.mjs +2 -2
  3. package/dist/{default-detection-model-CKNqjjRy.js → default-detection-model-BfMsW_XK.js} +1 -1
  4. package/dist/{default-detection-model--x95ODoz.mjs → default-detection-model-pXamampo.mjs} +1 -1
  5. package/dist/detection-pipeline/index.js +4 -4
  6. package/dist/detection-pipeline/index.mjs +4 -4
  7. package/dist/{dist-C7CvyImc.js → dist-CkNVb7Zh.js} +187 -11
  8. package/dist/{dist-Dm1V0nJX.mjs → dist-Cqf-U6EN.mjs} +187 -11
  9. package/dist/motion-wasm/index.js +1 -1
  10. package/dist/motion-wasm/index.mjs +1 -1
  11. package/dist/{node-CjN6Vze9.js → node-CqC8R84-.js} +116 -2
  12. package/dist/{node-B5haKIVa.mjs → node-jLmcbaar.mjs} +111 -3
  13. package/dist/pipeline-runner/index.js +3 -3
  14. package/dist/pipeline-runner/index.mjs +3 -3
  15. package/dist/{process-memory-BMCVwJcT.mjs → process-memory-B1YHg1_g.mjs} +1 -1
  16. package/dist/{process-memory-CaFOThD9.js → process-memory-D7LlWXty.js} +1 -1
  17. package/dist/recorder/index.js +2 -2
  18. package/dist/recorder/index.mjs +2 -2
  19. package/dist/{segment-demux-js-BaWzAeJu.mjs → segment-demux-js-B2TLcR_g.mjs} +1 -1
  20. package/dist/{segment-demux-js-bfaGjVqq.js → segment-demux-js-Bu-_Q7Um.js} +1 -1
  21. package/dist/stream-broker/_stub.js +2 -2
  22. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DEMQXM_a.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-CbUvu4Jn.mjs} +2 -2
  23. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DJVznXRG.mjs +26 -0
  24. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CeR_IxxU.mjs +26 -0
  25. package/dist/stream-broker/demux-worker-child.js +1 -1
  26. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  27. package/dist/stream-broker/{hostInit-C9moW6r3.mjs → hostInit-9ZN1ghaZ.mjs} +2 -2
  28. package/dist/stream-broker/index.js +404 -71
  29. package/dist/stream-broker/index.mjs +404 -71
  30. package/dist/stream-broker/remoteEntry.js +1 -1
  31. package/package.json +1 -1
  32. package/python/inference_pool.py +84 -2
  33. package/python/test_inference_pool_ov_threads.py +112 -0
  34. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B5hze8qG.mjs +0 -26
  35. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DTzfOQZq.mjs +0 -26
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-C7CvyImc.js");
7
- const require_process_memory = require("../process-memory-CaFOThD9.js");
6
+ const require_dist = require("../dist-CkNVb7Zh.js");
7
+ const require_process_memory = require("../process-memory-D7LlWXty.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
10
10
  let node_path = require("node:path");
@@ -1,6 +1,6 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { $t as hydrateSchema, Jt as audioChunkBytesPerSample, Lt as errMsg, N as audioAnalysisCapability, Ot as resolvePoolMemoryPolicy, P as audioAnalyzerCapability, Qt as expandAudioChunkToF32le, Wt as BaseAddon, bn as EventCategory, n as AUDIO_BACKEND_CHOICES, ot as mapAudioLabelToMacro, rn as nodePin, s as DEFAULT_AUDIO_ANALYZER_CONFIG, w as PoolMemoryWatchdog, y as HF_BASE_URL } from "../dist-Dm1V0nJX.mjs";
3
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-BMCVwJcT.mjs";
2
+ import { $t as hydrateSchema, Jt as audioChunkBytesPerSample, Lt as errMsg, N as audioAnalysisCapability, Ot as resolvePoolMemoryPolicy, P as audioAnalyzerCapability, Qt as expandAudioChunkToF32le, Wt as BaseAddon, bn as EventCategory, n as AUDIO_BACKEND_CHOICES, ot as mapAudioLabelToMacro, rn as nodePin, s as DEFAULT_AUDIO_ANALYZER_CONFIG, w as PoolMemoryWatchdog, y as HF_BASE_URL } from "../dist-Cqf-U6EN.mjs";
3
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-B1YHg1_g.mjs";
4
4
  import * as fs from "node:fs";
5
5
  import * as path$1 from "node:path";
6
6
  import { downloadFile } from "@camstack/system/addon-utils";
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-C7CvyImc.js");
1
+ const require_dist = require("./dist-CkNVb7Zh.js");
2
2
  let node_crypto = require("node:crypto");
3
3
  //#region src/detection-pipeline/pipeline/landmark-precision-gate.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as audioKindId, a as COCO_80_LABELS, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS, tt as hfModelUrl } from "./dist-Dm1V0nJX.mjs";
1
+ import { F as audioKindId, a as COCO_80_LABELS, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS, tt as hfModelUrl } from "./dist-Cqf-U6EN.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  //#region src/detection-pipeline/pipeline/landmark-precision-gate.ts
4
4
  /**
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-C7CvyImc.js");
7
- const require_node = require("../node-CjN6Vze9.js");
8
- const require_default_detection_model = require("../default-detection-model-CKNqjjRy.js");
6
+ const require_dist = require("../dist-CkNVb7Zh.js");
7
+ const require_node = require("../node-CqC8R84-.js");
8
+ const require_default_detection_model = require("../default-detection-model-BfMsW_XK.js");
9
9
  const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
10
- const require_process_memory = require("../process-memory-CaFOThD9.js");
10
+ const require_process_memory = require("../process-memory-D7LlWXty.js");
11
11
  let node_os = require("node:os");
12
12
  node_os = require_chunk.__toESM(node_os);
13
13
  let node_fs = require("node:fs");
@@ -1,9 +1,9 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { $t as hydrateSchema, At as runtimeDevices$1, Ft as supportedRuntimes$1, G as detectionPipelineCapability, J as enumerateInferenceDevices, Lt as errMsg, Ot as resolvePoolMemoryPolicy, Tt as resolveClusterStepModelId, V as defaultDeviceFor$1, Wt as BaseAddon, X as evaluateZoneRules, Yt as createEvent, bn as EventCategory, c as DEFAULT_CLUSTER_STEP_MODELS, gt as pickClusterStepSettings, hn as object, ht as pickClusterStepModels, in as parseJsonUnknown, it as loadContributionCapability, j as YAMNET_TO_MACRO, l as DEFAULT_CLUSTER_STEP_SETTINGS, ln as array, m as DEVICE_BACKEND_TO_FORMAT, nt as inferModelProvider, pt as overlayClusterStepSettings, rn as nodePin, sn as sleep, t as APPLE_SA_TO_MACRO, vn as string, w as PoolMemoryWatchdog, yn as union, yt as pipelineExecutorCapability } from "../dist-Dm1V0nJX.mjs";
3
- import { o as readProcessCost } from "../node-B5haKIVa.mjs";
4
- import { a as localFrameRegistry, c as ALL_STEPS, d as getStepDefinition, f as resolveModelForFormat, l as getDefaultModelForFormat, n as resolveDefaultDetectionModel, p as landmarkPrecisionVerdict, r as macroGateVerdict, s as ALL_PIPELINE_STEPS, u as getStep } from "../default-detection-model--x95ODoz.mjs";
2
+ import { $t as hydrateSchema, At as runtimeDevices$1, Ft as supportedRuntimes$1, G as detectionPipelineCapability, J as enumerateInferenceDevices, Lt as errMsg, Ot as resolvePoolMemoryPolicy, Tt as resolveClusterStepModelId, V as defaultDeviceFor$1, Wt as BaseAddon, X as evaluateZoneRules, Yt as createEvent, bn as EventCategory, c as DEFAULT_CLUSTER_STEP_MODELS, gt as pickClusterStepSettings, hn as object, ht as pickClusterStepModels, in as parseJsonUnknown, it as loadContributionCapability, j as YAMNET_TO_MACRO, l as DEFAULT_CLUSTER_STEP_SETTINGS, ln as array, m as DEVICE_BACKEND_TO_FORMAT, nt as inferModelProvider, pt as overlayClusterStepSettings, rn as nodePin, sn as sleep, t as APPLE_SA_TO_MACRO, vn as string, w as PoolMemoryWatchdog, yn as union, yt as pipelineExecutorCapability } from "../dist-Cqf-U6EN.mjs";
3
+ import { s as readProcessCost } from "../node-jLmcbaar.mjs";
4
+ import { a as localFrameRegistry, c as ALL_STEPS, d as getStepDefinition, f as resolveModelForFormat, l as getDefaultModelForFormat, n as resolveDefaultDetectionModel, p as landmarkPrecisionVerdict, r as macroGateVerdict, s as ALL_PIPELINE_STEPS, u as getStep } from "../default-detection-model-pXamampo.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-BMCVwJcT.mjs";
6
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-B1YHg1_g.mjs";
7
7
  import * as os from "node:os";
8
8
  import * as fs from "node:fs";
9
9
  import * as path$1 from "node:path";
@@ -5360,7 +5360,7 @@ var ZodIssueCode = {
5360
5360
  var ZodFirstPartyTypeKind;
5361
5361
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5362
5362
  //#endregion
5363
- //#region ../types/dist/sleep-GU_us3DG.mjs
5363
+ //#region ../types/dist/sleep-CiR4z7r9.mjs
5364
5364
  /**
5365
5365
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5366
5366
  * window to float samples (D455).
@@ -6556,6 +6556,17 @@ var CAM_PROFILE_ORDER = [
6556
6556
  "mid",
6557
6557
  "low"
6558
6558
  ];
6559
+ /**
6560
+ * Which rung a per-camera consumer listens on: an explicit profile, or `auto`.
6561
+ *
6562
+ * `auto` is a REAL value, not an absent one — it means "resolve it by the rule
6563
+ * that consumer owns". It lives beside `CamProfile` because a rung is the only
6564
+ * operator-facing way to name a stream: a cam-stream id is broker-internal and
6565
+ * moves when a slot is reassigned, so a stored id silently stops meaning what
6566
+ * the operator picked. Today's one user is the audio analyser, whose rule is
6567
+ * "the lowest AVAILABLE native rung" (D537).
6568
+ */
6569
+ var AudioStreamPickSchema = union([CamProfileSchema, literal("auto")]);
6559
6570
  var CamStreamKindSchema = _enum([
6560
6571
  "pull-rtsp",
6561
6572
  "pull-rtmp",
@@ -7577,7 +7588,7 @@ function sleep(ms) {
7577
7588
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
7578
7589
  }
7579
7590
  //#endregion
7580
- //#region ../types/dist/canonical-hash-CvL03d3i.mjs
7591
+ //#region ../types/dist/canonical-hash-CPK2Dy60.mjs
7581
7592
  var AUDIO_ENCODER_BY_CODEC = {
7582
7593
  opus: "libopus",
7583
7594
  aac: "aac",
@@ -7678,16 +7689,29 @@ function resolveStreamMaps(selection) {
7678
7689
  };
7679
7690
  }
7680
7691
  /** The `-vf` filter args, or `[]` when a consumer `-vf` already claims the slot. */
7681
- function buildVideoFilterArgs(scale, outputArgs, filterGraph) {
7692
+ function buildVideoFilterArgs(scale, outputArgs, filterGraph, hwUpload) {
7682
7693
  if (filterGraph) {
7683
7694
  if (scale) throw new Error("FfmpegInvocation: video.scale cannot be combined with a filter graph — scale inside the graph instead (the -vf would feed an output the graph already feeds)");
7684
7695
  if (outputArgs.some((a) => a === "-vf")) throw new Error("FfmpegInvocation: outputArgs carries a -vf while a filter graph feeds the same output — fold the filter into the graph");
7685
7696
  return [];
7686
7697
  }
7687
- if (!scale) return [];
7688
7698
  if (outputArgs.some((a) => a === "-vf")) return [];
7689
- if (scale.mode === "exact") return ["-vf", `scale=${scale.width}:${scale.height}`];
7690
- return ["-vf", `scale='min(${scale.width},iw)':'min(${scale.height},ih)':force_original_aspect_ratio=decrease:force_divisible_by=2`];
7699
+ if (!scale) return hwUpload.length > 0 ? ["-vf", hwUpload] : [];
7700
+ const suffix = hwUpload.length > 0 ? `,${hwUpload}` : "";
7701
+ if (scale.mode === "exact") return ["-vf", `scale=${scale.width}:${scale.height}${suffix}`];
7702
+ return ["-vf", `scale='min(${scale.width},iw)':'min(${scale.height},ih)':force_original_aspect_ratio=decrease:force_divisible_by=2${suffix}`];
7703
+ }
7704
+ /**
7705
+ * The upload filter a hardware encode needs, or `''`.
7706
+ *
7707
+ * Nothing is uploaded when the DECODE already left the frames on the GPU
7708
+ * (`-hwaccel vaapi`): they are surfaces already, and uploading a surface is an
7709
+ * error rather than a no-op.
7710
+ */
7711
+ function resolveHwUpload(device, decodeHwAccel) {
7712
+ if (device === void 0) return "";
7713
+ if (!isSoftwareDecode(decodeHwAccel)) return "";
7714
+ return "format=nv12,hwupload";
7691
7715
  }
7692
7716
  /** Rate-control args for an encode plan. */
7693
7717
  function buildRateControlArgs(video) {
@@ -7707,7 +7731,7 @@ function buildRateControlArgs(video) {
7707
7731
  ];
7708
7732
  }
7709
7733
  /** The whole video block (`-vf` … `-c:v` … knobs), after `-i`. */
7710
- function buildVideoArgs(video, outputArgs, filterGraph) {
7734
+ function buildVideoArgs(video, outputArgs, filterGraph, hwEncode) {
7711
7735
  if (video.kind === "raw") {
7712
7736
  if (filterGraph && video.filter !== void 0) throw new Error("FfmpegInvocation: video.filter cannot be combined with a filter graph — fold the filter into the graph");
7713
7737
  return [
@@ -7727,8 +7751,10 @@ function buildVideoArgs(video, outputArgs, filterGraph) {
7727
7751
  ...video.bitstreamFilter ? ["-bsf:v", video.bitstreamFilter] : []
7728
7752
  ];
7729
7753
  }
7754
+ const hwUpload = hwEncode === void 0 ? "" : resolveHwUpload(hwEncode.device, hwEncode.decodeHwAccel);
7755
+ if (hwEncode !== void 0 && filterGraph) throw new Error("FfmpegInvocation: a hardware encode fed by a filter graph must upload INSIDE the graph — hwEncodeDevice cannot be combined with filterGraph");
7730
7756
  const args = [
7731
- ...buildVideoFilterArgs(video.scale, outputArgs, filterGraph),
7757
+ ...buildVideoFilterArgs(video.scale, outputArgs, filterGraph, hwUpload),
7732
7758
  "-c:v",
7733
7759
  video.encoder
7734
7760
  ];
@@ -7898,10 +7924,18 @@ function buildAudioSidecarArgs(sidecar) {
7898
7924
  * (`0:a:0?`): the sidecar is defined as the SOURCE's microphone on its own RTP
7899
7925
  * output, not as whatever the main output happens to carry.
7900
7926
  */
7927
+ /** The hardware-encode context for this invocation, or `undefined`. */
7928
+ function hwEncodeFor(inv) {
7929
+ return inv.hwEncodeDevice === void 0 ? void 0 : {
7930
+ device: inv.hwEncodeDevice,
7931
+ decodeHwAccel: inv.decodeHwAccel
7932
+ };
7933
+ }
7901
7934
  function buildFfmpegArgs(inv) {
7902
7935
  const graph = inv.filterGraph ?? null;
7903
7936
  const head = [
7904
7937
  ...logBannerArgs(inv.logLevel),
7938
+ ...inv.hwEncodeDevice !== void 0 ? ["-vaapi_device", inv.hwEncodeDevice.renderNode] : [],
7905
7939
  ...buildInputArgs(inv.input, inv.decodeHwAccel),
7906
7940
  ...(inv.extraInputs ?? []).flatMap((extra) => buildInputArgs(extra, inv.decodeHwAccel)),
7907
7941
  ...graph ? ["-filter_complex", graph.graph] : []
@@ -7915,7 +7949,7 @@ function buildFfmpegArgs(inv) {
7915
7949
  "-an",
7916
7950
  "-map",
7917
7951
  maps.video ?? "0:v:0",
7918
- ...buildVideoArgs(inv.video, inv.outputArgs, graph),
7952
+ ...buildVideoArgs(inv.video, inv.outputArgs, graph, hwEncodeFor(inv)),
7919
7953
  ...threadArgs,
7920
7954
  ...inv.outputArgs,
7921
7955
  ...buildRtpOutputArgs(inv.sink.video)
@@ -7938,7 +7972,7 @@ function buildFfmpegArgs(inv) {
7938
7972
  return [
7939
7973
  ...head,
7940
7974
  ...videoMapArgs,
7941
- ...buildVideoArgs(inv.video, inv.outputArgs, graph),
7975
+ ...buildVideoArgs(inv.video, inv.outputArgs, graph, hwEncodeFor(inv)),
7942
7976
  ...threadArgs,
7943
7977
  ...mutedAudio ? [] : audioMapArgs,
7944
7978
  ...audioArgs,
@@ -22792,6 +22826,7 @@ var MediaFileKindEnum = _enum([
22792
22826
  "keyFrameSmall",
22793
22827
  "thumbnailSmall",
22794
22828
  "confirmationCrop",
22829
+ "debugCrop",
22795
22830
  "sceneFrame"
22796
22831
  ]);
22797
22832
  /**
@@ -24456,6 +24491,18 @@ var RunnerCameraConfigSchema = object({
24456
24491
  motionStreamId: string(),
24457
24492
  detectionStreamId: string(),
24458
24493
  /**
24494
+ * Which rung this camera's audio analysis listens on — `auto` (the lowest
24495
+ * AVAILABLE native rung) or an explicit one.
24496
+ *
24497
+ * Not consumed by the runner: carried here so it travels with the camera's
24498
+ * config the way `audioMotionWindowMs` does, and so the orchestrator's
24499
+ * watchdog resolves the same stream the audio subscription did. OPTIONAL
24500
+ * with no default — absent means `auto`, which is what every camera written
24501
+ * before this field had, and an absent optional adds nothing to the
24502
+ * generated cap-input defaults (D537).
24503
+ */
24504
+ audioStreamPick: AudioStreamPickSchema.optional(),
24505
+ /**
24459
24506
  * Motion sources that can activate the pipeline. At least one must
24460
24507
  * be present. Multiple sources OR-ed: any one firing arms the
24461
24508
  * cooldown timer and transitions watching → active. The same
@@ -27182,6 +27229,104 @@ var WebrtcStreamChoiceSchema = object({
27182
27229
  bitrateKbps: number().nullable()
27183
27230
  });
27184
27231
  /**
27232
+ * The last move the adaptive ladder made on this session, and the numbers it
27233
+ * rested on. Mirrors `LadderDecision` in the stream-broker's
27234
+ * `adaptive-controller.ts` — the log line's evidence, made readable.
27235
+ *
27236
+ * Nullability is load-bearing: `lossRatio: null` means the loss tracker had
27237
+ * no window to report, which is NOT a link with zero loss.
27238
+ */
27239
+ var WebrtcLadderDecisionSchema = object({
27240
+ /** `loss` — RTCP / client-reported packet loss; `stall` — the picture
27241
+ * stopped moving; `healthy` — a promotion. */
27242
+ cause: _enum([
27243
+ "loss",
27244
+ "stall",
27245
+ "healthy"
27246
+ ]),
27247
+ /** The rung the ladder moved TO. Null for a move that changed no rung
27248
+ * (an MTU reduction, a forced transcode-down at the bottom). */
27249
+ tier: CamProfileSchema.nullable(),
27250
+ /** Whether that move forced the egress transcode-down rung. */
27251
+ forcedTranscodeDown: boolean(),
27252
+ /** Loss ratio over the tracker's window at the moment of the decision. */
27253
+ lossRatio: number().nullable(),
27254
+ /** The client's reported downlink at that moment, in kbps. */
27255
+ clientKbps: number().nullable(),
27256
+ /** How long the stall detector had been seeing nothing arrive. */
27257
+ stalledForMs: number().nullable(),
27258
+ /** Whether the broker WAS sending while that was measured — the half that
27259
+ * separates "the camera stopped" from "the link stopped". */
27260
+ serverSending: boolean().nullable(),
27261
+ /** Epoch ms. The overlay prints its age; a decision from 40 minutes ago
27262
+ * must not read like one from this second. */
27263
+ at: number()
27264
+ });
27265
+ /** Per-tier count of MEASURED downgrades this viewer session has suffered. */
27266
+ var WebrtcTierFailureSchema = object({
27267
+ tier: CamProfileSchema,
27268
+ failures: number().int().nonnegative()
27269
+ });
27270
+ /**
27271
+ * What the SERVER decided for one WebRTC session — the half the client cannot
27272
+ * measure. See `getSessionDebug`.
27273
+ */
27274
+ var WebrtcSessionDebugSchema = object({
27275
+ sessionId: string(),
27276
+ /** Whether the session still exists here. Everything below is null when
27277
+ * it does not — a dead session has no measurements, not zero ones. */
27278
+ alive: boolean(),
27279
+ /** Epoch ms this snapshot was taken, so the overlay can show its age. */
27280
+ observedAt: number(),
27281
+ /** The broker actually feeding this session (`<deviceId>/<camStreamId>`). */
27282
+ brokerId: string().nullable(),
27283
+ camStreamId: string().nullable(),
27284
+ /** `derived` = this hub BUILT the rung being served (a transcode/scale of
27285
+ * another stream); `native` = the camera's own encode. */
27286
+ sourceKind: _enum([
27287
+ "native",
27288
+ "derived",
27289
+ "unknown"
27290
+ ]),
27291
+ /** Whether the ladder is running at all (an `adaptive` target). */
27292
+ adaptive: boolean(),
27293
+ /** The rung `auto` ACTUALLY resolved to right now. Null when the broker
27294
+ * is bound to no profile slot (a manually-activated stream). */
27295
+ servedTier: CamProfileSchema.nullable(),
27296
+ /** Which node ingests the source. Null when unresolved. */
27297
+ ingestNodeId: string().nullable(),
27298
+ /** Whether that node is a remote one (the media crosses a node boundary
27299
+ * before it reaches this session). Null when unresolved. */
27300
+ ingestIsRemote: boolean().nullable(),
27301
+ /** Codec off the source, and the one negotiated with this client. */
27302
+ sourceCodec: string().nullable(),
27303
+ negotiatedCodec: string().nullable(),
27304
+ /** Whether the EGRESS leg re-encodes for this client or forwards the
27305
+ * source bytes untouched. */
27306
+ egressLeg: _enum([
27307
+ "copy",
27308
+ "transcode",
27309
+ "unknown"
27310
+ ]),
27311
+ /** What the broker itself reports about the rung it is serving. */
27312
+ brokerStatus: string().nullable(),
27313
+ brokerCodec: string().nullable(),
27314
+ brokerBitrateKbps: number().nullable(),
27315
+ brokerInputFps: number().nullable(),
27316
+ brokerUptimeMs: number().nullable(),
27317
+ /** RTP packets this session has sent — the server's own "am I sending?". */
27318
+ rtpPacketsSent: number().nullable(),
27319
+ /** D42: the track may be carrying the recorded feeder, not live. The ladder
27320
+ * is suspended there, so a frozen picture in `recorded` mode means
27321
+ * something entirely different. */
27322
+ trackMode: _enum(["live", "recorded"]).nullable(),
27323
+ lastDecision: WebrtcLadderDecisionSchema.nullable(),
27324
+ tierFailures: array(WebrtcTierFailureSchema),
27325
+ /** Successful promotions in this viewer session (drives the progressive
27326
+ * healthy timer). Null when no ladder is running. */
27327
+ upgradeCount: number().nullable()
27328
+ });
27329
+ /**
27185
27330
  * WebRTC session — device-scoped facade over the system `webrtc` cap.
27186
27331
  *
27187
27332
  * Exposes per-device signaling (`createSession`, `handleAnswer`,
@@ -27421,7 +27566,27 @@ var webrtcSessionCapability = {
27421
27566
  * the same answer as "it ended": either way nothing is holding it up.
27422
27567
  */
27423
27568
  alive: boolean()
27424
- }))
27569
+ })),
27570
+ /**
27571
+ * The SERVER's half of the stream-debug overlay, for one live session.
27572
+ *
27573
+ * The client can measure its own transport (`getStats()`); it cannot see
27574
+ * which rung `auto` actually resolved to, why the ladder last moved, or
27575
+ * whether the rung it is being served is the camera's own encode or
27576
+ * something this hub built. That asymmetry is why "quality is stuck on
27577
+ * low" reports have historically been unanswerable from the viewer alone.
27578
+ *
27579
+ * EVERY measurement here is nullable and `null` means UNKNOWN, never zero
27580
+ * (D393): a session whose ladder has never moved reports
27581
+ * `lastDecision: null`, which is a different fact from a ladder that moved
27582
+ * for `healthy` with a 0 loss ratio.
27583
+ *
27584
+ * Read-only, ~1 Hz, polled by the overlay only while it is visible.
27585
+ */
27586
+ getSessionDebug: method(object({
27587
+ deviceId: number().int().nonnegative(),
27588
+ sessionId: string()
27589
+ }), WebrtcSessionDebugSchema, { kind: "query" })
27425
27590
  },
27426
27591
  /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
27427
27592
  mount: { kind: "server-provided" }
@@ -41619,6 +41784,12 @@ Object.freeze({
41619
41784
  addonId: null,
41620
41785
  access: "view"
41621
41786
  },
41787
+ "webrtcSession.getSessionDebug": {
41788
+ capName: "webrtc-session",
41789
+ capScope: "device",
41790
+ addonId: null,
41791
+ access: "view"
41792
+ },
41622
41793
  "webrtcSession.getSessionState": {
41623
41794
  capName: "webrtc-session",
41624
41795
  capScope: "device",
@@ -43602,6 +43773,11 @@ Object.freeze({
43602
43773
  form: "single",
43603
43774
  optional: false
43604
43775
  }],
43776
+ "webrtcSession.getSessionDebug": [{
43777
+ name: "deviceId",
43778
+ form: "single",
43779
+ optional: false
43780
+ }],
43605
43781
  "webrtcSession.getSessionState": [{
43606
43782
  name: "deviceId",
43607
43783
  form: "single",