@camstack/addon-provider-gree 0.2.30 → 0.2.32

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
@@ -7529,6 +7529,66 @@ var OpsLogQueryInputSchema = object({
7529
7529
  /** Max rows returned, newest-first. */
7530
7530
  limit: number().int().min(1).max(1e3).optional()
7531
7531
  });
7532
+ var LabelDefinitionSchema = object({
7533
+ id: string(),
7534
+ name: string(),
7535
+ category: string().optional(),
7536
+ description: string().optional(),
7537
+ icon: string().optional()
7538
+ });
7539
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7540
+ var CLASS_MAP_MACRO_TARGETS = [
7541
+ "person",
7542
+ "vehicle",
7543
+ "animal",
7544
+ "package"
7545
+ ];
7546
+ /**
7547
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7548
+ * un operatore può selezionare.
7549
+ *
7550
+ * Sono le tre offerte dallo step `object-detection`
7551
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7552
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7553
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7554
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7555
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7556
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7557
+ *
7558
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7559
+ * dello step e una seconda volta come union `FirstLevelMacro`
7560
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7561
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7562
+ * successiva.
7563
+ */
7564
+ var FIRST_LEVEL_MACRO_CLASSES = [
7565
+ "person",
7566
+ "vehicle",
7567
+ "animal"
7568
+ ];
7569
+ /**
7570
+ * Wire schema for a per-model CATALOG classMap override
7571
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7572
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7573
+ * detection pipeline executor actually routes.
7574
+ *
7575
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7576
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7577
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7578
+ * enum) — the two used to share the name `ClassMapDefinition`/
7579
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7580
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7581
+ * are not: it is two different concepts colliding on a name. Keep this type
7582
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7583
+ * would either narrow every `ClassMapDefinition` consumer to the four
7584
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7585
+ * schema exists for (see the "rejects a classMap whose target is not a
7586
+ * detection macro" test in `model-catalog-schema.test.ts`).
7587
+ */
7588
+ var DetectionCatalogClassMapSchema = object({
7589
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7590
+ preserveOriginal: boolean()
7591
+ });
7532
7592
  /**
7533
7593
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7534
7594
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7551,10 +7611,55 @@ var RecordingStorageModeSchema = _enum([
7551
7611
  "events",
7552
7612
  "continuous"
7553
7613
  ]);
7614
+ /**
7615
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7616
+ * tre offerte dallo step `object-detection`, da UNA lista
7617
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7618
+ */
7619
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7620
+ /**
7621
+ * True quando `values` non ripete un elemento.
7622
+ *
7623
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7624
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7625
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7626
+ */
7627
+ var noDuplicates = (values) => new Set(values).size === values.length;
7554
7628
  /** Which detectors trigger an `events`-mode band. */
7555
7629
  var RecordingTriggersSchema = object({
7556
7630
  motion: boolean().optional(),
7557
- audioThresholdDbfs: number().optional()
7631
+ audioThresholdDbfs: number().optional(),
7632
+ /**
7633
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7634
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7635
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7636
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7637
+ *
7638
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7639
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7640
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7641
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7642
+ * finestre — vedi `recorder/object-trigger.ts`.
7643
+ */
7644
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7645
+ /**
7646
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7647
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7648
+ * `objectClasses`.
7649
+ *
7650
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7651
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7652
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7653
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7654
+ * device (D12) — mai un elenco globale di cap.
7655
+ *
7656
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7657
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7658
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7659
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7660
+ * registrare.
7661
+ */
7662
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7558
7663
  });
7559
7664
  /**
7560
7665
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8006,41 +8111,6 @@ var DecoderSessionConfigSchema = object({
8006
8111
  */
8007
8112
  debug: boolean().optional()
8008
8113
  });
8009
- var LabelDefinitionSchema = object({
8010
- id: string(),
8011
- name: string(),
8012
- category: string().optional(),
8013
- description: string().optional(),
8014
- icon: string().optional()
8015
- });
8016
- /**
8017
- * Wire schema for a per-model CATALOG classMap override
8018
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8019
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8020
- * detection pipeline executor actually routes.
8021
- *
8022
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8023
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8024
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8025
- * enum) — the two used to share the name `ClassMapDefinition`/
8026
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8027
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8028
- * are not: it is two different concepts colliding on a name. Keep this type
8029
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8030
- * would either narrow every `ClassMapDefinition` consumer to the four
8031
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8032
- * schema exists for (see the "rejects a classMap whose target is not a
8033
- * detection macro" test in `model-catalog-schema.test.ts`).
8034
- */
8035
- var DetectionCatalogClassMapSchema = object({
8036
- mapping: record(string(), _enum([
8037
- "person",
8038
- "vehicle",
8039
- "animal",
8040
- "package"
8041
- ])),
8042
- preserveOriginal: boolean()
8043
- });
8044
8114
  var MODEL_FORMATS = [
8045
8115
  "onnx",
8046
8116
  "coreml",
@@ -21156,7 +21226,7 @@ var lifecycleJobSchema = object({
21156
21226
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21157
21227
  * as every other cap.
21158
21228
  */
21159
- var LogLevelSchema$1 = _enum([
21229
+ var LogLevelSchema$2 = _enum([
21160
21230
  "debug",
21161
21231
  "info",
21162
21232
  "warn",
@@ -21363,7 +21433,7 @@ var CustomActionInputSchema = object({
21363
21433
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21364
21434
  addonId: string(),
21365
21435
  limit: number().min(1).max(500).default(100),
21366
- level: LogLevelSchema$1.optional()
21436
+ level: LogLevelSchema$2.optional()
21367
21437
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21368
21438
  packageName: string(),
21369
21439
  version: string().optional()
@@ -21461,7 +21531,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21461
21531
  auth: "admin"
21462
21532
  }), method(object({
21463
21533
  addonId: string(),
21464
- level: LogLevelSchema$1.optional()
21534
+ level: LogLevelSchema$2.optional()
21465
21535
  }), LogStreamEntrySchema, { kind: "subscription" });
21466
21536
  /**
21467
21537
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23185,6 +23255,35 @@ var FaceFilterEnum = _enum([
23185
23255
  "identified",
23186
23256
  "all"
23187
23257
  ]);
23258
+ /**
23259
+ * What a `listRecentFaces` page is ORDERED BY.
23260
+ *
23261
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23262
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23263
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23264
+ * order: it puts the suggestions an operator can confirm with one tap at the
23265
+ * top, and it is the reason this enum exists — a client that ranked a capped
23266
+ * page client-side was ranking the newest N, never the most certain N.
23267
+ *
23268
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23269
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23270
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23271
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23272
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23273
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23274
+ * then by faceId, and is what makes this a total order instead of the
23275
+ * backend's NULL-collation accident.
23276
+ */
23277
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23278
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23279
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23280
+ * never leaves the server. */
23281
+ var FaceClusterSchema = object({
23282
+ faceIds: array(string()).readonly(),
23283
+ representativeFaceId: string(),
23284
+ size: number().int(),
23285
+ cohesion: number()
23286
+ });
23188
23287
  var MediaFileLiteSchema$1 = object({
23189
23288
  key: string(),
23190
23289
  kind: string(),
@@ -23231,24 +23330,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23231
23330
  kind: "mutation",
23232
23331
  auth: "admin"
23233
23332
  }), method(object({
23234
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23333
+ /**
23334
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23335
+ *
23336
+ * The legacy single-camera form, kept verbatim for every caller that
23337
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23338
+ * instead — never both: `deviceIds` is the authority whenever it is
23339
+ * present, and this field is then ignored rather than unioned, so
23340
+ * there is exactly one answer to "which cameras did I ask for".
23341
+ */
23235
23342
  deviceId: number().int().optional(),
23343
+ /**
23344
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23345
+ * until now had to fetch the cluster-wide page and drop rows in the
23346
+ * client (so the `limit` it asked for was spent on cameras it was
23347
+ * about to discard).
23348
+ *
23349
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23350
+ * "every camera". A request for no devices is a request, not an
23351
+ * omission; same contract as `deviceManager.listFleet` and
23352
+ * `pipelineAnalytics.listRecentTracks`.
23353
+ *
23354
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23355
+ */
23356
+ deviceIds: array(number().int()).optional(),
23236
23357
  limit: number().int().positive().optional(),
23237
23358
  filter: FaceFilterEnum.optional(),
23238
23359
  /**
23239
- * Inline the base64 crop on every row. Default `true` — the existing
23240
- * behaviour, kept so no caller breaks.
23360
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23361
+ * Absent means no lower bound.
23362
+ */
23363
+ since: number().int().optional(),
23364
+ /**
23365
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23366
+ * Absent means no upper bound.
23367
+ */
23368
+ until: number().int().optional(),
23369
+ /**
23370
+ * Order the page by time or by suggestion certainty. Default
23371
+ * `'timestamp'` — the historical order, unchanged for every caller
23372
+ * that does not ask.
23241
23373
  *
23242
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23243
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23244
- * the browser cache the images.
23374
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23375
+ * does under `'suggestionConfidence'`.
23245
23376
  *
23246
- * **This is an INPUT field, so it does not reach the addon until the
23247
- * next train.** The hub router validates cap inputs against its own
23248
- * compiled Zod, which strips a key it does not know — verified today
23249
- * on the OUTPUT side, where an additive field DOES arrive immediately
23250
- * (`Track.hasFace`). Until the train ships, sending `false` is
23251
- * harmless and simply keeps the crops inline.
23377
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23378
+ * index and stops reading as soon as `limit` rows have PASSED the
23379
+ * filter. `'suggestionConfidence'` cannot stop early — the most
23380
+ * certain row may be the oldest — so it walks the window. Narrow it
23381
+ * with {@link since} / {@link until}.
23382
+ */
23383
+ sortBy: FaceSortFieldEnum.optional(),
23384
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23385
+ sortDirection: FaceSortDirectionEnum.optional(),
23386
+ /**
23387
+ * Inline the base64 crop on every row.
23388
+ *
23389
+ * Default `false` since the 2026-08-25 inversion — see
23390
+ * `include-crops-default.ts`, which is the ONE place that resolves
23391
+ * this for every gallery, and which records why the inline shape had
23392
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23393
+ * The doc here used to still say `true`; it was wrong, and a leftover
23394
+ * that describes the old design reads as permission to rely on it.
23395
+ *
23396
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23397
+ * which the browser fetches off the `event-media` plane in parallel,
23398
+ * cached and ETagged.
23252
23399
  */
23253
23400
  includeCrops: boolean().optional()
23254
23401
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23284,13 +23431,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23284
23431
  }), method(object({
23285
23432
  threshold: number().min(0).max(1).optional(),
23286
23433
  minClusterSize: number().int().min(2).optional(),
23287
- limit: number().int().positive().optional()
23288
- }).optional(), array(object({
23289
- faceIds: array(string()).readonly(),
23290
- representativeFaceId: string(),
23291
- size: number().int(),
23292
- cohesion: number()
23293
- })).readonly());
23434
+ /**
23435
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23436
+ * which read as though it bounded the work — it never did.
23437
+ *
23438
+ * Wins over {@link limit} when both are sent.
23439
+ */
23440
+ maxClusters: number().int().positive().optional(),
23441
+ /**
23442
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23443
+ * RESULT, not the scan. Kept so existing callers keep working; send
23444
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23445
+ */
23446
+ limit: number().int().positive().optional(),
23447
+ /**
23448
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23449
+ * POOL, not the result.
23450
+ *
23451
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23452
+ * used to read every unassigned face on the hub no matter what the
23453
+ * caller asked for, because the only bound cut the finished clusters
23454
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23455
+ * whole corpus, on an addon whose disk is under contention.
23456
+ *
23457
+ * The pool is the NEWEST matching faces first — the same order the
23458
+ * gallery shows — so a bound here shortens the horizon, it does not
23459
+ * sample it randomly.
23460
+ *
23461
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23462
+ * so the live corpus — 372 face rows — is unaffected while the
23463
+ * unbounded scan can never come back as the table grows.
23464
+ */
23465
+ maxFacesScanned: number().int().positive().optional()
23466
+ }).optional(), array(FaceClusterSchema).readonly());
23294
23467
  /**
23295
23468
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23296
23469
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28232,6 +28405,293 @@ var SetSiteLocationInputSchema = object({
28232
28405
  latitude: number().min(-90).max(90),
28233
28406
  longitude: number().min(-180).max(180)
28234
28407
  }).nullable();
28408
+ /**
28409
+ * The TRANSPORT a call arrived on.
28410
+ *
28411
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
28412
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
28413
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
28414
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
28415
+ * checkable rather than asserted.
28416
+ *
28417
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
28418
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
28419
+ * connection; the viewer talks to the hub over `wsLink`
28420
+ * exclusively, so this is the plane the HTTP census could not see.
28421
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
28422
+ * never touches a socket and therefore never touched a census.
28423
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
28424
+ * that is exactly what its `0` asserts: every plane the hub has can name
28425
+ * itself. It is an output bucket, never a knob — a call that arrives on a
28426
+ * plane nobody instrumented lands here instead of vanishing from the total.
28427
+ */
28428
+ var TransportPlaneSchema = _enum([
28429
+ "http",
28430
+ "ws",
28431
+ "mesh",
28432
+ "unknown"
28433
+ ]);
28434
+ /**
28435
+ * Calls per plane. Every key is always present, `0` included — an absent plane
28436
+ * reads as "not instrumented", which is the one thing this census must never
28437
+ * make an operator wonder about.
28438
+ */
28439
+ var TransportPlaneCountsSchema = object({
28440
+ http: number(),
28441
+ ws: number(),
28442
+ mesh: number(),
28443
+ unknown: number()
28444
+ });
28445
+ /**
28446
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
28447
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28448
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28449
+ * already prints - never a token, never an `Authorization` header.
28450
+ *
28451
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
28452
+ * and lives for hours, so folding it into a call count makes one long-lived
28453
+ * stream look like a storm.
28454
+ */
28455
+ var RequestCensusGroupSchema = object({
28456
+ plane: TransportPlaneSchema,
28457
+ procedure: string(),
28458
+ userAgent: string(),
28459
+ ip: string(),
28460
+ principal: string(),
28461
+ calls: number(),
28462
+ subscriptions: number(),
28463
+ perMin: number()
28464
+ });
28465
+ /**
28466
+ * A procedure's TOTAL over the window, across every caller.
28467
+ *
28468
+ * This block, not the group list, is what answers "did these calls arrive over
28469
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28470
+ * same window excludes the HTTP plane, which is a result, not a failure.
28471
+ */
28472
+ var RequestCensusProcedureSchema = object({
28473
+ procedure: string(),
28474
+ calls: number(),
28475
+ /**
28476
+ * The same total, split by transport. THIS is the row that answers the
28477
+ * question the census exists for: one look at `deviceManager.listAll` says
28478
+ * which plane carried the 4 960, without joining two log lines by eye.
28479
+ */
28480
+ planes: TransportPlaneCountsSchema,
28481
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
28482
+ subscriptions: number(),
28483
+ perMin: number()
28484
+ });
28485
+ /**
28486
+ * The census as an operator sees it.
28487
+ *
28488
+ * `persisted` is the honest answer to "will this survive the restart I am
28489
+ * about to do": the arm deadline is written to `system-settings` so a window
28490
+ * armed now can measure the NEXT boot, and a write that failed must not look
28491
+ * like one that succeeded.
28492
+ */
28493
+ var RequestCensusStatusSchema = object({
28494
+ armed: boolean(),
28495
+ /** How long the current - or just-closed - window collected, in ms. */
28496
+ elapsedMs: number(),
28497
+ /** The window actually armed, after the server clamped the request. */
28498
+ windowMs: number(),
28499
+ /** Epoch ms the window closes at. 0 when disarmed. */
28500
+ armedUntilMs: number(),
28501
+ httpRequests: number(),
28502
+ batchedRequests: number(),
28503
+ /**
28504
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28505
+ * is in play (`?batch=1` carries several procedures in one request); this is
28506
+ * the number comparable with a store-side call count.
28507
+ */
28508
+ procedureCalls: number(),
28509
+ /**
28510
+ * `procedureCalls` split by transport. The four keys sum to
28511
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
28512
+ * `planesExplainTotal` is that identity, checked rather than assumed.
28513
+ */
28514
+ planes: TransportPlaneCountsSchema,
28515
+ /**
28516
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
28517
+ * on no plane at all - which is a RESULT (a plane is missing from the
28518
+ * instrument), not a failure, and it has to be visible to be read as one.
28519
+ */
28520
+ planesExplainTotal: boolean(),
28521
+ /**
28522
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28523
+ * adapter resolves one context per connection - kept because a plane's call
28524
+ * count of zero against 37 open connections says something different from a
28525
+ * plane with no connections at all.
28526
+ */
28527
+ wsConnections: number(),
28528
+ /**
28529
+ * Client frames the WS plane looked at. `wsMessages` far above
28530
+ * `planes.ws + subscriptions` means most traffic is not operations
28531
+ * (keepalives, connection params) - which is itself an answer.
28532
+ */
28533
+ wsMessages: number(),
28534
+ /**
28535
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
28536
+ * purpose: one live-events stream opened at boot and held for six hours is
28537
+ * one subscription, and counting it as a call would let a quiet plane
28538
+ * masquerade as the storm.
28539
+ */
28540
+ subscriptions: number(),
28541
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
28542
+ subscriptionStops: number(),
28543
+ distinctGroups: number(),
28544
+ /**
28545
+ * Operations counted in the totals whose CALLER attribution was shed at the
28546
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
28547
+ * which transport they arrived on, they just lost their group row.
28548
+ */
28549
+ unattributedCalls: number(),
28550
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28551
+ groups: array(RequestCensusGroupSchema).readonly()
28552
+ }).extend({ persisted: boolean() });
28553
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28554
+ var LogLevelSchema$1 = _enum([
28555
+ "debug",
28556
+ "info",
28557
+ "warn",
28558
+ "error"
28559
+ ]);
28560
+ /**
28561
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28562
+ *
28563
+ * A diagnostic is anything whose cost is only worth paying while a question is
28564
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28565
+ */
28566
+ var DiagnosticIdSchema = _enum(["request-census"]);
28567
+ /**
28568
+ * The layers of the level hierarchy, general → specific. The most specific
28569
+ * layer that carries an explicit value wins.
28570
+ *
28571
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28572
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28573
+ * grow later would force every consumer of this document to change with it.
28574
+ * Nothing returns `component` today.
28575
+ */
28576
+ var LoggingScopeKindSchema = _enum([
28577
+ "cluster",
28578
+ "node",
28579
+ "component"
28580
+ ]);
28581
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28582
+ var LoggingLevelSourceSchema = _enum([
28583
+ "default",
28584
+ "cluster",
28585
+ "node",
28586
+ "component"
28587
+ ]);
28588
+ /**
28589
+ * One layer of the hierarchy as it actually STANDS.
28590
+ *
28591
+ * `level: null` is the whole reason this array is returned: it is the
28592
+ * difference between "this node is at `info` because I decided it" and
28593
+ * "...because it inherits". An operator who clears an override believing they
28594
+ * are clearing an inherited value has been handed the same defect as the two
28595
+ * contradicting knobs this document exists to remove, moved one floor up.
28596
+ */
28597
+ var LoggingLevelLayerSchema = object({
28598
+ scope: LoggingScopeKindSchema,
28599
+ /** The node this layer speaks for; `null` on the cluster layer. */
28600
+ nodeId: string().nullable(),
28601
+ /** Explicitly set here, or `null` when this layer inherits. */
28602
+ level: LogLevelSchema$1.nullable()
28603
+ });
28604
+ /** What a line is judged against, and WHICH layer decided it. */
28605
+ var LoggingEffectiveSchema = object({
28606
+ level: LogLevelSchema$1,
28607
+ levelSource: LoggingLevelSourceSchema
28608
+ });
28609
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28610
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28611
+ /**
28612
+ * An armed diagnostic, with its DEADLINE.
28613
+ *
28614
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28615
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28616
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28617
+ * `armed` is false — a window is never reported as slightly expired.
28618
+ */
28619
+ var DiagnosticWindowSchema = object({
28620
+ id: DiagnosticIdSchema,
28621
+ armed: boolean(),
28622
+ /** Epoch ms the window closes at. 0 when disarmed. */
28623
+ armedUntilMs: number(),
28624
+ /** Ms left before it expires on its own. 0 when disarmed. */
28625
+ remainingMs: number(),
28626
+ /** Whether the stored deadline is the one the live diagnostic is running —
28627
+ * i.e. whether this window would survive a restart. */
28628
+ persisted: boolean()
28629
+ });
28630
+ /**
28631
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28632
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28633
+ * is a second knob that disagrees with the first the day one of them moves.
28634
+ */
28635
+ var DiagnosticWindowPatchSchema = object({
28636
+ id: DiagnosticIdSchema,
28637
+ armMs: number().int().min(0),
28638
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28639
+ reportEveryMs: number().int().positive().optional()
28640
+ });
28641
+ /**
28642
+ * A PATCH, and patches MERGE.
28643
+ *
28644
+ * A field absent from the patch is left exactly as it was — arming a
28645
+ * diagnostic never resets a level, and setting a level never disarms a window.
28646
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28647
+ * `setAll` already merges, and rebuilding the object is how an absent field
28648
+ * turns into an erased one.
28649
+ */
28650
+ var LoggingSettingsPatchSchema = object({
28651
+ /**
28652
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28653
+ * addressed scope so it inherits again. A value sets it.
28654
+ */
28655
+ level: LogLevelSchema$1.nullable().optional(),
28656
+ /**
28657
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28658
+ * keeps running — a patch is never a full replacement.
28659
+ */
28660
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28661
+ });
28662
+ /**
28663
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28664
+ *
28665
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28666
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28667
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28668
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28669
+ * by an agent that holds no cluster document at all. The hub is the single
28670
+ * authority over the whole hierarchy and answers for every layer, so the
28671
+ * layer selector needs a name the transport does not already own.
28672
+ */
28673
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28674
+ var SetLoggingSettingsInputSchema = object({
28675
+ scopeNodeId: string().optional(),
28676
+ patch: LoggingSettingsPatchSchema
28677
+ });
28678
+ /**
28679
+ * The whole document, as read and as returned after every write.
28680
+ *
28681
+ * `persisted: false` means the settings store could not be read or written.
28682
+ * The in-memory mirror still governs behaviour and is unchanged by the
28683
+ * failure — a read that fails neither switches a level nor disarms a window
28684
+ * (D49) — but the operator is told that what they are looking at would not
28685
+ * survive a restart.
28686
+ */
28687
+ var LoggingSettingsStateSchema = object({
28688
+ /** The layer this document was read at. `null` = the cluster layer. */
28689
+ scopeNodeId: string().nullable(),
28690
+ effective: LoggingEffectiveSchema,
28691
+ explicit: LoggingExplicitSchema,
28692
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28693
+ persisted: boolean()
28694
+ });
28235
28695
  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(), {
28236
28696
  kind: "mutation",
28237
28697
  auth: "admin"
@@ -28244,6 +28704,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28244
28704
  }), method(_void(), SiteLocationStatusSchema, {
28245
28705
  kind: "mutation",
28246
28706
  auth: "admin"
28707
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28708
+ kind: "mutation",
28709
+ auth: "admin"
28247
28710
  });
28248
28711
  /**
28249
28712
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35483,6 +35946,18 @@ Object.freeze({
35483
35946
  addonId: null,
35484
35947
  access: "create"
35485
35948
  },
35949
+ "system.getLoggingSettings": {
35950
+ capName: "system",
35951
+ capScope: "system",
35952
+ addonId: null,
35953
+ access: "view"
35954
+ },
35955
+ "system.getRequestCensus": {
35956
+ capName: "system",
35957
+ capScope: "system",
35958
+ addonId: null,
35959
+ access: "view"
35960
+ },
35486
35961
  "system.getRetentionConfig": {
35487
35962
  capName: "system",
35488
35963
  capScope: "system",
@@ -35513,6 +35988,12 @@ Object.freeze({
35513
35988
  addonId: null,
35514
35989
  access: "view"
35515
35990
  },
35991
+ "system.setLoggingSettings": {
35992
+ capName: "system",
35993
+ capScope: "system",
35994
+ addonId: null,
35995
+ access: "create"
35996
+ },
35516
35997
  "system.setRetentionConfig": {
35517
35998
  capName: "system",
35518
35999
  capScope: "system",
@@ -36668,6 +37149,10 @@ Object.freeze({
36668
37149
  name: "deviceId",
36669
37150
  form: "single",
36670
37151
  optional: true
37152
+ }, {
37153
+ name: "deviceIds",
37154
+ form: "array",
37155
+ optional: true
36671
37156
  }],
36672
37157
  "fanControl.setDirection": [{
36673
37158
  name: "deviceId",
@@ -38278,7 +38763,38 @@ object({
38278
38763
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38279
38764
  * reproduce that.
38280
38765
  */
38281
- tileBudgetMb: number().int().min(0).max(1024)
38766
+ tileBudgetMb: number().int().min(0).max(1024),
38767
+ /**
38768
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38769
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38770
+ * subject tiles, on frames that detected something.
38771
+ *
38772
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38773
+ * containment is strict by design, so the native `keyFrame`, the detail
38774
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38775
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38776
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38777
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38778
+ *
38779
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38780
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38781
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38782
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38783
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38784
+ * binds only through a detection burst, where it still covers well past the
38785
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38786
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38787
+ * whole shape exists to avoid.
38788
+ *
38789
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38790
+ * subject tile, so one shared budget would let a busy camera's key frames
38791
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38792
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38793
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38794
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38795
+ * nothing.
38796
+ */
38797
+ sceneBudgetMb: number().int().min(0).max(1024)
38282
38798
  });
38283
38799
  /**
38284
38800
  * The values in force when the operator has set nothing.
@@ -38294,12 +38810,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38294
38810
  budgetMb: 1024,
38295
38811
  activityMs: 15e3,
38296
38812
  tileBudgetMb: 64,
38813
+ sceneBudgetMb: 48,
38297
38814
  admission: "inferred"
38298
38815
  };
38299
38816
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38300
38817
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38301
38818
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38302
38819
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38820
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38303
38821
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38304
38822
  var MB = 1024 * 1024;
38305
38823
  1024 * MB, 3072 * MB;