@camstack/addon-model-studio 1.1.45 → 1.1.47

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 (18) hide show
  1. package/dist/{MotionZonesSettings-BA2jeOR6.mjs → MotionZonesSettings-1fJtqNCr.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-Bf1hFhGN.mjs → PrivacyMaskSettings-Cn6l1jIS.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-DcKcwKsJ.mjs → SceneMonitorEditor-CHV4hmwM.mjs} +3 -3
  4. package/dist/_stub.js +337 -336
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-B-ZMvrf0.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-CIlpdOAc.mjs} +4 -4
  6. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BEjMiwxz.mjs +26 -0
  7. package/dist/{hostInit-BZM9cD30.mjs → hostInit-K9hUMwrn.mjs} +3 -3
  8. package/dist/model-studio.addon.js +577 -59
  9. package/dist/model-studio.addon.mjs +577 -59
  10. package/dist/{player-overlays-CUJ2regU.mjs → player-overlays-DH4UacFT.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-pq6YOPGN.mjs → responsive-BApg0Jh0.mjs} +1 -1
  13. package/dist/{square-BFrlalUj.mjs → square-C2yNIs-0.mjs} +1 -1
  14. package/dist/{trash-2-KCXgMJqK.mjs → trash-2-CWMg_KtS.mjs} +1 -1
  15. package/dist/{use-device-snapshot-C9mtUHIM.mjs → use-device-snapshot-BT0s7YBQ.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DlP1RQa1.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-Dm6izmNn.mjs} +1 -1
  17. package/package.json +1 -1
  18. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C3sZIjJ6.mjs +0 -26
@@ -8165,6 +8165,66 @@ var OpsLogQueryInputSchema = object({
8165
8165
  /** Max rows returned, newest-first. */
8166
8166
  limit: number().int().min(1).max(1e3).optional()
8167
8167
  });
8168
+ var LabelDefinitionSchema = object({
8169
+ id: string(),
8170
+ name: string(),
8171
+ category: string().optional(),
8172
+ description: string().optional(),
8173
+ icon: string().optional()
8174
+ });
8175
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
8176
+ var CLASS_MAP_MACRO_TARGETS = [
8177
+ "person",
8178
+ "vehicle",
8179
+ "animal",
8180
+ "package"
8181
+ ];
8182
+ /**
8183
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
8184
+ * un operatore può selezionare.
8185
+ *
8186
+ * Sono le tre offerte dallo step `object-detection`
8187
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
8188
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
8189
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
8190
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
8191
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
8192
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
8193
+ *
8194
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
8195
+ * dello step e una seconda volta come union `FirstLevelMacro`
8196
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
8197
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
8198
+ * successiva.
8199
+ */
8200
+ var FIRST_LEVEL_MACRO_CLASSES = [
8201
+ "person",
8202
+ "vehicle",
8203
+ "animal"
8204
+ ];
8205
+ /**
8206
+ * Wire schema for a per-model CATALOG classMap override
8207
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8208
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8209
+ * detection pipeline executor actually routes.
8210
+ *
8211
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8212
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8213
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8214
+ * enum) — the two used to share the name `ClassMapDefinition`/
8215
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8216
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8217
+ * are not: it is two different concepts colliding on a name. Keep this type
8218
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
8219
+ * would either narrow every `ClassMapDefinition` consumer to the four
8220
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8221
+ * schema exists for (see the "rejects a classMap whose target is not a
8222
+ * detection macro" test in `model-catalog-schema.test.ts`).
8223
+ */
8224
+ var DetectionCatalogClassMapSchema = object({
8225
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
8226
+ preserveOriginal: boolean()
8227
+ });
8168
8228
  /**
8169
8229
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
8170
8230
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -8187,10 +8247,55 @@ var RecordingStorageModeSchema = _enum([
8187
8247
  "events",
8188
8248
  "continuous"
8189
8249
  ]);
8250
+ /**
8251
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
8252
+ * tre offerte dallo step `object-detection`, da UNA lista
8253
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
8254
+ */
8255
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
8256
+ /**
8257
+ * True quando `values` non ripete un elemento.
8258
+ *
8259
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
8260
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
8261
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
8262
+ */
8263
+ var noDuplicates = (values) => new Set(values).size === values.length;
8190
8264
  /** Which detectors trigger an `events`-mode band. */
8191
8265
  var RecordingTriggersSchema = object({
8192
8266
  motion: boolean().optional(),
8193
- audioThresholdDbfs: number().optional()
8267
+ audioThresholdDbfs: number().optional(),
8268
+ /**
8269
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
8270
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
8271
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
8272
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
8273
+ *
8274
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
8275
+ * quelle che hanno attraversato `enabledMacroClasses`, i
8276
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
8277
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
8278
+ * finestre — vedi `recorder/object-trigger.ts`.
8279
+ */
8280
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
8281
+ /**
8282
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
8283
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
8284
+ * `objectClasses`.
8285
+ *
8286
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
8287
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
8288
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
8289
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
8290
+ * device (D12) — mai un elenco globale di cap.
8291
+ *
8292
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
8293
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
8294
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
8295
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
8296
+ * registrare.
8297
+ */
8298
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8194
8299
  });
8195
8300
  /**
8196
8301
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8642,41 +8747,6 @@ var DecoderSessionConfigSchema = object({
8642
8747
  */
8643
8748
  debug: boolean().optional()
8644
8749
  });
8645
- var LabelDefinitionSchema = object({
8646
- id: string(),
8647
- name: string(),
8648
- category: string().optional(),
8649
- description: string().optional(),
8650
- icon: string().optional()
8651
- });
8652
- /**
8653
- * Wire schema for a per-model CATALOG classMap override
8654
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8655
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8656
- * detection pipeline executor actually routes.
8657
- *
8658
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8659
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8660
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8661
- * enum) — the two used to share the name `ClassMapDefinition`/
8662
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8663
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8664
- * are not: it is two different concepts colliding on a name. Keep this type
8665
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8666
- * would either narrow every `ClassMapDefinition` consumer to the four
8667
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8668
- * schema exists for (see the "rejects a classMap whose target is not a
8669
- * detection macro" test in `model-catalog-schema.test.ts`).
8670
- */
8671
- var DetectionCatalogClassMapSchema = object({
8672
- mapping: record(string(), _enum([
8673
- "person",
8674
- "vehicle",
8675
- "animal",
8676
- "package"
8677
- ])),
8678
- preserveOriginal: boolean()
8679
- });
8680
8750
  var MODEL_FORMATS = [
8681
8751
  "onnx",
8682
8752
  "coreml",
@@ -21512,7 +21582,7 @@ var lifecycleJobSchema = object({
21512
21582
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21513
21583
  * as every other cap.
21514
21584
  */
21515
- var LogLevelSchema$1 = _enum([
21585
+ var LogLevelSchema$2 = _enum([
21516
21586
  "debug",
21517
21587
  "info",
21518
21588
  "warn",
@@ -21719,7 +21789,7 @@ var CustomActionInputSchema = object({
21719
21789
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
21720
21790
  addonId: string(),
21721
21791
  limit: number().min(1).max(500).default(100),
21722
- level: LogLevelSchema$1.optional()
21792
+ level: LogLevelSchema$2.optional()
21723
21793
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
21724
21794
  packageName: string(),
21725
21795
  version: string().optional()
@@ -21817,7 +21887,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
21817
21887
  auth: "admin"
21818
21888
  }), method(object({
21819
21889
  addonId: string(),
21820
- level: LogLevelSchema$1.optional()
21890
+ level: LogLevelSchema$2.optional()
21821
21891
  }), LogStreamEntrySchema, { kind: "subscription" });
21822
21892
  object({
21823
21893
  /** Carbon dioxide concentration in ppm. */
@@ -22811,6 +22881,35 @@ var FaceFilterEnum = _enum([
22811
22881
  "identified",
22812
22882
  "all"
22813
22883
  ]);
22884
+ /**
22885
+ * What a `listRecentFaces` page is ORDERED BY.
22886
+ *
22887
+ * - `timestamp` — when the face was seen. The historical (and default) order.
22888
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
22889
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
22890
+ * order: it puts the suggestions an operator can confirm with one tap at the
22891
+ * top, and it is the reason this enum exists — a client that ranked a capped
22892
+ * page client-side was ranking the newest N, never the most certain N.
22893
+ *
22894
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
22895
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
22896
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
22897
+ * — flipping the direction reorders the rows that HAVE a certainty and never
22898
+ * floods the page with the ones that do not. `addon-post-analysis`'s
22899
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
22900
+ * then by faceId, and is what makes this a total order instead of the
22901
+ * backend's NULL-collation accident.
22902
+ */
22903
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
22904
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
22905
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
22906
+ * never leaves the server. */
22907
+ var FaceClusterSchema = object({
22908
+ faceIds: array(string()).readonly(),
22909
+ representativeFaceId: string(),
22910
+ size: number().int(),
22911
+ cohesion: number()
22912
+ });
22814
22913
  var MediaFileLiteSchema$1 = object({
22815
22914
  key: string(),
22816
22915
  kind: string(),
@@ -22857,24 +22956,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22857
22956
  kind: "mutation",
22858
22957
  auth: "admin"
22859
22958
  }), method(object({
22860
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22959
+ /**
22960
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
22961
+ *
22962
+ * The legacy single-camera form, kept verbatim for every caller that
22963
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
22964
+ * instead — never both: `deviceIds` is the authority whenever it is
22965
+ * present, and this field is then ignored rather than unioned, so
22966
+ * there is exactly one answer to "which cameras did I ask for".
22967
+ */
22861
22968
  deviceId: number().int().optional(),
22969
+ /**
22970
+ * Restrict to a SET of cameras — the review UI's camera filter, which
22971
+ * until now had to fetch the cluster-wide page and drop rows in the
22972
+ * client (so the `limit` it asked for was spent on cameras it was
22973
+ * about to discard).
22974
+ *
22975
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
22976
+ * "every camera". A request for no devices is a request, not an
22977
+ * omission; same contract as `deviceManager.listFleet` and
22978
+ * `pipelineAnalytics.listRecentTracks`.
22979
+ *
22980
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
22981
+ */
22982
+ deviceIds: array(number().int()).optional(),
22862
22983
  limit: number().int().positive().optional(),
22863
22984
  filter: FaceFilterEnum.optional(),
22864
22985
  /**
22865
- * Inline the base64 crop on every row. Default `true` — the existing
22866
- * behaviour, kept so no caller breaks.
22986
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22987
+ * Absent means no lower bound.
22988
+ */
22989
+ since: number().int().optional(),
22990
+ /**
22991
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
22992
+ * Absent means no upper bound.
22993
+ */
22994
+ until: number().int().optional(),
22995
+ /**
22996
+ * Order the page by time or by suggestion certainty. Default
22997
+ * `'timestamp'` — the historical order, unchanged for every caller
22998
+ * that does not ask.
22867
22999
  *
22868
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
22869
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
22870
- * the browser cache the images.
23000
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23001
+ * does under `'suggestionConfidence'`.
22871
23002
  *
22872
- * **This is an INPUT field, so it does not reach the addon until the
22873
- * next train.** The hub router validates cap inputs against its own
22874
- * compiled Zod, which strips a key it does not know verified today
22875
- * on the OUTPUT side, where an additive field DOES arrive immediately
22876
- * (`Track.hasFace`). Until the train ships, sending `false` is
22877
- * harmless and simply keeps the crops inline.
23003
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23004
+ * index and stops reading as soon as `limit` rows have PASSED the
23005
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23006
+ * certain row may be the oldest so it walks the window. Narrow it
23007
+ * with {@link since} / {@link until}.
23008
+ */
23009
+ sortBy: FaceSortFieldEnum.optional(),
23010
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23011
+ sortDirection: FaceSortDirectionEnum.optional(),
23012
+ /**
23013
+ * Inline the base64 crop on every row.
23014
+ *
23015
+ * Default `false` since the 2026-08-25 inversion — see
23016
+ * `include-crops-default.ts`, which is the ONE place that resolves
23017
+ * this for every gallery, and which records why the inline shape had
23018
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23019
+ * The doc here used to still say `true`; it was wrong, and a leftover
23020
+ * that describes the old design reads as permission to rely on it.
23021
+ *
23022
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23023
+ * which the browser fetches off the `event-media` plane in parallel,
23024
+ * cached and ETagged.
22878
23025
  */
22879
23026
  includeCrops: boolean().optional()
22880
23027
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -22910,13 +23057,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
22910
23057
  }), method(object({
22911
23058
  threshold: number().min(0).max(1).optional(),
22912
23059
  minClusterSize: number().int().min(2).optional(),
22913
- limit: number().int().positive().optional()
22914
- }).optional(), array(object({
22915
- faceIds: array(string()).readonly(),
22916
- representativeFaceId: string(),
22917
- size: number().int(),
22918
- cohesion: number()
22919
- })).readonly());
23060
+ /**
23061
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23062
+ * which read as though it bounded the work — it never did.
23063
+ *
23064
+ * Wins over {@link limit} when both are sent.
23065
+ */
23066
+ maxClusters: number().int().positive().optional(),
23067
+ /**
23068
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23069
+ * RESULT, not the scan. Kept so existing callers keep working; send
23070
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23071
+ */
23072
+ limit: number().int().positive().optional(),
23073
+ /**
23074
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23075
+ * POOL, not the result.
23076
+ *
23077
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23078
+ * used to read every unassigned face on the hub no matter what the
23079
+ * caller asked for, because the only bound cut the finished clusters
23080
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23081
+ * whole corpus, on an addon whose disk is under contention.
23082
+ *
23083
+ * The pool is the NEWEST matching faces first — the same order the
23084
+ * gallery shows — so a bound here shortens the horizon, it does not
23085
+ * sample it randomly.
23086
+ *
23087
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23088
+ * so the live corpus — 372 face rows — is unaffected while the
23089
+ * unbounded scan can never come back as the table grows.
23090
+ */
23091
+ maxFacesScanned: number().int().positive().optional()
23092
+ }).optional(), array(FaceClusterSchema).readonly());
22920
23093
  /**
22921
23094
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
22922
23095
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -26639,6 +26812,293 @@ var SetSiteLocationInputSchema = object({
26639
26812
  latitude: number().min(-90).max(90),
26640
26813
  longitude: number().min(-180).max(180)
26641
26814
  }).nullable();
26815
+ /**
26816
+ * The TRANSPORT a call arrived on.
26817
+ *
26818
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26819
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26820
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26821
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26822
+ * checkable rather than asserted.
26823
+ *
26824
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26825
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26826
+ * connection; the viewer talks to the hub over `wsLink`
26827
+ * exclusively, so this is the plane the HTTP census could not see.
26828
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26829
+ * never touches a socket and therefore never touched a census.
26830
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26831
+ * that is exactly what its `0` asserts: every plane the hub has can name
26832
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26833
+ * plane nobody instrumented lands here instead of vanishing from the total.
26834
+ */
26835
+ var TransportPlaneSchema = _enum([
26836
+ "http",
26837
+ "ws",
26838
+ "mesh",
26839
+ "unknown"
26840
+ ]);
26841
+ /**
26842
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26843
+ * reads as "not instrumented", which is the one thing this census must never
26844
+ * make an operator wonder about.
26845
+ */
26846
+ var TransportPlaneCountsSchema = object({
26847
+ http: number(),
26848
+ ws: number(),
26849
+ mesh: number(),
26850
+ unknown: number()
26851
+ });
26852
+ /**
26853
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26854
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26855
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26856
+ * already prints - never a token, never an `Authorization` header.
26857
+ *
26858
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26859
+ * and lives for hours, so folding it into a call count makes one long-lived
26860
+ * stream look like a storm.
26861
+ */
26862
+ var RequestCensusGroupSchema = object({
26863
+ plane: TransportPlaneSchema,
26864
+ procedure: string(),
26865
+ userAgent: string(),
26866
+ ip: string(),
26867
+ principal: string(),
26868
+ calls: number(),
26869
+ subscriptions: number(),
26870
+ perMin: number()
26871
+ });
26872
+ /**
26873
+ * A procedure's TOTAL over the window, across every caller.
26874
+ *
26875
+ * This block, not the group list, is what answers "did these calls arrive over
26876
+ * HTTP at all". A total far BELOW what a store-side census counted over the
26877
+ * same window excludes the HTTP plane, which is a result, not a failure.
26878
+ */
26879
+ var RequestCensusProcedureSchema = object({
26880
+ procedure: string(),
26881
+ calls: number(),
26882
+ /**
26883
+ * The same total, split by transport. THIS is the row that answers the
26884
+ * question the census exists for: one look at `deviceManager.listAll` says
26885
+ * which plane carried the 4 960, without joining two log lines by eye.
26886
+ */
26887
+ planes: TransportPlaneCountsSchema,
26888
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26889
+ subscriptions: number(),
26890
+ perMin: number()
26891
+ });
26892
+ /**
26893
+ * The census as an operator sees it.
26894
+ *
26895
+ * `persisted` is the honest answer to "will this survive the restart I am
26896
+ * about to do": the arm deadline is written to `system-settings` so a window
26897
+ * armed now can measure the NEXT boot, and a write that failed must not look
26898
+ * like one that succeeded.
26899
+ */
26900
+ var RequestCensusStatusSchema = object({
26901
+ armed: boolean(),
26902
+ /** How long the current - or just-closed - window collected, in ms. */
26903
+ elapsedMs: number(),
26904
+ /** The window actually armed, after the server clamped the request. */
26905
+ windowMs: number(),
26906
+ /** Epoch ms the window closes at. 0 when disarmed. */
26907
+ armedUntilMs: number(),
26908
+ httpRequests: number(),
26909
+ batchedRequests: number(),
26910
+ /**
26911
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
26912
+ * is in play (`?batch=1` carries several procedures in one request); this is
26913
+ * the number comparable with a store-side call count.
26914
+ */
26915
+ procedureCalls: number(),
26916
+ /**
26917
+ * `procedureCalls` split by transport. The four keys sum to
26918
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26919
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26920
+ */
26921
+ planes: TransportPlaneCountsSchema,
26922
+ /**
26923
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26924
+ * on no plane at all - which is a RESULT (a plane is missing from the
26925
+ * instrument), not a failure, and it has to be visible to be read as one.
26926
+ */
26927
+ planesExplainTotal: boolean(),
26928
+ /**
26929
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
26930
+ * adapter resolves one context per connection - kept because a plane's call
26931
+ * count of zero against 37 open connections says something different from a
26932
+ * plane with no connections at all.
26933
+ */
26934
+ wsConnections: number(),
26935
+ /**
26936
+ * Client frames the WS plane looked at. `wsMessages` far above
26937
+ * `planes.ws + subscriptions` means most traffic is not operations
26938
+ * (keepalives, connection params) - which is itself an answer.
26939
+ */
26940
+ wsMessages: number(),
26941
+ /**
26942
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26943
+ * purpose: one live-events stream opened at boot and held for six hours is
26944
+ * one subscription, and counting it as a call would let a quiet plane
26945
+ * masquerade as the storm.
26946
+ */
26947
+ subscriptions: number(),
26948
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26949
+ subscriptionStops: number(),
26950
+ distinctGroups: number(),
26951
+ /**
26952
+ * Operations counted in the totals whose CALLER attribution was shed at the
26953
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26954
+ * which transport they arrived on, they just lost their group row.
26955
+ */
26956
+ unattributedCalls: number(),
26957
+ procedures: array(RequestCensusProcedureSchema).readonly(),
26958
+ groups: array(RequestCensusGroupSchema).readonly()
26959
+ }).extend({ persisted: boolean() });
26960
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
26961
+ var LogLevelSchema$1 = _enum([
26962
+ "debug",
26963
+ "info",
26964
+ "warn",
26965
+ "error"
26966
+ ]);
26967
+ /**
26968
+ * The diagnostics that can be ARMED for a window. Exactly one today.
26969
+ *
26970
+ * A diagnostic is anything whose cost is only worth paying while a question is
26971
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
26972
+ */
26973
+ var DiagnosticIdSchema = _enum(["request-census"]);
26974
+ /**
26975
+ * The layers of the level hierarchy, general → specific. The most specific
26976
+ * layer that carries an explicit value wins.
26977
+ *
26978
+ * `component` is DECLARED and not yet resolvable: the per-component channels
26979
+ * are a later slice of the same plan, and a `levelSource` enum that has to
26980
+ * grow later would force every consumer of this document to change with it.
26981
+ * Nothing returns `component` today.
26982
+ */
26983
+ var LoggingScopeKindSchema = _enum([
26984
+ "cluster",
26985
+ "node",
26986
+ "component"
26987
+ ]);
26988
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
26989
+ var LoggingLevelSourceSchema = _enum([
26990
+ "default",
26991
+ "cluster",
26992
+ "node",
26993
+ "component"
26994
+ ]);
26995
+ /**
26996
+ * One layer of the hierarchy as it actually STANDS.
26997
+ *
26998
+ * `level: null` is the whole reason this array is returned: it is the
26999
+ * difference between "this node is at `info` because I decided it" and
27000
+ * "...because it inherits". An operator who clears an override believing they
27001
+ * are clearing an inherited value has been handed the same defect as the two
27002
+ * contradicting knobs this document exists to remove, moved one floor up.
27003
+ */
27004
+ var LoggingLevelLayerSchema = object({
27005
+ scope: LoggingScopeKindSchema,
27006
+ /** The node this layer speaks for; `null` on the cluster layer. */
27007
+ nodeId: string().nullable(),
27008
+ /** Explicitly set here, or `null` when this layer inherits. */
27009
+ level: LogLevelSchema$1.nullable()
27010
+ });
27011
+ /** What a line is judged against, and WHICH layer decided it. */
27012
+ var LoggingEffectiveSchema = object({
27013
+ level: LogLevelSchema$1,
27014
+ levelSource: LoggingLevelSourceSchema
27015
+ });
27016
+ /** Every layer, general → specific. Never collapsed into the effective value. */
27017
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
27018
+ /**
27019
+ * An armed diagnostic, with its DEADLINE.
27020
+ *
27021
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
27022
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
27023
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
27024
+ * `armed` is false — a window is never reported as slightly expired.
27025
+ */
27026
+ var DiagnosticWindowSchema = object({
27027
+ id: DiagnosticIdSchema,
27028
+ armed: boolean(),
27029
+ /** Epoch ms the window closes at. 0 when disarmed. */
27030
+ armedUntilMs: number(),
27031
+ /** Ms left before it expires on its own. 0 when disarmed. */
27032
+ remainingMs: number(),
27033
+ /** Whether the stored deadline is the one the live diagnostic is running —
27034
+ * i.e. whether this window would survive a restart. */
27035
+ persisted: boolean()
27036
+ });
27037
+ /**
27038
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
27039
+ * server — there is no maximum here on purpose: a bound repeated in a schema
27040
+ * is a second knob that disagrees with the first the day one of them moves.
27041
+ */
27042
+ var DiagnosticWindowPatchSchema = object({
27043
+ id: DiagnosticIdSchema,
27044
+ armMs: number().int().min(0),
27045
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
27046
+ reportEveryMs: number().int().positive().optional()
27047
+ });
27048
+ /**
27049
+ * A PATCH, and patches MERGE.
27050
+ *
27051
+ * A field absent from the patch is left exactly as it was — arming a
27052
+ * diagnostic never resets a level, and setting a level never disarms a window.
27053
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
27054
+ * `setAll` already merges, and rebuilding the object is how an absent field
27055
+ * turns into an erased one.
27056
+ */
27057
+ var LoggingSettingsPatchSchema = object({
27058
+ /**
27059
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
27060
+ * addressed scope so it inherits again. A value sets it.
27061
+ */
27062
+ level: LogLevelSchema$1.nullable().optional(),
27063
+ /**
27064
+ * Only the diagnostics NAMED here change. An armed window that is not listed
27065
+ * keeps running — a patch is never a full replacement.
27066
+ */
27067
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
27068
+ });
27069
+ /**
27070
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
27071
+ *
27072
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
27073
+ * input — the generated router strips it and uses it to resolve the PROVIDER
27074
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
27075
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
27076
+ * by an agent that holds no cluster document at all. The hub is the single
27077
+ * authority over the whole hierarchy and answers for every layer, so the
27078
+ * layer selector needs a name the transport does not already own.
27079
+ */
27080
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
27081
+ var SetLoggingSettingsInputSchema = object({
27082
+ scopeNodeId: string().optional(),
27083
+ patch: LoggingSettingsPatchSchema
27084
+ });
27085
+ /**
27086
+ * The whole document, as read and as returned after every write.
27087
+ *
27088
+ * `persisted: false` means the settings store could not be read or written.
27089
+ * The in-memory mirror still governs behaviour and is unchanged by the
27090
+ * failure — a read that fails neither switches a level nor disarms a window
27091
+ * (D49) — but the operator is told that what they are looking at would not
27092
+ * survive a restart.
27093
+ */
27094
+ var LoggingSettingsStateSchema = object({
27095
+ /** The layer this document was read at. `null` = the cluster layer. */
27096
+ scopeNodeId: string().nullable(),
27097
+ effective: LoggingEffectiveSchema,
27098
+ explicit: LoggingExplicitSchema,
27099
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
27100
+ persisted: boolean()
27101
+ });
26642
27102
  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(), {
26643
27103
  kind: "mutation",
26644
27104
  auth: "admin"
@@ -26651,6 +27111,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26651
27111
  }), method(_void(), SiteLocationStatusSchema, {
26652
27112
  kind: "mutation",
26653
27113
  auth: "admin"
27114
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27115
+ kind: "mutation",
27116
+ auth: "admin"
26654
27117
  });
26655
27118
  object({
26656
27119
  /** True when the device's tamper switch / case-open contact is
@@ -32482,6 +32945,18 @@ Object.freeze({
32482
32945
  addonId: null,
32483
32946
  access: "create"
32484
32947
  },
32948
+ "system.getLoggingSettings": {
32949
+ capName: "system",
32950
+ capScope: "system",
32951
+ addonId: null,
32952
+ access: "view"
32953
+ },
32954
+ "system.getRequestCensus": {
32955
+ capName: "system",
32956
+ capScope: "system",
32957
+ addonId: null,
32958
+ access: "view"
32959
+ },
32485
32960
  "system.getRetentionConfig": {
32486
32961
  capName: "system",
32487
32962
  capScope: "system",
@@ -32512,6 +32987,12 @@ Object.freeze({
32512
32987
  addonId: null,
32513
32988
  access: "view"
32514
32989
  },
32990
+ "system.setLoggingSettings": {
32991
+ capName: "system",
32992
+ capScope: "system",
32993
+ addonId: null,
32994
+ access: "create"
32995
+ },
32515
32996
  "system.setRetentionConfig": {
32516
32997
  capName: "system",
32517
32998
  capScope: "system",
@@ -33667,6 +34148,10 @@ Object.freeze({
33667
34148
  name: "deviceId",
33668
34149
  form: "single",
33669
34150
  optional: true
34151
+ }, {
34152
+ name: "deviceIds",
34153
+ form: "array",
34154
+ optional: true
33670
34155
  }],
33671
34156
  "fanControl.setDirection": [{
33672
34157
  name: "deviceId",
@@ -35277,7 +35762,38 @@ object({
35277
35762
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
35278
35763
  * reproduce that.
35279
35764
  */
35280
- tileBudgetMb: number().int().min(0).max(1024)
35765
+ tileBudgetMb: number().int().min(0).max(1024),
35766
+ /**
35767
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
35768
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
35769
+ * subject tiles, on frames that detected something.
35770
+ *
35771
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
35772
+ * containment is strict by design, so the native `keyFrame`, the detail
35773
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
35774
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
35775
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
35776
+ * frame-time after delivery, with the request only p50 367 ms behind it.
35777
+ *
35778
+ * Sizing, and why this is a budget and not a duration: a scene tile is
35779
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
35780
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
35781
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
35782
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
35783
+ * binds only through a detection burst, where it still covers well past the
35784
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
35785
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
35786
+ * whole shape exists to avoid.
35787
+ *
35788
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
35789
+ * subject tile, so one shared budget would let a busy camera's key frames
35790
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
35791
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
35792
+ * pre-existing behaviour, where a late full-frame request had nothing but the
35793
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
35794
+ * nothing.
35795
+ */
35796
+ sceneBudgetMb: number().int().min(0).max(1024)
35281
35797
  });
35282
35798
  /**
35283
35799
  * The values in force when the operator has set nothing.
@@ -35293,12 +35809,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
35293
35809
  budgetMb: 1024,
35294
35810
  activityMs: 15e3,
35295
35811
  tileBudgetMb: 64,
35812
+ sceneBudgetMb: 48,
35296
35813
  admission: "inferred"
35297
35814
  };
35298
35815
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
35299
35816
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
35300
35817
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
35301
35818
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
35819
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
35302
35820
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
35303
35821
  var MB = 1024 * 1024;
35304
35822
  1024 * MB, 3072 * MB;