@camstack/types 1.2.225 → 1.2.227

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-VlZxDyXq.js");
2
+ const require_sleep = require("./sleep-D7DPSeiv.js");
3
3
  const require_event_category = require("./event-category-BVfsrBYA.js");
4
4
  const require_err_msg = require("./err-msg-COpsHMw2.js");
5
5
  //#region src/generated/cap-input-defaults.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as DeviceType, Et as normalizeAddonInitResult, G as ReadinessRegistry, H as nodePin, I as expandCapMethods, K as ReadinessTimeoutError, S as DEVICE_CHILDREN_BATCH_MAX, St as DATAPLANE_SECRET_HEADER, T as describeCustomActions, Tt as BaseAddon, U as readNodePin, Y as scopeKey, a as asJsonObject, b as deviceOpsCapability, d as BOOT_RECOVERY_BACKOFF_MS, f as DEVICE_SCOPED_CAPS, h as createEventBusSliceSource, j as adminUiCapability, kt as emitReadiness, m as createDeviceProxy, p as isDeviceScopedCap, s as asString, t as sleep, u as parseJsonUnknown, wt as DisposerChain, x as viewerUiCapability } from "./sleep-GU_us3DG.mjs";
1
+ import { A as DeviceType, At as emitReadiness, Ct as DATAPLANE_SECRET_HEADER, Dt as normalizeAddonInitResult, Et as BaseAddon, G as ReadinessRegistry, H as nodePin, I as expandCapMethods, K as ReadinessTimeoutError, S as DEVICE_CHILDREN_BATCH_MAX, T as describeCustomActions, Tt as DisposerChain, U as readNodePin, Y as scopeKey, a as asJsonObject, b as deviceOpsCapability, d as BOOT_RECOVERY_BACKOFF_MS, f as DEVICE_SCOPED_CAPS, h as createEventBusSliceSource, j as adminUiCapability, m as createDeviceProxy, p as isDeviceScopedCap, s as asString, t as sleep, u as parseJsonUnknown, x as viewerUiCapability } from "./sleep-CiR4z7r9.mjs";
2
2
  import { t as EventCategory } from "./event-category-BVDXG4tB.mjs";
3
3
  import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
@@ -100,16 +100,29 @@ function resolveStreamMaps(selection) {
100
100
  };
101
101
  }
102
102
  /** The `-vf` filter args, or `[]` when a consumer `-vf` already claims the slot. */
103
- function buildVideoFilterArgs(scale, outputArgs, filterGraph) {
103
+ function buildVideoFilterArgs(scale, outputArgs, filterGraph, hwUpload) {
104
104
  if (filterGraph) {
105
105
  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)");
106
106
  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");
107
107
  return [];
108
108
  }
109
- if (!scale) return [];
110
109
  if (outputArgs.some((a) => a === "-vf")) return [];
111
- if (scale.mode === "exact") return ["-vf", `scale=${scale.width}:${scale.height}`];
112
- return ["-vf", `scale='min(${scale.width},iw)':'min(${scale.height},ih)':force_original_aspect_ratio=decrease:force_divisible_by=2`];
110
+ if (!scale) return hwUpload.length > 0 ? ["-vf", hwUpload] : [];
111
+ const suffix = hwUpload.length > 0 ? `,${hwUpload}` : "";
112
+ if (scale.mode === "exact") return ["-vf", `scale=${scale.width}:${scale.height}${suffix}`];
113
+ return ["-vf", `scale='min(${scale.width},iw)':'min(${scale.height},ih)':force_original_aspect_ratio=decrease:force_divisible_by=2${suffix}`];
114
+ }
115
+ /**
116
+ * The upload filter a hardware encode needs, or `''`.
117
+ *
118
+ * Nothing is uploaded when the DECODE already left the frames on the GPU
119
+ * (`-hwaccel vaapi`): they are surfaces already, and uploading a surface is an
120
+ * error rather than a no-op.
121
+ */
122
+ function resolveHwUpload(device, decodeHwAccel) {
123
+ if (device === void 0) return "";
124
+ if (!isSoftwareDecode(decodeHwAccel)) return "";
125
+ return "format=nv12,hwupload";
113
126
  }
114
127
  /** Rate-control args for an encode plan. */
115
128
  function buildRateControlArgs(video) {
@@ -129,7 +142,7 @@ function buildRateControlArgs(video) {
129
142
  ];
130
143
  }
131
144
  /** The whole video block (`-vf` … `-c:v` … knobs), after `-i`. */
132
- function buildVideoArgs(video, outputArgs, filterGraph) {
145
+ function buildVideoArgs(video, outputArgs, filterGraph, hwEncode) {
133
146
  if (video.kind === "raw") {
134
147
  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");
135
148
  return [
@@ -149,8 +162,10 @@ function buildVideoArgs(video, outputArgs, filterGraph) {
149
162
  ...video.bitstreamFilter ? ["-bsf:v", video.bitstreamFilter] : []
150
163
  ];
151
164
  }
165
+ const hwUpload = hwEncode === void 0 ? "" : resolveHwUpload(hwEncode.device, hwEncode.decodeHwAccel);
166
+ 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");
152
167
  const args = [
153
- ...buildVideoFilterArgs(video.scale, outputArgs, filterGraph),
168
+ ...buildVideoFilterArgs(video.scale, outputArgs, filterGraph, hwUpload),
154
169
  "-c:v",
155
170
  video.encoder
156
171
  ];
@@ -320,10 +335,18 @@ function buildAudioSidecarArgs(sidecar) {
320
335
  * (`0:a:0?`): the sidecar is defined as the SOURCE's microphone on its own RTP
321
336
  * output, not as whatever the main output happens to carry.
322
337
  */
338
+ /** The hardware-encode context for this invocation, or `undefined`. */
339
+ function hwEncodeFor(inv) {
340
+ return inv.hwEncodeDevice === void 0 ? void 0 : {
341
+ device: inv.hwEncodeDevice,
342
+ decodeHwAccel: inv.decodeHwAccel
343
+ };
344
+ }
323
345
  function buildFfmpegArgs(inv) {
324
346
  const graph = inv.filterGraph ?? null;
325
347
  const head = [
326
348
  ...logBannerArgs(inv.logLevel),
349
+ ...inv.hwEncodeDevice !== void 0 ? ["-vaapi_device", inv.hwEncodeDevice.renderNode] : [],
327
350
  ...buildInputArgs(inv.input, inv.decodeHwAccel),
328
351
  ...(inv.extraInputs ?? []).flatMap((extra) => buildInputArgs(extra, inv.decodeHwAccel)),
329
352
  ...graph ? ["-filter_complex", graph.graph] : []
@@ -337,7 +360,7 @@ function buildFfmpegArgs(inv) {
337
360
  "-an",
338
361
  "-map",
339
362
  maps.video ?? "0:v:0",
340
- ...buildVideoArgs(inv.video, inv.outputArgs, graph),
363
+ ...buildVideoArgs(inv.video, inv.outputArgs, graph, hwEncodeFor(inv)),
341
364
  ...threadArgs,
342
365
  ...inv.outputArgs,
343
366
  ...buildRtpOutputArgs(inv.sink.video)
@@ -360,7 +383,7 @@ function buildFfmpegArgs(inv) {
360
383
  return [
361
384
  ...head,
362
385
  ...videoMapArgs,
363
- ...buildVideoArgs(inv.video, inv.outputArgs, graph),
386
+ ...buildVideoArgs(inv.video, inv.outputArgs, graph, hwEncodeFor(inv)),
364
387
  ...threadArgs,
365
388
  ...mutedAudio ? [] : audioMapArgs,
366
389
  ...audioArgs,
@@ -100,16 +100,29 @@ function resolveStreamMaps(selection) {
100
100
  };
101
101
  }
102
102
  /** The `-vf` filter args, or `[]` when a consumer `-vf` already claims the slot. */
103
- function buildVideoFilterArgs(scale, outputArgs, filterGraph) {
103
+ function buildVideoFilterArgs(scale, outputArgs, filterGraph, hwUpload) {
104
104
  if (filterGraph) {
105
105
  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)");
106
106
  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");
107
107
  return [];
108
108
  }
109
- if (!scale) return [];
110
109
  if (outputArgs.some((a) => a === "-vf")) return [];
111
- if (scale.mode === "exact") return ["-vf", `scale=${scale.width}:${scale.height}`];
112
- return ["-vf", `scale='min(${scale.width},iw)':'min(${scale.height},ih)':force_original_aspect_ratio=decrease:force_divisible_by=2`];
110
+ if (!scale) return hwUpload.length > 0 ? ["-vf", hwUpload] : [];
111
+ const suffix = hwUpload.length > 0 ? `,${hwUpload}` : "";
112
+ if (scale.mode === "exact") return ["-vf", `scale=${scale.width}:${scale.height}${suffix}`];
113
+ return ["-vf", `scale='min(${scale.width},iw)':'min(${scale.height},ih)':force_original_aspect_ratio=decrease:force_divisible_by=2${suffix}`];
114
+ }
115
+ /**
116
+ * The upload filter a hardware encode needs, or `''`.
117
+ *
118
+ * Nothing is uploaded when the DECODE already left the frames on the GPU
119
+ * (`-hwaccel vaapi`): they are surfaces already, and uploading a surface is an
120
+ * error rather than a no-op.
121
+ */
122
+ function resolveHwUpload(device, decodeHwAccel) {
123
+ if (device === void 0) return "";
124
+ if (!isSoftwareDecode(decodeHwAccel)) return "";
125
+ return "format=nv12,hwupload";
113
126
  }
114
127
  /** Rate-control args for an encode plan. */
115
128
  function buildRateControlArgs(video) {
@@ -129,7 +142,7 @@ function buildRateControlArgs(video) {
129
142
  ];
130
143
  }
131
144
  /** The whole video block (`-vf` … `-c:v` … knobs), after `-i`. */
132
- function buildVideoArgs(video, outputArgs, filterGraph) {
145
+ function buildVideoArgs(video, outputArgs, filterGraph, hwEncode) {
133
146
  if (video.kind === "raw") {
134
147
  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");
135
148
  return [
@@ -149,8 +162,10 @@ function buildVideoArgs(video, outputArgs, filterGraph) {
149
162
  ...video.bitstreamFilter ? ["-bsf:v", video.bitstreamFilter] : []
150
163
  ];
151
164
  }
165
+ const hwUpload = hwEncode === void 0 ? "" : resolveHwUpload(hwEncode.device, hwEncode.decodeHwAccel);
166
+ 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");
152
167
  const args = [
153
- ...buildVideoFilterArgs(video.scale, outputArgs, filterGraph),
168
+ ...buildVideoFilterArgs(video.scale, outputArgs, filterGraph, hwUpload),
154
169
  "-c:v",
155
170
  video.encoder
156
171
  ];
@@ -320,10 +335,18 @@ function buildAudioSidecarArgs(sidecar) {
320
335
  * (`0:a:0?`): the sidecar is defined as the SOURCE's microphone on its own RTP
321
336
  * output, not as whatever the main output happens to carry.
322
337
  */
338
+ /** The hardware-encode context for this invocation, or `undefined`. */
339
+ function hwEncodeFor(inv) {
340
+ return inv.hwEncodeDevice === void 0 ? void 0 : {
341
+ device: inv.hwEncodeDevice,
342
+ decodeHwAccel: inv.decodeHwAccel
343
+ };
344
+ }
323
345
  function buildFfmpegArgs(inv) {
324
346
  const graph = inv.filterGraph ?? null;
325
347
  const head = [
326
348
  ...logBannerArgs(inv.logLevel),
349
+ ...inv.hwEncodeDevice !== void 0 ? ["-vaapi_device", inv.hwEncodeDevice.renderNode] : [],
327
350
  ...buildInputArgs(inv.input, inv.decodeHwAccel),
328
351
  ...(inv.extraInputs ?? []).flatMap((extra) => buildInputArgs(extra, inv.decodeHwAccel)),
329
352
  ...graph ? ["-filter_complex", graph.graph] : []
@@ -337,7 +360,7 @@ function buildFfmpegArgs(inv) {
337
360
  "-an",
338
361
  "-map",
339
362
  maps.video ?? "0:v:0",
340
- ...buildVideoArgs(inv.video, inv.outputArgs, graph),
363
+ ...buildVideoArgs(inv.video, inv.outputArgs, graph, hwEncodeFor(inv)),
341
364
  ...threadArgs,
342
365
  ...inv.outputArgs,
343
366
  ...buildRtpOutputArgs(inv.sink.video)
@@ -360,7 +383,7 @@ function buildFfmpegArgs(inv) {
360
383
  return [
361
384
  ...head,
362
385
  ...videoMapArgs,
363
- ...buildVideoArgs(inv.video, inv.outputArgs, graph),
386
+ ...buildVideoArgs(inv.video, inv.outputArgs, graph, hwEncodeFor(inv)),
364
387
  ...threadArgs,
365
388
  ...mutedAudio ? [] : audioMapArgs,
366
389
  ...audioArgs,
@@ -92,8 +92,8 @@ export type { DetailParent, DetailResult, MotionSource, MotionSources, ParkedFra
92
92
  export { FrameLazyCountersSchema, FrameLazyMetricsSchema, MotionSourceEnum, type DetectionSources, DetectionSourcesSchema, MotionSourcesSchema, type NativeCropBbox, NativeCropBboxSchema, NativeCropResultSchema, OccupancyBurstRefusalSchema, ParkedFrameKindSchema, ParkedTrackFrameSchema, ParkRefusalSchema, ParkTrackFrameResultSchema, pipelineRunnerCapability, ReportMotionInputSchema, RunnerCameraConfigSchema, RunnerCameraDeviceUIFields, RunnerFrameSourceSchema, RunnerInferenceDeviceSchema, RunnerLocalLoadSchema, RunnerLocalMetricsSchema, } from './pipeline-runner.cap.js';
93
93
  export { AudioChunkInputSchema, AudioClassificationLabelSchema, AudioLevelSchema, BoundingBoxSchema, FrameInputSchema, SpatialDetectionSchema, } from './schemas/detection-shared.js';
94
94
  export { CameraMetricsSchema, CameraMetricsWithDeviceIdSchema, OrchestratorMetricsSchema, } from './schemas/orchestrator-metrics.js';
95
- export type { CameraStream, CamProfile, CamStreamKind, DecodedAudioChunkWire, FrameHandleFormat, ProfileRtspEntry, ProfileSlot, ProfileSlotStatus, SubscribeAudioChunksInput, SubscribeAudioChunksResult, SubscribeFramesInput, SubscribeFramesResult, } from './schemas/streaming-shared.js';
96
- export { AudioChunkFormatSchema, BrokerStatsSchema, BrokerStatusSchema, CAM_PROFILE_ORDER, CameraStreamSchema, CamProfileSchema, CamStreamKindSchema, CamStreamResolutionSchema, DecodedAudioChunkSchema, DecodedFrameSchema, EncodedPacketSchema, FrameHandleFormatSchema, FrameHandleSchema, makeProfileBrokerId, makeSourceBrokerId, ProfileRtspEntrySchema, ProfileSlotSchema, ProfileSlotStatusSchema, parseProfileBrokerId, StreamSourceEntrySchema, StreamSourceSchema, SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, SubscribeFramesInputSchema, SubscribeFramesResultSchema, selectAssignedProfileSlots, } from './schemas/streaming-shared.js';
95
+ export type { CameraStream, CamProfile, CamStreamKind, DecodedAudioChunkWire, FrameHandleFormat, ProfileRtspEntry, ProfileSlot, AudioStreamPick, ProfileSlotStatus, SubscribeAudioChunksInput, SubscribeAudioChunksResult, SubscribeFramesInput, SubscribeFramesResult, } from './schemas/streaming-shared.js';
96
+ export { AudioChunkFormatSchema, AudioStreamPickSchema, BrokerStatsSchema, BrokerStatusSchema, CAM_PROFILE_ORDER, CameraStreamSchema, CamProfileSchema, CamStreamKindSchema, CamStreamResolutionSchema, DecodedAudioChunkSchema, DecodedFrameSchema, EncodedPacketSchema, FrameHandleFormatSchema, FrameHandleSchema, makeProfileBrokerId, makeSourceBrokerId, ProfileRtspEntrySchema, ProfileSlotSchema, ProfileSlotStatusSchema, parseProfileBrokerId, StreamSourceEntrySchema, StreamSourceSchema, SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, SubscribeFramesInputSchema, SubscribeFramesResultSchema, selectAssignedProfileSlots, } from './schemas/streaming-shared.js';
97
97
  export { buildEventKindDescriptor, EVENT_KIND_BY_CAP, EVENTFUL_CAP_NAMES, type SensorEventKindDescriptor, } from './sensor-event-kinds.js';
98
98
  export { type ImageContract, ImageContractSchema, type ImageContractState, ImageContractStateSchema, type IServerManagementProvider, type ServerBootMode, ServerBootModeSchema, type ServerPackageStatus, ServerPackageStatusSchema, type ServerRollbackInfo, ServerRollbackInfoSchema, type ServerUpdateActionResult, ServerUpdateActionResultSchema, type ServerUpdateCheckResult, ServerUpdateCheckResultSchema, type ServerUpdateState, ServerUpdateStateSchema, serverManagementCapability, type WrapperEvidence, WrapperEvidenceSchema, type WrapperIdentity, WrapperIdentitySchema, type WrapperKind, WrapperKindSchema, } from './server-management.cap.js';
99
99
  export { type BulkRecord, BulkRecordSchema, type CollectionColumn, CollectionColumnSchema, type CollectionIndex, CollectionIndexSchema, type ISettingsStoreProvider, type MutationFilter, MutationFilterSchema, QueryFilterSchema, SettingsRecordSchema, type SettingsStoreClient, settingsStoreCapability, } from './settings-store.cap.js';
@@ -120,7 +120,7 @@ export type { Clip, ClipPlayback, IVideoclipsProvider } from './videoclips.cap.j
120
120
  export { ClipPlaybackSchema, ClipSchema, MAX_CLIP_EVENT_IDS, MAX_CLIP_LABELS, videoclipsCapability, } from './videoclips.cap.js';
121
121
  export type { IViewerUiProvider } from './viewer-ui.cap.js';
122
122
  export { viewerUiCapability } from './viewer-ui.cap.js';
123
- export { type IWebrtcSessionProvider, type WebrtcClientHints, type WebrtcStreamChoice, WebrtcStreamChoiceSchema, type WebrtcStreamTarget, WebrtcStreamTargetSchema, webrtcClientHintsSchema, webrtcSessionCapability, } from './webrtc-session.cap.js';
123
+ export { type IWebrtcSessionProvider, type WebrtcClientHints, type WebrtcLadderDecision, WebrtcLadderDecisionSchema, type WebrtcSessionDebug, WebrtcSessionDebugSchema, type WebrtcStreamChoice, WebrtcStreamChoiceSchema, type WebrtcStreamTarget, WebrtcStreamTargetSchema, type WebrtcTierFailure, WebrtcTierFailureSchema, webrtcClientHintsSchema, webrtcSessionCapability, } from './webrtc-session.cap.js';
124
124
  export { type AccessoriesStatus, AccessoriesStatusSchema, accessoriesCapability, type IAccessoriesProvider, } from './accessories.cap.js';
125
125
  export { AddonAutoUpdateSchema, AddonListItemSchema, AutoUpdateSettingsSchema, addonsCapability, type BulkUpdateItem, type BulkUpdateItemStatus, type BulkUpdatePhase, type BulkUpdateState, CustomActionInputSchema, type IAddonsProvider, InstalledPackageSchema, LogStreamEntrySchema, PackageUpdateSchema, PackageVersionInfoSchema, SearchResultSchema, } from './addons.cap.js';
126
126
  export { type AirQualitySensorStatus, AirQualitySensorStatusSchema, airQualitySensorCapability, type IAirQualitySensorProvider, } from './air-quality-sensor.cap.js';
@@ -726,6 +726,7 @@ declare const MediaFileKindEnum: z.ZodEnum<{
726
726
  keyFrameSmall: "keyFrameSmall";
727
727
  thumbnailSmall: "thumbnailSmall";
728
728
  confirmationCrop: "confirmationCrop";
729
+ debugCrop: "debugCrop";
729
730
  sceneFrame: "sceneFrame";
730
731
  }>;
731
732
  export type MediaFileKind = z.infer<typeof MediaFileKindEnum>;
@@ -754,6 +755,7 @@ declare const MediaFileRefSchema: z.ZodObject<{
754
755
  keyFrameSmall: "keyFrameSmall";
755
756
  thumbnailSmall: "thumbnailSmall";
756
757
  confirmationCrop: "confirmationCrop";
758
+ debugCrop: "debugCrop";
757
759
  sceneFrame: "sceneFrame";
758
760
  }>;
759
761
  sizeBytes: z.ZodNumber;
@@ -829,6 +831,7 @@ declare const MediaFileSchema: z.ZodObject<{
829
831
  keyFrameSmall: "keyFrameSmall";
830
832
  thumbnailSmall: "thumbnailSmall";
831
833
  confirmationCrop: "confirmationCrop";
834
+ debugCrop: "debugCrop";
832
835
  sceneFrame: "sceneFrame";
833
836
  }>;
834
837
  sizeBytes: z.ZodNumber;
@@ -867,6 +870,7 @@ declare const MediaFileInfoSchema: z.ZodObject<{
867
870
  keyFrameSmall: "keyFrameSmall";
868
871
  thumbnailSmall: "thumbnailSmall";
869
872
  confirmationCrop: "confirmationCrop";
873
+ debugCrop: "debugCrop";
870
874
  sceneFrame: "sceneFrame";
871
875
  }>;
872
876
  url: z.ZodString;
@@ -1008,6 +1012,7 @@ export declare const RetrainFrameCandidateSchema: z.ZodObject<{
1008
1012
  keyFrameSmall: "keyFrameSmall";
1009
1013
  thumbnailSmall: "thumbnailSmall";
1010
1014
  confirmationCrop: "confirmationCrop";
1015
+ debugCrop: "debugCrop";
1011
1016
  sceneFrame: "sceneFrame";
1012
1017
  }>;
1013
1018
  timestamp: z.ZodNumber;
@@ -1035,6 +1040,7 @@ export declare const RetrainFrameSchema: z.ZodObject<{
1035
1040
  keyFrameSmall: "keyFrameSmall";
1036
1041
  thumbnailSmall: "thumbnailSmall";
1037
1042
  confirmationCrop: "confirmationCrop";
1043
+ debugCrop: "debugCrop";
1038
1044
  sceneFrame: "sceneFrame";
1039
1045
  }>;
1040
1046
  sizeBytes: z.ZodNumber;
@@ -1069,6 +1075,7 @@ export declare const RetrainFrameSelectionSchema: z.ZodObject<{
1069
1075
  keyFrameSmall: "keyFrameSmall";
1070
1076
  thumbnailSmall: "thumbnailSmall";
1071
1077
  confirmationCrop: "confirmationCrop";
1078
+ debugCrop: "debugCrop";
1072
1079
  sceneFrame: "sceneFrame";
1073
1080
  }>;
1074
1081
  sizeBytes: z.ZodNumber;
@@ -1103,6 +1110,7 @@ export declare const RetrainFrameListSchema: z.ZodObject<{
1103
1110
  keyFrameSmall: "keyFrameSmall";
1104
1111
  thumbnailSmall: "thumbnailSmall";
1105
1112
  confirmationCrop: "confirmationCrop";
1113
+ debugCrop: "debugCrop";
1106
1114
  sceneFrame: "sceneFrame";
1107
1115
  }>;
1108
1116
  timestamp: z.ZodNumber;
@@ -1128,6 +1136,7 @@ export declare const RetrainFrameListSchema: z.ZodObject<{
1128
1136
  keyFrameSmall: "keyFrameSmall";
1129
1137
  thumbnailSmall: "thumbnailSmall";
1130
1138
  confirmationCrop: "confirmationCrop";
1139
+ debugCrop: "debugCrop";
1131
1140
  sceneFrame: "sceneFrame";
1132
1141
  }>;
1133
1142
  sizeBytes: z.ZodNumber;
@@ -1730,6 +1739,7 @@ declare const EventMediaKindFootprintSchema: z.ZodObject<{
1730
1739
  keyFrameSmall: "keyFrameSmall";
1731
1740
  thumbnailSmall: "thumbnailSmall";
1732
1741
  confirmationCrop: "confirmationCrop";
1742
+ debugCrop: "debugCrop";
1733
1743
  sceneFrame: "sceneFrame";
1734
1744
  }>;
1735
1745
  rows: z.ZodNumber;
@@ -1778,6 +1788,7 @@ declare const EventMediaKindBreakdownSchema: z.ZodObject<{
1778
1788
  keyFrameSmall: "keyFrameSmall";
1779
1789
  thumbnailSmall: "thumbnailSmall";
1780
1790
  confirmationCrop: "confirmationCrop";
1791
+ debugCrop: "debugCrop";
1781
1792
  sceneFrame: "sceneFrame";
1782
1793
  }>;
1783
1794
  rows: z.ZodNumber;
@@ -3207,6 +3218,7 @@ export declare const pipelineAnalyticsCapability: {
3207
3218
  keyFrameSmall: "keyFrameSmall";
3208
3219
  thumbnailSmall: "thumbnailSmall";
3209
3220
  confirmationCrop: "confirmationCrop";
3221
+ debugCrop: "debugCrop";
3210
3222
  sceneFrame: "sceneFrame";
3211
3223
  }>;
3212
3224
  rows: z.ZodNumber;
@@ -3600,6 +3612,7 @@ export declare const pipelineAnalyticsCapability: {
3600
3612
  keyFrameSmall: "keyFrameSmall";
3601
3613
  thumbnailSmall: "thumbnailSmall";
3602
3614
  confirmationCrop: "confirmationCrop";
3615
+ debugCrop: "debugCrop";
3603
3616
  sceneFrame: "sceneFrame";
3604
3617
  }>;
3605
3618
  timestamp: z.ZodNumber;
@@ -3625,6 +3638,7 @@ export declare const pipelineAnalyticsCapability: {
3625
3638
  keyFrameSmall: "keyFrameSmall";
3626
3639
  thumbnailSmall: "thumbnailSmall";
3627
3640
  confirmationCrop: "confirmationCrop";
3641
+ debugCrop: "debugCrop";
3628
3642
  sceneFrame: "sceneFrame";
3629
3643
  }>;
3630
3644
  sizeBytes: z.ZodNumber;
@@ -3672,6 +3686,7 @@ export declare const pipelineAnalyticsCapability: {
3672
3686
  keyFrameSmall: "keyFrameSmall";
3673
3687
  thumbnailSmall: "thumbnailSmall";
3674
3688
  confirmationCrop: "confirmationCrop";
3689
+ debugCrop: "debugCrop";
3675
3690
  sceneFrame: "sceneFrame";
3676
3691
  }>;
3677
3692
  sizeBytes: z.ZodNumber;
@@ -4083,6 +4098,7 @@ export declare const pipelineAnalyticsCapability: {
4083
4098
  keyFrameSmall: "keyFrameSmall";
4084
4099
  thumbnailSmall: "thumbnailSmall";
4085
4100
  confirmationCrop: "confirmationCrop";
4101
+ debugCrop: "debugCrop";
4086
4102
  sceneFrame: "sceneFrame";
4087
4103
  }>>;
4088
4104
  deviceId: z.ZodNumber;
@@ -4102,6 +4118,7 @@ export declare const pipelineAnalyticsCapability: {
4102
4118
  keyFrameSmall: "keyFrameSmall";
4103
4119
  thumbnailSmall: "thumbnailSmall";
4104
4120
  confirmationCrop: "confirmationCrop";
4121
+ debugCrop: "debugCrop";
4105
4122
  sceneFrame: "sceneFrame";
4106
4123
  }>;
4107
4124
  sizeBytes: z.ZodNumber;
@@ -4129,6 +4146,7 @@ export declare const pipelineAnalyticsCapability: {
4129
4146
  keyFrameSmall: "keyFrameSmall";
4130
4147
  thumbnailSmall: "thumbnailSmall";
4131
4148
  confirmationCrop: "confirmationCrop";
4149
+ debugCrop: "debugCrop";
4132
4150
  sceneFrame: "sceneFrame";
4133
4151
  }>>>;
4134
4152
  deviceId: z.ZodNumber;
@@ -4148,6 +4166,7 @@ export declare const pipelineAnalyticsCapability: {
4148
4166
  keyFrameSmall: "keyFrameSmall";
4149
4167
  thumbnailSmall: "thumbnailSmall";
4150
4168
  confirmationCrop: "confirmationCrop";
4169
+ debugCrop: "debugCrop";
4151
4170
  sceneFrame: "sceneFrame";
4152
4171
  }>;
4153
4172
  sizeBytes: z.ZodNumber;
@@ -4189,6 +4208,7 @@ export declare const pipelineAnalyticsCapability: {
4189
4208
  keyFrameSmall: "keyFrameSmall";
4190
4209
  thumbnailSmall: "thumbnailSmall";
4191
4210
  confirmationCrop: "confirmationCrop";
4211
+ debugCrop: "debugCrop";
4192
4212
  sceneFrame: "sceneFrame";
4193
4213
  }>;
4194
4214
  url: z.ZodString;
@@ -4237,6 +4257,7 @@ export declare const pipelineAnalyticsCapability: {
4237
4257
  keyFrameSmall: "keyFrameSmall";
4238
4258
  thumbnailSmall: "thumbnailSmall";
4239
4259
  confirmationCrop: "confirmationCrop";
4260
+ debugCrop: "debugCrop";
4240
4261
  sceneFrame: "sceneFrame";
4241
4262
  }>;
4242
4263
  url: z.ZodString;
@@ -332,6 +332,11 @@ declare const RunnerCameraConfigSchema: z.ZodObject<{
332
332
  detectionFps: z.ZodDefault<z.ZodNumber>;
333
333
  motionStreamId: z.ZodString;
334
334
  detectionStreamId: z.ZodString;
335
+ audioStreamPick: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
336
+ high: "high";
337
+ mid: "mid";
338
+ low: "low";
339
+ }>, z.ZodLiteral<"auto">]>>;
335
340
  motionSources: z.ZodDefault<z.ZodArray<z.ZodEnum<{
336
341
  onboard: "onboard";
337
342
  analyzer: "analyzer";
@@ -611,6 +616,11 @@ export declare const pipelineRunnerCapability: {
611
616
  detectionFps: z.ZodDefault<z.ZodNumber>;
612
617
  motionStreamId: z.ZodString;
613
618
  detectionStreamId: z.ZodString;
619
+ audioStreamPick: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
620
+ high: "high";
621
+ mid: "mid";
622
+ low: "low";
623
+ }>, z.ZodLiteral<"auto">]>>;
614
624
  motionSources: z.ZodDefault<z.ZodArray<z.ZodEnum<{
615
625
  onboard: "onboard";
616
626
  analyzer: "analyzer";
@@ -8,6 +8,22 @@ export declare const CamProfileSchema: z.ZodEnum<{
8
8
  export type CamProfile = z.infer<typeof CamProfileSchema>;
9
9
  /** Canonical ordering. Hard-coded; never sorted. */
10
10
  export declare const CAM_PROFILE_ORDER: readonly ["high", "mid", "low"];
11
+ /**
12
+ * Which rung a per-camera consumer listens on: an explicit profile, or `auto`.
13
+ *
14
+ * `auto` is a REAL value, not an absent one — it means "resolve it by the rule
15
+ * that consumer owns". It lives beside `CamProfile` because a rung is the only
16
+ * operator-facing way to name a stream: a cam-stream id is broker-internal and
17
+ * moves when a slot is reassigned, so a stored id silently stops meaning what
18
+ * the operator picked. Today's one user is the audio analyser, whose rule is
19
+ * "the lowest AVAILABLE native rung" (D537).
20
+ */
21
+ export declare const AudioStreamPickSchema: z.ZodUnion<readonly [z.ZodEnum<{
22
+ high: "high";
23
+ mid: "mid";
24
+ low: "low";
25
+ }>, z.ZodLiteral<"auto">]>;
26
+ export type AudioStreamPick = z.infer<typeof AudioStreamPickSchema>;
11
27
  export declare const CamStreamKindSchema: z.ZodEnum<{
12
28
  "pull-rtsp": "pull-rtsp";
13
29
  "pull-rtmp": "pull-rtmp";
@@ -77,6 +77,112 @@ export declare const WebrtcStreamChoiceSchema: z.ZodObject<{
77
77
  bitrateKbps: z.ZodNullable<z.ZodNumber>;
78
78
  }, z.core.$strip>;
79
79
  export type WebrtcStreamChoice = z.infer<typeof WebrtcStreamChoiceSchema>;
80
+ /**
81
+ * The last move the adaptive ladder made on this session, and the numbers it
82
+ * rested on. Mirrors `LadderDecision` in the stream-broker's
83
+ * `adaptive-controller.ts` — the log line's evidence, made readable.
84
+ *
85
+ * Nullability is load-bearing: `lossRatio: null` means the loss tracker had
86
+ * no window to report, which is NOT a link with zero loss.
87
+ */
88
+ export declare const WebrtcLadderDecisionSchema: z.ZodObject<{
89
+ cause: z.ZodEnum<{
90
+ healthy: "healthy";
91
+ loss: "loss";
92
+ stall: "stall";
93
+ }>;
94
+ tier: z.ZodNullable<z.ZodEnum<{
95
+ high: "high";
96
+ mid: "mid";
97
+ low: "low";
98
+ }>>;
99
+ forcedTranscodeDown: z.ZodBoolean;
100
+ lossRatio: z.ZodNullable<z.ZodNumber>;
101
+ clientKbps: z.ZodNullable<z.ZodNumber>;
102
+ stalledForMs: z.ZodNullable<z.ZodNumber>;
103
+ serverSending: z.ZodNullable<z.ZodBoolean>;
104
+ at: z.ZodNumber;
105
+ }, z.core.$strip>;
106
+ export type WebrtcLadderDecision = z.infer<typeof WebrtcLadderDecisionSchema>;
107
+ /** Per-tier count of MEASURED downgrades this viewer session has suffered. */
108
+ export declare const WebrtcTierFailureSchema: z.ZodObject<{
109
+ tier: z.ZodEnum<{
110
+ high: "high";
111
+ mid: "mid";
112
+ low: "low";
113
+ }>;
114
+ failures: z.ZodNumber;
115
+ }, z.core.$strip>;
116
+ export type WebrtcTierFailure = z.infer<typeof WebrtcTierFailureSchema>;
117
+ /**
118
+ * What the SERVER decided for one WebRTC session — the half the client cannot
119
+ * measure. See `getSessionDebug`.
120
+ */
121
+ export declare const WebrtcSessionDebugSchema: z.ZodObject<{
122
+ sessionId: z.ZodString;
123
+ alive: z.ZodBoolean;
124
+ observedAt: z.ZodNumber;
125
+ brokerId: z.ZodNullable<z.ZodString>;
126
+ camStreamId: z.ZodNullable<z.ZodString>;
127
+ sourceKind: z.ZodEnum<{
128
+ unknown: "unknown";
129
+ derived: "derived";
130
+ native: "native";
131
+ }>;
132
+ adaptive: z.ZodBoolean;
133
+ servedTier: z.ZodNullable<z.ZodEnum<{
134
+ high: "high";
135
+ mid: "mid";
136
+ low: "low";
137
+ }>>;
138
+ ingestNodeId: z.ZodNullable<z.ZodString>;
139
+ ingestIsRemote: z.ZodNullable<z.ZodBoolean>;
140
+ sourceCodec: z.ZodNullable<z.ZodString>;
141
+ negotiatedCodec: z.ZodNullable<z.ZodString>;
142
+ egressLeg: z.ZodEnum<{
143
+ unknown: "unknown";
144
+ copy: "copy";
145
+ transcode: "transcode";
146
+ }>;
147
+ brokerStatus: z.ZodNullable<z.ZodString>;
148
+ brokerCodec: z.ZodNullable<z.ZodString>;
149
+ brokerBitrateKbps: z.ZodNullable<z.ZodNumber>;
150
+ brokerInputFps: z.ZodNullable<z.ZodNumber>;
151
+ brokerUptimeMs: z.ZodNullable<z.ZodNumber>;
152
+ rtpPacketsSent: z.ZodNullable<z.ZodNumber>;
153
+ trackMode: z.ZodNullable<z.ZodEnum<{
154
+ live: "live";
155
+ recorded: "recorded";
156
+ }>>;
157
+ lastDecision: z.ZodNullable<z.ZodObject<{
158
+ cause: z.ZodEnum<{
159
+ healthy: "healthy";
160
+ loss: "loss";
161
+ stall: "stall";
162
+ }>;
163
+ tier: z.ZodNullable<z.ZodEnum<{
164
+ high: "high";
165
+ mid: "mid";
166
+ low: "low";
167
+ }>>;
168
+ forcedTranscodeDown: z.ZodBoolean;
169
+ lossRatio: z.ZodNullable<z.ZodNumber>;
170
+ clientKbps: z.ZodNullable<z.ZodNumber>;
171
+ stalledForMs: z.ZodNullable<z.ZodNumber>;
172
+ serverSending: z.ZodNullable<z.ZodBoolean>;
173
+ at: z.ZodNumber;
174
+ }, z.core.$strip>>;
175
+ tierFailures: z.ZodArray<z.ZodObject<{
176
+ tier: z.ZodEnum<{
177
+ high: "high";
178
+ mid: "mid";
179
+ low: "low";
180
+ }>;
181
+ failures: z.ZodNumber;
182
+ }, z.core.$strip>>;
183
+ upgradeCount: z.ZodNullable<z.ZodNumber>;
184
+ }, z.core.$strip>;
185
+ export type WebrtcSessionDebug = z.infer<typeof WebrtcSessionDebugSchema>;
80
186
  /**
81
187
  * WebRTC session — device-scoped facade over the system `webrtc` cap.
82
188
  *
@@ -361,6 +467,89 @@ export declare const webrtcSessionCapability: {
361
467
  }, z.core.$strip>>;
362
468
  alive: z.ZodBoolean;
363
469
  }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
470
+ /**
471
+ * The SERVER's half of the stream-debug overlay, for one live session.
472
+ *
473
+ * The client can measure its own transport (`getStats()`); it cannot see
474
+ * which rung `auto` actually resolved to, why the ladder last moved, or
475
+ * whether the rung it is being served is the camera's own encode or
476
+ * something this hub built. That asymmetry is why "quality is stuck on
477
+ * low" reports have historically been unanswerable from the viewer alone.
478
+ *
479
+ * EVERY measurement here is nullable and `null` means UNKNOWN, never zero
480
+ * (D393): a session whose ladder has never moved reports
481
+ * `lastDecision: null`, which is a different fact from a ladder that moved
482
+ * for `healthy` with a 0 loss ratio.
483
+ *
484
+ * Read-only, ~1 Hz, polled by the overlay only while it is visible.
485
+ */
486
+ readonly getSessionDebug: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
487
+ deviceId: z.ZodNumber;
488
+ sessionId: z.ZodString;
489
+ }, z.core.$strip>, z.ZodObject<{
490
+ sessionId: z.ZodString;
491
+ alive: z.ZodBoolean;
492
+ observedAt: z.ZodNumber;
493
+ brokerId: z.ZodNullable<z.ZodString>;
494
+ camStreamId: z.ZodNullable<z.ZodString>;
495
+ sourceKind: z.ZodEnum<{
496
+ unknown: "unknown";
497
+ derived: "derived";
498
+ native: "native";
499
+ }>;
500
+ adaptive: z.ZodBoolean;
501
+ servedTier: z.ZodNullable<z.ZodEnum<{
502
+ high: "high";
503
+ mid: "mid";
504
+ low: "low";
505
+ }>>;
506
+ ingestNodeId: z.ZodNullable<z.ZodString>;
507
+ ingestIsRemote: z.ZodNullable<z.ZodBoolean>;
508
+ sourceCodec: z.ZodNullable<z.ZodString>;
509
+ negotiatedCodec: z.ZodNullable<z.ZodString>;
510
+ egressLeg: z.ZodEnum<{
511
+ unknown: "unknown";
512
+ copy: "copy";
513
+ transcode: "transcode";
514
+ }>;
515
+ brokerStatus: z.ZodNullable<z.ZodString>;
516
+ brokerCodec: z.ZodNullable<z.ZodString>;
517
+ brokerBitrateKbps: z.ZodNullable<z.ZodNumber>;
518
+ brokerInputFps: z.ZodNullable<z.ZodNumber>;
519
+ brokerUptimeMs: z.ZodNullable<z.ZodNumber>;
520
+ rtpPacketsSent: z.ZodNullable<z.ZodNumber>;
521
+ trackMode: z.ZodNullable<z.ZodEnum<{
522
+ live: "live";
523
+ recorded: "recorded";
524
+ }>>;
525
+ lastDecision: z.ZodNullable<z.ZodObject<{
526
+ cause: z.ZodEnum<{
527
+ healthy: "healthy";
528
+ loss: "loss";
529
+ stall: "stall";
530
+ }>;
531
+ tier: z.ZodNullable<z.ZodEnum<{
532
+ high: "high";
533
+ mid: "mid";
534
+ low: "low";
535
+ }>>;
536
+ forcedTranscodeDown: z.ZodBoolean;
537
+ lossRatio: z.ZodNullable<z.ZodNumber>;
538
+ clientKbps: z.ZodNullable<z.ZodNumber>;
539
+ stalledForMs: z.ZodNullable<z.ZodNumber>;
540
+ serverSending: z.ZodNullable<z.ZodBoolean>;
541
+ at: z.ZodNumber;
542
+ }, z.core.$strip>>;
543
+ tierFailures: z.ZodArray<z.ZodObject<{
544
+ tier: z.ZodEnum<{
545
+ high: "high";
546
+ mid: "mid";
547
+ low: "low";
548
+ }>;
549
+ failures: z.ZodNumber;
550
+ }, z.core.$strip>>;
551
+ upgradeCount: z.ZodNullable<z.ZodNumber>;
552
+ }, z.core.$strip>, "query">;
364
553
  };
365
554
  /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
366
555
  readonly mount: {