@camstack/addon-provider-homeassistant 1.2.43 → 1.2.45

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.
@@ -7729,6 +7729,66 @@ var OpsLogQueryInputSchema = object({
7729
7729
  /** Max rows returned, newest-first. */
7730
7730
  limit: number().int().min(1).max(1e3).optional()
7731
7731
  });
7732
+ var LabelDefinitionSchema = object({
7733
+ id: string(),
7734
+ name: string(),
7735
+ category: string().optional(),
7736
+ description: string().optional(),
7737
+ icon: string().optional()
7738
+ });
7739
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7740
+ var CLASS_MAP_MACRO_TARGETS = [
7741
+ "person",
7742
+ "vehicle",
7743
+ "animal",
7744
+ "package"
7745
+ ];
7746
+ /**
7747
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7748
+ * un operatore può selezionare.
7749
+ *
7750
+ * Sono le tre offerte dallo step `object-detection`
7751
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7752
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7753
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7754
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7755
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7756
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7757
+ *
7758
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7759
+ * dello step e una seconda volta come union `FirstLevelMacro`
7760
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7761
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7762
+ * successiva.
7763
+ */
7764
+ var FIRST_LEVEL_MACRO_CLASSES = [
7765
+ "person",
7766
+ "vehicle",
7767
+ "animal"
7768
+ ];
7769
+ /**
7770
+ * Wire schema for a per-model CATALOG classMap override
7771
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7772
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7773
+ * detection pipeline executor actually routes.
7774
+ *
7775
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7776
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7777
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7778
+ * enum) — the two used to share the name `ClassMapDefinition`/
7779
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7780
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7781
+ * are not: it is two different concepts colliding on a name. Keep this type
7782
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7783
+ * would either narrow every `ClassMapDefinition` consumer to the four
7784
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7785
+ * schema exists for (see the "rejects a classMap whose target is not a
7786
+ * detection macro" test in `model-catalog-schema.test.ts`).
7787
+ */
7788
+ var DetectionCatalogClassMapSchema = object({
7789
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7790
+ preserveOriginal: boolean()
7791
+ });
7732
7792
  /**
7733
7793
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7734
7794
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7751,10 +7811,55 @@ var RecordingStorageModeSchema = _enum([
7751
7811
  "events",
7752
7812
  "continuous"
7753
7813
  ]);
7814
+ /**
7815
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7816
+ * tre offerte dallo step `object-detection`, da UNA lista
7817
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7818
+ */
7819
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7820
+ /**
7821
+ * True quando `values` non ripete un elemento.
7822
+ *
7823
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7824
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7825
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7826
+ */
7827
+ var noDuplicates = (values) => new Set(values).size === values.length;
7754
7828
  /** Which detectors trigger an `events`-mode band. */
7755
7829
  var RecordingTriggersSchema = object({
7756
7830
  motion: boolean().optional(),
7757
- audioThresholdDbfs: number().optional()
7831
+ audioThresholdDbfs: number().optional(),
7832
+ /**
7833
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7834
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7835
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7836
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7837
+ *
7838
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7839
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7840
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7841
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7842
+ * finestre — vedi `recorder/object-trigger.ts`.
7843
+ */
7844
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7845
+ /**
7846
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7847
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7848
+ * `objectClasses`.
7849
+ *
7850
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7851
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7852
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7853
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7854
+ * device (D12) — mai un elenco globale di cap.
7855
+ *
7856
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7857
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7858
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7859
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7860
+ * registrare.
7861
+ */
7862
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7758
7863
  });
7759
7864
  /**
7760
7865
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8206,41 +8311,6 @@ var DecoderSessionConfigSchema = object({
8206
8311
  */
8207
8312
  debug: boolean().optional()
8208
8313
  });
8209
- var LabelDefinitionSchema = object({
8210
- id: string(),
8211
- name: string(),
8212
- category: string().optional(),
8213
- description: string().optional(),
8214
- icon: string().optional()
8215
- });
8216
- /**
8217
- * Wire schema for a per-model CATALOG classMap override
8218
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8219
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8220
- * detection pipeline executor actually routes.
8221
- *
8222
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8223
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8224
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8225
- * enum) — the two used to share the name `ClassMapDefinition`/
8226
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8227
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8228
- * are not: it is two different concepts colliding on a name. Keep this type
8229
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8230
- * would either narrow every `ClassMapDefinition` consumer to the four
8231
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8232
- * schema exists for (see the "rejects a classMap whose target is not a
8233
- * detection macro" test in `model-catalog-schema.test.ts`).
8234
- */
8235
- var DetectionCatalogClassMapSchema = object({
8236
- mapping: record(string(), _enum([
8237
- "person",
8238
- "vehicle",
8239
- "animal",
8240
- "package"
8241
- ])),
8242
- preserveOriginal: boolean()
8243
- });
8244
8314
  var MODEL_FORMATS = [
8245
8315
  "onnx",
8246
8316
  "coreml",
@@ -16154,7 +16224,23 @@ var NcHistoryEntrySchema = object({
16154
16224
  updatedAt: number(),
16155
16225
  /** Failure detail — present on a `dead` row. */
16156
16226
  error: string().optional(),
16157
- subject: NcHistorySubjectSchema
16227
+ subject: NcHistorySubjectSchema,
16228
+ /**
16229
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
16230
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
16231
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
16232
+ * every delivery attempt). Absent on a row still pending/dead, a row
16233
+ * delivered before this field shipped, or a wiring with no artefact index.
16234
+ *
16235
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
16236
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
16237
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
16238
+ * also answers `null` for an id whose artefact has since expired past the
16239
+ * retained shelf's own age bound — the degrade a caller (the Home
16240
+ * Assistant export) must render as "no image right now", never as a
16241
+ * broken link.
16242
+ */
16243
+ artifactIds: array(string().min(1)).optional()
16158
16244
  });
16159
16245
  /**
16160
16246
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16381,7 +16467,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16381
16467
  }), method(object({}), object({
16382
16468
  catalog: array(NcConditionDescriptorSchema),
16383
16469
  taxonomy: NcTaxonomySchema.optional()
16384
- })), 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 }), {
16470
+ })), 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 }), {
16385
16471
  kind: "mutation",
16386
16472
  caller: "required"
16387
16473
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21597,7 +21683,7 @@ var lifecycleJobSchema = object({
21597
21683
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21598
21684
  * as every other cap.
21599
21685
  */
21600
- var LogLevelSchema$1 = _enum([
21686
+ var LogLevelSchema$2 = _enum([
21601
21687
  "debug",
21602
21688
  "info",
21603
21689
  "warn",
@@ -21804,7 +21890,7 @@ var CustomActionInputSchema = object({
21804
21890
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21805
21891
  addonId: string(),
21806
21892
  limit: number().min(1).max(500).default(100),
21807
- level: LogLevelSchema$1.optional()
21893
+ level: LogLevelSchema$2.optional()
21808
21894
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21809
21895
  packageName: string(),
21810
21896
  version: string().optional()
@@ -21902,7 +21988,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21902
21988
  auth: "admin"
21903
21989
  }), method(object({
21904
21990
  addonId: string(),
21905
- level: LogLevelSchema$1.optional()
21991
+ level: LogLevelSchema$2.optional()
21906
21992
  }), LogStreamEntrySchema, { kind: "subscription" });
21907
21993
  /**
21908
21994
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23643,6 +23729,35 @@ var FaceFilterEnum = _enum([
23643
23729
  "identified",
23644
23730
  "all"
23645
23731
  ]);
23732
+ /**
23733
+ * What a `listRecentFaces` page is ORDERED BY.
23734
+ *
23735
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23736
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23737
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23738
+ * order: it puts the suggestions an operator can confirm with one tap at the
23739
+ * top, and it is the reason this enum exists — a client that ranked a capped
23740
+ * page client-side was ranking the newest N, never the most certain N.
23741
+ *
23742
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23743
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23744
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23745
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23746
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23747
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23748
+ * then by faceId, and is what makes this a total order instead of the
23749
+ * backend's NULL-collation accident.
23750
+ */
23751
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23752
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23753
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23754
+ * never leaves the server. */
23755
+ var FaceClusterSchema = object({
23756
+ faceIds: array(string()).readonly(),
23757
+ representativeFaceId: string(),
23758
+ size: number().int(),
23759
+ cohesion: number()
23760
+ });
23646
23761
  var MediaFileLiteSchema$1 = object({
23647
23762
  key: string(),
23648
23763
  kind: string(),
@@ -23689,24 +23804,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23689
23804
  kind: "mutation",
23690
23805
  auth: "admin"
23691
23806
  }), method(object({
23692
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23807
+ /**
23808
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23809
+ *
23810
+ * The legacy single-camera form, kept verbatim for every caller that
23811
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23812
+ * instead — never both: `deviceIds` is the authority whenever it is
23813
+ * present, and this field is then ignored rather than unioned, so
23814
+ * there is exactly one answer to "which cameras did I ask for".
23815
+ */
23693
23816
  deviceId: number().int().optional(),
23817
+ /**
23818
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23819
+ * until now had to fetch the cluster-wide page and drop rows in the
23820
+ * client (so the `limit` it asked for was spent on cameras it was
23821
+ * about to discard).
23822
+ *
23823
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23824
+ * "every camera". A request for no devices is a request, not an
23825
+ * omission; same contract as `deviceManager.listFleet` and
23826
+ * `pipelineAnalytics.listRecentTracks`.
23827
+ *
23828
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23829
+ */
23830
+ deviceIds: array(number().int()).optional(),
23694
23831
  limit: number().int().positive().optional(),
23695
23832
  filter: FaceFilterEnum.optional(),
23696
23833
  /**
23697
- * Inline the base64 crop on every row. Default `true` — the existing
23698
- * behaviour, kept so no caller breaks.
23834
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23835
+ * Absent means no lower bound.
23836
+ */
23837
+ since: number().int().optional(),
23838
+ /**
23839
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23840
+ * Absent means no upper bound.
23841
+ */
23842
+ until: number().int().optional(),
23843
+ /**
23844
+ * Order the page by time or by suggestion certainty. Default
23845
+ * `'timestamp'` — the historical order, unchanged for every caller
23846
+ * that does not ask.
23699
23847
  *
23700
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23701
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23702
- * the browser cache the images.
23848
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23849
+ * does under `'suggestionConfidence'`.
23703
23850
  *
23704
- * **This is an INPUT field, so it does not reach the addon until the
23705
- * next train.** The hub router validates cap inputs against its own
23706
- * compiled Zod, which strips a key it does not know verified today
23707
- * on the OUTPUT side, where an additive field DOES arrive immediately
23708
- * (`Track.hasFace`). Until the train ships, sending `false` is
23709
- * harmless and simply keeps the crops inline.
23851
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23852
+ * index and stops reading as soon as `limit` rows have PASSED the
23853
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23854
+ * certain row may be the oldest so it walks the window. Narrow it
23855
+ * with {@link since} / {@link until}.
23856
+ */
23857
+ sortBy: FaceSortFieldEnum.optional(),
23858
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23859
+ sortDirection: FaceSortDirectionEnum.optional(),
23860
+ /**
23861
+ * Inline the base64 crop on every row.
23862
+ *
23863
+ * Default `false` since the 2026-08-25 inversion — see
23864
+ * `include-crops-default.ts`, which is the ONE place that resolves
23865
+ * this for every gallery, and which records why the inline shape had
23866
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23867
+ * The doc here used to still say `true`; it was wrong, and a leftover
23868
+ * that describes the old design reads as permission to rely on it.
23869
+ *
23870
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23871
+ * which the browser fetches off the `event-media` plane in parallel,
23872
+ * cached and ETagged.
23710
23873
  */
23711
23874
  includeCrops: boolean().optional()
23712
23875
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23742,13 +23905,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23742
23905
  }), method(object({
23743
23906
  threshold: number().min(0).max(1).optional(),
23744
23907
  minClusterSize: number().int().min(2).optional(),
23745
- limit: number().int().positive().optional()
23746
- }).optional(), array(object({
23747
- faceIds: array(string()).readonly(),
23748
- representativeFaceId: string(),
23749
- size: number().int(),
23750
- cohesion: number()
23751
- })).readonly());
23908
+ /**
23909
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23910
+ * which read as though it bounded the work — it never did.
23911
+ *
23912
+ * Wins over {@link limit} when both are sent.
23913
+ */
23914
+ maxClusters: number().int().positive().optional(),
23915
+ /**
23916
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23917
+ * RESULT, not the scan. Kept so existing callers keep working; send
23918
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23919
+ */
23920
+ limit: number().int().positive().optional(),
23921
+ /**
23922
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23923
+ * POOL, not the result.
23924
+ *
23925
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23926
+ * used to read every unassigned face on the hub no matter what the
23927
+ * caller asked for, because the only bound cut the finished clusters
23928
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23929
+ * whole corpus, on an addon whose disk is under contention.
23930
+ *
23931
+ * The pool is the NEWEST matching faces first — the same order the
23932
+ * gallery shows — so a bound here shortens the horizon, it does not
23933
+ * sample it randomly.
23934
+ *
23935
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23936
+ * so the live corpus — 372 face rows — is unaffected while the
23937
+ * unbounded scan can never come back as the table grows.
23938
+ */
23939
+ maxFacesScanned: number().int().positive().optional()
23940
+ }).optional(), array(FaceClusterSchema).readonly());
23752
23941
  /**
23753
23942
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23754
23943
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27506,6 +27695,39 @@ var ReadGopBytesResultSchema = object({
27506
27695
  /** Media ms the returned fragment covers. */
27507
27696
  gopDurMs: number()
27508
27697
  });
27698
+ /**
27699
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27700
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27701
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27702
+ * a replay needs several seconds of native pixels, not one frame.
27703
+ *
27704
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27705
+ * is `false` when the returned bytes were cut short by the read's own safety
27706
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27707
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27708
+ * degradation: a window whose end falls past the covering segment would need
27709
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27710
+ * not one standalone-demuxable stream — the caller's answer is to request a
27711
+ * shorter window or one aligned to a single segment, not to receive spliced
27712
+ * bytes nothing has proven decodable.
27713
+ */
27714
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27715
+ kind: literal("ok"),
27716
+ data: _instanceof(Uint8Array),
27717
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27718
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27719
+ gopStartMs: number(),
27720
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27721
+ gopDurMs: number(),
27722
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27723
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27724
+ reachesRequestedEnd: boolean()
27725
+ }), object({
27726
+ kind: literal("spans-multiple-segments"),
27727
+ /** Where the covering segment's own footage runs out — informational,
27728
+ * not a retry hint (retrying the same window would refuse again). */
27729
+ segmentEndMs: number()
27730
+ })]);
27509
27731
  method(object({
27510
27732
  deviceId: number(),
27511
27733
  fromMs: number(),
@@ -27556,6 +27778,15 @@ method(object({
27556
27778
  }), ReadGopBytesResultSchema, {
27557
27779
  kind: "query",
27558
27780
  auth: "admin"
27781
+ }), method(object({
27782
+ deviceId: number(),
27783
+ profile: string(),
27784
+ startMs: number(),
27785
+ fromMs: number(),
27786
+ toMs: number()
27787
+ }), ReadWindowBytesResultSchema, {
27788
+ kind: "query",
27789
+ auth: "admin"
27559
27790
  }), method(object({
27560
27791
  deviceId: number(),
27561
27792
  config: RecordingConfigSchema
@@ -28648,6 +28879,211 @@ var SetSiteLocationInputSchema = object({
28648
28879
  latitude: number().min(-90).max(90),
28649
28880
  longitude: number().min(-180).max(180)
28650
28881
  }).nullable();
28882
+ /**
28883
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28884
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28885
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28886
+ * already prints - never a token, never an `Authorization` header.
28887
+ */
28888
+ var RequestCensusGroupSchema = object({
28889
+ procedure: string(),
28890
+ userAgent: string(),
28891
+ ip: string(),
28892
+ principal: string(),
28893
+ calls: number(),
28894
+ perMin: number()
28895
+ });
28896
+ /**
28897
+ * A procedure's TOTAL over the window, across every caller.
28898
+ *
28899
+ * This block, not the group list, is what answers "did these calls arrive over
28900
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28901
+ * same window excludes the HTTP plane, which is a result, not a failure.
28902
+ */
28903
+ var RequestCensusProcedureSchema = object({
28904
+ procedure: string(),
28905
+ calls: number(),
28906
+ perMin: number()
28907
+ });
28908
+ /**
28909
+ * The census as an operator sees it.
28910
+ *
28911
+ * `persisted` is the honest answer to "will this survive the restart I am
28912
+ * about to do": the arm deadline is written to `system-settings` so a window
28913
+ * armed now can measure the NEXT boot, and a write that failed must not look
28914
+ * like one that succeeded.
28915
+ */
28916
+ var RequestCensusStatusSchema = object({
28917
+ armed: boolean(),
28918
+ /** How long the current - or just-closed - window collected, in ms. */
28919
+ elapsedMs: number(),
28920
+ /** The window actually armed, after the server clamped the request. */
28921
+ windowMs: number(),
28922
+ /** Epoch ms the window closes at. 0 when disarmed. */
28923
+ armedUntilMs: number(),
28924
+ httpRequests: number(),
28925
+ batchedRequests: number(),
28926
+ /**
28927
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28928
+ * is in play (`?batch=1` carries several procedures in one request); this is
28929
+ * the number comparable with a store-side call count.
28930
+ */
28931
+ procedureCalls: number(),
28932
+ /**
28933
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28934
+ * transport resolves one context per connection - but the number that says
28935
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28936
+ */
28937
+ wsConnections: number(),
28938
+ distinctGroups: number(),
28939
+ /** Calls counted in the totals whose group attribution was shed at the
28940
+ * cardinality bound. */
28941
+ unattributedCalls: number(),
28942
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28943
+ groups: array(RequestCensusGroupSchema).readonly()
28944
+ }).extend({ persisted: boolean() });
28945
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28946
+ var LogLevelSchema$1 = _enum([
28947
+ "debug",
28948
+ "info",
28949
+ "warn",
28950
+ "error"
28951
+ ]);
28952
+ /**
28953
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28954
+ *
28955
+ * A diagnostic is anything whose cost is only worth paying while a question is
28956
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28957
+ */
28958
+ var DiagnosticIdSchema = _enum(["request-census"]);
28959
+ /**
28960
+ * The layers of the level hierarchy, general → specific. The most specific
28961
+ * layer that carries an explicit value wins.
28962
+ *
28963
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28964
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28965
+ * grow later would force every consumer of this document to change with it.
28966
+ * Nothing returns `component` today.
28967
+ */
28968
+ var LoggingScopeKindSchema = _enum([
28969
+ "cluster",
28970
+ "node",
28971
+ "component"
28972
+ ]);
28973
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28974
+ var LoggingLevelSourceSchema = _enum([
28975
+ "default",
28976
+ "cluster",
28977
+ "node",
28978
+ "component"
28979
+ ]);
28980
+ /**
28981
+ * One layer of the hierarchy as it actually STANDS.
28982
+ *
28983
+ * `level: null` is the whole reason this array is returned: it is the
28984
+ * difference between "this node is at `info` because I decided it" and
28985
+ * "...because it inherits". An operator who clears an override believing they
28986
+ * are clearing an inherited value has been handed the same defect as the two
28987
+ * contradicting knobs this document exists to remove, moved one floor up.
28988
+ */
28989
+ var LoggingLevelLayerSchema = object({
28990
+ scope: LoggingScopeKindSchema,
28991
+ /** The node this layer speaks for; `null` on the cluster layer. */
28992
+ nodeId: string().nullable(),
28993
+ /** Explicitly set here, or `null` when this layer inherits. */
28994
+ level: LogLevelSchema$1.nullable()
28995
+ });
28996
+ /** What a line is judged against, and WHICH layer decided it. */
28997
+ var LoggingEffectiveSchema = object({
28998
+ level: LogLevelSchema$1,
28999
+ levelSource: LoggingLevelSourceSchema
29000
+ });
29001
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29002
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29003
+ /**
29004
+ * An armed diagnostic, with its DEADLINE.
29005
+ *
29006
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29007
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29008
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29009
+ * `armed` is false — a window is never reported as slightly expired.
29010
+ */
29011
+ var DiagnosticWindowSchema = object({
29012
+ id: DiagnosticIdSchema,
29013
+ armed: boolean(),
29014
+ /** Epoch ms the window closes at. 0 when disarmed. */
29015
+ armedUntilMs: number(),
29016
+ /** Ms left before it expires on its own. 0 when disarmed. */
29017
+ remainingMs: number(),
29018
+ /** Whether the stored deadline is the one the live diagnostic is running —
29019
+ * i.e. whether this window would survive a restart. */
29020
+ persisted: boolean()
29021
+ });
29022
+ /**
29023
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29024
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29025
+ * is a second knob that disagrees with the first the day one of them moves.
29026
+ */
29027
+ var DiagnosticWindowPatchSchema = object({
29028
+ id: DiagnosticIdSchema,
29029
+ armMs: number().int().min(0),
29030
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29031
+ reportEveryMs: number().int().positive().optional()
29032
+ });
29033
+ /**
29034
+ * A PATCH, and patches MERGE.
29035
+ *
29036
+ * A field absent from the patch is left exactly as it was — arming a
29037
+ * diagnostic never resets a level, and setting a level never disarms a window.
29038
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29039
+ * `setAll` already merges, and rebuilding the object is how an absent field
29040
+ * turns into an erased one.
29041
+ */
29042
+ var LoggingSettingsPatchSchema = object({
29043
+ /**
29044
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29045
+ * addressed scope so it inherits again. A value sets it.
29046
+ */
29047
+ level: LogLevelSchema$1.nullable().optional(),
29048
+ /**
29049
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29050
+ * keeps running — a patch is never a full replacement.
29051
+ */
29052
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29053
+ });
29054
+ /**
29055
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29056
+ *
29057
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29058
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29059
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29060
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29061
+ * by an agent that holds no cluster document at all. The hub is the single
29062
+ * authority over the whole hierarchy and answers for every layer, so the
29063
+ * layer selector needs a name the transport does not already own.
29064
+ */
29065
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29066
+ var SetLoggingSettingsInputSchema = object({
29067
+ scopeNodeId: string().optional(),
29068
+ patch: LoggingSettingsPatchSchema
29069
+ });
29070
+ /**
29071
+ * The whole document, as read and as returned after every write.
29072
+ *
29073
+ * `persisted: false` means the settings store could not be read or written.
29074
+ * The in-memory mirror still governs behaviour and is unchanged by the
29075
+ * failure — a read that fails neither switches a level nor disarms a window
29076
+ * (D49) — but the operator is told that what they are looking at would not
29077
+ * survive a restart.
29078
+ */
29079
+ var LoggingSettingsStateSchema = object({
29080
+ /** The layer this document was read at. `null` = the cluster layer. */
29081
+ scopeNodeId: string().nullable(),
29082
+ effective: LoggingEffectiveSchema,
29083
+ explicit: LoggingExplicitSchema,
29084
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29085
+ persisted: boolean()
29086
+ });
28651
29087
  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(), {
28652
29088
  kind: "mutation",
28653
29089
  auth: "admin"
@@ -28660,6 +29096,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28660
29096
  }), method(_void(), SiteLocationStatusSchema, {
28661
29097
  kind: "mutation",
28662
29098
  auth: "admin"
29099
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29100
+ kind: "mutation",
29101
+ auth: "admin"
28663
29102
  });
28664
29103
  /**
28665
29104
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33643,6 +34082,12 @@ Object.freeze({
33643
34082
  addonId: null,
33644
34083
  access: "view"
33645
34084
  },
34085
+ "notificationRules.resolveArtifactUrl": {
34086
+ capName: "notification-rules",
34087
+ capScope: "system",
34088
+ addonId: null,
34089
+ access: "view"
34090
+ },
33646
34091
  "notificationRules.setAlarmConfig": {
33647
34092
  capName: "notification-rules",
33648
34093
  capScope: "system",
@@ -35047,6 +35492,12 @@ Object.freeze({
35047
35492
  addonId: null,
35048
35493
  access: "view"
35049
35494
  },
35495
+ "recording.readWindowBytes": {
35496
+ capName: "recording",
35497
+ capScope: "system",
35498
+ addonId: null,
35499
+ access: "view"
35500
+ },
35050
35501
  "recording.refreshStorageLocationsForMigration": {
35051
35502
  capName: "recording",
35052
35503
  capScope: "system",
@@ -35887,6 +36338,18 @@ Object.freeze({
35887
36338
  addonId: null,
35888
36339
  access: "create"
35889
36340
  },
36341
+ "system.getLoggingSettings": {
36342
+ capName: "system",
36343
+ capScope: "system",
36344
+ addonId: null,
36345
+ access: "view"
36346
+ },
36347
+ "system.getRequestCensus": {
36348
+ capName: "system",
36349
+ capScope: "system",
36350
+ addonId: null,
36351
+ access: "view"
36352
+ },
35890
36353
  "system.getRetentionConfig": {
35891
36354
  capName: "system",
35892
36355
  capScope: "system",
@@ -35917,6 +36380,12 @@ Object.freeze({
35917
36380
  addonId: null,
35918
36381
  access: "view"
35919
36382
  },
36383
+ "system.setLoggingSettings": {
36384
+ capName: "system",
36385
+ capScope: "system",
36386
+ addonId: null,
36387
+ access: "create"
36388
+ },
35920
36389
  "system.setRetentionConfig": {
35921
36390
  capName: "system",
35922
36391
  capScope: "system",
@@ -37072,6 +37541,10 @@ Object.freeze({
37072
37541
  name: "deviceId",
37073
37542
  form: "single",
37074
37543
  optional: true
37544
+ }, {
37545
+ name: "deviceIds",
37546
+ form: "array",
37547
+ optional: true
37075
37548
  }],
37076
37549
  "fanControl.setDirection": [{
37077
37550
  name: "deviceId",
@@ -37877,6 +38350,11 @@ Object.freeze({
37877
38350
  form: "single",
37878
38351
  optional: false
37879
38352
  }],
38353
+ "recording.readWindowBytes": [{
38354
+ name: "deviceId",
38355
+ form: "single",
38356
+ optional: false
38357
+ }],
37880
38358
  "recording.relocateFootage": [{
37881
38359
  name: "deviceId",
37882
38360
  form: "single",
@@ -38884,7 +39362,38 @@ object({
38884
39362
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38885
39363
  * reproduce that.
38886
39364
  */
38887
- tileBudgetMb: number().int().min(0).max(1024)
39365
+ tileBudgetMb: number().int().min(0).max(1024),
39366
+ /**
39367
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39368
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39369
+ * subject tiles, on frames that detected something.
39370
+ *
39371
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39372
+ * containment is strict by design, so the native `keyFrame`, the detail
39373
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39374
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39375
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39376
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39377
+ *
39378
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39379
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39380
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39381
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39382
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39383
+ * binds only through a detection burst, where it still covers well past the
39384
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39385
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39386
+ * whole shape exists to avoid.
39387
+ *
39388
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39389
+ * subject tile, so one shared budget would let a busy camera's key frames
39390
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39391
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39392
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39393
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39394
+ * nothing.
39395
+ */
39396
+ sceneBudgetMb: number().int().min(0).max(1024)
38888
39397
  });
38889
39398
  /**
38890
39399
  * The values in force when the operator has set nothing.
@@ -38900,12 +39409,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38900
39409
  budgetMb: 1024,
38901
39410
  activityMs: 15e3,
38902
39411
  tileBudgetMb: 64,
39412
+ sceneBudgetMb: 48,
38903
39413
  admission: "inferred"
38904
39414
  };
38905
39415
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38906
39416
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38907
39417
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38908
39418
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39419
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38909
39420
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38910
39421
  /**
38911
39422
  * Pure fuzzy matcher for adoption location import. Normalized