@camstack/types 1.2.42 → 1.2.44

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 (48) hide show
  1. package/dist/addon.js +8 -2
  2. package/dist/addon.mjs +8 -2
  3. package/dist/cap-call-context.d.ts +26 -0
  4. package/dist/capabilities/index.d.ts +8 -5
  5. package/dist/capabilities/osd-manager.cap.d.ts +900 -0
  6. package/dist/capabilities/pipeline-analytics.cap.d.ts +171 -4
  7. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +36 -0
  8. package/dist/capabilities/privacy-mask.cap.d.ts +69 -9
  9. package/dist/capabilities/recording.cap.d.ts +27 -0
  10. package/dist/capabilities/schemas/streaming-shared.d.ts +2 -0
  11. package/dist/capabilities/server-management.cap.d.ts +3 -3
  12. package/dist/capabilities/snapshot.cap.d.ts +1 -1
  13. package/dist/capabilities/stream-broker.cap.d.ts +36 -0
  14. package/dist/capabilities/stream-params.cap.d.ts +8 -4
  15. package/dist/device/device-profile.d.ts +12 -4
  16. package/dist/device/system-mirror.d.ts +11 -0
  17. package/dist/ffmpeg/encode-defaults.d.ts +18 -0
  18. package/dist/ffmpeg/fmp4-box-splitter.d.ts +113 -0
  19. package/dist/ffmpeg/fmp4-fragment-child.d.ts +85 -0
  20. package/dist/ffmpeg/fmp4-fragment-plane.d.ts +142 -0
  21. package/dist/ffmpeg/invocation.d.ts +102 -2
  22. package/dist/ffmpeg/sharing-key.d.ts +54 -2
  23. package/dist/fmp4-box-splitter-B53u9-Nu.mjs +615 -0
  24. package/dist/fmp4-box-splitter-BkWH7O3L.js +686 -0
  25. package/dist/generated/addon-api.d.ts +117 -0
  26. package/dist/generated/cap-input-defaults.d.ts +1 -1
  27. package/dist/generated/capability-router-map.d.ts +5 -2
  28. package/dist/generated/device-proxy.d.ts +4 -2
  29. package/dist/generated/method-access-map.d.ts +1 -1
  30. package/dist/generated/system-proxy.d.ts +2 -0
  31. package/dist/index.d.ts +4 -0
  32. package/dist/index.js +1264 -394
  33. package/dist/index.mjs +1217 -385
  34. package/dist/interfaces/camera-switches.d.ts +211 -5
  35. package/dist/interfaces/inference-engine.d.ts +24 -3
  36. package/dist/interfaces/stream-broker.d.ts +18 -0
  37. package/dist/node.d.ts +4 -0
  38. package/dist/node.js +509 -3
  39. package/dist/node.mjs +507 -3
  40. package/dist/notification/schedule.d.ts +20 -0
  41. package/dist/pipeline/native-lease.d.ts +150 -0
  42. package/dist/{sleep-BmNKsY7v.mjs → sleep-cC4Fuup8.mjs} +59 -3
  43. package/dist/{sleep-Cvi1JxZp.js → sleep-eiC10_cX.js} +64 -2
  44. package/dist/types/pipeline-step.d.ts +1 -1
  45. package/dist/utils/addon-id.d.ts +30 -0
  46. package/package.json +1 -1
  47. package/dist/canonical-hash-7nfBbEqR.mjs +0 -35
  48. package/dist/canonical-hash-BcZHRHIx.js +0 -40
@@ -247,6 +247,31 @@ export declare const TrackSourceSchema: z.ZodEnum<{
247
247
  pipeline: "pipeline";
248
248
  }>;
249
249
  export type TrackSource = z.infer<typeof TrackSourceSchema>;
250
+ /**
251
+ * Where a track sits in the RETRAIN lifecycle (D81).
252
+ *
253
+ * - `none` — never marked, or un-marked. Evictable.
254
+ * - `staging` — the operator wants this track as training material and has not
255
+ * finished with it. **This is the only state retention holds**: the track and
256
+ * everything it owns (object events, crops, keyframes, CLIP vector) survive
257
+ * the device's age window.
258
+ * - `trained` — the retrain page has taken what it needed. The frames it chose
259
+ * were COPIED into the retrain dataset at selection time, so the dataset no
260
+ * longer depends on the track's media and the track becomes EVICTABLE again.
261
+ * Terminal for the plain `markForTrain` toggle: returning it to `staging` is
262
+ * a deliberate action of the retrain page, not a side effect of a checkbox.
263
+ *
264
+ * There is no `null`. The state is stored `TEXT NOT NULL DEFAULT 'none'` because
265
+ * the store's filter language has only positive equality and `whereIn` — no
266
+ * negation, no IS NULL — so a NULL would be unselectable by ANY predicate and
267
+ * would make the entire pre-column history immortal in one deploy.
268
+ */
269
+ export declare const RetrainStatusSchema: z.ZodEnum<{
270
+ none: "none";
271
+ staging: "staging";
272
+ trained: "trained";
273
+ }>;
274
+ export type RetrainStatus = z.infer<typeof RetrainStatusSchema>;
250
275
  /**
251
276
  * The write half: a PARTIAL patch. An omitted key is left untouched, so setting
252
277
  * one flag can never clear the other — the toggles are independent and are
@@ -266,9 +291,45 @@ export declare const TrackFlagsSchema: z.ZodObject<{
266
291
  trackId: z.ZodString;
267
292
  markForTrain: z.ZodBoolean;
268
293
  debug: z.ZodBoolean;
294
+ retrainStatus: z.ZodEnum<{
295
+ none: "none";
296
+ staging: "staging";
297
+ trained: "trained";
298
+ }>;
269
299
  }, z.core.$strip>;
270
300
  export type TrackFlags = z.infer<typeof TrackFlagsSchema>;
301
+ /** Per-camera slice of a training-export estimate. */
302
+ export declare const TrainingExportDeviceTotalsSchema: z.ZodObject<{
303
+ deviceId: z.ZodNumber;
304
+ tracks: z.ZodNumber;
305
+ files: z.ZodNumber;
306
+ bytes: z.ZodNumber;
307
+ }, z.core.$strip>;
308
+ export type TrainingExportDeviceTotals = z.infer<typeof TrainingExportDeviceTotalsSchema>;
309
+ /**
310
+ * What a training export WOULD contain. Computed from media index rows only —
311
+ * no blob is read to produce this.
312
+ */
313
+ export declare const TrainingExportSummarySchema: z.ZodObject<{
314
+ generatedAt: z.ZodNumber;
315
+ trackCount: z.ZodNumber;
316
+ fileCount: z.ZodNumber;
317
+ byteCount: z.ZodNumber;
318
+ truncated: z.ZodBoolean;
319
+ devices: z.ZodReadonly<z.ZodArray<z.ZodObject<{
320
+ deviceId: z.ZodNumber;
321
+ tracks: z.ZodNumber;
322
+ files: z.ZodNumber;
323
+ bytes: z.ZodNumber;
324
+ }, z.core.$strip>>>;
325
+ }, z.core.$strip>;
326
+ export type TrainingExportSummary = z.infer<typeof TrainingExportSummarySchema>;
271
327
  declare const TrackSchema: z.ZodObject<{
328
+ retrainStatus: z.ZodOptional<z.ZodEnum<{
329
+ none: "none";
330
+ staging: "staging";
331
+ trained: "trained";
332
+ }>>;
272
333
  markForTrain: z.ZodOptional<z.ZodBoolean>;
273
334
  debug: z.ZodOptional<z.ZodBoolean>;
274
335
  trackId: z.ZodString;
@@ -550,6 +611,11 @@ declare const RecentTracksQueryInput: z.ZodObject<{
550
611
  export type RecentTracksQuery = z.infer<typeof RecentTracksQueryInput>;
551
612
  declare const RecentTracksPageSchema: z.ZodObject<{
552
613
  tracks: z.ZodReadonly<z.ZodArray<z.ZodObject<{
614
+ retrainStatus: z.ZodOptional<z.ZodEnum<{
615
+ none: "none";
616
+ staging: "staging";
617
+ trained: "trained";
618
+ }>>;
553
619
  markForTrain: z.ZodOptional<z.ZodBoolean>;
554
620
  debug: z.ZodOptional<z.ZodBoolean>;
555
621
  trackId: z.ZodString;
@@ -622,6 +688,11 @@ declare const RecentTracksPageSchema: z.ZodObject<{
622
688
  }, z.core.$strip>;
623
689
  export type RecentTracksPage = z.infer<typeof RecentTracksPageSchema>;
624
690
  declare const KeyEventSchema: z.ZodObject<{
691
+ retrainStatus: z.ZodOptional<z.ZodEnum<{
692
+ none: "none";
693
+ staging: "staging";
694
+ trained: "trained";
695
+ }>>;
625
696
  markForTrain: z.ZodOptional<z.ZodBoolean>;
626
697
  debug: z.ZodOptional<z.ZodBoolean>;
627
698
  id: z.ZodString;
@@ -744,6 +815,11 @@ export declare const pipelineAnalyticsCapability: {
744
815
  readonly getActiveTracks: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
745
816
  deviceId: z.ZodNumber;
746
817
  }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
818
+ retrainStatus: z.ZodOptional<z.ZodEnum<{
819
+ none: "none";
820
+ staging: "staging";
821
+ trained: "trained";
822
+ }>>;
747
823
  markForTrain: z.ZodOptional<z.ZodBoolean>;
748
824
  debug: z.ZodOptional<z.ZodBoolean>;
749
825
  trackId: z.ZodString;
@@ -816,6 +892,11 @@ export declare const pipelineAnalyticsCapability: {
816
892
  deviceId: z.ZodNumber;
817
893
  trackId: z.ZodString;
818
894
  }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
895
+ retrainStatus: z.ZodOptional<z.ZodEnum<{
896
+ none: "none";
897
+ staging: "staging";
898
+ trained: "trained";
899
+ }>>;
819
900
  markForTrain: z.ZodOptional<z.ZodBoolean>;
820
901
  debug: z.ZodOptional<z.ZodBoolean>;
821
902
  trackId: z.ZodString;
@@ -910,6 +991,11 @@ export declare const pipelineAnalyticsCapability: {
910
991
  slim: "slim";
911
992
  }>>;
912
993
  }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
994
+ retrainStatus: z.ZodOptional<z.ZodEnum<{
995
+ none: "none";
996
+ staging: "staging";
997
+ trained: "trained";
998
+ }>>;
913
999
  markForTrain: z.ZodOptional<z.ZodBoolean>;
914
1000
  debug: z.ZodOptional<z.ZodBoolean>;
915
1001
  trackId: z.ZodString;
@@ -1000,6 +1086,11 @@ export declare const pipelineAnalyticsCapability: {
1000
1086
  }>>;
1001
1087
  }, z.core.$strip>, z.ZodObject<{
1002
1088
  tracks: z.ZodReadonly<z.ZodArray<z.ZodObject<{
1089
+ retrainStatus: z.ZodOptional<z.ZodEnum<{
1090
+ none: "none";
1091
+ staging: "staging";
1092
+ trained: "trained";
1093
+ }>>;
1003
1094
  markForTrain: z.ZodOptional<z.ZodBoolean>;
1004
1095
  debug: z.ZodOptional<z.ZodBoolean>;
1005
1096
  trackId: z.ZodString;
@@ -1323,6 +1414,11 @@ export declare const pipelineAnalyticsCapability: {
1323
1414
  minImportance: z.ZodOptional<z.ZodNumber>;
1324
1415
  classFilter: z.ZodOptional<z.ZodString>;
1325
1416
  }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
1417
+ retrainStatus: z.ZodOptional<z.ZodEnum<{
1418
+ none: "none";
1419
+ staging: "staging";
1420
+ trained: "trained";
1421
+ }>>;
1326
1422
  markForTrain: z.ZodOptional<z.ZodBoolean>;
1327
1423
  debug: z.ZodOptional<z.ZodBoolean>;
1328
1424
  id: z.ZodString;
@@ -1434,11 +1530,29 @@ export declare const pipelineAnalyticsCapability: {
1434
1530
  *
1435
1531
  * `auth: 'protected'` (the default), NOT `admin`: the viewer is an
1436
1532
  * authenticated non-admin surface and two of the three call sites are
1437
- * there. Revisit if a flag ever gains an effect that costs storage
1438
- * `deleteTracks` next door is admin for exactly that reason.
1533
+ * there. The note that used to sit here said to revisit this the day a flag
1534
+ * gained an effect that costs storage, and D81 is that day — `markForTrain`
1535
+ * now pins. It STAYS protected, and the reason is that the alternative
1536
+ * makes the feature pointless: marking a track is something you do while
1537
+ * looking at it, on the surface you were already looking at it on, and that
1538
+ * surface is the viewer. What the storage cost gets instead is a BOUND — a
1539
+ * per-device pin budget enforced in the body, refusing a new pin past the
1540
+ * limit while always allowing un-marking. `deleteTracks` next door is still
1541
+ * admin, because destroying evidence and preserving it are not symmetric.
1439
1542
  *
1440
- * Returns the RESOLVED state of both flags (absent `false`) so a caller
1441
- * can drive its toggle without a re-fetch. Rejects an unknown track.
1543
+ * `markForTrain` writes the retrain LIFECYCLE, not a boolean column: `true`
1544
+ * is `none staging`, `false` is `staging none`. A track already
1545
+ * `trained` refuses BOTH — its frames are copies inside the retrain dataset
1546
+ * and re-staging it from a generic toggle is how the same material gets
1547
+ * annotated twice under two ground truths. Returning a trained track to
1548
+ * staging is a deliberate action of the retrain page, which is also the only
1549
+ * thing that produces `trained` in the first place.
1550
+ *
1551
+ * Returns the RESOLVED state of both flags (absent → `false`) plus the
1552
+ * `retrainStatus` they were derived from, so a caller can drive its toggle
1553
+ * — and render a `trained` badge — without a re-fetch. Rejects an unknown
1554
+ * track, a new staging mark on a device already holding its full budget, and
1555
+ * any `markForTrain` write against a trained track.
1442
1556
  */
1443
1557
  readonly setTrackFlags: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
1444
1558
  deviceId: z.ZodNumber;
@@ -1451,6 +1565,11 @@ export declare const pipelineAnalyticsCapability: {
1451
1565
  trackId: z.ZodString;
1452
1566
  markForTrain: z.ZodBoolean;
1453
1567
  debug: z.ZodBoolean;
1568
+ retrainStatus: z.ZodEnum<{
1569
+ none: "none";
1570
+ staging: "staging";
1571
+ trained: "trained";
1572
+ }>;
1454
1573
  }, z.core.$strip>, "mutation">;
1455
1574
  /**
1456
1575
  * Durable event-store footprint for the management UI: event rows
@@ -1570,6 +1689,54 @@ export declare const pipelineAnalyticsCapability: {
1570
1689
  detail: z.ZodNullable<z.ZodString>;
1571
1690
  actor: z.ZodString;
1572
1691
  }, z.core.$strip>>>, "query">;
1692
+ /**
1693
+ * The CHEAP QUESTION, asked before any media moves: how big is the dataset
1694
+ * the marked (`markForTrain`) tracks would produce?
1695
+ *
1696
+ * Answered from media INDEX rows only — key, kind, size, timestamp — so it
1697
+ * costs ~2 KB of reads per track and no blob reads at all. The measured harm
1698
+ * behind D56 was a bulk pass that read and base64'd every blob a track owned
1699
+ * before deciding anything, taking hub-main to 82 s busy out of 120; an
1700
+ * export is that same I/O shape, so it inherits the same discipline: know
1701
+ * the size, then decide.
1702
+ *
1703
+ * `truncated` reports that more marked tracks exist than one pass carries.
1704
+ * Empty `deviceIds` ⇒ every device that has marked tracks.
1705
+ */
1706
+ readonly getTrainingExportSummary: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
1707
+ deviceIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1708
+ }, z.core.$strip>, z.ZodObject<{
1709
+ generatedAt: z.ZodNumber;
1710
+ trackCount: z.ZodNumber;
1711
+ fileCount: z.ZodNumber;
1712
+ byteCount: z.ZodNumber;
1713
+ truncated: z.ZodBoolean;
1714
+ devices: z.ZodReadonly<z.ZodArray<z.ZodObject<{
1715
+ deviceId: z.ZodNumber;
1716
+ tracks: z.ZodNumber;
1717
+ files: z.ZodNumber;
1718
+ bytes: z.ZodNumber;
1719
+ }, z.core.$strip>>>;
1720
+ }, z.core.$strip>, "query">;
1721
+ /**
1722
+ * Where to download the dataset archive.
1723
+ *
1724
+ * The BYTES do not come back through this cap — they come from the returned
1725
+ * data-plane URL, which streams a tar built entry by entry. A multi-gigabyte
1726
+ * archive base64'd through a unary RPC envelope would be held whole in
1727
+ * memory twice on a hub this repo has already OOM'd once (D9/D18 are the
1728
+ * same lesson about frames). `getDownloadUrl` on `recordingExport` is the
1729
+ * precedent, and this follows it deliberately.
1730
+ *
1731
+ * The archive contains a `manifest.json` FIRST, then the stored media
1732
+ * VERBATIM under `tracks/<deviceId>/<trackId>/…`. No crop is derived and no
1733
+ * model is run: a training set's pixels must be the pixels the pipeline saw.
1734
+ */
1735
+ readonly getTrainingExportUrl: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
1736
+ deviceIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1737
+ }, z.core.$strip>, z.ZodObject<{
1738
+ url: z.ZodString;
1739
+ }, z.core.$strip>, "query">;
1573
1740
  readonly getEventMedia: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
1574
1741
  eventId: z.ZodString;
1575
1742
  kind: z.ZodOptional<z.ZodEnum<{
@@ -442,11 +442,14 @@ declare const CameraStatusSchema: z.ZodObject<{
442
442
  storageBytes: z.ZodNumber;
443
443
  }, z.core.$strip>>;
444
444
  switchedOff: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
445
+ "privacy-mask": "privacy-mask";
445
446
  "audio-analysis": "audio-analysis";
446
447
  recording: "recording";
447
448
  "stream-broker": "stream-broker";
448
449
  notifications: "notifications";
449
450
  "object-detection": "object-detection";
451
+ "device-audio": "device-audio";
452
+ "broker-audio": "broker-audio";
450
453
  }>>>;
451
454
  fetchedAt: z.ZodNumber;
452
455
  }, z.core.$strip>;
@@ -1090,11 +1093,14 @@ export declare const pipelineOrchestratorCapability: {
1090
1093
  deviceId: z.ZodNumber;
1091
1094
  switches: z.ZodReadonly<z.ZodArray<z.ZodObject<{
1092
1095
  id: z.ZodEnum<{
1096
+ "privacy-mask": "privacy-mask";
1093
1097
  "audio-analysis": "audio-analysis";
1094
1098
  recording: "recording";
1095
1099
  "stream-broker": "stream-broker";
1096
1100
  notifications: "notifications";
1097
1101
  "object-detection": "object-detection";
1102
+ "device-audio": "device-audio";
1103
+ "broker-audio": "broker-audio";
1098
1104
  }>;
1099
1105
  label: z.ZodString;
1100
1106
  costWhenOff: z.ZodString;
@@ -1102,6 +1108,7 @@ export declare const pipelineOrchestratorCapability: {
1102
1108
  unavailableReason: z.ZodOptional<z.ZodEnum<{
1103
1109
  "no-provider": "no-provider";
1104
1110
  "source-unreachable": "source-unreachable";
1111
+ "not-configured": "not-configured";
1105
1112
  }>>;
1106
1113
  enabled: z.ZodBoolean;
1107
1114
  authority: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1113,6 +1120,14 @@ export declare const pipelineOrchestratorCapability: {
1113
1120
  kind: z.ZodLiteral<"recording-config">;
1114
1121
  }, z.core.$strip>, z.ZodObject<{
1115
1122
  kind: z.ZodLiteral<"notification-mute">;
1123
+ }, z.core.$strip>, z.ZodObject<{
1124
+ kind: z.ZodLiteral<"camera-audio">;
1125
+ capName: z.ZodString;
1126
+ }, z.core.$strip>, z.ZodObject<{
1127
+ kind: z.ZodLiteral<"camera-mask">;
1128
+ capName: z.ZodString;
1129
+ }, z.core.$strip>, z.ZodObject<{
1130
+ kind: z.ZodLiteral<"broker-audio-mute">;
1116
1131
  }, z.core.$strip>], "kind">;
1117
1132
  }, z.core.$strip>>>;
1118
1133
  fetchedAt: z.ZodNumber;
@@ -1133,22 +1148,28 @@ export declare const pipelineOrchestratorCapability: {
1133
1148
  readonly setCameraSwitch: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
1134
1149
  deviceId: z.ZodNumber;
1135
1150
  switchId: z.ZodEnum<{
1151
+ "privacy-mask": "privacy-mask";
1136
1152
  "audio-analysis": "audio-analysis";
1137
1153
  recording: "recording";
1138
1154
  "stream-broker": "stream-broker";
1139
1155
  notifications: "notifications";
1140
1156
  "object-detection": "object-detection";
1157
+ "device-audio": "device-audio";
1158
+ "broker-audio": "broker-audio";
1141
1159
  }>;
1142
1160
  enabled: z.ZodBoolean;
1143
1161
  }, z.core.$strip>, z.ZodObject<{
1144
1162
  deviceId: z.ZodNumber;
1145
1163
  switches: z.ZodReadonly<z.ZodArray<z.ZodObject<{
1146
1164
  id: z.ZodEnum<{
1165
+ "privacy-mask": "privacy-mask";
1147
1166
  "audio-analysis": "audio-analysis";
1148
1167
  recording: "recording";
1149
1168
  "stream-broker": "stream-broker";
1150
1169
  notifications: "notifications";
1151
1170
  "object-detection": "object-detection";
1171
+ "device-audio": "device-audio";
1172
+ "broker-audio": "broker-audio";
1152
1173
  }>;
1153
1174
  label: z.ZodString;
1154
1175
  costWhenOff: z.ZodString;
@@ -1156,6 +1177,7 @@ export declare const pipelineOrchestratorCapability: {
1156
1177
  unavailableReason: z.ZodOptional<z.ZodEnum<{
1157
1178
  "no-provider": "no-provider";
1158
1179
  "source-unreachable": "source-unreachable";
1180
+ "not-configured": "not-configured";
1159
1181
  }>>;
1160
1182
  enabled: z.ZodBoolean;
1161
1183
  authority: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1167,6 +1189,14 @@ export declare const pipelineOrchestratorCapability: {
1167
1189
  kind: z.ZodLiteral<"recording-config">;
1168
1190
  }, z.core.$strip>, z.ZodObject<{
1169
1191
  kind: z.ZodLiteral<"notification-mute">;
1192
+ }, z.core.$strip>, z.ZodObject<{
1193
+ kind: z.ZodLiteral<"camera-audio">;
1194
+ capName: z.ZodString;
1195
+ }, z.core.$strip>, z.ZodObject<{
1196
+ kind: z.ZodLiteral<"camera-mask">;
1197
+ capName: z.ZodString;
1198
+ }, z.core.$strip>, z.ZodObject<{
1199
+ kind: z.ZodLiteral<"broker-audio-mute">;
1170
1200
  }, z.core.$strip>], "kind">;
1171
1201
  }, z.core.$strip>>>;
1172
1202
  fetchedAt: z.ZodNumber;
@@ -1281,11 +1311,14 @@ export declare const pipelineOrchestratorCapability: {
1281
1311
  storageBytes: z.ZodNumber;
1282
1312
  }, z.core.$strip>>;
1283
1313
  switchedOff: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
1314
+ "privacy-mask": "privacy-mask";
1284
1315
  "audio-analysis": "audio-analysis";
1285
1316
  recording: "recording";
1286
1317
  "stream-broker": "stream-broker";
1287
1318
  notifications: "notifications";
1288
1319
  "object-detection": "object-detection";
1320
+ "device-audio": "device-audio";
1321
+ "broker-audio": "broker-audio";
1289
1322
  }>>>;
1290
1323
  fetchedAt: z.ZodNumber;
1291
1324
  }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
@@ -1398,11 +1431,14 @@ export declare const pipelineOrchestratorCapability: {
1398
1431
  storageBytes: z.ZodNumber;
1399
1432
  }, z.core.$strip>>;
1400
1433
  switchedOff: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
1434
+ "privacy-mask": "privacy-mask";
1401
1435
  "audio-analysis": "audio-analysis";
1402
1436
  recording: "recording";
1403
1437
  "stream-broker": "stream-broker";
1404
1438
  notifications: "notifications";
1405
1439
  "object-detection": "object-detection";
1440
+ "device-audio": "device-audio";
1441
+ "broker-audio": "broker-audio";
1406
1442
  }>>>;
1407
1443
  fetchedAt: z.ZodNumber;
1408
1444
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
@@ -1,13 +1,31 @@
1
1
  import { z } from 'zod';
2
- import { type InferNativeProvider } from './capability-definition.js';
3
2
  import { DeviceType } from '../device/device-type.js';
3
+ import { type InferNativeProvider } from './capability-definition.js';
4
4
  /**
5
- * Privacy mask = up to `maxRegions` SHAPES the camera blanks out (NOT a
6
- * cell grid). Reolink `<shelterList>` zones are rectangles; Hikvision
7
- * ISAPI `<RegionCoordinatesList>` zones are free polygons (this camera:
8
- * exactly 4 vertices, not necessarily axis-aligned). The cap composes the
9
- * shared rect|polygon subset of the MaskShape vocabulary. All coords are
10
- * normalized 0..1 (top-left origin).
5
+ * PRIVACY what the camera deliberately does not capture. Two planes:
6
+ *
7
+ * - **video**: up to `maxRegions` SHAPES the camera blanks out (NOT a cell
8
+ * grid). Reolink `<shelterList>` zones are rectangles; Hikvision ISAPI
9
+ * `<RegionCoordinatesList>` zones are free polygons (this camera: exactly
10
+ * 4 vertices, not necessarily axis-aligned). The cap composes the shared
11
+ * rect|polygon subset of the MaskShape vocabulary. All coords are
12
+ * normalized 0..1 (top-left origin).
13
+ * - **audio**: the camera's microphone. `setAudioEnabled(false)` stops the
14
+ * camera encoding an audio track at all, so EVERY consumer — live view,
15
+ * recording, the audio analyzer, an export — sees silent video. There is
16
+ * no server-side copy of this fact; the camera is the store and every read
17
+ * is a read-through, which is why a switch over it cannot drift
18
+ * ([D62](../../../../docs/decisions/adr-0062.md)).
19
+ *
20
+ * Both belong here for one reason: they are the two things an operator turns
21
+ * off when the answer to "what is this camera allowed to record" changes, and
22
+ * both are applied ON the device, before anything leaves it.
23
+ *
24
+ * **The audio flag has exactly one writer.** `stream-params` used to carry a
25
+ * per-profile `audio` in its patch schema — reachable from no UI and honoured
26
+ * by one provider — and it was removed when this landed. A second writer onto
27
+ * one device register is the shape of every knob this repo has shipped that
28
+ * disagreed with the one the reader read.
11
29
  */
12
30
  /** A privacy-mask region's geometry — rectangle or free polygon. */
13
31
  export declare const PrivacyMaskShapeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -41,7 +59,7 @@ export declare const PrivacyMaskRegionSchema: z.ZodObject<{
41
59
  }, z.core.$strip>>;
42
60
  }, z.core.$strip>], "kind">;
43
61
  }, z.core.$strip>;
44
- /** Current on-camera privacy-mask state — master enable + zones. */
62
+ /** Current on-camera privacy state — mask master enable + zones + microphone. */
45
63
  export declare const PrivacyMaskStatusSchema: z.ZodObject<{
46
64
  enabled: z.ZodBoolean;
47
65
  regions: z.ZodArray<z.ZodObject<{
@@ -61,9 +79,10 @@ export declare const PrivacyMaskStatusSchema: z.ZodObject<{
61
79
  }, z.core.$strip>>;
62
80
  }, z.core.$strip>], "kind">;
63
81
  }, z.core.$strip>>;
82
+ audioEnabled: z.ZodNullable<z.ZodBoolean>;
64
83
  lastFetchedAt: z.ZodNumber;
65
84
  }, z.core.$strip>;
66
- /** Per-camera availability. */
85
+ /** Per-camera availability. Probed, never assumed from the model name. */
67
86
  export declare const PrivacyMaskOptionsSchema: z.ZodObject<{
68
87
  maxRegions: z.ZodNumber;
69
88
  supportedShapes: z.ZodArray<z.ZodEnum<{
@@ -76,6 +95,7 @@ export declare const PrivacyMaskOptionsSchema: z.ZodObject<{
76
95
  min: z.ZodNumber;
77
96
  max: z.ZodNumber;
78
97
  }, z.core.$strip>>;
98
+ supportsAudioMute: z.ZodBoolean;
79
99
  }, z.core.$strip>;
80
100
  /** Partial change — every field optional. */
81
101
  export declare const PrivacyMaskPatchSchema: z.ZodObject<{
@@ -132,6 +152,7 @@ export declare const privacyMaskCapability: {
132
152
  min: z.ZodNumber;
133
153
  max: z.ZodNumber;
134
154
  }, z.core.$strip>>;
155
+ supportsAudioMute: z.ZodBoolean;
135
156
  }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
136
157
  readonly setMask: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
137
158
  deviceId: z.ZodNumber;
@@ -156,6 +177,24 @@ export declare const privacyMaskCapability: {
156
177
  }, z.core.$strip>>>;
157
178
  }, z.core.$strip>;
158
179
  }, z.core.$strip>, z.ZodVoid, "mutation">;
180
+ /**
181
+ * Turn the camera's microphone on or off, at the camera.
182
+ *
183
+ * Deliberately its OWN mutation rather than a field on
184
+ * {@link PrivacyMaskPatchSchema}: `patch.enabled` already means "the video
185
+ * mask master switch", and overloading it would make one boolean mean two
186
+ * unrelated things on the same call. It is also the only method here whose
187
+ * write leaves the device in a state a later `getStatus` reads back
188
+ * verbatim, which is what makes it safe as a switch authority.
189
+ *
190
+ * A camera whose `getOptions().supportsAudioMute` is false must REJECT
191
+ * this rather than silently accept it — a write nothing applies is exactly
192
+ * what the switch group exists to remove.
193
+ */
194
+ readonly setAudioEnabled: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
195
+ deviceId: z.ZodNumber;
196
+ enabled: z.ZodBoolean;
197
+ }, z.core.$strip>, z.ZodVoid, "mutation">;
159
198
  };
160
199
  readonly status: {
161
200
  readonly schema: z.ZodObject<{
@@ -177,6 +216,7 @@ export declare const privacyMaskCapability: {
177
216
  }, z.core.$strip>>;
178
217
  }, z.core.$strip>], "kind">;
179
218
  }, z.core.$strip>>;
219
+ audioEnabled: z.ZodNullable<z.ZodBoolean>;
180
220
  lastFetchedAt: z.ZodNumber;
181
221
  }, z.core.$strip>;
182
222
  readonly kind: "poll";
@@ -200,7 +240,27 @@ export declare const privacyMaskCapability: {
200
240
  }, z.core.$strip>>;
201
241
  }, z.core.$strip>], "kind">;
202
242
  }, z.core.$strip>>;
243
+ audioEnabled: z.ZodNullable<z.ZodBoolean>;
203
244
  lastFetchedAt: z.ZodNumber;
204
245
  }, z.core.$strip>;
205
246
  };
206
247
  export type IPrivacyMaskProvider = InferNativeProvider<typeof privacyMaskCapability>;
248
+ /**
249
+ * Collapse a camera's PER-PROFILE audio flags into the one answer
250
+ * {@link PrivacyMaskStatusSchema.shape.audioEnabled} promises.
251
+ *
252
+ * Both firmwares this cap talks to store the flag per stream profile, and
253
+ * both let those profiles disagree. The rule is `some`, not `every`: privacy
254
+ * is only satisfied when NOTHING is carrying sound, so a camera whose sub
255
+ * stream is still audible must read as `true` and be switchable off — not as
256
+ * `false` because the main stream happens to be muted already.
257
+ *
258
+ * An empty list is `null` ("this camera reported no audio flag at all"),
259
+ * never `false`.
260
+ *
261
+ * Lives here rather than in each provider so the rule the schema documents
262
+ * and the rule the providers apply cannot drift apart.
263
+ */
264
+ export declare function summarisePrivacyAudio(profiles: readonly {
265
+ readonly audioEnabled: boolean;
266
+ }[]): boolean | null;
@@ -109,6 +109,20 @@ export declare const ReadSegmentBytesResultSchema: z.ZodObject<{
109
109
  data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
110
110
  }, z.core.$strip>;
111
111
  export type ReadSegmentBytesResult = z.infer<typeof ReadSegmentBytesResultSchema>;
112
+ /**
113
+ * One GOP of a finalized segment, cut by byte range through the segment's own
114
+ * `mfra` (D31 on the D42 feeder path). `data` is the `ftyp`+`moov` head plus
115
+ * the single `moof`+`mdat` covering the requested instant — standalone-
116
+ * demuxable, never the whole file. When the segment's index cannot be parsed
117
+ * the provider degrades INSIDE the mechanism to the whole segment (still one
118
+ * `data`, `gopStartMs` = the segment start) — a worse read, not another path.
119
+ */
120
+ export declare const ReadGopBytesResultSchema: z.ZodObject<{
121
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
122
+ gopStartMs: z.ZodNumber;
123
+ gopDurMs: z.ZodNumber;
124
+ }, z.core.$strip>;
125
+ export type ReadGopBytesResult = z.infer<typeof ReadGopBytesResultSchema>;
112
126
  export declare const recordingCapability: {
113
127
  readonly name: "recording";
114
128
  readonly scope: "system";
@@ -246,6 +260,19 @@ export declare const recordingCapability: {
246
260
  }, z.core.$strip>, z.ZodObject<{
247
261
  data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
248
262
  }, z.core.$strip>, "query">;
263
+ /** Read the single GOP of segment `startMs` covering `epochMs`, by mfra
264
+ * byte range — the scrub-granular read (D31 letter on the feeder path).
265
+ * See {@link ReadGopBytesResultSchema} for the degradation contract. */
266
+ readonly readGopBytes: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
267
+ deviceId: z.ZodNumber;
268
+ profile: z.ZodString;
269
+ startMs: z.ZodNumber;
270
+ epochMs: z.ZodNumber;
271
+ }, z.core.$strip>, z.ZodObject<{
272
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
273
+ gopStartMs: z.ZodNumber;
274
+ gopDurMs: z.ZodNumber;
275
+ }, z.core.$strip>, "query">;
249
276
  readonly setDeviceConfig: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
250
277
  deviceId: z.ZodNumber;
251
278
  config: z.ZodObject<{
@@ -317,6 +317,8 @@ export declare const BrokerStatsSchema: z.ZodObject<{
317
317
  channels: z.ZodNumber;
318
318
  supported: z.ZodBoolean;
319
319
  }, z.core.$strip>>>;
320
+ audioMuted: z.ZodOptional<z.ZodBoolean>;
321
+ audioMutedDropped: z.ZodOptional<z.ZodNumber>;
320
322
  }, z.core.$strip>;
321
323
  /**
322
324
  * Exporter-facing "profile restream" entry. Returned by
@@ -50,8 +50,8 @@ declare const ServerBootModeSchema: z.ZodEnum<{
50
50
  */
51
51
  declare const ServerUpdateStateSchema: z.ZodEnum<{
52
52
  idle: "idle";
53
- checking: "checking";
54
53
  staging: "staging";
54
+ checking: "checking";
55
55
  "pending-restart": "pending-restart";
56
56
  "awaiting-confirmation": "awaiting-confirmation";
57
57
  }>;
@@ -123,8 +123,8 @@ declare const ServerPackageStatusSchema: z.ZodObject<{
123
123
  }>;
124
124
  updateState: z.ZodEnum<{
125
125
  idle: "idle";
126
- checking: "checking";
127
126
  staging: "staging";
127
+ checking: "checking";
128
128
  "pending-restart": "pending-restart";
129
129
  "awaiting-confirmation": "awaiting-confirmation";
130
130
  }>;
@@ -189,8 +189,8 @@ export declare const serverManagementCapability: {
189
189
  }>;
190
190
  updateState: z.ZodEnum<{
191
191
  idle: "idle";
192
- checking: "checking";
193
192
  staging: "staging";
193
+ checking: "checking";
194
194
  "pending-restart": "pending-restart";
195
195
  "awaiting-confirmation": "awaiting-confirmation";
196
196
  }>;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { type InferProvider } from './capability-definition.js';
3
2
  import { DeviceType } from '../device/device-type.js';
3
+ import { type InferProvider } from './capability-definition.js';
4
4
  /**
5
5
  * A single device snapshot returned as base64 JPEG/PNG.
6
6
  *