@camstack/addon-provider-petkit 0.2.31 → 0.2.32

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