@camstack/addon-decoder-nodeav 1.2.30 → 1.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +577 -59
  2. package/dist/index.mjs +577 -59
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7526,6 +7526,66 @@ var OpsLogQueryInputSchema = object({
7526
7526
  /** Max rows returned, newest-first. */
7527
7527
  limit: number().int().min(1).max(1e3).optional()
7528
7528
  });
7529
+ var LabelDefinitionSchema = object({
7530
+ id: string(),
7531
+ name: string(),
7532
+ category: string().optional(),
7533
+ description: string().optional(),
7534
+ icon: string().optional()
7535
+ });
7536
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7537
+ var CLASS_MAP_MACRO_TARGETS = [
7538
+ "person",
7539
+ "vehicle",
7540
+ "animal",
7541
+ "package"
7542
+ ];
7543
+ /**
7544
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7545
+ * un operatore può selezionare.
7546
+ *
7547
+ * Sono le tre offerte dallo step `object-detection`
7548
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7549
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7550
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7551
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7552
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7553
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7554
+ *
7555
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7556
+ * dello step e una seconda volta come union `FirstLevelMacro`
7557
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7558
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7559
+ * successiva.
7560
+ */
7561
+ var FIRST_LEVEL_MACRO_CLASSES = [
7562
+ "person",
7563
+ "vehicle",
7564
+ "animal"
7565
+ ];
7566
+ /**
7567
+ * Wire schema for a per-model CATALOG classMap override
7568
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7569
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7570
+ * detection pipeline executor actually routes.
7571
+ *
7572
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7573
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7574
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7575
+ * enum) — the two used to share the name `ClassMapDefinition`/
7576
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7577
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7578
+ * are not: it is two different concepts colliding on a name. Keep this type
7579
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7580
+ * would either narrow every `ClassMapDefinition` consumer to the four
7581
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7582
+ * schema exists for (see the "rejects a classMap whose target is not a
7583
+ * detection macro" test in `model-catalog-schema.test.ts`).
7584
+ */
7585
+ var DetectionCatalogClassMapSchema = object({
7586
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7587
+ preserveOriginal: boolean()
7588
+ });
7529
7589
  /**
7530
7590
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7531
7591
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7548,10 +7608,55 @@ var RecordingStorageModeSchema = _enum([
7548
7608
  "events",
7549
7609
  "continuous"
7550
7610
  ]);
7611
+ /**
7612
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7613
+ * tre offerte dallo step `object-detection`, da UNA lista
7614
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7615
+ */
7616
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7617
+ /**
7618
+ * True quando `values` non ripete un elemento.
7619
+ *
7620
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7621
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7622
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7623
+ */
7624
+ var noDuplicates = (values) => new Set(values).size === values.length;
7551
7625
  /** Which detectors trigger an `events`-mode band. */
7552
7626
  var RecordingTriggersSchema = object({
7553
7627
  motion: boolean().optional(),
7554
- audioThresholdDbfs: number().optional()
7628
+ audioThresholdDbfs: number().optional(),
7629
+ /**
7630
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7631
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7632
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7633
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7634
+ *
7635
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7636
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7637
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7638
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7639
+ * finestre — vedi `recorder/object-trigger.ts`.
7640
+ */
7641
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7642
+ /**
7643
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7644
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7645
+ * `objectClasses`.
7646
+ *
7647
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7648
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7649
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7650
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7651
+ * device (D12) — mai un elenco globale di cap.
7652
+ *
7653
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7654
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7655
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7656
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7657
+ * registrare.
7658
+ */
7659
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7555
7660
  });
7556
7661
  /**
7557
7662
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8003,41 +8108,6 @@ var DecoderSessionConfigSchema = object({
8003
8108
  */
8004
8109
  debug: boolean().optional()
8005
8110
  });
8006
- var LabelDefinitionSchema = object({
8007
- id: string(),
8008
- name: string(),
8009
- category: string().optional(),
8010
- description: string().optional(),
8011
- icon: string().optional()
8012
- });
8013
- /**
8014
- * Wire schema for a per-model CATALOG classMap override
8015
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8016
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8017
- * detection pipeline executor actually routes.
8018
- *
8019
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8020
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8021
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8022
- * enum) — the two used to share the name `ClassMapDefinition`/
8023
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8024
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8025
- * are not: it is two different concepts colliding on a name. Keep this type
8026
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8027
- * would either narrow every `ClassMapDefinition` consumer to the four
8028
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8029
- * schema exists for (see the "rejects a classMap whose target is not a
8030
- * detection macro" test in `model-catalog-schema.test.ts`).
8031
- */
8032
- var DetectionCatalogClassMapSchema = object({
8033
- mapping: record(string(), _enum([
8034
- "person",
8035
- "vehicle",
8036
- "animal",
8037
- "package"
8038
- ])),
8039
- preserveOriginal: boolean()
8040
- });
8041
8111
  var MODEL_FORMATS = [
8042
8112
  "onnx",
8043
8113
  "coreml",
@@ -20941,7 +21011,7 @@ var lifecycleJobSchema = object({
20941
21011
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
20942
21012
  * as every other cap.
20943
21013
  */
20944
- var LogLevelSchema$1 = _enum([
21014
+ var LogLevelSchema$2 = _enum([
20945
21015
  "debug",
20946
21016
  "info",
20947
21017
  "warn",
@@ -21148,7 +21218,7 @@ var CustomActionInputSchema = object({
21148
21218
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21149
21219
  addonId: string(),
21150
21220
  limit: number().min(1).max(500).default(100),
21151
- level: LogLevelSchema$1.optional()
21221
+ level: LogLevelSchema$2.optional()
21152
21222
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21153
21223
  packageName: string(),
21154
21224
  version: string().optional()
@@ -21246,7 +21316,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21246
21316
  auth: "admin"
21247
21317
  }), method(object({
21248
21318
  addonId: string(),
21249
- level: LogLevelSchema$1.optional()
21319
+ level: LogLevelSchema$2.optional()
21250
21320
  }), LogStreamEntrySchema, { kind: "subscription" });
21251
21321
  object({
21252
21322
  /** Carbon dioxide concentration in ppm. */
@@ -22240,6 +22310,35 @@ var FaceFilterEnum = _enum([
22240
22310
  "identified",
22241
22311
  "all"
22242
22312
  ]);
22313
+ /**
22314
+ * What a `listRecentFaces` page is ORDERED BY.
22315
+ *
22316
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22317
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22318
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22319
+ * order: it puts the suggestions an operator can confirm with one tap at the
22320
+ * top, and it is the reason this enum exists — a client that ranked a capped
22321
+ * page client-side was ranking the newest N, never the most certain N.
22322
+ *
22323
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22324
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22325
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22326
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22327
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22328
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22329
+ * then by faceId, and is what makes this a total order instead of the
22330
+ * backend's NULL-collation accident.
22331
+ */
22332
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22333
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22334
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22335
+ * never leaves the server. */
22336
+ var FaceClusterSchema = object({
22337
+ faceIds: array(string()).readonly(),
22338
+ representativeFaceId: string(),
22339
+ size: number().int(),
22340
+ cohesion: number()
22341
+ });
22243
22342
  var MediaFileLiteSchema$1 = object({
22244
22343
  key: string(),
22245
22344
  kind: string(),
@@ -22286,24 +22385,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22286
22385
  kind: "mutation",
22287
22386
  auth: "admin"
22288
22387
  }), method(object({
22289
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22388
+ /**
22389
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22390
+ *
22391
+ * The legacy single-camera form, kept verbatim for every caller that
22392
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22393
+ * instead — never both: `deviceIds` is the authority whenever it is
22394
+ * present, and this field is then ignored rather than unioned, so
22395
+ * there is exactly one answer to "which cameras did I ask for".
22396
+ */
22290
22397
  deviceId: number().int().optional(),
22398
+ /**
22399
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22400
+ * until now had to fetch the cluster-wide page and drop rows in the
22401
+ * client (so the `limit` it asked for was spent on cameras it was
22402
+ * about to discard).
22403
+ *
22404
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22405
+ * "every camera". A request for no devices is a request, not an
22406
+ * omission; same contract as `deviceManager.listFleet` and
22407
+ * `pipelineAnalytics.listRecentTracks`.
22408
+ *
22409
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22410
+ */
22411
+ deviceIds: array(number().int()).optional(),
22291
22412
  limit: number().int().positive().optional(),
22292
22413
  filter: FaceFilterEnum.optional(),
22293
22414
  /**
22294
- * Inline the base64 crop on every row. Default `true` — the existing
22295
- * behaviour, kept so no caller breaks.
22415
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22416
+ * Absent means no lower bound.
22417
+ */
22418
+ since: number().int().optional(),
22419
+ /**
22420
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22421
+ * Absent means no upper bound.
22422
+ */
22423
+ until: number().int().optional(),
22424
+ /**
22425
+ * Order the page by time or by suggestion certainty. Default
22426
+ * `'timestamp'` — the historical order, unchanged for every caller
22427
+ * that does not ask.
22296
22428
  *
22297
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22298
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22299
- * the browser cache the images.
22429
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22430
+ * does under `'suggestionConfidence'`.
22300
22431
  *
22301
- * **This is an INPUT field, so it does not reach the addon until the
22302
- * next train.** The hub router validates cap inputs against its own
22303
- * compiled Zod, which strips a key it does not know verified today
22304
- * on the OUTPUT side, where an additive field DOES arrive immediately
22305
- * (`Track.hasFace`). Until the train ships, sending `false` is
22306
- * harmless and simply keeps the crops inline.
22432
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22433
+ * index and stops reading as soon as `limit` rows have PASSED the
22434
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
22435
+ * certain row may be the oldest so it walks the window. Narrow it
22436
+ * with {@link since} / {@link until}.
22437
+ */
22438
+ sortBy: FaceSortFieldEnum.optional(),
22439
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22440
+ sortDirection: FaceSortDirectionEnum.optional(),
22441
+ /**
22442
+ * Inline the base64 crop on every row.
22443
+ *
22444
+ * Default `false` since the 2026-08-25 inversion — see
22445
+ * `include-crops-default.ts`, which is the ONE place that resolves
22446
+ * this for every gallery, and which records why the inline shape had
22447
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22448
+ * The doc here used to still say `true`; it was wrong, and a leftover
22449
+ * that describes the old design reads as permission to rely on it.
22450
+ *
22451
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22452
+ * which the browser fetches off the `event-media` plane in parallel,
22453
+ * cached and ETagged.
22307
22454
  */
22308
22455
  includeCrops: boolean().optional()
22309
22456
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22339,13 +22486,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22339
22486
  }), method(object({
22340
22487
  threshold: number().min(0).max(1).optional(),
22341
22488
  minClusterSize: number().int().min(2).optional(),
22342
- limit: number().int().positive().optional()
22343
- }).optional(), array(object({
22344
- faceIds: array(string()).readonly(),
22345
- representativeFaceId: string(),
22346
- size: number().int(),
22347
- cohesion: number()
22348
- })).readonly());
22489
+ /**
22490
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22491
+ * which read as though it bounded the work — it never did.
22492
+ *
22493
+ * Wins over {@link limit} when both are sent.
22494
+ */
22495
+ maxClusters: number().int().positive().optional(),
22496
+ /**
22497
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22498
+ * RESULT, not the scan. Kept so existing callers keep working; send
22499
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22500
+ */
22501
+ limit: number().int().positive().optional(),
22502
+ /**
22503
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22504
+ * POOL, not the result.
22505
+ *
22506
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22507
+ * used to read every unassigned face on the hub no matter what the
22508
+ * caller asked for, because the only bound cut the finished clusters
22509
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22510
+ * whole corpus, on an addon whose disk is under contention.
22511
+ *
22512
+ * The pool is the NEWEST matching faces first — the same order the
22513
+ * gallery shows — so a bound here shortens the horizon, it does not
22514
+ * sample it randomly.
22515
+ *
22516
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22517
+ * so the live corpus — 372 face rows — is unaffected while the
22518
+ * unbounded scan can never come back as the table grows.
22519
+ */
22520
+ maxFacesScanned: number().int().positive().optional()
22521
+ }).optional(), array(FaceClusterSchema).readonly());
22349
22522
  /**
22350
22523
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22351
22524
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -26068,6 +26241,293 @@ var SetSiteLocationInputSchema = object({
26068
26241
  latitude: number().min(-90).max(90),
26069
26242
  longitude: number().min(-180).max(180)
26070
26243
  }).nullable();
26244
+ /**
26245
+ * The TRANSPORT a call arrived on.
26246
+ *
26247
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26248
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26249
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26250
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26251
+ * checkable rather than asserted.
26252
+ *
26253
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26254
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26255
+ * connection; the viewer talks to the hub over `wsLink`
26256
+ * exclusively, so this is the plane the HTTP census could not see.
26257
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26258
+ * never touches a socket and therefore never touched a census.
26259
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26260
+ * that is exactly what its `0` asserts: every plane the hub has can name
26261
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26262
+ * plane nobody instrumented lands here instead of vanishing from the total.
26263
+ */
26264
+ var TransportPlaneSchema = _enum([
26265
+ "http",
26266
+ "ws",
26267
+ "mesh",
26268
+ "unknown"
26269
+ ]);
26270
+ /**
26271
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26272
+ * reads as "not instrumented", which is the one thing this census must never
26273
+ * make an operator wonder about.
26274
+ */
26275
+ var TransportPlaneCountsSchema = object({
26276
+ http: number(),
26277
+ ws: number(),
26278
+ mesh: number(),
26279
+ unknown: number()
26280
+ });
26281
+ /**
26282
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26283
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26284
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26285
+ * already prints - never a token, never an `Authorization` header.
26286
+ *
26287
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26288
+ * and lives for hours, so folding it into a call count makes one long-lived
26289
+ * stream look like a storm.
26290
+ */
26291
+ var RequestCensusGroupSchema = object({
26292
+ plane: TransportPlaneSchema,
26293
+ procedure: string(),
26294
+ userAgent: string(),
26295
+ ip: string(),
26296
+ principal: string(),
26297
+ calls: number(),
26298
+ subscriptions: number(),
26299
+ perMin: number()
26300
+ });
26301
+ /**
26302
+ * A procedure's TOTAL over the window, across every caller.
26303
+ *
26304
+ * This block, not the group list, is what answers "did these calls arrive over
26305
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26306
+ * same window excludes the HTTP plane, which is a result, not a failure.
26307
+ */
26308
+ var RequestCensusProcedureSchema = object({
26309
+ procedure: string(),
26310
+ calls: number(),
26311
+ /**
26312
+ * The same total, split by transport. THIS is the row that answers the
26313
+ * question the census exists for: one look at `deviceManager.listAll` says
26314
+ * which plane carried the 4 960, without joining two log lines by eye.
26315
+ */
26316
+ planes: TransportPlaneCountsSchema,
26317
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26318
+ subscriptions: number(),
26319
+ perMin: number()
26320
+ });
26321
+ /**
26322
+ * The census as an operator sees it.
26323
+ *
26324
+ * `persisted` is the honest answer to "will this survive the restart I am
26325
+ * about to do": the arm deadline is written to `system-settings` so a window
26326
+ * armed now can measure the NEXT boot, and a write that failed must not look
26327
+ * like one that succeeded.
26328
+ */
26329
+ var RequestCensusStatusSchema = object({
26330
+ armed: boolean(),
26331
+ /** How long the current - or just-closed - window collected, in ms. */
26332
+ elapsedMs: number(),
26333
+ /** The window actually armed, after the server clamped the request. */
26334
+ windowMs: number(),
26335
+ /** Epoch ms the window closes at. 0 when disarmed. */
26336
+ armedUntilMs: number(),
26337
+ httpRequests: number(),
26338
+ batchedRequests: number(),
26339
+ /**
26340
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26341
+ * is in play (`?batch=1` carries several procedures in one request); this is
26342
+ * the number comparable with a store-side call count.
26343
+ */
26344
+ procedureCalls: number(),
26345
+ /**
26346
+ * `procedureCalls` split by transport. The four keys sum to
26347
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26348
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26349
+ */
26350
+ planes: TransportPlaneCountsSchema,
26351
+ /**
26352
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26353
+ * on no plane at all - which is a RESULT (a plane is missing from the
26354
+ * instrument), not a failure, and it has to be visible to be read as one.
26355
+ */
26356
+ planesExplainTotal: boolean(),
26357
+ /**
26358
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26359
+ * adapter resolves one context per connection - kept because a plane's call
26360
+ * count of zero against 37 open connections says something different from a
26361
+ * plane with no connections at all.
26362
+ */
26363
+ wsConnections: number(),
26364
+ /**
26365
+ * Client frames the WS plane looked at. `wsMessages` far above
26366
+ * `planes.ws + subscriptions` means most traffic is not operations
26367
+ * (keepalives, connection params) - which is itself an answer.
26368
+ */
26369
+ wsMessages: number(),
26370
+ /**
26371
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26372
+ * purpose: one live-events stream opened at boot and held for six hours is
26373
+ * one subscription, and counting it as a call would let a quiet plane
26374
+ * masquerade as the storm.
26375
+ */
26376
+ subscriptions: number(),
26377
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26378
+ subscriptionStops: number(),
26379
+ distinctGroups: number(),
26380
+ /**
26381
+ * Operations counted in the totals whose CALLER attribution was shed at the
26382
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26383
+ * which transport they arrived on, they just lost their group row.
26384
+ */
26385
+ unattributedCalls: number(),
26386
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26387
+ groups: array(RequestCensusGroupSchema).readonly()
26388
+ }).extend({ persisted: boolean() });
26389
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26390
+ var LogLevelSchema$1 = _enum([
26391
+ "debug",
26392
+ "info",
26393
+ "warn",
26394
+ "error"
26395
+ ]);
26396
+ /**
26397
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26398
+ *
26399
+ * A diagnostic is anything whose cost is only worth paying while a question is
26400
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26401
+ */
26402
+ var DiagnosticIdSchema = _enum(["request-census"]);
26403
+ /**
26404
+ * The layers of the level hierarchy, general → specific. The most specific
26405
+ * layer that carries an explicit value wins.
26406
+ *
26407
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26408
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26409
+ * grow later would force every consumer of this document to change with it.
26410
+ * Nothing returns `component` today.
26411
+ */
26412
+ var LoggingScopeKindSchema = _enum([
26413
+ "cluster",
26414
+ "node",
26415
+ "component"
26416
+ ]);
26417
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26418
+ var LoggingLevelSourceSchema = _enum([
26419
+ "default",
26420
+ "cluster",
26421
+ "node",
26422
+ "component"
26423
+ ]);
26424
+ /**
26425
+ * One layer of the hierarchy as it actually STANDS.
26426
+ *
26427
+ * `level: null` is the whole reason this array is returned: it is the
26428
+ * difference between "this node is at `info` because I decided it" and
26429
+ * "...because it inherits". An operator who clears an override believing they
26430
+ * are clearing an inherited value has been handed the same defect as the two
26431
+ * contradicting knobs this document exists to remove, moved one floor up.
26432
+ */
26433
+ var LoggingLevelLayerSchema = object({
26434
+ scope: LoggingScopeKindSchema,
26435
+ /** The node this layer speaks for; `null` on the cluster layer. */
26436
+ nodeId: string().nullable(),
26437
+ /** Explicitly set here, or `null` when this layer inherits. */
26438
+ level: LogLevelSchema$1.nullable()
26439
+ });
26440
+ /** What a line is judged against, and WHICH layer decided it. */
26441
+ var LoggingEffectiveSchema = object({
26442
+ level: LogLevelSchema$1,
26443
+ levelSource: LoggingLevelSourceSchema
26444
+ });
26445
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26446
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26447
+ /**
26448
+ * An armed diagnostic, with its DEADLINE.
26449
+ *
26450
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26451
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26452
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26453
+ * `armed` is false — a window is never reported as slightly expired.
26454
+ */
26455
+ var DiagnosticWindowSchema = object({
26456
+ id: DiagnosticIdSchema,
26457
+ armed: boolean(),
26458
+ /** Epoch ms the window closes at. 0 when disarmed. */
26459
+ armedUntilMs: number(),
26460
+ /** Ms left before it expires on its own. 0 when disarmed. */
26461
+ remainingMs: number(),
26462
+ /** Whether the stored deadline is the one the live diagnostic is running —
26463
+ * i.e. whether this window would survive a restart. */
26464
+ persisted: boolean()
26465
+ });
26466
+ /**
26467
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26468
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26469
+ * is a second knob that disagrees with the first the day one of them moves.
26470
+ */
26471
+ var DiagnosticWindowPatchSchema = object({
26472
+ id: DiagnosticIdSchema,
26473
+ armMs: number().int().min(0),
26474
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26475
+ reportEveryMs: number().int().positive().optional()
26476
+ });
26477
+ /**
26478
+ * A PATCH, and patches MERGE.
26479
+ *
26480
+ * A field absent from the patch is left exactly as it was — arming a
26481
+ * diagnostic never resets a level, and setting a level never disarms a window.
26482
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26483
+ * `setAll` already merges, and rebuilding the object is how an absent field
26484
+ * turns into an erased one.
26485
+ */
26486
+ var LoggingSettingsPatchSchema = object({
26487
+ /**
26488
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26489
+ * addressed scope so it inherits again. A value sets it.
26490
+ */
26491
+ level: LogLevelSchema$1.nullable().optional(),
26492
+ /**
26493
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26494
+ * keeps running — a patch is never a full replacement.
26495
+ */
26496
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26497
+ });
26498
+ /**
26499
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26500
+ *
26501
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26502
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26503
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26504
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26505
+ * by an agent that holds no cluster document at all. The hub is the single
26506
+ * authority over the whole hierarchy and answers for every layer, so the
26507
+ * layer selector needs a name the transport does not already own.
26508
+ */
26509
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26510
+ var SetLoggingSettingsInputSchema = object({
26511
+ scopeNodeId: string().optional(),
26512
+ patch: LoggingSettingsPatchSchema
26513
+ });
26514
+ /**
26515
+ * The whole document, as read and as returned after every write.
26516
+ *
26517
+ * `persisted: false` means the settings store could not be read or written.
26518
+ * The in-memory mirror still governs behaviour and is unchanged by the
26519
+ * failure — a read that fails neither switches a level nor disarms a window
26520
+ * (D49) — but the operator is told that what they are looking at would not
26521
+ * survive a restart.
26522
+ */
26523
+ var LoggingSettingsStateSchema = object({
26524
+ /** The layer this document was read at. `null` = the cluster layer. */
26525
+ scopeNodeId: string().nullable(),
26526
+ effective: LoggingEffectiveSchema,
26527
+ explicit: LoggingExplicitSchema,
26528
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26529
+ persisted: boolean()
26530
+ });
26071
26531
  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(), {
26072
26532
  kind: "mutation",
26073
26533
  auth: "admin"
@@ -26080,6 +26540,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26080
26540
  }), method(_void(), SiteLocationStatusSchema, {
26081
26541
  kind: "mutation",
26082
26542
  auth: "admin"
26543
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26544
+ kind: "mutation",
26545
+ auth: "admin"
26083
26546
  });
26084
26547
  object({
26085
26548
  /** True when the device's tamper switch / case-open contact is
@@ -31911,6 +32374,18 @@ Object.freeze({
31911
32374
  addonId: null,
31912
32375
  access: "create"
31913
32376
  },
32377
+ "system.getLoggingSettings": {
32378
+ capName: "system",
32379
+ capScope: "system",
32380
+ addonId: null,
32381
+ access: "view"
32382
+ },
32383
+ "system.getRequestCensus": {
32384
+ capName: "system",
32385
+ capScope: "system",
32386
+ addonId: null,
32387
+ access: "view"
32388
+ },
31914
32389
  "system.getRetentionConfig": {
31915
32390
  capName: "system",
31916
32391
  capScope: "system",
@@ -31941,6 +32416,12 @@ Object.freeze({
31941
32416
  addonId: null,
31942
32417
  access: "view"
31943
32418
  },
32419
+ "system.setLoggingSettings": {
32420
+ capName: "system",
32421
+ capScope: "system",
32422
+ addonId: null,
32423
+ access: "create"
32424
+ },
31944
32425
  "system.setRetentionConfig": {
31945
32426
  capName: "system",
31946
32427
  capScope: "system",
@@ -33096,6 +33577,10 @@ Object.freeze({
33096
33577
  name: "deviceId",
33097
33578
  form: "single",
33098
33579
  optional: true
33580
+ }, {
33581
+ name: "deviceIds",
33582
+ form: "array",
33583
+ optional: true
33099
33584
  }],
33100
33585
  "fanControl.setDirection": [{
33101
33586
  name: "deviceId",
@@ -34706,7 +35191,38 @@ object({
34706
35191
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34707
35192
  * reproduce that.
34708
35193
  */
34709
- tileBudgetMb: number().int().min(0).max(1024)
35194
+ tileBudgetMb: number().int().min(0).max(1024),
35195
+ /**
35196
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35197
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35198
+ * subject tiles, on frames that detected something.
35199
+ *
35200
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35201
+ * containment is strict by design, so the native `keyFrame`, the detail
35202
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35203
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35204
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35205
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35206
+ *
35207
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35208
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35209
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35210
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35211
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35212
+ * binds only through a detection burst, where it still covers well past the
35213
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35214
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35215
+ * whole shape exists to avoid.
35216
+ *
35217
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35218
+ * subject tile, so one shared budget would let a busy camera's key frames
35219
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35220
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35221
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35222
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35223
+ * nothing.
35224
+ */
35225
+ sceneBudgetMb: number().int().min(0).max(1024)
34710
35226
  });
34711
35227
  /**
34712
35228
  * The values in force when the operator has set nothing.
@@ -34722,12 +35238,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34722
35238
  budgetMb: 1024,
34723
35239
  activityMs: 15e3,
34724
35240
  tileBudgetMb: 64,
35241
+ sceneBudgetMb: 48,
34725
35242
  admission: "inferred"
34726
35243
  };
34727
35244
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34728
35245
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34729
35246
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34730
35247
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35248
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34731
35249
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34732
35250
  var MB = 1024 * 1024;
34733
35251
  1024 * MB, 3072 * MB;