@camstack/addon-agent-ui 1.2.147 → 1.2.149
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
CHANGED
|
@@ -5361,7 +5361,7 @@ var ZodIssueCode = {
|
|
|
5361
5361
|
var ZodFirstPartyTypeKind;
|
|
5362
5362
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5363
5363
|
//#endregion
|
|
5364
|
-
//#region ../types/dist/sleep-
|
|
5364
|
+
//#region ../types/dist/sleep-BXv0ZcRa.mjs
|
|
5365
5365
|
/**
|
|
5366
5366
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5367
5367
|
* window to float samples (D455).
|
|
@@ -6146,6 +6146,40 @@ var BaseAddon = class {
|
|
|
6146
6146
|
const node = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6147
6147
|
return keys.size > 0 ? projectStore(raw, keys, node) : raw;
|
|
6148
6148
|
}
|
|
6149
|
+
/**
|
|
6150
|
+
* Whether ONE global key of this addon's store was written, read three-way
|
|
6151
|
+
* (D651). For a question a hydrated view cannot answer: `getGlobalSettings`
|
|
6152
|
+
* reports `value ?? default`, so "the operator chose the default" and "nobody
|
|
6153
|
+
* chose" look the same, and a failed read looks like both. A `perNode` key is
|
|
6154
|
+
* not supported here: its stored name is scoped.
|
|
6155
|
+
*/
|
|
6156
|
+
async readStoredGlobalKey(key) {
|
|
6157
|
+
const read = this._ctx?.settings?.readAddonStoreResult;
|
|
6158
|
+
if (read === void 0) return {
|
|
6159
|
+
kind: "unreadable",
|
|
6160
|
+
reason: "three-way-read-unavailable"
|
|
6161
|
+
};
|
|
6162
|
+
let result;
|
|
6163
|
+
try {
|
|
6164
|
+
result = await read.call(this._ctx?.settings);
|
|
6165
|
+
} catch (err) {
|
|
6166
|
+
return {
|
|
6167
|
+
kind: "unreadable",
|
|
6168
|
+
reason: "store-read-failed",
|
|
6169
|
+
error: err instanceof Error ? err.message : String(err)
|
|
6170
|
+
};
|
|
6171
|
+
}
|
|
6172
|
+
if (result.kind === "failed") return {
|
|
6173
|
+
kind: "unreadable",
|
|
6174
|
+
reason: "store-read-failed",
|
|
6175
|
+
error: result.error
|
|
6176
|
+
};
|
|
6177
|
+
if (result.kind === "missing" || !Object.prototype.hasOwnProperty.call(result.value, key)) return { kind: "absent" };
|
|
6178
|
+
return {
|
|
6179
|
+
kind: "present",
|
|
6180
|
+
value: result.value[key]
|
|
6181
|
+
};
|
|
6182
|
+
}
|
|
6149
6183
|
async updateGlobalSettings(patch, nodeId) {
|
|
6150
6184
|
const keys = this.perNodeKeys();
|
|
6151
6185
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
@@ -9406,6 +9440,43 @@ var LogChannelWindowSchema = object({
|
|
|
9406
9440
|
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
9407
9441
|
deviceIds: array(number().int()).readonly().nullable()
|
|
9408
9442
|
});
|
|
9443
|
+
var ClipModelMetaSchema = object({
|
|
9444
|
+
/** The paired text encoder's catalog id (the embedding-encoder's text catalog). */
|
|
9445
|
+
textModelId: string().min(1),
|
|
9446
|
+
/** Output dimension of BOTH towers. A vector of any other length is refused. */
|
|
9447
|
+
embeddingDim: number().int().positive(),
|
|
9448
|
+
/**
|
|
9449
|
+
* The `vector-store` index this model's vectors live in. ONE feature space
|
|
9450
|
+
* per index: two models share an index only when their vectors are ranked
|
|
9451
|
+
* against each other, which for CLIP means never across families. MobileCLIP
|
|
9452
|
+
* S1 and S2 share `object-clip` for history (separated by the row's
|
|
9453
|
+
* `modelId`); any other model gets its own.
|
|
9454
|
+
*/
|
|
9455
|
+
vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
|
|
9456
|
+
/**
|
|
9457
|
+
* The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
|
|
9458
|
+
* must be unique per tokenizer: every model's siblings land in ONE flat
|
|
9459
|
+
* models directory, so two different tokenizers under the same name would
|
|
9460
|
+
* silently overwrite each other (whichever model downloaded last wins, and
|
|
9461
|
+
* the other one tokenises with the wrong vocabulary).
|
|
9462
|
+
*/
|
|
9463
|
+
tokenizerFile: string().min(1),
|
|
9464
|
+
/** Token window the text graph takes (SigLIP2: 64; CLIP BPE: 77). */
|
|
9465
|
+
contextLength: number().int().positive(),
|
|
9466
|
+
/** Id the tokenizer pads with. */
|
|
9467
|
+
padId: number().int().nonnegative(),
|
|
9468
|
+
/**
|
|
9469
|
+
* The search cosine floor at `strictness: 'loose'` — calibrated per model,
|
|
9470
|
+
* because cosine bands are a property of the model: 0.2 keeps 96% of matched
|
|
9471
|
+
* COCO caption-image pairs on MobileCLIP S1 and 2.7% on SigLIP2.
|
|
9472
|
+
*/
|
|
9473
|
+
searchMinScore: number().min(0).max(1)
|
|
9474
|
+
});
|
|
9475
|
+
var ClipSearchStrictnessSchema = _enum([
|
|
9476
|
+
"loose",
|
|
9477
|
+
"balanced",
|
|
9478
|
+
"strict"
|
|
9479
|
+
]);
|
|
9409
9480
|
var MODEL_FORMATS = [
|
|
9410
9481
|
"onnx",
|
|
9411
9482
|
"coreml",
|
|
@@ -9434,7 +9505,7 @@ var ModelFormatEntrySchema = object({
|
|
|
9434
9505
|
/** Multi-file payload (directory members or sibling files). */
|
|
9435
9506
|
files: array(string()).readonly().optional(),
|
|
9436
9507
|
/** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
|
|
9437
|
-
runtimes: array(_enum(["
|
|
9508
|
+
runtimes: array(_enum(["python"])).readonly().optional()
|
|
9438
9509
|
});
|
|
9439
9510
|
/**
|
|
9440
9511
|
* Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
|
|
@@ -9515,10 +9586,17 @@ var ModelCatalogEntrySchema = object({
|
|
|
9515
9586
|
inputChannels: number().int().positive().optional(),
|
|
9516
9587
|
labels: array(LabelDefinitionSchema).readonly(),
|
|
9517
9588
|
inputLayout: _enum(["nchw", "nhwc"]).optional(),
|
|
9589
|
+
/**
|
|
9590
|
+
* `'scrfd'` applies InsightFace's SCRFD input contract, `(x - 127.5) / 128`
|
|
9591
|
+
* (upstream `insightface/model_zoo/scrfd.py`), instead of the historical
|
|
9592
|
+
* plain `/255`. Measured against COCO GT: 188 → 196 faces found on the
|
|
9593
|
+
* `scrfd-2.5g` catalog entry (2026-09-26 model-replacement spike, §2.4-2).
|
|
9594
|
+
*/
|
|
9518
9595
|
inputNormalization: _enum([
|
|
9519
9596
|
"zero-one",
|
|
9520
9597
|
"imagenet",
|
|
9521
|
-
"none"
|
|
9598
|
+
"none",
|
|
9599
|
+
"scrfd"
|
|
9522
9600
|
]).optional(),
|
|
9523
9601
|
/**
|
|
9524
9602
|
* The model already applies softmax IN-GRAPH — its raw output is a
|
|
@@ -9602,7 +9680,14 @@ var ModelCatalogEntrySchema = object({
|
|
|
9602
9680
|
* applies (Frigate / COCO public catalog). Set on a custom model whose raw
|
|
9603
9681
|
* labels already ARE the CamStack macros (Scrypted identity map).
|
|
9604
9682
|
*/
|
|
9605
|
-
classMap: DetectionCatalogClassMapSchema.optional()
|
|
9683
|
+
classMap: DetectionCatalogClassMapSchema.optional(),
|
|
9684
|
+
/**
|
|
9685
|
+
* The model's CLIP feature-space contract (text encoder, dimension, vector
|
|
9686
|
+
* index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
|
|
9687
|
+
* CLIP image encoder; its absence is what "not a CLIP model" means to the
|
|
9688
|
+
* embedding encoder and the semantic-search store (D649).
|
|
9689
|
+
*/
|
|
9690
|
+
clip: ClipModelMetaSchema.optional()
|
|
9606
9691
|
});
|
|
9607
9692
|
var ConvertTargetSchema = discriminatedUnion("format", [object({
|
|
9608
9693
|
format: literal("openvino"),
|
|
@@ -9620,7 +9705,8 @@ var ModelConvertMetadataSchema = object({
|
|
|
9620
9705
|
inputNormalization: _enum([
|
|
9621
9706
|
"zero-one",
|
|
9622
9707
|
"imagenet",
|
|
9623
|
-
"none"
|
|
9708
|
+
"none",
|
|
9709
|
+
"scrfd"
|
|
9624
9710
|
]).optional(),
|
|
9625
9711
|
preprocessMode: _enum(["letterbox", "resize"]).optional(),
|
|
9626
9712
|
outputFormat: _enum([
|
|
@@ -13819,6 +13905,13 @@ var LinkedDeviceSchema = object({
|
|
|
13819
13905
|
features: array(string()),
|
|
13820
13906
|
producesTrackedEvents: boolean().optional()
|
|
13821
13907
|
});
|
|
13908
|
+
/**
|
|
13909
|
+
* The `linked-devices` extension slot's editable value (D648): the operator's
|
|
13910
|
+
* pick list, exactly what `_linkedDeviceIds` persists. Tree children are NOT
|
|
13911
|
+
* in it — they are always linked and are not a pick.
|
|
13912
|
+
*/
|
|
13913
|
+
var LinkedDevicesSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
|
|
13914
|
+
DeviceType.Camera;
|
|
13822
13915
|
/** One camera's resolved linked set, tagged with the camera it belongs to.
|
|
13823
13916
|
* The batch answer needs the tag; the single-device answer already has it
|
|
13824
13917
|
* from the input, which is why `getLinkedDevices` keeps the untagged shape. */
|
|
@@ -14344,16 +14437,101 @@ var EmbeddingResultSchema = object({
|
|
|
14344
14437
|
embedding: array(number()),
|
|
14345
14438
|
inferenceMs: number()
|
|
14346
14439
|
});
|
|
14440
|
+
/** The two CLIP towers the encoder runs; a crash budget is kept per tower. */
|
|
14441
|
+
var EmbeddingTowerSchema = _enum(["image", "text"]);
|
|
14442
|
+
/**
|
|
14443
|
+
* A tower in the terminal `failed` state (D649, D6): it crashed or failed to
|
|
14444
|
+
* load `crashes` times within `windowMs`, and is refused by name until an
|
|
14445
|
+
* operator `resetFailedModels` or a model change — never on a timer.
|
|
14446
|
+
*
|
|
14447
|
+
* `nodeId` is the node whose tower failed. The state lives in THAT node's
|
|
14448
|
+
* encoder process (in memory — a runner respawn clears it), and one node's
|
|
14449
|
+
* answer says nothing about another's.
|
|
14450
|
+
*/
|
|
14451
|
+
var EmbeddingFailedModelSchema = object({
|
|
14452
|
+
modelId: string(),
|
|
14453
|
+
tower: EmbeddingTowerSchema,
|
|
14454
|
+
nodeId: string(),
|
|
14455
|
+
crashes: number(),
|
|
14456
|
+
windowMs: number(),
|
|
14457
|
+
sinceMs: number(),
|
|
14458
|
+
lastReason: string()
|
|
14459
|
+
});
|
|
14460
|
+
/**
|
|
14461
|
+
* A model whose REQUIREMENTS can never be met on this node (D649 round 5):
|
|
14462
|
+
* an id the catalog does not know, a model URL answering 404/410, a declared
|
|
14463
|
+
* sibling (the tokenizer) that is not there. After `attempts` failed builds
|
|
14464
|
+
* it is terminally `requirements-failed`, refused by name until an operator
|
|
14465
|
+
* `resetFailedModels` or a model change — the same exits as a crashed tower.
|
|
14466
|
+
*/
|
|
14467
|
+
var EmbeddingFailedRequirementSchema = object({
|
|
14468
|
+
modelId: string(),
|
|
14469
|
+
tower: EmbeddingTowerSchema,
|
|
14470
|
+
nodeId: string(),
|
|
14471
|
+
attempts: number(),
|
|
14472
|
+
sinceMs: number(),
|
|
14473
|
+
lastReason: string()
|
|
14474
|
+
});
|
|
14347
14475
|
var EmbeddingInfoSchema = object({
|
|
14348
14476
|
modelId: string(),
|
|
14349
14477
|
embeddingDim: number(),
|
|
14350
|
-
ready: boolean()
|
|
14351
|
-
|
|
14478
|
+
ready: boolean(),
|
|
14479
|
+
/**
|
|
14480
|
+
* The node that answered. Absent only from an encoder older than D649's
|
|
14481
|
+
* crash budget — whose `failedModels` is then UNKNOWN (D315), never "none".
|
|
14482
|
+
*/
|
|
14483
|
+
nodeId: string().optional(),
|
|
14484
|
+
/**
|
|
14485
|
+
* Towers in `failed` on the answering node, each row naming it. `undefined`
|
|
14486
|
+
* means the node could not say (pre-budget encoder); a node that has the
|
|
14487
|
+
* budget always answers an array, empty included.
|
|
14488
|
+
*/
|
|
14489
|
+
failedModels: array(EmbeddingFailedModelSchema).optional(),
|
|
14490
|
+
/** Models terminally `requirements-failed` on the answering node; same reading as above. */
|
|
14491
|
+
failedRequirements: array(EmbeddingFailedRequirementSchema).optional()
|
|
14492
|
+
});
|
|
14493
|
+
/**
|
|
14494
|
+
* The THREE codes an encoder refusal can carry (D649, D6). Same shape as
|
|
14495
|
+
* `VECTOR_INDEX_DIM_CONFLICT`: the code rides in the MESSAGE, because an
|
|
14496
|
+
* Error's own properties do not survive the UDS/tRPC hop and its message does,
|
|
14497
|
+
* and both sides go through the helpers below — the encoder builds the
|
|
14498
|
+
* refusal, the live detail plane classifies on it to count refusals per
|
|
14499
|
+
* camera instead of logging one warning per track. The bracketed token
|
|
14500
|
+
* carries the code, the model, the tower and the node so a consumer never
|
|
14501
|
+
* parses prose.
|
|
14502
|
+
*
|
|
14503
|
+
* - `EMBEDDING_MODEL_FAILED`: the tower crashed / failed to load past the crash
|
|
14504
|
+
* budget — terminal until `resetFailedModels` or a model change.
|
|
14505
|
+
* - `EMBEDDING_REQUIREMENTS_UNAVAILABLE`: files or runtime not there right now
|
|
14506
|
+
* (a download or Python that failed, or the cooldown after one) — the next
|
|
14507
|
+
* request past the cooldown tries again.
|
|
14508
|
+
* - `EMBEDDING_REQUIREMENTS_FAILED`: the requirements can never be met (unknown
|
|
14509
|
+
* id, 404/410, missing sibling) and the bounded attempts are spent —
|
|
14510
|
+
* terminal, same exits as a crashed tower.
|
|
14511
|
+
*/
|
|
14512
|
+
var EMBEDDING_MODEL_FAILED = "embedding-model-failed";
|
|
14513
|
+
var EMBEDDING_REQUIREMENTS_UNAVAILABLE = "embedding-requirements-unavailable";
|
|
14514
|
+
var EMBEDDING_REQUIREMENTS_FAILED = "embedding-requirements-failed";
|
|
14515
|
+
_enum([
|
|
14516
|
+
EMBEDDING_MODEL_FAILED,
|
|
14517
|
+
EMBEDDING_REQUIREMENTS_UNAVAILABLE,
|
|
14518
|
+
EMBEDDING_REQUIREMENTS_FAILED
|
|
14519
|
+
]);
|
|
14520
|
+
new RegExp(`\\[(${EMBEDDING_MODEL_FAILED}|${EMBEDDING_REQUIREMENTS_UNAVAILABLE}|${EMBEDDING_REQUIREMENTS_FAILED}) model=([^\\s\\]]+) tower=(image|text) node=([^\\s\\]]+)\\]`);
|
|
14352
14521
|
method(object({
|
|
14353
14522
|
crop: _instanceof(Uint8Array),
|
|
14354
14523
|
width: number(),
|
|
14355
14524
|
height: number()
|
|
14356
|
-
}), EmbeddingResultSchema, { auth: "admin" }), method(object({
|
|
14525
|
+
}), EmbeddingResultSchema, { auth: "admin" }), method(object({
|
|
14526
|
+
text: string(),
|
|
14527
|
+
modelId: string().min(1).optional()
|
|
14528
|
+
}), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" }), method(object({ modelId: string().min(1).optional() }), object({
|
|
14529
|
+
cleared: array(string()),
|
|
14530
|
+
nodeId: string()
|
|
14531
|
+
}), {
|
|
14532
|
+
kind: "mutation",
|
|
14533
|
+
auth: "admin"
|
|
14534
|
+
});
|
|
14357
14535
|
/**
|
|
14358
14536
|
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
14359
14537
|
* through, per camera, with the denominator attached. It stores nothing.
|
|
@@ -16998,6 +17176,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
16998
17176
|
"device-battery-normal",
|
|
16999
17177
|
"device-consumable-low",
|
|
17000
17178
|
"device-consumable-normal",
|
|
17179
|
+
"device-tank-low",
|
|
17180
|
+
"device-tank-full",
|
|
17181
|
+
"device-tank-normal",
|
|
17001
17182
|
"stream-online",
|
|
17002
17183
|
"stream-offline",
|
|
17003
17184
|
"node-online",
|
|
@@ -17035,6 +17216,29 @@ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
|
17035
17216
|
]);
|
|
17036
17217
|
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
17037
17218
|
/**
|
|
17219
|
+
* The panel's transitions, as ONE list.
|
|
17220
|
+
*
|
|
17221
|
+
* Named here rather than spelled out at each of the four sites that need them
|
|
17222
|
+
* (the emitter, the intake, the editor group, the combined-notification gate),
|
|
17223
|
+
* because a transition added to the enum and forgotten at one of them is an
|
|
17224
|
+
* alarm state nobody can be notified about. That is exactly what this list
|
|
17225
|
+
* failed to prevent while it held three: `alarm-arming` was the fourth.
|
|
17226
|
+
*
|
|
17227
|
+
* In LIFECYCLE order, which is the order an editor lists them in and the order
|
|
17228
|
+
* a person experiences them — not the order they were added.
|
|
17229
|
+
*/
|
|
17230
|
+
var NC_ALARM_SYSTEM_EVENT_KINDS = [
|
|
17231
|
+
"alarm-arm-refused",
|
|
17232
|
+
"alarm-check-failed",
|
|
17233
|
+
"alarm-arming",
|
|
17234
|
+
"alarm-armed",
|
|
17235
|
+
"alarm-pending",
|
|
17236
|
+
"alarm-triggered",
|
|
17237
|
+
"alarm-rearmed",
|
|
17238
|
+
"alarm-sensor-bypass",
|
|
17239
|
+
"alarm-disarmed"
|
|
17240
|
+
];
|
|
17241
|
+
/**
|
|
17038
17242
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
17039
17243
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
17040
17244
|
* selected kinds.
|
|
@@ -17068,7 +17272,22 @@ var NcSystemEventConditionSchema = object({
|
|
|
17068
17272
|
*/
|
|
17069
17273
|
excludeDeviceIds: array(number().int()).min(1).optional(),
|
|
17070
17274
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
17071
|
-
packageNames: array(string().min(1)).min(1).optional()
|
|
17275
|
+
packageNames: array(string().min(1)).min(1).optional(),
|
|
17276
|
+
/**
|
|
17277
|
+
* At or below this remaining-life %, a consumable is LOW for THIS rule
|
|
17278
|
+
* (D642). Absent = {@link NC_CONSUMABLE_LOW_PERCENT_DEFAULT}; at most
|
|
17279
|
+
* {@link NC_CONSUMABLE_LOW_PERCENT_MAX}, so every episode can recover. Scoped to the
|
|
17280
|
+
* consumable kinds (`systemEventFilterApplies`) and to the device-events
|
|
17281
|
+
* family; ignored on every other kind.
|
|
17282
|
+
*
|
|
17283
|
+
* It is a property of the RULE because the operator decided so: a rule at
|
|
17284
|
+
* 25 must be told about a filter at 20 %, a rule at 10 must not. The hub
|
|
17285
|
+
* keeps one episode per (threshold, device, item) — its own hysteresis, its
|
|
17286
|
+
* own reminder — and a rule hears only the episode judged at ITS threshold,
|
|
17287
|
+
* exactly as an occupancy rule hears only the edge of its own count. A
|
|
17288
|
+
* provider's own `replace` verdict is low at every threshold.
|
|
17289
|
+
*/
|
|
17290
|
+
consumableLowPercent: number().int().min(1).max(95).optional()
|
|
17072
17291
|
});
|
|
17073
17292
|
/** Hard ceiling on a window (24h). A snooze that could not expire would be an
|
|
17074
17293
|
* outage the operator asked for once and forgot. */
|
|
@@ -17086,6 +17305,25 @@ var NcScheduleSchema = object({
|
|
|
17086
17305
|
/** Active OUTSIDE the windows (e.g. "only outside business hours"). */
|
|
17087
17306
|
invert: boolean().optional()
|
|
17088
17307
|
});
|
|
17308
|
+
/**
|
|
17309
|
+
* How a system-event rule of the `device-events` or `system` family speaks
|
|
17310
|
+
* (D647): at once, per event (`instant`, the only behaviour before D647), or
|
|
17311
|
+
* as a STATE SUMMARY at the end of each window of `schedule`.
|
|
17312
|
+
*/
|
|
17313
|
+
var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
|
|
17314
|
+
/**
|
|
17315
|
+
* `summary`: the rule sends NOTHING per event. When a window of `schedule`
|
|
17316
|
+
* CLOSES, it sends one notification with the current state of its kinds
|
|
17317
|
+
* (low batteries, consumables to replace, devices offline, updates
|
|
17318
|
+
* available, ...), after its own filters. Nothing to report sends nothing.
|
|
17319
|
+
* The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
|
|
17320
|
+
* midnight crossing); the send time is each window's END. Refused on the
|
|
17321
|
+
* `alarm` family, which stays instant (`systemEventDeliveryProblems`).
|
|
17322
|
+
*/
|
|
17323
|
+
var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
|
|
17324
|
+
mode: literal("summary"),
|
|
17325
|
+
schedule: NcScheduleSchema
|
|
17326
|
+
})]);
|
|
17089
17327
|
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
17090
17328
|
var NcPlateMatcherSchema = object({
|
|
17091
17329
|
/**
|
|
@@ -17699,7 +17937,12 @@ var NcMediaPolicySchema = object({
|
|
|
17699
17937
|
* the degrade engine, which drops the video and keeps the still.
|
|
17700
17938
|
*/
|
|
17701
17939
|
clip: boolean().optional(),
|
|
17702
|
-
/**
|
|
17940
|
+
/**
|
|
17941
|
+
* Seconds of footage BEFORE / AFTER the event instant. Absent =
|
|
17942
|
+
* {@link NC_CLIP_PRE_ROLL_DEFAULT_SEC} / {@link NC_CLIP_POST_ROLL_DEFAULT_SEC}
|
|
17943
|
+
* (4 / 6), resolved by the Notification Center at dispatch — deliberately not
|
|
17944
|
+
* a Zod default, so a rule that never chose keeps following the hub's.
|
|
17945
|
+
*/
|
|
17703
17946
|
clipPreRollSec: number().int().min(0).max(30).optional(),
|
|
17704
17947
|
clipPostRollSec: number().int().min(0).max(30).optional(),
|
|
17705
17948
|
/**
|
|
@@ -17821,6 +18064,16 @@ var NcRuleInputSchema = object({
|
|
|
17821
18064
|
delivery: NcDeliverySchema,
|
|
17822
18065
|
conditions: NcConditionsSchema.default({}),
|
|
17823
18066
|
schedule: NcScheduleSchema.optional(),
|
|
18067
|
+
/**
|
|
18068
|
+
* A `device-events` / `system` rule's delivery (D647): absent or `instant`
|
|
18069
|
+
* is a notification per event; `summary` is one state summary per closed
|
|
18070
|
+
* window of its schedule. `.optional()` and never defaulted: absent must
|
|
18071
|
+
* keep meaning what every rule authored before D647 meant, with no
|
|
18072
|
+
* migration. Top-level rather than inside `conditions.systemEvent`, so a
|
|
18073
|
+
* client that does not know it (an older viewer re-sending `conditions`
|
|
18074
|
+
* whole) leaves it standing through the store's patch merge.
|
|
18075
|
+
*/
|
|
18076
|
+
systemEventDelivery: NcSystemEventDeliverySchema.optional(),
|
|
17824
18077
|
/** May be empty when `targetUsers` addresses at least one user — the
|
|
17825
18078
|
* "at least one addressee" invariant is enforced by the provider, because
|
|
17826
18079
|
* a cross-field refine here would break `NcRulePatchSchema.partial()`. */
|
|
@@ -18049,6 +18302,28 @@ var NcRuleSchema = NcRuleInputSchema.extend({
|
|
|
18049
18302
|
*/
|
|
18050
18303
|
disabledTargetIds: array(string()).default([])
|
|
18051
18304
|
});
|
|
18305
|
+
/** One section of a previewed state summary. `unavailable` = its state could not be read. */
|
|
18306
|
+
var NcStateSummaryPreviewSectionSchema = object({
|
|
18307
|
+
id: string(),
|
|
18308
|
+
status: _enum(["read", "unavailable"]),
|
|
18309
|
+
items: number().int().nonnegative(),
|
|
18310
|
+
reason: string().optional()
|
|
18311
|
+
});
|
|
18312
|
+
/**
|
|
18313
|
+
* The summary a rule would send now. `empty` = nothing to report and every
|
|
18314
|
+
* section read: such a summary is NOT sent. `dropped` counts the open states
|
|
18315
|
+
* the rule's own filters (or a camera mute) left out, by reason.
|
|
18316
|
+
* `excludedGroups` names the kind groups selected that have no state to report
|
|
18317
|
+
* (backups & exports).
|
|
18318
|
+
*/
|
|
18319
|
+
var NcStateSummaryPreviewSchema = object({
|
|
18320
|
+
empty: boolean(),
|
|
18321
|
+
count: number().int().nonnegative(),
|
|
18322
|
+
text: string(),
|
|
18323
|
+
sections: array(NcStateSummaryPreviewSectionSchema),
|
|
18324
|
+
dropped: record(string(), number().int().nonnegative()),
|
|
18325
|
+
excludedGroups: array(string())
|
|
18326
|
+
});
|
|
18052
18327
|
var NcTestResultSchema = object({
|
|
18053
18328
|
recordId: string(),
|
|
18054
18329
|
recordKind: _enum([
|
|
@@ -18140,6 +18415,13 @@ var NcTemplateVarDescriptorSchema = object({
|
|
|
18140
18415
|
kinds: array(NcTemplateVarKindSchema).optional(),
|
|
18141
18416
|
deliveries: array(NcDeliverySchema).optional(),
|
|
18142
18417
|
systemEventKinds: array(NcSystemEventKindSchema).optional(),
|
|
18418
|
+
/**
|
|
18419
|
+
* Which system-event DELIVERY has a value for it (D647). Absent = an
|
|
18420
|
+
* instant row only when the descriptor names `systemEventKinds` (a
|
|
18421
|
+
* per-event fact: a summary row has no single device), and both otherwise.
|
|
18422
|
+
* `['summary']` marks the state-summary vocabulary (`{{summaryText}}`, ...).
|
|
18423
|
+
*/
|
|
18424
|
+
systemEventDeliveries: array(NcSystemEventDeliveryModeSchema).optional(),
|
|
18143
18425
|
dynamic: object({
|
|
18144
18426
|
prefix: literal("count_"),
|
|
18145
18427
|
from: literal("classes")
|
|
@@ -18152,7 +18434,9 @@ var NcTemplatePreviewInputSchema = object({
|
|
|
18152
18434
|
field: NcTemplateFieldSchema,
|
|
18153
18435
|
kind: NcRuleKindSchema.optional(),
|
|
18154
18436
|
delivery: NcDeliverySchema.optional(),
|
|
18155
|
-
systemEventKinds: array(NcSystemEventKindSchema).optional()
|
|
18437
|
+
systemEventKinds: array(NcSystemEventKindSchema).optional(),
|
|
18438
|
+
/** The rule's system-event delivery (D647); absent = instant. */
|
|
18439
|
+
systemEventDelivery: NcSystemEventDeliveryModeSchema.optional()
|
|
18156
18440
|
}),
|
|
18157
18441
|
template: object({
|
|
18158
18442
|
title: string().max(500).optional(),
|
|
@@ -18686,6 +18970,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
18686
18970
|
}), object({ results: array(NcTestResultSchema) }), {
|
|
18687
18971
|
kind: "mutation",
|
|
18688
18972
|
auth: "admin"
|
|
18973
|
+
}), method(object({ rule: NcRuleInputSchema }), NcStateSummaryPreviewSchema, {
|
|
18974
|
+
kind: "mutation",
|
|
18975
|
+
auth: "admin",
|
|
18976
|
+
access: "view"
|
|
18689
18977
|
}), method(object({}), object({
|
|
18690
18978
|
catalog: array(NcConditionDescriptorSchema),
|
|
18691
18979
|
taxonomy: NcTaxonomySchema.optional()
|
|
@@ -19032,758 +19320,282 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
19032
19320
|
});
|
|
19033
19321
|
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
19034
19322
|
/**
|
|
19035
|
-
*
|
|
19036
|
-
*
|
|
19037
|
-
*
|
|
19323
|
+
* A model choice has a SCOPE, and a scope change has a workflow.
|
|
19324
|
+
*
|
|
19325
|
+
* ## The two scopes
|
|
19326
|
+
*
|
|
19327
|
+
* Almost every pipeline step's model is a **node** question: which build runs
|
|
19328
|
+
* fastest on THIS accelerator. Two nodes may legitimately answer differently —
|
|
19329
|
+
* a Coral runs the tflite SSD, a Mac runs the coreml YOLO — because the answers
|
|
19330
|
+
* are compared against nothing. They produce boxes, and a box is a box.
|
|
19331
|
+
*
|
|
19332
|
+
* Two steps are not like that. `face-embedding` and `clip-embedding` produce
|
|
19333
|
+
* **vectors that land in ONE shared index** (`identity_samples`,
|
|
19334
|
+
* `vec_object_clip`) and are ranked against each other by cosine similarity.
|
|
19335
|
+
* Cosine similarity between two encoders is not a weak signal, it is a
|
|
19336
|
+
* meaningless number — and nothing inside a vector can tell you it happened.
|
|
19337
|
+
* So for those two steps the model is a **cluster** question with exactly one
|
|
19338
|
+
* answer, stored in exactly one row.
|
|
19339
|
+
*
|
|
19340
|
+
* That is the same argument [D52](../../../../docs/decisions/adr-0052.md) makes
|
|
19341
|
+
* for the crop convention (`detail-crop.ts`), one level up: the crop decides
|
|
19342
|
+
* WHAT pixels the encoder sees, this decides WHICH encoder sees them. Both are
|
|
19343
|
+
* cluster-wide for the same reason and neither may become per-node.
|
|
19344
|
+
*
|
|
19345
|
+
* ## Why the registry lives here and not in the step catalog
|
|
19346
|
+
*
|
|
19347
|
+
* The scope itself is declared on the step, in
|
|
19348
|
+
* `detection-pipeline/registry/step-definitions.ts` (`StepDefinition.modelScope`)
|
|
19349
|
+
* — that is where a new step declares what kind of choice its model is. But the
|
|
19350
|
+
* catalog lives inside `addon-pipeline`, and three packages that must NOT
|
|
19351
|
+
* import an addon need to know the set: the orchestrator (which renders and
|
|
19352
|
+
* stores the row), post-analysis (which pins the row for a re-embed pass) and
|
|
19353
|
+
* admin-ui (which mirrors it). So the set is mirrored here, and
|
|
19354
|
+
* `scripts/check-cluster-model-scope.ts` fails the build when the two disagree.
|
|
19355
|
+
* A hand-copied key that stops matching is exactly how a setting silently stops
|
|
19356
|
+
* arriving while both sides still look correct.
|
|
19357
|
+
*
|
|
19358
|
+
* ## The defaults ARE today's behaviour
|
|
19359
|
+
*
|
|
19360
|
+
* {@link DEFAULT_CLUSTER_STEP_MODELS} reproduces the catalog `defaultModelId`
|
|
19361
|
+
* of both steps. Declaring the scope therefore changes nothing on the day it
|
|
19362
|
+
* ships: the cluster row starts out saying what every node was already doing.
|
|
19363
|
+
* Changing it is legitimate — that is what the knob is for — but it invalidates
|
|
19364
|
+
* the stored vectors of that surface, and must be followed by a re-embed pass
|
|
19365
|
+
* (`face-reembed-pass.ts`, `embedding-rebuild.ts`).
|
|
19366
|
+
*/
|
|
19367
|
+
/**
|
|
19368
|
+
* Why the orchestrator cannot say which model the operator chose for a
|
|
19369
|
+
* cluster-scoped step (D651).
|
|
19370
|
+
*/
|
|
19371
|
+
var CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS = [
|
|
19372
|
+
"owner-not-ready",
|
|
19373
|
+
"store-read-failed",
|
|
19374
|
+
"three-way-read-unavailable",
|
|
19375
|
+
"invalid-stored",
|
|
19376
|
+
"not-cluster-scoped"
|
|
19377
|
+
];
|
|
19378
|
+
Object.freeze(Object.fromEntries([{
|
|
19379
|
+
stepId: "face-embedding",
|
|
19380
|
+
label: "Face recognition model",
|
|
19381
|
+
defaultModelId: "auraface-r100",
|
|
19382
|
+
indexName: "the enrolled face gallery",
|
|
19383
|
+
options: [
|
|
19384
|
+
{
|
|
19385
|
+
id: "auraface-r100",
|
|
19386
|
+
label: "AuraFace R100"
|
|
19387
|
+
},
|
|
19388
|
+
{
|
|
19389
|
+
id: "arcface-r100",
|
|
19390
|
+
label: "ArcFace (ResNet34)"
|
|
19391
|
+
},
|
|
19392
|
+
{
|
|
19393
|
+
id: "inception-resnet-v1",
|
|
19394
|
+
label: "Inception ResNet V1"
|
|
19395
|
+
}
|
|
19396
|
+
]
|
|
19397
|
+
}, {
|
|
19398
|
+
stepId: "clip-embedding",
|
|
19399
|
+
label: "Semantic search model",
|
|
19400
|
+
defaultModelId: "mobileclip-s1",
|
|
19401
|
+
indexName: "the object semantic-search index",
|
|
19402
|
+
options: [
|
|
19403
|
+
{
|
|
19404
|
+
id: "mobileclip-s1",
|
|
19405
|
+
label: "MobileCLIP S1"
|
|
19406
|
+
},
|
|
19407
|
+
{
|
|
19408
|
+
id: "mobileclip-s2",
|
|
19409
|
+
label: "MobileCLIP S2"
|
|
19410
|
+
},
|
|
19411
|
+
{
|
|
19412
|
+
id: "siglip2-b16-224",
|
|
19413
|
+
label: "SigLIP2 B/16 (Apache-2.0)"
|
|
19414
|
+
}
|
|
19415
|
+
]
|
|
19416
|
+
}].map((s) => [s.stepId, s.defaultModelId])));
|
|
19417
|
+
var CLUSTER_STEP_SETTING_FIELDS = [{
|
|
19418
|
+
stepId: "face-embedding",
|
|
19419
|
+
key: "minLandmarkFaceSize",
|
|
19420
|
+
label: "Min face size for recognition (detection px)",
|
|
19421
|
+
description: "Refuse to embed a face smaller than this IN THE DETECTION FRAME. Applies to every node — the enrolled gallery is one index, and two admission floors would fill it from two policies. 0 disables the gate.",
|
|
19422
|
+
type: "slider",
|
|
19423
|
+
min: 0,
|
|
19424
|
+
max: 64,
|
|
19425
|
+
step: 2,
|
|
19426
|
+
default: 24
|
|
19427
|
+
}];
|
|
19428
|
+
function clusterStepSettingKey(stepId, fieldKey) {
|
|
19429
|
+
return `clusterStepSetting:${stepId}:${fieldKey}`;
|
|
19430
|
+
}
|
|
19431
|
+
var ClusterSettingNumberSchema = number().finite();
|
|
19432
|
+
function readClusterStepSettings(config) {
|
|
19433
|
+
const out = {};
|
|
19434
|
+
for (const field of CLUSTER_STEP_SETTING_FIELDS) {
|
|
19435
|
+
const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
|
|
19436
|
+
const value = parsed.success ? parsed.data : field.default;
|
|
19437
|
+
const existing = out[field.stepId] ?? {};
|
|
19438
|
+
out[field.stepId] = {
|
|
19439
|
+
...existing,
|
|
19440
|
+
[field.key]: value
|
|
19441
|
+
};
|
|
19442
|
+
}
|
|
19443
|
+
return out;
|
|
19444
|
+
}
|
|
19445
|
+
readClusterStepSettings({});
|
|
19446
|
+
/**
|
|
19447
|
+
* pipeline-analytics — device-scoped wrapper cap. Refines raw
|
|
19448
|
+
* per-frame detections emitted by the pipeline runner into tracked
|
|
19449
|
+
* objects, per-kind event collections (motion / object / audio), and
|
|
19450
|
+
* persisted media. Owns the post-detection domain end-to-end:
|
|
19451
|
+
*
|
|
19452
|
+
* runner emits PipelineInferenceResult
|
|
19453
|
+
* ↓ (event bus)
|
|
19454
|
+
* pipeline-analytics subscriber
|
|
19455
|
+
* ↓ SORT tracker + zone engine + state analyzer + event emitter
|
|
19456
|
+
* → three DB collections (one per kind), one FS media tree, one
|
|
19457
|
+
* unified event emitter (FrameTracked + TrackStarted/Ended +
|
|
19458
|
+
* DetectionEvent on bus)
|
|
19459
|
+
*
|
|
19460
|
+
* Pure subscriber model. No `processFrame` cap method — the runner
|
|
19461
|
+
* already publishes the raw frame on the bus. The cap surface is
|
|
19462
|
+
* only QUERIES + per-device settings, bound on/off via
|
|
19463
|
+
* `device-manager.setWrapperActive`. `defaultActive: true` because
|
|
19464
|
+
* every camera with a detection pipeline wants its raw detections
|
|
19465
|
+
* refined; operators opt out per-device via BindingsTab when needed.
|
|
19466
|
+
*
|
|
19467
|
+
* Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
|
|
19468
|
+
* (per-device surface) and `track-trail` caps — see P11 cleanup.
|
|
19038
19469
|
*/
|
|
19039
|
-
var
|
|
19040
|
-
|
|
19041
|
-
|
|
19042
|
-
|
|
19043
|
-
|
|
19044
|
-
|
|
19045
|
-
|
|
19046
|
-
|
|
19047
|
-
|
|
19048
|
-
|
|
19049
|
-
|
|
19050
|
-
|
|
19051
|
-
crop: object({
|
|
19052
|
-
left: number(),
|
|
19053
|
-
top: number(),
|
|
19054
|
-
width: number().positive(),
|
|
19055
|
-
height: number().positive()
|
|
19056
|
-
}).optional(),
|
|
19057
|
-
content: object({
|
|
19058
|
-
width: number().int().positive(),
|
|
19059
|
-
height: number().int().positive()
|
|
19060
|
-
}),
|
|
19061
|
-
fit: _enum(["stretch", "contain"]),
|
|
19062
|
-
format: _enum([
|
|
19063
|
-
"rgb",
|
|
19064
|
-
"gray",
|
|
19065
|
-
"jpeg"
|
|
19066
|
-
])
|
|
19067
|
-
});
|
|
19470
|
+
var TrackStateSchema = _enum([
|
|
19471
|
+
"new",
|
|
19472
|
+
"entered",
|
|
19473
|
+
"left",
|
|
19474
|
+
"moving",
|
|
19475
|
+
"idle"
|
|
19476
|
+
]);
|
|
19477
|
+
var EventKindSchema = _enum([
|
|
19478
|
+
"motion",
|
|
19479
|
+
"object",
|
|
19480
|
+
"audio"
|
|
19481
|
+
]);
|
|
19068
19482
|
/**
|
|
19069
|
-
*
|
|
19070
|
-
*
|
|
19071
|
-
*
|
|
19483
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
19484
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
19485
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
19072
19486
|
*/
|
|
19073
|
-
var
|
|
19074
|
-
|
|
19075
|
-
|
|
19076
|
-
|
|
19077
|
-
|
|
19078
|
-
|
|
19079
|
-
|
|
19080
|
-
|
|
19081
|
-
|
|
19082
|
-
|
|
19083
|
-
"
|
|
19084
|
-
"
|
|
19085
|
-
"
|
|
19086
|
-
"
|
|
19087
|
-
"
|
|
19088
|
-
"gguf"
|
|
19487
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
19488
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
19489
|
+
var EventKindIconSchema = _enum([
|
|
19490
|
+
"motion",
|
|
19491
|
+
"audio",
|
|
19492
|
+
"person",
|
|
19493
|
+
"vehicle",
|
|
19494
|
+
"animal",
|
|
19495
|
+
"door",
|
|
19496
|
+
"pir",
|
|
19497
|
+
"smoke",
|
|
19498
|
+
"water",
|
|
19499
|
+
"button",
|
|
19500
|
+
"package",
|
|
19501
|
+
"generic"
|
|
19089
19502
|
]);
|
|
19090
|
-
var
|
|
19091
|
-
"
|
|
19092
|
-
"
|
|
19093
|
-
"
|
|
19094
|
-
"
|
|
19095
|
-
"
|
|
19503
|
+
var EventKindCategorySchema = _enum([
|
|
19504
|
+
"motion",
|
|
19505
|
+
"audio",
|
|
19506
|
+
"detection",
|
|
19507
|
+
"sensor",
|
|
19508
|
+
"control",
|
|
19509
|
+
"custom",
|
|
19510
|
+
"package"
|
|
19096
19511
|
]);
|
|
19097
|
-
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
|
|
19105
|
-
devices: array(object({
|
|
19106
|
-
id: string(),
|
|
19107
|
-
label: string(),
|
|
19108
|
-
description: string().optional()
|
|
19109
|
-
})).readonly(),
|
|
19110
|
-
defaultDevice: string()
|
|
19111
|
-
});
|
|
19112
|
-
var PipelineDefaultStepSchema = lazy(() => object({
|
|
19113
|
-
addonId: string(),
|
|
19114
|
-
addonName: string(),
|
|
19115
|
-
slot: PipelineSlotSchema,
|
|
19116
|
-
inputClasses: array(string()).readonly(),
|
|
19117
|
-
outputClasses: array(string()).readonly(),
|
|
19118
|
-
enabled: boolean(),
|
|
19119
|
-
modelId: string(),
|
|
19120
|
-
children: array(PipelineDefaultStepSchema).readonly(),
|
|
19121
|
-
group: string().optional(),
|
|
19122
|
-
settings: record(string(), unknown()).optional()
|
|
19123
|
-
}));
|
|
19124
|
-
var PipelineTemplateStepSchema = lazy(() => object({
|
|
19125
|
-
addonId: string(),
|
|
19126
|
-
enabled: boolean(),
|
|
19127
|
-
modelId: string(),
|
|
19128
|
-
children: array(PipelineTemplateStepSchema).readonly(),
|
|
19129
|
-
settings: record(string(), unknown()).optional()
|
|
19130
|
-
}));
|
|
19131
|
-
var PipelineTemplateSchema$1 = object({
|
|
19132
|
-
id: string(),
|
|
19133
|
-
name: string(),
|
|
19134
|
-
createdAt: string(),
|
|
19135
|
-
updatedAt: string(),
|
|
19136
|
-
engine: PipelineEngineChoiceSchema,
|
|
19137
|
-
steps: array(PipelineTemplateStepSchema).readonly()
|
|
19138
|
-
});
|
|
19139
|
-
var PipelineModelOptionSchema = object({
|
|
19140
|
-
id: string(),
|
|
19141
|
-
name: string(),
|
|
19142
|
-
formats: record(string(), object({
|
|
19143
|
-
downloaded: boolean(),
|
|
19144
|
-
sizeMB: number()
|
|
19145
|
-
})),
|
|
19146
|
-
group: ModelVariantGroupSchema.optional(),
|
|
19147
|
-
legacy: boolean().optional(),
|
|
19148
|
-
provider: ModelProviderIdSchema.optional()
|
|
19149
|
-
});
|
|
19150
|
-
var ConfigFieldBridge = custom();
|
|
19151
|
-
var PipelineAddonSchemaSchema = object({
|
|
19152
|
-
id: string(),
|
|
19153
|
-
name: string(),
|
|
19154
|
-
slot: PipelineSlotSchema,
|
|
19155
|
-
inputClasses: array(string()).readonly(),
|
|
19156
|
-
outputClasses: array(string()).readonly(),
|
|
19157
|
-
childSlots: array(PipelineSlotSchema).readonly(),
|
|
19158
|
-
models: array(PipelineModelOptionSchema).readonly(),
|
|
19159
|
-
defaultModelId: string(),
|
|
19160
|
-
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
19161
|
-
enabledByDefault: boolean().optional(),
|
|
19162
|
-
backfillIntoExistingOverrides: boolean().optional(),
|
|
19163
|
-
defaultConfidence: number(),
|
|
19164
|
-
group: string().optional(),
|
|
19165
|
-
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
19166
|
-
});
|
|
19167
|
-
var PipelineSlotSchemaSchema = object({
|
|
19168
|
-
id: PipelineSlotSchema,
|
|
19512
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
19513
|
+
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
19514
|
+
var EventKindDescriptorSchema = object({
|
|
19515
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
19516
|
+
kind: string(),
|
|
19517
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
19518
|
+
labelKey: string(),
|
|
19519
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
19169
19520
|
label: string(),
|
|
19170
|
-
|
|
19171
|
-
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19178
|
-
|
|
19179
|
-
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19183
|
-
|
|
19184
|
-
|
|
19185
|
-
|
|
19186
|
-
|
|
19187
|
-
state: _enum([
|
|
19188
|
-
"idle",
|
|
19189
|
-
"installing",
|
|
19190
|
-
"verifying",
|
|
19191
|
-
"ready",
|
|
19192
|
-
"failed"
|
|
19193
|
-
]),
|
|
19194
|
-
progress: number().optional(),
|
|
19195
|
-
error: string().optional(),
|
|
19196
|
-
nextRetryAt: number().optional(),
|
|
19197
|
-
/**
|
|
19198
|
-
* Gate A (config-correctness gate at engine change): human-readable
|
|
19199
|
-
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
19200
|
-
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
19201
|
-
* has a <format> build"). Additive/optional: informational only, never
|
|
19202
|
-
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
19203
|
-
* Absent/empty when the node-default tree resolves cleanly.
|
|
19204
|
-
*/
|
|
19205
|
-
configIssues: array(string()).optional()
|
|
19206
|
-
});
|
|
19207
|
-
var PipelineStepInputSchema = lazy(() => object({
|
|
19208
|
-
addonId: string(),
|
|
19209
|
-
modelId: string().optional(),
|
|
19210
|
-
enabled: boolean().default(true),
|
|
19211
|
-
children: array(PipelineStepInputSchema).optional(),
|
|
19212
|
-
settings: record(string(), unknown()).optional(),
|
|
19213
|
-
jumpDeviceKey: string().optional()
|
|
19214
|
-
}));
|
|
19215
|
-
var ModelSubstitutionSchema = object({
|
|
19216
|
-
addonId: string(),
|
|
19217
|
-
chosen: string(),
|
|
19218
|
-
running: string(),
|
|
19219
|
-
format: string()
|
|
19220
|
-
});
|
|
19221
|
-
var PipelineValidationIssueSchema = object({
|
|
19222
|
-
addonId: string(),
|
|
19223
|
-
kind: _enum(["unknown-addon", "no-format-build"]),
|
|
19224
|
-
detail: string()
|
|
19225
|
-
});
|
|
19226
|
-
var PipelineValidationResultSchema = object({
|
|
19227
|
-
ok: boolean(),
|
|
19228
|
-
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
19229
|
-
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
19230
|
-
/** The node's `currentEngine.format` this validation ran against. */
|
|
19231
|
-
format: string()
|
|
19232
|
-
});
|
|
19233
|
-
var ReferenceImageEntrySchema = object({
|
|
19234
|
-
filename: string(),
|
|
19235
|
-
stepIds: array(string()).readonly().optional()
|
|
19236
|
-
});
|
|
19237
|
-
var ReferenceImageBodySchema = object({
|
|
19238
|
-
base64: string(),
|
|
19239
|
-
filename: string()
|
|
19521
|
+
/** Hex color for timeline/legend rendering. */
|
|
19522
|
+
color: string(),
|
|
19523
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
19524
|
+
iconId: string(),
|
|
19525
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
19526
|
+
icon: EventKindIconSchema,
|
|
19527
|
+
category: EventKindCategorySchema,
|
|
19528
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
19529
|
+
parentKind: string().nullable(),
|
|
19530
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
19531
|
+
level: EventKindLevelSchema,
|
|
19532
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
19533
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
19534
|
+
source: object({
|
|
19535
|
+
capName: string(),
|
|
19536
|
+
deviceId: number()
|
|
19537
|
+
})
|
|
19240
19538
|
});
|
|
19241
|
-
|
|
19242
|
-
|
|
19243
|
-
|
|
19539
|
+
/** One camera's event vocabulary, as returned by `listEventKindsBatch`. */
|
|
19540
|
+
var EventKindsForDeviceSchema = object({
|
|
19541
|
+
deviceId: number(),
|
|
19542
|
+
kinds: array(EventKindDescriptorSchema).readonly()
|
|
19244
19543
|
});
|
|
19245
|
-
var
|
|
19246
|
-
var AudioBackendSchema = object({
|
|
19544
|
+
var SensorEventSchema = object({
|
|
19247
19545
|
id: string(),
|
|
19248
|
-
|
|
19249
|
-
|
|
19250
|
-
|
|
19546
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
19547
|
+
* yields N rows, one per camera). */
|
|
19548
|
+
deviceId: number(),
|
|
19549
|
+
/** The linked sensor device whose state changed. */
|
|
19550
|
+
sourceDeviceId: number(),
|
|
19551
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
19552
|
+
kind: string(),
|
|
19553
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
19554
|
+
value: record(string(), unknown()).nullable(),
|
|
19555
|
+
timestamp: number()
|
|
19556
|
+
});
|
|
19557
|
+
/**
|
|
19558
|
+
* One stored sighting on a track's trajectory.
|
|
19559
|
+
*
|
|
19560
|
+
* The array these live in is returned in TIME order (D399) — it is APPENDED in
|
|
19561
|
+
* arrival order, and the two detector passes interleave, so a consumer must not
|
|
19562
|
+
* assume the two are the same on a row written by an older build.
|
|
19563
|
+
*/
|
|
19564
|
+
var TrackPositionSchema = object({
|
|
19565
|
+
x: number(),
|
|
19566
|
+
y: number(),
|
|
19567
|
+
timestamp: number(),
|
|
19568
|
+
bbox: BoundingBoxSchema,
|
|
19251
19569
|
/**
|
|
19252
|
-
*
|
|
19253
|
-
*
|
|
19254
|
-
*
|
|
19255
|
-
*
|
|
19570
|
+
* Which detector pass measured this box (D399): `frame` is the full-frame
|
|
19571
|
+
* pass on the analysis raster, `recovery` is the native-resolution
|
|
19572
|
+
* small-subject second pass (D377/D378). Both write into one array, and until
|
|
19573
|
+
* this field existed the only way to tell them apart was that full-frame boxes
|
|
19574
|
+
* are exact multiples of 1.2 while recovery boxes are full-precision floats.
|
|
19575
|
+
* Absent on rows written before D399.
|
|
19256
19576
|
*/
|
|
19257
|
-
|
|
19577
|
+
source: _enum(["frame", "recovery"]).optional(),
|
|
19578
|
+
/** Detection score of this box, so a position can be weighed and not only
|
|
19579
|
+
* plotted. Absent on rows written before D399. */
|
|
19580
|
+
score: number().optional()
|
|
19258
19581
|
});
|
|
19259
|
-
var
|
|
19260
|
-
|
|
19261
|
-
|
|
19262
|
-
|
|
19263
|
-
|
|
19582
|
+
var TrackSnapshotSchema = object({
|
|
19583
|
+
timestamp: number(),
|
|
19584
|
+
position: TrackPositionSchema,
|
|
19585
|
+
/** The snapshot's media row id (D482); resolve via `listTrackMedia({ trackId })`. */
|
|
19586
|
+
mediaId: number().int()
|
|
19264
19587
|
});
|
|
19265
|
-
|
|
19266
|
-
|
|
19267
|
-
|
|
19268
|
-
|
|
19269
|
-
|
|
19270
|
-
|
|
19271
|
-
|
|
19272
|
-
|
|
19273
|
-
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
19277
|
-
* benchmark UI can still report a clean failure when the classifier
|
|
19278
|
-
* cap isn't available.
|
|
19279
|
-
*/
|
|
19280
|
-
var AudioTestResultSchema = object({
|
|
19281
|
-
success: boolean(),
|
|
19282
|
-
error: string().optional(),
|
|
19283
|
-
frame: custom().optional()
|
|
19284
|
-
});
|
|
19285
|
-
var PipelineConfigBridge = custom();
|
|
19286
|
-
var ConfigUISchemaBridge = custom();
|
|
19287
|
-
var ConfigUISchemaNullableBridge = custom();
|
|
19288
|
-
var InferenceCapabilitiesBridge = custom();
|
|
19289
|
-
var ModelAvailabilityListBridge = custom();
|
|
19290
|
-
var PipelineRunResultBridge = custom();
|
|
19291
|
-
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
19292
|
-
modelId: string(),
|
|
19293
|
-
settings: record(string(), unknown()).readonly()
|
|
19294
|
-
}))), method(object({ steps: record(string(), object({
|
|
19295
|
-
modelId: string(),
|
|
19296
|
-
settings: record(string(), unknown()).readonly()
|
|
19297
|
-
})) }), object({ success: literal(true) }), {
|
|
19298
|
-
kind: "mutation",
|
|
19299
|
-
auth: "admin"
|
|
19300
|
-
}), method(object({ nodeId: string() }), object({
|
|
19301
|
-
success: literal(true),
|
|
19302
|
-
clearedDevices: number()
|
|
19303
|
-
}), {
|
|
19304
|
-
kind: "mutation",
|
|
19305
|
-
auth: "admin"
|
|
19306
|
-
}), method(object({ nodeId: string() }), object({ unhealthy: array(object({
|
|
19307
|
-
/** `<backend>:<device>`, e.g. `openvino:gpu`. */
|
|
19308
|
-
deviceKey: string(),
|
|
19309
|
-
/**
|
|
19310
|
-
* `failed` — the per-device restart budget is exhausted; no pool
|
|
19311
|
-
* will be spawned until an operator re-arms it or the runner
|
|
19312
|
-
* respawns. `backoff` — under budget, waiting out the backoff (or
|
|
19313
|
-
* a cached pool observed dead and not yet condemned).
|
|
19314
|
-
*/
|
|
19315
|
-
state: _enum(["failed", "backoff"]),
|
|
19316
|
-
/** Epoch ms of the death that produced this state. */
|
|
19317
|
-
since: number(),
|
|
19318
|
-
/** Pool deaths inside the current window. */
|
|
19319
|
-
deaths: number(),
|
|
19320
|
-
/** The last death's message. */
|
|
19321
|
-
lastError: string()
|
|
19322
|
-
})).readonly() })), method(object({
|
|
19323
|
-
nodeId: string(),
|
|
19324
|
-
deviceKey: string()
|
|
19325
|
-
}), object({ rearmed: boolean() }), {
|
|
19326
|
-
kind: "mutation",
|
|
19327
|
-
auth: "admin"
|
|
19328
|
-
}), 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({
|
|
19329
|
-
name: string(),
|
|
19330
|
-
steps: array(PipelineTemplateStepSchema).readonly(),
|
|
19331
|
-
engine: PipelineEngineChoiceSchema
|
|
19332
|
-
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
|
|
19333
|
-
id: string(),
|
|
19334
|
-
name: string().optional(),
|
|
19335
|
-
steps: array(PipelineTemplateStepSchema).readonly().optional()
|
|
19336
|
-
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
|
|
19337
|
-
addonId: string(),
|
|
19338
|
-
modelId: string(),
|
|
19339
|
-
format: ModelFormatSchema$1
|
|
19340
|
-
}), DownloadModelResultSchema, { kind: "mutation" }), method(object({
|
|
19341
|
-
addonId: string(),
|
|
19342
|
-
modelId: string(),
|
|
19343
|
-
format: ModelFormatSchema$1
|
|
19344
|
-
}), object({ success: literal(true) }), { kind: "mutation" }), method(object({
|
|
19345
|
-
engine: PipelineEngineChoiceSchema.optional(),
|
|
19346
|
-
steps: array(PipelineStepInputSchema).min(1),
|
|
19347
|
-
frame: FrameInputSchema.optional(),
|
|
19348
|
-
/**
|
|
19349
|
-
* Process-local lazy frame. Valid only when caller and provider resolve
|
|
19350
|
-
* in the same execution-group process; split/cross-node callers use
|
|
19351
|
-
* `frame`/`image` inline compatibility instead.
|
|
19352
|
-
*/
|
|
19353
|
-
frameRef: FrameRefSchema.optional(),
|
|
19354
|
-
/**
|
|
19355
|
-
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
19356
|
-
* the decoded pixels live in. One more member of the one-of
|
|
19357
|
-
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
19358
|
-
*/
|
|
19359
|
-
frameHandle: FrameHandleSchema.optional(),
|
|
19360
|
-
imageBase64: string().optional(),
|
|
19361
|
-
/**
|
|
19362
|
-
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
19363
|
-
* hops (hub → forked worker via Moleculer MsgPack) because it
|
|
19364
|
-
* skips the 33% base64 overhead + the per-call base64 decode on
|
|
19365
|
-
* the detection-pipeline worker. Callers can pass either; exactly
|
|
19366
|
-
* one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
|
|
19367
|
-
*/
|
|
19368
|
-
image: _instanceof(Uint8Array).optional(),
|
|
19369
|
-
referenceImage: string().optional(),
|
|
19370
|
-
deviceId: number().optional(),
|
|
19371
|
-
sessionId: string().optional(),
|
|
19372
|
-
/**
|
|
19373
|
-
* Execution plane. 'full' (default) runs the whole tree — benchmark,
|
|
19374
|
-
* reference-image, and detail-subtree calls. 'frame' is the live
|
|
19375
|
-
* per-frame dispatch: ONLY root-plane steps run; crop children
|
|
19376
|
-
* (inputClasses ≠ null) are skipped and served per-track via
|
|
19377
|
-
* pipelineRunner.runDetailSubtree (two-plane design).
|
|
19378
|
-
*/
|
|
19379
|
-
plane: _enum(["full", "frame"]).optional(),
|
|
19380
|
-
/**
|
|
19381
|
-
* Inference-device selector (Phase 2 multi-device). Format
|
|
19382
|
-
* `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
|
|
19383
|
-
* Omitted ⇒ the runner's default device (current single-engine
|
|
19384
|
-
* behaviour). Selects WHICH device pool of the node runs the call.
|
|
19385
|
-
*/
|
|
19386
|
-
deviceKey: string().optional(),
|
|
19387
|
-
/**
|
|
19388
|
-
* Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
|
|
19389
|
-
* when the parent crop was resolved from the frame's retained NATIVE
|
|
19390
|
-
* surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
|
|
19391
|
-
* child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
|
|
19392
|
-
* resolution from that surface — the SAME quality path faces already
|
|
19393
|
-
* had — instead of the downscaled parent tile. `handle` keys the native
|
|
19394
|
-
* surface (node-pinned to its owner); `cropFrameSpace` is the parent
|
|
19395
|
-
* crop's padded/clamped rectangle in FRAME-space pixels, used to compose
|
|
19396
|
-
* the executor's crop-normalized child ROI back into frame-normalized
|
|
19397
|
-
* coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
|
|
19398
|
-
* of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
|
|
19399
|
-
* (today's behaviour on the fallback path).
|
|
19400
|
-
*/
|
|
19401
|
-
nativeCropRef: NativeCropRefSchema.optional()
|
|
19402
|
-
}), PipelineRunResultBridge, { kind: "mutation" }), method(object({
|
|
19403
|
-
engine: PipelineEngineChoiceSchema.optional(),
|
|
19404
|
-
steps: array(PipelineStepInputSchema).min(1),
|
|
19405
|
-
frames: array(FrameInputSchema).min(1).max(255),
|
|
19406
|
-
deviceId: number().optional(),
|
|
19407
|
-
sessionId: string().optional(),
|
|
19408
|
-
/**
|
|
19409
|
-
* Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
|
|
19410
|
-
* the batch to the Python pool's bench preprocess cache
|
|
19411
|
-
* (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
|
|
19412
|
-
* preprocessed ONCE and every later inference is a pure-inference cache
|
|
19413
|
-
* hit — the sustained-throughput run measures inference, not
|
|
19414
|
-
* decode+preprocess+infer. Omitted/0 for live frames (all different →
|
|
19415
|
-
* full preprocess every call, correct). Fresh per sustained run;
|
|
19416
|
-
* released via `uncacheFrame`.
|
|
19417
|
-
*/
|
|
19418
|
-
frameId: number().int().nonnegative().optional(),
|
|
19419
|
-
/** Inference-device selector (Phase 2 multi-device); see runPipeline. */
|
|
19420
|
-
deviceKey: string().optional()
|
|
19421
|
-
}), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
|
|
19422
|
-
data: _instanceof(Uint8Array),
|
|
19423
|
-
width: number().int().positive(),
|
|
19424
|
-
height: number().int().positive(),
|
|
19425
|
-
format: _enum([
|
|
19426
|
-
"rgb",
|
|
19427
|
-
"bgr",
|
|
19428
|
-
"gray"
|
|
19429
|
-
])
|
|
19430
|
-
}), object({
|
|
19431
|
-
frameId: number(),
|
|
19432
|
-
width: number(),
|
|
19433
|
-
height: number()
|
|
19434
|
-
}), { kind: "mutation" }), method(object({
|
|
19435
|
-
stepId: string(),
|
|
19436
|
-
frameId: number().int()
|
|
19437
|
-
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(_void(), object({
|
|
19438
|
-
batchMode: string(),
|
|
19439
|
-
windowMs: number(),
|
|
19440
|
-
maxBatchSize: number(),
|
|
19441
|
-
concurrency: number()
|
|
19442
|
-
})), method(_void(), array(object({
|
|
19443
|
-
engineKey: string(),
|
|
19444
|
-
engine: PipelineEngineChoiceSchema,
|
|
19445
|
-
modelsLoaded: array(string()).readonly(),
|
|
19446
|
-
inUseByCameras: array(number()).readonly(),
|
|
19447
|
-
/**
|
|
19448
|
-
* Origin of this resident factory.
|
|
19449
|
-
* - `runtime` — main camera-serving engine (no idle TTL).
|
|
19450
|
-
* - `warm-override` — benchmark/test override held in the warm
|
|
19451
|
-
* cache; auto-disposed after the idle TTL.
|
|
19452
|
-
* - `device-pool` — a concurrent per-device pool (Phase 2
|
|
19453
|
-
* multi-device, keyed by `deviceKey`) resolved
|
|
19454
|
-
* via `resolveDeviceFactory`. Runs alongside the
|
|
19455
|
-
* `runtime` engine on a DIFFERENT accelerator
|
|
19456
|
-
* (NPU / iGPU / Coral) — this is how the
|
|
19457
|
-
* Engines tab shows all pools running at once.
|
|
19458
|
-
*/
|
|
19459
|
-
kind: _enum([
|
|
19460
|
-
"runtime",
|
|
19461
|
-
"warm-override",
|
|
19462
|
-
"device-pool"
|
|
19463
|
-
]),
|
|
19464
|
-
/** Native pid of the underlying Python pool (null when no pool). */
|
|
19465
|
-
poolPid: number().nullable(),
|
|
19466
|
-
/** ms since this factory was last used (null when not warm-tracked). */
|
|
19467
|
-
idleMs: number().nullable(),
|
|
19468
|
-
/** Idle TTL after which `warm-override` factories self-evict (null when not applicable). */
|
|
19469
|
-
idleTtlMs: number().nullable()
|
|
19470
|
-
})).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
|
|
19471
|
-
kind: "mutation",
|
|
19472
|
-
auth: "admin"
|
|
19473
|
-
}), method(object({
|
|
19474
|
-
engine: PipelineEngineChoiceSchema,
|
|
19475
|
-
force: boolean().optional()
|
|
19476
|
-
}), object({
|
|
19477
|
-
success: boolean(),
|
|
19478
|
-
reason: string().optional()
|
|
19479
|
-
}), {
|
|
19480
|
-
kind: "mutation",
|
|
19481
|
-
auth: "admin"
|
|
19482
|
-
}), 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({
|
|
19483
|
-
addonId: string(),
|
|
19484
|
-
modelId: string(),
|
|
19485
|
-
filename: string().optional(),
|
|
19486
|
-
settings: record(string(), unknown()).optional()
|
|
19487
|
-
}), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
|
|
19488
|
-
/**
|
|
19489
|
-
* Per-stage gating mode applied to the zones a rule references.
|
|
19490
|
-
*
|
|
19491
|
-
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
19492
|
-
* When at least one `include` rule fires for a stage, only entities
|
|
19493
|
-
* inside one of those zones pass that stage.
|
|
19494
|
-
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
19495
|
-
* Entities inside one of those zones are dropped at that stage.
|
|
19496
|
-
*
|
|
19497
|
-
* `monitor`-style observation (count without filtering) is not a rule
|
|
19498
|
-
* mode — zones without any matching rule are observed naturally by
|
|
19499
|
-
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
19500
|
-
* count, not filter" use case needs no rule at all.
|
|
19501
|
-
*/
|
|
19502
|
-
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
19503
|
-
/**
|
|
19504
|
-
* Per-consumer rule that references existing zones (geometry) and
|
|
19505
|
-
* defines how a specific pipeline stage should treat them. Each
|
|
19506
|
-
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
19507
|
-
* settings:
|
|
19508
|
-
*
|
|
19509
|
-
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
19510
|
-
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
19511
|
-
* - future: notification rules, audio gating, etc.
|
|
19512
|
-
*
|
|
19513
|
-
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
19514
|
-
* express "ignore motion in ALL of {garden, street}" with a single
|
|
19515
|
-
* rule. `classFilter` narrows the rule to specific object classes —
|
|
19516
|
-
* "drop person detections in the street, but keep cars" is one
|
|
19517
|
-
* `exclude` rule with `classFilter: ['person']`.
|
|
19518
|
-
*
|
|
19519
|
-
* `enabled` is a soft toggle — the operator can keep the rule
|
|
19520
|
-
* configured but inert without deleting it.
|
|
19521
|
-
*/
|
|
19522
|
-
var ZoneRuleSchema = object({
|
|
19523
|
-
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
19524
|
-
id: string(),
|
|
19525
|
-
/** Optional human-readable label rendered in the rule editor. */
|
|
19526
|
-
name: string().optional(),
|
|
19527
|
-
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
19528
|
-
* listed zones (OR-set: a detection in any one of them counts).
|
|
19529
|
-
* At least one zone id required — a rule with no targets is a
|
|
19530
|
-
* configuration mistake and the form validator rejects it. */
|
|
19531
|
-
zoneIds: array(string()).min(1).readonly(),
|
|
19532
|
-
mode: ZoneRuleModeEnum,
|
|
19533
|
-
/**
|
|
19534
|
-
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
19535
|
-
* applies to every class. Class strings match the `macroClass`
|
|
19536
|
-
* field on detections (e.g. `person`, `car`, `dog`).
|
|
19537
|
-
*/
|
|
19538
|
-
classFilter: array(string()).readonly().optional(),
|
|
19539
|
-
/**
|
|
19540
|
-
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
19541
|
-
* required to consider an entity "in the zone". Defaults to the
|
|
19542
|
-
* consumer's stage default when omitted. Kept for back-compat with
|
|
19543
|
-
* existing per-rule overrides; new operators pick the value via
|
|
19544
|
-
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
19545
|
-
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
19546
|
-
*/
|
|
19547
|
-
overlapThreshold: number().min(0).max(1).optional(),
|
|
19548
|
-
/**
|
|
19549
|
-
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
19550
|
-
* of the detection's bbox that must lie inside the zone for the
|
|
19551
|
-
* rule to match. Documented default is 85%; the engine substitutes
|
|
19552
|
-
* that when the field is omitted (kept optional so existing rules
|
|
19553
|
-
* stored without it stay valid).
|
|
19554
|
-
*
|
|
19555
|
-
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
19556
|
-
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
19557
|
-
* field exposed in the UI. Internally both feed the same gate.
|
|
19558
|
-
*/
|
|
19559
|
-
bboxInclusionPct: number().min(0).max(100).optional(),
|
|
19560
|
-
/**
|
|
19561
|
-
* When `true` and a detection has a segmentation mask, use the
|
|
19562
|
-
* mask for overlap instead of the bbox. Detection-stage only;
|
|
19563
|
-
* motion rules ignore this field.
|
|
19564
|
-
*/
|
|
19565
|
-
preferMask: boolean().optional(),
|
|
19566
|
-
/**
|
|
19567
|
-
* Soft-toggle: `false` disables the rule without deleting it.
|
|
19568
|
-
* Defaults to `true` so operators creating a rule via the UI
|
|
19569
|
-
* see it active immediately.
|
|
19570
|
-
*/
|
|
19571
|
-
enabled: boolean().default(true)
|
|
19572
|
-
});
|
|
19573
|
-
array(ZoneRuleSchema).readonly();
|
|
19574
|
-
/**
|
|
19575
|
-
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
19576
|
-
*
|
|
19577
|
-
* Zones describe **where** in the frame the operator wants to flag
|
|
19578
|
-
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
19579
|
-
* each pipeline stage uses them. Splitting the two means a single
|
|
19580
|
-
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
19581
|
-
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
19582
|
-
* — without three duplicated polygons.
|
|
19583
|
-
*
|
|
19584
|
-
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
19585
|
-
* `zones` device-state slice on every mutation. Consumers
|
|
19586
|
-
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
19587
|
-
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
19588
|
-
* mirror with `onChanged`).
|
|
19589
|
-
*
|
|
19590
|
-
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
19591
|
-
* survive resolution changes and stream profile switches.
|
|
19592
|
-
*
|
|
19593
|
-
* `kind` discriminates between full polygons (closed regions used
|
|
19594
|
-
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
19595
|
-
* line segments used for cross events). Onboard / firmware-reported
|
|
19596
|
-
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
19597
|
-
* task list.
|
|
19598
|
-
*/
|
|
19599
|
-
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
19600
|
-
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
19601
|
-
var PolygonPointSchema = object({
|
|
19602
|
-
x: number(),
|
|
19603
|
-
y: number()
|
|
19604
|
-
});
|
|
19605
|
-
/** A camera detection zone — pure geometry/identity. */
|
|
19606
|
-
var ZoneSchema = object({
|
|
19607
|
-
id: string(),
|
|
19608
|
-
name: string(),
|
|
19609
|
-
kind: ZoneKindEnum.default("polygon"),
|
|
19610
|
-
/** Polygon vertices, fraction of frame (0–1). */
|
|
19611
|
-
polygon: array(PolygonPointSchema).readonly(),
|
|
19612
|
-
/** Visual color for UI rendering. */
|
|
19613
|
-
color: string().default("#3b82f6")
|
|
19614
|
-
});
|
|
19615
|
-
DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).readonly()), method(object({
|
|
19616
|
-
deviceId: number(),
|
|
19617
|
-
zone: ZoneSchema
|
|
19618
|
-
}), _void(), {
|
|
19619
|
-
kind: "mutation",
|
|
19620
|
-
auth: "admin"
|
|
19621
|
-
}), method(object({
|
|
19622
|
-
deviceId: number(),
|
|
19623
|
-
zoneId: string()
|
|
19624
|
-
}), _void(), {
|
|
19625
|
-
kind: "mutation",
|
|
19626
|
-
auth: "admin"
|
|
19627
|
-
}), method(object({
|
|
19628
|
-
deviceId: number(),
|
|
19629
|
-
zone: ZoneSchema
|
|
19630
|
-
}), _void(), {
|
|
19631
|
-
kind: "mutation",
|
|
19632
|
-
auth: "admin"
|
|
19633
|
-
}), object({ zones: array(ZoneSchema).readonly() });
|
|
19634
|
-
/**
|
|
19635
|
-
* pipeline-analytics — device-scoped wrapper cap. Refines raw
|
|
19636
|
-
* per-frame detections emitted by the pipeline runner into tracked
|
|
19637
|
-
* objects, per-kind event collections (motion / object / audio), and
|
|
19638
|
-
* persisted media. Owns the post-detection domain end-to-end:
|
|
19639
|
-
*
|
|
19640
|
-
* runner emits PipelineInferenceResult
|
|
19641
|
-
* ↓ (event bus)
|
|
19642
|
-
* pipeline-analytics subscriber
|
|
19643
|
-
* ↓ SORT tracker + zone engine + state analyzer + event emitter
|
|
19644
|
-
* → three DB collections (one per kind), one FS media tree, one
|
|
19645
|
-
* unified event emitter (FrameTracked + TrackStarted/Ended +
|
|
19646
|
-
* DetectionEvent on bus)
|
|
19647
|
-
*
|
|
19648
|
-
* Pure subscriber model. No `processFrame` cap method — the runner
|
|
19649
|
-
* already publishes the raw frame on the bus. The cap surface is
|
|
19650
|
-
* only QUERIES + per-device settings, bound on/off via
|
|
19651
|
-
* `device-manager.setWrapperActive`. `defaultActive: true` because
|
|
19652
|
-
* every camera with a detection pipeline wants its raw detections
|
|
19653
|
-
* refined; operators opt out per-device via BindingsTab when needed.
|
|
19654
|
-
*
|
|
19655
|
-
* Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
|
|
19656
|
-
* (per-device surface) and `track-trail` caps — see P11 cleanup.
|
|
19657
|
-
*/
|
|
19658
|
-
var TrackStateSchema = _enum([
|
|
19659
|
-
"new",
|
|
19660
|
-
"entered",
|
|
19661
|
-
"left",
|
|
19662
|
-
"moving",
|
|
19663
|
-
"idle"
|
|
19664
|
-
]);
|
|
19665
|
-
var EventKindSchema = _enum([
|
|
19666
|
-
"motion",
|
|
19667
|
-
"object",
|
|
19668
|
-
"audio"
|
|
19669
|
-
]);
|
|
19670
|
-
/**
|
|
19671
|
-
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
19672
|
-
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
19673
|
-
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
19674
|
-
*/
|
|
19675
|
-
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
19676
|
-
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
19677
|
-
var EventKindIconSchema = _enum([
|
|
19678
|
-
"motion",
|
|
19679
|
-
"audio",
|
|
19680
|
-
"person",
|
|
19681
|
-
"vehicle",
|
|
19682
|
-
"animal",
|
|
19683
|
-
"door",
|
|
19684
|
-
"pir",
|
|
19685
|
-
"smoke",
|
|
19686
|
-
"water",
|
|
19687
|
-
"button",
|
|
19688
|
-
"package",
|
|
19689
|
-
"generic"
|
|
19690
|
-
]);
|
|
19691
|
-
var EventKindCategorySchema = _enum([
|
|
19692
|
-
"motion",
|
|
19693
|
-
"audio",
|
|
19694
|
-
"detection",
|
|
19695
|
-
"sensor",
|
|
19696
|
-
"control",
|
|
19697
|
-
"custom",
|
|
19698
|
-
"package"
|
|
19699
|
-
]);
|
|
19700
|
-
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
19701
|
-
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
19702
|
-
var EventKindDescriptorSchema = object({
|
|
19703
|
-
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
19704
|
-
kind: string(),
|
|
19705
|
-
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
19706
|
-
labelKey: string(),
|
|
19707
|
-
/** English fallback label (kept for clients that don't translate). */
|
|
19708
|
-
label: string(),
|
|
19709
|
-
/** Hex color for timeline/legend rendering. */
|
|
19710
|
-
color: string(),
|
|
19711
|
-
/** Dictionary id → lucide component on the UI side. */
|
|
19712
|
-
iconId: string(),
|
|
19713
|
-
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
19714
|
-
icon: EventKindIconSchema,
|
|
19715
|
-
category: EventKindCategorySchema,
|
|
19716
|
-
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
19717
|
-
parentKind: string().nullable(),
|
|
19718
|
-
/** Derived from `parentKind`, explicit for the client tree. */
|
|
19719
|
-
level: EventKindLevelSchema,
|
|
19720
|
-
/** Which cap + device contributes this kind. For built-ins the camera
|
|
19721
|
-
* itself; for sensor kinds the LINKED source device. */
|
|
19722
|
-
source: object({
|
|
19723
|
-
capName: string(),
|
|
19724
|
-
deviceId: number()
|
|
19725
|
-
})
|
|
19726
|
-
});
|
|
19727
|
-
/** One camera's event vocabulary, as returned by `listEventKindsBatch`. */
|
|
19728
|
-
var EventKindsForDeviceSchema = object({
|
|
19729
|
-
deviceId: number(),
|
|
19730
|
-
kinds: array(EventKindDescriptorSchema).readonly()
|
|
19731
|
-
});
|
|
19732
|
-
var SensorEventSchema = object({
|
|
19733
|
-
id: string(),
|
|
19734
|
-
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
19735
|
-
* yields N rows, one per camera). */
|
|
19736
|
-
deviceId: number(),
|
|
19737
|
-
/** The linked sensor device whose state changed. */
|
|
19738
|
-
sourceDeviceId: number(),
|
|
19739
|
-
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
19740
|
-
kind: string(),
|
|
19741
|
-
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
19742
|
-
value: record(string(), unknown()).nullable(),
|
|
19743
|
-
timestamp: number()
|
|
19744
|
-
});
|
|
19745
|
-
/**
|
|
19746
|
-
* One stored sighting on a track's trajectory.
|
|
19747
|
-
*
|
|
19748
|
-
* The array these live in is returned in TIME order (D399) — it is APPENDED in
|
|
19749
|
-
* arrival order, and the two detector passes interleave, so a consumer must not
|
|
19750
|
-
* assume the two are the same on a row written by an older build.
|
|
19751
|
-
*/
|
|
19752
|
-
var TrackPositionSchema = object({
|
|
19753
|
-
x: number(),
|
|
19754
|
-
y: number(),
|
|
19755
|
-
timestamp: number(),
|
|
19756
|
-
bbox: BoundingBoxSchema,
|
|
19757
|
-
/**
|
|
19758
|
-
* Which detector pass measured this box (D399): `frame` is the full-frame
|
|
19759
|
-
* pass on the analysis raster, `recovery` is the native-resolution
|
|
19760
|
-
* small-subject second pass (D377/D378). Both write into one array, and until
|
|
19761
|
-
* this field existed the only way to tell them apart was that full-frame boxes
|
|
19762
|
-
* are exact multiples of 1.2 while recovery boxes are full-precision floats.
|
|
19763
|
-
* Absent on rows written before D399.
|
|
19764
|
-
*/
|
|
19765
|
-
source: _enum(["frame", "recovery"]).optional(),
|
|
19766
|
-
/** Detection score of this box, so a position can be weighed and not only
|
|
19767
|
-
* plotted. Absent on rows written before D399. */
|
|
19768
|
-
score: number().optional()
|
|
19769
|
-
});
|
|
19770
|
-
var TrackSnapshotSchema = object({
|
|
19771
|
-
timestamp: number(),
|
|
19772
|
-
position: TrackPositionSchema,
|
|
19773
|
-
/** The snapshot's media row id (D482); resolve via `listTrackMedia({ trackId })`. */
|
|
19774
|
-
mediaId: number().int()
|
|
19775
|
-
});
|
|
19776
|
-
/**
|
|
19777
|
-
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
19778
|
-
* divided by the track's detection-frame dims), computed at persist time.
|
|
19779
|
-
* Absent when the frame dims were unknown when the track was persisted
|
|
19780
|
-
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
19781
|
-
*/
|
|
19782
|
-
var TrackEnvelopeSchema = object({
|
|
19783
|
-
minX: number(),
|
|
19784
|
-
minY: number(),
|
|
19785
|
-
maxX: number(),
|
|
19786
|
-
maxY: number()
|
|
19588
|
+
/**
|
|
19589
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
19590
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
19591
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
19592
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
19593
|
+
*/
|
|
19594
|
+
var TrackEnvelopeSchema = object({
|
|
19595
|
+
minX: number(),
|
|
19596
|
+
minY: number(),
|
|
19597
|
+
maxX: number(),
|
|
19598
|
+
maxY: number()
|
|
19787
19599
|
});
|
|
19788
19600
|
/**
|
|
19789
19601
|
* Row projection for track list queries. `full` (default) returns the
|
|
@@ -20202,6 +20014,22 @@ var TrackSchema = object({
|
|
|
20202
20014
|
* omit it. Render nothing when absent.
|
|
20203
20015
|
*/
|
|
20204
20016
|
previewMissReason: string().optional(),
|
|
20017
|
+
/**
|
|
20018
|
+
* The ROOT model that produced this track — the `FrameResult.rootModelId` of
|
|
20019
|
+
* the frame it was BORN on (D646). What a later replay compares against, so
|
|
20020
|
+
* "the original model" is named rather than assumed. A birth fact: never
|
|
20021
|
+
* rewritten by a later frame. **Absent ≠ unknown-model**: a row from before
|
|
20022
|
+
* the column, and a track the camera's own detector produced, carry none.
|
|
20023
|
+
*/
|
|
20024
|
+
modelId: string().optional(),
|
|
20025
|
+
/**
|
|
20026
|
+
* Size (px) of the detection frame this track's `positions[].bbox` live in —
|
|
20027
|
+
* the frame it was born on, else the camera's latest analysis frame at
|
|
20028
|
+
* persist time. Divide a position by these to normalise it. Absent when the
|
|
20029
|
+
* size was never known.
|
|
20030
|
+
*/
|
|
20031
|
+
frameWidth: number().optional(),
|
|
20032
|
+
frameHeight: number().optional(),
|
|
20205
20033
|
...TrackFlagFields,
|
|
20206
20034
|
...TrackRetrainFields
|
|
20207
20035
|
});
|
|
@@ -20431,7 +20259,8 @@ var MediaFileKindEnum = _enum([
|
|
|
20431
20259
|
"thumbnailSmall",
|
|
20432
20260
|
"confirmationCrop",
|
|
20433
20261
|
"debugCrop",
|
|
20434
|
-
"sceneFrame"
|
|
20262
|
+
"sceneFrame",
|
|
20263
|
+
"lastSceneFrame"
|
|
20435
20264
|
]);
|
|
20436
20265
|
/**
|
|
20437
20266
|
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
@@ -20983,7 +20812,23 @@ var SearchObjectEventsInput = object({
|
|
|
20983
20812
|
until: number().optional(),
|
|
20984
20813
|
classFilter: string().optional(),
|
|
20985
20814
|
limit: number().default(50),
|
|
20986
|
-
|
|
20815
|
+
/**
|
|
20816
|
+
* An ABSOLUTE cosine floor. Optional since D649: a floor is a property of the
|
|
20817
|
+
* model (0.2 kept 96% of matched pairs on MobileCLIP S1 and 2.7% on SigLIP2),
|
|
20818
|
+
* so an absent one resolves to the searched model's own `searchMinScore`
|
|
20819
|
+
* scaled by `strictness`. A number sent here is honoured verbatim.
|
|
20820
|
+
*/
|
|
20821
|
+
minScore: number().min(0).max(1).optional(),
|
|
20822
|
+
/** Model-relative floor — see `resolveClipSearchMinScore`. Default `loose`. */
|
|
20823
|
+
strictness: ClipSearchStrictnessSchema.optional(),
|
|
20824
|
+
/**
|
|
20825
|
+
* Search THIS CLIP model's index instead of the cluster row's. Every index a
|
|
20826
|
+
* model ever wrote stays searchable until it is wiped (the MobileCLIP index
|
|
20827
|
+
* through a SigLIP2 cutover and its rollback window). An id with no CLIP
|
|
20828
|
+
* metadata is refused; an id other than the cluster row's is ADMIN-only
|
|
20829
|
+
* (`model-override-requires-admin`).
|
|
20830
|
+
*/
|
|
20831
|
+
modelId: string().min(1).optional()
|
|
20987
20832
|
});
|
|
20988
20833
|
var TrackCascadeCountsSchema = object({
|
|
20989
20834
|
/** Persisted track roots deleted (authoritative). */
|
|
@@ -21118,7 +20963,41 @@ var RebuildObjectEmbeddingsInput = object({
|
|
|
21118
20963
|
* comparable, so wiping and rebuilding is the only way to be sure every vector
|
|
21119
20964
|
* means the same thing.
|
|
21120
20965
|
*/
|
|
21121
|
-
var WipeObjectEmbeddingsResultSchema = object({
|
|
20966
|
+
var WipeObjectEmbeddingsResultSchema = object({
|
|
20967
|
+
deleted: number(),
|
|
20968
|
+
/**
|
|
20969
|
+
* CLIP indexes that could NOT be emptied (unreachable, or refused at their
|
|
20970
|
+
* dimension) — not a clean slate. Additive and optional (D649).
|
|
20971
|
+
*/
|
|
20972
|
+
failedIndexes: array(string()).optional()
|
|
20973
|
+
});
|
|
20974
|
+
/**
|
|
20975
|
+
* Why a rebuild did not start, BY NAME — ONE vocabulary for both gates in front
|
|
20976
|
+
* of a pass (D649 over D651). A bare `started: false` read the same for "the
|
|
20977
|
+
* stores are booting" and "the cluster row names a model with no CLIP
|
|
20978
|
+
* metadata", which need different fixes.
|
|
20979
|
+
* - `stores-unavailable` — the analytics stores or the API are not up yet.
|
|
20980
|
+
* - the owner's confirmation of the cluster model (D651, `ClusterPinConfirmer`):
|
|
20981
|
+
* a pass that rewrites an index needs two agreeing reads of the OWNER's
|
|
20982
|
+
* answer (`pipelineOrchestrator.getClusterModelChoice`) — a pass that cannot
|
|
20983
|
+
* name its model does not run (D54):
|
|
20984
|
+
* - the owner's own `unreadable` reasons (`owner-not-ready`,
|
|
20985
|
+
* `store-read-failed`, `three-way-read-unavailable`, `invalid-stored`,
|
|
20986
|
+
* `not-cluster-scoped`);
|
|
20987
|
+
* - `method-unavailable` — the orchestrator predates the method;
|
|
20988
|
+
* - `read-failed` — the call failed or answered something unparseable;
|
|
20989
|
+
* - `reads-disagree` — the two reads named different choices.
|
|
20990
|
+
* - `not-a-clip-model` — the CONFIRMED id has no CLIP metadata, so there is no
|
|
20991
|
+
* index to fill and no dimension to check against (D649).
|
|
20992
|
+
*/
|
|
20993
|
+
var RebuildObjectEmbeddingsRefusalSchema = _enum([
|
|
20994
|
+
"stores-unavailable",
|
|
20995
|
+
...CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS,
|
|
20996
|
+
"method-unavailable",
|
|
20997
|
+
"read-failed",
|
|
20998
|
+
"reads-disagree",
|
|
20999
|
+
"not-a-clip-model"
|
|
21000
|
+
]);
|
|
21122
21001
|
/**
|
|
21123
21002
|
* Acknowledgement that a rebuild STARTED.
|
|
21124
21003
|
*
|
|
@@ -21131,7 +21010,12 @@ var WipeObjectEmbeddingsResultSchema = object({ deleted: number() });
|
|
|
21131
21010
|
var RebuildObjectEmbeddingsResultSchema = object({
|
|
21132
21011
|
started: boolean(),
|
|
21133
21012
|
/** True when a pass was already running; the new request is ignored. */
|
|
21134
|
-
alreadyRunning: boolean()
|
|
21013
|
+
alreadyRunning: boolean(),
|
|
21014
|
+
/** Present when the pass refused to start — see `RebuildObjectEmbeddingsRefusalSchema`. */
|
|
21015
|
+
refusal: RebuildObjectEmbeddingsRefusalSchema.optional(),
|
|
21016
|
+
/** The CLIP model the pass pinned, and the index it fills (when it started). */
|
|
21017
|
+
modelId: string().optional(),
|
|
21018
|
+
index: string().optional()
|
|
21135
21019
|
});
|
|
21136
21020
|
var RebuildStatusSchema = object({
|
|
21137
21021
|
running: boolean(),
|
|
@@ -21165,7 +21049,11 @@ var RebuildStatusSchema = object({
|
|
|
21165
21049
|
startedAtMs: number().nullable(),
|
|
21166
21050
|
finishedAtMs: number().nullable(),
|
|
21167
21051
|
/** Present when the pass ended by throwing. */
|
|
21168
|
-
error: string().nullable()
|
|
21052
|
+
error: string().nullable(),
|
|
21053
|
+
/** The CLIP model the current / last pass pinned (D54), `null` before any. */
|
|
21054
|
+
modelId: string().nullable(),
|
|
21055
|
+
/** The index that pass fills — `ClipModelMeta.vectorIndex` of `modelId` (D649). */
|
|
21056
|
+
index: string().nullable()
|
|
21169
21057
|
});
|
|
21170
21058
|
/**
|
|
21171
21059
|
* Acknowledgement that a debug-media reclaim STARTED.
|
|
@@ -21208,24 +21096,6 @@ var MediaReclaimStatusSchema = object({
|
|
|
21208
21096
|
finishedAtMs: number().nullable(),
|
|
21209
21097
|
error: string().nullable()
|
|
21210
21098
|
});
|
|
21211
|
-
var ReplayFrameInputSchema = object({
|
|
21212
|
-
timestamp: number(),
|
|
21213
|
-
frame: PipelineRunResultBridge
|
|
21214
|
-
});
|
|
21215
|
-
var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
21216
|
-
className: string(),
|
|
21217
|
-
firstSeenMs: number(),
|
|
21218
|
-
lastSeenMs: number(),
|
|
21219
|
-
/** Bbox of the track's FIRST matched detection, pixel-space in the clip's
|
|
21220
|
-
* frame — a representative box for the diff's `(className, window, IoU)`
|
|
21221
|
-
* pairing (`replay-diff.ts`). A replay does not need the full per-frame
|
|
21222
|
-
* trajectory production's `Track.positions` keeps. */
|
|
21223
|
-
bbox: BoundingBoxSchema,
|
|
21224
|
-
/** How many of the input frames this track matched a real detection on
|
|
21225
|
-
* (never a coasted/extrapolated frame) — the replay's own signal for "how
|
|
21226
|
-
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
21227
|
-
framesMatched: number().int()
|
|
21228
|
-
})).readonly() });
|
|
21229
21099
|
/**
|
|
21230
21100
|
* The long-term series a camera produces. A closed union so a typo cannot
|
|
21231
21101
|
* invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
|
|
@@ -21385,162 +21255,624 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21385
21255
|
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
21386
21256
|
kind: "mutation",
|
|
21387
21257
|
auth: "admin"
|
|
21388
|
-
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
21389
|
-
kind: "query",
|
|
21390
|
-
auth: "admin"
|
|
21391
|
-
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
21392
|
-
kind: "query",
|
|
21393
|
-
auth: "admin"
|
|
21394
|
-
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
21258
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
21259
|
+
kind: "query",
|
|
21260
|
+
auth: "admin"
|
|
21261
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
21262
|
+
kind: "query",
|
|
21263
|
+
auth: "admin"
|
|
21264
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
21265
|
+
kind: "mutation",
|
|
21266
|
+
auth: "admin"
|
|
21267
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
21268
|
+
kind: "query",
|
|
21269
|
+
auth: "admin"
|
|
21270
|
+
}), method(MediaReclaimInputSchema, MediaReclaimStartResultSchema, {
|
|
21271
|
+
kind: "mutation",
|
|
21272
|
+
auth: "admin"
|
|
21273
|
+
}), method(object({}), MediaReclaimStatusSchema, {
|
|
21274
|
+
kind: "query",
|
|
21275
|
+
auth: "admin"
|
|
21276
|
+
}), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
|
|
21277
|
+
kind: "query",
|
|
21278
|
+
auth: "admin"
|
|
21279
|
+
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
21280
|
+
kind: "query",
|
|
21281
|
+
auth: "admin"
|
|
21282
|
+
}), method(object({
|
|
21283
|
+
/** Empty ⇒ every camera that has staging tracks. A LIST, not a single
|
|
21284
|
+
* `deviceId`, deliberately: `deviceId` would make this device-bound and
|
|
21285
|
+
* route it at one camera's owner, and "every camera" would stop being
|
|
21286
|
+
* expressible at all. */
|
|
21287
|
+
deviceIds: array(number()).optional(),
|
|
21288
|
+
limit: number().int().min(1).max(500).optional()
|
|
21289
|
+
}), array(RetrainTrackSchema).readonly(), {
|
|
21290
|
+
kind: "query",
|
|
21291
|
+
auth: "admin"
|
|
21292
|
+
}), method(object({ trackId: string() }), RetrainFrameListSchema, {
|
|
21293
|
+
kind: "query",
|
|
21294
|
+
auth: "admin"
|
|
21295
|
+
}), method(object({
|
|
21296
|
+
deviceId: number(),
|
|
21297
|
+
trackId: string(),
|
|
21298
|
+
mediaIds: array(number().int()).min(1)
|
|
21299
|
+
}), RetrainFrameSelectionSchema, {
|
|
21300
|
+
kind: "mutation",
|
|
21301
|
+
auth: "admin"
|
|
21302
|
+
}), method(object({
|
|
21303
|
+
deviceId: number(),
|
|
21304
|
+
trackId: string(),
|
|
21305
|
+
frameId: string()
|
|
21306
|
+
}), object({
|
|
21307
|
+
removed: boolean(),
|
|
21308
|
+
removedAnnotations: number().int()
|
|
21309
|
+
}), {
|
|
21310
|
+
kind: "mutation",
|
|
21311
|
+
auth: "admin"
|
|
21312
|
+
}), method(object({ frameId: string() }), object({
|
|
21313
|
+
base64: string(),
|
|
21314
|
+
width: number().int(),
|
|
21315
|
+
height: number().int()
|
|
21316
|
+
}), {
|
|
21317
|
+
kind: "query",
|
|
21318
|
+
auth: "admin"
|
|
21319
|
+
}), method(object({
|
|
21320
|
+
deviceId: number(),
|
|
21321
|
+
trackId: string(),
|
|
21322
|
+
frameId: string(),
|
|
21323
|
+
subject: RetrainAssistSubjectSchema,
|
|
21324
|
+
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
21325
|
+
nodeId: string().optional()
|
|
21326
|
+
}), RetrainAssistResultSchema, {
|
|
21327
|
+
kind: "mutation",
|
|
21328
|
+
auth: "admin"
|
|
21329
|
+
}), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
|
|
21330
|
+
kind: "query",
|
|
21331
|
+
auth: "admin"
|
|
21332
|
+
}), method(object({
|
|
21333
|
+
deviceId: number(),
|
|
21334
|
+
trackId: string(),
|
|
21335
|
+
frameId: string(),
|
|
21336
|
+
annotations: array(RetrainAnnotationDraftSchema)
|
|
21337
|
+
}), array(RetrainAnnotationSchema).readonly(), {
|
|
21338
|
+
kind: "mutation",
|
|
21339
|
+
auth: "admin"
|
|
21340
|
+
}), method(object({
|
|
21341
|
+
deviceId: number(),
|
|
21342
|
+
trackId: string()
|
|
21343
|
+
}), RetrainTransitionResultSchema, {
|
|
21344
|
+
kind: "mutation",
|
|
21345
|
+
auth: "admin"
|
|
21346
|
+
}), method(object({
|
|
21347
|
+
deviceId: number(),
|
|
21348
|
+
trackId: string()
|
|
21349
|
+
}), RetrainTransitionResultSchema, {
|
|
21350
|
+
kind: "mutation",
|
|
21351
|
+
auth: "admin"
|
|
21352
|
+
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
21353
|
+
kind: "query",
|
|
21354
|
+
auth: "admin"
|
|
21355
|
+
}), method(object({
|
|
21356
|
+
/** Which of the three event tables owns the row. */
|
|
21357
|
+
ownerType: EventOwnerTypeSchema,
|
|
21358
|
+
/** The event's rowid in that table (D474: an event id is a number). */
|
|
21359
|
+
eventId: number().int(),
|
|
21360
|
+
kind: MediaFileKindEnum.optional(),
|
|
21361
|
+
deviceId: number()
|
|
21362
|
+
}), array(MediaFileSchema).readonly()), method(object({
|
|
21363
|
+
trackId: string(),
|
|
21364
|
+
kinds: array(MediaFileKindEnum).optional(),
|
|
21365
|
+
deviceId: number()
|
|
21366
|
+
}), array(MediaFileSchema).readonly()), method(object({
|
|
21367
|
+
trackId: string(),
|
|
21368
|
+
deviceId: number()
|
|
21369
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
21370
|
+
ownerType: EventOwnerTypeSchema,
|
|
21371
|
+
eventId: number().int(),
|
|
21372
|
+
deviceId: number()
|
|
21373
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
21374
|
+
deviceId: number(),
|
|
21375
|
+
ownerKind: MediaPresenceOwnerKindSchema,
|
|
21376
|
+
ownerIds: array(string()).max(5e3)
|
|
21377
|
+
}), array(string()).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly(), { caller: "required" }), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
21378
|
+
kind: "mutation",
|
|
21379
|
+
auth: "admin"
|
|
21380
|
+
}), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
|
|
21381
|
+
kind: "mutation",
|
|
21382
|
+
auth: "admin"
|
|
21383
|
+
}), method(object({}), RebuildStatusSchema), object({
|
|
21384
|
+
deviceId: number(),
|
|
21385
|
+
timestamp: number(),
|
|
21386
|
+
frameWidth: number(),
|
|
21387
|
+
frameHeight: number(),
|
|
21388
|
+
detections: array(OverlayDetectionSchema).readonly()
|
|
21389
|
+
}), object({
|
|
21390
|
+
deviceId: number(),
|
|
21391
|
+
trackId: string(),
|
|
21392
|
+
className: string()
|
|
21393
|
+
}), object({
|
|
21394
|
+
deviceId: number(),
|
|
21395
|
+
trackId: string(),
|
|
21396
|
+
className: string(),
|
|
21397
|
+
durationMs: number()
|
|
21398
|
+
}), object({
|
|
21399
|
+
deviceId: number(),
|
|
21400
|
+
kind: EventKindSchema,
|
|
21401
|
+
eventId: string(),
|
|
21402
|
+
timestamp: number()
|
|
21403
|
+
});
|
|
21404
|
+
/**
|
|
21405
|
+
* Reference to the frame's retained NATIVE surface + the parent crop's placement
|
|
21406
|
+
* within the frame, so the executor can re-cut a leaf child ROI at native
|
|
21407
|
+
* resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
|
|
21408
|
+
*/
|
|
21409
|
+
var NativeCropRefSchema = object({
|
|
21410
|
+
/** Handle keying the retained native surface (node-pinned to its owner). */
|
|
21411
|
+
handle: FrameHandleSchema,
|
|
21412
|
+
/** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
|
|
21413
|
+
cropFrameSpace: object({
|
|
21414
|
+
x: number(),
|
|
21415
|
+
y: number(),
|
|
21416
|
+
w: number(),
|
|
21417
|
+
h: number()
|
|
21418
|
+
})
|
|
21419
|
+
});
|
|
21420
|
+
object({
|
|
21421
|
+
crop: object({
|
|
21422
|
+
left: number(),
|
|
21423
|
+
top: number(),
|
|
21424
|
+
width: number().positive(),
|
|
21425
|
+
height: number().positive()
|
|
21426
|
+
}).optional(),
|
|
21427
|
+
content: object({
|
|
21428
|
+
width: number().int().positive(),
|
|
21429
|
+
height: number().int().positive()
|
|
21430
|
+
}),
|
|
21431
|
+
fit: _enum(["stretch", "contain"]),
|
|
21432
|
+
format: _enum([
|
|
21433
|
+
"rgb",
|
|
21434
|
+
"gray",
|
|
21435
|
+
"jpeg"
|
|
21436
|
+
])
|
|
21437
|
+
});
|
|
21438
|
+
/**
|
|
21439
|
+
* Process-local frame identity. It is serializable so it can ride an in-process
|
|
21440
|
+
* capability call, but `registryId` deliberately prevents resolution in any
|
|
21441
|
+
* other process or execution group.
|
|
21442
|
+
*/
|
|
21443
|
+
var FrameRefSchema = object({
|
|
21444
|
+
registryId: string().min(1),
|
|
21445
|
+
id: string().min(1),
|
|
21446
|
+
width: number().int().positive(),
|
|
21447
|
+
height: number().int().positive(),
|
|
21448
|
+
format: _enum(["rgb", "gray"]),
|
|
21449
|
+
timestamp: number(),
|
|
21450
|
+
capturedAt: number().optional()
|
|
21451
|
+
});
|
|
21452
|
+
var ModelFormatSchema$1 = _enum([
|
|
21453
|
+
"onnx",
|
|
21454
|
+
"coreml",
|
|
21455
|
+
"openvino",
|
|
21456
|
+
"tflite",
|
|
21457
|
+
"pt",
|
|
21458
|
+
"gguf"
|
|
21459
|
+
]);
|
|
21460
|
+
var PipelineSlotSchema = _enum([
|
|
21461
|
+
"detector",
|
|
21462
|
+
"cropper",
|
|
21463
|
+
"classifier",
|
|
21464
|
+
"refiner",
|
|
21465
|
+
"audio-classifier"
|
|
21466
|
+
]);
|
|
21467
|
+
var PipelineEngineChoiceSchema = object({
|
|
21468
|
+
runtime: literal("python"),
|
|
21469
|
+
backend: string(),
|
|
21470
|
+
format: ModelFormatSchema$1,
|
|
21471
|
+
device: string().optional()
|
|
21472
|
+
});
|
|
21473
|
+
/**
|
|
21474
|
+
* One pool's resolved provisioning (`getEffectiveTuning`). `numWorkers` is the
|
|
21475
|
+
* knob that lifts a saturated pool (`inference-devices.md`); `concurrency` is
|
|
21476
|
+
* per-worker in-flight requests. `deviceKey` echoes the pool asked about —
|
|
21477
|
+
* `null` for the node-default pool.
|
|
21478
|
+
*/
|
|
21479
|
+
var EffectiveTuningSchema = object({
|
|
21480
|
+
deviceKey: string().nullable(),
|
|
21481
|
+
runtime: string(),
|
|
21482
|
+
batchMode: string(),
|
|
21483
|
+
windowMs: number(),
|
|
21484
|
+
maxBatchSize: number(),
|
|
21485
|
+
concurrency: number(),
|
|
21486
|
+
numWorkers: number()
|
|
21487
|
+
});
|
|
21488
|
+
var AvailableEngineSchema = object({
|
|
21489
|
+
engine: PipelineEngineChoiceSchema,
|
|
21490
|
+
devices: array(object({
|
|
21491
|
+
id: string(),
|
|
21492
|
+
label: string(),
|
|
21493
|
+
description: string().optional()
|
|
21494
|
+
})).readonly(),
|
|
21495
|
+
defaultDevice: string()
|
|
21496
|
+
});
|
|
21497
|
+
var PipelineDefaultStepSchema = lazy(() => object({
|
|
21498
|
+
addonId: string(),
|
|
21499
|
+
addonName: string(),
|
|
21500
|
+
slot: PipelineSlotSchema,
|
|
21501
|
+
inputClasses: array(string()).readonly(),
|
|
21502
|
+
outputClasses: array(string()).readonly(),
|
|
21503
|
+
enabled: boolean(),
|
|
21504
|
+
modelId: string(),
|
|
21505
|
+
children: array(PipelineDefaultStepSchema).readonly(),
|
|
21506
|
+
group: string().optional(),
|
|
21507
|
+
settings: record(string(), unknown()).optional()
|
|
21508
|
+
}));
|
|
21509
|
+
var PipelineTemplateStepSchema = lazy(() => object({
|
|
21510
|
+
addonId: string(),
|
|
21511
|
+
enabled: boolean(),
|
|
21512
|
+
modelId: string(),
|
|
21513
|
+
children: array(PipelineTemplateStepSchema).readonly(),
|
|
21514
|
+
settings: record(string(), unknown()).optional()
|
|
21515
|
+
}));
|
|
21516
|
+
var PipelineTemplateSchema$1 = object({
|
|
21517
|
+
id: string(),
|
|
21518
|
+
name: string(),
|
|
21519
|
+
createdAt: string(),
|
|
21520
|
+
updatedAt: string(),
|
|
21521
|
+
engine: PipelineEngineChoiceSchema,
|
|
21522
|
+
steps: array(PipelineTemplateStepSchema).readonly()
|
|
21523
|
+
});
|
|
21524
|
+
var PipelineModelOptionSchema = object({
|
|
21525
|
+
id: string(),
|
|
21526
|
+
name: string(),
|
|
21527
|
+
formats: record(string(), object({
|
|
21528
|
+
downloaded: boolean(),
|
|
21529
|
+
sizeMB: number()
|
|
21530
|
+
})),
|
|
21531
|
+
group: ModelVariantGroupSchema.optional(),
|
|
21532
|
+
legacy: boolean().optional(),
|
|
21533
|
+
provider: ModelProviderIdSchema.optional()
|
|
21534
|
+
});
|
|
21535
|
+
var ConfigFieldBridge = custom();
|
|
21536
|
+
var PipelineAddonSchemaSchema = object({
|
|
21537
|
+
id: string(),
|
|
21538
|
+
name: string(),
|
|
21539
|
+
slot: PipelineSlotSchema,
|
|
21540
|
+
inputClasses: array(string()).readonly(),
|
|
21541
|
+
outputClasses: array(string()).readonly(),
|
|
21542
|
+
childSlots: array(PipelineSlotSchema).readonly(),
|
|
21543
|
+
models: array(PipelineModelOptionSchema).readonly(),
|
|
21544
|
+
defaultModelId: string(),
|
|
21545
|
+
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
21546
|
+
enabledByDefault: boolean().optional(),
|
|
21547
|
+
backfillIntoExistingOverrides: boolean().optional(),
|
|
21548
|
+
defaultConfidence: number(),
|
|
21549
|
+
group: string().optional(),
|
|
21550
|
+
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
21551
|
+
});
|
|
21552
|
+
var PipelineSlotSchemaSchema = object({
|
|
21553
|
+
id: PipelineSlotSchema,
|
|
21554
|
+
label: string(),
|
|
21555
|
+
priority: number(),
|
|
21556
|
+
parentSlot: PipelineSlotSchema.nullable(),
|
|
21557
|
+
addons: array(PipelineAddonSchemaSchema).readonly()
|
|
21558
|
+
});
|
|
21559
|
+
var PipelineSchemaSchema = object({
|
|
21560
|
+
availableEngines: array(AvailableEngineSchema).readonly(),
|
|
21561
|
+
selectedEngine: PipelineEngineChoiceSchema,
|
|
21562
|
+
slots: array(PipelineSlotSchemaSchema).readonly()
|
|
21563
|
+
});
|
|
21564
|
+
var EngineProvisioningSchema = object({
|
|
21565
|
+
runtimeId: _enum([
|
|
21566
|
+
"onnx",
|
|
21567
|
+
"openvino",
|
|
21568
|
+
"coreml",
|
|
21569
|
+
"edgetpu"
|
|
21570
|
+
]).nullable(),
|
|
21571
|
+
device: string().nullable(),
|
|
21572
|
+
state: _enum([
|
|
21573
|
+
"idle",
|
|
21574
|
+
"installing",
|
|
21575
|
+
"verifying",
|
|
21576
|
+
"ready",
|
|
21577
|
+
"failed"
|
|
21578
|
+
]),
|
|
21579
|
+
progress: number().optional(),
|
|
21580
|
+
error: string().optional(),
|
|
21581
|
+
nextRetryAt: number().optional(),
|
|
21582
|
+
/**
|
|
21583
|
+
* Gate A (config-correctness gate at engine change): human-readable
|
|
21584
|
+
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
21585
|
+
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
21586
|
+
* has a <format> build"). Additive/optional: informational only, never
|
|
21587
|
+
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
21588
|
+
* Absent/empty when the node-default tree resolves cleanly.
|
|
21589
|
+
*/
|
|
21590
|
+
configIssues: array(string()).optional()
|
|
21591
|
+
});
|
|
21592
|
+
var PipelineStepInputSchema = lazy(() => object({
|
|
21593
|
+
addonId: string(),
|
|
21594
|
+
modelId: string().optional(),
|
|
21595
|
+
enabled: boolean().default(true),
|
|
21596
|
+
children: array(PipelineStepInputSchema).optional(),
|
|
21597
|
+
settings: record(string(), unknown()).optional(),
|
|
21598
|
+
jumpDeviceKey: string().optional()
|
|
21599
|
+
}));
|
|
21600
|
+
var ModelSubstitutionSchema = object({
|
|
21601
|
+
addonId: string(),
|
|
21602
|
+
chosen: string(),
|
|
21603
|
+
running: string(),
|
|
21604
|
+
format: string()
|
|
21605
|
+
});
|
|
21606
|
+
var PipelineValidationIssueSchema = object({
|
|
21607
|
+
addonId: string(),
|
|
21608
|
+
kind: _enum([
|
|
21609
|
+
"unknown-addon",
|
|
21610
|
+
"no-format-build",
|
|
21611
|
+
"unknown-device"
|
|
21612
|
+
]),
|
|
21613
|
+
detail: string()
|
|
21614
|
+
});
|
|
21615
|
+
var PipelineValidationResultSchema = object({
|
|
21616
|
+
ok: boolean(),
|
|
21617
|
+
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
21618
|
+
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
21619
|
+
/** The node's `currentEngine.format` this validation ran against. */
|
|
21620
|
+
format: string()
|
|
21621
|
+
});
|
|
21622
|
+
var ReferenceImageEntrySchema = object({
|
|
21623
|
+
filename: string(),
|
|
21624
|
+
stepIds: array(string()).readonly().optional()
|
|
21625
|
+
});
|
|
21626
|
+
var ReferenceImageBodySchema = object({
|
|
21627
|
+
base64: string(),
|
|
21628
|
+
filename: string()
|
|
21629
|
+
});
|
|
21630
|
+
var ReferenceAudioEntrySchema = object({
|
|
21631
|
+
filename: string(),
|
|
21632
|
+
sizeKb: number()
|
|
21633
|
+
});
|
|
21634
|
+
var ReferenceAudioBodySchema = object({ base64: string() });
|
|
21635
|
+
var AudioBackendSchema = object({
|
|
21636
|
+
id: string(),
|
|
21637
|
+
name: string(),
|
|
21638
|
+
description: string(),
|
|
21639
|
+
available: boolean(),
|
|
21640
|
+
/**
|
|
21641
|
+
* Raw classifier labels this backend can emit (e.g. YAMNet's
|
|
21642
|
+
* 521-class set or Apple SoundAnalysis's 303-class set). Used by
|
|
21643
|
+
* the benchmark UI to populate the `enabledMicroClasses` filter
|
|
21644
|
+
* specific to the selected backend without a separate fetch.
|
|
21645
|
+
*/
|
|
21646
|
+
rawLabels: array(string()).readonly().optional()
|
|
21647
|
+
});
|
|
21648
|
+
var AudioCapabilitiesSchema = object({
|
|
21649
|
+
activeBackend: string(),
|
|
21650
|
+
availableBackends: array(AudioBackendSchema).readonly(),
|
|
21651
|
+
sampleRate: number(),
|
|
21652
|
+
chunkDurationMs: number()
|
|
21653
|
+
});
|
|
21654
|
+
var DownloadModelResultSchema = object({
|
|
21655
|
+
filePath: string(),
|
|
21656
|
+
sizeMB: number(),
|
|
21657
|
+
durationMs: number()
|
|
21658
|
+
});
|
|
21659
|
+
/**
|
|
21660
|
+
* Wrapper carrying a single test run's result. Replaces the legacy
|
|
21661
|
+
* ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
|
|
21662
|
+
* canonical `AudioResult` from the Phase 6 output rework: one
|
|
21663
|
+
* `AudioDetection` per class above `minScore`, top-N candidates in
|
|
21664
|
+
* `debug.alternateLabels['audio-classifier']`, per-source timings in
|
|
21665
|
+
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
21666
|
+
* benchmark UI can still report a clean failure when the classifier
|
|
21667
|
+
* cap isn't available.
|
|
21668
|
+
*/
|
|
21669
|
+
var AudioTestResultSchema = object({
|
|
21670
|
+
success: boolean(),
|
|
21671
|
+
error: string().optional(),
|
|
21672
|
+
frame: custom().optional()
|
|
21673
|
+
});
|
|
21674
|
+
var PipelineConfigBridge = custom();
|
|
21675
|
+
var ConfigUISchemaBridge = custom();
|
|
21676
|
+
var ConfigUISchemaNullableBridge = custom();
|
|
21677
|
+
var InferenceCapabilitiesBridge = custom();
|
|
21678
|
+
var ModelAvailabilityListBridge = custom();
|
|
21679
|
+
var PipelineRunResultBridge = custom();
|
|
21680
|
+
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
21681
|
+
modelId: string(),
|
|
21682
|
+
settings: record(string(), unknown()).readonly()
|
|
21683
|
+
}))), method(object({ steps: record(string(), object({
|
|
21684
|
+
modelId: string(),
|
|
21685
|
+
settings: record(string(), unknown()).readonly()
|
|
21686
|
+
})) }), object({ success: literal(true) }), {
|
|
21687
|
+
kind: "mutation",
|
|
21688
|
+
auth: "admin"
|
|
21689
|
+
}), method(object({ nodeId: string() }), object({
|
|
21690
|
+
success: literal(true),
|
|
21691
|
+
clearedDevices: number()
|
|
21692
|
+
}), {
|
|
21395
21693
|
kind: "mutation",
|
|
21396
21694
|
auth: "admin"
|
|
21397
|
-
}), method(
|
|
21398
|
-
|
|
21399
|
-
|
|
21400
|
-
|
|
21695
|
+
}), method(object({ nodeId: string() }), object({ unhealthy: array(object({
|
|
21696
|
+
/** `<backend>:<device>`, e.g. `openvino:gpu`. */
|
|
21697
|
+
deviceKey: string(),
|
|
21698
|
+
/**
|
|
21699
|
+
* `failed` — the per-device restart budget is exhausted; no pool
|
|
21700
|
+
* will be spawned until an operator re-arms it or the runner
|
|
21701
|
+
* respawns. `backoff` — under budget, waiting out the backoff (or
|
|
21702
|
+
* a cached pool observed dead and not yet condemned).
|
|
21703
|
+
*/
|
|
21704
|
+
state: _enum(["failed", "backoff"]),
|
|
21705
|
+
/** Epoch ms of the death that produced this state. */
|
|
21706
|
+
since: number(),
|
|
21707
|
+
/** Pool deaths inside the current window. */
|
|
21708
|
+
deaths: number(),
|
|
21709
|
+
/** The last death's message. */
|
|
21710
|
+
lastError: string()
|
|
21711
|
+
})).readonly() })), method(object({
|
|
21712
|
+
nodeId: string(),
|
|
21713
|
+
deviceKey: string()
|
|
21714
|
+
}), object({ rearmed: boolean() }), {
|
|
21401
21715
|
kind: "mutation",
|
|
21402
21716
|
auth: "admin"
|
|
21403
|
-
}), method(
|
|
21404
|
-
|
|
21405
|
-
|
|
21406
|
-
}), method(
|
|
21407
|
-
|
|
21408
|
-
|
|
21409
|
-
|
|
21410
|
-
|
|
21411
|
-
|
|
21412
|
-
|
|
21413
|
-
|
|
21414
|
-
|
|
21415
|
-
|
|
21416
|
-
|
|
21417
|
-
|
|
21418
|
-
|
|
21419
|
-
|
|
21420
|
-
|
|
21421
|
-
|
|
21422
|
-
}),
|
|
21423
|
-
|
|
21424
|
-
|
|
21425
|
-
|
|
21426
|
-
|
|
21427
|
-
|
|
21428
|
-
|
|
21429
|
-
|
|
21717
|
+
}), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({
|
|
21718
|
+
steps: array(PipelineStepInputSchema),
|
|
21719
|
+
deviceKey: string().optional()
|
|
21720
|
+
}), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
|
|
21721
|
+
name: string(),
|
|
21722
|
+
steps: array(PipelineTemplateStepSchema).readonly(),
|
|
21723
|
+
engine: PipelineEngineChoiceSchema
|
|
21724
|
+
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
|
|
21725
|
+
id: string(),
|
|
21726
|
+
name: string().optional(),
|
|
21727
|
+
steps: array(PipelineTemplateStepSchema).readonly().optional()
|
|
21728
|
+
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
|
|
21729
|
+
addonId: string(),
|
|
21730
|
+
modelId: string(),
|
|
21731
|
+
format: ModelFormatSchema$1
|
|
21732
|
+
}), DownloadModelResultSchema, { kind: "mutation" }), method(object({
|
|
21733
|
+
addonId: string(),
|
|
21734
|
+
modelId: string(),
|
|
21735
|
+
format: ModelFormatSchema$1
|
|
21736
|
+
}), object({ success: literal(true) }), { kind: "mutation" }), method(object({
|
|
21737
|
+
steps: array(PipelineStepInputSchema).min(1),
|
|
21738
|
+
frame: FrameInputSchema.optional(),
|
|
21739
|
+
/**
|
|
21740
|
+
* Process-local lazy frame. Valid only when caller and provider resolve
|
|
21741
|
+
* in the same execution-group process; split/cross-node callers use
|
|
21742
|
+
* `frame`/`image` inline compatibility instead.
|
|
21743
|
+
*/
|
|
21744
|
+
frameRef: FrameRefSchema.optional(),
|
|
21745
|
+
/**
|
|
21746
|
+
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
21747
|
+
* the decoded pixels live in. One more member of the one-of
|
|
21748
|
+
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
21749
|
+
*/
|
|
21750
|
+
frameHandle: FrameHandleSchema.optional(),
|
|
21751
|
+
imageBase64: string().optional(),
|
|
21752
|
+
/**
|
|
21753
|
+
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
21754
|
+
* hops (hub → forked worker via Moleculer MsgPack) because it
|
|
21755
|
+
* skips the 33% base64 overhead + the per-call base64 decode on
|
|
21756
|
+
* the detection-pipeline worker. Callers can pass either; exactly
|
|
21757
|
+
* one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
|
|
21758
|
+
*/
|
|
21759
|
+
image: _instanceof(Uint8Array).optional(),
|
|
21760
|
+
referenceImage: string().optional(),
|
|
21761
|
+
deviceId: number().optional(),
|
|
21762
|
+
sessionId: string().optional(),
|
|
21763
|
+
/**
|
|
21764
|
+
* Execution plane. 'full' (default) runs the whole tree — benchmark,
|
|
21765
|
+
* reference-image, and detail-subtree calls. 'frame' is the live
|
|
21766
|
+
* per-frame dispatch: ONLY root-plane steps run; crop children
|
|
21767
|
+
* (inputClasses ≠ null) are skipped and served per-track via
|
|
21768
|
+
* pipelineRunner.runDetailSubtree (two-plane design).
|
|
21769
|
+
*/
|
|
21770
|
+
plane: _enum(["full", "frame"]).optional(),
|
|
21771
|
+
/**
|
|
21772
|
+
* Inference-device selector (Phase 2 multi-device). Format
|
|
21773
|
+
* `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
|
|
21774
|
+
* Omitted ⇒ the runner's default device (current single-engine
|
|
21775
|
+
* behaviour). Selects WHICH device pool of the node runs the call.
|
|
21776
|
+
*/
|
|
21777
|
+
deviceKey: string().optional(),
|
|
21778
|
+
/**
|
|
21779
|
+
* Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
|
|
21780
|
+
* when the parent crop was resolved from the frame's retained NATIVE
|
|
21781
|
+
* surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
|
|
21782
|
+
* child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
|
|
21783
|
+
* resolution from that surface — the SAME quality path faces already
|
|
21784
|
+
* had — instead of the downscaled parent tile. `handle` keys the native
|
|
21785
|
+
* surface (node-pinned to its owner); `cropFrameSpace` is the parent
|
|
21786
|
+
* crop's padded/clamped rectangle in FRAME-space pixels, used to compose
|
|
21787
|
+
* the executor's crop-normalized child ROI back into frame-normalized
|
|
21788
|
+
* coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
|
|
21789
|
+
* of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
|
|
21790
|
+
* (today's behaviour on the fallback path).
|
|
21791
|
+
*/
|
|
21792
|
+
nativeCropRef: NativeCropRefSchema.optional(),
|
|
21793
|
+
/**
|
|
21794
|
+
* Offline REPLAY of stored media for `deviceId` (D56, D646): the
|
|
21795
|
+
* camera's zone gate and overrides apply as live, every executing
|
|
21796
|
+
* step runs EXACTLY the model it names on the `deviceKey` pool it
|
|
21797
|
+
* names or the call refuses (`model-not-servable` /
|
|
21798
|
+
* `device-not-servable`), and nothing reaches the camera's live
|
|
21799
|
+
* trace stream. Absent ⇒ unchanged behaviour.
|
|
21800
|
+
*/
|
|
21801
|
+
replay: literal(true).optional()
|
|
21802
|
+
}), PipelineRunResultBridge, { kind: "mutation" }), method(object({
|
|
21803
|
+
steps: array(PipelineStepInputSchema).min(1),
|
|
21804
|
+
frames: array(FrameInputSchema).min(1).max(255),
|
|
21805
|
+
deviceId: number().optional(),
|
|
21806
|
+
sessionId: string().optional(),
|
|
21807
|
+
/**
|
|
21808
|
+
* Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
|
|
21809
|
+
* the batch to the Python pool's bench preprocess cache
|
|
21810
|
+
* (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
|
|
21811
|
+
* preprocessed ONCE and every later inference is a pure-inference cache
|
|
21812
|
+
* hit — the sustained-throughput run measures inference, not
|
|
21813
|
+
* decode+preprocess+infer. Omitted/0 for live frames (all different →
|
|
21814
|
+
* full preprocess every call, correct). Fresh per sustained run;
|
|
21815
|
+
* released via `uncacheFrame`.
|
|
21816
|
+
*/
|
|
21817
|
+
frameId: number().int().nonnegative().optional(),
|
|
21818
|
+
/** Inference-device selector (Phase 2 multi-device); see runPipeline. */
|
|
21819
|
+
deviceKey: string().optional()
|
|
21820
|
+
}), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
|
|
21821
|
+
data: _instanceof(Uint8Array),
|
|
21822
|
+
width: number().int().positive(),
|
|
21823
|
+
height: number().int().positive(),
|
|
21824
|
+
format: _enum([
|
|
21825
|
+
"rgb",
|
|
21826
|
+
"bgr",
|
|
21827
|
+
"gray"
|
|
21828
|
+
])
|
|
21829
|
+
}), object({
|
|
21830
|
+
frameId: number(),
|
|
21831
|
+
width: number(),
|
|
21832
|
+
height: number()
|
|
21833
|
+
}), { kind: "mutation" }), method(object({
|
|
21834
|
+
stepId: string(),
|
|
21835
|
+
frameId: number().int()
|
|
21836
|
+
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(object({ deviceKey: string().optional() }), EffectiveTuningSchema), method(_void(), array(object({
|
|
21837
|
+
engineKey: string(),
|
|
21838
|
+
engine: PipelineEngineChoiceSchema,
|
|
21839
|
+
modelsLoaded: array(string()).readonly(),
|
|
21840
|
+
inUseByCameras: array(number()).readonly(),
|
|
21841
|
+
/**
|
|
21842
|
+
* Origin of this resident factory.
|
|
21843
|
+
* - `runtime` — main camera-serving engine (no idle TTL).
|
|
21844
|
+
* - `device-pool` — a concurrent per-device pool (Phase 2
|
|
21845
|
+
* multi-device, keyed by `deviceKey`) resolved
|
|
21846
|
+
* via `resolveDeviceFactory`. Runs alongside the
|
|
21847
|
+
* `runtime` engine on a DIFFERENT accelerator
|
|
21848
|
+
* (NPU / iGPU / Coral) — this is how the
|
|
21849
|
+
* Engines tab shows all pools running at once.
|
|
21850
|
+
*/
|
|
21851
|
+
kind: _enum(["runtime", "device-pool"]),
|
|
21852
|
+
/** Native pid of the underlying Python pool (null when no pool). */
|
|
21853
|
+
poolPid: number().nullable(),
|
|
21854
|
+
/** ms since this factory was last used (null when not warm-tracked). */
|
|
21855
|
+
idleMs: number().nullable(),
|
|
21856
|
+
/** Idle TTL after which the factory self-evicts (null when not applicable). */
|
|
21857
|
+
idleTtlMs: number().nullable()
|
|
21858
|
+
})).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
|
|
21430
21859
|
kind: "mutation",
|
|
21431
21860
|
auth: "admin"
|
|
21432
21861
|
}), method(object({
|
|
21433
|
-
|
|
21434
|
-
|
|
21435
|
-
frameId: string()
|
|
21862
|
+
engine: PipelineEngineChoiceSchema,
|
|
21863
|
+
force: boolean().optional()
|
|
21436
21864
|
}), object({
|
|
21437
|
-
|
|
21438
|
-
|
|
21439
|
-
}), {
|
|
21440
|
-
kind: "mutation",
|
|
21441
|
-
auth: "admin"
|
|
21442
|
-
}), method(object({ frameId: string() }), object({
|
|
21443
|
-
base64: string(),
|
|
21444
|
-
width: number().int(),
|
|
21445
|
-
height: number().int()
|
|
21865
|
+
success: boolean(),
|
|
21866
|
+
reason: string().optional()
|
|
21446
21867
|
}), {
|
|
21447
|
-
kind: "query",
|
|
21448
|
-
auth: "admin"
|
|
21449
|
-
}), method(object({
|
|
21450
|
-
deviceId: number(),
|
|
21451
|
-
trackId: string(),
|
|
21452
|
-
frameId: string(),
|
|
21453
|
-
subject: RetrainAssistSubjectSchema,
|
|
21454
|
-
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
21455
|
-
nodeId: string().optional()
|
|
21456
|
-
}), RetrainAssistResultSchema, {
|
|
21457
|
-
kind: "mutation",
|
|
21458
|
-
auth: "admin"
|
|
21459
|
-
}), method(object({
|
|
21460
|
-
deviceId: number(),
|
|
21461
|
-
source: DetectionSourceSchema,
|
|
21462
|
-
zones: array(ZoneSchema).readonly().optional(),
|
|
21463
|
-
detectionRules: array(ZoneRuleSchema).readonly().optional(),
|
|
21464
|
-
zoneMembershipMinOverlap: number().min(0).max(1).optional(),
|
|
21465
|
-
frames: array(ReplayFrameInputSchema).min(1)
|
|
21466
|
-
}), RunReplayFrameProcessorResultSchema, {
|
|
21467
|
-
kind: "mutation",
|
|
21468
|
-
auth: "admin"
|
|
21469
|
-
}), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
|
|
21470
|
-
kind: "query",
|
|
21471
|
-
auth: "admin"
|
|
21472
|
-
}), method(object({
|
|
21473
|
-
deviceId: number(),
|
|
21474
|
-
trackId: string(),
|
|
21475
|
-
frameId: string(),
|
|
21476
|
-
annotations: array(RetrainAnnotationDraftSchema)
|
|
21477
|
-
}), array(RetrainAnnotationSchema).readonly(), {
|
|
21478
|
-
kind: "mutation",
|
|
21479
|
-
auth: "admin"
|
|
21480
|
-
}), method(object({
|
|
21481
|
-
deviceId: number(),
|
|
21482
|
-
trackId: string()
|
|
21483
|
-
}), RetrainTransitionResultSchema, {
|
|
21484
|
-
kind: "mutation",
|
|
21485
|
-
auth: "admin"
|
|
21486
|
-
}), method(object({
|
|
21487
|
-
deviceId: number(),
|
|
21488
|
-
trackId: string()
|
|
21489
|
-
}), RetrainTransitionResultSchema, {
|
|
21490
|
-
kind: "mutation",
|
|
21491
|
-
auth: "admin"
|
|
21492
|
-
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
21493
|
-
kind: "query",
|
|
21494
|
-
auth: "admin"
|
|
21495
|
-
}), method(object({
|
|
21496
|
-
/** Which of the three event tables owns the row. */
|
|
21497
|
-
ownerType: EventOwnerTypeSchema,
|
|
21498
|
-
/** The event's rowid in that table (D474: an event id is a number). */
|
|
21499
|
-
eventId: number().int(),
|
|
21500
|
-
kind: MediaFileKindEnum.optional(),
|
|
21501
|
-
deviceId: number()
|
|
21502
|
-
}), array(MediaFileSchema).readonly()), method(object({
|
|
21503
|
-
trackId: string(),
|
|
21504
|
-
kinds: array(MediaFileKindEnum).optional(),
|
|
21505
|
-
deviceId: number()
|
|
21506
|
-
}), array(MediaFileSchema).readonly()), method(object({
|
|
21507
|
-
trackId: string(),
|
|
21508
|
-
deviceId: number()
|
|
21509
|
-
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
21510
|
-
ownerType: EventOwnerTypeSchema,
|
|
21511
|
-
eventId: number().int(),
|
|
21512
|
-
deviceId: number()
|
|
21513
|
-
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
21514
|
-
deviceId: number(),
|
|
21515
|
-
ownerKind: MediaPresenceOwnerKindSchema,
|
|
21516
|
-
ownerIds: array(string()).max(5e3)
|
|
21517
|
-
}), array(string()).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
21518
21868
|
kind: "mutation",
|
|
21519
21869
|
auth: "admin"
|
|
21520
|
-
}), method(
|
|
21521
|
-
|
|
21522
|
-
|
|
21523
|
-
|
|
21524
|
-
|
|
21525
|
-
|
|
21526
|
-
frameWidth: number(),
|
|
21527
|
-
frameHeight: number(),
|
|
21528
|
-
detections: array(OverlayDetectionSchema).readonly()
|
|
21529
|
-
}), object({
|
|
21530
|
-
deviceId: number(),
|
|
21531
|
-
trackId: string(),
|
|
21532
|
-
className: string()
|
|
21533
|
-
}), object({
|
|
21534
|
-
deviceId: number(),
|
|
21535
|
-
trackId: string(),
|
|
21536
|
-
className: string(),
|
|
21537
|
-
durationMs: number()
|
|
21538
|
-
}), object({
|
|
21539
|
-
deviceId: number(),
|
|
21540
|
-
kind: EventKindSchema,
|
|
21541
|
-
eventId: string(),
|
|
21542
|
-
timestamp: number()
|
|
21543
|
-
});
|
|
21870
|
+
}), 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({
|
|
21871
|
+
addonId: string(),
|
|
21872
|
+
modelId: string(),
|
|
21873
|
+
filename: string().optional(),
|
|
21874
|
+
settings: record(string(), unknown()).optional()
|
|
21875
|
+
}), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
|
|
21544
21876
|
object({
|
|
21545
21877
|
activeCameras: number(),
|
|
21546
21878
|
throttledCameras: number(),
|
|
@@ -21566,6 +21898,66 @@ var CameraMetricsSchema = object({
|
|
|
21566
21898
|
});
|
|
21567
21899
|
var CameraMetricsWithDeviceIdSchema = CameraMetricsSchema.extend({ deviceId: number() });
|
|
21568
21900
|
/**
|
|
21901
|
+
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
21902
|
+
*
|
|
21903
|
+
* Zones describe **where** in the frame the operator wants to flag
|
|
21904
|
+
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
21905
|
+
* each pipeline stage uses them. Splitting the two means a single
|
|
21906
|
+
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
21907
|
+
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
21908
|
+
* — without three duplicated polygons.
|
|
21909
|
+
*
|
|
21910
|
+
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
21911
|
+
* `zones` device-state slice on every mutation. Consumers
|
|
21912
|
+
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
21913
|
+
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
21914
|
+
* mirror with `onChanged`).
|
|
21915
|
+
*
|
|
21916
|
+
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
21917
|
+
* survive resolution changes and stream profile switches.
|
|
21918
|
+
*
|
|
21919
|
+
* `kind` discriminates between full polygons (closed regions used
|
|
21920
|
+
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
21921
|
+
* line segments used for cross events). Onboard / firmware-reported
|
|
21922
|
+
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
21923
|
+
* task list.
|
|
21924
|
+
*/
|
|
21925
|
+
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
21926
|
+
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
21927
|
+
var PolygonPointSchema = object({
|
|
21928
|
+
x: number(),
|
|
21929
|
+
y: number()
|
|
21930
|
+
});
|
|
21931
|
+
/** A camera detection zone — pure geometry/identity. */
|
|
21932
|
+
var ZoneSchema = object({
|
|
21933
|
+
id: string(),
|
|
21934
|
+
name: string(),
|
|
21935
|
+
kind: ZoneKindEnum.default("polygon"),
|
|
21936
|
+
/** Polygon vertices, fraction of frame (0–1). */
|
|
21937
|
+
polygon: array(PolygonPointSchema).readonly(),
|
|
21938
|
+
/** Visual color for UI rendering. */
|
|
21939
|
+
color: string().default("#3b82f6")
|
|
21940
|
+
});
|
|
21941
|
+
DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).readonly()), method(object({
|
|
21942
|
+
deviceId: number(),
|
|
21943
|
+
zone: ZoneSchema
|
|
21944
|
+
}), _void(), {
|
|
21945
|
+
kind: "mutation",
|
|
21946
|
+
auth: "admin"
|
|
21947
|
+
}), method(object({
|
|
21948
|
+
deviceId: number(),
|
|
21949
|
+
zoneId: string()
|
|
21950
|
+
}), _void(), {
|
|
21951
|
+
kind: "mutation",
|
|
21952
|
+
auth: "admin"
|
|
21953
|
+
}), method(object({
|
|
21954
|
+
deviceId: number(),
|
|
21955
|
+
zone: ZoneSchema
|
|
21956
|
+
}), _void(), {
|
|
21957
|
+
kind: "mutation",
|
|
21958
|
+
auth: "admin"
|
|
21959
|
+
}), object({ zones: array(ZoneSchema).readonly() });
|
|
21960
|
+
/**
|
|
21569
21961
|
* A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
|
|
21570
21962
|
* decode worker resolves it against the RETAINED native frame's real pixel dims,
|
|
21571
21963
|
* so the caller supplies only the detection-res bbox divided by the detection
|
|
@@ -21752,7 +22144,17 @@ var DetailResultSchema = object({
|
|
|
21752
22144
|
/** Face short side (px) measured on the NATIVE crop surface. The `bbox`
|
|
21753
22145
|
* above is detection-frame px (≈6× smaller on a 4K camera) — min-face-size
|
|
21754
22146
|
* consumers MUST prefer this when present (2026-07-22 native-gate fix). */
|
|
21755
|
-
nativeFaceShortSidePx: number().optional()
|
|
22147
|
+
nativeFaceShortSidePx: number().optional(),
|
|
22148
|
+
/**
|
|
22149
|
+
* The five facial landmarks of a `face` detail, in the SAME frame space as
|
|
22150
|
+
* `bbox` (D644). Additive and optional: post-analysis stores them beside the
|
|
22151
|
+
* face's source frame so a future alignment can be re-derived exactly; a
|
|
22152
|
+
* runner that predates the field sends none and the face is stored without.
|
|
22153
|
+
*/
|
|
22154
|
+
landmarks: array(object({
|
|
22155
|
+
x: number(),
|
|
22156
|
+
y: number()
|
|
22157
|
+
})).optional()
|
|
21756
22158
|
});
|
|
21757
22159
|
/**
|
|
21758
22160
|
* Why an executing node REFUSED a stateless step run (`runStatelessStep`).
|
|
@@ -22007,6 +22409,17 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
|
|
|
22007
22409
|
hubHostnameOverride: string().optional()
|
|
22008
22410
|
})]).describe("Per-camera frame-source mode for the runner (P2c)");
|
|
22009
22411
|
/**
|
|
22412
|
+
* What ONE step runs with on ONE roster device for THIS camera (D650): the
|
|
22413
|
+
* device's per-(node,device) base with the camera's override for that device
|
|
22414
|
+
* on top — the same `override ?? base` merge the orchestrator applies to the
|
|
22415
|
+
* elected device (`applyDeviceProvisioning`). Absent `modelId` ⇒ the executor
|
|
22416
|
+
* resolves the device format's default, exactly as on the elected device.
|
|
22417
|
+
*/
|
|
22418
|
+
var RunnerJumpStepProvisioningSchema = object({
|
|
22419
|
+
modelId: string().optional(),
|
|
22420
|
+
settings: record(string(), unknown()).optional()
|
|
22421
|
+
});
|
|
22422
|
+
/**
|
|
22010
22423
|
* One ENABLED inference device on the runner's node, as the step-tree
|
|
22011
22424
|
* device-jump resolver sees it (phase 1). The orchestrator populates this
|
|
22012
22425
|
* roster on the attach payload whenever the camera is elected onto a specific
|
|
@@ -22018,7 +22431,16 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
|
|
|
22018
22431
|
var RunnerInferenceDeviceSchema = object({
|
|
22019
22432
|
deviceKey: string(),
|
|
22020
22433
|
weight: number().positive().default(1),
|
|
22021
|
-
maxSessions: number().int().positive().nullable().default(null)
|
|
22434
|
+
maxSessions: number().int().positive().nullable().default(null),
|
|
22435
|
+
/**
|
|
22436
|
+
* Per-step provisioning for this camera on THIS device (D650), keyed by step
|
|
22437
|
+
* id. A step the runner jumps here runs with these fields, never with the
|
|
22438
|
+
* elected device's: `modelId` / `settings` are REPLACED on the jumped subtree
|
|
22439
|
+
* (a step absent from the map runs with neither — the target format default).
|
|
22440
|
+
* Absent field ⇒ an orchestrator that predates D650: the jumped step keeps
|
|
22441
|
+
* the elected device's provisioning, as before.
|
|
22442
|
+
*/
|
|
22443
|
+
steps: record(string(), RunnerJumpStepProvisioningSchema).optional()
|
|
22022
22444
|
});
|
|
22023
22445
|
/**
|
|
22024
22446
|
* Camera assignment payload sent by `addon-pipeline-orchestrator` to a
|
|
@@ -22893,6 +23315,28 @@ var NodeInferenceDeviceSchema = object({
|
|
|
22893
23315
|
*/
|
|
22894
23316
|
exclusion: InferenceDeviceExclusionReasonSchema.nullable()
|
|
22895
23317
|
});
|
|
23318
|
+
/**
|
|
23319
|
+
* The operator's model choice for one cluster-scoped step, answered by the
|
|
23320
|
+
* addon that OWNS the `clusterModel:*` settings (D651). Three answers, never
|
|
23321
|
+
* folded: a written choice, a key nobody wrote (the cluster runs the default
|
|
23322
|
+
* BY ABSENCE), or no answer. A caller that rewrites an index acts only on the
|
|
23323
|
+
* first two, read twice and agreeing.
|
|
23324
|
+
*/
|
|
23325
|
+
var ClusterModelChoiceSchema = discriminatedUnion("kind", [
|
|
23326
|
+
object({
|
|
23327
|
+
kind: literal("stored"),
|
|
23328
|
+
modelId: string()
|
|
23329
|
+
}),
|
|
23330
|
+
object({
|
|
23331
|
+
kind: literal("absent"),
|
|
23332
|
+
defaultModelId: string()
|
|
23333
|
+
}),
|
|
23334
|
+
object({
|
|
23335
|
+
kind: literal("unreadable"),
|
|
23336
|
+
reason: _enum(CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS),
|
|
23337
|
+
error: string().optional()
|
|
23338
|
+
})
|
|
23339
|
+
]);
|
|
22896
23340
|
var NodeInferenceDevicesSchema = object({
|
|
22897
23341
|
nodeId: string(),
|
|
22898
23342
|
/** False when the node's platform-probe was unreachable (no live device set). */
|
|
@@ -22920,10 +23364,17 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
22920
23364
|
}), object({ success: literal(true) }), {
|
|
22921
23365
|
kind: "mutation",
|
|
22922
23366
|
auth: "admin"
|
|
22923
|
-
}), method(object({ deviceId: number() }), object({ deviceKey: string().nullable() })), method(_void(), object({
|
|
23367
|
+
}), method(object({ deviceId: number() }), object({ deviceKey: string().nullable() })), method(_void(), object({
|
|
23368
|
+
migrated: number(),
|
|
23369
|
+
skipped: array(object({
|
|
23370
|
+
deviceId: number(),
|
|
23371
|
+
targetNodeId: string(),
|
|
23372
|
+
reason: string()
|
|
23373
|
+
})).default([])
|
|
23374
|
+
}), {
|
|
22924
23375
|
kind: "mutation",
|
|
22925
23376
|
auth: "admin"
|
|
22926
|
-
}), method(_void(), array(PipelineAssignmentSchema).readonly()), method(object({ deviceId: number() }), PipelineAssignmentSchema.nullable()), method(_void(), array(AgentLoadSummarySchema).readonly()), method(_void(), GlobalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(object({ nodeId: string() }), CapabilityBindingsSchema), method(object({
|
|
23377
|
+
}), method(_void(), array(PipelineAssignmentSchema).readonly()), method(object({ deviceId: number() }), PipelineAssignmentSchema.nullable()), method(_void(), array(AgentLoadSummarySchema).readonly()), method(object({ stepId: string() }), ClusterModelChoiceSchema), method(_void(), GlobalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(object({ nodeId: string() }), CapabilityBindingsSchema), method(object({
|
|
22927
23378
|
nodeId: string(),
|
|
22928
23379
|
capName: string(),
|
|
22929
23380
|
addonId: string()
|
|
@@ -25223,6 +25674,167 @@ DeviceType.Camera, method(object({
|
|
|
25223
25674
|
auth: "protected"
|
|
25224
25675
|
});
|
|
25225
25676
|
/**
|
|
25677
|
+
* LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
|
|
25678
|
+
* valutatore puro del suo FRONTE.
|
|
25679
|
+
*
|
|
25680
|
+
* Viveva dentro il builtin virtual-doorbell
|
|
25681
|
+
* (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
|
|
25682
|
+
* predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
|
|
25683
|
+
* `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
|
|
25684
|
+
* tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
|
|
25685
|
+
* fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
|
|
25686
|
+
* SPOSTA qui e il doorbell la ri-esporta.
|
|
25687
|
+
*
|
|
25688
|
+
* ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
|
|
25689
|
+
* due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
|
|
25690
|
+
* regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
|
|
25691
|
+
* booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
|
|
25692
|
+
*/
|
|
25693
|
+
/**
|
|
25694
|
+
* Known binary / switch source caps → the boolean slice field whose
|
|
25695
|
+
* false→true rise counts as ACTIVE. Every entry is "fire on active".
|
|
25696
|
+
* Sensors whose "active" reading is not a plain boolean (presence's string
|
|
25697
|
+
* state, connectivity's connected flag) are deliberately excluded — a
|
|
25698
|
+
* reconnect is not a doorbell press, and it is not a recording either.
|
|
25699
|
+
*/
|
|
25700
|
+
var SOURCE_CAP_ACTIVE_FIELD = {
|
|
25701
|
+
contact: "entryOpen",
|
|
25702
|
+
binary: "on",
|
|
25703
|
+
switch: "on",
|
|
25704
|
+
motion: "detected",
|
|
25705
|
+
flood: "flooded",
|
|
25706
|
+
gas: "detected",
|
|
25707
|
+
smoke: "detected",
|
|
25708
|
+
"carbon-monoxide": "detected",
|
|
25709
|
+
vibration: "detected",
|
|
25710
|
+
tamper: "tampered"
|
|
25711
|
+
};
|
|
25712
|
+
object({
|
|
25713
|
+
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
25714
|
+
lastPressedAt: number().nullable(),
|
|
25715
|
+
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
25716
|
+
pressCountSinceStart: number()
|
|
25717
|
+
});
|
|
25718
|
+
object({
|
|
25719
|
+
deviceId: number(),
|
|
25720
|
+
timestamp: number()
|
|
25721
|
+
});
|
|
25722
|
+
/**
|
|
25723
|
+
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
25724
|
+
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
25725
|
+
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
25726
|
+
*/
|
|
25727
|
+
var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
|
|
25728
|
+
DeviceType.Camera;
|
|
25729
|
+
DeviceType.Button, DeviceType.Camera;
|
|
25730
|
+
var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
|
|
25731
|
+
DeviceType.Camera, DeviceType.Camera;
|
|
25732
|
+
/** A slot's editable value, discriminated on `slot`. */
|
|
25733
|
+
var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
25734
|
+
DeviceType.Camera;
|
|
25735
|
+
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
25736
|
+
state: literal("unreachable"),
|
|
25737
|
+
reason: string()
|
|
25738
|
+
})]);
|
|
25739
|
+
/** One provider of slots — the D554 source-listing row. */
|
|
25740
|
+
var ExtensionSourceSchema = object({
|
|
25741
|
+
/** The routing prefix of every `slotRef` this provider serves. */
|
|
25742
|
+
source: string(),
|
|
25743
|
+
label: string(),
|
|
25744
|
+
/** Stamped by the dispatcher from the registry (D557). */
|
|
25745
|
+
addonId: string().optional(),
|
|
25746
|
+
availability: ExtensionSourceAvailabilitySchema
|
|
25747
|
+
});
|
|
25748
|
+
/**
|
|
25749
|
+
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
25750
|
+
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
25751
|
+
* (slice 2's cross-owner graft source); `unavailable` — it exists but is not a
|
|
25752
|
+
* valid source now (a container, which is never a pick). A source in any of
|
|
25753
|
+
* these states is SHOWN, never silently dropped or re-pointed.
|
|
25754
|
+
*/
|
|
25755
|
+
var ExtensionSourceHealthSchema = _enum([
|
|
25756
|
+
"ok",
|
|
25757
|
+
"missing",
|
|
25758
|
+
"foreign",
|
|
25759
|
+
"unavailable"
|
|
25760
|
+
]);
|
|
25761
|
+
var ExtensionSlotSourceSchema = object({
|
|
25762
|
+
deviceId: number().int(),
|
|
25763
|
+
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
25764
|
+
name: string().nullable(),
|
|
25765
|
+
health: ExtensionSourceHealthSchema,
|
|
25766
|
+
detail: string().optional()
|
|
25767
|
+
});
|
|
25768
|
+
/**
|
|
25769
|
+
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
25770
|
+
* reported read-only, named, never written through this contract (D62). The
|
|
25771
|
+
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
25772
|
+
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
25773
|
+
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
25774
|
+
*/
|
|
25775
|
+
var ExtensionSlotActivationSchema = object({
|
|
25776
|
+
state: _enum([
|
|
25777
|
+
"active",
|
|
25778
|
+
"inactive",
|
|
25779
|
+
"unknown"
|
|
25780
|
+
]),
|
|
25781
|
+
authority: string(),
|
|
25782
|
+
detail: string().optional()
|
|
25783
|
+
});
|
|
25784
|
+
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
25785
|
+
state: literal("ok"),
|
|
25786
|
+
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
25787
|
+
slotRef: string(),
|
|
25788
|
+
slot: ExtensionSlotIdSchema,
|
|
25789
|
+
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
25790
|
+
authority: string(),
|
|
25791
|
+
/** graft: its switch. association: null — removing every source is "off". */
|
|
25792
|
+
enabled: boolean().nullable(),
|
|
25793
|
+
/** graft: the cap registered on the host. association: null. */
|
|
25794
|
+
projects: string().nullable(),
|
|
25795
|
+
activation: ExtensionSlotActivationSchema.nullable(),
|
|
25796
|
+
value: ExtensionSlotValueSchema,
|
|
25797
|
+
sources: array(ExtensionSlotSourceSchema)
|
|
25798
|
+
}), object({
|
|
25799
|
+
state: literal("unreachable"),
|
|
25800
|
+
addonId: string(),
|
|
25801
|
+
reason: string()
|
|
25802
|
+
})]);
|
|
25803
|
+
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
25804
|
+
deviceId: number().int(),
|
|
25805
|
+
name: string(),
|
|
25806
|
+
type: string(),
|
|
25807
|
+
location: string().nullable(),
|
|
25808
|
+
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
25809
|
+
parentName: string().nullable(),
|
|
25810
|
+
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
25811
|
+
suggested: boolean(),
|
|
25812
|
+
/** Why it is suggested ("same location"), null when it is not. */
|
|
25813
|
+
reason: string().nullable()
|
|
25814
|
+
})) });
|
|
25815
|
+
/**
|
|
25816
|
+
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
25817
|
+
* reloaded the host (or, for an accessory child, its parent) because the
|
|
25818
|
+
* write changed what the host REGISTERS (a graft switched on or off, slice 2).
|
|
25819
|
+
*/
|
|
25820
|
+
var ExtensionSetResultSchema = object({
|
|
25821
|
+
applied: literal(true),
|
|
25822
|
+
reload: _enum([
|
|
25823
|
+
"none",
|
|
25824
|
+
"host",
|
|
25825
|
+
"parent"
|
|
25826
|
+
])
|
|
25827
|
+
});
|
|
25828
|
+
var ExtensionSlotRefInputSchema = object({
|
|
25829
|
+
deviceId: number().int(),
|
|
25830
|
+
slotRef: string().min(1)
|
|
25831
|
+
});
|
|
25832
|
+
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
25833
|
+
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
25834
|
+
kind: "mutation",
|
|
25835
|
+
auth: "admin"
|
|
25836
|
+
});
|
|
25837
|
+
/**
|
|
25226
25838
|
* Optional client-side hints sent at session creation to help the provider
|
|
25227
25839
|
* pick the best native source. All fields optional — a viewer that knows
|
|
25228
25840
|
* nothing still gets a sane default. (Relocated from the retired `webrtc`
|
|
@@ -27011,17 +27623,6 @@ object({
|
|
|
27011
27623
|
deviceId: number(),
|
|
27012
27624
|
status: DeviceStatusSchema
|
|
27013
27625
|
});
|
|
27014
|
-
object({
|
|
27015
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
27016
|
-
lastPressedAt: number().nullable(),
|
|
27017
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
27018
|
-
pressCountSinceStart: number()
|
|
27019
|
-
});
|
|
27020
|
-
object({
|
|
27021
|
-
deviceId: number(),
|
|
27022
|
-
timestamp: number()
|
|
27023
|
-
});
|
|
27024
|
-
DeviceType.Button, DeviceType.Camera;
|
|
27025
27626
|
/**
|
|
27026
27627
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
27027
27628
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -30077,7 +30678,7 @@ var HardwareInfoSchema = object({
|
|
|
30077
30678
|
coral: CoralInfoSchema.nullable().optional()
|
|
30078
30679
|
});
|
|
30079
30680
|
var PlatformScoreSchema = object({
|
|
30080
|
-
runtime:
|
|
30681
|
+
runtime: literal("python"),
|
|
30081
30682
|
backend: string(),
|
|
30082
30683
|
format: _enum([
|
|
30083
30684
|
"onnx",
|
|
@@ -30114,7 +30715,7 @@ var ModelRequirementSchema = object({
|
|
|
30114
30715
|
});
|
|
30115
30716
|
var ResolvedInferenceConfigSchema = object({
|
|
30116
30717
|
modelId: string(),
|
|
30117
|
-
runtime:
|
|
30718
|
+
runtime: literal("python"),
|
|
30118
30719
|
backend: string(),
|
|
30119
30720
|
format: ModelFormatSchema,
|
|
30120
30721
|
reason: string()
|
|
@@ -32321,6 +32922,92 @@ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSche
|
|
|
32321
32922
|
kind: "mutation",
|
|
32322
32923
|
auth: "admin"
|
|
32323
32924
|
});
|
|
32925
|
+
/**
|
|
32926
|
+
* Per-stage gating mode applied to the zones a rule references.
|
|
32927
|
+
*
|
|
32928
|
+
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
32929
|
+
* When at least one `include` rule fires for a stage, only entities
|
|
32930
|
+
* inside one of those zones pass that stage.
|
|
32931
|
+
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
32932
|
+
* Entities inside one of those zones are dropped at that stage.
|
|
32933
|
+
*
|
|
32934
|
+
* `monitor`-style observation (count without filtering) is not a rule
|
|
32935
|
+
* mode — zones without any matching rule are observed naturally by
|
|
32936
|
+
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
32937
|
+
* count, not filter" use case needs no rule at all.
|
|
32938
|
+
*/
|
|
32939
|
+
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
32940
|
+
/**
|
|
32941
|
+
* Per-consumer rule that references existing zones (geometry) and
|
|
32942
|
+
* defines how a specific pipeline stage should treat them. Each
|
|
32943
|
+
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
32944
|
+
* settings:
|
|
32945
|
+
*
|
|
32946
|
+
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
32947
|
+
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
32948
|
+
* - future: notification rules, audio gating, etc.
|
|
32949
|
+
*
|
|
32950
|
+
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
32951
|
+
* express "ignore motion in ALL of {garden, street}" with a single
|
|
32952
|
+
* rule. `classFilter` narrows the rule to specific object classes —
|
|
32953
|
+
* "drop person detections in the street, but keep cars" is one
|
|
32954
|
+
* `exclude` rule with `classFilter: ['person']`.
|
|
32955
|
+
*
|
|
32956
|
+
* `enabled` is a soft toggle — the operator can keep the rule
|
|
32957
|
+
* configured but inert without deleting it.
|
|
32958
|
+
*/
|
|
32959
|
+
var ZoneRuleSchema = object({
|
|
32960
|
+
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
32961
|
+
id: string(),
|
|
32962
|
+
/** Optional human-readable label rendered in the rule editor. */
|
|
32963
|
+
name: string().optional(),
|
|
32964
|
+
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
32965
|
+
* listed zones (OR-set: a detection in any one of them counts).
|
|
32966
|
+
* At least one zone id required — a rule with no targets is a
|
|
32967
|
+
* configuration mistake and the form validator rejects it. */
|
|
32968
|
+
zoneIds: array(string()).min(1).readonly(),
|
|
32969
|
+
mode: ZoneRuleModeEnum,
|
|
32970
|
+
/**
|
|
32971
|
+
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
32972
|
+
* applies to every class. Class strings match the `macroClass`
|
|
32973
|
+
* field on detections (e.g. `person`, `car`, `dog`).
|
|
32974
|
+
*/
|
|
32975
|
+
classFilter: array(string()).readonly().optional(),
|
|
32976
|
+
/**
|
|
32977
|
+
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
32978
|
+
* required to consider an entity "in the zone". Defaults to the
|
|
32979
|
+
* consumer's stage default when omitted. Kept for back-compat with
|
|
32980
|
+
* existing per-rule overrides; new operators pick the value via
|
|
32981
|
+
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
32982
|
+
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
32983
|
+
*/
|
|
32984
|
+
overlapThreshold: number().min(0).max(1).optional(),
|
|
32985
|
+
/**
|
|
32986
|
+
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
32987
|
+
* of the detection's bbox that must lie inside the zone for the
|
|
32988
|
+
* rule to match. Documented default is 85%; the engine substitutes
|
|
32989
|
+
* that when the field is omitted (kept optional so existing rules
|
|
32990
|
+
* stored without it stay valid).
|
|
32991
|
+
*
|
|
32992
|
+
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
32993
|
+
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
32994
|
+
* field exposed in the UI. Internally both feed the same gate.
|
|
32995
|
+
*/
|
|
32996
|
+
bboxInclusionPct: number().min(0).max(100).optional(),
|
|
32997
|
+
/**
|
|
32998
|
+
* When `true` and a detection has a segmentation mask, use the
|
|
32999
|
+
* mask for overlap instead of the bbox. Detection-stage only;
|
|
33000
|
+
* motion rules ignore this field.
|
|
33001
|
+
*/
|
|
33002
|
+
preferMask: boolean().optional(),
|
|
33003
|
+
/**
|
|
33004
|
+
* Soft-toggle: `false` disables the rule without deleting it.
|
|
33005
|
+
* Defaults to `true` so operators creating a rule via the UI
|
|
33006
|
+
* see it active immediately.
|
|
33007
|
+
*/
|
|
33008
|
+
enabled: boolean().default(true)
|
|
33009
|
+
});
|
|
33010
|
+
array(ZoneRuleSchema).readonly();
|
|
32324
33011
|
object({
|
|
32325
33012
|
/** Whether the script is currently executing. */
|
|
32326
33013
|
isRunning: boolean(),
|
|
@@ -33702,42 +34389,6 @@ DeviceType.Camera, method(object({
|
|
|
33702
34389
|
package: array(ZoneRuleSchema).readonly()
|
|
33703
34390
|
});
|
|
33704
34391
|
/**
|
|
33705
|
-
* LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
|
|
33706
|
-
* valutatore puro del suo FRONTE.
|
|
33707
|
-
*
|
|
33708
|
-
* Viveva dentro il builtin virtual-doorbell
|
|
33709
|
-
* (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
|
|
33710
|
-
* predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
|
|
33711
|
-
* `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
|
|
33712
|
-
* tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
|
|
33713
|
-
* fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
|
|
33714
|
-
* SPOSTA qui e il doorbell la ri-esporta.
|
|
33715
|
-
*
|
|
33716
|
-
* ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
|
|
33717
|
-
* due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
|
|
33718
|
-
* regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
|
|
33719
|
-
* booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
|
|
33720
|
-
*/
|
|
33721
|
-
/**
|
|
33722
|
-
* Known binary / switch source caps → the boolean slice field whose
|
|
33723
|
-
* false→true rise counts as ACTIVE. Every entry is "fire on active".
|
|
33724
|
-
* Sensors whose "active" reading is not a plain boolean (presence's string
|
|
33725
|
-
* state, connectivity's connected flag) are deliberately excluded — a
|
|
33726
|
-
* reconnect is not a doorbell press, and it is not a recording either.
|
|
33727
|
-
*/
|
|
33728
|
-
var SOURCE_CAP_ACTIVE_FIELD = {
|
|
33729
|
-
contact: "entryOpen",
|
|
33730
|
-
binary: "on",
|
|
33731
|
-
switch: "on",
|
|
33732
|
-
motion: "detected",
|
|
33733
|
-
flood: "flooded",
|
|
33734
|
-
gas: "detected",
|
|
33735
|
-
smoke: "detected",
|
|
33736
|
-
"carbon-monoxide": "detected",
|
|
33737
|
-
vibration: "detected",
|
|
33738
|
-
tamper: "tampered"
|
|
33739
|
-
};
|
|
33740
|
-
/**
|
|
33741
34392
|
* Accessory device helpers — shared across drivers.
|
|
33742
34393
|
*
|
|
33743
34394
|
* Many vendor-specific drivers register accessory child devices on
|
|
@@ -36537,6 +37188,30 @@ Object.freeze({
|
|
|
36537
37188
|
addonId: null,
|
|
36538
37189
|
access: "create"
|
|
36539
37190
|
},
|
|
37191
|
+
"deviceExtension.listCandidates": {
|
|
37192
|
+
capName: "device-extension",
|
|
37193
|
+
capScope: "device",
|
|
37194
|
+
addonId: null,
|
|
37195
|
+
access: "view"
|
|
37196
|
+
},
|
|
37197
|
+
"deviceExtension.listSlots": {
|
|
37198
|
+
capName: "device-extension",
|
|
37199
|
+
capScope: "device",
|
|
37200
|
+
addonId: null,
|
|
37201
|
+
access: "view"
|
|
37202
|
+
},
|
|
37203
|
+
"deviceExtension.listSources": {
|
|
37204
|
+
capName: "device-extension",
|
|
37205
|
+
capScope: "device",
|
|
37206
|
+
addonId: null,
|
|
37207
|
+
access: "view"
|
|
37208
|
+
},
|
|
37209
|
+
"deviceExtension.setSlot": {
|
|
37210
|
+
capName: "device-extension",
|
|
37211
|
+
capScope: "device",
|
|
37212
|
+
addonId: null,
|
|
37213
|
+
access: "create"
|
|
37214
|
+
},
|
|
36540
37215
|
"deviceManager.addLocation": {
|
|
36541
37216
|
capName: "device-manager",
|
|
36542
37217
|
capScope: "system",
|
|
@@ -37287,6 +37962,12 @@ Object.freeze({
|
|
|
37287
37962
|
addonId: null,
|
|
37288
37963
|
access: "view"
|
|
37289
37964
|
},
|
|
37965
|
+
"embeddingEncoder.resetFailedModels": {
|
|
37966
|
+
capName: "embedding-encoder",
|
|
37967
|
+
capScope: "system",
|
|
37968
|
+
addonId: null,
|
|
37969
|
+
access: "delete"
|
|
37970
|
+
},
|
|
37290
37971
|
"enumSensor.getStatus": {
|
|
37291
37972
|
capName: "enum-sensor",
|
|
37292
37973
|
capScope: "device",
|
|
@@ -38673,6 +39354,12 @@ Object.freeze({
|
|
|
38673
39354
|
addonId: null,
|
|
38674
39355
|
access: "view"
|
|
38675
39356
|
},
|
|
39357
|
+
"notificationRules.previewStateSummary": {
|
|
39358
|
+
capName: "notification-rules",
|
|
39359
|
+
capScope: "system",
|
|
39360
|
+
addonId: null,
|
|
39361
|
+
access: "view"
|
|
39362
|
+
},
|
|
38676
39363
|
"notificationRules.previewTemplate": {
|
|
38677
39364
|
capName: "notification-rules",
|
|
38678
39365
|
capScope: "system",
|
|
@@ -39249,12 +39936,6 @@ Object.freeze({
|
|
|
39249
39936
|
addonId: null,
|
|
39250
39937
|
access: "create"
|
|
39251
39938
|
},
|
|
39252
|
-
"pipelineAnalytics.runReplayFrameProcessor": {
|
|
39253
|
-
capName: "pipeline-analytics",
|
|
39254
|
-
capScope: "device",
|
|
39255
|
-
addonId: null,
|
|
39256
|
-
access: "create"
|
|
39257
|
-
},
|
|
39258
39939
|
"pipelineAnalytics.saveRetrainAnnotations": {
|
|
39259
39940
|
capName: "pipeline-analytics",
|
|
39260
39941
|
capScope: "device",
|
|
@@ -39621,6 +40302,12 @@ Object.freeze({
|
|
|
39621
40302
|
addonId: null,
|
|
39622
40303
|
access: "view"
|
|
39623
40304
|
},
|
|
40305
|
+
"pipelineOrchestrator.getClusterModelChoice": {
|
|
40306
|
+
capName: "pipeline-orchestrator",
|
|
40307
|
+
capScope: "system",
|
|
40308
|
+
addonId: null,
|
|
40309
|
+
access: "view"
|
|
40310
|
+
},
|
|
39624
40311
|
"pipelineOrchestrator.getDeviceLiveContribution": {
|
|
39625
40312
|
capName: "pipeline-orchestrator",
|
|
39626
40313
|
capScope: "system",
|
|
@@ -42446,6 +43133,26 @@ Object.freeze({
|
|
|
42446
43133
|
form: "single",
|
|
42447
43134
|
optional: false
|
|
42448
43135
|
}],
|
|
43136
|
+
"deviceExtension.listCandidates": [{
|
|
43137
|
+
name: "deviceId",
|
|
43138
|
+
form: "single",
|
|
43139
|
+
optional: false
|
|
43140
|
+
}],
|
|
43141
|
+
"deviceExtension.listSlots": [{
|
|
43142
|
+
name: "deviceId",
|
|
43143
|
+
form: "single",
|
|
43144
|
+
optional: false
|
|
43145
|
+
}],
|
|
43146
|
+
"deviceExtension.listSources": [{
|
|
43147
|
+
name: "deviceId",
|
|
43148
|
+
form: "single",
|
|
43149
|
+
optional: false
|
|
43150
|
+
}],
|
|
43151
|
+
"deviceExtension.setSlot": [{
|
|
43152
|
+
name: "deviceId",
|
|
43153
|
+
form: "single",
|
|
43154
|
+
optional: false
|
|
43155
|
+
}],
|
|
42449
43156
|
"deviceManager.adoptionRelease": [{
|
|
42450
43157
|
name: "camDeviceId",
|
|
42451
43158
|
form: "single",
|
|
@@ -43352,11 +44059,6 @@ Object.freeze({
|
|
|
43352
44059
|
form: "single",
|
|
43353
44060
|
optional: false
|
|
43354
44061
|
}],
|
|
43355
|
-
"pipelineAnalytics.runReplayFrameProcessor": [{
|
|
43356
|
-
name: "deviceId",
|
|
43357
|
-
form: "single",
|
|
43358
|
-
optional: false
|
|
43359
|
-
}],
|
|
43360
44062
|
"pipelineAnalytics.saveRetrainAnnotations": [{
|
|
43361
44063
|
name: "deviceId",
|
|
43362
44064
|
form: "single",
|
|
@@ -44245,12 +44947,55 @@ var NC_AUDIO_DEFAULTS = {
|
|
|
44245
44947
|
samplingSeconds: 10
|
|
44246
44948
|
};
|
|
44247
44949
|
new Set(["devices", "classes"]);
|
|
44248
|
-
/**
|
|
44950
|
+
/**
|
|
44951
|
+
* WHICH narrowing filter speaks about WHICH system-event kind — one predicate,
|
|
44952
|
+
* consumed by the rule ENGINE and by every rule EDITOR.
|
|
44953
|
+
*
|
|
44954
|
+
* ── The failure this file exists for ───────────────────────────────────────
|
|
44955
|
+
* `NcSystemEventConditionSchema` carries four optional narrowing lists
|
|
44956
|
+
* (`deviceIds`, `deviceTypes`, `nodeIds`, `packageNames`) beside a required
|
|
44957
|
+
* `kinds` gate. They are not four filters over one vocabulary: each belongs to
|
|
44958
|
+
* a FAMILY of kinds and is meaningless outside it. A node going away has no
|
|
44959
|
+
* device type; a completed export has no package; `stream-offline` deliberately
|
|
44960
|
+
* carries no device type at all (a stream belongs to a camera by construction).
|
|
44961
|
+
*
|
|
44962
|
+
* The engine applied all four to every kind, so a filter from one family failed
|
|
44963
|
+
* a kind from another family CLOSED. The operator's live rule "Eventi di
|
|
44964
|
+
* sistema" selected eleven kinds and set `deviceTypes: ['camera']` — the only
|
|
44965
|
+
* way to say "only my cameras" about the two liveness kinds — and NINE of the
|
|
44966
|
+
* eleven silently stopped being deliverable. Four days of history contained
|
|
44967
|
+
* `device-online` and `device-offline` and nothing else, across a window in
|
|
44968
|
+
* which agents were restarted and addons were updated.
|
|
44969
|
+
*
|
|
44970
|
+
* Both editors already computed this scoping, to decide which filter boxes to
|
|
44971
|
+
* render; the cap's own docblock already promised it ("Narrow a `device-*` kind
|
|
44972
|
+
* to these device TYPES"). Only the engine disagreed, and it disagreed in the
|
|
44973
|
+
* destructive direction. So the rule is stated ONCE, here, and the engine and
|
|
44974
|
+
* the editors are readers of it rather than three independent authors.
|
|
44975
|
+
*
|
|
44976
|
+
* ── The direction ─────────────────────────────────────────────────────────
|
|
44977
|
+
* Out of family ⇒ the filter is IGNORED, never fail-closed. An editor that
|
|
44978
|
+
* hides a box has already told the operator this filter does not speak about
|
|
44979
|
+
* these kinds, so honouring it as an exclusion contradicts the only
|
|
44980
|
+
* explanation the operator was ever given. Inside its family the filter still
|
|
44981
|
+
* narrows, and still fails CLOSED on a subject that cannot produce the identity
|
|
44982
|
+
* it tests (a device the mirror cannot name is not evidence of a camera).
|
|
44983
|
+
*/
|
|
44984
|
+
/**
|
|
44985
|
+
* Every filter, for the callers that must cover all of them (guards, tests).
|
|
44986
|
+
*
|
|
44987
|
+
* `consumableLowPercent` (D642) is not a list but it is a filter in exactly
|
|
44988
|
+
* this sense: it belongs to a family of kinds (the consumable pair) and the
|
|
44989
|
+
* engine consults it only there. It differs in one way the readers must know —
|
|
44990
|
+
* its ABSENCE is not "no narrowing" but the default threshold, because a
|
|
44991
|
+
* consumable episode is always judged at SOME threshold.
|
|
44992
|
+
*/
|
|
44249
44993
|
var NC_SYSTEM_EVENT_FILTER_KEYS = [
|
|
44250
44994
|
"deviceIds",
|
|
44251
44995
|
"deviceTypes",
|
|
44252
44996
|
"nodeIds",
|
|
44253
|
-
"packageNames"
|
|
44997
|
+
"packageNames",
|
|
44998
|
+
"consumableLowPercent"
|
|
44254
44999
|
];
|
|
44255
45000
|
new Map(Object.entries({
|
|
44256
45001
|
"device-online": "device-events",
|
|
@@ -44261,6 +45006,9 @@ new Map(Object.entries({
|
|
|
44261
45006
|
"device-battery-normal": "device-events",
|
|
44262
45007
|
"device-consumable-low": "device-events",
|
|
44263
45008
|
"device-consumable-normal": "device-events",
|
|
45009
|
+
"device-tank-low": "device-events",
|
|
45010
|
+
"device-tank-full": "device-events",
|
|
45011
|
+
"device-tank-normal": "device-events",
|
|
44264
45012
|
"stream-online": "device-events",
|
|
44265
45013
|
"stream-offline": "device-events",
|
|
44266
45014
|
"detection-blind": "device-events",
|
|
@@ -44290,6 +45038,98 @@ new Map(Object.entries({
|
|
|
44290
45038
|
"camera-enabled": null
|
|
44291
45039
|
}));
|
|
44292
45040
|
[...NC_SYSTEM_EVENT_FILTER_KEYS];
|
|
45041
|
+
var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
|
|
45042
|
+
{
|
|
45043
|
+
id: "device-state",
|
|
45044
|
+
family: "device-events",
|
|
45045
|
+
label: "Device state",
|
|
45046
|
+
kinds: [
|
|
45047
|
+
"device-offline",
|
|
45048
|
+
"device-online",
|
|
45049
|
+
"device-disabled",
|
|
45050
|
+
"device-enabled"
|
|
45051
|
+
]
|
|
45052
|
+
},
|
|
45053
|
+
{
|
|
45054
|
+
id: "streams",
|
|
45055
|
+
family: "device-events",
|
|
45056
|
+
label: "Streams",
|
|
45057
|
+
kinds: ["stream-offline", "stream-online"]
|
|
45058
|
+
},
|
|
45059
|
+
{
|
|
45060
|
+
id: "battery",
|
|
45061
|
+
family: "device-events",
|
|
45062
|
+
label: "Battery",
|
|
45063
|
+
kinds: ["device-battery-low", "device-battery-normal"]
|
|
45064
|
+
},
|
|
45065
|
+
{
|
|
45066
|
+
id: "consumables",
|
|
45067
|
+
family: "device-events",
|
|
45068
|
+
label: "Consumables",
|
|
45069
|
+
kinds: ["device-consumable-low", "device-consumable-normal"]
|
|
45070
|
+
},
|
|
45071
|
+
{
|
|
45072
|
+
id: "tanks",
|
|
45073
|
+
family: "device-events",
|
|
45074
|
+
label: "Tanks",
|
|
45075
|
+
kinds: [
|
|
45076
|
+
"device-tank-low",
|
|
45077
|
+
"device-tank-full",
|
|
45078
|
+
"device-tank-normal"
|
|
45079
|
+
]
|
|
45080
|
+
},
|
|
45081
|
+
{
|
|
45082
|
+
id: "detection-blind",
|
|
45083
|
+
family: "device-events",
|
|
45084
|
+
label: "Detecting nothing",
|
|
45085
|
+
kinds: ["detection-blind"]
|
|
45086
|
+
},
|
|
45087
|
+
{
|
|
45088
|
+
id: "nodes",
|
|
45089
|
+
family: "system",
|
|
45090
|
+
label: "Nodes",
|
|
45091
|
+
kinds: [
|
|
45092
|
+
"node-offline",
|
|
45093
|
+
"node-online",
|
|
45094
|
+
"node-inference-unavailable"
|
|
45095
|
+
]
|
|
45096
|
+
},
|
|
45097
|
+
{
|
|
45098
|
+
id: "addons",
|
|
45099
|
+
family: "system",
|
|
45100
|
+
label: "Addons",
|
|
45101
|
+
kinds: [
|
|
45102
|
+
"addon-crash-loop",
|
|
45103
|
+
"addon-update-available",
|
|
45104
|
+
"addon-updated"
|
|
45105
|
+
]
|
|
45106
|
+
},
|
|
45107
|
+
{
|
|
45108
|
+
id: "updates",
|
|
45109
|
+
family: "system",
|
|
45110
|
+
label: "Server & container updates",
|
|
45111
|
+
kinds: [
|
|
45112
|
+
"server-update-available",
|
|
45113
|
+
"server-updated",
|
|
45114
|
+
"wrapper-update-available"
|
|
45115
|
+
]
|
|
45116
|
+
},
|
|
45117
|
+
{
|
|
45118
|
+
id: "backups-exports",
|
|
45119
|
+
family: "system",
|
|
45120
|
+
label: "Backups & exports",
|
|
45121
|
+
kinds: ["backup-completed", "export-completed"]
|
|
45122
|
+
},
|
|
45123
|
+
{
|
|
45124
|
+
id: "alarm",
|
|
45125
|
+
family: "alarm",
|
|
45126
|
+
label: "Alarm",
|
|
45127
|
+
kinds: NC_ALARM_SYSTEM_EVENT_KINDS
|
|
45128
|
+
}
|
|
45129
|
+
];
|
|
45130
|
+
function systemEventKindsOfFamily(family) {
|
|
45131
|
+
return NC_SYSTEM_EVENT_KIND_GROUP_SPECS.filter((g) => g.family === family).flatMap((g) => g.kinds);
|
|
45132
|
+
}
|
|
44293
45133
|
NC_AUDIO_DEFAULTS.hitPercent, NC_AUDIO_DEFAULTS.samplingSeconds;
|
|
44294
45134
|
/**
|
|
44295
45135
|
* WHICH WAY A BOOLEAN SENSOR MOVED — read off the one slice a sensor event
|
|
@@ -44328,6 +45168,11 @@ var RULE_BODY_ONLY = ["body"];
|
|
|
44328
45168
|
var RULE_TEXT = ["title", "body"];
|
|
44329
45169
|
var BATTERY = ["device-battery-low", "device-battery-normal"];
|
|
44330
45170
|
var CONSUMABLE = ["device-consumable-low", "device-consumable-normal"];
|
|
45171
|
+
var TANK = [
|
|
45172
|
+
"device-tank-low",
|
|
45173
|
+
"device-tank-full",
|
|
45174
|
+
"device-tank-normal"
|
|
45175
|
+
];
|
|
44331
45176
|
var UPDATES = [
|
|
44332
45177
|
"addon-update-available",
|
|
44333
45178
|
"server-update-available",
|
|
@@ -44353,12 +45198,189 @@ var DEVICE_EVENTS = [
|
|
|
44353
45198
|
"device-enabled",
|
|
44354
45199
|
...BATTERY,
|
|
44355
45200
|
...CONSUMABLE,
|
|
45201
|
+
...TANK,
|
|
44356
45202
|
"stream-online",
|
|
44357
45203
|
"stream-offline",
|
|
44358
45204
|
"detection-blind",
|
|
44359
45205
|
...ALARM
|
|
44360
45206
|
];
|
|
44361
|
-
|
|
45207
|
+
/** Every kind a summary may speak about — the two summarisable families. */
|
|
45208
|
+
var SUMMARISABLE = [...systemEventKindsOfFamily("device-events"), ...systemEventKindsOfFamily("system")];
|
|
45209
|
+
/** One per summary SECTION (`NC_STATE_SUMMARY_SECTIONS` in the notification
|
|
45210
|
+
* centre): the section's lines, offered when one of its kinds is selected. */
|
|
45211
|
+
var STATE_SUMMARY_SECTION_VARS = [
|
|
45212
|
+
{
|
|
45213
|
+
name: "summaryDevices",
|
|
45214
|
+
label: "Summary: devices offline / switched off",
|
|
45215
|
+
example: "Garage — offline since 07:12",
|
|
45216
|
+
kinds: [
|
|
45217
|
+
"device-offline",
|
|
45218
|
+
"device-online",
|
|
45219
|
+
"device-disabled",
|
|
45220
|
+
"device-enabled"
|
|
45221
|
+
]
|
|
45222
|
+
},
|
|
45223
|
+
{
|
|
45224
|
+
name: "summaryStreams",
|
|
45225
|
+
label: "Summary: streams offline",
|
|
45226
|
+
example: "Ingresso (high) — since 06:40",
|
|
45227
|
+
kinds: ["stream-offline", "stream-online"]
|
|
45228
|
+
},
|
|
45229
|
+
{
|
|
45230
|
+
name: "summaryBattery",
|
|
45231
|
+
label: "Summary: low batteries",
|
|
45232
|
+
example: "Sensore porta — 8 %",
|
|
45233
|
+
kinds: BATTERY
|
|
45234
|
+
},
|
|
45235
|
+
{
|
|
45236
|
+
name: "summaryConsumables",
|
|
45237
|
+
label: "Summary: consumables",
|
|
45238
|
+
example: "Robot — filter 10 %",
|
|
45239
|
+
kinds: CONSUMABLE
|
|
45240
|
+
},
|
|
45241
|
+
{
|
|
45242
|
+
name: "summaryTanks",
|
|
45243
|
+
label: "Summary: tanks",
|
|
45244
|
+
example: "Robot — clean water low",
|
|
45245
|
+
kinds: TANK
|
|
45246
|
+
},
|
|
45247
|
+
{
|
|
45248
|
+
name: "summaryDetection",
|
|
45249
|
+
label: "Summary: cameras detecting nothing",
|
|
45250
|
+
example: "Ingresso — since 05:10",
|
|
45251
|
+
kinds: ["detection-blind"]
|
|
45252
|
+
},
|
|
45253
|
+
{
|
|
45254
|
+
name: "summaryNodes",
|
|
45255
|
+
label: "Summary: nodes",
|
|
45256
|
+
example: "little-unraid — offline since 03:00",
|
|
45257
|
+
kinds: [
|
|
45258
|
+
"node-offline",
|
|
45259
|
+
"node-online",
|
|
45260
|
+
"node-inference-unavailable"
|
|
45261
|
+
]
|
|
45262
|
+
},
|
|
45263
|
+
{
|
|
45264
|
+
name: "summaryAddons",
|
|
45265
|
+
label: "Summary: addons",
|
|
45266
|
+
example: "@camstack/addon-recorder 1.2.3 → 1.2.4",
|
|
45267
|
+
kinds: [
|
|
45268
|
+
"addon-crash-loop",
|
|
45269
|
+
"addon-update-available",
|
|
45270
|
+
"addon-updated"
|
|
45271
|
+
]
|
|
45272
|
+
},
|
|
45273
|
+
{
|
|
45274
|
+
name: "summaryUpdates",
|
|
45275
|
+
label: "Summary: server & container updates",
|
|
45276
|
+
example: "server 1.2.377 → 1.2.378",
|
|
45277
|
+
kinds: [
|
|
45278
|
+
"server-update-available",
|
|
45279
|
+
"server-updated",
|
|
45280
|
+
"wrapper-update-available"
|
|
45281
|
+
]
|
|
45282
|
+
}
|
|
45283
|
+
];
|
|
45284
|
+
var STATE_SUMMARY_VARS = [
|
|
45285
|
+
{
|
|
45286
|
+
name: "summaryText",
|
|
45287
|
+
label: "Summary: every section",
|
|
45288
|
+
description: "One block per section with something to report, one line per item.",
|
|
45289
|
+
example: "Batterie scariche: Sensore porta — 8 %",
|
|
45290
|
+
group: "system",
|
|
45291
|
+
families: ["rule"],
|
|
45292
|
+
fields: [...RULE_TEXT],
|
|
45293
|
+
kinds: ["system"],
|
|
45294
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
45295
|
+
systemEventDeliveries: ["summary"]
|
|
45296
|
+
},
|
|
45297
|
+
{
|
|
45298
|
+
name: "summaryCount",
|
|
45299
|
+
label: "Summary: items reported",
|
|
45300
|
+
example: "3",
|
|
45301
|
+
group: "system",
|
|
45302
|
+
families: ["rule"],
|
|
45303
|
+
fields: [...RULE_TEXT],
|
|
45304
|
+
kinds: ["system"],
|
|
45305
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
45306
|
+
systemEventDeliveries: ["summary"]
|
|
45307
|
+
},
|
|
45308
|
+
...STATE_SUMMARY_SECTION_VARS.map((v) => ({
|
|
45309
|
+
name: v.name,
|
|
45310
|
+
label: v.label,
|
|
45311
|
+
example: v.example,
|
|
45312
|
+
group: "system",
|
|
45313
|
+
families: ["rule"],
|
|
45314
|
+
fields: [...RULE_TEXT],
|
|
45315
|
+
kinds: ["system"],
|
|
45316
|
+
systemEventKinds: [...v.kinds],
|
|
45317
|
+
systemEventDeliveries: ["summary"]
|
|
45318
|
+
}))
|
|
45319
|
+
];
|
|
45320
|
+
[
|
|
45321
|
+
[...DEVICE_EVENTS],
|
|
45322
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45323
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45324
|
+
[...RULE_TEXT],
|
|
45325
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45326
|
+
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
45327
|
+
[...RULE_TEXT],
|
|
45328
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45329
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45330
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45331
|
+
[...RULE_TEXT],
|
|
45332
|
+
[...RULE_TEXT],
|
|
45333
|
+
[...RULE_TEXT],
|
|
45334
|
+
[...RULE_TEXT],
|
|
45335
|
+
[...RULE_TEXT],
|
|
45336
|
+
[...RULE_TEXT],
|
|
45337
|
+
[...RULE_TEXT],
|
|
45338
|
+
[...RULE_TEXT],
|
|
45339
|
+
[...RULE_BODY_ONLY],
|
|
45340
|
+
[...RULE_TEXT],
|
|
45341
|
+
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
45342
|
+
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
45343
|
+
([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
|
|
45344
|
+
([...RULE_TEXT], [...CONSUMABLE]),
|
|
45345
|
+
([...RULE_TEXT], [...TANK]),
|
|
45346
|
+
[...RULE_TEXT],
|
|
45347
|
+
([...RULE_TEXT], [...UPDATES]),
|
|
45348
|
+
([...RULE_TEXT], [...UPDATES]),
|
|
45349
|
+
[...RULE_TEXT],
|
|
45350
|
+
[...RULE_TEXT],
|
|
45351
|
+
[...RULE_TEXT],
|
|
45352
|
+
([...RULE_TEXT], [...UPDATES]),
|
|
45353
|
+
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
45354
|
+
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
45355
|
+
([...RULE_TEXT], [...UPDATES]),
|
|
45356
|
+
([...RULE_TEXT], [...UPDATES]),
|
|
45357
|
+
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
45358
|
+
[...RULE_TEXT],
|
|
45359
|
+
[...RULE_TEXT],
|
|
45360
|
+
[...RULE_TEXT],
|
|
45361
|
+
[...RULE_TEXT],
|
|
45362
|
+
[...RULE_TEXT],
|
|
45363
|
+
[...RULE_TEXT],
|
|
45364
|
+
[...RULE_TEXT],
|
|
45365
|
+
[...RULE_TEXT],
|
|
45366
|
+
[...RULE_TEXT],
|
|
45367
|
+
[...RULE_TEXT],
|
|
45368
|
+
[...RULE_TEXT],
|
|
45369
|
+
[...RULE_TEXT],
|
|
45370
|
+
[...RULE_TEXT],
|
|
45371
|
+
[...RULE_TEXT],
|
|
45372
|
+
[...RULE_TEXT],
|
|
45373
|
+
[...RULE_TEXT],
|
|
45374
|
+
[...RULE_TEXT],
|
|
45375
|
+
[...RULE_TEXT],
|
|
45376
|
+
[...RULE_TEXT],
|
|
45377
|
+
[...RULE_TEXT],
|
|
45378
|
+
[...RULE_TEXT],
|
|
45379
|
+
[...RULE_TEXT],
|
|
45380
|
+
[...RULE_TEXT],
|
|
45381
|
+
[...RULE_TEXT],
|
|
45382
|
+
...STATE_SUMMARY_VARS
|
|
45383
|
+
];
|
|
44362
45384
|
/**
|
|
44363
45385
|
* TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
|
|
44364
45386
|
*
|
|
@@ -44590,68 +45612,6 @@ TimelapseRuleInputSchema.extend({
|
|
|
44590
45612
|
createdAt: number(),
|
|
44591
45613
|
updatedAt: number()
|
|
44592
45614
|
});
|
|
44593
|
-
Object.freeze(Object.fromEntries([{
|
|
44594
|
-
stepId: "face-embedding",
|
|
44595
|
-
label: "Face recognition model",
|
|
44596
|
-
defaultModelId: "arcface-r100",
|
|
44597
|
-
indexName: "the enrolled face gallery",
|
|
44598
|
-
options: [
|
|
44599
|
-
{
|
|
44600
|
-
id: "arcface-r100",
|
|
44601
|
-
label: "ArcFace (ResNet34)"
|
|
44602
|
-
},
|
|
44603
|
-
{
|
|
44604
|
-
id: "auraface-r100",
|
|
44605
|
-
label: "AuraFace R100"
|
|
44606
|
-
},
|
|
44607
|
-
{
|
|
44608
|
-
id: "inception-resnet-v1",
|
|
44609
|
-
label: "Inception ResNet V1"
|
|
44610
|
-
}
|
|
44611
|
-
]
|
|
44612
|
-
}, {
|
|
44613
|
-
stepId: "clip-embedding",
|
|
44614
|
-
label: "Semantic search model",
|
|
44615
|
-
defaultModelId: "mobileclip-s1",
|
|
44616
|
-
indexName: "the object semantic-search index",
|
|
44617
|
-
options: [{
|
|
44618
|
-
id: "mobileclip-s1",
|
|
44619
|
-
label: "MobileCLIP S1"
|
|
44620
|
-
}, {
|
|
44621
|
-
id: "mobileclip-s2",
|
|
44622
|
-
label: "MobileCLIP S2"
|
|
44623
|
-
}]
|
|
44624
|
-
}].map((s) => [s.stepId, s.defaultModelId])));
|
|
44625
|
-
string().min(1);
|
|
44626
|
-
var CLUSTER_STEP_SETTING_FIELDS = [{
|
|
44627
|
-
stepId: "face-embedding",
|
|
44628
|
-
key: "minLandmarkFaceSize",
|
|
44629
|
-
label: "Min face size for recognition (detection px)",
|
|
44630
|
-
description: "Refuse to embed a face smaller than this IN THE DETECTION FRAME. Applies to every node — the enrolled gallery is one index, and two admission floors would fill it from two policies. 0 disables the gate.",
|
|
44631
|
-
type: "slider",
|
|
44632
|
-
min: 0,
|
|
44633
|
-
max: 64,
|
|
44634
|
-
step: 2,
|
|
44635
|
-
default: 24
|
|
44636
|
-
}];
|
|
44637
|
-
function clusterStepSettingKey(stepId, fieldKey) {
|
|
44638
|
-
return `clusterStepSetting:${stepId}:${fieldKey}`;
|
|
44639
|
-
}
|
|
44640
|
-
var ClusterSettingNumberSchema = number().finite();
|
|
44641
|
-
function readClusterStepSettings(config) {
|
|
44642
|
-
const out = {};
|
|
44643
|
-
for (const field of CLUSTER_STEP_SETTING_FIELDS) {
|
|
44644
|
-
const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
|
|
44645
|
-
const value = parsed.success ? parsed.data : field.default;
|
|
44646
|
-
const existing = out[field.stepId] ?? {};
|
|
44647
|
-
out[field.stepId] = {
|
|
44648
|
-
...existing,
|
|
44649
|
-
[field.key]: value
|
|
44650
|
-
};
|
|
44651
|
-
}
|
|
44652
|
-
return out;
|
|
44653
|
-
}
|
|
44654
|
-
readClusterStepSettings({});
|
|
44655
45615
|
object({
|
|
44656
45616
|
/**
|
|
44657
45617
|
* Fraction of the box's own size added on EACH side before cutting.
|
|
@@ -44855,7 +45815,7 @@ var AgentUIAddon = class extends BaseAddon {
|
|
|
44855
45815
|
capability: adminUiCapability,
|
|
44856
45816
|
provider: {
|
|
44857
45817
|
getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
|
|
44858
|
-
getVersion: async () => ({ version: "1.2.
|
|
45818
|
+
getVersion: async () => ({ version: "1.2.149" })
|
|
44859
45819
|
}
|
|
44860
45820
|
}];
|
|
44861
45821
|
}
|