@camstack/types 1.1.41 → 1.1.43

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-Dqd2OlRi.js");
2
+ const require_sleep = require("./sleep-DmvEGsRg.js");
3
3
  const require_err_msg = require("./err-msg-COpsHMw2.js");
4
4
  exports.BaseAddon = require_sleep.BaseAddon;
5
5
  exports.DATAPLANE_SECRET_HEADER = require_sleep.DATAPLANE_SECRET_HEADER;
package/dist/addon.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { A as parseJsonUnknown, D as asString, I as scopeKey, M as ReadinessRegistry, N as ReadinessTimeoutError, S as DeviceType, T as asJsonObject, a as viewerUiCapability, bt as EventCategory, ct as BaseAddon, ft as emitReadiness, i as deviceOpsCapability, j as DATAPLANE_SECRET_HEADER, lt as normalizeAddonInitResult, m as expandCapMethods, o as adminUiCapability, s as createDeviceProxy, t as sleep, xt as DisposerChain } from "./sleep-b4Jf2n33.mjs";
1
+ import { A as parseJsonUnknown, D as asString, I as scopeKey, M as ReadinessRegistry, N as ReadinessTimeoutError, S as DeviceType, T as asJsonObject, a as viewerUiCapability, bt as EventCategory, ct as BaseAddon, ft as emitReadiness, i as deviceOpsCapability, j as DATAPLANE_SECRET_HEADER, lt as normalizeAddonInitResult, m as expandCapMethods, o as adminUiCapability, s as createDeviceProxy, t as sleep, xt as DisposerChain } from "./sleep-Baang_XW.mjs";
2
2
  import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
3
3
  export { BaseAddon, DATAPLANE_SECRET_HEADER, DeviceType, DisposerChain, EventCategory, ReadinessRegistry, ReadinessTimeoutError, adminUiCapability, asJsonObject, asString, createDeviceProxy, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, normalizeAddonInitResult, parseJsonUnknown, scopeKey, sleep, viewerUiCapability };
@@ -28,9 +28,9 @@ declare const NotificationRuleTemplateSchema: z.ZodObject<{
28
28
  body: z.ZodString;
29
29
  imageMode: z.ZodEnum<{
30
30
  none: "none";
31
+ full: "full";
31
32
  crop: "crop";
32
33
  annotated: "annotated";
33
- full: "full";
34
34
  }>;
35
35
  }, z.core.$strip>;
36
36
  declare const NotificationRuleSchema: z.ZodObject<{
@@ -67,9 +67,9 @@ declare const NotificationRuleSchema: z.ZodObject<{
67
67
  body: z.ZodString;
68
68
  imageMode: z.ZodEnum<{
69
69
  none: "none";
70
+ full: "full";
70
71
  crop: "crop";
71
72
  annotated: "annotated";
72
- full: "full";
73
73
  }>;
74
74
  }, z.core.$strip>>;
75
75
  priority: z.ZodEnum<{
@@ -145,9 +145,9 @@ export declare const advancedNotifierCapability: {
145
145
  body: z.ZodString;
146
146
  imageMode: z.ZodEnum<{
147
147
  none: "none";
148
+ full: "full";
148
149
  crop: "crop";
149
150
  annotated: "annotated";
150
- full: "full";
151
151
  }>;
152
152
  }, z.core.$strip>>;
153
153
  priority: z.ZodEnum<{
@@ -193,9 +193,9 @@ export declare const advancedNotifierCapability: {
193
193
  body: z.ZodString;
194
194
  imageMode: z.ZodEnum<{
195
195
  none: "none";
196
+ full: "full";
196
197
  crop: "crop";
197
198
  annotated: "annotated";
198
- full: "full";
199
199
  }>;
200
200
  }, z.core.$strip>>;
201
201
  priority: z.ZodEnum<{
@@ -28,6 +28,13 @@ declare const FaceInfoSchema: z.ZodObject<{
28
28
  identityName: z.ZodOptional<z.ZodString>;
29
29
  assigned: z.ZodBoolean;
30
30
  base64: z.ZodOptional<z.ZodString>;
31
+ faceBbox: z.ZodOptional<z.ZodObject<{
32
+ x: z.ZodNumber;
33
+ y: z.ZodNumber;
34
+ w: z.ZodNumber;
35
+ h: z.ZodNumber;
36
+ }, z.core.$strip>>;
37
+ keyFrameMediaKey: z.ZodOptional<z.ZodString>;
31
38
  }, z.core.$strip>;
32
39
  export type FaceInfo = z.infer<typeof FaceInfoSchema>;
33
40
  export declare const faceGalleryCapability: {
@@ -90,6 +97,13 @@ export declare const faceGalleryCapability: {
90
97
  identityName: z.ZodOptional<z.ZodString>;
91
98
  assigned: z.ZodBoolean;
92
99
  base64: z.ZodOptional<z.ZodString>;
100
+ faceBbox: z.ZodOptional<z.ZodObject<{
101
+ x: z.ZodNumber;
102
+ y: z.ZodNumber;
103
+ w: z.ZodNumber;
104
+ h: z.ZodNumber;
105
+ }, z.core.$strip>>;
106
+ keyFrameMediaKey: z.ZodOptional<z.ZodString>;
93
107
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
94
108
  readonly getFaceByTrack: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
95
109
  deviceId: z.ZodNumber;
@@ -103,6 +117,13 @@ export declare const faceGalleryCapability: {
103
117
  identityName: z.ZodOptional<z.ZodString>;
104
118
  assigned: z.ZodBoolean;
105
119
  base64: z.ZodOptional<z.ZodString>;
120
+ faceBbox: z.ZodOptional<z.ZodObject<{
121
+ x: z.ZodNumber;
122
+ y: z.ZodNumber;
123
+ w: z.ZodNumber;
124
+ h: z.ZodNumber;
125
+ }, z.core.$strip>>;
126
+ keyFrameMediaKey: z.ZodOptional<z.ZodString>;
106
127
  }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
107
128
  readonly getFaceMedia: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
108
129
  faceId: z.ZodString;
@@ -74,12 +74,12 @@ export type { NetworkAccessStatus, NetworkEndpoint } from './network-access.cap.
74
74
  export { NetworkAccessStatusSchema, NetworkEndpointSchema, networkAccessCapability, } from './network-access.cap.js';
75
75
  export { type Attachment, AttachmentMediaTypeSchema, type AttachmentMediaType, AttachmentSchema, type DiscoveredTarget, DiscoveredTargetSchema, type INotificationOutputProvider, type NotificationAction, NotificationActionSchema, type NotificationFormat, NotificationFormatSchema, NotificationSchema, type RenderedAs, RenderedAsSchema, type SendResult, SendResultSchema, type Target, type TargetKind, type TargetKindCaps, TargetKindCapsSchema, type TargetKindLevel, TargetKindLevelSchema, TargetKindSchema, TargetSchema, type TestResult, TestResultSchema, notificationOutputCapability, } from './notification-output.cap.js';
76
76
  export { type IOauthIntegrationProvider, type OauthIntegrationDescriptor, OauthIntegrationDescriptorSchema, oauthIntegrationCapability, } from './oauth-integration.cap.js';
77
- export { type AudioEvent, AudioEventSchema, type DetectionSource, DetectionSourceSchema, type EventKind, EventKindSchema, type IPipelineAnalyticsProvider, type MediaFile, type MediaFileKind, MediaFileSchema, type MotionEvent, MotionEventSchema, type ObjectEvent, ObjectEventSchema, pipelineAnalyticsCapability, type ScoredObjectEvent, ScoredObjectEventSchema, type Track, TrackedDetectionSchema, TrackSchema, type TrackState, TrackStateSchema, } from './pipeline-analytics.cap.js';
77
+ export { type AudioEvent, AudioEventSchema, type DetectionSource, DetectionSourceSchema, type EventKind, EventKindSchema, type IPipelineAnalyticsProvider, type KeyEvent, KeyEventSchema, type MediaFile, type MediaFileKind, MediaFileSchema, type MotionEvent, MotionEventSchema, type ObjectEvent, ObjectEventSchema, pipelineAnalyticsCapability, type ScoredObjectEvent, ScoredObjectEventSchema, type Track, TrackedDetectionSchema, TrackSchema, type TrackState, TrackStateSchema, } from './pipeline-analytics.cap.js';
78
78
  export type { PipelineStepInputOutput, PipelineValidationIssue, PipelineValidationResult, } from './pipeline-executor.cap.js';
79
79
  export { ModelSubstitutionSchema, PipelineDefaultStepSchema, PipelineEngineChoiceSchema, PipelineRunResultBridge, PipelineStepInputSchema, PipelineValidationIssueSchema, PipelineValidationResultSchema, pipelineExecutorCapability, } from './pipeline-executor.cap.js';
80
80
  export type { CameraAssignmentStatus, CameraAudioStatus, CameraBrokerProfile, CameraBrokerStatus, CameraDecoderShm, CameraDecoderStatus, CameraDetectionPhase, CameraDetectionProvisioning, CameraDetectionProvisioningState, CameraDetectionStatus, CameraMotionStatus, CameraRecordingMode, CameraRecordingStatus, CameraSourceStatus, CameraSourceStream, CameraStatus, IngestOwner, } from './pipeline-orchestrator.cap.js';
81
81
  export { AgentLoadSummarySchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraDecoderShmSchema, CameraDecoderStatusSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMotionStatusSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusSchema, CapabilityBindingsSchema, GlobalMetricsSchema, IngestOwnerSchema, PipelineAssignmentSchema, pipelineOrchestratorCapability, } from './pipeline-orchestrator.cap.js';
82
- export type { MotionSource, MotionSources, ReportMotionInput, RunnerFrameSource, } from './pipeline-runner.cap.js';
82
+ export type { DetailParent, DetailResult, MotionSource, MotionSources, ReportMotionInput, RunDetailSubtreeInput, RunDetailSubtreeResult, RunnerFrameSource, } from './pipeline-runner.cap.js';
83
83
  export { MotionSourceEnum, MotionSourcesSchema, pipelineRunnerCapability, ReportMotionInputSchema, RunnerCameraConfigSchema, RunnerCameraDeviceUIFields, RunnerFrameSourceSchema, RunnerLocalLoadSchema, RunnerLocalMetricsSchema, } from './pipeline-runner.cap.js';
84
84
  export { AudioChunkInputSchema, AudioClassificationLabelSchema, AudioLevelSchema, BoundingBoxSchema, FrameInputSchema, SpatialDetectionSchema, } from './schemas/detection-shared.js';
85
85
  export { CameraMetricsSchema, CameraMetricsWithDeviceIdSchema, OrchestratorMetricsSchema, } from './schemas/orchestrator-metrics.js';
@@ -82,6 +82,9 @@ declare const TrackSchema: z.ZodObject<{
82
82
  entered: "entered";
83
83
  }>;
84
84
  active: z.ZodBoolean;
85
+ importance: z.ZodOptional<z.ZodNumber>;
86
+ bestEventId: z.ZodOptional<z.ZodString>;
87
+ importanceReason: z.ZodOptional<z.ZodString>;
85
88
  }, z.core.$strip>;
86
89
  export type Track = z.infer<typeof TrackSchema>;
87
90
  declare const MotionEventSchema: z.ZodObject<{
@@ -146,7 +149,9 @@ declare const ObjectEventSchema: z.ZodObject<{
146
149
  frameWidth: z.ZodOptional<z.ZodNumber>;
147
150
  frameHeight: z.ZodOptional<z.ZodNumber>;
148
151
  mediaKey: z.ZodOptional<z.ZodString>;
152
+ keyFrameMediaKey: z.ZodOptional<z.ZodString>;
149
153
  mediaUrl: z.ZodOptional<z.ZodString>;
154
+ importance: z.ZodOptional<z.ZodNumber>;
150
155
  id: z.ZodString;
151
156
  deviceId: z.ZodNumber;
152
157
  timestamp: z.ZodNumber;
@@ -177,6 +182,7 @@ declare const MediaFileKindEnum: z.ZodEnum<{
177
182
  fullFrameBoxed: "fullFrameBoxed";
178
183
  faceCrop: "faceCrop";
179
184
  plateCrop: "plateCrop";
185
+ keyFrame: "keyFrame";
180
186
  }>;
181
187
  export type MediaFileKind = z.infer<typeof MediaFileKindEnum>;
182
188
  declare const MediaFileSchema: z.ZodObject<{
@@ -191,12 +197,24 @@ declare const MediaFileSchema: z.ZodObject<{
191
197
  fullFrameBoxed: "fullFrameBoxed";
192
198
  faceCrop: "faceCrop";
193
199
  plateCrop: "plateCrop";
200
+ keyFrame: "keyFrame";
194
201
  }>;
195
202
  base64: z.ZodString;
196
203
  sizeBytes: z.ZodNumber;
197
204
  timestamp: z.ZodNumber;
198
205
  }, z.core.$strip>;
199
206
  export type MediaFile = z.infer<typeof MediaFileSchema>;
207
+ declare const KeyEventSchema: z.ZodObject<{
208
+ id: z.ZodString;
209
+ trackId: z.ZodString;
210
+ timestamp: z.ZodNumber;
211
+ className: z.ZodString;
212
+ label: z.ZodOptional<z.ZodString>;
213
+ importance: z.ZodNumber;
214
+ bestEventId: z.ZodString;
215
+ windowMs: z.ZodOptional<z.ZodNumber>;
216
+ }, z.core.$strip>;
217
+ export type KeyEvent = z.infer<typeof KeyEventSchema>;
200
218
  declare const TrackedDetectionSchema: z.ZodObject<{
201
219
  trackId: z.ZodString;
202
220
  className: z.ZodString;
@@ -244,7 +262,9 @@ export declare const ScoredObjectEventSchema: z.ZodObject<{
244
262
  frameWidth: z.ZodOptional<z.ZodNumber>;
245
263
  frameHeight: z.ZodOptional<z.ZodNumber>;
246
264
  mediaKey: z.ZodOptional<z.ZodString>;
265
+ keyFrameMediaKey: z.ZodOptional<z.ZodString>;
247
266
  mediaUrl: z.ZodOptional<z.ZodString>;
267
+ importance: z.ZodOptional<z.ZodNumber>;
248
268
  id: z.ZodString;
249
269
  deviceId: z.ZodNumber;
250
270
  timestamp: z.ZodNumber;
@@ -305,6 +325,9 @@ export declare const pipelineAnalyticsCapability: {
305
325
  entered: "entered";
306
326
  }>;
307
327
  active: z.ZodBoolean;
328
+ importance: z.ZodOptional<z.ZodNumber>;
329
+ bestEventId: z.ZodOptional<z.ZodString>;
330
+ importanceReason: z.ZodOptional<z.ZodString>;
308
331
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
309
332
  readonly getTrack: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
310
333
  deviceId: z.ZodNumber;
@@ -352,6 +375,9 @@ export declare const pipelineAnalyticsCapability: {
352
375
  entered: "entered";
353
376
  }>;
354
377
  active: z.ZodBoolean;
378
+ importance: z.ZodOptional<z.ZodNumber>;
379
+ bestEventId: z.ZodOptional<z.ZodString>;
380
+ importanceReason: z.ZodOptional<z.ZodString>;
355
381
  }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
356
382
  /** Historical completed tracks for a device. Queried from the
357
383
  * persisted `pipeline-analytics:tracks` collection; active tracks
@@ -404,6 +430,9 @@ export declare const pipelineAnalyticsCapability: {
404
430
  entered: "entered";
405
431
  }>;
406
432
  active: z.ZodBoolean;
433
+ importance: z.ZodOptional<z.ZodNumber>;
434
+ bestEventId: z.ZodOptional<z.ZodString>;
435
+ importanceReason: z.ZodOptional<z.ZodString>;
407
436
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
408
437
  readonly clearTracks: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
409
438
  deviceId: z.ZodNumber;
@@ -475,7 +504,9 @@ export declare const pipelineAnalyticsCapability: {
475
504
  frameWidth: z.ZodOptional<z.ZodNumber>;
476
505
  frameHeight: z.ZodOptional<z.ZodNumber>;
477
506
  mediaKey: z.ZodOptional<z.ZodString>;
507
+ keyFrameMediaKey: z.ZodOptional<z.ZodString>;
478
508
  mediaUrl: z.ZodOptional<z.ZodString>;
509
+ importance: z.ZodOptional<z.ZodNumber>;
479
510
  id: z.ZodString;
480
511
  deviceId: z.ZodNumber;
481
512
  timestamp: z.ZodNumber;
@@ -503,6 +534,31 @@ export declare const pipelineAnalyticsCapability: {
503
534
  deviceId: z.ZodNumber;
504
535
  timestamp: z.ZodNumber;
505
536
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
537
+ /**
538
+ * Importance-ranked highlights for a device+window. Queries completed
539
+ * tracks by (deviceId, firstSeen ∈ [since,until]), scores each (or reuses
540
+ * the persisted score), filters by minImportance/classFilter, orders by
541
+ * importance desc, and returns up to `limit` compact key events mapped to
542
+ * each track's best event. Legacy tracks lacking a persisted score are
543
+ * scored on-read (no write). Degrades to `[]` on error.
544
+ */
545
+ readonly getKeyEvents: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
546
+ deviceId: z.ZodNumber;
547
+ since: z.ZodNumber;
548
+ until: z.ZodNumber;
549
+ limit: z.ZodDefault<z.ZodNumber>;
550
+ minImportance: z.ZodOptional<z.ZodNumber>;
551
+ classFilter: z.ZodOptional<z.ZodString>;
552
+ }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
553
+ id: z.ZodString;
554
+ trackId: z.ZodString;
555
+ timestamp: z.ZodNumber;
556
+ className: z.ZodString;
557
+ label: z.ZodOptional<z.ZodString>;
558
+ importance: z.ZodNumber;
559
+ bestEventId: z.ZodString;
560
+ windowMs: z.ZodOptional<z.ZodNumber>;
561
+ }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
506
562
  /** Server-side bucketed event counts for the 24-hour timeline.
507
563
  * Returns one entry per non-empty bucket; empty buckets are omitted. */
508
564
  readonly getEventDensity: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
@@ -544,6 +600,7 @@ export declare const pipelineAnalyticsCapability: {
544
600
  fullFrameBoxed: "fullFrameBoxed";
545
601
  faceCrop: "faceCrop";
546
602
  plateCrop: "plateCrop";
603
+ keyFrame: "keyFrame";
547
604
  }>>;
548
605
  }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
549
606
  key: z.ZodString;
@@ -557,6 +614,7 @@ export declare const pipelineAnalyticsCapability: {
557
614
  fullFrameBoxed: "fullFrameBoxed";
558
615
  faceCrop: "faceCrop";
559
616
  plateCrop: "plateCrop";
617
+ keyFrame: "keyFrame";
560
618
  }>;
561
619
  base64: z.ZodString;
562
620
  sizeBytes: z.ZodNumber;
@@ -576,6 +634,7 @@ export declare const pipelineAnalyticsCapability: {
576
634
  fullFrameBoxed: "fullFrameBoxed";
577
635
  faceCrop: "faceCrop";
578
636
  plateCrop: "plateCrop";
637
+ keyFrame: "keyFrame";
579
638
  }>;
580
639
  base64: z.ZodString;
581
640
  sizeBytes: z.ZodNumber;
@@ -625,7 +684,9 @@ export declare const pipelineAnalyticsCapability: {
625
684
  frameWidth: z.ZodOptional<z.ZodNumber>;
626
685
  frameHeight: z.ZodOptional<z.ZodNumber>;
627
686
  mediaKey: z.ZodOptional<z.ZodString>;
687
+ keyFrameMediaKey: z.ZodOptional<z.ZodString>;
628
688
  mediaUrl: z.ZodOptional<z.ZodString>;
689
+ importance: z.ZodOptional<z.ZodNumber>;
629
690
  id: z.ZodString;
630
691
  deviceId: z.ZodNumber;
631
692
  timestamp: z.ZodNumber;
@@ -699,4 +760,4 @@ export declare const pipelineAnalyticsCapability: {
699
760
  };
700
761
  };
701
762
  export type IPipelineAnalyticsProvider = InferProvider<typeof pipelineAnalyticsCapability>;
702
- export { TrackStateSchema, EventKindSchema, TrackSchema, MotionEventSchema, ObjectEventSchema, AudioEventSchema, MediaFileKindEnum, MediaFileSchema, TrackedDetectionSchema, };
763
+ export { TrackStateSchema, EventKindSchema, TrackSchema, KeyEventSchema, MotionEventSchema, ObjectEventSchema, AudioEventSchema, MediaFileKindEnum, MediaFileSchema, TrackedDetectionSchema, };
@@ -891,6 +891,10 @@ export declare const pipelineExecutorCapability: {
891
891
  referenceImage: z.ZodOptional<z.ZodString>;
892
892
  deviceId: z.ZodOptional<z.ZodNumber>;
893
893
  sessionId: z.ZodOptional<z.ZodString>;
894
+ plane: z.ZodOptional<z.ZodEnum<{
895
+ frame: "frame";
896
+ full: "full";
897
+ }>>;
894
898
  }, z.core.$strip>, z.ZodCustom<FrameResult, FrameResult>, "mutation">;
895
899
  /**
896
900
  * Batched run — N raw frames packed into one cap call. The provider
@@ -1,6 +1,59 @@
1
1
  import { z } from 'zod';
2
2
  import { type InferProvider } from './capability-definition.js';
3
3
  import type { ConfigField } from '../interfaces/config-ui.js';
4
+ /**
5
+ * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
6
+ * decode worker resolves it against the RETAINED native frame's real pixel dims,
7
+ * so the caller supplies only the detection-res bbox divided by the detection
8
+ * dims — no native resolution to plumb.
9
+ */
10
+ export declare const NativeCropBboxSchema: z.ZodObject<{
11
+ x: z.ZodNumber;
12
+ y: z.ZodNumber;
13
+ w: z.ZodNumber;
14
+ h: z.ZodNumber;
15
+ }, z.core.$strip>;
16
+ /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
17
+ export declare const NativeCropResultSchema: z.ZodObject<{
18
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
19
+ width: z.ZodNumber;
20
+ height: z.ZodNumber;
21
+ }, z.core.$strip>;
22
+ export type NativeCropBbox = z.infer<typeof NativeCropBboxSchema>;
23
+ export type NativeCropCapResult = z.infer<typeof NativeCropResultSchema>;
24
+ /** Parent detection context passed to `runDetailSubtree` — the crop's
25
+ * originating detection, in FRAME-space coordinates. Reuses
26
+ * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
27
+ * the coordinates are frame-space rather than getNativeCrop's
28
+ * normalized [0,1] convention). */
29
+ declare const DetailParentSchema: z.ZodObject<{
30
+ bbox: z.ZodObject<{
31
+ x: z.ZodNumber;
32
+ y: z.ZodNumber;
33
+ w: z.ZodNumber;
34
+ h: z.ZodNumber;
35
+ }, z.core.$strip>;
36
+ className: z.ZodString;
37
+ }, z.core.$strip>;
38
+ /** One child-step result from `runDetailSubtree` — an embedding, label,
39
+ * or refined detection produced by running the crop-subtree on a
40
+ * single tracked detection. */
41
+ declare const DetailResultSchema: z.ZodObject<{
42
+ stepId: z.ZodString;
43
+ className: z.ZodString;
44
+ score: z.ZodNumber;
45
+ bbox: z.ZodOptional<z.ZodObject<{
46
+ x: z.ZodNumber;
47
+ y: z.ZodNumber;
48
+ w: z.ZodNumber;
49
+ h: z.ZodNumber;
50
+ }, z.core.$strip>>;
51
+ embedding: z.ZodOptional<z.ZodString>;
52
+ label: z.ZodOptional<z.ZodString>;
53
+ alignedCropJpeg: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>;
55
+ export type DetailParent = z.infer<typeof DetailParentSchema>;
56
+ export type DetailResult = z.infer<typeof DetailResultSchema>;
4
57
  /**
5
58
  * Source enum for motion signals fed to the runner. Extensible — add
6
59
  * new variants here when new motion-trigger paths are wired in
@@ -375,7 +428,122 @@ export declare const pipelineRunnerCapability: {
375
428
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
376
429
  /** List the deviceIds currently attached to this runner. */
377
430
  readonly getLocalCameras: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodNumber>>, import("./capability-definition.js").CapabilityMethodKind>;
431
+ /**
432
+ * Best-effort NATIVE-resolution crop of a retention-ring frame. Given the
433
+ * `FrameHandle` that rode an inference-result event and a normalized `bbox`,
434
+ * the runner asks the decode worker still holding that frame's NATIVE
435
+ * surface to GPU/CPU-crop ONLY the ROI at native res and download just the
436
+ * crop. Returns `null` on a miss (handle not registered, or the worker's
437
+ * tiny native-retention ring already evicted the frame) — the caller falls
438
+ * back to a detection-frame crop. Routed to the frame's owning node by
439
+ * `handle.nodeId`; NEVER ships a full native frame.
440
+ */
441
+ readonly getNativeCrop: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
442
+ handle: z.ZodObject<{
443
+ shmId: z.ZodString;
444
+ slot: z.ZodNumber;
445
+ seq: z.ZodNumber;
446
+ width: z.ZodNumber;
447
+ height: z.ZodNumber;
448
+ format: z.ZodEnum<{
449
+ jpeg: "jpeg";
450
+ rgb: "rgb";
451
+ bgr: "bgr";
452
+ yuv420: "yuv420";
453
+ gray: "gray";
454
+ }>;
455
+ pts: z.ZodNumber;
456
+ byteLength: z.ZodNumber;
457
+ nodeId: z.ZodString;
458
+ slotCount: z.ZodNumber;
459
+ }, z.core.$strip>;
460
+ bbox: z.ZodObject<{
461
+ x: z.ZodNumber;
462
+ y: z.ZodNumber;
463
+ w: z.ZodNumber;
464
+ h: z.ZodNumber;
465
+ }, z.core.$strip>;
466
+ maxWidth: z.ZodOptional<z.ZodNumber>;
467
+ }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
468
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
469
+ width: z.ZodNumber;
470
+ height: z.ZodNumber;
471
+ }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
472
+ /**
473
+ * Two-plane design: run the DETAIL subtree (crop children —
474
+ * embedding, classifier, refiner steps whose `inputClasses ≠ null`)
475
+ * for a single tracked detection. The per-frame plane (`runPipeline`
476
+ * with `plane: 'frame'`) skips crop children entirely; a track-level
477
+ * caller invokes this per-track, on its own cadence, instead of on
478
+ * every frame. Takes either a `frameHandle` (shm lease/session —
479
+ * preferred, zero-copy) or a `cropJpeg` fallback when the lease/
480
+ * session backing the frame is already gone. `steps` narrows which
481
+ * configured children to run (default: all configured children for
482
+ * `parent.className`). Returns `null` when neither frame source is
483
+ * resolvable (handle evicted and no cropJpeg fallback supplied).
484
+ */
485
+ readonly runDetailSubtree: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
486
+ deviceId: z.ZodNumber;
487
+ frameHandle: z.ZodOptional<z.ZodObject<{
488
+ shmId: z.ZodString;
489
+ slot: z.ZodNumber;
490
+ seq: z.ZodNumber;
491
+ width: z.ZodNumber;
492
+ height: z.ZodNumber;
493
+ format: z.ZodEnum<{
494
+ jpeg: "jpeg";
495
+ rgb: "rgb";
496
+ bgr: "bgr";
497
+ yuv420: "yuv420";
498
+ gray: "gray";
499
+ }>;
500
+ pts: z.ZodNumber;
501
+ byteLength: z.ZodNumber;
502
+ nodeId: z.ZodString;
503
+ slotCount: z.ZodNumber;
504
+ }, z.core.$strip>>;
505
+ cropJpeg: z.ZodOptional<z.ZodString>;
506
+ parent: z.ZodObject<{
507
+ bbox: z.ZodObject<{
508
+ x: z.ZodNumber;
509
+ y: z.ZodNumber;
510
+ w: z.ZodNumber;
511
+ h: z.ZodNumber;
512
+ }, z.core.$strip>;
513
+ className: z.ZodString;
514
+ }, z.core.$strip>;
515
+ steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
516
+ }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
517
+ details: z.ZodArray<z.ZodObject<{
518
+ stepId: z.ZodString;
519
+ className: z.ZodString;
520
+ score: z.ZodNumber;
521
+ bbox: z.ZodOptional<z.ZodObject<{
522
+ x: z.ZodNumber;
523
+ y: z.ZodNumber;
524
+ w: z.ZodNumber;
525
+ h: z.ZodNumber;
526
+ }, z.core.$strip>>;
527
+ embedding: z.ZodOptional<z.ZodString>;
528
+ label: z.ZodOptional<z.ZodString>;
529
+ alignedCropJpeg: z.ZodOptional<z.ZodString>;
530
+ }, z.core.$strip>>;
531
+ }, z.core.$strip>>, "mutation">;
378
532
  };
379
533
  };
380
534
  export type IPipelineRunnerProvider = InferProvider<typeof pipelineRunnerCapability>;
535
+ /**
536
+ * Named input/output types for `runDetailSubtree`, derived from the cap
537
+ * definition above (`InferProvider`) rather than a standalone exported zod
538
+ * schema — the method's input stays an INLINE `z.object({...})` literal so
539
+ * `scripts/lib/parse-cap.ts`'s `deviceBound` regex (which only scans a
540
+ * method's own inline call body for `deviceId: z.number(`) keeps detecting
541
+ * it as device-bound and `generate-device-proxy.ts` keeps mounting it on
542
+ * `DeviceProxy.pipelineRunner`. Extracting the input into a separate named
543
+ * schema constant (as `RunnerCameraConfigSchema` does for `attachCamera`)
544
+ * would silently drop it from the device proxy — verified via `npm run
545
+ * codegen` while implementing this cap.
546
+ */
547
+ export type RunDetailSubtreeInput = Parameters<IPipelineRunnerProvider['runDetailSubtree']>[0];
548
+ export type RunDetailSubtreeResult = NonNullable<Awaited<ReturnType<IPipelineRunnerProvider['runDetailSubtree']>>>;
381
549
  export { RunnerCameraConfigSchema, RunnerLocalLoadSchema, RunnerLocalMetricsSchema };