@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.
@@ -7694,6 +7694,66 @@ var OpsLogQueryInputSchema = object({
7694
7694
  /** Max rows returned, newest-first. */
7695
7695
  limit: number().int().min(1).max(1e3).optional()
7696
7696
  });
7697
+ var LabelDefinitionSchema = object({
7698
+ id: string(),
7699
+ name: string(),
7700
+ category: string().optional(),
7701
+ description: string().optional(),
7702
+ icon: string().optional()
7703
+ });
7704
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7705
+ var CLASS_MAP_MACRO_TARGETS = [
7706
+ "person",
7707
+ "vehicle",
7708
+ "animal",
7709
+ "package"
7710
+ ];
7711
+ /**
7712
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7713
+ * un operatore può selezionare.
7714
+ *
7715
+ * Sono le tre offerte dallo step `object-detection`
7716
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7717
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7718
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7719
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7720
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7721
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7722
+ *
7723
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7724
+ * dello step e una seconda volta come union `FirstLevelMacro`
7725
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7726
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7727
+ * successiva.
7728
+ */
7729
+ var FIRST_LEVEL_MACRO_CLASSES = [
7730
+ "person",
7731
+ "vehicle",
7732
+ "animal"
7733
+ ];
7734
+ /**
7735
+ * Wire schema for a per-model CATALOG classMap override
7736
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7737
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7738
+ * detection pipeline executor actually routes.
7739
+ *
7740
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7741
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7742
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7743
+ * enum) — the two used to share the name `ClassMapDefinition`/
7744
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7745
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7746
+ * are not: it is two different concepts colliding on a name. Keep this type
7747
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7748
+ * would either narrow every `ClassMapDefinition` consumer to the four
7749
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7750
+ * schema exists for (see the "rejects a classMap whose target is not a
7751
+ * detection macro" test in `model-catalog-schema.test.ts`).
7752
+ */
7753
+ var DetectionCatalogClassMapSchema = object({
7754
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7755
+ preserveOriginal: boolean()
7756
+ });
7697
7757
  /**
7698
7758
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7699
7759
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7716,10 +7776,55 @@ var RecordingStorageModeSchema = _enum([
7716
7776
  "events",
7717
7777
  "continuous"
7718
7778
  ]);
7779
+ /**
7780
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7781
+ * tre offerte dallo step `object-detection`, da UNA lista
7782
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7783
+ */
7784
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7785
+ /**
7786
+ * True quando `values` non ripete un elemento.
7787
+ *
7788
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7789
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7790
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7791
+ */
7792
+ var noDuplicates = (values) => new Set(values).size === values.length;
7719
7793
  /** Which detectors trigger an `events`-mode band. */
7720
7794
  var RecordingTriggersSchema = object({
7721
7795
  motion: boolean().optional(),
7722
- audioThresholdDbfs: number().optional()
7796
+ audioThresholdDbfs: number().optional(),
7797
+ /**
7798
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7799
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7800
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7801
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7802
+ *
7803
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7804
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7805
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7806
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7807
+ * finestre — vedi `recorder/object-trigger.ts`.
7808
+ */
7809
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7810
+ /**
7811
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7812
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7813
+ * `objectClasses`.
7814
+ *
7815
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7816
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7817
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7818
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7819
+ * device (D12) — mai un elenco globale di cap.
7820
+ *
7821
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7822
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7823
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7824
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7825
+ * registrare.
7826
+ */
7827
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7723
7828
  });
7724
7829
  /**
7725
7830
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8225,41 +8330,6 @@ function pickClosestResolution(entries, target) {
8225
8330
  }
8226
8331
  return bestAbove?.entry ?? bestBelow?.entry;
8227
8332
  }
8228
- var LabelDefinitionSchema = object({
8229
- id: string(),
8230
- name: string(),
8231
- category: string().optional(),
8232
- description: string().optional(),
8233
- icon: string().optional()
8234
- });
8235
- /**
8236
- * Wire schema for a per-model CATALOG classMap override
8237
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8238
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8239
- * detection pipeline executor actually routes.
8240
- *
8241
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8242
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8243
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8244
- * enum) — the two used to share the name `ClassMapDefinition`/
8245
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8246
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8247
- * are not: it is two different concepts colliding on a name. Keep this type
8248
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8249
- * would either narrow every `ClassMapDefinition` consumer to the four
8250
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8251
- * schema exists for (see the "rejects a classMap whose target is not a
8252
- * detection macro" test in `model-catalog-schema.test.ts`).
8253
- */
8254
- var DetectionCatalogClassMapSchema = object({
8255
- mapping: record(string(), _enum([
8256
- "person",
8257
- "vehicle",
8258
- "animal",
8259
- "package"
8260
- ])),
8261
- preserveOriginal: boolean()
8262
- });
8263
8333
  var MODEL_FORMATS = [
8264
8334
  "onnx",
8265
8335
  "coreml",
@@ -15775,7 +15845,23 @@ var NcHistoryEntrySchema = object({
15775
15845
  updatedAt: number(),
15776
15846
  /** Failure detail — present on a `dead` row. */
15777
15847
  error: string().optional(),
15778
- subject: NcHistorySubjectSchema
15848
+ subject: NcHistorySubjectSchema,
15849
+ /**
15850
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15851
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15852
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15853
+ * every delivery attempt). Absent on a row still pending/dead, a row
15854
+ * delivered before this field shipped, or a wiring with no artefact index.
15855
+ *
15856
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15857
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15858
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15859
+ * also answers `null` for an id whose artefact has since expired past the
15860
+ * retained shelf's own age bound — the degrade a caller (the Home
15861
+ * Assistant export) must render as "no image right now", never as a
15862
+ * broken link.
15863
+ */
15864
+ artifactIds: array(string().min(1)).optional()
15779
15865
  });
15780
15866
  /**
15781
15867
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16002,7 +16088,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16002
16088
  }), method(object({}), object({
16003
16089
  catalog: array(NcConditionDescriptorSchema),
16004
16090
  taxonomy: NcTaxonomySchema.optional()
16005
- })), 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 }), {
16091
+ })), 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 }), {
16006
16092
  kind: "mutation",
16007
16093
  caller: "required"
16008
16094
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21106,7 +21192,7 @@ var lifecycleJobSchema = object({
21106
21192
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21107
21193
  * as every other cap.
21108
21194
  */
21109
- var LogLevelSchema$1 = _enum([
21195
+ var LogLevelSchema$2 = _enum([
21110
21196
  "debug",
21111
21197
  "info",
21112
21198
  "warn",
@@ -21313,7 +21399,7 @@ var CustomActionInputSchema = object({
21313
21399
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21314
21400
  addonId: string(),
21315
21401
  limit: number().min(1).max(500).default(100),
21316
- level: LogLevelSchema$1.optional()
21402
+ level: LogLevelSchema$2.optional()
21317
21403
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21318
21404
  packageName: string(),
21319
21405
  version: string().optional()
@@ -21411,7 +21497,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21411
21497
  auth: "admin"
21412
21498
  }), method(object({
21413
21499
  addonId: string(),
21414
- level: LogLevelSchema$1.optional()
21500
+ level: LogLevelSchema$2.optional()
21415
21501
  }), LogStreamEntrySchema, { kind: "subscription" });
21416
21502
  object({
21417
21503
  /** Carbon dioxide concentration in ppm. */
@@ -22405,6 +22491,35 @@ var FaceFilterEnum = _enum([
22405
22491
  "identified",
22406
22492
  "all"
22407
22493
  ]);
22494
+ /**
22495
+ * What a `listRecentFaces` page is ORDERED BY.
22496
+ *
22497
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22498
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22499
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22500
+ * order: it puts the suggestions an operator can confirm with one tap at the
22501
+ * top, and it is the reason this enum exists — a client that ranked a capped
22502
+ * page client-side was ranking the newest N, never the most certain N.
22503
+ *
22504
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22505
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22506
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22507
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22508
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22509
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22510
+ * then by faceId, and is what makes this a total order instead of the
22511
+ * backend's NULL-collation accident.
22512
+ */
22513
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22514
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22515
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22516
+ * never leaves the server. */
22517
+ var FaceClusterSchema = object({
22518
+ faceIds: array(string()).readonly(),
22519
+ representativeFaceId: string(),
22520
+ size: number().int(),
22521
+ cohesion: number()
22522
+ });
22408
22523
  var MediaFileLiteSchema$1 = object({
22409
22524
  key: string(),
22410
22525
  kind: string(),
@@ -22451,24 +22566,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22451
22566
  kind: "mutation",
22452
22567
  auth: "admin"
22453
22568
  }), method(object({
22454
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22569
+ /**
22570
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22571
+ *
22572
+ * The legacy single-camera form, kept verbatim for every caller that
22573
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22574
+ * instead — never both: `deviceIds` is the authority whenever it is
22575
+ * present, and this field is then ignored rather than unioned, so
22576
+ * there is exactly one answer to "which cameras did I ask for".
22577
+ */
22455
22578
  deviceId: number().int().optional(),
22579
+ /**
22580
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22581
+ * until now had to fetch the cluster-wide page and drop rows in the
22582
+ * client (so the `limit` it asked for was spent on cameras it was
22583
+ * about to discard).
22584
+ *
22585
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22586
+ * "every camera". A request for no devices is a request, not an
22587
+ * omission; same contract as `deviceManager.listFleet` and
22588
+ * `pipelineAnalytics.listRecentTracks`.
22589
+ *
22590
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22591
+ */
22592
+ deviceIds: array(number().int()).optional(),
22456
22593
  limit: number().int().positive().optional(),
22457
22594
  filter: FaceFilterEnum.optional(),
22458
22595
  /**
22459
- * Inline the base64 crop on every row. Default `true` — the existing
22460
- * behaviour, kept so no caller breaks.
22596
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22597
+ * Absent means no lower bound.
22598
+ */
22599
+ since: number().int().optional(),
22600
+ /**
22601
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22602
+ * Absent means no upper bound.
22603
+ */
22604
+ until: number().int().optional(),
22605
+ /**
22606
+ * Order the page by time or by suggestion certainty. Default
22607
+ * `'timestamp'` — the historical order, unchanged for every caller
22608
+ * that does not ask.
22461
22609
  *
22462
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22463
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22464
- * the browser cache the images.
22610
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22611
+ * does under `'suggestionConfidence'`.
22465
22612
  *
22466
- * **This is an INPUT field, so it does not reach the addon until the
22467
- * next train.** The hub router validates cap inputs against its own
22468
- * compiled Zod, which strips a key it does not know — verified today
22469
- * on the OUTPUT side, where an additive field DOES arrive immediately
22470
- * (`Track.hasFace`). Until the train ships, sending `false` is
22471
- * harmless and simply keeps the crops inline.
22613
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22614
+ * index and stops reading as soon as `limit` rows have PASSED the
22615
+ * filter. `'suggestionConfidence'` cannot stop early — the most
22616
+ * certain row may be the oldest — so it walks the window. Narrow it
22617
+ * with {@link since} / {@link until}.
22618
+ */
22619
+ sortBy: FaceSortFieldEnum.optional(),
22620
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22621
+ sortDirection: FaceSortDirectionEnum.optional(),
22622
+ /**
22623
+ * Inline the base64 crop on every row.
22624
+ *
22625
+ * Default `false` since the 2026-08-25 inversion — see
22626
+ * `include-crops-default.ts`, which is the ONE place that resolves
22627
+ * this for every gallery, and which records why the inline shape had
22628
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22629
+ * The doc here used to still say `true`; it was wrong, and a leftover
22630
+ * that describes the old design reads as permission to rely on it.
22631
+ *
22632
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22633
+ * which the browser fetches off the `event-media` plane in parallel,
22634
+ * cached and ETagged.
22472
22635
  */
22473
22636
  includeCrops: boolean().optional()
22474
22637
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22504,13 +22667,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22504
22667
  }), method(object({
22505
22668
  threshold: number().min(0).max(1).optional(),
22506
22669
  minClusterSize: number().int().min(2).optional(),
22507
- limit: number().int().positive().optional()
22508
- }).optional(), array(object({
22509
- faceIds: array(string()).readonly(),
22510
- representativeFaceId: string(),
22511
- size: number().int(),
22512
- cohesion: number()
22513
- })).readonly());
22670
+ /**
22671
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22672
+ * which read as though it bounded the work — it never did.
22673
+ *
22674
+ * Wins over {@link limit} when both are sent.
22675
+ */
22676
+ maxClusters: number().int().positive().optional(),
22677
+ /**
22678
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22679
+ * RESULT, not the scan. Kept so existing callers keep working; send
22680
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22681
+ */
22682
+ limit: number().int().positive().optional(),
22683
+ /**
22684
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22685
+ * POOL, not the result.
22686
+ *
22687
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22688
+ * used to read every unassigned face on the hub no matter what the
22689
+ * caller asked for, because the only bound cut the finished clusters
22690
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22691
+ * whole corpus, on an addon whose disk is under contention.
22692
+ *
22693
+ * The pool is the NEWEST matching faces first — the same order the
22694
+ * gallery shows — so a bound here shortens the horizon, it does not
22695
+ * sample it randomly.
22696
+ *
22697
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22698
+ * so the live corpus — 372 face rows — is unaffected while the
22699
+ * unbounded scan can never come back as the table grows.
22700
+ */
22701
+ maxFacesScanned: number().int().positive().optional()
22702
+ }).optional(), array(FaceClusterSchema).readonly());
22514
22703
  /**
22515
22704
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22516
22705
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -25310,6 +25499,39 @@ var ReadGopBytesResultSchema = object({
25310
25499
  /** Media ms the returned fragment covers. */
25311
25500
  gopDurMs: number()
25312
25501
  });
25502
+ /**
25503
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
25504
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
25505
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
25506
+ * a replay needs several seconds of native pixels, not one frame.
25507
+ *
25508
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
25509
+ * is `false` when the returned bytes were cut short by the read's own safety
25510
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
25511
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
25512
+ * degradation: a window whose end falls past the covering segment would need
25513
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
25514
+ * not one standalone-demuxable stream — the caller's answer is to request a
25515
+ * shorter window or one aligned to a single segment, not to receive spliced
25516
+ * bytes nothing has proven decodable.
25517
+ */
25518
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
25519
+ kind: literal("ok"),
25520
+ data: _instanceof(Uint8Array),
25521
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
25522
+ * the requested `fromMs` (anchored on the nearest keyframe). */
25523
+ gopStartMs: number(),
25524
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
25525
+ gopDurMs: number(),
25526
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
25527
+ * the requested `toMs`; the caller got fewer frames than asked for. */
25528
+ reachesRequestedEnd: boolean()
25529
+ }), object({
25530
+ kind: literal("spans-multiple-segments"),
25531
+ /** Where the covering segment's own footage runs out — informational,
25532
+ * not a retry hint (retrying the same window would refuse again). */
25533
+ segmentEndMs: number()
25534
+ })]);
25313
25535
  method(object({
25314
25536
  deviceId: number(),
25315
25537
  fromMs: number(),
@@ -25360,6 +25582,15 @@ method(object({
25360
25582
  }), ReadGopBytesResultSchema, {
25361
25583
  kind: "query",
25362
25584
  auth: "admin"
25585
+ }), method(object({
25586
+ deviceId: number(),
25587
+ profile: string(),
25588
+ startMs: number(),
25589
+ fromMs: number(),
25590
+ toMs: number()
25591
+ }), ReadWindowBytesResultSchema, {
25592
+ kind: "query",
25593
+ auth: "admin"
25363
25594
  }), method(object({
25364
25595
  deviceId: number(),
25365
25596
  config: RecordingConfigSchema
@@ -26191,6 +26422,211 @@ var SetSiteLocationInputSchema = object({
26191
26422
  latitude: number().min(-90).max(90),
26192
26423
  longitude: number().min(-180).max(180)
26193
26424
  }).nullable();
26425
+ /**
26426
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26427
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26428
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26429
+ * already prints - never a token, never an `Authorization` header.
26430
+ */
26431
+ var RequestCensusGroupSchema = object({
26432
+ procedure: string(),
26433
+ userAgent: string(),
26434
+ ip: string(),
26435
+ principal: string(),
26436
+ calls: number(),
26437
+ perMin: number()
26438
+ });
26439
+ /**
26440
+ * A procedure's TOTAL over the window, across every caller.
26441
+ *
26442
+ * This block, not the group list, is what answers "did these calls arrive over
26443
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26444
+ * same window excludes the HTTP plane, which is a result, not a failure.
26445
+ */
26446
+ var RequestCensusProcedureSchema = object({
26447
+ procedure: string(),
26448
+ calls: number(),
26449
+ perMin: number()
26450
+ });
26451
+ /**
26452
+ * The census as an operator sees it.
26453
+ *
26454
+ * `persisted` is the honest answer to "will this survive the restart I am
26455
+ * about to do": the arm deadline is written to `system-settings` so a window
26456
+ * armed now can measure the NEXT boot, and a write that failed must not look
26457
+ * like one that succeeded.
26458
+ */
26459
+ var RequestCensusStatusSchema = object({
26460
+ armed: boolean(),
26461
+ /** How long the current - or just-closed - window collected, in ms. */
26462
+ elapsedMs: number(),
26463
+ /** The window actually armed, after the server clamped the request. */
26464
+ windowMs: number(),
26465
+ /** Epoch ms the window closes at. 0 when disarmed. */
26466
+ armedUntilMs: number(),
26467
+ httpRequests: number(),
26468
+ batchedRequests: number(),
26469
+ /**
26470
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26471
+ * is in play (`?batch=1` carries several procedures in one request); this is
26472
+ * the number comparable with a store-side call count.
26473
+ */
26474
+ procedureCalls: number(),
26475
+ /**
26476
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26477
+ * transport resolves one context per connection - but the number that says
26478
+ * whether a plane this census cannot see was busy while HTTP was quiet.
26479
+ */
26480
+ wsConnections: number(),
26481
+ distinctGroups: number(),
26482
+ /** Calls counted in the totals whose group attribution was shed at the
26483
+ * cardinality bound. */
26484
+ unattributedCalls: number(),
26485
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26486
+ groups: array(RequestCensusGroupSchema).readonly()
26487
+ }).extend({ persisted: boolean() });
26488
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26489
+ var LogLevelSchema$1 = _enum([
26490
+ "debug",
26491
+ "info",
26492
+ "warn",
26493
+ "error"
26494
+ ]);
26495
+ /**
26496
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26497
+ *
26498
+ * A diagnostic is anything whose cost is only worth paying while a question is
26499
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26500
+ */
26501
+ var DiagnosticIdSchema = _enum(["request-census"]);
26502
+ /**
26503
+ * The layers of the level hierarchy, general → specific. The most specific
26504
+ * layer that carries an explicit value wins.
26505
+ *
26506
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26507
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26508
+ * grow later would force every consumer of this document to change with it.
26509
+ * Nothing returns `component` today.
26510
+ */
26511
+ var LoggingScopeKindSchema = _enum([
26512
+ "cluster",
26513
+ "node",
26514
+ "component"
26515
+ ]);
26516
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26517
+ var LoggingLevelSourceSchema = _enum([
26518
+ "default",
26519
+ "cluster",
26520
+ "node",
26521
+ "component"
26522
+ ]);
26523
+ /**
26524
+ * One layer of the hierarchy as it actually STANDS.
26525
+ *
26526
+ * `level: null` is the whole reason this array is returned: it is the
26527
+ * difference between "this node is at `info` because I decided it" and
26528
+ * "...because it inherits". An operator who clears an override believing they
26529
+ * are clearing an inherited value has been handed the same defect as the two
26530
+ * contradicting knobs this document exists to remove, moved one floor up.
26531
+ */
26532
+ var LoggingLevelLayerSchema = object({
26533
+ scope: LoggingScopeKindSchema,
26534
+ /** The node this layer speaks for; `null` on the cluster layer. */
26535
+ nodeId: string().nullable(),
26536
+ /** Explicitly set here, or `null` when this layer inherits. */
26537
+ level: LogLevelSchema$1.nullable()
26538
+ });
26539
+ /** What a line is judged against, and WHICH layer decided it. */
26540
+ var LoggingEffectiveSchema = object({
26541
+ level: LogLevelSchema$1,
26542
+ levelSource: LoggingLevelSourceSchema
26543
+ });
26544
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26545
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26546
+ /**
26547
+ * An armed diagnostic, with its DEADLINE.
26548
+ *
26549
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26550
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26551
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26552
+ * `armed` is false — a window is never reported as slightly expired.
26553
+ */
26554
+ var DiagnosticWindowSchema = object({
26555
+ id: DiagnosticIdSchema,
26556
+ armed: boolean(),
26557
+ /** Epoch ms the window closes at. 0 when disarmed. */
26558
+ armedUntilMs: number(),
26559
+ /** Ms left before it expires on its own. 0 when disarmed. */
26560
+ remainingMs: number(),
26561
+ /** Whether the stored deadline is the one the live diagnostic is running —
26562
+ * i.e. whether this window would survive a restart. */
26563
+ persisted: boolean()
26564
+ });
26565
+ /**
26566
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26567
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26568
+ * is a second knob that disagrees with the first the day one of them moves.
26569
+ */
26570
+ var DiagnosticWindowPatchSchema = object({
26571
+ id: DiagnosticIdSchema,
26572
+ armMs: number().int().min(0),
26573
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26574
+ reportEveryMs: number().int().positive().optional()
26575
+ });
26576
+ /**
26577
+ * A PATCH, and patches MERGE.
26578
+ *
26579
+ * A field absent from the patch is left exactly as it was — arming a
26580
+ * diagnostic never resets a level, and setting a level never disarms a window.
26581
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26582
+ * `setAll` already merges, and rebuilding the object is how an absent field
26583
+ * turns into an erased one.
26584
+ */
26585
+ var LoggingSettingsPatchSchema = object({
26586
+ /**
26587
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26588
+ * addressed scope so it inherits again. A value sets it.
26589
+ */
26590
+ level: LogLevelSchema$1.nullable().optional(),
26591
+ /**
26592
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26593
+ * keeps running — a patch is never a full replacement.
26594
+ */
26595
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26596
+ });
26597
+ /**
26598
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26599
+ *
26600
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26601
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26602
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26603
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26604
+ * by an agent that holds no cluster document at all. The hub is the single
26605
+ * authority over the whole hierarchy and answers for every layer, so the
26606
+ * layer selector needs a name the transport does not already own.
26607
+ */
26608
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26609
+ var SetLoggingSettingsInputSchema = object({
26610
+ scopeNodeId: string().optional(),
26611
+ patch: LoggingSettingsPatchSchema
26612
+ });
26613
+ /**
26614
+ * The whole document, as read and as returned after every write.
26615
+ *
26616
+ * `persisted: false` means the settings store could not be read or written.
26617
+ * The in-memory mirror still governs behaviour and is unchanged by the
26618
+ * failure — a read that fails neither switches a level nor disarms a window
26619
+ * (D49) — but the operator is told that what they are looking at would not
26620
+ * survive a restart.
26621
+ */
26622
+ var LoggingSettingsStateSchema = object({
26623
+ /** The layer this document was read at. `null` = the cluster layer. */
26624
+ scopeNodeId: string().nullable(),
26625
+ effective: LoggingEffectiveSchema,
26626
+ explicit: LoggingExplicitSchema,
26627
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26628
+ persisted: boolean()
26629
+ });
26194
26630
  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(), {
26195
26631
  kind: "mutation",
26196
26632
  auth: "admin"
@@ -26203,6 +26639,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26203
26639
  }), method(_void(), SiteLocationStatusSchema, {
26204
26640
  kind: "mutation",
26205
26641
  auth: "admin"
26642
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26643
+ kind: "mutation",
26644
+ auth: "admin"
26206
26645
  });
26207
26646
  object({
26208
26647
  /** True when the device's tamper switch / case-open contact is
@@ -29778,6 +30217,12 @@ Object.freeze({
29778
30217
  addonId: null,
29779
30218
  access: "view"
29780
30219
  },
30220
+ "notificationRules.resolveArtifactUrl": {
30221
+ capName: "notification-rules",
30222
+ capScope: "system",
30223
+ addonId: null,
30224
+ access: "view"
30225
+ },
29781
30226
  "notificationRules.setAlarmConfig": {
29782
30227
  capName: "notification-rules",
29783
30228
  capScope: "system",
@@ -31182,6 +31627,12 @@ Object.freeze({
31182
31627
  addonId: null,
31183
31628
  access: "view"
31184
31629
  },
31630
+ "recording.readWindowBytes": {
31631
+ capName: "recording",
31632
+ capScope: "system",
31633
+ addonId: null,
31634
+ access: "view"
31635
+ },
31185
31636
  "recording.refreshStorageLocationsForMigration": {
31186
31637
  capName: "recording",
31187
31638
  capScope: "system",
@@ -32022,6 +32473,18 @@ Object.freeze({
32022
32473
  addonId: null,
32023
32474
  access: "create"
32024
32475
  },
32476
+ "system.getLoggingSettings": {
32477
+ capName: "system",
32478
+ capScope: "system",
32479
+ addonId: null,
32480
+ access: "view"
32481
+ },
32482
+ "system.getRequestCensus": {
32483
+ capName: "system",
32484
+ capScope: "system",
32485
+ addonId: null,
32486
+ access: "view"
32487
+ },
32025
32488
  "system.getRetentionConfig": {
32026
32489
  capName: "system",
32027
32490
  capScope: "system",
@@ -32052,6 +32515,12 @@ Object.freeze({
32052
32515
  addonId: null,
32053
32516
  access: "view"
32054
32517
  },
32518
+ "system.setLoggingSettings": {
32519
+ capName: "system",
32520
+ capScope: "system",
32521
+ addonId: null,
32522
+ access: "create"
32523
+ },
32055
32524
  "system.setRetentionConfig": {
32056
32525
  capName: "system",
32057
32526
  capScope: "system",
@@ -33207,6 +33676,10 @@ Object.freeze({
33207
33676
  name: "deviceId",
33208
33677
  form: "single",
33209
33678
  optional: true
33679
+ }, {
33680
+ name: "deviceIds",
33681
+ form: "array",
33682
+ optional: true
33210
33683
  }],
33211
33684
  "fanControl.setDirection": [{
33212
33685
  name: "deviceId",
@@ -34012,6 +34485,11 @@ Object.freeze({
34012
34485
  form: "single",
34013
34486
  optional: false
34014
34487
  }],
34488
+ "recording.readWindowBytes": [{
34489
+ name: "deviceId",
34490
+ form: "single",
34491
+ optional: false
34492
+ }],
34015
34493
  "recording.relocateFootage": [{
34016
34494
  name: "deviceId",
34017
34495
  form: "single",
@@ -34812,7 +35290,38 @@ object({
34812
35290
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34813
35291
  * reproduce that.
34814
35292
  */
34815
- tileBudgetMb: number().int().min(0).max(1024)
35293
+ tileBudgetMb: number().int().min(0).max(1024),
35294
+ /**
35295
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35296
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35297
+ * subject tiles, on frames that detected something.
35298
+ *
35299
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35300
+ * containment is strict by design, so the native `keyFrame`, the detail
35301
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35302
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35303
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35304
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35305
+ *
35306
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35307
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35308
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35309
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35310
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35311
+ * binds only through a detection burst, where it still covers well past the
35312
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35313
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35314
+ * whole shape exists to avoid.
35315
+ *
35316
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35317
+ * subject tile, so one shared budget would let a busy camera's key frames
35318
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35319
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35320
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35321
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35322
+ * nothing.
35323
+ */
35324
+ sceneBudgetMb: number().int().min(0).max(1024)
34816
35325
  });
34817
35326
  /**
34818
35327
  * The values in force when the operator has set nothing.
@@ -34828,12 +35337,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34828
35337
  budgetMb: 1024,
34829
35338
  activityMs: 15e3,
34830
35339
  tileBudgetMb: 64,
35340
+ sceneBudgetMb: 48,
34831
35341
  admission: "inferred"
34832
35342
  };
34833
35343
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34834
35344
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34835
35345
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34836
35346
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35347
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34837
35348
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34838
35349
  var MB = 1024 * 1024;
34839
35350
  1024 * MB, 3072 * MB;