@camstack/addon-remote-storage 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.
@@ -7511,6 +7511,66 @@ var OpsLogQueryInputSchema = object({
7511
7511
  /** Max rows returned, newest-first. */
7512
7512
  limit: number().int().min(1).max(1e3).optional()
7513
7513
  });
7514
+ var LabelDefinitionSchema = object({
7515
+ id: string(),
7516
+ name: string(),
7517
+ category: string().optional(),
7518
+ description: string().optional(),
7519
+ icon: string().optional()
7520
+ });
7521
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7522
+ var CLASS_MAP_MACRO_TARGETS = [
7523
+ "person",
7524
+ "vehicle",
7525
+ "animal",
7526
+ "package"
7527
+ ];
7528
+ /**
7529
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7530
+ * un operatore può selezionare.
7531
+ *
7532
+ * Sono le tre offerte dallo step `object-detection`
7533
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7534
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7535
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7536
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7537
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7538
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7539
+ *
7540
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7541
+ * dello step e una seconda volta come union `FirstLevelMacro`
7542
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7543
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7544
+ * successiva.
7545
+ */
7546
+ var FIRST_LEVEL_MACRO_CLASSES = [
7547
+ "person",
7548
+ "vehicle",
7549
+ "animal"
7550
+ ];
7551
+ /**
7552
+ * Wire schema for a per-model CATALOG classMap override
7553
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7554
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7555
+ * detection pipeline executor actually routes.
7556
+ *
7557
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7558
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7559
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7560
+ * enum) — the two used to share the name `ClassMapDefinition`/
7561
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7562
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7563
+ * are not: it is two different concepts colliding on a name. Keep this type
7564
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7565
+ * would either narrow every `ClassMapDefinition` consumer to the four
7566
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7567
+ * schema exists for (see the "rejects a classMap whose target is not a
7568
+ * detection macro" test in `model-catalog-schema.test.ts`).
7569
+ */
7570
+ var DetectionCatalogClassMapSchema = object({
7571
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7572
+ preserveOriginal: boolean()
7573
+ });
7514
7574
  /**
7515
7575
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7516
7576
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7533,10 +7593,55 @@ var RecordingStorageModeSchema = _enum([
7533
7593
  "events",
7534
7594
  "continuous"
7535
7595
  ]);
7596
+ /**
7597
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7598
+ * tre offerte dallo step `object-detection`, da UNA lista
7599
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7600
+ */
7601
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7602
+ /**
7603
+ * True quando `values` non ripete un elemento.
7604
+ *
7605
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7606
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7607
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7608
+ */
7609
+ var noDuplicates = (values) => new Set(values).size === values.length;
7536
7610
  /** Which detectors trigger an `events`-mode band. */
7537
7611
  var RecordingTriggersSchema = object({
7538
7612
  motion: boolean().optional(),
7539
- audioThresholdDbfs: number().optional()
7613
+ audioThresholdDbfs: number().optional(),
7614
+ /**
7615
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7616
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7617
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7618
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7619
+ *
7620
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7621
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7622
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7623
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7624
+ * finestre — vedi `recorder/object-trigger.ts`.
7625
+ */
7626
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7627
+ /**
7628
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7629
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7630
+ * `objectClasses`.
7631
+ *
7632
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7633
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7634
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7635
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7636
+ * device (D12) — mai un elenco globale di cap.
7637
+ *
7638
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7639
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7640
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7641
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7642
+ * registrare.
7643
+ */
7644
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7540
7645
  });
7541
7646
  /**
7542
7647
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -7988,41 +8093,6 @@ var DecoderSessionConfigSchema = object({
7988
8093
  */
7989
8094
  debug: boolean().optional()
7990
8095
  });
7991
- var LabelDefinitionSchema = object({
7992
- id: string(),
7993
- name: string(),
7994
- category: string().optional(),
7995
- description: string().optional(),
7996
- icon: string().optional()
7997
- });
7998
- /**
7999
- * Wire schema for a per-model CATALOG classMap override
8000
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8001
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8002
- * detection pipeline executor actually routes.
8003
- *
8004
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8005
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8006
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8007
- * enum) — the two used to share the name `ClassMapDefinition`/
8008
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8009
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8010
- * are not: it is two different concepts colliding on a name. Keep this type
8011
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8012
- * would either narrow every `ClassMapDefinition` consumer to the four
8013
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8014
- * schema exists for (see the "rejects a classMap whose target is not a
8015
- * detection macro" test in `model-catalog-schema.test.ts`).
8016
- */
8017
- var DetectionCatalogClassMapSchema = object({
8018
- mapping: record(string(), _enum([
8019
- "person",
8020
- "vehicle",
8021
- "animal",
8022
- "package"
8023
- ])),
8024
- preserveOriginal: boolean()
8025
- });
8026
8096
  var MODEL_FORMATS = [
8027
8097
  "onnx",
8028
8098
  "coreml",
@@ -20856,7 +20926,7 @@ var lifecycleJobSchema = object({
20856
20926
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
20857
20927
  * as every other cap.
20858
20928
  */
20859
- var LogLevelSchema$1 = _enum([
20929
+ var LogLevelSchema$2 = _enum([
20860
20930
  "debug",
20861
20931
  "info",
20862
20932
  "warn",
@@ -21063,7 +21133,7 @@ var CustomActionInputSchema = object({
21063
21133
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21064
21134
  addonId: string(),
21065
21135
  limit: number().min(1).max(500).default(100),
21066
- level: LogLevelSchema$1.optional()
21136
+ level: LogLevelSchema$2.optional()
21067
21137
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21068
21138
  packageName: string(),
21069
21139
  version: string().optional()
@@ -21161,7 +21231,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21161
21231
  auth: "admin"
21162
21232
  }), method(object({
21163
21233
  addonId: string(),
21164
- level: LogLevelSchema$1.optional()
21234
+ level: LogLevelSchema$2.optional()
21165
21235
  }), LogStreamEntrySchema, { kind: "subscription" });
21166
21236
  object({
21167
21237
  /** Carbon dioxide concentration in ppm. */
@@ -22155,6 +22225,35 @@ var FaceFilterEnum = _enum([
22155
22225
  "identified",
22156
22226
  "all"
22157
22227
  ]);
22228
+ /**
22229
+ * What a `listRecentFaces` page is ORDERED BY.
22230
+ *
22231
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22232
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22233
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22234
+ * order: it puts the suggestions an operator can confirm with one tap at the
22235
+ * top, and it is the reason this enum exists — a client that ranked a capped
22236
+ * page client-side was ranking the newest N, never the most certain N.
22237
+ *
22238
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22239
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22240
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22241
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22242
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22243
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22244
+ * then by faceId, and is what makes this a total order instead of the
22245
+ * backend's NULL-collation accident.
22246
+ */
22247
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22248
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22249
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22250
+ * never leaves the server. */
22251
+ var FaceClusterSchema = object({
22252
+ faceIds: array(string()).readonly(),
22253
+ representativeFaceId: string(),
22254
+ size: number().int(),
22255
+ cohesion: number()
22256
+ });
22158
22257
  var MediaFileLiteSchema$1 = object({
22159
22258
  key: string(),
22160
22259
  kind: string(),
@@ -22201,24 +22300,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22201
22300
  kind: "mutation",
22202
22301
  auth: "admin"
22203
22302
  }), method(object({
22204
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22303
+ /**
22304
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22305
+ *
22306
+ * The legacy single-camera form, kept verbatim for every caller that
22307
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22308
+ * instead — never both: `deviceIds` is the authority whenever it is
22309
+ * present, and this field is then ignored rather than unioned, so
22310
+ * there is exactly one answer to "which cameras did I ask for".
22311
+ */
22205
22312
  deviceId: number().int().optional(),
22313
+ /**
22314
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22315
+ * until now had to fetch the cluster-wide page and drop rows in the
22316
+ * client (so the `limit` it asked for was spent on cameras it was
22317
+ * about to discard).
22318
+ *
22319
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22320
+ * "every camera". A request for no devices is a request, not an
22321
+ * omission; same contract as `deviceManager.listFleet` and
22322
+ * `pipelineAnalytics.listRecentTracks`.
22323
+ *
22324
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22325
+ */
22326
+ deviceIds: array(number().int()).optional(),
22206
22327
  limit: number().int().positive().optional(),
22207
22328
  filter: FaceFilterEnum.optional(),
22208
22329
  /**
22209
- * Inline the base64 crop on every row. Default `true` — the existing
22210
- * behaviour, kept so no caller breaks.
22330
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22331
+ * Absent means no lower bound.
22332
+ */
22333
+ since: number().int().optional(),
22334
+ /**
22335
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22336
+ * Absent means no upper bound.
22337
+ */
22338
+ until: number().int().optional(),
22339
+ /**
22340
+ * Order the page by time or by suggestion certainty. Default
22341
+ * `'timestamp'` — the historical order, unchanged for every caller
22342
+ * that does not ask.
22211
22343
  *
22212
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22213
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22214
- * the browser cache the images.
22344
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22345
+ * does under `'suggestionConfidence'`.
22215
22346
  *
22216
- * **This is an INPUT field, so it does not reach the addon until the
22217
- * next train.** The hub router validates cap inputs against its own
22218
- * compiled Zod, which strips a key it does not know verified today
22219
- * on the OUTPUT side, where an additive field DOES arrive immediately
22220
- * (`Track.hasFace`). Until the train ships, sending `false` is
22221
- * harmless and simply keeps the crops inline.
22347
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22348
+ * index and stops reading as soon as `limit` rows have PASSED the
22349
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
22350
+ * certain row may be the oldest so it walks the window. Narrow it
22351
+ * with {@link since} / {@link until}.
22352
+ */
22353
+ sortBy: FaceSortFieldEnum.optional(),
22354
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22355
+ sortDirection: FaceSortDirectionEnum.optional(),
22356
+ /**
22357
+ * Inline the base64 crop on every row.
22358
+ *
22359
+ * Default `false` since the 2026-08-25 inversion — see
22360
+ * `include-crops-default.ts`, which is the ONE place that resolves
22361
+ * this for every gallery, and which records why the inline shape had
22362
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22363
+ * The doc here used to still say `true`; it was wrong, and a leftover
22364
+ * that describes the old design reads as permission to rely on it.
22365
+ *
22366
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22367
+ * which the browser fetches off the `event-media` plane in parallel,
22368
+ * cached and ETagged.
22222
22369
  */
22223
22370
  includeCrops: boolean().optional()
22224
22371
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22254,13 +22401,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22254
22401
  }), method(object({
22255
22402
  threshold: number().min(0).max(1).optional(),
22256
22403
  minClusterSize: number().int().min(2).optional(),
22257
- limit: number().int().positive().optional()
22258
- }).optional(), array(object({
22259
- faceIds: array(string()).readonly(),
22260
- representativeFaceId: string(),
22261
- size: number().int(),
22262
- cohesion: number()
22263
- })).readonly());
22404
+ /**
22405
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22406
+ * which read as though it bounded the work — it never did.
22407
+ *
22408
+ * Wins over {@link limit} when both are sent.
22409
+ */
22410
+ maxClusters: number().int().positive().optional(),
22411
+ /**
22412
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22413
+ * RESULT, not the scan. Kept so existing callers keep working; send
22414
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22415
+ */
22416
+ limit: number().int().positive().optional(),
22417
+ /**
22418
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22419
+ * POOL, not the result.
22420
+ *
22421
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22422
+ * used to read every unassigned face on the hub no matter what the
22423
+ * caller asked for, because the only bound cut the finished clusters
22424
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22425
+ * whole corpus, on an addon whose disk is under contention.
22426
+ *
22427
+ * The pool is the NEWEST matching faces first — the same order the
22428
+ * gallery shows — so a bound here shortens the horizon, it does not
22429
+ * sample it randomly.
22430
+ *
22431
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22432
+ * so the live corpus — 372 face rows — is unaffected while the
22433
+ * unbounded scan can never come back as the table grows.
22434
+ */
22435
+ maxFacesScanned: number().int().positive().optional()
22436
+ }).optional(), array(FaceClusterSchema).readonly());
22264
22437
  /**
22265
22438
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22266
22439
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -25983,6 +26156,293 @@ var SetSiteLocationInputSchema = object({
25983
26156
  latitude: number().min(-90).max(90),
25984
26157
  longitude: number().min(-180).max(180)
25985
26158
  }).nullable();
26159
+ /**
26160
+ * The TRANSPORT a call arrived on.
26161
+ *
26162
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26163
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26164
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26165
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26166
+ * checkable rather than asserted.
26167
+ *
26168
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26169
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26170
+ * connection; the viewer talks to the hub over `wsLink`
26171
+ * exclusively, so this is the plane the HTTP census could not see.
26172
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26173
+ * never touches a socket and therefore never touched a census.
26174
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26175
+ * that is exactly what its `0` asserts: every plane the hub has can name
26176
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26177
+ * plane nobody instrumented lands here instead of vanishing from the total.
26178
+ */
26179
+ var TransportPlaneSchema = _enum([
26180
+ "http",
26181
+ "ws",
26182
+ "mesh",
26183
+ "unknown"
26184
+ ]);
26185
+ /**
26186
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26187
+ * reads as "not instrumented", which is the one thing this census must never
26188
+ * make an operator wonder about.
26189
+ */
26190
+ var TransportPlaneCountsSchema = object({
26191
+ http: number(),
26192
+ ws: number(),
26193
+ mesh: number(),
26194
+ unknown: number()
26195
+ });
26196
+ /**
26197
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26198
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26199
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26200
+ * already prints - never a token, never an `Authorization` header.
26201
+ *
26202
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26203
+ * and lives for hours, so folding it into a call count makes one long-lived
26204
+ * stream look like a storm.
26205
+ */
26206
+ var RequestCensusGroupSchema = object({
26207
+ plane: TransportPlaneSchema,
26208
+ procedure: string(),
26209
+ userAgent: string(),
26210
+ ip: string(),
26211
+ principal: string(),
26212
+ calls: number(),
26213
+ subscriptions: number(),
26214
+ perMin: number()
26215
+ });
26216
+ /**
26217
+ * A procedure's TOTAL over the window, across every caller.
26218
+ *
26219
+ * This block, not the group list, is what answers "did these calls arrive over
26220
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26221
+ * same window excludes the HTTP plane, which is a result, not a failure.
26222
+ */
26223
+ var RequestCensusProcedureSchema = object({
26224
+ procedure: string(),
26225
+ calls: number(),
26226
+ /**
26227
+ * The same total, split by transport. THIS is the row that answers the
26228
+ * question the census exists for: one look at `deviceManager.listAll` says
26229
+ * which plane carried the 4 960, without joining two log lines by eye.
26230
+ */
26231
+ planes: TransportPlaneCountsSchema,
26232
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26233
+ subscriptions: number(),
26234
+ perMin: number()
26235
+ });
26236
+ /**
26237
+ * The census as an operator sees it.
26238
+ *
26239
+ * `persisted` is the honest answer to "will this survive the restart I am
26240
+ * about to do": the arm deadline is written to `system-settings` so a window
26241
+ * armed now can measure the NEXT boot, and a write that failed must not look
26242
+ * like one that succeeded.
26243
+ */
26244
+ var RequestCensusStatusSchema = object({
26245
+ armed: boolean(),
26246
+ /** How long the current - or just-closed - window collected, in ms. */
26247
+ elapsedMs: number(),
26248
+ /** The window actually armed, after the server clamped the request. */
26249
+ windowMs: number(),
26250
+ /** Epoch ms the window closes at. 0 when disarmed. */
26251
+ armedUntilMs: number(),
26252
+ httpRequests: number(),
26253
+ batchedRequests: number(),
26254
+ /**
26255
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26256
+ * is in play (`?batch=1` carries several procedures in one request); this is
26257
+ * the number comparable with a store-side call count.
26258
+ */
26259
+ procedureCalls: number(),
26260
+ /**
26261
+ * `procedureCalls` split by transport. The four keys sum to
26262
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26263
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26264
+ */
26265
+ planes: TransportPlaneCountsSchema,
26266
+ /**
26267
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26268
+ * on no plane at all - which is a RESULT (a plane is missing from the
26269
+ * instrument), not a failure, and it has to be visible to be read as one.
26270
+ */
26271
+ planesExplainTotal: boolean(),
26272
+ /**
26273
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26274
+ * adapter resolves one context per connection - kept because a plane's call
26275
+ * count of zero against 37 open connections says something different from a
26276
+ * plane with no connections at all.
26277
+ */
26278
+ wsConnections: number(),
26279
+ /**
26280
+ * Client frames the WS plane looked at. `wsMessages` far above
26281
+ * `planes.ws + subscriptions` means most traffic is not operations
26282
+ * (keepalives, connection params) - which is itself an answer.
26283
+ */
26284
+ wsMessages: number(),
26285
+ /**
26286
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26287
+ * purpose: one live-events stream opened at boot and held for six hours is
26288
+ * one subscription, and counting it as a call would let a quiet plane
26289
+ * masquerade as the storm.
26290
+ */
26291
+ subscriptions: number(),
26292
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26293
+ subscriptionStops: number(),
26294
+ distinctGroups: number(),
26295
+ /**
26296
+ * Operations counted in the totals whose CALLER attribution was shed at the
26297
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26298
+ * which transport they arrived on, they just lost their group row.
26299
+ */
26300
+ unattributedCalls: number(),
26301
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26302
+ groups: array(RequestCensusGroupSchema).readonly()
26303
+ }).extend({ persisted: boolean() });
26304
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26305
+ var LogLevelSchema$1 = _enum([
26306
+ "debug",
26307
+ "info",
26308
+ "warn",
26309
+ "error"
26310
+ ]);
26311
+ /**
26312
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26313
+ *
26314
+ * A diagnostic is anything whose cost is only worth paying while a question is
26315
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26316
+ */
26317
+ var DiagnosticIdSchema = _enum(["request-census"]);
26318
+ /**
26319
+ * The layers of the level hierarchy, general → specific. The most specific
26320
+ * layer that carries an explicit value wins.
26321
+ *
26322
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26323
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26324
+ * grow later would force every consumer of this document to change with it.
26325
+ * Nothing returns `component` today.
26326
+ */
26327
+ var LoggingScopeKindSchema = _enum([
26328
+ "cluster",
26329
+ "node",
26330
+ "component"
26331
+ ]);
26332
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26333
+ var LoggingLevelSourceSchema = _enum([
26334
+ "default",
26335
+ "cluster",
26336
+ "node",
26337
+ "component"
26338
+ ]);
26339
+ /**
26340
+ * One layer of the hierarchy as it actually STANDS.
26341
+ *
26342
+ * `level: null` is the whole reason this array is returned: it is the
26343
+ * difference between "this node is at `info` because I decided it" and
26344
+ * "...because it inherits". An operator who clears an override believing they
26345
+ * are clearing an inherited value has been handed the same defect as the two
26346
+ * contradicting knobs this document exists to remove, moved one floor up.
26347
+ */
26348
+ var LoggingLevelLayerSchema = object({
26349
+ scope: LoggingScopeKindSchema,
26350
+ /** The node this layer speaks for; `null` on the cluster layer. */
26351
+ nodeId: string().nullable(),
26352
+ /** Explicitly set here, or `null` when this layer inherits. */
26353
+ level: LogLevelSchema$1.nullable()
26354
+ });
26355
+ /** What a line is judged against, and WHICH layer decided it. */
26356
+ var LoggingEffectiveSchema = object({
26357
+ level: LogLevelSchema$1,
26358
+ levelSource: LoggingLevelSourceSchema
26359
+ });
26360
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26361
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26362
+ /**
26363
+ * An armed diagnostic, with its DEADLINE.
26364
+ *
26365
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26366
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26367
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26368
+ * `armed` is false — a window is never reported as slightly expired.
26369
+ */
26370
+ var DiagnosticWindowSchema = object({
26371
+ id: DiagnosticIdSchema,
26372
+ armed: boolean(),
26373
+ /** Epoch ms the window closes at. 0 when disarmed. */
26374
+ armedUntilMs: number(),
26375
+ /** Ms left before it expires on its own. 0 when disarmed. */
26376
+ remainingMs: number(),
26377
+ /** Whether the stored deadline is the one the live diagnostic is running —
26378
+ * i.e. whether this window would survive a restart. */
26379
+ persisted: boolean()
26380
+ });
26381
+ /**
26382
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26383
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26384
+ * is a second knob that disagrees with the first the day one of them moves.
26385
+ */
26386
+ var DiagnosticWindowPatchSchema = object({
26387
+ id: DiagnosticIdSchema,
26388
+ armMs: number().int().min(0),
26389
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26390
+ reportEveryMs: number().int().positive().optional()
26391
+ });
26392
+ /**
26393
+ * A PATCH, and patches MERGE.
26394
+ *
26395
+ * A field absent from the patch is left exactly as it was — arming a
26396
+ * diagnostic never resets a level, and setting a level never disarms a window.
26397
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26398
+ * `setAll` already merges, and rebuilding the object is how an absent field
26399
+ * turns into an erased one.
26400
+ */
26401
+ var LoggingSettingsPatchSchema = object({
26402
+ /**
26403
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26404
+ * addressed scope so it inherits again. A value sets it.
26405
+ */
26406
+ level: LogLevelSchema$1.nullable().optional(),
26407
+ /**
26408
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26409
+ * keeps running — a patch is never a full replacement.
26410
+ */
26411
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26412
+ });
26413
+ /**
26414
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26415
+ *
26416
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26417
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26418
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26419
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26420
+ * by an agent that holds no cluster document at all. The hub is the single
26421
+ * authority over the whole hierarchy and answers for every layer, so the
26422
+ * layer selector needs a name the transport does not already own.
26423
+ */
26424
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26425
+ var SetLoggingSettingsInputSchema = object({
26426
+ scopeNodeId: string().optional(),
26427
+ patch: LoggingSettingsPatchSchema
26428
+ });
26429
+ /**
26430
+ * The whole document, as read and as returned after every write.
26431
+ *
26432
+ * `persisted: false` means the settings store could not be read or written.
26433
+ * The in-memory mirror still governs behaviour and is unchanged by the
26434
+ * failure — a read that fails neither switches a level nor disarms a window
26435
+ * (D49) — but the operator is told that what they are looking at would not
26436
+ * survive a restart.
26437
+ */
26438
+ var LoggingSettingsStateSchema = object({
26439
+ /** The layer this document was read at. `null` = the cluster layer. */
26440
+ scopeNodeId: string().nullable(),
26441
+ effective: LoggingEffectiveSchema,
26442
+ explicit: LoggingExplicitSchema,
26443
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26444
+ persisted: boolean()
26445
+ });
25986
26446
  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(), {
25987
26447
  kind: "mutation",
25988
26448
  auth: "admin"
@@ -25995,6 +26455,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
25995
26455
  }), method(_void(), SiteLocationStatusSchema, {
25996
26456
  kind: "mutation",
25997
26457
  auth: "admin"
26458
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26459
+ kind: "mutation",
26460
+ auth: "admin"
25998
26461
  });
25999
26462
  object({
26000
26463
  /** True when the device's tamper switch / case-open contact is
@@ -31826,6 +32289,18 @@ Object.freeze({
31826
32289
  addonId: null,
31827
32290
  access: "create"
31828
32291
  },
32292
+ "system.getLoggingSettings": {
32293
+ capName: "system",
32294
+ capScope: "system",
32295
+ addonId: null,
32296
+ access: "view"
32297
+ },
32298
+ "system.getRequestCensus": {
32299
+ capName: "system",
32300
+ capScope: "system",
32301
+ addonId: null,
32302
+ access: "view"
32303
+ },
31829
32304
  "system.getRetentionConfig": {
31830
32305
  capName: "system",
31831
32306
  capScope: "system",
@@ -31856,6 +32331,12 @@ Object.freeze({
31856
32331
  addonId: null,
31857
32332
  access: "view"
31858
32333
  },
32334
+ "system.setLoggingSettings": {
32335
+ capName: "system",
32336
+ capScope: "system",
32337
+ addonId: null,
32338
+ access: "create"
32339
+ },
31859
32340
  "system.setRetentionConfig": {
31860
32341
  capName: "system",
31861
32342
  capScope: "system",
@@ -33011,6 +33492,10 @@ Object.freeze({
33011
33492
  name: "deviceId",
33012
33493
  form: "single",
33013
33494
  optional: true
33495
+ }, {
33496
+ name: "deviceIds",
33497
+ form: "array",
33498
+ optional: true
33014
33499
  }],
33015
33500
  "fanControl.setDirection": [{
33016
33501
  name: "deviceId",
@@ -34621,7 +35106,38 @@ object({
34621
35106
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34622
35107
  * reproduce that.
34623
35108
  */
34624
- tileBudgetMb: number().int().min(0).max(1024)
35109
+ tileBudgetMb: number().int().min(0).max(1024),
35110
+ /**
35111
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35112
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35113
+ * subject tiles, on frames that detected something.
35114
+ *
35115
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35116
+ * containment is strict by design, so the native `keyFrame`, the detail
35117
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35118
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35119
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35120
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35121
+ *
35122
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35123
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35124
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35125
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35126
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35127
+ * binds only through a detection burst, where it still covers well past the
35128
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35129
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35130
+ * whole shape exists to avoid.
35131
+ *
35132
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35133
+ * subject tile, so one shared budget would let a busy camera's key frames
35134
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35135
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35136
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35137
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35138
+ * nothing.
35139
+ */
35140
+ sceneBudgetMb: number().int().min(0).max(1024)
34625
35141
  });
34626
35142
  /**
34627
35143
  * The values in force when the operator has set nothing.
@@ -34637,12 +35153,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34637
35153
  budgetMb: 1024,
34638
35154
  activityMs: 15e3,
34639
35155
  tileBudgetMb: 64,
35156
+ sceneBudgetMb: 48,
34640
35157
  admission: "inferred"
34641
35158
  };
34642
35159
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34643
35160
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34644
35161
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34645
35162
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35163
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34646
35164
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34647
35165
  var MB = 1024 * 1024;
34648
35166
  1024 * MB, 3072 * MB;