@camstack/addon-export-alexa 1.2.37 → 1.2.39

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.
@@ -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,293 @@ var SetSiteLocationInputSchema = object({
26222
26395
  latitude: number().min(-90).max(90),
26223
26396
  longitude: number().min(-180).max(180)
26224
26397
  }).nullable();
26398
+ /**
26399
+ * The TRANSPORT a call arrived on.
26400
+ *
26401
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26402
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26403
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26404
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26405
+ * checkable rather than asserted.
26406
+ *
26407
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26408
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26409
+ * connection; the viewer talks to the hub over `wsLink`
26410
+ * exclusively, so this is the plane the HTTP census could not see.
26411
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26412
+ * never touches a socket and therefore never touched a census.
26413
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26414
+ * that is exactly what its `0` asserts: every plane the hub has can name
26415
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26416
+ * plane nobody instrumented lands here instead of vanishing from the total.
26417
+ */
26418
+ var TransportPlaneSchema = _enum([
26419
+ "http",
26420
+ "ws",
26421
+ "mesh",
26422
+ "unknown"
26423
+ ]);
26424
+ /**
26425
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26426
+ * reads as "not instrumented", which is the one thing this census must never
26427
+ * make an operator wonder about.
26428
+ */
26429
+ var TransportPlaneCountsSchema = object({
26430
+ http: number(),
26431
+ ws: number(),
26432
+ mesh: number(),
26433
+ unknown: number()
26434
+ });
26435
+ /**
26436
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26437
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26438
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26439
+ * already prints - never a token, never an `Authorization` header.
26440
+ *
26441
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26442
+ * and lives for hours, so folding it into a call count makes one long-lived
26443
+ * stream look like a storm.
26444
+ */
26445
+ var RequestCensusGroupSchema = object({
26446
+ plane: TransportPlaneSchema,
26447
+ procedure: string(),
26448
+ userAgent: string(),
26449
+ ip: string(),
26450
+ principal: string(),
26451
+ calls: number(),
26452
+ subscriptions: number(),
26453
+ perMin: number()
26454
+ });
26455
+ /**
26456
+ * A procedure's TOTAL over the window, across every caller.
26457
+ *
26458
+ * This block, not the group list, is what answers "did these calls arrive over
26459
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26460
+ * same window excludes the HTTP plane, which is a result, not a failure.
26461
+ */
26462
+ var RequestCensusProcedureSchema = object({
26463
+ procedure: string(),
26464
+ calls: number(),
26465
+ /**
26466
+ * The same total, split by transport. THIS is the row that answers the
26467
+ * question the census exists for: one look at `deviceManager.listAll` says
26468
+ * which plane carried the 4 960, without joining two log lines by eye.
26469
+ */
26470
+ planes: TransportPlaneCountsSchema,
26471
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26472
+ subscriptions: number(),
26473
+ perMin: number()
26474
+ });
26475
+ /**
26476
+ * The census as an operator sees it.
26477
+ *
26478
+ * `persisted` is the honest answer to "will this survive the restart I am
26479
+ * about to do": the arm deadline is written to `system-settings` so a window
26480
+ * armed now can measure the NEXT boot, and a write that failed must not look
26481
+ * like one that succeeded.
26482
+ */
26483
+ var RequestCensusStatusSchema = object({
26484
+ armed: boolean(),
26485
+ /** How long the current - or just-closed - window collected, in ms. */
26486
+ elapsedMs: number(),
26487
+ /** The window actually armed, after the server clamped the request. */
26488
+ windowMs: number(),
26489
+ /** Epoch ms the window closes at. 0 when disarmed. */
26490
+ armedUntilMs: number(),
26491
+ httpRequests: number(),
26492
+ batchedRequests: number(),
26493
+ /**
26494
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26495
+ * is in play (`?batch=1` carries several procedures in one request); this is
26496
+ * the number comparable with a store-side call count.
26497
+ */
26498
+ procedureCalls: number(),
26499
+ /**
26500
+ * `procedureCalls` split by transport. The four keys sum to
26501
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26502
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26503
+ */
26504
+ planes: TransportPlaneCountsSchema,
26505
+ /**
26506
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26507
+ * on no plane at all - which is a RESULT (a plane is missing from the
26508
+ * instrument), not a failure, and it has to be visible to be read as one.
26509
+ */
26510
+ planesExplainTotal: boolean(),
26511
+ /**
26512
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26513
+ * adapter resolves one context per connection - kept because a plane's call
26514
+ * count of zero against 37 open connections says something different from a
26515
+ * plane with no connections at all.
26516
+ */
26517
+ wsConnections: number(),
26518
+ /**
26519
+ * Client frames the WS plane looked at. `wsMessages` far above
26520
+ * `planes.ws + subscriptions` means most traffic is not operations
26521
+ * (keepalives, connection params) - which is itself an answer.
26522
+ */
26523
+ wsMessages: number(),
26524
+ /**
26525
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26526
+ * purpose: one live-events stream opened at boot and held for six hours is
26527
+ * one subscription, and counting it as a call would let a quiet plane
26528
+ * masquerade as the storm.
26529
+ */
26530
+ subscriptions: number(),
26531
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26532
+ subscriptionStops: number(),
26533
+ distinctGroups: number(),
26534
+ /**
26535
+ * Operations counted in the totals whose CALLER attribution was shed at the
26536
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26537
+ * which transport they arrived on, they just lost their group row.
26538
+ */
26539
+ unattributedCalls: number(),
26540
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26541
+ groups: array(RequestCensusGroupSchema).readonly()
26542
+ }).extend({ persisted: boolean() });
26543
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26544
+ var LogLevelSchema$1 = _enum([
26545
+ "debug",
26546
+ "info",
26547
+ "warn",
26548
+ "error"
26549
+ ]);
26550
+ /**
26551
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26552
+ *
26553
+ * A diagnostic is anything whose cost is only worth paying while a question is
26554
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26555
+ */
26556
+ var DiagnosticIdSchema = _enum(["request-census"]);
26557
+ /**
26558
+ * The layers of the level hierarchy, general → specific. The most specific
26559
+ * layer that carries an explicit value wins.
26560
+ *
26561
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26562
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26563
+ * grow later would force every consumer of this document to change with it.
26564
+ * Nothing returns `component` today.
26565
+ */
26566
+ var LoggingScopeKindSchema = _enum([
26567
+ "cluster",
26568
+ "node",
26569
+ "component"
26570
+ ]);
26571
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26572
+ var LoggingLevelSourceSchema = _enum([
26573
+ "default",
26574
+ "cluster",
26575
+ "node",
26576
+ "component"
26577
+ ]);
26578
+ /**
26579
+ * One layer of the hierarchy as it actually STANDS.
26580
+ *
26581
+ * `level: null` is the whole reason this array is returned: it is the
26582
+ * difference between "this node is at `info` because I decided it" and
26583
+ * "...because it inherits". An operator who clears an override believing they
26584
+ * are clearing an inherited value has been handed the same defect as the two
26585
+ * contradicting knobs this document exists to remove, moved one floor up.
26586
+ */
26587
+ var LoggingLevelLayerSchema = object({
26588
+ scope: LoggingScopeKindSchema,
26589
+ /** The node this layer speaks for; `null` on the cluster layer. */
26590
+ nodeId: string().nullable(),
26591
+ /** Explicitly set here, or `null` when this layer inherits. */
26592
+ level: LogLevelSchema$1.nullable()
26593
+ });
26594
+ /** What a line is judged against, and WHICH layer decided it. */
26595
+ var LoggingEffectiveSchema = object({
26596
+ level: LogLevelSchema$1,
26597
+ levelSource: LoggingLevelSourceSchema
26598
+ });
26599
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26600
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26601
+ /**
26602
+ * An armed diagnostic, with its DEADLINE.
26603
+ *
26604
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26605
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26606
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26607
+ * `armed` is false — a window is never reported as slightly expired.
26608
+ */
26609
+ var DiagnosticWindowSchema = object({
26610
+ id: DiagnosticIdSchema,
26611
+ armed: boolean(),
26612
+ /** Epoch ms the window closes at. 0 when disarmed. */
26613
+ armedUntilMs: number(),
26614
+ /** Ms left before it expires on its own. 0 when disarmed. */
26615
+ remainingMs: number(),
26616
+ /** Whether the stored deadline is the one the live diagnostic is running —
26617
+ * i.e. whether this window would survive a restart. */
26618
+ persisted: boolean()
26619
+ });
26620
+ /**
26621
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26622
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26623
+ * is a second knob that disagrees with the first the day one of them moves.
26624
+ */
26625
+ var DiagnosticWindowPatchSchema = object({
26626
+ id: DiagnosticIdSchema,
26627
+ armMs: number().int().min(0),
26628
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26629
+ reportEveryMs: number().int().positive().optional()
26630
+ });
26631
+ /**
26632
+ * A PATCH, and patches MERGE.
26633
+ *
26634
+ * A field absent from the patch is left exactly as it was — arming a
26635
+ * diagnostic never resets a level, and setting a level never disarms a window.
26636
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26637
+ * `setAll` already merges, and rebuilding the object is how an absent field
26638
+ * turns into an erased one.
26639
+ */
26640
+ var LoggingSettingsPatchSchema = object({
26641
+ /**
26642
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26643
+ * addressed scope so it inherits again. A value sets it.
26644
+ */
26645
+ level: LogLevelSchema$1.nullable().optional(),
26646
+ /**
26647
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26648
+ * keeps running — a patch is never a full replacement.
26649
+ */
26650
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26651
+ });
26652
+ /**
26653
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26654
+ *
26655
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26656
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26657
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26658
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26659
+ * by an agent that holds no cluster document at all. The hub is the single
26660
+ * authority over the whole hierarchy and answers for every layer, so the
26661
+ * layer selector needs a name the transport does not already own.
26662
+ */
26663
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26664
+ var SetLoggingSettingsInputSchema = object({
26665
+ scopeNodeId: string().optional(),
26666
+ patch: LoggingSettingsPatchSchema
26667
+ });
26668
+ /**
26669
+ * The whole document, as read and as returned after every write.
26670
+ *
26671
+ * `persisted: false` means the settings store could not be read or written.
26672
+ * The in-memory mirror still governs behaviour and is unchanged by the
26673
+ * failure — a read that fails neither switches a level nor disarms a window
26674
+ * (D49) — but the operator is told that what they are looking at would not
26675
+ * survive a restart.
26676
+ */
26677
+ var LoggingSettingsStateSchema = object({
26678
+ /** The layer this document was read at. `null` = the cluster layer. */
26679
+ scopeNodeId: string().nullable(),
26680
+ effective: LoggingEffectiveSchema,
26681
+ explicit: LoggingExplicitSchema,
26682
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26683
+ persisted: boolean()
26684
+ });
26225
26685
  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
26686
  kind: "mutation",
26227
26687
  auth: "admin"
@@ -26234,6 +26694,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26234
26694
  }), method(_void(), SiteLocationStatusSchema, {
26235
26695
  kind: "mutation",
26236
26696
  auth: "admin"
26697
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26698
+ kind: "mutation",
26699
+ auth: "admin"
26237
26700
  });
26238
26701
  object({
26239
26702
  /** True when the device's tamper switch / case-open contact is
@@ -32065,6 +32528,18 @@ Object.freeze({
32065
32528
  addonId: null,
32066
32529
  access: "create"
32067
32530
  },
32531
+ "system.getLoggingSettings": {
32532
+ capName: "system",
32533
+ capScope: "system",
32534
+ addonId: null,
32535
+ access: "view"
32536
+ },
32537
+ "system.getRequestCensus": {
32538
+ capName: "system",
32539
+ capScope: "system",
32540
+ addonId: null,
32541
+ access: "view"
32542
+ },
32068
32543
  "system.getRetentionConfig": {
32069
32544
  capName: "system",
32070
32545
  capScope: "system",
@@ -32095,6 +32570,12 @@ Object.freeze({
32095
32570
  addonId: null,
32096
32571
  access: "view"
32097
32572
  },
32573
+ "system.setLoggingSettings": {
32574
+ capName: "system",
32575
+ capScope: "system",
32576
+ addonId: null,
32577
+ access: "create"
32578
+ },
32098
32579
  "system.setRetentionConfig": {
32099
32580
  capName: "system",
32100
32581
  capScope: "system",
@@ -33250,6 +33731,10 @@ Object.freeze({
33250
33731
  name: "deviceId",
33251
33732
  form: "single",
33252
33733
  optional: true
33734
+ }, {
33735
+ name: "deviceIds",
33736
+ form: "array",
33737
+ optional: true
33253
33738
  }],
33254
33739
  "fanControl.setDirection": [{
33255
33740
  name: "deviceId",
@@ -34860,7 +35345,38 @@ object({
34860
35345
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34861
35346
  * reproduce that.
34862
35347
  */
34863
- tileBudgetMb: number().int().min(0).max(1024)
35348
+ tileBudgetMb: number().int().min(0).max(1024),
35349
+ /**
35350
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35351
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35352
+ * subject tiles, on frames that detected something.
35353
+ *
35354
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35355
+ * containment is strict by design, so the native `keyFrame`, the detail
35356
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35357
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35358
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35359
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35360
+ *
35361
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35362
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35363
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35364
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35365
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35366
+ * binds only through a detection burst, where it still covers well past the
35367
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35368
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35369
+ * whole shape exists to avoid.
35370
+ *
35371
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35372
+ * subject tile, so one shared budget would let a busy camera's key frames
35373
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35374
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35375
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35376
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35377
+ * nothing.
35378
+ */
35379
+ sceneBudgetMb: number().int().min(0).max(1024)
34864
35380
  });
34865
35381
  /**
34866
35382
  * The values in force when the operator has set nothing.
@@ -34876,12 +35392,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34876
35392
  budgetMb: 1024,
34877
35393
  activityMs: 15e3,
34878
35394
  tileBudgetMb: 64,
35395
+ sceneBudgetMb: 48,
34879
35396
  admission: "inferred"
34880
35397
  };
34881
35398
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34882
35399
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34883
35400
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34884
35401
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35402
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34885
35403
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34886
35404
  var MB = 1024 * 1024;
34887
35405
  1024 * MB, 3072 * MB;