@camstack/addon-model-studio 1.1.173 → 1.1.175
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/{MotionZonesSettings-BfCoYgxT.mjs → MotionZonesSettings-BnPKd-p7.mjs} +2 -2
- package/dist/{PrivacyMaskSettings-Th5IVviI.mjs → PrivacyMaskSettings-DuPNepvj.mjs} +4 -4
- package/dist/{SceneMonitorEditor-BERqxPAZ.mjs → SceneMonitorEditor-shkSy7R6.mjs} +3 -3
- package/dist/_stub.js +12 -12
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-CP30dIZR.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-BtQXSIcN.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CSU-vA08.mjs +26 -0
- package/dist/addon-model-studio.css +1 -1
- package/dist/{hostInit-BZQ7ikZC.mjs → hostInit-v1KM-izE.mjs} +2 -2
- package/dist/model-studio.addon.js +2007 -1047
- package/dist/model-studio.addon.mjs +2007 -1047
- package/dist/{player-overlays-B4uXOi-a.mjs → player-overlays-XBDUBreN.mjs} +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-CEbpemt_.mjs → responsive-Ct9r9fcD.mjs} +1 -1
- package/dist/{scene-monitor-copy-DXDF5cQH.mjs → scene-monitor-copy-6edUqagK.mjs} +1 -1
- package/dist/{square-B_pecyJV.mjs → square-xaUv7lAA.mjs} +1 -1
- package/dist/{trash-2-DfAU2tvI.mjs → trash-2-BjU_ykxW.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DRHKHJI4.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-Byr-xHCs.mjs} +1 -1
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-ak-DR-J7.mjs +0 -26
|
@@ -5863,7 +5863,7 @@ var ZodIssueCode = {
|
|
|
5863
5863
|
var ZodFirstPartyTypeKind;
|
|
5864
5864
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5865
5865
|
//#endregion
|
|
5866
|
-
//#region ../types/dist/sleep-
|
|
5866
|
+
//#region ../types/dist/sleep-BXv0ZcRa.mjs
|
|
5867
5867
|
/**
|
|
5868
5868
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5869
5869
|
* window to float samples (D455).
|
|
@@ -6648,6 +6648,40 @@ var BaseAddon = class {
|
|
|
6648
6648
|
const node = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6649
6649
|
return keys.size > 0 ? projectStore(raw, keys, node) : raw;
|
|
6650
6650
|
}
|
|
6651
|
+
/**
|
|
6652
|
+
* Whether ONE global key of this addon's store was written, read three-way
|
|
6653
|
+
* (D651). For a question a hydrated view cannot answer: `getGlobalSettings`
|
|
6654
|
+
* reports `value ?? default`, so "the operator chose the default" and "nobody
|
|
6655
|
+
* chose" look the same, and a failed read looks like both. A `perNode` key is
|
|
6656
|
+
* not supported here: its stored name is scoped.
|
|
6657
|
+
*/
|
|
6658
|
+
async readStoredGlobalKey(key) {
|
|
6659
|
+
const read = this._ctx?.settings?.readAddonStoreResult;
|
|
6660
|
+
if (read === void 0) return {
|
|
6661
|
+
kind: "unreadable",
|
|
6662
|
+
reason: "three-way-read-unavailable"
|
|
6663
|
+
};
|
|
6664
|
+
let result;
|
|
6665
|
+
try {
|
|
6666
|
+
result = await read.call(this._ctx?.settings);
|
|
6667
|
+
} catch (err) {
|
|
6668
|
+
return {
|
|
6669
|
+
kind: "unreadable",
|
|
6670
|
+
reason: "store-read-failed",
|
|
6671
|
+
error: err instanceof Error ? err.message : String(err)
|
|
6672
|
+
};
|
|
6673
|
+
}
|
|
6674
|
+
if (result.kind === "failed") return {
|
|
6675
|
+
kind: "unreadable",
|
|
6676
|
+
reason: "store-read-failed",
|
|
6677
|
+
error: result.error
|
|
6678
|
+
};
|
|
6679
|
+
if (result.kind === "missing" || !Object.prototype.hasOwnProperty.call(result.value, key)) return { kind: "absent" };
|
|
6680
|
+
return {
|
|
6681
|
+
kind: "present",
|
|
6682
|
+
value: result.value[key]
|
|
6683
|
+
};
|
|
6684
|
+
}
|
|
6651
6685
|
async updateGlobalSettings(patch, nodeId) {
|
|
6652
6686
|
const keys = this.perNodeKeys();
|
|
6653
6687
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
@@ -9971,6 +10005,43 @@ var LogChannelWindowSchema = object({
|
|
|
9971
10005
|
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
9972
10006
|
deviceIds: array(number().int()).readonly().nullable()
|
|
9973
10007
|
});
|
|
10008
|
+
var ClipModelMetaSchema = object({
|
|
10009
|
+
/** The paired text encoder's catalog id (the embedding-encoder's text catalog). */
|
|
10010
|
+
textModelId: string().min(1),
|
|
10011
|
+
/** Output dimension of BOTH towers. A vector of any other length is refused. */
|
|
10012
|
+
embeddingDim: number().int().positive(),
|
|
10013
|
+
/**
|
|
10014
|
+
* The `vector-store` index this model's vectors live in. ONE feature space
|
|
10015
|
+
* per index: two models share an index only when their vectors are ranked
|
|
10016
|
+
* against each other, which for CLIP means never across families. MobileCLIP
|
|
10017
|
+
* S1 and S2 share `object-clip` for history (separated by the row's
|
|
10018
|
+
* `modelId`); any other model gets its own.
|
|
10019
|
+
*/
|
|
10020
|
+
vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
|
|
10021
|
+
/**
|
|
10022
|
+
* The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
|
|
10023
|
+
* must be unique per tokenizer: every model's siblings land in ONE flat
|
|
10024
|
+
* models directory, so two different tokenizers under the same name would
|
|
10025
|
+
* silently overwrite each other (whichever model downloaded last wins, and
|
|
10026
|
+
* the other one tokenises with the wrong vocabulary).
|
|
10027
|
+
*/
|
|
10028
|
+
tokenizerFile: string().min(1),
|
|
10029
|
+
/** Token window the text graph takes (SigLIP2: 64; CLIP BPE: 77). */
|
|
10030
|
+
contextLength: number().int().positive(),
|
|
10031
|
+
/** Id the tokenizer pads with. */
|
|
10032
|
+
padId: number().int().nonnegative(),
|
|
10033
|
+
/**
|
|
10034
|
+
* The search cosine floor at `strictness: 'loose'` — calibrated per model,
|
|
10035
|
+
* because cosine bands are a property of the model: 0.2 keeps 96% of matched
|
|
10036
|
+
* COCO caption-image pairs on MobileCLIP S1 and 2.7% on SigLIP2.
|
|
10037
|
+
*/
|
|
10038
|
+
searchMinScore: number().min(0).max(1)
|
|
10039
|
+
});
|
|
10040
|
+
var ClipSearchStrictnessSchema = _enum([
|
|
10041
|
+
"loose",
|
|
10042
|
+
"balanced",
|
|
10043
|
+
"strict"
|
|
10044
|
+
]);
|
|
9974
10045
|
var MODEL_FORMATS = [
|
|
9975
10046
|
"onnx",
|
|
9976
10047
|
"coreml",
|
|
@@ -9999,7 +10070,7 @@ var ModelFormatEntrySchema = object({
|
|
|
9999
10070
|
/** Multi-file payload (directory members or sibling files). */
|
|
10000
10071
|
files: array(string()).readonly().optional(),
|
|
10001
10072
|
/** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
|
|
10002
|
-
runtimes: array(_enum(["
|
|
10073
|
+
runtimes: array(_enum(["python"])).readonly().optional()
|
|
10003
10074
|
});
|
|
10004
10075
|
/**
|
|
10005
10076
|
* Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
|
|
@@ -10080,10 +10151,17 @@ var ModelCatalogEntrySchema = object({
|
|
|
10080
10151
|
inputChannels: number().int().positive().optional(),
|
|
10081
10152
|
labels: array(LabelDefinitionSchema).readonly(),
|
|
10082
10153
|
inputLayout: _enum(["nchw", "nhwc"]).optional(),
|
|
10154
|
+
/**
|
|
10155
|
+
* `'scrfd'` applies InsightFace's SCRFD input contract, `(x - 127.5) / 128`
|
|
10156
|
+
* (upstream `insightface/model_zoo/scrfd.py`), instead of the historical
|
|
10157
|
+
* plain `/255`. Measured against COCO GT: 188 → 196 faces found on the
|
|
10158
|
+
* `scrfd-2.5g` catalog entry (2026-09-26 model-replacement spike, §2.4-2).
|
|
10159
|
+
*/
|
|
10083
10160
|
inputNormalization: _enum([
|
|
10084
10161
|
"zero-one",
|
|
10085
10162
|
"imagenet",
|
|
10086
|
-
"none"
|
|
10163
|
+
"none",
|
|
10164
|
+
"scrfd"
|
|
10087
10165
|
]).optional(),
|
|
10088
10166
|
/**
|
|
10089
10167
|
* The model already applies softmax IN-GRAPH — its raw output is a
|
|
@@ -10167,7 +10245,14 @@ var ModelCatalogEntrySchema = object({
|
|
|
10167
10245
|
* applies (Frigate / COCO public catalog). Set on a custom model whose raw
|
|
10168
10246
|
* labels already ARE the CamStack macros (Scrypted identity map).
|
|
10169
10247
|
*/
|
|
10170
|
-
classMap: DetectionCatalogClassMapSchema.optional()
|
|
10248
|
+
classMap: DetectionCatalogClassMapSchema.optional(),
|
|
10249
|
+
/**
|
|
10250
|
+
* The model's CLIP feature-space contract (text encoder, dimension, vector
|
|
10251
|
+
* index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
|
|
10252
|
+
* CLIP image encoder; its absence is what "not a CLIP model" means to the
|
|
10253
|
+
* embedding encoder and the semantic-search store (D649).
|
|
10254
|
+
*/
|
|
10255
|
+
clip: ClipModelMetaSchema.optional()
|
|
10171
10256
|
});
|
|
10172
10257
|
var ConvertTargetSchema = discriminatedUnion("format", [object({
|
|
10173
10258
|
format: literal("openvino"),
|
|
@@ -10185,7 +10270,8 @@ var ModelConvertMetadataSchema = object({
|
|
|
10185
10270
|
inputNormalization: _enum([
|
|
10186
10271
|
"zero-one",
|
|
10187
10272
|
"imagenet",
|
|
10188
|
-
"none"
|
|
10273
|
+
"none",
|
|
10274
|
+
"scrfd"
|
|
10189
10275
|
]).optional(),
|
|
10190
10276
|
preprocessMode: _enum(["letterbox", "resize"]).optional(),
|
|
10191
10277
|
outputFormat: _enum([
|
|
@@ -14418,6 +14504,13 @@ var LinkedDeviceSchema = object({
|
|
|
14418
14504
|
features: array(string()),
|
|
14419
14505
|
producesTrackedEvents: boolean().optional()
|
|
14420
14506
|
});
|
|
14507
|
+
/**
|
|
14508
|
+
* The `linked-devices` extension slot's editable value (D648): the operator's
|
|
14509
|
+
* pick list, exactly what `_linkedDeviceIds` persists. Tree children are NOT
|
|
14510
|
+
* in it — they are always linked and are not a pick.
|
|
14511
|
+
*/
|
|
14512
|
+
var LinkedDevicesSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
|
|
14513
|
+
DeviceType.Camera;
|
|
14421
14514
|
/** One camera's resolved linked set, tagged with the camera it belongs to.
|
|
14422
14515
|
* The batch answer needs the tag; the single-device answer already has it
|
|
14423
14516
|
* from the input, which is why `getLinkedDevices` keeps the untagged shape. */
|
|
@@ -14943,16 +15036,101 @@ var EmbeddingResultSchema = object({
|
|
|
14943
15036
|
embedding: array(number()),
|
|
14944
15037
|
inferenceMs: number()
|
|
14945
15038
|
});
|
|
15039
|
+
/** The two CLIP towers the encoder runs; a crash budget is kept per tower. */
|
|
15040
|
+
var EmbeddingTowerSchema = _enum(["image", "text"]);
|
|
15041
|
+
/**
|
|
15042
|
+
* A tower in the terminal `failed` state (D649, D6): it crashed or failed to
|
|
15043
|
+
* load `crashes` times within `windowMs`, and is refused by name until an
|
|
15044
|
+
* operator `resetFailedModels` or a model change — never on a timer.
|
|
15045
|
+
*
|
|
15046
|
+
* `nodeId` is the node whose tower failed. The state lives in THAT node's
|
|
15047
|
+
* encoder process (in memory — a runner respawn clears it), and one node's
|
|
15048
|
+
* answer says nothing about another's.
|
|
15049
|
+
*/
|
|
15050
|
+
var EmbeddingFailedModelSchema = object({
|
|
15051
|
+
modelId: string(),
|
|
15052
|
+
tower: EmbeddingTowerSchema,
|
|
15053
|
+
nodeId: string(),
|
|
15054
|
+
crashes: number(),
|
|
15055
|
+
windowMs: number(),
|
|
15056
|
+
sinceMs: number(),
|
|
15057
|
+
lastReason: string()
|
|
15058
|
+
});
|
|
15059
|
+
/**
|
|
15060
|
+
* A model whose REQUIREMENTS can never be met on this node (D649 round 5):
|
|
15061
|
+
* an id the catalog does not know, a model URL answering 404/410, a declared
|
|
15062
|
+
* sibling (the tokenizer) that is not there. After `attempts` failed builds
|
|
15063
|
+
* it is terminally `requirements-failed`, refused by name until an operator
|
|
15064
|
+
* `resetFailedModels` or a model change — the same exits as a crashed tower.
|
|
15065
|
+
*/
|
|
15066
|
+
var EmbeddingFailedRequirementSchema = object({
|
|
15067
|
+
modelId: string(),
|
|
15068
|
+
tower: EmbeddingTowerSchema,
|
|
15069
|
+
nodeId: string(),
|
|
15070
|
+
attempts: number(),
|
|
15071
|
+
sinceMs: number(),
|
|
15072
|
+
lastReason: string()
|
|
15073
|
+
});
|
|
14946
15074
|
var EmbeddingInfoSchema = object({
|
|
14947
15075
|
modelId: string(),
|
|
14948
15076
|
embeddingDim: number(),
|
|
14949
|
-
ready: boolean()
|
|
14950
|
-
|
|
15077
|
+
ready: boolean(),
|
|
15078
|
+
/**
|
|
15079
|
+
* The node that answered. Absent only from an encoder older than D649's
|
|
15080
|
+
* crash budget — whose `failedModels` is then UNKNOWN (D315), never "none".
|
|
15081
|
+
*/
|
|
15082
|
+
nodeId: string().optional(),
|
|
15083
|
+
/**
|
|
15084
|
+
* Towers in `failed` on the answering node, each row naming it. `undefined`
|
|
15085
|
+
* means the node could not say (pre-budget encoder); a node that has the
|
|
15086
|
+
* budget always answers an array, empty included.
|
|
15087
|
+
*/
|
|
15088
|
+
failedModels: array(EmbeddingFailedModelSchema).optional(),
|
|
15089
|
+
/** Models terminally `requirements-failed` on the answering node; same reading as above. */
|
|
15090
|
+
failedRequirements: array(EmbeddingFailedRequirementSchema).optional()
|
|
15091
|
+
});
|
|
15092
|
+
/**
|
|
15093
|
+
* The THREE codes an encoder refusal can carry (D649, D6). Same shape as
|
|
15094
|
+
* `VECTOR_INDEX_DIM_CONFLICT`: the code rides in the MESSAGE, because an
|
|
15095
|
+
* Error's own properties do not survive the UDS/tRPC hop and its message does,
|
|
15096
|
+
* and both sides go through the helpers below — the encoder builds the
|
|
15097
|
+
* refusal, the live detail plane classifies on it to count refusals per
|
|
15098
|
+
* camera instead of logging one warning per track. The bracketed token
|
|
15099
|
+
* carries the code, the model, the tower and the node so a consumer never
|
|
15100
|
+
* parses prose.
|
|
15101
|
+
*
|
|
15102
|
+
* - `EMBEDDING_MODEL_FAILED`: the tower crashed / failed to load past the crash
|
|
15103
|
+
* budget — terminal until `resetFailedModels` or a model change.
|
|
15104
|
+
* - `EMBEDDING_REQUIREMENTS_UNAVAILABLE`: files or runtime not there right now
|
|
15105
|
+
* (a download or Python that failed, or the cooldown after one) — the next
|
|
15106
|
+
* request past the cooldown tries again.
|
|
15107
|
+
* - `EMBEDDING_REQUIREMENTS_FAILED`: the requirements can never be met (unknown
|
|
15108
|
+
* id, 404/410, missing sibling) and the bounded attempts are spent —
|
|
15109
|
+
* terminal, same exits as a crashed tower.
|
|
15110
|
+
*/
|
|
15111
|
+
var EMBEDDING_MODEL_FAILED = "embedding-model-failed";
|
|
15112
|
+
var EMBEDDING_REQUIREMENTS_UNAVAILABLE = "embedding-requirements-unavailable";
|
|
15113
|
+
var EMBEDDING_REQUIREMENTS_FAILED = "embedding-requirements-failed";
|
|
15114
|
+
_enum([
|
|
15115
|
+
EMBEDDING_MODEL_FAILED,
|
|
15116
|
+
EMBEDDING_REQUIREMENTS_UNAVAILABLE,
|
|
15117
|
+
EMBEDDING_REQUIREMENTS_FAILED
|
|
15118
|
+
]);
|
|
15119
|
+
new RegExp(`\\[(${EMBEDDING_MODEL_FAILED}|${EMBEDDING_REQUIREMENTS_UNAVAILABLE}|${EMBEDDING_REQUIREMENTS_FAILED}) model=([^\\s\\]]+) tower=(image|text) node=([^\\s\\]]+)\\]`);
|
|
14951
15120
|
method(object({
|
|
14952
15121
|
crop: _instanceof(Uint8Array),
|
|
14953
15122
|
width: number(),
|
|
14954
15123
|
height: number()
|
|
14955
|
-
}), EmbeddingResultSchema, { auth: "admin" }), method(object({
|
|
15124
|
+
}), EmbeddingResultSchema, { auth: "admin" }), method(object({
|
|
15125
|
+
text: string(),
|
|
15126
|
+
modelId: string().min(1).optional()
|
|
15127
|
+
}), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" }), method(object({ modelId: string().min(1).optional() }), object({
|
|
15128
|
+
cleared: array(string()),
|
|
15129
|
+
nodeId: string()
|
|
15130
|
+
}), {
|
|
15131
|
+
kind: "mutation",
|
|
15132
|
+
auth: "admin"
|
|
15133
|
+
});
|
|
14956
15134
|
/**
|
|
14957
15135
|
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
14958
15136
|
* through, per camera, with the denominator attached. It stores nothing.
|
|
@@ -17603,6 +17781,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
17603
17781
|
"device-battery-normal",
|
|
17604
17782
|
"device-consumable-low",
|
|
17605
17783
|
"device-consumable-normal",
|
|
17784
|
+
"device-tank-low",
|
|
17785
|
+
"device-tank-full",
|
|
17786
|
+
"device-tank-normal",
|
|
17606
17787
|
"stream-online",
|
|
17607
17788
|
"stream-offline",
|
|
17608
17789
|
"node-online",
|
|
@@ -17640,6 +17821,29 @@ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
|
|
|
17640
17821
|
]);
|
|
17641
17822
|
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
|
|
17642
17823
|
/**
|
|
17824
|
+
* The panel's transitions, as ONE list.
|
|
17825
|
+
*
|
|
17826
|
+
* Named here rather than spelled out at each of the four sites that need them
|
|
17827
|
+
* (the emitter, the intake, the editor group, the combined-notification gate),
|
|
17828
|
+
* because a transition added to the enum and forgotten at one of them is an
|
|
17829
|
+
* alarm state nobody can be notified about. That is exactly what this list
|
|
17830
|
+
* failed to prevent while it held three: `alarm-arming` was the fourth.
|
|
17831
|
+
*
|
|
17832
|
+
* In LIFECYCLE order, which is the order an editor lists them in and the order
|
|
17833
|
+
* a person experiences them — not the order they were added.
|
|
17834
|
+
*/
|
|
17835
|
+
var NC_ALARM_SYSTEM_EVENT_KINDS = [
|
|
17836
|
+
"alarm-arm-refused",
|
|
17837
|
+
"alarm-check-failed",
|
|
17838
|
+
"alarm-arming",
|
|
17839
|
+
"alarm-armed",
|
|
17840
|
+
"alarm-pending",
|
|
17841
|
+
"alarm-triggered",
|
|
17842
|
+
"alarm-rearmed",
|
|
17843
|
+
"alarm-sensor-bypass",
|
|
17844
|
+
"alarm-disarmed"
|
|
17845
|
+
];
|
|
17846
|
+
/**
|
|
17643
17847
|
* One coherent system-event condition. `kinds` is the required opt-in safety
|
|
17644
17848
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
17645
17849
|
* selected kinds.
|
|
@@ -17673,7 +17877,22 @@ var NcSystemEventConditionSchema = object({
|
|
|
17673
17877
|
*/
|
|
17674
17878
|
excludeDeviceIds: array(number().int()).min(1).optional(),
|
|
17675
17879
|
nodeIds: array(string().min(1)).min(1).optional(),
|
|
17676
|
-
packageNames: array(string().min(1)).min(1).optional()
|
|
17880
|
+
packageNames: array(string().min(1)).min(1).optional(),
|
|
17881
|
+
/**
|
|
17882
|
+
* At or below this remaining-life %, a consumable is LOW for THIS rule
|
|
17883
|
+
* (D642). Absent = {@link NC_CONSUMABLE_LOW_PERCENT_DEFAULT}; at most
|
|
17884
|
+
* {@link NC_CONSUMABLE_LOW_PERCENT_MAX}, so every episode can recover. Scoped to the
|
|
17885
|
+
* consumable kinds (`systemEventFilterApplies`) and to the device-events
|
|
17886
|
+
* family; ignored on every other kind.
|
|
17887
|
+
*
|
|
17888
|
+
* It is a property of the RULE because the operator decided so: a rule at
|
|
17889
|
+
* 25 must be told about a filter at 20 %, a rule at 10 must not. The hub
|
|
17890
|
+
* keeps one episode per (threshold, device, item) — its own hysteresis, its
|
|
17891
|
+
* own reminder — and a rule hears only the episode judged at ITS threshold,
|
|
17892
|
+
* exactly as an occupancy rule hears only the edge of its own count. A
|
|
17893
|
+
* provider's own `replace` verdict is low at every threshold.
|
|
17894
|
+
*/
|
|
17895
|
+
consumableLowPercent: number().int().min(1).max(95).optional()
|
|
17677
17896
|
});
|
|
17678
17897
|
/** Hard ceiling on a window (24h). A snooze that could not expire would be an
|
|
17679
17898
|
* outage the operator asked for once and forgot. */
|
|
@@ -17691,6 +17910,25 @@ var NcScheduleSchema = object({
|
|
|
17691
17910
|
/** Active OUTSIDE the windows (e.g. "only outside business hours"). */
|
|
17692
17911
|
invert: boolean().optional()
|
|
17693
17912
|
});
|
|
17913
|
+
/**
|
|
17914
|
+
* How a system-event rule of the `device-events` or `system` family speaks
|
|
17915
|
+
* (D647): at once, per event (`instant`, the only behaviour before D647), or
|
|
17916
|
+
* as a STATE SUMMARY at the end of each window of `schedule`.
|
|
17917
|
+
*/
|
|
17918
|
+
var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
|
|
17919
|
+
/**
|
|
17920
|
+
* `summary`: the rule sends NOTHING per event. When a window of `schedule`
|
|
17921
|
+
* CLOSES, it sends one notification with the current state of its kinds
|
|
17922
|
+
* (low batteries, consumables to replace, devices offline, updates
|
|
17923
|
+
* available, ...), after its own filters. Nothing to report sends nothing.
|
|
17924
|
+
* The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
|
|
17925
|
+
* midnight crossing); the send time is each window's END. Refused on the
|
|
17926
|
+
* `alarm` family, which stays instant (`systemEventDeliveryProblems`).
|
|
17927
|
+
*/
|
|
17928
|
+
var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
|
|
17929
|
+
mode: literal("summary"),
|
|
17930
|
+
schedule: NcScheduleSchema
|
|
17931
|
+
})]);
|
|
17694
17932
|
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
17695
17933
|
var NcPlateMatcherSchema = object({
|
|
17696
17934
|
/**
|
|
@@ -18304,7 +18542,12 @@ var NcMediaPolicySchema = object({
|
|
|
18304
18542
|
* the degrade engine, which drops the video and keeps the still.
|
|
18305
18543
|
*/
|
|
18306
18544
|
clip: boolean().optional(),
|
|
18307
|
-
/**
|
|
18545
|
+
/**
|
|
18546
|
+
* Seconds of footage BEFORE / AFTER the event instant. Absent =
|
|
18547
|
+
* {@link NC_CLIP_PRE_ROLL_DEFAULT_SEC} / {@link NC_CLIP_POST_ROLL_DEFAULT_SEC}
|
|
18548
|
+
* (4 / 6), resolved by the Notification Center at dispatch — deliberately not
|
|
18549
|
+
* a Zod default, so a rule that never chose keeps following the hub's.
|
|
18550
|
+
*/
|
|
18308
18551
|
clipPreRollSec: number().int().min(0).max(30).optional(),
|
|
18309
18552
|
clipPostRollSec: number().int().min(0).max(30).optional(),
|
|
18310
18553
|
/**
|
|
@@ -18426,6 +18669,16 @@ var NcRuleInputSchema = object({
|
|
|
18426
18669
|
delivery: NcDeliverySchema,
|
|
18427
18670
|
conditions: NcConditionsSchema.default({}),
|
|
18428
18671
|
schedule: NcScheduleSchema.optional(),
|
|
18672
|
+
/**
|
|
18673
|
+
* A `device-events` / `system` rule's delivery (D647): absent or `instant`
|
|
18674
|
+
* is a notification per event; `summary` is one state summary per closed
|
|
18675
|
+
* window of its schedule. `.optional()` and never defaulted: absent must
|
|
18676
|
+
* keep meaning what every rule authored before D647 meant, with no
|
|
18677
|
+
* migration. Top-level rather than inside `conditions.systemEvent`, so a
|
|
18678
|
+
* client that does not know it (an older viewer re-sending `conditions`
|
|
18679
|
+
* whole) leaves it standing through the store's patch merge.
|
|
18680
|
+
*/
|
|
18681
|
+
systemEventDelivery: NcSystemEventDeliverySchema.optional(),
|
|
18429
18682
|
/** May be empty when `targetUsers` addresses at least one user — the
|
|
18430
18683
|
* "at least one addressee" invariant is enforced by the provider, because
|
|
18431
18684
|
* a cross-field refine here would break `NcRulePatchSchema.partial()`. */
|
|
@@ -18654,6 +18907,28 @@ var NcRuleSchema = NcRuleInputSchema.extend({
|
|
|
18654
18907
|
*/
|
|
18655
18908
|
disabledTargetIds: array(string()).default([])
|
|
18656
18909
|
});
|
|
18910
|
+
/** One section of a previewed state summary. `unavailable` = its state could not be read. */
|
|
18911
|
+
var NcStateSummaryPreviewSectionSchema = object({
|
|
18912
|
+
id: string(),
|
|
18913
|
+
status: _enum(["read", "unavailable"]),
|
|
18914
|
+
items: number().int().nonnegative(),
|
|
18915
|
+
reason: string().optional()
|
|
18916
|
+
});
|
|
18917
|
+
/**
|
|
18918
|
+
* The summary a rule would send now. `empty` = nothing to report and every
|
|
18919
|
+
* section read: such a summary is NOT sent. `dropped` counts the open states
|
|
18920
|
+
* the rule's own filters (or a camera mute) left out, by reason.
|
|
18921
|
+
* `excludedGroups` names the kind groups selected that have no state to report
|
|
18922
|
+
* (backups & exports).
|
|
18923
|
+
*/
|
|
18924
|
+
var NcStateSummaryPreviewSchema = object({
|
|
18925
|
+
empty: boolean(),
|
|
18926
|
+
count: number().int().nonnegative(),
|
|
18927
|
+
text: string(),
|
|
18928
|
+
sections: array(NcStateSummaryPreviewSectionSchema),
|
|
18929
|
+
dropped: record(string(), number().int().nonnegative()),
|
|
18930
|
+
excludedGroups: array(string())
|
|
18931
|
+
});
|
|
18657
18932
|
var NcTestResultSchema = object({
|
|
18658
18933
|
recordId: string(),
|
|
18659
18934
|
recordKind: _enum([
|
|
@@ -18745,6 +19020,13 @@ var NcTemplateVarDescriptorSchema = object({
|
|
|
18745
19020
|
kinds: array(NcTemplateVarKindSchema).optional(),
|
|
18746
19021
|
deliveries: array(NcDeliverySchema).optional(),
|
|
18747
19022
|
systemEventKinds: array(NcSystemEventKindSchema).optional(),
|
|
19023
|
+
/**
|
|
19024
|
+
* Which system-event DELIVERY has a value for it (D647). Absent = an
|
|
19025
|
+
* instant row only when the descriptor names `systemEventKinds` (a
|
|
19026
|
+
* per-event fact: a summary row has no single device), and both otherwise.
|
|
19027
|
+
* `['summary']` marks the state-summary vocabulary (`{{summaryText}}`, ...).
|
|
19028
|
+
*/
|
|
19029
|
+
systemEventDeliveries: array(NcSystemEventDeliveryModeSchema).optional(),
|
|
18748
19030
|
dynamic: object({
|
|
18749
19031
|
prefix: literal("count_"),
|
|
18750
19032
|
from: literal("classes")
|
|
@@ -18757,7 +19039,9 @@ var NcTemplatePreviewInputSchema = object({
|
|
|
18757
19039
|
field: NcTemplateFieldSchema,
|
|
18758
19040
|
kind: NcRuleKindSchema.optional(),
|
|
18759
19041
|
delivery: NcDeliverySchema.optional(),
|
|
18760
|
-
systemEventKinds: array(NcSystemEventKindSchema).optional()
|
|
19042
|
+
systemEventKinds: array(NcSystemEventKindSchema).optional(),
|
|
19043
|
+
/** The rule's system-event delivery (D647); absent = instant. */
|
|
19044
|
+
systemEventDelivery: NcSystemEventDeliveryModeSchema.optional()
|
|
18761
19045
|
}),
|
|
18762
19046
|
template: object({
|
|
18763
19047
|
title: string().max(500).optional(),
|
|
@@ -19291,6 +19575,10 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
19291
19575
|
}), object({ results: array(NcTestResultSchema) }), {
|
|
19292
19576
|
kind: "mutation",
|
|
19293
19577
|
auth: "admin"
|
|
19578
|
+
}), method(object({ rule: NcRuleInputSchema }), NcStateSummaryPreviewSchema, {
|
|
19579
|
+
kind: "mutation",
|
|
19580
|
+
auth: "admin",
|
|
19581
|
+
access: "view"
|
|
19294
19582
|
}), method(object({}), object({
|
|
19295
19583
|
catalog: array(NcConditionDescriptorSchema),
|
|
19296
19584
|
taxonomy: NcTaxonomySchema.optional()
|
|
@@ -19637,758 +19925,282 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
19637
19925
|
});
|
|
19638
19926
|
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
19639
19927
|
/**
|
|
19640
|
-
*
|
|
19641
|
-
*
|
|
19642
|
-
*
|
|
19928
|
+
* A model choice has a SCOPE, and a scope change has a workflow.
|
|
19929
|
+
*
|
|
19930
|
+
* ## The two scopes
|
|
19931
|
+
*
|
|
19932
|
+
* Almost every pipeline step's model is a **node** question: which build runs
|
|
19933
|
+
* fastest on THIS accelerator. Two nodes may legitimately answer differently —
|
|
19934
|
+
* a Coral runs the tflite SSD, a Mac runs the coreml YOLO — because the answers
|
|
19935
|
+
* are compared against nothing. They produce boxes, and a box is a box.
|
|
19936
|
+
*
|
|
19937
|
+
* Two steps are not like that. `face-embedding` and `clip-embedding` produce
|
|
19938
|
+
* **vectors that land in ONE shared index** (`identity_samples`,
|
|
19939
|
+
* `vec_object_clip`) and are ranked against each other by cosine similarity.
|
|
19940
|
+
* Cosine similarity between two encoders is not a weak signal, it is a
|
|
19941
|
+
* meaningless number — and nothing inside a vector can tell you it happened.
|
|
19942
|
+
* So for those two steps the model is a **cluster** question with exactly one
|
|
19943
|
+
* answer, stored in exactly one row.
|
|
19944
|
+
*
|
|
19945
|
+
* That is the same argument [D52](../../../../docs/decisions/adr-0052.md) makes
|
|
19946
|
+
* for the crop convention (`detail-crop.ts`), one level up: the crop decides
|
|
19947
|
+
* WHAT pixels the encoder sees, this decides WHICH encoder sees them. Both are
|
|
19948
|
+
* cluster-wide for the same reason and neither may become per-node.
|
|
19949
|
+
*
|
|
19950
|
+
* ## Why the registry lives here and not in the step catalog
|
|
19951
|
+
*
|
|
19952
|
+
* The scope itself is declared on the step, in
|
|
19953
|
+
* `detection-pipeline/registry/step-definitions.ts` (`StepDefinition.modelScope`)
|
|
19954
|
+
* — that is where a new step declares what kind of choice its model is. But the
|
|
19955
|
+
* catalog lives inside `addon-pipeline`, and three packages that must NOT
|
|
19956
|
+
* import an addon need to know the set: the orchestrator (which renders and
|
|
19957
|
+
* stores the row), post-analysis (which pins the row for a re-embed pass) and
|
|
19958
|
+
* admin-ui (which mirrors it). So the set is mirrored here, and
|
|
19959
|
+
* `scripts/check-cluster-model-scope.ts` fails the build when the two disagree.
|
|
19960
|
+
* A hand-copied key that stops matching is exactly how a setting silently stops
|
|
19961
|
+
* arriving while both sides still look correct.
|
|
19962
|
+
*
|
|
19963
|
+
* ## The defaults ARE today's behaviour
|
|
19964
|
+
*
|
|
19965
|
+
* {@link DEFAULT_CLUSTER_STEP_MODELS} reproduces the catalog `defaultModelId`
|
|
19966
|
+
* of both steps. Declaring the scope therefore changes nothing on the day it
|
|
19967
|
+
* ships: the cluster row starts out saying what every node was already doing.
|
|
19968
|
+
* Changing it is legitimate — that is what the knob is for — but it invalidates
|
|
19969
|
+
* the stored vectors of that surface, and must be followed by a re-embed pass
|
|
19970
|
+
* (`face-reembed-pass.ts`, `embedding-rebuild.ts`).
|
|
19971
|
+
*/
|
|
19972
|
+
/**
|
|
19973
|
+
* Why the orchestrator cannot say which model the operator chose for a
|
|
19974
|
+
* cluster-scoped step (D651).
|
|
19975
|
+
*/
|
|
19976
|
+
var CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS = [
|
|
19977
|
+
"owner-not-ready",
|
|
19978
|
+
"store-read-failed",
|
|
19979
|
+
"three-way-read-unavailable",
|
|
19980
|
+
"invalid-stored",
|
|
19981
|
+
"not-cluster-scoped"
|
|
19982
|
+
];
|
|
19983
|
+
Object.freeze(Object.fromEntries([{
|
|
19984
|
+
stepId: "face-embedding",
|
|
19985
|
+
label: "Face recognition model",
|
|
19986
|
+
defaultModelId: "auraface-r100",
|
|
19987
|
+
indexName: "the enrolled face gallery",
|
|
19988
|
+
options: [
|
|
19989
|
+
{
|
|
19990
|
+
id: "auraface-r100",
|
|
19991
|
+
label: "AuraFace R100"
|
|
19992
|
+
},
|
|
19993
|
+
{
|
|
19994
|
+
id: "arcface-r100",
|
|
19995
|
+
label: "ArcFace (ResNet34)"
|
|
19996
|
+
},
|
|
19997
|
+
{
|
|
19998
|
+
id: "inception-resnet-v1",
|
|
19999
|
+
label: "Inception ResNet V1"
|
|
20000
|
+
}
|
|
20001
|
+
]
|
|
20002
|
+
}, {
|
|
20003
|
+
stepId: "clip-embedding",
|
|
20004
|
+
label: "Semantic search model",
|
|
20005
|
+
defaultModelId: "mobileclip-s1",
|
|
20006
|
+
indexName: "the object semantic-search index",
|
|
20007
|
+
options: [
|
|
20008
|
+
{
|
|
20009
|
+
id: "mobileclip-s1",
|
|
20010
|
+
label: "MobileCLIP S1"
|
|
20011
|
+
},
|
|
20012
|
+
{
|
|
20013
|
+
id: "mobileclip-s2",
|
|
20014
|
+
label: "MobileCLIP S2"
|
|
20015
|
+
},
|
|
20016
|
+
{
|
|
20017
|
+
id: "siglip2-b16-224",
|
|
20018
|
+
label: "SigLIP2 B/16 (Apache-2.0)"
|
|
20019
|
+
}
|
|
20020
|
+
]
|
|
20021
|
+
}].map((s) => [s.stepId, s.defaultModelId])));
|
|
20022
|
+
var CLUSTER_STEP_SETTING_FIELDS = [{
|
|
20023
|
+
stepId: "face-embedding",
|
|
20024
|
+
key: "minLandmarkFaceSize",
|
|
20025
|
+
label: "Min face size for recognition (detection px)",
|
|
20026
|
+
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.",
|
|
20027
|
+
type: "slider",
|
|
20028
|
+
min: 0,
|
|
20029
|
+
max: 64,
|
|
20030
|
+
step: 2,
|
|
20031
|
+
default: 24
|
|
20032
|
+
}];
|
|
20033
|
+
function clusterStepSettingKey(stepId, fieldKey) {
|
|
20034
|
+
return `clusterStepSetting:${stepId}:${fieldKey}`;
|
|
20035
|
+
}
|
|
20036
|
+
var ClusterSettingNumberSchema = number().finite();
|
|
20037
|
+
function readClusterStepSettings(config) {
|
|
20038
|
+
const out = {};
|
|
20039
|
+
for (const field of CLUSTER_STEP_SETTING_FIELDS) {
|
|
20040
|
+
const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
|
|
20041
|
+
const value = parsed.success ? parsed.data : field.default;
|
|
20042
|
+
const existing = out[field.stepId] ?? {};
|
|
20043
|
+
out[field.stepId] = {
|
|
20044
|
+
...existing,
|
|
20045
|
+
[field.key]: value
|
|
20046
|
+
};
|
|
20047
|
+
}
|
|
20048
|
+
return out;
|
|
20049
|
+
}
|
|
20050
|
+
readClusterStepSettings({});
|
|
20051
|
+
/**
|
|
20052
|
+
* pipeline-analytics — device-scoped wrapper cap. Refines raw
|
|
20053
|
+
* per-frame detections emitted by the pipeline runner into tracked
|
|
20054
|
+
* objects, per-kind event collections (motion / object / audio), and
|
|
20055
|
+
* persisted media. Owns the post-detection domain end-to-end:
|
|
20056
|
+
*
|
|
20057
|
+
* runner emits PipelineInferenceResult
|
|
20058
|
+
* ↓ (event bus)
|
|
20059
|
+
* pipeline-analytics subscriber
|
|
20060
|
+
* ↓ SORT tracker + zone engine + state analyzer + event emitter
|
|
20061
|
+
* → three DB collections (one per kind), one FS media tree, one
|
|
20062
|
+
* unified event emitter (FrameTracked + TrackStarted/Ended +
|
|
20063
|
+
* DetectionEvent on bus)
|
|
20064
|
+
*
|
|
20065
|
+
* Pure subscriber model. No `processFrame` cap method — the runner
|
|
20066
|
+
* already publishes the raw frame on the bus. The cap surface is
|
|
20067
|
+
* only QUERIES + per-device settings, bound on/off via
|
|
20068
|
+
* `device-manager.setWrapperActive`. `defaultActive: true` because
|
|
20069
|
+
* every camera with a detection pipeline wants its raw detections
|
|
20070
|
+
* refined; operators opt out per-device via BindingsTab when needed.
|
|
20071
|
+
*
|
|
20072
|
+
* Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
|
|
20073
|
+
* (per-device surface) and `track-trail` caps — see P11 cleanup.
|
|
19643
20074
|
*/
|
|
19644
|
-
var
|
|
19645
|
-
|
|
19646
|
-
|
|
19647
|
-
|
|
19648
|
-
|
|
19649
|
-
|
|
19650
|
-
|
|
19651
|
-
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
crop: object({
|
|
19657
|
-
left: number(),
|
|
19658
|
-
top: number(),
|
|
19659
|
-
width: number().positive(),
|
|
19660
|
-
height: number().positive()
|
|
19661
|
-
}).optional(),
|
|
19662
|
-
content: object({
|
|
19663
|
-
width: number().int().positive(),
|
|
19664
|
-
height: number().int().positive()
|
|
19665
|
-
}),
|
|
19666
|
-
fit: _enum(["stretch", "contain"]),
|
|
19667
|
-
format: _enum([
|
|
19668
|
-
"rgb",
|
|
19669
|
-
"gray",
|
|
19670
|
-
"jpeg"
|
|
19671
|
-
])
|
|
19672
|
-
});
|
|
20075
|
+
var TrackStateSchema = _enum([
|
|
20076
|
+
"new",
|
|
20077
|
+
"entered",
|
|
20078
|
+
"left",
|
|
20079
|
+
"moving",
|
|
20080
|
+
"idle"
|
|
20081
|
+
]);
|
|
20082
|
+
var EventKindSchema = _enum([
|
|
20083
|
+
"motion",
|
|
20084
|
+
"object",
|
|
20085
|
+
"audio"
|
|
20086
|
+
]);
|
|
19673
20087
|
/**
|
|
19674
|
-
*
|
|
19675
|
-
*
|
|
19676
|
-
*
|
|
20088
|
+
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
20089
|
+
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
20090
|
+
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
19677
20091
|
*/
|
|
19678
|
-
var
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19685
|
-
|
|
19686
|
-
|
|
19687
|
-
|
|
19688
|
-
"
|
|
19689
|
-
"
|
|
19690
|
-
"
|
|
19691
|
-
"
|
|
19692
|
-
"
|
|
19693
|
-
"gguf"
|
|
20092
|
+
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
20093
|
+
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
20094
|
+
var EventKindIconSchema = _enum([
|
|
20095
|
+
"motion",
|
|
20096
|
+
"audio",
|
|
20097
|
+
"person",
|
|
20098
|
+
"vehicle",
|
|
20099
|
+
"animal",
|
|
20100
|
+
"door",
|
|
20101
|
+
"pir",
|
|
20102
|
+
"smoke",
|
|
20103
|
+
"water",
|
|
20104
|
+
"button",
|
|
20105
|
+
"package",
|
|
20106
|
+
"generic"
|
|
19694
20107
|
]);
|
|
19695
|
-
var
|
|
19696
|
-
"
|
|
19697
|
-
"
|
|
19698
|
-
"
|
|
19699
|
-
"
|
|
19700
|
-
"
|
|
20108
|
+
var EventKindCategorySchema = _enum([
|
|
20109
|
+
"motion",
|
|
20110
|
+
"audio",
|
|
20111
|
+
"detection",
|
|
20112
|
+
"sensor",
|
|
20113
|
+
"control",
|
|
20114
|
+
"custom",
|
|
20115
|
+
"package"
|
|
19701
20116
|
]);
|
|
19702
|
-
|
|
19703
|
-
|
|
19704
|
-
|
|
19705
|
-
|
|
19706
|
-
|
|
19707
|
-
|
|
19708
|
-
|
|
19709
|
-
|
|
19710
|
-
devices: array(object({
|
|
19711
|
-
id: string(),
|
|
19712
|
-
label: string(),
|
|
19713
|
-
description: string().optional()
|
|
19714
|
-
})).readonly(),
|
|
19715
|
-
defaultDevice: string()
|
|
19716
|
-
});
|
|
19717
|
-
var PipelineDefaultStepSchema = lazy(() => object({
|
|
19718
|
-
addonId: string(),
|
|
19719
|
-
addonName: string(),
|
|
19720
|
-
slot: PipelineSlotSchema,
|
|
19721
|
-
inputClasses: array(string()).readonly(),
|
|
19722
|
-
outputClasses: array(string()).readonly(),
|
|
19723
|
-
enabled: boolean(),
|
|
19724
|
-
modelId: string(),
|
|
19725
|
-
children: array(PipelineDefaultStepSchema).readonly(),
|
|
19726
|
-
group: string().optional(),
|
|
19727
|
-
settings: record(string(), unknown()).optional()
|
|
19728
|
-
}));
|
|
19729
|
-
var PipelineTemplateStepSchema = lazy(() => object({
|
|
19730
|
-
addonId: string(),
|
|
19731
|
-
enabled: boolean(),
|
|
19732
|
-
modelId: string(),
|
|
19733
|
-
children: array(PipelineTemplateStepSchema).readonly(),
|
|
19734
|
-
settings: record(string(), unknown()).optional()
|
|
19735
|
-
}));
|
|
19736
|
-
var PipelineTemplateSchema$1 = object({
|
|
19737
|
-
id: string(),
|
|
19738
|
-
name: string(),
|
|
19739
|
-
createdAt: string(),
|
|
19740
|
-
updatedAt: string(),
|
|
19741
|
-
engine: PipelineEngineChoiceSchema,
|
|
19742
|
-
steps: array(PipelineTemplateStepSchema).readonly()
|
|
19743
|
-
});
|
|
19744
|
-
var PipelineModelOptionSchema = object({
|
|
19745
|
-
id: string(),
|
|
19746
|
-
name: string(),
|
|
19747
|
-
formats: record(string(), object({
|
|
19748
|
-
downloaded: boolean(),
|
|
19749
|
-
sizeMB: number()
|
|
19750
|
-
})),
|
|
19751
|
-
group: ModelVariantGroupSchema.optional(),
|
|
19752
|
-
legacy: boolean().optional(),
|
|
19753
|
-
provider: ModelProviderIdSchema.optional()
|
|
19754
|
-
});
|
|
19755
|
-
var ConfigFieldBridge = custom();
|
|
19756
|
-
var PipelineAddonSchemaSchema = object({
|
|
19757
|
-
id: string(),
|
|
19758
|
-
name: string(),
|
|
19759
|
-
slot: PipelineSlotSchema,
|
|
19760
|
-
inputClasses: array(string()).readonly(),
|
|
19761
|
-
outputClasses: array(string()).readonly(),
|
|
19762
|
-
childSlots: array(PipelineSlotSchema).readonly(),
|
|
19763
|
-
models: array(PipelineModelOptionSchema).readonly(),
|
|
19764
|
-
defaultModelId: string(),
|
|
19765
|
-
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
19766
|
-
enabledByDefault: boolean().optional(),
|
|
19767
|
-
backfillIntoExistingOverrides: boolean().optional(),
|
|
19768
|
-
defaultConfidence: number(),
|
|
19769
|
-
group: string().optional(),
|
|
19770
|
-
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
19771
|
-
});
|
|
19772
|
-
var PipelineSlotSchemaSchema = object({
|
|
19773
|
-
id: PipelineSlotSchema,
|
|
20117
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
20118
|
+
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
20119
|
+
var EventKindDescriptorSchema = object({
|
|
20120
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
20121
|
+
kind: string(),
|
|
20122
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
20123
|
+
labelKey: string(),
|
|
20124
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
19774
20125
|
label: string(),
|
|
19775
|
-
|
|
19776
|
-
|
|
19777
|
-
|
|
19778
|
-
|
|
19779
|
-
|
|
19780
|
-
|
|
19781
|
-
|
|
19782
|
-
|
|
19783
|
-
|
|
19784
|
-
|
|
19785
|
-
|
|
19786
|
-
|
|
19787
|
-
|
|
19788
|
-
|
|
19789
|
-
|
|
19790
|
-
|
|
19791
|
-
|
|
19792
|
-
state: _enum([
|
|
19793
|
-
"idle",
|
|
19794
|
-
"installing",
|
|
19795
|
-
"verifying",
|
|
19796
|
-
"ready",
|
|
19797
|
-
"failed"
|
|
19798
|
-
]),
|
|
19799
|
-
progress: number().optional(),
|
|
19800
|
-
error: string().optional(),
|
|
19801
|
-
nextRetryAt: number().optional(),
|
|
19802
|
-
/**
|
|
19803
|
-
* Gate A (config-correctness gate at engine change): human-readable
|
|
19804
|
-
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
19805
|
-
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
19806
|
-
* has a <format> build"). Additive/optional: informational only, never
|
|
19807
|
-
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
19808
|
-
* Absent/empty when the node-default tree resolves cleanly.
|
|
19809
|
-
*/
|
|
19810
|
-
configIssues: array(string()).optional()
|
|
19811
|
-
});
|
|
19812
|
-
var PipelineStepInputSchema = lazy(() => object({
|
|
19813
|
-
addonId: string(),
|
|
19814
|
-
modelId: string().optional(),
|
|
19815
|
-
enabled: boolean().default(true),
|
|
19816
|
-
children: array(PipelineStepInputSchema).optional(),
|
|
19817
|
-
settings: record(string(), unknown()).optional(),
|
|
19818
|
-
jumpDeviceKey: string().optional()
|
|
19819
|
-
}));
|
|
19820
|
-
var ModelSubstitutionSchema = object({
|
|
19821
|
-
addonId: string(),
|
|
19822
|
-
chosen: string(),
|
|
19823
|
-
running: string(),
|
|
19824
|
-
format: string()
|
|
19825
|
-
});
|
|
19826
|
-
var PipelineValidationIssueSchema = object({
|
|
19827
|
-
addonId: string(),
|
|
19828
|
-
kind: _enum(["unknown-addon", "no-format-build"]),
|
|
19829
|
-
detail: string()
|
|
19830
|
-
});
|
|
19831
|
-
var PipelineValidationResultSchema = object({
|
|
19832
|
-
ok: boolean(),
|
|
19833
|
-
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
19834
|
-
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
19835
|
-
/** The node's `currentEngine.format` this validation ran against. */
|
|
19836
|
-
format: string()
|
|
19837
|
-
});
|
|
19838
|
-
var ReferenceImageEntrySchema = object({
|
|
19839
|
-
filename: string(),
|
|
19840
|
-
stepIds: array(string()).readonly().optional()
|
|
19841
|
-
});
|
|
19842
|
-
var ReferenceImageBodySchema = object({
|
|
19843
|
-
base64: string(),
|
|
19844
|
-
filename: string()
|
|
20126
|
+
/** Hex color for timeline/legend rendering. */
|
|
20127
|
+
color: string(),
|
|
20128
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
20129
|
+
iconId: string(),
|
|
20130
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
20131
|
+
icon: EventKindIconSchema,
|
|
20132
|
+
category: EventKindCategorySchema,
|
|
20133
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
20134
|
+
parentKind: string().nullable(),
|
|
20135
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
20136
|
+
level: EventKindLevelSchema,
|
|
20137
|
+
/** Which cap + device contributes this kind. For built-ins the camera
|
|
20138
|
+
* itself; for sensor kinds the LINKED source device. */
|
|
20139
|
+
source: object({
|
|
20140
|
+
capName: string(),
|
|
20141
|
+
deviceId: number()
|
|
20142
|
+
})
|
|
19845
20143
|
});
|
|
19846
|
-
|
|
19847
|
-
|
|
19848
|
-
|
|
20144
|
+
/** One camera's event vocabulary, as returned by `listEventKindsBatch`. */
|
|
20145
|
+
var EventKindsForDeviceSchema = object({
|
|
20146
|
+
deviceId: number(),
|
|
20147
|
+
kinds: array(EventKindDescriptorSchema).readonly()
|
|
19849
20148
|
});
|
|
19850
|
-
var
|
|
19851
|
-
var AudioBackendSchema = object({
|
|
20149
|
+
var SensorEventSchema = object({
|
|
19852
20150
|
id: string(),
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
20151
|
+
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
20152
|
+
* yields N rows, one per camera). */
|
|
20153
|
+
deviceId: number(),
|
|
20154
|
+
/** The linked sensor device whose state changed. */
|
|
20155
|
+
sourceDeviceId: number(),
|
|
20156
|
+
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
20157
|
+
kind: string(),
|
|
20158
|
+
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
20159
|
+
value: record(string(), unknown()).nullable(),
|
|
20160
|
+
timestamp: number()
|
|
20161
|
+
});
|
|
20162
|
+
/**
|
|
20163
|
+
* One stored sighting on a track's trajectory.
|
|
20164
|
+
*
|
|
20165
|
+
* The array these live in is returned in TIME order (D399) — it is APPENDED in
|
|
20166
|
+
* arrival order, and the two detector passes interleave, so a consumer must not
|
|
20167
|
+
* assume the two are the same on a row written by an older build.
|
|
20168
|
+
*/
|
|
20169
|
+
var TrackPositionSchema = object({
|
|
20170
|
+
x: number(),
|
|
20171
|
+
y: number(),
|
|
20172
|
+
timestamp: number(),
|
|
20173
|
+
bbox: BoundingBoxSchema,
|
|
19856
20174
|
/**
|
|
19857
|
-
*
|
|
19858
|
-
*
|
|
19859
|
-
*
|
|
19860
|
-
*
|
|
20175
|
+
* Which detector pass measured this box (D399): `frame` is the full-frame
|
|
20176
|
+
* pass on the analysis raster, `recovery` is the native-resolution
|
|
20177
|
+
* small-subject second pass (D377/D378). Both write into one array, and until
|
|
20178
|
+
* this field existed the only way to tell them apart was that full-frame boxes
|
|
20179
|
+
* are exact multiples of 1.2 while recovery boxes are full-precision floats.
|
|
20180
|
+
* Absent on rows written before D399.
|
|
19861
20181
|
*/
|
|
19862
|
-
|
|
20182
|
+
source: _enum(["frame", "recovery"]).optional(),
|
|
20183
|
+
/** Detection score of this box, so a position can be weighed and not only
|
|
20184
|
+
* plotted. Absent on rows written before D399. */
|
|
20185
|
+
score: number().optional()
|
|
19863
20186
|
});
|
|
19864
|
-
var
|
|
19865
|
-
|
|
19866
|
-
|
|
19867
|
-
|
|
19868
|
-
|
|
20187
|
+
var TrackSnapshotSchema = object({
|
|
20188
|
+
timestamp: number(),
|
|
20189
|
+
position: TrackPositionSchema,
|
|
20190
|
+
/** The snapshot's media row id (D482); resolve via `listTrackMedia({ trackId })`. */
|
|
20191
|
+
mediaId: number().int()
|
|
19869
20192
|
});
|
|
19870
|
-
|
|
19871
|
-
|
|
19872
|
-
|
|
19873
|
-
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
|
|
19880
|
-
|
|
19881
|
-
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
19882
|
-
* benchmark UI can still report a clean failure when the classifier
|
|
19883
|
-
* cap isn't available.
|
|
19884
|
-
*/
|
|
19885
|
-
var AudioTestResultSchema = object({
|
|
19886
|
-
success: boolean(),
|
|
19887
|
-
error: string().optional(),
|
|
19888
|
-
frame: custom().optional()
|
|
19889
|
-
});
|
|
19890
|
-
var PipelineConfigBridge = custom();
|
|
19891
|
-
var ConfigUISchemaBridge = custom();
|
|
19892
|
-
var ConfigUISchemaNullableBridge = custom();
|
|
19893
|
-
var InferenceCapabilitiesBridge = custom();
|
|
19894
|
-
var ModelAvailabilityListBridge = custom();
|
|
19895
|
-
var PipelineRunResultBridge = custom();
|
|
19896
|
-
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
19897
|
-
modelId: string(),
|
|
19898
|
-
settings: record(string(), unknown()).readonly()
|
|
19899
|
-
}))), method(object({ steps: record(string(), object({
|
|
19900
|
-
modelId: string(),
|
|
19901
|
-
settings: record(string(), unknown()).readonly()
|
|
19902
|
-
})) }), object({ success: literal(true) }), {
|
|
19903
|
-
kind: "mutation",
|
|
19904
|
-
auth: "admin"
|
|
19905
|
-
}), method(object({ nodeId: string() }), object({
|
|
19906
|
-
success: literal(true),
|
|
19907
|
-
clearedDevices: number()
|
|
19908
|
-
}), {
|
|
19909
|
-
kind: "mutation",
|
|
19910
|
-
auth: "admin"
|
|
19911
|
-
}), method(object({ nodeId: string() }), object({ unhealthy: array(object({
|
|
19912
|
-
/** `<backend>:<device>`, e.g. `openvino:gpu`. */
|
|
19913
|
-
deviceKey: string(),
|
|
19914
|
-
/**
|
|
19915
|
-
* `failed` — the per-device restart budget is exhausted; no pool
|
|
19916
|
-
* will be spawned until an operator re-arms it or the runner
|
|
19917
|
-
* respawns. `backoff` — under budget, waiting out the backoff (or
|
|
19918
|
-
* a cached pool observed dead and not yet condemned).
|
|
19919
|
-
*/
|
|
19920
|
-
state: _enum(["failed", "backoff"]),
|
|
19921
|
-
/** Epoch ms of the death that produced this state. */
|
|
19922
|
-
since: number(),
|
|
19923
|
-
/** Pool deaths inside the current window. */
|
|
19924
|
-
deaths: number(),
|
|
19925
|
-
/** The last death's message. */
|
|
19926
|
-
lastError: string()
|
|
19927
|
-
})).readonly() })), method(object({
|
|
19928
|
-
nodeId: string(),
|
|
19929
|
-
deviceKey: string()
|
|
19930
|
-
}), object({ rearmed: boolean() }), {
|
|
19931
|
-
kind: "mutation",
|
|
19932
|
-
auth: "admin"
|
|
19933
|
-
}), 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({
|
|
19934
|
-
name: string(),
|
|
19935
|
-
steps: array(PipelineTemplateStepSchema).readonly(),
|
|
19936
|
-
engine: PipelineEngineChoiceSchema
|
|
19937
|
-
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
|
|
19938
|
-
id: string(),
|
|
19939
|
-
name: string().optional(),
|
|
19940
|
-
steps: array(PipelineTemplateStepSchema).readonly().optional()
|
|
19941
|
-
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
|
|
19942
|
-
addonId: string(),
|
|
19943
|
-
modelId: string(),
|
|
19944
|
-
format: ModelFormatSchema$1
|
|
19945
|
-
}), DownloadModelResultSchema, { kind: "mutation" }), method(object({
|
|
19946
|
-
addonId: string(),
|
|
19947
|
-
modelId: string(),
|
|
19948
|
-
format: ModelFormatSchema$1
|
|
19949
|
-
}), object({ success: literal(true) }), { kind: "mutation" }), method(object({
|
|
19950
|
-
engine: PipelineEngineChoiceSchema.optional(),
|
|
19951
|
-
steps: array(PipelineStepInputSchema).min(1),
|
|
19952
|
-
frame: FrameInputSchema.optional(),
|
|
19953
|
-
/**
|
|
19954
|
-
* Process-local lazy frame. Valid only when caller and provider resolve
|
|
19955
|
-
* in the same execution-group process; split/cross-node callers use
|
|
19956
|
-
* `frame`/`image` inline compatibility instead.
|
|
19957
|
-
*/
|
|
19958
|
-
frameRef: FrameRefSchema.optional(),
|
|
19959
|
-
/**
|
|
19960
|
-
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
19961
|
-
* the decoded pixels live in. One more member of the one-of
|
|
19962
|
-
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
19963
|
-
*/
|
|
19964
|
-
frameHandle: FrameHandleSchema.optional(),
|
|
19965
|
-
imageBase64: string().optional(),
|
|
19966
|
-
/**
|
|
19967
|
-
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
19968
|
-
* hops (hub → forked worker via Moleculer MsgPack) because it
|
|
19969
|
-
* skips the 33% base64 overhead + the per-call base64 decode on
|
|
19970
|
-
* the detection-pipeline worker. Callers can pass either; exactly
|
|
19971
|
-
* one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
|
|
19972
|
-
*/
|
|
19973
|
-
image: _instanceof(Uint8Array).optional(),
|
|
19974
|
-
referenceImage: string().optional(),
|
|
19975
|
-
deviceId: number().optional(),
|
|
19976
|
-
sessionId: string().optional(),
|
|
19977
|
-
/**
|
|
19978
|
-
* Execution plane. 'full' (default) runs the whole tree — benchmark,
|
|
19979
|
-
* reference-image, and detail-subtree calls. 'frame' is the live
|
|
19980
|
-
* per-frame dispatch: ONLY root-plane steps run; crop children
|
|
19981
|
-
* (inputClasses ≠ null) are skipped and served per-track via
|
|
19982
|
-
* pipelineRunner.runDetailSubtree (two-plane design).
|
|
19983
|
-
*/
|
|
19984
|
-
plane: _enum(["full", "frame"]).optional(),
|
|
19985
|
-
/**
|
|
19986
|
-
* Inference-device selector (Phase 2 multi-device). Format
|
|
19987
|
-
* `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
|
|
19988
|
-
* Omitted ⇒ the runner's default device (current single-engine
|
|
19989
|
-
* behaviour). Selects WHICH device pool of the node runs the call.
|
|
19990
|
-
*/
|
|
19991
|
-
deviceKey: string().optional(),
|
|
19992
|
-
/**
|
|
19993
|
-
* Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
|
|
19994
|
-
* when the parent crop was resolved from the frame's retained NATIVE
|
|
19995
|
-
* surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
|
|
19996
|
-
* child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
|
|
19997
|
-
* resolution from that surface — the SAME quality path faces already
|
|
19998
|
-
* had — instead of the downscaled parent tile. `handle` keys the native
|
|
19999
|
-
* surface (node-pinned to its owner); `cropFrameSpace` is the parent
|
|
20000
|
-
* crop's padded/clamped rectangle in FRAME-space pixels, used to compose
|
|
20001
|
-
* the executor's crop-normalized child ROI back into frame-normalized
|
|
20002
|
-
* coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
|
|
20003
|
-
* of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
|
|
20004
|
-
* (today's behaviour on the fallback path).
|
|
20005
|
-
*/
|
|
20006
|
-
nativeCropRef: NativeCropRefSchema.optional()
|
|
20007
|
-
}), PipelineRunResultBridge, { kind: "mutation" }), method(object({
|
|
20008
|
-
engine: PipelineEngineChoiceSchema.optional(),
|
|
20009
|
-
steps: array(PipelineStepInputSchema).min(1),
|
|
20010
|
-
frames: array(FrameInputSchema).min(1).max(255),
|
|
20011
|
-
deviceId: number().optional(),
|
|
20012
|
-
sessionId: string().optional(),
|
|
20013
|
-
/**
|
|
20014
|
-
* Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
|
|
20015
|
-
* the batch to the Python pool's bench preprocess cache
|
|
20016
|
-
* (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
|
|
20017
|
-
* preprocessed ONCE and every later inference is a pure-inference cache
|
|
20018
|
-
* hit — the sustained-throughput run measures inference, not
|
|
20019
|
-
* decode+preprocess+infer. Omitted/0 for live frames (all different →
|
|
20020
|
-
* full preprocess every call, correct). Fresh per sustained run;
|
|
20021
|
-
* released via `uncacheFrame`.
|
|
20022
|
-
*/
|
|
20023
|
-
frameId: number().int().nonnegative().optional(),
|
|
20024
|
-
/** Inference-device selector (Phase 2 multi-device); see runPipeline. */
|
|
20025
|
-
deviceKey: string().optional()
|
|
20026
|
-
}), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
|
|
20027
|
-
data: _instanceof(Uint8Array),
|
|
20028
|
-
width: number().int().positive(),
|
|
20029
|
-
height: number().int().positive(),
|
|
20030
|
-
format: _enum([
|
|
20031
|
-
"rgb",
|
|
20032
|
-
"bgr",
|
|
20033
|
-
"gray"
|
|
20034
|
-
])
|
|
20035
|
-
}), object({
|
|
20036
|
-
frameId: number(),
|
|
20037
|
-
width: number(),
|
|
20038
|
-
height: number()
|
|
20039
|
-
}), { kind: "mutation" }), method(object({
|
|
20040
|
-
stepId: string(),
|
|
20041
|
-
frameId: number().int()
|
|
20042
|
-
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(_void(), object({
|
|
20043
|
-
batchMode: string(),
|
|
20044
|
-
windowMs: number(),
|
|
20045
|
-
maxBatchSize: number(),
|
|
20046
|
-
concurrency: number()
|
|
20047
|
-
})), method(_void(), array(object({
|
|
20048
|
-
engineKey: string(),
|
|
20049
|
-
engine: PipelineEngineChoiceSchema,
|
|
20050
|
-
modelsLoaded: array(string()).readonly(),
|
|
20051
|
-
inUseByCameras: array(number()).readonly(),
|
|
20052
|
-
/**
|
|
20053
|
-
* Origin of this resident factory.
|
|
20054
|
-
* - `runtime` — main camera-serving engine (no idle TTL).
|
|
20055
|
-
* - `warm-override` — benchmark/test override held in the warm
|
|
20056
|
-
* cache; auto-disposed after the idle TTL.
|
|
20057
|
-
* - `device-pool` — a concurrent per-device pool (Phase 2
|
|
20058
|
-
* multi-device, keyed by `deviceKey`) resolved
|
|
20059
|
-
* via `resolveDeviceFactory`. Runs alongside the
|
|
20060
|
-
* `runtime` engine on a DIFFERENT accelerator
|
|
20061
|
-
* (NPU / iGPU / Coral) — this is how the
|
|
20062
|
-
* Engines tab shows all pools running at once.
|
|
20063
|
-
*/
|
|
20064
|
-
kind: _enum([
|
|
20065
|
-
"runtime",
|
|
20066
|
-
"warm-override",
|
|
20067
|
-
"device-pool"
|
|
20068
|
-
]),
|
|
20069
|
-
/** Native pid of the underlying Python pool (null when no pool). */
|
|
20070
|
-
poolPid: number().nullable(),
|
|
20071
|
-
/** ms since this factory was last used (null when not warm-tracked). */
|
|
20072
|
-
idleMs: number().nullable(),
|
|
20073
|
-
/** Idle TTL after which `warm-override` factories self-evict (null when not applicable). */
|
|
20074
|
-
idleTtlMs: number().nullable()
|
|
20075
|
-
})).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
|
|
20076
|
-
kind: "mutation",
|
|
20077
|
-
auth: "admin"
|
|
20078
|
-
}), method(object({
|
|
20079
|
-
engine: PipelineEngineChoiceSchema,
|
|
20080
|
-
force: boolean().optional()
|
|
20081
|
-
}), object({
|
|
20082
|
-
success: boolean(),
|
|
20083
|
-
reason: string().optional()
|
|
20084
|
-
}), {
|
|
20085
|
-
kind: "mutation",
|
|
20086
|
-
auth: "admin"
|
|
20087
|
-
}), 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({
|
|
20088
|
-
addonId: string(),
|
|
20089
|
-
modelId: string(),
|
|
20090
|
-
filename: string().optional(),
|
|
20091
|
-
settings: record(string(), unknown()).optional()
|
|
20092
|
-
}), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
|
|
20093
|
-
/**
|
|
20094
|
-
* Per-stage gating mode applied to the zones a rule references.
|
|
20095
|
-
*
|
|
20096
|
-
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
20097
|
-
* When at least one `include` rule fires for a stage, only entities
|
|
20098
|
-
* inside one of those zones pass that stage.
|
|
20099
|
-
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
20100
|
-
* Entities inside one of those zones are dropped at that stage.
|
|
20101
|
-
*
|
|
20102
|
-
* `monitor`-style observation (count without filtering) is not a rule
|
|
20103
|
-
* mode — zones without any matching rule are observed naturally by
|
|
20104
|
-
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
20105
|
-
* count, not filter" use case needs no rule at all.
|
|
20106
|
-
*/
|
|
20107
|
-
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
20108
|
-
/**
|
|
20109
|
-
* Per-consumer rule that references existing zones (geometry) and
|
|
20110
|
-
* defines how a specific pipeline stage should treat them. Each
|
|
20111
|
-
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
20112
|
-
* settings:
|
|
20113
|
-
*
|
|
20114
|
-
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
20115
|
-
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
20116
|
-
* - future: notification rules, audio gating, etc.
|
|
20117
|
-
*
|
|
20118
|
-
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
20119
|
-
* express "ignore motion in ALL of {garden, street}" with a single
|
|
20120
|
-
* rule. `classFilter` narrows the rule to specific object classes —
|
|
20121
|
-
* "drop person detections in the street, but keep cars" is one
|
|
20122
|
-
* `exclude` rule with `classFilter: ['person']`.
|
|
20123
|
-
*
|
|
20124
|
-
* `enabled` is a soft toggle — the operator can keep the rule
|
|
20125
|
-
* configured but inert without deleting it.
|
|
20126
|
-
*/
|
|
20127
|
-
var ZoneRuleSchema = object({
|
|
20128
|
-
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
20129
|
-
id: string(),
|
|
20130
|
-
/** Optional human-readable label rendered in the rule editor. */
|
|
20131
|
-
name: string().optional(),
|
|
20132
|
-
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
20133
|
-
* listed zones (OR-set: a detection in any one of them counts).
|
|
20134
|
-
* At least one zone id required — a rule with no targets is a
|
|
20135
|
-
* configuration mistake and the form validator rejects it. */
|
|
20136
|
-
zoneIds: array(string()).min(1).readonly(),
|
|
20137
|
-
mode: ZoneRuleModeEnum,
|
|
20138
|
-
/**
|
|
20139
|
-
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
20140
|
-
* applies to every class. Class strings match the `macroClass`
|
|
20141
|
-
* field on detections (e.g. `person`, `car`, `dog`).
|
|
20142
|
-
*/
|
|
20143
|
-
classFilter: array(string()).readonly().optional(),
|
|
20144
|
-
/**
|
|
20145
|
-
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
20146
|
-
* required to consider an entity "in the zone". Defaults to the
|
|
20147
|
-
* consumer's stage default when omitted. Kept for back-compat with
|
|
20148
|
-
* existing per-rule overrides; new operators pick the value via
|
|
20149
|
-
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
20150
|
-
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
20151
|
-
*/
|
|
20152
|
-
overlapThreshold: number().min(0).max(1).optional(),
|
|
20153
|
-
/**
|
|
20154
|
-
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
20155
|
-
* of the detection's bbox that must lie inside the zone for the
|
|
20156
|
-
* rule to match. Documented default is 85%; the engine substitutes
|
|
20157
|
-
* that when the field is omitted (kept optional so existing rules
|
|
20158
|
-
* stored without it stay valid).
|
|
20159
|
-
*
|
|
20160
|
-
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
20161
|
-
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
20162
|
-
* field exposed in the UI. Internally both feed the same gate.
|
|
20163
|
-
*/
|
|
20164
|
-
bboxInclusionPct: number().min(0).max(100).optional(),
|
|
20165
|
-
/**
|
|
20166
|
-
* When `true` and a detection has a segmentation mask, use the
|
|
20167
|
-
* mask for overlap instead of the bbox. Detection-stage only;
|
|
20168
|
-
* motion rules ignore this field.
|
|
20169
|
-
*/
|
|
20170
|
-
preferMask: boolean().optional(),
|
|
20171
|
-
/**
|
|
20172
|
-
* Soft-toggle: `false` disables the rule without deleting it.
|
|
20173
|
-
* Defaults to `true` so operators creating a rule via the UI
|
|
20174
|
-
* see it active immediately.
|
|
20175
|
-
*/
|
|
20176
|
-
enabled: boolean().default(true)
|
|
20177
|
-
});
|
|
20178
|
-
array(ZoneRuleSchema).readonly();
|
|
20179
|
-
/**
|
|
20180
|
-
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
20181
|
-
*
|
|
20182
|
-
* Zones describe **where** in the frame the operator wants to flag
|
|
20183
|
-
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
20184
|
-
* each pipeline stage uses them. Splitting the two means a single
|
|
20185
|
-
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
20186
|
-
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
20187
|
-
* — without three duplicated polygons.
|
|
20188
|
-
*
|
|
20189
|
-
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
20190
|
-
* `zones` device-state slice on every mutation. Consumers
|
|
20191
|
-
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
20192
|
-
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
20193
|
-
* mirror with `onChanged`).
|
|
20194
|
-
*
|
|
20195
|
-
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
20196
|
-
* survive resolution changes and stream profile switches.
|
|
20197
|
-
*
|
|
20198
|
-
* `kind` discriminates between full polygons (closed regions used
|
|
20199
|
-
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
20200
|
-
* line segments used for cross events). Onboard / firmware-reported
|
|
20201
|
-
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
20202
|
-
* task list.
|
|
20203
|
-
*/
|
|
20204
|
-
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
20205
|
-
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
20206
|
-
var PolygonPointSchema = object({
|
|
20207
|
-
x: number(),
|
|
20208
|
-
y: number()
|
|
20209
|
-
});
|
|
20210
|
-
/** A camera detection zone — pure geometry/identity. */
|
|
20211
|
-
var ZoneSchema = object({
|
|
20212
|
-
id: string(),
|
|
20213
|
-
name: string(),
|
|
20214
|
-
kind: ZoneKindEnum.default("polygon"),
|
|
20215
|
-
/** Polygon vertices, fraction of frame (0–1). */
|
|
20216
|
-
polygon: array(PolygonPointSchema).readonly(),
|
|
20217
|
-
/** Visual color for UI rendering. */
|
|
20218
|
-
color: string().default("#3b82f6")
|
|
20219
|
-
});
|
|
20220
|
-
DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).readonly()), method(object({
|
|
20221
|
-
deviceId: number(),
|
|
20222
|
-
zone: ZoneSchema
|
|
20223
|
-
}), _void(), {
|
|
20224
|
-
kind: "mutation",
|
|
20225
|
-
auth: "admin"
|
|
20226
|
-
}), method(object({
|
|
20227
|
-
deviceId: number(),
|
|
20228
|
-
zoneId: string()
|
|
20229
|
-
}), _void(), {
|
|
20230
|
-
kind: "mutation",
|
|
20231
|
-
auth: "admin"
|
|
20232
|
-
}), method(object({
|
|
20233
|
-
deviceId: number(),
|
|
20234
|
-
zone: ZoneSchema
|
|
20235
|
-
}), _void(), {
|
|
20236
|
-
kind: "mutation",
|
|
20237
|
-
auth: "admin"
|
|
20238
|
-
}), object({ zones: array(ZoneSchema).readonly() });
|
|
20239
|
-
/**
|
|
20240
|
-
* pipeline-analytics — device-scoped wrapper cap. Refines raw
|
|
20241
|
-
* per-frame detections emitted by the pipeline runner into tracked
|
|
20242
|
-
* objects, per-kind event collections (motion / object / audio), and
|
|
20243
|
-
* persisted media. Owns the post-detection domain end-to-end:
|
|
20244
|
-
*
|
|
20245
|
-
* runner emits PipelineInferenceResult
|
|
20246
|
-
* ↓ (event bus)
|
|
20247
|
-
* pipeline-analytics subscriber
|
|
20248
|
-
* ↓ SORT tracker + zone engine + state analyzer + event emitter
|
|
20249
|
-
* → three DB collections (one per kind), one FS media tree, one
|
|
20250
|
-
* unified event emitter (FrameTracked + TrackStarted/Ended +
|
|
20251
|
-
* DetectionEvent on bus)
|
|
20252
|
-
*
|
|
20253
|
-
* Pure subscriber model. No `processFrame` cap method — the runner
|
|
20254
|
-
* already publishes the raw frame on the bus. The cap surface is
|
|
20255
|
-
* only QUERIES + per-device settings, bound on/off via
|
|
20256
|
-
* `device-manager.setWrapperActive`. `defaultActive: true` because
|
|
20257
|
-
* every camera with a detection pipeline wants its raw detections
|
|
20258
|
-
* refined; operators opt out per-device via BindingsTab when needed.
|
|
20259
|
-
*
|
|
20260
|
-
* Replaces the legacy `analysis-pipeline`, `analysis-data-persistence`
|
|
20261
|
-
* (per-device surface) and `track-trail` caps — see P11 cleanup.
|
|
20262
|
-
*/
|
|
20263
|
-
var TrackStateSchema = _enum([
|
|
20264
|
-
"new",
|
|
20265
|
-
"entered",
|
|
20266
|
-
"left",
|
|
20267
|
-
"moving",
|
|
20268
|
-
"idle"
|
|
20269
|
-
]);
|
|
20270
|
-
var EventKindSchema = _enum([
|
|
20271
|
-
"motion",
|
|
20272
|
-
"object",
|
|
20273
|
-
"audio"
|
|
20274
|
-
]);
|
|
20275
|
-
/**
|
|
20276
|
-
* Spatial filter for `listTracks` — the rect + polygon variants of the shared
|
|
20277
|
-
* MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
|
|
20278
|
-
* of the camera frame (top-left origin), matching the drawing-plane editor.
|
|
20279
|
-
*/
|
|
20280
|
-
var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
|
|
20281
|
-
/** Closed icon vocabulary so clients render a known glyph per kind. */
|
|
20282
|
-
var EventKindIconSchema = _enum([
|
|
20283
|
-
"motion",
|
|
20284
|
-
"audio",
|
|
20285
|
-
"person",
|
|
20286
|
-
"vehicle",
|
|
20287
|
-
"animal",
|
|
20288
|
-
"door",
|
|
20289
|
-
"pir",
|
|
20290
|
-
"smoke",
|
|
20291
|
-
"water",
|
|
20292
|
-
"button",
|
|
20293
|
-
"package",
|
|
20294
|
-
"generic"
|
|
20295
|
-
]);
|
|
20296
|
-
var EventKindCategorySchema = _enum([
|
|
20297
|
-
"motion",
|
|
20298
|
-
"audio",
|
|
20299
|
-
"detection",
|
|
20300
|
-
"sensor",
|
|
20301
|
-
"control",
|
|
20302
|
-
"custom",
|
|
20303
|
-
"package"
|
|
20304
|
-
]);
|
|
20305
|
-
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
20306
|
-
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
20307
|
-
var EventKindDescriptorSchema = object({
|
|
20308
|
-
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
20309
|
-
kind: string(),
|
|
20310
|
-
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
20311
|
-
labelKey: string(),
|
|
20312
|
-
/** English fallback label (kept for clients that don't translate). */
|
|
20313
|
-
label: string(),
|
|
20314
|
-
/** Hex color for timeline/legend rendering. */
|
|
20315
|
-
color: string(),
|
|
20316
|
-
/** Dictionary id → lucide component on the UI side. */
|
|
20317
|
-
iconId: string(),
|
|
20318
|
-
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
20319
|
-
icon: EventKindIconSchema,
|
|
20320
|
-
category: EventKindCategorySchema,
|
|
20321
|
-
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
20322
|
-
parentKind: string().nullable(),
|
|
20323
|
-
/** Derived from `parentKind`, explicit for the client tree. */
|
|
20324
|
-
level: EventKindLevelSchema,
|
|
20325
|
-
/** Which cap + device contributes this kind. For built-ins the camera
|
|
20326
|
-
* itself; for sensor kinds the LINKED source device. */
|
|
20327
|
-
source: object({
|
|
20328
|
-
capName: string(),
|
|
20329
|
-
deviceId: number()
|
|
20330
|
-
})
|
|
20331
|
-
});
|
|
20332
|
-
/** One camera's event vocabulary, as returned by `listEventKindsBatch`. */
|
|
20333
|
-
var EventKindsForDeviceSchema = object({
|
|
20334
|
-
deviceId: number(),
|
|
20335
|
-
kinds: array(EventKindDescriptorSchema).readonly()
|
|
20336
|
-
});
|
|
20337
|
-
var SensorEventSchema = object({
|
|
20338
|
-
id: string(),
|
|
20339
|
-
/** The CAMERA the event is attributed to (a sensor linked to N cameras
|
|
20340
|
-
* yields N rows, one per camera). */
|
|
20341
|
-
deviceId: number(),
|
|
20342
|
-
/** The linked sensor device whose state changed. */
|
|
20343
|
-
sourceDeviceId: number(),
|
|
20344
|
-
/** Event kind id — matches an `EventKindDescriptor.kind`. */
|
|
20345
|
-
kind: string(),
|
|
20346
|
-
/** Snapshot of the sensor cap's runtime-state slice at the change. */
|
|
20347
|
-
value: record(string(), unknown()).nullable(),
|
|
20348
|
-
timestamp: number()
|
|
20349
|
-
});
|
|
20350
|
-
/**
|
|
20351
|
-
* One stored sighting on a track's trajectory.
|
|
20352
|
-
*
|
|
20353
|
-
* The array these live in is returned in TIME order (D399) — it is APPENDED in
|
|
20354
|
-
* arrival order, and the two detector passes interleave, so a consumer must not
|
|
20355
|
-
* assume the two are the same on a row written by an older build.
|
|
20356
|
-
*/
|
|
20357
|
-
var TrackPositionSchema = object({
|
|
20358
|
-
x: number(),
|
|
20359
|
-
y: number(),
|
|
20360
|
-
timestamp: number(),
|
|
20361
|
-
bbox: BoundingBoxSchema,
|
|
20362
|
-
/**
|
|
20363
|
-
* Which detector pass measured this box (D399): `frame` is the full-frame
|
|
20364
|
-
* pass on the analysis raster, `recovery` is the native-resolution
|
|
20365
|
-
* small-subject second pass (D377/D378). Both write into one array, and until
|
|
20366
|
-
* this field existed the only way to tell them apart was that full-frame boxes
|
|
20367
|
-
* are exact multiples of 1.2 while recovery boxes are full-precision floats.
|
|
20368
|
-
* Absent on rows written before D399.
|
|
20369
|
-
*/
|
|
20370
|
-
source: _enum(["frame", "recovery"]).optional(),
|
|
20371
|
-
/** Detection score of this box, so a position can be weighed and not only
|
|
20372
|
-
* plotted. Absent on rows written before D399. */
|
|
20373
|
-
score: number().optional()
|
|
20374
|
-
});
|
|
20375
|
-
var TrackSnapshotSchema = object({
|
|
20376
|
-
timestamp: number(),
|
|
20377
|
-
position: TrackPositionSchema,
|
|
20378
|
-
/** The snapshot's media row id (D482); resolve via `listTrackMedia({ trackId })`. */
|
|
20379
|
-
mediaId: number().int()
|
|
20380
|
-
});
|
|
20381
|
-
/**
|
|
20382
|
-
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
20383
|
-
* divided by the track's detection-frame dims), computed at persist time.
|
|
20384
|
-
* Absent when the frame dims were unknown when the track was persisted
|
|
20385
|
-
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
20386
|
-
*/
|
|
20387
|
-
var TrackEnvelopeSchema = object({
|
|
20388
|
-
minX: number(),
|
|
20389
|
-
minY: number(),
|
|
20390
|
-
maxX: number(),
|
|
20391
|
-
maxY: number()
|
|
20193
|
+
/**
|
|
20194
|
+
* Normalized 0..1 trajectory envelope (min/max over every position bbox,
|
|
20195
|
+
* divided by the track's detection-frame dims), computed at persist time.
|
|
20196
|
+
* Absent when the frame dims were unknown when the track was persisted
|
|
20197
|
+
* (legacy rows / dims-less sources) and on active (in-RAM) tracks.
|
|
20198
|
+
*/
|
|
20199
|
+
var TrackEnvelopeSchema = object({
|
|
20200
|
+
minX: number(),
|
|
20201
|
+
minY: number(),
|
|
20202
|
+
maxX: number(),
|
|
20203
|
+
maxY: number()
|
|
20392
20204
|
});
|
|
20393
20205
|
/**
|
|
20394
20206
|
* Row projection for track list queries. `full` (default) returns the
|
|
@@ -20807,6 +20619,22 @@ var TrackSchema = object({
|
|
|
20807
20619
|
* omit it. Render nothing when absent.
|
|
20808
20620
|
*/
|
|
20809
20621
|
previewMissReason: string().optional(),
|
|
20622
|
+
/**
|
|
20623
|
+
* The ROOT model that produced this track — the `FrameResult.rootModelId` of
|
|
20624
|
+
* the frame it was BORN on (D646). What a later replay compares against, so
|
|
20625
|
+
* "the original model" is named rather than assumed. A birth fact: never
|
|
20626
|
+
* rewritten by a later frame. **Absent ≠ unknown-model**: a row from before
|
|
20627
|
+
* the column, and a track the camera's own detector produced, carry none.
|
|
20628
|
+
*/
|
|
20629
|
+
modelId: string().optional(),
|
|
20630
|
+
/**
|
|
20631
|
+
* Size (px) of the detection frame this track's `positions[].bbox` live in —
|
|
20632
|
+
* the frame it was born on, else the camera's latest analysis frame at
|
|
20633
|
+
* persist time. Divide a position by these to normalise it. Absent when the
|
|
20634
|
+
* size was never known.
|
|
20635
|
+
*/
|
|
20636
|
+
frameWidth: number().optional(),
|
|
20637
|
+
frameHeight: number().optional(),
|
|
20810
20638
|
...TrackFlagFields,
|
|
20811
20639
|
...TrackRetrainFields
|
|
20812
20640
|
});
|
|
@@ -21036,7 +20864,8 @@ var MediaFileKindEnum = _enum([
|
|
|
21036
20864
|
"thumbnailSmall",
|
|
21037
20865
|
"confirmationCrop",
|
|
21038
20866
|
"debugCrop",
|
|
21039
|
-
"sceneFrame"
|
|
20867
|
+
"sceneFrame",
|
|
20868
|
+
"lastSceneFrame"
|
|
21040
20869
|
]);
|
|
21041
20870
|
/**
|
|
21042
20871
|
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
@@ -21588,7 +21417,23 @@ var SearchObjectEventsInput = object({
|
|
|
21588
21417
|
until: number().optional(),
|
|
21589
21418
|
classFilter: string().optional(),
|
|
21590
21419
|
limit: number().default(50),
|
|
21591
|
-
|
|
21420
|
+
/**
|
|
21421
|
+
* An ABSOLUTE cosine floor. Optional since D649: a floor is a property of the
|
|
21422
|
+
* model (0.2 kept 96% of matched pairs on MobileCLIP S1 and 2.7% on SigLIP2),
|
|
21423
|
+
* so an absent one resolves to the searched model's own `searchMinScore`
|
|
21424
|
+
* scaled by `strictness`. A number sent here is honoured verbatim.
|
|
21425
|
+
*/
|
|
21426
|
+
minScore: number().min(0).max(1).optional(),
|
|
21427
|
+
/** Model-relative floor — see `resolveClipSearchMinScore`. Default `loose`. */
|
|
21428
|
+
strictness: ClipSearchStrictnessSchema.optional(),
|
|
21429
|
+
/**
|
|
21430
|
+
* Search THIS CLIP model's index instead of the cluster row's. Every index a
|
|
21431
|
+
* model ever wrote stays searchable until it is wiped (the MobileCLIP index
|
|
21432
|
+
* through a SigLIP2 cutover and its rollback window). An id with no CLIP
|
|
21433
|
+
* metadata is refused; an id other than the cluster row's is ADMIN-only
|
|
21434
|
+
* (`model-override-requires-admin`).
|
|
21435
|
+
*/
|
|
21436
|
+
modelId: string().min(1).optional()
|
|
21592
21437
|
});
|
|
21593
21438
|
var TrackCascadeCountsSchema = object({
|
|
21594
21439
|
/** Persisted track roots deleted (authoritative). */
|
|
@@ -21723,7 +21568,41 @@ var RebuildObjectEmbeddingsInput = object({
|
|
|
21723
21568
|
* comparable, so wiping and rebuilding is the only way to be sure every vector
|
|
21724
21569
|
* means the same thing.
|
|
21725
21570
|
*/
|
|
21726
|
-
var WipeObjectEmbeddingsResultSchema = object({
|
|
21571
|
+
var WipeObjectEmbeddingsResultSchema = object({
|
|
21572
|
+
deleted: number(),
|
|
21573
|
+
/**
|
|
21574
|
+
* CLIP indexes that could NOT be emptied (unreachable, or refused at their
|
|
21575
|
+
* dimension) — not a clean slate. Additive and optional (D649).
|
|
21576
|
+
*/
|
|
21577
|
+
failedIndexes: array(string()).optional()
|
|
21578
|
+
});
|
|
21579
|
+
/**
|
|
21580
|
+
* Why a rebuild did not start, BY NAME — ONE vocabulary for both gates in front
|
|
21581
|
+
* of a pass (D649 over D651). A bare `started: false` read the same for "the
|
|
21582
|
+
* stores are booting" and "the cluster row names a model with no CLIP
|
|
21583
|
+
* metadata", which need different fixes.
|
|
21584
|
+
* - `stores-unavailable` — the analytics stores or the API are not up yet.
|
|
21585
|
+
* - the owner's confirmation of the cluster model (D651, `ClusterPinConfirmer`):
|
|
21586
|
+
* a pass that rewrites an index needs two agreeing reads of the OWNER's
|
|
21587
|
+
* answer (`pipelineOrchestrator.getClusterModelChoice`) — a pass that cannot
|
|
21588
|
+
* name its model does not run (D54):
|
|
21589
|
+
* - the owner's own `unreadable` reasons (`owner-not-ready`,
|
|
21590
|
+
* `store-read-failed`, `three-way-read-unavailable`, `invalid-stored`,
|
|
21591
|
+
* `not-cluster-scoped`);
|
|
21592
|
+
* - `method-unavailable` — the orchestrator predates the method;
|
|
21593
|
+
* - `read-failed` — the call failed or answered something unparseable;
|
|
21594
|
+
* - `reads-disagree` — the two reads named different choices.
|
|
21595
|
+
* - `not-a-clip-model` — the CONFIRMED id has no CLIP metadata, so there is no
|
|
21596
|
+
* index to fill and no dimension to check against (D649).
|
|
21597
|
+
*/
|
|
21598
|
+
var RebuildObjectEmbeddingsRefusalSchema = _enum([
|
|
21599
|
+
"stores-unavailable",
|
|
21600
|
+
...CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS,
|
|
21601
|
+
"method-unavailable",
|
|
21602
|
+
"read-failed",
|
|
21603
|
+
"reads-disagree",
|
|
21604
|
+
"not-a-clip-model"
|
|
21605
|
+
]);
|
|
21727
21606
|
/**
|
|
21728
21607
|
* Acknowledgement that a rebuild STARTED.
|
|
21729
21608
|
*
|
|
@@ -21736,7 +21615,12 @@ var WipeObjectEmbeddingsResultSchema = object({ deleted: number() });
|
|
|
21736
21615
|
var RebuildObjectEmbeddingsResultSchema = object({
|
|
21737
21616
|
started: boolean(),
|
|
21738
21617
|
/** True when a pass was already running; the new request is ignored. */
|
|
21739
|
-
alreadyRunning: boolean()
|
|
21618
|
+
alreadyRunning: boolean(),
|
|
21619
|
+
/** Present when the pass refused to start — see `RebuildObjectEmbeddingsRefusalSchema`. */
|
|
21620
|
+
refusal: RebuildObjectEmbeddingsRefusalSchema.optional(),
|
|
21621
|
+
/** The CLIP model the pass pinned, and the index it fills (when it started). */
|
|
21622
|
+
modelId: string().optional(),
|
|
21623
|
+
index: string().optional()
|
|
21740
21624
|
});
|
|
21741
21625
|
var RebuildStatusSchema = object({
|
|
21742
21626
|
running: boolean(),
|
|
@@ -21770,7 +21654,11 @@ var RebuildStatusSchema = object({
|
|
|
21770
21654
|
startedAtMs: number().nullable(),
|
|
21771
21655
|
finishedAtMs: number().nullable(),
|
|
21772
21656
|
/** Present when the pass ended by throwing. */
|
|
21773
|
-
error: string().nullable()
|
|
21657
|
+
error: string().nullable(),
|
|
21658
|
+
/** The CLIP model the current / last pass pinned (D54), `null` before any. */
|
|
21659
|
+
modelId: string().nullable(),
|
|
21660
|
+
/** The index that pass fills — `ClipModelMeta.vectorIndex` of `modelId` (D649). */
|
|
21661
|
+
index: string().nullable()
|
|
21774
21662
|
});
|
|
21775
21663
|
/**
|
|
21776
21664
|
* Acknowledgement that a debug-media reclaim STARTED.
|
|
@@ -21813,24 +21701,6 @@ var MediaReclaimStatusSchema = object({
|
|
|
21813
21701
|
finishedAtMs: number().nullable(),
|
|
21814
21702
|
error: string().nullable()
|
|
21815
21703
|
});
|
|
21816
|
-
var ReplayFrameInputSchema = object({
|
|
21817
|
-
timestamp: number(),
|
|
21818
|
-
frame: PipelineRunResultBridge
|
|
21819
|
-
});
|
|
21820
|
-
var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
21821
|
-
className: string(),
|
|
21822
|
-
firstSeenMs: number(),
|
|
21823
|
-
lastSeenMs: number(),
|
|
21824
|
-
/** Bbox of the track's FIRST matched detection, pixel-space in the clip's
|
|
21825
|
-
* frame — a representative box for the diff's `(className, window, IoU)`
|
|
21826
|
-
* pairing (`replay-diff.ts`). A replay does not need the full per-frame
|
|
21827
|
-
* trajectory production's `Track.positions` keeps. */
|
|
21828
|
-
bbox: BoundingBoxSchema,
|
|
21829
|
-
/** How many of the input frames this track matched a real detection on
|
|
21830
|
-
* (never a coasted/extrapolated frame) — the replay's own signal for "how
|
|
21831
|
-
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
21832
|
-
framesMatched: number().int()
|
|
21833
|
-
})).readonly() });
|
|
21834
21704
|
/**
|
|
21835
21705
|
* The long-term series a camera produces. A closed union so a typo cannot
|
|
21836
21706
|
* invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
|
|
@@ -21990,162 +21860,624 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21990
21860
|
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
21991
21861
|
kind: "mutation",
|
|
21992
21862
|
auth: "admin"
|
|
21993
|
-
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
21994
|
-
kind: "query",
|
|
21995
|
-
auth: "admin"
|
|
21996
|
-
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
21997
|
-
kind: "query",
|
|
21998
|
-
auth: "admin"
|
|
21999
|
-
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
21863
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, {
|
|
21864
|
+
kind: "query",
|
|
21865
|
+
auth: "admin"
|
|
21866
|
+
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
21867
|
+
kind: "query",
|
|
21868
|
+
auth: "admin"
|
|
21869
|
+
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
21870
|
+
kind: "mutation",
|
|
21871
|
+
auth: "admin"
|
|
21872
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
21873
|
+
kind: "query",
|
|
21874
|
+
auth: "admin"
|
|
21875
|
+
}), method(MediaReclaimInputSchema, MediaReclaimStartResultSchema, {
|
|
21876
|
+
kind: "mutation",
|
|
21877
|
+
auth: "admin"
|
|
21878
|
+
}), method(object({}), MediaReclaimStatusSchema, {
|
|
21879
|
+
kind: "query",
|
|
21880
|
+
auth: "admin"
|
|
21881
|
+
}), method(object({ deviceIds: array(number()).optional() }), TrainingExportSummarySchema, {
|
|
21882
|
+
kind: "query",
|
|
21883
|
+
auth: "admin"
|
|
21884
|
+
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
21885
|
+
kind: "query",
|
|
21886
|
+
auth: "admin"
|
|
21887
|
+
}), method(object({
|
|
21888
|
+
/** Empty ⇒ every camera that has staging tracks. A LIST, not a single
|
|
21889
|
+
* `deviceId`, deliberately: `deviceId` would make this device-bound and
|
|
21890
|
+
* route it at one camera's owner, and "every camera" would stop being
|
|
21891
|
+
* expressible at all. */
|
|
21892
|
+
deviceIds: array(number()).optional(),
|
|
21893
|
+
limit: number().int().min(1).max(500).optional()
|
|
21894
|
+
}), array(RetrainTrackSchema).readonly(), {
|
|
21895
|
+
kind: "query",
|
|
21896
|
+
auth: "admin"
|
|
21897
|
+
}), method(object({ trackId: string() }), RetrainFrameListSchema, {
|
|
21898
|
+
kind: "query",
|
|
21899
|
+
auth: "admin"
|
|
21900
|
+
}), method(object({
|
|
21901
|
+
deviceId: number(),
|
|
21902
|
+
trackId: string(),
|
|
21903
|
+
mediaIds: array(number().int()).min(1)
|
|
21904
|
+
}), RetrainFrameSelectionSchema, {
|
|
21905
|
+
kind: "mutation",
|
|
21906
|
+
auth: "admin"
|
|
21907
|
+
}), method(object({
|
|
21908
|
+
deviceId: number(),
|
|
21909
|
+
trackId: string(),
|
|
21910
|
+
frameId: string()
|
|
21911
|
+
}), object({
|
|
21912
|
+
removed: boolean(),
|
|
21913
|
+
removedAnnotations: number().int()
|
|
21914
|
+
}), {
|
|
21915
|
+
kind: "mutation",
|
|
21916
|
+
auth: "admin"
|
|
21917
|
+
}), method(object({ frameId: string() }), object({
|
|
21918
|
+
base64: string(),
|
|
21919
|
+
width: number().int(),
|
|
21920
|
+
height: number().int()
|
|
21921
|
+
}), {
|
|
21922
|
+
kind: "query",
|
|
21923
|
+
auth: "admin"
|
|
21924
|
+
}), method(object({
|
|
21925
|
+
deviceId: number(),
|
|
21926
|
+
trackId: string(),
|
|
21927
|
+
frameId: string(),
|
|
21928
|
+
subject: RetrainAssistSubjectSchema,
|
|
21929
|
+
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
21930
|
+
nodeId: string().optional()
|
|
21931
|
+
}), RetrainAssistResultSchema, {
|
|
21932
|
+
kind: "mutation",
|
|
21933
|
+
auth: "admin"
|
|
21934
|
+
}), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
|
|
21935
|
+
kind: "query",
|
|
21936
|
+
auth: "admin"
|
|
21937
|
+
}), method(object({
|
|
21938
|
+
deviceId: number(),
|
|
21939
|
+
trackId: string(),
|
|
21940
|
+
frameId: string(),
|
|
21941
|
+
annotations: array(RetrainAnnotationDraftSchema)
|
|
21942
|
+
}), array(RetrainAnnotationSchema).readonly(), {
|
|
21943
|
+
kind: "mutation",
|
|
21944
|
+
auth: "admin"
|
|
21945
|
+
}), method(object({
|
|
21946
|
+
deviceId: number(),
|
|
21947
|
+
trackId: string()
|
|
21948
|
+
}), RetrainTransitionResultSchema, {
|
|
21949
|
+
kind: "mutation",
|
|
21950
|
+
auth: "admin"
|
|
21951
|
+
}), method(object({
|
|
21952
|
+
deviceId: number(),
|
|
21953
|
+
trackId: string()
|
|
21954
|
+
}), RetrainTransitionResultSchema, {
|
|
21955
|
+
kind: "mutation",
|
|
21956
|
+
auth: "admin"
|
|
21957
|
+
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
21958
|
+
kind: "query",
|
|
21959
|
+
auth: "admin"
|
|
21960
|
+
}), method(object({
|
|
21961
|
+
/** Which of the three event tables owns the row. */
|
|
21962
|
+
ownerType: EventOwnerTypeSchema,
|
|
21963
|
+
/** The event's rowid in that table (D474: an event id is a number). */
|
|
21964
|
+
eventId: number().int(),
|
|
21965
|
+
kind: MediaFileKindEnum.optional(),
|
|
21966
|
+
deviceId: number()
|
|
21967
|
+
}), array(MediaFileSchema).readonly()), method(object({
|
|
21968
|
+
trackId: string(),
|
|
21969
|
+
kinds: array(MediaFileKindEnum).optional(),
|
|
21970
|
+
deviceId: number()
|
|
21971
|
+
}), array(MediaFileSchema).readonly()), method(object({
|
|
21972
|
+
trackId: string(),
|
|
21973
|
+
deviceId: number()
|
|
21974
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
21975
|
+
ownerType: EventOwnerTypeSchema,
|
|
21976
|
+
eventId: number().int(),
|
|
21977
|
+
deviceId: number()
|
|
21978
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
21979
|
+
deviceId: number(),
|
|
21980
|
+
ownerKind: MediaPresenceOwnerKindSchema,
|
|
21981
|
+
ownerIds: array(string()).max(5e3)
|
|
21982
|
+
}), array(string()).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly(), { caller: "required" }), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
21983
|
+
kind: "mutation",
|
|
21984
|
+
auth: "admin"
|
|
21985
|
+
}), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
|
|
21986
|
+
kind: "mutation",
|
|
21987
|
+
auth: "admin"
|
|
21988
|
+
}), method(object({}), RebuildStatusSchema), object({
|
|
21989
|
+
deviceId: number(),
|
|
21990
|
+
timestamp: number(),
|
|
21991
|
+
frameWidth: number(),
|
|
21992
|
+
frameHeight: number(),
|
|
21993
|
+
detections: array(OverlayDetectionSchema).readonly()
|
|
21994
|
+
}), object({
|
|
21995
|
+
deviceId: number(),
|
|
21996
|
+
trackId: string(),
|
|
21997
|
+
className: string()
|
|
21998
|
+
}), object({
|
|
21999
|
+
deviceId: number(),
|
|
22000
|
+
trackId: string(),
|
|
22001
|
+
className: string(),
|
|
22002
|
+
durationMs: number()
|
|
22003
|
+
}), object({
|
|
22004
|
+
deviceId: number(),
|
|
22005
|
+
kind: EventKindSchema,
|
|
22006
|
+
eventId: string(),
|
|
22007
|
+
timestamp: number()
|
|
22008
|
+
});
|
|
22009
|
+
/**
|
|
22010
|
+
* Reference to the frame's retained NATIVE surface + the parent crop's placement
|
|
22011
|
+
* within the frame, so the executor can re-cut a leaf child ROI at native
|
|
22012
|
+
* resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
|
|
22013
|
+
*/
|
|
22014
|
+
var NativeCropRefSchema = object({
|
|
22015
|
+
/** Handle keying the retained native surface (node-pinned to its owner). */
|
|
22016
|
+
handle: FrameHandleSchema,
|
|
22017
|
+
/** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
|
|
22018
|
+
cropFrameSpace: object({
|
|
22019
|
+
x: number(),
|
|
22020
|
+
y: number(),
|
|
22021
|
+
w: number(),
|
|
22022
|
+
h: number()
|
|
22023
|
+
})
|
|
22024
|
+
});
|
|
22025
|
+
object({
|
|
22026
|
+
crop: object({
|
|
22027
|
+
left: number(),
|
|
22028
|
+
top: number(),
|
|
22029
|
+
width: number().positive(),
|
|
22030
|
+
height: number().positive()
|
|
22031
|
+
}).optional(),
|
|
22032
|
+
content: object({
|
|
22033
|
+
width: number().int().positive(),
|
|
22034
|
+
height: number().int().positive()
|
|
22035
|
+
}),
|
|
22036
|
+
fit: _enum(["stretch", "contain"]),
|
|
22037
|
+
format: _enum([
|
|
22038
|
+
"rgb",
|
|
22039
|
+
"gray",
|
|
22040
|
+
"jpeg"
|
|
22041
|
+
])
|
|
22042
|
+
});
|
|
22043
|
+
/**
|
|
22044
|
+
* Process-local frame identity. It is serializable so it can ride an in-process
|
|
22045
|
+
* capability call, but `registryId` deliberately prevents resolution in any
|
|
22046
|
+
* other process or execution group.
|
|
22047
|
+
*/
|
|
22048
|
+
var FrameRefSchema = object({
|
|
22049
|
+
registryId: string().min(1),
|
|
22050
|
+
id: string().min(1),
|
|
22051
|
+
width: number().int().positive(),
|
|
22052
|
+
height: number().int().positive(),
|
|
22053
|
+
format: _enum(["rgb", "gray"]),
|
|
22054
|
+
timestamp: number(),
|
|
22055
|
+
capturedAt: number().optional()
|
|
22056
|
+
});
|
|
22057
|
+
var ModelFormatSchema$1 = _enum([
|
|
22058
|
+
"onnx",
|
|
22059
|
+
"coreml",
|
|
22060
|
+
"openvino",
|
|
22061
|
+
"tflite",
|
|
22062
|
+
"pt",
|
|
22063
|
+
"gguf"
|
|
22064
|
+
]);
|
|
22065
|
+
var PipelineSlotSchema = _enum([
|
|
22066
|
+
"detector",
|
|
22067
|
+
"cropper",
|
|
22068
|
+
"classifier",
|
|
22069
|
+
"refiner",
|
|
22070
|
+
"audio-classifier"
|
|
22071
|
+
]);
|
|
22072
|
+
var PipelineEngineChoiceSchema = object({
|
|
22073
|
+
runtime: literal("python"),
|
|
22074
|
+
backend: string(),
|
|
22075
|
+
format: ModelFormatSchema$1,
|
|
22076
|
+
device: string().optional()
|
|
22077
|
+
});
|
|
22078
|
+
/**
|
|
22079
|
+
* One pool's resolved provisioning (`getEffectiveTuning`). `numWorkers` is the
|
|
22080
|
+
* knob that lifts a saturated pool (`inference-devices.md`); `concurrency` is
|
|
22081
|
+
* per-worker in-flight requests. `deviceKey` echoes the pool asked about —
|
|
22082
|
+
* `null` for the node-default pool.
|
|
22083
|
+
*/
|
|
22084
|
+
var EffectiveTuningSchema = object({
|
|
22085
|
+
deviceKey: string().nullable(),
|
|
22086
|
+
runtime: string(),
|
|
22087
|
+
batchMode: string(),
|
|
22088
|
+
windowMs: number(),
|
|
22089
|
+
maxBatchSize: number(),
|
|
22090
|
+
concurrency: number(),
|
|
22091
|
+
numWorkers: number()
|
|
22092
|
+
});
|
|
22093
|
+
var AvailableEngineSchema = object({
|
|
22094
|
+
engine: PipelineEngineChoiceSchema,
|
|
22095
|
+
devices: array(object({
|
|
22096
|
+
id: string(),
|
|
22097
|
+
label: string(),
|
|
22098
|
+
description: string().optional()
|
|
22099
|
+
})).readonly(),
|
|
22100
|
+
defaultDevice: string()
|
|
22101
|
+
});
|
|
22102
|
+
var PipelineDefaultStepSchema = lazy(() => object({
|
|
22103
|
+
addonId: string(),
|
|
22104
|
+
addonName: string(),
|
|
22105
|
+
slot: PipelineSlotSchema,
|
|
22106
|
+
inputClasses: array(string()).readonly(),
|
|
22107
|
+
outputClasses: array(string()).readonly(),
|
|
22108
|
+
enabled: boolean(),
|
|
22109
|
+
modelId: string(),
|
|
22110
|
+
children: array(PipelineDefaultStepSchema).readonly(),
|
|
22111
|
+
group: string().optional(),
|
|
22112
|
+
settings: record(string(), unknown()).optional()
|
|
22113
|
+
}));
|
|
22114
|
+
var PipelineTemplateStepSchema = lazy(() => object({
|
|
22115
|
+
addonId: string(),
|
|
22116
|
+
enabled: boolean(),
|
|
22117
|
+
modelId: string(),
|
|
22118
|
+
children: array(PipelineTemplateStepSchema).readonly(),
|
|
22119
|
+
settings: record(string(), unknown()).optional()
|
|
22120
|
+
}));
|
|
22121
|
+
var PipelineTemplateSchema$1 = object({
|
|
22122
|
+
id: string(),
|
|
22123
|
+
name: string(),
|
|
22124
|
+
createdAt: string(),
|
|
22125
|
+
updatedAt: string(),
|
|
22126
|
+
engine: PipelineEngineChoiceSchema,
|
|
22127
|
+
steps: array(PipelineTemplateStepSchema).readonly()
|
|
22128
|
+
});
|
|
22129
|
+
var PipelineModelOptionSchema = object({
|
|
22130
|
+
id: string(),
|
|
22131
|
+
name: string(),
|
|
22132
|
+
formats: record(string(), object({
|
|
22133
|
+
downloaded: boolean(),
|
|
22134
|
+
sizeMB: number()
|
|
22135
|
+
})),
|
|
22136
|
+
group: ModelVariantGroupSchema.optional(),
|
|
22137
|
+
legacy: boolean().optional(),
|
|
22138
|
+
provider: ModelProviderIdSchema.optional()
|
|
22139
|
+
});
|
|
22140
|
+
var ConfigFieldBridge = custom();
|
|
22141
|
+
var PipelineAddonSchemaSchema = object({
|
|
22142
|
+
id: string(),
|
|
22143
|
+
name: string(),
|
|
22144
|
+
slot: PipelineSlotSchema,
|
|
22145
|
+
inputClasses: array(string()).readonly(),
|
|
22146
|
+
outputClasses: array(string()).readonly(),
|
|
22147
|
+
childSlots: array(PipelineSlotSchema).readonly(),
|
|
22148
|
+
models: array(PipelineModelOptionSchema).readonly(),
|
|
22149
|
+
defaultModelId: string(),
|
|
22150
|
+
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
22151
|
+
enabledByDefault: boolean().optional(),
|
|
22152
|
+
backfillIntoExistingOverrides: boolean().optional(),
|
|
22153
|
+
defaultConfidence: number(),
|
|
22154
|
+
group: string().optional(),
|
|
22155
|
+
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
22156
|
+
});
|
|
22157
|
+
var PipelineSlotSchemaSchema = object({
|
|
22158
|
+
id: PipelineSlotSchema,
|
|
22159
|
+
label: string(),
|
|
22160
|
+
priority: number(),
|
|
22161
|
+
parentSlot: PipelineSlotSchema.nullable(),
|
|
22162
|
+
addons: array(PipelineAddonSchemaSchema).readonly()
|
|
22163
|
+
});
|
|
22164
|
+
var PipelineSchemaSchema = object({
|
|
22165
|
+
availableEngines: array(AvailableEngineSchema).readonly(),
|
|
22166
|
+
selectedEngine: PipelineEngineChoiceSchema,
|
|
22167
|
+
slots: array(PipelineSlotSchemaSchema).readonly()
|
|
22168
|
+
});
|
|
22169
|
+
var EngineProvisioningSchema = object({
|
|
22170
|
+
runtimeId: _enum([
|
|
22171
|
+
"onnx",
|
|
22172
|
+
"openvino",
|
|
22173
|
+
"coreml",
|
|
22174
|
+
"edgetpu"
|
|
22175
|
+
]).nullable(),
|
|
22176
|
+
device: string().nullable(),
|
|
22177
|
+
state: _enum([
|
|
22178
|
+
"idle",
|
|
22179
|
+
"installing",
|
|
22180
|
+
"verifying",
|
|
22181
|
+
"ready",
|
|
22182
|
+
"failed"
|
|
22183
|
+
]),
|
|
22184
|
+
progress: number().optional(),
|
|
22185
|
+
error: string().optional(),
|
|
22186
|
+
nextRetryAt: number().optional(),
|
|
22187
|
+
/**
|
|
22188
|
+
* Gate A (config-correctness gate at engine change): human-readable
|
|
22189
|
+
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
22190
|
+
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
22191
|
+
* has a <format> build"). Additive/optional: informational only, never
|
|
22192
|
+
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
22193
|
+
* Absent/empty when the node-default tree resolves cleanly.
|
|
22194
|
+
*/
|
|
22195
|
+
configIssues: array(string()).optional()
|
|
22196
|
+
});
|
|
22197
|
+
var PipelineStepInputSchema = lazy(() => object({
|
|
22198
|
+
addonId: string(),
|
|
22199
|
+
modelId: string().optional(),
|
|
22200
|
+
enabled: boolean().default(true),
|
|
22201
|
+
children: array(PipelineStepInputSchema).optional(),
|
|
22202
|
+
settings: record(string(), unknown()).optional(),
|
|
22203
|
+
jumpDeviceKey: string().optional()
|
|
22204
|
+
}));
|
|
22205
|
+
var ModelSubstitutionSchema = object({
|
|
22206
|
+
addonId: string(),
|
|
22207
|
+
chosen: string(),
|
|
22208
|
+
running: string(),
|
|
22209
|
+
format: string()
|
|
22210
|
+
});
|
|
22211
|
+
var PipelineValidationIssueSchema = object({
|
|
22212
|
+
addonId: string(),
|
|
22213
|
+
kind: _enum([
|
|
22214
|
+
"unknown-addon",
|
|
22215
|
+
"no-format-build",
|
|
22216
|
+
"unknown-device"
|
|
22217
|
+
]),
|
|
22218
|
+
detail: string()
|
|
22219
|
+
});
|
|
22220
|
+
var PipelineValidationResultSchema = object({
|
|
22221
|
+
ok: boolean(),
|
|
22222
|
+
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
22223
|
+
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
22224
|
+
/** The node's `currentEngine.format` this validation ran against. */
|
|
22225
|
+
format: string()
|
|
22226
|
+
});
|
|
22227
|
+
var ReferenceImageEntrySchema = object({
|
|
22228
|
+
filename: string(),
|
|
22229
|
+
stepIds: array(string()).readonly().optional()
|
|
22230
|
+
});
|
|
22231
|
+
var ReferenceImageBodySchema = object({
|
|
22232
|
+
base64: string(),
|
|
22233
|
+
filename: string()
|
|
22234
|
+
});
|
|
22235
|
+
var ReferenceAudioEntrySchema = object({
|
|
22236
|
+
filename: string(),
|
|
22237
|
+
sizeKb: number()
|
|
22238
|
+
});
|
|
22239
|
+
var ReferenceAudioBodySchema = object({ base64: string() });
|
|
22240
|
+
var AudioBackendSchema = object({
|
|
22241
|
+
id: string(),
|
|
22242
|
+
name: string(),
|
|
22243
|
+
description: string(),
|
|
22244
|
+
available: boolean(),
|
|
22245
|
+
/**
|
|
22246
|
+
* Raw classifier labels this backend can emit (e.g. YAMNet's
|
|
22247
|
+
* 521-class set or Apple SoundAnalysis's 303-class set). Used by
|
|
22248
|
+
* the benchmark UI to populate the `enabledMicroClasses` filter
|
|
22249
|
+
* specific to the selected backend without a separate fetch.
|
|
22250
|
+
*/
|
|
22251
|
+
rawLabels: array(string()).readonly().optional()
|
|
22252
|
+
});
|
|
22253
|
+
var AudioCapabilitiesSchema = object({
|
|
22254
|
+
activeBackend: string(),
|
|
22255
|
+
availableBackends: array(AudioBackendSchema).readonly(),
|
|
22256
|
+
sampleRate: number(),
|
|
22257
|
+
chunkDurationMs: number()
|
|
22258
|
+
});
|
|
22259
|
+
var DownloadModelResultSchema = object({
|
|
22260
|
+
filePath: string(),
|
|
22261
|
+
sizeMB: number(),
|
|
22262
|
+
durationMs: number()
|
|
22263
|
+
});
|
|
22264
|
+
/**
|
|
22265
|
+
* Wrapper carrying a single test run's result. Replaces the legacy
|
|
22266
|
+
* ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
|
|
22267
|
+
* canonical `AudioResult` from the Phase 6 output rework: one
|
|
22268
|
+
* `AudioDetection` per class above `minScore`, top-N candidates in
|
|
22269
|
+
* `debug.alternateLabels['audio-classifier']`, per-source timings in
|
|
22270
|
+
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
22271
|
+
* benchmark UI can still report a clean failure when the classifier
|
|
22272
|
+
* cap isn't available.
|
|
22273
|
+
*/
|
|
22274
|
+
var AudioTestResultSchema = object({
|
|
22275
|
+
success: boolean(),
|
|
22276
|
+
error: string().optional(),
|
|
22277
|
+
frame: custom().optional()
|
|
22278
|
+
});
|
|
22279
|
+
var PipelineConfigBridge = custom();
|
|
22280
|
+
var ConfigUISchemaBridge = custom();
|
|
22281
|
+
var ConfigUISchemaNullableBridge = custom();
|
|
22282
|
+
var InferenceCapabilitiesBridge = custom();
|
|
22283
|
+
var ModelAvailabilityListBridge = custom();
|
|
22284
|
+
var PipelineRunResultBridge = custom();
|
|
22285
|
+
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
22286
|
+
modelId: string(),
|
|
22287
|
+
settings: record(string(), unknown()).readonly()
|
|
22288
|
+
}))), method(object({ steps: record(string(), object({
|
|
22289
|
+
modelId: string(),
|
|
22290
|
+
settings: record(string(), unknown()).readonly()
|
|
22291
|
+
})) }), object({ success: literal(true) }), {
|
|
22292
|
+
kind: "mutation",
|
|
22293
|
+
auth: "admin"
|
|
22294
|
+
}), method(object({ nodeId: string() }), object({
|
|
22295
|
+
success: literal(true),
|
|
22296
|
+
clearedDevices: number()
|
|
22297
|
+
}), {
|
|
22000
22298
|
kind: "mutation",
|
|
22001
22299
|
auth: "admin"
|
|
22002
|
-
}), method(
|
|
22003
|
-
|
|
22004
|
-
|
|
22005
|
-
|
|
22300
|
+
}), method(object({ nodeId: string() }), object({ unhealthy: array(object({
|
|
22301
|
+
/** `<backend>:<device>`, e.g. `openvino:gpu`. */
|
|
22302
|
+
deviceKey: string(),
|
|
22303
|
+
/**
|
|
22304
|
+
* `failed` — the per-device restart budget is exhausted; no pool
|
|
22305
|
+
* will be spawned until an operator re-arms it or the runner
|
|
22306
|
+
* respawns. `backoff` — under budget, waiting out the backoff (or
|
|
22307
|
+
* a cached pool observed dead and not yet condemned).
|
|
22308
|
+
*/
|
|
22309
|
+
state: _enum(["failed", "backoff"]),
|
|
22310
|
+
/** Epoch ms of the death that produced this state. */
|
|
22311
|
+
since: number(),
|
|
22312
|
+
/** Pool deaths inside the current window. */
|
|
22313
|
+
deaths: number(),
|
|
22314
|
+
/** The last death's message. */
|
|
22315
|
+
lastError: string()
|
|
22316
|
+
})).readonly() })), method(object({
|
|
22317
|
+
nodeId: string(),
|
|
22318
|
+
deviceKey: string()
|
|
22319
|
+
}), object({ rearmed: boolean() }), {
|
|
22006
22320
|
kind: "mutation",
|
|
22007
22321
|
auth: "admin"
|
|
22008
|
-
}), method(
|
|
22009
|
-
|
|
22010
|
-
|
|
22011
|
-
}), method(
|
|
22012
|
-
|
|
22013
|
-
|
|
22014
|
-
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
|
|
22018
|
-
|
|
22019
|
-
|
|
22020
|
-
|
|
22021
|
-
|
|
22022
|
-
|
|
22023
|
-
|
|
22024
|
-
|
|
22025
|
-
|
|
22026
|
-
|
|
22027
|
-
}),
|
|
22028
|
-
|
|
22029
|
-
|
|
22030
|
-
|
|
22031
|
-
|
|
22032
|
-
|
|
22033
|
-
|
|
22034
|
-
|
|
22322
|
+
}), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({
|
|
22323
|
+
steps: array(PipelineStepInputSchema),
|
|
22324
|
+
deviceKey: string().optional()
|
|
22325
|
+
}), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
|
|
22326
|
+
name: string(),
|
|
22327
|
+
steps: array(PipelineTemplateStepSchema).readonly(),
|
|
22328
|
+
engine: PipelineEngineChoiceSchema
|
|
22329
|
+
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
|
|
22330
|
+
id: string(),
|
|
22331
|
+
name: string().optional(),
|
|
22332
|
+
steps: array(PipelineTemplateStepSchema).readonly().optional()
|
|
22333
|
+
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
|
|
22334
|
+
addonId: string(),
|
|
22335
|
+
modelId: string(),
|
|
22336
|
+
format: ModelFormatSchema$1
|
|
22337
|
+
}), DownloadModelResultSchema, { kind: "mutation" }), method(object({
|
|
22338
|
+
addonId: string(),
|
|
22339
|
+
modelId: string(),
|
|
22340
|
+
format: ModelFormatSchema$1
|
|
22341
|
+
}), object({ success: literal(true) }), { kind: "mutation" }), method(object({
|
|
22342
|
+
steps: array(PipelineStepInputSchema).min(1),
|
|
22343
|
+
frame: FrameInputSchema.optional(),
|
|
22344
|
+
/**
|
|
22345
|
+
* Process-local lazy frame. Valid only when caller and provider resolve
|
|
22346
|
+
* in the same execution-group process; split/cross-node callers use
|
|
22347
|
+
* `frame`/`image` inline compatibility instead.
|
|
22348
|
+
*/
|
|
22349
|
+
frameRef: FrameRefSchema.optional(),
|
|
22350
|
+
/**
|
|
22351
|
+
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
22352
|
+
* the decoded pixels live in. One more member of the one-of
|
|
22353
|
+
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
22354
|
+
*/
|
|
22355
|
+
frameHandle: FrameHandleSchema.optional(),
|
|
22356
|
+
imageBase64: string().optional(),
|
|
22357
|
+
/**
|
|
22358
|
+
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
22359
|
+
* hops (hub → forked worker via Moleculer MsgPack) because it
|
|
22360
|
+
* skips the 33% base64 overhead + the per-call base64 decode on
|
|
22361
|
+
* the detection-pipeline worker. Callers can pass either; exactly
|
|
22362
|
+
* one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
|
|
22363
|
+
*/
|
|
22364
|
+
image: _instanceof(Uint8Array).optional(),
|
|
22365
|
+
referenceImage: string().optional(),
|
|
22366
|
+
deviceId: number().optional(),
|
|
22367
|
+
sessionId: string().optional(),
|
|
22368
|
+
/**
|
|
22369
|
+
* Execution plane. 'full' (default) runs the whole tree — benchmark,
|
|
22370
|
+
* reference-image, and detail-subtree calls. 'frame' is the live
|
|
22371
|
+
* per-frame dispatch: ONLY root-plane steps run; crop children
|
|
22372
|
+
* (inputClasses ≠ null) are skipped and served per-track via
|
|
22373
|
+
* pipelineRunner.runDetailSubtree (two-plane design).
|
|
22374
|
+
*/
|
|
22375
|
+
plane: _enum(["full", "frame"]).optional(),
|
|
22376
|
+
/**
|
|
22377
|
+
* Inference-device selector (Phase 2 multi-device). Format
|
|
22378
|
+
* `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
|
|
22379
|
+
* Omitted ⇒ the runner's default device (current single-engine
|
|
22380
|
+
* behaviour). Selects WHICH device pool of the node runs the call.
|
|
22381
|
+
*/
|
|
22382
|
+
deviceKey: string().optional(),
|
|
22383
|
+
/**
|
|
22384
|
+
* Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
|
|
22385
|
+
* when the parent crop was resolved from the frame's retained NATIVE
|
|
22386
|
+
* surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
|
|
22387
|
+
* child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
|
|
22388
|
+
* resolution from that surface — the SAME quality path faces already
|
|
22389
|
+
* had — instead of the downscaled parent tile. `handle` keys the native
|
|
22390
|
+
* surface (node-pinned to its owner); `cropFrameSpace` is the parent
|
|
22391
|
+
* crop's padded/clamped rectangle in FRAME-space pixels, used to compose
|
|
22392
|
+
* the executor's crop-normalized child ROI back into frame-normalized
|
|
22393
|
+
* coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
|
|
22394
|
+
* of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
|
|
22395
|
+
* (today's behaviour on the fallback path).
|
|
22396
|
+
*/
|
|
22397
|
+
nativeCropRef: NativeCropRefSchema.optional(),
|
|
22398
|
+
/**
|
|
22399
|
+
* Offline REPLAY of stored media for `deviceId` (D56, D646): the
|
|
22400
|
+
* camera's zone gate and overrides apply as live, every executing
|
|
22401
|
+
* step runs EXACTLY the model it names on the `deviceKey` pool it
|
|
22402
|
+
* names or the call refuses (`model-not-servable` /
|
|
22403
|
+
* `device-not-servable`), and nothing reaches the camera's live
|
|
22404
|
+
* trace stream. Absent ⇒ unchanged behaviour.
|
|
22405
|
+
*/
|
|
22406
|
+
replay: literal(true).optional()
|
|
22407
|
+
}), PipelineRunResultBridge, { kind: "mutation" }), method(object({
|
|
22408
|
+
steps: array(PipelineStepInputSchema).min(1),
|
|
22409
|
+
frames: array(FrameInputSchema).min(1).max(255),
|
|
22410
|
+
deviceId: number().optional(),
|
|
22411
|
+
sessionId: string().optional(),
|
|
22412
|
+
/**
|
|
22413
|
+
* Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
|
|
22414
|
+
* the batch to the Python pool's bench preprocess cache
|
|
22415
|
+
* (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
|
|
22416
|
+
* preprocessed ONCE and every later inference is a pure-inference cache
|
|
22417
|
+
* hit — the sustained-throughput run measures inference, not
|
|
22418
|
+
* decode+preprocess+infer. Omitted/0 for live frames (all different →
|
|
22419
|
+
* full preprocess every call, correct). Fresh per sustained run;
|
|
22420
|
+
* released via `uncacheFrame`.
|
|
22421
|
+
*/
|
|
22422
|
+
frameId: number().int().nonnegative().optional(),
|
|
22423
|
+
/** Inference-device selector (Phase 2 multi-device); see runPipeline. */
|
|
22424
|
+
deviceKey: string().optional()
|
|
22425
|
+
}), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
|
|
22426
|
+
data: _instanceof(Uint8Array),
|
|
22427
|
+
width: number().int().positive(),
|
|
22428
|
+
height: number().int().positive(),
|
|
22429
|
+
format: _enum([
|
|
22430
|
+
"rgb",
|
|
22431
|
+
"bgr",
|
|
22432
|
+
"gray"
|
|
22433
|
+
])
|
|
22434
|
+
}), object({
|
|
22435
|
+
frameId: number(),
|
|
22436
|
+
width: number(),
|
|
22437
|
+
height: number()
|
|
22438
|
+
}), { kind: "mutation" }), method(object({
|
|
22439
|
+
stepId: string(),
|
|
22440
|
+
frameId: number().int()
|
|
22441
|
+
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(object({ deviceKey: string().optional() }), EffectiveTuningSchema), method(_void(), array(object({
|
|
22442
|
+
engineKey: string(),
|
|
22443
|
+
engine: PipelineEngineChoiceSchema,
|
|
22444
|
+
modelsLoaded: array(string()).readonly(),
|
|
22445
|
+
inUseByCameras: array(number()).readonly(),
|
|
22446
|
+
/**
|
|
22447
|
+
* Origin of this resident factory.
|
|
22448
|
+
* - `runtime` — main camera-serving engine (no idle TTL).
|
|
22449
|
+
* - `device-pool` — a concurrent per-device pool (Phase 2
|
|
22450
|
+
* multi-device, keyed by `deviceKey`) resolved
|
|
22451
|
+
* via `resolveDeviceFactory`. Runs alongside the
|
|
22452
|
+
* `runtime` engine on a DIFFERENT accelerator
|
|
22453
|
+
* (NPU / iGPU / Coral) — this is how the
|
|
22454
|
+
* Engines tab shows all pools running at once.
|
|
22455
|
+
*/
|
|
22456
|
+
kind: _enum(["runtime", "device-pool"]),
|
|
22457
|
+
/** Native pid of the underlying Python pool (null when no pool). */
|
|
22458
|
+
poolPid: number().nullable(),
|
|
22459
|
+
/** ms since this factory was last used (null when not warm-tracked). */
|
|
22460
|
+
idleMs: number().nullable(),
|
|
22461
|
+
/** Idle TTL after which the factory self-evicts (null when not applicable). */
|
|
22462
|
+
idleTtlMs: number().nullable()
|
|
22463
|
+
})).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
|
|
22035
22464
|
kind: "mutation",
|
|
22036
22465
|
auth: "admin"
|
|
22037
22466
|
}), method(object({
|
|
22038
|
-
|
|
22039
|
-
|
|
22040
|
-
frameId: string()
|
|
22467
|
+
engine: PipelineEngineChoiceSchema,
|
|
22468
|
+
force: boolean().optional()
|
|
22041
22469
|
}), object({
|
|
22042
|
-
|
|
22043
|
-
|
|
22044
|
-
}), {
|
|
22045
|
-
kind: "mutation",
|
|
22046
|
-
auth: "admin"
|
|
22047
|
-
}), method(object({ frameId: string() }), object({
|
|
22048
|
-
base64: string(),
|
|
22049
|
-
width: number().int(),
|
|
22050
|
-
height: number().int()
|
|
22470
|
+
success: boolean(),
|
|
22471
|
+
reason: string().optional()
|
|
22051
22472
|
}), {
|
|
22052
|
-
kind: "query",
|
|
22053
|
-
auth: "admin"
|
|
22054
|
-
}), method(object({
|
|
22055
|
-
deviceId: number(),
|
|
22056
|
-
trackId: string(),
|
|
22057
|
-
frameId: string(),
|
|
22058
|
-
subject: RetrainAssistSubjectSchema,
|
|
22059
|
-
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
22060
|
-
nodeId: string().optional()
|
|
22061
|
-
}), RetrainAssistResultSchema, {
|
|
22062
|
-
kind: "mutation",
|
|
22063
|
-
auth: "admin"
|
|
22064
|
-
}), method(object({
|
|
22065
|
-
deviceId: number(),
|
|
22066
|
-
source: DetectionSourceSchema,
|
|
22067
|
-
zones: array(ZoneSchema).readonly().optional(),
|
|
22068
|
-
detectionRules: array(ZoneRuleSchema).readonly().optional(),
|
|
22069
|
-
zoneMembershipMinOverlap: number().min(0).max(1).optional(),
|
|
22070
|
-
frames: array(ReplayFrameInputSchema).min(1)
|
|
22071
|
-
}), RunReplayFrameProcessorResultSchema, {
|
|
22072
|
-
kind: "mutation",
|
|
22073
|
-
auth: "admin"
|
|
22074
|
-
}), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
|
|
22075
|
-
kind: "query",
|
|
22076
|
-
auth: "admin"
|
|
22077
|
-
}), method(object({
|
|
22078
|
-
deviceId: number(),
|
|
22079
|
-
trackId: string(),
|
|
22080
|
-
frameId: string(),
|
|
22081
|
-
annotations: array(RetrainAnnotationDraftSchema)
|
|
22082
|
-
}), array(RetrainAnnotationSchema).readonly(), {
|
|
22083
|
-
kind: "mutation",
|
|
22084
|
-
auth: "admin"
|
|
22085
|
-
}), method(object({
|
|
22086
|
-
deviceId: number(),
|
|
22087
|
-
trackId: string()
|
|
22088
|
-
}), RetrainTransitionResultSchema, {
|
|
22089
|
-
kind: "mutation",
|
|
22090
|
-
auth: "admin"
|
|
22091
|
-
}), method(object({
|
|
22092
|
-
deviceId: number(),
|
|
22093
|
-
trackId: string()
|
|
22094
|
-
}), RetrainTransitionResultSchema, {
|
|
22095
|
-
kind: "mutation",
|
|
22096
|
-
auth: "admin"
|
|
22097
|
-
}), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
|
|
22098
|
-
kind: "query",
|
|
22099
|
-
auth: "admin"
|
|
22100
|
-
}), method(object({
|
|
22101
|
-
/** Which of the three event tables owns the row. */
|
|
22102
|
-
ownerType: EventOwnerTypeSchema,
|
|
22103
|
-
/** The event's rowid in that table (D474: an event id is a number). */
|
|
22104
|
-
eventId: number().int(),
|
|
22105
|
-
kind: MediaFileKindEnum.optional(),
|
|
22106
|
-
deviceId: number()
|
|
22107
|
-
}), array(MediaFileSchema).readonly()), method(object({
|
|
22108
|
-
trackId: string(),
|
|
22109
|
-
kinds: array(MediaFileKindEnum).optional(),
|
|
22110
|
-
deviceId: number()
|
|
22111
|
-
}), array(MediaFileSchema).readonly()), method(object({
|
|
22112
|
-
trackId: string(),
|
|
22113
|
-
deviceId: number()
|
|
22114
|
-
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
22115
|
-
ownerType: EventOwnerTypeSchema,
|
|
22116
|
-
eventId: number().int(),
|
|
22117
|
-
deviceId: number()
|
|
22118
|
-
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
22119
|
-
deviceId: number(),
|
|
22120
|
-
ownerKind: MediaPresenceOwnerKindSchema,
|
|
22121
|
-
ownerIds: array(string()).max(5e3)
|
|
22122
|
-
}), array(string()).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
22123
22473
|
kind: "mutation",
|
|
22124
22474
|
auth: "admin"
|
|
22125
|
-
}), method(
|
|
22126
|
-
|
|
22127
|
-
|
|
22128
|
-
|
|
22129
|
-
|
|
22130
|
-
|
|
22131
|
-
frameWidth: number(),
|
|
22132
|
-
frameHeight: number(),
|
|
22133
|
-
detections: array(OverlayDetectionSchema).readonly()
|
|
22134
|
-
}), object({
|
|
22135
|
-
deviceId: number(),
|
|
22136
|
-
trackId: string(),
|
|
22137
|
-
className: string()
|
|
22138
|
-
}), object({
|
|
22139
|
-
deviceId: number(),
|
|
22140
|
-
trackId: string(),
|
|
22141
|
-
className: string(),
|
|
22142
|
-
durationMs: number()
|
|
22143
|
-
}), object({
|
|
22144
|
-
deviceId: number(),
|
|
22145
|
-
kind: EventKindSchema,
|
|
22146
|
-
eventId: string(),
|
|
22147
|
-
timestamp: number()
|
|
22148
|
-
});
|
|
22475
|
+
}), 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({
|
|
22476
|
+
addonId: string(),
|
|
22477
|
+
modelId: string(),
|
|
22478
|
+
filename: string().optional(),
|
|
22479
|
+
settings: record(string(), unknown()).optional()
|
|
22480
|
+
}), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
|
|
22149
22481
|
object({
|
|
22150
22482
|
activeCameras: number(),
|
|
22151
22483
|
throttledCameras: number(),
|
|
@@ -22171,6 +22503,66 @@ var CameraMetricsSchema = object({
|
|
|
22171
22503
|
});
|
|
22172
22504
|
var CameraMetricsWithDeviceIdSchema = CameraMetricsSchema.extend({ deviceId: number() });
|
|
22173
22505
|
/**
|
|
22506
|
+
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
22507
|
+
*
|
|
22508
|
+
* Zones describe **where** in the frame the operator wants to flag
|
|
22509
|
+
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
22510
|
+
* each pipeline stage uses them. Splitting the two means a single
|
|
22511
|
+
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
22512
|
+
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
22513
|
+
* — without three duplicated polygons.
|
|
22514
|
+
*
|
|
22515
|
+
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
22516
|
+
* `zones` device-state slice on every mutation. Consumers
|
|
22517
|
+
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
22518
|
+
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
22519
|
+
* mirror with `onChanged`).
|
|
22520
|
+
*
|
|
22521
|
+
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
22522
|
+
* survive resolution changes and stream profile switches.
|
|
22523
|
+
*
|
|
22524
|
+
* `kind` discriminates between full polygons (closed regions used
|
|
22525
|
+
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
22526
|
+
* line segments used for cross events). Onboard / firmware-reported
|
|
22527
|
+
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
22528
|
+
* task list.
|
|
22529
|
+
*/
|
|
22530
|
+
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
22531
|
+
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
22532
|
+
var PolygonPointSchema = object({
|
|
22533
|
+
x: number(),
|
|
22534
|
+
y: number()
|
|
22535
|
+
});
|
|
22536
|
+
/** A camera detection zone — pure geometry/identity. */
|
|
22537
|
+
var ZoneSchema = object({
|
|
22538
|
+
id: string(),
|
|
22539
|
+
name: string(),
|
|
22540
|
+
kind: ZoneKindEnum.default("polygon"),
|
|
22541
|
+
/** Polygon vertices, fraction of frame (0–1). */
|
|
22542
|
+
polygon: array(PolygonPointSchema).readonly(),
|
|
22543
|
+
/** Visual color for UI rendering. */
|
|
22544
|
+
color: string().default("#3b82f6")
|
|
22545
|
+
});
|
|
22546
|
+
DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).readonly()), method(object({
|
|
22547
|
+
deviceId: number(),
|
|
22548
|
+
zone: ZoneSchema
|
|
22549
|
+
}), _void(), {
|
|
22550
|
+
kind: "mutation",
|
|
22551
|
+
auth: "admin"
|
|
22552
|
+
}), method(object({
|
|
22553
|
+
deviceId: number(),
|
|
22554
|
+
zoneId: string()
|
|
22555
|
+
}), _void(), {
|
|
22556
|
+
kind: "mutation",
|
|
22557
|
+
auth: "admin"
|
|
22558
|
+
}), method(object({
|
|
22559
|
+
deviceId: number(),
|
|
22560
|
+
zone: ZoneSchema
|
|
22561
|
+
}), _void(), {
|
|
22562
|
+
kind: "mutation",
|
|
22563
|
+
auth: "admin"
|
|
22564
|
+
}), object({ zones: array(ZoneSchema).readonly() });
|
|
22565
|
+
/**
|
|
22174
22566
|
* A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
|
|
22175
22567
|
* decode worker resolves it against the RETAINED native frame's real pixel dims,
|
|
22176
22568
|
* so the caller supplies only the detection-res bbox divided by the detection
|
|
@@ -22357,7 +22749,17 @@ var DetailResultSchema = object({
|
|
|
22357
22749
|
/** Face short side (px) measured on the NATIVE crop surface. The `bbox`
|
|
22358
22750
|
* above is detection-frame px (≈6× smaller on a 4K camera) — min-face-size
|
|
22359
22751
|
* consumers MUST prefer this when present (2026-07-22 native-gate fix). */
|
|
22360
|
-
nativeFaceShortSidePx: number().optional()
|
|
22752
|
+
nativeFaceShortSidePx: number().optional(),
|
|
22753
|
+
/**
|
|
22754
|
+
* The five facial landmarks of a `face` detail, in the SAME frame space as
|
|
22755
|
+
* `bbox` (D644). Additive and optional: post-analysis stores them beside the
|
|
22756
|
+
* face's source frame so a future alignment can be re-derived exactly; a
|
|
22757
|
+
* runner that predates the field sends none and the face is stored without.
|
|
22758
|
+
*/
|
|
22759
|
+
landmarks: array(object({
|
|
22760
|
+
x: number(),
|
|
22761
|
+
y: number()
|
|
22762
|
+
})).optional()
|
|
22361
22763
|
});
|
|
22362
22764
|
/**
|
|
22363
22765
|
* Why an executing node REFUSED a stateless step run (`runStatelessStep`).
|
|
@@ -22612,6 +23014,17 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
|
|
|
22612
23014
|
hubHostnameOverride: string().optional()
|
|
22613
23015
|
})]).describe("Per-camera frame-source mode for the runner (P2c)");
|
|
22614
23016
|
/**
|
|
23017
|
+
* What ONE step runs with on ONE roster device for THIS camera (D650): the
|
|
23018
|
+
* device's per-(node,device) base with the camera's override for that device
|
|
23019
|
+
* on top — the same `override ?? base` merge the orchestrator applies to the
|
|
23020
|
+
* elected device (`applyDeviceProvisioning`). Absent `modelId` ⇒ the executor
|
|
23021
|
+
* resolves the device format's default, exactly as on the elected device.
|
|
23022
|
+
*/
|
|
23023
|
+
var RunnerJumpStepProvisioningSchema = object({
|
|
23024
|
+
modelId: string().optional(),
|
|
23025
|
+
settings: record(string(), unknown()).optional()
|
|
23026
|
+
});
|
|
23027
|
+
/**
|
|
22615
23028
|
* One ENABLED inference device on the runner's node, as the step-tree
|
|
22616
23029
|
* device-jump resolver sees it (phase 1). The orchestrator populates this
|
|
22617
23030
|
* roster on the attach payload whenever the camera is elected onto a specific
|
|
@@ -22623,7 +23036,16 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
|
|
|
22623
23036
|
var RunnerInferenceDeviceSchema = object({
|
|
22624
23037
|
deviceKey: string(),
|
|
22625
23038
|
weight: number().positive().default(1),
|
|
22626
|
-
maxSessions: number().int().positive().nullable().default(null)
|
|
23039
|
+
maxSessions: number().int().positive().nullable().default(null),
|
|
23040
|
+
/**
|
|
23041
|
+
* Per-step provisioning for this camera on THIS device (D650), keyed by step
|
|
23042
|
+
* id. A step the runner jumps here runs with these fields, never with the
|
|
23043
|
+
* elected device's: `modelId` / `settings` are REPLACED on the jumped subtree
|
|
23044
|
+
* (a step absent from the map runs with neither — the target format default).
|
|
23045
|
+
* Absent field ⇒ an orchestrator that predates D650: the jumped step keeps
|
|
23046
|
+
* the elected device's provisioning, as before.
|
|
23047
|
+
*/
|
|
23048
|
+
steps: record(string(), RunnerJumpStepProvisioningSchema).optional()
|
|
22627
23049
|
});
|
|
22628
23050
|
/**
|
|
22629
23051
|
* Camera assignment payload sent by `addon-pipeline-orchestrator` to a
|
|
@@ -23498,6 +23920,28 @@ var NodeInferenceDeviceSchema = object({
|
|
|
23498
23920
|
*/
|
|
23499
23921
|
exclusion: InferenceDeviceExclusionReasonSchema.nullable()
|
|
23500
23922
|
});
|
|
23923
|
+
/**
|
|
23924
|
+
* The operator's model choice for one cluster-scoped step, answered by the
|
|
23925
|
+
* addon that OWNS the `clusterModel:*` settings (D651). Three answers, never
|
|
23926
|
+
* folded: a written choice, a key nobody wrote (the cluster runs the default
|
|
23927
|
+
* BY ABSENCE), or no answer. A caller that rewrites an index acts only on the
|
|
23928
|
+
* first two, read twice and agreeing.
|
|
23929
|
+
*/
|
|
23930
|
+
var ClusterModelChoiceSchema = discriminatedUnion("kind", [
|
|
23931
|
+
object({
|
|
23932
|
+
kind: literal("stored"),
|
|
23933
|
+
modelId: string()
|
|
23934
|
+
}),
|
|
23935
|
+
object({
|
|
23936
|
+
kind: literal("absent"),
|
|
23937
|
+
defaultModelId: string()
|
|
23938
|
+
}),
|
|
23939
|
+
object({
|
|
23940
|
+
kind: literal("unreadable"),
|
|
23941
|
+
reason: _enum(CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS),
|
|
23942
|
+
error: string().optional()
|
|
23943
|
+
})
|
|
23944
|
+
]);
|
|
23501
23945
|
var NodeInferenceDevicesSchema = object({
|
|
23502
23946
|
nodeId: string(),
|
|
23503
23947
|
/** False when the node's platform-probe was unreachable (no live device set). */
|
|
@@ -23525,10 +23969,17 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
23525
23969
|
}), object({ success: literal(true) }), {
|
|
23526
23970
|
kind: "mutation",
|
|
23527
23971
|
auth: "admin"
|
|
23528
|
-
}), method(object({ deviceId: number() }), object({ deviceKey: string().nullable() })), method(_void(), object({
|
|
23972
|
+
}), method(object({ deviceId: number() }), object({ deviceKey: string().nullable() })), method(_void(), object({
|
|
23973
|
+
migrated: number(),
|
|
23974
|
+
skipped: array(object({
|
|
23975
|
+
deviceId: number(),
|
|
23976
|
+
targetNodeId: string(),
|
|
23977
|
+
reason: string()
|
|
23978
|
+
})).default([])
|
|
23979
|
+
}), {
|
|
23529
23980
|
kind: "mutation",
|
|
23530
23981
|
auth: "admin"
|
|
23531
|
-
}), 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({
|
|
23982
|
+
}), 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({
|
|
23532
23983
|
nodeId: string(),
|
|
23533
23984
|
capName: string(),
|
|
23534
23985
|
addonId: string()
|
|
@@ -25828,6 +26279,167 @@ DeviceType.Camera, method(object({
|
|
|
25828
26279
|
auth: "protected"
|
|
25829
26280
|
});
|
|
25830
26281
|
/**
|
|
26282
|
+
* LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
|
|
26283
|
+
* valutatore puro del suo FRONTE.
|
|
26284
|
+
*
|
|
26285
|
+
* Viveva dentro il builtin virtual-doorbell
|
|
26286
|
+
* (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
|
|
26287
|
+
* predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
|
|
26288
|
+
* `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
|
|
26289
|
+
* tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
|
|
26290
|
+
* fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
|
|
26291
|
+
* SPOSTA qui e il doorbell la ri-esporta.
|
|
26292
|
+
*
|
|
26293
|
+
* ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
|
|
26294
|
+
* due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
|
|
26295
|
+
* regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
|
|
26296
|
+
* booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
|
|
26297
|
+
*/
|
|
26298
|
+
/**
|
|
26299
|
+
* Known binary / switch source caps → the boolean slice field whose
|
|
26300
|
+
* false→true rise counts as ACTIVE. Every entry is "fire on active".
|
|
26301
|
+
* Sensors whose "active" reading is not a plain boolean (presence's string
|
|
26302
|
+
* state, connectivity's connected flag) are deliberately excluded — a
|
|
26303
|
+
* reconnect is not a doorbell press, and it is not a recording either.
|
|
26304
|
+
*/
|
|
26305
|
+
var SOURCE_CAP_ACTIVE_FIELD = {
|
|
26306
|
+
contact: "entryOpen",
|
|
26307
|
+
binary: "on",
|
|
26308
|
+
switch: "on",
|
|
26309
|
+
motion: "detected",
|
|
26310
|
+
flood: "flooded",
|
|
26311
|
+
gas: "detected",
|
|
26312
|
+
smoke: "detected",
|
|
26313
|
+
"carbon-monoxide": "detected",
|
|
26314
|
+
vibration: "detected",
|
|
26315
|
+
tamper: "tampered"
|
|
26316
|
+
};
|
|
26317
|
+
object({
|
|
26318
|
+
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
26319
|
+
lastPressedAt: number().nullable(),
|
|
26320
|
+
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
26321
|
+
pressCountSinceStart: number()
|
|
26322
|
+
});
|
|
26323
|
+
object({
|
|
26324
|
+
deviceId: number(),
|
|
26325
|
+
timestamp: number()
|
|
26326
|
+
});
|
|
26327
|
+
/**
|
|
26328
|
+
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
26329
|
+
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
26330
|
+
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
26331
|
+
*/
|
|
26332
|
+
var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
|
|
26333
|
+
DeviceType.Camera;
|
|
26334
|
+
DeviceType.Button, DeviceType.Camera;
|
|
26335
|
+
var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
|
|
26336
|
+
DeviceType.Camera, DeviceType.Camera;
|
|
26337
|
+
/** A slot's editable value, discriminated on `slot`. */
|
|
26338
|
+
var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
|
|
26339
|
+
DeviceType.Camera;
|
|
26340
|
+
var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
|
|
26341
|
+
state: literal("unreachable"),
|
|
26342
|
+
reason: string()
|
|
26343
|
+
})]);
|
|
26344
|
+
/** One provider of slots — the D554 source-listing row. */
|
|
26345
|
+
var ExtensionSourceSchema = object({
|
|
26346
|
+
/** The routing prefix of every `slotRef` this provider serves. */
|
|
26347
|
+
source: string(),
|
|
26348
|
+
label: string(),
|
|
26349
|
+
/** Stamped by the dispatcher from the registry (D557). */
|
|
26350
|
+
addonId: string().optional(),
|
|
26351
|
+
availability: ExtensionSourceAvailabilitySchema
|
|
26352
|
+
});
|
|
26353
|
+
/**
|
|
26354
|
+
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
26355
|
+
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
26356
|
+
* (slice 2's cross-owner graft source); `unavailable` — it exists but is not a
|
|
26357
|
+
* valid source now (a container, which is never a pick). A source in any of
|
|
26358
|
+
* these states is SHOWN, never silently dropped or re-pointed.
|
|
26359
|
+
*/
|
|
26360
|
+
var ExtensionSourceHealthSchema = _enum([
|
|
26361
|
+
"ok",
|
|
26362
|
+
"missing",
|
|
26363
|
+
"foreign",
|
|
26364
|
+
"unavailable"
|
|
26365
|
+
]);
|
|
26366
|
+
var ExtensionSlotSourceSchema = object({
|
|
26367
|
+
deviceId: number().int(),
|
|
26368
|
+
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
26369
|
+
name: string().nullable(),
|
|
26370
|
+
health: ExtensionSourceHealthSchema,
|
|
26371
|
+
detail: string().optional()
|
|
26372
|
+
});
|
|
26373
|
+
/**
|
|
26374
|
+
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
26375
|
+
* reported read-only, named, never written through this contract (D62). The
|
|
26376
|
+
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
26377
|
+
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
26378
|
+
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
26379
|
+
*/
|
|
26380
|
+
var ExtensionSlotActivationSchema = object({
|
|
26381
|
+
state: _enum([
|
|
26382
|
+
"active",
|
|
26383
|
+
"inactive",
|
|
26384
|
+
"unknown"
|
|
26385
|
+
]),
|
|
26386
|
+
authority: string(),
|
|
26387
|
+
detail: string().optional()
|
|
26388
|
+
});
|
|
26389
|
+
var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
26390
|
+
state: literal("ok"),
|
|
26391
|
+
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
26392
|
+
slotRef: string(),
|
|
26393
|
+
slot: ExtensionSlotIdSchema,
|
|
26394
|
+
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
26395
|
+
authority: string(),
|
|
26396
|
+
/** graft: its switch. association: null — removing every source is "off". */
|
|
26397
|
+
enabled: boolean().nullable(),
|
|
26398
|
+
/** graft: the cap registered on the host. association: null. */
|
|
26399
|
+
projects: string().nullable(),
|
|
26400
|
+
activation: ExtensionSlotActivationSchema.nullable(),
|
|
26401
|
+
value: ExtensionSlotValueSchema,
|
|
26402
|
+
sources: array(ExtensionSlotSourceSchema)
|
|
26403
|
+
}), object({
|
|
26404
|
+
state: literal("unreachable"),
|
|
26405
|
+
addonId: string(),
|
|
26406
|
+
reason: string()
|
|
26407
|
+
})]);
|
|
26408
|
+
var ExtensionCandidatesSchema = object({ candidates: array(object({
|
|
26409
|
+
deviceId: number().int(),
|
|
26410
|
+
name: string(),
|
|
26411
|
+
type: string(),
|
|
26412
|
+
location: string().nullable(),
|
|
26413
|
+
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
26414
|
+
parentName: string().nullable(),
|
|
26415
|
+
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
26416
|
+
suggested: boolean(),
|
|
26417
|
+
/** Why it is suggested ("same location"), null when it is not. */
|
|
26418
|
+
reason: string().nullable()
|
|
26419
|
+
})) });
|
|
26420
|
+
/**
|
|
26421
|
+
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
26422
|
+
* reloaded the host (or, for an accessory child, its parent) because the
|
|
26423
|
+
* write changed what the host REGISTERS (a graft switched on or off, slice 2).
|
|
26424
|
+
*/
|
|
26425
|
+
var ExtensionSetResultSchema = object({
|
|
26426
|
+
applied: literal(true),
|
|
26427
|
+
reload: _enum([
|
|
26428
|
+
"none",
|
|
26429
|
+
"host",
|
|
26430
|
+
"parent"
|
|
26431
|
+
])
|
|
26432
|
+
});
|
|
26433
|
+
var ExtensionSlotRefInputSchema = object({
|
|
26434
|
+
deviceId: number().int(),
|
|
26435
|
+
slotRef: string().min(1)
|
|
26436
|
+
});
|
|
26437
|
+
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
26438
|
+
method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
26439
|
+
kind: "mutation",
|
|
26440
|
+
auth: "admin"
|
|
26441
|
+
});
|
|
26442
|
+
/**
|
|
25831
26443
|
* Optional client-side hints sent at session creation to help the provider
|
|
25832
26444
|
* pick the best native source. All fields optional — a viewer that knows
|
|
25833
26445
|
* nothing still gets a sane default. (Relocated from the retired `webrtc`
|
|
@@ -27616,17 +28228,6 @@ object({
|
|
|
27616
28228
|
deviceId: number(),
|
|
27617
28229
|
status: DeviceStatusSchema
|
|
27618
28230
|
});
|
|
27619
|
-
object({
|
|
27620
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
27621
|
-
lastPressedAt: number().nullable(),
|
|
27622
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
27623
|
-
pressCountSinceStart: number()
|
|
27624
|
-
});
|
|
27625
|
-
object({
|
|
27626
|
-
deviceId: number(),
|
|
27627
|
-
timestamp: number()
|
|
27628
|
-
});
|
|
27629
|
-
DeviceType.Button, DeviceType.Camera;
|
|
27630
28231
|
/**
|
|
27631
28232
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
27632
28233
|
* Drives HA `sensor` entries with `state_class: enum` (HVAC action
|
|
@@ -30682,7 +31283,7 @@ var HardwareInfoSchema = object({
|
|
|
30682
31283
|
coral: CoralInfoSchema.nullable().optional()
|
|
30683
31284
|
});
|
|
30684
31285
|
var PlatformScoreSchema = object({
|
|
30685
|
-
runtime:
|
|
31286
|
+
runtime: literal("python"),
|
|
30686
31287
|
backend: string(),
|
|
30687
31288
|
format: _enum([
|
|
30688
31289
|
"onnx",
|
|
@@ -30719,7 +31320,7 @@ var ModelRequirementSchema = object({
|
|
|
30719
31320
|
});
|
|
30720
31321
|
var ResolvedInferenceConfigSchema = object({
|
|
30721
31322
|
modelId: string(),
|
|
30722
|
-
runtime:
|
|
31323
|
+
runtime: literal("python"),
|
|
30723
31324
|
backend: string(),
|
|
30724
31325
|
format: ModelFormatSchema,
|
|
30725
31326
|
reason: string()
|
|
@@ -32926,6 +33527,92 @@ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSche
|
|
|
32926
33527
|
kind: "mutation",
|
|
32927
33528
|
auth: "admin"
|
|
32928
33529
|
});
|
|
33530
|
+
/**
|
|
33531
|
+
* Per-stage gating mode applied to the zones a rule references.
|
|
33532
|
+
*
|
|
33533
|
+
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
33534
|
+
* When at least one `include` rule fires for a stage, only entities
|
|
33535
|
+
* inside one of those zones pass that stage.
|
|
33536
|
+
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
33537
|
+
* Entities inside one of those zones are dropped at that stage.
|
|
33538
|
+
*
|
|
33539
|
+
* `monitor`-style observation (count without filtering) is not a rule
|
|
33540
|
+
* mode — zones without any matching rule are observed naturally by
|
|
33541
|
+
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
33542
|
+
* count, not filter" use case needs no rule at all.
|
|
33543
|
+
*/
|
|
33544
|
+
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
33545
|
+
/**
|
|
33546
|
+
* Per-consumer rule that references existing zones (geometry) and
|
|
33547
|
+
* defines how a specific pipeline stage should treat them. Each
|
|
33548
|
+
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
33549
|
+
* settings:
|
|
33550
|
+
*
|
|
33551
|
+
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
33552
|
+
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
33553
|
+
* - future: notification rules, audio gating, etc.
|
|
33554
|
+
*
|
|
33555
|
+
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
33556
|
+
* express "ignore motion in ALL of {garden, street}" with a single
|
|
33557
|
+
* rule. `classFilter` narrows the rule to specific object classes —
|
|
33558
|
+
* "drop person detections in the street, but keep cars" is one
|
|
33559
|
+
* `exclude` rule with `classFilter: ['person']`.
|
|
33560
|
+
*
|
|
33561
|
+
* `enabled` is a soft toggle — the operator can keep the rule
|
|
33562
|
+
* configured but inert without deleting it.
|
|
33563
|
+
*/
|
|
33564
|
+
var ZoneRuleSchema = object({
|
|
33565
|
+
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
33566
|
+
id: string(),
|
|
33567
|
+
/** Optional human-readable label rendered in the rule editor. */
|
|
33568
|
+
name: string().optional(),
|
|
33569
|
+
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
33570
|
+
* listed zones (OR-set: a detection in any one of them counts).
|
|
33571
|
+
* At least one zone id required — a rule with no targets is a
|
|
33572
|
+
* configuration mistake and the form validator rejects it. */
|
|
33573
|
+
zoneIds: array(string()).min(1).readonly(),
|
|
33574
|
+
mode: ZoneRuleModeEnum,
|
|
33575
|
+
/**
|
|
33576
|
+
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
33577
|
+
* applies to every class. Class strings match the `macroClass`
|
|
33578
|
+
* field on detections (e.g. `person`, `car`, `dog`).
|
|
33579
|
+
*/
|
|
33580
|
+
classFilter: array(string()).readonly().optional(),
|
|
33581
|
+
/**
|
|
33582
|
+
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
33583
|
+
* required to consider an entity "in the zone". Defaults to the
|
|
33584
|
+
* consumer's stage default when omitted. Kept for back-compat with
|
|
33585
|
+
* existing per-rule overrides; new operators pick the value via
|
|
33586
|
+
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
33587
|
+
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
33588
|
+
*/
|
|
33589
|
+
overlapThreshold: number().min(0).max(1).optional(),
|
|
33590
|
+
/**
|
|
33591
|
+
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
33592
|
+
* of the detection's bbox that must lie inside the zone for the
|
|
33593
|
+
* rule to match. Documented default is 85%; the engine substitutes
|
|
33594
|
+
* that when the field is omitted (kept optional so existing rules
|
|
33595
|
+
* stored without it stay valid).
|
|
33596
|
+
*
|
|
33597
|
+
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
33598
|
+
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
33599
|
+
* field exposed in the UI. Internally both feed the same gate.
|
|
33600
|
+
*/
|
|
33601
|
+
bboxInclusionPct: number().min(0).max(100).optional(),
|
|
33602
|
+
/**
|
|
33603
|
+
* When `true` and a detection has a segmentation mask, use the
|
|
33604
|
+
* mask for overlap instead of the bbox. Detection-stage only;
|
|
33605
|
+
* motion rules ignore this field.
|
|
33606
|
+
*/
|
|
33607
|
+
preferMask: boolean().optional(),
|
|
33608
|
+
/**
|
|
33609
|
+
* Soft-toggle: `false` disables the rule without deleting it.
|
|
33610
|
+
* Defaults to `true` so operators creating a rule via the UI
|
|
33611
|
+
* see it active immediately.
|
|
33612
|
+
*/
|
|
33613
|
+
enabled: boolean().default(true)
|
|
33614
|
+
});
|
|
33615
|
+
array(ZoneRuleSchema).readonly();
|
|
32929
33616
|
object({
|
|
32930
33617
|
/** Whether the script is currently executing. */
|
|
32931
33618
|
isRunning: boolean(),
|
|
@@ -34307,42 +34994,6 @@ DeviceType.Camera, method(object({
|
|
|
34307
34994
|
package: array(ZoneRuleSchema).readonly()
|
|
34308
34995
|
});
|
|
34309
34996
|
/**
|
|
34310
|
-
* LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
|
|
34311
|
-
* valutatore puro del suo FRONTE.
|
|
34312
|
-
*
|
|
34313
|
-
* Viveva dentro il builtin virtual-doorbell
|
|
34314
|
-
* (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
|
|
34315
|
-
* predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
|
|
34316
|
-
* `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
|
|
34317
|
-
* tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
|
|
34318
|
-
* fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
|
|
34319
|
-
* SPOSTA qui e il doorbell la ri-esporta.
|
|
34320
|
-
*
|
|
34321
|
-
* ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
|
|
34322
|
-
* due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
|
|
34323
|
-
* regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
|
|
34324
|
-
* booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
|
|
34325
|
-
*/
|
|
34326
|
-
/**
|
|
34327
|
-
* Known binary / switch source caps → the boolean slice field whose
|
|
34328
|
-
* false→true rise counts as ACTIVE. Every entry is "fire on active".
|
|
34329
|
-
* Sensors whose "active" reading is not a plain boolean (presence's string
|
|
34330
|
-
* state, connectivity's connected flag) are deliberately excluded — a
|
|
34331
|
-
* reconnect is not a doorbell press, and it is not a recording either.
|
|
34332
|
-
*/
|
|
34333
|
-
var SOURCE_CAP_ACTIVE_FIELD = {
|
|
34334
|
-
contact: "entryOpen",
|
|
34335
|
-
binary: "on",
|
|
34336
|
-
switch: "on",
|
|
34337
|
-
motion: "detected",
|
|
34338
|
-
flood: "flooded",
|
|
34339
|
-
gas: "detected",
|
|
34340
|
-
smoke: "detected",
|
|
34341
|
-
"carbon-monoxide": "detected",
|
|
34342
|
-
vibration: "detected",
|
|
34343
|
-
tamper: "tampered"
|
|
34344
|
-
};
|
|
34345
|
-
/**
|
|
34346
34997
|
* Accessory device helpers — shared across drivers.
|
|
34347
34998
|
*
|
|
34348
34999
|
* Many vendor-specific drivers register accessory child devices on
|
|
@@ -37142,6 +37793,30 @@ Object.freeze({
|
|
|
37142
37793
|
addonId: null,
|
|
37143
37794
|
access: "create"
|
|
37144
37795
|
},
|
|
37796
|
+
"deviceExtension.listCandidates": {
|
|
37797
|
+
capName: "device-extension",
|
|
37798
|
+
capScope: "device",
|
|
37799
|
+
addonId: null,
|
|
37800
|
+
access: "view"
|
|
37801
|
+
},
|
|
37802
|
+
"deviceExtension.listSlots": {
|
|
37803
|
+
capName: "device-extension",
|
|
37804
|
+
capScope: "device",
|
|
37805
|
+
addonId: null,
|
|
37806
|
+
access: "view"
|
|
37807
|
+
},
|
|
37808
|
+
"deviceExtension.listSources": {
|
|
37809
|
+
capName: "device-extension",
|
|
37810
|
+
capScope: "device",
|
|
37811
|
+
addonId: null,
|
|
37812
|
+
access: "view"
|
|
37813
|
+
},
|
|
37814
|
+
"deviceExtension.setSlot": {
|
|
37815
|
+
capName: "device-extension",
|
|
37816
|
+
capScope: "device",
|
|
37817
|
+
addonId: null,
|
|
37818
|
+
access: "create"
|
|
37819
|
+
},
|
|
37145
37820
|
"deviceManager.addLocation": {
|
|
37146
37821
|
capName: "device-manager",
|
|
37147
37822
|
capScope: "system",
|
|
@@ -37892,6 +38567,12 @@ Object.freeze({
|
|
|
37892
38567
|
addonId: null,
|
|
37893
38568
|
access: "view"
|
|
37894
38569
|
},
|
|
38570
|
+
"embeddingEncoder.resetFailedModels": {
|
|
38571
|
+
capName: "embedding-encoder",
|
|
38572
|
+
capScope: "system",
|
|
38573
|
+
addonId: null,
|
|
38574
|
+
access: "delete"
|
|
38575
|
+
},
|
|
37895
38576
|
"enumSensor.getStatus": {
|
|
37896
38577
|
capName: "enum-sensor",
|
|
37897
38578
|
capScope: "device",
|
|
@@ -39278,6 +39959,12 @@ Object.freeze({
|
|
|
39278
39959
|
addonId: null,
|
|
39279
39960
|
access: "view"
|
|
39280
39961
|
},
|
|
39962
|
+
"notificationRules.previewStateSummary": {
|
|
39963
|
+
capName: "notification-rules",
|
|
39964
|
+
capScope: "system",
|
|
39965
|
+
addonId: null,
|
|
39966
|
+
access: "view"
|
|
39967
|
+
},
|
|
39281
39968
|
"notificationRules.previewTemplate": {
|
|
39282
39969
|
capName: "notification-rules",
|
|
39283
39970
|
capScope: "system",
|
|
@@ -39854,12 +40541,6 @@ Object.freeze({
|
|
|
39854
40541
|
addonId: null,
|
|
39855
40542
|
access: "create"
|
|
39856
40543
|
},
|
|
39857
|
-
"pipelineAnalytics.runReplayFrameProcessor": {
|
|
39858
|
-
capName: "pipeline-analytics",
|
|
39859
|
-
capScope: "device",
|
|
39860
|
-
addonId: null,
|
|
39861
|
-
access: "create"
|
|
39862
|
-
},
|
|
39863
40544
|
"pipelineAnalytics.saveRetrainAnnotations": {
|
|
39864
40545
|
capName: "pipeline-analytics",
|
|
39865
40546
|
capScope: "device",
|
|
@@ -40226,6 +40907,12 @@ Object.freeze({
|
|
|
40226
40907
|
addonId: null,
|
|
40227
40908
|
access: "view"
|
|
40228
40909
|
},
|
|
40910
|
+
"pipelineOrchestrator.getClusterModelChoice": {
|
|
40911
|
+
capName: "pipeline-orchestrator",
|
|
40912
|
+
capScope: "system",
|
|
40913
|
+
addonId: null,
|
|
40914
|
+
access: "view"
|
|
40915
|
+
},
|
|
40229
40916
|
"pipelineOrchestrator.getDeviceLiveContribution": {
|
|
40230
40917
|
capName: "pipeline-orchestrator",
|
|
40231
40918
|
capScope: "system",
|
|
@@ -43051,6 +43738,26 @@ Object.freeze({
|
|
|
43051
43738
|
form: "single",
|
|
43052
43739
|
optional: false
|
|
43053
43740
|
}],
|
|
43741
|
+
"deviceExtension.listCandidates": [{
|
|
43742
|
+
name: "deviceId",
|
|
43743
|
+
form: "single",
|
|
43744
|
+
optional: false
|
|
43745
|
+
}],
|
|
43746
|
+
"deviceExtension.listSlots": [{
|
|
43747
|
+
name: "deviceId",
|
|
43748
|
+
form: "single",
|
|
43749
|
+
optional: false
|
|
43750
|
+
}],
|
|
43751
|
+
"deviceExtension.listSources": [{
|
|
43752
|
+
name: "deviceId",
|
|
43753
|
+
form: "single",
|
|
43754
|
+
optional: false
|
|
43755
|
+
}],
|
|
43756
|
+
"deviceExtension.setSlot": [{
|
|
43757
|
+
name: "deviceId",
|
|
43758
|
+
form: "single",
|
|
43759
|
+
optional: false
|
|
43760
|
+
}],
|
|
43054
43761
|
"deviceManager.adoptionRelease": [{
|
|
43055
43762
|
name: "camDeviceId",
|
|
43056
43763
|
form: "single",
|
|
@@ -43957,11 +44664,6 @@ Object.freeze({
|
|
|
43957
44664
|
form: "single",
|
|
43958
44665
|
optional: false
|
|
43959
44666
|
}],
|
|
43960
|
-
"pipelineAnalytics.runReplayFrameProcessor": [{
|
|
43961
|
-
name: "deviceId",
|
|
43962
|
-
form: "single",
|
|
43963
|
-
optional: false
|
|
43964
|
-
}],
|
|
43965
44667
|
"pipelineAnalytics.saveRetrainAnnotations": [{
|
|
43966
44668
|
name: "deviceId",
|
|
43967
44669
|
form: "single",
|
|
@@ -44850,12 +45552,55 @@ var NC_AUDIO_DEFAULTS = {
|
|
|
44850
45552
|
samplingSeconds: 10
|
|
44851
45553
|
};
|
|
44852
45554
|
new Set(["devices", "classes"]);
|
|
44853
|
-
/**
|
|
45555
|
+
/**
|
|
45556
|
+
* WHICH narrowing filter speaks about WHICH system-event kind — one predicate,
|
|
45557
|
+
* consumed by the rule ENGINE and by every rule EDITOR.
|
|
45558
|
+
*
|
|
45559
|
+
* ── The failure this file exists for ───────────────────────────────────────
|
|
45560
|
+
* `NcSystemEventConditionSchema` carries four optional narrowing lists
|
|
45561
|
+
* (`deviceIds`, `deviceTypes`, `nodeIds`, `packageNames`) beside a required
|
|
45562
|
+
* `kinds` gate. They are not four filters over one vocabulary: each belongs to
|
|
45563
|
+
* a FAMILY of kinds and is meaningless outside it. A node going away has no
|
|
45564
|
+
* device type; a completed export has no package; `stream-offline` deliberately
|
|
45565
|
+
* carries no device type at all (a stream belongs to a camera by construction).
|
|
45566
|
+
*
|
|
45567
|
+
* The engine applied all four to every kind, so a filter from one family failed
|
|
45568
|
+
* a kind from another family CLOSED. The operator's live rule "Eventi di
|
|
45569
|
+
* sistema" selected eleven kinds and set `deviceTypes: ['camera']` — the only
|
|
45570
|
+
* way to say "only my cameras" about the two liveness kinds — and NINE of the
|
|
45571
|
+
* eleven silently stopped being deliverable. Four days of history contained
|
|
45572
|
+
* `device-online` and `device-offline` and nothing else, across a window in
|
|
45573
|
+
* which agents were restarted and addons were updated.
|
|
45574
|
+
*
|
|
45575
|
+
* Both editors already computed this scoping, to decide which filter boxes to
|
|
45576
|
+
* render; the cap's own docblock already promised it ("Narrow a `device-*` kind
|
|
45577
|
+
* to these device TYPES"). Only the engine disagreed, and it disagreed in the
|
|
45578
|
+
* destructive direction. So the rule is stated ONCE, here, and the engine and
|
|
45579
|
+
* the editors are readers of it rather than three independent authors.
|
|
45580
|
+
*
|
|
45581
|
+
* ── The direction ─────────────────────────────────────────────────────────
|
|
45582
|
+
* Out of family ⇒ the filter is IGNORED, never fail-closed. An editor that
|
|
45583
|
+
* hides a box has already told the operator this filter does not speak about
|
|
45584
|
+
* these kinds, so honouring it as an exclusion contradicts the only
|
|
45585
|
+
* explanation the operator was ever given. Inside its family the filter still
|
|
45586
|
+
* narrows, and still fails CLOSED on a subject that cannot produce the identity
|
|
45587
|
+
* it tests (a device the mirror cannot name is not evidence of a camera).
|
|
45588
|
+
*/
|
|
45589
|
+
/**
|
|
45590
|
+
* Every filter, for the callers that must cover all of them (guards, tests).
|
|
45591
|
+
*
|
|
45592
|
+
* `consumableLowPercent` (D642) is not a list but it is a filter in exactly
|
|
45593
|
+
* this sense: it belongs to a family of kinds (the consumable pair) and the
|
|
45594
|
+
* engine consults it only there. It differs in one way the readers must know —
|
|
45595
|
+
* its ABSENCE is not "no narrowing" but the default threshold, because a
|
|
45596
|
+
* consumable episode is always judged at SOME threshold.
|
|
45597
|
+
*/
|
|
44854
45598
|
var NC_SYSTEM_EVENT_FILTER_KEYS = [
|
|
44855
45599
|
"deviceIds",
|
|
44856
45600
|
"deviceTypes",
|
|
44857
45601
|
"nodeIds",
|
|
44858
|
-
"packageNames"
|
|
45602
|
+
"packageNames",
|
|
45603
|
+
"consumableLowPercent"
|
|
44859
45604
|
];
|
|
44860
45605
|
new Map(Object.entries({
|
|
44861
45606
|
"device-online": "device-events",
|
|
@@ -44866,6 +45611,9 @@ new Map(Object.entries({
|
|
|
44866
45611
|
"device-battery-normal": "device-events",
|
|
44867
45612
|
"device-consumable-low": "device-events",
|
|
44868
45613
|
"device-consumable-normal": "device-events",
|
|
45614
|
+
"device-tank-low": "device-events",
|
|
45615
|
+
"device-tank-full": "device-events",
|
|
45616
|
+
"device-tank-normal": "device-events",
|
|
44869
45617
|
"stream-online": "device-events",
|
|
44870
45618
|
"stream-offline": "device-events",
|
|
44871
45619
|
"detection-blind": "device-events",
|
|
@@ -44895,6 +45643,98 @@ new Map(Object.entries({
|
|
|
44895
45643
|
"camera-enabled": null
|
|
44896
45644
|
}));
|
|
44897
45645
|
[...NC_SYSTEM_EVENT_FILTER_KEYS];
|
|
45646
|
+
var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
|
|
45647
|
+
{
|
|
45648
|
+
id: "device-state",
|
|
45649
|
+
family: "device-events",
|
|
45650
|
+
label: "Device state",
|
|
45651
|
+
kinds: [
|
|
45652
|
+
"device-offline",
|
|
45653
|
+
"device-online",
|
|
45654
|
+
"device-disabled",
|
|
45655
|
+
"device-enabled"
|
|
45656
|
+
]
|
|
45657
|
+
},
|
|
45658
|
+
{
|
|
45659
|
+
id: "streams",
|
|
45660
|
+
family: "device-events",
|
|
45661
|
+
label: "Streams",
|
|
45662
|
+
kinds: ["stream-offline", "stream-online"]
|
|
45663
|
+
},
|
|
45664
|
+
{
|
|
45665
|
+
id: "battery",
|
|
45666
|
+
family: "device-events",
|
|
45667
|
+
label: "Battery",
|
|
45668
|
+
kinds: ["device-battery-low", "device-battery-normal"]
|
|
45669
|
+
},
|
|
45670
|
+
{
|
|
45671
|
+
id: "consumables",
|
|
45672
|
+
family: "device-events",
|
|
45673
|
+
label: "Consumables",
|
|
45674
|
+
kinds: ["device-consumable-low", "device-consumable-normal"]
|
|
45675
|
+
},
|
|
45676
|
+
{
|
|
45677
|
+
id: "tanks",
|
|
45678
|
+
family: "device-events",
|
|
45679
|
+
label: "Tanks",
|
|
45680
|
+
kinds: [
|
|
45681
|
+
"device-tank-low",
|
|
45682
|
+
"device-tank-full",
|
|
45683
|
+
"device-tank-normal"
|
|
45684
|
+
]
|
|
45685
|
+
},
|
|
45686
|
+
{
|
|
45687
|
+
id: "detection-blind",
|
|
45688
|
+
family: "device-events",
|
|
45689
|
+
label: "Detecting nothing",
|
|
45690
|
+
kinds: ["detection-blind"]
|
|
45691
|
+
},
|
|
45692
|
+
{
|
|
45693
|
+
id: "nodes",
|
|
45694
|
+
family: "system",
|
|
45695
|
+
label: "Nodes",
|
|
45696
|
+
kinds: [
|
|
45697
|
+
"node-offline",
|
|
45698
|
+
"node-online",
|
|
45699
|
+
"node-inference-unavailable"
|
|
45700
|
+
]
|
|
45701
|
+
},
|
|
45702
|
+
{
|
|
45703
|
+
id: "addons",
|
|
45704
|
+
family: "system",
|
|
45705
|
+
label: "Addons",
|
|
45706
|
+
kinds: [
|
|
45707
|
+
"addon-crash-loop",
|
|
45708
|
+
"addon-update-available",
|
|
45709
|
+
"addon-updated"
|
|
45710
|
+
]
|
|
45711
|
+
},
|
|
45712
|
+
{
|
|
45713
|
+
id: "updates",
|
|
45714
|
+
family: "system",
|
|
45715
|
+
label: "Server & container updates",
|
|
45716
|
+
kinds: [
|
|
45717
|
+
"server-update-available",
|
|
45718
|
+
"server-updated",
|
|
45719
|
+
"wrapper-update-available"
|
|
45720
|
+
]
|
|
45721
|
+
},
|
|
45722
|
+
{
|
|
45723
|
+
id: "backups-exports",
|
|
45724
|
+
family: "system",
|
|
45725
|
+
label: "Backups & exports",
|
|
45726
|
+
kinds: ["backup-completed", "export-completed"]
|
|
45727
|
+
},
|
|
45728
|
+
{
|
|
45729
|
+
id: "alarm",
|
|
45730
|
+
family: "alarm",
|
|
45731
|
+
label: "Alarm",
|
|
45732
|
+
kinds: NC_ALARM_SYSTEM_EVENT_KINDS
|
|
45733
|
+
}
|
|
45734
|
+
];
|
|
45735
|
+
function systemEventKindsOfFamily(family) {
|
|
45736
|
+
return NC_SYSTEM_EVENT_KIND_GROUP_SPECS.filter((g) => g.family === family).flatMap((g) => g.kinds);
|
|
45737
|
+
}
|
|
44898
45738
|
NC_AUDIO_DEFAULTS.hitPercent, NC_AUDIO_DEFAULTS.samplingSeconds;
|
|
44899
45739
|
/**
|
|
44900
45740
|
* WHICH WAY A BOOLEAN SENSOR MOVED — read off the one slice a sensor event
|
|
@@ -44933,6 +45773,11 @@ var RULE_BODY_ONLY = ["body"];
|
|
|
44933
45773
|
var RULE_TEXT = ["title", "body"];
|
|
44934
45774
|
var BATTERY = ["device-battery-low", "device-battery-normal"];
|
|
44935
45775
|
var CONSUMABLE = ["device-consumable-low", "device-consumable-normal"];
|
|
45776
|
+
var TANK = [
|
|
45777
|
+
"device-tank-low",
|
|
45778
|
+
"device-tank-full",
|
|
45779
|
+
"device-tank-normal"
|
|
45780
|
+
];
|
|
44936
45781
|
var UPDATES = [
|
|
44937
45782
|
"addon-update-available",
|
|
44938
45783
|
"server-update-available",
|
|
@@ -44958,12 +45803,189 @@ var DEVICE_EVENTS = [
|
|
|
44958
45803
|
"device-enabled",
|
|
44959
45804
|
...BATTERY,
|
|
44960
45805
|
...CONSUMABLE,
|
|
45806
|
+
...TANK,
|
|
44961
45807
|
"stream-online",
|
|
44962
45808
|
"stream-offline",
|
|
44963
45809
|
"detection-blind",
|
|
44964
45810
|
...ALARM
|
|
44965
45811
|
];
|
|
44966
|
-
|
|
45812
|
+
/** Every kind a summary may speak about — the two summarisable families. */
|
|
45813
|
+
var SUMMARISABLE = [...systemEventKindsOfFamily("device-events"), ...systemEventKindsOfFamily("system")];
|
|
45814
|
+
/** One per summary SECTION (`NC_STATE_SUMMARY_SECTIONS` in the notification
|
|
45815
|
+
* centre): the section's lines, offered when one of its kinds is selected. */
|
|
45816
|
+
var STATE_SUMMARY_SECTION_VARS = [
|
|
45817
|
+
{
|
|
45818
|
+
name: "summaryDevices",
|
|
45819
|
+
label: "Summary: devices offline / switched off",
|
|
45820
|
+
example: "Garage — offline since 07:12",
|
|
45821
|
+
kinds: [
|
|
45822
|
+
"device-offline",
|
|
45823
|
+
"device-online",
|
|
45824
|
+
"device-disabled",
|
|
45825
|
+
"device-enabled"
|
|
45826
|
+
]
|
|
45827
|
+
},
|
|
45828
|
+
{
|
|
45829
|
+
name: "summaryStreams",
|
|
45830
|
+
label: "Summary: streams offline",
|
|
45831
|
+
example: "Ingresso (high) — since 06:40",
|
|
45832
|
+
kinds: ["stream-offline", "stream-online"]
|
|
45833
|
+
},
|
|
45834
|
+
{
|
|
45835
|
+
name: "summaryBattery",
|
|
45836
|
+
label: "Summary: low batteries",
|
|
45837
|
+
example: "Sensore porta — 8 %",
|
|
45838
|
+
kinds: BATTERY
|
|
45839
|
+
},
|
|
45840
|
+
{
|
|
45841
|
+
name: "summaryConsumables",
|
|
45842
|
+
label: "Summary: consumables",
|
|
45843
|
+
example: "Robot — filter 10 %",
|
|
45844
|
+
kinds: CONSUMABLE
|
|
45845
|
+
},
|
|
45846
|
+
{
|
|
45847
|
+
name: "summaryTanks",
|
|
45848
|
+
label: "Summary: tanks",
|
|
45849
|
+
example: "Robot — clean water low",
|
|
45850
|
+
kinds: TANK
|
|
45851
|
+
},
|
|
45852
|
+
{
|
|
45853
|
+
name: "summaryDetection",
|
|
45854
|
+
label: "Summary: cameras detecting nothing",
|
|
45855
|
+
example: "Ingresso — since 05:10",
|
|
45856
|
+
kinds: ["detection-blind"]
|
|
45857
|
+
},
|
|
45858
|
+
{
|
|
45859
|
+
name: "summaryNodes",
|
|
45860
|
+
label: "Summary: nodes",
|
|
45861
|
+
example: "little-unraid — offline since 03:00",
|
|
45862
|
+
kinds: [
|
|
45863
|
+
"node-offline",
|
|
45864
|
+
"node-online",
|
|
45865
|
+
"node-inference-unavailable"
|
|
45866
|
+
]
|
|
45867
|
+
},
|
|
45868
|
+
{
|
|
45869
|
+
name: "summaryAddons",
|
|
45870
|
+
label: "Summary: addons",
|
|
45871
|
+
example: "@camstack/addon-recorder 1.2.3 → 1.2.4",
|
|
45872
|
+
kinds: [
|
|
45873
|
+
"addon-crash-loop",
|
|
45874
|
+
"addon-update-available",
|
|
45875
|
+
"addon-updated"
|
|
45876
|
+
]
|
|
45877
|
+
},
|
|
45878
|
+
{
|
|
45879
|
+
name: "summaryUpdates",
|
|
45880
|
+
label: "Summary: server & container updates",
|
|
45881
|
+
example: "server 1.2.377 → 1.2.378",
|
|
45882
|
+
kinds: [
|
|
45883
|
+
"server-update-available",
|
|
45884
|
+
"server-updated",
|
|
45885
|
+
"wrapper-update-available"
|
|
45886
|
+
]
|
|
45887
|
+
}
|
|
45888
|
+
];
|
|
45889
|
+
var STATE_SUMMARY_VARS = [
|
|
45890
|
+
{
|
|
45891
|
+
name: "summaryText",
|
|
45892
|
+
label: "Summary: every section",
|
|
45893
|
+
description: "One block per section with something to report, one line per item.",
|
|
45894
|
+
example: "Batterie scariche: Sensore porta — 8 %",
|
|
45895
|
+
group: "system",
|
|
45896
|
+
families: ["rule"],
|
|
45897
|
+
fields: [...RULE_TEXT],
|
|
45898
|
+
kinds: ["system"],
|
|
45899
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
45900
|
+
systemEventDeliveries: ["summary"]
|
|
45901
|
+
},
|
|
45902
|
+
{
|
|
45903
|
+
name: "summaryCount",
|
|
45904
|
+
label: "Summary: items reported",
|
|
45905
|
+
example: "3",
|
|
45906
|
+
group: "system",
|
|
45907
|
+
families: ["rule"],
|
|
45908
|
+
fields: [...RULE_TEXT],
|
|
45909
|
+
kinds: ["system"],
|
|
45910
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
45911
|
+
systemEventDeliveries: ["summary"]
|
|
45912
|
+
},
|
|
45913
|
+
...STATE_SUMMARY_SECTION_VARS.map((v) => ({
|
|
45914
|
+
name: v.name,
|
|
45915
|
+
label: v.label,
|
|
45916
|
+
example: v.example,
|
|
45917
|
+
group: "system",
|
|
45918
|
+
families: ["rule"],
|
|
45919
|
+
fields: [...RULE_TEXT],
|
|
45920
|
+
kinds: ["system"],
|
|
45921
|
+
systemEventKinds: [...v.kinds],
|
|
45922
|
+
systemEventDeliveries: ["summary"]
|
|
45923
|
+
}))
|
|
45924
|
+
];
|
|
45925
|
+
[
|
|
45926
|
+
[...DEVICE_EVENTS],
|
|
45927
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45928
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45929
|
+
[...RULE_TEXT],
|
|
45930
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45931
|
+
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
45932
|
+
[...RULE_TEXT],
|
|
45933
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45934
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45935
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
45936
|
+
[...RULE_TEXT],
|
|
45937
|
+
[...RULE_TEXT],
|
|
45938
|
+
[...RULE_TEXT],
|
|
45939
|
+
[...RULE_TEXT],
|
|
45940
|
+
[...RULE_TEXT],
|
|
45941
|
+
[...RULE_TEXT],
|
|
45942
|
+
[...RULE_TEXT],
|
|
45943
|
+
[...RULE_TEXT],
|
|
45944
|
+
[...RULE_BODY_ONLY],
|
|
45945
|
+
[...RULE_TEXT],
|
|
45946
|
+
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
45947
|
+
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
45948
|
+
([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
|
|
45949
|
+
([...RULE_TEXT], [...CONSUMABLE]),
|
|
45950
|
+
([...RULE_TEXT], [...TANK]),
|
|
45951
|
+
[...RULE_TEXT],
|
|
45952
|
+
([...RULE_TEXT], [...UPDATES]),
|
|
45953
|
+
([...RULE_TEXT], [...UPDATES]),
|
|
45954
|
+
[...RULE_TEXT],
|
|
45955
|
+
[...RULE_TEXT],
|
|
45956
|
+
[...RULE_TEXT],
|
|
45957
|
+
([...RULE_TEXT], [...UPDATES]),
|
|
45958
|
+
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
45959
|
+
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
45960
|
+
([...RULE_TEXT], [...UPDATES]),
|
|
45961
|
+
([...RULE_TEXT], [...UPDATES]),
|
|
45962
|
+
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
45963
|
+
[...RULE_TEXT],
|
|
45964
|
+
[...RULE_TEXT],
|
|
45965
|
+
[...RULE_TEXT],
|
|
45966
|
+
[...RULE_TEXT],
|
|
45967
|
+
[...RULE_TEXT],
|
|
45968
|
+
[...RULE_TEXT],
|
|
45969
|
+
[...RULE_TEXT],
|
|
45970
|
+
[...RULE_TEXT],
|
|
45971
|
+
[...RULE_TEXT],
|
|
45972
|
+
[...RULE_TEXT],
|
|
45973
|
+
[...RULE_TEXT],
|
|
45974
|
+
[...RULE_TEXT],
|
|
45975
|
+
[...RULE_TEXT],
|
|
45976
|
+
[...RULE_TEXT],
|
|
45977
|
+
[...RULE_TEXT],
|
|
45978
|
+
[...RULE_TEXT],
|
|
45979
|
+
[...RULE_TEXT],
|
|
45980
|
+
[...RULE_TEXT],
|
|
45981
|
+
[...RULE_TEXT],
|
|
45982
|
+
[...RULE_TEXT],
|
|
45983
|
+
[...RULE_TEXT],
|
|
45984
|
+
[...RULE_TEXT],
|
|
45985
|
+
[...RULE_TEXT],
|
|
45986
|
+
[...RULE_TEXT],
|
|
45987
|
+
...STATE_SUMMARY_VARS
|
|
45988
|
+
];
|
|
44967
45989
|
/**
|
|
44968
45990
|
* TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
|
|
44969
45991
|
*
|
|
@@ -45195,68 +46217,6 @@ TimelapseRuleInputSchema.extend({
|
|
|
45195
46217
|
createdAt: number(),
|
|
45196
46218
|
updatedAt: number()
|
|
45197
46219
|
});
|
|
45198
|
-
Object.freeze(Object.fromEntries([{
|
|
45199
|
-
stepId: "face-embedding",
|
|
45200
|
-
label: "Face recognition model",
|
|
45201
|
-
defaultModelId: "arcface-r100",
|
|
45202
|
-
indexName: "the enrolled face gallery",
|
|
45203
|
-
options: [
|
|
45204
|
-
{
|
|
45205
|
-
id: "arcface-r100",
|
|
45206
|
-
label: "ArcFace (ResNet34)"
|
|
45207
|
-
},
|
|
45208
|
-
{
|
|
45209
|
-
id: "auraface-r100",
|
|
45210
|
-
label: "AuraFace R100"
|
|
45211
|
-
},
|
|
45212
|
-
{
|
|
45213
|
-
id: "inception-resnet-v1",
|
|
45214
|
-
label: "Inception ResNet V1"
|
|
45215
|
-
}
|
|
45216
|
-
]
|
|
45217
|
-
}, {
|
|
45218
|
-
stepId: "clip-embedding",
|
|
45219
|
-
label: "Semantic search model",
|
|
45220
|
-
defaultModelId: "mobileclip-s1",
|
|
45221
|
-
indexName: "the object semantic-search index",
|
|
45222
|
-
options: [{
|
|
45223
|
-
id: "mobileclip-s1",
|
|
45224
|
-
label: "MobileCLIP S1"
|
|
45225
|
-
}, {
|
|
45226
|
-
id: "mobileclip-s2",
|
|
45227
|
-
label: "MobileCLIP S2"
|
|
45228
|
-
}]
|
|
45229
|
-
}].map((s) => [s.stepId, s.defaultModelId])));
|
|
45230
|
-
string().min(1);
|
|
45231
|
-
var CLUSTER_STEP_SETTING_FIELDS = [{
|
|
45232
|
-
stepId: "face-embedding",
|
|
45233
|
-
key: "minLandmarkFaceSize",
|
|
45234
|
-
label: "Min face size for recognition (detection px)",
|
|
45235
|
-
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.",
|
|
45236
|
-
type: "slider",
|
|
45237
|
-
min: 0,
|
|
45238
|
-
max: 64,
|
|
45239
|
-
step: 2,
|
|
45240
|
-
default: 24
|
|
45241
|
-
}];
|
|
45242
|
-
function clusterStepSettingKey(stepId, fieldKey) {
|
|
45243
|
-
return `clusterStepSetting:${stepId}:${fieldKey}`;
|
|
45244
|
-
}
|
|
45245
|
-
var ClusterSettingNumberSchema = number().finite();
|
|
45246
|
-
function readClusterStepSettings(config) {
|
|
45247
|
-
const out = {};
|
|
45248
|
-
for (const field of CLUSTER_STEP_SETTING_FIELDS) {
|
|
45249
|
-
const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
|
|
45250
|
-
const value = parsed.success ? parsed.data : field.default;
|
|
45251
|
-
const existing = out[field.stepId] ?? {};
|
|
45252
|
-
out[field.stepId] = {
|
|
45253
|
-
...existing,
|
|
45254
|
-
[field.key]: value
|
|
45255
|
-
};
|
|
45256
|
-
}
|
|
45257
|
-
return out;
|
|
45258
|
-
}
|
|
45259
|
-
readClusterStepSettings({});
|
|
45260
46220
|
object({
|
|
45261
46221
|
/**
|
|
45262
46222
|
* Fraction of the box's own size added on EACH side before cutting.
|