@camstack/addon-notifiers 1.2.35 → 1.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +577 -59
  2. package/dist/addon.mjs +577 -59
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7659,6 +7659,66 @@ var OpsLogQueryInputSchema = object({
7659
7659
  /** Max rows returned, newest-first. */
7660
7660
  limit: number().int().min(1).max(1e3).optional()
7661
7661
  });
7662
+ var LabelDefinitionSchema = object({
7663
+ id: string(),
7664
+ name: string(),
7665
+ category: string().optional(),
7666
+ description: string().optional(),
7667
+ icon: string().optional()
7668
+ });
7669
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7670
+ var CLASS_MAP_MACRO_TARGETS = [
7671
+ "person",
7672
+ "vehicle",
7673
+ "animal",
7674
+ "package"
7675
+ ];
7676
+ /**
7677
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7678
+ * un operatore può selezionare.
7679
+ *
7680
+ * Sono le tre offerte dallo step `object-detection`
7681
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7682
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7683
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7684
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7685
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7686
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7687
+ *
7688
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7689
+ * dello step e una seconda volta come union `FirstLevelMacro`
7690
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7691
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7692
+ * successiva.
7693
+ */
7694
+ var FIRST_LEVEL_MACRO_CLASSES = [
7695
+ "person",
7696
+ "vehicle",
7697
+ "animal"
7698
+ ];
7699
+ /**
7700
+ * Wire schema for a per-model CATALOG classMap override
7701
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7702
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7703
+ * detection pipeline executor actually routes.
7704
+ *
7705
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7706
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7707
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7708
+ * enum) — the two used to share the name `ClassMapDefinition`/
7709
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7710
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7711
+ * are not: it is two different concepts colliding on a name. Keep this type
7712
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7713
+ * would either narrow every `ClassMapDefinition` consumer to the four
7714
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7715
+ * schema exists for (see the "rejects a classMap whose target is not a
7716
+ * detection macro" test in `model-catalog-schema.test.ts`).
7717
+ */
7718
+ var DetectionCatalogClassMapSchema = object({
7719
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7720
+ preserveOriginal: boolean()
7721
+ });
7662
7722
  /**
7663
7723
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7664
7724
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7681,10 +7741,55 @@ var RecordingStorageModeSchema = _enum([
7681
7741
  "events",
7682
7742
  "continuous"
7683
7743
  ]);
7744
+ /**
7745
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7746
+ * tre offerte dallo step `object-detection`, da UNA lista
7747
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7748
+ */
7749
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7750
+ /**
7751
+ * True quando `values` non ripete un elemento.
7752
+ *
7753
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7754
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7755
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7756
+ */
7757
+ var noDuplicates = (values) => new Set(values).size === values.length;
7684
7758
  /** Which detectors trigger an `events`-mode band. */
7685
7759
  var RecordingTriggersSchema = object({
7686
7760
  motion: boolean().optional(),
7687
- audioThresholdDbfs: number().optional()
7761
+ audioThresholdDbfs: number().optional(),
7762
+ /**
7763
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7764
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7765
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7766
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7767
+ *
7768
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7769
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7770
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7771
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7772
+ * finestre — vedi `recorder/object-trigger.ts`.
7773
+ */
7774
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7775
+ /**
7776
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7777
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7778
+ * `objectClasses`.
7779
+ *
7780
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7781
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7782
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7783
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7784
+ * device (D12) — mai un elenco globale di cap.
7785
+ *
7786
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7787
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7788
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7789
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7790
+ * registrare.
7791
+ */
7792
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7688
7793
  });
7689
7794
  /**
7690
7795
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8136,41 +8241,6 @@ var DecoderSessionConfigSchema = object({
8136
8241
  */
8137
8242
  debug: boolean().optional()
8138
8243
  });
8139
- var LabelDefinitionSchema = object({
8140
- id: string(),
8141
- name: string(),
8142
- category: string().optional(),
8143
- description: string().optional(),
8144
- icon: string().optional()
8145
- });
8146
- /**
8147
- * Wire schema for a per-model CATALOG classMap override
8148
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8149
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8150
- * detection pipeline executor actually routes.
8151
- *
8152
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8153
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8154
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8155
- * enum) — the two used to share the name `ClassMapDefinition`/
8156
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8157
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8158
- * are not: it is two different concepts colliding on a name. Keep this type
8159
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8160
- * would either narrow every `ClassMapDefinition` consumer to the four
8161
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8162
- * schema exists for (see the "rejects a classMap whose target is not a
8163
- * detection macro" test in `model-catalog-schema.test.ts`).
8164
- */
8165
- var DetectionCatalogClassMapSchema = object({
8166
- mapping: record(string(), _enum([
8167
- "person",
8168
- "vehicle",
8169
- "animal",
8170
- "package"
8171
- ])),
8172
- preserveOriginal: boolean()
8173
- });
8174
8244
  var MODEL_FORMATS = [
8175
8245
  "onnx",
8176
8246
  "coreml",
@@ -20999,7 +21069,7 @@ var lifecycleJobSchema = object({
20999
21069
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21000
21070
  * as every other cap.
21001
21071
  */
21002
- var LogLevelSchema$1 = _enum([
21072
+ var LogLevelSchema$2 = _enum([
21003
21073
  "debug",
21004
21074
  "info",
21005
21075
  "warn",
@@ -21206,7 +21276,7 @@ var CustomActionInputSchema = object({
21206
21276
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21207
21277
  addonId: string(),
21208
21278
  limit: number().min(1).max(500).default(100),
21209
- level: LogLevelSchema$1.optional()
21279
+ level: LogLevelSchema$2.optional()
21210
21280
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21211
21281
  packageName: string(),
21212
21282
  version: string().optional()
@@ -21304,7 +21374,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21304
21374
  auth: "admin"
21305
21375
  }), method(object({
21306
21376
  addonId: string(),
21307
- level: LogLevelSchema$1.optional()
21377
+ level: LogLevelSchema$2.optional()
21308
21378
  }), LogStreamEntrySchema, { kind: "subscription" });
21309
21379
  object({
21310
21380
  /** Carbon dioxide concentration in ppm. */
@@ -22298,6 +22368,35 @@ var FaceFilterEnum = _enum([
22298
22368
  "identified",
22299
22369
  "all"
22300
22370
  ]);
22371
+ /**
22372
+ * What a `listRecentFaces` page is ORDERED BY.
22373
+ *
22374
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22375
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22376
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22377
+ * order: it puts the suggestions an operator can confirm with one tap at the
22378
+ * top, and it is the reason this enum exists — a client that ranked a capped
22379
+ * page client-side was ranking the newest N, never the most certain N.
22380
+ *
22381
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22382
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22383
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22384
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22385
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22386
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22387
+ * then by faceId, and is what makes this a total order instead of the
22388
+ * backend's NULL-collation accident.
22389
+ */
22390
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22391
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22392
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22393
+ * never leaves the server. */
22394
+ var FaceClusterSchema = object({
22395
+ faceIds: array(string()).readonly(),
22396
+ representativeFaceId: string(),
22397
+ size: number().int(),
22398
+ cohesion: number()
22399
+ });
22301
22400
  var MediaFileLiteSchema$1 = object({
22302
22401
  key: string(),
22303
22402
  kind: string(),
@@ -22344,24 +22443,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22344
22443
  kind: "mutation",
22345
22444
  auth: "admin"
22346
22445
  }), method(object({
22347
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22446
+ /**
22447
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22448
+ *
22449
+ * The legacy single-camera form, kept verbatim for every caller that
22450
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22451
+ * instead — never both: `deviceIds` is the authority whenever it is
22452
+ * present, and this field is then ignored rather than unioned, so
22453
+ * there is exactly one answer to "which cameras did I ask for".
22454
+ */
22348
22455
  deviceId: number().int().optional(),
22456
+ /**
22457
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22458
+ * until now had to fetch the cluster-wide page and drop rows in the
22459
+ * client (so the `limit` it asked for was spent on cameras it was
22460
+ * about to discard).
22461
+ *
22462
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22463
+ * "every camera". A request for no devices is a request, not an
22464
+ * omission; same contract as `deviceManager.listFleet` and
22465
+ * `pipelineAnalytics.listRecentTracks`.
22466
+ *
22467
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22468
+ */
22469
+ deviceIds: array(number().int()).optional(),
22349
22470
  limit: number().int().positive().optional(),
22350
22471
  filter: FaceFilterEnum.optional(),
22351
22472
  /**
22352
- * Inline the base64 crop on every row. Default `true` — the existing
22353
- * behaviour, kept so no caller breaks.
22473
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22474
+ * Absent means no lower bound.
22475
+ */
22476
+ since: number().int().optional(),
22477
+ /**
22478
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22479
+ * Absent means no upper bound.
22480
+ */
22481
+ until: number().int().optional(),
22482
+ /**
22483
+ * Order the page by time or by suggestion certainty. Default
22484
+ * `'timestamp'` — the historical order, unchanged for every caller
22485
+ * that does not ask.
22354
22486
  *
22355
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22356
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22357
- * the browser cache the images.
22487
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22488
+ * does under `'suggestionConfidence'`.
22358
22489
  *
22359
- * **This is an INPUT field, so it does not reach the addon until the
22360
- * next train.** The hub router validates cap inputs against its own
22361
- * compiled Zod, which strips a key it does not know — verified today
22362
- * on the OUTPUT side, where an additive field DOES arrive immediately
22363
- * (`Track.hasFace`). Until the train ships, sending `false` is
22364
- * harmless and simply keeps the crops inline.
22490
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22491
+ * index and stops reading as soon as `limit` rows have PASSED the
22492
+ * filter. `'suggestionConfidence'` cannot stop early — the most
22493
+ * certain row may be the oldest — so it walks the window. Narrow it
22494
+ * with {@link since} / {@link until}.
22495
+ */
22496
+ sortBy: FaceSortFieldEnum.optional(),
22497
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22498
+ sortDirection: FaceSortDirectionEnum.optional(),
22499
+ /**
22500
+ * Inline the base64 crop on every row.
22501
+ *
22502
+ * Default `false` since the 2026-08-25 inversion — see
22503
+ * `include-crops-default.ts`, which is the ONE place that resolves
22504
+ * this for every gallery, and which records why the inline shape had
22505
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22506
+ * The doc here used to still say `true`; it was wrong, and a leftover
22507
+ * that describes the old design reads as permission to rely on it.
22508
+ *
22509
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22510
+ * which the browser fetches off the `event-media` plane in parallel,
22511
+ * cached and ETagged.
22365
22512
  */
22366
22513
  includeCrops: boolean().optional()
22367
22514
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22397,13 +22544,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22397
22544
  }), method(object({
22398
22545
  threshold: number().min(0).max(1).optional(),
22399
22546
  minClusterSize: number().int().min(2).optional(),
22400
- limit: number().int().positive().optional()
22401
- }).optional(), array(object({
22402
- faceIds: array(string()).readonly(),
22403
- representativeFaceId: string(),
22404
- size: number().int(),
22405
- cohesion: number()
22406
- })).readonly());
22547
+ /**
22548
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22549
+ * which read as though it bounded the work — it never did.
22550
+ *
22551
+ * Wins over {@link limit} when both are sent.
22552
+ */
22553
+ maxClusters: number().int().positive().optional(),
22554
+ /**
22555
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22556
+ * RESULT, not the scan. Kept so existing callers keep working; send
22557
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22558
+ */
22559
+ limit: number().int().positive().optional(),
22560
+ /**
22561
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22562
+ * POOL, not the result.
22563
+ *
22564
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22565
+ * used to read every unassigned face on the hub no matter what the
22566
+ * caller asked for, because the only bound cut the finished clusters
22567
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22568
+ * whole corpus, on an addon whose disk is under contention.
22569
+ *
22570
+ * The pool is the NEWEST matching faces first — the same order the
22571
+ * gallery shows — so a bound here shortens the horizon, it does not
22572
+ * sample it randomly.
22573
+ *
22574
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22575
+ * so the live corpus — 372 face rows — is unaffected while the
22576
+ * unbounded scan can never come back as the table grows.
22577
+ */
22578
+ maxFacesScanned: number().int().positive().optional()
22579
+ }).optional(), array(FaceClusterSchema).readonly());
22407
22580
  /**
22408
22581
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22409
22582
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -26126,6 +26299,293 @@ var SetSiteLocationInputSchema = object({
26126
26299
  latitude: number().min(-90).max(90),
26127
26300
  longitude: number().min(-180).max(180)
26128
26301
  }).nullable();
26302
+ /**
26303
+ * The TRANSPORT a call arrived on.
26304
+ *
26305
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26306
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26307
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26308
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26309
+ * checkable rather than asserted.
26310
+ *
26311
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26312
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26313
+ * connection; the viewer talks to the hub over `wsLink`
26314
+ * exclusively, so this is the plane the HTTP census could not see.
26315
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26316
+ * never touches a socket and therefore never touched a census.
26317
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26318
+ * that is exactly what its `0` asserts: every plane the hub has can name
26319
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26320
+ * plane nobody instrumented lands here instead of vanishing from the total.
26321
+ */
26322
+ var TransportPlaneSchema = _enum([
26323
+ "http",
26324
+ "ws",
26325
+ "mesh",
26326
+ "unknown"
26327
+ ]);
26328
+ /**
26329
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26330
+ * reads as "not instrumented", which is the one thing this census must never
26331
+ * make an operator wonder about.
26332
+ */
26333
+ var TransportPlaneCountsSchema = object({
26334
+ http: number(),
26335
+ ws: number(),
26336
+ mesh: number(),
26337
+ unknown: number()
26338
+ });
26339
+ /**
26340
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26341
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26342
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26343
+ * already prints - never a token, never an `Authorization` header.
26344
+ *
26345
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26346
+ * and lives for hours, so folding it into a call count makes one long-lived
26347
+ * stream look like a storm.
26348
+ */
26349
+ var RequestCensusGroupSchema = object({
26350
+ plane: TransportPlaneSchema,
26351
+ procedure: string(),
26352
+ userAgent: string(),
26353
+ ip: string(),
26354
+ principal: string(),
26355
+ calls: number(),
26356
+ subscriptions: number(),
26357
+ perMin: number()
26358
+ });
26359
+ /**
26360
+ * A procedure's TOTAL over the window, across every caller.
26361
+ *
26362
+ * This block, not the group list, is what answers "did these calls arrive over
26363
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26364
+ * same window excludes the HTTP plane, which is a result, not a failure.
26365
+ */
26366
+ var RequestCensusProcedureSchema = object({
26367
+ procedure: string(),
26368
+ calls: number(),
26369
+ /**
26370
+ * The same total, split by transport. THIS is the row that answers the
26371
+ * question the census exists for: one look at `deviceManager.listAll` says
26372
+ * which plane carried the 4 960, without joining two log lines by eye.
26373
+ */
26374
+ planes: TransportPlaneCountsSchema,
26375
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26376
+ subscriptions: number(),
26377
+ perMin: number()
26378
+ });
26379
+ /**
26380
+ * The census as an operator sees it.
26381
+ *
26382
+ * `persisted` is the honest answer to "will this survive the restart I am
26383
+ * about to do": the arm deadline is written to `system-settings` so a window
26384
+ * armed now can measure the NEXT boot, and a write that failed must not look
26385
+ * like one that succeeded.
26386
+ */
26387
+ var RequestCensusStatusSchema = object({
26388
+ armed: boolean(),
26389
+ /** How long the current - or just-closed - window collected, in ms. */
26390
+ elapsedMs: number(),
26391
+ /** The window actually armed, after the server clamped the request. */
26392
+ windowMs: number(),
26393
+ /** Epoch ms the window closes at. 0 when disarmed. */
26394
+ armedUntilMs: number(),
26395
+ httpRequests: number(),
26396
+ batchedRequests: number(),
26397
+ /**
26398
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26399
+ * is in play (`?batch=1` carries several procedures in one request); this is
26400
+ * the number comparable with a store-side call count.
26401
+ */
26402
+ procedureCalls: number(),
26403
+ /**
26404
+ * `procedureCalls` split by transport. The four keys sum to
26405
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26406
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26407
+ */
26408
+ planes: TransportPlaneCountsSchema,
26409
+ /**
26410
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26411
+ * on no plane at all - which is a RESULT (a plane is missing from the
26412
+ * instrument), not a failure, and it has to be visible to be read as one.
26413
+ */
26414
+ planesExplainTotal: boolean(),
26415
+ /**
26416
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26417
+ * adapter resolves one context per connection - kept because a plane's call
26418
+ * count of zero against 37 open connections says something different from a
26419
+ * plane with no connections at all.
26420
+ */
26421
+ wsConnections: number(),
26422
+ /**
26423
+ * Client frames the WS plane looked at. `wsMessages` far above
26424
+ * `planes.ws + subscriptions` means most traffic is not operations
26425
+ * (keepalives, connection params) - which is itself an answer.
26426
+ */
26427
+ wsMessages: number(),
26428
+ /**
26429
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26430
+ * purpose: one live-events stream opened at boot and held for six hours is
26431
+ * one subscription, and counting it as a call would let a quiet plane
26432
+ * masquerade as the storm.
26433
+ */
26434
+ subscriptions: number(),
26435
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26436
+ subscriptionStops: number(),
26437
+ distinctGroups: number(),
26438
+ /**
26439
+ * Operations counted in the totals whose CALLER attribution was shed at the
26440
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26441
+ * which transport they arrived on, they just lost their group row.
26442
+ */
26443
+ unattributedCalls: number(),
26444
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26445
+ groups: array(RequestCensusGroupSchema).readonly()
26446
+ }).extend({ persisted: boolean() });
26447
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26448
+ var LogLevelSchema$1 = _enum([
26449
+ "debug",
26450
+ "info",
26451
+ "warn",
26452
+ "error"
26453
+ ]);
26454
+ /**
26455
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26456
+ *
26457
+ * A diagnostic is anything whose cost is only worth paying while a question is
26458
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26459
+ */
26460
+ var DiagnosticIdSchema = _enum(["request-census"]);
26461
+ /**
26462
+ * The layers of the level hierarchy, general → specific. The most specific
26463
+ * layer that carries an explicit value wins.
26464
+ *
26465
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26466
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26467
+ * grow later would force every consumer of this document to change with it.
26468
+ * Nothing returns `component` today.
26469
+ */
26470
+ var LoggingScopeKindSchema = _enum([
26471
+ "cluster",
26472
+ "node",
26473
+ "component"
26474
+ ]);
26475
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26476
+ var LoggingLevelSourceSchema = _enum([
26477
+ "default",
26478
+ "cluster",
26479
+ "node",
26480
+ "component"
26481
+ ]);
26482
+ /**
26483
+ * One layer of the hierarchy as it actually STANDS.
26484
+ *
26485
+ * `level: null` is the whole reason this array is returned: it is the
26486
+ * difference between "this node is at `info` because I decided it" and
26487
+ * "...because it inherits". An operator who clears an override believing they
26488
+ * are clearing an inherited value has been handed the same defect as the two
26489
+ * contradicting knobs this document exists to remove, moved one floor up.
26490
+ */
26491
+ var LoggingLevelLayerSchema = object({
26492
+ scope: LoggingScopeKindSchema,
26493
+ /** The node this layer speaks for; `null` on the cluster layer. */
26494
+ nodeId: string().nullable(),
26495
+ /** Explicitly set here, or `null` when this layer inherits. */
26496
+ level: LogLevelSchema$1.nullable()
26497
+ });
26498
+ /** What a line is judged against, and WHICH layer decided it. */
26499
+ var LoggingEffectiveSchema = object({
26500
+ level: LogLevelSchema$1,
26501
+ levelSource: LoggingLevelSourceSchema
26502
+ });
26503
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26504
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26505
+ /**
26506
+ * An armed diagnostic, with its DEADLINE.
26507
+ *
26508
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26509
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26510
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26511
+ * `armed` is false — a window is never reported as slightly expired.
26512
+ */
26513
+ var DiagnosticWindowSchema = object({
26514
+ id: DiagnosticIdSchema,
26515
+ armed: boolean(),
26516
+ /** Epoch ms the window closes at. 0 when disarmed. */
26517
+ armedUntilMs: number(),
26518
+ /** Ms left before it expires on its own. 0 when disarmed. */
26519
+ remainingMs: number(),
26520
+ /** Whether the stored deadline is the one the live diagnostic is running —
26521
+ * i.e. whether this window would survive a restart. */
26522
+ persisted: boolean()
26523
+ });
26524
+ /**
26525
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26526
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26527
+ * is a second knob that disagrees with the first the day one of them moves.
26528
+ */
26529
+ var DiagnosticWindowPatchSchema = object({
26530
+ id: DiagnosticIdSchema,
26531
+ armMs: number().int().min(0),
26532
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26533
+ reportEveryMs: number().int().positive().optional()
26534
+ });
26535
+ /**
26536
+ * A PATCH, and patches MERGE.
26537
+ *
26538
+ * A field absent from the patch is left exactly as it was — arming a
26539
+ * diagnostic never resets a level, and setting a level never disarms a window.
26540
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26541
+ * `setAll` already merges, and rebuilding the object is how an absent field
26542
+ * turns into an erased one.
26543
+ */
26544
+ var LoggingSettingsPatchSchema = object({
26545
+ /**
26546
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26547
+ * addressed scope so it inherits again. A value sets it.
26548
+ */
26549
+ level: LogLevelSchema$1.nullable().optional(),
26550
+ /**
26551
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26552
+ * keeps running — a patch is never a full replacement.
26553
+ */
26554
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26555
+ });
26556
+ /**
26557
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26558
+ *
26559
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26560
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26561
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26562
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26563
+ * by an agent that holds no cluster document at all. The hub is the single
26564
+ * authority over the whole hierarchy and answers for every layer, so the
26565
+ * layer selector needs a name the transport does not already own.
26566
+ */
26567
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26568
+ var SetLoggingSettingsInputSchema = object({
26569
+ scopeNodeId: string().optional(),
26570
+ patch: LoggingSettingsPatchSchema
26571
+ });
26572
+ /**
26573
+ * The whole document, as read and as returned after every write.
26574
+ *
26575
+ * `persisted: false` means the settings store could not be read or written.
26576
+ * The in-memory mirror still governs behaviour and is unchanged by the
26577
+ * failure — a read that fails neither switches a level nor disarms a window
26578
+ * (D49) — but the operator is told that what they are looking at would not
26579
+ * survive a restart.
26580
+ */
26581
+ var LoggingSettingsStateSchema = object({
26582
+ /** The layer this document was read at. `null` = the cluster layer. */
26583
+ scopeNodeId: string().nullable(),
26584
+ effective: LoggingEffectiveSchema,
26585
+ explicit: LoggingExplicitSchema,
26586
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26587
+ persisted: boolean()
26588
+ });
26129
26589
  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(), {
26130
26590
  kind: "mutation",
26131
26591
  auth: "admin"
@@ -26138,6 +26598,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26138
26598
  }), method(_void(), SiteLocationStatusSchema, {
26139
26599
  kind: "mutation",
26140
26600
  auth: "admin"
26601
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26602
+ kind: "mutation",
26603
+ auth: "admin"
26141
26604
  });
26142
26605
  object({
26143
26606
  /** True when the device's tamper switch / case-open contact is
@@ -31969,6 +32432,18 @@ Object.freeze({
31969
32432
  addonId: null,
31970
32433
  access: "create"
31971
32434
  },
32435
+ "system.getLoggingSettings": {
32436
+ capName: "system",
32437
+ capScope: "system",
32438
+ addonId: null,
32439
+ access: "view"
32440
+ },
32441
+ "system.getRequestCensus": {
32442
+ capName: "system",
32443
+ capScope: "system",
32444
+ addonId: null,
32445
+ access: "view"
32446
+ },
31972
32447
  "system.getRetentionConfig": {
31973
32448
  capName: "system",
31974
32449
  capScope: "system",
@@ -31999,6 +32474,12 @@ Object.freeze({
31999
32474
  addonId: null,
32000
32475
  access: "view"
32001
32476
  },
32477
+ "system.setLoggingSettings": {
32478
+ capName: "system",
32479
+ capScope: "system",
32480
+ addonId: null,
32481
+ access: "create"
32482
+ },
32002
32483
  "system.setRetentionConfig": {
32003
32484
  capName: "system",
32004
32485
  capScope: "system",
@@ -33154,6 +33635,10 @@ Object.freeze({
33154
33635
  name: "deviceId",
33155
33636
  form: "single",
33156
33637
  optional: true
33638
+ }, {
33639
+ name: "deviceIds",
33640
+ form: "array",
33641
+ optional: true
33157
33642
  }],
33158
33643
  "fanControl.setDirection": [{
33159
33644
  name: "deviceId",
@@ -34971,7 +35456,38 @@ object({
34971
35456
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34972
35457
  * reproduce that.
34973
35458
  */
34974
- tileBudgetMb: number().int().min(0).max(1024)
35459
+ tileBudgetMb: number().int().min(0).max(1024),
35460
+ /**
35461
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35462
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35463
+ * subject tiles, on frames that detected something.
35464
+ *
35465
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35466
+ * containment is strict by design, so the native `keyFrame`, the detail
35467
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35468
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35469
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35470
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35471
+ *
35472
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35473
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35474
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35475
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35476
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35477
+ * binds only through a detection burst, where it still covers well past the
35478
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35479
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35480
+ * whole shape exists to avoid.
35481
+ *
35482
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35483
+ * subject tile, so one shared budget would let a busy camera's key frames
35484
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35485
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35486
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35487
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35488
+ * nothing.
35489
+ */
35490
+ sceneBudgetMb: number().int().min(0).max(1024)
34975
35491
  });
34976
35492
  /**
34977
35493
  * The values in force when the operator has set nothing.
@@ -34987,12 +35503,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34987
35503
  budgetMb: 1024,
34988
35504
  activityMs: 15e3,
34989
35505
  tileBudgetMb: 64,
35506
+ sceneBudgetMb: 48,
34990
35507
  admission: "inferred"
34991
35508
  };
34992
35509
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34993
35510
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34994
35511
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34995
35512
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35513
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34996
35514
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34997
35515
  var MB = 1024 * 1024;
34998
35516
  1024 * MB, 3072 * MB;