@camstack/addon-import-alexa 0.2.30 → 0.2.31

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
@@ -7684,6 +7684,66 @@ var OpsLogQueryInputSchema = object({
7684
7684
  /** Max rows returned, newest-first. */
7685
7685
  limit: number().int().min(1).max(1e3).optional()
7686
7686
  });
7687
+ var LabelDefinitionSchema = object({
7688
+ id: string(),
7689
+ name: string(),
7690
+ category: string().optional(),
7691
+ description: string().optional(),
7692
+ icon: string().optional()
7693
+ });
7694
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7695
+ var CLASS_MAP_MACRO_TARGETS = [
7696
+ "person",
7697
+ "vehicle",
7698
+ "animal",
7699
+ "package"
7700
+ ];
7701
+ /**
7702
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7703
+ * un operatore può selezionare.
7704
+ *
7705
+ * Sono le tre offerte dallo step `object-detection`
7706
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7707
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7708
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7709
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7710
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7711
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7712
+ *
7713
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7714
+ * dello step e una seconda volta come union `FirstLevelMacro`
7715
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7716
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7717
+ * successiva.
7718
+ */
7719
+ var FIRST_LEVEL_MACRO_CLASSES = [
7720
+ "person",
7721
+ "vehicle",
7722
+ "animal"
7723
+ ];
7724
+ /**
7725
+ * Wire schema for a per-model CATALOG classMap override
7726
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7727
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7728
+ * detection pipeline executor actually routes.
7729
+ *
7730
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7731
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7732
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7733
+ * enum) — the two used to share the name `ClassMapDefinition`/
7734
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7735
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7736
+ * are not: it is two different concepts colliding on a name. Keep this type
7737
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7738
+ * would either narrow every `ClassMapDefinition` consumer to the four
7739
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7740
+ * schema exists for (see the "rejects a classMap whose target is not a
7741
+ * detection macro" test in `model-catalog-schema.test.ts`).
7742
+ */
7743
+ var DetectionCatalogClassMapSchema = object({
7744
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7745
+ preserveOriginal: boolean()
7746
+ });
7687
7747
  /**
7688
7748
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7689
7749
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7706,10 +7766,55 @@ var RecordingStorageModeSchema = _enum([
7706
7766
  "events",
7707
7767
  "continuous"
7708
7768
  ]);
7769
+ /**
7770
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7771
+ * tre offerte dallo step `object-detection`, da UNA lista
7772
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7773
+ */
7774
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7775
+ /**
7776
+ * True quando `values` non ripete un elemento.
7777
+ *
7778
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7779
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7780
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7781
+ */
7782
+ var noDuplicates = (values) => new Set(values).size === values.length;
7709
7783
  /** Which detectors trigger an `events`-mode band. */
7710
7784
  var RecordingTriggersSchema = object({
7711
7785
  motion: boolean().optional(),
7712
- audioThresholdDbfs: number().optional()
7786
+ audioThresholdDbfs: number().optional(),
7787
+ /**
7788
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7789
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7790
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7791
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7792
+ *
7793
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7794
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7795
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7796
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7797
+ * finestre — vedi `recorder/object-trigger.ts`.
7798
+ */
7799
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7800
+ /**
7801
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7802
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7803
+ * `objectClasses`.
7804
+ *
7805
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7806
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7807
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7808
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7809
+ * device (D12) — mai un elenco globale di cap.
7810
+ *
7811
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7812
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7813
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7814
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7815
+ * registrare.
7816
+ */
7817
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7713
7818
  });
7714
7819
  /**
7715
7820
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8161,41 +8266,6 @@ var DecoderSessionConfigSchema = object({
8161
8266
  */
8162
8267
  debug: boolean().optional()
8163
8268
  });
8164
- var LabelDefinitionSchema = object({
8165
- id: string(),
8166
- name: string(),
8167
- category: string().optional(),
8168
- description: string().optional(),
8169
- icon: string().optional()
8170
- });
8171
- /**
8172
- * Wire schema for a per-model CATALOG classMap override
8173
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8174
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8175
- * detection pipeline executor actually routes.
8176
- *
8177
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8178
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8179
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8180
- * enum) — the two used to share the name `ClassMapDefinition`/
8181
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8182
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8183
- * are not: it is two different concepts colliding on a name. Keep this type
8184
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8185
- * would either narrow every `ClassMapDefinition` consumer to the four
8186
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8187
- * schema exists for (see the "rejects a classMap whose target is not a
8188
- * detection macro" test in `model-catalog-schema.test.ts`).
8189
- */
8190
- var DetectionCatalogClassMapSchema = object({
8191
- mapping: record(string(), _enum([
8192
- "person",
8193
- "vehicle",
8194
- "animal",
8195
- "package"
8196
- ])),
8197
- preserveOriginal: boolean()
8198
- });
8199
8269
  var MODEL_FORMATS = [
8200
8270
  "onnx",
8201
8271
  "coreml",
@@ -21396,7 +21466,7 @@ var lifecycleJobSchema = object({
21396
21466
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21397
21467
  * as every other cap.
21398
21468
  */
21399
- var LogLevelSchema$1 = _enum([
21469
+ var LogLevelSchema$2 = _enum([
21400
21470
  "debug",
21401
21471
  "info",
21402
21472
  "warn",
@@ -21603,7 +21673,7 @@ var CustomActionInputSchema = object({
21603
21673
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21604
21674
  addonId: string(),
21605
21675
  limit: number().min(1).max(500).default(100),
21606
- level: LogLevelSchema$1.optional()
21676
+ level: LogLevelSchema$2.optional()
21607
21677
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21608
21678
  packageName: string(),
21609
21679
  version: string().optional()
@@ -21701,7 +21771,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21701
21771
  auth: "admin"
21702
21772
  }), method(object({
21703
21773
  addonId: string(),
21704
- level: LogLevelSchema$1.optional()
21774
+ level: LogLevelSchema$2.optional()
21705
21775
  }), LogStreamEntrySchema, { kind: "subscription" });
21706
21776
  /**
21707
21777
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23442,6 +23512,35 @@ var FaceFilterEnum = _enum([
23442
23512
  "identified",
23443
23513
  "all"
23444
23514
  ]);
23515
+ /**
23516
+ * What a `listRecentFaces` page is ORDERED BY.
23517
+ *
23518
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23519
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23520
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23521
+ * order: it puts the suggestions an operator can confirm with one tap at the
23522
+ * top, and it is the reason this enum exists — a client that ranked a capped
23523
+ * page client-side was ranking the newest N, never the most certain N.
23524
+ *
23525
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23526
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23527
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23528
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23529
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23530
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23531
+ * then by faceId, and is what makes this a total order instead of the
23532
+ * backend's NULL-collation accident.
23533
+ */
23534
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23535
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23536
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23537
+ * never leaves the server. */
23538
+ var FaceClusterSchema = object({
23539
+ faceIds: array(string()).readonly(),
23540
+ representativeFaceId: string(),
23541
+ size: number().int(),
23542
+ cohesion: number()
23543
+ });
23445
23544
  var MediaFileLiteSchema$1 = object({
23446
23545
  key: string(),
23447
23546
  kind: string(),
@@ -23488,24 +23587,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23488
23587
  kind: "mutation",
23489
23588
  auth: "admin"
23490
23589
  }), method(object({
23491
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23590
+ /**
23591
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23592
+ *
23593
+ * The legacy single-camera form, kept verbatim for every caller that
23594
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23595
+ * instead — never both: `deviceIds` is the authority whenever it is
23596
+ * present, and this field is then ignored rather than unioned, so
23597
+ * there is exactly one answer to "which cameras did I ask for".
23598
+ */
23492
23599
  deviceId: number().int().optional(),
23600
+ /**
23601
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23602
+ * until now had to fetch the cluster-wide page and drop rows in the
23603
+ * client (so the `limit` it asked for was spent on cameras it was
23604
+ * about to discard).
23605
+ *
23606
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23607
+ * "every camera". A request for no devices is a request, not an
23608
+ * omission; same contract as `deviceManager.listFleet` and
23609
+ * `pipelineAnalytics.listRecentTracks`.
23610
+ *
23611
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23612
+ */
23613
+ deviceIds: array(number().int()).optional(),
23493
23614
  limit: number().int().positive().optional(),
23494
23615
  filter: FaceFilterEnum.optional(),
23495
23616
  /**
23496
- * Inline the base64 crop on every row. Default `true` — the existing
23497
- * behaviour, kept so no caller breaks.
23617
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23618
+ * Absent means no lower bound.
23619
+ */
23620
+ since: number().int().optional(),
23621
+ /**
23622
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23623
+ * Absent means no upper bound.
23624
+ */
23625
+ until: number().int().optional(),
23626
+ /**
23627
+ * Order the page by time or by suggestion certainty. Default
23628
+ * `'timestamp'` — the historical order, unchanged for every caller
23629
+ * that does not ask.
23498
23630
  *
23499
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23500
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23501
- * the browser cache the images.
23631
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23632
+ * does under `'suggestionConfidence'`.
23502
23633
  *
23503
- * **This is an INPUT field, so it does not reach the addon until the
23504
- * next train.** The hub router validates cap inputs against its own
23505
- * compiled Zod, which strips a key it does not know — verified today
23506
- * on the OUTPUT side, where an additive field DOES arrive immediately
23507
- * (`Track.hasFace`). Until the train ships, sending `false` is
23508
- * harmless and simply keeps the crops inline.
23634
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23635
+ * index and stops reading as soon as `limit` rows have PASSED the
23636
+ * filter. `'suggestionConfidence'` cannot stop early — the most
23637
+ * certain row may be the oldest — so it walks the window. Narrow it
23638
+ * with {@link since} / {@link until}.
23639
+ */
23640
+ sortBy: FaceSortFieldEnum.optional(),
23641
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23642
+ sortDirection: FaceSortDirectionEnum.optional(),
23643
+ /**
23644
+ * Inline the base64 crop on every row.
23645
+ *
23646
+ * Default `false` since the 2026-08-25 inversion — see
23647
+ * `include-crops-default.ts`, which is the ONE place that resolves
23648
+ * this for every gallery, and which records why the inline shape had
23649
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23650
+ * The doc here used to still say `true`; it was wrong, and a leftover
23651
+ * that describes the old design reads as permission to rely on it.
23652
+ *
23653
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23654
+ * which the browser fetches off the `event-media` plane in parallel,
23655
+ * cached and ETagged.
23509
23656
  */
23510
23657
  includeCrops: boolean().optional()
23511
23658
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23541,13 +23688,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23541
23688
  }), method(object({
23542
23689
  threshold: number().min(0).max(1).optional(),
23543
23690
  minClusterSize: number().int().min(2).optional(),
23544
- limit: number().int().positive().optional()
23545
- }).optional(), array(object({
23546
- faceIds: array(string()).readonly(),
23547
- representativeFaceId: string(),
23548
- size: number().int(),
23549
- cohesion: number()
23550
- })).readonly());
23691
+ /**
23692
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23693
+ * which read as though it bounded the work — it never did.
23694
+ *
23695
+ * Wins over {@link limit} when both are sent.
23696
+ */
23697
+ maxClusters: number().int().positive().optional(),
23698
+ /**
23699
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23700
+ * RESULT, not the scan. Kept so existing callers keep working; send
23701
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23702
+ */
23703
+ limit: number().int().positive().optional(),
23704
+ /**
23705
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23706
+ * POOL, not the result.
23707
+ *
23708
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23709
+ * used to read every unassigned face on the hub no matter what the
23710
+ * caller asked for, because the only bound cut the finished clusters
23711
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23712
+ * whole corpus, on an addon whose disk is under contention.
23713
+ *
23714
+ * The pool is the NEWEST matching faces first — the same order the
23715
+ * gallery shows — so a bound here shortens the horizon, it does not
23716
+ * sample it randomly.
23717
+ *
23718
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23719
+ * so the live corpus — 372 face rows — is unaffected while the
23720
+ * unbounded scan can never come back as the table grows.
23721
+ */
23722
+ maxFacesScanned: number().int().positive().optional()
23723
+ }).optional(), array(FaceClusterSchema).readonly());
23551
23724
  /**
23552
23725
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23553
23726
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28489,6 +28662,211 @@ var SetSiteLocationInputSchema = object({
28489
28662
  latitude: number().min(-90).max(90),
28490
28663
  longitude: number().min(-180).max(180)
28491
28664
  }).nullable();
28665
+ /**
28666
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28667
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28668
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28669
+ * already prints - never a token, never an `Authorization` header.
28670
+ */
28671
+ var RequestCensusGroupSchema = object({
28672
+ procedure: string(),
28673
+ userAgent: string(),
28674
+ ip: string(),
28675
+ principal: string(),
28676
+ calls: number(),
28677
+ perMin: number()
28678
+ });
28679
+ /**
28680
+ * A procedure's TOTAL over the window, across every caller.
28681
+ *
28682
+ * This block, not the group list, is what answers "did these calls arrive over
28683
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28684
+ * same window excludes the HTTP plane, which is a result, not a failure.
28685
+ */
28686
+ var RequestCensusProcedureSchema = object({
28687
+ procedure: string(),
28688
+ calls: number(),
28689
+ perMin: number()
28690
+ });
28691
+ /**
28692
+ * The census as an operator sees it.
28693
+ *
28694
+ * `persisted` is the honest answer to "will this survive the restart I am
28695
+ * about to do": the arm deadline is written to `system-settings` so a window
28696
+ * armed now can measure the NEXT boot, and a write that failed must not look
28697
+ * like one that succeeded.
28698
+ */
28699
+ var RequestCensusStatusSchema = object({
28700
+ armed: boolean(),
28701
+ /** How long the current - or just-closed - window collected, in ms. */
28702
+ elapsedMs: number(),
28703
+ /** The window actually armed, after the server clamped the request. */
28704
+ windowMs: number(),
28705
+ /** Epoch ms the window closes at. 0 when disarmed. */
28706
+ armedUntilMs: number(),
28707
+ httpRequests: number(),
28708
+ batchedRequests: number(),
28709
+ /**
28710
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28711
+ * is in play (`?batch=1` carries several procedures in one request); this is
28712
+ * the number comparable with a store-side call count.
28713
+ */
28714
+ procedureCalls: number(),
28715
+ /**
28716
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28717
+ * transport resolves one context per connection - but the number that says
28718
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28719
+ */
28720
+ wsConnections: number(),
28721
+ distinctGroups: number(),
28722
+ /** Calls counted in the totals whose group attribution was shed at the
28723
+ * cardinality bound. */
28724
+ unattributedCalls: number(),
28725
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28726
+ groups: array(RequestCensusGroupSchema).readonly()
28727
+ }).extend({ persisted: boolean() });
28728
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28729
+ var LogLevelSchema$1 = _enum([
28730
+ "debug",
28731
+ "info",
28732
+ "warn",
28733
+ "error"
28734
+ ]);
28735
+ /**
28736
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28737
+ *
28738
+ * A diagnostic is anything whose cost is only worth paying while a question is
28739
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28740
+ */
28741
+ var DiagnosticIdSchema = _enum(["request-census"]);
28742
+ /**
28743
+ * The layers of the level hierarchy, general → specific. The most specific
28744
+ * layer that carries an explicit value wins.
28745
+ *
28746
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28747
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28748
+ * grow later would force every consumer of this document to change with it.
28749
+ * Nothing returns `component` today.
28750
+ */
28751
+ var LoggingScopeKindSchema = _enum([
28752
+ "cluster",
28753
+ "node",
28754
+ "component"
28755
+ ]);
28756
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28757
+ var LoggingLevelSourceSchema = _enum([
28758
+ "default",
28759
+ "cluster",
28760
+ "node",
28761
+ "component"
28762
+ ]);
28763
+ /**
28764
+ * One layer of the hierarchy as it actually STANDS.
28765
+ *
28766
+ * `level: null` is the whole reason this array is returned: it is the
28767
+ * difference between "this node is at `info` because I decided it" and
28768
+ * "...because it inherits". An operator who clears an override believing they
28769
+ * are clearing an inherited value has been handed the same defect as the two
28770
+ * contradicting knobs this document exists to remove, moved one floor up.
28771
+ */
28772
+ var LoggingLevelLayerSchema = object({
28773
+ scope: LoggingScopeKindSchema,
28774
+ /** The node this layer speaks for; `null` on the cluster layer. */
28775
+ nodeId: string().nullable(),
28776
+ /** Explicitly set here, or `null` when this layer inherits. */
28777
+ level: LogLevelSchema$1.nullable()
28778
+ });
28779
+ /** What a line is judged against, and WHICH layer decided it. */
28780
+ var LoggingEffectiveSchema = object({
28781
+ level: LogLevelSchema$1,
28782
+ levelSource: LoggingLevelSourceSchema
28783
+ });
28784
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28785
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28786
+ /**
28787
+ * An armed diagnostic, with its DEADLINE.
28788
+ *
28789
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28790
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28791
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28792
+ * `armed` is false — a window is never reported as slightly expired.
28793
+ */
28794
+ var DiagnosticWindowSchema = object({
28795
+ id: DiagnosticIdSchema,
28796
+ armed: boolean(),
28797
+ /** Epoch ms the window closes at. 0 when disarmed. */
28798
+ armedUntilMs: number(),
28799
+ /** Ms left before it expires on its own. 0 when disarmed. */
28800
+ remainingMs: number(),
28801
+ /** Whether the stored deadline is the one the live diagnostic is running —
28802
+ * i.e. whether this window would survive a restart. */
28803
+ persisted: boolean()
28804
+ });
28805
+ /**
28806
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28807
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28808
+ * is a second knob that disagrees with the first the day one of them moves.
28809
+ */
28810
+ var DiagnosticWindowPatchSchema = object({
28811
+ id: DiagnosticIdSchema,
28812
+ armMs: number().int().min(0),
28813
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28814
+ reportEveryMs: number().int().positive().optional()
28815
+ });
28816
+ /**
28817
+ * A PATCH, and patches MERGE.
28818
+ *
28819
+ * A field absent from the patch is left exactly as it was — arming a
28820
+ * diagnostic never resets a level, and setting a level never disarms a window.
28821
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28822
+ * `setAll` already merges, and rebuilding the object is how an absent field
28823
+ * turns into an erased one.
28824
+ */
28825
+ var LoggingSettingsPatchSchema = object({
28826
+ /**
28827
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28828
+ * addressed scope so it inherits again. A value sets it.
28829
+ */
28830
+ level: LogLevelSchema$1.nullable().optional(),
28831
+ /**
28832
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28833
+ * keeps running — a patch is never a full replacement.
28834
+ */
28835
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28836
+ });
28837
+ /**
28838
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28839
+ *
28840
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28841
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28842
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28843
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28844
+ * by an agent that holds no cluster document at all. The hub is the single
28845
+ * authority over the whole hierarchy and answers for every layer, so the
28846
+ * layer selector needs a name the transport does not already own.
28847
+ */
28848
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28849
+ var SetLoggingSettingsInputSchema = object({
28850
+ scopeNodeId: string().optional(),
28851
+ patch: LoggingSettingsPatchSchema
28852
+ });
28853
+ /**
28854
+ * The whole document, as read and as returned after every write.
28855
+ *
28856
+ * `persisted: false` means the settings store could not be read or written.
28857
+ * The in-memory mirror still governs behaviour and is unchanged by the
28858
+ * failure — a read that fails neither switches a level nor disarms a window
28859
+ * (D49) — but the operator is told that what they are looking at would not
28860
+ * survive a restart.
28861
+ */
28862
+ var LoggingSettingsStateSchema = object({
28863
+ /** The layer this document was read at. `null` = the cluster layer. */
28864
+ scopeNodeId: string().nullable(),
28865
+ effective: LoggingEffectiveSchema,
28866
+ explicit: LoggingExplicitSchema,
28867
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28868
+ persisted: boolean()
28869
+ });
28492
28870
  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(), {
28493
28871
  kind: "mutation",
28494
28872
  auth: "admin"
@@ -28501,6 +28879,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28501
28879
  }), method(_void(), SiteLocationStatusSchema, {
28502
28880
  kind: "mutation",
28503
28881
  auth: "admin"
28882
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28883
+ kind: "mutation",
28884
+ auth: "admin"
28504
28885
  });
28505
28886
  /**
28506
28887
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35740,6 +36121,18 @@ Object.freeze({
35740
36121
  addonId: null,
35741
36122
  access: "create"
35742
36123
  },
36124
+ "system.getLoggingSettings": {
36125
+ capName: "system",
36126
+ capScope: "system",
36127
+ addonId: null,
36128
+ access: "view"
36129
+ },
36130
+ "system.getRequestCensus": {
36131
+ capName: "system",
36132
+ capScope: "system",
36133
+ addonId: null,
36134
+ access: "view"
36135
+ },
35743
36136
  "system.getRetentionConfig": {
35744
36137
  capName: "system",
35745
36138
  capScope: "system",
@@ -35770,6 +36163,12 @@ Object.freeze({
35770
36163
  addonId: null,
35771
36164
  access: "view"
35772
36165
  },
36166
+ "system.setLoggingSettings": {
36167
+ capName: "system",
36168
+ capScope: "system",
36169
+ addonId: null,
36170
+ access: "create"
36171
+ },
35773
36172
  "system.setRetentionConfig": {
35774
36173
  capName: "system",
35775
36174
  capScope: "system",
@@ -36925,6 +37324,10 @@ Object.freeze({
36925
37324
  name: "deviceId",
36926
37325
  form: "single",
36927
37326
  optional: true
37327
+ }, {
37328
+ name: "deviceIds",
37329
+ form: "array",
37330
+ optional: true
36928
37331
  }],
36929
37332
  "fanControl.setDirection": [{
36930
37333
  name: "deviceId",
@@ -38535,7 +38938,38 @@ object({
38535
38938
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38536
38939
  * reproduce that.
38537
38940
  */
38538
- tileBudgetMb: number().int().min(0).max(1024)
38941
+ tileBudgetMb: number().int().min(0).max(1024),
38942
+ /**
38943
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38944
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38945
+ * subject tiles, on frames that detected something.
38946
+ *
38947
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38948
+ * containment is strict by design, so the native `keyFrame`, the detail
38949
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38950
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38951
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38952
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38953
+ *
38954
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38955
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38956
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38957
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38958
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38959
+ * binds only through a detection burst, where it still covers well past the
38960
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38961
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38962
+ * whole shape exists to avoid.
38963
+ *
38964
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38965
+ * subject tile, so one shared budget would let a busy camera's key frames
38966
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38967
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38968
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38969
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38970
+ * nothing.
38971
+ */
38972
+ sceneBudgetMb: number().int().min(0).max(1024)
38539
38973
  });
38540
38974
  /**
38541
38975
  * The values in force when the operator has set nothing.
@@ -38551,12 +38985,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38551
38985
  budgetMb: 1024,
38552
38986
  activityMs: 15e3,
38553
38987
  tileBudgetMb: 64,
38988
+ sceneBudgetMb: 48,
38554
38989
  admission: "inferred"
38555
38990
  };
38556
38991
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38557
38992
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38558
38993
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38559
38994
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38995
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38560
38996
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38561
38997
  var MB = 1024 * 1024;
38562
38998
  1024 * MB, 3072 * MB;
package/dist/addon.mjs CHANGED
@@ -7684,6 +7684,66 @@ var OpsLogQueryInputSchema = object({
7684
7684
  /** Max rows returned, newest-first. */
7685
7685
  limit: number().int().min(1).max(1e3).optional()
7686
7686
  });
7687
+ var LabelDefinitionSchema = object({
7688
+ id: string(),
7689
+ name: string(),
7690
+ category: string().optional(),
7691
+ description: string().optional(),
7692
+ icon: string().optional()
7693
+ });
7694
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7695
+ var CLASS_MAP_MACRO_TARGETS = [
7696
+ "person",
7697
+ "vehicle",
7698
+ "animal",
7699
+ "package"
7700
+ ];
7701
+ /**
7702
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7703
+ * un operatore può selezionare.
7704
+ *
7705
+ * Sono le tre offerte dallo step `object-detection`
7706
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7707
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7708
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7709
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7710
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7711
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7712
+ *
7713
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7714
+ * dello step e una seconda volta come union `FirstLevelMacro`
7715
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7716
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7717
+ * successiva.
7718
+ */
7719
+ var FIRST_LEVEL_MACRO_CLASSES = [
7720
+ "person",
7721
+ "vehicle",
7722
+ "animal"
7723
+ ];
7724
+ /**
7725
+ * Wire schema for a per-model CATALOG classMap override
7726
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7727
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7728
+ * detection pipeline executor actually routes.
7729
+ *
7730
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7731
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7732
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7733
+ * enum) — the two used to share the name `ClassMapDefinition`/
7734
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7735
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7736
+ * are not: it is two different concepts colliding on a name. Keep this type
7737
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7738
+ * would either narrow every `ClassMapDefinition` consumer to the four
7739
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7740
+ * schema exists for (see the "rejects a classMap whose target is not a
7741
+ * detection macro" test in `model-catalog-schema.test.ts`).
7742
+ */
7743
+ var DetectionCatalogClassMapSchema = object({
7744
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7745
+ preserveOriginal: boolean()
7746
+ });
7687
7747
  /**
7688
7748
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7689
7749
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7706,10 +7766,55 @@ var RecordingStorageModeSchema = _enum([
7706
7766
  "events",
7707
7767
  "continuous"
7708
7768
  ]);
7769
+ /**
7770
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7771
+ * tre offerte dallo step `object-detection`, da UNA lista
7772
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7773
+ */
7774
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7775
+ /**
7776
+ * True quando `values` non ripete un elemento.
7777
+ *
7778
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7779
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7780
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7781
+ */
7782
+ var noDuplicates = (values) => new Set(values).size === values.length;
7709
7783
  /** Which detectors trigger an `events`-mode band. */
7710
7784
  var RecordingTriggersSchema = object({
7711
7785
  motion: boolean().optional(),
7712
- audioThresholdDbfs: number().optional()
7786
+ audioThresholdDbfs: number().optional(),
7787
+ /**
7788
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7789
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7790
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7791
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7792
+ *
7793
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7794
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7795
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7796
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7797
+ * finestre — vedi `recorder/object-trigger.ts`.
7798
+ */
7799
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7800
+ /**
7801
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7802
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7803
+ * `objectClasses`.
7804
+ *
7805
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7806
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7807
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7808
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7809
+ * device (D12) — mai un elenco globale di cap.
7810
+ *
7811
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7812
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7813
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7814
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7815
+ * registrare.
7816
+ */
7817
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7713
7818
  });
7714
7819
  /**
7715
7820
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8161,41 +8266,6 @@ var DecoderSessionConfigSchema = object({
8161
8266
  */
8162
8267
  debug: boolean().optional()
8163
8268
  });
8164
- var LabelDefinitionSchema = object({
8165
- id: string(),
8166
- name: string(),
8167
- category: string().optional(),
8168
- description: string().optional(),
8169
- icon: string().optional()
8170
- });
8171
- /**
8172
- * Wire schema for a per-model CATALOG classMap override
8173
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8174
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8175
- * detection pipeline executor actually routes.
8176
- *
8177
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8178
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8179
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8180
- * enum) — the two used to share the name `ClassMapDefinition`/
8181
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8182
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8183
- * are not: it is two different concepts colliding on a name. Keep this type
8184
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8185
- * would either narrow every `ClassMapDefinition` consumer to the four
8186
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8187
- * schema exists for (see the "rejects a classMap whose target is not a
8188
- * detection macro" test in `model-catalog-schema.test.ts`).
8189
- */
8190
- var DetectionCatalogClassMapSchema = object({
8191
- mapping: record(string(), _enum([
8192
- "person",
8193
- "vehicle",
8194
- "animal",
8195
- "package"
8196
- ])),
8197
- preserveOriginal: boolean()
8198
- });
8199
8269
  var MODEL_FORMATS = [
8200
8270
  "onnx",
8201
8271
  "coreml",
@@ -21396,7 +21466,7 @@ var lifecycleJobSchema = object({
21396
21466
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21397
21467
  * as every other cap.
21398
21468
  */
21399
- var LogLevelSchema$1 = _enum([
21469
+ var LogLevelSchema$2 = _enum([
21400
21470
  "debug",
21401
21471
  "info",
21402
21472
  "warn",
@@ -21603,7 +21673,7 @@ var CustomActionInputSchema = object({
21603
21673
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21604
21674
  addonId: string(),
21605
21675
  limit: number().min(1).max(500).default(100),
21606
- level: LogLevelSchema$1.optional()
21676
+ level: LogLevelSchema$2.optional()
21607
21677
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21608
21678
  packageName: string(),
21609
21679
  version: string().optional()
@@ -21701,7 +21771,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21701
21771
  auth: "admin"
21702
21772
  }), method(object({
21703
21773
  addonId: string(),
21704
- level: LogLevelSchema$1.optional()
21774
+ level: LogLevelSchema$2.optional()
21705
21775
  }), LogStreamEntrySchema, { kind: "subscription" });
21706
21776
  /**
21707
21777
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23442,6 +23512,35 @@ var FaceFilterEnum = _enum([
23442
23512
  "identified",
23443
23513
  "all"
23444
23514
  ]);
23515
+ /**
23516
+ * What a `listRecentFaces` page is ORDERED BY.
23517
+ *
23518
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23519
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23520
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23521
+ * order: it puts the suggestions an operator can confirm with one tap at the
23522
+ * top, and it is the reason this enum exists — a client that ranked a capped
23523
+ * page client-side was ranking the newest N, never the most certain N.
23524
+ *
23525
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23526
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23527
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23528
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23529
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23530
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23531
+ * then by faceId, and is what makes this a total order instead of the
23532
+ * backend's NULL-collation accident.
23533
+ */
23534
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23535
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23536
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23537
+ * never leaves the server. */
23538
+ var FaceClusterSchema = object({
23539
+ faceIds: array(string()).readonly(),
23540
+ representativeFaceId: string(),
23541
+ size: number().int(),
23542
+ cohesion: number()
23543
+ });
23445
23544
  var MediaFileLiteSchema$1 = object({
23446
23545
  key: string(),
23447
23546
  kind: string(),
@@ -23488,24 +23587,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23488
23587
  kind: "mutation",
23489
23588
  auth: "admin"
23490
23589
  }), method(object({
23491
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23590
+ /**
23591
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23592
+ *
23593
+ * The legacy single-camera form, kept verbatim for every caller that
23594
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23595
+ * instead — never both: `deviceIds` is the authority whenever it is
23596
+ * present, and this field is then ignored rather than unioned, so
23597
+ * there is exactly one answer to "which cameras did I ask for".
23598
+ */
23492
23599
  deviceId: number().int().optional(),
23600
+ /**
23601
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23602
+ * until now had to fetch the cluster-wide page and drop rows in the
23603
+ * client (so the `limit` it asked for was spent on cameras it was
23604
+ * about to discard).
23605
+ *
23606
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23607
+ * "every camera". A request for no devices is a request, not an
23608
+ * omission; same contract as `deviceManager.listFleet` and
23609
+ * `pipelineAnalytics.listRecentTracks`.
23610
+ *
23611
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23612
+ */
23613
+ deviceIds: array(number().int()).optional(),
23493
23614
  limit: number().int().positive().optional(),
23494
23615
  filter: FaceFilterEnum.optional(),
23495
23616
  /**
23496
- * Inline the base64 crop on every row. Default `true` — the existing
23497
- * behaviour, kept so no caller breaks.
23617
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23618
+ * Absent means no lower bound.
23619
+ */
23620
+ since: number().int().optional(),
23621
+ /**
23622
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23623
+ * Absent means no upper bound.
23624
+ */
23625
+ until: number().int().optional(),
23626
+ /**
23627
+ * Order the page by time or by suggestion certainty. Default
23628
+ * `'timestamp'` — the historical order, unchanged for every caller
23629
+ * that does not ask.
23498
23630
  *
23499
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23500
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23501
- * the browser cache the images.
23631
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23632
+ * does under `'suggestionConfidence'`.
23502
23633
  *
23503
- * **This is an INPUT field, so it does not reach the addon until the
23504
- * next train.** The hub router validates cap inputs against its own
23505
- * compiled Zod, which strips a key it does not know — verified today
23506
- * on the OUTPUT side, where an additive field DOES arrive immediately
23507
- * (`Track.hasFace`). Until the train ships, sending `false` is
23508
- * harmless and simply keeps the crops inline.
23634
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23635
+ * index and stops reading as soon as `limit` rows have PASSED the
23636
+ * filter. `'suggestionConfidence'` cannot stop early — the most
23637
+ * certain row may be the oldest — so it walks the window. Narrow it
23638
+ * with {@link since} / {@link until}.
23639
+ */
23640
+ sortBy: FaceSortFieldEnum.optional(),
23641
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23642
+ sortDirection: FaceSortDirectionEnum.optional(),
23643
+ /**
23644
+ * Inline the base64 crop on every row.
23645
+ *
23646
+ * Default `false` since the 2026-08-25 inversion — see
23647
+ * `include-crops-default.ts`, which is the ONE place that resolves
23648
+ * this for every gallery, and which records why the inline shape had
23649
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23650
+ * The doc here used to still say `true`; it was wrong, and a leftover
23651
+ * that describes the old design reads as permission to rely on it.
23652
+ *
23653
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23654
+ * which the browser fetches off the `event-media` plane in parallel,
23655
+ * cached and ETagged.
23509
23656
  */
23510
23657
  includeCrops: boolean().optional()
23511
23658
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23541,13 +23688,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23541
23688
  }), method(object({
23542
23689
  threshold: number().min(0).max(1).optional(),
23543
23690
  minClusterSize: number().int().min(2).optional(),
23544
- limit: number().int().positive().optional()
23545
- }).optional(), array(object({
23546
- faceIds: array(string()).readonly(),
23547
- representativeFaceId: string(),
23548
- size: number().int(),
23549
- cohesion: number()
23550
- })).readonly());
23691
+ /**
23692
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23693
+ * which read as though it bounded the work — it never did.
23694
+ *
23695
+ * Wins over {@link limit} when both are sent.
23696
+ */
23697
+ maxClusters: number().int().positive().optional(),
23698
+ /**
23699
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23700
+ * RESULT, not the scan. Kept so existing callers keep working; send
23701
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23702
+ */
23703
+ limit: number().int().positive().optional(),
23704
+ /**
23705
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23706
+ * POOL, not the result.
23707
+ *
23708
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23709
+ * used to read every unassigned face on the hub no matter what the
23710
+ * caller asked for, because the only bound cut the finished clusters
23711
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23712
+ * whole corpus, on an addon whose disk is under contention.
23713
+ *
23714
+ * The pool is the NEWEST matching faces first — the same order the
23715
+ * gallery shows — so a bound here shortens the horizon, it does not
23716
+ * sample it randomly.
23717
+ *
23718
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23719
+ * so the live corpus — 372 face rows — is unaffected while the
23720
+ * unbounded scan can never come back as the table grows.
23721
+ */
23722
+ maxFacesScanned: number().int().positive().optional()
23723
+ }).optional(), array(FaceClusterSchema).readonly());
23551
23724
  /**
23552
23725
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23553
23726
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28489,6 +28662,211 @@ var SetSiteLocationInputSchema = object({
28489
28662
  latitude: number().min(-90).max(90),
28490
28663
  longitude: number().min(-180).max(180)
28491
28664
  }).nullable();
28665
+ /**
28666
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28667
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28668
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28669
+ * already prints - never a token, never an `Authorization` header.
28670
+ */
28671
+ var RequestCensusGroupSchema = object({
28672
+ procedure: string(),
28673
+ userAgent: string(),
28674
+ ip: string(),
28675
+ principal: string(),
28676
+ calls: number(),
28677
+ perMin: number()
28678
+ });
28679
+ /**
28680
+ * A procedure's TOTAL over the window, across every caller.
28681
+ *
28682
+ * This block, not the group list, is what answers "did these calls arrive over
28683
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28684
+ * same window excludes the HTTP plane, which is a result, not a failure.
28685
+ */
28686
+ var RequestCensusProcedureSchema = object({
28687
+ procedure: string(),
28688
+ calls: number(),
28689
+ perMin: number()
28690
+ });
28691
+ /**
28692
+ * The census as an operator sees it.
28693
+ *
28694
+ * `persisted` is the honest answer to "will this survive the restart I am
28695
+ * about to do": the arm deadline is written to `system-settings` so a window
28696
+ * armed now can measure the NEXT boot, and a write that failed must not look
28697
+ * like one that succeeded.
28698
+ */
28699
+ var RequestCensusStatusSchema = object({
28700
+ armed: boolean(),
28701
+ /** How long the current - or just-closed - window collected, in ms. */
28702
+ elapsedMs: number(),
28703
+ /** The window actually armed, after the server clamped the request. */
28704
+ windowMs: number(),
28705
+ /** Epoch ms the window closes at. 0 when disarmed. */
28706
+ armedUntilMs: number(),
28707
+ httpRequests: number(),
28708
+ batchedRequests: number(),
28709
+ /**
28710
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28711
+ * is in play (`?batch=1` carries several procedures in one request); this is
28712
+ * the number comparable with a store-side call count.
28713
+ */
28714
+ procedureCalls: number(),
28715
+ /**
28716
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28717
+ * transport resolves one context per connection - but the number that says
28718
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28719
+ */
28720
+ wsConnections: number(),
28721
+ distinctGroups: number(),
28722
+ /** Calls counted in the totals whose group attribution was shed at the
28723
+ * cardinality bound. */
28724
+ unattributedCalls: number(),
28725
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28726
+ groups: array(RequestCensusGroupSchema).readonly()
28727
+ }).extend({ persisted: boolean() });
28728
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28729
+ var LogLevelSchema$1 = _enum([
28730
+ "debug",
28731
+ "info",
28732
+ "warn",
28733
+ "error"
28734
+ ]);
28735
+ /**
28736
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28737
+ *
28738
+ * A diagnostic is anything whose cost is only worth paying while a question is
28739
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28740
+ */
28741
+ var DiagnosticIdSchema = _enum(["request-census"]);
28742
+ /**
28743
+ * The layers of the level hierarchy, general → specific. The most specific
28744
+ * layer that carries an explicit value wins.
28745
+ *
28746
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28747
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28748
+ * grow later would force every consumer of this document to change with it.
28749
+ * Nothing returns `component` today.
28750
+ */
28751
+ var LoggingScopeKindSchema = _enum([
28752
+ "cluster",
28753
+ "node",
28754
+ "component"
28755
+ ]);
28756
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28757
+ var LoggingLevelSourceSchema = _enum([
28758
+ "default",
28759
+ "cluster",
28760
+ "node",
28761
+ "component"
28762
+ ]);
28763
+ /**
28764
+ * One layer of the hierarchy as it actually STANDS.
28765
+ *
28766
+ * `level: null` is the whole reason this array is returned: it is the
28767
+ * difference between "this node is at `info` because I decided it" and
28768
+ * "...because it inherits". An operator who clears an override believing they
28769
+ * are clearing an inherited value has been handed the same defect as the two
28770
+ * contradicting knobs this document exists to remove, moved one floor up.
28771
+ */
28772
+ var LoggingLevelLayerSchema = object({
28773
+ scope: LoggingScopeKindSchema,
28774
+ /** The node this layer speaks for; `null` on the cluster layer. */
28775
+ nodeId: string().nullable(),
28776
+ /** Explicitly set here, or `null` when this layer inherits. */
28777
+ level: LogLevelSchema$1.nullable()
28778
+ });
28779
+ /** What a line is judged against, and WHICH layer decided it. */
28780
+ var LoggingEffectiveSchema = object({
28781
+ level: LogLevelSchema$1,
28782
+ levelSource: LoggingLevelSourceSchema
28783
+ });
28784
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28785
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28786
+ /**
28787
+ * An armed diagnostic, with its DEADLINE.
28788
+ *
28789
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28790
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28791
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28792
+ * `armed` is false — a window is never reported as slightly expired.
28793
+ */
28794
+ var DiagnosticWindowSchema = object({
28795
+ id: DiagnosticIdSchema,
28796
+ armed: boolean(),
28797
+ /** Epoch ms the window closes at. 0 when disarmed. */
28798
+ armedUntilMs: number(),
28799
+ /** Ms left before it expires on its own. 0 when disarmed. */
28800
+ remainingMs: number(),
28801
+ /** Whether the stored deadline is the one the live diagnostic is running —
28802
+ * i.e. whether this window would survive a restart. */
28803
+ persisted: boolean()
28804
+ });
28805
+ /**
28806
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28807
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28808
+ * is a second knob that disagrees with the first the day one of them moves.
28809
+ */
28810
+ var DiagnosticWindowPatchSchema = object({
28811
+ id: DiagnosticIdSchema,
28812
+ armMs: number().int().min(0),
28813
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28814
+ reportEveryMs: number().int().positive().optional()
28815
+ });
28816
+ /**
28817
+ * A PATCH, and patches MERGE.
28818
+ *
28819
+ * A field absent from the patch is left exactly as it was — arming a
28820
+ * diagnostic never resets a level, and setting a level never disarms a window.
28821
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28822
+ * `setAll` already merges, and rebuilding the object is how an absent field
28823
+ * turns into an erased one.
28824
+ */
28825
+ var LoggingSettingsPatchSchema = object({
28826
+ /**
28827
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28828
+ * addressed scope so it inherits again. A value sets it.
28829
+ */
28830
+ level: LogLevelSchema$1.nullable().optional(),
28831
+ /**
28832
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28833
+ * keeps running — a patch is never a full replacement.
28834
+ */
28835
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28836
+ });
28837
+ /**
28838
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28839
+ *
28840
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28841
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28842
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28843
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28844
+ * by an agent that holds no cluster document at all. The hub is the single
28845
+ * authority over the whole hierarchy and answers for every layer, so the
28846
+ * layer selector needs a name the transport does not already own.
28847
+ */
28848
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28849
+ var SetLoggingSettingsInputSchema = object({
28850
+ scopeNodeId: string().optional(),
28851
+ patch: LoggingSettingsPatchSchema
28852
+ });
28853
+ /**
28854
+ * The whole document, as read and as returned after every write.
28855
+ *
28856
+ * `persisted: false` means the settings store could not be read or written.
28857
+ * The in-memory mirror still governs behaviour and is unchanged by the
28858
+ * failure — a read that fails neither switches a level nor disarms a window
28859
+ * (D49) — but the operator is told that what they are looking at would not
28860
+ * survive a restart.
28861
+ */
28862
+ var LoggingSettingsStateSchema = object({
28863
+ /** The layer this document was read at. `null` = the cluster layer. */
28864
+ scopeNodeId: string().nullable(),
28865
+ effective: LoggingEffectiveSchema,
28866
+ explicit: LoggingExplicitSchema,
28867
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28868
+ persisted: boolean()
28869
+ });
28492
28870
  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(), {
28493
28871
  kind: "mutation",
28494
28872
  auth: "admin"
@@ -28501,6 +28879,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28501
28879
  }), method(_void(), SiteLocationStatusSchema, {
28502
28880
  kind: "mutation",
28503
28881
  auth: "admin"
28882
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28883
+ kind: "mutation",
28884
+ auth: "admin"
28504
28885
  });
28505
28886
  /**
28506
28887
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -35740,6 +36121,18 @@ Object.freeze({
35740
36121
  addonId: null,
35741
36122
  access: "create"
35742
36123
  },
36124
+ "system.getLoggingSettings": {
36125
+ capName: "system",
36126
+ capScope: "system",
36127
+ addonId: null,
36128
+ access: "view"
36129
+ },
36130
+ "system.getRequestCensus": {
36131
+ capName: "system",
36132
+ capScope: "system",
36133
+ addonId: null,
36134
+ access: "view"
36135
+ },
35743
36136
  "system.getRetentionConfig": {
35744
36137
  capName: "system",
35745
36138
  capScope: "system",
@@ -35770,6 +36163,12 @@ Object.freeze({
35770
36163
  addonId: null,
35771
36164
  access: "view"
35772
36165
  },
36166
+ "system.setLoggingSettings": {
36167
+ capName: "system",
36168
+ capScope: "system",
36169
+ addonId: null,
36170
+ access: "create"
36171
+ },
35773
36172
  "system.setRetentionConfig": {
35774
36173
  capName: "system",
35775
36174
  capScope: "system",
@@ -36925,6 +37324,10 @@ Object.freeze({
36925
37324
  name: "deviceId",
36926
37325
  form: "single",
36927
37326
  optional: true
37327
+ }, {
37328
+ name: "deviceIds",
37329
+ form: "array",
37330
+ optional: true
36928
37331
  }],
36929
37332
  "fanControl.setDirection": [{
36930
37333
  name: "deviceId",
@@ -38535,7 +38938,38 @@ object({
38535
38938
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38536
38939
  * reproduce that.
38537
38940
  */
38538
- tileBudgetMb: number().int().min(0).max(1024)
38941
+ tileBudgetMb: number().int().min(0).max(1024),
38942
+ /**
38943
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38944
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38945
+ * subject tiles, on frames that detected something.
38946
+ *
38947
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38948
+ * containment is strict by design, so the native `keyFrame`, the detail
38949
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38950
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38951
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38952
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38953
+ *
38954
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38955
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38956
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38957
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38958
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38959
+ * binds only through a detection burst, where it still covers well past the
38960
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38961
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38962
+ * whole shape exists to avoid.
38963
+ *
38964
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38965
+ * subject tile, so one shared budget would let a busy camera's key frames
38966
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38967
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38968
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38969
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38970
+ * nothing.
38971
+ */
38972
+ sceneBudgetMb: number().int().min(0).max(1024)
38539
38973
  });
38540
38974
  /**
38541
38975
  * The values in force when the operator has set nothing.
@@ -38551,12 +38985,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38551
38985
  budgetMb: 1024,
38552
38986
  activityMs: 15e3,
38553
38987
  tileBudgetMb: 64,
38988
+ sceneBudgetMb: 48,
38554
38989
  admission: "inferred"
38555
38990
  };
38556
38991
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38557
38992
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38558
38993
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38559
38994
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38995
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38560
38996
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38561
38997
  var MB = 1024 * 1024;
38562
38998
  1024 * MB, 3072 * MB;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-import-alexa",
3
- "version": "0.2.30",
3
+ "version": "0.2.31",
4
4
  "description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
5
5
  "keywords": [
6
6
  "camstack",