@camstack/addon-provider-rtsp 1.2.31 → 1.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +577 -59
  2. package/dist/addon.mjs +577 -59
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7582,6 +7582,66 @@ var OpsLogQueryInputSchema = object({
7582
7582
  /** Max rows returned, newest-first. */
7583
7583
  limit: number().int().min(1).max(1e3).optional()
7584
7584
  });
7585
+ var LabelDefinitionSchema = object({
7586
+ id: string(),
7587
+ name: string(),
7588
+ category: string().optional(),
7589
+ description: string().optional(),
7590
+ icon: string().optional()
7591
+ });
7592
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7593
+ var CLASS_MAP_MACRO_TARGETS = [
7594
+ "person",
7595
+ "vehicle",
7596
+ "animal",
7597
+ "package"
7598
+ ];
7599
+ /**
7600
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7601
+ * un operatore può selezionare.
7602
+ *
7603
+ * Sono le tre offerte dallo step `object-detection`
7604
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7605
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7606
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7607
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7608
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7609
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7610
+ *
7611
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7612
+ * dello step e una seconda volta come union `FirstLevelMacro`
7613
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7614
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7615
+ * successiva.
7616
+ */
7617
+ var FIRST_LEVEL_MACRO_CLASSES = [
7618
+ "person",
7619
+ "vehicle",
7620
+ "animal"
7621
+ ];
7622
+ /**
7623
+ * Wire schema for a per-model CATALOG classMap override
7624
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7625
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7626
+ * detection pipeline executor actually routes.
7627
+ *
7628
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7629
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7630
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7631
+ * enum) — the two used to share the name `ClassMapDefinition`/
7632
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7633
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7634
+ * are not: it is two different concepts colliding on a name. Keep this type
7635
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7636
+ * would either narrow every `ClassMapDefinition` consumer to the four
7637
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7638
+ * schema exists for (see the "rejects a classMap whose target is not a
7639
+ * detection macro" test in `model-catalog-schema.test.ts`).
7640
+ */
7641
+ var DetectionCatalogClassMapSchema = object({
7642
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7643
+ preserveOriginal: boolean()
7644
+ });
7585
7645
  /**
7586
7646
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7587
7647
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7604,10 +7664,55 @@ var RecordingStorageModeSchema = _enum([
7604
7664
  "events",
7605
7665
  "continuous"
7606
7666
  ]);
7667
+ /**
7668
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7669
+ * tre offerte dallo step `object-detection`, da UNA lista
7670
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7671
+ */
7672
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7673
+ /**
7674
+ * True quando `values` non ripete un elemento.
7675
+ *
7676
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7677
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7678
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7679
+ */
7680
+ var noDuplicates = (values) => new Set(values).size === values.length;
7607
7681
  /** Which detectors trigger an `events`-mode band. */
7608
7682
  var RecordingTriggersSchema = object({
7609
7683
  motion: boolean().optional(),
7610
- audioThresholdDbfs: number().optional()
7684
+ audioThresholdDbfs: number().optional(),
7685
+ /**
7686
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7687
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7688
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7689
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7690
+ *
7691
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7692
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7693
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7694
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7695
+ * finestre — vedi `recorder/object-trigger.ts`.
7696
+ */
7697
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7698
+ /**
7699
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7700
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7701
+ * `objectClasses`.
7702
+ *
7703
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7704
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7705
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7706
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7707
+ * device (D12) — mai un elenco globale di cap.
7708
+ *
7709
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7710
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7711
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7712
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7713
+ * registrare.
7714
+ */
7715
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7611
7716
  });
7612
7717
  /**
7613
7718
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8059,41 +8164,6 @@ var DecoderSessionConfigSchema = object({
8059
8164
  */
8060
8165
  debug: boolean().optional()
8061
8166
  });
8062
- var LabelDefinitionSchema = object({
8063
- id: string(),
8064
- name: string(),
8065
- category: string().optional(),
8066
- description: string().optional(),
8067
- icon: string().optional()
8068
- });
8069
- /**
8070
- * Wire schema for a per-model CATALOG classMap override
8071
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8072
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8073
- * detection pipeline executor actually routes.
8074
- *
8075
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8076
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8077
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8078
- * enum) — the two used to share the name `ClassMapDefinition`/
8079
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8080
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8081
- * are not: it is two different concepts colliding on a name. Keep this type
8082
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8083
- * would either narrow every `ClassMapDefinition` consumer to the four
8084
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8085
- * schema exists for (see the "rejects a classMap whose target is not a
8086
- * detection macro" test in `model-catalog-schema.test.ts`).
8087
- */
8088
- var DetectionCatalogClassMapSchema = object({
8089
- mapping: record(string(), _enum([
8090
- "person",
8091
- "vehicle",
8092
- "animal",
8093
- "package"
8094
- ])),
8095
- preserveOriginal: boolean()
8096
- });
8097
8167
  var MODEL_FORMATS = [
8098
8168
  "onnx",
8099
8169
  "coreml",
@@ -21313,7 +21383,7 @@ var lifecycleJobSchema = object({
21313
21383
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21314
21384
  * as every other cap.
21315
21385
  */
21316
- var LogLevelSchema$1 = _enum([
21386
+ var LogLevelSchema$2 = _enum([
21317
21387
  "debug",
21318
21388
  "info",
21319
21389
  "warn",
@@ -21520,7 +21590,7 @@ var CustomActionInputSchema = object({
21520
21590
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21521
21591
  addonId: string(),
21522
21592
  limit: number().min(1).max(500).default(100),
21523
- level: LogLevelSchema$1.optional()
21593
+ level: LogLevelSchema$2.optional()
21524
21594
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21525
21595
  packageName: string(),
21526
21596
  version: string().optional()
@@ -21618,7 +21688,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21618
21688
  auth: "admin"
21619
21689
  }), method(object({
21620
21690
  addonId: string(),
21621
- level: LogLevelSchema$1.optional()
21691
+ level: LogLevelSchema$2.optional()
21622
21692
  }), LogStreamEntrySchema, { kind: "subscription" });
21623
21693
  /**
21624
21694
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23350,6 +23420,35 @@ var FaceFilterEnum = _enum([
23350
23420
  "identified",
23351
23421
  "all"
23352
23422
  ]);
23423
+ /**
23424
+ * What a `listRecentFaces` page is ORDERED BY.
23425
+ *
23426
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23427
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23428
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23429
+ * order: it puts the suggestions an operator can confirm with one tap at the
23430
+ * top, and it is the reason this enum exists — a client that ranked a capped
23431
+ * page client-side was ranking the newest N, never the most certain N.
23432
+ *
23433
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23434
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23435
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23436
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23437
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23438
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23439
+ * then by faceId, and is what makes this a total order instead of the
23440
+ * backend's NULL-collation accident.
23441
+ */
23442
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23443
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23444
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23445
+ * never leaves the server. */
23446
+ var FaceClusterSchema = object({
23447
+ faceIds: array(string()).readonly(),
23448
+ representativeFaceId: string(),
23449
+ size: number().int(),
23450
+ cohesion: number()
23451
+ });
23353
23452
  var MediaFileLiteSchema$1 = object({
23354
23453
  key: string(),
23355
23454
  kind: string(),
@@ -23396,24 +23495,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23396
23495
  kind: "mutation",
23397
23496
  auth: "admin"
23398
23497
  }), method(object({
23399
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23498
+ /**
23499
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23500
+ *
23501
+ * The legacy single-camera form, kept verbatim for every caller that
23502
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23503
+ * instead — never both: `deviceIds` is the authority whenever it is
23504
+ * present, and this field is then ignored rather than unioned, so
23505
+ * there is exactly one answer to "which cameras did I ask for".
23506
+ */
23400
23507
  deviceId: number().int().optional(),
23508
+ /**
23509
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23510
+ * until now had to fetch the cluster-wide page and drop rows in the
23511
+ * client (so the `limit` it asked for was spent on cameras it was
23512
+ * about to discard).
23513
+ *
23514
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23515
+ * "every camera". A request for no devices is a request, not an
23516
+ * omission; same contract as `deviceManager.listFleet` and
23517
+ * `pipelineAnalytics.listRecentTracks`.
23518
+ *
23519
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23520
+ */
23521
+ deviceIds: array(number().int()).optional(),
23401
23522
  limit: number().int().positive().optional(),
23402
23523
  filter: FaceFilterEnum.optional(),
23403
23524
  /**
23404
- * Inline the base64 crop on every row. Default `true` — the existing
23405
- * behaviour, kept so no caller breaks.
23525
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23526
+ * Absent means no lower bound.
23527
+ */
23528
+ since: number().int().optional(),
23529
+ /**
23530
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23531
+ * Absent means no upper bound.
23532
+ */
23533
+ until: number().int().optional(),
23534
+ /**
23535
+ * Order the page by time or by suggestion certainty. Default
23536
+ * `'timestamp'` — the historical order, unchanged for every caller
23537
+ * that does not ask.
23406
23538
  *
23407
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23408
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23409
- * the browser cache the images.
23539
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23540
+ * does under `'suggestionConfidence'`.
23410
23541
  *
23411
- * **This is an INPUT field, so it does not reach the addon until the
23412
- * next train.** The hub router validates cap inputs against its own
23413
- * compiled Zod, which strips a key it does not know verified today
23414
- * on the OUTPUT side, where an additive field DOES arrive immediately
23415
- * (`Track.hasFace`). Until the train ships, sending `false` is
23416
- * harmless and simply keeps the crops inline.
23542
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23543
+ * index and stops reading as soon as `limit` rows have PASSED the
23544
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23545
+ * certain row may be the oldest so it walks the window. Narrow it
23546
+ * with {@link since} / {@link until}.
23547
+ */
23548
+ sortBy: FaceSortFieldEnum.optional(),
23549
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23550
+ sortDirection: FaceSortDirectionEnum.optional(),
23551
+ /**
23552
+ * Inline the base64 crop on every row.
23553
+ *
23554
+ * Default `false` since the 2026-08-25 inversion — see
23555
+ * `include-crops-default.ts`, which is the ONE place that resolves
23556
+ * this for every gallery, and which records why the inline shape had
23557
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23558
+ * The doc here used to still say `true`; it was wrong, and a leftover
23559
+ * that describes the old design reads as permission to rely on it.
23560
+ *
23561
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23562
+ * which the browser fetches off the `event-media` plane in parallel,
23563
+ * cached and ETagged.
23417
23564
  */
23418
23565
  includeCrops: boolean().optional()
23419
23566
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23449,13 +23596,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23449
23596
  }), method(object({
23450
23597
  threshold: number().min(0).max(1).optional(),
23451
23598
  minClusterSize: number().int().min(2).optional(),
23452
- limit: number().int().positive().optional()
23453
- }).optional(), array(object({
23454
- faceIds: array(string()).readonly(),
23455
- representativeFaceId: string(),
23456
- size: number().int(),
23457
- cohesion: number()
23458
- })).readonly());
23599
+ /**
23600
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23601
+ * which read as though it bounded the work — it never did.
23602
+ *
23603
+ * Wins over {@link limit} when both are sent.
23604
+ */
23605
+ maxClusters: number().int().positive().optional(),
23606
+ /**
23607
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23608
+ * RESULT, not the scan. Kept so existing callers keep working; send
23609
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23610
+ */
23611
+ limit: number().int().positive().optional(),
23612
+ /**
23613
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23614
+ * POOL, not the result.
23615
+ *
23616
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23617
+ * used to read every unassigned face on the hub no matter what the
23618
+ * caller asked for, because the only bound cut the finished clusters
23619
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23620
+ * whole corpus, on an addon whose disk is under contention.
23621
+ *
23622
+ * The pool is the NEWEST matching faces first — the same order the
23623
+ * gallery shows — so a bound here shortens the horizon, it does not
23624
+ * sample it randomly.
23625
+ *
23626
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23627
+ * so the live corpus — 372 face rows — is unaffected while the
23628
+ * unbounded scan can never come back as the table grows.
23629
+ */
23630
+ maxFacesScanned: number().int().positive().optional()
23631
+ }).optional(), array(FaceClusterSchema).readonly());
23459
23632
  /**
23460
23633
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23461
23634
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28397,6 +28570,293 @@ var SetSiteLocationInputSchema = object({
28397
28570
  latitude: number().min(-90).max(90),
28398
28571
  longitude: number().min(-180).max(180)
28399
28572
  }).nullable();
28573
+ /**
28574
+ * The TRANSPORT a call arrived on.
28575
+ *
28576
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
28577
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
28578
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
28579
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
28580
+ * checkable rather than asserted.
28581
+ *
28582
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
28583
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
28584
+ * connection; the viewer talks to the hub over `wsLink`
28585
+ * exclusively, so this is the plane the HTTP census could not see.
28586
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
28587
+ * never touches a socket and therefore never touched a census.
28588
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
28589
+ * that is exactly what its `0` asserts: every plane the hub has can name
28590
+ * itself. It is an output bucket, never a knob — a call that arrives on a
28591
+ * plane nobody instrumented lands here instead of vanishing from the total.
28592
+ */
28593
+ var TransportPlaneSchema = _enum([
28594
+ "http",
28595
+ "ws",
28596
+ "mesh",
28597
+ "unknown"
28598
+ ]);
28599
+ /**
28600
+ * Calls per plane. Every key is always present, `0` included — an absent plane
28601
+ * reads as "not instrumented", which is the one thing this census must never
28602
+ * make an operator wonder about.
28603
+ */
28604
+ var TransportPlaneCountsSchema = object({
28605
+ http: number(),
28606
+ ws: number(),
28607
+ mesh: number(),
28608
+ unknown: number()
28609
+ });
28610
+ /**
28611
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
28612
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28613
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28614
+ * already prints - never a token, never an `Authorization` header.
28615
+ *
28616
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
28617
+ * and lives for hours, so folding it into a call count makes one long-lived
28618
+ * stream look like a storm.
28619
+ */
28620
+ var RequestCensusGroupSchema = object({
28621
+ plane: TransportPlaneSchema,
28622
+ procedure: string(),
28623
+ userAgent: string(),
28624
+ ip: string(),
28625
+ principal: string(),
28626
+ calls: number(),
28627
+ subscriptions: number(),
28628
+ perMin: number()
28629
+ });
28630
+ /**
28631
+ * A procedure's TOTAL over the window, across every caller.
28632
+ *
28633
+ * This block, not the group list, is what answers "did these calls arrive over
28634
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28635
+ * same window excludes the HTTP plane, which is a result, not a failure.
28636
+ */
28637
+ var RequestCensusProcedureSchema = object({
28638
+ procedure: string(),
28639
+ calls: number(),
28640
+ /**
28641
+ * The same total, split by transport. THIS is the row that answers the
28642
+ * question the census exists for: one look at `deviceManager.listAll` says
28643
+ * which plane carried the 4 960, without joining two log lines by eye.
28644
+ */
28645
+ planes: TransportPlaneCountsSchema,
28646
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
28647
+ subscriptions: number(),
28648
+ perMin: number()
28649
+ });
28650
+ /**
28651
+ * The census as an operator sees it.
28652
+ *
28653
+ * `persisted` is the honest answer to "will this survive the restart I am
28654
+ * about to do": the arm deadline is written to `system-settings` so a window
28655
+ * armed now can measure the NEXT boot, and a write that failed must not look
28656
+ * like one that succeeded.
28657
+ */
28658
+ var RequestCensusStatusSchema = object({
28659
+ armed: boolean(),
28660
+ /** How long the current - or just-closed - window collected, in ms. */
28661
+ elapsedMs: number(),
28662
+ /** The window actually armed, after the server clamped the request. */
28663
+ windowMs: number(),
28664
+ /** Epoch ms the window closes at. 0 when disarmed. */
28665
+ armedUntilMs: number(),
28666
+ httpRequests: number(),
28667
+ batchedRequests: number(),
28668
+ /**
28669
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28670
+ * is in play (`?batch=1` carries several procedures in one request); this is
28671
+ * the number comparable with a store-side call count.
28672
+ */
28673
+ procedureCalls: number(),
28674
+ /**
28675
+ * `procedureCalls` split by transport. The four keys sum to
28676
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
28677
+ * `planesExplainTotal` is that identity, checked rather than assumed.
28678
+ */
28679
+ planes: TransportPlaneCountsSchema,
28680
+ /**
28681
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
28682
+ * on no plane at all - which is a RESULT (a plane is missing from the
28683
+ * instrument), not a failure, and it has to be visible to be read as one.
28684
+ */
28685
+ planesExplainTotal: boolean(),
28686
+ /**
28687
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28688
+ * adapter resolves one context per connection - kept because a plane's call
28689
+ * count of zero against 37 open connections says something different from a
28690
+ * plane with no connections at all.
28691
+ */
28692
+ wsConnections: number(),
28693
+ /**
28694
+ * Client frames the WS plane looked at. `wsMessages` far above
28695
+ * `planes.ws + subscriptions` means most traffic is not operations
28696
+ * (keepalives, connection params) - which is itself an answer.
28697
+ */
28698
+ wsMessages: number(),
28699
+ /**
28700
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
28701
+ * purpose: one live-events stream opened at boot and held for six hours is
28702
+ * one subscription, and counting it as a call would let a quiet plane
28703
+ * masquerade as the storm.
28704
+ */
28705
+ subscriptions: number(),
28706
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
28707
+ subscriptionStops: number(),
28708
+ distinctGroups: number(),
28709
+ /**
28710
+ * Operations counted in the totals whose CALLER attribution was shed at the
28711
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
28712
+ * which transport they arrived on, they just lost their group row.
28713
+ */
28714
+ unattributedCalls: number(),
28715
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28716
+ groups: array(RequestCensusGroupSchema).readonly()
28717
+ }).extend({ persisted: boolean() });
28718
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28719
+ var LogLevelSchema$1 = _enum([
28720
+ "debug",
28721
+ "info",
28722
+ "warn",
28723
+ "error"
28724
+ ]);
28725
+ /**
28726
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28727
+ *
28728
+ * A diagnostic is anything whose cost is only worth paying while a question is
28729
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28730
+ */
28731
+ var DiagnosticIdSchema = _enum(["request-census"]);
28732
+ /**
28733
+ * The layers of the level hierarchy, general → specific. The most specific
28734
+ * layer that carries an explicit value wins.
28735
+ *
28736
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28737
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28738
+ * grow later would force every consumer of this document to change with it.
28739
+ * Nothing returns `component` today.
28740
+ */
28741
+ var LoggingScopeKindSchema = _enum([
28742
+ "cluster",
28743
+ "node",
28744
+ "component"
28745
+ ]);
28746
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28747
+ var LoggingLevelSourceSchema = _enum([
28748
+ "default",
28749
+ "cluster",
28750
+ "node",
28751
+ "component"
28752
+ ]);
28753
+ /**
28754
+ * One layer of the hierarchy as it actually STANDS.
28755
+ *
28756
+ * `level: null` is the whole reason this array is returned: it is the
28757
+ * difference between "this node is at `info` because I decided it" and
28758
+ * "...because it inherits". An operator who clears an override believing they
28759
+ * are clearing an inherited value has been handed the same defect as the two
28760
+ * contradicting knobs this document exists to remove, moved one floor up.
28761
+ */
28762
+ var LoggingLevelLayerSchema = object({
28763
+ scope: LoggingScopeKindSchema,
28764
+ /** The node this layer speaks for; `null` on the cluster layer. */
28765
+ nodeId: string().nullable(),
28766
+ /** Explicitly set here, or `null` when this layer inherits. */
28767
+ level: LogLevelSchema$1.nullable()
28768
+ });
28769
+ /** What a line is judged against, and WHICH layer decided it. */
28770
+ var LoggingEffectiveSchema = object({
28771
+ level: LogLevelSchema$1,
28772
+ levelSource: LoggingLevelSourceSchema
28773
+ });
28774
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28775
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28776
+ /**
28777
+ * An armed diagnostic, with its DEADLINE.
28778
+ *
28779
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28780
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28781
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28782
+ * `armed` is false — a window is never reported as slightly expired.
28783
+ */
28784
+ var DiagnosticWindowSchema = object({
28785
+ id: DiagnosticIdSchema,
28786
+ armed: boolean(),
28787
+ /** Epoch ms the window closes at. 0 when disarmed. */
28788
+ armedUntilMs: number(),
28789
+ /** Ms left before it expires on its own. 0 when disarmed. */
28790
+ remainingMs: number(),
28791
+ /** Whether the stored deadline is the one the live diagnostic is running —
28792
+ * i.e. whether this window would survive a restart. */
28793
+ persisted: boolean()
28794
+ });
28795
+ /**
28796
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28797
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28798
+ * is a second knob that disagrees with the first the day one of them moves.
28799
+ */
28800
+ var DiagnosticWindowPatchSchema = object({
28801
+ id: DiagnosticIdSchema,
28802
+ armMs: number().int().min(0),
28803
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28804
+ reportEveryMs: number().int().positive().optional()
28805
+ });
28806
+ /**
28807
+ * A PATCH, and patches MERGE.
28808
+ *
28809
+ * A field absent from the patch is left exactly as it was — arming a
28810
+ * diagnostic never resets a level, and setting a level never disarms a window.
28811
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28812
+ * `setAll` already merges, and rebuilding the object is how an absent field
28813
+ * turns into an erased one.
28814
+ */
28815
+ var LoggingSettingsPatchSchema = object({
28816
+ /**
28817
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28818
+ * addressed scope so it inherits again. A value sets it.
28819
+ */
28820
+ level: LogLevelSchema$1.nullable().optional(),
28821
+ /**
28822
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28823
+ * keeps running — a patch is never a full replacement.
28824
+ */
28825
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28826
+ });
28827
+ /**
28828
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28829
+ *
28830
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28831
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28832
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28833
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28834
+ * by an agent that holds no cluster document at all. The hub is the single
28835
+ * authority over the whole hierarchy and answers for every layer, so the
28836
+ * layer selector needs a name the transport does not already own.
28837
+ */
28838
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28839
+ var SetLoggingSettingsInputSchema = object({
28840
+ scopeNodeId: string().optional(),
28841
+ patch: LoggingSettingsPatchSchema
28842
+ });
28843
+ /**
28844
+ * The whole document, as read and as returned after every write.
28845
+ *
28846
+ * `persisted: false` means the settings store could not be read or written.
28847
+ * The in-memory mirror still governs behaviour and is unchanged by the
28848
+ * failure — a read that fails neither switches a level nor disarms a window
28849
+ * (D49) — but the operator is told that what they are looking at would not
28850
+ * survive a restart.
28851
+ */
28852
+ var LoggingSettingsStateSchema = object({
28853
+ /** The layer this document was read at. `null` = the cluster layer. */
28854
+ scopeNodeId: string().nullable(),
28855
+ effective: LoggingEffectiveSchema,
28856
+ explicit: LoggingExplicitSchema,
28857
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28858
+ persisted: boolean()
28859
+ });
28400
28860
  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(), {
28401
28861
  kind: "mutation",
28402
28862
  auth: "admin"
@@ -28409,6 +28869,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28409
28869
  }), method(_void(), SiteLocationStatusSchema, {
28410
28870
  kind: "mutation",
28411
28871
  auth: "admin"
28872
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28873
+ kind: "mutation",
28874
+ auth: "admin"
28412
28875
  });
28413
28876
  /**
28414
28877
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35714,6 +36177,18 @@ Object.freeze({
35714
36177
  addonId: null,
35715
36178
  access: "create"
35716
36179
  },
36180
+ "system.getLoggingSettings": {
36181
+ capName: "system",
36182
+ capScope: "system",
36183
+ addonId: null,
36184
+ access: "view"
36185
+ },
36186
+ "system.getRequestCensus": {
36187
+ capName: "system",
36188
+ capScope: "system",
36189
+ addonId: null,
36190
+ access: "view"
36191
+ },
35717
36192
  "system.getRetentionConfig": {
35718
36193
  capName: "system",
35719
36194
  capScope: "system",
@@ -35744,6 +36219,12 @@ Object.freeze({
35744
36219
  addonId: null,
35745
36220
  access: "view"
35746
36221
  },
36222
+ "system.setLoggingSettings": {
36223
+ capName: "system",
36224
+ capScope: "system",
36225
+ addonId: null,
36226
+ access: "create"
36227
+ },
35747
36228
  "system.setRetentionConfig": {
35748
36229
  capName: "system",
35749
36230
  capScope: "system",
@@ -36899,6 +37380,10 @@ Object.freeze({
36899
37380
  name: "deviceId",
36900
37381
  form: "single",
36901
37382
  optional: true
37383
+ }, {
37384
+ name: "deviceIds",
37385
+ form: "array",
37386
+ optional: true
36902
37387
  }],
36903
37388
  "fanControl.setDirection": [{
36904
37389
  name: "deviceId",
@@ -38509,7 +38994,38 @@ object({
38509
38994
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38510
38995
  * reproduce that.
38511
38996
  */
38512
- tileBudgetMb: number().int().min(0).max(1024)
38997
+ tileBudgetMb: number().int().min(0).max(1024),
38998
+ /**
38999
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39000
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39001
+ * subject tiles, on frames that detected something.
39002
+ *
39003
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39004
+ * containment is strict by design, so the native `keyFrame`, the detail
39005
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39006
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39007
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39008
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39009
+ *
39010
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39011
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39012
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39013
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39014
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39015
+ * binds only through a detection burst, where it still covers well past the
39016
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39017
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39018
+ * whole shape exists to avoid.
39019
+ *
39020
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39021
+ * subject tile, so one shared budget would let a busy camera's key frames
39022
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39023
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39024
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39025
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39026
+ * nothing.
39027
+ */
39028
+ sceneBudgetMb: number().int().min(0).max(1024)
38513
39029
  });
38514
39030
  /**
38515
39031
  * The values in force when the operator has set nothing.
@@ -38525,12 +39041,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38525
39041
  budgetMb: 1024,
38526
39042
  activityMs: 15e3,
38527
39043
  tileBudgetMb: 64,
39044
+ sceneBudgetMb: 48,
38528
39045
  admission: "inferred"
38529
39046
  };
38530
39047
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38531
39048
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38532
39049
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38533
39050
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39051
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38534
39052
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38535
39053
  /**
38536
39054
  * Names that, when used as URL query parameters, almost certainly carry