@camstack/addon-tailscale 1.1.27 → 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.
@@ -7067,6 +7067,17 @@ var ModelCatalogEntrySchema = object({
7067
7067
  "imagenet",
7068
7068
  "none"
7069
7069
  ]).optional(),
7070
+ /**
7071
+ * The model already applies softmax IN-GRAPH — its raw output is a
7072
+ * probability distribution, not logits. When set, the `softmax`
7073
+ * postprocessor must NOT re-apply softmax: re-softmaxing an already-normalised
7074
+ * probability vector collapses it toward uniform (top-1 score craters far
7075
+ * below its true value, making every confidence gate meaningless). Absent ⇒
7076
+ * the output is raw logits and the postprocessor applies softmax (the normal
7077
+ * case). Set on the Google AIY Birds `bird-classifier` (softmax baked into the
7078
+ * TF graph). Threaded to the Python pool via `PoolModelConfig.outputProbabilities`.
7079
+ */
7080
+ outputProbabilities: boolean().optional(),
7070
7081
  preprocessMode: _enum(["letterbox", "resize"]).optional(),
7071
7082
  /**
7072
7083
  * Per-MODEL postprocessor override. Absent ⇒ the step's own
@@ -7626,6 +7637,160 @@ var EncodeProfileSchema = object({
7626
7637
  */
7627
7638
  outputArgs: array(string()).optional()
7628
7639
  });
7640
+ var COCO_TO_MACRO = {
7641
+ mapping: {
7642
+ person: "person",
7643
+ bicycle: "vehicle",
7644
+ car: "vehicle",
7645
+ motorcycle: "vehicle",
7646
+ airplane: "vehicle",
7647
+ bus: "vehicle",
7648
+ train: "vehicle",
7649
+ truck: "vehicle",
7650
+ boat: "vehicle",
7651
+ bird: "animal",
7652
+ cat: "animal",
7653
+ dog: "animal",
7654
+ horse: "animal",
7655
+ sheep: "animal",
7656
+ cow: "animal",
7657
+ elephant: "animal",
7658
+ bear: "animal",
7659
+ zebra: "animal",
7660
+ giraffe: "animal",
7661
+ suitcase: "package",
7662
+ backpack: "package",
7663
+ handbag: "package"
7664
+ },
7665
+ preserveOriginal: false
7666
+ };
7667
+ var AUDIO_MACRO_LABELS = [
7668
+ {
7669
+ id: "speech",
7670
+ name: "Speech",
7671
+ icon: "🗣️"
7672
+ },
7673
+ {
7674
+ id: "scream",
7675
+ name: "Scream / Shout",
7676
+ icon: "😱"
7677
+ },
7678
+ {
7679
+ id: "crying",
7680
+ name: "Crying / Baby",
7681
+ icon: "😢"
7682
+ },
7683
+ {
7684
+ id: "laughter",
7685
+ name: "Laughter",
7686
+ icon: "😂"
7687
+ },
7688
+ {
7689
+ id: "music",
7690
+ name: "Music",
7691
+ icon: "🎵"
7692
+ },
7693
+ {
7694
+ id: "dog",
7695
+ name: "Dog",
7696
+ icon: "🐕"
7697
+ },
7698
+ {
7699
+ id: "cat",
7700
+ name: "Cat",
7701
+ icon: "🐈"
7702
+ },
7703
+ {
7704
+ id: "bird",
7705
+ name: "Bird",
7706
+ icon: "🐦"
7707
+ },
7708
+ {
7709
+ id: "animal",
7710
+ name: "Animal (other)",
7711
+ icon: "🐾"
7712
+ },
7713
+ {
7714
+ id: "alarm",
7715
+ name: "Alarm / Siren",
7716
+ icon: "🚨"
7717
+ },
7718
+ {
7719
+ id: "doorbell",
7720
+ name: "Doorbell / Knock",
7721
+ icon: "🔔"
7722
+ },
7723
+ {
7724
+ id: "glass_breaking",
7725
+ name: "Glass Breaking",
7726
+ icon: "💥"
7727
+ },
7728
+ {
7729
+ id: "gunshot",
7730
+ name: "Gunshot / Explosion",
7731
+ icon: "💣"
7732
+ },
7733
+ {
7734
+ id: "vehicle",
7735
+ name: "Vehicle",
7736
+ icon: "🚗"
7737
+ },
7738
+ {
7739
+ id: "siren",
7740
+ name: "Emergency Siren",
7741
+ icon: "🚑"
7742
+ },
7743
+ {
7744
+ id: "fire",
7745
+ name: "Fire / Smoke",
7746
+ icon: "🔥"
7747
+ },
7748
+ {
7749
+ id: "water",
7750
+ name: "Water",
7751
+ icon: "💧"
7752
+ },
7753
+ {
7754
+ id: "wind",
7755
+ name: "Wind / Weather",
7756
+ icon: "🌬️"
7757
+ },
7758
+ {
7759
+ id: "door",
7760
+ name: "Door",
7761
+ icon: "🚪"
7762
+ },
7763
+ {
7764
+ id: "footsteps",
7765
+ name: "Footsteps",
7766
+ icon: "👣"
7767
+ },
7768
+ {
7769
+ id: "crowd",
7770
+ name: "Crowd / Chatter",
7771
+ icon: "👥"
7772
+ },
7773
+ {
7774
+ id: "telephone",
7775
+ name: "Telephone",
7776
+ icon: "📞"
7777
+ },
7778
+ {
7779
+ id: "engine",
7780
+ name: "Engine / Motor",
7781
+ icon: "⚙️"
7782
+ },
7783
+ {
7784
+ id: "tools",
7785
+ name: "Tools / Construction",
7786
+ icon: "🔨"
7787
+ },
7788
+ {
7789
+ id: "silence",
7790
+ name: "Silence",
7791
+ icon: "🤫"
7792
+ }
7793
+ ];
7629
7794
  var YAMNET_TO_MACRO = {
7630
7795
  mapping: {
7631
7796
  Speech: "speech",
@@ -7892,6 +8057,125 @@ var _macroLookup = /* @__PURE__ */ new Map();
7892
8057
  for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7893
8058
  for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7894
8059
  /**
8060
+ * Unified event-kind taxonomy — THE single source of truth for
8061
+ * `kind → { parentKind, category, level, color, iconId, labelKey, label,
8062
+ * icon }`.
8063
+ *
8064
+ * This dictionary folds together what used to be scattered across four
8065
+ * copies:
8066
+ * - `capabilities/sensor-event-kinds.ts` (sensor cap colors)
8067
+ * - `addon-post-analysis/.../services/event-kinds.ts`
8068
+ * (MOTION/PERSON/VEHICLE… _COLOR constants)
8069
+ * - `ui-library/composites/detection-colors.ts` (CLASS_COLORS)
8070
+ * - `addon-post-analysis/shared/frame/box-drawer.ts` (DEFAULT_COLOR)
8071
+ * - the COCO / audio class maps (macro ↔ sub relationships)
8072
+ *
8073
+ * The DATA (serializable — color/iconId/labelKey/parentKind) lives here in
8074
+ * `@camstack/types`. The UI-side mapping `iconId → lucide component` and
8075
+ * `labelKey → t()` lives in `@camstack/ui-library`. UIs never hardcode a
8076
+ * color or an icon: they read this dictionary (server descriptors carry the
8077
+ * fields inline; the client resolves color/icon/label from `iconId`/`kind`).
8078
+ *
8079
+ * Two levels only (v1 YAGNI): macro → sub. `person` is a leaf macro.
8080
+ */
8081
+ var TAXONOMY_COLORS = {
8082
+ motion: "#f59e0b",
8083
+ audio: "#06b6d4",
8084
+ person: "#22c55e",
8085
+ vehicle: "#3b82f6",
8086
+ animal: "#f97316",
8087
+ package: "#a855f7",
8088
+ sensor: "#8b5cf6",
8089
+ control: "#10b981",
8090
+ genericDetection: "#64748b"
8091
+ };
8092
+ var DETECTION_SUB_COLORS = {
8093
+ car: "#f59e0b",
8094
+ truck: "#d97706",
8095
+ bus: "#b45309",
8096
+ motorcycle: "#eab308",
8097
+ bicycle: "#ca8a04",
8098
+ airplane: "#60a5fa",
8099
+ boat: "#2563eb",
8100
+ train: "#1d4ed8",
8101
+ bird: "#14b8a6",
8102
+ dog: "#84cc16",
8103
+ cat: "#f97316",
8104
+ horse: "#a16207",
8105
+ sheep: "#a3a3a3",
8106
+ cow: "#78716c",
8107
+ elephant: "#6b7280",
8108
+ bear: "#7c2d12",
8109
+ zebra: "#404040",
8110
+ giraffe: "#d4a373"
8111
+ };
8112
+ function titleCase(id) {
8113
+ return id.split(/[-_ ]/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
8114
+ }
8115
+ var entries = /* @__PURE__ */ new Map();
8116
+ function macro(kind, category, color, iconId, label) {
8117
+ entries.set(kind, {
8118
+ kind,
8119
+ parentKind: null,
8120
+ level: "macro",
8121
+ category,
8122
+ color,
8123
+ iconId,
8124
+ labelKey: `eventKind.${kind}`,
8125
+ label
8126
+ });
8127
+ }
8128
+ function sub(kind, parentKind, category, color, iconId, label) {
8129
+ entries.set(kind, {
8130
+ kind,
8131
+ parentKind,
8132
+ level: "sub",
8133
+ category,
8134
+ color,
8135
+ iconId,
8136
+ labelKey: `eventKind.${kind}`,
8137
+ label
8138
+ });
8139
+ }
8140
+ macro("motion", "motion", TAXONOMY_COLORS.motion, "motion", "Motion");
8141
+ macro("audio", "audio", TAXONOMY_COLORS.audio, "audio", "Audio");
8142
+ macro("person", "detection", TAXONOMY_COLORS.person, "person", "Person");
8143
+ macro("vehicle", "detection", TAXONOMY_COLORS.vehicle, "vehicle", "Vehicle");
8144
+ macro("animal", "detection", TAXONOMY_COLORS.animal, "animal", "Animal");
8145
+ macro("package", "package", TAXONOMY_COLORS.package, "package", "Package");
8146
+ macro("sensor", "sensor", TAXONOMY_COLORS.sensor, "sensor", "Sensor");
8147
+ macro("control", "control", TAXONOMY_COLORS.control, "control", "Control");
8148
+ for (const [cocoClass, macroClass] of Object.entries(COCO_TO_MACRO.mapping)) {
8149
+ if (macroClass !== "vehicle" && macroClass !== "animal") continue;
8150
+ if (entries.has(cocoClass)) continue;
8151
+ sub(cocoClass, macroClass, "detection", DETECTION_SUB_COLORS[cocoClass] ?? TAXONOMY_COLORS.genericDetection, cocoClass, titleCase(cocoClass));
8152
+ }
8153
+ sub("package-delivered", "package", "package", TAXONOMY_COLORS.package, "package", "Package delivered");
8154
+ sub("package-picked-up", "package", "package", TAXONOMY_COLORS.package, "package", "Package picked up");
8155
+ sub("contact", "sensor", "sensor", "#f59e0b", "door", "Contact");
8156
+ sub("motion-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "pir", "Motion sensor");
8157
+ sub("smoke", "sensor", "sensor", "#ef4444", "smoke", "Smoke");
8158
+ sub("flood", "sensor", "sensor", "#3b82f6", "water", "Water leak");
8159
+ sub("gas", "sensor", "sensor", "#ef4444", "gas", "Gas");
8160
+ sub("carbon-monoxide", "sensor", "sensor", "#dc2626", "smoke", "Carbon monoxide");
8161
+ sub("vibration", "sensor", "sensor", "#eab308", "vibration", "Vibration");
8162
+ sub("tamper", "sensor", "sensor", "#f97316", "tamper", "Tamper");
8163
+ sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
8164
+ sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
8165
+ sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
8166
+ sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
8167
+ sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
8168
+ sub("siren", "control", "control", "#dc2626", "siren", "Siren");
8169
+ sub("button", "control", "control", "#10b981", "button", "Button");
8170
+ sub("doorbell", "control", "control", "#a855f7", "doorbell", "Doorbell");
8171
+ for (const l of AUDIO_MACRO_LABELS) {
8172
+ const kind = `audio-${l.id}`;
8173
+ if (entries.has(kind)) continue;
8174
+ sub(kind, "audio", "audio", TAXONOMY_COLORS.audio, kind, l.name);
8175
+ }
8176
+ /** The complete taxonomy dictionary, keyed by kind. */
8177
+ var EVENT_TAXONOMY = Object.freeze(Object.fromEntries(entries));
8178
+ /**
7895
8179
  * Error types for the safe expression engine. Two distinct classes so callers
7896
8180
  * can tell a compile-time (grammar) failure from a runtime (evaluation)
7897
8181
  * failure — both are non-fatal to the host: read paths degrade to "skip link".
@@ -10807,10 +11091,7 @@ var ConfigUISchemaNullableBridge = custom();
10807
11091
  var InferenceCapabilitiesBridge = custom();
10808
11092
  var ModelAvailabilityListBridge = custom();
10809
11093
  var PipelineRunResultBridge = custom();
10810
- method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
10811
- kind: "mutation",
10812
- auth: "admin"
10813
- }), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
11094
+ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
10814
11095
  modelId: string(),
10815
11096
  settings: record(string(), unknown()).readonly()
10816
11097
  }))), method(object({ steps: record(string(), object({
@@ -10870,13 +11151,33 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
10870
11151
  * (inputClasses ≠ null) are skipped and served per-track via
10871
11152
  * pipelineRunner.runDetailSubtree (two-plane design).
10872
11153
  */
10873
- plane: _enum(["full", "frame"]).optional()
11154
+ plane: _enum(["full", "frame"]).optional(),
11155
+ /**
11156
+ * Inference-device selector (Phase 2 multi-device). Format
11157
+ * `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`).
11158
+ * Omitted ⇒ the runner's default device (current single-engine
11159
+ * behaviour). Selects WHICH device pool of the node runs the call.
11160
+ */
11161
+ deviceKey: string().optional()
10874
11162
  }), PipelineRunResultBridge, { kind: "mutation" }), method(object({
10875
11163
  engine: PipelineEngineChoiceSchema.optional(),
10876
11164
  steps: array(PipelineStepInputSchema).min(1),
10877
11165
  frames: array(FrameInputSchema).min(1).max(255),
10878
11166
  deviceId: number().optional(),
10879
- sessionId: string().optional()
11167
+ sessionId: string().optional(),
11168
+ /**
11169
+ * Pure-inference benchmark hint. A NONZERO uint32 pins every frame in
11170
+ * the batch to the Python pool's bench preprocess cache
11171
+ * (`_bench_frame_id`) so a REPEATED benchmark frame is decoded +
11172
+ * preprocessed ONCE and every later inference is a pure-inference cache
11173
+ * hit — the sustained-throughput run measures inference, not
11174
+ * decode+preprocess+infer. Omitted/0 for live frames (all different →
11175
+ * full preprocess every call, correct). Fresh per sustained run;
11176
+ * released via `uncacheFrame`.
11177
+ */
11178
+ frameId: number().int().nonnegative().optional(),
11179
+ /** Inference-device selector (Phase 2 multi-device); see runPipeline. */
11180
+ deviceKey: string().optional()
10880
11181
  }), object({ results: array(PipelineRunResultBridge).readonly() }), { kind: "mutation" }), method(object({
10881
11182
  data: _instanceof(Uint8Array),
10882
11183
  width: number().int().positive(),
@@ -10908,8 +11209,18 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
10908
11209
  * - `runtime` — main camera-serving engine (no idle TTL).
10909
11210
  * - `warm-override` — benchmark/test override held in the warm
10910
11211
  * cache; auto-disposed after the idle TTL.
11212
+ * - `device-pool` — a concurrent per-device pool (Phase 2
11213
+ * multi-device, keyed by `deviceKey`) resolved
11214
+ * via `resolveDeviceFactory`. Runs alongside the
11215
+ * `runtime` engine on a DIFFERENT accelerator
11216
+ * (NPU / iGPU / Coral) — this is how the
11217
+ * Engines tab shows all pools running at once.
10911
11218
  */
10912
- kind: _enum(["runtime", "warm-override"]),
11219
+ kind: _enum([
11220
+ "runtime",
11221
+ "warm-override",
11222
+ "device-pool"
11223
+ ]),
10913
11224
  /** Native pid of the underlying Python pool (null when no pool). */
10914
11225
  poolPid: number().nullable(),
10915
11226
  /** ms since this factory was last used (null when not warm-tracked). */
@@ -11251,7 +11562,14 @@ var RunnerCameraConfigSchema = object({
11251
11562
  * camera's detect node differs from its source-owner (P2d, gated by the
11252
11563
  * `remoteSourcingNodes` rollout setting).
11253
11564
  */
11254
- frameSource: RunnerFrameSourceSchema.default({ kind: "local-broker" })
11565
+ frameSource: RunnerFrameSourceSchema.default({ kind: "local-broker" }),
11566
+ /**
11567
+ * Inference-device selector for this camera's sessions (Phase 2 multi-device).
11568
+ * Format `<backend>:<device>` (e.g. `openvino:gpu`, `edgetpu:usb`, `cpu`);
11569
+ * omitted ⇒ the runner's default device. The engine itself stays node-local —
11570
+ * this only selects WHICH device pool of that node runs the session.
11571
+ */
11572
+ deviceKey: string().optional()
11255
11573
  });
11256
11574
  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;
11257
11575
  /**
@@ -11272,6 +11590,19 @@ var RunnerLocalLoadSchema = object({
11272
11590
  avgInferenceTimeMs: number(),
11273
11591
  /** Total queue depth across motion + detection queues. */
11274
11592
  queueDepthTotal: number(),
11593
+ /**
11594
+ * Per-inference-device live load (multi-device C4). One entry per deviceKey
11595
+ * this runner currently has attached cameras on, so the orchestrator's second
11596
+ * `balance()` pass (over a node's devices) weights on real per-pool session
11597
+ * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
11598
+ * per device is 0 until the pool backlog gets a public accessor (follow-up).
11599
+ */
11600
+ devices: array(object({
11601
+ deviceKey: string(),
11602
+ backend: string(),
11603
+ attachedCameras: number(),
11604
+ queueDepthTotal: number()
11605
+ })).default([]),
11275
11606
  /** Hardware capability flags reported by this node. */
11276
11607
  hardware: object({
11277
11608
  hasGpu: boolean(),
@@ -12747,6 +13078,8 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
12747
13078
  kind: "mutation",
12748
13079
  auth: "admin"
12749
13080
  });
13081
+ 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;
13082
+ new Set(Object.values(DeviceType));
12750
13083
  /**
12751
13084
  * `addon-pages` — system-scoped singleton aggregator cap. Public-facing
12752
13085
  * surface that admin-ui consumes through `useAddonPagesListPages()`.
@@ -15858,17 +16191,30 @@ var EventKindCategorySchema = _enum([
15858
16191
  "audio",
15859
16192
  "detection",
15860
16193
  "sensor",
16194
+ "control",
15861
16195
  "custom",
15862
16196
  "package"
15863
16197
  ]);
16198
+ /** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
16199
+ var EventKindLevelSchema = _enum(["macro", "sub"]);
15864
16200
  var EventKindDescriptorSchema = object({
15865
- /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
16201
+ /** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
15866
16202
  kind: string(),
16203
+ /** i18n key resolved on the UI side; `label` is the English fallback. */
16204
+ labelKey: string(),
16205
+ /** English fallback label (kept for clients that don't translate). */
15867
16206
  label: string(),
15868
16207
  /** Hex color for timeline/legend rendering. */
15869
16208
  color: string(),
16209
+ /** Dictionary id → lucide component on the UI side. */
16210
+ iconId: string(),
16211
+ /** Legacy closed-vocab glyph — fallback for `iconId`. */
15870
16212
  icon: EventKindIconSchema,
15871
16213
  category: EventKindCategorySchema,
16214
+ /** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
16215
+ parentKind: string().nullable(),
16216
+ /** Derived from `parentKind`, explicit for the client tree. */
16217
+ level: EventKindLevelSchema,
15872
16218
  /** Which cap + device contributes this kind. For built-ins the camera
15873
16219
  * itself; for sensor kinds the LINKED source device. */
15874
16220
  source: object({
@@ -15941,11 +16287,21 @@ var TrackAudioLabelSchema = object({
15941
16287
  firstAt: number(),
15942
16288
  lastAt: number()
15943
16289
  });
16290
+ /**
16291
+ * How a track was produced. `pipeline` (default / absent) = the spatial
16292
+ * detection+tracking pipeline. `sensor` = a SYNTHETIC track projected from a
16293
+ * linked sensor/control state change (no positions; carries a snapshot). The
16294
+ * spatial subsystems (tracker association, occupancy count, re-id/embedding,
16295
+ * resurrection) MUST skip `sensor` tracks — they have no bbox trajectory.
16296
+ */
16297
+ var TrackSourceSchema = _enum(["pipeline", "sensor"]);
15944
16298
  var TrackSchema = object({
15945
16299
  trackId: string(),
15946
16300
  deviceId: number(),
15947
16301
  className: string(),
15948
16302
  label: string().optional(),
16303
+ /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16304
+ source: TrackSourceSchema.optional(),
15949
16305
  firstSeen: number(),
15950
16306
  lastSeen: number(),
15951
16307
  /** Frame-rate position history (subject to maxPositionHistory cap). */
@@ -16322,6 +16678,76 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16322
16678
  eventId: string(),
16323
16679
  timestamp: number()
16324
16680
  });
16681
+ /**
16682
+ * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
16683
+ * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
16684
+ * caps into per-camera event-kind descriptors.
16685
+ *
16686
+ * The descriptor DATA (color / iconId / labelKey / parentKind / category)
16687
+ * is NOT duplicated here — every entry is derived from the single
16688
+ * `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
16689
+ * ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
16690
+ * control cap means adding one line here (and a taxonomy entry); the anti-
16691
+ * drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
16692
+ * eventful cap is missing.
16693
+ */
16694
+ /** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
16695
+ var LEGACY_ICON = {
16696
+ motion: "motion",
16697
+ audio: "audio",
16698
+ person: "person",
16699
+ vehicle: "vehicle",
16700
+ animal: "animal",
16701
+ package: "package",
16702
+ door: "door",
16703
+ pir: "pir",
16704
+ smoke: "smoke",
16705
+ water: "water",
16706
+ button: "button",
16707
+ generic: "generic",
16708
+ gas: "smoke",
16709
+ vibration: "generic",
16710
+ tamper: "generic",
16711
+ presence: "person",
16712
+ lock: "generic",
16713
+ siren: "generic",
16714
+ switch: "generic",
16715
+ doorbell: "button"
16716
+ };
16717
+ function legacyIcon(iconId) {
16718
+ return LEGACY_ICON[iconId] ?? "generic";
16719
+ }
16720
+ /**
16721
+ * Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
16722
+ * The anti-drift guard cross-checks this against the eventful caps declared
16723
+ * in `packages/types/src/capabilities/*.cap.ts`.
16724
+ */
16725
+ var CAP_TO_KIND = {
16726
+ contact: "contact",
16727
+ motion: "motion-sensor",
16728
+ smoke: "smoke",
16729
+ flood: "flood",
16730
+ gas: "gas",
16731
+ "carbon-monoxide": "carbon-monoxide",
16732
+ vibration: "vibration",
16733
+ tamper: "tamper",
16734
+ presence: "presence",
16735
+ "enum-sensor": "enum-sensor",
16736
+ "event-emitter": "device-event",
16737
+ "lock-control": "lock",
16738
+ switch: "switch",
16739
+ button: "button",
16740
+ doorbell: "doorbell"
16741
+ };
16742
+ function buildDescriptor(capName, kind) {
16743
+ const t = EVENT_TAXONOMY[kind];
16744
+ if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
16745
+ return {
16746
+ ...t,
16747
+ icon: legacyIcon(t.iconId)
16748
+ };
16749
+ }
16750
+ Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
16325
16751
  var CameraPipelineConfigSchema = object({
16326
16752
  engine: PipelineEngineChoiceSchema.optional(),
16327
16753
  steps: array(PipelineStepInputSchema).readonly(),
@@ -16340,13 +16766,11 @@ var PipelineTemplateSchema = object({
16340
16766
  createdAt: string(),
16341
16767
  updatedAt: string()
16342
16768
  });
16343
- var AgentAddonConfigSchema = object({
16344
- enabled: boolean(),
16769
+ var DeviceStepConfigSchema = object({
16345
16770
  modelId: string().optional(),
16346
- settings: record(string(), unknown()).readonly()
16771
+ settings: record(string(), unknown()).optional()
16347
16772
  });
16348
16773
  var AgentPipelineSettingsSchema = object({
16349
- addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
16350
16774
  maxCameras: number().int().nonnegative().nullable().default(null),
16351
16775
  /** Per-node detection weight (relative share for the quota balancer). */
16352
16776
  detectWeight: number().positive().optional(),
@@ -16370,7 +16794,22 @@ var AgentPipelineSettingsSchema = object({
16370
16794
  * it already uses to reach the hub). Set this only when the auto-detected
16371
16795
  * address is wrong (multi-homed host, NAT, custom interface).
16372
16796
  */
16373
- reachableHost: string().optional()
16797
+ reachableHost: string().optional(),
16798
+ /**
16799
+ * Multi-device inference opt-in (Phase 4). Per-node map deviceKey → {enabled,
16800
+ * weight, steps}. Absent / all-disabled ⇒ the node's single default
16801
+ * accelerator (safe default); two+ enabled ⇒ the dispatcher balances
16802
+ * detection sessions across them so they run CONCURRENTLY. `steps` is the
16803
+ * per-(node,device) BASE provisioning (`stepId → {modelId?, settings?}`) —
16804
+ * the default model/settings for every camera landing on that accelerator;
16805
+ * a stepId absent ⇒ the step uses that device's format default.
16806
+ */
16807
+ inferenceDevices: record(string(), object({
16808
+ enabled: boolean(),
16809
+ weight: number().positive().optional(),
16810
+ maxSessions: number().int().positive().optional(),
16811
+ steps: record(string(), DeviceStepConfigSchema).optional()
16812
+ })).optional()
16374
16813
  });
16375
16814
  var CameraPipelineForAgentSchema = object({
16376
16815
  steps: array(PipelineStepInputSchema).readonly(),
@@ -16380,14 +16819,13 @@ var CameraPipelineForAgentSchema = object({
16380
16819
  }).nullable()
16381
16820
  });
16382
16821
  var CameraStepOverridePatchSchema = object({
16383
- enabled: boolean().optional(),
16384
16822
  modelId: string().optional(),
16385
16823
  settings: record(string(), unknown()).readonly().optional()
16386
16824
  });
16387
16825
  var CameraPipelineSettingsSchema = object({
16388
16826
  pinnedAgentNodeId: string().optional(),
16389
16827
  stepToggles: record(string(), boolean()).optional(),
16390
- stepOverridesByAgent: record(string(), record(string(), CameraStepOverridePatchSchema)).optional(),
16828
+ stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
16391
16829
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
16392
16830
  });
16393
16831
  /**
@@ -16601,6 +17039,44 @@ var CameraStatusSchema = object({
16601
17039
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
16602
17040
  fetchedAt: number()
16603
17041
  });
17042
+ var NodeInferenceDeviceSchema = object({
17043
+ /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
17044
+ key: string(),
17045
+ backend: string(),
17046
+ device: string(),
17047
+ format: _enum(MODEL_FORMATS),
17048
+ /** Whether the node's live probe reports the device as usable right now. */
17049
+ available: boolean(),
17050
+ /**
17051
+ * Whether this device participates in dispatch. AUTO default (spec C2):
17052
+ * accelerators are opt-OUT (a discovered NPU/iGPU/Coral/ANE with no stored
17053
+ * entry is `true`); CPU is opt-IN (`false` by default — the fallback pool,
17054
+ * not a balanced target). An explicit stored value always wins; a stored-only
17055
+ * (unavailable) key keeps its stored value.
17056
+ */
17057
+ enabled: boolean(),
17058
+ /** Relative balancer weight for the enabled device (default 1). */
17059
+ weight: number(),
17060
+ /** Per-device concurrent-session cap; null = unlimited (multi-device C4). */
17061
+ maxSessions: number().nullable(),
17062
+ /** Object-detection model the executor defaults to for this deviceKey. */
17063
+ defaultModelId: string(),
17064
+ /**
17065
+ * Per-(node,device) BASE provisioning (C7.2/C7.4) — the RAW stored
17066
+ * `stepId → {modelId?, settings?}` map from `inferenceDevices[key].steps`.
17067
+ * Absent/empty ⇒ no base (every step uses its device format default). The
17068
+ * UI cross-references `pipelineExecutor.getSchema` for the models actually
17069
+ * available per format; this is the stored selection that becomes the
17070
+ * default for EVERY camera landing on this accelerator.
17071
+ */
17072
+ steps: record(string(), DeviceStepConfigSchema).optional()
17073
+ });
17074
+ var NodeInferenceDevicesSchema = object({
17075
+ nodeId: string(),
17076
+ /** False when the node's platform-probe was unreachable (no live device set). */
17077
+ reachable: boolean(),
17078
+ devices: array(NodeInferenceDeviceSchema).readonly()
17079
+ });
16604
17080
  method(object({
16605
17081
  deviceId: number(),
16606
17082
  agentNodeId: string()
@@ -16610,7 +17086,13 @@ method(object({
16610
17086
  }), method(object({ deviceId: number() }), object({ success: literal(true) }), {
16611
17087
  kind: "mutation",
16612
17088
  auth: "admin"
16613
- }), method(_void(), object({ migrated: number() }), {
17089
+ }), method(object({
17090
+ deviceId: number(),
17091
+ deviceKey: string()
17092
+ }), object({ success: literal(true) }), {
17093
+ kind: "mutation",
17094
+ auth: "admin"
17095
+ }), method(object({ deviceId: number() }), object({ deviceKey: string().nullable() })), method(_void(), object({ migrated: number() }), {
16614
17096
  kind: "mutation",
16615
17097
  auth: "admin"
16616
17098
  }), 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({
@@ -16644,13 +17126,7 @@ method(object({
16644
17126
  }))), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
16645
17127
  nodeId: string(),
16646
17128
  settings: AgentPipelineSettingsSchema
16647
- })).readonly()), method(object({
16648
- agentNodeId: string(),
16649
- defaults: record(string(), AgentAddonConfigSchema)
16650
- }), object({ success: literal(true) }), {
16651
- kind: "mutation",
16652
- auth: "admin"
16653
- }), method(object({ agentNodeId: string() }), object({
17129
+ })).readonly()), method(object({ agentNodeId: string() }), object({
16654
17130
  success: boolean(),
16655
17131
  removed: boolean()
16656
17132
  }), {
@@ -16682,7 +17158,18 @@ method(object({
16682
17158
  }), object({ success: literal(true) }), {
16683
17159
  kind: "mutation",
16684
17160
  auth: "admin"
16685
- }), method(object({ agentNodeId: string() }), object({
17161
+ }), method(object({
17162
+ agentNodeId: string(),
17163
+ inferenceDevices: record(string(), object({
17164
+ enabled: boolean(),
17165
+ weight: number().positive().optional(),
17166
+ maxSessions: number().int().positive().optional(),
17167
+ steps: record(string(), DeviceStepConfigSchema).optional()
17168
+ }))
17169
+ }), object({ success: literal(true) }), {
17170
+ kind: "mutation",
17171
+ auth: "admin"
17172
+ }), method(object({ nodeId: string() }), NodeInferenceDevicesSchema), method(object({ agentNodeId: string() }), object({
16686
17173
  success: literal(true),
16687
17174
  /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
16688
17175
  effectiveModelId: string().nullable(),
@@ -16698,9 +17185,10 @@ method(object({
16698
17185
  }), object({ success: literal(true) }), {
16699
17186
  kind: "mutation",
16700
17187
  auth: "admin"
16701
- }), method(object({ deviceId: number() }), record(string(), record(string(), CameraStepOverridePatchSchema)).nullable()), method(object({
17188
+ }), method(object({ deviceId: number() }), record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).nullable()), method(object({
16702
17189
  deviceId: number(),
16703
17190
  agentNodeId: string(),
17191
+ deviceKey: string(),
16704
17192
  addonId: string(),
16705
17193
  patch: CameraStepOverridePatchSchema.nullable()
16706
17194
  }), object({ success: literal(true) }), {
@@ -16737,14 +17225,13 @@ method(object({
16737
17225
  });
16738
17226
  /**
16739
17227
  * server-management — per-NODE singleton capability for a node's ROOT
16740
- * package lifecycle (runtime-updatable node packages, phase 2: hub + docker
16741
- * agents).
17228
+ * package lifecycle (runtime-updatable node packages).
16742
17229
  *
16743
- * Each node's root package (`@camstack/server` on the hub, `@camstack/agent`
16744
- * on agents) carries the whole software stack in its npm dep tree, so ONE
16745
- * version describes the node. Updates install into
16746
- * `<dataDir>/server-root/versions/<v>/` and apply on restart via the baked
16747
- * starter (probation boot + auto-rollback to N-1).
17230
+ * Every node role runs the SAME root package (`@camstack/server`), which
17231
+ * carries the whole software stack in its npm dep tree, so ONE version
17232
+ * describes the node. Updates stage into `<dataDir>/server-root/` and apply
17233
+ * on restart via the baked starter (single-copy in-place swap — no probation,
17234
+ * no auto-rollback).
16748
17235
  *
16749
17236
  * Providers:
16750
17237
  * - HUB: `ServerUpdateService` behind the `server-provided` mount
@@ -16852,7 +17339,8 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
16852
17339
  /** Explicit target version; omitted = latest from the registry. */
16853
17340
  version: string().optional() }), ServerUpdateActionResultSchema, {
16854
17341
  kind: "mutation",
16855
- auth: "admin"
17342
+ auth: "admin",
17343
+ timeoutMs: 16 * 6e4
16856
17344
  }), method(_void(), ServerUpdateActionResultSchema, {
16857
17345
  kind: "mutation",
16858
17346
  auth: "admin"
@@ -17896,22 +18384,6 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
17896
18384
  var RestartAddonResultSchema = unknown();
17897
18385
  var InstallPackageResultSchema = unknown();
17898
18386
  var ReloadPackagesResultSchema = unknown();
17899
- /**
17900
- * Result of `updateFrameworkPackage`. The cap method returns BEFORE the
17901
- * server restarts so the admin UI can react to the `restartingAt`
17902
- * timestamp (shows reconnect overlay). The transition from
17903
- * `fromVersion` to `toVersion` will be confirmed by a subsequent
17904
- * `system.restart-completed` event after the new process boots.
17905
- *
17906
- * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
17907
- */
17908
- var UpdateFrameworkPackageResultSchema = object({
17909
- packageName: string(),
17910
- fromVersion: string(),
17911
- toVersion: string(),
17912
- /** Ms-epoch the server scheduled its self-restart. */
17913
- restartingAt: number()
17914
- });
17915
18387
  var BulkUpdateItemStatusSchema = _enum([
17916
18388
  "queued",
17917
18389
  "updating",
@@ -18039,13 +18511,6 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
18039
18511
  }), object({ success: literal(true) }), {
18040
18512
  kind: "mutation",
18041
18513
  auth: "admin"
18042
- }), method(object({
18043
- packageName: string().min(1),
18044
- version: string().optional(),
18045
- deferRestart: boolean().optional()
18046
- }), UpdateFrameworkPackageResultSchema, {
18047
- kind: "mutation",
18048
- auth: "admin"
18049
18514
  }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
18050
18515
  kind: "mutation",
18051
18516
  auth: "admin"
@@ -18972,10 +19437,10 @@ var TopologyCategorySchema = object({
18972
19437
  addons: array(TopologyCategoryAddonSchema).readonly()
18973
19438
  });
18974
19439
  /**
18975
- * The node's runtime-updatable ROOT package (`@camstack/server` on the hub,
18976
- * `@camstack/agent` on agents) as reported by its `registerNode` manifest —
18977
- * version visibility for the Server management surface. Nullable: offline
18978
- * rows and pre-phase-2 nodes report none.
19440
+ * The node's runtime-updatable ROOT package (`@camstack/server` the single
19441
+ * root package for every node role) as reported by its `registerNode`
19442
+ * manifest — version visibility for the Server management surface. Nullable:
19443
+ * offline rows and nodes that never reported one.
18979
19444
  */
18980
19445
  var TopologyRootPackageSchema = object({
18981
19446
  name: string(),
@@ -19363,17 +19828,28 @@ var PlatformScoreSchema = object({
19363
19828
  format: _enum([
19364
19829
  "onnx",
19365
19830
  "coreml",
19366
- "openvino"
19831
+ "openvino",
19832
+ "tflite"
19367
19833
  ]),
19368
19834
  score: number(),
19369
19835
  reason: string(),
19370
19836
  available: boolean()
19371
19837
  });
19838
+ var InferenceDeviceDescriptorSchema = object({
19839
+ key: string(),
19840
+ backend: string(),
19841
+ device: string(),
19842
+ format: ModelFormatSchema,
19843
+ runtime: literal("python"),
19844
+ score: number(),
19845
+ available: boolean()
19846
+ });
19372
19847
  var PlatformCapabilitiesSchema = object({
19373
19848
  hardware: HardwareInfoSchema,
19374
19849
  scores: array(PlatformScoreSchema).readonly(),
19375
19850
  bestScore: PlatformScoreSchema,
19376
- pythonPath: string().nullable()
19851
+ pythonPath: string().nullable(),
19852
+ devices: array(InferenceDeviceDescriptorSchema).readonly()
19377
19853
  });
19378
19854
  var ModelRequirementSchema = object({
19379
19855
  modelId: string(),
@@ -20252,12 +20728,6 @@ Object.freeze({
20252
20728
  addonId: null,
20253
20729
  access: "delete"
20254
20730
  },
20255
- "addons.updateFrameworkPackage": {
20256
- capName: "addons",
20257
- capScope: "system",
20258
- addonId: null,
20259
- access: "create"
20260
- },
20261
20731
  "addons.updatePackage": {
20262
20732
  capName: "addons",
20263
20733
  capScope: "system",
@@ -23030,12 +23500,6 @@ Object.freeze({
23030
23500
  addonId: null,
23031
23501
  access: "view"
23032
23502
  },
23033
- "pipelineExecutor.reprobeEngine": {
23034
- capName: "pipeline-executor",
23035
- capScope: "system",
23036
- addonId: null,
23037
- access: "create"
23038
- },
23039
23503
  "pipelineExecutor.runAudioTest": {
23040
23504
  capName: "pipeline-executor",
23041
23505
  capScope: "system",
@@ -23186,6 +23650,12 @@ Object.freeze({
23186
23650
  addonId: null,
23187
23651
  access: "view"
23188
23652
  },
23653
+ "pipelineOrchestrator.getNodeInferenceDevices": {
23654
+ capName: "pipeline-orchestrator",
23655
+ capScope: "system",
23656
+ addonId: null,
23657
+ access: "view"
23658
+ },
23189
23659
  "pipelineOrchestrator.getPipelineAssignment": {
23190
23660
  capName: "pipeline-orchestrator",
23191
23661
  capScope: "system",
@@ -23198,6 +23668,12 @@ Object.freeze({
23198
23668
  addonId: null,
23199
23669
  access: "view"
23200
23670
  },
23671
+ "pipelineOrchestrator.getPipelineDevicePin": {
23672
+ capName: "pipeline-orchestrator",
23673
+ capScope: "system",
23674
+ addonId: null,
23675
+ access: "view"
23676
+ },
23201
23677
  "pipelineOrchestrator.listAgentSettings": {
23202
23678
  capName: "pipeline-orchestrator",
23203
23679
  capScope: "system",
@@ -23240,19 +23716,19 @@ Object.freeze({
23240
23716
  addonId: null,
23241
23717
  access: "create"
23242
23718
  },
23243
- "pipelineOrchestrator.setAgentAddonDefaults": {
23719
+ "pipelineOrchestrator.setAgentCapabilities": {
23244
23720
  capName: "pipeline-orchestrator",
23245
23721
  capScope: "system",
23246
23722
  addonId: null,
23247
23723
  access: "create"
23248
23724
  },
23249
- "pipelineOrchestrator.setAgentCapabilities": {
23725
+ "pipelineOrchestrator.setAgentDetectWeight": {
23250
23726
  capName: "pipeline-orchestrator",
23251
23727
  capScope: "system",
23252
23728
  addonId: null,
23253
23729
  access: "create"
23254
23730
  },
23255
- "pipelineOrchestrator.setAgentDetectWeight": {
23731
+ "pipelineOrchestrator.setAgentInferenceDevices": {
23256
23732
  capName: "pipeline-orchestrator",
23257
23733
  capScope: "system",
23258
23734
  addonId: null,
@@ -23294,6 +23770,12 @@ Object.freeze({
23294
23770
  addonId: null,
23295
23771
  access: "create"
23296
23772
  },
23773
+ "pipelineOrchestrator.setPipelineDevicePin": {
23774
+ capName: "pipeline-orchestrator",
23775
+ capScope: "system",
23776
+ addonId: null,
23777
+ access: "create"
23778
+ },
23297
23779
  "pipelineOrchestrator.unassignAudio": {
23298
23780
  capName: "pipeline-orchestrator",
23299
23781
  capScope: "system",
@@ -24846,31 +25328,5 @@ Object.freeze({
24846
25328
  "network-access": "ingress",
24847
25329
  "smtp-provider": "email"
24848
25330
  });
24849
- var frameworkSwapPackageSchema = object({
24850
- name: string(),
24851
- stagedPath: string(),
24852
- backupPath: string(),
24853
- toVersion: string(),
24854
- fromVersion: string().nullable()
24855
- });
24856
- object({
24857
- jobId: string(),
24858
- taskId: string(),
24859
- packages: array(frameworkSwapPackageSchema),
24860
- requestedAtMs: number(),
24861
- schemaVersion: literal(1)
24862
- });
24863
- object({
24864
- jobId: string(),
24865
- taskId: string(),
24866
- backups: array(object({
24867
- name: string(),
24868
- backupPath: string(),
24869
- livePath: string()
24870
- })),
24871
- appliedAtMs: number(),
24872
- bootAttempts: number(),
24873
- schemaVersion: literal(1)
24874
- });
24875
25331
  //#endregion
24876
25332
  export { EventCategory as i, networkAccessCapability as n, BaseAddon as r, meshNetworkCapability as t };