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