@camstack/addon-ai 0.4.22 → 0.4.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +1585 -1437
- package/dist/addon.mjs +1585 -1437
- package/package.json +1 -1
package/dist/addon.mjs
CHANGED
|
@@ -15806,7 +15806,23 @@ var NcHistoryEntrySchema = object({
|
|
|
15806
15806
|
updatedAt: number$1(),
|
|
15807
15807
|
/** Failure detail — present on a `dead` row. */
|
|
15808
15808
|
error: string().optional(),
|
|
15809
|
-
subject: NcHistorySubjectSchema
|
|
15809
|
+
subject: NcHistorySubjectSchema,
|
|
15810
|
+
/**
|
|
15811
|
+
* Ids of the artefacts (still, then gif, then clip) this row's successful
|
|
15812
|
+
* delivery indexed in the artefact library — a REFERENCE, never the bytes
|
|
15813
|
+
* (an artefact is often megabytes; this row is durable JSON rewritten on
|
|
15814
|
+
* every delivery attempt). Absent on a row still pending/dead, a row
|
|
15815
|
+
* delivered before this field shipped, or a wiring with no artefact index.
|
|
15816
|
+
*
|
|
15817
|
+
* Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
|
|
15818
|
+
* outlives any one URL's TTL, so a caller mints a fresh link on demand
|
|
15819
|
+
* rather than trusting one frozen at delivery time. `resolveArtifactUrl`
|
|
15820
|
+
* also answers `null` for an id whose artefact has since expired past the
|
|
15821
|
+
* retained shelf's own age bound — the degrade a caller (the Home
|
|
15822
|
+
* Assistant export) must render as "no image right now", never as a
|
|
15823
|
+
* broken link.
|
|
15824
|
+
*/
|
|
15825
|
+
artifactIds: array(string().min(1)).optional()
|
|
15810
15826
|
});
|
|
15811
15827
|
/**
|
|
15812
15828
|
* Query filter for `getHistory` (spec §4.2). Every field is a narrowing
|
|
@@ -16033,7 +16049,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
16033
16049
|
}), method(object({}), object({
|
|
16034
16050
|
catalog: array(NcConditionDescriptorSchema),
|
|
16035
16051
|
taxonomy: NcTaxonomySchema.optional()
|
|
16036
|
-
})), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
|
|
16052
|
+
})), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
|
|
16037
16053
|
kind: "mutation",
|
|
16038
16054
|
caller: "required"
|
|
16039
16055
|
}), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
|
|
@@ -16373,896 +16389,1496 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
16373
16389
|
});
|
|
16374
16390
|
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
16375
16391
|
/**
|
|
16376
|
-
*
|
|
16377
|
-
*
|
|
16378
|
-
*
|
|
16379
|
-
* persisted media. Owns the post-detection domain end-to-end:
|
|
16380
|
-
*
|
|
16381
|
-
* runner emits PipelineInferenceResult
|
|
16382
|
-
* ↓ (event bus)
|
|
16383
|
-
* pipeline-analytics subscriber
|
|
16384
|
-
* ↓ SORT tracker + zone engine + state analyzer + event emitter
|
|
16385
|
-
* → three DB collections (one per kind), one FS media tree, one
|
|
16386
|
-
* unified event emitter (FrameTracked + TrackStarted/Ended +
|
|
16387
|
-
* DetectionEvent on bus)
|
|
16388
|
-
*
|
|
16389
|
-
* Pure subscriber model. No `processFrame` cap method — the runner
|
|
16390
|
-
* already publishes the raw frame on the bus. The cap surface is
|
|
16391
|
-
* only QUERIES + per-device settings, bound on/off via
|
|
16392
|
-
* `device-manager.setWrapperActive`. `defaultActive: true` because
|
|
16393
|
-
* every camera with a detection pipeline wants its raw detections
|
|
16394
|
-
* refined; operators opt out per-device via BindingsTab when needed.
|
|
16395
|
-
*
|
|
16396
|
-
* Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
|
|
16397
|
-
* (per-device surface) and `track-trail` caps — see P11 cleanup.
|
|
16392
|
+
* Reference to the frame's retained NATIVE surface + the parent crop's placement
|
|
16393
|
+
* within the frame, so the executor can re-cut a leaf child ROI at native
|
|
16394
|
+
* resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
|
|
16398
16395
|
*/
|
|
16399
|
-
var
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
|
|
16404
|
-
|
|
16405
|
-
|
|
16406
|
-
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
|
|
16410
|
-
|
|
16396
|
+
var NativeCropRefSchema = object({
|
|
16397
|
+
/** Handle keying the retained native surface (node-pinned to its owner). */
|
|
16398
|
+
handle: FrameHandleSchema,
|
|
16399
|
+
/** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
|
|
16400
|
+
cropFrameSpace: object({
|
|
16401
|
+
x: number$1(),
|
|
16402
|
+
y: number$1(),
|
|
16403
|
+
w: number$1(),
|
|
16404
|
+
h: number$1()
|
|
16405
|
+
})
|
|
16406
|
+
});
|
|
16407
|
+
object({
|
|
16408
|
+
crop: object({
|
|
16409
|
+
left: number$1(),
|
|
16410
|
+
top: number$1(),
|
|
16411
|
+
width: number$1().positive(),
|
|
16412
|
+
height: number$1().positive()
|
|
16413
|
+
}).optional(),
|
|
16414
|
+
content: object({
|
|
16415
|
+
width: number$1().int().positive(),
|
|
16416
|
+
height: number$1().int().positive()
|
|
16417
|
+
}),
|
|
16418
|
+
fit: _enum(["stretch", "contain"]),
|
|
16419
|
+
format: _enum([
|
|
16420
|
+
"rgb",
|
|
16421
|
+
"gray",
|
|
16422
|
+
"jpeg"
|
|
16423
|
+
])
|
|
16424
|
+
});
|
|
16411
16425
|
/**
|
|
16412
|
-
*
|
|
16413
|
-
*
|
|
16414
|
-
*
|
|
16426
|
+
* Process-local frame identity. It is serializable so it can ride an in-process
|
|
16427
|
+
* capability call, but `registryId` deliberately prevents resolution in any
|
|
16428
|
+
* other process or execution group.
|
|
16415
16429
|
*/
|
|
16416
|
-
var
|
|
16417
|
-
|
|
16418
|
-
|
|
16419
|
-
|
|
16420
|
-
|
|
16421
|
-
"
|
|
16422
|
-
|
|
16423
|
-
|
|
16424
|
-
|
|
16425
|
-
|
|
16426
|
-
"
|
|
16427
|
-
"
|
|
16428
|
-
"
|
|
16429
|
-
"
|
|
16430
|
-
"
|
|
16430
|
+
var FrameRefSchema = object({
|
|
16431
|
+
registryId: string().min(1),
|
|
16432
|
+
id: string().min(1),
|
|
16433
|
+
width: number$1().int().positive(),
|
|
16434
|
+
height: number$1().int().positive(),
|
|
16435
|
+
format: _enum(["rgb", "gray"]),
|
|
16436
|
+
timestamp: number$1(),
|
|
16437
|
+
capturedAt: number$1().optional()
|
|
16438
|
+
});
|
|
16439
|
+
var ModelFormatSchema$1 = _enum([
|
|
16440
|
+
"onnx",
|
|
16441
|
+
"coreml",
|
|
16442
|
+
"openvino",
|
|
16443
|
+
"tflite",
|
|
16444
|
+
"pt",
|
|
16445
|
+
"gguf"
|
|
16431
16446
|
]);
|
|
16432
|
-
var
|
|
16433
|
-
"
|
|
16434
|
-
"
|
|
16435
|
-
"
|
|
16436
|
-
"
|
|
16437
|
-
"
|
|
16438
|
-
"custom",
|
|
16439
|
-
"package"
|
|
16447
|
+
var PipelineSlotSchema = _enum([
|
|
16448
|
+
"detector",
|
|
16449
|
+
"cropper",
|
|
16450
|
+
"classifier",
|
|
16451
|
+
"refiner",
|
|
16452
|
+
"audio-classifier"
|
|
16440
16453
|
]);
|
|
16441
|
-
|
|
16442
|
-
|
|
16443
|
-
|
|
16444
|
-
|
|
16445
|
-
|
|
16446
|
-
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
16447
|
-
labelKey: string(),
|
|
16448
|
-
/** English fallback label (kept for clients that don't translate). */
|
|
16449
|
-
label: string(),
|
|
16450
|
-
/** Hex color for timeline/legend rendering. */
|
|
16451
|
-
color: string(),
|
|
16452
|
-
/** Dictionary id → lucide component on the UI side. */
|
|
16453
|
-
iconId: string(),
|
|
16454
|
-
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
16455
|
-
icon: EventKindIconSchema,
|
|
16456
|
-
category: EventKindCategorySchema,
|
|
16457
|
-
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
16458
|
-
parentKind: string().nullable(),
|
|
16459
|
-
/** Derived from `parentKind`, explicit for the client tree. */
|
|
16460
|
-
level: EventKindLevelSchema,
|
|
16461
|
-
/** Which cap + device contributes this kind. For built-ins the camera
|
|
16462
|
-
* itself; for sensor kinds the LINKED source device. */
|
|
16463
|
-
source: object({
|
|
16464
|
-
capName: string(),
|
|
16465
|
-
deviceId: number$1()
|
|
16466
|
-
})
|
|
16454
|
+
var PipelineEngineChoiceSchema = object({
|
|
16455
|
+
runtime: _enum(["node", "python"]),
|
|
16456
|
+
backend: string(),
|
|
16457
|
+
format: ModelFormatSchema$1,
|
|
16458
|
+
device: string().optional()
|
|
16467
16459
|
});
|
|
16468
|
-
|
|
16469
|
-
|
|
16470
|
-
|
|
16471
|
-
|
|
16460
|
+
var AvailableEngineSchema = object({
|
|
16461
|
+
engine: PipelineEngineChoiceSchema,
|
|
16462
|
+
devices: array(object({
|
|
16463
|
+
id: string(),
|
|
16464
|
+
label: string(),
|
|
16465
|
+
description: string().optional()
|
|
16466
|
+
})).readonly(),
|
|
16467
|
+
defaultDevice: string()
|
|
16472
16468
|
});
|
|
16473
|
-
var
|
|
16469
|
+
var PipelineDefaultStepSchema = lazy(() => object({
|
|
16470
|
+
addonId: string(),
|
|
16471
|
+
addonName: string(),
|
|
16472
|
+
slot: PipelineSlotSchema,
|
|
16473
|
+
inputClasses: array(string()).readonly(),
|
|
16474
|
+
outputClasses: array(string()).readonly(),
|
|
16475
|
+
enabled: boolean(),
|
|
16476
|
+
modelId: string(),
|
|
16477
|
+
children: array(PipelineDefaultStepSchema).readonly(),
|
|
16478
|
+
group: string().optional(),
|
|
16479
|
+
settings: record(string(), unknown()).optional()
|
|
16480
|
+
}));
|
|
16481
|
+
var PipelineTemplateStepSchema = lazy(() => object({
|
|
16482
|
+
addonId: string(),
|
|
16483
|
+
enabled: boolean(),
|
|
16484
|
+
modelId: string(),
|
|
16485
|
+
children: array(PipelineTemplateStepSchema).readonly(),
|
|
16486
|
+
settings: record(string(), unknown()).optional()
|
|
16487
|
+
}));
|
|
16488
|
+
var PipelineTemplateSchema$1 = object({
|
|
16474
16489
|
id: string(),
|
|
16475
|
-
|
|
16476
|
-
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
|
|
16480
|
-
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
16481
|
-
kind: string(),
|
|
16482
|
-
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
16483
|
-
value: record(string(), unknown()).nullable(),
|
|
16484
|
-
timestamp: number$1()
|
|
16490
|
+
name: string(),
|
|
16491
|
+
createdAt: string(),
|
|
16492
|
+
updatedAt: string(),
|
|
16493
|
+
engine: PipelineEngineChoiceSchema,
|
|
16494
|
+
steps: array(PipelineTemplateStepSchema).readonly()
|
|
16485
16495
|
});
|
|
16486
|
-
var
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16496
|
+
var PipelineModelOptionSchema = object({
|
|
16497
|
+
id: string(),
|
|
16498
|
+
name: string(),
|
|
16499
|
+
formats: record(string(), object({
|
|
16500
|
+
downloaded: boolean(),
|
|
16501
|
+
sizeMB: number$1()
|
|
16502
|
+
})),
|
|
16503
|
+
group: ModelVariantGroupSchema.optional(),
|
|
16504
|
+
legacy: boolean().optional(),
|
|
16505
|
+
provider: ModelProviderIdSchema.optional()
|
|
16491
16506
|
});
|
|
16492
|
-
var
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16507
|
+
var ConfigFieldBridge = custom();
|
|
16508
|
+
var PipelineAddonSchemaSchema = object({
|
|
16509
|
+
id: string(),
|
|
16510
|
+
name: string(),
|
|
16511
|
+
slot: PipelineSlotSchema,
|
|
16512
|
+
inputClasses: array(string()).readonly(),
|
|
16513
|
+
outputClasses: array(string()).readonly(),
|
|
16514
|
+
childSlots: array(PipelineSlotSchema).readonly(),
|
|
16515
|
+
models: array(PipelineModelOptionSchema).readonly(),
|
|
16516
|
+
defaultModelId: string(),
|
|
16517
|
+
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
16518
|
+
enabledByDefault: boolean().optional(),
|
|
16519
|
+
backfillIntoExistingOverrides: boolean().optional(),
|
|
16520
|
+
defaultConfidence: number$1(),
|
|
16521
|
+
group: string().optional(),
|
|
16522
|
+
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
16497
16523
|
});
|
|
16498
|
-
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
var TrackEnvelopeSchema = object({
|
|
16505
|
-
minX: number$1(),
|
|
16506
|
-
minY: number$1(),
|
|
16507
|
-
maxX: number$1(),
|
|
16508
|
-
maxY: number$1()
|
|
16524
|
+
var PipelineSlotSchemaSchema = object({
|
|
16525
|
+
id: PipelineSlotSchema,
|
|
16526
|
+
label: string(),
|
|
16527
|
+
priority: number$1(),
|
|
16528
|
+
parentSlot: PipelineSlotSchema.nullable(),
|
|
16529
|
+
addons: array(PipelineAddonSchemaSchema).readonly()
|
|
16509
16530
|
});
|
|
16510
|
-
|
|
16511
|
-
|
|
16512
|
-
|
|
16513
|
-
|
|
16514
|
-
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
16515
|
-
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
16516
|
-
* zonesVisited, bestEventId, envelope, hasFace, hasEmbeddedFace, hasRider) and returns `positions` /
|
|
16517
|
-
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
16518
|
-
* `getTrack`. Mirrors the event-store `projection` convention
|
|
16519
|
-
* (`getObjectEvents` et al.).
|
|
16520
|
-
*/
|
|
16521
|
-
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
16522
|
-
/**
|
|
16523
|
-
* One audio-classification label heard on the track's camera while the
|
|
16524
|
-
* track was alive, aggregated per label. An "episode" is one persisted
|
|
16525
|
-
* audio event (the confident-classification path: score ≥ the device's
|
|
16526
|
-
* `classificationMinScore`, class-change-or-heartbeat coalesced) — NOT
|
|
16527
|
-
* one 32 ms inference chunk, so counts stay human-scaled.
|
|
16528
|
-
*/
|
|
16529
|
-
var TrackAudioLabelSchema = object({
|
|
16530
|
-
label: string(),
|
|
16531
|
-
/** Highest classification score observed across the label's episodes. */
|
|
16532
|
-
peakScore: number$1(),
|
|
16533
|
-
/** Number of coalesced audio-event episodes carrying this label. */
|
|
16534
|
-
count: number$1(),
|
|
16535
|
-
firstAt: number$1(),
|
|
16536
|
-
lastAt: number$1()
|
|
16531
|
+
var PipelineSchemaSchema = object({
|
|
16532
|
+
availableEngines: array(AvailableEngineSchema).readonly(),
|
|
16533
|
+
selectedEngine: PipelineEngineChoiceSchema,
|
|
16534
|
+
slots: array(PipelineSlotSchemaSchema).readonly()
|
|
16537
16535
|
});
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16548
|
-
|
|
16549
|
-
|
|
16550
|
-
|
|
16551
|
-
|
|
16552
|
-
|
|
16553
|
-
|
|
16554
|
-
|
|
16555
|
-
|
|
16556
|
-
|
|
16557
|
-
|
|
16558
|
-
*
|
|
16559
|
-
*
|
|
16560
|
-
*
|
|
16561
|
-
*
|
|
16562
|
-
*
|
|
16563
|
-
|
|
16564
|
-
|
|
16565
|
-
* - `trained` — the retrain page has taken what it needed. The frames it chose
|
|
16566
|
-
* were COPIED into the retrain dataset at selection time, so the dataset no
|
|
16567
|
-
* longer depends on the track's media and the track becomes EVICTABLE again.
|
|
16568
|
-
* Terminal for the plain `markForTrain` toggle: returning it to `staging` is
|
|
16569
|
-
* a deliberate action of the retrain page, not a side effect of a checkbox.
|
|
16570
|
-
*
|
|
16571
|
-
* There is no `null`. The state is stored `TEXT NOT NULL DEFAULT 'none'` because
|
|
16572
|
-
* the store's filter language has only positive equality and `whereIn` — no
|
|
16573
|
-
* negation, no IS NULL — so a NULL would be unselectable by ANY predicate and
|
|
16574
|
-
* would make the entire pre-column history immortal in one deploy.
|
|
16575
|
-
*/
|
|
16576
|
-
var RetrainStatusSchema = _enum([
|
|
16577
|
-
"none",
|
|
16578
|
-
"staging",
|
|
16579
|
-
"trained"
|
|
16580
|
-
]);
|
|
16581
|
-
/**
|
|
16582
|
-
* Per-track OPERATOR flags — set by hand from the admin UI or the viewer, never
|
|
16583
|
-
* by the pipeline. Spread into `TrackSchema` and `KeyEventSchema` from one place
|
|
16584
|
-
* so the two surfaces cannot drift.
|
|
16585
|
-
*
|
|
16586
|
-
* **Absent ≠ false.** A track that has never been touched omits the field; an
|
|
16587
|
-
* explicitly un-flagged track carries `false`. Legacy rows written before the
|
|
16588
|
-
* columns existed read as absent, and a consumer that needs a boolean should say
|
|
16589
|
-
* `flag === true`, not `flag !== false`.
|
|
16590
|
-
*
|
|
16591
|
-
* `markForTrain` is the WIRE FACE of {@link RetrainStatusSchema}, not a column:
|
|
16592
|
-
* it is exactly `retrainStatus === 'staging'`, in both directions. Writing
|
|
16593
|
-
* `true` moves `none → staging`, writing `false` moves `staging → none`, and a
|
|
16594
|
-
* `trained` track reports `false` while refusing both writes. The boolean is
|
|
16595
|
-
* kept because three surfaces drive a toggle off it; anything that needs to tell
|
|
16596
|
-
* "never marked" from "already trained" must read `retrainStatus`.
|
|
16597
|
-
*
|
|
16598
|
-
* `debug` does NOT pin; it is attention, not durability.
|
|
16599
|
-
*
|
|
16600
|
-
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
16601
|
-
* A favourited track is skipped by retention the same way `staging` is, but
|
|
16602
|
-
* it does not enter `none|staging|trained` and has no staging budget.
|
|
16603
|
-
*/
|
|
16604
|
-
var TrackFlagFields = {
|
|
16605
|
-
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
16606
|
-
* `'staging'`. */
|
|
16607
|
-
markForTrain: boolean().optional(),
|
|
16608
|
-
/** Operator marked this track for diagnostic attention. */
|
|
16609
|
-
debug: boolean().optional(),
|
|
16610
|
-
/** Operator favourited this track. Pins it against pruning. */
|
|
16611
|
-
favourited: boolean().optional()
|
|
16612
|
-
};
|
|
16613
|
-
/**
|
|
16614
|
-
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
16615
|
-
* Deliberately NOT part of {@link TrackFlagFields}: that group also builds the
|
|
16616
|
-
* write patch, and the status is not something the toggle sets — it is what the
|
|
16617
|
-
* toggle's boolean is derived from. Absent on an in-RAM track never touched;
|
|
16618
|
-
* always present on a persisted row (the column default materialises `'none'`).
|
|
16619
|
-
*/
|
|
16620
|
-
var TrackRetrainFields = { retrainStatus: RetrainStatusSchema.optional() };
|
|
16621
|
-
/**
|
|
16622
|
-
* The write half: a PARTIAL patch. An omitted key is left untouched, so setting
|
|
16623
|
-
* one flag can never clear the other — the toggles are independent and are
|
|
16624
|
-
* driven from three surfaces that do not know about each other.
|
|
16625
|
-
*/
|
|
16626
|
-
var TrackFlagsPatchSchema = object(TrackFlagFields);
|
|
16627
|
-
/**
|
|
16628
|
-
* The resolved flag state after a write. Both fields are REQUIRED here (absent
|
|
16629
|
-
* collapses to `false`) so a caller can drive a toggle's checked state off the
|
|
16630
|
-
* mutation result without a re-fetch.
|
|
16631
|
-
*/
|
|
16632
|
-
var TrackFlagsSchema = object({
|
|
16633
|
-
trackId: string(),
|
|
16634
|
-
markForTrain: boolean(),
|
|
16635
|
-
debug: boolean(),
|
|
16636
|
-
favourited: boolean(),
|
|
16637
|
-
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
16638
|
-
* a track row) because this shape is only ever produced by the write body,
|
|
16639
|
-
* which always knows it — and a surface that has just written needs to render
|
|
16640
|
-
* `trained` without a re-fetch. */
|
|
16641
|
-
retrainStatus: RetrainStatusSchema
|
|
16536
|
+
var EngineProvisioningSchema = object({
|
|
16537
|
+
runtimeId: _enum([
|
|
16538
|
+
"onnx",
|
|
16539
|
+
"openvino",
|
|
16540
|
+
"coreml",
|
|
16541
|
+
"edgetpu"
|
|
16542
|
+
]).nullable(),
|
|
16543
|
+
device: string().nullable(),
|
|
16544
|
+
state: _enum([
|
|
16545
|
+
"idle",
|
|
16546
|
+
"installing",
|
|
16547
|
+
"verifying",
|
|
16548
|
+
"ready",
|
|
16549
|
+
"failed"
|
|
16550
|
+
]),
|
|
16551
|
+
progress: number$1().optional(),
|
|
16552
|
+
error: string().optional(),
|
|
16553
|
+
nextRetryAt: number$1().optional(),
|
|
16554
|
+
/**
|
|
16555
|
+
* Gate A (config-correctness gate at engine change): human-readable
|
|
16556
|
+
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
16557
|
+
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
16558
|
+
* has a <format> build"). Additive/optional: informational only, never
|
|
16559
|
+
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
16560
|
+
* Absent/empty when the node-default tree resolves cleanly.
|
|
16561
|
+
*/
|
|
16562
|
+
configIssues: array(string()).optional()
|
|
16642
16563
|
});
|
|
16643
|
-
|
|
16644
|
-
|
|
16645
|
-
* WHO decided a label, and when. Carried per tier so a value can be traced to
|
|
16646
|
-
* the step and model that produced it — which is what makes the write rule
|
|
16647
|
-
* arguable after the fact ("why is 592's label `dog` and not `Canis lupus`?")
|
|
16648
|
-
* and what lets a migrated, UNATTRIBUTED value be told apart from a real one.
|
|
16649
|
-
*
|
|
16650
|
-
* `stepId` is the pipeline step id (`animal-classifier`, `bird-classifier`,
|
|
16651
|
-
* `plate-ocr`, `face-embedding`, `object-detection`), or the sentinel
|
|
16652
|
-
* `migration:4g` for a value the 4g migration moved from the single-slot era —
|
|
16653
|
-
* that value has no provenance, and the write rule lets ANY properly-attributed
|
|
16654
|
-
* write of the same tier replace it regardless of score.
|
|
16655
|
-
*/
|
|
16656
|
-
var LabelAttributionSchema = object({
|
|
16657
|
-
stepId: string(),
|
|
16564
|
+
var PipelineStepInputSchema = lazy(() => object({
|
|
16565
|
+
addonId: string(),
|
|
16658
16566
|
modelId: string().optional(),
|
|
16659
|
-
|
|
16567
|
+
enabled: boolean().default(true),
|
|
16568
|
+
children: array(PipelineStepInputSchema).optional(),
|
|
16569
|
+
settings: record(string(), unknown()).optional(),
|
|
16570
|
+
jumpDeviceKey: string().optional()
|
|
16571
|
+
}));
|
|
16572
|
+
var ModelSubstitutionSchema = object({
|
|
16573
|
+
addonId: string(),
|
|
16574
|
+
chosen: string(),
|
|
16575
|
+
running: string(),
|
|
16576
|
+
format: string()
|
|
16577
|
+
});
|
|
16578
|
+
var PipelineValidationIssueSchema = object({
|
|
16579
|
+
addonId: string(),
|
|
16580
|
+
kind: _enum(["unknown-addon", "no-format-build"]),
|
|
16581
|
+
detail: string()
|
|
16582
|
+
});
|
|
16583
|
+
var PipelineValidationResultSchema = object({
|
|
16584
|
+
ok: boolean(),
|
|
16585
|
+
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
16586
|
+
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
16587
|
+
/** The node's `currentEngine.format` this validation ran against. */
|
|
16588
|
+
format: string()
|
|
16589
|
+
});
|
|
16590
|
+
var ReferenceImageEntrySchema = object({
|
|
16591
|
+
filename: string(),
|
|
16592
|
+
stepIds: array(string()).readonly().optional()
|
|
16593
|
+
});
|
|
16594
|
+
var ReferenceImageBodySchema = object({
|
|
16595
|
+
base64: string(),
|
|
16596
|
+
filename: string()
|
|
16597
|
+
});
|
|
16598
|
+
var ReferenceAudioEntrySchema = object({
|
|
16599
|
+
filename: string(),
|
|
16600
|
+
sizeKb: number$1()
|
|
16601
|
+
});
|
|
16602
|
+
var ReferenceAudioBodySchema = object({ base64: string() });
|
|
16603
|
+
var AudioBackendSchema = object({
|
|
16604
|
+
id: string(),
|
|
16605
|
+
name: string(),
|
|
16606
|
+
description: string(),
|
|
16607
|
+
available: boolean(),
|
|
16660
16608
|
/**
|
|
16661
|
-
*
|
|
16662
|
-
*
|
|
16663
|
-
*
|
|
16664
|
-
*
|
|
16665
|
-
* notification rule authored on "Gianluca" stopped matching the moment the
|
|
16666
|
-
* operator fixed the spelling in the gallery, and nothing said so. The id is
|
|
16667
|
-
* the thing that does not move, so it is what a rule matches on
|
|
16668
|
-
* (`NcConditions.identities`) and the text is what a human is shown.
|
|
16669
|
-
*
|
|
16670
|
-
* Absent when the label names no gallery row — a plate the OCR read but no
|
|
16671
|
-
* vehicle claims, a sub-class, a species, any tier-1 value.
|
|
16609
|
+
* Raw classifier labels this backend can emit (e.g. YAMNet's
|
|
16610
|
+
* 521-class set or Apple SoundAnalysis's 303-class set). Used by
|
|
16611
|
+
* the benchmark UI to populate the `enabledMicroClasses` filter
|
|
16612
|
+
* specific to the selected backend without a separate fetch.
|
|
16672
16613
|
*/
|
|
16673
|
-
|
|
16614
|
+
rawLabels: array(string()).readonly().optional()
|
|
16615
|
+
});
|
|
16616
|
+
var AudioCapabilitiesSchema = object({
|
|
16617
|
+
activeBackend: string(),
|
|
16618
|
+
availableBackends: array(AudioBackendSchema).readonly(),
|
|
16619
|
+
sampleRate: number$1(),
|
|
16620
|
+
chunkDurationMs: number$1()
|
|
16621
|
+
});
|
|
16622
|
+
var DownloadModelResultSchema = object({
|
|
16623
|
+
filePath: string(),
|
|
16624
|
+
sizeMB: number$1(),
|
|
16625
|
+
durationMs: number$1()
|
|
16674
16626
|
});
|
|
16675
16627
|
/**
|
|
16676
|
-
*
|
|
16677
|
-
* `
|
|
16678
|
-
*
|
|
16679
|
-
*
|
|
16680
|
-
*
|
|
16681
|
-
*
|
|
16682
|
-
*
|
|
16683
|
-
*
|
|
16684
|
-
* **Reading it.** What a human should be shown is `subLabel ?? label` — the
|
|
16685
|
-
* finest thing known. Before 4g the single `label` column held the finest
|
|
16686
|
-
* value, so a consumer that has not been updated reads the tier-1 slot and
|
|
16687
|
-
* shows nothing on a species-only row; that is why the migration puts every
|
|
16688
|
-
* pre-4g value in tier 2 (it cannot regress a display that reads the fallback)
|
|
16689
|
-
* and why the read surfaces were changed in the same train.
|
|
16690
|
-
*
|
|
16691
|
-
* **Writing it.** The slots are independent, which is the whole point: a
|
|
16692
|
-
* tier-1 write (`bird`) can never overwrite a tier-2 value (`Turdus
|
|
16693
|
-
* migratorius`), so fineness cannot regress by construction. Within a tier the
|
|
16694
|
-
* higher score wins. One rule, one implementation — see
|
|
16695
|
-
* `pipeline/label-tier.ts` in addon-post-analysis.
|
|
16696
|
-
*/
|
|
16697
|
-
var TieredLabelFields = {
|
|
16698
|
-
/** Tier 1 — the sub-class. See {@link LabelTierSchema}. */
|
|
16699
|
-
label: string().optional(),
|
|
16700
|
-
/** Confidence of the tier-1 value, as reported by the deciding step. */
|
|
16701
|
-
labelScore: number$1().optional(),
|
|
16702
|
-
/** Provenance of the tier-1 value. See {@link LabelAttributionSchema}. */
|
|
16703
|
-
labelMeta: LabelAttributionSchema.optional(),
|
|
16704
|
-
/** Tier 2 — the instance. See {@link LabelTierSchema}. */
|
|
16705
|
-
subLabel: string().optional(),
|
|
16706
|
-
/** Confidence of the tier-2 value, as reported by the deciding step. */
|
|
16707
|
-
subLabelScore: number$1().optional(),
|
|
16708
|
-
/** Provenance of the tier-2 value. See {@link LabelAttributionSchema}. */
|
|
16709
|
-
subLabelMeta: LabelAttributionSchema.optional()
|
|
16710
|
-
};
|
|
16711
|
-
/** Per-camera slice of a training-export estimate. */
|
|
16712
|
-
var TrainingExportDeviceTotalsSchema = object({
|
|
16713
|
-
deviceId: number$1(),
|
|
16714
|
-
tracks: number$1().int(),
|
|
16715
|
-
files: number$1().int(),
|
|
16716
|
-
bytes: number$1().int()
|
|
16717
|
-
});
|
|
16718
|
-
/**
|
|
16719
|
-
* What a training export WOULD contain. Computed from media index rows only —
|
|
16720
|
-
* no blob is read to produce this.
|
|
16628
|
+
* Wrapper carrying a single test run's result. Replaces the legacy
|
|
16629
|
+
* ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
|
|
16630
|
+
* canonical `AudioResult` from the Phase 6 output rework: one
|
|
16631
|
+
* `AudioDetection` per class above `minScore`, top-N candidates in
|
|
16632
|
+
* `debug.alternateLabels['audio-classifier']`, per-source timings in
|
|
16633
|
+
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
16634
|
+
* benchmark UI can still report a clean failure when the classifier
|
|
16635
|
+
* cap isn't available.
|
|
16721
16636
|
*/
|
|
16722
|
-
var
|
|
16723
|
-
|
|
16724
|
-
|
|
16725
|
-
|
|
16726
|
-
byteCount: number$1().int(),
|
|
16727
|
-
/** More marked tracks exist than a single pass carries. */
|
|
16728
|
-
truncated: boolean(),
|
|
16729
|
-
devices: array(TrainingExportDeviceTotalsSchema).readonly()
|
|
16637
|
+
var AudioTestResultSchema = object({
|
|
16638
|
+
success: boolean(),
|
|
16639
|
+
error: string().optional(),
|
|
16640
|
+
frame: custom().optional()
|
|
16730
16641
|
});
|
|
16731
|
-
var
|
|
16732
|
-
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
|
|
16736
|
-
|
|
16737
|
-
|
|
16738
|
-
|
|
16739
|
-
|
|
16740
|
-
|
|
16741
|
-
|
|
16742
|
-
|
|
16743
|
-
|
|
16744
|
-
|
|
16745
|
-
|
|
16746
|
-
|
|
16747
|
-
|
|
16642
|
+
var PipelineConfigBridge = custom();
|
|
16643
|
+
var ConfigUISchemaBridge = custom();
|
|
16644
|
+
var ConfigUISchemaNullableBridge = custom();
|
|
16645
|
+
var InferenceCapabilitiesBridge = custom();
|
|
16646
|
+
var ModelAvailabilityListBridge = custom();
|
|
16647
|
+
var PipelineRunResultBridge = custom();
|
|
16648
|
+
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
16649
|
+
modelId: string(),
|
|
16650
|
+
settings: record(string(), unknown()).readonly()
|
|
16651
|
+
}))), method(object({ steps: record(string(), object({
|
|
16652
|
+
modelId: string(),
|
|
16653
|
+
settings: record(string(), unknown()).readonly()
|
|
16654
|
+
})) }), object({ success: literal(true) }), {
|
|
16655
|
+
kind: "mutation",
|
|
16656
|
+
auth: "admin"
|
|
16657
|
+
}), method(object({ nodeId: string() }), object({
|
|
16658
|
+
success: literal(true),
|
|
16659
|
+
clearedDevices: number$1()
|
|
16660
|
+
}), {
|
|
16661
|
+
kind: "mutation",
|
|
16662
|
+
auth: "admin"
|
|
16663
|
+
}), method(object({ nodeId: string() }), object({ unhealthy: array(object({
|
|
16664
|
+
/** `<backend>:<device>`, e.g. `openvino:gpu`. */
|
|
16665
|
+
deviceKey: string(),
|
|
16748
16666
|
/**
|
|
16749
|
-
*
|
|
16750
|
-
*
|
|
16751
|
-
*
|
|
16752
|
-
*
|
|
16753
|
-
* and no card can render — so every free-text search surface was structurally
|
|
16754
|
-
* unable to answer "show me the tracks in Uscio", and did not fail loudly, it
|
|
16755
|
-
* just returned nothing. Resolving here rather than in each client keeps ONE
|
|
16756
|
-
* derivation and costs the clients no extra call (the `zones` cap is
|
|
16757
|
-
* per-device, so a client-side resolve would be a per-camera fan-out on a
|
|
16758
|
-
* surface built to avoid exactly that).
|
|
16759
|
-
*
|
|
16760
|
-
* Resolved, never invented: a zone deleted since the track was written has no
|
|
16761
|
-
* name and is DROPPED, so this array can be shorter than `zonesVisited` — the
|
|
16762
|
-
* two are not positionally aligned. Absent when the track visited no zone, or
|
|
16763
|
-
* when the zone catalogue could not be read.
|
|
16667
|
+
* `failed` — the per-device restart budget is exhausted; no pool
|
|
16668
|
+
* will be spawned until an operator re-arms it or the runner
|
|
16669
|
+
* respawns. `backoff` — under budget, waiting out the backoff (or
|
|
16670
|
+
* a cached pool observed dead and not yet condemned).
|
|
16764
16671
|
*/
|
|
16765
|
-
|
|
16766
|
-
/**
|
|
16767
|
-
|
|
16768
|
-
|
|
16769
|
-
|
|
16770
|
-
/**
|
|
16771
|
-
|
|
16772
|
-
|
|
16773
|
-
|
|
16774
|
-
|
|
16775
|
-
|
|
16776
|
-
|
|
16777
|
-
|
|
16778
|
-
|
|
16779
|
-
|
|
16780
|
-
|
|
16781
|
-
|
|
16782
|
-
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
|
|
16786
|
-
|
|
16787
|
-
|
|
16788
|
-
|
|
16789
|
-
|
|
16790
|
-
|
|
16791
|
-
|
|
16672
|
+
state: _enum(["failed", "backoff"]),
|
|
16673
|
+
/** Epoch ms of the death that produced this state. */
|
|
16674
|
+
since: number$1(),
|
|
16675
|
+
/** Pool deaths inside the current window. */
|
|
16676
|
+
deaths: number$1(),
|
|
16677
|
+
/** The last death's message. */
|
|
16678
|
+
lastError: string()
|
|
16679
|
+
})).readonly() })), method(object({
|
|
16680
|
+
nodeId: string(),
|
|
16681
|
+
deviceKey: string()
|
|
16682
|
+
}), object({ rearmed: boolean() }), {
|
|
16683
|
+
kind: "mutation",
|
|
16684
|
+
auth: "admin"
|
|
16685
|
+
}), 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({
|
|
16686
|
+
name: string(),
|
|
16687
|
+
steps: array(PipelineTemplateStepSchema).readonly(),
|
|
16688
|
+
engine: PipelineEngineChoiceSchema
|
|
16689
|
+
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
|
|
16690
|
+
id: string(),
|
|
16691
|
+
name: string().optional(),
|
|
16692
|
+
steps: array(PipelineTemplateStepSchema).readonly().optional()
|
|
16693
|
+
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
|
|
16694
|
+
addonId: string(),
|
|
16695
|
+
modelId: string(),
|
|
16696
|
+
format: ModelFormatSchema$1
|
|
16697
|
+
}), DownloadModelResultSchema, { kind: "mutation" }), method(object({
|
|
16698
|
+
addonId: string(),
|
|
16699
|
+
modelId: string(),
|
|
16700
|
+
format: ModelFormatSchema$1
|
|
16701
|
+
}), object({ success: literal(true) }), { kind: "mutation" }), method(object({
|
|
16702
|
+
engine: PipelineEngineChoiceSchema.optional(),
|
|
16703
|
+
steps: array(PipelineStepInputSchema).min(1),
|
|
16704
|
+
frame: FrameInputSchema.optional(),
|
|
16792
16705
|
/**
|
|
16793
|
-
*
|
|
16794
|
-
*
|
|
16795
|
-
*
|
|
16796
|
-
* enabled. Set once and never cleared.
|
|
16797
|
-
*
|
|
16798
|
-
* **This exists so "face present but not recognised" is expressible.** A
|
|
16799
|
-
* recognised identity lands in `subLabel` (attributed to the face chain via
|
|
16800
|
-
* `subLabelMeta.stepId`), so before this field a track with an unmatched face
|
|
16801
|
-
* and a track with no face at all were byte-identical on the wire and no
|
|
16802
|
-
* surface could tell them apart. The read is `hasFace === true && subLabel
|
|
16803
|
-
* === undefined`.
|
|
16804
|
-
*
|
|
16805
|
-
* **Absent ≠ false.** Every row written before the column existed omits it,
|
|
16806
|
-
* and so does every server that predates the field — a consumer must test
|
|
16807
|
-
* `=== true` and render nothing otherwise, never infer "no face".
|
|
16706
|
+
* Process-local lazy frame. Valid only when caller and provider resolve
|
|
16707
|
+
* in the same execution-group process; split/cross-node callers use
|
|
16708
|
+
* `frame`/`image` inline compatibility instead.
|
|
16808
16709
|
*/
|
|
16809
|
-
|
|
16710
|
+
frameRef: FrameRefSchema.optional(),
|
|
16810
16711
|
/**
|
|
16811
|
-
*
|
|
16812
|
-
*
|
|
16813
|
-
*
|
|
16814
|
-
* The STRICT twin of {@link hasFace}, and the pair only earns its keep
|
|
16815
|
-
* because the two disagree. `hasFace` is stamped at the TOP of the face
|
|
16816
|
-
* branch, before every gate, and means no more than "a face detector produced
|
|
16817
|
-
* a face detail". This one is stamped at the single moment the gallery row
|
|
16818
|
-
* LANDS — after `FaceRecognizer.onTrackEnd` successfully persists it, i.e.
|
|
16819
|
-
* past the embedding-magnitude verdict, the `minFacePx` detection gate, the
|
|
16820
|
-
* candidate gate, the imageless-track drop (no crop was ever captured) and
|
|
16821
|
-
* the crop-store drop. Everything between the detector and that insert can
|
|
16822
|
-
* legitimately refuse the face, so a flag written any earlier promises the
|
|
16823
|
-
* operator something to assign and delivers nothing.
|
|
16824
|
-
*
|
|
16825
|
-
* **Independent of recognition.** A face collected but never auto-matched is
|
|
16826
|
-
* still assignable — it is in fact the face an operator most wants to reach —
|
|
16827
|
-
* so this is NOT gated on `recognizedIdentityId`. Recognition lands in
|
|
16828
|
-
* `subLabel`; this says only that the raw material exists.
|
|
16829
|
-
*
|
|
16830
|
-
* **Set once, never cleared.** A track that produced a gallery row produced
|
|
16831
|
-
* one; deleting the row later is the gallery's business, not this flag's.
|
|
16832
|
-
*
|
|
16833
|
-
* **Absent ≠ false**, the same rule as {@link hasFace}: every row written
|
|
16834
|
-
* before the column omits it, and so does every server that predates the
|
|
16835
|
-
* field. A consumer must test `=== true` and render nothing otherwise —
|
|
16836
|
-
* never infer "no assignable face".
|
|
16712
|
+
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
16713
|
+
* the decoded pixels live in. One more member of the one-of
|
|
16714
|
+
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
16837
16715
|
*/
|
|
16838
|
-
|
|
16716
|
+
frameHandle: FrameHandleSchema.optional(),
|
|
16717
|
+
imageBase64: string().optional(),
|
|
16839
16718
|
/**
|
|
16840
|
-
*
|
|
16841
|
-
* (
|
|
16842
|
-
*
|
|
16843
|
-
*
|
|
16844
|
-
*
|
|
16845
|
-
* said "the person is not lost — it is reported so both entities stay on the
|
|
16846
|
-
* record"; in fact the pair went into a per-processor RAM field behind an
|
|
16847
|
-
* accessor nobody called, and every durable surface said `vehicle`, full
|
|
16848
|
-
* stop. This is the composition note that makes the row true.
|
|
16849
|
-
*
|
|
16850
|
-
* A COMPOSITION, never a class and never a label. "This vehicle contains a
|
|
16851
|
-
* person" is not an answer to "what is this" — both label tiers would refuse
|
|
16852
|
-
* a macro token anyway (D89), and correctly. Nothing here changes what the
|
|
16853
|
-
* subject IS: a cyclist stays one vehicle track, occupancy still counts one,
|
|
16854
|
-
* and a `person` rule still does not fire for someone cycling past.
|
|
16855
|
-
*
|
|
16856
|
-
* **Absent ≠ false**, exactly like {@link hasFace}: every row written before
|
|
16857
|
-
* the column, and every hub that predates the field, omits it. Test
|
|
16858
|
-
* `=== true` and render nothing otherwise — never infer "no rider".
|
|
16719
|
+
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
16720
|
+
* hops (hub → forked worker via Moleculer MsgPack) because it
|
|
16721
|
+
* skips the 33% base64 overhead + the per-call base64 decode on
|
|
16722
|
+
* the detection-pipeline worker. Callers can pass either; exactly
|
|
16723
|
+
* one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
|
|
16859
16724
|
*/
|
|
16860
|
-
|
|
16861
|
-
|
|
16862
|
-
|
|
16863
|
-
|
|
16864
|
-
|
|
16865
|
-
|
|
16866
|
-
|
|
16867
|
-
|
|
16868
|
-
|
|
16869
|
-
|
|
16870
|
-
|
|
16871
|
-
|
|
16872
|
-
|
|
16873
|
-
|
|
16874
|
-
|
|
16875
|
-
|
|
16876
|
-
|
|
16877
|
-
|
|
16878
|
-
|
|
16879
|
-
/**
|
|
16880
|
-
|
|
16881
|
-
|
|
16882
|
-
|
|
16883
|
-
|
|
16884
|
-
|
|
16885
|
-
|
|
16725
|
+
image: _instanceof(Uint8Array).optional(),
|
|
16726
|
+
referenceImage: string().optional(),
|
|
16727
|
+
deviceId: number$1().optional(),
|
|
16728
|
+
sessionId: string().optional(),
|
|
16729
|
+
/**
|
|
16730
|
+
* Execution plane. 'full' (default) runs the whole tree — benchmark,
|
|
16731
|
+
* reference-image, and detail-subtree calls. 'frame' is the live
|
|
16732
|
+
* per-frame dispatch: ONLY root-plane steps run; crop children
|
|
16733
|
+
* (inputClasses ≠ null) are skipped and served per-track via
|
|
16734
|
+
* pipelineRunner.runDetailSubtree (two-plane design).
|
|
16735
|
+
*/
|
|
16736
|
+
plane: _enum(["full", "frame"]).optional(),
|
|
16737
|
+
/**
|
|
16738
|
+
* Inference-device selector (Phase 2 multi-device). Format
|
|
16739
|
+
* `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
|
|
16740
|
+
* Omitted ⇒ the runner's default device (current single-engine
|
|
16741
|
+
* behaviour). Selects WHICH device pool of the node runs the call.
|
|
16742
|
+
*/
|
|
16743
|
+
deviceKey: string().optional(),
|
|
16744
|
+
/**
|
|
16745
|
+
* Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
|
|
16746
|
+
* when the parent crop was resolved from the frame's retained NATIVE
|
|
16747
|
+
* surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
|
|
16748
|
+
* child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
|
|
16749
|
+
* resolution from that surface — the SAME quality path faces already
|
|
16750
|
+
* had — instead of the downscaled parent tile. `handle` keys the native
|
|
16751
|
+
* surface (node-pinned to its owner); `cropFrameSpace` is the parent
|
|
16752
|
+
* crop's padded/clamped rectangle in FRAME-space pixels, used to compose
|
|
16753
|
+
* the executor's crop-normalized child ROI back into frame-normalized
|
|
16754
|
+
* coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
|
|
16755
|
+
* of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
|
|
16756
|
+
* (today's behaviour on the fallback path).
|
|
16757
|
+
*/
|
|
16758
|
+
nativeCropRef: NativeCropRefSchema.optional()
|
|
16759
|
+
}), PipelineRunResultBridge, { kind: "mutation" }), method(object({
|
|
16760
|
+
engine: PipelineEngineChoiceSchema.optional(),
|
|
16761
|
+
steps: array(PipelineStepInputSchema).min(1),
|
|
16762
|
+
frames: array(FrameInputSchema).min(1).max(255),
|
|
16763
|
+
deviceId: number$1().optional(),
|
|
16764
|
+
sessionId: string().optional(),
|
|
16765
|
+
/**
|
|
16766
|
+
* Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
|
|
16767
|
+
* the batch to the Python pool's bench preprocess cache
|
|
16768
|
+
* (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
|
|
16769
|
+
* preprocessed ONCE and every later inference is a pure-inference cache
|
|
16770
|
+
* hit — the sustained-throughput run measures inference, not
|
|
16771
|
+
* decode+preprocess+infer. Omitted/0 for live frames (all different →
|
|
16772
|
+
* full preprocess every call, correct). Fresh per sustained run;
|
|
16773
|
+
* released via `uncacheFrame`.
|
|
16774
|
+
*/
|
|
16775
|
+
frameId: number$1().int().nonnegative().optional(),
|
|
16776
|
+
/** Inference-device selector (Phase 2 multi-device); see runPipeline. */
|
|
16777
|
+
deviceKey: string().optional()
|
|
16778
|
+
}), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
|
|
16779
|
+
data: _instanceof(Uint8Array),
|
|
16780
|
+
width: number$1().int().positive(),
|
|
16781
|
+
height: number$1().int().positive(),
|
|
16782
|
+
format: _enum([
|
|
16783
|
+
"rgb",
|
|
16784
|
+
"bgr",
|
|
16785
|
+
"gray"
|
|
16786
|
+
])
|
|
16787
|
+
}), object({
|
|
16788
|
+
frameId: number$1(),
|
|
16789
|
+
width: number$1(),
|
|
16790
|
+
height: number$1()
|
|
16791
|
+
}), { kind: "mutation" }), method(object({
|
|
16792
|
+
stepId: string(),
|
|
16793
|
+
frameId: number$1().int()
|
|
16794
|
+
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number$1().int() }), _void(), { kind: "mutation" }), method(_void(), object({
|
|
16795
|
+
batchMode: string(),
|
|
16796
|
+
windowMs: number$1(),
|
|
16797
|
+
maxBatchSize: number$1(),
|
|
16798
|
+
concurrency: number$1()
|
|
16799
|
+
})), method(_void(), array(object({
|
|
16800
|
+
engineKey: string(),
|
|
16801
|
+
engine: PipelineEngineChoiceSchema,
|
|
16802
|
+
modelsLoaded: array(string()).readonly(),
|
|
16803
|
+
inUseByCameras: array(number$1()).readonly(),
|
|
16804
|
+
/**
|
|
16805
|
+
* Origin of this resident factory.
|
|
16806
|
+
* - `runtime` — main camera-serving engine (no idle TTL).
|
|
16807
|
+
* - `warm-override` — benchmark/test override held in the warm
|
|
16808
|
+
* cache; auto-disposed after the idle TTL.
|
|
16809
|
+
* - `device-pool` — a concurrent per-device pool (Phase 2
|
|
16810
|
+
* multi-device, keyed by `deviceKey`) resolved
|
|
16811
|
+
* via `resolveDeviceFactory`. Runs alongside the
|
|
16812
|
+
* `runtime` engine on a DIFFERENT accelerator
|
|
16813
|
+
* (NPU / iGPU / Coral) — this is how the
|
|
16814
|
+
* Engines tab shows all pools running at once.
|
|
16815
|
+
*/
|
|
16816
|
+
kind: _enum([
|
|
16817
|
+
"runtime",
|
|
16818
|
+
"warm-override",
|
|
16819
|
+
"device-pool"
|
|
16820
|
+
]),
|
|
16821
|
+
/** Native pid of the underlying Python pool (null when no pool). */
|
|
16822
|
+
poolPid: number$1().nullable(),
|
|
16823
|
+
/** ms since this factory was last used (null when not warm-tracked). */
|
|
16824
|
+
idleMs: number$1().nullable(),
|
|
16825
|
+
/** Idle TTL after which `warm-override` factories self-evict (null when not applicable). */
|
|
16826
|
+
idleTtlMs: number$1().nullable()
|
|
16827
|
+
})).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
|
|
16828
|
+
kind: "mutation",
|
|
16829
|
+
auth: "admin"
|
|
16830
|
+
}), method(object({
|
|
16831
|
+
engine: PipelineEngineChoiceSchema,
|
|
16832
|
+
force: boolean().optional()
|
|
16833
|
+
}), object({
|
|
16834
|
+
success: boolean(),
|
|
16835
|
+
reason: string().optional()
|
|
16836
|
+
}), {
|
|
16837
|
+
kind: "mutation",
|
|
16838
|
+
auth: "admin"
|
|
16839
|
+
}), 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({
|
|
16840
|
+
addonId: string(),
|
|
16841
|
+
modelId: string(),
|
|
16842
|
+
filename: string().optional(),
|
|
16843
|
+
settings: record(string(), unknown()).optional()
|
|
16844
|
+
}), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
|
|
16886
16845
|
/**
|
|
16887
|
-
*
|
|
16888
|
-
*
|
|
16889
|
-
*
|
|
16890
|
-
*
|
|
16891
|
-
*
|
|
16892
|
-
*
|
|
16846
|
+
* Per-stage gating mode applied to the zones a rule references.
|
|
16847
|
+
*
|
|
16848
|
+
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
16849
|
+
* When at least one `include` rule fires for a stage, only entities
|
|
16850
|
+
* inside one of those zones pass that stage.
|
|
16851
|
+
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
16852
|
+
* Entities inside one of those zones are dropped at that stage.
|
|
16853
|
+
*
|
|
16854
|
+
* `monitor`-style observation (count without filtering) is not a rule
|
|
16855
|
+
* mode — zones without any matching rule are observed naturally by
|
|
16856
|
+
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
16857
|
+
* count, not filter" use case needs no rule at all.
|
|
16893
16858
|
*/
|
|
16894
|
-
var
|
|
16859
|
+
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
16895
16860
|
/**
|
|
16896
|
-
*
|
|
16897
|
-
*
|
|
16898
|
-
*
|
|
16899
|
-
*
|
|
16900
|
-
* on them.
|
|
16861
|
+
* Per-consumer rule that references existing zones (geometry) and
|
|
16862
|
+
* defines how a specific pipeline stage should treat them. Each
|
|
16863
|
+
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
16864
|
+
* settings:
|
|
16901
16865
|
*
|
|
16902
|
-
*
|
|
16903
|
-
*
|
|
16904
|
-
*
|
|
16866
|
+
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
16867
|
+
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
16868
|
+
* - future: notification rules, audio gating, etc.
|
|
16905
16869
|
*
|
|
16906
|
-
*
|
|
16907
|
-
*
|
|
16908
|
-
*
|
|
16909
|
-
* the
|
|
16870
|
+
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
16871
|
+
* express "ignore motion in ALL of {garden, street}" with a single
|
|
16872
|
+
* rule. `classFilter` narrows the rule to specific object classes —
|
|
16873
|
+
* "drop person detections in the street, but keep cars" is one
|
|
16874
|
+
* `exclude` rule with `classFilter: ['person']`.
|
|
16875
|
+
*
|
|
16876
|
+
* `enabled` is a soft toggle — the operator can keep the rule
|
|
16877
|
+
* configured but inert without deleting it.
|
|
16910
16878
|
*/
|
|
16911
|
-
var
|
|
16912
|
-
|
|
16913
|
-
|
|
16914
|
-
|
|
16915
|
-
|
|
16916
|
-
|
|
16917
|
-
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
|
|
16922
|
-
source: DetectionSourceSchema.optional(),
|
|
16879
|
+
var ZoneRuleSchema = object({
|
|
16880
|
+
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
16881
|
+
id: string(),
|
|
16882
|
+
/** Optional human-readable label rendered in the rule editor. */
|
|
16883
|
+
name: string().optional(),
|
|
16884
|
+
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
16885
|
+
* listed zones (OR-set: a detection in any one of them counts).
|
|
16886
|
+
* At least one zone id required — a rule with no targets is a
|
|
16887
|
+
* configuration mistake and the form validator rejects it. */
|
|
16888
|
+
zoneIds: array(string()).min(1).readonly(),
|
|
16889
|
+
mode: ZoneRuleModeEnum,
|
|
16923
16890
|
/**
|
|
16924
|
-
*
|
|
16925
|
-
*
|
|
16926
|
-
*
|
|
16927
|
-
* (group by `trackId`, pick a representative `frameId` as the parent frame).
|
|
16928
|
-
* Optional for backward-compat with pre-existing rows / the slim projection
|
|
16929
|
-
* includes it (it is light). Absent on rows written before this field.
|
|
16891
|
+
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
16892
|
+
* applies to every class. Class strings match the `macroClass`
|
|
16893
|
+
* field on detections (e.g. `person`, `car`, `dog`).
|
|
16930
16894
|
*/
|
|
16931
|
-
|
|
16932
|
-
/** Omitted in slim projection. */
|
|
16933
|
-
trackId: string().optional(),
|
|
16934
|
-
className: string(),
|
|
16935
|
-
...TieredLabelFields,
|
|
16936
|
-
/** Omitted in slim projection. */
|
|
16937
|
-
confidence: number$1().optional(),
|
|
16938
|
-
/** Heavy JSON — omitted in slim projection. */
|
|
16939
|
-
bbox: BoundingBoxSchema.optional(),
|
|
16940
|
-
/** Heavy JSON — omitted in slim projection. */
|
|
16941
|
-
zones: array(string()).readonly().optional(),
|
|
16942
|
-
/** Omitted in slim projection. */
|
|
16943
|
-
state: TrackStateSchema.optional(),
|
|
16895
|
+
classFilter: array(string()).readonly().optional(),
|
|
16944
16896
|
/**
|
|
16945
|
-
*
|
|
16946
|
-
*
|
|
16947
|
-
*
|
|
16897
|
+
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
16898
|
+
* required to consider an entity "in the zone". Defaults to the
|
|
16899
|
+
* consumer's stage default when omitted. Kept for back-compat with
|
|
16900
|
+
* existing per-rule overrides; new operators pick the value via
|
|
16901
|
+
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
16902
|
+
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
16948
16903
|
*/
|
|
16949
|
-
|
|
16950
|
-
/**
|
|
16951
|
-
*
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
*
|
|
16958
|
-
*
|
|
16959
|
-
*
|
|
16960
|
-
|
|
16961
|
-
|
|
16962
|
-
/**
|
|
16963
|
-
|
|
16964
|
-
|
|
16965
|
-
*
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
|
|
16970
|
-
|
|
16971
|
-
|
|
16972
|
-
|
|
16973
|
-
|
|
16974
|
-
classification: object({
|
|
16975
|
-
className: string(),
|
|
16976
|
-
originalClass: string().optional(),
|
|
16977
|
-
score: number$1()
|
|
16978
|
-
}).optional(),
|
|
16979
|
-
/** Populated by B5 (recording playback URL for this event). */
|
|
16980
|
-
mediaUrl: string().optional()
|
|
16981
|
-
});
|
|
16982
|
-
var MediaFileKindEnum = _enum([
|
|
16983
|
-
"crop",
|
|
16984
|
-
"thumbnail",
|
|
16985
|
-
"snapshot",
|
|
16986
|
-
"firstFrame",
|
|
16987
|
-
"lastFrame",
|
|
16988
|
-
"fullFrame",
|
|
16989
|
-
"fullFrameBoxed",
|
|
16990
|
-
"faceCrop",
|
|
16991
|
-
"plateCrop",
|
|
16992
|
-
"keyFrame",
|
|
16993
|
-
"keyFrameSmall",
|
|
16994
|
-
"thumbnailSmall"
|
|
16995
|
-
]);
|
|
16996
|
-
var MediaFileSchema = object({
|
|
16997
|
-
key: string(),
|
|
16998
|
-
kind: MediaFileKindEnum,
|
|
16999
|
-
base64: string(),
|
|
17000
|
-
sizeBytes: number$1(),
|
|
17001
|
-
timestamp: number$1()
|
|
16904
|
+
overlapThreshold: number$1().min(0).max(1).optional(),
|
|
16905
|
+
/**
|
|
16906
|
+
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
16907
|
+
* of the detection's bbox that must lie inside the zone for the
|
|
16908
|
+
* rule to match. Documented default is 85%; the engine substitutes
|
|
16909
|
+
* that when the field is omitted (kept optional so existing rules
|
|
16910
|
+
* stored without it stay valid).
|
|
16911
|
+
*
|
|
16912
|
+
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
16913
|
+
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
16914
|
+
* field exposed in the UI. Internally both feed the same gate.
|
|
16915
|
+
*/
|
|
16916
|
+
bboxInclusionPct: number$1().min(0).max(100).optional(),
|
|
16917
|
+
/**
|
|
16918
|
+
* When `true` and a detection has a segmentation mask, use the
|
|
16919
|
+
* mask for overlap instead of the bbox. Detection-stage only;
|
|
16920
|
+
* motion rules ignore this field.
|
|
16921
|
+
*/
|
|
16922
|
+
preferMask: boolean().optional(),
|
|
16923
|
+
/**
|
|
16924
|
+
* Soft-toggle: `false` disables the rule without deleting it.
|
|
16925
|
+
* Defaults to `true` so operators creating a rule via the UI
|
|
16926
|
+
* see it active immediately.
|
|
16927
|
+
*/
|
|
16928
|
+
enabled: boolean().default(true)
|
|
17002
16929
|
});
|
|
16930
|
+
array(ZoneRuleSchema).readonly();
|
|
17003
16931
|
/**
|
|
17004
|
-
*
|
|
16932
|
+
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
17005
16933
|
*
|
|
17006
|
-
*
|
|
17007
|
-
*
|
|
17008
|
-
*
|
|
17009
|
-
*
|
|
17010
|
-
*
|
|
16934
|
+
* Zones describe **where** in the frame the operator wants to flag
|
|
16935
|
+
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
16936
|
+
* each pipeline stage uses them. Splitting the two means a single
|
|
16937
|
+
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
16938
|
+
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
16939
|
+
* — without three duplicated polygons.
|
|
17011
16940
|
*
|
|
17012
|
-
*
|
|
17013
|
-
*
|
|
16941
|
+
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
16942
|
+
* `zones` device-state slice on every mutation. Consumers
|
|
16943
|
+
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
16944
|
+
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
16945
|
+
* mirror with `onChanged`).
|
|
16946
|
+
*
|
|
16947
|
+
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
16948
|
+
* survive resolution changes and stream profile switches.
|
|
16949
|
+
*
|
|
16950
|
+
* `kind` discriminates between full polygons (closed regions used
|
|
16951
|
+
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
16952
|
+
* line segments used for cross events). Onboard / firmware-reported
|
|
16953
|
+
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
16954
|
+
* task list.
|
|
17014
16955
|
*/
|
|
17015
|
-
var
|
|
16956
|
+
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
16957
|
+
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
16958
|
+
var PolygonPointSchema = object({
|
|
16959
|
+
x: number$1(),
|
|
16960
|
+
y: number$1()
|
|
16961
|
+
});
|
|
16962
|
+
/** A camera detection zone — pure geometry/identity. */
|
|
16963
|
+
var ZoneSchema = object({
|
|
16964
|
+
id: string(),
|
|
16965
|
+
name: string(),
|
|
16966
|
+
kind: ZoneKindEnum.default("polygon"),
|
|
16967
|
+
/** Polygon vertices, fraction of frame (0–1). */
|
|
16968
|
+
polygon: array(PolygonPointSchema).readonly(),
|
|
16969
|
+
/** Visual color for UI rendering. */
|
|
16970
|
+
color: string().default("#3b82f6")
|
|
16971
|
+
});
|
|
16972
|
+
DeviceType.Camera, method(object({ deviceId: number$1() }), array(ZoneSchema).readonly()), method(object({
|
|
16973
|
+
deviceId: number$1(),
|
|
16974
|
+
zone: ZoneSchema
|
|
16975
|
+
}), _void(), {
|
|
16976
|
+
kind: "mutation",
|
|
16977
|
+
auth: "admin"
|
|
16978
|
+
}), method(object({
|
|
16979
|
+
deviceId: number$1(),
|
|
16980
|
+
zoneId: string()
|
|
16981
|
+
}), _void(), {
|
|
16982
|
+
kind: "mutation",
|
|
16983
|
+
auth: "admin"
|
|
16984
|
+
}), method(object({
|
|
16985
|
+
deviceId: number$1(),
|
|
16986
|
+
zone: ZoneSchema
|
|
16987
|
+
}), _void(), {
|
|
16988
|
+
kind: "mutation",
|
|
16989
|
+
auth: "admin"
|
|
16990
|
+
}), object({ zones: array(ZoneSchema).readonly() });
|
|
17016
16991
|
/**
|
|
17017
|
-
*
|
|
16992
|
+
* pipeline-analytics — device-scoped wrapper cap. Refines raw
|
|
16993
|
+
* per-frame detections emitted by the pipeline runner into tracked
|
|
16994
|
+
* objects, per-kind event collections (motion / object / audio), and
|
|
16995
|
+
* persisted media. Owns the post-detection domain end-to-end:
|
|
17018
16996
|
*
|
|
17019
|
-
*
|
|
17020
|
-
*
|
|
17021
|
-
*
|
|
17022
|
-
*
|
|
16997
|
+
* runner emits PipelineInferenceResult
|
|
16998
|
+
* ↓ (event bus)
|
|
16999
|
+
* pipeline-analytics subscriber
|
|
17000
|
+
* ↓ SORT tracker + zone engine + state analyzer + event emitter
|
|
17001
|
+
* → three DB collections (one per kind), one FS media tree, one
|
|
17002
|
+
* unified event emitter (FrameTracked + TrackStarted/Ended +
|
|
17003
|
+
* DetectionEvent on bus)
|
|
17023
17004
|
*
|
|
17024
|
-
*
|
|
17025
|
-
*
|
|
17026
|
-
*
|
|
17027
|
-
*
|
|
17005
|
+
* Pure subscriber model. No `processFrame` cap method — the runner
|
|
17006
|
+
* already publishes the raw frame on the bus. The cap surface is
|
|
17007
|
+
* only QUERIES + per-device settings, bound on/off via
|
|
17008
|
+
* `device-manager.setWrapperActive`. `defaultActive: true` because
|
|
17009
|
+
* every camera with a detection pipeline wants its raw detections
|
|
17010
|
+
* refined; operators opt out per-device via BindingsTab when needed.
|
|
17011
|
+
*
|
|
17012
|
+
* Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
|
|
17013
|
+
* (per-device surface) and `track-trail` caps — see P11 cleanup.
|
|
17028
17014
|
*/
|
|
17029
|
-
var
|
|
17015
|
+
var TrackStateSchema = _enum([
|
|
17016
|
+
"new",
|
|
17017
|
+
"entered",
|
|
17018
|
+
"left",
|
|
17019
|
+
"moving",
|
|
17020
|
+
"idle"
|
|
17021
|
+
]);
|
|
17022
|
+
var EventKindSchema = _enum([
|
|
17023
|
+
"motion",
|
|
17024
|
+
"object",
|
|
17025
|
+
"audio"
|
|
17026
|
+
]);
|
|
17027
|
+
/**
|
|
17028
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
17029
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
17030
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
17031
|
+
*/
|
|
17032
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
17033
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
17034
|
+
var EventKindIconSchema = _enum([
|
|
17035
|
+
"motion",
|
|
17036
|
+
"audio",
|
|
17030
17037
|
"person",
|
|
17031
17038
|
"vehicle",
|
|
17032
17039
|
"animal",
|
|
17040
|
+
"door",
|
|
17041
|
+
"pir",
|
|
17042
|
+
"smoke",
|
|
17043
|
+
"water",
|
|
17044
|
+
"button",
|
|
17033
17045
|
"package",
|
|
17034
|
-
"
|
|
17035
|
-
"plate"
|
|
17046
|
+
"generic"
|
|
17036
17047
|
]);
|
|
17037
|
-
|
|
17038
|
-
|
|
17039
|
-
|
|
17040
|
-
|
|
17041
|
-
|
|
17042
|
-
|
|
17048
|
+
var EventKindCategorySchema = _enum([
|
|
17049
|
+
"motion",
|
|
17050
|
+
"audio",
|
|
17051
|
+
"detection",
|
|
17052
|
+
"sensor",
|
|
17053
|
+
"control",
|
|
17054
|
+
"custom",
|
|
17055
|
+
"package"
|
|
17056
|
+
]);
|
|
17057
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
17058
|
+
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
17059
|
+
var EventKindDescriptorSchema = object({
|
|
17060
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
17061
|
+
kind: string(),
|
|
17062
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
17063
|
+
labelKey: string(),
|
|
17064
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
17065
|
+
label: string(),
|
|
17066
|
+
/** Hex color for timeline/legend rendering. */
|
|
17067
|
+
color: string(),
|
|
17068
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
17069
|
+
iconId: string(),
|
|
17070
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
17071
|
+
icon: EventKindIconSchema,
|
|
17072
|
+
category: EventKindCategorySchema,
|
|
17073
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
17074
|
+
parentKind: string().nullable(),
|
|
17075
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
17076
|
+
level: EventKindLevelSchema,
|
|
17077
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
17078
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
17079
|
+
source: object({
|
|
17080
|
+
capName: string(),
|
|
17081
|
+
deviceId: number$1()
|
|
17082
|
+
})
|
|
17083
|
+
});
|
|
17084
|
+
/** One camera's event vocabulary, as returned by `listEventKindsBatch`. */
|
|
17085
|
+
var EventKindsForDeviceSchema = object({
|
|
17086
|
+
deviceId: number$1(),
|
|
17087
|
+
kinds: array(EventKindDescriptorSchema).readonly()
|
|
17088
|
+
});
|
|
17089
|
+
var SensorEventSchema = object({
|
|
17090
|
+
id: string(),
|
|
17091
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
17092
|
+
* yields N rows, one per camera). */
|
|
17093
|
+
deviceId: number$1(),
|
|
17094
|
+
/** The linked sensor device whose state changed. */
|
|
17095
|
+
sourceDeviceId: number$1(),
|
|
17096
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
17097
|
+
kind: string(),
|
|
17098
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
17099
|
+
value: record(string(), unknown()).nullable(),
|
|
17100
|
+
timestamp: number$1()
|
|
17101
|
+
});
|
|
17102
|
+
var TrackPositionSchema = object({
|
|
17043
17103
|
x: number$1(),
|
|
17044
17104
|
y: number$1(),
|
|
17045
|
-
|
|
17046
|
-
|
|
17105
|
+
timestamp: number$1(),
|
|
17106
|
+
bbox: BoundingBoxSchema
|
|
17107
|
+
});
|
|
17108
|
+
var TrackSnapshotSchema = object({
|
|
17109
|
+
timestamp: number$1(),
|
|
17110
|
+
position: TrackPositionSchema,
|
|
17111
|
+
/** MediaStore key; resolve via `getTrackMedia({ trackId })`. */
|
|
17112
|
+
mediaKey: string()
|
|
17047
17113
|
});
|
|
17048
17114
|
/**
|
|
17049
|
-
*
|
|
17050
|
-
*
|
|
17051
|
-
*
|
|
17052
|
-
* (
|
|
17053
|
-
|
|
17054
|
-
|
|
17055
|
-
|
|
17056
|
-
|
|
17057
|
-
|
|
17115
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
17116
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
17117
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
17118
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
17119
|
+
*/
|
|
17120
|
+
var TrackEnvelopeSchema = object({
|
|
17121
|
+
minX: number$1(),
|
|
17122
|
+
minY: number$1(),
|
|
17123
|
+
maxX: number$1(),
|
|
17124
|
+
maxY: number$1()
|
|
17125
|
+
});
|
|
17126
|
+
/**
|
|
17127
|
+
* Row projection for track list queries. `full` (default) returns the
|
|
17128
|
+
* complete Track including the frame-rate `positions[]` history and the
|
|
17129
|
+
* `snapshots[]` references — megabytes across a page of tracks. `slim`
|
|
17130
|
+
* keeps every scalar the list surfaces actually render (ids, class(es),
|
|
17131
|
+
* label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
|
|
17132
|
+
* zonesVisited, bestEventId, envelope, hasFace, hasEmbeddedFace, hasRider) and returns `positions` /
|
|
17133
|
+
* `snapshots` as EMPTY arrays — detail views re-fetch the full row via
|
|
17134
|
+
* `getTrack`. Mirrors the event-store `projection` convention
|
|
17135
|
+
* (`getObjectEvents` et al.).
|
|
17136
|
+
*/
|
|
17137
|
+
var TrackProjectionSchema = _enum(["full", "slim"]);
|
|
17138
|
+
/**
|
|
17139
|
+
* One audio-classification label heard on the track's camera while the
|
|
17140
|
+
* track was alive, aggregated per label. An "episode" is one persisted
|
|
17141
|
+
* audio event (the confident-classification path: score ≥ the device's
|
|
17142
|
+
* `classificationMinScore`, class-change-or-heartbeat coalesced) — NOT
|
|
17143
|
+
* one 32 ms inference chunk, so counts stay human-scaled.
|
|
17144
|
+
*/
|
|
17145
|
+
var TrackAudioLabelSchema = object({
|
|
17146
|
+
label: string(),
|
|
17147
|
+
/** Highest classification score observed across the label's episodes. */
|
|
17148
|
+
peakScore: number$1(),
|
|
17149
|
+
/** Number of coalesced audio-event episodes carrying this label. */
|
|
17150
|
+
count: number$1(),
|
|
17151
|
+
firstAt: number$1(),
|
|
17152
|
+
lastAt: number$1()
|
|
17153
|
+
});
|
|
17154
|
+
/**
|
|
17155
|
+
* How a track was produced. `pipeline` (default / absent) = the spatial
|
|
17156
|
+
* detection+tracking pipeline. Every OTHER value is a SYNTHETIC projection —
|
|
17157
|
+
* no positions, a single snapshot, and no bbox trajectory at all:
|
|
17158
|
+
*
|
|
17159
|
+
* - `sensor` — a linked sensor/control device state change.
|
|
17160
|
+
* - `audio` — an audio event on the camera itself that was anomalous for
|
|
17161
|
+
* THAT camera, loud, and heard while nothing visual was happening (D62).
|
|
17162
|
+
*
|
|
17163
|
+
* The spatial subsystems (tracker association, occupancy count, re-id /
|
|
17164
|
+
* embedding, resurrection) MUST skip every synthetic source. Test for that
|
|
17165
|
+
* with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
|
|
17166
|
+
* check silently readmits every source added after it was written.
|
|
17167
|
+
*/
|
|
17168
|
+
var TrackSourceSchema = _enum([
|
|
17169
|
+
"pipeline",
|
|
17170
|
+
"sensor",
|
|
17171
|
+
"audio"
|
|
17172
|
+
]);
|
|
17173
|
+
/**
|
|
17174
|
+
* Where a track sits in the RETRAIN lifecycle (D81).
|
|
17175
|
+
*
|
|
17176
|
+
* - `none` — never marked, or un-marked. Evictable.
|
|
17177
|
+
* - `staging` — the operator wants this track as training material and has not
|
|
17178
|
+
* finished with it. **This is the only state retention holds**: the track and
|
|
17179
|
+
* everything it owns (object events, crops, keyframes, CLIP vector) survive
|
|
17180
|
+
* the device's age window.
|
|
17181
|
+
* - `trained` — the retrain page has taken what it needed. The frames it chose
|
|
17182
|
+
* were COPIED into the retrain dataset at selection time, so the dataset no
|
|
17183
|
+
* longer depends on the track's media and the track becomes EVICTABLE again.
|
|
17184
|
+
* Terminal for the plain `markForTrain` toggle: returning it to `staging` is
|
|
17185
|
+
* a deliberate action of the retrain page, not a side effect of a checkbox.
|
|
17186
|
+
*
|
|
17187
|
+
* There is no `null`. The state is stored `TEXT NOT NULL DEFAULT 'none'` because
|
|
17188
|
+
* the store's filter language has only positive equality and `whereIn` — no
|
|
17189
|
+
* negation, no IS NULL — so a NULL would be unselectable by ANY predicate and
|
|
17190
|
+
* would make the entire pre-column history immortal in one deploy.
|
|
17191
|
+
*/
|
|
17192
|
+
var RetrainStatusSchema = _enum([
|
|
17193
|
+
"none",
|
|
17194
|
+
"staging",
|
|
17195
|
+
"trained"
|
|
17196
|
+
]);
|
|
17197
|
+
/**
|
|
17198
|
+
* Per-track OPERATOR flags — set by hand from the admin UI or the viewer, never
|
|
17199
|
+
* by the pipeline. Spread into `TrackSchema` and `KeyEventSchema` from one place
|
|
17200
|
+
* so the two surfaces cannot drift.
|
|
17201
|
+
*
|
|
17202
|
+
* **Absent ≠ false.** A track that has never been touched omits the field; an
|
|
17203
|
+
* explicitly un-flagged track carries `false`. Legacy rows written before the
|
|
17204
|
+
* columns existed read as absent, and a consumer that needs a boolean should say
|
|
17205
|
+
* `flag === true`, not `flag !== false`.
|
|
17206
|
+
*
|
|
17207
|
+
* `markForTrain` is the WIRE FACE of {@link RetrainStatusSchema}, not a column:
|
|
17208
|
+
* it is exactly `retrainStatus === 'staging'`, in both directions. Writing
|
|
17209
|
+
* `true` moves `none → staging`, writing `false` moves `staging → none`, and a
|
|
17210
|
+
* `trained` track reports `false` while refusing both writes. The boolean is
|
|
17211
|
+
* kept because three surfaces drive a toggle off it; anything that needs to tell
|
|
17212
|
+
* "never marked" from "already trained" must read `retrainStatus`.
|
|
17213
|
+
*
|
|
17214
|
+
* `debug` does NOT pin; it is attention, not durability.
|
|
17215
|
+
*
|
|
17216
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
17217
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
17218
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
17219
|
+
*/
|
|
17220
|
+
var TrackFlagFields = {
|
|
17221
|
+
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
17222
|
+
* `'staging'`. */
|
|
17223
|
+
markForTrain: boolean().optional(),
|
|
17224
|
+
/** Operator marked this track for diagnostic attention. */
|
|
17225
|
+
debug: boolean().optional(),
|
|
17226
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
17227
|
+
favourited: boolean().optional()
|
|
17228
|
+
};
|
|
17229
|
+
/**
|
|
17230
|
+
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
17231
|
+
* Deliberately NOT part of {@link TrackFlagFields}: that group also builds the
|
|
17232
|
+
* write patch, and the status is not something the toggle sets — it is what the
|
|
17233
|
+
* toggle's boolean is derived from. Absent on an in-RAM track never touched;
|
|
17234
|
+
* always present on a persisted row (the column default materialises `'none'`).
|
|
17235
|
+
*/
|
|
17236
|
+
var TrackRetrainFields = { retrainStatus: RetrainStatusSchema.optional() };
|
|
17237
|
+
/**
|
|
17238
|
+
* The write half: a PARTIAL patch. An omitted key is left untouched, so setting
|
|
17239
|
+
* one flag can never clear the other — the toggles are independent and are
|
|
17240
|
+
* driven from three surfaces that do not know about each other.
|
|
17241
|
+
*/
|
|
17242
|
+
var TrackFlagsPatchSchema = object(TrackFlagFields);
|
|
17243
|
+
/**
|
|
17244
|
+
* The resolved flag state after a write. Both fields are REQUIRED here (absent
|
|
17245
|
+
* collapses to `false`) so a caller can drive a toggle's checked state off the
|
|
17246
|
+
* mutation result without a re-fetch.
|
|
17247
|
+
*/
|
|
17248
|
+
var TrackFlagsSchema = object({
|
|
17058
17249
|
trackId: string(),
|
|
17059
|
-
|
|
17060
|
-
|
|
17061
|
-
|
|
17062
|
-
|
|
17063
|
-
|
|
17250
|
+
markForTrain: boolean(),
|
|
17251
|
+
debug: boolean(),
|
|
17252
|
+
favourited: boolean(),
|
|
17253
|
+
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
17254
|
+
* a track row) because this shape is only ever produced by the write body,
|
|
17255
|
+
* which always knows it — and a surface that has just written needs to render
|
|
17256
|
+
* `trained` without a re-fetch. */
|
|
17257
|
+
retrainStatus: RetrainStatusSchema
|
|
17258
|
+
});
|
|
17259
|
+
union([literal(1), literal(2)]);
|
|
17260
|
+
/**
|
|
17261
|
+
* WHO decided a label, and when. Carried per tier so a value can be traced to
|
|
17262
|
+
* the step and model that produced it — which is what makes the write rule
|
|
17263
|
+
* arguable after the fact ("why is 592's label `dog` and not `Canis lupus`?")
|
|
17264
|
+
* and what lets a migrated, UNATTRIBUTED value be told apart from a real one.
|
|
17265
|
+
*
|
|
17266
|
+
* `stepId` is the pipeline step id (`animal-classifier`, `bird-classifier`,
|
|
17267
|
+
* `plate-ocr`, `face-embedding`, `object-detection`), or the sentinel
|
|
17268
|
+
* `migration:4g` for a value the 4g migration moved from the single-slot era —
|
|
17269
|
+
* that value has no provenance, and the write rule lets ANY properly-attributed
|
|
17270
|
+
* write of the same tier replace it regardless of score.
|
|
17271
|
+
*/
|
|
17272
|
+
var LabelAttributionSchema = object({
|
|
17273
|
+
stepId: string(),
|
|
17274
|
+
modelId: string().optional(),
|
|
17275
|
+
decidedAt: number$1(),
|
|
17276
|
+
/**
|
|
17277
|
+
* The GALLERY id behind a recognised tier-2 label — a face-gallery
|
|
17278
|
+
* `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
|
|
17279
|
+
*
|
|
17280
|
+
* The text alone is a DISPLAY NAME, and a display name is renameable: a
|
|
17281
|
+
* notification rule authored on "Gianluca" stopped matching the moment the
|
|
17282
|
+
* operator fixed the spelling in the gallery, and nothing said so. The id is
|
|
17283
|
+
* the thing that does not move, so it is what a rule matches on
|
|
17284
|
+
* (`NcConditions.identities`) and the text is what a human is shown.
|
|
17285
|
+
*
|
|
17286
|
+
* Absent when the label names no gallery row — a plate the OCR read but no
|
|
17287
|
+
* vehicle claims, a sub-class, a species, any tier-1 value.
|
|
17288
|
+
*/
|
|
17289
|
+
identityId: string().optional()
|
|
17290
|
+
});
|
|
17291
|
+
/**
|
|
17292
|
+
* The TIERED label model (roadmap 4g), spread into `TrackSchema` and
|
|
17293
|
+
* `ObjectEventSchema` from ONE place so the two surfaces cannot drift — a
|
|
17294
|
+
* track and its events always answer the same question the same way.
|
|
17295
|
+
*
|
|
17296
|
+
* Two scalar columns, not an array: every consumer wants "the coarse one" or
|
|
17297
|
+
* "the fine one", and an array made both a scan. `label` is tier 1, `subLabel`
|
|
17298
|
+
* is tier 2, and each carries its own score + attribution.
|
|
17299
|
+
*
|
|
17300
|
+
* **Reading it.** What a human should be shown is `subLabel ?? label` — the
|
|
17301
|
+
* finest thing known. Before 4g the single `label` column held the finest
|
|
17302
|
+
* value, so a consumer that has not been updated reads the tier-1 slot and
|
|
17303
|
+
* shows nothing on a species-only row; that is why the migration puts every
|
|
17304
|
+
* pre-4g value in tier 2 (it cannot regress a display that reads the fallback)
|
|
17305
|
+
* and why the read surfaces were changed in the same train.
|
|
17306
|
+
*
|
|
17307
|
+
* **Writing it.** The slots are independent, which is the whole point: a
|
|
17308
|
+
* tier-1 write (`bird`) can never overwrite a tier-2 value (`Turdus
|
|
17309
|
+
* migratorius`), so fineness cannot regress by construction. Within a tier the
|
|
17310
|
+
* higher score wins. One rule, one implementation — see
|
|
17311
|
+
* `pipeline/label-tier.ts` in addon-post-analysis.
|
|
17312
|
+
*/
|
|
17313
|
+
var TieredLabelFields = {
|
|
17314
|
+
/** Tier 1 — the sub-class. See {@link LabelTierSchema}. */
|
|
17064
17315
|
label: string().optional(),
|
|
17316
|
+
/** Confidence of the tier-1 value, as reported by the deciding step. */
|
|
17317
|
+
labelScore: number$1().optional(),
|
|
17318
|
+
/** Provenance of the tier-1 value. See {@link LabelAttributionSchema}. */
|
|
17319
|
+
labelMeta: LabelAttributionSchema.optional(),
|
|
17320
|
+
/** Tier 2 — the instance. See {@link LabelTierSchema}. */
|
|
17065
17321
|
subLabel: string().optional(),
|
|
17066
|
-
|
|
17067
|
-
|
|
17068
|
-
/**
|
|
17069
|
-
|
|
17070
|
-
|
|
17071
|
-
|
|
17072
|
-
|
|
17322
|
+
/** Confidence of the tier-2 value, as reported by the deciding step. */
|
|
17323
|
+
subLabelScore: number$1().optional(),
|
|
17324
|
+
/** Provenance of the tier-2 value. See {@link LabelAttributionSchema}. */
|
|
17325
|
+
subLabelMeta: LabelAttributionSchema.optional()
|
|
17326
|
+
};
|
|
17327
|
+
/** Per-camera slice of a training-export estimate. */
|
|
17328
|
+
var TrainingExportDeviceTotalsSchema = object({
|
|
17329
|
+
deviceId: number$1(),
|
|
17330
|
+
tracks: number$1().int(),
|
|
17331
|
+
files: number$1().int(),
|
|
17332
|
+
bytes: number$1().int()
|
|
17073
17333
|
});
|
|
17074
|
-
/**
|
|
17075
|
-
|
|
17076
|
-
|
|
17077
|
-
|
|
17078
|
-
|
|
17079
|
-
|
|
17080
|
-
|
|
17081
|
-
|
|
17334
|
+
/**
|
|
17335
|
+
* What a training export WOULD contain. Computed from media index rows only —
|
|
17336
|
+
* no blob is read to produce this.
|
|
17337
|
+
*/
|
|
17338
|
+
var TrainingExportSummarySchema = object({
|
|
17339
|
+
generatedAt: number$1(),
|
|
17340
|
+
trackCount: number$1().int(),
|
|
17341
|
+
fileCount: number$1().int(),
|
|
17342
|
+
byteCount: number$1().int(),
|
|
17343
|
+
/** More marked tracks exist than a single pass carries. */
|
|
17344
|
+
truncated: boolean(),
|
|
17345
|
+
devices: array(TrainingExportDeviceTotalsSchema).readonly()
|
|
17082
17346
|
});
|
|
17083
|
-
|
|
17084
|
-
var RetrainTrackSchema = object({
|
|
17347
|
+
var TrackSchema = object({
|
|
17085
17348
|
trackId: string(),
|
|
17086
17349
|
deviceId: number$1(),
|
|
17087
17350
|
className: string(),
|
|
17088
|
-
|
|
17351
|
+
...TieredLabelFields,
|
|
17352
|
+
producingDeviceName: string().optional(),
|
|
17353
|
+
/** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
|
|
17354
|
+
source: TrackSourceSchema.optional(),
|
|
17089
17355
|
firstSeen: number$1(),
|
|
17090
17356
|
lastSeen: number$1(),
|
|
17091
|
-
/**
|
|
17092
|
-
|
|
17093
|
-
/**
|
|
17094
|
-
*
|
|
17095
|
-
|
|
17096
|
-
|
|
17097
|
-
|
|
17098
|
-
|
|
17099
|
-
|
|
17100
|
-
|
|
17101
|
-
|
|
17102
|
-
|
|
17103
|
-
|
|
17104
|
-
*
|
|
17105
|
-
|
|
17357
|
+
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
17358
|
+
positions: array(TrackPositionSchema).readonly(),
|
|
17359
|
+
/** Periodic snapshots at snapshotIntervalMs cadence (subject to
|
|
17360
|
+
* saveThumbnails policy). */
|
|
17361
|
+
snapshots: array(TrackSnapshotSchema).readonly(),
|
|
17362
|
+
/** Deduplicated zones the track has entered at least once. Zone IDS. */
|
|
17363
|
+
zonesVisited: array(string()).readonly(),
|
|
17364
|
+
/**
|
|
17365
|
+
* Human NAMES for {@link zonesVisited}, resolved at READ time against the
|
|
17366
|
+
* `zones` capability.
|
|
17367
|
+
*
|
|
17368
|
+
* `zonesVisited` persists ids (`cfeec78c-8d69-…`), which no operator can type
|
|
17369
|
+
* and no card can render — so every free-text search surface was structurally
|
|
17370
|
+
* unable to answer "show me the tracks in Uscio", and did not fail loudly, it
|
|
17371
|
+
* just returned nothing. Resolving here rather than in each client keeps ONE
|
|
17372
|
+
* derivation and costs the clients no extra call (the `zones` cap is
|
|
17373
|
+
* per-device, so a client-side resolve would be a per-camera fan-out on a
|
|
17374
|
+
* surface built to avoid exactly that).
|
|
17375
|
+
*
|
|
17376
|
+
* Resolved, never invented: a zone deleted since the track was written has no
|
|
17377
|
+
* name and is DROPPED, so this array can be shorter than `zonesVisited` — the
|
|
17378
|
+
* two are not positionally aligned. Absent when the track visited no zone, or
|
|
17379
|
+
* when the zone catalogue could not be read.
|
|
17380
|
+
*/
|
|
17381
|
+
zoneNames: array(string()).readonly().optional(),
|
|
17382
|
+
/** Deduplicated set of detector classes observed for this track over its
|
|
17383
|
+
* life (a track may be reclassified, e.g. person→vehicle). Absent on
|
|
17384
|
+
* legacy rows written before class accumulation shipped. */
|
|
17385
|
+
classes: array(string()).readonly().optional(),
|
|
17386
|
+
/** Cumulative normalized distance travelled (0..1 units = full frame width). */
|
|
17387
|
+
totalDistance: number$1(),
|
|
17388
|
+
state: TrackStateSchema,
|
|
17389
|
+
active: boolean(),
|
|
17390
|
+
/** Deterministic key-event importance score in [0,1] (server-computed at
|
|
17391
|
+
* track expiry, recomputed on late label). Absent on legacy rows written
|
|
17392
|
+
* before scoring shipped — consumers degrade to absence / compute-on-read. */
|
|
17393
|
+
importance: number$1().optional(),
|
|
17394
|
+
/** Id of the track's highest-confidence ObjectEvent (its representative
|
|
17395
|
+
* "best" frame). Absent when the track produced no object events. */
|
|
17396
|
+
bestEventId: string().optional(),
|
|
17397
|
+
/** Tag of the importance sub-signal that dominated the score
|
|
17398
|
+
* (identity|dwell|proximity|class|confidence|travel|zone). */
|
|
17399
|
+
importanceReason: string().optional(),
|
|
17400
|
+
/** Audio-classification labels heard on the camera during the track's
|
|
17401
|
+
* life (score ≥ device `classificationMinScore`), aggregated per label.
|
|
17402
|
+
* Absent on legacy rows / tracks with no confident audio. */
|
|
17403
|
+
audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
|
|
17404
|
+
/** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
|
|
17405
|
+
* Populated from the persisted envelope columns on historical reads;
|
|
17406
|
+
* absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
|
|
17407
|
+
envelope: TrackEnvelopeSchema.optional(),
|
|
17408
|
+
/**
|
|
17409
|
+
* A face DETECTOR found a face on this track — nothing more. It says the
|
|
17410
|
+
* detail plane produced a `face` detail; it does NOT say the face was
|
|
17411
|
+
* embedded, matched, above `minFacePx`, or that the recognizer was even
|
|
17412
|
+
* enabled. Set once and never cleared.
|
|
17413
|
+
*
|
|
17414
|
+
* **This exists so "face present but not recognised" is expressible.** A
|
|
17415
|
+
* recognised identity lands in `subLabel` (attributed to the face chain via
|
|
17416
|
+
* `subLabelMeta.stepId`), so before this field a track with an unmatched face
|
|
17417
|
+
* and a track with no face at all were byte-identical on the wire and no
|
|
17418
|
+
* surface could tell them apart. The read is `hasFace === true && subLabel
|
|
17419
|
+
* === undefined`.
|
|
17420
|
+
*
|
|
17421
|
+
* **Absent ≠ false.** Every row written before the column existed omits it,
|
|
17422
|
+
* and so does every server that predates the field — a consumer must test
|
|
17423
|
+
* `=== true` and render nothing otherwise, never infer "no face".
|
|
17424
|
+
*/
|
|
17425
|
+
hasFace: boolean().optional(),
|
|
17426
|
+
/**
|
|
17427
|
+
* This track has a face row IN THE GALLERY: a crop **and** an embedding — a
|
|
17428
|
+
* face an operator could ASSIGN to an identity.
|
|
17429
|
+
*
|
|
17430
|
+
* The STRICT twin of {@link hasFace}, and the pair only earns its keep
|
|
17431
|
+
* because the two disagree. `hasFace` is stamped at the TOP of the face
|
|
17432
|
+
* branch, before every gate, and means no more than "a face detector produced
|
|
17433
|
+
* a face detail". This one is stamped at the single moment the gallery row
|
|
17434
|
+
* LANDS — after `FaceRecognizer.onTrackEnd` successfully persists it, i.e.
|
|
17435
|
+
* past the embedding-magnitude verdict, the `minFacePx` detection gate, the
|
|
17436
|
+
* candidate gate, the imageless-track drop (no crop was ever captured) and
|
|
17437
|
+
* the crop-store drop. Everything between the detector and that insert can
|
|
17438
|
+
* legitimately refuse the face, so a flag written any earlier promises the
|
|
17439
|
+
* operator something to assign and delivers nothing.
|
|
17440
|
+
*
|
|
17441
|
+
* **Independent of recognition.** A face collected but never auto-matched is
|
|
17442
|
+
* still assignable — it is in fact the face an operator most wants to reach —
|
|
17443
|
+
* so this is NOT gated on `recognizedIdentityId`. Recognition lands in
|
|
17444
|
+
* `subLabel`; this says only that the raw material exists.
|
|
17445
|
+
*
|
|
17446
|
+
* **Set once, never cleared.** A track that produced a gallery row produced
|
|
17447
|
+
* one; deleting the row later is the gallery's business, not this flag's.
|
|
17448
|
+
*
|
|
17449
|
+
* **Absent ≠ false**, the same rule as {@link hasFace}: every row written
|
|
17450
|
+
* before the column omits it, and so does every server that predates the
|
|
17451
|
+
* field. A consumer must test `=== true` and render nothing otherwise —
|
|
17452
|
+
* never infer "no assignable face".
|
|
17453
|
+
*/
|
|
17454
|
+
hasEmbeddedFace: boolean().optional(),
|
|
17455
|
+
/**
|
|
17456
|
+
* This subject CONTAINS a folded rider — a person the rider-pairing step
|
|
17457
|
+
* ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
|
|
17458
|
+
* so the passage is tracked once and as a VEHICLE.
|
|
17459
|
+
*
|
|
17460
|
+
* It exists because the fold's record was dishonest. D34 and the code both
|
|
17461
|
+
* said "the person is not lost — it is reported so both entities stay on the
|
|
17462
|
+
* record"; in fact the pair went into a per-processor RAM field behind an
|
|
17463
|
+
* accessor nobody called, and every durable surface said `vehicle`, full
|
|
17464
|
+
* stop. This is the composition note that makes the row true.
|
|
17465
|
+
*
|
|
17466
|
+
* A COMPOSITION, never a class and never a label. "This vehicle contains a
|
|
17467
|
+
* person" is not an answer to "what is this" — both label tiers would refuse
|
|
17468
|
+
* a macro token anyway (D89), and correctly. Nothing here changes what the
|
|
17469
|
+
* subject IS: a cyclist stays one vehicle track, occupancy still counts one,
|
|
17470
|
+
* and a `person` rule still does not fire for someone cycling past.
|
|
17471
|
+
*
|
|
17472
|
+
* **Absent ≠ false**, exactly like {@link hasFace}: every row written before
|
|
17473
|
+
* the column, and every hub that predates the field, omits it. Test
|
|
17474
|
+
* `=== true` and render nothing otherwise — never infer "no rider".
|
|
17475
|
+
*/
|
|
17476
|
+
hasRider: boolean().optional(),
|
|
17477
|
+
...TrackFlagFields,
|
|
17478
|
+
...TrackRetrainFields
|
|
17106
17479
|
});
|
|
17107
|
-
|
|
17108
|
-
|
|
17109
|
-
frameId: string(),
|
|
17480
|
+
var BaseEventFields = {
|
|
17481
|
+
id: string(),
|
|
17110
17482
|
deviceId: number$1(),
|
|
17111
|
-
|
|
17112
|
-
|
|
17113
|
-
|
|
17114
|
-
|
|
17115
|
-
|
|
17116
|
-
|
|
17117
|
-
|
|
17118
|
-
|
|
17119
|
-
|
|
17120
|
-
|
|
17121
|
-
|
|
17122
|
-
|
|
17123
|
-
|
|
17124
|
-
|
|
17125
|
-
|
|
17126
|
-
|
|
17127
|
-
|
|
17128
|
-
|
|
17129
|
-
sourceMediaKey: string(),
|
|
17130
|
-
reason: RetrainCopyRefusalSchema
|
|
17131
|
-
})).readonly()
|
|
17132
|
-
});
|
|
17133
|
-
var RetrainFrameListSchema = object({
|
|
17134
|
-
candidates: array(RetrainFrameCandidateSchema).readonly(),
|
|
17135
|
-
copies: array(RetrainFrameSchema).readonly(),
|
|
17136
|
-
/** What the page pre-selects — the native key frame when one survives. */
|
|
17137
|
-
autoPickMediaKey: string().optional()
|
|
17483
|
+
timestamp: number$1()
|
|
17484
|
+
};
|
|
17485
|
+
var MotionEventSchema = object({
|
|
17486
|
+
...BaseEventFields,
|
|
17487
|
+
kind: literal("motion"),
|
|
17488
|
+
regionCount: number$1(),
|
|
17489
|
+
/** Heavy JSON array — omitted in slim projection. */
|
|
17490
|
+
regions: array(object({
|
|
17491
|
+
bbox: BoundingBoxSchema,
|
|
17492
|
+
pixelCount: number$1(),
|
|
17493
|
+
intensity: number$1()
|
|
17494
|
+
})).readonly().optional(),
|
|
17495
|
+
/** Omitted in slim projection. */
|
|
17496
|
+
frameWidth: number$1().optional(),
|
|
17497
|
+
/** Omitted in slim projection. */
|
|
17498
|
+
frameHeight: number$1().optional(),
|
|
17499
|
+
/** Populated by B5 (recording playback URL for this event). */
|
|
17500
|
+
mediaUrl: string().optional()
|
|
17138
17501
|
});
|
|
17139
|
-
/** What the operator asked the assist to look for. */
|
|
17140
|
-
var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
|
|
17141
|
-
kind: literal("package"),
|
|
17142
|
-
zone: RetrainBboxSchema.optional()
|
|
17143
|
-
}), object({
|
|
17144
|
-
kind: literal("objects"),
|
|
17145
|
-
modelId: string(),
|
|
17146
|
-
minScore: number$1().optional()
|
|
17147
|
-
})]);
|
|
17148
17502
|
/**
|
|
17149
|
-
*
|
|
17150
|
-
*
|
|
17151
|
-
*
|
|
17503
|
+
* Which detection SOURCE produced an object event. `pipeline` = the ML
|
|
17504
|
+
* detection pipeline (decoded-frame inference); `onboard` = the camera's
|
|
17505
|
+
* native on-device AI. Both flow through the SAME analysis layers (zoning,
|
|
17506
|
+
* tracking, per-kind persistence) but stay distinguishable so consumers
|
|
17507
|
+
* (advanced-notifier, occupancy, …) can select which source(s) to act on.
|
|
17508
|
+
* Absent on legacy rows ⇒ treat as `pipeline`.
|
|
17152
17509
|
*/
|
|
17153
|
-
var
|
|
17154
|
-
|
|
17155
|
-
|
|
17156
|
-
|
|
17157
|
-
|
|
17158
|
-
|
|
17159
|
-
|
|
17160
|
-
|
|
17161
|
-
|
|
17162
|
-
|
|
17163
|
-
|
|
17164
|
-
|
|
17165
|
-
|
|
17166
|
-
|
|
17167
|
-
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17176
|
-
"unknown-track",
|
|
17177
|
-
"no-frames-copied",
|
|
17178
|
-
"not-staging",
|
|
17179
|
-
"not-trained",
|
|
17180
|
-
"unchanged"
|
|
17181
|
-
]).optional()
|
|
17510
|
+
var DetectionSourceSchema = _enum(["pipeline", "onboard"]);
|
|
17511
|
+
/**
|
|
17512
|
+
* The confirmed zone crossing that produced an object event. Present ONLY on
|
|
17513
|
+
* an event emitted BY a crossing (`zone.enter` / `zone.exit`); a movement-state
|
|
17514
|
+
* event (`object.entering` / `leaving` / `stationary` / `loitering`) and an
|
|
17515
|
+
* appearance event carry none, so a rule asking for a direction fails closed
|
|
17516
|
+
* on them.
|
|
17517
|
+
*
|
|
17518
|
+
* Exactly ONE crossing per event: the emitter turns each confirmed crossing
|
|
17519
|
+
* into its own event, so a frame in which a track enters A while leaving B
|
|
17520
|
+
* produces two events with two directions — never one ambiguous row.
|
|
17521
|
+
*
|
|
17522
|
+
* `zoneId` is load-bearing for an EXIT: the event's `zones` list is the
|
|
17523
|
+
* membership the box has NOW, and by definition it no longer contains the zone
|
|
17524
|
+
* that was just left. Without the id here, a zone-scoped rule could never match
|
|
17525
|
+
* the exit it asked for.
|
|
17526
|
+
*/
|
|
17527
|
+
var ZoneCrossingSchema = object({
|
|
17528
|
+
direction: _enum(["enter", "exit"]),
|
|
17529
|
+
/** Admin zone id crossed. */
|
|
17530
|
+
zoneId: string(),
|
|
17531
|
+
/** Zone display name at crossing time (falls back to the id). */
|
|
17532
|
+
zoneName: string().optional()
|
|
17182
17533
|
});
|
|
17183
|
-
var
|
|
17184
|
-
|
|
17185
|
-
|
|
17186
|
-
|
|
17187
|
-
|
|
17188
|
-
|
|
17189
|
-
|
|
17190
|
-
|
|
17191
|
-
*
|
|
17192
|
-
*
|
|
17193
|
-
*
|
|
17194
|
-
|
|
17534
|
+
var ObjectEventSchema = object({
|
|
17535
|
+
...BaseEventFields,
|
|
17536
|
+
kind: literal("object"),
|
|
17537
|
+
/** Detection source. Optional for backward-compat; absent ⇒ `pipeline`. */
|
|
17538
|
+
source: DetectionSourceSchema.optional(),
|
|
17539
|
+
/**
|
|
17540
|
+
* Inference-frame id shared by every object event emitted from the SAME frame
|
|
17541
|
+
* — the "scene/parent" key. Lets a consumer group co-occurring detections (e.g.
|
|
17542
|
+
* 2 people + 1 dog) under one full frame, and link a track's frames over time
|
|
17543
|
+
* (group by `trackId`, pick a representative `frameId` as the parent frame).
|
|
17544
|
+
* Optional for backward-compat with pre-existing rows / the slim projection
|
|
17545
|
+
* includes it (it is light). Absent on rows written before this field.
|
|
17546
|
+
*/
|
|
17547
|
+
frameId: string().optional(),
|
|
17548
|
+
/** Omitted in slim projection. */
|
|
17549
|
+
trackId: string().optional(),
|
|
17550
|
+
className: string(),
|
|
17551
|
+
...TieredLabelFields,
|
|
17552
|
+
/** Omitted in slim projection. */
|
|
17553
|
+
confidence: number$1().optional(),
|
|
17554
|
+
/** Heavy JSON — omitted in slim projection. */
|
|
17555
|
+
bbox: BoundingBoxSchema.optional(),
|
|
17556
|
+
/** Heavy JSON — omitted in slim projection. */
|
|
17557
|
+
zones: array(string()).readonly().optional(),
|
|
17558
|
+
/** Omitted in slim projection. */
|
|
17559
|
+
state: TrackStateSchema.optional(),
|
|
17560
|
+
/**
|
|
17561
|
+
* The zone crossing this event IS, when it is one. Absent on every other
|
|
17562
|
+
* event kind (movement state, appearance, package) — see
|
|
17563
|
+
* {@link ZoneCrossingSchema}. Omitted in slim projection.
|
|
17564
|
+
*/
|
|
17565
|
+
zoneCrossing: ZoneCrossingSchema.optional(),
|
|
17566
|
+
/** Detection-frame dimensions in pixels — let consumers normalize the
|
|
17567
|
+
* pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
|
|
17568
|
+
frameWidth: number$1().optional(),
|
|
17569
|
+
frameHeight: number$1().optional(),
|
|
17570
|
+
/** MediaStore key for the crop attached to this event (if any). */
|
|
17571
|
+
mediaKey: string().optional(),
|
|
17572
|
+
/** Design B: MediaStore key of the track's native-resolution key frame (the
|
|
17573
|
+
* best-detection full frame). Resolve via the event-media data-plane
|
|
17574
|
+
* (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
|
|
17575
|
+
* draws `bbox` over the native frame. Absent on legacy rows / non-decoded
|
|
17576
|
+
* sources — consumers fall back to `mediaKey` (the tight crop). */
|
|
17577
|
+
keyFrameMediaKey: string().optional(),
|
|
17578
|
+
/** Populated by B5 (recording playback URL for this event). */
|
|
17579
|
+
mediaUrl: string().optional(),
|
|
17580
|
+
/** The parent track's key-event importance [0,1], propagated to every object
|
|
17581
|
+
* event of the track (so an event row can be sorted by importance without a
|
|
17582
|
+
* track join). Absent on legacy rows / before the track was scored. */
|
|
17583
|
+
importance: number$1().optional()
|
|
17195
17584
|
});
|
|
17196
|
-
var
|
|
17197
|
-
|
|
17198
|
-
|
|
17199
|
-
|
|
17200
|
-
|
|
17201
|
-
|
|
17202
|
-
|
|
17203
|
-
|
|
17204
|
-
|
|
17205
|
-
|
|
17206
|
-
/**
|
|
17207
|
-
|
|
17208
|
-
cursor: string().optional(),
|
|
17209
|
-
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
17210
|
-
projection: TrackProjectionSchema.optional(),
|
|
17211
|
-
/** Include stationary-promoted rows (parked objects). Default false: the
|
|
17212
|
-
* feed lists passages; parking records live on the stationary registry. */
|
|
17213
|
-
includeStationary: boolean().optional()
|
|
17585
|
+
var AudioEventSchema = object({
|
|
17586
|
+
...BaseEventFields,
|
|
17587
|
+
kind: literal("audio"),
|
|
17588
|
+
rms: number$1(),
|
|
17589
|
+
dbfs: number$1(),
|
|
17590
|
+
classification: object({
|
|
17591
|
+
className: string(),
|
|
17592
|
+
originalClass: string().optional(),
|
|
17593
|
+
score: number$1()
|
|
17594
|
+
}).optional(),
|
|
17595
|
+
/** Populated by B5 (recording playback URL for this event). */
|
|
17596
|
+
mediaUrl: string().optional()
|
|
17214
17597
|
});
|
|
17215
|
-
var
|
|
17216
|
-
|
|
17217
|
-
|
|
17218
|
-
|
|
17219
|
-
|
|
17598
|
+
var MediaFileKindEnum = _enum([
|
|
17599
|
+
"crop",
|
|
17600
|
+
"thumbnail",
|
|
17601
|
+
"snapshot",
|
|
17602
|
+
"firstFrame",
|
|
17603
|
+
"lastFrame",
|
|
17604
|
+
"fullFrame",
|
|
17605
|
+
"fullFrameBoxed",
|
|
17606
|
+
"faceCrop",
|
|
17607
|
+
"plateCrop",
|
|
17608
|
+
"keyFrame",
|
|
17609
|
+
"keyFrameSmall",
|
|
17610
|
+
"thumbnailSmall"
|
|
17611
|
+
]);
|
|
17612
|
+
var MediaFileSchema = object({
|
|
17613
|
+
key: string(),
|
|
17614
|
+
kind: MediaFileKindEnum,
|
|
17615
|
+
base64: string(),
|
|
17616
|
+
sizeBytes: number$1(),
|
|
17617
|
+
timestamp: number$1()
|
|
17220
17618
|
});
|
|
17221
|
-
|
|
17222
|
-
|
|
17223
|
-
|
|
17619
|
+
/**
|
|
17620
|
+
* One media row WITHOUT its bytes.
|
|
17621
|
+
*
|
|
17622
|
+
* A track's media is 5-8 MB of base64 (measured: 7.67 MB across 23 files for a
|
|
17623
|
+
* 140 s track), and a client that renders tiles from the media data plane needs
|
|
17624
|
+
* to know only WHAT EXISTS — the bytes then arrive per tile, lazily, over HTTP
|
|
17625
|
+
* with an immutable cache, instead of all at once inside a tRPC response that
|
|
17626
|
+
* blocks the whole view.
|
|
17627
|
+
*
|
|
17628
|
+
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
17629
|
+
* stored blob and a `?variant=thumb` rendering without fetching either.
|
|
17630
|
+
*/
|
|
17631
|
+
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
17632
|
+
/**
|
|
17633
|
+
* The MACRO tier of an annotation — a CLOSED set.
|
|
17634
|
+
*
|
|
17635
|
+
* This is what the exported detector predicts, so a typo here is a new class
|
|
17636
|
+
* with one example in it. `label` and `subLabel` are open strings by contrast:
|
|
17637
|
+
* the whole point of the page is teaching the model things it does not know
|
|
17638
|
+
* yet, and constraining that vocabulary would make it useless.
|
|
17639
|
+
*
|
|
17640
|
+
* A macro class is NEVER a label. The provider refuses a write whose `label` or
|
|
17641
|
+
* `subLabel` is one of these values, in any casing, because once `person`
|
|
17642
|
+
* exists in both tiers "every person box" stops being answerable without
|
|
17643
|
+
* knowing every string anyone ever typed — and the damage is retroactive.
|
|
17644
|
+
*/
|
|
17645
|
+
var RetrainMacroClassSchema = _enum([
|
|
17646
|
+
"person",
|
|
17647
|
+
"vehicle",
|
|
17648
|
+
"animal",
|
|
17649
|
+
"package",
|
|
17650
|
+
"face",
|
|
17651
|
+
"plate"
|
|
17652
|
+
]);
|
|
17653
|
+
/** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
|
|
17654
|
+
var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
|
|
17655
|
+
/** Did a human draw this box, or did the assist propose it? */
|
|
17656
|
+
var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
|
|
17657
|
+
/** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
|
|
17658
|
+
var RetrainBboxSchema = object({
|
|
17659
|
+
x: number$1(),
|
|
17660
|
+
y: number$1(),
|
|
17661
|
+
w: number$1(),
|
|
17662
|
+
h: number$1()
|
|
17663
|
+
});
|
|
17664
|
+
/**
|
|
17665
|
+
* One annotated subject.
|
|
17666
|
+
*
|
|
17667
|
+
* `bbox` is normalised against the full frame, ALWAYS. The per-model shapes
|
|
17668
|
+
* (letterboxed root / zone-cropped package / subject-cropped classifier) are
|
|
17669
|
+
* derived from it at export and never stored — storing them is how one feature
|
|
17670
|
+
* space ends up holding two crops of the same subject (D52).
|
|
17671
|
+
*/
|
|
17672
|
+
var RetrainAnnotationSchema = object({
|
|
17224
17673
|
id: string(),
|
|
17225
|
-
|
|
17226
|
-
|
|
17227
|
-
|
|
17228
|
-
|
|
17229
|
-
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
|
|
17233
|
-
|
|
17234
|
-
|
|
17235
|
-
|
|
17674
|
+
trackId: string(),
|
|
17675
|
+
deviceId: number$1(),
|
|
17676
|
+
/** The COPY in retrain storage — never the source track's media key. */
|
|
17677
|
+
mediaKey: string(),
|
|
17678
|
+
bbox: RetrainBboxSchema,
|
|
17679
|
+
macroClass: RetrainMacroClassSchema,
|
|
17680
|
+
label: string().optional(),
|
|
17681
|
+
subLabel: string().optional(),
|
|
17682
|
+
kind: RetrainAnnotationKindSchema,
|
|
17683
|
+
source: RetrainAnnotationSourceSchema,
|
|
17684
|
+
/** Which model proposed this box — or, on a `model_error`, drew the phantom. */
|
|
17685
|
+
assistModelId: string().optional(),
|
|
17686
|
+
assistScore: number$1().optional(),
|
|
17687
|
+
exportedInBatch: string().optional(),
|
|
17688
|
+
createdAt: number$1()
|
|
17236
17689
|
});
|
|
17237
|
-
|
|
17690
|
+
/** The write form — the server owns `id`, `createdAt` and the frame binding. */
|
|
17691
|
+
var RetrainAnnotationDraftSchema = RetrainAnnotationSchema.omit({
|
|
17692
|
+
id: true,
|
|
17693
|
+
trackId: true,
|
|
17694
|
+
deviceId: true,
|
|
17695
|
+
mediaKey: true,
|
|
17696
|
+
createdAt: true,
|
|
17697
|
+
exportedInBatch: true
|
|
17698
|
+
});
|
|
17699
|
+
/** A track sitting in `staging`, with everything the worklist needs to rank it. */
|
|
17700
|
+
var RetrainTrackSchema = object({
|
|
17238
17701
|
trackId: string(),
|
|
17239
|
-
deviceId: number$1()
|
|
17702
|
+
deviceId: number$1(),
|
|
17240
17703
|
className: string(),
|
|
17241
|
-
|
|
17242
|
-
|
|
17243
|
-
|
|
17244
|
-
|
|
17245
|
-
|
|
17246
|
-
|
|
17247
|
-
|
|
17248
|
-
|
|
17249
|
-
/** Window lower bound on `closedAt` (inclusive). */
|
|
17250
|
-
since: number$1().optional(),
|
|
17251
|
-
/** Window upper bound on `openedAt` (inclusive). */
|
|
17252
|
-
until: number$1().optional(),
|
|
17253
|
-
limit: number$1().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
|
|
17254
|
-
/** Opaque continuation cursor from a previous page's `nextCursor`. */
|
|
17255
|
-
cursor: string().optional()
|
|
17704
|
+
label: string().optional(),
|
|
17705
|
+
firstSeen: number$1(),
|
|
17706
|
+
lastSeen: number$1(),
|
|
17707
|
+
/** How many frames the dataset already holds from this track. */
|
|
17708
|
+
frameCount: number$1().int(),
|
|
17709
|
+
/** How many subjects have been annotated on those frames. `0` with
|
|
17710
|
+
* `frameCount: 0` is exactly "staging, still to work". */
|
|
17711
|
+
annotationCount: number$1().int()
|
|
17256
17712
|
});
|
|
17257
|
-
|
|
17258
|
-
|
|
17259
|
-
|
|
17713
|
+
/** A frame the picker may offer — an index row, no blob was read to produce it. */
|
|
17714
|
+
var RetrainFrameCandidateSchema = object({
|
|
17715
|
+
mediaKey: string(),
|
|
17716
|
+
kind: MediaFileKindEnum,
|
|
17717
|
+
timestamp: number$1(),
|
|
17718
|
+
sizeBytes: number$1().int(),
|
|
17719
|
+
/** A copy of this original already exists — selecting it is free and cannot
|
|
17720
|
+
* fail, whatever became of the original. */
|
|
17721
|
+
copied: boolean()
|
|
17260
17722
|
});
|
|
17261
|
-
|
|
17723
|
+
/** A frame the dataset OWNS: bytes copied at selection time. */
|
|
17724
|
+
var RetrainFrameSchema = object({
|
|
17725
|
+
frameId: string(),
|
|
17262
17726
|
deviceId: number$1(),
|
|
17263
|
-
|
|
17264
|
-
|
|
17265
|
-
|
|
17727
|
+
trackId: string(),
|
|
17728
|
+
/** Provenance only. It may already point at nothing — that is expected. */
|
|
17729
|
+
sourceMediaKey: string(),
|
|
17730
|
+
sourceKind: MediaFileKindEnum,
|
|
17731
|
+
sizeBytes: number$1().int(),
|
|
17732
|
+
width: number$1().int(),
|
|
17733
|
+
height: number$1().int(),
|
|
17734
|
+
copiedAt: number$1()
|
|
17735
|
+
});
|
|
17736
|
+
/** Why a copy-on-select could not be honoured — named, never a silent skip. */
|
|
17737
|
+
var RetrainCopyRefusalSchema = _enum([
|
|
17738
|
+
"source-missing",
|
|
17739
|
+
"unreadable-image",
|
|
17740
|
+
"write-failed"
|
|
17741
|
+
]);
|
|
17742
|
+
var RetrainFrameSelectionSchema = object({
|
|
17743
|
+
copied: array(RetrainFrameSchema).readonly(),
|
|
17744
|
+
refused: array(object({
|
|
17745
|
+
sourceMediaKey: string(),
|
|
17746
|
+
reason: RetrainCopyRefusalSchema
|
|
17747
|
+
})).readonly()
|
|
17748
|
+
});
|
|
17749
|
+
var RetrainFrameListSchema = object({
|
|
17750
|
+
candidates: array(RetrainFrameCandidateSchema).readonly(),
|
|
17751
|
+
copies: array(RetrainFrameSchema).readonly(),
|
|
17752
|
+
/** What the page pre-selects — the native key frame when one survives. */
|
|
17753
|
+
autoPickMediaKey: string().optional()
|
|
17754
|
+
});
|
|
17755
|
+
/** What the operator asked the assist to look for. */
|
|
17756
|
+
var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
|
|
17757
|
+
kind: literal("package"),
|
|
17758
|
+
zone: RetrainBboxSchema.optional()
|
|
17759
|
+
}), object({
|
|
17760
|
+
kind: literal("objects"),
|
|
17761
|
+
modelId: string(),
|
|
17762
|
+
minScore: number$1().optional()
|
|
17763
|
+
})]);
|
|
17764
|
+
/**
|
|
17765
|
+
* The assist's answer — a discriminated union, because "the model saw nothing"
|
|
17766
|
+
* and "this node cannot run that model" lead to different next moves and a
|
|
17767
|
+
* nullable result cannot tell them apart.
|
|
17768
|
+
*/
|
|
17769
|
+
var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
|
|
17770
|
+
kind: literal("proposed"),
|
|
17771
|
+
modelId: string(),
|
|
17772
|
+
stepId: string(),
|
|
17773
|
+
minScore: number$1(),
|
|
17774
|
+
/** Drafts, ready to edit. `source: 'assist'` until the operator touches one. */
|
|
17775
|
+
proposals: array(RetrainAnnotationDraftSchema).readonly(),
|
|
17776
|
+
/** Returned by the runner but removed by the threshold. */
|
|
17777
|
+
belowThreshold: number$1().int()
|
|
17778
|
+
}), object({
|
|
17779
|
+
kind: literal("refused"),
|
|
17780
|
+
/** `no-zone` is ours; the rest are the runner's own refusal vocabulary. */
|
|
17781
|
+
reason: string(),
|
|
17782
|
+
detail: string().optional()
|
|
17783
|
+
})]);
|
|
17784
|
+
/** The outcome of a lifecycle move owned by the retrain page. */
|
|
17785
|
+
var RetrainTransitionResultSchema = object({
|
|
17786
|
+
trackId: string(),
|
|
17787
|
+
/** Where the track ended up, whatever happened. */
|
|
17788
|
+
retrainStatus: RetrainStatusSchema,
|
|
17789
|
+
/** `false` ⇒ the move was refused or was a no-op; `reason` says which. */
|
|
17790
|
+
changed: boolean(),
|
|
17791
|
+
reason: _enum([
|
|
17792
|
+
"unknown-track",
|
|
17793
|
+
"no-frames-copied",
|
|
17794
|
+
"not-staging",
|
|
17795
|
+
"not-trained",
|
|
17796
|
+
"unchanged"
|
|
17797
|
+
]).optional()
|
|
17798
|
+
});
|
|
17799
|
+
var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
|
|
17800
|
+
var MAX_EVENT_QUERY_LIMIT = 5e3;
|
|
17801
|
+
var DeviceEventQueryInput = object({
|
|
17802
|
+
deviceId: number$1(),
|
|
17803
|
+
since: number$1().optional(),
|
|
17804
|
+
until: number$1().optional(),
|
|
17805
|
+
limit: number$1().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
|
|
17806
|
+
/** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
|
|
17807
|
+
* optional `mediaUrl` (populated by B5). `full` (default) keeps today's
|
|
17808
|
+
* exact behaviour. Callers may omit this field — the store defaults to
|
|
17809
|
+
* `full` when not provided. */
|
|
17810
|
+
projection: _enum(["full", "slim"]).optional()
|
|
17811
|
+
});
|
|
17812
|
+
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
17813
|
+
var RecentTracksQueryInput = object({
|
|
17814
|
+
/** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
|
|
17815
|
+
deviceIds: array(number$1()),
|
|
17816
|
+
/** Window lower bound on `lastSeen` (inclusive). */
|
|
17817
|
+
since: number$1().optional(),
|
|
17818
|
+
/** Window upper bound on `lastSeen` (inclusive). */
|
|
17819
|
+
until: number$1().optional(),
|
|
17820
|
+
/** Page size. Default 200, max 1000. */
|
|
17821
|
+
limit: number$1().int().min(1).max(1e3).default(200),
|
|
17822
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`.
|
|
17823
|
+
* Encodes the (lastSeen, trackId) sort position — treat as opaque. */
|
|
17824
|
+
cursor: string().optional(),
|
|
17825
|
+
/** See {@link TrackProjectionSchema}. Default `full`. */
|
|
17826
|
+
projection: TrackProjectionSchema.optional(),
|
|
17827
|
+
/** Include stationary-promoted rows (parked objects). Default false: the
|
|
17828
|
+
* feed lists passages; parking records live on the stationary registry. */
|
|
17829
|
+
includeStationary: boolean().optional()
|
|
17830
|
+
});
|
|
17831
|
+
var RecentTracksPageSchema = object({
|
|
17832
|
+
/** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
|
|
17833
|
+
tracks: array(TrackSchema).readonly(),
|
|
17834
|
+
/** Cursor for the next page, or null when this page is the last. */
|
|
17835
|
+
nextCursor: string().nullable()
|
|
17836
|
+
});
|
|
17837
|
+
var LIST_GROUPS_DEFAULT_LIMIT = 40;
|
|
17838
|
+
var LIST_GROUPS_MAX_LIMIT = 100;
|
|
17839
|
+
var AnalyticsGroupRecordSchema = object({
|
|
17840
|
+
id: string(),
|
|
17841
|
+
deviceId: number$1().int(),
|
|
17842
|
+
openedAt: number$1().int(),
|
|
17843
|
+
closedAt: number$1().int(),
|
|
17844
|
+
timestamp: number$1().int(),
|
|
17845
|
+
memberCount: number$1().int(),
|
|
17846
|
+
memberTrackIds: array(string()).readonly(),
|
|
17847
|
+
className: string(),
|
|
17848
|
+
classes: array(string()).readonly(),
|
|
17849
|
+
/** Relative event-media path, or null when the group has no picture yet. */
|
|
17850
|
+
mediaUrl: string().nullable(),
|
|
17851
|
+
singleton: boolean()
|
|
17852
|
+
});
|
|
17853
|
+
var AnalyticsGroupMemberSchema = object({
|
|
17854
|
+
trackId: string(),
|
|
17855
|
+
deviceId: number$1().int(),
|
|
17856
|
+
className: string(),
|
|
17857
|
+
firstSeen: number$1().int(),
|
|
17858
|
+
lastSeen: number$1().int(),
|
|
17859
|
+
mediaUrl: string().nullable()
|
|
17860
|
+
});
|
|
17861
|
+
var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
|
|
17862
|
+
var ListGroupsQueryInput = object({
|
|
17863
|
+
/** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
|
|
17864
|
+
deviceIds: array(number$1()),
|
|
17865
|
+
/** Window lower bound on `closedAt` (inclusive). */
|
|
17866
|
+
since: number$1().optional(),
|
|
17867
|
+
/** Window upper bound on `openedAt` (inclusive). */
|
|
17868
|
+
until: number$1().optional(),
|
|
17869
|
+
limit: number$1().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
|
|
17870
|
+
/** Opaque continuation cursor from a previous page's `nextCursor`. */
|
|
17871
|
+
cursor: string().optional()
|
|
17872
|
+
});
|
|
17873
|
+
var ListGroupsPageSchema = object({
|
|
17874
|
+
groups: array(AnalyticsGroupRecordSchema).readonly(),
|
|
17875
|
+
nextCursor: string().nullable()
|
|
17876
|
+
});
|
|
17877
|
+
var KeyEventQueryInput = object({
|
|
17878
|
+
deviceId: number$1(),
|
|
17879
|
+
/** Window lower bound (track firstSeen ≥ since). */
|
|
17880
|
+
since: number$1(),
|
|
17881
|
+
/** Window upper bound (track firstSeen ≤ until). */
|
|
17266
17882
|
until: number$1(),
|
|
17267
17883
|
limit: number$1().int().min(1).max(200).default(50),
|
|
17268
17884
|
/** Drop tracks scoring below this importance. */
|
|
@@ -17461,6 +18077,24 @@ var RebuildStatusSchema = object({
|
|
|
17461
18077
|
/** Present when the pass ended by throwing. */
|
|
17462
18078
|
error: string().nullable()
|
|
17463
18079
|
});
|
|
18080
|
+
var ReplayFrameInputSchema = object({
|
|
18081
|
+
timestamp: number$1(),
|
|
18082
|
+
frame: PipelineRunResultBridge
|
|
18083
|
+
});
|
|
18084
|
+
var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
18085
|
+
className: string(),
|
|
18086
|
+
firstSeenMs: number$1(),
|
|
18087
|
+
lastSeenMs: number$1(),
|
|
18088
|
+
/** Bbox of the track's FIRST matched detection, pixel-space in the clip's
|
|
18089
|
+
* frame — a representative box for the diff's `(className, window, IoU)`
|
|
18090
|
+
* pairing (`replay-diff.ts`). A replay does not need the full per-frame
|
|
18091
|
+
* trajectory production's `Track.positions` keeps. */
|
|
18092
|
+
bbox: BoundingBoxSchema,
|
|
18093
|
+
/** How many of the input frames this track matched a real detection on
|
|
18094
|
+
* (never a coasted/extrapolated frame) — the replay's own signal for "how
|
|
18095
|
+
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
18096
|
+
framesMatched: number$1().int()
|
|
18097
|
+
})).readonly() });
|
|
17464
18098
|
DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).readonly()), method(object({
|
|
17465
18099
|
deviceId: number$1(),
|
|
17466
18100
|
trackId: string()
|
|
@@ -17631,502 +18265,80 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
|
|
|
17631
18265
|
}), RetrainAssistResultSchema, {
|
|
17632
18266
|
kind: "mutation",
|
|
17633
18267
|
auth: "admin"
|
|
17634
|
-
}), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
|
|
17635
|
-
kind: "query",
|
|
17636
|
-
auth: "admin"
|
|
17637
|
-
}), method(object({
|
|
17638
|
-
deviceId: number$1(),
|
|
17639
|
-
trackId: string(),
|
|
17640
|
-
frameId: string(),
|
|
17641
|
-
annotations: array(RetrainAnnotationDraftSchema)
|
|
17642
|
-
}), array(RetrainAnnotationSchema).readonly(), {
|
|
17643
|
-
kind: "mutation",
|
|
17644
|
-
auth: "admin"
|
|
17645
|
-
}), method(object({
|
|
17646
|
-
deviceId: number$1(),
|
|
17647
|
-
trackId: string()
|
|
17648
|
-
}), RetrainTransitionResultSchema, {
|
|
17649
|
-
kind: "mutation",
|
|
17650
|
-
auth: "admin"
|
|
17651
18268
|
}), method(object({
|
|
17652
18269
|
deviceId: number$1(),
|
|
17653
|
-
|
|
17654
|
-
|
|
18270
|
+
source: DetectionSourceSchema,
|
|
18271
|
+
zones: array(ZoneSchema).readonly().optional(),
|
|
18272
|
+
detectionRules: array(ZoneRuleSchema).readonly().optional(),
|
|
18273
|
+
zoneMembershipMinOverlap: number$1().min(0).max(1).optional(),
|
|
18274
|
+
frames: array(ReplayFrameInputSchema).min(1)
|
|
18275
|
+
}), RunReplayFrameProcessorResultSchema, {
|
|
17655
18276
|
kind: "mutation",
|
|
17656
18277
|
auth: "admin"
|
|
17657
|
-
}), method(object({
|
|
18278
|
+
}), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
|
|
17658
18279
|
kind: "query",
|
|
17659
18280
|
auth: "admin"
|
|
17660
18281
|
}), method(object({
|
|
17661
|
-
eventId: string(),
|
|
17662
|
-
kind: MediaFileKindEnum.optional(),
|
|
17663
|
-
deviceId: number$1()
|
|
17664
|
-
}), array(MediaFileSchema).readonly()), method(object({
|
|
17665
|
-
trackId: string(),
|
|
17666
|
-
kinds: array(MediaFileKindEnum).optional(),
|
|
17667
|
-
deviceId: number$1()
|
|
17668
|
-
}), array(MediaFileSchema).readonly()), method(object({
|
|
17669
|
-
trackId: string(),
|
|
17670
|
-
deviceId: number$1()
|
|
17671
|
-
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
17672
|
-
kind: "mutation",
|
|
17673
|
-
auth: "admin"
|
|
17674
|
-
}), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
|
|
17675
|
-
kind: "mutation",
|
|
17676
|
-
auth: "admin"
|
|
17677
|
-
}), method(object({}), RebuildStatusSchema), object({
|
|
17678
|
-
deviceId: number$1(),
|
|
17679
|
-
timestamp: number$1(),
|
|
17680
|
-
frameWidth: number$1(),
|
|
17681
|
-
frameHeight: number$1(),
|
|
17682
|
-
detections: array(OverlayDetectionSchema).readonly()
|
|
17683
|
-
}), object({
|
|
17684
|
-
deviceId: number$1(),
|
|
17685
|
-
trackId: string(),
|
|
17686
|
-
className: string()
|
|
17687
|
-
}), object({
|
|
17688
18282
|
deviceId: number$1(),
|
|
17689
18283
|
trackId: string(),
|
|
17690
|
-
|
|
17691
|
-
|
|
17692
|
-
}),
|
|
17693
|
-
deviceId: number$1(),
|
|
17694
|
-
kind: EventKindSchema,
|
|
17695
|
-
eventId: string(),
|
|
17696
|
-
timestamp: number$1()
|
|
17697
|
-
});
|
|
17698
|
-
/**
|
|
17699
|
-
* Reference to the frame's retained NATIVE surface + the parent crop's placement
|
|
17700
|
-
* within the frame, so the executor can re-cut a leaf child ROI at native
|
|
17701
|
-
* resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
|
|
17702
|
-
*/
|
|
17703
|
-
var NativeCropRefSchema = object({
|
|
17704
|
-
/** Handle keying the retained native surface (node-pinned to its owner). */
|
|
17705
|
-
handle: FrameHandleSchema,
|
|
17706
|
-
/** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
|
|
17707
|
-
cropFrameSpace: object({
|
|
17708
|
-
x: number$1(),
|
|
17709
|
-
y: number$1(),
|
|
17710
|
-
w: number$1(),
|
|
17711
|
-
h: number$1()
|
|
17712
|
-
})
|
|
17713
|
-
});
|
|
17714
|
-
object({
|
|
17715
|
-
crop: object({
|
|
17716
|
-
left: number$1(),
|
|
17717
|
-
top: number$1(),
|
|
17718
|
-
width: number$1().positive(),
|
|
17719
|
-
height: number$1().positive()
|
|
17720
|
-
}).optional(),
|
|
17721
|
-
content: object({
|
|
17722
|
-
width: number$1().int().positive(),
|
|
17723
|
-
height: number$1().int().positive()
|
|
17724
|
-
}),
|
|
17725
|
-
fit: _enum(["stretch", "contain"]),
|
|
17726
|
-
format: _enum([
|
|
17727
|
-
"rgb",
|
|
17728
|
-
"gray",
|
|
17729
|
-
"jpeg"
|
|
17730
|
-
])
|
|
17731
|
-
});
|
|
17732
|
-
/**
|
|
17733
|
-
* Process-local frame identity. It is serializable so it can ride an in-process
|
|
17734
|
-
* capability call, but `registryId` deliberately prevents resolution in any
|
|
17735
|
-
* other process or execution group.
|
|
17736
|
-
*/
|
|
17737
|
-
var FrameRefSchema = object({
|
|
17738
|
-
registryId: string().min(1),
|
|
17739
|
-
id: string().min(1),
|
|
17740
|
-
width: number$1().int().positive(),
|
|
17741
|
-
height: number$1().int().positive(),
|
|
17742
|
-
format: _enum(["rgb", "gray"]),
|
|
17743
|
-
timestamp: number$1(),
|
|
17744
|
-
capturedAt: number$1().optional()
|
|
17745
|
-
});
|
|
17746
|
-
var ModelFormatSchema$1 = _enum([
|
|
17747
|
-
"onnx",
|
|
17748
|
-
"coreml",
|
|
17749
|
-
"openvino",
|
|
17750
|
-
"tflite",
|
|
17751
|
-
"pt",
|
|
17752
|
-
"gguf"
|
|
17753
|
-
]);
|
|
17754
|
-
var PipelineSlotSchema = _enum([
|
|
17755
|
-
"detector",
|
|
17756
|
-
"cropper",
|
|
17757
|
-
"classifier",
|
|
17758
|
-
"refiner",
|
|
17759
|
-
"audio-classifier"
|
|
17760
|
-
]);
|
|
17761
|
-
var PipelineEngineChoiceSchema = object({
|
|
17762
|
-
runtime: _enum(["node", "python"]),
|
|
17763
|
-
backend: string(),
|
|
17764
|
-
format: ModelFormatSchema$1,
|
|
17765
|
-
device: string().optional()
|
|
17766
|
-
});
|
|
17767
|
-
var AvailableEngineSchema = object({
|
|
17768
|
-
engine: PipelineEngineChoiceSchema,
|
|
17769
|
-
devices: array(object({
|
|
17770
|
-
id: string(),
|
|
17771
|
-
label: string(),
|
|
17772
|
-
description: string().optional()
|
|
17773
|
-
})).readonly(),
|
|
17774
|
-
defaultDevice: string()
|
|
17775
|
-
});
|
|
17776
|
-
var PipelineDefaultStepSchema = lazy(() => object({
|
|
17777
|
-
addonId: string(),
|
|
17778
|
-
addonName: string(),
|
|
17779
|
-
slot: PipelineSlotSchema,
|
|
17780
|
-
inputClasses: array(string()).readonly(),
|
|
17781
|
-
outputClasses: array(string()).readonly(),
|
|
17782
|
-
enabled: boolean(),
|
|
17783
|
-
modelId: string(),
|
|
17784
|
-
children: array(PipelineDefaultStepSchema).readonly(),
|
|
17785
|
-
group: string().optional(),
|
|
17786
|
-
settings: record(string(), unknown()).optional()
|
|
17787
|
-
}));
|
|
17788
|
-
var PipelineTemplateStepSchema = lazy(() => object({
|
|
17789
|
-
addonId: string(),
|
|
17790
|
-
enabled: boolean(),
|
|
17791
|
-
modelId: string(),
|
|
17792
|
-
children: array(PipelineTemplateStepSchema).readonly(),
|
|
17793
|
-
settings: record(string(), unknown()).optional()
|
|
17794
|
-
}));
|
|
17795
|
-
var PipelineTemplateSchema$1 = object({
|
|
17796
|
-
id: string(),
|
|
17797
|
-
name: string(),
|
|
17798
|
-
createdAt: string(),
|
|
17799
|
-
updatedAt: string(),
|
|
17800
|
-
engine: PipelineEngineChoiceSchema,
|
|
17801
|
-
steps: array(PipelineTemplateStepSchema).readonly()
|
|
17802
|
-
});
|
|
17803
|
-
var PipelineModelOptionSchema = object({
|
|
17804
|
-
id: string(),
|
|
17805
|
-
name: string(),
|
|
17806
|
-
formats: record(string(), object({
|
|
17807
|
-
downloaded: boolean(),
|
|
17808
|
-
sizeMB: number$1()
|
|
17809
|
-
})),
|
|
17810
|
-
group: ModelVariantGroupSchema.optional(),
|
|
17811
|
-
legacy: boolean().optional(),
|
|
17812
|
-
provider: ModelProviderIdSchema.optional()
|
|
17813
|
-
});
|
|
17814
|
-
var ConfigFieldBridge = custom();
|
|
17815
|
-
var PipelineAddonSchemaSchema = object({
|
|
17816
|
-
id: string(),
|
|
17817
|
-
name: string(),
|
|
17818
|
-
slot: PipelineSlotSchema,
|
|
17819
|
-
inputClasses: array(string()).readonly(),
|
|
17820
|
-
outputClasses: array(string()).readonly(),
|
|
17821
|
-
childSlots: array(PipelineSlotSchema).readonly(),
|
|
17822
|
-
models: array(PipelineModelOptionSchema).readonly(),
|
|
17823
|
-
defaultModelId: string(),
|
|
17824
|
-
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
17825
|
-
enabledByDefault: boolean().optional(),
|
|
17826
|
-
backfillIntoExistingOverrides: boolean().optional(),
|
|
17827
|
-
defaultConfidence: number$1(),
|
|
17828
|
-
group: string().optional(),
|
|
17829
|
-
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
17830
|
-
});
|
|
17831
|
-
var PipelineSlotSchemaSchema = object({
|
|
17832
|
-
id: PipelineSlotSchema,
|
|
17833
|
-
label: string(),
|
|
17834
|
-
priority: number$1(),
|
|
17835
|
-
parentSlot: PipelineSlotSchema.nullable(),
|
|
17836
|
-
addons: array(PipelineAddonSchemaSchema).readonly()
|
|
17837
|
-
});
|
|
17838
|
-
var PipelineSchemaSchema = object({
|
|
17839
|
-
availableEngines: array(AvailableEngineSchema).readonly(),
|
|
17840
|
-
selectedEngine: PipelineEngineChoiceSchema,
|
|
17841
|
-
slots: array(PipelineSlotSchemaSchema).readonly()
|
|
17842
|
-
});
|
|
17843
|
-
var EngineProvisioningSchema = object({
|
|
17844
|
-
runtimeId: _enum([
|
|
17845
|
-
"onnx",
|
|
17846
|
-
"openvino",
|
|
17847
|
-
"coreml",
|
|
17848
|
-
"edgetpu"
|
|
17849
|
-
]).nullable(),
|
|
17850
|
-
device: string().nullable(),
|
|
17851
|
-
state: _enum([
|
|
17852
|
-
"idle",
|
|
17853
|
-
"installing",
|
|
17854
|
-
"verifying",
|
|
17855
|
-
"ready",
|
|
17856
|
-
"failed"
|
|
17857
|
-
]),
|
|
17858
|
-
progress: number$1().optional(),
|
|
17859
|
-
error: string().optional(),
|
|
17860
|
-
nextRetryAt: number$1().optional(),
|
|
17861
|
-
/**
|
|
17862
|
-
* Gate A (config-correctness gate at engine change): human-readable
|
|
17863
|
-
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
17864
|
-
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
17865
|
-
* has a <format> build"). Additive/optional: informational only, never
|
|
17866
|
-
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
17867
|
-
* Absent/empty when the node-default tree resolves cleanly.
|
|
17868
|
-
*/
|
|
17869
|
-
configIssues: array(string()).optional()
|
|
17870
|
-
});
|
|
17871
|
-
var PipelineStepInputSchema = lazy(() => object({
|
|
17872
|
-
addonId: string(),
|
|
17873
|
-
modelId: string().optional(),
|
|
17874
|
-
enabled: boolean().default(true),
|
|
17875
|
-
children: array(PipelineStepInputSchema).optional(),
|
|
17876
|
-
settings: record(string(), unknown()).optional(),
|
|
17877
|
-
jumpDeviceKey: string().optional()
|
|
17878
|
-
}));
|
|
17879
|
-
var ModelSubstitutionSchema = object({
|
|
17880
|
-
addonId: string(),
|
|
17881
|
-
chosen: string(),
|
|
17882
|
-
running: string(),
|
|
17883
|
-
format: string()
|
|
17884
|
-
});
|
|
17885
|
-
var PipelineValidationIssueSchema = object({
|
|
17886
|
-
addonId: string(),
|
|
17887
|
-
kind: _enum(["unknown-addon", "no-format-build"]),
|
|
17888
|
-
detail: string()
|
|
17889
|
-
});
|
|
17890
|
-
var PipelineValidationResultSchema = object({
|
|
17891
|
-
ok: boolean(),
|
|
17892
|
-
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
17893
|
-
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
17894
|
-
/** The node's `currentEngine.format` this validation ran against. */
|
|
17895
|
-
format: string()
|
|
17896
|
-
});
|
|
17897
|
-
var ReferenceImageEntrySchema = object({
|
|
17898
|
-
filename: string(),
|
|
17899
|
-
stepIds: array(string()).readonly().optional()
|
|
17900
|
-
});
|
|
17901
|
-
var ReferenceImageBodySchema = object({
|
|
17902
|
-
base64: string(),
|
|
17903
|
-
filename: string()
|
|
17904
|
-
});
|
|
17905
|
-
var ReferenceAudioEntrySchema = object({
|
|
17906
|
-
filename: string(),
|
|
17907
|
-
sizeKb: number$1()
|
|
17908
|
-
});
|
|
17909
|
-
var ReferenceAudioBodySchema = object({ base64: string() });
|
|
17910
|
-
var AudioBackendSchema = object({
|
|
17911
|
-
id: string(),
|
|
17912
|
-
name: string(),
|
|
17913
|
-
description: string(),
|
|
17914
|
-
available: boolean(),
|
|
17915
|
-
/**
|
|
17916
|
-
* Raw classifier labels this backend can emit (e.g. YAMNet's
|
|
17917
|
-
* 521-class set or Apple SoundAnalysis's 303-class set). Used by
|
|
17918
|
-
* the benchmark UI to populate the `enabledMicroClasses` filter
|
|
17919
|
-
* specific to the selected backend without a separate fetch.
|
|
17920
|
-
*/
|
|
17921
|
-
rawLabels: array(string()).readonly().optional()
|
|
17922
|
-
});
|
|
17923
|
-
var AudioCapabilitiesSchema = object({
|
|
17924
|
-
activeBackend: string(),
|
|
17925
|
-
availableBackends: array(AudioBackendSchema).readonly(),
|
|
17926
|
-
sampleRate: number$1(),
|
|
17927
|
-
chunkDurationMs: number$1()
|
|
17928
|
-
});
|
|
17929
|
-
var DownloadModelResultSchema = object({
|
|
17930
|
-
filePath: string(),
|
|
17931
|
-
sizeMB: number$1(),
|
|
17932
|
-
durationMs: number$1()
|
|
17933
|
-
});
|
|
17934
|
-
/**
|
|
17935
|
-
* Wrapper carrying a single test run's result. Replaces the legacy
|
|
17936
|
-
* ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
|
|
17937
|
-
* canonical `AudioResult` from the Phase 6 output rework: one
|
|
17938
|
-
* `AudioDetection` per class above `minScore`, top-N candidates in
|
|
17939
|
-
* `debug.alternateLabels['audio-classifier']`, per-source timings in
|
|
17940
|
-
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
17941
|
-
* benchmark UI can still report a clean failure when the classifier
|
|
17942
|
-
* cap isn't available.
|
|
17943
|
-
*/
|
|
17944
|
-
var AudioTestResultSchema = object({
|
|
17945
|
-
success: boolean(),
|
|
17946
|
-
error: string().optional(),
|
|
17947
|
-
frame: custom().optional()
|
|
17948
|
-
});
|
|
17949
|
-
var PipelineConfigBridge = custom();
|
|
17950
|
-
var ConfigUISchemaBridge = custom();
|
|
17951
|
-
var ConfigUISchemaNullableBridge = custom();
|
|
17952
|
-
var InferenceCapabilitiesBridge = custom();
|
|
17953
|
-
var ModelAvailabilityListBridge = custom();
|
|
17954
|
-
var PipelineRunResultBridge = custom();
|
|
17955
|
-
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
17956
|
-
modelId: string(),
|
|
17957
|
-
settings: record(string(), unknown()).readonly()
|
|
17958
|
-
}))), method(object({ steps: record(string(), object({
|
|
17959
|
-
modelId: string(),
|
|
17960
|
-
settings: record(string(), unknown()).readonly()
|
|
17961
|
-
})) }), object({ success: literal(true) }), {
|
|
17962
|
-
kind: "mutation",
|
|
17963
|
-
auth: "admin"
|
|
17964
|
-
}), method(object({ nodeId: string() }), object({
|
|
17965
|
-
success: literal(true),
|
|
17966
|
-
clearedDevices: number$1()
|
|
17967
|
-
}), {
|
|
17968
|
-
kind: "mutation",
|
|
17969
|
-
auth: "admin"
|
|
17970
|
-
}), 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({
|
|
17971
|
-
name: string(),
|
|
17972
|
-
steps: array(PipelineTemplateStepSchema).readonly(),
|
|
17973
|
-
engine: PipelineEngineChoiceSchema
|
|
17974
|
-
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
|
|
17975
|
-
id: string(),
|
|
17976
|
-
name: string().optional(),
|
|
17977
|
-
steps: array(PipelineTemplateStepSchema).readonly().optional()
|
|
17978
|
-
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
|
|
17979
|
-
addonId: string(),
|
|
17980
|
-
modelId: string(),
|
|
17981
|
-
format: ModelFormatSchema$1
|
|
17982
|
-
}), DownloadModelResultSchema, { kind: "mutation" }), method(object({
|
|
17983
|
-
addonId: string(),
|
|
17984
|
-
modelId: string(),
|
|
17985
|
-
format: ModelFormatSchema$1
|
|
17986
|
-
}), object({ success: literal(true) }), { kind: "mutation" }), method(object({
|
|
17987
|
-
engine: PipelineEngineChoiceSchema.optional(),
|
|
17988
|
-
steps: array(PipelineStepInputSchema).min(1),
|
|
17989
|
-
frame: FrameInputSchema.optional(),
|
|
17990
|
-
/**
|
|
17991
|
-
* Process-local lazy frame. Valid only when caller and provider resolve
|
|
17992
|
-
* in the same execution-group process; split/cross-node callers use
|
|
17993
|
-
* `frame`/`image` inline compatibility instead.
|
|
17994
|
-
*/
|
|
17995
|
-
frameRef: FrameRefSchema.optional(),
|
|
17996
|
-
/**
|
|
17997
|
-
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
17998
|
-
* the decoded pixels live in. One more member of the one-of
|
|
17999
|
-
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
18000
|
-
*/
|
|
18001
|
-
frameHandle: FrameHandleSchema.optional(),
|
|
18002
|
-
imageBase64: string().optional(),
|
|
18003
|
-
/**
|
|
18004
|
-
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
18005
|
-
* hops (hub → forked worker via Moleculer MsgPack) because it
|
|
18006
|
-
* skips the 33% base64 overhead + the per-call base64 decode on
|
|
18007
|
-
* the detection-pipeline worker. Callers can pass either; exactly
|
|
18008
|
-
* one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
|
|
18009
|
-
*/
|
|
18010
|
-
image: _instanceof(Uint8Array).optional(),
|
|
18011
|
-
referenceImage: string().optional(),
|
|
18012
|
-
deviceId: number$1().optional(),
|
|
18013
|
-
sessionId: string().optional(),
|
|
18014
|
-
/**
|
|
18015
|
-
* Execution plane. 'full' (default) runs the whole tree — benchmark,
|
|
18016
|
-
* reference-image, and detail-subtree calls. 'frame' is the live
|
|
18017
|
-
* per-frame dispatch: ONLY root-plane steps run; crop children
|
|
18018
|
-
* (inputClasses ≠ null) are skipped and served per-track via
|
|
18019
|
-
* pipelineRunner.runDetailSubtree (two-plane design).
|
|
18020
|
-
*/
|
|
18021
|
-
plane: _enum(["full", "frame"]).optional(),
|
|
18022
|
-
/**
|
|
18023
|
-
* Inference-device selector (Phase 2 multi-device). Format
|
|
18024
|
-
* `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
|
|
18025
|
-
* Omitted ⇒ the runner's default device (current single-engine
|
|
18026
|
-
* behaviour). Selects WHICH device pool of the node runs the call.
|
|
18027
|
-
*/
|
|
18028
|
-
deviceKey: string().optional(),
|
|
18029
|
-
/**
|
|
18030
|
-
* Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
|
|
18031
|
-
* when the parent crop was resolved from the frame's retained NATIVE
|
|
18032
|
-
* surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
|
|
18033
|
-
* child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
|
|
18034
|
-
* resolution from that surface — the SAME quality path faces already
|
|
18035
|
-
* had — instead of the downscaled parent tile. `handle` keys the native
|
|
18036
|
-
* surface (node-pinned to its owner); `cropFrameSpace` is the parent
|
|
18037
|
-
* crop's padded/clamped rectangle in FRAME-space pixels, used to compose
|
|
18038
|
-
* the executor's crop-normalized child ROI back into frame-normalized
|
|
18039
|
-
* coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
|
|
18040
|
-
* of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
|
|
18041
|
-
* (today's behaviour on the fallback path).
|
|
18042
|
-
*/
|
|
18043
|
-
nativeCropRef: NativeCropRefSchema.optional()
|
|
18044
|
-
}), PipelineRunResultBridge, { kind: "mutation" }), method(object({
|
|
18045
|
-
engine: PipelineEngineChoiceSchema.optional(),
|
|
18046
|
-
steps: array(PipelineStepInputSchema).min(1),
|
|
18047
|
-
frames: array(FrameInputSchema).min(1).max(255),
|
|
18048
|
-
deviceId: number$1().optional(),
|
|
18049
|
-
sessionId: string().optional(),
|
|
18050
|
-
/**
|
|
18051
|
-
* Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
|
|
18052
|
-
* the batch to the Python pool's bench preprocess cache
|
|
18053
|
-
* (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
|
|
18054
|
-
* preprocessed ONCE and every later inference is a pure-inference cache
|
|
18055
|
-
* hit — the sustained-throughput run measures inference, not
|
|
18056
|
-
* decode+preprocess+infer. Omitted/0 for live frames (all different →
|
|
18057
|
-
* full preprocess every call, correct). Fresh per sustained run;
|
|
18058
|
-
* released via `uncacheFrame`.
|
|
18059
|
-
*/
|
|
18060
|
-
frameId: number$1().int().nonnegative().optional(),
|
|
18061
|
-
/** Inference-device selector (Phase 2 multi-device); see runPipeline. */
|
|
18062
|
-
deviceKey: string().optional()
|
|
18063
|
-
}), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
|
|
18064
|
-
data: _instanceof(Uint8Array),
|
|
18065
|
-
width: number$1().int().positive(),
|
|
18066
|
-
height: number$1().int().positive(),
|
|
18067
|
-
format: _enum([
|
|
18068
|
-
"rgb",
|
|
18069
|
-
"bgr",
|
|
18070
|
-
"gray"
|
|
18071
|
-
])
|
|
18072
|
-
}), object({
|
|
18073
|
-
frameId: number$1(),
|
|
18074
|
-
width: number$1(),
|
|
18075
|
-
height: number$1()
|
|
18076
|
-
}), { kind: "mutation" }), method(object({
|
|
18077
|
-
stepId: string(),
|
|
18078
|
-
frameId: number$1().int()
|
|
18079
|
-
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number$1().int() }), _void(), { kind: "mutation" }), method(_void(), object({
|
|
18080
|
-
batchMode: string(),
|
|
18081
|
-
windowMs: number$1(),
|
|
18082
|
-
maxBatchSize: number$1(),
|
|
18083
|
-
concurrency: number$1()
|
|
18084
|
-
})), method(_void(), array(object({
|
|
18085
|
-
engineKey: string(),
|
|
18086
|
-
engine: PipelineEngineChoiceSchema,
|
|
18087
|
-
modelsLoaded: array(string()).readonly(),
|
|
18088
|
-
inUseByCameras: array(number$1()).readonly(),
|
|
18089
|
-
/**
|
|
18090
|
-
* Origin of this resident factory.
|
|
18091
|
-
* - `runtime` — main camera-serving engine (no idle TTL).
|
|
18092
|
-
* - `warm-override` — benchmark/test override held in the warm
|
|
18093
|
-
* cache; auto-disposed after the idle TTL.
|
|
18094
|
-
* - `device-pool` — a concurrent per-device pool (Phase 2
|
|
18095
|
-
* multi-device, keyed by `deviceKey`) resolved
|
|
18096
|
-
* via `resolveDeviceFactory`. Runs alongside the
|
|
18097
|
-
* `runtime` engine on a DIFFERENT accelerator
|
|
18098
|
-
* (NPU / iGPU / Coral) — this is how the
|
|
18099
|
-
* Engines tab shows all pools running at once.
|
|
18100
|
-
*/
|
|
18101
|
-
kind: _enum([
|
|
18102
|
-
"runtime",
|
|
18103
|
-
"warm-override",
|
|
18104
|
-
"device-pool"
|
|
18105
|
-
]),
|
|
18106
|
-
/** Native pid of the underlying Python pool (null when no pool). */
|
|
18107
|
-
poolPid: number$1().nullable(),
|
|
18108
|
-
/** ms since this factory was last used (null when not warm-tracked). */
|
|
18109
|
-
idleMs: number$1().nullable(),
|
|
18110
|
-
/** Idle TTL after which `warm-override` factories self-evict (null when not applicable). */
|
|
18111
|
-
idleTtlMs: number$1().nullable()
|
|
18112
|
-
})).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
|
|
18284
|
+
frameId: string(),
|
|
18285
|
+
annotations: array(RetrainAnnotationDraftSchema)
|
|
18286
|
+
}), array(RetrainAnnotationSchema).readonly(), {
|
|
18113
18287
|
kind: "mutation",
|
|
18114
18288
|
auth: "admin"
|
|
18115
18289
|
}), method(object({
|
|
18116
|
-
|
|
18117
|
-
|
|
18118
|
-
}),
|
|
18119
|
-
success: boolean(),
|
|
18120
|
-
reason: string().optional()
|
|
18121
|
-
}), {
|
|
18290
|
+
deviceId: number$1(),
|
|
18291
|
+
trackId: string()
|
|
18292
|
+
}), RetrainTransitionResultSchema, {
|
|
18122
18293
|
kind: "mutation",
|
|
18123
18294
|
auth: "admin"
|
|
18124
|
-
}), method(
|
|
18125
|
-
|
|
18126
|
-
|
|
18127
|
-
|
|
18128
|
-
|
|
18129
|
-
|
|
18295
|
+
}), method(object({
|
|
18296
|
+
deviceId: number$1(),
|
|
18297
|
+
trackId: string()
|
|
18298
|
+
}), RetrainTransitionResultSchema, {
|
|
18299
|
+
kind: "mutation",
|
|
18300
|
+
auth: "admin"
|
|
18301
|
+
}), method(object({ deviceIds: array(number$1()).optional() }), object({ url: string() }), {
|
|
18302
|
+
kind: "query",
|
|
18303
|
+
auth: "admin"
|
|
18304
|
+
}), method(object({
|
|
18305
|
+
eventId: string(),
|
|
18306
|
+
kind: MediaFileKindEnum.optional(),
|
|
18307
|
+
deviceId: number$1()
|
|
18308
|
+
}), array(MediaFileSchema).readonly()), method(object({
|
|
18309
|
+
trackId: string(),
|
|
18310
|
+
kinds: array(MediaFileKindEnum).optional(),
|
|
18311
|
+
deviceId: number$1()
|
|
18312
|
+
}), array(MediaFileSchema).readonly()), method(object({
|
|
18313
|
+
trackId: string(),
|
|
18314
|
+
deviceId: number$1()
|
|
18315
|
+
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
18316
|
+
kind: "mutation",
|
|
18317
|
+
auth: "admin"
|
|
18318
|
+
}), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
|
|
18319
|
+
kind: "mutation",
|
|
18320
|
+
auth: "admin"
|
|
18321
|
+
}), method(object({}), RebuildStatusSchema), object({
|
|
18322
|
+
deviceId: number$1(),
|
|
18323
|
+
timestamp: number$1(),
|
|
18324
|
+
frameWidth: number$1(),
|
|
18325
|
+
frameHeight: number$1(),
|
|
18326
|
+
detections: array(OverlayDetectionSchema).readonly()
|
|
18327
|
+
}), object({
|
|
18328
|
+
deviceId: number$1(),
|
|
18329
|
+
trackId: string(),
|
|
18330
|
+
className: string()
|
|
18331
|
+
}), object({
|
|
18332
|
+
deviceId: number$1(),
|
|
18333
|
+
trackId: string(),
|
|
18334
|
+
className: string(),
|
|
18335
|
+
durationMs: number$1()
|
|
18336
|
+
}), object({
|
|
18337
|
+
deviceId: number$1(),
|
|
18338
|
+
kind: EventKindSchema,
|
|
18339
|
+
eventId: string(),
|
|
18340
|
+
timestamp: number$1()
|
|
18341
|
+
});
|
|
18130
18342
|
object({
|
|
18131
18343
|
activeCameras: number$1(),
|
|
18132
18344
|
throttledCameras: number$1(),
|
|
@@ -18152,66 +18364,6 @@ var CameraMetricsSchema = object({
|
|
|
18152
18364
|
});
|
|
18153
18365
|
var CameraMetricsWithDeviceIdSchema = CameraMetricsSchema.extend({ deviceId: number$1() });
|
|
18154
18366
|
/**
|
|
18155
|
-
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
18156
|
-
*
|
|
18157
|
-
* Zones describe **where** in the frame the operator wants to flag
|
|
18158
|
-
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
18159
|
-
* each pipeline stage uses them. Splitting the two means a single
|
|
18160
|
-
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
18161
|
-
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
18162
|
-
* — without three duplicated polygons.
|
|
18163
|
-
*
|
|
18164
|
-
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
18165
|
-
* `zones` device-state slice on every mutation. Consumers
|
|
18166
|
-
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
18167
|
-
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
18168
|
-
* mirror with `onChanged`).
|
|
18169
|
-
*
|
|
18170
|
-
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
18171
|
-
* survive resolution changes and stream profile switches.
|
|
18172
|
-
*
|
|
18173
|
-
* `kind` discriminates between full polygons (closed regions used
|
|
18174
|
-
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
18175
|
-
* line segments used for cross events). Onboard / firmware-reported
|
|
18176
|
-
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
18177
|
-
* task list.
|
|
18178
|
-
*/
|
|
18179
|
-
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
18180
|
-
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
18181
|
-
var PolygonPointSchema = object({
|
|
18182
|
-
x: number$1(),
|
|
18183
|
-
y: number$1()
|
|
18184
|
-
});
|
|
18185
|
-
/** A camera detection zone — pure geometry/identity. */
|
|
18186
|
-
var ZoneSchema = object({
|
|
18187
|
-
id: string(),
|
|
18188
|
-
name: string(),
|
|
18189
|
-
kind: ZoneKindEnum.default("polygon"),
|
|
18190
|
-
/** Polygon vertices, fraction of frame (0–1). */
|
|
18191
|
-
polygon: array(PolygonPointSchema).readonly(),
|
|
18192
|
-
/** Visual color for UI rendering. */
|
|
18193
|
-
color: string().default("#3b82f6")
|
|
18194
|
-
});
|
|
18195
|
-
DeviceType.Camera, method(object({ deviceId: number$1() }), array(ZoneSchema).readonly()), method(object({
|
|
18196
|
-
deviceId: number$1(),
|
|
18197
|
-
zone: ZoneSchema
|
|
18198
|
-
}), _void(), {
|
|
18199
|
-
kind: "mutation",
|
|
18200
|
-
auth: "admin"
|
|
18201
|
-
}), method(object({
|
|
18202
|
-
deviceId: number$1(),
|
|
18203
|
-
zoneId: string()
|
|
18204
|
-
}), _void(), {
|
|
18205
|
-
kind: "mutation",
|
|
18206
|
-
auth: "admin"
|
|
18207
|
-
}), method(object({
|
|
18208
|
-
deviceId: number$1(),
|
|
18209
|
-
zone: ZoneSchema
|
|
18210
|
-
}), _void(), {
|
|
18211
|
-
kind: "mutation",
|
|
18212
|
-
auth: "admin"
|
|
18213
|
-
}), object({ zones: array(ZoneSchema).readonly() });
|
|
18214
|
-
/**
|
|
18215
18367
|
* A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
|
|
18216
18368
|
* decode worker resolves it against the RETAINED native frame's real pixel dims,
|
|
18217
18369
|
* so the caller supplies only the detection-res bbox divided by the detection
|
|
@@ -25189,6 +25341,39 @@ var ReadGopBytesResultSchema = object({
|
|
|
25189
25341
|
/** Media ms the returned fragment covers. */
|
|
25190
25342
|
gopDurMs: number$1()
|
|
25191
25343
|
});
|
|
25344
|
+
/**
|
|
25345
|
+
* A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
|
|
25346
|
+
* twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
|
|
25347
|
+
* replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
|
|
25348
|
+
* a replay needs several seconds of native pixels, not one frame.
|
|
25349
|
+
*
|
|
25350
|
+
* `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
|
|
25351
|
+
* is `false` when the returned bytes were cut short by the read's own safety
|
|
25352
|
+
* byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
|
|
25353
|
+
* silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
|
|
25354
|
+
* degradation: a window whose end falls past the covering segment would need
|
|
25355
|
+
* bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
|
|
25356
|
+
* not one standalone-demuxable stream — the caller's answer is to request a
|
|
25357
|
+
* shorter window or one aligned to a single segment, not to receive spliced
|
|
25358
|
+
* bytes nothing has proven decodable.
|
|
25359
|
+
*/
|
|
25360
|
+
var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
|
|
25361
|
+
kind: literal("ok"),
|
|
25362
|
+
data: _instanceof(Uint8Array),
|
|
25363
|
+
/** Absolute epoch ms of the returned bytes' first sample — at or before
|
|
25364
|
+
* the requested `fromMs` (anchored on the nearest keyframe). */
|
|
25365
|
+
gopStartMs: number$1(),
|
|
25366
|
+
/** Media ms the returned bytes cover, from `gopStartMs`. */
|
|
25367
|
+
gopDurMs: number$1(),
|
|
25368
|
+
/** `false` ⇒ the safety byte cap cut the read short before it reached
|
|
25369
|
+
* the requested `toMs`; the caller got fewer frames than asked for. */
|
|
25370
|
+
reachesRequestedEnd: boolean()
|
|
25371
|
+
}), object({
|
|
25372
|
+
kind: literal("spans-multiple-segments"),
|
|
25373
|
+
/** Where the covering segment's own footage runs out — informational,
|
|
25374
|
+
* not a retry hint (retrying the same window would refuse again). */
|
|
25375
|
+
segmentEndMs: number$1()
|
|
25376
|
+
})]);
|
|
25192
25377
|
method(object({
|
|
25193
25378
|
deviceId: number$1(),
|
|
25194
25379
|
fromMs: number$1(),
|
|
@@ -25239,6 +25424,15 @@ method(object({
|
|
|
25239
25424
|
}), ReadGopBytesResultSchema, {
|
|
25240
25425
|
kind: "query",
|
|
25241
25426
|
auth: "admin"
|
|
25427
|
+
}), method(object({
|
|
25428
|
+
deviceId: number$1(),
|
|
25429
|
+
profile: string(),
|
|
25430
|
+
startMs: number$1(),
|
|
25431
|
+
fromMs: number$1(),
|
|
25432
|
+
toMs: number$1()
|
|
25433
|
+
}), ReadWindowBytesResultSchema, {
|
|
25434
|
+
kind: "query",
|
|
25435
|
+
auth: "admin"
|
|
25242
25436
|
}), method(object({
|
|
25243
25437
|
deviceId: number$1(),
|
|
25244
25438
|
config: RecordingConfigSchema
|
|
@@ -25793,92 +25987,6 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), SceneMonitorStatusSc
|
|
|
25793
25987
|
kind: "mutation",
|
|
25794
25988
|
auth: "admin"
|
|
25795
25989
|
});
|
|
25796
|
-
/**
|
|
25797
|
-
* Per-stage gating mode applied to the zones a rule references.
|
|
25798
|
-
*
|
|
25799
|
-
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
25800
|
-
* When at least one `include` rule fires for a stage, only entities
|
|
25801
|
-
* inside one of those zones pass that stage.
|
|
25802
|
-
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
25803
|
-
* Entities inside one of those zones are dropped at that stage.
|
|
25804
|
-
*
|
|
25805
|
-
* `monitor`-style observation (count without filtering) is not a rule
|
|
25806
|
-
* mode — zones without any matching rule are observed naturally by
|
|
25807
|
-
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
25808
|
-
* count, not filter" use case needs no rule at all.
|
|
25809
|
-
*/
|
|
25810
|
-
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
25811
|
-
/**
|
|
25812
|
-
* Per-consumer rule that references existing zones (geometry) and
|
|
25813
|
-
* defines how a specific pipeline stage should treat them. Each
|
|
25814
|
-
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
25815
|
-
* settings:
|
|
25816
|
-
*
|
|
25817
|
-
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
25818
|
-
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
25819
|
-
* - future: notification rules, audio gating, etc.
|
|
25820
|
-
*
|
|
25821
|
-
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
25822
|
-
* express "ignore motion in ALL of {garden, street}" with a single
|
|
25823
|
-
* rule. `classFilter` narrows the rule to specific object classes —
|
|
25824
|
-
* "drop person detections in the street, but keep cars" is one
|
|
25825
|
-
* `exclude` rule with `classFilter: ['person']`.
|
|
25826
|
-
*
|
|
25827
|
-
* `enabled` is a soft toggle — the operator can keep the rule
|
|
25828
|
-
* configured but inert without deleting it.
|
|
25829
|
-
*/
|
|
25830
|
-
var ZoneRuleSchema = object({
|
|
25831
|
-
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
25832
|
-
id: string(),
|
|
25833
|
-
/** Optional human-readable label rendered in the rule editor. */
|
|
25834
|
-
name: string().optional(),
|
|
25835
|
-
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
25836
|
-
* listed zones (OR-set: a detection in any one of them counts).
|
|
25837
|
-
* At least one zone id required — a rule with no targets is a
|
|
25838
|
-
* configuration mistake and the form validator rejects it. */
|
|
25839
|
-
zoneIds: array(string()).min(1).readonly(),
|
|
25840
|
-
mode: ZoneRuleModeEnum,
|
|
25841
|
-
/**
|
|
25842
|
-
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
25843
|
-
* applies to every class. Class strings match the `macroClass`
|
|
25844
|
-
* field on detections (e.g. `person`, `car`, `dog`).
|
|
25845
|
-
*/
|
|
25846
|
-
classFilter: array(string()).readonly().optional(),
|
|
25847
|
-
/**
|
|
25848
|
-
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
25849
|
-
* required to consider an entity "in the zone". Defaults to the
|
|
25850
|
-
* consumer's stage default when omitted. Kept for back-compat with
|
|
25851
|
-
* existing per-rule overrides; new operators pick the value via
|
|
25852
|
-
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
25853
|
-
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
25854
|
-
*/
|
|
25855
|
-
overlapThreshold: number$1().min(0).max(1).optional(),
|
|
25856
|
-
/**
|
|
25857
|
-
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
25858
|
-
* of the detection's bbox that must lie inside the zone for the
|
|
25859
|
-
* rule to match. Documented default is 85%; the engine substitutes
|
|
25860
|
-
* that when the field is omitted (kept optional so existing rules
|
|
25861
|
-
* stored without it stay valid).
|
|
25862
|
-
*
|
|
25863
|
-
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
25864
|
-
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
25865
|
-
* field exposed in the UI. Internally both feed the same gate.
|
|
25866
|
-
*/
|
|
25867
|
-
bboxInclusionPct: number$1().min(0).max(100).optional(),
|
|
25868
|
-
/**
|
|
25869
|
-
* When `true` and a detection has a segmentation mask, use the
|
|
25870
|
-
* mask for overlap instead of the bbox. Detection-stage only;
|
|
25871
|
-
* motion rules ignore this field.
|
|
25872
|
-
*/
|
|
25873
|
-
preferMask: boolean().optional(),
|
|
25874
|
-
/**
|
|
25875
|
-
* Soft-toggle: `false` disables the rule without deleting it.
|
|
25876
|
-
* Defaults to `true` so operators creating a rule via the UI
|
|
25877
|
-
* see it active immediately.
|
|
25878
|
-
*/
|
|
25879
|
-
enabled: boolean().default(true)
|
|
25880
|
-
});
|
|
25881
|
-
array(ZoneRuleSchema).readonly();
|
|
25882
25990
|
object({
|
|
25883
25991
|
/** Whether the script is currently executing. */
|
|
25884
25992
|
isRunning: boolean(),
|
|
@@ -29743,6 +29851,12 @@ Object.freeze({
|
|
|
29743
29851
|
addonId: null,
|
|
29744
29852
|
access: "view"
|
|
29745
29853
|
},
|
|
29854
|
+
"notificationRules.resolveArtifactUrl": {
|
|
29855
|
+
capName: "notification-rules",
|
|
29856
|
+
capScope: "system",
|
|
29857
|
+
addonId: null,
|
|
29858
|
+
access: "view"
|
|
29859
|
+
},
|
|
29746
29860
|
"notificationRules.setAlarmConfig": {
|
|
29747
29861
|
capName: "notification-rules",
|
|
29748
29862
|
capScope: "system",
|
|
@@ -30187,6 +30301,12 @@ Object.freeze({
|
|
|
30187
30301
|
addonId: null,
|
|
30188
30302
|
access: "create"
|
|
30189
30303
|
},
|
|
30304
|
+
"pipelineAnalytics.runReplayFrameProcessor": {
|
|
30305
|
+
capName: "pipeline-analytics",
|
|
30306
|
+
capScope: "device",
|
|
30307
|
+
addonId: null,
|
|
30308
|
+
access: "create"
|
|
30309
|
+
},
|
|
30190
30310
|
"pipelineAnalytics.saveRetrainAnnotations": {
|
|
30191
30311
|
capName: "pipeline-analytics",
|
|
30192
30312
|
capScope: "device",
|
|
@@ -30319,6 +30439,12 @@ Object.freeze({
|
|
|
30319
30439
|
addonId: null,
|
|
30320
30440
|
access: "view"
|
|
30321
30441
|
},
|
|
30442
|
+
"pipelineExecutor.getInferenceDeviceHealth": {
|
|
30443
|
+
capName: "pipeline-executor",
|
|
30444
|
+
capScope: "system",
|
|
30445
|
+
addonId: null,
|
|
30446
|
+
access: "view"
|
|
30447
|
+
},
|
|
30322
30448
|
"pipelineExecutor.getOrchestratorConfigSchema": {
|
|
30323
30449
|
capName: "pipeline-executor",
|
|
30324
30450
|
capScope: "system",
|
|
@@ -30391,6 +30517,12 @@ Object.freeze({
|
|
|
30391
30517
|
addonId: null,
|
|
30392
30518
|
access: "view"
|
|
30393
30519
|
},
|
|
30520
|
+
"pipelineExecutor.rearmInferenceDevice": {
|
|
30521
|
+
capName: "pipeline-executor",
|
|
30522
|
+
capScope: "system",
|
|
30523
|
+
addonId: null,
|
|
30524
|
+
access: "create"
|
|
30525
|
+
},
|
|
30394
30526
|
"pipelineExecutor.runAudioTest": {
|
|
30395
30527
|
capName: "pipeline-executor",
|
|
30396
30528
|
capScope: "system",
|
|
@@ -31129,6 +31261,12 @@ Object.freeze({
|
|
|
31129
31261
|
addonId: null,
|
|
31130
31262
|
access: "view"
|
|
31131
31263
|
},
|
|
31264
|
+
"recording.readWindowBytes": {
|
|
31265
|
+
capName: "recording",
|
|
31266
|
+
capScope: "system",
|
|
31267
|
+
addonId: null,
|
|
31268
|
+
access: "view"
|
|
31269
|
+
},
|
|
31132
31270
|
"recording.refreshStorageLocationsForMigration": {
|
|
31133
31271
|
capName: "recording",
|
|
31134
31272
|
capScope: "system",
|
|
@@ -33639,6 +33777,11 @@ Object.freeze({
|
|
|
33639
33777
|
form: "single",
|
|
33640
33778
|
optional: false
|
|
33641
33779
|
}],
|
|
33780
|
+
"pipelineAnalytics.runReplayFrameProcessor": [{
|
|
33781
|
+
name: "deviceId",
|
|
33782
|
+
form: "single",
|
|
33783
|
+
optional: false
|
|
33784
|
+
}],
|
|
33642
33785
|
"pipelineAnalytics.saveRetrainAnnotations": [{
|
|
33643
33786
|
name: "deviceId",
|
|
33644
33787
|
form: "single",
|
|
@@ -33954,6 +34097,11 @@ Object.freeze({
|
|
|
33954
34097
|
form: "single",
|
|
33955
34098
|
optional: false
|
|
33956
34099
|
}],
|
|
34100
|
+
"recording.readWindowBytes": [{
|
|
34101
|
+
name: "deviceId",
|
|
34102
|
+
form: "single",
|
|
34103
|
+
optional: false
|
|
34104
|
+
}],
|
|
33957
34105
|
"recording.relocateFootage": [{
|
|
33958
34106
|
name: "deviceId",
|
|
33959
34107
|
form: "single",
|