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