@camstack/addon-provider-rademacher 0.2.29 → 0.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/addon.js +572 -61
  2. package/dist/addon.mjs +572 -61
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -8511,6 +8511,66 @@ var OpsLogQueryInputSchema = object({
8511
8511
  /** Max rows returned, newest-first. */
8512
8512
  limit: number().int().min(1).max(1e3).optional()
8513
8513
  });
8514
+ var LabelDefinitionSchema = object({
8515
+ id: string(),
8516
+ name: string(),
8517
+ category: string().optional(),
8518
+ description: string().optional(),
8519
+ icon: string().optional()
8520
+ });
8521
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
8522
+ var CLASS_MAP_MACRO_TARGETS = [
8523
+ "person",
8524
+ "vehicle",
8525
+ "animal",
8526
+ "package"
8527
+ ];
8528
+ /**
8529
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
8530
+ * un operatore può selezionare.
8531
+ *
8532
+ * Sono le tre offerte dallo step `object-detection`
8533
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
8534
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
8535
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
8536
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
8537
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
8538
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
8539
+ *
8540
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
8541
+ * dello step e una seconda volta come union `FirstLevelMacro`
8542
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
8543
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
8544
+ * successiva.
8545
+ */
8546
+ var FIRST_LEVEL_MACRO_CLASSES = [
8547
+ "person",
8548
+ "vehicle",
8549
+ "animal"
8550
+ ];
8551
+ /**
8552
+ * Wire schema for a per-model CATALOG classMap override
8553
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8554
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8555
+ * detection pipeline executor actually routes.
8556
+ *
8557
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8558
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8559
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8560
+ * enum) — the two used to share the name `ClassMapDefinition`/
8561
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8562
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8563
+ * are not: it is two different concepts colliding on a name. Keep this type
8564
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
8565
+ * would either narrow every `ClassMapDefinition` consumer to the four
8566
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8567
+ * schema exists for (see the "rejects a classMap whose target is not a
8568
+ * detection macro" test in `model-catalog-schema.test.ts`).
8569
+ */
8570
+ var DetectionCatalogClassMapSchema = object({
8571
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
8572
+ preserveOriginal: boolean()
8573
+ });
8514
8574
  /**
8515
8575
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
8516
8576
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -8533,10 +8593,55 @@ var RecordingStorageModeSchema = _enum([
8533
8593
  "events",
8534
8594
  "continuous"
8535
8595
  ]);
8596
+ /**
8597
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
8598
+ * tre offerte dallo step `object-detection`, da UNA lista
8599
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
8600
+ */
8601
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
8602
+ /**
8603
+ * True quando `values` non ripete un elemento.
8604
+ *
8605
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
8606
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
8607
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
8608
+ */
8609
+ var noDuplicates = (values) => new Set(values).size === values.length;
8536
8610
  /** Which detectors trigger an `events`-mode band. */
8537
8611
  var RecordingTriggersSchema = object({
8538
8612
  motion: boolean().optional(),
8539
- audioThresholdDbfs: number().optional()
8613
+ audioThresholdDbfs: number().optional(),
8614
+ /**
8615
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
8616
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
8617
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
8618
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
8619
+ *
8620
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
8621
+ * quelle che hanno attraversato `enabledMacroClasses`, i
8622
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
8623
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
8624
+ * finestre — vedi `recorder/object-trigger.ts`.
8625
+ */
8626
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
8627
+ /**
8628
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
8629
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
8630
+ * `objectClasses`.
8631
+ *
8632
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
8633
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
8634
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
8635
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
8636
+ * device (D12) — mai un elenco globale di cap.
8637
+ *
8638
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
8639
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
8640
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
8641
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
8642
+ * registrare.
8643
+ */
8644
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8540
8645
  });
8541
8646
  /**
8542
8647
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8988,41 +9093,6 @@ var DecoderSessionConfigSchema = object({
8988
9093
  */
8989
9094
  debug: boolean().optional()
8990
9095
  });
8991
- var LabelDefinitionSchema = object({
8992
- id: string(),
8993
- name: string(),
8994
- category: string().optional(),
8995
- description: string().optional(),
8996
- icon: string().optional()
8997
- });
8998
- /**
8999
- * Wire schema for a per-model CATALOG classMap override
9000
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
9001
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
9002
- * detection pipeline executor actually routes.
9003
- *
9004
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
9005
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
9006
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
9007
- * enum) — the two used to share the name `ClassMapDefinition`/
9008
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
9009
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
9010
- * are not: it is two different concepts colliding on a name. Keep this type
9011
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
9012
- * would either narrow every `ClassMapDefinition` consumer to the four
9013
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
9014
- * schema exists for (see the "rejects a classMap whose target is not a
9015
- * detection macro" test in `model-catalog-schema.test.ts`).
9016
- */
9017
- var DetectionCatalogClassMapSchema = object({
9018
- mapping: record(string(), _enum([
9019
- "person",
9020
- "vehicle",
9021
- "animal",
9022
- "package"
9023
- ])),
9024
- preserveOriginal: boolean()
9025
- });
9026
9096
  var MODEL_FORMATS = [
9027
9097
  "onnx",
9028
9098
  "coreml",
@@ -16767,7 +16837,23 @@ var NcHistoryEntrySchema = object({
16767
16837
  updatedAt: number(),
16768
16838
  /** Failure detail — present on a `dead` row. */
16769
16839
  error: string().optional(),
16770
- subject: NcHistorySubjectSchema
16840
+ subject: NcHistorySubjectSchema,
16841
+ /**
16842
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
16843
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
16844
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
16845
+ * every delivery attempt). Absent on a row still pending/dead, a row
16846
+ * delivered before this field shipped, or a wiring with no artefact index.
16847
+ *
16848
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
16849
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
16850
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
16851
+ * also answers `null` for an id whose artefact has since expired past the
16852
+ * retained shelf's own age bound — the degrade a caller (the Home
16853
+ * Assistant export) must render as "no image right now", never as a
16854
+ * broken link.
16855
+ */
16856
+ artifactIds: array(string().min(1)).optional()
16771
16857
  });
16772
16858
  /**
16773
16859
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16994,7 +17080,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16994
17080
  }), method(object({}), object({
16995
17081
  catalog: array(NcConditionDescriptorSchema),
16996
17082
  taxonomy: NcTaxonomySchema.optional()
16997
- })), 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 }), {
17083
+ })), 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 }), {
16998
17084
  kind: "mutation",
16999
17085
  caller: "required"
17000
17086
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -22122,7 +22208,7 @@ var lifecycleJobSchema = object({
22122
22208
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
22123
22209
  * as every other cap.
22124
22210
  */
22125
- var LogLevelSchema$1 = _enum([
22211
+ var LogLevelSchema$2 = _enum([
22126
22212
  "debug",
22127
22213
  "info",
22128
22214
  "warn",
@@ -22329,7 +22415,7 @@ var CustomActionInputSchema = object({
22329
22415
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
22330
22416
  addonId: string(),
22331
22417
  limit: number().min(1).max(500).default(100),
22332
- level: LogLevelSchema$1.optional()
22418
+ level: LogLevelSchema$2.optional()
22333
22419
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
22334
22420
  packageName: string(),
22335
22421
  version: string().optional()
@@ -22427,7 +22513,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
22427
22513
  auth: "admin"
22428
22514
  }), method(object({
22429
22515
  addonId: string(),
22430
- level: LogLevelSchema$1.optional()
22516
+ level: LogLevelSchema$2.optional()
22431
22517
  }), LogStreamEntrySchema, { kind: "subscription" });
22432
22518
  /**
22433
22519
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -24151,6 +24237,35 @@ var FaceFilterEnum = _enum([
24151
24237
  "identified",
24152
24238
  "all"
24153
24239
  ]);
24240
+ /**
24241
+ * What a `listRecentFaces` page is ORDERED BY.
24242
+ *
24243
+ * - `timestamp` — when the face was seen. The historical (and default) order.
24244
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
24245
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
24246
+ * order: it puts the suggestions an operator can confirm with one tap at the
24247
+ * top, and it is the reason this enum exists — a client that ranked a capped
24248
+ * page client-side was ranking the newest N, never the most certain N.
24249
+ *
24250
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
24251
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
24252
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
24253
+ * — flipping the direction reorders the rows that HAVE a certainty and never
24254
+ * floods the page with the ones that do not. `addon-post-analysis`'s
24255
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
24256
+ * then by faceId, and is what makes this a total order instead of the
24257
+ * backend's NULL-collation accident.
24258
+ */
24259
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
24260
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
24261
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
24262
+ * never leaves the server. */
24263
+ var FaceClusterSchema = object({
24264
+ faceIds: array(string()).readonly(),
24265
+ representativeFaceId: string(),
24266
+ size: number().int(),
24267
+ cohesion: number()
24268
+ });
24154
24269
  var MediaFileLiteSchema$1 = object({
24155
24270
  key: string(),
24156
24271
  kind: string(),
@@ -24197,24 +24312,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24197
24312
  kind: "mutation",
24198
24313
  auth: "admin"
24199
24314
  }), method(object({
24200
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
24315
+ /**
24316
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
24317
+ *
24318
+ * The legacy single-camera form, kept verbatim for every caller that
24319
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
24320
+ * instead — never both: `deviceIds` is the authority whenever it is
24321
+ * present, and this field is then ignored rather than unioned, so
24322
+ * there is exactly one answer to "which cameras did I ask for".
24323
+ */
24201
24324
  deviceId: number().int().optional(),
24325
+ /**
24326
+ * Restrict to a SET of cameras — the review UI's camera filter, which
24327
+ * until now had to fetch the cluster-wide page and drop rows in the
24328
+ * client (so the `limit` it asked for was spent on cameras it was
24329
+ * about to discard).
24330
+ *
24331
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
24332
+ * "every camera". A request for no devices is a request, not an
24333
+ * omission; same contract as `deviceManager.listFleet` and
24334
+ * `pipelineAnalytics.listRecentTracks`.
24335
+ *
24336
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
24337
+ */
24338
+ deviceIds: array(number().int()).optional(),
24202
24339
  limit: number().int().positive().optional(),
24203
24340
  filter: FaceFilterEnum.optional(),
24204
24341
  /**
24205
- * Inline the base64 crop on every row. Default `true` — the existing
24206
- * behaviour, kept so no caller breaks.
24342
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24343
+ * Absent means no lower bound.
24344
+ */
24345
+ since: number().int().optional(),
24346
+ /**
24347
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24348
+ * Absent means no upper bound.
24349
+ */
24350
+ until: number().int().optional(),
24351
+ /**
24352
+ * Order the page by time or by suggestion certainty. Default
24353
+ * `'timestamp'` — the historical order, unchanged for every caller
24354
+ * that does not ask.
24207
24355
  *
24208
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
24209
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
24210
- * the browser cache the images.
24356
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
24357
+ * does under `'suggestionConfidence'`.
24211
24358
  *
24212
- * **This is an INPUT field, so it does not reach the addon until the
24213
- * next train.** The hub router validates cap inputs against its own
24214
- * compiled Zod, which strips a key it does not know verified today
24215
- * on the OUTPUT side, where an additive field DOES arrive immediately
24216
- * (`Track.hasFace`). Until the train ships, sending `false` is
24217
- * harmless and simply keeps the crops inline.
24359
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
24360
+ * index and stops reading as soon as `limit` rows have PASSED the
24361
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
24362
+ * certain row may be the oldest so it walks the window. Narrow it
24363
+ * with {@link since} / {@link until}.
24364
+ */
24365
+ sortBy: FaceSortFieldEnum.optional(),
24366
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
24367
+ sortDirection: FaceSortDirectionEnum.optional(),
24368
+ /**
24369
+ * Inline the base64 crop on every row.
24370
+ *
24371
+ * Default `false` since the 2026-08-25 inversion — see
24372
+ * `include-crops-default.ts`, which is the ONE place that resolves
24373
+ * this for every gallery, and which records why the inline shape had
24374
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
24375
+ * The doc here used to still say `true`; it was wrong, and a leftover
24376
+ * that describes the old design reads as permission to rely on it.
24377
+ *
24378
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
24379
+ * which the browser fetches off the `event-media` plane in parallel,
24380
+ * cached and ETagged.
24218
24381
  */
24219
24382
  includeCrops: boolean().optional()
24220
24383
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -24250,13 +24413,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24250
24413
  }), method(object({
24251
24414
  threshold: number().min(0).max(1).optional(),
24252
24415
  minClusterSize: number().int().min(2).optional(),
24253
- limit: number().int().positive().optional()
24254
- }).optional(), array(object({
24255
- faceIds: array(string()).readonly(),
24256
- representativeFaceId: string(),
24257
- size: number().int(),
24258
- cohesion: number()
24259
- })).readonly());
24416
+ /**
24417
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
24418
+ * which read as though it bounded the work — it never did.
24419
+ *
24420
+ * Wins over {@link limit} when both are sent.
24421
+ */
24422
+ maxClusters: number().int().positive().optional(),
24423
+ /**
24424
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
24425
+ * RESULT, not the scan. Kept so existing callers keep working; send
24426
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
24427
+ */
24428
+ limit: number().int().positive().optional(),
24429
+ /**
24430
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
24431
+ * POOL, not the result.
24432
+ *
24433
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
24434
+ * used to read every unassigned face on the hub no matter what the
24435
+ * caller asked for, because the only bound cut the finished clusters
24436
+ * afterwards; a UI showing a window of 100 paid for a scan of the
24437
+ * whole corpus, on an addon whose disk is under contention.
24438
+ *
24439
+ * The pool is the NEWEST matching faces first — the same order the
24440
+ * gallery shows — so a bound here shortens the horizon, it does not
24441
+ * sample it randomly.
24442
+ *
24443
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
24444
+ * so the live corpus — 372 face rows — is unaffected while the
24445
+ * unbounded scan can never come back as the table grows.
24446
+ */
24447
+ maxFacesScanned: number().int().positive().optional()
24448
+ }).optional(), array(FaceClusterSchema).readonly());
24260
24449
  /**
24261
24450
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
24262
24451
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28014,6 +28203,39 @@ var ReadGopBytesResultSchema = object({
28014
28203
  /** Media ms the returned fragment covers. */
28015
28204
  gopDurMs: number()
28016
28205
  });
28206
+ /**
28207
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
28208
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
28209
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
28210
+ * a replay needs several seconds of native pixels, not one frame.
28211
+ *
28212
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
28213
+ * is `false` when the returned bytes were cut short by the read's own safety
28214
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
28215
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
28216
+ * degradation: a window whose end falls past the covering segment would need
28217
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
28218
+ * not one standalone-demuxable stream — the caller's answer is to request a
28219
+ * shorter window or one aligned to a single segment, not to receive spliced
28220
+ * bytes nothing has proven decodable.
28221
+ */
28222
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
28223
+ kind: literal("ok"),
28224
+ data: _instanceof(Uint8Array),
28225
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
28226
+ * the requested `fromMs` (anchored on the nearest keyframe). */
28227
+ gopStartMs: number(),
28228
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
28229
+ gopDurMs: number(),
28230
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
28231
+ * the requested `toMs`; the caller got fewer frames than asked for. */
28232
+ reachesRequestedEnd: boolean()
28233
+ }), object({
28234
+ kind: literal("spans-multiple-segments"),
28235
+ /** Where the covering segment's own footage runs out — informational,
28236
+ * not a retry hint (retrying the same window would refuse again). */
28237
+ segmentEndMs: number()
28238
+ })]);
28017
28239
  method(object({
28018
28240
  deviceId: number(),
28019
28241
  fromMs: number(),
@@ -28064,6 +28286,15 @@ method(object({
28064
28286
  }), ReadGopBytesResultSchema, {
28065
28287
  kind: "query",
28066
28288
  auth: "admin"
28289
+ }), method(object({
28290
+ deviceId: number(),
28291
+ profile: string(),
28292
+ startMs: number(),
28293
+ fromMs: number(),
28294
+ toMs: number()
28295
+ }), ReadWindowBytesResultSchema, {
28296
+ kind: "query",
28297
+ auth: "admin"
28067
28298
  }), method(object({
28068
28299
  deviceId: number(),
28069
28300
  config: RecordingConfigSchema
@@ -29156,6 +29387,211 @@ var SetSiteLocationInputSchema = object({
29156
29387
  latitude: number().min(-90).max(90),
29157
29388
  longitude: number().min(-180).max(180)
29158
29389
  }).nullable();
29390
+ /**
29391
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
29392
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29393
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29394
+ * already prints - never a token, never an `Authorization` header.
29395
+ */
29396
+ var RequestCensusGroupSchema = object({
29397
+ procedure: string(),
29398
+ userAgent: string(),
29399
+ ip: string(),
29400
+ principal: string(),
29401
+ calls: number(),
29402
+ perMin: number()
29403
+ });
29404
+ /**
29405
+ * A procedure's TOTAL over the window, across every caller.
29406
+ *
29407
+ * This block, not the group list, is what answers "did these calls arrive over
29408
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29409
+ * same window excludes the HTTP plane, which is a result, not a failure.
29410
+ */
29411
+ var RequestCensusProcedureSchema = object({
29412
+ procedure: string(),
29413
+ calls: number(),
29414
+ perMin: number()
29415
+ });
29416
+ /**
29417
+ * The census as an operator sees it.
29418
+ *
29419
+ * `persisted` is the honest answer to "will this survive the restart I am
29420
+ * about to do": the arm deadline is written to `system-settings` so a window
29421
+ * armed now can measure the NEXT boot, and a write that failed must not look
29422
+ * like one that succeeded.
29423
+ */
29424
+ var RequestCensusStatusSchema = object({
29425
+ armed: boolean(),
29426
+ /** How long the current - or just-closed - window collected, in ms. */
29427
+ elapsedMs: number(),
29428
+ /** The window actually armed, after the server clamped the request. */
29429
+ windowMs: number(),
29430
+ /** Epoch ms the window closes at. 0 when disarmed. */
29431
+ armedUntilMs: number(),
29432
+ httpRequests: number(),
29433
+ batchedRequests: number(),
29434
+ /**
29435
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29436
+ * is in play (`?batch=1` carries several procedures in one request); this is
29437
+ * the number comparable with a store-side call count.
29438
+ */
29439
+ procedureCalls: number(),
29440
+ /**
29441
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29442
+ * transport resolves one context per connection - but the number that says
29443
+ * whether a plane this census cannot see was busy while HTTP was quiet.
29444
+ */
29445
+ wsConnections: number(),
29446
+ distinctGroups: number(),
29447
+ /** Calls counted in the totals whose group attribution was shed at the
29448
+ * cardinality bound. */
29449
+ unattributedCalls: number(),
29450
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29451
+ groups: array(RequestCensusGroupSchema).readonly()
29452
+ }).extend({ persisted: boolean() });
29453
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29454
+ var LogLevelSchema$1 = _enum([
29455
+ "debug",
29456
+ "info",
29457
+ "warn",
29458
+ "error"
29459
+ ]);
29460
+ /**
29461
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29462
+ *
29463
+ * A diagnostic is anything whose cost is only worth paying while a question is
29464
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29465
+ */
29466
+ var DiagnosticIdSchema = _enum(["request-census"]);
29467
+ /**
29468
+ * The layers of the level hierarchy, general → specific. The most specific
29469
+ * layer that carries an explicit value wins.
29470
+ *
29471
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29472
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29473
+ * grow later would force every consumer of this document to change with it.
29474
+ * Nothing returns `component` today.
29475
+ */
29476
+ var LoggingScopeKindSchema = _enum([
29477
+ "cluster",
29478
+ "node",
29479
+ "component"
29480
+ ]);
29481
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29482
+ var LoggingLevelSourceSchema = _enum([
29483
+ "default",
29484
+ "cluster",
29485
+ "node",
29486
+ "component"
29487
+ ]);
29488
+ /**
29489
+ * One layer of the hierarchy as it actually STANDS.
29490
+ *
29491
+ * `level: null` is the whole reason this array is returned: it is the
29492
+ * difference between "this node is at `info` because I decided it" and
29493
+ * "...because it inherits". An operator who clears an override believing they
29494
+ * are clearing an inherited value has been handed the same defect as the two
29495
+ * contradicting knobs this document exists to remove, moved one floor up.
29496
+ */
29497
+ var LoggingLevelLayerSchema = object({
29498
+ scope: LoggingScopeKindSchema,
29499
+ /** The node this layer speaks for; `null` on the cluster layer. */
29500
+ nodeId: string().nullable(),
29501
+ /** Explicitly set here, or `null` when this layer inherits. */
29502
+ level: LogLevelSchema$1.nullable()
29503
+ });
29504
+ /** What a line is judged against, and WHICH layer decided it. */
29505
+ var LoggingEffectiveSchema = object({
29506
+ level: LogLevelSchema$1,
29507
+ levelSource: LoggingLevelSourceSchema
29508
+ });
29509
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29510
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29511
+ /**
29512
+ * An armed diagnostic, with its DEADLINE.
29513
+ *
29514
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29515
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29516
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29517
+ * `armed` is false — a window is never reported as slightly expired.
29518
+ */
29519
+ var DiagnosticWindowSchema = object({
29520
+ id: DiagnosticIdSchema,
29521
+ armed: boolean(),
29522
+ /** Epoch ms the window closes at. 0 when disarmed. */
29523
+ armedUntilMs: number(),
29524
+ /** Ms left before it expires on its own. 0 when disarmed. */
29525
+ remainingMs: number(),
29526
+ /** Whether the stored deadline is the one the live diagnostic is running —
29527
+ * i.e. whether this window would survive a restart. */
29528
+ persisted: boolean()
29529
+ });
29530
+ /**
29531
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29532
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29533
+ * is a second knob that disagrees with the first the day one of them moves.
29534
+ */
29535
+ var DiagnosticWindowPatchSchema = object({
29536
+ id: DiagnosticIdSchema,
29537
+ armMs: number().int().min(0),
29538
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29539
+ reportEveryMs: number().int().positive().optional()
29540
+ });
29541
+ /**
29542
+ * A PATCH, and patches MERGE.
29543
+ *
29544
+ * A field absent from the patch is left exactly as it was — arming a
29545
+ * diagnostic never resets a level, and setting a level never disarms a window.
29546
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29547
+ * `setAll` already merges, and rebuilding the object is how an absent field
29548
+ * turns into an erased one.
29549
+ */
29550
+ var LoggingSettingsPatchSchema = object({
29551
+ /**
29552
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29553
+ * addressed scope so it inherits again. A value sets it.
29554
+ */
29555
+ level: LogLevelSchema$1.nullable().optional(),
29556
+ /**
29557
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29558
+ * keeps running — a patch is never a full replacement.
29559
+ */
29560
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29561
+ });
29562
+ /**
29563
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29564
+ *
29565
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29566
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29567
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29568
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29569
+ * by an agent that holds no cluster document at all. The hub is the single
29570
+ * authority over the whole hierarchy and answers for every layer, so the
29571
+ * layer selector needs a name the transport does not already own.
29572
+ */
29573
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29574
+ var SetLoggingSettingsInputSchema = object({
29575
+ scopeNodeId: string().optional(),
29576
+ patch: LoggingSettingsPatchSchema
29577
+ });
29578
+ /**
29579
+ * The whole document, as read and as returned after every write.
29580
+ *
29581
+ * `persisted: false` means the settings store could not be read or written.
29582
+ * The in-memory mirror still governs behaviour and is unchanged by the
29583
+ * failure — a read that fails neither switches a level nor disarms a window
29584
+ * (D49) — but the operator is told that what they are looking at would not
29585
+ * survive a restart.
29586
+ */
29587
+ var LoggingSettingsStateSchema = object({
29588
+ /** The layer this document was read at. `null` = the cluster layer. */
29589
+ scopeNodeId: string().nullable(),
29590
+ effective: LoggingEffectiveSchema,
29591
+ explicit: LoggingExplicitSchema,
29592
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29593
+ persisted: boolean()
29594
+ });
29159
29595
  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(), {
29160
29596
  kind: "mutation",
29161
29597
  auth: "admin"
@@ -29168,6 +29604,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29168
29604
  }), method(_void(), SiteLocationStatusSchema, {
29169
29605
  kind: "mutation",
29170
29606
  auth: "admin"
29607
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29608
+ kind: "mutation",
29609
+ auth: "admin"
29171
29610
  });
29172
29611
  /**
29173
29612
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -34151,6 +34590,12 @@ Object.freeze({
34151
34590
  addonId: null,
34152
34591
  access: "view"
34153
34592
  },
34593
+ "notificationRules.resolveArtifactUrl": {
34594
+ capName: "notification-rules",
34595
+ capScope: "system",
34596
+ addonId: null,
34597
+ access: "view"
34598
+ },
34154
34599
  "notificationRules.setAlarmConfig": {
34155
34600
  capName: "notification-rules",
34156
34601
  capScope: "system",
@@ -35555,6 +36000,12 @@ Object.freeze({
35555
36000
  addonId: null,
35556
36001
  access: "view"
35557
36002
  },
36003
+ "recording.readWindowBytes": {
36004
+ capName: "recording",
36005
+ capScope: "system",
36006
+ addonId: null,
36007
+ access: "view"
36008
+ },
35558
36009
  "recording.refreshStorageLocationsForMigration": {
35559
36010
  capName: "recording",
35560
36011
  capScope: "system",
@@ -36395,6 +36846,18 @@ Object.freeze({
36395
36846
  addonId: null,
36396
36847
  access: "create"
36397
36848
  },
36849
+ "system.getLoggingSettings": {
36850
+ capName: "system",
36851
+ capScope: "system",
36852
+ addonId: null,
36853
+ access: "view"
36854
+ },
36855
+ "system.getRequestCensus": {
36856
+ capName: "system",
36857
+ capScope: "system",
36858
+ addonId: null,
36859
+ access: "view"
36860
+ },
36398
36861
  "system.getRetentionConfig": {
36399
36862
  capName: "system",
36400
36863
  capScope: "system",
@@ -36425,6 +36888,12 @@ Object.freeze({
36425
36888
  addonId: null,
36426
36889
  access: "view"
36427
36890
  },
36891
+ "system.setLoggingSettings": {
36892
+ capName: "system",
36893
+ capScope: "system",
36894
+ addonId: null,
36895
+ access: "create"
36896
+ },
36428
36897
  "system.setRetentionConfig": {
36429
36898
  capName: "system",
36430
36899
  capScope: "system",
@@ -37580,6 +38049,10 @@ Object.freeze({
37580
38049
  name: "deviceId",
37581
38050
  form: "single",
37582
38051
  optional: true
38052
+ }, {
38053
+ name: "deviceIds",
38054
+ form: "array",
38055
+ optional: true
37583
38056
  }],
37584
38057
  "fanControl.setDirection": [{
37585
38058
  name: "deviceId",
@@ -38385,6 +38858,11 @@ Object.freeze({
38385
38858
  form: "single",
38386
38859
  optional: false
38387
38860
  }],
38861
+ "recording.readWindowBytes": [{
38862
+ name: "deviceId",
38863
+ form: "single",
38864
+ optional: false
38865
+ }],
38388
38866
  "recording.relocateFootage": [{
38389
38867
  name: "deviceId",
38390
38868
  form: "single",
@@ -39185,7 +39663,38 @@ object({
39185
39663
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
39186
39664
  * reproduce that.
39187
39665
  */
39188
- tileBudgetMb: number().int().min(0).max(1024)
39666
+ tileBudgetMb: number().int().min(0).max(1024),
39667
+ /**
39668
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39669
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39670
+ * subject tiles, on frames that detected something.
39671
+ *
39672
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39673
+ * containment is strict by design, so the native `keyFrame`, the detail
39674
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39675
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39676
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39677
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39678
+ *
39679
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39680
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39681
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39682
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39683
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39684
+ * binds only through a detection burst, where it still covers well past the
39685
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39686
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39687
+ * whole shape exists to avoid.
39688
+ *
39689
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39690
+ * subject tile, so one shared budget would let a busy camera's key frames
39691
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39692
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39693
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39694
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39695
+ * nothing.
39696
+ */
39697
+ sceneBudgetMb: number().int().min(0).max(1024)
39189
39698
  });
39190
39699
  /**
39191
39700
  * The values in force when the operator has set nothing.
@@ -39201,12 +39710,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
39201
39710
  budgetMb: 1024,
39202
39711
  activityMs: 15e3,
39203
39712
  tileBudgetMb: 64,
39713
+ sceneBudgetMb: 48,
39204
39714
  admission: "inferred"
39205
39715
  };
39206
39716
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39207
39717
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39208
39718
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39209
39719
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39720
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39210
39721
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39211
39722
  var MB = 1024 * 1024;
39212
39723
  1024 * MB, 3072 * MB;