@camstack/addon-export-hap 1.2.42 → 1.2.44

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.
@@ -8192,6 +8192,66 @@ var OpsLogQueryInputSchema = object({
8192
8192
  /** Max rows returned, newest-first. */
8193
8193
  limit: number().int().min(1).max(1e3).optional()
8194
8194
  });
8195
+ var LabelDefinitionSchema = object({
8196
+ id: string(),
8197
+ name: string(),
8198
+ category: string().optional(),
8199
+ description: string().optional(),
8200
+ icon: string().optional()
8201
+ });
8202
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
8203
+ var CLASS_MAP_MACRO_TARGETS = [
8204
+ "person",
8205
+ "vehicle",
8206
+ "animal",
8207
+ "package"
8208
+ ];
8209
+ /**
8210
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
8211
+ * un operatore può selezionare.
8212
+ *
8213
+ * Sono le tre offerte dallo step `object-detection`
8214
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
8215
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
8216
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
8217
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
8218
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
8219
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
8220
+ *
8221
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
8222
+ * dello step e una seconda volta come union `FirstLevelMacro`
8223
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
8224
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
8225
+ * successiva.
8226
+ */
8227
+ var FIRST_LEVEL_MACRO_CLASSES = [
8228
+ "person",
8229
+ "vehicle",
8230
+ "animal"
8231
+ ];
8232
+ /**
8233
+ * Wire schema for a per-model CATALOG classMap override
8234
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8235
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8236
+ * detection pipeline executor actually routes.
8237
+ *
8238
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8239
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8240
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8241
+ * enum) — the two used to share the name `ClassMapDefinition`/
8242
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8243
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8244
+ * are not: it is two different concepts colliding on a name. Keep this type
8245
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
8246
+ * would either narrow every `ClassMapDefinition` consumer to the four
8247
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8248
+ * schema exists for (see the "rejects a classMap whose target is not a
8249
+ * detection macro" test in `model-catalog-schema.test.ts`).
8250
+ */
8251
+ var DetectionCatalogClassMapSchema = object({
8252
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
8253
+ preserveOriginal: boolean()
8254
+ });
8195
8255
  /**
8196
8256
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
8197
8257
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -8214,10 +8274,55 @@ var RecordingStorageModeSchema = _enum([
8214
8274
  "events",
8215
8275
  "continuous"
8216
8276
  ]);
8277
+ /**
8278
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
8279
+ * tre offerte dallo step `object-detection`, da UNA lista
8280
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
8281
+ */
8282
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
8283
+ /**
8284
+ * True quando `values` non ripete un elemento.
8285
+ *
8286
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
8287
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
8288
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
8289
+ */
8290
+ var noDuplicates = (values) => new Set(values).size === values.length;
8217
8291
  /** Which detectors trigger an `events`-mode band. */
8218
8292
  var RecordingTriggersSchema = object({
8219
8293
  motion: boolean().optional(),
8220
- audioThresholdDbfs: number().optional()
8294
+ audioThresholdDbfs: number().optional(),
8295
+ /**
8296
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
8297
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
8298
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
8299
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
8300
+ *
8301
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
8302
+ * quelle che hanno attraversato `enabledMacroClasses`, i
8303
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
8304
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
8305
+ * finestre — vedi `recorder/object-trigger.ts`.
8306
+ */
8307
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
8308
+ /**
8309
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
8310
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
8311
+ * `objectClasses`.
8312
+ *
8313
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
8314
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
8315
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
8316
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
8317
+ * device (D12) — mai un elenco globale di cap.
8318
+ *
8319
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
8320
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
8321
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
8322
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
8323
+ * registrare.
8324
+ */
8325
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8221
8326
  });
8222
8327
  /**
8223
8328
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8723,41 +8828,6 @@ function pickClosestResolution(entries, target) {
8723
8828
  }
8724
8829
  return bestAbove?.entry ?? bestBelow?.entry;
8725
8830
  }
8726
- var LabelDefinitionSchema = object({
8727
- id: string(),
8728
- name: string(),
8729
- category: string().optional(),
8730
- description: string().optional(),
8731
- icon: string().optional()
8732
- });
8733
- /**
8734
- * Wire schema for a per-model CATALOG classMap override
8735
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8736
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8737
- * detection pipeline executor actually routes.
8738
- *
8739
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8740
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8741
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8742
- * enum) — the two used to share the name `ClassMapDefinition`/
8743
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8744
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8745
- * are not: it is two different concepts colliding on a name. Keep this type
8746
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8747
- * would either narrow every `ClassMapDefinition` consumer to the four
8748
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8749
- * schema exists for (see the "rejects a classMap whose target is not a
8750
- * detection macro" test in `model-catalog-schema.test.ts`).
8751
- */
8752
- var DetectionCatalogClassMapSchema = object({
8753
- mapping: record(string(), _enum([
8754
- "person",
8755
- "vehicle",
8756
- "animal",
8757
- "package"
8758
- ])),
8759
- preserveOriginal: boolean()
8760
- });
8761
8831
  var MODEL_FORMATS = [
8762
8832
  "onnx",
8763
8833
  "coreml",
@@ -21612,7 +21682,7 @@ var lifecycleJobSchema = object({
21612
21682
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21613
21683
  * as every other cap.
21614
21684
  */
21615
- var LogLevelSchema$1 = _enum([
21685
+ var LogLevelSchema$2 = _enum([
21616
21686
  "debug",
21617
21687
  "info",
21618
21688
  "warn",
@@ -21819,7 +21889,7 @@ var CustomActionInputSchema = object({
21819
21889
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21820
21890
  addonId: string(),
21821
21891
  limit: number().min(1).max(500).default(100),
21822
- level: LogLevelSchema$1.optional()
21892
+ level: LogLevelSchema$2.optional()
21823
21893
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21824
21894
  packageName: string(),
21825
21895
  version: string().optional()
@@ -21917,7 +21987,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21917
21987
  auth: "admin"
21918
21988
  }), method(object({
21919
21989
  addonId: string(),
21920
- level: LogLevelSchema$1.optional()
21990
+ level: LogLevelSchema$2.optional()
21921
21991
  }), LogStreamEntrySchema, { kind: "subscription" });
21922
21992
  object({
21923
21993
  /** Carbon dioxide concentration in ppm. */
@@ -22931,6 +23001,35 @@ var FaceFilterEnum = _enum([
22931
23001
  "identified",
22932
23002
  "all"
22933
23003
  ]);
23004
+ /**
23005
+ * What a `listRecentFaces` page is ORDERED BY.
23006
+ *
23007
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23008
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23009
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23010
+ * order: it puts the suggestions an operator can confirm with one tap at the
23011
+ * top, and it is the reason this enum exists — a client that ranked a capped
23012
+ * page client-side was ranking the newest N, never the most certain N.
23013
+ *
23014
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23015
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23016
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23017
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23018
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23019
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23020
+ * then by faceId, and is what makes this a total order instead of the
23021
+ * backend's NULL-collation accident.
23022
+ */
23023
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23024
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23025
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23026
+ * never leaves the server. */
23027
+ var FaceClusterSchema = object({
23028
+ faceIds: array(string()).readonly(),
23029
+ representativeFaceId: string(),
23030
+ size: number().int(),
23031
+ cohesion: number()
23032
+ });
22934
23033
  var MediaFileLiteSchema$1 = object({
22935
23034
  key: string(),
22936
23035
  kind: string(),
@@ -22977,24 +23076,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22977
23076
  kind: "mutation",
22978
23077
  auth: "admin"
22979
23078
  }), method(object({
22980
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23079
+ /**
23080
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23081
+ *
23082
+ * The legacy single-camera form, kept verbatim for every caller that
23083
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23084
+ * instead — never both: `deviceIds` is the authority whenever it is
23085
+ * present, and this field is then ignored rather than unioned, so
23086
+ * there is exactly one answer to "which cameras did I ask for".
23087
+ */
22981
23088
  deviceId: number().int().optional(),
23089
+ /**
23090
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23091
+ * until now had to fetch the cluster-wide page and drop rows in the
23092
+ * client (so the `limit` it asked for was spent on cameras it was
23093
+ * about to discard).
23094
+ *
23095
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23096
+ * "every camera". A request for no devices is a request, not an
23097
+ * omission; same contract as `deviceManager.listFleet` and
23098
+ * `pipelineAnalytics.listRecentTracks`.
23099
+ *
23100
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23101
+ */
23102
+ deviceIds: array(number().int()).optional(),
22982
23103
  limit: number().int().positive().optional(),
22983
23104
  filter: FaceFilterEnum.optional(),
22984
23105
  /**
22985
- * Inline the base64 crop on every row. Default `true` — the existing
22986
- * behaviour, kept so no caller breaks.
23106
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23107
+ * Absent means no lower bound.
23108
+ */
23109
+ since: number().int().optional(),
23110
+ /**
23111
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23112
+ * Absent means no upper bound.
23113
+ */
23114
+ until: number().int().optional(),
23115
+ /**
23116
+ * Order the page by time or by suggestion certainty. Default
23117
+ * `'timestamp'` — the historical order, unchanged for every caller
23118
+ * that does not ask.
22987
23119
  *
22988
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22989
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22990
- * the browser cache the images.
23120
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23121
+ * does under `'suggestionConfidence'`.
22991
23122
  *
22992
- * **This is an INPUT field, so it does not reach the addon until the
22993
- * next train.** The hub router validates cap inputs against its own
22994
- * compiled Zod, which strips a key it does not know verified today
22995
- * on the OUTPUT side, where an additive field DOES arrive immediately
22996
- * (`Track.hasFace`). Until the train ships, sending `false` is
22997
- * harmless and simply keeps the crops inline.
23123
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23124
+ * index and stops reading as soon as `limit` rows have PASSED the
23125
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23126
+ * certain row may be the oldest so it walks the window. Narrow it
23127
+ * with {@link since} / {@link until}.
23128
+ */
23129
+ sortBy: FaceSortFieldEnum.optional(),
23130
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23131
+ sortDirection: FaceSortDirectionEnum.optional(),
23132
+ /**
23133
+ * Inline the base64 crop on every row.
23134
+ *
23135
+ * Default `false` since the 2026-08-25 inversion — see
23136
+ * `include-crops-default.ts`, which is the ONE place that resolves
23137
+ * this for every gallery, and which records why the inline shape had
23138
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23139
+ * The doc here used to still say `true`; it was wrong, and a leftover
23140
+ * that describes the old design reads as permission to rely on it.
23141
+ *
23142
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23143
+ * which the browser fetches off the `event-media` plane in parallel,
23144
+ * cached and ETagged.
22998
23145
  */
22999
23146
  includeCrops: boolean().optional()
23000
23147
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23030,13 +23177,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23030
23177
  }), method(object({
23031
23178
  threshold: number().min(0).max(1).optional(),
23032
23179
  minClusterSize: number().int().min(2).optional(),
23033
- limit: number().int().positive().optional()
23034
- }).optional(), array(object({
23035
- faceIds: array(string()).readonly(),
23036
- representativeFaceId: string(),
23037
- size: number().int(),
23038
- cohesion: number()
23039
- })).readonly());
23180
+ /**
23181
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23182
+ * which read as though it bounded the work — it never did.
23183
+ *
23184
+ * Wins over {@link limit} when both are sent.
23185
+ */
23186
+ maxClusters: number().int().positive().optional(),
23187
+ /**
23188
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23189
+ * RESULT, not the scan. Kept so existing callers keep working; send
23190
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23191
+ */
23192
+ limit: number().int().positive().optional(),
23193
+ /**
23194
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23195
+ * POOL, not the result.
23196
+ *
23197
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23198
+ * used to read every unassigned face on the hub no matter what the
23199
+ * caller asked for, because the only bound cut the finished clusters
23200
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23201
+ * whole corpus, on an addon whose disk is under contention.
23202
+ *
23203
+ * The pool is the NEWEST matching faces first — the same order the
23204
+ * gallery shows — so a bound here shortens the horizon, it does not
23205
+ * sample it randomly.
23206
+ *
23207
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23208
+ * so the live corpus — 372 face rows — is unaffected while the
23209
+ * unbounded scan can never come back as the table grows.
23210
+ */
23211
+ maxFacesScanned: number().int().positive().optional()
23212
+ }).optional(), array(FaceClusterSchema).readonly());
23040
23213
  /**
23041
23214
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23042
23215
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -26796,6 +26969,293 @@ var SetSiteLocationInputSchema = object({
26796
26969
  latitude: number().min(-90).max(90),
26797
26970
  longitude: number().min(-180).max(180)
26798
26971
  }).nullable();
26972
+ /**
26973
+ * The TRANSPORT a call arrived on.
26974
+ *
26975
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26976
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26977
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26978
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26979
+ * checkable rather than asserted.
26980
+ *
26981
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26982
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26983
+ * connection; the viewer talks to the hub over `wsLink`
26984
+ * exclusively, so this is the plane the HTTP census could not see.
26985
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26986
+ * never touches a socket and therefore never touched a census.
26987
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26988
+ * that is exactly what its `0` asserts: every plane the hub has can name
26989
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26990
+ * plane nobody instrumented lands here instead of vanishing from the total.
26991
+ */
26992
+ var TransportPlaneSchema = _enum([
26993
+ "http",
26994
+ "ws",
26995
+ "mesh",
26996
+ "unknown"
26997
+ ]);
26998
+ /**
26999
+ * Calls per plane. Every key is always present, `0` included — an absent plane
27000
+ * reads as "not instrumented", which is the one thing this census must never
27001
+ * make an operator wonder about.
27002
+ */
27003
+ var TransportPlaneCountsSchema = object({
27004
+ http: number(),
27005
+ ws: number(),
27006
+ mesh: number(),
27007
+ unknown: number()
27008
+ });
27009
+ /**
27010
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
27011
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
27012
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
27013
+ * already prints - never a token, never an `Authorization` header.
27014
+ *
27015
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
27016
+ * and lives for hours, so folding it into a call count makes one long-lived
27017
+ * stream look like a storm.
27018
+ */
27019
+ var RequestCensusGroupSchema = object({
27020
+ plane: TransportPlaneSchema,
27021
+ procedure: string(),
27022
+ userAgent: string(),
27023
+ ip: string(),
27024
+ principal: string(),
27025
+ calls: number(),
27026
+ subscriptions: number(),
27027
+ perMin: number()
27028
+ });
27029
+ /**
27030
+ * A procedure's TOTAL over the window, across every caller.
27031
+ *
27032
+ * This block, not the group list, is what answers "did these calls arrive over
27033
+ * HTTP at all". A total far BELOW what a store-side census counted over the
27034
+ * same window excludes the HTTP plane, which is a result, not a failure.
27035
+ */
27036
+ var RequestCensusProcedureSchema = object({
27037
+ procedure: string(),
27038
+ calls: number(),
27039
+ /**
27040
+ * The same total, split by transport. THIS is the row that answers the
27041
+ * question the census exists for: one look at `deviceManager.listAll` says
27042
+ * which plane carried the 4 960, without joining two log lines by eye.
27043
+ */
27044
+ planes: TransportPlaneCountsSchema,
27045
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
27046
+ subscriptions: number(),
27047
+ perMin: number()
27048
+ });
27049
+ /**
27050
+ * The census as an operator sees it.
27051
+ *
27052
+ * `persisted` is the honest answer to "will this survive the restart I am
27053
+ * about to do": the arm deadline is written to `system-settings` so a window
27054
+ * armed now can measure the NEXT boot, and a write that failed must not look
27055
+ * like one that succeeded.
27056
+ */
27057
+ var RequestCensusStatusSchema = object({
27058
+ armed: boolean(),
27059
+ /** How long the current - or just-closed - window collected, in ms. */
27060
+ elapsedMs: number(),
27061
+ /** The window actually armed, after the server clamped the request. */
27062
+ windowMs: number(),
27063
+ /** Epoch ms the window closes at. 0 when disarmed. */
27064
+ armedUntilMs: number(),
27065
+ httpRequests: number(),
27066
+ batchedRequests: number(),
27067
+ /**
27068
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
27069
+ * is in play (`?batch=1` carries several procedures in one request); this is
27070
+ * the number comparable with a store-side call count.
27071
+ */
27072
+ procedureCalls: number(),
27073
+ /**
27074
+ * `procedureCalls` split by transport. The four keys sum to
27075
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
27076
+ * `planesExplainTotal` is that identity, checked rather than assumed.
27077
+ */
27078
+ planes: TransportPlaneCountsSchema,
27079
+ /**
27080
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
27081
+ * on no plane at all - which is a RESULT (a plane is missing from the
27082
+ * instrument), not a failure, and it has to be visible to be read as one.
27083
+ */
27084
+ planesExplainTotal: boolean(),
27085
+ /**
27086
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
27087
+ * adapter resolves one context per connection - kept because a plane's call
27088
+ * count of zero against 37 open connections says something different from a
27089
+ * plane with no connections at all.
27090
+ */
27091
+ wsConnections: number(),
27092
+ /**
27093
+ * Client frames the WS plane looked at. `wsMessages` far above
27094
+ * `planes.ws + subscriptions` means most traffic is not operations
27095
+ * (keepalives, connection params) - which is itself an answer.
27096
+ */
27097
+ wsMessages: number(),
27098
+ /**
27099
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
27100
+ * purpose: one live-events stream opened at boot and held for six hours is
27101
+ * one subscription, and counting it as a call would let a quiet plane
27102
+ * masquerade as the storm.
27103
+ */
27104
+ subscriptions: number(),
27105
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
27106
+ subscriptionStops: number(),
27107
+ distinctGroups: number(),
27108
+ /**
27109
+ * Operations counted in the totals whose CALLER attribution was shed at the
27110
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
27111
+ * which transport they arrived on, they just lost their group row.
27112
+ */
27113
+ unattributedCalls: number(),
27114
+ procedures: array(RequestCensusProcedureSchema).readonly(),
27115
+ groups: array(RequestCensusGroupSchema).readonly()
27116
+ }).extend({ persisted: boolean() });
27117
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
27118
+ var LogLevelSchema$1 = _enum([
27119
+ "debug",
27120
+ "info",
27121
+ "warn",
27122
+ "error"
27123
+ ]);
27124
+ /**
27125
+ * The diagnostics that can be ARMED for a window. Exactly one today.
27126
+ *
27127
+ * A diagnostic is anything whose cost is only worth paying while a question is
27128
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
27129
+ */
27130
+ var DiagnosticIdSchema = _enum(["request-census"]);
27131
+ /**
27132
+ * The layers of the level hierarchy, general → specific. The most specific
27133
+ * layer that carries an explicit value wins.
27134
+ *
27135
+ * `component` is DECLARED and not yet resolvable: the per-component channels
27136
+ * are a later slice of the same plan, and a `levelSource` enum that has to
27137
+ * grow later would force every consumer of this document to change with it.
27138
+ * Nothing returns `component` today.
27139
+ */
27140
+ var LoggingScopeKindSchema = _enum([
27141
+ "cluster",
27142
+ "node",
27143
+ "component"
27144
+ ]);
27145
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
27146
+ var LoggingLevelSourceSchema = _enum([
27147
+ "default",
27148
+ "cluster",
27149
+ "node",
27150
+ "component"
27151
+ ]);
27152
+ /**
27153
+ * One layer of the hierarchy as it actually STANDS.
27154
+ *
27155
+ * `level: null` is the whole reason this array is returned: it is the
27156
+ * difference between "this node is at `info` because I decided it" and
27157
+ * "...because it inherits". An operator who clears an override believing they
27158
+ * are clearing an inherited value has been handed the same defect as the two
27159
+ * contradicting knobs this document exists to remove, moved one floor up.
27160
+ */
27161
+ var LoggingLevelLayerSchema = object({
27162
+ scope: LoggingScopeKindSchema,
27163
+ /** The node this layer speaks for; `null` on the cluster layer. */
27164
+ nodeId: string().nullable(),
27165
+ /** Explicitly set here, or `null` when this layer inherits. */
27166
+ level: LogLevelSchema$1.nullable()
27167
+ });
27168
+ /** What a line is judged against, and WHICH layer decided it. */
27169
+ var LoggingEffectiveSchema = object({
27170
+ level: LogLevelSchema$1,
27171
+ levelSource: LoggingLevelSourceSchema
27172
+ });
27173
+ /** Every layer, general → specific. Never collapsed into the effective value. */
27174
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
27175
+ /**
27176
+ * An armed diagnostic, with its DEADLINE.
27177
+ *
27178
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
27179
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
27180
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
27181
+ * `armed` is false — a window is never reported as slightly expired.
27182
+ */
27183
+ var DiagnosticWindowSchema = object({
27184
+ id: DiagnosticIdSchema,
27185
+ armed: boolean(),
27186
+ /** Epoch ms the window closes at. 0 when disarmed. */
27187
+ armedUntilMs: number(),
27188
+ /** Ms left before it expires on its own. 0 when disarmed. */
27189
+ remainingMs: number(),
27190
+ /** Whether the stored deadline is the one the live diagnostic is running —
27191
+ * i.e. whether this window would survive a restart. */
27192
+ persisted: boolean()
27193
+ });
27194
+ /**
27195
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
27196
+ * server — there is no maximum here on purpose: a bound repeated in a schema
27197
+ * is a second knob that disagrees with the first the day one of them moves.
27198
+ */
27199
+ var DiagnosticWindowPatchSchema = object({
27200
+ id: DiagnosticIdSchema,
27201
+ armMs: number().int().min(0),
27202
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
27203
+ reportEveryMs: number().int().positive().optional()
27204
+ });
27205
+ /**
27206
+ * A PATCH, and patches MERGE.
27207
+ *
27208
+ * A field absent from the patch is left exactly as it was — arming a
27209
+ * diagnostic never resets a level, and setting a level never disarms a window.
27210
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
27211
+ * `setAll` already merges, and rebuilding the object is how an absent field
27212
+ * turns into an erased one.
27213
+ */
27214
+ var LoggingSettingsPatchSchema = object({
27215
+ /**
27216
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
27217
+ * addressed scope so it inherits again. A value sets it.
27218
+ */
27219
+ level: LogLevelSchema$1.nullable().optional(),
27220
+ /**
27221
+ * Only the diagnostics NAMED here change. An armed window that is not listed
27222
+ * keeps running — a patch is never a full replacement.
27223
+ */
27224
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
27225
+ });
27226
+ /**
27227
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
27228
+ *
27229
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
27230
+ * input — the generated router strips it and uses it to resolve the PROVIDER
27231
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
27232
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
27233
+ * by an agent that holds no cluster document at all. The hub is the single
27234
+ * authority over the whole hierarchy and answers for every layer, so the
27235
+ * layer selector needs a name the transport does not already own.
27236
+ */
27237
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
27238
+ var SetLoggingSettingsInputSchema = object({
27239
+ scopeNodeId: string().optional(),
27240
+ patch: LoggingSettingsPatchSchema
27241
+ });
27242
+ /**
27243
+ * The whole document, as read and as returned after every write.
27244
+ *
27245
+ * `persisted: false` means the settings store could not be read or written.
27246
+ * The in-memory mirror still governs behaviour and is unchanged by the
27247
+ * failure — a read that fails neither switches a level nor disarms a window
27248
+ * (D49) — but the operator is told that what they are looking at would not
27249
+ * survive a restart.
27250
+ */
27251
+ var LoggingSettingsStateSchema = object({
27252
+ /** The layer this document was read at. `null` = the cluster layer. */
27253
+ scopeNodeId: string().nullable(),
27254
+ effective: LoggingEffectiveSchema,
27255
+ explicit: LoggingExplicitSchema,
27256
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
27257
+ persisted: boolean()
27258
+ });
26799
27259
  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(), {
26800
27260
  kind: "mutation",
26801
27261
  auth: "admin"
@@ -26808,6 +27268,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26808
27268
  }), method(_void(), SiteLocationStatusSchema, {
26809
27269
  kind: "mutation",
26810
27270
  auth: "admin"
27271
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27272
+ kind: "mutation",
27273
+ auth: "admin"
26811
27274
  });
26812
27275
  object({
26813
27276
  /** True when the device's tamper switch / case-open contact is
@@ -32655,6 +33118,18 @@ Object.freeze({
32655
33118
  addonId: null,
32656
33119
  access: "create"
32657
33120
  },
33121
+ "system.getLoggingSettings": {
33122
+ capName: "system",
33123
+ capScope: "system",
33124
+ addonId: null,
33125
+ access: "view"
33126
+ },
33127
+ "system.getRequestCensus": {
33128
+ capName: "system",
33129
+ capScope: "system",
33130
+ addonId: null,
33131
+ access: "view"
33132
+ },
32658
33133
  "system.getRetentionConfig": {
32659
33134
  capName: "system",
32660
33135
  capScope: "system",
@@ -32685,6 +33160,12 @@ Object.freeze({
32685
33160
  addonId: null,
32686
33161
  access: "view"
32687
33162
  },
33163
+ "system.setLoggingSettings": {
33164
+ capName: "system",
33165
+ capScope: "system",
33166
+ addonId: null,
33167
+ access: "create"
33168
+ },
32688
33169
  "system.setRetentionConfig": {
32689
33170
  capName: "system",
32690
33171
  capScope: "system",
@@ -33840,6 +34321,10 @@ Object.freeze({
33840
34321
  name: "deviceId",
33841
34322
  form: "single",
33842
34323
  optional: true
34324
+ }, {
34325
+ name: "deviceIds",
34326
+ form: "array",
34327
+ optional: true
33843
34328
  }],
33844
34329
  "fanControl.setDirection": [{
33845
34330
  name: "deviceId",
@@ -35450,7 +35935,38 @@ object({
35450
35935
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
35451
35936
  * reproduce that.
35452
35937
  */
35453
- tileBudgetMb: number().int().min(0).max(1024)
35938
+ tileBudgetMb: number().int().min(0).max(1024),
35939
+ /**
35940
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35941
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35942
+ * subject tiles, on frames that detected something.
35943
+ *
35944
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35945
+ * containment is strict by design, so the native `keyFrame`, the detail
35946
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35947
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35948
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35949
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35950
+ *
35951
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35952
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35953
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35954
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35955
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35956
+ * binds only through a detection burst, where it still covers well past the
35957
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35958
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35959
+ * whole shape exists to avoid.
35960
+ *
35961
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35962
+ * subject tile, so one shared budget would let a busy camera's key frames
35963
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35964
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35965
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35966
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35967
+ * nothing.
35968
+ */
35969
+ sceneBudgetMb: number().int().min(0).max(1024)
35454
35970
  });
35455
35971
  /**
35456
35972
  * The values in force when the operator has set nothing.
@@ -35466,12 +35982,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
35466
35982
  budgetMb: 1024,
35467
35983
  activityMs: 15e3,
35468
35984
  tileBudgetMb: 64,
35985
+ sceneBudgetMb: 48,
35469
35986
  admission: "inferred"
35470
35987
  };
35471
35988
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
35472
35989
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
35473
35990
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
35474
35991
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35992
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
35475
35993
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
35476
35994
  var MB = 1024 * 1024;
35477
35995
  1024 * MB, 3072 * MB;