@camstack/addon-terminal 0.1.36 → 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 +495 -59
  2. package/dist/addon.mjs +495 -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,211 @@ var SetSiteLocationInputSchema = object({
28421
28594
  latitude: number().min(-90).max(90),
28422
28595
  longitude: number().min(-180).max(180)
28423
28596
  }).nullable();
28597
+ /**
28598
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28599
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28600
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28601
+ * already prints - never a token, never an `Authorization` header.
28602
+ */
28603
+ var RequestCensusGroupSchema = object({
28604
+ procedure: string(),
28605
+ userAgent: string(),
28606
+ ip: string(),
28607
+ principal: string(),
28608
+ calls: number(),
28609
+ perMin: number()
28610
+ });
28611
+ /**
28612
+ * A procedure's TOTAL over the window, across every caller.
28613
+ *
28614
+ * This block, not the group list, is what answers "did these calls arrive over
28615
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28616
+ * same window excludes the HTTP plane, which is a result, not a failure.
28617
+ */
28618
+ var RequestCensusProcedureSchema = object({
28619
+ procedure: string(),
28620
+ calls: number(),
28621
+ perMin: number()
28622
+ });
28623
+ /**
28624
+ * The census as an operator sees it.
28625
+ *
28626
+ * `persisted` is the honest answer to "will this survive the restart I am
28627
+ * about to do": the arm deadline is written to `system-settings` so a window
28628
+ * armed now can measure the NEXT boot, and a write that failed must not look
28629
+ * like one that succeeded.
28630
+ */
28631
+ var RequestCensusStatusSchema = object({
28632
+ armed: boolean(),
28633
+ /** How long the current - or just-closed - window collected, in ms. */
28634
+ elapsedMs: number(),
28635
+ /** The window actually armed, after the server clamped the request. */
28636
+ windowMs: number(),
28637
+ /** Epoch ms the window closes at. 0 when disarmed. */
28638
+ armedUntilMs: number(),
28639
+ httpRequests: number(),
28640
+ batchedRequests: number(),
28641
+ /**
28642
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28643
+ * is in play (`?batch=1` carries several procedures in one request); this is
28644
+ * the number comparable with a store-side call count.
28645
+ */
28646
+ procedureCalls: number(),
28647
+ /**
28648
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28649
+ * transport resolves one context per connection - but the number that says
28650
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28651
+ */
28652
+ wsConnections: number(),
28653
+ distinctGroups: number(),
28654
+ /** Calls counted in the totals whose group attribution was shed at the
28655
+ * cardinality bound. */
28656
+ unattributedCalls: number(),
28657
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28658
+ groups: array(RequestCensusGroupSchema).readonly()
28659
+ }).extend({ persisted: boolean() });
28660
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28661
+ var LogLevelSchema$1 = _enum([
28662
+ "debug",
28663
+ "info",
28664
+ "warn",
28665
+ "error"
28666
+ ]);
28667
+ /**
28668
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28669
+ *
28670
+ * A diagnostic is anything whose cost is only worth paying while a question is
28671
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28672
+ */
28673
+ var DiagnosticIdSchema = _enum(["request-census"]);
28674
+ /**
28675
+ * The layers of the level hierarchy, general → specific. The most specific
28676
+ * layer that carries an explicit value wins.
28677
+ *
28678
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28679
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28680
+ * grow later would force every consumer of this document to change with it.
28681
+ * Nothing returns `component` today.
28682
+ */
28683
+ var LoggingScopeKindSchema = _enum([
28684
+ "cluster",
28685
+ "node",
28686
+ "component"
28687
+ ]);
28688
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28689
+ var LoggingLevelSourceSchema = _enum([
28690
+ "default",
28691
+ "cluster",
28692
+ "node",
28693
+ "component"
28694
+ ]);
28695
+ /**
28696
+ * One layer of the hierarchy as it actually STANDS.
28697
+ *
28698
+ * `level: null` is the whole reason this array is returned: it is the
28699
+ * difference between "this node is at `info` because I decided it" and
28700
+ * "...because it inherits". An operator who clears an override believing they
28701
+ * are clearing an inherited value has been handed the same defect as the two
28702
+ * contradicting knobs this document exists to remove, moved one floor up.
28703
+ */
28704
+ var LoggingLevelLayerSchema = object({
28705
+ scope: LoggingScopeKindSchema,
28706
+ /** The node this layer speaks for; `null` on the cluster layer. */
28707
+ nodeId: string().nullable(),
28708
+ /** Explicitly set here, or `null` when this layer inherits. */
28709
+ level: LogLevelSchema$1.nullable()
28710
+ });
28711
+ /** What a line is judged against, and WHICH layer decided it. */
28712
+ var LoggingEffectiveSchema = object({
28713
+ level: LogLevelSchema$1,
28714
+ levelSource: LoggingLevelSourceSchema
28715
+ });
28716
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28717
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28718
+ /**
28719
+ * An armed diagnostic, with its DEADLINE.
28720
+ *
28721
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28722
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28723
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28724
+ * `armed` is false — a window is never reported as slightly expired.
28725
+ */
28726
+ var DiagnosticWindowSchema = object({
28727
+ id: DiagnosticIdSchema,
28728
+ armed: boolean(),
28729
+ /** Epoch ms the window closes at. 0 when disarmed. */
28730
+ armedUntilMs: number(),
28731
+ /** Ms left before it expires on its own. 0 when disarmed. */
28732
+ remainingMs: number(),
28733
+ /** Whether the stored deadline is the one the live diagnostic is running —
28734
+ * i.e. whether this window would survive a restart. */
28735
+ persisted: boolean()
28736
+ });
28737
+ /**
28738
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28739
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28740
+ * is a second knob that disagrees with the first the day one of them moves.
28741
+ */
28742
+ var DiagnosticWindowPatchSchema = object({
28743
+ id: DiagnosticIdSchema,
28744
+ armMs: number().int().min(0),
28745
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28746
+ reportEveryMs: number().int().positive().optional()
28747
+ });
28748
+ /**
28749
+ * A PATCH, and patches MERGE.
28750
+ *
28751
+ * A field absent from the patch is left exactly as it was — arming a
28752
+ * diagnostic never resets a level, and setting a level never disarms a window.
28753
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28754
+ * `setAll` already merges, and rebuilding the object is how an absent field
28755
+ * turns into an erased one.
28756
+ */
28757
+ var LoggingSettingsPatchSchema = object({
28758
+ /**
28759
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28760
+ * addressed scope so it inherits again. A value sets it.
28761
+ */
28762
+ level: LogLevelSchema$1.nullable().optional(),
28763
+ /**
28764
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28765
+ * keeps running — a patch is never a full replacement.
28766
+ */
28767
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28768
+ });
28769
+ /**
28770
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28771
+ *
28772
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28773
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28774
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28775
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28776
+ * by an agent that holds no cluster document at all. The hub is the single
28777
+ * authority over the whole hierarchy and answers for every layer, so the
28778
+ * layer selector needs a name the transport does not already own.
28779
+ */
28780
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28781
+ var SetLoggingSettingsInputSchema = object({
28782
+ scopeNodeId: string().optional(),
28783
+ patch: LoggingSettingsPatchSchema
28784
+ });
28785
+ /**
28786
+ * The whole document, as read and as returned after every write.
28787
+ *
28788
+ * `persisted: false` means the settings store could not be read or written.
28789
+ * The in-memory mirror still governs behaviour and is unchanged by the
28790
+ * failure — a read that fails neither switches a level nor disarms a window
28791
+ * (D49) — but the operator is told that what they are looking at would not
28792
+ * survive a restart.
28793
+ */
28794
+ var LoggingSettingsStateSchema = object({
28795
+ /** The layer this document was read at. `null` = the cluster layer. */
28796
+ scopeNodeId: string().nullable(),
28797
+ effective: LoggingEffectiveSchema,
28798
+ explicit: LoggingExplicitSchema,
28799
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28800
+ persisted: boolean()
28801
+ });
28424
28802
  method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
28425
28803
  kind: "mutation",
28426
28804
  auth: "admin"
@@ -28433,6 +28811,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28433
28811
  }), method(_void(), SiteLocationStatusSchema, {
28434
28812
  kind: "mutation",
28435
28813
  auth: "admin"
28814
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28815
+ kind: "mutation",
28816
+ auth: "admin"
28436
28817
  });
28437
28818
  /**
28438
28819
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35670,6 +36051,18 @@ Object.freeze({
35670
36051
  addonId: null,
35671
36052
  access: "create"
35672
36053
  },
36054
+ "system.getLoggingSettings": {
36055
+ capName: "system",
36056
+ capScope: "system",
36057
+ addonId: null,
36058
+ access: "view"
36059
+ },
36060
+ "system.getRequestCensus": {
36061
+ capName: "system",
36062
+ capScope: "system",
36063
+ addonId: null,
36064
+ access: "view"
36065
+ },
35673
36066
  "system.getRetentionConfig": {
35674
36067
  capName: "system",
35675
36068
  capScope: "system",
@@ -35700,6 +36093,12 @@ Object.freeze({
35700
36093
  addonId: null,
35701
36094
  access: "view"
35702
36095
  },
36096
+ "system.setLoggingSettings": {
36097
+ capName: "system",
36098
+ capScope: "system",
36099
+ addonId: null,
36100
+ access: "create"
36101
+ },
35703
36102
  "system.setRetentionConfig": {
35704
36103
  capName: "system",
35705
36104
  capScope: "system",
@@ -36855,6 +37254,10 @@ Object.freeze({
36855
37254
  name: "deviceId",
36856
37255
  form: "single",
36857
37256
  optional: true
37257
+ }, {
37258
+ name: "deviceIds",
37259
+ form: "array",
37260
+ optional: true
36858
37261
  }],
36859
37262
  "fanControl.setDirection": [{
36860
37263
  name: "deviceId",
@@ -38465,7 +38868,38 @@ object({
38465
38868
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38466
38869
  * reproduce that.
38467
38870
  */
38468
- tileBudgetMb: number().int().min(0).max(1024)
38871
+ tileBudgetMb: number().int().min(0).max(1024),
38872
+ /**
38873
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38874
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38875
+ * subject tiles, on frames that detected something.
38876
+ *
38877
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38878
+ * containment is strict by design, so the native `keyFrame`, the detail
38879
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38880
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38881
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38882
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38883
+ *
38884
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38885
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38886
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38887
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38888
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38889
+ * binds only through a detection burst, where it still covers well past the
38890
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38891
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38892
+ * whole shape exists to avoid.
38893
+ *
38894
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38895
+ * subject tile, so one shared budget would let a busy camera's key frames
38896
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38897
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38898
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38899
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38900
+ * nothing.
38901
+ */
38902
+ sceneBudgetMb: number().int().min(0).max(1024)
38469
38903
  });
38470
38904
  /**
38471
38905
  * The values in force when the operator has set nothing.
@@ -38481,12 +38915,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38481
38915
  budgetMb: 1024,
38482
38916
  activityMs: 15e3,
38483
38917
  tileBudgetMb: 64,
38918
+ sceneBudgetMb: 48,
38484
38919
  admission: "inferred"
38485
38920
  };
38486
38921
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38487
38922
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38488
38923
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38489
38924
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38925
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38490
38926
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38491
38927
  var MB = 1024 * 1024;
38492
38928
  1024 * MB, 3072 * MB;
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,211 @@ var SetSiteLocationInputSchema = object({
28398
28571
  latitude: number().min(-90).max(90),
28399
28572
  longitude: number().min(-180).max(180)
28400
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
+ });
28401
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(), {
28402
28780
  kind: "mutation",
28403
28781
  auth: "admin"
@@ -28410,6 +28788,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28410
28788
  }), method(_void(), SiteLocationStatusSchema, {
28411
28789
  kind: "mutation",
28412
28790
  auth: "admin"
28791
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28792
+ kind: "mutation",
28793
+ auth: "admin"
28413
28794
  });
28414
28795
  /**
28415
28796
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35647,6 +36028,18 @@ Object.freeze({
35647
36028
  addonId: null,
35648
36029
  access: "create"
35649
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
+ },
35650
36043
  "system.getRetentionConfig": {
35651
36044
  capName: "system",
35652
36045
  capScope: "system",
@@ -35677,6 +36070,12 @@ Object.freeze({
35677
36070
  addonId: null,
35678
36071
  access: "view"
35679
36072
  },
36073
+ "system.setLoggingSettings": {
36074
+ capName: "system",
36075
+ capScope: "system",
36076
+ addonId: null,
36077
+ access: "create"
36078
+ },
35680
36079
  "system.setRetentionConfig": {
35681
36080
  capName: "system",
35682
36081
  capScope: "system",
@@ -36832,6 +37231,10 @@ Object.freeze({
36832
37231
  name: "deviceId",
36833
37232
  form: "single",
36834
37233
  optional: true
37234
+ }, {
37235
+ name: "deviceIds",
37236
+ form: "array",
37237
+ optional: true
36835
37238
  }],
36836
37239
  "fanControl.setDirection": [{
36837
37240
  name: "deviceId",
@@ -38442,7 +38845,38 @@ object({
38442
38845
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38443
38846
  * reproduce that.
38444
38847
  */
38445
- 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)
38446
38880
  });
38447
38881
  /**
38448
38882
  * The values in force when the operator has set nothing.
@@ -38458,12 +38892,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38458
38892
  budgetMb: 1024,
38459
38893
  activityMs: 15e3,
38460
38894
  tileBudgetMb: 64,
38895
+ sceneBudgetMb: 48,
38461
38896
  admission: "inferred"
38462
38897
  };
38463
38898
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38464
38899
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38465
38900
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38466
38901
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38902
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38467
38903
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38468
38904
  var MB = 1024 * 1024;
38469
38905
  1024 * MB, 3072 * MB;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-terminal",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "Interactive terminal sessions (pty + xterm) as a CamStack addon",
5
5
  "keywords": [
6
6
  "camstack",