@camstack/addon-provider-reolink 1.2.52 → 1.2.54

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
@@ -7565,6 +7565,66 @@ var OpsLogQueryInputSchema = object({
7565
7565
  /** Max rows returned, newest-first. */
7566
7566
  limit: number().int().min(1).max(1e3).optional()
7567
7567
  });
7568
+ var LabelDefinitionSchema = object({
7569
+ id: string(),
7570
+ name: string(),
7571
+ category: string().optional(),
7572
+ description: string().optional(),
7573
+ icon: string().optional()
7574
+ });
7575
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7576
+ var CLASS_MAP_MACRO_TARGETS = [
7577
+ "person",
7578
+ "vehicle",
7579
+ "animal",
7580
+ "package"
7581
+ ];
7582
+ /**
7583
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7584
+ * un operatore può selezionare.
7585
+ *
7586
+ * Sono le tre offerte dallo step `object-detection`
7587
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7588
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7589
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7590
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7591
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7592
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7593
+ *
7594
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7595
+ * dello step e una seconda volta come union `FirstLevelMacro`
7596
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7597
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7598
+ * successiva.
7599
+ */
7600
+ var FIRST_LEVEL_MACRO_CLASSES = [
7601
+ "person",
7602
+ "vehicle",
7603
+ "animal"
7604
+ ];
7605
+ /**
7606
+ * Wire schema for a per-model CATALOG classMap override
7607
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7608
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7609
+ * detection pipeline executor actually routes.
7610
+ *
7611
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7612
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7613
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7614
+ * enum) — the two used to share the name `ClassMapDefinition`/
7615
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7616
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7617
+ * are not: it is two different concepts colliding on a name. Keep this type
7618
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7619
+ * would either narrow every `ClassMapDefinition` consumer to the four
7620
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7621
+ * schema exists for (see the "rejects a classMap whose target is not a
7622
+ * detection macro" test in `model-catalog-schema.test.ts`).
7623
+ */
7624
+ var DetectionCatalogClassMapSchema = object({
7625
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7626
+ preserveOriginal: boolean()
7627
+ });
7568
7628
  /**
7569
7629
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7570
7630
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7587,10 +7647,55 @@ var RecordingStorageModeSchema = _enum([
7587
7647
  "events",
7588
7648
  "continuous"
7589
7649
  ]);
7650
+ /**
7651
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7652
+ * tre offerte dallo step `object-detection`, da UNA lista
7653
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7654
+ */
7655
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7656
+ /**
7657
+ * True quando `values` non ripete un elemento.
7658
+ *
7659
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7660
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7661
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7662
+ */
7663
+ var noDuplicates = (values) => new Set(values).size === values.length;
7590
7664
  /** Which detectors trigger an `events`-mode band. */
7591
7665
  var RecordingTriggersSchema = object({
7592
7666
  motion: boolean().optional(),
7593
- audioThresholdDbfs: number().optional()
7667
+ audioThresholdDbfs: number().optional(),
7668
+ /**
7669
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7670
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7671
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7672
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7673
+ *
7674
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7675
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7676
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7677
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7678
+ * finestre — vedi `recorder/object-trigger.ts`.
7679
+ */
7680
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7681
+ /**
7682
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7683
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7684
+ * `objectClasses`.
7685
+ *
7686
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7687
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7688
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7689
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7690
+ * device (D12) — mai un elenco globale di cap.
7691
+ *
7692
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7693
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7694
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7695
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7696
+ * registrare.
7697
+ */
7698
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7594
7699
  });
7595
7700
  /**
7596
7701
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8217,41 +8322,6 @@ var TIMEZONES = [
8217
8322
  function findTimezone(id) {
8218
8323
  return TIMEZONES.find((tz) => tz.id === id);
8219
8324
  }
8220
- var LabelDefinitionSchema = object({
8221
- id: string(),
8222
- name: string(),
8223
- category: string().optional(),
8224
- description: string().optional(),
8225
- icon: string().optional()
8226
- });
8227
- /**
8228
- * Wire schema for a per-model CATALOG classMap override
8229
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8230
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8231
- * detection pipeline executor actually routes.
8232
- *
8233
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8234
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8235
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8236
- * enum) — the two used to share the name `ClassMapDefinition`/
8237
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8238
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8239
- * are not: it is two different concepts colliding on a name. Keep this type
8240
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8241
- * would either narrow every `ClassMapDefinition` consumer to the four
8242
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8243
- * schema exists for (see the "rejects a classMap whose target is not a
8244
- * detection macro" test in `model-catalog-schema.test.ts`).
8245
- */
8246
- var DetectionCatalogClassMapSchema = object({
8247
- mapping: record(string(), _enum([
8248
- "person",
8249
- "vehicle",
8250
- "animal",
8251
- "package"
8252
- ])),
8253
- preserveOriginal: boolean()
8254
- });
8255
8325
  var MODEL_FORMATS = [
8256
8326
  "onnx",
8257
8327
  "coreml",
@@ -16008,7 +16078,23 @@ var NcHistoryEntrySchema = object({
16008
16078
  updatedAt: number(),
16009
16079
  /** Failure detail — present on a `dead` row. */
16010
16080
  error: string().optional(),
16011
- subject: NcHistorySubjectSchema
16081
+ subject: NcHistorySubjectSchema,
16082
+ /**
16083
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
16084
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
16085
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
16086
+ * every delivery attempt). Absent on a row still pending/dead, a row
16087
+ * delivered before this field shipped, or a wiring with no artefact index.
16088
+ *
16089
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
16090
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
16091
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
16092
+ * also answers `null` for an id whose artefact has since expired past the
16093
+ * retained shelf's own age bound — the degrade a caller (the Home
16094
+ * Assistant export) must render as "no image right now", never as a
16095
+ * broken link.
16096
+ */
16097
+ artifactIds: array(string().min(1)).optional()
16012
16098
  });
16013
16099
  /**
16014
16100
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16235,7 +16321,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16235
16321
  }), method(object({}), object({
16236
16322
  catalog: array(NcConditionDescriptorSchema),
16237
16323
  taxonomy: NcTaxonomySchema.optional()
16238
- })), 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 }), {
16324
+ })), 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 }), {
16239
16325
  kind: "mutation",
16240
16326
  caller: "required"
16241
16327
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21467,7 +21553,7 @@ var lifecycleJobSchema = object({
21467
21553
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21468
21554
  * as every other cap.
21469
21555
  */
21470
- var LogLevelSchema$1 = _enum([
21556
+ var LogLevelSchema$2 = _enum([
21471
21557
  "debug",
21472
21558
  "info",
21473
21559
  "warn",
@@ -21674,7 +21760,7 @@ var CustomActionInputSchema = object({
21674
21760
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21675
21761
  addonId: string(),
21676
21762
  limit: number().min(1).max(500).default(100),
21677
- level: LogLevelSchema$1.optional()
21763
+ level: LogLevelSchema$2.optional()
21678
21764
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21679
21765
  packageName: string(),
21680
21766
  version: string().optional()
@@ -21772,7 +21858,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21772
21858
  auth: "admin"
21773
21859
  }), method(object({
21774
21860
  addonId: string(),
21775
- level: LogLevelSchema$1.optional()
21861
+ level: LogLevelSchema$2.optional()
21776
21862
  }), LogStreamEntrySchema, { kind: "subscription" });
21777
21863
  /**
21778
21864
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23496,6 +23582,35 @@ var FaceFilterEnum = _enum([
23496
23582
  "identified",
23497
23583
  "all"
23498
23584
  ]);
23585
+ /**
23586
+ * What a `listRecentFaces` page is ORDERED BY.
23587
+ *
23588
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23589
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23590
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23591
+ * order: it puts the suggestions an operator can confirm with one tap at the
23592
+ * top, and it is the reason this enum exists — a client that ranked a capped
23593
+ * page client-side was ranking the newest N, never the most certain N.
23594
+ *
23595
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23596
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23597
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23598
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23599
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23600
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23601
+ * then by faceId, and is what makes this a total order instead of the
23602
+ * backend's NULL-collation accident.
23603
+ */
23604
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23605
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23606
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23607
+ * never leaves the server. */
23608
+ var FaceClusterSchema = object({
23609
+ faceIds: array(string()).readonly(),
23610
+ representativeFaceId: string(),
23611
+ size: number().int(),
23612
+ cohesion: number()
23613
+ });
23499
23614
  var MediaFileLiteSchema$1 = object({
23500
23615
  key: string(),
23501
23616
  kind: string(),
@@ -23542,24 +23657,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23542
23657
  kind: "mutation",
23543
23658
  auth: "admin"
23544
23659
  }), method(object({
23545
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23660
+ /**
23661
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23662
+ *
23663
+ * The legacy single-camera form, kept verbatim for every caller that
23664
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23665
+ * instead — never both: `deviceIds` is the authority whenever it is
23666
+ * present, and this field is then ignored rather than unioned, so
23667
+ * there is exactly one answer to "which cameras did I ask for".
23668
+ */
23546
23669
  deviceId: number().int().optional(),
23670
+ /**
23671
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23672
+ * until now had to fetch the cluster-wide page and drop rows in the
23673
+ * client (so the `limit` it asked for was spent on cameras it was
23674
+ * about to discard).
23675
+ *
23676
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23677
+ * "every camera". A request for no devices is a request, not an
23678
+ * omission; same contract as `deviceManager.listFleet` and
23679
+ * `pipelineAnalytics.listRecentTracks`.
23680
+ *
23681
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23682
+ */
23683
+ deviceIds: array(number().int()).optional(),
23547
23684
  limit: number().int().positive().optional(),
23548
23685
  filter: FaceFilterEnum.optional(),
23549
23686
  /**
23550
- * Inline the base64 crop on every row. Default `true` — the existing
23551
- * behaviour, kept so no caller breaks.
23687
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23688
+ * Absent means no lower bound.
23689
+ */
23690
+ since: number().int().optional(),
23691
+ /**
23692
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23693
+ * Absent means no upper bound.
23694
+ */
23695
+ until: number().int().optional(),
23696
+ /**
23697
+ * Order the page by time or by suggestion certainty. Default
23698
+ * `'timestamp'` — the historical order, unchanged for every caller
23699
+ * that does not ask.
23552
23700
  *
23553
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23554
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23555
- * the browser cache the images.
23701
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23702
+ * does under `'suggestionConfidence'`.
23556
23703
  *
23557
- * **This is an INPUT field, so it does not reach the addon until the
23558
- * next train.** The hub router validates cap inputs against its own
23559
- * compiled Zod, which strips a key it does not know verified today
23560
- * on the OUTPUT side, where an additive field DOES arrive immediately
23561
- * (`Track.hasFace`). Until the train ships, sending `false` is
23562
- * harmless and simply keeps the crops inline.
23704
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23705
+ * index and stops reading as soon as `limit` rows have PASSED the
23706
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23707
+ * certain row may be the oldest so it walks the window. Narrow it
23708
+ * with {@link since} / {@link until}.
23709
+ */
23710
+ sortBy: FaceSortFieldEnum.optional(),
23711
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23712
+ sortDirection: FaceSortDirectionEnum.optional(),
23713
+ /**
23714
+ * Inline the base64 crop on every row.
23715
+ *
23716
+ * Default `false` since the 2026-08-25 inversion — see
23717
+ * `include-crops-default.ts`, which is the ONE place that resolves
23718
+ * this for every gallery, and which records why the inline shape had
23719
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23720
+ * The doc here used to still say `true`; it was wrong, and a leftover
23721
+ * that describes the old design reads as permission to rely on it.
23722
+ *
23723
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23724
+ * which the browser fetches off the `event-media` plane in parallel,
23725
+ * cached and ETagged.
23563
23726
  */
23564
23727
  includeCrops: boolean().optional()
23565
23728
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23595,13 +23758,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23595
23758
  }), method(object({
23596
23759
  threshold: number().min(0).max(1).optional(),
23597
23760
  minClusterSize: number().int().min(2).optional(),
23598
- limit: number().int().positive().optional()
23599
- }).optional(), array(object({
23600
- faceIds: array(string()).readonly(),
23601
- representativeFaceId: string(),
23602
- size: number().int(),
23603
- cohesion: number()
23604
- })).readonly());
23761
+ /**
23762
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23763
+ * which read as though it bounded the work — it never did.
23764
+ *
23765
+ * Wins over {@link limit} when both are sent.
23766
+ */
23767
+ maxClusters: number().int().positive().optional(),
23768
+ /**
23769
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23770
+ * RESULT, not the scan. Kept so existing callers keep working; send
23771
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23772
+ */
23773
+ limit: number().int().positive().optional(),
23774
+ /**
23775
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23776
+ * POOL, not the result.
23777
+ *
23778
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23779
+ * used to read every unassigned face on the hub no matter what the
23780
+ * caller asked for, because the only bound cut the finished clusters
23781
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23782
+ * whole corpus, on an addon whose disk is under contention.
23783
+ *
23784
+ * The pool is the NEWEST matching faces first — the same order the
23785
+ * gallery shows — so a bound here shortens the horizon, it does not
23786
+ * sample it randomly.
23787
+ *
23788
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23789
+ * so the live corpus — 372 face rows — is unaffected while the
23790
+ * unbounded scan can never come back as the table grows.
23791
+ */
23792
+ maxFacesScanned: number().int().positive().optional()
23793
+ }).optional(), array(FaceClusterSchema).readonly());
23605
23794
  /**
23606
23795
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23607
23796
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27446,6 +27635,39 @@ var ReadGopBytesResultSchema = object({
27446
27635
  /** Media ms the returned fragment covers. */
27447
27636
  gopDurMs: number()
27448
27637
  });
27638
+ /**
27639
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27640
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27641
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27642
+ * a replay needs several seconds of native pixels, not one frame.
27643
+ *
27644
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27645
+ * is `false` when the returned bytes were cut short by the read's own safety
27646
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27647
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27648
+ * degradation: a window whose end falls past the covering segment would need
27649
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27650
+ * not one standalone-demuxable stream — the caller's answer is to request a
27651
+ * shorter window or one aligned to a single segment, not to receive spliced
27652
+ * bytes nothing has proven decodable.
27653
+ */
27654
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27655
+ kind: literal("ok"),
27656
+ data: _instanceof(Uint8Array),
27657
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27658
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27659
+ gopStartMs: number(),
27660
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27661
+ gopDurMs: number(),
27662
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27663
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27664
+ reachesRequestedEnd: boolean()
27665
+ }), object({
27666
+ kind: literal("spans-multiple-segments"),
27667
+ /** Where the covering segment's own footage runs out — informational,
27668
+ * not a retry hint (retrying the same window would refuse again). */
27669
+ segmentEndMs: number()
27670
+ })]);
27449
27671
  method(object({
27450
27672
  deviceId: number(),
27451
27673
  fromMs: number(),
@@ -27496,6 +27718,15 @@ method(object({
27496
27718
  }), ReadGopBytesResultSchema, {
27497
27719
  kind: "query",
27498
27720
  auth: "admin"
27721
+ }), method(object({
27722
+ deviceId: number(),
27723
+ profile: string(),
27724
+ startMs: number(),
27725
+ fromMs: number(),
27726
+ toMs: number()
27727
+ }), ReadWindowBytesResultSchema, {
27728
+ kind: "query",
27729
+ auth: "admin"
27499
27730
  }), method(object({
27500
27731
  deviceId: number(),
27501
27732
  config: RecordingConfigSchema
@@ -28786,6 +29017,211 @@ var SetSiteLocationInputSchema = object({
28786
29017
  latitude: number().min(-90).max(90),
28787
29018
  longitude: number().min(-180).max(180)
28788
29019
  }).nullable();
29020
+ /**
29021
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
29022
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29023
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29024
+ * already prints - never a token, never an `Authorization` header.
29025
+ */
29026
+ var RequestCensusGroupSchema = object({
29027
+ procedure: string(),
29028
+ userAgent: string(),
29029
+ ip: string(),
29030
+ principal: string(),
29031
+ calls: number(),
29032
+ perMin: number()
29033
+ });
29034
+ /**
29035
+ * A procedure's TOTAL over the window, across every caller.
29036
+ *
29037
+ * This block, not the group list, is what answers "did these calls arrive over
29038
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29039
+ * same window excludes the HTTP plane, which is a result, not a failure.
29040
+ */
29041
+ var RequestCensusProcedureSchema = object({
29042
+ procedure: string(),
29043
+ calls: number(),
29044
+ perMin: number()
29045
+ });
29046
+ /**
29047
+ * The census as an operator sees it.
29048
+ *
29049
+ * `persisted` is the honest answer to "will this survive the restart I am
29050
+ * about to do": the arm deadline is written to `system-settings` so a window
29051
+ * armed now can measure the NEXT boot, and a write that failed must not look
29052
+ * like one that succeeded.
29053
+ */
29054
+ var RequestCensusStatusSchema = object({
29055
+ armed: boolean(),
29056
+ /** How long the current - or just-closed - window collected, in ms. */
29057
+ elapsedMs: number(),
29058
+ /** The window actually armed, after the server clamped the request. */
29059
+ windowMs: number(),
29060
+ /** Epoch ms the window closes at. 0 when disarmed. */
29061
+ armedUntilMs: number(),
29062
+ httpRequests: number(),
29063
+ batchedRequests: number(),
29064
+ /**
29065
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29066
+ * is in play (`?batch=1` carries several procedures in one request); this is
29067
+ * the number comparable with a store-side call count.
29068
+ */
29069
+ procedureCalls: number(),
29070
+ /**
29071
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29072
+ * transport resolves one context per connection - but the number that says
29073
+ * whether a plane this census cannot see was busy while HTTP was quiet.
29074
+ */
29075
+ wsConnections: number(),
29076
+ distinctGroups: number(),
29077
+ /** Calls counted in the totals whose group attribution was shed at the
29078
+ * cardinality bound. */
29079
+ unattributedCalls: number(),
29080
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29081
+ groups: array(RequestCensusGroupSchema).readonly()
29082
+ }).extend({ persisted: boolean() });
29083
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29084
+ var LogLevelSchema$1 = _enum([
29085
+ "debug",
29086
+ "info",
29087
+ "warn",
29088
+ "error"
29089
+ ]);
29090
+ /**
29091
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29092
+ *
29093
+ * A diagnostic is anything whose cost is only worth paying while a question is
29094
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29095
+ */
29096
+ var DiagnosticIdSchema = _enum(["request-census"]);
29097
+ /**
29098
+ * The layers of the level hierarchy, general → specific. The most specific
29099
+ * layer that carries an explicit value wins.
29100
+ *
29101
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29102
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29103
+ * grow later would force every consumer of this document to change with it.
29104
+ * Nothing returns `component` today.
29105
+ */
29106
+ var LoggingScopeKindSchema = _enum([
29107
+ "cluster",
29108
+ "node",
29109
+ "component"
29110
+ ]);
29111
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29112
+ var LoggingLevelSourceSchema = _enum([
29113
+ "default",
29114
+ "cluster",
29115
+ "node",
29116
+ "component"
29117
+ ]);
29118
+ /**
29119
+ * One layer of the hierarchy as it actually STANDS.
29120
+ *
29121
+ * `level: null` is the whole reason this array is returned: it is the
29122
+ * difference between "this node is at `info` because I decided it" and
29123
+ * "...because it inherits". An operator who clears an override believing they
29124
+ * are clearing an inherited value has been handed the same defect as the two
29125
+ * contradicting knobs this document exists to remove, moved one floor up.
29126
+ */
29127
+ var LoggingLevelLayerSchema = object({
29128
+ scope: LoggingScopeKindSchema,
29129
+ /** The node this layer speaks for; `null` on the cluster layer. */
29130
+ nodeId: string().nullable(),
29131
+ /** Explicitly set here, or `null` when this layer inherits. */
29132
+ level: LogLevelSchema$1.nullable()
29133
+ });
29134
+ /** What a line is judged against, and WHICH layer decided it. */
29135
+ var LoggingEffectiveSchema = object({
29136
+ level: LogLevelSchema$1,
29137
+ levelSource: LoggingLevelSourceSchema
29138
+ });
29139
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29140
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29141
+ /**
29142
+ * An armed diagnostic, with its DEADLINE.
29143
+ *
29144
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29145
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29146
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29147
+ * `armed` is false — a window is never reported as slightly expired.
29148
+ */
29149
+ var DiagnosticWindowSchema = object({
29150
+ id: DiagnosticIdSchema,
29151
+ armed: boolean(),
29152
+ /** Epoch ms the window closes at. 0 when disarmed. */
29153
+ armedUntilMs: number(),
29154
+ /** Ms left before it expires on its own. 0 when disarmed. */
29155
+ remainingMs: number(),
29156
+ /** Whether the stored deadline is the one the live diagnostic is running —
29157
+ * i.e. whether this window would survive a restart. */
29158
+ persisted: boolean()
29159
+ });
29160
+ /**
29161
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29162
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29163
+ * is a second knob that disagrees with the first the day one of them moves.
29164
+ */
29165
+ var DiagnosticWindowPatchSchema = object({
29166
+ id: DiagnosticIdSchema,
29167
+ armMs: number().int().min(0),
29168
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29169
+ reportEveryMs: number().int().positive().optional()
29170
+ });
29171
+ /**
29172
+ * A PATCH, and patches MERGE.
29173
+ *
29174
+ * A field absent from the patch is left exactly as it was — arming a
29175
+ * diagnostic never resets a level, and setting a level never disarms a window.
29176
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29177
+ * `setAll` already merges, and rebuilding the object is how an absent field
29178
+ * turns into an erased one.
29179
+ */
29180
+ var LoggingSettingsPatchSchema = object({
29181
+ /**
29182
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29183
+ * addressed scope so it inherits again. A value sets it.
29184
+ */
29185
+ level: LogLevelSchema$1.nullable().optional(),
29186
+ /**
29187
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29188
+ * keeps running — a patch is never a full replacement.
29189
+ */
29190
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29191
+ });
29192
+ /**
29193
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29194
+ *
29195
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29196
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29197
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29198
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29199
+ * by an agent that holds no cluster document at all. The hub is the single
29200
+ * authority over the whole hierarchy and answers for every layer, so the
29201
+ * layer selector needs a name the transport does not already own.
29202
+ */
29203
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29204
+ var SetLoggingSettingsInputSchema = object({
29205
+ scopeNodeId: string().optional(),
29206
+ patch: LoggingSettingsPatchSchema
29207
+ });
29208
+ /**
29209
+ * The whole document, as read and as returned after every write.
29210
+ *
29211
+ * `persisted: false` means the settings store could not be read or written.
29212
+ * The in-memory mirror still governs behaviour and is unchanged by the
29213
+ * failure — a read that fails neither switches a level nor disarms a window
29214
+ * (D49) — but the operator is told that what they are looking at would not
29215
+ * survive a restart.
29216
+ */
29217
+ var LoggingSettingsStateSchema = object({
29218
+ /** The layer this document was read at. `null` = the cluster layer. */
29219
+ scopeNodeId: string().nullable(),
29220
+ effective: LoggingEffectiveSchema,
29221
+ explicit: LoggingExplicitSchema,
29222
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29223
+ persisted: boolean()
29224
+ });
28789
29225
  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(), {
28790
29226
  kind: "mutation",
28791
29227
  auth: "admin"
@@ -28798,6 +29234,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28798
29234
  }), method(_void(), SiteLocationStatusSchema, {
28799
29235
  kind: "mutation",
28800
29236
  auth: "admin"
29237
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29238
+ kind: "mutation",
29239
+ auth: "admin"
28801
29240
  });
28802
29241
  /**
28803
29242
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33948,6 +34387,12 @@ Object.freeze({
33948
34387
  addonId: null,
33949
34388
  access: "view"
33950
34389
  },
34390
+ "notificationRules.resolveArtifactUrl": {
34391
+ capName: "notification-rules",
34392
+ capScope: "system",
34393
+ addonId: null,
34394
+ access: "view"
34395
+ },
33951
34396
  "notificationRules.setAlarmConfig": {
33952
34397
  capName: "notification-rules",
33953
34398
  capScope: "system",
@@ -35352,6 +35797,12 @@ Object.freeze({
35352
35797
  addonId: null,
35353
35798
  access: "view"
35354
35799
  },
35800
+ "recording.readWindowBytes": {
35801
+ capName: "recording",
35802
+ capScope: "system",
35803
+ addonId: null,
35804
+ access: "view"
35805
+ },
35355
35806
  "recording.refreshStorageLocationsForMigration": {
35356
35807
  capName: "recording",
35357
35808
  capScope: "system",
@@ -36192,6 +36643,18 @@ Object.freeze({
36192
36643
  addonId: null,
36193
36644
  access: "create"
36194
36645
  },
36646
+ "system.getLoggingSettings": {
36647
+ capName: "system",
36648
+ capScope: "system",
36649
+ addonId: null,
36650
+ access: "view"
36651
+ },
36652
+ "system.getRequestCensus": {
36653
+ capName: "system",
36654
+ capScope: "system",
36655
+ addonId: null,
36656
+ access: "view"
36657
+ },
36195
36658
  "system.getRetentionConfig": {
36196
36659
  capName: "system",
36197
36660
  capScope: "system",
@@ -36222,6 +36685,12 @@ Object.freeze({
36222
36685
  addonId: null,
36223
36686
  access: "view"
36224
36687
  },
36688
+ "system.setLoggingSettings": {
36689
+ capName: "system",
36690
+ capScope: "system",
36691
+ addonId: null,
36692
+ access: "create"
36693
+ },
36225
36694
  "system.setRetentionConfig": {
36226
36695
  capName: "system",
36227
36696
  capScope: "system",
@@ -37377,6 +37846,10 @@ Object.freeze({
37377
37846
  name: "deviceId",
37378
37847
  form: "single",
37379
37848
  optional: true
37849
+ }, {
37850
+ name: "deviceIds",
37851
+ form: "array",
37852
+ optional: true
37380
37853
  }],
37381
37854
  "fanControl.setDirection": [{
37382
37855
  name: "deviceId",
@@ -38182,6 +38655,11 @@ Object.freeze({
38182
38655
  form: "single",
38183
38656
  optional: false
38184
38657
  }],
38658
+ "recording.readWindowBytes": [{
38659
+ name: "deviceId",
38660
+ form: "single",
38661
+ optional: false
38662
+ }],
38185
38663
  "recording.relocateFootage": [{
38186
38664
  name: "deviceId",
38187
38665
  form: "single",
@@ -38982,7 +39460,38 @@ object({
38982
39460
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38983
39461
  * reproduce that.
38984
39462
  */
38985
- tileBudgetMb: number().int().min(0).max(1024)
39463
+ tileBudgetMb: number().int().min(0).max(1024),
39464
+ /**
39465
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39466
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39467
+ * subject tiles, on frames that detected something.
39468
+ *
39469
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39470
+ * containment is strict by design, so the native `keyFrame`, the detail
39471
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39472
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39473
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39474
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39475
+ *
39476
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39477
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39478
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39479
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39480
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39481
+ * binds only through a detection burst, where it still covers well past the
39482
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39483
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39484
+ * whole shape exists to avoid.
39485
+ *
39486
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39487
+ * subject tile, so one shared budget would let a busy camera's key frames
39488
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39489
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39490
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39491
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39492
+ * nothing.
39493
+ */
39494
+ sceneBudgetMb: number().int().min(0).max(1024)
38986
39495
  });
38987
39496
  /**
38988
39497
  * The values in force when the operator has set nothing.
@@ -38998,12 +39507,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38998
39507
  budgetMb: 1024,
38999
39508
  activityMs: 15e3,
39000
39509
  tileBudgetMb: 64,
39510
+ sceneBudgetMb: 48,
39001
39511
  admission: "inferred"
39002
39512
  };
39003
39513
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39004
39514
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39005
39515
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39006
39516
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39517
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39007
39518
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39008
39519
  var MB = 1024 * 1024;
39009
39520
  1024 * MB, 3072 * MB;