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