@camstack/addon-pipeline 1.2.129 → 1.2.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{addon-utils-CKB-2oM9.js → addon-utils-DCQ5AP_v.js} +1 -1
- package/dist/audio-analyzer/index.js +3 -3
- package/dist/audio-analyzer/index.mjs +2 -2
- package/dist/detection-pipeline/index.js +332 -20
- package/dist/detection-pipeline/index.mjs +330 -18
- package/dist/{dist-D9x2_csL.js → dist-CqoMNE1e.js} +2010 -1753
- package/dist/{dist-CMio-1qq.mjs → dist-DO0UVhOk.mjs} +2010 -1753
- package/dist/{event-loop-stall-monitor-B9dxYxyf.mjs → event-loop-stall-monitor-D0Juf7Dn.mjs} +1 -1
- package/dist/{event-loop-stall-monitor-UW8nsiMb.js → event-loop-stall-monitor-eM7_yYfn.js} +1 -1
- package/dist/{lazy-sharp-DrLwLKpg.js → lazy-sharp-BGrpS8yi.js} +1 -1
- package/dist/motion-wasm/index.js +2 -2
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/pipeline-runner/index.js +4 -4
- package/dist/pipeline-runner/index.mjs +3 -3
- package/dist/{process-memory-C6es8dMA.mjs → process-memory-Bac3FuG6.mjs} +1 -1
- package/dist/{process-memory-CSJ7-Wlp.js → process-memory-xAPjvSw9.js} +1 -1
- package/dist/recorder/index.js +560 -31
- package/dist/recorder/index.mjs +558 -30
- package/dist/{segment-demux-js-DiLDoV9_.js → segment-demux-js-Cu0oDMUL.js} +1 -1
- package/dist/{segment-demux-js-BRCjXbI0.mjs → segment-demux-js-skhsAZx6.mjs} +1 -1
- package/dist/session-decode/decode-worker-child.js +2 -2
- package/dist/session-decode/decode-worker-child.mjs +1 -1
- package/dist/stream-broker/_stub.js +2 -2
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-1O99xPTr.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DGQkDEYw.mjs} +3 -3
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Bme2OZQp.mjs +26 -0
- package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Do2DEtRt.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CQKwHIHI.mjs} +1 -1
- package/dist/stream-broker/demux-worker-child.js +1 -1
- package/dist/stream-broker/demux-worker-child.mjs +1 -1
- package/dist/stream-broker/{hostInit-8scvCWua.mjs → hostInit-D7FwwZgj.mjs} +3 -3
- package/dist/stream-broker/index.js +426 -319
- package/dist/stream-broker/index.mjs +426 -319
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/dist/{worker-protocol-BmBYCioC.js → worker-protocol-G3HXTY8z.js} +1 -1
- package/dist/{worker-protocol-BHNWB9Ve.mjs → worker-protocol-_Ujvj1hl.mjs} +1 -1
- package/package.json +1 -1
- package/python/__pycache__/inference_pool.cpython-312.pyc +0 -0
- package/python/__pycache__/inference_pool.cpython-313.pyc +0 -0
- package/python/__pycache__/inference_pool.cpython-314.pyc +0 -0
- package/python/__pycache__/test_inference_pool_backpressure.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/__pycache__/test_inference_pool_backpressure.cpython-312.pyc +0 -0
- package/python/__pycache__/test_inference_pool_backpressure.cpython-314.pyc +0 -0
- package/python/__pycache__/test_inference_pool_coreml_cache.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/__pycache__/test_inference_pool_coreml_cache.cpython-312.pyc +0 -0
- package/python/__pycache__/test_inference_pool_coreml_cache.cpython-314.pyc +0 -0
- package/python/__pycache__/test_inference_pool_device_selection.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/__pycache__/test_inference_pool_device_selection.cpython-312.pyc +0 -0
- package/python/__pycache__/test_inference_pool_device_selection.cpython-314.pyc +0 -0
- package/python/__pycache__/test_inference_pool_layout.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/__pycache__/test_inference_pool_layout.cpython-314.pyc +0 -0
- package/python/__pycache__/test_inference_pool_memstats.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/__pycache__/test_inference_pool_memstats.cpython-312.pyc +0 -0
- package/python/__pycache__/test_inference_pool_memstats.cpython-314.pyc +0 -0
- package/python/__pycache__/test_inference_pool_ov_ppp.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/__pycache__/test_inference_pool_ov_ppp.cpython-312.pyc +0 -0
- package/python/__pycache__/test_inference_pool_ov_ppp.cpython-314.pyc +0 -0
- package/python/__pycache__/test_inference_pool_preprocess.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/__pycache__/test_inference_pool_preprocess.cpython-314.pyc +0 -0
- package/python/__pycache__/test_inference_pool_reconfigure.cpython-314.pyc +0 -0
- package/python/__pycache__/test_inference_pool_static_batch.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/__pycache__/test_inference_pool_static_batch.cpython-312.pyc +0 -0
- package/python/__pycache__/test_inference_pool_static_batch.cpython-314.pyc +0 -0
- package/python/__pycache__/yamnet_audio.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/__init__.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/_safety.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/arcface.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/arcface.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/arcface.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/clip.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/clip.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/clip.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/ctc.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/ctc.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/ctc.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/plate_slots.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/plate_slots.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/rfdetr.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/rfdetr.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/saliency.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/saliency.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/saliency.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/scrfd.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/scrfd.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/scrfd.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/softmax.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/softmax.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/softmax.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/ssd.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/ssd.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/ssd.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/test_clip.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/test_clip.cpython-313-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/test_ctc.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/test_ctc.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/test_ctc.cpython-313-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/test_ctc.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/test_ctc.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/test_plate_slots.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/test_rfdetr.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/test_rfdetr.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/test_saliency.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/test_saliency.cpython-313-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/test_saliency.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/test_softmax.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/test_softmax.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/test_yolo_nms.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/test_yolo_nms.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/test_yolo_nms.cpython-39.pyc +0 -0
- package/python/postprocessors/__pycache__/test_yolonas.cpython-312-pytest-9.1.1.pyc +0 -0
- package/python/postprocessors/__pycache__/yamnet.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/yamnet.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/yamnet.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/yolo.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/yolo.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/yolo.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/yolo.cpython-39.pyc +0 -0
- package/python/postprocessors/__pycache__/yolo_seg.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/yolo_seg.cpython-313.pyc +0 -0
- package/python/postprocessors/__pycache__/yolo_seg.cpython-314.pyc +0 -0
- package/python/postprocessors/__pycache__/yolonas.cpython-312.pyc +0 -0
- package/python/postprocessors/__pycache__/yolonas.cpython-314.pyc +0 -0
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CxppPmXr.mjs +0 -26
|
@@ -6792,7 +6792,7 @@ function method(input, output, options) {
|
|
|
6792
6792
|
input,
|
|
6793
6793
|
output,
|
|
6794
6794
|
kind: options?.kind ?? "query",
|
|
6795
|
-
auth: options
|
|
6795
|
+
...options?.auth !== void 0 ? { auth: options.auth } : {},
|
|
6796
6796
|
...options?.access !== void 0 ? { access: options.access } : {},
|
|
6797
6797
|
...options?.caller !== void 0 ? { caller: options.caller } : {},
|
|
6798
6798
|
timeoutMs: options?.timeoutMs
|
|
@@ -6816,7 +6816,7 @@ function event(data) {
|
|
|
6816
6816
|
}
|
|
6817
6817
|
var StaticDirOutputSchema$1 = object({ staticDir: string() });
|
|
6818
6818
|
var VersionOutputSchema$1 = object({ version: string() });
|
|
6819
|
-
method(_void(), StaticDirOutputSchema$1), method(_void(), VersionOutputSchema$1);
|
|
6819
|
+
method(_void(), StaticDirOutputSchema$1, { auth: "admin" }), method(_void(), VersionOutputSchema$1, { auth: "admin" });
|
|
6820
6820
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
6821
6821
|
DeviceType["Camera"] = "camera";
|
|
6822
6822
|
DeviceType["Hub"] = "hub";
|
|
@@ -7137,7 +7137,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
7137
7137
|
}({});
|
|
7138
7138
|
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
7139
7139
|
var VersionOutputSchema = object({ version: string() });
|
|
7140
|
-
method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
|
|
7140
|
+
method(_void(), StaticDirOutputSchema, { auth: "admin" }), method(_void(), VersionOutputSchema, { auth: "admin" });
|
|
7141
7141
|
/**
|
|
7142
7142
|
* device-ops — device-scoped cap that unifies the per-IDevice operations
|
|
7143
7143
|
* previously routed through the `.device-ops` Moleculer bridge service.
|
|
@@ -8772,10 +8772,11 @@ var RelocateFootageInputSchema = object({
|
|
|
8772
8772
|
* `RecordingConfig.enabled` or camera wrapper bindings. */
|
|
8773
8773
|
var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
|
|
8774
8774
|
var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
|
|
8775
|
-
var
|
|
8775
|
+
var RelocateMediaInputSchema = object({
|
|
8776
8776
|
toLocationId: string(),
|
|
8777
8777
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
8778
|
-
})
|
|
8778
|
+
});
|
|
8779
|
+
var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
|
|
8779
8780
|
/** The independently selectable logical storage classes. `recordings`
|
|
8780
8781
|
* encompasses the high and mid segment profiles; `recordingsLow` is low
|
|
8781
8782
|
* segments; `eventMedia` is post-analysis blobs. */
|
|
@@ -9070,7 +9071,26 @@ var LabelDefinitionSchema = object({
|
|
|
9070
9071
|
description: string().optional(),
|
|
9071
9072
|
icon: string().optional()
|
|
9072
9073
|
});
|
|
9073
|
-
|
|
9074
|
+
/**
|
|
9075
|
+
* Wire schema for a per-model CATALOG classMap override
|
|
9076
|
+
* (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
|
|
9077
|
+
* restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
|
|
9078
|
+
* detection pipeline executor actually routes.
|
|
9079
|
+
*
|
|
9080
|
+
* This is deliberately a DIFFERENT, narrower shape than the general-purpose
|
|
9081
|
+
* `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
|
|
9082
|
+
* and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
|
|
9083
|
+
* enum) — the two used to share the name `ClassMapDefinition`/
|
|
9084
|
+
* `ClassMapDefinitionSchema`, which made the schema-type-twin guard
|
|
9085
|
+
* (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
|
|
9086
|
+
* are not: it is two different concepts colliding on a name. Keep this type
|
|
9087
|
+
* under its own name rather than reusing `ClassMapDefinition` — reusing it
|
|
9088
|
+
* would either narrow every `ClassMapDefinition` consumer to the four
|
|
9089
|
+
* detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
|
|
9090
|
+
* schema exists for (see the "rejects a classMap whose target is not a
|
|
9091
|
+
* detection macro" test in `model-catalog-schema.test.ts`).
|
|
9092
|
+
*/
|
|
9093
|
+
var DetectionCatalogClassMapSchema = object({
|
|
9074
9094
|
mapping: record(string(), _enum([
|
|
9075
9095
|
"person",
|
|
9076
9096
|
"vehicle",
|
|
@@ -9288,7 +9308,7 @@ var ModelCatalogEntrySchema = object({
|
|
|
9288
9308
|
* applies (Frigate / COCO public catalog). Set on a custom model whose raw
|
|
9289
9309
|
* labels already ARE the CamStack macros (Scrypted identity map).
|
|
9290
9310
|
*/
|
|
9291
|
-
classMap:
|
|
9311
|
+
classMap: DetectionCatalogClassMapSchema.optional()
|
|
9292
9312
|
});
|
|
9293
9313
|
var ConvertTargetSchema = discriminatedUnion("format", [object({
|
|
9294
9314
|
format: literal("openvino"),
|
|
@@ -9318,7 +9338,7 @@ var ModelConvertMetadataSchema = object({
|
|
|
9318
9338
|
"segmentation"
|
|
9319
9339
|
]),
|
|
9320
9340
|
faceAlignment: boolean().optional(),
|
|
9321
|
-
classMap:
|
|
9341
|
+
classMap: DetectionCatalogClassMapSchema.optional()
|
|
9322
9342
|
});
|
|
9323
9343
|
var ConvertResultSchema = object({
|
|
9324
9344
|
entry: ModelCatalogEntrySchema,
|
|
@@ -10181,7 +10201,7 @@ var AddonPageDeclarationSchema = object({
|
|
|
10181
10201
|
/** Display label for a CUSTOM `section` id (ignored for well-known ids). */
|
|
10182
10202
|
sectionLabel: string().optional()
|
|
10183
10203
|
});
|
|
10184
|
-
method(_void(), array(AddonPageDeclarationSchema).readonly());
|
|
10204
|
+
method(_void(), array(AddonPageDeclarationSchema).readonly(), { auth: "admin" });
|
|
10185
10205
|
var AddonHttpRouteSchema = object({
|
|
10186
10206
|
method: _enum([
|
|
10187
10207
|
"GET",
|
|
@@ -10421,7 +10441,20 @@ var addonWidgetsSourceCapability = {
|
|
|
10421
10441
|
scope: "system",
|
|
10422
10442
|
mode: "collection",
|
|
10423
10443
|
internal: true,
|
|
10424
|
-
methods: {
|
|
10444
|
+
methods: {
|
|
10445
|
+
/**
|
|
10446
|
+
* `internal: true` did not gate the mount (see the 2026-08-26 note on
|
|
10447
|
+
* `data-store-provider`) — this was reachable on the AppRouter by ANY
|
|
10448
|
+
* authenticated session at the default `auth: 'protected'`. The only
|
|
10449
|
+
* consumer, the `addon-widgets-aggregator` builtin, reads it via
|
|
10450
|
+
* `ctx.capabilities.getCollection('addon-widgets-source')` — LOCAL-PROCESS
|
|
10451
|
+
* only, never tRPC. The public, enriched listing admin-ui actually
|
|
10452
|
+
* consumes is the separate `addon-widgets` cap (`listWidgets` there is
|
|
10453
|
+
* gated separately, and a `preAuth: true` widget is surfaced through the
|
|
10454
|
+
* PUBLIC `auth.listLoginMethods` contribution channel instead) —
|
|
10455
|
+
* neither is affected by this change.
|
|
10456
|
+
*/
|
|
10457
|
+
listWidgets: method(_void(), array(WidgetMetadataSchema).readonly(), { auth: "admin" }) }
|
|
10425
10458
|
};
|
|
10426
10459
|
/**
|
|
10427
10460
|
* `addon-widgets` — system-scoped singleton aggregator cap. Public-facing
|
|
@@ -12357,7 +12390,7 @@ var CustomModelDescriptorSchema = object({
|
|
|
12357
12390
|
stepId: string(),
|
|
12358
12391
|
entry: ModelCatalogEntrySchema
|
|
12359
12392
|
});
|
|
12360
|
-
method(_void(), array(CustomModelDescriptorSchema).readonly());
|
|
12393
|
+
method(_void(), array(CustomModelDescriptorSchema).readonly(), { auth: "admin" });
|
|
12361
12394
|
/**
|
|
12362
12395
|
* Query filter for settings-store collections.
|
|
12363
12396
|
*/
|
|
@@ -12508,56 +12541,87 @@ var EngineInfoSchema = object({
|
|
|
12508
12541
|
kind: _enum(["relational", "vector"]),
|
|
12509
12542
|
displayName: string()
|
|
12510
12543
|
});
|
|
12511
|
-
method(_void(), EngineInfoSchema), method(object({
|
|
12544
|
+
method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
12512
12545
|
namespace: string().optional(),
|
|
12513
12546
|
collection: string(),
|
|
12514
12547
|
key: string()
|
|
12515
|
-
}), unknown()), method(object({
|
|
12548
|
+
}), unknown(), { auth: "admin" }), method(object({
|
|
12516
12549
|
namespace: string().optional(),
|
|
12517
12550
|
collection: string(),
|
|
12518
12551
|
key: string(),
|
|
12519
12552
|
value: unknown()
|
|
12520
|
-
}), _void(), {
|
|
12553
|
+
}), _void(), {
|
|
12554
|
+
kind: "mutation",
|
|
12555
|
+
auth: "admin"
|
|
12556
|
+
}), method(object({
|
|
12521
12557
|
namespace: string().optional(),
|
|
12522
12558
|
collection: string(),
|
|
12523
12559
|
filter: QueryFilterSchema.optional(),
|
|
12524
12560
|
/**
|
|
12525
12561
|
* SQL-level column projection — MUST mirror `settings-store.query`.
|
|
12526
12562
|
*
|
|
12527
|
-
*
|
|
12528
|
-
*
|
|
12529
|
-
*
|
|
12530
|
-
*
|
|
12531
|
-
*
|
|
12563
|
+
* ⚠ An earlier version of this comment blamed Zod stripping, and that
|
|
12564
|
+
* was wrong — corrected 2026-08-26 after the hop map
|
|
12565
|
+
* (`docs/design/2026-08-26-mappa-hop-argomenti.md`) traced the path.
|
|
12566
|
+
* There is **no Zod parse at all** between the door and the engine: the
|
|
12567
|
+
* dispatcher forwards the payload verbatim and UDS carries it whole. A
|
|
12568
|
+
* field declared here reaches `SqliteSettingsBackend` either way.
|
|
12569
|
+
*
|
|
12570
|
+
* What actually lost `columns` was the THIRD declaration of this shape:
|
|
12571
|
+
* `SettingsQueryInput` in `interfaces/storage.ts`, a hand-written TS
|
|
12572
|
+
* interface the engine destructures from. The field existed on both
|
|
12573
|
+
* schemas and the engine still never read it, because nothing checks a
|
|
12574
|
+
* registered provider against `InferProvider<cap>` —
|
|
12575
|
+
* `ProviderRegistration.provider` is typed `object`.
|
|
12576
|
+
*
|
|
12577
|
+
* It is declared here anyway, and must stay in step with
|
|
12578
|
+
* `settings-store.query`: a caller reading only the cap definitions has
|
|
12579
|
+
* to be able to see that this call carries a projection.
|
|
12580
|
+
* `data-door-schema-parity.spec.ts` keeps the two aligned.
|
|
12532
12581
|
*/
|
|
12533
12582
|
columns: array(string()).readonly().optional()
|
|
12534
|
-
}), array(SettingsRecordSchema).readonly()), method(object({
|
|
12583
|
+
}), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
|
|
12535
12584
|
namespace: string().optional(),
|
|
12536
12585
|
collection: string(),
|
|
12537
12586
|
record: SettingsRecordSchema
|
|
12538
|
-
}), _void(), {
|
|
12587
|
+
}), _void(), {
|
|
12588
|
+
kind: "mutation",
|
|
12589
|
+
auth: "admin"
|
|
12590
|
+
}), method(object({
|
|
12539
12591
|
namespace: string().optional(),
|
|
12540
12592
|
collection: string(),
|
|
12541
12593
|
id: string(),
|
|
12542
12594
|
data: record(string(), unknown())
|
|
12543
|
-
}), _void(), {
|
|
12595
|
+
}), _void(), {
|
|
12596
|
+
kind: "mutation",
|
|
12597
|
+
auth: "admin"
|
|
12598
|
+
}), method(object({
|
|
12544
12599
|
namespace: string().optional(),
|
|
12545
12600
|
collection: string(),
|
|
12546
12601
|
key: string()
|
|
12547
|
-
}), _void(), {
|
|
12602
|
+
}), _void(), {
|
|
12603
|
+
kind: "mutation",
|
|
12604
|
+
auth: "admin"
|
|
12605
|
+
}), method(object({
|
|
12548
12606
|
namespace: string().optional(),
|
|
12549
12607
|
collection: string(),
|
|
12550
12608
|
filter: MutationFilterSchema
|
|
12551
|
-
}), object({ deleted: number().int() }), {
|
|
12609
|
+
}), object({ deleted: number().int() }), {
|
|
12610
|
+
kind: "mutation",
|
|
12611
|
+
auth: "admin"
|
|
12612
|
+
}), method(object({
|
|
12552
12613
|
namespace: string().optional(),
|
|
12553
12614
|
collection: string(),
|
|
12554
12615
|
filter: MutationFilterSchema,
|
|
12555
12616
|
data: record(string(), unknown())
|
|
12556
|
-
}), object({ updated: number().int() }), {
|
|
12617
|
+
}), object({ updated: number().int() }), {
|
|
12618
|
+
kind: "mutation",
|
|
12619
|
+
auth: "admin"
|
|
12620
|
+
}), method(object({
|
|
12557
12621
|
namespace: string().optional(),
|
|
12558
12622
|
collection: string(),
|
|
12559
12623
|
filter: QueryFilterSchema.optional()
|
|
12560
|
-
}), number()), method(object({
|
|
12624
|
+
}), number(), { auth: "admin" }), method(object({
|
|
12561
12625
|
namespace: string().optional(),
|
|
12562
12626
|
collection: string(),
|
|
12563
12627
|
field: string(),
|
|
@@ -12567,15 +12631,18 @@ method(_void(), EngineInfoSchema), method(object({
|
|
|
12567
12631
|
}), array(object({
|
|
12568
12632
|
bucket: number().int(),
|
|
12569
12633
|
count: number().int()
|
|
12570
|
-
})).readonly()), method(object({
|
|
12634
|
+
})).readonly(), { auth: "admin" }), method(object({
|
|
12571
12635
|
namespace: string().optional(),
|
|
12572
12636
|
collection: string()
|
|
12573
|
-
}), boolean()), method(object({
|
|
12637
|
+
}), boolean(), { auth: "admin" }), method(object({
|
|
12574
12638
|
namespace: string().optional(),
|
|
12575
12639
|
collection: string(),
|
|
12576
12640
|
columns: array(CollectionColumnSchema).readonly(),
|
|
12577
12641
|
indexes: array(CollectionIndexSchema).readonly().optional()
|
|
12578
|
-
}), _void(), {
|
|
12642
|
+
}), _void(), {
|
|
12643
|
+
kind: "mutation",
|
|
12644
|
+
auth: "admin"
|
|
12645
|
+
});
|
|
12579
12646
|
/**
|
|
12580
12647
|
* shm ring usage stats for a `frameSink: 'shm'` decoder session —
|
|
12581
12648
|
* exposed via `decoder.getShmStats` so downstream consumers can
|
|
@@ -13734,7 +13801,7 @@ method(object({
|
|
|
13734
13801
|
crop: _instanceof(Uint8Array),
|
|
13735
13802
|
width: number(),
|
|
13736
13803
|
height: number()
|
|
13737
|
-
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
13804
|
+
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
13738
13805
|
/**
|
|
13739
13806
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
13740
13807
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
@@ -14027,19 +14094,22 @@ method(LlmGenerateBaseInputSchema.extend({
|
|
|
14027
14094
|
runtime: ManagedRuntimeConfigSchema,
|
|
14028
14095
|
/** The managed profile's timeout, threaded by the hub provider. */
|
|
14029
14096
|
timeoutMs: number().int().positive().optional()
|
|
14030
|
-
}), LlmGenerateResultSchema, {
|
|
14097
|
+
}), LlmGenerateResultSchema, {
|
|
14098
|
+
kind: "mutation",
|
|
14099
|
+
auth: "admin"
|
|
14100
|
+
}), method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
|
|
14031
14101
|
kind: "mutation",
|
|
14032
14102
|
auth: "admin"
|
|
14033
14103
|
}), method(object({}), _void(), {
|
|
14034
14104
|
kind: "mutation",
|
|
14035
14105
|
auth: "admin"
|
|
14036
|
-
}), method(object({}), LlmRuntimeStatusSchema), method(object({ model: ManagedModelRefSchema }), _void(), {
|
|
14106
|
+
}), method(object({}), LlmRuntimeStatusSchema, { auth: "admin" }), method(object({ model: ManagedModelRefSchema }), _void(), {
|
|
14037
14107
|
kind: "mutation",
|
|
14038
14108
|
auth: "admin"
|
|
14039
14109
|
}), method(object({ file: string() }), _void(), {
|
|
14040
14110
|
kind: "mutation",
|
|
14041
14111
|
auth: "admin"
|
|
14042
|
-
}), method(object({}), array(LlmNodeModelSchema)), method(object({}), LlmRuntimeDiskUsageSchema);
|
|
14112
|
+
}), method(object({}), array(LlmNodeModelSchema), { auth: "admin" }), method(object({}), LlmRuntimeDiskUsageSchema, { auth: "admin" });
|
|
14043
14113
|
/**
|
|
14044
14114
|
* `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
|
|
14045
14115
|
* methods concat-fan across providers; single-row methods route to ONE
|
|
@@ -17855,1584 +17925,275 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
17855
17925
|
*/
|
|
17856
17926
|
refreshTokenTtlSec: union([number().int().positive(), literal("never")]).optional()
|
|
17857
17927
|
});
|
|
17858
|
-
method(_void(), OauthIntegrationDescriptorSchema);
|
|
17928
|
+
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
17859
17929
|
/**
|
|
17860
|
-
*
|
|
17861
|
-
*
|
|
17862
|
-
*
|
|
17863
|
-
* persisted media. Owns the post-detection domain end-to-end:
|
|
17864
|
-
*
|
|
17865
|
-
* runner emits PipelineInferenceResult
|
|
17866
|
-
* ↓ (event bus)
|
|
17867
|
-
* pipeline-analytics subscriber
|
|
17868
|
-
* ↓ SORT tracker + zone engine + state analyzer + event emitter
|
|
17869
|
-
* → three DB collections (one per kind), one FS media tree, one
|
|
17870
|
-
* unified event emitter (FrameTracked + TrackStarted/Ended +
|
|
17871
|
-
* DetectionEvent on bus)
|
|
17872
|
-
*
|
|
17873
|
-
* Pure subscriber model. No `processFrame` cap method — the runner
|
|
17874
|
-
* already publishes the raw frame on the bus. The cap surface is
|
|
17875
|
-
* only QUERIES + per-device settings, bound on/off via
|
|
17876
|
-
* `device-manager.setWrapperActive`. `defaultActive: true` because
|
|
17877
|
-
* every camera with a detection pipeline wants its raw detections
|
|
17878
|
-
* refined; operators opt out per-device via BindingsTab when needed.
|
|
17879
|
-
*
|
|
17880
|
-
* Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
|
|
17881
|
-
* (per-device surface) and `track-trail` caps — see P11 cleanup.
|
|
17930
|
+
* Reference to the frame's retained NATIVE surface + the parent crop's placement
|
|
17931
|
+
* within the frame, so the executor can re-cut a leaf child ROI at native
|
|
17932
|
+
* resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
|
|
17882
17933
|
*/
|
|
17883
|
-
var
|
|
17884
|
-
|
|
17885
|
-
|
|
17886
|
-
|
|
17887
|
-
|
|
17888
|
-
|
|
17889
|
-
|
|
17890
|
-
|
|
17891
|
-
|
|
17892
|
-
|
|
17893
|
-
|
|
17894
|
-
|
|
17934
|
+
var NativeCropRefSchema = object({
|
|
17935
|
+
/** Handle keying the retained native surface (node-pinned to its owner). */
|
|
17936
|
+
handle: FrameHandleSchema,
|
|
17937
|
+
/** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
|
|
17938
|
+
cropFrameSpace: object({
|
|
17939
|
+
x: number(),
|
|
17940
|
+
y: number(),
|
|
17941
|
+
w: number(),
|
|
17942
|
+
h: number()
|
|
17943
|
+
})
|
|
17944
|
+
});
|
|
17945
|
+
object({
|
|
17946
|
+
crop: object({
|
|
17947
|
+
left: number(),
|
|
17948
|
+
top: number(),
|
|
17949
|
+
width: number().positive(),
|
|
17950
|
+
height: number().positive()
|
|
17951
|
+
}).optional(),
|
|
17952
|
+
content: object({
|
|
17953
|
+
width: number().int().positive(),
|
|
17954
|
+
height: number().int().positive()
|
|
17955
|
+
}),
|
|
17956
|
+
fit: _enum(["stretch", "contain"]),
|
|
17957
|
+
format: _enum([
|
|
17958
|
+
"rgb",
|
|
17959
|
+
"gray",
|
|
17960
|
+
"jpeg"
|
|
17961
|
+
])
|
|
17962
|
+
});
|
|
17895
17963
|
/**
|
|
17896
|
-
*
|
|
17897
|
-
*
|
|
17898
|
-
*
|
|
17964
|
+
* Process-local frame identity. It is serializable so it can ride an in-process
|
|
17965
|
+
* capability call, but `registryId` deliberately prevents resolution in any
|
|
17966
|
+
* other process or execution group.
|
|
17899
17967
|
*/
|
|
17900
|
-
var
|
|
17901
|
-
|
|
17902
|
-
|
|
17903
|
-
|
|
17904
|
-
|
|
17905
|
-
"
|
|
17906
|
-
|
|
17907
|
-
|
|
17908
|
-
|
|
17909
|
-
|
|
17910
|
-
"
|
|
17911
|
-
"
|
|
17912
|
-
"
|
|
17913
|
-
"
|
|
17914
|
-
"
|
|
17968
|
+
var FrameRefSchema = object({
|
|
17969
|
+
registryId: string().min(1),
|
|
17970
|
+
id: string().min(1),
|
|
17971
|
+
width: number().int().positive(),
|
|
17972
|
+
height: number().int().positive(),
|
|
17973
|
+
format: _enum(["rgb", "gray"]),
|
|
17974
|
+
timestamp: number(),
|
|
17975
|
+
capturedAt: number().optional()
|
|
17976
|
+
});
|
|
17977
|
+
var ModelFormatSchema$1 = _enum([
|
|
17978
|
+
"onnx",
|
|
17979
|
+
"coreml",
|
|
17980
|
+
"openvino",
|
|
17981
|
+
"tflite",
|
|
17982
|
+
"pt",
|
|
17983
|
+
"gguf"
|
|
17915
17984
|
]);
|
|
17916
|
-
var
|
|
17917
|
-
"
|
|
17918
|
-
"
|
|
17919
|
-
"
|
|
17920
|
-
"
|
|
17921
|
-
"
|
|
17922
|
-
"custom",
|
|
17923
|
-
"package"
|
|
17985
|
+
var PipelineSlotSchema = _enum([
|
|
17986
|
+
"detector",
|
|
17987
|
+
"cropper",
|
|
17988
|
+
"classifier",
|
|
17989
|
+
"refiner",
|
|
17990
|
+
"audio-classifier"
|
|
17924
17991
|
]);
|
|
17925
|
-
|
|
17926
|
-
|
|
17927
|
-
|
|
17928
|
-
|
|
17929
|
-
|
|
17930
|
-
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
17931
|
-
labelKey: string(),
|
|
17932
|
-
/** English fallback label (kept for clients that don't translate). */
|
|
17933
|
-
label: string(),
|
|
17934
|
-
/** Hex color for timeline/legend rendering. */
|
|
17935
|
-
color: string(),
|
|
17936
|
-
/** Dictionary id → lucide component on the UI side. */
|
|
17937
|
-
iconId: string(),
|
|
17938
|
-
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
17939
|
-
icon: EventKindIconSchema,
|
|
17940
|
-
category: EventKindCategorySchema,
|
|
17941
|
-
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
17942
|
-
parentKind: string().nullable(),
|
|
17943
|
-
/** Derived from `parentKind`, explicit for the client tree. */
|
|
17944
|
-
level: EventKindLevelSchema,
|
|
17945
|
-
/** Which cap + device contributes this kind. For built-ins the camera
|
|
17946
|
-
* itself; for sensor kinds the LINKED source device. */
|
|
17947
|
-
source: object({
|
|
17948
|
-
capName: string(),
|
|
17949
|
-
deviceId: number()
|
|
17950
|
-
})
|
|
17992
|
+
var PipelineEngineChoiceSchema = object({
|
|
17993
|
+
runtime: _enum(["node", "python"]),
|
|
17994
|
+
backend: string(),
|
|
17995
|
+
format: ModelFormatSchema$1,
|
|
17996
|
+
device: string().optional()
|
|
17951
17997
|
});
|
|
17952
|
-
|
|
17953
|
-
|
|
17954
|
-
|
|
17955
|
-
|
|
17998
|
+
var AvailableEngineSchema = object({
|
|
17999
|
+
engine: PipelineEngineChoiceSchema,
|
|
18000
|
+
devices: array(object({
|
|
18001
|
+
id: string(),
|
|
18002
|
+
label: string(),
|
|
18003
|
+
description: string().optional()
|
|
18004
|
+
})).readonly(),
|
|
18005
|
+
defaultDevice: string()
|
|
17956
18006
|
});
|
|
17957
|
-
var
|
|
18007
|
+
var PipelineDefaultStepSchema = lazy(() => object({
|
|
18008
|
+
addonId: string(),
|
|
18009
|
+
addonName: string(),
|
|
18010
|
+
slot: PipelineSlotSchema,
|
|
18011
|
+
inputClasses: array(string()).readonly(),
|
|
18012
|
+
outputClasses: array(string()).readonly(),
|
|
18013
|
+
enabled: boolean(),
|
|
18014
|
+
modelId: string(),
|
|
18015
|
+
children: array(PipelineDefaultStepSchema).readonly(),
|
|
18016
|
+
group: string().optional(),
|
|
18017
|
+
settings: record(string(), unknown()).optional()
|
|
18018
|
+
}));
|
|
18019
|
+
var PipelineTemplateStepSchema = lazy(() => object({
|
|
18020
|
+
addonId: string(),
|
|
18021
|
+
enabled: boolean(),
|
|
18022
|
+
modelId: string(),
|
|
18023
|
+
children: array(PipelineTemplateStepSchema).readonly(),
|
|
18024
|
+
settings: record(string(), unknown()).optional()
|
|
18025
|
+
}));
|
|
18026
|
+
var PipelineTemplateSchema$1 = object({
|
|
17958
18027
|
id: string(),
|
|
17959
|
-
|
|
17960
|
-
|
|
17961
|
-
|
|
17962
|
-
|
|
17963
|
-
|
|
17964
|
-
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
17965
|
-
kind: string(),
|
|
17966
|
-
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
17967
|
-
value: record(string(), unknown()).nullable(),
|
|
17968
|
-
timestamp: number()
|
|
18028
|
+
name: string(),
|
|
18029
|
+
createdAt: string(),
|
|
18030
|
+
updatedAt: string(),
|
|
18031
|
+
engine: PipelineEngineChoiceSchema,
|
|
18032
|
+
steps: array(PipelineTemplateStepSchema).readonly()
|
|
17969
18033
|
});
|
|
17970
|
-
var
|
|
17971
|
-
|
|
17972
|
-
|
|
17973
|
-
|
|
17974
|
-
|
|
18034
|
+
var PipelineModelOptionSchema = object({
|
|
18035
|
+
id: string(),
|
|
18036
|
+
name: string(),
|
|
18037
|
+
formats: record(string(), object({
|
|
18038
|
+
downloaded: boolean(),
|
|
18039
|
+
sizeMB: number()
|
|
18040
|
+
})),
|
|
18041
|
+
group: ModelVariantGroupSchema.optional(),
|
|
18042
|
+
legacy: boolean().optional(),
|
|
18043
|
+
provider: ModelProviderIdSchema.optional()
|
|
17975
18044
|
});
|
|
17976
|
-
var
|
|
17977
|
-
|
|
17978
|
-
|
|
17979
|
-
|
|
17980
|
-
|
|
17981
|
-
|
|
17982
|
-
|
|
17983
|
-
|
|
17984
|
-
|
|
17985
|
-
|
|
17986
|
-
|
|
17987
|
-
|
|
17988
|
-
|
|
17989
|
-
|
|
17990
|
-
|
|
17991
|
-
|
|
17992
|
-
maxY: number()
|
|
18045
|
+
var ConfigFieldBridge = custom();
|
|
18046
|
+
var PipelineAddonSchemaSchema = object({
|
|
18047
|
+
id: string(),
|
|
18048
|
+
name: string(),
|
|
18049
|
+
slot: PipelineSlotSchema,
|
|
18050
|
+
inputClasses: array(string()).readonly(),
|
|
18051
|
+
outputClasses: array(string()).readonly(),
|
|
18052
|
+
childSlots: array(PipelineSlotSchema).readonly(),
|
|
18053
|
+
models: array(PipelineModelOptionSchema).readonly(),
|
|
18054
|
+
defaultModelId: string(),
|
|
18055
|
+
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
18056
|
+
enabledByDefault: boolean().optional(),
|
|
18057
|
+
backfillIntoExistingOverrides: boolean().optional(),
|
|
18058
|
+
defaultConfidence: number(),
|
|
18059
|
+
group: string().optional(),
|
|
18060
|
+
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
17993
18061
|
});
|
|
17994
|
-
|
|
17995
|
-
|
|
17996
|
-
* complete Track including the frame-rate `positions[]` history and the
|
|
17997
|
-
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
17998
|
-
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
17999
|
-
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
18000
|
-
* zonesVisited, bestEventId, envelope, hasFace, hasEmbeddedFace, hasRider) and returns `positions` /
|
|
18001
|
-
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
18002
|
-
* `getTrack`. Mirrors the event-store `projection` convention
|
|
18003
|
-
* (`getObjectEvents` et al.).
|
|
18004
|
-
*/
|
|
18005
|
-
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
18006
|
-
/**
|
|
18007
|
-
* One audio-classification label heard on the track's camera while the
|
|
18008
|
-
* track was alive, aggregated per label. An "episode" is one persisted
|
|
18009
|
-
* audio event (the confident-classification path: score ≥ the device's
|
|
18010
|
-
* `classificationMinScore`, class-change-or-heartbeat coalesced) — NOT
|
|
18011
|
-
* one 32 ms inference chunk, so counts stay human-scaled.
|
|
18012
|
-
*/
|
|
18013
|
-
var TrackAudioLabelSchema = object({
|
|
18062
|
+
var PipelineSlotSchemaSchema = object({
|
|
18063
|
+
id: PipelineSlotSchema,
|
|
18014
18064
|
label: string(),
|
|
18015
|
-
|
|
18016
|
-
|
|
18017
|
-
|
|
18018
|
-
|
|
18019
|
-
|
|
18020
|
-
|
|
18065
|
+
priority: number(),
|
|
18066
|
+
parentSlot: PipelineSlotSchema.nullable(),
|
|
18067
|
+
addons: array(PipelineAddonSchemaSchema).readonly()
|
|
18068
|
+
});
|
|
18069
|
+
var PipelineSchemaSchema = object({
|
|
18070
|
+
availableEngines: array(AvailableEngineSchema).readonly(),
|
|
18071
|
+
selectedEngine: PipelineEngineChoiceSchema,
|
|
18072
|
+
slots: array(PipelineSlotSchemaSchema).readonly()
|
|
18073
|
+
});
|
|
18074
|
+
var EngineProvisioningSchema = object({
|
|
18075
|
+
runtimeId: _enum([
|
|
18076
|
+
"onnx",
|
|
18077
|
+
"openvino",
|
|
18078
|
+
"coreml",
|
|
18079
|
+
"edgetpu"
|
|
18080
|
+
]).nullable(),
|
|
18081
|
+
device: string().nullable(),
|
|
18082
|
+
state: _enum([
|
|
18083
|
+
"idle",
|
|
18084
|
+
"installing",
|
|
18085
|
+
"verifying",
|
|
18086
|
+
"ready",
|
|
18087
|
+
"failed"
|
|
18088
|
+
]),
|
|
18089
|
+
progress: number().optional(),
|
|
18090
|
+
error: string().optional(),
|
|
18091
|
+
nextRetryAt: number().optional(),
|
|
18092
|
+
/**
|
|
18093
|
+
* Gate A (config-correctness gate at engine change): human-readable
|
|
18094
|
+
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
18095
|
+
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
18096
|
+
* has a <format> build"). Additive/optional: informational only, never
|
|
18097
|
+
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
18098
|
+
* Absent/empty when the node-default tree resolves cleanly.
|
|
18099
|
+
*/
|
|
18100
|
+
configIssues: array(string()).optional()
|
|
18101
|
+
});
|
|
18102
|
+
var PipelineStepInputSchema = lazy(() => object({
|
|
18103
|
+
addonId: string(),
|
|
18104
|
+
modelId: string().optional(),
|
|
18105
|
+
enabled: boolean().default(true),
|
|
18106
|
+
children: array(PipelineStepInputSchema).optional(),
|
|
18107
|
+
settings: record(string(), unknown()).optional(),
|
|
18108
|
+
jumpDeviceKey: string().optional()
|
|
18109
|
+
}));
|
|
18110
|
+
var ModelSubstitutionSchema = object({
|
|
18111
|
+
addonId: string(),
|
|
18112
|
+
chosen: string(),
|
|
18113
|
+
running: string(),
|
|
18114
|
+
format: string()
|
|
18115
|
+
});
|
|
18116
|
+
var PipelineValidationIssueSchema = object({
|
|
18117
|
+
addonId: string(),
|
|
18118
|
+
kind: _enum(["unknown-addon", "no-format-build"]),
|
|
18119
|
+
detail: string()
|
|
18120
|
+
});
|
|
18121
|
+
var PipelineValidationResultSchema = object({
|
|
18122
|
+
ok: boolean(),
|
|
18123
|
+
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
18124
|
+
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
18125
|
+
/** The node's `currentEngine.format` this validation ran against. */
|
|
18126
|
+
format: string()
|
|
18127
|
+
});
|
|
18128
|
+
var ReferenceImageEntrySchema = object({
|
|
18129
|
+
filename: string(),
|
|
18130
|
+
stepIds: array(string()).readonly().optional()
|
|
18131
|
+
});
|
|
18132
|
+
var ReferenceImageBodySchema = object({
|
|
18133
|
+
base64: string(),
|
|
18134
|
+
filename: string()
|
|
18135
|
+
});
|
|
18136
|
+
var ReferenceAudioEntrySchema = object({
|
|
18137
|
+
filename: string(),
|
|
18138
|
+
sizeKb: number()
|
|
18139
|
+
});
|
|
18140
|
+
var ReferenceAudioBodySchema = object({ base64: string() });
|
|
18141
|
+
var AudioBackendSchema = object({
|
|
18142
|
+
id: string(),
|
|
18143
|
+
name: string(),
|
|
18144
|
+
description: string(),
|
|
18145
|
+
available: boolean(),
|
|
18146
|
+
/**
|
|
18147
|
+
* Raw classifier labels this backend can emit (e.g. YAMNet's
|
|
18148
|
+
* 521-class set or Apple SoundAnalysis's 303-class set). Used by
|
|
18149
|
+
* the benchmark UI to populate the `enabledMicroClasses` filter
|
|
18150
|
+
* specific to the selected backend without a separate fetch.
|
|
18151
|
+
*/
|
|
18152
|
+
rawLabels: array(string()).readonly().optional()
|
|
18153
|
+
});
|
|
18154
|
+
var AudioCapabilitiesSchema = object({
|
|
18155
|
+
activeBackend: string(),
|
|
18156
|
+
availableBackends: array(AudioBackendSchema).readonly(),
|
|
18157
|
+
sampleRate: number(),
|
|
18158
|
+
chunkDurationMs: number()
|
|
18159
|
+
});
|
|
18160
|
+
var DownloadModelResultSchema = object({
|
|
18161
|
+
filePath: string(),
|
|
18162
|
+
sizeMB: number(),
|
|
18163
|
+
durationMs: number()
|
|
18021
18164
|
});
|
|
18022
18165
|
/**
|
|
18023
|
-
*
|
|
18024
|
-
*
|
|
18025
|
-
*
|
|
18026
|
-
*
|
|
18027
|
-
*
|
|
18028
|
-
*
|
|
18029
|
-
*
|
|
18030
|
-
*
|
|
18031
|
-
* The spatial subsystems (tracker association, occupancy count, re-id /
|
|
18032
|
-
* embedding, resurrection) MUST skip every synthetic source. Test for that
|
|
18033
|
-
* with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
|
|
18034
|
-
* check silently readmits every source added after it was written.
|
|
18035
|
-
*/
|
|
18036
|
-
var TrackSourceSchema = _enum([
|
|
18037
|
-
"pipeline",
|
|
18038
|
-
"sensor",
|
|
18039
|
-
"audio"
|
|
18040
|
-
]);
|
|
18041
|
-
/**
|
|
18042
|
-
* Where a track sits in the RETRAIN lifecycle (D81).
|
|
18043
|
-
*
|
|
18044
|
-
* - `none` — never marked, or un-marked. Evictable.
|
|
18045
|
-
* - `staging` — the operator wants this track as training material and has not
|
|
18046
|
-
* finished with it. **This is the only state retention holds**: the track and
|
|
18047
|
-
* everything it owns (object events, crops, keyframes, CLIP vector) survive
|
|
18048
|
-
* the device's age window.
|
|
18049
|
-
* - `trained` — the retrain page has taken what it needed. The frames it chose
|
|
18050
|
-
* were COPIED into the retrain dataset at selection time, so the dataset no
|
|
18051
|
-
* longer depends on the track's media and the track becomes EVICTABLE again.
|
|
18052
|
-
* Terminal for the plain `markForTrain` toggle: returning it to `staging` is
|
|
18053
|
-
* a deliberate action of the retrain page, not a side effect of a checkbox.
|
|
18054
|
-
*
|
|
18055
|
-
* There is no `null`. The state is stored `TEXT NOT NULL DEFAULT 'none'` because
|
|
18056
|
-
* the store's filter language has only positive equality and `whereIn` — no
|
|
18057
|
-
* negation, no IS NULL — so a NULL would be unselectable by ANY predicate and
|
|
18058
|
-
* would make the entire pre-column history immortal in one deploy.
|
|
18166
|
+
* Wrapper carrying a single test run's result. Replaces the legacy
|
|
18167
|
+
* ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
|
|
18168
|
+
* canonical `AudioResult` from the Phase 6 output rework: one
|
|
18169
|
+
* `AudioDetection` per class above `minScore`, top-N candidates in
|
|
18170
|
+
* `debug.alternateLabels['audio-classifier']`, per-source timings in
|
|
18171
|
+
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
18172
|
+
* benchmark UI can still report a clean failure when the classifier
|
|
18173
|
+
* cap isn't available.
|
|
18059
18174
|
*/
|
|
18060
|
-
var
|
|
18061
|
-
|
|
18062
|
-
|
|
18063
|
-
|
|
18064
|
-
|
|
18175
|
+
var AudioTestResultSchema = object({
|
|
18176
|
+
success: boolean(),
|
|
18177
|
+
error: string().optional(),
|
|
18178
|
+
frame: custom().optional()
|
|
18179
|
+
});
|
|
18180
|
+
var PipelineConfigBridge = custom();
|
|
18181
|
+
var ConfigUISchemaBridge = custom();
|
|
18182
|
+
var ConfigUISchemaNullableBridge = custom();
|
|
18183
|
+
var InferenceCapabilitiesBridge = custom();
|
|
18184
|
+
var ModelAvailabilityListBridge = custom();
|
|
18185
|
+
var PipelineRunResultBridge = custom();
|
|
18065
18186
|
/**
|
|
18066
|
-
*
|
|
18067
|
-
* by the pipeline. Spread into `TrackSchema` and `KeyEventSchema` from one place
|
|
18068
|
-
* so the two surfaces cannot drift.
|
|
18069
|
-
*
|
|
18070
|
-
* **Absent ≠ false.** A track that has never been touched omits the field; an
|
|
18071
|
-
* explicitly un-flagged track carries `false`. Legacy rows written before the
|
|
18072
|
-
* columns existed read as absent, and a consumer that needs a boolean should say
|
|
18073
|
-
* `flag === true`, not `flag !== false`.
|
|
18074
|
-
*
|
|
18075
|
-
* `markForTrain` is the WIRE FACE of {@link RetrainStatusSchema}, not a column:
|
|
18076
|
-
* it is exactly `retrainStatus === 'staging'`, in both directions. Writing
|
|
18077
|
-
* `true` moves `none → staging`, writing `false` moves `staging → none`, and a
|
|
18078
|
-
* `trained` track reports `false` while refusing both writes. The boolean is
|
|
18079
|
-
* kept because three surfaces drive a toggle off it; anything that needs to tell
|
|
18080
|
-
* "never marked" from "already trained" must read `retrainStatus`.
|
|
18187
|
+
* Pipeline executor — detection engine + configuration + inference API.
|
|
18081
18188
|
*
|
|
18082
|
-
*
|
|
18189
|
+
* Merged from: pipeline-executor, pipeline-config, inference, detection-config.
|
|
18190
|
+
* Implemented by the detection-pipeline addon.
|
|
18083
18191
|
*
|
|
18084
|
-
*
|
|
18085
|
-
*
|
|
18086
|
-
*
|
|
18087
|
-
|
|
18088
|
-
|
|
18089
|
-
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
18090
|
-
* `'staging'`. */
|
|
18091
|
-
markForTrain: boolean().optional(),
|
|
18092
|
-
/** Operator marked this track for diagnostic attention. */
|
|
18093
|
-
debug: boolean().optional(),
|
|
18094
|
-
/** Operator favourited this track. Pins it against pruning. */
|
|
18095
|
-
favourited: boolean().optional()
|
|
18096
|
-
};
|
|
18097
|
-
/**
|
|
18098
|
-
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
18099
|
-
* Deliberately NOT part of {@link TrackFlagFields}: that group also builds the
|
|
18100
|
-
* write patch, and the status is not something the toggle sets — it is what the
|
|
18101
|
-
* toggle's boolean is derived from. Absent on an in-RAM track never touched;
|
|
18102
|
-
* always present on a persisted row (the column default materialises `'none'`).
|
|
18103
|
-
*/
|
|
18104
|
-
var TrackRetrainFields = { retrainStatus: RetrainStatusSchema.optional() };
|
|
18105
|
-
/**
|
|
18106
|
-
* The write half: a PARTIAL patch. An omitted key is left untouched, so setting
|
|
18107
|
-
* one flag can never clear the other — the toggles are independent and are
|
|
18108
|
-
* driven from three surfaces that do not know about each other.
|
|
18109
|
-
*/
|
|
18110
|
-
var TrackFlagsPatchSchema = object(TrackFlagFields);
|
|
18111
|
-
/**
|
|
18112
|
-
* The resolved flag state after a write. Both fields are REQUIRED here (absent
|
|
18113
|
-
* collapses to `false`) so a caller can drive a toggle's checked state off the
|
|
18114
|
-
* mutation result without a re-fetch.
|
|
18115
|
-
*/
|
|
18116
|
-
var TrackFlagsSchema = object({
|
|
18117
|
-
trackId: string(),
|
|
18118
|
-
markForTrain: boolean(),
|
|
18119
|
-
debug: boolean(),
|
|
18120
|
-
favourited: boolean(),
|
|
18121
|
-
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
18122
|
-
* a track row) because this shape is only ever produced by the write body,
|
|
18123
|
-
* which always knows it — and a surface that has just written needs to render
|
|
18124
|
-
* `trained` without a re-fetch. */
|
|
18125
|
-
retrainStatus: RetrainStatusSchema
|
|
18126
|
-
});
|
|
18127
|
-
union([literal(1), literal(2)]);
|
|
18128
|
-
/**
|
|
18129
|
-
* WHO decided a label, and when. Carried per tier so a value can be traced to
|
|
18130
|
-
* the step and model that produced it — which is what makes the write rule
|
|
18131
|
-
* arguable after the fact ("why is 592's label `dog` and not `Canis lupus`?")
|
|
18132
|
-
* and what lets a migrated, UNATTRIBUTED value be told apart from a real one.
|
|
18133
|
-
*
|
|
18134
|
-
* `stepId` is the pipeline step id (`animal-classifier`, `bird-classifier`,
|
|
18135
|
-
* `plate-ocr`, `face-embedding`, `object-detection`), or the sentinel
|
|
18136
|
-
* `migration:4g` for a value the 4g migration moved from the single-slot era —
|
|
18137
|
-
* that value has no provenance, and the write rule lets ANY properly-attributed
|
|
18138
|
-
* write of the same tier replace it regardless of score.
|
|
18139
|
-
*/
|
|
18140
|
-
var LabelAttributionSchema = object({
|
|
18141
|
-
stepId: string(),
|
|
18142
|
-
modelId: string().optional(),
|
|
18143
|
-
decidedAt: number(),
|
|
18144
|
-
/**
|
|
18145
|
-
* The GALLERY id behind a recognised tier-2 label — a face-gallery
|
|
18146
|
-
* `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
|
|
18147
|
-
*
|
|
18148
|
-
* The text alone is a DISPLAY NAME, and a display name is renameable: a
|
|
18149
|
-
* notification rule authored on "Gianluca" stopped matching the moment the
|
|
18150
|
-
* operator fixed the spelling in the gallery, and nothing said so. The id is
|
|
18151
|
-
* the thing that does not move, so it is what a rule matches on
|
|
18152
|
-
* (`NcConditions.identities`) and the text is what a human is shown.
|
|
18153
|
-
*
|
|
18154
|
-
* Absent when the label names no gallery row — a plate the OCR read but no
|
|
18155
|
-
* vehicle claims, a sub-class, a species, any tier-1 value.
|
|
18156
|
-
*/
|
|
18157
|
-
identityId: string().optional()
|
|
18158
|
-
});
|
|
18159
|
-
/**
|
|
18160
|
-
* The TIERED label model (roadmap 4g), spread into `TrackSchema` and
|
|
18161
|
-
* `ObjectEventSchema` from ONE place so the two surfaces cannot drift — a
|
|
18162
|
-
* track and its events always answer the same question the same way.
|
|
18163
|
-
*
|
|
18164
|
-
* Two scalar columns, not an array: every consumer wants "the coarse one" or
|
|
18165
|
-
* "the fine one", and an array made both a scan. `label` is tier 1, `subLabel`
|
|
18166
|
-
* is tier 2, and each carries its own score + attribution.
|
|
18167
|
-
*
|
|
18168
|
-
* **Reading it.** What a human should be shown is `subLabel ?? label` — the
|
|
18169
|
-
* finest thing known. Before 4g the single `label` column held the finest
|
|
18170
|
-
* value, so a consumer that has not been updated reads the tier-1 slot and
|
|
18171
|
-
* shows nothing on a species-only row; that is why the migration puts every
|
|
18172
|
-
* pre-4g value in tier 2 (it cannot regress a display that reads the fallback)
|
|
18173
|
-
* and why the read surfaces were changed in the same train.
|
|
18174
|
-
*
|
|
18175
|
-
* **Writing it.** The slots are independent, which is the whole point: a
|
|
18176
|
-
* tier-1 write (`bird`) can never overwrite a tier-2 value (`Turdus
|
|
18177
|
-
* migratorius`), so fineness cannot regress by construction. Within a tier the
|
|
18178
|
-
* higher score wins. One rule, one implementation — see
|
|
18179
|
-
* `pipeline/label-tier.ts` in addon-post-analysis.
|
|
18180
|
-
*/
|
|
18181
|
-
var TieredLabelFields = {
|
|
18182
|
-
/** Tier 1 — the sub-class. See {@link LabelTierSchema}. */
|
|
18183
|
-
label: string().optional(),
|
|
18184
|
-
/** Confidence of the tier-1 value, as reported by the deciding step. */
|
|
18185
|
-
labelScore: number().optional(),
|
|
18186
|
-
/** Provenance of the tier-1 value. See {@link LabelAttributionSchema}. */
|
|
18187
|
-
labelMeta: LabelAttributionSchema.optional(),
|
|
18188
|
-
/** Tier 2 — the instance. See {@link LabelTierSchema}. */
|
|
18189
|
-
subLabel: string().optional(),
|
|
18190
|
-
/** Confidence of the tier-2 value, as reported by the deciding step. */
|
|
18191
|
-
subLabelScore: number().optional(),
|
|
18192
|
-
/** Provenance of the tier-2 value. See {@link LabelAttributionSchema}. */
|
|
18193
|
-
subLabelMeta: LabelAttributionSchema.optional()
|
|
18194
|
-
};
|
|
18195
|
-
/** Per-camera slice of a training-export estimate. */
|
|
18196
|
-
var TrainingExportDeviceTotalsSchema = object({
|
|
18197
|
-
deviceId: number(),
|
|
18198
|
-
tracks: number().int(),
|
|
18199
|
-
files: number().int(),
|
|
18200
|
-
bytes: number().int()
|
|
18201
|
-
});
|
|
18202
|
-
/**
|
|
18203
|
-
* What a training export WOULD contain. Computed from media index rows only —
|
|
18204
|
-
* no blob is read to produce this.
|
|
18205
|
-
*/
|
|
18206
|
-
var TrainingExportSummarySchema = object({
|
|
18207
|
-
generatedAt: number(),
|
|
18208
|
-
trackCount: number().int(),
|
|
18209
|
-
fileCount: number().int(),
|
|
18210
|
-
byteCount: number().int(),
|
|
18211
|
-
/** More marked tracks exist than a single pass carries. */
|
|
18212
|
-
truncated: boolean(),
|
|
18213
|
-
devices: array(TrainingExportDeviceTotalsSchema).readonly()
|
|
18214
|
-
});
|
|
18215
|
-
var TrackSchema = object({
|
|
18216
|
-
trackId: string(),
|
|
18217
|
-
deviceId: number(),
|
|
18218
|
-
className: string(),
|
|
18219
|
-
...TieredLabelFields,
|
|
18220
|
-
producingDeviceName: string().optional(),
|
|
18221
|
-
/** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
|
|
18222
|
-
source: TrackSourceSchema.optional(),
|
|
18223
|
-
firstSeen: number(),
|
|
18224
|
-
lastSeen: number(),
|
|
18225
|
-
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
18226
|
-
positions: array(TrackPositionSchema).readonly(),
|
|
18227
|
-
/** Periodic snapshots at snapshotIntervalMs cadence (subject to
|
|
18228
|
-
* saveThumbnails policy). */
|
|
18229
|
-
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
18230
|
-
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
18231
|
-
zonesVisited: array(string()).readonly(),
|
|
18232
|
-
/**
|
|
18233
|
-
* Human NAMES for {@link zonesVisited}, resolved at READ time against the
|
|
18234
|
-
* `zones` capability.
|
|
18235
|
-
*
|
|
18236
|
-
* `zonesVisited` persists ids (`cfeec78c-8d69-…`), which no operator can type
|
|
18237
|
-
* and no card can render — so every free-text search surface was structurally
|
|
18238
|
-
* unable to answer "show me the tracks in Uscio", and did not fail loudly, it
|
|
18239
|
-
* just returned nothing. Resolving here rather than in each client keeps ONE
|
|
18240
|
-
* derivation and costs the clients no extra call (the `zones` cap is
|
|
18241
|
-
* per-device, so a client-side resolve would be a per-camera fan-out on a
|
|
18242
|
-
* surface built to avoid exactly that).
|
|
18243
|
-
*
|
|
18244
|
-
* Resolved, never invented: a zone deleted since the track was written has no
|
|
18245
|
-
* name and is DROPPED, so this array can be shorter than `zonesVisited` — the
|
|
18246
|
-
* two are not positionally aligned. Absent when the track visited no zone, or
|
|
18247
|
-
* when the zone catalogue could not be read.
|
|
18248
|
-
*/
|
|
18249
|
-
zoneNames: array(string()).readonly().optional(),
|
|
18250
|
-
/** Deduplicated set of detector classes observed for this track over its
|
|
18251
|
-
* life (a track may be reclassified, e.g. person→vehicle). Absent on
|
|
18252
|
-
* legacy rows written before class accumulation shipped. */
|
|
18253
|
-
classes: array(string()).readonly().optional(),
|
|
18254
|
-
/** Cumulative normalized distance travelled (0..1 units = full frame width). */
|
|
18255
|
-
totalDistance: number(),
|
|
18256
|
-
state: TrackStateSchema,
|
|
18257
|
-
active: boolean(),
|
|
18258
|
-
/** Deterministic key-event importance score in [0,1] (server-computed at
|
|
18259
|
-
* track expiry, recomputed on late label). Absent on legacy rows written
|
|
18260
|
-
* before scoring shipped — consumers degrade to absence / compute-on-read. */
|
|
18261
|
-
importance: number().optional(),
|
|
18262
|
-
/** Id of the track's highest-confidence ObjectEvent (its representative
|
|
18263
|
-
* "best" frame). Absent when the track produced no object events. */
|
|
18264
|
-
bestEventId: string().optional(),
|
|
18265
|
-
/** Tag of the importance sub-signal that dominated the score
|
|
18266
|
-
* (identity|dwell|proximity|class|confidence|travel|zone). */
|
|
18267
|
-
importanceReason: string().optional(),
|
|
18268
|
-
/** Audio-classification labels heard on the camera during the track's
|
|
18269
|
-
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
18270
|
-
* Absent on legacy rows / tracks with no confident audio. */
|
|
18271
|
-
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
18272
|
-
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
18273
|
-
* Populated from the persisted envelope columns on historical reads;
|
|
18274
|
-
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
18275
|
-
envelope: TrackEnvelopeSchema.optional(),
|
|
18276
|
-
/**
|
|
18277
|
-
* A face DETECTOR found a face on this track — nothing more. It says the
|
|
18278
|
-
* detail plane produced a `face` detail; it does NOT say the face was
|
|
18279
|
-
* embedded, matched, above `minFacePx`, or that the recognizer was even
|
|
18280
|
-
* enabled. Set once and never cleared.
|
|
18281
|
-
*
|
|
18282
|
-
* **This exists so "face present but not recognised" is expressible.** A
|
|
18283
|
-
* recognised identity lands in `subLabel` (attributed to the face chain via
|
|
18284
|
-
* `subLabelMeta.stepId`), so before this field a track with an unmatched face
|
|
18285
|
-
* and a track with no face at all were byte-identical on the wire and no
|
|
18286
|
-
* surface could tell them apart. The read is `hasFace === true && subLabel
|
|
18287
|
-
* === undefined`.
|
|
18288
|
-
*
|
|
18289
|
-
* **Absent ≠ false.** Every row written before the column existed omits it,
|
|
18290
|
-
* and so does every server that predates the field — a consumer must test
|
|
18291
|
-
* `=== true` and render nothing otherwise, never infer "no face".
|
|
18292
|
-
*/
|
|
18293
|
-
hasFace: boolean().optional(),
|
|
18294
|
-
/**
|
|
18295
|
-
* This track has a face row IN THE GALLERY: a crop **and** an embedding — a
|
|
18296
|
-
* face an operator could ASSIGN to an identity.
|
|
18297
|
-
*
|
|
18298
|
-
* The STRICT twin of {@link hasFace}, and the pair only earns its keep
|
|
18299
|
-
* because the two disagree. `hasFace` is stamped at the TOP of the face
|
|
18300
|
-
* branch, before every gate, and means no more than "a face detector produced
|
|
18301
|
-
* a face detail". This one is stamped at the single moment the gallery row
|
|
18302
|
-
* LANDS — after `FaceRecognizer.onTrackEnd` successfully persists it, i.e.
|
|
18303
|
-
* past the embedding-magnitude verdict, the `minFacePx` detection gate, the
|
|
18304
|
-
* candidate gate, the imageless-track drop (no crop was ever captured) and
|
|
18305
|
-
* the crop-store drop. Everything between the detector and that insert can
|
|
18306
|
-
* legitimately refuse the face, so a flag written any earlier promises the
|
|
18307
|
-
* operator something to assign and delivers nothing.
|
|
18308
|
-
*
|
|
18309
|
-
* **Independent of recognition.** A face collected but never auto-matched is
|
|
18310
|
-
* still assignable — it is in fact the face an operator most wants to reach —
|
|
18311
|
-
* so this is NOT gated on `recognizedIdentityId`. Recognition lands in
|
|
18312
|
-
* `subLabel`; this says only that the raw material exists.
|
|
18313
|
-
*
|
|
18314
|
-
* **Set once, never cleared.** A track that produced a gallery row produced
|
|
18315
|
-
* one; deleting the row later is the gallery's business, not this flag's.
|
|
18316
|
-
*
|
|
18317
|
-
* **Absent ≠ false**, the same rule as {@link hasFace}: every row written
|
|
18318
|
-
* before the column omits it, and so does every server that predates the
|
|
18319
|
-
* field. A consumer must test `=== true` and render nothing otherwise —
|
|
18320
|
-
* never infer "no assignable face".
|
|
18321
|
-
*/
|
|
18322
|
-
hasEmbeddedFace: boolean().optional(),
|
|
18323
|
-
/**
|
|
18324
|
-
* This subject CONTAINS a folded rider — a person the rider-pairing step
|
|
18325
|
-
* ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
|
|
18326
|
-
* so the passage is tracked once and as a VEHICLE.
|
|
18327
|
-
*
|
|
18328
|
-
* It exists because the fold's record was dishonest. D34 and the code both
|
|
18329
|
-
* said "the person is not lost — it is reported so both entities stay on the
|
|
18330
|
-
* record"; in fact the pair went into a per-processor RAM field behind an
|
|
18331
|
-
* accessor nobody called, and every durable surface said `vehicle`, full
|
|
18332
|
-
* stop. This is the composition note that makes the row true.
|
|
18333
|
-
*
|
|
18334
|
-
* A COMPOSITION, never a class and never a label. "This vehicle contains a
|
|
18335
|
-
* person" is not an answer to "what is this" — both label tiers would refuse
|
|
18336
|
-
* a macro token anyway (D89), and correctly. Nothing here changes what the
|
|
18337
|
-
* subject IS: a cyclist stays one vehicle track, occupancy still counts one,
|
|
18338
|
-
* and a `person` rule still does not fire for someone cycling past.
|
|
18339
|
-
*
|
|
18340
|
-
* **Absent ≠ false**, exactly like {@link hasFace}: every row written before
|
|
18341
|
-
* the column, and every hub that predates the field, omits it. Test
|
|
18342
|
-
* `=== true` and render nothing otherwise — never infer "no rider".
|
|
18343
|
-
*/
|
|
18344
|
-
hasRider: boolean().optional(),
|
|
18345
|
-
...TrackFlagFields,
|
|
18346
|
-
...TrackRetrainFields
|
|
18347
|
-
});
|
|
18348
|
-
var BaseEventFields = {
|
|
18349
|
-
id: string(),
|
|
18350
|
-
deviceId: number(),
|
|
18351
|
-
timestamp: number()
|
|
18352
|
-
};
|
|
18353
|
-
var MotionEventSchema = object({
|
|
18354
|
-
...BaseEventFields,
|
|
18355
|
-
kind: literal("motion"),
|
|
18356
|
-
regionCount: number(),
|
|
18357
|
-
/** Heavy JSON array — omitted in slim projection. */
|
|
18358
|
-
regions: array(object({
|
|
18359
|
-
bbox: BoundingBoxSchema,
|
|
18360
|
-
pixelCount: number(),
|
|
18361
|
-
intensity: number()
|
|
18362
|
-
})).readonly().optional(),
|
|
18363
|
-
/** Omitted in slim projection. */
|
|
18364
|
-
frameWidth: number().optional(),
|
|
18365
|
-
/** Omitted in slim projection. */
|
|
18366
|
-
frameHeight: number().optional(),
|
|
18367
|
-
/** Populated by B5 (recording playback URL for this event). */
|
|
18368
|
-
mediaUrl: string().optional()
|
|
18369
|
-
});
|
|
18370
|
-
/**
|
|
18371
|
-
* Which detection SOURCE produced an object event. `pipeline` = the ML
|
|
18372
|
-
* detection pipeline (decoded-frame inference); `onboard` = the camera's
|
|
18373
|
-
* native on-device AI. Both flow through the SAME analysis layers (zoning,
|
|
18374
|
-
* tracking, per-kind persistence) but stay distinguishable so consumers
|
|
18375
|
-
* (advanced-notifier, occupancy, …) can select which source(s) to act on.
|
|
18376
|
-
* Absent on legacy rows ⇒ treat as `pipeline`.
|
|
18377
|
-
*/
|
|
18378
|
-
var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
|
|
18379
|
-
/**
|
|
18380
|
-
* The confirmed zone crossing that produced an object event. Present ONLY on
|
|
18381
|
-
* an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
|
|
18382
|
-
* event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
|
|
18383
|
-
* appearance event carry none, so a rule asking for a direction fails closed
|
|
18384
|
-
* on them.
|
|
18385
|
-
*
|
|
18386
|
-
* Exactly ONE crossing per event: the emitter turns each confirmed crossing
|
|
18387
|
-
* into its own event, so a frame in which a track enters A while leaving B
|
|
18388
|
-
* produces two events with two directions — never one ambiguous row.
|
|
18389
|
-
*
|
|
18390
|
-
* `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
|
|
18391
|
-
* membership the box has NOW, and by definition it no longer contains the zone
|
|
18392
|
-
* that was just left. Without the id here, a zone-scoped rule could never match
|
|
18393
|
-
* the exit it asked for.
|
|
18394
|
-
*/
|
|
18395
|
-
var ZoneCrossingSchema = object({
|
|
18396
|
-
direction: _enum(["enter", "exit"]),
|
|
18397
|
-
/** Admin zone id crossed. */
|
|
18398
|
-
zoneId: string(),
|
|
18399
|
-
/** Zone display name at crossing time (falls back to the id). */
|
|
18400
|
-
zoneName: string().optional()
|
|
18401
|
-
});
|
|
18402
|
-
var ObjectEventSchema = object({
|
|
18403
|
-
...BaseEventFields,
|
|
18404
|
-
kind: literal("object"),
|
|
18405
|
-
/** Detection source. Optional for backward-compat; absent ⇒ `pipeline`. */
|
|
18406
|
-
source: DetectionSourceSchema.optional(),
|
|
18407
|
-
/**
|
|
18408
|
-
* Inference-frame id shared by every object event emitted from the SAME frame
|
|
18409
|
-
* — the "scene/parent" key. Lets a consumer group co-occurring detections (e.g.
|
|
18410
|
-
* 2 people + 1 dog) under one full frame, and link a track's frames over time
|
|
18411
|
-
* (group by `trackId`, pick a representative `frameId` as the parent frame).
|
|
18412
|
-
* Optional for backward-compat with pre-existing rows / the slim projection
|
|
18413
|
-
* includes it (it is light). Absent on rows written before this field.
|
|
18414
|
-
*/
|
|
18415
|
-
frameId: string().optional(),
|
|
18416
|
-
/** Omitted in slim projection. */
|
|
18417
|
-
trackId: string().optional(),
|
|
18418
|
-
className: string(),
|
|
18419
|
-
...TieredLabelFields,
|
|
18420
|
-
/** Omitted in slim projection. */
|
|
18421
|
-
confidence: number().optional(),
|
|
18422
|
-
/** Heavy JSON — omitted in slim projection. */
|
|
18423
|
-
bbox: BoundingBoxSchema.optional(),
|
|
18424
|
-
/** Heavy JSON — omitted in slim projection. */
|
|
18425
|
-
zones: array(string()).readonly().optional(),
|
|
18426
|
-
/** Omitted in slim projection. */
|
|
18427
|
-
state: TrackStateSchema.optional(),
|
|
18428
|
-
/**
|
|
18429
|
-
* The zone crossing this event IS, when it is one. Absent on every other
|
|
18430
|
-
* event kind (movement state, appearance, package) — see
|
|
18431
|
-
* {@link ZoneCrossingSchema}. Omitted in slim projection.
|
|
18432
|
-
*/
|
|
18433
|
-
zoneCrossing: ZoneCrossingSchema.optional(),
|
|
18434
|
-
/** Detection-frame dimensions in pixels — let consumers normalize the
|
|
18435
|
-
* pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
|
|
18436
|
-
frameWidth: number().optional(),
|
|
18437
|
-
frameHeight: number().optional(),
|
|
18438
|
-
/** MediaStore key for the crop attached to this event (if any). */
|
|
18439
|
-
mediaKey: string().optional(),
|
|
18440
|
-
/** Design B: MediaStore key of the track's native-resolution key frame (the
|
|
18441
|
-
* best-detection full frame). Resolve via the event-media data-plane
|
|
18442
|
-
* (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
|
|
18443
|
-
* draws `bbox` over the native frame. Absent on legacy rows / non-decoded
|
|
18444
|
-
* sources — consumers fall back to `mediaKey` (the tight crop). */
|
|
18445
|
-
keyFrameMediaKey: string().optional(),
|
|
18446
|
-
/** Populated by B5 (recording playback URL for this event). */
|
|
18447
|
-
mediaUrl: string().optional(),
|
|
18448
|
-
/** The parent track's key-event importance [0,1], propagated to every object
|
|
18449
|
-
* event of the track (so an event row can be sorted by importance without a
|
|
18450
|
-
* track join). Absent on legacy rows / before the track was scored. */
|
|
18451
|
-
importance: number().optional()
|
|
18452
|
-
});
|
|
18453
|
-
var AudioEventSchema = object({
|
|
18454
|
-
...BaseEventFields,
|
|
18455
|
-
kind: literal("audio"),
|
|
18456
|
-
rms: number(),
|
|
18457
|
-
dbfs: number(),
|
|
18458
|
-
classification: object({
|
|
18459
|
-
className: string(),
|
|
18460
|
-
originalClass: string().optional(),
|
|
18461
|
-
score: number()
|
|
18462
|
-
}).optional(),
|
|
18463
|
-
/** Populated by B5 (recording playback URL for this event). */
|
|
18464
|
-
mediaUrl: string().optional()
|
|
18465
|
-
});
|
|
18466
|
-
var MediaFileKindEnum = _enum([
|
|
18467
|
-
"crop",
|
|
18468
|
-
"thumbnail",
|
|
18469
|
-
"snapshot",
|
|
18470
|
-
"firstFrame",
|
|
18471
|
-
"lastFrame",
|
|
18472
|
-
"fullFrame",
|
|
18473
|
-
"fullFrameBoxed",
|
|
18474
|
-
"faceCrop",
|
|
18475
|
-
"plateCrop",
|
|
18476
|
-
"keyFrame",
|
|
18477
|
-
"keyFrameSmall",
|
|
18478
|
-
"thumbnailSmall"
|
|
18479
|
-
]);
|
|
18480
|
-
var MediaFileSchema = object({
|
|
18481
|
-
key: string(),
|
|
18482
|
-
kind: MediaFileKindEnum,
|
|
18483
|
-
base64: string(),
|
|
18484
|
-
sizeBytes: number(),
|
|
18485
|
-
timestamp: number()
|
|
18486
|
-
});
|
|
18487
|
-
/**
|
|
18488
|
-
* One media row WITHOUT its bytes.
|
|
18489
|
-
*
|
|
18490
|
-
* A track's media is 5-8 MB of base64 (measured: 7.67 MB across 23 files for a
|
|
18491
|
-
* 140 s track), and a client that renders tiles from the media data plane needs
|
|
18492
|
-
* to know only WHAT EXISTS — the bytes then arrive per tile, lazily, over HTTP
|
|
18493
|
-
* with an immutable cache, instead of all at once inside a tRPC response that
|
|
18494
|
-
* blocks the whole view.
|
|
18495
|
-
*
|
|
18496
|
-
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
18497
|
-
* stored blob and a `?variant=thumb` rendering without fetching either.
|
|
18498
|
-
*/
|
|
18499
|
-
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
18500
|
-
/**
|
|
18501
|
-
* The MACRO tier of an annotation — a CLOSED set.
|
|
18502
|
-
*
|
|
18503
|
-
* This is what the exported detector predicts, so a typo here is a new class
|
|
18504
|
-
* with one example in it. `label` and `subLabel` are open strings by contrast:
|
|
18505
|
-
* the whole point of the page is teaching the model things it does not know
|
|
18506
|
-
* yet, and constraining that vocabulary would make it useless.
|
|
18507
|
-
*
|
|
18508
|
-
* A macro class is NEVER a label. The provider refuses a write whose `label` or
|
|
18509
|
-
* `subLabel` is one of these values, in any casing, because once `person`
|
|
18510
|
-
* exists in both tiers "every person box" stops being answerable without
|
|
18511
|
-
* knowing every string anyone ever typed — and the damage is retroactive.
|
|
18512
|
-
*/
|
|
18513
|
-
var RetrainMacroClassSchema = _enum([
|
|
18514
|
-
"person",
|
|
18515
|
-
"vehicle",
|
|
18516
|
-
"animal",
|
|
18517
|
-
"package",
|
|
18518
|
-
"face",
|
|
18519
|
-
"plate"
|
|
18520
|
-
]);
|
|
18521
|
-
/** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
|
|
18522
|
-
var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
|
|
18523
|
-
/** Did a human draw this box, or did the assist propose it? */
|
|
18524
|
-
var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
|
|
18525
|
-
/** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
|
|
18526
|
-
var RetrainBboxSchema = object({
|
|
18527
|
-
x: number(),
|
|
18528
|
-
y: number(),
|
|
18529
|
-
w: number(),
|
|
18530
|
-
h: number()
|
|
18531
|
-
});
|
|
18532
|
-
/**
|
|
18533
|
-
* One annotated subject.
|
|
18534
|
-
*
|
|
18535
|
-
* `bbox` is normalised against the full frame, ALWAYS. The per-model shapes
|
|
18536
|
-
* (letterboxed root / zone-cropped package / subject-cropped classifier) are
|
|
18537
|
-
* derived from it at export and never stored — storing them is how one feature
|
|
18538
|
-
* space ends up holding two crops of the same subject (D52).
|
|
18539
|
-
*/
|
|
18540
|
-
var RetrainAnnotationSchema = object({
|
|
18541
|
-
id: string(),
|
|
18542
|
-
trackId: string(),
|
|
18543
|
-
deviceId: number(),
|
|
18544
|
-
/** The COPY in retrain storage — never the source track's media key. */
|
|
18545
|
-
mediaKey: string(),
|
|
18546
|
-
bbox: RetrainBboxSchema,
|
|
18547
|
-
macroClass: RetrainMacroClassSchema,
|
|
18548
|
-
label: string().optional(),
|
|
18549
|
-
subLabel: string().optional(),
|
|
18550
|
-
kind: RetrainAnnotationKindSchema,
|
|
18551
|
-
source: RetrainAnnotationSourceSchema,
|
|
18552
|
-
/** Which model proposed this box — or, on a `model_error`, drew the phantom. */
|
|
18553
|
-
assistModelId: string().optional(),
|
|
18554
|
-
assistScore: number().optional(),
|
|
18555
|
-
exportedInBatch: string().optional(),
|
|
18556
|
-
createdAt: number()
|
|
18557
|
-
});
|
|
18558
|
-
/** The write form — the server owns `id`, `createdAt` and the frame binding. */
|
|
18559
|
-
var RetrainAnnotationDraftSchema = RetrainAnnotationSchema.omit({
|
|
18560
|
-
id: true,
|
|
18561
|
-
trackId: true,
|
|
18562
|
-
deviceId: true,
|
|
18563
|
-
mediaKey: true,
|
|
18564
|
-
createdAt: true,
|
|
18565
|
-
exportedInBatch: true
|
|
18566
|
-
});
|
|
18567
|
-
/** A track sitting in `staging`, with everything the worklist needs to rank it. */
|
|
18568
|
-
var RetrainTrackSchema = object({
|
|
18569
|
-
trackId: string(),
|
|
18570
|
-
deviceId: number(),
|
|
18571
|
-
className: string(),
|
|
18572
|
-
label: string().optional(),
|
|
18573
|
-
firstSeen: number(),
|
|
18574
|
-
lastSeen: number(),
|
|
18575
|
-
/** How many frames the dataset already holds from this track. */
|
|
18576
|
-
frameCount: number().int(),
|
|
18577
|
-
/** How many subjects have been annotated on those frames. `0` with
|
|
18578
|
-
* `frameCount: 0` is exactly "staging, still to work". */
|
|
18579
|
-
annotationCount: number().int()
|
|
18580
|
-
});
|
|
18581
|
-
/** A frame the picker may offer — an index row, no blob was read to produce it. */
|
|
18582
|
-
var RetrainFrameCandidateSchema = object({
|
|
18583
|
-
mediaKey: string(),
|
|
18584
|
-
kind: MediaFileKindEnum,
|
|
18585
|
-
timestamp: number(),
|
|
18586
|
-
sizeBytes: number().int(),
|
|
18587
|
-
/** A copy of this original already exists — selecting it is free and cannot
|
|
18588
|
-
* fail, whatever became of the original. */
|
|
18589
|
-
copied: boolean()
|
|
18590
|
-
});
|
|
18591
|
-
/** A frame the dataset OWNS: bytes copied at selection time. */
|
|
18592
|
-
var RetrainFrameSchema = object({
|
|
18593
|
-
frameId: string(),
|
|
18594
|
-
deviceId: number(),
|
|
18595
|
-
trackId: string(),
|
|
18596
|
-
/** Provenance only. It may already point at nothing — that is expected. */
|
|
18597
|
-
sourceMediaKey: string(),
|
|
18598
|
-
sourceKind: MediaFileKindEnum,
|
|
18599
|
-
sizeBytes: number().int(),
|
|
18600
|
-
width: number().int(),
|
|
18601
|
-
height: number().int(),
|
|
18602
|
-
copiedAt: number()
|
|
18603
|
-
});
|
|
18604
|
-
/** Why a copy-on-select could not be honoured — named, never a silent skip. */
|
|
18605
|
-
var RetrainCopyRefusalSchema = _enum([
|
|
18606
|
-
"source-missing",
|
|
18607
|
-
"unreadable-image",
|
|
18608
|
-
"write-failed"
|
|
18609
|
-
]);
|
|
18610
|
-
var RetrainFrameSelectionSchema = object({
|
|
18611
|
-
copied: array(RetrainFrameSchema).readonly(),
|
|
18612
|
-
refused: array(object({
|
|
18613
|
-
sourceMediaKey: string(),
|
|
18614
|
-
reason: RetrainCopyRefusalSchema
|
|
18615
|
-
})).readonly()
|
|
18616
|
-
});
|
|
18617
|
-
var RetrainFrameListSchema = object({
|
|
18618
|
-
candidates: array(RetrainFrameCandidateSchema).readonly(),
|
|
18619
|
-
copies: array(RetrainFrameSchema).readonly(),
|
|
18620
|
-
/** What the page pre-selects — the native key frame when one survives. */
|
|
18621
|
-
autoPickMediaKey: string().optional()
|
|
18622
|
-
});
|
|
18623
|
-
/** What the operator asked the assist to look for. */
|
|
18624
|
-
var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
|
|
18625
|
-
kind: literal("package"),
|
|
18626
|
-
zone: RetrainBboxSchema.optional()
|
|
18627
|
-
}), object({
|
|
18628
|
-
kind: literal("objects"),
|
|
18629
|
-
modelId: string(),
|
|
18630
|
-
minScore: number().optional()
|
|
18631
|
-
})]);
|
|
18632
|
-
/**
|
|
18633
|
-
* The assist's answer — a discriminated union, because "the model saw nothing"
|
|
18634
|
-
* and "this node cannot run that model" lead to different next moves and a
|
|
18635
|
-
* nullable result cannot tell them apart.
|
|
18636
|
-
*/
|
|
18637
|
-
var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
|
|
18638
|
-
kind: literal("proposed"),
|
|
18639
|
-
modelId: string(),
|
|
18640
|
-
stepId: string(),
|
|
18641
|
-
minScore: number(),
|
|
18642
|
-
/** Drafts, ready to edit. `source: 'assist'` until the operator touches one. */
|
|
18643
|
-
proposals: array(RetrainAnnotationDraftSchema).readonly(),
|
|
18644
|
-
/** Returned by the runner but removed by the threshold. */
|
|
18645
|
-
belowThreshold: number().int()
|
|
18646
|
-
}), object({
|
|
18647
|
-
kind: literal("refused"),
|
|
18648
|
-
/** `no-zone` is ours; the rest are the runner's own refusal vocabulary. */
|
|
18649
|
-
reason: string(),
|
|
18650
|
-
detail: string().optional()
|
|
18651
|
-
})]);
|
|
18652
|
-
/** The outcome of a lifecycle move owned by the retrain page. */
|
|
18653
|
-
var RetrainTransitionResultSchema = object({
|
|
18654
|
-
trackId: string(),
|
|
18655
|
-
/** Where the track ended up, whatever happened. */
|
|
18656
|
-
retrainStatus: RetrainStatusSchema,
|
|
18657
|
-
/** `false` ⇒ the move was refused or was a no-op; `reason` says which. */
|
|
18658
|
-
changed: boolean(),
|
|
18659
|
-
reason: _enum([
|
|
18660
|
-
"unknown-track",
|
|
18661
|
-
"no-frames-copied",
|
|
18662
|
-
"not-staging",
|
|
18663
|
-
"not-trained",
|
|
18664
|
-
"unchanged"
|
|
18665
|
-
]).optional()
|
|
18666
|
-
});
|
|
18667
|
-
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
18668
|
-
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
18669
|
-
var DeviceEventQueryInput = object({
|
|
18670
|
-
deviceId: number(),
|
|
18671
|
-
since: number().optional(),
|
|
18672
|
-
until: number().optional(),
|
|
18673
|
-
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
18674
|
-
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
18675
|
-
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
18676
|
-
* exact behaviour. Callers may omit this field — the store defaults to
|
|
18677
|
-
* `full` when not provided. */
|
|
18678
|
-
projection: _enum(["full", "slim"]).optional()
|
|
18679
|
-
});
|
|
18680
|
-
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
18681
|
-
var RecentTracksQueryInput = object({
|
|
18682
|
-
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
18683
|
-
deviceIds: array(number()),
|
|
18684
|
-
/** Window lower bound on `lastSeen` (inclusive). */
|
|
18685
|
-
since: number().optional(),
|
|
18686
|
-
/** Window upper bound on `lastSeen` (inclusive). */
|
|
18687
|
-
until: number().optional(),
|
|
18688
|
-
/** Page size. Default 200, max 1000. */
|
|
18689
|
-
limit: number().int().min(1).max(1e3).default(200),
|
|
18690
|
-
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
18691
|
-
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
18692
|
-
cursor: string().optional(),
|
|
18693
|
-
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
18694
|
-
projection: TrackProjectionSchema.optional(),
|
|
18695
|
-
/** Include stationary-promoted rows (parked objects). Default false: the
|
|
18696
|
-
* feed lists passages; parking records live on the stationary registry. */
|
|
18697
|
-
includeStationary: boolean().optional()
|
|
18698
|
-
});
|
|
18699
|
-
var RecentTracksPageSchema = object({
|
|
18700
|
-
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
18701
|
-
tracks: array(TrackSchema).readonly(),
|
|
18702
|
-
/** Cursor for the next page, or null when this page is the last. */
|
|
18703
|
-
nextCursor: string().nullable()
|
|
18704
|
-
});
|
|
18705
|
-
var LIST_GROUPS_DEFAULT_LIMIT = 40;
|
|
18706
|
-
var LIST_GROUPS_MAX_LIMIT = 100;
|
|
18707
|
-
var AnalyticsGroupRecordSchema = object({
|
|
18708
|
-
id: string(),
|
|
18709
|
-
deviceId: number().int(),
|
|
18710
|
-
openedAt: number().int(),
|
|
18711
|
-
closedAt: number().int(),
|
|
18712
|
-
timestamp: number().int(),
|
|
18713
|
-
memberCount: number().int(),
|
|
18714
|
-
memberTrackIds: array(string()).readonly(),
|
|
18715
|
-
className: string(),
|
|
18716
|
-
classes: array(string()).readonly(),
|
|
18717
|
-
/** Relative event-media path, or null when the group has no picture yet. */
|
|
18718
|
-
mediaUrl: string().nullable(),
|
|
18719
|
-
singleton: boolean()
|
|
18720
|
-
});
|
|
18721
|
-
var AnalyticsGroupMemberSchema = object({
|
|
18722
|
-
trackId: string(),
|
|
18723
|
-
deviceId: number().int(),
|
|
18724
|
-
className: string(),
|
|
18725
|
-
firstSeen: number().int(),
|
|
18726
|
-
lastSeen: number().int(),
|
|
18727
|
-
mediaUrl: string().nullable()
|
|
18728
|
-
});
|
|
18729
|
-
var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
|
|
18730
|
-
var ListGroupsQueryInput = object({
|
|
18731
|
-
/** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
|
|
18732
|
-
deviceIds: array(number()),
|
|
18733
|
-
/** Window lower bound on `closedAt` (inclusive). */
|
|
18734
|
-
since: number().optional(),
|
|
18735
|
-
/** Window upper bound on `openedAt` (inclusive). */
|
|
18736
|
-
until: number().optional(),
|
|
18737
|
-
limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
|
|
18738
|
-
/** Opaque continuation cursor from a previous page's `nextCursor`. */
|
|
18739
|
-
cursor: string().optional()
|
|
18740
|
-
});
|
|
18741
|
-
var ListGroupsPageSchema = object({
|
|
18742
|
-
groups: array(AnalyticsGroupRecordSchema).readonly(),
|
|
18743
|
-
nextCursor: string().nullable()
|
|
18744
|
-
});
|
|
18745
|
-
var KeyEventQueryInput = object({
|
|
18746
|
-
deviceId: number(),
|
|
18747
|
-
/** Window lower bound (track firstSeen ≥ since). */
|
|
18748
|
-
since: number(),
|
|
18749
|
-
/** Window upper bound (track firstSeen ≤ until). */
|
|
18750
|
-
until: number(),
|
|
18751
|
-
limit: number().int().min(1).max(200).default(50),
|
|
18752
|
-
/** Drop tracks scoring below this importance. */
|
|
18753
|
-
minImportance: number().min(0).max(1).optional(),
|
|
18754
|
-
/** Restrict to a single class (e.g. 'person'). */
|
|
18755
|
-
classFilter: string().optional()
|
|
18756
|
-
});
|
|
18757
|
-
var KeyEventSchema = object({
|
|
18758
|
-
/** The representative event id (the track's best ObjectEvent, else its trackId). */
|
|
18759
|
-
id: string(),
|
|
18760
|
-
trackId: string(),
|
|
18761
|
-
/** Track start time (firstSeen). */
|
|
18762
|
-
timestamp: number(),
|
|
18763
|
-
className: string(),
|
|
18764
|
-
...TieredLabelFields,
|
|
18765
|
-
importance: number(),
|
|
18766
|
-
/** Highest-confidence ObjectEvent id for the track (empty when none). */
|
|
18767
|
-
bestEventId: string(),
|
|
18768
|
-
/** Track lifetime in ms (lastSeen - firstSeen). */
|
|
18769
|
-
windowMs: number().optional(),
|
|
18770
|
-
...TrackFlagFields,
|
|
18771
|
-
...TrackRetrainFields
|
|
18772
|
-
});
|
|
18773
|
-
object({
|
|
18774
|
-
trackId: string(),
|
|
18775
|
-
className: string(),
|
|
18776
|
-
confidence: number(),
|
|
18777
|
-
bbox: BoundingBoxSchema,
|
|
18778
|
-
zones: array(string()).readonly(),
|
|
18779
|
-
state: TrackStateSchema
|
|
18780
|
-
});
|
|
18781
|
-
var OverlayDetectionSchema = looseObject({
|
|
18782
|
-
id: string(),
|
|
18783
|
-
kind: _enum(["first-level", "detail"]),
|
|
18784
|
-
macroClass: string(),
|
|
18785
|
-
score: number(),
|
|
18786
|
-
bbox: object({
|
|
18787
|
-
x: number(),
|
|
18788
|
-
y: number(),
|
|
18789
|
-
width: number(),
|
|
18790
|
-
height: number()
|
|
18791
|
-
}),
|
|
18792
|
-
labels: array(looseObject({
|
|
18793
|
-
label: string(),
|
|
18794
|
-
score: number()
|
|
18795
|
-
})).readonly(),
|
|
18796
|
-
parentId: string().optional()
|
|
18797
|
-
});
|
|
18798
|
-
var ScoredObjectEventSchema = ObjectEventSchema.extend({ score: number() });
|
|
18799
|
-
var SearchObjectEventsInput = object({
|
|
18800
|
-
text: string(),
|
|
18801
|
-
deviceId: number().optional(),
|
|
18802
|
-
since: number().optional(),
|
|
18803
|
-
until: number().optional(),
|
|
18804
|
-
classFilter: string().optional(),
|
|
18805
|
-
limit: number().default(50),
|
|
18806
|
-
minScore: number().min(0).max(1).default(.2)
|
|
18807
|
-
});
|
|
18808
|
-
var TrackCascadeCountsSchema = object({
|
|
18809
|
-
/** Persisted track roots deleted (authoritative). */
|
|
18810
|
-
tracks: number().int(),
|
|
18811
|
-
/** Object events removed with their tracks (best-effort; see note above). */
|
|
18812
|
-
events: number().int(),
|
|
18813
|
-
/** Track/face/plate-owned media removed (best-effort). Never identity media. */
|
|
18814
|
-
media: number().int(),
|
|
18815
|
-
/** Unassigned (non-enrolled) face reads removed (best-effort). */
|
|
18816
|
-
faces: number().int(),
|
|
18817
|
-
/** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
|
|
18818
|
-
plates: number().int(),
|
|
18819
|
-
/** Per-track CLIP search vectors removed (best-effort). */
|
|
18820
|
-
embeddings: number().int(),
|
|
18821
|
-
/** Group membership + group rows removed with their last member (best-effort). */
|
|
18822
|
-
groups: number().int()
|
|
18823
|
-
});
|
|
18824
|
-
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
18825
|
-
var DiskReconcileCountsSchema = object({
|
|
18826
|
-
mediaDropped: number().int(),
|
|
18827
|
-
tracks: number().int(),
|
|
18828
|
-
events: number().int()
|
|
18829
|
-
});
|
|
18830
|
-
/** Event-store footprint for one camera. */
|
|
18831
|
-
var EventStoreDeviceFootprintSchema = object({
|
|
18832
|
-
deviceId: number(),
|
|
18833
|
-
/** Persisted event rows (motion + object + audio) for the camera. */
|
|
18834
|
-
rows: number().int(),
|
|
18835
|
-
/** Event-owned media bytes on disk for the camera. */
|
|
18836
|
-
bytes: number().int()
|
|
18837
|
-
});
|
|
18838
|
-
/** Aggregate event-store footprint: global totals + per-camera breakdown. */
|
|
18839
|
-
var EventStoreFootprintSchema = object({
|
|
18840
|
-
totalRows: number().int(),
|
|
18841
|
-
totalBytes: number().int(),
|
|
18842
|
-
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
18843
|
-
});
|
|
18844
|
-
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
18845
|
-
var EventPruneCountsSchema = object({
|
|
18846
|
-
motion: number().int(),
|
|
18847
|
-
object: number().int(),
|
|
18848
|
-
audio: number().int()
|
|
18849
|
-
});
|
|
18850
|
-
/**
|
|
18851
|
-
* Re-embed stored tracks from their key frames.
|
|
18852
|
-
*
|
|
18853
|
-
* The reason this is an operator-callable method and not a migration script:
|
|
18854
|
-
* every knob that decides what a vector MEANS — encoder model, crop margin,
|
|
18855
|
-
* squaring — is only changeable if the existing vectors can be regenerated.
|
|
18856
|
-
* Mixing feature spaces in one index makes cosine scores incomparable, and the
|
|
18857
|
-
* symptom is a quality regression with no visible cause.
|
|
18858
|
-
*/
|
|
18859
|
-
var RebuildObjectEmbeddingsInput = object({
|
|
18860
|
-
/** Restrict to one camera. Omit for the whole fleet. */
|
|
18861
|
-
deviceId: number().optional(),
|
|
18862
|
-
since: number().optional(),
|
|
18863
|
-
until: number().optional(),
|
|
18864
|
-
/** Stop after this many tracks; the result reports whether more remain. */
|
|
18865
|
-
maxTracks: number().int().positive().optional(),
|
|
18866
|
-
/**
|
|
18867
|
-
* Run every embedding on THIS node instead of round-robining the fleet.
|
|
18868
|
-
*
|
|
18869
|
-
* Named `executeOnNodeId` and not `nodeId` on purpose: an inline `nodeId`
|
|
18870
|
-
* field in cap args is read by `parent-unowned-call.ts` as a ROUTING PIN, so
|
|
18871
|
-
* calling it that would pin the rebuild REQUEST itself to that node — the
|
|
18872
|
-
* rebuild orchestration lives on the hub, and only the per-track step runs
|
|
18873
|
-
* remotely. This field is data; the per-track pin is applied inside.
|
|
18874
|
-
*
|
|
18875
|
-
* Absent ⇒ round-robin over every online node whose runner can serve the
|
|
18876
|
-
* pinned model.
|
|
18877
|
-
*/
|
|
18878
|
-
executeOnNodeId: string().optional(),
|
|
18879
|
-
/**
|
|
18880
|
-
* Milliseconds to wait between tracks; omit for the built-in default, `0` to
|
|
18881
|
-
* run flat out.
|
|
18882
|
-
*
|
|
18883
|
-
* A rebuild is bulk maintenance on hub-main's single thread. Measured
|
|
18884
|
-
* 2026-08-06, an unpaced pass held that thread busy 82.2 s out of 120 and
|
|
18885
|
-
* pushed `nodes.topology` from 0.25 s to 26 s for 43 minutes. The value in
|
|
18886
|
-
* force is logged at start and finish so a deliberately slow pass reads
|
|
18887
|
-
* differently from a stalled one.
|
|
18888
|
-
*/
|
|
18889
|
-
pacingMs: number().int().nonnegative().optional()
|
|
18890
|
-
});
|
|
18891
|
-
/**
|
|
18892
|
-
* Result of emptying the CLIP index.
|
|
18893
|
-
*
|
|
18894
|
-
* The clean slate before a policy change: a new crop margin or encoder model
|
|
18895
|
-
* leaves two feature spaces in one index whose cosine scores are not
|
|
18896
|
-
* comparable, so wiping and rebuilding is the only way to be sure every vector
|
|
18897
|
-
* means the same thing.
|
|
18898
|
-
*/
|
|
18899
|
-
var WipeObjectEmbeddingsResultSchema = object({ deleted: number() });
|
|
18900
|
-
/**
|
|
18901
|
-
* Acknowledgement that a rebuild STARTED.
|
|
18902
|
-
*
|
|
18903
|
-
* The pass costs ~1s per track — 45 minutes for a 2,600-track fleet — so it
|
|
18904
|
-
* runs detached and this returns immediately. Waiting for it made the client
|
|
18905
|
-
* time out while the work carried on server-side, which is the worst of both:
|
|
18906
|
-
* no result and no way to know it was still going. Poll
|
|
18907
|
-
* `getObjectEmbeddingRebuildStatus` for progress.
|
|
18908
|
-
*/
|
|
18909
|
-
var RebuildObjectEmbeddingsResultSchema = object({
|
|
18910
|
-
started: boolean(),
|
|
18911
|
-
/** True when a pass was already running; the new request is ignored. */
|
|
18912
|
-
alreadyRunning: boolean()
|
|
18913
|
-
});
|
|
18914
|
-
var RebuildStatusSchema = object({
|
|
18915
|
-
running: boolean(),
|
|
18916
|
-
scanned: number(),
|
|
18917
|
-
rebuilt: number(),
|
|
18918
|
-
/** Tracks whose key frame is gone — nothing to re-embed from. */
|
|
18919
|
-
missingKeyFrame: number(),
|
|
18920
|
-
/** Tracks with no usable detection box. */
|
|
18921
|
-
missingBbox: number(),
|
|
18922
|
-
/**
|
|
18923
|
-
* Tracks an executing node REFUSED rather than broke on — an unreadable key
|
|
18924
|
-
* frame, a step that threw. Separate from `failed` because the remedy is
|
|
18925
|
-
* different, and because a whole camera silently contributing zero vectors
|
|
18926
|
-
* is the shape of failure a rebuild must never hide.
|
|
18927
|
-
*/
|
|
18928
|
-
notRunnable: number(),
|
|
18929
|
-
/**
|
|
18930
|
-
* The pass stopped because NO node could serve the pinned model.
|
|
18931
|
-
*
|
|
18932
|
-
* Distinct from `notRunnable` on purpose: that one says "this track was
|
|
18933
|
-
* refused", this one says "the cluster cannot do this work at all" — every
|
|
18934
|
-
* candidate node either lacks the `clip-embedding` step, lacks a build of the
|
|
18935
|
-
* pinned model for its engine format, or dropped out. The remedy is a model /
|
|
18936
|
-
* engine change, not a per-camera one. Non-zero here always comes with
|
|
18937
|
-
* `complete: false`.
|
|
18938
|
-
*/
|
|
18939
|
-
noCapableNode: number(),
|
|
18940
|
-
failed: number(),
|
|
18941
|
-
/** Set once a pass ends: true only when EVERYTHING was covered. */
|
|
18942
|
-
complete: boolean().nullable(),
|
|
18943
|
-
startedAtMs: number().nullable(),
|
|
18944
|
-
finishedAtMs: number().nullable(),
|
|
18945
|
-
/** Present when the pass ended by throwing. */
|
|
18946
|
-
error: string().nullable()
|
|
18947
|
-
});
|
|
18948
|
-
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
18949
|
-
deviceId: number(),
|
|
18950
|
-
trackId: string()
|
|
18951
|
-
}), TrackSchema.nullable()), method(object({
|
|
18952
|
-
deviceId: number(),
|
|
18953
|
-
since: number().optional(),
|
|
18954
|
-
until: number().optional(),
|
|
18955
|
-
limit: number().optional(),
|
|
18956
|
-
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
18957
|
-
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
18958
|
-
* envelope columns, then precisely tested per position. Tracks with
|
|
18959
|
-
* an unknown envelope (no frame dims at persist time) always match. */
|
|
18960
|
-
zone: TrackZoneFilterSchema.optional(),
|
|
18961
|
-
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
18962
|
-
* compatible — omitting the field keeps today's exact behaviour). */
|
|
18963
|
-
projection: TrackProjectionSchema.optional(),
|
|
18964
|
-
/** Include stationary-promoted rows (parked objects handed to the
|
|
18965
|
-
* stationary registry). Default false: the timeline lists passages,
|
|
18966
|
-
* not parking records (operator decision, 2026-08-15). */
|
|
18967
|
-
includeStationary: boolean().optional()
|
|
18968
|
-
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
|
|
18969
|
-
deviceId: number(),
|
|
18970
|
-
groupId: string().min(1)
|
|
18971
|
-
}), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
|
|
18972
|
-
kind: "mutation",
|
|
18973
|
-
auth: "admin"
|
|
18974
|
-
}), 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({
|
|
18975
|
-
deviceId: number(),
|
|
18976
|
-
since: number().optional(),
|
|
18977
|
-
until: number().optional(),
|
|
18978
|
-
kinds: array(string()).optional(),
|
|
18979
|
-
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
18980
|
-
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
18981
|
-
deviceId: number(),
|
|
18982
|
-
since: number(),
|
|
18983
|
-
until: number(),
|
|
18984
|
-
bucketMs: number().int().positive()
|
|
18985
|
-
}), array(object({
|
|
18986
|
-
bucketStart: number(),
|
|
18987
|
-
motion: number().int(),
|
|
18988
|
-
object: number().int(),
|
|
18989
|
-
audio: number().int()
|
|
18990
|
-
})).readonly()), method(object({
|
|
18991
|
-
deviceId: number(),
|
|
18992
|
-
cutoffMs: number()
|
|
18993
|
-
}), object({
|
|
18994
|
-
motion: number().int(),
|
|
18995
|
-
object: number().int(),
|
|
18996
|
-
audio: number().int()
|
|
18997
|
-
}), {
|
|
18998
|
-
kind: "mutation",
|
|
18999
|
-
auth: "admin"
|
|
19000
|
-
}), method(object({
|
|
19001
|
-
deviceId: number(),
|
|
19002
|
-
cutoffMs: number()
|
|
19003
|
-
}), TrackCascadeCountsSchema, {
|
|
19004
|
-
kind: "mutation",
|
|
19005
|
-
auth: "admin"
|
|
19006
|
-
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
19007
|
-
kind: "mutation",
|
|
19008
|
-
auth: "admin"
|
|
19009
|
-
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
19010
|
-
kind: "mutation",
|
|
19011
|
-
auth: "admin"
|
|
19012
|
-
}), method(object({
|
|
19013
|
-
deviceId: number(),
|
|
19014
|
-
trackIds: array(string()).min(1)
|
|
19015
|
-
}), object({
|
|
19016
|
-
deleted: number().int(),
|
|
19017
|
-
failed: array(string()).readonly()
|
|
19018
|
-
}), {
|
|
19019
|
-
kind: "mutation",
|
|
19020
|
-
auth: "admin"
|
|
19021
|
-
}), method(object({
|
|
19022
|
-
/** Log/audit scope only — the trackId is globally unique on its own. */
|
|
19023
|
-
deviceId: number(),
|
|
19024
|
-
trackId: string(),
|
|
19025
|
-
flags: TrackFlagsPatchSchema
|
|
19026
|
-
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
19027
|
-
kind: "query",
|
|
19028
|
-
auth: "admin"
|
|
19029
|
-
}), method(object({
|
|
19030
|
-
olderThanMs: number(),
|
|
19031
|
-
reason: OpsLogReasonSchema.optional()
|
|
19032
|
-
}), EventPruneCountsSchema, {
|
|
19033
|
-
kind: "mutation",
|
|
19034
|
-
auth: "admin"
|
|
19035
|
-
}), method(object({ deviceId: number() }), EventPruneCountsSchema, {
|
|
19036
|
-
kind: "mutation",
|
|
19037
|
-
auth: "admin"
|
|
19038
|
-
}), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
19039
|
-
kind: "mutation",
|
|
19040
|
-
auth: "admin"
|
|
19041
|
-
}), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
|
|
19042
|
-
kind: "mutation",
|
|
19043
|
-
auth: "admin"
|
|
19044
|
-
}), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
|
|
19045
|
-
kind: "mutation",
|
|
19046
|
-
auth: "admin"
|
|
19047
|
-
}), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
|
|
19048
|
-
kind: "mutation",
|
|
19049
|
-
auth: "admin"
|
|
19050
|
-
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
19051
|
-
kind: "mutation",
|
|
19052
|
-
auth: "admin"
|
|
19053
|
-
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
19054
|
-
kind: "query",
|
|
19055
|
-
auth: "admin"
|
|
19056
|
-
}), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
|
|
19057
|
-
kind: "query",
|
|
19058
|
-
auth: "admin"
|
|
19059
|
-
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
19060
|
-
kind: "query",
|
|
19061
|
-
auth: "admin"
|
|
19062
|
-
}), method(object({
|
|
19063
|
-
/** Empty ⇒ every camera that has staging tracks. A LIST, not a single
|
|
19064
|
-
* `deviceId`, deliberately: `deviceId` would make this device-bound and
|
|
19065
|
-
* route it at one camera's owner, and "every camera" would stop being
|
|
19066
|
-
* expressible at all. */
|
|
19067
|
-
deviceIds: array(number()).optional(),
|
|
19068
|
-
limit: number().int().min(1).max(500).optional()
|
|
19069
|
-
}), array(RetrainTrackSchema).readonly(), {
|
|
19070
|
-
kind: "query",
|
|
19071
|
-
auth: "admin"
|
|
19072
|
-
}), method(object({ trackId: string() }), RetrainFrameListSchema, {
|
|
19073
|
-
kind: "query",
|
|
19074
|
-
auth: "admin"
|
|
19075
|
-
}), method(object({
|
|
19076
|
-
deviceId: number(),
|
|
19077
|
-
trackId: string(),
|
|
19078
|
-
mediaKeys: array(string()).min(1)
|
|
19079
|
-
}), RetrainFrameSelectionSchema, {
|
|
19080
|
-
kind: "mutation",
|
|
19081
|
-
auth: "admin"
|
|
19082
|
-
}), method(object({
|
|
19083
|
-
deviceId: number(),
|
|
19084
|
-
trackId: string(),
|
|
19085
|
-
frameId: string()
|
|
19086
|
-
}), object({
|
|
19087
|
-
removed: boolean(),
|
|
19088
|
-
removedAnnotations: number().int()
|
|
19089
|
-
}), {
|
|
19090
|
-
kind: "mutation",
|
|
19091
|
-
auth: "admin"
|
|
19092
|
-
}), method(object({ frameId: string() }), object({
|
|
19093
|
-
base64: string(),
|
|
19094
|
-
width: number().int(),
|
|
19095
|
-
height: number().int()
|
|
19096
|
-
}), {
|
|
19097
|
-
kind: "query",
|
|
19098
|
-
auth: "admin"
|
|
19099
|
-
}), method(object({
|
|
19100
|
-
deviceId: number(),
|
|
19101
|
-
trackId: string(),
|
|
19102
|
-
frameId: string(),
|
|
19103
|
-
subject: RetrainAssistSubjectSchema,
|
|
19104
|
-
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
19105
|
-
nodeId: string().optional()
|
|
19106
|
-
}), RetrainAssistResultSchema, {
|
|
19107
|
-
kind: "mutation",
|
|
19108
|
-
auth: "admin"
|
|
19109
|
-
}), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
|
|
19110
|
-
kind: "query",
|
|
19111
|
-
auth: "admin"
|
|
19112
|
-
}), method(object({
|
|
19113
|
-
deviceId: number(),
|
|
19114
|
-
trackId: string(),
|
|
19115
|
-
frameId: string(),
|
|
19116
|
-
annotations: array(RetrainAnnotationDraftSchema)
|
|
19117
|
-
}), array(RetrainAnnotationSchema).readonly(), {
|
|
19118
|
-
kind: "mutation",
|
|
19119
|
-
auth: "admin"
|
|
19120
|
-
}), method(object({
|
|
19121
|
-
deviceId: number(),
|
|
19122
|
-
trackId: string()
|
|
19123
|
-
}), RetrainTransitionResultSchema, {
|
|
19124
|
-
kind: "mutation",
|
|
19125
|
-
auth: "admin"
|
|
19126
|
-
}), method(object({
|
|
19127
|
-
deviceId: number(),
|
|
19128
|
-
trackId: string()
|
|
19129
|
-
}), RetrainTransitionResultSchema, {
|
|
19130
|
-
kind: "mutation",
|
|
19131
|
-
auth: "admin"
|
|
19132
|
-
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
19133
|
-
kind: "query",
|
|
19134
|
-
auth: "admin"
|
|
19135
|
-
}), method(object({
|
|
19136
|
-
eventId: string(),
|
|
19137
|
-
kind: MediaFileKindEnum.optional(),
|
|
19138
|
-
deviceId: number()
|
|
19139
|
-
}), array(MediaFileSchema).readonly()), method(object({
|
|
19140
|
-
trackId: string(),
|
|
19141
|
-
kinds: array(MediaFileKindEnum).optional(),
|
|
19142
|
-
deviceId: number()
|
|
19143
|
-
}), array(MediaFileSchema).readonly()), method(object({
|
|
19144
|
-
trackId: string(),
|
|
19145
|
-
deviceId: number()
|
|
19146
|
-
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
19147
|
-
kind: "mutation",
|
|
19148
|
-
auth: "admin"
|
|
19149
|
-
}), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
|
|
19150
|
-
kind: "mutation",
|
|
19151
|
-
auth: "admin"
|
|
19152
|
-
}), method(object({}), RebuildStatusSchema), object({
|
|
19153
|
-
deviceId: number(),
|
|
19154
|
-
timestamp: number(),
|
|
19155
|
-
frameWidth: number(),
|
|
19156
|
-
frameHeight: number(),
|
|
19157
|
-
detections: array(OverlayDetectionSchema).readonly()
|
|
19158
|
-
}), object({
|
|
19159
|
-
deviceId: number(),
|
|
19160
|
-
trackId: string(),
|
|
19161
|
-
className: string()
|
|
19162
|
-
}), object({
|
|
19163
|
-
deviceId: number(),
|
|
19164
|
-
trackId: string(),
|
|
19165
|
-
className: string(),
|
|
19166
|
-
durationMs: number()
|
|
19167
|
-
}), object({
|
|
19168
|
-
deviceId: number(),
|
|
19169
|
-
kind: EventKindSchema,
|
|
19170
|
-
eventId: string(),
|
|
19171
|
-
timestamp: number()
|
|
19172
|
-
});
|
|
19173
|
-
/**
|
|
19174
|
-
* Reference to the frame's retained NATIVE surface + the parent crop's placement
|
|
19175
|
-
* within the frame, so the executor can re-cut a leaf child ROI at native
|
|
19176
|
-
* resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
|
|
19177
|
-
*/
|
|
19178
|
-
var NativeCropRefSchema = object({
|
|
19179
|
-
/** Handle keying the retained native surface (node-pinned to its owner). */
|
|
19180
|
-
handle: FrameHandleSchema,
|
|
19181
|
-
/** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
|
|
19182
|
-
cropFrameSpace: object({
|
|
19183
|
-
x: number(),
|
|
19184
|
-
y: number(),
|
|
19185
|
-
w: number(),
|
|
19186
|
-
h: number()
|
|
19187
|
-
})
|
|
19188
|
-
});
|
|
19189
|
-
object({
|
|
19190
|
-
crop: object({
|
|
19191
|
-
left: number(),
|
|
19192
|
-
top: number(),
|
|
19193
|
-
width: number().positive(),
|
|
19194
|
-
height: number().positive()
|
|
19195
|
-
}).optional(),
|
|
19196
|
-
content: object({
|
|
19197
|
-
width: number().int().positive(),
|
|
19198
|
-
height: number().int().positive()
|
|
19199
|
-
}),
|
|
19200
|
-
fit: _enum(["stretch", "contain"]),
|
|
19201
|
-
format: _enum([
|
|
19202
|
-
"rgb",
|
|
19203
|
-
"gray",
|
|
19204
|
-
"jpeg"
|
|
19205
|
-
])
|
|
19206
|
-
});
|
|
19207
|
-
var FrameRefSchema = object({
|
|
19208
|
-
registryId: string().min(1),
|
|
19209
|
-
id: string().min(1),
|
|
19210
|
-
width: number().int().positive(),
|
|
19211
|
-
height: number().int().positive(),
|
|
19212
|
-
format: _enum(["rgb", "gray"]),
|
|
19213
|
-
timestamp: number(),
|
|
19214
|
-
capturedAt: number().optional()
|
|
19215
|
-
});
|
|
19216
|
-
var ModelFormatSchema$1 = _enum([
|
|
19217
|
-
"onnx",
|
|
19218
|
-
"coreml",
|
|
19219
|
-
"openvino",
|
|
19220
|
-
"tflite",
|
|
19221
|
-
"pt",
|
|
19222
|
-
"gguf"
|
|
19223
|
-
]);
|
|
19224
|
-
var PipelineSlotSchema = _enum([
|
|
19225
|
-
"detector",
|
|
19226
|
-
"cropper",
|
|
19227
|
-
"classifier",
|
|
19228
|
-
"refiner",
|
|
19229
|
-
"audio-classifier"
|
|
19230
|
-
]);
|
|
19231
|
-
var PipelineEngineChoiceSchema = object({
|
|
19232
|
-
runtime: _enum(["node", "python"]),
|
|
19233
|
-
backend: string(),
|
|
19234
|
-
format: ModelFormatSchema$1,
|
|
19235
|
-
device: string().optional()
|
|
19236
|
-
});
|
|
19237
|
-
var AvailableEngineSchema = object({
|
|
19238
|
-
engine: PipelineEngineChoiceSchema,
|
|
19239
|
-
devices: array(object({
|
|
19240
|
-
id: string(),
|
|
19241
|
-
label: string(),
|
|
19242
|
-
description: string().optional()
|
|
19243
|
-
})).readonly(),
|
|
19244
|
-
defaultDevice: string()
|
|
19245
|
-
});
|
|
19246
|
-
var PipelineDefaultStepSchema = lazy(() => object({
|
|
19247
|
-
addonId: string(),
|
|
19248
|
-
addonName: string(),
|
|
19249
|
-
slot: PipelineSlotSchema,
|
|
19250
|
-
inputClasses: array(string()).readonly(),
|
|
19251
|
-
outputClasses: array(string()).readonly(),
|
|
19252
|
-
enabled: boolean(),
|
|
19253
|
-
modelId: string(),
|
|
19254
|
-
children: array(PipelineDefaultStepSchema).readonly(),
|
|
19255
|
-
group: string().optional(),
|
|
19256
|
-
settings: record(string(), unknown()).optional()
|
|
19257
|
-
}));
|
|
19258
|
-
var PipelineTemplateStepSchema = lazy(() => object({
|
|
19259
|
-
addonId: string(),
|
|
19260
|
-
enabled: boolean(),
|
|
19261
|
-
modelId: string(),
|
|
19262
|
-
children: array(PipelineTemplateStepSchema).readonly(),
|
|
19263
|
-
settings: record(string(), unknown()).optional()
|
|
19264
|
-
}));
|
|
19265
|
-
var PipelineTemplateSchema$1 = object({
|
|
19266
|
-
id: string(),
|
|
19267
|
-
name: string(),
|
|
19268
|
-
createdAt: string(),
|
|
19269
|
-
updatedAt: string(),
|
|
19270
|
-
engine: PipelineEngineChoiceSchema,
|
|
19271
|
-
steps: array(PipelineTemplateStepSchema).readonly()
|
|
19272
|
-
});
|
|
19273
|
-
var PipelineModelOptionSchema = object({
|
|
19274
|
-
id: string(),
|
|
19275
|
-
name: string(),
|
|
19276
|
-
formats: record(string(), object({
|
|
19277
|
-
downloaded: boolean(),
|
|
19278
|
-
sizeMB: number()
|
|
19279
|
-
})),
|
|
19280
|
-
group: ModelVariantGroupSchema.optional(),
|
|
19281
|
-
legacy: boolean().optional(),
|
|
19282
|
-
provider: ModelProviderIdSchema.optional()
|
|
19283
|
-
});
|
|
19284
|
-
var ConfigFieldBridge = custom();
|
|
19285
|
-
var PipelineAddonSchemaSchema = object({
|
|
19286
|
-
id: string(),
|
|
19287
|
-
name: string(),
|
|
19288
|
-
slot: PipelineSlotSchema,
|
|
19289
|
-
inputClasses: array(string()).readonly(),
|
|
19290
|
-
outputClasses: array(string()).readonly(),
|
|
19291
|
-
childSlots: array(PipelineSlotSchema).readonly(),
|
|
19292
|
-
models: array(PipelineModelOptionSchema).readonly(),
|
|
19293
|
-
defaultModelId: string(),
|
|
19294
|
-
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
19295
|
-
enabledByDefault: boolean().optional(),
|
|
19296
|
-
backfillIntoExistingOverrides: boolean().optional(),
|
|
19297
|
-
defaultConfidence: number(),
|
|
19298
|
-
group: string().optional(),
|
|
19299
|
-
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
19300
|
-
});
|
|
19301
|
-
var PipelineSlotSchemaSchema = object({
|
|
19302
|
-
id: PipelineSlotSchema,
|
|
19303
|
-
label: string(),
|
|
19304
|
-
priority: number(),
|
|
19305
|
-
parentSlot: PipelineSlotSchema.nullable(),
|
|
19306
|
-
addons: array(PipelineAddonSchemaSchema).readonly()
|
|
19307
|
-
});
|
|
19308
|
-
var PipelineSchemaSchema = object({
|
|
19309
|
-
availableEngines: array(AvailableEngineSchema).readonly(),
|
|
19310
|
-
selectedEngine: PipelineEngineChoiceSchema,
|
|
19311
|
-
slots: array(PipelineSlotSchemaSchema).readonly()
|
|
19312
|
-
});
|
|
19313
|
-
var EngineProvisioningSchema = object({
|
|
19314
|
-
runtimeId: _enum([
|
|
19315
|
-
"onnx",
|
|
19316
|
-
"openvino",
|
|
19317
|
-
"coreml",
|
|
19318
|
-
"edgetpu"
|
|
19319
|
-
]).nullable(),
|
|
19320
|
-
device: string().nullable(),
|
|
19321
|
-
state: _enum([
|
|
19322
|
-
"idle",
|
|
19323
|
-
"installing",
|
|
19324
|
-
"verifying",
|
|
19325
|
-
"ready",
|
|
19326
|
-
"failed"
|
|
19327
|
-
]),
|
|
19328
|
-
progress: number().optional(),
|
|
19329
|
-
error: string().optional(),
|
|
19330
|
-
nextRetryAt: number().optional(),
|
|
19331
|
-
/**
|
|
19332
|
-
* Gate A (config-correctness gate at engine change): human-readable
|
|
19333
|
-
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
19334
|
-
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
19335
|
-
* has a <format> build"). Additive/optional: informational only, never
|
|
19336
|
-
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
19337
|
-
* Absent/empty when the node-default tree resolves cleanly.
|
|
19338
|
-
*/
|
|
19339
|
-
configIssues: array(string()).optional()
|
|
19340
|
-
});
|
|
19341
|
-
var PipelineStepInputSchema = lazy(() => object({
|
|
19342
|
-
addonId: string(),
|
|
19343
|
-
modelId: string().optional(),
|
|
19344
|
-
enabled: boolean().default(true),
|
|
19345
|
-
children: array(PipelineStepInputSchema).optional(),
|
|
19346
|
-
settings: record(string(), unknown()).optional(),
|
|
19347
|
-
jumpDeviceKey: string().optional()
|
|
19348
|
-
}));
|
|
19349
|
-
var ModelSubstitutionSchema = object({
|
|
19350
|
-
addonId: string(),
|
|
19351
|
-
chosen: string(),
|
|
19352
|
-
running: string(),
|
|
19353
|
-
format: string()
|
|
19354
|
-
});
|
|
19355
|
-
var PipelineValidationIssueSchema = object({
|
|
19356
|
-
addonId: string(),
|
|
19357
|
-
kind: _enum(["unknown-addon", "no-format-build"]),
|
|
19358
|
-
detail: string()
|
|
19359
|
-
});
|
|
19360
|
-
var PipelineValidationResultSchema = object({
|
|
19361
|
-
ok: boolean(),
|
|
19362
|
-
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
19363
|
-
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
19364
|
-
/** The node's `currentEngine.format` this validation ran against. */
|
|
19365
|
-
format: string()
|
|
19366
|
-
});
|
|
19367
|
-
var ReferenceImageEntrySchema = object({
|
|
19368
|
-
filename: string(),
|
|
19369
|
-
stepIds: array(string()).readonly().optional()
|
|
19370
|
-
});
|
|
19371
|
-
var ReferenceImageBodySchema = object({
|
|
19372
|
-
base64: string(),
|
|
19373
|
-
filename: string()
|
|
19374
|
-
});
|
|
19375
|
-
var ReferenceAudioEntrySchema = object({
|
|
19376
|
-
filename: string(),
|
|
19377
|
-
sizeKb: number()
|
|
19378
|
-
});
|
|
19379
|
-
var ReferenceAudioBodySchema = object({ base64: string() });
|
|
19380
|
-
var AudioBackendSchema = object({
|
|
19381
|
-
id: string(),
|
|
19382
|
-
name: string(),
|
|
19383
|
-
description: string(),
|
|
19384
|
-
available: boolean(),
|
|
19385
|
-
/**
|
|
19386
|
-
* Raw classifier labels this backend can emit (e.g. YAMNet's
|
|
19387
|
-
* 521-class set or Apple SoundAnalysis's 303-class set). Used by
|
|
19388
|
-
* the benchmark UI to populate the `enabledMicroClasses` filter
|
|
19389
|
-
* specific to the selected backend without a separate fetch.
|
|
19390
|
-
*/
|
|
19391
|
-
rawLabels: array(string()).readonly().optional()
|
|
19392
|
-
});
|
|
19393
|
-
var AudioCapabilitiesSchema = object({
|
|
19394
|
-
activeBackend: string(),
|
|
19395
|
-
availableBackends: array(AudioBackendSchema).readonly(),
|
|
19396
|
-
sampleRate: number(),
|
|
19397
|
-
chunkDurationMs: number()
|
|
19398
|
-
});
|
|
19399
|
-
var DownloadModelResultSchema = object({
|
|
19400
|
-
filePath: string(),
|
|
19401
|
-
sizeMB: number(),
|
|
19402
|
-
durationMs: number()
|
|
19403
|
-
});
|
|
19404
|
-
/**
|
|
19405
|
-
* Wrapper carrying a single test run's result. Replaces the legacy
|
|
19406
|
-
* ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
|
|
19407
|
-
* canonical `AudioResult` from the Phase 6 output rework: one
|
|
19408
|
-
* `AudioDetection` per class above `minScore`, top-N candidates in
|
|
19409
|
-
* `debug.alternateLabels['audio-classifier']`, per-source timings in
|
|
19410
|
-
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
19411
|
-
* benchmark UI can still report a clean failure when the classifier
|
|
19412
|
-
* cap isn't available.
|
|
19413
|
-
*/
|
|
19414
|
-
var AudioTestResultSchema = object({
|
|
19415
|
-
success: boolean(),
|
|
19416
|
-
error: string().optional(),
|
|
19417
|
-
frame: custom().optional()
|
|
19418
|
-
});
|
|
19419
|
-
var PipelineConfigBridge = custom();
|
|
19420
|
-
var ConfigUISchemaBridge = custom();
|
|
19421
|
-
var ConfigUISchemaNullableBridge = custom();
|
|
19422
|
-
var InferenceCapabilitiesBridge = custom();
|
|
19423
|
-
var ModelAvailabilityListBridge = custom();
|
|
19424
|
-
var PipelineRunResultBridge = custom();
|
|
19425
|
-
/**
|
|
19426
|
-
* Pipeline executor — detection engine + configuration + inference API.
|
|
19427
|
-
*
|
|
19428
|
-
* Merged from: pipeline-executor, pipeline-config, inference, detection-config.
|
|
19429
|
-
* Implemented by the detection-pipeline addon.
|
|
19430
|
-
*
|
|
19431
|
-
* Per-device surface (DeviceSettingsContribution + the "is detection
|
|
19432
|
-
* enabled for this camera?" toggle) lives on the paired
|
|
19433
|
-
* `detection-pipeline` cap (device-scoped, singleton, wrapper
|
|
19434
|
-
* defaultActive) — same split pattern used by stream-broker /
|
|
19435
|
-
* camera-streams and audio-analyzer / audio-analysis.
|
|
18192
|
+
* Per-device surface (DeviceSettingsContribution + the "is detection
|
|
18193
|
+
* enabled for this camera?" toggle) lives on the paired
|
|
18194
|
+
* `detection-pipeline` cap (device-scoped, singleton, wrapper
|
|
18195
|
+
* defaultActive) — same split pattern used by stream-broker /
|
|
18196
|
+
* camera-streams and audio-analyzer / audio-analysis.
|
|
19436
18197
|
*/
|
|
19437
18198
|
var pipelineExecutorCapability = {
|
|
19438
18199
|
name: "pipeline-executor",
|
|
@@ -19484,6 +18245,60 @@ var pipelineExecutorCapability = {
|
|
|
19484
18245
|
kind: "mutation",
|
|
19485
18246
|
auth: "admin"
|
|
19486
18247
|
}),
|
|
18248
|
+
/**
|
|
18249
|
+
* Which of THIS node's inference devices the executor currently refuses,
|
|
18250
|
+
* and why. `nodeId` is the ROUTING key (stripped by the generated router).
|
|
18251
|
+
*
|
|
18252
|
+
* The channel that did not exist. Pool health was known only inside the
|
|
18253
|
+
* detection addon and was an input to no routing decision anywhere: the
|
|
18254
|
+
* per-dispatch capability gate is keyed on model FORMAT and so can never
|
|
18255
|
+
* separate `openvino:gpu` from `openvino:npu`, and the orchestrator's live
|
|
18256
|
+
* eligibility probe (`platformProbe.getCapabilities`) answers about
|
|
18257
|
+
* HARDWARE — which was present throughout. So when the hub's `openvino:gpu`
|
|
18258
|
+
* Python worker was SIGABRT'd by the Intel GPU plugin on 2026-08-25, the
|
|
18259
|
+
* balancer went on handing that dead pool cameras by rotation for 31 hours:
|
|
18260
|
+
* ~370 000 `PoolWorker[w0]: not initialized` lines, every frame lost.
|
|
18261
|
+
*
|
|
18262
|
+
* Read semantics the caller depends on, and which the provider guarantees:
|
|
18263
|
+
* this is a synchronous read of in-memory state. It never probes hardware,
|
|
18264
|
+
* never spawns a pool and never throws — an EMPTY `unhealthy` means "asked,
|
|
18265
|
+
* nothing is refused", which is what re-admits a device. A read that FAILS
|
|
18266
|
+
* (node offline, version skew) must therefore be distinguishable from an
|
|
18267
|
+
* empty answer, and it is: it rejects.
|
|
18268
|
+
*/
|
|
18269
|
+
getInferenceDeviceHealth: method(object({ nodeId: string() }), object({ unhealthy: array(object({
|
|
18270
|
+
/** `<backend>:<device>`, e.g. `openvino:gpu`. */
|
|
18271
|
+
deviceKey: string(),
|
|
18272
|
+
/**
|
|
18273
|
+
* `failed` — the per-device restart budget is exhausted; no pool
|
|
18274
|
+
* will be spawned until an operator re-arms it or the runner
|
|
18275
|
+
* respawns. `backoff` — under budget, waiting out the backoff (or
|
|
18276
|
+
* a cached pool observed dead and not yet condemned).
|
|
18277
|
+
*/
|
|
18278
|
+
state: _enum(["failed", "backoff"]),
|
|
18279
|
+
/** Epoch ms of the death that produced this state. */
|
|
18280
|
+
since: number(),
|
|
18281
|
+
/** Pool deaths inside the current window. */
|
|
18282
|
+
deaths: number(),
|
|
18283
|
+
/** The last death's message. */
|
|
18284
|
+
lastError: string()
|
|
18285
|
+
})).readonly() })),
|
|
18286
|
+
/**
|
|
18287
|
+
* Re-arm a terminally `failed` inference device on `nodeId`: forget its
|
|
18288
|
+
* restart budget so the next dispatch builds a fresh pool.
|
|
18289
|
+
*
|
|
18290
|
+
* The terminal state is deliberate (the abort it bounds is deterministic —
|
|
18291
|
+
* an automatic probation would just respawn Python forever, more slowly),
|
|
18292
|
+
* and a terminal state an operator cannot leave is a silent fault. This is
|
|
18293
|
+
* the way out. `rearmed:false` means there was nothing to forget.
|
|
18294
|
+
*/
|
|
18295
|
+
rearmInferenceDevice: method(object({
|
|
18296
|
+
nodeId: string(),
|
|
18297
|
+
deviceKey: string()
|
|
18298
|
+
}), object({ rearmed: boolean() }), {
|
|
18299
|
+
kind: "mutation",
|
|
18300
|
+
auth: "admin"
|
|
18301
|
+
}),
|
|
19487
18302
|
getSchema: method(_void(), PipelineSchemaSchema),
|
|
19488
18303
|
getGlobalSteps: method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()),
|
|
19489
18304
|
getGlobalPipelineConfig: method(_void(), PipelineConfigBridge),
|
|
@@ -19749,6 +18564,1503 @@ var pipelineExecutorCapability = {
|
|
|
19749
18564
|
getDetectionConfigSchema: method(_void(), ConfigUISchemaNullableBridge)
|
|
19750
18565
|
}
|
|
19751
18566
|
};
|
|
18567
|
+
/**
|
|
18568
|
+
* Per-stage gating mode applied to the zones a rule references.
|
|
18569
|
+
*
|
|
18570
|
+
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
18571
|
+
* When at least one `include` rule fires for a stage, only entities
|
|
18572
|
+
* inside one of those zones pass that stage.
|
|
18573
|
+
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
18574
|
+
* Entities inside one of those zones are dropped at that stage.
|
|
18575
|
+
*
|
|
18576
|
+
* `monitor`-style observation (count without filtering) is not a rule
|
|
18577
|
+
* mode — zones without any matching rule are observed naturally by
|
|
18578
|
+
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
18579
|
+
* count, not filter" use case needs no rule at all.
|
|
18580
|
+
*/
|
|
18581
|
+
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
18582
|
+
/**
|
|
18583
|
+
* Per-consumer rule that references existing zones (geometry) and
|
|
18584
|
+
* defines how a specific pipeline stage should treat them. Each
|
|
18585
|
+
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
18586
|
+
* settings:
|
|
18587
|
+
*
|
|
18588
|
+
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
18589
|
+
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
18590
|
+
* - future: notification rules, audio gating, etc.
|
|
18591
|
+
*
|
|
18592
|
+
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
18593
|
+
* express "ignore motion in ALL of {garden, street}" with a single
|
|
18594
|
+
* rule. `classFilter` narrows the rule to specific object classes —
|
|
18595
|
+
* "drop person detections in the street, but keep cars" is one
|
|
18596
|
+
* `exclude` rule with `classFilter: ['person']`.
|
|
18597
|
+
*
|
|
18598
|
+
* `enabled` is a soft toggle — the operator can keep the rule
|
|
18599
|
+
* configured but inert without deleting it.
|
|
18600
|
+
*/
|
|
18601
|
+
var ZoneRuleSchema = object({
|
|
18602
|
+
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
18603
|
+
id: string(),
|
|
18604
|
+
/** Optional human-readable label rendered in the rule editor. */
|
|
18605
|
+
name: string().optional(),
|
|
18606
|
+
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
18607
|
+
* listed zones (OR-set: a detection in any one of them counts).
|
|
18608
|
+
* At least one zone id required — a rule with no targets is a
|
|
18609
|
+
* configuration mistake and the form validator rejects it. */
|
|
18610
|
+
zoneIds: array(string()).min(1).readonly(),
|
|
18611
|
+
mode: ZoneRuleModeEnum,
|
|
18612
|
+
/**
|
|
18613
|
+
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
18614
|
+
* applies to every class. Class strings match the `macroClass`
|
|
18615
|
+
* field on detections (e.g. `person`, `car`, `dog`).
|
|
18616
|
+
*/
|
|
18617
|
+
classFilter: array(string()).readonly().optional(),
|
|
18618
|
+
/**
|
|
18619
|
+
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
18620
|
+
* required to consider an entity "in the zone". Defaults to the
|
|
18621
|
+
* consumer's stage default when omitted. Kept for back-compat with
|
|
18622
|
+
* existing per-rule overrides; new operators pick the value via
|
|
18623
|
+
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
18624
|
+
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
18625
|
+
*/
|
|
18626
|
+
overlapThreshold: number().min(0).max(1).optional(),
|
|
18627
|
+
/**
|
|
18628
|
+
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
18629
|
+
* of the detection's bbox that must lie inside the zone for the
|
|
18630
|
+
* rule to match. Documented default is 85%; the engine substitutes
|
|
18631
|
+
* that when the field is omitted (kept optional so existing rules
|
|
18632
|
+
* stored without it stay valid).
|
|
18633
|
+
*
|
|
18634
|
+
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
18635
|
+
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
18636
|
+
* field exposed in the UI. Internally both feed the same gate.
|
|
18637
|
+
*/
|
|
18638
|
+
bboxInclusionPct: number().min(0).max(100).optional(),
|
|
18639
|
+
/**
|
|
18640
|
+
* When `true` and a detection has a segmentation mask, use the
|
|
18641
|
+
* mask for overlap instead of the bbox. Detection-stage only;
|
|
18642
|
+
* motion rules ignore this field.
|
|
18643
|
+
*/
|
|
18644
|
+
preferMask: boolean().optional(),
|
|
18645
|
+
/**
|
|
18646
|
+
* Soft-toggle: `false` disables the rule without deleting it.
|
|
18647
|
+
* Defaults to `true` so operators creating a rule via the UI
|
|
18648
|
+
* see it active immediately.
|
|
18649
|
+
*/
|
|
18650
|
+
enabled: boolean().default(true)
|
|
18651
|
+
});
|
|
18652
|
+
array(ZoneRuleSchema).readonly();
|
|
18653
|
+
/**
|
|
18654
|
+
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
18655
|
+
*
|
|
18656
|
+
* Zones describe **where** in the frame the operator wants to flag
|
|
18657
|
+
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
18658
|
+
* each pipeline stage uses them. Splitting the two means a single
|
|
18659
|
+
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
18660
|
+
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
18661
|
+
* — without three duplicated polygons.
|
|
18662
|
+
*
|
|
18663
|
+
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
18664
|
+
* `zones` device-state slice on every mutation. Consumers
|
|
18665
|
+
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
18666
|
+
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
18667
|
+
* mirror with `onChanged`).
|
|
18668
|
+
*
|
|
18669
|
+
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
18670
|
+
* survive resolution changes and stream profile switches.
|
|
18671
|
+
*
|
|
18672
|
+
* `kind` discriminates between full polygons (closed regions used
|
|
18673
|
+
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
18674
|
+
* line segments used for cross events). Onboard / firmware-reported
|
|
18675
|
+
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
18676
|
+
* task list.
|
|
18677
|
+
*/
|
|
18678
|
+
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
18679
|
+
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
18680
|
+
var PolygonPointSchema = object({
|
|
18681
|
+
x: number(),
|
|
18682
|
+
y: number()
|
|
18683
|
+
});
|
|
18684
|
+
/** A camera detection zone — pure geometry/identity. */
|
|
18685
|
+
var ZoneSchema = object({
|
|
18686
|
+
id: string(),
|
|
18687
|
+
name: string(),
|
|
18688
|
+
kind: ZoneKindEnum.default("polygon"),
|
|
18689
|
+
/** Polygon vertices, fraction of frame (0–1). */
|
|
18690
|
+
polygon: array(PolygonPointSchema).readonly(),
|
|
18691
|
+
/** Visual color for UI rendering. */
|
|
18692
|
+
color: string().default("#3b82f6")
|
|
18693
|
+
});
|
|
18694
|
+
DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).readonly()), method(object({
|
|
18695
|
+
deviceId: number(),
|
|
18696
|
+
zone: ZoneSchema
|
|
18697
|
+
}), _void(), {
|
|
18698
|
+
kind: "mutation",
|
|
18699
|
+
auth: "admin"
|
|
18700
|
+
}), method(object({
|
|
18701
|
+
deviceId: number(),
|
|
18702
|
+
zoneId: string()
|
|
18703
|
+
}), _void(), {
|
|
18704
|
+
kind: "mutation",
|
|
18705
|
+
auth: "admin"
|
|
18706
|
+
}), method(object({
|
|
18707
|
+
deviceId: number(),
|
|
18708
|
+
zone: ZoneSchema
|
|
18709
|
+
}), _void(), {
|
|
18710
|
+
kind: "mutation",
|
|
18711
|
+
auth: "admin"
|
|
18712
|
+
}), object({ zones: array(ZoneSchema).readonly() });
|
|
18713
|
+
/**
|
|
18714
|
+
* pipeline-analytics — device-scoped wrapper cap. Refines raw
|
|
18715
|
+
* per-frame detections emitted by the pipeline runner into tracked
|
|
18716
|
+
* objects, per-kind event collections (motion / object / audio), and
|
|
18717
|
+
* persisted media. Owns the post-detection domain end-to-end:
|
|
18718
|
+
*
|
|
18719
|
+
* runner emits PipelineInferenceResult
|
|
18720
|
+
* ↓ (event bus)
|
|
18721
|
+
* pipeline-analytics subscriber
|
|
18722
|
+
* ↓ SORT tracker + zone engine + state analyzer + event emitter
|
|
18723
|
+
* → three DB collections (one per kind), one FS media tree, one
|
|
18724
|
+
* unified event emitter (FrameTracked + TrackStarted/Ended +
|
|
18725
|
+
* DetectionEvent on bus)
|
|
18726
|
+
*
|
|
18727
|
+
* Pure subscriber model. No `processFrame` cap method — the runner
|
|
18728
|
+
* already publishes the raw frame on the bus. The cap surface is
|
|
18729
|
+
* only QUERIES + per-device settings, bound on/off via
|
|
18730
|
+
* `device-manager.setWrapperActive`. `defaultActive: true` because
|
|
18731
|
+
* every camera with a detection pipeline wants its raw detections
|
|
18732
|
+
* refined; operators opt out per-device via BindingsTab when needed.
|
|
18733
|
+
*
|
|
18734
|
+
* Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
|
|
18735
|
+
* (per-device surface) and `track-trail` caps — see P11 cleanup.
|
|
18736
|
+
*/
|
|
18737
|
+
var TrackStateSchema = _enum([
|
|
18738
|
+
"new",
|
|
18739
|
+
"entered",
|
|
18740
|
+
"left",
|
|
18741
|
+
"moving",
|
|
18742
|
+
"idle"
|
|
18743
|
+
]);
|
|
18744
|
+
var EventKindSchema = _enum([
|
|
18745
|
+
"motion",
|
|
18746
|
+
"object",
|
|
18747
|
+
"audio"
|
|
18748
|
+
]);
|
|
18749
|
+
/**
|
|
18750
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
18751
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
18752
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
18753
|
+
*/
|
|
18754
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
18755
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
18756
|
+
var EventKindIconSchema = _enum([
|
|
18757
|
+
"motion",
|
|
18758
|
+
"audio",
|
|
18759
|
+
"person",
|
|
18760
|
+
"vehicle",
|
|
18761
|
+
"animal",
|
|
18762
|
+
"door",
|
|
18763
|
+
"pir",
|
|
18764
|
+
"smoke",
|
|
18765
|
+
"water",
|
|
18766
|
+
"button",
|
|
18767
|
+
"package",
|
|
18768
|
+
"generic"
|
|
18769
|
+
]);
|
|
18770
|
+
var EventKindCategorySchema = _enum([
|
|
18771
|
+
"motion",
|
|
18772
|
+
"audio",
|
|
18773
|
+
"detection",
|
|
18774
|
+
"sensor",
|
|
18775
|
+
"control",
|
|
18776
|
+
"custom",
|
|
18777
|
+
"package"
|
|
18778
|
+
]);
|
|
18779
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
18780
|
+
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
18781
|
+
var EventKindDescriptorSchema = object({
|
|
18782
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
18783
|
+
kind: string(),
|
|
18784
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
18785
|
+
labelKey: string(),
|
|
18786
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
18787
|
+
label: string(),
|
|
18788
|
+
/** Hex color for timeline/legend rendering. */
|
|
18789
|
+
color: string(),
|
|
18790
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
18791
|
+
iconId: string(),
|
|
18792
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
18793
|
+
icon: EventKindIconSchema,
|
|
18794
|
+
category: EventKindCategorySchema,
|
|
18795
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
18796
|
+
parentKind: string().nullable(),
|
|
18797
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
18798
|
+
level: EventKindLevelSchema,
|
|
18799
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
18800
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
18801
|
+
source: object({
|
|
18802
|
+
capName: string(),
|
|
18803
|
+
deviceId: number()
|
|
18804
|
+
})
|
|
18805
|
+
});
|
|
18806
|
+
/** One camera's event vocabulary, as returned by `listEventKindsBatch`. */
|
|
18807
|
+
var EventKindsForDeviceSchema = object({
|
|
18808
|
+
deviceId: number(),
|
|
18809
|
+
kinds: array(EventKindDescriptorSchema).readonly()
|
|
18810
|
+
});
|
|
18811
|
+
var SensorEventSchema = object({
|
|
18812
|
+
id: string(),
|
|
18813
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
18814
|
+
* yields N rows, one per camera). */
|
|
18815
|
+
deviceId: number(),
|
|
18816
|
+
/** The linked sensor device whose state changed. */
|
|
18817
|
+
sourceDeviceId: number(),
|
|
18818
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
18819
|
+
kind: string(),
|
|
18820
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
18821
|
+
value: record(string(), unknown()).nullable(),
|
|
18822
|
+
timestamp: number()
|
|
18823
|
+
});
|
|
18824
|
+
var TrackPositionSchema = object({
|
|
18825
|
+
x: number(),
|
|
18826
|
+
y: number(),
|
|
18827
|
+
timestamp: number(),
|
|
18828
|
+
bbox: BoundingBoxSchema
|
|
18829
|
+
});
|
|
18830
|
+
var TrackSnapshotSchema = object({
|
|
18831
|
+
timestamp: number(),
|
|
18832
|
+
position: TrackPositionSchema,
|
|
18833
|
+
/** MediaStore key; resolve via `getTrackMedia({ trackId })`. */
|
|
18834
|
+
mediaKey: string()
|
|
18835
|
+
});
|
|
18836
|
+
/**
|
|
18837
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
18838
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
18839
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
18840
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
18841
|
+
*/
|
|
18842
|
+
var TrackEnvelopeSchema = object({
|
|
18843
|
+
minX: number(),
|
|
18844
|
+
minY: number(),
|
|
18845
|
+
maxX: number(),
|
|
18846
|
+
maxY: number()
|
|
18847
|
+
});
|
|
18848
|
+
/**
|
|
18849
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
18850
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
18851
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
18852
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
18853
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
18854
|
+
* zonesVisited, bestEventId, envelope, hasFace, hasEmbeddedFace, hasRider) and returns `positions` /
|
|
18855
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
18856
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
18857
|
+
* (`getObjectEvents` et al.).
|
|
18858
|
+
*/
|
|
18859
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
18860
|
+
/**
|
|
18861
|
+
* One audio-classification label heard on the track's camera while the
|
|
18862
|
+
* track was alive, aggregated per label. An "episode" is one persisted
|
|
18863
|
+
* audio event (the confident-classification path: score ≥ the device's
|
|
18864
|
+
* `classificationMinScore`, class-change-or-heartbeat coalesced) — NOT
|
|
18865
|
+
* one 32 ms inference chunk, so counts stay human-scaled.
|
|
18866
|
+
*/
|
|
18867
|
+
var TrackAudioLabelSchema = object({
|
|
18868
|
+
label: string(),
|
|
18869
|
+
/** Highest classification score observed across the label's episodes. */
|
|
18870
|
+
peakScore: number(),
|
|
18871
|
+
/** Number of coalesced audio-event episodes carrying this label. */
|
|
18872
|
+
count: number(),
|
|
18873
|
+
firstAt: number(),
|
|
18874
|
+
lastAt: number()
|
|
18875
|
+
});
|
|
18876
|
+
/**
|
|
18877
|
+
* How a track was produced. `pipeline` (default / absent) = the spatial
|
|
18878
|
+
* detection+tracking pipeline. Every OTHER value is a SYNTHETIC projection —
|
|
18879
|
+
* no positions, a single snapshot, and no bbox trajectory at all:
|
|
18880
|
+
*
|
|
18881
|
+
* - `sensor` — a linked sensor/control device state change.
|
|
18882
|
+
* - `audio` — an audio event on the camera itself that was anomalous for
|
|
18883
|
+
* THAT camera, loud, and heard while nothing visual was happening (D62).
|
|
18884
|
+
*
|
|
18885
|
+
* The spatial subsystems (tracker association, occupancy count, re-id /
|
|
18886
|
+
* embedding, resurrection) MUST skip every synthetic source. Test for that
|
|
18887
|
+
* with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
|
|
18888
|
+
* check silently readmits every source added after it was written.
|
|
18889
|
+
*/
|
|
18890
|
+
var TrackSourceSchema = _enum([
|
|
18891
|
+
"pipeline",
|
|
18892
|
+
"sensor",
|
|
18893
|
+
"audio"
|
|
18894
|
+
]);
|
|
18895
|
+
/**
|
|
18896
|
+
* Where a track sits in the RETRAIN lifecycle (D81).
|
|
18897
|
+
*
|
|
18898
|
+
* - `none` — never marked, or un-marked. Evictable.
|
|
18899
|
+
* - `staging` — the operator wants this track as training material and has not
|
|
18900
|
+
* finished with it. **This is the only state retention holds**: the track and
|
|
18901
|
+
* everything it owns (object events, crops, keyframes, CLIP vector) survive
|
|
18902
|
+
* the device's age window.
|
|
18903
|
+
* - `trained` — the retrain page has taken what it needed. The frames it chose
|
|
18904
|
+
* were COPIED into the retrain dataset at selection time, so the dataset no
|
|
18905
|
+
* longer depends on the track's media and the track becomes EVICTABLE again.
|
|
18906
|
+
* Terminal for the plain `markForTrain` toggle: returning it to `staging` is
|
|
18907
|
+
* a deliberate action of the retrain page, not a side effect of a checkbox.
|
|
18908
|
+
*
|
|
18909
|
+
* There is no `null`. The state is stored `TEXT NOT NULL DEFAULT 'none'` because
|
|
18910
|
+
* the store's filter language has only positive equality and `whereIn` — no
|
|
18911
|
+
* negation, no IS NULL — so a NULL would be unselectable by ANY predicate and
|
|
18912
|
+
* would make the entire pre-column history immortal in one deploy.
|
|
18913
|
+
*/
|
|
18914
|
+
var RetrainStatusSchema = _enum([
|
|
18915
|
+
"none",
|
|
18916
|
+
"staging",
|
|
18917
|
+
"trained"
|
|
18918
|
+
]);
|
|
18919
|
+
/**
|
|
18920
|
+
* Per-track OPERATOR flags — set by hand from the admin UI or the viewer, never
|
|
18921
|
+
* by the pipeline. Spread into `TrackSchema` and `KeyEventSchema` from one place
|
|
18922
|
+
* so the two surfaces cannot drift.
|
|
18923
|
+
*
|
|
18924
|
+
* **Absent ≠ false.** A track that has never been touched omits the field; an
|
|
18925
|
+
* explicitly un-flagged track carries `false`. Legacy rows written before the
|
|
18926
|
+
* columns existed read as absent, and a consumer that needs a boolean should say
|
|
18927
|
+
* `flag === true`, not `flag !== false`.
|
|
18928
|
+
*
|
|
18929
|
+
* `markForTrain` is the WIRE FACE of {@link RetrainStatusSchema}, not a column:
|
|
18930
|
+
* it is exactly `retrainStatus === 'staging'`, in both directions. Writing
|
|
18931
|
+
* `true` moves `none → staging`, writing `false` moves `staging → none`, and a
|
|
18932
|
+
* `trained` track reports `false` while refusing both writes. The boolean is
|
|
18933
|
+
* kept because three surfaces drive a toggle off it; anything that needs to tell
|
|
18934
|
+
* "never marked" from "already trained" must read `retrainStatus`.
|
|
18935
|
+
*
|
|
18936
|
+
* `debug` does NOT pin; it is attention, not durability.
|
|
18937
|
+
*
|
|
18938
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
18939
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
18940
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
18941
|
+
*/
|
|
18942
|
+
var TrackFlagFields = {
|
|
18943
|
+
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
18944
|
+
* `'staging'`. */
|
|
18945
|
+
markForTrain: boolean().optional(),
|
|
18946
|
+
/** Operator marked this track for diagnostic attention. */
|
|
18947
|
+
debug: boolean().optional(),
|
|
18948
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
18949
|
+
favourited: boolean().optional()
|
|
18950
|
+
};
|
|
18951
|
+
/**
|
|
18952
|
+
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
18953
|
+
* Deliberately NOT part of {@link TrackFlagFields}: that group also builds the
|
|
18954
|
+
* write patch, and the status is not something the toggle sets — it is what the
|
|
18955
|
+
* toggle's boolean is derived from. Absent on an in-RAM track never touched;
|
|
18956
|
+
* always present on a persisted row (the column default materialises `'none'`).
|
|
18957
|
+
*/
|
|
18958
|
+
var TrackRetrainFields = { retrainStatus: RetrainStatusSchema.optional() };
|
|
18959
|
+
/**
|
|
18960
|
+
* The write half: a PARTIAL patch. An omitted key is left untouched, so setting
|
|
18961
|
+
* one flag can never clear the other — the toggles are independent and are
|
|
18962
|
+
* driven from three surfaces that do not know about each other.
|
|
18963
|
+
*/
|
|
18964
|
+
var TrackFlagsPatchSchema = object(TrackFlagFields);
|
|
18965
|
+
/**
|
|
18966
|
+
* The resolved flag state after a write. Both fields are REQUIRED here (absent
|
|
18967
|
+
* collapses to `false`) so a caller can drive a toggle's checked state off the
|
|
18968
|
+
* mutation result without a re-fetch.
|
|
18969
|
+
*/
|
|
18970
|
+
var TrackFlagsSchema = object({
|
|
18971
|
+
trackId: string(),
|
|
18972
|
+
markForTrain: boolean(),
|
|
18973
|
+
debug: boolean(),
|
|
18974
|
+
favourited: boolean(),
|
|
18975
|
+
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
18976
|
+
* a track row) because this shape is only ever produced by the write body,
|
|
18977
|
+
* which always knows it — and a surface that has just written needs to render
|
|
18978
|
+
* `trained` without a re-fetch. */
|
|
18979
|
+
retrainStatus: RetrainStatusSchema
|
|
18980
|
+
});
|
|
18981
|
+
union([literal(1), literal(2)]);
|
|
18982
|
+
/**
|
|
18983
|
+
* WHO decided a label, and when. Carried per tier so a value can be traced to
|
|
18984
|
+
* the step and model that produced it — which is what makes the write rule
|
|
18985
|
+
* arguable after the fact ("why is 592's label `dog` and not `Canis lupus`?")
|
|
18986
|
+
* and what lets a migrated, UNATTRIBUTED value be told apart from a real one.
|
|
18987
|
+
*
|
|
18988
|
+
* `stepId` is the pipeline step id (`animal-classifier`, `bird-classifier`,
|
|
18989
|
+
* `plate-ocr`, `face-embedding`, `object-detection`), or the sentinel
|
|
18990
|
+
* `migration:4g` for a value the 4g migration moved from the single-slot era —
|
|
18991
|
+
* that value has no provenance, and the write rule lets ANY properly-attributed
|
|
18992
|
+
* write of the same tier replace it regardless of score.
|
|
18993
|
+
*/
|
|
18994
|
+
var LabelAttributionSchema = object({
|
|
18995
|
+
stepId: string(),
|
|
18996
|
+
modelId: string().optional(),
|
|
18997
|
+
decidedAt: number(),
|
|
18998
|
+
/**
|
|
18999
|
+
* The GALLERY id behind a recognised tier-2 label — a face-gallery
|
|
19000
|
+
* `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
|
|
19001
|
+
*
|
|
19002
|
+
* The text alone is a DISPLAY NAME, and a display name is renameable: a
|
|
19003
|
+
* notification rule authored on "Gianluca" stopped matching the moment the
|
|
19004
|
+
* operator fixed the spelling in the gallery, and nothing said so. The id is
|
|
19005
|
+
* the thing that does not move, so it is what a rule matches on
|
|
19006
|
+
* (`NcConditions.identities`) and the text is what a human is shown.
|
|
19007
|
+
*
|
|
19008
|
+
* Absent when the label names no gallery row — a plate the OCR read but no
|
|
19009
|
+
* vehicle claims, a sub-class, a species, any tier-1 value.
|
|
19010
|
+
*/
|
|
19011
|
+
identityId: string().optional()
|
|
19012
|
+
});
|
|
19013
|
+
/**
|
|
19014
|
+
* The TIERED label model (roadmap 4g), spread into `TrackSchema` and
|
|
19015
|
+
* `ObjectEventSchema` from ONE place so the two surfaces cannot drift — a
|
|
19016
|
+
* track and its events always answer the same question the same way.
|
|
19017
|
+
*
|
|
19018
|
+
* Two scalar columns, not an array: every consumer wants "the coarse one" or
|
|
19019
|
+
* "the fine one", and an array made both a scan. `label` is tier 1, `subLabel`
|
|
19020
|
+
* is tier 2, and each carries its own score + attribution.
|
|
19021
|
+
*
|
|
19022
|
+
* **Reading it.** What a human should be shown is `subLabel ?? label` — the
|
|
19023
|
+
* finest thing known. Before 4g the single `label` column held the finest
|
|
19024
|
+
* value, so a consumer that has not been updated reads the tier-1 slot and
|
|
19025
|
+
* shows nothing on a species-only row; that is why the migration puts every
|
|
19026
|
+
* pre-4g value in tier 2 (it cannot regress a display that reads the fallback)
|
|
19027
|
+
* and why the read surfaces were changed in the same train.
|
|
19028
|
+
*
|
|
19029
|
+
* **Writing it.** The slots are independent, which is the whole point: a
|
|
19030
|
+
* tier-1 write (`bird`) can never overwrite a tier-2 value (`Turdus
|
|
19031
|
+
* migratorius`), so fineness cannot regress by construction. Within a tier the
|
|
19032
|
+
* higher score wins. One rule, one implementation — see
|
|
19033
|
+
* `pipeline/label-tier.ts` in addon-post-analysis.
|
|
19034
|
+
*/
|
|
19035
|
+
var TieredLabelFields = {
|
|
19036
|
+
/** Tier 1 — the sub-class. See {@link LabelTierSchema}. */
|
|
19037
|
+
label: string().optional(),
|
|
19038
|
+
/** Confidence of the tier-1 value, as reported by the deciding step. */
|
|
19039
|
+
labelScore: number().optional(),
|
|
19040
|
+
/** Provenance of the tier-1 value. See {@link LabelAttributionSchema}. */
|
|
19041
|
+
labelMeta: LabelAttributionSchema.optional(),
|
|
19042
|
+
/** Tier 2 — the instance. See {@link LabelTierSchema}. */
|
|
19043
|
+
subLabel: string().optional(),
|
|
19044
|
+
/** Confidence of the tier-2 value, as reported by the deciding step. */
|
|
19045
|
+
subLabelScore: number().optional(),
|
|
19046
|
+
/** Provenance of the tier-2 value. See {@link LabelAttributionSchema}. */
|
|
19047
|
+
subLabelMeta: LabelAttributionSchema.optional()
|
|
19048
|
+
};
|
|
19049
|
+
/** Per-camera slice of a training-export estimate. */
|
|
19050
|
+
var TrainingExportDeviceTotalsSchema = object({
|
|
19051
|
+
deviceId: number(),
|
|
19052
|
+
tracks: number().int(),
|
|
19053
|
+
files: number().int(),
|
|
19054
|
+
bytes: number().int()
|
|
19055
|
+
});
|
|
19056
|
+
/**
|
|
19057
|
+
* What a training export WOULD contain. Computed from media index rows only —
|
|
19058
|
+
* no blob is read to produce this.
|
|
19059
|
+
*/
|
|
19060
|
+
var TrainingExportSummarySchema = object({
|
|
19061
|
+
generatedAt: number(),
|
|
19062
|
+
trackCount: number().int(),
|
|
19063
|
+
fileCount: number().int(),
|
|
19064
|
+
byteCount: number().int(),
|
|
19065
|
+
/** More marked tracks exist than a single pass carries. */
|
|
19066
|
+
truncated: boolean(),
|
|
19067
|
+
devices: array(TrainingExportDeviceTotalsSchema).readonly()
|
|
19068
|
+
});
|
|
19069
|
+
var TrackSchema = object({
|
|
19070
|
+
trackId: string(),
|
|
19071
|
+
deviceId: number(),
|
|
19072
|
+
className: string(),
|
|
19073
|
+
...TieredLabelFields,
|
|
19074
|
+
producingDeviceName: string().optional(),
|
|
19075
|
+
/** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
|
|
19076
|
+
source: TrackSourceSchema.optional(),
|
|
19077
|
+
firstSeen: number(),
|
|
19078
|
+
lastSeen: number(),
|
|
19079
|
+
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
19080
|
+
positions: array(TrackPositionSchema).readonly(),
|
|
19081
|
+
/** Periodic snapshots at snapshotIntervalMs cadence (subject to
|
|
19082
|
+
* saveThumbnails policy). */
|
|
19083
|
+
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
19084
|
+
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
19085
|
+
zonesVisited: array(string()).readonly(),
|
|
19086
|
+
/**
|
|
19087
|
+
* Human NAMES for {@link zonesVisited}, resolved at READ time against the
|
|
19088
|
+
* `zones` capability.
|
|
19089
|
+
*
|
|
19090
|
+
* `zonesVisited` persists ids (`cfeec78c-8d69-…`), which no operator can type
|
|
19091
|
+
* and no card can render — so every free-text search surface was structurally
|
|
19092
|
+
* unable to answer "show me the tracks in Uscio", and did not fail loudly, it
|
|
19093
|
+
* just returned nothing. Resolving here rather than in each client keeps ONE
|
|
19094
|
+
* derivation and costs the clients no extra call (the `zones` cap is
|
|
19095
|
+
* per-device, so a client-side resolve would be a per-camera fan-out on a
|
|
19096
|
+
* surface built to avoid exactly that).
|
|
19097
|
+
*
|
|
19098
|
+
* Resolved, never invented: a zone deleted since the track was written has no
|
|
19099
|
+
* name and is DROPPED, so this array can be shorter than `zonesVisited` — the
|
|
19100
|
+
* two are not positionally aligned. Absent when the track visited no zone, or
|
|
19101
|
+
* when the zone catalogue could not be read.
|
|
19102
|
+
*/
|
|
19103
|
+
zoneNames: array(string()).readonly().optional(),
|
|
19104
|
+
/** Deduplicated set of detector classes observed for this track over its
|
|
19105
|
+
* life (a track may be reclassified, e.g. person→vehicle). Absent on
|
|
19106
|
+
* legacy rows written before class accumulation shipped. */
|
|
19107
|
+
classes: array(string()).readonly().optional(),
|
|
19108
|
+
/** Cumulative normalized distance travelled (0..1 units = full frame width). */
|
|
19109
|
+
totalDistance: number(),
|
|
19110
|
+
state: TrackStateSchema,
|
|
19111
|
+
active: boolean(),
|
|
19112
|
+
/** Deterministic key-event importance score in [0,1] (server-computed at
|
|
19113
|
+
* track expiry, recomputed on late label). Absent on legacy rows written
|
|
19114
|
+
* before scoring shipped — consumers degrade to absence / compute-on-read. */
|
|
19115
|
+
importance: number().optional(),
|
|
19116
|
+
/** Id of the track's highest-confidence ObjectEvent (its representative
|
|
19117
|
+
* "best" frame). Absent when the track produced no object events. */
|
|
19118
|
+
bestEventId: string().optional(),
|
|
19119
|
+
/** Tag of the importance sub-signal that dominated the score
|
|
19120
|
+
* (identity|dwell|proximity|class|confidence|travel|zone). */
|
|
19121
|
+
importanceReason: string().optional(),
|
|
19122
|
+
/** Audio-classification labels heard on the camera during the track's
|
|
19123
|
+
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
19124
|
+
* Absent on legacy rows / tracks with no confident audio. */
|
|
19125
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
19126
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
19127
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
19128
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
19129
|
+
envelope: TrackEnvelopeSchema.optional(),
|
|
19130
|
+
/**
|
|
19131
|
+
* A face DETECTOR found a face on this track — nothing more. It says the
|
|
19132
|
+
* detail plane produced a `face` detail; it does NOT say the face was
|
|
19133
|
+
* embedded, matched, above `minFacePx`, or that the recognizer was even
|
|
19134
|
+
* enabled. Set once and never cleared.
|
|
19135
|
+
*
|
|
19136
|
+
* **This exists so "face present but not recognised" is expressible.** A
|
|
19137
|
+
* recognised identity lands in `subLabel` (attributed to the face chain via
|
|
19138
|
+
* `subLabelMeta.stepId`), so before this field a track with an unmatched face
|
|
19139
|
+
* and a track with no face at all were byte-identical on the wire and no
|
|
19140
|
+
* surface could tell them apart. The read is `hasFace === true && subLabel
|
|
19141
|
+
* === undefined`.
|
|
19142
|
+
*
|
|
19143
|
+
* **Absent ≠ false.** Every row written before the column existed omits it,
|
|
19144
|
+
* and so does every server that predates the field — a consumer must test
|
|
19145
|
+
* `=== true` and render nothing otherwise, never infer "no face".
|
|
19146
|
+
*/
|
|
19147
|
+
hasFace: boolean().optional(),
|
|
19148
|
+
/**
|
|
19149
|
+
* This track has a face row IN THE GALLERY: a crop **and** an embedding — a
|
|
19150
|
+
* face an operator could ASSIGN to an identity.
|
|
19151
|
+
*
|
|
19152
|
+
* The STRICT twin of {@link hasFace}, and the pair only earns its keep
|
|
19153
|
+
* because the two disagree. `hasFace` is stamped at the TOP of the face
|
|
19154
|
+
* branch, before every gate, and means no more than "a face detector produced
|
|
19155
|
+
* a face detail". This one is stamped at the single moment the gallery row
|
|
19156
|
+
* LANDS — after `FaceRecognizer.onTrackEnd` successfully persists it, i.e.
|
|
19157
|
+
* past the embedding-magnitude verdict, the `minFacePx` detection gate, the
|
|
19158
|
+
* candidate gate, the imageless-track drop (no crop was ever captured) and
|
|
19159
|
+
* the crop-store drop. Everything between the detector and that insert can
|
|
19160
|
+
* legitimately refuse the face, so a flag written any earlier promises the
|
|
19161
|
+
* operator something to assign and delivers nothing.
|
|
19162
|
+
*
|
|
19163
|
+
* **Independent of recognition.** A face collected but never auto-matched is
|
|
19164
|
+
* still assignable — it is in fact the face an operator most wants to reach —
|
|
19165
|
+
* so this is NOT gated on `recognizedIdentityId`. Recognition lands in
|
|
19166
|
+
* `subLabel`; this says only that the raw material exists.
|
|
19167
|
+
*
|
|
19168
|
+
* **Set once, never cleared.** A track that produced a gallery row produced
|
|
19169
|
+
* one; deleting the row later is the gallery's business, not this flag's.
|
|
19170
|
+
*
|
|
19171
|
+
* **Absent ≠ false**, the same rule as {@link hasFace}: every row written
|
|
19172
|
+
* before the column omits it, and so does every server that predates the
|
|
19173
|
+
* field. A consumer must test `=== true` and render nothing otherwise —
|
|
19174
|
+
* never infer "no assignable face".
|
|
19175
|
+
*/
|
|
19176
|
+
hasEmbeddedFace: boolean().optional(),
|
|
19177
|
+
/**
|
|
19178
|
+
* This subject CONTAINS a folded rider — a person the rider-pairing step
|
|
19179
|
+
* ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
|
|
19180
|
+
* so the passage is tracked once and as a VEHICLE.
|
|
19181
|
+
*
|
|
19182
|
+
* It exists because the fold's record was dishonest. D34 and the code both
|
|
19183
|
+
* said "the person is not lost — it is reported so both entities stay on the
|
|
19184
|
+
* record"; in fact the pair went into a per-processor RAM field behind an
|
|
19185
|
+
* accessor nobody called, and every durable surface said `vehicle`, full
|
|
19186
|
+
* stop. This is the composition note that makes the row true.
|
|
19187
|
+
*
|
|
19188
|
+
* A COMPOSITION, never a class and never a label. "This vehicle contains a
|
|
19189
|
+
* person" is not an answer to "what is this" — both label tiers would refuse
|
|
19190
|
+
* a macro token anyway (D89), and correctly. Nothing here changes what the
|
|
19191
|
+
* subject IS: a cyclist stays one vehicle track, occupancy still counts one,
|
|
19192
|
+
* and a `person` rule still does not fire for someone cycling past.
|
|
19193
|
+
*
|
|
19194
|
+
* **Absent ≠ false**, exactly like {@link hasFace}: every row written before
|
|
19195
|
+
* the column, and every hub that predates the field, omits it. Test
|
|
19196
|
+
* `=== true` and render nothing otherwise — never infer "no rider".
|
|
19197
|
+
*/
|
|
19198
|
+
hasRider: boolean().optional(),
|
|
19199
|
+
...TrackFlagFields,
|
|
19200
|
+
...TrackRetrainFields
|
|
19201
|
+
});
|
|
19202
|
+
var BaseEventFields = {
|
|
19203
|
+
id: string(),
|
|
19204
|
+
deviceId: number(),
|
|
19205
|
+
timestamp: number()
|
|
19206
|
+
};
|
|
19207
|
+
var MotionEventSchema = object({
|
|
19208
|
+
...BaseEventFields,
|
|
19209
|
+
kind: literal("motion"),
|
|
19210
|
+
regionCount: number(),
|
|
19211
|
+
/** Heavy JSON array — omitted in slim projection. */
|
|
19212
|
+
regions: array(object({
|
|
19213
|
+
bbox: BoundingBoxSchema,
|
|
19214
|
+
pixelCount: number(),
|
|
19215
|
+
intensity: number()
|
|
19216
|
+
})).readonly().optional(),
|
|
19217
|
+
/** Omitted in slim projection. */
|
|
19218
|
+
frameWidth: number().optional(),
|
|
19219
|
+
/** Omitted in slim projection. */
|
|
19220
|
+
frameHeight: number().optional(),
|
|
19221
|
+
/** Populated by B5 (recording playback URL for this event). */
|
|
19222
|
+
mediaUrl: string().optional()
|
|
19223
|
+
});
|
|
19224
|
+
/**
|
|
19225
|
+
* Which detection SOURCE produced an object event. `pipeline` = the ML
|
|
19226
|
+
* detection pipeline (decoded-frame inference); `onboard` = the camera's
|
|
19227
|
+
* native on-device AI. Both flow through the SAME analysis layers (zoning,
|
|
19228
|
+
* tracking, per-kind persistence) but stay distinguishable so consumers
|
|
19229
|
+
* (advanced-notifier, occupancy, …) can select which source(s) to act on.
|
|
19230
|
+
* Absent on legacy rows ⇒ treat as `pipeline`.
|
|
19231
|
+
*/
|
|
19232
|
+
var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
|
|
19233
|
+
/**
|
|
19234
|
+
* The confirmed zone crossing that produced an object event. Present ONLY on
|
|
19235
|
+
* an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
|
|
19236
|
+
* event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
|
|
19237
|
+
* appearance event carry none, so a rule asking for a direction fails closed
|
|
19238
|
+
* on them.
|
|
19239
|
+
*
|
|
19240
|
+
* Exactly ONE crossing per event: the emitter turns each confirmed crossing
|
|
19241
|
+
* into its own event, so a frame in which a track enters A while leaving B
|
|
19242
|
+
* produces two events with two directions — never one ambiguous row.
|
|
19243
|
+
*
|
|
19244
|
+
* `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
|
|
19245
|
+
* membership the box has NOW, and by definition it no longer contains the zone
|
|
19246
|
+
* that was just left. Without the id here, a zone-scoped rule could never match
|
|
19247
|
+
* the exit it asked for.
|
|
19248
|
+
*/
|
|
19249
|
+
var ZoneCrossingSchema = object({
|
|
19250
|
+
direction: _enum(["enter", "exit"]),
|
|
19251
|
+
/** Admin zone id crossed. */
|
|
19252
|
+
zoneId: string(),
|
|
19253
|
+
/** Zone display name at crossing time (falls back to the id). */
|
|
19254
|
+
zoneName: string().optional()
|
|
19255
|
+
});
|
|
19256
|
+
var ObjectEventSchema = object({
|
|
19257
|
+
...BaseEventFields,
|
|
19258
|
+
kind: literal("object"),
|
|
19259
|
+
/** Detection source. Optional for backward-compat; absent ⇒ `pipeline`. */
|
|
19260
|
+
source: DetectionSourceSchema.optional(),
|
|
19261
|
+
/**
|
|
19262
|
+
* Inference-frame id shared by every object event emitted from the SAME frame
|
|
19263
|
+
* — the "scene/parent" key. Lets a consumer group co-occurring detections (e.g.
|
|
19264
|
+
* 2 people + 1 dog) under one full frame, and link a track's frames over time
|
|
19265
|
+
* (group by `trackId`, pick a representative `frameId` as the parent frame).
|
|
19266
|
+
* Optional for backward-compat with pre-existing rows / the slim projection
|
|
19267
|
+
* includes it (it is light). Absent on rows written before this field.
|
|
19268
|
+
*/
|
|
19269
|
+
frameId: string().optional(),
|
|
19270
|
+
/** Omitted in slim projection. */
|
|
19271
|
+
trackId: string().optional(),
|
|
19272
|
+
className: string(),
|
|
19273
|
+
...TieredLabelFields,
|
|
19274
|
+
/** Omitted in slim projection. */
|
|
19275
|
+
confidence: number().optional(),
|
|
19276
|
+
/** Heavy JSON — omitted in slim projection. */
|
|
19277
|
+
bbox: BoundingBoxSchema.optional(),
|
|
19278
|
+
/** Heavy JSON — omitted in slim projection. */
|
|
19279
|
+
zones: array(string()).readonly().optional(),
|
|
19280
|
+
/** Omitted in slim projection. */
|
|
19281
|
+
state: TrackStateSchema.optional(),
|
|
19282
|
+
/**
|
|
19283
|
+
* The zone crossing this event IS, when it is one. Absent on every other
|
|
19284
|
+
* event kind (movement state, appearance, package) — see
|
|
19285
|
+
* {@link ZoneCrossingSchema}. Omitted in slim projection.
|
|
19286
|
+
*/
|
|
19287
|
+
zoneCrossing: ZoneCrossingSchema.optional(),
|
|
19288
|
+
/** Detection-frame dimensions in pixels — let consumers normalize the
|
|
19289
|
+
* pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
|
|
19290
|
+
frameWidth: number().optional(),
|
|
19291
|
+
frameHeight: number().optional(),
|
|
19292
|
+
/** MediaStore key for the crop attached to this event (if any). */
|
|
19293
|
+
mediaKey: string().optional(),
|
|
19294
|
+
/** Design B: MediaStore key of the track's native-resolution key frame (the
|
|
19295
|
+
* best-detection full frame). Resolve via the event-media data-plane
|
|
19296
|
+
* (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
|
|
19297
|
+
* draws `bbox` over the native frame. Absent on legacy rows / non-decoded
|
|
19298
|
+
* sources — consumers fall back to `mediaKey` (the tight crop). */
|
|
19299
|
+
keyFrameMediaKey: string().optional(),
|
|
19300
|
+
/** Populated by B5 (recording playback URL for this event). */
|
|
19301
|
+
mediaUrl: string().optional(),
|
|
19302
|
+
/** The parent track's key-event importance [0,1], propagated to every object
|
|
19303
|
+
* event of the track (so an event row can be sorted by importance without a
|
|
19304
|
+
* track join). Absent on legacy rows / before the track was scored. */
|
|
19305
|
+
importance: number().optional()
|
|
19306
|
+
});
|
|
19307
|
+
var AudioEventSchema = object({
|
|
19308
|
+
...BaseEventFields,
|
|
19309
|
+
kind: literal("audio"),
|
|
19310
|
+
rms: number(),
|
|
19311
|
+
dbfs: number(),
|
|
19312
|
+
classification: object({
|
|
19313
|
+
className: string(),
|
|
19314
|
+
originalClass: string().optional(),
|
|
19315
|
+
score: number()
|
|
19316
|
+
}).optional(),
|
|
19317
|
+
/** Populated by B5 (recording playback URL for this event). */
|
|
19318
|
+
mediaUrl: string().optional()
|
|
19319
|
+
});
|
|
19320
|
+
var MediaFileKindEnum = _enum([
|
|
19321
|
+
"crop",
|
|
19322
|
+
"thumbnail",
|
|
19323
|
+
"snapshot",
|
|
19324
|
+
"firstFrame",
|
|
19325
|
+
"lastFrame",
|
|
19326
|
+
"fullFrame",
|
|
19327
|
+
"fullFrameBoxed",
|
|
19328
|
+
"faceCrop",
|
|
19329
|
+
"plateCrop",
|
|
19330
|
+
"keyFrame",
|
|
19331
|
+
"keyFrameSmall",
|
|
19332
|
+
"thumbnailSmall"
|
|
19333
|
+
]);
|
|
19334
|
+
var MediaFileSchema = object({
|
|
19335
|
+
key: string(),
|
|
19336
|
+
kind: MediaFileKindEnum,
|
|
19337
|
+
base64: string(),
|
|
19338
|
+
sizeBytes: number(),
|
|
19339
|
+
timestamp: number()
|
|
19340
|
+
});
|
|
19341
|
+
/**
|
|
19342
|
+
* One media row WITHOUT its bytes.
|
|
19343
|
+
*
|
|
19344
|
+
* A track's media is 5-8 MB of base64 (measured: 7.67 MB across 23 files for a
|
|
19345
|
+
* 140 s track), and a client that renders tiles from the media data plane needs
|
|
19346
|
+
* to know only WHAT EXISTS — the bytes then arrive per tile, lazily, over HTTP
|
|
19347
|
+
* with an immutable cache, instead of all at once inside a tRPC response that
|
|
19348
|
+
* blocks the whole view.
|
|
19349
|
+
*
|
|
19350
|
+
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
19351
|
+
* stored blob and a `?variant=thumb` rendering without fetching either.
|
|
19352
|
+
*/
|
|
19353
|
+
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
19354
|
+
/**
|
|
19355
|
+
* The MACRO tier of an annotation — a CLOSED set.
|
|
19356
|
+
*
|
|
19357
|
+
* This is what the exported detector predicts, so a typo here is a new class
|
|
19358
|
+
* with one example in it. `label` and `subLabel` are open strings by contrast:
|
|
19359
|
+
* the whole point of the page is teaching the model things it does not know
|
|
19360
|
+
* yet, and constraining that vocabulary would make it useless.
|
|
19361
|
+
*
|
|
19362
|
+
* A macro class is NEVER a label. The provider refuses a write whose `label` or
|
|
19363
|
+
* `subLabel` is one of these values, in any casing, because once `person`
|
|
19364
|
+
* exists in both tiers "every person box" stops being answerable without
|
|
19365
|
+
* knowing every string anyone ever typed — and the damage is retroactive.
|
|
19366
|
+
*/
|
|
19367
|
+
var RetrainMacroClassSchema = _enum([
|
|
19368
|
+
"person",
|
|
19369
|
+
"vehicle",
|
|
19370
|
+
"animal",
|
|
19371
|
+
"package",
|
|
19372
|
+
"face",
|
|
19373
|
+
"plate"
|
|
19374
|
+
]);
|
|
19375
|
+
/** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
|
|
19376
|
+
var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
|
|
19377
|
+
/** Did a human draw this box, or did the assist propose it? */
|
|
19378
|
+
var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
|
|
19379
|
+
/** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
|
|
19380
|
+
var RetrainBboxSchema = object({
|
|
19381
|
+
x: number(),
|
|
19382
|
+
y: number(),
|
|
19383
|
+
w: number(),
|
|
19384
|
+
h: number()
|
|
19385
|
+
});
|
|
19386
|
+
/**
|
|
19387
|
+
* One annotated subject.
|
|
19388
|
+
*
|
|
19389
|
+
* `bbox` is normalised against the full frame, ALWAYS. The per-model shapes
|
|
19390
|
+
* (letterboxed root / zone-cropped package / subject-cropped classifier) are
|
|
19391
|
+
* derived from it at export and never stored — storing them is how one feature
|
|
19392
|
+
* space ends up holding two crops of the same subject (D52).
|
|
19393
|
+
*/
|
|
19394
|
+
var RetrainAnnotationSchema = object({
|
|
19395
|
+
id: string(),
|
|
19396
|
+
trackId: string(),
|
|
19397
|
+
deviceId: number(),
|
|
19398
|
+
/** The COPY in retrain storage — never the source track's media key. */
|
|
19399
|
+
mediaKey: string(),
|
|
19400
|
+
bbox: RetrainBboxSchema,
|
|
19401
|
+
macroClass: RetrainMacroClassSchema,
|
|
19402
|
+
label: string().optional(),
|
|
19403
|
+
subLabel: string().optional(),
|
|
19404
|
+
kind: RetrainAnnotationKindSchema,
|
|
19405
|
+
source: RetrainAnnotationSourceSchema,
|
|
19406
|
+
/** Which model proposed this box — or, on a `model_error`, drew the phantom. */
|
|
19407
|
+
assistModelId: string().optional(),
|
|
19408
|
+
assistScore: number().optional(),
|
|
19409
|
+
exportedInBatch: string().optional(),
|
|
19410
|
+
createdAt: number()
|
|
19411
|
+
});
|
|
19412
|
+
/** The write form — the server owns `id`, `createdAt` and the frame binding. */
|
|
19413
|
+
var RetrainAnnotationDraftSchema = RetrainAnnotationSchema.omit({
|
|
19414
|
+
id: true,
|
|
19415
|
+
trackId: true,
|
|
19416
|
+
deviceId: true,
|
|
19417
|
+
mediaKey: true,
|
|
19418
|
+
createdAt: true,
|
|
19419
|
+
exportedInBatch: true
|
|
19420
|
+
});
|
|
19421
|
+
/** A track sitting in `staging`, with everything the worklist needs to rank it. */
|
|
19422
|
+
var RetrainTrackSchema = object({
|
|
19423
|
+
trackId: string(),
|
|
19424
|
+
deviceId: number(),
|
|
19425
|
+
className: string(),
|
|
19426
|
+
label: string().optional(),
|
|
19427
|
+
firstSeen: number(),
|
|
19428
|
+
lastSeen: number(),
|
|
19429
|
+
/** How many frames the dataset already holds from this track. */
|
|
19430
|
+
frameCount: number().int(),
|
|
19431
|
+
/** How many subjects have been annotated on those frames. `0` with
|
|
19432
|
+
* `frameCount: 0` is exactly "staging, still to work". */
|
|
19433
|
+
annotationCount: number().int()
|
|
19434
|
+
});
|
|
19435
|
+
/** A frame the picker may offer — an index row, no blob was read to produce it. */
|
|
19436
|
+
var RetrainFrameCandidateSchema = object({
|
|
19437
|
+
mediaKey: string(),
|
|
19438
|
+
kind: MediaFileKindEnum,
|
|
19439
|
+
timestamp: number(),
|
|
19440
|
+
sizeBytes: number().int(),
|
|
19441
|
+
/** A copy of this original already exists — selecting it is free and cannot
|
|
19442
|
+
* fail, whatever became of the original. */
|
|
19443
|
+
copied: boolean()
|
|
19444
|
+
});
|
|
19445
|
+
/** A frame the dataset OWNS: bytes copied at selection time. */
|
|
19446
|
+
var RetrainFrameSchema = object({
|
|
19447
|
+
frameId: string(),
|
|
19448
|
+
deviceId: number(),
|
|
19449
|
+
trackId: string(),
|
|
19450
|
+
/** Provenance only. It may already point at nothing — that is expected. */
|
|
19451
|
+
sourceMediaKey: string(),
|
|
19452
|
+
sourceKind: MediaFileKindEnum,
|
|
19453
|
+
sizeBytes: number().int(),
|
|
19454
|
+
width: number().int(),
|
|
19455
|
+
height: number().int(),
|
|
19456
|
+
copiedAt: number()
|
|
19457
|
+
});
|
|
19458
|
+
/** Why a copy-on-select could not be honoured — named, never a silent skip. */
|
|
19459
|
+
var RetrainCopyRefusalSchema = _enum([
|
|
19460
|
+
"source-missing",
|
|
19461
|
+
"unreadable-image",
|
|
19462
|
+
"write-failed"
|
|
19463
|
+
]);
|
|
19464
|
+
var RetrainFrameSelectionSchema = object({
|
|
19465
|
+
copied: array(RetrainFrameSchema).readonly(),
|
|
19466
|
+
refused: array(object({
|
|
19467
|
+
sourceMediaKey: string(),
|
|
19468
|
+
reason: RetrainCopyRefusalSchema
|
|
19469
|
+
})).readonly()
|
|
19470
|
+
});
|
|
19471
|
+
var RetrainFrameListSchema = object({
|
|
19472
|
+
candidates: array(RetrainFrameCandidateSchema).readonly(),
|
|
19473
|
+
copies: array(RetrainFrameSchema).readonly(),
|
|
19474
|
+
/** What the page pre-selects — the native key frame when one survives. */
|
|
19475
|
+
autoPickMediaKey: string().optional()
|
|
19476
|
+
});
|
|
19477
|
+
/** What the operator asked the assist to look for. */
|
|
19478
|
+
var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
|
|
19479
|
+
kind: literal("package"),
|
|
19480
|
+
zone: RetrainBboxSchema.optional()
|
|
19481
|
+
}), object({
|
|
19482
|
+
kind: literal("objects"),
|
|
19483
|
+
modelId: string(),
|
|
19484
|
+
minScore: number().optional()
|
|
19485
|
+
})]);
|
|
19486
|
+
/**
|
|
19487
|
+
* The assist's answer — a discriminated union, because "the model saw nothing"
|
|
19488
|
+
* and "this node cannot run that model" lead to different next moves and a
|
|
19489
|
+
* nullable result cannot tell them apart.
|
|
19490
|
+
*/
|
|
19491
|
+
var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
|
|
19492
|
+
kind: literal("proposed"),
|
|
19493
|
+
modelId: string(),
|
|
19494
|
+
stepId: string(),
|
|
19495
|
+
minScore: number(),
|
|
19496
|
+
/** Drafts, ready to edit. `source: 'assist'` until the operator touches one. */
|
|
19497
|
+
proposals: array(RetrainAnnotationDraftSchema).readonly(),
|
|
19498
|
+
/** Returned by the runner but removed by the threshold. */
|
|
19499
|
+
belowThreshold: number().int()
|
|
19500
|
+
}), object({
|
|
19501
|
+
kind: literal("refused"),
|
|
19502
|
+
/** `no-zone` is ours; the rest are the runner's own refusal vocabulary. */
|
|
19503
|
+
reason: string(),
|
|
19504
|
+
detail: string().optional()
|
|
19505
|
+
})]);
|
|
19506
|
+
/** The outcome of a lifecycle move owned by the retrain page. */
|
|
19507
|
+
var RetrainTransitionResultSchema = object({
|
|
19508
|
+
trackId: string(),
|
|
19509
|
+
/** Where the track ended up, whatever happened. */
|
|
19510
|
+
retrainStatus: RetrainStatusSchema,
|
|
19511
|
+
/** `false` ⇒ the move was refused or was a no-op; `reason` says which. */
|
|
19512
|
+
changed: boolean(),
|
|
19513
|
+
reason: _enum([
|
|
19514
|
+
"unknown-track",
|
|
19515
|
+
"no-frames-copied",
|
|
19516
|
+
"not-staging",
|
|
19517
|
+
"not-trained",
|
|
19518
|
+
"unchanged"
|
|
19519
|
+
]).optional()
|
|
19520
|
+
});
|
|
19521
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
19522
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
19523
|
+
var DeviceEventQueryInput = object({
|
|
19524
|
+
deviceId: number(),
|
|
19525
|
+
since: number().optional(),
|
|
19526
|
+
until: number().optional(),
|
|
19527
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
19528
|
+
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
19529
|
+
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
19530
|
+
* exact behaviour. Callers may omit this field — the store defaults to
|
|
19531
|
+
* `full` when not provided. */
|
|
19532
|
+
projection: _enum(["full", "slim"]).optional()
|
|
19533
|
+
});
|
|
19534
|
+
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
19535
|
+
var RecentTracksQueryInput = object({
|
|
19536
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
19537
|
+
deviceIds: array(number()),
|
|
19538
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
19539
|
+
since: number().optional(),
|
|
19540
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
19541
|
+
until: number().optional(),
|
|
19542
|
+
/** Page size. Default 200, max 1000. */
|
|
19543
|
+
limit: number().int().min(1).max(1e3).default(200),
|
|
19544
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
19545
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
19546
|
+
cursor: string().optional(),
|
|
19547
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
19548
|
+
projection: TrackProjectionSchema.optional(),
|
|
19549
|
+
/** Include stationary-promoted rows (parked objects). Default false: the
|
|
19550
|
+
* feed lists passages; parking records live on the stationary registry. */
|
|
19551
|
+
includeStationary: boolean().optional()
|
|
19552
|
+
});
|
|
19553
|
+
var RecentTracksPageSchema = object({
|
|
19554
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
19555
|
+
tracks: array(TrackSchema).readonly(),
|
|
19556
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
19557
|
+
nextCursor: string().nullable()
|
|
19558
|
+
});
|
|
19559
|
+
var LIST_GROUPS_DEFAULT_LIMIT = 40;
|
|
19560
|
+
var LIST_GROUPS_MAX_LIMIT = 100;
|
|
19561
|
+
var AnalyticsGroupRecordSchema = object({
|
|
19562
|
+
id: string(),
|
|
19563
|
+
deviceId: number().int(),
|
|
19564
|
+
openedAt: number().int(),
|
|
19565
|
+
closedAt: number().int(),
|
|
19566
|
+
timestamp: number().int(),
|
|
19567
|
+
memberCount: number().int(),
|
|
19568
|
+
memberTrackIds: array(string()).readonly(),
|
|
19569
|
+
className: string(),
|
|
19570
|
+
classes: array(string()).readonly(),
|
|
19571
|
+
/** Relative event-media path, or null when the group has no picture yet. */
|
|
19572
|
+
mediaUrl: string().nullable(),
|
|
19573
|
+
singleton: boolean()
|
|
19574
|
+
});
|
|
19575
|
+
var AnalyticsGroupMemberSchema = object({
|
|
19576
|
+
trackId: string(),
|
|
19577
|
+
deviceId: number().int(),
|
|
19578
|
+
className: string(),
|
|
19579
|
+
firstSeen: number().int(),
|
|
19580
|
+
lastSeen: number().int(),
|
|
19581
|
+
mediaUrl: string().nullable()
|
|
19582
|
+
});
|
|
19583
|
+
var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
|
|
19584
|
+
var ListGroupsQueryInput = object({
|
|
19585
|
+
/** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
|
|
19586
|
+
deviceIds: array(number()),
|
|
19587
|
+
/** Window lower bound on `closedAt` (inclusive). */
|
|
19588
|
+
since: number().optional(),
|
|
19589
|
+
/** Window upper bound on `openedAt` (inclusive). */
|
|
19590
|
+
until: number().optional(),
|
|
19591
|
+
limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
|
|
19592
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`. */
|
|
19593
|
+
cursor: string().optional()
|
|
19594
|
+
});
|
|
19595
|
+
var ListGroupsPageSchema = object({
|
|
19596
|
+
groups: array(AnalyticsGroupRecordSchema).readonly(),
|
|
19597
|
+
nextCursor: string().nullable()
|
|
19598
|
+
});
|
|
19599
|
+
var KeyEventQueryInput = object({
|
|
19600
|
+
deviceId: number(),
|
|
19601
|
+
/** Window lower bound (track firstSeen ≥ since). */
|
|
19602
|
+
since: number(),
|
|
19603
|
+
/** Window upper bound (track firstSeen ≤ until). */
|
|
19604
|
+
until: number(),
|
|
19605
|
+
limit: number().int().min(1).max(200).default(50),
|
|
19606
|
+
/** Drop tracks scoring below this importance. */
|
|
19607
|
+
minImportance: number().min(0).max(1).optional(),
|
|
19608
|
+
/** Restrict to a single class (e.g. 'person'). */
|
|
19609
|
+
classFilter: string().optional()
|
|
19610
|
+
});
|
|
19611
|
+
var KeyEventSchema = object({
|
|
19612
|
+
/** The representative event id (the track's best ObjectEvent, else its trackId). */
|
|
19613
|
+
id: string(),
|
|
19614
|
+
trackId: string(),
|
|
19615
|
+
/** Track start time (firstSeen). */
|
|
19616
|
+
timestamp: number(),
|
|
19617
|
+
className: string(),
|
|
19618
|
+
...TieredLabelFields,
|
|
19619
|
+
importance: number(),
|
|
19620
|
+
/** Highest-confidence ObjectEvent id for the track (empty when none). */
|
|
19621
|
+
bestEventId: string(),
|
|
19622
|
+
/** Track lifetime in ms (lastSeen - firstSeen). */
|
|
19623
|
+
windowMs: number().optional(),
|
|
19624
|
+
...TrackFlagFields,
|
|
19625
|
+
...TrackRetrainFields
|
|
19626
|
+
});
|
|
19627
|
+
object({
|
|
19628
|
+
trackId: string(),
|
|
19629
|
+
className: string(),
|
|
19630
|
+
confidence: number(),
|
|
19631
|
+
bbox: BoundingBoxSchema,
|
|
19632
|
+
zones: array(string()).readonly(),
|
|
19633
|
+
state: TrackStateSchema
|
|
19634
|
+
});
|
|
19635
|
+
var OverlayDetectionSchema = looseObject({
|
|
19636
|
+
id: string(),
|
|
19637
|
+
kind: _enum(["first-level", "detail"]),
|
|
19638
|
+
macroClass: string(),
|
|
19639
|
+
score: number(),
|
|
19640
|
+
bbox: object({
|
|
19641
|
+
x: number(),
|
|
19642
|
+
y: number(),
|
|
19643
|
+
width: number(),
|
|
19644
|
+
height: number()
|
|
19645
|
+
}),
|
|
19646
|
+
labels: array(looseObject({
|
|
19647
|
+
label: string(),
|
|
19648
|
+
score: number()
|
|
19649
|
+
})).readonly(),
|
|
19650
|
+
parentId: string().optional()
|
|
19651
|
+
});
|
|
19652
|
+
var ScoredObjectEventSchema = ObjectEventSchema.extend({ score: number() });
|
|
19653
|
+
var SearchObjectEventsInput = object({
|
|
19654
|
+
text: string(),
|
|
19655
|
+
deviceId: number().optional(),
|
|
19656
|
+
since: number().optional(),
|
|
19657
|
+
until: number().optional(),
|
|
19658
|
+
classFilter: string().optional(),
|
|
19659
|
+
limit: number().default(50),
|
|
19660
|
+
minScore: number().min(0).max(1).default(.2)
|
|
19661
|
+
});
|
|
19662
|
+
var TrackCascadeCountsSchema = object({
|
|
19663
|
+
/** Persisted track roots deleted (authoritative). */
|
|
19664
|
+
tracks: number().int(),
|
|
19665
|
+
/** Object events removed with their tracks (best-effort; see note above). */
|
|
19666
|
+
events: number().int(),
|
|
19667
|
+
/** Track/face/plate-owned media removed (best-effort). Never identity media. */
|
|
19668
|
+
media: number().int(),
|
|
19669
|
+
/** Unassigned (non-enrolled) face reads removed (best-effort). */
|
|
19670
|
+
faces: number().int(),
|
|
19671
|
+
/** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
|
|
19672
|
+
plates: number().int(),
|
|
19673
|
+
/** Per-track CLIP search vectors removed (best-effort). */
|
|
19674
|
+
embeddings: number().int(),
|
|
19675
|
+
/** Group membership + group rows removed with their last member (best-effort). */
|
|
19676
|
+
groups: number().int()
|
|
19677
|
+
});
|
|
19678
|
+
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
19679
|
+
var DiskReconcileCountsSchema = object({
|
|
19680
|
+
mediaDropped: number().int(),
|
|
19681
|
+
tracks: number().int(),
|
|
19682
|
+
events: number().int()
|
|
19683
|
+
});
|
|
19684
|
+
/** Event-store footprint for one camera. */
|
|
19685
|
+
var EventStoreDeviceFootprintSchema = object({
|
|
19686
|
+
deviceId: number(),
|
|
19687
|
+
/** Persisted event rows (motion + object + audio) for the camera. */
|
|
19688
|
+
rows: number().int(),
|
|
19689
|
+
/** Event-owned media bytes on disk for the camera. */
|
|
19690
|
+
bytes: number().int()
|
|
19691
|
+
});
|
|
19692
|
+
/** Aggregate event-store footprint: global totals + per-camera breakdown. */
|
|
19693
|
+
var EventStoreFootprintSchema = object({
|
|
19694
|
+
totalRows: number().int(),
|
|
19695
|
+
totalBytes: number().int(),
|
|
19696
|
+
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
19697
|
+
});
|
|
19698
|
+
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
19699
|
+
var EventPruneCountsSchema = object({
|
|
19700
|
+
motion: number().int(),
|
|
19701
|
+
object: number().int(),
|
|
19702
|
+
audio: number().int()
|
|
19703
|
+
});
|
|
19704
|
+
/**
|
|
19705
|
+
* Re-embed stored tracks from their key frames.
|
|
19706
|
+
*
|
|
19707
|
+
* The reason this is an operator-callable method and not a migration script:
|
|
19708
|
+
* every knob that decides what a vector MEANS — encoder model, crop margin,
|
|
19709
|
+
* squaring — is only changeable if the existing vectors can be regenerated.
|
|
19710
|
+
* Mixing feature spaces in one index makes cosine scores incomparable, and the
|
|
19711
|
+
* symptom is a quality regression with no visible cause.
|
|
19712
|
+
*/
|
|
19713
|
+
var RebuildObjectEmbeddingsInput = object({
|
|
19714
|
+
/** Restrict to one camera. Omit for the whole fleet. */
|
|
19715
|
+
deviceId: number().optional(),
|
|
19716
|
+
since: number().optional(),
|
|
19717
|
+
until: number().optional(),
|
|
19718
|
+
/** Stop after this many tracks; the result reports whether more remain. */
|
|
19719
|
+
maxTracks: number().int().positive().optional(),
|
|
19720
|
+
/**
|
|
19721
|
+
* Run every embedding on THIS node instead of round-robining the fleet.
|
|
19722
|
+
*
|
|
19723
|
+
* Named `executeOnNodeId` and not `nodeId` on purpose: an inline `nodeId`
|
|
19724
|
+
* field in cap args is read by `parent-unowned-call.ts` as a ROUTING PIN, so
|
|
19725
|
+
* calling it that would pin the rebuild REQUEST itself to that node — the
|
|
19726
|
+
* rebuild orchestration lives on the hub, and only the per-track step runs
|
|
19727
|
+
* remotely. This field is data; the per-track pin is applied inside.
|
|
19728
|
+
*
|
|
19729
|
+
* Absent ⇒ round-robin over every online node whose runner can serve the
|
|
19730
|
+
* pinned model.
|
|
19731
|
+
*/
|
|
19732
|
+
executeOnNodeId: string().optional(),
|
|
19733
|
+
/**
|
|
19734
|
+
* Milliseconds to wait between tracks; omit for the built-in default, `0` to
|
|
19735
|
+
* run flat out.
|
|
19736
|
+
*
|
|
19737
|
+
* A rebuild is bulk maintenance on hub-main's single thread. Measured
|
|
19738
|
+
* 2026-08-06, an unpaced pass held that thread busy 82.2 s out of 120 and
|
|
19739
|
+
* pushed `nodes.topology` from 0.25 s to 26 s for 43 minutes. The value in
|
|
19740
|
+
* force is logged at start and finish so a deliberately slow pass reads
|
|
19741
|
+
* differently from a stalled one.
|
|
19742
|
+
*/
|
|
19743
|
+
pacingMs: number().int().nonnegative().optional()
|
|
19744
|
+
});
|
|
19745
|
+
/**
|
|
19746
|
+
* Result of emptying the CLIP index.
|
|
19747
|
+
*
|
|
19748
|
+
* The clean slate before a policy change: a new crop margin or encoder model
|
|
19749
|
+
* leaves two feature spaces in one index whose cosine scores are not
|
|
19750
|
+
* comparable, so wiping and rebuilding is the only way to be sure every vector
|
|
19751
|
+
* means the same thing.
|
|
19752
|
+
*/
|
|
19753
|
+
var WipeObjectEmbeddingsResultSchema = object({ deleted: number() });
|
|
19754
|
+
/**
|
|
19755
|
+
* Acknowledgement that a rebuild STARTED.
|
|
19756
|
+
*
|
|
19757
|
+
* The pass costs ~1s per track — 45 minutes for a 2,600-track fleet — so it
|
|
19758
|
+
* runs detached and this returns immediately. Waiting for it made the client
|
|
19759
|
+
* time out while the work carried on server-side, which is the worst of both:
|
|
19760
|
+
* no result and no way to know it was still going. Poll
|
|
19761
|
+
* `getObjectEmbeddingRebuildStatus` for progress.
|
|
19762
|
+
*/
|
|
19763
|
+
var RebuildObjectEmbeddingsResultSchema = object({
|
|
19764
|
+
started: boolean(),
|
|
19765
|
+
/** True when a pass was already running; the new request is ignored. */
|
|
19766
|
+
alreadyRunning: boolean()
|
|
19767
|
+
});
|
|
19768
|
+
var RebuildStatusSchema = object({
|
|
19769
|
+
running: boolean(),
|
|
19770
|
+
scanned: number(),
|
|
19771
|
+
rebuilt: number(),
|
|
19772
|
+
/** Tracks whose key frame is gone — nothing to re-embed from. */
|
|
19773
|
+
missingKeyFrame: number(),
|
|
19774
|
+
/** Tracks with no usable detection box. */
|
|
19775
|
+
missingBbox: number(),
|
|
19776
|
+
/**
|
|
19777
|
+
* Tracks an executing node REFUSED rather than broke on — an unreadable key
|
|
19778
|
+
* frame, a step that threw. Separate from `failed` because the remedy is
|
|
19779
|
+
* different, and because a whole camera silently contributing zero vectors
|
|
19780
|
+
* is the shape of failure a rebuild must never hide.
|
|
19781
|
+
*/
|
|
19782
|
+
notRunnable: number(),
|
|
19783
|
+
/**
|
|
19784
|
+
* The pass stopped because NO node could serve the pinned model.
|
|
19785
|
+
*
|
|
19786
|
+
* Distinct from `notRunnable` on purpose: that one says "this track was
|
|
19787
|
+
* refused", this one says "the cluster cannot do this work at all" — every
|
|
19788
|
+
* candidate node either lacks the `clip-embedding` step, lacks a build of the
|
|
19789
|
+
* pinned model for its engine format, or dropped out. The remedy is a model /
|
|
19790
|
+
* engine change, not a per-camera one. Non-zero here always comes with
|
|
19791
|
+
* `complete: false`.
|
|
19792
|
+
*/
|
|
19793
|
+
noCapableNode: number(),
|
|
19794
|
+
failed: number(),
|
|
19795
|
+
/** Set once a pass ends: true only when EVERYTHING was covered. */
|
|
19796
|
+
complete: boolean().nullable(),
|
|
19797
|
+
startedAtMs: number().nullable(),
|
|
19798
|
+
finishedAtMs: number().nullable(),
|
|
19799
|
+
/** Present when the pass ended by throwing. */
|
|
19800
|
+
error: string().nullable()
|
|
19801
|
+
});
|
|
19802
|
+
var ReplayFrameInputSchema = object({
|
|
19803
|
+
timestamp: number(),
|
|
19804
|
+
frame: PipelineRunResultBridge
|
|
19805
|
+
});
|
|
19806
|
+
var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
19807
|
+
className: string(),
|
|
19808
|
+
firstSeenMs: number(),
|
|
19809
|
+
lastSeenMs: number(),
|
|
19810
|
+
/** Bbox of the track's FIRST matched detection, pixel-space in the clip's
|
|
19811
|
+
* frame — a representative box for the diff's `(className, window, IoU)`
|
|
19812
|
+
* pairing (`replay-diff.ts`). A replay does not need the full per-frame
|
|
19813
|
+
* trajectory production's `Track.positions` keeps. */
|
|
19814
|
+
bbox: BoundingBoxSchema,
|
|
19815
|
+
/** How many of the input frames this track matched a real detection on
|
|
19816
|
+
* (never a coasted/extrapolated frame) — the replay's own signal for "how
|
|
19817
|
+
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
19818
|
+
framesMatched: number().int()
|
|
19819
|
+
})).readonly() });
|
|
19820
|
+
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
19821
|
+
deviceId: number(),
|
|
19822
|
+
trackId: string()
|
|
19823
|
+
}), TrackSchema.nullable()), method(object({
|
|
19824
|
+
deviceId: number(),
|
|
19825
|
+
since: number().optional(),
|
|
19826
|
+
until: number().optional(),
|
|
19827
|
+
limit: number().optional(),
|
|
19828
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
19829
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
19830
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
19831
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
19832
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
19833
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
19834
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
19835
|
+
projection: TrackProjectionSchema.optional(),
|
|
19836
|
+
/** Include stationary-promoted rows (parked objects handed to the
|
|
19837
|
+
* stationary registry). Default false: the timeline lists passages,
|
|
19838
|
+
* not parking records (operator decision, 2026-08-15). */
|
|
19839
|
+
includeStationary: boolean().optional()
|
|
19840
|
+
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
|
|
19841
|
+
deviceId: number(),
|
|
19842
|
+
groupId: string().min(1)
|
|
19843
|
+
}), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
|
|
19844
|
+
kind: "mutation",
|
|
19845
|
+
auth: "admin"
|
|
19846
|
+
}), 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({
|
|
19847
|
+
deviceId: number(),
|
|
19848
|
+
since: number().optional(),
|
|
19849
|
+
until: number().optional(),
|
|
19850
|
+
kinds: array(string()).optional(),
|
|
19851
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
19852
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
19853
|
+
deviceId: number(),
|
|
19854
|
+
since: number(),
|
|
19855
|
+
until: number(),
|
|
19856
|
+
bucketMs: number().int().positive()
|
|
19857
|
+
}), array(object({
|
|
19858
|
+
bucketStart: number(),
|
|
19859
|
+
motion: number().int(),
|
|
19860
|
+
object: number().int(),
|
|
19861
|
+
audio: number().int()
|
|
19862
|
+
})).readonly()), method(object({
|
|
19863
|
+
deviceId: number(),
|
|
19864
|
+
cutoffMs: number()
|
|
19865
|
+
}), object({
|
|
19866
|
+
motion: number().int(),
|
|
19867
|
+
object: number().int(),
|
|
19868
|
+
audio: number().int()
|
|
19869
|
+
}), {
|
|
19870
|
+
kind: "mutation",
|
|
19871
|
+
auth: "admin"
|
|
19872
|
+
}), method(object({
|
|
19873
|
+
deviceId: number(),
|
|
19874
|
+
cutoffMs: number()
|
|
19875
|
+
}), TrackCascadeCountsSchema, {
|
|
19876
|
+
kind: "mutation",
|
|
19877
|
+
auth: "admin"
|
|
19878
|
+
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
19879
|
+
kind: "mutation",
|
|
19880
|
+
auth: "admin"
|
|
19881
|
+
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
19882
|
+
kind: "mutation",
|
|
19883
|
+
auth: "admin"
|
|
19884
|
+
}), method(object({
|
|
19885
|
+
deviceId: number(),
|
|
19886
|
+
trackIds: array(string()).min(1)
|
|
19887
|
+
}), object({
|
|
19888
|
+
deleted: number().int(),
|
|
19889
|
+
failed: array(string()).readonly()
|
|
19890
|
+
}), {
|
|
19891
|
+
kind: "mutation",
|
|
19892
|
+
auth: "admin"
|
|
19893
|
+
}), method(object({
|
|
19894
|
+
/** Log/audit scope only — the trackId is globally unique on its own. */
|
|
19895
|
+
deviceId: number(),
|
|
19896
|
+
trackId: string(),
|
|
19897
|
+
flags: TrackFlagsPatchSchema
|
|
19898
|
+
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
19899
|
+
kind: "query",
|
|
19900
|
+
auth: "admin"
|
|
19901
|
+
}), method(object({
|
|
19902
|
+
olderThanMs: number(),
|
|
19903
|
+
reason: OpsLogReasonSchema.optional()
|
|
19904
|
+
}), EventPruneCountsSchema, {
|
|
19905
|
+
kind: "mutation",
|
|
19906
|
+
auth: "admin"
|
|
19907
|
+
}), method(object({ deviceId: number() }), EventPruneCountsSchema, {
|
|
19908
|
+
kind: "mutation",
|
|
19909
|
+
auth: "admin"
|
|
19910
|
+
}), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
19911
|
+
kind: "mutation",
|
|
19912
|
+
auth: "admin"
|
|
19913
|
+
}), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
|
|
19914
|
+
kind: "mutation",
|
|
19915
|
+
auth: "admin"
|
|
19916
|
+
}), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
|
|
19917
|
+
kind: "mutation",
|
|
19918
|
+
auth: "admin"
|
|
19919
|
+
}), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
|
|
19920
|
+
kind: "mutation",
|
|
19921
|
+
auth: "admin"
|
|
19922
|
+
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
19923
|
+
kind: "mutation",
|
|
19924
|
+
auth: "admin"
|
|
19925
|
+
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
19926
|
+
kind: "mutation",
|
|
19927
|
+
auth: "admin"
|
|
19928
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
19929
|
+
kind: "query",
|
|
19930
|
+
auth: "admin"
|
|
19931
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
19932
|
+
kind: "mutation",
|
|
19933
|
+
auth: "admin"
|
|
19934
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
19935
|
+
kind: "query",
|
|
19936
|
+
auth: "admin"
|
|
19937
|
+
}), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
|
|
19938
|
+
kind: "query",
|
|
19939
|
+
auth: "admin"
|
|
19940
|
+
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
19941
|
+
kind: "query",
|
|
19942
|
+
auth: "admin"
|
|
19943
|
+
}), method(object({
|
|
19944
|
+
/** Empty ⇒ every camera that has staging tracks. A LIST, not a single
|
|
19945
|
+
* `deviceId`, deliberately: `deviceId` would make this device-bound and
|
|
19946
|
+
* route it at one camera's owner, and "every camera" would stop being
|
|
19947
|
+
* expressible at all. */
|
|
19948
|
+
deviceIds: array(number()).optional(),
|
|
19949
|
+
limit: number().int().min(1).max(500).optional()
|
|
19950
|
+
}), array(RetrainTrackSchema).readonly(), {
|
|
19951
|
+
kind: "query",
|
|
19952
|
+
auth: "admin"
|
|
19953
|
+
}), method(object({ trackId: string() }), RetrainFrameListSchema, {
|
|
19954
|
+
kind: "query",
|
|
19955
|
+
auth: "admin"
|
|
19956
|
+
}), method(object({
|
|
19957
|
+
deviceId: number(),
|
|
19958
|
+
trackId: string(),
|
|
19959
|
+
mediaKeys: array(string()).min(1)
|
|
19960
|
+
}), RetrainFrameSelectionSchema, {
|
|
19961
|
+
kind: "mutation",
|
|
19962
|
+
auth: "admin"
|
|
19963
|
+
}), method(object({
|
|
19964
|
+
deviceId: number(),
|
|
19965
|
+
trackId: string(),
|
|
19966
|
+
frameId: string()
|
|
19967
|
+
}), object({
|
|
19968
|
+
removed: boolean(),
|
|
19969
|
+
removedAnnotations: number().int()
|
|
19970
|
+
}), {
|
|
19971
|
+
kind: "mutation",
|
|
19972
|
+
auth: "admin"
|
|
19973
|
+
}), method(object({ frameId: string() }), object({
|
|
19974
|
+
base64: string(),
|
|
19975
|
+
width: number().int(),
|
|
19976
|
+
height: number().int()
|
|
19977
|
+
}), {
|
|
19978
|
+
kind: "query",
|
|
19979
|
+
auth: "admin"
|
|
19980
|
+
}), method(object({
|
|
19981
|
+
deviceId: number(),
|
|
19982
|
+
trackId: string(),
|
|
19983
|
+
frameId: string(),
|
|
19984
|
+
subject: RetrainAssistSubjectSchema,
|
|
19985
|
+
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
19986
|
+
nodeId: string().optional()
|
|
19987
|
+
}), RetrainAssistResultSchema, {
|
|
19988
|
+
kind: "mutation",
|
|
19989
|
+
auth: "admin"
|
|
19990
|
+
}), method(object({
|
|
19991
|
+
deviceId: number(),
|
|
19992
|
+
source: DetectionSourceSchema,
|
|
19993
|
+
zones: array(ZoneSchema).readonly().optional(),
|
|
19994
|
+
detectionRules: array(ZoneRuleSchema).readonly().optional(),
|
|
19995
|
+
zoneMembershipMinOverlap: number().min(0).max(1).optional(),
|
|
19996
|
+
frames: array(ReplayFrameInputSchema).min(1)
|
|
19997
|
+
}), RunReplayFrameProcessorResultSchema, {
|
|
19998
|
+
kind: "mutation",
|
|
19999
|
+
auth: "admin"
|
|
20000
|
+
}), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
|
|
20001
|
+
kind: "query",
|
|
20002
|
+
auth: "admin"
|
|
20003
|
+
}), method(object({
|
|
20004
|
+
deviceId: number(),
|
|
20005
|
+
trackId: string(),
|
|
20006
|
+
frameId: string(),
|
|
20007
|
+
annotations: array(RetrainAnnotationDraftSchema)
|
|
20008
|
+
}), array(RetrainAnnotationSchema).readonly(), {
|
|
20009
|
+
kind: "mutation",
|
|
20010
|
+
auth: "admin"
|
|
20011
|
+
}), method(object({
|
|
20012
|
+
deviceId: number(),
|
|
20013
|
+
trackId: string()
|
|
20014
|
+
}), RetrainTransitionResultSchema, {
|
|
20015
|
+
kind: "mutation",
|
|
20016
|
+
auth: "admin"
|
|
20017
|
+
}), method(object({
|
|
20018
|
+
deviceId: number(),
|
|
20019
|
+
trackId: string()
|
|
20020
|
+
}), RetrainTransitionResultSchema, {
|
|
20021
|
+
kind: "mutation",
|
|
20022
|
+
auth: "admin"
|
|
20023
|
+
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
20024
|
+
kind: "query",
|
|
20025
|
+
auth: "admin"
|
|
20026
|
+
}), method(object({
|
|
20027
|
+
eventId: string(),
|
|
20028
|
+
kind: MediaFileKindEnum.optional(),
|
|
20029
|
+
deviceId: number()
|
|
20030
|
+
}), array(MediaFileSchema).readonly()), method(object({
|
|
20031
|
+
trackId: string(),
|
|
20032
|
+
kinds: array(MediaFileKindEnum).optional(),
|
|
20033
|
+
deviceId: number()
|
|
20034
|
+
}), array(MediaFileSchema).readonly()), method(object({
|
|
20035
|
+
trackId: string(),
|
|
20036
|
+
deviceId: number()
|
|
20037
|
+
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
20038
|
+
kind: "mutation",
|
|
20039
|
+
auth: "admin"
|
|
20040
|
+
}), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
|
|
20041
|
+
kind: "mutation",
|
|
20042
|
+
auth: "admin"
|
|
20043
|
+
}), method(object({}), RebuildStatusSchema), object({
|
|
20044
|
+
deviceId: number(),
|
|
20045
|
+
timestamp: number(),
|
|
20046
|
+
frameWidth: number(),
|
|
20047
|
+
frameHeight: number(),
|
|
20048
|
+
detections: array(OverlayDetectionSchema).readonly()
|
|
20049
|
+
}), object({
|
|
20050
|
+
deviceId: number(),
|
|
20051
|
+
trackId: string(),
|
|
20052
|
+
className: string()
|
|
20053
|
+
}), object({
|
|
20054
|
+
deviceId: number(),
|
|
20055
|
+
trackId: string(),
|
|
20056
|
+
className: string(),
|
|
20057
|
+
durationMs: number()
|
|
20058
|
+
}), object({
|
|
20059
|
+
deviceId: number(),
|
|
20060
|
+
kind: EventKindSchema,
|
|
20061
|
+
eventId: string(),
|
|
20062
|
+
timestamp: number()
|
|
20063
|
+
});
|
|
19752
20064
|
object({
|
|
19753
20065
|
activeCameras: number(),
|
|
19754
20066
|
throttledCameras: number(),
|
|
@@ -19774,66 +20086,6 @@ var CameraMetricsSchema = object({
|
|
|
19774
20086
|
});
|
|
19775
20087
|
var CameraMetricsWithDeviceIdSchema = CameraMetricsSchema.extend({ deviceId: number() });
|
|
19776
20088
|
/**
|
|
19777
|
-
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
19778
|
-
*
|
|
19779
|
-
* Zones describe **where** in the frame the operator wants to flag
|
|
19780
|
-
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
19781
|
-
* each pipeline stage uses them. Splitting the two means a single
|
|
19782
|
-
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
19783
|
-
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
19784
|
-
* — without three duplicated polygons.
|
|
19785
|
-
*
|
|
19786
|
-
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
19787
|
-
* `zones` device-state slice on every mutation. Consumers
|
|
19788
|
-
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
19789
|
-
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
19790
|
-
* mirror with `onChanged`).
|
|
19791
|
-
*
|
|
19792
|
-
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
19793
|
-
* survive resolution changes and stream profile switches.
|
|
19794
|
-
*
|
|
19795
|
-
* `kind` discriminates between full polygons (closed regions used
|
|
19796
|
-
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
19797
|
-
* line segments used for cross events). Onboard / firmware-reported
|
|
19798
|
-
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
19799
|
-
* task list.
|
|
19800
|
-
*/
|
|
19801
|
-
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
19802
|
-
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
19803
|
-
var PolygonPointSchema = object({
|
|
19804
|
-
x: number(),
|
|
19805
|
-
y: number()
|
|
19806
|
-
});
|
|
19807
|
-
/** A camera detection zone — pure geometry/identity. */
|
|
19808
|
-
var ZoneSchema = object({
|
|
19809
|
-
id: string(),
|
|
19810
|
-
name: string(),
|
|
19811
|
-
kind: ZoneKindEnum.default("polygon"),
|
|
19812
|
-
/** Polygon vertices, fraction of frame (0–1). */
|
|
19813
|
-
polygon: array(PolygonPointSchema).readonly(),
|
|
19814
|
-
/** Visual color for UI rendering. */
|
|
19815
|
-
color: string().default("#3b82f6")
|
|
19816
|
-
});
|
|
19817
|
-
DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).readonly()), method(object({
|
|
19818
|
-
deviceId: number(),
|
|
19819
|
-
zone: ZoneSchema
|
|
19820
|
-
}), _void(), {
|
|
19821
|
-
kind: "mutation",
|
|
19822
|
-
auth: "admin"
|
|
19823
|
-
}), method(object({
|
|
19824
|
-
deviceId: number(),
|
|
19825
|
-
zoneId: string()
|
|
19826
|
-
}), _void(), {
|
|
19827
|
-
kind: "mutation",
|
|
19828
|
-
auth: "admin"
|
|
19829
|
-
}), method(object({
|
|
19830
|
-
deviceId: number(),
|
|
19831
|
-
zone: ZoneSchema
|
|
19832
|
-
}), _void(), {
|
|
19833
|
-
kind: "mutation",
|
|
19834
|
-
auth: "admin"
|
|
19835
|
-
}), object({ zones: array(ZoneSchema).readonly() });
|
|
19836
|
-
/**
|
|
19837
20089
|
* A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
|
|
19838
20090
|
* decode worker resolves it against the RETAINED native frame's real pixel dims,
|
|
19839
20091
|
* so the caller supplies only the detection-res bbox divided by the detection
|
|
@@ -21663,7 +21915,7 @@ method(object({
|
|
|
21663
21915
|
* linking rather than produce an eternal token.
|
|
21664
21916
|
*/
|
|
21665
21917
|
ttlSec: union([number().int().positive(), literal("never")]).optional()
|
|
21666
|
-
}), object({ token: string() })), method(object({ token: string() }), SsoBridgeClaimsSchema.nullable());
|
|
21918
|
+
}), object({ token: string() }), { auth: "admin" }), method(object({ token: string() }), SsoBridgeClaimsSchema.nullable(), { auth: "admin" });
|
|
21667
21919
|
var ProviderListEntrySchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21668
21920
|
providerId: string().min(1),
|
|
21669
21921
|
displayName: string().min(1),
|
|
@@ -21764,8 +22016,15 @@ var storageEvictableCapability = {
|
|
|
21764
22016
|
mode: "collection",
|
|
21765
22017
|
internal: true,
|
|
21766
22018
|
methods: {
|
|
22019
|
+
/**
|
|
22020
|
+
* `internal: true` did not gate the mount (see the 2026-08-26 note on
|
|
22021
|
+
* `data-store-provider`) — this was reachable on the AppRouter by ANY
|
|
22022
|
+
* authenticated session at the default `auth: 'protected'`. The only
|
|
22023
|
+
* consumer is the orchestrator's `StoragePressureManager`, which calls
|
|
22024
|
+
* `ctx.api` — never tRPC — so `auth: 'admin'` costs it nothing.
|
|
22025
|
+
*/
|
|
21767
22026
|
/** Bytes this provider holds on the given location — drives proportional fan-out. */
|
|
21768
|
-
getEvictableUsage: method(object({ locationId: string() }), EvictableUsageSchema),
|
|
22027
|
+
getEvictableUsage: method(object({ locationId: string() }), EvictableUsageSchema, { auth: "admin" }),
|
|
21769
22028
|
/**
|
|
21770
22029
|
* Free approximately `targetBytes` of this provider's OWN least-valuable
|
|
21771
22030
|
* data on the location (oldest footage, expired clips, …). Returns what it
|
|
@@ -21774,7 +22033,10 @@ var storageEvictableCapability = {
|
|
|
21774
22033
|
evict: method(object({
|
|
21775
22034
|
locationId: string(),
|
|
21776
22035
|
targetBytes: number().int().positive()
|
|
21777
|
-
}), EvictResultSchema, {
|
|
22036
|
+
}), EvictResultSchema, {
|
|
22037
|
+
kind: "mutation",
|
|
22038
|
+
auth: "admin"
|
|
22039
|
+
})
|
|
21778
22040
|
}
|
|
21779
22041
|
};
|
|
21780
22042
|
method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
|
|
@@ -21836,26 +22098,50 @@ var ReadChunkInputSchema = object({
|
|
|
21836
22098
|
length: number()
|
|
21837
22099
|
});
|
|
21838
22100
|
var EndDownloadInputSchema = object({ downloadId: string() });
|
|
21839
|
-
method(_void(), ProviderInfoSchema), method(object({ config: record(string(), unknown()) }), TestLocationResultSchema, { auth: "admin" }), method(object({
|
|
22101
|
+
method(_void(), ProviderInfoSchema, { auth: "admin" }), method(object({ config: record(string(), unknown()) }), TestLocationResultSchema, { auth: "admin" }), method(object({
|
|
21840
22102
|
location: StorageLocationSchema,
|
|
21841
22103
|
relativePath: string()
|
|
21842
|
-
}), string()), method(object({
|
|
22104
|
+
}), string(), { auth: "admin" }), method(object({
|
|
21843
22105
|
location: StorageLocationSchema,
|
|
21844
22106
|
relativePath: string(),
|
|
21845
22107
|
data: _instanceof(Uint8Array)
|
|
21846
|
-
}), _void(), {
|
|
22108
|
+
}), _void(), {
|
|
22109
|
+
kind: "mutation",
|
|
22110
|
+
auth: "admin"
|
|
22111
|
+
}), method(object({
|
|
21847
22112
|
location: StorageLocationSchema,
|
|
21848
22113
|
relativePath: string()
|
|
21849
|
-
}), _instanceof(Uint8Array)), method(object({
|
|
22114
|
+
}), _instanceof(Uint8Array), { auth: "admin" }), method(object({
|
|
21850
22115
|
location: StorageLocationSchema,
|
|
21851
22116
|
relativePath: string()
|
|
21852
|
-
}), boolean()), method(object({
|
|
22117
|
+
}), boolean(), { auth: "admin" }), method(object({
|
|
21853
22118
|
location: StorageLocationSchema,
|
|
21854
22119
|
prefix: string().optional()
|
|
21855
|
-
}), array(string()).readonly()), method(object({
|
|
22120
|
+
}), array(string()).readonly(), { auth: "admin" }), method(object({
|
|
21856
22121
|
location: StorageLocationSchema,
|
|
21857
22122
|
relativePath: string()
|
|
21858
|
-
}), _void(), {
|
|
22123
|
+
}), _void(), {
|
|
22124
|
+
kind: "mutation",
|
|
22125
|
+
auth: "admin"
|
|
22126
|
+
}), method(object({ location: StorageLocationSchema }), number().nullable(), { auth: "admin" }), method(BeginUploadInputSchema, BeginUploadResultSchema, {
|
|
22127
|
+
kind: "mutation",
|
|
22128
|
+
auth: "admin"
|
|
22129
|
+
}), method(WriteChunkInputSchema, _void(), {
|
|
22130
|
+
kind: "mutation",
|
|
22131
|
+
auth: "admin"
|
|
22132
|
+
}), method(FinalizeUploadInputSchema, _void(), {
|
|
22133
|
+
kind: "mutation",
|
|
22134
|
+
auth: "admin"
|
|
22135
|
+
}), method(AbortUploadInputSchema, _void(), {
|
|
22136
|
+
kind: "mutation",
|
|
22137
|
+
auth: "admin"
|
|
22138
|
+
}), method(BeginDownloadInputSchema, BeginDownloadResultSchema, {
|
|
22139
|
+
kind: "mutation",
|
|
22140
|
+
auth: "admin"
|
|
22141
|
+
}), method(ReadChunkInputSchema, _instanceof(Uint8Array), { auth: "admin" }), method(EndDownloadInputSchema, _void(), {
|
|
22142
|
+
kind: "mutation",
|
|
22143
|
+
auth: "admin"
|
|
22144
|
+
});
|
|
21859
22145
|
/** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
|
|
21860
22146
|
var ProfileSettingsSchemaBridge = unknown().nullable();
|
|
21861
22147
|
var ProfileSettingsBagSchema = record(string(), unknown());
|
|
@@ -22113,7 +22399,8 @@ method(object({
|
|
|
22113
22399
|
access: "create"
|
|
22114
22400
|
}), method(object({ userId: string().optional() }), object({ optionsJSON: record(string(), unknown()) }), {
|
|
22115
22401
|
kind: "mutation",
|
|
22116
|
-
access: "view"
|
|
22402
|
+
access: "view",
|
|
22403
|
+
auth: "admin"
|
|
22117
22404
|
}), method(object({
|
|
22118
22405
|
/** Required — the user the assertion belongs to (verified). */
|
|
22119
22406
|
userId: string(),
|
|
@@ -22121,10 +22408,12 @@ method(object({
|
|
|
22121
22408
|
response: record(string(), unknown())
|
|
22122
22409
|
}), object({ verified: boolean() }), {
|
|
22123
22410
|
kind: "mutation",
|
|
22124
|
-
access: "view"
|
|
22411
|
+
access: "view",
|
|
22412
|
+
auth: "admin"
|
|
22125
22413
|
}), method(object({}), object({ optionsJSON: record(string(), unknown()) }), {
|
|
22126
22414
|
kind: "mutation",
|
|
22127
|
-
access: "view"
|
|
22415
|
+
access: "view",
|
|
22416
|
+
auth: "admin"
|
|
22128
22417
|
}), method(object({
|
|
22129
22418
|
/** AuthenticationResponseJSON from the browser. */
|
|
22130
22419
|
response: record(string(), unknown()) }), object({
|
|
@@ -22132,7 +22421,8 @@ response: record(string(), unknown()) }), object({
|
|
|
22132
22421
|
userId: string().nullable()
|
|
22133
22422
|
}), {
|
|
22134
22423
|
kind: "mutation",
|
|
22135
|
-
access: "view"
|
|
22424
|
+
access: "view",
|
|
22425
|
+
auth: "admin"
|
|
22136
22426
|
}), method(object({ userId: string() }), array(PasskeySummarySchema), { auth: "admin" }), method(object({
|
|
22137
22427
|
userId: string(),
|
|
22138
22428
|
credentialId: string()
|
|
@@ -22304,7 +22594,19 @@ var VectorStatsResultSchema = object({
|
|
|
22304
22594
|
/** False when the backend ranks approximately. */
|
|
22305
22595
|
exact: boolean()
|
|
22306
22596
|
});
|
|
22307
|
-
method(VectorDeclareIndexInputSchema, _void(), {
|
|
22597
|
+
method(VectorDeclareIndexInputSchema, _void(), {
|
|
22598
|
+
kind: "mutation",
|
|
22599
|
+
auth: "admin"
|
|
22600
|
+
}), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
|
|
22601
|
+
kind: "mutation",
|
|
22602
|
+
auth: "admin"
|
|
22603
|
+
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
22604
|
+
kind: "mutation",
|
|
22605
|
+
auth: "admin"
|
|
22606
|
+
}), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
|
|
22607
|
+
kind: "mutation",
|
|
22608
|
+
auth: "admin"
|
|
22609
|
+
}), method(VectorStatsInputSchema, VectorStatsResultSchema, { auth: "admin" });
|
|
22308
22610
|
var ClipSchema = object({
|
|
22309
22611
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
22310
22612
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -27829,92 +28131,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSche
|
|
|
27829
28131
|
kind: "mutation",
|
|
27830
28132
|
auth: "admin"
|
|
27831
28133
|
});
|
|
27832
|
-
/**
|
|
27833
|
-
* Per-stage gating mode applied to the zones a rule references.
|
|
27834
|
-
*
|
|
27835
|
-
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
27836
|
-
* When at least one `include` rule fires for a stage, only entities
|
|
27837
|
-
* inside one of those zones pass that stage.
|
|
27838
|
-
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
27839
|
-
* Entities inside one of those zones are dropped at that stage.
|
|
27840
|
-
*
|
|
27841
|
-
* `monitor`-style observation (count without filtering) is not a rule
|
|
27842
|
-
* mode — zones without any matching rule are observed naturally by
|
|
27843
|
-
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
27844
|
-
* count, not filter" use case needs no rule at all.
|
|
27845
|
-
*/
|
|
27846
|
-
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
27847
|
-
/**
|
|
27848
|
-
* Per-consumer rule that references existing zones (geometry) and
|
|
27849
|
-
* defines how a specific pipeline stage should treat them. Each
|
|
27850
|
-
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
27851
|
-
* settings:
|
|
27852
|
-
*
|
|
27853
|
-
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
27854
|
-
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
27855
|
-
* - future: notification rules, audio gating, etc.
|
|
27856
|
-
*
|
|
27857
|
-
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
27858
|
-
* express "ignore motion in ALL of {garden, street}" with a single
|
|
27859
|
-
* rule. `classFilter` narrows the rule to specific object classes —
|
|
27860
|
-
* "drop person detections in the street, but keep cars" is one
|
|
27861
|
-
* `exclude` rule with `classFilter: ['person']`.
|
|
27862
|
-
*
|
|
27863
|
-
* `enabled` is a soft toggle — the operator can keep the rule
|
|
27864
|
-
* configured but inert without deleting it.
|
|
27865
|
-
*/
|
|
27866
|
-
var ZoneRuleSchema = object({
|
|
27867
|
-
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
27868
|
-
id: string(),
|
|
27869
|
-
/** Optional human-readable label rendered in the rule editor. */
|
|
27870
|
-
name: string().optional(),
|
|
27871
|
-
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
27872
|
-
* listed zones (OR-set: a detection in any one of them counts).
|
|
27873
|
-
* At least one zone id required — a rule with no targets is a
|
|
27874
|
-
* configuration mistake and the form validator rejects it. */
|
|
27875
|
-
zoneIds: array(string()).min(1).readonly(),
|
|
27876
|
-
mode: ZoneRuleModeEnum,
|
|
27877
|
-
/**
|
|
27878
|
-
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
27879
|
-
* applies to every class. Class strings match the `macroClass`
|
|
27880
|
-
* field on detections (e.g. `person`, `car`, `dog`).
|
|
27881
|
-
*/
|
|
27882
|
-
classFilter: array(string()).readonly().optional(),
|
|
27883
|
-
/**
|
|
27884
|
-
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
27885
|
-
* required to consider an entity "in the zone". Defaults to the
|
|
27886
|
-
* consumer's stage default when omitted. Kept for back-compat with
|
|
27887
|
-
* existing per-rule overrides; new operators pick the value via
|
|
27888
|
-
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
27889
|
-
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
27890
|
-
*/
|
|
27891
|
-
overlapThreshold: number().min(0).max(1).optional(),
|
|
27892
|
-
/**
|
|
27893
|
-
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
27894
|
-
* of the detection's bbox that must lie inside the zone for the
|
|
27895
|
-
* rule to match. Documented default is 85%; the engine substitutes
|
|
27896
|
-
* that when the field is omitted (kept optional so existing rules
|
|
27897
|
-
* stored without it stay valid).
|
|
27898
|
-
*
|
|
27899
|
-
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
27900
|
-
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
27901
|
-
* field exposed in the UI. Internally both feed the same gate.
|
|
27902
|
-
*/
|
|
27903
|
-
bboxInclusionPct: number().min(0).max(100).optional(),
|
|
27904
|
-
/**
|
|
27905
|
-
* When `true` and a detection has a segmentation mask, use the
|
|
27906
|
-
* mask for overlap instead of the bbox. Detection-stage only;
|
|
27907
|
-
* motion rules ignore this field.
|
|
27908
|
-
*/
|
|
27909
|
-
preferMask: boolean().optional(),
|
|
27910
|
-
/**
|
|
27911
|
-
* Soft-toggle: `false` disables the rule without deleting it.
|
|
27912
|
-
* Defaults to `true` so operators creating a rule via the UI
|
|
27913
|
-
* see it active immediately.
|
|
27914
|
-
*/
|
|
27915
|
-
enabled: boolean().default(true)
|
|
27916
|
-
});
|
|
27917
|
-
array(ZoneRuleSchema).readonly();
|
|
27918
28134
|
object({
|
|
27919
28135
|
/** Whether the script is currently executing. */
|
|
27920
28136
|
isRunning: boolean(),
|
|
@@ -31960,6 +32176,12 @@ Object.freeze({
|
|
|
31960
32176
|
addonId: null,
|
|
31961
32177
|
access: "create"
|
|
31962
32178
|
},
|
|
32179
|
+
"pipelineAnalytics.cancelRelocateMedia": {
|
|
32180
|
+
capName: "pipeline-analytics",
|
|
32181
|
+
capScope: "device",
|
|
32182
|
+
addonId: null,
|
|
32183
|
+
access: "create"
|
|
32184
|
+
},
|
|
31963
32185
|
"pipelineAnalytics.cancelStorageMigrationMove": {
|
|
31964
32186
|
capName: "pipeline-analytics",
|
|
31965
32187
|
capScope: "device",
|
|
@@ -32134,6 +32356,12 @@ Object.freeze({
|
|
|
32134
32356
|
addonId: null,
|
|
32135
32357
|
access: "view"
|
|
32136
32358
|
},
|
|
32359
|
+
"pipelineAnalytics.listRelocateMediaJobs": {
|
|
32360
|
+
capName: "pipeline-analytics",
|
|
32361
|
+
capScope: "device",
|
|
32362
|
+
addonId: null,
|
|
32363
|
+
access: "view"
|
|
32364
|
+
},
|
|
32137
32365
|
"pipelineAnalytics.listRetrainAnnotations": {
|
|
32138
32366
|
capName: "pipeline-analytics",
|
|
32139
32367
|
capScope: "device",
|
|
@@ -32212,6 +32440,12 @@ Object.freeze({
|
|
|
32212
32440
|
addonId: null,
|
|
32213
32441
|
access: "create"
|
|
32214
32442
|
},
|
|
32443
|
+
"pipelineAnalytics.relocateMedia": {
|
|
32444
|
+
capName: "pipeline-analytics",
|
|
32445
|
+
capScope: "device",
|
|
32446
|
+
addonId: null,
|
|
32447
|
+
access: "create"
|
|
32448
|
+
},
|
|
32215
32449
|
"pipelineAnalytics.restageRetrainTrack": {
|
|
32216
32450
|
capName: "pipeline-analytics",
|
|
32217
32451
|
capScope: "device",
|
|
@@ -32224,6 +32458,12 @@ Object.freeze({
|
|
|
32224
32458
|
addonId: null,
|
|
32225
32459
|
access: "create"
|
|
32226
32460
|
},
|
|
32461
|
+
"pipelineAnalytics.runReplayFrameProcessor": {
|
|
32462
|
+
capName: "pipeline-analytics",
|
|
32463
|
+
capScope: "device",
|
|
32464
|
+
addonId: null,
|
|
32465
|
+
access: "create"
|
|
32466
|
+
},
|
|
32227
32467
|
"pipelineAnalytics.saveRetrainAnnotations": {
|
|
32228
32468
|
capName: "pipeline-analytics",
|
|
32229
32469
|
capScope: "device",
|
|
@@ -32356,6 +32596,12 @@ Object.freeze({
|
|
|
32356
32596
|
addonId: null,
|
|
32357
32597
|
access: "view"
|
|
32358
32598
|
},
|
|
32599
|
+
"pipelineExecutor.getInferenceDeviceHealth": {
|
|
32600
|
+
capName: "pipeline-executor",
|
|
32601
|
+
capScope: "system",
|
|
32602
|
+
addonId: null,
|
|
32603
|
+
access: "view"
|
|
32604
|
+
},
|
|
32359
32605
|
"pipelineExecutor.getOrchestratorConfigSchema": {
|
|
32360
32606
|
capName: "pipeline-executor",
|
|
32361
32607
|
capScope: "system",
|
|
@@ -32428,6 +32674,12 @@ Object.freeze({
|
|
|
32428
32674
|
addonId: null,
|
|
32429
32675
|
access: "view"
|
|
32430
32676
|
},
|
|
32677
|
+
"pipelineExecutor.rearmInferenceDevice": {
|
|
32678
|
+
capName: "pipeline-executor",
|
|
32679
|
+
capScope: "system",
|
|
32680
|
+
addonId: null,
|
|
32681
|
+
access: "create"
|
|
32682
|
+
},
|
|
32431
32683
|
"pipelineExecutor.runAudioTest": {
|
|
32432
32684
|
capName: "pipeline-executor",
|
|
32433
32685
|
capScope: "system",
|
|
@@ -35676,6 +35928,11 @@ Object.freeze({
|
|
|
35676
35928
|
form: "single",
|
|
35677
35929
|
optional: false
|
|
35678
35930
|
}],
|
|
35931
|
+
"pipelineAnalytics.runReplayFrameProcessor": [{
|
|
35932
|
+
name: "deviceId",
|
|
35933
|
+
form: "single",
|
|
35934
|
+
optional: false
|
|
35935
|
+
}],
|
|
35679
35936
|
"pipelineAnalytics.saveRetrainAnnotations": [{
|
|
35680
35937
|
name: "deviceId",
|
|
35681
35938
|
form: "single",
|