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