@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.mjs CHANGED
@@ -7602,6 +7602,66 @@ var OpsLogQueryInputSchema = object({
7602
7602
  /** Max rows returned, newest-first. */
7603
7603
  limit: number().int().min(1).max(1e3).optional()
7604
7604
  });
7605
+ var LabelDefinitionSchema = object({
7606
+ id: string(),
7607
+ name: string(),
7608
+ category: string().optional(),
7609
+ description: string().optional(),
7610
+ icon: string().optional()
7611
+ });
7612
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7613
+ var CLASS_MAP_MACRO_TARGETS = [
7614
+ "person",
7615
+ "vehicle",
7616
+ "animal",
7617
+ "package"
7618
+ ];
7619
+ /**
7620
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7621
+ * un operatore può selezionare.
7622
+ *
7623
+ * Sono le tre offerte dallo step `object-detection`
7624
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7625
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7626
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7627
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7628
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7629
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7630
+ *
7631
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7632
+ * dello step e una seconda volta come union `FirstLevelMacro`
7633
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7634
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7635
+ * successiva.
7636
+ */
7637
+ var FIRST_LEVEL_MACRO_CLASSES = [
7638
+ "person",
7639
+ "vehicle",
7640
+ "animal"
7641
+ ];
7642
+ /**
7643
+ * Wire schema for a per-model CATALOG classMap override
7644
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7645
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7646
+ * detection pipeline executor actually routes.
7647
+ *
7648
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7649
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7650
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7651
+ * enum) — the two used to share the name `ClassMapDefinition`/
7652
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7653
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7654
+ * are not: it is two different concepts colliding on a name. Keep this type
7655
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7656
+ * would either narrow every `ClassMapDefinition` consumer to the four
7657
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7658
+ * schema exists for (see the "rejects a classMap whose target is not a
7659
+ * detection macro" test in `model-catalog-schema.test.ts`).
7660
+ */
7661
+ var DetectionCatalogClassMapSchema = object({
7662
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7663
+ preserveOriginal: boolean()
7664
+ });
7605
7665
  /**
7606
7666
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7607
7667
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7624,10 +7684,55 @@ var RecordingStorageModeSchema = _enum([
7624
7684
  "events",
7625
7685
  "continuous"
7626
7686
  ]);
7687
+ /**
7688
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7689
+ * tre offerte dallo step `object-detection`, da UNA lista
7690
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7691
+ */
7692
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7693
+ /**
7694
+ * True quando `values` non ripete un elemento.
7695
+ *
7696
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7697
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7698
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7699
+ */
7700
+ var noDuplicates = (values) => new Set(values).size === values.length;
7627
7701
  /** Which detectors trigger an `events`-mode band. */
7628
7702
  var RecordingTriggersSchema = object({
7629
7703
  motion: boolean().optional(),
7630
- audioThresholdDbfs: number().optional()
7704
+ audioThresholdDbfs: number().optional(),
7705
+ /**
7706
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7707
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7708
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7709
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7710
+ *
7711
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7712
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7713
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7714
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7715
+ * finestre — vedi `recorder/object-trigger.ts`.
7716
+ */
7717
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7718
+ /**
7719
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7720
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7721
+ * `objectClasses`.
7722
+ *
7723
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7724
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7725
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7726
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7727
+ * device (D12) — mai un elenco globale di cap.
7728
+ *
7729
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7730
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7731
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7732
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7733
+ * registrare.
7734
+ */
7735
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7631
7736
  });
7632
7737
  /**
7633
7738
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8079,41 +8184,6 @@ var DecoderSessionConfigSchema = object({
8079
8184
  */
8080
8185
  debug: boolean().optional()
8081
8186
  });
8082
- var LabelDefinitionSchema = object({
8083
- id: string(),
8084
- name: string(),
8085
- category: string().optional(),
8086
- description: string().optional(),
8087
- icon: string().optional()
8088
- });
8089
- /**
8090
- * Wire schema for a per-model CATALOG classMap override
8091
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8092
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8093
- * detection pipeline executor actually routes.
8094
- *
8095
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8096
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8097
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8098
- * enum) — the two used to share the name `ClassMapDefinition`/
8099
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8100
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8101
- * are not: it is two different concepts colliding on a name. Keep this type
8102
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8103
- * would either narrow every `ClassMapDefinition` consumer to the four
8104
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8105
- * schema exists for (see the "rejects a classMap whose target is not a
8106
- * detection macro" test in `model-catalog-schema.test.ts`).
8107
- */
8108
- var DetectionCatalogClassMapSchema = object({
8109
- mapping: record(string(), _enum([
8110
- "person",
8111
- "vehicle",
8112
- "animal",
8113
- "package"
8114
- ])),
8115
- preserveOriginal: boolean()
8116
- });
8117
8187
  var MODEL_FORMATS = [
8118
8188
  "onnx",
8119
8189
  "coreml",
@@ -15803,7 +15873,23 @@ var NcHistoryEntrySchema = object({
15803
15873
  updatedAt: number(),
15804
15874
  /** Failure detail — present on a `dead` row. */
15805
15875
  error: string().optional(),
15806
- subject: NcHistorySubjectSchema
15876
+ subject: NcHistorySubjectSchema,
15877
+ /**
15878
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15879
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15880
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15881
+ * every delivery attempt). Absent on a row still pending/dead, a row
15882
+ * delivered before this field shipped, or a wiring with no artefact index.
15883
+ *
15884
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15885
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15886
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15887
+ * also answers `null` for an id whose artefact has since expired past the
15888
+ * retained shelf's own age bound — the degrade a caller (the Home
15889
+ * Assistant export) must render as "no image right now", never as a
15890
+ * broken link.
15891
+ */
15892
+ artifactIds: array(string().min(1)).optional()
15807
15893
  });
15808
15894
  /**
15809
15895
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16030,7 +16116,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16030
16116
  }), method(object({}), object({
16031
16117
  catalog: array(NcConditionDescriptorSchema),
16032
16118
  taxonomy: NcTaxonomySchema.optional()
16033
- })), 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 }), {
16119
+ })), 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 }), {
16034
16120
  kind: "mutation",
16035
16121
  caller: "required"
16036
16122
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21306,7 +21392,7 @@ var lifecycleJobSchema = object({
21306
21392
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21307
21393
  * as every other cap.
21308
21394
  */
21309
- var LogLevelSchema$1 = _enum([
21395
+ var LogLevelSchema$2 = _enum([
21310
21396
  "debug",
21311
21397
  "info",
21312
21398
  "warn",
@@ -21513,7 +21599,7 @@ var CustomActionInputSchema = object({
21513
21599
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21514
21600
  addonId: string(),
21515
21601
  limit: number().min(1).max(500).default(100),
21516
- level: LogLevelSchema$1.optional()
21602
+ level: LogLevelSchema$2.optional()
21517
21603
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21518
21604
  packageName: string(),
21519
21605
  version: string().optional()
@@ -21611,7 +21697,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21611
21697
  auth: "admin"
21612
21698
  }), method(object({
21613
21699
  addonId: string(),
21614
- level: LogLevelSchema$1.optional()
21700
+ level: LogLevelSchema$2.optional()
21615
21701
  }), LogStreamEntrySchema, { kind: "subscription" });
21616
21702
  /**
21617
21703
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23335,6 +23421,35 @@ var FaceFilterEnum = _enum([
23335
23421
  "identified",
23336
23422
  "all"
23337
23423
  ]);
23424
+ /**
23425
+ * What a `listRecentFaces` page is ORDERED BY.
23426
+ *
23427
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23428
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23429
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23430
+ * order: it puts the suggestions an operator can confirm with one tap at the
23431
+ * top, and it is the reason this enum exists — a client that ranked a capped
23432
+ * page client-side was ranking the newest N, never the most certain N.
23433
+ *
23434
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23435
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23436
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23437
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23438
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23439
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23440
+ * then by faceId, and is what makes this a total order instead of the
23441
+ * backend's NULL-collation accident.
23442
+ */
23443
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23444
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23445
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23446
+ * never leaves the server. */
23447
+ var FaceClusterSchema = object({
23448
+ faceIds: array(string()).readonly(),
23449
+ representativeFaceId: string(),
23450
+ size: number().int(),
23451
+ cohesion: number()
23452
+ });
23338
23453
  var MediaFileLiteSchema$1 = object({
23339
23454
  key: string(),
23340
23455
  kind: string(),
@@ -23381,24 +23496,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23381
23496
  kind: "mutation",
23382
23497
  auth: "admin"
23383
23498
  }), method(object({
23384
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23499
+ /**
23500
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23501
+ *
23502
+ * The legacy single-camera form, kept verbatim for every caller that
23503
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23504
+ * instead — never both: `deviceIds` is the authority whenever it is
23505
+ * present, and this field is then ignored rather than unioned, so
23506
+ * there is exactly one answer to "which cameras did I ask for".
23507
+ */
23385
23508
  deviceId: number().int().optional(),
23509
+ /**
23510
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23511
+ * until now had to fetch the cluster-wide page and drop rows in the
23512
+ * client (so the `limit` it asked for was spent on cameras it was
23513
+ * about to discard).
23514
+ *
23515
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23516
+ * "every camera". A request for no devices is a request, not an
23517
+ * omission; same contract as `deviceManager.listFleet` and
23518
+ * `pipelineAnalytics.listRecentTracks`.
23519
+ *
23520
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23521
+ */
23522
+ deviceIds: array(number().int()).optional(),
23386
23523
  limit: number().int().positive().optional(),
23387
23524
  filter: FaceFilterEnum.optional(),
23388
23525
  /**
23389
- * Inline the base64 crop on every row. Default `true` — the existing
23390
- * behaviour, kept so no caller breaks.
23526
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23527
+ * Absent means no lower bound.
23528
+ */
23529
+ since: number().int().optional(),
23530
+ /**
23531
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23532
+ * Absent means no upper bound.
23533
+ */
23534
+ until: number().int().optional(),
23535
+ /**
23536
+ * Order the page by time or by suggestion certainty. Default
23537
+ * `'timestamp'` — the historical order, unchanged for every caller
23538
+ * that does not ask.
23391
23539
  *
23392
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23393
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23394
- * the browser cache the images.
23540
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23541
+ * does under `'suggestionConfidence'`.
23395
23542
  *
23396
- * **This is an INPUT field, so it does not reach the addon until the
23397
- * next train.** The hub router validates cap inputs against its own
23398
- * compiled Zod, which strips a key it does not know verified today
23399
- * on the OUTPUT side, where an additive field DOES arrive immediately
23400
- * (`Track.hasFace`). Until the train ships, sending `false` is
23401
- * harmless and simply keeps the crops inline.
23543
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23544
+ * index and stops reading as soon as `limit` rows have PASSED the
23545
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23546
+ * certain row may be the oldest so it walks the window. Narrow it
23547
+ * with {@link since} / {@link until}.
23548
+ */
23549
+ sortBy: FaceSortFieldEnum.optional(),
23550
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23551
+ sortDirection: FaceSortDirectionEnum.optional(),
23552
+ /**
23553
+ * Inline the base64 crop on every row.
23554
+ *
23555
+ * Default `false` since the 2026-08-25 inversion — see
23556
+ * `include-crops-default.ts`, which is the ONE place that resolves
23557
+ * this for every gallery, and which records why the inline shape had
23558
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23559
+ * The doc here used to still say `true`; it was wrong, and a leftover
23560
+ * that describes the old design reads as permission to rely on it.
23561
+ *
23562
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23563
+ * which the browser fetches off the `event-media` plane in parallel,
23564
+ * cached and ETagged.
23402
23565
  */
23403
23566
  includeCrops: boolean().optional()
23404
23567
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23434,13 +23597,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23434
23597
  }), method(object({
23435
23598
  threshold: number().min(0).max(1).optional(),
23436
23599
  minClusterSize: number().int().min(2).optional(),
23437
- limit: number().int().positive().optional()
23438
- }).optional(), array(object({
23439
- faceIds: array(string()).readonly(),
23440
- representativeFaceId: string(),
23441
- size: number().int(),
23442
- cohesion: number()
23443
- })).readonly());
23600
+ /**
23601
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23602
+ * which read as though it bounded the work — it never did.
23603
+ *
23604
+ * Wins over {@link limit} when both are sent.
23605
+ */
23606
+ maxClusters: number().int().positive().optional(),
23607
+ /**
23608
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23609
+ * RESULT, not the scan. Kept so existing callers keep working; send
23610
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23611
+ */
23612
+ limit: number().int().positive().optional(),
23613
+ /**
23614
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23615
+ * POOL, not the result.
23616
+ *
23617
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23618
+ * used to read every unassigned face on the hub no matter what the
23619
+ * caller asked for, because the only bound cut the finished clusters
23620
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23621
+ * whole corpus, on an addon whose disk is under contention.
23622
+ *
23623
+ * The pool is the NEWEST matching faces first — the same order the
23624
+ * gallery shows — so a bound here shortens the horizon, it does not
23625
+ * sample it randomly.
23626
+ *
23627
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23628
+ * so the live corpus — 372 face rows — is unaffected while the
23629
+ * unbounded scan can never come back as the table grows.
23630
+ */
23631
+ maxFacesScanned: number().int().positive().optional()
23632
+ }).optional(), array(FaceClusterSchema).readonly());
23444
23633
  /**
23445
23634
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23446
23635
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27198,6 +27387,39 @@ var ReadGopBytesResultSchema = object({
27198
27387
  /** Media ms the returned fragment covers. */
27199
27388
  gopDurMs: number()
27200
27389
  });
27390
+ /**
27391
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27392
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27393
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27394
+ * a replay needs several seconds of native pixels, not one frame.
27395
+ *
27396
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27397
+ * is `false` when the returned bytes were cut short by the read's own safety
27398
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27399
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27400
+ * degradation: a window whose end falls past the covering segment would need
27401
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27402
+ * not one standalone-demuxable stream — the caller's answer is to request a
27403
+ * shorter window or one aligned to a single segment, not to receive spliced
27404
+ * bytes nothing has proven decodable.
27405
+ */
27406
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27407
+ kind: literal("ok"),
27408
+ data: _instanceof(Uint8Array),
27409
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27410
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27411
+ gopStartMs: number(),
27412
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27413
+ gopDurMs: number(),
27414
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27415
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27416
+ reachesRequestedEnd: boolean()
27417
+ }), object({
27418
+ kind: literal("spans-multiple-segments"),
27419
+ /** Where the covering segment's own footage runs out — informational,
27420
+ * not a retry hint (retrying the same window would refuse again). */
27421
+ segmentEndMs: number()
27422
+ })]);
27201
27423
  method(object({
27202
27424
  deviceId: number(),
27203
27425
  fromMs: number(),
@@ -27248,6 +27470,15 @@ method(object({
27248
27470
  }), ReadGopBytesResultSchema, {
27249
27471
  kind: "query",
27250
27472
  auth: "admin"
27473
+ }), method(object({
27474
+ deviceId: number(),
27475
+ profile: string(),
27476
+ startMs: number(),
27477
+ fromMs: number(),
27478
+ toMs: number()
27479
+ }), ReadWindowBytesResultSchema, {
27480
+ kind: "query",
27481
+ auth: "admin"
27251
27482
  }), method(object({
27252
27483
  deviceId: number(),
27253
27484
  config: RecordingConfigSchema
@@ -28340,6 +28571,211 @@ var SetSiteLocationInputSchema = object({
28340
28571
  latitude: number().min(-90).max(90),
28341
28572
  longitude: number().min(-180).max(180)
28342
28573
  }).nullable();
28574
+ /**
28575
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28576
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28577
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28578
+ * already prints - never a token, never an `Authorization` header.
28579
+ */
28580
+ var RequestCensusGroupSchema = object({
28581
+ procedure: string(),
28582
+ userAgent: string(),
28583
+ ip: string(),
28584
+ principal: string(),
28585
+ calls: number(),
28586
+ perMin: number()
28587
+ });
28588
+ /**
28589
+ * A procedure's TOTAL over the window, across every caller.
28590
+ *
28591
+ * This block, not the group list, is what answers "did these calls arrive over
28592
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28593
+ * same window excludes the HTTP plane, which is a result, not a failure.
28594
+ */
28595
+ var RequestCensusProcedureSchema = object({
28596
+ procedure: string(),
28597
+ calls: number(),
28598
+ perMin: number()
28599
+ });
28600
+ /**
28601
+ * The census as an operator sees it.
28602
+ *
28603
+ * `persisted` is the honest answer to "will this survive the restart I am
28604
+ * about to do": the arm deadline is written to `system-settings` so a window
28605
+ * armed now can measure the NEXT boot, and a write that failed must not look
28606
+ * like one that succeeded.
28607
+ */
28608
+ var RequestCensusStatusSchema = object({
28609
+ armed: boolean(),
28610
+ /** How long the current - or just-closed - window collected, in ms. */
28611
+ elapsedMs: number(),
28612
+ /** The window actually armed, after the server clamped the request. */
28613
+ windowMs: number(),
28614
+ /** Epoch ms the window closes at. 0 when disarmed. */
28615
+ armedUntilMs: number(),
28616
+ httpRequests: number(),
28617
+ batchedRequests: number(),
28618
+ /**
28619
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28620
+ * is in play (`?batch=1` carries several procedures in one request); this is
28621
+ * the number comparable with a store-side call count.
28622
+ */
28623
+ procedureCalls: number(),
28624
+ /**
28625
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28626
+ * transport resolves one context per connection - but the number that says
28627
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28628
+ */
28629
+ wsConnections: number(),
28630
+ distinctGroups: number(),
28631
+ /** Calls counted in the totals whose group attribution was shed at the
28632
+ * cardinality bound. */
28633
+ unattributedCalls: number(),
28634
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28635
+ groups: array(RequestCensusGroupSchema).readonly()
28636
+ }).extend({ persisted: boolean() });
28637
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28638
+ var LogLevelSchema$1 = _enum([
28639
+ "debug",
28640
+ "info",
28641
+ "warn",
28642
+ "error"
28643
+ ]);
28644
+ /**
28645
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28646
+ *
28647
+ * A diagnostic is anything whose cost is only worth paying while a question is
28648
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28649
+ */
28650
+ var DiagnosticIdSchema = _enum(["request-census"]);
28651
+ /**
28652
+ * The layers of the level hierarchy, general → specific. The most specific
28653
+ * layer that carries an explicit value wins.
28654
+ *
28655
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28656
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28657
+ * grow later would force every consumer of this document to change with it.
28658
+ * Nothing returns `component` today.
28659
+ */
28660
+ var LoggingScopeKindSchema = _enum([
28661
+ "cluster",
28662
+ "node",
28663
+ "component"
28664
+ ]);
28665
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28666
+ var LoggingLevelSourceSchema = _enum([
28667
+ "default",
28668
+ "cluster",
28669
+ "node",
28670
+ "component"
28671
+ ]);
28672
+ /**
28673
+ * One layer of the hierarchy as it actually STANDS.
28674
+ *
28675
+ * `level: null` is the whole reason this array is returned: it is the
28676
+ * difference between "this node is at `info` because I decided it" and
28677
+ * "...because it inherits". An operator who clears an override believing they
28678
+ * are clearing an inherited value has been handed the same defect as the two
28679
+ * contradicting knobs this document exists to remove, moved one floor up.
28680
+ */
28681
+ var LoggingLevelLayerSchema = object({
28682
+ scope: LoggingScopeKindSchema,
28683
+ /** The node this layer speaks for; `null` on the cluster layer. */
28684
+ nodeId: string().nullable(),
28685
+ /** Explicitly set here, or `null` when this layer inherits. */
28686
+ level: LogLevelSchema$1.nullable()
28687
+ });
28688
+ /** What a line is judged against, and WHICH layer decided it. */
28689
+ var LoggingEffectiveSchema = object({
28690
+ level: LogLevelSchema$1,
28691
+ levelSource: LoggingLevelSourceSchema
28692
+ });
28693
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28694
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28695
+ /**
28696
+ * An armed diagnostic, with its DEADLINE.
28697
+ *
28698
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28699
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28700
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28701
+ * `armed` is false — a window is never reported as slightly expired.
28702
+ */
28703
+ var DiagnosticWindowSchema = object({
28704
+ id: DiagnosticIdSchema,
28705
+ armed: boolean(),
28706
+ /** Epoch ms the window closes at. 0 when disarmed. */
28707
+ armedUntilMs: number(),
28708
+ /** Ms left before it expires on its own. 0 when disarmed. */
28709
+ remainingMs: number(),
28710
+ /** Whether the stored deadline is the one the live diagnostic is running —
28711
+ * i.e. whether this window would survive a restart. */
28712
+ persisted: boolean()
28713
+ });
28714
+ /**
28715
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28716
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28717
+ * is a second knob that disagrees with the first the day one of them moves.
28718
+ */
28719
+ var DiagnosticWindowPatchSchema = object({
28720
+ id: DiagnosticIdSchema,
28721
+ armMs: number().int().min(0),
28722
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28723
+ reportEveryMs: number().int().positive().optional()
28724
+ });
28725
+ /**
28726
+ * A PATCH, and patches MERGE.
28727
+ *
28728
+ * A field absent from the patch is left exactly as it was — arming a
28729
+ * diagnostic never resets a level, and setting a level never disarms a window.
28730
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28731
+ * `setAll` already merges, and rebuilding the object is how an absent field
28732
+ * turns into an erased one.
28733
+ */
28734
+ var LoggingSettingsPatchSchema = object({
28735
+ /**
28736
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28737
+ * addressed scope so it inherits again. A value sets it.
28738
+ */
28739
+ level: LogLevelSchema$1.nullable().optional(),
28740
+ /**
28741
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28742
+ * keeps running — a patch is never a full replacement.
28743
+ */
28744
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28745
+ });
28746
+ /**
28747
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28748
+ *
28749
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28750
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28751
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28752
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28753
+ * by an agent that holds no cluster document at all. The hub is the single
28754
+ * authority over the whole hierarchy and answers for every layer, so the
28755
+ * layer selector needs a name the transport does not already own.
28756
+ */
28757
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28758
+ var SetLoggingSettingsInputSchema = object({
28759
+ scopeNodeId: string().optional(),
28760
+ patch: LoggingSettingsPatchSchema
28761
+ });
28762
+ /**
28763
+ * The whole document, as read and as returned after every write.
28764
+ *
28765
+ * `persisted: false` means the settings store could not be read or written.
28766
+ * The in-memory mirror still governs behaviour and is unchanged by the
28767
+ * failure — a read that fails neither switches a level nor disarms a window
28768
+ * (D49) — but the operator is told that what they are looking at would not
28769
+ * survive a restart.
28770
+ */
28771
+ var LoggingSettingsStateSchema = object({
28772
+ /** The layer this document was read at. `null` = the cluster layer. */
28773
+ scopeNodeId: string().nullable(),
28774
+ effective: LoggingEffectiveSchema,
28775
+ explicit: LoggingExplicitSchema,
28776
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28777
+ persisted: boolean()
28778
+ });
28343
28779
  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(), {
28344
28780
  kind: "mutation",
28345
28781
  auth: "admin"
@@ -28352,6 +28788,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28352
28788
  }), method(_void(), SiteLocationStatusSchema, {
28353
28789
  kind: "mutation",
28354
28790
  auth: "admin"
28791
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28792
+ kind: "mutation",
28793
+ auth: "admin"
28355
28794
  });
28356
28795
  /**
28357
28796
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33333,6 +33772,12 @@ Object.freeze({
33333
33772
  addonId: null,
33334
33773
  access: "view"
33335
33774
  },
33775
+ "notificationRules.resolveArtifactUrl": {
33776
+ capName: "notification-rules",
33777
+ capScope: "system",
33778
+ addonId: null,
33779
+ access: "view"
33780
+ },
33336
33781
  "notificationRules.setAlarmConfig": {
33337
33782
  capName: "notification-rules",
33338
33783
  capScope: "system",
@@ -34737,6 +35182,12 @@ Object.freeze({
34737
35182
  addonId: null,
34738
35183
  access: "view"
34739
35184
  },
35185
+ "recording.readWindowBytes": {
35186
+ capName: "recording",
35187
+ capScope: "system",
35188
+ addonId: null,
35189
+ access: "view"
35190
+ },
34740
35191
  "recording.refreshStorageLocationsForMigration": {
34741
35192
  capName: "recording",
34742
35193
  capScope: "system",
@@ -35577,6 +36028,18 @@ Object.freeze({
35577
36028
  addonId: null,
35578
36029
  access: "create"
35579
36030
  },
36031
+ "system.getLoggingSettings": {
36032
+ capName: "system",
36033
+ capScope: "system",
36034
+ addonId: null,
36035
+ access: "view"
36036
+ },
36037
+ "system.getRequestCensus": {
36038
+ capName: "system",
36039
+ capScope: "system",
36040
+ addonId: null,
36041
+ access: "view"
36042
+ },
35580
36043
  "system.getRetentionConfig": {
35581
36044
  capName: "system",
35582
36045
  capScope: "system",
@@ -35607,6 +36070,12 @@ Object.freeze({
35607
36070
  addonId: null,
35608
36071
  access: "view"
35609
36072
  },
36073
+ "system.setLoggingSettings": {
36074
+ capName: "system",
36075
+ capScope: "system",
36076
+ addonId: null,
36077
+ access: "create"
36078
+ },
35610
36079
  "system.setRetentionConfig": {
35611
36080
  capName: "system",
35612
36081
  capScope: "system",
@@ -36762,6 +37231,10 @@ Object.freeze({
36762
37231
  name: "deviceId",
36763
37232
  form: "single",
36764
37233
  optional: true
37234
+ }, {
37235
+ name: "deviceIds",
37236
+ form: "array",
37237
+ optional: true
36765
37238
  }],
36766
37239
  "fanControl.setDirection": [{
36767
37240
  name: "deviceId",
@@ -37567,6 +38040,11 @@ Object.freeze({
37567
38040
  form: "single",
37568
38041
  optional: false
37569
38042
  }],
38043
+ "recording.readWindowBytes": [{
38044
+ name: "deviceId",
38045
+ form: "single",
38046
+ optional: false
38047
+ }],
37570
38048
  "recording.relocateFootage": [{
37571
38049
  name: "deviceId",
37572
38050
  form: "single",
@@ -38367,7 +38845,38 @@ object({
38367
38845
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38368
38846
  * reproduce that.
38369
38847
  */
38370
- tileBudgetMb: number().int().min(0).max(1024)
38848
+ tileBudgetMb: number().int().min(0).max(1024),
38849
+ /**
38850
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38851
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38852
+ * subject tiles, on frames that detected something.
38853
+ *
38854
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38855
+ * containment is strict by design, so the native `keyFrame`, the detail
38856
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38857
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38858
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38859
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38860
+ *
38861
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38862
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38863
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38864
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38865
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38866
+ * binds only through a detection burst, where it still covers well past the
38867
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38868
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38869
+ * whole shape exists to avoid.
38870
+ *
38871
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38872
+ * subject tile, so one shared budget would let a busy camera's key frames
38873
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38874
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38875
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38876
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38877
+ * nothing.
38878
+ */
38879
+ sceneBudgetMb: number().int().min(0).max(1024)
38371
38880
  });
38372
38881
  /**
38373
38882
  * The values in force when the operator has set nothing.
@@ -38383,12 +38892,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38383
38892
  budgetMb: 1024,
38384
38893
  activityMs: 15e3,
38385
38894
  tileBudgetMb: 64,
38895
+ sceneBudgetMb: 48,
38386
38896
  admission: "inferred"
38387
38897
  };
38388
38898
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38389
38899
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38390
38900
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38391
38901
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38902
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38392
38903
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38393
38904
  var MB = 1024 * 1024;
38394
38905
  1024 * MB, 3072 * MB;