@camstack/addon-provider-hikvision 1.2.37 → 1.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +572 -61
  2. package/dist/addon.mjs +572 -61
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7521,6 +7521,66 @@ var OpsLogQueryInputSchema = object({
7521
7521
  /** Max rows returned, newest-first. */
7522
7522
  limit: number().int().min(1).max(1e3).optional()
7523
7523
  });
7524
+ var LabelDefinitionSchema = object({
7525
+ id: string(),
7526
+ name: string(),
7527
+ category: string().optional(),
7528
+ description: string().optional(),
7529
+ icon: string().optional()
7530
+ });
7531
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7532
+ var CLASS_MAP_MACRO_TARGETS = [
7533
+ "person",
7534
+ "vehicle",
7535
+ "animal",
7536
+ "package"
7537
+ ];
7538
+ /**
7539
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7540
+ * un operatore può selezionare.
7541
+ *
7542
+ * Sono le tre offerte dallo step `object-detection`
7543
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7544
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7545
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7546
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7547
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7548
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7549
+ *
7550
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7551
+ * dello step e una seconda volta come union `FirstLevelMacro`
7552
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7553
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7554
+ * successiva.
7555
+ */
7556
+ var FIRST_LEVEL_MACRO_CLASSES = [
7557
+ "person",
7558
+ "vehicle",
7559
+ "animal"
7560
+ ];
7561
+ /**
7562
+ * Wire schema for a per-model CATALOG classMap override
7563
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7564
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7565
+ * detection pipeline executor actually routes.
7566
+ *
7567
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7568
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7569
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7570
+ * enum) — the two used to share the name `ClassMapDefinition`/
7571
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7572
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7573
+ * are not: it is two different concepts colliding on a name. Keep this type
7574
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7575
+ * would either narrow every `ClassMapDefinition` consumer to the four
7576
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7577
+ * schema exists for (see the "rejects a classMap whose target is not a
7578
+ * detection macro" test in `model-catalog-schema.test.ts`).
7579
+ */
7580
+ var DetectionCatalogClassMapSchema = object({
7581
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7582
+ preserveOriginal: boolean()
7583
+ });
7524
7584
  /**
7525
7585
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7526
7586
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7543,10 +7603,55 @@ var RecordingStorageModeSchema = _enum([
7543
7603
  "events",
7544
7604
  "continuous"
7545
7605
  ]);
7606
+ /**
7607
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7608
+ * tre offerte dallo step `object-detection`, da UNA lista
7609
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7610
+ */
7611
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7612
+ /**
7613
+ * True quando `values` non ripete un elemento.
7614
+ *
7615
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7616
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7617
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7618
+ */
7619
+ var noDuplicates = (values) => new Set(values).size === values.length;
7546
7620
  /** Which detectors trigger an `events`-mode band. */
7547
7621
  var RecordingTriggersSchema = object({
7548
7622
  motion: boolean().optional(),
7549
- audioThresholdDbfs: number().optional()
7623
+ audioThresholdDbfs: number().optional(),
7624
+ /**
7625
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7626
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7627
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7628
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7629
+ *
7630
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7631
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7632
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7633
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7634
+ * finestre — vedi `recorder/object-trigger.ts`.
7635
+ */
7636
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7637
+ /**
7638
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7639
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7640
+ * `objectClasses`.
7641
+ *
7642
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7643
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7644
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7645
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7646
+ * device (D12) — mai un elenco globale di cap.
7647
+ *
7648
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7649
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7650
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7651
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7652
+ * registrare.
7653
+ */
7654
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7550
7655
  });
7551
7656
  /**
7552
7657
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8173,41 +8278,6 @@ var TIMEZONES = [
8173
8278
  function findTimezone(id) {
8174
8279
  return TIMEZONES.find((tz) => tz.id === id);
8175
8280
  }
8176
- var LabelDefinitionSchema = object({
8177
- id: string(),
8178
- name: string(),
8179
- category: string().optional(),
8180
- description: string().optional(),
8181
- icon: string().optional()
8182
- });
8183
- /**
8184
- * Wire schema for a per-model CATALOG classMap override
8185
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8186
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8187
- * detection pipeline executor actually routes.
8188
- *
8189
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8190
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8191
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8192
- * enum) — the two used to share the name `ClassMapDefinition`/
8193
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8194
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8195
- * are not: it is two different concepts colliding on a name. Keep this type
8196
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8197
- * would either narrow every `ClassMapDefinition` consumer to the four
8198
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8199
- * schema exists for (see the "rejects a classMap whose target is not a
8200
- * detection macro" test in `model-catalog-schema.test.ts`).
8201
- */
8202
- var DetectionCatalogClassMapSchema = object({
8203
- mapping: record(string(), _enum([
8204
- "person",
8205
- "vehicle",
8206
- "animal",
8207
- "package"
8208
- ])),
8209
- preserveOriginal: boolean()
8210
- });
8211
8281
  var MODEL_FORMATS = [
8212
8282
  "onnx",
8213
8283
  "coreml",
@@ -15964,7 +16034,23 @@ var NcHistoryEntrySchema = object({
15964
16034
  updatedAt: number(),
15965
16035
  /** Failure detail — present on a `dead` row. */
15966
16036
  error: string().optional(),
15967
- subject: NcHistorySubjectSchema
16037
+ subject: NcHistorySubjectSchema,
16038
+ /**
16039
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
16040
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
16041
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
16042
+ * every delivery attempt). Absent on a row still pending/dead, a row
16043
+ * delivered before this field shipped, or a wiring with no artefact index.
16044
+ *
16045
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
16046
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
16047
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
16048
+ * also answers `null` for an id whose artefact has since expired past the
16049
+ * retained shelf's own age bound — the degrade a caller (the Home
16050
+ * Assistant export) must render as "no image right now", never as a
16051
+ * broken link.
16052
+ */
16053
+ artifactIds: array(string().min(1)).optional()
15968
16054
  });
15969
16055
  /**
15970
16056
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16191,7 +16277,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16191
16277
  }), method(object({}), object({
16192
16278
  catalog: array(NcConditionDescriptorSchema),
16193
16279
  taxonomy: NcTaxonomySchema.optional()
16194
- })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
16280
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
16195
16281
  kind: "mutation",
16196
16282
  caller: "required"
16197
16283
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21423,7 +21509,7 @@ var lifecycleJobSchema = object({
21423
21509
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21424
21510
  * as every other cap.
21425
21511
  */
21426
- var LogLevelSchema$1 = _enum([
21512
+ var LogLevelSchema$2 = _enum([
21427
21513
  "debug",
21428
21514
  "info",
21429
21515
  "warn",
@@ -21630,7 +21716,7 @@ var CustomActionInputSchema = object({
21630
21716
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21631
21717
  addonId: string(),
21632
21718
  limit: number().min(1).max(500).default(100),
21633
- level: LogLevelSchema$1.optional()
21719
+ level: LogLevelSchema$2.optional()
21634
21720
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21635
21721
  packageName: string(),
21636
21722
  version: string().optional()
@@ -21728,7 +21814,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21728
21814
  auth: "admin"
21729
21815
  }), method(object({
21730
21816
  addonId: string(),
21731
- level: LogLevelSchema$1.optional()
21817
+ level: LogLevelSchema$2.optional()
21732
21818
  }), LogStreamEntrySchema, { kind: "subscription" });
21733
21819
  /**
21734
21820
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23452,6 +23538,35 @@ var FaceFilterEnum = _enum([
23452
23538
  "identified",
23453
23539
  "all"
23454
23540
  ]);
23541
+ /**
23542
+ * What a `listRecentFaces` page is ORDERED BY.
23543
+ *
23544
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23545
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23546
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23547
+ * order: it puts the suggestions an operator can confirm with one tap at the
23548
+ * top, and it is the reason this enum exists — a client that ranked a capped
23549
+ * page client-side was ranking the newest N, never the most certain N.
23550
+ *
23551
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23552
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23553
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23554
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23555
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23556
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23557
+ * then by faceId, and is what makes this a total order instead of the
23558
+ * backend's NULL-collation accident.
23559
+ */
23560
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23561
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23562
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23563
+ * never leaves the server. */
23564
+ var FaceClusterSchema = object({
23565
+ faceIds: array(string()).readonly(),
23566
+ representativeFaceId: string(),
23567
+ size: number().int(),
23568
+ cohesion: number()
23569
+ });
23455
23570
  var MediaFileLiteSchema$1 = object({
23456
23571
  key: string(),
23457
23572
  kind: string(),
@@ -23498,24 +23613,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23498
23613
  kind: "mutation",
23499
23614
  auth: "admin"
23500
23615
  }), method(object({
23501
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23616
+ /**
23617
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23618
+ *
23619
+ * The legacy single-camera form, kept verbatim for every caller that
23620
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23621
+ * instead — never both: `deviceIds` is the authority whenever it is
23622
+ * present, and this field is then ignored rather than unioned, so
23623
+ * there is exactly one answer to "which cameras did I ask for".
23624
+ */
23502
23625
  deviceId: number().int().optional(),
23626
+ /**
23627
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23628
+ * until now had to fetch the cluster-wide page and drop rows in the
23629
+ * client (so the `limit` it asked for was spent on cameras it was
23630
+ * about to discard).
23631
+ *
23632
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23633
+ * "every camera". A request for no devices is a request, not an
23634
+ * omission; same contract as `deviceManager.listFleet` and
23635
+ * `pipelineAnalytics.listRecentTracks`.
23636
+ *
23637
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23638
+ */
23639
+ deviceIds: array(number().int()).optional(),
23503
23640
  limit: number().int().positive().optional(),
23504
23641
  filter: FaceFilterEnum.optional(),
23505
23642
  /**
23506
- * Inline the base64 crop on every row. Default `true` — the existing
23507
- * behaviour, kept so no caller breaks.
23643
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23644
+ * Absent means no lower bound.
23645
+ */
23646
+ since: number().int().optional(),
23647
+ /**
23648
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23649
+ * Absent means no upper bound.
23650
+ */
23651
+ until: number().int().optional(),
23652
+ /**
23653
+ * Order the page by time or by suggestion certainty. Default
23654
+ * `'timestamp'` — the historical order, unchanged for every caller
23655
+ * that does not ask.
23508
23656
  *
23509
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23510
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23511
- * the browser cache the images.
23657
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23658
+ * does under `'suggestionConfidence'`.
23512
23659
  *
23513
- * **This is an INPUT field, so it does not reach the addon until the
23514
- * next train.** The hub router validates cap inputs against its own
23515
- * compiled Zod, which strips a key it does not know verified today
23516
- * on the OUTPUT side, where an additive field DOES arrive immediately
23517
- * (`Track.hasFace`). Until the train ships, sending `false` is
23518
- * harmless and simply keeps the crops inline.
23660
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23661
+ * index and stops reading as soon as `limit` rows have PASSED the
23662
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23663
+ * certain row may be the oldest so it walks the window. Narrow it
23664
+ * with {@link since} / {@link until}.
23665
+ */
23666
+ sortBy: FaceSortFieldEnum.optional(),
23667
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23668
+ sortDirection: FaceSortDirectionEnum.optional(),
23669
+ /**
23670
+ * Inline the base64 crop on every row.
23671
+ *
23672
+ * Default `false` since the 2026-08-25 inversion — see
23673
+ * `include-crops-default.ts`, which is the ONE place that resolves
23674
+ * this for every gallery, and which records why the inline shape had
23675
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23676
+ * The doc here used to still say `true`; it was wrong, and a leftover
23677
+ * that describes the old design reads as permission to rely on it.
23678
+ *
23679
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23680
+ * which the browser fetches off the `event-media` plane in parallel,
23681
+ * cached and ETagged.
23519
23682
  */
23520
23683
  includeCrops: boolean().optional()
23521
23684
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23551,13 +23714,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23551
23714
  }), method(object({
23552
23715
  threshold: number().min(0).max(1).optional(),
23553
23716
  minClusterSize: number().int().min(2).optional(),
23554
- limit: number().int().positive().optional()
23555
- }).optional(), array(object({
23556
- faceIds: array(string()).readonly(),
23557
- representativeFaceId: string(),
23558
- size: number().int(),
23559
- cohesion: number()
23560
- })).readonly());
23717
+ /**
23718
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23719
+ * which read as though it bounded the work — it never did.
23720
+ *
23721
+ * Wins over {@link limit} when both are sent.
23722
+ */
23723
+ maxClusters: number().int().positive().optional(),
23724
+ /**
23725
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23726
+ * RESULT, not the scan. Kept so existing callers keep working; send
23727
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23728
+ */
23729
+ limit: number().int().positive().optional(),
23730
+ /**
23731
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23732
+ * POOL, not the result.
23733
+ *
23734
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23735
+ * used to read every unassigned face on the hub no matter what the
23736
+ * caller asked for, because the only bound cut the finished clusters
23737
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23738
+ * whole corpus, on an addon whose disk is under contention.
23739
+ *
23740
+ * The pool is the NEWEST matching faces first — the same order the
23741
+ * gallery shows — so a bound here shortens the horizon, it does not
23742
+ * sample it randomly.
23743
+ *
23744
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23745
+ * so the live corpus — 372 face rows — is unaffected while the
23746
+ * unbounded scan can never come back as the table grows.
23747
+ */
23748
+ maxFacesScanned: number().int().positive().optional()
23749
+ }).optional(), array(FaceClusterSchema).readonly());
23561
23750
  /**
23562
23751
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23563
23752
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27448,6 +27637,39 @@ var ReadGopBytesResultSchema = object({
27448
27637
  /** Media ms the returned fragment covers. */
27449
27638
  gopDurMs: number()
27450
27639
  });
27640
+ /**
27641
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27642
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27643
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27644
+ * a replay needs several seconds of native pixels, not one frame.
27645
+ *
27646
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27647
+ * is `false` when the returned bytes were cut short by the read's own safety
27648
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27649
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27650
+ * degradation: a window whose end falls past the covering segment would need
27651
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27652
+ * not one standalone-demuxable stream — the caller's answer is to request a
27653
+ * shorter window or one aligned to a single segment, not to receive spliced
27654
+ * bytes nothing has proven decodable.
27655
+ */
27656
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27657
+ kind: literal("ok"),
27658
+ data: _instanceof(Uint8Array),
27659
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27660
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27661
+ gopStartMs: number(),
27662
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27663
+ gopDurMs: number(),
27664
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27665
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27666
+ reachesRequestedEnd: boolean()
27667
+ }), object({
27668
+ kind: literal("spans-multiple-segments"),
27669
+ /** Where the covering segment's own footage runs out — informational,
27670
+ * not a retry hint (retrying the same window would refuse again). */
27671
+ segmentEndMs: number()
27672
+ })]);
27451
27673
  method(object({
27452
27674
  deviceId: number(),
27453
27675
  fromMs: number(),
@@ -27498,6 +27720,15 @@ method(object({
27498
27720
  }), ReadGopBytesResultSchema, {
27499
27721
  kind: "query",
27500
27722
  auth: "admin"
27723
+ }), method(object({
27724
+ deviceId: number(),
27725
+ profile: string(),
27726
+ startMs: number(),
27727
+ fromMs: number(),
27728
+ toMs: number()
27729
+ }), ReadWindowBytesResultSchema, {
27730
+ kind: "query",
27731
+ auth: "admin"
27501
27732
  }), method(object({
27502
27733
  deviceId: number(),
27503
27734
  config: RecordingConfigSchema
@@ -28788,6 +29019,211 @@ var SetSiteLocationInputSchema = object({
28788
29019
  latitude: number().min(-90).max(90),
28789
29020
  longitude: number().min(-180).max(180)
28790
29021
  }).nullable();
29022
+ /**
29023
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
29024
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29025
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29026
+ * already prints - never a token, never an `Authorization` header.
29027
+ */
29028
+ var RequestCensusGroupSchema = object({
29029
+ procedure: string(),
29030
+ userAgent: string(),
29031
+ ip: string(),
29032
+ principal: string(),
29033
+ calls: number(),
29034
+ perMin: number()
29035
+ });
29036
+ /**
29037
+ * A procedure's TOTAL over the window, across every caller.
29038
+ *
29039
+ * This block, not the group list, is what answers "did these calls arrive over
29040
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29041
+ * same window excludes the HTTP plane, which is a result, not a failure.
29042
+ */
29043
+ var RequestCensusProcedureSchema = object({
29044
+ procedure: string(),
29045
+ calls: number(),
29046
+ perMin: number()
29047
+ });
29048
+ /**
29049
+ * The census as an operator sees it.
29050
+ *
29051
+ * `persisted` is the honest answer to "will this survive the restart I am
29052
+ * about to do": the arm deadline is written to `system-settings` so a window
29053
+ * armed now can measure the NEXT boot, and a write that failed must not look
29054
+ * like one that succeeded.
29055
+ */
29056
+ var RequestCensusStatusSchema = object({
29057
+ armed: boolean(),
29058
+ /** How long the current - or just-closed - window collected, in ms. */
29059
+ elapsedMs: number(),
29060
+ /** The window actually armed, after the server clamped the request. */
29061
+ windowMs: number(),
29062
+ /** Epoch ms the window closes at. 0 when disarmed. */
29063
+ armedUntilMs: number(),
29064
+ httpRequests: number(),
29065
+ batchedRequests: number(),
29066
+ /**
29067
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29068
+ * is in play (`?batch=1` carries several procedures in one request); this is
29069
+ * the number comparable with a store-side call count.
29070
+ */
29071
+ procedureCalls: number(),
29072
+ /**
29073
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29074
+ * transport resolves one context per connection - but the number that says
29075
+ * whether a plane this census cannot see was busy while HTTP was quiet.
29076
+ */
29077
+ wsConnections: number(),
29078
+ distinctGroups: number(),
29079
+ /** Calls counted in the totals whose group attribution was shed at the
29080
+ * cardinality bound. */
29081
+ unattributedCalls: number(),
29082
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29083
+ groups: array(RequestCensusGroupSchema).readonly()
29084
+ }).extend({ persisted: boolean() });
29085
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29086
+ var LogLevelSchema$1 = _enum([
29087
+ "debug",
29088
+ "info",
29089
+ "warn",
29090
+ "error"
29091
+ ]);
29092
+ /**
29093
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29094
+ *
29095
+ * A diagnostic is anything whose cost is only worth paying while a question is
29096
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29097
+ */
29098
+ var DiagnosticIdSchema = _enum(["request-census"]);
29099
+ /**
29100
+ * The layers of the level hierarchy, general → specific. The most specific
29101
+ * layer that carries an explicit value wins.
29102
+ *
29103
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29104
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29105
+ * grow later would force every consumer of this document to change with it.
29106
+ * Nothing returns `component` today.
29107
+ */
29108
+ var LoggingScopeKindSchema = _enum([
29109
+ "cluster",
29110
+ "node",
29111
+ "component"
29112
+ ]);
29113
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29114
+ var LoggingLevelSourceSchema = _enum([
29115
+ "default",
29116
+ "cluster",
29117
+ "node",
29118
+ "component"
29119
+ ]);
29120
+ /**
29121
+ * One layer of the hierarchy as it actually STANDS.
29122
+ *
29123
+ * `level: null` is the whole reason this array is returned: it is the
29124
+ * difference between "this node is at `info` because I decided it" and
29125
+ * "...because it inherits". An operator who clears an override believing they
29126
+ * are clearing an inherited value has been handed the same defect as the two
29127
+ * contradicting knobs this document exists to remove, moved one floor up.
29128
+ */
29129
+ var LoggingLevelLayerSchema = object({
29130
+ scope: LoggingScopeKindSchema,
29131
+ /** The node this layer speaks for; `null` on the cluster layer. */
29132
+ nodeId: string().nullable(),
29133
+ /** Explicitly set here, or `null` when this layer inherits. */
29134
+ level: LogLevelSchema$1.nullable()
29135
+ });
29136
+ /** What a line is judged against, and WHICH layer decided it. */
29137
+ var LoggingEffectiveSchema = object({
29138
+ level: LogLevelSchema$1,
29139
+ levelSource: LoggingLevelSourceSchema
29140
+ });
29141
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29142
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29143
+ /**
29144
+ * An armed diagnostic, with its DEADLINE.
29145
+ *
29146
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29147
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29148
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29149
+ * `armed` is false — a window is never reported as slightly expired.
29150
+ */
29151
+ var DiagnosticWindowSchema = object({
29152
+ id: DiagnosticIdSchema,
29153
+ armed: boolean(),
29154
+ /** Epoch ms the window closes at. 0 when disarmed. */
29155
+ armedUntilMs: number(),
29156
+ /** Ms left before it expires on its own. 0 when disarmed. */
29157
+ remainingMs: number(),
29158
+ /** Whether the stored deadline is the one the live diagnostic is running —
29159
+ * i.e. whether this window would survive a restart. */
29160
+ persisted: boolean()
29161
+ });
29162
+ /**
29163
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29164
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29165
+ * is a second knob that disagrees with the first the day one of them moves.
29166
+ */
29167
+ var DiagnosticWindowPatchSchema = object({
29168
+ id: DiagnosticIdSchema,
29169
+ armMs: number().int().min(0),
29170
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29171
+ reportEveryMs: number().int().positive().optional()
29172
+ });
29173
+ /**
29174
+ * A PATCH, and patches MERGE.
29175
+ *
29176
+ * A field absent from the patch is left exactly as it was — arming a
29177
+ * diagnostic never resets a level, and setting a level never disarms a window.
29178
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29179
+ * `setAll` already merges, and rebuilding the object is how an absent field
29180
+ * turns into an erased one.
29181
+ */
29182
+ var LoggingSettingsPatchSchema = object({
29183
+ /**
29184
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29185
+ * addressed scope so it inherits again. A value sets it.
29186
+ */
29187
+ level: LogLevelSchema$1.nullable().optional(),
29188
+ /**
29189
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29190
+ * keeps running — a patch is never a full replacement.
29191
+ */
29192
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29193
+ });
29194
+ /**
29195
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29196
+ *
29197
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29198
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29199
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29200
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29201
+ * by an agent that holds no cluster document at all. The hub is the single
29202
+ * authority over the whole hierarchy and answers for every layer, so the
29203
+ * layer selector needs a name the transport does not already own.
29204
+ */
29205
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29206
+ var SetLoggingSettingsInputSchema = object({
29207
+ scopeNodeId: string().optional(),
29208
+ patch: LoggingSettingsPatchSchema
29209
+ });
29210
+ /**
29211
+ * The whole document, as read and as returned after every write.
29212
+ *
29213
+ * `persisted: false` means the settings store could not be read or written.
29214
+ * The in-memory mirror still governs behaviour and is unchanged by the
29215
+ * failure — a read that fails neither switches a level nor disarms a window
29216
+ * (D49) — but the operator is told that what they are looking at would not
29217
+ * survive a restart.
29218
+ */
29219
+ var LoggingSettingsStateSchema = object({
29220
+ /** The layer this document was read at. `null` = the cluster layer. */
29221
+ scopeNodeId: string().nullable(),
29222
+ effective: LoggingEffectiveSchema,
29223
+ explicit: LoggingExplicitSchema,
29224
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29225
+ persisted: boolean()
29226
+ });
28791
29227
  method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
28792
29228
  kind: "mutation",
28793
29229
  auth: "admin"
@@ -28800,6 +29236,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28800
29236
  }), method(_void(), SiteLocationStatusSchema, {
28801
29237
  kind: "mutation",
28802
29238
  auth: "admin"
29239
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29240
+ kind: "mutation",
29241
+ auth: "admin"
28803
29242
  });
28804
29243
  /**
28805
29244
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -34016,6 +34455,12 @@ Object.freeze({
34016
34455
  addonId: null,
34017
34456
  access: "view"
34018
34457
  },
34458
+ "notificationRules.resolveArtifactUrl": {
34459
+ capName: "notification-rules",
34460
+ capScope: "system",
34461
+ addonId: null,
34462
+ access: "view"
34463
+ },
34019
34464
  "notificationRules.setAlarmConfig": {
34020
34465
  capName: "notification-rules",
34021
34466
  capScope: "system",
@@ -35420,6 +35865,12 @@ Object.freeze({
35420
35865
  addonId: null,
35421
35866
  access: "view"
35422
35867
  },
35868
+ "recording.readWindowBytes": {
35869
+ capName: "recording",
35870
+ capScope: "system",
35871
+ addonId: null,
35872
+ access: "view"
35873
+ },
35423
35874
  "recording.refreshStorageLocationsForMigration": {
35424
35875
  capName: "recording",
35425
35876
  capScope: "system",
@@ -36260,6 +36711,18 @@ Object.freeze({
36260
36711
  addonId: null,
36261
36712
  access: "create"
36262
36713
  },
36714
+ "system.getLoggingSettings": {
36715
+ capName: "system",
36716
+ capScope: "system",
36717
+ addonId: null,
36718
+ access: "view"
36719
+ },
36720
+ "system.getRequestCensus": {
36721
+ capName: "system",
36722
+ capScope: "system",
36723
+ addonId: null,
36724
+ access: "view"
36725
+ },
36263
36726
  "system.getRetentionConfig": {
36264
36727
  capName: "system",
36265
36728
  capScope: "system",
@@ -36290,6 +36753,12 @@ Object.freeze({
36290
36753
  addonId: null,
36291
36754
  access: "view"
36292
36755
  },
36756
+ "system.setLoggingSettings": {
36757
+ capName: "system",
36758
+ capScope: "system",
36759
+ addonId: null,
36760
+ access: "create"
36761
+ },
36293
36762
  "system.setRetentionConfig": {
36294
36763
  capName: "system",
36295
36764
  capScope: "system",
@@ -37445,6 +37914,10 @@ Object.freeze({
37445
37914
  name: "deviceId",
37446
37915
  form: "single",
37447
37916
  optional: true
37917
+ }, {
37918
+ name: "deviceIds",
37919
+ form: "array",
37920
+ optional: true
37448
37921
  }],
37449
37922
  "fanControl.setDirection": [{
37450
37923
  name: "deviceId",
@@ -38250,6 +38723,11 @@ Object.freeze({
38250
38723
  form: "single",
38251
38724
  optional: false
38252
38725
  }],
38726
+ "recording.readWindowBytes": [{
38727
+ name: "deviceId",
38728
+ form: "single",
38729
+ optional: false
38730
+ }],
38253
38731
  "recording.relocateFootage": [{
38254
38732
  name: "deviceId",
38255
38733
  form: "single",
@@ -39050,7 +39528,38 @@ object({
39050
39528
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
39051
39529
  * reproduce that.
39052
39530
  */
39053
- tileBudgetMb: number().int().min(0).max(1024)
39531
+ tileBudgetMb: number().int().min(0).max(1024),
39532
+ /**
39533
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39534
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39535
+ * subject tiles, on frames that detected something.
39536
+ *
39537
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39538
+ * containment is strict by design, so the native `keyFrame`, the detail
39539
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39540
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39541
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39542
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39543
+ *
39544
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39545
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39546
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39547
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39548
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39549
+ * binds only through a detection burst, where it still covers well past the
39550
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39551
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39552
+ * whole shape exists to avoid.
39553
+ *
39554
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39555
+ * subject tile, so one shared budget would let a busy camera's key frames
39556
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39557
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39558
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39559
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39560
+ * nothing.
39561
+ */
39562
+ sceneBudgetMb: number().int().min(0).max(1024)
39054
39563
  });
39055
39564
  /**
39056
39565
  * The values in force when the operator has set nothing.
@@ -39066,12 +39575,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
39066
39575
  budgetMb: 1024,
39067
39576
  activityMs: 15e3,
39068
39577
  tileBudgetMb: 64,
39578
+ sceneBudgetMb: 48,
39069
39579
  admission: "inferred"
39070
39580
  };
39071
39581
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39072
39582
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39073
39583
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39074
39584
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39585
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39075
39586
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39076
39587
  var MB = 1024 * 1024;
39077
39588
  1024 * MB, 3072 * MB;