@camstack/addon-provider-onvif 1.2.30 → 1.2.32

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
@@ -7525,6 +7525,66 @@ var OpsLogQueryInputSchema = object({
7525
7525
  /** Max rows returned, newest-first. */
7526
7526
  limit: number().int().min(1).max(1e3).optional()
7527
7527
  });
7528
+ var LabelDefinitionSchema = object({
7529
+ id: string(),
7530
+ name: string(),
7531
+ category: string().optional(),
7532
+ description: string().optional(),
7533
+ icon: string().optional()
7534
+ });
7535
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7536
+ var CLASS_MAP_MACRO_TARGETS = [
7537
+ "person",
7538
+ "vehicle",
7539
+ "animal",
7540
+ "package"
7541
+ ];
7542
+ /**
7543
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7544
+ * un operatore può selezionare.
7545
+ *
7546
+ * Sono le tre offerte dallo step `object-detection`
7547
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7548
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7549
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7550
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7551
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7552
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7553
+ *
7554
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7555
+ * dello step e una seconda volta come union `FirstLevelMacro`
7556
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7557
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7558
+ * successiva.
7559
+ */
7560
+ var FIRST_LEVEL_MACRO_CLASSES = [
7561
+ "person",
7562
+ "vehicle",
7563
+ "animal"
7564
+ ];
7565
+ /**
7566
+ * Wire schema for a per-model CATALOG classMap override
7567
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7568
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7569
+ * detection pipeline executor actually routes.
7570
+ *
7571
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7572
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7573
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7574
+ * enum) — the two used to share the name `ClassMapDefinition`/
7575
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7576
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7577
+ * are not: it is two different concepts colliding on a name. Keep this type
7578
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7579
+ * would either narrow every `ClassMapDefinition` consumer to the four
7580
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7581
+ * schema exists for (see the "rejects a classMap whose target is not a
7582
+ * detection macro" test in `model-catalog-schema.test.ts`).
7583
+ */
7584
+ var DetectionCatalogClassMapSchema = object({
7585
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7586
+ preserveOriginal: boolean()
7587
+ });
7528
7588
  /**
7529
7589
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7530
7590
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7547,10 +7607,55 @@ var RecordingStorageModeSchema = _enum([
7547
7607
  "events",
7548
7608
  "continuous"
7549
7609
  ]);
7610
+ /**
7611
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7612
+ * tre offerte dallo step `object-detection`, da UNA lista
7613
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7614
+ */
7615
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7616
+ /**
7617
+ * True quando `values` non ripete un elemento.
7618
+ *
7619
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7620
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7621
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7622
+ */
7623
+ var noDuplicates = (values) => new Set(values).size === values.length;
7550
7624
  /** Which detectors trigger an `events`-mode band. */
7551
7625
  var RecordingTriggersSchema = object({
7552
7626
  motion: boolean().optional(),
7553
- audioThresholdDbfs: number().optional()
7627
+ audioThresholdDbfs: number().optional(),
7628
+ /**
7629
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7630
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7631
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7632
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7633
+ *
7634
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7635
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7636
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7637
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7638
+ * finestre — vedi `recorder/object-trigger.ts`.
7639
+ */
7640
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7641
+ /**
7642
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7643
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7644
+ * `objectClasses`.
7645
+ *
7646
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7647
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7648
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7649
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7650
+ * device (D12) — mai un elenco globale di cap.
7651
+ *
7652
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7653
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7654
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7655
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7656
+ * registrare.
7657
+ */
7658
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7554
7659
  });
7555
7660
  /**
7556
7661
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8002,41 +8107,6 @@ var DecoderSessionConfigSchema = object({
8002
8107
  */
8003
8108
  debug: boolean().optional()
8004
8109
  });
8005
- var LabelDefinitionSchema = object({
8006
- id: string(),
8007
- name: string(),
8008
- category: string().optional(),
8009
- description: string().optional(),
8010
- icon: string().optional()
8011
- });
8012
- /**
8013
- * Wire schema for a per-model CATALOG classMap override
8014
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8015
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8016
- * detection pipeline executor actually routes.
8017
- *
8018
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8019
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8020
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8021
- * enum) — the two used to share the name `ClassMapDefinition`/
8022
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8023
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8024
- * are not: it is two different concepts colliding on a name. Keep this type
8025
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8026
- * would either narrow every `ClassMapDefinition` consumer to the four
8027
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8028
- * schema exists for (see the "rejects a classMap whose target is not a
8029
- * detection macro" test in `model-catalog-schema.test.ts`).
8030
- */
8031
- var DetectionCatalogClassMapSchema = object({
8032
- mapping: record(string(), _enum([
8033
- "person",
8034
- "vehicle",
8035
- "animal",
8036
- "package"
8037
- ])),
8038
- preserveOriginal: boolean()
8039
- });
8040
8110
  var MODEL_FORMATS = [
8041
8111
  "onnx",
8042
8112
  "coreml",
@@ -20969,7 +21039,7 @@ var lifecycleJobSchema = object({
20969
21039
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
20970
21040
  * as every other cap.
20971
21041
  */
20972
- var LogLevelSchema$1 = _enum([
21042
+ var LogLevelSchema$2 = _enum([
20973
21043
  "debug",
20974
21044
  "info",
20975
21045
  "warn",
@@ -21176,7 +21246,7 @@ var CustomActionInputSchema = object({
21176
21246
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21177
21247
  addonId: string(),
21178
21248
  limit: number().min(1).max(500).default(100),
21179
- level: LogLevelSchema$1.optional()
21249
+ level: LogLevelSchema$2.optional()
21180
21250
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21181
21251
  packageName: string(),
21182
21252
  version: string().optional()
@@ -21274,7 +21344,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21274
21344
  auth: "admin"
21275
21345
  }), method(object({
21276
21346
  addonId: string(),
21277
- level: LogLevelSchema$1.optional()
21347
+ level: LogLevelSchema$2.optional()
21278
21348
  }), LogStreamEntrySchema, { kind: "subscription" });
21279
21349
  object({
21280
21350
  /** Carbon dioxide concentration in ppm. */
@@ -22268,6 +22338,35 @@ var FaceFilterEnum = _enum([
22268
22338
  "identified",
22269
22339
  "all"
22270
22340
  ]);
22341
+ /**
22342
+ * What a `listRecentFaces` page is ORDERED BY.
22343
+ *
22344
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22345
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22346
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22347
+ * order: it puts the suggestions an operator can confirm with one tap at the
22348
+ * top, and it is the reason this enum exists — a client that ranked a capped
22349
+ * page client-side was ranking the newest N, never the most certain N.
22350
+ *
22351
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22352
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22353
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22354
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22355
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22356
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22357
+ * then by faceId, and is what makes this a total order instead of the
22358
+ * backend's NULL-collation accident.
22359
+ */
22360
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22361
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22362
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22363
+ * never leaves the server. */
22364
+ var FaceClusterSchema = object({
22365
+ faceIds: array(string()).readonly(),
22366
+ representativeFaceId: string(),
22367
+ size: number().int(),
22368
+ cohesion: number()
22369
+ });
22271
22370
  var MediaFileLiteSchema$1 = object({
22272
22371
  key: string(),
22273
22372
  kind: string(),
@@ -22314,24 +22413,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22314
22413
  kind: "mutation",
22315
22414
  auth: "admin"
22316
22415
  }), method(object({
22317
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22416
+ /**
22417
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22418
+ *
22419
+ * The legacy single-camera form, kept verbatim for every caller that
22420
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22421
+ * instead — never both: `deviceIds` is the authority whenever it is
22422
+ * present, and this field is then ignored rather than unioned, so
22423
+ * there is exactly one answer to "which cameras did I ask for".
22424
+ */
22318
22425
  deviceId: number().int().optional(),
22426
+ /**
22427
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22428
+ * until now had to fetch the cluster-wide page and drop rows in the
22429
+ * client (so the `limit` it asked for was spent on cameras it was
22430
+ * about to discard).
22431
+ *
22432
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22433
+ * "every camera". A request for no devices is a request, not an
22434
+ * omission; same contract as `deviceManager.listFleet` and
22435
+ * `pipelineAnalytics.listRecentTracks`.
22436
+ *
22437
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22438
+ */
22439
+ deviceIds: array(number().int()).optional(),
22319
22440
  limit: number().int().positive().optional(),
22320
22441
  filter: FaceFilterEnum.optional(),
22321
22442
  /**
22322
- * Inline the base64 crop on every row. Default `true` — the existing
22323
- * behaviour, kept so no caller breaks.
22443
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22444
+ * Absent means no lower bound.
22445
+ */
22446
+ since: number().int().optional(),
22447
+ /**
22448
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22449
+ * Absent means no upper bound.
22450
+ */
22451
+ until: number().int().optional(),
22452
+ /**
22453
+ * Order the page by time or by suggestion certainty. Default
22454
+ * `'timestamp'` — the historical order, unchanged for every caller
22455
+ * that does not ask.
22324
22456
  *
22325
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22326
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22327
- * the browser cache the images.
22457
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22458
+ * does under `'suggestionConfidence'`.
22328
22459
  *
22329
- * **This is an INPUT field, so it does not reach the addon until the
22330
- * next train.** The hub router validates cap inputs against its own
22331
- * compiled Zod, which strips a key it does not know verified today
22332
- * on the OUTPUT side, where an additive field DOES arrive immediately
22333
- * (`Track.hasFace`). Until the train ships, sending `false` is
22334
- * harmless and simply keeps the crops inline.
22460
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22461
+ * index and stops reading as soon as `limit` rows have PASSED the
22462
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
22463
+ * certain row may be the oldest so it walks the window. Narrow it
22464
+ * with {@link since} / {@link until}.
22465
+ */
22466
+ sortBy: FaceSortFieldEnum.optional(),
22467
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22468
+ sortDirection: FaceSortDirectionEnum.optional(),
22469
+ /**
22470
+ * Inline the base64 crop on every row.
22471
+ *
22472
+ * Default `false` since the 2026-08-25 inversion — see
22473
+ * `include-crops-default.ts`, which is the ONE place that resolves
22474
+ * this for every gallery, and which records why the inline shape had
22475
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22476
+ * The doc here used to still say `true`; it was wrong, and a leftover
22477
+ * that describes the old design reads as permission to rely on it.
22478
+ *
22479
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22480
+ * which the browser fetches off the `event-media` plane in parallel,
22481
+ * cached and ETagged.
22335
22482
  */
22336
22483
  includeCrops: boolean().optional()
22337
22484
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22367,13 +22514,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22367
22514
  }), method(object({
22368
22515
  threshold: number().min(0).max(1).optional(),
22369
22516
  minClusterSize: number().int().min(2).optional(),
22370
- limit: number().int().positive().optional()
22371
- }).optional(), array(object({
22372
- faceIds: array(string()).readonly(),
22373
- representativeFaceId: string(),
22374
- size: number().int(),
22375
- cohesion: number()
22376
- })).readonly());
22517
+ /**
22518
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22519
+ * which read as though it bounded the work — it never did.
22520
+ *
22521
+ * Wins over {@link limit} when both are sent.
22522
+ */
22523
+ maxClusters: number().int().positive().optional(),
22524
+ /**
22525
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22526
+ * RESULT, not the scan. Kept so existing callers keep working; send
22527
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22528
+ */
22529
+ limit: number().int().positive().optional(),
22530
+ /**
22531
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22532
+ * POOL, not the result.
22533
+ *
22534
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22535
+ * used to read every unassigned face on the hub no matter what the
22536
+ * caller asked for, because the only bound cut the finished clusters
22537
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22538
+ * whole corpus, on an addon whose disk is under contention.
22539
+ *
22540
+ * The pool is the NEWEST matching faces first — the same order the
22541
+ * gallery shows — so a bound here shortens the horizon, it does not
22542
+ * sample it randomly.
22543
+ *
22544
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22545
+ * so the live corpus — 372 face rows — is unaffected while the
22546
+ * unbounded scan can never come back as the table grows.
22547
+ */
22548
+ maxFacesScanned: number().int().positive().optional()
22549
+ }).optional(), array(FaceClusterSchema).readonly());
22377
22550
  /**
22378
22551
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22379
22552
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -26138,6 +26311,293 @@ var SetSiteLocationInputSchema = object({
26138
26311
  latitude: number().min(-90).max(90),
26139
26312
  longitude: number().min(-180).max(180)
26140
26313
  }).nullable();
26314
+ /**
26315
+ * The TRANSPORT a call arrived on.
26316
+ *
26317
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26318
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26319
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26320
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26321
+ * checkable rather than asserted.
26322
+ *
26323
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26324
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26325
+ * connection; the viewer talks to the hub over `wsLink`
26326
+ * exclusively, so this is the plane the HTTP census could not see.
26327
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26328
+ * never touches a socket and therefore never touched a census.
26329
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26330
+ * that is exactly what its `0` asserts: every plane the hub has can name
26331
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26332
+ * plane nobody instrumented lands here instead of vanishing from the total.
26333
+ */
26334
+ var TransportPlaneSchema = _enum([
26335
+ "http",
26336
+ "ws",
26337
+ "mesh",
26338
+ "unknown"
26339
+ ]);
26340
+ /**
26341
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26342
+ * reads as "not instrumented", which is the one thing this census must never
26343
+ * make an operator wonder about.
26344
+ */
26345
+ var TransportPlaneCountsSchema = object({
26346
+ http: number(),
26347
+ ws: number(),
26348
+ mesh: number(),
26349
+ unknown: number()
26350
+ });
26351
+ /**
26352
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26353
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26354
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26355
+ * already prints - never a token, never an `Authorization` header.
26356
+ *
26357
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26358
+ * and lives for hours, so folding it into a call count makes one long-lived
26359
+ * stream look like a storm.
26360
+ */
26361
+ var RequestCensusGroupSchema = object({
26362
+ plane: TransportPlaneSchema,
26363
+ procedure: string(),
26364
+ userAgent: string(),
26365
+ ip: string(),
26366
+ principal: string(),
26367
+ calls: number(),
26368
+ subscriptions: number(),
26369
+ perMin: number()
26370
+ });
26371
+ /**
26372
+ * A procedure's TOTAL over the window, across every caller.
26373
+ *
26374
+ * This block, not the group list, is what answers "did these calls arrive over
26375
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26376
+ * same window excludes the HTTP plane, which is a result, not a failure.
26377
+ */
26378
+ var RequestCensusProcedureSchema = object({
26379
+ procedure: string(),
26380
+ calls: number(),
26381
+ /**
26382
+ * The same total, split by transport. THIS is the row that answers the
26383
+ * question the census exists for: one look at `deviceManager.listAll` says
26384
+ * which plane carried the 4 960, without joining two log lines by eye.
26385
+ */
26386
+ planes: TransportPlaneCountsSchema,
26387
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26388
+ subscriptions: number(),
26389
+ perMin: number()
26390
+ });
26391
+ /**
26392
+ * The census as an operator sees it.
26393
+ *
26394
+ * `persisted` is the honest answer to "will this survive the restart I am
26395
+ * about to do": the arm deadline is written to `system-settings` so a window
26396
+ * armed now can measure the NEXT boot, and a write that failed must not look
26397
+ * like one that succeeded.
26398
+ */
26399
+ var RequestCensusStatusSchema = object({
26400
+ armed: boolean(),
26401
+ /** How long the current - or just-closed - window collected, in ms. */
26402
+ elapsedMs: number(),
26403
+ /** The window actually armed, after the server clamped the request. */
26404
+ windowMs: number(),
26405
+ /** Epoch ms the window closes at. 0 when disarmed. */
26406
+ armedUntilMs: number(),
26407
+ httpRequests: number(),
26408
+ batchedRequests: number(),
26409
+ /**
26410
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26411
+ * is in play (`?batch=1` carries several procedures in one request); this is
26412
+ * the number comparable with a store-side call count.
26413
+ */
26414
+ procedureCalls: number(),
26415
+ /**
26416
+ * `procedureCalls` split by transport. The four keys sum to
26417
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26418
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26419
+ */
26420
+ planes: TransportPlaneCountsSchema,
26421
+ /**
26422
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26423
+ * on no plane at all - which is a RESULT (a plane is missing from the
26424
+ * instrument), not a failure, and it has to be visible to be read as one.
26425
+ */
26426
+ planesExplainTotal: boolean(),
26427
+ /**
26428
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26429
+ * adapter resolves one context per connection - kept because a plane's call
26430
+ * count of zero against 37 open connections says something different from a
26431
+ * plane with no connections at all.
26432
+ */
26433
+ wsConnections: number(),
26434
+ /**
26435
+ * Client frames the WS plane looked at. `wsMessages` far above
26436
+ * `planes.ws + subscriptions` means most traffic is not operations
26437
+ * (keepalives, connection params) - which is itself an answer.
26438
+ */
26439
+ wsMessages: number(),
26440
+ /**
26441
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26442
+ * purpose: one live-events stream opened at boot and held for six hours is
26443
+ * one subscription, and counting it as a call would let a quiet plane
26444
+ * masquerade as the storm.
26445
+ */
26446
+ subscriptions: number(),
26447
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26448
+ subscriptionStops: number(),
26449
+ distinctGroups: number(),
26450
+ /**
26451
+ * Operations counted in the totals whose CALLER attribution was shed at the
26452
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26453
+ * which transport they arrived on, they just lost their group row.
26454
+ */
26455
+ unattributedCalls: number(),
26456
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26457
+ groups: array(RequestCensusGroupSchema).readonly()
26458
+ }).extend({ persisted: boolean() });
26459
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26460
+ var LogLevelSchema$1 = _enum([
26461
+ "debug",
26462
+ "info",
26463
+ "warn",
26464
+ "error"
26465
+ ]);
26466
+ /**
26467
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26468
+ *
26469
+ * A diagnostic is anything whose cost is only worth paying while a question is
26470
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26471
+ */
26472
+ var DiagnosticIdSchema = _enum(["request-census"]);
26473
+ /**
26474
+ * The layers of the level hierarchy, general → specific. The most specific
26475
+ * layer that carries an explicit value wins.
26476
+ *
26477
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26478
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26479
+ * grow later would force every consumer of this document to change with it.
26480
+ * Nothing returns `component` today.
26481
+ */
26482
+ var LoggingScopeKindSchema = _enum([
26483
+ "cluster",
26484
+ "node",
26485
+ "component"
26486
+ ]);
26487
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26488
+ var LoggingLevelSourceSchema = _enum([
26489
+ "default",
26490
+ "cluster",
26491
+ "node",
26492
+ "component"
26493
+ ]);
26494
+ /**
26495
+ * One layer of the hierarchy as it actually STANDS.
26496
+ *
26497
+ * `level: null` is the whole reason this array is returned: it is the
26498
+ * difference between "this node is at `info` because I decided it" and
26499
+ * "...because it inherits". An operator who clears an override believing they
26500
+ * are clearing an inherited value has been handed the same defect as the two
26501
+ * contradicting knobs this document exists to remove, moved one floor up.
26502
+ */
26503
+ var LoggingLevelLayerSchema = object({
26504
+ scope: LoggingScopeKindSchema,
26505
+ /** The node this layer speaks for; `null` on the cluster layer. */
26506
+ nodeId: string().nullable(),
26507
+ /** Explicitly set here, or `null` when this layer inherits. */
26508
+ level: LogLevelSchema$1.nullable()
26509
+ });
26510
+ /** What a line is judged against, and WHICH layer decided it. */
26511
+ var LoggingEffectiveSchema = object({
26512
+ level: LogLevelSchema$1,
26513
+ levelSource: LoggingLevelSourceSchema
26514
+ });
26515
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26516
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26517
+ /**
26518
+ * An armed diagnostic, with its DEADLINE.
26519
+ *
26520
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26521
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26522
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26523
+ * `armed` is false — a window is never reported as slightly expired.
26524
+ */
26525
+ var DiagnosticWindowSchema = object({
26526
+ id: DiagnosticIdSchema,
26527
+ armed: boolean(),
26528
+ /** Epoch ms the window closes at. 0 when disarmed. */
26529
+ armedUntilMs: number(),
26530
+ /** Ms left before it expires on its own. 0 when disarmed. */
26531
+ remainingMs: number(),
26532
+ /** Whether the stored deadline is the one the live diagnostic is running —
26533
+ * i.e. whether this window would survive a restart. */
26534
+ persisted: boolean()
26535
+ });
26536
+ /**
26537
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26538
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26539
+ * is a second knob that disagrees with the first the day one of them moves.
26540
+ */
26541
+ var DiagnosticWindowPatchSchema = object({
26542
+ id: DiagnosticIdSchema,
26543
+ armMs: number().int().min(0),
26544
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26545
+ reportEveryMs: number().int().positive().optional()
26546
+ });
26547
+ /**
26548
+ * A PATCH, and patches MERGE.
26549
+ *
26550
+ * A field absent from the patch is left exactly as it was — arming a
26551
+ * diagnostic never resets a level, and setting a level never disarms a window.
26552
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26553
+ * `setAll` already merges, and rebuilding the object is how an absent field
26554
+ * turns into an erased one.
26555
+ */
26556
+ var LoggingSettingsPatchSchema = object({
26557
+ /**
26558
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26559
+ * addressed scope so it inherits again. A value sets it.
26560
+ */
26561
+ level: LogLevelSchema$1.nullable().optional(),
26562
+ /**
26563
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26564
+ * keeps running — a patch is never a full replacement.
26565
+ */
26566
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26567
+ });
26568
+ /**
26569
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26570
+ *
26571
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26572
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26573
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26574
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26575
+ * by an agent that holds no cluster document at all. The hub is the single
26576
+ * authority over the whole hierarchy and answers for every layer, so the
26577
+ * layer selector needs a name the transport does not already own.
26578
+ */
26579
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26580
+ var SetLoggingSettingsInputSchema = object({
26581
+ scopeNodeId: string().optional(),
26582
+ patch: LoggingSettingsPatchSchema
26583
+ });
26584
+ /**
26585
+ * The whole document, as read and as returned after every write.
26586
+ *
26587
+ * `persisted: false` means the settings store could not be read or written.
26588
+ * The in-memory mirror still governs behaviour and is unchanged by the
26589
+ * failure — a read that fails neither switches a level nor disarms a window
26590
+ * (D49) — but the operator is told that what they are looking at would not
26591
+ * survive a restart.
26592
+ */
26593
+ var LoggingSettingsStateSchema = object({
26594
+ /** The layer this document was read at. `null` = the cluster layer. */
26595
+ scopeNodeId: string().nullable(),
26596
+ effective: LoggingEffectiveSchema,
26597
+ explicit: LoggingExplicitSchema,
26598
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26599
+ persisted: boolean()
26600
+ });
26141
26601
  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(), {
26142
26602
  kind: "mutation",
26143
26603
  auth: "admin"
@@ -26150,6 +26610,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26150
26610
  }), method(_void(), SiteLocationStatusSchema, {
26151
26611
  kind: "mutation",
26152
26612
  auth: "admin"
26613
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26614
+ kind: "mutation",
26615
+ auth: "admin"
26153
26616
  });
26154
26617
  object({
26155
26618
  /** True when the device's tamper switch / case-open contact is
@@ -32391,6 +32854,18 @@ Object.freeze({
32391
32854
  addonId: null,
32392
32855
  access: "create"
32393
32856
  },
32857
+ "system.getLoggingSettings": {
32858
+ capName: "system",
32859
+ capScope: "system",
32860
+ addonId: null,
32861
+ access: "view"
32862
+ },
32863
+ "system.getRequestCensus": {
32864
+ capName: "system",
32865
+ capScope: "system",
32866
+ addonId: null,
32867
+ access: "view"
32868
+ },
32394
32869
  "system.getRetentionConfig": {
32395
32870
  capName: "system",
32396
32871
  capScope: "system",
@@ -32421,6 +32896,12 @@ Object.freeze({
32421
32896
  addonId: null,
32422
32897
  access: "view"
32423
32898
  },
32899
+ "system.setLoggingSettings": {
32900
+ capName: "system",
32901
+ capScope: "system",
32902
+ addonId: null,
32903
+ access: "create"
32904
+ },
32424
32905
  "system.setRetentionConfig": {
32425
32906
  capName: "system",
32426
32907
  capScope: "system",
@@ -33576,6 +34057,10 @@ Object.freeze({
33576
34057
  name: "deviceId",
33577
34058
  form: "single",
33578
34059
  optional: true
34060
+ }, {
34061
+ name: "deviceIds",
34062
+ form: "array",
34063
+ optional: true
33579
34064
  }],
33580
34065
  "fanControl.setDirection": [{
33581
34066
  name: "deviceId",
@@ -35186,7 +35671,38 @@ object({
35186
35671
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
35187
35672
  * reproduce that.
35188
35673
  */
35189
- tileBudgetMb: number().int().min(0).max(1024)
35674
+ tileBudgetMb: number().int().min(0).max(1024),
35675
+ /**
35676
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35677
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35678
+ * subject tiles, on frames that detected something.
35679
+ *
35680
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35681
+ * containment is strict by design, so the native `keyFrame`, the detail
35682
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35683
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35684
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35685
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35686
+ *
35687
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35688
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35689
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35690
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35691
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35692
+ * binds only through a detection burst, where it still covers well past the
35693
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35694
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35695
+ * whole shape exists to avoid.
35696
+ *
35697
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35698
+ * subject tile, so one shared budget would let a busy camera's key frames
35699
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35700
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35701
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35702
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35703
+ * nothing.
35704
+ */
35705
+ sceneBudgetMb: number().int().min(0).max(1024)
35190
35706
  });
35191
35707
  /**
35192
35708
  * The values in force when the operator has set nothing.
@@ -35202,12 +35718,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
35202
35718
  budgetMb: 1024,
35203
35719
  activityMs: 15e3,
35204
35720
  tileBudgetMb: 64,
35721
+ sceneBudgetMb: 48,
35205
35722
  admission: "inferred"
35206
35723
  };
35207
35724
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
35208
35725
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
35209
35726
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
35210
35727
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35728
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
35211
35729
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
35212
35730
  var MB = 1024 * 1024;
35213
35731
  1024 * MB, 3072 * MB;