@camstack/addon-provider-wyze 0.1.24 → 0.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.
Files changed (3) hide show
  1. package/dist/addon.js +560 -104
  2. package/dist/addon.mjs +560 -104
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7115,6 +7115,17 @@ var ModelCatalogEntrySchema = object({
7115
7115
  "imagenet",
7116
7116
  "none"
7117
7117
  ]).optional(),
7118
+ /**
7119
+ * The model already applies softmax IN-GRAPH — its raw output is a
7120
+ * probability distribution, not logits. When set, the `softmax`
7121
+ * postprocessor must NOT re-apply softmax: re-softmaxing an already-normalised
7122
+ * probability vector collapses it toward uniform (top-1 score craters far
7123
+ * below its true value, making every confidence gate meaningless). Absent ⇒
7124
+ * the output is raw logits and the postprocessor applies softmax (the normal
7125
+ * case). Set on the Google AIY Birds `bird-classifier` (softmax baked into the
7126
+ * TF graph). Threaded to the Python pool via `PoolModelConfig.outputProbabilities`.
7127
+ */
7128
+ outputProbabilities: boolean().optional(),
7118
7129
  preprocessMode: _enum(["letterbox", "resize"]).optional(),
7119
7130
  /**
7120
7131
  * Per-MODEL postprocessor override. Absent ⇒ the step's own
@@ -7674,6 +7685,160 @@ var EncodeProfileSchema = object({
7674
7685
  */
7675
7686
  outputArgs: array(string()).optional()
7676
7687
  });
7688
+ var COCO_TO_MACRO = {
7689
+ mapping: {
7690
+ person: "person",
7691
+ bicycle: "vehicle",
7692
+ car: "vehicle",
7693
+ motorcycle: "vehicle",
7694
+ airplane: "vehicle",
7695
+ bus: "vehicle",
7696
+ train: "vehicle",
7697
+ truck: "vehicle",
7698
+ boat: "vehicle",
7699
+ bird: "animal",
7700
+ cat: "animal",
7701
+ dog: "animal",
7702
+ horse: "animal",
7703
+ sheep: "animal",
7704
+ cow: "animal",
7705
+ elephant: "animal",
7706
+ bear: "animal",
7707
+ zebra: "animal",
7708
+ giraffe: "animal",
7709
+ suitcase: "package",
7710
+ backpack: "package",
7711
+ handbag: "package"
7712
+ },
7713
+ preserveOriginal: false
7714
+ };
7715
+ var AUDIO_MACRO_LABELS = [
7716
+ {
7717
+ id: "speech",
7718
+ name: "Speech",
7719
+ icon: "🗣️"
7720
+ },
7721
+ {
7722
+ id: "scream",
7723
+ name: "Scream / Shout",
7724
+ icon: "😱"
7725
+ },
7726
+ {
7727
+ id: "crying",
7728
+ name: "Crying / Baby",
7729
+ icon: "😢"
7730
+ },
7731
+ {
7732
+ id: "laughter",
7733
+ name: "Laughter",
7734
+ icon: "😂"
7735
+ },
7736
+ {
7737
+ id: "music",
7738
+ name: "Music",
7739
+ icon: "🎵"
7740
+ },
7741
+ {
7742
+ id: "dog",
7743
+ name: "Dog",
7744
+ icon: "🐕"
7745
+ },
7746
+ {
7747
+ id: "cat",
7748
+ name: "Cat",
7749
+ icon: "🐈"
7750
+ },
7751
+ {
7752
+ id: "bird",
7753
+ name: "Bird",
7754
+ icon: "🐦"
7755
+ },
7756
+ {
7757
+ id: "animal",
7758
+ name: "Animal (other)",
7759
+ icon: "🐾"
7760
+ },
7761
+ {
7762
+ id: "alarm",
7763
+ name: "Alarm / Siren",
7764
+ icon: "🚨"
7765
+ },
7766
+ {
7767
+ id: "doorbell",
7768
+ name: "Doorbell / Knock",
7769
+ icon: "🔔"
7770
+ },
7771
+ {
7772
+ id: "glass_breaking",
7773
+ name: "Glass Breaking",
7774
+ icon: "💥"
7775
+ },
7776
+ {
7777
+ id: "gunshot",
7778
+ name: "Gunshot / Explosion",
7779
+ icon: "💣"
7780
+ },
7781
+ {
7782
+ id: "vehicle",
7783
+ name: "Vehicle",
7784
+ icon: "🚗"
7785
+ },
7786
+ {
7787
+ id: "siren",
7788
+ name: "Emergency Siren",
7789
+ icon: "🚑"
7790
+ },
7791
+ {
7792
+ id: "fire",
7793
+ name: "Fire / Smoke",
7794
+ icon: "🔥"
7795
+ },
7796
+ {
7797
+ id: "water",
7798
+ name: "Water",
7799
+ icon: "💧"
7800
+ },
7801
+ {
7802
+ id: "wind",
7803
+ name: "Wind / Weather",
7804
+ icon: "🌬️"
7805
+ },
7806
+ {
7807
+ id: "door",
7808
+ name: "Door",
7809
+ icon: "🚪"
7810
+ },
7811
+ {
7812
+ id: "footsteps",
7813
+ name: "Footsteps",
7814
+ icon: "👣"
7815
+ },
7816
+ {
7817
+ id: "crowd",
7818
+ name: "Crowd / Chatter",
7819
+ icon: "👥"
7820
+ },
7821
+ {
7822
+ id: "telephone",
7823
+ name: "Telephone",
7824
+ icon: "📞"
7825
+ },
7826
+ {
7827
+ id: "engine",
7828
+ name: "Engine / Motor",
7829
+ icon: "⚙️"
7830
+ },
7831
+ {
7832
+ id: "tools",
7833
+ name: "Tools / Construction",
7834
+ icon: "🔨"
7835
+ },
7836
+ {
7837
+ id: "silence",
7838
+ name: "Silence",
7839
+ icon: "🤫"
7840
+ }
7841
+ ];
7677
7842
  var YAMNET_TO_MACRO = {
7678
7843
  mapping: {
7679
7844
  Speech: "speech",
@@ -7940,6 +8105,125 @@ var _macroLookup = /* @__PURE__ */ new Map();
7940
8105
  for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7941
8106
  for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7942
8107
  /**
8108
+ * Unified event-kind taxonomy — THE single source of truth for
8109
+ * `kind → { parentKind, category, level, color, iconId, labelKey, label,
8110
+ * icon }`.
8111
+ *
8112
+ * This dictionary folds together what used to be scattered across four
8113
+ * copies:
8114
+ * - `capabilities/sensor-event-kinds.ts` (sensor cap colors)
8115
+ * - `addon-post-analysis/.../services/event-kinds.ts`
8116
+ * (MOTION/PERSON/VEHICLE… _COLOR constants)
8117
+ * - `ui-library/composites/detection-colors.ts` (CLASS_COLORS)
8118
+ * - `addon-post-analysis/shared/frame/box-drawer.ts` (DEFAULT_COLOR)
8119
+ * - the COCO / audio class maps (macro ↔ sub relationships)
8120
+ *
8121
+ * The DATA (serializable — color/iconId/labelKey/parentKind) lives here in
8122
+ * `@camstack/types`. The UI-side mapping `iconId → lucide component` and
8123
+ * `labelKey → t()` lives in `@camstack/ui-library`. UIs never hardcode a
8124
+ * color or an icon: they read this dictionary (server descriptors carry the
8125
+ * fields inline; the client resolves color/icon/label from `iconId`/`kind`).
8126
+ *
8127
+ * Two levels only (v1 YAGNI): macro → sub. `person` is a leaf macro.
8128
+ */
8129
+ var TAXONOMY_COLORS = {
8130
+ motion: "#f59e0b",
8131
+ audio: "#06b6d4",
8132
+ person: "#22c55e",
8133
+ vehicle: "#3b82f6",
8134
+ animal: "#f97316",
8135
+ package: "#a855f7",
8136
+ sensor: "#8b5cf6",
8137
+ control: "#10b981",
8138
+ genericDetection: "#64748b"
8139
+ };
8140
+ var DETECTION_SUB_COLORS = {
8141
+ car: "#f59e0b",
8142
+ truck: "#d97706",
8143
+ bus: "#b45309",
8144
+ motorcycle: "#eab308",
8145
+ bicycle: "#ca8a04",
8146
+ airplane: "#60a5fa",
8147
+ boat: "#2563eb",
8148
+ train: "#1d4ed8",
8149
+ bird: "#14b8a6",
8150
+ dog: "#84cc16",
8151
+ cat: "#f97316",
8152
+ horse: "#a16207",
8153
+ sheep: "#a3a3a3",
8154
+ cow: "#78716c",
8155
+ elephant: "#6b7280",
8156
+ bear: "#7c2d12",
8157
+ zebra: "#404040",
8158
+ giraffe: "#d4a373"
8159
+ };
8160
+ function titleCase(id) {
8161
+ return id.split(/[-_ ]/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
8162
+ }
8163
+ var entries = /* @__PURE__ */ new Map();
8164
+ function macro(kind, category, color, iconId, label) {
8165
+ entries.set(kind, {
8166
+ kind,
8167
+ parentKind: null,
8168
+ level: "macro",
8169
+ category,
8170
+ color,
8171
+ iconId,
8172
+ labelKey: `eventKind.${kind}`,
8173
+ label
8174
+ });
8175
+ }
8176
+ function sub(kind, parentKind, category, color, iconId, label) {
8177
+ entries.set(kind, {
8178
+ kind,
8179
+ parentKind,
8180
+ level: "sub",
8181
+ category,
8182
+ color,
8183
+ iconId,
8184
+ labelKey: `eventKind.${kind}`,
8185
+ label
8186
+ });
8187
+ }
8188
+ macro("motion", "motion", TAXONOMY_COLORS.motion, "motion", "Motion");
8189
+ macro("audio", "audio", TAXONOMY_COLORS.audio, "audio", "Audio");
8190
+ macro("person", "detection", TAXONOMY_COLORS.person, "person", "Person");
8191
+ macro("vehicle", "detection", TAXONOMY_COLORS.vehicle, "vehicle", "Vehicle");
8192
+ macro("animal", "detection", TAXONOMY_COLORS.animal, "animal", "Animal");
8193
+ macro("package", "package", TAXONOMY_COLORS.package, "package", "Package");
8194
+ macro("sensor", "sensor", TAXONOMY_COLORS.sensor, "sensor", "Sensor");
8195
+ macro("control", "control", TAXONOMY_COLORS.control, "control", "Control");
8196
+ for (const [cocoClass, macroClass] of Object.entries(COCO_TO_MACRO.mapping)) {
8197
+ if (macroClass !== "vehicle" && macroClass !== "animal") continue;
8198
+ if (entries.has(cocoClass)) continue;
8199
+ sub(cocoClass, macroClass, "detection", DETECTION_SUB_COLORS[cocoClass] ?? TAXONOMY_COLORS.genericDetection, cocoClass, titleCase(cocoClass));
8200
+ }
8201
+ sub("package-delivered", "package", "package", TAXONOMY_COLORS.package, "package", "Package delivered");
8202
+ sub("package-picked-up", "package", "package", TAXONOMY_COLORS.package, "package", "Package picked up");
8203
+ sub("contact", "sensor", "sensor", "#f59e0b", "door", "Contact");
8204
+ sub("motion-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "pir", "Motion sensor");
8205
+ sub("smoke", "sensor", "sensor", "#ef4444", "smoke", "Smoke");
8206
+ sub("flood", "sensor", "sensor", "#3b82f6", "water", "Water leak");
8207
+ sub("gas", "sensor", "sensor", "#ef4444", "gas", "Gas");
8208
+ sub("carbon-monoxide", "sensor", "sensor", "#dc2626", "smoke", "Carbon monoxide");
8209
+ sub("vibration", "sensor", "sensor", "#eab308", "vibration", "Vibration");
8210
+ sub("tamper", "sensor", "sensor", "#f97316", "tamper", "Tamper");
8211
+ sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
8212
+ sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
8213
+ sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
8214
+ sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
8215
+ sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
8216
+ sub("siren", "control", "control", "#dc2626", "siren", "Siren");
8217
+ sub("button", "control", "control", "#10b981", "button", "Button");
8218
+ sub("doorbell", "control", "control", "#a855f7", "doorbell", "Doorbell");
8219
+ for (const l of AUDIO_MACRO_LABELS) {
8220
+ const kind = `audio-${l.id}`;
8221
+ if (entries.has(kind)) continue;
8222
+ sub(kind, "audio", "audio", TAXONOMY_COLORS.audio, kind, l.name);
8223
+ }
8224
+ /** The complete taxonomy dictionary, keyed by kind. */
8225
+ var EVENT_TAXONOMY = Object.freeze(Object.fromEntries(entries));
8226
+ /**
7943
8227
  * Error types for the safe expression engine. Two distinct classes so callers
7944
8228
  * can tell a compile-time (grammar) failure from a runtime (evaluation)
7945
8229
  * failure — both are non-fatal to the host: read paths degrade to "skip link".
@@ -12132,10 +12416,7 @@ var ConfigUISchemaNullableBridge = custom();
12132
12416
  var InferenceCapabilitiesBridge = custom();
12133
12417
  var ModelAvailabilityListBridge = custom();
12134
12418
  var PipelineRunResultBridge = custom();
12135
- method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
12136
- kind: "mutation",
12137
- auth: "admin"
12138
- }), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
12419
+ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
12139
12420
  modelId: string(),
12140
12421
  settings: record(string(), unknown()).readonly()
12141
12422
  }))), method(object({ steps: record(string(), object({
@@ -12195,13 +12476,33 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
12195
12476
  * (inputClasses ≠ null) are skipped and served per-track via
12196
12477
  * pipelineRunner.runDetailSubtree (two-plane design).
12197
12478
  */
12198
- plane: _enum(["full", "frame"]).optional()
12479
+ plane: _enum(["full", "frame"]).optional(),
12480
+ /**
12481
+ * Inference-device selector (Phase 2 multi-device). Format
12482
+ * `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
12483
+ * Omitted ⇒ the runner's default device (current single-engine
12484
+ * behaviour). Selects WHICH device pool of the node runs the call.
12485
+ */
12486
+ deviceKey: string().optional()
12199
12487
  }), PipelineRunResultBridge, { kind: "mutation" }), method(object({
12200
12488
  engine: PipelineEngineChoiceSchema.optional(),
12201
12489
  steps: array(PipelineStepInputSchema).min(1),
12202
12490
  frames: array(FrameInputSchema).min(1).max(255),
12203
12491
  deviceId: number().optional(),
12204
- sessionId: string().optional()
12492
+ sessionId: string().optional(),
12493
+ /**
12494
+ * Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
12495
+ * the batch to the Python pool's bench preprocess cache
12496
+ * (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
12497
+ * preprocessed ONCE and every later inference is a pure-inference cache
12498
+ * hit — the sustained-throughput run measures inference, not
12499
+ * decode+preprocess+infer. Omitted/0 for live frames (all different →
12500
+ * full preprocess every call, correct). Fresh per sustained run;
12501
+ * released via `uncacheFrame`.
12502
+ */
12503
+ frameId: number().int().nonnegative().optional(),
12504
+ /** Inference-device selector (Phase 2 multi-device); see runPipeline. */
12505
+ deviceKey: string().optional()
12205
12506
  }), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
12206
12507
  data: _instanceof(Uint8Array),
12207
12508
  width: number().int().positive(),
@@ -12233,8 +12534,18 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
12233
12534
  * - `runtime` — main camera-serving engine (no idle TTL).
12234
12535
  * - `warm-override` — benchmark/test override held in the warm
12235
12536
  * cache; auto-disposed after the idle TTL.
12537
+ * - `device-pool` — a concurrent per-device pool (Phase 2
12538
+ * multi-device, keyed by `deviceKey`) resolved
12539
+ * via `resolveDeviceFactory`. Runs alongside the
12540
+ * `runtime` engine on a DIFFERENT accelerator
12541
+ * (NPU / iGPU / Coral) — this is how the
12542
+ * Engines tab shows all pools running at once.
12236
12543
  */
12237
- kind: _enum(["runtime", "warm-override"]),
12544
+ kind: _enum([
12545
+ "runtime",
12546
+ "warm-override",
12547
+ "device-pool"
12548
+ ]),
12238
12549
  /** Native pid of the underlying Python pool (null when no pool). */
12239
12550
  poolPid: number().nullable(),
12240
12551
  /** ms since this factory was last used (null when not warm-tracked). */
@@ -12609,7 +12920,14 @@ var RunnerCameraConfigSchema = object({
12609
12920
  * camera's detect node differs from its source-owner (P2d, gated by the
12610
12921
  * `remoteSourcingNodes` rollout setting).
12611
12922
  */
12612
- frameSource: RunnerFrameSourceSchema.default({ kind: "local-broker" })
12923
+ frameSource: RunnerFrameSourceSchema.default({ kind: "local-broker" }),
12924
+ /**
12925
+ * Inference-device selector for this camera's sessions (Phase 2 multi-device).
12926
+ * Format `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`);
12927
+ * omitted ⇒ the runner's default device. The engine itself stays node-local —
12928
+ * this only selects WHICH device pool of that node runs the session.
12929
+ */
12930
+ deviceKey: string().optional()
12613
12931
  });
12614
12932
  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;
12615
12933
  /**
@@ -12630,6 +12948,19 @@ var RunnerLocalLoadSchema = object({
12630
12948
  avgInferenceTimeMs: number(),
12631
12949
  /** Total queue depth across motion + detection queues. */
12632
12950
  queueDepthTotal: number(),
12951
+ /**
12952
+ * Per-inference-device live load (multi-device C4). One entry per deviceKey
12953
+ * this runner currently has attached cameras on, so the orchestrator's second
12954
+ * `balance()` pass (over a node's devices) weights on real per-pool session
12955
+ * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
12956
+ * per device is 0 until the pool backlog gets a public accessor (follow-up).
12957
+ */
12958
+ devices: array(object({
12959
+ deviceKey: string(),
12960
+ backend: string(),
12961
+ attachedCameras: number(),
12962
+ queueDepthTotal: number()
12963
+ })).default([]),
12633
12964
  /** Hardware capability flags reported by this node. */
12634
12965
  hardware: object({
12635
12966
  hasGpu: boolean(),
@@ -15778,6 +16109,8 @@ var BaseDeviceProvider = class extends BaseAddon {
15778
16109
  return toDeviceSummary(device, this.addonId);
15779
16110
  }
15780
16111
  };
16112
+ 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;
16113
+ new Set(Object.values(DeviceType));
15781
16114
  /**
15782
16115
  * `addon-pages` — system-scoped singleton aggregator cap. Public-facing
15783
16116
  * surface that admin-ui consumes through `useAddonPagesListPages()`.
@@ -18889,17 +19222,30 @@ var EventKindCategorySchema = _enum([
18889
19222
  "audio",
18890
19223
  "detection",
18891
19224
  "sensor",
19225
+ "control",
18892
19226
  "custom",
18893
19227
  "package"
18894
19228
  ]);
19229
+ /** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
19230
+ var EventKindLevelSchema = _enum(["macro", "sub"]);
18895
19231
  var EventKindDescriptorSchema = object({
18896
- /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
19232
+ /** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
18897
19233
  kind: string(),
19234
+ /** i18n key resolved on the UI side; `label` is the English fallback. */
19235
+ labelKey: string(),
19236
+ /** English fallback label (kept for clients that don't translate). */
18898
19237
  label: string(),
18899
19238
  /** Hex color for timeline/legend rendering. */
18900
19239
  color: string(),
19240
+ /** Dictionary id → lucide component on the UI side. */
19241
+ iconId: string(),
19242
+ /** Legacy closed-vocab glyph — fallback for `iconId`. */
18901
19243
  icon: EventKindIconSchema,
18902
19244
  category: EventKindCategorySchema,
19245
+ /** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
19246
+ parentKind: string().nullable(),
19247
+ /** Derived from `parentKind`, explicit for the client tree. */
19248
+ level: EventKindLevelSchema,
18903
19249
  /** Which cap + device contributes this kind. For built-ins the camera
18904
19250
  * itself; for sensor kinds the LINKED source device. */
18905
19251
  source: object({
@@ -18972,11 +19318,21 @@ var TrackAudioLabelSchema = object({
18972
19318
  firstAt: number(),
18973
19319
  lastAt: number()
18974
19320
  });
19321
+ /**
19322
+ * How a track was produced. `pipeline` (default / absent) = the spatial
19323
+ * detection+tracking pipeline. `sensor` = a SYNTHETIC track projected from a
19324
+ * linked sensor/control state change (no positions; carries a snapshot). The
19325
+ * spatial subsystems (tracker association, occupancy count, re-id/embedding,
19326
+ * resurrection) MUST skip `sensor` tracks — they have no bbox trajectory.
19327
+ */
19328
+ var TrackSourceSchema = _enum(["pipeline", "sensor"]);
18975
19329
  var TrackSchema = object({
18976
19330
  trackId: string(),
18977
19331
  deviceId: number(),
18978
19332
  className: string(),
18979
19333
  label: string().optional(),
19334
+ /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19335
+ source: TrackSourceSchema.optional(),
18980
19336
  firstSeen: number(),
18981
19337
  lastSeen: number(),
18982
19338
  /** Frame-rate position history (subject to maxPositionHistory cap). */
@@ -19353,6 +19709,76 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19353
19709
  eventId: string(),
19354
19710
  timestamp: number()
19355
19711
  });
19712
+ /**
19713
+ * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
19714
+ * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
19715
+ * caps into per-camera event-kind descriptors.
19716
+ *
19717
+ * The descriptor DATA (color / iconId / labelKey / parentKind / category)
19718
+ * is NOT duplicated here — every entry is derived from the single
19719
+ * `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
19720
+ * ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
19721
+ * control cap means adding one line here (and a taxonomy entry); the anti-
19722
+ * drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
19723
+ * eventful cap is missing.
19724
+ */
19725
+ /** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
19726
+ var LEGACY_ICON = {
19727
+ motion: "motion",
19728
+ audio: "audio",
19729
+ person: "person",
19730
+ vehicle: "vehicle",
19731
+ animal: "animal",
19732
+ package: "package",
19733
+ door: "door",
19734
+ pir: "pir",
19735
+ smoke: "smoke",
19736
+ water: "water",
19737
+ button: "button",
19738
+ generic: "generic",
19739
+ gas: "smoke",
19740
+ vibration: "generic",
19741
+ tamper: "generic",
19742
+ presence: "person",
19743
+ lock: "generic",
19744
+ siren: "generic",
19745
+ switch: "generic",
19746
+ doorbell: "button"
19747
+ };
19748
+ function legacyIcon(iconId) {
19749
+ return LEGACY_ICON[iconId] ?? "generic";
19750
+ }
19751
+ /**
19752
+ * Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
19753
+ * The anti-drift guard cross-checks this against the eventful caps declared
19754
+ * in `packages/types/src/capabilities/*.cap.ts`.
19755
+ */
19756
+ var CAP_TO_KIND = {
19757
+ contact: "contact",
19758
+ motion: "motion-sensor",
19759
+ smoke: "smoke",
19760
+ flood: "flood",
19761
+ gas: "gas",
19762
+ "carbon-monoxide": "carbon-monoxide",
19763
+ vibration: "vibration",
19764
+ tamper: "tamper",
19765
+ presence: "presence",
19766
+ "enum-sensor": "enum-sensor",
19767
+ "event-emitter": "device-event",
19768
+ "lock-control": "lock",
19769
+ switch: "switch",
19770
+ button: "button",
19771
+ doorbell: "doorbell"
19772
+ };
19773
+ function buildDescriptor(capName, kind) {
19774
+ const t = EVENT_TAXONOMY[kind];
19775
+ if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
19776
+ return {
19777
+ ...t,
19778
+ icon: legacyIcon(t.iconId)
19779
+ };
19780
+ }
19781
+ Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
19356
19782
  var CameraPipelineConfigSchema = object({
19357
19783
  engine: PipelineEngineChoiceSchema.optional(),
19358
19784
  steps: array(PipelineStepInputSchema).readonly(),
@@ -19371,13 +19797,11 @@ var PipelineTemplateSchema = object({
19371
19797
  createdAt: string(),
19372
19798
  updatedAt: string()
19373
19799
  });
19374
- var AgentAddonConfigSchema = object({
19375
- enabled: boolean(),
19800
+ var DeviceStepConfigSchema = object({
19376
19801
  modelId: string().optional(),
19377
- settings: record(string(), unknown()).readonly()
19802
+ settings: record(string(), unknown()).optional()
19378
19803
  });
19379
19804
  var AgentPipelineSettingsSchema = object({
19380
- addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
19381
19805
  maxCameras: number().int().nonnegative().nullable().default(null),
19382
19806
  /** Per-node detection weight (relative share for the quota balancer). */
19383
19807
  detectWeight: number().positive().optional(),
@@ -19401,7 +19825,22 @@ var AgentPipelineSettingsSchema = object({
19401
19825
  * it already uses to reach the hub). Set this only when the auto-detected
19402
19826
  * address is wrong (multi-homed host, NAT, custom interface).
19403
19827
  */
19404
- reachableHost: string().optional()
19828
+ reachableHost: string().optional(),
19829
+ /**
19830
+ * Multi-device inference opt-in (Phase 4). Per-node map deviceKey → {enabled,
19831
+ * weight, steps}. Absent / all-disabled ⇒ the node's single default
19832
+ * accelerator (safe default); two+ enabled ⇒ the dispatcher balances
19833
+ * detection sessions across them so they run CONCURRENTLY. `steps` is the
19834
+ * per-(node,device) BASE provisioning (`stepId → {modelId?, settings?}`) —
19835
+ * the default model/settings for every camera landing on that accelerator;
19836
+ * a stepId absent ⇒ the step uses that device's format default.
19837
+ */
19838
+ inferenceDevices: record(string(), object({
19839
+ enabled: boolean(),
19840
+ weight: number().positive().optional(),
19841
+ maxSessions: number().int().positive().optional(),
19842
+ steps: record(string(), DeviceStepConfigSchema).optional()
19843
+ })).optional()
19405
19844
  });
19406
19845
  var CameraPipelineForAgentSchema = object({
19407
19846
  steps: array(PipelineStepInputSchema).readonly(),
@@ -19411,14 +19850,13 @@ var CameraPipelineForAgentSchema = object({
19411
19850
  }).nullable()
19412
19851
  });
19413
19852
  var CameraStepOverridePatchSchema = object({
19414
- enabled: boolean().optional(),
19415
19853
  modelId: string().optional(),
19416
19854
  settings: record(string(), unknown()).readonly().optional()
19417
19855
  });
19418
19856
  var CameraPipelineSettingsSchema = object({
19419
19857
  pinnedAgentNodeId: string().optional(),
19420
19858
  stepToggles: record(string(), boolean()).optional(),
19421
- stepOverridesByAgent: record(string(), record(string(), CameraStepOverridePatchSchema)).optional(),
19859
+ stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
19422
19860
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
19423
19861
  });
19424
19862
  /**
@@ -19632,6 +20070,44 @@ var CameraStatusSchema = object({
19632
20070
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19633
20071
  fetchedAt: number()
19634
20072
  });
20073
+ var NodeInferenceDeviceSchema = object({
20074
+ /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
20075
+ key: string(),
20076
+ backend: string(),
20077
+ device: string(),
20078
+ format: _enum(MODEL_FORMATS),
20079
+ /** Whether the node's live probe reports the device as usable right now. */
20080
+ available: boolean(),
20081
+ /**
20082
+ * Whether this device participates in dispatch. AUTO default (spec C2):
20083
+ * accelerators are opt-OUT (a discovered NPU/iGPU/Coral/ANE with no stored
20084
+ * entry is `true`); CPU is opt-IN (`false` by default — the fallback pool,
20085
+ * not a balanced target). An explicit stored value always wins; a stored-only
20086
+ * (unavailable) key keeps its stored value.
20087
+ */
20088
+ enabled: boolean(),
20089
+ /** Relative balancer weight for the enabled device (default 1). */
20090
+ weight: number(),
20091
+ /** Per-device concurrent-session cap; null = unlimited (multi-device C4). */
20092
+ maxSessions: number().nullable(),
20093
+ /** Object-detection model the executor defaults to for this deviceKey. */
20094
+ defaultModelId: string(),
20095
+ /**
20096
+ * Per-(node,device) BASE provisioning (C7.2/C7.4) — the RAW stored
20097
+ * `stepId → {modelId?, settings?}` map from `inferenceDevices[key].steps`.
20098
+ * Absent/empty ⇒ no base (every step uses its device format default). The
20099
+ * UI cross-references `pipelineExecutor.getSchema` for the models actually
20100
+ * available per format; this is the stored selection that becomes the
20101
+ * default for EVERY camera landing on this accelerator.
20102
+ */
20103
+ steps: record(string(), DeviceStepConfigSchema).optional()
20104
+ });
20105
+ var NodeInferenceDevicesSchema = object({
20106
+ nodeId: string(),
20107
+ /** False when the node's platform-probe was unreachable (no live device set). */
20108
+ reachable: boolean(),
20109
+ devices: array(NodeInferenceDeviceSchema).readonly()
20110
+ });
19635
20111
  method(object({
19636
20112
  deviceId: number(),
19637
20113
  agentNodeId: string()
@@ -19641,7 +20117,13 @@ method(object({
19641
20117
  }), method(object({ deviceId: number() }), object({ success: literal(true) }), {
19642
20118
  kind: "mutation",
19643
20119
  auth: "admin"
19644
- }), method(_void(), object({ migrated: number() }), {
20120
+ }), method(object({
20121
+ deviceId: number(),
20122
+ deviceKey: string()
20123
+ }), object({ success: literal(true) }), {
20124
+ kind: "mutation",
20125
+ auth: "admin"
20126
+ }), method(object({ deviceId: number() }), object({ deviceKey: string().nullable() })), method(_void(), object({ migrated: number() }), {
19645
20127
  kind: "mutation",
19646
20128
  auth: "admin"
19647
20129
  }), method(_void(), array(PipelineAssignmentSchema).readonly()), method(object({ deviceId: number() }), PipelineAssignmentSchema.nullable()), method(_void(), array(AgentLoadSummarySchema).readonly()), method(_void(), GlobalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(object({ nodeId: string() }), CapabilityBindingsSchema), method(object({
@@ -19675,13 +20157,7 @@ method(object({
19675
20157
  }))), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
19676
20158
  nodeId: string(),
19677
20159
  settings: AgentPipelineSettingsSchema
19678
- })).readonly()), method(object({
19679
- agentNodeId: string(),
19680
- defaults: record(string(), AgentAddonConfigSchema)
19681
- }), object({ success: literal(true) }), {
19682
- kind: "mutation",
19683
- auth: "admin"
19684
- }), method(object({ agentNodeId: string() }), object({
20160
+ })).readonly()), method(object({ agentNodeId: string() }), object({
19685
20161
  success: boolean(),
19686
20162
  removed: boolean()
19687
20163
  }), {
@@ -19713,7 +20189,18 @@ method(object({
19713
20189
  }), object({ success: literal(true) }), {
19714
20190
  kind: "mutation",
19715
20191
  auth: "admin"
19716
- }), method(object({ agentNodeId: string() }), object({
20192
+ }), method(object({
20193
+ agentNodeId: string(),
20194
+ inferenceDevices: record(string(), object({
20195
+ enabled: boolean(),
20196
+ weight: number().positive().optional(),
20197
+ maxSessions: number().int().positive().optional(),
20198
+ steps: record(string(), DeviceStepConfigSchema).optional()
20199
+ }))
20200
+ }), object({ success: literal(true) }), {
20201
+ kind: "mutation",
20202
+ auth: "admin"
20203
+ }), method(object({ nodeId: string() }), NodeInferenceDevicesSchema), method(object({ agentNodeId: string() }), object({
19717
20204
  success: literal(true),
19718
20205
  /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
19719
20206
  effectiveModelId: string().nullable(),
@@ -19729,9 +20216,10 @@ method(object({
19729
20216
  }), object({ success: literal(true) }), {
19730
20217
  kind: "mutation",
19731
20218
  auth: "admin"
19732
- }), method(object({ deviceId: number() }), record(string(), record(string(), CameraStepOverridePatchSchema)).nullable()), method(object({
20219
+ }), method(object({ deviceId: number() }), record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).nullable()), method(object({
19733
20220
  deviceId: number(),
19734
20221
  agentNodeId: string(),
20222
+ deviceKey: string(),
19735
20223
  addonId: string(),
19736
20224
  patch: CameraStepOverridePatchSchema.nullable()
19737
20225
  }), object({ success: literal(true) }), {
@@ -19768,14 +20256,13 @@ method(object({
19768
20256
  });
19769
20257
  /**
19770
20258
  * server-management — per-NODE singleton capability for a node's ROOT
19771
- * package lifecycle (runtime-updatable node packages, phase 2: hub + docker
19772
- * agents).
20259
+ * package lifecycle (runtime-updatable node packages).
19773
20260
  *
19774
- * Each node's root package (`@camstack/server` on the hub, `@camstack/agent`
19775
- * on agents) carries the whole software stack in its npm dep tree, so ONE
19776
- * version describes the node. Updates install into
19777
- * `<dataDir>/server-root/versions/<v>/` and apply on restart via the baked
19778
- * starter (probation boot + auto-rollback to N-1).
20261
+ * Every node role runs the SAME root package (`@camstack/server`), which
20262
+ * carries the whole software stack in its npm dep tree, so ONE version
20263
+ * describes the node. Updates stage into `<dataDir>/server-root/` and apply
20264
+ * on restart via the baked starter (single-copy in-place swap — no probation,
20265
+ * no auto-rollback).
19779
20266
  *
19780
20267
  * Providers:
19781
20268
  * - HUB: `ServerUpdateService` behind the `server-provided` mount
@@ -19883,7 +20370,8 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
19883
20370
  /** Explicit target version; omitted = latest from the registry. */
19884
20371
  version: string().optional() }), ServerUpdateActionResultSchema, {
19885
20372
  kind: "mutation",
19886
- auth: "admin"
20373
+ auth: "admin",
20374
+ timeoutMs: 16 * 6e4
19887
20375
  }), method(_void(), ServerUpdateActionResultSchema, {
19888
20376
  kind: "mutation",
19889
20377
  auth: "admin"
@@ -20978,22 +21466,6 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20978
21466
  var RestartAddonResultSchema = unknown();
20979
21467
  var InstallPackageResultSchema = unknown();
20980
21468
  var ReloadPackagesResultSchema = unknown();
20981
- /**
20982
- * Result of `updateFrameworkPackage`. The cap method returns BEFORE the
20983
- * server restarts so the admin UI can react to the `restartingAt`
20984
- * timestamp (shows reconnect overlay). The transition from
20985
- * `fromVersion` to `toVersion` will be confirmed by a subsequent
20986
- * `system.restart-completed` event after the new process boots.
20987
- *
20988
- * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
20989
- */
20990
- var UpdateFrameworkPackageResultSchema = object({
20991
- packageName: string(),
20992
- fromVersion: string(),
20993
- toVersion: string(),
20994
- /** Ms-epoch the server scheduled its self-restart. */
20995
- restartingAt: number()
20996
- });
20997
21469
  var BulkUpdateItemStatusSchema = _enum([
20998
21470
  "queued",
20999
21471
  "updating",
@@ -21121,13 +21593,6 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21121
21593
  }), object({ success: literal(true) }), {
21122
21594
  kind: "mutation",
21123
21595
  auth: "admin"
21124
- }), method(object({
21125
- packageName: string().min(1),
21126
- version: string().optional(),
21127
- deferRestart: boolean().optional()
21128
- }), UpdateFrameworkPackageResultSchema, {
21129
- kind: "mutation",
21130
- auth: "admin"
21131
21596
  }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
21132
21597
  kind: "mutation",
21133
21598
  auth: "admin"
@@ -22044,10 +22509,10 @@ var TopologyCategorySchema = object({
22044
22509
  addons: array(TopologyCategoryAddonSchema).readonly()
22045
22510
  });
22046
22511
  /**
22047
- * The node's runtime-updatable ROOT package (`@camstack/server` on the hub,
22048
- * `@camstack/agent` on agents) as reported by its `registerNode` manifest —
22049
- * version visibility for the Server management surface. Nullable: offline
22050
- * rows and pre-phase-2 nodes report none.
22512
+ * The node's runtime-updatable ROOT package (`@camstack/server` the single
22513
+ * root package for every node role) as reported by its `registerNode`
22514
+ * manifest — version visibility for the Server management surface. Nullable:
22515
+ * offline rows and nodes that never reported one.
22051
22516
  */
22052
22517
  var TopologyRootPackageSchema = object({
22053
22518
  name: string(),
@@ -22435,17 +22900,28 @@ var PlatformScoreSchema = object({
22435
22900
  format: _enum([
22436
22901
  "onnx",
22437
22902
  "coreml",
22438
- "openvino"
22903
+ "openvino",
22904
+ "tflite"
22439
22905
  ]),
22440
22906
  score: number(),
22441
22907
  reason: string(),
22442
22908
  available: boolean()
22443
22909
  });
22910
+ var InferenceDeviceDescriptorSchema = object({
22911
+ key: string(),
22912
+ backend: string(),
22913
+ device: string(),
22914
+ format: ModelFormatSchema,
22915
+ runtime: literal("python"),
22916
+ score: number(),
22917
+ available: boolean()
22918
+ });
22444
22919
  var PlatformCapabilitiesSchema = object({
22445
22920
  hardware: HardwareInfoSchema,
22446
22921
  scores: array(PlatformScoreSchema).readonly(),
22447
22922
  bestScore: PlatformScoreSchema,
22448
- pythonPath: string().nullable()
22923
+ pythonPath: string().nullable(),
22924
+ devices: array(InferenceDeviceDescriptorSchema).readonly()
22449
22925
  });
22450
22926
  var ModelRequirementSchema = object({
22451
22927
  modelId: string(),
@@ -23337,12 +23813,6 @@ Object.freeze({
23337
23813
  addonId: null,
23338
23814
  access: "delete"
23339
23815
  },
23340
- "addons.updateFrameworkPackage": {
23341
- capName: "addons",
23342
- capScope: "system",
23343
- addonId: null,
23344
- access: "create"
23345
- },
23346
23816
  "addons.updatePackage": {
23347
23817
  capName: "addons",
23348
23818
  capScope: "system",
@@ -26115,12 +26585,6 @@ Object.freeze({
26115
26585
  addonId: null,
26116
26586
  access: "view"
26117
26587
  },
26118
- "pipelineExecutor.reprobeEngine": {
26119
- capName: "pipeline-executor",
26120
- capScope: "system",
26121
- addonId: null,
26122
- access: "create"
26123
- },
26124
26588
  "pipelineExecutor.runAudioTest": {
26125
26589
  capName: "pipeline-executor",
26126
26590
  capScope: "system",
@@ -26271,6 +26735,12 @@ Object.freeze({
26271
26735
  addonId: null,
26272
26736
  access: "view"
26273
26737
  },
26738
+ "pipelineOrchestrator.getNodeInferenceDevices": {
26739
+ capName: "pipeline-orchestrator",
26740
+ capScope: "system",
26741
+ addonId: null,
26742
+ access: "view"
26743
+ },
26274
26744
  "pipelineOrchestrator.getPipelineAssignment": {
26275
26745
  capName: "pipeline-orchestrator",
26276
26746
  capScope: "system",
@@ -26283,6 +26753,12 @@ Object.freeze({
26283
26753
  addonId: null,
26284
26754
  access: "view"
26285
26755
  },
26756
+ "pipelineOrchestrator.getPipelineDevicePin": {
26757
+ capName: "pipeline-orchestrator",
26758
+ capScope: "system",
26759
+ addonId: null,
26760
+ access: "view"
26761
+ },
26286
26762
  "pipelineOrchestrator.listAgentSettings": {
26287
26763
  capName: "pipeline-orchestrator",
26288
26764
  capScope: "system",
@@ -26325,19 +26801,19 @@ Object.freeze({
26325
26801
  addonId: null,
26326
26802
  access: "create"
26327
26803
  },
26328
- "pipelineOrchestrator.setAgentAddonDefaults": {
26804
+ "pipelineOrchestrator.setAgentCapabilities": {
26329
26805
  capName: "pipeline-orchestrator",
26330
26806
  capScope: "system",
26331
26807
  addonId: null,
26332
26808
  access: "create"
26333
26809
  },
26334
- "pipelineOrchestrator.setAgentCapabilities": {
26810
+ "pipelineOrchestrator.setAgentDetectWeight": {
26335
26811
  capName: "pipeline-orchestrator",
26336
26812
  capScope: "system",
26337
26813
  addonId: null,
26338
26814
  access: "create"
26339
26815
  },
26340
- "pipelineOrchestrator.setAgentDetectWeight": {
26816
+ "pipelineOrchestrator.setAgentInferenceDevices": {
26341
26817
  capName: "pipeline-orchestrator",
26342
26818
  capScope: "system",
26343
26819
  addonId: null,
@@ -26379,6 +26855,12 @@ Object.freeze({
26379
26855
  addonId: null,
26380
26856
  access: "create"
26381
26857
  },
26858
+ "pipelineOrchestrator.setPipelineDevicePin": {
26859
+ capName: "pipeline-orchestrator",
26860
+ capScope: "system",
26861
+ addonId: null,
26862
+ access: "create"
26863
+ },
26382
26864
  "pipelineOrchestrator.unassignAudio": {
26383
26865
  capName: "pipeline-orchestrator",
26384
26866
  capScope: "system",
@@ -27931,32 +28413,6 @@ Object.freeze({
27931
28413
  "network-access": "ingress",
27932
28414
  "smtp-provider": "email"
27933
28415
  });
27934
- var frameworkSwapPackageSchema = object({
27935
- name: string(),
27936
- stagedPath: string(),
27937
- backupPath: string(),
27938
- toVersion: string(),
27939
- fromVersion: string().nullable()
27940
- });
27941
- object({
27942
- jobId: string(),
27943
- taskId: string(),
27944
- packages: array(frameworkSwapPackageSchema),
27945
- requestedAtMs: number(),
27946
- schemaVersion: literal(1)
27947
- });
27948
- object({
27949
- jobId: string(),
27950
- taskId: string(),
27951
- backups: array(object({
27952
- name: string(),
27953
- backupPath: string(),
27954
- livePath: string()
27955
- })),
27956
- appliedAtMs: number(),
27957
- bootAttempts: number(),
27958
- schemaVersion: literal(1)
27959
- });
27960
28416
  //#endregion
27961
28417
  //#region ../../node_modules/@apocaliss92/wyze-bridge-js/dist/index.js
27962
28418
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {