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