@camstack/addon-post-analysis 1.2.130 → 1.2.131

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.
@@ -7749,6 +7749,66 @@ var OpsLogQueryInputSchema = object({
7749
7749
  /** Max rows returned, newest-first. */
7750
7750
  limit: number().int().min(1).max(1e3).optional()
7751
7751
  });
7752
+ var LabelDefinitionSchema = object({
7753
+ id: string(),
7754
+ name: string(),
7755
+ category: string().optional(),
7756
+ description: string().optional(),
7757
+ icon: string().optional()
7758
+ });
7759
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7760
+ var CLASS_MAP_MACRO_TARGETS = [
7761
+ "person",
7762
+ "vehicle",
7763
+ "animal",
7764
+ "package"
7765
+ ];
7766
+ /**
7767
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7768
+ * un operatore può selezionare.
7769
+ *
7770
+ * Sono le tre offerte dallo step `object-detection`
7771
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7772
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7773
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7774
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7775
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7776
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7777
+ *
7778
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7779
+ * dello step e una seconda volta come union `FirstLevelMacro`
7780
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7781
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7782
+ * successiva.
7783
+ */
7784
+ var FIRST_LEVEL_MACRO_CLASSES = [
7785
+ "person",
7786
+ "vehicle",
7787
+ "animal"
7788
+ ];
7789
+ /**
7790
+ * Wire schema for a per-model CATALOG classMap override
7791
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7792
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7793
+ * detection pipeline executor actually routes.
7794
+ *
7795
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7796
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7797
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7798
+ * enum) — the two used to share the name `ClassMapDefinition`/
7799
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7800
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7801
+ * are not: it is two different concepts colliding on a name. Keep this type
7802
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7803
+ * would either narrow every `ClassMapDefinition` consumer to the four
7804
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7805
+ * schema exists for (see the "rejects a classMap whose target is not a
7806
+ * detection macro" test in `model-catalog-schema.test.ts`).
7807
+ */
7808
+ var DetectionCatalogClassMapSchema = object({
7809
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7810
+ preserveOriginal: boolean()
7811
+ });
7752
7812
  /**
7753
7813
  * THE canonical event-clip pad: the time window a single-timestamp analytics
7754
7814
  * event expands to when joined with footage (clip window = `[timestamp - preMs,
@@ -7790,10 +7850,55 @@ var RecordingStorageModeSchema = _enum([
7790
7850
  "events",
7791
7851
  "continuous"
7792
7852
  ]);
7853
+ /**
7854
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7855
+ * tre offerte dallo step `object-detection`, da UNA lista
7856
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7857
+ */
7858
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7859
+ /**
7860
+ * True quando `values` non ripete un elemento.
7861
+ *
7862
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7863
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7864
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7865
+ */
7866
+ var noDuplicates = (values) => new Set(values).size === values.length;
7793
7867
  /** Which detectors trigger an `events`-mode band. */
7794
7868
  var RecordingTriggersSchema = object({
7795
7869
  motion: boolean().optional(),
7796
- audioThresholdDbfs: number().optional()
7870
+ audioThresholdDbfs: number().optional(),
7871
+ /**
7872
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7873
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7874
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7875
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7876
+ *
7877
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7878
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7879
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7880
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7881
+ * finestre — vedi `recorder/object-trigger.ts`.
7882
+ */
7883
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7884
+ /**
7885
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7886
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7887
+ * `objectClasses`.
7888
+ *
7889
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7890
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7891
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7892
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7893
+ * device (D12) — mai un elenco globale di cap.
7894
+ *
7895
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7896
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7897
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7898
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7899
+ * registrare.
7900
+ */
7901
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7797
7902
  });
7798
7903
  /**
7799
7904
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8274,41 +8379,6 @@ var DecoderSessionConfigSchema = object({
8274
8379
  */
8275
8380
  debug: boolean().optional()
8276
8381
  });
8277
- var LabelDefinitionSchema = object({
8278
- id: string(),
8279
- name: string(),
8280
- category: string().optional(),
8281
- description: string().optional(),
8282
- icon: string().optional()
8283
- });
8284
- /**
8285
- * Wire schema for a per-model CATALOG classMap override
8286
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8287
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8288
- * detection pipeline executor actually routes.
8289
- *
8290
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8291
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8292
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8293
- * enum) — the two used to share the name `ClassMapDefinition`/
8294
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8295
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8296
- * are not: it is two different concepts colliding on a name. Keep this type
8297
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8298
- * would either narrow every `ClassMapDefinition` consumer to the four
8299
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8300
- * schema exists for (see the "rejects a classMap whose target is not a
8301
- * detection macro" test in `model-catalog-schema.test.ts`).
8302
- */
8303
- var DetectionCatalogClassMapSchema = object({
8304
- mapping: record(string(), _enum([
8305
- "person",
8306
- "vehicle",
8307
- "animal",
8308
- "package"
8309
- ])),
8310
- preserveOriginal: boolean()
8311
- });
8312
8382
  var MODEL_FORMATS = [
8313
8383
  "onnx",
8314
8384
  "coreml",
@@ -22541,7 +22611,7 @@ var lifecycleJobSchema = object({
22541
22611
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
22542
22612
  * as every other cap.
22543
22613
  */
22544
- var LogLevelSchema$1 = _enum([
22614
+ var LogLevelSchema$2 = _enum([
22545
22615
  "debug",
22546
22616
  "info",
22547
22617
  "warn",
@@ -22748,7 +22818,7 @@ var CustomActionInputSchema = object({
22748
22818
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
22749
22819
  addonId: string(),
22750
22820
  limit: number().min(1).max(500).default(100),
22751
- level: LogLevelSchema$1.optional()
22821
+ level: LogLevelSchema$2.optional()
22752
22822
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
22753
22823
  packageName: string(),
22754
22824
  version: string().optional()
@@ -22846,7 +22916,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
22846
22916
  auth: "admin"
22847
22917
  }), method(object({
22848
22918
  addonId: string(),
22849
- level: LogLevelSchema$1.optional()
22919
+ level: LogLevelSchema$2.optional()
22850
22920
  }), LogStreamEntrySchema, { kind: "subscription" });
22851
22921
  /**
22852
22922
  * Multi-metric air-quality slice. Covers CO₂, total VOCs, particulate
@@ -24570,6 +24640,35 @@ var FaceFilterEnum = _enum([
24570
24640
  "identified",
24571
24641
  "all"
24572
24642
  ]);
24643
+ /**
24644
+ * What a `listRecentFaces` page is ORDERED BY.
24645
+ *
24646
+ * - `timestamp` — when the face was seen. The historical (and default) order.
24647
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
24648
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
24649
+ * order: it puts the suggestions an operator can confirm with one tap at the
24650
+ * top, and it is the reason this enum exists — a client that ranked a capped
24651
+ * page client-side was ranking the newest N, never the most certain N.
24652
+ *
24653
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
24654
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
24655
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
24656
+ * — flipping the direction reorders the rows that HAVE a certainty and never
24657
+ * floods the page with the ones that do not. `addon-post-analysis`'s
24658
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
24659
+ * then by faceId, and is what makes this a total order instead of the
24660
+ * backend's NULL-collation accident.
24661
+ */
24662
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
24663
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
24664
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
24665
+ * never leaves the server. */
24666
+ var FaceClusterSchema = object({
24667
+ faceIds: array(string()).readonly(),
24668
+ representativeFaceId: string(),
24669
+ size: number().int(),
24670
+ cohesion: number()
24671
+ });
24573
24672
  var MediaFileLiteSchema$1 = object({
24574
24673
  key: string(),
24575
24674
  kind: string(),
@@ -24627,24 +24726,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24627
24726
  auth: "admin"
24628
24727
  }),
24629
24728
  listRecentFaces: method(object({
24630
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
24729
+ /**
24730
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
24731
+ *
24732
+ * The legacy single-camera form, kept verbatim for every caller that
24733
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
24734
+ * instead — never both: `deviceIds` is the authority whenever it is
24735
+ * present, and this field is then ignored rather than unioned, so
24736
+ * there is exactly one answer to "which cameras did I ask for".
24737
+ */
24631
24738
  deviceId: number().int().optional(),
24739
+ /**
24740
+ * Restrict to a SET of cameras — the review UI's camera filter, which
24741
+ * until now had to fetch the cluster-wide page and drop rows in the
24742
+ * client (so the `limit` it asked for was spent on cameras it was
24743
+ * about to discard).
24744
+ *
24745
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
24746
+ * "every camera". A request for no devices is a request, not an
24747
+ * omission; same contract as `deviceManager.listFleet` and
24748
+ * `pipelineAnalytics.listRecentTracks`.
24749
+ *
24750
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
24751
+ */
24752
+ deviceIds: array(number().int()).optional(),
24632
24753
  limit: number().int().positive().optional(),
24633
24754
  filter: FaceFilterEnum.optional(),
24634
24755
  /**
24635
- * Inline the base64 crop on every row. Default `true` — the existing
24636
- * behaviour, kept so no caller breaks.
24756
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24757
+ * Absent means no lower bound.
24758
+ */
24759
+ since: number().int().optional(),
24760
+ /**
24761
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24762
+ * Absent means no upper bound.
24763
+ */
24764
+ until: number().int().optional(),
24765
+ /**
24766
+ * Order the page by time or by suggestion certainty. Default
24767
+ * `'timestamp'` — the historical order, unchanged for every caller
24768
+ * that does not ask.
24637
24769
  *
24638
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
24639
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
24640
- * the browser cache the images.
24770
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
24771
+ * does under `'suggestionConfidence'`.
24641
24772
  *
24642
- * **This is an INPUT field, so it does not reach the addon until the
24643
- * next train.** The hub router validates cap inputs against its own
24644
- * compiled Zod, which strips a key it does not know — verified today
24645
- * on the OUTPUT side, where an additive field DOES arrive immediately
24646
- * (`Track.hasFace`). Until the train ships, sending `false` is
24647
- * harmless and simply keeps the crops inline.
24773
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
24774
+ * index and stops reading as soon as `limit` rows have PASSED the
24775
+ * filter. `'suggestionConfidence'` cannot stop early — the most
24776
+ * certain row may be the oldest — so it walks the window. Narrow it
24777
+ * with {@link since} / {@link until}.
24778
+ */
24779
+ sortBy: FaceSortFieldEnum.optional(),
24780
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
24781
+ sortDirection: FaceSortDirectionEnum.optional(),
24782
+ /**
24783
+ * Inline the base64 crop on every row.
24784
+ *
24785
+ * Default `false` since the 2026-08-25 inversion — see
24786
+ * `include-crops-default.ts`, which is the ONE place that resolves
24787
+ * this for every gallery, and which records why the inline shape had
24788
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
24789
+ * The doc here used to still say `true`; it was wrong, and a leftover
24790
+ * that describes the old design reads as permission to rely on it.
24791
+ *
24792
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
24793
+ * which the browser fetches off the `event-media` plane in parallel,
24794
+ * cached and ETagged.
24648
24795
  */
24649
24796
  includeCrops: boolean().optional()
24650
24797
  }).optional(), array(FaceInfoSchema).readonly()),
@@ -24693,13 +24840,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24693
24840
  suggestFaceClusters: method(object({
24694
24841
  threshold: number().min(0).max(1).optional(),
24695
24842
  minClusterSize: number().int().min(2).optional(),
24696
- limit: number().int().positive().optional()
24697
- }).optional(), array(object({
24698
- faceIds: array(string()).readonly(),
24699
- representativeFaceId: string(),
24700
- size: number().int(),
24701
- cohesion: number()
24702
- })).readonly())
24843
+ /**
24844
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
24845
+ * which read as though it bounded the work — it never did.
24846
+ *
24847
+ * Wins over {@link limit} when both are sent.
24848
+ */
24849
+ maxClusters: number().int().positive().optional(),
24850
+ /**
24851
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
24852
+ * RESULT, not the scan. Kept so existing callers keep working; send
24853
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
24854
+ */
24855
+ limit: number().int().positive().optional(),
24856
+ /**
24857
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
24858
+ * POOL, not the result.
24859
+ *
24860
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
24861
+ * used to read every unassigned face on the hub no matter what the
24862
+ * caller asked for, because the only bound cut the finished clusters
24863
+ * afterwards; a UI showing a window of 100 paid for a scan of the
24864
+ * whole corpus, on an addon whose disk is under contention.
24865
+ *
24866
+ * The pool is the NEWEST matching faces first — the same order the
24867
+ * gallery shows — so a bound here shortens the horizon, it does not
24868
+ * sample it randomly.
24869
+ *
24870
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
24871
+ * so the live corpus — 372 face rows — is unaffected while the
24872
+ * unbounded scan can never come back as the table grows.
24873
+ */
24874
+ maxFacesScanned: number().int().positive().optional()
24875
+ }).optional(), array(FaceClusterSchema).readonly())
24703
24876
  }
24704
24877
  };
24705
24878
  /**
@@ -29702,6 +29875,211 @@ var SetSiteLocationInputSchema = object({
29702
29875
  latitude: number().min(-90).max(90),
29703
29876
  longitude: number().min(-180).max(180)
29704
29877
  }).nullable();
29878
+ /**
29879
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
29880
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29881
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29882
+ * already prints - never a token, never an `Authorization` header.
29883
+ */
29884
+ var RequestCensusGroupSchema = object({
29885
+ procedure: string(),
29886
+ userAgent: string(),
29887
+ ip: string(),
29888
+ principal: string(),
29889
+ calls: number(),
29890
+ perMin: number()
29891
+ });
29892
+ /**
29893
+ * A procedure's TOTAL over the window, across every caller.
29894
+ *
29895
+ * This block, not the group list, is what answers "did these calls arrive over
29896
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29897
+ * same window excludes the HTTP plane, which is a result, not a failure.
29898
+ */
29899
+ var RequestCensusProcedureSchema = object({
29900
+ procedure: string(),
29901
+ calls: number(),
29902
+ perMin: number()
29903
+ });
29904
+ /**
29905
+ * The census as an operator sees it.
29906
+ *
29907
+ * `persisted` is the honest answer to "will this survive the restart I am
29908
+ * about to do": the arm deadline is written to `system-settings` so a window
29909
+ * armed now can measure the NEXT boot, and a write that failed must not look
29910
+ * like one that succeeded.
29911
+ */
29912
+ var RequestCensusStatusSchema = object({
29913
+ armed: boolean(),
29914
+ /** How long the current - or just-closed - window collected, in ms. */
29915
+ elapsedMs: number(),
29916
+ /** The window actually armed, after the server clamped the request. */
29917
+ windowMs: number(),
29918
+ /** Epoch ms the window closes at. 0 when disarmed. */
29919
+ armedUntilMs: number(),
29920
+ httpRequests: number(),
29921
+ batchedRequests: number(),
29922
+ /**
29923
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29924
+ * is in play (`?batch=1` carries several procedures in one request); this is
29925
+ * the number comparable with a store-side call count.
29926
+ */
29927
+ procedureCalls: number(),
29928
+ /**
29929
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29930
+ * transport resolves one context per connection - but the number that says
29931
+ * whether a plane this census cannot see was busy while HTTP was quiet.
29932
+ */
29933
+ wsConnections: number(),
29934
+ distinctGroups: number(),
29935
+ /** Calls counted in the totals whose group attribution was shed at the
29936
+ * cardinality bound. */
29937
+ unattributedCalls: number(),
29938
+ procedures: array(RequestCensusProcedureSchema).readonly(),
29939
+ groups: array(RequestCensusGroupSchema).readonly()
29940
+ }).extend({ persisted: boolean() });
29941
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29942
+ var LogLevelSchema$1 = _enum([
29943
+ "debug",
29944
+ "info",
29945
+ "warn",
29946
+ "error"
29947
+ ]);
29948
+ /**
29949
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29950
+ *
29951
+ * A diagnostic is anything whose cost is only worth paying while a question is
29952
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29953
+ */
29954
+ var DiagnosticIdSchema = _enum(["request-census"]);
29955
+ /**
29956
+ * The layers of the level hierarchy, general → specific. The most specific
29957
+ * layer that carries an explicit value wins.
29958
+ *
29959
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29960
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29961
+ * grow later would force every consumer of this document to change with it.
29962
+ * Nothing returns `component` today.
29963
+ */
29964
+ var LoggingScopeKindSchema = _enum([
29965
+ "cluster",
29966
+ "node",
29967
+ "component"
29968
+ ]);
29969
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29970
+ var LoggingLevelSourceSchema = _enum([
29971
+ "default",
29972
+ "cluster",
29973
+ "node",
29974
+ "component"
29975
+ ]);
29976
+ /**
29977
+ * One layer of the hierarchy as it actually STANDS.
29978
+ *
29979
+ * `level: null` is the whole reason this array is returned: it is the
29980
+ * difference between "this node is at `info` because I decided it" and
29981
+ * "...because it inherits". An operator who clears an override believing they
29982
+ * are clearing an inherited value has been handed the same defect as the two
29983
+ * contradicting knobs this document exists to remove, moved one floor up.
29984
+ */
29985
+ var LoggingLevelLayerSchema = object({
29986
+ scope: LoggingScopeKindSchema,
29987
+ /** The node this layer speaks for; `null` on the cluster layer. */
29988
+ nodeId: string().nullable(),
29989
+ /** Explicitly set here, or `null` when this layer inherits. */
29990
+ level: LogLevelSchema$1.nullable()
29991
+ });
29992
+ /** What a line is judged against, and WHICH layer decided it. */
29993
+ var LoggingEffectiveSchema = object({
29994
+ level: LogLevelSchema$1,
29995
+ levelSource: LoggingLevelSourceSchema
29996
+ });
29997
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29998
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
29999
+ /**
30000
+ * An armed diagnostic, with its DEADLINE.
30001
+ *
30002
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
30003
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
30004
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
30005
+ * `armed` is false — a window is never reported as slightly expired.
30006
+ */
30007
+ var DiagnosticWindowSchema = object({
30008
+ id: DiagnosticIdSchema,
30009
+ armed: boolean(),
30010
+ /** Epoch ms the window closes at. 0 when disarmed. */
30011
+ armedUntilMs: number(),
30012
+ /** Ms left before it expires on its own. 0 when disarmed. */
30013
+ remainingMs: number(),
30014
+ /** Whether the stored deadline is the one the live diagnostic is running —
30015
+ * i.e. whether this window would survive a restart. */
30016
+ persisted: boolean()
30017
+ });
30018
+ /**
30019
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
30020
+ * server — there is no maximum here on purpose: a bound repeated in a schema
30021
+ * is a second knob that disagrees with the first the day one of them moves.
30022
+ */
30023
+ var DiagnosticWindowPatchSchema = object({
30024
+ id: DiagnosticIdSchema,
30025
+ armMs: number().int().min(0),
30026
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
30027
+ reportEveryMs: number().int().positive().optional()
30028
+ });
30029
+ /**
30030
+ * A PATCH, and patches MERGE.
30031
+ *
30032
+ * A field absent from the patch is left exactly as it was — arming a
30033
+ * diagnostic never resets a level, and setting a level never disarms a window.
30034
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
30035
+ * `setAll` already merges, and rebuilding the object is how an absent field
30036
+ * turns into an erased one.
30037
+ */
30038
+ var LoggingSettingsPatchSchema = object({
30039
+ /**
30040
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
30041
+ * addressed scope so it inherits again. A value sets it.
30042
+ */
30043
+ level: LogLevelSchema$1.nullable().optional(),
30044
+ /**
30045
+ * Only the diagnostics NAMED here change. An armed window that is not listed
30046
+ * keeps running — a patch is never a full replacement.
30047
+ */
30048
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
30049
+ });
30050
+ /**
30051
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
30052
+ *
30053
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
30054
+ * input — the generated router strips it and uses it to resolve the PROVIDER
30055
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
30056
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
30057
+ * by an agent that holds no cluster document at all. The hub is the single
30058
+ * authority over the whole hierarchy and answers for every layer, so the
30059
+ * layer selector needs a name the transport does not already own.
30060
+ */
30061
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
30062
+ var SetLoggingSettingsInputSchema = object({
30063
+ scopeNodeId: string().optional(),
30064
+ patch: LoggingSettingsPatchSchema
30065
+ });
30066
+ /**
30067
+ * The whole document, as read and as returned after every write.
30068
+ *
30069
+ * `persisted: false` means the settings store could not be read or written.
30070
+ * The in-memory mirror still governs behaviour and is unchanged by the
30071
+ * failure — a read that fails neither switches a level nor disarms a window
30072
+ * (D49) — but the operator is told that what they are looking at would not
30073
+ * survive a restart.
30074
+ */
30075
+ var LoggingSettingsStateSchema = object({
30076
+ /** The layer this document was read at. `null` = the cluster layer. */
30077
+ scopeNodeId: string().nullable(),
30078
+ effective: LoggingEffectiveSchema,
30079
+ explicit: LoggingExplicitSchema,
30080
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
30081
+ persisted: boolean()
30082
+ });
29705
30083
  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(), {
29706
30084
  kind: "mutation",
29707
30085
  auth: "admin"
@@ -29714,6 +30092,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29714
30092
  }), method(_void(), SiteLocationStatusSchema, {
29715
30093
  kind: "mutation",
29716
30094
  auth: "admin"
30095
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30096
+ kind: "mutation",
30097
+ auth: "admin"
29717
30098
  });
29718
30099
  /**
29719
30100
  * Tamper / case-open detection sensor. Drives Home Assistant
@@ -37005,6 +37386,18 @@ Object.freeze({
37005
37386
  addonId: null,
37006
37387
  access: "create"
37007
37388
  },
37389
+ "system.getLoggingSettings": {
37390
+ capName: "system",
37391
+ capScope: "system",
37392
+ addonId: null,
37393
+ access: "view"
37394
+ },
37395
+ "system.getRequestCensus": {
37396
+ capName: "system",
37397
+ capScope: "system",
37398
+ addonId: null,
37399
+ access: "view"
37400
+ },
37008
37401
  "system.getRetentionConfig": {
37009
37402
  capName: "system",
37010
37403
  capScope: "system",
@@ -37035,6 +37428,12 @@ Object.freeze({
37035
37428
  addonId: null,
37036
37429
  access: "view"
37037
37430
  },
37431
+ "system.setLoggingSettings": {
37432
+ capName: "system",
37433
+ capScope: "system",
37434
+ addonId: null,
37435
+ access: "create"
37436
+ },
37038
37437
  "system.setRetentionConfig": {
37039
37438
  capName: "system",
37040
37439
  capScope: "system",
@@ -38190,6 +38589,10 @@ Object.freeze({
38190
38589
  name: "deviceId",
38191
38590
  form: "single",
38192
38591
  optional: true
38592
+ }, {
38593
+ name: "deviceIds",
38594
+ form: "array",
38595
+ optional: true
38193
38596
  }],
38194
38597
  "fanControl.setDirection": [{
38195
38598
  name: "deviceId",
@@ -40082,7 +40485,38 @@ object({
40082
40485
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
40083
40486
  * reproduce that.
40084
40487
  */
40085
- tileBudgetMb: number().int().min(0).max(1024)
40488
+ tileBudgetMb: number().int().min(0).max(1024),
40489
+ /**
40490
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
40491
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
40492
+ * subject tiles, on frames that detected something.
40493
+ *
40494
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
40495
+ * containment is strict by design, so the native `keyFrame`, the detail
40496
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
40497
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
40498
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
40499
+ * frame-time after delivery, with the request only p50 367 ms behind it.
40500
+ *
40501
+ * Sizing, and why this is a budget and not a duration: a scene tile is
40502
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
40503
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
40504
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
40505
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
40506
+ * binds only through a detection burst, where it still covers well past the
40507
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
40508
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
40509
+ * whole shape exists to avoid.
40510
+ *
40511
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
40512
+ * subject tile, so one shared budget would let a busy camera's key frames
40513
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
40514
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
40515
+ * pre-existing behaviour, where a late full-frame request had nothing but the
40516
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
40517
+ * nothing.
40518
+ */
40519
+ sceneBudgetMb: number().int().min(0).max(1024)
40086
40520
  });
40087
40521
  /**
40088
40522
  * The values in force when the operator has set nothing.
@@ -40098,12 +40532,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
40098
40532
  budgetMb: 1024,
40099
40533
  activityMs: 15e3,
40100
40534
  tileBudgetMb: 64,
40535
+ sceneBudgetMb: 48,
40101
40536
  admission: "inferred"
40102
40537
  };
40103
40538
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
40104
40539
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
40105
40540
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
40106
40541
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
40542
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
40107
40543
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
40108
40544
  /** Cosine similarity between two embedding vectors */
40109
40545
  function cosineSimilarity(a, b) {