@camstack/addon-provider-reolink 1.2.53 → 1.2.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +495 -59
  2. package/dist/addon.mjs +495 -59
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -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,211 @@ var SetSiteLocationInputSchema = object({
28844
29017
  latitude: number().min(-90).max(90),
28845
29018
  longitude: number().min(-180).max(180)
28846
29019
  }).nullable();
29020
+ /**
29021
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
29022
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29023
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29024
+ * already prints - never a token, never an `Authorization` header.
29025
+ */
29026
+ var RequestCensusGroupSchema = object({
29027
+ procedure: string(),
29028
+ userAgent: string(),
29029
+ ip: string(),
29030
+ principal: string(),
29031
+ calls: number(),
29032
+ perMin: number()
29033
+ });
29034
+ /**
29035
+ * A procedure's TOTAL over the window, across every caller.
29036
+ *
29037
+ * This block, not the group list, is what answers "did these calls arrive over
29038
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29039
+ * same window excludes the HTTP plane, which is a result, not a failure.
29040
+ */
29041
+ var RequestCensusProcedureSchema = object({
29042
+ procedure: string(),
29043
+ calls: number(),
29044
+ perMin: number()
29045
+ });
29046
+ /**
29047
+ * The census as an operator sees it.
29048
+ *
29049
+ * `persisted` is the honest answer to "will this survive the restart I am
29050
+ * about to do": the arm deadline is written to `system-settings` so a window
29051
+ * armed now can measure the NEXT boot, and a write that failed must not look
29052
+ * like one that succeeded.
29053
+ */
29054
+ var RequestCensusStatusSchema = object({
29055
+ armed: boolean(),
29056
+ /** How long the current - or just-closed - window collected, in ms. */
29057
+ elapsedMs: number(),
29058
+ /** The window actually armed, after the server clamped the request. */
29059
+ windowMs: number(),
29060
+ /** Epoch ms the window closes at. 0 when disarmed. */
29061
+ armedUntilMs: number(),
29062
+ httpRequests: number(),
29063
+ batchedRequests: number(),
29064
+ /**
29065
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29066
+ * is in play (`?batch=1` carries several procedures in one request); this is
29067
+ * the number comparable with a store-side call count.
29068
+ */
29069
+ procedureCalls: number(),
29070
+ /**
29071
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29072
+ * transport resolves one context per connection - but the number that says
29073
+ * whether a plane this census cannot see was busy while HTTP was quiet.
29074
+ */
29075
+ wsConnections: number(),
29076
+ distinctGroups: number(),
29077
+ /** Calls counted in the totals whose group attribution was shed at the
29078
+ * cardinality bound. */
29079
+ unattributedCalls: number(),
29080
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29081
+ groups: array(RequestCensusGroupSchema).readonly()
29082
+ }).extend({ persisted: boolean() });
29083
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29084
+ var LogLevelSchema$1 = _enum([
29085
+ "debug",
29086
+ "info",
29087
+ "warn",
29088
+ "error"
29089
+ ]);
29090
+ /**
29091
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29092
+ *
29093
+ * A diagnostic is anything whose cost is only worth paying while a question is
29094
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29095
+ */
29096
+ var DiagnosticIdSchema = _enum(["request-census"]);
29097
+ /**
29098
+ * The layers of the level hierarchy, general → specific. The most specific
29099
+ * layer that carries an explicit value wins.
29100
+ *
29101
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29102
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29103
+ * grow later would force every consumer of this document to change with it.
29104
+ * Nothing returns `component` today.
29105
+ */
29106
+ var LoggingScopeKindSchema = _enum([
29107
+ "cluster",
29108
+ "node",
29109
+ "component"
29110
+ ]);
29111
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29112
+ var LoggingLevelSourceSchema = _enum([
29113
+ "default",
29114
+ "cluster",
29115
+ "node",
29116
+ "component"
29117
+ ]);
29118
+ /**
29119
+ * One layer of the hierarchy as it actually STANDS.
29120
+ *
29121
+ * `level: null` is the whole reason this array is returned: it is the
29122
+ * difference between "this node is at `info` because I decided it" and
29123
+ * "...because it inherits". An operator who clears an override believing they
29124
+ * are clearing an inherited value has been handed the same defect as the two
29125
+ * contradicting knobs this document exists to remove, moved one floor up.
29126
+ */
29127
+ var LoggingLevelLayerSchema = object({
29128
+ scope: LoggingScopeKindSchema,
29129
+ /** The node this layer speaks for; `null` on the cluster layer. */
29130
+ nodeId: string().nullable(),
29131
+ /** Explicitly set here, or `null` when this layer inherits. */
29132
+ level: LogLevelSchema$1.nullable()
29133
+ });
29134
+ /** What a line is judged against, and WHICH layer decided it. */
29135
+ var LoggingEffectiveSchema = object({
29136
+ level: LogLevelSchema$1,
29137
+ levelSource: LoggingLevelSourceSchema
29138
+ });
29139
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29140
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29141
+ /**
29142
+ * An armed diagnostic, with its DEADLINE.
29143
+ *
29144
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29145
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29146
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29147
+ * `armed` is false — a window is never reported as slightly expired.
29148
+ */
29149
+ var DiagnosticWindowSchema = object({
29150
+ id: DiagnosticIdSchema,
29151
+ armed: boolean(),
29152
+ /** Epoch ms the window closes at. 0 when disarmed. */
29153
+ armedUntilMs: number(),
29154
+ /** Ms left before it expires on its own. 0 when disarmed. */
29155
+ remainingMs: number(),
29156
+ /** Whether the stored deadline is the one the live diagnostic is running —
29157
+ * i.e. whether this window would survive a restart. */
29158
+ persisted: boolean()
29159
+ });
29160
+ /**
29161
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29162
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29163
+ * is a second knob that disagrees with the first the day one of them moves.
29164
+ */
29165
+ var DiagnosticWindowPatchSchema = object({
29166
+ id: DiagnosticIdSchema,
29167
+ armMs: number().int().min(0),
29168
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29169
+ reportEveryMs: number().int().positive().optional()
29170
+ });
29171
+ /**
29172
+ * A PATCH, and patches MERGE.
29173
+ *
29174
+ * A field absent from the patch is left exactly as it was — arming a
29175
+ * diagnostic never resets a level, and setting a level never disarms a window.
29176
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29177
+ * `setAll` already merges, and rebuilding the object is how an absent field
29178
+ * turns into an erased one.
29179
+ */
29180
+ var LoggingSettingsPatchSchema = object({
29181
+ /**
29182
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29183
+ * addressed scope so it inherits again. A value sets it.
29184
+ */
29185
+ level: LogLevelSchema$1.nullable().optional(),
29186
+ /**
29187
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29188
+ * keeps running — a patch is never a full replacement.
29189
+ */
29190
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29191
+ });
29192
+ /**
29193
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29194
+ *
29195
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29196
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29197
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29198
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29199
+ * by an agent that holds no cluster document at all. The hub is the single
29200
+ * authority over the whole hierarchy and answers for every layer, so the
29201
+ * layer selector needs a name the transport does not already own.
29202
+ */
29203
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29204
+ var SetLoggingSettingsInputSchema = object({
29205
+ scopeNodeId: string().optional(),
29206
+ patch: LoggingSettingsPatchSchema
29207
+ });
29208
+ /**
29209
+ * The whole document, as read and as returned after every write.
29210
+ *
29211
+ * `persisted: false` means the settings store could not be read or written.
29212
+ * The in-memory mirror still governs behaviour and is unchanged by the
29213
+ * failure — a read that fails neither switches a level nor disarms a window
29214
+ * (D49) — but the operator is told that what they are looking at would not
29215
+ * survive a restart.
29216
+ */
29217
+ var LoggingSettingsStateSchema = object({
29218
+ /** The layer this document was read at. `null` = the cluster layer. */
29219
+ scopeNodeId: string().nullable(),
29220
+ effective: LoggingEffectiveSchema,
29221
+ explicit: LoggingExplicitSchema,
29222
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29223
+ persisted: boolean()
29224
+ });
28847
29225
  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
29226
  kind: "mutation",
28849
29227
  auth: "admin"
@@ -28856,6 +29234,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28856
29234
  }), method(_void(), SiteLocationStatusSchema, {
28857
29235
  kind: "mutation",
28858
29236
  auth: "admin"
29237
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29238
+ kind: "mutation",
29239
+ auth: "admin"
28859
29240
  });
28860
29241
  /**
28861
29242
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -36262,6 +36643,18 @@ Object.freeze({
36262
36643
  addonId: null,
36263
36644
  access: "create"
36264
36645
  },
36646
+ "system.getLoggingSettings": {
36647
+ capName: "system",
36648
+ capScope: "system",
36649
+ addonId: null,
36650
+ access: "view"
36651
+ },
36652
+ "system.getRequestCensus": {
36653
+ capName: "system",
36654
+ capScope: "system",
36655
+ addonId: null,
36656
+ access: "view"
36657
+ },
36265
36658
  "system.getRetentionConfig": {
36266
36659
  capName: "system",
36267
36660
  capScope: "system",
@@ -36292,6 +36685,12 @@ Object.freeze({
36292
36685
  addonId: null,
36293
36686
  access: "view"
36294
36687
  },
36688
+ "system.setLoggingSettings": {
36689
+ capName: "system",
36690
+ capScope: "system",
36691
+ addonId: null,
36692
+ access: "create"
36693
+ },
36295
36694
  "system.setRetentionConfig": {
36296
36695
  capName: "system",
36297
36696
  capScope: "system",
@@ -37447,6 +37846,10 @@ Object.freeze({
37447
37846
  name: "deviceId",
37448
37847
  form: "single",
37449
37848
  optional: true
37849
+ }, {
37850
+ name: "deviceIds",
37851
+ form: "array",
37852
+ optional: true
37450
37853
  }],
37451
37854
  "fanControl.setDirection": [{
37452
37855
  name: "deviceId",
@@ -39057,7 +39460,38 @@ object({
39057
39460
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
39058
39461
  * reproduce that.
39059
39462
  */
39060
- tileBudgetMb: number().int().min(0).max(1024)
39463
+ tileBudgetMb: number().int().min(0).max(1024),
39464
+ /**
39465
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39466
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39467
+ * subject tiles, on frames that detected something.
39468
+ *
39469
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39470
+ * containment is strict by design, so the native `keyFrame`, the detail
39471
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39472
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39473
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39474
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39475
+ *
39476
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39477
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39478
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39479
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39480
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39481
+ * binds only through a detection burst, where it still covers well past the
39482
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39483
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39484
+ * whole shape exists to avoid.
39485
+ *
39486
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39487
+ * subject tile, so one shared budget would let a busy camera's key frames
39488
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39489
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39490
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39491
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39492
+ * nothing.
39493
+ */
39494
+ sceneBudgetMb: number().int().min(0).max(1024)
39061
39495
  });
39062
39496
  /**
39063
39497
  * The values in force when the operator has set nothing.
@@ -39073,12 +39507,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
39073
39507
  budgetMb: 1024,
39074
39508
  activityMs: 15e3,
39075
39509
  tileBudgetMb: 64,
39510
+ sceneBudgetMb: 48,
39076
39511
  admission: "inferred"
39077
39512
  };
39078
39513
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39079
39514
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39080
39515
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39081
39516
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39517
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39082
39518
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39083
39519
  var MB = 1024 * 1024;
39084
39520
  1024 * MB, 3072 * MB;
package/dist/addon.mjs CHANGED
@@ -7560,6 +7560,66 @@ var OpsLogQueryInputSchema = object({
7560
7560
  /** Max rows returned, newest-first. */
7561
7561
  limit: number().int().min(1).max(1e3).optional()
7562
7562
  });
7563
+ var LabelDefinitionSchema = object({
7564
+ id: string(),
7565
+ name: string(),
7566
+ category: string().optional(),
7567
+ description: string().optional(),
7568
+ icon: string().optional()
7569
+ });
7570
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7571
+ var CLASS_MAP_MACRO_TARGETS = [
7572
+ "person",
7573
+ "vehicle",
7574
+ "animal",
7575
+ "package"
7576
+ ];
7577
+ /**
7578
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7579
+ * un operatore può selezionare.
7580
+ *
7581
+ * Sono le tre offerte dallo step `object-detection`
7582
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7583
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7584
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7585
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7586
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7587
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7588
+ *
7589
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7590
+ * dello step e una seconda volta come union `FirstLevelMacro`
7591
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7592
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7593
+ * successiva.
7594
+ */
7595
+ var FIRST_LEVEL_MACRO_CLASSES = [
7596
+ "person",
7597
+ "vehicle",
7598
+ "animal"
7599
+ ];
7600
+ /**
7601
+ * Wire schema for a per-model CATALOG classMap override
7602
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7603
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7604
+ * detection pipeline executor actually routes.
7605
+ *
7606
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7607
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7608
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7609
+ * enum) — the two used to share the name `ClassMapDefinition`/
7610
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7611
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7612
+ * are not: it is two different concepts colliding on a name. Keep this type
7613
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7614
+ * would either narrow every `ClassMapDefinition` consumer to the four
7615
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7616
+ * schema exists for (see the "rejects a classMap whose target is not a
7617
+ * detection macro" test in `model-catalog-schema.test.ts`).
7618
+ */
7619
+ var DetectionCatalogClassMapSchema = object({
7620
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7621
+ preserveOriginal: boolean()
7622
+ });
7563
7623
  /**
7564
7624
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7565
7625
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7582,10 +7642,55 @@ var RecordingStorageModeSchema = _enum([
7582
7642
  "events",
7583
7643
  "continuous"
7584
7644
  ]);
7645
+ /**
7646
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7647
+ * tre offerte dallo step `object-detection`, da UNA lista
7648
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7649
+ */
7650
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7651
+ /**
7652
+ * True quando `values` non ripete un elemento.
7653
+ *
7654
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7655
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7656
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7657
+ */
7658
+ var noDuplicates = (values) => new Set(values).size === values.length;
7585
7659
  /** Which detectors trigger an `events`-mode band. */
7586
7660
  var RecordingTriggersSchema = object({
7587
7661
  motion: boolean().optional(),
7588
- audioThresholdDbfs: number().optional()
7662
+ audioThresholdDbfs: number().optional(),
7663
+ /**
7664
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7665
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7666
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7667
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7668
+ *
7669
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7670
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7671
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7672
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7673
+ * finestre — vedi `recorder/object-trigger.ts`.
7674
+ */
7675
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7676
+ /**
7677
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7678
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7679
+ * `objectClasses`.
7680
+ *
7681
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7682
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7683
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7684
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7685
+ * device (D12) — mai un elenco globale di cap.
7686
+ *
7687
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7688
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7689
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7690
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7691
+ * registrare.
7692
+ */
7693
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7589
7694
  });
7590
7695
  /**
7591
7696
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8212,41 +8317,6 @@ var TIMEZONES = [
8212
8317
  function findTimezone(id) {
8213
8318
  return TIMEZONES.find((tz) => tz.id === id);
8214
8319
  }
8215
- var LabelDefinitionSchema = object({
8216
- id: string(),
8217
- name: string(),
8218
- category: string().optional(),
8219
- description: string().optional(),
8220
- icon: string().optional()
8221
- });
8222
- /**
8223
- * Wire schema for a per-model CATALOG classMap override
8224
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8225
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8226
- * detection pipeline executor actually routes.
8227
- *
8228
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8229
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8230
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8231
- * enum) — the two used to share the name `ClassMapDefinition`/
8232
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8233
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8234
- * are not: it is two different concepts colliding on a name. Keep this type
8235
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8236
- * would either narrow every `ClassMapDefinition` consumer to the four
8237
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8238
- * schema exists for (see the "rejects a classMap whose target is not a
8239
- * detection macro" test in `model-catalog-schema.test.ts`).
8240
- */
8241
- var DetectionCatalogClassMapSchema = object({
8242
- mapping: record(string(), _enum([
8243
- "person",
8244
- "vehicle",
8245
- "animal",
8246
- "package"
8247
- ])),
8248
- preserveOriginal: boolean()
8249
- });
8250
8320
  var MODEL_FORMATS = [
8251
8321
  "onnx",
8252
8322
  "coreml",
@@ -21478,7 +21548,7 @@ var lifecycleJobSchema = object({
21478
21548
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21479
21549
  * as every other cap.
21480
21550
  */
21481
- var LogLevelSchema$1 = _enum([
21551
+ var LogLevelSchema$2 = _enum([
21482
21552
  "debug",
21483
21553
  "info",
21484
21554
  "warn",
@@ -21685,7 +21755,7 @@ var CustomActionInputSchema = object({
21685
21755
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21686
21756
  addonId: string(),
21687
21757
  limit: number().min(1).max(500).default(100),
21688
- level: LogLevelSchema$1.optional()
21758
+ level: LogLevelSchema$2.optional()
21689
21759
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21690
21760
  packageName: string(),
21691
21761
  version: string().optional()
@@ -21783,7 +21853,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21783
21853
  auth: "admin"
21784
21854
  }), method(object({
21785
21855
  addonId: string(),
21786
- level: LogLevelSchema$1.optional()
21856
+ level: LogLevelSchema$2.optional()
21787
21857
  }), LogStreamEntrySchema, { kind: "subscription" });
21788
21858
  /**
21789
21859
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23507,6 +23577,35 @@ var FaceFilterEnum = _enum([
23507
23577
  "identified",
23508
23578
  "all"
23509
23579
  ]);
23580
+ /**
23581
+ * What a `listRecentFaces` page is ORDERED BY.
23582
+ *
23583
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23584
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23585
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23586
+ * order: it puts the suggestions an operator can confirm with one tap at the
23587
+ * top, and it is the reason this enum exists — a client that ranked a capped
23588
+ * page client-side was ranking the newest N, never the most certain N.
23589
+ *
23590
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23591
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23592
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23593
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23594
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23595
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23596
+ * then by faceId, and is what makes this a total order instead of the
23597
+ * backend's NULL-collation accident.
23598
+ */
23599
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23600
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23601
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23602
+ * never leaves the server. */
23603
+ var FaceClusterSchema = object({
23604
+ faceIds: array(string()).readonly(),
23605
+ representativeFaceId: string(),
23606
+ size: number().int(),
23607
+ cohesion: number()
23608
+ });
23510
23609
  var MediaFileLiteSchema$1 = object({
23511
23610
  key: string(),
23512
23611
  kind: string(),
@@ -23553,24 +23652,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23553
23652
  kind: "mutation",
23554
23653
  auth: "admin"
23555
23654
  }), method(object({
23556
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23655
+ /**
23656
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23657
+ *
23658
+ * The legacy single-camera form, kept verbatim for every caller that
23659
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23660
+ * instead — never both: `deviceIds` is the authority whenever it is
23661
+ * present, and this field is then ignored rather than unioned, so
23662
+ * there is exactly one answer to "which cameras did I ask for".
23663
+ */
23557
23664
  deviceId: number().int().optional(),
23665
+ /**
23666
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23667
+ * until now had to fetch the cluster-wide page and drop rows in the
23668
+ * client (so the `limit` it asked for was spent on cameras it was
23669
+ * about to discard).
23670
+ *
23671
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23672
+ * "every camera". A request for no devices is a request, not an
23673
+ * omission; same contract as `deviceManager.listFleet` and
23674
+ * `pipelineAnalytics.listRecentTracks`.
23675
+ *
23676
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23677
+ */
23678
+ deviceIds: array(number().int()).optional(),
23558
23679
  limit: number().int().positive().optional(),
23559
23680
  filter: FaceFilterEnum.optional(),
23560
23681
  /**
23561
- * Inline the base64 crop on every row. Default `true` — the existing
23562
- * behaviour, kept so no caller breaks.
23682
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23683
+ * Absent means no lower bound.
23684
+ */
23685
+ since: number().int().optional(),
23686
+ /**
23687
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23688
+ * Absent means no upper bound.
23689
+ */
23690
+ until: number().int().optional(),
23691
+ /**
23692
+ * Order the page by time or by suggestion certainty. Default
23693
+ * `'timestamp'` — the historical order, unchanged for every caller
23694
+ * that does not ask.
23563
23695
  *
23564
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23565
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23566
- * the browser cache the images.
23696
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23697
+ * does under `'suggestionConfidence'`.
23567
23698
  *
23568
- * **This is an INPUT field, so it does not reach the addon until the
23569
- * next train.** The hub router validates cap inputs against its own
23570
- * compiled Zod, which strips a key it does not know verified today
23571
- * on the OUTPUT side, where an additive field DOES arrive immediately
23572
- * (`Track.hasFace`). Until the train ships, sending `false` is
23573
- * harmless and simply keeps the crops inline.
23699
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23700
+ * index and stops reading as soon as `limit` rows have PASSED the
23701
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23702
+ * certain row may be the oldest so it walks the window. Narrow it
23703
+ * with {@link since} / {@link until}.
23704
+ */
23705
+ sortBy: FaceSortFieldEnum.optional(),
23706
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23707
+ sortDirection: FaceSortDirectionEnum.optional(),
23708
+ /**
23709
+ * Inline the base64 crop on every row.
23710
+ *
23711
+ * Default `false` since the 2026-08-25 inversion — see
23712
+ * `include-crops-default.ts`, which is the ONE place that resolves
23713
+ * this for every gallery, and which records why the inline shape had
23714
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23715
+ * The doc here used to still say `true`; it was wrong, and a leftover
23716
+ * that describes the old design reads as permission to rely on it.
23717
+ *
23718
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23719
+ * which the browser fetches off the `event-media` plane in parallel,
23720
+ * cached and ETagged.
23574
23721
  */
23575
23722
  includeCrops: boolean().optional()
23576
23723
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23606,13 +23753,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23606
23753
  }), method(object({
23607
23754
  threshold: number().min(0).max(1).optional(),
23608
23755
  minClusterSize: number().int().min(2).optional(),
23609
- limit: number().int().positive().optional()
23610
- }).optional(), array(object({
23611
- faceIds: array(string()).readonly(),
23612
- representativeFaceId: string(),
23613
- size: number().int(),
23614
- cohesion: number()
23615
- })).readonly());
23756
+ /**
23757
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23758
+ * which read as though it bounded the work — it never did.
23759
+ *
23760
+ * Wins over {@link limit} when both are sent.
23761
+ */
23762
+ maxClusters: number().int().positive().optional(),
23763
+ /**
23764
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23765
+ * RESULT, not the scan. Kept so existing callers keep working; send
23766
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23767
+ */
23768
+ limit: number().int().positive().optional(),
23769
+ /**
23770
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23771
+ * POOL, not the result.
23772
+ *
23773
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23774
+ * used to read every unassigned face on the hub no matter what the
23775
+ * caller asked for, because the only bound cut the finished clusters
23776
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23777
+ * whole corpus, on an addon whose disk is under contention.
23778
+ *
23779
+ * The pool is the NEWEST matching faces first — the same order the
23780
+ * gallery shows — so a bound here shortens the horizon, it does not
23781
+ * sample it randomly.
23782
+ *
23783
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23784
+ * so the live corpus — 372 face rows — is unaffected while the
23785
+ * unbounded scan can never come back as the table grows.
23786
+ */
23787
+ maxFacesScanned: number().int().positive().optional()
23788
+ }).optional(), array(FaceClusterSchema).readonly());
23616
23789
  /**
23617
23790
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23618
23791
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28839,6 +29012,211 @@ var SetSiteLocationInputSchema = object({
28839
29012
  latitude: number().min(-90).max(90),
28840
29013
  longitude: number().min(-180).max(180)
28841
29014
  }).nullable();
29015
+ /**
29016
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
29017
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29018
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29019
+ * already prints - never a token, never an `Authorization` header.
29020
+ */
29021
+ var RequestCensusGroupSchema = object({
29022
+ procedure: string(),
29023
+ userAgent: string(),
29024
+ ip: string(),
29025
+ principal: string(),
29026
+ calls: number(),
29027
+ perMin: number()
29028
+ });
29029
+ /**
29030
+ * A procedure's TOTAL over the window, across every caller.
29031
+ *
29032
+ * This block, not the group list, is what answers "did these calls arrive over
29033
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29034
+ * same window excludes the HTTP plane, which is a result, not a failure.
29035
+ */
29036
+ var RequestCensusProcedureSchema = object({
29037
+ procedure: string(),
29038
+ calls: number(),
29039
+ perMin: number()
29040
+ });
29041
+ /**
29042
+ * The census as an operator sees it.
29043
+ *
29044
+ * `persisted` is the honest answer to "will this survive the restart I am
29045
+ * about to do": the arm deadline is written to `system-settings` so a window
29046
+ * armed now can measure the NEXT boot, and a write that failed must not look
29047
+ * like one that succeeded.
29048
+ */
29049
+ var RequestCensusStatusSchema = object({
29050
+ armed: boolean(),
29051
+ /** How long the current - or just-closed - window collected, in ms. */
29052
+ elapsedMs: number(),
29053
+ /** The window actually armed, after the server clamped the request. */
29054
+ windowMs: number(),
29055
+ /** Epoch ms the window closes at. 0 when disarmed. */
29056
+ armedUntilMs: number(),
29057
+ httpRequests: number(),
29058
+ batchedRequests: number(),
29059
+ /**
29060
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29061
+ * is in play (`?batch=1` carries several procedures in one request); this is
29062
+ * the number comparable with a store-side call count.
29063
+ */
29064
+ procedureCalls: number(),
29065
+ /**
29066
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29067
+ * transport resolves one context per connection - but the number that says
29068
+ * whether a plane this census cannot see was busy while HTTP was quiet.
29069
+ */
29070
+ wsConnections: number(),
29071
+ distinctGroups: number(),
29072
+ /** Calls counted in the totals whose group attribution was shed at the
29073
+ * cardinality bound. */
29074
+ unattributedCalls: number(),
29075
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29076
+ groups: array(RequestCensusGroupSchema).readonly()
29077
+ }).extend({ persisted: boolean() });
29078
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29079
+ var LogLevelSchema$1 = _enum([
29080
+ "debug",
29081
+ "info",
29082
+ "warn",
29083
+ "error"
29084
+ ]);
29085
+ /**
29086
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29087
+ *
29088
+ * A diagnostic is anything whose cost is only worth paying while a question is
29089
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29090
+ */
29091
+ var DiagnosticIdSchema = _enum(["request-census"]);
29092
+ /**
29093
+ * The layers of the level hierarchy, general → specific. The most specific
29094
+ * layer that carries an explicit value wins.
29095
+ *
29096
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29097
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29098
+ * grow later would force every consumer of this document to change with it.
29099
+ * Nothing returns `component` today.
29100
+ */
29101
+ var LoggingScopeKindSchema = _enum([
29102
+ "cluster",
29103
+ "node",
29104
+ "component"
29105
+ ]);
29106
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29107
+ var LoggingLevelSourceSchema = _enum([
29108
+ "default",
29109
+ "cluster",
29110
+ "node",
29111
+ "component"
29112
+ ]);
29113
+ /**
29114
+ * One layer of the hierarchy as it actually STANDS.
29115
+ *
29116
+ * `level: null` is the whole reason this array is returned: it is the
29117
+ * difference between "this node is at `info` because I decided it" and
29118
+ * "...because it inherits". An operator who clears an override believing they
29119
+ * are clearing an inherited value has been handed the same defect as the two
29120
+ * contradicting knobs this document exists to remove, moved one floor up.
29121
+ */
29122
+ var LoggingLevelLayerSchema = object({
29123
+ scope: LoggingScopeKindSchema,
29124
+ /** The node this layer speaks for; `null` on the cluster layer. */
29125
+ nodeId: string().nullable(),
29126
+ /** Explicitly set here, or `null` when this layer inherits. */
29127
+ level: LogLevelSchema$1.nullable()
29128
+ });
29129
+ /** What a line is judged against, and WHICH layer decided it. */
29130
+ var LoggingEffectiveSchema = object({
29131
+ level: LogLevelSchema$1,
29132
+ levelSource: LoggingLevelSourceSchema
29133
+ });
29134
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29135
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29136
+ /**
29137
+ * An armed diagnostic, with its DEADLINE.
29138
+ *
29139
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29140
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29141
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29142
+ * `armed` is false — a window is never reported as slightly expired.
29143
+ */
29144
+ var DiagnosticWindowSchema = object({
29145
+ id: DiagnosticIdSchema,
29146
+ armed: boolean(),
29147
+ /** Epoch ms the window closes at. 0 when disarmed. */
29148
+ armedUntilMs: number(),
29149
+ /** Ms left before it expires on its own. 0 when disarmed. */
29150
+ remainingMs: number(),
29151
+ /** Whether the stored deadline is the one the live diagnostic is running —
29152
+ * i.e. whether this window would survive a restart. */
29153
+ persisted: boolean()
29154
+ });
29155
+ /**
29156
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29157
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29158
+ * is a second knob that disagrees with the first the day one of them moves.
29159
+ */
29160
+ var DiagnosticWindowPatchSchema = object({
29161
+ id: DiagnosticIdSchema,
29162
+ armMs: number().int().min(0),
29163
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29164
+ reportEveryMs: number().int().positive().optional()
29165
+ });
29166
+ /**
29167
+ * A PATCH, and patches MERGE.
29168
+ *
29169
+ * A field absent from the patch is left exactly as it was — arming a
29170
+ * diagnostic never resets a level, and setting a level never disarms a window.
29171
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29172
+ * `setAll` already merges, and rebuilding the object is how an absent field
29173
+ * turns into an erased one.
29174
+ */
29175
+ var LoggingSettingsPatchSchema = object({
29176
+ /**
29177
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29178
+ * addressed scope so it inherits again. A value sets it.
29179
+ */
29180
+ level: LogLevelSchema$1.nullable().optional(),
29181
+ /**
29182
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29183
+ * keeps running — a patch is never a full replacement.
29184
+ */
29185
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29186
+ });
29187
+ /**
29188
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29189
+ *
29190
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29191
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29192
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29193
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29194
+ * by an agent that holds no cluster document at all. The hub is the single
29195
+ * authority over the whole hierarchy and answers for every layer, so the
29196
+ * layer selector needs a name the transport does not already own.
29197
+ */
29198
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29199
+ var SetLoggingSettingsInputSchema = object({
29200
+ scopeNodeId: string().optional(),
29201
+ patch: LoggingSettingsPatchSchema
29202
+ });
29203
+ /**
29204
+ * The whole document, as read and as returned after every write.
29205
+ *
29206
+ * `persisted: false` means the settings store could not be read or written.
29207
+ * The in-memory mirror still governs behaviour and is unchanged by the
29208
+ * failure — a read that fails neither switches a level nor disarms a window
29209
+ * (D49) — but the operator is told that what they are looking at would not
29210
+ * survive a restart.
29211
+ */
29212
+ var LoggingSettingsStateSchema = object({
29213
+ /** The layer this document was read at. `null` = the cluster layer. */
29214
+ scopeNodeId: string().nullable(),
29215
+ effective: LoggingEffectiveSchema,
29216
+ explicit: LoggingExplicitSchema,
29217
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29218
+ persisted: boolean()
29219
+ });
28842
29220
  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(), {
28843
29221
  kind: "mutation",
28844
29222
  auth: "admin"
@@ -28851,6 +29229,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28851
29229
  }), method(_void(), SiteLocationStatusSchema, {
28852
29230
  kind: "mutation",
28853
29231
  auth: "admin"
29232
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29233
+ kind: "mutation",
29234
+ auth: "admin"
28854
29235
  });
28855
29236
  /**
28856
29237
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -36257,6 +36638,18 @@ Object.freeze({
36257
36638
  addonId: null,
36258
36639
  access: "create"
36259
36640
  },
36641
+ "system.getLoggingSettings": {
36642
+ capName: "system",
36643
+ capScope: "system",
36644
+ addonId: null,
36645
+ access: "view"
36646
+ },
36647
+ "system.getRequestCensus": {
36648
+ capName: "system",
36649
+ capScope: "system",
36650
+ addonId: null,
36651
+ access: "view"
36652
+ },
36260
36653
  "system.getRetentionConfig": {
36261
36654
  capName: "system",
36262
36655
  capScope: "system",
@@ -36287,6 +36680,12 @@ Object.freeze({
36287
36680
  addonId: null,
36288
36681
  access: "view"
36289
36682
  },
36683
+ "system.setLoggingSettings": {
36684
+ capName: "system",
36685
+ capScope: "system",
36686
+ addonId: null,
36687
+ access: "create"
36688
+ },
36290
36689
  "system.setRetentionConfig": {
36291
36690
  capName: "system",
36292
36691
  capScope: "system",
@@ -37442,6 +37841,10 @@ Object.freeze({
37442
37841
  name: "deviceId",
37443
37842
  form: "single",
37444
37843
  optional: true
37844
+ }, {
37845
+ name: "deviceIds",
37846
+ form: "array",
37847
+ optional: true
37445
37848
  }],
37446
37849
  "fanControl.setDirection": [{
37447
37850
  name: "deviceId",
@@ -39052,7 +39455,38 @@ object({
39052
39455
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
39053
39456
  * reproduce that.
39054
39457
  */
39055
- tileBudgetMb: number().int().min(0).max(1024)
39458
+ tileBudgetMb: number().int().min(0).max(1024),
39459
+ /**
39460
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39461
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39462
+ * subject tiles, on frames that detected something.
39463
+ *
39464
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39465
+ * containment is strict by design, so the native `keyFrame`, the detail
39466
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39467
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39468
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39469
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39470
+ *
39471
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39472
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39473
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39474
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39475
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39476
+ * binds only through a detection burst, where it still covers well past the
39477
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39478
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39479
+ * whole shape exists to avoid.
39480
+ *
39481
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39482
+ * subject tile, so one shared budget would let a busy camera's key frames
39483
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39484
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39485
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39486
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39487
+ * nothing.
39488
+ */
39489
+ sceneBudgetMb: number().int().min(0).max(1024)
39056
39490
  });
39057
39491
  /**
39058
39492
  * The values in force when the operator has set nothing.
@@ -39068,12 +39502,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
39068
39502
  budgetMb: 1024,
39069
39503
  activityMs: 15e3,
39070
39504
  tileBudgetMb: 64,
39505
+ sceneBudgetMb: 48,
39071
39506
  admission: "inferred"
39072
39507
  };
39073
39508
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39074
39509
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39075
39510
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39076
39511
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39512
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39077
39513
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39078
39514
  var MB = 1024 * 1024;
39079
39515
  1024 * MB, 3072 * MB;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-reolink",
3
- "version": "1.2.53",
3
+ "version": "1.2.54",
4
4
  "description": "Reolink camera device provider addon for CamStack — native Baichuan protocol",
5
5
  "keywords": [
6
6
  "camstack",