@camstack/addon-provider-wyze 0.2.34 → 0.2.36

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
@@ -7558,6 +7558,66 @@ var OpsLogQueryInputSchema = object({
7558
7558
  /** Max rows returned, newest-first. */
7559
7559
  limit: number().int().min(1).max(1e3).optional()
7560
7560
  });
7561
+ var LabelDefinitionSchema = object({
7562
+ id: string(),
7563
+ name: string(),
7564
+ category: string().optional(),
7565
+ description: string().optional(),
7566
+ icon: string().optional()
7567
+ });
7568
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7569
+ var CLASS_MAP_MACRO_TARGETS = [
7570
+ "person",
7571
+ "vehicle",
7572
+ "animal",
7573
+ "package"
7574
+ ];
7575
+ /**
7576
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7577
+ * un operatore può selezionare.
7578
+ *
7579
+ * Sono le tre offerte dallo step `object-detection`
7580
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7581
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7582
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7583
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7584
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7585
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7586
+ *
7587
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7588
+ * dello step e una seconda volta come union `FirstLevelMacro`
7589
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7590
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7591
+ * successiva.
7592
+ */
7593
+ var FIRST_LEVEL_MACRO_CLASSES = [
7594
+ "person",
7595
+ "vehicle",
7596
+ "animal"
7597
+ ];
7598
+ /**
7599
+ * Wire schema for a per-model CATALOG classMap override
7600
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7601
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7602
+ * detection pipeline executor actually routes.
7603
+ *
7604
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7605
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7606
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7607
+ * enum) — the two used to share the name `ClassMapDefinition`/
7608
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7609
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7610
+ * are not: it is two different concepts colliding on a name. Keep this type
7611
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7612
+ * would either narrow every `ClassMapDefinition` consumer to the four
7613
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7614
+ * schema exists for (see the "rejects a classMap whose target is not a
7615
+ * detection macro" test in `model-catalog-schema.test.ts`).
7616
+ */
7617
+ var DetectionCatalogClassMapSchema = object({
7618
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7619
+ preserveOriginal: boolean()
7620
+ });
7561
7621
  /**
7562
7622
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7563
7623
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7580,10 +7640,55 @@ var RecordingStorageModeSchema = _enum([
7580
7640
  "events",
7581
7641
  "continuous"
7582
7642
  ]);
7643
+ /**
7644
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7645
+ * tre offerte dallo step `object-detection`, da UNA lista
7646
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7647
+ */
7648
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7649
+ /**
7650
+ * True quando `values` non ripete un elemento.
7651
+ *
7652
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7653
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7654
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7655
+ */
7656
+ var noDuplicates = (values) => new Set(values).size === values.length;
7583
7657
  /** Which detectors trigger an `events`-mode band. */
7584
7658
  var RecordingTriggersSchema = object({
7585
7659
  motion: boolean().optional(),
7586
- audioThresholdDbfs: number().optional()
7660
+ audioThresholdDbfs: number().optional(),
7661
+ /**
7662
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7663
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7664
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7665
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7666
+ *
7667
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7668
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7669
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7670
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7671
+ * finestre — vedi `recorder/object-trigger.ts`.
7672
+ */
7673
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7674
+ /**
7675
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7676
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7677
+ * `objectClasses`.
7678
+ *
7679
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7680
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7681
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7682
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7683
+ * device (D12) — mai un elenco globale di cap.
7684
+ *
7685
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7686
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7687
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7688
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7689
+ * registrare.
7690
+ */
7691
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7587
7692
  });
7588
7693
  /**
7589
7694
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8035,41 +8140,6 @@ var DecoderSessionConfigSchema = object({
8035
8140
  */
8036
8141
  debug: boolean().optional()
8037
8142
  });
8038
- var LabelDefinitionSchema = object({
8039
- id: string(),
8040
- name: string(),
8041
- category: string().optional(),
8042
- description: string().optional(),
8043
- icon: string().optional()
8044
- });
8045
- /**
8046
- * Wire schema for a per-model CATALOG classMap override
8047
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8048
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8049
- * detection pipeline executor actually routes.
8050
- *
8051
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8052
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8053
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8054
- * enum) — the two used to share the name `ClassMapDefinition`/
8055
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8056
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8057
- * are not: it is two different concepts colliding on a name. Keep this type
8058
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8059
- * would either narrow every `ClassMapDefinition` consumer to the four
8060
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8061
- * schema exists for (see the "rejects a classMap whose target is not a
8062
- * detection macro" test in `model-catalog-schema.test.ts`).
8063
- */
8064
- var DetectionCatalogClassMapSchema = object({
8065
- mapping: record(string(), _enum([
8066
- "person",
8067
- "vehicle",
8068
- "animal",
8069
- "package"
8070
- ])),
8071
- preserveOriginal: boolean()
8072
- });
8073
8143
  var MODEL_FORMATS = [
8074
8144
  "onnx",
8075
8145
  "coreml",
@@ -15831,7 +15901,23 @@ var NcHistoryEntrySchema = object({
15831
15901
  updatedAt: number(),
15832
15902
  /** Failure detail — present on a `dead` row. */
15833
15903
  error: string().optional(),
15834
- subject: NcHistorySubjectSchema
15904
+ subject: NcHistorySubjectSchema,
15905
+ /**
15906
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15907
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15908
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15909
+ * every delivery attempt). Absent on a row still pending/dead, a row
15910
+ * delivered before this field shipped, or a wiring with no artefact index.
15911
+ *
15912
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15913
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15914
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15915
+ * also answers `null` for an id whose artefact has since expired past the
15916
+ * retained shelf's own age bound — the degrade a caller (the Home
15917
+ * Assistant export) must render as "no image right now", never as a
15918
+ * broken link.
15919
+ */
15920
+ artifactIds: array(string().min(1)).optional()
15835
15921
  });
15836
15922
  /**
15837
15923
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16058,7 +16144,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16058
16144
  }), method(object({}), object({
16059
16145
  catalog: array(NcConditionDescriptorSchema),
16060
16146
  taxonomy: NcTaxonomySchema.optional()
16061
- })), 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 }), {
16147
+ })), 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 }), {
16062
16148
  kind: "mutation",
16063
16149
  caller: "required"
16064
16150
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21290,7 +21376,7 @@ var lifecycleJobSchema = object({
21290
21376
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21291
21377
  * as every other cap.
21292
21378
  */
21293
- var LogLevelSchema$1 = _enum([
21379
+ var LogLevelSchema$2 = _enum([
21294
21380
  "debug",
21295
21381
  "info",
21296
21382
  "warn",
@@ -21497,7 +21583,7 @@ var CustomActionInputSchema = object({
21497
21583
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21498
21584
  addonId: string(),
21499
21585
  limit: number().min(1).max(500).default(100),
21500
- level: LogLevelSchema$1.optional()
21586
+ level: LogLevelSchema$2.optional()
21501
21587
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21502
21588
  packageName: string(),
21503
21589
  version: string().optional()
@@ -21595,7 +21681,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21595
21681
  auth: "admin"
21596
21682
  }), method(object({
21597
21683
  addonId: string(),
21598
- level: LogLevelSchema$1.optional()
21684
+ level: LogLevelSchema$2.optional()
21599
21685
  }), LogStreamEntrySchema, { kind: "subscription" });
21600
21686
  /**
21601
21687
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23327,6 +23413,35 @@ var FaceFilterEnum = _enum([
23327
23413
  "identified",
23328
23414
  "all"
23329
23415
  ]);
23416
+ /**
23417
+ * What a `listRecentFaces` page is ORDERED BY.
23418
+ *
23419
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23420
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23421
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23422
+ * order: it puts the suggestions an operator can confirm with one tap at the
23423
+ * top, and it is the reason this enum exists — a client that ranked a capped
23424
+ * page client-side was ranking the newest N, never the most certain N.
23425
+ *
23426
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23427
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23428
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23429
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23430
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23431
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23432
+ * then by faceId, and is what makes this a total order instead of the
23433
+ * backend's NULL-collation accident.
23434
+ */
23435
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23436
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23437
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23438
+ * never leaves the server. */
23439
+ var FaceClusterSchema = object({
23440
+ faceIds: array(string()).readonly(),
23441
+ representativeFaceId: string(),
23442
+ size: number().int(),
23443
+ cohesion: number()
23444
+ });
23330
23445
  var MediaFileLiteSchema$1 = object({
23331
23446
  key: string(),
23332
23447
  kind: string(),
@@ -23373,24 +23488,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23373
23488
  kind: "mutation",
23374
23489
  auth: "admin"
23375
23490
  }), method(object({
23376
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23491
+ /**
23492
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23493
+ *
23494
+ * The legacy single-camera form, kept verbatim for every caller that
23495
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23496
+ * instead — never both: `deviceIds` is the authority whenever it is
23497
+ * present, and this field is then ignored rather than unioned, so
23498
+ * there is exactly one answer to "which cameras did I ask for".
23499
+ */
23377
23500
  deviceId: number().int().optional(),
23501
+ /**
23502
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23503
+ * until now had to fetch the cluster-wide page and drop rows in the
23504
+ * client (so the `limit` it asked for was spent on cameras it was
23505
+ * about to discard).
23506
+ *
23507
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23508
+ * "every camera". A request for no devices is a request, not an
23509
+ * omission; same contract as `deviceManager.listFleet` and
23510
+ * `pipelineAnalytics.listRecentTracks`.
23511
+ *
23512
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23513
+ */
23514
+ deviceIds: array(number().int()).optional(),
23378
23515
  limit: number().int().positive().optional(),
23379
23516
  filter: FaceFilterEnum.optional(),
23380
23517
  /**
23381
- * Inline the base64 crop on every row. Default `true` — the existing
23382
- * behaviour, kept so no caller breaks.
23518
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23519
+ * Absent means no lower bound.
23520
+ */
23521
+ since: number().int().optional(),
23522
+ /**
23523
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23524
+ * Absent means no upper bound.
23525
+ */
23526
+ until: number().int().optional(),
23527
+ /**
23528
+ * Order the page by time or by suggestion certainty. Default
23529
+ * `'timestamp'` — the historical order, unchanged for every caller
23530
+ * that does not ask.
23383
23531
  *
23384
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23385
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23386
- * the browser cache the images.
23532
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23533
+ * does under `'suggestionConfidence'`.
23387
23534
  *
23388
- * **This is an INPUT field, so it does not reach the addon until the
23389
- * next train.** The hub router validates cap inputs against its own
23390
- * compiled Zod, which strips a key it does not know — verified today
23391
- * on the OUTPUT side, where an additive field DOES arrive immediately
23392
- * (`Track.hasFace`). Until the train ships, sending `false` is
23393
- * harmless and simply keeps the crops inline.
23535
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23536
+ * index and stops reading as soon as `limit` rows have PASSED the
23537
+ * filter. `'suggestionConfidence'` cannot stop early — the most
23538
+ * certain row may be the oldest — so it walks the window. Narrow it
23539
+ * with {@link since} / {@link until}.
23540
+ */
23541
+ sortBy: FaceSortFieldEnum.optional(),
23542
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23543
+ sortDirection: FaceSortDirectionEnum.optional(),
23544
+ /**
23545
+ * Inline the base64 crop on every row.
23546
+ *
23547
+ * Default `false` since the 2026-08-25 inversion — see
23548
+ * `include-crops-default.ts`, which is the ONE place that resolves
23549
+ * this for every gallery, and which records why the inline shape had
23550
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23551
+ * The doc here used to still say `true`; it was wrong, and a leftover
23552
+ * that describes the old design reads as permission to rely on it.
23553
+ *
23554
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23555
+ * which the browser fetches off the `event-media` plane in parallel,
23556
+ * cached and ETagged.
23394
23557
  */
23395
23558
  includeCrops: boolean().optional()
23396
23559
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23426,13 +23589,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23426
23589
  }), method(object({
23427
23590
  threshold: number().min(0).max(1).optional(),
23428
23591
  minClusterSize: number().int().min(2).optional(),
23429
- limit: number().int().positive().optional()
23430
- }).optional(), array(object({
23431
- faceIds: array(string()).readonly(),
23432
- representativeFaceId: string(),
23433
- size: number().int(),
23434
- cohesion: number()
23435
- })).readonly());
23592
+ /**
23593
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23594
+ * which read as though it bounded the work — it never did.
23595
+ *
23596
+ * Wins over {@link limit} when both are sent.
23597
+ */
23598
+ maxClusters: number().int().positive().optional(),
23599
+ /**
23600
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23601
+ * RESULT, not the scan. Kept so existing callers keep working; send
23602
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23603
+ */
23604
+ limit: number().int().positive().optional(),
23605
+ /**
23606
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23607
+ * POOL, not the result.
23608
+ *
23609
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23610
+ * used to read every unassigned face on the hub no matter what the
23611
+ * caller asked for, because the only bound cut the finished clusters
23612
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23613
+ * whole corpus, on an addon whose disk is under contention.
23614
+ *
23615
+ * The pool is the NEWEST matching faces first — the same order the
23616
+ * gallery shows — so a bound here shortens the horizon, it does not
23617
+ * sample it randomly.
23618
+ *
23619
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23620
+ * so the live corpus — 372 face rows — is unaffected while the
23621
+ * unbounded scan can never come back as the table grows.
23622
+ */
23623
+ maxFacesScanned: number().int().positive().optional()
23624
+ }).optional(), array(FaceClusterSchema).readonly());
23436
23625
  /**
23437
23626
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23438
23627
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27190,6 +27379,39 @@ var ReadGopBytesResultSchema = object({
27190
27379
  /** Media ms the returned fragment covers. */
27191
27380
  gopDurMs: number()
27192
27381
  });
27382
+ /**
27383
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27384
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27385
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27386
+ * a replay needs several seconds of native pixels, not one frame.
27387
+ *
27388
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27389
+ * is `false` when the returned bytes were cut short by the read's own safety
27390
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27391
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27392
+ * degradation: a window whose end falls past the covering segment would need
27393
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27394
+ * not one standalone-demuxable stream — the caller's answer is to request a
27395
+ * shorter window or one aligned to a single segment, not to receive spliced
27396
+ * bytes nothing has proven decodable.
27397
+ */
27398
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27399
+ kind: literal("ok"),
27400
+ data: _instanceof(Uint8Array),
27401
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27402
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27403
+ gopStartMs: number(),
27404
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27405
+ gopDurMs: number(),
27406
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27407
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27408
+ reachesRequestedEnd: boolean()
27409
+ }), object({
27410
+ kind: literal("spans-multiple-segments"),
27411
+ /** Where the covering segment's own footage runs out — informational,
27412
+ * not a retry hint (retrying the same window would refuse again). */
27413
+ segmentEndMs: number()
27414
+ })]);
27193
27415
  method(object({
27194
27416
  deviceId: number(),
27195
27417
  fromMs: number(),
@@ -27240,6 +27462,15 @@ method(object({
27240
27462
  }), ReadGopBytesResultSchema, {
27241
27463
  kind: "query",
27242
27464
  auth: "admin"
27465
+ }), method(object({
27466
+ deviceId: number(),
27467
+ profile: string(),
27468
+ startMs: number(),
27469
+ fromMs: number(),
27470
+ toMs: number()
27471
+ }), ReadWindowBytesResultSchema, {
27472
+ kind: "query",
27473
+ auth: "admin"
27243
27474
  }), method(object({
27244
27475
  deviceId: number(),
27245
27476
  config: RecordingConfigSchema
@@ -28332,6 +28563,211 @@ var SetSiteLocationInputSchema = object({
28332
28563
  latitude: number().min(-90).max(90),
28333
28564
  longitude: number().min(-180).max(180)
28334
28565
  }).nullable();
28566
+ /**
28567
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28568
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28569
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28570
+ * already prints - never a token, never an `Authorization` header.
28571
+ */
28572
+ var RequestCensusGroupSchema = object({
28573
+ procedure: string(),
28574
+ userAgent: string(),
28575
+ ip: string(),
28576
+ principal: string(),
28577
+ calls: number(),
28578
+ perMin: number()
28579
+ });
28580
+ /**
28581
+ * A procedure's TOTAL over the window, across every caller.
28582
+ *
28583
+ * This block, not the group list, is what answers "did these calls arrive over
28584
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28585
+ * same window excludes the HTTP plane, which is a result, not a failure.
28586
+ */
28587
+ var RequestCensusProcedureSchema = object({
28588
+ procedure: string(),
28589
+ calls: number(),
28590
+ perMin: number()
28591
+ });
28592
+ /**
28593
+ * The census as an operator sees it.
28594
+ *
28595
+ * `persisted` is the honest answer to "will this survive the restart I am
28596
+ * about to do": the arm deadline is written to `system-settings` so a window
28597
+ * armed now can measure the NEXT boot, and a write that failed must not look
28598
+ * like one that succeeded.
28599
+ */
28600
+ var RequestCensusStatusSchema = object({
28601
+ armed: boolean(),
28602
+ /** How long the current - or just-closed - window collected, in ms. */
28603
+ elapsedMs: number(),
28604
+ /** The window actually armed, after the server clamped the request. */
28605
+ windowMs: number(),
28606
+ /** Epoch ms the window closes at. 0 when disarmed. */
28607
+ armedUntilMs: number(),
28608
+ httpRequests: number(),
28609
+ batchedRequests: number(),
28610
+ /**
28611
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28612
+ * is in play (`?batch=1` carries several procedures in one request); this is
28613
+ * the number comparable with a store-side call count.
28614
+ */
28615
+ procedureCalls: number(),
28616
+ /**
28617
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28618
+ * transport resolves one context per connection - but the number that says
28619
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28620
+ */
28621
+ wsConnections: number(),
28622
+ distinctGroups: number(),
28623
+ /** Calls counted in the totals whose group attribution was shed at the
28624
+ * cardinality bound. */
28625
+ unattributedCalls: number(),
28626
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28627
+ groups: array(RequestCensusGroupSchema).readonly()
28628
+ }).extend({ persisted: boolean() });
28629
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28630
+ var LogLevelSchema$1 = _enum([
28631
+ "debug",
28632
+ "info",
28633
+ "warn",
28634
+ "error"
28635
+ ]);
28636
+ /**
28637
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28638
+ *
28639
+ * A diagnostic is anything whose cost is only worth paying while a question is
28640
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28641
+ */
28642
+ var DiagnosticIdSchema = _enum(["request-census"]);
28643
+ /**
28644
+ * The layers of the level hierarchy, general → specific. The most specific
28645
+ * layer that carries an explicit value wins.
28646
+ *
28647
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28648
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28649
+ * grow later would force every consumer of this document to change with it.
28650
+ * Nothing returns `component` today.
28651
+ */
28652
+ var LoggingScopeKindSchema = _enum([
28653
+ "cluster",
28654
+ "node",
28655
+ "component"
28656
+ ]);
28657
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28658
+ var LoggingLevelSourceSchema = _enum([
28659
+ "default",
28660
+ "cluster",
28661
+ "node",
28662
+ "component"
28663
+ ]);
28664
+ /**
28665
+ * One layer of the hierarchy as it actually STANDS.
28666
+ *
28667
+ * `level: null` is the whole reason this array is returned: it is the
28668
+ * difference between "this node is at `info` because I decided it" and
28669
+ * "...because it inherits". An operator who clears an override believing they
28670
+ * are clearing an inherited value has been handed the same defect as the two
28671
+ * contradicting knobs this document exists to remove, moved one floor up.
28672
+ */
28673
+ var LoggingLevelLayerSchema = object({
28674
+ scope: LoggingScopeKindSchema,
28675
+ /** The node this layer speaks for; `null` on the cluster layer. */
28676
+ nodeId: string().nullable(),
28677
+ /** Explicitly set here, or `null` when this layer inherits. */
28678
+ level: LogLevelSchema$1.nullable()
28679
+ });
28680
+ /** What a line is judged against, and WHICH layer decided it. */
28681
+ var LoggingEffectiveSchema = object({
28682
+ level: LogLevelSchema$1,
28683
+ levelSource: LoggingLevelSourceSchema
28684
+ });
28685
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28686
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28687
+ /**
28688
+ * An armed diagnostic, with its DEADLINE.
28689
+ *
28690
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28691
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28692
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28693
+ * `armed` is false — a window is never reported as slightly expired.
28694
+ */
28695
+ var DiagnosticWindowSchema = object({
28696
+ id: DiagnosticIdSchema,
28697
+ armed: boolean(),
28698
+ /** Epoch ms the window closes at. 0 when disarmed. */
28699
+ armedUntilMs: number(),
28700
+ /** Ms left before it expires on its own. 0 when disarmed. */
28701
+ remainingMs: number(),
28702
+ /** Whether the stored deadline is the one the live diagnostic is running —
28703
+ * i.e. whether this window would survive a restart. */
28704
+ persisted: boolean()
28705
+ });
28706
+ /**
28707
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28708
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28709
+ * is a second knob that disagrees with the first the day one of them moves.
28710
+ */
28711
+ var DiagnosticWindowPatchSchema = object({
28712
+ id: DiagnosticIdSchema,
28713
+ armMs: number().int().min(0),
28714
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28715
+ reportEveryMs: number().int().positive().optional()
28716
+ });
28717
+ /**
28718
+ * A PATCH, and patches MERGE.
28719
+ *
28720
+ * A field absent from the patch is left exactly as it was — arming a
28721
+ * diagnostic never resets a level, and setting a level never disarms a window.
28722
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28723
+ * `setAll` already merges, and rebuilding the object is how an absent field
28724
+ * turns into an erased one.
28725
+ */
28726
+ var LoggingSettingsPatchSchema = object({
28727
+ /**
28728
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28729
+ * addressed scope so it inherits again. A value sets it.
28730
+ */
28731
+ level: LogLevelSchema$1.nullable().optional(),
28732
+ /**
28733
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28734
+ * keeps running — a patch is never a full replacement.
28735
+ */
28736
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28737
+ });
28738
+ /**
28739
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28740
+ *
28741
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28742
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28743
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28744
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28745
+ * by an agent that holds no cluster document at all. The hub is the single
28746
+ * authority over the whole hierarchy and answers for every layer, so the
28747
+ * layer selector needs a name the transport does not already own.
28748
+ */
28749
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28750
+ var SetLoggingSettingsInputSchema = object({
28751
+ scopeNodeId: string().optional(),
28752
+ patch: LoggingSettingsPatchSchema
28753
+ });
28754
+ /**
28755
+ * The whole document, as read and as returned after every write.
28756
+ *
28757
+ * `persisted: false` means the settings store could not be read or written.
28758
+ * The in-memory mirror still governs behaviour and is unchanged by the
28759
+ * failure — a read that fails neither switches a level nor disarms a window
28760
+ * (D49) — but the operator is told that what they are looking at would not
28761
+ * survive a restart.
28762
+ */
28763
+ var LoggingSettingsStateSchema = object({
28764
+ /** The layer this document was read at. `null` = the cluster layer. */
28765
+ scopeNodeId: string().nullable(),
28766
+ effective: LoggingEffectiveSchema,
28767
+ explicit: LoggingExplicitSchema,
28768
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28769
+ persisted: boolean()
28770
+ });
28335
28771
  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(), {
28336
28772
  kind: "mutation",
28337
28773
  auth: "admin"
@@ -28344,6 +28780,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28344
28780
  }), method(_void(), SiteLocationStatusSchema, {
28345
28781
  kind: "mutation",
28346
28782
  auth: "admin"
28783
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28784
+ kind: "mutation",
28785
+ auth: "admin"
28347
28786
  });
28348
28787
  /**
28349
28788
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33327,6 +33766,12 @@ Object.freeze({
33327
33766
  addonId: null,
33328
33767
  access: "view"
33329
33768
  },
33769
+ "notificationRules.resolveArtifactUrl": {
33770
+ capName: "notification-rules",
33771
+ capScope: "system",
33772
+ addonId: null,
33773
+ access: "view"
33774
+ },
33330
33775
  "notificationRules.setAlarmConfig": {
33331
33776
  capName: "notification-rules",
33332
33777
  capScope: "system",
@@ -34731,6 +35176,12 @@ Object.freeze({
34731
35176
  addonId: null,
34732
35177
  access: "view"
34733
35178
  },
35179
+ "recording.readWindowBytes": {
35180
+ capName: "recording",
35181
+ capScope: "system",
35182
+ addonId: null,
35183
+ access: "view"
35184
+ },
34734
35185
  "recording.refreshStorageLocationsForMigration": {
34735
35186
  capName: "recording",
34736
35187
  capScope: "system",
@@ -35571,6 +36022,18 @@ Object.freeze({
35571
36022
  addonId: null,
35572
36023
  access: "create"
35573
36024
  },
36025
+ "system.getLoggingSettings": {
36026
+ capName: "system",
36027
+ capScope: "system",
36028
+ addonId: null,
36029
+ access: "view"
36030
+ },
36031
+ "system.getRequestCensus": {
36032
+ capName: "system",
36033
+ capScope: "system",
36034
+ addonId: null,
36035
+ access: "view"
36036
+ },
35574
36037
  "system.getRetentionConfig": {
35575
36038
  capName: "system",
35576
36039
  capScope: "system",
@@ -35601,6 +36064,12 @@ Object.freeze({
35601
36064
  addonId: null,
35602
36065
  access: "view"
35603
36066
  },
36067
+ "system.setLoggingSettings": {
36068
+ capName: "system",
36069
+ capScope: "system",
36070
+ addonId: null,
36071
+ access: "create"
36072
+ },
35604
36073
  "system.setRetentionConfig": {
35605
36074
  capName: "system",
35606
36075
  capScope: "system",
@@ -36756,6 +37225,10 @@ Object.freeze({
36756
37225
  name: "deviceId",
36757
37226
  form: "single",
36758
37227
  optional: true
37228
+ }, {
37229
+ name: "deviceIds",
37230
+ form: "array",
37231
+ optional: true
36759
37232
  }],
36760
37233
  "fanControl.setDirection": [{
36761
37234
  name: "deviceId",
@@ -37561,6 +38034,11 @@ Object.freeze({
37561
38034
  form: "single",
37562
38035
  optional: false
37563
38036
  }],
38037
+ "recording.readWindowBytes": [{
38038
+ name: "deviceId",
38039
+ form: "single",
38040
+ optional: false
38041
+ }],
37564
38042
  "recording.relocateFootage": [{
37565
38043
  name: "deviceId",
37566
38044
  form: "single",
@@ -38361,7 +38839,38 @@ object({
38361
38839
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38362
38840
  * reproduce that.
38363
38841
  */
38364
- tileBudgetMb: number().int().min(0).max(1024)
38842
+ tileBudgetMb: number().int().min(0).max(1024),
38843
+ /**
38844
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38845
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38846
+ * subject tiles, on frames that detected something.
38847
+ *
38848
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38849
+ * containment is strict by design, so the native `keyFrame`, the detail
38850
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38851
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38852
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38853
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38854
+ *
38855
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38856
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38857
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38858
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38859
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38860
+ * binds only through a detection burst, where it still covers well past the
38861
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38862
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38863
+ * whole shape exists to avoid.
38864
+ *
38865
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38866
+ * subject tile, so one shared budget would let a busy camera's key frames
38867
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38868
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38869
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38870
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38871
+ * nothing.
38872
+ */
38873
+ sceneBudgetMb: number().int().min(0).max(1024)
38365
38874
  });
38366
38875
  /**
38367
38876
  * The values in force when the operator has set nothing.
@@ -38377,12 +38886,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38377
38886
  budgetMb: 1024,
38378
38887
  activityMs: 15e3,
38379
38888
  tileBudgetMb: 64,
38889
+ sceneBudgetMb: 48,
38380
38890
  admission: "inferred"
38381
38891
  };
38382
38892
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38383
38893
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38384
38894
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38385
38895
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38896
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38386
38897
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38387
38898
  var MB = 1024 * 1024;
38388
38899
  1024 * MB, 3072 * MB;