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