@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.mjs CHANGED
@@ -7632,6 +7632,66 @@ var OpsLogQueryInputSchema = object({
7632
7632
  /** Max rows returned, newest-first. */
7633
7633
  limit: number().int().min(1).max(1e3).optional()
7634
7634
  });
7635
+ var LabelDefinitionSchema = object({
7636
+ id: string(),
7637
+ name: string(),
7638
+ category: string().optional(),
7639
+ description: string().optional(),
7640
+ icon: string().optional()
7641
+ });
7642
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7643
+ var CLASS_MAP_MACRO_TARGETS = [
7644
+ "person",
7645
+ "vehicle",
7646
+ "animal",
7647
+ "package"
7648
+ ];
7649
+ /**
7650
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7651
+ * un operatore può selezionare.
7652
+ *
7653
+ * Sono le tre offerte dallo step `object-detection`
7654
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7655
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7656
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7657
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7658
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7659
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7660
+ *
7661
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7662
+ * dello step e una seconda volta come union `FirstLevelMacro`
7663
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7664
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7665
+ * successiva.
7666
+ */
7667
+ var FIRST_LEVEL_MACRO_CLASSES = [
7668
+ "person",
7669
+ "vehicle",
7670
+ "animal"
7671
+ ];
7672
+ /**
7673
+ * Wire schema for a per-model CATALOG classMap override
7674
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7675
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7676
+ * detection pipeline executor actually routes.
7677
+ *
7678
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7679
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7680
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7681
+ * enum) — the two used to share the name `ClassMapDefinition`/
7682
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7683
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7684
+ * are not: it is two different concepts colliding on a name. Keep this type
7685
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7686
+ * would either narrow every `ClassMapDefinition` consumer to the four
7687
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7688
+ * schema exists for (see the "rejects a classMap whose target is not a
7689
+ * detection macro" test in `model-catalog-schema.test.ts`).
7690
+ */
7691
+ var DetectionCatalogClassMapSchema = object({
7692
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7693
+ preserveOriginal: boolean()
7694
+ });
7635
7695
  /**
7636
7696
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7637
7697
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7654,10 +7714,55 @@ var RecordingStorageModeSchema = _enum([
7654
7714
  "events",
7655
7715
  "continuous"
7656
7716
  ]);
7717
+ /**
7718
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7719
+ * tre offerte dallo step `object-detection`, da UNA lista
7720
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7721
+ */
7722
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7723
+ /**
7724
+ * True quando `values` non ripete un elemento.
7725
+ *
7726
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7727
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7728
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7729
+ */
7730
+ var noDuplicates = (values) => new Set(values).size === values.length;
7657
7731
  /** Which detectors trigger an `events`-mode band. */
7658
7732
  var RecordingTriggersSchema = object({
7659
7733
  motion: boolean().optional(),
7660
- audioThresholdDbfs: number().optional()
7734
+ audioThresholdDbfs: number().optional(),
7735
+ /**
7736
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7737
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7738
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7739
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7740
+ *
7741
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7742
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7743
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7744
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7745
+ * finestre — vedi `recorder/object-trigger.ts`.
7746
+ */
7747
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7748
+ /**
7749
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7750
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7751
+ * `objectClasses`.
7752
+ *
7753
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7754
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7755
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7756
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7757
+ * device (D12) — mai un elenco globale di cap.
7758
+ *
7759
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7760
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7761
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7762
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7763
+ * registrare.
7764
+ */
7765
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7661
7766
  });
7662
7767
  /**
7663
7768
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8109,41 +8214,6 @@ var DecoderSessionConfigSchema = object({
8109
8214
  */
8110
8215
  debug: boolean().optional()
8111
8216
  });
8112
- var LabelDefinitionSchema = object({
8113
- id: string(),
8114
- name: string(),
8115
- category: string().optional(),
8116
- description: string().optional(),
8117
- icon: string().optional()
8118
- });
8119
- /**
8120
- * Wire schema for a per-model CATALOG classMap override
8121
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8122
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8123
- * detection pipeline executor actually routes.
8124
- *
8125
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8126
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8127
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8128
- * enum) — the two used to share the name `ClassMapDefinition`/
8129
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8130
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8131
- * are not: it is two different concepts colliding on a name. Keep this type
8132
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8133
- * would either narrow every `ClassMapDefinition` consumer to the four
8134
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8135
- * schema exists for (see the "rejects a classMap whose target is not a
8136
- * detection macro" test in `model-catalog-schema.test.ts`).
8137
- */
8138
- var DetectionCatalogClassMapSchema = object({
8139
- mapping: record(string(), _enum([
8140
- "person",
8141
- "vehicle",
8142
- "animal",
8143
- "package"
8144
- ])),
8145
- preserveOriginal: boolean()
8146
- });
8147
8217
  var MODEL_FORMATS = [
8148
8218
  "onnx",
8149
8219
  "coreml",
@@ -15641,7 +15711,23 @@ var NcHistoryEntrySchema = object({
15641
15711
  updatedAt: number(),
15642
15712
  /** Failure detail — present on a `dead` row. */
15643
15713
  error: string().optional(),
15644
- subject: NcHistorySubjectSchema
15714
+ subject: NcHistorySubjectSchema,
15715
+ /**
15716
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15717
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15718
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15719
+ * every delivery attempt). Absent on a row still pending/dead, a row
15720
+ * delivered before this field shipped, or a wiring with no artefact index.
15721
+ *
15722
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15723
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15724
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15725
+ * also answers `null` for an id whose artefact has since expired past the
15726
+ * retained shelf's own age bound — the degrade a caller (the Home
15727
+ * Assistant export) must render as "no image right now", never as a
15728
+ * broken link.
15729
+ */
15730
+ artifactIds: array(string().min(1)).optional()
15645
15731
  });
15646
15732
  /**
15647
15733
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -15868,7 +15954,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
15868
15954
  }), method(object({}), object({
15869
15955
  catalog: array(NcConditionDescriptorSchema),
15870
15956
  taxonomy: NcTaxonomySchema.optional()
15871
- })), 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 }), {
15957
+ })), 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 }), {
15872
15958
  kind: "mutation",
15873
15959
  caller: "required"
15874
15960
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -20956,7 +21042,7 @@ var lifecycleJobSchema = object({
20956
21042
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
20957
21043
  * as every other cap.
20958
21044
  */
20959
- var LogLevelSchema$1 = _enum([
21045
+ var LogLevelSchema$2 = _enum([
20960
21046
  "debug",
20961
21047
  "info",
20962
21048
  "warn",
@@ -21163,7 +21249,7 @@ var CustomActionInputSchema = object({
21163
21249
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21164
21250
  addonId: string(),
21165
21251
  limit: number().min(1).max(500).default(100),
21166
- level: LogLevelSchema$1.optional()
21252
+ level: LogLevelSchema$2.optional()
21167
21253
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21168
21254
  packageName: string(),
21169
21255
  version: string().optional()
@@ -21261,7 +21347,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21261
21347
  auth: "admin"
21262
21348
  }), method(object({
21263
21349
  addonId: string(),
21264
- level: LogLevelSchema$1.optional()
21350
+ level: LogLevelSchema$2.optional()
21265
21351
  }), LogStreamEntrySchema, { kind: "subscription" });
21266
21352
  object({
21267
21353
  /** Carbon dioxide concentration in ppm. */
@@ -22255,6 +22341,35 @@ var FaceFilterEnum = _enum([
22255
22341
  "identified",
22256
22342
  "all"
22257
22343
  ]);
22344
+ /**
22345
+ * What a `listRecentFaces` page is ORDERED BY.
22346
+ *
22347
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22348
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22349
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22350
+ * order: it puts the suggestions an operator can confirm with one tap at the
22351
+ * top, and it is the reason this enum exists — a client that ranked a capped
22352
+ * page client-side was ranking the newest N, never the most certain N.
22353
+ *
22354
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22355
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22356
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22357
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22358
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22359
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22360
+ * then by faceId, and is what makes this a total order instead of the
22361
+ * backend's NULL-collation accident.
22362
+ */
22363
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22364
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22365
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22366
+ * never leaves the server. */
22367
+ var FaceClusterSchema = object({
22368
+ faceIds: array(string()).readonly(),
22369
+ representativeFaceId: string(),
22370
+ size: number().int(),
22371
+ cohesion: number()
22372
+ });
22258
22373
  var MediaFileLiteSchema$1 = object({
22259
22374
  key: string(),
22260
22375
  kind: string(),
@@ -22301,24 +22416,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22301
22416
  kind: "mutation",
22302
22417
  auth: "admin"
22303
22418
  }), method(object({
22304
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22419
+ /**
22420
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22421
+ *
22422
+ * The legacy single-camera form, kept verbatim for every caller that
22423
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22424
+ * instead — never both: `deviceIds` is the authority whenever it is
22425
+ * present, and this field is then ignored rather than unioned, so
22426
+ * there is exactly one answer to "which cameras did I ask for".
22427
+ */
22305
22428
  deviceId: number().int().optional(),
22429
+ /**
22430
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22431
+ * until now had to fetch the cluster-wide page and drop rows in the
22432
+ * client (so the `limit` it asked for was spent on cameras it was
22433
+ * about to discard).
22434
+ *
22435
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22436
+ * "every camera". A request for no devices is a request, not an
22437
+ * omission; same contract as `deviceManager.listFleet` and
22438
+ * `pipelineAnalytics.listRecentTracks`.
22439
+ *
22440
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22441
+ */
22442
+ deviceIds: array(number().int()).optional(),
22306
22443
  limit: number().int().positive().optional(),
22307
22444
  filter: FaceFilterEnum.optional(),
22308
22445
  /**
22309
- * Inline the base64 crop on every row. Default `true` — the existing
22310
- * behaviour, kept so no caller breaks.
22446
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22447
+ * Absent means no lower bound.
22448
+ */
22449
+ since: number().int().optional(),
22450
+ /**
22451
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22452
+ * Absent means no upper bound.
22453
+ */
22454
+ until: number().int().optional(),
22455
+ /**
22456
+ * Order the page by time or by suggestion certainty. Default
22457
+ * `'timestamp'` — the historical order, unchanged for every caller
22458
+ * that does not ask.
22311
22459
  *
22312
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22313
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22314
- * the browser cache the images.
22460
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
22461
+ * does under `'suggestionConfidence'`.
22315
22462
  *
22316
- * **This is an INPUT field, so it does not reach the addon until the
22317
- * next train.** The hub router validates cap inputs against its own
22318
- * compiled Zod, which strips a key it does not know — verified today
22319
- * on the OUTPUT side, where an additive field DOES arrive immediately
22320
- * (`Track.hasFace`). Until the train ships, sending `false` is
22321
- * harmless and simply keeps the crops inline.
22463
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
22464
+ * index and stops reading as soon as `limit` rows have PASSED the
22465
+ * filter. `'suggestionConfidence'` cannot stop early — the most
22466
+ * certain row may be the oldest — so it walks the window. Narrow it
22467
+ * with {@link since} / {@link until}.
22468
+ */
22469
+ sortBy: FaceSortFieldEnum.optional(),
22470
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
22471
+ sortDirection: FaceSortDirectionEnum.optional(),
22472
+ /**
22473
+ * Inline the base64 crop on every row.
22474
+ *
22475
+ * Default `false` since the 2026-08-25 inversion — see
22476
+ * `include-crops-default.ts`, which is the ONE place that resolves
22477
+ * this for every gallery, and which records why the inline shape had
22478
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
22479
+ * The doc here used to still say `true`; it was wrong, and a leftover
22480
+ * that describes the old design reads as permission to rely on it.
22481
+ *
22482
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
22483
+ * which the browser fetches off the `event-media` plane in parallel,
22484
+ * cached and ETagged.
22322
22485
  */
22323
22486
  includeCrops: boolean().optional()
22324
22487
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22354,13 +22517,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22354
22517
  }), method(object({
22355
22518
  threshold: number().min(0).max(1).optional(),
22356
22519
  minClusterSize: number().int().min(2).optional(),
22357
- limit: number().int().positive().optional()
22358
- }).optional(), array(object({
22359
- faceIds: array(string()).readonly(),
22360
- representativeFaceId: string(),
22361
- size: number().int(),
22362
- cohesion: number()
22363
- })).readonly());
22520
+ /**
22521
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
22522
+ * which read as though it bounded the work — it never did.
22523
+ *
22524
+ * Wins over {@link limit} when both are sent.
22525
+ */
22526
+ maxClusters: number().int().positive().optional(),
22527
+ /**
22528
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
22529
+ * RESULT, not the scan. Kept so existing callers keep working; send
22530
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
22531
+ */
22532
+ limit: number().int().positive().optional(),
22533
+ /**
22534
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
22535
+ * POOL, not the result.
22536
+ *
22537
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
22538
+ * used to read every unassigned face on the hub no matter what the
22539
+ * caller asked for, because the only bound cut the finished clusters
22540
+ * afterwards; a UI showing a window of 100 paid for a scan of the
22541
+ * whole corpus, on an addon whose disk is under contention.
22542
+ *
22543
+ * The pool is the NEWEST matching faces first — the same order the
22544
+ * gallery shows — so a bound here shortens the horizon, it does not
22545
+ * sample it randomly.
22546
+ *
22547
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
22548
+ * so the live corpus — 372 face rows — is unaffected while the
22549
+ * unbounded scan can never come back as the table grows.
22550
+ */
22551
+ maxFacesScanned: number().int().positive().optional()
22552
+ }).optional(), array(FaceClusterSchema).readonly());
22364
22553
  /**
22365
22554
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22366
22555
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -25160,6 +25349,39 @@ var ReadGopBytesResultSchema = object({
25160
25349
  /** Media ms the returned fragment covers. */
25161
25350
  gopDurMs: number()
25162
25351
  });
25352
+ /**
25353
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
25354
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
25355
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
25356
+ * a replay needs several seconds of native pixels, not one frame.
25357
+ *
25358
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
25359
+ * is `false` when the returned bytes were cut short by the read's own safety
25360
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
25361
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
25362
+ * degradation: a window whose end falls past the covering segment would need
25363
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
25364
+ * not one standalone-demuxable stream — the caller's answer is to request a
25365
+ * shorter window or one aligned to a single segment, not to receive spliced
25366
+ * bytes nothing has proven decodable.
25367
+ */
25368
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
25369
+ kind: literal("ok"),
25370
+ data: _instanceof(Uint8Array),
25371
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
25372
+ * the requested `fromMs` (anchored on the nearest keyframe). */
25373
+ gopStartMs: number(),
25374
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
25375
+ gopDurMs: number(),
25376
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
25377
+ * the requested `toMs`; the caller got fewer frames than asked for. */
25378
+ reachesRequestedEnd: boolean()
25379
+ }), object({
25380
+ kind: literal("spans-multiple-segments"),
25381
+ /** Where the covering segment's own footage runs out — informational,
25382
+ * not a retry hint (retrying the same window would refuse again). */
25383
+ segmentEndMs: number()
25384
+ })]);
25163
25385
  method(object({
25164
25386
  deviceId: number(),
25165
25387
  fromMs: number(),
@@ -25210,6 +25432,15 @@ method(object({
25210
25432
  }), ReadGopBytesResultSchema, {
25211
25433
  kind: "query",
25212
25434
  auth: "admin"
25435
+ }), method(object({
25436
+ deviceId: number(),
25437
+ profile: string(),
25438
+ startMs: number(),
25439
+ fromMs: number(),
25440
+ toMs: number()
25441
+ }), ReadWindowBytesResultSchema, {
25442
+ kind: "query",
25443
+ auth: "admin"
25213
25444
  }), method(object({
25214
25445
  deviceId: number(),
25215
25446
  config: RecordingConfigSchema
@@ -26041,6 +26272,211 @@ var SetSiteLocationInputSchema = object({
26041
26272
  latitude: number().min(-90).max(90),
26042
26273
  longitude: number().min(-180).max(180)
26043
26274
  }).nullable();
26275
+ /**
26276
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26277
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26278
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26279
+ * already prints - never a token, never an `Authorization` header.
26280
+ */
26281
+ var RequestCensusGroupSchema = object({
26282
+ procedure: string(),
26283
+ userAgent: string(),
26284
+ ip: string(),
26285
+ principal: string(),
26286
+ calls: number(),
26287
+ perMin: number()
26288
+ });
26289
+ /**
26290
+ * A procedure's TOTAL over the window, across every caller.
26291
+ *
26292
+ * This block, not the group list, is what answers "did these calls arrive over
26293
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26294
+ * same window excludes the HTTP plane, which is a result, not a failure.
26295
+ */
26296
+ var RequestCensusProcedureSchema = object({
26297
+ procedure: string(),
26298
+ calls: number(),
26299
+ perMin: number()
26300
+ });
26301
+ /**
26302
+ * The census as an operator sees it.
26303
+ *
26304
+ * `persisted` is the honest answer to "will this survive the restart I am
26305
+ * about to do": the arm deadline is written to `system-settings` so a window
26306
+ * armed now can measure the NEXT boot, and a write that failed must not look
26307
+ * like one that succeeded.
26308
+ */
26309
+ var RequestCensusStatusSchema = object({
26310
+ armed: boolean(),
26311
+ /** How long the current - or just-closed - window collected, in ms. */
26312
+ elapsedMs: number(),
26313
+ /** The window actually armed, after the server clamped the request. */
26314
+ windowMs: number(),
26315
+ /** Epoch ms the window closes at. 0 when disarmed. */
26316
+ armedUntilMs: number(),
26317
+ httpRequests: number(),
26318
+ batchedRequests: number(),
26319
+ /**
26320
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26321
+ * is in play (`?batch=1` carries several procedures in one request); this is
26322
+ * the number comparable with a store-side call count.
26323
+ */
26324
+ procedureCalls: number(),
26325
+ /**
26326
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26327
+ * transport resolves one context per connection - but the number that says
26328
+ * whether a plane this census cannot see was busy while HTTP was quiet.
26329
+ */
26330
+ wsConnections: number(),
26331
+ distinctGroups: number(),
26332
+ /** Calls counted in the totals whose group attribution was shed at the
26333
+ * cardinality bound. */
26334
+ unattributedCalls: number(),
26335
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26336
+ groups: array(RequestCensusGroupSchema).readonly()
26337
+ }).extend({ persisted: boolean() });
26338
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26339
+ var LogLevelSchema$1 = _enum([
26340
+ "debug",
26341
+ "info",
26342
+ "warn",
26343
+ "error"
26344
+ ]);
26345
+ /**
26346
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26347
+ *
26348
+ * A diagnostic is anything whose cost is only worth paying while a question is
26349
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26350
+ */
26351
+ var DiagnosticIdSchema = _enum(["request-census"]);
26352
+ /**
26353
+ * The layers of the level hierarchy, general → specific. The most specific
26354
+ * layer that carries an explicit value wins.
26355
+ *
26356
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26357
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26358
+ * grow later would force every consumer of this document to change with it.
26359
+ * Nothing returns `component` today.
26360
+ */
26361
+ var LoggingScopeKindSchema = _enum([
26362
+ "cluster",
26363
+ "node",
26364
+ "component"
26365
+ ]);
26366
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26367
+ var LoggingLevelSourceSchema = _enum([
26368
+ "default",
26369
+ "cluster",
26370
+ "node",
26371
+ "component"
26372
+ ]);
26373
+ /**
26374
+ * One layer of the hierarchy as it actually STANDS.
26375
+ *
26376
+ * `level: null` is the whole reason this array is returned: it is the
26377
+ * difference between "this node is at `info` because I decided it" and
26378
+ * "...because it inherits". An operator who clears an override believing they
26379
+ * are clearing an inherited value has been handed the same defect as the two
26380
+ * contradicting knobs this document exists to remove, moved one floor up.
26381
+ */
26382
+ var LoggingLevelLayerSchema = object({
26383
+ scope: LoggingScopeKindSchema,
26384
+ /** The node this layer speaks for; `null` on the cluster layer. */
26385
+ nodeId: string().nullable(),
26386
+ /** Explicitly set here, or `null` when this layer inherits. */
26387
+ level: LogLevelSchema$1.nullable()
26388
+ });
26389
+ /** What a line is judged against, and WHICH layer decided it. */
26390
+ var LoggingEffectiveSchema = object({
26391
+ level: LogLevelSchema$1,
26392
+ levelSource: LoggingLevelSourceSchema
26393
+ });
26394
+ /** Every layer, general → specific. Never collapsed into the effective value. */
26395
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
26396
+ /**
26397
+ * An armed diagnostic, with its DEADLINE.
26398
+ *
26399
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
26400
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
26401
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
26402
+ * `armed` is false — a window is never reported as slightly expired.
26403
+ */
26404
+ var DiagnosticWindowSchema = object({
26405
+ id: DiagnosticIdSchema,
26406
+ armed: boolean(),
26407
+ /** Epoch ms the window closes at. 0 when disarmed. */
26408
+ armedUntilMs: number(),
26409
+ /** Ms left before it expires on its own. 0 when disarmed. */
26410
+ remainingMs: number(),
26411
+ /** Whether the stored deadline is the one the live diagnostic is running —
26412
+ * i.e. whether this window would survive a restart. */
26413
+ persisted: boolean()
26414
+ });
26415
+ /**
26416
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
26417
+ * server — there is no maximum here on purpose: a bound repeated in a schema
26418
+ * is a second knob that disagrees with the first the day one of them moves.
26419
+ */
26420
+ var DiagnosticWindowPatchSchema = object({
26421
+ id: DiagnosticIdSchema,
26422
+ armMs: number().int().min(0),
26423
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
26424
+ reportEveryMs: number().int().positive().optional()
26425
+ });
26426
+ /**
26427
+ * A PATCH, and patches MERGE.
26428
+ *
26429
+ * A field absent from the patch is left exactly as it was — arming a
26430
+ * diagnostic never resets a level, and setting a level never disarms a window.
26431
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
26432
+ * `setAll` already merges, and rebuilding the object is how an absent field
26433
+ * turns into an erased one.
26434
+ */
26435
+ var LoggingSettingsPatchSchema = object({
26436
+ /**
26437
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
26438
+ * addressed scope so it inherits again. A value sets it.
26439
+ */
26440
+ level: LogLevelSchema$1.nullable().optional(),
26441
+ /**
26442
+ * Only the diagnostics NAMED here change. An armed window that is not listed
26443
+ * keeps running — a patch is never a full replacement.
26444
+ */
26445
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26446
+ });
26447
+ /**
26448
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
26449
+ *
26450
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
26451
+ * input — the generated router strips it and uses it to resolve the PROVIDER
26452
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
26453
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
26454
+ * by an agent that holds no cluster document at all. The hub is the single
26455
+ * authority over the whole hierarchy and answers for every layer, so the
26456
+ * layer selector needs a name the transport does not already own.
26457
+ */
26458
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26459
+ var SetLoggingSettingsInputSchema = object({
26460
+ scopeNodeId: string().optional(),
26461
+ patch: LoggingSettingsPatchSchema
26462
+ });
26463
+ /**
26464
+ * The whole document, as read and as returned after every write.
26465
+ *
26466
+ * `persisted: false` means the settings store could not be read or written.
26467
+ * The in-memory mirror still governs behaviour and is unchanged by the
26468
+ * failure — a read that fails neither switches a level nor disarms a window
26469
+ * (D49) — but the operator is told that what they are looking at would not
26470
+ * survive a restart.
26471
+ */
26472
+ var LoggingSettingsStateSchema = object({
26473
+ /** The layer this document was read at. `null` = the cluster layer. */
26474
+ scopeNodeId: string().nullable(),
26475
+ effective: LoggingEffectiveSchema,
26476
+ explicit: LoggingExplicitSchema,
26477
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
26478
+ persisted: boolean()
26479
+ });
26044
26480
  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(), {
26045
26481
  kind: "mutation",
26046
26482
  auth: "admin"
@@ -26053,6 +26489,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26053
26489
  }), method(_void(), SiteLocationStatusSchema, {
26054
26490
  kind: "mutation",
26055
26491
  auth: "admin"
26492
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26493
+ kind: "mutation",
26494
+ auth: "admin"
26056
26495
  });
26057
26496
  object({
26058
26497
  /** True when the device's tamper switch / case-open contact is
@@ -29628,6 +30067,12 @@ Object.freeze({
29628
30067
  addonId: null,
29629
30068
  access: "view"
29630
30069
  },
30070
+ "notificationRules.resolveArtifactUrl": {
30071
+ capName: "notification-rules",
30072
+ capScope: "system",
30073
+ addonId: null,
30074
+ access: "view"
30075
+ },
29631
30076
  "notificationRules.setAlarmConfig": {
29632
30077
  capName: "notification-rules",
29633
30078
  capScope: "system",
@@ -31032,6 +31477,12 @@ Object.freeze({
31032
31477
  addonId: null,
31033
31478
  access: "view"
31034
31479
  },
31480
+ "recording.readWindowBytes": {
31481
+ capName: "recording",
31482
+ capScope: "system",
31483
+ addonId: null,
31484
+ access: "view"
31485
+ },
31035
31486
  "recording.refreshStorageLocationsForMigration": {
31036
31487
  capName: "recording",
31037
31488
  capScope: "system",
@@ -31872,6 +32323,18 @@ Object.freeze({
31872
32323
  addonId: null,
31873
32324
  access: "create"
31874
32325
  },
32326
+ "system.getLoggingSettings": {
32327
+ capName: "system",
32328
+ capScope: "system",
32329
+ addonId: null,
32330
+ access: "view"
32331
+ },
32332
+ "system.getRequestCensus": {
32333
+ capName: "system",
32334
+ capScope: "system",
32335
+ addonId: null,
32336
+ access: "view"
32337
+ },
31875
32338
  "system.getRetentionConfig": {
31876
32339
  capName: "system",
31877
32340
  capScope: "system",
@@ -31902,6 +32365,12 @@ Object.freeze({
31902
32365
  addonId: null,
31903
32366
  access: "view"
31904
32367
  },
32368
+ "system.setLoggingSettings": {
32369
+ capName: "system",
32370
+ capScope: "system",
32371
+ addonId: null,
32372
+ access: "create"
32373
+ },
31905
32374
  "system.setRetentionConfig": {
31906
32375
  capName: "system",
31907
32376
  capScope: "system",
@@ -33057,6 +33526,10 @@ Object.freeze({
33057
33526
  name: "deviceId",
33058
33527
  form: "single",
33059
33528
  optional: true
33529
+ }, {
33530
+ name: "deviceIds",
33531
+ form: "array",
33532
+ optional: true
33060
33533
  }],
33061
33534
  "fanControl.setDirection": [{
33062
33535
  name: "deviceId",
@@ -33862,6 +34335,11 @@ Object.freeze({
33862
34335
  form: "single",
33863
34336
  optional: false
33864
34337
  }],
34338
+ "recording.readWindowBytes": [{
34339
+ name: "deviceId",
34340
+ form: "single",
34341
+ optional: false
34342
+ }],
33865
34343
  "recording.relocateFootage": [{
33866
34344
  name: "deviceId",
33867
34345
  form: "single",
@@ -34869,7 +35347,38 @@ object({
34869
35347
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34870
35348
  * reproduce that.
34871
35349
  */
34872
- tileBudgetMb: number().int().min(0).max(1024)
35350
+ tileBudgetMb: number().int().min(0).max(1024),
35351
+ /**
35352
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35353
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35354
+ * subject tiles, on frames that detected something.
35355
+ *
35356
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35357
+ * containment is strict by design, so the native `keyFrame`, the detail
35358
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35359
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35360
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35361
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35362
+ *
35363
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35364
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35365
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35366
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35367
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35368
+ * binds only through a detection burst, where it still covers well past the
35369
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35370
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35371
+ * whole shape exists to avoid.
35372
+ *
35373
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35374
+ * subject tile, so one shared budget would let a busy camera's key frames
35375
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35376
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35377
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35378
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35379
+ * nothing.
35380
+ */
35381
+ sceneBudgetMb: number().int().min(0).max(1024)
34873
35382
  });
34874
35383
  /**
34875
35384
  * The values in force when the operator has set nothing.
@@ -34885,12 +35394,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
34885
35394
  budgetMb: 1024,
34886
35395
  activityMs: 15e3,
34887
35396
  tileBudgetMb: 64,
35397
+ sceneBudgetMb: 48,
34888
35398
  admission: "inferred"
34889
35399
  };
34890
35400
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34891
35401
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34892
35402
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34893
35403
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35404
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
34894
35405
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34895
35406
  var MB = 1024 * 1024;
34896
35407
  1024 * MB, 3072 * MB;