@camstack/addon-decoder-ffmpeg 1.2.30 → 1.2.31

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 +495 -59
  2. package/dist/index.mjs +495 -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,211 @@ var SetSiteLocationInputSchema = object({
26069
26242
  latitude: number().min(-90).max(90),
26070
26243
  longitude: number().min(-180).max(180)
26071
26244
  }).nullable();
26245
+ /**
26246
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26247
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26248
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26249
+ * already prints - never a token, never an `Authorization` header.
26250
+ */
26251
+ var RequestCensusGroupSchema = object({
26252
+ procedure: string(),
26253
+ userAgent: string(),
26254
+ ip: string(),
26255
+ principal: string(),
26256
+ calls: number(),
26257
+ perMin: number()
26258
+ });
26259
+ /**
26260
+ * A procedure's TOTAL over the window, across every caller.
26261
+ *
26262
+ * This block, not the group list, is what answers "did these calls arrive over
26263
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26264
+ * same window excludes the HTTP plane, which is a result, not a failure.
26265
+ */
26266
+ var RequestCensusProcedureSchema = object({
26267
+ procedure: string(),
26268
+ calls: number(),
26269
+ perMin: number()
26270
+ });
26271
+ /**
26272
+ * The census as an operator sees it.
26273
+ *
26274
+ * `persisted` is the honest answer to "will this survive the restart I am
26275
+ * about to do": the arm deadline is written to `system-settings` so a window
26276
+ * armed now can measure the NEXT boot, and a write that failed must not look
26277
+ * like one that succeeded.
26278
+ */
26279
+ var RequestCensusStatusSchema = object({
26280
+ armed: boolean(),
26281
+ /** How long the current - or just-closed - window collected, in ms. */
26282
+ elapsedMs: number(),
26283
+ /** The window actually armed, after the server clamped the request. */
26284
+ windowMs: number(),
26285
+ /** Epoch ms the window closes at. 0 when disarmed. */
26286
+ armedUntilMs: number(),
26287
+ httpRequests: number(),
26288
+ batchedRequests: number(),
26289
+ /**
26290
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26291
+ * is in play (`?batch=1` carries several procedures in one request); this is
26292
+ * the number comparable with a store-side call count.
26293
+ */
26294
+ procedureCalls: number(),
26295
+ /**
26296
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26297
+ * transport resolves one context per connection - but the number that says
26298
+ * whether a plane this census cannot see was busy while HTTP was quiet.
26299
+ */
26300
+ wsConnections: number(),
26301
+ distinctGroups: number(),
26302
+ /** Calls counted in the totals whose group attribution was shed at the
26303
+ * cardinality bound. */
26304
+ unattributedCalls: number(),
26305
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26306
+ groups: array(RequestCensusGroupSchema).readonly()
26307
+ }).extend({ persisted: boolean() });
26308
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26309
+ var LogLevelSchema$1 = _enum([
26310
+ "debug",
26311
+ "info",
26312
+ "warn",
26313
+ "error"
26314
+ ]);
26315
+ /**
26316
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26317
+ *
26318
+ * A diagnostic is anything whose cost is only worth paying while a question is
26319
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26320
+ */
26321
+ var DiagnosticIdSchema = _enum(["request-census"]);
26322
+ /**
26323
+ * The layers of the level hierarchy, general → specific. The most specific
26324
+ * layer that carries an explicit value wins.
26325
+ *
26326
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26327
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26328
+ * grow later would force every consumer of this document to change with it.
26329
+ * Nothing returns `component` today.
26330
+ */
26331
+ var LoggingScopeKindSchema = _enum([
26332
+ "cluster",
26333
+ "node",
26334
+ "component"
26335
+ ]);
26336
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26337
+ var LoggingLevelSourceSchema = _enum([
26338
+ "default",
26339
+ "cluster",
26340
+ "node",
26341
+ "component"
26342
+ ]);
26343
+ /**
26344
+ * One layer of the hierarchy as it actually STANDS.
26345
+ *
26346
+ * `level: null` is the whole reason this array is returned: it is the
26347
+ * difference between "this node is at `info` because I decided it" and
26348
+ * "...because it inherits". An operator who clears an override believing they
26349
+ * are clearing an inherited value has been handed the same defect as the two
26350
+ * contradicting knobs this document exists to remove, moved one floor up.
26351
+ */
26352
+ var LoggingLevelLayerSchema = object({
26353
+ scope: LoggingScopeKindSchema,
26354
+ /** The node this layer speaks for; `null` on the cluster layer. */
26355
+ nodeId: string().nullable(),
26356
+ /** Explicitly set here, or `null` when this layer inherits. */
26357
+ level: LogLevelSchema$1.nullable()
26358
+ });
26359
+ /** What a line is judged against, and WHICH layer decided it. */
26360
+ var LoggingEffectiveSchema = object({
26361
+ level: LogLevelSchema$1,
26362
+ levelSource: LoggingLevelSourceSchema
26363
+ });
26364
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26365
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26366
+ /**
26367
+ * An armed diagnostic, with its DEADLINE.
26368
+ *
26369
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26370
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26371
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26372
+ * `armed` is false — a window is never reported as slightly expired.
26373
+ */
26374
+ var DiagnosticWindowSchema = object({
26375
+ id: DiagnosticIdSchema,
26376
+ armed: boolean(),
26377
+ /** Epoch ms the window closes at. 0 when disarmed. */
26378
+ armedUntilMs: number(),
26379
+ /** Ms left before it expires on its own. 0 when disarmed. */
26380
+ remainingMs: number(),
26381
+ /** Whether the stored deadline is the one the live diagnostic is running —
26382
+ * i.e. whether this window would survive a restart. */
26383
+ persisted: boolean()
26384
+ });
26385
+ /**
26386
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26387
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26388
+ * is a second knob that disagrees with the first the day one of them moves.
26389
+ */
26390
+ var DiagnosticWindowPatchSchema = object({
26391
+ id: DiagnosticIdSchema,
26392
+ armMs: number().int().min(0),
26393
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26394
+ reportEveryMs: number().int().positive().optional()
26395
+ });
26396
+ /**
26397
+ * A PATCH, and patches MERGE.
26398
+ *
26399
+ * A field absent from the patch is left exactly as it was — arming a
26400
+ * diagnostic never resets a level, and setting a level never disarms a window.
26401
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26402
+ * `setAll` already merges, and rebuilding the object is how an absent field
26403
+ * turns into an erased one.
26404
+ */
26405
+ var LoggingSettingsPatchSchema = object({
26406
+ /**
26407
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26408
+ * addressed scope so it inherits again. A value sets it.
26409
+ */
26410
+ level: LogLevelSchema$1.nullable().optional(),
26411
+ /**
26412
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26413
+ * keeps running — a patch is never a full replacement.
26414
+ */
26415
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26416
+ });
26417
+ /**
26418
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26419
+ *
26420
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26421
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26422
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26423
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26424
+ * by an agent that holds no cluster document at all. The hub is the single
26425
+ * authority over the whole hierarchy and answers for every layer, so the
26426
+ * layer selector needs a name the transport does not already own.
26427
+ */
26428
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26429
+ var SetLoggingSettingsInputSchema = object({
26430
+ scopeNodeId: string().optional(),
26431
+ patch: LoggingSettingsPatchSchema
26432
+ });
26433
+ /**
26434
+ * The whole document, as read and as returned after every write.
26435
+ *
26436
+ * `persisted: false` means the settings store could not be read or written.
26437
+ * The in-memory mirror still governs behaviour and is unchanged by the
26438
+ * failure — a read that fails neither switches a level nor disarms a window
26439
+ * (D49) — but the operator is told that what they are looking at would not
26440
+ * survive a restart.
26441
+ */
26442
+ var LoggingSettingsStateSchema = object({
26443
+ /** The layer this document was read at. `null` = the cluster layer. */
26444
+ scopeNodeId: string().nullable(),
26445
+ effective: LoggingEffectiveSchema,
26446
+ explicit: LoggingExplicitSchema,
26447
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26448
+ persisted: boolean()
26449
+ });
26072
26450
  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
26451
  kind: "mutation",
26074
26452
  auth: "admin"
@@ -26081,6 +26459,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26081
26459
  }), method(_void(), SiteLocationStatusSchema, {
26082
26460
  kind: "mutation",
26083
26461
  auth: "admin"
26462
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26463
+ kind: "mutation",
26464
+ auth: "admin"
26084
26465
  });
26085
26466
  object({
26086
26467
  /** True when the device's tamper switch / case-open contact is
@@ -31912,6 +32293,18 @@ Object.freeze({
31912
32293
  addonId: null,
31913
32294
  access: "create"
31914
32295
  },
32296
+ "system.getLoggingSettings": {
32297
+ capName: "system",
32298
+ capScope: "system",
32299
+ addonId: null,
32300
+ access: "view"
32301
+ },
32302
+ "system.getRequestCensus": {
32303
+ capName: "system",
32304
+ capScope: "system",
32305
+ addonId: null,
32306
+ access: "view"
32307
+ },
31915
32308
  "system.getRetentionConfig": {
31916
32309
  capName: "system",
31917
32310
  capScope: "system",
@@ -31942,6 +32335,12 @@ Object.freeze({
31942
32335
  addonId: null,
31943
32336
  access: "view"
31944
32337
  },
32338
+ "system.setLoggingSettings": {
32339
+ capName: "system",
32340
+ capScope: "system",
32341
+ addonId: null,
32342
+ access: "create"
32343
+ },
31945
32344
  "system.setRetentionConfig": {
31946
32345
  capName: "system",
31947
32346
  capScope: "system",
@@ -33097,6 +33496,10 @@ Object.freeze({
33097
33496
  name: "deviceId",
33098
33497
  form: "single",
33099
33498
  optional: true
33499
+ }, {
33500
+ name: "deviceIds",
33501
+ form: "array",
33502
+ optional: true
33100
33503
  }],
33101
33504
  "fanControl.setDirection": [{
33102
33505
  name: "deviceId",
@@ -34707,7 +35110,38 @@ object({
34707
35110
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34708
35111
  * reproduce that.
34709
35112
  */
34710
- tileBudgetMb: number().int().min(0).max(1024)
35113
+ tileBudgetMb: number().int().min(0).max(1024),
35114
+ /**
35115
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35116
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35117
+ * subject tiles, on frames that detected something.
35118
+ *
35119
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35120
+ * containment is strict by design, so the native `keyFrame`, the detail
35121
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35122
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35123
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35124
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35125
+ *
35126
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35127
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35128
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35129
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35130
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35131
+ * binds only through a detection burst, where it still covers well past the
35132
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35133
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35134
+ * whole shape exists to avoid.
35135
+ *
35136
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35137
+ * subject tile, so one shared budget would let a busy camera's key frames
35138
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35139
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35140
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35141
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35142
+ * nothing.
35143
+ */
35144
+ sceneBudgetMb: number().int().min(0).max(1024)
34711
35145
  });
34712
35146
  /**
34713
35147
  * The values in force when the operator has set nothing.
@@ -34723,12 +35157,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34723
35157
  budgetMb: 1024,
34724
35158
  activityMs: 15e3,
34725
35159
  tileBudgetMb: 64,
35160
+ sceneBudgetMb: 48,
34726
35161
  admission: "inferred"
34727
35162
  };
34728
35163
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34729
35164
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34730
35165
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34731
35166
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35167
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34732
35168
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34733
35169
  var MB = 1024 * 1024;
34734
35170
  1024 * MB, 3072 * MB;
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,211 @@ var SetSiteLocationInputSchema = object({
26065
26238
  latitude: number().min(-90).max(90),
26066
26239
  longitude: number().min(-180).max(180)
26067
26240
  }).nullable();
26241
+ /**
26242
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26243
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26244
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26245
+ * already prints - never a token, never an `Authorization` header.
26246
+ */
26247
+ var RequestCensusGroupSchema = object({
26248
+ procedure: string(),
26249
+ userAgent: string(),
26250
+ ip: string(),
26251
+ principal: string(),
26252
+ calls: number(),
26253
+ perMin: number()
26254
+ });
26255
+ /**
26256
+ * A procedure's TOTAL over the window, across every caller.
26257
+ *
26258
+ * This block, not the group list, is what answers "did these calls arrive over
26259
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26260
+ * same window excludes the HTTP plane, which is a result, not a failure.
26261
+ */
26262
+ var RequestCensusProcedureSchema = object({
26263
+ procedure: string(),
26264
+ calls: number(),
26265
+ perMin: number()
26266
+ });
26267
+ /**
26268
+ * The census as an operator sees it.
26269
+ *
26270
+ * `persisted` is the honest answer to "will this survive the restart I am
26271
+ * about to do": the arm deadline is written to `system-settings` so a window
26272
+ * armed now can measure the NEXT boot, and a write that failed must not look
26273
+ * like one that succeeded.
26274
+ */
26275
+ var RequestCensusStatusSchema = object({
26276
+ armed: boolean(),
26277
+ /** How long the current - or just-closed - window collected, in ms. */
26278
+ elapsedMs: number(),
26279
+ /** The window actually armed, after the server clamped the request. */
26280
+ windowMs: number(),
26281
+ /** Epoch ms the window closes at. 0 when disarmed. */
26282
+ armedUntilMs: number(),
26283
+ httpRequests: number(),
26284
+ batchedRequests: number(),
26285
+ /**
26286
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26287
+ * is in play (`?batch=1` carries several procedures in one request); this is
26288
+ * the number comparable with a store-side call count.
26289
+ */
26290
+ procedureCalls: number(),
26291
+ /**
26292
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26293
+ * transport resolves one context per connection - but the number that says
26294
+ * whether a plane this census cannot see was busy while HTTP was quiet.
26295
+ */
26296
+ wsConnections: number(),
26297
+ distinctGroups: number(),
26298
+ /** Calls counted in the totals whose group attribution was shed at the
26299
+ * cardinality bound. */
26300
+ unattributedCalls: number(),
26301
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26302
+ groups: array(RequestCensusGroupSchema).readonly()
26303
+ }).extend({ persisted: boolean() });
26304
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26305
+ var LogLevelSchema$1 = _enum([
26306
+ "debug",
26307
+ "info",
26308
+ "warn",
26309
+ "error"
26310
+ ]);
26311
+ /**
26312
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26313
+ *
26314
+ * A diagnostic is anything whose cost is only worth paying while a question is
26315
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26316
+ */
26317
+ var DiagnosticIdSchema = _enum(["request-census"]);
26318
+ /**
26319
+ * The layers of the level hierarchy, general → specific. The most specific
26320
+ * layer that carries an explicit value wins.
26321
+ *
26322
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26323
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26324
+ * grow later would force every consumer of this document to change with it.
26325
+ * Nothing returns `component` today.
26326
+ */
26327
+ var LoggingScopeKindSchema = _enum([
26328
+ "cluster",
26329
+ "node",
26330
+ "component"
26331
+ ]);
26332
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26333
+ var LoggingLevelSourceSchema = _enum([
26334
+ "default",
26335
+ "cluster",
26336
+ "node",
26337
+ "component"
26338
+ ]);
26339
+ /**
26340
+ * One layer of the hierarchy as it actually STANDS.
26341
+ *
26342
+ * `level: null` is the whole reason this array is returned: it is the
26343
+ * difference between "this node is at `info` because I decided it" and
26344
+ * "...because it inherits". An operator who clears an override believing they
26345
+ * are clearing an inherited value has been handed the same defect as the two
26346
+ * contradicting knobs this document exists to remove, moved one floor up.
26347
+ */
26348
+ var LoggingLevelLayerSchema = object({
26349
+ scope: LoggingScopeKindSchema,
26350
+ /** The node this layer speaks for; `null` on the cluster layer. */
26351
+ nodeId: string().nullable(),
26352
+ /** Explicitly set here, or `null` when this layer inherits. */
26353
+ level: LogLevelSchema$1.nullable()
26354
+ });
26355
+ /** What a line is judged against, and WHICH layer decided it. */
26356
+ var LoggingEffectiveSchema = object({
26357
+ level: LogLevelSchema$1,
26358
+ levelSource: LoggingLevelSourceSchema
26359
+ });
26360
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26361
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26362
+ /**
26363
+ * An armed diagnostic, with its DEADLINE.
26364
+ *
26365
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26366
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26367
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26368
+ * `armed` is false — a window is never reported as slightly expired.
26369
+ */
26370
+ var DiagnosticWindowSchema = object({
26371
+ id: DiagnosticIdSchema,
26372
+ armed: boolean(),
26373
+ /** Epoch ms the window closes at. 0 when disarmed. */
26374
+ armedUntilMs: number(),
26375
+ /** Ms left before it expires on its own. 0 when disarmed. */
26376
+ remainingMs: number(),
26377
+ /** Whether the stored deadline is the one the live diagnostic is running —
26378
+ * i.e. whether this window would survive a restart. */
26379
+ persisted: boolean()
26380
+ });
26381
+ /**
26382
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26383
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26384
+ * is a second knob that disagrees with the first the day one of them moves.
26385
+ */
26386
+ var DiagnosticWindowPatchSchema = object({
26387
+ id: DiagnosticIdSchema,
26388
+ armMs: number().int().min(0),
26389
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26390
+ reportEveryMs: number().int().positive().optional()
26391
+ });
26392
+ /**
26393
+ * A PATCH, and patches MERGE.
26394
+ *
26395
+ * A field absent from the patch is left exactly as it was — arming a
26396
+ * diagnostic never resets a level, and setting a level never disarms a window.
26397
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26398
+ * `setAll` already merges, and rebuilding the object is how an absent field
26399
+ * turns into an erased one.
26400
+ */
26401
+ var LoggingSettingsPatchSchema = object({
26402
+ /**
26403
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26404
+ * addressed scope so it inherits again. A value sets it.
26405
+ */
26406
+ level: LogLevelSchema$1.nullable().optional(),
26407
+ /**
26408
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26409
+ * keeps running — a patch is never a full replacement.
26410
+ */
26411
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26412
+ });
26413
+ /**
26414
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26415
+ *
26416
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26417
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26418
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26419
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26420
+ * by an agent that holds no cluster document at all. The hub is the single
26421
+ * authority over the whole hierarchy and answers for every layer, so the
26422
+ * layer selector needs a name the transport does not already own.
26423
+ */
26424
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26425
+ var SetLoggingSettingsInputSchema = object({
26426
+ scopeNodeId: string().optional(),
26427
+ patch: LoggingSettingsPatchSchema
26428
+ });
26429
+ /**
26430
+ * The whole document, as read and as returned after every write.
26431
+ *
26432
+ * `persisted: false` means the settings store could not be read or written.
26433
+ * The in-memory mirror still governs behaviour and is unchanged by the
26434
+ * failure — a read that fails neither switches a level nor disarms a window
26435
+ * (D49) — but the operator is told that what they are looking at would not
26436
+ * survive a restart.
26437
+ */
26438
+ var LoggingSettingsStateSchema = object({
26439
+ /** The layer this document was read at. `null` = the cluster layer. */
26440
+ scopeNodeId: string().nullable(),
26441
+ effective: LoggingEffectiveSchema,
26442
+ explicit: LoggingExplicitSchema,
26443
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26444
+ persisted: boolean()
26445
+ });
26068
26446
  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
26447
  kind: "mutation",
26070
26448
  auth: "admin"
@@ -26077,6 +26455,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26077
26455
  }), method(_void(), SiteLocationStatusSchema, {
26078
26456
  kind: "mutation",
26079
26457
  auth: "admin"
26458
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26459
+ kind: "mutation",
26460
+ auth: "admin"
26080
26461
  });
26081
26462
  object({
26082
26463
  /** True when the device's tamper switch / case-open contact is
@@ -31908,6 +32289,18 @@ Object.freeze({
31908
32289
  addonId: null,
31909
32290
  access: "create"
31910
32291
  },
32292
+ "system.getLoggingSettings": {
32293
+ capName: "system",
32294
+ capScope: "system",
32295
+ addonId: null,
32296
+ access: "view"
32297
+ },
32298
+ "system.getRequestCensus": {
32299
+ capName: "system",
32300
+ capScope: "system",
32301
+ addonId: null,
32302
+ access: "view"
32303
+ },
31911
32304
  "system.getRetentionConfig": {
31912
32305
  capName: "system",
31913
32306
  capScope: "system",
@@ -31938,6 +32331,12 @@ Object.freeze({
31938
32331
  addonId: null,
31939
32332
  access: "view"
31940
32333
  },
32334
+ "system.setLoggingSettings": {
32335
+ capName: "system",
32336
+ capScope: "system",
32337
+ addonId: null,
32338
+ access: "create"
32339
+ },
31941
32340
  "system.setRetentionConfig": {
31942
32341
  capName: "system",
31943
32342
  capScope: "system",
@@ -33093,6 +33492,10 @@ Object.freeze({
33093
33492
  name: "deviceId",
33094
33493
  form: "single",
33095
33494
  optional: true
33495
+ }, {
33496
+ name: "deviceIds",
33497
+ form: "array",
33498
+ optional: true
33096
33499
  }],
33097
33500
  "fanControl.setDirection": [{
33098
33501
  name: "deviceId",
@@ -34703,7 +35106,38 @@ object({
34703
35106
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34704
35107
  * reproduce that.
34705
35108
  */
34706
- tileBudgetMb: number().int().min(0).max(1024)
35109
+ tileBudgetMb: number().int().min(0).max(1024),
35110
+ /**
35111
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35112
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35113
+ * subject tiles, on frames that detected something.
35114
+ *
35115
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35116
+ * containment is strict by design, so the native `keyFrame`, the detail
35117
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35118
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35119
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35120
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35121
+ *
35122
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35123
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35124
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35125
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35126
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35127
+ * binds only through a detection burst, where it still covers well past the
35128
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35129
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35130
+ * whole shape exists to avoid.
35131
+ *
35132
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35133
+ * subject tile, so one shared budget would let a busy camera's key frames
35134
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35135
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35136
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35137
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35138
+ * nothing.
35139
+ */
35140
+ sceneBudgetMb: number().int().min(0).max(1024)
34707
35141
  });
34708
35142
  /**
34709
35143
  * The values in force when the operator has set nothing.
@@ -34719,12 +35153,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34719
35153
  budgetMb: 1024,
34720
35154
  activityMs: 15e3,
34721
35155
  tileBudgetMb: 64,
35156
+ sceneBudgetMb: 48,
34722
35157
  admission: "inferred"
34723
35158
  };
34724
35159
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34725
35160
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34726
35161
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34727
35162
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35163
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34728
35164
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34729
35165
  var MB = 1024 * 1024;
34730
35166
  1024 * MB, 3072 * MB;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-decoder-ffmpeg",
3
- "version": "1.2.30",
3
+ "version": "1.2.31",
4
4
  "description": "Standalone ffmpeg-subprocess decoder fallback addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",