@camstack/addon-decoder-ffmpeg 1.2.29 → 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 +572 -61
  2. package/dist/index.mjs +572 -61
  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",
@@ -15607,7 +15677,23 @@ var NcHistoryEntrySchema = object({
15607
15677
  updatedAt: number(),
15608
15678
  /** Failure detail — present on a `dead` row. */
15609
15679
  error: string().optional(),
15610
- subject: NcHistorySubjectSchema
15680
+ subject: NcHistorySubjectSchema,
15681
+ /**
15682
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15683
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15684
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15685
+ * every delivery attempt). Absent on a row still pending/dead, a row
15686
+ * delivered before this field shipped, or a wiring with no artefact index.
15687
+ *
15688
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15689
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15690
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15691
+ * also answers `null` for an id whose artefact has since expired past the
15692
+ * retained shelf's own age bound — the degrade a caller (the Home
15693
+ * Assistant export) must render as "no image right now", never as a
15694
+ * broken link.
15695
+ */
15696
+ artifactIds: array(string().min(1)).optional()
15611
15697
  });
15612
15698
  /**
15613
15699
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -15834,7 +15920,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
15834
15920
  }), method(object({}), object({
15835
15921
  catalog: array(NcConditionDescriptorSchema),
15836
15922
  taxonomy: NcTaxonomySchema.optional()
15837
- })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
15923
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
15838
15924
  kind: "mutation",
15839
15925
  caller: "required"
15840
15926
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -20922,7 +21008,7 @@ var lifecycleJobSchema = object({
20922
21008
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
20923
21009
  * as every other cap.
20924
21010
  */
20925
- var LogLevelSchema$1 = _enum([
21011
+ var LogLevelSchema$2 = _enum([
20926
21012
  "debug",
20927
21013
  "info",
20928
21014
  "warn",
@@ -21129,7 +21215,7 @@ var CustomActionInputSchema = object({
21129
21215
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21130
21216
  addonId: string(),
21131
21217
  limit: number().min(1).max(500).default(100),
21132
- level: LogLevelSchema$1.optional()
21218
+ level: LogLevelSchema$2.optional()
21133
21219
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21134
21220
  packageName: string(),
21135
21221
  version: string().optional()
@@ -21227,7 +21313,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21227
21313
  auth: "admin"
21228
21314
  }), method(object({
21229
21315
  addonId: string(),
21230
- level: LogLevelSchema$1.optional()
21316
+ level: LogLevelSchema$2.optional()
21231
21317
  }), LogStreamEntrySchema, { kind: "subscription" });
21232
21318
  object({
21233
21319
  /** Carbon dioxide concentration in ppm. */
@@ -22221,6 +22307,35 @@ var FaceFilterEnum = _enum([
22221
22307
  "identified",
22222
22308
  "all"
22223
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
+ });
22224
22339
  var MediaFileLiteSchema$1 = object({
22225
22340
  key: string(),
22226
22341
  kind: string(),
@@ -22267,24 +22382,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22267
22382
  kind: "mutation",
22268
22383
  auth: "admin"
22269
22384
  }), method(object({
22270
- /** 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
+ */
22271
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(),
22272
22409
  limit: number().int().positive().optional(),
22273
22410
  filter: FaceFilterEnum.optional(),
22274
22411
  /**
22275
- * Inline the base64 crop on every row. Default `true` — the existing
22276
- * 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.
22277
22425
  *
22278
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22279
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22280
- * the browser cache the images.
22426
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22427
+ * does under `'suggestionConfidence'`.
22281
22428
  *
22282
- * **This is an INPUT field, so it does not reach the addon until the
22283
- * next train.** The hub router validates cap inputs against its own
22284
- * compiled Zod, which strips a key it does not know verified today
22285
- * on the OUTPUT side, where an additive field DOES arrive immediately
22286
- * (`Track.hasFace`). Until the train ships, sending `false` is
22287
- * 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.
22288
22451
  */
22289
22452
  includeCrops: boolean().optional()
22290
22453
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22320,13 +22483,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22320
22483
  }), method(object({
22321
22484
  threshold: number().min(0).max(1).optional(),
22322
22485
  minClusterSize: number().int().min(2).optional(),
22323
- limit: number().int().positive().optional()
22324
- }).optional(), array(object({
22325
- faceIds: array(string()).readonly(),
22326
- representativeFaceId: string(),
22327
- size: number().int(),
22328
- cohesion: number()
22329
- })).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());
22330
22519
  /**
22331
22520
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22332
22521
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -25126,6 +25315,39 @@ var ReadGopBytesResultSchema = object({
25126
25315
  /** Media ms the returned fragment covers. */
25127
25316
  gopDurMs: number()
25128
25317
  });
25318
+ /**
25319
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
25320
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
25321
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
25322
+ * a replay needs several seconds of native pixels, not one frame.
25323
+ *
25324
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
25325
+ * is `false` when the returned bytes were cut short by the read's own safety
25326
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
25327
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
25328
+ * degradation: a window whose end falls past the covering segment would need
25329
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
25330
+ * not one standalone-demuxable stream — the caller's answer is to request a
25331
+ * shorter window or one aligned to a single segment, not to receive spliced
25332
+ * bytes nothing has proven decodable.
25333
+ */
25334
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
25335
+ kind: literal("ok"),
25336
+ data: _instanceof(Uint8Array),
25337
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
25338
+ * the requested `fromMs` (anchored on the nearest keyframe). */
25339
+ gopStartMs: number(),
25340
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
25341
+ gopDurMs: number(),
25342
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
25343
+ * the requested `toMs`; the caller got fewer frames than asked for. */
25344
+ reachesRequestedEnd: boolean()
25345
+ }), object({
25346
+ kind: literal("spans-multiple-segments"),
25347
+ /** Where the covering segment's own footage runs out — informational,
25348
+ * not a retry hint (retrying the same window would refuse again). */
25349
+ segmentEndMs: number()
25350
+ })]);
25129
25351
  method(object({
25130
25352
  deviceId: number(),
25131
25353
  fromMs: number(),
@@ -25176,6 +25398,15 @@ method(object({
25176
25398
  }), ReadGopBytesResultSchema, {
25177
25399
  kind: "query",
25178
25400
  auth: "admin"
25401
+ }), method(object({
25402
+ deviceId: number(),
25403
+ profile: string(),
25404
+ startMs: number(),
25405
+ fromMs: number(),
25406
+ toMs: number()
25407
+ }), ReadWindowBytesResultSchema, {
25408
+ kind: "query",
25409
+ auth: "admin"
25179
25410
  }), method(object({
25180
25411
  deviceId: number(),
25181
25412
  config: RecordingConfigSchema
@@ -26007,6 +26238,211 @@ var SetSiteLocationInputSchema = object({
26007
26238
  latitude: number().min(-90).max(90),
26008
26239
  longitude: number().min(-180).max(180)
26009
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
+ });
26010
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(), {
26011
26447
  kind: "mutation",
26012
26448
  auth: "admin"
@@ -26019,6 +26455,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26019
26455
  }), method(_void(), SiteLocationStatusSchema, {
26020
26456
  kind: "mutation",
26021
26457
  auth: "admin"
26458
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26459
+ kind: "mutation",
26460
+ auth: "admin"
26022
26461
  });
26023
26462
  object({
26024
26463
  /** True when the device's tamper switch / case-open contact is
@@ -29594,6 +30033,12 @@ Object.freeze({
29594
30033
  addonId: null,
29595
30034
  access: "view"
29596
30035
  },
30036
+ "notificationRules.resolveArtifactUrl": {
30037
+ capName: "notification-rules",
30038
+ capScope: "system",
30039
+ addonId: null,
30040
+ access: "view"
30041
+ },
29597
30042
  "notificationRules.setAlarmConfig": {
29598
30043
  capName: "notification-rules",
29599
30044
  capScope: "system",
@@ -30998,6 +31443,12 @@ Object.freeze({
30998
31443
  addonId: null,
30999
31444
  access: "view"
31000
31445
  },
31446
+ "recording.readWindowBytes": {
31447
+ capName: "recording",
31448
+ capScope: "system",
31449
+ addonId: null,
31450
+ access: "view"
31451
+ },
31001
31452
  "recording.refreshStorageLocationsForMigration": {
31002
31453
  capName: "recording",
31003
31454
  capScope: "system",
@@ -31838,6 +32289,18 @@ Object.freeze({
31838
32289
  addonId: null,
31839
32290
  access: "create"
31840
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
+ },
31841
32304
  "system.getRetentionConfig": {
31842
32305
  capName: "system",
31843
32306
  capScope: "system",
@@ -31868,6 +32331,12 @@ Object.freeze({
31868
32331
  addonId: null,
31869
32332
  access: "view"
31870
32333
  },
32334
+ "system.setLoggingSettings": {
32335
+ capName: "system",
32336
+ capScope: "system",
32337
+ addonId: null,
32338
+ access: "create"
32339
+ },
31871
32340
  "system.setRetentionConfig": {
31872
32341
  capName: "system",
31873
32342
  capScope: "system",
@@ -33023,6 +33492,10 @@ Object.freeze({
33023
33492
  name: "deviceId",
33024
33493
  form: "single",
33025
33494
  optional: true
33495
+ }, {
33496
+ name: "deviceIds",
33497
+ form: "array",
33498
+ optional: true
33026
33499
  }],
33027
33500
  "fanControl.setDirection": [{
33028
33501
  name: "deviceId",
@@ -33828,6 +34301,11 @@ Object.freeze({
33828
34301
  form: "single",
33829
34302
  optional: false
33830
34303
  }],
34304
+ "recording.readWindowBytes": [{
34305
+ name: "deviceId",
34306
+ form: "single",
34307
+ optional: false
34308
+ }],
33831
34309
  "recording.relocateFootage": [{
33832
34310
  name: "deviceId",
33833
34311
  form: "single",
@@ -34628,7 +35106,38 @@ object({
34628
35106
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34629
35107
  * reproduce that.
34630
35108
  */
34631
- 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)
34632
35141
  });
34633
35142
  /**
34634
35143
  * The values in force when the operator has set nothing.
@@ -34644,12 +35153,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34644
35153
  budgetMb: 1024,
34645
35154
  activityMs: 15e3,
34646
35155
  tileBudgetMb: 64,
35156
+ sceneBudgetMb: 48,
34647
35157
  admission: "inferred"
34648
35158
  };
34649
35159
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34650
35160
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34651
35161
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34652
35162
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35163
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34653
35164
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34654
35165
  var MB = 1024 * 1024;
34655
35166
  1024 * MB, 3072 * MB;