@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.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",
@@ -21322,7 +21392,7 @@ var lifecycleJobSchema = object({
21322
21392
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21323
21393
  * as every other cap.
21324
21394
  */
21325
- var LogLevelSchema$1 = _enum([
21395
+ var LogLevelSchema$2 = _enum([
21326
21396
  "debug",
21327
21397
  "info",
21328
21398
  "warn",
@@ -21529,7 +21599,7 @@ var CustomActionInputSchema = object({
21529
21599
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21530
21600
  addonId: string(),
21531
21601
  limit: number().min(1).max(500).default(100),
21532
- level: LogLevelSchema$1.optional()
21602
+ level: LogLevelSchema$2.optional()
21533
21603
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21534
21604
  packageName: string(),
21535
21605
  version: string().optional()
@@ -21627,7 +21697,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21627
21697
  auth: "admin"
21628
21698
  }), method(object({
21629
21699
  addonId: string(),
21630
- level: LogLevelSchema$1.optional()
21700
+ level: LogLevelSchema$2.optional()
21631
21701
  }), LogStreamEntrySchema, { kind: "subscription" });
21632
21702
  /**
21633
21703
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23351,6 +23421,35 @@ var FaceFilterEnum = _enum([
23351
23421
  "identified",
23352
23422
  "all"
23353
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
+ });
23354
23453
  var MediaFileLiteSchema$1 = object({
23355
23454
  key: string(),
23356
23455
  kind: string(),
@@ -23397,24 +23496,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23397
23496
  kind: "mutation",
23398
23497
  auth: "admin"
23399
23498
  }), method(object({
23400
- /** 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
+ */
23401
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(),
23402
23523
  limit: number().int().positive().optional(),
23403
23524
  filter: FaceFilterEnum.optional(),
23404
23525
  /**
23405
- * Inline the base64 crop on every row. Default `true` — the existing
23406
- * 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.
23407
23539
  *
23408
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23409
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23410
- * the browser cache the images.
23540
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23541
+ * does under `'suggestionConfidence'`.
23411
23542
  *
23412
- * **This is an INPUT field, so it does not reach the addon until the
23413
- * next train.** The hub router validates cap inputs against its own
23414
- * compiled Zod, which strips a key it does not know verified today
23415
- * on the OUTPUT side, where an additive field DOES arrive immediately
23416
- * (`Track.hasFace`). Until the train ships, sending `false` is
23417
- * 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.
23418
23565
  */
23419
23566
  includeCrops: boolean().optional()
23420
23567
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23450,13 +23597,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23450
23597
  }), method(object({
23451
23598
  threshold: number().min(0).max(1).optional(),
23452
23599
  minClusterSize: number().int().min(2).optional(),
23453
- limit: number().int().positive().optional()
23454
- }).optional(), array(object({
23455
- faceIds: array(string()).readonly(),
23456
- representativeFaceId: string(),
23457
- size: number().int(),
23458
- cohesion: number()
23459
- })).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());
23460
23633
  /**
23461
23634
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23462
23635
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28398,6 +28571,293 @@ var SetSiteLocationInputSchema = object({
28398
28571
  latitude: number().min(-90).max(90),
28399
28572
  longitude: number().min(-180).max(180)
28400
28573
  }).nullable();
28574
+ /**
28575
+ * The TRANSPORT a call arrived on.
28576
+ *
28577
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
28578
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
28579
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
28580
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
28581
+ * checkable rather than asserted.
28582
+ *
28583
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
28584
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
28585
+ * connection; the viewer talks to the hub over `wsLink`
28586
+ * exclusively, so this is the plane the HTTP census could not see.
28587
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
28588
+ * never touches a socket and therefore never touched a census.
28589
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
28590
+ * that is exactly what its `0` asserts: every plane the hub has can name
28591
+ * itself. It is an output bucket, never a knob — a call that arrives on a
28592
+ * plane nobody instrumented lands here instead of vanishing from the total.
28593
+ */
28594
+ var TransportPlaneSchema = _enum([
28595
+ "http",
28596
+ "ws",
28597
+ "mesh",
28598
+ "unknown"
28599
+ ]);
28600
+ /**
28601
+ * Calls per plane. Every key is always present, `0` included — an absent plane
28602
+ * reads as "not instrumented", which is the one thing this census must never
28603
+ * make an operator wonder about.
28604
+ */
28605
+ var TransportPlaneCountsSchema = object({
28606
+ http: number(),
28607
+ ws: number(),
28608
+ mesh: number(),
28609
+ unknown: number()
28610
+ });
28611
+ /**
28612
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
28613
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28614
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28615
+ * already prints - never a token, never an `Authorization` header.
28616
+ *
28617
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
28618
+ * and lives for hours, so folding it into a call count makes one long-lived
28619
+ * stream look like a storm.
28620
+ */
28621
+ var RequestCensusGroupSchema = object({
28622
+ plane: TransportPlaneSchema,
28623
+ procedure: string(),
28624
+ userAgent: string(),
28625
+ ip: string(),
28626
+ principal: string(),
28627
+ calls: number(),
28628
+ subscriptions: number(),
28629
+ perMin: number()
28630
+ });
28631
+ /**
28632
+ * A procedure's TOTAL over the window, across every caller.
28633
+ *
28634
+ * This block, not the group list, is what answers "did these calls arrive over
28635
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28636
+ * same window excludes the HTTP plane, which is a result, not a failure.
28637
+ */
28638
+ var RequestCensusProcedureSchema = object({
28639
+ procedure: string(),
28640
+ calls: number(),
28641
+ /**
28642
+ * The same total, split by transport. THIS is the row that answers the
28643
+ * question the census exists for: one look at `deviceManager.listAll` says
28644
+ * which plane carried the 4 960, without joining two log lines by eye.
28645
+ */
28646
+ planes: TransportPlaneCountsSchema,
28647
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
28648
+ subscriptions: number(),
28649
+ perMin: number()
28650
+ });
28651
+ /**
28652
+ * The census as an operator sees it.
28653
+ *
28654
+ * `persisted` is the honest answer to "will this survive the restart I am
28655
+ * about to do": the arm deadline is written to `system-settings` so a window
28656
+ * armed now can measure the NEXT boot, and a write that failed must not look
28657
+ * like one that succeeded.
28658
+ */
28659
+ var RequestCensusStatusSchema = object({
28660
+ armed: boolean(),
28661
+ /** How long the current - or just-closed - window collected, in ms. */
28662
+ elapsedMs: number(),
28663
+ /** The window actually armed, after the server clamped the request. */
28664
+ windowMs: number(),
28665
+ /** Epoch ms the window closes at. 0 when disarmed. */
28666
+ armedUntilMs: number(),
28667
+ httpRequests: number(),
28668
+ batchedRequests: number(),
28669
+ /**
28670
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28671
+ * is in play (`?batch=1` carries several procedures in one request); this is
28672
+ * the number comparable with a store-side call count.
28673
+ */
28674
+ procedureCalls: number(),
28675
+ /**
28676
+ * `procedureCalls` split by transport. The four keys sum to
28677
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
28678
+ * `planesExplainTotal` is that identity, checked rather than assumed.
28679
+ */
28680
+ planes: TransportPlaneCountsSchema,
28681
+ /**
28682
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
28683
+ * on no plane at all - which is a RESULT (a plane is missing from the
28684
+ * instrument), not a failure, and it has to be visible to be read as one.
28685
+ */
28686
+ planesExplainTotal: boolean(),
28687
+ /**
28688
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28689
+ * adapter resolves one context per connection - kept because a plane's call
28690
+ * count of zero against 37 open connections says something different from a
28691
+ * plane with no connections at all.
28692
+ */
28693
+ wsConnections: number(),
28694
+ /**
28695
+ * Client frames the WS plane looked at. `wsMessages` far above
28696
+ * `planes.ws + subscriptions` means most traffic is not operations
28697
+ * (keepalives, connection params) - which is itself an answer.
28698
+ */
28699
+ wsMessages: number(),
28700
+ /**
28701
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
28702
+ * purpose: one live-events stream opened at boot and held for six hours is
28703
+ * one subscription, and counting it as a call would let a quiet plane
28704
+ * masquerade as the storm.
28705
+ */
28706
+ subscriptions: number(),
28707
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
28708
+ subscriptionStops: number(),
28709
+ distinctGroups: number(),
28710
+ /**
28711
+ * Operations counted in the totals whose CALLER attribution was shed at the
28712
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
28713
+ * which transport they arrived on, they just lost their group row.
28714
+ */
28715
+ unattributedCalls: number(),
28716
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28717
+ groups: array(RequestCensusGroupSchema).readonly()
28718
+ }).extend({ persisted: boolean() });
28719
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28720
+ var LogLevelSchema$1 = _enum([
28721
+ "debug",
28722
+ "info",
28723
+ "warn",
28724
+ "error"
28725
+ ]);
28726
+ /**
28727
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28728
+ *
28729
+ * A diagnostic is anything whose cost is only worth paying while a question is
28730
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28731
+ */
28732
+ var DiagnosticIdSchema = _enum(["request-census"]);
28733
+ /**
28734
+ * The layers of the level hierarchy, general → specific. The most specific
28735
+ * layer that carries an explicit value wins.
28736
+ *
28737
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28738
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28739
+ * grow later would force every consumer of this document to change with it.
28740
+ * Nothing returns `component` today.
28741
+ */
28742
+ var LoggingScopeKindSchema = _enum([
28743
+ "cluster",
28744
+ "node",
28745
+ "component"
28746
+ ]);
28747
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28748
+ var LoggingLevelSourceSchema = _enum([
28749
+ "default",
28750
+ "cluster",
28751
+ "node",
28752
+ "component"
28753
+ ]);
28754
+ /**
28755
+ * One layer of the hierarchy as it actually STANDS.
28756
+ *
28757
+ * `level: null` is the whole reason this array is returned: it is the
28758
+ * difference between "this node is at `info` because I decided it" and
28759
+ * "...because it inherits". An operator who clears an override believing they
28760
+ * are clearing an inherited value has been handed the same defect as the two
28761
+ * contradicting knobs this document exists to remove, moved one floor up.
28762
+ */
28763
+ var LoggingLevelLayerSchema = object({
28764
+ scope: LoggingScopeKindSchema,
28765
+ /** The node this layer speaks for; `null` on the cluster layer. */
28766
+ nodeId: string().nullable(),
28767
+ /** Explicitly set here, or `null` when this layer inherits. */
28768
+ level: LogLevelSchema$1.nullable()
28769
+ });
28770
+ /** What a line is judged against, and WHICH layer decided it. */
28771
+ var LoggingEffectiveSchema = object({
28772
+ level: LogLevelSchema$1,
28773
+ levelSource: LoggingLevelSourceSchema
28774
+ });
28775
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28776
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28777
+ /**
28778
+ * An armed diagnostic, with its DEADLINE.
28779
+ *
28780
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28781
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28782
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28783
+ * `armed` is false — a window is never reported as slightly expired.
28784
+ */
28785
+ var DiagnosticWindowSchema = object({
28786
+ id: DiagnosticIdSchema,
28787
+ armed: boolean(),
28788
+ /** Epoch ms the window closes at. 0 when disarmed. */
28789
+ armedUntilMs: number(),
28790
+ /** Ms left before it expires on its own. 0 when disarmed. */
28791
+ remainingMs: number(),
28792
+ /** Whether the stored deadline is the one the live diagnostic is running —
28793
+ * i.e. whether this window would survive a restart. */
28794
+ persisted: boolean()
28795
+ });
28796
+ /**
28797
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28798
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28799
+ * is a second knob that disagrees with the first the day one of them moves.
28800
+ */
28801
+ var DiagnosticWindowPatchSchema = object({
28802
+ id: DiagnosticIdSchema,
28803
+ armMs: number().int().min(0),
28804
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28805
+ reportEveryMs: number().int().positive().optional()
28806
+ });
28807
+ /**
28808
+ * A PATCH, and patches MERGE.
28809
+ *
28810
+ * A field absent from the patch is left exactly as it was — arming a
28811
+ * diagnostic never resets a level, and setting a level never disarms a window.
28812
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28813
+ * `setAll` already merges, and rebuilding the object is how an absent field
28814
+ * turns into an erased one.
28815
+ */
28816
+ var LoggingSettingsPatchSchema = object({
28817
+ /**
28818
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28819
+ * addressed scope so it inherits again. A value sets it.
28820
+ */
28821
+ level: LogLevelSchema$1.nullable().optional(),
28822
+ /**
28823
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28824
+ * keeps running — a patch is never a full replacement.
28825
+ */
28826
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28827
+ });
28828
+ /**
28829
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28830
+ *
28831
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28832
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28833
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28834
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28835
+ * by an agent that holds no cluster document at all. The hub is the single
28836
+ * authority over the whole hierarchy and answers for every layer, so the
28837
+ * layer selector needs a name the transport does not already own.
28838
+ */
28839
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28840
+ var SetLoggingSettingsInputSchema = object({
28841
+ scopeNodeId: string().optional(),
28842
+ patch: LoggingSettingsPatchSchema
28843
+ });
28844
+ /**
28845
+ * The whole document, as read and as returned after every write.
28846
+ *
28847
+ * `persisted: false` means the settings store could not be read or written.
28848
+ * The in-memory mirror still governs behaviour and is unchanged by the
28849
+ * failure — a read that fails neither switches a level nor disarms a window
28850
+ * (D49) — but the operator is told that what they are looking at would not
28851
+ * survive a restart.
28852
+ */
28853
+ var LoggingSettingsStateSchema = object({
28854
+ /** The layer this document was read at. `null` = the cluster layer. */
28855
+ scopeNodeId: string().nullable(),
28856
+ effective: LoggingEffectiveSchema,
28857
+ explicit: LoggingExplicitSchema,
28858
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28859
+ persisted: boolean()
28860
+ });
28401
28861
  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(), {
28402
28862
  kind: "mutation",
28403
28863
  auth: "admin"
@@ -28410,6 +28870,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28410
28870
  }), method(_void(), SiteLocationStatusSchema, {
28411
28871
  kind: "mutation",
28412
28872
  auth: "admin"
28873
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28874
+ kind: "mutation",
28875
+ auth: "admin"
28413
28876
  });
28414
28877
  /**
28415
28878
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35647,6 +36110,18 @@ Object.freeze({
35647
36110
  addonId: null,
35648
36111
  access: "create"
35649
36112
  },
36113
+ "system.getLoggingSettings": {
36114
+ capName: "system",
36115
+ capScope: "system",
36116
+ addonId: null,
36117
+ access: "view"
36118
+ },
36119
+ "system.getRequestCensus": {
36120
+ capName: "system",
36121
+ capScope: "system",
36122
+ addonId: null,
36123
+ access: "view"
36124
+ },
35650
36125
  "system.getRetentionConfig": {
35651
36126
  capName: "system",
35652
36127
  capScope: "system",
@@ -35677,6 +36152,12 @@ Object.freeze({
35677
36152
  addonId: null,
35678
36153
  access: "view"
35679
36154
  },
36155
+ "system.setLoggingSettings": {
36156
+ capName: "system",
36157
+ capScope: "system",
36158
+ addonId: null,
36159
+ access: "create"
36160
+ },
35680
36161
  "system.setRetentionConfig": {
35681
36162
  capName: "system",
35682
36163
  capScope: "system",
@@ -36832,6 +37313,10 @@ Object.freeze({
36832
37313
  name: "deviceId",
36833
37314
  form: "single",
36834
37315
  optional: true
37316
+ }, {
37317
+ name: "deviceIds",
37318
+ form: "array",
37319
+ optional: true
36835
37320
  }],
36836
37321
  "fanControl.setDirection": [{
36837
37322
  name: "deviceId",
@@ -38442,7 +38927,38 @@ object({
38442
38927
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38443
38928
  * reproduce that.
38444
38929
  */
38445
- tileBudgetMb: number().int().min(0).max(1024)
38930
+ tileBudgetMb: number().int().min(0).max(1024),
38931
+ /**
38932
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38933
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38934
+ * subject tiles, on frames that detected something.
38935
+ *
38936
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38937
+ * containment is strict by design, so the native `keyFrame`, the detail
38938
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38939
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38940
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38941
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38942
+ *
38943
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38944
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38945
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38946
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38947
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38948
+ * binds only through a detection burst, where it still covers well past the
38949
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38950
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38951
+ * whole shape exists to avoid.
38952
+ *
38953
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38954
+ * subject tile, so one shared budget would let a busy camera's key frames
38955
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38956
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38957
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38958
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38959
+ * nothing.
38960
+ */
38961
+ sceneBudgetMb: number().int().min(0).max(1024)
38446
38962
  });
38447
38963
  /**
38448
38964
  * The values in force when the operator has set nothing.
@@ -38458,12 +38974,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38458
38974
  budgetMb: 1024,
38459
38975
  activityMs: 15e3,
38460
38976
  tileBudgetMb: 64,
38977
+ sceneBudgetMb: 48,
38461
38978
  admission: "inferred"
38462
38979
  };
38463
38980
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38464
38981
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38465
38982
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38466
38983
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38984
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38467
38985
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38468
38986
  var MB = 1024 * 1024;
38469
38987
  1024 * MB, 3072 * MB;