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