@camstack/addon-provider-hikvision 1.2.21 → 1.2.22

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.
package/README.md CHANGED
@@ -35,4 +35,4 @@ The probe runs once per camera lifetime (after the first successful `publishToBr
35
35
  ## References
36
36
 
37
37
  - ISAPI Service v2 & v3 specs (Hikvision ISAPI doc package — vendor download).
38
- - Scrypted Hikvision plugin — `/Users/gianlucaruocco/Documents/Git/scrypted/plugins/hikvision/src/` (port reference for endpoint patterns + alarm-stream parsing).
38
+ - Scrypted Hikvision plugin — `plugins/hikvision/src/` in the [Scrypted](https://github.com/koush/scrypted) repository (port reference for endpoint patterns + alarm-stream parsing).
package/dist/addon.js CHANGED
@@ -6,7 +6,7 @@ let node_crypto = require("node:crypto");
6
6
  let node_http = require("node:http");
7
7
  let node_https = require("node:https");
8
8
  let node_os = require("node:os");
9
- //#region ../types/dist/event-category-Cv9dO26A.mjs
9
+ //#region ../types/dist/event-category-Bxo5yJjt.mjs
10
10
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
11
11
  EventCategory["SystemBoot"] = "system.boot";
12
12
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -213,6 +213,33 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
213
213
  EventCategory["PipelineCameraAssigned"] = "pipeline.camera-assigned";
214
214
  EventCategory["PipelineCameraUnassigned"] = "pipeline.camera-unassigned";
215
215
  /**
216
+ * A node the orchestrator would otherwise place cameras on has NO usable
217
+ * inference device: the operator enabled one or more accelerators there and
218
+ * the live probe reports every one of them unavailable. Emitted once per
219
+ * TRANSITION into that state (never per dispatch), and the node is dropped
220
+ * from the placement candidate set for as long as it holds.
221
+ *
222
+ * This exists because the state was previously invisible: little-unraid
223
+ * absorbed 283k inference errors in a day while still being handed cameras,
224
+ * and nothing in the system said so.
225
+ *
226
+ * A node with no accelerators configured at all is NOT this — its devices
227
+ * are `disabled`, not `unavailable`, and the runner's default CPU pool
228
+ * serves it exactly as before.
229
+ */
230
+ EventCategory["PipelineNodeInferenceUnavailable"] = "pipeline.node-inference-unavailable";
231
+ /**
232
+ * A camera has an OPEN detection session and has produced no detection at
233
+ * all for longer than the blind threshold — the camera is being decoded and
234
+ * inferred and is returning nothing. Emitted once per transition into blind,
235
+ * per camera.
236
+ *
237
+ * The failure it reports: a 1h43 detection blackout on the entrance camera
238
+ * that nobody noticed, because "a camera that detects nothing" and "a quiet
239
+ * camera" produce byte-identical silence.
240
+ */
241
+ EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
242
+ /**
216
243
  * Per-camera pipeline config was mutated by the orchestrator
217
244
  * (3-level settings change via `setAgentAddonDefaults` /
218
245
  * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
@@ -5377,6 +5404,12 @@ Object.fromEntries([
5377
5404
  icon: "shapes",
5378
5405
  order: 38
5379
5406
  },
5407
+ {
5408
+ id: "scenes",
5409
+ label: "Scenes",
5410
+ icon: "scan-eye",
5411
+ order: 36
5412
+ },
5380
5413
  {
5381
5414
  id: "analytics",
5382
5415
  label: "Analytics",
@@ -14485,6 +14518,8 @@ var NcSystemEventKindSchema = _enum([
14485
14518
  "stream-offline",
14486
14519
  "node-online",
14487
14520
  "node-offline",
14521
+ "node-inference-unavailable",
14522
+ "detection-blind",
14488
14523
  "addon-update-available",
14489
14524
  "server-update-available",
14490
14525
  "alarm-triggered",
@@ -14546,7 +14581,16 @@ var NcScheduleSchema = object({
14546
14581
  });
14547
14582
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
14548
14583
  var NcPlateMatcherSchema = object({
14549
- values: array(string().min(1)).min(1),
14584
+ /**
14585
+ * Plate texts (or gallery vehicle names) to match. EMPTY = **any plate the
14586
+ * pipeline could read** — the plate half of "no selection = no narrowing",
14587
+ * and the switch that says this rule is about vehicles that were IDENTIFIED
14588
+ * rather than merely seen. A subject carrying no plate still fails.
14589
+ *
14590
+ * The `.min(1)` this used to carry made that state unauthorable; nothing has
14591
+ * ever persisted an empty list, so widening it cannot change an existing rule.
14592
+ */
14593
+ values: array(string().min(1)),
14550
14594
  /** Max Levenshtein distance after normalization (uppercase alphanumeric). */
14551
14595
  maxDistance: number().int().min(0).max(3).default(1)
14552
14596
  });
@@ -14785,18 +14829,47 @@ var NcConditionsSchema = object({
14785
14829
  */
14786
14830
  labelEquals: array(string().min(1)).optional(),
14787
14831
  /**
14788
- * Identity matcher. P1 boundary: matched against the record's collapsed
14789
- * `label` (the identity display name propagated by the face pipeline) —
14790
- * identity-ID matching rides in P2 when identity ids reach the record.
14832
+ * KNOWN FACES the rule's identity scope, and the switch that says the rule
14833
+ * is about recognised people at all.
14834
+ *
14835
+ * Three states, and the empty one is the point:
14836
+ *
14837
+ * | value | meaning |
14838
+ * | --- | --- |
14839
+ * | absent | the rule does not care who it is; an unrecognised person matches |
14840
+ * | `[]` | **only known faces** — any identity in the gallery, nobody in particular |
14841
+ * | a list | only these identities |
14842
+ *
14843
+ * `[]` is the repo-wide "no selection = no narrowing" reading (an absent
14844
+ * `devices` list is every device), applied one level down: the operator has
14845
+ * turned the face scope ON and narrowed it to nothing, which is every known
14846
+ * face. No second field states the same thing — a switch that can disagree
14847
+ * with the list under it is worse than no switch (D62).
14848
+ *
14849
+ * MEMBERS ARE FACE-GALLERY `Identity.id`s (uuid), not display names. A name is
14850
+ * renameable, and a rule authored on "Gianluca" went silently dark the moment
14851
+ * the operator fixed the spelling. The id reaches the record on
14852
+ * `LabelAttribution.identityId`; the name is what the editor shows and what
14853
+ * `{{label}}` renders.
14854
+ *
14855
+ * Rules written before this carry NAMES, and are resolved to ids lazily at
14856
+ * load (`NcRuleStore.load`) against the live gallery — a name nothing answers
14857
+ * for is left as it stands and reported, never dropped. The engine also
14858
+ * accepts a display-name hit as a compatibility leg, so a rule whose
14859
+ * migration could not resolve keeps matching exactly what it matched before.
14791
14860
  */
14792
14861
  identities: array(string().min(1)).optional(),
14793
- /** Fuzzy plate matcher against the record's `label` (plate text). */
14862
+ /**
14863
+ * KNOWN PLATES / VEHICLES — the plate mirror of {@link identities}, including
14864
+ * the empty-list reading: `values: []` is "any plate the OCR could read",
14865
+ * a non-empty list is those plates (fuzzily). See {@link NcPlateMatcherSchema}.
14866
+ */
14794
14867
  plates: NcPlateMatcherSchema.optional(),
14795
14868
  /**
14796
- * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics.
14797
- * Same P1 boundary: matched against the record's collapsed `label` (the
14798
- * identity display name). A record with NO label passes (nothing to
14799
- * exclude), unlike the include variant which fails on an absent label.
14869
+ * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics, and
14870
+ * the same id members and the same lazy name→id migration. A record with NO
14871
+ * identity passes (nothing to exclude), unlike the include variant which
14872
+ * fails on an unrecognised subject. An EMPTY list excludes nobody.
14800
14873
  */
14801
14874
  identitiesExclude: array(string().min(1)).optional(),
14802
14875
  /**
@@ -15188,7 +15261,80 @@ var NcRuleInputSchema = object({
15188
15261
  * a rule that predates the gate must keep delivering byte-for-byte as it
15189
15262
  * did, and absent is the only way to say that without a migration.
15190
15263
  */
15191
- confirm: NcConfirmSchema.optional()
15264
+ confirm: NcConfirmSchema.optional(),
15265
+ /**
15266
+ * WAIT for face/plate recognition before saying anything.
15267
+ *
15268
+ * A notification's TEXT is frozen at enqueue and its media is re-resolved at
15269
+ * send; the identity is neither. A face is confirmed after `confirmFrames`
15270
+ * agreeing observations — p50 **11.4 s** after the track was first seen,
15271
+ * measured on this hub — and an `immediate` rule enqueues on the first object
15272
+ * event, seconds before that. So "Gianluca è arrivato" is unsayable on the
15273
+ * immediate path, and no amount of media re-resolution fixes a sentence.
15274
+ *
15275
+ * Only two honest answers exist, and this flag picks between them. It has
15276
+ * effect ONLY on a rule that declares a recognition scope
15277
+ * ({@link NcConditions.identities} or {@link NcConditions.plates}) — on any
15278
+ * other rule there is nothing to wait for and the flag is inert.
15279
+ *
15280
+ * | value | what happens |
15281
+ * | --- | --- |
15282
+ * | `true` | the rule stops firing on the object event and fires at TRACK CLOSE instead, once, with the name — later, and complete |
15283
+ * | 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) |
15284
+ *
15285
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
15286
+ * on the addon cap path, and absent has to keep meaning exactly what every
15287
+ * rule authored before this field meant.
15288
+ *
15289
+ * The cost of `true` is stated here because the editor states it too: a rule
15290
+ * that waits also inherits track-close SEMANTICS — its `zones` condition
15291
+ * tests every zone the track visited and a `crossing` condition can no longer
15292
+ * be satisfied, because a closed track carries no crossing.
15293
+ */
15294
+ waitForEnhancement: boolean().optional(),
15295
+ /**
15296
+ * GROUP a burst of subjects into ONE notification that grows.
15297
+ *
15298
+ * Seconds of quiet after the last matching subject before the burst is
15299
+ * considered over. While it is open, the first subject enqueues immediately —
15300
+ * **exactly as today, with no added latency** — and every real growth (a new
15301
+ * subject, or a name confirmed on one already in it) REPLACES that
15302
+ * notification with an updated one naming everybody. The push carries the
15303
+ * group's own coalescing tag, so the phone replaces rather than stacks.
15304
+ *
15305
+ * `0` / absent = off, and off is today's behaviour byte for byte.
15306
+ *
15307
+ * ### Why an idle cutoff and not a window
15308
+ *
15309
+ * The measured seven-person arrival on device 590 spans 110 s with every
15310
+ * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
15311
+ * idle cutoff holds it as one and ends it when the arrival actually ends.
15312
+ * 30 is Frigate's shipped value for the same decision.
15313
+ *
15314
+ * ### What it replaces
15315
+ *
15316
+ * The blind cooldown, which collapses a burst by DISCARDING it. Measured on
15317
+ * device 615 / *Persona su Uscio* over six days: 116 qualifying tracks → 74
15318
+ * notifications, **44 (37.9%) suppressed outright**, 23 of them overlapping a
15319
+ * track that did fire and 7 carrying a confirmed identity nobody heard about.
15320
+ * A group collapses the same volume by MERGING, so the cooldown becomes a
15321
+ * budget over GROUPS — which is what it always meant — and a growth is never
15322
+ * throttled by the window its own first member spent.
15323
+ *
15324
+ * ### Interaction with {@link waitForEnhancement}
15325
+ *
15326
+ * They compose, and the order matters. `waitForEnhancement` defers the rule to
15327
+ * TRACK CLOSE, so with both set the group is opened by the first member to
15328
+ * CLOSE — already carrying its name — and grows as later members close. That
15329
+ * is later, and complete. With grouping alone the group opens on the first
15330
+ * object event and picks up names as they are confirmed, through the growth
15331
+ * path. Neither combination fires twice for one subject.
15332
+ *
15333
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
15334
+ * on the addon cap path, so absent must keep meaning what it meant before this
15335
+ * field existed.
15336
+ */
15337
+ groupIdleSec: number().int().min(0).max(600).optional()
15192
15338
  });
15193
15339
  /**
15194
15340
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -16114,7 +16260,7 @@ var TrackEnvelopeSchema = object({
16114
16260
  * `snapshots[]` references — megabytes across a page of tracks. `slim`
16115
16261
  * keeps every scalar the list surfaces actually render (ids, class(es),
16116
16262
  * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
16117
- * zonesVisited, bestEventId, envelope, hasFace) and returns `positions` /
16263
+ * zonesVisited, bestEventId, envelope, hasFace, hasRider) and returns `positions` /
16118
16264
  * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
16119
16265
  * `getTrack`. Mirrors the event-store `projection` convention
16120
16266
  * (`getObjectEvents` et al.).
@@ -16250,7 +16396,21 @@ union([literal(1), literal(2)]);
16250
16396
  var LabelAttributionSchema = object({
16251
16397
  stepId: string(),
16252
16398
  modelId: string().optional(),
16253
- decidedAt: number()
16399
+ decidedAt: number(),
16400
+ /**
16401
+ * The GALLERY id behind a recognised tier-2 label — a face-gallery
16402
+ * `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
16403
+ *
16404
+ * The text alone is a DISPLAY NAME, and a display name is renameable: a
16405
+ * notification rule authored on "Gianluca" stopped matching the moment the
16406
+ * operator fixed the spelling in the gallery, and nothing said so. The id is
16407
+ * the thing that does not move, so it is what a rule matches on
16408
+ * (`NcConditions.identities`) and the text is what a human is shown.
16409
+ *
16410
+ * Absent when the label names no gallery row — a plate the OCR read but no
16411
+ * vehicle claims, a sub-class, a species, any tier-1 value.
16412
+ */
16413
+ identityId: string().optional()
16254
16414
  });
16255
16415
  /**
16256
16416
  * The TIERED label model (roadmap 4g), spread into `TrackSchema` and
@@ -16387,6 +16547,28 @@ var TrackSchema = object({
16387
16547
  * `=== true` and render nothing otherwise, never infer "no face".
16388
16548
  */
16389
16549
  hasFace: boolean().optional(),
16550
+ /**
16551
+ * This subject CONTAINS a folded rider — a person the rider-pairing step
16552
+ * ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
16553
+ * so the passage is tracked once and as a VEHICLE.
16554
+ *
16555
+ * It exists because the fold's record was dishonest. D34 and the code both
16556
+ * said "the person is not lost — it is reported so both entities stay on the
16557
+ * record"; in fact the pair went into a per-processor RAM field behind an
16558
+ * accessor nobody called, and every durable surface said `vehicle`, full
16559
+ * stop. This is the composition note that makes the row true.
16560
+ *
16561
+ * A COMPOSITION, never a class and never a label. "This vehicle contains a
16562
+ * person" is not an answer to "what is this" — both label tiers would refuse
16563
+ * a macro token anyway (D89), and correctly. Nothing here changes what the
16564
+ * subject IS: a cyclist stays one vehicle track, occupancy still counts one,
16565
+ * and a `person` rule still does not fire for someone cycling past.
16566
+ *
16567
+ * **Absent ≠ false**, exactly like {@link hasFace}: every row written before
16568
+ * the column, and every hub that predates the field, omits it. Test
16569
+ * `=== true` and render nothing otherwise — never infer "no rider".
16570
+ */
16571
+ hasRider: boolean().optional(),
16390
16572
  ...TrackFlagFields,
16391
16573
  ...TrackRetrainFields
16392
16574
  });
@@ -26394,9 +26576,33 @@ method(object({
26394
26576
  * settings-contribution methods. `status.kind:'push'` — the engine pushes on
26395
26577
  * every hysteresis flip / availability change; consumers never poll.
26396
26578
  */
26397
- /** Extensible condition tag. Seeded 'day' | 'night'; open by design so more can
26398
- * be added without a wire break (matching falls back to any-condition refs). */
26579
+ /** Extensible condition tag. Seeded 'day' | 'ir' (the two variants the operator
26580
+ * captures) plus 'night' | 'dawn' | 'dusk' from the resolver's sun-times band.
26581
+ * Open by design so more can be added without a wire break.
26582
+ *
26583
+ * Matching does NOT fall back across conditions: cross-condition cosines are
26584
+ * not comparable, so "I have never seen this scene in this light" is reported
26585
+ * as `unknown`, never guessed. A day reference scored against an IR frame
26586
+ * collapses the cosine and would latch a false alarm every single night. */
26399
26587
  var SceneConditionSchema = string();
26588
+ /** `matched` = the baseline is what we see; `diverged` = it demonstrably is not;
26589
+ * `unknown` = we cannot judge (no reference for this condition, encoder model
26590
+ * changed, view shifted, no snapshot). `unknown` is a real value, not a null,
26591
+ * and never counts toward hysteresis in either direction. */
26592
+ var SceneVerdictSchema = _enum([
26593
+ "matched",
26594
+ "diverged",
26595
+ "unknown"
26596
+ ]);
26597
+ /** Why a scene cannot judge. Named, because this feature's failure mode is
26598
+ * silence that reads as "nothing has happened". */
26599
+ var SceneUnavailableSchema = _enum([
26600
+ "no-reference-for-condition",
26601
+ "view-shifted",
26602
+ "no-vision-profile",
26603
+ "encoder-model-changed",
26604
+ "no-snapshot"
26605
+ ]);
26400
26606
  /** One captured reference — condition-tagged, model-version-gated. `embedding`
26401
26607
  * is `number[]` (Float32Array does NOT survive MsgPack/UDS). */
26402
26608
  var SceneReferenceSchema = object({
@@ -26404,7 +26610,14 @@ var SceneReferenceSchema = object({
26404
26610
  modelId: string(),
26405
26611
  condition: SceneConditionSchema,
26406
26612
  capturedAt: number(),
26407
- thumbnailMediaId: string().optional()
26613
+ thumbnailMediaId: string().optional(),
26614
+ /** Whole-frame (downscaled) embedding captured alongside the ROI crop. The
26615
+ * anti-view-shift anchor: a bumped camera, a PTZ preset or a re-aim makes the
26616
+ * normalized rect frame a different piece of world, and the scene would
26617
+ * diverge forever with a perfectly plausible cosine. Checked LAZILY, only
26618
+ * when hysteresis is about to flip — one extra encode per candidate
26619
+ * transition, not per poll. */
26620
+ anchorEmbedding: array(number()).optional()
26408
26621
  });
26409
26622
  var SceneMonitorStateSchema = object({
26410
26623
  id: string(),
@@ -26426,6 +26639,25 @@ var SceneCheckSchema = discriminatedUnion("mode", [object({
26426
26639
  profileId: string().optional(),
26427
26640
  hysteresisCount: number().int().positive()
26428
26641
  })]);
26642
+ var SCENE_DEFAULT_ANCHOR_THRESHOLD = .85;
26643
+ /**
26644
+ * Vision-model adjudication of a candidate flip. Field names deliberately
26645
+ * mirror `NcConfirmSchema` so an operator meets one vocabulary, not two.
26646
+ *
26647
+ * `onTimeout` defaults to **'hold'**, the OPPOSITE of `NcConfirmGate`'s
26648
+ * fail-open: a notification suppressed is the worse error there, but a vision
26649
+ * model that timed out has not told us the bin is gone, and a latch is a
26650
+ * stateful claim that costs the operator a trip to reset.
26651
+ */
26652
+ var SceneConfirmSchema = object({
26653
+ enabled: boolean().default(false),
26654
+ prompt: string().min(1).max(1e3),
26655
+ profileId: string().optional(),
26656
+ timeoutMs: number().int().min(1e3).max(2e4).default(8e3),
26657
+ maxImagePx: number().int().min(64).max(2048).default(448),
26658
+ /** What a timeout / unavailable model means for the PENDING flip. */
26659
+ onTimeout: _enum(["flip", "hold"]).default("hold")
26660
+ });
26429
26661
  var SceneMonitorSchema = object({
26430
26662
  id: string(),
26431
26663
  label: string(),
@@ -26444,7 +26676,41 @@ var SceneMonitorSchema = object({
26444
26676
  lastConfidence: number().nullable(),
26445
26677
  currentCondition: SceneConditionSchema.nullable(),
26446
26678
  availability: _enum(["ok", "unavailable"]),
26447
- unavailableReason: string().nullable()
26679
+ unavailableReason: string().nullable(),
26680
+ /** Which state is "the initial screen". `null` until the first capture. */
26681
+ baselineStateId: string().nullable(),
26682
+ /** Which boolean drives notification rules and any export. */
26683
+ emit: _enum(["latched", "live"]).default("latched"),
26684
+ /** Live: does the region match the baseline RIGHT NOW. */
26685
+ verdict: SceneVerdictSchema,
26686
+ /** Has it been `diverged` at least once since `armedAt` — the operator's boolean. */
26687
+ latched: boolean(),
26688
+ /** Last reset (or creation). */
26689
+ armedAt: number(),
26690
+ divergedAt: number().nullable(),
26691
+ restoredAt: number().nullable(),
26692
+ /** A check is only COUNTED when the device has been quiet this long. Motion
26693
+ * during the window DISCARDS the observation — a car pulling up in front of
26694
+ * the bin must not be able to spend hysteresis credit. */
26695
+ quietSeconds: number().int().min(0).max(3600).default(60),
26696
+ /** An observation only advances the pending count when it is at least this
26697
+ * far from the previously counted one, so N agreeing checks span real time
26698
+ * rather than N adjacent polls inside one occlusion. */
26699
+ minObservationSpacingSec: number().int().min(0).max(3600).default(120),
26700
+ /** Vision-model adjudication of a candidate flip. Similarity primary only. */
26701
+ confirm: SceneConfirmSchema.optional(),
26702
+ /** Whole-frame anchor cosine below which a flip is REFUSED as `view-shifted`. */
26703
+ anchorThreshold: number().min(0).max(1).default(SCENE_DEFAULT_ANCHOR_THRESHOLD),
26704
+ /** Clear the latch on its own when the scene matches again? Default false —
26705
+ * `restoredAt` and the `scene-restored` edge are recorded regardless, so an
26706
+ * automation can react to the bin coming back without the operator's own
26707
+ * alarm silently clearing itself. */
26708
+ autoRestore: boolean().default(false),
26709
+ /** Named cause when `verdict === 'unknown'`. */
26710
+ unavailable: SceneUnavailableSchema.nullable(),
26711
+ /** Conditions that have at least one comparable reference — the coverage line
26712
+ * ("day ✓ · ir ✓ · dusk ✗") that turns a silent fallback into a visible fact. */
26713
+ coveredConditions: array(SceneConditionSchema)
26448
26714
  });
26449
26715
  var SceneMonitorStatusSchema = object({
26450
26716
  monitors: array(SceneMonitorSchema),
@@ -26493,7 +26759,14 @@ var sceneMonitorCapability = {
26493
26759
  "both"
26494
26760
  ]).optional(),
26495
26761
  checkIntervalSec: number().optional(),
26496
- check: SceneCheckSchema.optional()
26762
+ check: SceneCheckSchema.optional(),
26763
+ emit: _enum(["latched", "live"]).optional(),
26764
+ quietSeconds: number().int().min(0).max(3600).optional(),
26765
+ minObservationSpacingSec: number().int().min(0).max(3600).optional(),
26766
+ anchorThreshold: number().min(0).max(1).optional(),
26767
+ autoRestore: boolean().optional(),
26768
+ /** `null` clears the vision-model adjudicator. */
26769
+ confirm: SceneConfirmSchema.nullable().optional()
26497
26770
  })
26498
26771
  }), _void(), {
26499
26772
  kind: "mutation",
@@ -26534,6 +26807,26 @@ var sceneMonitorCapability = {
26534
26807
  }), _void(), {
26535
26808
  kind: "mutation",
26536
26809
  auth: "admin"
26810
+ }),
26811
+ /**
26812
+ * Clear the latch, re-arm, and — by default — RE-CAPTURE the baseline for
26813
+ * the CURRENT condition. The bin never goes back in exactly the same spot;
26814
+ * "reset" in the operator's head means *this is the new normal*, and
26815
+ * re-capture is what makes the feature self-healing against slow drift
26816
+ * instead of failing silently weeks later.
26817
+ *
26818
+ * Reachable from three surfaces on this one mutation: the scene card, a
26819
+ * notification button (an `onTrigger` sequence with a `kind:'cap'` step —
26820
+ * no new Notification-Center code at all), and tRPC for scripts.
26821
+ */
26822
+ resetScene: method(object({
26823
+ deviceId: number(),
26824
+ monitorId: string(),
26825
+ /** Defaults to TRUE at the provider seam — see `SCENE_RESET_RECAPTURES`. */
26826
+ recapture: boolean().optional()
26827
+ }), _void(), {
26828
+ kind: "mutation",
26829
+ auth: "admin"
26537
26830
  })
26538
26831
  },
26539
26832
  status: {
@@ -33772,6 +34065,12 @@ Object.freeze({
33772
34065
  addonId: null,
33773
34066
  access: "create"
33774
34067
  },
34068
+ "sceneMonitor.resetScene": {
34069
+ capName: "scene-monitor",
34070
+ capScope: "device",
34071
+ addonId: null,
34072
+ access: "delete"
34073
+ },
33775
34074
  "sceneMonitor.updateScene": {
33776
34075
  capName: "scene-monitor",
33777
34076
  capScope: "device",
@@ -36454,6 +36753,11 @@ Object.freeze({
36454
36753
  form: "single",
36455
36754
  optional: false
36456
36755
  }],
36756
+ "sceneMonitor.resetScene": [{
36757
+ name: "deviceId",
36758
+ form: "single",
36759
+ optional: false
36760
+ }],
36457
36761
  "sceneMonitor.updateScene": [{
36458
36762
  name: "deviceId",
36459
36763
  form: "single",
package/dist/addon.mjs CHANGED
@@ -7,7 +7,7 @@ import { networkInterfaces } from "node:os";
7
7
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
8
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
9
9
  //#endregion
10
- //#region ../types/dist/event-category-Cv9dO26A.mjs
10
+ //#region ../types/dist/event-category-Bxo5yJjt.mjs
11
11
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
12
12
  EventCategory["SystemBoot"] = "system.boot";
13
13
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -214,6 +214,33 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
214
214
  EventCategory["PipelineCameraAssigned"] = "pipeline.camera-assigned";
215
215
  EventCategory["PipelineCameraUnassigned"] = "pipeline.camera-unassigned";
216
216
  /**
217
+ * A node the orchestrator would otherwise place cameras on has NO usable
218
+ * inference device: the operator enabled one or more accelerators there and
219
+ * the live probe reports every one of them unavailable. Emitted once per
220
+ * TRANSITION into that state (never per dispatch), and the node is dropped
221
+ * from the placement candidate set for as long as it holds.
222
+ *
223
+ * This exists because the state was previously invisible: little-unraid
224
+ * absorbed 283k inference errors in a day while still being handed cameras,
225
+ * and nothing in the system said so.
226
+ *
227
+ * A node with no accelerators configured at all is NOT this — its devices
228
+ * are `disabled`, not `unavailable`, and the runner's default CPU pool
229
+ * serves it exactly as before.
230
+ */
231
+ EventCategory["PipelineNodeInferenceUnavailable"] = "pipeline.node-inference-unavailable";
232
+ /**
233
+ * A camera has an OPEN detection session and has produced no detection at
234
+ * all for longer than the blind threshold — the camera is being decoded and
235
+ * inferred and is returning nothing. Emitted once per transition into blind,
236
+ * per camera.
237
+ *
238
+ * The failure it reports: a 1h43 detection blackout on the entrance camera
239
+ * that nobody noticed, because "a camera that detects nothing" and "a quiet
240
+ * camera" produce byte-identical silence.
241
+ */
242
+ EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
243
+ /**
217
244
  * Per-camera pipeline config was mutated by the orchestrator
218
245
  * (3-level settings change via `setAgentAddonDefaults` /
219
246
  * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
@@ -5378,6 +5405,12 @@ Object.fromEntries([
5378
5405
  icon: "shapes",
5379
5406
  order: 38
5380
5407
  },
5408
+ {
5409
+ id: "scenes",
5410
+ label: "Scenes",
5411
+ icon: "scan-eye",
5412
+ order: 36
5413
+ },
5381
5414
  {
5382
5415
  id: "analytics",
5383
5416
  label: "Analytics",
@@ -14486,6 +14519,8 @@ var NcSystemEventKindSchema = _enum([
14486
14519
  "stream-offline",
14487
14520
  "node-online",
14488
14521
  "node-offline",
14522
+ "node-inference-unavailable",
14523
+ "detection-blind",
14489
14524
  "addon-update-available",
14490
14525
  "server-update-available",
14491
14526
  "alarm-triggered",
@@ -14547,7 +14582,16 @@ var NcScheduleSchema = object({
14547
14582
  });
14548
14583
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
14549
14584
  var NcPlateMatcherSchema = object({
14550
- values: array(string().min(1)).min(1),
14585
+ /**
14586
+ * Plate texts (or gallery vehicle names) to match. EMPTY = **any plate the
14587
+ * pipeline could read** — the plate half of "no selection = no narrowing",
14588
+ * and the switch that says this rule is about vehicles that were IDENTIFIED
14589
+ * rather than merely seen. A subject carrying no plate still fails.
14590
+ *
14591
+ * The `.min(1)` this used to carry made that state unauthorable; nothing has
14592
+ * ever persisted an empty list, so widening it cannot change an existing rule.
14593
+ */
14594
+ values: array(string().min(1)),
14551
14595
  /** Max Levenshtein distance after normalization (uppercase alphanumeric). */
14552
14596
  maxDistance: number().int().min(0).max(3).default(1)
14553
14597
  });
@@ -14786,18 +14830,47 @@ var NcConditionsSchema = object({
14786
14830
  */
14787
14831
  labelEquals: array(string().min(1)).optional(),
14788
14832
  /**
14789
- * Identity matcher. P1 boundary: matched against the record's collapsed
14790
- * `label` (the identity display name propagated by the face pipeline) —
14791
- * identity-ID matching rides in P2 when identity ids reach the record.
14833
+ * KNOWN FACES the rule's identity scope, and the switch that says the rule
14834
+ * is about recognised people at all.
14835
+ *
14836
+ * Three states, and the empty one is the point:
14837
+ *
14838
+ * | value | meaning |
14839
+ * | --- | --- |
14840
+ * | absent | the rule does not care who it is; an unrecognised person matches |
14841
+ * | `[]` | **only known faces** — any identity in the gallery, nobody in particular |
14842
+ * | a list | only these identities |
14843
+ *
14844
+ * `[]` is the repo-wide "no selection = no narrowing" reading (an absent
14845
+ * `devices` list is every device), applied one level down: the operator has
14846
+ * turned the face scope ON and narrowed it to nothing, which is every known
14847
+ * face. No second field states the same thing — a switch that can disagree
14848
+ * with the list under it is worse than no switch (D62).
14849
+ *
14850
+ * MEMBERS ARE FACE-GALLERY `Identity.id`s (uuid), not display names. A name is
14851
+ * renameable, and a rule authored on "Gianluca" went silently dark the moment
14852
+ * the operator fixed the spelling. The id reaches the record on
14853
+ * `LabelAttribution.identityId`; the name is what the editor shows and what
14854
+ * `{{label}}` renders.
14855
+ *
14856
+ * Rules written before this carry NAMES, and are resolved to ids lazily at
14857
+ * load (`NcRuleStore.load`) against the live gallery — a name nothing answers
14858
+ * for is left as it stands and reported, never dropped. The engine also
14859
+ * accepts a display-name hit as a compatibility leg, so a rule whose
14860
+ * migration could not resolve keeps matching exactly what it matched before.
14792
14861
  */
14793
14862
  identities: array(string().min(1)).optional(),
14794
- /** Fuzzy plate matcher against the record's `label` (plate text). */
14863
+ /**
14864
+ * KNOWN PLATES / VEHICLES — the plate mirror of {@link identities}, including
14865
+ * the empty-list reading: `values: []` is "any plate the OCR could read",
14866
+ * a non-empty list is those plates (fuzzily). See {@link NcPlateMatcherSchema}.
14867
+ */
14795
14868
  plates: NcPlateMatcherSchema.optional(),
14796
14869
  /**
14797
- * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics.
14798
- * Same P1 boundary: matched against the record's collapsed `label` (the
14799
- * identity display name). A record with NO label passes (nothing to
14800
- * exclude), unlike the include variant which fails on an absent label.
14870
+ * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics, and
14871
+ * the same id members and the same lazy name→id migration. A record with NO
14872
+ * identity passes (nothing to exclude), unlike the include variant which
14873
+ * fails on an unrecognised subject. An EMPTY list excludes nobody.
14801
14874
  */
14802
14875
  identitiesExclude: array(string().min(1)).optional(),
14803
14876
  /**
@@ -15189,7 +15262,80 @@ var NcRuleInputSchema = object({
15189
15262
  * a rule that predates the gate must keep delivering byte-for-byte as it
15190
15263
  * did, and absent is the only way to say that without a migration.
15191
15264
  */
15192
- confirm: NcConfirmSchema.optional()
15265
+ confirm: NcConfirmSchema.optional(),
15266
+ /**
15267
+ * WAIT for face/plate recognition before saying anything.
15268
+ *
15269
+ * A notification's TEXT is frozen at enqueue and its media is re-resolved at
15270
+ * send; the identity is neither. A face is confirmed after `confirmFrames`
15271
+ * agreeing observations — p50 **11.4 s** after the track was first seen,
15272
+ * measured on this hub — and an `immediate` rule enqueues on the first object
15273
+ * event, seconds before that. So "Gianluca è arrivato" is unsayable on the
15274
+ * immediate path, and no amount of media re-resolution fixes a sentence.
15275
+ *
15276
+ * Only two honest answers exist, and this flag picks between them. It has
15277
+ * effect ONLY on a rule that declares a recognition scope
15278
+ * ({@link NcConditions.identities} or {@link NcConditions.plates}) — on any
15279
+ * other rule there is nothing to wait for and the flag is inert.
15280
+ *
15281
+ * | value | what happens |
15282
+ * | --- | --- |
15283
+ * | `true` | the rule stops firing on the object event and fires at TRACK CLOSE instead, once, with the name — later, and complete |
15284
+ * | 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) |
15285
+ *
15286
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
15287
+ * on the addon cap path, and absent has to keep meaning exactly what every
15288
+ * rule authored before this field meant.
15289
+ *
15290
+ * The cost of `true` is stated here because the editor states it too: a rule
15291
+ * that waits also inherits track-close SEMANTICS — its `zones` condition
15292
+ * tests every zone the track visited and a `crossing` condition can no longer
15293
+ * be satisfied, because a closed track carries no crossing.
15294
+ */
15295
+ waitForEnhancement: boolean().optional(),
15296
+ /**
15297
+ * GROUP a burst of subjects into ONE notification that grows.
15298
+ *
15299
+ * Seconds of quiet after the last matching subject before the burst is
15300
+ * considered over. While it is open, the first subject enqueues immediately —
15301
+ * **exactly as today, with no added latency** — and every real growth (a new
15302
+ * subject, or a name confirmed on one already in it) REPLACES that
15303
+ * notification with an updated one naming everybody. The push carries the
15304
+ * group's own coalescing tag, so the phone replaces rather than stacks.
15305
+ *
15306
+ * `0` / absent = off, and off is today's behaviour byte for byte.
15307
+ *
15308
+ * ### Why an idle cutoff and not a window
15309
+ *
15310
+ * The measured seven-person arrival on device 590 spans 110 s with every
15311
+ * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
15312
+ * idle cutoff holds it as one and ends it when the arrival actually ends.
15313
+ * 30 is Frigate's shipped value for the same decision.
15314
+ *
15315
+ * ### What it replaces
15316
+ *
15317
+ * The blind cooldown, which collapses a burst by DISCARDING it. Measured on
15318
+ * device 615 / *Persona su Uscio* over six days: 116 qualifying tracks → 74
15319
+ * notifications, **44 (37.9%) suppressed outright**, 23 of them overlapping a
15320
+ * track that did fire and 7 carrying a confirmed identity nobody heard about.
15321
+ * A group collapses the same volume by MERGING, so the cooldown becomes a
15322
+ * budget over GROUPS — which is what it always meant — and a growth is never
15323
+ * throttled by the window its own first member spent.
15324
+ *
15325
+ * ### Interaction with {@link waitForEnhancement}
15326
+ *
15327
+ * They compose, and the order matters. `waitForEnhancement` defers the rule to
15328
+ * TRACK CLOSE, so with both set the group is opened by the first member to
15329
+ * CLOSE — already carrying its name — and grows as later members close. That
15330
+ * is later, and complete. With grouping alone the group opens on the first
15331
+ * object event and picks up names as they are confirmed, through the growth
15332
+ * path. Neither combination fires twice for one subject.
15333
+ *
15334
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
15335
+ * on the addon cap path, so absent must keep meaning what it meant before this
15336
+ * field existed.
15337
+ */
15338
+ groupIdleSec: number().int().min(0).max(600).optional()
15193
15339
  });
15194
15340
  /**
15195
15341
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -16115,7 +16261,7 @@ var TrackEnvelopeSchema = object({
16115
16261
  * `snapshots[]` references — megabytes across a page of tracks. `slim`
16116
16262
  * keeps every scalar the list surfaces actually render (ids, class(es),
16117
16263
  * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
16118
- * zonesVisited, bestEventId, envelope, hasFace) and returns `positions` /
16264
+ * zonesVisited, bestEventId, envelope, hasFace, hasRider) and returns `positions` /
16119
16265
  * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
16120
16266
  * `getTrack`. Mirrors the event-store `projection` convention
16121
16267
  * (`getObjectEvents` et al.).
@@ -16251,7 +16397,21 @@ union([literal(1), literal(2)]);
16251
16397
  var LabelAttributionSchema = object({
16252
16398
  stepId: string(),
16253
16399
  modelId: string().optional(),
16254
- decidedAt: number()
16400
+ decidedAt: number(),
16401
+ /**
16402
+ * The GALLERY id behind a recognised tier-2 label — a face-gallery
16403
+ * `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
16404
+ *
16405
+ * The text alone is a DISPLAY NAME, and a display name is renameable: a
16406
+ * notification rule authored on "Gianluca" stopped matching the moment the
16407
+ * operator fixed the spelling in the gallery, and nothing said so. The id is
16408
+ * the thing that does not move, so it is what a rule matches on
16409
+ * (`NcConditions.identities`) and the text is what a human is shown.
16410
+ *
16411
+ * Absent when the label names no gallery row — a plate the OCR read but no
16412
+ * vehicle claims, a sub-class, a species, any tier-1 value.
16413
+ */
16414
+ identityId: string().optional()
16255
16415
  });
16256
16416
  /**
16257
16417
  * The TIERED label model (roadmap 4g), spread into `TrackSchema` and
@@ -16388,6 +16548,28 @@ var TrackSchema = object({
16388
16548
  * `=== true` and render nothing otherwise, never infer "no face".
16389
16549
  */
16390
16550
  hasFace: boolean().optional(),
16551
+ /**
16552
+ * This subject CONTAINS a folded rider — a person the rider-pairing step
16553
+ * ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
16554
+ * so the passage is tracked once and as a VEHICLE.
16555
+ *
16556
+ * It exists because the fold's record was dishonest. D34 and the code both
16557
+ * said "the person is not lost — it is reported so both entities stay on the
16558
+ * record"; in fact the pair went into a per-processor RAM field behind an
16559
+ * accessor nobody called, and every durable surface said `vehicle`, full
16560
+ * stop. This is the composition note that makes the row true.
16561
+ *
16562
+ * A COMPOSITION, never a class and never a label. "This vehicle contains a
16563
+ * person" is not an answer to "what is this" — both label tiers would refuse
16564
+ * a macro token anyway (D89), and correctly. Nothing here changes what the
16565
+ * subject IS: a cyclist stays one vehicle track, occupancy still counts one,
16566
+ * and a `person` rule still does not fire for someone cycling past.
16567
+ *
16568
+ * **Absent ≠ false**, exactly like {@link hasFace}: every row written before
16569
+ * the column, and every hub that predates the field, omits it. Test
16570
+ * `=== true` and render nothing otherwise — never infer "no rider".
16571
+ */
16572
+ hasRider: boolean().optional(),
16391
16573
  ...TrackFlagFields,
16392
16574
  ...TrackRetrainFields
16393
16575
  });
@@ -26395,9 +26577,33 @@ method(object({
26395
26577
  * settings-contribution methods. `status.kind:'push'` — the engine pushes on
26396
26578
  * every hysteresis flip / availability change; consumers never poll.
26397
26579
  */
26398
- /** Extensible condition tag. Seeded 'day' | 'night'; open by design so more can
26399
- * be added without a wire break (matching falls back to any-condition refs). */
26580
+ /** Extensible condition tag. Seeded 'day' | 'ir' (the two variants the operator
26581
+ * captures) plus 'night' | 'dawn' | 'dusk' from the resolver's sun-times band.
26582
+ * Open by design so more can be added without a wire break.
26583
+ *
26584
+ * Matching does NOT fall back across conditions: cross-condition cosines are
26585
+ * not comparable, so "I have never seen this scene in this light" is reported
26586
+ * as `unknown`, never guessed. A day reference scored against an IR frame
26587
+ * collapses the cosine and would latch a false alarm every single night. */
26400
26588
  var SceneConditionSchema = string();
26589
+ /** `matched` = the baseline is what we see; `diverged` = it demonstrably is not;
26590
+ * `unknown` = we cannot judge (no reference for this condition, encoder model
26591
+ * changed, view shifted, no snapshot). `unknown` is a real value, not a null,
26592
+ * and never counts toward hysteresis in either direction. */
26593
+ var SceneVerdictSchema = _enum([
26594
+ "matched",
26595
+ "diverged",
26596
+ "unknown"
26597
+ ]);
26598
+ /** Why a scene cannot judge. Named, because this feature's failure mode is
26599
+ * silence that reads as "nothing has happened". */
26600
+ var SceneUnavailableSchema = _enum([
26601
+ "no-reference-for-condition",
26602
+ "view-shifted",
26603
+ "no-vision-profile",
26604
+ "encoder-model-changed",
26605
+ "no-snapshot"
26606
+ ]);
26401
26607
  /** One captured reference — condition-tagged, model-version-gated. `embedding`
26402
26608
  * is `number[]` (Float32Array does NOT survive MsgPack/UDS). */
26403
26609
  var SceneReferenceSchema = object({
@@ -26405,7 +26611,14 @@ var SceneReferenceSchema = object({
26405
26611
  modelId: string(),
26406
26612
  condition: SceneConditionSchema,
26407
26613
  capturedAt: number(),
26408
- thumbnailMediaId: string().optional()
26614
+ thumbnailMediaId: string().optional(),
26615
+ /** Whole-frame (downscaled) embedding captured alongside the ROI crop. The
26616
+ * anti-view-shift anchor: a bumped camera, a PTZ preset or a re-aim makes the
26617
+ * normalized rect frame a different piece of world, and the scene would
26618
+ * diverge forever with a perfectly plausible cosine. Checked LAZILY, only
26619
+ * when hysteresis is about to flip — one extra encode per candidate
26620
+ * transition, not per poll. */
26621
+ anchorEmbedding: array(number()).optional()
26409
26622
  });
26410
26623
  var SceneMonitorStateSchema = object({
26411
26624
  id: string(),
@@ -26427,6 +26640,25 @@ var SceneCheckSchema = discriminatedUnion("mode", [object({
26427
26640
  profileId: string().optional(),
26428
26641
  hysteresisCount: number().int().positive()
26429
26642
  })]);
26643
+ var SCENE_DEFAULT_ANCHOR_THRESHOLD = .85;
26644
+ /**
26645
+ * Vision-model adjudication of a candidate flip. Field names deliberately
26646
+ * mirror `NcConfirmSchema` so an operator meets one vocabulary, not two.
26647
+ *
26648
+ * `onTimeout` defaults to **'hold'**, the OPPOSITE of `NcConfirmGate`'s
26649
+ * fail-open: a notification suppressed is the worse error there, but a vision
26650
+ * model that timed out has not told us the bin is gone, and a latch is a
26651
+ * stateful claim that costs the operator a trip to reset.
26652
+ */
26653
+ var SceneConfirmSchema = object({
26654
+ enabled: boolean().default(false),
26655
+ prompt: string().min(1).max(1e3),
26656
+ profileId: string().optional(),
26657
+ timeoutMs: number().int().min(1e3).max(2e4).default(8e3),
26658
+ maxImagePx: number().int().min(64).max(2048).default(448),
26659
+ /** What a timeout / unavailable model means for the PENDING flip. */
26660
+ onTimeout: _enum(["flip", "hold"]).default("hold")
26661
+ });
26430
26662
  var SceneMonitorSchema = object({
26431
26663
  id: string(),
26432
26664
  label: string(),
@@ -26445,7 +26677,41 @@ var SceneMonitorSchema = object({
26445
26677
  lastConfidence: number().nullable(),
26446
26678
  currentCondition: SceneConditionSchema.nullable(),
26447
26679
  availability: _enum(["ok", "unavailable"]),
26448
- unavailableReason: string().nullable()
26680
+ unavailableReason: string().nullable(),
26681
+ /** Which state is "the initial screen". `null` until the first capture. */
26682
+ baselineStateId: string().nullable(),
26683
+ /** Which boolean drives notification rules and any export. */
26684
+ emit: _enum(["latched", "live"]).default("latched"),
26685
+ /** Live: does the region match the baseline RIGHT NOW. */
26686
+ verdict: SceneVerdictSchema,
26687
+ /** Has it been `diverged` at least once since `armedAt` — the operator's boolean. */
26688
+ latched: boolean(),
26689
+ /** Last reset (or creation). */
26690
+ armedAt: number(),
26691
+ divergedAt: number().nullable(),
26692
+ restoredAt: number().nullable(),
26693
+ /** A check is only COUNTED when the device has been quiet this long. Motion
26694
+ * during the window DISCARDS the observation — a car pulling up in front of
26695
+ * the bin must not be able to spend hysteresis credit. */
26696
+ quietSeconds: number().int().min(0).max(3600).default(60),
26697
+ /** An observation only advances the pending count when it is at least this
26698
+ * far from the previously counted one, so N agreeing checks span real time
26699
+ * rather than N adjacent polls inside one occlusion. */
26700
+ minObservationSpacingSec: number().int().min(0).max(3600).default(120),
26701
+ /** Vision-model adjudication of a candidate flip. Similarity primary only. */
26702
+ confirm: SceneConfirmSchema.optional(),
26703
+ /** Whole-frame anchor cosine below which a flip is REFUSED as `view-shifted`. */
26704
+ anchorThreshold: number().min(0).max(1).default(SCENE_DEFAULT_ANCHOR_THRESHOLD),
26705
+ /** Clear the latch on its own when the scene matches again? Default false —
26706
+ * `restoredAt` and the `scene-restored` edge are recorded regardless, so an
26707
+ * automation can react to the bin coming back without the operator's own
26708
+ * alarm silently clearing itself. */
26709
+ autoRestore: boolean().default(false),
26710
+ /** Named cause when `verdict === 'unknown'`. */
26711
+ unavailable: SceneUnavailableSchema.nullable(),
26712
+ /** Conditions that have at least one comparable reference — the coverage line
26713
+ * ("day ✓ · ir ✓ · dusk ✗") that turns a silent fallback into a visible fact. */
26714
+ coveredConditions: array(SceneConditionSchema)
26449
26715
  });
26450
26716
  var SceneMonitorStatusSchema = object({
26451
26717
  monitors: array(SceneMonitorSchema),
@@ -26494,7 +26760,14 @@ var sceneMonitorCapability = {
26494
26760
  "both"
26495
26761
  ]).optional(),
26496
26762
  checkIntervalSec: number().optional(),
26497
- check: SceneCheckSchema.optional()
26763
+ check: SceneCheckSchema.optional(),
26764
+ emit: _enum(["latched", "live"]).optional(),
26765
+ quietSeconds: number().int().min(0).max(3600).optional(),
26766
+ minObservationSpacingSec: number().int().min(0).max(3600).optional(),
26767
+ anchorThreshold: number().min(0).max(1).optional(),
26768
+ autoRestore: boolean().optional(),
26769
+ /** `null` clears the vision-model adjudicator. */
26770
+ confirm: SceneConfirmSchema.nullable().optional()
26498
26771
  })
26499
26772
  }), _void(), {
26500
26773
  kind: "mutation",
@@ -26535,6 +26808,26 @@ var sceneMonitorCapability = {
26535
26808
  }), _void(), {
26536
26809
  kind: "mutation",
26537
26810
  auth: "admin"
26811
+ }),
26812
+ /**
26813
+ * Clear the latch, re-arm, and — by default — RE-CAPTURE the baseline for
26814
+ * the CURRENT condition. The bin never goes back in exactly the same spot;
26815
+ * "reset" in the operator's head means *this is the new normal*, and
26816
+ * re-capture is what makes the feature self-healing against slow drift
26817
+ * instead of failing silently weeks later.
26818
+ *
26819
+ * Reachable from three surfaces on this one mutation: the scene card, a
26820
+ * notification button (an `onTrigger` sequence with a `kind:'cap'` step —
26821
+ * no new Notification-Center code at all), and tRPC for scripts.
26822
+ */
26823
+ resetScene: method(object({
26824
+ deviceId: number(),
26825
+ monitorId: string(),
26826
+ /** Defaults to TRUE at the provider seam — see `SCENE_RESET_RECAPTURES`. */
26827
+ recapture: boolean().optional()
26828
+ }), _void(), {
26829
+ kind: "mutation",
26830
+ auth: "admin"
26538
26831
  })
26539
26832
  },
26540
26833
  status: {
@@ -33773,6 +34066,12 @@ Object.freeze({
33773
34066
  addonId: null,
33774
34067
  access: "create"
33775
34068
  },
34069
+ "sceneMonitor.resetScene": {
34070
+ capName: "scene-monitor",
34071
+ capScope: "device",
34072
+ addonId: null,
34073
+ access: "delete"
34074
+ },
33776
34075
  "sceneMonitor.updateScene": {
33777
34076
  capName: "scene-monitor",
33778
34077
  capScope: "device",
@@ -36455,6 +36754,11 @@ Object.freeze({
36455
36754
  form: "single",
36456
36755
  optional: false
36457
36756
  }],
36757
+ "sceneMonitor.resetScene": [{
36758
+ name: "deviceId",
36759
+ form: "single",
36760
+ optional: false
36761
+ }],
36458
36762
  "sceneMonitor.updateScene": [{
36459
36763
  name: "deviceId",
36460
36764
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-hikvision",
3
- "version": "1.2.21",
3
+ "version": "1.2.22",
4
4
  "description": "Hikvision camera device provider addon for CamStack — ISAPI over HTTP(S) with digest auth (snapshot, alarm stream, RTSP discovery)",
5
5
  "keywords": [
6
6
  "camstack",