@camstack/addon-provider-rtsp 1.2.30 → 1.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +572 -61
  2. package/dist/addon.mjs +572 -61
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7582,6 +7582,66 @@ var OpsLogQueryInputSchema = object({
7582
7582
  /** Max rows returned, newest-first. */
7583
7583
  limit: number().int().min(1).max(1e3).optional()
7584
7584
  });
7585
+ var LabelDefinitionSchema = object({
7586
+ id: string(),
7587
+ name: string(),
7588
+ category: string().optional(),
7589
+ description: string().optional(),
7590
+ icon: string().optional()
7591
+ });
7592
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7593
+ var CLASS_MAP_MACRO_TARGETS = [
7594
+ "person",
7595
+ "vehicle",
7596
+ "animal",
7597
+ "package"
7598
+ ];
7599
+ /**
7600
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7601
+ * un operatore può selezionare.
7602
+ *
7603
+ * Sono le tre offerte dallo step `object-detection`
7604
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7605
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7606
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7607
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7608
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7609
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7610
+ *
7611
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7612
+ * dello step e una seconda volta come union `FirstLevelMacro`
7613
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7614
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7615
+ * successiva.
7616
+ */
7617
+ var FIRST_LEVEL_MACRO_CLASSES = [
7618
+ "person",
7619
+ "vehicle",
7620
+ "animal"
7621
+ ];
7622
+ /**
7623
+ * Wire schema for a per-model CATALOG classMap override
7624
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7625
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7626
+ * detection pipeline executor actually routes.
7627
+ *
7628
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7629
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7630
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7631
+ * enum) — the two used to share the name `ClassMapDefinition`/
7632
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7633
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7634
+ * are not: it is two different concepts colliding on a name. Keep this type
7635
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7636
+ * would either narrow every `ClassMapDefinition` consumer to the four
7637
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7638
+ * schema exists for (see the "rejects a classMap whose target is not a
7639
+ * detection macro" test in `model-catalog-schema.test.ts`).
7640
+ */
7641
+ var DetectionCatalogClassMapSchema = object({
7642
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7643
+ preserveOriginal: boolean()
7644
+ });
7585
7645
  /**
7586
7646
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7587
7647
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7604,10 +7664,55 @@ var RecordingStorageModeSchema = _enum([
7604
7664
  "events",
7605
7665
  "continuous"
7606
7666
  ]);
7667
+ /**
7668
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7669
+ * tre offerte dallo step `object-detection`, da UNA lista
7670
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7671
+ */
7672
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7673
+ /**
7674
+ * True quando `values` non ripete un elemento.
7675
+ *
7676
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7677
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7678
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7679
+ */
7680
+ var noDuplicates = (values) => new Set(values).size === values.length;
7607
7681
  /** Which detectors trigger an `events`-mode band. */
7608
7682
  var RecordingTriggersSchema = object({
7609
7683
  motion: boolean().optional(),
7610
- audioThresholdDbfs: number().optional()
7684
+ audioThresholdDbfs: number().optional(),
7685
+ /**
7686
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7687
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7688
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7689
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7690
+ *
7691
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7692
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7693
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7694
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7695
+ * finestre — vedi `recorder/object-trigger.ts`.
7696
+ */
7697
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7698
+ /**
7699
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7700
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7701
+ * `objectClasses`.
7702
+ *
7703
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7704
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7705
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7706
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7707
+ * device (D12) — mai un elenco globale di cap.
7708
+ *
7709
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7710
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7711
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7712
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7713
+ * registrare.
7714
+ */
7715
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7611
7716
  });
7612
7717
  /**
7613
7718
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8059,41 +8164,6 @@ var DecoderSessionConfigSchema = object({
8059
8164
  */
8060
8165
  debug: boolean().optional()
8061
8166
  });
8062
- var LabelDefinitionSchema = object({
8063
- id: string(),
8064
- name: string(),
8065
- category: string().optional(),
8066
- description: string().optional(),
8067
- icon: string().optional()
8068
- });
8069
- /**
8070
- * Wire schema for a per-model CATALOG classMap override
8071
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8072
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8073
- * detection pipeline executor actually routes.
8074
- *
8075
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8076
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8077
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8078
- * enum) — the two used to share the name `ClassMapDefinition`/
8079
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8080
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8081
- * are not: it is two different concepts colliding on a name. Keep this type
8082
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8083
- * would either narrow every `ClassMapDefinition` consumer to the four
8084
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8085
- * schema exists for (see the "rejects a classMap whose target is not a
8086
- * detection macro" test in `model-catalog-schema.test.ts`).
8087
- */
8088
- var DetectionCatalogClassMapSchema = object({
8089
- mapping: record(string(), _enum([
8090
- "person",
8091
- "vehicle",
8092
- "animal",
8093
- "package"
8094
- ])),
8095
- preserveOriginal: boolean()
8096
- });
8097
8167
  var MODEL_FORMATS = [
8098
8168
  "onnx",
8099
8169
  "coreml",
@@ -15838,7 +15908,23 @@ var NcHistoryEntrySchema = object({
15838
15908
  updatedAt: number(),
15839
15909
  /** Failure detail — present on a `dead` row. */
15840
15910
  error: string().optional(),
15841
- subject: NcHistorySubjectSchema
15911
+ subject: NcHistorySubjectSchema,
15912
+ /**
15913
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15914
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15915
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15916
+ * every delivery attempt). Absent on a row still pending/dead, a row
15917
+ * delivered before this field shipped, or a wiring with no artefact index.
15918
+ *
15919
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15920
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15921
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15922
+ * also answers `null` for an id whose artefact has since expired past the
15923
+ * retained shelf's own age bound — the degrade a caller (the Home
15924
+ * Assistant export) must render as "no image right now", never as a
15925
+ * broken link.
15926
+ */
15927
+ artifactIds: array(string().min(1)).optional()
15842
15928
  });
15843
15929
  /**
15844
15930
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16065,7 +16151,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16065
16151
  }), method(object({}), object({
16066
16152
  catalog: array(NcConditionDescriptorSchema),
16067
16153
  taxonomy: NcTaxonomySchema.optional()
16068
- })), 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 }), {
16154
+ })), 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 }), {
16069
16155
  kind: "mutation",
16070
16156
  caller: "required"
16071
16157
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21297,7 +21383,7 @@ var lifecycleJobSchema = object({
21297
21383
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21298
21384
  * as every other cap.
21299
21385
  */
21300
- var LogLevelSchema$1 = _enum([
21386
+ var LogLevelSchema$2 = _enum([
21301
21387
  "debug",
21302
21388
  "info",
21303
21389
  "warn",
@@ -21504,7 +21590,7 @@ var CustomActionInputSchema = object({
21504
21590
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21505
21591
  addonId: string(),
21506
21592
  limit: number().min(1).max(500).default(100),
21507
- level: LogLevelSchema$1.optional()
21593
+ level: LogLevelSchema$2.optional()
21508
21594
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21509
21595
  packageName: string(),
21510
21596
  version: string().optional()
@@ -21602,7 +21688,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21602
21688
  auth: "admin"
21603
21689
  }), method(object({
21604
21690
  addonId: string(),
21605
- level: LogLevelSchema$1.optional()
21691
+ level: LogLevelSchema$2.optional()
21606
21692
  }), LogStreamEntrySchema, { kind: "subscription" });
21607
21693
  /**
21608
21694
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23334,6 +23420,35 @@ var FaceFilterEnum = _enum([
23334
23420
  "identified",
23335
23421
  "all"
23336
23422
  ]);
23423
+ /**
23424
+ * What a `listRecentFaces` page is ORDERED BY.
23425
+ *
23426
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23427
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23428
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23429
+ * order: it puts the suggestions an operator can confirm with one tap at the
23430
+ * top, and it is the reason this enum exists — a client that ranked a capped
23431
+ * page client-side was ranking the newest N, never the most certain N.
23432
+ *
23433
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23434
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23435
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23436
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23437
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23438
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23439
+ * then by faceId, and is what makes this a total order instead of the
23440
+ * backend's NULL-collation accident.
23441
+ */
23442
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23443
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23444
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23445
+ * never leaves the server. */
23446
+ var FaceClusterSchema = object({
23447
+ faceIds: array(string()).readonly(),
23448
+ representativeFaceId: string(),
23449
+ size: number().int(),
23450
+ cohesion: number()
23451
+ });
23337
23452
  var MediaFileLiteSchema$1 = object({
23338
23453
  key: string(),
23339
23454
  kind: string(),
@@ -23380,24 +23495,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23380
23495
  kind: "mutation",
23381
23496
  auth: "admin"
23382
23497
  }), method(object({
23383
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23498
+ /**
23499
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23500
+ *
23501
+ * The legacy single-camera form, kept verbatim for every caller that
23502
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23503
+ * instead — never both: `deviceIds` is the authority whenever it is
23504
+ * present, and this field is then ignored rather than unioned, so
23505
+ * there is exactly one answer to "which cameras did I ask for".
23506
+ */
23384
23507
  deviceId: number().int().optional(),
23508
+ /**
23509
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23510
+ * until now had to fetch the cluster-wide page and drop rows in the
23511
+ * client (so the `limit` it asked for was spent on cameras it was
23512
+ * about to discard).
23513
+ *
23514
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23515
+ * "every camera". A request for no devices is a request, not an
23516
+ * omission; same contract as `deviceManager.listFleet` and
23517
+ * `pipelineAnalytics.listRecentTracks`.
23518
+ *
23519
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23520
+ */
23521
+ deviceIds: array(number().int()).optional(),
23385
23522
  limit: number().int().positive().optional(),
23386
23523
  filter: FaceFilterEnum.optional(),
23387
23524
  /**
23388
- * Inline the base64 crop on every row. Default `true` — the existing
23389
- * behaviour, kept so no caller breaks.
23525
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23526
+ * Absent means no lower bound.
23527
+ */
23528
+ since: number().int().optional(),
23529
+ /**
23530
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23531
+ * Absent means no upper bound.
23532
+ */
23533
+ until: number().int().optional(),
23534
+ /**
23535
+ * Order the page by time or by suggestion certainty. Default
23536
+ * `'timestamp'` — the historical order, unchanged for every caller
23537
+ * that does not ask.
23390
23538
  *
23391
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23392
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23393
- * the browser cache the images.
23539
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23540
+ * does under `'suggestionConfidence'`.
23394
23541
  *
23395
- * **This is an INPUT field, so it does not reach the addon until the
23396
- * next train.** The hub router validates cap inputs against its own
23397
- * compiled Zod, which strips a key it does not know verified today
23398
- * on the OUTPUT side, where an additive field DOES arrive immediately
23399
- * (`Track.hasFace`). Until the train ships, sending `false` is
23400
- * harmless and simply keeps the crops inline.
23542
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23543
+ * index and stops reading as soon as `limit` rows have PASSED the
23544
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23545
+ * certain row may be the oldest so it walks the window. Narrow it
23546
+ * with {@link since} / {@link until}.
23547
+ */
23548
+ sortBy: FaceSortFieldEnum.optional(),
23549
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23550
+ sortDirection: FaceSortDirectionEnum.optional(),
23551
+ /**
23552
+ * Inline the base64 crop on every row.
23553
+ *
23554
+ * Default `false` since the 2026-08-25 inversion — see
23555
+ * `include-crops-default.ts`, which is the ONE place that resolves
23556
+ * this for every gallery, and which records why the inline shape had
23557
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23558
+ * The doc here used to still say `true`; it was wrong, and a leftover
23559
+ * that describes the old design reads as permission to rely on it.
23560
+ *
23561
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23562
+ * which the browser fetches off the `event-media` plane in parallel,
23563
+ * cached and ETagged.
23401
23564
  */
23402
23565
  includeCrops: boolean().optional()
23403
23566
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23433,13 +23596,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23433
23596
  }), method(object({
23434
23597
  threshold: number().min(0).max(1).optional(),
23435
23598
  minClusterSize: number().int().min(2).optional(),
23436
- limit: number().int().positive().optional()
23437
- }).optional(), array(object({
23438
- faceIds: array(string()).readonly(),
23439
- representativeFaceId: string(),
23440
- size: number().int(),
23441
- cohesion: number()
23442
- })).readonly());
23599
+ /**
23600
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23601
+ * which read as though it bounded the work — it never did.
23602
+ *
23603
+ * Wins over {@link limit} when both are sent.
23604
+ */
23605
+ maxClusters: number().int().positive().optional(),
23606
+ /**
23607
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23608
+ * RESULT, not the scan. Kept so existing callers keep working; send
23609
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23610
+ */
23611
+ limit: number().int().positive().optional(),
23612
+ /**
23613
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23614
+ * POOL, not the result.
23615
+ *
23616
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23617
+ * used to read every unassigned face on the hub no matter what the
23618
+ * caller asked for, because the only bound cut the finished clusters
23619
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23620
+ * whole corpus, on an addon whose disk is under contention.
23621
+ *
23622
+ * The pool is the NEWEST matching faces first — the same order the
23623
+ * gallery shows — so a bound here shortens the horizon, it does not
23624
+ * sample it randomly.
23625
+ *
23626
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23627
+ * so the live corpus — 372 face rows — is unaffected while the
23628
+ * unbounded scan can never come back as the table grows.
23629
+ */
23630
+ maxFacesScanned: number().int().positive().optional()
23631
+ }).optional(), array(FaceClusterSchema).readonly());
23443
23632
  /**
23444
23633
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23445
23634
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27197,6 +27386,39 @@ var ReadGopBytesResultSchema = object({
27197
27386
  /** Media ms the returned fragment covers. */
27198
27387
  gopDurMs: number()
27199
27388
  });
27389
+ /**
27390
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27391
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27392
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27393
+ * a replay needs several seconds of native pixels, not one frame.
27394
+ *
27395
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27396
+ * is `false` when the returned bytes were cut short by the read's own safety
27397
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27398
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27399
+ * degradation: a window whose end falls past the covering segment would need
27400
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27401
+ * not one standalone-demuxable stream — the caller's answer is to request a
27402
+ * shorter window or one aligned to a single segment, not to receive spliced
27403
+ * bytes nothing has proven decodable.
27404
+ */
27405
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27406
+ kind: literal("ok"),
27407
+ data: _instanceof(Uint8Array),
27408
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27409
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27410
+ gopStartMs: number(),
27411
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27412
+ gopDurMs: number(),
27413
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27414
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27415
+ reachesRequestedEnd: boolean()
27416
+ }), object({
27417
+ kind: literal("spans-multiple-segments"),
27418
+ /** Where the covering segment's own footage runs out — informational,
27419
+ * not a retry hint (retrying the same window would refuse again). */
27420
+ segmentEndMs: number()
27421
+ })]);
27200
27422
  method(object({
27201
27423
  deviceId: number(),
27202
27424
  fromMs: number(),
@@ -27247,6 +27469,15 @@ method(object({
27247
27469
  }), ReadGopBytesResultSchema, {
27248
27470
  kind: "query",
27249
27471
  auth: "admin"
27472
+ }), method(object({
27473
+ deviceId: number(),
27474
+ profile: string(),
27475
+ startMs: number(),
27476
+ fromMs: number(),
27477
+ toMs: number()
27478
+ }), ReadWindowBytesResultSchema, {
27479
+ kind: "query",
27480
+ auth: "admin"
27250
27481
  }), method(object({
27251
27482
  deviceId: number(),
27252
27483
  config: RecordingConfigSchema
@@ -28339,6 +28570,211 @@ var SetSiteLocationInputSchema = object({
28339
28570
  latitude: number().min(-90).max(90),
28340
28571
  longitude: number().min(-180).max(180)
28341
28572
  }).nullable();
28573
+ /**
28574
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28575
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28576
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28577
+ * already prints - never a token, never an `Authorization` header.
28578
+ */
28579
+ var RequestCensusGroupSchema = object({
28580
+ procedure: string(),
28581
+ userAgent: string(),
28582
+ ip: string(),
28583
+ principal: string(),
28584
+ calls: number(),
28585
+ perMin: number()
28586
+ });
28587
+ /**
28588
+ * A procedure's TOTAL over the window, across every caller.
28589
+ *
28590
+ * This block, not the group list, is what answers "did these calls arrive over
28591
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28592
+ * same window excludes the HTTP plane, which is a result, not a failure.
28593
+ */
28594
+ var RequestCensusProcedureSchema = object({
28595
+ procedure: string(),
28596
+ calls: number(),
28597
+ perMin: number()
28598
+ });
28599
+ /**
28600
+ * The census as an operator sees it.
28601
+ *
28602
+ * `persisted` is the honest answer to "will this survive the restart I am
28603
+ * about to do": the arm deadline is written to `system-settings` so a window
28604
+ * armed now can measure the NEXT boot, and a write that failed must not look
28605
+ * like one that succeeded.
28606
+ */
28607
+ var RequestCensusStatusSchema = object({
28608
+ armed: boolean(),
28609
+ /** How long the current - or just-closed - window collected, in ms. */
28610
+ elapsedMs: number(),
28611
+ /** The window actually armed, after the server clamped the request. */
28612
+ windowMs: number(),
28613
+ /** Epoch ms the window closes at. 0 when disarmed. */
28614
+ armedUntilMs: number(),
28615
+ httpRequests: number(),
28616
+ batchedRequests: number(),
28617
+ /**
28618
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28619
+ * is in play (`?batch=1` carries several procedures in one request); this is
28620
+ * the number comparable with a store-side call count.
28621
+ */
28622
+ procedureCalls: number(),
28623
+ /**
28624
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28625
+ * transport resolves one context per connection - but the number that says
28626
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28627
+ */
28628
+ wsConnections: number(),
28629
+ distinctGroups: number(),
28630
+ /** Calls counted in the totals whose group attribution was shed at the
28631
+ * cardinality bound. */
28632
+ unattributedCalls: number(),
28633
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28634
+ groups: array(RequestCensusGroupSchema).readonly()
28635
+ }).extend({ persisted: boolean() });
28636
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28637
+ var LogLevelSchema$1 = _enum([
28638
+ "debug",
28639
+ "info",
28640
+ "warn",
28641
+ "error"
28642
+ ]);
28643
+ /**
28644
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28645
+ *
28646
+ * A diagnostic is anything whose cost is only worth paying while a question is
28647
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28648
+ */
28649
+ var DiagnosticIdSchema = _enum(["request-census"]);
28650
+ /**
28651
+ * The layers of the level hierarchy, general → specific. The most specific
28652
+ * layer that carries an explicit value wins.
28653
+ *
28654
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28655
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28656
+ * grow later would force every consumer of this document to change with it.
28657
+ * Nothing returns `component` today.
28658
+ */
28659
+ var LoggingScopeKindSchema = _enum([
28660
+ "cluster",
28661
+ "node",
28662
+ "component"
28663
+ ]);
28664
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28665
+ var LoggingLevelSourceSchema = _enum([
28666
+ "default",
28667
+ "cluster",
28668
+ "node",
28669
+ "component"
28670
+ ]);
28671
+ /**
28672
+ * One layer of the hierarchy as it actually STANDS.
28673
+ *
28674
+ * `level: null` is the whole reason this array is returned: it is the
28675
+ * difference between "this node is at `info` because I decided it" and
28676
+ * "...because it inherits". An operator who clears an override believing they
28677
+ * are clearing an inherited value has been handed the same defect as the two
28678
+ * contradicting knobs this document exists to remove, moved one floor up.
28679
+ */
28680
+ var LoggingLevelLayerSchema = object({
28681
+ scope: LoggingScopeKindSchema,
28682
+ /** The node this layer speaks for; `null` on the cluster layer. */
28683
+ nodeId: string().nullable(),
28684
+ /** Explicitly set here, or `null` when this layer inherits. */
28685
+ level: LogLevelSchema$1.nullable()
28686
+ });
28687
+ /** What a line is judged against, and WHICH layer decided it. */
28688
+ var LoggingEffectiveSchema = object({
28689
+ level: LogLevelSchema$1,
28690
+ levelSource: LoggingLevelSourceSchema
28691
+ });
28692
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28693
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28694
+ /**
28695
+ * An armed diagnostic, with its DEADLINE.
28696
+ *
28697
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28698
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28699
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28700
+ * `armed` is false — a window is never reported as slightly expired.
28701
+ */
28702
+ var DiagnosticWindowSchema = object({
28703
+ id: DiagnosticIdSchema,
28704
+ armed: boolean(),
28705
+ /** Epoch ms the window closes at. 0 when disarmed. */
28706
+ armedUntilMs: number(),
28707
+ /** Ms left before it expires on its own. 0 when disarmed. */
28708
+ remainingMs: number(),
28709
+ /** Whether the stored deadline is the one the live diagnostic is running —
28710
+ * i.e. whether this window would survive a restart. */
28711
+ persisted: boolean()
28712
+ });
28713
+ /**
28714
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28715
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28716
+ * is a second knob that disagrees with the first the day one of them moves.
28717
+ */
28718
+ var DiagnosticWindowPatchSchema = object({
28719
+ id: DiagnosticIdSchema,
28720
+ armMs: number().int().min(0),
28721
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28722
+ reportEveryMs: number().int().positive().optional()
28723
+ });
28724
+ /**
28725
+ * A PATCH, and patches MERGE.
28726
+ *
28727
+ * A field absent from the patch is left exactly as it was — arming a
28728
+ * diagnostic never resets a level, and setting a level never disarms a window.
28729
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28730
+ * `setAll` already merges, and rebuilding the object is how an absent field
28731
+ * turns into an erased one.
28732
+ */
28733
+ var LoggingSettingsPatchSchema = object({
28734
+ /**
28735
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28736
+ * addressed scope so it inherits again. A value sets it.
28737
+ */
28738
+ level: LogLevelSchema$1.nullable().optional(),
28739
+ /**
28740
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28741
+ * keeps running — a patch is never a full replacement.
28742
+ */
28743
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28744
+ });
28745
+ /**
28746
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28747
+ *
28748
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28749
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28750
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28751
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28752
+ * by an agent that holds no cluster document at all. The hub is the single
28753
+ * authority over the whole hierarchy and answers for every layer, so the
28754
+ * layer selector needs a name the transport does not already own.
28755
+ */
28756
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28757
+ var SetLoggingSettingsInputSchema = object({
28758
+ scopeNodeId: string().optional(),
28759
+ patch: LoggingSettingsPatchSchema
28760
+ });
28761
+ /**
28762
+ * The whole document, as read and as returned after every write.
28763
+ *
28764
+ * `persisted: false` means the settings store could not be read or written.
28765
+ * The in-memory mirror still governs behaviour and is unchanged by the
28766
+ * failure — a read that fails neither switches a level nor disarms a window
28767
+ * (D49) — but the operator is told that what they are looking at would not
28768
+ * survive a restart.
28769
+ */
28770
+ var LoggingSettingsStateSchema = object({
28771
+ /** The layer this document was read at. `null` = the cluster layer. */
28772
+ scopeNodeId: string().nullable(),
28773
+ effective: LoggingEffectiveSchema,
28774
+ explicit: LoggingExplicitSchema,
28775
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28776
+ persisted: boolean()
28777
+ });
28342
28778
  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(), {
28343
28779
  kind: "mutation",
28344
28780
  auth: "admin"
@@ -28351,6 +28787,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28351
28787
  }), method(_void(), SiteLocationStatusSchema, {
28352
28788
  kind: "mutation",
28353
28789
  auth: "admin"
28790
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28791
+ kind: "mutation",
28792
+ auth: "admin"
28354
28793
  });
28355
28794
  /**
28356
28795
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33400,6 +33839,12 @@ Object.freeze({
33400
33839
  addonId: null,
33401
33840
  access: "view"
33402
33841
  },
33842
+ "notificationRules.resolveArtifactUrl": {
33843
+ capName: "notification-rules",
33844
+ capScope: "system",
33845
+ addonId: null,
33846
+ access: "view"
33847
+ },
33403
33848
  "notificationRules.setAlarmConfig": {
33404
33849
  capName: "notification-rules",
33405
33850
  capScope: "system",
@@ -34804,6 +35249,12 @@ Object.freeze({
34804
35249
  addonId: null,
34805
35250
  access: "view"
34806
35251
  },
35252
+ "recording.readWindowBytes": {
35253
+ capName: "recording",
35254
+ capScope: "system",
35255
+ addonId: null,
35256
+ access: "view"
35257
+ },
34807
35258
  "recording.refreshStorageLocationsForMigration": {
34808
35259
  capName: "recording",
34809
35260
  capScope: "system",
@@ -35644,6 +36095,18 @@ Object.freeze({
35644
36095
  addonId: null,
35645
36096
  access: "create"
35646
36097
  },
36098
+ "system.getLoggingSettings": {
36099
+ capName: "system",
36100
+ capScope: "system",
36101
+ addonId: null,
36102
+ access: "view"
36103
+ },
36104
+ "system.getRequestCensus": {
36105
+ capName: "system",
36106
+ capScope: "system",
36107
+ addonId: null,
36108
+ access: "view"
36109
+ },
35647
36110
  "system.getRetentionConfig": {
35648
36111
  capName: "system",
35649
36112
  capScope: "system",
@@ -35674,6 +36137,12 @@ Object.freeze({
35674
36137
  addonId: null,
35675
36138
  access: "view"
35676
36139
  },
36140
+ "system.setLoggingSettings": {
36141
+ capName: "system",
36142
+ capScope: "system",
36143
+ addonId: null,
36144
+ access: "create"
36145
+ },
35677
36146
  "system.setRetentionConfig": {
35678
36147
  capName: "system",
35679
36148
  capScope: "system",
@@ -36829,6 +37298,10 @@ Object.freeze({
36829
37298
  name: "deviceId",
36830
37299
  form: "single",
36831
37300
  optional: true
37301
+ }, {
37302
+ name: "deviceIds",
37303
+ form: "array",
37304
+ optional: true
36832
37305
  }],
36833
37306
  "fanControl.setDirection": [{
36834
37307
  name: "deviceId",
@@ -37634,6 +38107,11 @@ Object.freeze({
37634
38107
  form: "single",
37635
38108
  optional: false
37636
38109
  }],
38110
+ "recording.readWindowBytes": [{
38111
+ name: "deviceId",
38112
+ form: "single",
38113
+ optional: false
38114
+ }],
37637
38115
  "recording.relocateFootage": [{
37638
38116
  name: "deviceId",
37639
38117
  form: "single",
@@ -38434,7 +38912,38 @@ object({
38434
38912
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38435
38913
  * reproduce that.
38436
38914
  */
38437
- tileBudgetMb: number().int().min(0).max(1024)
38915
+ tileBudgetMb: number().int().min(0).max(1024),
38916
+ /**
38917
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38918
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38919
+ * subject tiles, on frames that detected something.
38920
+ *
38921
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38922
+ * containment is strict by design, so the native `keyFrame`, the detail
38923
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38924
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38925
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38926
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38927
+ *
38928
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38929
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38930
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38931
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38932
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38933
+ * binds only through a detection burst, where it still covers well past the
38934
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38935
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38936
+ * whole shape exists to avoid.
38937
+ *
38938
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38939
+ * subject tile, so one shared budget would let a busy camera's key frames
38940
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38941
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38942
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38943
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38944
+ * nothing.
38945
+ */
38946
+ sceneBudgetMb: number().int().min(0).max(1024)
38438
38947
  });
38439
38948
  /**
38440
38949
  * The values in force when the operator has set nothing.
@@ -38450,12 +38959,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38450
38959
  budgetMb: 1024,
38451
38960
  activityMs: 15e3,
38452
38961
  tileBudgetMb: 64,
38962
+ sceneBudgetMb: 48,
38453
38963
  admission: "inferred"
38454
38964
  };
38455
38965
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38456
38966
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38457
38967
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38458
38968
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38969
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38459
38970
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38460
38971
  /**
38461
38972
  * Names that, when used as URL query parameters, almost certainly carry