@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.mjs CHANGED
@@ -7537,6 +7537,66 @@ var OpsLogQueryInputSchema = object({
7537
7537
  /** Max rows returned, newest-first. */
7538
7538
  limit: number().int().min(1).max(1e3).optional()
7539
7539
  });
7540
+ var LabelDefinitionSchema = object({
7541
+ id: string(),
7542
+ name: string(),
7543
+ category: string().optional(),
7544
+ description: string().optional(),
7545
+ icon: string().optional()
7546
+ });
7547
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7548
+ var CLASS_MAP_MACRO_TARGETS = [
7549
+ "person",
7550
+ "vehicle",
7551
+ "animal",
7552
+ "package"
7553
+ ];
7554
+ /**
7555
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7556
+ * un operatore può selezionare.
7557
+ *
7558
+ * Sono le tre offerte dallo step `object-detection`
7559
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7560
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7561
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7562
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7563
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7564
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7565
+ *
7566
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7567
+ * dello step e una seconda volta come union `FirstLevelMacro`
7568
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7569
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7570
+ * successiva.
7571
+ */
7572
+ var FIRST_LEVEL_MACRO_CLASSES = [
7573
+ "person",
7574
+ "vehicle",
7575
+ "animal"
7576
+ ];
7577
+ /**
7578
+ * Wire schema for a per-model CATALOG classMap override
7579
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7580
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7581
+ * detection pipeline executor actually routes.
7582
+ *
7583
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7584
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7585
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7586
+ * enum) — the two used to share the name `ClassMapDefinition`/
7587
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7588
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7589
+ * are not: it is two different concepts colliding on a name. Keep this type
7590
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7591
+ * would either narrow every `ClassMapDefinition` consumer to the four
7592
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7593
+ * schema exists for (see the "rejects a classMap whose target is not a
7594
+ * detection macro" test in `model-catalog-schema.test.ts`).
7595
+ */
7596
+ var DetectionCatalogClassMapSchema = object({
7597
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7598
+ preserveOriginal: boolean()
7599
+ });
7540
7600
  /**
7541
7601
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7542
7602
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7559,10 +7619,55 @@ var RecordingStorageModeSchema = _enum([
7559
7619
  "events",
7560
7620
  "continuous"
7561
7621
  ]);
7622
+ /**
7623
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7624
+ * tre offerte dallo step `object-detection`, da UNA lista
7625
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7626
+ */
7627
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7628
+ /**
7629
+ * True quando `values` non ripete un elemento.
7630
+ *
7631
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7632
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7633
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7634
+ */
7635
+ var noDuplicates = (values) => new Set(values).size === values.length;
7562
7636
  /** Which detectors trigger an `events`-mode band. */
7563
7637
  var RecordingTriggersSchema = object({
7564
7638
  motion: boolean().optional(),
7565
- audioThresholdDbfs: number().optional()
7639
+ audioThresholdDbfs: number().optional(),
7640
+ /**
7641
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7642
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7643
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7644
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7645
+ *
7646
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7647
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7648
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7649
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7650
+ * finestre — vedi `recorder/object-trigger.ts`.
7651
+ */
7652
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7653
+ /**
7654
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7655
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7656
+ * `objectClasses`.
7657
+ *
7658
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7659
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7660
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7661
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7662
+ * device (D12) — mai un elenco globale di cap.
7663
+ *
7664
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7665
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7666
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7667
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7668
+ * registrare.
7669
+ */
7670
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7566
7671
  });
7567
7672
  /**
7568
7673
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8014,41 +8119,6 @@ var DecoderSessionConfigSchema = object({
8014
8119
  */
8015
8120
  debug: boolean().optional()
8016
8121
  });
8017
- var LabelDefinitionSchema = object({
8018
- id: string(),
8019
- name: string(),
8020
- category: string().optional(),
8021
- description: string().optional(),
8022
- icon: string().optional()
8023
- });
8024
- /**
8025
- * Wire schema for a per-model CATALOG classMap override
8026
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8027
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8028
- * detection pipeline executor actually routes.
8029
- *
8030
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8031
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8032
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8033
- * enum) — the two used to share the name `ClassMapDefinition`/
8034
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8035
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8036
- * are not: it is two different concepts colliding on a name. Keep this type
8037
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8038
- * would either narrow every `ClassMapDefinition` consumer to the four
8039
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8040
- * schema exists for (see the "rejects a classMap whose target is not a
8041
- * detection macro" test in `model-catalog-schema.test.ts`).
8042
- */
8043
- var DetectionCatalogClassMapSchema = object({
8044
- mapping: record(string(), _enum([
8045
- "person",
8046
- "vehicle",
8047
- "animal",
8048
- "package"
8049
- ])),
8050
- preserveOriginal: boolean()
8051
- });
8052
8122
  var MODEL_FORMATS = [
8053
8123
  "onnx",
8054
8124
  "coreml",
@@ -15810,7 +15880,23 @@ var NcHistoryEntrySchema = object({
15810
15880
  updatedAt: number(),
15811
15881
  /** Failure detail — present on a `dead` row. */
15812
15882
  error: string().optional(),
15813
- subject: NcHistorySubjectSchema
15883
+ subject: NcHistorySubjectSchema,
15884
+ /**
15885
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15886
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15887
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15888
+ * every delivery attempt). Absent on a row still pending/dead, a row
15889
+ * delivered before this field shipped, or a wiring with no artefact index.
15890
+ *
15891
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15892
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15893
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15894
+ * also answers `null` for an id whose artefact has since expired past the
15895
+ * retained shelf's own age bound — the degrade a caller (the Home
15896
+ * Assistant export) must render as "no image right now", never as a
15897
+ * broken link.
15898
+ */
15899
+ artifactIds: array(string().min(1)).optional()
15814
15900
  });
15815
15901
  /**
15816
15902
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16037,7 +16123,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16037
16123
  }), method(object({}), object({
16038
16124
  catalog: array(NcConditionDescriptorSchema),
16039
16125
  taxonomy: NcTaxonomySchema.optional()
16040
- })), 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 }), {
16126
+ })), 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 }), {
16041
16127
  kind: "mutation",
16042
16128
  caller: "required"
16043
16129
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21269,7 +21355,7 @@ var lifecycleJobSchema = object({
21269
21355
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21270
21356
  * as every other cap.
21271
21357
  */
21272
- var LogLevelSchema$1 = _enum([
21358
+ var LogLevelSchema$2 = _enum([
21273
21359
  "debug",
21274
21360
  "info",
21275
21361
  "warn",
@@ -21476,7 +21562,7 @@ var CustomActionInputSchema = object({
21476
21562
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21477
21563
  addonId: string(),
21478
21564
  limit: number().min(1).max(500).default(100),
21479
- level: LogLevelSchema$1.optional()
21565
+ level: LogLevelSchema$2.optional()
21480
21566
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21481
21567
  packageName: string(),
21482
21568
  version: string().optional()
@@ -21574,7 +21660,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21574
21660
  auth: "admin"
21575
21661
  }), method(object({
21576
21662
  addonId: string(),
21577
- level: LogLevelSchema$1.optional()
21663
+ level: LogLevelSchema$2.optional()
21578
21664
  }), LogStreamEntrySchema, { kind: "subscription" });
21579
21665
  /**
21580
21666
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23306,6 +23392,35 @@ var FaceFilterEnum = _enum([
23306
23392
  "identified",
23307
23393
  "all"
23308
23394
  ]);
23395
+ /**
23396
+ * What a `listRecentFaces` page is ORDERED BY.
23397
+ *
23398
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23399
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23400
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23401
+ * order: it puts the suggestions an operator can confirm with one tap at the
23402
+ * top, and it is the reason this enum exists — a client that ranked a capped
23403
+ * page client-side was ranking the newest N, never the most certain N.
23404
+ *
23405
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23406
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23407
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23408
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23409
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23410
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23411
+ * then by faceId, and is what makes this a total order instead of the
23412
+ * backend's NULL-collation accident.
23413
+ */
23414
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23415
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23416
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23417
+ * never leaves the server. */
23418
+ var FaceClusterSchema = object({
23419
+ faceIds: array(string()).readonly(),
23420
+ representativeFaceId: string(),
23421
+ size: number().int(),
23422
+ cohesion: number()
23423
+ });
23309
23424
  var MediaFileLiteSchema$1 = object({
23310
23425
  key: string(),
23311
23426
  kind: string(),
@@ -23352,24 +23467,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23352
23467
  kind: "mutation",
23353
23468
  auth: "admin"
23354
23469
  }), method(object({
23355
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23470
+ /**
23471
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23472
+ *
23473
+ * The legacy single-camera form, kept verbatim for every caller that
23474
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23475
+ * instead — never both: `deviceIds` is the authority whenever it is
23476
+ * present, and this field is then ignored rather than unioned, so
23477
+ * there is exactly one answer to "which cameras did I ask for".
23478
+ */
23356
23479
  deviceId: number().int().optional(),
23480
+ /**
23481
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23482
+ * until now had to fetch the cluster-wide page and drop rows in the
23483
+ * client (so the `limit` it asked for was spent on cameras it was
23484
+ * about to discard).
23485
+ *
23486
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23487
+ * "every camera". A request for no devices is a request, not an
23488
+ * omission; same contract as `deviceManager.listFleet` and
23489
+ * `pipelineAnalytics.listRecentTracks`.
23490
+ *
23491
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23492
+ */
23493
+ deviceIds: array(number().int()).optional(),
23357
23494
  limit: number().int().positive().optional(),
23358
23495
  filter: FaceFilterEnum.optional(),
23359
23496
  /**
23360
- * Inline the base64 crop on every row. Default `true` — the existing
23361
- * behaviour, kept so no caller breaks.
23497
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23498
+ * Absent means no lower bound.
23499
+ */
23500
+ since: number().int().optional(),
23501
+ /**
23502
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23503
+ * Absent means no upper bound.
23504
+ */
23505
+ until: number().int().optional(),
23506
+ /**
23507
+ * Order the page by time or by suggestion certainty. Default
23508
+ * `'timestamp'` — the historical order, unchanged for every caller
23509
+ * that does not ask.
23362
23510
  *
23363
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23364
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23365
- * the browser cache the images.
23511
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23512
+ * does under `'suggestionConfidence'`.
23366
23513
  *
23367
- * **This is an INPUT field, so it does not reach the addon until the
23368
- * next train.** The hub router validates cap inputs against its own
23369
- * compiled Zod, which strips a key it does not know — verified today
23370
- * on the OUTPUT side, where an additive field DOES arrive immediately
23371
- * (`Track.hasFace`). Until the train ships, sending `false` is
23372
- * harmless and simply keeps the crops inline.
23514
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23515
+ * index and stops reading as soon as `limit` rows have PASSED the
23516
+ * filter. `'suggestionConfidence'` cannot stop early — the most
23517
+ * certain row may be the oldest — so it walks the window. Narrow it
23518
+ * with {@link since} / {@link until}.
23519
+ */
23520
+ sortBy: FaceSortFieldEnum.optional(),
23521
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23522
+ sortDirection: FaceSortDirectionEnum.optional(),
23523
+ /**
23524
+ * Inline the base64 crop on every row.
23525
+ *
23526
+ * Default `false` since the 2026-08-25 inversion — see
23527
+ * `include-crops-default.ts`, which is the ONE place that resolves
23528
+ * this for every gallery, and which records why the inline shape had
23529
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23530
+ * The doc here used to still say `true`; it was wrong, and a leftover
23531
+ * that describes the old design reads as permission to rely on it.
23532
+ *
23533
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23534
+ * which the browser fetches off the `event-media` plane in parallel,
23535
+ * cached and ETagged.
23373
23536
  */
23374
23537
  includeCrops: boolean().optional()
23375
23538
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23405,13 +23568,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23405
23568
  }), method(object({
23406
23569
  threshold: number().min(0).max(1).optional(),
23407
23570
  minClusterSize: number().int().min(2).optional(),
23408
- limit: number().int().positive().optional()
23409
- }).optional(), array(object({
23410
- faceIds: array(string()).readonly(),
23411
- representativeFaceId: string(),
23412
- size: number().int(),
23413
- cohesion: number()
23414
- })).readonly());
23571
+ /**
23572
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23573
+ * which read as though it bounded the work — it never did.
23574
+ *
23575
+ * Wins over {@link limit} when both are sent.
23576
+ */
23577
+ maxClusters: number().int().positive().optional(),
23578
+ /**
23579
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23580
+ * RESULT, not the scan. Kept so existing callers keep working; send
23581
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23582
+ */
23583
+ limit: number().int().positive().optional(),
23584
+ /**
23585
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23586
+ * POOL, not the result.
23587
+ *
23588
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23589
+ * used to read every unassigned face on the hub no matter what the
23590
+ * caller asked for, because the only bound cut the finished clusters
23591
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23592
+ * whole corpus, on an addon whose disk is under contention.
23593
+ *
23594
+ * The pool is the NEWEST matching faces first — the same order the
23595
+ * gallery shows — so a bound here shortens the horizon, it does not
23596
+ * sample it randomly.
23597
+ *
23598
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23599
+ * so the live corpus — 372 face rows — is unaffected while the
23600
+ * unbounded scan can never come back as the table grows.
23601
+ */
23602
+ maxFacesScanned: number().int().positive().optional()
23603
+ }).optional(), array(FaceClusterSchema).readonly());
23415
23604
  /**
23416
23605
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23417
23606
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27169,6 +27358,39 @@ var ReadGopBytesResultSchema = object({
27169
27358
  /** Media ms the returned fragment covers. */
27170
27359
  gopDurMs: number()
27171
27360
  });
27361
+ /**
27362
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27363
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27364
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27365
+ * a replay needs several seconds of native pixels, not one frame.
27366
+ *
27367
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27368
+ * is `false` when the returned bytes were cut short by the read's own safety
27369
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27370
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27371
+ * degradation: a window whose end falls past the covering segment would need
27372
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27373
+ * not one standalone-demuxable stream — the caller's answer is to request a
27374
+ * shorter window or one aligned to a single segment, not to receive spliced
27375
+ * bytes nothing has proven decodable.
27376
+ */
27377
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27378
+ kind: literal("ok"),
27379
+ data: _instanceof(Uint8Array),
27380
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27381
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27382
+ gopStartMs: number(),
27383
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27384
+ gopDurMs: number(),
27385
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27386
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27387
+ reachesRequestedEnd: boolean()
27388
+ }), object({
27389
+ kind: literal("spans-multiple-segments"),
27390
+ /** Where the covering segment's own footage runs out — informational,
27391
+ * not a retry hint (retrying the same window would refuse again). */
27392
+ segmentEndMs: number()
27393
+ })]);
27172
27394
  method(object({
27173
27395
  deviceId: number(),
27174
27396
  fromMs: number(),
@@ -27219,6 +27441,15 @@ method(object({
27219
27441
  }), ReadGopBytesResultSchema, {
27220
27442
  kind: "query",
27221
27443
  auth: "admin"
27444
+ }), method(object({
27445
+ deviceId: number(),
27446
+ profile: string(),
27447
+ startMs: number(),
27448
+ fromMs: number(),
27449
+ toMs: number()
27450
+ }), ReadWindowBytesResultSchema, {
27451
+ kind: "query",
27452
+ auth: "admin"
27222
27453
  }), method(object({
27223
27454
  deviceId: number(),
27224
27455
  config: RecordingConfigSchema
@@ -28311,6 +28542,211 @@ var SetSiteLocationInputSchema = object({
28311
28542
  latitude: number().min(-90).max(90),
28312
28543
  longitude: number().min(-180).max(180)
28313
28544
  }).nullable();
28545
+ /**
28546
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28547
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28548
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28549
+ * already prints - never a token, never an `Authorization` header.
28550
+ */
28551
+ var RequestCensusGroupSchema = object({
28552
+ procedure: string(),
28553
+ userAgent: string(),
28554
+ ip: string(),
28555
+ principal: string(),
28556
+ calls: number(),
28557
+ perMin: number()
28558
+ });
28559
+ /**
28560
+ * A procedure's TOTAL over the window, across every caller.
28561
+ *
28562
+ * This block, not the group list, is what answers "did these calls arrive over
28563
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28564
+ * same window excludes the HTTP plane, which is a result, not a failure.
28565
+ */
28566
+ var RequestCensusProcedureSchema = object({
28567
+ procedure: string(),
28568
+ calls: number(),
28569
+ perMin: number()
28570
+ });
28571
+ /**
28572
+ * The census as an operator sees it.
28573
+ *
28574
+ * `persisted` is the honest answer to "will this survive the restart I am
28575
+ * about to do": the arm deadline is written to `system-settings` so a window
28576
+ * armed now can measure the NEXT boot, and a write that failed must not look
28577
+ * like one that succeeded.
28578
+ */
28579
+ var RequestCensusStatusSchema = object({
28580
+ armed: boolean(),
28581
+ /** How long the current - or just-closed - window collected, in ms. */
28582
+ elapsedMs: number(),
28583
+ /** The window actually armed, after the server clamped the request. */
28584
+ windowMs: number(),
28585
+ /** Epoch ms the window closes at. 0 when disarmed. */
28586
+ armedUntilMs: number(),
28587
+ httpRequests: number(),
28588
+ batchedRequests: number(),
28589
+ /**
28590
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28591
+ * is in play (`?batch=1` carries several procedures in one request); this is
28592
+ * the number comparable with a store-side call count.
28593
+ */
28594
+ procedureCalls: number(),
28595
+ /**
28596
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28597
+ * transport resolves one context per connection - but the number that says
28598
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28599
+ */
28600
+ wsConnections: number(),
28601
+ distinctGroups: number(),
28602
+ /** Calls counted in the totals whose group attribution was shed at the
28603
+ * cardinality bound. */
28604
+ unattributedCalls: number(),
28605
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28606
+ groups: array(RequestCensusGroupSchema).readonly()
28607
+ }).extend({ persisted: boolean() });
28608
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28609
+ var LogLevelSchema$1 = _enum([
28610
+ "debug",
28611
+ "info",
28612
+ "warn",
28613
+ "error"
28614
+ ]);
28615
+ /**
28616
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28617
+ *
28618
+ * A diagnostic is anything whose cost is only worth paying while a question is
28619
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28620
+ */
28621
+ var DiagnosticIdSchema = _enum(["request-census"]);
28622
+ /**
28623
+ * The layers of the level hierarchy, general → specific. The most specific
28624
+ * layer that carries an explicit value wins.
28625
+ *
28626
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28627
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28628
+ * grow later would force every consumer of this document to change with it.
28629
+ * Nothing returns `component` today.
28630
+ */
28631
+ var LoggingScopeKindSchema = _enum([
28632
+ "cluster",
28633
+ "node",
28634
+ "component"
28635
+ ]);
28636
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28637
+ var LoggingLevelSourceSchema = _enum([
28638
+ "default",
28639
+ "cluster",
28640
+ "node",
28641
+ "component"
28642
+ ]);
28643
+ /**
28644
+ * One layer of the hierarchy as it actually STANDS.
28645
+ *
28646
+ * `level: null` is the whole reason this array is returned: it is the
28647
+ * difference between "this node is at `info` because I decided it" and
28648
+ * "...because it inherits". An operator who clears an override believing they
28649
+ * are clearing an inherited value has been handed the same defect as the two
28650
+ * contradicting knobs this document exists to remove, moved one floor up.
28651
+ */
28652
+ var LoggingLevelLayerSchema = object({
28653
+ scope: LoggingScopeKindSchema,
28654
+ /** The node this layer speaks for; `null` on the cluster layer. */
28655
+ nodeId: string().nullable(),
28656
+ /** Explicitly set here, or `null` when this layer inherits. */
28657
+ level: LogLevelSchema$1.nullable()
28658
+ });
28659
+ /** What a line is judged against, and WHICH layer decided it. */
28660
+ var LoggingEffectiveSchema = object({
28661
+ level: LogLevelSchema$1,
28662
+ levelSource: LoggingLevelSourceSchema
28663
+ });
28664
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28665
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28666
+ /**
28667
+ * An armed diagnostic, with its DEADLINE.
28668
+ *
28669
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28670
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28671
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28672
+ * `armed` is false — a window is never reported as slightly expired.
28673
+ */
28674
+ var DiagnosticWindowSchema = object({
28675
+ id: DiagnosticIdSchema,
28676
+ armed: boolean(),
28677
+ /** Epoch ms the window closes at. 0 when disarmed. */
28678
+ armedUntilMs: number(),
28679
+ /** Ms left before it expires on its own. 0 when disarmed. */
28680
+ remainingMs: number(),
28681
+ /** Whether the stored deadline is the one the live diagnostic is running —
28682
+ * i.e. whether this window would survive a restart. */
28683
+ persisted: boolean()
28684
+ });
28685
+ /**
28686
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28687
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28688
+ * is a second knob that disagrees with the first the day one of them moves.
28689
+ */
28690
+ var DiagnosticWindowPatchSchema = object({
28691
+ id: DiagnosticIdSchema,
28692
+ armMs: number().int().min(0),
28693
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28694
+ reportEveryMs: number().int().positive().optional()
28695
+ });
28696
+ /**
28697
+ * A PATCH, and patches MERGE.
28698
+ *
28699
+ * A field absent from the patch is left exactly as it was — arming a
28700
+ * diagnostic never resets a level, and setting a level never disarms a window.
28701
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28702
+ * `setAll` already merges, and rebuilding the object is how an absent field
28703
+ * turns into an erased one.
28704
+ */
28705
+ var LoggingSettingsPatchSchema = object({
28706
+ /**
28707
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28708
+ * addressed scope so it inherits again. A value sets it.
28709
+ */
28710
+ level: LogLevelSchema$1.nullable().optional(),
28711
+ /**
28712
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28713
+ * keeps running — a patch is never a full replacement.
28714
+ */
28715
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28716
+ });
28717
+ /**
28718
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28719
+ *
28720
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28721
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28722
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28723
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28724
+ * by an agent that holds no cluster document at all. The hub is the single
28725
+ * authority over the whole hierarchy and answers for every layer, so the
28726
+ * layer selector needs a name the transport does not already own.
28727
+ */
28728
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28729
+ var SetLoggingSettingsInputSchema = object({
28730
+ scopeNodeId: string().optional(),
28731
+ patch: LoggingSettingsPatchSchema
28732
+ });
28733
+ /**
28734
+ * The whole document, as read and as returned after every write.
28735
+ *
28736
+ * `persisted: false` means the settings store could not be read or written.
28737
+ * The in-memory mirror still governs behaviour and is unchanged by the
28738
+ * failure — a read that fails neither switches a level nor disarms a window
28739
+ * (D49) — but the operator is told that what they are looking at would not
28740
+ * survive a restart.
28741
+ */
28742
+ var LoggingSettingsStateSchema = object({
28743
+ /** The layer this document was read at. `null` = the cluster layer. */
28744
+ scopeNodeId: string().nullable(),
28745
+ effective: LoggingEffectiveSchema,
28746
+ explicit: LoggingExplicitSchema,
28747
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28748
+ persisted: boolean()
28749
+ });
28314
28750
  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(), {
28315
28751
  kind: "mutation",
28316
28752
  auth: "admin"
@@ -28323,6 +28759,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28323
28759
  }), method(_void(), SiteLocationStatusSchema, {
28324
28760
  kind: "mutation",
28325
28761
  auth: "admin"
28762
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28763
+ kind: "mutation",
28764
+ auth: "admin"
28326
28765
  });
28327
28766
  /**
28328
28767
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33306,6 +33745,12 @@ Object.freeze({
33306
33745
  addonId: null,
33307
33746
  access: "view"
33308
33747
  },
33748
+ "notificationRules.resolveArtifactUrl": {
33749
+ capName: "notification-rules",
33750
+ capScope: "system",
33751
+ addonId: null,
33752
+ access: "view"
33753
+ },
33309
33754
  "notificationRules.setAlarmConfig": {
33310
33755
  capName: "notification-rules",
33311
33756
  capScope: "system",
@@ -34710,6 +35155,12 @@ Object.freeze({
34710
35155
  addonId: null,
34711
35156
  access: "view"
34712
35157
  },
35158
+ "recording.readWindowBytes": {
35159
+ capName: "recording",
35160
+ capScope: "system",
35161
+ addonId: null,
35162
+ access: "view"
35163
+ },
34713
35164
  "recording.refreshStorageLocationsForMigration": {
34714
35165
  capName: "recording",
34715
35166
  capScope: "system",
@@ -35550,6 +36001,18 @@ Object.freeze({
35550
36001
  addonId: null,
35551
36002
  access: "create"
35552
36003
  },
36004
+ "system.getLoggingSettings": {
36005
+ capName: "system",
36006
+ capScope: "system",
36007
+ addonId: null,
36008
+ access: "view"
36009
+ },
36010
+ "system.getRequestCensus": {
36011
+ capName: "system",
36012
+ capScope: "system",
36013
+ addonId: null,
36014
+ access: "view"
36015
+ },
35553
36016
  "system.getRetentionConfig": {
35554
36017
  capName: "system",
35555
36018
  capScope: "system",
@@ -35580,6 +36043,12 @@ Object.freeze({
35580
36043
  addonId: null,
35581
36044
  access: "view"
35582
36045
  },
36046
+ "system.setLoggingSettings": {
36047
+ capName: "system",
36048
+ capScope: "system",
36049
+ addonId: null,
36050
+ access: "create"
36051
+ },
35583
36052
  "system.setRetentionConfig": {
35584
36053
  capName: "system",
35585
36054
  capScope: "system",
@@ -36735,6 +37204,10 @@ Object.freeze({
36735
37204
  name: "deviceId",
36736
37205
  form: "single",
36737
37206
  optional: true
37207
+ }, {
37208
+ name: "deviceIds",
37209
+ form: "array",
37210
+ optional: true
36738
37211
  }],
36739
37212
  "fanControl.setDirection": [{
36740
37213
  name: "deviceId",
@@ -37540,6 +38013,11 @@ Object.freeze({
37540
38013
  form: "single",
37541
38014
  optional: false
37542
38015
  }],
38016
+ "recording.readWindowBytes": [{
38017
+ name: "deviceId",
38018
+ form: "single",
38019
+ optional: false
38020
+ }],
37543
38021
  "recording.relocateFootage": [{
37544
38022
  name: "deviceId",
37545
38023
  form: "single",
@@ -38340,7 +38818,38 @@ object({
38340
38818
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38341
38819
  * reproduce that.
38342
38820
  */
38343
- tileBudgetMb: number().int().min(0).max(1024)
38821
+ tileBudgetMb: number().int().min(0).max(1024),
38822
+ /**
38823
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38824
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38825
+ * subject tiles, on frames that detected something.
38826
+ *
38827
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38828
+ * containment is strict by design, so the native `keyFrame`, the detail
38829
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38830
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38831
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38832
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38833
+ *
38834
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38835
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38836
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38837
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38838
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38839
+ * binds only through a detection burst, where it still covers well past the
38840
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38841
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38842
+ * whole shape exists to avoid.
38843
+ *
38844
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38845
+ * subject tile, so one shared budget would let a busy camera's key frames
38846
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38847
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38848
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38849
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38850
+ * nothing.
38851
+ */
38852
+ sceneBudgetMb: number().int().min(0).max(1024)
38344
38853
  });
38345
38854
  /**
38346
38855
  * The values in force when the operator has set nothing.
@@ -38356,12 +38865,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38356
38865
  budgetMb: 1024,
38357
38866
  activityMs: 15e3,
38358
38867
  tileBudgetMb: 64,
38868
+ sceneBudgetMb: 48,
38359
38869
  admission: "inferred"
38360
38870
  };
38361
38871
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38362
38872
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38363
38873
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38364
38874
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38875
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38365
38876
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38366
38877
  var MB = 1024 * 1024;
38367
38878
  1024 * MB, 3072 * MB;