@camstack/addon-admin-ui 1.2.100 → 1.2.101

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