@camstack/addon-notifiers 1.2.34 → 1.2.36

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 +572 -61
  2. package/dist/addon.mjs +572 -61
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7659,6 +7659,66 @@ var OpsLogQueryInputSchema = object({
7659
7659
  /** Max rows returned, newest-first. */
7660
7660
  limit: number().int().min(1).max(1e3).optional()
7661
7661
  });
7662
+ var LabelDefinitionSchema = object({
7663
+ id: string(),
7664
+ name: string(),
7665
+ category: string().optional(),
7666
+ description: string().optional(),
7667
+ icon: string().optional()
7668
+ });
7669
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7670
+ var CLASS_MAP_MACRO_TARGETS = [
7671
+ "person",
7672
+ "vehicle",
7673
+ "animal",
7674
+ "package"
7675
+ ];
7676
+ /**
7677
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7678
+ * un operatore può selezionare.
7679
+ *
7680
+ * Sono le tre offerte dallo step `object-detection`
7681
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7682
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7683
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7684
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7685
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7686
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7687
+ *
7688
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7689
+ * dello step e una seconda volta come union `FirstLevelMacro`
7690
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7691
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7692
+ * successiva.
7693
+ */
7694
+ var FIRST_LEVEL_MACRO_CLASSES = [
7695
+ "person",
7696
+ "vehicle",
7697
+ "animal"
7698
+ ];
7699
+ /**
7700
+ * Wire schema for a per-model CATALOG classMap override
7701
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7702
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7703
+ * detection pipeline executor actually routes.
7704
+ *
7705
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7706
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7707
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7708
+ * enum) — the two used to share the name `ClassMapDefinition`/
7709
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7710
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7711
+ * are not: it is two different concepts colliding on a name. Keep this type
7712
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7713
+ * would either narrow every `ClassMapDefinition` consumer to the four
7714
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7715
+ * schema exists for (see the "rejects a classMap whose target is not a
7716
+ * detection macro" test in `model-catalog-schema.test.ts`).
7717
+ */
7718
+ var DetectionCatalogClassMapSchema = object({
7719
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7720
+ preserveOriginal: boolean()
7721
+ });
7662
7722
  /**
7663
7723
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7664
7724
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7681,10 +7741,55 @@ var RecordingStorageModeSchema = _enum([
7681
7741
  "events",
7682
7742
  "continuous"
7683
7743
  ]);
7744
+ /**
7745
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7746
+ * tre offerte dallo step `object-detection`, da UNA lista
7747
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7748
+ */
7749
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7750
+ /**
7751
+ * True quando `values` non ripete un elemento.
7752
+ *
7753
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7754
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7755
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7756
+ */
7757
+ var noDuplicates = (values) => new Set(values).size === values.length;
7684
7758
  /** Which detectors trigger an `events`-mode band. */
7685
7759
  var RecordingTriggersSchema = object({
7686
7760
  motion: boolean().optional(),
7687
- audioThresholdDbfs: number().optional()
7761
+ audioThresholdDbfs: number().optional(),
7762
+ /**
7763
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7764
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7765
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7766
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7767
+ *
7768
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7769
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7770
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7771
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7772
+ * finestre — vedi `recorder/object-trigger.ts`.
7773
+ */
7774
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7775
+ /**
7776
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7777
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7778
+ * `objectClasses`.
7779
+ *
7780
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7781
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7782
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7783
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7784
+ * device (D12) — mai un elenco globale di cap.
7785
+ *
7786
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7787
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7788
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7789
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7790
+ * registrare.
7791
+ */
7792
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7688
7793
  });
7689
7794
  /**
7690
7795
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8136,41 +8241,6 @@ var DecoderSessionConfigSchema = object({
8136
8241
  */
8137
8242
  debug: boolean().optional()
8138
8243
  });
8139
- var LabelDefinitionSchema = object({
8140
- id: string(),
8141
- name: string(),
8142
- category: string().optional(),
8143
- description: string().optional(),
8144
- icon: string().optional()
8145
- });
8146
- /**
8147
- * Wire schema for a per-model CATALOG classMap override
8148
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8149
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8150
- * detection pipeline executor actually routes.
8151
- *
8152
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8153
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8154
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8155
- * enum) — the two used to share the name `ClassMapDefinition`/
8156
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8157
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8158
- * are not: it is two different concepts colliding on a name. Keep this type
8159
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8160
- * would either narrow every `ClassMapDefinition` consumer to the four
8161
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8162
- * schema exists for (see the "rejects a classMap whose target is not a
8163
- * detection macro" test in `model-catalog-schema.test.ts`).
8164
- */
8165
- var DetectionCatalogClassMapSchema = object({
8166
- mapping: record(string(), _enum([
8167
- "person",
8168
- "vehicle",
8169
- "animal",
8170
- "package"
8171
- ])),
8172
- preserveOriginal: boolean()
8173
- });
8174
8244
  var MODEL_FORMATS = [
8175
8245
  "onnx",
8176
8246
  "coreml",
@@ -15668,7 +15738,23 @@ var NcHistoryEntrySchema = object({
15668
15738
  updatedAt: number(),
15669
15739
  /** Failure detail — present on a `dead` row. */
15670
15740
  error: string().optional(),
15671
- subject: NcHistorySubjectSchema
15741
+ subject: NcHistorySubjectSchema,
15742
+ /**
15743
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15744
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15745
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15746
+ * every delivery attempt). Absent on a row still pending/dead, a row
15747
+ * delivered before this field shipped, or a wiring with no artefact index.
15748
+ *
15749
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15750
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15751
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15752
+ * also answers `null` for an id whose artefact has since expired past the
15753
+ * retained shelf's own age bound — the degrade a caller (the Home
15754
+ * Assistant export) must render as "no image right now", never as a
15755
+ * broken link.
15756
+ */
15757
+ artifactIds: array(string().min(1)).optional()
15672
15758
  });
15673
15759
  /**
15674
15760
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -15895,7 +15981,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
15895
15981
  }), method(object({}), object({
15896
15982
  catalog: array(NcConditionDescriptorSchema),
15897
15983
  taxonomy: NcTaxonomySchema.optional()
15898
- })), 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 }), {
15984
+ })), 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 }), {
15899
15985
  kind: "mutation",
15900
15986
  caller: "required"
15901
15987
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -20983,7 +21069,7 @@ var lifecycleJobSchema = object({
20983
21069
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
20984
21070
  * as every other cap.
20985
21071
  */
20986
- var LogLevelSchema$1 = _enum([
21072
+ var LogLevelSchema$2 = _enum([
20987
21073
  "debug",
20988
21074
  "info",
20989
21075
  "warn",
@@ -21190,7 +21276,7 @@ var CustomActionInputSchema = object({
21190
21276
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21191
21277
  addonId: string(),
21192
21278
  limit: number().min(1).max(500).default(100),
21193
- level: LogLevelSchema$1.optional()
21279
+ level: LogLevelSchema$2.optional()
21194
21280
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21195
21281
  packageName: string(),
21196
21282
  version: string().optional()
@@ -21288,7 +21374,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21288
21374
  auth: "admin"
21289
21375
  }), method(object({
21290
21376
  addonId: string(),
21291
- level: LogLevelSchema$1.optional()
21377
+ level: LogLevelSchema$2.optional()
21292
21378
  }), LogStreamEntrySchema, { kind: "subscription" });
21293
21379
  object({
21294
21380
  /** Carbon dioxide concentration in ppm. */
@@ -22282,6 +22368,35 @@ var FaceFilterEnum = _enum([
22282
22368
  "identified",
22283
22369
  "all"
22284
22370
  ]);
22371
+ /**
22372
+ * What a `listRecentFaces` page is ORDERED BY.
22373
+ *
22374
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22375
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22376
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22377
+ * order: it puts the suggestions an operator can confirm with one tap at the
22378
+ * top, and it is the reason this enum exists — a client that ranked a capped
22379
+ * page client-side was ranking the newest N, never the most certain N.
22380
+ *
22381
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22382
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22383
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22384
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22385
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22386
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22387
+ * then by faceId, and is what makes this a total order instead of the
22388
+ * backend's NULL-collation accident.
22389
+ */
22390
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22391
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22392
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22393
+ * never leaves the server. */
22394
+ var FaceClusterSchema = object({
22395
+ faceIds: array(string()).readonly(),
22396
+ representativeFaceId: string(),
22397
+ size: number().int(),
22398
+ cohesion: number()
22399
+ });
22285
22400
  var MediaFileLiteSchema$1 = object({
22286
22401
  key: string(),
22287
22402
  kind: string(),
@@ -22328,24 +22443,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22328
22443
  kind: "mutation",
22329
22444
  auth: "admin"
22330
22445
  }), method(object({
22331
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22446
+ /**
22447
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22448
+ *
22449
+ * The legacy single-camera form, kept verbatim for every caller that
22450
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22451
+ * instead — never both: `deviceIds` is the authority whenever it is
22452
+ * present, and this field is then ignored rather than unioned, so
22453
+ * there is exactly one answer to "which cameras did I ask for".
22454
+ */
22332
22455
  deviceId: number().int().optional(),
22456
+ /**
22457
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22458
+ * until now had to fetch the cluster-wide page and drop rows in the
22459
+ * client (so the `limit` it asked for was spent on cameras it was
22460
+ * about to discard).
22461
+ *
22462
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22463
+ * "every camera". A request for no devices is a request, not an
22464
+ * omission; same contract as `deviceManager.listFleet` and
22465
+ * `pipelineAnalytics.listRecentTracks`.
22466
+ *
22467
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22468
+ */
22469
+ deviceIds: array(number().int()).optional(),
22333
22470
  limit: number().int().positive().optional(),
22334
22471
  filter: FaceFilterEnum.optional(),
22335
22472
  /**
22336
- * Inline the base64 crop on every row. Default `true` — the existing
22337
- * behaviour, kept so no caller breaks.
22473
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22474
+ * Absent means no lower bound.
22475
+ */
22476
+ since: number().int().optional(),
22477
+ /**
22478
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22479
+ * Absent means no upper bound.
22480
+ */
22481
+ until: number().int().optional(),
22482
+ /**
22483
+ * Order the page by time or by suggestion certainty. Default
22484
+ * `'timestamp'` — the historical order, unchanged for every caller
22485
+ * that does not ask.
22338
22486
  *
22339
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22340
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22341
- * the browser cache the images.
22487
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22488
+ * does under `'suggestionConfidence'`.
22342
22489
  *
22343
- * **This is an INPUT field, so it does not reach the addon until the
22344
- * next train.** The hub router validates cap inputs against its own
22345
- * compiled Zod, which strips a key it does not know — verified today
22346
- * on the OUTPUT side, where an additive field DOES arrive immediately
22347
- * (`Track.hasFace`). Until the train ships, sending `false` is
22348
- * harmless and simply keeps the crops inline.
22490
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22491
+ * index and stops reading as soon as `limit` rows have PASSED the
22492
+ * filter. `'suggestionConfidence'` cannot stop early — the most
22493
+ * certain row may be the oldest — so it walks the window. Narrow it
22494
+ * with {@link since} / {@link until}.
22495
+ */
22496
+ sortBy: FaceSortFieldEnum.optional(),
22497
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22498
+ sortDirection: FaceSortDirectionEnum.optional(),
22499
+ /**
22500
+ * Inline the base64 crop on every row.
22501
+ *
22502
+ * Default `false` since the 2026-08-25 inversion — see
22503
+ * `include-crops-default.ts`, which is the ONE place that resolves
22504
+ * this for every gallery, and which records why the inline shape had
22505
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22506
+ * The doc here used to still say `true`; it was wrong, and a leftover
22507
+ * that describes the old design reads as permission to rely on it.
22508
+ *
22509
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22510
+ * which the browser fetches off the `event-media` plane in parallel,
22511
+ * cached and ETagged.
22349
22512
  */
22350
22513
  includeCrops: boolean().optional()
22351
22514
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22381,13 +22544,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22381
22544
  }), method(object({
22382
22545
  threshold: number().min(0).max(1).optional(),
22383
22546
  minClusterSize: number().int().min(2).optional(),
22384
- limit: number().int().positive().optional()
22385
- }).optional(), array(object({
22386
- faceIds: array(string()).readonly(),
22387
- representativeFaceId: string(),
22388
- size: number().int(),
22389
- cohesion: number()
22390
- })).readonly());
22547
+ /**
22548
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22549
+ * which read as though it bounded the work — it never did.
22550
+ *
22551
+ * Wins over {@link limit} when both are sent.
22552
+ */
22553
+ maxClusters: number().int().positive().optional(),
22554
+ /**
22555
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22556
+ * RESULT, not the scan. Kept so existing callers keep working; send
22557
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22558
+ */
22559
+ limit: number().int().positive().optional(),
22560
+ /**
22561
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22562
+ * POOL, not the result.
22563
+ *
22564
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22565
+ * used to read every unassigned face on the hub no matter what the
22566
+ * caller asked for, because the only bound cut the finished clusters
22567
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22568
+ * whole corpus, on an addon whose disk is under contention.
22569
+ *
22570
+ * The pool is the NEWEST matching faces first — the same order the
22571
+ * gallery shows — so a bound here shortens the horizon, it does not
22572
+ * sample it randomly.
22573
+ *
22574
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22575
+ * so the live corpus — 372 face rows — is unaffected while the
22576
+ * unbounded scan can never come back as the table grows.
22577
+ */
22578
+ maxFacesScanned: number().int().positive().optional()
22579
+ }).optional(), array(FaceClusterSchema).readonly());
22391
22580
  /**
22392
22581
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22393
22582
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -25187,6 +25376,39 @@ var ReadGopBytesResultSchema = object({
25187
25376
  /** Media ms the returned fragment covers. */
25188
25377
  gopDurMs: number()
25189
25378
  });
25379
+ /**
25380
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
25381
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
25382
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
25383
+ * a replay needs several seconds of native pixels, not one frame.
25384
+ *
25385
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
25386
+ * is `false` when the returned bytes were cut short by the read's own safety
25387
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
25388
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
25389
+ * degradation: a window whose end falls past the covering segment would need
25390
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
25391
+ * not one standalone-demuxable stream — the caller's answer is to request a
25392
+ * shorter window or one aligned to a single segment, not to receive spliced
25393
+ * bytes nothing has proven decodable.
25394
+ */
25395
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
25396
+ kind: literal("ok"),
25397
+ data: _instanceof(Uint8Array),
25398
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
25399
+ * the requested `fromMs` (anchored on the nearest keyframe). */
25400
+ gopStartMs: number(),
25401
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
25402
+ gopDurMs: number(),
25403
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
25404
+ * the requested `toMs`; the caller got fewer frames than asked for. */
25405
+ reachesRequestedEnd: boolean()
25406
+ }), object({
25407
+ kind: literal("spans-multiple-segments"),
25408
+ /** Where the covering segment's own footage runs out — informational,
25409
+ * not a retry hint (retrying the same window would refuse again). */
25410
+ segmentEndMs: number()
25411
+ })]);
25190
25412
  method(object({
25191
25413
  deviceId: number(),
25192
25414
  fromMs: number(),
@@ -25237,6 +25459,15 @@ method(object({
25237
25459
  }), ReadGopBytesResultSchema, {
25238
25460
  kind: "query",
25239
25461
  auth: "admin"
25462
+ }), method(object({
25463
+ deviceId: number(),
25464
+ profile: string(),
25465
+ startMs: number(),
25466
+ fromMs: number(),
25467
+ toMs: number()
25468
+ }), ReadWindowBytesResultSchema, {
25469
+ kind: "query",
25470
+ auth: "admin"
25240
25471
  }), method(object({
25241
25472
  deviceId: number(),
25242
25473
  config: RecordingConfigSchema
@@ -26068,6 +26299,211 @@ var SetSiteLocationInputSchema = object({
26068
26299
  latitude: number().min(-90).max(90),
26069
26300
  longitude: number().min(-180).max(180)
26070
26301
  }).nullable();
26302
+ /**
26303
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26304
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26305
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26306
+ * already prints - never a token, never an `Authorization` header.
26307
+ */
26308
+ var RequestCensusGroupSchema = object({
26309
+ procedure: string(),
26310
+ userAgent: string(),
26311
+ ip: string(),
26312
+ principal: string(),
26313
+ calls: number(),
26314
+ perMin: number()
26315
+ });
26316
+ /**
26317
+ * A procedure's TOTAL over the window, across every caller.
26318
+ *
26319
+ * This block, not the group list, is what answers "did these calls arrive over
26320
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26321
+ * same window excludes the HTTP plane, which is a result, not a failure.
26322
+ */
26323
+ var RequestCensusProcedureSchema = object({
26324
+ procedure: string(),
26325
+ calls: number(),
26326
+ perMin: number()
26327
+ });
26328
+ /**
26329
+ * The census as an operator sees it.
26330
+ *
26331
+ * `persisted` is the honest answer to "will this survive the restart I am
26332
+ * about to do": the arm deadline is written to `system-settings` so a window
26333
+ * armed now can measure the NEXT boot, and a write that failed must not look
26334
+ * like one that succeeded.
26335
+ */
26336
+ var RequestCensusStatusSchema = object({
26337
+ armed: boolean(),
26338
+ /** How long the current - or just-closed - window collected, in ms. */
26339
+ elapsedMs: number(),
26340
+ /** The window actually armed, after the server clamped the request. */
26341
+ windowMs: number(),
26342
+ /** Epoch ms the window closes at. 0 when disarmed. */
26343
+ armedUntilMs: number(),
26344
+ httpRequests: number(),
26345
+ batchedRequests: number(),
26346
+ /**
26347
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26348
+ * is in play (`?batch=1` carries several procedures in one request); this is
26349
+ * the number comparable with a store-side call count.
26350
+ */
26351
+ procedureCalls: number(),
26352
+ /**
26353
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26354
+ * transport resolves one context per connection - but the number that says
26355
+ * whether a plane this census cannot see was busy while HTTP was quiet.
26356
+ */
26357
+ wsConnections: number(),
26358
+ distinctGroups: number(),
26359
+ /** Calls counted in the totals whose group attribution was shed at the
26360
+ * cardinality bound. */
26361
+ unattributedCalls: number(),
26362
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26363
+ groups: array(RequestCensusGroupSchema).readonly()
26364
+ }).extend({ persisted: boolean() });
26365
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26366
+ var LogLevelSchema$1 = _enum([
26367
+ "debug",
26368
+ "info",
26369
+ "warn",
26370
+ "error"
26371
+ ]);
26372
+ /**
26373
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26374
+ *
26375
+ * A diagnostic is anything whose cost is only worth paying while a question is
26376
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26377
+ */
26378
+ var DiagnosticIdSchema = _enum(["request-census"]);
26379
+ /**
26380
+ * The layers of the level hierarchy, general → specific. The most specific
26381
+ * layer that carries an explicit value wins.
26382
+ *
26383
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26384
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26385
+ * grow later would force every consumer of this document to change with it.
26386
+ * Nothing returns `component` today.
26387
+ */
26388
+ var LoggingScopeKindSchema = _enum([
26389
+ "cluster",
26390
+ "node",
26391
+ "component"
26392
+ ]);
26393
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26394
+ var LoggingLevelSourceSchema = _enum([
26395
+ "default",
26396
+ "cluster",
26397
+ "node",
26398
+ "component"
26399
+ ]);
26400
+ /**
26401
+ * One layer of the hierarchy as it actually STANDS.
26402
+ *
26403
+ * `level: null` is the whole reason this array is returned: it is the
26404
+ * difference between "this node is at `info` because I decided it" and
26405
+ * "...because it inherits". An operator who clears an override believing they
26406
+ * are clearing an inherited value has been handed the same defect as the two
26407
+ * contradicting knobs this document exists to remove, moved one floor up.
26408
+ */
26409
+ var LoggingLevelLayerSchema = object({
26410
+ scope: LoggingScopeKindSchema,
26411
+ /** The node this layer speaks for; `null` on the cluster layer. */
26412
+ nodeId: string().nullable(),
26413
+ /** Explicitly set here, or `null` when this layer inherits. */
26414
+ level: LogLevelSchema$1.nullable()
26415
+ });
26416
+ /** What a line is judged against, and WHICH layer decided it. */
26417
+ var LoggingEffectiveSchema = object({
26418
+ level: LogLevelSchema$1,
26419
+ levelSource: LoggingLevelSourceSchema
26420
+ });
26421
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26422
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26423
+ /**
26424
+ * An armed diagnostic, with its DEADLINE.
26425
+ *
26426
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26427
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26428
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26429
+ * `armed` is false — a window is never reported as slightly expired.
26430
+ */
26431
+ var DiagnosticWindowSchema = object({
26432
+ id: DiagnosticIdSchema,
26433
+ armed: boolean(),
26434
+ /** Epoch ms the window closes at. 0 when disarmed. */
26435
+ armedUntilMs: number(),
26436
+ /** Ms left before it expires on its own. 0 when disarmed. */
26437
+ remainingMs: number(),
26438
+ /** Whether the stored deadline is the one the live diagnostic is running —
26439
+ * i.e. whether this window would survive a restart. */
26440
+ persisted: boolean()
26441
+ });
26442
+ /**
26443
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26444
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26445
+ * is a second knob that disagrees with the first the day one of them moves.
26446
+ */
26447
+ var DiagnosticWindowPatchSchema = object({
26448
+ id: DiagnosticIdSchema,
26449
+ armMs: number().int().min(0),
26450
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26451
+ reportEveryMs: number().int().positive().optional()
26452
+ });
26453
+ /**
26454
+ * A PATCH, and patches MERGE.
26455
+ *
26456
+ * A field absent from the patch is left exactly as it was — arming a
26457
+ * diagnostic never resets a level, and setting a level never disarms a window.
26458
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26459
+ * `setAll` already merges, and rebuilding the object is how an absent field
26460
+ * turns into an erased one.
26461
+ */
26462
+ var LoggingSettingsPatchSchema = object({
26463
+ /**
26464
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26465
+ * addressed scope so it inherits again. A value sets it.
26466
+ */
26467
+ level: LogLevelSchema$1.nullable().optional(),
26468
+ /**
26469
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26470
+ * keeps running — a patch is never a full replacement.
26471
+ */
26472
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26473
+ });
26474
+ /**
26475
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26476
+ *
26477
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26478
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26479
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26480
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26481
+ * by an agent that holds no cluster document at all. The hub is the single
26482
+ * authority over the whole hierarchy and answers for every layer, so the
26483
+ * layer selector needs a name the transport does not already own.
26484
+ */
26485
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26486
+ var SetLoggingSettingsInputSchema = object({
26487
+ scopeNodeId: string().optional(),
26488
+ patch: LoggingSettingsPatchSchema
26489
+ });
26490
+ /**
26491
+ * The whole document, as read and as returned after every write.
26492
+ *
26493
+ * `persisted: false` means the settings store could not be read or written.
26494
+ * The in-memory mirror still governs behaviour and is unchanged by the
26495
+ * failure — a read that fails neither switches a level nor disarms a window
26496
+ * (D49) — but the operator is told that what they are looking at would not
26497
+ * survive a restart.
26498
+ */
26499
+ var LoggingSettingsStateSchema = object({
26500
+ /** The layer this document was read at. `null` = the cluster layer. */
26501
+ scopeNodeId: string().nullable(),
26502
+ effective: LoggingEffectiveSchema,
26503
+ explicit: LoggingExplicitSchema,
26504
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26505
+ persisted: boolean()
26506
+ });
26071
26507
  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(), {
26072
26508
  kind: "mutation",
26073
26509
  auth: "admin"
@@ -26080,6 +26516,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26080
26516
  }), method(_void(), SiteLocationStatusSchema, {
26081
26517
  kind: "mutation",
26082
26518
  auth: "admin"
26519
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26520
+ kind: "mutation",
26521
+ auth: "admin"
26083
26522
  });
26084
26523
  object({
26085
26524
  /** True when the device's tamper switch / case-open contact is
@@ -29655,6 +30094,12 @@ Object.freeze({
29655
30094
  addonId: null,
29656
30095
  access: "view"
29657
30096
  },
30097
+ "notificationRules.resolveArtifactUrl": {
30098
+ capName: "notification-rules",
30099
+ capScope: "system",
30100
+ addonId: null,
30101
+ access: "view"
30102
+ },
29658
30103
  "notificationRules.setAlarmConfig": {
29659
30104
  capName: "notification-rules",
29660
30105
  capScope: "system",
@@ -31059,6 +31504,12 @@ Object.freeze({
31059
31504
  addonId: null,
31060
31505
  access: "view"
31061
31506
  },
31507
+ "recording.readWindowBytes": {
31508
+ capName: "recording",
31509
+ capScope: "system",
31510
+ addonId: null,
31511
+ access: "view"
31512
+ },
31062
31513
  "recording.refreshStorageLocationsForMigration": {
31063
31514
  capName: "recording",
31064
31515
  capScope: "system",
@@ -31899,6 +32350,18 @@ Object.freeze({
31899
32350
  addonId: null,
31900
32351
  access: "create"
31901
32352
  },
32353
+ "system.getLoggingSettings": {
32354
+ capName: "system",
32355
+ capScope: "system",
32356
+ addonId: null,
32357
+ access: "view"
32358
+ },
32359
+ "system.getRequestCensus": {
32360
+ capName: "system",
32361
+ capScope: "system",
32362
+ addonId: null,
32363
+ access: "view"
32364
+ },
31902
32365
  "system.getRetentionConfig": {
31903
32366
  capName: "system",
31904
32367
  capScope: "system",
@@ -31929,6 +32392,12 @@ Object.freeze({
31929
32392
  addonId: null,
31930
32393
  access: "view"
31931
32394
  },
32395
+ "system.setLoggingSettings": {
32396
+ capName: "system",
32397
+ capScope: "system",
32398
+ addonId: null,
32399
+ access: "create"
32400
+ },
31932
32401
  "system.setRetentionConfig": {
31933
32402
  capName: "system",
31934
32403
  capScope: "system",
@@ -33084,6 +33553,10 @@ Object.freeze({
33084
33553
  name: "deviceId",
33085
33554
  form: "single",
33086
33555
  optional: true
33556
+ }, {
33557
+ name: "deviceIds",
33558
+ form: "array",
33559
+ optional: true
33087
33560
  }],
33088
33561
  "fanControl.setDirection": [{
33089
33562
  name: "deviceId",
@@ -33889,6 +34362,11 @@ Object.freeze({
33889
34362
  form: "single",
33890
34363
  optional: false
33891
34364
  }],
34365
+ "recording.readWindowBytes": [{
34366
+ name: "deviceId",
34367
+ form: "single",
34368
+ optional: false
34369
+ }],
33892
34370
  "recording.relocateFootage": [{
33893
34371
  name: "deviceId",
33894
34372
  form: "single",
@@ -34896,7 +35374,38 @@ object({
34896
35374
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34897
35375
  * reproduce that.
34898
35376
  */
34899
- tileBudgetMb: number().int().min(0).max(1024)
35377
+ tileBudgetMb: number().int().min(0).max(1024),
35378
+ /**
35379
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35380
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35381
+ * subject tiles, on frames that detected something.
35382
+ *
35383
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35384
+ * containment is strict by design, so the native `keyFrame`, the detail
35385
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35386
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35387
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35388
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35389
+ *
35390
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35391
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35392
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35393
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35394
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35395
+ * binds only through a detection burst, where it still covers well past the
35396
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35397
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35398
+ * whole shape exists to avoid.
35399
+ *
35400
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35401
+ * subject tile, so one shared budget would let a busy camera's key frames
35402
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35403
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35404
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35405
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35406
+ * nothing.
35407
+ */
35408
+ sceneBudgetMb: number().int().min(0).max(1024)
34900
35409
  });
34901
35410
  /**
34902
35411
  * The values in force when the operator has set nothing.
@@ -34912,12 +35421,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34912
35421
  budgetMb: 1024,
34913
35422
  activityMs: 15e3,
34914
35423
  tileBudgetMb: 64,
35424
+ sceneBudgetMb: 48,
34915
35425
  admission: "inferred"
34916
35426
  };
34917
35427
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34918
35428
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34919
35429
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34920
35430
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35431
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34921
35432
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34922
35433
  var MB = 1024 * 1024;
34923
35434
  1024 * MB, 3072 * MB;