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