@camstack/addon-mqtt-broker 1.2.31 → 1.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7550,6 +7550,66 @@ var OpsLogQueryInputSchema = object({
7550
7550
  /** Max rows returned, newest-first. */
7551
7551
  limit: number().int().min(1).max(1e3).optional()
7552
7552
  });
7553
+ var LabelDefinitionSchema = object({
7554
+ id: string(),
7555
+ name: string(),
7556
+ category: string().optional(),
7557
+ description: string().optional(),
7558
+ icon: string().optional()
7559
+ });
7560
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7561
+ var CLASS_MAP_MACRO_TARGETS = [
7562
+ "person",
7563
+ "vehicle",
7564
+ "animal",
7565
+ "package"
7566
+ ];
7567
+ /**
7568
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7569
+ * un operatore può selezionare.
7570
+ *
7571
+ * Sono le tre offerte dallo step `object-detection`
7572
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7573
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7574
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7575
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7576
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7577
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7578
+ *
7579
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7580
+ * dello step e una seconda volta come union `FirstLevelMacro`
7581
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7582
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7583
+ * successiva.
7584
+ */
7585
+ var FIRST_LEVEL_MACRO_CLASSES = [
7586
+ "person",
7587
+ "vehicle",
7588
+ "animal"
7589
+ ];
7590
+ /**
7591
+ * Wire schema for a per-model CATALOG classMap override
7592
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7593
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7594
+ * detection pipeline executor actually routes.
7595
+ *
7596
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7597
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7598
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7599
+ * enum) — the two used to share the name `ClassMapDefinition`/
7600
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7601
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7602
+ * are not: it is two different concepts colliding on a name. Keep this type
7603
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7604
+ * would either narrow every `ClassMapDefinition` consumer to the four
7605
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7606
+ * schema exists for (see the "rejects a classMap whose target is not a
7607
+ * detection macro" test in `model-catalog-schema.test.ts`).
7608
+ */
7609
+ var DetectionCatalogClassMapSchema = object({
7610
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7611
+ preserveOriginal: boolean()
7612
+ });
7553
7613
  /**
7554
7614
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7555
7615
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7572,10 +7632,55 @@ var RecordingStorageModeSchema = _enum([
7572
7632
  "events",
7573
7633
  "continuous"
7574
7634
  ]);
7635
+ /**
7636
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7637
+ * tre offerte dallo step `object-detection`, da UNA lista
7638
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7639
+ */
7640
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7641
+ /**
7642
+ * True quando `values` non ripete un elemento.
7643
+ *
7644
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7645
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7646
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7647
+ */
7648
+ var noDuplicates = (values) => new Set(values).size === values.length;
7575
7649
  /** Which detectors trigger an `events`-mode band. */
7576
7650
  var RecordingTriggersSchema = object({
7577
7651
  motion: boolean().optional(),
7578
- audioThresholdDbfs: number().optional()
7652
+ audioThresholdDbfs: number().optional(),
7653
+ /**
7654
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7655
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7656
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7657
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7658
+ *
7659
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7660
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7661
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7662
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7663
+ * finestre — vedi `recorder/object-trigger.ts`.
7664
+ */
7665
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7666
+ /**
7667
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7668
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7669
+ * `objectClasses`.
7670
+ *
7671
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7672
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7673
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7674
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7675
+ * device (D12) — mai un elenco globale di cap.
7676
+ *
7677
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7678
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7679
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7680
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7681
+ * registrare.
7682
+ */
7683
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7579
7684
  });
7580
7685
  /**
7581
7686
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8027,41 +8132,6 @@ var DecoderSessionConfigSchema = object({
8027
8132
  */
8028
8133
  debug: boolean().optional()
8029
8134
  });
8030
- var LabelDefinitionSchema = object({
8031
- id: string(),
8032
- name: string(),
8033
- category: string().optional(),
8034
- description: string().optional(),
8035
- icon: string().optional()
8036
- });
8037
- /**
8038
- * Wire schema for a per-model CATALOG classMap override
8039
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8040
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8041
- * detection pipeline executor actually routes.
8042
- *
8043
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8044
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8045
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8046
- * enum) — the two used to share the name `ClassMapDefinition`/
8047
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8048
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8049
- * are not: it is two different concepts colliding on a name. Keep this type
8050
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8051
- * would either narrow every `ClassMapDefinition` consumer to the four
8052
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8053
- * schema exists for (see the "rejects a classMap whose target is not a
8054
- * detection macro" test in `model-catalog-schema.test.ts`).
8055
- */
8056
- var DetectionCatalogClassMapSchema = object({
8057
- mapping: record(string(), _enum([
8058
- "person",
8059
- "vehicle",
8060
- "animal",
8061
- "package"
8062
- ])),
8063
- preserveOriginal: boolean()
8064
- });
8065
8135
  var MODEL_FORMATS = [
8066
8136
  "onnx",
8067
8137
  "coreml",
@@ -20903,7 +20973,7 @@ var lifecycleJobSchema = object({
20903
20973
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
20904
20974
  * as every other cap.
20905
20975
  */
20906
- var LogLevelSchema$1 = _enum([
20976
+ var LogLevelSchema$2 = _enum([
20907
20977
  "debug",
20908
20978
  "info",
20909
20979
  "warn",
@@ -21110,7 +21180,7 @@ var CustomActionInputSchema = object({
21110
21180
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21111
21181
  addonId: string(),
21112
21182
  limit: number().min(1).max(500).default(100),
21113
- level: LogLevelSchema$1.optional()
21183
+ level: LogLevelSchema$2.optional()
21114
21184
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21115
21185
  packageName: string(),
21116
21186
  version: string().optional()
@@ -21208,7 +21278,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21208
21278
  auth: "admin"
21209
21279
  }), method(object({
21210
21280
  addonId: string(),
21211
- level: LogLevelSchema$1.optional()
21281
+ level: LogLevelSchema$2.optional()
21212
21282
  }), LogStreamEntrySchema, { kind: "subscription" });
21213
21283
  object({
21214
21284
  /** Carbon dioxide concentration in ppm. */
@@ -22202,6 +22272,35 @@ var FaceFilterEnum = _enum([
22202
22272
  "identified",
22203
22273
  "all"
22204
22274
  ]);
22275
+ /**
22276
+ * What a `listRecentFaces` page is ORDERED BY.
22277
+ *
22278
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22279
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22280
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22281
+ * order: it puts the suggestions an operator can confirm with one tap at the
22282
+ * top, and it is the reason this enum exists — a client that ranked a capped
22283
+ * page client-side was ranking the newest N, never the most certain N.
22284
+ *
22285
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22286
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22287
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22288
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22289
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22290
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22291
+ * then by faceId, and is what makes this a total order instead of the
22292
+ * backend's NULL-collation accident.
22293
+ */
22294
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22295
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22296
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22297
+ * never leaves the server. */
22298
+ var FaceClusterSchema = object({
22299
+ faceIds: array(string()).readonly(),
22300
+ representativeFaceId: string(),
22301
+ size: number().int(),
22302
+ cohesion: number()
22303
+ });
22205
22304
  var MediaFileLiteSchema$1 = object({
22206
22305
  key: string(),
22207
22306
  kind: string(),
@@ -22248,24 +22347,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22248
22347
  kind: "mutation",
22249
22348
  auth: "admin"
22250
22349
  }), method(object({
22251
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22350
+ /**
22351
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22352
+ *
22353
+ * The legacy single-camera form, kept verbatim for every caller that
22354
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22355
+ * instead — never both: `deviceIds` is the authority whenever it is
22356
+ * present, and this field is then ignored rather than unioned, so
22357
+ * there is exactly one answer to "which cameras did I ask for".
22358
+ */
22252
22359
  deviceId: number().int().optional(),
22360
+ /**
22361
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22362
+ * until now had to fetch the cluster-wide page and drop rows in the
22363
+ * client (so the `limit` it asked for was spent on cameras it was
22364
+ * about to discard).
22365
+ *
22366
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22367
+ * "every camera". A request for no devices is a request, not an
22368
+ * omission; same contract as `deviceManager.listFleet` and
22369
+ * `pipelineAnalytics.listRecentTracks`.
22370
+ *
22371
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22372
+ */
22373
+ deviceIds: array(number().int()).optional(),
22253
22374
  limit: number().int().positive().optional(),
22254
22375
  filter: FaceFilterEnum.optional(),
22255
22376
  /**
22256
- * Inline the base64 crop on every row. Default `true` — the existing
22257
- * behaviour, kept so no caller breaks.
22377
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22378
+ * Absent means no lower bound.
22379
+ */
22380
+ since: number().int().optional(),
22381
+ /**
22382
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22383
+ * Absent means no upper bound.
22384
+ */
22385
+ until: number().int().optional(),
22386
+ /**
22387
+ * Order the page by time or by suggestion certainty. Default
22388
+ * `'timestamp'` — the historical order, unchanged for every caller
22389
+ * that does not ask.
22258
22390
  *
22259
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22260
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22261
- * the browser cache the images.
22391
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22392
+ * does under `'suggestionConfidence'`.
22262
22393
  *
22263
- * **This is an INPUT field, so it does not reach the addon until the
22264
- * next train.** The hub router validates cap inputs against its own
22265
- * compiled Zod, which strips a key it does not know — verified today
22266
- * on the OUTPUT side, where an additive field DOES arrive immediately
22267
- * (`Track.hasFace`). Until the train ships, sending `false` is
22268
- * harmless and simply keeps the crops inline.
22394
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22395
+ * index and stops reading as soon as `limit` rows have PASSED the
22396
+ * filter. `'suggestionConfidence'` cannot stop early — the most
22397
+ * certain row may be the oldest — so it walks the window. Narrow it
22398
+ * with {@link since} / {@link until}.
22399
+ */
22400
+ sortBy: FaceSortFieldEnum.optional(),
22401
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22402
+ sortDirection: FaceSortDirectionEnum.optional(),
22403
+ /**
22404
+ * Inline the base64 crop on every row.
22405
+ *
22406
+ * Default `false` since the 2026-08-25 inversion — see
22407
+ * `include-crops-default.ts`, which is the ONE place that resolves
22408
+ * this for every gallery, and which records why the inline shape had
22409
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22410
+ * The doc here used to still say `true`; it was wrong, and a leftover
22411
+ * that describes the old design reads as permission to rely on it.
22412
+ *
22413
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22414
+ * which the browser fetches off the `event-media` plane in parallel,
22415
+ * cached and ETagged.
22269
22416
  */
22270
22417
  includeCrops: boolean().optional()
22271
22418
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22301,13 +22448,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22301
22448
  }), method(object({
22302
22449
  threshold: number().min(0).max(1).optional(),
22303
22450
  minClusterSize: number().int().min(2).optional(),
22304
- limit: number().int().positive().optional()
22305
- }).optional(), array(object({
22306
- faceIds: array(string()).readonly(),
22307
- representativeFaceId: string(),
22308
- size: number().int(),
22309
- cohesion: number()
22310
- })).readonly());
22451
+ /**
22452
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22453
+ * which read as though it bounded the work — it never did.
22454
+ *
22455
+ * Wins over {@link limit} when both are sent.
22456
+ */
22457
+ maxClusters: number().int().positive().optional(),
22458
+ /**
22459
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22460
+ * RESULT, not the scan. Kept so existing callers keep working; send
22461
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22462
+ */
22463
+ limit: number().int().positive().optional(),
22464
+ /**
22465
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22466
+ * POOL, not the result.
22467
+ *
22468
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22469
+ * used to read every unassigned face on the hub no matter what the
22470
+ * caller asked for, because the only bound cut the finished clusters
22471
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22472
+ * whole corpus, on an addon whose disk is under contention.
22473
+ *
22474
+ * The pool is the NEWEST matching faces first — the same order the
22475
+ * gallery shows — so a bound here shortens the horizon, it does not
22476
+ * sample it randomly.
22477
+ *
22478
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22479
+ * so the live corpus — 372 face rows — is unaffected while the
22480
+ * unbounded scan can never come back as the table grows.
22481
+ */
22482
+ maxFacesScanned: number().int().positive().optional()
22483
+ }).optional(), array(FaceClusterSchema).readonly());
22311
22484
  /**
22312
22485
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22313
22486
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -26030,6 +26203,293 @@ var SetSiteLocationInputSchema = object({
26030
26203
  latitude: number().min(-90).max(90),
26031
26204
  longitude: number().min(-180).max(180)
26032
26205
  }).nullable();
26206
+ /**
26207
+ * The TRANSPORT a call arrived on.
26208
+ *
26209
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26210
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26211
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26212
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26213
+ * checkable rather than asserted.
26214
+ *
26215
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26216
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26217
+ * connection; the viewer talks to the hub over `wsLink`
26218
+ * exclusively, so this is the plane the HTTP census could not see.
26219
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26220
+ * never touches a socket and therefore never touched a census.
26221
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26222
+ * that is exactly what its `0` asserts: every plane the hub has can name
26223
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26224
+ * plane nobody instrumented lands here instead of vanishing from the total.
26225
+ */
26226
+ var TransportPlaneSchema = _enum([
26227
+ "http",
26228
+ "ws",
26229
+ "mesh",
26230
+ "unknown"
26231
+ ]);
26232
+ /**
26233
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26234
+ * reads as "not instrumented", which is the one thing this census must never
26235
+ * make an operator wonder about.
26236
+ */
26237
+ var TransportPlaneCountsSchema = object({
26238
+ http: number(),
26239
+ ws: number(),
26240
+ mesh: number(),
26241
+ unknown: number()
26242
+ });
26243
+ /**
26244
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26245
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26246
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26247
+ * already prints - never a token, never an `Authorization` header.
26248
+ *
26249
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26250
+ * and lives for hours, so folding it into a call count makes one long-lived
26251
+ * stream look like a storm.
26252
+ */
26253
+ var RequestCensusGroupSchema = object({
26254
+ plane: TransportPlaneSchema,
26255
+ procedure: string(),
26256
+ userAgent: string(),
26257
+ ip: string(),
26258
+ principal: string(),
26259
+ calls: number(),
26260
+ subscriptions: number(),
26261
+ perMin: number()
26262
+ });
26263
+ /**
26264
+ * A procedure's TOTAL over the window, across every caller.
26265
+ *
26266
+ * This block, not the group list, is what answers "did these calls arrive over
26267
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26268
+ * same window excludes the HTTP plane, which is a result, not a failure.
26269
+ */
26270
+ var RequestCensusProcedureSchema = object({
26271
+ procedure: string(),
26272
+ calls: number(),
26273
+ /**
26274
+ * The same total, split by transport. THIS is the row that answers the
26275
+ * question the census exists for: one look at `deviceManager.listAll` says
26276
+ * which plane carried the 4 960, without joining two log lines by eye.
26277
+ */
26278
+ planes: TransportPlaneCountsSchema,
26279
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26280
+ subscriptions: number(),
26281
+ perMin: number()
26282
+ });
26283
+ /**
26284
+ * The census as an operator sees it.
26285
+ *
26286
+ * `persisted` is the honest answer to "will this survive the restart I am
26287
+ * about to do": the arm deadline is written to `system-settings` so a window
26288
+ * armed now can measure the NEXT boot, and a write that failed must not look
26289
+ * like one that succeeded.
26290
+ */
26291
+ var RequestCensusStatusSchema = object({
26292
+ armed: boolean(),
26293
+ /** How long the current - or just-closed - window collected, in ms. */
26294
+ elapsedMs: number(),
26295
+ /** The window actually armed, after the server clamped the request. */
26296
+ windowMs: number(),
26297
+ /** Epoch ms the window closes at. 0 when disarmed. */
26298
+ armedUntilMs: number(),
26299
+ httpRequests: number(),
26300
+ batchedRequests: number(),
26301
+ /**
26302
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26303
+ * is in play (`?batch=1` carries several procedures in one request); this is
26304
+ * the number comparable with a store-side call count.
26305
+ */
26306
+ procedureCalls: number(),
26307
+ /**
26308
+ * `procedureCalls` split by transport. The four keys sum to
26309
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26310
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26311
+ */
26312
+ planes: TransportPlaneCountsSchema,
26313
+ /**
26314
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26315
+ * on no plane at all - which is a RESULT (a plane is missing from the
26316
+ * instrument), not a failure, and it has to be visible to be read as one.
26317
+ */
26318
+ planesExplainTotal: boolean(),
26319
+ /**
26320
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26321
+ * adapter resolves one context per connection - kept because a plane's call
26322
+ * count of zero against 37 open connections says something different from a
26323
+ * plane with no connections at all.
26324
+ */
26325
+ wsConnections: number(),
26326
+ /**
26327
+ * Client frames the WS plane looked at. `wsMessages` far above
26328
+ * `planes.ws + subscriptions` means most traffic is not operations
26329
+ * (keepalives, connection params) - which is itself an answer.
26330
+ */
26331
+ wsMessages: number(),
26332
+ /**
26333
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26334
+ * purpose: one live-events stream opened at boot and held for six hours is
26335
+ * one subscription, and counting it as a call would let a quiet plane
26336
+ * masquerade as the storm.
26337
+ */
26338
+ subscriptions: number(),
26339
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26340
+ subscriptionStops: number(),
26341
+ distinctGroups: number(),
26342
+ /**
26343
+ * Operations counted in the totals whose CALLER attribution was shed at the
26344
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26345
+ * which transport they arrived on, they just lost their group row.
26346
+ */
26347
+ unattributedCalls: number(),
26348
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26349
+ groups: array(RequestCensusGroupSchema).readonly()
26350
+ }).extend({ persisted: boolean() });
26351
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26352
+ var LogLevelSchema$1 = _enum([
26353
+ "debug",
26354
+ "info",
26355
+ "warn",
26356
+ "error"
26357
+ ]);
26358
+ /**
26359
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26360
+ *
26361
+ * A diagnostic is anything whose cost is only worth paying while a question is
26362
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26363
+ */
26364
+ var DiagnosticIdSchema = _enum(["request-census"]);
26365
+ /**
26366
+ * The layers of the level hierarchy, general → specific. The most specific
26367
+ * layer that carries an explicit value wins.
26368
+ *
26369
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26370
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26371
+ * grow later would force every consumer of this document to change with it.
26372
+ * Nothing returns `component` today.
26373
+ */
26374
+ var LoggingScopeKindSchema = _enum([
26375
+ "cluster",
26376
+ "node",
26377
+ "component"
26378
+ ]);
26379
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26380
+ var LoggingLevelSourceSchema = _enum([
26381
+ "default",
26382
+ "cluster",
26383
+ "node",
26384
+ "component"
26385
+ ]);
26386
+ /**
26387
+ * One layer of the hierarchy as it actually STANDS.
26388
+ *
26389
+ * `level: null` is the whole reason this array is returned: it is the
26390
+ * difference between "this node is at `info` because I decided it" and
26391
+ * "...because it inherits". An operator who clears an override believing they
26392
+ * are clearing an inherited value has been handed the same defect as the two
26393
+ * contradicting knobs this document exists to remove, moved one floor up.
26394
+ */
26395
+ var LoggingLevelLayerSchema = object({
26396
+ scope: LoggingScopeKindSchema,
26397
+ /** The node this layer speaks for; `null` on the cluster layer. */
26398
+ nodeId: string().nullable(),
26399
+ /** Explicitly set here, or `null` when this layer inherits. */
26400
+ level: LogLevelSchema$1.nullable()
26401
+ });
26402
+ /** What a line is judged against, and WHICH layer decided it. */
26403
+ var LoggingEffectiveSchema = object({
26404
+ level: LogLevelSchema$1,
26405
+ levelSource: LoggingLevelSourceSchema
26406
+ });
26407
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26408
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26409
+ /**
26410
+ * An armed diagnostic, with its DEADLINE.
26411
+ *
26412
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26413
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26414
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26415
+ * `armed` is false — a window is never reported as slightly expired.
26416
+ */
26417
+ var DiagnosticWindowSchema = object({
26418
+ id: DiagnosticIdSchema,
26419
+ armed: boolean(),
26420
+ /** Epoch ms the window closes at. 0 when disarmed. */
26421
+ armedUntilMs: number(),
26422
+ /** Ms left before it expires on its own. 0 when disarmed. */
26423
+ remainingMs: number(),
26424
+ /** Whether the stored deadline is the one the live diagnostic is running —
26425
+ * i.e. whether this window would survive a restart. */
26426
+ persisted: boolean()
26427
+ });
26428
+ /**
26429
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26430
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26431
+ * is a second knob that disagrees with the first the day one of them moves.
26432
+ */
26433
+ var DiagnosticWindowPatchSchema = object({
26434
+ id: DiagnosticIdSchema,
26435
+ armMs: number().int().min(0),
26436
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26437
+ reportEveryMs: number().int().positive().optional()
26438
+ });
26439
+ /**
26440
+ * A PATCH, and patches MERGE.
26441
+ *
26442
+ * A field absent from the patch is left exactly as it was — arming a
26443
+ * diagnostic never resets a level, and setting a level never disarms a window.
26444
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26445
+ * `setAll` already merges, and rebuilding the object is how an absent field
26446
+ * turns into an erased one.
26447
+ */
26448
+ var LoggingSettingsPatchSchema = object({
26449
+ /**
26450
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26451
+ * addressed scope so it inherits again. A value sets it.
26452
+ */
26453
+ level: LogLevelSchema$1.nullable().optional(),
26454
+ /**
26455
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26456
+ * keeps running — a patch is never a full replacement.
26457
+ */
26458
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26459
+ });
26460
+ /**
26461
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26462
+ *
26463
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26464
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26465
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26466
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26467
+ * by an agent that holds no cluster document at all. The hub is the single
26468
+ * authority over the whole hierarchy and answers for every layer, so the
26469
+ * layer selector needs a name the transport does not already own.
26470
+ */
26471
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26472
+ var SetLoggingSettingsInputSchema = object({
26473
+ scopeNodeId: string().optional(),
26474
+ patch: LoggingSettingsPatchSchema
26475
+ });
26476
+ /**
26477
+ * The whole document, as read and as returned after every write.
26478
+ *
26479
+ * `persisted: false` means the settings store could not be read or written.
26480
+ * The in-memory mirror still governs behaviour and is unchanged by the
26481
+ * failure — a read that fails neither switches a level nor disarms a window
26482
+ * (D49) — but the operator is told that what they are looking at would not
26483
+ * survive a restart.
26484
+ */
26485
+ var LoggingSettingsStateSchema = object({
26486
+ /** The layer this document was read at. `null` = the cluster layer. */
26487
+ scopeNodeId: string().nullable(),
26488
+ effective: LoggingEffectiveSchema,
26489
+ explicit: LoggingExplicitSchema,
26490
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26491
+ persisted: boolean()
26492
+ });
26033
26493
  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(), {
26034
26494
  kind: "mutation",
26035
26495
  auth: "admin"
@@ -26042,6 +26502,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26042
26502
  }), method(_void(), SiteLocationStatusSchema, {
26043
26503
  kind: "mutation",
26044
26504
  auth: "admin"
26505
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26506
+ kind: "mutation",
26507
+ auth: "admin"
26045
26508
  });
26046
26509
  object({
26047
26510
  /** True when the device's tamper switch / case-open contact is
@@ -31873,6 +32336,18 @@ Object.freeze({
31873
32336
  addonId: null,
31874
32337
  access: "create"
31875
32338
  },
32339
+ "system.getLoggingSettings": {
32340
+ capName: "system",
32341
+ capScope: "system",
32342
+ addonId: null,
32343
+ access: "view"
32344
+ },
32345
+ "system.getRequestCensus": {
32346
+ capName: "system",
32347
+ capScope: "system",
32348
+ addonId: null,
32349
+ access: "view"
32350
+ },
31876
32351
  "system.getRetentionConfig": {
31877
32352
  capName: "system",
31878
32353
  capScope: "system",
@@ -31903,6 +32378,12 @@ Object.freeze({
31903
32378
  addonId: null,
31904
32379
  access: "view"
31905
32380
  },
32381
+ "system.setLoggingSettings": {
32382
+ capName: "system",
32383
+ capScope: "system",
32384
+ addonId: null,
32385
+ access: "create"
32386
+ },
31906
32387
  "system.setRetentionConfig": {
31907
32388
  capName: "system",
31908
32389
  capScope: "system",
@@ -33058,6 +33539,10 @@ Object.freeze({
33058
33539
  name: "deviceId",
33059
33540
  form: "single",
33060
33541
  optional: true
33542
+ }, {
33543
+ name: "deviceIds",
33544
+ form: "array",
33545
+ optional: true
33061
33546
  }],
33062
33547
  "fanControl.setDirection": [{
33063
33548
  name: "deviceId",
@@ -34668,7 +35153,38 @@ object({
34668
35153
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34669
35154
  * reproduce that.
34670
35155
  */
34671
- tileBudgetMb: number().int().min(0).max(1024)
35156
+ tileBudgetMb: number().int().min(0).max(1024),
35157
+ /**
35158
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35159
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35160
+ * subject tiles, on frames that detected something.
35161
+ *
35162
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35163
+ * containment is strict by design, so the native `keyFrame`, the detail
35164
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35165
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35166
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35167
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35168
+ *
35169
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35170
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35171
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35172
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35173
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35174
+ * binds only through a detection burst, where it still covers well past the
35175
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35176
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35177
+ * whole shape exists to avoid.
35178
+ *
35179
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35180
+ * subject tile, so one shared budget would let a busy camera's key frames
35181
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35182
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35183
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35184
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35185
+ * nothing.
35186
+ */
35187
+ sceneBudgetMb: number().int().min(0).max(1024)
34672
35188
  });
34673
35189
  /**
34674
35190
  * The values in force when the operator has set nothing.
@@ -34684,12 +35200,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34684
35200
  budgetMb: 1024,
34685
35201
  activityMs: 15e3,
34686
35202
  tileBudgetMb: 64,
35203
+ sceneBudgetMb: 48,
34687
35204
  admission: "inferred"
34688
35205
  };
34689
35206
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34690
35207
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34691
35208
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34692
35209
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35210
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34693
35211
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34694
35212
  var MB = 1024 * 1024;
34695
35213
  1024 * MB, 3072 * MB;