@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.mjs CHANGED
@@ -7558,6 +7558,66 @@ var OpsLogQueryInputSchema = object({
7558
7558
  /** Max rows returned, newest-first. */
7559
7559
  limit: number().int().min(1).max(1e3).optional()
7560
7560
  });
7561
+ var LabelDefinitionSchema = object({
7562
+ id: string(),
7563
+ name: string(),
7564
+ category: string().optional(),
7565
+ description: string().optional(),
7566
+ icon: string().optional()
7567
+ });
7568
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7569
+ var CLASS_MAP_MACRO_TARGETS = [
7570
+ "person",
7571
+ "vehicle",
7572
+ "animal",
7573
+ "package"
7574
+ ];
7575
+ /**
7576
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7577
+ * un operatore può selezionare.
7578
+ *
7579
+ * Sono le tre offerte dallo step `object-detection`
7580
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7581
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7582
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7583
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7584
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7585
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7586
+ *
7587
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7588
+ * dello step e una seconda volta come union `FirstLevelMacro`
7589
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7590
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7591
+ * successiva.
7592
+ */
7593
+ var FIRST_LEVEL_MACRO_CLASSES = [
7594
+ "person",
7595
+ "vehicle",
7596
+ "animal"
7597
+ ];
7598
+ /**
7599
+ * Wire schema for a per-model CATALOG classMap override
7600
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7601
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7602
+ * detection pipeline executor actually routes.
7603
+ *
7604
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7605
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7606
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7607
+ * enum) — the two used to share the name `ClassMapDefinition`/
7608
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7609
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7610
+ * are not: it is two different concepts colliding on a name. Keep this type
7611
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7612
+ * would either narrow every `ClassMapDefinition` consumer to the four
7613
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7614
+ * schema exists for (see the "rejects a classMap whose target is not a
7615
+ * detection macro" test in `model-catalog-schema.test.ts`).
7616
+ */
7617
+ var DetectionCatalogClassMapSchema = object({
7618
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7619
+ preserveOriginal: boolean()
7620
+ });
7561
7621
  /**
7562
7622
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7563
7623
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7580,10 +7640,55 @@ var RecordingStorageModeSchema = _enum([
7580
7640
  "events",
7581
7641
  "continuous"
7582
7642
  ]);
7643
+ /**
7644
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7645
+ * tre offerte dallo step `object-detection`, da UNA lista
7646
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7647
+ */
7648
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7649
+ /**
7650
+ * True quando `values` non ripete un elemento.
7651
+ *
7652
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7653
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7654
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7655
+ */
7656
+ var noDuplicates = (values) => new Set(values).size === values.length;
7583
7657
  /** Which detectors trigger an `events`-mode band. */
7584
7658
  var RecordingTriggersSchema = object({
7585
7659
  motion: boolean().optional(),
7586
- audioThresholdDbfs: number().optional()
7660
+ audioThresholdDbfs: number().optional(),
7661
+ /**
7662
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7663
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7664
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7665
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7666
+ *
7667
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7668
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7669
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7670
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7671
+ * finestre — vedi `recorder/object-trigger.ts`.
7672
+ */
7673
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7674
+ /**
7675
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7676
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7677
+ * `objectClasses`.
7678
+ *
7679
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7680
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7681
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7682
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7683
+ * device (D12) — mai un elenco globale di cap.
7684
+ *
7685
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7686
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7687
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7688
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7689
+ * registrare.
7690
+ */
7691
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7587
7692
  });
7588
7693
  /**
7589
7694
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8035,41 +8140,6 @@ var DecoderSessionConfigSchema = object({
8035
8140
  */
8036
8141
  debug: boolean().optional()
8037
8142
  });
8038
- var LabelDefinitionSchema = object({
8039
- id: string(),
8040
- name: string(),
8041
- category: string().optional(),
8042
- description: string().optional(),
8043
- icon: string().optional()
8044
- });
8045
- /**
8046
- * Wire schema for a per-model CATALOG classMap override
8047
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8048
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8049
- * detection pipeline executor actually routes.
8050
- *
8051
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8052
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8053
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8054
- * enum) — the two used to share the name `ClassMapDefinition`/
8055
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8056
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8057
- * are not: it is two different concepts colliding on a name. Keep this type
8058
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8059
- * would either narrow every `ClassMapDefinition` consumer to the four
8060
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8061
- * schema exists for (see the "rejects a classMap whose target is not a
8062
- * detection macro" test in `model-catalog-schema.test.ts`).
8063
- */
8064
- var DetectionCatalogClassMapSchema = object({
8065
- mapping: record(string(), _enum([
8066
- "person",
8067
- "vehicle",
8068
- "animal",
8069
- "package"
8070
- ])),
8071
- preserveOriginal: boolean()
8072
- });
8073
8143
  var MODEL_FORMATS = [
8074
8144
  "onnx",
8075
8145
  "coreml",
@@ -15814,7 +15884,23 @@ var NcHistoryEntrySchema = object({
15814
15884
  updatedAt: number(),
15815
15885
  /** Failure detail — present on a `dead` row. */
15816
15886
  error: string().optional(),
15817
- subject: NcHistorySubjectSchema
15887
+ subject: NcHistorySubjectSchema,
15888
+ /**
15889
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15890
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15891
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15892
+ * every delivery attempt). Absent on a row still pending/dead, a row
15893
+ * delivered before this field shipped, or a wiring with no artefact index.
15894
+ *
15895
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15896
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15897
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15898
+ * also answers `null` for an id whose artefact has since expired past the
15899
+ * retained shelf's own age bound — the degrade a caller (the Home
15900
+ * Assistant export) must render as "no image right now", never as a
15901
+ * broken link.
15902
+ */
15903
+ artifactIds: array(string().min(1)).optional()
15818
15904
  });
15819
15905
  /**
15820
15906
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16041,7 +16127,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16041
16127
  }), method(object({}), object({
16042
16128
  catalog: array(NcConditionDescriptorSchema),
16043
16129
  taxonomy: NcTaxonomySchema.optional()
16044
- })), 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 }), {
16130
+ })), 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 }), {
16045
16131
  kind: "mutation",
16046
16132
  caller: "required"
16047
16133
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21273,7 +21359,7 @@ var lifecycleJobSchema = object({
21273
21359
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21274
21360
  * as every other cap.
21275
21361
  */
21276
- var LogLevelSchema$1 = _enum([
21362
+ var LogLevelSchema$2 = _enum([
21277
21363
  "debug",
21278
21364
  "info",
21279
21365
  "warn",
@@ -21480,7 +21566,7 @@ var CustomActionInputSchema = object({
21480
21566
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21481
21567
  addonId: string(),
21482
21568
  limit: number().min(1).max(500).default(100),
21483
- level: LogLevelSchema$1.optional()
21569
+ level: LogLevelSchema$2.optional()
21484
21570
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21485
21571
  packageName: string(),
21486
21572
  version: string().optional()
@@ -21578,7 +21664,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21578
21664
  auth: "admin"
21579
21665
  }), method(object({
21580
21666
  addonId: string(),
21581
- level: LogLevelSchema$1.optional()
21667
+ level: LogLevelSchema$2.optional()
21582
21668
  }), LogStreamEntrySchema, { kind: "subscription" });
21583
21669
  /**
21584
21670
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23310,6 +23396,35 @@ var FaceFilterEnum = _enum([
23310
23396
  "identified",
23311
23397
  "all"
23312
23398
  ]);
23399
+ /**
23400
+ * What a `listRecentFaces` page is ORDERED BY.
23401
+ *
23402
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23403
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23404
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23405
+ * order: it puts the suggestions an operator can confirm with one tap at the
23406
+ * top, and it is the reason this enum exists — a client that ranked a capped
23407
+ * page client-side was ranking the newest N, never the most certain N.
23408
+ *
23409
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23410
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23411
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23412
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23413
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23414
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23415
+ * then by faceId, and is what makes this a total order instead of the
23416
+ * backend's NULL-collation accident.
23417
+ */
23418
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23419
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23420
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23421
+ * never leaves the server. */
23422
+ var FaceClusterSchema = object({
23423
+ faceIds: array(string()).readonly(),
23424
+ representativeFaceId: string(),
23425
+ size: number().int(),
23426
+ cohesion: number()
23427
+ });
23313
23428
  var MediaFileLiteSchema$1 = object({
23314
23429
  key: string(),
23315
23430
  kind: string(),
@@ -23356,24 +23471,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23356
23471
  kind: "mutation",
23357
23472
  auth: "admin"
23358
23473
  }), method(object({
23359
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23474
+ /**
23475
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23476
+ *
23477
+ * The legacy single-camera form, kept verbatim for every caller that
23478
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23479
+ * instead — never both: `deviceIds` is the authority whenever it is
23480
+ * present, and this field is then ignored rather than unioned, so
23481
+ * there is exactly one answer to "which cameras did I ask for".
23482
+ */
23360
23483
  deviceId: number().int().optional(),
23484
+ /**
23485
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23486
+ * until now had to fetch the cluster-wide page and drop rows in the
23487
+ * client (so the `limit` it asked for was spent on cameras it was
23488
+ * about to discard).
23489
+ *
23490
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23491
+ * "every camera". A request for no devices is a request, not an
23492
+ * omission; same contract as `deviceManager.listFleet` and
23493
+ * `pipelineAnalytics.listRecentTracks`.
23494
+ *
23495
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23496
+ */
23497
+ deviceIds: array(number().int()).optional(),
23361
23498
  limit: number().int().positive().optional(),
23362
23499
  filter: FaceFilterEnum.optional(),
23363
23500
  /**
23364
- * Inline the base64 crop on every row. Default `true` — the existing
23365
- * behaviour, kept so no caller breaks.
23501
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23502
+ * Absent means no lower bound.
23503
+ */
23504
+ since: number().int().optional(),
23505
+ /**
23506
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23507
+ * Absent means no upper bound.
23508
+ */
23509
+ until: number().int().optional(),
23510
+ /**
23511
+ * Order the page by time or by suggestion certainty. Default
23512
+ * `'timestamp'` — the historical order, unchanged for every caller
23513
+ * that does not ask.
23366
23514
  *
23367
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23368
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23369
- * the browser cache the images.
23515
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23516
+ * does under `'suggestionConfidence'`.
23370
23517
  *
23371
- * **This is an INPUT field, so it does not reach the addon until the
23372
- * next train.** The hub router validates cap inputs against its own
23373
- * compiled Zod, which strips a key it does not know verified today
23374
- * on the OUTPUT side, where an additive field DOES arrive immediately
23375
- * (`Track.hasFace`). Until the train ships, sending `false` is
23376
- * harmless and simply keeps the crops inline.
23518
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23519
+ * index and stops reading as soon as `limit` rows have PASSED the
23520
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23521
+ * certain row may be the oldest so it walks the window. Narrow it
23522
+ * with {@link since} / {@link until}.
23523
+ */
23524
+ sortBy: FaceSortFieldEnum.optional(),
23525
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23526
+ sortDirection: FaceSortDirectionEnum.optional(),
23527
+ /**
23528
+ * Inline the base64 crop on every row.
23529
+ *
23530
+ * Default `false` since the 2026-08-25 inversion — see
23531
+ * `include-crops-default.ts`, which is the ONE place that resolves
23532
+ * this for every gallery, and which records why the inline shape had
23533
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23534
+ * The doc here used to still say `true`; it was wrong, and a leftover
23535
+ * that describes the old design reads as permission to rely on it.
23536
+ *
23537
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23538
+ * which the browser fetches off the `event-media` plane in parallel,
23539
+ * cached and ETagged.
23377
23540
  */
23378
23541
  includeCrops: boolean().optional()
23379
23542
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23409,13 +23572,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23409
23572
  }), method(object({
23410
23573
  threshold: number().min(0).max(1).optional(),
23411
23574
  minClusterSize: number().int().min(2).optional(),
23412
- limit: number().int().positive().optional()
23413
- }).optional(), array(object({
23414
- faceIds: array(string()).readonly(),
23415
- representativeFaceId: string(),
23416
- size: number().int(),
23417
- cohesion: number()
23418
- })).readonly());
23575
+ /**
23576
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23577
+ * which read as though it bounded the work — it never did.
23578
+ *
23579
+ * Wins over {@link limit} when both are sent.
23580
+ */
23581
+ maxClusters: number().int().positive().optional(),
23582
+ /**
23583
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23584
+ * RESULT, not the scan. Kept so existing callers keep working; send
23585
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23586
+ */
23587
+ limit: number().int().positive().optional(),
23588
+ /**
23589
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23590
+ * POOL, not the result.
23591
+ *
23592
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23593
+ * used to read every unassigned face on the hub no matter what the
23594
+ * caller asked for, because the only bound cut the finished clusters
23595
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23596
+ * whole corpus, on an addon whose disk is under contention.
23597
+ *
23598
+ * The pool is the NEWEST matching faces first — the same order the
23599
+ * gallery shows — so a bound here shortens the horizon, it does not
23600
+ * sample it randomly.
23601
+ *
23602
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23603
+ * so the live corpus — 372 face rows — is unaffected while the
23604
+ * unbounded scan can never come back as the table grows.
23605
+ */
23606
+ maxFacesScanned: number().int().positive().optional()
23607
+ }).optional(), array(FaceClusterSchema).readonly());
23419
23608
  /**
23420
23609
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23421
23610
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27173,6 +27362,39 @@ var ReadGopBytesResultSchema = object({
27173
27362
  /** Media ms the returned fragment covers. */
27174
27363
  gopDurMs: number()
27175
27364
  });
27365
+ /**
27366
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27367
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27368
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27369
+ * a replay needs several seconds of native pixels, not one frame.
27370
+ *
27371
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27372
+ * is `false` when the returned bytes were cut short by the read's own safety
27373
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27374
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27375
+ * degradation: a window whose end falls past the covering segment would need
27376
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27377
+ * not one standalone-demuxable stream — the caller's answer is to request a
27378
+ * shorter window or one aligned to a single segment, not to receive spliced
27379
+ * bytes nothing has proven decodable.
27380
+ */
27381
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27382
+ kind: literal("ok"),
27383
+ data: _instanceof(Uint8Array),
27384
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27385
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27386
+ gopStartMs: number(),
27387
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27388
+ gopDurMs: number(),
27389
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27390
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27391
+ reachesRequestedEnd: boolean()
27392
+ }), object({
27393
+ kind: literal("spans-multiple-segments"),
27394
+ /** Where the covering segment's own footage runs out — informational,
27395
+ * not a retry hint (retrying the same window would refuse again). */
27396
+ segmentEndMs: number()
27397
+ })]);
27176
27398
  method(object({
27177
27399
  deviceId: number(),
27178
27400
  fromMs: number(),
@@ -27223,6 +27445,15 @@ method(object({
27223
27445
  }), ReadGopBytesResultSchema, {
27224
27446
  kind: "query",
27225
27447
  auth: "admin"
27448
+ }), method(object({
27449
+ deviceId: number(),
27450
+ profile: string(),
27451
+ startMs: number(),
27452
+ fromMs: number(),
27453
+ toMs: number()
27454
+ }), ReadWindowBytesResultSchema, {
27455
+ kind: "query",
27456
+ auth: "admin"
27226
27457
  }), method(object({
27227
27458
  deviceId: number(),
27228
27459
  config: RecordingConfigSchema
@@ -28315,6 +28546,211 @@ var SetSiteLocationInputSchema = object({
28315
28546
  latitude: number().min(-90).max(90),
28316
28547
  longitude: number().min(-180).max(180)
28317
28548
  }).nullable();
28549
+ /**
28550
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28551
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28552
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28553
+ * already prints - never a token, never an `Authorization` header.
28554
+ */
28555
+ var RequestCensusGroupSchema = object({
28556
+ procedure: string(),
28557
+ userAgent: string(),
28558
+ ip: string(),
28559
+ principal: string(),
28560
+ calls: number(),
28561
+ perMin: number()
28562
+ });
28563
+ /**
28564
+ * A procedure's TOTAL over the window, across every caller.
28565
+ *
28566
+ * This block, not the group list, is what answers "did these calls arrive over
28567
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28568
+ * same window excludes the HTTP plane, which is a result, not a failure.
28569
+ */
28570
+ var RequestCensusProcedureSchema = object({
28571
+ procedure: string(),
28572
+ calls: number(),
28573
+ perMin: number()
28574
+ });
28575
+ /**
28576
+ * The census as an operator sees it.
28577
+ *
28578
+ * `persisted` is the honest answer to "will this survive the restart I am
28579
+ * about to do": the arm deadline is written to `system-settings` so a window
28580
+ * armed now can measure the NEXT boot, and a write that failed must not look
28581
+ * like one that succeeded.
28582
+ */
28583
+ var RequestCensusStatusSchema = object({
28584
+ armed: boolean(),
28585
+ /** How long the current - or just-closed - window collected, in ms. */
28586
+ elapsedMs: number(),
28587
+ /** The window actually armed, after the server clamped the request. */
28588
+ windowMs: number(),
28589
+ /** Epoch ms the window closes at. 0 when disarmed. */
28590
+ armedUntilMs: number(),
28591
+ httpRequests: number(),
28592
+ batchedRequests: number(),
28593
+ /**
28594
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28595
+ * is in play (`?batch=1` carries several procedures in one request); this is
28596
+ * the number comparable with a store-side call count.
28597
+ */
28598
+ procedureCalls: number(),
28599
+ /**
28600
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28601
+ * transport resolves one context per connection - but the number that says
28602
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28603
+ */
28604
+ wsConnections: number(),
28605
+ distinctGroups: number(),
28606
+ /** Calls counted in the totals whose group attribution was shed at the
28607
+ * cardinality bound. */
28608
+ unattributedCalls: number(),
28609
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28610
+ groups: array(RequestCensusGroupSchema).readonly()
28611
+ }).extend({ persisted: boolean() });
28612
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28613
+ var LogLevelSchema$1 = _enum([
28614
+ "debug",
28615
+ "info",
28616
+ "warn",
28617
+ "error"
28618
+ ]);
28619
+ /**
28620
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28621
+ *
28622
+ * A diagnostic is anything whose cost is only worth paying while a question is
28623
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28624
+ */
28625
+ var DiagnosticIdSchema = _enum(["request-census"]);
28626
+ /**
28627
+ * The layers of the level hierarchy, general → specific. The most specific
28628
+ * layer that carries an explicit value wins.
28629
+ *
28630
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28631
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28632
+ * grow later would force every consumer of this document to change with it.
28633
+ * Nothing returns `component` today.
28634
+ */
28635
+ var LoggingScopeKindSchema = _enum([
28636
+ "cluster",
28637
+ "node",
28638
+ "component"
28639
+ ]);
28640
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28641
+ var LoggingLevelSourceSchema = _enum([
28642
+ "default",
28643
+ "cluster",
28644
+ "node",
28645
+ "component"
28646
+ ]);
28647
+ /**
28648
+ * One layer of the hierarchy as it actually STANDS.
28649
+ *
28650
+ * `level: null` is the whole reason this array is returned: it is the
28651
+ * difference between "this node is at `info` because I decided it" and
28652
+ * "...because it inherits". An operator who clears an override believing they
28653
+ * are clearing an inherited value has been handed the same defect as the two
28654
+ * contradicting knobs this document exists to remove, moved one floor up.
28655
+ */
28656
+ var LoggingLevelLayerSchema = object({
28657
+ scope: LoggingScopeKindSchema,
28658
+ /** The node this layer speaks for; `null` on the cluster layer. */
28659
+ nodeId: string().nullable(),
28660
+ /** Explicitly set here, or `null` when this layer inherits. */
28661
+ level: LogLevelSchema$1.nullable()
28662
+ });
28663
+ /** What a line is judged against, and WHICH layer decided it. */
28664
+ var LoggingEffectiveSchema = object({
28665
+ level: LogLevelSchema$1,
28666
+ levelSource: LoggingLevelSourceSchema
28667
+ });
28668
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28669
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28670
+ /**
28671
+ * An armed diagnostic, with its DEADLINE.
28672
+ *
28673
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28674
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28675
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28676
+ * `armed` is false — a window is never reported as slightly expired.
28677
+ */
28678
+ var DiagnosticWindowSchema = object({
28679
+ id: DiagnosticIdSchema,
28680
+ armed: boolean(),
28681
+ /** Epoch ms the window closes at. 0 when disarmed. */
28682
+ armedUntilMs: number(),
28683
+ /** Ms left before it expires on its own. 0 when disarmed. */
28684
+ remainingMs: number(),
28685
+ /** Whether the stored deadline is the one the live diagnostic is running —
28686
+ * i.e. whether this window would survive a restart. */
28687
+ persisted: boolean()
28688
+ });
28689
+ /**
28690
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28691
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28692
+ * is a second knob that disagrees with the first the day one of them moves.
28693
+ */
28694
+ var DiagnosticWindowPatchSchema = object({
28695
+ id: DiagnosticIdSchema,
28696
+ armMs: number().int().min(0),
28697
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28698
+ reportEveryMs: number().int().positive().optional()
28699
+ });
28700
+ /**
28701
+ * A PATCH, and patches MERGE.
28702
+ *
28703
+ * A field absent from the patch is left exactly as it was — arming a
28704
+ * diagnostic never resets a level, and setting a level never disarms a window.
28705
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28706
+ * `setAll` already merges, and rebuilding the object is how an absent field
28707
+ * turns into an erased one.
28708
+ */
28709
+ var LoggingSettingsPatchSchema = object({
28710
+ /**
28711
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28712
+ * addressed scope so it inherits again. A value sets it.
28713
+ */
28714
+ level: LogLevelSchema$1.nullable().optional(),
28715
+ /**
28716
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28717
+ * keeps running — a patch is never a full replacement.
28718
+ */
28719
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28720
+ });
28721
+ /**
28722
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28723
+ *
28724
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28725
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28726
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28727
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28728
+ * by an agent that holds no cluster document at all. The hub is the single
28729
+ * authority over the whole hierarchy and answers for every layer, so the
28730
+ * layer selector needs a name the transport does not already own.
28731
+ */
28732
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28733
+ var SetLoggingSettingsInputSchema = object({
28734
+ scopeNodeId: string().optional(),
28735
+ patch: LoggingSettingsPatchSchema
28736
+ });
28737
+ /**
28738
+ * The whole document, as read and as returned after every write.
28739
+ *
28740
+ * `persisted: false` means the settings store could not be read or written.
28741
+ * The in-memory mirror still governs behaviour and is unchanged by the
28742
+ * failure — a read that fails neither switches a level nor disarms a window
28743
+ * (D49) — but the operator is told that what they are looking at would not
28744
+ * survive a restart.
28745
+ */
28746
+ var LoggingSettingsStateSchema = object({
28747
+ /** The layer this document was read at. `null` = the cluster layer. */
28748
+ scopeNodeId: string().nullable(),
28749
+ effective: LoggingEffectiveSchema,
28750
+ explicit: LoggingExplicitSchema,
28751
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28752
+ persisted: boolean()
28753
+ });
28318
28754
  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(), {
28319
28755
  kind: "mutation",
28320
28756
  auth: "admin"
@@ -28327,6 +28763,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28327
28763
  }), method(_void(), SiteLocationStatusSchema, {
28328
28764
  kind: "mutation",
28329
28765
  auth: "admin"
28766
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28767
+ kind: "mutation",
28768
+ auth: "admin"
28330
28769
  });
28331
28770
  /**
28332
28771
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33376,6 +33815,12 @@ Object.freeze({
33376
33815
  addonId: null,
33377
33816
  access: "view"
33378
33817
  },
33818
+ "notificationRules.resolveArtifactUrl": {
33819
+ capName: "notification-rules",
33820
+ capScope: "system",
33821
+ addonId: null,
33822
+ access: "view"
33823
+ },
33379
33824
  "notificationRules.setAlarmConfig": {
33380
33825
  capName: "notification-rules",
33381
33826
  capScope: "system",
@@ -34780,6 +35225,12 @@ Object.freeze({
34780
35225
  addonId: null,
34781
35226
  access: "view"
34782
35227
  },
35228
+ "recording.readWindowBytes": {
35229
+ capName: "recording",
35230
+ capScope: "system",
35231
+ addonId: null,
35232
+ access: "view"
35233
+ },
34783
35234
  "recording.refreshStorageLocationsForMigration": {
34784
35235
  capName: "recording",
34785
35236
  capScope: "system",
@@ -35620,6 +36071,18 @@ Object.freeze({
35620
36071
  addonId: null,
35621
36072
  access: "create"
35622
36073
  },
36074
+ "system.getLoggingSettings": {
36075
+ capName: "system",
36076
+ capScope: "system",
36077
+ addonId: null,
36078
+ access: "view"
36079
+ },
36080
+ "system.getRequestCensus": {
36081
+ capName: "system",
36082
+ capScope: "system",
36083
+ addonId: null,
36084
+ access: "view"
36085
+ },
35623
36086
  "system.getRetentionConfig": {
35624
36087
  capName: "system",
35625
36088
  capScope: "system",
@@ -35650,6 +36113,12 @@ Object.freeze({
35650
36113
  addonId: null,
35651
36114
  access: "view"
35652
36115
  },
36116
+ "system.setLoggingSettings": {
36117
+ capName: "system",
36118
+ capScope: "system",
36119
+ addonId: null,
36120
+ access: "create"
36121
+ },
35653
36122
  "system.setRetentionConfig": {
35654
36123
  capName: "system",
35655
36124
  capScope: "system",
@@ -36805,6 +37274,10 @@ Object.freeze({
36805
37274
  name: "deviceId",
36806
37275
  form: "single",
36807
37276
  optional: true
37277
+ }, {
37278
+ name: "deviceIds",
37279
+ form: "array",
37280
+ optional: true
36808
37281
  }],
36809
37282
  "fanControl.setDirection": [{
36810
37283
  name: "deviceId",
@@ -37610,6 +38083,11 @@ Object.freeze({
37610
38083
  form: "single",
37611
38084
  optional: false
37612
38085
  }],
38086
+ "recording.readWindowBytes": [{
38087
+ name: "deviceId",
38088
+ form: "single",
38089
+ optional: false
38090
+ }],
37613
38091
  "recording.relocateFootage": [{
37614
38092
  name: "deviceId",
37615
38093
  form: "single",
@@ -38410,7 +38888,38 @@ object({
38410
38888
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38411
38889
  * reproduce that.
38412
38890
  */
38413
- tileBudgetMb: number().int().min(0).max(1024)
38891
+ tileBudgetMb: number().int().min(0).max(1024),
38892
+ /**
38893
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38894
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38895
+ * subject tiles, on frames that detected something.
38896
+ *
38897
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38898
+ * containment is strict by design, so the native `keyFrame`, the detail
38899
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38900
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38901
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38902
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38903
+ *
38904
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38905
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38906
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38907
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38908
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38909
+ * binds only through a detection burst, where it still covers well past the
38910
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38911
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38912
+ * whole shape exists to avoid.
38913
+ *
38914
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38915
+ * subject tile, so one shared budget would let a busy camera's key frames
38916
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38917
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38918
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38919
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38920
+ * nothing.
38921
+ */
38922
+ sceneBudgetMb: number().int().min(0).max(1024)
38414
38923
  });
38415
38924
  /**
38416
38925
  * The values in force when the operator has set nothing.
@@ -38426,12 +38935,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38426
38935
  budgetMb: 1024,
38427
38936
  activityMs: 15e3,
38428
38937
  tileBudgetMb: 64,
38938
+ sceneBudgetMb: 48,
38429
38939
  admission: "inferred"
38430
38940
  };
38431
38941
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38432
38942
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38433
38943
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38434
38944
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38945
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38435
38946
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38436
38947
  /**
38437
38948
  * Names that, when used as URL query parameters, almost certainly carry