@camstack/addon-provider-petkit 0.2.31 → 0.2.33

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.mjs CHANGED
@@ -8627,6 +8627,66 @@ var OpsLogQueryInputSchema = object({
8627
8627
  /** Max rows returned, newest-first. */
8628
8628
  limit: number().int().min(1).max(1e3).optional()
8629
8629
  });
8630
+ var LabelDefinitionSchema = object({
8631
+ id: string(),
8632
+ name: string(),
8633
+ category: string().optional(),
8634
+ description: string().optional(),
8635
+ icon: string().optional()
8636
+ });
8637
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
8638
+ var CLASS_MAP_MACRO_TARGETS = [
8639
+ "person",
8640
+ "vehicle",
8641
+ "animal",
8642
+ "package"
8643
+ ];
8644
+ /**
8645
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
8646
+ * un operatore può selezionare.
8647
+ *
8648
+ * Sono le tre offerte dallo step `object-detection`
8649
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
8650
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
8651
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
8652
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
8653
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
8654
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
8655
+ *
8656
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
8657
+ * dello step e una seconda volta come union `FirstLevelMacro`
8658
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
8659
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
8660
+ * successiva.
8661
+ */
8662
+ var FIRST_LEVEL_MACRO_CLASSES = [
8663
+ "person",
8664
+ "vehicle",
8665
+ "animal"
8666
+ ];
8667
+ /**
8668
+ * Wire schema for a per-model CATALOG classMap override
8669
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8670
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8671
+ * detection pipeline executor actually routes.
8672
+ *
8673
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8674
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8675
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8676
+ * enum) — the two used to share the name `ClassMapDefinition`/
8677
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8678
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8679
+ * are not: it is two different concepts colliding on a name. Keep this type
8680
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
8681
+ * would either narrow every `ClassMapDefinition` consumer to the four
8682
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8683
+ * schema exists for (see the "rejects a classMap whose target is not a
8684
+ * detection macro" test in `model-catalog-schema.test.ts`).
8685
+ */
8686
+ var DetectionCatalogClassMapSchema = object({
8687
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
8688
+ preserveOriginal: boolean()
8689
+ });
8630
8690
  /**
8631
8691
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
8632
8692
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -8649,10 +8709,55 @@ var RecordingStorageModeSchema = _enum([
8649
8709
  "events",
8650
8710
  "continuous"
8651
8711
  ]);
8712
+ /**
8713
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
8714
+ * tre offerte dallo step `object-detection`, da UNA lista
8715
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
8716
+ */
8717
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
8718
+ /**
8719
+ * True quando `values` non ripete un elemento.
8720
+ *
8721
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
8722
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
8723
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
8724
+ */
8725
+ var noDuplicates = (values) => new Set(values).size === values.length;
8652
8726
  /** Which detectors trigger an `events`-mode band. */
8653
8727
  var RecordingTriggersSchema = object({
8654
8728
  motion: boolean().optional(),
8655
- audioThresholdDbfs: number().optional()
8729
+ audioThresholdDbfs: number().optional(),
8730
+ /**
8731
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
8732
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
8733
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
8734
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
8735
+ *
8736
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
8737
+ * quelle che hanno attraversato `enabledMacroClasses`, i
8738
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
8739
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
8740
+ * finestre — vedi `recorder/object-trigger.ts`.
8741
+ */
8742
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
8743
+ /**
8744
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
8745
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
8746
+ * `objectClasses`.
8747
+ *
8748
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
8749
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
8750
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
8751
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
8752
+ * device (D12) — mai un elenco globale di cap.
8753
+ *
8754
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
8755
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
8756
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
8757
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
8758
+ * registrare.
8759
+ */
8760
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8656
8761
  });
8657
8762
  /**
8658
8763
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -9104,41 +9209,6 @@ var DecoderSessionConfigSchema = object({
9104
9209
  */
9105
9210
  debug: boolean().optional()
9106
9211
  });
9107
- var LabelDefinitionSchema = object({
9108
- id: string(),
9109
- name: string(),
9110
- category: string().optional(),
9111
- description: string().optional(),
9112
- icon: string().optional()
9113
- });
9114
- /**
9115
- * Wire schema for a per-model CATALOG classMap override
9116
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
9117
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
9118
- * detection pipeline executor actually routes.
9119
- *
9120
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
9121
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
9122
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
9123
- * enum) — the two used to share the name `ClassMapDefinition`/
9124
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
9125
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
9126
- * are not: it is two different concepts colliding on a name. Keep this type
9127
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
9128
- * would either narrow every `ClassMapDefinition` consumer to the four
9129
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
9130
- * schema exists for (see the "rejects a classMap whose target is not a
9131
- * detection macro" test in `model-catalog-schema.test.ts`).
9132
- */
9133
- var DetectionCatalogClassMapSchema = object({
9134
- mapping: record(string(), _enum([
9135
- "person",
9136
- "vehicle",
9137
- "animal",
9138
- "package"
9139
- ])),
9140
- preserveOriginal: boolean()
9141
- });
9142
9212
  var MODEL_FORMATS = [
9143
9213
  "onnx",
9144
9214
  "coreml",
@@ -22271,7 +22341,7 @@ var lifecycleJobSchema = object({
22271
22341
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
22272
22342
  * as every other cap.
22273
22343
  */
22274
- var LogLevelSchema$1 = _enum([
22344
+ var LogLevelSchema$2 = _enum([
22275
22345
  "debug",
22276
22346
  "info",
22277
22347
  "warn",
@@ -22478,7 +22548,7 @@ var CustomActionInputSchema = object({
22478
22548
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
22479
22549
  addonId: string(),
22480
22550
  limit: number().min(1).max(500).default(100),
22481
- level: LogLevelSchema$1.optional()
22551
+ level: LogLevelSchema$2.optional()
22482
22552
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
22483
22553
  packageName: string(),
22484
22554
  version: string().optional()
@@ -22576,7 +22646,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
22576
22646
  auth: "admin"
22577
22647
  }), method(object({
22578
22648
  addonId: string(),
22579
- level: LogLevelSchema$1.optional()
22649
+ level: LogLevelSchema$2.optional()
22580
22650
  }), LogStreamEntrySchema, { kind: "subscription" });
22581
22651
  /**
22582
22652
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -24308,6 +24378,35 @@ var FaceFilterEnum = _enum([
24308
24378
  "identified",
24309
24379
  "all"
24310
24380
  ]);
24381
+ /**
24382
+ * What a `listRecentFaces` page is ORDERED BY.
24383
+ *
24384
+ * - `timestamp` — when the face was seen. The historical (and default) order.
24385
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
24386
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
24387
+ * order: it puts the suggestions an operator can confirm with one tap at the
24388
+ * top, and it is the reason this enum exists — a client that ranked a capped
24389
+ * page client-side was ranking the newest N, never the most certain N.
24390
+ *
24391
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
24392
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
24393
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
24394
+ * — flipping the direction reorders the rows that HAVE a certainty and never
24395
+ * floods the page with the ones that do not. `addon-post-analysis`'s
24396
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
24397
+ * then by faceId, and is what makes this a total order instead of the
24398
+ * backend's NULL-collation accident.
24399
+ */
24400
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
24401
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
24402
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
24403
+ * never leaves the server. */
24404
+ var FaceClusterSchema = object({
24405
+ faceIds: array(string()).readonly(),
24406
+ representativeFaceId: string(),
24407
+ size: number().int(),
24408
+ cohesion: number()
24409
+ });
24311
24410
  var MediaFileLiteSchema$1 = object({
24312
24411
  key: string(),
24313
24412
  kind: string(),
@@ -24354,24 +24453,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24354
24453
  kind: "mutation",
24355
24454
  auth: "admin"
24356
24455
  }), method(object({
24357
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
24456
+ /**
24457
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
24458
+ *
24459
+ * The legacy single-camera form, kept verbatim for every caller that
24460
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
24461
+ * instead — never both: `deviceIds` is the authority whenever it is
24462
+ * present, and this field is then ignored rather than unioned, so
24463
+ * there is exactly one answer to "which cameras did I ask for".
24464
+ */
24358
24465
  deviceId: number().int().optional(),
24466
+ /**
24467
+ * Restrict to a SET of cameras — the review UI's camera filter, which
24468
+ * until now had to fetch the cluster-wide page and drop rows in the
24469
+ * client (so the `limit` it asked for was spent on cameras it was
24470
+ * about to discard).
24471
+ *
24472
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
24473
+ * "every camera". A request for no devices is a request, not an
24474
+ * omission; same contract as `deviceManager.listFleet` and
24475
+ * `pipelineAnalytics.listRecentTracks`.
24476
+ *
24477
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
24478
+ */
24479
+ deviceIds: array(number().int()).optional(),
24359
24480
  limit: number().int().positive().optional(),
24360
24481
  filter: FaceFilterEnum.optional(),
24361
24482
  /**
24362
- * Inline the base64 crop on every row. Default `true` — the existing
24363
- * behaviour, kept so no caller breaks.
24483
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24484
+ * Absent means no lower bound.
24485
+ */
24486
+ since: number().int().optional(),
24487
+ /**
24488
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24489
+ * Absent means no upper bound.
24490
+ */
24491
+ until: number().int().optional(),
24492
+ /**
24493
+ * Order the page by time or by suggestion certainty. Default
24494
+ * `'timestamp'` — the historical order, unchanged for every caller
24495
+ * that does not ask.
24364
24496
  *
24365
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
24366
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
24367
- * the browser cache the images.
24497
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
24498
+ * does under `'suggestionConfidence'`.
24368
24499
  *
24369
- * **This is an INPUT field, so it does not reach the addon until the
24370
- * next train.** The hub router validates cap inputs against its own
24371
- * compiled Zod, which strips a key it does not know verified today
24372
- * on the OUTPUT side, where an additive field DOES arrive immediately
24373
- * (`Track.hasFace`). Until the train ships, sending `false` is
24374
- * harmless and simply keeps the crops inline.
24500
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
24501
+ * index and stops reading as soon as `limit` rows have PASSED the
24502
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
24503
+ * certain row may be the oldest so it walks the window. Narrow it
24504
+ * with {@link since} / {@link until}.
24505
+ */
24506
+ sortBy: FaceSortFieldEnum.optional(),
24507
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
24508
+ sortDirection: FaceSortDirectionEnum.optional(),
24509
+ /**
24510
+ * Inline the base64 crop on every row.
24511
+ *
24512
+ * Default `false` since the 2026-08-25 inversion — see
24513
+ * `include-crops-default.ts`, which is the ONE place that resolves
24514
+ * this for every gallery, and which records why the inline shape had
24515
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
24516
+ * The doc here used to still say `true`; it was wrong, and a leftover
24517
+ * that describes the old design reads as permission to rely on it.
24518
+ *
24519
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
24520
+ * which the browser fetches off the `event-media` plane in parallel,
24521
+ * cached and ETagged.
24375
24522
  */
24376
24523
  includeCrops: boolean().optional()
24377
24524
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -24407,13 +24554,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24407
24554
  }), method(object({
24408
24555
  threshold: number().min(0).max(1).optional(),
24409
24556
  minClusterSize: number().int().min(2).optional(),
24410
- limit: number().int().positive().optional()
24411
- }).optional(), array(object({
24412
- faceIds: array(string()).readonly(),
24413
- representativeFaceId: string(),
24414
- size: number().int(),
24415
- cohesion: number()
24416
- })).readonly());
24557
+ /**
24558
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
24559
+ * which read as though it bounded the work — it never did.
24560
+ *
24561
+ * Wins over {@link limit} when both are sent.
24562
+ */
24563
+ maxClusters: number().int().positive().optional(),
24564
+ /**
24565
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
24566
+ * RESULT, not the scan. Kept so existing callers keep working; send
24567
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
24568
+ */
24569
+ limit: number().int().positive().optional(),
24570
+ /**
24571
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
24572
+ * POOL, not the result.
24573
+ *
24574
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
24575
+ * used to read every unassigned face on the hub no matter what the
24576
+ * caller asked for, because the only bound cut the finished clusters
24577
+ * afterwards; a UI showing a window of 100 paid for a scan of the
24578
+ * whole corpus, on an addon whose disk is under contention.
24579
+ *
24580
+ * The pool is the NEWEST matching faces first — the same order the
24581
+ * gallery shows — so a bound here shortens the horizon, it does not
24582
+ * sample it randomly.
24583
+ *
24584
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
24585
+ * so the live corpus — 372 face rows — is unaffected while the
24586
+ * unbounded scan can never come back as the table grows.
24587
+ */
24588
+ maxFacesScanned: number().int().positive().optional()
24589
+ }).optional(), array(FaceClusterSchema).readonly());
24417
24590
  /**
24418
24591
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
24419
24592
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -29355,6 +29528,293 @@ var SetSiteLocationInputSchema = object({
29355
29528
  latitude: number().min(-90).max(90),
29356
29529
  longitude: number().min(-180).max(180)
29357
29530
  }).nullable();
29531
+ /**
29532
+ * The TRANSPORT a call arrived on.
29533
+ *
29534
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
29535
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
29536
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
29537
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
29538
+ * checkable rather than asserted.
29539
+ *
29540
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
29541
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
29542
+ * connection; the viewer talks to the hub over `wsLink`
29543
+ * exclusively, so this is the plane the HTTP census could not see.
29544
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
29545
+ * never touches a socket and therefore never touched a census.
29546
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
29547
+ * that is exactly what its `0` asserts: every plane the hub has can name
29548
+ * itself. It is an output bucket, never a knob — a call that arrives on a
29549
+ * plane nobody instrumented lands here instead of vanishing from the total.
29550
+ */
29551
+ var TransportPlaneSchema = _enum([
29552
+ "http",
29553
+ "ws",
29554
+ "mesh",
29555
+ "unknown"
29556
+ ]);
29557
+ /**
29558
+ * Calls per plane. Every key is always present, `0` included — an absent plane
29559
+ * reads as "not instrumented", which is the one thing this census must never
29560
+ * make an operator wonder about.
29561
+ */
29562
+ var TransportPlaneCountsSchema = object({
29563
+ http: number(),
29564
+ ws: number(),
29565
+ mesh: number(),
29566
+ unknown: number()
29567
+ });
29568
+ /**
29569
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
29570
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29571
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29572
+ * already prints - never a token, never an `Authorization` header.
29573
+ *
29574
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
29575
+ * and lives for hours, so folding it into a call count makes one long-lived
29576
+ * stream look like a storm.
29577
+ */
29578
+ var RequestCensusGroupSchema = object({
29579
+ plane: TransportPlaneSchema,
29580
+ procedure: string(),
29581
+ userAgent: string(),
29582
+ ip: string(),
29583
+ principal: string(),
29584
+ calls: number(),
29585
+ subscriptions: number(),
29586
+ perMin: number()
29587
+ });
29588
+ /**
29589
+ * A procedure's TOTAL over the window, across every caller.
29590
+ *
29591
+ * This block, not the group list, is what answers "did these calls arrive over
29592
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29593
+ * same window excludes the HTTP plane, which is a result, not a failure.
29594
+ */
29595
+ var RequestCensusProcedureSchema = object({
29596
+ procedure: string(),
29597
+ calls: number(),
29598
+ /**
29599
+ * The same total, split by transport. THIS is the row that answers the
29600
+ * question the census exists for: one look at `deviceManager.listAll` says
29601
+ * which plane carried the 4 960, without joining two log lines by eye.
29602
+ */
29603
+ planes: TransportPlaneCountsSchema,
29604
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
29605
+ subscriptions: number(),
29606
+ perMin: number()
29607
+ });
29608
+ /**
29609
+ * The census as an operator sees it.
29610
+ *
29611
+ * `persisted` is the honest answer to "will this survive the restart I am
29612
+ * about to do": the arm deadline is written to `system-settings` so a window
29613
+ * armed now can measure the NEXT boot, and a write that failed must not look
29614
+ * like one that succeeded.
29615
+ */
29616
+ var RequestCensusStatusSchema = object({
29617
+ armed: boolean(),
29618
+ /** How long the current - or just-closed - window collected, in ms. */
29619
+ elapsedMs: number(),
29620
+ /** The window actually armed, after the server clamped the request. */
29621
+ windowMs: number(),
29622
+ /** Epoch ms the window closes at. 0 when disarmed. */
29623
+ armedUntilMs: number(),
29624
+ httpRequests: number(),
29625
+ batchedRequests: number(),
29626
+ /**
29627
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29628
+ * is in play (`?batch=1` carries several procedures in one request); this is
29629
+ * the number comparable with a store-side call count.
29630
+ */
29631
+ procedureCalls: number(),
29632
+ /**
29633
+ * `procedureCalls` split by transport. The four keys sum to
29634
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
29635
+ * `planesExplainTotal` is that identity, checked rather than assumed.
29636
+ */
29637
+ planes: TransportPlaneCountsSchema,
29638
+ /**
29639
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
29640
+ * on no plane at all - which is a RESULT (a plane is missing from the
29641
+ * instrument), not a failure, and it has to be visible to be read as one.
29642
+ */
29643
+ planesExplainTotal: boolean(),
29644
+ /**
29645
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29646
+ * adapter resolves one context per connection - kept because a plane's call
29647
+ * count of zero against 37 open connections says something different from a
29648
+ * plane with no connections at all.
29649
+ */
29650
+ wsConnections: number(),
29651
+ /**
29652
+ * Client frames the WS plane looked at. `wsMessages` far above
29653
+ * `planes.ws + subscriptions` means most traffic is not operations
29654
+ * (keepalives, connection params) - which is itself an answer.
29655
+ */
29656
+ wsMessages: number(),
29657
+ /**
29658
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
29659
+ * purpose: one live-events stream opened at boot and held for six hours is
29660
+ * one subscription, and counting it as a call would let a quiet plane
29661
+ * masquerade as the storm.
29662
+ */
29663
+ subscriptions: number(),
29664
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
29665
+ subscriptionStops: number(),
29666
+ distinctGroups: number(),
29667
+ /**
29668
+ * Operations counted in the totals whose CALLER attribution was shed at the
29669
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
29670
+ * which transport they arrived on, they just lost their group row.
29671
+ */
29672
+ unattributedCalls: number(),
29673
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29674
+ groups: array(RequestCensusGroupSchema).readonly()
29675
+ }).extend({ persisted: boolean() });
29676
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29677
+ var LogLevelSchema$1 = _enum([
29678
+ "debug",
29679
+ "info",
29680
+ "warn",
29681
+ "error"
29682
+ ]);
29683
+ /**
29684
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29685
+ *
29686
+ * A diagnostic is anything whose cost is only worth paying while a question is
29687
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29688
+ */
29689
+ var DiagnosticIdSchema = _enum(["request-census"]);
29690
+ /**
29691
+ * The layers of the level hierarchy, general → specific. The most specific
29692
+ * layer that carries an explicit value wins.
29693
+ *
29694
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29695
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29696
+ * grow later would force every consumer of this document to change with it.
29697
+ * Nothing returns `component` today.
29698
+ */
29699
+ var LoggingScopeKindSchema = _enum([
29700
+ "cluster",
29701
+ "node",
29702
+ "component"
29703
+ ]);
29704
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29705
+ var LoggingLevelSourceSchema = _enum([
29706
+ "default",
29707
+ "cluster",
29708
+ "node",
29709
+ "component"
29710
+ ]);
29711
+ /**
29712
+ * One layer of the hierarchy as it actually STANDS.
29713
+ *
29714
+ * `level: null` is the whole reason this array is returned: it is the
29715
+ * difference between "this node is at `info` because I decided it" and
29716
+ * "...because it inherits". An operator who clears an override believing they
29717
+ * are clearing an inherited value has been handed the same defect as the two
29718
+ * contradicting knobs this document exists to remove, moved one floor up.
29719
+ */
29720
+ var LoggingLevelLayerSchema = object({
29721
+ scope: LoggingScopeKindSchema,
29722
+ /** The node this layer speaks for; `null` on the cluster layer. */
29723
+ nodeId: string().nullable(),
29724
+ /** Explicitly set here, or `null` when this layer inherits. */
29725
+ level: LogLevelSchema$1.nullable()
29726
+ });
29727
+ /** What a line is judged against, and WHICH layer decided it. */
29728
+ var LoggingEffectiveSchema = object({
29729
+ level: LogLevelSchema$1,
29730
+ levelSource: LoggingLevelSourceSchema
29731
+ });
29732
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29733
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29734
+ /**
29735
+ * An armed diagnostic, with its DEADLINE.
29736
+ *
29737
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29738
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29739
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29740
+ * `armed` is false — a window is never reported as slightly expired.
29741
+ */
29742
+ var DiagnosticWindowSchema = object({
29743
+ id: DiagnosticIdSchema,
29744
+ armed: boolean(),
29745
+ /** Epoch ms the window closes at. 0 when disarmed. */
29746
+ armedUntilMs: number(),
29747
+ /** Ms left before it expires on its own. 0 when disarmed. */
29748
+ remainingMs: number(),
29749
+ /** Whether the stored deadline is the one the live diagnostic is running —
29750
+ * i.e. whether this window would survive a restart. */
29751
+ persisted: boolean()
29752
+ });
29753
+ /**
29754
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29755
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29756
+ * is a second knob that disagrees with the first the day one of them moves.
29757
+ */
29758
+ var DiagnosticWindowPatchSchema = object({
29759
+ id: DiagnosticIdSchema,
29760
+ armMs: number().int().min(0),
29761
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29762
+ reportEveryMs: number().int().positive().optional()
29763
+ });
29764
+ /**
29765
+ * A PATCH, and patches MERGE.
29766
+ *
29767
+ * A field absent from the patch is left exactly as it was — arming a
29768
+ * diagnostic never resets a level, and setting a level never disarms a window.
29769
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29770
+ * `setAll` already merges, and rebuilding the object is how an absent field
29771
+ * turns into an erased one.
29772
+ */
29773
+ var LoggingSettingsPatchSchema = object({
29774
+ /**
29775
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29776
+ * addressed scope so it inherits again. A value sets it.
29777
+ */
29778
+ level: LogLevelSchema$1.nullable().optional(),
29779
+ /**
29780
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29781
+ * keeps running — a patch is never a full replacement.
29782
+ */
29783
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
29784
+ });
29785
+ /**
29786
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29787
+ *
29788
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29789
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29790
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29791
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29792
+ * by an agent that holds no cluster document at all. The hub is the single
29793
+ * authority over the whole hierarchy and answers for every layer, so the
29794
+ * layer selector needs a name the transport does not already own.
29795
+ */
29796
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
29797
+ var SetLoggingSettingsInputSchema = object({
29798
+ scopeNodeId: string().optional(),
29799
+ patch: LoggingSettingsPatchSchema
29800
+ });
29801
+ /**
29802
+ * The whole document, as read and as returned after every write.
29803
+ *
29804
+ * `persisted: false` means the settings store could not be read or written.
29805
+ * The in-memory mirror still governs behaviour and is unchanged by the
29806
+ * failure — a read that fails neither switches a level nor disarms a window
29807
+ * (D49) — but the operator is told that what they are looking at would not
29808
+ * survive a restart.
29809
+ */
29810
+ var LoggingSettingsStateSchema = object({
29811
+ /** The layer this document was read at. `null` = the cluster layer. */
29812
+ scopeNodeId: string().nullable(),
29813
+ effective: LoggingEffectiveSchema,
29814
+ explicit: LoggingExplicitSchema,
29815
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
29816
+ persisted: boolean()
29817
+ });
29358
29818
  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(), {
29359
29819
  kind: "mutation",
29360
29820
  auth: "admin"
@@ -29367,6 +29827,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29367
29827
  }), method(_void(), SiteLocationStatusSchema, {
29368
29828
  kind: "mutation",
29369
29829
  auth: "admin"
29830
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29831
+ kind: "mutation",
29832
+ auth: "admin"
29370
29833
  });
29371
29834
  /**
29372
29835
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -36606,6 +37069,18 @@ Object.freeze({
36606
37069
  addonId: null,
36607
37070
  access: "create"
36608
37071
  },
37072
+ "system.getLoggingSettings": {
37073
+ capName: "system",
37074
+ capScope: "system",
37075
+ addonId: null,
37076
+ access: "view"
37077
+ },
37078
+ "system.getRequestCensus": {
37079
+ capName: "system",
37080
+ capScope: "system",
37081
+ addonId: null,
37082
+ access: "view"
37083
+ },
36609
37084
  "system.getRetentionConfig": {
36610
37085
  capName: "system",
36611
37086
  capScope: "system",
@@ -36636,6 +37111,12 @@ Object.freeze({
36636
37111
  addonId: null,
36637
37112
  access: "view"
36638
37113
  },
37114
+ "system.setLoggingSettings": {
37115
+ capName: "system",
37116
+ capScope: "system",
37117
+ addonId: null,
37118
+ access: "create"
37119
+ },
36639
37120
  "system.setRetentionConfig": {
36640
37121
  capName: "system",
36641
37122
  capScope: "system",
@@ -37791,6 +38272,10 @@ Object.freeze({
37791
38272
  name: "deviceId",
37792
38273
  form: "single",
37793
38274
  optional: true
38275
+ }, {
38276
+ name: "deviceIds",
38277
+ form: "array",
38278
+ optional: true
37794
38279
  }],
37795
38280
  "fanControl.setDirection": [{
37796
38281
  name: "deviceId",
@@ -39401,7 +39886,38 @@ object({
39401
39886
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
39402
39887
  * reproduce that.
39403
39888
  */
39404
- tileBudgetMb: number().int().min(0).max(1024)
39889
+ tileBudgetMb: number().int().min(0).max(1024),
39890
+ /**
39891
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39892
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39893
+ * subject tiles, on frames that detected something.
39894
+ *
39895
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39896
+ * containment is strict by design, so the native `keyFrame`, the detail
39897
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39898
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39899
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39900
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39901
+ *
39902
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39903
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39904
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39905
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39906
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39907
+ * binds only through a detection burst, where it still covers well past the
39908
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39909
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39910
+ * whole shape exists to avoid.
39911
+ *
39912
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39913
+ * subject tile, so one shared budget would let a busy camera's key frames
39914
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39915
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39916
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39917
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39918
+ * nothing.
39919
+ */
39920
+ sceneBudgetMb: number().int().min(0).max(1024)
39405
39921
  });
39406
39922
  /**
39407
39923
  * The values in force when the operator has set nothing.
@@ -39417,12 +39933,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
39417
39933
  budgetMb: 1024,
39418
39934
  activityMs: 15e3,
39419
39935
  tileBudgetMb: 64,
39936
+ sceneBudgetMb: 48,
39420
39937
  admission: "inferred"
39421
39938
  };
39422
39939
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39423
39940
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39424
39941
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39425
39942
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
39943
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39426
39944
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39427
39945
  var MB = 1024 * 1024;
39428
39946
  1024 * MB, 3072 * MB;