@camstack/addon-provider-dreo 0.2.31 → 0.2.33

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
@@ -7562,6 +7562,66 @@ var OpsLogQueryInputSchema = object({
7562
7562
  /** Max rows returned, newest-first. */
7563
7563
  limit: number().int().min(1).max(1e3).optional()
7564
7564
  });
7565
+ var LabelDefinitionSchema = object({
7566
+ id: string(),
7567
+ name: string(),
7568
+ category: string().optional(),
7569
+ description: string().optional(),
7570
+ icon: string().optional()
7571
+ });
7572
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7573
+ var CLASS_MAP_MACRO_TARGETS = [
7574
+ "person",
7575
+ "vehicle",
7576
+ "animal",
7577
+ "package"
7578
+ ];
7579
+ /**
7580
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7581
+ * un operatore può selezionare.
7582
+ *
7583
+ * Sono le tre offerte dallo step `object-detection`
7584
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7585
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7586
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7587
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7588
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7589
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7590
+ *
7591
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7592
+ * dello step e una seconda volta come union `FirstLevelMacro`
7593
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7594
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7595
+ * successiva.
7596
+ */
7597
+ var FIRST_LEVEL_MACRO_CLASSES = [
7598
+ "person",
7599
+ "vehicle",
7600
+ "animal"
7601
+ ];
7602
+ /**
7603
+ * Wire schema for a per-model CATALOG classMap override
7604
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7605
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7606
+ * detection pipeline executor actually routes.
7607
+ *
7608
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7609
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7610
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7611
+ * enum) — the two used to share the name `ClassMapDefinition`/
7612
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7613
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7614
+ * are not: it is two different concepts colliding on a name. Keep this type
7615
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7616
+ * would either narrow every `ClassMapDefinition` consumer to the four
7617
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7618
+ * schema exists for (see the "rejects a classMap whose target is not a
7619
+ * detection macro" test in `model-catalog-schema.test.ts`).
7620
+ */
7621
+ var DetectionCatalogClassMapSchema = object({
7622
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7623
+ preserveOriginal: boolean()
7624
+ });
7565
7625
  /**
7566
7626
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7567
7627
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7584,10 +7644,55 @@ var RecordingStorageModeSchema = _enum([
7584
7644
  "events",
7585
7645
  "continuous"
7586
7646
  ]);
7647
+ /**
7648
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7649
+ * tre offerte dallo step `object-detection`, da UNA lista
7650
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7651
+ */
7652
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7653
+ /**
7654
+ * True quando `values` non ripete un elemento.
7655
+ *
7656
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7657
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7658
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7659
+ */
7660
+ var noDuplicates = (values) => new Set(values).size === values.length;
7587
7661
  /** Which detectors trigger an `events`-mode band. */
7588
7662
  var RecordingTriggersSchema = object({
7589
7663
  motion: boolean().optional(),
7590
- audioThresholdDbfs: number().optional()
7664
+ audioThresholdDbfs: number().optional(),
7665
+ /**
7666
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7667
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7668
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7669
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7670
+ *
7671
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7672
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7673
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7674
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7675
+ * finestre — vedi `recorder/object-trigger.ts`.
7676
+ */
7677
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7678
+ /**
7679
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7680
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7681
+ * `objectClasses`.
7682
+ *
7683
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7684
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7685
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7686
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7687
+ * device (D12) — mai un elenco globale di cap.
7688
+ *
7689
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7690
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7691
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7692
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7693
+ * registrare.
7694
+ */
7695
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7591
7696
  });
7592
7697
  /**
7593
7698
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8039,41 +8144,6 @@ var DecoderSessionConfigSchema = object({
8039
8144
  */
8040
8145
  debug: boolean().optional()
8041
8146
  });
8042
- var LabelDefinitionSchema = object({
8043
- id: string(),
8044
- name: string(),
8045
- category: string().optional(),
8046
- description: string().optional(),
8047
- icon: string().optional()
8048
- });
8049
- /**
8050
- * Wire schema for a per-model CATALOG classMap override
8051
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8052
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8053
- * detection pipeline executor actually routes.
8054
- *
8055
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8056
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8057
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8058
- * enum) — the two used to share the name `ClassMapDefinition`/
8059
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8060
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8061
- * are not: it is two different concepts colliding on a name. Keep this type
8062
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8063
- * would either narrow every `ClassMapDefinition` consumer to the four
8064
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8065
- * schema exists for (see the "rejects a classMap whose target is not a
8066
- * detection macro" test in `model-catalog-schema.test.ts`).
8067
- */
8068
- var DetectionCatalogClassMapSchema = object({
8069
- mapping: record(string(), _enum([
8070
- "person",
8071
- "vehicle",
8072
- "animal",
8073
- "package"
8074
- ])),
8075
- preserveOriginal: boolean()
8076
- });
8077
8147
  var MODEL_FORMATS = [
8078
8148
  "onnx",
8079
8149
  "coreml",
@@ -21206,7 +21276,7 @@ var lifecycleJobSchema = object({
21206
21276
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21207
21277
  * as every other cap.
21208
21278
  */
21209
- var LogLevelSchema$1 = _enum([
21279
+ var LogLevelSchema$2 = _enum([
21210
21280
  "debug",
21211
21281
  "info",
21212
21282
  "warn",
@@ -21413,7 +21483,7 @@ var CustomActionInputSchema = object({
21413
21483
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21414
21484
  addonId: string(),
21415
21485
  limit: number().min(1).max(500).default(100),
21416
- level: LogLevelSchema$1.optional()
21486
+ level: LogLevelSchema$2.optional()
21417
21487
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21418
21488
  packageName: string(),
21419
21489
  version: string().optional()
@@ -21511,7 +21581,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21511
21581
  auth: "admin"
21512
21582
  }), method(object({
21513
21583
  addonId: string(),
21514
- level: LogLevelSchema$1.optional()
21584
+ level: LogLevelSchema$2.optional()
21515
21585
  }), LogStreamEntrySchema, { kind: "subscription" });
21516
21586
  /**
21517
21587
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23243,6 +23313,35 @@ var FaceFilterEnum = _enum([
23243
23313
  "identified",
23244
23314
  "all"
23245
23315
  ]);
23316
+ /**
23317
+ * What a `listRecentFaces` page is ORDERED BY.
23318
+ *
23319
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23320
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23321
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23322
+ * order: it puts the suggestions an operator can confirm with one tap at the
23323
+ * top, and it is the reason this enum exists — a client that ranked a capped
23324
+ * page client-side was ranking the newest N, never the most certain N.
23325
+ *
23326
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23327
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23328
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23329
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23330
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23331
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23332
+ * then by faceId, and is what makes this a total order instead of the
23333
+ * backend's NULL-collation accident.
23334
+ */
23335
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23336
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23337
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23338
+ * never leaves the server. */
23339
+ var FaceClusterSchema = object({
23340
+ faceIds: array(string()).readonly(),
23341
+ representativeFaceId: string(),
23342
+ size: number().int(),
23343
+ cohesion: number()
23344
+ });
23246
23345
  var MediaFileLiteSchema$1 = object({
23247
23346
  key: string(),
23248
23347
  kind: string(),
@@ -23289,24 +23388,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23289
23388
  kind: "mutation",
23290
23389
  auth: "admin"
23291
23390
  }), method(object({
23292
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23391
+ /**
23392
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23393
+ *
23394
+ * The legacy single-camera form, kept verbatim for every caller that
23395
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23396
+ * instead — never both: `deviceIds` is the authority whenever it is
23397
+ * present, and this field is then ignored rather than unioned, so
23398
+ * there is exactly one answer to "which cameras did I ask for".
23399
+ */
23293
23400
  deviceId: number().int().optional(),
23401
+ /**
23402
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23403
+ * until now had to fetch the cluster-wide page and drop rows in the
23404
+ * client (so the `limit` it asked for was spent on cameras it was
23405
+ * about to discard).
23406
+ *
23407
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23408
+ * "every camera". A request for no devices is a request, not an
23409
+ * omission; same contract as `deviceManager.listFleet` and
23410
+ * `pipelineAnalytics.listRecentTracks`.
23411
+ *
23412
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23413
+ */
23414
+ deviceIds: array(number().int()).optional(),
23294
23415
  limit: number().int().positive().optional(),
23295
23416
  filter: FaceFilterEnum.optional(),
23296
23417
  /**
23297
- * Inline the base64 crop on every row. Default `true` — the existing
23298
- * behaviour, kept so no caller breaks.
23418
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23419
+ * Absent means no lower bound.
23420
+ */
23421
+ since: number().int().optional(),
23422
+ /**
23423
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23424
+ * Absent means no upper bound.
23425
+ */
23426
+ until: number().int().optional(),
23427
+ /**
23428
+ * Order the page by time or by suggestion certainty. Default
23429
+ * `'timestamp'` — the historical order, unchanged for every caller
23430
+ * that does not ask.
23299
23431
  *
23300
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23301
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23302
- * the browser cache the images.
23432
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23433
+ * does under `'suggestionConfidence'`.
23303
23434
  *
23304
- * **This is an INPUT field, so it does not reach the addon until the
23305
- * next train.** The hub router validates cap inputs against its own
23306
- * compiled Zod, which strips a key it does not know — verified today
23307
- * on the OUTPUT side, where an additive field DOES arrive immediately
23308
- * (`Track.hasFace`). Until the train ships, sending `false` is
23309
- * harmless and simply keeps the crops inline.
23435
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23436
+ * index and stops reading as soon as `limit` rows have PASSED the
23437
+ * filter. `'suggestionConfidence'` cannot stop early — the most
23438
+ * certain row may be the oldest — so it walks the window. Narrow it
23439
+ * with {@link since} / {@link until}.
23440
+ */
23441
+ sortBy: FaceSortFieldEnum.optional(),
23442
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23443
+ sortDirection: FaceSortDirectionEnum.optional(),
23444
+ /**
23445
+ * Inline the base64 crop on every row.
23446
+ *
23447
+ * Default `false` since the 2026-08-25 inversion — see
23448
+ * `include-crops-default.ts`, which is the ONE place that resolves
23449
+ * this for every gallery, and which records why the inline shape had
23450
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23451
+ * The doc here used to still say `true`; it was wrong, and a leftover
23452
+ * that describes the old design reads as permission to rely on it.
23453
+ *
23454
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23455
+ * which the browser fetches off the `event-media` plane in parallel,
23456
+ * cached and ETagged.
23310
23457
  */
23311
23458
  includeCrops: boolean().optional()
23312
23459
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23342,13 +23489,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23342
23489
  }), method(object({
23343
23490
  threshold: number().min(0).max(1).optional(),
23344
23491
  minClusterSize: number().int().min(2).optional(),
23345
- limit: number().int().positive().optional()
23346
- }).optional(), array(object({
23347
- faceIds: array(string()).readonly(),
23348
- representativeFaceId: string(),
23349
- size: number().int(),
23350
- cohesion: number()
23351
- })).readonly());
23492
+ /**
23493
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23494
+ * which read as though it bounded the work — it never did.
23495
+ *
23496
+ * Wins over {@link limit} when both are sent.
23497
+ */
23498
+ maxClusters: number().int().positive().optional(),
23499
+ /**
23500
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23501
+ * RESULT, not the scan. Kept so existing callers keep working; send
23502
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23503
+ */
23504
+ limit: number().int().positive().optional(),
23505
+ /**
23506
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23507
+ * POOL, not the result.
23508
+ *
23509
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23510
+ * used to read every unassigned face on the hub no matter what the
23511
+ * caller asked for, because the only bound cut the finished clusters
23512
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23513
+ * whole corpus, on an addon whose disk is under contention.
23514
+ *
23515
+ * The pool is the NEWEST matching faces first — the same order the
23516
+ * gallery shows — so a bound here shortens the horizon, it does not
23517
+ * sample it randomly.
23518
+ *
23519
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23520
+ * so the live corpus — 372 face rows — is unaffected while the
23521
+ * unbounded scan can never come back as the table grows.
23522
+ */
23523
+ maxFacesScanned: number().int().positive().optional()
23524
+ }).optional(), array(FaceClusterSchema).readonly());
23352
23525
  /**
23353
23526
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23354
23527
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28290,6 +28463,293 @@ var SetSiteLocationInputSchema = object({
28290
28463
  latitude: number().min(-90).max(90),
28291
28464
  longitude: number().min(-180).max(180)
28292
28465
  }).nullable();
28466
+ /**
28467
+ * The TRANSPORT a call arrived on.
28468
+ *
28469
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
28470
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
28471
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
28472
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
28473
+ * checkable rather than asserted.
28474
+ *
28475
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
28476
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
28477
+ * connection; the viewer talks to the hub over `wsLink`
28478
+ * exclusively, so this is the plane the HTTP census could not see.
28479
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
28480
+ * never touches a socket and therefore never touched a census.
28481
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
28482
+ * that is exactly what its `0` asserts: every plane the hub has can name
28483
+ * itself. It is an output bucket, never a knob — a call that arrives on a
28484
+ * plane nobody instrumented lands here instead of vanishing from the total.
28485
+ */
28486
+ var TransportPlaneSchema = _enum([
28487
+ "http",
28488
+ "ws",
28489
+ "mesh",
28490
+ "unknown"
28491
+ ]);
28492
+ /**
28493
+ * Calls per plane. Every key is always present, `0` included — an absent plane
28494
+ * reads as "not instrumented", which is the one thing this census must never
28495
+ * make an operator wonder about.
28496
+ */
28497
+ var TransportPlaneCountsSchema = object({
28498
+ http: number(),
28499
+ ws: number(),
28500
+ mesh: number(),
28501
+ unknown: number()
28502
+ });
28503
+ /**
28504
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
28505
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28506
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28507
+ * already prints - never a token, never an `Authorization` header.
28508
+ *
28509
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
28510
+ * and lives for hours, so folding it into a call count makes one long-lived
28511
+ * stream look like a storm.
28512
+ */
28513
+ var RequestCensusGroupSchema = object({
28514
+ plane: TransportPlaneSchema,
28515
+ procedure: string(),
28516
+ userAgent: string(),
28517
+ ip: string(),
28518
+ principal: string(),
28519
+ calls: number(),
28520
+ subscriptions: number(),
28521
+ perMin: number()
28522
+ });
28523
+ /**
28524
+ * A procedure's TOTAL over the window, across every caller.
28525
+ *
28526
+ * This block, not the group list, is what answers "did these calls arrive over
28527
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28528
+ * same window excludes the HTTP plane, which is a result, not a failure.
28529
+ */
28530
+ var RequestCensusProcedureSchema = object({
28531
+ procedure: string(),
28532
+ calls: number(),
28533
+ /**
28534
+ * The same total, split by transport. THIS is the row that answers the
28535
+ * question the census exists for: one look at `deviceManager.listAll` says
28536
+ * which plane carried the 4 960, without joining two log lines by eye.
28537
+ */
28538
+ planes: TransportPlaneCountsSchema,
28539
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
28540
+ subscriptions: number(),
28541
+ perMin: number()
28542
+ });
28543
+ /**
28544
+ * The census as an operator sees it.
28545
+ *
28546
+ * `persisted` is the honest answer to "will this survive the restart I am
28547
+ * about to do": the arm deadline is written to `system-settings` so a window
28548
+ * armed now can measure the NEXT boot, and a write that failed must not look
28549
+ * like one that succeeded.
28550
+ */
28551
+ var RequestCensusStatusSchema = object({
28552
+ armed: boolean(),
28553
+ /** How long the current - or just-closed - window collected, in ms. */
28554
+ elapsedMs: number(),
28555
+ /** The window actually armed, after the server clamped the request. */
28556
+ windowMs: number(),
28557
+ /** Epoch ms the window closes at. 0 when disarmed. */
28558
+ armedUntilMs: number(),
28559
+ httpRequests: number(),
28560
+ batchedRequests: number(),
28561
+ /**
28562
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28563
+ * is in play (`?batch=1` carries several procedures in one request); this is
28564
+ * the number comparable with a store-side call count.
28565
+ */
28566
+ procedureCalls: number(),
28567
+ /**
28568
+ * `procedureCalls` split by transport. The four keys sum to
28569
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
28570
+ * `planesExplainTotal` is that identity, checked rather than assumed.
28571
+ */
28572
+ planes: TransportPlaneCountsSchema,
28573
+ /**
28574
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
28575
+ * on no plane at all - which is a RESULT (a plane is missing from the
28576
+ * instrument), not a failure, and it has to be visible to be read as one.
28577
+ */
28578
+ planesExplainTotal: boolean(),
28579
+ /**
28580
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28581
+ * adapter resolves one context per connection - kept because a plane's call
28582
+ * count of zero against 37 open connections says something different from a
28583
+ * plane with no connections at all.
28584
+ */
28585
+ wsConnections: number(),
28586
+ /**
28587
+ * Client frames the WS plane looked at. `wsMessages` far above
28588
+ * `planes.ws + subscriptions` means most traffic is not operations
28589
+ * (keepalives, connection params) - which is itself an answer.
28590
+ */
28591
+ wsMessages: number(),
28592
+ /**
28593
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
28594
+ * purpose: one live-events stream opened at boot and held for six hours is
28595
+ * one subscription, and counting it as a call would let a quiet plane
28596
+ * masquerade as the storm.
28597
+ */
28598
+ subscriptions: number(),
28599
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
28600
+ subscriptionStops: number(),
28601
+ distinctGroups: number(),
28602
+ /**
28603
+ * Operations counted in the totals whose CALLER attribution was shed at the
28604
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
28605
+ * which transport they arrived on, they just lost their group row.
28606
+ */
28607
+ unattributedCalls: number(),
28608
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28609
+ groups: array(RequestCensusGroupSchema).readonly()
28610
+ }).extend({ persisted: boolean() });
28611
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28612
+ var LogLevelSchema$1 = _enum([
28613
+ "debug",
28614
+ "info",
28615
+ "warn",
28616
+ "error"
28617
+ ]);
28618
+ /**
28619
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28620
+ *
28621
+ * A diagnostic is anything whose cost is only worth paying while a question is
28622
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28623
+ */
28624
+ var DiagnosticIdSchema = _enum(["request-census"]);
28625
+ /**
28626
+ * The layers of the level hierarchy, general → specific. The most specific
28627
+ * layer that carries an explicit value wins.
28628
+ *
28629
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28630
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28631
+ * grow later would force every consumer of this document to change with it.
28632
+ * Nothing returns `component` today.
28633
+ */
28634
+ var LoggingScopeKindSchema = _enum([
28635
+ "cluster",
28636
+ "node",
28637
+ "component"
28638
+ ]);
28639
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28640
+ var LoggingLevelSourceSchema = _enum([
28641
+ "default",
28642
+ "cluster",
28643
+ "node",
28644
+ "component"
28645
+ ]);
28646
+ /**
28647
+ * One layer of the hierarchy as it actually STANDS.
28648
+ *
28649
+ * `level: null` is the whole reason this array is returned: it is the
28650
+ * difference between "this node is at `info` because I decided it" and
28651
+ * "...because it inherits". An operator who clears an override believing they
28652
+ * are clearing an inherited value has been handed the same defect as the two
28653
+ * contradicting knobs this document exists to remove, moved one floor up.
28654
+ */
28655
+ var LoggingLevelLayerSchema = object({
28656
+ scope: LoggingScopeKindSchema,
28657
+ /** The node this layer speaks for; `null` on the cluster layer. */
28658
+ nodeId: string().nullable(),
28659
+ /** Explicitly set here, or `null` when this layer inherits. */
28660
+ level: LogLevelSchema$1.nullable()
28661
+ });
28662
+ /** What a line is judged against, and WHICH layer decided it. */
28663
+ var LoggingEffectiveSchema = object({
28664
+ level: LogLevelSchema$1,
28665
+ levelSource: LoggingLevelSourceSchema
28666
+ });
28667
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28668
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28669
+ /**
28670
+ * An armed diagnostic, with its DEADLINE.
28671
+ *
28672
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28673
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28674
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28675
+ * `armed` is false — a window is never reported as slightly expired.
28676
+ */
28677
+ var DiagnosticWindowSchema = object({
28678
+ id: DiagnosticIdSchema,
28679
+ armed: boolean(),
28680
+ /** Epoch ms the window closes at. 0 when disarmed. */
28681
+ armedUntilMs: number(),
28682
+ /** Ms left before it expires on its own. 0 when disarmed. */
28683
+ remainingMs: number(),
28684
+ /** Whether the stored deadline is the one the live diagnostic is running —
28685
+ * i.e. whether this window would survive a restart. */
28686
+ persisted: boolean()
28687
+ });
28688
+ /**
28689
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28690
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28691
+ * is a second knob that disagrees with the first the day one of them moves.
28692
+ */
28693
+ var DiagnosticWindowPatchSchema = object({
28694
+ id: DiagnosticIdSchema,
28695
+ armMs: number().int().min(0),
28696
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28697
+ reportEveryMs: number().int().positive().optional()
28698
+ });
28699
+ /**
28700
+ * A PATCH, and patches MERGE.
28701
+ *
28702
+ * A field absent from the patch is left exactly as it was — arming a
28703
+ * diagnostic never resets a level, and setting a level never disarms a window.
28704
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28705
+ * `setAll` already merges, and rebuilding the object is how an absent field
28706
+ * turns into an erased one.
28707
+ */
28708
+ var LoggingSettingsPatchSchema = object({
28709
+ /**
28710
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28711
+ * addressed scope so it inherits again. A value sets it.
28712
+ */
28713
+ level: LogLevelSchema$1.nullable().optional(),
28714
+ /**
28715
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28716
+ * keeps running — a patch is never a full replacement.
28717
+ */
28718
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28719
+ });
28720
+ /**
28721
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28722
+ *
28723
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28724
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28725
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28726
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28727
+ * by an agent that holds no cluster document at all. The hub is the single
28728
+ * authority over the whole hierarchy and answers for every layer, so the
28729
+ * layer selector needs a name the transport does not already own.
28730
+ */
28731
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28732
+ var SetLoggingSettingsInputSchema = object({
28733
+ scopeNodeId: string().optional(),
28734
+ patch: LoggingSettingsPatchSchema
28735
+ });
28736
+ /**
28737
+ * The whole document, as read and as returned after every write.
28738
+ *
28739
+ * `persisted: false` means the settings store could not be read or written.
28740
+ * The in-memory mirror still governs behaviour and is unchanged by the
28741
+ * failure — a read that fails neither switches a level nor disarms a window
28742
+ * (D49) — but the operator is told that what they are looking at would not
28743
+ * survive a restart.
28744
+ */
28745
+ var LoggingSettingsStateSchema = object({
28746
+ /** The layer this document was read at. `null` = the cluster layer. */
28747
+ scopeNodeId: string().nullable(),
28748
+ effective: LoggingEffectiveSchema,
28749
+ explicit: LoggingExplicitSchema,
28750
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28751
+ persisted: boolean()
28752
+ });
28293
28753
  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(), {
28294
28754
  kind: "mutation",
28295
28755
  auth: "admin"
@@ -28302,6 +28762,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28302
28762
  }), method(_void(), SiteLocationStatusSchema, {
28303
28763
  kind: "mutation",
28304
28764
  auth: "admin"
28765
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28766
+ kind: "mutation",
28767
+ auth: "admin"
28305
28768
  });
28306
28769
  /**
28307
28770
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35541,6 +36004,18 @@ Object.freeze({
35541
36004
  addonId: null,
35542
36005
  access: "create"
35543
36006
  },
36007
+ "system.getLoggingSettings": {
36008
+ capName: "system",
36009
+ capScope: "system",
36010
+ addonId: null,
36011
+ access: "view"
36012
+ },
36013
+ "system.getRequestCensus": {
36014
+ capName: "system",
36015
+ capScope: "system",
36016
+ addonId: null,
36017
+ access: "view"
36018
+ },
35544
36019
  "system.getRetentionConfig": {
35545
36020
  capName: "system",
35546
36021
  capScope: "system",
@@ -35571,6 +36046,12 @@ Object.freeze({
35571
36046
  addonId: null,
35572
36047
  access: "view"
35573
36048
  },
36049
+ "system.setLoggingSettings": {
36050
+ capName: "system",
36051
+ capScope: "system",
36052
+ addonId: null,
36053
+ access: "create"
36054
+ },
35574
36055
  "system.setRetentionConfig": {
35575
36056
  capName: "system",
35576
36057
  capScope: "system",
@@ -36726,6 +37207,10 @@ Object.freeze({
36726
37207
  name: "deviceId",
36727
37208
  form: "single",
36728
37209
  optional: true
37210
+ }, {
37211
+ name: "deviceIds",
37212
+ form: "array",
37213
+ optional: true
36729
37214
  }],
36730
37215
  "fanControl.setDirection": [{
36731
37216
  name: "deviceId",
@@ -38336,7 +38821,38 @@ object({
38336
38821
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38337
38822
  * reproduce that.
38338
38823
  */
38339
- tileBudgetMb: number().int().min(0).max(1024)
38824
+ tileBudgetMb: number().int().min(0).max(1024),
38825
+ /**
38826
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38827
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38828
+ * subject tiles, on frames that detected something.
38829
+ *
38830
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38831
+ * containment is strict by design, so the native `keyFrame`, the detail
38832
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38833
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38834
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38835
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38836
+ *
38837
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38838
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38839
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38840
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38841
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38842
+ * binds only through a detection burst, where it still covers well past the
38843
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38844
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38845
+ * whole shape exists to avoid.
38846
+ *
38847
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38848
+ * subject tile, so one shared budget would let a busy camera's key frames
38849
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38850
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38851
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38852
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38853
+ * nothing.
38854
+ */
38855
+ sceneBudgetMb: number().int().min(0).max(1024)
38340
38856
  });
38341
38857
  /**
38342
38858
  * The values in force when the operator has set nothing.
@@ -38352,12 +38868,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38352
38868
  budgetMb: 1024,
38353
38869
  activityMs: 15e3,
38354
38870
  tileBudgetMb: 64,
38871
+ sceneBudgetMb: 48,
38355
38872
  admission: "inferred"
38356
38873
  };
38357
38874
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38358
38875
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38359
38876
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38360
38877
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38878
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38361
38879
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38362
38880
  var MB = 1024 * 1024;
38363
38881
  1024 * MB, 3072 * MB;