@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.mjs CHANGED
@@ -7632,6 +7632,66 @@ var OpsLogQueryInputSchema = object({
7632
7632
  /** Max rows returned, newest-first. */
7633
7633
  limit: number().int().min(1).max(1e3).optional()
7634
7634
  });
7635
+ var LabelDefinitionSchema = object({
7636
+ id: string(),
7637
+ name: string(),
7638
+ category: string().optional(),
7639
+ description: string().optional(),
7640
+ icon: string().optional()
7641
+ });
7642
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7643
+ var CLASS_MAP_MACRO_TARGETS = [
7644
+ "person",
7645
+ "vehicle",
7646
+ "animal",
7647
+ "package"
7648
+ ];
7649
+ /**
7650
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7651
+ * un operatore può selezionare.
7652
+ *
7653
+ * Sono le tre offerte dallo step `object-detection`
7654
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7655
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7656
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7657
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7658
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7659
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7660
+ *
7661
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7662
+ * dello step e una seconda volta come union `FirstLevelMacro`
7663
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7664
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7665
+ * successiva.
7666
+ */
7667
+ var FIRST_LEVEL_MACRO_CLASSES = [
7668
+ "person",
7669
+ "vehicle",
7670
+ "animal"
7671
+ ];
7672
+ /**
7673
+ * Wire schema for a per-model CATALOG classMap override
7674
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7675
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7676
+ * detection pipeline executor actually routes.
7677
+ *
7678
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7679
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7680
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7681
+ * enum) — the two used to share the name `ClassMapDefinition`/
7682
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7683
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7684
+ * are not: it is two different concepts colliding on a name. Keep this type
7685
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7686
+ * would either narrow every `ClassMapDefinition` consumer to the four
7687
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7688
+ * schema exists for (see the "rejects a classMap whose target is not a
7689
+ * detection macro" test in `model-catalog-schema.test.ts`).
7690
+ */
7691
+ var DetectionCatalogClassMapSchema = object({
7692
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7693
+ preserveOriginal: boolean()
7694
+ });
7635
7695
  /**
7636
7696
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7637
7697
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7654,10 +7714,55 @@ var RecordingStorageModeSchema = _enum([
7654
7714
  "events",
7655
7715
  "continuous"
7656
7716
  ]);
7717
+ /**
7718
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7719
+ * tre offerte dallo step `object-detection`, da UNA lista
7720
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7721
+ */
7722
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7723
+ /**
7724
+ * True quando `values` non ripete un elemento.
7725
+ *
7726
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7727
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7728
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7729
+ */
7730
+ var noDuplicates = (values) => new Set(values).size === values.length;
7657
7731
  /** Which detectors trigger an `events`-mode band. */
7658
7732
  var RecordingTriggersSchema = object({
7659
7733
  motion: boolean().optional(),
7660
- audioThresholdDbfs: number().optional()
7734
+ audioThresholdDbfs: number().optional(),
7735
+ /**
7736
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7737
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7738
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7739
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7740
+ *
7741
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7742
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7743
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7744
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7745
+ * finestre — vedi `recorder/object-trigger.ts`.
7746
+ */
7747
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7748
+ /**
7749
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7750
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7751
+ * `objectClasses`.
7752
+ *
7753
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7754
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7755
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7756
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7757
+ * device (D12) — mai un elenco globale di cap.
7758
+ *
7759
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7760
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7761
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7762
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7763
+ * registrare.
7764
+ */
7765
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7661
7766
  });
7662
7767
  /**
7663
7768
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8109,41 +8214,6 @@ var DecoderSessionConfigSchema = object({
8109
8214
  */
8110
8215
  debug: boolean().optional()
8111
8216
  });
8112
- var LabelDefinitionSchema = object({
8113
- id: string(),
8114
- name: string(),
8115
- category: string().optional(),
8116
- description: string().optional(),
8117
- icon: string().optional()
8118
- });
8119
- /**
8120
- * Wire schema for a per-model CATALOG classMap override
8121
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8122
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8123
- * detection pipeline executor actually routes.
8124
- *
8125
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8126
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8127
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8128
- * enum) — the two used to share the name `ClassMapDefinition`/
8129
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8130
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8131
- * are not: it is two different concepts colliding on a name. Keep this type
8132
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8133
- * would either narrow every `ClassMapDefinition` consumer to the four
8134
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8135
- * schema exists for (see the "rejects a classMap whose target is not a
8136
- * detection macro" test in `model-catalog-schema.test.ts`).
8137
- */
8138
- var DetectionCatalogClassMapSchema = object({
8139
- mapping: record(string(), _enum([
8140
- "person",
8141
- "vehicle",
8142
- "animal",
8143
- "package"
8144
- ])),
8145
- preserveOriginal: boolean()
8146
- });
8147
8217
  var MODEL_FORMATS = [
8148
8218
  "onnx",
8149
8219
  "coreml",
@@ -20972,7 +21042,7 @@ var lifecycleJobSchema = object({
20972
21042
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
20973
21043
  * as every other cap.
20974
21044
  */
20975
- var LogLevelSchema$1 = _enum([
21045
+ var LogLevelSchema$2 = _enum([
20976
21046
  "debug",
20977
21047
  "info",
20978
21048
  "warn",
@@ -21179,7 +21249,7 @@ var CustomActionInputSchema = object({
21179
21249
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21180
21250
  addonId: string(),
21181
21251
  limit: number().min(1).max(500).default(100),
21182
- level: LogLevelSchema$1.optional()
21252
+ level: LogLevelSchema$2.optional()
21183
21253
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21184
21254
  packageName: string(),
21185
21255
  version: string().optional()
@@ -21277,7 +21347,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21277
21347
  auth: "admin"
21278
21348
  }), method(object({
21279
21349
  addonId: string(),
21280
- level: LogLevelSchema$1.optional()
21350
+ level: LogLevelSchema$2.optional()
21281
21351
  }), LogStreamEntrySchema, { kind: "subscription" });
21282
21352
  object({
21283
21353
  /** Carbon dioxide concentration in ppm. */
@@ -22271,6 +22341,35 @@ var FaceFilterEnum = _enum([
22271
22341
  "identified",
22272
22342
  "all"
22273
22343
  ]);
22344
+ /**
22345
+ * What a `listRecentFaces` page is ORDERED BY.
22346
+ *
22347
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22348
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22349
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22350
+ * order: it puts the suggestions an operator can confirm with one tap at the
22351
+ * top, and it is the reason this enum exists — a client that ranked a capped
22352
+ * page client-side was ranking the newest N, never the most certain N.
22353
+ *
22354
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22355
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22356
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22357
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22358
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22359
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22360
+ * then by faceId, and is what makes this a total order instead of the
22361
+ * backend's NULL-collation accident.
22362
+ */
22363
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22364
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22365
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22366
+ * never leaves the server. */
22367
+ var FaceClusterSchema = object({
22368
+ faceIds: array(string()).readonly(),
22369
+ representativeFaceId: string(),
22370
+ size: number().int(),
22371
+ cohesion: number()
22372
+ });
22274
22373
  var MediaFileLiteSchema$1 = object({
22275
22374
  key: string(),
22276
22375
  kind: string(),
@@ -22317,24 +22416,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22317
22416
  kind: "mutation",
22318
22417
  auth: "admin"
22319
22418
  }), method(object({
22320
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22419
+ /**
22420
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22421
+ *
22422
+ * The legacy single-camera form, kept verbatim for every caller that
22423
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22424
+ * instead — never both: `deviceIds` is the authority whenever it is
22425
+ * present, and this field is then ignored rather than unioned, so
22426
+ * there is exactly one answer to "which cameras did I ask for".
22427
+ */
22321
22428
  deviceId: number().int().optional(),
22429
+ /**
22430
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22431
+ * until now had to fetch the cluster-wide page and drop rows in the
22432
+ * client (so the `limit` it asked for was spent on cameras it was
22433
+ * about to discard).
22434
+ *
22435
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22436
+ * "every camera". A request for no devices is a request, not an
22437
+ * omission; same contract as `deviceManager.listFleet` and
22438
+ * `pipelineAnalytics.listRecentTracks`.
22439
+ *
22440
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22441
+ */
22442
+ deviceIds: array(number().int()).optional(),
22322
22443
  limit: number().int().positive().optional(),
22323
22444
  filter: FaceFilterEnum.optional(),
22324
22445
  /**
22325
- * Inline the base64 crop on every row. Default `true` — the existing
22326
- * behaviour, kept so no caller breaks.
22446
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22447
+ * Absent means no lower bound.
22448
+ */
22449
+ since: number().int().optional(),
22450
+ /**
22451
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22452
+ * Absent means no upper bound.
22453
+ */
22454
+ until: number().int().optional(),
22455
+ /**
22456
+ * Order the page by time or by suggestion certainty. Default
22457
+ * `'timestamp'` — the historical order, unchanged for every caller
22458
+ * that does not ask.
22327
22459
  *
22328
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22329
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22330
- * the browser cache the images.
22460
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22461
+ * does under `'suggestionConfidence'`.
22331
22462
  *
22332
- * **This is an INPUT field, so it does not reach the addon until the
22333
- * next train.** The hub router validates cap inputs against its own
22334
- * compiled Zod, which strips a key it does not know — verified today
22335
- * on the OUTPUT side, where an additive field DOES arrive immediately
22336
- * (`Track.hasFace`). Until the train ships, sending `false` is
22337
- * harmless and simply keeps the crops inline.
22463
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22464
+ * index and stops reading as soon as `limit` rows have PASSED the
22465
+ * filter. `'suggestionConfidence'` cannot stop early — the most
22466
+ * certain row may be the oldest — so it walks the window. Narrow it
22467
+ * with {@link since} / {@link until}.
22468
+ */
22469
+ sortBy: FaceSortFieldEnum.optional(),
22470
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22471
+ sortDirection: FaceSortDirectionEnum.optional(),
22472
+ /**
22473
+ * Inline the base64 crop on every row.
22474
+ *
22475
+ * Default `false` since the 2026-08-25 inversion — see
22476
+ * `include-crops-default.ts`, which is the ONE place that resolves
22477
+ * this for every gallery, and which records why the inline shape had
22478
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22479
+ * The doc here used to still say `true`; it was wrong, and a leftover
22480
+ * that describes the old design reads as permission to rely on it.
22481
+ *
22482
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22483
+ * which the browser fetches off the `event-media` plane in parallel,
22484
+ * cached and ETagged.
22338
22485
  */
22339
22486
  includeCrops: boolean().optional()
22340
22487
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22370,13 +22517,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22370
22517
  }), method(object({
22371
22518
  threshold: number().min(0).max(1).optional(),
22372
22519
  minClusterSize: number().int().min(2).optional(),
22373
- limit: number().int().positive().optional()
22374
- }).optional(), array(object({
22375
- faceIds: array(string()).readonly(),
22376
- representativeFaceId: string(),
22377
- size: number().int(),
22378
- cohesion: number()
22379
- })).readonly());
22520
+ /**
22521
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22522
+ * which read as though it bounded the work — it never did.
22523
+ *
22524
+ * Wins over {@link limit} when both are sent.
22525
+ */
22526
+ maxClusters: number().int().positive().optional(),
22527
+ /**
22528
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22529
+ * RESULT, not the scan. Kept so existing callers keep working; send
22530
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22531
+ */
22532
+ limit: number().int().positive().optional(),
22533
+ /**
22534
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22535
+ * POOL, not the result.
22536
+ *
22537
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22538
+ * used to read every unassigned face on the hub no matter what the
22539
+ * caller asked for, because the only bound cut the finished clusters
22540
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22541
+ * whole corpus, on an addon whose disk is under contention.
22542
+ *
22543
+ * The pool is the NEWEST matching faces first — the same order the
22544
+ * gallery shows — so a bound here shortens the horizon, it does not
22545
+ * sample it randomly.
22546
+ *
22547
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22548
+ * so the live corpus — 372 face rows — is unaffected while the
22549
+ * unbounded scan can never come back as the table grows.
22550
+ */
22551
+ maxFacesScanned: number().int().positive().optional()
22552
+ }).optional(), array(FaceClusterSchema).readonly());
22380
22553
  /**
22381
22554
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22382
22555
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -26099,6 +26272,293 @@ var SetSiteLocationInputSchema = object({
26099
26272
  latitude: number().min(-90).max(90),
26100
26273
  longitude: number().min(-180).max(180)
26101
26274
  }).nullable();
26275
+ /**
26276
+ * The TRANSPORT a call arrived on.
26277
+ *
26278
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26279
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26280
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26281
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26282
+ * checkable rather than asserted.
26283
+ *
26284
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26285
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26286
+ * connection; the viewer talks to the hub over `wsLink`
26287
+ * exclusively, so this is the plane the HTTP census could not see.
26288
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26289
+ * never touches a socket and therefore never touched a census.
26290
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26291
+ * that is exactly what its `0` asserts: every plane the hub has can name
26292
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26293
+ * plane nobody instrumented lands here instead of vanishing from the total.
26294
+ */
26295
+ var TransportPlaneSchema = _enum([
26296
+ "http",
26297
+ "ws",
26298
+ "mesh",
26299
+ "unknown"
26300
+ ]);
26301
+ /**
26302
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26303
+ * reads as "not instrumented", which is the one thing this census must never
26304
+ * make an operator wonder about.
26305
+ */
26306
+ var TransportPlaneCountsSchema = object({
26307
+ http: number(),
26308
+ ws: number(),
26309
+ mesh: number(),
26310
+ unknown: number()
26311
+ });
26312
+ /**
26313
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26314
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26315
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26316
+ * already prints - never a token, never an `Authorization` header.
26317
+ *
26318
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26319
+ * and lives for hours, so folding it into a call count makes one long-lived
26320
+ * stream look like a storm.
26321
+ */
26322
+ var RequestCensusGroupSchema = object({
26323
+ plane: TransportPlaneSchema,
26324
+ procedure: string(),
26325
+ userAgent: string(),
26326
+ ip: string(),
26327
+ principal: string(),
26328
+ calls: number(),
26329
+ subscriptions: number(),
26330
+ perMin: number()
26331
+ });
26332
+ /**
26333
+ * A procedure's TOTAL over the window, across every caller.
26334
+ *
26335
+ * This block, not the group list, is what answers "did these calls arrive over
26336
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26337
+ * same window excludes the HTTP plane, which is a result, not a failure.
26338
+ */
26339
+ var RequestCensusProcedureSchema = object({
26340
+ procedure: string(),
26341
+ calls: number(),
26342
+ /**
26343
+ * The same total, split by transport. THIS is the row that answers the
26344
+ * question the census exists for: one look at `deviceManager.listAll` says
26345
+ * which plane carried the 4 960, without joining two log lines by eye.
26346
+ */
26347
+ planes: TransportPlaneCountsSchema,
26348
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26349
+ subscriptions: number(),
26350
+ perMin: number()
26351
+ });
26352
+ /**
26353
+ * The census as an operator sees it.
26354
+ *
26355
+ * `persisted` is the honest answer to "will this survive the restart I am
26356
+ * about to do": the arm deadline is written to `system-settings` so a window
26357
+ * armed now can measure the NEXT boot, and a write that failed must not look
26358
+ * like one that succeeded.
26359
+ */
26360
+ var RequestCensusStatusSchema = object({
26361
+ armed: boolean(),
26362
+ /** How long the current - or just-closed - window collected, in ms. */
26363
+ elapsedMs: number(),
26364
+ /** The window actually armed, after the server clamped the request. */
26365
+ windowMs: number(),
26366
+ /** Epoch ms the window closes at. 0 when disarmed. */
26367
+ armedUntilMs: number(),
26368
+ httpRequests: number(),
26369
+ batchedRequests: number(),
26370
+ /**
26371
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26372
+ * is in play (`?batch=1` carries several procedures in one request); this is
26373
+ * the number comparable with a store-side call count.
26374
+ */
26375
+ procedureCalls: number(),
26376
+ /**
26377
+ * `procedureCalls` split by transport. The four keys sum to
26378
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26379
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26380
+ */
26381
+ planes: TransportPlaneCountsSchema,
26382
+ /**
26383
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26384
+ * on no plane at all - which is a RESULT (a plane is missing from the
26385
+ * instrument), not a failure, and it has to be visible to be read as one.
26386
+ */
26387
+ planesExplainTotal: boolean(),
26388
+ /**
26389
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26390
+ * adapter resolves one context per connection - kept because a plane's call
26391
+ * count of zero against 37 open connections says something different from a
26392
+ * plane with no connections at all.
26393
+ */
26394
+ wsConnections: number(),
26395
+ /**
26396
+ * Client frames the WS plane looked at. `wsMessages` far above
26397
+ * `planes.ws + subscriptions` means most traffic is not operations
26398
+ * (keepalives, connection params) - which is itself an answer.
26399
+ */
26400
+ wsMessages: number(),
26401
+ /**
26402
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26403
+ * purpose: one live-events stream opened at boot and held for six hours is
26404
+ * one subscription, and counting it as a call would let a quiet plane
26405
+ * masquerade as the storm.
26406
+ */
26407
+ subscriptions: number(),
26408
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26409
+ subscriptionStops: number(),
26410
+ distinctGroups: number(),
26411
+ /**
26412
+ * Operations counted in the totals whose CALLER attribution was shed at the
26413
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26414
+ * which transport they arrived on, they just lost their group row.
26415
+ */
26416
+ unattributedCalls: number(),
26417
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26418
+ groups: array(RequestCensusGroupSchema).readonly()
26419
+ }).extend({ persisted: boolean() });
26420
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26421
+ var LogLevelSchema$1 = _enum([
26422
+ "debug",
26423
+ "info",
26424
+ "warn",
26425
+ "error"
26426
+ ]);
26427
+ /**
26428
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26429
+ *
26430
+ * A diagnostic is anything whose cost is only worth paying while a question is
26431
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26432
+ */
26433
+ var DiagnosticIdSchema = _enum(["request-census"]);
26434
+ /**
26435
+ * The layers of the level hierarchy, general → specific. The most specific
26436
+ * layer that carries an explicit value wins.
26437
+ *
26438
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26439
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26440
+ * grow later would force every consumer of this document to change with it.
26441
+ * Nothing returns `component` today.
26442
+ */
26443
+ var LoggingScopeKindSchema = _enum([
26444
+ "cluster",
26445
+ "node",
26446
+ "component"
26447
+ ]);
26448
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26449
+ var LoggingLevelSourceSchema = _enum([
26450
+ "default",
26451
+ "cluster",
26452
+ "node",
26453
+ "component"
26454
+ ]);
26455
+ /**
26456
+ * One layer of the hierarchy as it actually STANDS.
26457
+ *
26458
+ * `level: null` is the whole reason this array is returned: it is the
26459
+ * difference between "this node is at `info` because I decided it" and
26460
+ * "...because it inherits". An operator who clears an override believing they
26461
+ * are clearing an inherited value has been handed the same defect as the two
26462
+ * contradicting knobs this document exists to remove, moved one floor up.
26463
+ */
26464
+ var LoggingLevelLayerSchema = object({
26465
+ scope: LoggingScopeKindSchema,
26466
+ /** The node this layer speaks for; `null` on the cluster layer. */
26467
+ nodeId: string().nullable(),
26468
+ /** Explicitly set here, or `null` when this layer inherits. */
26469
+ level: LogLevelSchema$1.nullable()
26470
+ });
26471
+ /** What a line is judged against, and WHICH layer decided it. */
26472
+ var LoggingEffectiveSchema = object({
26473
+ level: LogLevelSchema$1,
26474
+ levelSource: LoggingLevelSourceSchema
26475
+ });
26476
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26477
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26478
+ /**
26479
+ * An armed diagnostic, with its DEADLINE.
26480
+ *
26481
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26482
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26483
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26484
+ * `armed` is false — a window is never reported as slightly expired.
26485
+ */
26486
+ var DiagnosticWindowSchema = object({
26487
+ id: DiagnosticIdSchema,
26488
+ armed: boolean(),
26489
+ /** Epoch ms the window closes at. 0 when disarmed. */
26490
+ armedUntilMs: number(),
26491
+ /** Ms left before it expires on its own. 0 when disarmed. */
26492
+ remainingMs: number(),
26493
+ /** Whether the stored deadline is the one the live diagnostic is running —
26494
+ * i.e. whether this window would survive a restart. */
26495
+ persisted: boolean()
26496
+ });
26497
+ /**
26498
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26499
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26500
+ * is a second knob that disagrees with the first the day one of them moves.
26501
+ */
26502
+ var DiagnosticWindowPatchSchema = object({
26503
+ id: DiagnosticIdSchema,
26504
+ armMs: number().int().min(0),
26505
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26506
+ reportEveryMs: number().int().positive().optional()
26507
+ });
26508
+ /**
26509
+ * A PATCH, and patches MERGE.
26510
+ *
26511
+ * A field absent from the patch is left exactly as it was — arming a
26512
+ * diagnostic never resets a level, and setting a level never disarms a window.
26513
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26514
+ * `setAll` already merges, and rebuilding the object is how an absent field
26515
+ * turns into an erased one.
26516
+ */
26517
+ var LoggingSettingsPatchSchema = object({
26518
+ /**
26519
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26520
+ * addressed scope so it inherits again. A value sets it.
26521
+ */
26522
+ level: LogLevelSchema$1.nullable().optional(),
26523
+ /**
26524
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26525
+ * keeps running — a patch is never a full replacement.
26526
+ */
26527
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26528
+ });
26529
+ /**
26530
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26531
+ *
26532
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26533
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26534
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26535
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26536
+ * by an agent that holds no cluster document at all. The hub is the single
26537
+ * authority over the whole hierarchy and answers for every layer, so the
26538
+ * layer selector needs a name the transport does not already own.
26539
+ */
26540
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26541
+ var SetLoggingSettingsInputSchema = object({
26542
+ scopeNodeId: string().optional(),
26543
+ patch: LoggingSettingsPatchSchema
26544
+ });
26545
+ /**
26546
+ * The whole document, as read and as returned after every write.
26547
+ *
26548
+ * `persisted: false` means the settings store could not be read or written.
26549
+ * The in-memory mirror still governs behaviour and is unchanged by the
26550
+ * failure — a read that fails neither switches a level nor disarms a window
26551
+ * (D49) — but the operator is told that what they are looking at would not
26552
+ * survive a restart.
26553
+ */
26554
+ var LoggingSettingsStateSchema = object({
26555
+ /** The layer this document was read at. `null` = the cluster layer. */
26556
+ scopeNodeId: string().nullable(),
26557
+ effective: LoggingEffectiveSchema,
26558
+ explicit: LoggingExplicitSchema,
26559
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26560
+ persisted: boolean()
26561
+ });
26102
26562
  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(), {
26103
26563
  kind: "mutation",
26104
26564
  auth: "admin"
@@ -26111,6 +26571,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26111
26571
  }), method(_void(), SiteLocationStatusSchema, {
26112
26572
  kind: "mutation",
26113
26573
  auth: "admin"
26574
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26575
+ kind: "mutation",
26576
+ auth: "admin"
26114
26577
  });
26115
26578
  object({
26116
26579
  /** True when the device's tamper switch / case-open contact is
@@ -31942,6 +32405,18 @@ Object.freeze({
31942
32405
  addonId: null,
31943
32406
  access: "create"
31944
32407
  },
32408
+ "system.getLoggingSettings": {
32409
+ capName: "system",
32410
+ capScope: "system",
32411
+ addonId: null,
32412
+ access: "view"
32413
+ },
32414
+ "system.getRequestCensus": {
32415
+ capName: "system",
32416
+ capScope: "system",
32417
+ addonId: null,
32418
+ access: "view"
32419
+ },
31945
32420
  "system.getRetentionConfig": {
31946
32421
  capName: "system",
31947
32422
  capScope: "system",
@@ -31972,6 +32447,12 @@ Object.freeze({
31972
32447
  addonId: null,
31973
32448
  access: "view"
31974
32449
  },
32450
+ "system.setLoggingSettings": {
32451
+ capName: "system",
32452
+ capScope: "system",
32453
+ addonId: null,
32454
+ access: "create"
32455
+ },
31975
32456
  "system.setRetentionConfig": {
31976
32457
  capName: "system",
31977
32458
  capScope: "system",
@@ -33127,6 +33608,10 @@ Object.freeze({
33127
33608
  name: "deviceId",
33128
33609
  form: "single",
33129
33610
  optional: true
33611
+ }, {
33612
+ name: "deviceIds",
33613
+ form: "array",
33614
+ optional: true
33130
33615
  }],
33131
33616
  "fanControl.setDirection": [{
33132
33617
  name: "deviceId",
@@ -34944,7 +35429,38 @@ object({
34944
35429
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34945
35430
  * reproduce that.
34946
35431
  */
34947
- tileBudgetMb: number().int().min(0).max(1024)
35432
+ tileBudgetMb: number().int().min(0).max(1024),
35433
+ /**
35434
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35435
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35436
+ * subject tiles, on frames that detected something.
35437
+ *
35438
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35439
+ * containment is strict by design, so the native `keyFrame`, the detail
35440
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35441
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35442
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35443
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35444
+ *
35445
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35446
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35447
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35448
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35449
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35450
+ * binds only through a detection burst, where it still covers well past the
35451
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35452
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35453
+ * whole shape exists to avoid.
35454
+ *
35455
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35456
+ * subject tile, so one shared budget would let a busy camera's key frames
35457
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35458
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35459
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35460
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35461
+ * nothing.
35462
+ */
35463
+ sceneBudgetMb: number().int().min(0).max(1024)
34948
35464
  });
34949
35465
  /**
34950
35466
  * The values in force when the operator has set nothing.
@@ -34960,12 +35476,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34960
35476
  budgetMb: 1024,
34961
35477
  activityMs: 15e3,
34962
35478
  tileBudgetMb: 64,
35479
+ sceneBudgetMb: 48,
34963
35480
  admission: "inferred"
34964
35481
  };
34965
35482
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34966
35483
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34967
35484
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34968
35485
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35486
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34969
35487
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34970
35488
  var MB = 1024 * 1024;
34971
35489
  1024 * MB, 3072 * MB;