@camstack/addon-terminal 0.1.35 → 0.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +572 -61
  2. package/dist/addon.mjs +572 -61
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7625,6 +7625,66 @@ var OpsLogQueryInputSchema = object({
7625
7625
  /** Max rows returned, newest-first. */
7626
7626
  limit: number().int().min(1).max(1e3).optional()
7627
7627
  });
7628
+ var LabelDefinitionSchema = object({
7629
+ id: string(),
7630
+ name: string(),
7631
+ category: string().optional(),
7632
+ description: string().optional(),
7633
+ icon: string().optional()
7634
+ });
7635
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7636
+ var CLASS_MAP_MACRO_TARGETS = [
7637
+ "person",
7638
+ "vehicle",
7639
+ "animal",
7640
+ "package"
7641
+ ];
7642
+ /**
7643
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7644
+ * un operatore può selezionare.
7645
+ *
7646
+ * Sono le tre offerte dallo step `object-detection`
7647
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7648
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7649
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7650
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7651
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7652
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7653
+ *
7654
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7655
+ * dello step e una seconda volta come union `FirstLevelMacro`
7656
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7657
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7658
+ * successiva.
7659
+ */
7660
+ var FIRST_LEVEL_MACRO_CLASSES = [
7661
+ "person",
7662
+ "vehicle",
7663
+ "animal"
7664
+ ];
7665
+ /**
7666
+ * Wire schema for a per-model CATALOG classMap override
7667
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7668
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7669
+ * detection pipeline executor actually routes.
7670
+ *
7671
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7672
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7673
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7674
+ * enum) — the two used to share the name `ClassMapDefinition`/
7675
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7676
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7677
+ * are not: it is two different concepts colliding on a name. Keep this type
7678
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7679
+ * would either narrow every `ClassMapDefinition` consumer to the four
7680
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7681
+ * schema exists for (see the "rejects a classMap whose target is not a
7682
+ * detection macro" test in `model-catalog-schema.test.ts`).
7683
+ */
7684
+ var DetectionCatalogClassMapSchema = object({
7685
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7686
+ preserveOriginal: boolean()
7687
+ });
7628
7688
  /**
7629
7689
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7630
7690
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7647,10 +7707,55 @@ var RecordingStorageModeSchema = _enum([
7647
7707
  "events",
7648
7708
  "continuous"
7649
7709
  ]);
7710
+ /**
7711
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7712
+ * tre offerte dallo step `object-detection`, da UNA lista
7713
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7714
+ */
7715
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7716
+ /**
7717
+ * True quando `values` non ripete un elemento.
7718
+ *
7719
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7720
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7721
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7722
+ */
7723
+ var noDuplicates = (values) => new Set(values).size === values.length;
7650
7724
  /** Which detectors trigger an `events`-mode band. */
7651
7725
  var RecordingTriggersSchema = object({
7652
7726
  motion: boolean().optional(),
7653
- audioThresholdDbfs: number().optional()
7727
+ audioThresholdDbfs: number().optional(),
7728
+ /**
7729
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7730
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7731
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7732
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7733
+ *
7734
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7735
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7736
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7737
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7738
+ * finestre — vedi `recorder/object-trigger.ts`.
7739
+ */
7740
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7741
+ /**
7742
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7743
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7744
+ * `objectClasses`.
7745
+ *
7746
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7747
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7748
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7749
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7750
+ * device (D12) — mai un elenco globale di cap.
7751
+ *
7752
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7753
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7754
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7755
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7756
+ * registrare.
7757
+ */
7758
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7654
7759
  });
7655
7760
  /**
7656
7761
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8102,41 +8207,6 @@ var DecoderSessionConfigSchema = object({
8102
8207
  */
8103
8208
  debug: boolean().optional()
8104
8209
  });
8105
- var LabelDefinitionSchema = object({
8106
- id: string(),
8107
- name: string(),
8108
- category: string().optional(),
8109
- description: string().optional(),
8110
- icon: string().optional()
8111
- });
8112
- /**
8113
- * Wire schema for a per-model CATALOG classMap override
8114
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8115
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8116
- * detection pipeline executor actually routes.
8117
- *
8118
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8119
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8120
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8121
- * enum) — the two used to share the name `ClassMapDefinition`/
8122
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8123
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8124
- * are not: it is two different concepts colliding on a name. Keep this type
8125
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8126
- * would either narrow every `ClassMapDefinition` consumer to the four
8127
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8128
- * schema exists for (see the "rejects a classMap whose target is not a
8129
- * detection macro" test in `model-catalog-schema.test.ts`).
8130
- */
8131
- var DetectionCatalogClassMapSchema = object({
8132
- mapping: record(string(), _enum([
8133
- "person",
8134
- "vehicle",
8135
- "animal",
8136
- "package"
8137
- ])),
8138
- preserveOriginal: boolean()
8139
- });
8140
8210
  var MODEL_FORMATS = [
8141
8211
  "onnx",
8142
8212
  "coreml",
@@ -15826,7 +15896,23 @@ var NcHistoryEntrySchema = object({
15826
15896
  updatedAt: number(),
15827
15897
  /** Failure detail — present on a `dead` row. */
15828
15898
  error: string().optional(),
15829
- subject: NcHistorySubjectSchema
15899
+ subject: NcHistorySubjectSchema,
15900
+ /**
15901
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15902
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15903
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15904
+ * every delivery attempt). Absent on a row still pending/dead, a row
15905
+ * delivered before this field shipped, or a wiring with no artefact index.
15906
+ *
15907
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15908
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15909
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15910
+ * also answers `null` for an id whose artefact has since expired past the
15911
+ * retained shelf's own age bound — the degrade a caller (the Home
15912
+ * Assistant export) must render as "no image right now", never as a
15913
+ * broken link.
15914
+ */
15915
+ artifactIds: array(string().min(1)).optional()
15830
15916
  });
15831
15917
  /**
15832
15918
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16053,7 +16139,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16053
16139
  }), method(object({}), object({
16054
16140
  catalog: array(NcConditionDescriptorSchema),
16055
16141
  taxonomy: NcTaxonomySchema.optional()
16056
- })), 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 }), {
16142
+ })), 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 }), {
16057
16143
  kind: "mutation",
16058
16144
  caller: "required"
16059
16145
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21329,7 +21415,7 @@ var lifecycleJobSchema = object({
21329
21415
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21330
21416
  * as every other cap.
21331
21417
  */
21332
- var LogLevelSchema$1 = _enum([
21418
+ var LogLevelSchema$2 = _enum([
21333
21419
  "debug",
21334
21420
  "info",
21335
21421
  "warn",
@@ -21536,7 +21622,7 @@ var CustomActionInputSchema = object({
21536
21622
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21537
21623
  addonId: string(),
21538
21624
  limit: number().min(1).max(500).default(100),
21539
- level: LogLevelSchema$1.optional()
21625
+ level: LogLevelSchema$2.optional()
21540
21626
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21541
21627
  packageName: string(),
21542
21628
  version: string().optional()
@@ -21634,7 +21720,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21634
21720
  auth: "admin"
21635
21721
  }), method(object({
21636
21722
  addonId: string(),
21637
- level: LogLevelSchema$1.optional()
21723
+ level: LogLevelSchema$2.optional()
21638
21724
  }), LogStreamEntrySchema, { kind: "subscription" });
21639
21725
  /**
21640
21726
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23358,6 +23444,35 @@ var FaceFilterEnum = _enum([
23358
23444
  "identified",
23359
23445
  "all"
23360
23446
  ]);
23447
+ /**
23448
+ * What a `listRecentFaces` page is ORDERED BY.
23449
+ *
23450
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23451
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23452
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23453
+ * order: it puts the suggestions an operator can confirm with one tap at the
23454
+ * top, and it is the reason this enum exists — a client that ranked a capped
23455
+ * page client-side was ranking the newest N, never the most certain N.
23456
+ *
23457
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23458
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23459
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23460
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23461
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23462
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23463
+ * then by faceId, and is what makes this a total order instead of the
23464
+ * backend's NULL-collation accident.
23465
+ */
23466
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23467
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23468
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23469
+ * never leaves the server. */
23470
+ var FaceClusterSchema = object({
23471
+ faceIds: array(string()).readonly(),
23472
+ representativeFaceId: string(),
23473
+ size: number().int(),
23474
+ cohesion: number()
23475
+ });
23361
23476
  var MediaFileLiteSchema$1 = object({
23362
23477
  key: string(),
23363
23478
  kind: string(),
@@ -23404,24 +23519,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23404
23519
  kind: "mutation",
23405
23520
  auth: "admin"
23406
23521
  }), method(object({
23407
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23522
+ /**
23523
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23524
+ *
23525
+ * The legacy single-camera form, kept verbatim for every caller that
23526
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23527
+ * instead — never both: `deviceIds` is the authority whenever it is
23528
+ * present, and this field is then ignored rather than unioned, so
23529
+ * there is exactly one answer to "which cameras did I ask for".
23530
+ */
23408
23531
  deviceId: number().int().optional(),
23532
+ /**
23533
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23534
+ * until now had to fetch the cluster-wide page and drop rows in the
23535
+ * client (so the `limit` it asked for was spent on cameras it was
23536
+ * about to discard).
23537
+ *
23538
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23539
+ * "every camera". A request for no devices is a request, not an
23540
+ * omission; same contract as `deviceManager.listFleet` and
23541
+ * `pipelineAnalytics.listRecentTracks`.
23542
+ *
23543
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23544
+ */
23545
+ deviceIds: array(number().int()).optional(),
23409
23546
  limit: number().int().positive().optional(),
23410
23547
  filter: FaceFilterEnum.optional(),
23411
23548
  /**
23412
- * Inline the base64 crop on every row. Default `true` — the existing
23413
- * behaviour, kept so no caller breaks.
23549
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23550
+ * Absent means no lower bound.
23551
+ */
23552
+ since: number().int().optional(),
23553
+ /**
23554
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23555
+ * Absent means no upper bound.
23556
+ */
23557
+ until: number().int().optional(),
23558
+ /**
23559
+ * Order the page by time or by suggestion certainty. Default
23560
+ * `'timestamp'` — the historical order, unchanged for every caller
23561
+ * that does not ask.
23414
23562
  *
23415
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23416
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23417
- * the browser cache the images.
23563
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23564
+ * does under `'suggestionConfidence'`.
23418
23565
  *
23419
- * **This is an INPUT field, so it does not reach the addon until the
23420
- * next train.** The hub router validates cap inputs against its own
23421
- * compiled Zod, which strips a key it does not know verified today
23422
- * on the OUTPUT side, where an additive field DOES arrive immediately
23423
- * (`Track.hasFace`). Until the train ships, sending `false` is
23424
- * harmless and simply keeps the crops inline.
23566
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23567
+ * index and stops reading as soon as `limit` rows have PASSED the
23568
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23569
+ * certain row may be the oldest so it walks the window. Narrow it
23570
+ * with {@link since} / {@link until}.
23571
+ */
23572
+ sortBy: FaceSortFieldEnum.optional(),
23573
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23574
+ sortDirection: FaceSortDirectionEnum.optional(),
23575
+ /**
23576
+ * Inline the base64 crop on every row.
23577
+ *
23578
+ * Default `false` since the 2026-08-25 inversion — see
23579
+ * `include-crops-default.ts`, which is the ONE place that resolves
23580
+ * this for every gallery, and which records why the inline shape had
23581
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23582
+ * The doc here used to still say `true`; it was wrong, and a leftover
23583
+ * that describes the old design reads as permission to rely on it.
23584
+ *
23585
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23586
+ * which the browser fetches off the `event-media` plane in parallel,
23587
+ * cached and ETagged.
23425
23588
  */
23426
23589
  includeCrops: boolean().optional()
23427
23590
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23457,13 +23620,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23457
23620
  }), method(object({
23458
23621
  threshold: number().min(0).max(1).optional(),
23459
23622
  minClusterSize: number().int().min(2).optional(),
23460
- limit: number().int().positive().optional()
23461
- }).optional(), array(object({
23462
- faceIds: array(string()).readonly(),
23463
- representativeFaceId: string(),
23464
- size: number().int(),
23465
- cohesion: number()
23466
- })).readonly());
23623
+ /**
23624
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23625
+ * which read as though it bounded the work — it never did.
23626
+ *
23627
+ * Wins over {@link limit} when both are sent.
23628
+ */
23629
+ maxClusters: number().int().positive().optional(),
23630
+ /**
23631
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23632
+ * RESULT, not the scan. Kept so existing callers keep working; send
23633
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23634
+ */
23635
+ limit: number().int().positive().optional(),
23636
+ /**
23637
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23638
+ * POOL, not the result.
23639
+ *
23640
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23641
+ * used to read every unassigned face on the hub no matter what the
23642
+ * caller asked for, because the only bound cut the finished clusters
23643
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23644
+ * whole corpus, on an addon whose disk is under contention.
23645
+ *
23646
+ * The pool is the NEWEST matching faces first — the same order the
23647
+ * gallery shows — so a bound here shortens the horizon, it does not
23648
+ * sample it randomly.
23649
+ *
23650
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23651
+ * so the live corpus — 372 face rows — is unaffected while the
23652
+ * unbounded scan can never come back as the table grows.
23653
+ */
23654
+ maxFacesScanned: number().int().positive().optional()
23655
+ }).optional(), array(FaceClusterSchema).readonly());
23467
23656
  /**
23468
23657
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23469
23658
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27221,6 +27410,39 @@ var ReadGopBytesResultSchema = object({
27221
27410
  /** Media ms the returned fragment covers. */
27222
27411
  gopDurMs: number()
27223
27412
  });
27413
+ /**
27414
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27415
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27416
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27417
+ * a replay needs several seconds of native pixels, not one frame.
27418
+ *
27419
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27420
+ * is `false` when the returned bytes were cut short by the read's own safety
27421
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27422
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27423
+ * degradation: a window whose end falls past the covering segment would need
27424
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27425
+ * not one standalone-demuxable stream — the caller's answer is to request a
27426
+ * shorter window or one aligned to a single segment, not to receive spliced
27427
+ * bytes nothing has proven decodable.
27428
+ */
27429
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27430
+ kind: literal("ok"),
27431
+ data: _instanceof(Uint8Array),
27432
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27433
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27434
+ gopStartMs: number(),
27435
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27436
+ gopDurMs: number(),
27437
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27438
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27439
+ reachesRequestedEnd: boolean()
27440
+ }), object({
27441
+ kind: literal("spans-multiple-segments"),
27442
+ /** Where the covering segment's own footage runs out — informational,
27443
+ * not a retry hint (retrying the same window would refuse again). */
27444
+ segmentEndMs: number()
27445
+ })]);
27224
27446
  method(object({
27225
27447
  deviceId: number(),
27226
27448
  fromMs: number(),
@@ -27271,6 +27493,15 @@ method(object({
27271
27493
  }), ReadGopBytesResultSchema, {
27272
27494
  kind: "query",
27273
27495
  auth: "admin"
27496
+ }), method(object({
27497
+ deviceId: number(),
27498
+ profile: string(),
27499
+ startMs: number(),
27500
+ fromMs: number(),
27501
+ toMs: number()
27502
+ }), ReadWindowBytesResultSchema, {
27503
+ kind: "query",
27504
+ auth: "admin"
27274
27505
  }), method(object({
27275
27506
  deviceId: number(),
27276
27507
  config: RecordingConfigSchema
@@ -28363,6 +28594,211 @@ var SetSiteLocationInputSchema = object({
28363
28594
  latitude: number().min(-90).max(90),
28364
28595
  longitude: number().min(-180).max(180)
28365
28596
  }).nullable();
28597
+ /**
28598
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28599
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28600
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28601
+ * already prints - never a token, never an `Authorization` header.
28602
+ */
28603
+ var RequestCensusGroupSchema = object({
28604
+ procedure: string(),
28605
+ userAgent: string(),
28606
+ ip: string(),
28607
+ principal: string(),
28608
+ calls: number(),
28609
+ perMin: number()
28610
+ });
28611
+ /**
28612
+ * A procedure's TOTAL over the window, across every caller.
28613
+ *
28614
+ * This block, not the group list, is what answers "did these calls arrive over
28615
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28616
+ * same window excludes the HTTP plane, which is a result, not a failure.
28617
+ */
28618
+ var RequestCensusProcedureSchema = object({
28619
+ procedure: string(),
28620
+ calls: number(),
28621
+ perMin: number()
28622
+ });
28623
+ /**
28624
+ * The census as an operator sees it.
28625
+ *
28626
+ * `persisted` is the honest answer to "will this survive the restart I am
28627
+ * about to do": the arm deadline is written to `system-settings` so a window
28628
+ * armed now can measure the NEXT boot, and a write that failed must not look
28629
+ * like one that succeeded.
28630
+ */
28631
+ var RequestCensusStatusSchema = object({
28632
+ armed: boolean(),
28633
+ /** How long the current - or just-closed - window collected, in ms. */
28634
+ elapsedMs: number(),
28635
+ /** The window actually armed, after the server clamped the request. */
28636
+ windowMs: number(),
28637
+ /** Epoch ms the window closes at. 0 when disarmed. */
28638
+ armedUntilMs: number(),
28639
+ httpRequests: number(),
28640
+ batchedRequests: number(),
28641
+ /**
28642
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28643
+ * is in play (`?batch=1` carries several procedures in one request); this is
28644
+ * the number comparable with a store-side call count.
28645
+ */
28646
+ procedureCalls: number(),
28647
+ /**
28648
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28649
+ * transport resolves one context per connection - but the number that says
28650
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28651
+ */
28652
+ wsConnections: number(),
28653
+ distinctGroups: number(),
28654
+ /** Calls counted in the totals whose group attribution was shed at the
28655
+ * cardinality bound. */
28656
+ unattributedCalls: number(),
28657
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28658
+ groups: array(RequestCensusGroupSchema).readonly()
28659
+ }).extend({ persisted: boolean() });
28660
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28661
+ var LogLevelSchema$1 = _enum([
28662
+ "debug",
28663
+ "info",
28664
+ "warn",
28665
+ "error"
28666
+ ]);
28667
+ /**
28668
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28669
+ *
28670
+ * A diagnostic is anything whose cost is only worth paying while a question is
28671
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28672
+ */
28673
+ var DiagnosticIdSchema = _enum(["request-census"]);
28674
+ /**
28675
+ * The layers of the level hierarchy, general → specific. The most specific
28676
+ * layer that carries an explicit value wins.
28677
+ *
28678
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28679
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28680
+ * grow later would force every consumer of this document to change with it.
28681
+ * Nothing returns `component` today.
28682
+ */
28683
+ var LoggingScopeKindSchema = _enum([
28684
+ "cluster",
28685
+ "node",
28686
+ "component"
28687
+ ]);
28688
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28689
+ var LoggingLevelSourceSchema = _enum([
28690
+ "default",
28691
+ "cluster",
28692
+ "node",
28693
+ "component"
28694
+ ]);
28695
+ /**
28696
+ * One layer of the hierarchy as it actually STANDS.
28697
+ *
28698
+ * `level: null` is the whole reason this array is returned: it is the
28699
+ * difference between "this node is at `info` because I decided it" and
28700
+ * "...because it inherits". An operator who clears an override believing they
28701
+ * are clearing an inherited value has been handed the same defect as the two
28702
+ * contradicting knobs this document exists to remove, moved one floor up.
28703
+ */
28704
+ var LoggingLevelLayerSchema = object({
28705
+ scope: LoggingScopeKindSchema,
28706
+ /** The node this layer speaks for; `null` on the cluster layer. */
28707
+ nodeId: string().nullable(),
28708
+ /** Explicitly set here, or `null` when this layer inherits. */
28709
+ level: LogLevelSchema$1.nullable()
28710
+ });
28711
+ /** What a line is judged against, and WHICH layer decided it. */
28712
+ var LoggingEffectiveSchema = object({
28713
+ level: LogLevelSchema$1,
28714
+ levelSource: LoggingLevelSourceSchema
28715
+ });
28716
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28717
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28718
+ /**
28719
+ * An armed diagnostic, with its DEADLINE.
28720
+ *
28721
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28722
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28723
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28724
+ * `armed` is false — a window is never reported as slightly expired.
28725
+ */
28726
+ var DiagnosticWindowSchema = object({
28727
+ id: DiagnosticIdSchema,
28728
+ armed: boolean(),
28729
+ /** Epoch ms the window closes at. 0 when disarmed. */
28730
+ armedUntilMs: number(),
28731
+ /** Ms left before it expires on its own. 0 when disarmed. */
28732
+ remainingMs: number(),
28733
+ /** Whether the stored deadline is the one the live diagnostic is running —
28734
+ * i.e. whether this window would survive a restart. */
28735
+ persisted: boolean()
28736
+ });
28737
+ /**
28738
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28739
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28740
+ * is a second knob that disagrees with the first the day one of them moves.
28741
+ */
28742
+ var DiagnosticWindowPatchSchema = object({
28743
+ id: DiagnosticIdSchema,
28744
+ armMs: number().int().min(0),
28745
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28746
+ reportEveryMs: number().int().positive().optional()
28747
+ });
28748
+ /**
28749
+ * A PATCH, and patches MERGE.
28750
+ *
28751
+ * A field absent from the patch is left exactly as it was — arming a
28752
+ * diagnostic never resets a level, and setting a level never disarms a window.
28753
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28754
+ * `setAll` already merges, and rebuilding the object is how an absent field
28755
+ * turns into an erased one.
28756
+ */
28757
+ var LoggingSettingsPatchSchema = object({
28758
+ /**
28759
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28760
+ * addressed scope so it inherits again. A value sets it.
28761
+ */
28762
+ level: LogLevelSchema$1.nullable().optional(),
28763
+ /**
28764
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28765
+ * keeps running — a patch is never a full replacement.
28766
+ */
28767
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28768
+ });
28769
+ /**
28770
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28771
+ *
28772
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28773
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28774
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28775
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28776
+ * by an agent that holds no cluster document at all. The hub is the single
28777
+ * authority over the whole hierarchy and answers for every layer, so the
28778
+ * layer selector needs a name the transport does not already own.
28779
+ */
28780
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28781
+ var SetLoggingSettingsInputSchema = object({
28782
+ scopeNodeId: string().optional(),
28783
+ patch: LoggingSettingsPatchSchema
28784
+ });
28785
+ /**
28786
+ * The whole document, as read and as returned after every write.
28787
+ *
28788
+ * `persisted: false` means the settings store could not be read or written.
28789
+ * The in-memory mirror still governs behaviour and is unchanged by the
28790
+ * failure — a read that fails neither switches a level nor disarms a window
28791
+ * (D49) — but the operator is told that what they are looking at would not
28792
+ * survive a restart.
28793
+ */
28794
+ var LoggingSettingsStateSchema = object({
28795
+ /** The layer this document was read at. `null` = the cluster layer. */
28796
+ scopeNodeId: string().nullable(),
28797
+ effective: LoggingEffectiveSchema,
28798
+ explicit: LoggingExplicitSchema,
28799
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28800
+ persisted: boolean()
28801
+ });
28366
28802
  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(), {
28367
28803
  kind: "mutation",
28368
28804
  auth: "admin"
@@ -28375,6 +28811,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28375
28811
  }), method(_void(), SiteLocationStatusSchema, {
28376
28812
  kind: "mutation",
28377
28813
  auth: "admin"
28814
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28815
+ kind: "mutation",
28816
+ auth: "admin"
28378
28817
  });
28379
28818
  /**
28380
28819
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33356,6 +33795,12 @@ Object.freeze({
33356
33795
  addonId: null,
33357
33796
  access: "view"
33358
33797
  },
33798
+ "notificationRules.resolveArtifactUrl": {
33799
+ capName: "notification-rules",
33800
+ capScope: "system",
33801
+ addonId: null,
33802
+ access: "view"
33803
+ },
33359
33804
  "notificationRules.setAlarmConfig": {
33360
33805
  capName: "notification-rules",
33361
33806
  capScope: "system",
@@ -34760,6 +35205,12 @@ Object.freeze({
34760
35205
  addonId: null,
34761
35206
  access: "view"
34762
35207
  },
35208
+ "recording.readWindowBytes": {
35209
+ capName: "recording",
35210
+ capScope: "system",
35211
+ addonId: null,
35212
+ access: "view"
35213
+ },
34763
35214
  "recording.refreshStorageLocationsForMigration": {
34764
35215
  capName: "recording",
34765
35216
  capScope: "system",
@@ -35600,6 +36051,18 @@ Object.freeze({
35600
36051
  addonId: null,
35601
36052
  access: "create"
35602
36053
  },
36054
+ "system.getLoggingSettings": {
36055
+ capName: "system",
36056
+ capScope: "system",
36057
+ addonId: null,
36058
+ access: "view"
36059
+ },
36060
+ "system.getRequestCensus": {
36061
+ capName: "system",
36062
+ capScope: "system",
36063
+ addonId: null,
36064
+ access: "view"
36065
+ },
35603
36066
  "system.getRetentionConfig": {
35604
36067
  capName: "system",
35605
36068
  capScope: "system",
@@ -35630,6 +36093,12 @@ Object.freeze({
35630
36093
  addonId: null,
35631
36094
  access: "view"
35632
36095
  },
36096
+ "system.setLoggingSettings": {
36097
+ capName: "system",
36098
+ capScope: "system",
36099
+ addonId: null,
36100
+ access: "create"
36101
+ },
35633
36102
  "system.setRetentionConfig": {
35634
36103
  capName: "system",
35635
36104
  capScope: "system",
@@ -36785,6 +37254,10 @@ Object.freeze({
36785
37254
  name: "deviceId",
36786
37255
  form: "single",
36787
37256
  optional: true
37257
+ }, {
37258
+ name: "deviceIds",
37259
+ form: "array",
37260
+ optional: true
36788
37261
  }],
36789
37262
  "fanControl.setDirection": [{
36790
37263
  name: "deviceId",
@@ -37590,6 +38063,11 @@ Object.freeze({
37590
38063
  form: "single",
37591
38064
  optional: false
37592
38065
  }],
38066
+ "recording.readWindowBytes": [{
38067
+ name: "deviceId",
38068
+ form: "single",
38069
+ optional: false
38070
+ }],
37593
38071
  "recording.relocateFootage": [{
37594
38072
  name: "deviceId",
37595
38073
  form: "single",
@@ -38390,7 +38868,38 @@ object({
38390
38868
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38391
38869
  * reproduce that.
38392
38870
  */
38393
- tileBudgetMb: number().int().min(0).max(1024)
38871
+ tileBudgetMb: number().int().min(0).max(1024),
38872
+ /**
38873
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38874
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38875
+ * subject tiles, on frames that detected something.
38876
+ *
38877
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38878
+ * containment is strict by design, so the native `keyFrame`, the detail
38879
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38880
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38881
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38882
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38883
+ *
38884
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38885
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38886
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38887
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38888
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38889
+ * binds only through a detection burst, where it still covers well past the
38890
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38891
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38892
+ * whole shape exists to avoid.
38893
+ *
38894
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38895
+ * subject tile, so one shared budget would let a busy camera's key frames
38896
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38897
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38898
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38899
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38900
+ * nothing.
38901
+ */
38902
+ sceneBudgetMb: number().int().min(0).max(1024)
38394
38903
  });
38395
38904
  /**
38396
38905
  * The values in force when the operator has set nothing.
@@ -38406,12 +38915,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38406
38915
  budgetMb: 1024,
38407
38916
  activityMs: 15e3,
38408
38917
  tileBudgetMb: 64,
38918
+ sceneBudgetMb: 48,
38409
38919
  admission: "inferred"
38410
38920
  };
38411
38921
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38412
38922
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38413
38923
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38414
38924
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38925
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38415
38926
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38416
38927
  var MB = 1024 * 1024;
38417
38928
  1024 * MB, 3072 * MB;