@camstack/addon-export-alexa 1.2.36 → 1.2.38

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.
@@ -7667,6 +7667,66 @@ var OpsLogQueryInputSchema = object({
7667
7667
  /** Max rows returned, newest-first. */
7668
7668
  limit: number().int().min(1).max(1e3).optional()
7669
7669
  });
7670
+ var LabelDefinitionSchema = object({
7671
+ id: string(),
7672
+ name: string(),
7673
+ category: string().optional(),
7674
+ description: string().optional(),
7675
+ icon: string().optional()
7676
+ });
7677
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7678
+ var CLASS_MAP_MACRO_TARGETS = [
7679
+ "person",
7680
+ "vehicle",
7681
+ "animal",
7682
+ "package"
7683
+ ];
7684
+ /**
7685
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7686
+ * un operatore può selezionare.
7687
+ *
7688
+ * Sono le tre offerte dallo step `object-detection`
7689
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7690
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7691
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7692
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7693
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7694
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7695
+ *
7696
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7697
+ * dello step e una seconda volta come union `FirstLevelMacro`
7698
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7699
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7700
+ * successiva.
7701
+ */
7702
+ var FIRST_LEVEL_MACRO_CLASSES = [
7703
+ "person",
7704
+ "vehicle",
7705
+ "animal"
7706
+ ];
7707
+ /**
7708
+ * Wire schema for a per-model CATALOG classMap override
7709
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7710
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7711
+ * detection pipeline executor actually routes.
7712
+ *
7713
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7714
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7715
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7716
+ * enum) — the two used to share the name `ClassMapDefinition`/
7717
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7718
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7719
+ * are not: it is two different concepts colliding on a name. Keep this type
7720
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7721
+ * would either narrow every `ClassMapDefinition` consumer to the four
7722
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7723
+ * schema exists for (see the "rejects a classMap whose target is not a
7724
+ * detection macro" test in `model-catalog-schema.test.ts`).
7725
+ */
7726
+ var DetectionCatalogClassMapSchema = object({
7727
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7728
+ preserveOriginal: boolean()
7729
+ });
7670
7730
  /**
7671
7731
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7672
7732
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7689,10 +7749,55 @@ var RecordingStorageModeSchema = _enum([
7689
7749
  "events",
7690
7750
  "continuous"
7691
7751
  ]);
7752
+ /**
7753
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7754
+ * tre offerte dallo step `object-detection`, da UNA lista
7755
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7756
+ */
7757
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7758
+ /**
7759
+ * True quando `values` non ripete un elemento.
7760
+ *
7761
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7762
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7763
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7764
+ */
7765
+ var noDuplicates = (values) => new Set(values).size === values.length;
7692
7766
  /** Which detectors trigger an `events`-mode band. */
7693
7767
  var RecordingTriggersSchema = object({
7694
7768
  motion: boolean().optional(),
7695
- audioThresholdDbfs: number().optional()
7769
+ audioThresholdDbfs: number().optional(),
7770
+ /**
7771
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7772
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7773
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7774
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7775
+ *
7776
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7777
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7778
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7779
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7780
+ * finestre — vedi `recorder/object-trigger.ts`.
7781
+ */
7782
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7783
+ /**
7784
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7785
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7786
+ * `objectClasses`.
7787
+ *
7788
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7789
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7790
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7791
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7792
+ * device (D12) — mai un elenco globale di cap.
7793
+ *
7794
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7795
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7796
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7797
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7798
+ * registrare.
7799
+ */
7800
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7696
7801
  });
7697
7802
  /**
7698
7803
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8198,41 +8303,6 @@ function pickClosestResolution(entries, target) {
8198
8303
  }
8199
8304
  return bestAbove?.entry ?? bestBelow?.entry;
8200
8305
  }
8201
- var LabelDefinitionSchema = object({
8202
- id: string(),
8203
- name: string(),
8204
- category: string().optional(),
8205
- description: string().optional(),
8206
- icon: string().optional()
8207
- });
8208
- /**
8209
- * Wire schema for a per-model CATALOG classMap override
8210
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8211
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8212
- * detection pipeline executor actually routes.
8213
- *
8214
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8215
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8216
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8217
- * enum) — the two used to share the name `ClassMapDefinition`/
8218
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8219
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8220
- * are not: it is two different concepts colliding on a name. Keep this type
8221
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8222
- * would either narrow every `ClassMapDefinition` consumer to the four
8223
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8224
- * schema exists for (see the "rejects a classMap whose target is not a
8225
- * detection macro" test in `model-catalog-schema.test.ts`).
8226
- */
8227
- var DetectionCatalogClassMapSchema = object({
8228
- mapping: record(string(), _enum([
8229
- "person",
8230
- "vehicle",
8231
- "animal",
8232
- "package"
8233
- ])),
8234
- preserveOriginal: boolean()
8235
- });
8236
8306
  var MODEL_FORMATS = [
8237
8307
  "onnx",
8238
8308
  "coreml",
@@ -15748,7 +15818,23 @@ var NcHistoryEntrySchema = object({
15748
15818
  updatedAt: number(),
15749
15819
  /** Failure detail — present on a `dead` row. */
15750
15820
  error: string().optional(),
15751
- subject: NcHistorySubjectSchema
15821
+ subject: NcHistorySubjectSchema,
15822
+ /**
15823
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15824
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15825
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15826
+ * every delivery attempt). Absent on a row still pending/dead, a row
15827
+ * delivered before this field shipped, or a wiring with no artefact index.
15828
+ *
15829
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15830
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15831
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15832
+ * also answers `null` for an id whose artefact has since expired past the
15833
+ * retained shelf's own age bound — the degrade a caller (the Home
15834
+ * Assistant export) must render as "no image right now", never as a
15835
+ * broken link.
15836
+ */
15837
+ artifactIds: array(string().min(1)).optional()
15752
15838
  });
15753
15839
  /**
15754
15840
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -15975,7 +16061,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
15975
16061
  }), method(object({}), object({
15976
16062
  catalog: array(NcConditionDescriptorSchema),
15977
16063
  taxonomy: NcTaxonomySchema.optional()
15978
- })), 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 }), {
16064
+ })), 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 }), {
15979
16065
  kind: "mutation",
15980
16066
  caller: "required"
15981
16067
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21079,7 +21165,7 @@ var lifecycleJobSchema = object({
21079
21165
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21080
21166
  * as every other cap.
21081
21167
  */
21082
- var LogLevelSchema$1 = _enum([
21168
+ var LogLevelSchema$2 = _enum([
21083
21169
  "debug",
21084
21170
  "info",
21085
21171
  "warn",
@@ -21286,7 +21372,7 @@ var CustomActionInputSchema = object({
21286
21372
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21287
21373
  addonId: string(),
21288
21374
  limit: number().min(1).max(500).default(100),
21289
- level: LogLevelSchema$1.optional()
21375
+ level: LogLevelSchema$2.optional()
21290
21376
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21291
21377
  packageName: string(),
21292
21378
  version: string().optional()
@@ -21384,7 +21470,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21384
21470
  auth: "admin"
21385
21471
  }), method(object({
21386
21472
  addonId: string(),
21387
- level: LogLevelSchema$1.optional()
21473
+ level: LogLevelSchema$2.optional()
21388
21474
  }), LogStreamEntrySchema, { kind: "subscription" });
21389
21475
  object({
21390
21476
  /** Carbon dioxide concentration in ppm. */
@@ -22378,6 +22464,35 @@ var FaceFilterEnum = _enum([
22378
22464
  "identified",
22379
22465
  "all"
22380
22466
  ]);
22467
+ /**
22468
+ * What a `listRecentFaces` page is ORDERED BY.
22469
+ *
22470
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22471
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22472
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22473
+ * order: it puts the suggestions an operator can confirm with one tap at the
22474
+ * top, and it is the reason this enum exists — a client that ranked a capped
22475
+ * page client-side was ranking the newest N, never the most certain N.
22476
+ *
22477
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22478
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22479
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22480
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22481
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22482
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22483
+ * then by faceId, and is what makes this a total order instead of the
22484
+ * backend's NULL-collation accident.
22485
+ */
22486
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22487
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22488
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22489
+ * never leaves the server. */
22490
+ var FaceClusterSchema = object({
22491
+ faceIds: array(string()).readonly(),
22492
+ representativeFaceId: string(),
22493
+ size: number().int(),
22494
+ cohesion: number()
22495
+ });
22381
22496
  var MediaFileLiteSchema$1 = object({
22382
22497
  key: string(),
22383
22498
  kind: string(),
@@ -22424,24 +22539,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22424
22539
  kind: "mutation",
22425
22540
  auth: "admin"
22426
22541
  }), method(object({
22427
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22542
+ /**
22543
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22544
+ *
22545
+ * The legacy single-camera form, kept verbatim for every caller that
22546
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22547
+ * instead — never both: `deviceIds` is the authority whenever it is
22548
+ * present, and this field is then ignored rather than unioned, so
22549
+ * there is exactly one answer to "which cameras did I ask for".
22550
+ */
22428
22551
  deviceId: number().int().optional(),
22552
+ /**
22553
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22554
+ * until now had to fetch the cluster-wide page and drop rows in the
22555
+ * client (so the `limit` it asked for was spent on cameras it was
22556
+ * about to discard).
22557
+ *
22558
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22559
+ * "every camera". A request for no devices is a request, not an
22560
+ * omission; same contract as `deviceManager.listFleet` and
22561
+ * `pipelineAnalytics.listRecentTracks`.
22562
+ *
22563
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22564
+ */
22565
+ deviceIds: array(number().int()).optional(),
22429
22566
  limit: number().int().positive().optional(),
22430
22567
  filter: FaceFilterEnum.optional(),
22431
22568
  /**
22432
- * Inline the base64 crop on every row. Default `true` — the existing
22433
- * behaviour, kept so no caller breaks.
22569
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22570
+ * Absent means no lower bound.
22571
+ */
22572
+ since: number().int().optional(),
22573
+ /**
22574
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22575
+ * Absent means no upper bound.
22576
+ */
22577
+ until: number().int().optional(),
22578
+ /**
22579
+ * Order the page by time or by suggestion certainty. Default
22580
+ * `'timestamp'` — the historical order, unchanged for every caller
22581
+ * that does not ask.
22434
22582
  *
22435
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22436
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22437
- * the browser cache the images.
22583
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22584
+ * does under `'suggestionConfidence'`.
22438
22585
  *
22439
- * **This is an INPUT field, so it does not reach the addon until the
22440
- * next train.** The hub router validates cap inputs against its own
22441
- * compiled Zod, which strips a key it does not know — verified today
22442
- * on the OUTPUT side, where an additive field DOES arrive immediately
22443
- * (`Track.hasFace`). Until the train ships, sending `false` is
22444
- * harmless and simply keeps the crops inline.
22586
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22587
+ * index and stops reading as soon as `limit` rows have PASSED the
22588
+ * filter. `'suggestionConfidence'` cannot stop early — the most
22589
+ * certain row may be the oldest — so it walks the window. Narrow it
22590
+ * with {@link since} / {@link until}.
22591
+ */
22592
+ sortBy: FaceSortFieldEnum.optional(),
22593
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22594
+ sortDirection: FaceSortDirectionEnum.optional(),
22595
+ /**
22596
+ * Inline the base64 crop on every row.
22597
+ *
22598
+ * Default `false` since the 2026-08-25 inversion — see
22599
+ * `include-crops-default.ts`, which is the ONE place that resolves
22600
+ * this for every gallery, and which records why the inline shape had
22601
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22602
+ * The doc here used to still say `true`; it was wrong, and a leftover
22603
+ * that describes the old design reads as permission to rely on it.
22604
+ *
22605
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22606
+ * which the browser fetches off the `event-media` plane in parallel,
22607
+ * cached and ETagged.
22445
22608
  */
22446
22609
  includeCrops: boolean().optional()
22447
22610
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22477,13 +22640,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22477
22640
  }), method(object({
22478
22641
  threshold: number().min(0).max(1).optional(),
22479
22642
  minClusterSize: number().int().min(2).optional(),
22480
- limit: number().int().positive().optional()
22481
- }).optional(), array(object({
22482
- faceIds: array(string()).readonly(),
22483
- representativeFaceId: string(),
22484
- size: number().int(),
22485
- cohesion: number()
22486
- })).readonly());
22643
+ /**
22644
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22645
+ * which read as though it bounded the work — it never did.
22646
+ *
22647
+ * Wins over {@link limit} when both are sent.
22648
+ */
22649
+ maxClusters: number().int().positive().optional(),
22650
+ /**
22651
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22652
+ * RESULT, not the scan. Kept so existing callers keep working; send
22653
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22654
+ */
22655
+ limit: number().int().positive().optional(),
22656
+ /**
22657
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22658
+ * POOL, not the result.
22659
+ *
22660
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22661
+ * used to read every unassigned face on the hub no matter what the
22662
+ * caller asked for, because the only bound cut the finished clusters
22663
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22664
+ * whole corpus, on an addon whose disk is under contention.
22665
+ *
22666
+ * The pool is the NEWEST matching faces first — the same order the
22667
+ * gallery shows — so a bound here shortens the horizon, it does not
22668
+ * sample it randomly.
22669
+ *
22670
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22671
+ * so the live corpus — 372 face rows — is unaffected while the
22672
+ * unbounded scan can never come back as the table grows.
22673
+ */
22674
+ maxFacesScanned: number().int().positive().optional()
22675
+ }).optional(), array(FaceClusterSchema).readonly());
22487
22676
  /**
22488
22677
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22489
22678
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -25283,6 +25472,39 @@ var ReadGopBytesResultSchema = object({
25283
25472
  /** Media ms the returned fragment covers. */
25284
25473
  gopDurMs: number()
25285
25474
  });
25475
+ /**
25476
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
25477
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
25478
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
25479
+ * a replay needs several seconds of native pixels, not one frame.
25480
+ *
25481
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
25482
+ * is `false` when the returned bytes were cut short by the read's own safety
25483
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
25484
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
25485
+ * degradation: a window whose end falls past the covering segment would need
25486
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
25487
+ * not one standalone-demuxable stream — the caller's answer is to request a
25488
+ * shorter window or one aligned to a single segment, not to receive spliced
25489
+ * bytes nothing has proven decodable.
25490
+ */
25491
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
25492
+ kind: literal("ok"),
25493
+ data: _instanceof(Uint8Array),
25494
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
25495
+ * the requested `fromMs` (anchored on the nearest keyframe). */
25496
+ gopStartMs: number(),
25497
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
25498
+ gopDurMs: number(),
25499
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
25500
+ * the requested `toMs`; the caller got fewer frames than asked for. */
25501
+ reachesRequestedEnd: boolean()
25502
+ }), object({
25503
+ kind: literal("spans-multiple-segments"),
25504
+ /** Where the covering segment's own footage runs out — informational,
25505
+ * not a retry hint (retrying the same window would refuse again). */
25506
+ segmentEndMs: number()
25507
+ })]);
25286
25508
  method(object({
25287
25509
  deviceId: number(),
25288
25510
  fromMs: number(),
@@ -25333,6 +25555,15 @@ method(object({
25333
25555
  }), ReadGopBytesResultSchema, {
25334
25556
  kind: "query",
25335
25557
  auth: "admin"
25558
+ }), method(object({
25559
+ deviceId: number(),
25560
+ profile: string(),
25561
+ startMs: number(),
25562
+ fromMs: number(),
25563
+ toMs: number()
25564
+ }), ReadWindowBytesResultSchema, {
25565
+ kind: "query",
25566
+ auth: "admin"
25336
25567
  }), method(object({
25337
25568
  deviceId: number(),
25338
25569
  config: RecordingConfigSchema
@@ -26164,6 +26395,211 @@ var SetSiteLocationInputSchema = object({
26164
26395
  latitude: number().min(-90).max(90),
26165
26396
  longitude: number().min(-180).max(180)
26166
26397
  }).nullable();
26398
+ /**
26399
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26400
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26401
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26402
+ * already prints - never a token, never an `Authorization` header.
26403
+ */
26404
+ var RequestCensusGroupSchema = object({
26405
+ procedure: string(),
26406
+ userAgent: string(),
26407
+ ip: string(),
26408
+ principal: string(),
26409
+ calls: number(),
26410
+ perMin: number()
26411
+ });
26412
+ /**
26413
+ * A procedure's TOTAL over the window, across every caller.
26414
+ *
26415
+ * This block, not the group list, is what answers "did these calls arrive over
26416
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26417
+ * same window excludes the HTTP plane, which is a result, not a failure.
26418
+ */
26419
+ var RequestCensusProcedureSchema = object({
26420
+ procedure: string(),
26421
+ calls: number(),
26422
+ perMin: number()
26423
+ });
26424
+ /**
26425
+ * The census as an operator sees it.
26426
+ *
26427
+ * `persisted` is the honest answer to "will this survive the restart I am
26428
+ * about to do": the arm deadline is written to `system-settings` so a window
26429
+ * armed now can measure the NEXT boot, and a write that failed must not look
26430
+ * like one that succeeded.
26431
+ */
26432
+ var RequestCensusStatusSchema = object({
26433
+ armed: boolean(),
26434
+ /** How long the current - or just-closed - window collected, in ms. */
26435
+ elapsedMs: number(),
26436
+ /** The window actually armed, after the server clamped the request. */
26437
+ windowMs: number(),
26438
+ /** Epoch ms the window closes at. 0 when disarmed. */
26439
+ armedUntilMs: number(),
26440
+ httpRequests: number(),
26441
+ batchedRequests: number(),
26442
+ /**
26443
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26444
+ * is in play (`?batch=1` carries several procedures in one request); this is
26445
+ * the number comparable with a store-side call count.
26446
+ */
26447
+ procedureCalls: number(),
26448
+ /**
26449
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26450
+ * transport resolves one context per connection - but the number that says
26451
+ * whether a plane this census cannot see was busy while HTTP was quiet.
26452
+ */
26453
+ wsConnections: number(),
26454
+ distinctGroups: number(),
26455
+ /** Calls counted in the totals whose group attribution was shed at the
26456
+ * cardinality bound. */
26457
+ unattributedCalls: number(),
26458
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26459
+ groups: array(RequestCensusGroupSchema).readonly()
26460
+ }).extend({ persisted: boolean() });
26461
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26462
+ var LogLevelSchema$1 = _enum([
26463
+ "debug",
26464
+ "info",
26465
+ "warn",
26466
+ "error"
26467
+ ]);
26468
+ /**
26469
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26470
+ *
26471
+ * A diagnostic is anything whose cost is only worth paying while a question is
26472
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26473
+ */
26474
+ var DiagnosticIdSchema = _enum(["request-census"]);
26475
+ /**
26476
+ * The layers of the level hierarchy, general → specific. The most specific
26477
+ * layer that carries an explicit value wins.
26478
+ *
26479
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26480
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26481
+ * grow later would force every consumer of this document to change with it.
26482
+ * Nothing returns `component` today.
26483
+ */
26484
+ var LoggingScopeKindSchema = _enum([
26485
+ "cluster",
26486
+ "node",
26487
+ "component"
26488
+ ]);
26489
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26490
+ var LoggingLevelSourceSchema = _enum([
26491
+ "default",
26492
+ "cluster",
26493
+ "node",
26494
+ "component"
26495
+ ]);
26496
+ /**
26497
+ * One layer of the hierarchy as it actually STANDS.
26498
+ *
26499
+ * `level: null` is the whole reason this array is returned: it is the
26500
+ * difference between "this node is at `info` because I decided it" and
26501
+ * "...because it inherits". An operator who clears an override believing they
26502
+ * are clearing an inherited value has been handed the same defect as the two
26503
+ * contradicting knobs this document exists to remove, moved one floor up.
26504
+ */
26505
+ var LoggingLevelLayerSchema = object({
26506
+ scope: LoggingScopeKindSchema,
26507
+ /** The node this layer speaks for; `null` on the cluster layer. */
26508
+ nodeId: string().nullable(),
26509
+ /** Explicitly set here, or `null` when this layer inherits. */
26510
+ level: LogLevelSchema$1.nullable()
26511
+ });
26512
+ /** What a line is judged against, and WHICH layer decided it. */
26513
+ var LoggingEffectiveSchema = object({
26514
+ level: LogLevelSchema$1,
26515
+ levelSource: LoggingLevelSourceSchema
26516
+ });
26517
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26518
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26519
+ /**
26520
+ * An armed diagnostic, with its DEADLINE.
26521
+ *
26522
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26523
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26524
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26525
+ * `armed` is false — a window is never reported as slightly expired.
26526
+ */
26527
+ var DiagnosticWindowSchema = object({
26528
+ id: DiagnosticIdSchema,
26529
+ armed: boolean(),
26530
+ /** Epoch ms the window closes at. 0 when disarmed. */
26531
+ armedUntilMs: number(),
26532
+ /** Ms left before it expires on its own. 0 when disarmed. */
26533
+ remainingMs: number(),
26534
+ /** Whether the stored deadline is the one the live diagnostic is running —
26535
+ * i.e. whether this window would survive a restart. */
26536
+ persisted: boolean()
26537
+ });
26538
+ /**
26539
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26540
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26541
+ * is a second knob that disagrees with the first the day one of them moves.
26542
+ */
26543
+ var DiagnosticWindowPatchSchema = object({
26544
+ id: DiagnosticIdSchema,
26545
+ armMs: number().int().min(0),
26546
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26547
+ reportEveryMs: number().int().positive().optional()
26548
+ });
26549
+ /**
26550
+ * A PATCH, and patches MERGE.
26551
+ *
26552
+ * A field absent from the patch is left exactly as it was — arming a
26553
+ * diagnostic never resets a level, and setting a level never disarms a window.
26554
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26555
+ * `setAll` already merges, and rebuilding the object is how an absent field
26556
+ * turns into an erased one.
26557
+ */
26558
+ var LoggingSettingsPatchSchema = object({
26559
+ /**
26560
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26561
+ * addressed scope so it inherits again. A value sets it.
26562
+ */
26563
+ level: LogLevelSchema$1.nullable().optional(),
26564
+ /**
26565
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26566
+ * keeps running — a patch is never a full replacement.
26567
+ */
26568
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26569
+ });
26570
+ /**
26571
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26572
+ *
26573
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26574
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26575
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26576
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26577
+ * by an agent that holds no cluster document at all. The hub is the single
26578
+ * authority over the whole hierarchy and answers for every layer, so the
26579
+ * layer selector needs a name the transport does not already own.
26580
+ */
26581
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26582
+ var SetLoggingSettingsInputSchema = object({
26583
+ scopeNodeId: string().optional(),
26584
+ patch: LoggingSettingsPatchSchema
26585
+ });
26586
+ /**
26587
+ * The whole document, as read and as returned after every write.
26588
+ *
26589
+ * `persisted: false` means the settings store could not be read or written.
26590
+ * The in-memory mirror still governs behaviour and is unchanged by the
26591
+ * failure — a read that fails neither switches a level nor disarms a window
26592
+ * (D49) — but the operator is told that what they are looking at would not
26593
+ * survive a restart.
26594
+ */
26595
+ var LoggingSettingsStateSchema = object({
26596
+ /** The layer this document was read at. `null` = the cluster layer. */
26597
+ scopeNodeId: string().nullable(),
26598
+ effective: LoggingEffectiveSchema,
26599
+ explicit: LoggingExplicitSchema,
26600
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26601
+ persisted: boolean()
26602
+ });
26167
26603
  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(), {
26168
26604
  kind: "mutation",
26169
26605
  auth: "admin"
@@ -26176,6 +26612,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26176
26612
  }), method(_void(), SiteLocationStatusSchema, {
26177
26613
  kind: "mutation",
26178
26614
  auth: "admin"
26615
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26616
+ kind: "mutation",
26617
+ auth: "admin"
26179
26618
  });
26180
26619
  object({
26181
26620
  /** True when the device's tamper switch / case-open contact is
@@ -29751,6 +30190,12 @@ Object.freeze({
29751
30190
  addonId: null,
29752
30191
  access: "view"
29753
30192
  },
30193
+ "notificationRules.resolveArtifactUrl": {
30194
+ capName: "notification-rules",
30195
+ capScope: "system",
30196
+ addonId: null,
30197
+ access: "view"
30198
+ },
29754
30199
  "notificationRules.setAlarmConfig": {
29755
30200
  capName: "notification-rules",
29756
30201
  capScope: "system",
@@ -31155,6 +31600,12 @@ Object.freeze({
31155
31600
  addonId: null,
31156
31601
  access: "view"
31157
31602
  },
31603
+ "recording.readWindowBytes": {
31604
+ capName: "recording",
31605
+ capScope: "system",
31606
+ addonId: null,
31607
+ access: "view"
31608
+ },
31158
31609
  "recording.refreshStorageLocationsForMigration": {
31159
31610
  capName: "recording",
31160
31611
  capScope: "system",
@@ -31995,6 +32446,18 @@ Object.freeze({
31995
32446
  addonId: null,
31996
32447
  access: "create"
31997
32448
  },
32449
+ "system.getLoggingSettings": {
32450
+ capName: "system",
32451
+ capScope: "system",
32452
+ addonId: null,
32453
+ access: "view"
32454
+ },
32455
+ "system.getRequestCensus": {
32456
+ capName: "system",
32457
+ capScope: "system",
32458
+ addonId: null,
32459
+ access: "view"
32460
+ },
31998
32461
  "system.getRetentionConfig": {
31999
32462
  capName: "system",
32000
32463
  capScope: "system",
@@ -32025,6 +32488,12 @@ Object.freeze({
32025
32488
  addonId: null,
32026
32489
  access: "view"
32027
32490
  },
32491
+ "system.setLoggingSettings": {
32492
+ capName: "system",
32493
+ capScope: "system",
32494
+ addonId: null,
32495
+ access: "create"
32496
+ },
32028
32497
  "system.setRetentionConfig": {
32029
32498
  capName: "system",
32030
32499
  capScope: "system",
@@ -33180,6 +33649,10 @@ Object.freeze({
33180
33649
  name: "deviceId",
33181
33650
  form: "single",
33182
33651
  optional: true
33652
+ }, {
33653
+ name: "deviceIds",
33654
+ form: "array",
33655
+ optional: true
33183
33656
  }],
33184
33657
  "fanControl.setDirection": [{
33185
33658
  name: "deviceId",
@@ -33985,6 +34458,11 @@ Object.freeze({
33985
34458
  form: "single",
33986
34459
  optional: false
33987
34460
  }],
34461
+ "recording.readWindowBytes": [{
34462
+ name: "deviceId",
34463
+ form: "single",
34464
+ optional: false
34465
+ }],
33988
34466
  "recording.relocateFootage": [{
33989
34467
  name: "deviceId",
33990
34468
  form: "single",
@@ -34785,7 +35263,38 @@ object({
34785
35263
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34786
35264
  * reproduce that.
34787
35265
  */
34788
- tileBudgetMb: number().int().min(0).max(1024)
35266
+ tileBudgetMb: number().int().min(0).max(1024),
35267
+ /**
35268
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35269
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35270
+ * subject tiles, on frames that detected something.
35271
+ *
35272
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35273
+ * containment is strict by design, so the native `keyFrame`, the detail
35274
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35275
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35276
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35277
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35278
+ *
35279
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35280
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35281
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35282
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35283
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35284
+ * binds only through a detection burst, where it still covers well past the
35285
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35286
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35287
+ * whole shape exists to avoid.
35288
+ *
35289
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35290
+ * subject tile, so one shared budget would let a busy camera's key frames
35291
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35292
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35293
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35294
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35295
+ * nothing.
35296
+ */
35297
+ sceneBudgetMb: number().int().min(0).max(1024)
34789
35298
  });
34790
35299
  /**
34791
35300
  * The values in force when the operator has set nothing.
@@ -34801,12 +35310,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34801
35310
  budgetMb: 1024,
34802
35311
  activityMs: 15e3,
34803
35312
  tileBudgetMb: 64,
35313
+ sceneBudgetMb: 48,
34804
35314
  admission: "inferred"
34805
35315
  };
34806
35316
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34807
35317
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34808
35318
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34809
35319
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35320
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34810
35321
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34811
35322
  var MB = 1024 * 1024;
34812
35323
  1024 * MB, 3072 * MB;