@camstack/addon-decoder-ffmpeg 1.2.27 → 1.2.29
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/index.js +2085 -1842
- package/dist/index.mjs +2085 -1842
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6631,7 +6631,7 @@ function method(input, output, options) {
|
|
|
6631
6631
|
input,
|
|
6632
6632
|
output,
|
|
6633
6633
|
kind: options?.kind ?? "query",
|
|
6634
|
-
auth: options
|
|
6634
|
+
...options?.auth !== void 0 ? { auth: options.auth } : {},
|
|
6635
6635
|
...options?.access !== void 0 ? { access: options.access } : {},
|
|
6636
6636
|
...options?.caller !== void 0 ? { caller: options.caller } : {},
|
|
6637
6637
|
timeoutMs: options?.timeoutMs
|
|
@@ -6651,7 +6651,7 @@ function systemMethod(input, output, options) {
|
|
|
6651
6651
|
}
|
|
6652
6652
|
var StaticDirOutputSchema$1 = object({ staticDir: string() });
|
|
6653
6653
|
var VersionOutputSchema$1 = object({ version: string() });
|
|
6654
|
-
method(_void(), StaticDirOutputSchema$1), method(_void(), VersionOutputSchema$1);
|
|
6654
|
+
method(_void(), StaticDirOutputSchema$1, { auth: "admin" }), method(_void(), VersionOutputSchema$1, { auth: "admin" });
|
|
6655
6655
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
6656
6656
|
DeviceType["Camera"] = "camera";
|
|
6657
6657
|
DeviceType["Hub"] = "hub";
|
|
@@ -6972,7 +6972,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
6972
6972
|
}({});
|
|
6973
6973
|
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
6974
6974
|
var VersionOutputSchema = object({ version: string() });
|
|
6975
|
-
method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
|
|
6975
|
+
method(_void(), StaticDirOutputSchema, { auth: "admin" }), method(_void(), VersionOutputSchema, { auth: "admin" });
|
|
6976
6976
|
/**
|
|
6977
6977
|
* device-ops — device-scoped cap that unifies the per-IDevice operations
|
|
6978
6978
|
* previously routed through the `.device-ops` Moleculer bridge service.
|
|
@@ -7598,24 +7598,6 @@ var RecordingRetentionSchema = object({
|
|
|
7598
7598
|
maxSizeGb: number().min(0).optional()
|
|
7599
7599
|
});
|
|
7600
7600
|
/**
|
|
7601
|
-
* Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
|
|
7602
|
-
* sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
|
|
7603
|
-
* previews at. Five graduated steps; absent on a config = `standard` (the
|
|
7604
|
-
* shipped default, matching `sheet-geometry`/`sheet-composer`).
|
|
7605
|
-
*
|
|
7606
|
-
* Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
|
|
7607
|
-
* Each window's index sidecar carries its own tile dims, so a camera whose
|
|
7608
|
-
* preset changed over time renders every historical window at the dims it was
|
|
7609
|
-
* written with.
|
|
7610
|
-
*/
|
|
7611
|
-
var ScrubThumbnailPresetSchema = _enum([
|
|
7612
|
-
"minimal",
|
|
7613
|
-
"low",
|
|
7614
|
-
"standard",
|
|
7615
|
-
"high",
|
|
7616
|
-
"max"
|
|
7617
|
-
]);
|
|
7618
|
-
/**
|
|
7619
7601
|
* The full per-camera recording intent — the wire shape of a RecordingTarget.
|
|
7620
7602
|
*
|
|
7621
7603
|
* `bands` is the ONLY authored recording intent: what to record, when, and on
|
|
@@ -7623,7 +7605,11 @@ var ScrubThumbnailPresetSchema = _enum([
|
|
|
7623
7605
|
* other field is a storage knob (profiles, segment length, retention, scrub).
|
|
7624
7606
|
*
|
|
7625
7607
|
* STRICT on purpose: the legacy authoring surface (`schedule`/`schedules`/
|
|
7626
|
-
* `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30
|
|
7608
|
+
* `triggers`/`preBufferSec`/`postBufferSec`/`rules`) was retired 2026-07-30,
|
|
7609
|
+
* and `scrubThumbnails` — a five-step fidelity knob for a sprite tier that was
|
|
7610
|
+
* deleted on 2026-07-24 and had ZERO consumers in the recorder — on 2026-08-25
|
|
7611
|
+
* (D62: a switch that writes a store nobody reads is worse than no switch).
|
|
7612
|
+
* Stored rows keep loading: the READ schema is `.strip()` (config-store.ts).
|
|
7627
7613
|
* A stale caller must fail loudly — silently stripping its legacy intent would
|
|
7628
7614
|
* persist a band-less config, i.e. silently stop recording the camera.
|
|
7629
7615
|
*/
|
|
@@ -7646,14 +7632,7 @@ var RecordingConfigSchema = object({
|
|
|
7646
7632
|
* "off" is the absence of a covering band, never a band value.
|
|
7647
7633
|
*/
|
|
7648
7634
|
bands: array(RecordingBandSchema).default([]),
|
|
7649
|
-
retention: RecordingRetentionSchema.optional()
|
|
7650
|
-
/**
|
|
7651
|
-
* Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
|
|
7652
|
-
* timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
|
|
7653
|
-
* windows only — existing sheets are immutable, and each window's index
|
|
7654
|
-
* carries its own tile dims so mixed-preset history renders correctly.
|
|
7655
|
-
*/
|
|
7656
|
-
scrubThumbnails: ScrubThumbnailPresetSchema.optional()
|
|
7635
|
+
retention: RecordingRetentionSchema.optional()
|
|
7657
7636
|
}).strict();
|
|
7658
7637
|
/**
|
|
7659
7638
|
* Entity-relocation job state (storage entity-routing spec, Phase 4).
|
|
@@ -7729,10 +7708,11 @@ var RelocateFootageInputSchema = object({
|
|
|
7729
7708
|
* `RecordingConfig.enabled` or camera wrapper bindings. */
|
|
7730
7709
|
var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
|
|
7731
7710
|
var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
|
|
7732
|
-
var
|
|
7711
|
+
var RelocateMediaInputSchema = object({
|
|
7733
7712
|
toLocationId: string(),
|
|
7734
7713
|
throttleMbps: number().min(1).max(1e3).optional()
|
|
7735
|
-
})
|
|
7714
|
+
});
|
|
7715
|
+
var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
|
|
7736
7716
|
/** The independently selectable logical storage classes. `recordings`
|
|
7737
7717
|
* encompasses the high and mid segment profiles; `recordingsLow` is low
|
|
7738
7718
|
* segments; `eventMedia` is post-analysis blobs. */
|
|
@@ -8027,7 +8007,26 @@ var LabelDefinitionSchema = object({
|
|
|
8027
8007
|
description: string().optional(),
|
|
8028
8008
|
icon: string().optional()
|
|
8029
8009
|
});
|
|
8030
|
-
|
|
8010
|
+
/**
|
|
8011
|
+
* Wire schema for a per-model CATALOG classMap override
|
|
8012
|
+
* (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
|
|
8013
|
+
* restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
|
|
8014
|
+
* detection pipeline executor actually routes.
|
|
8015
|
+
*
|
|
8016
|
+
* This is deliberately a DIFFERENT, narrower shape than the general-purpose
|
|
8017
|
+
* `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
|
|
8018
|
+
* and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
|
|
8019
|
+
* enum) — the two used to share the name `ClassMapDefinition`/
|
|
8020
|
+
* `ClassMapDefinitionSchema`, which made the schema-type-twin guard
|
|
8021
|
+
* (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
|
|
8022
|
+
* are not: it is two different concepts colliding on a name. Keep this type
|
|
8023
|
+
* under its own name rather than reusing `ClassMapDefinition` — reusing it
|
|
8024
|
+
* would either narrow every `ClassMapDefinition` consumer to the four
|
|
8025
|
+
* detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
|
|
8026
|
+
* schema exists for (see the "rejects a classMap whose target is not a
|
|
8027
|
+
* detection macro" test in `model-catalog-schema.test.ts`).
|
|
8028
|
+
*/
|
|
8029
|
+
var DetectionCatalogClassMapSchema = object({
|
|
8031
8030
|
mapping: record(string(), _enum([
|
|
8032
8031
|
"person",
|
|
8033
8032
|
"vehicle",
|
|
@@ -8232,7 +8231,7 @@ var ModelCatalogEntrySchema = object({
|
|
|
8232
8231
|
* applies (Frigate / COCO public catalog). Set on a custom model whose raw
|
|
8233
8232
|
* labels already ARE the CamStack macros (Scrypted identity map).
|
|
8234
8233
|
*/
|
|
8235
|
-
classMap:
|
|
8234
|
+
classMap: DetectionCatalogClassMapSchema.optional()
|
|
8236
8235
|
});
|
|
8237
8236
|
var ConvertTargetSchema = discriminatedUnion("format", [object({
|
|
8238
8237
|
format: literal("openvino"),
|
|
@@ -8262,7 +8261,7 @@ var ModelConvertMetadataSchema = object({
|
|
|
8262
8261
|
"segmentation"
|
|
8263
8262
|
]),
|
|
8264
8263
|
faceAlignment: boolean().optional(),
|
|
8265
|
-
classMap:
|
|
8264
|
+
classMap: DetectionCatalogClassMapSchema.optional()
|
|
8266
8265
|
});
|
|
8267
8266
|
var ConvertResultSchema = object({
|
|
8268
8267
|
entry: ModelCatalogEntrySchema,
|
|
@@ -9125,7 +9124,7 @@ var AddonPageDeclarationSchema = object({
|
|
|
9125
9124
|
/** Display label for a CUSTOM `section` id (ignored for well-known ids). */
|
|
9126
9125
|
sectionLabel: string().optional()
|
|
9127
9126
|
});
|
|
9128
|
-
method(_void(), array(AddonPageDeclarationSchema).readonly());
|
|
9127
|
+
method(_void(), array(AddonPageDeclarationSchema).readonly(), { auth: "admin" });
|
|
9129
9128
|
var AddonHttpRouteSchema = object({
|
|
9130
9129
|
method: _enum([
|
|
9131
9130
|
"GET",
|
|
@@ -9360,7 +9359,7 @@ var WidgetMetadataSchema = object({
|
|
|
9360
9359
|
defaultColumns: number().int().min(1).max(12).default(6),
|
|
9361
9360
|
defaultRows: number().int().min(1).max(12).default(1)
|
|
9362
9361
|
});
|
|
9363
|
-
method(_void(), array(WidgetMetadataSchema).readonly());
|
|
9362
|
+
method(_void(), array(WidgetMetadataSchema).readonly(), { auth: "admin" });
|
|
9364
9363
|
/**
|
|
9365
9364
|
* `addon-widgets` — system-scoped singleton aggregator cap. Public-facing
|
|
9366
9365
|
* surface that admin-ui consumes through `useAddonWidgetsListWidgets()`.
|
|
@@ -10919,7 +10918,7 @@ var CustomModelDescriptorSchema = object({
|
|
|
10919
10918
|
stepId: string(),
|
|
10920
10919
|
entry: ModelCatalogEntrySchema
|
|
10921
10920
|
});
|
|
10922
|
-
method(_void(), array(CustomModelDescriptorSchema).readonly());
|
|
10921
|
+
method(_void(), array(CustomModelDescriptorSchema).readonly(), { auth: "admin" });
|
|
10923
10922
|
/**
|
|
10924
10923
|
* Query filter for settings-store collections.
|
|
10925
10924
|
*/
|
|
@@ -11006,7 +11005,8 @@ method(object({
|
|
|
11006
11005
|
}), _void(), { kind: "mutation" }), method(object({
|
|
11007
11006
|
namespace: string().optional(),
|
|
11008
11007
|
collection: string(),
|
|
11009
|
-
filter: QueryFilterSchema.optional()
|
|
11008
|
+
filter: QueryFilterSchema.optional(),
|
|
11009
|
+
columns: array(string()).readonly().optional()
|
|
11010
11010
|
}), array(SettingsRecordSchema).readonly()), method(object({
|
|
11011
11011
|
namespace: string().optional(),
|
|
11012
11012
|
collection: string(),
|
|
@@ -11069,46 +11069,87 @@ var EngineInfoSchema = object({
|
|
|
11069
11069
|
kind: _enum(["relational", "vector"]),
|
|
11070
11070
|
displayName: string()
|
|
11071
11071
|
});
|
|
11072
|
-
method(_void(), EngineInfoSchema), method(object({
|
|
11072
|
+
method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
11073
11073
|
namespace: string().optional(),
|
|
11074
11074
|
collection: string(),
|
|
11075
11075
|
key: string()
|
|
11076
|
-
}), unknown()), method(object({
|
|
11076
|
+
}), unknown(), { auth: "admin" }), method(object({
|
|
11077
11077
|
namespace: string().optional(),
|
|
11078
11078
|
collection: string(),
|
|
11079
11079
|
key: string(),
|
|
11080
11080
|
value: unknown()
|
|
11081
|
-
}), _void(), {
|
|
11081
|
+
}), _void(), {
|
|
11082
|
+
kind: "mutation",
|
|
11083
|
+
auth: "admin"
|
|
11084
|
+
}), method(object({
|
|
11082
11085
|
namespace: string().optional(),
|
|
11083
11086
|
collection: string(),
|
|
11084
|
-
filter: QueryFilterSchema.optional()
|
|
11085
|
-
|
|
11087
|
+
filter: QueryFilterSchema.optional(),
|
|
11088
|
+
/**
|
|
11089
|
+
* SQL-level column projection — MUST mirror `settings-store.query`.
|
|
11090
|
+
*
|
|
11091
|
+
* ⚠ An earlier version of this comment blamed Zod stripping, and that
|
|
11092
|
+
* was wrong — corrected 2026-08-26 after the hop map
|
|
11093
|
+
* (`docs/design/2026-08-26-mappa-hop-argomenti.md`) traced the path.
|
|
11094
|
+
* There is **no Zod parse at all** between the door and the engine: the
|
|
11095
|
+
* dispatcher forwards the payload verbatim and UDS carries it whole. A
|
|
11096
|
+
* field declared here reaches `SqliteSettingsBackend` either way.
|
|
11097
|
+
*
|
|
11098
|
+
* What actually lost `columns` was the THIRD declaration of this shape:
|
|
11099
|
+
* `SettingsQueryInput` in `interfaces/storage.ts`, a hand-written TS
|
|
11100
|
+
* interface the engine destructures from. The field existed on both
|
|
11101
|
+
* schemas and the engine still never read it, because nothing checks a
|
|
11102
|
+
* registered provider against `InferProvider<cap>` —
|
|
11103
|
+
* `ProviderRegistration.provider` is typed `object`.
|
|
11104
|
+
*
|
|
11105
|
+
* It is declared here anyway, and must stay in step with
|
|
11106
|
+
* `settings-store.query`: a caller reading only the cap definitions has
|
|
11107
|
+
* to be able to see that this call carries a projection.
|
|
11108
|
+
* `data-door-schema-parity.spec.ts` keeps the two aligned.
|
|
11109
|
+
*/
|
|
11110
|
+
columns: array(string()).readonly().optional()
|
|
11111
|
+
}), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
|
|
11086
11112
|
namespace: string().optional(),
|
|
11087
11113
|
collection: string(),
|
|
11088
11114
|
record: SettingsRecordSchema
|
|
11089
|
-
}), _void(), {
|
|
11115
|
+
}), _void(), {
|
|
11116
|
+
kind: "mutation",
|
|
11117
|
+
auth: "admin"
|
|
11118
|
+
}), method(object({
|
|
11090
11119
|
namespace: string().optional(),
|
|
11091
11120
|
collection: string(),
|
|
11092
11121
|
id: string(),
|
|
11093
11122
|
data: record(string(), unknown())
|
|
11094
|
-
}), _void(), {
|
|
11123
|
+
}), _void(), {
|
|
11124
|
+
kind: "mutation",
|
|
11125
|
+
auth: "admin"
|
|
11126
|
+
}), method(object({
|
|
11095
11127
|
namespace: string().optional(),
|
|
11096
11128
|
collection: string(),
|
|
11097
11129
|
key: string()
|
|
11098
|
-
}), _void(), {
|
|
11130
|
+
}), _void(), {
|
|
11131
|
+
kind: "mutation",
|
|
11132
|
+
auth: "admin"
|
|
11133
|
+
}), method(object({
|
|
11099
11134
|
namespace: string().optional(),
|
|
11100
11135
|
collection: string(),
|
|
11101
11136
|
filter: MutationFilterSchema
|
|
11102
|
-
}), object({ deleted: number().int() }), {
|
|
11137
|
+
}), object({ deleted: number().int() }), {
|
|
11138
|
+
kind: "mutation",
|
|
11139
|
+
auth: "admin"
|
|
11140
|
+
}), method(object({
|
|
11103
11141
|
namespace: string().optional(),
|
|
11104
11142
|
collection: string(),
|
|
11105
11143
|
filter: MutationFilterSchema,
|
|
11106
11144
|
data: record(string(), unknown())
|
|
11107
|
-
}), object({ updated: number().int() }), {
|
|
11145
|
+
}), object({ updated: number().int() }), {
|
|
11146
|
+
kind: "mutation",
|
|
11147
|
+
auth: "admin"
|
|
11148
|
+
}), method(object({
|
|
11108
11149
|
namespace: string().optional(),
|
|
11109
11150
|
collection: string(),
|
|
11110
11151
|
filter: QueryFilterSchema.optional()
|
|
11111
|
-
}), number()), method(object({
|
|
11152
|
+
}), number(), { auth: "admin" }), method(object({
|
|
11112
11153
|
namespace: string().optional(),
|
|
11113
11154
|
collection: string(),
|
|
11114
11155
|
field: string(),
|
|
@@ -11118,15 +11159,18 @@ method(_void(), EngineInfoSchema), method(object({
|
|
|
11118
11159
|
}), array(object({
|
|
11119
11160
|
bucket: number().int(),
|
|
11120
11161
|
count: number().int()
|
|
11121
|
-
})).readonly()), method(object({
|
|
11162
|
+
})).readonly(), { auth: "admin" }), method(object({
|
|
11122
11163
|
namespace: string().optional(),
|
|
11123
11164
|
collection: string()
|
|
11124
|
-
}), boolean()), method(object({
|
|
11165
|
+
}), boolean(), { auth: "admin" }), method(object({
|
|
11125
11166
|
namespace: string().optional(),
|
|
11126
11167
|
collection: string(),
|
|
11127
11168
|
columns: array(CollectionColumnSchema).readonly(),
|
|
11128
11169
|
indexes: array(CollectionIndexSchema).readonly().optional()
|
|
11129
|
-
}), _void(), {
|
|
11170
|
+
}), _void(), {
|
|
11171
|
+
kind: "mutation",
|
|
11172
|
+
auth: "admin"
|
|
11173
|
+
});
|
|
11130
11174
|
/**
|
|
11131
11175
|
* Stable UI option list for the `hwaccel` setting. Decoder addons
|
|
11132
11176
|
* reuse this for `globalSettingsSchema()` so the dropdown is
|
|
@@ -12347,7 +12391,7 @@ method(object({
|
|
|
12347
12391
|
crop: _instanceof(Uint8Array),
|
|
12348
12392
|
width: number(),
|
|
12349
12393
|
height: number()
|
|
12350
|
-
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
12394
|
+
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
12351
12395
|
/**
|
|
12352
12396
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12353
12397
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
@@ -12640,19 +12684,22 @@ method(LlmGenerateBaseInputSchema.extend({
|
|
|
12640
12684
|
runtime: ManagedRuntimeConfigSchema,
|
|
12641
12685
|
/** The managed profile's timeout, threaded by the hub provider. */
|
|
12642
12686
|
timeoutMs: number().int().positive().optional()
|
|
12643
|
-
}), LlmGenerateResultSchema, {
|
|
12687
|
+
}), LlmGenerateResultSchema, {
|
|
12688
|
+
kind: "mutation",
|
|
12689
|
+
auth: "admin"
|
|
12690
|
+
}), method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
|
|
12644
12691
|
kind: "mutation",
|
|
12645
12692
|
auth: "admin"
|
|
12646
12693
|
}), method(object({}), _void(), {
|
|
12647
12694
|
kind: "mutation",
|
|
12648
12695
|
auth: "admin"
|
|
12649
|
-
}), method(object({}), LlmRuntimeStatusSchema), method(object({ model: ManagedModelRefSchema }), _void(), {
|
|
12696
|
+
}), method(object({}), LlmRuntimeStatusSchema, { auth: "admin" }), method(object({ model: ManagedModelRefSchema }), _void(), {
|
|
12650
12697
|
kind: "mutation",
|
|
12651
12698
|
auth: "admin"
|
|
12652
12699
|
}), method(object({ file: string() }), _void(), {
|
|
12653
12700
|
kind: "mutation",
|
|
12654
12701
|
auth: "admin"
|
|
12655
|
-
}), method(object({}), array(LlmNodeModelSchema)), method(object({}), LlmRuntimeDiskUsageSchema);
|
|
12702
|
+
}), method(object({}), array(LlmNodeModelSchema), { auth: "admin" }), method(object({}), LlmRuntimeDiskUsageSchema, { auth: "admin" });
|
|
12656
12703
|
/**
|
|
12657
12704
|
* `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
|
|
12658
12705
|
* methods concat-fan across providers; single-row methods route to ONE
|
|
@@ -16125,1748 +16172,1958 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
16125
16172
|
*/
|
|
16126
16173
|
refreshTokenTtlSec: union([number().int().positive(), literal("never")]).optional()
|
|
16127
16174
|
});
|
|
16128
|
-
method(_void(), OauthIntegrationDescriptorSchema);
|
|
16175
|
+
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
16129
16176
|
/**
|
|
16130
|
-
*
|
|
16131
|
-
*
|
|
16132
|
-
*
|
|
16133
|
-
* persisted media. Owns the post-detection domain end-to-end:
|
|
16134
|
-
*
|
|
16135
|
-
* runner emits PipelineInferenceResult
|
|
16136
|
-
* ↓ (event bus)
|
|
16137
|
-
* pipeline-analytics subscriber
|
|
16138
|
-
* ↓ SORT tracker + zone engine + state analyzer + event emitter
|
|
16139
|
-
* → three DB collections (one per kind), one FS media tree, one
|
|
16140
|
-
* unified event emitter (FrameTracked + TrackStarted/Ended +
|
|
16141
|
-
* DetectionEvent on bus)
|
|
16142
|
-
*
|
|
16143
|
-
* Pure subscriber model. No `processFrame` cap method — the runner
|
|
16144
|
-
* already publishes the raw frame on the bus. The cap surface is
|
|
16145
|
-
* only QUERIES + per-device settings, bound on/off via
|
|
16146
|
-
* `device-manager.setWrapperActive`. `defaultActive: true` because
|
|
16147
|
-
* every camera with a detection pipeline wants its raw detections
|
|
16148
|
-
* refined; operators opt out per-device via BindingsTab when needed.
|
|
16149
|
-
*
|
|
16150
|
-
* Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
|
|
16151
|
-
* (per-device surface) and `track-trail` caps — see P11 cleanup.
|
|
16177
|
+
* Reference to the frame's retained NATIVE surface + the parent crop's placement
|
|
16178
|
+
* within the frame, so the executor can re-cut a leaf child ROI at native
|
|
16179
|
+
* resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
|
|
16152
16180
|
*/
|
|
16153
|
-
var
|
|
16154
|
-
|
|
16155
|
-
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16181
|
+
var NativeCropRefSchema = object({
|
|
16182
|
+
/** Handle keying the retained native surface (node-pinned to its owner). */
|
|
16183
|
+
handle: FrameHandleSchema,
|
|
16184
|
+
/** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
|
|
16185
|
+
cropFrameSpace: object({
|
|
16186
|
+
x: number(),
|
|
16187
|
+
y: number(),
|
|
16188
|
+
w: number(),
|
|
16189
|
+
h: number()
|
|
16190
|
+
})
|
|
16191
|
+
});
|
|
16192
|
+
object({
|
|
16193
|
+
crop: object({
|
|
16194
|
+
left: number(),
|
|
16195
|
+
top: number(),
|
|
16196
|
+
width: number().positive(),
|
|
16197
|
+
height: number().positive()
|
|
16198
|
+
}).optional(),
|
|
16199
|
+
content: object({
|
|
16200
|
+
width: number().int().positive(),
|
|
16201
|
+
height: number().int().positive()
|
|
16202
|
+
}),
|
|
16203
|
+
fit: _enum(["stretch", "contain"]),
|
|
16204
|
+
format: _enum([
|
|
16205
|
+
"rgb",
|
|
16206
|
+
"gray",
|
|
16207
|
+
"jpeg"
|
|
16208
|
+
])
|
|
16209
|
+
});
|
|
16165
16210
|
/**
|
|
16166
|
-
*
|
|
16167
|
-
*
|
|
16168
|
-
*
|
|
16211
|
+
* Process-local frame identity. It is serializable so it can ride an in-process
|
|
16212
|
+
* capability call, but `registryId` deliberately prevents resolution in any
|
|
16213
|
+
* other process or execution group.
|
|
16169
16214
|
*/
|
|
16170
|
-
var
|
|
16171
|
-
|
|
16172
|
-
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
"
|
|
16176
|
-
|
|
16177
|
-
|
|
16178
|
-
|
|
16179
|
-
|
|
16180
|
-
"
|
|
16181
|
-
"
|
|
16182
|
-
"
|
|
16183
|
-
"
|
|
16184
|
-
"
|
|
16215
|
+
var FrameRefSchema = object({
|
|
16216
|
+
registryId: string().min(1),
|
|
16217
|
+
id: string().min(1),
|
|
16218
|
+
width: number().int().positive(),
|
|
16219
|
+
height: number().int().positive(),
|
|
16220
|
+
format: _enum(["rgb", "gray"]),
|
|
16221
|
+
timestamp: number(),
|
|
16222
|
+
capturedAt: number().optional()
|
|
16223
|
+
});
|
|
16224
|
+
var ModelFormatSchema$1 = _enum([
|
|
16225
|
+
"onnx",
|
|
16226
|
+
"coreml",
|
|
16227
|
+
"openvino",
|
|
16228
|
+
"tflite",
|
|
16229
|
+
"pt",
|
|
16230
|
+
"gguf"
|
|
16185
16231
|
]);
|
|
16186
|
-
var
|
|
16187
|
-
"
|
|
16188
|
-
"
|
|
16189
|
-
"
|
|
16190
|
-
"
|
|
16191
|
-
"
|
|
16192
|
-
"custom",
|
|
16193
|
-
"package"
|
|
16232
|
+
var PipelineSlotSchema = _enum([
|
|
16233
|
+
"detector",
|
|
16234
|
+
"cropper",
|
|
16235
|
+
"classifier",
|
|
16236
|
+
"refiner",
|
|
16237
|
+
"audio-classifier"
|
|
16194
16238
|
]);
|
|
16195
|
-
|
|
16196
|
-
|
|
16197
|
-
|
|
16198
|
-
|
|
16199
|
-
|
|
16200
|
-
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
16201
|
-
labelKey: string(),
|
|
16202
|
-
/** English fallback label (kept for clients that don't translate). */
|
|
16203
|
-
label: string(),
|
|
16204
|
-
/** Hex color for timeline/legend rendering. */
|
|
16205
|
-
color: string(),
|
|
16206
|
-
/** Dictionary id → lucide component on the UI side. */
|
|
16207
|
-
iconId: string(),
|
|
16208
|
-
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
16209
|
-
icon: EventKindIconSchema,
|
|
16210
|
-
category: EventKindCategorySchema,
|
|
16211
|
-
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
16212
|
-
parentKind: string().nullable(),
|
|
16213
|
-
/** Derived from `parentKind`, explicit for the client tree. */
|
|
16214
|
-
level: EventKindLevelSchema,
|
|
16215
|
-
/** Which cap + device contributes this kind. For built-ins the camera
|
|
16216
|
-
* itself; for sensor kinds the LINKED source device. */
|
|
16217
|
-
source: object({
|
|
16218
|
-
capName: string(),
|
|
16219
|
-
deviceId: number()
|
|
16220
|
-
})
|
|
16239
|
+
var PipelineEngineChoiceSchema = object({
|
|
16240
|
+
runtime: _enum(["node", "python"]),
|
|
16241
|
+
backend: string(),
|
|
16242
|
+
format: ModelFormatSchema$1,
|
|
16243
|
+
device: string().optional()
|
|
16221
16244
|
});
|
|
16222
|
-
|
|
16223
|
-
|
|
16224
|
-
|
|
16225
|
-
|
|
16245
|
+
var AvailableEngineSchema = object({
|
|
16246
|
+
engine: PipelineEngineChoiceSchema,
|
|
16247
|
+
devices: array(object({
|
|
16248
|
+
id: string(),
|
|
16249
|
+
label: string(),
|
|
16250
|
+
description: string().optional()
|
|
16251
|
+
})).readonly(),
|
|
16252
|
+
defaultDevice: string()
|
|
16226
16253
|
});
|
|
16227
|
-
var
|
|
16254
|
+
var PipelineDefaultStepSchema = lazy(() => object({
|
|
16255
|
+
addonId: string(),
|
|
16256
|
+
addonName: string(),
|
|
16257
|
+
slot: PipelineSlotSchema,
|
|
16258
|
+
inputClasses: array(string()).readonly(),
|
|
16259
|
+
outputClasses: array(string()).readonly(),
|
|
16260
|
+
enabled: boolean(),
|
|
16261
|
+
modelId: string(),
|
|
16262
|
+
children: array(PipelineDefaultStepSchema).readonly(),
|
|
16263
|
+
group: string().optional(),
|
|
16264
|
+
settings: record(string(), unknown()).optional()
|
|
16265
|
+
}));
|
|
16266
|
+
var PipelineTemplateStepSchema = lazy(() => object({
|
|
16267
|
+
addonId: string(),
|
|
16268
|
+
enabled: boolean(),
|
|
16269
|
+
modelId: string(),
|
|
16270
|
+
children: array(PipelineTemplateStepSchema).readonly(),
|
|
16271
|
+
settings: record(string(), unknown()).optional()
|
|
16272
|
+
}));
|
|
16273
|
+
var PipelineTemplateSchema$1 = object({
|
|
16228
16274
|
id: string(),
|
|
16229
|
-
|
|
16230
|
-
|
|
16231
|
-
|
|
16232
|
-
|
|
16233
|
-
|
|
16234
|
-
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
16235
|
-
kind: string(),
|
|
16236
|
-
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
16237
|
-
value: record(string(), unknown()).nullable(),
|
|
16238
|
-
timestamp: number()
|
|
16239
|
-
});
|
|
16240
|
-
var TrackPositionSchema = object({
|
|
16241
|
-
x: number(),
|
|
16242
|
-
y: number(),
|
|
16243
|
-
timestamp: number(),
|
|
16244
|
-
bbox: BoundingBoxSchema
|
|
16275
|
+
name: string(),
|
|
16276
|
+
createdAt: string(),
|
|
16277
|
+
updatedAt: string(),
|
|
16278
|
+
engine: PipelineEngineChoiceSchema,
|
|
16279
|
+
steps: array(PipelineTemplateStepSchema).readonly()
|
|
16245
16280
|
});
|
|
16246
|
-
var
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16250
|
-
|
|
16281
|
+
var PipelineModelOptionSchema = object({
|
|
16282
|
+
id: string(),
|
|
16283
|
+
name: string(),
|
|
16284
|
+
formats: record(string(), object({
|
|
16285
|
+
downloaded: boolean(),
|
|
16286
|
+
sizeMB: number()
|
|
16287
|
+
})),
|
|
16288
|
+
group: ModelVariantGroupSchema.optional(),
|
|
16289
|
+
legacy: boolean().optional(),
|
|
16290
|
+
provider: ModelProviderIdSchema.optional()
|
|
16251
16291
|
});
|
|
16252
|
-
|
|
16253
|
-
|
|
16254
|
-
|
|
16255
|
-
|
|
16256
|
-
|
|
16257
|
-
|
|
16258
|
-
|
|
16259
|
-
|
|
16260
|
-
|
|
16261
|
-
|
|
16262
|
-
|
|
16292
|
+
var ConfigFieldBridge = custom();
|
|
16293
|
+
var PipelineAddonSchemaSchema = object({
|
|
16294
|
+
id: string(),
|
|
16295
|
+
name: string(),
|
|
16296
|
+
slot: PipelineSlotSchema,
|
|
16297
|
+
inputClasses: array(string()).readonly(),
|
|
16298
|
+
outputClasses: array(string()).readonly(),
|
|
16299
|
+
childSlots: array(PipelineSlotSchema).readonly(),
|
|
16300
|
+
models: array(PipelineModelOptionSchema).readonly(),
|
|
16301
|
+
defaultModelId: string(),
|
|
16302
|
+
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
16303
|
+
enabledByDefault: boolean().optional(),
|
|
16304
|
+
backfillIntoExistingOverrides: boolean().optional(),
|
|
16305
|
+
defaultConfidence: number(),
|
|
16306
|
+
group: string().optional(),
|
|
16307
|
+
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
16263
16308
|
});
|
|
16264
|
-
|
|
16265
|
-
|
|
16266
|
-
* complete Track including the frame-rate `positions[]` history and the
|
|
16267
|
-
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
16268
|
-
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
16269
|
-
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
16270
|
-
* zonesVisited, bestEventId, envelope, hasFace, hasEmbeddedFace, hasRider) and returns `positions` /
|
|
16271
|
-
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
16272
|
-
* `getTrack`. Mirrors the event-store `projection` convention
|
|
16273
|
-
* (`getObjectEvents` et al.).
|
|
16274
|
-
*/
|
|
16275
|
-
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
16276
|
-
/**
|
|
16277
|
-
* One audio-classification label heard on the track's camera while the
|
|
16278
|
-
* track was alive, aggregated per label. An "episode" is one persisted
|
|
16279
|
-
* audio event (the confident-classification path: score ≥ the device's
|
|
16280
|
-
* `classificationMinScore`, class-change-or-heartbeat coalesced) — NOT
|
|
16281
|
-
* one 32 ms inference chunk, so counts stay human-scaled.
|
|
16282
|
-
*/
|
|
16283
|
-
var TrackAudioLabelSchema = object({
|
|
16309
|
+
var PipelineSlotSchemaSchema = object({
|
|
16310
|
+
id: PipelineSlotSchema,
|
|
16284
16311
|
label: string(),
|
|
16285
|
-
|
|
16286
|
-
|
|
16287
|
-
|
|
16288
|
-
count: number(),
|
|
16289
|
-
firstAt: number(),
|
|
16290
|
-
lastAt: number()
|
|
16312
|
+
priority: number(),
|
|
16313
|
+
parentSlot: PipelineSlotSchema.nullable(),
|
|
16314
|
+
addons: array(PipelineAddonSchemaSchema).readonly()
|
|
16291
16315
|
});
|
|
16292
|
-
|
|
16293
|
-
|
|
16294
|
-
|
|
16295
|
-
|
|
16296
|
-
*
|
|
16297
|
-
* - `sensor` — a linked sensor/control device state change.
|
|
16298
|
-
* - `audio` — an audio event on the camera itself that was anomalous for
|
|
16299
|
-
* THAT camera, loud, and heard while nothing visual was happening (D62).
|
|
16300
|
-
*
|
|
16301
|
-
* The spatial subsystems (tracker association, occupancy count, re-id /
|
|
16302
|
-
* embedding, resurrection) MUST skip every synthetic source. Test for that
|
|
16303
|
-
* with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
|
|
16304
|
-
* check silently readmits every source added after it was written.
|
|
16305
|
-
*/
|
|
16306
|
-
var TrackSourceSchema = _enum([
|
|
16307
|
-
"pipeline",
|
|
16308
|
-
"sensor",
|
|
16309
|
-
"audio"
|
|
16310
|
-
]);
|
|
16311
|
-
/**
|
|
16312
|
-
* Where a track sits in the RETRAIN lifecycle (D81).
|
|
16313
|
-
*
|
|
16314
|
-
* - `none` — never marked, or un-marked. Evictable.
|
|
16315
|
-
* - `staging` — the operator wants this track as training material and has not
|
|
16316
|
-
* finished with it. **This is the only state retention holds**: the track and
|
|
16317
|
-
* everything it owns (object events, crops, keyframes, CLIP vector) survive
|
|
16318
|
-
* the device's age window.
|
|
16319
|
-
* - `trained` — the retrain page has taken what it needed. The frames it chose
|
|
16320
|
-
* were COPIED into the retrain dataset at selection time, so the dataset no
|
|
16321
|
-
* longer depends on the track's media and the track becomes EVICTABLE again.
|
|
16322
|
-
* Terminal for the plain `markForTrain` toggle: returning it to `staging` is
|
|
16323
|
-
* a deliberate action of the retrain page, not a side effect of a checkbox.
|
|
16324
|
-
*
|
|
16325
|
-
* There is no `null`. The state is stored `TEXT NOT NULL DEFAULT 'none'` because
|
|
16326
|
-
* the store's filter language has only positive equality and `whereIn` — no
|
|
16327
|
-
* negation, no IS NULL — so a NULL would be unselectable by ANY predicate and
|
|
16328
|
-
* would make the entire pre-column history immortal in one deploy.
|
|
16329
|
-
*/
|
|
16330
|
-
var RetrainStatusSchema = _enum([
|
|
16331
|
-
"none",
|
|
16332
|
-
"staging",
|
|
16333
|
-
"trained"
|
|
16334
|
-
]);
|
|
16335
|
-
/**
|
|
16336
|
-
* Per-track OPERATOR flags — set by hand from the admin UI or the viewer, never
|
|
16337
|
-
* by the pipeline. Spread into `TrackSchema` and `KeyEventSchema` from one place
|
|
16338
|
-
* so the two surfaces cannot drift.
|
|
16339
|
-
*
|
|
16340
|
-
* **Absent ≠ false.** A track that has never been touched omits the field; an
|
|
16341
|
-
* explicitly un-flagged track carries `false`. Legacy rows written before the
|
|
16342
|
-
* columns existed read as absent, and a consumer that needs a boolean should say
|
|
16343
|
-
* `flag === true`, not `flag !== false`.
|
|
16344
|
-
*
|
|
16345
|
-
* `markForTrain` is the WIRE FACE of {@link RetrainStatusSchema}, not a column:
|
|
16346
|
-
* it is exactly `retrainStatus === 'staging'`, in both directions. Writing
|
|
16347
|
-
* `true` moves `none → staging`, writing `false` moves `staging → none`, and a
|
|
16348
|
-
* `trained` track reports `false` while refusing both writes. The boolean is
|
|
16349
|
-
* kept because three surfaces drive a toggle off it; anything that needs to tell
|
|
16350
|
-
* "never marked" from "already trained" must read `retrainStatus`.
|
|
16351
|
-
*
|
|
16352
|
-
* `debug` does NOT pin; it is attention, not durability.
|
|
16353
|
-
*
|
|
16354
|
-
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
16355
|
-
* A favourited track is skipped by retention the same way `staging` is, but
|
|
16356
|
-
* it does not enter `none|staging|trained` and has no staging budget.
|
|
16357
|
-
*/
|
|
16358
|
-
var TrackFlagFields = {
|
|
16359
|
-
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
16360
|
-
* `'staging'`. */
|
|
16361
|
-
markForTrain: boolean().optional(),
|
|
16362
|
-
/** Operator marked this track for diagnostic attention. */
|
|
16363
|
-
debug: boolean().optional(),
|
|
16364
|
-
/** Operator favourited this track. Pins it against pruning. */
|
|
16365
|
-
favourited: boolean().optional()
|
|
16366
|
-
};
|
|
16367
|
-
/**
|
|
16368
|
-
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
16369
|
-
* Deliberately NOT part of {@link TrackFlagFields}: that group also builds the
|
|
16370
|
-
* write patch, and the status is not something the toggle sets — it is what the
|
|
16371
|
-
* toggle's boolean is derived from. Absent on an in-RAM track never touched;
|
|
16372
|
-
* always present on a persisted row (the column default materialises `'none'`).
|
|
16373
|
-
*/
|
|
16374
|
-
var TrackRetrainFields = { retrainStatus: RetrainStatusSchema.optional() };
|
|
16375
|
-
/**
|
|
16376
|
-
* The write half: a PARTIAL patch. An omitted key is left untouched, so setting
|
|
16377
|
-
* one flag can never clear the other — the toggles are independent and are
|
|
16378
|
-
* driven from three surfaces that do not know about each other.
|
|
16379
|
-
*/
|
|
16380
|
-
var TrackFlagsPatchSchema = object(TrackFlagFields);
|
|
16381
|
-
/**
|
|
16382
|
-
* The resolved flag state after a write. Both fields are REQUIRED here (absent
|
|
16383
|
-
* collapses to `false`) so a caller can drive a toggle's checked state off the
|
|
16384
|
-
* mutation result without a re-fetch.
|
|
16385
|
-
*/
|
|
16386
|
-
var TrackFlagsSchema = object({
|
|
16387
|
-
trackId: string(),
|
|
16388
|
-
markForTrain: boolean(),
|
|
16389
|
-
debug: boolean(),
|
|
16390
|
-
favourited: boolean(),
|
|
16391
|
-
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
16392
|
-
* a track row) because this shape is only ever produced by the write body,
|
|
16393
|
-
* which always knows it — and a surface that has just written needs to render
|
|
16394
|
-
* `trained` without a re-fetch. */
|
|
16395
|
-
retrainStatus: RetrainStatusSchema
|
|
16316
|
+
var PipelineSchemaSchema = object({
|
|
16317
|
+
availableEngines: array(AvailableEngineSchema).readonly(),
|
|
16318
|
+
selectedEngine: PipelineEngineChoiceSchema,
|
|
16319
|
+
slots: array(PipelineSlotSchemaSchema).readonly()
|
|
16396
16320
|
});
|
|
16397
|
-
|
|
16398
|
-
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
|
|
16404
|
-
|
|
16405
|
-
|
|
16406
|
-
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
|
|
16410
|
-
|
|
16411
|
-
|
|
16412
|
-
|
|
16413
|
-
|
|
16321
|
+
var EngineProvisioningSchema = object({
|
|
16322
|
+
runtimeId: _enum([
|
|
16323
|
+
"onnx",
|
|
16324
|
+
"openvino",
|
|
16325
|
+
"coreml",
|
|
16326
|
+
"edgetpu"
|
|
16327
|
+
]).nullable(),
|
|
16328
|
+
device: string().nullable(),
|
|
16329
|
+
state: _enum([
|
|
16330
|
+
"idle",
|
|
16331
|
+
"installing",
|
|
16332
|
+
"verifying",
|
|
16333
|
+
"ready",
|
|
16334
|
+
"failed"
|
|
16335
|
+
]),
|
|
16336
|
+
progress: number().optional(),
|
|
16337
|
+
error: string().optional(),
|
|
16338
|
+
nextRetryAt: number().optional(),
|
|
16414
16339
|
/**
|
|
16415
|
-
*
|
|
16416
|
-
*
|
|
16417
|
-
*
|
|
16418
|
-
*
|
|
16419
|
-
*
|
|
16420
|
-
*
|
|
16421
|
-
* the thing that does not move, so it is what a rule matches on
|
|
16422
|
-
* (`NcConditions.identities`) and the text is what a human is shown.
|
|
16423
|
-
*
|
|
16424
|
-
* Absent when the label names no gallery row — a plate the OCR read but no
|
|
16425
|
-
* vehicle claims, a sub-class, a species, any tier-1 value.
|
|
16340
|
+
* Gate A (config-correctness gate at engine change): human-readable
|
|
16341
|
+
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
16342
|
+
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
16343
|
+
* has a <format> build"). Additive/optional: informational only, never
|
|
16344
|
+
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
16345
|
+
* Absent/empty when the node-default tree resolves cleanly.
|
|
16426
16346
|
*/
|
|
16427
|
-
|
|
16347
|
+
configIssues: array(string()).optional()
|
|
16428
16348
|
});
|
|
16429
|
-
|
|
16430
|
-
|
|
16431
|
-
|
|
16432
|
-
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
|
|
16436
|
-
|
|
16437
|
-
|
|
16438
|
-
|
|
16439
|
-
|
|
16440
|
-
|
|
16441
|
-
|
|
16442
|
-
|
|
16443
|
-
|
|
16444
|
-
|
|
16445
|
-
|
|
16446
|
-
|
|
16447
|
-
|
|
16448
|
-
|
|
16449
|
-
|
|
16450
|
-
|
|
16451
|
-
|
|
16452
|
-
/**
|
|
16453
|
-
|
|
16454
|
-
|
|
16455
|
-
|
|
16456
|
-
|
|
16457
|
-
|
|
16458
|
-
|
|
16459
|
-
|
|
16460
|
-
|
|
16461
|
-
|
|
16462
|
-
|
|
16463
|
-
|
|
16464
|
-
|
|
16465
|
-
|
|
16466
|
-
|
|
16467
|
-
|
|
16468
|
-
|
|
16469
|
-
|
|
16470
|
-
|
|
16349
|
+
var PipelineStepInputSchema = lazy(() => object({
|
|
16350
|
+
addonId: string(),
|
|
16351
|
+
modelId: string().optional(),
|
|
16352
|
+
enabled: boolean().default(true),
|
|
16353
|
+
children: array(PipelineStepInputSchema).optional(),
|
|
16354
|
+
settings: record(string(), unknown()).optional(),
|
|
16355
|
+
jumpDeviceKey: string().optional()
|
|
16356
|
+
}));
|
|
16357
|
+
var ModelSubstitutionSchema = object({
|
|
16358
|
+
addonId: string(),
|
|
16359
|
+
chosen: string(),
|
|
16360
|
+
running: string(),
|
|
16361
|
+
format: string()
|
|
16362
|
+
});
|
|
16363
|
+
var PipelineValidationIssueSchema = object({
|
|
16364
|
+
addonId: string(),
|
|
16365
|
+
kind: _enum(["unknown-addon", "no-format-build"]),
|
|
16366
|
+
detail: string()
|
|
16367
|
+
});
|
|
16368
|
+
var PipelineValidationResultSchema = object({
|
|
16369
|
+
ok: boolean(),
|
|
16370
|
+
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
16371
|
+
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
16372
|
+
/** The node's `currentEngine.format` this validation ran against. */
|
|
16373
|
+
format: string()
|
|
16374
|
+
});
|
|
16375
|
+
var ReferenceImageEntrySchema = object({
|
|
16376
|
+
filename: string(),
|
|
16377
|
+
stepIds: array(string()).readonly().optional()
|
|
16378
|
+
});
|
|
16379
|
+
var ReferenceImageBodySchema = object({
|
|
16380
|
+
base64: string(),
|
|
16381
|
+
filename: string()
|
|
16382
|
+
});
|
|
16383
|
+
var ReferenceAudioEntrySchema = object({
|
|
16384
|
+
filename: string(),
|
|
16385
|
+
sizeKb: number()
|
|
16386
|
+
});
|
|
16387
|
+
var ReferenceAudioBodySchema = object({ base64: string() });
|
|
16388
|
+
var AudioBackendSchema = object({
|
|
16389
|
+
id: string(),
|
|
16390
|
+
name: string(),
|
|
16391
|
+
description: string(),
|
|
16392
|
+
available: boolean(),
|
|
16393
|
+
/**
|
|
16394
|
+
* Raw classifier labels this backend can emit (e.g. YAMNet's
|
|
16395
|
+
* 521-class set or Apple SoundAnalysis's 303-class set). Used by
|
|
16396
|
+
* the benchmark UI to populate the `enabledMicroClasses` filter
|
|
16397
|
+
* specific to the selected backend without a separate fetch.
|
|
16398
|
+
*/
|
|
16399
|
+
rawLabels: array(string()).readonly().optional()
|
|
16400
|
+
});
|
|
16401
|
+
var AudioCapabilitiesSchema = object({
|
|
16402
|
+
activeBackend: string(),
|
|
16403
|
+
availableBackends: array(AudioBackendSchema).readonly(),
|
|
16404
|
+
sampleRate: number(),
|
|
16405
|
+
chunkDurationMs: number()
|
|
16406
|
+
});
|
|
16407
|
+
var DownloadModelResultSchema = object({
|
|
16408
|
+
filePath: string(),
|
|
16409
|
+
sizeMB: number(),
|
|
16410
|
+
durationMs: number()
|
|
16471
16411
|
});
|
|
16472
16412
|
/**
|
|
16473
|
-
*
|
|
16474
|
-
*
|
|
16413
|
+
* Wrapper carrying a single test run's result. Replaces the legacy
|
|
16414
|
+
* ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
|
|
16415
|
+
* canonical `AudioResult` from the Phase 6 output rework: one
|
|
16416
|
+
* `AudioDetection` per class above `minScore`, top-N candidates in
|
|
16417
|
+
* `debug.alternateLabels['audio-classifier']`, per-source timings in
|
|
16418
|
+
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
16419
|
+
* benchmark UI can still report a clean failure when the classifier
|
|
16420
|
+
* cap isn't available.
|
|
16475
16421
|
*/
|
|
16476
|
-
var
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
|
|
16480
|
-
byteCount: number().int(),
|
|
16481
|
-
/** More marked tracks exist than a single pass carries. */
|
|
16482
|
-
truncated: boolean(),
|
|
16483
|
-
devices: array(TrainingExportDeviceTotalsSchema).readonly()
|
|
16422
|
+
var AudioTestResultSchema = object({
|
|
16423
|
+
success: boolean(),
|
|
16424
|
+
error: string().optional(),
|
|
16425
|
+
frame: custom().optional()
|
|
16484
16426
|
});
|
|
16485
|
-
var
|
|
16486
|
-
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16497
|
-
|
|
16498
|
-
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
|
|
16427
|
+
var PipelineConfigBridge = custom();
|
|
16428
|
+
var ConfigUISchemaBridge = custom();
|
|
16429
|
+
var ConfigUISchemaNullableBridge = custom();
|
|
16430
|
+
var InferenceCapabilitiesBridge = custom();
|
|
16431
|
+
var ModelAvailabilityListBridge = custom();
|
|
16432
|
+
var PipelineRunResultBridge = custom();
|
|
16433
|
+
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
16434
|
+
modelId: string(),
|
|
16435
|
+
settings: record(string(), unknown()).readonly()
|
|
16436
|
+
}))), method(object({ steps: record(string(), object({
|
|
16437
|
+
modelId: string(),
|
|
16438
|
+
settings: record(string(), unknown()).readonly()
|
|
16439
|
+
})) }), object({ success: literal(true) }), {
|
|
16440
|
+
kind: "mutation",
|
|
16441
|
+
auth: "admin"
|
|
16442
|
+
}), method(object({ nodeId: string() }), object({
|
|
16443
|
+
success: literal(true),
|
|
16444
|
+
clearedDevices: number()
|
|
16445
|
+
}), {
|
|
16446
|
+
kind: "mutation",
|
|
16447
|
+
auth: "admin"
|
|
16448
|
+
}), method(object({ nodeId: string() }), object({ unhealthy: array(object({
|
|
16449
|
+
/** `<backend>:<device>`, e.g. `openvino:gpu`. */
|
|
16450
|
+
deviceKey: string(),
|
|
16502
16451
|
/**
|
|
16503
|
-
*
|
|
16504
|
-
*
|
|
16505
|
-
*
|
|
16506
|
-
*
|
|
16507
|
-
* and no card can render — so every free-text search surface was structurally
|
|
16508
|
-
* unable to answer "show me the tracks in Uscio", and did not fail loudly, it
|
|
16509
|
-
* just returned nothing. Resolving here rather than in each client keeps ONE
|
|
16510
|
-
* derivation and costs the clients no extra call (the `zones` cap is
|
|
16511
|
-
* per-device, so a client-side resolve would be a per-camera fan-out on a
|
|
16512
|
-
* surface built to avoid exactly that).
|
|
16513
|
-
*
|
|
16514
|
-
* Resolved, never invented: a zone deleted since the track was written has no
|
|
16515
|
-
* name and is DROPPED, so this array can be shorter than `zonesVisited` — the
|
|
16516
|
-
* two are not positionally aligned. Absent when the track visited no zone, or
|
|
16517
|
-
* when the zone catalogue could not be read.
|
|
16452
|
+
* `failed` — the per-device restart budget is exhausted; no pool
|
|
16453
|
+
* will be spawned until an operator re-arms it or the runner
|
|
16454
|
+
* respawns. `backoff` — under budget, waiting out the backoff (or
|
|
16455
|
+
* a cached pool observed dead and not yet condemned).
|
|
16518
16456
|
*/
|
|
16519
|
-
|
|
16520
|
-
/**
|
|
16521
|
-
|
|
16522
|
-
|
|
16523
|
-
|
|
16524
|
-
/**
|
|
16525
|
-
|
|
16526
|
-
|
|
16527
|
-
|
|
16528
|
-
|
|
16529
|
-
|
|
16530
|
-
|
|
16531
|
-
|
|
16532
|
-
|
|
16533
|
-
|
|
16534
|
-
|
|
16535
|
-
|
|
16536
|
-
|
|
16537
|
-
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16457
|
+
state: _enum(["failed", "backoff"]),
|
|
16458
|
+
/** Epoch ms of the death that produced this state. */
|
|
16459
|
+
since: number(),
|
|
16460
|
+
/** Pool deaths inside the current window. */
|
|
16461
|
+
deaths: number(),
|
|
16462
|
+
/** The last death's message. */
|
|
16463
|
+
lastError: string()
|
|
16464
|
+
})).readonly() })), method(object({
|
|
16465
|
+
nodeId: string(),
|
|
16466
|
+
deviceKey: string()
|
|
16467
|
+
}), object({ rearmed: boolean() }), {
|
|
16468
|
+
kind: "mutation",
|
|
16469
|
+
auth: "admin"
|
|
16470
|
+
}), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({ steps: array(PipelineStepInputSchema) }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
|
|
16471
|
+
name: string(),
|
|
16472
|
+
steps: array(PipelineTemplateStepSchema).readonly(),
|
|
16473
|
+
engine: PipelineEngineChoiceSchema
|
|
16474
|
+
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
|
|
16475
|
+
id: string(),
|
|
16476
|
+
name: string().optional(),
|
|
16477
|
+
steps: array(PipelineTemplateStepSchema).readonly().optional()
|
|
16478
|
+
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
|
|
16479
|
+
addonId: string(),
|
|
16480
|
+
modelId: string(),
|
|
16481
|
+
format: ModelFormatSchema$1
|
|
16482
|
+
}), DownloadModelResultSchema, { kind: "mutation" }), method(object({
|
|
16483
|
+
addonId: string(),
|
|
16484
|
+
modelId: string(),
|
|
16485
|
+
format: ModelFormatSchema$1
|
|
16486
|
+
}), object({ success: literal(true) }), { kind: "mutation" }), method(object({
|
|
16487
|
+
engine: PipelineEngineChoiceSchema.optional(),
|
|
16488
|
+
steps: array(PipelineStepInputSchema).min(1),
|
|
16489
|
+
frame: FrameInputSchema.optional(),
|
|
16546
16490
|
/**
|
|
16547
|
-
*
|
|
16548
|
-
*
|
|
16549
|
-
*
|
|
16550
|
-
* enabled. Set once and never cleared.
|
|
16551
|
-
*
|
|
16552
|
-
* **This exists so "face present but not recognised" is expressible.** A
|
|
16553
|
-
* recognised identity lands in `subLabel` (attributed to the face chain via
|
|
16554
|
-
* `subLabelMeta.stepId`), so before this field a track with an unmatched face
|
|
16555
|
-
* and a track with no face at all were byte-identical on the wire and no
|
|
16556
|
-
* surface could tell them apart. The read is `hasFace === true && subLabel
|
|
16557
|
-
* === undefined`.
|
|
16558
|
-
*
|
|
16559
|
-
* **Absent ≠ false.** Every row written before the column existed omits it,
|
|
16560
|
-
* and so does every server that predates the field — a consumer must test
|
|
16561
|
-
* `=== true` and render nothing otherwise, never infer "no face".
|
|
16491
|
+
* Process-local lazy frame. Valid only when caller and provider resolve
|
|
16492
|
+
* in the same execution-group process; split/cross-node callers use
|
|
16493
|
+
* `frame`/`image` inline compatibility instead.
|
|
16562
16494
|
*/
|
|
16563
|
-
|
|
16495
|
+
frameRef: FrameRefSchema.optional(),
|
|
16564
16496
|
/**
|
|
16565
|
-
*
|
|
16566
|
-
*
|
|
16567
|
-
*
|
|
16568
|
-
* The STRICT twin of {@link hasFace}, and the pair only earns its keep
|
|
16569
|
-
* because the two disagree. `hasFace` is stamped at the TOP of the face
|
|
16570
|
-
* branch, before every gate, and means no more than "a face detector produced
|
|
16571
|
-
* a face detail". This one is stamped at the single moment the gallery row
|
|
16572
|
-
* LANDS — after `FaceRecognizer.onTrackEnd` successfully persists it, i.e.
|
|
16573
|
-
* past the embedding-magnitude verdict, the `minFacePx` detection gate, the
|
|
16574
|
-
* candidate gate, the imageless-track drop (no crop was ever captured) and
|
|
16575
|
-
* the crop-store drop. Everything between the detector and that insert can
|
|
16576
|
-
* legitimately refuse the face, so a flag written any earlier promises the
|
|
16577
|
-
* operator something to assign and delivers nothing.
|
|
16578
|
-
*
|
|
16579
|
-
* **Independent of recognition.** A face collected but never auto-matched is
|
|
16580
|
-
* still assignable — it is in fact the face an operator most wants to reach —
|
|
16581
|
-
* so this is NOT gated on `recognizedIdentityId`. Recognition lands in
|
|
16582
|
-
* `subLabel`; this says only that the raw material exists.
|
|
16583
|
-
*
|
|
16584
|
-
* **Set once, never cleared.** A track that produced a gallery row produced
|
|
16585
|
-
* one; deleting the row later is the gallery's business, not this flag's.
|
|
16586
|
-
*
|
|
16587
|
-
* **Absent ≠ false**, the same rule as {@link hasFace}: every row written
|
|
16588
|
-
* before the column omits it, and so does every server that predates the
|
|
16589
|
-
* field. A consumer must test `=== true` and render nothing otherwise —
|
|
16590
|
-
* never infer "no assignable face".
|
|
16497
|
+
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
16498
|
+
* the decoded pixels live in. One more member of the one-of
|
|
16499
|
+
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
16591
16500
|
*/
|
|
16592
|
-
|
|
16501
|
+
frameHandle: FrameHandleSchema.optional(),
|
|
16502
|
+
imageBase64: string().optional(),
|
|
16593
16503
|
/**
|
|
16594
|
-
*
|
|
16595
|
-
* (
|
|
16596
|
-
*
|
|
16597
|
-
*
|
|
16598
|
-
*
|
|
16599
|
-
* said "the person is not lost — it is reported so both entities stay on the
|
|
16600
|
-
* record"; in fact the pair went into a per-processor RAM field behind an
|
|
16601
|
-
* accessor nobody called, and every durable surface said `vehicle`, full
|
|
16602
|
-
* stop. This is the composition note that makes the row true.
|
|
16603
|
-
*
|
|
16604
|
-
* A COMPOSITION, never a class and never a label. "This vehicle contains a
|
|
16605
|
-
* person" is not an answer to "what is this" — both label tiers would refuse
|
|
16606
|
-
* a macro token anyway (D89), and correctly. Nothing here changes what the
|
|
16607
|
-
* subject IS: a cyclist stays one vehicle track, occupancy still counts one,
|
|
16608
|
-
* and a `person` rule still does not fire for someone cycling past.
|
|
16609
|
-
*
|
|
16610
|
-
* **Absent ≠ false**, exactly like {@link hasFace}: every row written before
|
|
16611
|
-
* the column, and every hub that predates the field, omits it. Test
|
|
16612
|
-
* `=== true` and render nothing otherwise — never infer "no rider".
|
|
16504
|
+
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
16505
|
+
* hops (hub → forked worker via Moleculer MsgPack) because it
|
|
16506
|
+
* skips the 33% base64 overhead + the per-call base64 decode on
|
|
16507
|
+
* the detection-pipeline worker. Callers can pass either; exactly
|
|
16508
|
+
* one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
|
|
16613
16509
|
*/
|
|
16614
|
-
|
|
16615
|
-
|
|
16616
|
-
|
|
16617
|
-
|
|
16618
|
-
|
|
16619
|
-
|
|
16620
|
-
|
|
16621
|
-
|
|
16622
|
-
|
|
16623
|
-
|
|
16624
|
-
|
|
16625
|
-
|
|
16626
|
-
|
|
16627
|
-
|
|
16628
|
-
|
|
16629
|
-
|
|
16630
|
-
|
|
16631
|
-
|
|
16632
|
-
|
|
16633
|
-
/**
|
|
16634
|
-
|
|
16635
|
-
|
|
16636
|
-
|
|
16637
|
-
|
|
16638
|
-
|
|
16639
|
-
|
|
16510
|
+
image: _instanceof(Uint8Array).optional(),
|
|
16511
|
+
referenceImage: string().optional(),
|
|
16512
|
+
deviceId: number().optional(),
|
|
16513
|
+
sessionId: string().optional(),
|
|
16514
|
+
/**
|
|
16515
|
+
* Execution plane. 'full' (default) runs the whole tree — benchmark,
|
|
16516
|
+
* reference-image, and detail-subtree calls. 'frame' is the live
|
|
16517
|
+
* per-frame dispatch: ONLY root-plane steps run; crop children
|
|
16518
|
+
* (inputClasses ≠ null) are skipped and served per-track via
|
|
16519
|
+
* pipelineRunner.runDetailSubtree (two-plane design).
|
|
16520
|
+
*/
|
|
16521
|
+
plane: _enum(["full", "frame"]).optional(),
|
|
16522
|
+
/**
|
|
16523
|
+
* Inference-device selector (Phase 2 multi-device). Format
|
|
16524
|
+
* `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
|
|
16525
|
+
* Omitted ⇒ the runner's default device (current single-engine
|
|
16526
|
+
* behaviour). Selects WHICH device pool of the node runs the call.
|
|
16527
|
+
*/
|
|
16528
|
+
deviceKey: string().optional(),
|
|
16529
|
+
/**
|
|
16530
|
+
* Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
|
|
16531
|
+
* when the parent crop was resolved from the frame's retained NATIVE
|
|
16532
|
+
* surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
|
|
16533
|
+
* child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
|
|
16534
|
+
* resolution from that surface — the SAME quality path faces already
|
|
16535
|
+
* had — instead of the downscaled parent tile. `handle` keys the native
|
|
16536
|
+
* surface (node-pinned to its owner); `cropFrameSpace` is the parent
|
|
16537
|
+
* crop's padded/clamped rectangle in FRAME-space pixels, used to compose
|
|
16538
|
+
* the executor's crop-normalized child ROI back into frame-normalized
|
|
16539
|
+
* coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
|
|
16540
|
+
* of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
|
|
16541
|
+
* (today's behaviour on the fallback path).
|
|
16542
|
+
*/
|
|
16543
|
+
nativeCropRef: NativeCropRefSchema.optional()
|
|
16544
|
+
}), PipelineRunResultBridge, { kind: "mutation" }), method(object({
|
|
16545
|
+
engine: PipelineEngineChoiceSchema.optional(),
|
|
16546
|
+
steps: array(PipelineStepInputSchema).min(1),
|
|
16547
|
+
frames: array(FrameInputSchema).min(1).max(255),
|
|
16548
|
+
deviceId: number().optional(),
|
|
16549
|
+
sessionId: string().optional(),
|
|
16550
|
+
/**
|
|
16551
|
+
* Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
|
|
16552
|
+
* the batch to the Python pool's bench preprocess cache
|
|
16553
|
+
* (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
|
|
16554
|
+
* preprocessed ONCE and every later inference is a pure-inference cache
|
|
16555
|
+
* hit — the sustained-throughput run measures inference, not
|
|
16556
|
+
* decode+preprocess+infer. Omitted/0 for live frames (all different →
|
|
16557
|
+
* full preprocess every call, correct). Fresh per sustained run;
|
|
16558
|
+
* released via `uncacheFrame`.
|
|
16559
|
+
*/
|
|
16560
|
+
frameId: number().int().nonnegative().optional(),
|
|
16561
|
+
/** Inference-device selector (Phase 2 multi-device); see runPipeline. */
|
|
16562
|
+
deviceKey: string().optional()
|
|
16563
|
+
}), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
|
|
16564
|
+
data: _instanceof(Uint8Array),
|
|
16565
|
+
width: number().int().positive(),
|
|
16566
|
+
height: number().int().positive(),
|
|
16567
|
+
format: _enum([
|
|
16568
|
+
"rgb",
|
|
16569
|
+
"bgr",
|
|
16570
|
+
"gray"
|
|
16571
|
+
])
|
|
16572
|
+
}), object({
|
|
16573
|
+
frameId: number(),
|
|
16574
|
+
width: number(),
|
|
16575
|
+
height: number()
|
|
16576
|
+
}), { kind: "mutation" }), method(object({
|
|
16577
|
+
stepId: string(),
|
|
16578
|
+
frameId: number().int()
|
|
16579
|
+
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(_void(), object({
|
|
16580
|
+
batchMode: string(),
|
|
16581
|
+
windowMs: number(),
|
|
16582
|
+
maxBatchSize: number(),
|
|
16583
|
+
concurrency: number()
|
|
16584
|
+
})), method(_void(), array(object({
|
|
16585
|
+
engineKey: string(),
|
|
16586
|
+
engine: PipelineEngineChoiceSchema,
|
|
16587
|
+
modelsLoaded: array(string()).readonly(),
|
|
16588
|
+
inUseByCameras: array(number()).readonly(),
|
|
16589
|
+
/**
|
|
16590
|
+
* Origin of this resident factory.
|
|
16591
|
+
* - `runtime` — main camera-serving engine (no idle TTL).
|
|
16592
|
+
* - `warm-override` — benchmark/test override held in the warm
|
|
16593
|
+
* cache; auto-disposed after the idle TTL.
|
|
16594
|
+
* - `device-pool` — a concurrent per-device pool (Phase 2
|
|
16595
|
+
* multi-device, keyed by `deviceKey`) resolved
|
|
16596
|
+
* via `resolveDeviceFactory`. Runs alongside the
|
|
16597
|
+
* `runtime` engine on a DIFFERENT accelerator
|
|
16598
|
+
* (NPU / iGPU / Coral) — this is how the
|
|
16599
|
+
* Engines tab shows all pools running at once.
|
|
16600
|
+
*/
|
|
16601
|
+
kind: _enum([
|
|
16602
|
+
"runtime",
|
|
16603
|
+
"warm-override",
|
|
16604
|
+
"device-pool"
|
|
16605
|
+
]),
|
|
16606
|
+
/** Native pid of the underlying Python pool (null when no pool). */
|
|
16607
|
+
poolPid: number().nullable(),
|
|
16608
|
+
/** ms since this factory was last used (null when not warm-tracked). */
|
|
16609
|
+
idleMs: number().nullable(),
|
|
16610
|
+
/** Idle TTL after which `warm-override` factories self-evict (null when not applicable). */
|
|
16611
|
+
idleTtlMs: number().nullable()
|
|
16612
|
+
})).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
|
|
16613
|
+
kind: "mutation",
|
|
16614
|
+
auth: "admin"
|
|
16615
|
+
}), method(object({
|
|
16616
|
+
engine: PipelineEngineChoiceSchema,
|
|
16617
|
+
force: boolean().optional()
|
|
16618
|
+
}), object({
|
|
16619
|
+
success: boolean(),
|
|
16620
|
+
reason: string().optional()
|
|
16621
|
+
}), {
|
|
16622
|
+
kind: "mutation",
|
|
16623
|
+
auth: "admin"
|
|
16624
|
+
}), method(_void(), array(ReferenceImageEntrySchema).readonly()), method(object({ filename: string() }), ReferenceImageBodySchema.nullable()), method(_void(), array(ReferenceAudioEntrySchema).readonly()), method(object({ filename: string() }), ReferenceAudioBodySchema.nullable()), method(_void(), AudioCapabilitiesSchema), method(object({
|
|
16625
|
+
addonId: string(),
|
|
16626
|
+
modelId: string(),
|
|
16627
|
+
filename: string().optional(),
|
|
16628
|
+
settings: record(string(), unknown()).optional()
|
|
16629
|
+
}), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
|
|
16640
16630
|
/**
|
|
16641
|
-
*
|
|
16642
|
-
*
|
|
16643
|
-
*
|
|
16644
|
-
*
|
|
16645
|
-
*
|
|
16646
|
-
*
|
|
16631
|
+
* Per-stage gating mode applied to the zones a rule references.
|
|
16632
|
+
*
|
|
16633
|
+
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
16634
|
+
* When at least one `include` rule fires for a stage, only entities
|
|
16635
|
+
* inside one of those zones pass that stage.
|
|
16636
|
+
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
16637
|
+
* Entities inside one of those zones are dropped at that stage.
|
|
16638
|
+
*
|
|
16639
|
+
* `monitor`-style observation (count without filtering) is not a rule
|
|
16640
|
+
* mode — zones without any matching rule are observed naturally by
|
|
16641
|
+
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
16642
|
+
* count, not filter" use case needs no rule at all.
|
|
16647
16643
|
*/
|
|
16648
|
-
var
|
|
16644
|
+
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
16649
16645
|
/**
|
|
16650
|
-
*
|
|
16651
|
-
*
|
|
16652
|
-
*
|
|
16653
|
-
*
|
|
16654
|
-
* on them.
|
|
16646
|
+
* Per-consumer rule that references existing zones (geometry) and
|
|
16647
|
+
* defines how a specific pipeline stage should treat them. Each
|
|
16648
|
+
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
16649
|
+
* settings:
|
|
16655
16650
|
*
|
|
16656
|
-
*
|
|
16657
|
-
*
|
|
16658
|
-
*
|
|
16651
|
+
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
16652
|
+
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
16653
|
+
* - future: notification rules, audio gating, etc.
|
|
16659
16654
|
*
|
|
16660
|
-
*
|
|
16661
|
-
*
|
|
16662
|
-
*
|
|
16663
|
-
* the
|
|
16655
|
+
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
16656
|
+
* express "ignore motion in ALL of {garden, street}" with a single
|
|
16657
|
+
* rule. `classFilter` narrows the rule to specific object classes —
|
|
16658
|
+
* "drop person detections in the street, but keep cars" is one
|
|
16659
|
+
* `exclude` rule with `classFilter: ['person']`.
|
|
16660
|
+
*
|
|
16661
|
+
* `enabled` is a soft toggle — the operator can keep the rule
|
|
16662
|
+
* configured but inert without deleting it.
|
|
16664
16663
|
*/
|
|
16665
|
-
var
|
|
16666
|
-
|
|
16667
|
-
|
|
16668
|
-
|
|
16669
|
-
|
|
16670
|
-
|
|
16671
|
-
|
|
16672
|
-
|
|
16673
|
-
|
|
16674
|
-
|
|
16675
|
-
|
|
16676
|
-
source: DetectionSourceSchema.optional(),
|
|
16664
|
+
var ZoneRuleSchema = object({
|
|
16665
|
+
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
16666
|
+
id: string(),
|
|
16667
|
+
/** Optional human-readable label rendered in the rule editor. */
|
|
16668
|
+
name: string().optional(),
|
|
16669
|
+
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
16670
|
+
* listed zones (OR-set: a detection in any one of them counts).
|
|
16671
|
+
* At least one zone id required — a rule with no targets is a
|
|
16672
|
+
* configuration mistake and the form validator rejects it. */
|
|
16673
|
+
zoneIds: array(string()).min(1).readonly(),
|
|
16674
|
+
mode: ZoneRuleModeEnum,
|
|
16677
16675
|
/**
|
|
16678
|
-
*
|
|
16679
|
-
*
|
|
16680
|
-
*
|
|
16681
|
-
* (group by `trackId`, pick a representative `frameId` as the parent frame).
|
|
16682
|
-
* Optional for backward-compat with pre-existing rows / the slim projection
|
|
16683
|
-
* includes it (it is light). Absent on rows written before this field.
|
|
16676
|
+
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
16677
|
+
* applies to every class. Class strings match the `macroClass`
|
|
16678
|
+
* field on detections (e.g. `person`, `car`, `dog`).
|
|
16684
16679
|
*/
|
|
16685
|
-
|
|
16686
|
-
/** Omitted in slim projection. */
|
|
16687
|
-
trackId: string().optional(),
|
|
16688
|
-
className: string(),
|
|
16689
|
-
...TieredLabelFields,
|
|
16690
|
-
/** Omitted in slim projection. */
|
|
16691
|
-
confidence: number().optional(),
|
|
16692
|
-
/** Heavy JSON — omitted in slim projection. */
|
|
16693
|
-
bbox: BoundingBoxSchema.optional(),
|
|
16694
|
-
/** Heavy JSON — omitted in slim projection. */
|
|
16695
|
-
zones: array(string()).readonly().optional(),
|
|
16696
|
-
/** Omitted in slim projection. */
|
|
16697
|
-
state: TrackStateSchema.optional(),
|
|
16680
|
+
classFilter: array(string()).readonly().optional(),
|
|
16698
16681
|
/**
|
|
16699
|
-
*
|
|
16700
|
-
*
|
|
16701
|
-
*
|
|
16682
|
+
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
16683
|
+
* required to consider an entity "in the zone". Defaults to the
|
|
16684
|
+
* consumer's stage default when omitted. Kept for back-compat with
|
|
16685
|
+
* existing per-rule overrides; new operators pick the value via
|
|
16686
|
+
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
16687
|
+
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
16702
16688
|
*/
|
|
16703
|
-
|
|
16704
|
-
/**
|
|
16705
|
-
*
|
|
16706
|
-
|
|
16707
|
-
|
|
16708
|
-
|
|
16709
|
-
|
|
16710
|
-
|
|
16711
|
-
*
|
|
16712
|
-
*
|
|
16713
|
-
*
|
|
16714
|
-
|
|
16715
|
-
|
|
16716
|
-
/**
|
|
16717
|
-
|
|
16718
|
-
|
|
16719
|
-
*
|
|
16720
|
-
|
|
16721
|
-
|
|
16722
|
-
|
|
16723
|
-
|
|
16724
|
-
|
|
16725
|
-
|
|
16726
|
-
|
|
16727
|
-
|
|
16728
|
-
classification: object({
|
|
16729
|
-
className: string(),
|
|
16730
|
-
originalClass: string().optional(),
|
|
16731
|
-
score: number()
|
|
16732
|
-
}).optional(),
|
|
16733
|
-
/** Populated by B5 (recording playback URL for this event). */
|
|
16734
|
-
mediaUrl: string().optional()
|
|
16735
|
-
});
|
|
16736
|
-
var MediaFileKindEnum = _enum([
|
|
16737
|
-
"crop",
|
|
16738
|
-
"thumbnail",
|
|
16739
|
-
"snapshot",
|
|
16740
|
-
"firstFrame",
|
|
16741
|
-
"lastFrame",
|
|
16742
|
-
"fullFrame",
|
|
16743
|
-
"fullFrameBoxed",
|
|
16744
|
-
"faceCrop",
|
|
16745
|
-
"plateCrop",
|
|
16746
|
-
"keyFrame",
|
|
16747
|
-
"keyFrameSmall",
|
|
16748
|
-
"thumbnailSmall"
|
|
16749
|
-
]);
|
|
16750
|
-
var MediaFileSchema = object({
|
|
16751
|
-
key: string(),
|
|
16752
|
-
kind: MediaFileKindEnum,
|
|
16753
|
-
base64: string(),
|
|
16754
|
-
sizeBytes: number(),
|
|
16755
|
-
timestamp: number()
|
|
16689
|
+
overlapThreshold: number().min(0).max(1).optional(),
|
|
16690
|
+
/**
|
|
16691
|
+
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
16692
|
+
* of the detection's bbox that must lie inside the zone for the
|
|
16693
|
+
* rule to match. Documented default is 85%; the engine substitutes
|
|
16694
|
+
* that when the field is omitted (kept optional so existing rules
|
|
16695
|
+
* stored without it stay valid).
|
|
16696
|
+
*
|
|
16697
|
+
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
16698
|
+
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
16699
|
+
* field exposed in the UI. Internally both feed the same gate.
|
|
16700
|
+
*/
|
|
16701
|
+
bboxInclusionPct: number().min(0).max(100).optional(),
|
|
16702
|
+
/**
|
|
16703
|
+
* When `true` and a detection has a segmentation mask, use the
|
|
16704
|
+
* mask for overlap instead of the bbox. Detection-stage only;
|
|
16705
|
+
* motion rules ignore this field.
|
|
16706
|
+
*/
|
|
16707
|
+
preferMask: boolean().optional(),
|
|
16708
|
+
/**
|
|
16709
|
+
* Soft-toggle: `false` disables the rule without deleting it.
|
|
16710
|
+
* Defaults to `true` so operators creating a rule via the UI
|
|
16711
|
+
* see it active immediately.
|
|
16712
|
+
*/
|
|
16713
|
+
enabled: boolean().default(true)
|
|
16756
16714
|
});
|
|
16715
|
+
array(ZoneRuleSchema).readonly();
|
|
16757
16716
|
/**
|
|
16758
|
-
*
|
|
16717
|
+
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
16759
16718
|
*
|
|
16760
|
-
*
|
|
16761
|
-
*
|
|
16762
|
-
*
|
|
16763
|
-
*
|
|
16764
|
-
*
|
|
16719
|
+
* Zones describe **where** in the frame the operator wants to flag
|
|
16720
|
+
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
16721
|
+
* each pipeline stage uses them. Splitting the two means a single
|
|
16722
|
+
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
16723
|
+
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
16724
|
+
* — without three duplicated polygons.
|
|
16765
16725
|
*
|
|
16766
|
-
*
|
|
16767
|
-
*
|
|
16726
|
+
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
16727
|
+
* `zones` device-state slice on every mutation. Consumers
|
|
16728
|
+
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
16729
|
+
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
16730
|
+
* mirror with `onChanged`).
|
|
16731
|
+
*
|
|
16732
|
+
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
16733
|
+
* survive resolution changes and stream profile switches.
|
|
16734
|
+
*
|
|
16735
|
+
* `kind` discriminates between full polygons (closed regions used
|
|
16736
|
+
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
16737
|
+
* line segments used for cross events). Onboard / firmware-reported
|
|
16738
|
+
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
16739
|
+
* task list.
|
|
16768
16740
|
*/
|
|
16769
|
-
var
|
|
16741
|
+
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
16742
|
+
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
16743
|
+
var PolygonPointSchema = object({
|
|
16744
|
+
x: number(),
|
|
16745
|
+
y: number()
|
|
16746
|
+
});
|
|
16747
|
+
/** A camera detection zone — pure geometry/identity. */
|
|
16748
|
+
var ZoneSchema = object({
|
|
16749
|
+
id: string(),
|
|
16750
|
+
name: string(),
|
|
16751
|
+
kind: ZoneKindEnum.default("polygon"),
|
|
16752
|
+
/** Polygon vertices, fraction of frame (0–1). */
|
|
16753
|
+
polygon: array(PolygonPointSchema).readonly(),
|
|
16754
|
+
/** Visual color for UI rendering. */
|
|
16755
|
+
color: string().default("#3b82f6")
|
|
16756
|
+
});
|
|
16757
|
+
DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).readonly()), method(object({
|
|
16758
|
+
deviceId: number(),
|
|
16759
|
+
zone: ZoneSchema
|
|
16760
|
+
}), _void(), {
|
|
16761
|
+
kind: "mutation",
|
|
16762
|
+
auth: "admin"
|
|
16763
|
+
}), method(object({
|
|
16764
|
+
deviceId: number(),
|
|
16765
|
+
zoneId: string()
|
|
16766
|
+
}), _void(), {
|
|
16767
|
+
kind: "mutation",
|
|
16768
|
+
auth: "admin"
|
|
16769
|
+
}), method(object({
|
|
16770
|
+
deviceId: number(),
|
|
16771
|
+
zone: ZoneSchema
|
|
16772
|
+
}), _void(), {
|
|
16773
|
+
kind: "mutation",
|
|
16774
|
+
auth: "admin"
|
|
16775
|
+
}), object({ zones: array(ZoneSchema).readonly() });
|
|
16770
16776
|
/**
|
|
16771
|
-
*
|
|
16777
|
+
* pipeline-analytics — device-scoped wrapper cap. Refines raw
|
|
16778
|
+
* per-frame detections emitted by the pipeline runner into tracked
|
|
16779
|
+
* objects, per-kind event collections (motion / object / audio), and
|
|
16780
|
+
* persisted media. Owns the post-detection domain end-to-end:
|
|
16772
16781
|
*
|
|
16773
|
-
*
|
|
16774
|
-
*
|
|
16775
|
-
*
|
|
16776
|
-
*
|
|
16782
|
+
* runner emits PipelineInferenceResult
|
|
16783
|
+
* ↓ (event bus)
|
|
16784
|
+
* pipeline-analytics subscriber
|
|
16785
|
+
* ↓ SORT tracker + zone engine + state analyzer + event emitter
|
|
16786
|
+
* → three DB collections (one per kind), one FS media tree, one
|
|
16787
|
+
* unified event emitter (FrameTracked + TrackStarted/Ended +
|
|
16788
|
+
* DetectionEvent on bus)
|
|
16777
16789
|
*
|
|
16778
|
-
*
|
|
16779
|
-
*
|
|
16780
|
-
*
|
|
16781
|
-
*
|
|
16790
|
+
* Pure subscriber model. No `processFrame` cap method — the runner
|
|
16791
|
+
* already publishes the raw frame on the bus. The cap surface is
|
|
16792
|
+
* only QUERIES + per-device settings, bound on/off via
|
|
16793
|
+
* `device-manager.setWrapperActive`. `defaultActive: true` because
|
|
16794
|
+
* every camera with a detection pipeline wants its raw detections
|
|
16795
|
+
* refined; operators opt out per-device via BindingsTab when needed.
|
|
16796
|
+
*
|
|
16797
|
+
* Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
|
|
16798
|
+
* (per-device surface) and `track-trail` caps — see P11 cleanup.
|
|
16782
16799
|
*/
|
|
16783
|
-
var
|
|
16800
|
+
var TrackStateSchema = _enum([
|
|
16801
|
+
"new",
|
|
16802
|
+
"entered",
|
|
16803
|
+
"left",
|
|
16804
|
+
"moving",
|
|
16805
|
+
"idle"
|
|
16806
|
+
]);
|
|
16807
|
+
var EventKindSchema = _enum([
|
|
16808
|
+
"motion",
|
|
16809
|
+
"object",
|
|
16810
|
+
"audio"
|
|
16811
|
+
]);
|
|
16812
|
+
/**
|
|
16813
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
16814
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
16815
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
16816
|
+
*/
|
|
16817
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
16818
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
16819
|
+
var EventKindIconSchema = _enum([
|
|
16820
|
+
"motion",
|
|
16821
|
+
"audio",
|
|
16784
16822
|
"person",
|
|
16785
16823
|
"vehicle",
|
|
16786
16824
|
"animal",
|
|
16825
|
+
"door",
|
|
16826
|
+
"pir",
|
|
16827
|
+
"smoke",
|
|
16828
|
+
"water",
|
|
16829
|
+
"button",
|
|
16787
16830
|
"package",
|
|
16788
|
-
"
|
|
16789
|
-
"plate"
|
|
16831
|
+
"generic"
|
|
16790
16832
|
]);
|
|
16791
|
-
|
|
16792
|
-
|
|
16793
|
-
|
|
16794
|
-
|
|
16795
|
-
|
|
16796
|
-
|
|
16797
|
-
|
|
16798
|
-
|
|
16799
|
-
|
|
16800
|
-
|
|
16801
|
-
|
|
16802
|
-
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
*/
|
|
16810
|
-
|
|
16811
|
-
id
|
|
16812
|
-
|
|
16813
|
-
|
|
16814
|
-
|
|
16815
|
-
|
|
16816
|
-
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
|
|
16820
|
-
kind
|
|
16821
|
-
source
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
createdAt: number()
|
|
16827
|
-
});
|
|
16828
|
-
/** The write form — the server owns `id`, `createdAt` and the frame binding. */
|
|
16829
|
-
var RetrainAnnotationDraftSchema = RetrainAnnotationSchema.omit({
|
|
16830
|
-
id: true,
|
|
16831
|
-
trackId: true,
|
|
16832
|
-
deviceId: true,
|
|
16833
|
-
mediaKey: true,
|
|
16834
|
-
createdAt: true,
|
|
16835
|
-
exportedInBatch: true
|
|
16833
|
+
var EventKindCategorySchema = _enum([
|
|
16834
|
+
"motion",
|
|
16835
|
+
"audio",
|
|
16836
|
+
"detection",
|
|
16837
|
+
"sensor",
|
|
16838
|
+
"control",
|
|
16839
|
+
"custom",
|
|
16840
|
+
"package"
|
|
16841
|
+
]);
|
|
16842
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
16843
|
+
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
16844
|
+
var EventKindDescriptorSchema = object({
|
|
16845
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
16846
|
+
kind: string(),
|
|
16847
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
16848
|
+
labelKey: string(),
|
|
16849
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
16850
|
+
label: string(),
|
|
16851
|
+
/** Hex color for timeline/legend rendering. */
|
|
16852
|
+
color: string(),
|
|
16853
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
16854
|
+
iconId: string(),
|
|
16855
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
16856
|
+
icon: EventKindIconSchema,
|
|
16857
|
+
category: EventKindCategorySchema,
|
|
16858
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
16859
|
+
parentKind: string().nullable(),
|
|
16860
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
16861
|
+
level: EventKindLevelSchema,
|
|
16862
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
16863
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
16864
|
+
source: object({
|
|
16865
|
+
capName: string(),
|
|
16866
|
+
deviceId: number()
|
|
16867
|
+
})
|
|
16836
16868
|
});
|
|
16837
|
-
/**
|
|
16838
|
-
var
|
|
16839
|
-
trackId: string(),
|
|
16869
|
+
/** One camera's event vocabulary, as returned by `listEventKindsBatch`. */
|
|
16870
|
+
var EventKindsForDeviceSchema = object({
|
|
16840
16871
|
deviceId: number(),
|
|
16841
|
-
|
|
16842
|
-
label: string().optional(),
|
|
16843
|
-
firstSeen: number(),
|
|
16844
|
-
lastSeen: number(),
|
|
16845
|
-
/** How many frames the dataset already holds from this track. */
|
|
16846
|
-
frameCount: number().int(),
|
|
16847
|
-
/** How many subjects have been annotated on those frames. `0` with
|
|
16848
|
-
* `frameCount: 0` is exactly "staging, still to work". */
|
|
16849
|
-
annotationCount: number().int()
|
|
16850
|
-
});
|
|
16851
|
-
/** A frame the picker may offer — an index row, no blob was read to produce it. */
|
|
16852
|
-
var RetrainFrameCandidateSchema = object({
|
|
16853
|
-
mediaKey: string(),
|
|
16854
|
-
kind: MediaFileKindEnum,
|
|
16855
|
-
timestamp: number(),
|
|
16856
|
-
sizeBytes: number().int(),
|
|
16857
|
-
/** A copy of this original already exists — selecting it is free and cannot
|
|
16858
|
-
* fail, whatever became of the original. */
|
|
16859
|
-
copied: boolean()
|
|
16872
|
+
kinds: array(EventKindDescriptorSchema).readonly()
|
|
16860
16873
|
});
|
|
16861
|
-
|
|
16862
|
-
|
|
16863
|
-
|
|
16874
|
+
var SensorEventSchema = object({
|
|
16875
|
+
id: string(),
|
|
16876
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
16877
|
+
* yields N rows, one per camera). */
|
|
16864
16878
|
deviceId: number(),
|
|
16865
|
-
|
|
16866
|
-
|
|
16867
|
-
|
|
16868
|
-
|
|
16869
|
-
|
|
16870
|
-
|
|
16871
|
-
|
|
16872
|
-
copiedAt: number()
|
|
16879
|
+
/** The linked sensor device whose state changed. */
|
|
16880
|
+
sourceDeviceId: number(),
|
|
16881
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
16882
|
+
kind: string(),
|
|
16883
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
16884
|
+
value: record(string(), unknown()).nullable(),
|
|
16885
|
+
timestamp: number()
|
|
16873
16886
|
});
|
|
16874
|
-
|
|
16875
|
-
|
|
16876
|
-
|
|
16877
|
-
|
|
16878
|
-
|
|
16879
|
-
]);
|
|
16880
|
-
var RetrainFrameSelectionSchema = object({
|
|
16881
|
-
copied: array(RetrainFrameSchema).readonly(),
|
|
16882
|
-
refused: array(object({
|
|
16883
|
-
sourceMediaKey: string(),
|
|
16884
|
-
reason: RetrainCopyRefusalSchema
|
|
16885
|
-
})).readonly()
|
|
16887
|
+
var TrackPositionSchema = object({
|
|
16888
|
+
x: number(),
|
|
16889
|
+
y: number(),
|
|
16890
|
+
timestamp: number(),
|
|
16891
|
+
bbox: BoundingBoxSchema
|
|
16886
16892
|
});
|
|
16887
|
-
var
|
|
16888
|
-
|
|
16889
|
-
|
|
16890
|
-
/**
|
|
16891
|
-
|
|
16893
|
+
var TrackSnapshotSchema = object({
|
|
16894
|
+
timestamp: number(),
|
|
16895
|
+
position: TrackPositionSchema,
|
|
16896
|
+
/** MediaStore key; resolve via `getTrackMedia({ trackId })`. */
|
|
16897
|
+
mediaKey: string()
|
|
16892
16898
|
});
|
|
16893
|
-
/** What the operator asked the assist to look for. */
|
|
16894
|
-
var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
|
|
16895
|
-
kind: literal("package"),
|
|
16896
|
-
zone: RetrainBboxSchema.optional()
|
|
16897
|
-
}), object({
|
|
16898
|
-
kind: literal("objects"),
|
|
16899
|
-
modelId: string(),
|
|
16900
|
-
minScore: number().optional()
|
|
16901
|
-
})]);
|
|
16902
16899
|
/**
|
|
16903
|
-
*
|
|
16904
|
-
*
|
|
16905
|
-
*
|
|
16900
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
16901
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
16902
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
16903
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
16906
16904
|
*/
|
|
16907
|
-
var
|
|
16908
|
-
|
|
16909
|
-
|
|
16910
|
-
|
|
16911
|
-
|
|
16912
|
-
/** Drafts, ready to edit. `source: 'assist'` until the operator touches one. */
|
|
16913
|
-
proposals: array(RetrainAnnotationDraftSchema).readonly(),
|
|
16914
|
-
/** Returned by the runner but removed by the threshold. */
|
|
16915
|
-
belowThreshold: number().int()
|
|
16916
|
-
}), object({
|
|
16917
|
-
kind: literal("refused"),
|
|
16918
|
-
/** `no-zone` is ours; the rest are the runner's own refusal vocabulary. */
|
|
16919
|
-
reason: string(),
|
|
16920
|
-
detail: string().optional()
|
|
16921
|
-
})]);
|
|
16922
|
-
/** The outcome of a lifecycle move owned by the retrain page. */
|
|
16923
|
-
var RetrainTransitionResultSchema = object({
|
|
16924
|
-
trackId: string(),
|
|
16925
|
-
/** Where the track ended up, whatever happened. */
|
|
16926
|
-
retrainStatus: RetrainStatusSchema,
|
|
16927
|
-
/** `false` ⇒ the move was refused or was a no-op; `reason` says which. */
|
|
16928
|
-
changed: boolean(),
|
|
16929
|
-
reason: _enum([
|
|
16930
|
-
"unknown-track",
|
|
16931
|
-
"no-frames-copied",
|
|
16932
|
-
"not-staging",
|
|
16933
|
-
"not-trained",
|
|
16934
|
-
"unchanged"
|
|
16935
|
-
]).optional()
|
|
16936
|
-
});
|
|
16937
|
-
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
16938
|
-
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
16939
|
-
var DeviceEventQueryInput = object({
|
|
16940
|
-
deviceId: number(),
|
|
16941
|
-
since: number().optional(),
|
|
16942
|
-
until: number().optional(),
|
|
16943
|
-
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
16944
|
-
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
16945
|
-
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
16946
|
-
* exact behaviour. Callers may omit this field — the store defaults to
|
|
16947
|
-
* `full` when not provided. */
|
|
16948
|
-
projection: _enum(["full", "slim"]).optional()
|
|
16949
|
-
});
|
|
16950
|
-
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
16951
|
-
var RecentTracksQueryInput = object({
|
|
16952
|
-
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
16953
|
-
deviceIds: array(number()),
|
|
16954
|
-
/** Window lower bound on `lastSeen` (inclusive). */
|
|
16955
|
-
since: number().optional(),
|
|
16956
|
-
/** Window upper bound on `lastSeen` (inclusive). */
|
|
16957
|
-
until: number().optional(),
|
|
16958
|
-
/** Page size. Default 200, max 1000. */
|
|
16959
|
-
limit: number().int().min(1).max(1e3).default(200),
|
|
16960
|
-
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
16961
|
-
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
16962
|
-
cursor: string().optional(),
|
|
16963
|
-
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
16964
|
-
projection: TrackProjectionSchema.optional(),
|
|
16965
|
-
/** Include stationary-promoted rows (parked objects). Default false: the
|
|
16966
|
-
* feed lists passages; parking records live on the stationary registry. */
|
|
16967
|
-
includeStationary: boolean().optional()
|
|
16968
|
-
});
|
|
16969
|
-
var RecentTracksPageSchema = object({
|
|
16970
|
-
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
16971
|
-
tracks: array(TrackSchema).readonly(),
|
|
16972
|
-
/** Cursor for the next page, or null when this page is the last. */
|
|
16973
|
-
nextCursor: string().nullable()
|
|
16905
|
+
var TrackEnvelopeSchema = object({
|
|
16906
|
+
minX: number(),
|
|
16907
|
+
minY: number(),
|
|
16908
|
+
maxX: number(),
|
|
16909
|
+
maxY: number()
|
|
16974
16910
|
});
|
|
16975
|
-
|
|
16976
|
-
|
|
16977
|
-
|
|
16978
|
-
|
|
16979
|
-
|
|
16980
|
-
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
|
|
16992
|
-
|
|
16993
|
-
|
|
16994
|
-
|
|
16995
|
-
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
|
|
16999
|
-
|
|
17000
|
-
|
|
17001
|
-
|
|
17002
|
-
deviceIds: array(number()),
|
|
17003
|
-
/** Window lower bound on `closedAt` (inclusive). */
|
|
17004
|
-
since: number().optional(),
|
|
17005
|
-
/** Window upper bound on `openedAt` (inclusive). */
|
|
17006
|
-
until: number().optional(),
|
|
17007
|
-
limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
|
|
17008
|
-
/** Opaque continuation cursor from a previous page's `nextCursor`. */
|
|
17009
|
-
cursor: string().optional()
|
|
17010
|
-
});
|
|
17011
|
-
var ListGroupsPageSchema = object({
|
|
17012
|
-
groups: array(AnalyticsGroupRecordSchema).readonly(),
|
|
17013
|
-
nextCursor: string().nullable()
|
|
17014
|
-
});
|
|
17015
|
-
var KeyEventQueryInput = object({
|
|
17016
|
-
deviceId: number(),
|
|
17017
|
-
/** Window lower bound (track firstSeen ≥ since). */
|
|
17018
|
-
since: number(),
|
|
17019
|
-
/** Window upper bound (track firstSeen ≤ until). */
|
|
17020
|
-
until: number(),
|
|
17021
|
-
limit: number().int().min(1).max(200).default(50),
|
|
17022
|
-
/** Drop tracks scoring below this importance. */
|
|
17023
|
-
minImportance: number().min(0).max(1).optional(),
|
|
17024
|
-
/** Restrict to a single class (e.g. 'person'). */
|
|
17025
|
-
classFilter: string().optional()
|
|
17026
|
-
});
|
|
17027
|
-
var KeyEventSchema = object({
|
|
17028
|
-
/** The representative event id (the track's best ObjectEvent, else its trackId). */
|
|
17029
|
-
id: string(),
|
|
17030
|
-
trackId: string(),
|
|
17031
|
-
/** Track start time (firstSeen). */
|
|
17032
|
-
timestamp: number(),
|
|
17033
|
-
className: string(),
|
|
17034
|
-
...TieredLabelFields,
|
|
17035
|
-
importance: number(),
|
|
17036
|
-
/** Highest-confidence ObjectEvent id for the track (empty when none). */
|
|
17037
|
-
bestEventId: string(),
|
|
17038
|
-
/** Track lifetime in ms (lastSeen - firstSeen). */
|
|
17039
|
-
windowMs: number().optional(),
|
|
17040
|
-
...TrackFlagFields,
|
|
17041
|
-
...TrackRetrainFields
|
|
17042
|
-
});
|
|
17043
|
-
object({
|
|
17044
|
-
trackId: string(),
|
|
17045
|
-
className: string(),
|
|
17046
|
-
confidence: number(),
|
|
17047
|
-
bbox: BoundingBoxSchema,
|
|
17048
|
-
zones: array(string()).readonly(),
|
|
17049
|
-
state: TrackStateSchema
|
|
17050
|
-
});
|
|
17051
|
-
var OverlayDetectionSchema = looseObject({
|
|
17052
|
-
id: string(),
|
|
17053
|
-
kind: _enum(["first-level", "detail"]),
|
|
17054
|
-
macroClass: string(),
|
|
17055
|
-
score: number(),
|
|
17056
|
-
bbox: object({
|
|
17057
|
-
x: number(),
|
|
17058
|
-
y: number(),
|
|
17059
|
-
width: number(),
|
|
17060
|
-
height: number()
|
|
17061
|
-
}),
|
|
17062
|
-
labels: array(looseObject({
|
|
17063
|
-
label: string(),
|
|
17064
|
-
score: number()
|
|
17065
|
-
})).readonly(),
|
|
17066
|
-
parentId: string().optional()
|
|
17067
|
-
});
|
|
17068
|
-
var ScoredObjectEventSchema = ObjectEventSchema.extend({ score: number() });
|
|
17069
|
-
var SearchObjectEventsInput = object({
|
|
17070
|
-
text: string(),
|
|
17071
|
-
deviceId: number().optional(),
|
|
17072
|
-
since: number().optional(),
|
|
17073
|
-
until: number().optional(),
|
|
17074
|
-
classFilter: string().optional(),
|
|
17075
|
-
limit: number().default(50),
|
|
17076
|
-
minScore: number().min(0).max(1).default(.2)
|
|
17077
|
-
});
|
|
17078
|
-
var TrackCascadeCountsSchema = object({
|
|
17079
|
-
/** Persisted track roots deleted (authoritative). */
|
|
17080
|
-
tracks: number().int(),
|
|
17081
|
-
/** Object events removed with their tracks (best-effort; see note above). */
|
|
17082
|
-
events: number().int(),
|
|
17083
|
-
/** Track/face/plate-owned media removed (best-effort). Never identity media. */
|
|
17084
|
-
media: number().int(),
|
|
17085
|
-
/** Unassigned (non-enrolled) face reads removed (best-effort). */
|
|
17086
|
-
faces: number().int(),
|
|
17087
|
-
/** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
|
|
17088
|
-
plates: number().int(),
|
|
17089
|
-
/** Per-track CLIP search vectors removed (best-effort). */
|
|
17090
|
-
embeddings: number().int(),
|
|
17091
|
-
/** Group membership + group rows removed with their last member (best-effort). */
|
|
17092
|
-
groups: number().int()
|
|
17093
|
-
});
|
|
17094
|
-
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
17095
|
-
var DiskReconcileCountsSchema = object({
|
|
17096
|
-
mediaDropped: number().int(),
|
|
17097
|
-
tracks: number().int(),
|
|
17098
|
-
events: number().int()
|
|
17099
|
-
});
|
|
17100
|
-
/** Event-store footprint for one camera. */
|
|
17101
|
-
var EventStoreDeviceFootprintSchema = object({
|
|
17102
|
-
deviceId: number(),
|
|
17103
|
-
/** Persisted event rows (motion + object + audio) for the camera. */
|
|
17104
|
-
rows: number().int(),
|
|
17105
|
-
/** Event-owned media bytes on disk for the camera. */
|
|
17106
|
-
bytes: number().int()
|
|
17107
|
-
});
|
|
17108
|
-
/** Aggregate event-store footprint: global totals + per-camera breakdown. */
|
|
17109
|
-
var EventStoreFootprintSchema = object({
|
|
17110
|
-
totalRows: number().int(),
|
|
17111
|
-
totalBytes: number().int(),
|
|
17112
|
-
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
17113
|
-
});
|
|
17114
|
-
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
17115
|
-
var EventPruneCountsSchema = object({
|
|
17116
|
-
motion: number().int(),
|
|
17117
|
-
object: number().int(),
|
|
17118
|
-
audio: number().int()
|
|
16911
|
+
/**
|
|
16912
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
16913
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
16914
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
16915
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
16916
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
16917
|
+
* zonesVisited, bestEventId, envelope, hasFace, hasEmbeddedFace, hasRider) and returns `positions` /
|
|
16918
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
16919
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
16920
|
+
* (`getObjectEvents` et al.).
|
|
16921
|
+
*/
|
|
16922
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
16923
|
+
/**
|
|
16924
|
+
* One audio-classification label heard on the track's camera while the
|
|
16925
|
+
* track was alive, aggregated per label. An "episode" is one persisted
|
|
16926
|
+
* audio event (the confident-classification path: score ≥ the device's
|
|
16927
|
+
* `classificationMinScore`, class-change-or-heartbeat coalesced) — NOT
|
|
16928
|
+
* one 32 ms inference chunk, so counts stay human-scaled.
|
|
16929
|
+
*/
|
|
16930
|
+
var TrackAudioLabelSchema = object({
|
|
16931
|
+
label: string(),
|
|
16932
|
+
/** Highest classification score observed across the label's episodes. */
|
|
16933
|
+
peakScore: number(),
|
|
16934
|
+
/** Number of coalesced audio-event episodes carrying this label. */
|
|
16935
|
+
count: number(),
|
|
16936
|
+
firstAt: number(),
|
|
16937
|
+
lastAt: number()
|
|
17119
16938
|
});
|
|
17120
16939
|
/**
|
|
17121
|
-
*
|
|
16940
|
+
* How a track was produced. `pipeline` (default / absent) = the spatial
|
|
16941
|
+
* detection+tracking pipeline. Every OTHER value is a SYNTHETIC projection —
|
|
16942
|
+
* no positions, a single snapshot, and no bbox trajectory at all:
|
|
17122
16943
|
*
|
|
17123
|
-
*
|
|
17124
|
-
*
|
|
17125
|
-
*
|
|
17126
|
-
*
|
|
17127
|
-
*
|
|
16944
|
+
* - `sensor` — a linked sensor/control device state change.
|
|
16945
|
+
* - `audio` — an audio event on the camera itself that was anomalous for
|
|
16946
|
+
* THAT camera, loud, and heard while nothing visual was happening (D62).
|
|
16947
|
+
*
|
|
16948
|
+
* The spatial subsystems (tracker association, occupancy count, re-id /
|
|
16949
|
+
* embedding, resurrection) MUST skip every synthetic source. Test for that
|
|
16950
|
+
* with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
|
|
16951
|
+
* check silently readmits every source added after it was written.
|
|
17128
16952
|
*/
|
|
17129
|
-
var
|
|
17130
|
-
|
|
17131
|
-
|
|
17132
|
-
|
|
17133
|
-
|
|
17134
|
-
/** Stop after this many tracks; the result reports whether more remain. */
|
|
17135
|
-
maxTracks: number().int().positive().optional(),
|
|
17136
|
-
/**
|
|
17137
|
-
* Run every embedding on THIS node instead of round-robining the fleet.
|
|
17138
|
-
*
|
|
17139
|
-
* Named `executeOnNodeId` and not `nodeId` on purpose: an inline `nodeId`
|
|
17140
|
-
* field in cap args is read by `parent-unowned-call.ts` as a ROUTING PIN, so
|
|
17141
|
-
* calling it that would pin the rebuild REQUEST itself to that node — the
|
|
17142
|
-
* rebuild orchestration lives on the hub, and only the per-track step runs
|
|
17143
|
-
* remotely. This field is data; the per-track pin is applied inside.
|
|
17144
|
-
*
|
|
17145
|
-
* Absent ⇒ round-robin over every online node whose runner can serve the
|
|
17146
|
-
* pinned model.
|
|
17147
|
-
*/
|
|
17148
|
-
executeOnNodeId: string().optional(),
|
|
17149
|
-
/**
|
|
17150
|
-
* Milliseconds to wait between tracks; omit for the built-in default, `0` to
|
|
17151
|
-
* run flat out.
|
|
17152
|
-
*
|
|
17153
|
-
* A rebuild is bulk maintenance on hub-main's single thread. Measured
|
|
17154
|
-
* 2026-08-06, an unpaced pass held that thread busy 82.2 s out of 120 and
|
|
17155
|
-
* pushed `nodes.topology` from 0.25 s to 26 s for 43 minutes. The value in
|
|
17156
|
-
* force is logged at start and finish so a deliberately slow pass reads
|
|
17157
|
-
* differently from a stalled one.
|
|
17158
|
-
*/
|
|
17159
|
-
pacingMs: number().int().nonnegative().optional()
|
|
17160
|
-
});
|
|
16953
|
+
var TrackSourceSchema = _enum([
|
|
16954
|
+
"pipeline",
|
|
16955
|
+
"sensor",
|
|
16956
|
+
"audio"
|
|
16957
|
+
]);
|
|
17161
16958
|
/**
|
|
17162
|
-
*
|
|
16959
|
+
* Where a track sits in the RETRAIN lifecycle (D81).
|
|
17163
16960
|
*
|
|
17164
|
-
*
|
|
17165
|
-
*
|
|
17166
|
-
*
|
|
17167
|
-
*
|
|
16961
|
+
* - `none` — never marked, or un-marked. Evictable.
|
|
16962
|
+
* - `staging` — the operator wants this track as training material and has not
|
|
16963
|
+
* finished with it. **This is the only state retention holds**: the track and
|
|
16964
|
+
* everything it owns (object events, crops, keyframes, CLIP vector) survive
|
|
16965
|
+
* the device's age window.
|
|
16966
|
+
* - `trained` — the retrain page has taken what it needed. The frames it chose
|
|
16967
|
+
* were COPIED into the retrain dataset at selection time, so the dataset no
|
|
16968
|
+
* longer depends on the track's media and the track becomes EVICTABLE again.
|
|
16969
|
+
* Terminal for the plain `markForTrain` toggle: returning it to `staging` is
|
|
16970
|
+
* a deliberate action of the retrain page, not a side effect of a checkbox.
|
|
16971
|
+
*
|
|
16972
|
+
* There is no `null`. The state is stored `TEXT NOT NULL DEFAULT 'none'` because
|
|
16973
|
+
* the store's filter language has only positive equality and `whereIn` — no
|
|
16974
|
+
* negation, no IS NULL — so a NULL would be unselectable by ANY predicate and
|
|
16975
|
+
* would make the entire pre-column history immortal in one deploy.
|
|
17168
16976
|
*/
|
|
17169
|
-
var
|
|
16977
|
+
var RetrainStatusSchema = _enum([
|
|
16978
|
+
"none",
|
|
16979
|
+
"staging",
|
|
16980
|
+
"trained"
|
|
16981
|
+
]);
|
|
17170
16982
|
/**
|
|
17171
|
-
*
|
|
16983
|
+
* Per-track OPERATOR flags — set by hand from the admin UI or the viewer, never
|
|
16984
|
+
* by the pipeline. Spread into `TrackSchema` and `KeyEventSchema` from one place
|
|
16985
|
+
* so the two surfaces cannot drift.
|
|
17172
16986
|
*
|
|
17173
|
-
*
|
|
17174
|
-
*
|
|
17175
|
-
*
|
|
17176
|
-
*
|
|
17177
|
-
*
|
|
16987
|
+
* **Absent ≠ false.** A track that has never been touched omits the field; an
|
|
16988
|
+
* explicitly un-flagged track carries `false`. Legacy rows written before the
|
|
16989
|
+
* columns existed read as absent, and a consumer that needs a boolean should say
|
|
16990
|
+
* `flag === true`, not `flag !== false`.
|
|
16991
|
+
*
|
|
16992
|
+
* `markForTrain` is the WIRE FACE of {@link RetrainStatusSchema}, not a column:
|
|
16993
|
+
* it is exactly `retrainStatus === 'staging'`, in both directions. Writing
|
|
16994
|
+
* `true` moves `none → staging`, writing `false` moves `staging → none`, and a
|
|
16995
|
+
* `trained` track reports `false` while refusing both writes. The boolean is
|
|
16996
|
+
* kept because three surfaces drive a toggle off it; anything that needs to tell
|
|
16997
|
+
* "never marked" from "already trained" must read `retrainStatus`.
|
|
16998
|
+
*
|
|
16999
|
+
* `debug` does NOT pin; it is attention, not durability.
|
|
17000
|
+
*
|
|
17001
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
17002
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
17003
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
17178
17004
|
*/
|
|
17179
|
-
var
|
|
17180
|
-
|
|
17181
|
-
|
|
17182
|
-
|
|
17183
|
-
|
|
17184
|
-
|
|
17185
|
-
|
|
17186
|
-
|
|
17187
|
-
|
|
17188
|
-
|
|
17189
|
-
|
|
17190
|
-
|
|
17191
|
-
|
|
17192
|
-
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
|
|
17196
|
-
|
|
17197
|
-
|
|
17198
|
-
|
|
17199
|
-
|
|
17200
|
-
|
|
17005
|
+
var TrackFlagFields = {
|
|
17006
|
+
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
17007
|
+
* `'staging'`. */
|
|
17008
|
+
markForTrain: boolean().optional(),
|
|
17009
|
+
/** Operator marked this track for diagnostic attention. */
|
|
17010
|
+
debug: boolean().optional(),
|
|
17011
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
17012
|
+
favourited: boolean().optional()
|
|
17013
|
+
};
|
|
17014
|
+
/**
|
|
17015
|
+
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
17016
|
+
* Deliberately NOT part of {@link TrackFlagFields}: that group also builds the
|
|
17017
|
+
* write patch, and the status is not something the toggle sets — it is what the
|
|
17018
|
+
* toggle's boolean is derived from. Absent on an in-RAM track never touched;
|
|
17019
|
+
* always present on a persisted row (the column default materialises `'none'`).
|
|
17020
|
+
*/
|
|
17021
|
+
var TrackRetrainFields = { retrainStatus: RetrainStatusSchema.optional() };
|
|
17022
|
+
/**
|
|
17023
|
+
* The write half: a PARTIAL patch. An omitted key is left untouched, so setting
|
|
17024
|
+
* one flag can never clear the other — the toggles are independent and are
|
|
17025
|
+
* driven from three surfaces that do not know about each other.
|
|
17026
|
+
*/
|
|
17027
|
+
var TrackFlagsPatchSchema = object(TrackFlagFields);
|
|
17028
|
+
/**
|
|
17029
|
+
* The resolved flag state after a write. Both fields are REQUIRED here (absent
|
|
17030
|
+
* collapses to `false`) so a caller can drive a toggle's checked state off the
|
|
17031
|
+
* mutation result without a re-fetch.
|
|
17032
|
+
*/
|
|
17033
|
+
var TrackFlagsSchema = object({
|
|
17034
|
+
trackId: string(),
|
|
17035
|
+
markForTrain: boolean(),
|
|
17036
|
+
debug: boolean(),
|
|
17037
|
+
favourited: boolean(),
|
|
17038
|
+
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
17039
|
+
* a track row) because this shape is only ever produced by the write body,
|
|
17040
|
+
* which always knows it — and a surface that has just written needs to render
|
|
17041
|
+
* `trained` without a re-fetch. */
|
|
17042
|
+
retrainStatus: RetrainStatusSchema
|
|
17043
|
+
});
|
|
17044
|
+
union([literal(1), literal(2)]);
|
|
17045
|
+
/**
|
|
17046
|
+
* WHO decided a label, and when. Carried per tier so a value can be traced to
|
|
17047
|
+
* the step and model that produced it — which is what makes the write rule
|
|
17048
|
+
* arguable after the fact ("why is 592's label `dog` and not `Canis lupus`?")
|
|
17049
|
+
* and what lets a migrated, UNATTRIBUTED value be told apart from a real one.
|
|
17050
|
+
*
|
|
17051
|
+
* `stepId` is the pipeline step id (`animal-classifier`, `bird-classifier`,
|
|
17052
|
+
* `plate-ocr`, `face-embedding`, `object-detection`), or the sentinel
|
|
17053
|
+
* `migration:4g` for a value the 4g migration moved from the single-slot era —
|
|
17054
|
+
* that value has no provenance, and the write rule lets ANY properly-attributed
|
|
17055
|
+
* write of the same tier replace it regardless of score.
|
|
17056
|
+
*/
|
|
17057
|
+
var LabelAttributionSchema = object({
|
|
17058
|
+
stepId: string(),
|
|
17059
|
+
modelId: string().optional(),
|
|
17060
|
+
decidedAt: number(),
|
|
17061
|
+
/**
|
|
17062
|
+
* The GALLERY id behind a recognised tier-2 label — a face-gallery
|
|
17063
|
+
* `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
|
|
17201
17064
|
*
|
|
17202
|
-
*
|
|
17203
|
-
*
|
|
17204
|
-
*
|
|
17205
|
-
*
|
|
17206
|
-
*
|
|
17207
|
-
*
|
|
17065
|
+
* The text alone is a DISPLAY NAME, and a display name is renameable: a
|
|
17066
|
+
* notification rule authored on "Gianluca" stopped matching the moment the
|
|
17067
|
+
* operator fixed the spelling in the gallery, and nothing said so. The id is
|
|
17068
|
+
* the thing that does not move, so it is what a rule matches on
|
|
17069
|
+
* (`NcConditions.identities`) and the text is what a human is shown.
|
|
17070
|
+
*
|
|
17071
|
+
* Absent when the label names no gallery row — a plate the OCR read but no
|
|
17072
|
+
* vehicle claims, a sub-class, a species, any tier-1 value.
|
|
17208
17073
|
*/
|
|
17209
|
-
|
|
17210
|
-
failed: number(),
|
|
17211
|
-
/** Set once a pass ends: true only when EVERYTHING was covered. */
|
|
17212
|
-
complete: boolean().nullable(),
|
|
17213
|
-
startedAtMs: number().nullable(),
|
|
17214
|
-
finishedAtMs: number().nullable(),
|
|
17215
|
-
/** Present when the pass ended by throwing. */
|
|
17216
|
-
error: string().nullable()
|
|
17074
|
+
identityId: string().optional()
|
|
17217
17075
|
});
|
|
17218
|
-
|
|
17219
|
-
|
|
17220
|
-
|
|
17221
|
-
|
|
17222
|
-
|
|
17223
|
-
|
|
17224
|
-
|
|
17225
|
-
|
|
17226
|
-
|
|
17227
|
-
|
|
17228
|
-
|
|
17229
|
-
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
|
|
17233
|
-
|
|
17234
|
-
|
|
17235
|
-
|
|
17236
|
-
|
|
17237
|
-
|
|
17238
|
-
|
|
17239
|
-
|
|
17240
|
-
|
|
17241
|
-
|
|
17242
|
-
|
|
17243
|
-
|
|
17244
|
-
|
|
17245
|
-
|
|
17246
|
-
|
|
17247
|
-
|
|
17248
|
-
|
|
17249
|
-
|
|
17250
|
-
|
|
17251
|
-
|
|
17252
|
-
|
|
17253
|
-
|
|
17254
|
-
|
|
17255
|
-
|
|
17256
|
-
bucketStart: number(),
|
|
17257
|
-
motion: number().int(),
|
|
17258
|
-
object: number().int(),
|
|
17259
|
-
audio: number().int()
|
|
17260
|
-
})).readonly()), method(object({
|
|
17261
|
-
deviceId: number(),
|
|
17262
|
-
cutoffMs: number()
|
|
17263
|
-
}), object({
|
|
17264
|
-
motion: number().int(),
|
|
17265
|
-
object: number().int(),
|
|
17266
|
-
audio: number().int()
|
|
17267
|
-
}), {
|
|
17268
|
-
kind: "mutation",
|
|
17269
|
-
auth: "admin"
|
|
17270
|
-
}), method(object({
|
|
17271
|
-
deviceId: number(),
|
|
17272
|
-
cutoffMs: number()
|
|
17273
|
-
}), TrackCascadeCountsSchema, {
|
|
17274
|
-
kind: "mutation",
|
|
17275
|
-
auth: "admin"
|
|
17276
|
-
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
17277
|
-
kind: "mutation",
|
|
17278
|
-
auth: "admin"
|
|
17279
|
-
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
17280
|
-
kind: "mutation",
|
|
17281
|
-
auth: "admin"
|
|
17282
|
-
}), method(object({
|
|
17283
|
-
deviceId: number(),
|
|
17284
|
-
trackIds: array(string()).min(1)
|
|
17285
|
-
}), object({
|
|
17286
|
-
deleted: number().int(),
|
|
17287
|
-
failed: array(string()).readonly()
|
|
17288
|
-
}), {
|
|
17289
|
-
kind: "mutation",
|
|
17290
|
-
auth: "admin"
|
|
17291
|
-
}), method(object({
|
|
17292
|
-
/** Log/audit scope only — the trackId is globally unique on its own. */
|
|
17076
|
+
/**
|
|
17077
|
+
* The TIERED label model (roadmap 4g), spread into `TrackSchema` and
|
|
17078
|
+
* `ObjectEventSchema` from ONE place so the two surfaces cannot drift — a
|
|
17079
|
+
* track and its events always answer the same question the same way.
|
|
17080
|
+
*
|
|
17081
|
+
* Two scalar columns, not an array: every consumer wants "the coarse one" or
|
|
17082
|
+
* "the fine one", and an array made both a scan. `label` is tier 1, `subLabel`
|
|
17083
|
+
* is tier 2, and each carries its own score + attribution.
|
|
17084
|
+
*
|
|
17085
|
+
* **Reading it.** What a human should be shown is `subLabel ?? label` — the
|
|
17086
|
+
* finest thing known. Before 4g the single `label` column held the finest
|
|
17087
|
+
* value, so a consumer that has not been updated reads the tier-1 slot and
|
|
17088
|
+
* shows nothing on a species-only row; that is why the migration puts every
|
|
17089
|
+
* pre-4g value in tier 2 (it cannot regress a display that reads the fallback)
|
|
17090
|
+
* and why the read surfaces were changed in the same train.
|
|
17091
|
+
*
|
|
17092
|
+
* **Writing it.** The slots are independent, which is the whole point: a
|
|
17093
|
+
* tier-1 write (`bird`) can never overwrite a tier-2 value (`Turdus
|
|
17094
|
+
* migratorius`), so fineness cannot regress by construction. Within a tier the
|
|
17095
|
+
* higher score wins. One rule, one implementation — see
|
|
17096
|
+
* `pipeline/label-tier.ts` in addon-post-analysis.
|
|
17097
|
+
*/
|
|
17098
|
+
var TieredLabelFields = {
|
|
17099
|
+
/** Tier 1 — the sub-class. See {@link LabelTierSchema}. */
|
|
17100
|
+
label: string().optional(),
|
|
17101
|
+
/** Confidence of the tier-1 value, as reported by the deciding step. */
|
|
17102
|
+
labelScore: number().optional(),
|
|
17103
|
+
/** Provenance of the tier-1 value. See {@link LabelAttributionSchema}. */
|
|
17104
|
+
labelMeta: LabelAttributionSchema.optional(),
|
|
17105
|
+
/** Tier 2 — the instance. See {@link LabelTierSchema}. */
|
|
17106
|
+
subLabel: string().optional(),
|
|
17107
|
+
/** Confidence of the tier-2 value, as reported by the deciding step. */
|
|
17108
|
+
subLabelScore: number().optional(),
|
|
17109
|
+
/** Provenance of the tier-2 value. See {@link LabelAttributionSchema}. */
|
|
17110
|
+
subLabelMeta: LabelAttributionSchema.optional()
|
|
17111
|
+
};
|
|
17112
|
+
/** Per-camera slice of a training-export estimate. */
|
|
17113
|
+
var TrainingExportDeviceTotalsSchema = object({
|
|
17293
17114
|
deviceId: number(),
|
|
17115
|
+
tracks: number().int(),
|
|
17116
|
+
files: number().int(),
|
|
17117
|
+
bytes: number().int()
|
|
17118
|
+
});
|
|
17119
|
+
/**
|
|
17120
|
+
* What a training export WOULD contain. Computed from media index rows only —
|
|
17121
|
+
* no blob is read to produce this.
|
|
17122
|
+
*/
|
|
17123
|
+
var TrainingExportSummarySchema = object({
|
|
17124
|
+
generatedAt: number(),
|
|
17125
|
+
trackCount: number().int(),
|
|
17126
|
+
fileCount: number().int(),
|
|
17127
|
+
byteCount: number().int(),
|
|
17128
|
+
/** More marked tracks exist than a single pass carries. */
|
|
17129
|
+
truncated: boolean(),
|
|
17130
|
+
devices: array(TrainingExportDeviceTotalsSchema).readonly()
|
|
17131
|
+
});
|
|
17132
|
+
var TrackSchema = object({
|
|
17294
17133
|
trackId: string(),
|
|
17295
|
-
flags: TrackFlagsPatchSchema
|
|
17296
|
-
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
17297
|
-
kind: "query",
|
|
17298
|
-
auth: "admin"
|
|
17299
|
-
}), method(object({
|
|
17300
|
-
olderThanMs: number(),
|
|
17301
|
-
reason: OpsLogReasonSchema.optional()
|
|
17302
|
-
}), EventPruneCountsSchema, {
|
|
17303
|
-
kind: "mutation",
|
|
17304
|
-
auth: "admin"
|
|
17305
|
-
}), method(object({ deviceId: number() }), EventPruneCountsSchema, {
|
|
17306
|
-
kind: "mutation",
|
|
17307
|
-
auth: "admin"
|
|
17308
|
-
}), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
17309
|
-
kind: "mutation",
|
|
17310
|
-
auth: "admin"
|
|
17311
|
-
}), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
|
|
17312
|
-
kind: "mutation",
|
|
17313
|
-
auth: "admin"
|
|
17314
|
-
}), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
|
|
17315
|
-
kind: "mutation",
|
|
17316
|
-
auth: "admin"
|
|
17317
|
-
}), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
|
|
17318
|
-
kind: "mutation",
|
|
17319
|
-
auth: "admin"
|
|
17320
|
-
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
17321
|
-
kind: "mutation",
|
|
17322
|
-
auth: "admin"
|
|
17323
|
-
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
17324
|
-
kind: "query",
|
|
17325
|
-
auth: "admin"
|
|
17326
|
-
}), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
|
|
17327
|
-
kind: "query",
|
|
17328
|
-
auth: "admin"
|
|
17329
|
-
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
17330
|
-
kind: "query",
|
|
17331
|
-
auth: "admin"
|
|
17332
|
-
}), method(object({
|
|
17333
|
-
/** Empty ⇒ every camera that has staging tracks. A LIST, not a single
|
|
17334
|
-
* `deviceId`, deliberately: `deviceId` would make this device-bound and
|
|
17335
|
-
* route it at one camera's owner, and "every camera" would stop being
|
|
17336
|
-
* expressible at all. */
|
|
17337
|
-
deviceIds: array(number()).optional(),
|
|
17338
|
-
limit: number().int().min(1).max(500).optional()
|
|
17339
|
-
}), array(RetrainTrackSchema).readonly(), {
|
|
17340
|
-
kind: "query",
|
|
17341
|
-
auth: "admin"
|
|
17342
|
-
}), method(object({ trackId: string() }), RetrainFrameListSchema, {
|
|
17343
|
-
kind: "query",
|
|
17344
|
-
auth: "admin"
|
|
17345
|
-
}), method(object({
|
|
17346
17134
|
deviceId: number(),
|
|
17347
|
-
|
|
17348
|
-
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
|
|
17352
|
-
|
|
17135
|
+
className: string(),
|
|
17136
|
+
...TieredLabelFields,
|
|
17137
|
+
producingDeviceName: string().optional(),
|
|
17138
|
+
/** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
|
|
17139
|
+
source: TrackSourceSchema.optional(),
|
|
17140
|
+
firstSeen: number(),
|
|
17141
|
+
lastSeen: number(),
|
|
17142
|
+
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
17143
|
+
positions: array(TrackPositionSchema).readonly(),
|
|
17144
|
+
/** Periodic snapshots at snapshotIntervalMs cadence (subject to
|
|
17145
|
+
* saveThumbnails policy). */
|
|
17146
|
+
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
17147
|
+
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
17148
|
+
zonesVisited: array(string()).readonly(),
|
|
17149
|
+
/**
|
|
17150
|
+
* Human NAMES for {@link zonesVisited}, resolved at READ time against the
|
|
17151
|
+
* `zones` capability.
|
|
17152
|
+
*
|
|
17153
|
+
* `zonesVisited` persists ids (`cfeec78c-8d69-…`), which no operator can type
|
|
17154
|
+
* and no card can render — so every free-text search surface was structurally
|
|
17155
|
+
* unable to answer "show me the tracks in Uscio", and did not fail loudly, it
|
|
17156
|
+
* just returned nothing. Resolving here rather than in each client keeps ONE
|
|
17157
|
+
* derivation and costs the clients no extra call (the `zones` cap is
|
|
17158
|
+
* per-device, so a client-side resolve would be a per-camera fan-out on a
|
|
17159
|
+
* surface built to avoid exactly that).
|
|
17160
|
+
*
|
|
17161
|
+
* Resolved, never invented: a zone deleted since the track was written has no
|
|
17162
|
+
* name and is DROPPED, so this array can be shorter than `zonesVisited` — the
|
|
17163
|
+
* two are not positionally aligned. Absent when the track visited no zone, or
|
|
17164
|
+
* when the zone catalogue could not be read.
|
|
17165
|
+
*/
|
|
17166
|
+
zoneNames: array(string()).readonly().optional(),
|
|
17167
|
+
/** Deduplicated set of detector classes observed for this track over its
|
|
17168
|
+
* life (a track may be reclassified, e.g. person→vehicle). Absent on
|
|
17169
|
+
* legacy rows written before class accumulation shipped. */
|
|
17170
|
+
classes: array(string()).readonly().optional(),
|
|
17171
|
+
/** Cumulative normalized distance travelled (0..1 units = full frame width). */
|
|
17172
|
+
totalDistance: number(),
|
|
17173
|
+
state: TrackStateSchema,
|
|
17174
|
+
active: boolean(),
|
|
17175
|
+
/** Deterministic key-event importance score in [0,1] (server-computed at
|
|
17176
|
+
* track expiry, recomputed on late label). Absent on legacy rows written
|
|
17177
|
+
* before scoring shipped — consumers degrade to absence / compute-on-read. */
|
|
17178
|
+
importance: number().optional(),
|
|
17179
|
+
/** Id of the track's highest-confidence ObjectEvent (its representative
|
|
17180
|
+
* "best" frame). Absent when the track produced no object events. */
|
|
17181
|
+
bestEventId: string().optional(),
|
|
17182
|
+
/** Tag of the importance sub-signal that dominated the score
|
|
17183
|
+
* (identity|dwell|proximity|class|confidence|travel|zone). */
|
|
17184
|
+
importanceReason: string().optional(),
|
|
17185
|
+
/** Audio-classification labels heard on the camera during the track's
|
|
17186
|
+
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
17187
|
+
* Absent on legacy rows / tracks with no confident audio. */
|
|
17188
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
17189
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
17190
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
17191
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
17192
|
+
envelope: TrackEnvelopeSchema.optional(),
|
|
17193
|
+
/**
|
|
17194
|
+
* A face DETECTOR found a face on this track — nothing more. It says the
|
|
17195
|
+
* detail plane produced a `face` detail; it does NOT say the face was
|
|
17196
|
+
* embedded, matched, above `minFacePx`, or that the recognizer was even
|
|
17197
|
+
* enabled. Set once and never cleared.
|
|
17198
|
+
*
|
|
17199
|
+
* **This exists so "face present but not recognised" is expressible.** A
|
|
17200
|
+
* recognised identity lands in `subLabel` (attributed to the face chain via
|
|
17201
|
+
* `subLabelMeta.stepId`), so before this field a track with an unmatched face
|
|
17202
|
+
* and a track with no face at all were byte-identical on the wire and no
|
|
17203
|
+
* surface could tell them apart. The read is `hasFace === true && subLabel
|
|
17204
|
+
* === undefined`.
|
|
17205
|
+
*
|
|
17206
|
+
* **Absent ≠ false.** Every row written before the column existed omits it,
|
|
17207
|
+
* and so does every server that predates the field — a consumer must test
|
|
17208
|
+
* `=== true` and render nothing otherwise, never infer "no face".
|
|
17209
|
+
*/
|
|
17210
|
+
hasFace: boolean().optional(),
|
|
17211
|
+
/**
|
|
17212
|
+
* This track has a face row IN THE GALLERY: a crop **and** an embedding — a
|
|
17213
|
+
* face an operator could ASSIGN to an identity.
|
|
17214
|
+
*
|
|
17215
|
+
* The STRICT twin of {@link hasFace}, and the pair only earns its keep
|
|
17216
|
+
* because the two disagree. `hasFace` is stamped at the TOP of the face
|
|
17217
|
+
* branch, before every gate, and means no more than "a face detector produced
|
|
17218
|
+
* a face detail". This one is stamped at the single moment the gallery row
|
|
17219
|
+
* LANDS — after `FaceRecognizer.onTrackEnd` successfully persists it, i.e.
|
|
17220
|
+
* past the embedding-magnitude verdict, the `minFacePx` detection gate, the
|
|
17221
|
+
* candidate gate, the imageless-track drop (no crop was ever captured) and
|
|
17222
|
+
* the crop-store drop. Everything between the detector and that insert can
|
|
17223
|
+
* legitimately refuse the face, so a flag written any earlier promises the
|
|
17224
|
+
* operator something to assign and delivers nothing.
|
|
17225
|
+
*
|
|
17226
|
+
* **Independent of recognition.** A face collected but never auto-matched is
|
|
17227
|
+
* still assignable — it is in fact the face an operator most wants to reach —
|
|
17228
|
+
* so this is NOT gated on `recognizedIdentityId`. Recognition lands in
|
|
17229
|
+
* `subLabel`; this says only that the raw material exists.
|
|
17230
|
+
*
|
|
17231
|
+
* **Set once, never cleared.** A track that produced a gallery row produced
|
|
17232
|
+
* one; deleting the row later is the gallery's business, not this flag's.
|
|
17233
|
+
*
|
|
17234
|
+
* **Absent ≠ false**, the same rule as {@link hasFace}: every row written
|
|
17235
|
+
* before the column omits it, and so does every server that predates the
|
|
17236
|
+
* field. A consumer must test `=== true` and render nothing otherwise —
|
|
17237
|
+
* never infer "no assignable face".
|
|
17238
|
+
*/
|
|
17239
|
+
hasEmbeddedFace: boolean().optional(),
|
|
17240
|
+
/**
|
|
17241
|
+
* This subject CONTAINS a folded rider — a person the rider-pairing step
|
|
17242
|
+
* ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
|
|
17243
|
+
* so the passage is tracked once and as a VEHICLE.
|
|
17244
|
+
*
|
|
17245
|
+
* It exists because the fold's record was dishonest. D34 and the code both
|
|
17246
|
+
* said "the person is not lost — it is reported so both entities stay on the
|
|
17247
|
+
* record"; in fact the pair went into a per-processor RAM field behind an
|
|
17248
|
+
* accessor nobody called, and every durable surface said `vehicle`, full
|
|
17249
|
+
* stop. This is the composition note that makes the row true.
|
|
17250
|
+
*
|
|
17251
|
+
* A COMPOSITION, never a class and never a label. "This vehicle contains a
|
|
17252
|
+
* person" is not an answer to "what is this" — both label tiers would refuse
|
|
17253
|
+
* a macro token anyway (D89), and correctly. Nothing here changes what the
|
|
17254
|
+
* subject IS: a cyclist stays one vehicle track, occupancy still counts one,
|
|
17255
|
+
* and a `person` rule still does not fire for someone cycling past.
|
|
17256
|
+
*
|
|
17257
|
+
* **Absent ≠ false**, exactly like {@link hasFace}: every row written before
|
|
17258
|
+
* the column, and every hub that predates the field, omits it. Test
|
|
17259
|
+
* `=== true` and render nothing otherwise — never infer "no rider".
|
|
17260
|
+
*/
|
|
17261
|
+
hasRider: boolean().optional(),
|
|
17262
|
+
...TrackFlagFields,
|
|
17263
|
+
...TrackRetrainFields
|
|
17264
|
+
});
|
|
17265
|
+
var BaseEventFields = {
|
|
17266
|
+
id: string(),
|
|
17353
17267
|
deviceId: number(),
|
|
17354
|
-
|
|
17355
|
-
|
|
17356
|
-
|
|
17357
|
-
|
|
17358
|
-
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
|
|
17362
|
-
|
|
17268
|
+
timestamp: number()
|
|
17269
|
+
};
|
|
17270
|
+
var MotionEventSchema = object({
|
|
17271
|
+
...BaseEventFields,
|
|
17272
|
+
kind: literal("motion"),
|
|
17273
|
+
regionCount: number(),
|
|
17274
|
+
/** Heavy JSON array — omitted in slim projection. */
|
|
17275
|
+
regions: array(object({
|
|
17276
|
+
bbox: BoundingBoxSchema,
|
|
17277
|
+
pixelCount: number(),
|
|
17278
|
+
intensity: number()
|
|
17279
|
+
})).readonly().optional(),
|
|
17280
|
+
/** Omitted in slim projection. */
|
|
17281
|
+
frameWidth: number().optional(),
|
|
17282
|
+
/** Omitted in slim projection. */
|
|
17283
|
+
frameHeight: number().optional(),
|
|
17284
|
+
/** Populated by B5 (recording playback URL for this event). */
|
|
17285
|
+
mediaUrl: string().optional()
|
|
17286
|
+
});
|
|
17287
|
+
/**
|
|
17288
|
+
* Which detection SOURCE produced an object event. `pipeline` = the ML
|
|
17289
|
+
* detection pipeline (decoded-frame inference); `onboard` = the camera's
|
|
17290
|
+
* native on-device AI. Both flow through the SAME analysis layers (zoning,
|
|
17291
|
+
* tracking, per-kind persistence) but stay distinguishable so consumers
|
|
17292
|
+
* (advanced-notifier, occupancy, …) can select which source(s) to act on.
|
|
17293
|
+
* Absent on legacy rows ⇒ treat as `pipeline`.
|
|
17294
|
+
*/
|
|
17295
|
+
var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
|
|
17296
|
+
/**
|
|
17297
|
+
* The confirmed zone crossing that produced an object event. Present ONLY on
|
|
17298
|
+
* an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
|
|
17299
|
+
* event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
|
|
17300
|
+
* appearance event carry none, so a rule asking for a direction fails closed
|
|
17301
|
+
* on them.
|
|
17302
|
+
*
|
|
17303
|
+
* Exactly ONE crossing per event: the emitter turns each confirmed crossing
|
|
17304
|
+
* into its own event, so a frame in which a track enters A while leaving B
|
|
17305
|
+
* produces two events with two directions — never one ambiguous row.
|
|
17306
|
+
*
|
|
17307
|
+
* `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
|
|
17308
|
+
* membership the box has NOW, and by definition it no longer contains the zone
|
|
17309
|
+
* that was just left. Without the id here, a zone-scoped rule could never match
|
|
17310
|
+
* the exit it asked for.
|
|
17311
|
+
*/
|
|
17312
|
+
var ZoneCrossingSchema = object({
|
|
17313
|
+
direction: _enum(["enter", "exit"]),
|
|
17314
|
+
/** Admin zone id crossed. */
|
|
17315
|
+
zoneId: string(),
|
|
17316
|
+
/** Zone display name at crossing time (falls back to the id). */
|
|
17317
|
+
zoneName: string().optional()
|
|
17318
|
+
});
|
|
17319
|
+
var ObjectEventSchema = object({
|
|
17320
|
+
...BaseEventFields,
|
|
17321
|
+
kind: literal("object"),
|
|
17322
|
+
/** Detection source. Optional for backward-compat; absent ⇒ `pipeline`. */
|
|
17323
|
+
source: DetectionSourceSchema.optional(),
|
|
17324
|
+
/**
|
|
17325
|
+
* Inference-frame id shared by every object event emitted from the SAME frame
|
|
17326
|
+
* — the "scene/parent" key. Lets a consumer group co-occurring detections (e.g.
|
|
17327
|
+
* 2 people + 1 dog) under one full frame, and link a track's frames over time
|
|
17328
|
+
* (group by `trackId`, pick a representative `frameId` as the parent frame).
|
|
17329
|
+
* Optional for backward-compat with pre-existing rows / the slim projection
|
|
17330
|
+
* includes it (it is light). Absent on rows written before this field.
|
|
17331
|
+
*/
|
|
17332
|
+
frameId: string().optional(),
|
|
17333
|
+
/** Omitted in slim projection. */
|
|
17334
|
+
trackId: string().optional(),
|
|
17335
|
+
className: string(),
|
|
17336
|
+
...TieredLabelFields,
|
|
17337
|
+
/** Omitted in slim projection. */
|
|
17338
|
+
confidence: number().optional(),
|
|
17339
|
+
/** Heavy JSON — omitted in slim projection. */
|
|
17340
|
+
bbox: BoundingBoxSchema.optional(),
|
|
17341
|
+
/** Heavy JSON — omitted in slim projection. */
|
|
17342
|
+
zones: array(string()).readonly().optional(),
|
|
17343
|
+
/** Omitted in slim projection. */
|
|
17344
|
+
state: TrackStateSchema.optional(),
|
|
17345
|
+
/**
|
|
17346
|
+
* The zone crossing this event IS, when it is one. Absent on every other
|
|
17347
|
+
* event kind (movement state, appearance, package) — see
|
|
17348
|
+
* {@link ZoneCrossingSchema}. Omitted in slim projection.
|
|
17349
|
+
*/
|
|
17350
|
+
zoneCrossing: ZoneCrossingSchema.optional(),
|
|
17351
|
+
/** Detection-frame dimensions in pixels — let consumers normalize the
|
|
17352
|
+
* pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
|
|
17353
|
+
frameWidth: number().optional(),
|
|
17354
|
+
frameHeight: number().optional(),
|
|
17355
|
+
/** MediaStore key for the crop attached to this event (if any). */
|
|
17356
|
+
mediaKey: string().optional(),
|
|
17357
|
+
/** Design B: MediaStore key of the track's native-resolution key frame (the
|
|
17358
|
+
* best-detection full frame). Resolve via the event-media data-plane
|
|
17359
|
+
* (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
|
|
17360
|
+
* draws `bbox` over the native frame. Absent on legacy rows / non-decoded
|
|
17361
|
+
* sources — consumers fall back to `mediaKey` (the tight crop). */
|
|
17362
|
+
keyFrameMediaKey: string().optional(),
|
|
17363
|
+
/** Populated by B5 (recording playback URL for this event). */
|
|
17364
|
+
mediaUrl: string().optional(),
|
|
17365
|
+
/** The parent track's key-event importance [0,1], propagated to every object
|
|
17366
|
+
* event of the track (so an event row can be sorted by importance without a
|
|
17367
|
+
* track join). Absent on legacy rows / before the track was scored. */
|
|
17368
|
+
importance: number().optional()
|
|
17369
|
+
});
|
|
17370
|
+
var AudioEventSchema = object({
|
|
17371
|
+
...BaseEventFields,
|
|
17372
|
+
kind: literal("audio"),
|
|
17373
|
+
rms: number(),
|
|
17374
|
+
dbfs: number(),
|
|
17375
|
+
classification: object({
|
|
17376
|
+
className: string(),
|
|
17377
|
+
originalClass: string().optional(),
|
|
17378
|
+
score: number()
|
|
17379
|
+
}).optional(),
|
|
17380
|
+
/** Populated by B5 (recording playback URL for this event). */
|
|
17381
|
+
mediaUrl: string().optional()
|
|
17382
|
+
});
|
|
17383
|
+
var MediaFileKindEnum = _enum([
|
|
17384
|
+
"crop",
|
|
17385
|
+
"thumbnail",
|
|
17386
|
+
"snapshot",
|
|
17387
|
+
"firstFrame",
|
|
17388
|
+
"lastFrame",
|
|
17389
|
+
"fullFrame",
|
|
17390
|
+
"fullFrameBoxed",
|
|
17391
|
+
"faceCrop",
|
|
17392
|
+
"plateCrop",
|
|
17393
|
+
"keyFrame",
|
|
17394
|
+
"keyFrameSmall",
|
|
17395
|
+
"thumbnailSmall"
|
|
17396
|
+
]);
|
|
17397
|
+
var MediaFileSchema = object({
|
|
17398
|
+
key: string(),
|
|
17399
|
+
kind: MediaFileKindEnum,
|
|
17363
17400
|
base64: string(),
|
|
17364
|
-
|
|
17365
|
-
|
|
17366
|
-
})
|
|
17367
|
-
|
|
17368
|
-
|
|
17369
|
-
|
|
17370
|
-
|
|
17371
|
-
|
|
17372
|
-
|
|
17373
|
-
|
|
17374
|
-
|
|
17375
|
-
|
|
17376
|
-
|
|
17377
|
-
|
|
17378
|
-
|
|
17379
|
-
|
|
17380
|
-
|
|
17381
|
-
|
|
17382
|
-
|
|
17383
|
-
|
|
17384
|
-
|
|
17385
|
-
|
|
17386
|
-
|
|
17387
|
-
|
|
17388
|
-
|
|
17389
|
-
|
|
17390
|
-
|
|
17391
|
-
|
|
17392
|
-
|
|
17393
|
-
|
|
17394
|
-
|
|
17395
|
-
|
|
17396
|
-
|
|
17397
|
-
|
|
17398
|
-
|
|
17399
|
-
|
|
17400
|
-
|
|
17401
|
-
|
|
17402
|
-
|
|
17403
|
-
|
|
17404
|
-
|
|
17405
|
-
|
|
17406
|
-
|
|
17407
|
-
|
|
17408
|
-
|
|
17409
|
-
|
|
17410
|
-
|
|
17411
|
-
|
|
17412
|
-
|
|
17413
|
-
|
|
17401
|
+
sizeBytes: number(),
|
|
17402
|
+
timestamp: number()
|
|
17403
|
+
});
|
|
17404
|
+
/**
|
|
17405
|
+
* One media row WITHOUT its bytes.
|
|
17406
|
+
*
|
|
17407
|
+
* A track's media is 5-8 MB of base64 (measured: 7.67 MB across 23 files for a
|
|
17408
|
+
* 140 s track), and a client that renders tiles from the media data plane needs
|
|
17409
|
+
* to know only WHAT EXISTS — the bytes then arrive per tile, lazily, over HTTP
|
|
17410
|
+
* with an immutable cache, instead of all at once inside a tRPC response that
|
|
17411
|
+
* blocks the whole view.
|
|
17412
|
+
*
|
|
17413
|
+
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
17414
|
+
* stored blob and a `?variant=thumb` rendering without fetching either.
|
|
17415
|
+
*/
|
|
17416
|
+
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
17417
|
+
/**
|
|
17418
|
+
* The MACRO tier of an annotation — a CLOSED set.
|
|
17419
|
+
*
|
|
17420
|
+
* This is what the exported detector predicts, so a typo here is a new class
|
|
17421
|
+
* with one example in it. `label` and `subLabel` are open strings by contrast:
|
|
17422
|
+
* the whole point of the page is teaching the model things it does not know
|
|
17423
|
+
* yet, and constraining that vocabulary would make it useless.
|
|
17424
|
+
*
|
|
17425
|
+
* A macro class is NEVER a label. The provider refuses a write whose `label` or
|
|
17426
|
+
* `subLabel` is one of these values, in any casing, because once `person`
|
|
17427
|
+
* exists in both tiers "every person box" stops being answerable without
|
|
17428
|
+
* knowing every string anyone ever typed — and the damage is retroactive.
|
|
17429
|
+
*/
|
|
17430
|
+
var RetrainMacroClassSchema = _enum([
|
|
17431
|
+
"person",
|
|
17432
|
+
"vehicle",
|
|
17433
|
+
"animal",
|
|
17434
|
+
"package",
|
|
17435
|
+
"face",
|
|
17436
|
+
"plate"
|
|
17437
|
+
]);
|
|
17438
|
+
/** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
|
|
17439
|
+
var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
|
|
17440
|
+
/** Did a human draw this box, or did the assist propose it? */
|
|
17441
|
+
var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
|
|
17442
|
+
/** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
|
|
17443
|
+
var RetrainBboxSchema = object({
|
|
17444
|
+
x: number(),
|
|
17445
|
+
y: number(),
|
|
17446
|
+
w: number(),
|
|
17447
|
+
h: number()
|
|
17448
|
+
});
|
|
17449
|
+
/**
|
|
17450
|
+
* One annotated subject.
|
|
17451
|
+
*
|
|
17452
|
+
* `bbox` is normalised against the full frame, ALWAYS. The per-model shapes
|
|
17453
|
+
* (letterboxed root / zone-cropped package / subject-cropped classifier) are
|
|
17454
|
+
* derived from it at export and never stored — storing them is how one feature
|
|
17455
|
+
* space ends up holding two crops of the same subject (D52).
|
|
17456
|
+
*/
|
|
17457
|
+
var RetrainAnnotationSchema = object({
|
|
17458
|
+
id: string(),
|
|
17414
17459
|
trackId: string(),
|
|
17415
|
-
deviceId: number()
|
|
17416
|
-
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
17417
|
-
kind: "mutation",
|
|
17418
|
-
auth: "admin"
|
|
17419
|
-
}), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
|
|
17420
|
-
kind: "mutation",
|
|
17421
|
-
auth: "admin"
|
|
17422
|
-
}), method(object({}), RebuildStatusSchema), object({
|
|
17423
|
-
deviceId: number(),
|
|
17424
|
-
timestamp: number(),
|
|
17425
|
-
frameWidth: number(),
|
|
17426
|
-
frameHeight: number(),
|
|
17427
|
-
detections: array(OverlayDetectionSchema).readonly()
|
|
17428
|
-
}), object({
|
|
17429
17460
|
deviceId: number(),
|
|
17461
|
+
/** The COPY in retrain storage — never the source track's media key. */
|
|
17462
|
+
mediaKey: string(),
|
|
17463
|
+
bbox: RetrainBboxSchema,
|
|
17464
|
+
macroClass: RetrainMacroClassSchema,
|
|
17465
|
+
label: string().optional(),
|
|
17466
|
+
subLabel: string().optional(),
|
|
17467
|
+
kind: RetrainAnnotationKindSchema,
|
|
17468
|
+
source: RetrainAnnotationSourceSchema,
|
|
17469
|
+
/** Which model proposed this box — or, on a `model_error`, drew the phantom. */
|
|
17470
|
+
assistModelId: string().optional(),
|
|
17471
|
+
assistScore: number().optional(),
|
|
17472
|
+
exportedInBatch: string().optional(),
|
|
17473
|
+
createdAt: number()
|
|
17474
|
+
});
|
|
17475
|
+
/** The write form — the server owns `id`, `createdAt` and the frame binding. */
|
|
17476
|
+
var RetrainAnnotationDraftSchema = RetrainAnnotationSchema.omit({
|
|
17477
|
+
id: true,
|
|
17478
|
+
trackId: true,
|
|
17479
|
+
deviceId: true,
|
|
17480
|
+
mediaKey: true,
|
|
17481
|
+
createdAt: true,
|
|
17482
|
+
exportedInBatch: true
|
|
17483
|
+
});
|
|
17484
|
+
/** A track sitting in `staging`, with everything the worklist needs to rank it. */
|
|
17485
|
+
var RetrainTrackSchema = object({
|
|
17430
17486
|
trackId: string(),
|
|
17431
|
-
className: string()
|
|
17432
|
-
}), object({
|
|
17433
17487
|
deviceId: number(),
|
|
17434
|
-
trackId: string(),
|
|
17435
17488
|
className: string(),
|
|
17436
|
-
|
|
17437
|
-
|
|
17489
|
+
label: string().optional(),
|
|
17490
|
+
firstSeen: number(),
|
|
17491
|
+
lastSeen: number(),
|
|
17492
|
+
/** How many frames the dataset already holds from this track. */
|
|
17493
|
+
frameCount: number().int(),
|
|
17494
|
+
/** How many subjects have been annotated on those frames. `0` with
|
|
17495
|
+
* `frameCount: 0` is exactly "staging, still to work". */
|
|
17496
|
+
annotationCount: number().int()
|
|
17497
|
+
});
|
|
17498
|
+
/** A frame the picker may offer — an index row, no blob was read to produce it. */
|
|
17499
|
+
var RetrainFrameCandidateSchema = object({
|
|
17500
|
+
mediaKey: string(),
|
|
17501
|
+
kind: MediaFileKindEnum,
|
|
17502
|
+
timestamp: number(),
|
|
17503
|
+
sizeBytes: number().int(),
|
|
17504
|
+
/** A copy of this original already exists — selecting it is free and cannot
|
|
17505
|
+
* fail, whatever became of the original. */
|
|
17506
|
+
copied: boolean()
|
|
17507
|
+
});
|
|
17508
|
+
/** A frame the dataset OWNS: bytes copied at selection time. */
|
|
17509
|
+
var RetrainFrameSchema = object({
|
|
17510
|
+
frameId: string(),
|
|
17438
17511
|
deviceId: number(),
|
|
17439
|
-
|
|
17440
|
-
|
|
17441
|
-
|
|
17512
|
+
trackId: string(),
|
|
17513
|
+
/** Provenance only. It may already point at nothing — that is expected. */
|
|
17514
|
+
sourceMediaKey: string(),
|
|
17515
|
+
sourceKind: MediaFileKindEnum,
|
|
17516
|
+
sizeBytes: number().int(),
|
|
17517
|
+
width: number().int(),
|
|
17518
|
+
height: number().int(),
|
|
17519
|
+
copiedAt: number()
|
|
17520
|
+
});
|
|
17521
|
+
/** Why a copy-on-select could not be honoured — named, never a silent skip. */
|
|
17522
|
+
var RetrainCopyRefusalSchema = _enum([
|
|
17523
|
+
"source-missing",
|
|
17524
|
+
"unreadable-image",
|
|
17525
|
+
"write-failed"
|
|
17526
|
+
]);
|
|
17527
|
+
var RetrainFrameSelectionSchema = object({
|
|
17528
|
+
copied: array(RetrainFrameSchema).readonly(),
|
|
17529
|
+
refused: array(object({
|
|
17530
|
+
sourceMediaKey: string(),
|
|
17531
|
+
reason: RetrainCopyRefusalSchema
|
|
17532
|
+
})).readonly()
|
|
17442
17533
|
});
|
|
17534
|
+
var RetrainFrameListSchema = object({
|
|
17535
|
+
candidates: array(RetrainFrameCandidateSchema).readonly(),
|
|
17536
|
+
copies: array(RetrainFrameSchema).readonly(),
|
|
17537
|
+
/** What the page pre-selects — the native key frame when one survives. */
|
|
17538
|
+
autoPickMediaKey: string().optional()
|
|
17539
|
+
});
|
|
17540
|
+
/** What the operator asked the assist to look for. */
|
|
17541
|
+
var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
|
|
17542
|
+
kind: literal("package"),
|
|
17543
|
+
zone: RetrainBboxSchema.optional()
|
|
17544
|
+
}), object({
|
|
17545
|
+
kind: literal("objects"),
|
|
17546
|
+
modelId: string(),
|
|
17547
|
+
minScore: number().optional()
|
|
17548
|
+
})]);
|
|
17443
17549
|
/**
|
|
17444
|
-
*
|
|
17445
|
-
*
|
|
17446
|
-
*
|
|
17550
|
+
* The assist's answer — a discriminated union, because "the model saw nothing"
|
|
17551
|
+
* and "this node cannot run that model" lead to different next moves and a
|
|
17552
|
+
* nullable result cannot tell them apart.
|
|
17447
17553
|
*/
|
|
17448
|
-
var
|
|
17449
|
-
|
|
17450
|
-
|
|
17451
|
-
|
|
17452
|
-
|
|
17453
|
-
|
|
17454
|
-
|
|
17455
|
-
|
|
17456
|
-
|
|
17457
|
-
|
|
17554
|
+
var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
|
|
17555
|
+
kind: literal("proposed"),
|
|
17556
|
+
modelId: string(),
|
|
17557
|
+
stepId: string(),
|
|
17558
|
+
minScore: number(),
|
|
17559
|
+
/** Drafts, ready to edit. `source: 'assist'` until the operator touches one. */
|
|
17560
|
+
proposals: array(RetrainAnnotationDraftSchema).readonly(),
|
|
17561
|
+
/** Returned by the runner but removed by the threshold. */
|
|
17562
|
+
belowThreshold: number().int()
|
|
17563
|
+
}), object({
|
|
17564
|
+
kind: literal("refused"),
|
|
17565
|
+
/** `no-zone` is ours; the rest are the runner's own refusal vocabulary. */
|
|
17566
|
+
reason: string(),
|
|
17567
|
+
detail: string().optional()
|
|
17568
|
+
})]);
|
|
17569
|
+
/** The outcome of a lifecycle move owned by the retrain page. */
|
|
17570
|
+
var RetrainTransitionResultSchema = object({
|
|
17571
|
+
trackId: string(),
|
|
17572
|
+
/** Where the track ended up, whatever happened. */
|
|
17573
|
+
retrainStatus: RetrainStatusSchema,
|
|
17574
|
+
/** `false` ⇒ the move was refused or was a no-op; `reason` says which. */
|
|
17575
|
+
changed: boolean(),
|
|
17576
|
+
reason: _enum([
|
|
17577
|
+
"unknown-track",
|
|
17578
|
+
"no-frames-copied",
|
|
17579
|
+
"not-staging",
|
|
17580
|
+
"not-trained",
|
|
17581
|
+
"unchanged"
|
|
17582
|
+
]).optional()
|
|
17458
17583
|
});
|
|
17459
|
-
|
|
17460
|
-
|
|
17461
|
-
|
|
17462
|
-
|
|
17463
|
-
|
|
17464
|
-
|
|
17465
|
-
|
|
17466
|
-
|
|
17467
|
-
|
|
17468
|
-
|
|
17469
|
-
|
|
17470
|
-
|
|
17471
|
-
format: _enum([
|
|
17472
|
-
"rgb",
|
|
17473
|
-
"gray",
|
|
17474
|
-
"jpeg"
|
|
17475
|
-
])
|
|
17584
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
17585
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
17586
|
+
var DeviceEventQueryInput = object({
|
|
17587
|
+
deviceId: number(),
|
|
17588
|
+
since: number().optional(),
|
|
17589
|
+
until: number().optional(),
|
|
17590
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
17591
|
+
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
17592
|
+
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
17593
|
+
* exact behaviour. Callers may omit this field — the store defaults to
|
|
17594
|
+
* `full` when not provided. */
|
|
17595
|
+
projection: _enum(["full", "slim"]).optional()
|
|
17476
17596
|
});
|
|
17477
|
-
var
|
|
17478
|
-
|
|
17479
|
-
|
|
17480
|
-
|
|
17481
|
-
|
|
17482
|
-
|
|
17483
|
-
|
|
17484
|
-
|
|
17597
|
+
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
17598
|
+
var RecentTracksQueryInput = object({
|
|
17599
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
17600
|
+
deviceIds: array(number()),
|
|
17601
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
17602
|
+
since: number().optional(),
|
|
17603
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
17604
|
+
until: number().optional(),
|
|
17605
|
+
/** Page size. Default 200, max 1000. */
|
|
17606
|
+
limit: number().int().min(1).max(1e3).default(200),
|
|
17607
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
17608
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
17609
|
+
cursor: string().optional(),
|
|
17610
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
17611
|
+
projection: TrackProjectionSchema.optional(),
|
|
17612
|
+
/** Include stationary-promoted rows (parked objects). Default false: the
|
|
17613
|
+
* feed lists passages; parking records live on the stationary registry. */
|
|
17614
|
+
includeStationary: boolean().optional()
|
|
17485
17615
|
});
|
|
17486
|
-
var
|
|
17487
|
-
|
|
17488
|
-
|
|
17489
|
-
|
|
17490
|
-
|
|
17491
|
-
|
|
17492
|
-
|
|
17493
|
-
|
|
17494
|
-
var
|
|
17495
|
-
|
|
17496
|
-
|
|
17497
|
-
|
|
17498
|
-
|
|
17499
|
-
|
|
17500
|
-
|
|
17501
|
-
|
|
17502
|
-
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
|
|
17616
|
+
var RecentTracksPageSchema = object({
|
|
17617
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
17618
|
+
tracks: array(TrackSchema).readonly(),
|
|
17619
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
17620
|
+
nextCursor: string().nullable()
|
|
17621
|
+
});
|
|
17622
|
+
var LIST_GROUPS_DEFAULT_LIMIT = 40;
|
|
17623
|
+
var LIST_GROUPS_MAX_LIMIT = 100;
|
|
17624
|
+
var AnalyticsGroupRecordSchema = object({
|
|
17625
|
+
id: string(),
|
|
17626
|
+
deviceId: number().int(),
|
|
17627
|
+
openedAt: number().int(),
|
|
17628
|
+
closedAt: number().int(),
|
|
17629
|
+
timestamp: number().int(),
|
|
17630
|
+
memberCount: number().int(),
|
|
17631
|
+
memberTrackIds: array(string()).readonly(),
|
|
17632
|
+
className: string(),
|
|
17633
|
+
classes: array(string()).readonly(),
|
|
17634
|
+
/** Relative event-media path, or null when the group has no picture yet. */
|
|
17635
|
+
mediaUrl: string().nullable(),
|
|
17636
|
+
singleton: boolean()
|
|
17506
17637
|
});
|
|
17507
|
-
var
|
|
17508
|
-
|
|
17509
|
-
|
|
17510
|
-
|
|
17511
|
-
|
|
17512
|
-
|
|
17513
|
-
|
|
17514
|
-
defaultDevice: string()
|
|
17638
|
+
var AnalyticsGroupMemberSchema = object({
|
|
17639
|
+
trackId: string(),
|
|
17640
|
+
deviceId: number().int(),
|
|
17641
|
+
className: string(),
|
|
17642
|
+
firstSeen: number().int(),
|
|
17643
|
+
lastSeen: number().int(),
|
|
17644
|
+
mediaUrl: string().nullable()
|
|
17515
17645
|
});
|
|
17516
|
-
var
|
|
17517
|
-
|
|
17518
|
-
|
|
17519
|
-
|
|
17520
|
-
|
|
17521
|
-
|
|
17522
|
-
|
|
17523
|
-
|
|
17524
|
-
|
|
17525
|
-
|
|
17526
|
-
|
|
17527
|
-
}));
|
|
17528
|
-
var PipelineTemplateStepSchema = lazy(() => object({
|
|
17529
|
-
addonId: string(),
|
|
17530
|
-
enabled: boolean(),
|
|
17531
|
-
modelId: string(),
|
|
17532
|
-
children: array(PipelineTemplateStepSchema).readonly(),
|
|
17533
|
-
settings: record(string(), unknown()).optional()
|
|
17534
|
-
}));
|
|
17535
|
-
var PipelineTemplateSchema$1 = object({
|
|
17536
|
-
id: string(),
|
|
17537
|
-
name: string(),
|
|
17538
|
-
createdAt: string(),
|
|
17539
|
-
updatedAt: string(),
|
|
17540
|
-
engine: PipelineEngineChoiceSchema,
|
|
17541
|
-
steps: array(PipelineTemplateStepSchema).readonly()
|
|
17646
|
+
var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
|
|
17647
|
+
var ListGroupsQueryInput = object({
|
|
17648
|
+
/** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
|
|
17649
|
+
deviceIds: array(number()),
|
|
17650
|
+
/** Window lower bound on `closedAt` (inclusive). */
|
|
17651
|
+
since: number().optional(),
|
|
17652
|
+
/** Window upper bound on `openedAt` (inclusive). */
|
|
17653
|
+
until: number().optional(),
|
|
17654
|
+
limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
|
|
17655
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`. */
|
|
17656
|
+
cursor: string().optional()
|
|
17542
17657
|
});
|
|
17543
|
-
var
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
formats: record(string(), object({
|
|
17547
|
-
downloaded: boolean(),
|
|
17548
|
-
sizeMB: number()
|
|
17549
|
-
})),
|
|
17550
|
-
group: ModelVariantGroupSchema.optional(),
|
|
17551
|
-
legacy: boolean().optional(),
|
|
17552
|
-
provider: ModelProviderIdSchema.optional()
|
|
17658
|
+
var ListGroupsPageSchema = object({
|
|
17659
|
+
groups: array(AnalyticsGroupRecordSchema).readonly(),
|
|
17660
|
+
nextCursor: string().nullable()
|
|
17553
17661
|
});
|
|
17554
|
-
var
|
|
17555
|
-
|
|
17556
|
-
|
|
17557
|
-
|
|
17558
|
-
|
|
17559
|
-
|
|
17560
|
-
|
|
17561
|
-
|
|
17562
|
-
|
|
17563
|
-
|
|
17564
|
-
|
|
17565
|
-
enabledByDefault: boolean().optional(),
|
|
17566
|
-
backfillIntoExistingOverrides: boolean().optional(),
|
|
17567
|
-
defaultConfidence: number(),
|
|
17568
|
-
group: string().optional(),
|
|
17569
|
-
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
17662
|
+
var KeyEventQueryInput = object({
|
|
17663
|
+
deviceId: number(),
|
|
17664
|
+
/** Window lower bound (track firstSeen ≥ since). */
|
|
17665
|
+
since: number(),
|
|
17666
|
+
/** Window upper bound (track firstSeen ≤ until). */
|
|
17667
|
+
until: number(),
|
|
17668
|
+
limit: number().int().min(1).max(200).default(50),
|
|
17669
|
+
/** Drop tracks scoring below this importance. */
|
|
17670
|
+
minImportance: number().min(0).max(1).optional(),
|
|
17671
|
+
/** Restrict to a single class (e.g. 'person'). */
|
|
17672
|
+
classFilter: string().optional()
|
|
17570
17673
|
});
|
|
17571
|
-
var
|
|
17572
|
-
id
|
|
17573
|
-
|
|
17574
|
-
|
|
17575
|
-
|
|
17576
|
-
|
|
17674
|
+
var KeyEventSchema = object({
|
|
17675
|
+
/** The representative event id (the track's best ObjectEvent, else its trackId). */
|
|
17676
|
+
id: string(),
|
|
17677
|
+
trackId: string(),
|
|
17678
|
+
/** Track start time (firstSeen). */
|
|
17679
|
+
timestamp: number(),
|
|
17680
|
+
className: string(),
|
|
17681
|
+
...TieredLabelFields,
|
|
17682
|
+
importance: number(),
|
|
17683
|
+
/** Highest-confidence ObjectEvent id for the track (empty when none). */
|
|
17684
|
+
bestEventId: string(),
|
|
17685
|
+
/** Track lifetime in ms (lastSeen - firstSeen). */
|
|
17686
|
+
windowMs: number().optional(),
|
|
17687
|
+
...TrackFlagFields,
|
|
17688
|
+
...TrackRetrainFields
|
|
17577
17689
|
});
|
|
17578
|
-
|
|
17579
|
-
|
|
17580
|
-
|
|
17581
|
-
|
|
17690
|
+
object({
|
|
17691
|
+
trackId: string(),
|
|
17692
|
+
className: string(),
|
|
17693
|
+
confidence: number(),
|
|
17694
|
+
bbox: BoundingBoxSchema,
|
|
17695
|
+
zones: array(string()).readonly(),
|
|
17696
|
+
state: TrackStateSchema
|
|
17582
17697
|
});
|
|
17583
|
-
var
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
|
|
17588
|
-
|
|
17589
|
-
|
|
17590
|
-
|
|
17591
|
-
|
|
17592
|
-
|
|
17593
|
-
|
|
17594
|
-
|
|
17595
|
-
|
|
17596
|
-
|
|
17597
|
-
|
|
17598
|
-
|
|
17599
|
-
error: string().optional(),
|
|
17600
|
-
nextRetryAt: number().optional(),
|
|
17601
|
-
/**
|
|
17602
|
-
* Gate A (config-correctness gate at engine change): human-readable
|
|
17603
|
-
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
17604
|
-
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
17605
|
-
* has a <format> build"). Additive/optional: informational only, never
|
|
17606
|
-
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
17607
|
-
* Absent/empty when the node-default tree resolves cleanly.
|
|
17608
|
-
*/
|
|
17609
|
-
configIssues: array(string()).optional()
|
|
17698
|
+
var OverlayDetectionSchema = looseObject({
|
|
17699
|
+
id: string(),
|
|
17700
|
+
kind: _enum(["first-level", "detail"]),
|
|
17701
|
+
macroClass: string(),
|
|
17702
|
+
score: number(),
|
|
17703
|
+
bbox: object({
|
|
17704
|
+
x: number(),
|
|
17705
|
+
y: number(),
|
|
17706
|
+
width: number(),
|
|
17707
|
+
height: number()
|
|
17708
|
+
}),
|
|
17709
|
+
labels: array(looseObject({
|
|
17710
|
+
label: string(),
|
|
17711
|
+
score: number()
|
|
17712
|
+
})).readonly(),
|
|
17713
|
+
parentId: string().optional()
|
|
17610
17714
|
});
|
|
17611
|
-
var
|
|
17612
|
-
|
|
17613
|
-
|
|
17614
|
-
|
|
17615
|
-
|
|
17616
|
-
|
|
17617
|
-
|
|
17618
|
-
|
|
17619
|
-
|
|
17620
|
-
addonId: string(),
|
|
17621
|
-
chosen: string(),
|
|
17622
|
-
running: string(),
|
|
17623
|
-
format: string()
|
|
17715
|
+
var ScoredObjectEventSchema = ObjectEventSchema.extend({ score: number() });
|
|
17716
|
+
var SearchObjectEventsInput = object({
|
|
17717
|
+
text: string(),
|
|
17718
|
+
deviceId: number().optional(),
|
|
17719
|
+
since: number().optional(),
|
|
17720
|
+
until: number().optional(),
|
|
17721
|
+
classFilter: string().optional(),
|
|
17722
|
+
limit: number().default(50),
|
|
17723
|
+
minScore: number().min(0).max(1).default(.2)
|
|
17624
17724
|
});
|
|
17625
|
-
var
|
|
17626
|
-
|
|
17627
|
-
|
|
17628
|
-
|
|
17725
|
+
var TrackCascadeCountsSchema = object({
|
|
17726
|
+
/** Persisted track roots deleted (authoritative). */
|
|
17727
|
+
tracks: number().int(),
|
|
17728
|
+
/** Object events removed with their tracks (best-effort; see note above). */
|
|
17729
|
+
events: number().int(),
|
|
17730
|
+
/** Track/face/plate-owned media removed (best-effort). Never identity media. */
|
|
17731
|
+
media: number().int(),
|
|
17732
|
+
/** Unassigned (non-enrolled) face reads removed (best-effort). */
|
|
17733
|
+
faces: number().int(),
|
|
17734
|
+
/** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
|
|
17735
|
+
plates: number().int(),
|
|
17736
|
+
/** Per-track CLIP search vectors removed (best-effort). */
|
|
17737
|
+
embeddings: number().int(),
|
|
17738
|
+
/** Group membership + group rows removed with their last member (best-effort). */
|
|
17739
|
+
groups: number().int()
|
|
17629
17740
|
});
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17633
|
-
|
|
17634
|
-
|
|
17635
|
-
format: string()
|
|
17741
|
+
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
17742
|
+
var DiskReconcileCountsSchema = object({
|
|
17743
|
+
mediaDropped: number().int(),
|
|
17744
|
+
tracks: number().int(),
|
|
17745
|
+
events: number().int()
|
|
17636
17746
|
});
|
|
17637
|
-
|
|
17638
|
-
|
|
17639
|
-
|
|
17747
|
+
/** Event-store footprint for one camera. */
|
|
17748
|
+
var EventStoreDeviceFootprintSchema = object({
|
|
17749
|
+
deviceId: number(),
|
|
17750
|
+
/** Persisted event rows (motion + object + audio) for the camera. */
|
|
17751
|
+
rows: number().int(),
|
|
17752
|
+
/** Event-owned media bytes on disk for the camera. */
|
|
17753
|
+
bytes: number().int()
|
|
17640
17754
|
});
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
|
|
17755
|
+
/** Aggregate event-store footprint: global totals + per-camera breakdown. */
|
|
17756
|
+
var EventStoreFootprintSchema = object({
|
|
17757
|
+
totalRows: number().int(),
|
|
17758
|
+
totalBytes: number().int(),
|
|
17759
|
+
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
17644
17760
|
});
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17761
|
+
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
17762
|
+
var EventPruneCountsSchema = object({
|
|
17763
|
+
motion: number().int(),
|
|
17764
|
+
object: number().int(),
|
|
17765
|
+
audio: number().int()
|
|
17648
17766
|
});
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
17652
|
-
|
|
17653
|
-
|
|
17654
|
-
|
|
17767
|
+
/**
|
|
17768
|
+
* Re-embed stored tracks from their key frames.
|
|
17769
|
+
*
|
|
17770
|
+
* The reason this is an operator-callable method and not a migration script:
|
|
17771
|
+
* every knob that decides what a vector MEANS — encoder model, crop margin,
|
|
17772
|
+
* squaring — is only changeable if the existing vectors can be regenerated.
|
|
17773
|
+
* Mixing feature spaces in one index makes cosine scores incomparable, and the
|
|
17774
|
+
* symptom is a quality regression with no visible cause.
|
|
17775
|
+
*/
|
|
17776
|
+
var RebuildObjectEmbeddingsInput = object({
|
|
17777
|
+
/** Restrict to one camera. Omit for the whole fleet. */
|
|
17778
|
+
deviceId: number().optional(),
|
|
17779
|
+
since: number().optional(),
|
|
17780
|
+
until: number().optional(),
|
|
17781
|
+
/** Stop after this many tracks; the result reports whether more remain. */
|
|
17782
|
+
maxTracks: number().int().positive().optional(),
|
|
17655
17783
|
/**
|
|
17656
|
-
*
|
|
17657
|
-
*
|
|
17658
|
-
*
|
|
17659
|
-
*
|
|
17784
|
+
* Run every embedding on THIS node instead of round-robining the fleet.
|
|
17785
|
+
*
|
|
17786
|
+
* Named `executeOnNodeId` and not `nodeId` on purpose: an inline `nodeId`
|
|
17787
|
+
* field in cap args is read by `parent-unowned-call.ts` as a ROUTING PIN, so
|
|
17788
|
+
* calling it that would pin the rebuild REQUEST itself to that node — the
|
|
17789
|
+
* rebuild orchestration lives on the hub, and only the per-track step runs
|
|
17790
|
+
* remotely. This field is data; the per-track pin is applied inside.
|
|
17791
|
+
*
|
|
17792
|
+
* Absent ⇒ round-robin over every online node whose runner can serve the
|
|
17793
|
+
* pinned model.
|
|
17660
17794
|
*/
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
|
|
17668
|
-
|
|
17669
|
-
|
|
17670
|
-
|
|
17671
|
-
|
|
17672
|
-
|
|
17795
|
+
executeOnNodeId: string().optional(),
|
|
17796
|
+
/**
|
|
17797
|
+
* Milliseconds to wait between tracks; omit for the built-in default, `0` to
|
|
17798
|
+
* run flat out.
|
|
17799
|
+
*
|
|
17800
|
+
* A rebuild is bulk maintenance on hub-main's single thread. Measured
|
|
17801
|
+
* 2026-08-06, an unpaced pass held that thread busy 82.2 s out of 120 and
|
|
17802
|
+
* pushed `nodes.topology` from 0.25 s to 26 s for 43 minutes. The value in
|
|
17803
|
+
* force is logged at start and finish so a deliberately slow pass reads
|
|
17804
|
+
* differently from a stalled one.
|
|
17805
|
+
*/
|
|
17806
|
+
pacingMs: number().int().nonnegative().optional()
|
|
17673
17807
|
});
|
|
17674
17808
|
/**
|
|
17675
|
-
*
|
|
17676
|
-
*
|
|
17677
|
-
*
|
|
17678
|
-
*
|
|
17679
|
-
*
|
|
17680
|
-
*
|
|
17681
|
-
* benchmark UI can still report a clean failure when the classifier
|
|
17682
|
-
* cap isn't available.
|
|
17809
|
+
* Result of emptying the CLIP index.
|
|
17810
|
+
*
|
|
17811
|
+
* The clean slate before a policy change: a new crop margin or encoder model
|
|
17812
|
+
* leaves two feature spaces in one index whose cosine scores are not
|
|
17813
|
+
* comparable, so wiping and rebuilding is the only way to be sure every vector
|
|
17814
|
+
* means the same thing.
|
|
17683
17815
|
*/
|
|
17684
|
-
var
|
|
17685
|
-
|
|
17686
|
-
|
|
17687
|
-
|
|
17816
|
+
var WipeObjectEmbeddingsResultSchema = object({ deleted: number() });
|
|
17817
|
+
/**
|
|
17818
|
+
* Acknowledgement that a rebuild STARTED.
|
|
17819
|
+
*
|
|
17820
|
+
* The pass costs ~1s per track — 45 minutes for a 2,600-track fleet — so it
|
|
17821
|
+
* runs detached and this returns immediately. Waiting for it made the client
|
|
17822
|
+
* time out while the work carried on server-side, which is the worst of both:
|
|
17823
|
+
* no result and no way to know it was still going. Poll
|
|
17824
|
+
* `getObjectEmbeddingRebuildStatus` for progress.
|
|
17825
|
+
*/
|
|
17826
|
+
var RebuildObjectEmbeddingsResultSchema = object({
|
|
17827
|
+
started: boolean(),
|
|
17828
|
+
/** True when a pass was already running; the new request is ignored. */
|
|
17829
|
+
alreadyRunning: boolean()
|
|
17688
17830
|
});
|
|
17689
|
-
var
|
|
17690
|
-
|
|
17691
|
-
|
|
17692
|
-
|
|
17693
|
-
|
|
17694
|
-
|
|
17695
|
-
|
|
17696
|
-
|
|
17697
|
-
|
|
17698
|
-
|
|
17699
|
-
|
|
17700
|
-
|
|
17701
|
-
|
|
17831
|
+
var RebuildStatusSchema = object({
|
|
17832
|
+
running: boolean(),
|
|
17833
|
+
scanned: number(),
|
|
17834
|
+
rebuilt: number(),
|
|
17835
|
+
/** Tracks whose key frame is gone — nothing to re-embed from. */
|
|
17836
|
+
missingKeyFrame: number(),
|
|
17837
|
+
/** Tracks with no usable detection box. */
|
|
17838
|
+
missingBbox: number(),
|
|
17839
|
+
/**
|
|
17840
|
+
* Tracks an executing node REFUSED rather than broke on — an unreadable key
|
|
17841
|
+
* frame, a step that threw. Separate from `failed` because the remedy is
|
|
17842
|
+
* different, and because a whole camera silently contributing zero vectors
|
|
17843
|
+
* is the shape of failure a rebuild must never hide.
|
|
17844
|
+
*/
|
|
17845
|
+
notRunnable: number(),
|
|
17846
|
+
/**
|
|
17847
|
+
* The pass stopped because NO node could serve the pinned model.
|
|
17848
|
+
*
|
|
17849
|
+
* Distinct from `notRunnable` on purpose: that one says "this track was
|
|
17850
|
+
* refused", this one says "the cluster cannot do this work at all" — every
|
|
17851
|
+
* candidate node either lacks the `clip-embedding` step, lacks a build of the
|
|
17852
|
+
* pinned model for its engine format, or dropped out. The remedy is a model /
|
|
17853
|
+
* engine change, not a per-camera one. Non-zero here always comes with
|
|
17854
|
+
* `complete: false`.
|
|
17855
|
+
*/
|
|
17856
|
+
noCapableNode: number(),
|
|
17857
|
+
failed: number(),
|
|
17858
|
+
/** Set once a pass ends: true only when EVERYTHING was covered. */
|
|
17859
|
+
complete: boolean().nullable(),
|
|
17860
|
+
startedAtMs: number().nullable(),
|
|
17861
|
+
finishedAtMs: number().nullable(),
|
|
17862
|
+
/** Present when the pass ended by throwing. */
|
|
17863
|
+
error: string().nullable()
|
|
17864
|
+
});
|
|
17865
|
+
var ReplayFrameInputSchema = object({
|
|
17866
|
+
timestamp: number(),
|
|
17867
|
+
frame: PipelineRunResultBridge
|
|
17868
|
+
});
|
|
17869
|
+
var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
17870
|
+
className: string(),
|
|
17871
|
+
firstSeenMs: number(),
|
|
17872
|
+
lastSeenMs: number(),
|
|
17873
|
+
/** Bbox of the track's FIRST matched detection, pixel-space in the clip's
|
|
17874
|
+
* frame — a representative box for the diff's `(className, window, IoU)`
|
|
17875
|
+
* pairing (`replay-diff.ts`). A replay does not need the full per-frame
|
|
17876
|
+
* trajectory production's `Track.positions` keeps. */
|
|
17877
|
+
bbox: BoundingBoxSchema,
|
|
17878
|
+
/** How many of the input frames this track matched a real detection on
|
|
17879
|
+
* (never a coasted/extrapolated frame) — the replay's own signal for "how
|
|
17880
|
+
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
17881
|
+
framesMatched: number().int()
|
|
17882
|
+
})).readonly() });
|
|
17883
|
+
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
17884
|
+
deviceId: number(),
|
|
17885
|
+
trackId: string()
|
|
17886
|
+
}), TrackSchema.nullable()), method(object({
|
|
17887
|
+
deviceId: number(),
|
|
17888
|
+
since: number().optional(),
|
|
17889
|
+
until: number().optional(),
|
|
17890
|
+
limit: number().optional(),
|
|
17891
|
+
/** Spatial filter — only tracks whose trajectory intersects the zone
|
|
17892
|
+
* (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
|
|
17893
|
+
* envelope columns, then precisely tested per position. Tracks with
|
|
17894
|
+
* an unknown envelope (no frame dims at persist time) always match. */
|
|
17895
|
+
zone: TrackZoneFilterSchema.optional(),
|
|
17896
|
+
/** See {@link TrackProjectionSchema}. Default `full` (backward
|
|
17897
|
+
* compatible — omitting the field keeps today's exact behaviour). */
|
|
17898
|
+
projection: TrackProjectionSchema.optional(),
|
|
17899
|
+
/** Include stationary-promoted rows (parked objects handed to the
|
|
17900
|
+
* stationary registry). Default false: the timeline lists passages,
|
|
17901
|
+
* not parking records (operator decision, 2026-08-15). */
|
|
17902
|
+
includeStationary: boolean().optional()
|
|
17903
|
+
}), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
|
|
17904
|
+
deviceId: number(),
|
|
17905
|
+
groupId: string().min(1)
|
|
17906
|
+
}), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
|
|
17907
|
+
kind: "mutation",
|
|
17908
|
+
auth: "admin"
|
|
17909
|
+
}), 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({
|
|
17910
|
+
deviceId: number(),
|
|
17911
|
+
since: number().optional(),
|
|
17912
|
+
until: number().optional(),
|
|
17913
|
+
kinds: array(string()).optional(),
|
|
17914
|
+
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
17915
|
+
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
17916
|
+
deviceId: number(),
|
|
17917
|
+
since: number(),
|
|
17918
|
+
until: number(),
|
|
17919
|
+
bucketMs: number().int().positive()
|
|
17920
|
+
}), array(object({
|
|
17921
|
+
bucketStart: number(),
|
|
17922
|
+
motion: number().int(),
|
|
17923
|
+
object: number().int(),
|
|
17924
|
+
audio: number().int()
|
|
17925
|
+
})).readonly()), method(object({
|
|
17926
|
+
deviceId: number(),
|
|
17927
|
+
cutoffMs: number()
|
|
17928
|
+
}), object({
|
|
17929
|
+
motion: number().int(),
|
|
17930
|
+
object: number().int(),
|
|
17931
|
+
audio: number().int()
|
|
17932
|
+
}), {
|
|
17933
|
+
kind: "mutation",
|
|
17934
|
+
auth: "admin"
|
|
17935
|
+
}), method(object({
|
|
17936
|
+
deviceId: number(),
|
|
17937
|
+
cutoffMs: number()
|
|
17938
|
+
}), TrackCascadeCountsSchema, {
|
|
17939
|
+
kind: "mutation",
|
|
17940
|
+
auth: "admin"
|
|
17941
|
+
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
17942
|
+
kind: "mutation",
|
|
17943
|
+
auth: "admin"
|
|
17944
|
+
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
17945
|
+
kind: "mutation",
|
|
17946
|
+
auth: "admin"
|
|
17947
|
+
}), method(object({
|
|
17948
|
+
deviceId: number(),
|
|
17949
|
+
trackIds: array(string()).min(1)
|
|
17950
|
+
}), object({
|
|
17951
|
+
deleted: number().int(),
|
|
17952
|
+
failed: array(string()).readonly()
|
|
17953
|
+
}), {
|
|
17954
|
+
kind: "mutation",
|
|
17955
|
+
auth: "admin"
|
|
17956
|
+
}), method(object({
|
|
17957
|
+
/** Log/audit scope only — the trackId is globally unique on its own. */
|
|
17958
|
+
deviceId: number(),
|
|
17959
|
+
trackId: string(),
|
|
17960
|
+
flags: TrackFlagsPatchSchema
|
|
17961
|
+
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
17962
|
+
kind: "query",
|
|
17963
|
+
auth: "admin"
|
|
17964
|
+
}), method(object({
|
|
17965
|
+
olderThanMs: number(),
|
|
17966
|
+
reason: OpsLogReasonSchema.optional()
|
|
17967
|
+
}), EventPruneCountsSchema, {
|
|
17968
|
+
kind: "mutation",
|
|
17969
|
+
auth: "admin"
|
|
17970
|
+
}), method(object({ deviceId: number() }), EventPruneCountsSchema, {
|
|
17971
|
+
kind: "mutation",
|
|
17972
|
+
auth: "admin"
|
|
17973
|
+
}), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
17974
|
+
kind: "mutation",
|
|
17975
|
+
auth: "admin"
|
|
17976
|
+
}), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
|
|
17977
|
+
kind: "mutation",
|
|
17978
|
+
auth: "admin"
|
|
17979
|
+
}), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
|
|
17980
|
+
kind: "mutation",
|
|
17981
|
+
auth: "admin"
|
|
17982
|
+
}), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
|
|
17983
|
+
kind: "mutation",
|
|
17984
|
+
auth: "admin"
|
|
17985
|
+
}), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
17986
|
+
kind: "mutation",
|
|
17987
|
+
auth: "admin"
|
|
17988
|
+
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
17989
|
+
kind: "mutation",
|
|
17990
|
+
auth: "admin"
|
|
17991
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
17992
|
+
kind: "query",
|
|
17993
|
+
auth: "admin"
|
|
17994
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
17995
|
+
kind: "mutation",
|
|
17996
|
+
auth: "admin"
|
|
17997
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
17998
|
+
kind: "query",
|
|
17999
|
+
auth: "admin"
|
|
18000
|
+
}), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
|
|
18001
|
+
kind: "query",
|
|
18002
|
+
auth: "admin"
|
|
18003
|
+
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
18004
|
+
kind: "query",
|
|
18005
|
+
auth: "admin"
|
|
18006
|
+
}), method(object({
|
|
18007
|
+
/** Empty ⇒ every camera that has staging tracks. A LIST, not a single
|
|
18008
|
+
* `deviceId`, deliberately: `deviceId` would make this device-bound and
|
|
18009
|
+
* route it at one camera's owner, and "every camera" would stop being
|
|
18010
|
+
* expressible at all. */
|
|
18011
|
+
deviceIds: array(number()).optional(),
|
|
18012
|
+
limit: number().int().min(1).max(500).optional()
|
|
18013
|
+
}), array(RetrainTrackSchema).readonly(), {
|
|
18014
|
+
kind: "query",
|
|
18015
|
+
auth: "admin"
|
|
18016
|
+
}), method(object({ trackId: string() }), RetrainFrameListSchema, {
|
|
18017
|
+
kind: "query",
|
|
18018
|
+
auth: "admin"
|
|
18019
|
+
}), method(object({
|
|
18020
|
+
deviceId: number(),
|
|
18021
|
+
trackId: string(),
|
|
18022
|
+
mediaKeys: array(string()).min(1)
|
|
18023
|
+
}), RetrainFrameSelectionSchema, {
|
|
17702
18024
|
kind: "mutation",
|
|
17703
18025
|
auth: "admin"
|
|
17704
|
-
}), method(object({
|
|
17705
|
-
|
|
17706
|
-
|
|
18026
|
+
}), method(object({
|
|
18027
|
+
deviceId: number(),
|
|
18028
|
+
trackId: string(),
|
|
18029
|
+
frameId: string()
|
|
18030
|
+
}), object({
|
|
18031
|
+
removed: boolean(),
|
|
18032
|
+
removedAnnotations: number().int()
|
|
17707
18033
|
}), {
|
|
17708
18034
|
kind: "mutation",
|
|
17709
18035
|
auth: "admin"
|
|
17710
|
-
}), method(
|
|
17711
|
-
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
}),
|
|
17715
|
-
|
|
17716
|
-
|
|
17717
|
-
|
|
17718
|
-
|
|
17719
|
-
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
|
|
17724
|
-
|
|
17725
|
-
format: ModelFormatSchema$1
|
|
17726
|
-
}), object({ success: literal(true) }), { kind: "mutation" }), method(object({
|
|
17727
|
-
engine: PipelineEngineChoiceSchema.optional(),
|
|
17728
|
-
steps: array(PipelineStepInputSchema).min(1),
|
|
17729
|
-
frame: FrameInputSchema.optional(),
|
|
17730
|
-
/**
|
|
17731
|
-
* Process-local lazy frame. Valid only when caller and provider resolve
|
|
17732
|
-
* in the same execution-group process; split/cross-node callers use
|
|
17733
|
-
* `frame`/`image` inline compatibility instead.
|
|
17734
|
-
*/
|
|
17735
|
-
frameRef: FrameRefSchema.optional(),
|
|
17736
|
-
/**
|
|
17737
|
-
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
17738
|
-
* the decoded pixels live in. One more member of the one-of
|
|
17739
|
-
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
17740
|
-
*/
|
|
17741
|
-
frameHandle: FrameHandleSchema.optional(),
|
|
17742
|
-
imageBase64: string().optional(),
|
|
17743
|
-
/**
|
|
17744
|
-
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
17745
|
-
* hops (hub → forked worker via Moleculer MsgPack) because it
|
|
17746
|
-
* skips the 33% base64 overhead + the per-call base64 decode on
|
|
17747
|
-
* the detection-pipeline worker. Callers can pass either; exactly
|
|
17748
|
-
* one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
|
|
17749
|
-
*/
|
|
17750
|
-
image: _instanceof(Uint8Array).optional(),
|
|
17751
|
-
referenceImage: string().optional(),
|
|
17752
|
-
deviceId: number().optional(),
|
|
17753
|
-
sessionId: string().optional(),
|
|
17754
|
-
/**
|
|
17755
|
-
* Execution plane. 'full' (default) runs the whole tree — benchmark,
|
|
17756
|
-
* reference-image, and detail-subtree calls. 'frame' is the live
|
|
17757
|
-
* per-frame dispatch: ONLY root-plane steps run; crop children
|
|
17758
|
-
* (inputClasses ≠ null) are skipped and served per-track via
|
|
17759
|
-
* pipelineRunner.runDetailSubtree (two-plane design).
|
|
17760
|
-
*/
|
|
17761
|
-
plane: _enum(["full", "frame"]).optional(),
|
|
17762
|
-
/**
|
|
17763
|
-
* Inference-device selector (Phase 2 multi-device). Format
|
|
17764
|
-
* `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
|
|
17765
|
-
* Omitted ⇒ the runner's default device (current single-engine
|
|
17766
|
-
* behaviour). Selects WHICH device pool of the node runs the call.
|
|
17767
|
-
*/
|
|
17768
|
-
deviceKey: string().optional(),
|
|
17769
|
-
/**
|
|
17770
|
-
* Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
|
|
17771
|
-
* when the parent crop was resolved from the frame's retained NATIVE
|
|
17772
|
-
* surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
|
|
17773
|
-
* child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
|
|
17774
|
-
* resolution from that surface — the SAME quality path faces already
|
|
17775
|
-
* had — instead of the downscaled parent tile. `handle` keys the native
|
|
17776
|
-
* surface (node-pinned to its owner); `cropFrameSpace` is the parent
|
|
17777
|
-
* crop's padded/clamped rectangle in FRAME-space pixels, used to compose
|
|
17778
|
-
* the executor's crop-normalized child ROI back into frame-normalized
|
|
17779
|
-
* coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
|
|
17780
|
-
* of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
|
|
17781
|
-
* (today's behaviour on the fallback path).
|
|
17782
|
-
*/
|
|
17783
|
-
nativeCropRef: NativeCropRefSchema.optional()
|
|
17784
|
-
}), PipelineRunResultBridge, { kind: "mutation" }), method(object({
|
|
17785
|
-
engine: PipelineEngineChoiceSchema.optional(),
|
|
17786
|
-
steps: array(PipelineStepInputSchema).min(1),
|
|
17787
|
-
frames: array(FrameInputSchema).min(1).max(255),
|
|
17788
|
-
deviceId: number().optional(),
|
|
17789
|
-
sessionId: string().optional(),
|
|
17790
|
-
/**
|
|
17791
|
-
* Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
|
|
17792
|
-
* the batch to the Python pool's bench preprocess cache
|
|
17793
|
-
* (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
|
|
17794
|
-
* preprocessed ONCE and every later inference is a pure-inference cache
|
|
17795
|
-
* hit — the sustained-throughput run measures inference, not
|
|
17796
|
-
* decode+preprocess+infer. Omitted/0 for live frames (all different →
|
|
17797
|
-
* full preprocess every call, correct). Fresh per sustained run;
|
|
17798
|
-
* released via `uncacheFrame`.
|
|
17799
|
-
*/
|
|
17800
|
-
frameId: number().int().nonnegative().optional(),
|
|
17801
|
-
/** Inference-device selector (Phase 2 multi-device); see runPipeline. */
|
|
17802
|
-
deviceKey: string().optional()
|
|
17803
|
-
}), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
|
|
17804
|
-
data: _instanceof(Uint8Array),
|
|
17805
|
-
width: number().int().positive(),
|
|
17806
|
-
height: number().int().positive(),
|
|
17807
|
-
format: _enum([
|
|
17808
|
-
"rgb",
|
|
17809
|
-
"bgr",
|
|
17810
|
-
"gray"
|
|
17811
|
-
])
|
|
17812
|
-
}), object({
|
|
17813
|
-
frameId: number(),
|
|
17814
|
-
width: number(),
|
|
17815
|
-
height: number()
|
|
17816
|
-
}), { kind: "mutation" }), method(object({
|
|
17817
|
-
stepId: string(),
|
|
17818
|
-
frameId: number().int()
|
|
17819
|
-
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(_void(), object({
|
|
17820
|
-
batchMode: string(),
|
|
17821
|
-
windowMs: number(),
|
|
17822
|
-
maxBatchSize: number(),
|
|
17823
|
-
concurrency: number()
|
|
17824
|
-
})), method(_void(), array(object({
|
|
17825
|
-
engineKey: string(),
|
|
17826
|
-
engine: PipelineEngineChoiceSchema,
|
|
17827
|
-
modelsLoaded: array(string()).readonly(),
|
|
17828
|
-
inUseByCameras: array(number()).readonly(),
|
|
17829
|
-
/**
|
|
17830
|
-
* Origin of this resident factory.
|
|
17831
|
-
* - `runtime` — main camera-serving engine (no idle TTL).
|
|
17832
|
-
* - `warm-override` — benchmark/test override held in the warm
|
|
17833
|
-
* cache; auto-disposed after the idle TTL.
|
|
17834
|
-
* - `device-pool` — a concurrent per-device pool (Phase 2
|
|
17835
|
-
* multi-device, keyed by `deviceKey`) resolved
|
|
17836
|
-
* via `resolveDeviceFactory`. Runs alongside the
|
|
17837
|
-
* `runtime` engine on a DIFFERENT accelerator
|
|
17838
|
-
* (NPU / iGPU / Coral) — this is how the
|
|
17839
|
-
* Engines tab shows all pools running at once.
|
|
17840
|
-
*/
|
|
17841
|
-
kind: _enum([
|
|
17842
|
-
"runtime",
|
|
17843
|
-
"warm-override",
|
|
17844
|
-
"device-pool"
|
|
17845
|
-
]),
|
|
17846
|
-
/** Native pid of the underlying Python pool (null when no pool). */
|
|
17847
|
-
poolPid: number().nullable(),
|
|
17848
|
-
/** ms since this factory was last used (null when not warm-tracked). */
|
|
17849
|
-
idleMs: number().nullable(),
|
|
17850
|
-
/** Idle TTL after which `warm-override` factories self-evict (null when not applicable). */
|
|
17851
|
-
idleTtlMs: number().nullable()
|
|
17852
|
-
})).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
|
|
18036
|
+
}), method(object({ frameId: string() }), object({
|
|
18037
|
+
base64: string(),
|
|
18038
|
+
width: number().int(),
|
|
18039
|
+
height: number().int()
|
|
18040
|
+
}), {
|
|
18041
|
+
kind: "query",
|
|
18042
|
+
auth: "admin"
|
|
18043
|
+
}), method(object({
|
|
18044
|
+
deviceId: number(),
|
|
18045
|
+
trackId: string(),
|
|
18046
|
+
frameId: string(),
|
|
18047
|
+
subject: RetrainAssistSubjectSchema,
|
|
18048
|
+
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
18049
|
+
nodeId: string().optional()
|
|
18050
|
+
}), RetrainAssistResultSchema, {
|
|
17853
18051
|
kind: "mutation",
|
|
17854
18052
|
auth: "admin"
|
|
17855
18053
|
}), method(object({
|
|
17856
|
-
|
|
17857
|
-
|
|
17858
|
-
|
|
17859
|
-
|
|
17860
|
-
|
|
17861
|
-
|
|
18054
|
+
deviceId: number(),
|
|
18055
|
+
source: DetectionSourceSchema,
|
|
18056
|
+
zones: array(ZoneSchema).readonly().optional(),
|
|
18057
|
+
detectionRules: array(ZoneRuleSchema).readonly().optional(),
|
|
18058
|
+
zoneMembershipMinOverlap: number().min(0).max(1).optional(),
|
|
18059
|
+
frames: array(ReplayFrameInputSchema).min(1)
|
|
18060
|
+
}), RunReplayFrameProcessorResultSchema, {
|
|
17862
18061
|
kind: "mutation",
|
|
17863
18062
|
auth: "admin"
|
|
17864
|
-
}), method(
|
|
17865
|
-
|
|
17866
|
-
|
|
17867
|
-
|
|
17868
|
-
|
|
17869
|
-
|
|
18063
|
+
}), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
|
|
18064
|
+
kind: "query",
|
|
18065
|
+
auth: "admin"
|
|
18066
|
+
}), method(object({
|
|
18067
|
+
deviceId: number(),
|
|
18068
|
+
trackId: string(),
|
|
18069
|
+
frameId: string(),
|
|
18070
|
+
annotations: array(RetrainAnnotationDraftSchema)
|
|
18071
|
+
}), array(RetrainAnnotationSchema).readonly(), {
|
|
18072
|
+
kind: "mutation",
|
|
18073
|
+
auth: "admin"
|
|
18074
|
+
}), method(object({
|
|
18075
|
+
deviceId: number(),
|
|
18076
|
+
trackId: string()
|
|
18077
|
+
}), RetrainTransitionResultSchema, {
|
|
18078
|
+
kind: "mutation",
|
|
18079
|
+
auth: "admin"
|
|
18080
|
+
}), method(object({
|
|
18081
|
+
deviceId: number(),
|
|
18082
|
+
trackId: string()
|
|
18083
|
+
}), RetrainTransitionResultSchema, {
|
|
18084
|
+
kind: "mutation",
|
|
18085
|
+
auth: "admin"
|
|
18086
|
+
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
18087
|
+
kind: "query",
|
|
18088
|
+
auth: "admin"
|
|
18089
|
+
}), method(object({
|
|
18090
|
+
eventId: string(),
|
|
18091
|
+
kind: MediaFileKindEnum.optional(),
|
|
18092
|
+
deviceId: number()
|
|
18093
|
+
}), array(MediaFileSchema).readonly()), method(object({
|
|
18094
|
+
trackId: string(),
|
|
18095
|
+
kinds: array(MediaFileKindEnum).optional(),
|
|
18096
|
+
deviceId: number()
|
|
18097
|
+
}), array(MediaFileSchema).readonly()), method(object({
|
|
18098
|
+
trackId: string(),
|
|
18099
|
+
deviceId: number()
|
|
18100
|
+
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
18101
|
+
kind: "mutation",
|
|
18102
|
+
auth: "admin"
|
|
18103
|
+
}), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
|
|
18104
|
+
kind: "mutation",
|
|
18105
|
+
auth: "admin"
|
|
18106
|
+
}), method(object({}), RebuildStatusSchema), object({
|
|
18107
|
+
deviceId: number(),
|
|
18108
|
+
timestamp: number(),
|
|
18109
|
+
frameWidth: number(),
|
|
18110
|
+
frameHeight: number(),
|
|
18111
|
+
detections: array(OverlayDetectionSchema).readonly()
|
|
18112
|
+
}), object({
|
|
18113
|
+
deviceId: number(),
|
|
18114
|
+
trackId: string(),
|
|
18115
|
+
className: string()
|
|
18116
|
+
}), object({
|
|
18117
|
+
deviceId: number(),
|
|
18118
|
+
trackId: string(),
|
|
18119
|
+
className: string(),
|
|
18120
|
+
durationMs: number()
|
|
18121
|
+
}), object({
|
|
18122
|
+
deviceId: number(),
|
|
18123
|
+
kind: EventKindSchema,
|
|
18124
|
+
eventId: string(),
|
|
18125
|
+
timestamp: number()
|
|
18126
|
+
});
|
|
17870
18127
|
object({
|
|
17871
18128
|
activeCameras: number(),
|
|
17872
18129
|
throttledCameras: number(),
|
|
@@ -17892,66 +18149,6 @@ var CameraMetricsSchema = object({
|
|
|
17892
18149
|
});
|
|
17893
18150
|
var CameraMetricsWithDeviceIdSchema = CameraMetricsSchema.extend({ deviceId: number() });
|
|
17894
18151
|
/**
|
|
17895
|
-
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
17896
|
-
*
|
|
17897
|
-
* Zones describe **where** in the frame the operator wants to flag
|
|
17898
|
-
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
17899
|
-
* each pipeline stage uses them. Splitting the two means a single
|
|
17900
|
-
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
17901
|
-
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
17902
|
-
* — without three duplicated polygons.
|
|
17903
|
-
*
|
|
17904
|
-
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
17905
|
-
* `zones` device-state slice on every mutation. Consumers
|
|
17906
|
-
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
17907
|
-
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
17908
|
-
* mirror with `onChanged`).
|
|
17909
|
-
*
|
|
17910
|
-
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
17911
|
-
* survive resolution changes and stream profile switches.
|
|
17912
|
-
*
|
|
17913
|
-
* `kind` discriminates between full polygons (closed regions used
|
|
17914
|
-
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
17915
|
-
* line segments used for cross events). Onboard / firmware-reported
|
|
17916
|
-
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
17917
|
-
* task list.
|
|
17918
|
-
*/
|
|
17919
|
-
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
17920
|
-
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
17921
|
-
var PolygonPointSchema = object({
|
|
17922
|
-
x: number(),
|
|
17923
|
-
y: number()
|
|
17924
|
-
});
|
|
17925
|
-
/** A camera detection zone — pure geometry/identity. */
|
|
17926
|
-
var ZoneSchema = object({
|
|
17927
|
-
id: string(),
|
|
17928
|
-
name: string(),
|
|
17929
|
-
kind: ZoneKindEnum.default("polygon"),
|
|
17930
|
-
/** Polygon vertices, fraction of frame (0–1). */
|
|
17931
|
-
polygon: array(PolygonPointSchema).readonly(),
|
|
17932
|
-
/** Visual color for UI rendering. */
|
|
17933
|
-
color: string().default("#3b82f6")
|
|
17934
|
-
});
|
|
17935
|
-
DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).readonly()), method(object({
|
|
17936
|
-
deviceId: number(),
|
|
17937
|
-
zone: ZoneSchema
|
|
17938
|
-
}), _void(), {
|
|
17939
|
-
kind: "mutation",
|
|
17940
|
-
auth: "admin"
|
|
17941
|
-
}), method(object({
|
|
17942
|
-
deviceId: number(),
|
|
17943
|
-
zoneId: string()
|
|
17944
|
-
}), _void(), {
|
|
17945
|
-
kind: "mutation",
|
|
17946
|
-
auth: "admin"
|
|
17947
|
-
}), method(object({
|
|
17948
|
-
deviceId: number(),
|
|
17949
|
-
zone: ZoneSchema
|
|
17950
|
-
}), _void(), {
|
|
17951
|
-
kind: "mutation",
|
|
17952
|
-
auth: "admin"
|
|
17953
|
-
}), object({ zones: array(ZoneSchema).readonly() });
|
|
17954
|
-
/**
|
|
17955
18152
|
* A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
|
|
17956
18153
|
* decode worker resolves it against the RETAINED native frame's real pixel dims,
|
|
17957
18154
|
* so the caller supplies only the detection-res bbox divided by the detection
|
|
@@ -19639,7 +19836,7 @@ method(object({
|
|
|
19639
19836
|
* linking rather than produce an eternal token.
|
|
19640
19837
|
*/
|
|
19641
19838
|
ttlSec: union([number().int().positive(), literal("never")]).optional()
|
|
19642
|
-
}), object({ token: string() })), method(object({ token: string() }), SsoBridgeClaimsSchema.nullable());
|
|
19839
|
+
}), object({ token: string() }), { auth: "admin" }), method(object({ token: string() }), SsoBridgeClaimsSchema.nullable(), { auth: "admin" });
|
|
19643
19840
|
var ProviderListEntrySchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
19644
19841
|
providerId: string().min(1),
|
|
19645
19842
|
displayName: string().min(1),
|
|
@@ -19734,10 +19931,13 @@ var EvictResultSchema = object({
|
|
|
19734
19931
|
/** True when the provider has nothing left it is willing to drop on this location. */
|
|
19735
19932
|
exhausted: boolean()
|
|
19736
19933
|
});
|
|
19737
|
-
method(object({ locationId: string() }), EvictableUsageSchema), method(object({
|
|
19934
|
+
method(object({ locationId: string() }), EvictableUsageSchema, { auth: "admin" }), method(object({
|
|
19738
19935
|
locationId: string(),
|
|
19739
19936
|
targetBytes: number().int().positive()
|
|
19740
|
-
}), EvictResultSchema, {
|
|
19937
|
+
}), EvictResultSchema, {
|
|
19938
|
+
kind: "mutation",
|
|
19939
|
+
auth: "admin"
|
|
19940
|
+
});
|
|
19741
19941
|
method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
|
|
19742
19942
|
kind: "mutation",
|
|
19743
19943
|
auth: "admin"
|
|
@@ -19797,26 +19997,50 @@ var ReadChunkInputSchema = object({
|
|
|
19797
19997
|
length: number()
|
|
19798
19998
|
});
|
|
19799
19999
|
var EndDownloadInputSchema = object({ downloadId: string() });
|
|
19800
|
-
method(_void(), ProviderInfoSchema), method(object({ config: record(string(), unknown()) }), TestLocationResultSchema, { auth: "admin" }), method(object({
|
|
20000
|
+
method(_void(), ProviderInfoSchema, { auth: "admin" }), method(object({ config: record(string(), unknown()) }), TestLocationResultSchema, { auth: "admin" }), method(object({
|
|
19801
20001
|
location: StorageLocationSchema,
|
|
19802
20002
|
relativePath: string()
|
|
19803
|
-
}), string()), method(object({
|
|
20003
|
+
}), string(), { auth: "admin" }), method(object({
|
|
19804
20004
|
location: StorageLocationSchema,
|
|
19805
20005
|
relativePath: string(),
|
|
19806
20006
|
data: _instanceof(Uint8Array)
|
|
19807
|
-
}), _void(), {
|
|
20007
|
+
}), _void(), {
|
|
20008
|
+
kind: "mutation",
|
|
20009
|
+
auth: "admin"
|
|
20010
|
+
}), method(object({
|
|
19808
20011
|
location: StorageLocationSchema,
|
|
19809
20012
|
relativePath: string()
|
|
19810
|
-
}), _instanceof(Uint8Array)), method(object({
|
|
20013
|
+
}), _instanceof(Uint8Array), { auth: "admin" }), method(object({
|
|
19811
20014
|
location: StorageLocationSchema,
|
|
19812
20015
|
relativePath: string()
|
|
19813
|
-
}), boolean()), method(object({
|
|
20016
|
+
}), boolean(), { auth: "admin" }), method(object({
|
|
19814
20017
|
location: StorageLocationSchema,
|
|
19815
20018
|
prefix: string().optional()
|
|
19816
|
-
}), array(string()).readonly()), method(object({
|
|
20019
|
+
}), array(string()).readonly(), { auth: "admin" }), method(object({
|
|
19817
20020
|
location: StorageLocationSchema,
|
|
19818
20021
|
relativePath: string()
|
|
19819
|
-
}), _void(), {
|
|
20022
|
+
}), _void(), {
|
|
20023
|
+
kind: "mutation",
|
|
20024
|
+
auth: "admin"
|
|
20025
|
+
}), method(object({ location: StorageLocationSchema }), number().nullable(), { auth: "admin" }), method(BeginUploadInputSchema, BeginUploadResultSchema, {
|
|
20026
|
+
kind: "mutation",
|
|
20027
|
+
auth: "admin"
|
|
20028
|
+
}), method(WriteChunkInputSchema, _void(), {
|
|
20029
|
+
kind: "mutation",
|
|
20030
|
+
auth: "admin"
|
|
20031
|
+
}), method(FinalizeUploadInputSchema, _void(), {
|
|
20032
|
+
kind: "mutation",
|
|
20033
|
+
auth: "admin"
|
|
20034
|
+
}), method(AbortUploadInputSchema, _void(), {
|
|
20035
|
+
kind: "mutation",
|
|
20036
|
+
auth: "admin"
|
|
20037
|
+
}), method(BeginDownloadInputSchema, BeginDownloadResultSchema, {
|
|
20038
|
+
kind: "mutation",
|
|
20039
|
+
auth: "admin"
|
|
20040
|
+
}), method(ReadChunkInputSchema, _instanceof(Uint8Array), { auth: "admin" }), method(EndDownloadInputSchema, _void(), {
|
|
20041
|
+
kind: "mutation",
|
|
20042
|
+
auth: "admin"
|
|
20043
|
+
});
|
|
19820
20044
|
/** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
|
|
19821
20045
|
var ProfileSettingsSchemaBridge = unknown().nullable();
|
|
19822
20046
|
var ProfileSettingsBagSchema = record(string(), unknown());
|
|
@@ -20074,7 +20298,8 @@ method(object({
|
|
|
20074
20298
|
access: "create"
|
|
20075
20299
|
}), method(object({ userId: string().optional() }), object({ optionsJSON: record(string(), unknown()) }), {
|
|
20076
20300
|
kind: "mutation",
|
|
20077
|
-
access: "view"
|
|
20301
|
+
access: "view",
|
|
20302
|
+
auth: "admin"
|
|
20078
20303
|
}), method(object({
|
|
20079
20304
|
/** Required — the user the assertion belongs to (verified). */
|
|
20080
20305
|
userId: string(),
|
|
@@ -20082,10 +20307,12 @@ method(object({
|
|
|
20082
20307
|
response: record(string(), unknown())
|
|
20083
20308
|
}), object({ verified: boolean() }), {
|
|
20084
20309
|
kind: "mutation",
|
|
20085
|
-
access: "view"
|
|
20310
|
+
access: "view",
|
|
20311
|
+
auth: "admin"
|
|
20086
20312
|
}), method(object({}), object({ optionsJSON: record(string(), unknown()) }), {
|
|
20087
20313
|
kind: "mutation",
|
|
20088
|
-
access: "view"
|
|
20314
|
+
access: "view",
|
|
20315
|
+
auth: "admin"
|
|
20089
20316
|
}), method(object({
|
|
20090
20317
|
/** AuthenticationResponseJSON from the browser. */
|
|
20091
20318
|
response: record(string(), unknown()) }), object({
|
|
@@ -20093,7 +20320,8 @@ response: record(string(), unknown()) }), object({
|
|
|
20093
20320
|
userId: string().nullable()
|
|
20094
20321
|
}), {
|
|
20095
20322
|
kind: "mutation",
|
|
20096
|
-
access: "view"
|
|
20323
|
+
access: "view",
|
|
20324
|
+
auth: "admin"
|
|
20097
20325
|
}), method(object({ userId: string() }), array(PasskeySummarySchema), { auth: "admin" }), method(object({
|
|
20098
20326
|
userId: string(),
|
|
20099
20327
|
credentialId: string()
|
|
@@ -20265,7 +20493,19 @@ var VectorStatsResultSchema = object({
|
|
|
20265
20493
|
/** False when the backend ranks approximately. */
|
|
20266
20494
|
exact: boolean()
|
|
20267
20495
|
});
|
|
20268
|
-
method(VectorDeclareIndexInputSchema, _void(), {
|
|
20496
|
+
method(VectorDeclareIndexInputSchema, _void(), {
|
|
20497
|
+
kind: "mutation",
|
|
20498
|
+
auth: "admin"
|
|
20499
|
+
}), method(VectorUpsertInputSchema, VectorUpsertResultSchema, {
|
|
20500
|
+
kind: "mutation",
|
|
20501
|
+
auth: "admin"
|
|
20502
|
+
}), method(VectorQueryInputSchema, VectorQueryResultSchema, { auth: "admin" }), method(VectorGetInputSchema, VectorGetResultSchema, { auth: "admin" }), method(VectorDeleteInputSchema, VectorDeleteResultSchema, {
|
|
20503
|
+
kind: "mutation",
|
|
20504
|
+
auth: "admin"
|
|
20505
|
+
}), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, {
|
|
20506
|
+
kind: "mutation",
|
|
20507
|
+
auth: "admin"
|
|
20508
|
+
}), method(VectorStatsInputSchema, VectorStatsResultSchema, { auth: "admin" });
|
|
20269
20509
|
var ClipSchema = object({
|
|
20270
20510
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20271
20511
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -21988,7 +22228,27 @@ var MediaFileLiteSchema$1 = object({
|
|
|
21988
22228
|
sizeBytes: number(),
|
|
21989
22229
|
timestamp: number()
|
|
21990
22230
|
});
|
|
21991
|
-
method(
|
|
22231
|
+
method(object({
|
|
22232
|
+
/**
|
|
22233
|
+
* Inline {@link IdentitySchema.coverBase64} on every row.
|
|
22234
|
+
*
|
|
22235
|
+
* Default `false`, the same inversion `listRecentFaces` and
|
|
22236
|
+
* `listPlates` took on 2026-08-25 (see `include-crops-default.ts` for
|
|
22237
|
+
* why the burden belongs on the caller that WANTS the bytes). Measured
|
|
22238
|
+
* on the live hub the same day: four identities cost 40,979 B with the
|
|
22239
|
+
* covers inline, ~10 KB of base64 per row, on a query this UI mounts
|
|
22240
|
+
* four times and the viewer holds at `staleTime: 30_000`.
|
|
22241
|
+
*
|
|
22242
|
+
* Nothing loses its avatar: `coverMediaKey` is already on every row and
|
|
22243
|
+
* the `event-media` plane serves that key `immutable` with an ETag.
|
|
22244
|
+
*
|
|
22245
|
+
* **This is an INPUT field, so it does not reach the addon until the
|
|
22246
|
+
* next train** — the hub router validates cap inputs against its own
|
|
22247
|
+
* compiled Zod and strips a key it does not know. Until then the
|
|
22248
|
+
* provider sees `undefined`, which resolves to `false`: the cheap shape
|
|
22249
|
+
* is what ships, and the opt-in becomes reachable when the train lands.
|
|
22250
|
+
*/
|
|
22251
|
+
includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly()), method(object({ name: string().min(1) }), IdentitySchema, {
|
|
21992
22252
|
kind: "mutation",
|
|
21993
22253
|
auth: "admin"
|
|
21994
22254
|
}), method(object({
|
|
@@ -24135,8 +24395,10 @@ var PlateInfoSchema = object({
|
|
|
24135
24395
|
keyFrameMediaKey: string().optional(),
|
|
24136
24396
|
base64: string().optional(),
|
|
24137
24397
|
/**
|
|
24138
|
-
* Same crop as a data-plane URL
|
|
24139
|
-
* never inlines JPEG; `listPlates`
|
|
24398
|
+
* Same crop as a data-plane URL, always present when the plate has a stored
|
|
24399
|
+
* crop. `getPlateByTrack` returns this and never inlines JPEG; `listPlates`
|
|
24400
|
+
* and `searchPlates` inline the crop only when their `includeCrops` input is
|
|
24401
|
+
* left at its `true` default.
|
|
24140
24402
|
*/
|
|
24141
24403
|
cropUrl: string().optional()
|
|
24142
24404
|
});
|
|
@@ -24156,14 +24418,34 @@ var PlateClusterSchema = object({
|
|
|
24156
24418
|
});
|
|
24157
24419
|
method(object({
|
|
24158
24420
|
deviceId: number().int().optional(),
|
|
24159
|
-
limit: number().int().positive().optional()
|
|
24421
|
+
limit: number().int().positive().optional(),
|
|
24422
|
+
/**
|
|
24423
|
+
* Inline the base64 crop on every row. Default `true` — the existing
|
|
24424
|
+
* behaviour, kept so no caller breaks.
|
|
24425
|
+
*
|
|
24426
|
+
* Set `false` once the caller renders {@link PlateInfo.cropUrl}.
|
|
24427
|
+
* Measured on the live hub at the 500 rows the Plates view asks for:
|
|
24428
|
+
* 879,403 B and 27.7 s with the crops inline, against a few KiB of
|
|
24429
|
+
* metadata without them — and the browser then caches the images.
|
|
24430
|
+
*
|
|
24431
|
+
* This is the plate twin of `faceGallery.listRecentFaces`'s option;
|
|
24432
|
+
* plates were the one gallery list left without it.
|
|
24433
|
+
*
|
|
24434
|
+
* **This is an INPUT field, so it does not reach the addon until the
|
|
24435
|
+
* next train.** The hub router validates cap inputs against its own
|
|
24436
|
+
* compiled Zod and strips a key it does not know. Until the train
|
|
24437
|
+
* ships, sending `false` is harmless and keeps the crops inline.
|
|
24438
|
+
*/
|
|
24439
|
+
includeCrops: boolean().optional()
|
|
24160
24440
|
}).optional(), array(PlateInfoSchema).readonly()), method(object({
|
|
24161
24441
|
deviceId: number().int(),
|
|
24162
24442
|
trackId: string()
|
|
24163
24443
|
}), PlateInfoSchema.nullable()), method(object({ plateId: string() }), array(MediaFileLiteSchema).readonly()), method(object({
|
|
24164
24444
|
text: string().min(1),
|
|
24165
24445
|
maxDistance: number().int().min(0).optional(),
|
|
24166
|
-
limit: number().int().positive().optional()
|
|
24446
|
+
limit: number().int().positive().optional(),
|
|
24447
|
+
/** See `listPlates.includeCrops`. Default `true`. */
|
|
24448
|
+
includeCrops: boolean().optional()
|
|
24167
24449
|
}), array(PlateInfoSchema).readonly()), method(object({
|
|
24168
24450
|
maxDistance: number().int().min(0).optional(),
|
|
24169
24451
|
minClusterSize: number().int().min(2).optional(),
|
|
@@ -24177,7 +24459,13 @@ method(object({
|
|
|
24177
24459
|
}), method(object({ plateId: string() }), _void(), {
|
|
24178
24460
|
kind: "mutation",
|
|
24179
24461
|
auth: "admin"
|
|
24180
|
-
}), method(
|
|
24462
|
+
}), method(object({
|
|
24463
|
+
/** Inline {@link VehicleSchema.coverBase64} on every row. Default
|
|
24464
|
+
* `false` — the vehicle twin of `faceGallery.listIdentities`'s
|
|
24465
|
+
* option; `coverMediaKey` + the `event-media` plane carry the picture.
|
|
24466
|
+
* INPUT field: stripped by the hub router until the train ships, which
|
|
24467
|
+
* resolves to `false` and is exactly the intended default. */
|
|
24468
|
+
includeCrops: boolean().optional() }).optional(), array(VehicleSchema).readonly()), method(object({ name: string().min(1) }), VehicleSchema, {
|
|
24181
24469
|
kind: "mutation",
|
|
24182
24470
|
auth: "admin"
|
|
24183
24471
|
}), method(object({
|
|
@@ -25442,92 +25730,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSche
|
|
|
25442
25730
|
kind: "mutation",
|
|
25443
25731
|
auth: "admin"
|
|
25444
25732
|
});
|
|
25445
|
-
/**
|
|
25446
|
-
* Per-stage gating mode applied to the zones a rule references.
|
|
25447
|
-
*
|
|
25448
|
-
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
25449
|
-
* When at least one `include` rule fires for a stage, only entities
|
|
25450
|
-
* inside one of those zones pass that stage.
|
|
25451
|
-
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
25452
|
-
* Entities inside one of those zones are dropped at that stage.
|
|
25453
|
-
*
|
|
25454
|
-
* `monitor`-style observation (count without filtering) is not a rule
|
|
25455
|
-
* mode — zones without any matching rule are observed naturally by
|
|
25456
|
-
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
25457
|
-
* count, not filter" use case needs no rule at all.
|
|
25458
|
-
*/
|
|
25459
|
-
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
25460
|
-
/**
|
|
25461
|
-
* Per-consumer rule that references existing zones (geometry) and
|
|
25462
|
-
* defines how a specific pipeline stage should treat them. Each
|
|
25463
|
-
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
25464
|
-
* settings:
|
|
25465
|
-
*
|
|
25466
|
-
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
25467
|
-
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
25468
|
-
* - future: notification rules, audio gating, etc.
|
|
25469
|
-
*
|
|
25470
|
-
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
25471
|
-
* express "ignore motion in ALL of {garden, street}" with a single
|
|
25472
|
-
* rule. `classFilter` narrows the rule to specific object classes —
|
|
25473
|
-
* "drop person detections in the street, but keep cars" is one
|
|
25474
|
-
* `exclude` rule with `classFilter: ['person']`.
|
|
25475
|
-
*
|
|
25476
|
-
* `enabled` is a soft toggle — the operator can keep the rule
|
|
25477
|
-
* configured but inert without deleting it.
|
|
25478
|
-
*/
|
|
25479
|
-
var ZoneRuleSchema = object({
|
|
25480
|
-
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
25481
|
-
id: string(),
|
|
25482
|
-
/** Optional human-readable label rendered in the rule editor. */
|
|
25483
|
-
name: string().optional(),
|
|
25484
|
-
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
25485
|
-
* listed zones (OR-set: a detection in any one of them counts).
|
|
25486
|
-
* At least one zone id required — a rule with no targets is a
|
|
25487
|
-
* configuration mistake and the form validator rejects it. */
|
|
25488
|
-
zoneIds: array(string()).min(1).readonly(),
|
|
25489
|
-
mode: ZoneRuleModeEnum,
|
|
25490
|
-
/**
|
|
25491
|
-
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
25492
|
-
* applies to every class. Class strings match the `macroClass`
|
|
25493
|
-
* field on detections (e.g. `person`, `car`, `dog`).
|
|
25494
|
-
*/
|
|
25495
|
-
classFilter: array(string()).readonly().optional(),
|
|
25496
|
-
/**
|
|
25497
|
-
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
25498
|
-
* required to consider an entity "in the zone". Defaults to the
|
|
25499
|
-
* consumer's stage default when omitted. Kept for back-compat with
|
|
25500
|
-
* existing per-rule overrides; new operators pick the value via
|
|
25501
|
-
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
25502
|
-
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
25503
|
-
*/
|
|
25504
|
-
overlapThreshold: number().min(0).max(1).optional(),
|
|
25505
|
-
/**
|
|
25506
|
-
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
25507
|
-
* of the detection's bbox that must lie inside the zone for the
|
|
25508
|
-
* rule to match. Documented default is 85%; the engine substitutes
|
|
25509
|
-
* that when the field is omitted (kept optional so existing rules
|
|
25510
|
-
* stored without it stay valid).
|
|
25511
|
-
*
|
|
25512
|
-
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
25513
|
-
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
25514
|
-
* field exposed in the UI. Internally both feed the same gate.
|
|
25515
|
-
*/
|
|
25516
|
-
bboxInclusionPct: number().min(0).max(100).optional(),
|
|
25517
|
-
/**
|
|
25518
|
-
* When `true` and a detection has a segmentation mask, use the
|
|
25519
|
-
* mask for overlap instead of the bbox. Detection-stage only;
|
|
25520
|
-
* motion rules ignore this field.
|
|
25521
|
-
*/
|
|
25522
|
-
preferMask: boolean().optional(),
|
|
25523
|
-
/**
|
|
25524
|
-
* Soft-toggle: `false` disables the rule without deleting it.
|
|
25525
|
-
* Defaults to `true` so operators creating a rule via the UI
|
|
25526
|
-
* see it active immediately.
|
|
25527
|
-
*/
|
|
25528
|
-
enabled: boolean().default(true)
|
|
25529
|
-
});
|
|
25530
|
-
array(ZoneRuleSchema).readonly();
|
|
25531
25733
|
object({
|
|
25532
25734
|
/** Whether the script is currently executing. */
|
|
25533
25735
|
isRunning: boolean(),
|
|
@@ -29554,6 +29756,12 @@ Object.freeze({
|
|
|
29554
29756
|
addonId: null,
|
|
29555
29757
|
access: "create"
|
|
29556
29758
|
},
|
|
29759
|
+
"pipelineAnalytics.cancelRelocateMedia": {
|
|
29760
|
+
capName: "pipeline-analytics",
|
|
29761
|
+
capScope: "device",
|
|
29762
|
+
addonId: null,
|
|
29763
|
+
access: "create"
|
|
29764
|
+
},
|
|
29557
29765
|
"pipelineAnalytics.cancelStorageMigrationMove": {
|
|
29558
29766
|
capName: "pipeline-analytics",
|
|
29559
29767
|
capScope: "device",
|
|
@@ -29728,6 +29936,12 @@ Object.freeze({
|
|
|
29728
29936
|
addonId: null,
|
|
29729
29937
|
access: "view"
|
|
29730
29938
|
},
|
|
29939
|
+
"pipelineAnalytics.listRelocateMediaJobs": {
|
|
29940
|
+
capName: "pipeline-analytics",
|
|
29941
|
+
capScope: "device",
|
|
29942
|
+
addonId: null,
|
|
29943
|
+
access: "view"
|
|
29944
|
+
},
|
|
29731
29945
|
"pipelineAnalytics.listRetrainAnnotations": {
|
|
29732
29946
|
capName: "pipeline-analytics",
|
|
29733
29947
|
capScope: "device",
|
|
@@ -29806,6 +30020,12 @@ Object.freeze({
|
|
|
29806
30020
|
addonId: null,
|
|
29807
30021
|
access: "create"
|
|
29808
30022
|
},
|
|
30023
|
+
"pipelineAnalytics.relocateMedia": {
|
|
30024
|
+
capName: "pipeline-analytics",
|
|
30025
|
+
capScope: "device",
|
|
30026
|
+
addonId: null,
|
|
30027
|
+
access: "create"
|
|
30028
|
+
},
|
|
29809
30029
|
"pipelineAnalytics.restageRetrainTrack": {
|
|
29810
30030
|
capName: "pipeline-analytics",
|
|
29811
30031
|
capScope: "device",
|
|
@@ -29818,6 +30038,12 @@ Object.freeze({
|
|
|
29818
30038
|
addonId: null,
|
|
29819
30039
|
access: "create"
|
|
29820
30040
|
},
|
|
30041
|
+
"pipelineAnalytics.runReplayFrameProcessor": {
|
|
30042
|
+
capName: "pipeline-analytics",
|
|
30043
|
+
capScope: "device",
|
|
30044
|
+
addonId: null,
|
|
30045
|
+
access: "create"
|
|
30046
|
+
},
|
|
29821
30047
|
"pipelineAnalytics.saveRetrainAnnotations": {
|
|
29822
30048
|
capName: "pipeline-analytics",
|
|
29823
30049
|
capScope: "device",
|
|
@@ -29950,6 +30176,12 @@ Object.freeze({
|
|
|
29950
30176
|
addonId: null,
|
|
29951
30177
|
access: "view"
|
|
29952
30178
|
},
|
|
30179
|
+
"pipelineExecutor.getInferenceDeviceHealth": {
|
|
30180
|
+
capName: "pipeline-executor",
|
|
30181
|
+
capScope: "system",
|
|
30182
|
+
addonId: null,
|
|
30183
|
+
access: "view"
|
|
30184
|
+
},
|
|
29953
30185
|
"pipelineExecutor.getOrchestratorConfigSchema": {
|
|
29954
30186
|
capName: "pipeline-executor",
|
|
29955
30187
|
capScope: "system",
|
|
@@ -30022,6 +30254,12 @@ Object.freeze({
|
|
|
30022
30254
|
addonId: null,
|
|
30023
30255
|
access: "view"
|
|
30024
30256
|
},
|
|
30257
|
+
"pipelineExecutor.rearmInferenceDevice": {
|
|
30258
|
+
capName: "pipeline-executor",
|
|
30259
|
+
capScope: "system",
|
|
30260
|
+
addonId: null,
|
|
30261
|
+
access: "create"
|
|
30262
|
+
},
|
|
30025
30263
|
"pipelineExecutor.runAudioTest": {
|
|
30026
30264
|
capName: "pipeline-executor",
|
|
30027
30265
|
capScope: "system",
|
|
@@ -33270,6 +33508,11 @@ Object.freeze({
|
|
|
33270
33508
|
form: "single",
|
|
33271
33509
|
optional: false
|
|
33272
33510
|
}],
|
|
33511
|
+
"pipelineAnalytics.runReplayFrameProcessor": [{
|
|
33512
|
+
name: "deviceId",
|
|
33513
|
+
form: "single",
|
|
33514
|
+
optional: false
|
|
33515
|
+
}],
|
|
33273
33516
|
"pipelineAnalytics.saveRetrainAnnotations": [{
|
|
33274
33517
|
name: "deviceId",
|
|
33275
33518
|
form: "single",
|