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