@camstack/system 1.1.55 → 1.1.56

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.
Files changed (49) hide show
  1. package/dist/addon-runner.js +2 -2
  2. package/dist/addon-runner.mjs +2 -2
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  14. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  15. package/dist/builtins/doorbell/trigger-engine.d.ts +18 -0
  16. package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +8 -14
  17. package/dist/builtins/doorbell/virtual-doorbell.addon.js +37 -30
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +37 -30
  19. package/dist/builtins/hub-forwarder/index.js +1 -1
  20. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  21. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  22. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  23. package/dist/builtins/local-network/local-network.addon.js +1 -1
  24. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  25. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  26. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  27. package/dist/builtins/platform-probe/index.js +1 -1
  28. package/dist/builtins/platform-probe/index.mjs +1 -1
  29. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  30. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  31. package/dist/builtins/snapshot/index.js +1 -1
  32. package/dist/builtins/snapshot/index.mjs +1 -1
  33. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  34. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  35. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  36. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  37. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  38. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  39. package/dist/builtins/system-config/system-config.addon.js +1 -1
  40. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  41. package/dist/builtins/winston-logging/index.js +1 -1
  42. package/dist/builtins/winston-logging/index.mjs +1 -1
  43. package/dist/{dist-CD5HJkAg.js → dist-Bg795EQF.js} +367 -1
  44. package/dist/{dist-RlzjLezj.mjs → dist-JAF9YR1q.mjs} +367 -1
  45. package/dist/index.js +2 -2
  46. package/dist/index.mjs +2 -2
  47. package/dist/{manifest-python-deps-BMKlyabv.mjs → manifest-python-deps-9wuRyL-k.mjs} +1 -1
  48. package/dist/{manifest-python-deps-BpDOYWC2.js → manifest-python-deps-eI3-3FeW.js} +1 -1
  49. package/package.json +1 -1
@@ -3742,6 +3742,160 @@ function readNodePin(context) {
3742
3742
  const value = Reflect.get(context, CAP_NODE_PIN_CONTEXT_KEY);
3743
3743
  return typeof value === "string" ? value : void 0;
3744
3744
  }
3745
+ var COCO_TO_MACRO = {
3746
+ mapping: {
3747
+ person: "person",
3748
+ bicycle: "vehicle",
3749
+ car: "vehicle",
3750
+ motorcycle: "vehicle",
3751
+ airplane: "vehicle",
3752
+ bus: "vehicle",
3753
+ train: "vehicle",
3754
+ truck: "vehicle",
3755
+ boat: "vehicle",
3756
+ bird: "animal",
3757
+ cat: "animal",
3758
+ dog: "animal",
3759
+ horse: "animal",
3760
+ sheep: "animal",
3761
+ cow: "animal",
3762
+ elephant: "animal",
3763
+ bear: "animal",
3764
+ zebra: "animal",
3765
+ giraffe: "animal",
3766
+ suitcase: "package",
3767
+ backpack: "package",
3768
+ handbag: "package"
3769
+ },
3770
+ preserveOriginal: false
3771
+ };
3772
+ var AUDIO_MACRO_LABELS = [
3773
+ {
3774
+ id: "speech",
3775
+ name: "Speech",
3776
+ icon: "🗣️"
3777
+ },
3778
+ {
3779
+ id: "scream",
3780
+ name: "Scream / Shout",
3781
+ icon: "😱"
3782
+ },
3783
+ {
3784
+ id: "crying",
3785
+ name: "Crying / Baby",
3786
+ icon: "😢"
3787
+ },
3788
+ {
3789
+ id: "laughter",
3790
+ name: "Laughter",
3791
+ icon: "😂"
3792
+ },
3793
+ {
3794
+ id: "music",
3795
+ name: "Music",
3796
+ icon: "🎵"
3797
+ },
3798
+ {
3799
+ id: "dog",
3800
+ name: "Dog",
3801
+ icon: "🐕"
3802
+ },
3803
+ {
3804
+ id: "cat",
3805
+ name: "Cat",
3806
+ icon: "🐈"
3807
+ },
3808
+ {
3809
+ id: "bird",
3810
+ name: "Bird",
3811
+ icon: "🐦"
3812
+ },
3813
+ {
3814
+ id: "animal",
3815
+ name: "Animal (other)",
3816
+ icon: "🐾"
3817
+ },
3818
+ {
3819
+ id: "alarm",
3820
+ name: "Alarm / Siren",
3821
+ icon: "🚨"
3822
+ },
3823
+ {
3824
+ id: "doorbell",
3825
+ name: "Doorbell / Knock",
3826
+ icon: "🔔"
3827
+ },
3828
+ {
3829
+ id: "glass_breaking",
3830
+ name: "Glass Breaking",
3831
+ icon: "💥"
3832
+ },
3833
+ {
3834
+ id: "gunshot",
3835
+ name: "Gunshot / Explosion",
3836
+ icon: "💣"
3837
+ },
3838
+ {
3839
+ id: "vehicle",
3840
+ name: "Vehicle",
3841
+ icon: "🚗"
3842
+ },
3843
+ {
3844
+ id: "siren",
3845
+ name: "Emergency Siren",
3846
+ icon: "🚑"
3847
+ },
3848
+ {
3849
+ id: "fire",
3850
+ name: "Fire / Smoke",
3851
+ icon: "🔥"
3852
+ },
3853
+ {
3854
+ id: "water",
3855
+ name: "Water",
3856
+ icon: "💧"
3857
+ },
3858
+ {
3859
+ id: "wind",
3860
+ name: "Wind / Weather",
3861
+ icon: "🌬️"
3862
+ },
3863
+ {
3864
+ id: "door",
3865
+ name: "Door",
3866
+ icon: "🚪"
3867
+ },
3868
+ {
3869
+ id: "footsteps",
3870
+ name: "Footsteps",
3871
+ icon: "👣"
3872
+ },
3873
+ {
3874
+ id: "crowd",
3875
+ name: "Crowd / Chatter",
3876
+ icon: "👥"
3877
+ },
3878
+ {
3879
+ id: "telephone",
3880
+ name: "Telephone",
3881
+ icon: "📞"
3882
+ },
3883
+ {
3884
+ id: "engine",
3885
+ name: "Engine / Motor",
3886
+ icon: "⚙️"
3887
+ },
3888
+ {
3889
+ id: "tools",
3890
+ name: "Tools / Construction",
3891
+ icon: "🔨"
3892
+ },
3893
+ {
3894
+ id: "silence",
3895
+ name: "Silence",
3896
+ icon: "🤫"
3897
+ }
3898
+ ];
3745
3899
  var YAMNET_TO_MACRO = {
3746
3900
  mapping: {
3747
3901
  Speech: "speech",
@@ -4008,6 +4162,125 @@ var _macroLookup = /* @__PURE__ */ new Map();
4008
4162
  for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
4009
4163
  for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
4010
4164
  /**
4165
+ * Unified event-kind taxonomy — THE single source of truth for
4166
+ * `kind → { parentKind, category, level, color, iconId, labelKey, label,
4167
+ * icon }`.
4168
+ *
4169
+ * This dictionary folds together what used to be scattered across four
4170
+ * copies:
4171
+ * - `capabilities/sensor-event-kinds.ts` (sensor cap colors)
4172
+ * - `addon-post-analysis/.../services/event-kinds.ts`
4173
+ * (MOTION/PERSON/VEHICLE… _COLOR constants)
4174
+ * - `ui-library/composites/detection-colors.ts` (CLASS_COLORS)
4175
+ * - `addon-post-analysis/shared/frame/box-drawer.ts` (DEFAULT_COLOR)
4176
+ * - the COCO / audio class maps (macro ↔ sub relationships)
4177
+ *
4178
+ * The DATA (serializable — color/iconId/labelKey/parentKind) lives here in
4179
+ * `@camstack/types`. The UI-side mapping `iconId → lucide component` and
4180
+ * `labelKey → t()` lives in `@camstack/ui-library`. UIs never hardcode a
4181
+ * color or an icon: they read this dictionary (server descriptors carry the
4182
+ * fields inline; the client resolves color/icon/label from `iconId`/`kind`).
4183
+ *
4184
+ * Two levels only (v1 YAGNI): macro → sub. `person` is a leaf macro.
4185
+ */
4186
+ var TAXONOMY_COLORS = {
4187
+ motion: "#f59e0b",
4188
+ audio: "#06b6d4",
4189
+ person: "#22c55e",
4190
+ vehicle: "#3b82f6",
4191
+ animal: "#f97316",
4192
+ package: "#a855f7",
4193
+ sensor: "#8b5cf6",
4194
+ control: "#10b981",
4195
+ genericDetection: "#64748b"
4196
+ };
4197
+ var DETECTION_SUB_COLORS = {
4198
+ car: "#f59e0b",
4199
+ truck: "#d97706",
4200
+ bus: "#b45309",
4201
+ motorcycle: "#eab308",
4202
+ bicycle: "#ca8a04",
4203
+ airplane: "#60a5fa",
4204
+ boat: "#2563eb",
4205
+ train: "#1d4ed8",
4206
+ bird: "#14b8a6",
4207
+ dog: "#84cc16",
4208
+ cat: "#f97316",
4209
+ horse: "#a16207",
4210
+ sheep: "#a3a3a3",
4211
+ cow: "#78716c",
4212
+ elephant: "#6b7280",
4213
+ bear: "#7c2d12",
4214
+ zebra: "#404040",
4215
+ giraffe: "#d4a373"
4216
+ };
4217
+ function titleCase(id) {
4218
+ return id.split(/[-_ ]/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
4219
+ }
4220
+ var entries = /* @__PURE__ */ new Map();
4221
+ function macro(kind, category, color, iconId, label) {
4222
+ entries.set(kind, {
4223
+ kind,
4224
+ parentKind: null,
4225
+ level: "macro",
4226
+ category,
4227
+ color,
4228
+ iconId,
4229
+ labelKey: `eventKind.${kind}`,
4230
+ label
4231
+ });
4232
+ }
4233
+ function sub(kind, parentKind, category, color, iconId, label) {
4234
+ entries.set(kind, {
4235
+ kind,
4236
+ parentKind,
4237
+ level: "sub",
4238
+ category,
4239
+ color,
4240
+ iconId,
4241
+ labelKey: `eventKind.${kind}`,
4242
+ label
4243
+ });
4244
+ }
4245
+ macro("motion", "motion", TAXONOMY_COLORS.motion, "motion", "Motion");
4246
+ macro("audio", "audio", TAXONOMY_COLORS.audio, "audio", "Audio");
4247
+ macro("person", "detection", TAXONOMY_COLORS.person, "person", "Person");
4248
+ macro("vehicle", "detection", TAXONOMY_COLORS.vehicle, "vehicle", "Vehicle");
4249
+ macro("animal", "detection", TAXONOMY_COLORS.animal, "animal", "Animal");
4250
+ macro("package", "package", TAXONOMY_COLORS.package, "package", "Package");
4251
+ macro("sensor", "sensor", TAXONOMY_COLORS.sensor, "sensor", "Sensor");
4252
+ macro("control", "control", TAXONOMY_COLORS.control, "control", "Control");
4253
+ for (const [cocoClass, macroClass] of Object.entries(COCO_TO_MACRO.mapping)) {
4254
+ if (macroClass !== "vehicle" && macroClass !== "animal") continue;
4255
+ if (entries.has(cocoClass)) continue;
4256
+ sub(cocoClass, macroClass, "detection", DETECTION_SUB_COLORS[cocoClass] ?? TAXONOMY_COLORS.genericDetection, cocoClass, titleCase(cocoClass));
4257
+ }
4258
+ sub("package-delivered", "package", "package", TAXONOMY_COLORS.package, "package", "Package delivered");
4259
+ sub("package-picked-up", "package", "package", TAXONOMY_COLORS.package, "package", "Package picked up");
4260
+ sub("contact", "sensor", "sensor", "#f59e0b", "door", "Contact");
4261
+ sub("motion-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "pir", "Motion sensor");
4262
+ sub("smoke", "sensor", "sensor", "#ef4444", "smoke", "Smoke");
4263
+ sub("flood", "sensor", "sensor", "#3b82f6", "water", "Water leak");
4264
+ sub("gas", "sensor", "sensor", "#ef4444", "gas", "Gas");
4265
+ sub("carbon-monoxide", "sensor", "sensor", "#dc2626", "smoke", "Carbon monoxide");
4266
+ sub("vibration", "sensor", "sensor", "#eab308", "vibration", "Vibration");
4267
+ sub("tamper", "sensor", "sensor", "#f97316", "tamper", "Tamper");
4268
+ sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
4269
+ sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
4270
+ sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
4271
+ sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
4272
+ sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
4273
+ sub("siren", "control", "control", "#dc2626", "siren", "Siren");
4274
+ sub("button", "control", "control", "#10b981", "button", "Button");
4275
+ sub("doorbell", "control", "control", "#a855f7", "doorbell", "Doorbell");
4276
+ for (const l of AUDIO_MACRO_LABELS) {
4277
+ const kind = `audio-${l.id}`;
4278
+ if (entries.has(kind)) continue;
4279
+ sub(kind, "audio", "audio", TAXONOMY_COLORS.audio, kind, l.name);
4280
+ }
4281
+ /** The complete taxonomy dictionary, keyed by kind. */
4282
+ var EVENT_TAXONOMY = Object.freeze(Object.fromEntries(entries));
4283
+ /**
4011
4284
  * Error types for the safe expression engine. Two distinct classes so callers
4012
4285
  * can tell a compile-time (grammar) failure from a runtime (evaluation)
4013
4286
  * failure — both are non-fatal to the host: read paths degrade to "skip link".
@@ -15876,17 +16149,30 @@ var EventKindCategorySchema = zod.z.enum([
15876
16149
  "audio",
15877
16150
  "detection",
15878
16151
  "sensor",
16152
+ "control",
15879
16153
  "custom",
15880
16154
  "package"
15881
16155
  ]);
16156
+ /** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
16157
+ var EventKindLevelSchema = zod.z.enum(["macro", "sub"]);
15882
16158
  var EventKindDescriptorSchema = zod.z.object({
15883
- /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
16159
+ /** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
15884
16160
  kind: zod.z.string(),
16161
+ /** i18n key resolved on the UI side; `label` is the English fallback. */
16162
+ labelKey: zod.z.string(),
16163
+ /** English fallback label (kept for clients that don't translate). */
15885
16164
  label: zod.z.string(),
15886
16165
  /** Hex color for timeline/legend rendering. */
15887
16166
  color: zod.z.string(),
16167
+ /** Dictionary id → lucide component on the UI side. */
16168
+ iconId: zod.z.string(),
16169
+ /** Legacy closed-vocab glyph — fallback for `iconId`. */
15888
16170
  icon: EventKindIconSchema,
15889
16171
  category: EventKindCategorySchema,
16172
+ /** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
16173
+ parentKind: zod.z.string().nullable(),
16174
+ /** Derived from `parentKind`, explicit for the client tree. */
16175
+ level: EventKindLevelSchema,
15890
16176
  /** Which cap + device contributes this kind. For built-ins the camera
15891
16177
  * itself; for sensor kinds the LINKED source device. */
15892
16178
  source: zod.z.object({
@@ -15959,11 +16245,21 @@ var TrackAudioLabelSchema = zod.z.object({
15959
16245
  firstAt: zod.z.number(),
15960
16246
  lastAt: zod.z.number()
15961
16247
  });
16248
+ /**
16249
+ * How a track was produced. `pipeline` (default / absent) = the spatial
16250
+ * detection+tracking pipeline. `sensor` = a SYNTHETIC track projected from a
16251
+ * linked sensor/control state change (no positions; carries a snapshot). The
16252
+ * spatial subsystems (tracker association, occupancy count, re-id/embedding,
16253
+ * resurrection) MUST skip `sensor` tracks — they have no bbox trajectory.
16254
+ */
16255
+ var TrackSourceSchema = zod.z.enum(["pipeline", "sensor"]);
15962
16256
  var TrackSchema = zod.z.object({
15963
16257
  trackId: zod.z.string(),
15964
16258
  deviceId: zod.z.number(),
15965
16259
  className: zod.z.string(),
15966
16260
  label: zod.z.string().optional(),
16261
+ /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16262
+ source: TrackSourceSchema.optional(),
15967
16263
  firstSeen: zod.z.number(),
15968
16264
  lastSeen: zod.z.number(),
15969
16265
  /** Frame-rate position history (subject to maxPositionHistory cap). */
@@ -16491,6 +16787,76 @@ var pipelineAnalyticsCapability = {
16491
16787
  }) }
16492
16788
  }
16493
16789
  };
16790
+ /**
16791
+ * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
16792
+ * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
16793
+ * caps into per-camera event-kind descriptors.
16794
+ *
16795
+ * The descriptor DATA (color / iconId / labelKey / parentKind / category)
16796
+ * is NOT duplicated here — every entry is derived from the single
16797
+ * `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
16798
+ * ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
16799
+ * control cap means adding one line here (and a taxonomy entry); the anti-
16800
+ * drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
16801
+ * eventful cap is missing.
16802
+ */
16803
+ /** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
16804
+ var LEGACY_ICON = {
16805
+ motion: "motion",
16806
+ audio: "audio",
16807
+ person: "person",
16808
+ vehicle: "vehicle",
16809
+ animal: "animal",
16810
+ package: "package",
16811
+ door: "door",
16812
+ pir: "pir",
16813
+ smoke: "smoke",
16814
+ water: "water",
16815
+ button: "button",
16816
+ generic: "generic",
16817
+ gas: "smoke",
16818
+ vibration: "generic",
16819
+ tamper: "generic",
16820
+ presence: "person",
16821
+ lock: "generic",
16822
+ siren: "generic",
16823
+ switch: "generic",
16824
+ doorbell: "button"
16825
+ };
16826
+ function legacyIcon(iconId) {
16827
+ return LEGACY_ICON[iconId] ?? "generic";
16828
+ }
16829
+ /**
16830
+ * Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
16831
+ * The anti-drift guard cross-checks this against the eventful caps declared
16832
+ * in `packages/types/src/capabilities/*.cap.ts`.
16833
+ */
16834
+ var CAP_TO_KIND = {
16835
+ contact: "contact",
16836
+ motion: "motion-sensor",
16837
+ smoke: "smoke",
16838
+ flood: "flood",
16839
+ gas: "gas",
16840
+ "carbon-monoxide": "carbon-monoxide",
16841
+ vibration: "vibration",
16842
+ tamper: "tamper",
16843
+ presence: "presence",
16844
+ "enum-sensor": "enum-sensor",
16845
+ "event-emitter": "device-event",
16846
+ "lock-control": "lock",
16847
+ switch: "switch",
16848
+ button: "button",
16849
+ doorbell: "doorbell"
16850
+ };
16851
+ function buildDescriptor(capName, kind) {
16852
+ const t = EVENT_TAXONOMY[kind];
16853
+ if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
16854
+ return {
16855
+ ...t,
16856
+ icon: legacyIcon(t.iconId)
16857
+ };
16858
+ }
16859
+ Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
16494
16860
  var CameraPipelineConfigSchema = zod.z.object({
16495
16861
  engine: PipelineEngineChoiceSchema.optional(),
16496
16862
  steps: zod.z.array(PipelineStepInputSchema).readonly(),