@camstack/addon-provider-rademacher 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
@@ -8511,6 +8511,66 @@ var OpsLogQueryInputSchema = object({
8511
8511
  /** Max rows returned, newest-first. */
8512
8512
  limit: number().int().min(1).max(1e3).optional()
8513
8513
  });
8514
+ var LabelDefinitionSchema = object({
8515
+ id: string(),
8516
+ name: string(),
8517
+ category: string().optional(),
8518
+ description: string().optional(),
8519
+ icon: string().optional()
8520
+ });
8521
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
8522
+ var CLASS_MAP_MACRO_TARGETS = [
8523
+ "person",
8524
+ "vehicle",
8525
+ "animal",
8526
+ "package"
8527
+ ];
8528
+ /**
8529
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
8530
+ * un operatore può selezionare.
8531
+ *
8532
+ * Sono le tre offerte dallo step `object-detection`
8533
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
8534
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
8535
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
8536
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
8537
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
8538
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
8539
+ *
8540
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
8541
+ * dello step e una seconda volta come union `FirstLevelMacro`
8542
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
8543
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
8544
+ * successiva.
8545
+ */
8546
+ var FIRST_LEVEL_MACRO_CLASSES = [
8547
+ "person",
8548
+ "vehicle",
8549
+ "animal"
8550
+ ];
8551
+ /**
8552
+ * Wire schema for a per-model CATALOG classMap override
8553
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8554
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8555
+ * detection pipeline executor actually routes.
8556
+ *
8557
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8558
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8559
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8560
+ * enum) — the two used to share the name `ClassMapDefinition`/
8561
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8562
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8563
+ * are not: it is two different concepts colliding on a name. Keep this type
8564
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
8565
+ * would either narrow every `ClassMapDefinition` consumer to the four
8566
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8567
+ * schema exists for (see the "rejects a classMap whose target is not a
8568
+ * detection macro" test in `model-catalog-schema.test.ts`).
8569
+ */
8570
+ var DetectionCatalogClassMapSchema = object({
8571
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
8572
+ preserveOriginal: boolean()
8573
+ });
8514
8574
  /**
8515
8575
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
8516
8576
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -8533,10 +8593,55 @@ var RecordingStorageModeSchema = _enum([
8533
8593
  "events",
8534
8594
  "continuous"
8535
8595
  ]);
8596
+ /**
8597
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
8598
+ * tre offerte dallo step `object-detection`, da UNA lista
8599
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
8600
+ */
8601
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
8602
+ /**
8603
+ * True quando `values` non ripete un elemento.
8604
+ *
8605
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
8606
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
8607
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
8608
+ */
8609
+ var noDuplicates = (values) => new Set(values).size === values.length;
8536
8610
  /** Which detectors trigger an `events`-mode band. */
8537
8611
  var RecordingTriggersSchema = object({
8538
8612
  motion: boolean().optional(),
8539
- audioThresholdDbfs: number().optional()
8613
+ audioThresholdDbfs: number().optional(),
8614
+ /**
8615
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
8616
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
8617
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
8618
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
8619
+ *
8620
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
8621
+ * quelle che hanno attraversato `enabledMacroClasses`, i
8622
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
8623
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
8624
+ * finestre — vedi `recorder/object-trigger.ts`.
8625
+ */
8626
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
8627
+ /**
8628
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
8629
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
8630
+ * `objectClasses`.
8631
+ *
8632
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
8633
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
8634
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
8635
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
8636
+ * device (D12) — mai un elenco globale di cap.
8637
+ *
8638
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
8639
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
8640
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
8641
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
8642
+ * registrare.
8643
+ */
8644
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8540
8645
  });
8541
8646
  /**
8542
8647
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8988,41 +9093,6 @@ var DecoderSessionConfigSchema = object({
8988
9093
  */
8989
9094
  debug: boolean().optional()
8990
9095
  });
8991
- var LabelDefinitionSchema = object({
8992
- id: string(),
8993
- name: string(),
8994
- category: string().optional(),
8995
- description: string().optional(),
8996
- icon: string().optional()
8997
- });
8998
- /**
8999
- * Wire schema for a per-model CATALOG classMap override
9000
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
9001
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
9002
- * detection pipeline executor actually routes.
9003
- *
9004
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
9005
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
9006
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
9007
- * enum) — the two used to share the name `ClassMapDefinition`/
9008
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
9009
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
9010
- * are not: it is two different concepts colliding on a name. Keep this type
9011
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
9012
- * would either narrow every `ClassMapDefinition` consumer to the four
9013
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
9014
- * schema exists for (see the "rejects a classMap whose target is not a
9015
- * detection macro" test in `model-catalog-schema.test.ts`).
9016
- */
9017
- var DetectionCatalogClassMapSchema = object({
9018
- mapping: record(string(), _enum([
9019
- "person",
9020
- "vehicle",
9021
- "animal",
9022
- "package"
9023
- ])),
9024
- preserveOriginal: boolean()
9025
- });
9026
9096
  var MODEL_FORMATS = [
9027
9097
  "onnx",
9028
9098
  "coreml",
@@ -22138,7 +22208,7 @@ var lifecycleJobSchema = object({
22138
22208
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
22139
22209
  * as every other cap.
22140
22210
  */
22141
- var LogLevelSchema$1 = _enum([
22211
+ var LogLevelSchema$2 = _enum([
22142
22212
  "debug",
22143
22213
  "info",
22144
22214
  "warn",
@@ -22345,7 +22415,7 @@ var CustomActionInputSchema = object({
22345
22415
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
22346
22416
  addonId: string(),
22347
22417
  limit: number().min(1).max(500).default(100),
22348
- level: LogLevelSchema$1.optional()
22418
+ level: LogLevelSchema$2.optional()
22349
22419
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
22350
22420
  packageName: string(),
22351
22421
  version: string().optional()
@@ -22443,7 +22513,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
22443
22513
  auth: "admin"
22444
22514
  }), method(object({
22445
22515
  addonId: string(),
22446
- level: LogLevelSchema$1.optional()
22516
+ level: LogLevelSchema$2.optional()
22447
22517
  }), LogStreamEntrySchema, { kind: "subscription" });
22448
22518
  /**
22449
22519
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -24167,6 +24237,35 @@ var FaceFilterEnum = _enum([
24167
24237
  "identified",
24168
24238
  "all"
24169
24239
  ]);
24240
+ /**
24241
+ * What a `listRecentFaces` page is ORDERED BY.
24242
+ *
24243
+ * - `timestamp` — when the face was seen. The historical (and default) order.
24244
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
24245
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
24246
+ * order: it puts the suggestions an operator can confirm with one tap at the
24247
+ * top, and it is the reason this enum exists — a client that ranked a capped
24248
+ * page client-side was ranking the newest N, never the most certain N.
24249
+ *
24250
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
24251
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
24252
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
24253
+ * — flipping the direction reorders the rows that HAVE a certainty and never
24254
+ * floods the page with the ones that do not. `addon-post-analysis`'s
24255
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
24256
+ * then by faceId, and is what makes this a total order instead of the
24257
+ * backend's NULL-collation accident.
24258
+ */
24259
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
24260
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
24261
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
24262
+ * never leaves the server. */
24263
+ var FaceClusterSchema = object({
24264
+ faceIds: array(string()).readonly(),
24265
+ representativeFaceId: string(),
24266
+ size: number().int(),
24267
+ cohesion: number()
24268
+ });
24170
24269
  var MediaFileLiteSchema$1 = object({
24171
24270
  key: string(),
24172
24271
  kind: string(),
@@ -24213,24 +24312,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24213
24312
  kind: "mutation",
24214
24313
  auth: "admin"
24215
24314
  }), method(object({
24216
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
24315
+ /**
24316
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
24317
+ *
24318
+ * The legacy single-camera form, kept verbatim for every caller that
24319
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
24320
+ * instead — never both: `deviceIds` is the authority whenever it is
24321
+ * present, and this field is then ignored rather than unioned, so
24322
+ * there is exactly one answer to "which cameras did I ask for".
24323
+ */
24217
24324
  deviceId: number().int().optional(),
24325
+ /**
24326
+ * Restrict to a SET of cameras — the review UI's camera filter, which
24327
+ * until now had to fetch the cluster-wide page and drop rows in the
24328
+ * client (so the `limit` it asked for was spent on cameras it was
24329
+ * about to discard).
24330
+ *
24331
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
24332
+ * "every camera". A request for no devices is a request, not an
24333
+ * omission; same contract as `deviceManager.listFleet` and
24334
+ * `pipelineAnalytics.listRecentTracks`.
24335
+ *
24336
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
24337
+ */
24338
+ deviceIds: array(number().int()).optional(),
24218
24339
  limit: number().int().positive().optional(),
24219
24340
  filter: FaceFilterEnum.optional(),
24220
24341
  /**
24221
- * Inline the base64 crop on every row. Default `true` — the existing
24222
- * behaviour, kept so no caller breaks.
24342
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24343
+ * Absent means no lower bound.
24344
+ */
24345
+ since: number().int().optional(),
24346
+ /**
24347
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24348
+ * Absent means no upper bound.
24349
+ */
24350
+ until: number().int().optional(),
24351
+ /**
24352
+ * Order the page by time or by suggestion certainty. Default
24353
+ * `'timestamp'` — the historical order, unchanged for every caller
24354
+ * that does not ask.
24223
24355
  *
24224
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
24225
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
24226
- * the browser cache the images.
24356
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
24357
+ * does under `'suggestionConfidence'`.
24227
24358
  *
24228
- * **This is an INPUT field, so it does not reach the addon until the
24229
- * next train.** The hub router validates cap inputs against its own
24230
- * compiled Zod, which strips a key it does not know verified today
24231
- * on the OUTPUT side, where an additive field DOES arrive immediately
24232
- * (`Track.hasFace`). Until the train ships, sending `false` is
24233
- * harmless and simply keeps the crops inline.
24359
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
24360
+ * index and stops reading as soon as `limit` rows have PASSED the
24361
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
24362
+ * certain row may be the oldest so it walks the window. Narrow it
24363
+ * with {@link since} / {@link until}.
24364
+ */
24365
+ sortBy: FaceSortFieldEnum.optional(),
24366
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
24367
+ sortDirection: FaceSortDirectionEnum.optional(),
24368
+ /**
24369
+ * Inline the base64 crop on every row.
24370
+ *
24371
+ * Default `false` since the 2026-08-25 inversion — see
24372
+ * `include-crops-default.ts`, which is the ONE place that resolves
24373
+ * this for every gallery, and which records why the inline shape had
24374
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
24375
+ * The doc here used to still say `true`; it was wrong, and a leftover
24376
+ * that describes the old design reads as permission to rely on it.
24377
+ *
24378
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
24379
+ * which the browser fetches off the `event-media` plane in parallel,
24380
+ * cached and ETagged.
24234
24381
  */
24235
24382
  includeCrops: boolean().optional()
24236
24383
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -24266,13 +24413,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24266
24413
  }), method(object({
24267
24414
  threshold: number().min(0).max(1).optional(),
24268
24415
  minClusterSize: number().int().min(2).optional(),
24269
- limit: number().int().positive().optional()
24270
- }).optional(), array(object({
24271
- faceIds: array(string()).readonly(),
24272
- representativeFaceId: string(),
24273
- size: number().int(),
24274
- cohesion: number()
24275
- })).readonly());
24416
+ /**
24417
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
24418
+ * which read as though it bounded the work — it never did.
24419
+ *
24420
+ * Wins over {@link limit} when both are sent.
24421
+ */
24422
+ maxClusters: number().int().positive().optional(),
24423
+ /**
24424
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
24425
+ * RESULT, not the scan. Kept so existing callers keep working; send
24426
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
24427
+ */
24428
+ limit: number().int().positive().optional(),
24429
+ /**
24430
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
24431
+ * POOL, not the result.
24432
+ *
24433
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
24434
+ * used to read every unassigned face on the hub no matter what the
24435
+ * caller asked for, because the only bound cut the finished clusters
24436
+ * afterwards; a UI showing a window of 100 paid for a scan of the
24437
+ * whole corpus, on an addon whose disk is under contention.
24438
+ *
24439
+ * The pool is the NEWEST matching faces first — the same order the
24440
+ * gallery shows — so a bound here shortens the horizon, it does not
24441
+ * sample it randomly.
24442
+ *
24443
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
24444
+ * so the live corpus — 372 face rows — is unaffected while the
24445
+ * unbounded scan can never come back as the table grows.
24446
+ */
24447
+ maxFacesScanned: number().int().positive().optional()
24448
+ }).optional(), array(FaceClusterSchema).readonly());
24276
24449
  /**
24277
24450
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
24278
24451
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -29214,6 +29387,293 @@ var SetSiteLocationInputSchema = object({
29214
29387
  latitude: number().min(-90).max(90),
29215
29388
  longitude: number().min(-180).max(180)
29216
29389
  }).nullable();
29390
+ /**
29391
+ * The TRANSPORT a call arrived on.
29392
+ *
29393
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
29394
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
29395
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
29396
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
29397
+ * checkable rather than asserted.
29398
+ *
29399
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
29400
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
29401
+ * connection; the viewer talks to the hub over `wsLink`
29402
+ * exclusively, so this is the plane the HTTP census could not see.
29403
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
29404
+ * never touches a socket and therefore never touched a census.
29405
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
29406
+ * that is exactly what its `0` asserts: every plane the hub has can name
29407
+ * itself. It is an output bucket, never a knob — a call that arrives on a
29408
+ * plane nobody instrumented lands here instead of vanishing from the total.
29409
+ */
29410
+ var TransportPlaneSchema = _enum([
29411
+ "http",
29412
+ "ws",
29413
+ "mesh",
29414
+ "unknown"
29415
+ ]);
29416
+ /**
29417
+ * Calls per plane. Every key is always present, `0` included — an absent plane
29418
+ * reads as "not instrumented", which is the one thing this census must never
29419
+ * make an operator wonder about.
29420
+ */
29421
+ var TransportPlaneCountsSchema = object({
29422
+ http: number(),
29423
+ ws: number(),
29424
+ mesh: number(),
29425
+ unknown: number()
29426
+ });
29427
+ /**
29428
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
29429
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29430
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29431
+ * already prints - never a token, never an `Authorization` header.
29432
+ *
29433
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
29434
+ * and lives for hours, so folding it into a call count makes one long-lived
29435
+ * stream look like a storm.
29436
+ */
29437
+ var RequestCensusGroupSchema = object({
29438
+ plane: TransportPlaneSchema,
29439
+ procedure: string(),
29440
+ userAgent: string(),
29441
+ ip: string(),
29442
+ principal: string(),
29443
+ calls: number(),
29444
+ subscriptions: number(),
29445
+ perMin: number()
29446
+ });
29447
+ /**
29448
+ * A procedure's TOTAL over the window, across every caller.
29449
+ *
29450
+ * This block, not the group list, is what answers "did these calls arrive over
29451
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29452
+ * same window excludes the HTTP plane, which is a result, not a failure.
29453
+ */
29454
+ var RequestCensusProcedureSchema = object({
29455
+ procedure: string(),
29456
+ calls: number(),
29457
+ /**
29458
+ * The same total, split by transport. THIS is the row that answers the
29459
+ * question the census exists for: one look at `deviceManager.listAll` says
29460
+ * which plane carried the 4 960, without joining two log lines by eye.
29461
+ */
29462
+ planes: TransportPlaneCountsSchema,
29463
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
29464
+ subscriptions: number(),
29465
+ perMin: number()
29466
+ });
29467
+ /**
29468
+ * The census as an operator sees it.
29469
+ *
29470
+ * `persisted` is the honest answer to "will this survive the restart I am
29471
+ * about to do": the arm deadline is written to `system-settings` so a window
29472
+ * armed now can measure the NEXT boot, and a write that failed must not look
29473
+ * like one that succeeded.
29474
+ */
29475
+ var RequestCensusStatusSchema = object({
29476
+ armed: boolean(),
29477
+ /** How long the current - or just-closed - window collected, in ms. */
29478
+ elapsedMs: number(),
29479
+ /** The window actually armed, after the server clamped the request. */
29480
+ windowMs: number(),
29481
+ /** Epoch ms the window closes at. 0 when disarmed. */
29482
+ armedUntilMs: number(),
29483
+ httpRequests: number(),
29484
+ batchedRequests: number(),
29485
+ /**
29486
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29487
+ * is in play (`?batch=1` carries several procedures in one request); this is
29488
+ * the number comparable with a store-side call count.
29489
+ */
29490
+ procedureCalls: number(),
29491
+ /**
29492
+ * `procedureCalls` split by transport. The four keys sum to
29493
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
29494
+ * `planesExplainTotal` is that identity, checked rather than assumed.
29495
+ */
29496
+ planes: TransportPlaneCountsSchema,
29497
+ /**
29498
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
29499
+ * on no plane at all - which is a RESULT (a plane is missing from the
29500
+ * instrument), not a failure, and it has to be visible to be read as one.
29501
+ */
29502
+ planesExplainTotal: boolean(),
29503
+ /**
29504
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29505
+ * adapter resolves one context per connection - kept because a plane's call
29506
+ * count of zero against 37 open connections says something different from a
29507
+ * plane with no connections at all.
29508
+ */
29509
+ wsConnections: number(),
29510
+ /**
29511
+ * Client frames the WS plane looked at. `wsMessages` far above
29512
+ * `planes.ws + subscriptions` means most traffic is not operations
29513
+ * (keepalives, connection params) - which is itself an answer.
29514
+ */
29515
+ wsMessages: number(),
29516
+ /**
29517
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
29518
+ * purpose: one live-events stream opened at boot and held for six hours is
29519
+ * one subscription, and counting it as a call would let a quiet plane
29520
+ * masquerade as the storm.
29521
+ */
29522
+ subscriptions: number(),
29523
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
29524
+ subscriptionStops: number(),
29525
+ distinctGroups: number(),
29526
+ /**
29527
+ * Operations counted in the totals whose CALLER attribution was shed at the
29528
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
29529
+ * which transport they arrived on, they just lost their group row.
29530
+ */
29531
+ unattributedCalls: number(),
29532
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29533
+ groups: array(RequestCensusGroupSchema).readonly()
29534
+ }).extend({ persisted: boolean() });
29535
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29536
+ var LogLevelSchema$1 = _enum([
29537
+ "debug",
29538
+ "info",
29539
+ "warn",
29540
+ "error"
29541
+ ]);
29542
+ /**
29543
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29544
+ *
29545
+ * A diagnostic is anything whose cost is only worth paying while a question is
29546
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29547
+ */
29548
+ var DiagnosticIdSchema = _enum(["request-census"]);
29549
+ /**
29550
+ * The layers of the level hierarchy, general → specific. The most specific
29551
+ * layer that carries an explicit value wins.
29552
+ *
29553
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29554
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29555
+ * grow later would force every consumer of this document to change with it.
29556
+ * Nothing returns `component` today.
29557
+ */
29558
+ var LoggingScopeKindSchema = _enum([
29559
+ "cluster",
29560
+ "node",
29561
+ "component"
29562
+ ]);
29563
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29564
+ var LoggingLevelSourceSchema = _enum([
29565
+ "default",
29566
+ "cluster",
29567
+ "node",
29568
+ "component"
29569
+ ]);
29570
+ /**
29571
+ * One layer of the hierarchy as it actually STANDS.
29572
+ *
29573
+ * `level: null` is the whole reason this array is returned: it is the
29574
+ * difference between "this node is at `info` because I decided it" and
29575
+ * "...because it inherits". An operator who clears an override believing they
29576
+ * are clearing an inherited value has been handed the same defect as the two
29577
+ * contradicting knobs this document exists to remove, moved one floor up.
29578
+ */
29579
+ var LoggingLevelLayerSchema = object({
29580
+ scope: LoggingScopeKindSchema,
29581
+ /** The node this layer speaks for; `null` on the cluster layer. */
29582
+ nodeId: string().nullable(),
29583
+ /** Explicitly set here, or `null` when this layer inherits. */
29584
+ level: LogLevelSchema$1.nullable()
29585
+ });
29586
+ /** What a line is judged against, and WHICH layer decided it. */
29587
+ var LoggingEffectiveSchema = object({
29588
+ level: LogLevelSchema$1,
29589
+ levelSource: LoggingLevelSourceSchema
29590
+ });
29591
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29592
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29593
+ /**
29594
+ * An armed diagnostic, with its DEADLINE.
29595
+ *
29596
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29597
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29598
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29599
+ * `armed` is false — a window is never reported as slightly expired.
29600
+ */
29601
+ var DiagnosticWindowSchema = object({
29602
+ id: DiagnosticIdSchema,
29603
+ armed: boolean(),
29604
+ /** Epoch ms the window closes at. 0 when disarmed. */
29605
+ armedUntilMs: number(),
29606
+ /** Ms left before it expires on its own. 0 when disarmed. */
29607
+ remainingMs: number(),
29608
+ /** Whether the stored deadline is the one the live diagnostic is running —
29609
+ * i.e. whether this window would survive a restart. */
29610
+ persisted: boolean()
29611
+ });
29612
+ /**
29613
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29614
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29615
+ * is a second knob that disagrees with the first the day one of them moves.
29616
+ */
29617
+ var DiagnosticWindowPatchSchema = object({
29618
+ id: DiagnosticIdSchema,
29619
+ armMs: number().int().min(0),
29620
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29621
+ reportEveryMs: number().int().positive().optional()
29622
+ });
29623
+ /**
29624
+ * A PATCH, and patches MERGE.
29625
+ *
29626
+ * A field absent from the patch is left exactly as it was — arming a
29627
+ * diagnostic never resets a level, and setting a level never disarms a window.
29628
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29629
+ * `setAll` already merges, and rebuilding the object is how an absent field
29630
+ * turns into an erased one.
29631
+ */
29632
+ var LoggingSettingsPatchSchema = object({
29633
+ /**
29634
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29635
+ * addressed scope so it inherits again. A value sets it.
29636
+ */
29637
+ level: LogLevelSchema$1.nullable().optional(),
29638
+ /**
29639
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29640
+ * keeps running — a patch is never a full replacement.
29641
+ */
29642
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29643
+ });
29644
+ /**
29645
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29646
+ *
29647
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29648
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29649
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29650
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29651
+ * by an agent that holds no cluster document at all. The hub is the single
29652
+ * authority over the whole hierarchy and answers for every layer, so the
29653
+ * layer selector needs a name the transport does not already own.
29654
+ */
29655
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29656
+ var SetLoggingSettingsInputSchema = object({
29657
+ scopeNodeId: string().optional(),
29658
+ patch: LoggingSettingsPatchSchema
29659
+ });
29660
+ /**
29661
+ * The whole document, as read and as returned after every write.
29662
+ *
29663
+ * `persisted: false` means the settings store could not be read or written.
29664
+ * The in-memory mirror still governs behaviour and is unchanged by the
29665
+ * failure — a read that fails neither switches a level nor disarms a window
29666
+ * (D49) — but the operator is told that what they are looking at would not
29667
+ * survive a restart.
29668
+ */
29669
+ var LoggingSettingsStateSchema = object({
29670
+ /** The layer this document was read at. `null` = the cluster layer. */
29671
+ scopeNodeId: string().nullable(),
29672
+ effective: LoggingEffectiveSchema,
29673
+ explicit: LoggingExplicitSchema,
29674
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29675
+ persisted: boolean()
29676
+ });
29217
29677
  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(), {
29218
29678
  kind: "mutation",
29219
29679
  auth: "admin"
@@ -29226,6 +29686,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29226
29686
  }), method(_void(), SiteLocationStatusSchema, {
29227
29687
  kind: "mutation",
29228
29688
  auth: "admin"
29689
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29690
+ kind: "mutation",
29691
+ auth: "admin"
29229
29692
  });
29230
29693
  /**
29231
29694
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -36465,6 +36928,18 @@ Object.freeze({
36465
36928
  addonId: null,
36466
36929
  access: "create"
36467
36930
  },
36931
+ "system.getLoggingSettings": {
36932
+ capName: "system",
36933
+ capScope: "system",
36934
+ addonId: null,
36935
+ access: "view"
36936
+ },
36937
+ "system.getRequestCensus": {
36938
+ capName: "system",
36939
+ capScope: "system",
36940
+ addonId: null,
36941
+ access: "view"
36942
+ },
36468
36943
  "system.getRetentionConfig": {
36469
36944
  capName: "system",
36470
36945
  capScope: "system",
@@ -36495,6 +36970,12 @@ Object.freeze({
36495
36970
  addonId: null,
36496
36971
  access: "view"
36497
36972
  },
36973
+ "system.setLoggingSettings": {
36974
+ capName: "system",
36975
+ capScope: "system",
36976
+ addonId: null,
36977
+ access: "create"
36978
+ },
36498
36979
  "system.setRetentionConfig": {
36499
36980
  capName: "system",
36500
36981
  capScope: "system",
@@ -37650,6 +38131,10 @@ Object.freeze({
37650
38131
  name: "deviceId",
37651
38132
  form: "single",
37652
38133
  optional: true
38134
+ }, {
38135
+ name: "deviceIds",
38136
+ form: "array",
38137
+ optional: true
37653
38138
  }],
37654
38139
  "fanControl.setDirection": [{
37655
38140
  name: "deviceId",
@@ -39260,7 +39745,38 @@ object({
39260
39745
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
39261
39746
  * reproduce that.
39262
39747
  */
39263
- tileBudgetMb: number().int().min(0).max(1024)
39748
+ tileBudgetMb: number().int().min(0).max(1024),
39749
+ /**
39750
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39751
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39752
+ * subject tiles, on frames that detected something.
39753
+ *
39754
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39755
+ * containment is strict by design, so the native `keyFrame`, the detail
39756
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39757
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39758
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39759
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39760
+ *
39761
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39762
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39763
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39764
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39765
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39766
+ * binds only through a detection burst, where it still covers well past the
39767
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39768
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39769
+ * whole shape exists to avoid.
39770
+ *
39771
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39772
+ * subject tile, so one shared budget would let a busy camera's key frames
39773
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39774
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39775
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39776
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39777
+ * nothing.
39778
+ */
39779
+ sceneBudgetMb: number().int().min(0).max(1024)
39264
39780
  });
39265
39781
  /**
39266
39782
  * The values in force when the operator has set nothing.
@@ -39276,12 +39792,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
39276
39792
  budgetMb: 1024,
39277
39793
  activityMs: 15e3,
39278
39794
  tileBudgetMb: 64,
39795
+ sceneBudgetMb: 48,
39279
39796
  admission: "inferred"
39280
39797
  };
39281
39798
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39282
39799
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39283
39800
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39284
39801
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39802
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39285
39803
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39286
39804
  var MB = 1024 * 1024;
39287
39805
  1024 * MB, 3072 * MB;