@camstack/addon-provider-petkit 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
@@ -8628,6 +8628,66 @@ var OpsLogQueryInputSchema = object({
8628
8628
  /** Max rows returned, newest-first. */
8629
8629
  limit: number().int().min(1).max(1e3).optional()
8630
8630
  });
8631
+ var LabelDefinitionSchema = object({
8632
+ id: string(),
8633
+ name: string(),
8634
+ category: string().optional(),
8635
+ description: string().optional(),
8636
+ icon: string().optional()
8637
+ });
8638
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
8639
+ var CLASS_MAP_MACRO_TARGETS = [
8640
+ "person",
8641
+ "vehicle",
8642
+ "animal",
8643
+ "package"
8644
+ ];
8645
+ /**
8646
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
8647
+ * un operatore può selezionare.
8648
+ *
8649
+ * Sono le tre offerte dallo step `object-detection`
8650
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
8651
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
8652
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
8653
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
8654
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
8655
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
8656
+ *
8657
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
8658
+ * dello step e una seconda volta come union `FirstLevelMacro`
8659
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
8660
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
8661
+ * successiva.
8662
+ */
8663
+ var FIRST_LEVEL_MACRO_CLASSES = [
8664
+ "person",
8665
+ "vehicle",
8666
+ "animal"
8667
+ ];
8668
+ /**
8669
+ * Wire schema for a per-model CATALOG classMap override
8670
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8671
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8672
+ * detection pipeline executor actually routes.
8673
+ *
8674
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8675
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8676
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8677
+ * enum) — the two used to share the name `ClassMapDefinition`/
8678
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8679
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8680
+ * are not: it is two different concepts colliding on a name. Keep this type
8681
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
8682
+ * would either narrow every `ClassMapDefinition` consumer to the four
8683
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8684
+ * schema exists for (see the "rejects a classMap whose target is not a
8685
+ * detection macro" test in `model-catalog-schema.test.ts`).
8686
+ */
8687
+ var DetectionCatalogClassMapSchema = object({
8688
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
8689
+ preserveOriginal: boolean()
8690
+ });
8631
8691
  /**
8632
8692
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
8633
8693
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -8650,10 +8710,55 @@ var RecordingStorageModeSchema = _enum([
8650
8710
  "events",
8651
8711
  "continuous"
8652
8712
  ]);
8713
+ /**
8714
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
8715
+ * tre offerte dallo step `object-detection`, da UNA lista
8716
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
8717
+ */
8718
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
8719
+ /**
8720
+ * True quando `values` non ripete un elemento.
8721
+ *
8722
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
8723
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
8724
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
8725
+ */
8726
+ var noDuplicates = (values) => new Set(values).size === values.length;
8653
8727
  /** Which detectors trigger an `events`-mode band. */
8654
8728
  var RecordingTriggersSchema = object({
8655
8729
  motion: boolean().optional(),
8656
- audioThresholdDbfs: number().optional()
8730
+ audioThresholdDbfs: number().optional(),
8731
+ /**
8732
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
8733
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
8734
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
8735
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
8736
+ *
8737
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
8738
+ * quelle che hanno attraversato `enabledMacroClasses`, i
8739
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
8740
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
8741
+ * finestre — vedi `recorder/object-trigger.ts`.
8742
+ */
8743
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
8744
+ /**
8745
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
8746
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
8747
+ * `objectClasses`.
8748
+ *
8749
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
8750
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
8751
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
8752
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
8753
+ * device (D12) — mai un elenco globale di cap.
8754
+ *
8755
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
8756
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
8757
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
8758
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
8759
+ * registrare.
8760
+ */
8761
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8657
8762
  });
8658
8763
  /**
8659
8764
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -9105,41 +9210,6 @@ var DecoderSessionConfigSchema = object({
9105
9210
  */
9106
9211
  debug: boolean().optional()
9107
9212
  });
9108
- var LabelDefinitionSchema = object({
9109
- id: string(),
9110
- name: string(),
9111
- category: string().optional(),
9112
- description: string().optional(),
9113
- icon: string().optional()
9114
- });
9115
- /**
9116
- * Wire schema for a per-model CATALOG classMap override
9117
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
9118
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
9119
- * detection pipeline executor actually routes.
9120
- *
9121
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
9122
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
9123
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
9124
- * enum) — the two used to share the name `ClassMapDefinition`/
9125
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
9126
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
9127
- * are not: it is two different concepts colliding on a name. Keep this type
9128
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
9129
- * would either narrow every `ClassMapDefinition` consumer to the four
9130
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
9131
- * schema exists for (see the "rejects a classMap whose target is not a
9132
- * detection macro" test in `model-catalog-schema.test.ts`).
9133
- */
9134
- var DetectionCatalogClassMapSchema = object({
9135
- mapping: record(string(), _enum([
9136
- "person",
9137
- "vehicle",
9138
- "animal",
9139
- "package"
9140
- ])),
9141
- preserveOriginal: boolean()
9142
- });
9143
9213
  var MODEL_FORMATS = [
9144
9214
  "onnx",
9145
9215
  "coreml",
@@ -16901,7 +16971,23 @@ var NcHistoryEntrySchema = object({
16901
16971
  updatedAt: number(),
16902
16972
  /** Failure detail — present on a `dead` row. */
16903
16973
  error: string().optional(),
16904
- subject: NcHistorySubjectSchema
16974
+ subject: NcHistorySubjectSchema,
16975
+ /**
16976
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
16977
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
16978
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
16979
+ * every delivery attempt). Absent on a row still pending/dead, a row
16980
+ * delivered before this field shipped, or a wiring with no artefact index.
16981
+ *
16982
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
16983
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
16984
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
16985
+ * also answers `null` for an id whose artefact has since expired past the
16986
+ * retained shelf's own age bound — the degrade a caller (the Home
16987
+ * Assistant export) must render as "no image right now", never as a
16988
+ * broken link.
16989
+ */
16990
+ artifactIds: array(string().min(1)).optional()
16905
16991
  });
16906
16992
  /**
16907
16993
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -17128,7 +17214,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
17128
17214
  }), method(object({}), object({
17129
17215
  catalog: array(NcConditionDescriptorSchema),
17130
17216
  taxonomy: NcTaxonomySchema.optional()
17131
- })), 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 }), {
17217
+ })), 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 }), {
17132
17218
  kind: "mutation",
17133
17219
  caller: "required"
17134
17220
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -22256,7 +22342,7 @@ var lifecycleJobSchema = object({
22256
22342
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
22257
22343
  * as every other cap.
22258
22344
  */
22259
- var LogLevelSchema$1 = _enum([
22345
+ var LogLevelSchema$2 = _enum([
22260
22346
  "debug",
22261
22347
  "info",
22262
22348
  "warn",
@@ -22463,7 +22549,7 @@ var CustomActionInputSchema = object({
22463
22549
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
22464
22550
  addonId: string(),
22465
22551
  limit: number().min(1).max(500).default(100),
22466
- level: LogLevelSchema$1.optional()
22552
+ level: LogLevelSchema$2.optional()
22467
22553
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
22468
22554
  packageName: string(),
22469
22555
  version: string().optional()
@@ -22561,7 +22647,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
22561
22647
  auth: "admin"
22562
22648
  }), method(object({
22563
22649
  addonId: string(),
22564
- level: LogLevelSchema$1.optional()
22650
+ level: LogLevelSchema$2.optional()
22565
22651
  }), LogStreamEntrySchema, { kind: "subscription" });
22566
22652
  /**
22567
22653
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -24293,6 +24379,35 @@ var FaceFilterEnum = _enum([
24293
24379
  "identified",
24294
24380
  "all"
24295
24381
  ]);
24382
+ /**
24383
+ * What a `listRecentFaces` page is ORDERED BY.
24384
+ *
24385
+ * - `timestamp` — when the face was seen. The historical (and default) order.
24386
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
24387
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
24388
+ * order: it puts the suggestions an operator can confirm with one tap at the
24389
+ * top, and it is the reason this enum exists — a client that ranked a capped
24390
+ * page client-side was ranking the newest N, never the most certain N.
24391
+ *
24392
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
24393
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
24394
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
24395
+ * — flipping the direction reorders the rows that HAVE a certainty and never
24396
+ * floods the page with the ones that do not. `addon-post-analysis`'s
24397
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
24398
+ * then by faceId, and is what makes this a total order instead of the
24399
+ * backend's NULL-collation accident.
24400
+ */
24401
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
24402
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
24403
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
24404
+ * never leaves the server. */
24405
+ var FaceClusterSchema = object({
24406
+ faceIds: array(string()).readonly(),
24407
+ representativeFaceId: string(),
24408
+ size: number().int(),
24409
+ cohesion: number()
24410
+ });
24296
24411
  var MediaFileLiteSchema$1 = object({
24297
24412
  key: string(),
24298
24413
  kind: string(),
@@ -24339,24 +24454,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24339
24454
  kind: "mutation",
24340
24455
  auth: "admin"
24341
24456
  }), method(object({
24342
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
24457
+ /**
24458
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
24459
+ *
24460
+ * The legacy single-camera form, kept verbatim for every caller that
24461
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
24462
+ * instead — never both: `deviceIds` is the authority whenever it is
24463
+ * present, and this field is then ignored rather than unioned, so
24464
+ * there is exactly one answer to "which cameras did I ask for".
24465
+ */
24343
24466
  deviceId: number().int().optional(),
24467
+ /**
24468
+ * Restrict to a SET of cameras — the review UI's camera filter, which
24469
+ * until now had to fetch the cluster-wide page and drop rows in the
24470
+ * client (so the `limit` it asked for was spent on cameras it was
24471
+ * about to discard).
24472
+ *
24473
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
24474
+ * "every camera". A request for no devices is a request, not an
24475
+ * omission; same contract as `deviceManager.listFleet` and
24476
+ * `pipelineAnalytics.listRecentTracks`.
24477
+ *
24478
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
24479
+ */
24480
+ deviceIds: array(number().int()).optional(),
24344
24481
  limit: number().int().positive().optional(),
24345
24482
  filter: FaceFilterEnum.optional(),
24346
24483
  /**
24347
- * Inline the base64 crop on every row. Default `true` — the existing
24348
- * behaviour, kept so no caller breaks.
24484
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24485
+ * Absent means no lower bound.
24486
+ */
24487
+ since: number().int().optional(),
24488
+ /**
24489
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24490
+ * Absent means no upper bound.
24491
+ */
24492
+ until: number().int().optional(),
24493
+ /**
24494
+ * Order the page by time or by suggestion certainty. Default
24495
+ * `'timestamp'` — the historical order, unchanged for every caller
24496
+ * that does not ask.
24349
24497
  *
24350
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
24351
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
24352
- * the browser cache the images.
24498
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
24499
+ * does under `'suggestionConfidence'`.
24353
24500
  *
24354
- * **This is an INPUT field, so it does not reach the addon until the
24355
- * next train.** The hub router validates cap inputs against its own
24356
- * compiled Zod, which strips a key it does not know verified today
24357
- * on the OUTPUT side, where an additive field DOES arrive immediately
24358
- * (`Track.hasFace`). Until the train ships, sending `false` is
24359
- * harmless and simply keeps the crops inline.
24501
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
24502
+ * index and stops reading as soon as `limit` rows have PASSED the
24503
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
24504
+ * certain row may be the oldest so it walks the window. Narrow it
24505
+ * with {@link since} / {@link until}.
24506
+ */
24507
+ sortBy: FaceSortFieldEnum.optional(),
24508
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
24509
+ sortDirection: FaceSortDirectionEnum.optional(),
24510
+ /**
24511
+ * Inline the base64 crop on every row.
24512
+ *
24513
+ * Default `false` since the 2026-08-25 inversion — see
24514
+ * `include-crops-default.ts`, which is the ONE place that resolves
24515
+ * this for every gallery, and which records why the inline shape had
24516
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
24517
+ * The doc here used to still say `true`; it was wrong, and a leftover
24518
+ * that describes the old design reads as permission to rely on it.
24519
+ *
24520
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
24521
+ * which the browser fetches off the `event-media` plane in parallel,
24522
+ * cached and ETagged.
24360
24523
  */
24361
24524
  includeCrops: boolean().optional()
24362
24525
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -24392,13 +24555,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24392
24555
  }), method(object({
24393
24556
  threshold: number().min(0).max(1).optional(),
24394
24557
  minClusterSize: number().int().min(2).optional(),
24395
- limit: number().int().positive().optional()
24396
- }).optional(), array(object({
24397
- faceIds: array(string()).readonly(),
24398
- representativeFaceId: string(),
24399
- size: number().int(),
24400
- cohesion: number()
24401
- })).readonly());
24558
+ /**
24559
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
24560
+ * which read as though it bounded the work — it never did.
24561
+ *
24562
+ * Wins over {@link limit} when both are sent.
24563
+ */
24564
+ maxClusters: number().int().positive().optional(),
24565
+ /**
24566
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
24567
+ * RESULT, not the scan. Kept so existing callers keep working; send
24568
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
24569
+ */
24570
+ limit: number().int().positive().optional(),
24571
+ /**
24572
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
24573
+ * POOL, not the result.
24574
+ *
24575
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
24576
+ * used to read every unassigned face on the hub no matter what the
24577
+ * caller asked for, because the only bound cut the finished clusters
24578
+ * afterwards; a UI showing a window of 100 paid for a scan of the
24579
+ * whole corpus, on an addon whose disk is under contention.
24580
+ *
24581
+ * The pool is the NEWEST matching faces first — the same order the
24582
+ * gallery shows — so a bound here shortens the horizon, it does not
24583
+ * sample it randomly.
24584
+ *
24585
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
24586
+ * so the live corpus — 372 face rows — is unaffected while the
24587
+ * unbounded scan can never come back as the table grows.
24588
+ */
24589
+ maxFacesScanned: number().int().positive().optional()
24590
+ }).optional(), array(FaceClusterSchema).readonly());
24402
24591
  /**
24403
24592
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
24404
24593
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28156,6 +28345,39 @@ var ReadGopBytesResultSchema = object({
28156
28345
  /** Media ms the returned fragment covers. */
28157
28346
  gopDurMs: number()
28158
28347
  });
28348
+ /**
28349
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
28350
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
28351
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
28352
+ * a replay needs several seconds of native pixels, not one frame.
28353
+ *
28354
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
28355
+ * is `false` when the returned bytes were cut short by the read's own safety
28356
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
28357
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
28358
+ * degradation: a window whose end falls past the covering segment would need
28359
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
28360
+ * not one standalone-demuxable stream — the caller's answer is to request a
28361
+ * shorter window or one aligned to a single segment, not to receive spliced
28362
+ * bytes nothing has proven decodable.
28363
+ */
28364
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
28365
+ kind: literal("ok"),
28366
+ data: _instanceof(Uint8Array),
28367
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
28368
+ * the requested `fromMs` (anchored on the nearest keyframe). */
28369
+ gopStartMs: number(),
28370
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
28371
+ gopDurMs: number(),
28372
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
28373
+ * the requested `toMs`; the caller got fewer frames than asked for. */
28374
+ reachesRequestedEnd: boolean()
28375
+ }), object({
28376
+ kind: literal("spans-multiple-segments"),
28377
+ /** Where the covering segment's own footage runs out — informational,
28378
+ * not a retry hint (retrying the same window would refuse again). */
28379
+ segmentEndMs: number()
28380
+ })]);
28159
28381
  method(object({
28160
28382
  deviceId: number(),
28161
28383
  fromMs: number(),
@@ -28206,6 +28428,15 @@ method(object({
28206
28428
  }), ReadGopBytesResultSchema, {
28207
28429
  kind: "query",
28208
28430
  auth: "admin"
28431
+ }), method(object({
28432
+ deviceId: number(),
28433
+ profile: string(),
28434
+ startMs: number(),
28435
+ fromMs: number(),
28436
+ toMs: number()
28437
+ }), ReadWindowBytesResultSchema, {
28438
+ kind: "query",
28439
+ auth: "admin"
28209
28440
  }), method(object({
28210
28441
  deviceId: number(),
28211
28442
  config: RecordingConfigSchema
@@ -29298,6 +29529,211 @@ var SetSiteLocationInputSchema = object({
29298
29529
  latitude: number().min(-90).max(90),
29299
29530
  longitude: number().min(-180).max(180)
29300
29531
  }).nullable();
29532
+ /**
29533
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
29534
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29535
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29536
+ * already prints - never a token, never an `Authorization` header.
29537
+ */
29538
+ var RequestCensusGroupSchema = object({
29539
+ procedure: string(),
29540
+ userAgent: string(),
29541
+ ip: string(),
29542
+ principal: string(),
29543
+ calls: number(),
29544
+ perMin: number()
29545
+ });
29546
+ /**
29547
+ * A procedure's TOTAL over the window, across every caller.
29548
+ *
29549
+ * This block, not the group list, is what answers "did these calls arrive over
29550
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29551
+ * same window excludes the HTTP plane, which is a result, not a failure.
29552
+ */
29553
+ var RequestCensusProcedureSchema = object({
29554
+ procedure: string(),
29555
+ calls: number(),
29556
+ perMin: number()
29557
+ });
29558
+ /**
29559
+ * The census as an operator sees it.
29560
+ *
29561
+ * `persisted` is the honest answer to "will this survive the restart I am
29562
+ * about to do": the arm deadline is written to `system-settings` so a window
29563
+ * armed now can measure the NEXT boot, and a write that failed must not look
29564
+ * like one that succeeded.
29565
+ */
29566
+ var RequestCensusStatusSchema = object({
29567
+ armed: boolean(),
29568
+ /** How long the current - or just-closed - window collected, in ms. */
29569
+ elapsedMs: number(),
29570
+ /** The window actually armed, after the server clamped the request. */
29571
+ windowMs: number(),
29572
+ /** Epoch ms the window closes at. 0 when disarmed. */
29573
+ armedUntilMs: number(),
29574
+ httpRequests: number(),
29575
+ batchedRequests: number(),
29576
+ /**
29577
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29578
+ * is in play (`?batch=1` carries several procedures in one request); this is
29579
+ * the number comparable with a store-side call count.
29580
+ */
29581
+ procedureCalls: number(),
29582
+ /**
29583
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29584
+ * transport resolves one context per connection - but the number that says
29585
+ * whether a plane this census cannot see was busy while HTTP was quiet.
29586
+ */
29587
+ wsConnections: number(),
29588
+ distinctGroups: number(),
29589
+ /** Calls counted in the totals whose group attribution was shed at the
29590
+ * cardinality bound. */
29591
+ unattributedCalls: number(),
29592
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29593
+ groups: array(RequestCensusGroupSchema).readonly()
29594
+ }).extend({ persisted: boolean() });
29595
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29596
+ var LogLevelSchema$1 = _enum([
29597
+ "debug",
29598
+ "info",
29599
+ "warn",
29600
+ "error"
29601
+ ]);
29602
+ /**
29603
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29604
+ *
29605
+ * A diagnostic is anything whose cost is only worth paying while a question is
29606
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29607
+ */
29608
+ var DiagnosticIdSchema = _enum(["request-census"]);
29609
+ /**
29610
+ * The layers of the level hierarchy, general → specific. The most specific
29611
+ * layer that carries an explicit value wins.
29612
+ *
29613
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29614
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29615
+ * grow later would force every consumer of this document to change with it.
29616
+ * Nothing returns `component` today.
29617
+ */
29618
+ var LoggingScopeKindSchema = _enum([
29619
+ "cluster",
29620
+ "node",
29621
+ "component"
29622
+ ]);
29623
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29624
+ var LoggingLevelSourceSchema = _enum([
29625
+ "default",
29626
+ "cluster",
29627
+ "node",
29628
+ "component"
29629
+ ]);
29630
+ /**
29631
+ * One layer of the hierarchy as it actually STANDS.
29632
+ *
29633
+ * `level: null` is the whole reason this array is returned: it is the
29634
+ * difference between "this node is at `info` because I decided it" and
29635
+ * "...because it inherits". An operator who clears an override believing they
29636
+ * are clearing an inherited value has been handed the same defect as the two
29637
+ * contradicting knobs this document exists to remove, moved one floor up.
29638
+ */
29639
+ var LoggingLevelLayerSchema = object({
29640
+ scope: LoggingScopeKindSchema,
29641
+ /** The node this layer speaks for; `null` on the cluster layer. */
29642
+ nodeId: string().nullable(),
29643
+ /** Explicitly set here, or `null` when this layer inherits. */
29644
+ level: LogLevelSchema$1.nullable()
29645
+ });
29646
+ /** What a line is judged against, and WHICH layer decided it. */
29647
+ var LoggingEffectiveSchema = object({
29648
+ level: LogLevelSchema$1,
29649
+ levelSource: LoggingLevelSourceSchema
29650
+ });
29651
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29652
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29653
+ /**
29654
+ * An armed diagnostic, with its DEADLINE.
29655
+ *
29656
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29657
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29658
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29659
+ * `armed` is false — a window is never reported as slightly expired.
29660
+ */
29661
+ var DiagnosticWindowSchema = object({
29662
+ id: DiagnosticIdSchema,
29663
+ armed: boolean(),
29664
+ /** Epoch ms the window closes at. 0 when disarmed. */
29665
+ armedUntilMs: number(),
29666
+ /** Ms left before it expires on its own. 0 when disarmed. */
29667
+ remainingMs: number(),
29668
+ /** Whether the stored deadline is the one the live diagnostic is running —
29669
+ * i.e. whether this window would survive a restart. */
29670
+ persisted: boolean()
29671
+ });
29672
+ /**
29673
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29674
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29675
+ * is a second knob that disagrees with the first the day one of them moves.
29676
+ */
29677
+ var DiagnosticWindowPatchSchema = object({
29678
+ id: DiagnosticIdSchema,
29679
+ armMs: number().int().min(0),
29680
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29681
+ reportEveryMs: number().int().positive().optional()
29682
+ });
29683
+ /**
29684
+ * A PATCH, and patches MERGE.
29685
+ *
29686
+ * A field absent from the patch is left exactly as it was — arming a
29687
+ * diagnostic never resets a level, and setting a level never disarms a window.
29688
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29689
+ * `setAll` already merges, and rebuilding the object is how an absent field
29690
+ * turns into an erased one.
29691
+ */
29692
+ var LoggingSettingsPatchSchema = object({
29693
+ /**
29694
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29695
+ * addressed scope so it inherits again. A value sets it.
29696
+ */
29697
+ level: LogLevelSchema$1.nullable().optional(),
29698
+ /**
29699
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29700
+ * keeps running — a patch is never a full replacement.
29701
+ */
29702
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29703
+ });
29704
+ /**
29705
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29706
+ *
29707
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29708
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29709
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29710
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29711
+ * by an agent that holds no cluster document at all. The hub is the single
29712
+ * authority over the whole hierarchy and answers for every layer, so the
29713
+ * layer selector needs a name the transport does not already own.
29714
+ */
29715
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29716
+ var SetLoggingSettingsInputSchema = object({
29717
+ scopeNodeId: string().optional(),
29718
+ patch: LoggingSettingsPatchSchema
29719
+ });
29720
+ /**
29721
+ * The whole document, as read and as returned after every write.
29722
+ *
29723
+ * `persisted: false` means the settings store could not be read or written.
29724
+ * The in-memory mirror still governs behaviour and is unchanged by the
29725
+ * failure — a read that fails neither switches a level nor disarms a window
29726
+ * (D49) — but the operator is told that what they are looking at would not
29727
+ * survive a restart.
29728
+ */
29729
+ var LoggingSettingsStateSchema = object({
29730
+ /** The layer this document was read at. `null` = the cluster layer. */
29731
+ scopeNodeId: string().nullable(),
29732
+ effective: LoggingEffectiveSchema,
29733
+ explicit: LoggingExplicitSchema,
29734
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29735
+ persisted: boolean()
29736
+ });
29301
29737
  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(), {
29302
29738
  kind: "mutation",
29303
29739
  auth: "admin"
@@ -29310,6 +29746,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29310
29746
  }), method(_void(), SiteLocationStatusSchema, {
29311
29747
  kind: "mutation",
29312
29748
  auth: "admin"
29749
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29750
+ kind: "mutation",
29751
+ auth: "admin"
29313
29752
  });
29314
29753
  /**
29315
29754
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -34293,6 +34732,12 @@ Object.freeze({
34293
34732
  addonId: null,
34294
34733
  access: "view"
34295
34734
  },
34735
+ "notificationRules.resolveArtifactUrl": {
34736
+ capName: "notification-rules",
34737
+ capScope: "system",
34738
+ addonId: null,
34739
+ access: "view"
34740
+ },
34296
34741
  "notificationRules.setAlarmConfig": {
34297
34742
  capName: "notification-rules",
34298
34743
  capScope: "system",
@@ -35697,6 +36142,12 @@ Object.freeze({
35697
36142
  addonId: null,
35698
36143
  access: "view"
35699
36144
  },
36145
+ "recording.readWindowBytes": {
36146
+ capName: "recording",
36147
+ capScope: "system",
36148
+ addonId: null,
36149
+ access: "view"
36150
+ },
35700
36151
  "recording.refreshStorageLocationsForMigration": {
35701
36152
  capName: "recording",
35702
36153
  capScope: "system",
@@ -36537,6 +36988,18 @@ Object.freeze({
36537
36988
  addonId: null,
36538
36989
  access: "create"
36539
36990
  },
36991
+ "system.getLoggingSettings": {
36992
+ capName: "system",
36993
+ capScope: "system",
36994
+ addonId: null,
36995
+ access: "view"
36996
+ },
36997
+ "system.getRequestCensus": {
36998
+ capName: "system",
36999
+ capScope: "system",
37000
+ addonId: null,
37001
+ access: "view"
37002
+ },
36540
37003
  "system.getRetentionConfig": {
36541
37004
  capName: "system",
36542
37005
  capScope: "system",
@@ -36567,6 +37030,12 @@ Object.freeze({
36567
37030
  addonId: null,
36568
37031
  access: "view"
36569
37032
  },
37033
+ "system.setLoggingSettings": {
37034
+ capName: "system",
37035
+ capScope: "system",
37036
+ addonId: null,
37037
+ access: "create"
37038
+ },
36570
37039
  "system.setRetentionConfig": {
36571
37040
  capName: "system",
36572
37041
  capScope: "system",
@@ -37722,6 +38191,10 @@ Object.freeze({
37722
38191
  name: "deviceId",
37723
38192
  form: "single",
37724
38193
  optional: true
38194
+ }, {
38195
+ name: "deviceIds",
38196
+ form: "array",
38197
+ optional: true
37725
38198
  }],
37726
38199
  "fanControl.setDirection": [{
37727
38200
  name: "deviceId",
@@ -38527,6 +39000,11 @@ Object.freeze({
38527
39000
  form: "single",
38528
39001
  optional: false
38529
39002
  }],
39003
+ "recording.readWindowBytes": [{
39004
+ name: "deviceId",
39005
+ form: "single",
39006
+ optional: false
39007
+ }],
38530
39008
  "recording.relocateFootage": [{
38531
39009
  name: "deviceId",
38532
39010
  form: "single",
@@ -39327,7 +39805,38 @@ object({
39327
39805
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
39328
39806
  * reproduce that.
39329
39807
  */
39330
- tileBudgetMb: number().int().min(0).max(1024)
39808
+ tileBudgetMb: number().int().min(0).max(1024),
39809
+ /**
39810
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39811
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39812
+ * subject tiles, on frames that detected something.
39813
+ *
39814
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39815
+ * containment is strict by design, so the native `keyFrame`, the detail
39816
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39817
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39818
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39819
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39820
+ *
39821
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39822
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39823
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39824
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39825
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39826
+ * binds only through a detection burst, where it still covers well past the
39827
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39828
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39829
+ * whole shape exists to avoid.
39830
+ *
39831
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39832
+ * subject tile, so one shared budget would let a busy camera's key frames
39833
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39834
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39835
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39836
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39837
+ * nothing.
39838
+ */
39839
+ sceneBudgetMb: number().int().min(0).max(1024)
39331
39840
  });
39332
39841
  /**
39333
39842
  * The values in force when the operator has set nothing.
@@ -39343,12 +39852,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
39343
39852
  budgetMb: 1024,
39344
39853
  activityMs: 15e3,
39345
39854
  tileBudgetMb: 64,
39855
+ sceneBudgetMb: 48,
39346
39856
  admission: "inferred"
39347
39857
  };
39348
39858
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39349
39859
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39350
39860
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39351
39861
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39862
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39352
39863
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39353
39864
  var MB = 1024 * 1024;
39354
39865
  1024 * MB, 3072 * MB;