@camstack/addon-provider-amcrest 0.2.32 → 0.2.34

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 +577 -59
  2. package/dist/addon.mjs +577 -59
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7519,6 +7519,66 @@ var OpsLogQueryInputSchema = object({
7519
7519
  /** Max rows returned, newest-first. */
7520
7520
  limit: number().int().min(1).max(1e3).optional()
7521
7521
  });
7522
+ var LabelDefinitionSchema = object({
7523
+ id: string(),
7524
+ name: string(),
7525
+ category: string().optional(),
7526
+ description: string().optional(),
7527
+ icon: string().optional()
7528
+ });
7529
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7530
+ var CLASS_MAP_MACRO_TARGETS = [
7531
+ "person",
7532
+ "vehicle",
7533
+ "animal",
7534
+ "package"
7535
+ ];
7536
+ /**
7537
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7538
+ * un operatore può selezionare.
7539
+ *
7540
+ * Sono le tre offerte dallo step `object-detection`
7541
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7542
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7543
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7544
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7545
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7546
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7547
+ *
7548
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7549
+ * dello step e una seconda volta come union `FirstLevelMacro`
7550
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7551
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7552
+ * successiva.
7553
+ */
7554
+ var FIRST_LEVEL_MACRO_CLASSES = [
7555
+ "person",
7556
+ "vehicle",
7557
+ "animal"
7558
+ ];
7559
+ /**
7560
+ * Wire schema for a per-model CATALOG classMap override
7561
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7562
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7563
+ * detection pipeline executor actually routes.
7564
+ *
7565
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7566
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7567
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7568
+ * enum) — the two used to share the name `ClassMapDefinition`/
7569
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7570
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7571
+ * are not: it is two different concepts colliding on a name. Keep this type
7572
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7573
+ * would either narrow every `ClassMapDefinition` consumer to the four
7574
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7575
+ * schema exists for (see the "rejects a classMap whose target is not a
7576
+ * detection macro" test in `model-catalog-schema.test.ts`).
7577
+ */
7578
+ var DetectionCatalogClassMapSchema = object({
7579
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7580
+ preserveOriginal: boolean()
7581
+ });
7522
7582
  /**
7523
7583
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7524
7584
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7541,10 +7601,55 @@ var RecordingStorageModeSchema = _enum([
7541
7601
  "events",
7542
7602
  "continuous"
7543
7603
  ]);
7604
+ /**
7605
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7606
+ * tre offerte dallo step `object-detection`, da UNA lista
7607
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7608
+ */
7609
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7610
+ /**
7611
+ * True quando `values` non ripete un elemento.
7612
+ *
7613
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7614
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7615
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7616
+ */
7617
+ var noDuplicates = (values) => new Set(values).size === values.length;
7544
7618
  /** Which detectors trigger an `events`-mode band. */
7545
7619
  var RecordingTriggersSchema = object({
7546
7620
  motion: boolean().optional(),
7547
- audioThresholdDbfs: number().optional()
7621
+ audioThresholdDbfs: number().optional(),
7622
+ /**
7623
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7624
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7625
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7626
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7627
+ *
7628
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7629
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7630
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7631
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7632
+ * finestre — vedi `recorder/object-trigger.ts`.
7633
+ */
7634
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7635
+ /**
7636
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7637
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7638
+ * `objectClasses`.
7639
+ *
7640
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7641
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7642
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7643
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7644
+ * device (D12) — mai un elenco globale di cap.
7645
+ *
7646
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7647
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7648
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7649
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7650
+ * registrare.
7651
+ */
7652
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7548
7653
  });
7549
7654
  /**
7550
7655
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -7996,41 +8101,6 @@ var DecoderSessionConfigSchema = object({
7996
8101
  */
7997
8102
  debug: boolean().optional()
7998
8103
  });
7999
- var LabelDefinitionSchema = object({
8000
- id: string(),
8001
- name: string(),
8002
- category: string().optional(),
8003
- description: string().optional(),
8004
- icon: string().optional()
8005
- });
8006
- /**
8007
- * Wire schema for a per-model CATALOG classMap override
8008
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8009
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8010
- * detection pipeline executor actually routes.
8011
- *
8012
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8013
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8014
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8015
- * enum) — the two used to share the name `ClassMapDefinition`/
8016
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8017
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8018
- * are not: it is two different concepts colliding on a name. Keep this type
8019
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8020
- * would either narrow every `ClassMapDefinition` consumer to the four
8021
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8022
- * schema exists for (see the "rejects a classMap whose target is not a
8023
- * detection macro" test in `model-catalog-schema.test.ts`).
8024
- */
8025
- var DetectionCatalogClassMapSchema = object({
8026
- mapping: record(string(), _enum([
8027
- "person",
8028
- "vehicle",
8029
- "animal",
8030
- "package"
8031
- ])),
8032
- preserveOriginal: boolean()
8033
- });
8034
8104
  var MODEL_FORMATS = [
8035
8105
  "onnx",
8036
8106
  "coreml",
@@ -21250,7 +21320,7 @@ var lifecycleJobSchema = object({
21250
21320
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21251
21321
  * as every other cap.
21252
21322
  */
21253
- var LogLevelSchema$1 = _enum([
21323
+ var LogLevelSchema$2 = _enum([
21254
21324
  "debug",
21255
21325
  "info",
21256
21326
  "warn",
@@ -21457,7 +21527,7 @@ var CustomActionInputSchema = object({
21457
21527
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21458
21528
  addonId: string(),
21459
21529
  limit: number().min(1).max(500).default(100),
21460
- level: LogLevelSchema$1.optional()
21530
+ level: LogLevelSchema$2.optional()
21461
21531
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21462
21532
  packageName: string(),
21463
21533
  version: string().optional()
@@ -21555,7 +21625,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21555
21625
  auth: "admin"
21556
21626
  }), method(object({
21557
21627
  addonId: string(),
21558
- level: LogLevelSchema$1.optional()
21628
+ level: LogLevelSchema$2.optional()
21559
21629
  }), LogStreamEntrySchema, { kind: "subscription" });
21560
21630
  /**
21561
21631
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -23279,6 +23349,35 @@ var FaceFilterEnum = _enum([
23279
23349
  "identified",
23280
23350
  "all"
23281
23351
  ]);
23352
+ /**
23353
+ * What a `listRecentFaces` page is ORDERED BY.
23354
+ *
23355
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23356
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23357
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23358
+ * order: it puts the suggestions an operator can confirm with one tap at the
23359
+ * top, and it is the reason this enum exists — a client that ranked a capped
23360
+ * page client-side was ranking the newest N, never the most certain N.
23361
+ *
23362
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23363
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23364
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23365
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23366
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23367
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23368
+ * then by faceId, and is what makes this a total order instead of the
23369
+ * backend's NULL-collation accident.
23370
+ */
23371
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
23372
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
23373
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23374
+ * never leaves the server. */
23375
+ var FaceClusterSchema = object({
23376
+ faceIds: array(string()).readonly(),
23377
+ representativeFaceId: string(),
23378
+ size: number().int(),
23379
+ cohesion: number()
23380
+ });
23282
23381
  var MediaFileLiteSchema$1 = object({
23283
23382
  key: string(),
23284
23383
  kind: string(),
@@ -23325,24 +23424,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23325
23424
  kind: "mutation",
23326
23425
  auth: "admin"
23327
23426
  }), method(object({
23328
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23427
+ /**
23428
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23429
+ *
23430
+ * The legacy single-camera form, kept verbatim for every caller that
23431
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23432
+ * instead — never both: `deviceIds` is the authority whenever it is
23433
+ * present, and this field is then ignored rather than unioned, so
23434
+ * there is exactly one answer to "which cameras did I ask for".
23435
+ */
23329
23436
  deviceId: number().int().optional(),
23437
+ /**
23438
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23439
+ * until now had to fetch the cluster-wide page and drop rows in the
23440
+ * client (so the `limit` it asked for was spent on cameras it was
23441
+ * about to discard).
23442
+ *
23443
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23444
+ * "every camera". A request for no devices is a request, not an
23445
+ * omission; same contract as `deviceManager.listFleet` and
23446
+ * `pipelineAnalytics.listRecentTracks`.
23447
+ *
23448
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23449
+ */
23450
+ deviceIds: array(number().int()).optional(),
23330
23451
  limit: number().int().positive().optional(),
23331
23452
  filter: FaceFilterEnum.optional(),
23332
23453
  /**
23333
- * Inline the base64 crop on every row. Default `true` — the existing
23334
- * behaviour, kept so no caller breaks.
23454
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23455
+ * Absent means no lower bound.
23456
+ */
23457
+ since: number().int().optional(),
23458
+ /**
23459
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23460
+ * Absent means no upper bound.
23461
+ */
23462
+ until: number().int().optional(),
23463
+ /**
23464
+ * Order the page by time or by suggestion certainty. Default
23465
+ * `'timestamp'` — the historical order, unchanged for every caller
23466
+ * that does not ask.
23335
23467
  *
23336
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23337
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23338
- * the browser cache the images.
23468
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23469
+ * does under `'suggestionConfidence'`.
23339
23470
  *
23340
- * **This is an INPUT field, so it does not reach the addon until the
23341
- * next train.** The hub router validates cap inputs against its own
23342
- * compiled Zod, which strips a key it does not know verified today
23343
- * on the OUTPUT side, where an additive field DOES arrive immediately
23344
- * (`Track.hasFace`). Until the train ships, sending `false` is
23345
- * harmless and simply keeps the crops inline.
23471
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23472
+ * index and stops reading as soon as `limit` rows have PASSED the
23473
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23474
+ * certain row may be the oldest so it walks the window. Narrow it
23475
+ * with {@link since} / {@link until}.
23476
+ */
23477
+ sortBy: FaceSortFieldEnum.optional(),
23478
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23479
+ sortDirection: FaceSortDirectionEnum.optional(),
23480
+ /**
23481
+ * Inline the base64 crop on every row.
23482
+ *
23483
+ * Default `false` since the 2026-08-25 inversion — see
23484
+ * `include-crops-default.ts`, which is the ONE place that resolves
23485
+ * this for every gallery, and which records why the inline shape had
23486
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23487
+ * The doc here used to still say `true`; it was wrong, and a leftover
23488
+ * that describes the old design reads as permission to rely on it.
23489
+ *
23490
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23491
+ * which the browser fetches off the `event-media` plane in parallel,
23492
+ * cached and ETagged.
23346
23493
  */
23347
23494
  includeCrops: boolean().optional()
23348
23495
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -23378,13 +23525,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
23378
23525
  }), method(object({
23379
23526
  threshold: number().min(0).max(1).optional(),
23380
23527
  minClusterSize: number().int().min(2).optional(),
23381
- limit: number().int().positive().optional()
23382
- }).optional(), array(object({
23383
- faceIds: array(string()).readonly(),
23384
- representativeFaceId: string(),
23385
- size: number().int(),
23386
- cohesion: number()
23387
- })).readonly());
23528
+ /**
23529
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23530
+ * which read as though it bounded the work — it never did.
23531
+ *
23532
+ * Wins over {@link limit} when both are sent.
23533
+ */
23534
+ maxClusters: number().int().positive().optional(),
23535
+ /**
23536
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23537
+ * RESULT, not the scan. Kept so existing callers keep working; send
23538
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23539
+ */
23540
+ limit: number().int().positive().optional(),
23541
+ /**
23542
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23543
+ * POOL, not the result.
23544
+ *
23545
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23546
+ * used to read every unassigned face on the hub no matter what the
23547
+ * caller asked for, because the only bound cut the finished clusters
23548
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23549
+ * whole corpus, on an addon whose disk is under contention.
23550
+ *
23551
+ * The pool is the NEWEST matching faces first — the same order the
23552
+ * gallery shows — so a bound here shortens the horizon, it does not
23553
+ * sample it randomly.
23554
+ *
23555
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23556
+ * so the live corpus — 372 face rows — is unaffected while the
23557
+ * unbounded scan can never come back as the table grows.
23558
+ */
23559
+ maxFacesScanned: number().int().positive().optional()
23560
+ }).optional(), array(FaceClusterSchema).readonly());
23388
23561
  /**
23389
23562
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
23390
23563
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28612,6 +28785,293 @@ var SetSiteLocationInputSchema = object({
28612
28785
  latitude: number().min(-90).max(90),
28613
28786
  longitude: number().min(-180).max(180)
28614
28787
  }).nullable();
28788
+ /**
28789
+ * The TRANSPORT a call arrived on.
28790
+ *
28791
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
28792
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
28793
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
28794
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
28795
+ * checkable rather than asserted.
28796
+ *
28797
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
28798
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
28799
+ * connection; the viewer talks to the hub over `wsLink`
28800
+ * exclusively, so this is the plane the HTTP census could not see.
28801
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
28802
+ * never touches a socket and therefore never touched a census.
28803
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
28804
+ * that is exactly what its `0` asserts: every plane the hub has can name
28805
+ * itself. It is an output bucket, never a knob — a call that arrives on a
28806
+ * plane nobody instrumented lands here instead of vanishing from the total.
28807
+ */
28808
+ var TransportPlaneSchema = _enum([
28809
+ "http",
28810
+ "ws",
28811
+ "mesh",
28812
+ "unknown"
28813
+ ]);
28814
+ /**
28815
+ * Calls per plane. Every key is always present, `0` included — an absent plane
28816
+ * reads as "not instrumented", which is the one thing this census must never
28817
+ * make an operator wonder about.
28818
+ */
28819
+ var TransportPlaneCountsSchema = object({
28820
+ http: number(),
28821
+ ws: number(),
28822
+ mesh: number(),
28823
+ unknown: number()
28824
+ });
28825
+ /**
28826
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
28827
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28828
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28829
+ * already prints - never a token, never an `Authorization` header.
28830
+ *
28831
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
28832
+ * and lives for hours, so folding it into a call count makes one long-lived
28833
+ * stream look like a storm.
28834
+ */
28835
+ var RequestCensusGroupSchema = object({
28836
+ plane: TransportPlaneSchema,
28837
+ procedure: string(),
28838
+ userAgent: string(),
28839
+ ip: string(),
28840
+ principal: string(),
28841
+ calls: number(),
28842
+ subscriptions: number(),
28843
+ perMin: number()
28844
+ });
28845
+ /**
28846
+ * A procedure's TOTAL over the window, across every caller.
28847
+ *
28848
+ * This block, not the group list, is what answers "did these calls arrive over
28849
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28850
+ * same window excludes the HTTP plane, which is a result, not a failure.
28851
+ */
28852
+ var RequestCensusProcedureSchema = object({
28853
+ procedure: string(),
28854
+ calls: number(),
28855
+ /**
28856
+ * The same total, split by transport. THIS is the row that answers the
28857
+ * question the census exists for: one look at `deviceManager.listAll` says
28858
+ * which plane carried the 4 960, without joining two log lines by eye.
28859
+ */
28860
+ planes: TransportPlaneCountsSchema,
28861
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
28862
+ subscriptions: number(),
28863
+ perMin: number()
28864
+ });
28865
+ /**
28866
+ * The census as an operator sees it.
28867
+ *
28868
+ * `persisted` is the honest answer to "will this survive the restart I am
28869
+ * about to do": the arm deadline is written to `system-settings` so a window
28870
+ * armed now can measure the NEXT boot, and a write that failed must not look
28871
+ * like one that succeeded.
28872
+ */
28873
+ var RequestCensusStatusSchema = object({
28874
+ armed: boolean(),
28875
+ /** How long the current - or just-closed - window collected, in ms. */
28876
+ elapsedMs: number(),
28877
+ /** The window actually armed, after the server clamped the request. */
28878
+ windowMs: number(),
28879
+ /** Epoch ms the window closes at. 0 when disarmed. */
28880
+ armedUntilMs: number(),
28881
+ httpRequests: number(),
28882
+ batchedRequests: number(),
28883
+ /**
28884
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28885
+ * is in play (`?batch=1` carries several procedures in one request); this is
28886
+ * the number comparable with a store-side call count.
28887
+ */
28888
+ procedureCalls: number(),
28889
+ /**
28890
+ * `procedureCalls` split by transport. The four keys sum to
28891
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
28892
+ * `planesExplainTotal` is that identity, checked rather than assumed.
28893
+ */
28894
+ planes: TransportPlaneCountsSchema,
28895
+ /**
28896
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
28897
+ * on no plane at all - which is a RESULT (a plane is missing from the
28898
+ * instrument), not a failure, and it has to be visible to be read as one.
28899
+ */
28900
+ planesExplainTotal: boolean(),
28901
+ /**
28902
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28903
+ * adapter resolves one context per connection - kept because a plane's call
28904
+ * count of zero against 37 open connections says something different from a
28905
+ * plane with no connections at all.
28906
+ */
28907
+ wsConnections: number(),
28908
+ /**
28909
+ * Client frames the WS plane looked at. `wsMessages` far above
28910
+ * `planes.ws + subscriptions` means most traffic is not operations
28911
+ * (keepalives, connection params) - which is itself an answer.
28912
+ */
28913
+ wsMessages: number(),
28914
+ /**
28915
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
28916
+ * purpose: one live-events stream opened at boot and held for six hours is
28917
+ * one subscription, and counting it as a call would let a quiet plane
28918
+ * masquerade as the storm.
28919
+ */
28920
+ subscriptions: number(),
28921
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
28922
+ subscriptionStops: number(),
28923
+ distinctGroups: number(),
28924
+ /**
28925
+ * Operations counted in the totals whose CALLER attribution was shed at the
28926
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
28927
+ * which transport they arrived on, they just lost their group row.
28928
+ */
28929
+ unattributedCalls: number(),
28930
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28931
+ groups: array(RequestCensusGroupSchema).readonly()
28932
+ }).extend({ persisted: boolean() });
28933
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28934
+ var LogLevelSchema$1 = _enum([
28935
+ "debug",
28936
+ "info",
28937
+ "warn",
28938
+ "error"
28939
+ ]);
28940
+ /**
28941
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28942
+ *
28943
+ * A diagnostic is anything whose cost is only worth paying while a question is
28944
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28945
+ */
28946
+ var DiagnosticIdSchema = _enum(["request-census"]);
28947
+ /**
28948
+ * The layers of the level hierarchy, general → specific. The most specific
28949
+ * layer that carries an explicit value wins.
28950
+ *
28951
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28952
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28953
+ * grow later would force every consumer of this document to change with it.
28954
+ * Nothing returns `component` today.
28955
+ */
28956
+ var LoggingScopeKindSchema = _enum([
28957
+ "cluster",
28958
+ "node",
28959
+ "component"
28960
+ ]);
28961
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28962
+ var LoggingLevelSourceSchema = _enum([
28963
+ "default",
28964
+ "cluster",
28965
+ "node",
28966
+ "component"
28967
+ ]);
28968
+ /**
28969
+ * One layer of the hierarchy as it actually STANDS.
28970
+ *
28971
+ * `level: null` is the whole reason this array is returned: it is the
28972
+ * difference between "this node is at `info` because I decided it" and
28973
+ * "...because it inherits". An operator who clears an override believing they
28974
+ * are clearing an inherited value has been handed the same defect as the two
28975
+ * contradicting knobs this document exists to remove, moved one floor up.
28976
+ */
28977
+ var LoggingLevelLayerSchema = object({
28978
+ scope: LoggingScopeKindSchema,
28979
+ /** The node this layer speaks for; `null` on the cluster layer. */
28980
+ nodeId: string().nullable(),
28981
+ /** Explicitly set here, or `null` when this layer inherits. */
28982
+ level: LogLevelSchema$1.nullable()
28983
+ });
28984
+ /** What a line is judged against, and WHICH layer decided it. */
28985
+ var LoggingEffectiveSchema = object({
28986
+ level: LogLevelSchema$1,
28987
+ levelSource: LoggingLevelSourceSchema
28988
+ });
28989
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28990
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28991
+ /**
28992
+ * An armed diagnostic, with its DEADLINE.
28993
+ *
28994
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28995
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28996
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28997
+ * `armed` is false — a window is never reported as slightly expired.
28998
+ */
28999
+ var DiagnosticWindowSchema = object({
29000
+ id: DiagnosticIdSchema,
29001
+ armed: boolean(),
29002
+ /** Epoch ms the window closes at. 0 when disarmed. */
29003
+ armedUntilMs: number(),
29004
+ /** Ms left before it expires on its own. 0 when disarmed. */
29005
+ remainingMs: number(),
29006
+ /** Whether the stored deadline is the one the live diagnostic is running —
29007
+ * i.e. whether this window would survive a restart. */
29008
+ persisted: boolean()
29009
+ });
29010
+ /**
29011
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29012
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29013
+ * is a second knob that disagrees with the first the day one of them moves.
29014
+ */
29015
+ var DiagnosticWindowPatchSchema = object({
29016
+ id: DiagnosticIdSchema,
29017
+ armMs: number().int().min(0),
29018
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29019
+ reportEveryMs: number().int().positive().optional()
29020
+ });
29021
+ /**
29022
+ * A PATCH, and patches MERGE.
29023
+ *
29024
+ * A field absent from the patch is left exactly as it was — arming a
29025
+ * diagnostic never resets a level, and setting a level never disarms a window.
29026
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29027
+ * `setAll` already merges, and rebuilding the object is how an absent field
29028
+ * turns into an erased one.
29029
+ */
29030
+ var LoggingSettingsPatchSchema = object({
29031
+ /**
29032
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29033
+ * addressed scope so it inherits again. A value sets it.
29034
+ */
29035
+ level: LogLevelSchema$1.nullable().optional(),
29036
+ /**
29037
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29038
+ * keeps running — a patch is never a full replacement.
29039
+ */
29040
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29041
+ });
29042
+ /**
29043
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29044
+ *
29045
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29046
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29047
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29048
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29049
+ * by an agent that holds no cluster document at all. The hub is the single
29050
+ * authority over the whole hierarchy and answers for every layer, so the
29051
+ * layer selector needs a name the transport does not already own.
29052
+ */
29053
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29054
+ var SetLoggingSettingsInputSchema = object({
29055
+ scopeNodeId: string().optional(),
29056
+ patch: LoggingSettingsPatchSchema
29057
+ });
29058
+ /**
29059
+ * The whole document, as read and as returned after every write.
29060
+ *
29061
+ * `persisted: false` means the settings store could not be read or written.
29062
+ * The in-memory mirror still governs behaviour and is unchanged by the
29063
+ * failure — a read that fails neither switches a level nor disarms a window
29064
+ * (D49) — but the operator is told that what they are looking at would not
29065
+ * survive a restart.
29066
+ */
29067
+ var LoggingSettingsStateSchema = object({
29068
+ /** The layer this document was read at. `null` = the cluster layer. */
29069
+ scopeNodeId: string().nullable(),
29070
+ effective: LoggingEffectiveSchema,
29071
+ explicit: LoggingExplicitSchema,
29072
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29073
+ persisted: boolean()
29074
+ });
28615
29075
  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(), {
28616
29076
  kind: "mutation",
28617
29077
  auth: "admin"
@@ -28624,6 +29084,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28624
29084
  }), method(_void(), SiteLocationStatusSchema, {
28625
29085
  kind: "mutation",
28626
29086
  auth: "admin"
29087
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29088
+ kind: "mutation",
29089
+ auth: "admin"
28627
29090
  });
28628
29091
  /**
28629
29092
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -36069,6 +36532,18 @@ Object.freeze({
36069
36532
  addonId: null,
36070
36533
  access: "create"
36071
36534
  },
36535
+ "system.getLoggingSettings": {
36536
+ capName: "system",
36537
+ capScope: "system",
36538
+ addonId: null,
36539
+ access: "view"
36540
+ },
36541
+ "system.getRequestCensus": {
36542
+ capName: "system",
36543
+ capScope: "system",
36544
+ addonId: null,
36545
+ access: "view"
36546
+ },
36072
36547
  "system.getRetentionConfig": {
36073
36548
  capName: "system",
36074
36549
  capScope: "system",
@@ -36099,6 +36574,12 @@ Object.freeze({
36099
36574
  addonId: null,
36100
36575
  access: "view"
36101
36576
  },
36577
+ "system.setLoggingSettings": {
36578
+ capName: "system",
36579
+ capScope: "system",
36580
+ addonId: null,
36581
+ access: "create"
36582
+ },
36102
36583
  "system.setRetentionConfig": {
36103
36584
  capName: "system",
36104
36585
  capScope: "system",
@@ -37254,6 +37735,10 @@ Object.freeze({
37254
37735
  name: "deviceId",
37255
37736
  form: "single",
37256
37737
  optional: true
37738
+ }, {
37739
+ name: "deviceIds",
37740
+ form: "array",
37741
+ optional: true
37257
37742
  }],
37258
37743
  "fanControl.setDirection": [{
37259
37744
  name: "deviceId",
@@ -38864,7 +39349,38 @@ object({
38864
39349
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
38865
39350
  * reproduce that.
38866
39351
  */
38867
- tileBudgetMb: number().int().min(0).max(1024)
39352
+ tileBudgetMb: number().int().min(0).max(1024),
39353
+ /**
39354
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39355
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39356
+ * subject tiles, on frames that detected something.
39357
+ *
39358
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39359
+ * containment is strict by design, so the native `keyFrame`, the detail
39360
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39361
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39362
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39363
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39364
+ *
39365
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39366
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39367
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39368
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39369
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39370
+ * binds only through a detection burst, where it still covers well past the
39371
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39372
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39373
+ * whole shape exists to avoid.
39374
+ *
39375
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39376
+ * subject tile, so one shared budget would let a busy camera's key frames
39377
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39378
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39379
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39380
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39381
+ * nothing.
39382
+ */
39383
+ sceneBudgetMb: number().int().min(0).max(1024)
38868
39384
  });
38869
39385
  /**
38870
39386
  * The values in force when the operator has set nothing.
@@ -38880,12 +39396,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
38880
39396
  budgetMb: 1024,
38881
39397
  activityMs: 15e3,
38882
39398
  tileBudgetMb: 64,
39399
+ sceneBudgetMb: 48,
38883
39400
  admission: "inferred"
38884
39401
  };
38885
39402
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
38886
39403
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
38887
39404
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
38888
39405
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39406
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38889
39407
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38890
39408
  var MB = 1024 * 1024;
38891
39409
  1024 * MB, 3072 * MB;