@camstack/addon-post-analysis 1.2.284 → 1.2.285
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/THIRD_PARTY_MODELS.md +233 -0
- package/dist/{dist-C770IfQJ.mjs → dist-D2tXUMfE.mjs} +1014 -713
- package/dist/{dist-Bpx5JMso.js → dist-ITESpHou.js} +1049 -712
- package/dist/embedding-encoder/index.js +1 -1
- package/dist/embedding-encoder/index.mjs +1 -1
- package/dist/pipeline-analytics/_stub.js +2 -2
- package/dist/pipeline-analytics/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-Cc4KIQdo.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-7oasHfhD.mjs} +2 -2
- package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CjeM5Bph.mjs +26 -0
- package/dist/pipeline-analytics/{_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DWPDYuJS.mjs → _virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BidXbeas.mjs} +1 -1
- package/dist/pipeline-analytics/{hostInit-BzoLW-k9.mjs → hostInit-B6m75Rnz.mjs} +2 -2
- package/dist/pipeline-analytics/index.js +1860 -90
- package/dist/pipeline-analytics/index.mjs +1860 -90
- package/dist/pipeline-analytics/remoteEntry.js +1 -1
- package/package.json +3 -2
- package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CZkZhroP.mjs +0 -26
|
@@ -5360,7 +5360,7 @@ var ZodIssueCode = {
|
|
|
5360
5360
|
var ZodFirstPartyTypeKind;
|
|
5361
5361
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5362
5362
|
//#endregion
|
|
5363
|
-
//#region ../types/dist/sleep-
|
|
5363
|
+
//#region ../types/dist/sleep-BaRu0bS5.mjs
|
|
5364
5364
|
/**
|
|
5365
5365
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5366
5366
|
* window to float samples (D455).
|
|
@@ -10024,7 +10024,7 @@ var ModelFormatEntrySchema = object({
|
|
|
10024
10024
|
/** Multi-file payload (directory members or sibling files). */
|
|
10025
10025
|
files: array(string()).readonly().optional(),
|
|
10026
10026
|
/** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
|
|
10027
|
-
runtimes: array(_enum(["
|
|
10027
|
+
runtimes: array(_enum(["python"])).readonly().optional()
|
|
10028
10028
|
});
|
|
10029
10029
|
/**
|
|
10030
10030
|
* Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
|
|
@@ -18095,6 +18095,25 @@ var NcScheduleSchema = object({
|
|
|
18095
18095
|
/** Active OUTSIDE the windows (e.g. "only outside business hours"). */
|
|
18096
18096
|
invert: boolean().optional()
|
|
18097
18097
|
});
|
|
18098
|
+
/**
|
|
18099
|
+
* How a system-event rule of the `device-events` or `system` family speaks
|
|
18100
|
+
* (D647): at once, per event (`instant`, the only behaviour before D647), or
|
|
18101
|
+
* as a STATE SUMMARY at the end of each window of `schedule`.
|
|
18102
|
+
*/
|
|
18103
|
+
var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
|
|
18104
|
+
/**
|
|
18105
|
+
* `summary`: the rule sends NOTHING per event. When a window of `schedule`
|
|
18106
|
+
* CLOSES, it sends one notification with the current state of its kinds
|
|
18107
|
+
* (low batteries, consumables to replace, devices offline, updates
|
|
18108
|
+
* available, ...), after its own filters. Nothing to report sends nothing.
|
|
18109
|
+
* The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
|
|
18110
|
+
* midnight crossing); the send time is each window's END. Refused on the
|
|
18111
|
+
* `alarm` family, which stays instant (`systemEventDeliveryProblems`).
|
|
18112
|
+
*/
|
|
18113
|
+
var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
|
|
18114
|
+
mode: literal("summary"),
|
|
18115
|
+
schedule: NcScheduleSchema
|
|
18116
|
+
})]);
|
|
18098
18117
|
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
18099
18118
|
var NcPlateMatcherSchema = object({
|
|
18100
18119
|
/**
|
|
@@ -18830,6 +18849,16 @@ var NcRuleInputSchema = object({
|
|
|
18830
18849
|
delivery: NcDeliverySchema,
|
|
18831
18850
|
conditions: NcConditionsSchema.default({}),
|
|
18832
18851
|
schedule: NcScheduleSchema.optional(),
|
|
18852
|
+
/**
|
|
18853
|
+
* A `device-events` / `system` rule's delivery (D647): absent or `instant`
|
|
18854
|
+
* is a notification per event; `summary` is one state summary per closed
|
|
18855
|
+
* window of its schedule. `.optional()` and never defaulted: absent must
|
|
18856
|
+
* keep meaning what every rule authored before D647 meant, with no
|
|
18857
|
+
* migration. Top-level rather than inside `conditions.systemEvent`, so a
|
|
18858
|
+
* client that does not know it (an older viewer re-sending `conditions`
|
|
18859
|
+
* whole) leaves it standing through the store's patch merge.
|
|
18860
|
+
*/
|
|
18861
|
+
systemEventDelivery: NcSystemEventDeliverySchema.optional(),
|
|
18833
18862
|
/** May be empty when `targetUsers` addresses at least one user — the
|
|
18834
18863
|
* "at least one addressee" invariant is enforced by the provider, because
|
|
18835
18864
|
* a cross-field refine here would break `NcRulePatchSchema.partial()`. */
|
|
@@ -19058,6 +19087,28 @@ var NcRuleSchema = NcRuleInputSchema.extend({
|
|
|
19058
19087
|
*/
|
|
19059
19088
|
disabledTargetIds: array(string()).default([])
|
|
19060
19089
|
});
|
|
19090
|
+
/** One section of a previewed state summary. `unavailable` = its state could not be read. */
|
|
19091
|
+
var NcStateSummaryPreviewSectionSchema = object({
|
|
19092
|
+
id: string(),
|
|
19093
|
+
status: _enum(["read", "unavailable"]),
|
|
19094
|
+
items: number().int().nonnegative(),
|
|
19095
|
+
reason: string().optional()
|
|
19096
|
+
});
|
|
19097
|
+
/**
|
|
19098
|
+
* The summary a rule would send now. `empty` = nothing to report and every
|
|
19099
|
+
* section read: such a summary is NOT sent. `dropped` counts the open states
|
|
19100
|
+
* the rule's own filters (or a camera mute) left out, by reason.
|
|
19101
|
+
* `excludedGroups` names the kind groups selected that have no state to report
|
|
19102
|
+
* (backups & exports).
|
|
19103
|
+
*/
|
|
19104
|
+
var NcStateSummaryPreviewSchema = object({
|
|
19105
|
+
empty: boolean(),
|
|
19106
|
+
count: number().int().nonnegative(),
|
|
19107
|
+
text: string(),
|
|
19108
|
+
sections: array(NcStateSummaryPreviewSectionSchema),
|
|
19109
|
+
dropped: record(string(), number().int().nonnegative()),
|
|
19110
|
+
excludedGroups: array(string())
|
|
19111
|
+
});
|
|
19061
19112
|
var NcTestResultSchema = object({
|
|
19062
19113
|
recordId: string(),
|
|
19063
19114
|
recordKind: _enum([
|
|
@@ -19149,6 +19200,13 @@ var NcTemplateVarDescriptorSchema = object({
|
|
|
19149
19200
|
kinds: array(NcTemplateVarKindSchema).optional(),
|
|
19150
19201
|
deliveries: array(NcDeliverySchema).optional(),
|
|
19151
19202
|
systemEventKinds: array(NcSystemEventKindSchema).optional(),
|
|
19203
|
+
/**
|
|
19204
|
+
* Which system-event DELIVERY has a value for it (D647). Absent = an
|
|
19205
|
+
* instant row only when the descriptor names `systemEventKinds` (a
|
|
19206
|
+
* per-event fact: a summary row has no single device), and both otherwise.
|
|
19207
|
+
* `['summary']` marks the state-summary vocabulary (`{{summaryText}}`, ...).
|
|
19208
|
+
*/
|
|
19209
|
+
systemEventDeliveries: array(NcSystemEventDeliveryModeSchema).optional(),
|
|
19152
19210
|
dynamic: object({
|
|
19153
19211
|
prefix: literal("count_"),
|
|
19154
19212
|
from: literal("classes")
|
|
@@ -19161,7 +19219,9 @@ var NcTemplatePreviewInputSchema = object({
|
|
|
19161
19219
|
field: NcTemplateFieldSchema,
|
|
19162
19220
|
kind: NcRuleKindSchema.optional(),
|
|
19163
19221
|
delivery: NcDeliverySchema.optional(),
|
|
19164
|
-
systemEventKinds: array(NcSystemEventKindSchema).optional()
|
|
19222
|
+
systemEventKinds: array(NcSystemEventKindSchema).optional(),
|
|
19223
|
+
/** The rule's system-event delivery (D647); absent = instant. */
|
|
19224
|
+
systemEventDelivery: NcSystemEventDeliveryModeSchema.optional()
|
|
19165
19225
|
}),
|
|
19166
19226
|
template: object({
|
|
19167
19227
|
title: string().max(500).optional(),
|
|
@@ -20295,6 +20355,17 @@ var notificationRulesCapability = {
|
|
|
20295
20355
|
auth: "admin"
|
|
20296
20356
|
}),
|
|
20297
20357
|
/**
|
|
20358
|
+
* The STATE SUMMARY a system rule would send now (D647) — for a saved rule
|
|
20359
|
+
* or an unsaved draft. Pure: sends nothing, stamps nothing. A MUTATION
|
|
20360
|
+
* only for transport (a whole rule does not belong in a GET URL). Admin,
|
|
20361
|
+
* like `testRule`: it names devices and nodes across the installation.
|
|
20362
|
+
*/
|
|
20363
|
+
previewStateSummary: method(object({ rule: NcRuleInputSchema }), NcStateSummaryPreviewSchema, {
|
|
20364
|
+
kind: "mutation",
|
|
20365
|
+
auth: "admin",
|
|
20366
|
+
access: "view"
|
|
20367
|
+
}),
|
|
20368
|
+
/**
|
|
20298
20369
|
* The machine-readable condition surface a rule editor renders from, plus
|
|
20299
20370
|
* the picker VOCABULARY those conditions draw on.
|
|
20300
20371
|
*
|
|
@@ -20739,646 +20810,6 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
20739
20810
|
});
|
|
20740
20811
|
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
20741
20812
|
/**
|
|
20742
|
-
* Reference to the frame's retained NATIVE surface + the parent crop's placement
|
|
20743
|
-
* within the frame, so the executor can re-cut a leaf child ROI at native
|
|
20744
|
-
* resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
|
|
20745
|
-
*/
|
|
20746
|
-
var NativeCropRefSchema = object({
|
|
20747
|
-
/** Handle keying the retained native surface (node-pinned to its owner). */
|
|
20748
|
-
handle: FrameHandleSchema,
|
|
20749
|
-
/** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
|
|
20750
|
-
cropFrameSpace: object({
|
|
20751
|
-
x: number(),
|
|
20752
|
-
y: number(),
|
|
20753
|
-
w: number(),
|
|
20754
|
-
h: number()
|
|
20755
|
-
})
|
|
20756
|
-
});
|
|
20757
|
-
object({
|
|
20758
|
-
crop: object({
|
|
20759
|
-
left: number(),
|
|
20760
|
-
top: number(),
|
|
20761
|
-
width: number().positive(),
|
|
20762
|
-
height: number().positive()
|
|
20763
|
-
}).optional(),
|
|
20764
|
-
content: object({
|
|
20765
|
-
width: number().int().positive(),
|
|
20766
|
-
height: number().int().positive()
|
|
20767
|
-
}),
|
|
20768
|
-
fit: _enum(["stretch", "contain"]),
|
|
20769
|
-
format: _enum([
|
|
20770
|
-
"rgb",
|
|
20771
|
-
"gray",
|
|
20772
|
-
"jpeg"
|
|
20773
|
-
])
|
|
20774
|
-
});
|
|
20775
|
-
/**
|
|
20776
|
-
* Process-local frame identity. It is serializable so it can ride an in-process
|
|
20777
|
-
* capability call, but `registryId` deliberately prevents resolution in any
|
|
20778
|
-
* other process or execution group.
|
|
20779
|
-
*/
|
|
20780
|
-
var FrameRefSchema = object({
|
|
20781
|
-
registryId: string().min(1),
|
|
20782
|
-
id: string().min(1),
|
|
20783
|
-
width: number().int().positive(),
|
|
20784
|
-
height: number().int().positive(),
|
|
20785
|
-
format: _enum(["rgb", "gray"]),
|
|
20786
|
-
timestamp: number(),
|
|
20787
|
-
capturedAt: number().optional()
|
|
20788
|
-
});
|
|
20789
|
-
var ModelFormatSchema$1 = _enum([
|
|
20790
|
-
"onnx",
|
|
20791
|
-
"coreml",
|
|
20792
|
-
"openvino",
|
|
20793
|
-
"tflite",
|
|
20794
|
-
"pt",
|
|
20795
|
-
"gguf"
|
|
20796
|
-
]);
|
|
20797
|
-
var PipelineSlotSchema = _enum([
|
|
20798
|
-
"detector",
|
|
20799
|
-
"cropper",
|
|
20800
|
-
"classifier",
|
|
20801
|
-
"refiner",
|
|
20802
|
-
"audio-classifier"
|
|
20803
|
-
]);
|
|
20804
|
-
var PipelineEngineChoiceSchema = object({
|
|
20805
|
-
runtime: _enum(["node", "python"]),
|
|
20806
|
-
backend: string(),
|
|
20807
|
-
format: ModelFormatSchema$1,
|
|
20808
|
-
device: string().optional()
|
|
20809
|
-
});
|
|
20810
|
-
var AvailableEngineSchema = object({
|
|
20811
|
-
engine: PipelineEngineChoiceSchema,
|
|
20812
|
-
devices: array(object({
|
|
20813
|
-
id: string(),
|
|
20814
|
-
label: string(),
|
|
20815
|
-
description: string().optional()
|
|
20816
|
-
})).readonly(),
|
|
20817
|
-
defaultDevice: string()
|
|
20818
|
-
});
|
|
20819
|
-
var PipelineDefaultStepSchema = lazy(() => object({
|
|
20820
|
-
addonId: string(),
|
|
20821
|
-
addonName: string(),
|
|
20822
|
-
slot: PipelineSlotSchema,
|
|
20823
|
-
inputClasses: array(string()).readonly(),
|
|
20824
|
-
outputClasses: array(string()).readonly(),
|
|
20825
|
-
enabled: boolean(),
|
|
20826
|
-
modelId: string(),
|
|
20827
|
-
children: array(PipelineDefaultStepSchema).readonly(),
|
|
20828
|
-
group: string().optional(),
|
|
20829
|
-
settings: record(string(), unknown()).optional()
|
|
20830
|
-
}));
|
|
20831
|
-
var PipelineTemplateStepSchema = lazy(() => object({
|
|
20832
|
-
addonId: string(),
|
|
20833
|
-
enabled: boolean(),
|
|
20834
|
-
modelId: string(),
|
|
20835
|
-
children: array(PipelineTemplateStepSchema).readonly(),
|
|
20836
|
-
settings: record(string(), unknown()).optional()
|
|
20837
|
-
}));
|
|
20838
|
-
var PipelineTemplateSchema$1 = object({
|
|
20839
|
-
id: string(),
|
|
20840
|
-
name: string(),
|
|
20841
|
-
createdAt: string(),
|
|
20842
|
-
updatedAt: string(),
|
|
20843
|
-
engine: PipelineEngineChoiceSchema,
|
|
20844
|
-
steps: array(PipelineTemplateStepSchema).readonly()
|
|
20845
|
-
});
|
|
20846
|
-
var PipelineModelOptionSchema = object({
|
|
20847
|
-
id: string(),
|
|
20848
|
-
name: string(),
|
|
20849
|
-
formats: record(string(), object({
|
|
20850
|
-
downloaded: boolean(),
|
|
20851
|
-
sizeMB: number()
|
|
20852
|
-
})),
|
|
20853
|
-
group: ModelVariantGroupSchema.optional(),
|
|
20854
|
-
legacy: boolean().optional(),
|
|
20855
|
-
provider: ModelProviderIdSchema.optional()
|
|
20856
|
-
});
|
|
20857
|
-
var ConfigFieldBridge = custom();
|
|
20858
|
-
var PipelineAddonSchemaSchema = object({
|
|
20859
|
-
id: string(),
|
|
20860
|
-
name: string(),
|
|
20861
|
-
slot: PipelineSlotSchema,
|
|
20862
|
-
inputClasses: array(string()).readonly(),
|
|
20863
|
-
outputClasses: array(string()).readonly(),
|
|
20864
|
-
childSlots: array(PipelineSlotSchema).readonly(),
|
|
20865
|
-
models: array(PipelineModelOptionSchema).readonly(),
|
|
20866
|
-
defaultModelId: string(),
|
|
20867
|
-
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
20868
|
-
enabledByDefault: boolean().optional(),
|
|
20869
|
-
backfillIntoExistingOverrides: boolean().optional(),
|
|
20870
|
-
defaultConfidence: number(),
|
|
20871
|
-
group: string().optional(),
|
|
20872
|
-
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
20873
|
-
});
|
|
20874
|
-
var PipelineSlotSchemaSchema = object({
|
|
20875
|
-
id: PipelineSlotSchema,
|
|
20876
|
-
label: string(),
|
|
20877
|
-
priority: number(),
|
|
20878
|
-
parentSlot: PipelineSlotSchema.nullable(),
|
|
20879
|
-
addons: array(PipelineAddonSchemaSchema).readonly()
|
|
20880
|
-
});
|
|
20881
|
-
var PipelineSchemaSchema = object({
|
|
20882
|
-
availableEngines: array(AvailableEngineSchema).readonly(),
|
|
20883
|
-
selectedEngine: PipelineEngineChoiceSchema,
|
|
20884
|
-
slots: array(PipelineSlotSchemaSchema).readonly()
|
|
20885
|
-
});
|
|
20886
|
-
var EngineProvisioningSchema = object({
|
|
20887
|
-
runtimeId: _enum([
|
|
20888
|
-
"onnx",
|
|
20889
|
-
"openvino",
|
|
20890
|
-
"coreml",
|
|
20891
|
-
"edgetpu"
|
|
20892
|
-
]).nullable(),
|
|
20893
|
-
device: string().nullable(),
|
|
20894
|
-
state: _enum([
|
|
20895
|
-
"idle",
|
|
20896
|
-
"installing",
|
|
20897
|
-
"verifying",
|
|
20898
|
-
"ready",
|
|
20899
|
-
"failed"
|
|
20900
|
-
]),
|
|
20901
|
-
progress: number().optional(),
|
|
20902
|
-
error: string().optional(),
|
|
20903
|
-
nextRetryAt: number().optional(),
|
|
20904
|
-
/**
|
|
20905
|
-
* Gate A (config-correctness gate at engine change): human-readable
|
|
20906
|
-
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
20907
|
-
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
20908
|
-
* has a <format> build"). Additive/optional: informational only, never
|
|
20909
|
-
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
20910
|
-
* Absent/empty when the node-default tree resolves cleanly.
|
|
20911
|
-
*/
|
|
20912
|
-
configIssues: array(string()).optional()
|
|
20913
|
-
});
|
|
20914
|
-
var PipelineStepInputSchema = lazy(() => object({
|
|
20915
|
-
addonId: string(),
|
|
20916
|
-
modelId: string().optional(),
|
|
20917
|
-
enabled: boolean().default(true),
|
|
20918
|
-
children: array(PipelineStepInputSchema).optional(),
|
|
20919
|
-
settings: record(string(), unknown()).optional(),
|
|
20920
|
-
jumpDeviceKey: string().optional()
|
|
20921
|
-
}));
|
|
20922
|
-
var ModelSubstitutionSchema = object({
|
|
20923
|
-
addonId: string(),
|
|
20924
|
-
chosen: string(),
|
|
20925
|
-
running: string(),
|
|
20926
|
-
format: string()
|
|
20927
|
-
});
|
|
20928
|
-
var PipelineValidationIssueSchema = object({
|
|
20929
|
-
addonId: string(),
|
|
20930
|
-
kind: _enum(["unknown-addon", "no-format-build"]),
|
|
20931
|
-
detail: string()
|
|
20932
|
-
});
|
|
20933
|
-
var PipelineValidationResultSchema = object({
|
|
20934
|
-
ok: boolean(),
|
|
20935
|
-
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
20936
|
-
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
20937
|
-
/** The node's `currentEngine.format` this validation ran against. */
|
|
20938
|
-
format: string()
|
|
20939
|
-
});
|
|
20940
|
-
var ReferenceImageEntrySchema = object({
|
|
20941
|
-
filename: string(),
|
|
20942
|
-
stepIds: array(string()).readonly().optional()
|
|
20943
|
-
});
|
|
20944
|
-
var ReferenceImageBodySchema = object({
|
|
20945
|
-
base64: string(),
|
|
20946
|
-
filename: string()
|
|
20947
|
-
});
|
|
20948
|
-
var ReferenceAudioEntrySchema = object({
|
|
20949
|
-
filename: string(),
|
|
20950
|
-
sizeKb: number()
|
|
20951
|
-
});
|
|
20952
|
-
var ReferenceAudioBodySchema = object({ base64: string() });
|
|
20953
|
-
var AudioBackendSchema = object({
|
|
20954
|
-
id: string(),
|
|
20955
|
-
name: string(),
|
|
20956
|
-
description: string(),
|
|
20957
|
-
available: boolean(),
|
|
20958
|
-
/**
|
|
20959
|
-
* Raw classifier labels this backend can emit (e.g. YAMNet's
|
|
20960
|
-
* 521-class set or Apple SoundAnalysis's 303-class set). Used by
|
|
20961
|
-
* the benchmark UI to populate the `enabledMicroClasses` filter
|
|
20962
|
-
* specific to the selected backend without a separate fetch.
|
|
20963
|
-
*/
|
|
20964
|
-
rawLabels: array(string()).readonly().optional()
|
|
20965
|
-
});
|
|
20966
|
-
var AudioCapabilitiesSchema = object({
|
|
20967
|
-
activeBackend: string(),
|
|
20968
|
-
availableBackends: array(AudioBackendSchema).readonly(),
|
|
20969
|
-
sampleRate: number(),
|
|
20970
|
-
chunkDurationMs: number()
|
|
20971
|
-
});
|
|
20972
|
-
var DownloadModelResultSchema = object({
|
|
20973
|
-
filePath: string(),
|
|
20974
|
-
sizeMB: number(),
|
|
20975
|
-
durationMs: number()
|
|
20976
|
-
});
|
|
20977
|
-
/**
|
|
20978
|
-
* Wrapper carrying a single test run's result. Replaces the legacy
|
|
20979
|
-
* ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
|
|
20980
|
-
* canonical `AudioResult` from the Phase 6 output rework: one
|
|
20981
|
-
* `AudioDetection` per class above `minScore`, top-N candidates in
|
|
20982
|
-
* `debug.alternateLabels['audio-classifier']`, per-source timings in
|
|
20983
|
-
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
20984
|
-
* benchmark UI can still report a clean failure when the classifier
|
|
20985
|
-
* cap isn't available.
|
|
20986
|
-
*/
|
|
20987
|
-
var AudioTestResultSchema = object({
|
|
20988
|
-
success: boolean(),
|
|
20989
|
-
error: string().optional(),
|
|
20990
|
-
frame: custom().optional()
|
|
20991
|
-
});
|
|
20992
|
-
var PipelineConfigBridge = custom();
|
|
20993
|
-
var ConfigUISchemaBridge = custom();
|
|
20994
|
-
var ConfigUISchemaNullableBridge = custom();
|
|
20995
|
-
var InferenceCapabilitiesBridge = custom();
|
|
20996
|
-
var ModelAvailabilityListBridge = custom();
|
|
20997
|
-
var PipelineRunResultBridge = custom();
|
|
20998
|
-
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
20999
|
-
modelId: string(),
|
|
21000
|
-
settings: record(string(), unknown()).readonly()
|
|
21001
|
-
}))), method(object({ steps: record(string(), object({
|
|
21002
|
-
modelId: string(),
|
|
21003
|
-
settings: record(string(), unknown()).readonly()
|
|
21004
|
-
})) }), object({ success: literal(true) }), {
|
|
21005
|
-
kind: "mutation",
|
|
21006
|
-
auth: "admin"
|
|
21007
|
-
}), method(object({ nodeId: string() }), object({
|
|
21008
|
-
success: literal(true),
|
|
21009
|
-
clearedDevices: number()
|
|
21010
|
-
}), {
|
|
21011
|
-
kind: "mutation",
|
|
21012
|
-
auth: "admin"
|
|
21013
|
-
}), method(object({ nodeId: string() }), object({ unhealthy: array(object({
|
|
21014
|
-
/** `<backend>:<device>`, e.g. `openvino:gpu`. */
|
|
21015
|
-
deviceKey: string(),
|
|
21016
|
-
/**
|
|
21017
|
-
* `failed` — the per-device restart budget is exhausted; no pool
|
|
21018
|
-
* will be spawned until an operator re-arms it or the runner
|
|
21019
|
-
* respawns. `backoff` — under budget, waiting out the backoff (or
|
|
21020
|
-
* a cached pool observed dead and not yet condemned).
|
|
21021
|
-
*/
|
|
21022
|
-
state: _enum(["failed", "backoff"]),
|
|
21023
|
-
/** Epoch ms of the death that produced this state. */
|
|
21024
|
-
since: number(),
|
|
21025
|
-
/** Pool deaths inside the current window. */
|
|
21026
|
-
deaths: number(),
|
|
21027
|
-
/** The last death's message. */
|
|
21028
|
-
lastError: string()
|
|
21029
|
-
})).readonly() })), method(object({
|
|
21030
|
-
nodeId: string(),
|
|
21031
|
-
deviceKey: string()
|
|
21032
|
-
}), object({ rearmed: boolean() }), {
|
|
21033
|
-
kind: "mutation",
|
|
21034
|
-
auth: "admin"
|
|
21035
|
-
}), 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({
|
|
21036
|
-
name: string(),
|
|
21037
|
-
steps: array(PipelineTemplateStepSchema).readonly(),
|
|
21038
|
-
engine: PipelineEngineChoiceSchema
|
|
21039
|
-
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
|
|
21040
|
-
id: string(),
|
|
21041
|
-
name: string().optional(),
|
|
21042
|
-
steps: array(PipelineTemplateStepSchema).readonly().optional()
|
|
21043
|
-
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
|
|
21044
|
-
addonId: string(),
|
|
21045
|
-
modelId: string(),
|
|
21046
|
-
format: ModelFormatSchema$1
|
|
21047
|
-
}), DownloadModelResultSchema, { kind: "mutation" }), method(object({
|
|
21048
|
-
addonId: string(),
|
|
21049
|
-
modelId: string(),
|
|
21050
|
-
format: ModelFormatSchema$1
|
|
21051
|
-
}), object({ success: literal(true) }), { kind: "mutation" }), method(object({
|
|
21052
|
-
engine: PipelineEngineChoiceSchema.optional(),
|
|
21053
|
-
steps: array(PipelineStepInputSchema).min(1),
|
|
21054
|
-
frame: FrameInputSchema.optional(),
|
|
21055
|
-
/**
|
|
21056
|
-
* Process-local lazy frame. Valid only when caller and provider resolve
|
|
21057
|
-
* in the same execution-group process; split/cross-node callers use
|
|
21058
|
-
* `frame`/`image` inline compatibility instead.
|
|
21059
|
-
*/
|
|
21060
|
-
frameRef: FrameRefSchema.optional(),
|
|
21061
|
-
/**
|
|
21062
|
-
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
21063
|
-
* the decoded pixels live in. One more member of the one-of
|
|
21064
|
-
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
21065
|
-
*/
|
|
21066
|
-
frameHandle: FrameHandleSchema.optional(),
|
|
21067
|
-
imageBase64: string().optional(),
|
|
21068
|
-
/**
|
|
21069
|
-
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
21070
|
-
* hops (hub → forked worker via Moleculer MsgPack) because it
|
|
21071
|
-
* skips the 33% base64 overhead + the per-call base64 decode on
|
|
21072
|
-
* the detection-pipeline worker. Callers can pass either; exactly
|
|
21073
|
-
* one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
|
|
21074
|
-
*/
|
|
21075
|
-
image: _instanceof(Uint8Array).optional(),
|
|
21076
|
-
referenceImage: string().optional(),
|
|
21077
|
-
deviceId: number().optional(),
|
|
21078
|
-
sessionId: string().optional(),
|
|
21079
|
-
/**
|
|
21080
|
-
* Execution plane. 'full' (default) runs the whole tree — benchmark,
|
|
21081
|
-
* reference-image, and detail-subtree calls. 'frame' is the live
|
|
21082
|
-
* per-frame dispatch: ONLY root-plane steps run; crop children
|
|
21083
|
-
* (inputClasses ≠ null) are skipped and served per-track via
|
|
21084
|
-
* pipelineRunner.runDetailSubtree (two-plane design).
|
|
21085
|
-
*/
|
|
21086
|
-
plane: _enum(["full", "frame"]).optional(),
|
|
21087
|
-
/**
|
|
21088
|
-
* Inference-device selector (Phase 2 multi-device). Format
|
|
21089
|
-
* `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
|
|
21090
|
-
* Omitted ⇒ the runner's default device (current single-engine
|
|
21091
|
-
* behaviour). Selects WHICH device pool of the node runs the call.
|
|
21092
|
-
*/
|
|
21093
|
-
deviceKey: string().optional(),
|
|
21094
|
-
/**
|
|
21095
|
-
* Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
|
|
21096
|
-
* when the parent crop was resolved from the frame's retained NATIVE
|
|
21097
|
-
* surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
|
|
21098
|
-
* child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
|
|
21099
|
-
* resolution from that surface — the SAME quality path faces already
|
|
21100
|
-
* had — instead of the downscaled parent tile. `handle` keys the native
|
|
21101
|
-
* surface (node-pinned to its owner); `cropFrameSpace` is the parent
|
|
21102
|
-
* crop's padded/clamped rectangle in FRAME-space pixels, used to compose
|
|
21103
|
-
* the executor's crop-normalized child ROI back into frame-normalized
|
|
21104
|
-
* coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
|
|
21105
|
-
* of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
|
|
21106
|
-
* (today's behaviour on the fallback path).
|
|
21107
|
-
*/
|
|
21108
|
-
nativeCropRef: NativeCropRefSchema.optional()
|
|
21109
|
-
}), PipelineRunResultBridge, { kind: "mutation" }), method(object({
|
|
21110
|
-
engine: PipelineEngineChoiceSchema.optional(),
|
|
21111
|
-
steps: array(PipelineStepInputSchema).min(1),
|
|
21112
|
-
frames: array(FrameInputSchema).min(1).max(255),
|
|
21113
|
-
deviceId: number().optional(),
|
|
21114
|
-
sessionId: string().optional(),
|
|
21115
|
-
/**
|
|
21116
|
-
* Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
|
|
21117
|
-
* the batch to the Python pool's bench preprocess cache
|
|
21118
|
-
* (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
|
|
21119
|
-
* preprocessed ONCE and every later inference is a pure-inference cache
|
|
21120
|
-
* hit — the sustained-throughput run measures inference, not
|
|
21121
|
-
* decode+preprocess+infer. Omitted/0 for live frames (all different →
|
|
21122
|
-
* full preprocess every call, correct). Fresh per sustained run;
|
|
21123
|
-
* released via `uncacheFrame`.
|
|
21124
|
-
*/
|
|
21125
|
-
frameId: number().int().nonnegative().optional(),
|
|
21126
|
-
/** Inference-device selector (Phase 2 multi-device); see runPipeline. */
|
|
21127
|
-
deviceKey: string().optional()
|
|
21128
|
-
}), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
|
|
21129
|
-
data: _instanceof(Uint8Array),
|
|
21130
|
-
width: number().int().positive(),
|
|
21131
|
-
height: number().int().positive(),
|
|
21132
|
-
format: _enum([
|
|
21133
|
-
"rgb",
|
|
21134
|
-
"bgr",
|
|
21135
|
-
"gray"
|
|
21136
|
-
])
|
|
21137
|
-
}), object({
|
|
21138
|
-
frameId: number(),
|
|
21139
|
-
width: number(),
|
|
21140
|
-
height: number()
|
|
21141
|
-
}), { kind: "mutation" }), method(object({
|
|
21142
|
-
stepId: string(),
|
|
21143
|
-
frameId: number().int()
|
|
21144
|
-
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(_void(), object({
|
|
21145
|
-
batchMode: string(),
|
|
21146
|
-
windowMs: number(),
|
|
21147
|
-
maxBatchSize: number(),
|
|
21148
|
-
concurrency: number()
|
|
21149
|
-
})), method(_void(), array(object({
|
|
21150
|
-
engineKey: string(),
|
|
21151
|
-
engine: PipelineEngineChoiceSchema,
|
|
21152
|
-
modelsLoaded: array(string()).readonly(),
|
|
21153
|
-
inUseByCameras: array(number()).readonly(),
|
|
21154
|
-
/**
|
|
21155
|
-
* Origin of this resident factory.
|
|
21156
|
-
* - `runtime` — main camera-serving engine (no idle TTL).
|
|
21157
|
-
* - `warm-override` — benchmark/test override held in the warm
|
|
21158
|
-
* cache; auto-disposed after the idle TTL.
|
|
21159
|
-
* - `device-pool` — a concurrent per-device pool (Phase 2
|
|
21160
|
-
* multi-device, keyed by `deviceKey`) resolved
|
|
21161
|
-
* via `resolveDeviceFactory`. Runs alongside the
|
|
21162
|
-
* `runtime` engine on a DIFFERENT accelerator
|
|
21163
|
-
* (NPU / iGPU / Coral) — this is how the
|
|
21164
|
-
* Engines tab shows all pools running at once.
|
|
21165
|
-
*/
|
|
21166
|
-
kind: _enum([
|
|
21167
|
-
"runtime",
|
|
21168
|
-
"warm-override",
|
|
21169
|
-
"device-pool"
|
|
21170
|
-
]),
|
|
21171
|
-
/** Native pid of the underlying Python pool (null when no pool). */
|
|
21172
|
-
poolPid: number().nullable(),
|
|
21173
|
-
/** ms since this factory was last used (null when not warm-tracked). */
|
|
21174
|
-
idleMs: number().nullable(),
|
|
21175
|
-
/** Idle TTL after which `warm-override` factories self-evict (null when not applicable). */
|
|
21176
|
-
idleTtlMs: number().nullable()
|
|
21177
|
-
})).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
|
|
21178
|
-
kind: "mutation",
|
|
21179
|
-
auth: "admin"
|
|
21180
|
-
}), method(object({
|
|
21181
|
-
engine: PipelineEngineChoiceSchema,
|
|
21182
|
-
force: boolean().optional()
|
|
21183
|
-
}), object({
|
|
21184
|
-
success: boolean(),
|
|
21185
|
-
reason: string().optional()
|
|
21186
|
-
}), {
|
|
21187
|
-
kind: "mutation",
|
|
21188
|
-
auth: "admin"
|
|
21189
|
-
}), 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({
|
|
21190
|
-
addonId: string(),
|
|
21191
|
-
modelId: string(),
|
|
21192
|
-
filename: string().optional(),
|
|
21193
|
-
settings: record(string(), unknown()).optional()
|
|
21194
|
-
}), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
|
|
21195
|
-
/**
|
|
21196
|
-
* Per-stage gating mode applied to the zones a rule references.
|
|
21197
|
-
*
|
|
21198
|
-
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
21199
|
-
* When at least one `include` rule fires for a stage, only entities
|
|
21200
|
-
* inside one of those zones pass that stage.
|
|
21201
|
-
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
21202
|
-
* Entities inside one of those zones are dropped at that stage.
|
|
21203
|
-
*
|
|
21204
|
-
* `monitor`-style observation (count without filtering) is not a rule
|
|
21205
|
-
* mode — zones without any matching rule are observed naturally by
|
|
21206
|
-
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
21207
|
-
* count, not filter" use case needs no rule at all.
|
|
21208
|
-
*/
|
|
21209
|
-
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
21210
|
-
/**
|
|
21211
|
-
* Per-consumer rule that references existing zones (geometry) and
|
|
21212
|
-
* defines how a specific pipeline stage should treat them. Each
|
|
21213
|
-
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
21214
|
-
* settings:
|
|
21215
|
-
*
|
|
21216
|
-
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
21217
|
-
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
21218
|
-
* - future: notification rules, audio gating, etc.
|
|
21219
|
-
*
|
|
21220
|
-
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
21221
|
-
* express "ignore motion in ALL of {garden, street}" with a single
|
|
21222
|
-
* rule. `classFilter` narrows the rule to specific object classes —
|
|
21223
|
-
* "drop person detections in the street, but keep cars" is one
|
|
21224
|
-
* `exclude` rule with `classFilter: ['person']`.
|
|
21225
|
-
*
|
|
21226
|
-
* `enabled` is a soft toggle — the operator can keep the rule
|
|
21227
|
-
* configured but inert without deleting it.
|
|
21228
|
-
*/
|
|
21229
|
-
var ZoneRuleSchema = object({
|
|
21230
|
-
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
21231
|
-
id: string(),
|
|
21232
|
-
/** Optional human-readable label rendered in the rule editor. */
|
|
21233
|
-
name: string().optional(),
|
|
21234
|
-
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
21235
|
-
* listed zones (OR-set: a detection in any one of them counts).
|
|
21236
|
-
* At least one zone id required — a rule with no targets is a
|
|
21237
|
-
* configuration mistake and the form validator rejects it. */
|
|
21238
|
-
zoneIds: array(string()).min(1).readonly(),
|
|
21239
|
-
mode: ZoneRuleModeEnum,
|
|
21240
|
-
/**
|
|
21241
|
-
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
21242
|
-
* applies to every class. Class strings match the `macroClass`
|
|
21243
|
-
* field on detections (e.g. `person`, `car`, `dog`).
|
|
21244
|
-
*/
|
|
21245
|
-
classFilter: array(string()).readonly().optional(),
|
|
21246
|
-
/**
|
|
21247
|
-
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
21248
|
-
* required to consider an entity "in the zone". Defaults to the
|
|
21249
|
-
* consumer's stage default when omitted. Kept for back-compat with
|
|
21250
|
-
* existing per-rule overrides; new operators pick the value via
|
|
21251
|
-
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
21252
|
-
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
21253
|
-
*/
|
|
21254
|
-
overlapThreshold: number().min(0).max(1).optional(),
|
|
21255
|
-
/**
|
|
21256
|
-
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
21257
|
-
* of the detection's bbox that must lie inside the zone for the
|
|
21258
|
-
* rule to match. Documented default is 85%; the engine substitutes
|
|
21259
|
-
* that when the field is omitted (kept optional so existing rules
|
|
21260
|
-
* stored without it stay valid).
|
|
21261
|
-
*
|
|
21262
|
-
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
21263
|
-
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
21264
|
-
* field exposed in the UI. Internally both feed the same gate.
|
|
21265
|
-
*/
|
|
21266
|
-
bboxInclusionPct: number().min(0).max(100).optional(),
|
|
21267
|
-
/**
|
|
21268
|
-
* When `true` and a detection has a segmentation mask, use the
|
|
21269
|
-
* mask for overlap instead of the bbox. Detection-stage only;
|
|
21270
|
-
* motion rules ignore this field.
|
|
21271
|
-
*/
|
|
21272
|
-
preferMask: boolean().optional(),
|
|
21273
|
-
/**
|
|
21274
|
-
* Soft-toggle: `false` disables the rule without deleting it.
|
|
21275
|
-
* Defaults to `true` so operators creating a rule via the UI
|
|
21276
|
-
* see it active immediately.
|
|
21277
|
-
*/
|
|
21278
|
-
enabled: boolean().default(true)
|
|
21279
|
-
});
|
|
21280
|
-
array(ZoneRuleSchema).readonly();
|
|
21281
|
-
/**
|
|
21282
|
-
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
21283
|
-
*
|
|
21284
|
-
* Zones describe **where** in the frame the operator wants to flag
|
|
21285
|
-
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
21286
|
-
* each pipeline stage uses them. Splitting the two means a single
|
|
21287
|
-
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
21288
|
-
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
21289
|
-
* — without three duplicated polygons.
|
|
21290
|
-
*
|
|
21291
|
-
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
21292
|
-
* `zones` device-state slice on every mutation. Consumers
|
|
21293
|
-
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
21294
|
-
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
21295
|
-
* mirror with `onChanged`).
|
|
21296
|
-
*
|
|
21297
|
-
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
21298
|
-
* survive resolution changes and stream profile switches.
|
|
21299
|
-
*
|
|
21300
|
-
* `kind` discriminates between full polygons (closed regions used
|
|
21301
|
-
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
21302
|
-
* line segments used for cross events). Onboard / firmware-reported
|
|
21303
|
-
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
21304
|
-
* task list.
|
|
21305
|
-
*/
|
|
21306
|
-
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
21307
|
-
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
21308
|
-
var PolygonPointSchema = object({
|
|
21309
|
-
x: number(),
|
|
21310
|
-
y: number()
|
|
21311
|
-
});
|
|
21312
|
-
/** A camera detection zone — pure geometry/identity. */
|
|
21313
|
-
var ZoneSchema = object({
|
|
21314
|
-
id: string(),
|
|
21315
|
-
name: string(),
|
|
21316
|
-
kind: ZoneKindEnum.default("polygon"),
|
|
21317
|
-
/** Polygon vertices, fraction of frame (0–1). */
|
|
21318
|
-
polygon: array(PolygonPointSchema).readonly(),
|
|
21319
|
-
/** Visual color for UI rendering. */
|
|
21320
|
-
color: string().default("#3b82f6")
|
|
21321
|
-
});
|
|
21322
|
-
/**
|
|
21323
|
-
* Zones capability — per-camera CRUD over polygon detection zones.
|
|
21324
|
-
*
|
|
21325
|
-
* Provider lives in `addon-pipeline-orchestrator` (hub-only). Persists
|
|
21326
|
-
* to per-device settings and mirrors into the `zones` device-state
|
|
21327
|
-
* slice on every mutation, so downstream consumers can subscribe via
|
|
21328
|
-
* `dev.state.zones.onChanged`.
|
|
21329
|
-
*
|
|
21330
|
-
* The cap surface only handles geometry + identity; filtering
|
|
21331
|
-
* behaviour (per-class, include/exclude, threshold) lives in the
|
|
21332
|
-
* consumer addons' rule arrays — see `ZoneRuleSchema` exported from
|
|
21333
|
-
* `capabilities/schemas/zone-rule.js`.
|
|
21334
|
-
*/
|
|
21335
|
-
var zonesCapability = {
|
|
21336
|
-
name: "zones",
|
|
21337
|
-
scope: "device",
|
|
21338
|
-
mode: "singleton",
|
|
21339
|
-
deviceTypes: [DeviceType.Camera],
|
|
21340
|
-
methods: {
|
|
21341
|
-
listZones: method(object({ deviceId: number() }), array(ZoneSchema).readonly()),
|
|
21342
|
-
addZone: method(object({
|
|
21343
|
-
deviceId: number(),
|
|
21344
|
-
zone: ZoneSchema
|
|
21345
|
-
}), _void(), {
|
|
21346
|
-
kind: "mutation",
|
|
21347
|
-
auth: "admin"
|
|
21348
|
-
}),
|
|
21349
|
-
removeZone: method(object({
|
|
21350
|
-
deviceId: number(),
|
|
21351
|
-
zoneId: string()
|
|
21352
|
-
}), _void(), {
|
|
21353
|
-
kind: "mutation",
|
|
21354
|
-
auth: "admin"
|
|
21355
|
-
}),
|
|
21356
|
-
updateZone: method(object({
|
|
21357
|
-
deviceId: number(),
|
|
21358
|
-
zone: ZoneSchema
|
|
21359
|
-
}), _void(), {
|
|
21360
|
-
kind: "mutation",
|
|
21361
|
-
auth: "admin"
|
|
21362
|
-
})
|
|
21363
|
-
},
|
|
21364
|
-
/**
|
|
21365
|
-
* Runtime-state slice — the live zone catalogue mirrored by the
|
|
21366
|
-
* orchestrator on every CRUD mutation. Consumers read via
|
|
21367
|
-
* `device.state.zones.value` / `.watch(...)` without round-tripping
|
|
21368
|
-
* the cap, and the codegen DeviceProxy auto-wires the reactive
|
|
21369
|
-
* handle. Slice shape is `{ zones: Zone[] }` so future extensions
|
|
21370
|
-
* (e.g. zone groupings) can sit alongside the polygon list.
|
|
21371
|
-
*/
|
|
21372
|
-
runtimeState: object({ zones: array(ZoneSchema).readonly() }),
|
|
21373
|
-
/**
|
|
21374
|
-
* Runtime-state durability: **restored** — written only on operator mutation, so a camera that never had one has nothing to re-derive from. This is the slice `zone-mirror-hydration.ts` exists to paper over.
|
|
21375
|
-
*
|
|
21376
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
21377
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
21378
|
-
*/
|
|
21379
|
-
durability: "restored"
|
|
21380
|
-
};
|
|
21381
|
-
/**
|
|
21382
20813
|
* pipeline-analytics — device-scoped wrapper cap. Refines raw
|
|
21383
20814
|
* per-frame detections emitted by the pipeline runner into tracked
|
|
21384
20815
|
* objects, per-kind event collections (motion / object / audio), and
|
|
@@ -21949,6 +21380,22 @@ var TrackSchema = object({
|
|
|
21949
21380
|
* omit it. Render nothing when absent.
|
|
21950
21381
|
*/
|
|
21951
21382
|
previewMissReason: string().optional(),
|
|
21383
|
+
/**
|
|
21384
|
+
* The ROOT model that produced this track — the `FrameResult.rootModelId` of
|
|
21385
|
+
* the frame it was BORN on (D646). What a later replay compares against, so
|
|
21386
|
+
* "the original model" is named rather than assumed. A birth fact: never
|
|
21387
|
+
* rewritten by a later frame. **Absent ≠ unknown-model**: a row from before
|
|
21388
|
+
* the column, and a track the camera's own detector produced, carry none.
|
|
21389
|
+
*/
|
|
21390
|
+
modelId: string().optional(),
|
|
21391
|
+
/**
|
|
21392
|
+
* Size (px) of the detection frame this track's `positions[].bbox` live in —
|
|
21393
|
+
* the frame it was born on, else the camera's latest analysis frame at
|
|
21394
|
+
* persist time. Divide a position by these to normalise it. Absent when the
|
|
21395
|
+
* size was never known.
|
|
21396
|
+
*/
|
|
21397
|
+
frameWidth: number().optional(),
|
|
21398
|
+
frameHeight: number().optional(),
|
|
21952
21399
|
...TrackFlagFields,
|
|
21953
21400
|
...TrackRetrainFields
|
|
21954
21401
|
});
|
|
@@ -22955,24 +22402,6 @@ var MediaReclaimStatusSchema = object({
|
|
|
22955
22402
|
finishedAtMs: number().nullable(),
|
|
22956
22403
|
error: string().nullable()
|
|
22957
22404
|
});
|
|
22958
|
-
var ReplayFrameInputSchema = object({
|
|
22959
|
-
timestamp: number(),
|
|
22960
|
-
frame: PipelineRunResultBridge
|
|
22961
|
-
});
|
|
22962
|
-
var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
22963
|
-
className: string(),
|
|
22964
|
-
firstSeenMs: number(),
|
|
22965
|
-
lastSeenMs: number(),
|
|
22966
|
-
/** Bbox of the track's FIRST matched detection, pixel-space in the clip's
|
|
22967
|
-
* frame — a representative box for the diff's `(className, window, IoU)`
|
|
22968
|
-
* pairing (`replay-diff.ts`). A replay does not need the full per-frame
|
|
22969
|
-
* trajectory production's `Track.positions` keeps. */
|
|
22970
|
-
bbox: BoundingBoxSchema,
|
|
22971
|
-
/** How many of the input frames this track matched a real detection on
|
|
22972
|
-
* (never a coasted/extrapolated frame) — the replay's own signal for "how
|
|
22973
|
-
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
22974
|
-
framesMatched: number().int()
|
|
22975
|
-
})).readonly() });
|
|
22976
22405
|
/**
|
|
22977
22406
|
* The long-term series a camera produces. A closed union so a typo cannot
|
|
22978
22407
|
* invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
|
|
@@ -23699,32 +23128,6 @@ var pipelineAnalyticsCapability = {
|
|
|
23699
23128
|
kind: "mutation",
|
|
23700
23129
|
auth: "admin"
|
|
23701
23130
|
}),
|
|
23702
|
-
/**
|
|
23703
|
-
* The FrameProcessor pass of a replay run — see the `Replay` section
|
|
23704
|
-
* above this capability's definition for why this is not the
|
|
23705
|
-
* `processFrame` method this file's header says pipeline-analytics does
|
|
23706
|
-
* not have.
|
|
23707
|
-
*
|
|
23708
|
-
* Constructs a FRESH `FrameProcessor` for `(deviceId, source)`, feeds it
|
|
23709
|
-
* `frames` IN THE ORDER GIVEN (the caller is responsible for time
|
|
23710
|
-
* ordering — this method does not sort), and returns the tracks it
|
|
23711
|
-
* produced. Zero persistence: no `TrackStore`, no event bus, no media
|
|
23712
|
-
* capture. `zones` / `detectionRules` are the run's OWN zone set —
|
|
23713
|
-
* typically the camera's real zones plus an ephemeral overlay
|
|
23714
|
-
* (`addon-benchmark`'s `replay-plan.ts`), never read from or written to
|
|
23715
|
-
* the `zones` capability by this method itself.
|
|
23716
|
-
*/
|
|
23717
|
-
runReplayFrameProcessor: method(object({
|
|
23718
|
-
deviceId: number(),
|
|
23719
|
-
source: DetectionSourceSchema,
|
|
23720
|
-
zones: array(ZoneSchema).readonly().optional(),
|
|
23721
|
-
detectionRules: array(ZoneRuleSchema).readonly().optional(),
|
|
23722
|
-
zoneMembershipMinOverlap: number().min(0).max(1).optional(),
|
|
23723
|
-
frames: array(ReplayFrameInputSchema).min(1)
|
|
23724
|
-
}), RunReplayFrameProcessorResultSchema, {
|
|
23725
|
-
kind: "mutation",
|
|
23726
|
-
auth: "admin"
|
|
23727
|
-
}),
|
|
23728
23131
|
/** Every annotation on a track, oldest first. */
|
|
23729
23132
|
listRetrainAnnotations: method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
|
|
23730
23133
|
kind: "query",
|
|
@@ -23964,6 +23367,478 @@ var pipelineAnalyticsCapability = {
|
|
|
23964
23367
|
}) }
|
|
23965
23368
|
}
|
|
23966
23369
|
};
|
|
23370
|
+
/**
|
|
23371
|
+
* Reference to the frame's retained NATIVE surface + the parent crop's placement
|
|
23372
|
+
* within the frame, so the executor can re-cut a leaf child ROI at native
|
|
23373
|
+
* resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
|
|
23374
|
+
*/
|
|
23375
|
+
var NativeCropRefSchema = object({
|
|
23376
|
+
/** Handle keying the retained native surface (node-pinned to its owner). */
|
|
23377
|
+
handle: FrameHandleSchema,
|
|
23378
|
+
/** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
|
|
23379
|
+
cropFrameSpace: object({
|
|
23380
|
+
x: number(),
|
|
23381
|
+
y: number(),
|
|
23382
|
+
w: number(),
|
|
23383
|
+
h: number()
|
|
23384
|
+
})
|
|
23385
|
+
});
|
|
23386
|
+
object({
|
|
23387
|
+
crop: object({
|
|
23388
|
+
left: number(),
|
|
23389
|
+
top: number(),
|
|
23390
|
+
width: number().positive(),
|
|
23391
|
+
height: number().positive()
|
|
23392
|
+
}).optional(),
|
|
23393
|
+
content: object({
|
|
23394
|
+
width: number().int().positive(),
|
|
23395
|
+
height: number().int().positive()
|
|
23396
|
+
}),
|
|
23397
|
+
fit: _enum(["stretch", "contain"]),
|
|
23398
|
+
format: _enum([
|
|
23399
|
+
"rgb",
|
|
23400
|
+
"gray",
|
|
23401
|
+
"jpeg"
|
|
23402
|
+
])
|
|
23403
|
+
});
|
|
23404
|
+
/**
|
|
23405
|
+
* Process-local frame identity. It is serializable so it can ride an in-process
|
|
23406
|
+
* capability call, but `registryId` deliberately prevents resolution in any
|
|
23407
|
+
* other process or execution group.
|
|
23408
|
+
*/
|
|
23409
|
+
var FrameRefSchema = object({
|
|
23410
|
+
registryId: string().min(1),
|
|
23411
|
+
id: string().min(1),
|
|
23412
|
+
width: number().int().positive(),
|
|
23413
|
+
height: number().int().positive(),
|
|
23414
|
+
format: _enum(["rgb", "gray"]),
|
|
23415
|
+
timestamp: number(),
|
|
23416
|
+
capturedAt: number().optional()
|
|
23417
|
+
});
|
|
23418
|
+
var ModelFormatSchema$1 = _enum([
|
|
23419
|
+
"onnx",
|
|
23420
|
+
"coreml",
|
|
23421
|
+
"openvino",
|
|
23422
|
+
"tflite",
|
|
23423
|
+
"pt",
|
|
23424
|
+
"gguf"
|
|
23425
|
+
]);
|
|
23426
|
+
var PipelineSlotSchema = _enum([
|
|
23427
|
+
"detector",
|
|
23428
|
+
"cropper",
|
|
23429
|
+
"classifier",
|
|
23430
|
+
"refiner",
|
|
23431
|
+
"audio-classifier"
|
|
23432
|
+
]);
|
|
23433
|
+
var PipelineEngineChoiceSchema = object({
|
|
23434
|
+
runtime: literal("python"),
|
|
23435
|
+
backend: string(),
|
|
23436
|
+
format: ModelFormatSchema$1,
|
|
23437
|
+
device: string().optional()
|
|
23438
|
+
});
|
|
23439
|
+
/**
|
|
23440
|
+
* One pool's resolved provisioning (`getEffectiveTuning`). `numWorkers` is the
|
|
23441
|
+
* knob that lifts a saturated pool (`inference-devices.md`); `concurrency` is
|
|
23442
|
+
* per-worker in-flight requests. `deviceKey` echoes the pool asked about —
|
|
23443
|
+
* `null` for the node-default pool.
|
|
23444
|
+
*/
|
|
23445
|
+
var EffectiveTuningSchema = object({
|
|
23446
|
+
deviceKey: string().nullable(),
|
|
23447
|
+
runtime: string(),
|
|
23448
|
+
batchMode: string(),
|
|
23449
|
+
windowMs: number(),
|
|
23450
|
+
maxBatchSize: number(),
|
|
23451
|
+
concurrency: number(),
|
|
23452
|
+
numWorkers: number()
|
|
23453
|
+
});
|
|
23454
|
+
var AvailableEngineSchema = object({
|
|
23455
|
+
engine: PipelineEngineChoiceSchema,
|
|
23456
|
+
devices: array(object({
|
|
23457
|
+
id: string(),
|
|
23458
|
+
label: string(),
|
|
23459
|
+
description: string().optional()
|
|
23460
|
+
})).readonly(),
|
|
23461
|
+
defaultDevice: string()
|
|
23462
|
+
});
|
|
23463
|
+
var PipelineDefaultStepSchema = lazy(() => object({
|
|
23464
|
+
addonId: string(),
|
|
23465
|
+
addonName: string(),
|
|
23466
|
+
slot: PipelineSlotSchema,
|
|
23467
|
+
inputClasses: array(string()).readonly(),
|
|
23468
|
+
outputClasses: array(string()).readonly(),
|
|
23469
|
+
enabled: boolean(),
|
|
23470
|
+
modelId: string(),
|
|
23471
|
+
children: array(PipelineDefaultStepSchema).readonly(),
|
|
23472
|
+
group: string().optional(),
|
|
23473
|
+
settings: record(string(), unknown()).optional()
|
|
23474
|
+
}));
|
|
23475
|
+
var PipelineTemplateStepSchema = lazy(() => object({
|
|
23476
|
+
addonId: string(),
|
|
23477
|
+
enabled: boolean(),
|
|
23478
|
+
modelId: string(),
|
|
23479
|
+
children: array(PipelineTemplateStepSchema).readonly(),
|
|
23480
|
+
settings: record(string(), unknown()).optional()
|
|
23481
|
+
}));
|
|
23482
|
+
var PipelineTemplateSchema$1 = object({
|
|
23483
|
+
id: string(),
|
|
23484
|
+
name: string(),
|
|
23485
|
+
createdAt: string(),
|
|
23486
|
+
updatedAt: string(),
|
|
23487
|
+
engine: PipelineEngineChoiceSchema,
|
|
23488
|
+
steps: array(PipelineTemplateStepSchema).readonly()
|
|
23489
|
+
});
|
|
23490
|
+
var PipelineModelOptionSchema = object({
|
|
23491
|
+
id: string(),
|
|
23492
|
+
name: string(),
|
|
23493
|
+
formats: record(string(), object({
|
|
23494
|
+
downloaded: boolean(),
|
|
23495
|
+
sizeMB: number()
|
|
23496
|
+
})),
|
|
23497
|
+
group: ModelVariantGroupSchema.optional(),
|
|
23498
|
+
legacy: boolean().optional(),
|
|
23499
|
+
provider: ModelProviderIdSchema.optional()
|
|
23500
|
+
});
|
|
23501
|
+
var ConfigFieldBridge = custom();
|
|
23502
|
+
var PipelineAddonSchemaSchema = object({
|
|
23503
|
+
id: string(),
|
|
23504
|
+
name: string(),
|
|
23505
|
+
slot: PipelineSlotSchema,
|
|
23506
|
+
inputClasses: array(string()).readonly(),
|
|
23507
|
+
outputClasses: array(string()).readonly(),
|
|
23508
|
+
childSlots: array(PipelineSlotSchema).readonly(),
|
|
23509
|
+
models: array(PipelineModelOptionSchema).readonly(),
|
|
23510
|
+
defaultModelId: string(),
|
|
23511
|
+
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
23512
|
+
enabledByDefault: boolean().optional(),
|
|
23513
|
+
backfillIntoExistingOverrides: boolean().optional(),
|
|
23514
|
+
defaultConfidence: number(),
|
|
23515
|
+
group: string().optional(),
|
|
23516
|
+
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
23517
|
+
});
|
|
23518
|
+
var PipelineSlotSchemaSchema = object({
|
|
23519
|
+
id: PipelineSlotSchema,
|
|
23520
|
+
label: string(),
|
|
23521
|
+
priority: number(),
|
|
23522
|
+
parentSlot: PipelineSlotSchema.nullable(),
|
|
23523
|
+
addons: array(PipelineAddonSchemaSchema).readonly()
|
|
23524
|
+
});
|
|
23525
|
+
var PipelineSchemaSchema = object({
|
|
23526
|
+
availableEngines: array(AvailableEngineSchema).readonly(),
|
|
23527
|
+
selectedEngine: PipelineEngineChoiceSchema,
|
|
23528
|
+
slots: array(PipelineSlotSchemaSchema).readonly()
|
|
23529
|
+
});
|
|
23530
|
+
var EngineProvisioningSchema = object({
|
|
23531
|
+
runtimeId: _enum([
|
|
23532
|
+
"onnx",
|
|
23533
|
+
"openvino",
|
|
23534
|
+
"coreml",
|
|
23535
|
+
"edgetpu"
|
|
23536
|
+
]).nullable(),
|
|
23537
|
+
device: string().nullable(),
|
|
23538
|
+
state: _enum([
|
|
23539
|
+
"idle",
|
|
23540
|
+
"installing",
|
|
23541
|
+
"verifying",
|
|
23542
|
+
"ready",
|
|
23543
|
+
"failed"
|
|
23544
|
+
]),
|
|
23545
|
+
progress: number().optional(),
|
|
23546
|
+
error: string().optional(),
|
|
23547
|
+
nextRetryAt: number().optional(),
|
|
23548
|
+
/**
|
|
23549
|
+
* Gate A (config-correctness gate at engine change): human-readable
|
|
23550
|
+
* config issues surfaced EAGERLY when the node's engine changes — model
|
|
23551
|
+
* substitutions ("chose X, running Y") and zero-build steps ("no model
|
|
23552
|
+
* has a <format> build"). Additive/optional: informational only, never
|
|
23553
|
+
* enforced here — `assertEngineReady` (readiness) still gates inference.
|
|
23554
|
+
* Absent/empty when the node-default tree resolves cleanly.
|
|
23555
|
+
*/
|
|
23556
|
+
configIssues: array(string()).optional()
|
|
23557
|
+
});
|
|
23558
|
+
var PipelineStepInputSchema = lazy(() => object({
|
|
23559
|
+
addonId: string(),
|
|
23560
|
+
modelId: string().optional(),
|
|
23561
|
+
enabled: boolean().default(true),
|
|
23562
|
+
children: array(PipelineStepInputSchema).optional(),
|
|
23563
|
+
settings: record(string(), unknown()).optional(),
|
|
23564
|
+
jumpDeviceKey: string().optional()
|
|
23565
|
+
}));
|
|
23566
|
+
var ModelSubstitutionSchema = object({
|
|
23567
|
+
addonId: string(),
|
|
23568
|
+
chosen: string(),
|
|
23569
|
+
running: string(),
|
|
23570
|
+
format: string()
|
|
23571
|
+
});
|
|
23572
|
+
var PipelineValidationIssueSchema = object({
|
|
23573
|
+
addonId: string(),
|
|
23574
|
+
kind: _enum([
|
|
23575
|
+
"unknown-addon",
|
|
23576
|
+
"no-format-build",
|
|
23577
|
+
"unknown-device"
|
|
23578
|
+
]),
|
|
23579
|
+
detail: string()
|
|
23580
|
+
});
|
|
23581
|
+
var PipelineValidationResultSchema = object({
|
|
23582
|
+
ok: boolean(),
|
|
23583
|
+
issues: array(PipelineValidationIssueSchema).readonly(),
|
|
23584
|
+
substitutions: array(ModelSubstitutionSchema).readonly(),
|
|
23585
|
+
/** The node's `currentEngine.format` this validation ran against. */
|
|
23586
|
+
format: string()
|
|
23587
|
+
});
|
|
23588
|
+
var ReferenceImageEntrySchema = object({
|
|
23589
|
+
filename: string(),
|
|
23590
|
+
stepIds: array(string()).readonly().optional()
|
|
23591
|
+
});
|
|
23592
|
+
var ReferenceImageBodySchema = object({
|
|
23593
|
+
base64: string(),
|
|
23594
|
+
filename: string()
|
|
23595
|
+
});
|
|
23596
|
+
var ReferenceAudioEntrySchema = object({
|
|
23597
|
+
filename: string(),
|
|
23598
|
+
sizeKb: number()
|
|
23599
|
+
});
|
|
23600
|
+
var ReferenceAudioBodySchema = object({ base64: string() });
|
|
23601
|
+
var AudioBackendSchema = object({
|
|
23602
|
+
id: string(),
|
|
23603
|
+
name: string(),
|
|
23604
|
+
description: string(),
|
|
23605
|
+
available: boolean(),
|
|
23606
|
+
/**
|
|
23607
|
+
* Raw classifier labels this backend can emit (e.g. YAMNet's
|
|
23608
|
+
* 521-class set or Apple SoundAnalysis's 303-class set). Used by
|
|
23609
|
+
* the benchmark UI to populate the `enabledMicroClasses` filter
|
|
23610
|
+
* specific to the selected backend without a separate fetch.
|
|
23611
|
+
*/
|
|
23612
|
+
rawLabels: array(string()).readonly().optional()
|
|
23613
|
+
});
|
|
23614
|
+
var AudioCapabilitiesSchema = object({
|
|
23615
|
+
activeBackend: string(),
|
|
23616
|
+
availableBackends: array(AudioBackendSchema).readonly(),
|
|
23617
|
+
sampleRate: number(),
|
|
23618
|
+
chunkDurationMs: number()
|
|
23619
|
+
});
|
|
23620
|
+
var DownloadModelResultSchema = object({
|
|
23621
|
+
filePath: string(),
|
|
23622
|
+
sizeMB: number(),
|
|
23623
|
+
durationMs: number()
|
|
23624
|
+
});
|
|
23625
|
+
/**
|
|
23626
|
+
* Wrapper carrying a single test run's result. Replaces the legacy
|
|
23627
|
+
* ad-hoc `{labels: [{className, originalClass, score}]}` shape with the
|
|
23628
|
+
* canonical `AudioResult` from the Phase 6 output rework: one
|
|
23629
|
+
* `AudioDetection` per class above `minScore`, top-N candidates in
|
|
23630
|
+
* `debug.alternateLabels['audio-classifier']`, per-source timings in
|
|
23631
|
+
* `debug.stepTimings`. The outer `success`/`error` fields stay so the
|
|
23632
|
+
* benchmark UI can still report a clean failure when the classifier
|
|
23633
|
+
* cap isn't available.
|
|
23634
|
+
*/
|
|
23635
|
+
var AudioTestResultSchema = object({
|
|
23636
|
+
success: boolean(),
|
|
23637
|
+
error: string().optional(),
|
|
23638
|
+
frame: custom().optional()
|
|
23639
|
+
});
|
|
23640
|
+
var PipelineConfigBridge = custom();
|
|
23641
|
+
var ConfigUISchemaBridge = custom();
|
|
23642
|
+
var ConfigUISchemaNullableBridge = custom();
|
|
23643
|
+
var InferenceCapabilitiesBridge = custom();
|
|
23644
|
+
var ModelAvailabilityListBridge = custom();
|
|
23645
|
+
var PipelineRunResultBridge = custom();
|
|
23646
|
+
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
23647
|
+
modelId: string(),
|
|
23648
|
+
settings: record(string(), unknown()).readonly()
|
|
23649
|
+
}))), method(object({ steps: record(string(), object({
|
|
23650
|
+
modelId: string(),
|
|
23651
|
+
settings: record(string(), unknown()).readonly()
|
|
23652
|
+
})) }), object({ success: literal(true) }), {
|
|
23653
|
+
kind: "mutation",
|
|
23654
|
+
auth: "admin"
|
|
23655
|
+
}), method(object({ nodeId: string() }), object({
|
|
23656
|
+
success: literal(true),
|
|
23657
|
+
clearedDevices: number()
|
|
23658
|
+
}), {
|
|
23659
|
+
kind: "mutation",
|
|
23660
|
+
auth: "admin"
|
|
23661
|
+
}), method(object({ nodeId: string() }), object({ unhealthy: array(object({
|
|
23662
|
+
/** `<backend>:<device>`, e.g. `openvino:gpu`. */
|
|
23663
|
+
deviceKey: string(),
|
|
23664
|
+
/**
|
|
23665
|
+
* `failed` — the per-device restart budget is exhausted; no pool
|
|
23666
|
+
* will be spawned until an operator re-arms it or the runner
|
|
23667
|
+
* respawns. `backoff` — under budget, waiting out the backoff (or
|
|
23668
|
+
* a cached pool observed dead and not yet condemned).
|
|
23669
|
+
*/
|
|
23670
|
+
state: _enum(["failed", "backoff"]),
|
|
23671
|
+
/** Epoch ms of the death that produced this state. */
|
|
23672
|
+
since: number(),
|
|
23673
|
+
/** Pool deaths inside the current window. */
|
|
23674
|
+
deaths: number(),
|
|
23675
|
+
/** The last death's message. */
|
|
23676
|
+
lastError: string()
|
|
23677
|
+
})).readonly() })), method(object({
|
|
23678
|
+
nodeId: string(),
|
|
23679
|
+
deviceKey: string()
|
|
23680
|
+
}), object({ rearmed: boolean() }), {
|
|
23681
|
+
kind: "mutation",
|
|
23682
|
+
auth: "admin"
|
|
23683
|
+
}), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({
|
|
23684
|
+
steps: array(PipelineStepInputSchema),
|
|
23685
|
+
deviceKey: string().optional()
|
|
23686
|
+
}), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
|
|
23687
|
+
name: string(),
|
|
23688
|
+
steps: array(PipelineTemplateStepSchema).readonly(),
|
|
23689
|
+
engine: PipelineEngineChoiceSchema
|
|
23690
|
+
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
|
|
23691
|
+
id: string(),
|
|
23692
|
+
name: string().optional(),
|
|
23693
|
+
steps: array(PipelineTemplateStepSchema).readonly().optional()
|
|
23694
|
+
}), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
|
|
23695
|
+
addonId: string(),
|
|
23696
|
+
modelId: string(),
|
|
23697
|
+
format: ModelFormatSchema$1
|
|
23698
|
+
}), DownloadModelResultSchema, { kind: "mutation" }), method(object({
|
|
23699
|
+
addonId: string(),
|
|
23700
|
+
modelId: string(),
|
|
23701
|
+
format: ModelFormatSchema$1
|
|
23702
|
+
}), object({ success: literal(true) }), { kind: "mutation" }), method(object({
|
|
23703
|
+
steps: array(PipelineStepInputSchema).min(1),
|
|
23704
|
+
frame: FrameInputSchema.optional(),
|
|
23705
|
+
/**
|
|
23706
|
+
* Process-local lazy frame. Valid only when caller and provider resolve
|
|
23707
|
+
* in the same execution-group process; split/cross-node callers use
|
|
23708
|
+
* `frame`/`image` inline compatibility instead.
|
|
23709
|
+
*/
|
|
23710
|
+
frameRef: FrameRefSchema.optional(),
|
|
23711
|
+
/**
|
|
23712
|
+
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
23713
|
+
* the decoded pixels live in. One more member of the one-of
|
|
23714
|
+
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
23715
|
+
*/
|
|
23716
|
+
frameHandle: FrameHandleSchema.optional(),
|
|
23717
|
+
imageBase64: string().optional(),
|
|
23718
|
+
/**
|
|
23719
|
+
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
23720
|
+
* hops (hub → forked worker via Moleculer MsgPack) because it
|
|
23721
|
+
* skips the 33% base64 overhead + the per-call base64 decode on
|
|
23722
|
+
* the detection-pipeline worker. Callers can pass either; exactly
|
|
23723
|
+
* one of `frame`/`image`/`imageBase64`/`referenceImage` is required.
|
|
23724
|
+
*/
|
|
23725
|
+
image: _instanceof(Uint8Array).optional(),
|
|
23726
|
+
referenceImage: string().optional(),
|
|
23727
|
+
deviceId: number().optional(),
|
|
23728
|
+
sessionId: string().optional(),
|
|
23729
|
+
/**
|
|
23730
|
+
* Execution plane. 'full' (default) runs the whole tree — benchmark,
|
|
23731
|
+
* reference-image, and detail-subtree calls. 'frame' is the live
|
|
23732
|
+
* per-frame dispatch: ONLY root-plane steps run; crop children
|
|
23733
|
+
* (inputClasses ≠ null) are skipped and served per-track via
|
|
23734
|
+
* pipelineRunner.runDetailSubtree (two-plane design).
|
|
23735
|
+
*/
|
|
23736
|
+
plane: _enum(["full", "frame"]).optional(),
|
|
23737
|
+
/**
|
|
23738
|
+
* Inference-device selector (Phase 2 multi-device). Format
|
|
23739
|
+
* `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
|
|
23740
|
+
* Omitted ⇒ the runner's default device (current single-engine
|
|
23741
|
+
* behaviour). Selects WHICH device pool of the node runs the call.
|
|
23742
|
+
*/
|
|
23743
|
+
deviceKey: string().optional(),
|
|
23744
|
+
/**
|
|
23745
|
+
* Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
|
|
23746
|
+
* when the parent crop was resolved from the frame's retained NATIVE
|
|
23747
|
+
* surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
|
|
23748
|
+
* child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
|
|
23749
|
+
* resolution from that surface — the SAME quality path faces already
|
|
23750
|
+
* had — instead of the downscaled parent tile. `handle` keys the native
|
|
23751
|
+
* surface (node-pinned to its owner); `cropFrameSpace` is the parent
|
|
23752
|
+
* crop's padded/clamped rectangle in FRAME-space pixels, used to compose
|
|
23753
|
+
* the executor's crop-normalized child ROI back into frame-normalized
|
|
23754
|
+
* coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
|
|
23755
|
+
* of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
|
|
23756
|
+
* (today's behaviour on the fallback path).
|
|
23757
|
+
*/
|
|
23758
|
+
nativeCropRef: NativeCropRefSchema.optional(),
|
|
23759
|
+
/**
|
|
23760
|
+
* Offline REPLAY of stored media for `deviceId` (D56, D646): the
|
|
23761
|
+
* camera's zone gate and overrides apply as live, every executing
|
|
23762
|
+
* step runs EXACTLY the model it names on the `deviceKey` pool it
|
|
23763
|
+
* names or the call refuses (`model-not-servable` /
|
|
23764
|
+
* `device-not-servable`), and nothing reaches the camera's live
|
|
23765
|
+
* trace stream. Absent ⇒ unchanged behaviour.
|
|
23766
|
+
*/
|
|
23767
|
+
replay: literal(true).optional()
|
|
23768
|
+
}), PipelineRunResultBridge, { kind: "mutation" }), method(object({
|
|
23769
|
+
steps: array(PipelineStepInputSchema).min(1),
|
|
23770
|
+
frames: array(FrameInputSchema).min(1).max(255),
|
|
23771
|
+
deviceId: number().optional(),
|
|
23772
|
+
sessionId: string().optional(),
|
|
23773
|
+
/**
|
|
23774
|
+
* Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
|
|
23775
|
+
* the batch to the Python pool's bench preprocess cache
|
|
23776
|
+
* (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
|
|
23777
|
+
* preprocessed ONCE and every later inference is a pure-inference cache
|
|
23778
|
+
* hit — the sustained-throughput run measures inference, not
|
|
23779
|
+
* decode+preprocess+infer. Omitted/0 for live frames (all different →
|
|
23780
|
+
* full preprocess every call, correct). Fresh per sustained run;
|
|
23781
|
+
* released via `uncacheFrame`.
|
|
23782
|
+
*/
|
|
23783
|
+
frameId: number().int().nonnegative().optional(),
|
|
23784
|
+
/** Inference-device selector (Phase 2 multi-device); see runPipeline. */
|
|
23785
|
+
deviceKey: string().optional()
|
|
23786
|
+
}), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
|
|
23787
|
+
data: _instanceof(Uint8Array),
|
|
23788
|
+
width: number().int().positive(),
|
|
23789
|
+
height: number().int().positive(),
|
|
23790
|
+
format: _enum([
|
|
23791
|
+
"rgb",
|
|
23792
|
+
"bgr",
|
|
23793
|
+
"gray"
|
|
23794
|
+
])
|
|
23795
|
+
}), object({
|
|
23796
|
+
frameId: number(),
|
|
23797
|
+
width: number(),
|
|
23798
|
+
height: number()
|
|
23799
|
+
}), { kind: "mutation" }), method(object({
|
|
23800
|
+
stepId: string(),
|
|
23801
|
+
frameId: number().int()
|
|
23802
|
+
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(object({ deviceKey: string().optional() }), EffectiveTuningSchema), method(_void(), array(object({
|
|
23803
|
+
engineKey: string(),
|
|
23804
|
+
engine: PipelineEngineChoiceSchema,
|
|
23805
|
+
modelsLoaded: array(string()).readonly(),
|
|
23806
|
+
inUseByCameras: array(number()).readonly(),
|
|
23807
|
+
/**
|
|
23808
|
+
* Origin of this resident factory.
|
|
23809
|
+
* - `runtime` — main camera-serving engine (no idle TTL).
|
|
23810
|
+
* - `device-pool` — a concurrent per-device pool (Phase 2
|
|
23811
|
+
* multi-device, keyed by `deviceKey`) resolved
|
|
23812
|
+
* via `resolveDeviceFactory`. Runs alongside the
|
|
23813
|
+
* `runtime` engine on a DIFFERENT accelerator
|
|
23814
|
+
* (NPU / iGPU / Coral) — this is how the
|
|
23815
|
+
* Engines tab shows all pools running at once.
|
|
23816
|
+
*/
|
|
23817
|
+
kind: _enum(["runtime", "device-pool"]),
|
|
23818
|
+
/** Native pid of the underlying Python pool (null when no pool). */
|
|
23819
|
+
poolPid: number().nullable(),
|
|
23820
|
+
/** ms since this factory was last used (null when not warm-tracked). */
|
|
23821
|
+
idleMs: number().nullable(),
|
|
23822
|
+
/** Idle TTL after which the factory self-evicts (null when not applicable). */
|
|
23823
|
+
idleTtlMs: number().nullable()
|
|
23824
|
+
})).readonly()), method(object({ engine: PipelineEngineChoiceSchema }), object({ success: literal(true) }), {
|
|
23825
|
+
kind: "mutation",
|
|
23826
|
+
auth: "admin"
|
|
23827
|
+
}), method(object({
|
|
23828
|
+
engine: PipelineEngineChoiceSchema,
|
|
23829
|
+
force: boolean().optional()
|
|
23830
|
+
}), object({
|
|
23831
|
+
success: boolean(),
|
|
23832
|
+
reason: string().optional()
|
|
23833
|
+
}), {
|
|
23834
|
+
kind: "mutation",
|
|
23835
|
+
auth: "admin"
|
|
23836
|
+
}), 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({
|
|
23837
|
+
addonId: string(),
|
|
23838
|
+
modelId: string(),
|
|
23839
|
+
filename: string().optional(),
|
|
23840
|
+
settings: record(string(), unknown()).optional()
|
|
23841
|
+
}), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
|
|
23967
23842
|
object({
|
|
23968
23843
|
activeCameras: number(),
|
|
23969
23844
|
throttledCameras: number(),
|
|
@@ -23989,6 +23864,106 @@ var CameraMetricsSchema = object({
|
|
|
23989
23864
|
});
|
|
23990
23865
|
var CameraMetricsWithDeviceIdSchema = CameraMetricsSchema.extend({ deviceId: number() });
|
|
23991
23866
|
/**
|
|
23867
|
+
* Zone — pure geometry + identity. NO filtering behaviour.
|
|
23868
|
+
*
|
|
23869
|
+
* Zones describe **where** in the frame the operator wants to flag
|
|
23870
|
+
* something; consumer-owned {@link ZoneRule} arrays describe **how**
|
|
23871
|
+
* each pipeline stage uses them. Splitting the two means a single
|
|
23872
|
+
* polygon "Driveway" can simultaneously back a motion-exclude rule,
|
|
23873
|
+
* a detection-include rule on `['car']`, and an occupancy aggregate
|
|
23874
|
+
* — without three duplicated polygons.
|
|
23875
|
+
*
|
|
23876
|
+
* Owned by the orchestrator addon (provider) and mirrored into the
|
|
23877
|
+
* `zones` device-state slice on every mutation. Consumers
|
|
23878
|
+
* (motion-wasm, pipeline-executor, analytics, admin UI) read either
|
|
23879
|
+
* via `api.zones.listZones` (one-shot) or via `dev.state.zones` (live
|
|
23880
|
+
* mirror with `onChanged`).
|
|
23881
|
+
*
|
|
23882
|
+
* Coordinates are normalised fractions of the frame (0–1) so zones
|
|
23883
|
+
* survive resolution changes and stream profile switches.
|
|
23884
|
+
*
|
|
23885
|
+
* `kind` discriminates between full polygons (closed regions used
|
|
23886
|
+
* for intrusion / occupancy filters) and tripwires (open 2-point
|
|
23887
|
+
* line segments used for cross events). Onboard / firmware-reported
|
|
23888
|
+
* zones (Reolink, ONVIF) are out of scope for now — see the deferred
|
|
23889
|
+
* task list.
|
|
23890
|
+
*/
|
|
23891
|
+
var ZoneKindEnum = _enum(["polygon", "tripwire"]);
|
|
23892
|
+
/** Polygon vertex in fraction-of-frame coordinates (0–1). */
|
|
23893
|
+
var PolygonPointSchema = object({
|
|
23894
|
+
x: number(),
|
|
23895
|
+
y: number()
|
|
23896
|
+
});
|
|
23897
|
+
/** A camera detection zone — pure geometry/identity. */
|
|
23898
|
+
var ZoneSchema = object({
|
|
23899
|
+
id: string(),
|
|
23900
|
+
name: string(),
|
|
23901
|
+
kind: ZoneKindEnum.default("polygon"),
|
|
23902
|
+
/** Polygon vertices, fraction of frame (0–1). */
|
|
23903
|
+
polygon: array(PolygonPointSchema).readonly(),
|
|
23904
|
+
/** Visual color for UI rendering. */
|
|
23905
|
+
color: string().default("#3b82f6")
|
|
23906
|
+
});
|
|
23907
|
+
/**
|
|
23908
|
+
* Zones capability — per-camera CRUD over polygon detection zones.
|
|
23909
|
+
*
|
|
23910
|
+
* Provider lives in `addon-pipeline-orchestrator` (hub-only). Persists
|
|
23911
|
+
* to per-device settings and mirrors into the `zones` device-state
|
|
23912
|
+
* slice on every mutation, so downstream consumers can subscribe via
|
|
23913
|
+
* `dev.state.zones.onChanged`.
|
|
23914
|
+
*
|
|
23915
|
+
* The cap surface only handles geometry + identity; filtering
|
|
23916
|
+
* behaviour (per-class, include/exclude, threshold) lives in the
|
|
23917
|
+
* consumer addons' rule arrays — see `ZoneRuleSchema` exported from
|
|
23918
|
+
* `capabilities/schemas/zone-rule.js`.
|
|
23919
|
+
*/
|
|
23920
|
+
var zonesCapability = {
|
|
23921
|
+
name: "zones",
|
|
23922
|
+
scope: "device",
|
|
23923
|
+
mode: "singleton",
|
|
23924
|
+
deviceTypes: [DeviceType.Camera],
|
|
23925
|
+
methods: {
|
|
23926
|
+
listZones: method(object({ deviceId: number() }), array(ZoneSchema).readonly()),
|
|
23927
|
+
addZone: method(object({
|
|
23928
|
+
deviceId: number(),
|
|
23929
|
+
zone: ZoneSchema
|
|
23930
|
+
}), _void(), {
|
|
23931
|
+
kind: "mutation",
|
|
23932
|
+
auth: "admin"
|
|
23933
|
+
}),
|
|
23934
|
+
removeZone: method(object({
|
|
23935
|
+
deviceId: number(),
|
|
23936
|
+
zoneId: string()
|
|
23937
|
+
}), _void(), {
|
|
23938
|
+
kind: "mutation",
|
|
23939
|
+
auth: "admin"
|
|
23940
|
+
}),
|
|
23941
|
+
updateZone: method(object({
|
|
23942
|
+
deviceId: number(),
|
|
23943
|
+
zone: ZoneSchema
|
|
23944
|
+
}), _void(), {
|
|
23945
|
+
kind: "mutation",
|
|
23946
|
+
auth: "admin"
|
|
23947
|
+
})
|
|
23948
|
+
},
|
|
23949
|
+
/**
|
|
23950
|
+
* Runtime-state slice — the live zone catalogue mirrored by the
|
|
23951
|
+
* orchestrator on every CRUD mutation. Consumers read via
|
|
23952
|
+
* `device.state.zones.value` / `.watch(...)` without round-tripping
|
|
23953
|
+
* the cap, and the codegen DeviceProxy auto-wires the reactive
|
|
23954
|
+
* handle. Slice shape is `{ zones: Zone[] }` so future extensions
|
|
23955
|
+
* (e.g. zone groupings) can sit alongside the polygon list.
|
|
23956
|
+
*/
|
|
23957
|
+
runtimeState: object({ zones: array(ZoneSchema).readonly() }),
|
|
23958
|
+
/**
|
|
23959
|
+
* Runtime-state durability: **restored** — written only on operator mutation, so a camera that never had one has nothing to re-derive from. This is the slice `zone-mirror-hydration.ts` exists to paper over.
|
|
23960
|
+
*
|
|
23961
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23962
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
23963
|
+
*/
|
|
23964
|
+
durability: "restored"
|
|
23965
|
+
};
|
|
23966
|
+
/**
|
|
23992
23967
|
* A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
|
|
23993
23968
|
* decode worker resolves it against the RETAINED native frame's real pixel dims,
|
|
23994
23969
|
* so the caller supplies only the detection-res bbox divided by the detection
|
|
@@ -34362,7 +34337,7 @@ var HardwareInfoSchema = object({
|
|
|
34362
34337
|
coral: CoralInfoSchema.nullable().optional()
|
|
34363
34338
|
});
|
|
34364
34339
|
var PlatformScoreSchema = object({
|
|
34365
|
-
runtime:
|
|
34340
|
+
runtime: literal("python"),
|
|
34366
34341
|
backend: string(),
|
|
34367
34342
|
format: _enum([
|
|
34368
34343
|
"onnx",
|
|
@@ -34399,7 +34374,7 @@ var ModelRequirementSchema = object({
|
|
|
34399
34374
|
});
|
|
34400
34375
|
var ResolvedInferenceConfigSchema = object({
|
|
34401
34376
|
modelId: string(),
|
|
34402
|
-
runtime:
|
|
34377
|
+
runtime: literal("python"),
|
|
34403
34378
|
backend: string(),
|
|
34404
34379
|
format: ModelFormatSchema,
|
|
34405
34380
|
reason: string()
|
|
@@ -36994,6 +36969,92 @@ var sceneMonitorCapability = {
|
|
|
36994
36969
|
durability: "session"
|
|
36995
36970
|
};
|
|
36996
36971
|
/**
|
|
36972
|
+
* Per-stage gating mode applied to the zones a rule references.
|
|
36973
|
+
*
|
|
36974
|
+
* - `include`: the rule contributes to a **whitelist** for its stage.
|
|
36975
|
+
* When at least one `include` rule fires for a stage, only entities
|
|
36976
|
+
* inside one of those zones pass that stage.
|
|
36977
|
+
* - `exclude`: the rule contributes to a **blacklist** for its stage.
|
|
36978
|
+
* Entities inside one of those zones are dropped at that stage.
|
|
36979
|
+
*
|
|
36980
|
+
* `monitor`-style observation (count without filtering) is not a rule
|
|
36981
|
+
* mode — zones without any matching rule are observed naturally by
|
|
36982
|
+
* `zone-analytics` (live snapshot + history), so an "I just want to
|
|
36983
|
+
* count, not filter" use case needs no rule at all.
|
|
36984
|
+
*/
|
|
36985
|
+
var ZoneRuleModeEnum = _enum(["include", "exclude"]);
|
|
36986
|
+
/**
|
|
36987
|
+
* Per-consumer rule that references existing zones (geometry) and
|
|
36988
|
+
* defines how a specific pipeline stage should treat them. Each
|
|
36989
|
+
* consumer addon owns its own `ZoneRule[]` array in its per-device
|
|
36990
|
+
* settings:
|
|
36991
|
+
*
|
|
36992
|
+
* - `addon-motion-wasm` → `motionZoneRules: ZoneRule[]` (motion stage)
|
|
36993
|
+
* - `addon-detection-pipeline` → `detectionZoneRules: ZoneRule[]` (detection stage)
|
|
36994
|
+
* - future: notification rules, audio gating, etc.
|
|
36995
|
+
*
|
|
36996
|
+
* One rule applies to N zones (`zoneIds[]`) so the operator can
|
|
36997
|
+
* express "ignore motion in ALL of {garden, street}" with a single
|
|
36998
|
+
* rule. `classFilter` narrows the rule to specific object classes —
|
|
36999
|
+
* "drop person detections in the street, but keep cars" is one
|
|
37000
|
+
* `exclude` rule with `classFilter: ['person']`.
|
|
37001
|
+
*
|
|
37002
|
+
* `enabled` is a soft toggle — the operator can keep the rule
|
|
37003
|
+
* configured but inert without deleting it.
|
|
37004
|
+
*/
|
|
37005
|
+
var ZoneRuleSchema = object({
|
|
37006
|
+
/** Stable rule id — survives edits, used by the UI for diffing. */
|
|
37007
|
+
id: string(),
|
|
37008
|
+
/** Optional human-readable label rendered in the rule editor. */
|
|
37009
|
+
name: string().optional(),
|
|
37010
|
+
/** Zones this rule targets. The rule's `mode` applies to ALL
|
|
37011
|
+
* listed zones (OR-set: a detection in any one of them counts).
|
|
37012
|
+
* At least one zone id required — a rule with no targets is a
|
|
37013
|
+
* configuration mistake and the form validator rejects it. */
|
|
37014
|
+
zoneIds: array(string()).min(1).readonly(),
|
|
37015
|
+
mode: ZoneRuleModeEnum,
|
|
37016
|
+
/**
|
|
37017
|
+
* Class names this rule applies to. Empty / undefined ⇒ rule
|
|
37018
|
+
* applies to every class. Class strings match the `macroClass`
|
|
37019
|
+
* field on detections (e.g. `person`, `car`, `dog`).
|
|
37020
|
+
*/
|
|
37021
|
+
classFilter: array(string()).readonly().optional(),
|
|
37022
|
+
/**
|
|
37023
|
+
* Minimum bbox/mask overlap (0–1) with any of the rule's zones
|
|
37024
|
+
* required to consider an entity "in the zone". Defaults to the
|
|
37025
|
+
* consumer's stage default when omitted. Kept for back-compat with
|
|
37026
|
+
* existing per-rule overrides; new operators pick the value via
|
|
37027
|
+
* `bboxInclusionPct` (operator-friendly 0–100). Whichever field is
|
|
37028
|
+
* set, the lower-level engine reads it as a 0–1 fraction.
|
|
37029
|
+
*/
|
|
37030
|
+
overlapThreshold: number().min(0).max(1).optional(),
|
|
37031
|
+
/**
|
|
37032
|
+
* Operator-friendly version of `overlapThreshold` — the percentage
|
|
37033
|
+
* of the detection's bbox that must lie inside the zone for the
|
|
37034
|
+
* rule to match. Documented default is 85%; the engine substitutes
|
|
37035
|
+
* that when the field is omitted (kept optional so existing rules
|
|
37036
|
+
* stored without it stay valid).
|
|
37037
|
+
*
|
|
37038
|
+
* When BOTH `overlapThreshold` and `bboxInclusionPct` are set on a
|
|
37039
|
+
* rule, the engine prefers `bboxInclusionPct` because it's the
|
|
37040
|
+
* field exposed in the UI. Internally both feed the same gate.
|
|
37041
|
+
*/
|
|
37042
|
+
bboxInclusionPct: number().min(0).max(100).optional(),
|
|
37043
|
+
/**
|
|
37044
|
+
* When `true` and a detection has a segmentation mask, use the
|
|
37045
|
+
* mask for overlap instead of the bbox. Detection-stage only;
|
|
37046
|
+
* motion rules ignore this field.
|
|
37047
|
+
*/
|
|
37048
|
+
preferMask: boolean().optional(),
|
|
37049
|
+
/**
|
|
37050
|
+
* Soft-toggle: `false` disables the rule without deleting it.
|
|
37051
|
+
* Defaults to `true` so operators creating a rule via the UI
|
|
37052
|
+
* see it active immediately.
|
|
37053
|
+
*/
|
|
37054
|
+
enabled: boolean().default(true)
|
|
37055
|
+
});
|
|
37056
|
+
array(ZoneRuleSchema).readonly();
|
|
37057
|
+
/**
|
|
36997
37058
|
* Script-runner cap. Models HA `script.*` entities on
|
|
36998
37059
|
* `DeviceType.Script`. A Script is a pre-recorded action sequence
|
|
36999
37060
|
* that can be invoked imperatively — optionally with a variables
|
|
@@ -45165,6 +45226,12 @@ Object.freeze({
|
|
|
45165
45226
|
addonId: null,
|
|
45166
45227
|
access: "view"
|
|
45167
45228
|
},
|
|
45229
|
+
"notificationRules.previewStateSummary": {
|
|
45230
|
+
capName: "notification-rules",
|
|
45231
|
+
capScope: "system",
|
|
45232
|
+
addonId: null,
|
|
45233
|
+
access: "view"
|
|
45234
|
+
},
|
|
45168
45235
|
"notificationRules.previewTemplate": {
|
|
45169
45236
|
capName: "notification-rules",
|
|
45170
45237
|
capScope: "system",
|
|
@@ -45741,12 +45808,6 @@ Object.freeze({
|
|
|
45741
45808
|
addonId: null,
|
|
45742
45809
|
access: "create"
|
|
45743
45810
|
},
|
|
45744
|
-
"pipelineAnalytics.runReplayFrameProcessor": {
|
|
45745
|
-
capName: "pipeline-analytics",
|
|
45746
|
-
capScope: "device",
|
|
45747
|
-
addonId: null,
|
|
45748
|
-
access: "create"
|
|
45749
|
-
},
|
|
45750
45811
|
"pipelineAnalytics.saveRetrainAnnotations": {
|
|
45751
45812
|
capName: "pipeline-analytics",
|
|
45752
45813
|
capScope: "device",
|
|
@@ -49844,11 +49905,6 @@ Object.freeze({
|
|
|
49844
49905
|
form: "single",
|
|
49845
49906
|
optional: false
|
|
49846
49907
|
}],
|
|
49847
|
-
"pipelineAnalytics.runReplayFrameProcessor": [{
|
|
49848
|
-
name: "deviceId",
|
|
49849
|
-
form: "single",
|
|
49850
|
-
optional: false
|
|
49851
|
-
}],
|
|
49852
49908
|
"pipelineAnalytics.saveRetrainAnnotations": [{
|
|
49853
49909
|
name: "deviceId",
|
|
49854
49910
|
form: "single",
|
|
@@ -50886,7 +50942,8 @@ var NC_SYSTEM_EVENT_FAMILY = {
|
|
|
50886
50942
|
"camera-disabled": null,
|
|
50887
50943
|
"camera-enabled": null
|
|
50888
50944
|
};
|
|
50889
|
-
|
|
50945
|
+
/** Read by NAME, for kinds that arrive as plain strings (a newer hub, the viewer's mirror). */
|
|
50946
|
+
var FAMILY_BY_NAME = new Map(Object.entries(NC_SYSTEM_EVENT_FAMILY));
|
|
50890
50947
|
var NC_SYSTEM_EVENT_CONDITION_FILTER_KEYS = [...NC_SYSTEM_EVENT_FILTER_KEYS, "excludeDeviceIds"];
|
|
50891
50948
|
/**
|
|
50892
50949
|
* The filters a family may carry. The base filters are the union of
|
|
@@ -50997,6 +51054,24 @@ function systemEventKindsOfFamily(family) {
|
|
|
50997
51054
|
return NC_SYSTEM_EVENT_KIND_GROUP_SPECS.filter((g) => g.family === family).flatMap((g) => g.kinds);
|
|
50998
51055
|
}
|
|
50999
51056
|
/**
|
|
51057
|
+
* One family, or `mixed`. Mixed covers kinds that span families, a legacy kind,
|
|
51058
|
+
* a kind this build does not know (it fails toward read-only and never toward
|
|
51059
|
+
* editable), and an empty selection (nothing to decide on).
|
|
51060
|
+
*/
|
|
51061
|
+
function systemEventFamilyOf(kindNames) {
|
|
51062
|
+
const families = /* @__PURE__ */ new Set();
|
|
51063
|
+
for (const name of kindNames) {
|
|
51064
|
+
const family = FAMILY_BY_NAME.get(name);
|
|
51065
|
+
if (family === void 0 || family === null) return { kind: "mixed" };
|
|
51066
|
+
families.add(family);
|
|
51067
|
+
}
|
|
51068
|
+
const [only] = [...families];
|
|
51069
|
+
return families.size === 1 && only !== void 0 ? {
|
|
51070
|
+
kind: "family",
|
|
51071
|
+
family: only
|
|
51072
|
+
} : { kind: "mixed" };
|
|
51073
|
+
}
|
|
51074
|
+
/**
|
|
51000
51075
|
* Why the hub refuses this condition on a new or updated rule. Empty = accepted.
|
|
51001
51076
|
* Families are reported in `NC_SYSTEM_EVENT_FAMILIES` order, and filters in
|
|
51002
51077
|
* `NC_SYSTEM_EVENT_CONDITION_FILTER_KEYS` order, so a refusal reads the same
|
|
@@ -51072,18 +51147,38 @@ var WEEKDAY_TO_DAY = {
|
|
|
51072
51147
|
Fri: 5,
|
|
51073
51148
|
Sat: 6
|
|
51074
51149
|
};
|
|
51075
|
-
/**
|
|
51076
|
-
*
|
|
51077
|
-
function
|
|
51078
|
-
|
|
51079
|
-
|
|
51080
|
-
|
|
51150
|
+
/**
|
|
51151
|
+
* One formatter per timezone, built once (D647 review I4). Constructing an
|
|
51152
|
+
* `Intl.DateTimeFormat` is the expensive part of this function, and a caller
|
|
51153
|
+
* that asks about many instants — a window scan — used to build one per
|
|
51154
|
+
* instant. `null` = an invalid IANA name (the host timezone is used).
|
|
51155
|
+
*/
|
|
51156
|
+
var FORMATTERS = /* @__PURE__ */ new Map();
|
|
51157
|
+
function formatterFor(timezone) {
|
|
51158
|
+
const held = FORMATTERS.get(timezone);
|
|
51159
|
+
if (held !== void 0) return held;
|
|
51160
|
+
let made;
|
|
51161
|
+
try {
|
|
51162
|
+
made = new Intl.DateTimeFormat("en-US", {
|
|
51081
51163
|
timeZone: timezone,
|
|
51082
51164
|
weekday: "short",
|
|
51083
51165
|
hour: "numeric",
|
|
51084
51166
|
minute: "numeric",
|
|
51085
51167
|
hourCycle: "h23"
|
|
51086
|
-
})
|
|
51168
|
+
});
|
|
51169
|
+
} catch {
|
|
51170
|
+
made = null;
|
|
51171
|
+
}
|
|
51172
|
+
FORMATTERS.set(timezone, made);
|
|
51173
|
+
return made;
|
|
51174
|
+
}
|
|
51175
|
+
/** Resolve (weekday, minute-of-day) of `atMs` in the schedule's timezone.
|
|
51176
|
+
* An invalid/unknown IANA name falls back to the host timezone. */
|
|
51177
|
+
function localDayMinute(atMs, timezone) {
|
|
51178
|
+
const d = new Date(atMs);
|
|
51179
|
+
const formatter = timezone !== void 0 ? formatterFor(timezone) : null;
|
|
51180
|
+
if (formatter !== null) try {
|
|
51181
|
+
const parts = formatter.formatToParts(d);
|
|
51087
51182
|
let weekday;
|
|
51088
51183
|
let hour;
|
|
51089
51184
|
let minute;
|
|
@@ -51223,6 +51318,119 @@ var DEVICE_EVENTS = [
|
|
|
51223
51318
|
"detection-blind",
|
|
51224
51319
|
...ALARM
|
|
51225
51320
|
];
|
|
51321
|
+
/** Every kind a summary may speak about — the two summarisable families. */
|
|
51322
|
+
var SUMMARISABLE = [...systemEventKindsOfFamily("device-events"), ...systemEventKindsOfFamily("system")];
|
|
51323
|
+
/** One per summary SECTION (`NC_STATE_SUMMARY_SECTIONS` in the notification
|
|
51324
|
+
* centre): the section's lines, offered when one of its kinds is selected. */
|
|
51325
|
+
var STATE_SUMMARY_SECTION_VARS = [
|
|
51326
|
+
{
|
|
51327
|
+
name: "summaryDevices",
|
|
51328
|
+
label: "Summary: devices offline / switched off",
|
|
51329
|
+
example: "Garage — offline since 07:12",
|
|
51330
|
+
kinds: [
|
|
51331
|
+
"device-offline",
|
|
51332
|
+
"device-online",
|
|
51333
|
+
"device-disabled",
|
|
51334
|
+
"device-enabled"
|
|
51335
|
+
]
|
|
51336
|
+
},
|
|
51337
|
+
{
|
|
51338
|
+
name: "summaryStreams",
|
|
51339
|
+
label: "Summary: streams offline",
|
|
51340
|
+
example: "Ingresso (high) — since 06:40",
|
|
51341
|
+
kinds: ["stream-offline", "stream-online"]
|
|
51342
|
+
},
|
|
51343
|
+
{
|
|
51344
|
+
name: "summaryBattery",
|
|
51345
|
+
label: "Summary: low batteries",
|
|
51346
|
+
example: "Sensore porta — 8 %",
|
|
51347
|
+
kinds: BATTERY
|
|
51348
|
+
},
|
|
51349
|
+
{
|
|
51350
|
+
name: "summaryConsumables",
|
|
51351
|
+
label: "Summary: consumables",
|
|
51352
|
+
example: "Robot — filter 10 %",
|
|
51353
|
+
kinds: CONSUMABLE
|
|
51354
|
+
},
|
|
51355
|
+
{
|
|
51356
|
+
name: "summaryTanks",
|
|
51357
|
+
label: "Summary: tanks",
|
|
51358
|
+
example: "Robot — clean water low",
|
|
51359
|
+
kinds: TANK
|
|
51360
|
+
},
|
|
51361
|
+
{
|
|
51362
|
+
name: "summaryDetection",
|
|
51363
|
+
label: "Summary: cameras detecting nothing",
|
|
51364
|
+
example: "Ingresso — since 05:10",
|
|
51365
|
+
kinds: ["detection-blind"]
|
|
51366
|
+
},
|
|
51367
|
+
{
|
|
51368
|
+
name: "summaryNodes",
|
|
51369
|
+
label: "Summary: nodes",
|
|
51370
|
+
example: "little-unraid — offline since 03:00",
|
|
51371
|
+
kinds: [
|
|
51372
|
+
"node-offline",
|
|
51373
|
+
"node-online",
|
|
51374
|
+
"node-inference-unavailable"
|
|
51375
|
+
]
|
|
51376
|
+
},
|
|
51377
|
+
{
|
|
51378
|
+
name: "summaryAddons",
|
|
51379
|
+
label: "Summary: addons",
|
|
51380
|
+
example: "@camstack/addon-recorder 1.2.3 → 1.2.4",
|
|
51381
|
+
kinds: [
|
|
51382
|
+
"addon-crash-loop",
|
|
51383
|
+
"addon-update-available",
|
|
51384
|
+
"addon-updated"
|
|
51385
|
+
]
|
|
51386
|
+
},
|
|
51387
|
+
{
|
|
51388
|
+
name: "summaryUpdates",
|
|
51389
|
+
label: "Summary: server & container updates",
|
|
51390
|
+
example: "server 1.2.377 → 1.2.378",
|
|
51391
|
+
kinds: [
|
|
51392
|
+
"server-update-available",
|
|
51393
|
+
"server-updated",
|
|
51394
|
+
"wrapper-update-available"
|
|
51395
|
+
]
|
|
51396
|
+
}
|
|
51397
|
+
];
|
|
51398
|
+
var STATE_SUMMARY_VARS = [
|
|
51399
|
+
{
|
|
51400
|
+
name: "summaryText",
|
|
51401
|
+
label: "Summary: every section",
|
|
51402
|
+
description: "One block per section with something to report, one line per item.",
|
|
51403
|
+
example: "Batterie scariche: Sensore porta — 8 %",
|
|
51404
|
+
group: "system",
|
|
51405
|
+
families: ["rule"],
|
|
51406
|
+
fields: [...RULE_TEXT],
|
|
51407
|
+
kinds: ["system"],
|
|
51408
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
51409
|
+
systemEventDeliveries: ["summary"]
|
|
51410
|
+
},
|
|
51411
|
+
{
|
|
51412
|
+
name: "summaryCount",
|
|
51413
|
+
label: "Summary: items reported",
|
|
51414
|
+
example: "3",
|
|
51415
|
+
group: "system",
|
|
51416
|
+
families: ["rule"],
|
|
51417
|
+
fields: [...RULE_TEXT],
|
|
51418
|
+
kinds: ["system"],
|
|
51419
|
+
systemEventKinds: [...SUMMARISABLE],
|
|
51420
|
+
systemEventDeliveries: ["summary"]
|
|
51421
|
+
},
|
|
51422
|
+
...STATE_SUMMARY_SECTION_VARS.map((v) => ({
|
|
51423
|
+
name: v.name,
|
|
51424
|
+
label: v.label,
|
|
51425
|
+
example: v.example,
|
|
51426
|
+
group: "system",
|
|
51427
|
+
families: ["rule"],
|
|
51428
|
+
fields: [...RULE_TEXT],
|
|
51429
|
+
kinds: ["system"],
|
|
51430
|
+
systemEventKinds: [...v.kinds],
|
|
51431
|
+
systemEventDeliveries: ["summary"]
|
|
51432
|
+
}))
|
|
51433
|
+
];
|
|
51226
51434
|
var NC_TEMPLATE_VARS = [
|
|
51227
51435
|
{
|
|
51228
51436
|
name: "camera",
|
|
@@ -51473,7 +51681,8 @@ var NC_TEMPLATE_VARS = [
|
|
|
51473
51681
|
group: "system",
|
|
51474
51682
|
families: ["rule"],
|
|
51475
51683
|
fields: [...RULE_TEXT],
|
|
51476
|
-
kinds: ["system"]
|
|
51684
|
+
kinds: ["system"],
|
|
51685
|
+
systemEventDeliveries: ["instant"]
|
|
51477
51686
|
},
|
|
51478
51687
|
{
|
|
51479
51688
|
name: "deviceName",
|
|
@@ -51916,7 +52125,8 @@ var NC_TEMPLATE_VARS = [
|
|
|
51916
52125
|
group: "digest",
|
|
51917
52126
|
families: ["summary"],
|
|
51918
52127
|
fields: [...RULE_TEXT]
|
|
51919
|
-
}
|
|
52128
|
+
},
|
|
52129
|
+
...STATE_SUMMARY_VARS
|
|
51920
52130
|
];
|
|
51921
52131
|
/**
|
|
51922
52132
|
* System-event kinds the SERVED catalog holds back (D642): the kinds the hub
|
|
@@ -51945,11 +52155,32 @@ var NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS = [
|
|
|
51945
52155
|
* rule an installed viewer can author, which is exactly true.
|
|
51946
52156
|
*/
|
|
51947
52157
|
function servedTemplateVars() {
|
|
51948
|
-
return NC_TEMPLATE_VARS.map((d) => d.systemEventKinds === void 0 ? d : {
|
|
52158
|
+
return NC_TEMPLATE_VARS.filter((d) => !isHeldBackTemplateVar(d)).map((d) => d.systemEventKinds === void 0 ? d : {
|
|
51949
52159
|
...d,
|
|
51950
52160
|
systemEventKinds: d.systemEventKinds.filter((kind) => !NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS.includes(kind))
|
|
51951
52161
|
});
|
|
51952
52162
|
}
|
|
52163
|
+
/**
|
|
52164
|
+
* Is this descriptor held back from the SERVED catalog as a whole (D647)?
|
|
52165
|
+
* A summary-only variable is: an installed viewer does not read the delivery
|
|
52166
|
+
* axis, and would offer it on every instant system rule. The admin, built
|
|
52167
|
+
* from the workspace, restores it from its own `NC_TEMPLATE_VARS`.
|
|
52168
|
+
*/
|
|
52169
|
+
function isHeldBackTemplateVar(d) {
|
|
52170
|
+
return d.systemEventDeliveries !== void 0 && !d.systemEventDeliveries.includes("instant");
|
|
52171
|
+
}
|
|
52172
|
+
/**
|
|
52173
|
+
* Does a descriptor have a value on a system rule of this DELIVERY (D647)?
|
|
52174
|
+
* Read only for a system rule kind. An absent axis is `instant` for a
|
|
52175
|
+
* descriptor that names `systemEventKinds` (a per-event fact: a summary row
|
|
52176
|
+
* has no one device, node or package) and BOTH for one that does not
|
|
52177
|
+
* (`{{rule}}`, `{{time}}`).
|
|
52178
|
+
*/
|
|
52179
|
+
function templateVarDeliveryApplies(d, ctx) {
|
|
52180
|
+
if (!isSystemRuleKind(ctx.kind)) return true;
|
|
52181
|
+
const mode = ctx.systemEventDelivery ?? "instant";
|
|
52182
|
+
return (d.systemEventDeliveries ?? (d.systemEventKinds !== void 0 ? ["instant"] : [mode])).includes(mode);
|
|
52183
|
+
}
|
|
51953
52184
|
/** The caption fields see a fixed, smaller vocabulary (`timelapsePreviewText`,
|
|
51954
52185
|
* `summaryCaptionText`). Declared here rather than as `fields` on every
|
|
51955
52186
|
* descriptor so the whole rule stays in one line of code. */
|
|
@@ -52014,12 +52245,82 @@ function templateVarsFor(ctx) {
|
|
|
52014
52245
|
const allowed = CAPTION_VARS[ctx.field];
|
|
52015
52246
|
return NC_TEMPLATE_VARS.filter((d) => d.families.includes(ctx.family) && allowed.includes(d.name) && d.dynamic === void 0);
|
|
52016
52247
|
}
|
|
52017
|
-
return NC_TEMPLATE_VARS.filter((d) => d.families.includes(ctx.family) && onAxis(d.fields, ctx.field) && templateVarKindApplies(d.kinds, ctx.kind) && onAxis(d.deliveries, ctx.delivery) && templateVarSystemEventApplies(d, ctx));
|
|
52248
|
+
return NC_TEMPLATE_VARS.filter((d) => d.families.includes(ctx.family) && onAxis(d.fields, ctx.field) && templateVarKindApplies(d.kinds, ctx.kind) && onAxis(d.deliveries, ctx.delivery) && templateVarSystemEventApplies(d, ctx) && templateVarDeliveryApplies(d, ctx));
|
|
52018
52249
|
}
|
|
52019
52250
|
/** True when `name` is supplied in `ctx`, dynamic families (`count_<class>`) included. */
|
|
52020
52251
|
function isKnownTemplateVar(name, ctx) {
|
|
52021
52252
|
return templateVarsFor(ctx).some((d) => d.dynamic !== void 0 ? name.startsWith(d.dynamic.prefix) && name.length > d.dynamic.prefix.length : d.name === name);
|
|
52022
52253
|
}
|
|
52254
|
+
/** The families a rule may summarise. The alarm is not one of them. */
|
|
52255
|
+
var NC_SYSTEM_EVENT_SUMMARY_FAMILIES = ["device-events", "system"];
|
|
52256
|
+
/** The summary's schedule, or `null` for any rule that is not a summary system rule. */
|
|
52257
|
+
function systemEventSummaryScheduleOf(rule) {
|
|
52258
|
+
if (!isSystemDelivery(rule.delivery)) return null;
|
|
52259
|
+
const delivery = rule.systemEventDelivery;
|
|
52260
|
+
return delivery?.mode === "summary" ? delivery.schedule : null;
|
|
52261
|
+
}
|
|
52262
|
+
/** Absent and `instant` are the same answer: a notification per event. */
|
|
52263
|
+
function isSystemEventSummaryRule(rule) {
|
|
52264
|
+
return systemEventSummaryScheduleOf(rule) !== null;
|
|
52265
|
+
}
|
|
52266
|
+
function actionsAreSet(actions) {
|
|
52267
|
+
return (actions?.onTrigger?.length ?? 0) > 0 || (actions?.buttons?.length ?? 0) > 0;
|
|
52268
|
+
}
|
|
52269
|
+
/**
|
|
52270
|
+
* Why the hub refuses this rule's delivery. Empty = accepted. An instant rule
|
|
52271
|
+
* (absent or `{ mode: 'instant' }`) is never refused here.
|
|
52272
|
+
*
|
|
52273
|
+
* Beside a summary, two fields are refused because they would do nothing:
|
|
52274
|
+
* the rule's own `schedule` (the summary's schedule is the send time; a second
|
|
52275
|
+
* active-hours gate would silently empty it) and `actions` (a summary is not a
|
|
52276
|
+
* match, so nothing would ever run them).
|
|
52277
|
+
*/
|
|
52278
|
+
function systemEventDeliveryProblems(rule) {
|
|
52279
|
+
if (rule.systemEventDelivery?.mode !== "summary") return [];
|
|
52280
|
+
if (!isSystemDelivery(rule.delivery)) return [{
|
|
52281
|
+
code: "not-a-system-rule",
|
|
52282
|
+
delivery: rule.delivery
|
|
52283
|
+
}];
|
|
52284
|
+
const problems = [];
|
|
52285
|
+
const verdict = systemEventFamilyOf(rule.conditions.systemEvent?.kinds ?? []);
|
|
52286
|
+
const family = verdict.kind === "family" ? verdict.family : "mixed";
|
|
52287
|
+
if (family === "mixed" || !NC_SYSTEM_EVENT_SUMMARY_FAMILIES.includes(family)) problems.push({
|
|
52288
|
+
code: "family-not-summarisable",
|
|
52289
|
+
family
|
|
52290
|
+
});
|
|
52291
|
+
const windows = rule.systemEventDelivery.schedule.windows;
|
|
52292
|
+
if (windows.length === 0) problems.push({ code: "empty-schedule" });
|
|
52293
|
+
windows.forEach((window, index) => {
|
|
52294
|
+
if (window.days.length === 0 || window.startMinute === window.endMinute) problems.push({
|
|
52295
|
+
code: "degenerate-window",
|
|
52296
|
+
index
|
|
52297
|
+
});
|
|
52298
|
+
});
|
|
52299
|
+
if (rule.schedule !== void 0) problems.push({ code: "schedule-beside-summary" });
|
|
52300
|
+
if (actionsAreSet(rule.actions)) problems.push({ code: "actions-beside-summary" });
|
|
52301
|
+
return problems;
|
|
52302
|
+
}
|
|
52303
|
+
function describeSystemEventDeliveryProblem(problem) {
|
|
52304
|
+
switch (problem.code) {
|
|
52305
|
+
case "not-a-system-rule": return `a '${problem.delivery}' rule has no summary delivery — only device-events and system rules do`;
|
|
52306
|
+
case "family-not-summarisable": return problem.family === "alarm" ? "an alarm rule cannot be a scheduled summary — the alarm stays instant" : `a ${problem.family} rule cannot be a scheduled summary — only device-events and system rules`;
|
|
52307
|
+
case "degenerate-window": return `send time ${String(problem.index + 1)} has no day, or starts and ends on the same minute — it never closes, so nothing would be sent`;
|
|
52308
|
+
case "empty-schedule": return "a summary rule needs at least one send time — its schedule has no window";
|
|
52309
|
+
case "schedule-beside-summary": return "a summary rule is sent on its summary schedule — remove the active-hours schedule";
|
|
52310
|
+
case "actions-beside-summary": return "a summary rule never matches an event, so its actions would never run — remove them";
|
|
52311
|
+
}
|
|
52312
|
+
}
|
|
52313
|
+
var SUMMARY_CONTENT_VAR = /\{\{\s*summary(?:Text|Devices|Streams|Battery|Consumables|Tanks|Detection|Nodes|Addons|Updates)\s*\}\}/;
|
|
52314
|
+
/**
|
|
52315
|
+
* Does a custom BODY carry the summary's content (`{{summaryText}}` or a
|
|
52316
|
+
* section variable)? A body that does not would send a summary with nothing
|
|
52317
|
+
* in it; the hub then appends `{{summaryText}}` and the admin warns (review
|
|
52318
|
+
* M3). An absent or blank body uses the hub's own wording, which does.
|
|
52319
|
+
*/
|
|
52320
|
+
function templateCarriesSummary(body) {
|
|
52321
|
+
if (body === void 0 || body.trim().length === 0) return true;
|
|
52322
|
+
return SUMMARY_CONTENT_VAR.test(body);
|
|
52323
|
+
}
|
|
52023
52324
|
/**
|
|
52024
52325
|
* TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
|
|
52025
52326
|
*
|
|
@@ -53024,4 +53325,4 @@ function vectorDimFromBase64(encoded) {
|
|
|
53024
53325
|
return Math.floor(Buffer.from(encoded, "base64").byteLength / 4);
|
|
53025
53326
|
}
|
|
53026
53327
|
//#endregion
|
|
53027
|
-
export {
|
|
53328
|
+
export { NcTemplatePreviewSchema as $, resolvePoolMemoryPolicy as $t, NC_DEFAULT_SNOOZE_MINUTES as A, literal as An, evictionPolicyOfLocation as At, NcConditionsSchema as B, isSystemDelivery as Bt, MAX_BIRTH_DECISION_RECORDS as C, isDeviceScopedCap as Cn, cosineSimilarity as Ct, NC_ALARM_SYSTEM_EVENT_KINDS as D, array as Dn, embeddingEncoderCapability as Dt, MediaFileKindEnum as E, _enum as En, describeSystemEventFamilyProblem as Et, NC_TAXONOMY as F, string as Fn, isEventOwnerType as Ft, NcRuleUpdateInputSchema as G, occupancyScope as Gt, NcRulePatchSchema as H, kebabToCamel as Ht, NC_TEMPLATE_VARS as I, unknown as In, isKnownTemplateVar as It, NcSnoozeSchema as J, pipelineAnalyticsCapability as Jt, NcScheduleSchema as K, parseProcStatus as Kt, NcAlarmConfigSchema as L, EventCategory as Ln, isMediaOwnerType as Lt, NC_SNOOZE_MAX_MINUTES as M, object as Mn, failureContributionCapability as Mt, NC_SYSTEM_EVENT_KIND_GROUP_SPECS as N, partialRecord as Nn, hfModelUrl as Nt, NC_CONDITION_CATALOG as O, boolean as On, encodeVectorBase64 as Ot, NC_TANK_SYSTEM_EVENT_KINDS as P, record as Pn, isDetectionMacroClass as Pt, NcTemplatePreviewInputSchema as Q, resolveLocationMode as Qt, NcAlarmSettingsPatchSchema as R, isScheduleActive as Rt, MAX_ARCHIVED_DEBUG_NOTES as S, hydrateSchema as Sn, consumableLowPercentOf as St, MOTION_CLOSE_AFTER_MS as T, sleep as Tn, describeSystemEventDeliveryProblem as Tt, NcRuleSchema as U, mayWriteToLocation as Ut, NcRuleInputSchema as V, isSystemEventSummaryRule as Vt, NcRuleTargetSchema as W, notificationRulesCapability as Wt, NcSystemEventKindSchema as X, readDeviceStateFrom as Xt, NcSnoozeSuppressedSchema as Y, plateGalleryCapability as Yt, NcTaxonomySchema as Z, readTimelapseGeneratedAt as Zt, FIRST_LEVEL_MACRO_CLASSES as _, CamProfileSchema as _n, alarmPanelCapability as _t, BirthDecisionRecordSchema as a, subKindsOf as an, RetrainStatusSchema as at, LabelAttributionSchema as b, customAction as bn, audioModeOf as bt, CoverStateSchema as c, systemEventFilterApplies as cn, SCENE_DEFAULT_UNCOVERED_POLICY as ct, DEFAULT_TIMELAPSE_PREVIEW_TEXT as d, templateVarsFor as dn, TIMELAPSE_DENSE_FLOOR_SEC as dt, ruleBelongsToAlarm as en, NcTemplateVarDescriptorSchema as et, DETECTION_MACRO_CLASSES as f, vectorDimFromBase64 as fn, TimelapseRuleInputSchema as ft, EVENT_OWNER_TYPES as g, BaseAddon as gn, addonWidgetsSourceCapability as gt, EVENT_KIND_BY_CAP as h, canonicalHash as hn, TrackSourceSchema as ht, BaseDevice as i, storageOccupancyCapability as in, RECORDING_SOURCE_CAMSTACK_ADDON as it, NC_SENSOR_TRANSITION_KINDS as j, number as jn, faceGalleryCapability as jt, NC_CONSUMABLE_SYSTEM_EVENT_KINDS as k, discriminatedUnion as kn, evaluateSensorEdge as kt, DEFAULT_EVENT_COLOR as l, systemEventSummaryScheduleOf as ln, SCENE_DIVERGED as lt, DeclaredDevices as m, errMsg as mn, TimelapseRuleSchema as mt, AlarmArmModeSchema as n, sensorRaisedOf as nn, PoolMemoryWatchdog as nt, CLUSTER_MODEL_SCOPED_STEPS as o, systemEventDeliveryProblems as on, SCENE_CONFIRM_DEFAULT_TIMEOUT_MS as ot, DETECTION_PIPELINE_CAP_NAME as p, zoneAnalyticsCapability as pn, TimelapseRulePatchSchema as pt, NcSnoozeInputSchema as q, pickClusterStepModels as qt, ArchivedDebugNoteSchema as r, servedTemplateVars as rn, RECORDING_EXPORT_MAX_READ_BYTES as rt, COCO_TO_MACRO as s, systemEventFamilyProblems as sn, SCENE_DEFAULT_ANCHOR_THRESHOLD as st, AUDIO_MACRO_LABELS as t, sceneMonitorCapability as tn, OpsLogEntrySchema as tt, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as u, templateCarriesSummary as un, SceneMonitorSchema as ut, FULL_IMAGE_BBOX as v, DeviceType as vn, assertTimelapseCadences as vt, MAX_BIRTH_LATENCY_PROXY_MS as w, nodePin as wn, deriveRecordingMode as wt, LockStateSchema as x, defineCustomActions as xn, buildEventKindDescriptor as xt, FailureCounters as y, createEvent as yn, audioMetricsCapability as yt, NcConditionDescriptorSchema as z, isSourceCap as zt };
|