@camstack/addon-model-studio 1.0.26 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MotionZonesSettings-DswyY6HP.mjs → MotionZonesSettings-JuOM4wpI.mjs} +1 -1
- package/dist/{PrivacyMaskSettings-eoxneoGu.mjs → PrivacyMaskSettings-B4AFKvVk.mjs} +2 -2
- package/dist/_stub.js +1697 -1685
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page--ScsoC58.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-NMFv_zoJ.mjs} +4 -4
- package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BOsI55Qr.mjs +26 -0
- package/dist/addon-model-studio.css +1 -1
- package/dist/{hostInit-RsirfP3S.mjs → hostInit-CdGt-Tbt.mjs} +3 -3
- package/dist/model-studio.addon.js +511 -2
- package/dist/model-studio.addon.mjs +511 -2
- package/dist/{player-overlays-D4ghec6K.mjs → player-overlays-BR3IAbV5.mjs} +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{trash-2-BofMNso1.mjs → trash-2-CCPJ47Sy.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DGVlW7T3.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DvnLvZMm.mjs} +1 -1
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Cu8_cMyT.mjs +0 -26
|
@@ -7362,6 +7362,62 @@ var RecordingConfigSchema = object({
|
|
|
7362
7362
|
scrubThumbnails: ScrubThumbnailPresetSchema.optional()
|
|
7363
7363
|
});
|
|
7364
7364
|
/**
|
|
7365
|
+
* Ops-log — the durable, append-only operations audit shared by the
|
|
7366
|
+
* recordings and events management surfaces.
|
|
7367
|
+
*
|
|
7368
|
+
* ONE row shape is reused for both domains so a single "Activity" view can
|
|
7369
|
+
* merge the recorder's DurableState ring (recordings ops-log) and the
|
|
7370
|
+
* pipeline-analytics SQLite collection (events ops-log). Each row records a
|
|
7371
|
+
* management operation, WHY it ran (reason), and its measurable effect
|
|
7372
|
+
* (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
|
|
7373
|
+
* never fail the operation it records.
|
|
7374
|
+
*/
|
|
7375
|
+
/** Which management domain the operation belongs to. */
|
|
7376
|
+
var OpsLogDomainSchema = _enum(["recording", "events"]);
|
|
7377
|
+
/** The kind of management operation performed. */
|
|
7378
|
+
var OpsLogOpSchema = _enum([
|
|
7379
|
+
"prune",
|
|
7380
|
+
"manual-delete",
|
|
7381
|
+
"rescan",
|
|
7382
|
+
"retention-run"
|
|
7383
|
+
]);
|
|
7384
|
+
/** Why the operation ran. */
|
|
7385
|
+
var OpsLogReasonSchema = _enum([
|
|
7386
|
+
"retention",
|
|
7387
|
+
"quota",
|
|
7388
|
+
"manual",
|
|
7389
|
+
"operator"
|
|
7390
|
+
]);
|
|
7391
|
+
/** One audit row, shared verbatim by both domains. */
|
|
7392
|
+
var OpsLogEntrySchema = object({
|
|
7393
|
+
/** Unique row id. */
|
|
7394
|
+
id: string(),
|
|
7395
|
+
/** Epoch ms the operation completed. */
|
|
7396
|
+
at: number(),
|
|
7397
|
+
domain: OpsLogDomainSchema,
|
|
7398
|
+
op: OpsLogOpSchema,
|
|
7399
|
+
reason: OpsLogReasonSchema,
|
|
7400
|
+
/** The camera the op targeted; null for a cluster/global op. */
|
|
7401
|
+
deviceId: number().nullable(),
|
|
7402
|
+
/** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
|
|
7403
|
+
nodeId: string(),
|
|
7404
|
+
/** Buckets / rows deleted (op-specific unit). */
|
|
7405
|
+
itemsAffected: number(),
|
|
7406
|
+
/** Bytes reclaimed by the op (0 when not measurable). */
|
|
7407
|
+
bytesReclaimed: number(),
|
|
7408
|
+
/** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
|
|
7409
|
+
detail: string().nullable(),
|
|
7410
|
+
/** Who/what triggered the op. */
|
|
7411
|
+
actor: string()
|
|
7412
|
+
});
|
|
7413
|
+
/** Shared query input for the per-domain `listOpsLog` cap methods. */
|
|
7414
|
+
var OpsLogQueryInputSchema = object({
|
|
7415
|
+
/** Restrict to a single camera; omit for every row. */
|
|
7416
|
+
deviceId: number().optional(),
|
|
7417
|
+
/** Max rows returned, newest-first. */
|
|
7418
|
+
limit: number().int().min(1).max(1e3).optional()
|
|
7419
|
+
});
|
|
7420
|
+
/**
|
|
7365
7421
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
7366
7422
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
7367
7423
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -7635,6 +7691,160 @@ var CAP_NODE_PIN_CONTEXT_KEY = "__camstackNodePin";
|
|
|
7635
7691
|
function nodePin(nodeId) {
|
|
7636
7692
|
return { context: { [CAP_NODE_PIN_CONTEXT_KEY]: nodeId } };
|
|
7637
7693
|
}
|
|
7694
|
+
var COCO_TO_MACRO = {
|
|
7695
|
+
mapping: {
|
|
7696
|
+
person: "person",
|
|
7697
|
+
bicycle: "vehicle",
|
|
7698
|
+
car: "vehicle",
|
|
7699
|
+
motorcycle: "vehicle",
|
|
7700
|
+
airplane: "vehicle",
|
|
7701
|
+
bus: "vehicle",
|
|
7702
|
+
train: "vehicle",
|
|
7703
|
+
truck: "vehicle",
|
|
7704
|
+
boat: "vehicle",
|
|
7705
|
+
bird: "animal",
|
|
7706
|
+
cat: "animal",
|
|
7707
|
+
dog: "animal",
|
|
7708
|
+
horse: "animal",
|
|
7709
|
+
sheep: "animal",
|
|
7710
|
+
cow: "animal",
|
|
7711
|
+
elephant: "animal",
|
|
7712
|
+
bear: "animal",
|
|
7713
|
+
zebra: "animal",
|
|
7714
|
+
giraffe: "animal",
|
|
7715
|
+
suitcase: "package",
|
|
7716
|
+
backpack: "package",
|
|
7717
|
+
handbag: "package"
|
|
7718
|
+
},
|
|
7719
|
+
preserveOriginal: false
|
|
7720
|
+
};
|
|
7721
|
+
var AUDIO_MACRO_LABELS = [
|
|
7722
|
+
{
|
|
7723
|
+
id: "speech",
|
|
7724
|
+
name: "Speech",
|
|
7725
|
+
icon: "🗣️"
|
|
7726
|
+
},
|
|
7727
|
+
{
|
|
7728
|
+
id: "scream",
|
|
7729
|
+
name: "Scream / Shout",
|
|
7730
|
+
icon: "😱"
|
|
7731
|
+
},
|
|
7732
|
+
{
|
|
7733
|
+
id: "crying",
|
|
7734
|
+
name: "Crying / Baby",
|
|
7735
|
+
icon: "😢"
|
|
7736
|
+
},
|
|
7737
|
+
{
|
|
7738
|
+
id: "laughter",
|
|
7739
|
+
name: "Laughter",
|
|
7740
|
+
icon: "😂"
|
|
7741
|
+
},
|
|
7742
|
+
{
|
|
7743
|
+
id: "music",
|
|
7744
|
+
name: "Music",
|
|
7745
|
+
icon: "🎵"
|
|
7746
|
+
},
|
|
7747
|
+
{
|
|
7748
|
+
id: "dog",
|
|
7749
|
+
name: "Dog",
|
|
7750
|
+
icon: "🐕"
|
|
7751
|
+
},
|
|
7752
|
+
{
|
|
7753
|
+
id: "cat",
|
|
7754
|
+
name: "Cat",
|
|
7755
|
+
icon: "🐈"
|
|
7756
|
+
},
|
|
7757
|
+
{
|
|
7758
|
+
id: "bird",
|
|
7759
|
+
name: "Bird",
|
|
7760
|
+
icon: "🐦"
|
|
7761
|
+
},
|
|
7762
|
+
{
|
|
7763
|
+
id: "animal",
|
|
7764
|
+
name: "Animal (other)",
|
|
7765
|
+
icon: "🐾"
|
|
7766
|
+
},
|
|
7767
|
+
{
|
|
7768
|
+
id: "alarm",
|
|
7769
|
+
name: "Alarm / Siren",
|
|
7770
|
+
icon: "🚨"
|
|
7771
|
+
},
|
|
7772
|
+
{
|
|
7773
|
+
id: "doorbell",
|
|
7774
|
+
name: "Doorbell / Knock",
|
|
7775
|
+
icon: "🔔"
|
|
7776
|
+
},
|
|
7777
|
+
{
|
|
7778
|
+
id: "glass_breaking",
|
|
7779
|
+
name: "Glass Breaking",
|
|
7780
|
+
icon: "💥"
|
|
7781
|
+
},
|
|
7782
|
+
{
|
|
7783
|
+
id: "gunshot",
|
|
7784
|
+
name: "Gunshot / Explosion",
|
|
7785
|
+
icon: "💣"
|
|
7786
|
+
},
|
|
7787
|
+
{
|
|
7788
|
+
id: "vehicle",
|
|
7789
|
+
name: "Vehicle",
|
|
7790
|
+
icon: "🚗"
|
|
7791
|
+
},
|
|
7792
|
+
{
|
|
7793
|
+
id: "siren",
|
|
7794
|
+
name: "Emergency Siren",
|
|
7795
|
+
icon: "🚑"
|
|
7796
|
+
},
|
|
7797
|
+
{
|
|
7798
|
+
id: "fire",
|
|
7799
|
+
name: "Fire / Smoke",
|
|
7800
|
+
icon: "🔥"
|
|
7801
|
+
},
|
|
7802
|
+
{
|
|
7803
|
+
id: "water",
|
|
7804
|
+
name: "Water",
|
|
7805
|
+
icon: "💧"
|
|
7806
|
+
},
|
|
7807
|
+
{
|
|
7808
|
+
id: "wind",
|
|
7809
|
+
name: "Wind / Weather",
|
|
7810
|
+
icon: "🌬️"
|
|
7811
|
+
},
|
|
7812
|
+
{
|
|
7813
|
+
id: "door",
|
|
7814
|
+
name: "Door",
|
|
7815
|
+
icon: "🚪"
|
|
7816
|
+
},
|
|
7817
|
+
{
|
|
7818
|
+
id: "footsteps",
|
|
7819
|
+
name: "Footsteps",
|
|
7820
|
+
icon: "👣"
|
|
7821
|
+
},
|
|
7822
|
+
{
|
|
7823
|
+
id: "crowd",
|
|
7824
|
+
name: "Crowd / Chatter",
|
|
7825
|
+
icon: "👥"
|
|
7826
|
+
},
|
|
7827
|
+
{
|
|
7828
|
+
id: "telephone",
|
|
7829
|
+
name: "Telephone",
|
|
7830
|
+
icon: "📞"
|
|
7831
|
+
},
|
|
7832
|
+
{
|
|
7833
|
+
id: "engine",
|
|
7834
|
+
name: "Engine / Motor",
|
|
7835
|
+
icon: "⚙️"
|
|
7836
|
+
},
|
|
7837
|
+
{
|
|
7838
|
+
id: "tools",
|
|
7839
|
+
name: "Tools / Construction",
|
|
7840
|
+
icon: "🔨"
|
|
7841
|
+
},
|
|
7842
|
+
{
|
|
7843
|
+
id: "silence",
|
|
7844
|
+
name: "Silence",
|
|
7845
|
+
icon: "🤫"
|
|
7846
|
+
}
|
|
7847
|
+
];
|
|
7638
7848
|
var YAMNET_TO_MACRO = {
|
|
7639
7849
|
mapping: {
|
|
7640
7850
|
Speech: "speech",
|
|
@@ -7901,6 +8111,125 @@ var _macroLookup = /* @__PURE__ */ new Map();
|
|
|
7901
8111
|
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7902
8112
|
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7903
8113
|
/**
|
|
8114
|
+
* Unified event-kind taxonomy — THE single source of truth for
|
|
8115
|
+
* `kind → { parentKind, category, level, color, iconId, labelKey, label,
|
|
8116
|
+
* icon }`.
|
|
8117
|
+
*
|
|
8118
|
+
* This dictionary folds together what used to be scattered across four
|
|
8119
|
+
* copies:
|
|
8120
|
+
* - `capabilities/sensor-event-kinds.ts` (sensor cap colors)
|
|
8121
|
+
* - `addon-post-analysis/.../services/event-kinds.ts`
|
|
8122
|
+
* (MOTION/PERSON/VEHICLE… _COLOR constants)
|
|
8123
|
+
* - `ui-library/composites/detection-colors.ts` (CLASS_COLORS)
|
|
8124
|
+
* - `addon-post-analysis/shared/frame/box-drawer.ts` (DEFAULT_COLOR)
|
|
8125
|
+
* - the COCO / audio class maps (macro ↔ sub relationships)
|
|
8126
|
+
*
|
|
8127
|
+
* The DATA (serializable — color/iconId/labelKey/parentKind) lives here in
|
|
8128
|
+
* `@camstack/types`. The UI-side mapping `iconId → lucide component` and
|
|
8129
|
+
* `labelKey → t()` lives in `@camstack/ui-library`. UIs never hardcode a
|
|
8130
|
+
* color or an icon: they read this dictionary (server descriptors carry the
|
|
8131
|
+
* fields inline; the client resolves color/icon/label from `iconId`/`kind`).
|
|
8132
|
+
*
|
|
8133
|
+
* Two levels only (v1 YAGNI): macro → sub. `person` is a leaf macro.
|
|
8134
|
+
*/
|
|
8135
|
+
var TAXONOMY_COLORS = {
|
|
8136
|
+
motion: "#f59e0b",
|
|
8137
|
+
audio: "#06b6d4",
|
|
8138
|
+
person: "#22c55e",
|
|
8139
|
+
vehicle: "#3b82f6",
|
|
8140
|
+
animal: "#f97316",
|
|
8141
|
+
package: "#a855f7",
|
|
8142
|
+
sensor: "#8b5cf6",
|
|
8143
|
+
control: "#10b981",
|
|
8144
|
+
genericDetection: "#64748b"
|
|
8145
|
+
};
|
|
8146
|
+
var DETECTION_SUB_COLORS = {
|
|
8147
|
+
car: "#f59e0b",
|
|
8148
|
+
truck: "#d97706",
|
|
8149
|
+
bus: "#b45309",
|
|
8150
|
+
motorcycle: "#eab308",
|
|
8151
|
+
bicycle: "#ca8a04",
|
|
8152
|
+
airplane: "#60a5fa",
|
|
8153
|
+
boat: "#2563eb",
|
|
8154
|
+
train: "#1d4ed8",
|
|
8155
|
+
bird: "#14b8a6",
|
|
8156
|
+
dog: "#84cc16",
|
|
8157
|
+
cat: "#f97316",
|
|
8158
|
+
horse: "#a16207",
|
|
8159
|
+
sheep: "#a3a3a3",
|
|
8160
|
+
cow: "#78716c",
|
|
8161
|
+
elephant: "#6b7280",
|
|
8162
|
+
bear: "#7c2d12",
|
|
8163
|
+
zebra: "#404040",
|
|
8164
|
+
giraffe: "#d4a373"
|
|
8165
|
+
};
|
|
8166
|
+
function titleCase(id) {
|
|
8167
|
+
return id.split(/[-_ ]/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
|
|
8168
|
+
}
|
|
8169
|
+
var entries = /* @__PURE__ */ new Map();
|
|
8170
|
+
function macro(kind, category, color, iconId, label) {
|
|
8171
|
+
entries.set(kind, {
|
|
8172
|
+
kind,
|
|
8173
|
+
parentKind: null,
|
|
8174
|
+
level: "macro",
|
|
8175
|
+
category,
|
|
8176
|
+
color,
|
|
8177
|
+
iconId,
|
|
8178
|
+
labelKey: `eventKind.${kind}`,
|
|
8179
|
+
label
|
|
8180
|
+
});
|
|
8181
|
+
}
|
|
8182
|
+
function sub(kind, parentKind, category, color, iconId, label) {
|
|
8183
|
+
entries.set(kind, {
|
|
8184
|
+
kind,
|
|
8185
|
+
parentKind,
|
|
8186
|
+
level: "sub",
|
|
8187
|
+
category,
|
|
8188
|
+
color,
|
|
8189
|
+
iconId,
|
|
8190
|
+
labelKey: `eventKind.${kind}`,
|
|
8191
|
+
label
|
|
8192
|
+
});
|
|
8193
|
+
}
|
|
8194
|
+
macro("motion", "motion", TAXONOMY_COLORS.motion, "motion", "Motion");
|
|
8195
|
+
macro("audio", "audio", TAXONOMY_COLORS.audio, "audio", "Audio");
|
|
8196
|
+
macro("person", "detection", TAXONOMY_COLORS.person, "person", "Person");
|
|
8197
|
+
macro("vehicle", "detection", TAXONOMY_COLORS.vehicle, "vehicle", "Vehicle");
|
|
8198
|
+
macro("animal", "detection", TAXONOMY_COLORS.animal, "animal", "Animal");
|
|
8199
|
+
macro("package", "package", TAXONOMY_COLORS.package, "package", "Package");
|
|
8200
|
+
macro("sensor", "sensor", TAXONOMY_COLORS.sensor, "sensor", "Sensor");
|
|
8201
|
+
macro("control", "control", TAXONOMY_COLORS.control, "control", "Control");
|
|
8202
|
+
for (const [cocoClass, macroClass] of Object.entries(COCO_TO_MACRO.mapping)) {
|
|
8203
|
+
if (macroClass !== "vehicle" && macroClass !== "animal") continue;
|
|
8204
|
+
if (entries.has(cocoClass)) continue;
|
|
8205
|
+
sub(cocoClass, macroClass, "detection", DETECTION_SUB_COLORS[cocoClass] ?? TAXONOMY_COLORS.genericDetection, cocoClass, titleCase(cocoClass));
|
|
8206
|
+
}
|
|
8207
|
+
sub("package-delivered", "package", "package", TAXONOMY_COLORS.package, "package", "Package delivered");
|
|
8208
|
+
sub("package-picked-up", "package", "package", TAXONOMY_COLORS.package, "package", "Package picked up");
|
|
8209
|
+
sub("contact", "sensor", "sensor", "#f59e0b", "door", "Contact");
|
|
8210
|
+
sub("motion-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "pir", "Motion sensor");
|
|
8211
|
+
sub("smoke", "sensor", "sensor", "#ef4444", "smoke", "Smoke");
|
|
8212
|
+
sub("flood", "sensor", "sensor", "#3b82f6", "water", "Water leak");
|
|
8213
|
+
sub("gas", "sensor", "sensor", "#ef4444", "gas", "Gas");
|
|
8214
|
+
sub("carbon-monoxide", "sensor", "sensor", "#dc2626", "smoke", "Carbon monoxide");
|
|
8215
|
+
sub("vibration", "sensor", "sensor", "#eab308", "vibration", "Vibration");
|
|
8216
|
+
sub("tamper", "sensor", "sensor", "#f97316", "tamper", "Tamper");
|
|
8217
|
+
sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
|
|
8218
|
+
sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
|
|
8219
|
+
sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
|
|
8220
|
+
sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
|
|
8221
|
+
sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
|
|
8222
|
+
sub("siren", "control", "control", "#dc2626", "siren", "Siren");
|
|
8223
|
+
sub("button", "control", "control", "#10b981", "button", "Button");
|
|
8224
|
+
sub("doorbell", "control", "control", "#a855f7", "doorbell", "Doorbell");
|
|
8225
|
+
for (const l of AUDIO_MACRO_LABELS) {
|
|
8226
|
+
const kind = `audio-${l.id}`;
|
|
8227
|
+
if (entries.has(kind)) continue;
|
|
8228
|
+
sub(kind, "audio", "audio", TAXONOMY_COLORS.audio, kind, l.name);
|
|
8229
|
+
}
|
|
8230
|
+
/** The complete taxonomy dictionary, keyed by kind. */
|
|
8231
|
+
var EVENT_TAXONOMY = Object.freeze(Object.fromEntries(entries));
|
|
8232
|
+
/**
|
|
7904
8233
|
* Error types for the safe expression engine. Two distinct classes so callers
|
|
7905
8234
|
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
7906
8235
|
* failure — both are non-fatal to the host: read paths degrade to "skip link".
|
|
@@ -15889,17 +16218,30 @@ var EventKindCategorySchema = _enum([
|
|
|
15889
16218
|
"audio",
|
|
15890
16219
|
"detection",
|
|
15891
16220
|
"sensor",
|
|
16221
|
+
"control",
|
|
15892
16222
|
"custom",
|
|
15893
16223
|
"package"
|
|
15894
16224
|
]);
|
|
16225
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
16226
|
+
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
15895
16227
|
var EventKindDescriptorSchema = object({
|
|
15896
|
-
/** Stable kind id (e.g. 'motion', '
|
|
16228
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
15897
16229
|
kind: string(),
|
|
16230
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
16231
|
+
labelKey: string(),
|
|
16232
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
15898
16233
|
label: string(),
|
|
15899
16234
|
/** Hex color for timeline/legend rendering. */
|
|
15900
16235
|
color: string(),
|
|
16236
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
16237
|
+
iconId: string(),
|
|
16238
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
15901
16239
|
icon: EventKindIconSchema,
|
|
15902
16240
|
category: EventKindCategorySchema,
|
|
16241
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
16242
|
+
parentKind: string().nullable(),
|
|
16243
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
16244
|
+
level: EventKindLevelSchema,
|
|
15903
16245
|
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15904
16246
|
* itself; for sensor kinds the LINKED source device. */
|
|
15905
16247
|
source: object({
|
|
@@ -15972,11 +16314,21 @@ var TrackAudioLabelSchema = object({
|
|
|
15972
16314
|
firstAt: number(),
|
|
15973
16315
|
lastAt: number()
|
|
15974
16316
|
});
|
|
16317
|
+
/**
|
|
16318
|
+
* How a track was produced. `pipeline` (default / absent) = the spatial
|
|
16319
|
+
* detection+tracking pipeline. `sensor` = a SYNTHETIC track projected from a
|
|
16320
|
+
* linked sensor/control state change (no positions; carries a snapshot). The
|
|
16321
|
+
* spatial subsystems (tracker association, occupancy count, re-id/embedding,
|
|
16322
|
+
* resurrection) MUST skip `sensor` tracks — they have no bbox trajectory.
|
|
16323
|
+
*/
|
|
16324
|
+
var TrackSourceSchema = _enum(["pipeline", "sensor"]);
|
|
15975
16325
|
var TrackSchema = object({
|
|
15976
16326
|
trackId: string(),
|
|
15977
16327
|
deviceId: number(),
|
|
15978
16328
|
className: string(),
|
|
15979
16329
|
label: string().optional(),
|
|
16330
|
+
/** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
|
|
16331
|
+
source: TrackSourceSchema.optional(),
|
|
15980
16332
|
firstSeen: number(),
|
|
15981
16333
|
lastSeen: number(),
|
|
15982
16334
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
@@ -16231,6 +16583,26 @@ var TrackCascadeCountsSchema = object({
|
|
|
16231
16583
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
16232
16584
|
embeddings: number().int()
|
|
16233
16585
|
});
|
|
16586
|
+
/** Event-store footprint for one camera. */
|
|
16587
|
+
var EventStoreDeviceFootprintSchema = object({
|
|
16588
|
+
deviceId: number(),
|
|
16589
|
+
/** Persisted event rows (motion + object + audio) for the camera. */
|
|
16590
|
+
rows: number().int(),
|
|
16591
|
+
/** Event-owned media bytes on disk for the camera. */
|
|
16592
|
+
bytes: number().int()
|
|
16593
|
+
});
|
|
16594
|
+
/** Aggregate event-store footprint: global totals + per-camera breakdown. */
|
|
16595
|
+
var EventStoreFootprintSchema = object({
|
|
16596
|
+
totalRows: number().int(),
|
|
16597
|
+
totalBytes: number().int(),
|
|
16598
|
+
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
16599
|
+
});
|
|
16600
|
+
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
16601
|
+
var EventPruneCountsSchema = object({
|
|
16602
|
+
motion: number().int(),
|
|
16603
|
+
object: number().int(),
|
|
16604
|
+
audio: number().int()
|
|
16605
|
+
});
|
|
16234
16606
|
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
16235
16607
|
deviceId: number(),
|
|
16236
16608
|
trackId: string()
|
|
@@ -16294,6 +16666,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16294
16666
|
}), {
|
|
16295
16667
|
kind: "mutation",
|
|
16296
16668
|
auth: "admin"
|
|
16669
|
+
}), method(object({}), EventStoreFootprintSchema, {
|
|
16670
|
+
kind: "query",
|
|
16671
|
+
auth: "admin"
|
|
16672
|
+
}), method(object({
|
|
16673
|
+
olderThanMs: number(),
|
|
16674
|
+
reason: OpsLogReasonSchema.optional()
|
|
16675
|
+
}), EventPruneCountsSchema, {
|
|
16676
|
+
kind: "mutation",
|
|
16677
|
+
auth: "admin"
|
|
16678
|
+
}), method(object({ deviceId: number() }), EventPruneCountsSchema, {
|
|
16679
|
+
kind: "mutation",
|
|
16680
|
+
auth: "admin"
|
|
16681
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
16682
|
+
kind: "query",
|
|
16683
|
+
auth: "admin"
|
|
16297
16684
|
}), method(object({
|
|
16298
16685
|
eventId: string(),
|
|
16299
16686
|
kind: MediaFileKindEnum.optional()
|
|
@@ -16318,6 +16705,76 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16318
16705
|
eventId: string(),
|
|
16319
16706
|
timestamp: number()
|
|
16320
16707
|
});
|
|
16708
|
+
/**
|
|
16709
|
+
* Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
|
|
16710
|
+
* `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
|
|
16711
|
+
* caps into per-camera event-kind descriptors.
|
|
16712
|
+
*
|
|
16713
|
+
* The descriptor DATA (color / iconId / labelKey / parentKind / category)
|
|
16714
|
+
* is NOT duplicated here — every entry is derived from the single
|
|
16715
|
+
* `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
|
|
16716
|
+
* ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
|
|
16717
|
+
* control cap means adding one line here (and a taxonomy entry); the anti-
|
|
16718
|
+
* drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
|
|
16719
|
+
* eventful cap is missing.
|
|
16720
|
+
*/
|
|
16721
|
+
/** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
|
|
16722
|
+
var LEGACY_ICON = {
|
|
16723
|
+
motion: "motion",
|
|
16724
|
+
audio: "audio",
|
|
16725
|
+
person: "person",
|
|
16726
|
+
vehicle: "vehicle",
|
|
16727
|
+
animal: "animal",
|
|
16728
|
+
package: "package",
|
|
16729
|
+
door: "door",
|
|
16730
|
+
pir: "pir",
|
|
16731
|
+
smoke: "smoke",
|
|
16732
|
+
water: "water",
|
|
16733
|
+
button: "button",
|
|
16734
|
+
generic: "generic",
|
|
16735
|
+
gas: "smoke",
|
|
16736
|
+
vibration: "generic",
|
|
16737
|
+
tamper: "generic",
|
|
16738
|
+
presence: "person",
|
|
16739
|
+
lock: "generic",
|
|
16740
|
+
siren: "generic",
|
|
16741
|
+
switch: "generic",
|
|
16742
|
+
doorbell: "button"
|
|
16743
|
+
};
|
|
16744
|
+
function legacyIcon(iconId) {
|
|
16745
|
+
return LEGACY_ICON[iconId] ?? "generic";
|
|
16746
|
+
}
|
|
16747
|
+
/**
|
|
16748
|
+
* Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
|
|
16749
|
+
* The anti-drift guard cross-checks this against the eventful caps declared
|
|
16750
|
+
* in `packages/types/src/capabilities/*.cap.ts`.
|
|
16751
|
+
*/
|
|
16752
|
+
var CAP_TO_KIND = {
|
|
16753
|
+
contact: "contact",
|
|
16754
|
+
motion: "motion-sensor",
|
|
16755
|
+
smoke: "smoke",
|
|
16756
|
+
flood: "flood",
|
|
16757
|
+
gas: "gas",
|
|
16758
|
+
"carbon-monoxide": "carbon-monoxide",
|
|
16759
|
+
vibration: "vibration",
|
|
16760
|
+
tamper: "tamper",
|
|
16761
|
+
presence: "presence",
|
|
16762
|
+
"enum-sensor": "enum-sensor",
|
|
16763
|
+
"event-emitter": "device-event",
|
|
16764
|
+
"lock-control": "lock",
|
|
16765
|
+
switch: "switch",
|
|
16766
|
+
button: "button",
|
|
16767
|
+
doorbell: "doorbell"
|
|
16768
|
+
};
|
|
16769
|
+
function buildDescriptor(capName, kind) {
|
|
16770
|
+
const t = EVENT_TAXONOMY[kind];
|
|
16771
|
+
if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
|
|
16772
|
+
return {
|
|
16773
|
+
...t,
|
|
16774
|
+
icon: legacyIcon(t.iconId)
|
|
16775
|
+
};
|
|
16776
|
+
}
|
|
16777
|
+
Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
|
|
16321
16778
|
var CameraPipelineConfigSchema = object({
|
|
16322
16779
|
engine: PipelineEngineChoiceSchema.optional(),
|
|
16323
16780
|
steps: array(PipelineStepInputSchema).readonly(),
|
|
@@ -19527,13 +19984,29 @@ method(object({
|
|
|
19527
19984
|
}), method(object({ deviceId: number() }), RecordingStatusSchema, {
|
|
19528
19985
|
kind: "mutation",
|
|
19529
19986
|
auth: "admin"
|
|
19530
|
-
}), method(object({
|
|
19987
|
+
}), method(object({
|
|
19988
|
+
deviceId: number(),
|
|
19989
|
+
reason: OpsLogReasonSchema.optional()
|
|
19990
|
+
}), object({
|
|
19531
19991
|
floorMs: number().nullable(),
|
|
19532
19992
|
deletedBuckets: number().int(),
|
|
19533
19993
|
reclaimedBytes: number().int()
|
|
19534
19994
|
}), {
|
|
19535
19995
|
kind: "mutation",
|
|
19536
19996
|
auth: "admin"
|
|
19997
|
+
}), method(object({
|
|
19998
|
+
deviceId: number(),
|
|
19999
|
+
fromMs: number().optional(),
|
|
20000
|
+
toMs: number().optional()
|
|
20001
|
+
}), object({
|
|
20002
|
+
deletedBuckets: number().int(),
|
|
20003
|
+
reclaimedBytes: number().int()
|
|
20004
|
+
}), {
|
|
20005
|
+
kind: "mutation",
|
|
20006
|
+
auth: "admin"
|
|
20007
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
20008
|
+
kind: "query",
|
|
20009
|
+
auth: "admin"
|
|
19537
20010
|
});
|
|
19538
20011
|
/**
|
|
19539
20012
|
* `recordingExport` cap — render a footage time range into a single downloadable
|
|
@@ -22655,6 +23128,12 @@ Object.freeze({
|
|
|
22655
23128
|
addonId: null,
|
|
22656
23129
|
access: "delete"
|
|
22657
23130
|
},
|
|
23131
|
+
"pipelineAnalytics.deleteDeviceEvents": {
|
|
23132
|
+
capName: "pipeline-analytics",
|
|
23133
|
+
capScope: "device",
|
|
23134
|
+
addonId: null,
|
|
23135
|
+
access: "delete"
|
|
23136
|
+
},
|
|
22658
23137
|
"pipelineAnalytics.deleteTracks": {
|
|
22659
23138
|
capName: "pipeline-analytics",
|
|
22660
23139
|
capScope: "device",
|
|
@@ -22685,6 +23164,12 @@ Object.freeze({
|
|
|
22685
23164
|
addonId: null,
|
|
22686
23165
|
access: "view"
|
|
22687
23166
|
},
|
|
23167
|
+
"pipelineAnalytics.getEventStoreFootprint": {
|
|
23168
|
+
capName: "pipeline-analytics",
|
|
23169
|
+
capScope: "device",
|
|
23170
|
+
addonId: null,
|
|
23171
|
+
access: "view"
|
|
23172
|
+
},
|
|
22688
23173
|
"pipelineAnalytics.getKeyEvents": {
|
|
22689
23174
|
capName: "pipeline-analytics",
|
|
22690
23175
|
capScope: "device",
|
|
@@ -22727,6 +23212,12 @@ Object.freeze({
|
|
|
22727
23212
|
addonId: null,
|
|
22728
23213
|
access: "view"
|
|
22729
23214
|
},
|
|
23215
|
+
"pipelineAnalytics.listOpsLog": {
|
|
23216
|
+
capName: "pipeline-analytics",
|
|
23217
|
+
capScope: "device",
|
|
23218
|
+
addonId: null,
|
|
23219
|
+
access: "view"
|
|
23220
|
+
},
|
|
22730
23221
|
"pipelineAnalytics.listRecentTracks": {
|
|
22731
23222
|
capName: "pipeline-analytics",
|
|
22732
23223
|
capScope: "device",
|
|
@@ -22739,6 +23230,12 @@ Object.freeze({
|
|
|
22739
23230
|
addonId: null,
|
|
22740
23231
|
access: "view"
|
|
22741
23232
|
},
|
|
23233
|
+
"pipelineAnalytics.pruneEvents": {
|
|
23234
|
+
capName: "pipeline-analytics",
|
|
23235
|
+
capScope: "device",
|
|
23236
|
+
addonId: null,
|
|
23237
|
+
access: "create"
|
|
23238
|
+
},
|
|
22742
23239
|
"pipelineAnalytics.pruneEventsBefore": {
|
|
22743
23240
|
capName: "pipeline-analytics",
|
|
22744
23241
|
capScope: "device",
|
|
@@ -23501,6 +23998,12 @@ Object.freeze({
|
|
|
23501
23998
|
addonId: null,
|
|
23502
23999
|
access: "create"
|
|
23503
24000
|
},
|
|
24001
|
+
"recording.deleteFootprint": {
|
|
24002
|
+
capName: "recording",
|
|
24003
|
+
capScope: "system",
|
|
24004
|
+
addonId: null,
|
|
24005
|
+
access: "delete"
|
|
24006
|
+
},
|
|
23504
24007
|
"recording.getAvailability": {
|
|
23505
24008
|
capName: "recording",
|
|
23506
24009
|
capScope: "system",
|
|
@@ -23531,6 +24034,12 @@ Object.freeze({
|
|
|
23531
24034
|
addonId: null,
|
|
23532
24035
|
access: "view"
|
|
23533
24036
|
},
|
|
24037
|
+
"recording.listOpsLog": {
|
|
24038
|
+
capName: "recording",
|
|
24039
|
+
capScope: "system",
|
|
24040
|
+
addonId: null,
|
|
24041
|
+
access: "view"
|
|
24042
|
+
},
|
|
23534
24043
|
"recording.locateSegment": {
|
|
23535
24044
|
capName: "recording",
|
|
23536
24045
|
capScope: "system",
|