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