@camstack/types 1.2.69 → 1.2.71

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.
@@ -205,6 +205,33 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
205
205
  EventCategory["PipelineCameraAssigned"] = "pipeline.camera-assigned";
206
206
  EventCategory["PipelineCameraUnassigned"] = "pipeline.camera-unassigned";
207
207
  /**
208
+ * A node the orchestrator would otherwise place cameras on has NO usable
209
+ * inference device: the operator enabled one or more accelerators there and
210
+ * the live probe reports every one of them unavailable. Emitted once per
211
+ * TRANSITION into that state (never per dispatch), and the node is dropped
212
+ * from the placement candidate set for as long as it holds.
213
+ *
214
+ * This exists because the state was previously invisible: little-unraid
215
+ * absorbed 283k inference errors in a day while still being handed cameras,
216
+ * and nothing in the system said so.
217
+ *
218
+ * A node with no accelerators configured at all is NOT this — its devices
219
+ * are `disabled`, not `unavailable`, and the runner's default CPU pool
220
+ * serves it exactly as before.
221
+ */
222
+ EventCategory["PipelineNodeInferenceUnavailable"] = "pipeline.node-inference-unavailable";
223
+ /**
224
+ * A camera has an OPEN detection session and has produced no detection at
225
+ * all for longer than the blind threshold — the camera is being decoded and
226
+ * inferred and is returning nothing. Emitted once per transition into blind,
227
+ * per camera.
228
+ *
229
+ * The failure it reports: a 1h43 detection blackout on the entrance camera
230
+ * that nobody noticed, because "a camera that detects nothing" and "a quiet
231
+ * camera" produce byte-identical silence.
232
+ */
233
+ EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
234
+ /**
208
235
  * Per-camera pipeline config was mutated by the orchestrator
209
236
  * (3-level settings change via `setAgentAddonDefaults` /
210
237
  * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_event_category = require("./event-category-DxZbWydC.js");
3
- const require_sleep = require("./sleep-YuacOD41.js");
2
+ const require_event_category = require("./event-category-D3gG7oil.js");
3
+ const require_sleep = require("./sleep-DbVrpKVz.js");
4
4
  const require_canonical_hash = require("./canonical-hash-DNV8S5ET.js");
5
5
  const require_enums = require("./enums.js");
6
6
  const require_err_msg = require("./err-msg-COpsHMw2.js");
@@ -11958,6 +11958,8 @@ var NcSystemEventKindSchema = zod.z.enum([
11958
11958
  "stream-offline",
11959
11959
  "node-online",
11960
11960
  "node-offline",
11961
+ "node-inference-unavailable",
11962
+ "detection-blind",
11961
11963
  "addon-update-available",
11962
11964
  "server-update-available",
11963
11965
  "alarm-triggered",
@@ -12068,7 +12070,16 @@ var NcScheduleSchema = zod.z.object({
12068
12070
  });
12069
12071
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
12070
12072
  var NcPlateMatcherSchema = zod.z.object({
12071
- values: zod.z.array(zod.z.string().min(1)).min(1),
12073
+ /**
12074
+ * Plate texts (or gallery vehicle names) to match. EMPTY = **any plate the
12075
+ * pipeline could read** — the plate half of "no selection = no narrowing",
12076
+ * and the switch that says this rule is about vehicles that were IDENTIFIED
12077
+ * rather than merely seen. A subject carrying no plate still fails.
12078
+ *
12079
+ * The `.min(1)` this used to carry made that state unauthorable; nothing has
12080
+ * ever persisted an empty list, so widening it cannot change an existing rule.
12081
+ */
12082
+ values: zod.z.array(zod.z.string().min(1)),
12072
12083
  /** Max Levenshtein distance after normalization (uppercase alphanumeric). */
12073
12084
  maxDistance: zod.z.number().int().min(0).max(3).default(1)
12074
12085
  });
@@ -12330,18 +12341,47 @@ var NcConditionsSchema = zod.z.object({
12330
12341
  */
12331
12342
  labelEquals: zod.z.array(zod.z.string().min(1)).optional(),
12332
12343
  /**
12333
- * Identity matcher. P1 boundary: matched against the record's collapsed
12334
- * `label` (the identity display name propagated by the face pipeline) —
12335
- * identity-ID matching rides in P2 when identity ids reach the record.
12344
+ * KNOWN FACES the rule's identity scope, and the switch that says the rule
12345
+ * is about recognised people at all.
12346
+ *
12347
+ * Three states, and the empty one is the point:
12348
+ *
12349
+ * | value | meaning |
12350
+ * | --- | --- |
12351
+ * | absent | the rule does not care who it is; an unrecognised person matches |
12352
+ * | `[]` | **only known faces** — any identity in the gallery, nobody in particular |
12353
+ * | a list | only these identities |
12354
+ *
12355
+ * `[]` is the repo-wide "no selection = no narrowing" reading (an absent
12356
+ * `devices` list is every device), applied one level down: the operator has
12357
+ * turned the face scope ON and narrowed it to nothing, which is every known
12358
+ * face. No second field states the same thing — a switch that can disagree
12359
+ * with the list under it is worse than no switch (D62).
12360
+ *
12361
+ * MEMBERS ARE FACE-GALLERY `Identity.id`s (uuid), not display names. A name is
12362
+ * renameable, and a rule authored on "Gianluca" went silently dark the moment
12363
+ * the operator fixed the spelling. The id reaches the record on
12364
+ * `LabelAttribution.identityId`; the name is what the editor shows and what
12365
+ * `{{label}}` renders.
12366
+ *
12367
+ * Rules written before this carry NAMES, and are resolved to ids lazily at
12368
+ * load (`NcRuleStore.load`) against the live gallery — a name nothing answers
12369
+ * for is left as it stands and reported, never dropped. The engine also
12370
+ * accepts a display-name hit as a compatibility leg, so a rule whose
12371
+ * migration could not resolve keeps matching exactly what it matched before.
12336
12372
  */
12337
12373
  identities: zod.z.array(zod.z.string().min(1)).optional(),
12338
- /** Fuzzy plate matcher against the record's `label` (plate text). */
12374
+ /**
12375
+ * KNOWN PLATES / VEHICLES — the plate mirror of {@link identities}, including
12376
+ * the empty-list reading: `values: []` is "any plate the OCR could read",
12377
+ * a non-empty list is those plates (fuzzily). See {@link NcPlateMatcherSchema}.
12378
+ */
12339
12379
  plates: NcPlateMatcherSchema.optional(),
12340
12380
  /**
12341
- * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics.
12342
- * Same P1 boundary: matched against the record's collapsed `label` (the
12343
- * identity display name). A record with NO label passes (nothing to
12344
- * exclude), unlike the include variant which fails on an absent label.
12381
+ * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics, and
12382
+ * the same id members and the same lazy name→id migration. A record with NO
12383
+ * identity passes (nothing to exclude), unlike the include variant which
12384
+ * fails on an unrecognised subject. An EMPTY list excludes nobody.
12345
12385
  */
12346
12386
  identitiesExclude: zod.z.array(zod.z.string().min(1)).optional(),
12347
12387
  /**
@@ -12734,7 +12774,80 @@ var NcRuleInputSchema = zod.z.object({
12734
12774
  * a rule that predates the gate must keep delivering byte-for-byte as it
12735
12775
  * did, and absent is the only way to say that without a migration.
12736
12776
  */
12737
- confirm: NcConfirmSchema.optional()
12777
+ confirm: NcConfirmSchema.optional(),
12778
+ /**
12779
+ * WAIT for face/plate recognition before saying anything.
12780
+ *
12781
+ * A notification's TEXT is frozen at enqueue and its media is re-resolved at
12782
+ * send; the identity is neither. A face is confirmed after `confirmFrames`
12783
+ * agreeing observations — p50 **11.4 s** after the track was first seen,
12784
+ * measured on this hub — and an `immediate` rule enqueues on the first object
12785
+ * event, seconds before that. So "Gianluca è arrivato" is unsayable on the
12786
+ * immediate path, and no amount of media re-resolution fixes a sentence.
12787
+ *
12788
+ * Only two honest answers exist, and this flag picks between them. It has
12789
+ * effect ONLY on a rule that declares a recognition scope
12790
+ * ({@link NcConditions.identities} or {@link NcConditions.plates}) — on any
12791
+ * other rule there is nothing to wait for and the flag is inert.
12792
+ *
12793
+ * | value | what happens |
12794
+ * | --- | --- |
12795
+ * | `true` | the rule stops firing on the object event and fires at TRACK CLOSE instead, once, with the name — later, and complete |
12796
+ * | absent / `false` | it fires at once WITHOUT the name, and if recognition lands before the track closes a SECOND, "…is Gianluca" notification follows (one per track, per rule, per target) |
12797
+ *
12798
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
12799
+ * on the addon cap path, and absent has to keep meaning exactly what every
12800
+ * rule authored before this field meant.
12801
+ *
12802
+ * The cost of `true` is stated here because the editor states it too: a rule
12803
+ * that waits also inherits track-close SEMANTICS — its `zones` condition
12804
+ * tests every zone the track visited and a `crossing` condition can no longer
12805
+ * be satisfied, because a closed track carries no crossing.
12806
+ */
12807
+ waitForEnhancement: zod.z.boolean().optional(),
12808
+ /**
12809
+ * GROUP a burst of subjects into ONE notification that grows.
12810
+ *
12811
+ * Seconds of quiet after the last matching subject before the burst is
12812
+ * considered over. While it is open, the first subject enqueues immediately —
12813
+ * **exactly as today, with no added latency** — and every real growth (a new
12814
+ * subject, or a name confirmed on one already in it) REPLACES that
12815
+ * notification with an updated one naming everybody. The push carries the
12816
+ * group's own coalescing tag, so the phone replaces rather than stacks.
12817
+ *
12818
+ * `0` / absent = off, and off is today's behaviour byte for byte.
12819
+ *
12820
+ * ### Why an idle cutoff and not a window
12821
+ *
12822
+ * The measured seven-person arrival on device 590 spans 110 s with every
12823
+ * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
12824
+ * idle cutoff holds it as one and ends it when the arrival actually ends.
12825
+ * 30 is Frigate's shipped value for the same decision.
12826
+ *
12827
+ * ### What it replaces
12828
+ *
12829
+ * The blind cooldown, which collapses a burst by DISCARDING it. Measured on
12830
+ * device 615 / *Persona su Uscio* over six days: 116 qualifying tracks → 74
12831
+ * notifications, **44 (37.9%) suppressed outright**, 23 of them overlapping a
12832
+ * track that did fire and 7 carrying a confirmed identity nobody heard about.
12833
+ * A group collapses the same volume by MERGING, so the cooldown becomes a
12834
+ * budget over GROUPS — which is what it always meant — and a growth is never
12835
+ * throttled by the window its own first member spent.
12836
+ *
12837
+ * ### Interaction with {@link waitForEnhancement}
12838
+ *
12839
+ * They compose, and the order matters. `waitForEnhancement` defers the rule to
12840
+ * TRACK CLOSE, so with both set the group is opened by the first member to
12841
+ * CLOSE — already carrying its name — and grows as later members close. That
12842
+ * is later, and complete. With grouping alone the group opens on the first
12843
+ * object event and picks up names as they are confirmed, through the growth
12844
+ * path. Neither combination fires twice for one subject.
12845
+ *
12846
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
12847
+ * on the addon cap path, so absent must keep meaning what it meant before this
12848
+ * field existed.
12849
+ */
12850
+ groupIdleSec: zod.z.number().int().min(0).max(600).optional()
12738
12851
  });
12739
12852
  /**
12740
12853
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -12921,6 +13034,14 @@ var NC_CONDITION_CATALOG = [
12921
13034
  value: "node-offline",
12922
13035
  label: "Node offline"
12923
13036
  },
13037
+ {
13038
+ value: "node-inference-unavailable",
13039
+ label: "Node has no usable inference device"
13040
+ },
13041
+ {
13042
+ value: "detection-blind",
13043
+ label: "Camera detecting nothing"
13044
+ },
12924
13045
  {
12925
13046
  value: "addon-update-available",
12926
13047
  label: "Addon update available"
@@ -13078,32 +13199,32 @@ var NC_CONDITION_CATALOG = [
13078
13199
  {
13079
13200
  id: "identities",
13080
13201
  group: "label",
13081
- label: "Identities",
13202
+ label: "Known faces",
13082
13203
  valueType: "stringList",
13083
13204
  operator: "in",
13084
13205
  appliesTo: ["immediate", "track-end"],
13085
13206
  phase: "P1",
13086
- description: "P1: matched against the identity display name on the record label."
13207
+ description: "Only recognised people. Selecting NOBODY means every identity in the face gallery; selecting some narrows to those. Matched on the gallery id, so renaming a person does not break the rule. On immediate delivery the name is not known yet when the notification is enqueued — see the rule’s \"wait for recognition\" switch."
13087
13208
  },
13088
13209
  {
13089
13210
  id: "plates",
13090
13211
  group: "label",
13091
- label: "License plates",
13212
+ label: "Known plates",
13092
13213
  valueType: "plateMatcher",
13093
13214
  operator: "fuzzyIn",
13094
13215
  appliesTo: ["immediate", "track-end"],
13095
13216
  phase: "P1",
13096
- description: "Levenshtein-tolerant match against the plate text."
13217
+ description: "Only vehicles whose plate was read. Selecting NO plate means any readable plate; listed plates are matched Levenshtein-tolerantly, because OCR noise makes an exact match useless."
13097
13218
  },
13098
13219
  {
13099
13220
  id: "identitiesExclude",
13100
13221
  group: "label",
13101
- label: "Excluded identities",
13222
+ label: "Excluded faces",
13102
13223
  valueType: "stringList",
13103
13224
  operator: "notIn",
13104
13225
  appliesTo: ["immediate", "track-end"],
13105
13226
  phase: "P1",
13106
- description: "Veto by identity display name (mirror of Identities; absent label passes)."
13227
+ description: "Veto by identity (mirror of Known faces, same gallery ids). A subject nobody recognised passes — there is nothing to exclude."
13107
13228
  },
13108
13229
  {
13109
13230
  id: "minLabelConfidence",
@@ -14182,7 +14303,7 @@ var TrackEnvelopeSchema = zod.z.object({
14182
14303
  * `snapshots[]` references — megabytes across a page of tracks. `slim`
14183
14304
  * keeps every scalar the list surfaces actually render (ids, class(es),
14184
14305
  * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
14185
- * zonesVisited, bestEventId, envelope, hasFace) and returns `positions` /
14306
+ * zonesVisited, bestEventId, envelope, hasFace, hasRider) and returns `positions` /
14186
14307
  * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
14187
14308
  * `getTrack`. Mirrors the event-store `projection` convention
14188
14309
  * (`getObjectEvents` et al.).
@@ -14334,7 +14455,21 @@ var LabelTierSchema = zod.z.union([zod.z.literal(1), zod.z.literal(2)]);
14334
14455
  var LabelAttributionSchema = zod.z.object({
14335
14456
  stepId: zod.z.string(),
14336
14457
  modelId: zod.z.string().optional(),
14337
- decidedAt: zod.z.number()
14458
+ decidedAt: zod.z.number(),
14459
+ /**
14460
+ * The GALLERY id behind a recognised tier-2 label — a face-gallery
14461
+ * `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
14462
+ *
14463
+ * The text alone is a DISPLAY NAME, and a display name is renameable: a
14464
+ * notification rule authored on "Gianluca" stopped matching the moment the
14465
+ * operator fixed the spelling in the gallery, and nothing said so. The id is
14466
+ * the thing that does not move, so it is what a rule matches on
14467
+ * (`NcConditions.identities`) and the text is what a human is shown.
14468
+ *
14469
+ * Absent when the label names no gallery row — a plate the OCR read but no
14470
+ * vehicle claims, a sub-class, a species, any tier-1 value.
14471
+ */
14472
+ identityId: zod.z.string().optional()
14338
14473
  });
14339
14474
  /**
14340
14475
  * The TIERED label model (roadmap 4g), spread into `TrackSchema` and
@@ -14471,6 +14606,28 @@ var TrackSchema = zod.z.object({
14471
14606
  * `=== true` and render nothing otherwise, never infer "no face".
14472
14607
  */
14473
14608
  hasFace: zod.z.boolean().optional(),
14609
+ /**
14610
+ * This subject CONTAINS a folded rider — a person the rider-pairing step
14611
+ * ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
14612
+ * so the passage is tracked once and as a VEHICLE.
14613
+ *
14614
+ * It exists because the fold's record was dishonest. D34 and the code both
14615
+ * said "the person is not lost — it is reported so both entities stay on the
14616
+ * record"; in fact the pair went into a per-processor RAM field behind an
14617
+ * accessor nobody called, and every durable surface said `vehicle`, full
14618
+ * stop. This is the composition note that makes the row true.
14619
+ *
14620
+ * A COMPOSITION, never a class and never a label. "This vehicle contains a
14621
+ * person" is not an answer to "what is this" — both label tiers would refuse
14622
+ * a macro token anyway (D89), and correctly. Nothing here changes what the
14623
+ * subject IS: a cyclist stays one vehicle track, occupancy still counts one,
14624
+ * and a `person` rule still does not fire for someone cycling past.
14625
+ *
14626
+ * **Absent ≠ false**, exactly like {@link hasFace}: every row written before
14627
+ * the column, and every hub that predates the field, omits it. Test
14628
+ * `=== true` and render nothing otherwise — never infer "no rider".
14629
+ */
14630
+ hasRider: zod.z.boolean().optional(),
14474
14631
  ...TrackFlagFields,
14475
14632
  ...TrackRetrainFields
14476
14633
  });
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { t as EventCategory } from "./event-category-Cv9dO26A.mjs";
2
- import { $ as FrameHandleFormatSchema, A as isDeviceConfigCap, B as emitDownForOwnedCaps, C as DeviceType, Ct as WELL_KNOWN_TAB_MAP, D as DEVICE_STATUS_METHOD, Dt as resolveHydratedFieldValue, E as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Et as hydrateSchema, F as nodePin, G as CAM_PROFILE_ORDER, H as scopeKey, I as readNodePin, J as CamStreamResolutionSchema, K as CamProfileSchema, L as toNodeId, M as resolveCapMount, N as systemMethod, O as event, P as CAP_NODE_PIN_CONTEXT_KEY, Q as EncodedPacketSchema, R as ReadinessRegistry, S as DeviceRole, St as WELL_KNOWN_TABS, T as DEFAULT_RUNTIME_STATE_DURABILITY, Tt as collectHydratedFieldValues, U as BrokerStatsSchema, V as readinessKey, W as BrokerStatusSchema, X as DecodedAudioChunkSchema, Y as CameraStreamSchema, Z as DecodedFrameSchema, _ as RawStateResultSchema, _t as normalizeAddonInitResult, a as asJsonObject, at as StreamSourceSchema, b as ChargingStatus, bt as emitReadiness, c as parseJsonArray, ct as SubscribeFramesInputSchema, d as DEVICE_SCOPED_CAPS, dt as makeSourceBrokerId, et as FrameHandleSchema, f as isDeviceScopedCap, ft as parseProfileBrokerId, g as createSliceHandle, gt as BaseAddon, h as createMirrorSource, ht as DisposerChain, i as asJsonArray, it as StreamSourceEntrySchema, j as method, k as expandCapMethods, l as parseJsonObject, lt as SubscribeFramesResultSchema, m as createLazyTrpcSource, mt as DATAPLANE_SECRET_HEADER, n as sleepCancellable, nt as ProfileSlotSchema, o as asNumber, ot as SubscribeAudioChunksInputSchema, p as createDeviceProxy, pt as selectAssignedProfileSlots, q as CamStreamKindSchema, r as asBoolean, rt as ProfileSlotStatusSchema, s as asString, st as SubscribeAudioChunksResultSchema, t as sleep, tt as ProfileRtspEntrySchema, u as parseJsonUnknown, ut as makeProfileBrokerId, v as deviceOpsCapability, vt as createDurableState, w as adminUiCapability, wt as collectHydratedFieldEntries, x as DeviceFeature, xt as isEvent, y as viewerUiCapability, yt as createEvent, z as ReadinessTimeoutError } from "./sleep-CwERnGrD.mjs";
1
+ import { t as EventCategory } from "./event-category-Bxo5yJjt.mjs";
2
+ import { $ as FrameHandleFormatSchema, A as isDeviceConfigCap, B as emitDownForOwnedCaps, C as DeviceType, Ct as WELL_KNOWN_TAB_MAP, D as DEVICE_STATUS_METHOD, Dt as resolveHydratedFieldValue, E as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Et as hydrateSchema, F as nodePin, G as CAM_PROFILE_ORDER, H as scopeKey, I as readNodePin, J as CamStreamResolutionSchema, K as CamProfileSchema, L as toNodeId, M as resolveCapMount, N as systemMethod, O as event, P as CAP_NODE_PIN_CONTEXT_KEY, Q as EncodedPacketSchema, R as ReadinessRegistry, S as DeviceRole, St as WELL_KNOWN_TABS, T as DEFAULT_RUNTIME_STATE_DURABILITY, Tt as collectHydratedFieldValues, U as BrokerStatsSchema, V as readinessKey, W as BrokerStatusSchema, X as DecodedAudioChunkSchema, Y as CameraStreamSchema, Z as DecodedFrameSchema, _ as RawStateResultSchema, _t as normalizeAddonInitResult, a as asJsonObject, at as StreamSourceSchema, b as ChargingStatus, bt as emitReadiness, c as parseJsonArray, ct as SubscribeFramesInputSchema, d as DEVICE_SCOPED_CAPS, dt as makeSourceBrokerId, et as FrameHandleSchema, f as isDeviceScopedCap, ft as parseProfileBrokerId, g as createSliceHandle, gt as BaseAddon, h as createMirrorSource, ht as DisposerChain, i as asJsonArray, it as StreamSourceEntrySchema, j as method, k as expandCapMethods, l as parseJsonObject, lt as SubscribeFramesResultSchema, m as createLazyTrpcSource, mt as DATAPLANE_SECRET_HEADER, n as sleepCancellable, nt as ProfileSlotSchema, o as asNumber, ot as SubscribeAudioChunksInputSchema, p as createDeviceProxy, pt as selectAssignedProfileSlots, q as CamStreamKindSchema, r as asBoolean, rt as ProfileSlotStatusSchema, s as asString, st as SubscribeAudioChunksResultSchema, t as sleep, tt as ProfileRtspEntrySchema, u as parseJsonUnknown, ut as makeProfileBrokerId, v as deviceOpsCapability, vt as createDurableState, w as adminUiCapability, wt as collectHydratedFieldEntries, x as DeviceFeature, xt as isEvent, y as viewerUiCapability, yt as createEvent, z as ReadinessTimeoutError } from "./sleep-CTgUmjYq.mjs";
3
3
  import { a as buildAudioArgs, c as buildVideoArgs, d as logBannerArgs, f as pickVideoEncoder, i as audioPlanFromEncodeProfile, l as invocationFromEncodeProfile, n as Fmp4BoxSplitter, o as buildFfmpegArgs, r as AUDIO_PRESETS, s as buildInputArgs, t as canonicalHash, u as isSoftwareDecode } from "./canonical-hash-rO1sRmEK.mjs";
4
4
  import { EventSourceType } from "./enums.mjs";
5
5
  import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
@@ -11957,6 +11957,8 @@ var NcSystemEventKindSchema = z.enum([
11957
11957
  "stream-offline",
11958
11958
  "node-online",
11959
11959
  "node-offline",
11960
+ "node-inference-unavailable",
11961
+ "detection-blind",
11960
11962
  "addon-update-available",
11961
11963
  "server-update-available",
11962
11964
  "alarm-triggered",
@@ -12067,7 +12069,16 @@ var NcScheduleSchema = z.object({
12067
12069
  });
12068
12070
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
12069
12071
  var NcPlateMatcherSchema = z.object({
12070
- values: z.array(z.string().min(1)).min(1),
12072
+ /**
12073
+ * Plate texts (or gallery vehicle names) to match. EMPTY = **any plate the
12074
+ * pipeline could read** — the plate half of "no selection = no narrowing",
12075
+ * and the switch that says this rule is about vehicles that were IDENTIFIED
12076
+ * rather than merely seen. A subject carrying no plate still fails.
12077
+ *
12078
+ * The `.min(1)` this used to carry made that state unauthorable; nothing has
12079
+ * ever persisted an empty list, so widening it cannot change an existing rule.
12080
+ */
12081
+ values: z.array(z.string().min(1)),
12071
12082
  /** Max Levenshtein distance after normalization (uppercase alphanumeric). */
12072
12083
  maxDistance: z.number().int().min(0).max(3).default(1)
12073
12084
  });
@@ -12329,18 +12340,47 @@ var NcConditionsSchema = z.object({
12329
12340
  */
12330
12341
  labelEquals: z.array(z.string().min(1)).optional(),
12331
12342
  /**
12332
- * Identity matcher. P1 boundary: matched against the record's collapsed
12333
- * `label` (the identity display name propagated by the face pipeline) —
12334
- * identity-ID matching rides in P2 when identity ids reach the record.
12343
+ * KNOWN FACES the rule's identity scope, and the switch that says the rule
12344
+ * is about recognised people at all.
12345
+ *
12346
+ * Three states, and the empty one is the point:
12347
+ *
12348
+ * | value | meaning |
12349
+ * | --- | --- |
12350
+ * | absent | the rule does not care who it is; an unrecognised person matches |
12351
+ * | `[]` | **only known faces** — any identity in the gallery, nobody in particular |
12352
+ * | a list | only these identities |
12353
+ *
12354
+ * `[]` is the repo-wide "no selection = no narrowing" reading (an absent
12355
+ * `devices` list is every device), applied one level down: the operator has
12356
+ * turned the face scope ON and narrowed it to nothing, which is every known
12357
+ * face. No second field states the same thing — a switch that can disagree
12358
+ * with the list under it is worse than no switch (D62).
12359
+ *
12360
+ * MEMBERS ARE FACE-GALLERY `Identity.id`s (uuid), not display names. A name is
12361
+ * renameable, and a rule authored on "Gianluca" went silently dark the moment
12362
+ * the operator fixed the spelling. The id reaches the record on
12363
+ * `LabelAttribution.identityId`; the name is what the editor shows and what
12364
+ * `{{label}}` renders.
12365
+ *
12366
+ * Rules written before this carry NAMES, and are resolved to ids lazily at
12367
+ * load (`NcRuleStore.load`) against the live gallery — a name nothing answers
12368
+ * for is left as it stands and reported, never dropped. The engine also
12369
+ * accepts a display-name hit as a compatibility leg, so a rule whose
12370
+ * migration could not resolve keeps matching exactly what it matched before.
12335
12371
  */
12336
12372
  identities: z.array(z.string().min(1)).optional(),
12337
- /** Fuzzy plate matcher against the record's `label` (plate text). */
12373
+ /**
12374
+ * KNOWN PLATES / VEHICLES — the plate mirror of {@link identities}, including
12375
+ * the empty-list reading: `values: []` is "any plate the OCR could read",
12376
+ * a non-empty list is those plates (fuzzily). See {@link NcPlateMatcherSchema}.
12377
+ */
12338
12378
  plates: NcPlateMatcherSchema.optional(),
12339
12379
  /**
12340
- * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics.
12341
- * Same P1 boundary: matched against the record's collapsed `label` (the
12342
- * identity display name). A record with NO label passes (nothing to
12343
- * exclude), unlike the include variant which fails on an absent label.
12380
+ * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics, and
12381
+ * the same id members and the same lazy name→id migration. A record with NO
12382
+ * identity passes (nothing to exclude), unlike the include variant which
12383
+ * fails on an unrecognised subject. An EMPTY list excludes nobody.
12344
12384
  */
12345
12385
  identitiesExclude: z.array(z.string().min(1)).optional(),
12346
12386
  /**
@@ -12733,7 +12773,80 @@ var NcRuleInputSchema = z.object({
12733
12773
  * a rule that predates the gate must keep delivering byte-for-byte as it
12734
12774
  * did, and absent is the only way to say that without a migration.
12735
12775
  */
12736
- confirm: NcConfirmSchema.optional()
12776
+ confirm: NcConfirmSchema.optional(),
12777
+ /**
12778
+ * WAIT for face/plate recognition before saying anything.
12779
+ *
12780
+ * A notification's TEXT is frozen at enqueue and its media is re-resolved at
12781
+ * send; the identity is neither. A face is confirmed after `confirmFrames`
12782
+ * agreeing observations — p50 **11.4 s** after the track was first seen,
12783
+ * measured on this hub — and an `immediate` rule enqueues on the first object
12784
+ * event, seconds before that. So "Gianluca è arrivato" is unsayable on the
12785
+ * immediate path, and no amount of media re-resolution fixes a sentence.
12786
+ *
12787
+ * Only two honest answers exist, and this flag picks between them. It has
12788
+ * effect ONLY on a rule that declares a recognition scope
12789
+ * ({@link NcConditions.identities} or {@link NcConditions.plates}) — on any
12790
+ * other rule there is nothing to wait for and the flag is inert.
12791
+ *
12792
+ * | value | what happens |
12793
+ * | --- | --- |
12794
+ * | `true` | the rule stops firing on the object event and fires at TRACK CLOSE instead, once, with the name — later, and complete |
12795
+ * | absent / `false` | it fires at once WITHOUT the name, and if recognition lands before the track closes a SECOND, "…is Gianluca" notification follows (one per track, per rule, per target) |
12796
+ *
12797
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
12798
+ * on the addon cap path, and absent has to keep meaning exactly what every
12799
+ * rule authored before this field meant.
12800
+ *
12801
+ * The cost of `true` is stated here because the editor states it too: a rule
12802
+ * that waits also inherits track-close SEMANTICS — its `zones` condition
12803
+ * tests every zone the track visited and a `crossing` condition can no longer
12804
+ * be satisfied, because a closed track carries no crossing.
12805
+ */
12806
+ waitForEnhancement: z.boolean().optional(),
12807
+ /**
12808
+ * GROUP a burst of subjects into ONE notification that grows.
12809
+ *
12810
+ * Seconds of quiet after the last matching subject before the burst is
12811
+ * considered over. While it is open, the first subject enqueues immediately —
12812
+ * **exactly as today, with no added latency** — and every real growth (a new
12813
+ * subject, or a name confirmed on one already in it) REPLACES that
12814
+ * notification with an updated one naming everybody. The push carries the
12815
+ * group's own coalescing tag, so the phone replaces rather than stacks.
12816
+ *
12817
+ * `0` / absent = off, and off is today's behaviour byte for byte.
12818
+ *
12819
+ * ### Why an idle cutoff and not a window
12820
+ *
12821
+ * The measured seven-person arrival on device 590 spans 110 s with every
12822
+ * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
12823
+ * idle cutoff holds it as one and ends it when the arrival actually ends.
12824
+ * 30 is Frigate's shipped value for the same decision.
12825
+ *
12826
+ * ### What it replaces
12827
+ *
12828
+ * The blind cooldown, which collapses a burst by DISCARDING it. Measured on
12829
+ * device 615 / *Persona su Uscio* over six days: 116 qualifying tracks → 74
12830
+ * notifications, **44 (37.9%) suppressed outright**, 23 of them overlapping a
12831
+ * track that did fire and 7 carrying a confirmed identity nobody heard about.
12832
+ * A group collapses the same volume by MERGING, so the cooldown becomes a
12833
+ * budget over GROUPS — which is what it always meant — and a growth is never
12834
+ * throttled by the window its own first member spent.
12835
+ *
12836
+ * ### Interaction with {@link waitForEnhancement}
12837
+ *
12838
+ * They compose, and the order matters. `waitForEnhancement` defers the rule to
12839
+ * TRACK CLOSE, so with both set the group is opened by the first member to
12840
+ * CLOSE — already carrying its name — and grows as later members close. That
12841
+ * is later, and complete. With grouping alone the group opens on the first
12842
+ * object event and picks up names as they are confirmed, through the growth
12843
+ * path. Neither combination fires twice for one subject.
12844
+ *
12845
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
12846
+ * on the addon cap path, so absent must keep meaning what it meant before this
12847
+ * field existed.
12848
+ */
12849
+ groupIdleSec: z.number().int().min(0).max(600).optional()
12737
12850
  });
12738
12851
  /**
12739
12852
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -12920,6 +13033,14 @@ var NC_CONDITION_CATALOG = [
12920
13033
  value: "node-offline",
12921
13034
  label: "Node offline"
12922
13035
  },
13036
+ {
13037
+ value: "node-inference-unavailable",
13038
+ label: "Node has no usable inference device"
13039
+ },
13040
+ {
13041
+ value: "detection-blind",
13042
+ label: "Camera detecting nothing"
13043
+ },
12923
13044
  {
12924
13045
  value: "addon-update-available",
12925
13046
  label: "Addon update available"
@@ -13077,32 +13198,32 @@ var NC_CONDITION_CATALOG = [
13077
13198
  {
13078
13199
  id: "identities",
13079
13200
  group: "label",
13080
- label: "Identities",
13201
+ label: "Known faces",
13081
13202
  valueType: "stringList",
13082
13203
  operator: "in",
13083
13204
  appliesTo: ["immediate", "track-end"],
13084
13205
  phase: "P1",
13085
- description: "P1: matched against the identity display name on the record label."
13206
+ description: "Only recognised people. Selecting NOBODY means every identity in the face gallery; selecting some narrows to those. Matched on the gallery id, so renaming a person does not break the rule. On immediate delivery the name is not known yet when the notification is enqueued — see the rule’s \"wait for recognition\" switch."
13086
13207
  },
13087
13208
  {
13088
13209
  id: "plates",
13089
13210
  group: "label",
13090
- label: "License plates",
13211
+ label: "Known plates",
13091
13212
  valueType: "plateMatcher",
13092
13213
  operator: "fuzzyIn",
13093
13214
  appliesTo: ["immediate", "track-end"],
13094
13215
  phase: "P1",
13095
- description: "Levenshtein-tolerant match against the plate text."
13216
+ description: "Only vehicles whose plate was read. Selecting NO plate means any readable plate; listed plates are matched Levenshtein-tolerantly, because OCR noise makes an exact match useless."
13096
13217
  },
13097
13218
  {
13098
13219
  id: "identitiesExclude",
13099
13220
  group: "label",
13100
- label: "Excluded identities",
13221
+ label: "Excluded faces",
13101
13222
  valueType: "stringList",
13102
13223
  operator: "notIn",
13103
13224
  appliesTo: ["immediate", "track-end"],
13104
13225
  phase: "P1",
13105
- description: "Veto by identity display name (mirror of Identities; absent label passes)."
13226
+ description: "Veto by identity (mirror of Known faces, same gallery ids). A subject nobody recognised passes — there is nothing to exclude."
13106
13227
  },
13107
13228
  {
13108
13229
  id: "minLabelConfidence",
@@ -14181,7 +14302,7 @@ var TrackEnvelopeSchema = z.object({
14181
14302
  * `snapshots[]` references — megabytes across a page of tracks. `slim`
14182
14303
  * keeps every scalar the list surfaces actually render (ids, class(es),
14183
14304
  * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
14184
- * zonesVisited, bestEventId, envelope, hasFace) and returns `positions` /
14305
+ * zonesVisited, bestEventId, envelope, hasFace, hasRider) and returns `positions` /
14185
14306
  * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
14186
14307
  * `getTrack`. Mirrors the event-store `projection` convention
14187
14308
  * (`getObjectEvents` et al.).
@@ -14333,7 +14454,21 @@ var LabelTierSchema = z.union([z.literal(1), z.literal(2)]);
14333
14454
  var LabelAttributionSchema = z.object({
14334
14455
  stepId: z.string(),
14335
14456
  modelId: z.string().optional(),
14336
- decidedAt: z.number()
14457
+ decidedAt: z.number(),
14458
+ /**
14459
+ * The GALLERY id behind a recognised tier-2 label — a face-gallery
14460
+ * `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
14461
+ *
14462
+ * The text alone is a DISPLAY NAME, and a display name is renameable: a
14463
+ * notification rule authored on "Gianluca" stopped matching the moment the
14464
+ * operator fixed the spelling in the gallery, and nothing said so. The id is
14465
+ * the thing that does not move, so it is what a rule matches on
14466
+ * (`NcConditions.identities`) and the text is what a human is shown.
14467
+ *
14468
+ * Absent when the label names no gallery row — a plate the OCR read but no
14469
+ * vehicle claims, a sub-class, a species, any tier-1 value.
14470
+ */
14471
+ identityId: z.string().optional()
14337
14472
  });
14338
14473
  /**
14339
14474
  * The TIERED label model (roadmap 4g), spread into `TrackSchema` and
@@ -14470,6 +14605,28 @@ var TrackSchema = z.object({
14470
14605
  * `=== true` and render nothing otherwise, never infer "no face".
14471
14606
  */
14472
14607
  hasFace: z.boolean().optional(),
14608
+ /**
14609
+ * This subject CONTAINS a folded rider — a person the rider-pairing step
14610
+ * ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
14611
+ * so the passage is tracked once and as a VEHICLE.
14612
+ *
14613
+ * It exists because the fold's record was dishonest. D34 and the code both
14614
+ * said "the person is not lost — it is reported so both entities stay on the
14615
+ * record"; in fact the pair went into a per-processor RAM field behind an
14616
+ * accessor nobody called, and every durable surface said `vehicle`, full
14617
+ * stop. This is the composition note that makes the row true.
14618
+ *
14619
+ * A COMPOSITION, never a class and never a label. "This vehicle contains a
14620
+ * person" is not an answer to "what is this" — both label tiers would refuse
14621
+ * a macro token anyway (D89), and correctly. Nothing here changes what the
14622
+ * subject IS: a cyclist stays one vehicle track, occupancy still counts one,
14623
+ * and a `person` rule still does not fire for someone cycling past.
14624
+ *
14625
+ * **Absent ≠ false**, exactly like {@link hasFace}: every row written before
14626
+ * the column, and every hub that predates the field, omits it. Test
14627
+ * `=== true` and render nothing otherwise — never infer "no rider".
14628
+ */
14629
+ hasRider: z.boolean().optional(),
14473
14630
  ...TrackFlagFields,
14474
14631
  ...TrackRetrainFields
14475
14632
  });
@@ -890,6 +890,22 @@ export interface EventCatalog {
890
890
  'pipeline.camera-assigned': PipelineCameraAssignmentPayload;
891
891
  /** Camera released from an agent runner. */
892
892
  'pipeline.camera-unassigned': PipelineCameraAssignmentPayload;
893
+ /** A node whose every ENABLED inference device is unavailable — dropped from
894
+ * the placement candidate set until one comes back. */
895
+ 'pipeline.node-inference-unavailable': {
896
+ readonly nodeId: string;
897
+ /** The enabled device keys the live probe did not report. */
898
+ readonly unavailableDeviceKeys: readonly string[];
899
+ };
900
+ /** A camera with an open detection session that has detected nothing for
901
+ * longer than the blind threshold. */
902
+ 'pipeline.detection-blind': {
903
+ readonly deviceId: number;
904
+ /** How long it has been blind, in ms. */
905
+ readonly blindForMs: number;
906
+ /** The threshold that was crossed, in ms. */
907
+ readonly thresholdMs: number;
908
+ };
893
909
  /** Per-camera pipeline config changed — orchestrator hot-reloads the assigned runner. */
894
910
  'pipeline.camera-updated': {
895
911
  readonly deviceId: number;
@@ -1,4 +1,4 @@
1
- import { t as EventCategory } from "./event-category-Cv9dO26A.mjs";
1
+ import { t as EventCategory } from "./event-category-Bxo5yJjt.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/interfaces/config-ui.ts
4
4
  /** Predefined tabs with standard label, icon, and sort order.
@@ -1,4 +1,4 @@
1
- const require_event_category = require("./event-category-DxZbWydC.js");
1
+ const require_event_category = require("./event-category-D3gG7oil.js");
2
2
  let zod = require("zod");
3
3
  //#region src/interfaces/config-ui.ts
4
4
  /** Predefined tabs with standard label, icon, and sort order.