@camstack/addon-export-alexa 1.2.37 → 1.2.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7694,6 +7694,66 @@ var OpsLogQueryInputSchema = object({
7694
7694
  /** Max rows returned, newest-first. */
7695
7695
  limit: number().int().min(1).max(1e3).optional()
7696
7696
  });
7697
+ var LabelDefinitionSchema = object({
7698
+ id: string(),
7699
+ name: string(),
7700
+ category: string().optional(),
7701
+ description: string().optional(),
7702
+ icon: string().optional()
7703
+ });
7704
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7705
+ var CLASS_MAP_MACRO_TARGETS = [
7706
+ "person",
7707
+ "vehicle",
7708
+ "animal",
7709
+ "package"
7710
+ ];
7711
+ /**
7712
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7713
+ * un operatore può selezionare.
7714
+ *
7715
+ * Sono le tre offerte dallo step `object-detection`
7716
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7717
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7718
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7719
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7720
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7721
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7722
+ *
7723
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7724
+ * dello step e una seconda volta come union `FirstLevelMacro`
7725
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7726
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7727
+ * successiva.
7728
+ */
7729
+ var FIRST_LEVEL_MACRO_CLASSES = [
7730
+ "person",
7731
+ "vehicle",
7732
+ "animal"
7733
+ ];
7734
+ /**
7735
+ * Wire schema for a per-model CATALOG classMap override
7736
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7737
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7738
+ * detection pipeline executor actually routes.
7739
+ *
7740
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7741
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7742
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7743
+ * enum) — the two used to share the name `ClassMapDefinition`/
7744
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7745
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7746
+ * are not: it is two different concepts colliding on a name. Keep this type
7747
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7748
+ * would either narrow every `ClassMapDefinition` consumer to the four
7749
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7750
+ * schema exists for (see the "rejects a classMap whose target is not a
7751
+ * detection macro" test in `model-catalog-schema.test.ts`).
7752
+ */
7753
+ var DetectionCatalogClassMapSchema = object({
7754
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7755
+ preserveOriginal: boolean()
7756
+ });
7697
7757
  /**
7698
7758
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7699
7759
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7716,10 +7776,55 @@ var RecordingStorageModeSchema = _enum([
7716
7776
  "events",
7717
7777
  "continuous"
7718
7778
  ]);
7779
+ /**
7780
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7781
+ * tre offerte dallo step `object-detection`, da UNA lista
7782
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7783
+ */
7784
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7785
+ /**
7786
+ * True quando `values` non ripete un elemento.
7787
+ *
7788
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7789
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7790
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7791
+ */
7792
+ var noDuplicates = (values) => new Set(values).size === values.length;
7719
7793
  /** Which detectors trigger an `events`-mode band. */
7720
7794
  var RecordingTriggersSchema = object({
7721
7795
  motion: boolean().optional(),
7722
- audioThresholdDbfs: number().optional()
7796
+ audioThresholdDbfs: number().optional(),
7797
+ /**
7798
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7799
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7800
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7801
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7802
+ *
7803
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7804
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7805
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7806
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7807
+ * finestre — vedi `recorder/object-trigger.ts`.
7808
+ */
7809
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7810
+ /**
7811
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7812
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7813
+ * `objectClasses`.
7814
+ *
7815
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7816
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7817
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7818
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7819
+ * device (D12) — mai un elenco globale di cap.
7820
+ *
7821
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7822
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7823
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7824
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7825
+ * registrare.
7826
+ */
7827
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7723
7828
  });
7724
7829
  /**
7725
7830
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8225,41 +8330,6 @@ function pickClosestResolution(entries, target) {
8225
8330
  }
8226
8331
  return bestAbove?.entry ?? bestBelow?.entry;
8227
8332
  }
8228
- var LabelDefinitionSchema = object({
8229
- id: string(),
8230
- name: string(),
8231
- category: string().optional(),
8232
- description: string().optional(),
8233
- icon: string().optional()
8234
- });
8235
- /**
8236
- * Wire schema for a per-model CATALOG classMap override
8237
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8238
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8239
- * detection pipeline executor actually routes.
8240
- *
8241
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8242
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8243
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8244
- * enum) — the two used to share the name `ClassMapDefinition`/
8245
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8246
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8247
- * are not: it is two different concepts colliding on a name. Keep this type
8248
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8249
- * would either narrow every `ClassMapDefinition` consumer to the four
8250
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8251
- * schema exists for (see the "rejects a classMap whose target is not a
8252
- * detection macro" test in `model-catalog-schema.test.ts`).
8253
- */
8254
- var DetectionCatalogClassMapSchema = object({
8255
- mapping: record(string(), _enum([
8256
- "person",
8257
- "vehicle",
8258
- "animal",
8259
- "package"
8260
- ])),
8261
- preserveOriginal: boolean()
8262
- });
8263
8333
  var MODEL_FORMATS = [
8264
8334
  "onnx",
8265
8335
  "coreml",
@@ -21122,7 +21192,7 @@ var lifecycleJobSchema = object({
21122
21192
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21123
21193
  * as every other cap.
21124
21194
  */
21125
- var LogLevelSchema$1 = _enum([
21195
+ var LogLevelSchema$2 = _enum([
21126
21196
  "debug",
21127
21197
  "info",
21128
21198
  "warn",
@@ -21329,7 +21399,7 @@ var CustomActionInputSchema = object({
21329
21399
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21330
21400
  addonId: string(),
21331
21401
  limit: number().min(1).max(500).default(100),
21332
- level: LogLevelSchema$1.optional()
21402
+ level: LogLevelSchema$2.optional()
21333
21403
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21334
21404
  packageName: string(),
21335
21405
  version: string().optional()
@@ -21427,7 +21497,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21427
21497
  auth: "admin"
21428
21498
  }), method(object({
21429
21499
  addonId: string(),
21430
- level: LogLevelSchema$1.optional()
21500
+ level: LogLevelSchema$2.optional()
21431
21501
  }), LogStreamEntrySchema, { kind: "subscription" });
21432
21502
  object({
21433
21503
  /** Carbon dioxide concentration in ppm. */
@@ -22421,6 +22491,35 @@ var FaceFilterEnum = _enum([
22421
22491
  "identified",
22422
22492
  "all"
22423
22493
  ]);
22494
+ /**
22495
+ * What a `listRecentFaces` page is ORDERED BY.
22496
+ *
22497
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22498
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22499
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22500
+ * order: it puts the suggestions an operator can confirm with one tap at the
22501
+ * top, and it is the reason this enum exists — a client that ranked a capped
22502
+ * page client-side was ranking the newest N, never the most certain N.
22503
+ *
22504
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22505
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22506
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22507
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22508
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22509
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22510
+ * then by faceId, and is what makes this a total order instead of the
22511
+ * backend's NULL-collation accident.
22512
+ */
22513
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22514
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22515
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22516
+ * never leaves the server. */
22517
+ var FaceClusterSchema = object({
22518
+ faceIds: array(string()).readonly(),
22519
+ representativeFaceId: string(),
22520
+ size: number().int(),
22521
+ cohesion: number()
22522
+ });
22424
22523
  var MediaFileLiteSchema$1 = object({
22425
22524
  key: string(),
22426
22525
  kind: string(),
@@ -22467,24 +22566,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22467
22566
  kind: "mutation",
22468
22567
  auth: "admin"
22469
22568
  }), method(object({
22470
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22569
+ /**
22570
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22571
+ *
22572
+ * The legacy single-camera form, kept verbatim for every caller that
22573
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22574
+ * instead — never both: `deviceIds` is the authority whenever it is
22575
+ * present, and this field is then ignored rather than unioned, so
22576
+ * there is exactly one answer to "which cameras did I ask for".
22577
+ */
22471
22578
  deviceId: number().int().optional(),
22579
+ /**
22580
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22581
+ * until now had to fetch the cluster-wide page and drop rows in the
22582
+ * client (so the `limit` it asked for was spent on cameras it was
22583
+ * about to discard).
22584
+ *
22585
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22586
+ * "every camera". A request for no devices is a request, not an
22587
+ * omission; same contract as `deviceManager.listFleet` and
22588
+ * `pipelineAnalytics.listRecentTracks`.
22589
+ *
22590
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22591
+ */
22592
+ deviceIds: array(number().int()).optional(),
22472
22593
  limit: number().int().positive().optional(),
22473
22594
  filter: FaceFilterEnum.optional(),
22474
22595
  /**
22475
- * Inline the base64 crop on every row. Default `true` — the existing
22476
- * behaviour, kept so no caller breaks.
22596
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22597
+ * Absent means no lower bound.
22598
+ */
22599
+ since: number().int().optional(),
22600
+ /**
22601
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22602
+ * Absent means no upper bound.
22603
+ */
22604
+ until: number().int().optional(),
22605
+ /**
22606
+ * Order the page by time or by suggestion certainty. Default
22607
+ * `'timestamp'` — the historical order, unchanged for every caller
22608
+ * that does not ask.
22477
22609
  *
22478
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22479
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22480
- * the browser cache the images.
22610
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22611
+ * does under `'suggestionConfidence'`.
22481
22612
  *
22482
- * **This is an INPUT field, so it does not reach the addon until the
22483
- * next train.** The hub router validates cap inputs against its own
22484
- * compiled Zod, which strips a key it does not know — verified today
22485
- * on the OUTPUT side, where an additive field DOES arrive immediately
22486
- * (`Track.hasFace`). Until the train ships, sending `false` is
22487
- * harmless and simply keeps the crops inline.
22613
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22614
+ * index and stops reading as soon as `limit` rows have PASSED the
22615
+ * filter. `'suggestionConfidence'` cannot stop early — the most
22616
+ * certain row may be the oldest — so it walks the window. Narrow it
22617
+ * with {@link since} / {@link until}.
22618
+ */
22619
+ sortBy: FaceSortFieldEnum.optional(),
22620
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22621
+ sortDirection: FaceSortDirectionEnum.optional(),
22622
+ /**
22623
+ * Inline the base64 crop on every row.
22624
+ *
22625
+ * Default `false` since the 2026-08-25 inversion — see
22626
+ * `include-crops-default.ts`, which is the ONE place that resolves
22627
+ * this for every gallery, and which records why the inline shape had
22628
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22629
+ * The doc here used to still say `true`; it was wrong, and a leftover
22630
+ * that describes the old design reads as permission to rely on it.
22631
+ *
22632
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22633
+ * which the browser fetches off the `event-media` plane in parallel,
22634
+ * cached and ETagged.
22488
22635
  */
22489
22636
  includeCrops: boolean().optional()
22490
22637
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22520,13 +22667,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22520
22667
  }), method(object({
22521
22668
  threshold: number().min(0).max(1).optional(),
22522
22669
  minClusterSize: number().int().min(2).optional(),
22523
- limit: number().int().positive().optional()
22524
- }).optional(), array(object({
22525
- faceIds: array(string()).readonly(),
22526
- representativeFaceId: string(),
22527
- size: number().int(),
22528
- cohesion: number()
22529
- })).readonly());
22670
+ /**
22671
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22672
+ * which read as though it bounded the work — it never did.
22673
+ *
22674
+ * Wins over {@link limit} when both are sent.
22675
+ */
22676
+ maxClusters: number().int().positive().optional(),
22677
+ /**
22678
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22679
+ * RESULT, not the scan. Kept so existing callers keep working; send
22680
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22681
+ */
22682
+ limit: number().int().positive().optional(),
22683
+ /**
22684
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22685
+ * POOL, not the result.
22686
+ *
22687
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22688
+ * used to read every unassigned face on the hub no matter what the
22689
+ * caller asked for, because the only bound cut the finished clusters
22690
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22691
+ * whole corpus, on an addon whose disk is under contention.
22692
+ *
22693
+ * The pool is the NEWEST matching faces first — the same order the
22694
+ * gallery shows — so a bound here shortens the horizon, it does not
22695
+ * sample it randomly.
22696
+ *
22697
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22698
+ * so the live corpus — 372 face rows — is unaffected while the
22699
+ * unbounded scan can never come back as the table grows.
22700
+ */
22701
+ maxFacesScanned: number().int().positive().optional()
22702
+ }).optional(), array(FaceClusterSchema).readonly());
22530
22703
  /**
22531
22704
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22532
22705
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -26249,6 +26422,211 @@ var SetSiteLocationInputSchema = object({
26249
26422
  latitude: number().min(-90).max(90),
26250
26423
  longitude: number().min(-180).max(180)
26251
26424
  }).nullable();
26425
+ /**
26426
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26427
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26428
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26429
+ * already prints - never a token, never an `Authorization` header.
26430
+ */
26431
+ var RequestCensusGroupSchema = object({
26432
+ procedure: string(),
26433
+ userAgent: string(),
26434
+ ip: string(),
26435
+ principal: string(),
26436
+ calls: number(),
26437
+ perMin: number()
26438
+ });
26439
+ /**
26440
+ * A procedure's TOTAL over the window, across every caller.
26441
+ *
26442
+ * This block, not the group list, is what answers "did these calls arrive over
26443
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26444
+ * same window excludes the HTTP plane, which is a result, not a failure.
26445
+ */
26446
+ var RequestCensusProcedureSchema = object({
26447
+ procedure: string(),
26448
+ calls: number(),
26449
+ perMin: number()
26450
+ });
26451
+ /**
26452
+ * The census as an operator sees it.
26453
+ *
26454
+ * `persisted` is the honest answer to "will this survive the restart I am
26455
+ * about to do": the arm deadline is written to `system-settings` so a window
26456
+ * armed now can measure the NEXT boot, and a write that failed must not look
26457
+ * like one that succeeded.
26458
+ */
26459
+ var RequestCensusStatusSchema = object({
26460
+ armed: boolean(),
26461
+ /** How long the current - or just-closed - window collected, in ms. */
26462
+ elapsedMs: number(),
26463
+ /** The window actually armed, after the server clamped the request. */
26464
+ windowMs: number(),
26465
+ /** Epoch ms the window closes at. 0 when disarmed. */
26466
+ armedUntilMs: number(),
26467
+ httpRequests: number(),
26468
+ batchedRequests: number(),
26469
+ /**
26470
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26471
+ * is in play (`?batch=1` carries several procedures in one request); this is
26472
+ * the number comparable with a store-side call count.
26473
+ */
26474
+ procedureCalls: number(),
26475
+ /**
26476
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26477
+ * transport resolves one context per connection - but the number that says
26478
+ * whether a plane this census cannot see was busy while HTTP was quiet.
26479
+ */
26480
+ wsConnections: number(),
26481
+ distinctGroups: number(),
26482
+ /** Calls counted in the totals whose group attribution was shed at the
26483
+ * cardinality bound. */
26484
+ unattributedCalls: number(),
26485
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26486
+ groups: array(RequestCensusGroupSchema).readonly()
26487
+ }).extend({ persisted: boolean() });
26488
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26489
+ var LogLevelSchema$1 = _enum([
26490
+ "debug",
26491
+ "info",
26492
+ "warn",
26493
+ "error"
26494
+ ]);
26495
+ /**
26496
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26497
+ *
26498
+ * A diagnostic is anything whose cost is only worth paying while a question is
26499
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26500
+ */
26501
+ var DiagnosticIdSchema = _enum(["request-census"]);
26502
+ /**
26503
+ * The layers of the level hierarchy, general → specific. The most specific
26504
+ * layer that carries an explicit value wins.
26505
+ *
26506
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26507
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26508
+ * grow later would force every consumer of this document to change with it.
26509
+ * Nothing returns `component` today.
26510
+ */
26511
+ var LoggingScopeKindSchema = _enum([
26512
+ "cluster",
26513
+ "node",
26514
+ "component"
26515
+ ]);
26516
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26517
+ var LoggingLevelSourceSchema = _enum([
26518
+ "default",
26519
+ "cluster",
26520
+ "node",
26521
+ "component"
26522
+ ]);
26523
+ /**
26524
+ * One layer of the hierarchy as it actually STANDS.
26525
+ *
26526
+ * `level: null` is the whole reason this array is returned: it is the
26527
+ * difference between "this node is at `info` because I decided it" and
26528
+ * "...because it inherits". An operator who clears an override believing they
26529
+ * are clearing an inherited value has been handed the same defect as the two
26530
+ * contradicting knobs this document exists to remove, moved one floor up.
26531
+ */
26532
+ var LoggingLevelLayerSchema = object({
26533
+ scope: LoggingScopeKindSchema,
26534
+ /** The node this layer speaks for; `null` on the cluster layer. */
26535
+ nodeId: string().nullable(),
26536
+ /** Explicitly set here, or `null` when this layer inherits. */
26537
+ level: LogLevelSchema$1.nullable()
26538
+ });
26539
+ /** What a line is judged against, and WHICH layer decided it. */
26540
+ var LoggingEffectiveSchema = object({
26541
+ level: LogLevelSchema$1,
26542
+ levelSource: LoggingLevelSourceSchema
26543
+ });
26544
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26545
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26546
+ /**
26547
+ * An armed diagnostic, with its DEADLINE.
26548
+ *
26549
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26550
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26551
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26552
+ * `armed` is false — a window is never reported as slightly expired.
26553
+ */
26554
+ var DiagnosticWindowSchema = object({
26555
+ id: DiagnosticIdSchema,
26556
+ armed: boolean(),
26557
+ /** Epoch ms the window closes at. 0 when disarmed. */
26558
+ armedUntilMs: number(),
26559
+ /** Ms left before it expires on its own. 0 when disarmed. */
26560
+ remainingMs: number(),
26561
+ /** Whether the stored deadline is the one the live diagnostic is running —
26562
+ * i.e. whether this window would survive a restart. */
26563
+ persisted: boolean()
26564
+ });
26565
+ /**
26566
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26567
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26568
+ * is a second knob that disagrees with the first the day one of them moves.
26569
+ */
26570
+ var DiagnosticWindowPatchSchema = object({
26571
+ id: DiagnosticIdSchema,
26572
+ armMs: number().int().min(0),
26573
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26574
+ reportEveryMs: number().int().positive().optional()
26575
+ });
26576
+ /**
26577
+ * A PATCH, and patches MERGE.
26578
+ *
26579
+ * A field absent from the patch is left exactly as it was — arming a
26580
+ * diagnostic never resets a level, and setting a level never disarms a window.
26581
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26582
+ * `setAll` already merges, and rebuilding the object is how an absent field
26583
+ * turns into an erased one.
26584
+ */
26585
+ var LoggingSettingsPatchSchema = object({
26586
+ /**
26587
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26588
+ * addressed scope so it inherits again. A value sets it.
26589
+ */
26590
+ level: LogLevelSchema$1.nullable().optional(),
26591
+ /**
26592
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26593
+ * keeps running — a patch is never a full replacement.
26594
+ */
26595
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26596
+ });
26597
+ /**
26598
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26599
+ *
26600
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26601
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26602
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26603
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26604
+ * by an agent that holds no cluster document at all. The hub is the single
26605
+ * authority over the whole hierarchy and answers for every layer, so the
26606
+ * layer selector needs a name the transport does not already own.
26607
+ */
26608
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26609
+ var SetLoggingSettingsInputSchema = object({
26610
+ scopeNodeId: string().optional(),
26611
+ patch: LoggingSettingsPatchSchema
26612
+ });
26613
+ /**
26614
+ * The whole document, as read and as returned after every write.
26615
+ *
26616
+ * `persisted: false` means the settings store could not be read or written.
26617
+ * The in-memory mirror still governs behaviour and is unchanged by the
26618
+ * failure — a read that fails neither switches a level nor disarms a window
26619
+ * (D49) — but the operator is told that what they are looking at would not
26620
+ * survive a restart.
26621
+ */
26622
+ var LoggingSettingsStateSchema = object({
26623
+ /** The layer this document was read at. `null` = the cluster layer. */
26624
+ scopeNodeId: string().nullable(),
26625
+ effective: LoggingEffectiveSchema,
26626
+ explicit: LoggingExplicitSchema,
26627
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26628
+ persisted: boolean()
26629
+ });
26252
26630
  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(), {
26253
26631
  kind: "mutation",
26254
26632
  auth: "admin"
@@ -26261,6 +26639,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26261
26639
  }), method(_void(), SiteLocationStatusSchema, {
26262
26640
  kind: "mutation",
26263
26641
  auth: "admin"
26642
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26643
+ kind: "mutation",
26644
+ auth: "admin"
26264
26645
  });
26265
26646
  object({
26266
26647
  /** True when the device's tamper switch / case-open contact is
@@ -32092,6 +32473,18 @@ Object.freeze({
32092
32473
  addonId: null,
32093
32474
  access: "create"
32094
32475
  },
32476
+ "system.getLoggingSettings": {
32477
+ capName: "system",
32478
+ capScope: "system",
32479
+ addonId: null,
32480
+ access: "view"
32481
+ },
32482
+ "system.getRequestCensus": {
32483
+ capName: "system",
32484
+ capScope: "system",
32485
+ addonId: null,
32486
+ access: "view"
32487
+ },
32095
32488
  "system.getRetentionConfig": {
32096
32489
  capName: "system",
32097
32490
  capScope: "system",
@@ -32122,6 +32515,12 @@ Object.freeze({
32122
32515
  addonId: null,
32123
32516
  access: "view"
32124
32517
  },
32518
+ "system.setLoggingSettings": {
32519
+ capName: "system",
32520
+ capScope: "system",
32521
+ addonId: null,
32522
+ access: "create"
32523
+ },
32125
32524
  "system.setRetentionConfig": {
32126
32525
  capName: "system",
32127
32526
  capScope: "system",
@@ -33277,6 +33676,10 @@ Object.freeze({
33277
33676
  name: "deviceId",
33278
33677
  form: "single",
33279
33678
  optional: true
33679
+ }, {
33680
+ name: "deviceIds",
33681
+ form: "array",
33682
+ optional: true
33280
33683
  }],
33281
33684
  "fanControl.setDirection": [{
33282
33685
  name: "deviceId",
@@ -34887,7 +35290,38 @@ object({
34887
35290
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34888
35291
  * reproduce that.
34889
35292
  */
34890
- tileBudgetMb: number().int().min(0).max(1024)
35293
+ tileBudgetMb: number().int().min(0).max(1024),
35294
+ /**
35295
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35296
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35297
+ * subject tiles, on frames that detected something.
35298
+ *
35299
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35300
+ * containment is strict by design, so the native `keyFrame`, the detail
35301
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35302
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35303
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35304
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35305
+ *
35306
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35307
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35308
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35309
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35310
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35311
+ * binds only through a detection burst, where it still covers well past the
35312
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35313
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35314
+ * whole shape exists to avoid.
35315
+ *
35316
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35317
+ * subject tile, so one shared budget would let a busy camera's key frames
35318
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35319
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35320
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35321
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35322
+ * nothing.
35323
+ */
35324
+ sceneBudgetMb: number().int().min(0).max(1024)
34891
35325
  });
34892
35326
  /**
34893
35327
  * The values in force when the operator has set nothing.
@@ -34903,12 +35337,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34903
35337
  budgetMb: 1024,
34904
35338
  activityMs: 15e3,
34905
35339
  tileBudgetMb: 64,
35340
+ sceneBudgetMb: 48,
34906
35341
  admission: "inferred"
34907
35342
  };
34908
35343
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34909
35344
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34910
35345
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34911
35346
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35347
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34912
35348
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34913
35349
  var MB = 1024 * 1024;
34914
35350
  1024 * MB, 3072 * MB;
@@ -7667,6 +7667,66 @@ var OpsLogQueryInputSchema = object({
7667
7667
  /** Max rows returned, newest-first. */
7668
7668
  limit: number().int().min(1).max(1e3).optional()
7669
7669
  });
7670
+ var LabelDefinitionSchema = object({
7671
+ id: string(),
7672
+ name: string(),
7673
+ category: string().optional(),
7674
+ description: string().optional(),
7675
+ icon: string().optional()
7676
+ });
7677
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7678
+ var CLASS_MAP_MACRO_TARGETS = [
7679
+ "person",
7680
+ "vehicle",
7681
+ "animal",
7682
+ "package"
7683
+ ];
7684
+ /**
7685
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7686
+ * un operatore può selezionare.
7687
+ *
7688
+ * Sono le tre offerte dallo step `object-detection`
7689
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7690
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7691
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7692
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7693
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7694
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7695
+ *
7696
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7697
+ * dello step e una seconda volta come union `FirstLevelMacro`
7698
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7699
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7700
+ * successiva.
7701
+ */
7702
+ var FIRST_LEVEL_MACRO_CLASSES = [
7703
+ "person",
7704
+ "vehicle",
7705
+ "animal"
7706
+ ];
7707
+ /**
7708
+ * Wire schema for a per-model CATALOG classMap override
7709
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7710
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7711
+ * detection pipeline executor actually routes.
7712
+ *
7713
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7714
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7715
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7716
+ * enum) — the two used to share the name `ClassMapDefinition`/
7717
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7718
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7719
+ * are not: it is two different concepts colliding on a name. Keep this type
7720
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7721
+ * would either narrow every `ClassMapDefinition` consumer to the four
7722
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7723
+ * schema exists for (see the "rejects a classMap whose target is not a
7724
+ * detection macro" test in `model-catalog-schema.test.ts`).
7725
+ */
7726
+ var DetectionCatalogClassMapSchema = object({
7727
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7728
+ preserveOriginal: boolean()
7729
+ });
7670
7730
  /**
7671
7731
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7672
7732
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7689,10 +7749,55 @@ var RecordingStorageModeSchema = _enum([
7689
7749
  "events",
7690
7750
  "continuous"
7691
7751
  ]);
7752
+ /**
7753
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7754
+ * tre offerte dallo step `object-detection`, da UNA lista
7755
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7756
+ */
7757
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7758
+ /**
7759
+ * True quando `values` non ripete un elemento.
7760
+ *
7761
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7762
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7763
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7764
+ */
7765
+ var noDuplicates = (values) => new Set(values).size === values.length;
7692
7766
  /** Which detectors trigger an `events`-mode band. */
7693
7767
  var RecordingTriggersSchema = object({
7694
7768
  motion: boolean().optional(),
7695
- audioThresholdDbfs: number().optional()
7769
+ audioThresholdDbfs: number().optional(),
7770
+ /**
7771
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7772
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7773
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7774
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7775
+ *
7776
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7777
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7778
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7779
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7780
+ * finestre — vedi `recorder/object-trigger.ts`.
7781
+ */
7782
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7783
+ /**
7784
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7785
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7786
+ * `objectClasses`.
7787
+ *
7788
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7789
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7790
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7791
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7792
+ * device (D12) — mai un elenco globale di cap.
7793
+ *
7794
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7795
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7796
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7797
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7798
+ * registrare.
7799
+ */
7800
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7696
7801
  });
7697
7802
  /**
7698
7803
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8198,41 +8303,6 @@ function pickClosestResolution(entries, target) {
8198
8303
  }
8199
8304
  return bestAbove?.entry ?? bestBelow?.entry;
8200
8305
  }
8201
- var LabelDefinitionSchema = object({
8202
- id: string(),
8203
- name: string(),
8204
- category: string().optional(),
8205
- description: string().optional(),
8206
- icon: string().optional()
8207
- });
8208
- /**
8209
- * Wire schema for a per-model CATALOG classMap override
8210
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8211
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8212
- * detection pipeline executor actually routes.
8213
- *
8214
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8215
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8216
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8217
- * enum) — the two used to share the name `ClassMapDefinition`/
8218
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8219
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8220
- * are not: it is two different concepts colliding on a name. Keep this type
8221
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8222
- * would either narrow every `ClassMapDefinition` consumer to the four
8223
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8224
- * schema exists for (see the "rejects a classMap whose target is not a
8225
- * detection macro" test in `model-catalog-schema.test.ts`).
8226
- */
8227
- var DetectionCatalogClassMapSchema = object({
8228
- mapping: record(string(), _enum([
8229
- "person",
8230
- "vehicle",
8231
- "animal",
8232
- "package"
8233
- ])),
8234
- preserveOriginal: boolean()
8235
- });
8236
8306
  var MODEL_FORMATS = [
8237
8307
  "onnx",
8238
8308
  "coreml",
@@ -21095,7 +21165,7 @@ var lifecycleJobSchema = object({
21095
21165
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21096
21166
  * as every other cap.
21097
21167
  */
21098
- var LogLevelSchema$1 = _enum([
21168
+ var LogLevelSchema$2 = _enum([
21099
21169
  "debug",
21100
21170
  "info",
21101
21171
  "warn",
@@ -21302,7 +21372,7 @@ var CustomActionInputSchema = object({
21302
21372
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21303
21373
  addonId: string(),
21304
21374
  limit: number().min(1).max(500).default(100),
21305
- level: LogLevelSchema$1.optional()
21375
+ level: LogLevelSchema$2.optional()
21306
21376
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21307
21377
  packageName: string(),
21308
21378
  version: string().optional()
@@ -21400,7 +21470,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21400
21470
  auth: "admin"
21401
21471
  }), method(object({
21402
21472
  addonId: string(),
21403
- level: LogLevelSchema$1.optional()
21473
+ level: LogLevelSchema$2.optional()
21404
21474
  }), LogStreamEntrySchema, { kind: "subscription" });
21405
21475
  object({
21406
21476
  /** Carbon dioxide concentration in ppm. */
@@ -22394,6 +22464,35 @@ var FaceFilterEnum = _enum([
22394
22464
  "identified",
22395
22465
  "all"
22396
22466
  ]);
22467
+ /**
22468
+ * What a `listRecentFaces` page is ORDERED BY.
22469
+ *
22470
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22471
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22472
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22473
+ * order: it puts the suggestions an operator can confirm with one tap at the
22474
+ * top, and it is the reason this enum exists — a client that ranked a capped
22475
+ * page client-side was ranking the newest N, never the most certain N.
22476
+ *
22477
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22478
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22479
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22480
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22481
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22482
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22483
+ * then by faceId, and is what makes this a total order instead of the
22484
+ * backend's NULL-collation accident.
22485
+ */
22486
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22487
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22488
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22489
+ * never leaves the server. */
22490
+ var FaceClusterSchema = object({
22491
+ faceIds: array(string()).readonly(),
22492
+ representativeFaceId: string(),
22493
+ size: number().int(),
22494
+ cohesion: number()
22495
+ });
22397
22496
  var MediaFileLiteSchema$1 = object({
22398
22497
  key: string(),
22399
22498
  kind: string(),
@@ -22440,24 +22539,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22440
22539
  kind: "mutation",
22441
22540
  auth: "admin"
22442
22541
  }), method(object({
22443
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22542
+ /**
22543
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22544
+ *
22545
+ * The legacy single-camera form, kept verbatim for every caller that
22546
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22547
+ * instead — never both: `deviceIds` is the authority whenever it is
22548
+ * present, and this field is then ignored rather than unioned, so
22549
+ * there is exactly one answer to "which cameras did I ask for".
22550
+ */
22444
22551
  deviceId: number().int().optional(),
22552
+ /**
22553
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22554
+ * until now had to fetch the cluster-wide page and drop rows in the
22555
+ * client (so the `limit` it asked for was spent on cameras it was
22556
+ * about to discard).
22557
+ *
22558
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22559
+ * "every camera". A request for no devices is a request, not an
22560
+ * omission; same contract as `deviceManager.listFleet` and
22561
+ * `pipelineAnalytics.listRecentTracks`.
22562
+ *
22563
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22564
+ */
22565
+ deviceIds: array(number().int()).optional(),
22445
22566
  limit: number().int().positive().optional(),
22446
22567
  filter: FaceFilterEnum.optional(),
22447
22568
  /**
22448
- * Inline the base64 crop on every row. Default `true` — the existing
22449
- * behaviour, kept so no caller breaks.
22569
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22570
+ * Absent means no lower bound.
22571
+ */
22572
+ since: number().int().optional(),
22573
+ /**
22574
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22575
+ * Absent means no upper bound.
22576
+ */
22577
+ until: number().int().optional(),
22578
+ /**
22579
+ * Order the page by time or by suggestion certainty. Default
22580
+ * `'timestamp'` — the historical order, unchanged for every caller
22581
+ * that does not ask.
22450
22582
  *
22451
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22452
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22453
- * the browser cache the images.
22583
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22584
+ * does under `'suggestionConfidence'`.
22454
22585
  *
22455
- * **This is an INPUT field, so it does not reach the addon until the
22456
- * next train.** The hub router validates cap inputs against its own
22457
- * compiled Zod, which strips a key it does not know — verified today
22458
- * on the OUTPUT side, where an additive field DOES arrive immediately
22459
- * (`Track.hasFace`). Until the train ships, sending `false` is
22460
- * harmless and simply keeps the crops inline.
22586
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22587
+ * index and stops reading as soon as `limit` rows have PASSED the
22588
+ * filter. `'suggestionConfidence'` cannot stop early — the most
22589
+ * certain row may be the oldest — so it walks the window. Narrow it
22590
+ * with {@link since} / {@link until}.
22591
+ */
22592
+ sortBy: FaceSortFieldEnum.optional(),
22593
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22594
+ sortDirection: FaceSortDirectionEnum.optional(),
22595
+ /**
22596
+ * Inline the base64 crop on every row.
22597
+ *
22598
+ * Default `false` since the 2026-08-25 inversion — see
22599
+ * `include-crops-default.ts`, which is the ONE place that resolves
22600
+ * this for every gallery, and which records why the inline shape had
22601
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22602
+ * The doc here used to still say `true`; it was wrong, and a leftover
22603
+ * that describes the old design reads as permission to rely on it.
22604
+ *
22605
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22606
+ * which the browser fetches off the `event-media` plane in parallel,
22607
+ * cached and ETagged.
22461
22608
  */
22462
22609
  includeCrops: boolean().optional()
22463
22610
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22493,13 +22640,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22493
22640
  }), method(object({
22494
22641
  threshold: number().min(0).max(1).optional(),
22495
22642
  minClusterSize: number().int().min(2).optional(),
22496
- limit: number().int().positive().optional()
22497
- }).optional(), array(object({
22498
- faceIds: array(string()).readonly(),
22499
- representativeFaceId: string(),
22500
- size: number().int(),
22501
- cohesion: number()
22502
- })).readonly());
22643
+ /**
22644
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22645
+ * which read as though it bounded the work — it never did.
22646
+ *
22647
+ * Wins over {@link limit} when both are sent.
22648
+ */
22649
+ maxClusters: number().int().positive().optional(),
22650
+ /**
22651
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22652
+ * RESULT, not the scan. Kept so existing callers keep working; send
22653
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22654
+ */
22655
+ limit: number().int().positive().optional(),
22656
+ /**
22657
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22658
+ * POOL, not the result.
22659
+ *
22660
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22661
+ * used to read every unassigned face on the hub no matter what the
22662
+ * caller asked for, because the only bound cut the finished clusters
22663
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22664
+ * whole corpus, on an addon whose disk is under contention.
22665
+ *
22666
+ * The pool is the NEWEST matching faces first — the same order the
22667
+ * gallery shows — so a bound here shortens the horizon, it does not
22668
+ * sample it randomly.
22669
+ *
22670
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22671
+ * so the live corpus — 372 face rows — is unaffected while the
22672
+ * unbounded scan can never come back as the table grows.
22673
+ */
22674
+ maxFacesScanned: number().int().positive().optional()
22675
+ }).optional(), array(FaceClusterSchema).readonly());
22503
22676
  /**
22504
22677
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22505
22678
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -26222,6 +26395,211 @@ var SetSiteLocationInputSchema = object({
26222
26395
  latitude: number().min(-90).max(90),
26223
26396
  longitude: number().min(-180).max(180)
26224
26397
  }).nullable();
26398
+ /**
26399
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26400
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26401
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26402
+ * already prints - never a token, never an `Authorization` header.
26403
+ */
26404
+ var RequestCensusGroupSchema = object({
26405
+ procedure: string(),
26406
+ userAgent: string(),
26407
+ ip: string(),
26408
+ principal: string(),
26409
+ calls: number(),
26410
+ perMin: number()
26411
+ });
26412
+ /**
26413
+ * A procedure's TOTAL over the window, across every caller.
26414
+ *
26415
+ * This block, not the group list, is what answers "did these calls arrive over
26416
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26417
+ * same window excludes the HTTP plane, which is a result, not a failure.
26418
+ */
26419
+ var RequestCensusProcedureSchema = object({
26420
+ procedure: string(),
26421
+ calls: number(),
26422
+ perMin: number()
26423
+ });
26424
+ /**
26425
+ * The census as an operator sees it.
26426
+ *
26427
+ * `persisted` is the honest answer to "will this survive the restart I am
26428
+ * about to do": the arm deadline is written to `system-settings` so a window
26429
+ * armed now can measure the NEXT boot, and a write that failed must not look
26430
+ * like one that succeeded.
26431
+ */
26432
+ var RequestCensusStatusSchema = object({
26433
+ armed: boolean(),
26434
+ /** How long the current - or just-closed - window collected, in ms. */
26435
+ elapsedMs: number(),
26436
+ /** The window actually armed, after the server clamped the request. */
26437
+ windowMs: number(),
26438
+ /** Epoch ms the window closes at. 0 when disarmed. */
26439
+ armedUntilMs: number(),
26440
+ httpRequests: number(),
26441
+ batchedRequests: number(),
26442
+ /**
26443
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26444
+ * is in play (`?batch=1` carries several procedures in one request); this is
26445
+ * the number comparable with a store-side call count.
26446
+ */
26447
+ procedureCalls: number(),
26448
+ /**
26449
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26450
+ * transport resolves one context per connection - but the number that says
26451
+ * whether a plane this census cannot see was busy while HTTP was quiet.
26452
+ */
26453
+ wsConnections: number(),
26454
+ distinctGroups: number(),
26455
+ /** Calls counted in the totals whose group attribution was shed at the
26456
+ * cardinality bound. */
26457
+ unattributedCalls: number(),
26458
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26459
+ groups: array(RequestCensusGroupSchema).readonly()
26460
+ }).extend({ persisted: boolean() });
26461
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26462
+ var LogLevelSchema$1 = _enum([
26463
+ "debug",
26464
+ "info",
26465
+ "warn",
26466
+ "error"
26467
+ ]);
26468
+ /**
26469
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26470
+ *
26471
+ * A diagnostic is anything whose cost is only worth paying while a question is
26472
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26473
+ */
26474
+ var DiagnosticIdSchema = _enum(["request-census"]);
26475
+ /**
26476
+ * The layers of the level hierarchy, general → specific. The most specific
26477
+ * layer that carries an explicit value wins.
26478
+ *
26479
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26480
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26481
+ * grow later would force every consumer of this document to change with it.
26482
+ * Nothing returns `component` today.
26483
+ */
26484
+ var LoggingScopeKindSchema = _enum([
26485
+ "cluster",
26486
+ "node",
26487
+ "component"
26488
+ ]);
26489
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26490
+ var LoggingLevelSourceSchema = _enum([
26491
+ "default",
26492
+ "cluster",
26493
+ "node",
26494
+ "component"
26495
+ ]);
26496
+ /**
26497
+ * One layer of the hierarchy as it actually STANDS.
26498
+ *
26499
+ * `level: null` is the whole reason this array is returned: it is the
26500
+ * difference between "this node is at `info` because I decided it" and
26501
+ * "...because it inherits". An operator who clears an override believing they
26502
+ * are clearing an inherited value has been handed the same defect as the two
26503
+ * contradicting knobs this document exists to remove, moved one floor up.
26504
+ */
26505
+ var LoggingLevelLayerSchema = object({
26506
+ scope: LoggingScopeKindSchema,
26507
+ /** The node this layer speaks for; `null` on the cluster layer. */
26508
+ nodeId: string().nullable(),
26509
+ /** Explicitly set here, or `null` when this layer inherits. */
26510
+ level: LogLevelSchema$1.nullable()
26511
+ });
26512
+ /** What a line is judged against, and WHICH layer decided it. */
26513
+ var LoggingEffectiveSchema = object({
26514
+ level: LogLevelSchema$1,
26515
+ levelSource: LoggingLevelSourceSchema
26516
+ });
26517
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26518
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26519
+ /**
26520
+ * An armed diagnostic, with its DEADLINE.
26521
+ *
26522
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26523
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26524
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26525
+ * `armed` is false — a window is never reported as slightly expired.
26526
+ */
26527
+ var DiagnosticWindowSchema = object({
26528
+ id: DiagnosticIdSchema,
26529
+ armed: boolean(),
26530
+ /** Epoch ms the window closes at. 0 when disarmed. */
26531
+ armedUntilMs: number(),
26532
+ /** Ms left before it expires on its own. 0 when disarmed. */
26533
+ remainingMs: number(),
26534
+ /** Whether the stored deadline is the one the live diagnostic is running —
26535
+ * i.e. whether this window would survive a restart. */
26536
+ persisted: boolean()
26537
+ });
26538
+ /**
26539
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26540
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26541
+ * is a second knob that disagrees with the first the day one of them moves.
26542
+ */
26543
+ var DiagnosticWindowPatchSchema = object({
26544
+ id: DiagnosticIdSchema,
26545
+ armMs: number().int().min(0),
26546
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26547
+ reportEveryMs: number().int().positive().optional()
26548
+ });
26549
+ /**
26550
+ * A PATCH, and patches MERGE.
26551
+ *
26552
+ * A field absent from the patch is left exactly as it was — arming a
26553
+ * diagnostic never resets a level, and setting a level never disarms a window.
26554
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26555
+ * `setAll` already merges, and rebuilding the object is how an absent field
26556
+ * turns into an erased one.
26557
+ */
26558
+ var LoggingSettingsPatchSchema = object({
26559
+ /**
26560
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26561
+ * addressed scope so it inherits again. A value sets it.
26562
+ */
26563
+ level: LogLevelSchema$1.nullable().optional(),
26564
+ /**
26565
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26566
+ * keeps running — a patch is never a full replacement.
26567
+ */
26568
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26569
+ });
26570
+ /**
26571
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26572
+ *
26573
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26574
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26575
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26576
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26577
+ * by an agent that holds no cluster document at all. The hub is the single
26578
+ * authority over the whole hierarchy and answers for every layer, so the
26579
+ * layer selector needs a name the transport does not already own.
26580
+ */
26581
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26582
+ var SetLoggingSettingsInputSchema = object({
26583
+ scopeNodeId: string().optional(),
26584
+ patch: LoggingSettingsPatchSchema
26585
+ });
26586
+ /**
26587
+ * The whole document, as read and as returned after every write.
26588
+ *
26589
+ * `persisted: false` means the settings store could not be read or written.
26590
+ * The in-memory mirror still governs behaviour and is unchanged by the
26591
+ * failure — a read that fails neither switches a level nor disarms a window
26592
+ * (D49) — but the operator is told that what they are looking at would not
26593
+ * survive a restart.
26594
+ */
26595
+ var LoggingSettingsStateSchema = object({
26596
+ /** The layer this document was read at. `null` = the cluster layer. */
26597
+ scopeNodeId: string().nullable(),
26598
+ effective: LoggingEffectiveSchema,
26599
+ explicit: LoggingExplicitSchema,
26600
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26601
+ persisted: boolean()
26602
+ });
26225
26603
  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(), {
26226
26604
  kind: "mutation",
26227
26605
  auth: "admin"
@@ -26234,6 +26612,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26234
26612
  }), method(_void(), SiteLocationStatusSchema, {
26235
26613
  kind: "mutation",
26236
26614
  auth: "admin"
26615
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26616
+ kind: "mutation",
26617
+ auth: "admin"
26237
26618
  });
26238
26619
  object({
26239
26620
  /** True when the device's tamper switch / case-open contact is
@@ -32065,6 +32446,18 @@ Object.freeze({
32065
32446
  addonId: null,
32066
32447
  access: "create"
32067
32448
  },
32449
+ "system.getLoggingSettings": {
32450
+ capName: "system",
32451
+ capScope: "system",
32452
+ addonId: null,
32453
+ access: "view"
32454
+ },
32455
+ "system.getRequestCensus": {
32456
+ capName: "system",
32457
+ capScope: "system",
32458
+ addonId: null,
32459
+ access: "view"
32460
+ },
32068
32461
  "system.getRetentionConfig": {
32069
32462
  capName: "system",
32070
32463
  capScope: "system",
@@ -32095,6 +32488,12 @@ Object.freeze({
32095
32488
  addonId: null,
32096
32489
  access: "view"
32097
32490
  },
32491
+ "system.setLoggingSettings": {
32492
+ capName: "system",
32493
+ capScope: "system",
32494
+ addonId: null,
32495
+ access: "create"
32496
+ },
32098
32497
  "system.setRetentionConfig": {
32099
32498
  capName: "system",
32100
32499
  capScope: "system",
@@ -33250,6 +33649,10 @@ Object.freeze({
33250
33649
  name: "deviceId",
33251
33650
  form: "single",
33252
33651
  optional: true
33652
+ }, {
33653
+ name: "deviceIds",
33654
+ form: "array",
33655
+ optional: true
33253
33656
  }],
33254
33657
  "fanControl.setDirection": [{
33255
33658
  name: "deviceId",
@@ -34860,7 +35263,38 @@ object({
34860
35263
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34861
35264
  * reproduce that.
34862
35265
  */
34863
- tileBudgetMb: number().int().min(0).max(1024)
35266
+ tileBudgetMb: number().int().min(0).max(1024),
35267
+ /**
35268
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35269
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35270
+ * subject tiles, on frames that detected something.
35271
+ *
35272
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35273
+ * containment is strict by design, so the native `keyFrame`, the detail
35274
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35275
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35276
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35277
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35278
+ *
35279
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35280
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35281
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35282
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35283
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35284
+ * binds only through a detection burst, where it still covers well past the
35285
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35286
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35287
+ * whole shape exists to avoid.
35288
+ *
35289
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35290
+ * subject tile, so one shared budget would let a busy camera's key frames
35291
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35292
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35293
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35294
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35295
+ * nothing.
35296
+ */
35297
+ sceneBudgetMb: number().int().min(0).max(1024)
34864
35298
  });
34865
35299
  /**
34866
35300
  * The values in force when the operator has set nothing.
@@ -34876,12 +35310,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34876
35310
  budgetMb: 1024,
34877
35311
  activityMs: 15e3,
34878
35312
  tileBudgetMb: 64,
35313
+ sceneBudgetMb: 48,
34879
35314
  admission: "inferred"
34880
35315
  };
34881
35316
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34882
35317
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34883
35318
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34884
35319
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35320
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34885
35321
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34886
35322
  var MB = 1024 * 1024;
34887
35323
  1024 * MB, 3072 * MB;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-alexa",
3
- "version": "1.2.37",
3
+ "version": "1.2.38",
4
4
  "description": "Alexa Smart Home Skill export — hub-side OAuth provider + directive handler. The companion AWS Lambda forwards Alexa directives to this addon's /addon/export-alexa/directive endpoint.",
5
5
  "keywords": [
6
6
  "camstack",