@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.mjs 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",
@@ -21289,7 +21359,7 @@ var lifecycleJobSchema = object({
21289
21359
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21290
21360
  * as every other cap.
21291
21361
  */
21292
- var LogLevelSchema$1 = _enum([
21362
+ var LogLevelSchema$2 = _enum([
21293
21363
  "debug",
21294
21364
  "info",
21295
21365
  "warn",
@@ -21496,7 +21566,7 @@ var CustomActionInputSchema = object({
21496
21566
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21497
21567
  addonId: string(),
21498
21568
  limit: number().min(1).max(500).default(100),
21499
- level: LogLevelSchema$1.optional()
21569
+ level: LogLevelSchema$2.optional()
21500
21570
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21501
21571
  packageName: string(),
21502
21572
  version: string().optional()
@@ -21594,7 +21664,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21594
21664
  auth: "admin"
21595
21665
  }), method(object({
21596
21666
  addonId: string(),
21597
- level: LogLevelSchema$1.optional()
21667
+ level: LogLevelSchema$2.optional()
21598
21668
  }), LogStreamEntrySchema, { kind: "subscription" });
21599
21669
  /**
21600
21670
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23326,6 +23396,35 @@ var FaceFilterEnum = _enum([
23326
23396
  "identified",
23327
23397
  "all"
23328
23398
  ]);
23399
+ /**
23400
+ * What a `listRecentFaces` page is ORDERED BY.
23401
+ *
23402
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23403
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23404
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23405
+ * order: it puts the suggestions an operator can confirm with one tap at the
23406
+ * top, and it is the reason this enum exists — a client that ranked a capped
23407
+ * page client-side was ranking the newest N, never the most certain N.
23408
+ *
23409
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23410
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23411
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23412
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23413
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23414
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23415
+ * then by faceId, and is what makes this a total order instead of the
23416
+ * backend's NULL-collation accident.
23417
+ */
23418
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23419
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23420
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23421
+ * never leaves the server. */
23422
+ var FaceClusterSchema = object({
23423
+ faceIds: array(string()).readonly(),
23424
+ representativeFaceId: string(),
23425
+ size: number().int(),
23426
+ cohesion: number()
23427
+ });
23329
23428
  var MediaFileLiteSchema$1 = object({
23330
23429
  key: string(),
23331
23430
  kind: string(),
@@ -23372,24 +23471,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23372
23471
  kind: "mutation",
23373
23472
  auth: "admin"
23374
23473
  }), method(object({
23375
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23474
+ /**
23475
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23476
+ *
23477
+ * The legacy single-camera form, kept verbatim for every caller that
23478
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23479
+ * instead — never both: `deviceIds` is the authority whenever it is
23480
+ * present, and this field is then ignored rather than unioned, so
23481
+ * there is exactly one answer to "which cameras did I ask for".
23482
+ */
23376
23483
  deviceId: number().int().optional(),
23484
+ /**
23485
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23486
+ * until now had to fetch the cluster-wide page and drop rows in the
23487
+ * client (so the `limit` it asked for was spent on cameras it was
23488
+ * about to discard).
23489
+ *
23490
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23491
+ * "every camera". A request for no devices is a request, not an
23492
+ * omission; same contract as `deviceManager.listFleet` and
23493
+ * `pipelineAnalytics.listRecentTracks`.
23494
+ *
23495
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23496
+ */
23497
+ deviceIds: array(number().int()).optional(),
23377
23498
  limit: number().int().positive().optional(),
23378
23499
  filter: FaceFilterEnum.optional(),
23379
23500
  /**
23380
- * Inline the base64 crop on every row. Default `true` — the existing
23381
- * behaviour, kept so no caller breaks.
23501
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23502
+ * Absent means no lower bound.
23503
+ */
23504
+ since: number().int().optional(),
23505
+ /**
23506
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23507
+ * Absent means no upper bound.
23508
+ */
23509
+ until: number().int().optional(),
23510
+ /**
23511
+ * Order the page by time or by suggestion certainty. Default
23512
+ * `'timestamp'` — the historical order, unchanged for every caller
23513
+ * that does not ask.
23382
23514
  *
23383
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23384
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23385
- * the browser cache the images.
23515
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23516
+ * does under `'suggestionConfidence'`.
23386
23517
  *
23387
- * **This is an INPUT field, so it does not reach the addon until the
23388
- * next train.** The hub router validates cap inputs against its own
23389
- * compiled Zod, which strips a key it does not know verified today
23390
- * on the OUTPUT side, where an additive field DOES arrive immediately
23391
- * (`Track.hasFace`). Until the train ships, sending `false` is
23392
- * harmless and simply keeps the crops inline.
23518
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23519
+ * index and stops reading as soon as `limit` rows have PASSED the
23520
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23521
+ * certain row may be the oldest so it walks the window. Narrow it
23522
+ * with {@link since} / {@link until}.
23523
+ */
23524
+ sortBy: FaceSortFieldEnum.optional(),
23525
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23526
+ sortDirection: FaceSortDirectionEnum.optional(),
23527
+ /**
23528
+ * Inline the base64 crop on every row.
23529
+ *
23530
+ * Default `false` since the 2026-08-25 inversion — see
23531
+ * `include-crops-default.ts`, which is the ONE place that resolves
23532
+ * this for every gallery, and which records why the inline shape had
23533
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23534
+ * The doc here used to still say `true`; it was wrong, and a leftover
23535
+ * that describes the old design reads as permission to rely on it.
23536
+ *
23537
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23538
+ * which the browser fetches off the `event-media` plane in parallel,
23539
+ * cached and ETagged.
23393
23540
  */
23394
23541
  includeCrops: boolean().optional()
23395
23542
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23425,13 +23572,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23425
23572
  }), method(object({
23426
23573
  threshold: number().min(0).max(1).optional(),
23427
23574
  minClusterSize: number().int().min(2).optional(),
23428
- limit: number().int().positive().optional()
23429
- }).optional(), array(object({
23430
- faceIds: array(string()).readonly(),
23431
- representativeFaceId: string(),
23432
- size: number().int(),
23433
- cohesion: number()
23434
- })).readonly());
23575
+ /**
23576
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23577
+ * which read as though it bounded the work — it never did.
23578
+ *
23579
+ * Wins over {@link limit} when both are sent.
23580
+ */
23581
+ maxClusters: number().int().positive().optional(),
23582
+ /**
23583
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23584
+ * RESULT, not the scan. Kept so existing callers keep working; send
23585
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23586
+ */
23587
+ limit: number().int().positive().optional(),
23588
+ /**
23589
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23590
+ * POOL, not the result.
23591
+ *
23592
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23593
+ * used to read every unassigned face on the hub no matter what the
23594
+ * caller asked for, because the only bound cut the finished clusters
23595
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23596
+ * whole corpus, on an addon whose disk is under contention.
23597
+ *
23598
+ * The pool is the NEWEST matching faces first — the same order the
23599
+ * gallery shows — so a bound here shortens the horizon, it does not
23600
+ * sample it randomly.
23601
+ *
23602
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23603
+ * so the live corpus — 372 face rows — is unaffected while the
23604
+ * unbounded scan can never come back as the table grows.
23605
+ */
23606
+ maxFacesScanned: number().int().positive().optional()
23607
+ }).optional(), array(FaceClusterSchema).readonly());
23435
23608
  /**
23436
23609
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23437
23610
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28373,6 +28546,293 @@ var SetSiteLocationInputSchema = object({
28373
28546
  latitude: number().min(-90).max(90),
28374
28547
  longitude: number().min(-180).max(180)
28375
28548
  }).nullable();
28549
+ /**
28550
+ * The TRANSPORT a call arrived on.
28551
+ *
28552
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
28553
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
28554
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
28555
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
28556
+ * checkable rather than asserted.
28557
+ *
28558
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
28559
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
28560
+ * connection; the viewer talks to the hub over `wsLink`
28561
+ * exclusively, so this is the plane the HTTP census could not see.
28562
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
28563
+ * never touches a socket and therefore never touched a census.
28564
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
28565
+ * that is exactly what its `0` asserts: every plane the hub has can name
28566
+ * itself. It is an output bucket, never a knob — a call that arrives on a
28567
+ * plane nobody instrumented lands here instead of vanishing from the total.
28568
+ */
28569
+ var TransportPlaneSchema = _enum([
28570
+ "http",
28571
+ "ws",
28572
+ "mesh",
28573
+ "unknown"
28574
+ ]);
28575
+ /**
28576
+ * Calls per plane. Every key is always present, `0` included — an absent plane
28577
+ * reads as "not instrumented", which is the one thing this census must never
28578
+ * make an operator wonder about.
28579
+ */
28580
+ var TransportPlaneCountsSchema = object({
28581
+ http: number(),
28582
+ ws: number(),
28583
+ mesh: number(),
28584
+ unknown: number()
28585
+ });
28586
+ /**
28587
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
28588
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28589
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28590
+ * already prints - never a token, never an `Authorization` header.
28591
+ *
28592
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
28593
+ * and lives for hours, so folding it into a call count makes one long-lived
28594
+ * stream look like a storm.
28595
+ */
28596
+ var RequestCensusGroupSchema = object({
28597
+ plane: TransportPlaneSchema,
28598
+ procedure: string(),
28599
+ userAgent: string(),
28600
+ ip: string(),
28601
+ principal: string(),
28602
+ calls: number(),
28603
+ subscriptions: number(),
28604
+ perMin: number()
28605
+ });
28606
+ /**
28607
+ * A procedure's TOTAL over the window, across every caller.
28608
+ *
28609
+ * This block, not the group list, is what answers "did these calls arrive over
28610
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28611
+ * same window excludes the HTTP plane, which is a result, not a failure.
28612
+ */
28613
+ var RequestCensusProcedureSchema = object({
28614
+ procedure: string(),
28615
+ calls: number(),
28616
+ /**
28617
+ * The same total, split by transport. THIS is the row that answers the
28618
+ * question the census exists for: one look at `deviceManager.listAll` says
28619
+ * which plane carried the 4 960, without joining two log lines by eye.
28620
+ */
28621
+ planes: TransportPlaneCountsSchema,
28622
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
28623
+ subscriptions: number(),
28624
+ perMin: number()
28625
+ });
28626
+ /**
28627
+ * The census as an operator sees it.
28628
+ *
28629
+ * `persisted` is the honest answer to "will this survive the restart I am
28630
+ * about to do": the arm deadline is written to `system-settings` so a window
28631
+ * armed now can measure the NEXT boot, and a write that failed must not look
28632
+ * like one that succeeded.
28633
+ */
28634
+ var RequestCensusStatusSchema = object({
28635
+ armed: boolean(),
28636
+ /** How long the current - or just-closed - window collected, in ms. */
28637
+ elapsedMs: number(),
28638
+ /** The window actually armed, after the server clamped the request. */
28639
+ windowMs: number(),
28640
+ /** Epoch ms the window closes at. 0 when disarmed. */
28641
+ armedUntilMs: number(),
28642
+ httpRequests: number(),
28643
+ batchedRequests: number(),
28644
+ /**
28645
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28646
+ * is in play (`?batch=1` carries several procedures in one request); this is
28647
+ * the number comparable with a store-side call count.
28648
+ */
28649
+ procedureCalls: number(),
28650
+ /**
28651
+ * `procedureCalls` split by transport. The four keys sum to
28652
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
28653
+ * `planesExplainTotal` is that identity, checked rather than assumed.
28654
+ */
28655
+ planes: TransportPlaneCountsSchema,
28656
+ /**
28657
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
28658
+ * on no plane at all - which is a RESULT (a plane is missing from the
28659
+ * instrument), not a failure, and it has to be visible to be read as one.
28660
+ */
28661
+ planesExplainTotal: boolean(),
28662
+ /**
28663
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28664
+ * adapter resolves one context per connection - kept because a plane's call
28665
+ * count of zero against 37 open connections says something different from a
28666
+ * plane with no connections at all.
28667
+ */
28668
+ wsConnections: number(),
28669
+ /**
28670
+ * Client frames the WS plane looked at. `wsMessages` far above
28671
+ * `planes.ws + subscriptions` means most traffic is not operations
28672
+ * (keepalives, connection params) - which is itself an answer.
28673
+ */
28674
+ wsMessages: number(),
28675
+ /**
28676
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
28677
+ * purpose: one live-events stream opened at boot and held for six hours is
28678
+ * one subscription, and counting it as a call would let a quiet plane
28679
+ * masquerade as the storm.
28680
+ */
28681
+ subscriptions: number(),
28682
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
28683
+ subscriptionStops: number(),
28684
+ distinctGroups: number(),
28685
+ /**
28686
+ * Operations counted in the totals whose CALLER attribution was shed at the
28687
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
28688
+ * which transport they arrived on, they just lost their group row.
28689
+ */
28690
+ unattributedCalls: number(),
28691
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28692
+ groups: array(RequestCensusGroupSchema).readonly()
28693
+ }).extend({ persisted: boolean() });
28694
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28695
+ var LogLevelSchema$1 = _enum([
28696
+ "debug",
28697
+ "info",
28698
+ "warn",
28699
+ "error"
28700
+ ]);
28701
+ /**
28702
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28703
+ *
28704
+ * A diagnostic is anything whose cost is only worth paying while a question is
28705
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28706
+ */
28707
+ var DiagnosticIdSchema = _enum(["request-census"]);
28708
+ /**
28709
+ * The layers of the level hierarchy, general → specific. The most specific
28710
+ * layer that carries an explicit value wins.
28711
+ *
28712
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28713
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28714
+ * grow later would force every consumer of this document to change with it.
28715
+ * Nothing returns `component` today.
28716
+ */
28717
+ var LoggingScopeKindSchema = _enum([
28718
+ "cluster",
28719
+ "node",
28720
+ "component"
28721
+ ]);
28722
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28723
+ var LoggingLevelSourceSchema = _enum([
28724
+ "default",
28725
+ "cluster",
28726
+ "node",
28727
+ "component"
28728
+ ]);
28729
+ /**
28730
+ * One layer of the hierarchy as it actually STANDS.
28731
+ *
28732
+ * `level: null` is the whole reason this array is returned: it is the
28733
+ * difference between "this node is at `info` because I decided it" and
28734
+ * "...because it inherits". An operator who clears an override believing they
28735
+ * are clearing an inherited value has been handed the same defect as the two
28736
+ * contradicting knobs this document exists to remove, moved one floor up.
28737
+ */
28738
+ var LoggingLevelLayerSchema = object({
28739
+ scope: LoggingScopeKindSchema,
28740
+ /** The node this layer speaks for; `null` on the cluster layer. */
28741
+ nodeId: string().nullable(),
28742
+ /** Explicitly set here, or `null` when this layer inherits. */
28743
+ level: LogLevelSchema$1.nullable()
28744
+ });
28745
+ /** What a line is judged against, and WHICH layer decided it. */
28746
+ var LoggingEffectiveSchema = object({
28747
+ level: LogLevelSchema$1,
28748
+ levelSource: LoggingLevelSourceSchema
28749
+ });
28750
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28751
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28752
+ /**
28753
+ * An armed diagnostic, with its DEADLINE.
28754
+ *
28755
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28756
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28757
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28758
+ * `armed` is false — a window is never reported as slightly expired.
28759
+ */
28760
+ var DiagnosticWindowSchema = object({
28761
+ id: DiagnosticIdSchema,
28762
+ armed: boolean(),
28763
+ /** Epoch ms the window closes at. 0 when disarmed. */
28764
+ armedUntilMs: number(),
28765
+ /** Ms left before it expires on its own. 0 when disarmed. */
28766
+ remainingMs: number(),
28767
+ /** Whether the stored deadline is the one the live diagnostic is running —
28768
+ * i.e. whether this window would survive a restart. */
28769
+ persisted: boolean()
28770
+ });
28771
+ /**
28772
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28773
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28774
+ * is a second knob that disagrees with the first the day one of them moves.
28775
+ */
28776
+ var DiagnosticWindowPatchSchema = object({
28777
+ id: DiagnosticIdSchema,
28778
+ armMs: number().int().min(0),
28779
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28780
+ reportEveryMs: number().int().positive().optional()
28781
+ });
28782
+ /**
28783
+ * A PATCH, and patches MERGE.
28784
+ *
28785
+ * A field absent from the patch is left exactly as it was — arming a
28786
+ * diagnostic never resets a level, and setting a level never disarms a window.
28787
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28788
+ * `setAll` already merges, and rebuilding the object is how an absent field
28789
+ * turns into an erased one.
28790
+ */
28791
+ var LoggingSettingsPatchSchema = object({
28792
+ /**
28793
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28794
+ * addressed scope so it inherits again. A value sets it.
28795
+ */
28796
+ level: LogLevelSchema$1.nullable().optional(),
28797
+ /**
28798
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28799
+ * keeps running — a patch is never a full replacement.
28800
+ */
28801
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28802
+ });
28803
+ /**
28804
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28805
+ *
28806
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28807
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28808
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28809
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28810
+ * by an agent that holds no cluster document at all. The hub is the single
28811
+ * authority over the whole hierarchy and answers for every layer, so the
28812
+ * layer selector needs a name the transport does not already own.
28813
+ */
28814
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28815
+ var SetLoggingSettingsInputSchema = object({
28816
+ scopeNodeId: string().optional(),
28817
+ patch: LoggingSettingsPatchSchema
28818
+ });
28819
+ /**
28820
+ * The whole document, as read and as returned after every write.
28821
+ *
28822
+ * `persisted: false` means the settings store could not be read or written.
28823
+ * The in-memory mirror still governs behaviour and is unchanged by the
28824
+ * failure — a read that fails neither switches a level nor disarms a window
28825
+ * (D49) — but the operator is told that what they are looking at would not
28826
+ * survive a restart.
28827
+ */
28828
+ var LoggingSettingsStateSchema = object({
28829
+ /** The layer this document was read at. `null` = the cluster layer. */
28830
+ scopeNodeId: string().nullable(),
28831
+ effective: LoggingEffectiveSchema,
28832
+ explicit: LoggingExplicitSchema,
28833
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28834
+ persisted: boolean()
28835
+ });
28376
28836
  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(), {
28377
28837
  kind: "mutation",
28378
28838
  auth: "admin"
@@ -28385,6 +28845,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28385
28845
  }), method(_void(), SiteLocationStatusSchema, {
28386
28846
  kind: "mutation",
28387
28847
  auth: "admin"
28848
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28849
+ kind: "mutation",
28850
+ auth: "admin"
28388
28851
  });
28389
28852
  /**
28390
28853
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35690,6 +36153,18 @@ Object.freeze({
35690
36153
  addonId: null,
35691
36154
  access: "create"
35692
36155
  },
36156
+ "system.getLoggingSettings": {
36157
+ capName: "system",
36158
+ capScope: "system",
36159
+ addonId: null,
36160
+ access: "view"
36161
+ },
36162
+ "system.getRequestCensus": {
36163
+ capName: "system",
36164
+ capScope: "system",
36165
+ addonId: null,
36166
+ access: "view"
36167
+ },
35693
36168
  "system.getRetentionConfig": {
35694
36169
  capName: "system",
35695
36170
  capScope: "system",
@@ -35720,6 +36195,12 @@ Object.freeze({
35720
36195
  addonId: null,
35721
36196
  access: "view"
35722
36197
  },
36198
+ "system.setLoggingSettings": {
36199
+ capName: "system",
36200
+ capScope: "system",
36201
+ addonId: null,
36202
+ access: "create"
36203
+ },
35723
36204
  "system.setRetentionConfig": {
35724
36205
  capName: "system",
35725
36206
  capScope: "system",
@@ -36875,6 +37356,10 @@ Object.freeze({
36875
37356
  name: "deviceId",
36876
37357
  form: "single",
36877
37358
  optional: true
37359
+ }, {
37360
+ name: "deviceIds",
37361
+ form: "array",
37362
+ optional: true
36878
37363
  }],
36879
37364
  "fanControl.setDirection": [{
36880
37365
  name: "deviceId",
@@ -38485,7 +38970,38 @@ object({
38485
38970
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38486
38971
  * reproduce that.
38487
38972
  */
38488
- tileBudgetMb: number().int().min(0).max(1024)
38973
+ tileBudgetMb: number().int().min(0).max(1024),
38974
+ /**
38975
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38976
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38977
+ * subject tiles, on frames that detected something.
38978
+ *
38979
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38980
+ * containment is strict by design, so the native `keyFrame`, the detail
38981
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38982
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38983
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38984
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38985
+ *
38986
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38987
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38988
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38989
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38990
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38991
+ * binds only through a detection burst, where it still covers well past the
38992
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38993
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38994
+ * whole shape exists to avoid.
38995
+ *
38996
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38997
+ * subject tile, so one shared budget would let a busy camera's key frames
38998
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38999
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39000
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39001
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39002
+ * nothing.
39003
+ */
39004
+ sceneBudgetMb: number().int().min(0).max(1024)
38489
39005
  });
38490
39006
  /**
38491
39007
  * The values in force when the operator has set nothing.
@@ -38501,12 +39017,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38501
39017
  budgetMb: 1024,
38502
39018
  activityMs: 15e3,
38503
39019
  tileBudgetMb: 64,
39020
+ sceneBudgetMb: 48,
38504
39021
  admission: "inferred"
38505
39022
  };
38506
39023
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38507
39024
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38508
39025
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38509
39026
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39027
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38510
39028
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38511
39029
  /**
38512
39030
  * Names that, when used as URL query parameters, almost certainly carry