@camstack/addon-provider-hikvision 1.2.38 → 1.2.40

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
@@ -7521,6 +7521,66 @@ var OpsLogQueryInputSchema = object({
7521
7521
  /** Max rows returned, newest-first. */
7522
7522
  limit: number().int().min(1).max(1e3).optional()
7523
7523
  });
7524
+ var LabelDefinitionSchema = object({
7525
+ id: string(),
7526
+ name: string(),
7527
+ category: string().optional(),
7528
+ description: string().optional(),
7529
+ icon: string().optional()
7530
+ });
7531
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7532
+ var CLASS_MAP_MACRO_TARGETS = [
7533
+ "person",
7534
+ "vehicle",
7535
+ "animal",
7536
+ "package"
7537
+ ];
7538
+ /**
7539
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7540
+ * un operatore può selezionare.
7541
+ *
7542
+ * Sono le tre offerte dallo step `object-detection`
7543
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7544
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7545
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7546
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7547
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7548
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7549
+ *
7550
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7551
+ * dello step e una seconda volta come union `FirstLevelMacro`
7552
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7553
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7554
+ * successiva.
7555
+ */
7556
+ var FIRST_LEVEL_MACRO_CLASSES = [
7557
+ "person",
7558
+ "vehicle",
7559
+ "animal"
7560
+ ];
7561
+ /**
7562
+ * Wire schema for a per-model CATALOG classMap override
7563
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7564
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7565
+ * detection pipeline executor actually routes.
7566
+ *
7567
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7568
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7569
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7570
+ * enum) — the two used to share the name `ClassMapDefinition`/
7571
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7572
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7573
+ * are not: it is two different concepts colliding on a name. Keep this type
7574
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7575
+ * would either narrow every `ClassMapDefinition` consumer to the four
7576
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7577
+ * schema exists for (see the "rejects a classMap whose target is not a
7578
+ * detection macro" test in `model-catalog-schema.test.ts`).
7579
+ */
7580
+ var DetectionCatalogClassMapSchema = object({
7581
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7582
+ preserveOriginal: boolean()
7583
+ });
7524
7584
  /**
7525
7585
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7526
7586
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7543,10 +7603,55 @@ var RecordingStorageModeSchema = _enum([
7543
7603
  "events",
7544
7604
  "continuous"
7545
7605
  ]);
7606
+ /**
7607
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7608
+ * tre offerte dallo step `object-detection`, da UNA lista
7609
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7610
+ */
7611
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7612
+ /**
7613
+ * True quando `values` non ripete un elemento.
7614
+ *
7615
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7616
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7617
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7618
+ */
7619
+ var noDuplicates = (values) => new Set(values).size === values.length;
7546
7620
  /** Which detectors trigger an `events`-mode band. */
7547
7621
  var RecordingTriggersSchema = object({
7548
7622
  motion: boolean().optional(),
7549
- audioThresholdDbfs: number().optional()
7623
+ audioThresholdDbfs: number().optional(),
7624
+ /**
7625
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7626
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7627
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7628
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7629
+ *
7630
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7631
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7632
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7633
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7634
+ * finestre — vedi `recorder/object-trigger.ts`.
7635
+ */
7636
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7637
+ /**
7638
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7639
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7640
+ * `objectClasses`.
7641
+ *
7642
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7643
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7644
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7645
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7646
+ * device (D12) — mai un elenco globale di cap.
7647
+ *
7648
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7649
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7650
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7651
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7652
+ * registrare.
7653
+ */
7654
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7550
7655
  });
7551
7656
  /**
7552
7657
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8173,41 +8278,6 @@ var TIMEZONES = [
8173
8278
  function findTimezone(id) {
8174
8279
  return TIMEZONES.find((tz) => tz.id === id);
8175
8280
  }
8176
- var LabelDefinitionSchema = object({
8177
- id: string(),
8178
- name: string(),
8179
- category: string().optional(),
8180
- description: string().optional(),
8181
- icon: string().optional()
8182
- });
8183
- /**
8184
- * Wire schema for a per-model CATALOG classMap override
8185
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8186
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8187
- * detection pipeline executor actually routes.
8188
- *
8189
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8190
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8191
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8192
- * enum) — the two used to share the name `ClassMapDefinition`/
8193
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8194
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8195
- * are not: it is two different concepts colliding on a name. Keep this type
8196
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8197
- * would either narrow every `ClassMapDefinition` consumer to the four
8198
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8199
- * schema exists for (see the "rejects a classMap whose target is not a
8200
- * detection macro" test in `model-catalog-schema.test.ts`).
8201
- */
8202
- var DetectionCatalogClassMapSchema = object({
8203
- mapping: record(string(), _enum([
8204
- "person",
8205
- "vehicle",
8206
- "animal",
8207
- "package"
8208
- ])),
8209
- preserveOriginal: boolean()
8210
- });
8211
8281
  var MODEL_FORMATS = [
8212
8282
  "onnx",
8213
8283
  "coreml",
@@ -21439,7 +21509,7 @@ var lifecycleJobSchema = object({
21439
21509
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21440
21510
  * as every other cap.
21441
21511
  */
21442
- var LogLevelSchema$1 = _enum([
21512
+ var LogLevelSchema$2 = _enum([
21443
21513
  "debug",
21444
21514
  "info",
21445
21515
  "warn",
@@ -21646,7 +21716,7 @@ var CustomActionInputSchema = object({
21646
21716
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21647
21717
  addonId: string(),
21648
21718
  limit: number().min(1).max(500).default(100),
21649
- level: LogLevelSchema$1.optional()
21719
+ level: LogLevelSchema$2.optional()
21650
21720
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21651
21721
  packageName: string(),
21652
21722
  version: string().optional()
@@ -21744,7 +21814,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21744
21814
  auth: "admin"
21745
21815
  }), method(object({
21746
21816
  addonId: string(),
21747
- level: LogLevelSchema$1.optional()
21817
+ level: LogLevelSchema$2.optional()
21748
21818
  }), LogStreamEntrySchema, { kind: "subscription" });
21749
21819
  /**
21750
21820
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23468,6 +23538,35 @@ var FaceFilterEnum = _enum([
23468
23538
  "identified",
23469
23539
  "all"
23470
23540
  ]);
23541
+ /**
23542
+ * What a `listRecentFaces` page is ORDERED BY.
23543
+ *
23544
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23545
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23546
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23547
+ * order: it puts the suggestions an operator can confirm with one tap at the
23548
+ * top, and it is the reason this enum exists — a client that ranked a capped
23549
+ * page client-side was ranking the newest N, never the most certain N.
23550
+ *
23551
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23552
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23553
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23554
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23555
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23556
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23557
+ * then by faceId, and is what makes this a total order instead of the
23558
+ * backend's NULL-collation accident.
23559
+ */
23560
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23561
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23562
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23563
+ * never leaves the server. */
23564
+ var FaceClusterSchema = object({
23565
+ faceIds: array(string()).readonly(),
23566
+ representativeFaceId: string(),
23567
+ size: number().int(),
23568
+ cohesion: number()
23569
+ });
23471
23570
  var MediaFileLiteSchema$1 = object({
23472
23571
  key: string(),
23473
23572
  kind: string(),
@@ -23514,24 +23613,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23514
23613
  kind: "mutation",
23515
23614
  auth: "admin"
23516
23615
  }), method(object({
23517
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23616
+ /**
23617
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23618
+ *
23619
+ * The legacy single-camera form, kept verbatim for every caller that
23620
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23621
+ * instead — never both: `deviceIds` is the authority whenever it is
23622
+ * present, and this field is then ignored rather than unioned, so
23623
+ * there is exactly one answer to "which cameras did I ask for".
23624
+ */
23518
23625
  deviceId: number().int().optional(),
23626
+ /**
23627
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23628
+ * until now had to fetch the cluster-wide page and drop rows in the
23629
+ * client (so the `limit` it asked for was spent on cameras it was
23630
+ * about to discard).
23631
+ *
23632
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23633
+ * "every camera". A request for no devices is a request, not an
23634
+ * omission; same contract as `deviceManager.listFleet` and
23635
+ * `pipelineAnalytics.listRecentTracks`.
23636
+ *
23637
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23638
+ */
23639
+ deviceIds: array(number().int()).optional(),
23519
23640
  limit: number().int().positive().optional(),
23520
23641
  filter: FaceFilterEnum.optional(),
23521
23642
  /**
23522
- * Inline the base64 crop on every row. Default `true` — the existing
23523
- * behaviour, kept so no caller breaks.
23643
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23644
+ * Absent means no lower bound.
23645
+ */
23646
+ since: number().int().optional(),
23647
+ /**
23648
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23649
+ * Absent means no upper bound.
23650
+ */
23651
+ until: number().int().optional(),
23652
+ /**
23653
+ * Order the page by time or by suggestion certainty. Default
23654
+ * `'timestamp'` — the historical order, unchanged for every caller
23655
+ * that does not ask.
23524
23656
  *
23525
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23526
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23527
- * the browser cache the images.
23657
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23658
+ * does under `'suggestionConfidence'`.
23528
23659
  *
23529
- * **This is an INPUT field, so it does not reach the addon until the
23530
- * next train.** The hub router validates cap inputs against its own
23531
- * compiled Zod, which strips a key it does not know verified today
23532
- * on the OUTPUT side, where an additive field DOES arrive immediately
23533
- * (`Track.hasFace`). Until the train ships, sending `false` is
23534
- * harmless and simply keeps the crops inline.
23660
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23661
+ * index and stops reading as soon as `limit` rows have PASSED the
23662
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23663
+ * certain row may be the oldest so it walks the window. Narrow it
23664
+ * with {@link since} / {@link until}.
23665
+ */
23666
+ sortBy: FaceSortFieldEnum.optional(),
23667
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23668
+ sortDirection: FaceSortDirectionEnum.optional(),
23669
+ /**
23670
+ * Inline the base64 crop on every row.
23671
+ *
23672
+ * Default `false` since the 2026-08-25 inversion — see
23673
+ * `include-crops-default.ts`, which is the ONE place that resolves
23674
+ * this for every gallery, and which records why the inline shape had
23675
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23676
+ * The doc here used to still say `true`; it was wrong, and a leftover
23677
+ * that describes the old design reads as permission to rely on it.
23678
+ *
23679
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23680
+ * which the browser fetches off the `event-media` plane in parallel,
23681
+ * cached and ETagged.
23535
23682
  */
23536
23683
  includeCrops: boolean().optional()
23537
23684
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23567,13 +23714,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23567
23714
  }), method(object({
23568
23715
  threshold: number().min(0).max(1).optional(),
23569
23716
  minClusterSize: number().int().min(2).optional(),
23570
- limit: number().int().positive().optional()
23571
- }).optional(), array(object({
23572
- faceIds: array(string()).readonly(),
23573
- representativeFaceId: string(),
23574
- size: number().int(),
23575
- cohesion: number()
23576
- })).readonly());
23717
+ /**
23718
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23719
+ * which read as though it bounded the work — it never did.
23720
+ *
23721
+ * Wins over {@link limit} when both are sent.
23722
+ */
23723
+ maxClusters: number().int().positive().optional(),
23724
+ /**
23725
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23726
+ * RESULT, not the scan. Kept so existing callers keep working; send
23727
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23728
+ */
23729
+ limit: number().int().positive().optional(),
23730
+ /**
23731
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23732
+ * POOL, not the result.
23733
+ *
23734
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23735
+ * used to read every unassigned face on the hub no matter what the
23736
+ * caller asked for, because the only bound cut the finished clusters
23737
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23738
+ * whole corpus, on an addon whose disk is under contention.
23739
+ *
23740
+ * The pool is the NEWEST matching faces first — the same order the
23741
+ * gallery shows — so a bound here shortens the horizon, it does not
23742
+ * sample it randomly.
23743
+ *
23744
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23745
+ * so the live corpus — 372 face rows — is unaffected while the
23746
+ * unbounded scan can never come back as the table grows.
23747
+ */
23748
+ maxFacesScanned: number().int().positive().optional()
23749
+ }).optional(), array(FaceClusterSchema).readonly());
23577
23750
  /**
23578
23751
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23579
23752
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28846,6 +29019,293 @@ var SetSiteLocationInputSchema = object({
28846
29019
  latitude: number().min(-90).max(90),
28847
29020
  longitude: number().min(-180).max(180)
28848
29021
  }).nullable();
29022
+ /**
29023
+ * The TRANSPORT a call arrived on.
29024
+ *
29025
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
29026
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
29027
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
29028
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
29029
+ * checkable rather than asserted.
29030
+ *
29031
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
29032
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
29033
+ * connection; the viewer talks to the hub over `wsLink`
29034
+ * exclusively, so this is the plane the HTTP census could not see.
29035
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
29036
+ * never touches a socket and therefore never touched a census.
29037
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
29038
+ * that is exactly what its `0` asserts: every plane the hub has can name
29039
+ * itself. It is an output bucket, never a knob — a call that arrives on a
29040
+ * plane nobody instrumented lands here instead of vanishing from the total.
29041
+ */
29042
+ var TransportPlaneSchema = _enum([
29043
+ "http",
29044
+ "ws",
29045
+ "mesh",
29046
+ "unknown"
29047
+ ]);
29048
+ /**
29049
+ * Calls per plane. Every key is always present, `0` included — an absent plane
29050
+ * reads as "not instrumented", which is the one thing this census must never
29051
+ * make an operator wonder about.
29052
+ */
29053
+ var TransportPlaneCountsSchema = object({
29054
+ http: number(),
29055
+ ws: number(),
29056
+ mesh: number(),
29057
+ unknown: number()
29058
+ });
29059
+ /**
29060
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
29061
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29062
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29063
+ * already prints - never a token, never an `Authorization` header.
29064
+ *
29065
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
29066
+ * and lives for hours, so folding it into a call count makes one long-lived
29067
+ * stream look like a storm.
29068
+ */
29069
+ var RequestCensusGroupSchema = object({
29070
+ plane: TransportPlaneSchema,
29071
+ procedure: string(),
29072
+ userAgent: string(),
29073
+ ip: string(),
29074
+ principal: string(),
29075
+ calls: number(),
29076
+ subscriptions: number(),
29077
+ perMin: number()
29078
+ });
29079
+ /**
29080
+ * A procedure's TOTAL over the window, across every caller.
29081
+ *
29082
+ * This block, not the group list, is what answers "did these calls arrive over
29083
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29084
+ * same window excludes the HTTP plane, which is a result, not a failure.
29085
+ */
29086
+ var RequestCensusProcedureSchema = object({
29087
+ procedure: string(),
29088
+ calls: number(),
29089
+ /**
29090
+ * The same total, split by transport. THIS is the row that answers the
29091
+ * question the census exists for: one look at `deviceManager.listAll` says
29092
+ * which plane carried the 4 960, without joining two log lines by eye.
29093
+ */
29094
+ planes: TransportPlaneCountsSchema,
29095
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
29096
+ subscriptions: number(),
29097
+ perMin: number()
29098
+ });
29099
+ /**
29100
+ * The census as an operator sees it.
29101
+ *
29102
+ * `persisted` is the honest answer to "will this survive the restart I am
29103
+ * about to do": the arm deadline is written to `system-settings` so a window
29104
+ * armed now can measure the NEXT boot, and a write that failed must not look
29105
+ * like one that succeeded.
29106
+ */
29107
+ var RequestCensusStatusSchema = object({
29108
+ armed: boolean(),
29109
+ /** How long the current - or just-closed - window collected, in ms. */
29110
+ elapsedMs: number(),
29111
+ /** The window actually armed, after the server clamped the request. */
29112
+ windowMs: number(),
29113
+ /** Epoch ms the window closes at. 0 when disarmed. */
29114
+ armedUntilMs: number(),
29115
+ httpRequests: number(),
29116
+ batchedRequests: number(),
29117
+ /**
29118
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29119
+ * is in play (`?batch=1` carries several procedures in one request); this is
29120
+ * the number comparable with a store-side call count.
29121
+ */
29122
+ procedureCalls: number(),
29123
+ /**
29124
+ * `procedureCalls` split by transport. The four keys sum to
29125
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
29126
+ * `planesExplainTotal` is that identity, checked rather than assumed.
29127
+ */
29128
+ planes: TransportPlaneCountsSchema,
29129
+ /**
29130
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
29131
+ * on no plane at all - which is a RESULT (a plane is missing from the
29132
+ * instrument), not a failure, and it has to be visible to be read as one.
29133
+ */
29134
+ planesExplainTotal: boolean(),
29135
+ /**
29136
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29137
+ * adapter resolves one context per connection - kept because a plane's call
29138
+ * count of zero against 37 open connections says something different from a
29139
+ * plane with no connections at all.
29140
+ */
29141
+ wsConnections: number(),
29142
+ /**
29143
+ * Client frames the WS plane looked at. `wsMessages` far above
29144
+ * `planes.ws + subscriptions` means most traffic is not operations
29145
+ * (keepalives, connection params) - which is itself an answer.
29146
+ */
29147
+ wsMessages: number(),
29148
+ /**
29149
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
29150
+ * purpose: one live-events stream opened at boot and held for six hours is
29151
+ * one subscription, and counting it as a call would let a quiet plane
29152
+ * masquerade as the storm.
29153
+ */
29154
+ subscriptions: number(),
29155
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
29156
+ subscriptionStops: number(),
29157
+ distinctGroups: number(),
29158
+ /**
29159
+ * Operations counted in the totals whose CALLER attribution was shed at the
29160
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
29161
+ * which transport they arrived on, they just lost their group row.
29162
+ */
29163
+ unattributedCalls: number(),
29164
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29165
+ groups: array(RequestCensusGroupSchema).readonly()
29166
+ }).extend({ persisted: boolean() });
29167
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29168
+ var LogLevelSchema$1 = _enum([
29169
+ "debug",
29170
+ "info",
29171
+ "warn",
29172
+ "error"
29173
+ ]);
29174
+ /**
29175
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29176
+ *
29177
+ * A diagnostic is anything whose cost is only worth paying while a question is
29178
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29179
+ */
29180
+ var DiagnosticIdSchema = _enum(["request-census"]);
29181
+ /**
29182
+ * The layers of the level hierarchy, general → specific. The most specific
29183
+ * layer that carries an explicit value wins.
29184
+ *
29185
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29186
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29187
+ * grow later would force every consumer of this document to change with it.
29188
+ * Nothing returns `component` today.
29189
+ */
29190
+ var LoggingScopeKindSchema = _enum([
29191
+ "cluster",
29192
+ "node",
29193
+ "component"
29194
+ ]);
29195
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29196
+ var LoggingLevelSourceSchema = _enum([
29197
+ "default",
29198
+ "cluster",
29199
+ "node",
29200
+ "component"
29201
+ ]);
29202
+ /**
29203
+ * One layer of the hierarchy as it actually STANDS.
29204
+ *
29205
+ * `level: null` is the whole reason this array is returned: it is the
29206
+ * difference between "this node is at `info` because I decided it" and
29207
+ * "...because it inherits". An operator who clears an override believing they
29208
+ * are clearing an inherited value has been handed the same defect as the two
29209
+ * contradicting knobs this document exists to remove, moved one floor up.
29210
+ */
29211
+ var LoggingLevelLayerSchema = object({
29212
+ scope: LoggingScopeKindSchema,
29213
+ /** The node this layer speaks for; `null` on the cluster layer. */
29214
+ nodeId: string().nullable(),
29215
+ /** Explicitly set here, or `null` when this layer inherits. */
29216
+ level: LogLevelSchema$1.nullable()
29217
+ });
29218
+ /** What a line is judged against, and WHICH layer decided it. */
29219
+ var LoggingEffectiveSchema = object({
29220
+ level: LogLevelSchema$1,
29221
+ levelSource: LoggingLevelSourceSchema
29222
+ });
29223
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29224
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29225
+ /**
29226
+ * An armed diagnostic, with its DEADLINE.
29227
+ *
29228
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29229
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29230
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29231
+ * `armed` is false — a window is never reported as slightly expired.
29232
+ */
29233
+ var DiagnosticWindowSchema = object({
29234
+ id: DiagnosticIdSchema,
29235
+ armed: boolean(),
29236
+ /** Epoch ms the window closes at. 0 when disarmed. */
29237
+ armedUntilMs: number(),
29238
+ /** Ms left before it expires on its own. 0 when disarmed. */
29239
+ remainingMs: number(),
29240
+ /** Whether the stored deadline is the one the live diagnostic is running —
29241
+ * i.e. whether this window would survive a restart. */
29242
+ persisted: boolean()
29243
+ });
29244
+ /**
29245
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29246
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29247
+ * is a second knob that disagrees with the first the day one of them moves.
29248
+ */
29249
+ var DiagnosticWindowPatchSchema = object({
29250
+ id: DiagnosticIdSchema,
29251
+ armMs: number().int().min(0),
29252
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29253
+ reportEveryMs: number().int().positive().optional()
29254
+ });
29255
+ /**
29256
+ * A PATCH, and patches MERGE.
29257
+ *
29258
+ * A field absent from the patch is left exactly as it was — arming a
29259
+ * diagnostic never resets a level, and setting a level never disarms a window.
29260
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29261
+ * `setAll` already merges, and rebuilding the object is how an absent field
29262
+ * turns into an erased one.
29263
+ */
29264
+ var LoggingSettingsPatchSchema = object({
29265
+ /**
29266
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29267
+ * addressed scope so it inherits again. A value sets it.
29268
+ */
29269
+ level: LogLevelSchema$1.nullable().optional(),
29270
+ /**
29271
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29272
+ * keeps running — a patch is never a full replacement.
29273
+ */
29274
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29275
+ });
29276
+ /**
29277
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29278
+ *
29279
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29280
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29281
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29282
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29283
+ * by an agent that holds no cluster document at all. The hub is the single
29284
+ * authority over the whole hierarchy and answers for every layer, so the
29285
+ * layer selector needs a name the transport does not already own.
29286
+ */
29287
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29288
+ var SetLoggingSettingsInputSchema = object({
29289
+ scopeNodeId: string().optional(),
29290
+ patch: LoggingSettingsPatchSchema
29291
+ });
29292
+ /**
29293
+ * The whole document, as read and as returned after every write.
29294
+ *
29295
+ * `persisted: false` means the settings store could not be read or written.
29296
+ * The in-memory mirror still governs behaviour and is unchanged by the
29297
+ * failure — a read that fails neither switches a level nor disarms a window
29298
+ * (D49) — but the operator is told that what they are looking at would not
29299
+ * survive a restart.
29300
+ */
29301
+ var LoggingSettingsStateSchema = object({
29302
+ /** The layer this document was read at. `null` = the cluster layer. */
29303
+ scopeNodeId: string().nullable(),
29304
+ effective: LoggingEffectiveSchema,
29305
+ explicit: LoggingExplicitSchema,
29306
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29307
+ persisted: boolean()
29308
+ });
28849
29309
  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(), {
28850
29310
  kind: "mutation",
28851
29311
  auth: "admin"
@@ -28858,6 +29318,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28858
29318
  }), method(_void(), SiteLocationStatusSchema, {
28859
29319
  kind: "mutation",
28860
29320
  auth: "admin"
29321
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29322
+ kind: "mutation",
29323
+ auth: "admin"
28861
29324
  });
28862
29325
  /**
28863
29326
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -36330,6 +36793,18 @@ Object.freeze({
36330
36793
  addonId: null,
36331
36794
  access: "create"
36332
36795
  },
36796
+ "system.getLoggingSettings": {
36797
+ capName: "system",
36798
+ capScope: "system",
36799
+ addonId: null,
36800
+ access: "view"
36801
+ },
36802
+ "system.getRequestCensus": {
36803
+ capName: "system",
36804
+ capScope: "system",
36805
+ addonId: null,
36806
+ access: "view"
36807
+ },
36333
36808
  "system.getRetentionConfig": {
36334
36809
  capName: "system",
36335
36810
  capScope: "system",
@@ -36360,6 +36835,12 @@ Object.freeze({
36360
36835
  addonId: null,
36361
36836
  access: "view"
36362
36837
  },
36838
+ "system.setLoggingSettings": {
36839
+ capName: "system",
36840
+ capScope: "system",
36841
+ addonId: null,
36842
+ access: "create"
36843
+ },
36363
36844
  "system.setRetentionConfig": {
36364
36845
  capName: "system",
36365
36846
  capScope: "system",
@@ -37515,6 +37996,10 @@ Object.freeze({
37515
37996
  name: "deviceId",
37516
37997
  form: "single",
37517
37998
  optional: true
37999
+ }, {
38000
+ name: "deviceIds",
38001
+ form: "array",
38002
+ optional: true
37518
38003
  }],
37519
38004
  "fanControl.setDirection": [{
37520
38005
  name: "deviceId",
@@ -39125,7 +39610,38 @@ object({
39125
39610
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
39126
39611
  * reproduce that.
39127
39612
  */
39128
- tileBudgetMb: number().int().min(0).max(1024)
39613
+ tileBudgetMb: number().int().min(0).max(1024),
39614
+ /**
39615
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39616
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39617
+ * subject tiles, on frames that detected something.
39618
+ *
39619
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39620
+ * containment is strict by design, so the native `keyFrame`, the detail
39621
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39622
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39623
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39624
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39625
+ *
39626
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39627
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39628
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39629
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39630
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39631
+ * binds only through a detection burst, where it still covers well past the
39632
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39633
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39634
+ * whole shape exists to avoid.
39635
+ *
39636
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39637
+ * subject tile, so one shared budget would let a busy camera's key frames
39638
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39639
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39640
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39641
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39642
+ * nothing.
39643
+ */
39644
+ sceneBudgetMb: number().int().min(0).max(1024)
39129
39645
  });
39130
39646
  /**
39131
39647
  * The values in force when the operator has set nothing.
@@ -39141,12 +39657,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
39141
39657
  budgetMb: 1024,
39142
39658
  activityMs: 15e3,
39143
39659
  tileBudgetMb: 64,
39660
+ sceneBudgetMb: 48,
39144
39661
  admission: "inferred"
39145
39662
  };
39146
39663
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39147
39664
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39148
39665
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39149
39666
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39667
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39150
39668
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39151
39669
  var MB = 1024 * 1024;
39152
39670
  1024 * MB, 3072 * MB;