@camstack/addon-osd-manager 0.1.24 → 0.1.26

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-DGKPpkat.mjs → MotionZonesSettings-Dy_h9EA1.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-B-xe1lPU.mjs → PrivacyMaskSettings-CaWxq05R.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-0NvQ7u8p.mjs → SceneMonitorEditor-8hN2YKuj.mjs} +3 -3
  4. package/dist/_stub.js +2359 -2358
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BzlpFss2.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-kjdb00lx.mjs} +4 -4
  6. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DwVNeYGJ.mjs +26 -0
  7. package/dist/{hostInit-B8Ruwadu.mjs → hostInit-BDUiCsCj.mjs} +3 -3
  8. package/dist/index.js +606 -59
  9. package/dist/index.mjs +606 -59
  10. package/dist/{player-overlays-DJoIfr1y.mjs → player-overlays-COKQa37c.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-C9bIj-Co.mjs → responsive-BPlFvtSt.mjs} +1 -1
  13. package/dist/{square-DN891EHD.mjs → square-BhmFshyv.mjs} +1 -1
  14. package/dist/{trash-2-CVuZp_eM.mjs → trash-2-Bfyk6oRp.mjs} +1 -1
  15. package/dist/{use-device-snapshot-BOoUcvYJ.mjs → use-device-snapshot-CbUEtNq7.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-u47fvw-t.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-CKsyFdWi.mjs} +1 -1
  17. package/package.json +1 -1
  18. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BsLq9Hga.mjs +0 -26
package/dist/index.js CHANGED
@@ -7625,6 +7625,66 @@ var OpsLogQueryInputSchema = object({
7625
7625
  /** Max rows returned, newest-first. */
7626
7626
  limit: number().int().min(1).max(1e3).optional()
7627
7627
  });
7628
+ var LabelDefinitionSchema = object({
7629
+ id: string(),
7630
+ name: string(),
7631
+ category: string().optional(),
7632
+ description: string().optional(),
7633
+ icon: string().optional()
7634
+ });
7635
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
7636
+ var CLASS_MAP_MACRO_TARGETS = [
7637
+ "person",
7638
+ "vehicle",
7639
+ "animal",
7640
+ "package"
7641
+ ];
7642
+ /**
7643
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
7644
+ * un operatore può selezionare.
7645
+ *
7646
+ * Sono le tre offerte dallo step `object-detection`
7647
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
7648
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
7649
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
7650
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
7651
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
7652
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
7653
+ *
7654
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
7655
+ * dello step e una seconda volta come union `FirstLevelMacro`
7656
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
7657
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
7658
+ * successiva.
7659
+ */
7660
+ var FIRST_LEVEL_MACRO_CLASSES = [
7661
+ "person",
7662
+ "vehicle",
7663
+ "animal"
7664
+ ];
7665
+ /**
7666
+ * Wire schema for a per-model CATALOG classMap override
7667
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
7668
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
7669
+ * detection pipeline executor actually routes.
7670
+ *
7671
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
7672
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
7673
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
7674
+ * enum) — the two used to share the name `ClassMapDefinition`/
7675
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
7676
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
7677
+ * are not: it is two different concepts colliding on a name. Keep this type
7678
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
7679
+ * would either narrow every `ClassMapDefinition` consumer to the four
7680
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
7681
+ * schema exists for (see the "rejects a classMap whose target is not a
7682
+ * detection macro" test in `model-catalog-schema.test.ts`).
7683
+ */
7684
+ var DetectionCatalogClassMapSchema = object({
7685
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
7686
+ preserveOriginal: boolean()
7687
+ });
7628
7688
  /**
7629
7689
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
7630
7690
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -7647,10 +7707,55 @@ var RecordingStorageModeSchema = _enum([
7647
7707
  "events",
7648
7708
  "continuous"
7649
7709
  ]);
7710
+ /**
7711
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
7712
+ * tre offerte dallo step `object-detection`, da UNA lista
7713
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
7714
+ */
7715
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
7716
+ /**
7717
+ * True quando `values` non ripete un elemento.
7718
+ *
7719
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
7720
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
7721
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
7722
+ */
7723
+ var noDuplicates = (values) => new Set(values).size === values.length;
7650
7724
  /** Which detectors trigger an `events`-mode band. */
7651
7725
  var RecordingTriggersSchema = object({
7652
7726
  motion: boolean().optional(),
7653
- audioThresholdDbfs: number().optional()
7727
+ audioThresholdDbfs: number().optional(),
7728
+ /**
7729
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
7730
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
7731
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
7732
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
7733
+ *
7734
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
7735
+ * quelle che hanno attraversato `enabledMacroClasses`, i
7736
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
7737
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
7738
+ * finestre — vedi `recorder/object-trigger.ts`.
7739
+ */
7740
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
7741
+ /**
7742
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
7743
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
7744
+ * `objectClasses`.
7745
+ *
7746
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
7747
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
7748
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
7749
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
7750
+ * device (D12) — mai un elenco globale di cap.
7751
+ *
7752
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
7753
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
7754
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
7755
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
7756
+ * registrare.
7757
+ */
7758
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7654
7759
  });
7655
7760
  /**
7656
7761
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8102,41 +8207,6 @@ var DecoderSessionConfigSchema = object({
8102
8207
  */
8103
8208
  debug: boolean().optional()
8104
8209
  });
8105
- var LabelDefinitionSchema = object({
8106
- id: string(),
8107
- name: string(),
8108
- category: string().optional(),
8109
- description: string().optional(),
8110
- icon: string().optional()
8111
- });
8112
- /**
8113
- * Wire schema for a per-model CATALOG classMap override
8114
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8115
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8116
- * detection pipeline executor actually routes.
8117
- *
8118
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8119
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8120
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8121
- * enum) — the two used to share the name `ClassMapDefinition`/
8122
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8123
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8124
- * are not: it is two different concepts colliding on a name. Keep this type
8125
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
8126
- * would either narrow every `ClassMapDefinition` consumer to the four
8127
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8128
- * schema exists for (see the "rejects a classMap whose target is not a
8129
- * detection macro" test in `model-catalog-schema.test.ts`).
8130
- */
8131
- var DetectionCatalogClassMapSchema = object({
8132
- mapping: record(string(), _enum([
8133
- "person",
8134
- "vehicle",
8135
- "animal",
8136
- "package"
8137
- ])),
8138
- preserveOriginal: boolean()
8139
- });
8140
8210
  var MODEL_FORMATS = [
8141
8211
  "onnx",
8142
8212
  "coreml",
@@ -25104,7 +25174,7 @@ var lifecycleJobSchema = object({
25104
25174
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
25105
25175
  * as every other cap.
25106
25176
  */
25107
- var LogLevelSchema$1 = _enum([
25177
+ var LogLevelSchema$2 = _enum([
25108
25178
  "debug",
25109
25179
  "info",
25110
25180
  "warn",
@@ -25331,7 +25401,7 @@ var addonsCapability = {
25331
25401
  getLogs: method(object({
25332
25402
  addonId: string(),
25333
25403
  limit: number().min(1).max(500).default(100),
25334
- level: LogLevelSchema$1.optional()
25404
+ level: LogLevelSchema$2.optional()
25335
25405
  }), array(LogQueryEntrySchema)),
25336
25406
  listPackages: method(_void(), array(InstalledPackageSchema).readonly()),
25337
25407
  installPackage: method(object({
@@ -25569,7 +25639,7 @@ var addonsCapability = {
25569
25639
  }),
25570
25640
  onAddonLogs: method(object({
25571
25641
  addonId: string(),
25572
- level: LogLevelSchema$1.optional()
25642
+ level: LogLevelSchema$2.optional()
25573
25643
  }), LogStreamEntrySchema, { kind: "subscription" })
25574
25644
  },
25575
25645
  /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
@@ -27356,6 +27426,35 @@ var FaceFilterEnum = _enum([
27356
27426
  "identified",
27357
27427
  "all"
27358
27428
  ]);
27429
+ /**
27430
+ * What a `listRecentFaces` page is ORDERED BY.
27431
+ *
27432
+ * - `timestamp` — when the face was seen. The historical (and default) order.
27433
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
27434
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
27435
+ * order: it puts the suggestions an operator can confirm with one tap at the
27436
+ * top, and it is the reason this enum exists — a client that ranked a capped
27437
+ * page client-side was ranking the newest N, never the most certain N.
27438
+ *
27439
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
27440
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
27441
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
27442
+ * — flipping the direction reorders the rows that HAVE a certainty and never
27443
+ * floods the page with the ones that do not. `addon-post-analysis`'s
27444
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
27445
+ * then by faceId, and is what makes this a total order instead of the
27446
+ * backend's NULL-collation accident.
27447
+ */
27448
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
27449
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
27450
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
27451
+ * never leaves the server. */
27452
+ var FaceClusterSchema = object({
27453
+ faceIds: array(string()).readonly(),
27454
+ representativeFaceId: string(),
27455
+ size: number().int(),
27456
+ cohesion: number()
27457
+ });
27359
27458
  var MediaFileLiteSchema$1 = object({
27360
27459
  key: string(),
27361
27460
  kind: string(),
@@ -27413,24 +27512,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
27413
27512
  auth: "admin"
27414
27513
  }),
27415
27514
  listRecentFaces: method(object({
27416
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
27515
+ /**
27516
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
27517
+ *
27518
+ * The legacy single-camera form, kept verbatim for every caller that
27519
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
27520
+ * instead — never both: `deviceIds` is the authority whenever it is
27521
+ * present, and this field is then ignored rather than unioned, so
27522
+ * there is exactly one answer to "which cameras did I ask for".
27523
+ */
27417
27524
  deviceId: number().int().optional(),
27525
+ /**
27526
+ * Restrict to a SET of cameras — the review UI's camera filter, which
27527
+ * until now had to fetch the cluster-wide page and drop rows in the
27528
+ * client (so the `limit` it asked for was spent on cameras it was
27529
+ * about to discard).
27530
+ *
27531
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
27532
+ * "every camera". A request for no devices is a request, not an
27533
+ * omission; same contract as `deviceManager.listFleet` and
27534
+ * `pipelineAnalytics.listRecentTracks`.
27535
+ *
27536
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
27537
+ */
27538
+ deviceIds: array(number().int()).optional(),
27418
27539
  limit: number().int().positive().optional(),
27419
27540
  filter: FaceFilterEnum.optional(),
27420
27541
  /**
27421
- * Inline the base64 crop on every row. Default `true` — the existing
27422
- * behaviour, kept so no caller breaks.
27542
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
27543
+ * Absent means no lower bound.
27544
+ */
27545
+ since: number().int().optional(),
27546
+ /**
27547
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
27548
+ * Absent means no upper bound.
27549
+ */
27550
+ until: number().int().optional(),
27551
+ /**
27552
+ * Order the page by time or by suggestion certainty. Default
27553
+ * `'timestamp'` — the historical order, unchanged for every caller
27554
+ * that does not ask.
27423
27555
  *
27424
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
27425
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
27426
- * the browser cache the images.
27556
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
27557
+ * does under `'suggestionConfidence'`.
27427
27558
  *
27428
- * **This is an INPUT field, so it does not reach the addon until the
27429
- * next train.** The hub router validates cap inputs against its own
27430
- * compiled Zod, which strips a key it does not know verified today
27431
- * on the OUTPUT side, where an additive field DOES arrive immediately
27432
- * (`Track.hasFace`). Until the train ships, sending `false` is
27433
- * harmless and simply keeps the crops inline.
27559
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
27560
+ * index and stops reading as soon as `limit` rows have PASSED the
27561
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
27562
+ * certain row may be the oldest so it walks the window. Narrow it
27563
+ * with {@link since} / {@link until}.
27564
+ */
27565
+ sortBy: FaceSortFieldEnum.optional(),
27566
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
27567
+ sortDirection: FaceSortDirectionEnum.optional(),
27568
+ /**
27569
+ * Inline the base64 crop on every row.
27570
+ *
27571
+ * Default `false` since the 2026-08-25 inversion — see
27572
+ * `include-crops-default.ts`, which is the ONE place that resolves
27573
+ * this for every gallery, and which records why the inline shape had
27574
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
27575
+ * The doc here used to still say `true`; it was wrong, and a leftover
27576
+ * that describes the old design reads as permission to rely on it.
27577
+ *
27578
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
27579
+ * which the browser fetches off the `event-media` plane in parallel,
27580
+ * cached and ETagged.
27434
27581
  */
27435
27582
  includeCrops: boolean().optional()
27436
27583
  }).optional(), array(FaceInfoSchema).readonly()),
@@ -27479,13 +27626,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
27479
27626
  suggestFaceClusters: method(object({
27480
27627
  threshold: number().min(0).max(1).optional(),
27481
27628
  minClusterSize: number().int().min(2).optional(),
27482
- limit: number().int().positive().optional()
27483
- }).optional(), array(object({
27484
- faceIds: array(string()).readonly(),
27485
- representativeFaceId: string(),
27486
- size: number().int(),
27487
- cohesion: number()
27488
- })).readonly())
27629
+ /**
27630
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
27631
+ * which read as though it bounded the work — it never did.
27632
+ *
27633
+ * Wins over {@link limit} when both are sent.
27634
+ */
27635
+ maxClusters: number().int().positive().optional(),
27636
+ /**
27637
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
27638
+ * RESULT, not the scan. Kept so existing callers keep working; send
27639
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
27640
+ */
27641
+ limit: number().int().positive().optional(),
27642
+ /**
27643
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
27644
+ * POOL, not the result.
27645
+ *
27646
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
27647
+ * used to read every unassigned face on the hub no matter what the
27648
+ * caller asked for, because the only bound cut the finished clusters
27649
+ * afterwards; a UI showing a window of 100 paid for a scan of the
27650
+ * whole corpus, on an addon whose disk is under contention.
27651
+ *
27652
+ * The pool is the NEWEST matching faces first — the same order the
27653
+ * gallery shows — so a bound here shortens the horizon, it does not
27654
+ * sample it randomly.
27655
+ *
27656
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
27657
+ * so the live corpus — 372 face rows — is unaffected while the
27658
+ * unbounded scan can never come back as the table grows.
27659
+ */
27660
+ maxFacesScanned: number().int().positive().optional()
27661
+ }).optional(), array(FaceClusterSchema).readonly())
27489
27662
  }
27490
27663
  };
27491
27664
  /**
@@ -33022,6 +33195,293 @@ var SetSiteLocationInputSchema = object({
33022
33195
  latitude: number().min(-90).max(90),
33023
33196
  longitude: number().min(-180).max(180)
33024
33197
  }).nullable();
33198
+ /**
33199
+ * The TRANSPORT a call arrived on.
33200
+ *
33201
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
33202
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
33203
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
33204
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
33205
+ * checkable rather than asserted.
33206
+ *
33207
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
33208
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
33209
+ * connection; the viewer talks to the hub over `wsLink`
33210
+ * exclusively, so this is the plane the HTTP census could not see.
33211
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
33212
+ * never touches a socket and therefore never touched a census.
33213
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
33214
+ * that is exactly what its `0` asserts: every plane the hub has can name
33215
+ * itself. It is an output bucket, never a knob — a call that arrives on a
33216
+ * plane nobody instrumented lands here instead of vanishing from the total.
33217
+ */
33218
+ var TransportPlaneSchema = _enum([
33219
+ "http",
33220
+ "ws",
33221
+ "mesh",
33222
+ "unknown"
33223
+ ]);
33224
+ /**
33225
+ * Calls per plane. Every key is always present, `0` included — an absent plane
33226
+ * reads as "not instrumented", which is the one thing this census must never
33227
+ * make an operator wonder about.
33228
+ */
33229
+ var TransportPlaneCountsSchema = object({
33230
+ http: number(),
33231
+ ws: number(),
33232
+ mesh: number(),
33233
+ unknown: number()
33234
+ });
33235
+ /**
33236
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
33237
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
33238
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
33239
+ * already prints - never a token, never an `Authorization` header.
33240
+ *
33241
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
33242
+ * and lives for hours, so folding it into a call count makes one long-lived
33243
+ * stream look like a storm.
33244
+ */
33245
+ var RequestCensusGroupSchema = object({
33246
+ plane: TransportPlaneSchema,
33247
+ procedure: string(),
33248
+ userAgent: string(),
33249
+ ip: string(),
33250
+ principal: string(),
33251
+ calls: number(),
33252
+ subscriptions: number(),
33253
+ perMin: number()
33254
+ });
33255
+ /**
33256
+ * A procedure's TOTAL over the window, across every caller.
33257
+ *
33258
+ * This block, not the group list, is what answers "did these calls arrive over
33259
+ * HTTP at all". A total far BELOW what a store-side census counted over the
33260
+ * same window excludes the HTTP plane, which is a result, not a failure.
33261
+ */
33262
+ var RequestCensusProcedureSchema = object({
33263
+ procedure: string(),
33264
+ calls: number(),
33265
+ /**
33266
+ * The same total, split by transport. THIS is the row that answers the
33267
+ * question the census exists for: one look at `deviceManager.listAll` says
33268
+ * which plane carried the 4 960, without joining two log lines by eye.
33269
+ */
33270
+ planes: TransportPlaneCountsSchema,
33271
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
33272
+ subscriptions: number(),
33273
+ perMin: number()
33274
+ });
33275
+ /**
33276
+ * The census as an operator sees it.
33277
+ *
33278
+ * `persisted` is the honest answer to "will this survive the restart I am
33279
+ * about to do": the arm deadline is written to `system-settings` so a window
33280
+ * armed now can measure the NEXT boot, and a write that failed must not look
33281
+ * like one that succeeded.
33282
+ */
33283
+ var RequestCensusStatusSchema = object({
33284
+ armed: boolean(),
33285
+ /** How long the current - or just-closed - window collected, in ms. */
33286
+ elapsedMs: number(),
33287
+ /** The window actually armed, after the server clamped the request. */
33288
+ windowMs: number(),
33289
+ /** Epoch ms the window closes at. 0 when disarmed. */
33290
+ armedUntilMs: number(),
33291
+ httpRequests: number(),
33292
+ batchedRequests: number(),
33293
+ /**
33294
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
33295
+ * is in play (`?batch=1` carries several procedures in one request); this is
33296
+ * the number comparable with a store-side call count.
33297
+ */
33298
+ procedureCalls: number(),
33299
+ /**
33300
+ * `procedureCalls` split by transport. The four keys sum to
33301
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
33302
+ * `planesExplainTotal` is that identity, checked rather than assumed.
33303
+ */
33304
+ planes: TransportPlaneCountsSchema,
33305
+ /**
33306
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
33307
+ * on no plane at all - which is a RESULT (a plane is missing from the
33308
+ * instrument), not a failure, and it has to be visible to be read as one.
33309
+ */
33310
+ planesExplainTotal: boolean(),
33311
+ /**
33312
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
33313
+ * adapter resolves one context per connection - kept because a plane's call
33314
+ * count of zero against 37 open connections says something different from a
33315
+ * plane with no connections at all.
33316
+ */
33317
+ wsConnections: number(),
33318
+ /**
33319
+ * Client frames the WS plane looked at. `wsMessages` far above
33320
+ * `planes.ws + subscriptions` means most traffic is not operations
33321
+ * (keepalives, connection params) - which is itself an answer.
33322
+ */
33323
+ wsMessages: number(),
33324
+ /**
33325
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
33326
+ * purpose: one live-events stream opened at boot and held for six hours is
33327
+ * one subscription, and counting it as a call would let a quiet plane
33328
+ * masquerade as the storm.
33329
+ */
33330
+ subscriptions: number(),
33331
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
33332
+ subscriptionStops: number(),
33333
+ distinctGroups: number(),
33334
+ /**
33335
+ * Operations counted in the totals whose CALLER attribution was shed at the
33336
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
33337
+ * which transport they arrived on, they just lost their group row.
33338
+ */
33339
+ unattributedCalls: number(),
33340
+ procedures: array(RequestCensusProcedureSchema).readonly(),
33341
+ groups: array(RequestCensusGroupSchema).readonly()
33342
+ }).extend({ persisted: boolean() });
33343
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
33344
+ var LogLevelSchema$1 = _enum([
33345
+ "debug",
33346
+ "info",
33347
+ "warn",
33348
+ "error"
33349
+ ]);
33350
+ /**
33351
+ * The diagnostics that can be ARMED for a window. Exactly one today.
33352
+ *
33353
+ * A diagnostic is anything whose cost is only worth paying while a question is
33354
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
33355
+ */
33356
+ var DiagnosticIdSchema = _enum(["request-census"]);
33357
+ /**
33358
+ * The layers of the level hierarchy, general → specific. The most specific
33359
+ * layer that carries an explicit value wins.
33360
+ *
33361
+ * `component` is DECLARED and not yet resolvable: the per-component channels
33362
+ * are a later slice of the same plan, and a `levelSource` enum that has to
33363
+ * grow later would force every consumer of this document to change with it.
33364
+ * Nothing returns `component` today.
33365
+ */
33366
+ var LoggingScopeKindSchema = _enum([
33367
+ "cluster",
33368
+ "node",
33369
+ "component"
33370
+ ]);
33371
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
33372
+ var LoggingLevelSourceSchema = _enum([
33373
+ "default",
33374
+ "cluster",
33375
+ "node",
33376
+ "component"
33377
+ ]);
33378
+ /**
33379
+ * One layer of the hierarchy as it actually STANDS.
33380
+ *
33381
+ * `level: null` is the whole reason this array is returned: it is the
33382
+ * difference between "this node is at `info` because I decided it" and
33383
+ * "...because it inherits". An operator who clears an override believing they
33384
+ * are clearing an inherited value has been handed the same defect as the two
33385
+ * contradicting knobs this document exists to remove, moved one floor up.
33386
+ */
33387
+ var LoggingLevelLayerSchema = object({
33388
+ scope: LoggingScopeKindSchema,
33389
+ /** The node this layer speaks for; `null` on the cluster layer. */
33390
+ nodeId: string().nullable(),
33391
+ /** Explicitly set here, or `null` when this layer inherits. */
33392
+ level: LogLevelSchema$1.nullable()
33393
+ });
33394
+ /** What a line is judged against, and WHICH layer decided it. */
33395
+ var LoggingEffectiveSchema = object({
33396
+ level: LogLevelSchema$1,
33397
+ levelSource: LoggingLevelSourceSchema
33398
+ });
33399
+ /** Every layer, general → specific. Never collapsed into the effective value. */
33400
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
33401
+ /**
33402
+ * An armed diagnostic, with its DEADLINE.
33403
+ *
33404
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
33405
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
33406
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
33407
+ * `armed` is false — a window is never reported as slightly expired.
33408
+ */
33409
+ var DiagnosticWindowSchema = object({
33410
+ id: DiagnosticIdSchema,
33411
+ armed: boolean(),
33412
+ /** Epoch ms the window closes at. 0 when disarmed. */
33413
+ armedUntilMs: number(),
33414
+ /** Ms left before it expires on its own. 0 when disarmed. */
33415
+ remainingMs: number(),
33416
+ /** Whether the stored deadline is the one the live diagnostic is running —
33417
+ * i.e. whether this window would survive a restart. */
33418
+ persisted: boolean()
33419
+ });
33420
+ /**
33421
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
33422
+ * server — there is no maximum here on purpose: a bound repeated in a schema
33423
+ * is a second knob that disagrees with the first the day one of them moves.
33424
+ */
33425
+ var DiagnosticWindowPatchSchema = object({
33426
+ id: DiagnosticIdSchema,
33427
+ armMs: number().int().min(0),
33428
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
33429
+ reportEveryMs: number().int().positive().optional()
33430
+ });
33431
+ /**
33432
+ * A PATCH, and patches MERGE.
33433
+ *
33434
+ * A field absent from the patch is left exactly as it was — arming a
33435
+ * diagnostic never resets a level, and setting a level never disarms a window.
33436
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
33437
+ * `setAll` already merges, and rebuilding the object is how an absent field
33438
+ * turns into an erased one.
33439
+ */
33440
+ var LoggingSettingsPatchSchema = object({
33441
+ /**
33442
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
33443
+ * addressed scope so it inherits again. A value sets it.
33444
+ */
33445
+ level: LogLevelSchema$1.nullable().optional(),
33446
+ /**
33447
+ * Only the diagnostics NAMED here change. An armed window that is not listed
33448
+ * keeps running — a patch is never a full replacement.
33449
+ */
33450
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
33451
+ });
33452
+ /**
33453
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
33454
+ *
33455
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
33456
+ * input — the generated router strips it and uses it to resolve the PROVIDER
33457
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
33458
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
33459
+ * by an agent that holds no cluster document at all. The hub is the single
33460
+ * authority over the whole hierarchy and answers for every layer, so the
33461
+ * layer selector needs a name the transport does not already own.
33462
+ */
33463
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
33464
+ var SetLoggingSettingsInputSchema = object({
33465
+ scopeNodeId: string().optional(),
33466
+ patch: LoggingSettingsPatchSchema
33467
+ });
33468
+ /**
33469
+ * The whole document, as read and as returned after every write.
33470
+ *
33471
+ * `persisted: false` means the settings store could not be read or written.
33472
+ * The in-memory mirror still governs behaviour and is unchanged by the
33473
+ * failure — a read that fails neither switches a level nor disarms a window
33474
+ * (D49) — but the operator is told that what they are looking at would not
33475
+ * survive a restart.
33476
+ */
33477
+ var LoggingSettingsStateSchema = object({
33478
+ /** The layer this document was read at. `null` = the cluster layer. */
33479
+ scopeNodeId: string().nullable(),
33480
+ effective: LoggingEffectiveSchema,
33481
+ explicit: LoggingExplicitSchema,
33482
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
33483
+ persisted: boolean()
33484
+ });
33025
33485
  var systemCapability = {
33026
33486
  name: "system",
33027
33487
  scope: "system",
@@ -33065,6 +33525,38 @@ var systemCapability = {
33065
33525
  detectSiteLocation: method(_void(), SiteLocationStatusSchema, {
33066
33526
  kind: "mutation",
33067
33527
  auth: "admin"
33528
+ }),
33529
+ /**
33530
+ * Read the HTTP request census - which caller, from which address, with
33531
+ * which user-agent, invoked which tRPC procedure, and how often.
33532
+ *
33533
+ * Reading NEVER re-arms: re-arming clears the counts, which would throw
33534
+ * away exactly the numbers being asked for. A closed window may be read as
33535
+ * many times as the operator likes and always describes the same window.
33536
+ *
33537
+ * Admin-only: the rows carry source addresses and principal names.
33538
+ */
33539
+ getRequestCensus: method(_void(), RequestCensusStatusSchema, { auth: "admin" }),
33540
+ /**
33541
+ * The logging settings document — levels and armed diagnostics — resolved
33542
+ * for `nodeId`, or for the cluster when `nodeId` is absent.
33543
+ *
33544
+ * Returns BOTH `effective` and `explicit`. See
33545
+ * {@link LoggingLevelLayerSchema} for why collapsing them is the defect.
33546
+ */
33547
+ getLoggingSettings: method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }),
33548
+ /**
33549
+ * Write the logging settings document. The ONLY write authority over log
33550
+ * levels and diagnostic windows — arming the request census went through
33551
+ * `system.setRequestCensus` until 2026-08-27 and no longer does, because
33552
+ * two writes that disagree about the same window is exactly the defect
33553
+ * this document exists to remove (D245).
33554
+ *
33555
+ * The patch MERGES: see {@link LoggingSettingsPatchSchema}.
33556
+ */
33557
+ setLoggingSettings: method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
33558
+ kind: "mutation",
33559
+ auth: "admin"
33068
33560
  })
33069
33561
  },
33070
33562
  /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
@@ -39534,6 +40026,18 @@ Object.freeze({
39534
40026
  addonId: null,
39535
40027
  access: "create"
39536
40028
  },
40029
+ "system.getLoggingSettings": {
40030
+ capName: "system",
40031
+ capScope: "system",
40032
+ addonId: null,
40033
+ access: "view"
40034
+ },
40035
+ "system.getRequestCensus": {
40036
+ capName: "system",
40037
+ capScope: "system",
40038
+ addonId: null,
40039
+ access: "view"
40040
+ },
39537
40041
  "system.getRetentionConfig": {
39538
40042
  capName: "system",
39539
40043
  capScope: "system",
@@ -39564,6 +40068,12 @@ Object.freeze({
39564
40068
  addonId: null,
39565
40069
  access: "view"
39566
40070
  },
40071
+ "system.setLoggingSettings": {
40072
+ capName: "system",
40073
+ capScope: "system",
40074
+ addonId: null,
40075
+ access: "create"
40076
+ },
39567
40077
  "system.setRetentionConfig": {
39568
40078
  capName: "system",
39569
40079
  capScope: "system",
@@ -40719,6 +41229,10 @@ Object.freeze({
40719
41229
  name: "deviceId",
40720
41230
  form: "single",
40721
41231
  optional: true
41232
+ }, {
41233
+ name: "deviceIds",
41234
+ form: "array",
41235
+ optional: true
40722
41236
  }],
40723
41237
  "fanControl.setDirection": [{
40724
41238
  name: "deviceId",
@@ -42389,7 +42903,38 @@ object({
42389
42903
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
42390
42904
  * reproduce that.
42391
42905
  */
42392
- tileBudgetMb: number().int().min(0).max(1024)
42906
+ tileBudgetMb: number().int().min(0).max(1024),
42907
+ /**
42908
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
42909
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
42910
+ * subject tiles, on frames that detected something.
42911
+ *
42912
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
42913
+ * containment is strict by design, so the native `keyFrame`, the detail
42914
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
42915
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
42916
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
42917
+ * frame-time after delivery, with the request only p50 367 ms behind it.
42918
+ *
42919
+ * Sizing, and why this is a budget and not a duration: a scene tile is
42920
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
42921
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
42922
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
42923
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
42924
+ * binds only through a detection burst, where it still covers well past the
42925
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
42926
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
42927
+ * whole shape exists to avoid.
42928
+ *
42929
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
42930
+ * subject tile, so one shared budget would let a busy camera's key frames
42931
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
42932
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
42933
+ * pre-existing behaviour, where a late full-frame request had nothing but the
42934
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
42935
+ * nothing.
42936
+ */
42937
+ sceneBudgetMb: number().int().min(0).max(1024)
42393
42938
  });
42394
42939
  /**
42395
42940
  * The values in force when the operator has set nothing.
@@ -42405,12 +42950,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
42405
42950
  budgetMb: 1024,
42406
42951
  activityMs: 15e3,
42407
42952
  tileBudgetMb: 64,
42953
+ sceneBudgetMb: 48,
42408
42954
  admission: "inferred"
42409
42955
  };
42410
42956
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
42411
42957
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
42412
42958
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
42413
42959
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
42960
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
42414
42961
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
42415
42962
  var MB = 1024 * 1024;
42416
42963
  1024 * MB, 3072 * MB;