@camstack/addon-provider-homematic 1.2.32 → 1.2.34

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 +577 -59
  2. package/dist/addon.mjs +577 -59
  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",
@@ -21229,7 +21299,7 @@ var lifecycleJobSchema = object({
21229
21299
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21230
21300
  * as every other cap.
21231
21301
  */
21232
- var LogLevelSchema$1 = _enum([
21302
+ var LogLevelSchema$2 = _enum([
21233
21303
  "debug",
21234
21304
  "info",
21235
21305
  "warn",
@@ -21436,7 +21506,7 @@ var CustomActionInputSchema = object({
21436
21506
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21437
21507
  addonId: string(),
21438
21508
  limit: number().min(1).max(500).default(100),
21439
- level: LogLevelSchema$1.optional()
21509
+ level: LogLevelSchema$2.optional()
21440
21510
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21441
21511
  packageName: string(),
21442
21512
  version: string().optional()
@@ -21534,7 +21604,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21534
21604
  auth: "admin"
21535
21605
  }), method(object({
21536
21606
  addonId: string(),
21537
- level: LogLevelSchema$1.optional()
21607
+ level: LogLevelSchema$2.optional()
21538
21608
  }), LogStreamEntrySchema, { kind: "subscription" });
21539
21609
  /**
21540
21610
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23258,6 +23328,35 @@ var FaceFilterEnum = _enum([
23258
23328
  "identified",
23259
23329
  "all"
23260
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
+ });
23261
23360
  var MediaFileLiteSchema$1 = object({
23262
23361
  key: string(),
23263
23362
  kind: string(),
@@ -23304,24 +23403,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23304
23403
  kind: "mutation",
23305
23404
  auth: "admin"
23306
23405
  }), method(object({
23307
- /** 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
+ */
23308
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(),
23309
23430
  limit: number().int().positive().optional(),
23310
23431
  filter: FaceFilterEnum.optional(),
23311
23432
  /**
23312
- * Inline the base64 crop on every row. Default `true` — the existing
23313
- * 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.
23314
23446
  *
23315
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23316
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23317
- * the browser cache the images.
23447
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23448
+ * does under `'suggestionConfidence'`.
23318
23449
  *
23319
- * **This is an INPUT field, so it does not reach the addon until the
23320
- * next train.** The hub router validates cap inputs against its own
23321
- * compiled Zod, which strips a key it does not know — verified today
23322
- * on the OUTPUT side, where an additive field DOES arrive immediately
23323
- * (`Track.hasFace`). Until the train ships, sending `false` is
23324
- * 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.
23325
23472
  */
23326
23473
  includeCrops: boolean().optional()
23327
23474
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23357,13 +23504,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23357
23504
  }), method(object({
23358
23505
  threshold: number().min(0).max(1).optional(),
23359
23506
  minClusterSize: number().int().min(2).optional(),
23360
- limit: number().int().positive().optional()
23361
- }).optional(), array(object({
23362
- faceIds: array(string()).readonly(),
23363
- representativeFaceId: string(),
23364
- size: number().int(),
23365
- cohesion: number()
23366
- })).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());
23367
23540
  /**
23368
23541
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23369
23542
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28305,6 +28478,293 @@ var SetSiteLocationInputSchema = object({
28305
28478
  latitude: number().min(-90).max(90),
28306
28479
  longitude: number().min(-180).max(180)
28307
28480
  }).nullable();
28481
+ /**
28482
+ * The TRANSPORT a call arrived on.
28483
+ *
28484
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
28485
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
28486
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
28487
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
28488
+ * checkable rather than asserted.
28489
+ *
28490
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
28491
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
28492
+ * connection; the viewer talks to the hub over `wsLink`
28493
+ * exclusively, so this is the plane the HTTP census could not see.
28494
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
28495
+ * never touches a socket and therefore never touched a census.
28496
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
28497
+ * that is exactly what its `0` asserts: every plane the hub has can name
28498
+ * itself. It is an output bucket, never a knob — a call that arrives on a
28499
+ * plane nobody instrumented lands here instead of vanishing from the total.
28500
+ */
28501
+ var TransportPlaneSchema = _enum([
28502
+ "http",
28503
+ "ws",
28504
+ "mesh",
28505
+ "unknown"
28506
+ ]);
28507
+ /**
28508
+ * Calls per plane. Every key is always present, `0` included — an absent plane
28509
+ * reads as "not instrumented", which is the one thing this census must never
28510
+ * make an operator wonder about.
28511
+ */
28512
+ var TransportPlaneCountsSchema = object({
28513
+ http: number(),
28514
+ ws: number(),
28515
+ mesh: number(),
28516
+ unknown: number()
28517
+ });
28518
+ /**
28519
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
28520
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28521
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28522
+ * already prints - never a token, never an `Authorization` header.
28523
+ *
28524
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
28525
+ * and lives for hours, so folding it into a call count makes one long-lived
28526
+ * stream look like a storm.
28527
+ */
28528
+ var RequestCensusGroupSchema = object({
28529
+ plane: TransportPlaneSchema,
28530
+ procedure: string(),
28531
+ userAgent: string(),
28532
+ ip: string(),
28533
+ principal: string(),
28534
+ calls: number(),
28535
+ subscriptions: number(),
28536
+ perMin: number()
28537
+ });
28538
+ /**
28539
+ * A procedure's TOTAL over the window, across every caller.
28540
+ *
28541
+ * This block, not the group list, is what answers "did these calls arrive over
28542
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28543
+ * same window excludes the HTTP plane, which is a result, not a failure.
28544
+ */
28545
+ var RequestCensusProcedureSchema = object({
28546
+ procedure: string(),
28547
+ calls: number(),
28548
+ /**
28549
+ * The same total, split by transport. THIS is the row that answers the
28550
+ * question the census exists for: one look at `deviceManager.listAll` says
28551
+ * which plane carried the 4 960, without joining two log lines by eye.
28552
+ */
28553
+ planes: TransportPlaneCountsSchema,
28554
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
28555
+ subscriptions: number(),
28556
+ perMin: number()
28557
+ });
28558
+ /**
28559
+ * The census as an operator sees it.
28560
+ *
28561
+ * `persisted` is the honest answer to "will this survive the restart I am
28562
+ * about to do": the arm deadline is written to `system-settings` so a window
28563
+ * armed now can measure the NEXT boot, and a write that failed must not look
28564
+ * like one that succeeded.
28565
+ */
28566
+ var RequestCensusStatusSchema = object({
28567
+ armed: boolean(),
28568
+ /** How long the current - or just-closed - window collected, in ms. */
28569
+ elapsedMs: number(),
28570
+ /** The window actually armed, after the server clamped the request. */
28571
+ windowMs: number(),
28572
+ /** Epoch ms the window closes at. 0 when disarmed. */
28573
+ armedUntilMs: number(),
28574
+ httpRequests: number(),
28575
+ batchedRequests: number(),
28576
+ /**
28577
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28578
+ * is in play (`?batch=1` carries several procedures in one request); this is
28579
+ * the number comparable with a store-side call count.
28580
+ */
28581
+ procedureCalls: number(),
28582
+ /**
28583
+ * `procedureCalls` split by transport. The four keys sum to
28584
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
28585
+ * `planesExplainTotal` is that identity, checked rather than assumed.
28586
+ */
28587
+ planes: TransportPlaneCountsSchema,
28588
+ /**
28589
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
28590
+ * on no plane at all - which is a RESULT (a plane is missing from the
28591
+ * instrument), not a failure, and it has to be visible to be read as one.
28592
+ */
28593
+ planesExplainTotal: boolean(),
28594
+ /**
28595
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28596
+ * adapter resolves one context per connection - kept because a plane's call
28597
+ * count of zero against 37 open connections says something different from a
28598
+ * plane with no connections at all.
28599
+ */
28600
+ wsConnections: number(),
28601
+ /**
28602
+ * Client frames the WS plane looked at. `wsMessages` far above
28603
+ * `planes.ws + subscriptions` means most traffic is not operations
28604
+ * (keepalives, connection params) - which is itself an answer.
28605
+ */
28606
+ wsMessages: number(),
28607
+ /**
28608
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
28609
+ * purpose: one live-events stream opened at boot and held for six hours is
28610
+ * one subscription, and counting it as a call would let a quiet plane
28611
+ * masquerade as the storm.
28612
+ */
28613
+ subscriptions: number(),
28614
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
28615
+ subscriptionStops: number(),
28616
+ distinctGroups: number(),
28617
+ /**
28618
+ * Operations counted in the totals whose CALLER attribution was shed at the
28619
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
28620
+ * which transport they arrived on, they just lost their group row.
28621
+ */
28622
+ unattributedCalls: number(),
28623
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28624
+ groups: array(RequestCensusGroupSchema).readonly()
28625
+ }).extend({ persisted: boolean() });
28626
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28627
+ var LogLevelSchema$1 = _enum([
28628
+ "debug",
28629
+ "info",
28630
+ "warn",
28631
+ "error"
28632
+ ]);
28633
+ /**
28634
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28635
+ *
28636
+ * A diagnostic is anything whose cost is only worth paying while a question is
28637
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28638
+ */
28639
+ var DiagnosticIdSchema = _enum(["request-census"]);
28640
+ /**
28641
+ * The layers of the level hierarchy, general → specific. The most specific
28642
+ * layer that carries an explicit value wins.
28643
+ *
28644
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28645
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28646
+ * grow later would force every consumer of this document to change with it.
28647
+ * Nothing returns `component` today.
28648
+ */
28649
+ var LoggingScopeKindSchema = _enum([
28650
+ "cluster",
28651
+ "node",
28652
+ "component"
28653
+ ]);
28654
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28655
+ var LoggingLevelSourceSchema = _enum([
28656
+ "default",
28657
+ "cluster",
28658
+ "node",
28659
+ "component"
28660
+ ]);
28661
+ /**
28662
+ * One layer of the hierarchy as it actually STANDS.
28663
+ *
28664
+ * `level: null` is the whole reason this array is returned: it is the
28665
+ * difference between "this node is at `info` because I decided it" and
28666
+ * "...because it inherits". An operator who clears an override believing they
28667
+ * are clearing an inherited value has been handed the same defect as the two
28668
+ * contradicting knobs this document exists to remove, moved one floor up.
28669
+ */
28670
+ var LoggingLevelLayerSchema = object({
28671
+ scope: LoggingScopeKindSchema,
28672
+ /** The node this layer speaks for; `null` on the cluster layer. */
28673
+ nodeId: string().nullable(),
28674
+ /** Explicitly set here, or `null` when this layer inherits. */
28675
+ level: LogLevelSchema$1.nullable()
28676
+ });
28677
+ /** What a line is judged against, and WHICH layer decided it. */
28678
+ var LoggingEffectiveSchema = object({
28679
+ level: LogLevelSchema$1,
28680
+ levelSource: LoggingLevelSourceSchema
28681
+ });
28682
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28683
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28684
+ /**
28685
+ * An armed diagnostic, with its DEADLINE.
28686
+ *
28687
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28688
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28689
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28690
+ * `armed` is false — a window is never reported as slightly expired.
28691
+ */
28692
+ var DiagnosticWindowSchema = object({
28693
+ id: DiagnosticIdSchema,
28694
+ armed: boolean(),
28695
+ /** Epoch ms the window closes at. 0 when disarmed. */
28696
+ armedUntilMs: number(),
28697
+ /** Ms left before it expires on its own. 0 when disarmed. */
28698
+ remainingMs: number(),
28699
+ /** Whether the stored deadline is the one the live diagnostic is running —
28700
+ * i.e. whether this window would survive a restart. */
28701
+ persisted: boolean()
28702
+ });
28703
+ /**
28704
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28705
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28706
+ * is a second knob that disagrees with the first the day one of them moves.
28707
+ */
28708
+ var DiagnosticWindowPatchSchema = object({
28709
+ id: DiagnosticIdSchema,
28710
+ armMs: number().int().min(0),
28711
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28712
+ reportEveryMs: number().int().positive().optional()
28713
+ });
28714
+ /**
28715
+ * A PATCH, and patches MERGE.
28716
+ *
28717
+ * A field absent from the patch is left exactly as it was — arming a
28718
+ * diagnostic never resets a level, and setting a level never disarms a window.
28719
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28720
+ * `setAll` already merges, and rebuilding the object is how an absent field
28721
+ * turns into an erased one.
28722
+ */
28723
+ var LoggingSettingsPatchSchema = object({
28724
+ /**
28725
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28726
+ * addressed scope so it inherits again. A value sets it.
28727
+ */
28728
+ level: LogLevelSchema$1.nullable().optional(),
28729
+ /**
28730
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28731
+ * keeps running — a patch is never a full replacement.
28732
+ */
28733
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28734
+ });
28735
+ /**
28736
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28737
+ *
28738
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28739
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28740
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28741
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28742
+ * by an agent that holds no cluster document at all. The hub is the single
28743
+ * authority over the whole hierarchy and answers for every layer, so the
28744
+ * layer selector needs a name the transport does not already own.
28745
+ */
28746
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28747
+ var SetLoggingSettingsInputSchema = object({
28748
+ scopeNodeId: string().optional(),
28749
+ patch: LoggingSettingsPatchSchema
28750
+ });
28751
+ /**
28752
+ * The whole document, as read and as returned after every write.
28753
+ *
28754
+ * `persisted: false` means the settings store could not be read or written.
28755
+ * The in-memory mirror still governs behaviour and is unchanged by the
28756
+ * failure — a read that fails neither switches a level nor disarms a window
28757
+ * (D49) — but the operator is told that what they are looking at would not
28758
+ * survive a restart.
28759
+ */
28760
+ var LoggingSettingsStateSchema = object({
28761
+ /** The layer this document was read at. `null` = the cluster layer. */
28762
+ scopeNodeId: string().nullable(),
28763
+ effective: LoggingEffectiveSchema,
28764
+ explicit: LoggingExplicitSchema,
28765
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28766
+ persisted: boolean()
28767
+ });
28308
28768
  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(), {
28309
28769
  kind: "mutation",
28310
28770
  auth: "admin"
@@ -28317,6 +28777,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28317
28777
  }), method(_void(), SiteLocationStatusSchema, {
28318
28778
  kind: "mutation",
28319
28779
  auth: "admin"
28780
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28781
+ kind: "mutation",
28782
+ auth: "admin"
28320
28783
  });
28321
28784
  /**
28322
28785
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35556,6 +36019,18 @@ Object.freeze({
35556
36019
  addonId: null,
35557
36020
  access: "create"
35558
36021
  },
36022
+ "system.getLoggingSettings": {
36023
+ capName: "system",
36024
+ capScope: "system",
36025
+ addonId: null,
36026
+ access: "view"
36027
+ },
36028
+ "system.getRequestCensus": {
36029
+ capName: "system",
36030
+ capScope: "system",
36031
+ addonId: null,
36032
+ access: "view"
36033
+ },
35559
36034
  "system.getRetentionConfig": {
35560
36035
  capName: "system",
35561
36036
  capScope: "system",
@@ -35586,6 +36061,12 @@ Object.freeze({
35586
36061
  addonId: null,
35587
36062
  access: "view"
35588
36063
  },
36064
+ "system.setLoggingSettings": {
36065
+ capName: "system",
36066
+ capScope: "system",
36067
+ addonId: null,
36068
+ access: "create"
36069
+ },
35589
36070
  "system.setRetentionConfig": {
35590
36071
  capName: "system",
35591
36072
  capScope: "system",
@@ -36741,6 +37222,10 @@ Object.freeze({
36741
37222
  name: "deviceId",
36742
37223
  form: "single",
36743
37224
  optional: true
37225
+ }, {
37226
+ name: "deviceIds",
37227
+ form: "array",
37228
+ optional: true
36744
37229
  }],
36745
37230
  "fanControl.setDirection": [{
36746
37231
  name: "deviceId",
@@ -38351,7 +38836,38 @@ object({
38351
38836
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38352
38837
  * reproduce that.
38353
38838
  */
38354
- tileBudgetMb: number().int().min(0).max(1024)
38839
+ tileBudgetMb: number().int().min(0).max(1024),
38840
+ /**
38841
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38842
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38843
+ * subject tiles, on frames that detected something.
38844
+ *
38845
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38846
+ * containment is strict by design, so the native `keyFrame`, the detail
38847
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38848
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38849
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38850
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38851
+ *
38852
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38853
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38854
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38855
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38856
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38857
+ * binds only through a detection burst, where it still covers well past the
38858
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38859
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38860
+ * whole shape exists to avoid.
38861
+ *
38862
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38863
+ * subject tile, so one shared budget would let a busy camera's key frames
38864
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38865
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38866
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38867
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38868
+ * nothing.
38869
+ */
38870
+ sceneBudgetMb: number().int().min(0).max(1024)
38355
38871
  });
38356
38872
  /**
38357
38873
  * The values in force when the operator has set nothing.
@@ -38367,12 +38883,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38367
38883
  budgetMb: 1024,
38368
38884
  activityMs: 15e3,
38369
38885
  tileBudgetMb: 64,
38886
+ sceneBudgetMb: 48,
38370
38887
  admission: "inferred"
38371
38888
  };
38372
38889
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38373
38890
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38374
38891
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38375
38892
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38893
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38376
38894
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38377
38895
  /**
38378
38896
  * Pure fuzzy matcher for adoption location import. Normalized