@camstack/addon-provider-wyze 0.2.35 → 0.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +577 -59
  2. package/dist/addon.mjs +577 -59
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7558,6 +7558,66 @@ var OpsLogQueryInputSchema = object({
7558
7558
  /** Max rows returned, newest-first. */
7559
7559
  limit: number().int().min(1).max(1e3).optional()
7560
7560
  });
7561
+ var LabelDefinitionSchema = object({
7562
+ id: string(),
7563
+ name: string(),
7564
+ category: string().optional(),
7565
+ description: string().optional(),
7566
+ icon: string().optional()
7567
+ });
7568
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7569
+ var CLASS_MAP_MACRO_TARGETS = [
7570
+ "person",
7571
+ "vehicle",
7572
+ "animal",
7573
+ "package"
7574
+ ];
7575
+ /**
7576
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7577
+ * un operatore può selezionare.
7578
+ *
7579
+ * Sono le tre offerte dallo step `object-detection`
7580
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7581
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7582
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7583
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7584
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7585
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7586
+ *
7587
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7588
+ * dello step e una seconda volta come union `FirstLevelMacro`
7589
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7590
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7591
+ * successiva.
7592
+ */
7593
+ var FIRST_LEVEL_MACRO_CLASSES = [
7594
+ "person",
7595
+ "vehicle",
7596
+ "animal"
7597
+ ];
7598
+ /**
7599
+ * Wire schema for a per-model CATALOG classMap override
7600
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7601
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7602
+ * detection pipeline executor actually routes.
7603
+ *
7604
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7605
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7606
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7607
+ * enum) — the two used to share the name `ClassMapDefinition`/
7608
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7609
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7610
+ * are not: it is two different concepts colliding on a name. Keep this type
7611
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7612
+ * would either narrow every `ClassMapDefinition` consumer to the four
7613
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7614
+ * schema exists for (see the "rejects a classMap whose target is not a
7615
+ * detection macro" test in `model-catalog-schema.test.ts`).
7616
+ */
7617
+ var DetectionCatalogClassMapSchema = object({
7618
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7619
+ preserveOriginal: boolean()
7620
+ });
7561
7621
  /**
7562
7622
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7563
7623
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7580,10 +7640,55 @@ var RecordingStorageModeSchema = _enum([
7580
7640
  "events",
7581
7641
  "continuous"
7582
7642
  ]);
7643
+ /**
7644
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7645
+ * tre offerte dallo step `object-detection`, da UNA lista
7646
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7647
+ */
7648
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7649
+ /**
7650
+ * True quando `values` non ripete un elemento.
7651
+ *
7652
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7653
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7654
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7655
+ */
7656
+ var noDuplicates = (values) => new Set(values).size === values.length;
7583
7657
  /** Which detectors trigger an `events`-mode band. */
7584
7658
  var RecordingTriggersSchema = object({
7585
7659
  motion: boolean().optional(),
7586
- audioThresholdDbfs: number().optional()
7660
+ audioThresholdDbfs: number().optional(),
7661
+ /**
7662
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7663
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7664
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7665
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7666
+ *
7667
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7668
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7669
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7670
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7671
+ * finestre — vedi `recorder/object-trigger.ts`.
7672
+ */
7673
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7674
+ /**
7675
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7676
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7677
+ * `objectClasses`.
7678
+ *
7679
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7680
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7681
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7682
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7683
+ * device (D12) — mai un elenco globale di cap.
7684
+ *
7685
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7686
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7687
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7688
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7689
+ * registrare.
7690
+ */
7691
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7587
7692
  });
7588
7693
  /**
7589
7694
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8035,41 +8140,6 @@ var DecoderSessionConfigSchema = object({
8035
8140
  */
8036
8141
  debug: boolean().optional()
8037
8142
  });
8038
- var LabelDefinitionSchema = object({
8039
- id: string(),
8040
- name: string(),
8041
- category: string().optional(),
8042
- description: string().optional(),
8043
- icon: string().optional()
8044
- });
8045
- /**
8046
- * Wire schema for a per-model CATALOG classMap override
8047
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8048
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8049
- * detection pipeline executor actually routes.
8050
- *
8051
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8052
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8053
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8054
- * enum) — the two used to share the name `ClassMapDefinition`/
8055
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8056
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8057
- * are not: it is two different concepts colliding on a name. Keep this type
8058
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8059
- * would either narrow every `ClassMapDefinition` consumer to the four
8060
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8061
- * schema exists for (see the "rejects a classMap whose target is not a
8062
- * detection macro" test in `model-catalog-schema.test.ts`).
8063
- */
8064
- var DetectionCatalogClassMapSchema = object({
8065
- mapping: record(string(), _enum([
8066
- "person",
8067
- "vehicle",
8068
- "animal",
8069
- "package"
8070
- ])),
8071
- preserveOriginal: boolean()
8072
- });
8073
8143
  var MODEL_FORMATS = [
8074
8144
  "onnx",
8075
8145
  "coreml",
@@ -21306,7 +21376,7 @@ var lifecycleJobSchema = object({
21306
21376
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21307
21377
  * as every other cap.
21308
21378
  */
21309
- var LogLevelSchema$1 = _enum([
21379
+ var LogLevelSchema$2 = _enum([
21310
21380
  "debug",
21311
21381
  "info",
21312
21382
  "warn",
@@ -21513,7 +21583,7 @@ var CustomActionInputSchema = object({
21513
21583
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21514
21584
  addonId: string(),
21515
21585
  limit: number().min(1).max(500).default(100),
21516
- level: LogLevelSchema$1.optional()
21586
+ level: LogLevelSchema$2.optional()
21517
21587
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21518
21588
  packageName: string(),
21519
21589
  version: string().optional()
@@ -21611,7 +21681,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21611
21681
  auth: "admin"
21612
21682
  }), method(object({
21613
21683
  addonId: string(),
21614
- level: LogLevelSchema$1.optional()
21684
+ level: LogLevelSchema$2.optional()
21615
21685
  }), LogStreamEntrySchema, { kind: "subscription" });
21616
21686
  /**
21617
21687
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23343,6 +23413,35 @@ var FaceFilterEnum = _enum([
23343
23413
  "identified",
23344
23414
  "all"
23345
23415
  ]);
23416
+ /**
23417
+ * What a `listRecentFaces` page is ORDERED BY.
23418
+ *
23419
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23420
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23421
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23422
+ * order: it puts the suggestions an operator can confirm with one tap at the
23423
+ * top, and it is the reason this enum exists — a client that ranked a capped
23424
+ * page client-side was ranking the newest N, never the most certain N.
23425
+ *
23426
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23427
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23428
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23429
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23430
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23431
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23432
+ * then by faceId, and is what makes this a total order instead of the
23433
+ * backend's NULL-collation accident.
23434
+ */
23435
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23436
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23437
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23438
+ * never leaves the server. */
23439
+ var FaceClusterSchema = object({
23440
+ faceIds: array(string()).readonly(),
23441
+ representativeFaceId: string(),
23442
+ size: number().int(),
23443
+ cohesion: number()
23444
+ });
23346
23445
  var MediaFileLiteSchema$1 = object({
23347
23446
  key: string(),
23348
23447
  kind: string(),
@@ -23389,24 +23488,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23389
23488
  kind: "mutation",
23390
23489
  auth: "admin"
23391
23490
  }), method(object({
23392
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23491
+ /**
23492
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23493
+ *
23494
+ * The legacy single-camera form, kept verbatim for every caller that
23495
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23496
+ * instead — never both: `deviceIds` is the authority whenever it is
23497
+ * present, and this field is then ignored rather than unioned, so
23498
+ * there is exactly one answer to "which cameras did I ask for".
23499
+ */
23393
23500
  deviceId: number().int().optional(),
23501
+ /**
23502
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23503
+ * until now had to fetch the cluster-wide page and drop rows in the
23504
+ * client (so the `limit` it asked for was spent on cameras it was
23505
+ * about to discard).
23506
+ *
23507
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23508
+ * "every camera". A request for no devices is a request, not an
23509
+ * omission; same contract as `deviceManager.listFleet` and
23510
+ * `pipelineAnalytics.listRecentTracks`.
23511
+ *
23512
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23513
+ */
23514
+ deviceIds: array(number().int()).optional(),
23394
23515
  limit: number().int().positive().optional(),
23395
23516
  filter: FaceFilterEnum.optional(),
23396
23517
  /**
23397
- * Inline the base64 crop on every row. Default `true` — the existing
23398
- * behaviour, kept so no caller breaks.
23518
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23519
+ * Absent means no lower bound.
23520
+ */
23521
+ since: number().int().optional(),
23522
+ /**
23523
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23524
+ * Absent means no upper bound.
23525
+ */
23526
+ until: number().int().optional(),
23527
+ /**
23528
+ * Order the page by time or by suggestion certainty. Default
23529
+ * `'timestamp'` — the historical order, unchanged for every caller
23530
+ * that does not ask.
23399
23531
  *
23400
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23401
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23402
- * the browser cache the images.
23532
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23533
+ * does under `'suggestionConfidence'`.
23403
23534
  *
23404
- * **This is an INPUT field, so it does not reach the addon until the
23405
- * next train.** The hub router validates cap inputs against its own
23406
- * compiled Zod, which strips a key it does not know — verified today
23407
- * on the OUTPUT side, where an additive field DOES arrive immediately
23408
- * (`Track.hasFace`). Until the train ships, sending `false` is
23409
- * harmless and simply keeps the crops inline.
23535
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23536
+ * index and stops reading as soon as `limit` rows have PASSED the
23537
+ * filter. `'suggestionConfidence'` cannot stop early — the most
23538
+ * certain row may be the oldest — so it walks the window. Narrow it
23539
+ * with {@link since} / {@link until}.
23540
+ */
23541
+ sortBy: FaceSortFieldEnum.optional(),
23542
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23543
+ sortDirection: FaceSortDirectionEnum.optional(),
23544
+ /**
23545
+ * Inline the base64 crop on every row.
23546
+ *
23547
+ * Default `false` since the 2026-08-25 inversion — see
23548
+ * `include-crops-default.ts`, which is the ONE place that resolves
23549
+ * this for every gallery, and which records why the inline shape had
23550
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23551
+ * The doc here used to still say `true`; it was wrong, and a leftover
23552
+ * that describes the old design reads as permission to rely on it.
23553
+ *
23554
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23555
+ * which the browser fetches off the `event-media` plane in parallel,
23556
+ * cached and ETagged.
23410
23557
  */
23411
23558
  includeCrops: boolean().optional()
23412
23559
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23442,13 +23589,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23442
23589
  }), method(object({
23443
23590
  threshold: number().min(0).max(1).optional(),
23444
23591
  minClusterSize: number().int().min(2).optional(),
23445
- limit: number().int().positive().optional()
23446
- }).optional(), array(object({
23447
- faceIds: array(string()).readonly(),
23448
- representativeFaceId: string(),
23449
- size: number().int(),
23450
- cohesion: number()
23451
- })).readonly());
23592
+ /**
23593
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23594
+ * which read as though it bounded the work — it never did.
23595
+ *
23596
+ * Wins over {@link limit} when both are sent.
23597
+ */
23598
+ maxClusters: number().int().positive().optional(),
23599
+ /**
23600
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23601
+ * RESULT, not the scan. Kept so existing callers keep working; send
23602
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23603
+ */
23604
+ limit: number().int().positive().optional(),
23605
+ /**
23606
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23607
+ * POOL, not the result.
23608
+ *
23609
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23610
+ * used to read every unassigned face on the hub no matter what the
23611
+ * caller asked for, because the only bound cut the finished clusters
23612
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23613
+ * whole corpus, on an addon whose disk is under contention.
23614
+ *
23615
+ * The pool is the NEWEST matching faces first — the same order the
23616
+ * gallery shows — so a bound here shortens the horizon, it does not
23617
+ * sample it randomly.
23618
+ *
23619
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23620
+ * so the live corpus — 372 face rows — is unaffected while the
23621
+ * unbounded scan can never come back as the table grows.
23622
+ */
23623
+ maxFacesScanned: number().int().positive().optional()
23624
+ }).optional(), array(FaceClusterSchema).readonly());
23452
23625
  /**
23453
23626
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23454
23627
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28390,6 +28563,293 @@ var SetSiteLocationInputSchema = object({
28390
28563
  latitude: number().min(-90).max(90),
28391
28564
  longitude: number().min(-180).max(180)
28392
28565
  }).nullable();
28566
+ /**
28567
+ * The TRANSPORT a call arrived on.
28568
+ *
28569
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
28570
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
28571
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
28572
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
28573
+ * checkable rather than asserted.
28574
+ *
28575
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
28576
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
28577
+ * connection; the viewer talks to the hub over `wsLink`
28578
+ * exclusively, so this is the plane the HTTP census could not see.
28579
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
28580
+ * never touches a socket and therefore never touched a census.
28581
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
28582
+ * that is exactly what its `0` asserts: every plane the hub has can name
28583
+ * itself. It is an output bucket, never a knob — a call that arrives on a
28584
+ * plane nobody instrumented lands here instead of vanishing from the total.
28585
+ */
28586
+ var TransportPlaneSchema = _enum([
28587
+ "http",
28588
+ "ws",
28589
+ "mesh",
28590
+ "unknown"
28591
+ ]);
28592
+ /**
28593
+ * Calls per plane. Every key is always present, `0` included — an absent plane
28594
+ * reads as "not instrumented", which is the one thing this census must never
28595
+ * make an operator wonder about.
28596
+ */
28597
+ var TransportPlaneCountsSchema = object({
28598
+ http: number(),
28599
+ ws: number(),
28600
+ mesh: number(),
28601
+ unknown: number()
28602
+ });
28603
+ /**
28604
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
28605
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28606
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28607
+ * already prints - never a token, never an `Authorization` header.
28608
+ *
28609
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
28610
+ * and lives for hours, so folding it into a call count makes one long-lived
28611
+ * stream look like a storm.
28612
+ */
28613
+ var RequestCensusGroupSchema = object({
28614
+ plane: TransportPlaneSchema,
28615
+ procedure: string(),
28616
+ userAgent: string(),
28617
+ ip: string(),
28618
+ principal: string(),
28619
+ calls: number(),
28620
+ subscriptions: number(),
28621
+ perMin: number()
28622
+ });
28623
+ /**
28624
+ * A procedure's TOTAL over the window, across every caller.
28625
+ *
28626
+ * This block, not the group list, is what answers "did these calls arrive over
28627
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28628
+ * same window excludes the HTTP plane, which is a result, not a failure.
28629
+ */
28630
+ var RequestCensusProcedureSchema = object({
28631
+ procedure: string(),
28632
+ calls: number(),
28633
+ /**
28634
+ * The same total, split by transport. THIS is the row that answers the
28635
+ * question the census exists for: one look at `deviceManager.listAll` says
28636
+ * which plane carried the 4 960, without joining two log lines by eye.
28637
+ */
28638
+ planes: TransportPlaneCountsSchema,
28639
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
28640
+ subscriptions: number(),
28641
+ perMin: number()
28642
+ });
28643
+ /**
28644
+ * The census as an operator sees it.
28645
+ *
28646
+ * `persisted` is the honest answer to "will this survive the restart I am
28647
+ * about to do": the arm deadline is written to `system-settings` so a window
28648
+ * armed now can measure the NEXT boot, and a write that failed must not look
28649
+ * like one that succeeded.
28650
+ */
28651
+ var RequestCensusStatusSchema = object({
28652
+ armed: boolean(),
28653
+ /** How long the current - or just-closed - window collected, in ms. */
28654
+ elapsedMs: number(),
28655
+ /** The window actually armed, after the server clamped the request. */
28656
+ windowMs: number(),
28657
+ /** Epoch ms the window closes at. 0 when disarmed. */
28658
+ armedUntilMs: number(),
28659
+ httpRequests: number(),
28660
+ batchedRequests: number(),
28661
+ /**
28662
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28663
+ * is in play (`?batch=1` carries several procedures in one request); this is
28664
+ * the number comparable with a store-side call count.
28665
+ */
28666
+ procedureCalls: number(),
28667
+ /**
28668
+ * `procedureCalls` split by transport. The four keys sum to
28669
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
28670
+ * `planesExplainTotal` is that identity, checked rather than assumed.
28671
+ */
28672
+ planes: TransportPlaneCountsSchema,
28673
+ /**
28674
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
28675
+ * on no plane at all - which is a RESULT (a plane is missing from the
28676
+ * instrument), not a failure, and it has to be visible to be read as one.
28677
+ */
28678
+ planesExplainTotal: boolean(),
28679
+ /**
28680
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28681
+ * adapter resolves one context per connection - kept because a plane's call
28682
+ * count of zero against 37 open connections says something different from a
28683
+ * plane with no connections at all.
28684
+ */
28685
+ wsConnections: number(),
28686
+ /**
28687
+ * Client frames the WS plane looked at. `wsMessages` far above
28688
+ * `planes.ws + subscriptions` means most traffic is not operations
28689
+ * (keepalives, connection params) - which is itself an answer.
28690
+ */
28691
+ wsMessages: number(),
28692
+ /**
28693
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
28694
+ * purpose: one live-events stream opened at boot and held for six hours is
28695
+ * one subscription, and counting it as a call would let a quiet plane
28696
+ * masquerade as the storm.
28697
+ */
28698
+ subscriptions: number(),
28699
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
28700
+ subscriptionStops: number(),
28701
+ distinctGroups: number(),
28702
+ /**
28703
+ * Operations counted in the totals whose CALLER attribution was shed at the
28704
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
28705
+ * which transport they arrived on, they just lost their group row.
28706
+ */
28707
+ unattributedCalls: number(),
28708
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28709
+ groups: array(RequestCensusGroupSchema).readonly()
28710
+ }).extend({ persisted: boolean() });
28711
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28712
+ var LogLevelSchema$1 = _enum([
28713
+ "debug",
28714
+ "info",
28715
+ "warn",
28716
+ "error"
28717
+ ]);
28718
+ /**
28719
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28720
+ *
28721
+ * A diagnostic is anything whose cost is only worth paying while a question is
28722
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28723
+ */
28724
+ var DiagnosticIdSchema = _enum(["request-census"]);
28725
+ /**
28726
+ * The layers of the level hierarchy, general → specific. The most specific
28727
+ * layer that carries an explicit value wins.
28728
+ *
28729
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28730
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28731
+ * grow later would force every consumer of this document to change with it.
28732
+ * Nothing returns `component` today.
28733
+ */
28734
+ var LoggingScopeKindSchema = _enum([
28735
+ "cluster",
28736
+ "node",
28737
+ "component"
28738
+ ]);
28739
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28740
+ var LoggingLevelSourceSchema = _enum([
28741
+ "default",
28742
+ "cluster",
28743
+ "node",
28744
+ "component"
28745
+ ]);
28746
+ /**
28747
+ * One layer of the hierarchy as it actually STANDS.
28748
+ *
28749
+ * `level: null` is the whole reason this array is returned: it is the
28750
+ * difference between "this node is at `info` because I decided it" and
28751
+ * "...because it inherits". An operator who clears an override believing they
28752
+ * are clearing an inherited value has been handed the same defect as the two
28753
+ * contradicting knobs this document exists to remove, moved one floor up.
28754
+ */
28755
+ var LoggingLevelLayerSchema = object({
28756
+ scope: LoggingScopeKindSchema,
28757
+ /** The node this layer speaks for; `null` on the cluster layer. */
28758
+ nodeId: string().nullable(),
28759
+ /** Explicitly set here, or `null` when this layer inherits. */
28760
+ level: LogLevelSchema$1.nullable()
28761
+ });
28762
+ /** What a line is judged against, and WHICH layer decided it. */
28763
+ var LoggingEffectiveSchema = object({
28764
+ level: LogLevelSchema$1,
28765
+ levelSource: LoggingLevelSourceSchema
28766
+ });
28767
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28768
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28769
+ /**
28770
+ * An armed diagnostic, with its DEADLINE.
28771
+ *
28772
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28773
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28774
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28775
+ * `armed` is false — a window is never reported as slightly expired.
28776
+ */
28777
+ var DiagnosticWindowSchema = object({
28778
+ id: DiagnosticIdSchema,
28779
+ armed: boolean(),
28780
+ /** Epoch ms the window closes at. 0 when disarmed. */
28781
+ armedUntilMs: number(),
28782
+ /** Ms left before it expires on its own. 0 when disarmed. */
28783
+ remainingMs: number(),
28784
+ /** Whether the stored deadline is the one the live diagnostic is running —
28785
+ * i.e. whether this window would survive a restart. */
28786
+ persisted: boolean()
28787
+ });
28788
+ /**
28789
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28790
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28791
+ * is a second knob that disagrees with the first the day one of them moves.
28792
+ */
28793
+ var DiagnosticWindowPatchSchema = object({
28794
+ id: DiagnosticIdSchema,
28795
+ armMs: number().int().min(0),
28796
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28797
+ reportEveryMs: number().int().positive().optional()
28798
+ });
28799
+ /**
28800
+ * A PATCH, and patches MERGE.
28801
+ *
28802
+ * A field absent from the patch is left exactly as it was — arming a
28803
+ * diagnostic never resets a level, and setting a level never disarms a window.
28804
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28805
+ * `setAll` already merges, and rebuilding the object is how an absent field
28806
+ * turns into an erased one.
28807
+ */
28808
+ var LoggingSettingsPatchSchema = object({
28809
+ /**
28810
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28811
+ * addressed scope so it inherits again. A value sets it.
28812
+ */
28813
+ level: LogLevelSchema$1.nullable().optional(),
28814
+ /**
28815
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28816
+ * keeps running — a patch is never a full replacement.
28817
+ */
28818
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28819
+ });
28820
+ /**
28821
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28822
+ *
28823
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28824
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28825
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28826
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28827
+ * by an agent that holds no cluster document at all. The hub is the single
28828
+ * authority over the whole hierarchy and answers for every layer, so the
28829
+ * layer selector needs a name the transport does not already own.
28830
+ */
28831
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28832
+ var SetLoggingSettingsInputSchema = object({
28833
+ scopeNodeId: string().optional(),
28834
+ patch: LoggingSettingsPatchSchema
28835
+ });
28836
+ /**
28837
+ * The whole document, as read and as returned after every write.
28838
+ *
28839
+ * `persisted: false` means the settings store could not be read or written.
28840
+ * The in-memory mirror still governs behaviour and is unchanged by the
28841
+ * failure — a read that fails neither switches a level nor disarms a window
28842
+ * (D49) — but the operator is told that what they are looking at would not
28843
+ * survive a restart.
28844
+ */
28845
+ var LoggingSettingsStateSchema = object({
28846
+ /** The layer this document was read at. `null` = the cluster layer. */
28847
+ scopeNodeId: string().nullable(),
28848
+ effective: LoggingEffectiveSchema,
28849
+ explicit: LoggingExplicitSchema,
28850
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28851
+ persisted: boolean()
28852
+ });
28393
28853
  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(), {
28394
28854
  kind: "mutation",
28395
28855
  auth: "admin"
@@ -28402,6 +28862,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28402
28862
  }), method(_void(), SiteLocationStatusSchema, {
28403
28863
  kind: "mutation",
28404
28864
  auth: "admin"
28865
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28866
+ kind: "mutation",
28867
+ auth: "admin"
28405
28868
  });
28406
28869
  /**
28407
28870
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35641,6 +36104,18 @@ Object.freeze({
35641
36104
  addonId: null,
35642
36105
  access: "create"
35643
36106
  },
36107
+ "system.getLoggingSettings": {
36108
+ capName: "system",
36109
+ capScope: "system",
36110
+ addonId: null,
36111
+ access: "view"
36112
+ },
36113
+ "system.getRequestCensus": {
36114
+ capName: "system",
36115
+ capScope: "system",
36116
+ addonId: null,
36117
+ access: "view"
36118
+ },
35644
36119
  "system.getRetentionConfig": {
35645
36120
  capName: "system",
35646
36121
  capScope: "system",
@@ -35671,6 +36146,12 @@ Object.freeze({
35671
36146
  addonId: null,
35672
36147
  access: "view"
35673
36148
  },
36149
+ "system.setLoggingSettings": {
36150
+ capName: "system",
36151
+ capScope: "system",
36152
+ addonId: null,
36153
+ access: "create"
36154
+ },
35674
36155
  "system.setRetentionConfig": {
35675
36156
  capName: "system",
35676
36157
  capScope: "system",
@@ -36826,6 +37307,10 @@ Object.freeze({
36826
37307
  name: "deviceId",
36827
37308
  form: "single",
36828
37309
  optional: true
37310
+ }, {
37311
+ name: "deviceIds",
37312
+ form: "array",
37313
+ optional: true
36829
37314
  }],
36830
37315
  "fanControl.setDirection": [{
36831
37316
  name: "deviceId",
@@ -38436,7 +38921,38 @@ object({
38436
38921
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38437
38922
  * reproduce that.
38438
38923
  */
38439
- tileBudgetMb: number().int().min(0).max(1024)
38924
+ tileBudgetMb: number().int().min(0).max(1024),
38925
+ /**
38926
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38927
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38928
+ * subject tiles, on frames that detected something.
38929
+ *
38930
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38931
+ * containment is strict by design, so the native `keyFrame`, the detail
38932
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38933
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38934
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38935
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38936
+ *
38937
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38938
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38939
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38940
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38941
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38942
+ * binds only through a detection burst, where it still covers well past the
38943
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38944
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38945
+ * whole shape exists to avoid.
38946
+ *
38947
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38948
+ * subject tile, so one shared budget would let a busy camera's key frames
38949
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38950
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38951
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38952
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38953
+ * nothing.
38954
+ */
38955
+ sceneBudgetMb: number().int().min(0).max(1024)
38440
38956
  });
38441
38957
  /**
38442
38958
  * The values in force when the operator has set nothing.
@@ -38452,12 +38968,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38452
38968
  budgetMb: 1024,
38453
38969
  activityMs: 15e3,
38454
38970
  tileBudgetMb: 64,
38971
+ sceneBudgetMb: 48,
38455
38972
  admission: "inferred"
38456
38973
  };
38457
38974
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38458
38975
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38459
38976
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38460
38977
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38978
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38461
38979
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38462
38980
  var MB = 1024 * 1024;
38463
38981
  1024 * MB, 3072 * MB;