@camstack/addon-export-ha-mqtt 1.1.26 → 1.2.0

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.
@@ -7117,6 +7117,17 @@ var ModelCatalogEntrySchema = object({
7117
7117
  "imagenet",
7118
7118
  "none"
7119
7119
  ]).optional(),
7120
+ /**
7121
+ * The model already applies softmax IN-GRAPH — its raw output is a
7122
+ * probability distribution, not logits. When set, the `softmax`
7123
+ * postprocessor must NOT re-apply softmax: re-softmaxing an already-normalised
7124
+ * probability vector collapses it toward uniform (top-1 score craters far
7125
+ * below its true value, making every confidence gate meaningless). Absent ⇒
7126
+ * the output is raw logits and the postprocessor applies softmax (the normal
7127
+ * case). Set on the Google AIY Birds `bird-classifier` (softmax baked into the
7128
+ * TF graph). Threaded to the Python pool via `PoolModelConfig.outputProbabilities`.
7129
+ */
7130
+ outputProbabilities: boolean().optional(),
7120
7131
  preprocessMode: _enum(["letterbox", "resize"]).optional(),
7121
7132
  /**
7122
7133
  * Per-MODEL postprocessor override. Absent ⇒ the step's own
@@ -7676,6 +7687,160 @@ var EncodeProfileSchema = object({
7676
7687
  */
7677
7688
  outputArgs: array(string()).optional()
7678
7689
  });
7690
+ var COCO_TO_MACRO = {
7691
+ mapping: {
7692
+ person: "person",
7693
+ bicycle: "vehicle",
7694
+ car: "vehicle",
7695
+ motorcycle: "vehicle",
7696
+ airplane: "vehicle",
7697
+ bus: "vehicle",
7698
+ train: "vehicle",
7699
+ truck: "vehicle",
7700
+ boat: "vehicle",
7701
+ bird: "animal",
7702
+ cat: "animal",
7703
+ dog: "animal",
7704
+ horse: "animal",
7705
+ sheep: "animal",
7706
+ cow: "animal",
7707
+ elephant: "animal",
7708
+ bear: "animal",
7709
+ zebra: "animal",
7710
+ giraffe: "animal",
7711
+ suitcase: "package",
7712
+ backpack: "package",
7713
+ handbag: "package"
7714
+ },
7715
+ preserveOriginal: false
7716
+ };
7717
+ var AUDIO_MACRO_LABELS = [
7718
+ {
7719
+ id: "speech",
7720
+ name: "Speech",
7721
+ icon: "🗣️"
7722
+ },
7723
+ {
7724
+ id: "scream",
7725
+ name: "Scream / Shout",
7726
+ icon: "😱"
7727
+ },
7728
+ {
7729
+ id: "crying",
7730
+ name: "Crying / Baby",
7731
+ icon: "😢"
7732
+ },
7733
+ {
7734
+ id: "laughter",
7735
+ name: "Laughter",
7736
+ icon: "😂"
7737
+ },
7738
+ {
7739
+ id: "music",
7740
+ name: "Music",
7741
+ icon: "🎵"
7742
+ },
7743
+ {
7744
+ id: "dog",
7745
+ name: "Dog",
7746
+ icon: "🐕"
7747
+ },
7748
+ {
7749
+ id: "cat",
7750
+ name: "Cat",
7751
+ icon: "🐈"
7752
+ },
7753
+ {
7754
+ id: "bird",
7755
+ name: "Bird",
7756
+ icon: "🐦"
7757
+ },
7758
+ {
7759
+ id: "animal",
7760
+ name: "Animal (other)",
7761
+ icon: "🐾"
7762
+ },
7763
+ {
7764
+ id: "alarm",
7765
+ name: "Alarm / Siren",
7766
+ icon: "🚨"
7767
+ },
7768
+ {
7769
+ id: "doorbell",
7770
+ name: "Doorbell / Knock",
7771
+ icon: "🔔"
7772
+ },
7773
+ {
7774
+ id: "glass_breaking",
7775
+ name: "Glass Breaking",
7776
+ icon: "💥"
7777
+ },
7778
+ {
7779
+ id: "gunshot",
7780
+ name: "Gunshot / Explosion",
7781
+ icon: "💣"
7782
+ },
7783
+ {
7784
+ id: "vehicle",
7785
+ name: "Vehicle",
7786
+ icon: "🚗"
7787
+ },
7788
+ {
7789
+ id: "siren",
7790
+ name: "Emergency Siren",
7791
+ icon: "🚑"
7792
+ },
7793
+ {
7794
+ id: "fire",
7795
+ name: "Fire / Smoke",
7796
+ icon: "🔥"
7797
+ },
7798
+ {
7799
+ id: "water",
7800
+ name: "Water",
7801
+ icon: "💧"
7802
+ },
7803
+ {
7804
+ id: "wind",
7805
+ name: "Wind / Weather",
7806
+ icon: "🌬️"
7807
+ },
7808
+ {
7809
+ id: "door",
7810
+ name: "Door",
7811
+ icon: "🚪"
7812
+ },
7813
+ {
7814
+ id: "footsteps",
7815
+ name: "Footsteps",
7816
+ icon: "👣"
7817
+ },
7818
+ {
7819
+ id: "crowd",
7820
+ name: "Crowd / Chatter",
7821
+ icon: "👥"
7822
+ },
7823
+ {
7824
+ id: "telephone",
7825
+ name: "Telephone",
7826
+ icon: "📞"
7827
+ },
7828
+ {
7829
+ id: "engine",
7830
+ name: "Engine / Motor",
7831
+ icon: "⚙️"
7832
+ },
7833
+ {
7834
+ id: "tools",
7835
+ name: "Tools / Construction",
7836
+ icon: "🔨"
7837
+ },
7838
+ {
7839
+ id: "silence",
7840
+ name: "Silence",
7841
+ icon: "🤫"
7842
+ }
7843
+ ];
7679
7844
  var YAMNET_TO_MACRO = {
7680
7845
  mapping: {
7681
7846
  Speech: "speech",
@@ -7942,6 +8107,125 @@ var _macroLookup = /* @__PURE__ */ new Map();
7942
8107
  for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7943
8108
  for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7944
8109
  /**
8110
+ * Unified event-kind taxonomy — THE single source of truth for
8111
+ * `kind → { parentKind, category, level, color, iconId, labelKey, label,
8112
+ * icon }`.
8113
+ *
8114
+ * This dictionary folds together what used to be scattered across four
8115
+ * copies:
8116
+ * - `capabilities/sensor-event-kinds.ts` (sensor cap colors)
8117
+ * - `addon-post-analysis/.../services/event-kinds.ts`
8118
+ * (MOTION/PERSON/VEHICLE… _COLOR constants)
8119
+ * - `ui-library/composites/detection-colors.ts` (CLASS_COLORS)
8120
+ * - `addon-post-analysis/shared/frame/box-drawer.ts` (DEFAULT_COLOR)
8121
+ * - the COCO / audio class maps (macro ↔ sub relationships)
8122
+ *
8123
+ * The DATA (serializable — color/iconId/labelKey/parentKind) lives here in
8124
+ * `@camstack/types`. The UI-side mapping `iconId → lucide component` and
8125
+ * `labelKey → t()` lives in `@camstack/ui-library`. UIs never hardcode a
8126
+ * color or an icon: they read this dictionary (server descriptors carry the
8127
+ * fields inline; the client resolves color/icon/label from `iconId`/`kind`).
8128
+ *
8129
+ * Two levels only (v1 YAGNI): macro → sub. `person` is a leaf macro.
8130
+ */
8131
+ var TAXONOMY_COLORS = {
8132
+ motion: "#f59e0b",
8133
+ audio: "#06b6d4",
8134
+ person: "#22c55e",
8135
+ vehicle: "#3b82f6",
8136
+ animal: "#f97316",
8137
+ package: "#a855f7",
8138
+ sensor: "#8b5cf6",
8139
+ control: "#10b981",
8140
+ genericDetection: "#64748b"
8141
+ };
8142
+ var DETECTION_SUB_COLORS = {
8143
+ car: "#f59e0b",
8144
+ truck: "#d97706",
8145
+ bus: "#b45309",
8146
+ motorcycle: "#eab308",
8147
+ bicycle: "#ca8a04",
8148
+ airplane: "#60a5fa",
8149
+ boat: "#2563eb",
8150
+ train: "#1d4ed8",
8151
+ bird: "#14b8a6",
8152
+ dog: "#84cc16",
8153
+ cat: "#f97316",
8154
+ horse: "#a16207",
8155
+ sheep: "#a3a3a3",
8156
+ cow: "#78716c",
8157
+ elephant: "#6b7280",
8158
+ bear: "#7c2d12",
8159
+ zebra: "#404040",
8160
+ giraffe: "#d4a373"
8161
+ };
8162
+ function titleCase(id) {
8163
+ return id.split(/[-_ ]/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
8164
+ }
8165
+ var entries = /* @__PURE__ */ new Map();
8166
+ function macro(kind, category, color, iconId, label) {
8167
+ entries.set(kind, {
8168
+ kind,
8169
+ parentKind: null,
8170
+ level: "macro",
8171
+ category,
8172
+ color,
8173
+ iconId,
8174
+ labelKey: `eventKind.${kind}`,
8175
+ label
8176
+ });
8177
+ }
8178
+ function sub(kind, parentKind, category, color, iconId, label) {
8179
+ entries.set(kind, {
8180
+ kind,
8181
+ parentKind,
8182
+ level: "sub",
8183
+ category,
8184
+ color,
8185
+ iconId,
8186
+ labelKey: `eventKind.${kind}`,
8187
+ label
8188
+ });
8189
+ }
8190
+ macro("motion", "motion", TAXONOMY_COLORS.motion, "motion", "Motion");
8191
+ macro("audio", "audio", TAXONOMY_COLORS.audio, "audio", "Audio");
8192
+ macro("person", "detection", TAXONOMY_COLORS.person, "person", "Person");
8193
+ macro("vehicle", "detection", TAXONOMY_COLORS.vehicle, "vehicle", "Vehicle");
8194
+ macro("animal", "detection", TAXONOMY_COLORS.animal, "animal", "Animal");
8195
+ macro("package", "package", TAXONOMY_COLORS.package, "package", "Package");
8196
+ macro("sensor", "sensor", TAXONOMY_COLORS.sensor, "sensor", "Sensor");
8197
+ macro("control", "control", TAXONOMY_COLORS.control, "control", "Control");
8198
+ for (const [cocoClass, macroClass] of Object.entries(COCO_TO_MACRO.mapping)) {
8199
+ if (macroClass !== "vehicle" && macroClass !== "animal") continue;
8200
+ if (entries.has(cocoClass)) continue;
8201
+ sub(cocoClass, macroClass, "detection", DETECTION_SUB_COLORS[cocoClass] ?? TAXONOMY_COLORS.genericDetection, cocoClass, titleCase(cocoClass));
8202
+ }
8203
+ sub("package-delivered", "package", "package", TAXONOMY_COLORS.package, "package", "Package delivered");
8204
+ sub("package-picked-up", "package", "package", TAXONOMY_COLORS.package, "package", "Package picked up");
8205
+ sub("contact", "sensor", "sensor", "#f59e0b", "door", "Contact");
8206
+ sub("motion-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "pir", "Motion sensor");
8207
+ sub("smoke", "sensor", "sensor", "#ef4444", "smoke", "Smoke");
8208
+ sub("flood", "sensor", "sensor", "#3b82f6", "water", "Water leak");
8209
+ sub("gas", "sensor", "sensor", "#ef4444", "gas", "Gas");
8210
+ sub("carbon-monoxide", "sensor", "sensor", "#dc2626", "smoke", "Carbon monoxide");
8211
+ sub("vibration", "sensor", "sensor", "#eab308", "vibration", "Vibration");
8212
+ sub("tamper", "sensor", "sensor", "#f97316", "tamper", "Tamper");
8213
+ sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
8214
+ sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
8215
+ sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
8216
+ sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
8217
+ sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
8218
+ sub("siren", "control", "control", "#dc2626", "siren", "Siren");
8219
+ sub("button", "control", "control", "#10b981", "button", "Button");
8220
+ sub("doorbell", "control", "control", "#a855f7", "doorbell", "Doorbell");
8221
+ for (const l of AUDIO_MACRO_LABELS) {
8222
+ const kind = `audio-${l.id}`;
8223
+ if (entries.has(kind)) continue;
8224
+ sub(kind, "audio", "audio", TAXONOMY_COLORS.audio, kind, l.name);
8225
+ }
8226
+ /** The complete taxonomy dictionary, keyed by kind. */
8227
+ var EVENT_TAXONOMY = Object.freeze(Object.fromEntries(entries));
8228
+ /**
7945
8229
  * Error types for the safe expression engine. Two distinct classes so callers
7946
8230
  * can tell a compile-time (grammar) failure from a runtime (evaluation)
7947
8231
  * failure — both are non-fatal to the host: read paths degrade to "skip link".
@@ -10857,10 +11141,7 @@ var ConfigUISchemaNullableBridge = custom();
10857
11141
  var InferenceCapabilitiesBridge = custom();
10858
11142
  var ModelAvailabilityListBridge = custom();
10859
11143
  var PipelineRunResultBridge = custom();
10860
- method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
10861
- kind: "mutation",
10862
- auth: "admin"
10863
- }), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
11144
+ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
10864
11145
  modelId: string(),
10865
11146
  settings: record(string(), unknown()).readonly()
10866
11147
  }))), method(object({ steps: record(string(), object({
@@ -10920,13 +11201,33 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
10920
11201
  * (inputClasses ≠ null) are skipped and served per-track via
10921
11202
  * pipelineRunner.runDetailSubtree (two-plane design).
10922
11203
  */
10923
- plane: _enum(["full", "frame"]).optional()
11204
+ plane: _enum(["full", "frame"]).optional(),
11205
+ /**
11206
+ * Inference-device selector (Phase 2 multi-device). Format
11207
+ * `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
11208
+ * Omitted ⇒ the runner's default device (current single-engine
11209
+ * behaviour). Selects WHICH device pool of the node runs the call.
11210
+ */
11211
+ deviceKey: string().optional()
10924
11212
  }), PipelineRunResultBridge, { kind: "mutation" }), method(object({
10925
11213
  engine: PipelineEngineChoiceSchema.optional(),
10926
11214
  steps: array(PipelineStepInputSchema).min(1),
10927
11215
  frames: array(FrameInputSchema).min(1).max(255),
10928
11216
  deviceId: number$1().optional(),
10929
- sessionId: string().optional()
11217
+ sessionId: string().optional(),
11218
+ /**
11219
+ * Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
11220
+ * the batch to the Python pool's bench preprocess cache
11221
+ * (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
11222
+ * preprocessed ONCE and every later inference is a pure-inference cache
11223
+ * hit — the sustained-throughput run measures inference, not
11224
+ * decode+preprocess+infer. Omitted/0 for live frames (all different →
11225
+ * full preprocess every call, correct). Fresh per sustained run;
11226
+ * released via `uncacheFrame`.
11227
+ */
11228
+ frameId: number$1().int().nonnegative().optional(),
11229
+ /** Inference-device selector (Phase 2 multi-device); see runPipeline. */
11230
+ deviceKey: string().optional()
10930
11231
  }), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
10931
11232
  data: _instanceof(Uint8Array),
10932
11233
  width: number$1().int().positive(),
@@ -10958,8 +11259,18 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
10958
11259
  * - `runtime` — main camera-serving engine (no idle TTL).
10959
11260
  * - `warm-override` — benchmark/test override held in the warm
10960
11261
  * cache; auto-disposed after the idle TTL.
11262
+ * - `device-pool` — a concurrent per-device pool (Phase 2
11263
+ * multi-device, keyed by `deviceKey`) resolved
11264
+ * via `resolveDeviceFactory`. Runs alongside the
11265
+ * `runtime` engine on a DIFFERENT accelerator
11266
+ * (NPU / iGPU / Coral) — this is how the
11267
+ * Engines tab shows all pools running at once.
10961
11268
  */
10962
- kind: _enum(["runtime", "warm-override"]),
11269
+ kind: _enum([
11270
+ "runtime",
11271
+ "warm-override",
11272
+ "device-pool"
11273
+ ]),
10963
11274
  /** Native pid of the underlying Python pool (null when no pool). */
10964
11275
  poolPid: number$1().nullable(),
10965
11276
  /** ms since this factory was last used (null when not warm-tracked). */
@@ -11301,7 +11612,14 @@ var RunnerCameraConfigSchema = object({
11301
11612
  * camera's detect node differs from its source-owner (P2d, gated by the
11302
11613
  * `remoteSourcingNodes` rollout setting).
11303
11614
  */
11304
- frameSource: RunnerFrameSourceSchema.default({ kind: "local-broker" })
11615
+ frameSource: RunnerFrameSourceSchema.default({ kind: "local-broker" }),
11616
+ /**
11617
+ * Inference-device selector for this camera's sessions (Phase 2 multi-device).
11618
+ * Format `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`);
11619
+ * omitted ⇒ the runner's default device. The engine itself stays node-local —
11620
+ * this only selects WHICH device pool of that node runs the session.
11621
+ */
11622
+ deviceKey: string().optional()
11305
11623
  });
11306
11624
  motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
11307
11625
  /**
@@ -11322,6 +11640,19 @@ var RunnerLocalLoadSchema = object({
11322
11640
  avgInferenceTimeMs: number$1(),
11323
11641
  /** Total queue depth across motion + detection queues. */
11324
11642
  queueDepthTotal: number$1(),
11643
+ /**
11644
+ * Per-inference-device live load (multi-device C4). One entry per deviceKey
11645
+ * this runner currently has attached cameras on, so the orchestrator's second
11646
+ * `balance()` pass (over a node's devices) weights on real per-pool session
11647
+ * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
11648
+ * per device is 0 until the pool backlog gets a public accessor (follow-up).
11649
+ */
11650
+ devices: array(object({
11651
+ deviceKey: string(),
11652
+ backend: string(),
11653
+ attachedCameras: number$1(),
11654
+ queueDepthTotal: number$1()
11655
+ })).default([]),
11325
11656
  /** Hardware capability flags reported by this node. */
11326
11657
  hardware: object({
11327
11658
  hasGpu: boolean(),
@@ -12797,6 +13128,8 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
12797
13128
  kind: "mutation",
12798
13129
  auth: "admin"
12799
13130
  });
13131
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder;
13132
+ new Set(Object.values(DeviceType));
12800
13133
  /**
12801
13134
  * `addon-pages` — system-scoped singleton aggregator cap. Public-facing
12802
13135
  * surface that admin-ui consumes through `useAddonPagesListPages()`.
@@ -15916,17 +16249,30 @@ var EventKindCategorySchema = _enum([
15916
16249
  "audio",
15917
16250
  "detection",
15918
16251
  "sensor",
16252
+ "control",
15919
16253
  "custom",
15920
16254
  "package"
15921
16255
  ]);
16256
+ /** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
16257
+ var EventKindLevelSchema = _enum(["macro", "sub"]);
15922
16258
  var EventKindDescriptorSchema = object({
15923
- /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
16259
+ /** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
15924
16260
  kind: string(),
16261
+ /** i18n key resolved on the UI side; `label` is the English fallback. */
16262
+ labelKey: string(),
16263
+ /** English fallback label (kept for clients that don't translate). */
15925
16264
  label: string(),
15926
16265
  /** Hex color for timeline/legend rendering. */
15927
16266
  color: string(),
16267
+ /** Dictionary id → lucide component on the UI side. */
16268
+ iconId: string(),
16269
+ /** Legacy closed-vocab glyph — fallback for `iconId`. */
15928
16270
  icon: EventKindIconSchema,
15929
16271
  category: EventKindCategorySchema,
16272
+ /** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
16273
+ parentKind: string().nullable(),
16274
+ /** Derived from `parentKind`, explicit for the client tree. */
16275
+ level: EventKindLevelSchema,
15930
16276
  /** Which cap + device contributes this kind. For built-ins the camera
15931
16277
  * itself; for sensor kinds the LINKED source device. */
15932
16278
  source: object({
@@ -15999,11 +16345,21 @@ var TrackAudioLabelSchema = object({
15999
16345
  firstAt: number$1(),
16000
16346
  lastAt: number$1()
16001
16347
  });
16348
+ /**
16349
+ * How a track was produced. `pipeline` (default / absent) = the spatial
16350
+ * detection+tracking pipeline. `sensor` = a SYNTHETIC track projected from a
16351
+ * linked sensor/control state change (no positions; carries a snapshot). The
16352
+ * spatial subsystems (tracker association, occupancy count, re-id/embedding,
16353
+ * resurrection) MUST skip `sensor` tracks — they have no bbox trajectory.
16354
+ */
16355
+ var TrackSourceSchema = _enum(["pipeline", "sensor"]);
16002
16356
  var TrackSchema = object({
16003
16357
  trackId: string(),
16004
16358
  deviceId: number$1(),
16005
16359
  className: string(),
16006
16360
  label: string().optional(),
16361
+ /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16362
+ source: TrackSourceSchema.optional(),
16007
16363
  firstSeen: number$1(),
16008
16364
  lastSeen: number$1(),
16009
16365
  /** Frame-rate position history (subject to maxPositionHistory cap). */
@@ -16380,6 +16736,76 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
16380
16736
  eventId: string(),
16381
16737
  timestamp: number$1()
16382
16738
  });
16739
+ /**
16740
+ * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
16741
+ * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
16742
+ * caps into per-camera event-kind descriptors.
16743
+ *
16744
+ * The descriptor DATA (color / iconId / labelKey / parentKind / category)
16745
+ * is NOT duplicated here — every entry is derived from the single
16746
+ * `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
16747
+ * ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
16748
+ * control cap means adding one line here (and a taxonomy entry); the anti-
16749
+ * drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
16750
+ * eventful cap is missing.
16751
+ */
16752
+ /** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
16753
+ var LEGACY_ICON = {
16754
+ motion: "motion",
16755
+ audio: "audio",
16756
+ person: "person",
16757
+ vehicle: "vehicle",
16758
+ animal: "animal",
16759
+ package: "package",
16760
+ door: "door",
16761
+ pir: "pir",
16762
+ smoke: "smoke",
16763
+ water: "water",
16764
+ button: "button",
16765
+ generic: "generic",
16766
+ gas: "smoke",
16767
+ vibration: "generic",
16768
+ tamper: "generic",
16769
+ presence: "person",
16770
+ lock: "generic",
16771
+ siren: "generic",
16772
+ switch: "generic",
16773
+ doorbell: "button"
16774
+ };
16775
+ function legacyIcon(iconId) {
16776
+ return LEGACY_ICON[iconId] ?? "generic";
16777
+ }
16778
+ /**
16779
+ * Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
16780
+ * The anti-drift guard cross-checks this against the eventful caps declared
16781
+ * in `packages/types/src/capabilities/*.cap.ts`.
16782
+ */
16783
+ var CAP_TO_KIND = {
16784
+ contact: "contact",
16785
+ motion: "motion-sensor",
16786
+ smoke: "smoke",
16787
+ flood: "flood",
16788
+ gas: "gas",
16789
+ "carbon-monoxide": "carbon-monoxide",
16790
+ vibration: "vibration",
16791
+ tamper: "tamper",
16792
+ presence: "presence",
16793
+ "enum-sensor": "enum-sensor",
16794
+ "event-emitter": "device-event",
16795
+ "lock-control": "lock",
16796
+ switch: "switch",
16797
+ button: "button",
16798
+ doorbell: "doorbell"
16799
+ };
16800
+ function buildDescriptor(capName, kind) {
16801
+ const t = EVENT_TAXONOMY[kind];
16802
+ if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
16803
+ return {
16804
+ ...t,
16805
+ icon: legacyIcon(t.iconId)
16806
+ };
16807
+ }
16808
+ Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
16383
16809
  var CameraPipelineConfigSchema = object({
16384
16810
  engine: PipelineEngineChoiceSchema.optional(),
16385
16811
  steps: array(PipelineStepInputSchema).readonly(),
@@ -16398,13 +16824,11 @@ var PipelineTemplateSchema = object({
16398
16824
  createdAt: string(),
16399
16825
  updatedAt: string()
16400
16826
  });
16401
- var AgentAddonConfigSchema = object({
16402
- enabled: boolean(),
16827
+ var DeviceStepConfigSchema = object({
16403
16828
  modelId: string().optional(),
16404
- settings: record(string(), unknown()).readonly()
16829
+ settings: record(string(), unknown()).optional()
16405
16830
  });
16406
16831
  var AgentPipelineSettingsSchema = object({
16407
- addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
16408
16832
  maxCameras: number$1().int().nonnegative().nullable().default(null),
16409
16833
  /** Per-node detection weight (relative share for the quota balancer). */
16410
16834
  detectWeight: number$1().positive().optional(),
@@ -16428,7 +16852,22 @@ var AgentPipelineSettingsSchema = object({
16428
16852
  * it already uses to reach the hub). Set this only when the auto-detected
16429
16853
  * address is wrong (multi-homed host, NAT, custom interface).
16430
16854
  */
16431
- reachableHost: string().optional()
16855
+ reachableHost: string().optional(),
16856
+ /**
16857
+ * Multi-device inference opt-in (Phase 4). Per-node map deviceKey → {enabled,
16858
+ * weight, steps}. Absent / all-disabled ⇒ the node's single default
16859
+ * accelerator (safe default); two+ enabled ⇒ the dispatcher balances
16860
+ * detection sessions across them so they run CONCURRENTLY. `steps` is the
16861
+ * per-(node,device) BASE provisioning (`stepId → {modelId?, settings?}`) —
16862
+ * the default model/settings for every camera landing on that accelerator;
16863
+ * a stepId absent ⇒ the step uses that device's format default.
16864
+ */
16865
+ inferenceDevices: record(string(), object({
16866
+ enabled: boolean(),
16867
+ weight: number$1().positive().optional(),
16868
+ maxSessions: number$1().int().positive().optional(),
16869
+ steps: record(string(), DeviceStepConfigSchema).optional()
16870
+ })).optional()
16432
16871
  });
16433
16872
  var CameraPipelineForAgentSchema = object({
16434
16873
  steps: array(PipelineStepInputSchema).readonly(),
@@ -16438,14 +16877,13 @@ var CameraPipelineForAgentSchema = object({
16438
16877
  }).nullable()
16439
16878
  });
16440
16879
  var CameraStepOverridePatchSchema = object({
16441
- enabled: boolean().optional(),
16442
16880
  modelId: string().optional(),
16443
16881
  settings: record(string(), unknown()).readonly().optional()
16444
16882
  });
16445
16883
  var CameraPipelineSettingsSchema = object({
16446
16884
  pinnedAgentNodeId: string().optional(),
16447
16885
  stepToggles: record(string(), boolean()).optional(),
16448
- stepOverridesByAgent: record(string(), record(string(), CameraStepOverridePatchSchema)).optional(),
16886
+ stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
16449
16887
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
16450
16888
  });
16451
16889
  /**
@@ -16659,6 +17097,44 @@ var CameraStatusSchema = object({
16659
17097
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
16660
17098
  fetchedAt: number$1()
16661
17099
  });
17100
+ var NodeInferenceDeviceSchema = object({
17101
+ /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
17102
+ key: string(),
17103
+ backend: string(),
17104
+ device: string(),
17105
+ format: _enum(MODEL_FORMATS),
17106
+ /** Whether the node's live probe reports the device as usable right now. */
17107
+ available: boolean(),
17108
+ /**
17109
+ * Whether this device participates in dispatch. AUTO default (spec C2):
17110
+ * accelerators are opt-OUT (a discovered NPU/iGPU/Coral/ANE with no stored
17111
+ * entry is `true`); CPU is opt-IN (`false` by default — the fallback pool,
17112
+ * not a balanced target). An explicit stored value always wins; a stored-only
17113
+ * (unavailable) key keeps its stored value.
17114
+ */
17115
+ enabled: boolean(),
17116
+ /** Relative balancer weight for the enabled device (default 1). */
17117
+ weight: number$1(),
17118
+ /** Per-device concurrent-session cap; null = unlimited (multi-device C4). */
17119
+ maxSessions: number$1().nullable(),
17120
+ /** Object-detection model the executor defaults to for this deviceKey. */
17121
+ defaultModelId: string(),
17122
+ /**
17123
+ * Per-(node,device) BASE provisioning (C7.2/C7.4) — the RAW stored
17124
+ * `stepId → {modelId?, settings?}` map from `inferenceDevices[key].steps`.
17125
+ * Absent/empty ⇒ no base (every step uses its device format default). The
17126
+ * UI cross-references `pipelineExecutor.getSchema` for the models actually
17127
+ * available per format; this is the stored selection that becomes the
17128
+ * default for EVERY camera landing on this accelerator.
17129
+ */
17130
+ steps: record(string(), DeviceStepConfigSchema).optional()
17131
+ });
17132
+ var NodeInferenceDevicesSchema = object({
17133
+ nodeId: string(),
17134
+ /** False when the node's platform-probe was unreachable (no live device set). */
17135
+ reachable: boolean(),
17136
+ devices: array(NodeInferenceDeviceSchema).readonly()
17137
+ });
16662
17138
  method(object({
16663
17139
  deviceId: number$1(),
16664
17140
  agentNodeId: string()
@@ -16668,7 +17144,13 @@ method(object({
16668
17144
  }), method(object({ deviceId: number$1() }), object({ success: literal(true) }), {
16669
17145
  kind: "mutation",
16670
17146
  auth: "admin"
16671
- }), method(_void(), object({ migrated: number$1() }), {
17147
+ }), method(object({
17148
+ deviceId: number$1(),
17149
+ deviceKey: string()
17150
+ }), object({ success: literal(true) }), {
17151
+ kind: "mutation",
17152
+ auth: "admin"
17153
+ }), method(object({ deviceId: number$1() }), object({ deviceKey: string().nullable() })), method(_void(), object({ migrated: number$1() }), {
16672
17154
  kind: "mutation",
16673
17155
  auth: "admin"
16674
17156
  }), method(_void(), array(PipelineAssignmentSchema).readonly()), method(object({ deviceId: number$1() }), PipelineAssignmentSchema.nullable()), method(_void(), array(AgentLoadSummarySchema).readonly()), method(_void(), GlobalMetricsSchema), method(object({ deviceId: number$1() }), CameraMetricsSchema.nullable()), method(object({ nodeId: string() }), CapabilityBindingsSchema), method(object({
@@ -16702,13 +17184,7 @@ method(object({
16702
17184
  }))), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
16703
17185
  nodeId: string(),
16704
17186
  settings: AgentPipelineSettingsSchema
16705
- })).readonly()), method(object({
16706
- agentNodeId: string(),
16707
- defaults: record(string(), AgentAddonConfigSchema)
16708
- }), object({ success: literal(true) }), {
16709
- kind: "mutation",
16710
- auth: "admin"
16711
- }), method(object({ agentNodeId: string() }), object({
17187
+ })).readonly()), method(object({ agentNodeId: string() }), object({
16712
17188
  success: boolean(),
16713
17189
  removed: boolean()
16714
17190
  }), {
@@ -16740,7 +17216,18 @@ method(object({
16740
17216
  }), object({ success: literal(true) }), {
16741
17217
  kind: "mutation",
16742
17218
  auth: "admin"
16743
- }), method(object({ agentNodeId: string() }), object({
17219
+ }), method(object({
17220
+ agentNodeId: string(),
17221
+ inferenceDevices: record(string(), object({
17222
+ enabled: boolean(),
17223
+ weight: number$1().positive().optional(),
17224
+ maxSessions: number$1().int().positive().optional(),
17225
+ steps: record(string(), DeviceStepConfigSchema).optional()
17226
+ }))
17227
+ }), object({ success: literal(true) }), {
17228
+ kind: "mutation",
17229
+ auth: "admin"
17230
+ }), method(object({ nodeId: string() }), NodeInferenceDevicesSchema), method(object({ agentNodeId: string() }), object({
16744
17231
  success: literal(true),
16745
17232
  /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
16746
17233
  effectiveModelId: string().nullable(),
@@ -16756,9 +17243,10 @@ method(object({
16756
17243
  }), object({ success: literal(true) }), {
16757
17244
  kind: "mutation",
16758
17245
  auth: "admin"
16759
- }), method(object({ deviceId: number$1() }), record(string(), record(string(), CameraStepOverridePatchSchema)).nullable()), method(object({
17246
+ }), method(object({ deviceId: number$1() }), record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).nullable()), method(object({
16760
17247
  deviceId: number$1(),
16761
17248
  agentNodeId: string(),
17249
+ deviceKey: string(),
16762
17250
  addonId: string(),
16763
17251
  patch: CameraStepOverridePatchSchema.nullable()
16764
17252
  }), object({ success: literal(true) }), {
@@ -16795,14 +17283,13 @@ method(object({
16795
17283
  });
16796
17284
  /**
16797
17285
  * server-management — per-NODE singleton capability for a node's ROOT
16798
- * package lifecycle (runtime-updatable node packages, phase 2: hub + docker
16799
- * agents).
17286
+ * package lifecycle (runtime-updatable node packages).
16800
17287
  *
16801
- * Each node's root package (`@camstack/server` on the hub, `@camstack/agent`
16802
- * on agents) carries the whole software stack in its npm dep tree, so ONE
16803
- * version describes the node. Updates install into
16804
- * `<dataDir>/server-root/versions/<v>/` and apply on restart via the baked
16805
- * starter (probation boot + auto-rollback to N-1).
17288
+ * Every node role runs the SAME root package (`@camstack/server`), which
17289
+ * carries the whole software stack in its npm dep tree, so ONE version
17290
+ * describes the node. Updates stage into `<dataDir>/server-root/` and apply
17291
+ * on restart via the baked starter (single-copy in-place swap — no probation,
17292
+ * no auto-rollback).
16806
17293
  *
16807
17294
  * Providers:
16808
17295
  * - HUB: `ServerUpdateService` behind the `server-provided` mount
@@ -16910,7 +17397,8 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
16910
17397
  /** Explicit target version; omitted = latest from the registry. */
16911
17398
  version: string().optional() }), ServerUpdateActionResultSchema, {
16912
17399
  kind: "mutation",
16913
- auth: "admin"
17400
+ auth: "admin",
17401
+ timeoutMs: 16 * 6e4
16914
17402
  }), method(_void(), ServerUpdateActionResultSchema, {
16915
17403
  kind: "mutation",
16916
17404
  auth: "admin"
@@ -17954,22 +18442,6 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
17954
18442
  var RestartAddonResultSchema = unknown();
17955
18443
  var InstallPackageResultSchema = unknown();
17956
18444
  var ReloadPackagesResultSchema = unknown();
17957
- /**
17958
- * Result of `updateFrameworkPackage`. The cap method returns BEFORE the
17959
- * server restarts so the admin UI can react to the `restartingAt`
17960
- * timestamp (shows reconnect overlay). The transition from
17961
- * `fromVersion` to `toVersion` will be confirmed by a subsequent
17962
- * `system.restart-completed` event after the new process boots.
17963
- *
17964
- * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
17965
- */
17966
- var UpdateFrameworkPackageResultSchema = object({
17967
- packageName: string(),
17968
- fromVersion: string(),
17969
- toVersion: string(),
17970
- /** Ms-epoch the server scheduled its self-restart. */
17971
- restartingAt: number$1()
17972
- });
17973
18445
  var BulkUpdateItemStatusSchema = _enum([
17974
18446
  "queued",
17975
18447
  "updating",
@@ -18097,13 +18569,6 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
18097
18569
  }), object({ success: literal(true) }), {
18098
18570
  kind: "mutation",
18099
18571
  auth: "admin"
18100
- }), method(object({
18101
- packageName: string().min(1),
18102
- version: string().optional(),
18103
- deferRestart: boolean().optional()
18104
- }), UpdateFrameworkPackageResultSchema, {
18105
- kind: "mutation",
18106
- auth: "admin"
18107
18572
  }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
18108
18573
  kind: "mutation",
18109
18574
  auth: "admin"
@@ -18969,10 +19434,10 @@ var TopologyCategorySchema = object({
18969
19434
  addons: array(TopologyCategoryAddonSchema).readonly()
18970
19435
  });
18971
19436
  /**
18972
- * The node's runtime-updatable ROOT package (`@camstack/server` on the hub,
18973
- * `@camstack/agent` on agents) as reported by its `registerNode` manifest —
18974
- * version visibility for the Server management surface. Nullable: offline
18975
- * rows and pre-phase-2 nodes report none.
19437
+ * The node's runtime-updatable ROOT package (`@camstack/server` the single
19438
+ * root package for every node role) as reported by its `registerNode`
19439
+ * manifest — version visibility for the Server management surface. Nullable:
19440
+ * offline rows and nodes that never reported one.
18976
19441
  */
18977
19442
  var TopologyRootPackageSchema = object({
18978
19443
  name: string(),
@@ -19360,17 +19825,28 @@ var PlatformScoreSchema = object({
19360
19825
  format: _enum([
19361
19826
  "onnx",
19362
19827
  "coreml",
19363
- "openvino"
19828
+ "openvino",
19829
+ "tflite"
19364
19830
  ]),
19365
19831
  score: number$1(),
19366
19832
  reason: string(),
19367
19833
  available: boolean()
19368
19834
  });
19835
+ var InferenceDeviceDescriptorSchema = object({
19836
+ key: string(),
19837
+ backend: string(),
19838
+ device: string(),
19839
+ format: ModelFormatSchema,
19840
+ runtime: literal("python"),
19841
+ score: number$1(),
19842
+ available: boolean()
19843
+ });
19369
19844
  var PlatformCapabilitiesSchema = object({
19370
19845
  hardware: HardwareInfoSchema,
19371
19846
  scores: array(PlatformScoreSchema).readonly(),
19372
19847
  bestScore: PlatformScoreSchema,
19373
- pythonPath: string().nullable()
19848
+ pythonPath: string().nullable(),
19849
+ devices: array(InferenceDeviceDescriptorSchema).readonly()
19374
19850
  });
19375
19851
  var ModelRequirementSchema = object({
19376
19852
  modelId: string(),
@@ -20249,12 +20725,6 @@ Object.freeze({
20249
20725
  addonId: null,
20250
20726
  access: "delete"
20251
20727
  },
20252
- "addons.updateFrameworkPackage": {
20253
- capName: "addons",
20254
- capScope: "system",
20255
- addonId: null,
20256
- access: "create"
20257
- },
20258
20728
  "addons.updatePackage": {
20259
20729
  capName: "addons",
20260
20730
  capScope: "system",
@@ -23027,12 +23497,6 @@ Object.freeze({
23027
23497
  addonId: null,
23028
23498
  access: "view"
23029
23499
  },
23030
- "pipelineExecutor.reprobeEngine": {
23031
- capName: "pipeline-executor",
23032
- capScope: "system",
23033
- addonId: null,
23034
- access: "create"
23035
- },
23036
23500
  "pipelineExecutor.runAudioTest": {
23037
23501
  capName: "pipeline-executor",
23038
23502
  capScope: "system",
@@ -23183,6 +23647,12 @@ Object.freeze({
23183
23647
  addonId: null,
23184
23648
  access: "view"
23185
23649
  },
23650
+ "pipelineOrchestrator.getNodeInferenceDevices": {
23651
+ capName: "pipeline-orchestrator",
23652
+ capScope: "system",
23653
+ addonId: null,
23654
+ access: "view"
23655
+ },
23186
23656
  "pipelineOrchestrator.getPipelineAssignment": {
23187
23657
  capName: "pipeline-orchestrator",
23188
23658
  capScope: "system",
@@ -23195,6 +23665,12 @@ Object.freeze({
23195
23665
  addonId: null,
23196
23666
  access: "view"
23197
23667
  },
23668
+ "pipelineOrchestrator.getPipelineDevicePin": {
23669
+ capName: "pipeline-orchestrator",
23670
+ capScope: "system",
23671
+ addonId: null,
23672
+ access: "view"
23673
+ },
23198
23674
  "pipelineOrchestrator.listAgentSettings": {
23199
23675
  capName: "pipeline-orchestrator",
23200
23676
  capScope: "system",
@@ -23237,19 +23713,19 @@ Object.freeze({
23237
23713
  addonId: null,
23238
23714
  access: "create"
23239
23715
  },
23240
- "pipelineOrchestrator.setAgentAddonDefaults": {
23716
+ "pipelineOrchestrator.setAgentCapabilities": {
23241
23717
  capName: "pipeline-orchestrator",
23242
23718
  capScope: "system",
23243
23719
  addonId: null,
23244
23720
  access: "create"
23245
23721
  },
23246
- "pipelineOrchestrator.setAgentCapabilities": {
23722
+ "pipelineOrchestrator.setAgentDetectWeight": {
23247
23723
  capName: "pipeline-orchestrator",
23248
23724
  capScope: "system",
23249
23725
  addonId: null,
23250
23726
  access: "create"
23251
23727
  },
23252
- "pipelineOrchestrator.setAgentDetectWeight": {
23728
+ "pipelineOrchestrator.setAgentInferenceDevices": {
23253
23729
  capName: "pipeline-orchestrator",
23254
23730
  capScope: "system",
23255
23731
  addonId: null,
@@ -23291,6 +23767,12 @@ Object.freeze({
23291
23767
  addonId: null,
23292
23768
  access: "create"
23293
23769
  },
23770
+ "pipelineOrchestrator.setPipelineDevicePin": {
23771
+ capName: "pipeline-orchestrator",
23772
+ capScope: "system",
23773
+ addonId: null,
23774
+ access: "create"
23775
+ },
23294
23776
  "pipelineOrchestrator.unassignAudio": {
23295
23777
  capName: "pipeline-orchestrator",
23296
23778
  capScope: "system",
@@ -24843,32 +25325,6 @@ Object.freeze({
24843
25325
  "network-access": "ingress",
24844
25326
  "smtp-provider": "email"
24845
25327
  });
24846
- var frameworkSwapPackageSchema = object({
24847
- name: string(),
24848
- stagedPath: string(),
24849
- backupPath: string(),
24850
- toVersion: string(),
24851
- fromVersion: string().nullable()
24852
- });
24853
- object({
24854
- jobId: string(),
24855
- taskId: string(),
24856
- packages: array(frameworkSwapPackageSchema),
24857
- requestedAtMs: number$1(),
24858
- schemaVersion: literal(1)
24859
- });
24860
- object({
24861
- jobId: string(),
24862
- taskId: string(),
24863
- backups: array(object({
24864
- name: string(),
24865
- backupPath: string(),
24866
- livePath: string()
24867
- })),
24868
- appliedAtMs: number$1(),
24869
- bootAttempts: number$1(),
24870
- schemaVersion: literal(1)
24871
- });
24872
25328
  //#endregion
24873
25329
  //#region ../../node_modules/readable-stream/lib/ours/primordials.js
24874
25330
  var require_primordials = /* @__PURE__ */ __commonJSMin(((exports, module) => {