@camstack/addon-terminal 0.1.36 → 0.1.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.
Files changed (3) hide show
  1. package/dist/addon.js +577 -59
  2. package/dist/addon.mjs +577 -59
  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",
@@ -21345,7 +21415,7 @@ var lifecycleJobSchema = object({
21345
21415
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21346
21416
  * as every other cap.
21347
21417
  */
21348
- var LogLevelSchema$1 = _enum([
21418
+ var LogLevelSchema$2 = _enum([
21349
21419
  "debug",
21350
21420
  "info",
21351
21421
  "warn",
@@ -21552,7 +21622,7 @@ var CustomActionInputSchema = object({
21552
21622
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21553
21623
  addonId: string(),
21554
21624
  limit: number().min(1).max(500).default(100),
21555
- level: LogLevelSchema$1.optional()
21625
+ level: LogLevelSchema$2.optional()
21556
21626
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21557
21627
  packageName: string(),
21558
21628
  version: string().optional()
@@ -21650,7 +21720,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21650
21720
  auth: "admin"
21651
21721
  }), method(object({
21652
21722
  addonId: string(),
21653
- level: LogLevelSchema$1.optional()
21723
+ level: LogLevelSchema$2.optional()
21654
21724
  }), LogStreamEntrySchema, { kind: "subscription" });
21655
21725
  /**
21656
21726
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23374,6 +23444,35 @@ var FaceFilterEnum = _enum([
23374
23444
  "identified",
23375
23445
  "all"
23376
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
+ });
23377
23476
  var MediaFileLiteSchema$1 = object({
23378
23477
  key: string(),
23379
23478
  kind: string(),
@@ -23420,24 +23519,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23420
23519
  kind: "mutation",
23421
23520
  auth: "admin"
23422
23521
  }), method(object({
23423
- /** 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
+ */
23424
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(),
23425
23546
  limit: number().int().positive().optional(),
23426
23547
  filter: FaceFilterEnum.optional(),
23427
23548
  /**
23428
- * Inline the base64 crop on every row. Default `true` — the existing
23429
- * 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.
23430
23562
  *
23431
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23432
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23433
- * the browser cache the images.
23563
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23564
+ * does under `'suggestionConfidence'`.
23434
23565
  *
23435
- * **This is an INPUT field, so it does not reach the addon until the
23436
- * next train.** The hub router validates cap inputs against its own
23437
- * compiled Zod, which strips a key it does not know verified today
23438
- * on the OUTPUT side, where an additive field DOES arrive immediately
23439
- * (`Track.hasFace`). Until the train ships, sending `false` is
23440
- * 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.
23441
23588
  */
23442
23589
  includeCrops: boolean().optional()
23443
23590
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23473,13 +23620,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23473
23620
  }), method(object({
23474
23621
  threshold: number().min(0).max(1).optional(),
23475
23622
  minClusterSize: number().int().min(2).optional(),
23476
- limit: number().int().positive().optional()
23477
- }).optional(), array(object({
23478
- faceIds: array(string()).readonly(),
23479
- representativeFaceId: string(),
23480
- size: number().int(),
23481
- cohesion: number()
23482
- })).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());
23483
23656
  /**
23484
23657
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23485
23658
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28421,6 +28594,293 @@ var SetSiteLocationInputSchema = object({
28421
28594
  latitude: number().min(-90).max(90),
28422
28595
  longitude: number().min(-180).max(180)
28423
28596
  }).nullable();
28597
+ /**
28598
+ * The TRANSPORT a call arrived on.
28599
+ *
28600
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
28601
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
28602
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
28603
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
28604
+ * checkable rather than asserted.
28605
+ *
28606
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
28607
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
28608
+ * connection; the viewer talks to the hub over `wsLink`
28609
+ * exclusively, so this is the plane the HTTP census could not see.
28610
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
28611
+ * never touches a socket and therefore never touched a census.
28612
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
28613
+ * that is exactly what its `0` asserts: every plane the hub has can name
28614
+ * itself. It is an output bucket, never a knob — a call that arrives on a
28615
+ * plane nobody instrumented lands here instead of vanishing from the total.
28616
+ */
28617
+ var TransportPlaneSchema = _enum([
28618
+ "http",
28619
+ "ws",
28620
+ "mesh",
28621
+ "unknown"
28622
+ ]);
28623
+ /**
28624
+ * Calls per plane. Every key is always present, `0` included — an absent plane
28625
+ * reads as "not instrumented", which is the one thing this census must never
28626
+ * make an operator wonder about.
28627
+ */
28628
+ var TransportPlaneCountsSchema = object({
28629
+ http: number(),
28630
+ ws: number(),
28631
+ mesh: number(),
28632
+ unknown: number()
28633
+ });
28634
+ /**
28635
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
28636
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28637
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28638
+ * already prints - never a token, never an `Authorization` header.
28639
+ *
28640
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
28641
+ * and lives for hours, so folding it into a call count makes one long-lived
28642
+ * stream look like a storm.
28643
+ */
28644
+ var RequestCensusGroupSchema = object({
28645
+ plane: TransportPlaneSchema,
28646
+ procedure: string(),
28647
+ userAgent: string(),
28648
+ ip: string(),
28649
+ principal: string(),
28650
+ calls: number(),
28651
+ subscriptions: number(),
28652
+ perMin: number()
28653
+ });
28654
+ /**
28655
+ * A procedure's TOTAL over the window, across every caller.
28656
+ *
28657
+ * This block, not the group list, is what answers "did these calls arrive over
28658
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28659
+ * same window excludes the HTTP plane, which is a result, not a failure.
28660
+ */
28661
+ var RequestCensusProcedureSchema = object({
28662
+ procedure: string(),
28663
+ calls: number(),
28664
+ /**
28665
+ * The same total, split by transport. THIS is the row that answers the
28666
+ * question the census exists for: one look at `deviceManager.listAll` says
28667
+ * which plane carried the 4 960, without joining two log lines by eye.
28668
+ */
28669
+ planes: TransportPlaneCountsSchema,
28670
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
28671
+ subscriptions: number(),
28672
+ perMin: number()
28673
+ });
28674
+ /**
28675
+ * The census as an operator sees it.
28676
+ *
28677
+ * `persisted` is the honest answer to "will this survive the restart I am
28678
+ * about to do": the arm deadline is written to `system-settings` so a window
28679
+ * armed now can measure the NEXT boot, and a write that failed must not look
28680
+ * like one that succeeded.
28681
+ */
28682
+ var RequestCensusStatusSchema = object({
28683
+ armed: boolean(),
28684
+ /** How long the current - or just-closed - window collected, in ms. */
28685
+ elapsedMs: number(),
28686
+ /** The window actually armed, after the server clamped the request. */
28687
+ windowMs: number(),
28688
+ /** Epoch ms the window closes at. 0 when disarmed. */
28689
+ armedUntilMs: number(),
28690
+ httpRequests: number(),
28691
+ batchedRequests: number(),
28692
+ /**
28693
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28694
+ * is in play (`?batch=1` carries several procedures in one request); this is
28695
+ * the number comparable with a store-side call count.
28696
+ */
28697
+ procedureCalls: number(),
28698
+ /**
28699
+ * `procedureCalls` split by transport. The four keys sum to
28700
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
28701
+ * `planesExplainTotal` is that identity, checked rather than assumed.
28702
+ */
28703
+ planes: TransportPlaneCountsSchema,
28704
+ /**
28705
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
28706
+ * on no plane at all - which is a RESULT (a plane is missing from the
28707
+ * instrument), not a failure, and it has to be visible to be read as one.
28708
+ */
28709
+ planesExplainTotal: boolean(),
28710
+ /**
28711
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28712
+ * adapter resolves one context per connection - kept because a plane's call
28713
+ * count of zero against 37 open connections says something different from a
28714
+ * plane with no connections at all.
28715
+ */
28716
+ wsConnections: number(),
28717
+ /**
28718
+ * Client frames the WS plane looked at. `wsMessages` far above
28719
+ * `planes.ws + subscriptions` means most traffic is not operations
28720
+ * (keepalives, connection params) - which is itself an answer.
28721
+ */
28722
+ wsMessages: number(),
28723
+ /**
28724
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
28725
+ * purpose: one live-events stream opened at boot and held for six hours is
28726
+ * one subscription, and counting it as a call would let a quiet plane
28727
+ * masquerade as the storm.
28728
+ */
28729
+ subscriptions: number(),
28730
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
28731
+ subscriptionStops: number(),
28732
+ distinctGroups: number(),
28733
+ /**
28734
+ * Operations counted in the totals whose CALLER attribution was shed at the
28735
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
28736
+ * which transport they arrived on, they just lost their group row.
28737
+ */
28738
+ unattributedCalls: number(),
28739
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28740
+ groups: array(RequestCensusGroupSchema).readonly()
28741
+ }).extend({ persisted: boolean() });
28742
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28743
+ var LogLevelSchema$1 = _enum([
28744
+ "debug",
28745
+ "info",
28746
+ "warn",
28747
+ "error"
28748
+ ]);
28749
+ /**
28750
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28751
+ *
28752
+ * A diagnostic is anything whose cost is only worth paying while a question is
28753
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28754
+ */
28755
+ var DiagnosticIdSchema = _enum(["request-census"]);
28756
+ /**
28757
+ * The layers of the level hierarchy, general → specific. The most specific
28758
+ * layer that carries an explicit value wins.
28759
+ *
28760
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28761
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28762
+ * grow later would force every consumer of this document to change with it.
28763
+ * Nothing returns `component` today.
28764
+ */
28765
+ var LoggingScopeKindSchema = _enum([
28766
+ "cluster",
28767
+ "node",
28768
+ "component"
28769
+ ]);
28770
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28771
+ var LoggingLevelSourceSchema = _enum([
28772
+ "default",
28773
+ "cluster",
28774
+ "node",
28775
+ "component"
28776
+ ]);
28777
+ /**
28778
+ * One layer of the hierarchy as it actually STANDS.
28779
+ *
28780
+ * `level: null` is the whole reason this array is returned: it is the
28781
+ * difference between "this node is at `info` because I decided it" and
28782
+ * "...because it inherits". An operator who clears an override believing they
28783
+ * are clearing an inherited value has been handed the same defect as the two
28784
+ * contradicting knobs this document exists to remove, moved one floor up.
28785
+ */
28786
+ var LoggingLevelLayerSchema = object({
28787
+ scope: LoggingScopeKindSchema,
28788
+ /** The node this layer speaks for; `null` on the cluster layer. */
28789
+ nodeId: string().nullable(),
28790
+ /** Explicitly set here, or `null` when this layer inherits. */
28791
+ level: LogLevelSchema$1.nullable()
28792
+ });
28793
+ /** What a line is judged against, and WHICH layer decided it. */
28794
+ var LoggingEffectiveSchema = object({
28795
+ level: LogLevelSchema$1,
28796
+ levelSource: LoggingLevelSourceSchema
28797
+ });
28798
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28799
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28800
+ /**
28801
+ * An armed diagnostic, with its DEADLINE.
28802
+ *
28803
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28804
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28805
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28806
+ * `armed` is false — a window is never reported as slightly expired.
28807
+ */
28808
+ var DiagnosticWindowSchema = object({
28809
+ id: DiagnosticIdSchema,
28810
+ armed: boolean(),
28811
+ /** Epoch ms the window closes at. 0 when disarmed. */
28812
+ armedUntilMs: number(),
28813
+ /** Ms left before it expires on its own. 0 when disarmed. */
28814
+ remainingMs: number(),
28815
+ /** Whether the stored deadline is the one the live diagnostic is running —
28816
+ * i.e. whether this window would survive a restart. */
28817
+ persisted: boolean()
28818
+ });
28819
+ /**
28820
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28821
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28822
+ * is a second knob that disagrees with the first the day one of them moves.
28823
+ */
28824
+ var DiagnosticWindowPatchSchema = object({
28825
+ id: DiagnosticIdSchema,
28826
+ armMs: number().int().min(0),
28827
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28828
+ reportEveryMs: number().int().positive().optional()
28829
+ });
28830
+ /**
28831
+ * A PATCH, and patches MERGE.
28832
+ *
28833
+ * A field absent from the patch is left exactly as it was — arming a
28834
+ * diagnostic never resets a level, and setting a level never disarms a window.
28835
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28836
+ * `setAll` already merges, and rebuilding the object is how an absent field
28837
+ * turns into an erased one.
28838
+ */
28839
+ var LoggingSettingsPatchSchema = object({
28840
+ /**
28841
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28842
+ * addressed scope so it inherits again. A value sets it.
28843
+ */
28844
+ level: LogLevelSchema$1.nullable().optional(),
28845
+ /**
28846
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28847
+ * keeps running — a patch is never a full replacement.
28848
+ */
28849
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28850
+ });
28851
+ /**
28852
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28853
+ *
28854
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28855
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28856
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28857
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28858
+ * by an agent that holds no cluster document at all. The hub is the single
28859
+ * authority over the whole hierarchy and answers for every layer, so the
28860
+ * layer selector needs a name the transport does not already own.
28861
+ */
28862
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28863
+ var SetLoggingSettingsInputSchema = object({
28864
+ scopeNodeId: string().optional(),
28865
+ patch: LoggingSettingsPatchSchema
28866
+ });
28867
+ /**
28868
+ * The whole document, as read and as returned after every write.
28869
+ *
28870
+ * `persisted: false` means the settings store could not be read or written.
28871
+ * The in-memory mirror still governs behaviour and is unchanged by the
28872
+ * failure — a read that fails neither switches a level nor disarms a window
28873
+ * (D49) — but the operator is told that what they are looking at would not
28874
+ * survive a restart.
28875
+ */
28876
+ var LoggingSettingsStateSchema = object({
28877
+ /** The layer this document was read at. `null` = the cluster layer. */
28878
+ scopeNodeId: string().nullable(),
28879
+ effective: LoggingEffectiveSchema,
28880
+ explicit: LoggingExplicitSchema,
28881
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28882
+ persisted: boolean()
28883
+ });
28424
28884
  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(), {
28425
28885
  kind: "mutation",
28426
28886
  auth: "admin"
@@ -28433,6 +28893,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28433
28893
  }), method(_void(), SiteLocationStatusSchema, {
28434
28894
  kind: "mutation",
28435
28895
  auth: "admin"
28896
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28897
+ kind: "mutation",
28898
+ auth: "admin"
28436
28899
  });
28437
28900
  /**
28438
28901
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35670,6 +36133,18 @@ Object.freeze({
35670
36133
  addonId: null,
35671
36134
  access: "create"
35672
36135
  },
36136
+ "system.getLoggingSettings": {
36137
+ capName: "system",
36138
+ capScope: "system",
36139
+ addonId: null,
36140
+ access: "view"
36141
+ },
36142
+ "system.getRequestCensus": {
36143
+ capName: "system",
36144
+ capScope: "system",
36145
+ addonId: null,
36146
+ access: "view"
36147
+ },
35673
36148
  "system.getRetentionConfig": {
35674
36149
  capName: "system",
35675
36150
  capScope: "system",
@@ -35700,6 +36175,12 @@ Object.freeze({
35700
36175
  addonId: null,
35701
36176
  access: "view"
35702
36177
  },
36178
+ "system.setLoggingSettings": {
36179
+ capName: "system",
36180
+ capScope: "system",
36181
+ addonId: null,
36182
+ access: "create"
36183
+ },
35703
36184
  "system.setRetentionConfig": {
35704
36185
  capName: "system",
35705
36186
  capScope: "system",
@@ -36855,6 +37336,10 @@ Object.freeze({
36855
37336
  name: "deviceId",
36856
37337
  form: "single",
36857
37338
  optional: true
37339
+ }, {
37340
+ name: "deviceIds",
37341
+ form: "array",
37342
+ optional: true
36858
37343
  }],
36859
37344
  "fanControl.setDirection": [{
36860
37345
  name: "deviceId",
@@ -38465,7 +38950,38 @@ object({
38465
38950
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38466
38951
  * reproduce that.
38467
38952
  */
38468
- tileBudgetMb: number().int().min(0).max(1024)
38953
+ tileBudgetMb: number().int().min(0).max(1024),
38954
+ /**
38955
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38956
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38957
+ * subject tiles, on frames that detected something.
38958
+ *
38959
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38960
+ * containment is strict by design, so the native `keyFrame`, the detail
38961
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38962
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38963
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38964
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38965
+ *
38966
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38967
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38968
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38969
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38970
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38971
+ * binds only through a detection burst, where it still covers well past the
38972
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38973
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38974
+ * whole shape exists to avoid.
38975
+ *
38976
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38977
+ * subject tile, so one shared budget would let a busy camera's key frames
38978
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38979
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38980
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38981
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38982
+ * nothing.
38983
+ */
38984
+ sceneBudgetMb: number().int().min(0).max(1024)
38469
38985
  });
38470
38986
  /**
38471
38987
  * The values in force when the operator has set nothing.
@@ -38481,12 +38997,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38481
38997
  budgetMb: 1024,
38482
38998
  activityMs: 15e3,
38483
38999
  tileBudgetMb: 64,
39000
+ sceneBudgetMb: 48,
38484
39001
  admission: "inferred"
38485
39002
  };
38486
39003
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38487
39004
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38488
39005
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38489
39006
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39007
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38490
39008
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38491
39009
  var MB = 1024 * 1024;
38492
39010
  1024 * MB, 3072 * MB;