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