@camstack/addon-provider-dreo 0.2.31 → 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 +495 -59
  2. package/dist/addon.mjs +495 -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,211 @@ var SetSiteLocationInputSchema = object({
28290
28463
  latitude: number().min(-90).max(90),
28291
28464
  longitude: number().min(-180).max(180)
28292
28465
  }).nullable();
28466
+ /**
28467
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28468
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28469
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28470
+ * already prints - never a token, never an `Authorization` header.
28471
+ */
28472
+ var RequestCensusGroupSchema = object({
28473
+ procedure: string(),
28474
+ userAgent: string(),
28475
+ ip: string(),
28476
+ principal: string(),
28477
+ calls: number(),
28478
+ perMin: number()
28479
+ });
28480
+ /**
28481
+ * A procedure's TOTAL over the window, across every caller.
28482
+ *
28483
+ * This block, not the group list, is what answers "did these calls arrive over
28484
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28485
+ * same window excludes the HTTP plane, which is a result, not a failure.
28486
+ */
28487
+ var RequestCensusProcedureSchema = object({
28488
+ procedure: string(),
28489
+ calls: number(),
28490
+ perMin: number()
28491
+ });
28492
+ /**
28493
+ * The census as an operator sees it.
28494
+ *
28495
+ * `persisted` is the honest answer to "will this survive the restart I am
28496
+ * about to do": the arm deadline is written to `system-settings` so a window
28497
+ * armed now can measure the NEXT boot, and a write that failed must not look
28498
+ * like one that succeeded.
28499
+ */
28500
+ var RequestCensusStatusSchema = object({
28501
+ armed: boolean(),
28502
+ /** How long the current - or just-closed - window collected, in ms. */
28503
+ elapsedMs: number(),
28504
+ /** The window actually armed, after the server clamped the request. */
28505
+ windowMs: number(),
28506
+ /** Epoch ms the window closes at. 0 when disarmed. */
28507
+ armedUntilMs: number(),
28508
+ httpRequests: number(),
28509
+ batchedRequests: number(),
28510
+ /**
28511
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28512
+ * is in play (`?batch=1` carries several procedures in one request); this is
28513
+ * the number comparable with a store-side call count.
28514
+ */
28515
+ procedureCalls: number(),
28516
+ /**
28517
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28518
+ * transport resolves one context per connection - but the number that says
28519
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28520
+ */
28521
+ wsConnections: number(),
28522
+ distinctGroups: number(),
28523
+ /** Calls counted in the totals whose group attribution was shed at the
28524
+ * cardinality bound. */
28525
+ unattributedCalls: number(),
28526
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28527
+ groups: array(RequestCensusGroupSchema).readonly()
28528
+ }).extend({ persisted: boolean() });
28529
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28530
+ var LogLevelSchema$1 = _enum([
28531
+ "debug",
28532
+ "info",
28533
+ "warn",
28534
+ "error"
28535
+ ]);
28536
+ /**
28537
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28538
+ *
28539
+ * A diagnostic is anything whose cost is only worth paying while a question is
28540
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28541
+ */
28542
+ var DiagnosticIdSchema = _enum(["request-census"]);
28543
+ /**
28544
+ * The layers of the level hierarchy, general → specific. The most specific
28545
+ * layer that carries an explicit value wins.
28546
+ *
28547
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28548
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28549
+ * grow later would force every consumer of this document to change with it.
28550
+ * Nothing returns `component` today.
28551
+ */
28552
+ var LoggingScopeKindSchema = _enum([
28553
+ "cluster",
28554
+ "node",
28555
+ "component"
28556
+ ]);
28557
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28558
+ var LoggingLevelSourceSchema = _enum([
28559
+ "default",
28560
+ "cluster",
28561
+ "node",
28562
+ "component"
28563
+ ]);
28564
+ /**
28565
+ * One layer of the hierarchy as it actually STANDS.
28566
+ *
28567
+ * `level: null` is the whole reason this array is returned: it is the
28568
+ * difference between "this node is at `info` because I decided it" and
28569
+ * "...because it inherits". An operator who clears an override believing they
28570
+ * are clearing an inherited value has been handed the same defect as the two
28571
+ * contradicting knobs this document exists to remove, moved one floor up.
28572
+ */
28573
+ var LoggingLevelLayerSchema = object({
28574
+ scope: LoggingScopeKindSchema,
28575
+ /** The node this layer speaks for; `null` on the cluster layer. */
28576
+ nodeId: string().nullable(),
28577
+ /** Explicitly set here, or `null` when this layer inherits. */
28578
+ level: LogLevelSchema$1.nullable()
28579
+ });
28580
+ /** What a line is judged against, and WHICH layer decided it. */
28581
+ var LoggingEffectiveSchema = object({
28582
+ level: LogLevelSchema$1,
28583
+ levelSource: LoggingLevelSourceSchema
28584
+ });
28585
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28586
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28587
+ /**
28588
+ * An armed diagnostic, with its DEADLINE.
28589
+ *
28590
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28591
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28592
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28593
+ * `armed` is false — a window is never reported as slightly expired.
28594
+ */
28595
+ var DiagnosticWindowSchema = object({
28596
+ id: DiagnosticIdSchema,
28597
+ armed: boolean(),
28598
+ /** Epoch ms the window closes at. 0 when disarmed. */
28599
+ armedUntilMs: number(),
28600
+ /** Ms left before it expires on its own. 0 when disarmed. */
28601
+ remainingMs: number(),
28602
+ /** Whether the stored deadline is the one the live diagnostic is running —
28603
+ * i.e. whether this window would survive a restart. */
28604
+ persisted: boolean()
28605
+ });
28606
+ /**
28607
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28608
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28609
+ * is a second knob that disagrees with the first the day one of them moves.
28610
+ */
28611
+ var DiagnosticWindowPatchSchema = object({
28612
+ id: DiagnosticIdSchema,
28613
+ armMs: number().int().min(0),
28614
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28615
+ reportEveryMs: number().int().positive().optional()
28616
+ });
28617
+ /**
28618
+ * A PATCH, and patches MERGE.
28619
+ *
28620
+ * A field absent from the patch is left exactly as it was — arming a
28621
+ * diagnostic never resets a level, and setting a level never disarms a window.
28622
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28623
+ * `setAll` already merges, and rebuilding the object is how an absent field
28624
+ * turns into an erased one.
28625
+ */
28626
+ var LoggingSettingsPatchSchema = object({
28627
+ /**
28628
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28629
+ * addressed scope so it inherits again. A value sets it.
28630
+ */
28631
+ level: LogLevelSchema$1.nullable().optional(),
28632
+ /**
28633
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28634
+ * keeps running — a patch is never a full replacement.
28635
+ */
28636
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28637
+ });
28638
+ /**
28639
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28640
+ *
28641
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28642
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28643
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28644
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28645
+ * by an agent that holds no cluster document at all. The hub is the single
28646
+ * authority over the whole hierarchy and answers for every layer, so the
28647
+ * layer selector needs a name the transport does not already own.
28648
+ */
28649
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28650
+ var SetLoggingSettingsInputSchema = object({
28651
+ scopeNodeId: string().optional(),
28652
+ patch: LoggingSettingsPatchSchema
28653
+ });
28654
+ /**
28655
+ * The whole document, as read and as returned after every write.
28656
+ *
28657
+ * `persisted: false` means the settings store could not be read or written.
28658
+ * The in-memory mirror still governs behaviour and is unchanged by the
28659
+ * failure — a read that fails neither switches a level nor disarms a window
28660
+ * (D49) — but the operator is told that what they are looking at would not
28661
+ * survive a restart.
28662
+ */
28663
+ var LoggingSettingsStateSchema = object({
28664
+ /** The layer this document was read at. `null` = the cluster layer. */
28665
+ scopeNodeId: string().nullable(),
28666
+ effective: LoggingEffectiveSchema,
28667
+ explicit: LoggingExplicitSchema,
28668
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28669
+ persisted: boolean()
28670
+ });
28293
28671
  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
28672
  kind: "mutation",
28295
28673
  auth: "admin"
@@ -28302,6 +28680,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28302
28680
  }), method(_void(), SiteLocationStatusSchema, {
28303
28681
  kind: "mutation",
28304
28682
  auth: "admin"
28683
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28684
+ kind: "mutation",
28685
+ auth: "admin"
28305
28686
  });
28306
28687
  /**
28307
28688
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35541,6 +35922,18 @@ Object.freeze({
35541
35922
  addonId: null,
35542
35923
  access: "create"
35543
35924
  },
35925
+ "system.getLoggingSettings": {
35926
+ capName: "system",
35927
+ capScope: "system",
35928
+ addonId: null,
35929
+ access: "view"
35930
+ },
35931
+ "system.getRequestCensus": {
35932
+ capName: "system",
35933
+ capScope: "system",
35934
+ addonId: null,
35935
+ access: "view"
35936
+ },
35544
35937
  "system.getRetentionConfig": {
35545
35938
  capName: "system",
35546
35939
  capScope: "system",
@@ -35571,6 +35964,12 @@ Object.freeze({
35571
35964
  addonId: null,
35572
35965
  access: "view"
35573
35966
  },
35967
+ "system.setLoggingSettings": {
35968
+ capName: "system",
35969
+ capScope: "system",
35970
+ addonId: null,
35971
+ access: "create"
35972
+ },
35574
35973
  "system.setRetentionConfig": {
35575
35974
  capName: "system",
35576
35975
  capScope: "system",
@@ -36726,6 +37125,10 @@ Object.freeze({
36726
37125
  name: "deviceId",
36727
37126
  form: "single",
36728
37127
  optional: true
37128
+ }, {
37129
+ name: "deviceIds",
37130
+ form: "array",
37131
+ optional: true
36729
37132
  }],
36730
37133
  "fanControl.setDirection": [{
36731
37134
  name: "deviceId",
@@ -38336,7 +38739,38 @@ object({
38336
38739
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38337
38740
  * reproduce that.
38338
38741
  */
38339
- tileBudgetMb: number().int().min(0).max(1024)
38742
+ tileBudgetMb: number().int().min(0).max(1024),
38743
+ /**
38744
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38745
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38746
+ * subject tiles, on frames that detected something.
38747
+ *
38748
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38749
+ * containment is strict by design, so the native `keyFrame`, the detail
38750
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38751
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38752
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38753
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38754
+ *
38755
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38756
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38757
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38758
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38759
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38760
+ * binds only through a detection burst, where it still covers well past the
38761
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38762
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38763
+ * whole shape exists to avoid.
38764
+ *
38765
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38766
+ * subject tile, so one shared budget would let a busy camera's key frames
38767
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38768
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38769
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38770
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38771
+ * nothing.
38772
+ */
38773
+ sceneBudgetMb: number().int().min(0).max(1024)
38340
38774
  });
38341
38775
  /**
38342
38776
  * The values in force when the operator has set nothing.
@@ -38352,12 +38786,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38352
38786
  budgetMb: 1024,
38353
38787
  activityMs: 15e3,
38354
38788
  tileBudgetMb: 64,
38789
+ sceneBudgetMb: 48,
38355
38790
  admission: "inferred"
38356
38791
  };
38357
38792
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38358
38793
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38359
38794
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38360
38795
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38796
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38361
38797
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38362
38798
  var MB = 1024 * 1024;
38363
38799
  1024 * MB, 3072 * MB;
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,211 @@ var SetSiteLocationInputSchema = object({
28291
28464
  latitude: number().min(-90).max(90),
28292
28465
  longitude: number().min(-180).max(180)
28293
28466
  }).nullable();
28467
+ /**
28468
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28469
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28470
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28471
+ * already prints - never a token, never an `Authorization` header.
28472
+ */
28473
+ var RequestCensusGroupSchema = object({
28474
+ procedure: string(),
28475
+ userAgent: string(),
28476
+ ip: string(),
28477
+ principal: string(),
28478
+ calls: number(),
28479
+ perMin: number()
28480
+ });
28481
+ /**
28482
+ * A procedure's TOTAL over the window, across every caller.
28483
+ *
28484
+ * This block, not the group list, is what answers "did these calls arrive over
28485
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28486
+ * same window excludes the HTTP plane, which is a result, not a failure.
28487
+ */
28488
+ var RequestCensusProcedureSchema = object({
28489
+ procedure: string(),
28490
+ calls: number(),
28491
+ perMin: number()
28492
+ });
28493
+ /**
28494
+ * The census as an operator sees it.
28495
+ *
28496
+ * `persisted` is the honest answer to "will this survive the restart I am
28497
+ * about to do": the arm deadline is written to `system-settings` so a window
28498
+ * armed now can measure the NEXT boot, and a write that failed must not look
28499
+ * like one that succeeded.
28500
+ */
28501
+ var RequestCensusStatusSchema = object({
28502
+ armed: boolean(),
28503
+ /** How long the current - or just-closed - window collected, in ms. */
28504
+ elapsedMs: number(),
28505
+ /** The window actually armed, after the server clamped the request. */
28506
+ windowMs: number(),
28507
+ /** Epoch ms the window closes at. 0 when disarmed. */
28508
+ armedUntilMs: number(),
28509
+ httpRequests: number(),
28510
+ batchedRequests: number(),
28511
+ /**
28512
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28513
+ * is in play (`?batch=1` carries several procedures in one request); this is
28514
+ * the number comparable with a store-side call count.
28515
+ */
28516
+ procedureCalls: number(),
28517
+ /**
28518
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28519
+ * transport resolves one context per connection - but the number that says
28520
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28521
+ */
28522
+ wsConnections: number(),
28523
+ distinctGroups: number(),
28524
+ /** Calls counted in the totals whose group attribution was shed at the
28525
+ * cardinality bound. */
28526
+ unattributedCalls: number(),
28527
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28528
+ groups: array(RequestCensusGroupSchema).readonly()
28529
+ }).extend({ persisted: boolean() });
28530
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28531
+ var LogLevelSchema$1 = _enum([
28532
+ "debug",
28533
+ "info",
28534
+ "warn",
28535
+ "error"
28536
+ ]);
28537
+ /**
28538
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28539
+ *
28540
+ * A diagnostic is anything whose cost is only worth paying while a question is
28541
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28542
+ */
28543
+ var DiagnosticIdSchema = _enum(["request-census"]);
28544
+ /**
28545
+ * The layers of the level hierarchy, general → specific. The most specific
28546
+ * layer that carries an explicit value wins.
28547
+ *
28548
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28549
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28550
+ * grow later would force every consumer of this document to change with it.
28551
+ * Nothing returns `component` today.
28552
+ */
28553
+ var LoggingScopeKindSchema = _enum([
28554
+ "cluster",
28555
+ "node",
28556
+ "component"
28557
+ ]);
28558
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28559
+ var LoggingLevelSourceSchema = _enum([
28560
+ "default",
28561
+ "cluster",
28562
+ "node",
28563
+ "component"
28564
+ ]);
28565
+ /**
28566
+ * One layer of the hierarchy as it actually STANDS.
28567
+ *
28568
+ * `level: null` is the whole reason this array is returned: it is the
28569
+ * difference between "this node is at `info` because I decided it" and
28570
+ * "...because it inherits". An operator who clears an override believing they
28571
+ * are clearing an inherited value has been handed the same defect as the two
28572
+ * contradicting knobs this document exists to remove, moved one floor up.
28573
+ */
28574
+ var LoggingLevelLayerSchema = object({
28575
+ scope: LoggingScopeKindSchema,
28576
+ /** The node this layer speaks for; `null` on the cluster layer. */
28577
+ nodeId: string().nullable(),
28578
+ /** Explicitly set here, or `null` when this layer inherits. */
28579
+ level: LogLevelSchema$1.nullable()
28580
+ });
28581
+ /** What a line is judged against, and WHICH layer decided it. */
28582
+ var LoggingEffectiveSchema = object({
28583
+ level: LogLevelSchema$1,
28584
+ levelSource: LoggingLevelSourceSchema
28585
+ });
28586
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28587
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28588
+ /**
28589
+ * An armed diagnostic, with its DEADLINE.
28590
+ *
28591
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28592
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28593
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28594
+ * `armed` is false — a window is never reported as slightly expired.
28595
+ */
28596
+ var DiagnosticWindowSchema = object({
28597
+ id: DiagnosticIdSchema,
28598
+ armed: boolean(),
28599
+ /** Epoch ms the window closes at. 0 when disarmed. */
28600
+ armedUntilMs: number(),
28601
+ /** Ms left before it expires on its own. 0 when disarmed. */
28602
+ remainingMs: number(),
28603
+ /** Whether the stored deadline is the one the live diagnostic is running —
28604
+ * i.e. whether this window would survive a restart. */
28605
+ persisted: boolean()
28606
+ });
28607
+ /**
28608
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28609
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28610
+ * is a second knob that disagrees with the first the day one of them moves.
28611
+ */
28612
+ var DiagnosticWindowPatchSchema = object({
28613
+ id: DiagnosticIdSchema,
28614
+ armMs: number().int().min(0),
28615
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28616
+ reportEveryMs: number().int().positive().optional()
28617
+ });
28618
+ /**
28619
+ * A PATCH, and patches MERGE.
28620
+ *
28621
+ * A field absent from the patch is left exactly as it was — arming a
28622
+ * diagnostic never resets a level, and setting a level never disarms a window.
28623
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28624
+ * `setAll` already merges, and rebuilding the object is how an absent field
28625
+ * turns into an erased one.
28626
+ */
28627
+ var LoggingSettingsPatchSchema = object({
28628
+ /**
28629
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28630
+ * addressed scope so it inherits again. A value sets it.
28631
+ */
28632
+ level: LogLevelSchema$1.nullable().optional(),
28633
+ /**
28634
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28635
+ * keeps running — a patch is never a full replacement.
28636
+ */
28637
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28638
+ });
28639
+ /**
28640
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28641
+ *
28642
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28643
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28644
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28645
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28646
+ * by an agent that holds no cluster document at all. The hub is the single
28647
+ * authority over the whole hierarchy and answers for every layer, so the
28648
+ * layer selector needs a name the transport does not already own.
28649
+ */
28650
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28651
+ var SetLoggingSettingsInputSchema = object({
28652
+ scopeNodeId: string().optional(),
28653
+ patch: LoggingSettingsPatchSchema
28654
+ });
28655
+ /**
28656
+ * The whole document, as read and as returned after every write.
28657
+ *
28658
+ * `persisted: false` means the settings store could not be read or written.
28659
+ * The in-memory mirror still governs behaviour and is unchanged by the
28660
+ * failure — a read that fails neither switches a level nor disarms a window
28661
+ * (D49) — but the operator is told that what they are looking at would not
28662
+ * survive a restart.
28663
+ */
28664
+ var LoggingSettingsStateSchema = object({
28665
+ /** The layer this document was read at. `null` = the cluster layer. */
28666
+ scopeNodeId: string().nullable(),
28667
+ effective: LoggingEffectiveSchema,
28668
+ explicit: LoggingExplicitSchema,
28669
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28670
+ persisted: boolean()
28671
+ });
28294
28672
  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
28673
  kind: "mutation",
28296
28674
  auth: "admin"
@@ -28303,6 +28681,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28303
28681
  }), method(_void(), SiteLocationStatusSchema, {
28304
28682
  kind: "mutation",
28305
28683
  auth: "admin"
28684
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28685
+ kind: "mutation",
28686
+ auth: "admin"
28306
28687
  });
28307
28688
  /**
28308
28689
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35542,6 +35923,18 @@ Object.freeze({
35542
35923
  addonId: null,
35543
35924
  access: "create"
35544
35925
  },
35926
+ "system.getLoggingSettings": {
35927
+ capName: "system",
35928
+ capScope: "system",
35929
+ addonId: null,
35930
+ access: "view"
35931
+ },
35932
+ "system.getRequestCensus": {
35933
+ capName: "system",
35934
+ capScope: "system",
35935
+ addonId: null,
35936
+ access: "view"
35937
+ },
35545
35938
  "system.getRetentionConfig": {
35546
35939
  capName: "system",
35547
35940
  capScope: "system",
@@ -35572,6 +35965,12 @@ Object.freeze({
35572
35965
  addonId: null,
35573
35966
  access: "view"
35574
35967
  },
35968
+ "system.setLoggingSettings": {
35969
+ capName: "system",
35970
+ capScope: "system",
35971
+ addonId: null,
35972
+ access: "create"
35973
+ },
35575
35974
  "system.setRetentionConfig": {
35576
35975
  capName: "system",
35577
35976
  capScope: "system",
@@ -36727,6 +37126,10 @@ Object.freeze({
36727
37126
  name: "deviceId",
36728
37127
  form: "single",
36729
37128
  optional: true
37129
+ }, {
37130
+ name: "deviceIds",
37131
+ form: "array",
37132
+ optional: true
36730
37133
  }],
36731
37134
  "fanControl.setDirection": [{
36732
37135
  name: "deviceId",
@@ -38337,7 +38740,38 @@ object({
38337
38740
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38338
38741
  * reproduce that.
38339
38742
  */
38340
- tileBudgetMb: number().int().min(0).max(1024)
38743
+ tileBudgetMb: number().int().min(0).max(1024),
38744
+ /**
38745
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38746
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38747
+ * subject tiles, on frames that detected something.
38748
+ *
38749
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38750
+ * containment is strict by design, so the native `keyFrame`, the detail
38751
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38752
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38753
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38754
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38755
+ *
38756
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38757
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38758
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38759
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38760
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38761
+ * binds only through a detection burst, where it still covers well past the
38762
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38763
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38764
+ * whole shape exists to avoid.
38765
+ *
38766
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38767
+ * subject tile, so one shared budget would let a busy camera's key frames
38768
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38769
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38770
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38771
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38772
+ * nothing.
38773
+ */
38774
+ sceneBudgetMb: number().int().min(0).max(1024)
38341
38775
  });
38342
38776
  /**
38343
38777
  * The values in force when the operator has set nothing.
@@ -38353,12 +38787,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38353
38787
  budgetMb: 1024,
38354
38788
  activityMs: 15e3,
38355
38789
  tileBudgetMb: 64,
38790
+ sceneBudgetMb: 48,
38356
38791
  admission: "inferred"
38357
38792
  };
38358
38793
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38359
38794
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38360
38795
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38361
38796
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38797
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38362
38798
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38363
38799
  var MB = 1024 * 1024;
38364
38800
  1024 * MB, 3072 * MB;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-dreo",
3
- "version": "0.2.31",
3
+ "version": "0.2.32",
4
4
  "description": "Dreo smart-device (fan / air-circulator / purifier / heater / humidifier) device-provider addon for CamStack — wraps the @apocaliss92/nodedreo Dreo cloud client (REST + WebSocket)",
5
5
  "keywords": [
6
6
  "camstack",