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