@camstack/addon-pipeline 1.1.62 → 1.1.64
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/audio-analyzer/index.js +1 -1
- package/dist/audio-analyzer/index.mjs +1 -1
- package/dist/detection-pipeline/index.js +2 -2
- package/dist/detection-pipeline/index.mjs +2 -2
- package/dist/{dist-DlMmkOsE.js → dist-B2jTt7Lq.js} +213 -1
- package/dist/{dist-LkwlodgP.mjs → dist-BzVZ2I4P.mjs} +213 -1
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/pipeline-runner/index.js +126 -3
- package/dist/pipeline-runner/index.mjs +126 -3
- package/dist/recorder/index.js +1 -1
- package/dist/recorder/index.mjs +1 -1
- package/dist/{step-definitions-DxN9tmQP.mjs → step-definitions-B07M9qhj.mjs} +1 -1
- package/dist/{step-definitions-CxwB0fEq.js → step-definitions-DXkY5Zor.js} +1 -1
- package/dist/stream-broker/_stub.js +2 -2
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-3gAFmxjh.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-dTMki_1D.mjs} +3 -3
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-bAh96WNb.mjs +26 -0
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CV2WbUaO.mjs +26 -0
- package/dist/stream-broker/{hostInit-B1aDV0u0.mjs → hostInit-BY2oQAEX.mjs} +3 -3
- package/dist/stream-broker/index.js +1 -1
- package/dist/stream-broker/index.mjs +1 -1
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-C7IhxQQ_.js → MaskShapeCanvas-DI4BY7W2-C03fx7Sp.js} +1 -1
- package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-DZXzBUU8.js → MotionZonesSettings-NcxxQN8r-BTxzn1rQ.js} +1 -1
- package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-Dz9ttl4A.js → PrivacyMaskSettings-APgPLF7p-GKO8O7rC.js} +1 -1
- package/embed-dist/assets/index-Bm9LaQPH.css +2 -0
- package/embed-dist/assets/index-QdssILAA.js +81 -0
- package/embed-dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DHJB3xUN.mjs +0 -26
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-C4pcysOQ.mjs +0 -26
- package/embed-dist/assets/index-Bmpl9O1K.css +0 -2
- package/embed-dist/assets/index-DRsQUyLF.js +0 -81
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../chunk-D6vf50IK.js");
|
|
6
|
-
const require_dist = require("../dist-
|
|
6
|
+
const require_dist = require("../dist-B2jTt7Lq.js");
|
|
7
7
|
const require_node_topology_platform = require("../node-topology-platform-CFZ7F4xW.js");
|
|
8
8
|
const require_model_download_service_Cp9f4dk6 = require("../model-download-service-Cp9f4dk6-Dv-oFwjN.js");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __require } from "../chunk-BdkLduGY.mjs";
|
|
2
|
-
import { B as errMsg, K as hydrateSchema, T as mapAudioLabelToMacro, V as BaseAddon, _ as audioAnalyzerCapability, g as audioAnalysisCapability, n as AUDIO_BACKEND_CHOICES, o as DEFAULT_AUDIO_ANALYZER_CONFIG, u as HF_BASE_URL } from "../dist-
|
|
2
|
+
import { B as errMsg, K as hydrateSchema, T as mapAudioLabelToMacro, V as BaseAddon, _ as audioAnalyzerCapability, g as audioAnalysisCapability, n as AUDIO_BACKEND_CHOICES, o as DEFAULT_AUDIO_ANALYZER_CONFIG, u as HF_BASE_URL } from "../dist-BzVZ2I4P.mjs";
|
|
3
3
|
import { t as pickNodePlatformArch } from "../node-topology-platform-BkR_k6WT.mjs";
|
|
4
4
|
import { i as downloadFile } from "../model-download-service-Cp9f4dk6-CwUb5v3Y.mjs";
|
|
5
5
|
import * as fs from "node:fs";
|
|
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../chunk-D6vf50IK.js");
|
|
6
|
-
const require_dist = require("../dist-
|
|
7
|
-
const require_step_definitions = require("../step-definitions-
|
|
6
|
+
const require_dist = require("../dist-B2jTt7Lq.js");
|
|
7
|
+
const require_step_definitions = require("../step-definitions-DXkY5Zor.js");
|
|
8
8
|
const require_node_topology_platform = require("../node-topology-platform-CFZ7F4xW.js");
|
|
9
9
|
const require_model_download_service_Cp9f4dk6 = require("../model-download-service-Cp9f4dk6-Dv-oFwjN.js");
|
|
10
10
|
let node_child_process = require("node:child_process");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __require } from "../chunk-BdkLduGY.mjs";
|
|
2
|
-
import { $ as sleep, A as pipelineExecutorCapability, B as errMsg, C as evaluateZoneRules, F as runtimeDevices$1, G as createEvent, K as hydrateSchema, R as supportedRuntimes$1, S as detectionPipelineCapability, V as BaseAddon, X as parseJsonUnknown, b as defaultDeviceFor$1, dt as EventCategory, k as nodePin, m as YAMNET_TO_MACRO, t as APPLE_SA_TO_MACRO } from "../dist-
|
|
3
|
-
import { a as getStepDefinition, i as getStep, n as ALL_STEPS, o as resolveModelForFormat, r as getDefaultModelForFormat, t as ALL_PIPELINE_STEPS } from "../step-definitions-
|
|
2
|
+
import { $ as sleep, A as pipelineExecutorCapability, B as errMsg, C as evaluateZoneRules, F as runtimeDevices$1, G as createEvent, K as hydrateSchema, R as supportedRuntimes$1, S as detectionPipelineCapability, V as BaseAddon, X as parseJsonUnknown, b as defaultDeviceFor$1, dt as EventCategory, k as nodePin, m as YAMNET_TO_MACRO, t as APPLE_SA_TO_MACRO } from "../dist-BzVZ2I4P.mjs";
|
|
3
|
+
import { a as getStepDefinition, i as getStep, n as ALL_STEPS, o as resolveModelForFormat, r as getDefaultModelForFormat, t as ALL_PIPELINE_STEPS } from "../step-definitions-B07M9qhj.mjs";
|
|
4
4
|
import { t as pickNodePlatformArch } from "../node-topology-platform-BkR_k6WT.mjs";
|
|
5
5
|
import { a as ensureModel, o as isModelDownloaded, r as deleteModelFromDisk } from "../model-download-service-Cp9f4dk6-CwUb5v3Y.mjs";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
@@ -8659,6 +8659,125 @@ function mapAudioLabelToMacro(label) {
|
|
|
8659
8659
|
return _macroLookup.get(label.toLowerCase()) ?? null;
|
|
8660
8660
|
}
|
|
8661
8661
|
/**
|
|
8662
|
+
* Unified event-kind taxonomy — THE single source of truth for
|
|
8663
|
+
* `kind → { parentKind, category, level, color, iconId, labelKey, label,
|
|
8664
|
+
* icon }`.
|
|
8665
|
+
*
|
|
8666
|
+
* This dictionary folds together what used to be scattered across four
|
|
8667
|
+
* copies:
|
|
8668
|
+
* - `capabilities/sensor-event-kinds.ts` (sensor cap colors)
|
|
8669
|
+
* - `addon-post-analysis/.../services/event-kinds.ts`
|
|
8670
|
+
* (MOTION/PERSON/VEHICLE… _COLOR constants)
|
|
8671
|
+
* - `ui-library/composites/detection-colors.ts` (CLASS_COLORS)
|
|
8672
|
+
* - `addon-post-analysis/shared/frame/box-drawer.ts` (DEFAULT_COLOR)
|
|
8673
|
+
* - the COCO / audio class maps (macro ↔ sub relationships)
|
|
8674
|
+
*
|
|
8675
|
+
* The DATA (serializable — color/iconId/labelKey/parentKind) lives here in
|
|
8676
|
+
* `@camstack/types`. The UI-side mapping `iconId → lucide component` and
|
|
8677
|
+
* `labelKey → t()` lives in `@camstack/ui-library`. UIs never hardcode a
|
|
8678
|
+
* color or an icon: they read this dictionary (server descriptors carry the
|
|
8679
|
+
* fields inline; the client resolves color/icon/label from `iconId`/`kind`).
|
|
8680
|
+
*
|
|
8681
|
+
* Two levels only (v1 YAGNI): macro → sub. `person` is a leaf macro.
|
|
8682
|
+
*/
|
|
8683
|
+
var TAXONOMY_COLORS = {
|
|
8684
|
+
motion: "#f59e0b",
|
|
8685
|
+
audio: "#06b6d4",
|
|
8686
|
+
person: "#22c55e",
|
|
8687
|
+
vehicle: "#3b82f6",
|
|
8688
|
+
animal: "#f97316",
|
|
8689
|
+
package: "#a855f7",
|
|
8690
|
+
sensor: "#8b5cf6",
|
|
8691
|
+
control: "#10b981",
|
|
8692
|
+
genericDetection: "#64748b"
|
|
8693
|
+
};
|
|
8694
|
+
var DETECTION_SUB_COLORS = {
|
|
8695
|
+
car: "#f59e0b",
|
|
8696
|
+
truck: "#d97706",
|
|
8697
|
+
bus: "#b45309",
|
|
8698
|
+
motorcycle: "#eab308",
|
|
8699
|
+
bicycle: "#ca8a04",
|
|
8700
|
+
airplane: "#60a5fa",
|
|
8701
|
+
boat: "#2563eb",
|
|
8702
|
+
train: "#1d4ed8",
|
|
8703
|
+
bird: "#14b8a6",
|
|
8704
|
+
dog: "#84cc16",
|
|
8705
|
+
cat: "#f97316",
|
|
8706
|
+
horse: "#a16207",
|
|
8707
|
+
sheep: "#a3a3a3",
|
|
8708
|
+
cow: "#78716c",
|
|
8709
|
+
elephant: "#6b7280",
|
|
8710
|
+
bear: "#7c2d12",
|
|
8711
|
+
zebra: "#404040",
|
|
8712
|
+
giraffe: "#d4a373"
|
|
8713
|
+
};
|
|
8714
|
+
function titleCase(id) {
|
|
8715
|
+
return id.split(/[-_ ]/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
|
|
8716
|
+
}
|
|
8717
|
+
var entries = /* @__PURE__ */ new Map();
|
|
8718
|
+
function macro(kind, category, color, iconId, label) {
|
|
8719
|
+
entries.set(kind, {
|
|
8720
|
+
kind,
|
|
8721
|
+
parentKind: null,
|
|
8722
|
+
level: "macro",
|
|
8723
|
+
category,
|
|
8724
|
+
color,
|
|
8725
|
+
iconId,
|
|
8726
|
+
labelKey: `eventKind.${kind}`,
|
|
8727
|
+
label
|
|
8728
|
+
});
|
|
8729
|
+
}
|
|
8730
|
+
function sub(kind, parentKind, category, color, iconId, label) {
|
|
8731
|
+
entries.set(kind, {
|
|
8732
|
+
kind,
|
|
8733
|
+
parentKind,
|
|
8734
|
+
level: "sub",
|
|
8735
|
+
category,
|
|
8736
|
+
color,
|
|
8737
|
+
iconId,
|
|
8738
|
+
labelKey: `eventKind.${kind}`,
|
|
8739
|
+
label
|
|
8740
|
+
});
|
|
8741
|
+
}
|
|
8742
|
+
macro("motion", "motion", TAXONOMY_COLORS.motion, "motion", "Motion");
|
|
8743
|
+
macro("audio", "audio", TAXONOMY_COLORS.audio, "audio", "Audio");
|
|
8744
|
+
macro("person", "detection", TAXONOMY_COLORS.person, "person", "Person");
|
|
8745
|
+
macro("vehicle", "detection", TAXONOMY_COLORS.vehicle, "vehicle", "Vehicle");
|
|
8746
|
+
macro("animal", "detection", TAXONOMY_COLORS.animal, "animal", "Animal");
|
|
8747
|
+
macro("package", "package", TAXONOMY_COLORS.package, "package", "Package");
|
|
8748
|
+
macro("sensor", "sensor", TAXONOMY_COLORS.sensor, "sensor", "Sensor");
|
|
8749
|
+
macro("control", "control", TAXONOMY_COLORS.control, "control", "Control");
|
|
8750
|
+
for (const [cocoClass, macroClass] of Object.entries(COCO_TO_MACRO.mapping)) {
|
|
8751
|
+
if (macroClass !== "vehicle" && macroClass !== "animal") continue;
|
|
8752
|
+
if (entries.has(cocoClass)) continue;
|
|
8753
|
+
sub(cocoClass, macroClass, "detection", DETECTION_SUB_COLORS[cocoClass] ?? TAXONOMY_COLORS.genericDetection, cocoClass, titleCase(cocoClass));
|
|
8754
|
+
}
|
|
8755
|
+
sub("package-delivered", "package", "package", TAXONOMY_COLORS.package, "package", "Package delivered");
|
|
8756
|
+
sub("package-picked-up", "package", "package", TAXONOMY_COLORS.package, "package", "Package picked up");
|
|
8757
|
+
sub("contact", "sensor", "sensor", "#f59e0b", "door", "Contact");
|
|
8758
|
+
sub("motion-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "pir", "Motion sensor");
|
|
8759
|
+
sub("smoke", "sensor", "sensor", "#ef4444", "smoke", "Smoke");
|
|
8760
|
+
sub("flood", "sensor", "sensor", "#3b82f6", "water", "Water leak");
|
|
8761
|
+
sub("gas", "sensor", "sensor", "#ef4444", "gas", "Gas");
|
|
8762
|
+
sub("carbon-monoxide", "sensor", "sensor", "#dc2626", "smoke", "Carbon monoxide");
|
|
8763
|
+
sub("vibration", "sensor", "sensor", "#eab308", "vibration", "Vibration");
|
|
8764
|
+
sub("tamper", "sensor", "sensor", "#f97316", "tamper", "Tamper");
|
|
8765
|
+
sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
|
|
8766
|
+
sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
|
|
8767
|
+
sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
|
|
8768
|
+
sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
|
|
8769
|
+
sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
|
|
8770
|
+
sub("siren", "control", "control", "#dc2626", "siren", "Siren");
|
|
8771
|
+
sub("button", "control", "control", "#10b981", "button", "Button");
|
|
8772
|
+
sub("doorbell", "control", "control", "#a855f7", "doorbell", "Doorbell");
|
|
8773
|
+
for (const l of AUDIO_MACRO_LABELS) {
|
|
8774
|
+
const kind = `audio-${l.id}`;
|
|
8775
|
+
if (entries.has(kind)) continue;
|
|
8776
|
+
sub(kind, "audio", "audio", TAXONOMY_COLORS.audio, kind, l.name);
|
|
8777
|
+
}
|
|
8778
|
+
/** The complete taxonomy dictionary, keyed by kind. */
|
|
8779
|
+
var EVENT_TAXONOMY = Object.freeze(Object.fromEntries(entries));
|
|
8780
|
+
/**
|
|
8662
8781
|
* Error types for the safe expression engine. Two distinct classes so callers
|
|
8663
8782
|
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
8664
8783
|
* failure — both are non-fatal to the host: read paths degrade to "skip link".
|
|
@@ -17272,17 +17391,30 @@ var EventKindCategorySchema = _enum([
|
|
|
17272
17391
|
"audio",
|
|
17273
17392
|
"detection",
|
|
17274
17393
|
"sensor",
|
|
17394
|
+
"control",
|
|
17275
17395
|
"custom",
|
|
17276
17396
|
"package"
|
|
17277
17397
|
]);
|
|
17398
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
17399
|
+
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
17278
17400
|
var EventKindDescriptorSchema = object({
|
|
17279
|
-
/** Stable kind id (e.g. 'motion', '
|
|
17401
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
17280
17402
|
kind: string(),
|
|
17403
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
17404
|
+
labelKey: string(),
|
|
17405
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
17281
17406
|
label: string(),
|
|
17282
17407
|
/** Hex color for timeline/legend rendering. */
|
|
17283
17408
|
color: string(),
|
|
17409
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
17410
|
+
iconId: string(),
|
|
17411
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
17284
17412
|
icon: EventKindIconSchema,
|
|
17285
17413
|
category: EventKindCategorySchema,
|
|
17414
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
17415
|
+
parentKind: string().nullable(),
|
|
17416
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
17417
|
+
level: EventKindLevelSchema,
|
|
17286
17418
|
/** Which cap + device contributes this kind. For built-ins the camera
|
|
17287
17419
|
* itself; for sensor kinds the LINKED source device. */
|
|
17288
17420
|
source: object({
|
|
@@ -17355,11 +17487,21 @@ var TrackAudioLabelSchema = object({
|
|
|
17355
17487
|
firstAt: number(),
|
|
17356
17488
|
lastAt: number()
|
|
17357
17489
|
});
|
|
17490
|
+
/**
|
|
17491
|
+
* How a track was produced. `pipeline` (default / absent) = the spatial
|
|
17492
|
+
* detection+tracking pipeline. `sensor` = a SYNTHETIC track projected from a
|
|
17493
|
+
* linked sensor/control state change (no positions; carries a snapshot). The
|
|
17494
|
+
* spatial subsystems (tracker association, occupancy count, re-id/embedding,
|
|
17495
|
+
* resurrection) MUST skip `sensor` tracks — they have no bbox trajectory.
|
|
17496
|
+
*/
|
|
17497
|
+
var TrackSourceSchema = _enum(["pipeline", "sensor"]);
|
|
17358
17498
|
var TrackSchema = object({
|
|
17359
17499
|
trackId: string(),
|
|
17360
17500
|
deviceId: number(),
|
|
17361
17501
|
className: string(),
|
|
17362
17502
|
label: string().optional(),
|
|
17503
|
+
/** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
|
|
17504
|
+
source: TrackSourceSchema.optional(),
|
|
17363
17505
|
firstSeen: number(),
|
|
17364
17506
|
lastSeen: number(),
|
|
17365
17507
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
@@ -17736,6 +17878,76 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
17736
17878
|
eventId: string(),
|
|
17737
17879
|
timestamp: number()
|
|
17738
17880
|
});
|
|
17881
|
+
/**
|
|
17882
|
+
* Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
|
|
17883
|
+
* `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
|
|
17884
|
+
* caps into per-camera event-kind descriptors.
|
|
17885
|
+
*
|
|
17886
|
+
* The descriptor DATA (color / iconId / labelKey / parentKind / category)
|
|
17887
|
+
* is NOT duplicated here — every entry is derived from the single
|
|
17888
|
+
* `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
|
|
17889
|
+
* ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
|
|
17890
|
+
* control cap means adding one line here (and a taxonomy entry); the anti-
|
|
17891
|
+
* drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
|
|
17892
|
+
* eventful cap is missing.
|
|
17893
|
+
*/
|
|
17894
|
+
/** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
|
|
17895
|
+
var LEGACY_ICON = {
|
|
17896
|
+
motion: "motion",
|
|
17897
|
+
audio: "audio",
|
|
17898
|
+
person: "person",
|
|
17899
|
+
vehicle: "vehicle",
|
|
17900
|
+
animal: "animal",
|
|
17901
|
+
package: "package",
|
|
17902
|
+
door: "door",
|
|
17903
|
+
pir: "pir",
|
|
17904
|
+
smoke: "smoke",
|
|
17905
|
+
water: "water",
|
|
17906
|
+
button: "button",
|
|
17907
|
+
generic: "generic",
|
|
17908
|
+
gas: "smoke",
|
|
17909
|
+
vibration: "generic",
|
|
17910
|
+
tamper: "generic",
|
|
17911
|
+
presence: "person",
|
|
17912
|
+
lock: "generic",
|
|
17913
|
+
siren: "generic",
|
|
17914
|
+
switch: "generic",
|
|
17915
|
+
doorbell: "button"
|
|
17916
|
+
};
|
|
17917
|
+
function legacyIcon(iconId) {
|
|
17918
|
+
return LEGACY_ICON[iconId] ?? "generic";
|
|
17919
|
+
}
|
|
17920
|
+
/**
|
|
17921
|
+
* Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
|
|
17922
|
+
* The anti-drift guard cross-checks this against the eventful caps declared
|
|
17923
|
+
* in `packages/types/src/capabilities/*.cap.ts`.
|
|
17924
|
+
*/
|
|
17925
|
+
var CAP_TO_KIND = {
|
|
17926
|
+
contact: "contact",
|
|
17927
|
+
motion: "motion-sensor",
|
|
17928
|
+
smoke: "smoke",
|
|
17929
|
+
flood: "flood",
|
|
17930
|
+
gas: "gas",
|
|
17931
|
+
"carbon-monoxide": "carbon-monoxide",
|
|
17932
|
+
vibration: "vibration",
|
|
17933
|
+
tamper: "tamper",
|
|
17934
|
+
presence: "presence",
|
|
17935
|
+
"enum-sensor": "enum-sensor",
|
|
17936
|
+
"event-emitter": "device-event",
|
|
17937
|
+
"lock-control": "lock",
|
|
17938
|
+
switch: "switch",
|
|
17939
|
+
button: "button",
|
|
17940
|
+
doorbell: "doorbell"
|
|
17941
|
+
};
|
|
17942
|
+
function buildDescriptor(capName, kind) {
|
|
17943
|
+
const t = EVENT_TAXONOMY[kind];
|
|
17944
|
+
if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
|
|
17945
|
+
return {
|
|
17946
|
+
...t,
|
|
17947
|
+
icon: legacyIcon(t.iconId)
|
|
17948
|
+
};
|
|
17949
|
+
}
|
|
17950
|
+
Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
|
|
17739
17951
|
var CameraPipelineConfigSchema = object({
|
|
17740
17952
|
engine: PipelineEngineChoiceSchema.optional(),
|
|
17741
17953
|
steps: array(PipelineStepInputSchema).readonly(),
|
|
@@ -8659,6 +8659,125 @@ function mapAudioLabelToMacro(label) {
|
|
|
8659
8659
|
return _macroLookup.get(label.toLowerCase()) ?? null;
|
|
8660
8660
|
}
|
|
8661
8661
|
/**
|
|
8662
|
+
* Unified event-kind taxonomy — THE single source of truth for
|
|
8663
|
+
* `kind → { parentKind, category, level, color, iconId, labelKey, label,
|
|
8664
|
+
* icon }`.
|
|
8665
|
+
*
|
|
8666
|
+
* This dictionary folds together what used to be scattered across four
|
|
8667
|
+
* copies:
|
|
8668
|
+
* - `capabilities/sensor-event-kinds.ts` (sensor cap colors)
|
|
8669
|
+
* - `addon-post-analysis/.../services/event-kinds.ts`
|
|
8670
|
+
* (MOTION/PERSON/VEHICLE… _COLOR constants)
|
|
8671
|
+
* - `ui-library/composites/detection-colors.ts` (CLASS_COLORS)
|
|
8672
|
+
* - `addon-post-analysis/shared/frame/box-drawer.ts` (DEFAULT_COLOR)
|
|
8673
|
+
* - the COCO / audio class maps (macro ↔ sub relationships)
|
|
8674
|
+
*
|
|
8675
|
+
* The DATA (serializable — color/iconId/labelKey/parentKind) lives here in
|
|
8676
|
+
* `@camstack/types`. The UI-side mapping `iconId → lucide component` and
|
|
8677
|
+
* `labelKey → t()` lives in `@camstack/ui-library`. UIs never hardcode a
|
|
8678
|
+
* color or an icon: they read this dictionary (server descriptors carry the
|
|
8679
|
+
* fields inline; the client resolves color/icon/label from `iconId`/`kind`).
|
|
8680
|
+
*
|
|
8681
|
+
* Two levels only (v1 YAGNI): macro → sub. `person` is a leaf macro.
|
|
8682
|
+
*/
|
|
8683
|
+
var TAXONOMY_COLORS = {
|
|
8684
|
+
motion: "#f59e0b",
|
|
8685
|
+
audio: "#06b6d4",
|
|
8686
|
+
person: "#22c55e",
|
|
8687
|
+
vehicle: "#3b82f6",
|
|
8688
|
+
animal: "#f97316",
|
|
8689
|
+
package: "#a855f7",
|
|
8690
|
+
sensor: "#8b5cf6",
|
|
8691
|
+
control: "#10b981",
|
|
8692
|
+
genericDetection: "#64748b"
|
|
8693
|
+
};
|
|
8694
|
+
var DETECTION_SUB_COLORS = {
|
|
8695
|
+
car: "#f59e0b",
|
|
8696
|
+
truck: "#d97706",
|
|
8697
|
+
bus: "#b45309",
|
|
8698
|
+
motorcycle: "#eab308",
|
|
8699
|
+
bicycle: "#ca8a04",
|
|
8700
|
+
airplane: "#60a5fa",
|
|
8701
|
+
boat: "#2563eb",
|
|
8702
|
+
train: "#1d4ed8",
|
|
8703
|
+
bird: "#14b8a6",
|
|
8704
|
+
dog: "#84cc16",
|
|
8705
|
+
cat: "#f97316",
|
|
8706
|
+
horse: "#a16207",
|
|
8707
|
+
sheep: "#a3a3a3",
|
|
8708
|
+
cow: "#78716c",
|
|
8709
|
+
elephant: "#6b7280",
|
|
8710
|
+
bear: "#7c2d12",
|
|
8711
|
+
zebra: "#404040",
|
|
8712
|
+
giraffe: "#d4a373"
|
|
8713
|
+
};
|
|
8714
|
+
function titleCase(id) {
|
|
8715
|
+
return id.split(/[-_ ]/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
|
|
8716
|
+
}
|
|
8717
|
+
var entries = /* @__PURE__ */ new Map();
|
|
8718
|
+
function macro(kind, category, color, iconId, label) {
|
|
8719
|
+
entries.set(kind, {
|
|
8720
|
+
kind,
|
|
8721
|
+
parentKind: null,
|
|
8722
|
+
level: "macro",
|
|
8723
|
+
category,
|
|
8724
|
+
color,
|
|
8725
|
+
iconId,
|
|
8726
|
+
labelKey: `eventKind.${kind}`,
|
|
8727
|
+
label
|
|
8728
|
+
});
|
|
8729
|
+
}
|
|
8730
|
+
function sub(kind, parentKind, category, color, iconId, label) {
|
|
8731
|
+
entries.set(kind, {
|
|
8732
|
+
kind,
|
|
8733
|
+
parentKind,
|
|
8734
|
+
level: "sub",
|
|
8735
|
+
category,
|
|
8736
|
+
color,
|
|
8737
|
+
iconId,
|
|
8738
|
+
labelKey: `eventKind.${kind}`,
|
|
8739
|
+
label
|
|
8740
|
+
});
|
|
8741
|
+
}
|
|
8742
|
+
macro("motion", "motion", TAXONOMY_COLORS.motion, "motion", "Motion");
|
|
8743
|
+
macro("audio", "audio", TAXONOMY_COLORS.audio, "audio", "Audio");
|
|
8744
|
+
macro("person", "detection", TAXONOMY_COLORS.person, "person", "Person");
|
|
8745
|
+
macro("vehicle", "detection", TAXONOMY_COLORS.vehicle, "vehicle", "Vehicle");
|
|
8746
|
+
macro("animal", "detection", TAXONOMY_COLORS.animal, "animal", "Animal");
|
|
8747
|
+
macro("package", "package", TAXONOMY_COLORS.package, "package", "Package");
|
|
8748
|
+
macro("sensor", "sensor", TAXONOMY_COLORS.sensor, "sensor", "Sensor");
|
|
8749
|
+
macro("control", "control", TAXONOMY_COLORS.control, "control", "Control");
|
|
8750
|
+
for (const [cocoClass, macroClass] of Object.entries(COCO_TO_MACRO.mapping)) {
|
|
8751
|
+
if (macroClass !== "vehicle" && macroClass !== "animal") continue;
|
|
8752
|
+
if (entries.has(cocoClass)) continue;
|
|
8753
|
+
sub(cocoClass, macroClass, "detection", DETECTION_SUB_COLORS[cocoClass] ?? TAXONOMY_COLORS.genericDetection, cocoClass, titleCase(cocoClass));
|
|
8754
|
+
}
|
|
8755
|
+
sub("package-delivered", "package", "package", TAXONOMY_COLORS.package, "package", "Package delivered");
|
|
8756
|
+
sub("package-picked-up", "package", "package", TAXONOMY_COLORS.package, "package", "Package picked up");
|
|
8757
|
+
sub("contact", "sensor", "sensor", "#f59e0b", "door", "Contact");
|
|
8758
|
+
sub("motion-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "pir", "Motion sensor");
|
|
8759
|
+
sub("smoke", "sensor", "sensor", "#ef4444", "smoke", "Smoke");
|
|
8760
|
+
sub("flood", "sensor", "sensor", "#3b82f6", "water", "Water leak");
|
|
8761
|
+
sub("gas", "sensor", "sensor", "#ef4444", "gas", "Gas");
|
|
8762
|
+
sub("carbon-monoxide", "sensor", "sensor", "#dc2626", "smoke", "Carbon monoxide");
|
|
8763
|
+
sub("vibration", "sensor", "sensor", "#eab308", "vibration", "Vibration");
|
|
8764
|
+
sub("tamper", "sensor", "sensor", "#f97316", "tamper", "Tamper");
|
|
8765
|
+
sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
|
|
8766
|
+
sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
|
|
8767
|
+
sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
|
|
8768
|
+
sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
|
|
8769
|
+
sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
|
|
8770
|
+
sub("siren", "control", "control", "#dc2626", "siren", "Siren");
|
|
8771
|
+
sub("button", "control", "control", "#10b981", "button", "Button");
|
|
8772
|
+
sub("doorbell", "control", "control", "#a855f7", "doorbell", "Doorbell");
|
|
8773
|
+
for (const l of AUDIO_MACRO_LABELS) {
|
|
8774
|
+
const kind = `audio-${l.id}`;
|
|
8775
|
+
if (entries.has(kind)) continue;
|
|
8776
|
+
sub(kind, "audio", "audio", TAXONOMY_COLORS.audio, kind, l.name);
|
|
8777
|
+
}
|
|
8778
|
+
/** The complete taxonomy dictionary, keyed by kind. */
|
|
8779
|
+
var EVENT_TAXONOMY = Object.freeze(Object.fromEntries(entries));
|
|
8780
|
+
/**
|
|
8662
8781
|
* Error types for the safe expression engine. Two distinct classes so callers
|
|
8663
8782
|
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
8664
8783
|
* failure — both are non-fatal to the host: read paths degrade to "skip link".
|
|
@@ -17272,17 +17391,30 @@ var EventKindCategorySchema = _enum([
|
|
|
17272
17391
|
"audio",
|
|
17273
17392
|
"detection",
|
|
17274
17393
|
"sensor",
|
|
17394
|
+
"control",
|
|
17275
17395
|
"custom",
|
|
17276
17396
|
"package"
|
|
17277
17397
|
]);
|
|
17398
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
17399
|
+
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
17278
17400
|
var EventKindDescriptorSchema = object({
|
|
17279
|
-
/** Stable kind id (e.g. 'motion', '
|
|
17401
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
17280
17402
|
kind: string(),
|
|
17403
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
17404
|
+
labelKey: string(),
|
|
17405
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
17281
17406
|
label: string(),
|
|
17282
17407
|
/** Hex color for timeline/legend rendering. */
|
|
17283
17408
|
color: string(),
|
|
17409
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
17410
|
+
iconId: string(),
|
|
17411
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
17284
17412
|
icon: EventKindIconSchema,
|
|
17285
17413
|
category: EventKindCategorySchema,
|
|
17414
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
17415
|
+
parentKind: string().nullable(),
|
|
17416
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
17417
|
+
level: EventKindLevelSchema,
|
|
17286
17418
|
/** Which cap + device contributes this kind. For built-ins the camera
|
|
17287
17419
|
* itself; for sensor kinds the LINKED source device. */
|
|
17288
17420
|
source: object({
|
|
@@ -17355,11 +17487,21 @@ var TrackAudioLabelSchema = object({
|
|
|
17355
17487
|
firstAt: number(),
|
|
17356
17488
|
lastAt: number()
|
|
17357
17489
|
});
|
|
17490
|
+
/**
|
|
17491
|
+
* How a track was produced. `pipeline` (default / absent) = the spatial
|
|
17492
|
+
* detection+tracking pipeline. `sensor` = a SYNTHETIC track projected from a
|
|
17493
|
+
* linked sensor/control state change (no positions; carries a snapshot). The
|
|
17494
|
+
* spatial subsystems (tracker association, occupancy count, re-id/embedding,
|
|
17495
|
+
* resurrection) MUST skip `sensor` tracks — they have no bbox trajectory.
|
|
17496
|
+
*/
|
|
17497
|
+
var TrackSourceSchema = _enum(["pipeline", "sensor"]);
|
|
17358
17498
|
var TrackSchema = object({
|
|
17359
17499
|
trackId: string(),
|
|
17360
17500
|
deviceId: number(),
|
|
17361
17501
|
className: string(),
|
|
17362
17502
|
label: string().optional(),
|
|
17503
|
+
/** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
|
|
17504
|
+
source: TrackSourceSchema.optional(),
|
|
17363
17505
|
firstSeen: number(),
|
|
17364
17506
|
lastSeen: number(),
|
|
17365
17507
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
@@ -17736,6 +17878,76 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
17736
17878
|
eventId: string(),
|
|
17737
17879
|
timestamp: number()
|
|
17738
17880
|
});
|
|
17881
|
+
/**
|
|
17882
|
+
* Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
|
|
17883
|
+
* `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
|
|
17884
|
+
* caps into per-camera event-kind descriptors.
|
|
17885
|
+
*
|
|
17886
|
+
* The descriptor DATA (color / iconId / labelKey / parentKind / category)
|
|
17887
|
+
* is NOT duplicated here — every entry is derived from the single
|
|
17888
|
+
* `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
|
|
17889
|
+
* ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
|
|
17890
|
+
* control cap means adding one line here (and a taxonomy entry); the anti-
|
|
17891
|
+
* drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
|
|
17892
|
+
* eventful cap is missing.
|
|
17893
|
+
*/
|
|
17894
|
+
/** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
|
|
17895
|
+
var LEGACY_ICON = {
|
|
17896
|
+
motion: "motion",
|
|
17897
|
+
audio: "audio",
|
|
17898
|
+
person: "person",
|
|
17899
|
+
vehicle: "vehicle",
|
|
17900
|
+
animal: "animal",
|
|
17901
|
+
package: "package",
|
|
17902
|
+
door: "door",
|
|
17903
|
+
pir: "pir",
|
|
17904
|
+
smoke: "smoke",
|
|
17905
|
+
water: "water",
|
|
17906
|
+
button: "button",
|
|
17907
|
+
generic: "generic",
|
|
17908
|
+
gas: "smoke",
|
|
17909
|
+
vibration: "generic",
|
|
17910
|
+
tamper: "generic",
|
|
17911
|
+
presence: "person",
|
|
17912
|
+
lock: "generic",
|
|
17913
|
+
siren: "generic",
|
|
17914
|
+
switch: "generic",
|
|
17915
|
+
doorbell: "button"
|
|
17916
|
+
};
|
|
17917
|
+
function legacyIcon(iconId) {
|
|
17918
|
+
return LEGACY_ICON[iconId] ?? "generic";
|
|
17919
|
+
}
|
|
17920
|
+
/**
|
|
17921
|
+
* Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
|
|
17922
|
+
* The anti-drift guard cross-checks this against the eventful caps declared
|
|
17923
|
+
* in `packages/types/src/capabilities/*.cap.ts`.
|
|
17924
|
+
*/
|
|
17925
|
+
var CAP_TO_KIND = {
|
|
17926
|
+
contact: "contact",
|
|
17927
|
+
motion: "motion-sensor",
|
|
17928
|
+
smoke: "smoke",
|
|
17929
|
+
flood: "flood",
|
|
17930
|
+
gas: "gas",
|
|
17931
|
+
"carbon-monoxide": "carbon-monoxide",
|
|
17932
|
+
vibration: "vibration",
|
|
17933
|
+
tamper: "tamper",
|
|
17934
|
+
presence: "presence",
|
|
17935
|
+
"enum-sensor": "enum-sensor",
|
|
17936
|
+
"event-emitter": "device-event",
|
|
17937
|
+
"lock-control": "lock",
|
|
17938
|
+
switch: "switch",
|
|
17939
|
+
button: "button",
|
|
17940
|
+
doorbell: "doorbell"
|
|
17941
|
+
};
|
|
17942
|
+
function buildDescriptor(capName, kind) {
|
|
17943
|
+
const t = EVENT_TAXONOMY[kind];
|
|
17944
|
+
if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
|
|
17945
|
+
return {
|
|
17946
|
+
...t,
|
|
17947
|
+
icon: legacyIcon(t.iconId)
|
|
17948
|
+
};
|
|
17949
|
+
}
|
|
17950
|
+
Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
|
|
17739
17951
|
var CameraPipelineConfigSchema = object({
|
|
17740
17952
|
engine: PipelineEngineChoiceSchema.optional(),
|
|
17741
17953
|
steps: array(PipelineStepInputSchema).readonly(),
|
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_dist = require("../dist-
|
|
5
|
+
const require_dist = require("../dist-B2jTt7Lq.js");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
//#region src/motion-wasm/wasm-motion-detector.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as evaluateZoneRules, K as hydrateSchema, O as motionDetectionCapability, V as BaseAddon, W as DeviceType } from "../dist-
|
|
1
|
+
import { C as evaluateZoneRules, K as hydrateSchema, O as motionDetectionCapability, V as BaseAddon, W as DeviceType } from "../dist-BzVZ2I4P.mjs";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
//#region src/motion-wasm/wasm-motion-detector.ts
|