@camstack/addon-admin-ui 1.2.100 → 1.2.102

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 (118) hide show
  1. package/dist/assets/{AddLocationWizard-ww2FaZ1E.js → AddLocationWizard-xjNUYOP4.js} +1 -1
  2. package/dist/assets/{AddonCollectionPage-2an6cPDR.js → AddonCollectionPage-DspmP66O.js} +1 -1
  3. package/dist/assets/Addons-ByXBZ3zi.js +1 -0
  4. package/dist/assets/{AdminTabs-Bp6VWjqO.js → AdminTabs-9AwhBI94.js} +1 -1
  5. package/dist/assets/{AiProfiles-DpS2g7XY.js → AiProfiles-CCe5_zY4.js} +2 -2
  6. package/dist/assets/{BrokerForm-MO0zLICQ.js → BrokerForm-VGXakxUd.js} +1 -1
  7. package/dist/assets/{Build-C6grDXZj.js → Build-DUqW5Gxx.js} +4 -4
  8. package/dist/assets/{Capabilities-C1oKrOiJ.js → Capabilities-B11_OV0Y.js} +1 -1
  9. package/dist/assets/{CapabilityBadges-CQ8iNKjJ.js → CapabilityBadges-BwNGTw8y.js} +1 -1
  10. package/dist/assets/{Cluster-BlBr9mrc.js → Cluster-D0TEBilk.js} +1 -1
  11. package/dist/assets/{Data-CbSER22j.js → Data-Cy67bW0a.js} +1 -1
  12. package/dist/assets/DetectionIntelligence-CK9np42Z.js +1 -0
  13. package/dist/assets/{DeviceAggregateSection-DJUAmzyp.js → DeviceAggregateSection-DGQHZLG0.js} +1 -1
  14. package/dist/assets/DeviceDetail-B1IOH7GM.js +2 -0
  15. package/dist/assets/Devices-DPoVojQK.js +1 -0
  16. package/dist/assets/{EmbedPlayerPage-4Ay_8z3U.js → EmbedPlayerPage-B6cO9q5G.js} +1 -1
  17. package/dist/assets/Events-bNZw4v7L.js +1 -0
  18. package/dist/assets/FormBuilder-DqBRb6Sj.js +1 -0
  19. package/dist/assets/Identity-C4yPB2tV.js +1 -0
  20. package/dist/assets/IntegrationDetail-DjBnD4E4.js +1 -0
  21. package/dist/assets/Integrations-BB3fSZZW.js +1 -0
  22. package/dist/assets/Integrations-DKpeygWw.js +1 -0
  23. package/dist/assets/{Logs-It8Tm5s9.js → Logs-BTBIyLNd.js} +1 -1
  24. package/dist/assets/{MotionZonesSettings-DwzHsRPk.js → MotionZonesSettings-CtGDIBWB.js} +1 -1
  25. package/dist/assets/{MyAccess-Bo811JUn.js → MyAccess-DHUGIabu.js} +1 -1
  26. package/dist/assets/Network-CnSsPmeV.js +1 -0
  27. package/dist/assets/{NodeAddonsSettingsPanel-hGBeOFYH.js → NodeAddonsSettingsPanel-8F1PhiIq.js} +1 -1
  28. package/dist/assets/NodeInferenceDevices-Bvq9dR_b.js +1 -0
  29. package/dist/assets/Notifications-DeakyZJa.js +1 -0
  30. package/dist/assets/Pipeline-Bhr3dmlx.js +1 -0
  31. package/dist/assets/Plates-Cmi99Ln5.js +1 -0
  32. package/dist/assets/{PrivacyMaskSettings-B_z0irSV.js → PrivacyMaskSettings-B2h2VMyH.js} +1 -1
  33. package/dist/assets/{ProviderIcon-DupRG1e9.js → ProviderIcon-BVClDyfu.js} +1 -1
  34. package/dist/assets/Recordings-C9LP3o_e.js +1 -0
  35. package/dist/assets/{ScanNetworkModal-D0r0hQ_h.js → ScanNetworkModal-IRdKOplG.js} +1 -1
  36. package/dist/assets/{SceneMonitorEditor-CGXIUSVs.js → SceneMonitorEditor-BOdP3AvS.js} +1 -1
  37. package/dist/assets/Scenes-PSzaKz5n.js +1 -0
  38. package/dist/assets/{Settings-Bh1XKvEL.js → Settings-C4mHm6M2.js} +1 -1
  39. package/dist/assets/{Showroom-BzVgVZC7.js → Showroom-CQPNOoYB.js} +1 -1
  40. package/dist/assets/{Terminal-B58p5WIp.js → Terminal-CvJ3MtHJ.js} +3 -3
  41. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-TBqHL73f.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DccaVQGd.js} +1 -1
  42. package/dist/assets/{bell-ring-DTczejZ4.js → bell-ring-BlXqso2t.js} +1 -1
  43. package/dist/assets/{boxes-C985Wrl0.js → boxes-C7tyzhWt.js} +1 -1
  44. package/dist/assets/{build-cluster-graph-CipaA_oB.js → build-cluster-graph-C7WDEBPT.js} +2 -2
  45. package/dist/assets/circle-check-big-_wz1yIB9.js +1 -0
  46. package/dist/assets/{circle-x-CDQw-Oki.js → circle-x-DZIkb-Lz.js} +1 -1
  47. package/dist/assets/clock-CSbo3gkM.js +1 -0
  48. package/dist/assets/{copy-CAOXjD5r.js → copy-CXmQmVfO.js} +1 -1
  49. package/dist/assets/{debounced-invalidate-DpIEFwPp.js → debounced-invalidate-B-d-TMXU.js} +1 -1
  50. package/dist/assets/{dist-CI4L7l-2.js → dist-0-0Oj4Ob.js} +1 -1
  51. package/dist/assets/dist-DzZnZN0v.js +349 -0
  52. package/dist/assets/{download-CAJNFrAB.js → download-CfM9N5MT.js} +1 -1
  53. package/dist/assets/{face-bbox-BFgt9EZy.js → face-bbox-Hcwf_KR0.js} +1 -1
  54. package/dist/assets/{hostInit-CAD--nfI.js → hostInit-DdzXJVVO.js} +1 -1
  55. package/dist/assets/index-BjZTxNFK.js +4 -0
  56. package/dist/assets/{index-9YoL1cUW.css → index-r1TtJ95R.css} +1 -1
  57. package/dist/assets/{key-round-D_sH_q8V.js → key-round-DirTpnKo.js} +1 -1
  58. package/dist/assets/{mf-entry-bootstrap-0-c4e36f72.js → mf-entry-bootstrap-0-94812e64.js} +2 -2
  59. package/dist/assets/{pencil-CqqsHO49.js → pencil-BFQRfkl7.js} +1 -1
  60. package/dist/assets/play-RppAHnLs.js +1 -0
  61. package/dist/assets/{player-overlays-bbH94q-C.js → player-overlays-CHrph3xo.js} +1 -1
  62. package/dist/assets/plus-BtQBvRuY.js +1 -0
  63. package/dist/assets/power-BPX2cYIN.js +1 -0
  64. package/dist/assets/{radio-Cug4imoO.js → radio-BmH8fc6z.js} +1 -1
  65. package/dist/assets/{refresh-cw-BGCphjMn.js → refresh-cw-BBc2JTLr.js} +1 -1
  66. package/dist/assets/remoteEntry-C1cmXJIC.js +1 -0
  67. package/dist/assets/rotate-ccw-CEvQgC-E.js +1 -0
  68. package/dist/assets/rotate-cw-CTrXx8FE.js +1 -0
  69. package/dist/assets/{send-C5aDTEjJ.js → send-DFy_pFNt.js} +1 -1
  70. package/dist/assets/{server-3wNyeBU4.js → server-CqOiCoo_.js} +1 -1
  71. package/dist/assets/{shield-DplCqcL2.js → shield-C0hVD7Yo.js} +1 -1
  72. package/dist/assets/square-Mo-mUBnd.js +1 -0
  73. package/dist/assets/{square-check-big-DH3-Pa_W.js → square-check-big-CDOJdigz.js} +1 -1
  74. package/dist/assets/src-C52t7Uiv.js +67 -0
  75. package/dist/assets/src-CRBtfo2P.js +349 -0
  76. package/dist/assets/{star-Y4-10BmL.js → star-BcrH71wG.js} +1 -1
  77. package/dist/assets/{undo-2-DEYHOb0E.js → undo-2-C_1eWxDD.js} +1 -1
  78. package/dist/assets/{upload-BtP3VBCU.js → upload-X3vKXYEa.js} +1 -1
  79. package/dist/assets/{use-scenes-feed-BXzv1F4x.js → use-scenes-feed-DznJQEVW.js} +1 -1
  80. package/dist/assets/useEventInvalidation-CbtypNsV.js +1 -0
  81. package/dist/assets/{video-CXx7eETO.js → video-D-Tl6S_x.js} +1 -1
  82. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DyH01HQs.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-B83-HnIn.js} +2 -2
  83. package/dist/assets/{wifi-ClKydJp-.js → wifi-BcHa5Af2.js} +1 -1
  84. package/dist/assets/{zap-Dnj7qxTO.js → zap-DAvG_CQH.js} +1 -1
  85. package/dist/index.html +6 -6
  86. package/dist/server/addon.js +1586 -1438
  87. package/package.json +1 -1
  88. package/dist/assets/Addons-Dnc-RXgM.js +0 -1
  89. package/dist/assets/DetectionIntelligence-CZyeSCJf.js +0 -1
  90. package/dist/assets/DeviceDetail-DmgBCV4a.js +0 -2
  91. package/dist/assets/Devices-BrElFvY3.js +0 -1
  92. package/dist/assets/Events-KnLsawMq.js +0 -1
  93. package/dist/assets/FormBuilder-CEw554z0.js +0 -1
  94. package/dist/assets/Identity-bGGI1QWE.js +0 -1
  95. package/dist/assets/IntegrationDetail-eQjr_VZf.js +0 -1
  96. package/dist/assets/Integrations-CDOiRBS9.js +0 -1
  97. package/dist/assets/Integrations-R6vGB8m2.js +0 -1
  98. package/dist/assets/Network-B6zVgaCe.js +0 -1
  99. package/dist/assets/NodeInferenceDevices-BCmCXC5y.js +0 -1
  100. package/dist/assets/Notifications-DSAFFXJr.js +0 -1
  101. package/dist/assets/Pipeline-BbnF9Ozb.js +0 -1
  102. package/dist/assets/Plates-Ck6zc0jT.js +0 -1
  103. package/dist/assets/Recordings-BmEupF3w.js +0 -1
  104. package/dist/assets/Scenes-BNeqc2nK.js +0 -1
  105. package/dist/assets/circle-check-big-Bj2tv0Uy.js +0 -1
  106. package/dist/assets/clock-BcKuptwD.js +0 -1
  107. package/dist/assets/dist-BHaLZy2_.js +0 -349
  108. package/dist/assets/index-KHEomj2t.js +0 -4
  109. package/dist/assets/play-I3HZudQM.js +0 -1
  110. package/dist/assets/plus-CJqabi49.js +0 -1
  111. package/dist/assets/power-txJcg2ZI.js +0 -1
  112. package/dist/assets/remoteEntry-BG1pNM_r.js +0 -1
  113. package/dist/assets/rotate-ccw-h1d3r46-.js +0 -1
  114. package/dist/assets/rotate-cw-Bfa_vcNi.js +0 -1
  115. package/dist/assets/square-BTe4gnO3.js +0 -1
  116. package/dist/assets/src-CEeJOwlR.js +0 -349
  117. package/dist/assets/src-D7V1-vUs.js +0 -67
  118. package/dist/assets/useEventInvalidation-Bzw3MDRD.js +0 -1
@@ -15483,7 +15483,23 @@ var NcHistoryEntrySchema = object({
15483
15483
  updatedAt: number(),
15484
15484
  /** Failure detail — present on a `dead` row. */
15485
15485
  error: string().optional(),
15486
- subject: NcHistorySubjectSchema
15486
+ subject: NcHistorySubjectSchema,
15487
+ /**
15488
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15489
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15490
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15491
+ * every delivery attempt). Absent on a row still pending/dead, a row
15492
+ * delivered before this field shipped, or a wiring with no artefact index.
15493
+ *
15494
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15495
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15496
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15497
+ * also answers `null` for an id whose artefact has since expired past the
15498
+ * retained shelf's own age bound — the degrade a caller (the Home
15499
+ * Assistant export) must render as "no image right now", never as a
15500
+ * broken link.
15501
+ */
15502
+ artifactIds: array(string().min(1)).optional()
15487
15503
  });
15488
15504
  /**
15489
15505
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -15710,7 +15726,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
15710
15726
  }), method(object({}), object({
15711
15727
  catalog: array(NcConditionDescriptorSchema),
15712
15728
  taxonomy: NcTaxonomySchema.optional()
15713
- })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
15729
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
15714
15730
  kind: "mutation",
15715
15731
  caller: "required"
15716
15732
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -16050,896 +16066,1496 @@ var OauthIntegrationDescriptorSchema = object({
16050
16066
  });
16051
16067
  method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
16052
16068
  /**
16053
- * pipeline-analytics device-scoped wrapper cap. Refines raw
16054
- * per-frame detections emitted by the pipeline runner into tracked
16055
- * objects, per-kind event collections (motion / object / audio), and
16056
- * persisted media. Owns the post-detection domain end-to-end:
16057
- *
16058
- * runner emits PipelineInferenceResult
16059
- * ↓ (event bus)
16060
- * pipeline-analytics subscriber
16061
- * ↓ SORT tracker + zone engine + state analyzer + event emitter
16062
- * → three DB collections (one per kind), one FS media tree, one
16063
- * unified event emitter (FrameTracked + TrackStarted/Ended +
16064
- * DetectionEvent on bus)
16065
- *
16066
- * Pure subscriber model. No `processFrame` cap method — the runner
16067
- * already publishes the raw frame on the bus. The cap surface is
16068
- * only QUERIES + per-device settings, bound on/off via
16069
- * `device-manager.setWrapperActive`. `defaultActive: true` because
16070
- * every camera with a detection pipeline wants its raw detections
16071
- * refined; operators opt out per-device via BindingsTab when needed.
16072
- *
16073
- * Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
16074
- * (per-device surface) and `track-trail` caps — see P11 cleanup.
16069
+ * Reference to the frame's retained NATIVE surface + the parent crop's placement
16070
+ * within the frame, so the executor can re-cut a leaf child ROI at native
16071
+ * resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
16075
16072
  */
16076
- var TrackStateSchema = _enum([
16077
- "new",
16078
- "entered",
16079
- "left",
16080
- "moving",
16081
- "idle"
16082
- ]);
16083
- var EventKindSchema = _enum([
16084
- "motion",
16085
- "object",
16086
- "audio"
16087
- ]);
16073
+ var NativeCropRefSchema = object({
16074
+ /** Handle keying the retained native surface (node-pinned to its owner). */
16075
+ handle: FrameHandleSchema,
16076
+ /** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
16077
+ cropFrameSpace: object({
16078
+ x: number(),
16079
+ y: number(),
16080
+ w: number(),
16081
+ h: number()
16082
+ })
16083
+ });
16084
+ object({
16085
+ crop: object({
16086
+ left: number(),
16087
+ top: number(),
16088
+ width: number().positive(),
16089
+ height: number().positive()
16090
+ }).optional(),
16091
+ content: object({
16092
+ width: number().int().positive(),
16093
+ height: number().int().positive()
16094
+ }),
16095
+ fit: _enum(["stretch", "contain"]),
16096
+ format: _enum([
16097
+ "rgb",
16098
+ "gray",
16099
+ "jpeg"
16100
+ ])
16101
+ });
16088
16102
  /**
16089
- * Spatial filter for `listTracks` the rect + polygon variants of the shared
16090
- * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
16091
- * of the camera frame (top-left origin), matching the drawing-plane editor.
16103
+ * Process-local frame identity. It is serializable so it can ride an in-process
16104
+ * capability call, but `registryId` deliberately prevents resolution in any
16105
+ * other process or execution group.
16092
16106
  */
16093
- var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
16094
- /** Closed icon vocabulary so clients render a known glyph per kind. */
16095
- var EventKindIconSchema = _enum([
16096
- "motion",
16097
- "audio",
16098
- "person",
16099
- "vehicle",
16100
- "animal",
16101
- "door",
16102
- "pir",
16103
- "smoke",
16104
- "water",
16105
- "button",
16106
- "package",
16107
- "generic"
16107
+ var FrameRefSchema = object({
16108
+ registryId: string().min(1),
16109
+ id: string().min(1),
16110
+ width: number().int().positive(),
16111
+ height: number().int().positive(),
16112
+ format: _enum(["rgb", "gray"]),
16113
+ timestamp: number(),
16114
+ capturedAt: number().optional()
16115
+ });
16116
+ var ModelFormatSchema$1 = _enum([
16117
+ "onnx",
16118
+ "coreml",
16119
+ "openvino",
16120
+ "tflite",
16121
+ "pt",
16122
+ "gguf"
16108
16123
  ]);
16109
- var EventKindCategorySchema = _enum([
16110
- "motion",
16111
- "audio",
16112
- "detection",
16113
- "sensor",
16114
- "control",
16115
- "custom",
16116
- "package"
16124
+ var PipelineSlotSchema = _enum([
16125
+ "detector",
16126
+ "cropper",
16127
+ "classifier",
16128
+ "refiner",
16129
+ "audio-classifier"
16117
16130
  ]);
16118
- /** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
16119
- var EventKindLevelSchema = _enum(["macro", "sub"]);
16120
- var EventKindDescriptorSchema = object({
16121
- /** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
16122
- kind: string(),
16123
- /** i18n key resolved on the UI side; `label` is the English fallback. */
16124
- labelKey: string(),
16125
- /** English fallback label (kept for clients that don't translate). */
16126
- label: string(),
16127
- /** Hex color for timeline/legend rendering. */
16128
- color: string(),
16129
- /** Dictionary id → lucide component on the UI side. */
16130
- iconId: string(),
16131
- /** Legacy closed-vocab glyph — fallback for `iconId`. */
16132
- icon: EventKindIconSchema,
16133
- category: EventKindCategorySchema,
16134
- /** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
16135
- parentKind: string().nullable(),
16136
- /** Derived from `parentKind`, explicit for the client tree. */
16137
- level: EventKindLevelSchema,
16138
- /** Which cap + device contributes this kind. For built-ins the camera
16139
- * itself; for sensor kinds the LINKED source device. */
16140
- source: object({
16141
- capName: string(),
16142
- deviceId: number()
16143
- })
16131
+ var PipelineEngineChoiceSchema = object({
16132
+ runtime: _enum(["node", "python"]),
16133
+ backend: string(),
16134
+ format: ModelFormatSchema$1,
16135
+ device: string().optional()
16144
16136
  });
16145
- /** One camera's event vocabulary, as returned by `listEventKindsBatch`. */
16146
- var EventKindsForDeviceSchema = object({
16147
- deviceId: number(),
16148
- kinds: array(EventKindDescriptorSchema).readonly()
16137
+ var AvailableEngineSchema = object({
16138
+ engine: PipelineEngineChoiceSchema,
16139
+ devices: array(object({
16140
+ id: string(),
16141
+ label: string(),
16142
+ description: string().optional()
16143
+ })).readonly(),
16144
+ defaultDevice: string()
16149
16145
  });
16150
- var SensorEventSchema = object({
16146
+ var PipelineDefaultStepSchema = lazy(() => object({
16147
+ addonId: string(),
16148
+ addonName: string(),
16149
+ slot: PipelineSlotSchema,
16150
+ inputClasses: array(string()).readonly(),
16151
+ outputClasses: array(string()).readonly(),
16152
+ enabled: boolean(),
16153
+ modelId: string(),
16154
+ children: array(PipelineDefaultStepSchema).readonly(),
16155
+ group: string().optional(),
16156
+ settings: record(string(), unknown()).optional()
16157
+ }));
16158
+ var PipelineTemplateStepSchema = lazy(() => object({
16159
+ addonId: string(),
16160
+ enabled: boolean(),
16161
+ modelId: string(),
16162
+ children: array(PipelineTemplateStepSchema).readonly(),
16163
+ settings: record(string(), unknown()).optional()
16164
+ }));
16165
+ var PipelineTemplateSchema$1 = object({
16151
16166
  id: string(),
16152
- /** The CAMERA the event is attributed to (a sensor linked to N cameras
16153
- * yields N rows, one per camera). */
16154
- deviceId: number(),
16155
- /** The linked sensor device whose state changed. */
16156
- sourceDeviceId: number(),
16157
- /** Event kind id — matches an `EventKindDescriptor.kind`. */
16158
- kind: string(),
16159
- /** Snapshot of the sensor cap's runtime-state slice at the change. */
16160
- value: record(string(), unknown()).nullable(),
16161
- timestamp: number()
16167
+ name: string(),
16168
+ createdAt: string(),
16169
+ updatedAt: string(),
16170
+ engine: PipelineEngineChoiceSchema,
16171
+ steps: array(PipelineTemplateStepSchema).readonly()
16162
16172
  });
16163
- var TrackPositionSchema = object({
16164
- x: number(),
16165
- y: number(),
16166
- timestamp: number(),
16167
- bbox: BoundingBoxSchema
16173
+ var PipelineModelOptionSchema = object({
16174
+ id: string(),
16175
+ name: string(),
16176
+ formats: record(string(), object({
16177
+ downloaded: boolean(),
16178
+ sizeMB: number()
16179
+ })),
16180
+ group: ModelVariantGroupSchema.optional(),
16181
+ legacy: boolean().optional(),
16182
+ provider: ModelProviderIdSchema.optional()
16168
16183
  });
16169
- var TrackSnapshotSchema = object({
16170
- timestamp: number(),
16171
- position: TrackPositionSchema,
16172
- /** MediaStore key; resolve via `getTrackMedia({ trackId })`. */
16173
- mediaKey: string()
16184
+ var ConfigFieldBridge = custom();
16185
+ var PipelineAddonSchemaSchema = object({
16186
+ id: string(),
16187
+ name: string(),
16188
+ slot: PipelineSlotSchema,
16189
+ inputClasses: array(string()).readonly(),
16190
+ outputClasses: array(string()).readonly(),
16191
+ childSlots: array(PipelineSlotSchema).readonly(),
16192
+ models: array(PipelineModelOptionSchema).readonly(),
16193
+ defaultModelId: string(),
16194
+ defaultModelIdByFormat: record(string(), string()).optional(),
16195
+ enabledByDefault: boolean().optional(),
16196
+ backfillIntoExistingOverrides: boolean().optional(),
16197
+ defaultConfidence: number(),
16198
+ group: string().optional(),
16199
+ configSchema: array(ConfigFieldBridge).readonly().optional()
16174
16200
  });
16175
- /**
16176
- * Normalized 0..1 trajectory envelope (min/max over every position bbox,
16177
- * divided by the track's detection-frame dims), computed at persist time.
16178
- * Absent when the frame dims were unknown when the track was persisted
16179
- * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
16180
- */
16181
- var TrackEnvelopeSchema = object({
16182
- minX: number(),
16183
- minY: number(),
16184
- maxX: number(),
16185
- maxY: number()
16201
+ var PipelineSlotSchemaSchema = object({
16202
+ id: PipelineSlotSchema,
16203
+ label: string(),
16204
+ priority: number(),
16205
+ parentSlot: PipelineSlotSchema.nullable(),
16206
+ addons: array(PipelineAddonSchemaSchema).readonly()
16186
16207
  });
16187
- /**
16188
- * Row projection for track list queries. `full` (default) returns the
16189
- * complete Track including the frame-rate `positions[]` history and the
16190
- * `snapshots[]` references — megabytes across a page of tracks. `slim`
16191
- * keeps every scalar the list surfaces actually render (ids, class(es),
16192
- * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
16193
- * zonesVisited, bestEventId, envelope, hasFace, hasEmbeddedFace, hasRider) and returns `positions` /
16194
- * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
16195
- * `getTrack`. Mirrors the event-store `projection` convention
16196
- * (`getObjectEvents` et al.).
16197
- */
16198
- var TrackProjectionSchema = _enum(["full", "slim"]);
16199
- /**
16200
- * One audio-classification label heard on the track's camera while the
16201
- * track was alive, aggregated per label. An "episode" is one persisted
16202
- * audio event (the confident-classification path: score ≥ the device's
16203
- * `classificationMinScore`, class-change-or-heartbeat coalesced) — NOT
16204
- * one 32 ms inference chunk, so counts stay human-scaled.
16205
- */
16206
- var TrackAudioLabelSchema = object({
16207
- label: string(),
16208
- /** Highest classification score observed across the label's episodes. */
16209
- peakScore: number(),
16210
- /** Number of coalesced audio-event episodes carrying this label. */
16211
- count: number(),
16212
- firstAt: number(),
16213
- lastAt: number()
16208
+ var PipelineSchemaSchema = object({
16209
+ availableEngines: array(AvailableEngineSchema).readonly(),
16210
+ selectedEngine: PipelineEngineChoiceSchema,
16211
+ slots: array(PipelineSlotSchemaSchema).readonly()
16214
16212
  });
16215
- /**
16216
- * How a track was produced. `pipeline` (default / absent) = the spatial
16217
- * detection+tracking pipeline. Every OTHER value is a SYNTHETIC projection —
16218
- * no positions, a single snapshot, and no bbox trajectory at all:
16219
- *
16220
- * - `sensor` — a linked sensor/control device state change.
16221
- * - `audio` — an audio event on the camera itself that was anomalous for
16222
- * THAT camera, loud, and heard while nothing visual was happening (D62).
16223
- *
16224
- * The spatial subsystems (tracker association, occupancy count, re-id /
16225
- * embedding, resurrection) MUST skip every synthetic source. Test for that
16226
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
16227
- * check silently readmits every source added after it was written.
16228
- */
16229
- var TrackSourceSchema = _enum([
16230
- "pipeline",
16231
- "sensor",
16232
- "audio"
16233
- ]);
16234
- /**
16235
- * Where a track sits in the RETRAIN lifecycle (D81).
16236
- *
16237
- * - `none` never marked, or un-marked. Evictable.
16238
- * - `staging`the operator wants this track as training material and has not
16239
- * finished with it. **This is the only state retention holds**: the track and
16240
- * everything it owns (object events, crops, keyframes, CLIP vector) survive
16241
- * the device's age window.
16242
- * - `trained` — the retrain page has taken what it needed. The frames it chose
16243
- * were COPIED into the retrain dataset at selection time, so the dataset no
16244
- * longer depends on the track's media and the track becomes EVICTABLE again.
16245
- * Terminal for the plain `markForTrain` toggle: returning it to `staging` is
16246
- * a deliberate action of the retrain page, not a side effect of a checkbox.
16247
- *
16248
- * There is no `null`. The state is stored `TEXT NOT NULL DEFAULT 'none'` because
16249
- * the store's filter language has only positive equality and `whereIn` — no
16250
- * negation, no IS NULL — so a NULL would be unselectable by ANY predicate and
16251
- * would make the entire pre-column history immortal in one deploy.
16252
- */
16253
- var RetrainStatusSchema = _enum([
16254
- "none",
16255
- "staging",
16256
- "trained"
16257
- ]);
16258
- /**
16259
- * Per-track OPERATOR flags — set by hand from the admin UI or the viewer, never
16260
- * by the pipeline. Spread into `TrackSchema` and `KeyEventSchema` from one place
16261
- * so the two surfaces cannot drift.
16262
- *
16263
- * **Absent ≠ false.** A track that has never been touched omits the field; an
16264
- * explicitly un-flagged track carries `false`. Legacy rows written before the
16265
- * columns existed read as absent, and a consumer that needs a boolean should say
16266
- * `flag === true`, not `flag !== false`.
16267
- *
16268
- * `markForTrain` is the WIRE FACE of {@link RetrainStatusSchema}, not a column:
16269
- * it is exactly `retrainStatus === 'staging'`, in both directions. Writing
16270
- * `true` moves `none → staging`, writing `false` moves `staging → none`, and a
16271
- * `trained` track reports `false` while refusing both writes. The boolean is
16272
- * kept because three surfaces drive a toggle off it; anything that needs to tell
16273
- * "never marked" from "already trained" must read `retrainStatus`.
16274
- *
16275
- * `debug` does NOT pin; it is attention, not durability.
16276
- *
16277
- * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
16278
- * A favourited track is skipped by retention the same way `staging` is, but
16279
- * it does not enter `none|staging|trained` and has no staging budget.
16280
- */
16281
- var TrackFlagFields = {
16282
- /** Operator marked this track as training material — i.e. `retrainStatus` is
16283
- * `'staging'`. */
16284
- markForTrain: boolean().optional(),
16285
- /** Operator marked this track for diagnostic attention. */
16286
- debug: boolean().optional(),
16287
- /** Operator favourited this track. Pins it against pruning. */
16288
- favourited: boolean().optional()
16289
- };
16290
- /**
16291
- * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
16292
- * Deliberately NOT part of {@link TrackFlagFields}: that group also builds the
16293
- * write patch, and the status is not something the toggle sets — it is what the
16294
- * toggle's boolean is derived from. Absent on an in-RAM track never touched;
16295
- * always present on a persisted row (the column default materialises `'none'`).
16296
- */
16297
- var TrackRetrainFields = { retrainStatus: RetrainStatusSchema.optional() };
16298
- /**
16299
- * The write half: a PARTIAL patch. An omitted key is left untouched, so setting
16300
- * one flag can never clear the other — the toggles are independent and are
16301
- * driven from three surfaces that do not know about each other.
16302
- */
16303
- var TrackFlagsPatchSchema = object(TrackFlagFields);
16304
- /**
16305
- * The resolved flag state after a write. Both fields are REQUIRED here (absent
16306
- * collapses to `false`) so a caller can drive a toggle's checked state off the
16307
- * mutation result without a re-fetch.
16308
- */
16309
- var TrackFlagsSchema = object({
16310
- trackId: string(),
16311
- markForTrain: boolean(),
16312
- debug: boolean(),
16313
- favourited: boolean(),
16314
- /** The lifecycle state the boolean was derived from. Required here (unlike on
16315
- * a track row) because this shape is only ever produced by the write body,
16316
- * which always knows it — and a surface that has just written needs to render
16317
- * `trained` without a re-fetch. */
16318
- retrainStatus: RetrainStatusSchema
16213
+ var EngineProvisioningSchema = object({
16214
+ runtimeId: _enum([
16215
+ "onnx",
16216
+ "openvino",
16217
+ "coreml",
16218
+ "edgetpu"
16219
+ ]).nullable(),
16220
+ device: string().nullable(),
16221
+ state: _enum([
16222
+ "idle",
16223
+ "installing",
16224
+ "verifying",
16225
+ "ready",
16226
+ "failed"
16227
+ ]),
16228
+ progress: number().optional(),
16229
+ error: string().optional(),
16230
+ nextRetryAt: number().optional(),
16231
+ /**
16232
+ * Gate A (config-correctness gate at engine change): human-readable
16233
+ * config issues surfaced EAGERLY when the node's engine changes — model
16234
+ * substitutions ("chose X, running Y") and zero-build steps ("no model
16235
+ * has a <format> build"). Additive/optional: informational only, never
16236
+ * enforced here `assertEngineReady` (readiness) still gates inference.
16237
+ * Absent/empty when the node-default tree resolves cleanly.
16238
+ */
16239
+ configIssues: array(string()).optional()
16319
16240
  });
16320
- union([literal(1), literal(2)]);
16321
- /**
16322
- * WHO decided a label, and when. Carried per tier so a value can be traced to
16323
- * the step and model that produced it — which is what makes the write rule
16324
- * arguable after the fact ("why is 592's label `dog` and not `Canis lupus`?")
16325
- * and what lets a migrated, UNATTRIBUTED value be told apart from a real one.
16326
- *
16327
- * `stepId` is the pipeline step id (`animal-classifier`, `bird-classifier`,
16328
- * `plate-ocr`, `face-embedding`, `object-detection`), or the sentinel
16329
- * `migration:4g` for a value the 4g migration moved from the single-slot era —
16330
- * that value has no provenance, and the write rule lets ANY properly-attributed
16331
- * write of the same tier replace it regardless of score.
16332
- */
16333
- var LabelAttributionSchema = object({
16334
- stepId: string(),
16241
+ var PipelineStepInputSchema = lazy(() => object({
16242
+ addonId: string(),
16335
16243
  modelId: string().optional(),
16336
- decidedAt: number(),
16244
+ enabled: boolean().default(true),
16245
+ children: array(PipelineStepInputSchema).optional(),
16246
+ settings: record(string(), unknown()).optional(),
16247
+ jumpDeviceKey: string().optional()
16248
+ }));
16249
+ var ModelSubstitutionSchema = object({
16250
+ addonId: string(),
16251
+ chosen: string(),
16252
+ running: string(),
16253
+ format: string()
16254
+ });
16255
+ var PipelineValidationIssueSchema = object({
16256
+ addonId: string(),
16257
+ kind: _enum(["unknown-addon", "no-format-build"]),
16258
+ detail: string()
16259
+ });
16260
+ var PipelineValidationResultSchema = object({
16261
+ ok: boolean(),
16262
+ issues: array(PipelineValidationIssueSchema).readonly(),
16263
+ substitutions: array(ModelSubstitutionSchema).readonly(),
16264
+ /** The node's `currentEngine.format` this validation ran against. */
16265
+ format: string()
16266
+ });
16267
+ var ReferenceImageEntrySchema = object({
16268
+ filename: string(),
16269
+ stepIds: array(string()).readonly().optional()
16270
+ });
16271
+ var ReferenceImageBodySchema = object({
16272
+ base64: string(),
16273
+ filename: string()
16274
+ });
16275
+ var ReferenceAudioEntrySchema = object({
16276
+ filename: string(),
16277
+ sizeKb: number()
16278
+ });
16279
+ var ReferenceAudioBodySchema = object({ base64: string() });
16280
+ var AudioBackendSchema = object({
16281
+ id: string(),
16282
+ name: string(),
16283
+ description: string(),
16284
+ available: boolean(),
16337
16285
  /**
16338
- * The GALLERY id behind a recognised tier-2 label — a face-gallery
16339
- * `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
16340
- *
16341
- * The text alone is a DISPLAY NAME, and a display name is renameable: a
16342
- * notification rule authored on "Gianluca" stopped matching the moment the
16343
- * operator fixed the spelling in the gallery, and nothing said so. The id is
16344
- * the thing that does not move, so it is what a rule matches on
16345
- * (`NcConditions.identities`) and the text is what a human is shown.
16346
- *
16347
- * Absent when the label names no gallery row — a plate the OCR read but no
16348
- * vehicle claims, a sub-class, a species, any tier-1 value.
16286
+ * Raw classifier labels this backend can emit (e.g. YAMNet's
16287
+ * 521-class set or Apple SoundAnalysis's 303-class set). Used by
16288
+ * the benchmark UI to populate the `enabledMicroClasses` filter
16289
+ * specific to the selected backend without a separate fetch.
16349
16290
  */
16350
- identityId: string().optional()
16291
+ rawLabels: array(string()).readonly().optional()
16292
+ });
16293
+ var AudioCapabilitiesSchema = object({
16294
+ activeBackend: string(),
16295
+ availableBackends: array(AudioBackendSchema).readonly(),
16296
+ sampleRate: number(),
16297
+ chunkDurationMs: number()
16298
+ });
16299
+ var DownloadModelResultSchema = object({
16300
+ filePath: string(),
16301
+ sizeMB: number(),
16302
+ durationMs: number()
16351
16303
  });
16352
16304
  /**
16353
- * The TIERED label model (roadmap 4g), spread into `TrackSchema` and
16354
- * `ObjectEventSchema` from ONE place so the two surfaces cannot drift — a
16355
- * track and its events always answer the same question the same way.
16356
- *
16357
- * Two scalar columns, not an array: every consumer wants "the coarse one" or
16358
- * "the fine one", and an array made both a scan. `label` is tier 1, `subLabel`
16359
- * is tier 2, and each carries its own score + attribution.
16360
- *
16361
- * **Reading it.** What a human should be shown is `subLabel ?? label` — the
16362
- * finest thing known. Before 4g the single `label` column held the finest
16363
- * value, so a consumer that has not been updated reads the tier-1 slot and
16364
- * shows nothing on a species-only row; that is why the migration puts every
16365
- * pre-4g value in tier 2 (it cannot regress a display that reads the fallback)
16366
- * and why the read surfaces were changed in the same train.
16367
- *
16368
- * **Writing it.** The slots are independent, which is the whole point: a
16369
- * tier-1 write (`bird`) can never overwrite a tier-2 value (`Turdus
16370
- * migratorius`), so fineness cannot regress by construction. Within a tier the
16371
- * higher score wins. One rule, one implementation — see
16372
- * `pipeline/label-tier.ts` in addon-post-analysis.
16373
- */
16374
- var TieredLabelFields = {
16375
- /** Tier 1 — the sub-class. See {@link LabelTierSchema}. */
16376
- label: string().optional(),
16377
- /** Confidence of the tier-1 value, as reported by the deciding step. */
16378
- labelScore: number().optional(),
16379
- /** Provenance of the tier-1 value. See {@link LabelAttributionSchema}. */
16380
- labelMeta: LabelAttributionSchema.optional(),
16381
- /** Tier 2 — the instance. See {@link LabelTierSchema}. */
16382
- subLabel: string().optional(),
16383
- /** Confidence of the tier-2 value, as reported by the deciding step. */
16384
- subLabelScore: number().optional(),
16385
- /** Provenance of the tier-2 value. See {@link LabelAttributionSchema}. */
16386
- subLabelMeta: LabelAttributionSchema.optional()
16387
- };
16388
- /** Per-camera slice of a training-export estimate. */
16389
- var TrainingExportDeviceTotalsSchema = object({
16390
- deviceId: number(),
16391
- tracks: number().int(),
16392
- files: number().int(),
16393
- bytes: number().int()
16394
- });
16395
- /**
16396
- * What a training export WOULD contain. Computed from media index rows only —
16397
- * no blob is read to produce this.
16305
+ * Wrapper carrying a single test run's result. Replaces the legacy
16306
+ * ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
16307
+ * canonical `AudioResult` from the Phase 6 output rework: one
16308
+ * `AudioDetection` per class above `minScore`, top-N candidates in
16309
+ * `debug.alternateLabels['audio-classifier']`, per-source timings in
16310
+ * `debug.stepTimings`. The outer `success`/`error` fields stay so the
16311
+ * benchmark UI can still report a clean failure when the classifier
16312
+ * cap isn't available.
16398
16313
  */
16399
- var TrainingExportSummarySchema = object({
16400
- generatedAt: number(),
16401
- trackCount: number().int(),
16402
- fileCount: number().int(),
16403
- byteCount: number().int(),
16404
- /** More marked tracks exist than a single pass carries. */
16405
- truncated: boolean(),
16406
- devices: array(TrainingExportDeviceTotalsSchema).readonly()
16314
+ var AudioTestResultSchema = object({
16315
+ success: boolean(),
16316
+ error: string().optional(),
16317
+ frame: custom().optional()
16407
16318
  });
16408
- var TrackSchema = object({
16409
- trackId: string(),
16410
- deviceId: number(),
16411
- className: string(),
16412
- ...TieredLabelFields,
16413
- producingDeviceName: string().optional(),
16414
- /** Track provenance. Absent `pipeline` (legacy rows). */
16415
- source: TrackSourceSchema.optional(),
16416
- firstSeen: number(),
16417
- lastSeen: number(),
16418
- /** Frame-rate position history (subject to maxPositionHistory cap). */
16419
- positions: array(TrackPositionSchema).readonly(),
16420
- /** Periodic snapshots at snapshotIntervalMs cadence (subject to
16421
- * saveThumbnails policy). */
16422
- snapshots: array(TrackSnapshotSchema).readonly(),
16423
- /** Deduplicated zones the track has entered at least once. Zone IDS. */
16424
- zonesVisited: array(string()).readonly(),
16319
+ var PipelineConfigBridge = custom();
16320
+ var ConfigUISchemaBridge = custom();
16321
+ var ConfigUISchemaNullableBridge = custom();
16322
+ var InferenceCapabilitiesBridge = custom();
16323
+ var ModelAvailabilityListBridge = custom();
16324
+ var PipelineRunResultBridge = custom();
16325
+ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
16326
+ modelId: string(),
16327
+ settings: record(string(), unknown()).readonly()
16328
+ }))), method(object({ steps: record(string(), object({
16329
+ modelId: string(),
16330
+ settings: record(string(), unknown()).readonly()
16331
+ })) }), object({ success: literal(true) }), {
16332
+ kind: "mutation",
16333
+ auth: "admin"
16334
+ }), method(object({ nodeId: string() }), object({
16335
+ success: literal(true),
16336
+ clearedDevices: number()
16337
+ }), {
16338
+ kind: "mutation",
16339
+ auth: "admin"
16340
+ }), method(object({ nodeId: string() }), object({ unhealthy: array(object({
16341
+ /** `<backend>:<device>`, e.g. `openvino:gpu`. */
16342
+ deviceKey: string(),
16425
16343
  /**
16426
- * Human NAMES for {@link zonesVisited}, resolved at READ time against the
16427
- * `zones` capability.
16428
- *
16429
- * `zonesVisited` persists ids (`cfeec78c-8d69-…`), which no operator can type
16430
- * and no card can render — so every free-text search surface was structurally
16431
- * unable to answer "show me the tracks in Uscio", and did not fail loudly, it
16432
- * just returned nothing. Resolving here rather than in each client keeps ONE
16433
- * derivation and costs the clients no extra call (the `zones` cap is
16434
- * per-device, so a client-side resolve would be a per-camera fan-out on a
16435
- * surface built to avoid exactly that).
16436
- *
16437
- * Resolved, never invented: a zone deleted since the track was written has no
16438
- * name and is DROPPED, so this array can be shorter than `zonesVisited` — the
16439
- * two are not positionally aligned. Absent when the track visited no zone, or
16440
- * when the zone catalogue could not be read.
16344
+ * `failed` the per-device restart budget is exhausted; no pool
16345
+ * will be spawned until an operator re-arms it or the runner
16346
+ * respawns. `backoff` — under budget, waiting out the backoff (or
16347
+ * a cached pool observed dead and not yet condemned).
16441
16348
  */
16442
- zoneNames: array(string()).readonly().optional(),
16443
- /** Deduplicated set of detector classes observed for this track over its
16444
- * life (a track may be reclassified, e.g. person→vehicle). Absent on
16445
- * legacy rows written before class accumulation shipped. */
16446
- classes: array(string()).readonly().optional(),
16447
- /** Cumulative normalized distance travelled (0..1 units = full frame width). */
16448
- totalDistance: number(),
16449
- state: TrackStateSchema,
16450
- active: boolean(),
16451
- /** Deterministic key-event importance score in [0,1] (server-computed at
16452
- * track expiry, recomputed on late label). Absent on legacy rows written
16453
- * before scoring shipped — consumers degrade to absence / compute-on-read. */
16454
- importance: number().optional(),
16455
- /** Id of the track's highest-confidence ObjectEvent (its representative
16456
- * "best" frame). Absent when the track produced no object events. */
16457
- bestEventId: string().optional(),
16458
- /** Tag of the importance sub-signal that dominated the score
16459
- * (identity|dwell|proximity|class|confidence|travel|zone). */
16460
- importanceReason: string().optional(),
16461
- /** Audio-classification labels heard on the camera during the track's
16462
- * life (score ≥ device `classificationMinScore`), aggregated per label.
16463
- * Absent on legacy rows / tracks with no confident audio. */
16464
- audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
16465
- /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
16466
- * Populated from the persisted envelope columns on historical reads;
16467
- * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
16468
- envelope: TrackEnvelopeSchema.optional(),
16349
+ state: _enum(["failed", "backoff"]),
16350
+ /** Epoch ms of the death that produced this state. */
16351
+ since: number(),
16352
+ /** Pool deaths inside the current window. */
16353
+ deaths: number(),
16354
+ /** The last death's message. */
16355
+ lastError: string()
16356
+ })).readonly() })), method(object({
16357
+ nodeId: string(),
16358
+ deviceKey: string()
16359
+ }), object({ rearmed: boolean() }), {
16360
+ kind: "mutation",
16361
+ auth: "admin"
16362
+ }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({ steps: array(PipelineStepInputSchema) }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
16363
+ name: string(),
16364
+ steps: array(PipelineTemplateStepSchema).readonly(),
16365
+ engine: PipelineEngineChoiceSchema
16366
+ }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
16367
+ id: string(),
16368
+ name: string().optional(),
16369
+ steps: array(PipelineTemplateStepSchema).readonly().optional()
16370
+ }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
16371
+ addonId: string(),
16372
+ modelId: string(),
16373
+ format: ModelFormatSchema$1
16374
+ }), DownloadModelResultSchema, { kind: "mutation" }), method(object({
16375
+ addonId: string(),
16376
+ modelId: string(),
16377
+ format: ModelFormatSchema$1
16378
+ }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
16379
+ engine: PipelineEngineChoiceSchema.optional(),
16380
+ steps: array(PipelineStepInputSchema).min(1),
16381
+ frame: FrameInputSchema.optional(),
16469
16382
  /**
16470
- * A face DETECTOR found a face on this track — nothing more. It says the
16471
- * detail plane produced a `face` detail; it does NOT say the face was
16472
- * embedded, matched, above `minFacePx`, or that the recognizer was even
16473
- * enabled. Set once and never cleared.
16474
- *
16475
- * **This exists so "face present but not recognised" is expressible.** A
16476
- * recognised identity lands in `subLabel` (attributed to the face chain via
16477
- * `subLabelMeta.stepId`), so before this field a track with an unmatched face
16478
- * and a track with no face at all were byte-identical on the wire and no
16479
- * surface could tell them apart. The read is `hasFace === true && subLabel
16480
- * === undefined`.
16481
- *
16482
- * **Absent ≠ false.** Every row written before the column existed omits it,
16483
- * and so does every server that predates the field — a consumer must test
16484
- * `=== true` and render nothing otherwise, never infer "no face".
16383
+ * Process-local lazy frame. Valid only when caller and provider resolve
16384
+ * in the same execution-group process; split/cross-node callers use
16385
+ * `frame`/`image` inline compatibility instead.
16485
16386
  */
16486
- hasFace: boolean().optional(),
16387
+ frameRef: FrameRefSchema.optional(),
16487
16388
  /**
16488
- * This track has a face row IN THE GALLERY: a crop **and** an embedding a
16489
- * face an operator could ASSIGN to an identity.
16490
- *
16491
- * The STRICT twin of {@link hasFace}, and the pair only earns its keep
16492
- * because the two disagree. `hasFace` is stamped at the TOP of the face
16493
- * branch, before every gate, and means no more than "a face detector produced
16494
- * a face detail". This one is stamped at the single moment the gallery row
16495
- * LANDS — after `FaceRecognizer.onTrackEnd` successfully persists it, i.e.
16496
- * past the embedding-magnitude verdict, the `minFacePx` detection gate, the
16497
- * candidate gate, the imageless-track drop (no crop was ever captured) and
16498
- * the crop-store drop. Everything between the detector and that insert can
16499
- * legitimately refuse the face, so a flag written any earlier promises the
16500
- * operator something to assign and delivers nothing.
16501
- *
16502
- * **Independent of recognition.** A face collected but never auto-matched is
16503
- * still assignable — it is in fact the face an operator most wants to reach —
16504
- * so this is NOT gated on `recognizedIdentityId`. Recognition lands in
16505
- * `subLabel`; this says only that the raw material exists.
16506
- *
16507
- * **Set once, never cleared.** A track that produced a gallery row produced
16508
- * one; deleting the row later is the gallery's business, not this flag's.
16509
- *
16510
- * **Absent ≠ false**, the same rule as {@link hasFace}: every row written
16511
- * before the column omits it, and so does every server that predates the
16512
- * field. A consumer must test `=== true` and render nothing otherwise —
16513
- * never infer "no assignable face".
16389
+ * CB5 shm passthrough a `FrameHandle` naming the same ring slot
16390
+ * the decoded pixels live in. One more member of the one-of
16391
+ * frame/frameHandle/image/imageBase64/referenceImage group.
16514
16392
  */
16515
- hasEmbeddedFace: boolean().optional(),
16393
+ frameHandle: FrameHandleSchema.optional(),
16394
+ imageBase64: string().optional(),
16516
16395
  /**
16517
- * This subject CONTAINS a folded rider a person the rider-pairing step
16518
- * ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
16519
- * so the passage is tracked once and as a VEHICLE.
16520
- *
16521
- * It exists because the fold's record was dishonest. D34 and the code both
16522
- * said "the person is not lost — it is reported so both entities stay on the
16523
- * record"; in fact the pair went into a per-processor RAM field behind an
16524
- * accessor nobody called, and every durable surface said `vehicle`, full
16525
- * stop. This is the composition note that makes the row true.
16526
- *
16527
- * A COMPOSITION, never a class and never a label. "This vehicle contains a
16528
- * person" is not an answer to "what is this" — both label tiers would refuse
16529
- * a macro token anyway (D89), and correctly. Nothing here changes what the
16530
- * subject IS: a cyclist stays one vehicle track, occupancy still counts one,
16531
- * and a `person` rule still does not fire for someone cycling past.
16532
- *
16533
- * **Absent ≠ false**, exactly like {@link hasFace}: every row written before
16534
- * the column, and every hub that predates the field, omits it. Test
16535
- * `=== true` and render nothing otherwise — never infer "no rider".
16396
+ * Binary JPEG bytespreferred over `imageBase64` on internal
16397
+ * hops (hub forked worker via Moleculer MsgPack) because it
16398
+ * skips the 33% base64 overhead + the per-call base64 decode on
16399
+ * the detection-pipeline worker. Callers can pass either; exactly
16400
+ * one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
16536
16401
  */
16537
- hasRider: boolean().optional(),
16538
- ...TrackFlagFields,
16539
- ...TrackRetrainFields
16540
- });
16541
- var BaseEventFields = {
16542
- id: string(),
16543
- deviceId: number(),
16544
- timestamp: number()
16545
- };
16546
- var MotionEventSchema = object({
16547
- ...BaseEventFields,
16548
- kind: literal("motion"),
16549
- regionCount: number(),
16550
- /** Heavy JSON array omitted in slim projection. */
16551
- regions: array(object({
16552
- bbox: BoundingBoxSchema,
16553
- pixelCount: number(),
16554
- intensity: number()
16555
- })).readonly().optional(),
16556
- /** Omitted in slim projection. */
16557
- frameWidth: number().optional(),
16558
- /** Omitted in slim projection. */
16559
- frameHeight: number().optional(),
16560
- /** Populated by B5 (recording playback URL for this event). */
16561
- mediaUrl: string().optional()
16562
- });
16402
+ image: _instanceof(Uint8Array).optional(),
16403
+ referenceImage: string().optional(),
16404
+ deviceId: number().optional(),
16405
+ sessionId: string().optional(),
16406
+ /**
16407
+ * Execution plane. 'full' (default) runs the whole tree — benchmark,
16408
+ * reference-image, and detail-subtree calls. 'frame' is the live
16409
+ * per-frame dispatch: ONLY root-plane steps run; crop children
16410
+ * (inputClasses ≠ null) are skipped and served per-track via
16411
+ * pipelineRunner.runDetailSubtree (two-plane design).
16412
+ */
16413
+ plane: _enum(["full", "frame"]).optional(),
16414
+ /**
16415
+ * Inference-device selector (Phase 2 multi-device). Format
16416
+ * `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
16417
+ * Omitted ⇒ the runner's default device (current single-engine
16418
+ * behaviour). Selects WHICH device pool of the node runs the call.
16419
+ */
16420
+ deviceKey: string().optional(),
16421
+ /**
16422
+ * Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
16423
+ * when the parent crop was resolved from the frame's retained NATIVE
16424
+ * surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
16425
+ * child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
16426
+ * resolution from that surface — the SAME quality path faces already
16427
+ * had — instead of the downscaled parent tile. `handle` keys the native
16428
+ * surface (node-pinned to its owner); `cropFrameSpace` is the parent
16429
+ * crop's padded/clamped rectangle in FRAME-space pixels, used to compose
16430
+ * the executor's crop-normalized child ROI back into frame-normalized
16431
+ * coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
16432
+ * of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
16433
+ * (today's behaviour on the fallback path).
16434
+ */
16435
+ nativeCropRef: NativeCropRefSchema.optional()
16436
+ }), PipelineRunResultBridge, { kind: "mutation" }), method(object({
16437
+ engine: PipelineEngineChoiceSchema.optional(),
16438
+ steps: array(PipelineStepInputSchema).min(1),
16439
+ frames: array(FrameInputSchema).min(1).max(255),
16440
+ deviceId: number().optional(),
16441
+ sessionId: string().optional(),
16442
+ /**
16443
+ * Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
16444
+ * the batch to the Python pool's bench preprocess cache
16445
+ * (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
16446
+ * preprocessed ONCE and every later inference is a pure-inference cache
16447
+ * hit — the sustained-throughput run measures inference, not
16448
+ * decode+preprocess+infer. Omitted/0 for live frames (all different →
16449
+ * full preprocess every call, correct). Fresh per sustained run;
16450
+ * released via `uncacheFrame`.
16451
+ */
16452
+ frameId: number().int().nonnegative().optional(),
16453
+ /** Inference-device selector (Phase 2 multi-device); see runPipeline. */
16454
+ deviceKey: string().optional()
16455
+ }), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
16456
+ data: _instanceof(Uint8Array),
16457
+ width: number().int().positive(),
16458
+ height: number().int().positive(),
16459
+ format: _enum([
16460
+ "rgb",
16461
+ "bgr",
16462
+ "gray"
16463
+ ])
16464
+ }), object({
16465
+ frameId: number(),
16466
+ width: number(),
16467
+ height: number()
16468
+ }), { kind: "mutation" }), method(object({
16469
+ stepId: string(),
16470
+ frameId: number().int()
16471
+ }), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(_void(), object({
16472
+ batchMode: string(),
16473
+ windowMs: number(),
16474
+ maxBatchSize: number(),
16475
+ concurrency: number()
16476
+ })), method(_void(), array(object({
16477
+ engineKey: string(),
16478
+ engine: PipelineEngineChoiceSchema,
16479
+ modelsLoaded: array(string()).readonly(),
16480
+ inUseByCameras: array(number()).readonly(),
16481
+ /**
16482
+ * Origin of this resident factory.
16483
+ * - `runtime` — main camera-serving engine (no idle TTL).
16484
+ * - `warm-override` — benchmark/test override held in the warm
16485
+ * cache; auto-disposed after the idle TTL.
16486
+ * - `device-pool` — a concurrent per-device pool (Phase 2
16487
+ * multi-device, keyed by `deviceKey`) resolved
16488
+ * via `resolveDeviceFactory`. Runs alongside the
16489
+ * `runtime` engine on a DIFFERENT accelerator
16490
+ * (NPU / iGPU / Coral) — this is how the
16491
+ * Engines tab shows all pools running at once.
16492
+ */
16493
+ kind: _enum([
16494
+ "runtime",
16495
+ "warm-override",
16496
+ "device-pool"
16497
+ ]),
16498
+ /** Native pid of the underlying Python pool (null when no pool). */
16499
+ poolPid: number().nullable(),
16500
+ /** ms since this factory was last used (null when not warm-tracked). */
16501
+ idleMs: number().nullable(),
16502
+ /** Idle TTL after which `warm-override` factories self-evict (null when not applicable). */
16503
+ idleTtlMs: number().nullable()
16504
+ })).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
16505
+ kind: "mutation",
16506
+ auth: "admin"
16507
+ }), method(object({
16508
+ engine: PipelineEngineChoiceSchema,
16509
+ force: boolean().optional()
16510
+ }), object({
16511
+ success: boolean(),
16512
+ reason: string().optional()
16513
+ }), {
16514
+ kind: "mutation",
16515
+ auth: "admin"
16516
+ }), method(_void(), array(ReferenceImageEntrySchema).readonly()), method(object({ filename: string() }), ReferenceImageBodySchema.nullable()), method(_void(), array(ReferenceAudioEntrySchema).readonly()), method(object({ filename: string() }), ReferenceAudioBodySchema.nullable()), method(_void(), AudioCapabilitiesSchema), method(object({
16517
+ addonId: string(),
16518
+ modelId: string(),
16519
+ filename: string().optional(),
16520
+ settings: record(string(), unknown()).optional()
16521
+ }), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
16563
16522
  /**
16564
- * Which detection SOURCE produced an object event. `pipeline` = the ML
16565
- * detection pipeline (decoded-frame inference); `onboard` = the camera's
16566
- * native on-device AI. Both flow through the SAME analysis layers (zoning,
16567
- * tracking, per-kind persistence) but stay distinguishable so consumers
16568
- * (advanced-notifier, occupancy, …) can select which source(s) to act on.
16569
- * Absent on legacy rows treat as `pipeline`.
16523
+ * Per-stage gating mode applied to the zones a rule references.
16524
+ *
16525
+ * - `include`: the rule contributes to a **whitelist** for its stage.
16526
+ * When at least one `include` rule fires for a stage, only entities
16527
+ * inside one of those zones pass that stage.
16528
+ * - `exclude`: the rule contributes to a **blacklist** for its stage.
16529
+ * Entities inside one of those zones are dropped at that stage.
16530
+ *
16531
+ * `monitor`-style observation (count without filtering) is not a rule
16532
+ * mode — zones without any matching rule are observed naturally by
16533
+ * `zone-analytics` (live snapshot + history), so an "I just want to
16534
+ * count, not filter" use case needs no rule at all.
16570
16535
  */
16571
- var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
16536
+ var ZoneRuleModeEnum = _enum(["include", "exclude"]);
16572
16537
  /**
16573
- * The confirmed zone crossing that produced an object event. Present ONLY on
16574
- * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
16575
- * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
16576
- * appearance event carry none, so a rule asking for a direction fails closed
16577
- * on them.
16538
+ * Per-consumer rule that references existing zones (geometry) and
16539
+ * defines how a specific pipeline stage should treat them. Each
16540
+ * consumer addon owns its own `ZoneRule[]` array in its per-device
16541
+ * settings:
16578
16542
  *
16579
- * Exactly ONE crossing per event: the emitter turns each confirmed crossing
16580
- * into its own event, so a frame in which a track enters A while leaving B
16581
- * produces two events with two directions — never one ambiguous row.
16543
+ * - `addon-motion-wasm` `motionZoneRules: ZoneRule[]` (motion stage)
16544
+ * - `addon-detection-pipeline` `detectionZoneRules: ZoneRule[]` (detection stage)
16545
+ * - future: notification rules, audio gating, etc.
16582
16546
  *
16583
- * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
16584
- * membership the box has NOW, and by definition it no longer contains the zone
16585
- * that was just left. Without the id here, a zone-scoped rule could never match
16586
- * the exit it asked for.
16547
+ * One rule applies to N zones (`zoneIds[]`) so the operator can
16548
+ * express "ignore motion in ALL of {garden, street}" with a single
16549
+ * rule. `classFilter` narrows the rule to specific object classes
16550
+ * "drop person detections in the street, but keep cars" is one
16551
+ * `exclude` rule with `classFilter: ['person']`.
16552
+ *
16553
+ * `enabled` is a soft toggle — the operator can keep the rule
16554
+ * configured but inert without deleting it.
16587
16555
  */
16588
- var ZoneCrossingSchema = object({
16589
- direction: _enum(["enter", "exit"]),
16590
- /** Admin zone id crossed. */
16591
- zoneId: string(),
16592
- /** Zone display name at crossing time (falls back to the id). */
16593
- zoneName: string().optional()
16594
- });
16595
- var ObjectEventSchema = object({
16596
- ...BaseEventFields,
16597
- kind: literal("object"),
16598
- /** Detection source. Optional for backward-compat; absent ⇒ `pipeline`. */
16599
- source: DetectionSourceSchema.optional(),
16556
+ var ZoneRuleSchema = object({
16557
+ /** Stable rule id — survives edits, used by the UI for diffing. */
16558
+ id: string(),
16559
+ /** Optional human-readable label rendered in the rule editor. */
16560
+ name: string().optional(),
16561
+ /** Zones this rule targets. The rule's `mode` applies to ALL
16562
+ * listed zones (OR-set: a detection in any one of them counts).
16563
+ * At least one zone id required — a rule with no targets is a
16564
+ * configuration mistake and the form validator rejects it. */
16565
+ zoneIds: array(string()).min(1).readonly(),
16566
+ mode: ZoneRuleModeEnum,
16600
16567
  /**
16601
- * Inference-frame id shared by every object event emitted from the SAME frame
16602
- * the "scene/parent" key. Lets a consumer group co-occurring detections (e.g.
16603
- * 2 people + 1 dog) under one full frame, and link a track's frames over time
16604
- * (group by `trackId`, pick a representative `frameId` as the parent frame).
16605
- * Optional for backward-compat with pre-existing rows / the slim projection
16606
- * includes it (it is light). Absent on rows written before this field.
16568
+ * Class names this rule applies to. Empty / undefined rule
16569
+ * applies to every class. Class strings match the `macroClass`
16570
+ * field on detections (e.g. `person`, `car`, `dog`).
16607
16571
  */
16608
- frameId: string().optional(),
16609
- /** Omitted in slim projection. */
16610
- trackId: string().optional(),
16611
- className: string(),
16612
- ...TieredLabelFields,
16613
- /** Omitted in slim projection. */
16614
- confidence: number().optional(),
16615
- /** Heavy JSON — omitted in slim projection. */
16616
- bbox: BoundingBoxSchema.optional(),
16617
- /** Heavy JSON — omitted in slim projection. */
16618
- zones: array(string()).readonly().optional(),
16619
- /** Omitted in slim projection. */
16620
- state: TrackStateSchema.optional(),
16572
+ classFilter: array(string()).readonly().optional(),
16621
16573
  /**
16622
- * The zone crossing this event IS, when it is one. Absent on every other
16623
- * event kind (movement state, appearance, package) see
16624
- * {@link ZoneCrossingSchema}. Omitted in slim projection.
16574
+ * Minimum bbox/mask overlap (0–1) with any of the rule's zones
16575
+ * required to consider an entity "in the zone". Defaults to the
16576
+ * consumer's stage default when omitted. Kept for back-compat with
16577
+ * existing per-rule overrides; new operators pick the value via
16578
+ * `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
16579
+ * set, the lower-level engine reads it as a 0–1 fraction.
16625
16580
  */
16626
- zoneCrossing: ZoneCrossingSchema.optional(),
16627
- /** Detection-frame dimensions in pixels — let consumers normalize the
16628
- * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
16629
- frameWidth: number().optional(),
16630
- frameHeight: number().optional(),
16631
- /** MediaStore key for the crop attached to this event (if any). */
16632
- mediaKey: string().optional(),
16633
- /** Design B: MediaStore key of the track's native-resolution key frame (the
16634
- * best-detection full frame). Resolve via the event-media data-plane
16635
- * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
16636
- * draws `bbox` over the native frame. Absent on legacy rows / non-decoded
16637
- * sources — consumers fall back to `mediaKey` (the tight crop). */
16638
- keyFrameMediaKey: string().optional(),
16639
- /** Populated by B5 (recording playback URL for this event). */
16640
- mediaUrl: string().optional(),
16641
- /** The parent track's key-event importance [0,1], propagated to every object
16642
- * event of the track (so an event row can be sorted by importance without a
16643
- * track join). Absent on legacy rows / before the track was scored. */
16644
- importance: number().optional()
16645
- });
16646
- var AudioEventSchema = object({
16647
- ...BaseEventFields,
16648
- kind: literal("audio"),
16649
- rms: number(),
16650
- dbfs: number(),
16651
- classification: object({
16652
- className: string(),
16653
- originalClass: string().optional(),
16654
- score: number()
16655
- }).optional(),
16656
- /** Populated by B5 (recording playback URL for this event). */
16657
- mediaUrl: string().optional()
16658
- });
16659
- var MediaFileKindEnum = _enum([
16660
- "crop",
16661
- "thumbnail",
16662
- "snapshot",
16663
- "firstFrame",
16664
- "lastFrame",
16665
- "fullFrame",
16666
- "fullFrameBoxed",
16667
- "faceCrop",
16668
- "plateCrop",
16669
- "keyFrame",
16670
- "keyFrameSmall",
16671
- "thumbnailSmall"
16672
- ]);
16673
- var MediaFileSchema = object({
16674
- key: string(),
16675
- kind: MediaFileKindEnum,
16676
- base64: string(),
16677
- sizeBytes: number(),
16678
- timestamp: number()
16581
+ overlapThreshold: number().min(0).max(1).optional(),
16582
+ /**
16583
+ * Operator-friendly version of `overlapThreshold` the percentage
16584
+ * of the detection's bbox that must lie inside the zone for the
16585
+ * rule to match. Documented default is 85%; the engine substitutes
16586
+ * that when the field is omitted (kept optional so existing rules
16587
+ * stored without it stay valid).
16588
+ *
16589
+ * When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
16590
+ * rule, the engine prefers `bboxInclusionPct` because it's the
16591
+ * field exposed in the UI. Internally both feed the same gate.
16592
+ */
16593
+ bboxInclusionPct: number().min(0).max(100).optional(),
16594
+ /**
16595
+ * When `true` and a detection has a segmentation mask, use the
16596
+ * mask for overlap instead of the bbox. Detection-stage only;
16597
+ * motion rules ignore this field.
16598
+ */
16599
+ preferMask: boolean().optional(),
16600
+ /**
16601
+ * Soft-toggle: `false` disables the rule without deleting it.
16602
+ * Defaults to `true` so operators creating a rule via the UI
16603
+ * see it active immediately.
16604
+ */
16605
+ enabled: boolean().default(true)
16679
16606
  });
16607
+ array(ZoneRuleSchema).readonly();
16680
16608
  /**
16681
- * One media row WITHOUT its bytes.
16609
+ * Zone pure geometry + identity. NO filtering behaviour.
16682
16610
  *
16683
- * A track's media is 5-8 MB of base64 (measured: 7.67 MB across 23 files for a
16684
- * 140 s track), and a client that renders tiles from the media data plane needs
16685
- * to know only WHAT EXISTS the bytes then arrive per tile, lazily, over HTTP
16686
- * with an immutable cache, instead of all at once inside a tRPC response that
16687
- * blocks the whole view.
16611
+ * Zones describe **where** in the frame the operator wants to flag
16612
+ * something; consumer-owned {@link ZoneRule} arrays describe **how**
16613
+ * each pipeline stage uses them. Splitting the two means a single
16614
+ * polygon "Driveway" can simultaneously back a motion-exclude rule,
16615
+ * a detection-include rule on `['car']`, and an occupancy aggregate
16616
+ * — without three duplicated polygons.
16688
16617
  *
16689
- * `sizeBytes` is carried because it is what lets a client decide between the
16690
- * stored blob and a `?variant=thumb` rendering without fetching either.
16618
+ * Owned by the orchestrator addon (provider) and mirrored into the
16619
+ * `zones` device-state slice on every mutation. Consumers
16620
+ * (motion-wasm, pipeline-executor, analytics, admin UI) read either
16621
+ * via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
16622
+ * mirror with `onChanged`).
16623
+ *
16624
+ * Coordinates are normalised fractions of the frame (0–1) so zones
16625
+ * survive resolution changes and stream profile switches.
16626
+ *
16627
+ * `kind` discriminates between full polygons (closed regions used
16628
+ * for intrusion / occupancy filters) and tripwires (open 2-point
16629
+ * line segments used for cross events). Onboard / firmware-reported
16630
+ * zones (Reolink, ONVIF) are out of scope for now — see the deferred
16631
+ * task list.
16691
16632
  */
16692
- var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
16633
+ var ZoneKindEnum = _enum(["polygon", "tripwire"]);
16634
+ /** Polygon vertex in fraction-of-frame coordinates (0–1). */
16635
+ var PolygonPointSchema = object({
16636
+ x: number(),
16637
+ y: number()
16638
+ });
16639
+ /** A camera detection zone — pure geometry/identity. */
16640
+ var ZoneSchema = object({
16641
+ id: string(),
16642
+ name: string(),
16643
+ kind: ZoneKindEnum.default("polygon"),
16644
+ /** Polygon vertices, fraction of frame (0–1). */
16645
+ polygon: array(PolygonPointSchema).readonly(),
16646
+ /** Visual color for UI rendering. */
16647
+ color: string().default("#3b82f6")
16648
+ });
16649
+ DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).readonly()), method(object({
16650
+ deviceId: number(),
16651
+ zone: ZoneSchema
16652
+ }), _void(), {
16653
+ kind: "mutation",
16654
+ auth: "admin"
16655
+ }), method(object({
16656
+ deviceId: number(),
16657
+ zoneId: string()
16658
+ }), _void(), {
16659
+ kind: "mutation",
16660
+ auth: "admin"
16661
+ }), method(object({
16662
+ deviceId: number(),
16663
+ zone: ZoneSchema
16664
+ }), _void(), {
16665
+ kind: "mutation",
16666
+ auth: "admin"
16667
+ }), object({ zones: array(ZoneSchema).readonly() });
16693
16668
  /**
16694
- * The MACRO tier of an annotation — a CLOSED set.
16669
+ * pipeline-analytics device-scoped wrapper cap. Refines raw
16670
+ * per-frame detections emitted by the pipeline runner into tracked
16671
+ * objects, per-kind event collections (motion / object / audio), and
16672
+ * persisted media. Owns the post-detection domain end-to-end:
16695
16673
  *
16696
- * This is what the exported detector predicts, so a typo here is a new class
16697
- * with one example in it. `label` and `subLabel` are open strings by contrast:
16698
- * the whole point of the page is teaching the model things it does not know
16699
- * yet, and constraining that vocabulary would make it useless.
16674
+ * runner emits PipelineInferenceResult
16675
+ * (event bus)
16676
+ * pipeline-analytics subscriber
16677
+ * SORT tracker + zone engine + state analyzer + event emitter
16678
+ * → three DB collections (one per kind), one FS media tree, one
16679
+ * unified event emitter (FrameTracked + TrackStarted/Ended +
16680
+ * DetectionEvent on bus)
16700
16681
  *
16701
- * A macro class is NEVER a label. The provider refuses a write whose `label` or
16702
- * `subLabel` is one of these values, in any casing, because once `person`
16703
- * exists in both tiers "every person box" stops being answerable without
16704
- * knowing every string anyone ever typed — and the damage is retroactive.
16682
+ * Pure subscriber model. No `processFrame` cap method the runner
16683
+ * already publishes the raw frame on the bus. The cap surface is
16684
+ * only QUERIES + per-device settings, bound on/off via
16685
+ * `device-manager.setWrapperActive`. `defaultActive: true` because
16686
+ * every camera with a detection pipeline wants its raw detections
16687
+ * refined; operators opt out per-device via BindingsTab when needed.
16688
+ *
16689
+ * Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
16690
+ * (per-device surface) and `track-trail` caps — see P11 cleanup.
16705
16691
  */
16706
- var RetrainMacroClassSchema = _enum([
16692
+ var TrackStateSchema = _enum([
16693
+ "new",
16694
+ "entered",
16695
+ "left",
16696
+ "moving",
16697
+ "idle"
16698
+ ]);
16699
+ var EventKindSchema = _enum([
16700
+ "motion",
16701
+ "object",
16702
+ "audio"
16703
+ ]);
16704
+ /**
16705
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
16706
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
16707
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
16708
+ */
16709
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
16710
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
16711
+ var EventKindIconSchema = _enum([
16712
+ "motion",
16713
+ "audio",
16707
16714
  "person",
16708
16715
  "vehicle",
16709
16716
  "animal",
16717
+ "door",
16718
+ "pir",
16719
+ "smoke",
16720
+ "water",
16721
+ "button",
16710
16722
  "package",
16711
- "face",
16712
- "plate"
16723
+ "generic"
16713
16724
  ]);
16714
- /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
16715
- var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
16716
- /** Did a human draw this box, or did the assist propose it? */
16717
- var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
16718
- /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
16719
- var RetrainBboxSchema = object({
16725
+ var EventKindCategorySchema = _enum([
16726
+ "motion",
16727
+ "audio",
16728
+ "detection",
16729
+ "sensor",
16730
+ "control",
16731
+ "custom",
16732
+ "package"
16733
+ ]);
16734
+ /** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
16735
+ var EventKindLevelSchema = _enum(["macro", "sub"]);
16736
+ var EventKindDescriptorSchema = object({
16737
+ /** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
16738
+ kind: string(),
16739
+ /** i18n key resolved on the UI side; `label` is the English fallback. */
16740
+ labelKey: string(),
16741
+ /** English fallback label (kept for clients that don't translate). */
16742
+ label: string(),
16743
+ /** Hex color for timeline/legend rendering. */
16744
+ color: string(),
16745
+ /** Dictionary id → lucide component on the UI side. */
16746
+ iconId: string(),
16747
+ /** Legacy closed-vocab glyph — fallback for `iconId`. */
16748
+ icon: EventKindIconSchema,
16749
+ category: EventKindCategorySchema,
16750
+ /** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
16751
+ parentKind: string().nullable(),
16752
+ /** Derived from `parentKind`, explicit for the client tree. */
16753
+ level: EventKindLevelSchema,
16754
+ /** Which cap + device contributes this kind. For built-ins the camera
16755
+ * itself; for sensor kinds the LINKED source device. */
16756
+ source: object({
16757
+ capName: string(),
16758
+ deviceId: number()
16759
+ })
16760
+ });
16761
+ /** One camera's event vocabulary, as returned by `listEventKindsBatch`. */
16762
+ var EventKindsForDeviceSchema = object({
16763
+ deviceId: number(),
16764
+ kinds: array(EventKindDescriptorSchema).readonly()
16765
+ });
16766
+ var SensorEventSchema = object({
16767
+ id: string(),
16768
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
16769
+ * yields N rows, one per camera). */
16770
+ deviceId: number(),
16771
+ /** The linked sensor device whose state changed. */
16772
+ sourceDeviceId: number(),
16773
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
16774
+ kind: string(),
16775
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
16776
+ value: record(string(), unknown()).nullable(),
16777
+ timestamp: number()
16778
+ });
16779
+ var TrackPositionSchema = object({
16720
16780
  x: number(),
16721
16781
  y: number(),
16722
- w: number(),
16723
- h: number()
16782
+ timestamp: number(),
16783
+ bbox: BoundingBoxSchema
16784
+ });
16785
+ var TrackSnapshotSchema = object({
16786
+ timestamp: number(),
16787
+ position: TrackPositionSchema,
16788
+ /** MediaStore key; resolve via `getTrackMedia({ trackId })`. */
16789
+ mediaKey: string()
16724
16790
  });
16725
16791
  /**
16726
- * One annotated subject.
16727
- *
16728
- * `bbox` is normalised against the full frame, ALWAYS. The per-model shapes
16729
- * (letterboxed root / zone-cropped package / subject-cropped classifier) are
16730
- * derived from it at export and never stored — storing them is how one feature
16731
- * space ends up holding two crops of the same subject (D52).
16732
- */
16733
- var RetrainAnnotationSchema = object({
16734
- id: string(),
16792
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
16793
+ * divided by the track's detection-frame dims), computed at persist time.
16794
+ * Absent when the frame dims were unknown when the track was persisted
16795
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
16796
+ */
16797
+ var TrackEnvelopeSchema = object({
16798
+ minX: number(),
16799
+ minY: number(),
16800
+ maxX: number(),
16801
+ maxY: number()
16802
+ });
16803
+ /**
16804
+ * Row projection for track list queries. `full` (default) returns the
16805
+ * complete Track including the frame-rate `positions[]` history and the
16806
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
16807
+ * keeps every scalar the list surfaces actually render (ids, class(es),
16808
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
16809
+ * zonesVisited, bestEventId, envelope, hasFace, hasEmbeddedFace, hasRider) and returns `positions` /
16810
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
16811
+ * `getTrack`. Mirrors the event-store `projection` convention
16812
+ * (`getObjectEvents` et al.).
16813
+ */
16814
+ var TrackProjectionSchema = _enum(["full", "slim"]);
16815
+ /**
16816
+ * One audio-classification label heard on the track's camera while the
16817
+ * track was alive, aggregated per label. An "episode" is one persisted
16818
+ * audio event (the confident-classification path: score ≥ the device's
16819
+ * `classificationMinScore`, class-change-or-heartbeat coalesced) — NOT
16820
+ * one 32 ms inference chunk, so counts stay human-scaled.
16821
+ */
16822
+ var TrackAudioLabelSchema = object({
16823
+ label: string(),
16824
+ /** Highest classification score observed across the label's episodes. */
16825
+ peakScore: number(),
16826
+ /** Number of coalesced audio-event episodes carrying this label. */
16827
+ count: number(),
16828
+ firstAt: number(),
16829
+ lastAt: number()
16830
+ });
16831
+ /**
16832
+ * How a track was produced. `pipeline` (default / absent) = the spatial
16833
+ * detection+tracking pipeline. Every OTHER value is a SYNTHETIC projection —
16834
+ * no positions, a single snapshot, and no bbox trajectory at all:
16835
+ *
16836
+ * - `sensor` — a linked sensor/control device state change.
16837
+ * - `audio` — an audio event on the camera itself that was anomalous for
16838
+ * THAT camera, loud, and heard while nothing visual was happening (D62).
16839
+ *
16840
+ * The spatial subsystems (tracker association, occupancy count, re-id /
16841
+ * embedding, resurrection) MUST skip every synthetic source. Test for that
16842
+ * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
16843
+ * check silently readmits every source added after it was written.
16844
+ */
16845
+ var TrackSourceSchema = _enum([
16846
+ "pipeline",
16847
+ "sensor",
16848
+ "audio"
16849
+ ]);
16850
+ /**
16851
+ * Where a track sits in the RETRAIN lifecycle (D81).
16852
+ *
16853
+ * - `none` — never marked, or un-marked. Evictable.
16854
+ * - `staging` — the operator wants this track as training material and has not
16855
+ * finished with it. **This is the only state retention holds**: the track and
16856
+ * everything it owns (object events, crops, keyframes, CLIP vector) survive
16857
+ * the device's age window.
16858
+ * - `trained` — the retrain page has taken what it needed. The frames it chose
16859
+ * were COPIED into the retrain dataset at selection time, so the dataset no
16860
+ * longer depends on the track's media and the track becomes EVICTABLE again.
16861
+ * Terminal for the plain `markForTrain` toggle: returning it to `staging` is
16862
+ * a deliberate action of the retrain page, not a side effect of a checkbox.
16863
+ *
16864
+ * There is no `null`. The state is stored `TEXT NOT NULL DEFAULT 'none'` because
16865
+ * the store's filter language has only positive equality and `whereIn` — no
16866
+ * negation, no IS NULL — so a NULL would be unselectable by ANY predicate and
16867
+ * would make the entire pre-column history immortal in one deploy.
16868
+ */
16869
+ var RetrainStatusSchema = _enum([
16870
+ "none",
16871
+ "staging",
16872
+ "trained"
16873
+ ]);
16874
+ /**
16875
+ * Per-track OPERATOR flags — set by hand from the admin UI or the viewer, never
16876
+ * by the pipeline. Spread into `TrackSchema` and `KeyEventSchema` from one place
16877
+ * so the two surfaces cannot drift.
16878
+ *
16879
+ * **Absent ≠ false.** A track that has never been touched omits the field; an
16880
+ * explicitly un-flagged track carries `false`. Legacy rows written before the
16881
+ * columns existed read as absent, and a consumer that needs a boolean should say
16882
+ * `flag === true`, not `flag !== false`.
16883
+ *
16884
+ * `markForTrain` is the WIRE FACE of {@link RetrainStatusSchema}, not a column:
16885
+ * it is exactly `retrainStatus === 'staging'`, in both directions. Writing
16886
+ * `true` moves `none → staging`, writing `false` moves `staging → none`, and a
16887
+ * `trained` track reports `false` while refusing both writes. The boolean is
16888
+ * kept because three surfaces drive a toggle off it; anything that needs to tell
16889
+ * "never marked" from "already trained" must read `retrainStatus`.
16890
+ *
16891
+ * `debug` does NOT pin; it is attention, not durability.
16892
+ *
16893
+ * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
16894
+ * A favourited track is skipped by retention the same way `staging` is, but
16895
+ * it does not enter `none|staging|trained` and has no staging budget.
16896
+ */
16897
+ var TrackFlagFields = {
16898
+ /** Operator marked this track as training material — i.e. `retrainStatus` is
16899
+ * `'staging'`. */
16900
+ markForTrain: boolean().optional(),
16901
+ /** Operator marked this track for diagnostic attention. */
16902
+ debug: boolean().optional(),
16903
+ /** Operator favourited this track. Pins it against pruning. */
16904
+ favourited: boolean().optional()
16905
+ };
16906
+ /**
16907
+ * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
16908
+ * Deliberately NOT part of {@link TrackFlagFields}: that group also builds the
16909
+ * write patch, and the status is not something the toggle sets — it is what the
16910
+ * toggle's boolean is derived from. Absent on an in-RAM track never touched;
16911
+ * always present on a persisted row (the column default materialises `'none'`).
16912
+ */
16913
+ var TrackRetrainFields = { retrainStatus: RetrainStatusSchema.optional() };
16914
+ /**
16915
+ * The write half: a PARTIAL patch. An omitted key is left untouched, so setting
16916
+ * one flag can never clear the other — the toggles are independent and are
16917
+ * driven from three surfaces that do not know about each other.
16918
+ */
16919
+ var TrackFlagsPatchSchema = object(TrackFlagFields);
16920
+ /**
16921
+ * The resolved flag state after a write. Both fields are REQUIRED here (absent
16922
+ * collapses to `false`) so a caller can drive a toggle's checked state off the
16923
+ * mutation result without a re-fetch.
16924
+ */
16925
+ var TrackFlagsSchema = object({
16735
16926
  trackId: string(),
16736
- deviceId: number(),
16737
- /** The COPY in retrain storage — never the source track's media key. */
16738
- mediaKey: string(),
16739
- bbox: RetrainBboxSchema,
16740
- macroClass: RetrainMacroClassSchema,
16927
+ markForTrain: boolean(),
16928
+ debug: boolean(),
16929
+ favourited: boolean(),
16930
+ /** The lifecycle state the boolean was derived from. Required here (unlike on
16931
+ * a track row) because this shape is only ever produced by the write body,
16932
+ * which always knows it — and a surface that has just written needs to render
16933
+ * `trained` without a re-fetch. */
16934
+ retrainStatus: RetrainStatusSchema
16935
+ });
16936
+ union([literal(1), literal(2)]);
16937
+ /**
16938
+ * WHO decided a label, and when. Carried per tier so a value can be traced to
16939
+ * the step and model that produced it — which is what makes the write rule
16940
+ * arguable after the fact ("why is 592's label `dog` and not `Canis lupus`?")
16941
+ * and what lets a migrated, UNATTRIBUTED value be told apart from a real one.
16942
+ *
16943
+ * `stepId` is the pipeline step id (`animal-classifier`, `bird-classifier`,
16944
+ * `plate-ocr`, `face-embedding`, `object-detection`), or the sentinel
16945
+ * `migration:4g` for a value the 4g migration moved from the single-slot era —
16946
+ * that value has no provenance, and the write rule lets ANY properly-attributed
16947
+ * write of the same tier replace it regardless of score.
16948
+ */
16949
+ var LabelAttributionSchema = object({
16950
+ stepId: string(),
16951
+ modelId: string().optional(),
16952
+ decidedAt: number(),
16953
+ /**
16954
+ * The GALLERY id behind a recognised tier-2 label — a face-gallery
16955
+ * `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
16956
+ *
16957
+ * The text alone is a DISPLAY NAME, and a display name is renameable: a
16958
+ * notification rule authored on "Gianluca" stopped matching the moment the
16959
+ * operator fixed the spelling in the gallery, and nothing said so. The id is
16960
+ * the thing that does not move, so it is what a rule matches on
16961
+ * (`NcConditions.identities`) and the text is what a human is shown.
16962
+ *
16963
+ * Absent when the label names no gallery row — a plate the OCR read but no
16964
+ * vehicle claims, a sub-class, a species, any tier-1 value.
16965
+ */
16966
+ identityId: string().optional()
16967
+ });
16968
+ /**
16969
+ * The TIERED label model (roadmap 4g), spread into `TrackSchema` and
16970
+ * `ObjectEventSchema` from ONE place so the two surfaces cannot drift — a
16971
+ * track and its events always answer the same question the same way.
16972
+ *
16973
+ * Two scalar columns, not an array: every consumer wants "the coarse one" or
16974
+ * "the fine one", and an array made both a scan. `label` is tier 1, `subLabel`
16975
+ * is tier 2, and each carries its own score + attribution.
16976
+ *
16977
+ * **Reading it.** What a human should be shown is `subLabel ?? label` — the
16978
+ * finest thing known. Before 4g the single `label` column held the finest
16979
+ * value, so a consumer that has not been updated reads the tier-1 slot and
16980
+ * shows nothing on a species-only row; that is why the migration puts every
16981
+ * pre-4g value in tier 2 (it cannot regress a display that reads the fallback)
16982
+ * and why the read surfaces were changed in the same train.
16983
+ *
16984
+ * **Writing it.** The slots are independent, which is the whole point: a
16985
+ * tier-1 write (`bird`) can never overwrite a tier-2 value (`Turdus
16986
+ * migratorius`), so fineness cannot regress by construction. Within a tier the
16987
+ * higher score wins. One rule, one implementation — see
16988
+ * `pipeline/label-tier.ts` in addon-post-analysis.
16989
+ */
16990
+ var TieredLabelFields = {
16991
+ /** Tier 1 — the sub-class. See {@link LabelTierSchema}. */
16741
16992
  label: string().optional(),
16993
+ /** Confidence of the tier-1 value, as reported by the deciding step. */
16994
+ labelScore: number().optional(),
16995
+ /** Provenance of the tier-1 value. See {@link LabelAttributionSchema}. */
16996
+ labelMeta: LabelAttributionSchema.optional(),
16997
+ /** Tier 2 — the instance. See {@link LabelTierSchema}. */
16742
16998
  subLabel: string().optional(),
16743
- kind: RetrainAnnotationKindSchema,
16744
- source: RetrainAnnotationSourceSchema,
16745
- /** Which model proposed this box or, on a `model_error`, drew the phantom. */
16746
- assistModelId: string().optional(),
16747
- assistScore: number().optional(),
16748
- exportedInBatch: string().optional(),
16749
- createdAt: number()
16999
+ /** Confidence of the tier-2 value, as reported by the deciding step. */
17000
+ subLabelScore: number().optional(),
17001
+ /** Provenance of the tier-2 value. See {@link LabelAttributionSchema}. */
17002
+ subLabelMeta: LabelAttributionSchema.optional()
17003
+ };
17004
+ /** Per-camera slice of a training-export estimate. */
17005
+ var TrainingExportDeviceTotalsSchema = object({
17006
+ deviceId: number(),
17007
+ tracks: number().int(),
17008
+ files: number().int(),
17009
+ bytes: number().int()
16750
17010
  });
16751
- /** The write form — the server owns `id`, `createdAt` and the frame binding. */
16752
- var RetrainAnnotationDraftSchema = RetrainAnnotationSchema.omit({
16753
- id: true,
16754
- trackId: true,
16755
- deviceId: true,
16756
- mediaKey: true,
16757
- createdAt: true,
16758
- exportedInBatch: true
17011
+ /**
17012
+ * What a training export WOULD contain. Computed from media index rows only —
17013
+ * no blob is read to produce this.
17014
+ */
17015
+ var TrainingExportSummarySchema = object({
17016
+ generatedAt: number(),
17017
+ trackCount: number().int(),
17018
+ fileCount: number().int(),
17019
+ byteCount: number().int(),
17020
+ /** More marked tracks exist than a single pass carries. */
17021
+ truncated: boolean(),
17022
+ devices: array(TrainingExportDeviceTotalsSchema).readonly()
16759
17023
  });
16760
- /** A track sitting in `staging`, with everything the worklist needs to rank it. */
16761
- var RetrainTrackSchema = object({
17024
+ var TrackSchema = object({
16762
17025
  trackId: string(),
16763
17026
  deviceId: number(),
16764
17027
  className: string(),
16765
- label: string().optional(),
17028
+ ...TieredLabelFields,
17029
+ producingDeviceName: string().optional(),
17030
+ /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
17031
+ source: TrackSourceSchema.optional(),
16766
17032
  firstSeen: number(),
16767
17033
  lastSeen: number(),
16768
- /** How many frames the dataset already holds from this track. */
16769
- frameCount: number().int(),
16770
- /** How many subjects have been annotated on those frames. `0` with
16771
- * `frameCount: 0` is exactly "staging, still to work". */
16772
- annotationCount: number().int()
16773
- });
16774
- /** A frame the picker may offer — an index row, no blob was read to produce it. */
16775
- var RetrainFrameCandidateSchema = object({
16776
- mediaKey: string(),
16777
- kind: MediaFileKindEnum,
16778
- timestamp: number(),
16779
- sizeBytes: number().int(),
16780
- /** A copy of this original already exists selecting it is free and cannot
16781
- * fail, whatever became of the original. */
16782
- copied: boolean()
17034
+ /** Frame-rate position history (subject to maxPositionHistory cap). */
17035
+ positions: array(TrackPositionSchema).readonly(),
17036
+ /** Periodic snapshots at snapshotIntervalMs cadence (subject to
17037
+ * saveThumbnails policy). */
17038
+ snapshots: array(TrackSnapshotSchema).readonly(),
17039
+ /** Deduplicated zones the track has entered at least once. Zone IDS. */
17040
+ zonesVisited: array(string()).readonly(),
17041
+ /**
17042
+ * Human NAMES for {@link zonesVisited}, resolved at READ time against the
17043
+ * `zones` capability.
17044
+ *
17045
+ * `zonesVisited` persists ids (`cfeec78c-8d69-…`), which no operator can type
17046
+ * and no card can render so every free-text search surface was structurally
17047
+ * unable to answer "show me the tracks in Uscio", and did not fail loudly, it
17048
+ * just returned nothing. Resolving here rather than in each client keeps ONE
17049
+ * derivation and costs the clients no extra call (the `zones` cap is
17050
+ * per-device, so a client-side resolve would be a per-camera fan-out on a
17051
+ * surface built to avoid exactly that).
17052
+ *
17053
+ * Resolved, never invented: a zone deleted since the track was written has no
17054
+ * name and is DROPPED, so this array can be shorter than `zonesVisited` — the
17055
+ * two are not positionally aligned. Absent when the track visited no zone, or
17056
+ * when the zone catalogue could not be read.
17057
+ */
17058
+ zoneNames: array(string()).readonly().optional(),
17059
+ /** Deduplicated set of detector classes observed for this track over its
17060
+ * life (a track may be reclassified, e.g. person→vehicle). Absent on
17061
+ * legacy rows written before class accumulation shipped. */
17062
+ classes: array(string()).readonly().optional(),
17063
+ /** Cumulative normalized distance travelled (0..1 units = full frame width). */
17064
+ totalDistance: number(),
17065
+ state: TrackStateSchema,
17066
+ active: boolean(),
17067
+ /** Deterministic key-event importance score in [0,1] (server-computed at
17068
+ * track expiry, recomputed on late label). Absent on legacy rows written
17069
+ * before scoring shipped — consumers degrade to absence / compute-on-read. */
17070
+ importance: number().optional(),
17071
+ /** Id of the track's highest-confidence ObjectEvent (its representative
17072
+ * "best" frame). Absent when the track produced no object events. */
17073
+ bestEventId: string().optional(),
17074
+ /** Tag of the importance sub-signal that dominated the score
17075
+ * (identity|dwell|proximity|class|confidence|travel|zone). */
17076
+ importanceReason: string().optional(),
17077
+ /** Audio-classification labels heard on the camera during the track's
17078
+ * life (score ≥ device `classificationMinScore`), aggregated per label.
17079
+ * Absent on legacy rows / tracks with no confident audio. */
17080
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
17081
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
17082
+ * Populated from the persisted envelope columns on historical reads;
17083
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
17084
+ envelope: TrackEnvelopeSchema.optional(),
17085
+ /**
17086
+ * A face DETECTOR found a face on this track — nothing more. It says the
17087
+ * detail plane produced a `face` detail; it does NOT say the face was
17088
+ * embedded, matched, above `minFacePx`, or that the recognizer was even
17089
+ * enabled. Set once and never cleared.
17090
+ *
17091
+ * **This exists so "face present but not recognised" is expressible.** A
17092
+ * recognised identity lands in `subLabel` (attributed to the face chain via
17093
+ * `subLabelMeta.stepId`), so before this field a track with an unmatched face
17094
+ * and a track with no face at all were byte-identical on the wire and no
17095
+ * surface could tell them apart. The read is `hasFace === true && subLabel
17096
+ * === undefined`.
17097
+ *
17098
+ * **Absent ≠ false.** Every row written before the column existed omits it,
17099
+ * and so does every server that predates the field — a consumer must test
17100
+ * `=== true` and render nothing otherwise, never infer "no face".
17101
+ */
17102
+ hasFace: boolean().optional(),
17103
+ /**
17104
+ * This track has a face row IN THE GALLERY: a crop **and** an embedding — a
17105
+ * face an operator could ASSIGN to an identity.
17106
+ *
17107
+ * The STRICT twin of {@link hasFace}, and the pair only earns its keep
17108
+ * because the two disagree. `hasFace` is stamped at the TOP of the face
17109
+ * branch, before every gate, and means no more than "a face detector produced
17110
+ * a face detail". This one is stamped at the single moment the gallery row
17111
+ * LANDS — after `FaceRecognizer.onTrackEnd` successfully persists it, i.e.
17112
+ * past the embedding-magnitude verdict, the `minFacePx` detection gate, the
17113
+ * candidate gate, the imageless-track drop (no crop was ever captured) and
17114
+ * the crop-store drop. Everything between the detector and that insert can
17115
+ * legitimately refuse the face, so a flag written any earlier promises the
17116
+ * operator something to assign and delivers nothing.
17117
+ *
17118
+ * **Independent of recognition.** A face collected but never auto-matched is
17119
+ * still assignable — it is in fact the face an operator most wants to reach —
17120
+ * so this is NOT gated on `recognizedIdentityId`. Recognition lands in
17121
+ * `subLabel`; this says only that the raw material exists.
17122
+ *
17123
+ * **Set once, never cleared.** A track that produced a gallery row produced
17124
+ * one; deleting the row later is the gallery's business, not this flag's.
17125
+ *
17126
+ * **Absent ≠ false**, the same rule as {@link hasFace}: every row written
17127
+ * before the column omits it, and so does every server that predates the
17128
+ * field. A consumer must test `=== true` and render nothing otherwise —
17129
+ * never infer "no assignable face".
17130
+ */
17131
+ hasEmbeddedFace: boolean().optional(),
17132
+ /**
17133
+ * This subject CONTAINS a folded rider — a person the rider-pairing step
17134
+ * ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
17135
+ * so the passage is tracked once and as a VEHICLE.
17136
+ *
17137
+ * It exists because the fold's record was dishonest. D34 and the code both
17138
+ * said "the person is not lost — it is reported so both entities stay on the
17139
+ * record"; in fact the pair went into a per-processor RAM field behind an
17140
+ * accessor nobody called, and every durable surface said `vehicle`, full
17141
+ * stop. This is the composition note that makes the row true.
17142
+ *
17143
+ * A COMPOSITION, never a class and never a label. "This vehicle contains a
17144
+ * person" is not an answer to "what is this" — both label tiers would refuse
17145
+ * a macro token anyway (D89), and correctly. Nothing here changes what the
17146
+ * subject IS: a cyclist stays one vehicle track, occupancy still counts one,
17147
+ * and a `person` rule still does not fire for someone cycling past.
17148
+ *
17149
+ * **Absent ≠ false**, exactly like {@link hasFace}: every row written before
17150
+ * the column, and every hub that predates the field, omits it. Test
17151
+ * `=== true` and render nothing otherwise — never infer "no rider".
17152
+ */
17153
+ hasRider: boolean().optional(),
17154
+ ...TrackFlagFields,
17155
+ ...TrackRetrainFields
16783
17156
  });
16784
- /** A frame the dataset OWNS: bytes copied at selection time. */
16785
- var RetrainFrameSchema = object({
16786
- frameId: string(),
17157
+ var BaseEventFields = {
17158
+ id: string(),
16787
17159
  deviceId: number(),
16788
- trackId: string(),
16789
- /** Provenance only. It may already point at nothing — that is expected. */
16790
- sourceMediaKey: string(),
16791
- sourceKind: MediaFileKindEnum,
16792
- sizeBytes: number().int(),
16793
- width: number().int(),
16794
- height: number().int(),
16795
- copiedAt: number()
16796
- });
16797
- /** Why a copy-on-select could not be honoured — named, never a silent skip. */
16798
- var RetrainCopyRefusalSchema = _enum([
16799
- "source-missing",
16800
- "unreadable-image",
16801
- "write-failed"
16802
- ]);
16803
- var RetrainFrameSelectionSchema = object({
16804
- copied: array(RetrainFrameSchema).readonly(),
16805
- refused: array(object({
16806
- sourceMediaKey: string(),
16807
- reason: RetrainCopyRefusalSchema
16808
- })).readonly()
16809
- });
16810
- var RetrainFrameListSchema = object({
16811
- candidates: array(RetrainFrameCandidateSchema).readonly(),
16812
- copies: array(RetrainFrameSchema).readonly(),
16813
- /** What the page pre-selects — the native key frame when one survives. */
16814
- autoPickMediaKey: string().optional()
17160
+ timestamp: number()
17161
+ };
17162
+ var MotionEventSchema = object({
17163
+ ...BaseEventFields,
17164
+ kind: literal("motion"),
17165
+ regionCount: number(),
17166
+ /** Heavy JSON array — omitted in slim projection. */
17167
+ regions: array(object({
17168
+ bbox: BoundingBoxSchema,
17169
+ pixelCount: number(),
17170
+ intensity: number()
17171
+ })).readonly().optional(),
17172
+ /** Omitted in slim projection. */
17173
+ frameWidth: number().optional(),
17174
+ /** Omitted in slim projection. */
17175
+ frameHeight: number().optional(),
17176
+ /** Populated by B5 (recording playback URL for this event). */
17177
+ mediaUrl: string().optional()
16815
17178
  });
16816
- /** What the operator asked the assist to look for. */
16817
- var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
16818
- kind: literal("package"),
16819
- zone: RetrainBboxSchema.optional()
16820
- }), object({
16821
- kind: literal("objects"),
16822
- modelId: string(),
16823
- minScore: number().optional()
16824
- })]);
16825
17179
  /**
16826
- * The assist's answer a discriminated union, because "the model saw nothing"
16827
- * and "this node cannot run that model" lead to different next moves and a
16828
- * nullable result cannot tell them apart.
17180
+ * Which detection SOURCE produced an object event. `pipeline` = the ML
17181
+ * detection pipeline (decoded-frame inference); `onboard` = the camera's
17182
+ * native on-device AI. Both flow through the SAME analysis layers (zoning,
17183
+ * tracking, per-kind persistence) but stay distinguishable so consumers
17184
+ * (advanced-notifier, occupancy, …) can select which source(s) to act on.
17185
+ * Absent on legacy rows ⇒ treat as `pipeline`.
16829
17186
  */
16830
- var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
16831
- kind: literal("proposed"),
16832
- modelId: string(),
16833
- stepId: string(),
16834
- minScore: number(),
16835
- /** Drafts, ready to edit. `source: 'assist'` until the operator touches one. */
16836
- proposals: array(RetrainAnnotationDraftSchema).readonly(),
16837
- /** Returned by the runner but removed by the threshold. */
16838
- belowThreshold: number().int()
16839
- }), object({
16840
- kind: literal("refused"),
16841
- /** `no-zone` is ours; the rest are the runner's own refusal vocabulary. */
16842
- reason: string(),
16843
- detail: string().optional()
16844
- })]);
16845
- /** The outcome of a lifecycle move owned by the retrain page. */
16846
- var RetrainTransitionResultSchema = object({
16847
- trackId: string(),
16848
- /** Where the track ended up, whatever happened. */
16849
- retrainStatus: RetrainStatusSchema,
16850
- /** `false` ⇒ the move was refused or was a no-op; `reason` says which. */
16851
- changed: boolean(),
16852
- reason: _enum([
16853
- "unknown-track",
16854
- "no-frames-copied",
16855
- "not-staging",
16856
- "not-trained",
16857
- "unchanged"
16858
- ]).optional()
17187
+ var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
17188
+ /**
17189
+ * The confirmed zone crossing that produced an object event. Present ONLY on
17190
+ * an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
17191
+ * event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
17192
+ * appearance event carry none, so a rule asking for a direction fails closed
17193
+ * on them.
17194
+ *
17195
+ * Exactly ONE crossing per event: the emitter turns each confirmed crossing
17196
+ * into its own event, so a frame in which a track enters A while leaving B
17197
+ * produces two events with two directions — never one ambiguous row.
17198
+ *
17199
+ * `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
17200
+ * membership the box has NOW, and by definition it no longer contains the zone
17201
+ * that was just left. Without the id here, a zone-scoped rule could never match
17202
+ * the exit it asked for.
17203
+ */
17204
+ var ZoneCrossingSchema = object({
17205
+ direction: _enum(["enter", "exit"]),
17206
+ /** Admin zone id crossed. */
17207
+ zoneId: string(),
17208
+ /** Zone display name at crossing time (falls back to the id). */
17209
+ zoneName: string().optional()
16859
17210
  });
16860
- var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
16861
- var MAX_EVENT_QUERY_LIMIT = 5e3;
16862
- var DeviceEventQueryInput = object({
16863
- deviceId: number(),
16864
- since: number().optional(),
16865
- until: number().optional(),
16866
- limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
16867
- /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
16868
- * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
16869
- * exact behaviour. Callers may omit this field the store defaults to
16870
- * `full` when not provided. */
16871
- projection: _enum(["full", "slim"]).optional()
17211
+ var ObjectEventSchema = object({
17212
+ ...BaseEventFields,
17213
+ kind: literal("object"),
17214
+ /** Detection source. Optional for backward-compat; absent ⇒ `pipeline`. */
17215
+ source: DetectionSourceSchema.optional(),
17216
+ /**
17217
+ * Inference-frame id shared by every object event emitted from the SAME frame
17218
+ * the "scene/parent" key. Lets a consumer group co-occurring detections (e.g.
17219
+ * 2 people + 1 dog) under one full frame, and link a track's frames over time
17220
+ * (group by `trackId`, pick a representative `frameId` as the parent frame).
17221
+ * Optional for backward-compat with pre-existing rows / the slim projection
17222
+ * includes it (it is light). Absent on rows written before this field.
17223
+ */
17224
+ frameId: string().optional(),
17225
+ /** Omitted in slim projection. */
17226
+ trackId: string().optional(),
17227
+ className: string(),
17228
+ ...TieredLabelFields,
17229
+ /** Omitted in slim projection. */
17230
+ confidence: number().optional(),
17231
+ /** Heavy JSON — omitted in slim projection. */
17232
+ bbox: BoundingBoxSchema.optional(),
17233
+ /** Heavy JSON — omitted in slim projection. */
17234
+ zones: array(string()).readonly().optional(),
17235
+ /** Omitted in slim projection. */
17236
+ state: TrackStateSchema.optional(),
17237
+ /**
17238
+ * The zone crossing this event IS, when it is one. Absent on every other
17239
+ * event kind (movement state, appearance, package) — see
17240
+ * {@link ZoneCrossingSchema}. Omitted in slim projection.
17241
+ */
17242
+ zoneCrossing: ZoneCrossingSchema.optional(),
17243
+ /** Detection-frame dimensions in pixels — let consumers normalize the
17244
+ * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
17245
+ frameWidth: number().optional(),
17246
+ frameHeight: number().optional(),
17247
+ /** MediaStore key for the crop attached to this event (if any). */
17248
+ mediaKey: string().optional(),
17249
+ /** Design B: MediaStore key of the track's native-resolution key frame (the
17250
+ * best-detection full frame). Resolve via the event-media data-plane
17251
+ * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
17252
+ * draws `bbox` over the native frame. Absent on legacy rows / non-decoded
17253
+ * sources — consumers fall back to `mediaKey` (the tight crop). */
17254
+ keyFrameMediaKey: string().optional(),
17255
+ /** Populated by B5 (recording playback URL for this event). */
17256
+ mediaUrl: string().optional(),
17257
+ /** The parent track's key-event importance [0,1], propagated to every object
17258
+ * event of the track (so an event row can be sorted by importance without a
17259
+ * track join). Absent on legacy rows / before the track was scored. */
17260
+ importance: number().optional()
16872
17261
  });
16873
- var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
16874
- var RecentTracksQueryInput = object({
16875
- /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
16876
- deviceIds: array(number()),
16877
- /** Window lower bound on `lastSeen` (inclusive). */
16878
- since: number().optional(),
16879
- /** Window upper bound on `lastSeen` (inclusive). */
16880
- until: number().optional(),
16881
- /** Page size. Default 200, max 1000. */
16882
- limit: number().int().min(1).max(1e3).default(200),
16883
- /** Opaque continuation cursor from a previous page's `nextCursor`.
16884
- * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
16885
- cursor: string().optional(),
16886
- /** See {@link TrackProjectionSchema}. Default `full`. */
16887
- projection: TrackProjectionSchema.optional(),
16888
- /** Include stationary-promoted rows (parked objects). Default false: the
16889
- * feed lists passages; parking records live on the stationary registry. */
16890
- includeStationary: boolean().optional()
17262
+ var AudioEventSchema = object({
17263
+ ...BaseEventFields,
17264
+ kind: literal("audio"),
17265
+ rms: number(),
17266
+ dbfs: number(),
17267
+ classification: object({
17268
+ className: string(),
17269
+ originalClass: string().optional(),
17270
+ score: number()
17271
+ }).optional(),
17272
+ /** Populated by B5 (recording playback URL for this event). */
17273
+ mediaUrl: string().optional()
16891
17274
  });
16892
- var RecentTracksPageSchema = object({
16893
- /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
16894
- tracks: array(TrackSchema).readonly(),
16895
- /** Cursor for the next page, or null when this page is the last. */
16896
- nextCursor: string().nullable()
17275
+ var MediaFileKindEnum = _enum([
17276
+ "crop",
17277
+ "thumbnail",
17278
+ "snapshot",
17279
+ "firstFrame",
17280
+ "lastFrame",
17281
+ "fullFrame",
17282
+ "fullFrameBoxed",
17283
+ "faceCrop",
17284
+ "plateCrop",
17285
+ "keyFrame",
17286
+ "keyFrameSmall",
17287
+ "thumbnailSmall"
17288
+ ]);
17289
+ var MediaFileSchema = object({
17290
+ key: string(),
17291
+ kind: MediaFileKindEnum,
17292
+ base64: string(),
17293
+ sizeBytes: number(),
17294
+ timestamp: number()
16897
17295
  });
16898
- var LIST_GROUPS_DEFAULT_LIMIT = 40;
16899
- var LIST_GROUPS_MAX_LIMIT = 100;
16900
- var AnalyticsGroupRecordSchema = object({
17296
+ /**
17297
+ * One media row WITHOUT its bytes.
17298
+ *
17299
+ * A track's media is 5-8 MB of base64 (measured: 7.67 MB across 23 files for a
17300
+ * 140 s track), and a client that renders tiles from the media data plane needs
17301
+ * to know only WHAT EXISTS — the bytes then arrive per tile, lazily, over HTTP
17302
+ * with an immutable cache, instead of all at once inside a tRPC response that
17303
+ * blocks the whole view.
17304
+ *
17305
+ * `sizeBytes` is carried because it is what lets a client decide between the
17306
+ * stored blob and a `?variant=thumb` rendering without fetching either.
17307
+ */
17308
+ var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
17309
+ /**
17310
+ * The MACRO tier of an annotation — a CLOSED set.
17311
+ *
17312
+ * This is what the exported detector predicts, so a typo here is a new class
17313
+ * with one example in it. `label` and `subLabel` are open strings by contrast:
17314
+ * the whole point of the page is teaching the model things it does not know
17315
+ * yet, and constraining that vocabulary would make it useless.
17316
+ *
17317
+ * A macro class is NEVER a label. The provider refuses a write whose `label` or
17318
+ * `subLabel` is one of these values, in any casing, because once `person`
17319
+ * exists in both tiers "every person box" stops being answerable without
17320
+ * knowing every string anyone ever typed — and the damage is retroactive.
17321
+ */
17322
+ var RetrainMacroClassSchema = _enum([
17323
+ "person",
17324
+ "vehicle",
17325
+ "animal",
17326
+ "package",
17327
+ "face",
17328
+ "plate"
17329
+ ]);
17330
+ /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
17331
+ var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
17332
+ /** Did a human draw this box, or did the assist propose it? */
17333
+ var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
17334
+ /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
17335
+ var RetrainBboxSchema = object({
17336
+ x: number(),
17337
+ y: number(),
17338
+ w: number(),
17339
+ h: number()
17340
+ });
17341
+ /**
17342
+ * One annotated subject.
17343
+ *
17344
+ * `bbox` is normalised against the full frame, ALWAYS. The per-model shapes
17345
+ * (letterboxed root / zone-cropped package / subject-cropped classifier) are
17346
+ * derived from it at export and never stored — storing them is how one feature
17347
+ * space ends up holding two crops of the same subject (D52).
17348
+ */
17349
+ var RetrainAnnotationSchema = object({
16901
17350
  id: string(),
16902
- deviceId: number().int(),
16903
- openedAt: number().int(),
16904
- closedAt: number().int(),
16905
- timestamp: number().int(),
16906
- memberCount: number().int(),
16907
- memberTrackIds: array(string()).readonly(),
16908
- className: string(),
16909
- classes: array(string()).readonly(),
16910
- /** Relative event-media path, or null when the group has no picture yet. */
16911
- mediaUrl: string().nullable(),
16912
- singleton: boolean()
17351
+ trackId: string(),
17352
+ deviceId: number(),
17353
+ /** The COPY in retrain storage — never the source track's media key. */
17354
+ mediaKey: string(),
17355
+ bbox: RetrainBboxSchema,
17356
+ macroClass: RetrainMacroClassSchema,
17357
+ label: string().optional(),
17358
+ subLabel: string().optional(),
17359
+ kind: RetrainAnnotationKindSchema,
17360
+ source: RetrainAnnotationSourceSchema,
17361
+ /** Which model proposed this box — or, on a `model_error`, drew the phantom. */
17362
+ assistModelId: string().optional(),
17363
+ assistScore: number().optional(),
17364
+ exportedInBatch: string().optional(),
17365
+ createdAt: number()
16913
17366
  });
16914
- var AnalyticsGroupMemberSchema = object({
17367
+ /** The write form — the server owns `id`, `createdAt` and the frame binding. */
17368
+ var RetrainAnnotationDraftSchema = RetrainAnnotationSchema.omit({
17369
+ id: true,
17370
+ trackId: true,
17371
+ deviceId: true,
17372
+ mediaKey: true,
17373
+ createdAt: true,
17374
+ exportedInBatch: true
17375
+ });
17376
+ /** A track sitting in `staging`, with everything the worklist needs to rank it. */
17377
+ var RetrainTrackSchema = object({
16915
17378
  trackId: string(),
16916
- deviceId: number().int(),
17379
+ deviceId: number(),
16917
17380
  className: string(),
16918
- firstSeen: number().int(),
16919
- lastSeen: number().int(),
16920
- mediaUrl: string().nullable()
16921
- });
16922
- var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
16923
- var ListGroupsQueryInput = object({
16924
- /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
16925
- deviceIds: array(number()),
16926
- /** Window lower bound on `closedAt` (inclusive). */
16927
- since: number().optional(),
16928
- /** Window upper bound on `openedAt` (inclusive). */
16929
- until: number().optional(),
16930
- limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
16931
- /** Opaque continuation cursor from a previous page's `nextCursor`. */
16932
- cursor: string().optional()
17381
+ label: string().optional(),
17382
+ firstSeen: number(),
17383
+ lastSeen: number(),
17384
+ /** How many frames the dataset already holds from this track. */
17385
+ frameCount: number().int(),
17386
+ /** How many subjects have been annotated on those frames. `0` with
17387
+ * `frameCount: 0` is exactly "staging, still to work". */
17388
+ annotationCount: number().int()
16933
17389
  });
16934
- var ListGroupsPageSchema = object({
16935
- groups: array(AnalyticsGroupRecordSchema).readonly(),
16936
- nextCursor: string().nullable()
17390
+ /** A frame the picker may offer — an index row, no blob was read to produce it. */
17391
+ var RetrainFrameCandidateSchema = object({
17392
+ mediaKey: string(),
17393
+ kind: MediaFileKindEnum,
17394
+ timestamp: number(),
17395
+ sizeBytes: number().int(),
17396
+ /** A copy of this original already exists — selecting it is free and cannot
17397
+ * fail, whatever became of the original. */
17398
+ copied: boolean()
16937
17399
  });
16938
- var KeyEventQueryInput = object({
17400
+ /** A frame the dataset OWNS: bytes copied at selection time. */
17401
+ var RetrainFrameSchema = object({
17402
+ frameId: string(),
16939
17403
  deviceId: number(),
16940
- /** Window lower bound (track firstSeen ≥ since). */
16941
- since: number(),
16942
- /** Window upper bound (track firstSeen ≤ until). */
17404
+ trackId: string(),
17405
+ /** Provenance only. It may already point at nothing — that is expected. */
17406
+ sourceMediaKey: string(),
17407
+ sourceKind: MediaFileKindEnum,
17408
+ sizeBytes: number().int(),
17409
+ width: number().int(),
17410
+ height: number().int(),
17411
+ copiedAt: number()
17412
+ });
17413
+ /** Why a copy-on-select could not be honoured — named, never a silent skip. */
17414
+ var RetrainCopyRefusalSchema = _enum([
17415
+ "source-missing",
17416
+ "unreadable-image",
17417
+ "write-failed"
17418
+ ]);
17419
+ var RetrainFrameSelectionSchema = object({
17420
+ copied: array(RetrainFrameSchema).readonly(),
17421
+ refused: array(object({
17422
+ sourceMediaKey: string(),
17423
+ reason: RetrainCopyRefusalSchema
17424
+ })).readonly()
17425
+ });
17426
+ var RetrainFrameListSchema = object({
17427
+ candidates: array(RetrainFrameCandidateSchema).readonly(),
17428
+ copies: array(RetrainFrameSchema).readonly(),
17429
+ /** What the page pre-selects — the native key frame when one survives. */
17430
+ autoPickMediaKey: string().optional()
17431
+ });
17432
+ /** What the operator asked the assist to look for. */
17433
+ var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
17434
+ kind: literal("package"),
17435
+ zone: RetrainBboxSchema.optional()
17436
+ }), object({
17437
+ kind: literal("objects"),
17438
+ modelId: string(),
17439
+ minScore: number().optional()
17440
+ })]);
17441
+ /**
17442
+ * The assist's answer — a discriminated union, because "the model saw nothing"
17443
+ * and "this node cannot run that model" lead to different next moves and a
17444
+ * nullable result cannot tell them apart.
17445
+ */
17446
+ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
17447
+ kind: literal("proposed"),
17448
+ modelId: string(),
17449
+ stepId: string(),
17450
+ minScore: number(),
17451
+ /** Drafts, ready to edit. `source: 'assist'` until the operator touches one. */
17452
+ proposals: array(RetrainAnnotationDraftSchema).readonly(),
17453
+ /** Returned by the runner but removed by the threshold. */
17454
+ belowThreshold: number().int()
17455
+ }), object({
17456
+ kind: literal("refused"),
17457
+ /** `no-zone` is ours; the rest are the runner's own refusal vocabulary. */
17458
+ reason: string(),
17459
+ detail: string().optional()
17460
+ })]);
17461
+ /** The outcome of a lifecycle move owned by the retrain page. */
17462
+ var RetrainTransitionResultSchema = object({
17463
+ trackId: string(),
17464
+ /** Where the track ended up, whatever happened. */
17465
+ retrainStatus: RetrainStatusSchema,
17466
+ /** `false` ⇒ the move was refused or was a no-op; `reason` says which. */
17467
+ changed: boolean(),
17468
+ reason: _enum([
17469
+ "unknown-track",
17470
+ "no-frames-copied",
17471
+ "not-staging",
17472
+ "not-trained",
17473
+ "unchanged"
17474
+ ]).optional()
17475
+ });
17476
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
17477
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
17478
+ var DeviceEventQueryInput = object({
17479
+ deviceId: number(),
17480
+ since: number().optional(),
17481
+ until: number().optional(),
17482
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
17483
+ /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
17484
+ * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
17485
+ * exact behaviour. Callers may omit this field — the store defaults to
17486
+ * `full` when not provided. */
17487
+ projection: _enum(["full", "slim"]).optional()
17488
+ });
17489
+ var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
17490
+ var RecentTracksQueryInput = object({
17491
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
17492
+ deviceIds: array(number()),
17493
+ /** Window lower bound on `lastSeen` (inclusive). */
17494
+ since: number().optional(),
17495
+ /** Window upper bound on `lastSeen` (inclusive). */
17496
+ until: number().optional(),
17497
+ /** Page size. Default 200, max 1000. */
17498
+ limit: number().int().min(1).max(1e3).default(200),
17499
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
17500
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
17501
+ cursor: string().optional(),
17502
+ /** See {@link TrackProjectionSchema}. Default `full`. */
17503
+ projection: TrackProjectionSchema.optional(),
17504
+ /** Include stationary-promoted rows (parked objects). Default false: the
17505
+ * feed lists passages; parking records live on the stationary registry. */
17506
+ includeStationary: boolean().optional()
17507
+ });
17508
+ var RecentTracksPageSchema = object({
17509
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
17510
+ tracks: array(TrackSchema).readonly(),
17511
+ /** Cursor for the next page, or null when this page is the last. */
17512
+ nextCursor: string().nullable()
17513
+ });
17514
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
17515
+ var LIST_GROUPS_MAX_LIMIT = 100;
17516
+ var AnalyticsGroupRecordSchema = object({
17517
+ id: string(),
17518
+ deviceId: number().int(),
17519
+ openedAt: number().int(),
17520
+ closedAt: number().int(),
17521
+ timestamp: number().int(),
17522
+ memberCount: number().int(),
17523
+ memberTrackIds: array(string()).readonly(),
17524
+ className: string(),
17525
+ classes: array(string()).readonly(),
17526
+ /** Relative event-media path, or null when the group has no picture yet. */
17527
+ mediaUrl: string().nullable(),
17528
+ singleton: boolean()
17529
+ });
17530
+ var AnalyticsGroupMemberSchema = object({
17531
+ trackId: string(),
17532
+ deviceId: number().int(),
17533
+ className: string(),
17534
+ firstSeen: number().int(),
17535
+ lastSeen: number().int(),
17536
+ mediaUrl: string().nullable()
17537
+ });
17538
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
17539
+ var ListGroupsQueryInput = object({
17540
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
17541
+ deviceIds: array(number()),
17542
+ /** Window lower bound on `closedAt` (inclusive). */
17543
+ since: number().optional(),
17544
+ /** Window upper bound on `openedAt` (inclusive). */
17545
+ until: number().optional(),
17546
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
17547
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
17548
+ cursor: string().optional()
17549
+ });
17550
+ var ListGroupsPageSchema = object({
17551
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
17552
+ nextCursor: string().nullable()
17553
+ });
17554
+ var KeyEventQueryInput = object({
17555
+ deviceId: number(),
17556
+ /** Window lower bound (track firstSeen ≥ since). */
17557
+ since: number(),
17558
+ /** Window upper bound (track firstSeen ≤ until). */
16943
17559
  until: number(),
16944
17560
  limit: number().int().min(1).max(200).default(50),
16945
17561
  /** Drop tracks scoring below this importance. */
@@ -17138,6 +17754,24 @@ var RebuildStatusSchema = object({
17138
17754
  /** Present when the pass ended by throwing. */
17139
17755
  error: string().nullable()
17140
17756
  });
17757
+ var ReplayFrameInputSchema = object({
17758
+ timestamp: number(),
17759
+ frame: PipelineRunResultBridge
17760
+ });
17761
+ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
17762
+ className: string(),
17763
+ firstSeenMs: number(),
17764
+ lastSeenMs: number(),
17765
+ /** Bbox of the track's FIRST matched detection, pixel-space in the clip's
17766
+ * frame — a representative box for the diff's `(className, window, IoU)`
17767
+ * pairing (`replay-diff.ts`). A replay does not need the full per-frame
17768
+ * trajectory production's `Track.positions` keeps. */
17769
+ bbox: BoundingBoxSchema,
17770
+ /** How many of the input frames this track matched a real detection on
17771
+ * (never a coasted/extrapolated frame) — the replay's own signal for "how
17772
+ * solid is this track", cheaper than re-deriving it from a trajectory. */
17773
+ framesMatched: number().int()
17774
+ })).readonly() });
17141
17775
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
17142
17776
  deviceId: number(),
17143
17777
  trackId: string()
@@ -17308,502 +17942,80 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17308
17942
  }), RetrainAssistResultSchema, {
17309
17943
  kind: "mutation",
17310
17944
  auth: "admin"
17311
- }), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
17312
- kind: "query",
17313
- auth: "admin"
17314
- }), method(object({
17315
- deviceId: number(),
17316
- trackId: string(),
17317
- frameId: string(),
17318
- annotations: array(RetrainAnnotationDraftSchema)
17319
- }), array(RetrainAnnotationSchema).readonly(), {
17320
- kind: "mutation",
17321
- auth: "admin"
17322
- }), method(object({
17323
- deviceId: number(),
17324
- trackId: string()
17325
- }), RetrainTransitionResultSchema, {
17326
- kind: "mutation",
17327
- auth: "admin"
17328
17945
  }), method(object({
17329
17946
  deviceId: number(),
17330
- trackId: string()
17331
- }), RetrainTransitionResultSchema, {
17947
+ source: DetectionSourceSchema,
17948
+ zones: array(ZoneSchema).readonly().optional(),
17949
+ detectionRules: array(ZoneRuleSchema).readonly().optional(),
17950
+ zoneMembershipMinOverlap: number().min(0).max(1).optional(),
17951
+ frames: array(ReplayFrameInputSchema).min(1)
17952
+ }), RunReplayFrameProcessorResultSchema, {
17332
17953
  kind: "mutation",
17333
17954
  auth: "admin"
17334
- }), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
17955
+ }), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
17335
17956
  kind: "query",
17336
17957
  auth: "admin"
17337
17958
  }), method(object({
17338
- eventId: string(),
17339
- kind: MediaFileKindEnum.optional(),
17340
- deviceId: number()
17341
- }), array(MediaFileSchema).readonly()), method(object({
17342
- trackId: string(),
17343
- kinds: array(MediaFileKindEnum).optional(),
17344
- deviceId: number()
17345
- }), array(MediaFileSchema).readonly()), method(object({
17346
- trackId: string(),
17347
- deviceId: number()
17348
- }), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
17349
- kind: "mutation",
17350
- auth: "admin"
17351
- }), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
17352
- kind: "mutation",
17353
- auth: "admin"
17354
- }), method(object({}), RebuildStatusSchema), object({
17355
- deviceId: number(),
17356
- timestamp: number(),
17357
- frameWidth: number(),
17358
- frameHeight: number(),
17359
- detections: array(OverlayDetectionSchema).readonly()
17360
- }), object({
17361
- deviceId: number(),
17362
- trackId: string(),
17363
- className: string()
17364
- }), object({
17365
17959
  deviceId: number(),
17366
17960
  trackId: string(),
17367
- className: string(),
17368
- durationMs: number()
17369
- }), object({
17370
- deviceId: number(),
17371
- kind: EventKindSchema,
17372
- eventId: string(),
17373
- timestamp: number()
17374
- });
17375
- /**
17376
- * Reference to the frame's retained NATIVE surface + the parent crop's placement
17377
- * within the frame, so the executor can re-cut a leaf child ROI at native
17378
- * resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
17379
- */
17380
- var NativeCropRefSchema = object({
17381
- /** Handle keying the retained native surface (node-pinned to its owner). */
17382
- handle: FrameHandleSchema,
17383
- /** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
17384
- cropFrameSpace: object({
17385
- x: number(),
17386
- y: number(),
17387
- w: number(),
17388
- h: number()
17389
- })
17390
- });
17391
- object({
17392
- crop: object({
17393
- left: number(),
17394
- top: number(),
17395
- width: number().positive(),
17396
- height: number().positive()
17397
- }).optional(),
17398
- content: object({
17399
- width: number().int().positive(),
17400
- height: number().int().positive()
17401
- }),
17402
- fit: _enum(["stretch", "contain"]),
17403
- format: _enum([
17404
- "rgb",
17405
- "gray",
17406
- "jpeg"
17407
- ])
17408
- });
17409
- /**
17410
- * Process-local frame identity. It is serializable so it can ride an in-process
17411
- * capability call, but `registryId` deliberately prevents resolution in any
17412
- * other process or execution group.
17413
- */
17414
- var FrameRefSchema = object({
17415
- registryId: string().min(1),
17416
- id: string().min(1),
17417
- width: number().int().positive(),
17418
- height: number().int().positive(),
17419
- format: _enum(["rgb", "gray"]),
17420
- timestamp: number(),
17421
- capturedAt: number().optional()
17422
- });
17423
- var ModelFormatSchema$1 = _enum([
17424
- "onnx",
17425
- "coreml",
17426
- "openvino",
17427
- "tflite",
17428
- "pt",
17429
- "gguf"
17430
- ]);
17431
- var PipelineSlotSchema = _enum([
17432
- "detector",
17433
- "cropper",
17434
- "classifier",
17435
- "refiner",
17436
- "audio-classifier"
17437
- ]);
17438
- var PipelineEngineChoiceSchema = object({
17439
- runtime: _enum(["node", "python"]),
17440
- backend: string(),
17441
- format: ModelFormatSchema$1,
17442
- device: string().optional()
17443
- });
17444
- var AvailableEngineSchema = object({
17445
- engine: PipelineEngineChoiceSchema,
17446
- devices: array(object({
17447
- id: string(),
17448
- label: string(),
17449
- description: string().optional()
17450
- })).readonly(),
17451
- defaultDevice: string()
17452
- });
17453
- var PipelineDefaultStepSchema = lazy(() => object({
17454
- addonId: string(),
17455
- addonName: string(),
17456
- slot: PipelineSlotSchema,
17457
- inputClasses: array(string()).readonly(),
17458
- outputClasses: array(string()).readonly(),
17459
- enabled: boolean(),
17460
- modelId: string(),
17461
- children: array(PipelineDefaultStepSchema).readonly(),
17462
- group: string().optional(),
17463
- settings: record(string(), unknown()).optional()
17464
- }));
17465
- var PipelineTemplateStepSchema = lazy(() => object({
17466
- addonId: string(),
17467
- enabled: boolean(),
17468
- modelId: string(),
17469
- children: array(PipelineTemplateStepSchema).readonly(),
17470
- settings: record(string(), unknown()).optional()
17471
- }));
17472
- var PipelineTemplateSchema$1 = object({
17473
- id: string(),
17474
- name: string(),
17475
- createdAt: string(),
17476
- updatedAt: string(),
17477
- engine: PipelineEngineChoiceSchema,
17478
- steps: array(PipelineTemplateStepSchema).readonly()
17479
- });
17480
- var PipelineModelOptionSchema = object({
17481
- id: string(),
17482
- name: string(),
17483
- formats: record(string(), object({
17484
- downloaded: boolean(),
17485
- sizeMB: number()
17486
- })),
17487
- group: ModelVariantGroupSchema.optional(),
17488
- legacy: boolean().optional(),
17489
- provider: ModelProviderIdSchema.optional()
17490
- });
17491
- var ConfigFieldBridge = custom();
17492
- var PipelineAddonSchemaSchema = object({
17493
- id: string(),
17494
- name: string(),
17495
- slot: PipelineSlotSchema,
17496
- inputClasses: array(string()).readonly(),
17497
- outputClasses: array(string()).readonly(),
17498
- childSlots: array(PipelineSlotSchema).readonly(),
17499
- models: array(PipelineModelOptionSchema).readonly(),
17500
- defaultModelId: string(),
17501
- defaultModelIdByFormat: record(string(), string()).optional(),
17502
- enabledByDefault: boolean().optional(),
17503
- backfillIntoExistingOverrides: boolean().optional(),
17504
- defaultConfidence: number(),
17505
- group: string().optional(),
17506
- configSchema: array(ConfigFieldBridge).readonly().optional()
17507
- });
17508
- var PipelineSlotSchemaSchema = object({
17509
- id: PipelineSlotSchema,
17510
- label: string(),
17511
- priority: number(),
17512
- parentSlot: PipelineSlotSchema.nullable(),
17513
- addons: array(PipelineAddonSchemaSchema).readonly()
17514
- });
17515
- var PipelineSchemaSchema = object({
17516
- availableEngines: array(AvailableEngineSchema).readonly(),
17517
- selectedEngine: PipelineEngineChoiceSchema,
17518
- slots: array(PipelineSlotSchemaSchema).readonly()
17519
- });
17520
- var EngineProvisioningSchema = object({
17521
- runtimeId: _enum([
17522
- "onnx",
17523
- "openvino",
17524
- "coreml",
17525
- "edgetpu"
17526
- ]).nullable(),
17527
- device: string().nullable(),
17528
- state: _enum([
17529
- "idle",
17530
- "installing",
17531
- "verifying",
17532
- "ready",
17533
- "failed"
17534
- ]),
17535
- progress: number().optional(),
17536
- error: string().optional(),
17537
- nextRetryAt: number().optional(),
17538
- /**
17539
- * Gate A (config-correctness gate at engine change): human-readable
17540
- * config issues surfaced EAGERLY when the node's engine changes — model
17541
- * substitutions ("chose X, running Y") and zero-build steps ("no model
17542
- * has a <format> build"). Additive/optional: informational only, never
17543
- * enforced here — `assertEngineReady` (readiness) still gates inference.
17544
- * Absent/empty when the node-default tree resolves cleanly.
17545
- */
17546
- configIssues: array(string()).optional()
17547
- });
17548
- var PipelineStepInputSchema = lazy(() => object({
17549
- addonId: string(),
17550
- modelId: string().optional(),
17551
- enabled: boolean().default(true),
17552
- children: array(PipelineStepInputSchema).optional(),
17553
- settings: record(string(), unknown()).optional(),
17554
- jumpDeviceKey: string().optional()
17555
- }));
17556
- var ModelSubstitutionSchema = object({
17557
- addonId: string(),
17558
- chosen: string(),
17559
- running: string(),
17560
- format: string()
17561
- });
17562
- var PipelineValidationIssueSchema = object({
17563
- addonId: string(),
17564
- kind: _enum(["unknown-addon", "no-format-build"]),
17565
- detail: string()
17566
- });
17567
- var PipelineValidationResultSchema = object({
17568
- ok: boolean(),
17569
- issues: array(PipelineValidationIssueSchema).readonly(),
17570
- substitutions: array(ModelSubstitutionSchema).readonly(),
17571
- /** The node's `currentEngine.format` this validation ran against. */
17572
- format: string()
17573
- });
17574
- var ReferenceImageEntrySchema = object({
17575
- filename: string(),
17576
- stepIds: array(string()).readonly().optional()
17577
- });
17578
- var ReferenceImageBodySchema = object({
17579
- base64: string(),
17580
- filename: string()
17581
- });
17582
- var ReferenceAudioEntrySchema = object({
17583
- filename: string(),
17584
- sizeKb: number()
17585
- });
17586
- var ReferenceAudioBodySchema = object({ base64: string() });
17587
- var AudioBackendSchema = object({
17588
- id: string(),
17589
- name: string(),
17590
- description: string(),
17591
- available: boolean(),
17592
- /**
17593
- * Raw classifier labels this backend can emit (e.g. YAMNet's
17594
- * 521-class set or Apple SoundAnalysis's 303-class set). Used by
17595
- * the benchmark UI to populate the `enabledMicroClasses` filter
17596
- * specific to the selected backend without a separate fetch.
17597
- */
17598
- rawLabels: array(string()).readonly().optional()
17599
- });
17600
- var AudioCapabilitiesSchema = object({
17601
- activeBackend: string(),
17602
- availableBackends: array(AudioBackendSchema).readonly(),
17603
- sampleRate: number(),
17604
- chunkDurationMs: number()
17605
- });
17606
- var DownloadModelResultSchema = object({
17607
- filePath: string(),
17608
- sizeMB: number(),
17609
- durationMs: number()
17610
- });
17611
- /**
17612
- * Wrapper carrying a single test run's result. Replaces the legacy
17613
- * ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
17614
- * canonical `AudioResult` from the Phase 6 output rework: one
17615
- * `AudioDetection` per class above `minScore`, top-N candidates in
17616
- * `debug.alternateLabels['audio-classifier']`, per-source timings in
17617
- * `debug.stepTimings`. The outer `success`/`error` fields stay so the
17618
- * benchmark UI can still report a clean failure when the classifier
17619
- * cap isn't available.
17620
- */
17621
- var AudioTestResultSchema = object({
17622
- success: boolean(),
17623
- error: string().optional(),
17624
- frame: custom().optional()
17625
- });
17626
- var PipelineConfigBridge = custom();
17627
- var ConfigUISchemaBridge = custom();
17628
- var ConfigUISchemaNullableBridge = custom();
17629
- var InferenceCapabilitiesBridge = custom();
17630
- var ModelAvailabilityListBridge = custom();
17631
- var PipelineRunResultBridge = custom();
17632
- method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
17633
- modelId: string(),
17634
- settings: record(string(), unknown()).readonly()
17635
- }))), method(object({ steps: record(string(), object({
17636
- modelId: string(),
17637
- settings: record(string(), unknown()).readonly()
17638
- })) }), object({ success: literal(true) }), {
17639
- kind: "mutation",
17640
- auth: "admin"
17641
- }), method(object({ nodeId: string() }), object({
17642
- success: literal(true),
17643
- clearedDevices: number()
17644
- }), {
17645
- kind: "mutation",
17646
- auth: "admin"
17647
- }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({ steps: array(PipelineStepInputSchema) }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
17648
- name: string(),
17649
- steps: array(PipelineTemplateStepSchema).readonly(),
17650
- engine: PipelineEngineChoiceSchema
17651
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
17652
- id: string(),
17653
- name: string().optional(),
17654
- steps: array(PipelineTemplateStepSchema).readonly().optional()
17655
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
17656
- addonId: string(),
17657
- modelId: string(),
17658
- format: ModelFormatSchema$1
17659
- }), DownloadModelResultSchema, { kind: "mutation" }), method(object({
17660
- addonId: string(),
17661
- modelId: string(),
17662
- format: ModelFormatSchema$1
17663
- }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
17664
- engine: PipelineEngineChoiceSchema.optional(),
17665
- steps: array(PipelineStepInputSchema).min(1),
17666
- frame: FrameInputSchema.optional(),
17667
- /**
17668
- * Process-local lazy frame. Valid only when caller and provider resolve
17669
- * in the same execution-group process; split/cross-node callers use
17670
- * `frame`/`image` inline compatibility instead.
17671
- */
17672
- frameRef: FrameRefSchema.optional(),
17673
- /**
17674
- * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
17675
- * the decoded pixels live in. One more member of the one-of
17676
- * frame/frameHandle/image/imageBase64/referenceImage group.
17677
- */
17678
- frameHandle: FrameHandleSchema.optional(),
17679
- imageBase64: string().optional(),
17680
- /**
17681
- * Binary JPEG bytes — preferred over `imageBase64` on internal
17682
- * hops (hub → forked worker via Moleculer MsgPack) because it
17683
- * skips the 33% base64 overhead + the per-call base64 decode on
17684
- * the detection-pipeline worker. Callers can pass either; exactly
17685
- * one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
17686
- */
17687
- image: _instanceof(Uint8Array).optional(),
17688
- referenceImage: string().optional(),
17689
- deviceId: number().optional(),
17690
- sessionId: string().optional(),
17691
- /**
17692
- * Execution plane. 'full' (default) runs the whole tree — benchmark,
17693
- * reference-image, and detail-subtree calls. 'frame' is the live
17694
- * per-frame dispatch: ONLY root-plane steps run; crop children
17695
- * (inputClasses ≠ null) are skipped and served per-track via
17696
- * pipelineRunner.runDetailSubtree (two-plane design).
17697
- */
17698
- plane: _enum(["full", "frame"]).optional(),
17699
- /**
17700
- * Inference-device selector (Phase 2 multi-device). Format
17701
- * `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
17702
- * Omitted ⇒ the runner's default device (current single-engine
17703
- * behaviour). Selects WHICH device pool of the node runs the call.
17704
- */
17705
- deviceKey: string().optional(),
17706
- /**
17707
- * Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
17708
- * when the parent crop was resolved from the frame's retained NATIVE
17709
- * surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
17710
- * child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
17711
- * resolution from that surface — the SAME quality path faces already
17712
- * had — instead of the downscaled parent tile. `handle` keys the native
17713
- * surface (node-pinned to its owner); `cropFrameSpace` is the parent
17714
- * crop's padded/clamped rectangle in FRAME-space pixels, used to compose
17715
- * the executor's crop-normalized child ROI back into frame-normalized
17716
- * coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
17717
- * of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
17718
- * (today's behaviour on the fallback path).
17719
- */
17720
- nativeCropRef: NativeCropRefSchema.optional()
17721
- }), PipelineRunResultBridge, { kind: "mutation" }), method(object({
17722
- engine: PipelineEngineChoiceSchema.optional(),
17723
- steps: array(PipelineStepInputSchema).min(1),
17724
- frames: array(FrameInputSchema).min(1).max(255),
17725
- deviceId: number().optional(),
17726
- sessionId: string().optional(),
17727
- /**
17728
- * Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
17729
- * the batch to the Python pool's bench preprocess cache
17730
- * (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
17731
- * preprocessed ONCE and every later inference is a pure-inference cache
17732
- * hit — the sustained-throughput run measures inference, not
17733
- * decode+preprocess+infer. Omitted/0 for live frames (all different →
17734
- * full preprocess every call, correct). Fresh per sustained run;
17735
- * released via `uncacheFrame`.
17736
- */
17737
- frameId: number().int().nonnegative().optional(),
17738
- /** Inference-device selector (Phase 2 multi-device); see runPipeline. */
17739
- deviceKey: string().optional()
17740
- }), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
17741
- data: _instanceof(Uint8Array),
17742
- width: number().int().positive(),
17743
- height: number().int().positive(),
17744
- format: _enum([
17745
- "rgb",
17746
- "bgr",
17747
- "gray"
17748
- ])
17749
- }), object({
17750
- frameId: number(),
17751
- width: number(),
17752
- height: number()
17753
- }), { kind: "mutation" }), method(object({
17754
- stepId: string(),
17755
- frameId: number().int()
17756
- }), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(_void(), object({
17757
- batchMode: string(),
17758
- windowMs: number(),
17759
- maxBatchSize: number(),
17760
- concurrency: number()
17761
- })), method(_void(), array(object({
17762
- engineKey: string(),
17763
- engine: PipelineEngineChoiceSchema,
17764
- modelsLoaded: array(string()).readonly(),
17765
- inUseByCameras: array(number()).readonly(),
17766
- /**
17767
- * Origin of this resident factory.
17768
- * - `runtime` — main camera-serving engine (no idle TTL).
17769
- * - `warm-override` — benchmark/test override held in the warm
17770
- * cache; auto-disposed after the idle TTL.
17771
- * - `device-pool` — a concurrent per-device pool (Phase 2
17772
- * multi-device, keyed by `deviceKey`) resolved
17773
- * via `resolveDeviceFactory`. Runs alongside the
17774
- * `runtime` engine on a DIFFERENT accelerator
17775
- * (NPU / iGPU / Coral) — this is how the
17776
- * Engines tab shows all pools running at once.
17777
- */
17778
- kind: _enum([
17779
- "runtime",
17780
- "warm-override",
17781
- "device-pool"
17782
- ]),
17783
- /** Native pid of the underlying Python pool (null when no pool). */
17784
- poolPid: number().nullable(),
17785
- /** ms since this factory was last used (null when not warm-tracked). */
17786
- idleMs: number().nullable(),
17787
- /** Idle TTL after which `warm-override` factories self-evict (null when not applicable). */
17788
- idleTtlMs: number().nullable()
17789
- })).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
17961
+ frameId: string(),
17962
+ annotations: array(RetrainAnnotationDraftSchema)
17963
+ }), array(RetrainAnnotationSchema).readonly(), {
17790
17964
  kind: "mutation",
17791
17965
  auth: "admin"
17792
17966
  }), method(object({
17793
- engine: PipelineEngineChoiceSchema,
17794
- force: boolean().optional()
17795
- }), object({
17796
- success: boolean(),
17797
- reason: string().optional()
17798
- }), {
17967
+ deviceId: number(),
17968
+ trackId: string()
17969
+ }), RetrainTransitionResultSchema, {
17799
17970
  kind: "mutation",
17800
17971
  auth: "admin"
17801
- }), method(_void(), array(ReferenceImageEntrySchema).readonly()), method(object({ filename: string() }), ReferenceImageBodySchema.nullable()), method(_void(), array(ReferenceAudioEntrySchema).readonly()), method(object({ filename: string() }), ReferenceAudioBodySchema.nullable()), method(_void(), AudioCapabilitiesSchema), method(object({
17802
- addonId: string(),
17803
- modelId: string(),
17804
- filename: string().optional(),
17805
- settings: record(string(), unknown()).optional()
17806
- }), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
17972
+ }), method(object({
17973
+ deviceId: number(),
17974
+ trackId: string()
17975
+ }), RetrainTransitionResultSchema, {
17976
+ kind: "mutation",
17977
+ auth: "admin"
17978
+ }), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
17979
+ kind: "query",
17980
+ auth: "admin"
17981
+ }), method(object({
17982
+ eventId: string(),
17983
+ kind: MediaFileKindEnum.optional(),
17984
+ deviceId: number()
17985
+ }), array(MediaFileSchema).readonly()), method(object({
17986
+ trackId: string(),
17987
+ kinds: array(MediaFileKindEnum).optional(),
17988
+ deviceId: number()
17989
+ }), array(MediaFileSchema).readonly()), method(object({
17990
+ trackId: string(),
17991
+ deviceId: number()
17992
+ }), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
17993
+ kind: "mutation",
17994
+ auth: "admin"
17995
+ }), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
17996
+ kind: "mutation",
17997
+ auth: "admin"
17998
+ }), method(object({}), RebuildStatusSchema), object({
17999
+ deviceId: number(),
18000
+ timestamp: number(),
18001
+ frameWidth: number(),
18002
+ frameHeight: number(),
18003
+ detections: array(OverlayDetectionSchema).readonly()
18004
+ }), object({
18005
+ deviceId: number(),
18006
+ trackId: string(),
18007
+ className: string()
18008
+ }), object({
18009
+ deviceId: number(),
18010
+ trackId: string(),
18011
+ className: string(),
18012
+ durationMs: number()
18013
+ }), object({
18014
+ deviceId: number(),
18015
+ kind: EventKindSchema,
18016
+ eventId: string(),
18017
+ timestamp: number()
18018
+ });
17807
18019
  object({
17808
18020
  activeCameras: number(),
17809
18021
  throttledCameras: number(),
@@ -17829,66 +18041,6 @@ var CameraMetricsSchema = object({
17829
18041
  });
17830
18042
  var CameraMetricsWithDeviceIdSchema = CameraMetricsSchema.extend({ deviceId: number() });
17831
18043
  /**
17832
- * Zone — pure geometry + identity. NO filtering behaviour.
17833
- *
17834
- * Zones describe **where** in the frame the operator wants to flag
17835
- * something; consumer-owned {@link ZoneRule} arrays describe **how**
17836
- * each pipeline stage uses them. Splitting the two means a single
17837
- * polygon "Driveway" can simultaneously back a motion-exclude rule,
17838
- * a detection-include rule on `['car']`, and an occupancy aggregate
17839
- * — without three duplicated polygons.
17840
- *
17841
- * Owned by the orchestrator addon (provider) and mirrored into the
17842
- * `zones` device-state slice on every mutation. Consumers
17843
- * (motion-wasm, pipeline-executor, analytics, admin UI) read either
17844
- * via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
17845
- * mirror with `onChanged`).
17846
- *
17847
- * Coordinates are normalised fractions of the frame (0–1) so zones
17848
- * survive resolution changes and stream profile switches.
17849
- *
17850
- * `kind` discriminates between full polygons (closed regions used
17851
- * for intrusion / occupancy filters) and tripwires (open 2-point
17852
- * line segments used for cross events). Onboard / firmware-reported
17853
- * zones (Reolink, ONVIF) are out of scope for now — see the deferred
17854
- * task list.
17855
- */
17856
- var ZoneKindEnum = _enum(["polygon", "tripwire"]);
17857
- /** Polygon vertex in fraction-of-frame coordinates (0–1). */
17858
- var PolygonPointSchema = object({
17859
- x: number(),
17860
- y: number()
17861
- });
17862
- /** A camera detection zone — pure geometry/identity. */
17863
- var ZoneSchema = object({
17864
- id: string(),
17865
- name: string(),
17866
- kind: ZoneKindEnum.default("polygon"),
17867
- /** Polygon vertices, fraction of frame (0–1). */
17868
- polygon: array(PolygonPointSchema).readonly(),
17869
- /** Visual color for UI rendering. */
17870
- color: string().default("#3b82f6")
17871
- });
17872
- DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).readonly()), method(object({
17873
- deviceId: number(),
17874
- zone: ZoneSchema
17875
- }), _void(), {
17876
- kind: "mutation",
17877
- auth: "admin"
17878
- }), method(object({
17879
- deviceId: number(),
17880
- zoneId: string()
17881
- }), _void(), {
17882
- kind: "mutation",
17883
- auth: "admin"
17884
- }), method(object({
17885
- deviceId: number(),
17886
- zone: ZoneSchema
17887
- }), _void(), {
17888
- kind: "mutation",
17889
- auth: "admin"
17890
- }), object({ zones: array(ZoneSchema).readonly() });
17891
- /**
17892
18044
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
17893
18045
  * decode worker resolves it against the RETAINED native frame's real pixel dims,
17894
18046
  * so the caller supplies only the detection-res bbox divided by the detection
@@ -24866,6 +25018,39 @@ var ReadGopBytesResultSchema = object({
24866
25018
  /** Media ms the returned fragment covers. */
24867
25019
  gopDurMs: number()
24868
25020
  });
25021
+ /**
25022
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
25023
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
25024
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
25025
+ * a replay needs several seconds of native pixels, not one frame.
25026
+ *
25027
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
25028
+ * is `false` when the returned bytes were cut short by the read's own safety
25029
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
25030
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
25031
+ * degradation: a window whose end falls past the covering segment would need
25032
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
25033
+ * not one standalone-demuxable stream — the caller's answer is to request a
25034
+ * shorter window or one aligned to a single segment, not to receive spliced
25035
+ * bytes nothing has proven decodable.
25036
+ */
25037
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
25038
+ kind: literal("ok"),
25039
+ data: _instanceof(Uint8Array),
25040
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
25041
+ * the requested `fromMs` (anchored on the nearest keyframe). */
25042
+ gopStartMs: number(),
25043
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
25044
+ gopDurMs: number(),
25045
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
25046
+ * the requested `toMs`; the caller got fewer frames than asked for. */
25047
+ reachesRequestedEnd: boolean()
25048
+ }), object({
25049
+ kind: literal("spans-multiple-segments"),
25050
+ /** Where the covering segment's own footage runs out — informational,
25051
+ * not a retry hint (retrying the same window would refuse again). */
25052
+ segmentEndMs: number()
25053
+ })]);
24869
25054
  method(object({
24870
25055
  deviceId: number(),
24871
25056
  fromMs: number(),
@@ -24916,6 +25101,15 @@ method(object({
24916
25101
  }), ReadGopBytesResultSchema, {
24917
25102
  kind: "query",
24918
25103
  auth: "admin"
25104
+ }), method(object({
25105
+ deviceId: number(),
25106
+ profile: string(),
25107
+ startMs: number(),
25108
+ fromMs: number(),
25109
+ toMs: number()
25110
+ }), ReadWindowBytesResultSchema, {
25111
+ kind: "query",
25112
+ auth: "admin"
24919
25113
  }), method(object({
24920
25114
  deviceId: number(),
24921
25115
  config: RecordingConfigSchema
@@ -25470,92 +25664,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSche
25470
25664
  kind: "mutation",
25471
25665
  auth: "admin"
25472
25666
  });
25473
- /**
25474
- * Per-stage gating mode applied to the zones a rule references.
25475
- *
25476
- * - `include`: the rule contributes to a **whitelist** for its stage.
25477
- * When at least one `include` rule fires for a stage, only entities
25478
- * inside one of those zones pass that stage.
25479
- * - `exclude`: the rule contributes to a **blacklist** for its stage.
25480
- * Entities inside one of those zones are dropped at that stage.
25481
- *
25482
- * `monitor`-style observation (count without filtering) is not a rule
25483
- * mode — zones without any matching rule are observed naturally by
25484
- * `zone-analytics` (live snapshot + history), so an "I just want to
25485
- * count, not filter" use case needs no rule at all.
25486
- */
25487
- var ZoneRuleModeEnum = _enum(["include", "exclude"]);
25488
- /**
25489
- * Per-consumer rule that references existing zones (geometry) and
25490
- * defines how a specific pipeline stage should treat them. Each
25491
- * consumer addon owns its own `ZoneRule[]` array in its per-device
25492
- * settings:
25493
- *
25494
- * - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
25495
- * - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
25496
- * - future: notification rules, audio gating, etc.
25497
- *
25498
- * One rule applies to N zones (`zoneIds[]`) so the operator can
25499
- * express "ignore motion in ALL of {garden, street}" with a single
25500
- * rule. `classFilter` narrows the rule to specific object classes —
25501
- * "drop person detections in the street, but keep cars" is one
25502
- * `exclude` rule with `classFilter: ['person']`.
25503
- *
25504
- * `enabled` is a soft toggle — the operator can keep the rule
25505
- * configured but inert without deleting it.
25506
- */
25507
- var ZoneRuleSchema = object({
25508
- /** Stable rule id — survives edits, used by the UI for diffing. */
25509
- id: string(),
25510
- /** Optional human-readable label rendered in the rule editor. */
25511
- name: string().optional(),
25512
- /** Zones this rule targets. The rule's `mode` applies to ALL
25513
- * listed zones (OR-set: a detection in any one of them counts).
25514
- * At least one zone id required — a rule with no targets is a
25515
- * configuration mistake and the form validator rejects it. */
25516
- zoneIds: array(string()).min(1).readonly(),
25517
- mode: ZoneRuleModeEnum,
25518
- /**
25519
- * Class names this rule applies to. Empty / undefined ⇒ rule
25520
- * applies to every class. Class strings match the `macroClass`
25521
- * field on detections (e.g. `person`, `car`, `dog`).
25522
- */
25523
- classFilter: array(string()).readonly().optional(),
25524
- /**
25525
- * Minimum bbox/mask overlap (0–1) with any of the rule's zones
25526
- * required to consider an entity "in the zone". Defaults to the
25527
- * consumer's stage default when omitted. Kept for back-compat with
25528
- * existing per-rule overrides; new operators pick the value via
25529
- * `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
25530
- * set, the lower-level engine reads it as a 0–1 fraction.
25531
- */
25532
- overlapThreshold: number().min(0).max(1).optional(),
25533
- /**
25534
- * Operator-friendly version of `overlapThreshold` — the percentage
25535
- * of the detection's bbox that must lie inside the zone for the
25536
- * rule to match. Documented default is 85%; the engine substitutes
25537
- * that when the field is omitted (kept optional so existing rules
25538
- * stored without it stay valid).
25539
- *
25540
- * When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
25541
- * rule, the engine prefers `bboxInclusionPct` because it's the
25542
- * field exposed in the UI. Internally both feed the same gate.
25543
- */
25544
- bboxInclusionPct: number().min(0).max(100).optional(),
25545
- /**
25546
- * When `true` and a detection has a segmentation mask, use the
25547
- * mask for overlap instead of the bbox. Detection-stage only;
25548
- * motion rules ignore this field.
25549
- */
25550
- preferMask: boolean().optional(),
25551
- /**
25552
- * Soft-toggle: `false` disables the rule without deleting it.
25553
- * Defaults to `true` so operators creating a rule via the UI
25554
- * see it active immediately.
25555
- */
25556
- enabled: boolean().default(true)
25557
- });
25558
- array(ZoneRuleSchema).readonly();
25559
25667
  object({
25560
25668
  /** Whether the script is currently executing. */
25561
25669
  isRunning: boolean(),
@@ -29420,6 +29528,12 @@ Object.freeze({
29420
29528
  addonId: null,
29421
29529
  access: "view"
29422
29530
  },
29531
+ "notificationRules.resolveArtifactUrl": {
29532
+ capName: "notification-rules",
29533
+ capScope: "system",
29534
+ addonId: null,
29535
+ access: "view"
29536
+ },
29423
29537
  "notificationRules.setAlarmConfig": {
29424
29538
  capName: "notification-rules",
29425
29539
  capScope: "system",
@@ -29864,6 +29978,12 @@ Object.freeze({
29864
29978
  addonId: null,
29865
29979
  access: "create"
29866
29980
  },
29981
+ "pipelineAnalytics.runReplayFrameProcessor": {
29982
+ capName: "pipeline-analytics",
29983
+ capScope: "device",
29984
+ addonId: null,
29985
+ access: "create"
29986
+ },
29867
29987
  "pipelineAnalytics.saveRetrainAnnotations": {
29868
29988
  capName: "pipeline-analytics",
29869
29989
  capScope: "device",
@@ -29996,6 +30116,12 @@ Object.freeze({
29996
30116
  addonId: null,
29997
30117
  access: "view"
29998
30118
  },
30119
+ "pipelineExecutor.getInferenceDeviceHealth": {
30120
+ capName: "pipeline-executor",
30121
+ capScope: "system",
30122
+ addonId: null,
30123
+ access: "view"
30124
+ },
29999
30125
  "pipelineExecutor.getOrchestratorConfigSchema": {
30000
30126
  capName: "pipeline-executor",
30001
30127
  capScope: "system",
@@ -30068,6 +30194,12 @@ Object.freeze({
30068
30194
  addonId: null,
30069
30195
  access: "view"
30070
30196
  },
30197
+ "pipelineExecutor.rearmInferenceDevice": {
30198
+ capName: "pipeline-executor",
30199
+ capScope: "system",
30200
+ addonId: null,
30201
+ access: "create"
30202
+ },
30071
30203
  "pipelineExecutor.runAudioTest": {
30072
30204
  capName: "pipeline-executor",
30073
30205
  capScope: "system",
@@ -30806,6 +30938,12 @@ Object.freeze({
30806
30938
  addonId: null,
30807
30939
  access: "view"
30808
30940
  },
30941
+ "recording.readWindowBytes": {
30942
+ capName: "recording",
30943
+ capScope: "system",
30944
+ addonId: null,
30945
+ access: "view"
30946
+ },
30809
30947
  "recording.refreshStorageLocationsForMigration": {
30810
30948
  capName: "recording",
30811
30949
  capScope: "system",
@@ -33316,6 +33454,11 @@ Object.freeze({
33316
33454
  form: "single",
33317
33455
  optional: false
33318
33456
  }],
33457
+ "pipelineAnalytics.runReplayFrameProcessor": [{
33458
+ name: "deviceId",
33459
+ form: "single",
33460
+ optional: false
33461
+ }],
33319
33462
  "pipelineAnalytics.saveRetrainAnnotations": [{
33320
33463
  name: "deviceId",
33321
33464
  form: "single",
@@ -33631,6 +33774,11 @@ Object.freeze({
33631
33774
  form: "single",
33632
33775
  optional: false
33633
33776
  }],
33777
+ "recording.readWindowBytes": [{
33778
+ name: "deviceId",
33779
+ form: "single",
33780
+ optional: false
33781
+ }],
33634
33782
  "recording.relocateFootage": [{
33635
33783
  name: "deviceId",
33636
33784
  form: "single",
@@ -34475,7 +34623,7 @@ var AdminUIAddon = class extends BaseAddon {
34475
34623
  capability: adminUiCapability,
34476
34624
  provider: {
34477
34625
  getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
34478
- getVersion: async () => ({ version: "1.2.100" })
34626
+ getVersion: async () => ({ version: "1.2.102" })
34479
34627
  }
34480
34628
  }];
34481
34629
  }