@camstack/addon-provider-gree 0.2.29 → 0.2.31

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
@@ -7528,6 +7528,66 @@ var OpsLogQueryInputSchema = object({
7528
7528
  /** Max rows returned, newest-first. */
7529
7529
  limit: number().int().min(1).max(1e3).optional()
7530
7530
  });
7531
+ var LabelDefinitionSchema = object({
7532
+ id: string(),
7533
+ name: string(),
7534
+ category: string().optional(),
7535
+ description: string().optional(),
7536
+ icon: string().optional()
7537
+ });
7538
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7539
+ var CLASS_MAP_MACRO_TARGETS = [
7540
+ "person",
7541
+ "vehicle",
7542
+ "animal",
7543
+ "package"
7544
+ ];
7545
+ /**
7546
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7547
+ * un operatore può selezionare.
7548
+ *
7549
+ * Sono le tre offerte dallo step `object-detection`
7550
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7551
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7552
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7553
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7554
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7555
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7556
+ *
7557
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7558
+ * dello step e una seconda volta come union `FirstLevelMacro`
7559
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7560
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7561
+ * successiva.
7562
+ */
7563
+ var FIRST_LEVEL_MACRO_CLASSES = [
7564
+ "person",
7565
+ "vehicle",
7566
+ "animal"
7567
+ ];
7568
+ /**
7569
+ * Wire schema for a per-model CATALOG classMap override
7570
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7571
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7572
+ * detection pipeline executor actually routes.
7573
+ *
7574
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7575
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7576
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7577
+ * enum) — the two used to share the name `ClassMapDefinition`/
7578
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7579
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7580
+ * are not: it is two different concepts colliding on a name. Keep this type
7581
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7582
+ * would either narrow every `ClassMapDefinition` consumer to the four
7583
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7584
+ * schema exists for (see the "rejects a classMap whose target is not a
7585
+ * detection macro" test in `model-catalog-schema.test.ts`).
7586
+ */
7587
+ var DetectionCatalogClassMapSchema = object({
7588
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7589
+ preserveOriginal: boolean()
7590
+ });
7531
7591
  /**
7532
7592
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7533
7593
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7550,10 +7610,55 @@ var RecordingStorageModeSchema = _enum([
7550
7610
  "events",
7551
7611
  "continuous"
7552
7612
  ]);
7613
+ /**
7614
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7615
+ * tre offerte dallo step `object-detection`, da UNA lista
7616
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7617
+ */
7618
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7619
+ /**
7620
+ * True quando `values` non ripete un elemento.
7621
+ *
7622
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7623
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7624
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7625
+ */
7626
+ var noDuplicates = (values) => new Set(values).size === values.length;
7553
7627
  /** Which detectors trigger an `events`-mode band. */
7554
7628
  var RecordingTriggersSchema = object({
7555
7629
  motion: boolean().optional(),
7556
- audioThresholdDbfs: number().optional()
7630
+ audioThresholdDbfs: number().optional(),
7631
+ /**
7632
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7633
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7634
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7635
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7636
+ *
7637
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7638
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7639
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7640
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7641
+ * finestre — vedi `recorder/object-trigger.ts`.
7642
+ */
7643
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7644
+ /**
7645
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7646
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7647
+ * `objectClasses`.
7648
+ *
7649
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7650
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7651
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7652
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7653
+ * device (D12) — mai un elenco globale di cap.
7654
+ *
7655
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7656
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7657
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7658
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7659
+ * registrare.
7660
+ */
7661
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7557
7662
  });
7558
7663
  /**
7559
7664
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8005,41 +8110,6 @@ var DecoderSessionConfigSchema = object({
8005
8110
  */
8006
8111
  debug: boolean().optional()
8007
8112
  });
8008
- var LabelDefinitionSchema = object({
8009
- id: string(),
8010
- name: string(),
8011
- category: string().optional(),
8012
- description: string().optional(),
8013
- icon: string().optional()
8014
- });
8015
- /**
8016
- * Wire schema for a per-model CATALOG classMap override
8017
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8018
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8019
- * detection pipeline executor actually routes.
8020
- *
8021
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8022
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8023
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8024
- * enum) — the two used to share the name `ClassMapDefinition`/
8025
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8026
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8027
- * are not: it is two different concepts colliding on a name. Keep this type
8028
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8029
- * would either narrow every `ClassMapDefinition` consumer to the four
8030
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8031
- * schema exists for (see the "rejects a classMap whose target is not a
8032
- * detection macro" test in `model-catalog-schema.test.ts`).
8033
- */
8034
- var DetectionCatalogClassMapSchema = object({
8035
- mapping: record(string(), _enum([
8036
- "person",
8037
- "vehicle",
8038
- "animal",
8039
- "package"
8040
- ])),
8041
- preserveOriginal: boolean()
8042
- });
8043
8113
  var MODEL_FORMATS = [
8044
8114
  "onnx",
8045
8115
  "coreml",
@@ -15784,7 +15854,23 @@ var NcHistoryEntrySchema = object({
15784
15854
  updatedAt: number(),
15785
15855
  /** Failure detail — present on a `dead` row. */
15786
15856
  error: string().optional(),
15787
- subject: NcHistorySubjectSchema
15857
+ subject: NcHistorySubjectSchema,
15858
+ /**
15859
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
15860
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
15861
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
15862
+ * every delivery attempt). Absent on a row still pending/dead, a row
15863
+ * delivered before this field shipped, or a wiring with no artefact index.
15864
+ *
15865
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
15866
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
15867
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
15868
+ * also answers `null` for an id whose artefact has since expired past the
15869
+ * retained shelf's own age bound — the degrade a caller (the Home
15870
+ * Assistant export) must render as "no image right now", never as a
15871
+ * broken link.
15872
+ */
15873
+ artifactIds: array(string().min(1)).optional()
15788
15874
  });
15789
15875
  /**
15790
15876
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -16011,7 +16097,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
16011
16097
  }), method(object({}), object({
16012
16098
  catalog: array(NcConditionDescriptorSchema),
16013
16099
  taxonomy: NcTaxonomySchema.optional()
16014
- })), 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 }), {
16100
+ })), 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 }), {
16015
16101
  kind: "mutation",
16016
16102
  caller: "required"
16017
16103
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -21139,7 +21225,7 @@ var lifecycleJobSchema = object({
21139
21225
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21140
21226
  * as every other cap.
21141
21227
  */
21142
- var LogLevelSchema$1 = _enum([
21228
+ var LogLevelSchema$2 = _enum([
21143
21229
  "debug",
21144
21230
  "info",
21145
21231
  "warn",
@@ -21346,7 +21432,7 @@ var CustomActionInputSchema = object({
21346
21432
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21347
21433
  addonId: string(),
21348
21434
  limit: number().min(1).max(500).default(100),
21349
- level: LogLevelSchema$1.optional()
21435
+ level: LogLevelSchema$2.optional()
21350
21436
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21351
21437
  packageName: string(),
21352
21438
  version: string().optional()
@@ -21444,7 +21530,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21444
21530
  auth: "admin"
21445
21531
  }), method(object({
21446
21532
  addonId: string(),
21447
- level: LogLevelSchema$1.optional()
21533
+ level: LogLevelSchema$2.optional()
21448
21534
  }), LogStreamEntrySchema, { kind: "subscription" });
21449
21535
  /**
21450
21536
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23168,6 +23254,35 @@ var FaceFilterEnum = _enum([
23168
23254
  "identified",
23169
23255
  "all"
23170
23256
  ]);
23257
+ /**
23258
+ * What a `listRecentFaces` page is ORDERED BY.
23259
+ *
23260
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23261
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23262
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23263
+ * order: it puts the suggestions an operator can confirm with one tap at the
23264
+ * top, and it is the reason this enum exists — a client that ranked a capped
23265
+ * page client-side was ranking the newest N, never the most certain N.
23266
+ *
23267
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23268
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23269
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23270
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23271
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23272
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23273
+ * then by faceId, and is what makes this a total order instead of the
23274
+ * backend's NULL-collation accident.
23275
+ */
23276
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23277
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23278
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23279
+ * never leaves the server. */
23280
+ var FaceClusterSchema = object({
23281
+ faceIds: array(string()).readonly(),
23282
+ representativeFaceId: string(),
23283
+ size: number().int(),
23284
+ cohesion: number()
23285
+ });
23171
23286
  var MediaFileLiteSchema$1 = object({
23172
23287
  key: string(),
23173
23288
  kind: string(),
@@ -23214,24 +23329,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23214
23329
  kind: "mutation",
23215
23330
  auth: "admin"
23216
23331
  }), method(object({
23217
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23332
+ /**
23333
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23334
+ *
23335
+ * The legacy single-camera form, kept verbatim for every caller that
23336
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23337
+ * instead — never both: `deviceIds` is the authority whenever it is
23338
+ * present, and this field is then ignored rather than unioned, so
23339
+ * there is exactly one answer to "which cameras did I ask for".
23340
+ */
23218
23341
  deviceId: number().int().optional(),
23342
+ /**
23343
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23344
+ * until now had to fetch the cluster-wide page and drop rows in the
23345
+ * client (so the `limit` it asked for was spent on cameras it was
23346
+ * about to discard).
23347
+ *
23348
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23349
+ * "every camera". A request for no devices is a request, not an
23350
+ * omission; same contract as `deviceManager.listFleet` and
23351
+ * `pipelineAnalytics.listRecentTracks`.
23352
+ *
23353
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23354
+ */
23355
+ deviceIds: array(number().int()).optional(),
23219
23356
  limit: number().int().positive().optional(),
23220
23357
  filter: FaceFilterEnum.optional(),
23221
23358
  /**
23222
- * Inline the base64 crop on every row. Default `true` — the existing
23223
- * behaviour, kept so no caller breaks.
23359
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23360
+ * Absent means no lower bound.
23361
+ */
23362
+ since: number().int().optional(),
23363
+ /**
23364
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23365
+ * Absent means no upper bound.
23366
+ */
23367
+ until: number().int().optional(),
23368
+ /**
23369
+ * Order the page by time or by suggestion certainty. Default
23370
+ * `'timestamp'` — the historical order, unchanged for every caller
23371
+ * that does not ask.
23224
23372
  *
23225
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23226
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23227
- * the browser cache the images.
23373
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23374
+ * does under `'suggestionConfidence'`.
23228
23375
  *
23229
- * **This is an INPUT field, so it does not reach the addon until the
23230
- * next train.** The hub router validates cap inputs against its own
23231
- * compiled Zod, which strips a key it does not know — verified today
23232
- * on the OUTPUT side, where an additive field DOES arrive immediately
23233
- * (`Track.hasFace`). Until the train ships, sending `false` is
23234
- * harmless and simply keeps the crops inline.
23376
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23377
+ * index and stops reading as soon as `limit` rows have PASSED the
23378
+ * filter. `'suggestionConfidence'` cannot stop early — the most
23379
+ * certain row may be the oldest — so it walks the window. Narrow it
23380
+ * with {@link since} / {@link until}.
23381
+ */
23382
+ sortBy: FaceSortFieldEnum.optional(),
23383
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23384
+ sortDirection: FaceSortDirectionEnum.optional(),
23385
+ /**
23386
+ * Inline the base64 crop on every row.
23387
+ *
23388
+ * Default `false` since the 2026-08-25 inversion — see
23389
+ * `include-crops-default.ts`, which is the ONE place that resolves
23390
+ * this for every gallery, and which records why the inline shape had
23391
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23392
+ * The doc here used to still say `true`; it was wrong, and a leftover
23393
+ * that describes the old design reads as permission to rely on it.
23394
+ *
23395
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23396
+ * which the browser fetches off the `event-media` plane in parallel,
23397
+ * cached and ETagged.
23235
23398
  */
23236
23399
  includeCrops: boolean().optional()
23237
23400
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23267,13 +23430,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23267
23430
  }), method(object({
23268
23431
  threshold: number().min(0).max(1).optional(),
23269
23432
  minClusterSize: number().int().min(2).optional(),
23270
- limit: number().int().positive().optional()
23271
- }).optional(), array(object({
23272
- faceIds: array(string()).readonly(),
23273
- representativeFaceId: string(),
23274
- size: number().int(),
23275
- cohesion: number()
23276
- })).readonly());
23433
+ /**
23434
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23435
+ * which read as though it bounded the work — it never did.
23436
+ *
23437
+ * Wins over {@link limit} when both are sent.
23438
+ */
23439
+ maxClusters: number().int().positive().optional(),
23440
+ /**
23441
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23442
+ * RESULT, not the scan. Kept so existing callers keep working; send
23443
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23444
+ */
23445
+ limit: number().int().positive().optional(),
23446
+ /**
23447
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23448
+ * POOL, not the result.
23449
+ *
23450
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23451
+ * used to read every unassigned face on the hub no matter what the
23452
+ * caller asked for, because the only bound cut the finished clusters
23453
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23454
+ * whole corpus, on an addon whose disk is under contention.
23455
+ *
23456
+ * The pool is the NEWEST matching faces first — the same order the
23457
+ * gallery shows — so a bound here shortens the horizon, it does not
23458
+ * sample it randomly.
23459
+ *
23460
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23461
+ * so the live corpus — 372 face rows — is unaffected while the
23462
+ * unbounded scan can never come back as the table grows.
23463
+ */
23464
+ maxFacesScanned: number().int().positive().optional()
23465
+ }).optional(), array(FaceClusterSchema).readonly());
23277
23466
  /**
23278
23467
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23279
23468
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27031,6 +27220,39 @@ var ReadGopBytesResultSchema = object({
27031
27220
  /** Media ms the returned fragment covers. */
27032
27221
  gopDurMs: number()
27033
27222
  });
27223
+ /**
27224
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27225
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27226
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27227
+ * a replay needs several seconds of native pixels, not one frame.
27228
+ *
27229
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27230
+ * is `false` when the returned bytes were cut short by the read's own safety
27231
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27232
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27233
+ * degradation: a window whose end falls past the covering segment would need
27234
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27235
+ * not one standalone-demuxable stream — the caller's answer is to request a
27236
+ * shorter window or one aligned to a single segment, not to receive spliced
27237
+ * bytes nothing has proven decodable.
27238
+ */
27239
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27240
+ kind: literal("ok"),
27241
+ data: _instanceof(Uint8Array),
27242
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27243
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27244
+ gopStartMs: number(),
27245
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27246
+ gopDurMs: number(),
27247
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27248
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27249
+ reachesRequestedEnd: boolean()
27250
+ }), object({
27251
+ kind: literal("spans-multiple-segments"),
27252
+ /** Where the covering segment's own footage runs out — informational,
27253
+ * not a retry hint (retrying the same window would refuse again). */
27254
+ segmentEndMs: number()
27255
+ })]);
27034
27256
  method(object({
27035
27257
  deviceId: number(),
27036
27258
  fromMs: number(),
@@ -27081,6 +27303,15 @@ method(object({
27081
27303
  }), ReadGopBytesResultSchema, {
27082
27304
  kind: "query",
27083
27305
  auth: "admin"
27306
+ }), method(object({
27307
+ deviceId: number(),
27308
+ profile: string(),
27309
+ startMs: number(),
27310
+ fromMs: number(),
27311
+ toMs: number()
27312
+ }), ReadWindowBytesResultSchema, {
27313
+ kind: "query",
27314
+ auth: "admin"
27084
27315
  }), method(object({
27085
27316
  deviceId: number(),
27086
27317
  config: RecordingConfigSchema
@@ -28173,6 +28404,211 @@ var SetSiteLocationInputSchema = object({
28173
28404
  latitude: number().min(-90).max(90),
28174
28405
  longitude: number().min(-180).max(180)
28175
28406
  }).nullable();
28407
+ /**
28408
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28409
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28410
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28411
+ * already prints - never a token, never an `Authorization` header.
28412
+ */
28413
+ var RequestCensusGroupSchema = object({
28414
+ procedure: string(),
28415
+ userAgent: string(),
28416
+ ip: string(),
28417
+ principal: string(),
28418
+ calls: number(),
28419
+ perMin: number()
28420
+ });
28421
+ /**
28422
+ * A procedure's TOTAL over the window, across every caller.
28423
+ *
28424
+ * This block, not the group list, is what answers "did these calls arrive over
28425
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28426
+ * same window excludes the HTTP plane, which is a result, not a failure.
28427
+ */
28428
+ var RequestCensusProcedureSchema = object({
28429
+ procedure: string(),
28430
+ calls: number(),
28431
+ perMin: number()
28432
+ });
28433
+ /**
28434
+ * The census as an operator sees it.
28435
+ *
28436
+ * `persisted` is the honest answer to "will this survive the restart I am
28437
+ * about to do": the arm deadline is written to `system-settings` so a window
28438
+ * armed now can measure the NEXT boot, and a write that failed must not look
28439
+ * like one that succeeded.
28440
+ */
28441
+ var RequestCensusStatusSchema = object({
28442
+ armed: boolean(),
28443
+ /** How long the current - or just-closed - window collected, in ms. */
28444
+ elapsedMs: number(),
28445
+ /** The window actually armed, after the server clamped the request. */
28446
+ windowMs: number(),
28447
+ /** Epoch ms the window closes at. 0 when disarmed. */
28448
+ armedUntilMs: number(),
28449
+ httpRequests: number(),
28450
+ batchedRequests: number(),
28451
+ /**
28452
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28453
+ * is in play (`?batch=1` carries several procedures in one request); this is
28454
+ * the number comparable with a store-side call count.
28455
+ */
28456
+ procedureCalls: number(),
28457
+ /**
28458
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28459
+ * transport resolves one context per connection - but the number that says
28460
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28461
+ */
28462
+ wsConnections: number(),
28463
+ distinctGroups: number(),
28464
+ /** Calls counted in the totals whose group attribution was shed at the
28465
+ * cardinality bound. */
28466
+ unattributedCalls: number(),
28467
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28468
+ groups: array(RequestCensusGroupSchema).readonly()
28469
+ }).extend({ persisted: boolean() });
28470
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28471
+ var LogLevelSchema$1 = _enum([
28472
+ "debug",
28473
+ "info",
28474
+ "warn",
28475
+ "error"
28476
+ ]);
28477
+ /**
28478
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28479
+ *
28480
+ * A diagnostic is anything whose cost is only worth paying while a question is
28481
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28482
+ */
28483
+ var DiagnosticIdSchema = _enum(["request-census"]);
28484
+ /**
28485
+ * The layers of the level hierarchy, general → specific. The most specific
28486
+ * layer that carries an explicit value wins.
28487
+ *
28488
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28489
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28490
+ * grow later would force every consumer of this document to change with it.
28491
+ * Nothing returns `component` today.
28492
+ */
28493
+ var LoggingScopeKindSchema = _enum([
28494
+ "cluster",
28495
+ "node",
28496
+ "component"
28497
+ ]);
28498
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28499
+ var LoggingLevelSourceSchema = _enum([
28500
+ "default",
28501
+ "cluster",
28502
+ "node",
28503
+ "component"
28504
+ ]);
28505
+ /**
28506
+ * One layer of the hierarchy as it actually STANDS.
28507
+ *
28508
+ * `level: null` is the whole reason this array is returned: it is the
28509
+ * difference between "this node is at `info` because I decided it" and
28510
+ * "...because it inherits". An operator who clears an override believing they
28511
+ * are clearing an inherited value has been handed the same defect as the two
28512
+ * contradicting knobs this document exists to remove, moved one floor up.
28513
+ */
28514
+ var LoggingLevelLayerSchema = object({
28515
+ scope: LoggingScopeKindSchema,
28516
+ /** The node this layer speaks for; `null` on the cluster layer. */
28517
+ nodeId: string().nullable(),
28518
+ /** Explicitly set here, or `null` when this layer inherits. */
28519
+ level: LogLevelSchema$1.nullable()
28520
+ });
28521
+ /** What a line is judged against, and WHICH layer decided it. */
28522
+ var LoggingEffectiveSchema = object({
28523
+ level: LogLevelSchema$1,
28524
+ levelSource: LoggingLevelSourceSchema
28525
+ });
28526
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28527
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28528
+ /**
28529
+ * An armed diagnostic, with its DEADLINE.
28530
+ *
28531
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28532
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28533
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28534
+ * `armed` is false — a window is never reported as slightly expired.
28535
+ */
28536
+ var DiagnosticWindowSchema = object({
28537
+ id: DiagnosticIdSchema,
28538
+ armed: boolean(),
28539
+ /** Epoch ms the window closes at. 0 when disarmed. */
28540
+ armedUntilMs: number(),
28541
+ /** Ms left before it expires on its own. 0 when disarmed. */
28542
+ remainingMs: number(),
28543
+ /** Whether the stored deadline is the one the live diagnostic is running —
28544
+ * i.e. whether this window would survive a restart. */
28545
+ persisted: boolean()
28546
+ });
28547
+ /**
28548
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28549
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28550
+ * is a second knob that disagrees with the first the day one of them moves.
28551
+ */
28552
+ var DiagnosticWindowPatchSchema = object({
28553
+ id: DiagnosticIdSchema,
28554
+ armMs: number().int().min(0),
28555
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28556
+ reportEveryMs: number().int().positive().optional()
28557
+ });
28558
+ /**
28559
+ * A PATCH, and patches MERGE.
28560
+ *
28561
+ * A field absent from the patch is left exactly as it was — arming a
28562
+ * diagnostic never resets a level, and setting a level never disarms a window.
28563
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28564
+ * `setAll` already merges, and rebuilding the object is how an absent field
28565
+ * turns into an erased one.
28566
+ */
28567
+ var LoggingSettingsPatchSchema = object({
28568
+ /**
28569
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28570
+ * addressed scope so it inherits again. A value sets it.
28571
+ */
28572
+ level: LogLevelSchema$1.nullable().optional(),
28573
+ /**
28574
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28575
+ * keeps running — a patch is never a full replacement.
28576
+ */
28577
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28578
+ });
28579
+ /**
28580
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28581
+ *
28582
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28583
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28584
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28585
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28586
+ * by an agent that holds no cluster document at all. The hub is the single
28587
+ * authority over the whole hierarchy and answers for every layer, so the
28588
+ * layer selector needs a name the transport does not already own.
28589
+ */
28590
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28591
+ var SetLoggingSettingsInputSchema = object({
28592
+ scopeNodeId: string().optional(),
28593
+ patch: LoggingSettingsPatchSchema
28594
+ });
28595
+ /**
28596
+ * The whole document, as read and as returned after every write.
28597
+ *
28598
+ * `persisted: false` means the settings store could not be read or written.
28599
+ * The in-memory mirror still governs behaviour and is unchanged by the
28600
+ * failure — a read that fails neither switches a level nor disarms a window
28601
+ * (D49) — but the operator is told that what they are looking at would not
28602
+ * survive a restart.
28603
+ */
28604
+ var LoggingSettingsStateSchema = object({
28605
+ /** The layer this document was read at. `null` = the cluster layer. */
28606
+ scopeNodeId: string().nullable(),
28607
+ effective: LoggingEffectiveSchema,
28608
+ explicit: LoggingExplicitSchema,
28609
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28610
+ persisted: boolean()
28611
+ });
28176
28612
  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(), {
28177
28613
  kind: "mutation",
28178
28614
  auth: "admin"
@@ -28185,6 +28621,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28185
28621
  }), method(_void(), SiteLocationStatusSchema, {
28186
28622
  kind: "mutation",
28187
28623
  auth: "admin"
28624
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28625
+ kind: "mutation",
28626
+ auth: "admin"
28188
28627
  });
28189
28628
  /**
28190
28629
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -33168,6 +33607,12 @@ Object.freeze({
33168
33607
  addonId: null,
33169
33608
  access: "view"
33170
33609
  },
33610
+ "notificationRules.resolveArtifactUrl": {
33611
+ capName: "notification-rules",
33612
+ capScope: "system",
33613
+ addonId: null,
33614
+ access: "view"
33615
+ },
33171
33616
  "notificationRules.setAlarmConfig": {
33172
33617
  capName: "notification-rules",
33173
33618
  capScope: "system",
@@ -34572,6 +35017,12 @@ Object.freeze({
34572
35017
  addonId: null,
34573
35018
  access: "view"
34574
35019
  },
35020
+ "recording.readWindowBytes": {
35021
+ capName: "recording",
35022
+ capScope: "system",
35023
+ addonId: null,
35024
+ access: "view"
35025
+ },
34575
35026
  "recording.refreshStorageLocationsForMigration": {
34576
35027
  capName: "recording",
34577
35028
  capScope: "system",
@@ -35412,6 +35863,18 @@ Object.freeze({
35412
35863
  addonId: null,
35413
35864
  access: "create"
35414
35865
  },
35866
+ "system.getLoggingSettings": {
35867
+ capName: "system",
35868
+ capScope: "system",
35869
+ addonId: null,
35870
+ access: "view"
35871
+ },
35872
+ "system.getRequestCensus": {
35873
+ capName: "system",
35874
+ capScope: "system",
35875
+ addonId: null,
35876
+ access: "view"
35877
+ },
35415
35878
  "system.getRetentionConfig": {
35416
35879
  capName: "system",
35417
35880
  capScope: "system",
@@ -35442,6 +35905,12 @@ Object.freeze({
35442
35905
  addonId: null,
35443
35906
  access: "view"
35444
35907
  },
35908
+ "system.setLoggingSettings": {
35909
+ capName: "system",
35910
+ capScope: "system",
35911
+ addonId: null,
35912
+ access: "create"
35913
+ },
35445
35914
  "system.setRetentionConfig": {
35446
35915
  capName: "system",
35447
35916
  capScope: "system",
@@ -36597,6 +37066,10 @@ Object.freeze({
36597
37066
  name: "deviceId",
36598
37067
  form: "single",
36599
37068
  optional: true
37069
+ }, {
37070
+ name: "deviceIds",
37071
+ form: "array",
37072
+ optional: true
36600
37073
  }],
36601
37074
  "fanControl.setDirection": [{
36602
37075
  name: "deviceId",
@@ -37402,6 +37875,11 @@ Object.freeze({
37402
37875
  form: "single",
37403
37876
  optional: false
37404
37877
  }],
37878
+ "recording.readWindowBytes": [{
37879
+ name: "deviceId",
37880
+ form: "single",
37881
+ optional: false
37882
+ }],
37405
37883
  "recording.relocateFootage": [{
37406
37884
  name: "deviceId",
37407
37885
  form: "single",
@@ -38202,7 +38680,38 @@ object({
38202
38680
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38203
38681
  * reproduce that.
38204
38682
  */
38205
- tileBudgetMb: number().int().min(0).max(1024)
38683
+ tileBudgetMb: number().int().min(0).max(1024),
38684
+ /**
38685
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
38686
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
38687
+ * subject tiles, on frames that detected something.
38688
+ *
38689
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
38690
+ * containment is strict by design, so the native `keyFrame`, the detail
38691
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
38692
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
38693
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
38694
+ * frame-time after delivery, with the request only p50 367 ms behind it.
38695
+ *
38696
+ * Sizing, and why this is a budget and not a duration: a scene tile is
38697
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
38698
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
38699
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
38700
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
38701
+ * binds only through a detection burst, where it still covers well past the
38702
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
38703
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
38704
+ * whole shape exists to avoid.
38705
+ *
38706
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
38707
+ * subject tile, so one shared budget would let a busy camera's key frames
38708
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38709
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38710
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38711
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38712
+ * nothing.
38713
+ */
38714
+ sceneBudgetMb: number().int().min(0).max(1024)
38206
38715
  });
38207
38716
  /**
38208
38717
  * The values in force when the operator has set nothing.
@@ -38218,12 +38727,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38218
38727
  budgetMb: 1024,
38219
38728
  activityMs: 15e3,
38220
38729
  tileBudgetMb: 64,
38730
+ sceneBudgetMb: 48,
38221
38731
  admission: "inferred"
38222
38732
  };
38223
38733
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38224
38734
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38225
38735
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38226
38736
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38737
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38227
38738
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38228
38739
  var MB = 1024 * 1024;
38229
38740
  1024 * MB, 3072 * MB;