@camstack/addon-provider-reolink 1.2.53 → 1.2.55

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
@@ -7565,6 +7565,66 @@ var OpsLogQueryInputSchema = object({
7565
7565
  /** Max rows returned, newest-first. */
7566
7566
  limit: number().int().min(1).max(1e3).optional()
7567
7567
  });
7568
+ var LabelDefinitionSchema = object({
7569
+ id: string(),
7570
+ name: string(),
7571
+ category: string().optional(),
7572
+ description: string().optional(),
7573
+ icon: string().optional()
7574
+ });
7575
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7576
+ var CLASS_MAP_MACRO_TARGETS = [
7577
+ "person",
7578
+ "vehicle",
7579
+ "animal",
7580
+ "package"
7581
+ ];
7582
+ /**
7583
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7584
+ * un operatore può selezionare.
7585
+ *
7586
+ * Sono le tre offerte dallo step `object-detection`
7587
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7588
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7589
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7590
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7591
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7592
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7593
+ *
7594
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7595
+ * dello step e una seconda volta come union `FirstLevelMacro`
7596
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7597
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7598
+ * successiva.
7599
+ */
7600
+ var FIRST_LEVEL_MACRO_CLASSES = [
7601
+ "person",
7602
+ "vehicle",
7603
+ "animal"
7604
+ ];
7605
+ /**
7606
+ * Wire schema for a per-model CATALOG classMap override
7607
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7608
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7609
+ * detection pipeline executor actually routes.
7610
+ *
7611
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7612
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7613
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7614
+ * enum) — the two used to share the name `ClassMapDefinition`/
7615
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7616
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7617
+ * are not: it is two different concepts colliding on a name. Keep this type
7618
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7619
+ * would either narrow every `ClassMapDefinition` consumer to the four
7620
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7621
+ * schema exists for (see the "rejects a classMap whose target is not a
7622
+ * detection macro" test in `model-catalog-schema.test.ts`).
7623
+ */
7624
+ var DetectionCatalogClassMapSchema = object({
7625
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7626
+ preserveOriginal: boolean()
7627
+ });
7568
7628
  /**
7569
7629
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7570
7630
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7587,10 +7647,55 @@ var RecordingStorageModeSchema = _enum([
7587
7647
  "events",
7588
7648
  "continuous"
7589
7649
  ]);
7650
+ /**
7651
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7652
+ * tre offerte dallo step `object-detection`, da UNA lista
7653
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7654
+ */
7655
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7656
+ /**
7657
+ * True quando `values` non ripete un elemento.
7658
+ *
7659
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7660
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7661
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7662
+ */
7663
+ var noDuplicates = (values) => new Set(values).size === values.length;
7590
7664
  /** Which detectors trigger an `events`-mode band. */
7591
7665
  var RecordingTriggersSchema = object({
7592
7666
  motion: boolean().optional(),
7593
- audioThresholdDbfs: number().optional()
7667
+ audioThresholdDbfs: number().optional(),
7668
+ /**
7669
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7670
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7671
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7672
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7673
+ *
7674
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7675
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7676
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7677
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7678
+ * finestre — vedi `recorder/object-trigger.ts`.
7679
+ */
7680
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7681
+ /**
7682
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7683
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7684
+ * `objectClasses`.
7685
+ *
7686
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7687
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7688
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7689
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7690
+ * device (D12) — mai un elenco globale di cap.
7691
+ *
7692
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7693
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7694
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7695
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7696
+ * registrare.
7697
+ */
7698
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7594
7699
  });
7595
7700
  /**
7596
7701
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8217,41 +8322,6 @@ var TIMEZONES = [
8217
8322
  function findTimezone(id) {
8218
8323
  return TIMEZONES.find((tz) => tz.id === id);
8219
8324
  }
8220
- var LabelDefinitionSchema = object({
8221
- id: string(),
8222
- name: string(),
8223
- category: string().optional(),
8224
- description: string().optional(),
8225
- icon: string().optional()
8226
- });
8227
- /**
8228
- * Wire schema for a per-model CATALOG classMap override
8229
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8230
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8231
- * detection pipeline executor actually routes.
8232
- *
8233
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8234
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8235
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8236
- * enum) — the two used to share the name `ClassMapDefinition`/
8237
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8238
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8239
- * are not: it is two different concepts colliding on a name. Keep this type
8240
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8241
- * would either narrow every `ClassMapDefinition` consumer to the four
8242
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8243
- * schema exists for (see the "rejects a classMap whose target is not a
8244
- * detection macro" test in `model-catalog-schema.test.ts`).
8245
- */
8246
- var DetectionCatalogClassMapSchema = object({
8247
- mapping: record(string(), _enum([
8248
- "person",
8249
- "vehicle",
8250
- "animal",
8251
- "package"
8252
- ])),
8253
- preserveOriginal: boolean()
8254
- });
8255
8325
  var MODEL_FORMATS = [
8256
8326
  "onnx",
8257
8327
  "coreml",
@@ -21483,7 +21553,7 @@ var lifecycleJobSchema = object({
21483
21553
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21484
21554
  * as every other cap.
21485
21555
  */
21486
- var LogLevelSchema$1 = _enum([
21556
+ var LogLevelSchema$2 = _enum([
21487
21557
  "debug",
21488
21558
  "info",
21489
21559
  "warn",
@@ -21690,7 +21760,7 @@ var CustomActionInputSchema = object({
21690
21760
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21691
21761
  addonId: string(),
21692
21762
  limit: number().min(1).max(500).default(100),
21693
- level: LogLevelSchema$1.optional()
21763
+ level: LogLevelSchema$2.optional()
21694
21764
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21695
21765
  packageName: string(),
21696
21766
  version: string().optional()
@@ -21788,7 +21858,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21788
21858
  auth: "admin"
21789
21859
  }), method(object({
21790
21860
  addonId: string(),
21791
- level: LogLevelSchema$1.optional()
21861
+ level: LogLevelSchema$2.optional()
21792
21862
  }), LogStreamEntrySchema, { kind: "subscription" });
21793
21863
  /**
21794
21864
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23512,6 +23582,35 @@ var FaceFilterEnum = _enum([
23512
23582
  "identified",
23513
23583
  "all"
23514
23584
  ]);
23585
+ /**
23586
+ * What a `listRecentFaces` page is ORDERED BY.
23587
+ *
23588
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23589
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23590
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23591
+ * order: it puts the suggestions an operator can confirm with one tap at the
23592
+ * top, and it is the reason this enum exists — a client that ranked a capped
23593
+ * page client-side was ranking the newest N, never the most certain N.
23594
+ *
23595
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23596
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23597
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23598
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23599
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23600
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23601
+ * then by faceId, and is what makes this a total order instead of the
23602
+ * backend's NULL-collation accident.
23603
+ */
23604
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23605
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23606
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23607
+ * never leaves the server. */
23608
+ var FaceClusterSchema = object({
23609
+ faceIds: array(string()).readonly(),
23610
+ representativeFaceId: string(),
23611
+ size: number().int(),
23612
+ cohesion: number()
23613
+ });
23515
23614
  var MediaFileLiteSchema$1 = object({
23516
23615
  key: string(),
23517
23616
  kind: string(),
@@ -23558,24 +23657,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23558
23657
  kind: "mutation",
23559
23658
  auth: "admin"
23560
23659
  }), method(object({
23561
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23660
+ /**
23661
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23662
+ *
23663
+ * The legacy single-camera form, kept verbatim for every caller that
23664
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23665
+ * instead — never both: `deviceIds` is the authority whenever it is
23666
+ * present, and this field is then ignored rather than unioned, so
23667
+ * there is exactly one answer to "which cameras did I ask for".
23668
+ */
23562
23669
  deviceId: number().int().optional(),
23670
+ /**
23671
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23672
+ * until now had to fetch the cluster-wide page and drop rows in the
23673
+ * client (so the `limit` it asked for was spent on cameras it was
23674
+ * about to discard).
23675
+ *
23676
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23677
+ * "every camera". A request for no devices is a request, not an
23678
+ * omission; same contract as `deviceManager.listFleet` and
23679
+ * `pipelineAnalytics.listRecentTracks`.
23680
+ *
23681
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23682
+ */
23683
+ deviceIds: array(number().int()).optional(),
23563
23684
  limit: number().int().positive().optional(),
23564
23685
  filter: FaceFilterEnum.optional(),
23565
23686
  /**
23566
- * Inline the base64 crop on every row. Default `true` — the existing
23567
- * behaviour, kept so no caller breaks.
23687
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23688
+ * Absent means no lower bound.
23689
+ */
23690
+ since: number().int().optional(),
23691
+ /**
23692
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23693
+ * Absent means no upper bound.
23694
+ */
23695
+ until: number().int().optional(),
23696
+ /**
23697
+ * Order the page by time or by suggestion certainty. Default
23698
+ * `'timestamp'` — the historical order, unchanged for every caller
23699
+ * that does not ask.
23568
23700
  *
23569
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23570
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23571
- * the browser cache the images.
23701
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23702
+ * does under `'suggestionConfidence'`.
23572
23703
  *
23573
- * **This is an INPUT field, so it does not reach the addon until the
23574
- * next train.** The hub router validates cap inputs against its own
23575
- * compiled Zod, which strips a key it does not know verified today
23576
- * on the OUTPUT side, where an additive field DOES arrive immediately
23577
- * (`Track.hasFace`). Until the train ships, sending `false` is
23578
- * harmless and simply keeps the crops inline.
23704
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23705
+ * index and stops reading as soon as `limit` rows have PASSED the
23706
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23707
+ * certain row may be the oldest so it walks the window. Narrow it
23708
+ * with {@link since} / {@link until}.
23709
+ */
23710
+ sortBy: FaceSortFieldEnum.optional(),
23711
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23712
+ sortDirection: FaceSortDirectionEnum.optional(),
23713
+ /**
23714
+ * Inline the base64 crop on every row.
23715
+ *
23716
+ * Default `false` since the 2026-08-25 inversion — see
23717
+ * `include-crops-default.ts`, which is the ONE place that resolves
23718
+ * this for every gallery, and which records why the inline shape had
23719
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23720
+ * The doc here used to still say `true`; it was wrong, and a leftover
23721
+ * that describes the old design reads as permission to rely on it.
23722
+ *
23723
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23724
+ * which the browser fetches off the `event-media` plane in parallel,
23725
+ * cached and ETagged.
23579
23726
  */
23580
23727
  includeCrops: boolean().optional()
23581
23728
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23611,13 +23758,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23611
23758
  }), method(object({
23612
23759
  threshold: number().min(0).max(1).optional(),
23613
23760
  minClusterSize: number().int().min(2).optional(),
23614
- limit: number().int().positive().optional()
23615
- }).optional(), array(object({
23616
- faceIds: array(string()).readonly(),
23617
- representativeFaceId: string(),
23618
- size: number().int(),
23619
- cohesion: number()
23620
- })).readonly());
23761
+ /**
23762
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23763
+ * which read as though it bounded the work — it never did.
23764
+ *
23765
+ * Wins over {@link limit} when both are sent.
23766
+ */
23767
+ maxClusters: number().int().positive().optional(),
23768
+ /**
23769
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23770
+ * RESULT, not the scan. Kept so existing callers keep working; send
23771
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23772
+ */
23773
+ limit: number().int().positive().optional(),
23774
+ /**
23775
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23776
+ * POOL, not the result.
23777
+ *
23778
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23779
+ * used to read every unassigned face on the hub no matter what the
23780
+ * caller asked for, because the only bound cut the finished clusters
23781
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23782
+ * whole corpus, on an addon whose disk is under contention.
23783
+ *
23784
+ * The pool is the NEWEST matching faces first — the same order the
23785
+ * gallery shows — so a bound here shortens the horizon, it does not
23786
+ * sample it randomly.
23787
+ *
23788
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23789
+ * so the live corpus — 372 face rows — is unaffected while the
23790
+ * unbounded scan can never come back as the table grows.
23791
+ */
23792
+ maxFacesScanned: number().int().positive().optional()
23793
+ }).optional(), array(FaceClusterSchema).readonly());
23621
23794
  /**
23622
23795
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23623
23796
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28844,6 +29017,293 @@ var SetSiteLocationInputSchema = object({
28844
29017
  latitude: number().min(-90).max(90),
28845
29018
  longitude: number().min(-180).max(180)
28846
29019
  }).nullable();
29020
+ /**
29021
+ * The TRANSPORT a call arrived on.
29022
+ *
29023
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
29024
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
29025
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
29026
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
29027
+ * checkable rather than asserted.
29028
+ *
29029
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
29030
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
29031
+ * connection; the viewer talks to the hub over `wsLink`
29032
+ * exclusively, so this is the plane the HTTP census could not see.
29033
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
29034
+ * never touches a socket and therefore never touched a census.
29035
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
29036
+ * that is exactly what its `0` asserts: every plane the hub has can name
29037
+ * itself. It is an output bucket, never a knob — a call that arrives on a
29038
+ * plane nobody instrumented lands here instead of vanishing from the total.
29039
+ */
29040
+ var TransportPlaneSchema = _enum([
29041
+ "http",
29042
+ "ws",
29043
+ "mesh",
29044
+ "unknown"
29045
+ ]);
29046
+ /**
29047
+ * Calls per plane. Every key is always present, `0` included — an absent plane
29048
+ * reads as "not instrumented", which is the one thing this census must never
29049
+ * make an operator wonder about.
29050
+ */
29051
+ var TransportPlaneCountsSchema = object({
29052
+ http: number(),
29053
+ ws: number(),
29054
+ mesh: number(),
29055
+ unknown: number()
29056
+ });
29057
+ /**
29058
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
29059
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29060
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29061
+ * already prints - never a token, never an `Authorization` header.
29062
+ *
29063
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
29064
+ * and lives for hours, so folding it into a call count makes one long-lived
29065
+ * stream look like a storm.
29066
+ */
29067
+ var RequestCensusGroupSchema = object({
29068
+ plane: TransportPlaneSchema,
29069
+ procedure: string(),
29070
+ userAgent: string(),
29071
+ ip: string(),
29072
+ principal: string(),
29073
+ calls: number(),
29074
+ subscriptions: number(),
29075
+ perMin: number()
29076
+ });
29077
+ /**
29078
+ * A procedure's TOTAL over the window, across every caller.
29079
+ *
29080
+ * This block, not the group list, is what answers "did these calls arrive over
29081
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29082
+ * same window excludes the HTTP plane, which is a result, not a failure.
29083
+ */
29084
+ var RequestCensusProcedureSchema = object({
29085
+ procedure: string(),
29086
+ calls: number(),
29087
+ /**
29088
+ * The same total, split by transport. THIS is the row that answers the
29089
+ * question the census exists for: one look at `deviceManager.listAll` says
29090
+ * which plane carried the 4 960, without joining two log lines by eye.
29091
+ */
29092
+ planes: TransportPlaneCountsSchema,
29093
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
29094
+ subscriptions: number(),
29095
+ perMin: number()
29096
+ });
29097
+ /**
29098
+ * The census as an operator sees it.
29099
+ *
29100
+ * `persisted` is the honest answer to "will this survive the restart I am
29101
+ * about to do": the arm deadline is written to `system-settings` so a window
29102
+ * armed now can measure the NEXT boot, and a write that failed must not look
29103
+ * like one that succeeded.
29104
+ */
29105
+ var RequestCensusStatusSchema = object({
29106
+ armed: boolean(),
29107
+ /** How long the current - or just-closed - window collected, in ms. */
29108
+ elapsedMs: number(),
29109
+ /** The window actually armed, after the server clamped the request. */
29110
+ windowMs: number(),
29111
+ /** Epoch ms the window closes at. 0 when disarmed. */
29112
+ armedUntilMs: number(),
29113
+ httpRequests: number(),
29114
+ batchedRequests: number(),
29115
+ /**
29116
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29117
+ * is in play (`?batch=1` carries several procedures in one request); this is
29118
+ * the number comparable with a store-side call count.
29119
+ */
29120
+ procedureCalls: number(),
29121
+ /**
29122
+ * `procedureCalls` split by transport. The four keys sum to
29123
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
29124
+ * `planesExplainTotal` is that identity, checked rather than assumed.
29125
+ */
29126
+ planes: TransportPlaneCountsSchema,
29127
+ /**
29128
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
29129
+ * on no plane at all - which is a RESULT (a plane is missing from the
29130
+ * instrument), not a failure, and it has to be visible to be read as one.
29131
+ */
29132
+ planesExplainTotal: boolean(),
29133
+ /**
29134
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29135
+ * adapter resolves one context per connection - kept because a plane's call
29136
+ * count of zero against 37 open connections says something different from a
29137
+ * plane with no connections at all.
29138
+ */
29139
+ wsConnections: number(),
29140
+ /**
29141
+ * Client frames the WS plane looked at. `wsMessages` far above
29142
+ * `planes.ws + subscriptions` means most traffic is not operations
29143
+ * (keepalives, connection params) - which is itself an answer.
29144
+ */
29145
+ wsMessages: number(),
29146
+ /**
29147
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
29148
+ * purpose: one live-events stream opened at boot and held for six hours is
29149
+ * one subscription, and counting it as a call would let a quiet plane
29150
+ * masquerade as the storm.
29151
+ */
29152
+ subscriptions: number(),
29153
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
29154
+ subscriptionStops: number(),
29155
+ distinctGroups: number(),
29156
+ /**
29157
+ * Operations counted in the totals whose CALLER attribution was shed at the
29158
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
29159
+ * which transport they arrived on, they just lost their group row.
29160
+ */
29161
+ unattributedCalls: number(),
29162
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29163
+ groups: array(RequestCensusGroupSchema).readonly()
29164
+ }).extend({ persisted: boolean() });
29165
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29166
+ var LogLevelSchema$1 = _enum([
29167
+ "debug",
29168
+ "info",
29169
+ "warn",
29170
+ "error"
29171
+ ]);
29172
+ /**
29173
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29174
+ *
29175
+ * A diagnostic is anything whose cost is only worth paying while a question is
29176
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29177
+ */
29178
+ var DiagnosticIdSchema = _enum(["request-census"]);
29179
+ /**
29180
+ * The layers of the level hierarchy, general → specific. The most specific
29181
+ * layer that carries an explicit value wins.
29182
+ *
29183
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29184
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29185
+ * grow later would force every consumer of this document to change with it.
29186
+ * Nothing returns `component` today.
29187
+ */
29188
+ var LoggingScopeKindSchema = _enum([
29189
+ "cluster",
29190
+ "node",
29191
+ "component"
29192
+ ]);
29193
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29194
+ var LoggingLevelSourceSchema = _enum([
29195
+ "default",
29196
+ "cluster",
29197
+ "node",
29198
+ "component"
29199
+ ]);
29200
+ /**
29201
+ * One layer of the hierarchy as it actually STANDS.
29202
+ *
29203
+ * `level: null` is the whole reason this array is returned: it is the
29204
+ * difference between "this node is at `info` because I decided it" and
29205
+ * "...because it inherits". An operator who clears an override believing they
29206
+ * are clearing an inherited value has been handed the same defect as the two
29207
+ * contradicting knobs this document exists to remove, moved one floor up.
29208
+ */
29209
+ var LoggingLevelLayerSchema = object({
29210
+ scope: LoggingScopeKindSchema,
29211
+ /** The node this layer speaks for; `null` on the cluster layer. */
29212
+ nodeId: string().nullable(),
29213
+ /** Explicitly set here, or `null` when this layer inherits. */
29214
+ level: LogLevelSchema$1.nullable()
29215
+ });
29216
+ /** What a line is judged against, and WHICH layer decided it. */
29217
+ var LoggingEffectiveSchema = object({
29218
+ level: LogLevelSchema$1,
29219
+ levelSource: LoggingLevelSourceSchema
29220
+ });
29221
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29222
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29223
+ /**
29224
+ * An armed diagnostic, with its DEADLINE.
29225
+ *
29226
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29227
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29228
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29229
+ * `armed` is false — a window is never reported as slightly expired.
29230
+ */
29231
+ var DiagnosticWindowSchema = object({
29232
+ id: DiagnosticIdSchema,
29233
+ armed: boolean(),
29234
+ /** Epoch ms the window closes at. 0 when disarmed. */
29235
+ armedUntilMs: number(),
29236
+ /** Ms left before it expires on its own. 0 when disarmed. */
29237
+ remainingMs: number(),
29238
+ /** Whether the stored deadline is the one the live diagnostic is running —
29239
+ * i.e. whether this window would survive a restart. */
29240
+ persisted: boolean()
29241
+ });
29242
+ /**
29243
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29244
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29245
+ * is a second knob that disagrees with the first the day one of them moves.
29246
+ */
29247
+ var DiagnosticWindowPatchSchema = object({
29248
+ id: DiagnosticIdSchema,
29249
+ armMs: number().int().min(0),
29250
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29251
+ reportEveryMs: number().int().positive().optional()
29252
+ });
29253
+ /**
29254
+ * A PATCH, and patches MERGE.
29255
+ *
29256
+ * A field absent from the patch is left exactly as it was — arming a
29257
+ * diagnostic never resets a level, and setting a level never disarms a window.
29258
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29259
+ * `setAll` already merges, and rebuilding the object is how an absent field
29260
+ * turns into an erased one.
29261
+ */
29262
+ var LoggingSettingsPatchSchema = object({
29263
+ /**
29264
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29265
+ * addressed scope so it inherits again. A value sets it.
29266
+ */
29267
+ level: LogLevelSchema$1.nullable().optional(),
29268
+ /**
29269
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29270
+ * keeps running — a patch is never a full replacement.
29271
+ */
29272
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29273
+ });
29274
+ /**
29275
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29276
+ *
29277
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29278
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29279
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29280
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29281
+ * by an agent that holds no cluster document at all. The hub is the single
29282
+ * authority over the whole hierarchy and answers for every layer, so the
29283
+ * layer selector needs a name the transport does not already own.
29284
+ */
29285
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29286
+ var SetLoggingSettingsInputSchema = object({
29287
+ scopeNodeId: string().optional(),
29288
+ patch: LoggingSettingsPatchSchema
29289
+ });
29290
+ /**
29291
+ * The whole document, as read and as returned after every write.
29292
+ *
29293
+ * `persisted: false` means the settings store could not be read or written.
29294
+ * The in-memory mirror still governs behaviour and is unchanged by the
29295
+ * failure — a read that fails neither switches a level nor disarms a window
29296
+ * (D49) — but the operator is told that what they are looking at would not
29297
+ * survive a restart.
29298
+ */
29299
+ var LoggingSettingsStateSchema = object({
29300
+ /** The layer this document was read at. `null` = the cluster layer. */
29301
+ scopeNodeId: string().nullable(),
29302
+ effective: LoggingEffectiveSchema,
29303
+ explicit: LoggingExplicitSchema,
29304
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29305
+ persisted: boolean()
29306
+ });
28847
29307
  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(), {
28848
29308
  kind: "mutation",
28849
29309
  auth: "admin"
@@ -28856,6 +29316,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28856
29316
  }), method(_void(), SiteLocationStatusSchema, {
28857
29317
  kind: "mutation",
28858
29318
  auth: "admin"
29319
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29320
+ kind: "mutation",
29321
+ auth: "admin"
28859
29322
  });
28860
29323
  /**
28861
29324
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -36262,6 +36725,18 @@ Object.freeze({
36262
36725
  addonId: null,
36263
36726
  access: "create"
36264
36727
  },
36728
+ "system.getLoggingSettings": {
36729
+ capName: "system",
36730
+ capScope: "system",
36731
+ addonId: null,
36732
+ access: "view"
36733
+ },
36734
+ "system.getRequestCensus": {
36735
+ capName: "system",
36736
+ capScope: "system",
36737
+ addonId: null,
36738
+ access: "view"
36739
+ },
36265
36740
  "system.getRetentionConfig": {
36266
36741
  capName: "system",
36267
36742
  capScope: "system",
@@ -36292,6 +36767,12 @@ Object.freeze({
36292
36767
  addonId: null,
36293
36768
  access: "view"
36294
36769
  },
36770
+ "system.setLoggingSettings": {
36771
+ capName: "system",
36772
+ capScope: "system",
36773
+ addonId: null,
36774
+ access: "create"
36775
+ },
36295
36776
  "system.setRetentionConfig": {
36296
36777
  capName: "system",
36297
36778
  capScope: "system",
@@ -37447,6 +37928,10 @@ Object.freeze({
37447
37928
  name: "deviceId",
37448
37929
  form: "single",
37449
37930
  optional: true
37931
+ }, {
37932
+ name: "deviceIds",
37933
+ form: "array",
37934
+ optional: true
37450
37935
  }],
37451
37936
  "fanControl.setDirection": [{
37452
37937
  name: "deviceId",
@@ -39057,7 +39542,38 @@ object({
39057
39542
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
39058
39543
  * reproduce that.
39059
39544
  */
39060
- tileBudgetMb: number().int().min(0).max(1024)
39545
+ tileBudgetMb: number().int().min(0).max(1024),
39546
+ /**
39547
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39548
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39549
+ * subject tiles, on frames that detected something.
39550
+ *
39551
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39552
+ * containment is strict by design, so the native `keyFrame`, the detail
39553
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39554
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39555
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39556
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39557
+ *
39558
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39559
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39560
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39561
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39562
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39563
+ * binds only through a detection burst, where it still covers well past the
39564
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39565
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39566
+ * whole shape exists to avoid.
39567
+ *
39568
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39569
+ * subject tile, so one shared budget would let a busy camera's key frames
39570
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39571
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39572
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39573
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39574
+ * nothing.
39575
+ */
39576
+ sceneBudgetMb: number().int().min(0).max(1024)
39061
39577
  });
39062
39578
  /**
39063
39579
  * The values in force when the operator has set nothing.
@@ -39073,12 +39589,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
39073
39589
  budgetMb: 1024,
39074
39590
  activityMs: 15e3,
39075
39591
  tileBudgetMb: 64,
39592
+ sceneBudgetMb: 48,
39076
39593
  admission: "inferred"
39077
39594
  };
39078
39595
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39079
39596
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39080
39597
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39081
39598
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39599
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39082
39600
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39083
39601
  var MB = 1024 * 1024;
39084
39602
  1024 * MB, 3072 * MB;