@camstack/addon-pipeline 1.2.132 → 1.2.133

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 (36) hide show
  1. package/dist/{addon-utils-DzCn6z7v.js → addon-utils-FV2O25id.js} +1 -1
  2. package/dist/audio-analyzer/index.js +3 -3
  3. package/dist/audio-analyzer/index.mjs +2 -2
  4. package/dist/detection-pipeline/index.js +5 -5
  5. package/dist/detection-pipeline/index.mjs +3 -3
  6. package/dist/{dist-BZYUUBUx.mjs → dist-7Uc6NdFm.mjs} +653 -65
  7. package/dist/{dist-DBP47QOz.js → dist-DsnZUYTs.js} +670 -64
  8. package/dist/{event-loop-stall-monitor-CiH_MHfO.js → event-loop-stall-monitor-D86J6d2c.js} +1 -1
  9. package/dist/{event-loop-stall-monitor-IACE22fK.mjs → event-loop-stall-monitor-XzDMVU9d.mjs} +1 -1
  10. package/dist/{lazy-sharp-B_kETjyQ.js → lazy-sharp-UzEUL79V.js} +1 -1
  11. package/dist/motion-wasm/index.js +2 -2
  12. package/dist/motion-wasm/index.mjs +1 -1
  13. package/dist/pipeline-runner/index.js +4 -4
  14. package/dist/pipeline-runner/index.mjs +3 -3
  15. package/dist/{process-memory-C7rsraCR.mjs → process-memory-Ci90-zF_.mjs} +1 -1
  16. package/dist/{process-memory-CtXQAA3d.js → process-memory-Co59RQIK.js} +1 -1
  17. package/dist/recorder/index.js +446 -86
  18. package/dist/recorder/index.mjs +445 -85
  19. package/dist/{segment-demux-js-BL1UDdiI.mjs → segment-demux-js-0NZ9TXro.mjs} +1 -1
  20. package/dist/{segment-demux-js-wTzFi5UW.js → segment-demux-js-DKcc0bxA.js} +1 -1
  21. package/dist/session-decode/decode-worker-child.js +195 -13
  22. package/dist/session-decode/decode-worker-child.mjs +194 -12
  23. package/dist/stream-broker/_stub.js +2 -2
  24. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DlKJZ-_M.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Dqj2f3H7.mjs} +3 -3
  25. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CVBnNONy.mjs +26 -0
  26. package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BUw_aTfK.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-77rGxv1J.mjs} +1 -1
  27. package/dist/stream-broker/demux-worker-child.js +1 -1
  28. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  29. package/dist/stream-broker/{hostInit-kDKgfUjp.mjs → hostInit-DnwyBL4I.mjs} +3 -3
  30. package/dist/stream-broker/index.js +2 -2
  31. package/dist/stream-broker/index.mjs +2 -2
  32. package/dist/stream-broker/remoteEntry.js +1 -1
  33. package/dist/{worker-protocol-Cut8984B.mjs → worker-protocol-CMDUAqvX.mjs} +12 -6
  34. package/dist/{worker-protocol-C3zaz0Jv.js → worker-protocol-DzRUHIcM.js} +12 -6
  35. package/package.json +1 -1
  36. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DXKTNEae.mjs +0 -26
@@ -8471,6 +8471,74 @@ var OpsLogQueryInputSchema = object({
8471
8471
  /** Max rows returned, newest-first. */
8472
8472
  limit: number().int().min(1).max(1e3).optional()
8473
8473
  });
8474
+ var LabelDefinitionSchema = object({
8475
+ id: string(),
8476
+ name: string(),
8477
+ category: string().optional(),
8478
+ description: string().optional(),
8479
+ icon: string().optional()
8480
+ });
8481
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
8482
+ var CLASS_MAP_MACRO_TARGETS = [
8483
+ "person",
8484
+ "vehicle",
8485
+ "animal",
8486
+ "package"
8487
+ ];
8488
+ /**
8489
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
8490
+ * un operatore può selezionare.
8491
+ *
8492
+ * Sono le tre offerte dallo step `object-detection`
8493
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
8494
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
8495
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
8496
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
8497
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
8498
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
8499
+ *
8500
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
8501
+ * dello step e una seconda volta come union `FirstLevelMacro`
8502
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
8503
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
8504
+ * successiva.
8505
+ */
8506
+ var FIRST_LEVEL_MACRO_CLASSES = [
8507
+ "person",
8508
+ "vehicle",
8509
+ "animal"
8510
+ ];
8511
+ /**
8512
+ * True quando `value` è una macro di primo livello. Type guard, non cast: un
8513
+ * `className` che arriva dal bus è una stringa qualunque finché non passa di
8514
+ * qui.
8515
+ */
8516
+ function isFirstLevelMacroClass(value) {
8517
+ return FIRST_LEVEL_MACRO_CLASSES.some((macro) => macro === value);
8518
+ }
8519
+ /**
8520
+ * Wire schema for a per-model CATALOG classMap override
8521
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
8522
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
8523
+ * detection pipeline executor actually routes.
8524
+ *
8525
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
8526
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
8527
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
8528
+ * enum) — the two used to share the name `ClassMapDefinition`/
8529
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
8530
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
8531
+ * are not: it is two different concepts colliding on a name. Keep this type
8532
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
8533
+ * would either narrow every `ClassMapDefinition` consumer to the four
8534
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
8535
+ * schema exists for (see the "rejects a classMap whose target is not a
8536
+ * detection macro" test in `model-catalog-schema.test.ts`).
8537
+ */
8538
+ var DetectionCatalogClassMapSchema = object({
8539
+ mapping: record(string(), _enum(CLASS_MAP_MACRO_TARGETS)),
8540
+ preserveOriginal: boolean()
8541
+ });
8474
8542
  /**
8475
8543
  * THE canonical event-clip pad: the time window a single-timestamp analytics
8476
8544
  * event expands to when joined with footage (clip window = `[timestamp - preMs,
@@ -8512,10 +8580,55 @@ var RecordingStorageModeSchema = _enum([
8512
8580
  "events",
8513
8581
  "continuous"
8514
8582
  ]);
8583
+ /**
8584
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
8585
+ * tre offerte dallo step `object-detection`, da UNA lista
8586
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
8587
+ */
8588
+ var RecordingObjectTriggerClassSchema = _enum(FIRST_LEVEL_MACRO_CLASSES);
8589
+ /**
8590
+ * True quando `values` non ripete un elemento.
8591
+ *
8592
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
8593
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
8594
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
8595
+ */
8596
+ var noDuplicates = (values) => new Set(values).size === values.length;
8515
8597
  /** Which detectors trigger an `events`-mode band. */
8516
8598
  var RecordingTriggersSchema = object({
8517
8599
  motion: boolean().optional(),
8518
- audioThresholdDbfs: number().optional()
8600
+ audioThresholdDbfs: number().optional(),
8601
+ /**
8602
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
8603
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
8604
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
8605
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
8606
+ *
8607
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
8608
+ * quelle che hanno attraversato `enabledMacroClasses`, i
8609
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
8610
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
8611
+ * finestre — vedi `recorder/object-trigger.ts`.
8612
+ */
8613
+ objectClasses: array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
8614
+ /**
8615
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
8616
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
8617
+ * `objectClasses`.
8618
+ *
8619
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
8620
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
8621
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
8622
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
8623
+ * device (D12) — mai un elenco globale di cap.
8624
+ *
8625
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
8626
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
8627
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
8628
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
8629
+ * registrare.
8630
+ */
8631
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8519
8632
  });
8520
8633
  /**
8521
8634
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -9041,41 +9154,6 @@ var DecoderSessionConfigSchema = object({
9041
9154
  */
9042
9155
  debug: boolean().optional()
9043
9156
  });
9044
- var LabelDefinitionSchema = object({
9045
- id: string(),
9046
- name: string(),
9047
- category: string().optional(),
9048
- description: string().optional(),
9049
- icon: string().optional()
9050
- });
9051
- /**
9052
- * Wire schema for a per-model CATALOG classMap override
9053
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
9054
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
9055
- * detection pipeline executor actually routes.
9056
- *
9057
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
9058
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
9059
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
9060
- * enum) — the two used to share the name `ClassMapDefinition`/
9061
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
9062
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
9063
- * are not: it is two different concepts colliding on a name. Keep this type
9064
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
9065
- * would either narrow every `ClassMapDefinition` consumer to the four
9066
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
9067
- * schema exists for (see the "rejects a classMap whose target is not a
9068
- * detection macro" test in `model-catalog-schema.test.ts`).
9069
- */
9070
- var DetectionCatalogClassMapSchema = object({
9071
- mapping: record(string(), _enum([
9072
- "person",
9073
- "vehicle",
9074
- "animal",
9075
- "package"
9076
- ])),
9077
- preserveOriginal: boolean()
9078
- });
9079
9157
  var MODEL_FORMATS = [
9080
9158
  "onnx",
9081
9159
  "coreml",
@@ -23096,7 +23174,7 @@ var lifecycleJobSchema = object({
23096
23174
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
23097
23175
  * as every other cap.
23098
23176
  */
23099
- var LogLevelSchema$1 = _enum([
23177
+ var LogLevelSchema$2 = _enum([
23100
23178
  "debug",
23101
23179
  "info",
23102
23180
  "warn",
@@ -23303,7 +23381,7 @@ var CustomActionInputSchema = object({
23303
23381
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
23304
23382
  addonId: string(),
23305
23383
  limit: number().min(1).max(500).default(100),
23306
- level: LogLevelSchema$1.optional()
23384
+ level: LogLevelSchema$2.optional()
23307
23385
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
23308
23386
  packageName: string(),
23309
23387
  version: string().optional()
@@ -23401,7 +23479,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
23401
23479
  auth: "admin"
23402
23480
  }), method(object({
23403
23481
  addonId: string(),
23404
- level: LogLevelSchema$1.optional()
23482
+ level: LogLevelSchema$2.optional()
23405
23483
  }), LogStreamEntrySchema, { kind: "subscription" });
23406
23484
  object({
23407
23485
  /** Carbon dioxide concentration in ppm. */
@@ -24462,6 +24540,35 @@ var FaceFilterEnum = _enum([
24462
24540
  "identified",
24463
24541
  "all"
24464
24542
  ]);
24543
+ /**
24544
+ * What a `listRecentFaces` page is ORDERED BY.
24545
+ *
24546
+ * - `timestamp` — when the face was seen. The historical (and default) order.
24547
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
24548
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
24549
+ * order: it puts the suggestions an operator can confirm with one tap at the
24550
+ * top, and it is the reason this enum exists — a client that ranked a capped
24551
+ * page client-side was ranking the newest N, never the most certain N.
24552
+ *
24553
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
24554
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
24555
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
24556
+ * — flipping the direction reorders the rows that HAVE a certainty and never
24557
+ * floods the page with the ones that do not. `addon-post-analysis`'s
24558
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
24559
+ * then by faceId, and is what makes this a total order instead of the
24560
+ * backend's NULL-collation accident.
24561
+ */
24562
+ var FaceSortFieldEnum = _enum(["timestamp", "suggestionConfidence"]);
24563
+ var FaceSortDirectionEnum = _enum(["asc", "desc"]);
24564
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
24565
+ * never leaves the server. */
24566
+ var FaceClusterSchema = object({
24567
+ faceIds: array(string()).readonly(),
24568
+ representativeFaceId: string(),
24569
+ size: number().int(),
24570
+ cohesion: number()
24571
+ });
24465
24572
  var MediaFileLiteSchema$1 = object({
24466
24573
  key: string(),
24467
24574
  kind: string(),
@@ -24508,24 +24615,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24508
24615
  kind: "mutation",
24509
24616
  auth: "admin"
24510
24617
  }), method(object({
24511
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
24618
+ /**
24619
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
24620
+ *
24621
+ * The legacy single-camera form, kept verbatim for every caller that
24622
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
24623
+ * instead — never both: `deviceIds` is the authority whenever it is
24624
+ * present, and this field is then ignored rather than unioned, so
24625
+ * there is exactly one answer to "which cameras did I ask for".
24626
+ */
24512
24627
  deviceId: number().int().optional(),
24628
+ /**
24629
+ * Restrict to a SET of cameras — the review UI's camera filter, which
24630
+ * until now had to fetch the cluster-wide page and drop rows in the
24631
+ * client (so the `limit` it asked for was spent on cameras it was
24632
+ * about to discard).
24633
+ *
24634
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
24635
+ * "every camera". A request for no devices is a request, not an
24636
+ * omission; same contract as `deviceManager.listFleet` and
24637
+ * `pipelineAnalytics.listRecentTracks`.
24638
+ *
24639
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
24640
+ */
24641
+ deviceIds: array(number().int()).optional(),
24513
24642
  limit: number().int().positive().optional(),
24514
24643
  filter: FaceFilterEnum.optional(),
24515
24644
  /**
24516
- * Inline the base64 crop on every row. Default `true` — the existing
24517
- * behaviour, kept so no caller breaks.
24645
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24646
+ * Absent means no lower bound.
24647
+ */
24648
+ since: number().int().optional(),
24649
+ /**
24650
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
24651
+ * Absent means no upper bound.
24652
+ */
24653
+ until: number().int().optional(),
24654
+ /**
24655
+ * Order the page by time or by suggestion certainty. Default
24656
+ * `'timestamp'` — the historical order, unchanged for every caller
24657
+ * that does not ask.
24518
24658
  *
24519
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
24520
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
24521
- * the browser cache the images.
24659
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
24660
+ * does under `'suggestionConfidence'`.
24522
24661
  *
24523
- * **This is an INPUT field, so it does not reach the addon until the
24524
- * next train.** The hub router validates cap inputs against its own
24525
- * compiled Zod, which strips a key it does not know verified today
24526
- * on the OUTPUT side, where an additive field DOES arrive immediately
24527
- * (`Track.hasFace`). Until the train ships, sending `false` is
24528
- * harmless and simply keeps the crops inline.
24662
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
24663
+ * index and stops reading as soon as `limit` rows have PASSED the
24664
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
24665
+ * certain row may be the oldest so it walks the window. Narrow it
24666
+ * with {@link since} / {@link until}.
24667
+ */
24668
+ sortBy: FaceSortFieldEnum.optional(),
24669
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
24670
+ sortDirection: FaceSortDirectionEnum.optional(),
24671
+ /**
24672
+ * Inline the base64 crop on every row.
24673
+ *
24674
+ * Default `false` since the 2026-08-25 inversion — see
24675
+ * `include-crops-default.ts`, which is the ONE place that resolves
24676
+ * this for every gallery, and which records why the inline shape had
24677
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
24678
+ * The doc here used to still say `true`; it was wrong, and a leftover
24679
+ * that describes the old design reads as permission to rely on it.
24680
+ *
24681
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
24682
+ * which the browser fetches off the `event-media` plane in parallel,
24683
+ * cached and ETagged.
24529
24684
  */
24530
24685
  includeCrops: boolean().optional()
24531
24686
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -24561,13 +24716,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24561
24716
  }), method(object({
24562
24717
  threshold: number().min(0).max(1).optional(),
24563
24718
  minClusterSize: number().int().min(2).optional(),
24564
- limit: number().int().positive().optional()
24565
- }).optional(), array(object({
24566
- faceIds: array(string()).readonly(),
24567
- representativeFaceId: string(),
24568
- size: number().int(),
24569
- cohesion: number()
24570
- })).readonly());
24719
+ /**
24720
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
24721
+ * which read as though it bounded the work — it never did.
24722
+ *
24723
+ * Wins over {@link limit} when both are sent.
24724
+ */
24725
+ maxClusters: number().int().positive().optional(),
24726
+ /**
24727
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
24728
+ * RESULT, not the scan. Kept so existing callers keep working; send
24729
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
24730
+ */
24731
+ limit: number().int().positive().optional(),
24732
+ /**
24733
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
24734
+ * POOL, not the result.
24735
+ *
24736
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
24737
+ * used to read every unassigned face on the hub no matter what the
24738
+ * caller asked for, because the only bound cut the finished clusters
24739
+ * afterwards; a UI showing a window of 100 paid for a scan of the
24740
+ * whole corpus, on an addon whose disk is under contention.
24741
+ *
24742
+ * The pool is the NEWEST matching faces first — the same order the
24743
+ * gallery shows — so a bound here shortens the horizon, it does not
24744
+ * sample it randomly.
24745
+ *
24746
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
24747
+ * so the live corpus — 372 face rows — is unaffected while the
24748
+ * unbounded scan can never come back as the table grows.
24749
+ */
24750
+ maxFacesScanned: number().int().positive().optional()
24751
+ }).optional(), array(FaceClusterSchema).readonly());
24571
24752
  /**
24572
24753
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
24573
24754
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -28449,6 +28630,211 @@ var SetSiteLocationInputSchema = object({
28449
28630
  latitude: number().min(-90).max(90),
28450
28631
  longitude: number().min(-180).max(180)
28451
28632
  }).nullable();
28633
+ /**
28634
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
28635
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
28636
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
28637
+ * already prints - never a token, never an `Authorization` header.
28638
+ */
28639
+ var RequestCensusGroupSchema = object({
28640
+ procedure: string(),
28641
+ userAgent: string(),
28642
+ ip: string(),
28643
+ principal: string(),
28644
+ calls: number(),
28645
+ perMin: number()
28646
+ });
28647
+ /**
28648
+ * A procedure's TOTAL over the window, across every caller.
28649
+ *
28650
+ * This block, not the group list, is what answers "did these calls arrive over
28651
+ * HTTP at all". A total far BELOW what a store-side census counted over the
28652
+ * same window excludes the HTTP plane, which is a result, not a failure.
28653
+ */
28654
+ var RequestCensusProcedureSchema = object({
28655
+ procedure: string(),
28656
+ calls: number(),
28657
+ perMin: number()
28658
+ });
28659
+ /**
28660
+ * The census as an operator sees it.
28661
+ *
28662
+ * `persisted` is the honest answer to "will this survive the restart I am
28663
+ * about to do": the arm deadline is written to `system-settings` so a window
28664
+ * armed now can measure the NEXT boot, and a write that failed must not look
28665
+ * like one that succeeded.
28666
+ */
28667
+ var RequestCensusStatusSchema = object({
28668
+ armed: boolean(),
28669
+ /** How long the current - or just-closed - window collected, in ms. */
28670
+ elapsedMs: number(),
28671
+ /** The window actually armed, after the server clamped the request. */
28672
+ windowMs: number(),
28673
+ /** Epoch ms the window closes at. 0 when disarmed. */
28674
+ armedUntilMs: number(),
28675
+ httpRequests: number(),
28676
+ batchedRequests: number(),
28677
+ /**
28678
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
28679
+ * is in play (`?batch=1` carries several procedures in one request); this is
28680
+ * the number comparable with a store-side call count.
28681
+ */
28682
+ procedureCalls: number(),
28683
+ /**
28684
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
28685
+ * transport resolves one context per connection - but the number that says
28686
+ * whether a plane this census cannot see was busy while HTTP was quiet.
28687
+ */
28688
+ wsConnections: number(),
28689
+ distinctGroups: number(),
28690
+ /** Calls counted in the totals whose group attribution was shed at the
28691
+ * cardinality bound. */
28692
+ unattributedCalls: number(),
28693
+ procedures: array(RequestCensusProcedureSchema).readonly(),
28694
+ groups: array(RequestCensusGroupSchema).readonly()
28695
+ }).extend({ persisted: boolean() });
28696
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
28697
+ var LogLevelSchema$1 = _enum([
28698
+ "debug",
28699
+ "info",
28700
+ "warn",
28701
+ "error"
28702
+ ]);
28703
+ /**
28704
+ * The diagnostics that can be ARMED for a window. Exactly one today.
28705
+ *
28706
+ * A diagnostic is anything whose cost is only worth paying while a question is
28707
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
28708
+ */
28709
+ var DiagnosticIdSchema = _enum(["request-census"]);
28710
+ /**
28711
+ * The layers of the level hierarchy, general → specific. The most specific
28712
+ * layer that carries an explicit value wins.
28713
+ *
28714
+ * `component` is DECLARED and not yet resolvable: the per-component channels
28715
+ * are a later slice of the same plan, and a `levelSource` enum that has to
28716
+ * grow later would force every consumer of this document to change with it.
28717
+ * Nothing returns `component` today.
28718
+ */
28719
+ var LoggingScopeKindSchema = _enum([
28720
+ "cluster",
28721
+ "node",
28722
+ "component"
28723
+ ]);
28724
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
28725
+ var LoggingLevelSourceSchema = _enum([
28726
+ "default",
28727
+ "cluster",
28728
+ "node",
28729
+ "component"
28730
+ ]);
28731
+ /**
28732
+ * One layer of the hierarchy as it actually STANDS.
28733
+ *
28734
+ * `level: null` is the whole reason this array is returned: it is the
28735
+ * difference between "this node is at `info` because I decided it" and
28736
+ * "...because it inherits". An operator who clears an override believing they
28737
+ * are clearing an inherited value has been handed the same defect as the two
28738
+ * contradicting knobs this document exists to remove, moved one floor up.
28739
+ */
28740
+ var LoggingLevelLayerSchema = object({
28741
+ scope: LoggingScopeKindSchema,
28742
+ /** The node this layer speaks for; `null` on the cluster layer. */
28743
+ nodeId: string().nullable(),
28744
+ /** Explicitly set here, or `null` when this layer inherits. */
28745
+ level: LogLevelSchema$1.nullable()
28746
+ });
28747
+ /** What a line is judged against, and WHICH layer decided it. */
28748
+ var LoggingEffectiveSchema = object({
28749
+ level: LogLevelSchema$1,
28750
+ levelSource: LoggingLevelSourceSchema
28751
+ });
28752
+ /** Every layer, general → specific. Never collapsed into the effective value. */
28753
+ var LoggingExplicitSchema = object({ layers: array(LoggingLevelLayerSchema).readonly() });
28754
+ /**
28755
+ * An armed diagnostic, with its DEADLINE.
28756
+ *
28757
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
28758
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
28759
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
28760
+ * `armed` is false — a window is never reported as slightly expired.
28761
+ */
28762
+ var DiagnosticWindowSchema = object({
28763
+ id: DiagnosticIdSchema,
28764
+ armed: boolean(),
28765
+ /** Epoch ms the window closes at. 0 when disarmed. */
28766
+ armedUntilMs: number(),
28767
+ /** Ms left before it expires on its own. 0 when disarmed. */
28768
+ remainingMs: number(),
28769
+ /** Whether the stored deadline is the one the live diagnostic is running —
28770
+ * i.e. whether this window would survive a restart. */
28771
+ persisted: boolean()
28772
+ });
28773
+ /**
28774
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
28775
+ * server — there is no maximum here on purpose: a bound repeated in a schema
28776
+ * is a second knob that disagrees with the first the day one of them moves.
28777
+ */
28778
+ var DiagnosticWindowPatchSchema = object({
28779
+ id: DiagnosticIdSchema,
28780
+ armMs: number().int().min(0),
28781
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
28782
+ reportEveryMs: number().int().positive().optional()
28783
+ });
28784
+ /**
28785
+ * A PATCH, and patches MERGE.
28786
+ *
28787
+ * A field absent from the patch is left exactly as it was — arming a
28788
+ * diagnostic never resets a level, and setting a level never disarms a window.
28789
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
28790
+ * `setAll` already merges, and rebuilding the object is how an absent field
28791
+ * turns into an erased one.
28792
+ */
28793
+ var LoggingSettingsPatchSchema = object({
28794
+ /**
28795
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
28796
+ * addressed scope so it inherits again. A value sets it.
28797
+ */
28798
+ level: LogLevelSchema$1.nullable().optional(),
28799
+ /**
28800
+ * Only the diagnostics NAMED here change. An armed window that is not listed
28801
+ * keeps running — a patch is never a full replacement.
28802
+ */
28803
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
28804
+ });
28805
+ /**
28806
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
28807
+ *
28808
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
28809
+ * input — the generated router strips it and uses it to resolve the PROVIDER
28810
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
28811
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
28812
+ * by an agent that holds no cluster document at all. The hub is the single
28813
+ * authority over the whole hierarchy and answers for every layer, so the
28814
+ * layer selector needs a name the transport does not already own.
28815
+ */
28816
+ var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
28817
+ var SetLoggingSettingsInputSchema = object({
28818
+ scopeNodeId: string().optional(),
28819
+ patch: LoggingSettingsPatchSchema
28820
+ });
28821
+ /**
28822
+ * The whole document, as read and as returned after every write.
28823
+ *
28824
+ * `persisted: false` means the settings store could not be read or written.
28825
+ * The in-memory mirror still governs behaviour and is unchanged by the
28826
+ * failure — a read that fails neither switches a level nor disarms a window
28827
+ * (D49) — but the operator is told that what they are looking at would not
28828
+ * survive a restart.
28829
+ */
28830
+ var LoggingSettingsStateSchema = object({
28831
+ /** The layer this document was read at. `null` = the cluster layer. */
28832
+ scopeNodeId: string().nullable(),
28833
+ effective: LoggingEffectiveSchema,
28834
+ explicit: LoggingExplicitSchema,
28835
+ activeWindows: array(DiagnosticWindowSchema).readonly(),
28836
+ persisted: boolean()
28837
+ });
28452
28838
  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(), {
28453
28839
  kind: "mutation",
28454
28840
  auth: "admin"
@@ -28461,6 +28847,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28461
28847
  }), method(_void(), SiteLocationStatusSchema, {
28462
28848
  kind: "mutation",
28463
28849
  auth: "admin"
28850
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28851
+ kind: "mutation",
28852
+ auth: "admin"
28464
28853
  });
28465
28854
  object({
28466
28855
  /** True when the device's tamper switch / case-open contact is
@@ -29089,6 +29478,146 @@ DeviceType.Camera, method(object({
29089
29478
  detection: array(ZoneRuleSchema).readonly(),
29090
29479
  package: array(ZoneRuleSchema).readonly()
29091
29480
  });
29481
+ /**
29482
+ * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
29483
+ * valutatore puro del suo FRONTE.
29484
+ *
29485
+ * Viveva dentro il builtin virtual-doorbell
29486
+ * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
29487
+ * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
29488
+ * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
29489
+ * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
29490
+ * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
29491
+ * SPOSTA qui e il doorbell la ri-esporta.
29492
+ *
29493
+ * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
29494
+ * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
29495
+ * regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
29496
+ * booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
29497
+ */
29498
+ /**
29499
+ * Known binary / switch source caps → the boolean slice field whose
29500
+ * false→true rise counts as ACTIVE. Every entry is "fire on active".
29501
+ * Sensors whose "active" reading is not a plain boolean (presence's string
29502
+ * state, connectivity's connected flag) are deliberately excluded — a
29503
+ * reconnect is not a doorbell press, and it is not a recording either.
29504
+ */
29505
+ var SOURCE_CAP_ACTIVE_FIELD = {
29506
+ contact: "entryOpen",
29507
+ binary: "on",
29508
+ switch: "on",
29509
+ motion: "detected",
29510
+ flood: "flooded",
29511
+ gas: "detected",
29512
+ smoke: "detected",
29513
+ "carbon-monoxide": "detected",
29514
+ vibration: "detected",
29515
+ tamper: "tampered"
29516
+ };
29517
+ /**
29518
+ * The same caps → the slice field carrying the ms-epoch timestamp of the
29519
+ * last transition. Every source cap MUST appear here (guarded by a spec):
29520
+ * without a transition timestamp the evaluator cannot tell a genuine rise
29521
+ * from a boot-time hydration when the FIRST slice it ever sees is already
29522
+ * active, and errs towards silence — swallowing the rise.
29523
+ *
29524
+ * These timestamps are UPSTREAM ones, not ingest ones: the Home Assistant
29525
+ * provider derives them from `state.last_changed`, so they survive our own
29526
+ * restarts and correctly read as "hours ago" for a state that has been
29527
+ * active for hours. `motion` names its rise timestamp `lastDetectedAt`.
29528
+ */
29529
+ var SOURCE_CAP_CHANGED_AT_FIELD = {
29530
+ contact: "lastChangedAt",
29531
+ binary: "lastChangedAt",
29532
+ switch: "lastChangedAt",
29533
+ motion: "lastDetectedAt",
29534
+ flood: "lastChangedAt",
29535
+ gas: "lastChangedAt",
29536
+ smoke: "lastChangedAt",
29537
+ "carbon-monoxide": "lastChangedAt",
29538
+ vibration: "lastChangedAt",
29539
+ tamper: "lastChangedAt"
29540
+ };
29541
+ /** True when a cap is a recognised binary/switch source. */
29542
+ function isSourceCap(capName) {
29543
+ return Object.prototype.hasOwnProperty.call(SOURCE_CAP_ACTIVE_FIELD, capName);
29544
+ }
29545
+ /** Extract the "active" boolean a source cap's slice carries, or null when
29546
+ * the cap is unknown or the field is missing / non-boolean. */
29547
+ function sliceActiveValue(capName, slice) {
29548
+ const field = SOURCE_CAP_ACTIVE_FIELD[capName];
29549
+ if (field === void 0) return null;
29550
+ const raw = slice[field];
29551
+ return typeof raw === "boolean" ? raw : null;
29552
+ }
29553
+ /** Ms-epoch transition timestamp a source cap's slice carries, or null when
29554
+ * it is absent, non-numeric or the zero "never observed" sentinel. */
29555
+ function sliceChangedAt(capName, slice) {
29556
+ const field = SOURCE_CAP_CHANGED_AT_FIELD[capName];
29557
+ if (field === void 0) return null;
29558
+ const raw = slice[field];
29559
+ if (typeof raw !== "number" || !Number.isFinite(raw) || raw <= 0) return null;
29560
+ return raw;
29561
+ }
29562
+ /**
29563
+ * How recent a source's own transition timestamp must be for a FIRST
29564
+ * sighting that is already active to count as a genuine rise rather than a
29565
+ * hydration of long-standing state.
29566
+ */
29567
+ var DEFAULT_FIRST_SIGHTING_FRESHNESS_MS = 3e4;
29568
+ /**
29569
+ * IL fronte. Puro: nessun orologio proprio, nessuna memoria — il chiamante
29570
+ * porta `prior`, `nowMs` e il proprio `startedAtMs`.
29571
+ *
29572
+ * Il caso della PRIMA slice già attiva è trattato esplicitamente e vale come
29573
+ * fronte solo se il timestamp UPSTREAM della transizione è posteriore a
29574
+ * `startedAtMs` **e** entro `firstSightingFreshnessMs`. Entrambe le metà
29575
+ * servono: la sola freschezza scatterebbe su un'idratazione al boot di uno
29576
+ * stato flippato pochi secondi prima del riavvio, e il solo "dopo che abbiamo
29577
+ * iniziato" scatterebbe, su un processo di lunga vita, per una sorgente
29578
+ * adottata oggi il cui stato è cambiato ieri. Il caso ambiguo ERRA VERSO IL
29579
+ * SILENZIO e lo dichiara (`baseline-seeded-stale-active`).
29580
+ */
29581
+ function evaluateSensorEdge(input) {
29582
+ const value = sliceActiveValue(input.capName, input.slice);
29583
+ if (value === null) return {
29584
+ edge: "none",
29585
+ value: null,
29586
+ reason: isSourceCap(input.capName) ? "non-boolean-value" : "unknown-cap"
29587
+ };
29588
+ if (input.prior === void 0) {
29589
+ if (!value) return {
29590
+ edge: "none",
29591
+ value,
29592
+ reason: "baseline-seeded-inactive"
29593
+ };
29594
+ const changedAt = sliceChangedAt(input.capName, input.slice);
29595
+ const floor = Math.max(input.startedAtMs, input.nowMs - input.firstSightingFreshnessMs);
29596
+ if (changedAt === null || changedAt < floor) return {
29597
+ edge: "none",
29598
+ value,
29599
+ reason: "baseline-seeded-stale-active"
29600
+ };
29601
+ return {
29602
+ edge: "rising",
29603
+ value: true
29604
+ };
29605
+ }
29606
+ if (input.prior === value) return {
29607
+ edge: "none",
29608
+ value,
29609
+ reason: "no-change"
29610
+ };
29611
+ if (!value) return {
29612
+ edge: "none",
29613
+ value,
29614
+ reason: "falling-edge"
29615
+ };
29616
+ return {
29617
+ edge: "rising",
29618
+ value: true
29619
+ };
29620
+ }
29092
29621
  var HF_BASE_URL = `https://huggingface.co/camstack/camstack-models/resolve/main`;
29093
29622
  /**
29094
29623
  * Accessory device helpers — shared across drivers.
@@ -29129,9 +29658,6 @@ var AccessoryKind = {
29129
29658
  PrivacyMask: DeviceRole.PrivacyMask
29130
29659
  };
29131
29660
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
29132
- DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder;
29133
- new Set(Object.values(DeviceType));
29134
- DeviceFeature.BatteryOperated;
29135
29661
  /**
29136
29662
  * THE derivation. One crop rectangle, one presence verdict — see D52 for why
29137
29663
  * this repo insists a derived value has exactly one implementation.
@@ -29150,6 +29676,9 @@ function deriveBatteryPresence(input) {
29150
29676
  const budget = input.unreachableAfterMs ?? 216e5;
29151
29677
  return input.nowMs - lastContactAt > budget ? "unreachable" : "sleeping";
29152
29678
  }
29679
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder;
29680
+ new Set(Object.values(DeviceType));
29681
+ DeviceFeature.BatteryOperated;
29153
29682
  Object.freeze({
29154
29683
  "accessories.setChildHidden": {
29155
29684
  capName: "accessories",
@@ -34311,6 +34840,18 @@ Object.freeze({
34311
34840
  addonId: null,
34312
34841
  access: "create"
34313
34842
  },
34843
+ "system.getLoggingSettings": {
34844
+ capName: "system",
34845
+ capScope: "system",
34846
+ addonId: null,
34847
+ access: "view"
34848
+ },
34849
+ "system.getRequestCensus": {
34850
+ capName: "system",
34851
+ capScope: "system",
34852
+ addonId: null,
34853
+ access: "view"
34854
+ },
34314
34855
  "system.getRetentionConfig": {
34315
34856
  capName: "system",
34316
34857
  capScope: "system",
@@ -34341,6 +34882,12 @@ Object.freeze({
34341
34882
  addonId: null,
34342
34883
  access: "view"
34343
34884
  },
34885
+ "system.setLoggingSettings": {
34886
+ capName: "system",
34887
+ capScope: "system",
34888
+ addonId: null,
34889
+ access: "create"
34890
+ },
34344
34891
  "system.setRetentionConfig": {
34345
34892
  capName: "system",
34346
34893
  capScope: "system",
@@ -35496,6 +36043,10 @@ Object.freeze({
35496
36043
  name: "deviceId",
35497
36044
  form: "single",
35498
36045
  optional: true
36046
+ }, {
36047
+ name: "deviceIds",
36048
+ form: "array",
36049
+ optional: true
35499
36050
  }],
35500
36051
  "fanControl.setDirection": [{
35501
36052
  name: "deviceId",
@@ -37326,6 +37877,7 @@ var NATIVE_LEASE_BUDGET_KEY = "nativeLeaseBudgetMb";
37326
37877
  var NATIVE_LEASE_ACTIVITY_KEY = "nativeLeaseActivityMs";
37327
37878
  var NATIVE_LEASE_ADMISSION_KEY = "nativeLeaseAdmission";
37328
37879
  var NATIVE_LEASE_TILE_BUDGET_KEY = "nativeTileBudgetMb";
37880
+ var NATIVE_LEASE_SCENE_BUDGET_KEY = "nativeSceneBudgetMb";
37329
37881
  /**
37330
37882
  * WHICH delivered frames the decode worker retains a native copy of.
37331
37883
  *
@@ -37420,7 +37972,38 @@ var NativeLeaseSettingsSchema = object({
37420
37972
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
37421
37973
  * reproduce that.
37422
37974
  */
37423
- tileBudgetMb: number().int().min(0).max(1024)
37975
+ tileBudgetMb: number().int().min(0).max(1024),
37976
+ /**
37977
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
37978
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
37979
+ * subject tiles, on frames that detected something.
37980
+ *
37981
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
37982
+ * containment is strict by design, so the native `keyFrame`, the detail
37983
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
37984
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
37985
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
37986
+ * frame-time after delivery, with the request only p50 367 ms behind it.
37987
+ *
37988
+ * Sizing, and why this is a budget and not a duration: a scene tile is
37989
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
37990
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
37991
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
37992
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
37993
+ * binds only through a detection burst, where it still covers well past the
37994
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
37995
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
37996
+ * whole shape exists to avoid.
37997
+ *
37998
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
37999
+ * subject tile, so one shared budget would let a busy camera's key frames
38000
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
38001
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
38002
+ * pre-existing behaviour, where a late full-frame request had nothing but the
38003
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
38004
+ * nothing.
38005
+ */
38006
+ sceneBudgetMb: number().int().min(0).max(1024)
37424
38007
  });
37425
38008
  /**
37426
38009
  * The values in force when the operator has set nothing.
@@ -37436,12 +38019,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
37436
38019
  budgetMb: 1024,
37437
38020
  activityMs: 15e3,
37438
38021
  tileBudgetMb: 64,
38022
+ sceneBudgetMb: 48,
37439
38023
  admission: "inferred"
37440
38024
  };
37441
38025
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
37442
38026
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
37443
38027
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
37444
38028
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38029
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
37445
38030
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
37446
38031
  /**
37447
38032
  * Parse one knob, reporting `null` for absent, junk, out-of-bounds — AND for a
@@ -37490,12 +38075,14 @@ function readNativeLeaseOverride(config) {
37490
38075
  const activityMs = readKnob("activityMs", config[NATIVE_LEASE_ACTIVITY_KEY]);
37491
38076
  const admission = readAdmissionKnob(config[NATIVE_LEASE_ADMISSION_KEY]);
37492
38077
  const tileBudgetMb = readKnob("tileBudgetMb", config[NATIVE_LEASE_TILE_BUDGET_KEY]);
38078
+ const sceneBudgetMb = readKnob("sceneBudgetMb", config[NATIVE_LEASE_SCENE_BUDGET_KEY]);
37493
38079
  return {
37494
38080
  ...holdFrames === null ? {} : { holdFrames },
37495
38081
  ...budgetMb === null ? {} : { budgetMb },
37496
38082
  ...activityMs === null ? {} : { activityMs },
37497
38083
  ...admission === null ? {} : { admission },
37498
- ...tileBudgetMb === null ? {} : { tileBudgetMb }
38084
+ ...tileBudgetMb === null ? {} : { tileBudgetMb },
38085
+ ...sceneBudgetMb === null ? {} : { sceneBudgetMb }
37499
38086
  };
37500
38087
  }
37501
38088
  function isHydratedField(entry) {
@@ -37506,7 +38093,8 @@ var LEASE_KEYS = [
37506
38093
  NATIVE_LEASE_BUDGET_KEY,
37507
38094
  NATIVE_LEASE_ACTIVITY_KEY,
37508
38095
  NATIVE_LEASE_ADMISSION_KEY,
37509
- NATIVE_LEASE_TILE_BUDGET_KEY
38096
+ NATIVE_LEASE_TILE_BUDGET_KEY,
38097
+ NATIVE_LEASE_SCENE_BUDGET_KEY
37510
38098
  ];
37511
38099
  /**
37512
38100
  * Extract the operator's lease overrides from an
@@ -38228,4 +38816,4 @@ function enumerateInferenceDevices(hw) {
38228
38816
  return out;
38229
38817
  }
38230
38818
  //#endregion
38231
- export { pickClusterStepModels as $, audioAnalyzerCapability as A, makeSourceBrokerId as At, deriveRecordingMode as B, lazy as Bt, RATE_CONTROL_TIGHT as C, CAM_PROFILE_ORDER as Ct, YAMNET_TO_MACRO as D, hydrateSchema as Dt, RingBuffer as E, createEvent as Et, customAction as F, sleep as Ft, evaluateZoneRules as G, string as Gt, egressTranscodeSharingKey as H, number as Ht, defaultDeviceFor as I, _enum as It, mapAudioLabelToMacro as J, hfModelUrl as K, union as Kt, defineCustomActions as L, array as Lt, batteryCapability as M, parseJsonUnknown as Mt, cameraStreamsCapability as N, parseProfileBrokerId as Nt, addonWidgetsSourceCapability as O, isEvent as Ot, createHwAccelCache as P, selectAssignedProfileSlots as Pt, parseProcStatus as Q, deriveBatteryPresence as R, boolean as Rt, RATE_CONTROL_RELAXED as S, BaseAddon as St, RecordingConfigSchema as T, DeviceType as Tt, egressTransportFromRequest as U, object as Ut, detectionPipelineCapability as V, literal as Vt, enumerateInferenceDevices as W, record as Wt, motionDetectionCapability as X, maskUrlCredentials as Y, overlayClusterStepSettings as Z, HF_BASE_URL as _, AUDIO_PRESETS as _t, COCO_80_LABELS as a, recordingCapability as at, OpsLogEntrySchema as b, invocationFromEncodeProfile as bt, DEFAULT_CLUSTER_STEP_MODELS as c, resolveEgressDecodeHwAccel as ct, DEFAULT_EVENTS_BAND_BUFFER_SEC as d, runtimeDevices as dt, pickClusterStepSettings as et, DEFAULT_NATIVE_LEASE_SETTINGS as f, storageEvictableCapability as ft, ExportRecordSchema as g, errMsg as gt, EncodeProfileSchema as h, webrtcSessionCapability as ht, BatteryStatusSchema as i, pipelineRunnerCapability as it, audioKindId as j, nodePin as jt, audioAnalysisCapability as k, makeProfileBrokerId as kt, DEFAULT_CLUSTER_STEP_SETTINGS as l, resolvePoolMemoryPolicy as lt, EVENT_PAD_MS as m, supportedRuntimes as mt, AUDIO_BACKEND_CHOICES as n, pickNativeLeaseOverride as nt, COCO_TO_MACRO as o, recordingExportCapability as ot, DEVICE_BACKEND_TO_FORMAT as p, streamBrokerCapability as pt, inferModelProvider as q, EventCategory as qt, AUDIO_MACRO_LABELS as r, pipelineExecutorCapability as rt, DEFAULT_AUDIO_ANALYZER_CONFIG as s, resolveClusterStepModelId as st, APPLE_SA_TO_MACRO as t, pickDetailCropConvention as tt, DEFAULT_DETAIL_CROP_CONVENTION as u, resolveRecordingProfiles as ut, NativeLeaseAdmissionSchema as v, Fmp4BoxSplitter as vt, RECORDING_EXPORT_MAX_READ_BYTES as w, DeviceFeature as wt, PoolMemoryWatchdog as x, isSoftwareDecode as xt, NativeLeaseSettingsSchema as y, buildFfmpegArgs as yt, deriveDetailCropRect as z, discriminatedUnion as zt };
38819
+ export { motionDetectionCapability as $, audioAnalysisCapability as A, hydrateSchema as At, deriveDetailCropRect as B, array as Bt, RATE_CONTROL_RELAXED as C, invocationFromEncodeProfile as Ct, RingBuffer as D, DeviceFeature as Dt, RecordingConfigSchema as E, CAM_PROFILE_ORDER as Et, createHwAccelCache as F, parseJsonUnknown as Ft, enumerateInferenceDevices as G, number as Gt, detectionPipelineCapability as H, discriminatedUnion as Ht, customAction as I, parseProfileBrokerId as It, hfModelUrl as J, string as Jt, evaluateSensorEdge as K, object as Kt, defaultDeviceFor as L, selectAssignedProfileSlots as Lt, audioKindId as M, makeProfileBrokerId as Mt, batteryCapability as N, makeSourceBrokerId as Nt, YAMNET_TO_MACRO as O, DeviceType as Ot, cameraStreamsCapability as P, nodePin as Pt, maskUrlCredentials as Q, defineCustomActions as R, sleep as Rt, PoolMemoryWatchdog as S, buildFfmpegArgs as St, RECORDING_EXPORT_MAX_READ_BYTES as T, BaseAddon as Tt, egressTranscodeSharingKey as U, lazy as Ut, deriveRecordingMode as V, boolean as Vt, egressTransportFromRequest as W, literal as Wt, isFirstLevelMacroClass as X, EventCategory as Xt, inferModelProvider as Y, union as Yt, mapAudioLabelToMacro as Z, ExportRecordSchema as _, supportedRuntimes as _t, COCO_80_LABELS as a, pickNativeLeaseOverride as at, NativeLeaseSettingsSchema as b, AUDIO_PRESETS as bt, DEFAULT_CLUSTER_STEP_MODELS as c, recordingCapability as ct, DEFAULT_EVENTS_BAND_BUFFER_SEC as d, resolveEgressDecodeHwAccel as dt, overlayClusterStepSettings as et, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as f, resolvePoolMemoryPolicy as ft, EncodeProfileSchema as g, streamBrokerCapability as gt, EVENT_PAD_MS as h, storageEvictableCapability as ht, BatteryStatusSchema as i, pickDetailCropConvention as it, audioAnalyzerCapability as j, isEvent as jt, addonWidgetsSourceCapability as k, createEvent as kt, DEFAULT_CLUSTER_STEP_SETTINGS as l, recordingExportCapability as lt, DEVICE_BACKEND_TO_FORMAT as m, runtimeDevices as mt, AUDIO_BACKEND_CHOICES as n, pickClusterStepModels as nt, COCO_TO_MACRO as o, pipelineExecutorCapability as ot, DEFAULT_NATIVE_LEASE_SETTINGS as p, resolveRecordingProfiles as pt, evaluateZoneRules as q, record as qt, AUDIO_MACRO_LABELS as r, pickClusterStepSettings as rt, DEFAULT_AUDIO_ANALYZER_CONFIG as s, pipelineRunnerCapability as st, APPLE_SA_TO_MACRO as t, parseProcStatus as tt, DEFAULT_DETAIL_CROP_CONVENTION as u, resolveClusterStepModelId as ut, HF_BASE_URL as v, webrtcSessionCapability as vt, RATE_CONTROL_TIGHT as w, isSoftwareDecode as wt, OpsLogEntrySchema as x, Fmp4BoxSplitter as xt, NativeLeaseAdmissionSchema as y, errMsg as yt, deriveBatteryPresence as z, _enum as zt };