@camstack/addon-mqtt-broker 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.
@@ -7555,6 +7555,66 @@ var OpsLogQueryInputSchema = object({
7555
7555
  /** Max rows returned, newest-first. */
7556
7556
  limit: number().int().min(1).max(1e3).optional()
7557
7557
  });
7558
+ var LabelDefinitionSchema = object({
7559
+ id: string(),
7560
+ name: string(),
7561
+ category: string().optional(),
7562
+ description: string().optional(),
7563
+ icon: string().optional()
7564
+ });
7565
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7566
+ var CLASS_MAP_MACRO_TARGETS = [
7567
+ "person",
7568
+ "vehicle",
7569
+ "animal",
7570
+ "package"
7571
+ ];
7572
+ /**
7573
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7574
+ * un operatore può selezionare.
7575
+ *
7576
+ * Sono le tre offerte dallo step `object-detection`
7577
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7578
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7579
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7580
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7581
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7582
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7583
+ *
7584
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7585
+ * dello step e una seconda volta come union `FirstLevelMacro`
7586
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7587
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7588
+ * successiva.
7589
+ */
7590
+ var FIRST_LEVEL_MACRO_CLASSES = [
7591
+ "person",
7592
+ "vehicle",
7593
+ "animal"
7594
+ ];
7595
+ /**
7596
+ * Wire schema for a per-model CATALOG classMap override
7597
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7598
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7599
+ * detection pipeline executor actually routes.
7600
+ *
7601
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7602
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7603
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7604
+ * enum) — the two used to share the name `ClassMapDefinition`/
7605
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7606
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7607
+ * are not: it is two different concepts colliding on a name. Keep this type
7608
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7609
+ * would either narrow every `ClassMapDefinition` consumer to the four
7610
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7611
+ * schema exists for (see the "rejects a classMap whose target is not a
7612
+ * detection macro" test in `model-catalog-schema.test.ts`).
7613
+ */
7614
+ var DetectionCatalogClassMapSchema = object({
7615
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7616
+ preserveOriginal: boolean()
7617
+ });
7558
7618
  /**
7559
7619
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7560
7620
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7577,10 +7637,55 @@ var RecordingStorageModeSchema = _enum([
7577
7637
  "events",
7578
7638
  "continuous"
7579
7639
  ]);
7640
+ /**
7641
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7642
+ * tre offerte dallo step `object-detection`, da UNA lista
7643
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7644
+ */
7645
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7646
+ /**
7647
+ * True quando `values` non ripete un elemento.
7648
+ *
7649
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7650
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7651
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7652
+ */
7653
+ var noDuplicates = (values) => new Set(values).size === values.length;
7580
7654
  /** Which detectors trigger an `events`-mode band. */
7581
7655
  var RecordingTriggersSchema = object({
7582
7656
  motion: boolean().optional(),
7583
- audioThresholdDbfs: number().optional()
7657
+ audioThresholdDbfs: number().optional(),
7658
+ /**
7659
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7660
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7661
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7662
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7663
+ *
7664
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7665
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7666
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7667
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7668
+ * finestre — vedi `recorder/object-trigger.ts`.
7669
+ */
7670
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7671
+ /**
7672
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7673
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7674
+ * `objectClasses`.
7675
+ *
7676
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7677
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7678
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7679
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7680
+ * device (D12) — mai un elenco globale di cap.
7681
+ *
7682
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7683
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7684
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7685
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7686
+ * registrare.
7687
+ */
7688
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7584
7689
  });
7585
7690
  /**
7586
7691
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8032,41 +8137,6 @@ var DecoderSessionConfigSchema = object({
8032
8137
  */
8033
8138
  debug: boolean().optional()
8034
8139
  });
8035
- var LabelDefinitionSchema = object({
8036
- id: string(),
8037
- name: string(),
8038
- category: string().optional(),
8039
- description: string().optional(),
8040
- icon: string().optional()
8041
- });
8042
- /**
8043
- * Wire schema for a per-model CATALOG classMap override
8044
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8045
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8046
- * detection pipeline executor actually routes.
8047
- *
8048
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8049
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8050
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8051
- * enum) — the two used to share the name `ClassMapDefinition`/
8052
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8053
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8054
- * are not: it is two different concepts colliding on a name. Keep this type
8055
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8056
- * would either narrow every `ClassMapDefinition` consumer to the four
8057
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8058
- * schema exists for (see the "rejects a classMap whose target is not a
8059
- * detection macro" test in `model-catalog-schema.test.ts`).
8060
- */
8061
- var DetectionCatalogClassMapSchema = object({
8062
- mapping: record(string(), _enum([
8063
- "person",
8064
- "vehicle",
8065
- "animal",
8066
- "package"
8067
- ])),
8068
- preserveOriginal: boolean()
8069
- });
8070
8140
  var MODEL_FORMATS = [
8071
8141
  "onnx",
8072
8142
  "coreml",
@@ -15577,7 +15647,23 @@ var NcHistoryEntrySchema = object({
15577
15647
  updatedAt: number(),
15578
15648
  /** Failure detail — present on a `dead` row. */
15579
15649
  error: string().optional(),
15580
- subject: NcHistorySubjectSchema
15650
+ subject: NcHistorySubjectSchema,
15651
+ /**
15652
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15653
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15654
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15655
+ * every delivery attempt). Absent on a row still pending/dead, a row
15656
+ * delivered before this field shipped, or a wiring with no artefact index.
15657
+ *
15658
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15659
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15660
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15661
+ * also answers `null` for an id whose artefact has since expired past the
15662
+ * retained shelf's own age bound — the degrade a caller (the Home
15663
+ * Assistant export) must render as "no image right now", never as a
15664
+ * broken link.
15665
+ */
15666
+ artifactIds: array(string().min(1)).optional()
15581
15667
  });
15582
15668
  /**
15583
15669
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -15804,7 +15890,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
15804
15890
  }), method(object({}), object({
15805
15891
  catalog: array(NcConditionDescriptorSchema),
15806
15892
  taxonomy: NcTaxonomySchema.optional()
15807
- })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
15893
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
15808
15894
  kind: "mutation",
15809
15895
  caller: "required"
15810
15896
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -20892,7 +20978,7 @@ var lifecycleJobSchema = object({
20892
20978
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
20893
20979
  * as every other cap.
20894
20980
  */
20895
- var LogLevelSchema$1 = _enum([
20981
+ var LogLevelSchema$2 = _enum([
20896
20982
  "debug",
20897
20983
  "info",
20898
20984
  "warn",
@@ -21099,7 +21185,7 @@ var CustomActionInputSchema = object({
21099
21185
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21100
21186
  addonId: string(),
21101
21187
  limit: number().min(1).max(500).default(100),
21102
- level: LogLevelSchema$1.optional()
21188
+ level: LogLevelSchema$2.optional()
21103
21189
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21104
21190
  packageName: string(),
21105
21191
  version: string().optional()
@@ -21197,7 +21283,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21197
21283
  auth: "admin"
21198
21284
  }), method(object({
21199
21285
  addonId: string(),
21200
- level: LogLevelSchema$1.optional()
21286
+ level: LogLevelSchema$2.optional()
21201
21287
  }), LogStreamEntrySchema, { kind: "subscription" });
21202
21288
  object({
21203
21289
  /** Carbon dioxide concentration in ppm. */
@@ -22191,6 +22277,35 @@ var FaceFilterEnum = _enum([
22191
22277
  "identified",
22192
22278
  "all"
22193
22279
  ]);
22280
+ /**
22281
+ * What a `listRecentFaces` page is ORDERED BY.
22282
+ *
22283
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22284
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22285
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22286
+ * order: it puts the suggestions an operator can confirm with one tap at the
22287
+ * top, and it is the reason this enum exists — a client that ranked a capped
22288
+ * page client-side was ranking the newest N, never the most certain N.
22289
+ *
22290
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22291
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22292
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22293
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22294
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22295
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22296
+ * then by faceId, and is what makes this a total order instead of the
22297
+ * backend's NULL-collation accident.
22298
+ */
22299
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22300
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22301
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22302
+ * never leaves the server. */
22303
+ var FaceClusterSchema = object({
22304
+ faceIds: array(string()).readonly(),
22305
+ representativeFaceId: string(),
22306
+ size: number().int(),
22307
+ cohesion: number()
22308
+ });
22194
22309
  var MediaFileLiteSchema$1 = object({
22195
22310
  key: string(),
22196
22311
  kind: string(),
@@ -22237,24 +22352,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22237
22352
  kind: "mutation",
22238
22353
  auth: "admin"
22239
22354
  }), method(object({
22240
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22355
+ /**
22356
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22357
+ *
22358
+ * The legacy single-camera form, kept verbatim for every caller that
22359
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22360
+ * instead — never both: `deviceIds` is the authority whenever it is
22361
+ * present, and this field is then ignored rather than unioned, so
22362
+ * there is exactly one answer to "which cameras did I ask for".
22363
+ */
22241
22364
  deviceId: number().int().optional(),
22365
+ /**
22366
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22367
+ * until now had to fetch the cluster-wide page and drop rows in the
22368
+ * client (so the `limit` it asked for was spent on cameras it was
22369
+ * about to discard).
22370
+ *
22371
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22372
+ * "every camera". A request for no devices is a request, not an
22373
+ * omission; same contract as `deviceManager.listFleet` and
22374
+ * `pipelineAnalytics.listRecentTracks`.
22375
+ *
22376
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22377
+ */
22378
+ deviceIds: array(number().int()).optional(),
22242
22379
  limit: number().int().positive().optional(),
22243
22380
  filter: FaceFilterEnum.optional(),
22244
22381
  /**
22245
- * Inline the base64 crop on every row. Default `true` — the existing
22246
- * behaviour, kept so no caller breaks.
22382
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22383
+ * Absent means no lower bound.
22384
+ */
22385
+ since: number().int().optional(),
22386
+ /**
22387
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22388
+ * Absent means no upper bound.
22389
+ */
22390
+ until: number().int().optional(),
22391
+ /**
22392
+ * Order the page by time or by suggestion certainty. Default
22393
+ * `'timestamp'` — the historical order, unchanged for every caller
22394
+ * that does not ask.
22247
22395
  *
22248
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22249
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22250
- * the browser cache the images.
22396
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22397
+ * does under `'suggestionConfidence'`.
22251
22398
  *
22252
- * **This is an INPUT field, so it does not reach the addon until the
22253
- * next train.** The hub router validates cap inputs against its own
22254
- * compiled Zod, which strips a key it does not know — verified today
22255
- * on the OUTPUT side, where an additive field DOES arrive immediately
22256
- * (`Track.hasFace`). Until the train ships, sending `false` is
22257
- * harmless and simply keeps the crops inline.
22399
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22400
+ * index and stops reading as soon as `limit` rows have PASSED the
22401
+ * filter. `'suggestionConfidence'` cannot stop early — the most
22402
+ * certain row may be the oldest — so it walks the window. Narrow it
22403
+ * with {@link since} / {@link until}.
22404
+ */
22405
+ sortBy: FaceSortFieldEnum.optional(),
22406
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22407
+ sortDirection: FaceSortDirectionEnum.optional(),
22408
+ /**
22409
+ * Inline the base64 crop on every row.
22410
+ *
22411
+ * Default `false` since the 2026-08-25 inversion — see
22412
+ * `include-crops-default.ts`, which is the ONE place that resolves
22413
+ * this for every gallery, and which records why the inline shape had
22414
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22415
+ * The doc here used to still say `true`; it was wrong, and a leftover
22416
+ * that describes the old design reads as permission to rely on it.
22417
+ *
22418
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22419
+ * which the browser fetches off the `event-media` plane in parallel,
22420
+ * cached and ETagged.
22258
22421
  */
22259
22422
  includeCrops: boolean().optional()
22260
22423
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22290,13 +22453,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22290
22453
  }), method(object({
22291
22454
  threshold: number().min(0).max(1).optional(),
22292
22455
  minClusterSize: number().int().min(2).optional(),
22293
- limit: number().int().positive().optional()
22294
- }).optional(), array(object({
22295
- faceIds: array(string()).readonly(),
22296
- representativeFaceId: string(),
22297
- size: number().int(),
22298
- cohesion: number()
22299
- })).readonly());
22456
+ /**
22457
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22458
+ * which read as though it bounded the work — it never did.
22459
+ *
22460
+ * Wins over {@link limit} when both are sent.
22461
+ */
22462
+ maxClusters: number().int().positive().optional(),
22463
+ /**
22464
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22465
+ * RESULT, not the scan. Kept so existing callers keep working; send
22466
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22467
+ */
22468
+ limit: number().int().positive().optional(),
22469
+ /**
22470
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22471
+ * POOL, not the result.
22472
+ *
22473
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22474
+ * used to read every unassigned face on the hub no matter what the
22475
+ * caller asked for, because the only bound cut the finished clusters
22476
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22477
+ * whole corpus, on an addon whose disk is under contention.
22478
+ *
22479
+ * The pool is the NEWEST matching faces first — the same order the
22480
+ * gallery shows — so a bound here shortens the horizon, it does not
22481
+ * sample it randomly.
22482
+ *
22483
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22484
+ * so the live corpus — 372 face rows — is unaffected while the
22485
+ * unbounded scan can never come back as the table grows.
22486
+ */
22487
+ maxFacesScanned: number().int().positive().optional()
22488
+ }).optional(), array(FaceClusterSchema).readonly());
22300
22489
  /**
22301
22490
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22302
22491
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -25096,6 +25285,39 @@ var ReadGopBytesResultSchema = object({
25096
25285
  /** Media ms the returned fragment covers. */
25097
25286
  gopDurMs: number()
25098
25287
  });
25288
+ /**
25289
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
25290
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
25291
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
25292
+ * a replay needs several seconds of native pixels, not one frame.
25293
+ *
25294
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
25295
+ * is `false` when the returned bytes were cut short by the read's own safety
25296
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
25297
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
25298
+ * degradation: a window whose end falls past the covering segment would need
25299
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
25300
+ * not one standalone-demuxable stream — the caller's answer is to request a
25301
+ * shorter window or one aligned to a single segment, not to receive spliced
25302
+ * bytes nothing has proven decodable.
25303
+ */
25304
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
25305
+ kind: literal("ok"),
25306
+ data: _instanceof(Uint8Array),
25307
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
25308
+ * the requested `fromMs` (anchored on the nearest keyframe). */
25309
+ gopStartMs: number(),
25310
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
25311
+ gopDurMs: number(),
25312
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
25313
+ * the requested `toMs`; the caller got fewer frames than asked for. */
25314
+ reachesRequestedEnd: boolean()
25315
+ }), object({
25316
+ kind: literal("spans-multiple-segments"),
25317
+ /** Where the covering segment's own footage runs out — informational,
25318
+ * not a retry hint (retrying the same window would refuse again). */
25319
+ segmentEndMs: number()
25320
+ })]);
25099
25321
  method(object({
25100
25322
  deviceId: number(),
25101
25323
  fromMs: number(),
@@ -25146,6 +25368,15 @@ method(object({
25146
25368
  }), ReadGopBytesResultSchema, {
25147
25369
  kind: "query",
25148
25370
  auth: "admin"
25371
+ }), method(object({
25372
+ deviceId: number(),
25373
+ profile: string(),
25374
+ startMs: number(),
25375
+ fromMs: number(),
25376
+ toMs: number()
25377
+ }), ReadWindowBytesResultSchema, {
25378
+ kind: "query",
25379
+ auth: "admin"
25149
25380
  }), method(object({
25150
25381
  deviceId: number(),
25151
25382
  config: RecordingConfigSchema
@@ -25977,6 +26208,211 @@ var SetSiteLocationInputSchema = object({
25977
26208
  latitude: number().min(-90).max(90),
25978
26209
  longitude: number().min(-180).max(180)
25979
26210
  }).nullable();
26211
+ /**
26212
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26213
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26214
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26215
+ * already prints - never a token, never an `Authorization` header.
26216
+ */
26217
+ var RequestCensusGroupSchema = object({
26218
+ procedure: string(),
26219
+ userAgent: string(),
26220
+ ip: string(),
26221
+ principal: string(),
26222
+ calls: number(),
26223
+ perMin: number()
26224
+ });
26225
+ /**
26226
+ * A procedure's TOTAL over the window, across every caller.
26227
+ *
26228
+ * This block, not the group list, is what answers "did these calls arrive over
26229
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26230
+ * same window excludes the HTTP plane, which is a result, not a failure.
26231
+ */
26232
+ var RequestCensusProcedureSchema = object({
26233
+ procedure: string(),
26234
+ calls: number(),
26235
+ perMin: number()
26236
+ });
26237
+ /**
26238
+ * The census as an operator sees it.
26239
+ *
26240
+ * `persisted` is the honest answer to "will this survive the restart I am
26241
+ * about to do": the arm deadline is written to `system-settings` so a window
26242
+ * armed now can measure the NEXT boot, and a write that failed must not look
26243
+ * like one that succeeded.
26244
+ */
26245
+ var RequestCensusStatusSchema = object({
26246
+ armed: boolean(),
26247
+ /** How long the current - or just-closed - window collected, in ms. */
26248
+ elapsedMs: number(),
26249
+ /** The window actually armed, after the server clamped the request. */
26250
+ windowMs: number(),
26251
+ /** Epoch ms the window closes at. 0 when disarmed. */
26252
+ armedUntilMs: number(),
26253
+ httpRequests: number(),
26254
+ batchedRequests: number(),
26255
+ /**
26256
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26257
+ * is in play (`?batch=1` carries several procedures in one request); this is
26258
+ * the number comparable with a store-side call count.
26259
+ */
26260
+ procedureCalls: number(),
26261
+ /**
26262
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26263
+ * transport resolves one context per connection - but the number that says
26264
+ * whether a plane this census cannot see was busy while HTTP was quiet.
26265
+ */
26266
+ wsConnections: number(),
26267
+ distinctGroups: number(),
26268
+ /** Calls counted in the totals whose group attribution was shed at the
26269
+ * cardinality bound. */
26270
+ unattributedCalls: number(),
26271
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26272
+ groups: array(RequestCensusGroupSchema).readonly()
26273
+ }).extend({ persisted: boolean() });
26274
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26275
+ var LogLevelSchema$1 = _enum([
26276
+ "debug",
26277
+ "info",
26278
+ "warn",
26279
+ "error"
26280
+ ]);
26281
+ /**
26282
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26283
+ *
26284
+ * A diagnostic is anything whose cost is only worth paying while a question is
26285
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26286
+ */
26287
+ var DiagnosticIdSchema = _enum(["request-census"]);
26288
+ /**
26289
+ * The layers of the level hierarchy, general → specific. The most specific
26290
+ * layer that carries an explicit value wins.
26291
+ *
26292
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26293
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26294
+ * grow later would force every consumer of this document to change with it.
26295
+ * Nothing returns `component` today.
26296
+ */
26297
+ var LoggingScopeKindSchema = _enum([
26298
+ "cluster",
26299
+ "node",
26300
+ "component"
26301
+ ]);
26302
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26303
+ var LoggingLevelSourceSchema = _enum([
26304
+ "default",
26305
+ "cluster",
26306
+ "node",
26307
+ "component"
26308
+ ]);
26309
+ /**
26310
+ * One layer of the hierarchy as it actually STANDS.
26311
+ *
26312
+ * `level: null` is the whole reason this array is returned: it is the
26313
+ * difference between "this node is at `info` because I decided it" and
26314
+ * "...because it inherits". An operator who clears an override believing they
26315
+ * are clearing an inherited value has been handed the same defect as the two
26316
+ * contradicting knobs this document exists to remove, moved one floor up.
26317
+ */
26318
+ var LoggingLevelLayerSchema = object({
26319
+ scope: LoggingScopeKindSchema,
26320
+ /** The node this layer speaks for; `null` on the cluster layer. */
26321
+ nodeId: string().nullable(),
26322
+ /** Explicitly set here, or `null` when this layer inherits. */
26323
+ level: LogLevelSchema$1.nullable()
26324
+ });
26325
+ /** What a line is judged against, and WHICH layer decided it. */
26326
+ var LoggingEffectiveSchema = object({
26327
+ level: LogLevelSchema$1,
26328
+ levelSource: LoggingLevelSourceSchema
26329
+ });
26330
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26331
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26332
+ /**
26333
+ * An armed diagnostic, with its DEADLINE.
26334
+ *
26335
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26336
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26337
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26338
+ * `armed` is false — a window is never reported as slightly expired.
26339
+ */
26340
+ var DiagnosticWindowSchema = object({
26341
+ id: DiagnosticIdSchema,
26342
+ armed: boolean(),
26343
+ /** Epoch ms the window closes at. 0 when disarmed. */
26344
+ armedUntilMs: number(),
26345
+ /** Ms left before it expires on its own. 0 when disarmed. */
26346
+ remainingMs: number(),
26347
+ /** Whether the stored deadline is the one the live diagnostic is running —
26348
+ * i.e. whether this window would survive a restart. */
26349
+ persisted: boolean()
26350
+ });
26351
+ /**
26352
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26353
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26354
+ * is a second knob that disagrees with the first the day one of them moves.
26355
+ */
26356
+ var DiagnosticWindowPatchSchema = object({
26357
+ id: DiagnosticIdSchema,
26358
+ armMs: number().int().min(0),
26359
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26360
+ reportEveryMs: number().int().positive().optional()
26361
+ });
26362
+ /**
26363
+ * A PATCH, and patches MERGE.
26364
+ *
26365
+ * A field absent from the patch is left exactly as it was — arming a
26366
+ * diagnostic never resets a level, and setting a level never disarms a window.
26367
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26368
+ * `setAll` already merges, and rebuilding the object is how an absent field
26369
+ * turns into an erased one.
26370
+ */
26371
+ var LoggingSettingsPatchSchema = object({
26372
+ /**
26373
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26374
+ * addressed scope so it inherits again. A value sets it.
26375
+ */
26376
+ level: LogLevelSchema$1.nullable().optional(),
26377
+ /**
26378
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26379
+ * keeps running — a patch is never a full replacement.
26380
+ */
26381
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26382
+ });
26383
+ /**
26384
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26385
+ *
26386
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26387
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26388
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26389
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26390
+ * by an agent that holds no cluster document at all. The hub is the single
26391
+ * authority over the whole hierarchy and answers for every layer, so the
26392
+ * layer selector needs a name the transport does not already own.
26393
+ */
26394
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26395
+ var SetLoggingSettingsInputSchema = object({
26396
+ scopeNodeId: string().optional(),
26397
+ patch: LoggingSettingsPatchSchema
26398
+ });
26399
+ /**
26400
+ * The whole document, as read and as returned after every write.
26401
+ *
26402
+ * `persisted: false` means the settings store could not be read or written.
26403
+ * The in-memory mirror still governs behaviour and is unchanged by the
26404
+ * failure — a read that fails neither switches a level nor disarms a window
26405
+ * (D49) — but the operator is told that what they are looking at would not
26406
+ * survive a restart.
26407
+ */
26408
+ var LoggingSettingsStateSchema = object({
26409
+ /** The layer this document was read at. `null` = the cluster layer. */
26410
+ scopeNodeId: string().nullable(),
26411
+ effective: LoggingEffectiveSchema,
26412
+ explicit: LoggingExplicitSchema,
26413
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26414
+ persisted: boolean()
26415
+ });
25980
26416
  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(), {
25981
26417
  kind: "mutation",
25982
26418
  auth: "admin"
@@ -25989,6 +26425,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
25989
26425
  }), method(_void(), SiteLocationStatusSchema, {
25990
26426
  kind: "mutation",
25991
26427
  auth: "admin"
26428
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26429
+ kind: "mutation",
26430
+ auth: "admin"
25992
26431
  });
25993
26432
  object({
25994
26433
  /** True when the device's tamper switch / case-open contact is
@@ -29564,6 +30003,12 @@ Object.freeze({
29564
30003
  addonId: null,
29565
30004
  access: "view"
29566
30005
  },
30006
+ "notificationRules.resolveArtifactUrl": {
30007
+ capName: "notification-rules",
30008
+ capScope: "system",
30009
+ addonId: null,
30010
+ access: "view"
30011
+ },
29567
30012
  "notificationRules.setAlarmConfig": {
29568
30013
  capName: "notification-rules",
29569
30014
  capScope: "system",
@@ -30968,6 +31413,12 @@ Object.freeze({
30968
31413
  addonId: null,
30969
31414
  access: "view"
30970
31415
  },
31416
+ "recording.readWindowBytes": {
31417
+ capName: "recording",
31418
+ capScope: "system",
31419
+ addonId: null,
31420
+ access: "view"
31421
+ },
30971
31422
  "recording.refreshStorageLocationsForMigration": {
30972
31423
  capName: "recording",
30973
31424
  capScope: "system",
@@ -31808,6 +32259,18 @@ Object.freeze({
31808
32259
  addonId: null,
31809
32260
  access: "create"
31810
32261
  },
32262
+ "system.getLoggingSettings": {
32263
+ capName: "system",
32264
+ capScope: "system",
32265
+ addonId: null,
32266
+ access: "view"
32267
+ },
32268
+ "system.getRequestCensus": {
32269
+ capName: "system",
32270
+ capScope: "system",
32271
+ addonId: null,
32272
+ access: "view"
32273
+ },
31811
32274
  "system.getRetentionConfig": {
31812
32275
  capName: "system",
31813
32276
  capScope: "system",
@@ -31838,6 +32301,12 @@ Object.freeze({
31838
32301
  addonId: null,
31839
32302
  access: "view"
31840
32303
  },
32304
+ "system.setLoggingSettings": {
32305
+ capName: "system",
32306
+ capScope: "system",
32307
+ addonId: null,
32308
+ access: "create"
32309
+ },
31841
32310
  "system.setRetentionConfig": {
31842
32311
  capName: "system",
31843
32312
  capScope: "system",
@@ -32993,6 +33462,10 @@ Object.freeze({
32993
33462
  name: "deviceId",
32994
33463
  form: "single",
32995
33464
  optional: true
33465
+ }, {
33466
+ name: "deviceIds",
33467
+ form: "array",
33468
+ optional: true
32996
33469
  }],
32997
33470
  "fanControl.setDirection": [{
32998
33471
  name: "deviceId",
@@ -33798,6 +34271,11 @@ Object.freeze({
33798
34271
  form: "single",
33799
34272
  optional: false
33800
34273
  }],
34274
+ "recording.readWindowBytes": [{
34275
+ name: "deviceId",
34276
+ form: "single",
34277
+ optional: false
34278
+ }],
33801
34279
  "recording.relocateFootage": [{
33802
34280
  name: "deviceId",
33803
34281
  form: "single",
@@ -34598,7 +35076,38 @@ object({
34598
35076
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34599
35077
  * reproduce that.
34600
35078
  */
34601
- tileBudgetMb: number().int().min(0).max(1024)
35079
+ tileBudgetMb: number().int().min(0).max(1024),
35080
+ /**
35081
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35082
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35083
+ * subject tiles, on frames that detected something.
35084
+ *
35085
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35086
+ * containment is strict by design, so the native `keyFrame`, the detail
35087
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35088
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35089
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35090
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35091
+ *
35092
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35093
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35094
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35095
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35096
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35097
+ * binds only through a detection burst, where it still covers well past the
35098
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35099
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35100
+ * whole shape exists to avoid.
35101
+ *
35102
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35103
+ * subject tile, so one shared budget would let a busy camera's key frames
35104
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35105
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35106
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35107
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35108
+ * nothing.
35109
+ */
35110
+ sceneBudgetMb: number().int().min(0).max(1024)
34602
35111
  });
34603
35112
  /**
34604
35113
  * The values in force when the operator has set nothing.
@@ -34614,12 +35123,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34614
35123
  budgetMb: 1024,
34615
35124
  activityMs: 15e3,
34616
35125
  tileBudgetMb: 64,
35126
+ sceneBudgetMb: 48,
34617
35127
  admission: "inferred"
34618
35128
  };
34619
35129
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34620
35130
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34621
35131
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34622
35132
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35133
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34623
35134
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34624
35135
  var MB = 1024 * 1024;
34625
35136
  1024 * MB, 3072 * MB;