@camstack/addon-provider-dreo 0.2.30 → 0.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +572 -61
  2. package/dist/addon.mjs +572 -61
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7562,6 +7562,66 @@ var OpsLogQueryInputSchema = object({
7562
7562
  /** Max rows returned, newest-first. */
7563
7563
  limit: number().int().min(1).max(1e3).optional()
7564
7564
  });
7565
+ var LabelDefinitionSchema = object({
7566
+ id: string(),
7567
+ name: string(),
7568
+ category: string().optional(),
7569
+ description: string().optional(),
7570
+ icon: string().optional()
7571
+ });
7572
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7573
+ var CLASS_MAP_MACRO_TARGETS = [
7574
+ "person",
7575
+ "vehicle",
7576
+ "animal",
7577
+ "package"
7578
+ ];
7579
+ /**
7580
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7581
+ * un operatore può selezionare.
7582
+ *
7583
+ * Sono le tre offerte dallo step `object-detection`
7584
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7585
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7586
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7587
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7588
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7589
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7590
+ *
7591
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7592
+ * dello step e una seconda volta come union `FirstLevelMacro`
7593
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7594
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7595
+ * successiva.
7596
+ */
7597
+ var FIRST_LEVEL_MACRO_CLASSES = [
7598
+ "person",
7599
+ "vehicle",
7600
+ "animal"
7601
+ ];
7602
+ /**
7603
+ * Wire schema for a per-model CATALOG classMap override
7604
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7605
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7606
+ * detection pipeline executor actually routes.
7607
+ *
7608
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7609
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7610
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7611
+ * enum) — the two used to share the name `ClassMapDefinition`/
7612
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7613
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7614
+ * are not: it is two different concepts colliding on a name. Keep this type
7615
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7616
+ * would either narrow every `ClassMapDefinition` consumer to the four
7617
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7618
+ * schema exists for (see the "rejects a classMap whose target is not a
7619
+ * detection macro" test in `model-catalog-schema.test.ts`).
7620
+ */
7621
+ var DetectionCatalogClassMapSchema = object({
7622
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7623
+ preserveOriginal: boolean()
7624
+ });
7565
7625
  /**
7566
7626
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7567
7627
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7584,10 +7644,55 @@ var RecordingStorageModeSchema = _enum([
7584
7644
  "events",
7585
7645
  "continuous"
7586
7646
  ]);
7647
+ /**
7648
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7649
+ * tre offerte dallo step `object-detection`, da UNA lista
7650
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7651
+ */
7652
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7653
+ /**
7654
+ * True quando `values` non ripete un elemento.
7655
+ *
7656
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7657
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7658
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7659
+ */
7660
+ var noDuplicates = (values) => new Set(values).size === values.length;
7587
7661
  /** Which detectors trigger an `events`-mode band. */
7588
7662
  var RecordingTriggersSchema = object({
7589
7663
  motion: boolean().optional(),
7590
- audioThresholdDbfs: number().optional()
7664
+ audioThresholdDbfs: number().optional(),
7665
+ /**
7666
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7667
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7668
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7669
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7670
+ *
7671
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7672
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7673
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7674
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7675
+ * finestre — vedi `recorder/object-trigger.ts`.
7676
+ */
7677
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7678
+ /**
7679
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7680
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7681
+ * `objectClasses`.
7682
+ *
7683
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7684
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7685
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7686
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7687
+ * device (D12) — mai un elenco globale di cap.
7688
+ *
7689
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7690
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7691
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7692
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7693
+ * registrare.
7694
+ */
7695
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7591
7696
  });
7592
7697
  /**
7593
7698
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8039,41 +8144,6 @@ var DecoderSessionConfigSchema = object({
8039
8144
  */
8040
8145
  debug: boolean().optional()
8041
8146
  });
8042
- var LabelDefinitionSchema = object({
8043
- id: string(),
8044
- name: string(),
8045
- category: string().optional(),
8046
- description: string().optional(),
8047
- icon: string().optional()
8048
- });
8049
- /**
8050
- * Wire schema for a per-model CATALOG classMap override
8051
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8052
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8053
- * detection pipeline executor actually routes.
8054
- *
8055
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8056
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8057
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8058
- * enum) — the two used to share the name `ClassMapDefinition`/
8059
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8060
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8061
- * are not: it is two different concepts colliding on a name. Keep this type
8062
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8063
- * would either narrow every `ClassMapDefinition` consumer to the four
8064
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8065
- * schema exists for (see the "rejects a classMap whose target is not a
8066
- * detection macro" test in `model-catalog-schema.test.ts`).
8067
- */
8068
- var DetectionCatalogClassMapSchema = object({
8069
- mapping: record(string(), _enum([
8070
- "person",
8071
- "vehicle",
8072
- "animal",
8073
- "package"
8074
- ])),
8075
- preserveOriginal: boolean()
8076
- });
8077
8147
  var MODEL_FORMATS = [
8078
8148
  "onnx",
8079
8149
  "coreml",
@@ -15835,7 +15905,23 @@ var NcHistoryEntrySchema = object({
15835
15905
  updatedAt: number(),
15836
15906
  /** Failure detail — present on a `dead` row. */
15837
15907
  error: string().optional(),
15838
- subject: NcHistorySubjectSchema
15908
+ subject: NcHistorySubjectSchema,
15909
+ /**
15910
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15911
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15912
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15913
+ * every delivery attempt). Absent on a row still pending/dead, a row
15914
+ * delivered before this field shipped, or a wiring with no artefact index.
15915
+ *
15916
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15917
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15918
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15919
+ * also answers `null` for an id whose artefact has since expired past the
15920
+ * retained shelf's own age bound — the degrade a caller (the Home
15921
+ * Assistant export) must render as "no image right now", never as a
15922
+ * broken link.
15923
+ */
15924
+ artifactIds: array(string().min(1)).optional()
15839
15925
  });
15840
15926
  /**
15841
15927
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16062,7 +16148,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16062
16148
  }), method(object({}), object({
16063
16149
  catalog: array(NcConditionDescriptorSchema),
16064
16150
  taxonomy: NcTaxonomySchema.optional()
16065
- })), 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 }), {
16151
+ })), 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 }), {
16066
16152
  kind: "mutation",
16067
16153
  caller: "required"
16068
16154
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21190,7 +21276,7 @@ var lifecycleJobSchema = object({
21190
21276
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21191
21277
  * as every other cap.
21192
21278
  */
21193
- var LogLevelSchema$1 = _enum([
21279
+ var LogLevelSchema$2 = _enum([
21194
21280
  "debug",
21195
21281
  "info",
21196
21282
  "warn",
@@ -21397,7 +21483,7 @@ var CustomActionInputSchema = object({
21397
21483
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21398
21484
  addonId: string(),
21399
21485
  limit: number().min(1).max(500).default(100),
21400
- level: LogLevelSchema$1.optional()
21486
+ level: LogLevelSchema$2.optional()
21401
21487
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21402
21488
  packageName: string(),
21403
21489
  version: string().optional()
@@ -21495,7 +21581,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21495
21581
  auth: "admin"
21496
21582
  }), method(object({
21497
21583
  addonId: string(),
21498
- level: LogLevelSchema$1.optional()
21584
+ level: LogLevelSchema$2.optional()
21499
21585
  }), LogStreamEntrySchema, { kind: "subscription" });
21500
21586
  /**
21501
21587
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23227,6 +23313,35 @@ var FaceFilterEnum = _enum([
23227
23313
  "identified",
23228
23314
  "all"
23229
23315
  ]);
23316
+ /**
23317
+ * What a `listRecentFaces` page is ORDERED BY.
23318
+ *
23319
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23320
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23321
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23322
+ * order: it puts the suggestions an operator can confirm with one tap at the
23323
+ * top, and it is the reason this enum exists — a client that ranked a capped
23324
+ * page client-side was ranking the newest N, never the most certain N.
23325
+ *
23326
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23327
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23328
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23329
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23330
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23331
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23332
+ * then by faceId, and is what makes this a total order instead of the
23333
+ * backend's NULL-collation accident.
23334
+ */
23335
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23336
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23337
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23338
+ * never leaves the server. */
23339
+ var FaceClusterSchema = object({
23340
+ faceIds: array(string()).readonly(),
23341
+ representativeFaceId: string(),
23342
+ size: number().int(),
23343
+ cohesion: number()
23344
+ });
23230
23345
  var MediaFileLiteSchema$1 = object({
23231
23346
  key: string(),
23232
23347
  kind: string(),
@@ -23273,24 +23388,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23273
23388
  kind: "mutation",
23274
23389
  auth: "admin"
23275
23390
  }), method(object({
23276
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23391
+ /**
23392
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23393
+ *
23394
+ * The legacy single-camera form, kept verbatim for every caller that
23395
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23396
+ * instead — never both: `deviceIds` is the authority whenever it is
23397
+ * present, and this field is then ignored rather than unioned, so
23398
+ * there is exactly one answer to "which cameras did I ask for".
23399
+ */
23277
23400
  deviceId: number().int().optional(),
23401
+ /**
23402
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23403
+ * until now had to fetch the cluster-wide page and drop rows in the
23404
+ * client (so the `limit` it asked for was spent on cameras it was
23405
+ * about to discard).
23406
+ *
23407
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23408
+ * "every camera". A request for no devices is a request, not an
23409
+ * omission; same contract as `deviceManager.listFleet` and
23410
+ * `pipelineAnalytics.listRecentTracks`.
23411
+ *
23412
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23413
+ */
23414
+ deviceIds: array(number().int()).optional(),
23278
23415
  limit: number().int().positive().optional(),
23279
23416
  filter: FaceFilterEnum.optional(),
23280
23417
  /**
23281
- * Inline the base64 crop on every row. Default `true` — the existing
23282
- * behaviour, kept so no caller breaks.
23418
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23419
+ * Absent means no lower bound.
23420
+ */
23421
+ since: number().int().optional(),
23422
+ /**
23423
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23424
+ * Absent means no upper bound.
23425
+ */
23426
+ until: number().int().optional(),
23427
+ /**
23428
+ * Order the page by time or by suggestion certainty. Default
23429
+ * `'timestamp'` — the historical order, unchanged for every caller
23430
+ * that does not ask.
23283
23431
  *
23284
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23285
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23286
- * the browser cache the images.
23432
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23433
+ * does under `'suggestionConfidence'`.
23287
23434
  *
23288
- * **This is an INPUT field, so it does not reach the addon until the
23289
- * next train.** The hub router validates cap inputs against its own
23290
- * compiled Zod, which strips a key it does not know — verified today
23291
- * on the OUTPUT side, where an additive field DOES arrive immediately
23292
- * (`Track.hasFace`). Until the train ships, sending `false` is
23293
- * harmless and simply keeps the crops inline.
23435
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23436
+ * index and stops reading as soon as `limit` rows have PASSED the
23437
+ * filter. `'suggestionConfidence'` cannot stop early — the most
23438
+ * certain row may be the oldest — so it walks the window. Narrow it
23439
+ * with {@link since} / {@link until}.
23440
+ */
23441
+ sortBy: FaceSortFieldEnum.optional(),
23442
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23443
+ sortDirection: FaceSortDirectionEnum.optional(),
23444
+ /**
23445
+ * Inline the base64 crop on every row.
23446
+ *
23447
+ * Default `false` since the 2026-08-25 inversion — see
23448
+ * `include-crops-default.ts`, which is the ONE place that resolves
23449
+ * this for every gallery, and which records why the inline shape had
23450
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23451
+ * The doc here used to still say `true`; it was wrong, and a leftover
23452
+ * that describes the old design reads as permission to rely on it.
23453
+ *
23454
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23455
+ * which the browser fetches off the `event-media` plane in parallel,
23456
+ * cached and ETagged.
23294
23457
  */
23295
23458
  includeCrops: boolean().optional()
23296
23459
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23326,13 +23489,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23326
23489
  }), method(object({
23327
23490
  threshold: number().min(0).max(1).optional(),
23328
23491
  minClusterSize: number().int().min(2).optional(),
23329
- limit: number().int().positive().optional()
23330
- }).optional(), array(object({
23331
- faceIds: array(string()).readonly(),
23332
- representativeFaceId: string(),
23333
- size: number().int(),
23334
- cohesion: number()
23335
- })).readonly());
23492
+ /**
23493
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23494
+ * which read as though it bounded the work — it never did.
23495
+ *
23496
+ * Wins over {@link limit} when both are sent.
23497
+ */
23498
+ maxClusters: number().int().positive().optional(),
23499
+ /**
23500
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23501
+ * RESULT, not the scan. Kept so existing callers keep working; send
23502
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23503
+ */
23504
+ limit: number().int().positive().optional(),
23505
+ /**
23506
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23507
+ * POOL, not the result.
23508
+ *
23509
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23510
+ * used to read every unassigned face on the hub no matter what the
23511
+ * caller asked for, because the only bound cut the finished clusters
23512
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23513
+ * whole corpus, on an addon whose disk is under contention.
23514
+ *
23515
+ * The pool is the NEWEST matching faces first — the same order the
23516
+ * gallery shows — so a bound here shortens the horizon, it does not
23517
+ * sample it randomly.
23518
+ *
23519
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23520
+ * so the live corpus — 372 face rows — is unaffected while the
23521
+ * unbounded scan can never come back as the table grows.
23522
+ */
23523
+ maxFacesScanned: number().int().positive().optional()
23524
+ }).optional(), array(FaceClusterSchema).readonly());
23336
23525
  /**
23337
23526
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23338
23527
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27090,6 +27279,39 @@ var ReadGopBytesResultSchema = object({
27090
27279
  /** Media ms the returned fragment covers. */
27091
27280
  gopDurMs: number()
27092
27281
  });
27282
+ /**
27283
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27284
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27285
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27286
+ * a replay needs several seconds of native pixels, not one frame.
27287
+ *
27288
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27289
+ * is `false` when the returned bytes were cut short by the read's own safety
27290
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27291
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27292
+ * degradation: a window whose end falls past the covering segment would need
27293
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27294
+ * not one standalone-demuxable stream — the caller's answer is to request a
27295
+ * shorter window or one aligned to a single segment, not to receive spliced
27296
+ * bytes nothing has proven decodable.
27297
+ */
27298
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27299
+ kind: literal("ok"),
27300
+ data: _instanceof(Uint8Array),
27301
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27302
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27303
+ gopStartMs: number(),
27304
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27305
+ gopDurMs: number(),
27306
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27307
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27308
+ reachesRequestedEnd: boolean()
27309
+ }), object({
27310
+ kind: literal("spans-multiple-segments"),
27311
+ /** Where the covering segment's own footage runs out — informational,
27312
+ * not a retry hint (retrying the same window would refuse again). */
27313
+ segmentEndMs: number()
27314
+ })]);
27093
27315
  method(object({
27094
27316
  deviceId: number(),
27095
27317
  fromMs: number(),
@@ -27140,6 +27362,15 @@ method(object({
27140
27362
  }), ReadGopBytesResultSchema, {
27141
27363
  kind: "query",
27142
27364
  auth: "admin"
27365
+ }), method(object({
27366
+ deviceId: number(),
27367
+ profile: string(),
27368
+ startMs: number(),
27369
+ fromMs: number(),
27370
+ toMs: number()
27371
+ }), ReadWindowBytesResultSchema, {
27372
+ kind: "query",
27373
+ auth: "admin"
27143
27374
  }), method(object({
27144
27375
  deviceId: number(),
27145
27376
  config: RecordingConfigSchema
@@ -28232,6 +28463,211 @@ var SetSiteLocationInputSchema = object({
28232
28463
  latitude: number().min(-90).max(90),
28233
28464
  longitude: number().min(-180).max(180)
28234
28465
  }).nullable();
28466
+ /**
28467
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28468
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28469
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28470
+ * already prints - never a token, never an `Authorization` header.
28471
+ */
28472
+ var RequestCensusGroupSchema = object({
28473
+ procedure: string(),
28474
+ userAgent: string(),
28475
+ ip: string(),
28476
+ principal: string(),
28477
+ calls: number(),
28478
+ perMin: number()
28479
+ });
28480
+ /**
28481
+ * A procedure's TOTAL over the window, across every caller.
28482
+ *
28483
+ * This block, not the group list, is what answers "did these calls arrive over
28484
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28485
+ * same window excludes the HTTP plane, which is a result, not a failure.
28486
+ */
28487
+ var RequestCensusProcedureSchema = object({
28488
+ procedure: string(),
28489
+ calls: number(),
28490
+ perMin: number()
28491
+ });
28492
+ /**
28493
+ * The census as an operator sees it.
28494
+ *
28495
+ * `persisted` is the honest answer to "will this survive the restart I am
28496
+ * about to do": the arm deadline is written to `system-settings` so a window
28497
+ * armed now can measure the NEXT boot, and a write that failed must not look
28498
+ * like one that succeeded.
28499
+ */
28500
+ var RequestCensusStatusSchema = object({
28501
+ armed: boolean(),
28502
+ /** How long the current - or just-closed - window collected, in ms. */
28503
+ elapsedMs: number(),
28504
+ /** The window actually armed, after the server clamped the request. */
28505
+ windowMs: number(),
28506
+ /** Epoch ms the window closes at. 0 when disarmed. */
28507
+ armedUntilMs: number(),
28508
+ httpRequests: number(),
28509
+ batchedRequests: number(),
28510
+ /**
28511
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28512
+ * is in play (`?batch=1` carries several procedures in one request); this is
28513
+ * the number comparable with a store-side call count.
28514
+ */
28515
+ procedureCalls: number(),
28516
+ /**
28517
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28518
+ * transport resolves one context per connection - but the number that says
28519
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28520
+ */
28521
+ wsConnections: number(),
28522
+ distinctGroups: number(),
28523
+ /** Calls counted in the totals whose group attribution was shed at the
28524
+ * cardinality bound. */
28525
+ unattributedCalls: number(),
28526
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28527
+ groups: array(RequestCensusGroupSchema).readonly()
28528
+ }).extend({ persisted: boolean() });
28529
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28530
+ var LogLevelSchema$1 = _enum([
28531
+ "debug",
28532
+ "info",
28533
+ "warn",
28534
+ "error"
28535
+ ]);
28536
+ /**
28537
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28538
+ *
28539
+ * A diagnostic is anything whose cost is only worth paying while a question is
28540
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28541
+ */
28542
+ var DiagnosticIdSchema = _enum(["request-census"]);
28543
+ /**
28544
+ * The layers of the level hierarchy, general → specific. The most specific
28545
+ * layer that carries an explicit value wins.
28546
+ *
28547
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28548
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28549
+ * grow later would force every consumer of this document to change with it.
28550
+ * Nothing returns `component` today.
28551
+ */
28552
+ var LoggingScopeKindSchema = _enum([
28553
+ "cluster",
28554
+ "node",
28555
+ "component"
28556
+ ]);
28557
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28558
+ var LoggingLevelSourceSchema = _enum([
28559
+ "default",
28560
+ "cluster",
28561
+ "node",
28562
+ "component"
28563
+ ]);
28564
+ /**
28565
+ * One layer of the hierarchy as it actually STANDS.
28566
+ *
28567
+ * `level: null` is the whole reason this array is returned: it is the
28568
+ * difference between "this node is at `info` because I decided it" and
28569
+ * "...because it inherits". An operator who clears an override believing they
28570
+ * are clearing an inherited value has been handed the same defect as the two
28571
+ * contradicting knobs this document exists to remove, moved one floor up.
28572
+ */
28573
+ var LoggingLevelLayerSchema = object({
28574
+ scope: LoggingScopeKindSchema,
28575
+ /** The node this layer speaks for; `null` on the cluster layer. */
28576
+ nodeId: string().nullable(),
28577
+ /** Explicitly set here, or `null` when this layer inherits. */
28578
+ level: LogLevelSchema$1.nullable()
28579
+ });
28580
+ /** What a line is judged against, and WHICH layer decided it. */
28581
+ var LoggingEffectiveSchema = object({
28582
+ level: LogLevelSchema$1,
28583
+ levelSource: LoggingLevelSourceSchema
28584
+ });
28585
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28586
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28587
+ /**
28588
+ * An armed diagnostic, with its DEADLINE.
28589
+ *
28590
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28591
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28592
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28593
+ * `armed` is false — a window is never reported as slightly expired.
28594
+ */
28595
+ var DiagnosticWindowSchema = object({
28596
+ id: DiagnosticIdSchema,
28597
+ armed: boolean(),
28598
+ /** Epoch ms the window closes at. 0 when disarmed. */
28599
+ armedUntilMs: number(),
28600
+ /** Ms left before it expires on its own. 0 when disarmed. */
28601
+ remainingMs: number(),
28602
+ /** Whether the stored deadline is the one the live diagnostic is running —
28603
+ * i.e. whether this window would survive a restart. */
28604
+ persisted: boolean()
28605
+ });
28606
+ /**
28607
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28608
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28609
+ * is a second knob that disagrees with the first the day one of them moves.
28610
+ */
28611
+ var DiagnosticWindowPatchSchema = object({
28612
+ id: DiagnosticIdSchema,
28613
+ armMs: number().int().min(0),
28614
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28615
+ reportEveryMs: number().int().positive().optional()
28616
+ });
28617
+ /**
28618
+ * A PATCH, and patches MERGE.
28619
+ *
28620
+ * A field absent from the patch is left exactly as it was — arming a
28621
+ * diagnostic never resets a level, and setting a level never disarms a window.
28622
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28623
+ * `setAll` already merges, and rebuilding the object is how an absent field
28624
+ * turns into an erased one.
28625
+ */
28626
+ var LoggingSettingsPatchSchema = object({
28627
+ /**
28628
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28629
+ * addressed scope so it inherits again. A value sets it.
28630
+ */
28631
+ level: LogLevelSchema$1.nullable().optional(),
28632
+ /**
28633
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28634
+ * keeps running — a patch is never a full replacement.
28635
+ */
28636
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28637
+ });
28638
+ /**
28639
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28640
+ *
28641
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28642
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28643
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28644
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28645
+ * by an agent that holds no cluster document at all. The hub is the single
28646
+ * authority over the whole hierarchy and answers for every layer, so the
28647
+ * layer selector needs a name the transport does not already own.
28648
+ */
28649
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28650
+ var SetLoggingSettingsInputSchema = object({
28651
+ scopeNodeId: string().optional(),
28652
+ patch: LoggingSettingsPatchSchema
28653
+ });
28654
+ /**
28655
+ * The whole document, as read and as returned after every write.
28656
+ *
28657
+ * `persisted: false` means the settings store could not be read or written.
28658
+ * The in-memory mirror still governs behaviour and is unchanged by the
28659
+ * failure — a read that fails neither switches a level nor disarms a window
28660
+ * (D49) — but the operator is told that what they are looking at would not
28661
+ * survive a restart.
28662
+ */
28663
+ var LoggingSettingsStateSchema = object({
28664
+ /** The layer this document was read at. `null` = the cluster layer. */
28665
+ scopeNodeId: string().nullable(),
28666
+ effective: LoggingEffectiveSchema,
28667
+ explicit: LoggingExplicitSchema,
28668
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28669
+ persisted: boolean()
28670
+ });
28235
28671
  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(), {
28236
28672
  kind: "mutation",
28237
28673
  auth: "admin"
@@ -28244,6 +28680,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28244
28680
  }), method(_void(), SiteLocationStatusSchema, {
28245
28681
  kind: "mutation",
28246
28682
  auth: "admin"
28683
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28684
+ kind: "mutation",
28685
+ auth: "admin"
28247
28686
  });
28248
28687
  /**
28249
28688
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33227,6 +33666,12 @@ Object.freeze({
33227
33666
  addonId: null,
33228
33667
  access: "view"
33229
33668
  },
33669
+ "notificationRules.resolveArtifactUrl": {
33670
+ capName: "notification-rules",
33671
+ capScope: "system",
33672
+ addonId: null,
33673
+ access: "view"
33674
+ },
33230
33675
  "notificationRules.setAlarmConfig": {
33231
33676
  capName: "notification-rules",
33232
33677
  capScope: "system",
@@ -34631,6 +35076,12 @@ Object.freeze({
34631
35076
  addonId: null,
34632
35077
  access: "view"
34633
35078
  },
35079
+ "recording.readWindowBytes": {
35080
+ capName: "recording",
35081
+ capScope: "system",
35082
+ addonId: null,
35083
+ access: "view"
35084
+ },
34634
35085
  "recording.refreshStorageLocationsForMigration": {
34635
35086
  capName: "recording",
34636
35087
  capScope: "system",
@@ -35471,6 +35922,18 @@ Object.freeze({
35471
35922
  addonId: null,
35472
35923
  access: "create"
35473
35924
  },
35925
+ "system.getLoggingSettings": {
35926
+ capName: "system",
35927
+ capScope: "system",
35928
+ addonId: null,
35929
+ access: "view"
35930
+ },
35931
+ "system.getRequestCensus": {
35932
+ capName: "system",
35933
+ capScope: "system",
35934
+ addonId: null,
35935
+ access: "view"
35936
+ },
35474
35937
  "system.getRetentionConfig": {
35475
35938
  capName: "system",
35476
35939
  capScope: "system",
@@ -35501,6 +35964,12 @@ Object.freeze({
35501
35964
  addonId: null,
35502
35965
  access: "view"
35503
35966
  },
35967
+ "system.setLoggingSettings": {
35968
+ capName: "system",
35969
+ capScope: "system",
35970
+ addonId: null,
35971
+ access: "create"
35972
+ },
35504
35973
  "system.setRetentionConfig": {
35505
35974
  capName: "system",
35506
35975
  capScope: "system",
@@ -36656,6 +37125,10 @@ Object.freeze({
36656
37125
  name: "deviceId",
36657
37126
  form: "single",
36658
37127
  optional: true
37128
+ }, {
37129
+ name: "deviceIds",
37130
+ form: "array",
37131
+ optional: true
36659
37132
  }],
36660
37133
  "fanControl.setDirection": [{
36661
37134
  name: "deviceId",
@@ -37461,6 +37934,11 @@ Object.freeze({
37461
37934
  form: "single",
37462
37935
  optional: false
37463
37936
  }],
37937
+ "recording.readWindowBytes": [{
37938
+ name: "deviceId",
37939
+ form: "single",
37940
+ optional: false
37941
+ }],
37464
37942
  "recording.relocateFootage": [{
37465
37943
  name: "deviceId",
37466
37944
  form: "single",
@@ -38261,7 +38739,38 @@ object({
38261
38739
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38262
38740
  * reproduce that.
38263
38741
  */
38264
- tileBudgetMb: number().int().min(0).max(1024)
38742
+ tileBudgetMb: number().int().min(0).max(1024),
38743
+ /**
38744
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38745
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38746
+ * subject tiles, on frames that detected something.
38747
+ *
38748
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38749
+ * containment is strict by design, so the native `keyFrame`, the detail
38750
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38751
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38752
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38753
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38754
+ *
38755
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38756
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38757
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38758
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38759
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38760
+ * binds only through a detection burst, where it still covers well past the
38761
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38762
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38763
+ * whole shape exists to avoid.
38764
+ *
38765
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38766
+ * subject tile, so one shared budget would let a busy camera's key frames
38767
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38768
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38769
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38770
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38771
+ * nothing.
38772
+ */
38773
+ sceneBudgetMb: number().int().min(0).max(1024)
38265
38774
  });
38266
38775
  /**
38267
38776
  * The values in force when the operator has set nothing.
@@ -38277,12 +38786,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38277
38786
  budgetMb: 1024,
38278
38787
  activityMs: 15e3,
38279
38788
  tileBudgetMb: 64,
38789
+ sceneBudgetMb: 48,
38280
38790
  admission: "inferred"
38281
38791
  };
38282
38792
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38283
38793
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38284
38794
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38285
38795
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38796
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38286
38797
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38287
38798
  var MB = 1024 * 1024;
38288
38799
  1024 * MB, 3072 * MB;