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