@camstack/addon-provider-homematic 1.2.31 → 1.2.33

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
@@ -7536,6 +7536,66 @@ var OpsLogQueryInputSchema = object({
7536
7536
  /** Max rows returned, newest-first. */
7537
7537
  limit: number().int().min(1).max(1e3).optional()
7538
7538
  });
7539
+ var LabelDefinitionSchema = object({
7540
+ id: string(),
7541
+ name: string(),
7542
+ category: string().optional(),
7543
+ description: string().optional(),
7544
+ icon: string().optional()
7545
+ });
7546
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7547
+ var CLASS_MAP_MACRO_TARGETS = [
7548
+ "person",
7549
+ "vehicle",
7550
+ "animal",
7551
+ "package"
7552
+ ];
7553
+ /**
7554
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7555
+ * un operatore può selezionare.
7556
+ *
7557
+ * Sono le tre offerte dallo step `object-detection`
7558
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7559
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7560
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7561
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7562
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7563
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7564
+ *
7565
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7566
+ * dello step e una seconda volta come union `FirstLevelMacro`
7567
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7568
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7569
+ * successiva.
7570
+ */
7571
+ var FIRST_LEVEL_MACRO_CLASSES = [
7572
+ "person",
7573
+ "vehicle",
7574
+ "animal"
7575
+ ];
7576
+ /**
7577
+ * Wire schema for a per-model CATALOG classMap override
7578
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7579
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7580
+ * detection pipeline executor actually routes.
7581
+ *
7582
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7583
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7584
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7585
+ * enum) — the two used to share the name `ClassMapDefinition`/
7586
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7587
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7588
+ * are not: it is two different concepts colliding on a name. Keep this type
7589
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7590
+ * would either narrow every `ClassMapDefinition` consumer to the four
7591
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7592
+ * schema exists for (see the "rejects a classMap whose target is not a
7593
+ * detection macro" test in `model-catalog-schema.test.ts`).
7594
+ */
7595
+ var DetectionCatalogClassMapSchema = object({
7596
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7597
+ preserveOriginal: boolean()
7598
+ });
7539
7599
  /**
7540
7600
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7541
7601
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7558,10 +7618,55 @@ var RecordingStorageModeSchema = _enum([
7558
7618
  "events",
7559
7619
  "continuous"
7560
7620
  ]);
7621
+ /**
7622
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7623
+ * tre offerte dallo step `object-detection`, da UNA lista
7624
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7625
+ */
7626
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7627
+ /**
7628
+ * True quando `values` non ripete un elemento.
7629
+ *
7630
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7631
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7632
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7633
+ */
7634
+ var noDuplicates = (values) => new Set(values).size === values.length;
7561
7635
  /** Which detectors trigger an `events`-mode band. */
7562
7636
  var RecordingTriggersSchema = object({
7563
7637
  motion: boolean().optional(),
7564
- audioThresholdDbfs: number().optional()
7638
+ audioThresholdDbfs: number().optional(),
7639
+ /**
7640
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7641
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7642
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7643
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7644
+ *
7645
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7646
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7647
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7648
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7649
+ * finestre — vedi `recorder/object-trigger.ts`.
7650
+ */
7651
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7652
+ /**
7653
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7654
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7655
+ * `objectClasses`.
7656
+ *
7657
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7658
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7659
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7660
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7661
+ * device (D12) — mai un elenco globale di cap.
7662
+ *
7663
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7664
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7665
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7666
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7667
+ * registrare.
7668
+ */
7669
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7565
7670
  });
7566
7671
  /**
7567
7672
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8013,41 +8118,6 @@ var DecoderSessionConfigSchema = object({
8013
8118
  */
8014
8119
  debug: boolean().optional()
8015
8120
  });
8016
- var LabelDefinitionSchema = object({
8017
- id: string(),
8018
- name: string(),
8019
- category: string().optional(),
8020
- description: string().optional(),
8021
- icon: string().optional()
8022
- });
8023
- /**
8024
- * Wire schema for a per-model CATALOG classMap override
8025
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8026
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8027
- * detection pipeline executor actually routes.
8028
- *
8029
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8030
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8031
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8032
- * enum) — the two used to share the name `ClassMapDefinition`/
8033
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8034
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8035
- * are not: it is two different concepts colliding on a name. Keep this type
8036
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8037
- * would either narrow every `ClassMapDefinition` consumer to the four
8038
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8039
- * schema exists for (see the "rejects a classMap whose target is not a
8040
- * detection macro" test in `model-catalog-schema.test.ts`).
8041
- */
8042
- var DetectionCatalogClassMapSchema = object({
8043
- mapping: record(string(), _enum([
8044
- "person",
8045
- "vehicle",
8046
- "animal",
8047
- "package"
8048
- ])),
8049
- preserveOriginal: boolean()
8050
- });
8051
8121
  var MODEL_FORMATS = [
8052
8122
  "onnx",
8053
8123
  "coreml",
@@ -15858,7 +15928,23 @@ var NcHistoryEntrySchema = object({
15858
15928
  updatedAt: number(),
15859
15929
  /** Failure detail — present on a `dead` row. */
15860
15930
  error: string().optional(),
15861
- subject: NcHistorySubjectSchema
15931
+ subject: NcHistorySubjectSchema,
15932
+ /**
15933
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15934
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15935
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15936
+ * every delivery attempt). Absent on a row still pending/dead, a row
15937
+ * delivered before this field shipped, or a wiring with no artefact index.
15938
+ *
15939
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15940
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15941
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15942
+ * also answers `null` for an id whose artefact has since expired past the
15943
+ * retained shelf's own age bound — the degrade a caller (the Home
15944
+ * Assistant export) must render as "no image right now", never as a
15945
+ * broken link.
15946
+ */
15947
+ artifactIds: array(string().min(1)).optional()
15862
15948
  });
15863
15949
  /**
15864
15950
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16085,7 +16171,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16085
16171
  }), method(object({}), object({
16086
16172
  catalog: array(NcConditionDescriptorSchema),
16087
16173
  taxonomy: NcTaxonomySchema.optional()
16088
- })), 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 }), {
16174
+ })), 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 }), {
16089
16175
  kind: "mutation",
16090
16176
  caller: "required"
16091
16177
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21213,7 +21299,7 @@ var lifecycleJobSchema = object({
21213
21299
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21214
21300
  * as every other cap.
21215
21301
  */
21216
- var LogLevelSchema$1 = _enum([
21302
+ var LogLevelSchema$2 = _enum([
21217
21303
  "debug",
21218
21304
  "info",
21219
21305
  "warn",
@@ -21420,7 +21506,7 @@ var CustomActionInputSchema = object({
21420
21506
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21421
21507
  addonId: string(),
21422
21508
  limit: number().min(1).max(500).default(100),
21423
- level: LogLevelSchema$1.optional()
21509
+ level: LogLevelSchema$2.optional()
21424
21510
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21425
21511
  packageName: string(),
21426
21512
  version: string().optional()
@@ -21518,7 +21604,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21518
21604
  auth: "admin"
21519
21605
  }), method(object({
21520
21606
  addonId: string(),
21521
- level: LogLevelSchema$1.optional()
21607
+ level: LogLevelSchema$2.optional()
21522
21608
  }), LogStreamEntrySchema, { kind: "subscription" });
21523
21609
  /**
21524
21610
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23242,6 +23328,35 @@ var FaceFilterEnum = _enum([
23242
23328
  "identified",
23243
23329
  "all"
23244
23330
  ]);
23331
+ /**
23332
+ * What a `listRecentFaces` page is ORDERED BY.
23333
+ *
23334
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23335
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23336
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23337
+ * order: it puts the suggestions an operator can confirm with one tap at the
23338
+ * top, and it is the reason this enum exists — a client that ranked a capped
23339
+ * page client-side was ranking the newest N, never the most certain N.
23340
+ *
23341
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23342
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23343
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23344
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23345
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23346
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23347
+ * then by faceId, and is what makes this a total order instead of the
23348
+ * backend's NULL-collation accident.
23349
+ */
23350
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23351
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23352
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23353
+ * never leaves the server. */
23354
+ var FaceClusterSchema = object({
23355
+ faceIds: array(string()).readonly(),
23356
+ representativeFaceId: string(),
23357
+ size: number().int(),
23358
+ cohesion: number()
23359
+ });
23245
23360
  var MediaFileLiteSchema$1 = object({
23246
23361
  key: string(),
23247
23362
  kind: string(),
@@ -23288,24 +23403,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23288
23403
  kind: "mutation",
23289
23404
  auth: "admin"
23290
23405
  }), method(object({
23291
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23406
+ /**
23407
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23408
+ *
23409
+ * The legacy single-camera form, kept verbatim for every caller that
23410
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23411
+ * instead — never both: `deviceIds` is the authority whenever it is
23412
+ * present, and this field is then ignored rather than unioned, so
23413
+ * there is exactly one answer to "which cameras did I ask for".
23414
+ */
23292
23415
  deviceId: number().int().optional(),
23416
+ /**
23417
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23418
+ * until now had to fetch the cluster-wide page and drop rows in the
23419
+ * client (so the `limit` it asked for was spent on cameras it was
23420
+ * about to discard).
23421
+ *
23422
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23423
+ * "every camera". A request for no devices is a request, not an
23424
+ * omission; same contract as `deviceManager.listFleet` and
23425
+ * `pipelineAnalytics.listRecentTracks`.
23426
+ *
23427
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23428
+ */
23429
+ deviceIds: array(number().int()).optional(),
23293
23430
  limit: number().int().positive().optional(),
23294
23431
  filter: FaceFilterEnum.optional(),
23295
23432
  /**
23296
- * Inline the base64 crop on every row. Default `true` — the existing
23297
- * behaviour, kept so no caller breaks.
23433
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23434
+ * Absent means no lower bound.
23435
+ */
23436
+ since: number().int().optional(),
23437
+ /**
23438
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23439
+ * Absent means no upper bound.
23440
+ */
23441
+ until: number().int().optional(),
23442
+ /**
23443
+ * Order the page by time or by suggestion certainty. Default
23444
+ * `'timestamp'` — the historical order, unchanged for every caller
23445
+ * that does not ask.
23298
23446
  *
23299
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23300
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23301
- * the browser cache the images.
23447
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23448
+ * does under `'suggestionConfidence'`.
23302
23449
  *
23303
- * **This is an INPUT field, so it does not reach the addon until the
23304
- * next train.** The hub router validates cap inputs against its own
23305
- * compiled Zod, which strips a key it does not know — verified today
23306
- * on the OUTPUT side, where an additive field DOES arrive immediately
23307
- * (`Track.hasFace`). Until the train ships, sending `false` is
23308
- * harmless and simply keeps the crops inline.
23450
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23451
+ * index and stops reading as soon as `limit` rows have PASSED the
23452
+ * filter. `'suggestionConfidence'` cannot stop early — the most
23453
+ * certain row may be the oldest — so it walks the window. Narrow it
23454
+ * with {@link since} / {@link until}.
23455
+ */
23456
+ sortBy: FaceSortFieldEnum.optional(),
23457
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23458
+ sortDirection: FaceSortDirectionEnum.optional(),
23459
+ /**
23460
+ * Inline the base64 crop on every row.
23461
+ *
23462
+ * Default `false` since the 2026-08-25 inversion — see
23463
+ * `include-crops-default.ts`, which is the ONE place that resolves
23464
+ * this for every gallery, and which records why the inline shape had
23465
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23466
+ * The doc here used to still say `true`; it was wrong, and a leftover
23467
+ * that describes the old design reads as permission to rely on it.
23468
+ *
23469
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23470
+ * which the browser fetches off the `event-media` plane in parallel,
23471
+ * cached and ETagged.
23309
23472
  */
23310
23473
  includeCrops: boolean().optional()
23311
23474
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23341,13 +23504,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23341
23504
  }), method(object({
23342
23505
  threshold: number().min(0).max(1).optional(),
23343
23506
  minClusterSize: number().int().min(2).optional(),
23344
- limit: number().int().positive().optional()
23345
- }).optional(), array(object({
23346
- faceIds: array(string()).readonly(),
23347
- representativeFaceId: string(),
23348
- size: number().int(),
23349
- cohesion: number()
23350
- })).readonly());
23507
+ /**
23508
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23509
+ * which read as though it bounded the work — it never did.
23510
+ *
23511
+ * Wins over {@link limit} when both are sent.
23512
+ */
23513
+ maxClusters: number().int().positive().optional(),
23514
+ /**
23515
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23516
+ * RESULT, not the scan. Kept so existing callers keep working; send
23517
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23518
+ */
23519
+ limit: number().int().positive().optional(),
23520
+ /**
23521
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23522
+ * POOL, not the result.
23523
+ *
23524
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23525
+ * used to read every unassigned face on the hub no matter what the
23526
+ * caller asked for, because the only bound cut the finished clusters
23527
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23528
+ * whole corpus, on an addon whose disk is under contention.
23529
+ *
23530
+ * The pool is the NEWEST matching faces first — the same order the
23531
+ * gallery shows — so a bound here shortens the horizon, it does not
23532
+ * sample it randomly.
23533
+ *
23534
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23535
+ * so the live corpus — 372 face rows — is unaffected while the
23536
+ * unbounded scan can never come back as the table grows.
23537
+ */
23538
+ maxFacesScanned: number().int().positive().optional()
23539
+ }).optional(), array(FaceClusterSchema).readonly());
23351
23540
  /**
23352
23541
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23353
23542
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27105,6 +27294,39 @@ var ReadGopBytesResultSchema = object({
27105
27294
  /** Media ms the returned fragment covers. */
27106
27295
  gopDurMs: number()
27107
27296
  });
27297
+ /**
27298
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27299
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27300
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27301
+ * a replay needs several seconds of native pixels, not one frame.
27302
+ *
27303
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27304
+ * is `false` when the returned bytes were cut short by the read's own safety
27305
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27306
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27307
+ * degradation: a window whose end falls past the covering segment would need
27308
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27309
+ * not one standalone-demuxable stream — the caller's answer is to request a
27310
+ * shorter window or one aligned to a single segment, not to receive spliced
27311
+ * bytes nothing has proven decodable.
27312
+ */
27313
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27314
+ kind: literal("ok"),
27315
+ data: _instanceof(Uint8Array),
27316
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27317
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27318
+ gopStartMs: number(),
27319
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27320
+ gopDurMs: number(),
27321
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27322
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27323
+ reachesRequestedEnd: boolean()
27324
+ }), object({
27325
+ kind: literal("spans-multiple-segments"),
27326
+ /** Where the covering segment's own footage runs out — informational,
27327
+ * not a retry hint (retrying the same window would refuse again). */
27328
+ segmentEndMs: number()
27329
+ })]);
27108
27330
  method(object({
27109
27331
  deviceId: number(),
27110
27332
  fromMs: number(),
@@ -27155,6 +27377,15 @@ method(object({
27155
27377
  }), ReadGopBytesResultSchema, {
27156
27378
  kind: "query",
27157
27379
  auth: "admin"
27380
+ }), method(object({
27381
+ deviceId: number(),
27382
+ profile: string(),
27383
+ startMs: number(),
27384
+ fromMs: number(),
27385
+ toMs: number()
27386
+ }), ReadWindowBytesResultSchema, {
27387
+ kind: "query",
27388
+ auth: "admin"
27158
27389
  }), method(object({
27159
27390
  deviceId: number(),
27160
27391
  config: RecordingConfigSchema
@@ -28247,6 +28478,211 @@ var SetSiteLocationInputSchema = object({
28247
28478
  latitude: number().min(-90).max(90),
28248
28479
  longitude: number().min(-180).max(180)
28249
28480
  }).nullable();
28481
+ /**
28482
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28483
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28484
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28485
+ * already prints - never a token, never an `Authorization` header.
28486
+ */
28487
+ var RequestCensusGroupSchema = object({
28488
+ procedure: string(),
28489
+ userAgent: string(),
28490
+ ip: string(),
28491
+ principal: string(),
28492
+ calls: number(),
28493
+ perMin: number()
28494
+ });
28495
+ /**
28496
+ * A procedure's TOTAL over the window, across every caller.
28497
+ *
28498
+ * This block, not the group list, is what answers "did these calls arrive over
28499
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28500
+ * same window excludes the HTTP plane, which is a result, not a failure.
28501
+ */
28502
+ var RequestCensusProcedureSchema = object({
28503
+ procedure: string(),
28504
+ calls: number(),
28505
+ perMin: number()
28506
+ });
28507
+ /**
28508
+ * The census as an operator sees it.
28509
+ *
28510
+ * `persisted` is the honest answer to "will this survive the restart I am
28511
+ * about to do": the arm deadline is written to `system-settings` so a window
28512
+ * armed now can measure the NEXT boot, and a write that failed must not look
28513
+ * like one that succeeded.
28514
+ */
28515
+ var RequestCensusStatusSchema = object({
28516
+ armed: boolean(),
28517
+ /** How long the current - or just-closed - window collected, in ms. */
28518
+ elapsedMs: number(),
28519
+ /** The window actually armed, after the server clamped the request. */
28520
+ windowMs: number(),
28521
+ /** Epoch ms the window closes at. 0 when disarmed. */
28522
+ armedUntilMs: number(),
28523
+ httpRequests: number(),
28524
+ batchedRequests: number(),
28525
+ /**
28526
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28527
+ * is in play (`?batch=1` carries several procedures in one request); this is
28528
+ * the number comparable with a store-side call count.
28529
+ */
28530
+ procedureCalls: number(),
28531
+ /**
28532
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28533
+ * transport resolves one context per connection - but the number that says
28534
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28535
+ */
28536
+ wsConnections: number(),
28537
+ distinctGroups: number(),
28538
+ /** Calls counted in the totals whose group attribution was shed at the
28539
+ * cardinality bound. */
28540
+ unattributedCalls: number(),
28541
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28542
+ groups: array(RequestCensusGroupSchema).readonly()
28543
+ }).extend({ persisted: boolean() });
28544
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28545
+ var LogLevelSchema$1 = _enum([
28546
+ "debug",
28547
+ "info",
28548
+ "warn",
28549
+ "error"
28550
+ ]);
28551
+ /**
28552
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28553
+ *
28554
+ * A diagnostic is anything whose cost is only worth paying while a question is
28555
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28556
+ */
28557
+ var DiagnosticIdSchema = _enum(["request-census"]);
28558
+ /**
28559
+ * The layers of the level hierarchy, general → specific. The most specific
28560
+ * layer that carries an explicit value wins.
28561
+ *
28562
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28563
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28564
+ * grow later would force every consumer of this document to change with it.
28565
+ * Nothing returns `component` today.
28566
+ */
28567
+ var LoggingScopeKindSchema = _enum([
28568
+ "cluster",
28569
+ "node",
28570
+ "component"
28571
+ ]);
28572
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28573
+ var LoggingLevelSourceSchema = _enum([
28574
+ "default",
28575
+ "cluster",
28576
+ "node",
28577
+ "component"
28578
+ ]);
28579
+ /**
28580
+ * One layer of the hierarchy as it actually STANDS.
28581
+ *
28582
+ * `level: null` is the whole reason this array is returned: it is the
28583
+ * difference between "this node is at `info` because I decided it" and
28584
+ * "...because it inherits". An operator who clears an override believing they
28585
+ * are clearing an inherited value has been handed the same defect as the two
28586
+ * contradicting knobs this document exists to remove, moved one floor up.
28587
+ */
28588
+ var LoggingLevelLayerSchema = object({
28589
+ scope: LoggingScopeKindSchema,
28590
+ /** The node this layer speaks for; `null` on the cluster layer. */
28591
+ nodeId: string().nullable(),
28592
+ /** Explicitly set here, or `null` when this layer inherits. */
28593
+ level: LogLevelSchema$1.nullable()
28594
+ });
28595
+ /** What a line is judged against, and WHICH layer decided it. */
28596
+ var LoggingEffectiveSchema = object({
28597
+ level: LogLevelSchema$1,
28598
+ levelSource: LoggingLevelSourceSchema
28599
+ });
28600
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28601
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28602
+ /**
28603
+ * An armed diagnostic, with its DEADLINE.
28604
+ *
28605
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28606
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28607
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28608
+ * `armed` is false — a window is never reported as slightly expired.
28609
+ */
28610
+ var DiagnosticWindowSchema = object({
28611
+ id: DiagnosticIdSchema,
28612
+ armed: boolean(),
28613
+ /** Epoch ms the window closes at. 0 when disarmed. */
28614
+ armedUntilMs: number(),
28615
+ /** Ms left before it expires on its own. 0 when disarmed. */
28616
+ remainingMs: number(),
28617
+ /** Whether the stored deadline is the one the live diagnostic is running —
28618
+ * i.e. whether this window would survive a restart. */
28619
+ persisted: boolean()
28620
+ });
28621
+ /**
28622
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28623
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28624
+ * is a second knob that disagrees with the first the day one of them moves.
28625
+ */
28626
+ var DiagnosticWindowPatchSchema = object({
28627
+ id: DiagnosticIdSchema,
28628
+ armMs: number().int().min(0),
28629
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28630
+ reportEveryMs: number().int().positive().optional()
28631
+ });
28632
+ /**
28633
+ * A PATCH, and patches MERGE.
28634
+ *
28635
+ * A field absent from the patch is left exactly as it was — arming a
28636
+ * diagnostic never resets a level, and setting a level never disarms a window.
28637
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28638
+ * `setAll` already merges, and rebuilding the object is how an absent field
28639
+ * turns into an erased one.
28640
+ */
28641
+ var LoggingSettingsPatchSchema = object({
28642
+ /**
28643
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28644
+ * addressed scope so it inherits again. A value sets it.
28645
+ */
28646
+ level: LogLevelSchema$1.nullable().optional(),
28647
+ /**
28648
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28649
+ * keeps running — a patch is never a full replacement.
28650
+ */
28651
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28652
+ });
28653
+ /**
28654
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28655
+ *
28656
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28657
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28658
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28659
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28660
+ * by an agent that holds no cluster document at all. The hub is the single
28661
+ * authority over the whole hierarchy and answers for every layer, so the
28662
+ * layer selector needs a name the transport does not already own.
28663
+ */
28664
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28665
+ var SetLoggingSettingsInputSchema = object({
28666
+ scopeNodeId: string().optional(),
28667
+ patch: LoggingSettingsPatchSchema
28668
+ });
28669
+ /**
28670
+ * The whole document, as read and as returned after every write.
28671
+ *
28672
+ * `persisted: false` means the settings store could not be read or written.
28673
+ * The in-memory mirror still governs behaviour and is unchanged by the
28674
+ * failure — a read that fails neither switches a level nor disarms a window
28675
+ * (D49) — but the operator is told that what they are looking at would not
28676
+ * survive a restart.
28677
+ */
28678
+ var LoggingSettingsStateSchema = object({
28679
+ /** The layer this document was read at. `null` = the cluster layer. */
28680
+ scopeNodeId: string().nullable(),
28681
+ effective: LoggingEffectiveSchema,
28682
+ explicit: LoggingExplicitSchema,
28683
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28684
+ persisted: boolean()
28685
+ });
28250
28686
  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(), {
28251
28687
  kind: "mutation",
28252
28688
  auth: "admin"
@@ -28259,6 +28695,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28259
28695
  }), method(_void(), SiteLocationStatusSchema, {
28260
28696
  kind: "mutation",
28261
28697
  auth: "admin"
28698
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28699
+ kind: "mutation",
28700
+ auth: "admin"
28262
28701
  });
28263
28702
  /**
28264
28703
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33242,6 +33681,12 @@ Object.freeze({
33242
33681
  addonId: null,
33243
33682
  access: "view"
33244
33683
  },
33684
+ "notificationRules.resolveArtifactUrl": {
33685
+ capName: "notification-rules",
33686
+ capScope: "system",
33687
+ addonId: null,
33688
+ access: "view"
33689
+ },
33245
33690
  "notificationRules.setAlarmConfig": {
33246
33691
  capName: "notification-rules",
33247
33692
  capScope: "system",
@@ -34646,6 +35091,12 @@ Object.freeze({
34646
35091
  addonId: null,
34647
35092
  access: "view"
34648
35093
  },
35094
+ "recording.readWindowBytes": {
35095
+ capName: "recording",
35096
+ capScope: "system",
35097
+ addonId: null,
35098
+ access: "view"
35099
+ },
34649
35100
  "recording.refreshStorageLocationsForMigration": {
34650
35101
  capName: "recording",
34651
35102
  capScope: "system",
@@ -35486,6 +35937,18 @@ Object.freeze({
35486
35937
  addonId: null,
35487
35938
  access: "create"
35488
35939
  },
35940
+ "system.getLoggingSettings": {
35941
+ capName: "system",
35942
+ capScope: "system",
35943
+ addonId: null,
35944
+ access: "view"
35945
+ },
35946
+ "system.getRequestCensus": {
35947
+ capName: "system",
35948
+ capScope: "system",
35949
+ addonId: null,
35950
+ access: "view"
35951
+ },
35489
35952
  "system.getRetentionConfig": {
35490
35953
  capName: "system",
35491
35954
  capScope: "system",
@@ -35516,6 +35979,12 @@ Object.freeze({
35516
35979
  addonId: null,
35517
35980
  access: "view"
35518
35981
  },
35982
+ "system.setLoggingSettings": {
35983
+ capName: "system",
35984
+ capScope: "system",
35985
+ addonId: null,
35986
+ access: "create"
35987
+ },
35519
35988
  "system.setRetentionConfig": {
35520
35989
  capName: "system",
35521
35990
  capScope: "system",
@@ -36671,6 +37140,10 @@ Object.freeze({
36671
37140
  name: "deviceId",
36672
37141
  form: "single",
36673
37142
  optional: true
37143
+ }, {
37144
+ name: "deviceIds",
37145
+ form: "array",
37146
+ optional: true
36674
37147
  }],
36675
37148
  "fanControl.setDirection": [{
36676
37149
  name: "deviceId",
@@ -37476,6 +37949,11 @@ Object.freeze({
37476
37949
  form: "single",
37477
37950
  optional: false
37478
37951
  }],
37952
+ "recording.readWindowBytes": [{
37953
+ name: "deviceId",
37954
+ form: "single",
37955
+ optional: false
37956
+ }],
37479
37957
  "recording.relocateFootage": [{
37480
37958
  name: "deviceId",
37481
37959
  form: "single",
@@ -38276,7 +38754,38 @@ object({
38276
38754
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38277
38755
  * reproduce that.
38278
38756
  */
38279
- tileBudgetMb: number().int().min(0).max(1024)
38757
+ tileBudgetMb: number().int().min(0).max(1024),
38758
+ /**
38759
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38760
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38761
+ * subject tiles, on frames that detected something.
38762
+ *
38763
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38764
+ * containment is strict by design, so the native `keyFrame`, the detail
38765
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38766
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38767
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38768
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38769
+ *
38770
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38771
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38772
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38773
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38774
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38775
+ * binds only through a detection burst, where it still covers well past the
38776
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38777
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38778
+ * whole shape exists to avoid.
38779
+ *
38780
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38781
+ * subject tile, so one shared budget would let a busy camera's key frames
38782
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38783
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38784
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38785
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38786
+ * nothing.
38787
+ */
38788
+ sceneBudgetMb: number().int().min(0).max(1024)
38280
38789
  });
38281
38790
  /**
38282
38791
  * The values in force when the operator has set nothing.
@@ -38292,12 +38801,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38292
38801
  budgetMb: 1024,
38293
38802
  activityMs: 15e3,
38294
38803
  tileBudgetMb: 64,
38804
+ sceneBudgetMb: 48,
38295
38805
  admission: "inferred"
38296
38806
  };
38297
38807
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38298
38808
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38299
38809
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38300
38810
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38811
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38301
38812
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38302
38813
  /**
38303
38814
  * Pure fuzzy matcher for adoption location import. Normalized