@camstack/types 1.2.44 → 1.2.46

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.
@@ -55,6 +55,8 @@ declare const DetailResultSchema: z.ZodObject<{
55
55
  }, z.core.$strip>>;
56
56
  embedding: z.ZodOptional<z.ZodString>;
57
57
  label: z.ZodOptional<z.ZodString>;
58
+ labelTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
59
+ labelModelId: z.ZodOptional<z.ZodString>;
58
60
  alignedCropJpeg: z.ZodOptional<z.ZodString>;
59
61
  nativeFaceShortSidePx: z.ZodOptional<z.ZodNumber>;
60
62
  }, z.core.$strip>;
@@ -623,6 +625,8 @@ export declare const pipelineRunnerCapability: {
623
625
  }, z.core.$strip>>;
624
626
  embedding: z.ZodOptional<z.ZodString>;
625
627
  label: z.ZodOptional<z.ZodString>;
628
+ labelTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
629
+ labelModelId: z.ZodOptional<z.ZodString>;
626
630
  alignedCropJpeg: z.ZodOptional<z.ZodString>;
627
631
  nativeFaceShortSidePx: z.ZodOptional<z.ZodNumber>;
628
632
  }, z.core.$strip>>;
@@ -699,6 +703,8 @@ export declare const pipelineRunnerCapability: {
699
703
  }, z.core.$strip>>;
700
704
  embedding: z.ZodOptional<z.ZodString>;
701
705
  label: z.ZodOptional<z.ZodString>;
706
+ labelTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
707
+ labelModelId: z.ZodOptional<z.ZodString>;
702
708
  alignedCropJpeg: z.ZodOptional<z.ZodString>;
703
709
  nativeFaceShortSidePx: z.ZodOptional<z.ZodNumber>;
704
710
  }, z.core.$strip>>;
@@ -8,6 +8,87 @@ export declare const StreamFormatSchema: z.ZodEnum<{
8
8
  mjpeg: "mjpeg";
9
9
  }>;
10
10
  export type StreamFormat = z.infer<typeof StreamFormatSchema>;
11
+ /** A container `produceEventMedia` can emit. */
12
+ export declare const EventMediaKindSchema: z.ZodEnum<{
13
+ mp4: "mp4";
14
+ gif: "gif";
15
+ }>;
16
+ export type EventMediaKind = z.infer<typeof EventMediaKindSchema>;
17
+ /**
18
+ * One produced artifact, referenced by HANDLE.
19
+ *
20
+ * Never inline bytes: a produced clip is 200 KB–5 MB and every consumer of this
21
+ * method is in another runner ([D9](../../../../docs/decisions/adr-0009.md),
22
+ * [D18](../../../../docs/decisions/adr-0018.md) — cross-process media is fetched
23
+ * on demand, compressed, by handle). `bytes` is here so a caller can decide
24
+ * whether it wants the fetch at all.
25
+ */
26
+ export declare const EventMediaArtifactSchema: z.ZodObject<{
27
+ kind: z.ZodEnum<{
28
+ mp4: "mp4";
29
+ gif: "gif";
30
+ }>;
31
+ handle: z.ZodString;
32
+ nodeId: z.ZodString;
33
+ mime: z.ZodString;
34
+ bytes: z.ZodNumber;
35
+ width: z.ZodNumber;
36
+ height: z.ZodNumber;
37
+ }, z.core.$strip>;
38
+ export type EventMediaArtifact = z.infer<typeof EventMediaArtifactSchema>;
39
+ /**
40
+ * What a production actually covered — the answer to the only question an
41
+ * operator asks about a notification clip.
42
+ *
43
+ * `fromTs`/`toTs` are WALL CLOCK, derived from the ring's own packet timeline,
44
+ * so a caller can state "this clip starts 4.1 s before the event" instead of
45
+ * inferring it from a duration. A production whose `fromTs` is later than the
46
+ * event is a production with no pre-roll, and that is exactly the defect this
47
+ * method exists to make visible rather than plausible.
48
+ */
49
+ export declare const EventMediaCoverageSchema: z.ZodObject<{
50
+ fromTs: z.ZodNumber;
51
+ toTs: z.ZodNumber;
52
+ packets: z.ZodNumber;
53
+ }, z.core.$strip>;
54
+ export type EventMediaCoverage = z.infer<typeof EventMediaCoverageSchema>;
55
+ /**
56
+ * The result of ONE cut, in every container the caller asked for.
57
+ *
58
+ * Every artifact in `media` came out of the SAME window of the SAME rendition —
59
+ * that is the whole reason this is one method rather than one call per format.
60
+ * A consumer attaching a gif and a video can no longer show two different
61
+ * moments, because it never chose two sources.
62
+ */
63
+ export declare const EventMediaProductionSchema: z.ZodObject<{
64
+ media: z.ZodReadonly<z.ZodArray<z.ZodObject<{
65
+ kind: z.ZodEnum<{
66
+ mp4: "mp4";
67
+ gif: "gif";
68
+ }>;
69
+ handle: z.ZodString;
70
+ nodeId: z.ZodString;
71
+ mime: z.ZodString;
72
+ bytes: z.ZodNumber;
73
+ width: z.ZodNumber;
74
+ height: z.ZodNumber;
75
+ }, z.core.$strip>>>;
76
+ coverage: z.ZodObject<{
77
+ fromTs: z.ZodNumber;
78
+ toTs: z.ZodNumber;
79
+ packets: z.ZodNumber;
80
+ }, z.core.$strip>;
81
+ profile: z.ZodEnum<{
82
+ high: "high";
83
+ mid: "mid";
84
+ low: "low";
85
+ }>;
86
+ video: z.ZodEnum<{
87
+ encode: "encode";
88
+ copy: "copy";
89
+ }>;
90
+ }, z.core.$strip>;
91
+ export type EventMediaProduction = z.infer<typeof EventMediaProductionSchema>;
11
92
  declare const RtspRestreamEntrySchema: z.ZodObject<{
12
93
  brokerId: z.ZodString;
13
94
  url: z.ZodString;
@@ -592,8 +673,8 @@ export declare const streamBrokerCapability: {
592
673
  preRollSec: z.ZodDefault<z.ZodNumber>;
593
674
  postRollSec: z.ZodDefault<z.ZodNumber>;
594
675
  format: z.ZodDefault<z.ZodEnum<{
595
- gif: "gif";
596
676
  mp4: "mp4";
677
+ gif: "gif";
597
678
  }>>;
598
679
  maxWidth: z.ZodDefault<z.ZodNumber>;
599
680
  fps: z.ZodDefault<z.ZodNumber>;
@@ -609,6 +690,88 @@ export declare const streamBrokerCapability: {
609
690
  }>;
610
691
  durationMs: z.ZodNumber;
611
692
  }, z.core.$strip>, "mutation">;
693
+ /**
694
+ * THE production point for event media — one window, every container.
695
+ *
696
+ * `renderPreBufferClip` renders ONE format per call, so a consumer wanting a
697
+ * gif and a video made two calls and got two windows. On 2026-08-08 the
698
+ * operator received exactly that: a gif around a doorbell press and an mp4
699
+ * of the six seconds after it. This method cuts once and derives the rest,
700
+ * so "the attachments agree" is a property of the service instead of a
701
+ * discipline every consumer has to keep.
702
+ *
703
+ * It is also the only place that owns the packets. The broker already
704
+ * retains an AnnexB ring per camera (`setClipRetention`, D32) — the
705
+ * prebuffer — so a production reaches BACKWARDS from the event with no
706
+ * process to spawn and nothing kept warm. It waits out `postSeconds`, muxes
707
+ * the window once (COPYING the camera's own H.264 whenever nothing is being
708
+ * changed), derives any gif from that same mux, and returns HANDLES.
709
+ *
710
+ * Intended for every future consumer, not just notifications: a clips API, a
711
+ * retrain export and an event export all want the same window of the same
712
+ * camera and must not each grow their own renderer.
713
+ */
714
+ readonly produceEventMedia: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
715
+ deviceId: z.ZodNumber;
716
+ profile: z.ZodOptional<z.ZodEnum<{
717
+ high: "high";
718
+ mid: "mid";
719
+ low: "low";
720
+ }>>;
721
+ aroundMs: z.ZodNumber;
722
+ preSeconds: z.ZodDefault<z.ZodNumber>;
723
+ postSeconds: z.ZodDefault<z.ZodNumber>;
724
+ kinds: z.ZodDefault<z.ZodArray<z.ZodEnum<{
725
+ mp4: "mp4";
726
+ gif: "gif";
727
+ }>>>;
728
+ gifMaxWidth: z.ZodDefault<z.ZodNumber>;
729
+ gifFps: z.ZodDefault<z.ZodNumber>;
730
+ speed: z.ZodDefault<z.ZodNumber>;
731
+ }, z.core.$strip>, z.ZodObject<{
732
+ media: z.ZodReadonly<z.ZodArray<z.ZodObject<{
733
+ kind: z.ZodEnum<{
734
+ mp4: "mp4";
735
+ gif: "gif";
736
+ }>;
737
+ handle: z.ZodString;
738
+ nodeId: z.ZodString;
739
+ mime: z.ZodString;
740
+ bytes: z.ZodNumber;
741
+ width: z.ZodNumber;
742
+ height: z.ZodNumber;
743
+ }, z.core.$strip>>>;
744
+ coverage: z.ZodObject<{
745
+ fromTs: z.ZodNumber;
746
+ toTs: z.ZodNumber;
747
+ packets: z.ZodNumber;
748
+ }, z.core.$strip>;
749
+ profile: z.ZodEnum<{
750
+ high: "high";
751
+ mid: "mid";
752
+ low: "low";
753
+ }>;
754
+ video: z.ZodEnum<{
755
+ encode: "encode";
756
+ copy: "copy";
757
+ }>;
758
+ }, z.core.$strip>, "mutation">;
759
+ /**
760
+ * Redeem a {@link EventMediaArtifactSchema} handle for its bytes.
761
+ *
762
+ * Separate from the production on purpose (D18): the producing runner keeps
763
+ * the artifact for a few minutes, and a consumer that only wanted the
764
+ * coverage never moves a megabyte. `null` once it has expired — a handle is
765
+ * short-lived by design and a caller that waited too long must see that
766
+ * rather than a zero-length file.
767
+ */
768
+ readonly fetchEventMedia: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
769
+ handle: z.ZodString;
770
+ }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
771
+ base64: z.ZodString;
772
+ mime: z.ZodString;
773
+ bytes: z.ZodNumber;
774
+ }, z.core.$strip>>, "mutation">;
612
775
  readonly listAllCameraStreams: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodObject<{
613
776
  camStreamId: z.ZodString;
614
777
  deviceId: z.ZodNumber;
@@ -4876,6 +4876,83 @@ export type AppRouter = TrpcCoreRouter<{
4876
4876
  output: z.infer<typeof pipelineAnalyticsCapability.methods.getTrainingExportUrl.output>;
4877
4877
  meta: object;
4878
4878
  }>;
4879
+ listRetrainStaging: TRPCQueryProcedure<{
4880
+ input: {
4881
+ [x: string]: unknown;
4882
+ } & z.input<typeof pipelineAnalyticsCapability.methods.listRetrainStaging.input>;
4883
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.listRetrainStaging.output>;
4884
+ meta: object;
4885
+ }>;
4886
+ listRetrainFrames: TRPCQueryProcedure<{
4887
+ input: {
4888
+ [x: string]: unknown;
4889
+ } & z.input<typeof pipelineAnalyticsCapability.methods.listRetrainFrames.input>;
4890
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.listRetrainFrames.output>;
4891
+ meta: object;
4892
+ }>;
4893
+ selectRetrainFrames: TRPCMutationProcedure<{
4894
+ input: {
4895
+ [x: string]: unknown;
4896
+ } & z.input<typeof pipelineAnalyticsCapability.methods.selectRetrainFrames.input>;
4897
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.selectRetrainFrames.output>;
4898
+ meta: object;
4899
+ }>;
4900
+ deselectRetrainFrame: TRPCMutationProcedure<{
4901
+ input: {
4902
+ [x: string]: unknown;
4903
+ } & z.input<typeof pipelineAnalyticsCapability.methods.deselectRetrainFrame.input>;
4904
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.deselectRetrainFrame.output>;
4905
+ meta: object;
4906
+ }>;
4907
+ getRetrainFrameImage: TRPCQueryProcedure<{
4908
+ input: {
4909
+ [x: string]: unknown;
4910
+ } & z.input<typeof pipelineAnalyticsCapability.methods.getRetrainFrameImage.input>;
4911
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.getRetrainFrameImage.output>;
4912
+ meta: object;
4913
+ }>;
4914
+ proposeRetrainAnnotations: TRPCMutationProcedure<{
4915
+ input: {
4916
+ [x: string]: unknown;
4917
+ } & z.input<typeof pipelineAnalyticsCapability.methods.proposeRetrainAnnotations.input>;
4918
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.proposeRetrainAnnotations.output>;
4919
+ meta: object;
4920
+ }>;
4921
+ listRetrainAnnotations: TRPCQueryProcedure<{
4922
+ input: {
4923
+ [x: string]: unknown;
4924
+ } & z.input<typeof pipelineAnalyticsCapability.methods.listRetrainAnnotations.input>;
4925
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.listRetrainAnnotations.output>;
4926
+ meta: object;
4927
+ }>;
4928
+ saveRetrainAnnotations: TRPCMutationProcedure<{
4929
+ input: {
4930
+ [x: string]: unknown;
4931
+ } & z.input<typeof pipelineAnalyticsCapability.methods.saveRetrainAnnotations.input>;
4932
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.saveRetrainAnnotations.output>;
4933
+ meta: object;
4934
+ }>;
4935
+ completeRetrainTrack: TRPCMutationProcedure<{
4936
+ input: {
4937
+ [x: string]: unknown;
4938
+ } & z.input<typeof pipelineAnalyticsCapability.methods.completeRetrainTrack.input>;
4939
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.completeRetrainTrack.output>;
4940
+ meta: object;
4941
+ }>;
4942
+ restageRetrainTrack: TRPCMutationProcedure<{
4943
+ input: {
4944
+ [x: string]: unknown;
4945
+ } & z.input<typeof pipelineAnalyticsCapability.methods.restageRetrainTrack.input>;
4946
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.restageRetrainTrack.output>;
4947
+ meta: object;
4948
+ }>;
4949
+ getRetrainExportUrl: TRPCQueryProcedure<{
4950
+ input: {
4951
+ [x: string]: unknown;
4952
+ } & z.input<typeof pipelineAnalyticsCapability.methods.getRetrainExportUrl.input>;
4953
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.getRetrainExportUrl.output>;
4954
+ meta: object;
4955
+ }>;
4879
4956
  getEventMedia: TRPCQueryProcedure<{
4880
4957
  input: {
4881
4958
  [x: string]: unknown;
@@ -6884,6 +6961,20 @@ export type AppRouter = TrpcCoreRouter<{
6884
6961
  output: z.infer<typeof streamBrokerCapability.methods.renderPreBufferClip.output>;
6885
6962
  meta: object;
6886
6963
  }>;
6964
+ produceEventMedia: TRPCMutationProcedure<{
6965
+ input: {
6966
+ [x: string]: unknown;
6967
+ } & z.input<typeof streamBrokerCapability.methods.produceEventMedia.input>;
6968
+ output: z.infer<typeof streamBrokerCapability.methods.produceEventMedia.output>;
6969
+ meta: object;
6970
+ }>;
6971
+ fetchEventMedia: TRPCMutationProcedure<{
6972
+ input: {
6973
+ [x: string]: unknown;
6974
+ } & z.input<typeof streamBrokerCapability.methods.fetchEventMedia.input>;
6975
+ output: z.infer<typeof streamBrokerCapability.methods.fetchEventMedia.output>;
6976
+ meta: object;
6977
+ }>;
6887
6978
  listAllCameraStreams: TRPCQueryProcedure<{
6888
6979
  input: {
6889
6980
  nodeId?: string | undefined;
@@ -11,7 +11,7 @@
11
11
  * Plain data, zero Zod: a forked runner must not import the schema barrel
12
12
  * (~144MB RSS per runner — D28).
13
13
  *
14
- * Coverage: 23 caps, 50 methods with defaults.
14
+ * Coverage: 23 caps, 51 methods with defaults.
15
15
  */
16
16
  export declare const CAP_INPUT_DEFAULTS: Readonly<Record<string, Readonly<Record<string, Readonly<Record<string, unknown>>>>>>;
17
17
  /**
@@ -280,7 +280,7 @@ export interface DeviceProxy {
280
280
  readonly plateGallery: Pick<InferDeviceProxyCap<typeof plateGalleryCapability>, 'listPlates' | 'getPlateByTrack'>;
281
281
  readonly recording: Pick<InferDeviceProxyCap<typeof recordingCapability>, 'getAvailability' | 'getDaysWithRecordings' | 'getPlaybackManifest' | 'getDeviceConfig' | 'locateSegment' | 'readSegmentBytes' | 'readGopBytes' | 'setDeviceConfig' | 'rescanStorage' | 'pruneFootage' | 'deleteFootprint' | 'renderGif' | 'renderClip' | 'getStatus' | 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
282
282
  readonly recordingExport: Pick<InferDeviceProxyCap<typeof recordingExportCapability>, 'createExport' | 'listExports'>;
283
- readonly streamBroker: Pick<InferDeviceProxyCap<typeof streamBrokerCapability>, 'publishCameraStream' | 'retractCameraStream' | 'assignProfile' | 'unassignProfile' | 'renderPreBufferClip' | 'restartProfile' | 'getDeviceAudioMute' | 'setDeviceAudioMute' | 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
283
+ readonly streamBroker: Pick<InferDeviceProxyCap<typeof streamBrokerCapability>, 'publishCameraStream' | 'retractCameraStream' | 'assignProfile' | 'unassignProfile' | 'renderPreBufferClip' | 'produceEventMedia' | 'restartProfile' | 'getDeviceAudioMute' | 'setDeviceAudioMute' | 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
284
284
  }
285
285
  /**
286
286
  * Build a DeviceProxy that pre-binds deviceId + nodeId on every method call
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 887 method paths across 121 capabilities.
9
+ * Coverage: 900 method paths across 121 capabilities.
10
10
  */
11
11
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
12
12
  export interface MethodAccessRecord {
@@ -89,7 +89,7 @@ export interface SystemProxy {
89
89
  readonly serverManagement: Pick<InferProvider<typeof serverManagementCapability>, 'getServerPackageStatus' | 'checkServerUpdate' | 'applyServerUpdate' | 'rollbackServerUpdate' | 'restartServer'>;
90
90
  readonly settingsStore: Pick<InferProvider<typeof settingsStoreCapability>, 'get' | 'set' | 'query' | 'insert' | 'update' | 'delete' | 'deleteWhere' | 'updateWhere' | 'count' | 'histogram' | 'isEmpty' | 'declareCollection'>;
91
91
  readonly storage: Pick<InferProvider<typeof storageCapability>, 'resolve' | 'write' | 'read' | 'exists' | 'list' | 'delete' | 'getAvailableSpace' | 'beginUpload' | 'writeChunk' | 'finalizeUpload' | 'abortUpload' | 'beginDownload' | 'readChunk' | 'endDownload' | 'listLocations' | 'getDefaultLocation' | 'listLocationDeclarations' | 'upsertLocation' | 'deleteLocation' | 'testLocation' | 'listProviders' | 'testConfig'>;
92
- readonly streamBroker: Pick<InferProvider<typeof streamBrokerCapability>, 'listAllCameraStreams' | 'listAllProfileSlots' | 'getBrokerStats' | 'probeStream' | 'listClients' | 'killClient' | 'getStreamUrl' | 'getStreamWithCodec' | 'releaseStreamWithCodec' | 'acquireEgressTranscode' | 'releaseEgressTranscode' | 'subscribeAudioChunks' | 'pullAudioChunks' | 'unsubscribeAudioChunks' | 'subscribeFrames' | 'pullFrameHandles' | 'unsubscribeFrames' | 'setPreBufferDuration' | 'getPreBufferInfo' | 'getRtspPort' | 'getAllRtspEntries' | 'getRtspEntry' | 'regenerateRtspToken' | 'setRtspEnabled' | 'isRtspEnabled'>;
92
+ readonly streamBroker: Pick<InferProvider<typeof streamBrokerCapability>, 'fetchEventMedia' | 'listAllCameraStreams' | 'listAllProfileSlots' | 'getBrokerStats' | 'probeStream' | 'listClients' | 'killClient' | 'getStreamUrl' | 'getStreamWithCodec' | 'releaseStreamWithCodec' | 'acquireEgressTranscode' | 'releaseEgressTranscode' | 'subscribeAudioChunks' | 'pullAudioChunks' | 'unsubscribeAudioChunks' | 'subscribeFrames' | 'pullFrameHandles' | 'unsubscribeFrames' | 'setPreBufferDuration' | 'getPreBufferInfo' | 'getRtspPort' | 'getAllRtspEntries' | 'getRtspEntry' | 'regenerateRtspToken' | 'setRtspEnabled' | 'isRtspEnabled'>;
93
93
  readonly system: Pick<InferProvider<typeof systemCapability>, 'info' | 'health' | 'featureFlags' | 'networkAddresses' | 'getRetentionConfig' | 'setRetentionConfig' | 'forceRetentionCleanup'>;
94
94
  readonly terminalSession: Pick<InferProvider<typeof terminalSessionCapability>, 'listProfiles' | 'listSessions' | 'openSession' | 'resize' | 'close'>;
95
95
  readonly toast: Pick<InferProvider<typeof toastCapability>, 'onToast'>;