@camstack/system 1.2.142 → 1.2.143

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 (60) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  15. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  16. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  17. package/dist/builtins/doorbell/trigger-engine.d.ts +7 -81
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.js +29 -109
  19. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +26 -106
  20. package/dist/builtins/hub-forwarder/index.js +1 -1
  21. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  22. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  23. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  24. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  25. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  26. package/dist/builtins/local-network/local-network.addon.js +1 -1
  27. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  28. package/dist/builtins/loki-logging/index.js +1 -1
  29. package/dist/builtins/loki-logging/index.mjs +1 -1
  30. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  31. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  32. package/dist/builtins/platform-probe/index.js +1 -1
  33. package/dist/builtins/platform-probe/index.mjs +1 -1
  34. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  35. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  36. package/dist/builtins/snapshot/index.js +1 -1
  37. package/dist/builtins/snapshot/index.mjs +1 -1
  38. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  39. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  40. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  41. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  42. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  43. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  44. package/dist/builtins/system-config/system-config.addon.js +1 -1
  45. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  46. package/dist/builtins/winston-logging/index.js +1 -1
  47. package/dist/builtins/winston-logging/index.mjs +1 -1
  48. package/dist/{dist-jRSrzoXr.js → dist-CQs1b7uh.js} +742 -77
  49. package/dist/{dist-XjWZZYr9.mjs → dist-CVuVKA-O.mjs} +707 -78
  50. package/dist/index.d.ts +3 -0
  51. package/dist/index.js +127 -3
  52. package/dist/index.mjs +124 -4
  53. package/dist/logging/log-manager.d.ts +16 -0
  54. package/dist/logging/logging-gate.d.ts +32 -0
  55. package/dist/logging/logging-gate.singleton.d.ts +5 -0
  56. package/dist/{manifest-python-deps-DBQarwp9.js → manifest-python-deps-B_mCU6gz.js} +25 -2
  57. package/dist/{manifest-python-deps-D3zYlMEa.mjs → manifest-python-deps-BuhBXCg0.mjs} +25 -2
  58. package/dist/{retired-settings-keys-C8FeTH36.mjs → retired-settings-keys-DnMYSIEr.mjs} +1 -1
  59. package/dist/{retired-settings-keys-ovd_DQzc.js → retired-settings-keys-Dvei9nhG.js} +1 -1
  60. package/package.json +1 -1
@@ -3653,6 +3653,66 @@ var OpsLogQueryInputSchema = z.object({
3653
3653
  /** Max rows returned, newest-first. */
3654
3654
  limit: z.number().int().min(1).max(1e3).optional()
3655
3655
  });
3656
+ var LabelDefinitionSchema = z.object({
3657
+ id: z.string(),
3658
+ name: z.string(),
3659
+ category: z.string().optional(),
3660
+ description: z.string().optional(),
3661
+ icon: z.string().optional()
3662
+ });
3663
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
3664
+ var CLASS_MAP_MACRO_TARGETS = [
3665
+ "person",
3666
+ "vehicle",
3667
+ "animal",
3668
+ "package"
3669
+ ];
3670
+ /**
3671
+ * Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
3672
+ * un operatore può selezionare.
3673
+ *
3674
+ * Sono le tre offerte dallo step `object-detection`
3675
+ * (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
3676
+ * `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
3677
+ * `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
3678
+ * `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
3679
+ * stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
3680
+ * (suitcase/backpack/handbag) lasciando spento il detector dedicato.
3681
+ *
3682
+ * UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
3683
+ * dello step e una seconda volta come union `FirstLevelMacro`
3684
+ * (`types/detection.ts`); una terza copia per il trigger di registrazione
3685
+ * (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
3686
+ * successiva.
3687
+ */
3688
+ var FIRST_LEVEL_MACRO_CLASSES = [
3689
+ "person",
3690
+ "vehicle",
3691
+ "animal"
3692
+ ];
3693
+ /**
3694
+ * Wire schema for a per-model CATALOG classMap override
3695
+ * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
3696
+ * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
3697
+ * detection pipeline executor actually routes.
3698
+ *
3699
+ * This is deliberately a DIFFERENT, narrower shape than the general-purpose
3700
+ * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
3701
+ * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
3702
+ * enum) — the two used to share the name `ClassMapDefinition`/
3703
+ * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
3704
+ * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
3705
+ * are not: it is two different concepts colliding on a name. Keep this type
3706
+ * under its own name rather than reusing `ClassMapDefinition` — reusing it
3707
+ * would either narrow every `ClassMapDefinition` consumer to the four
3708
+ * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
3709
+ * schema exists for (see the "rejects a classMap whose target is not a
3710
+ * detection macro" test in `model-catalog-schema.test.ts`).
3711
+ */
3712
+ var DetectionCatalogClassMapSchema = z.object({
3713
+ mapping: z.record(z.string(), z.enum(CLASS_MAP_MACRO_TARGETS)),
3714
+ preserveOriginal: z.boolean()
3715
+ });
3656
3716
  /**
3657
3717
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
3658
3718
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -3675,10 +3735,55 @@ var RecordingStorageModeSchema = z.enum([
3675
3735
  "events",
3676
3736
  "continuous"
3677
3737
  ]);
3738
+ /**
3739
+ * Le macro classi che possono aprire una finestra di registrazione — le stesse
3740
+ * tre offerte dallo step `object-detection`, da UNA lista
3741
+ * ({@link FIRST_LEVEL_MACRO_CLASSES}).
3742
+ */
3743
+ var RecordingObjectTriggerClassSchema = z.enum(FIRST_LEVEL_MACRO_CLASSES);
3744
+ /**
3745
+ * True quando `values` non ripete un elemento.
3746
+ *
3747
+ * Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
3748
+ * diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
3749
+ * conterebbe due volte le sue finestre in `segmentMissedByMs`.
3750
+ */
3751
+ var noDuplicates = (values) => new Set(values).size === values.length;
3678
3752
  /** Which detectors trigger an `events`-mode band. */
3679
3753
  var RecordingTriggersSchema = z.object({
3680
3754
  motion: z.boolean().optional(),
3681
- audioThresholdDbfs: z.number().optional()
3755
+ audioThresholdDbfs: z.number().optional(),
3756
+ /**
3757
+ * Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
3758
+ * non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
3759
+ * object acceso, nessuna classe" è la stessa forma "abilitata e non registra
3760
+ * nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
3761
+ *
3762
+ * Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
3763
+ * quelle che hanno attraversato `enabledMacroClasses`, i
3764
+ * `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
3765
+ * (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
3766
+ * finestre — vedi `recorder/object-trigger.ts`.
3767
+ */
3768
+ objectClasses: z.array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
3769
+ /**
3770
+ * I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
3771
+ * non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
3772
+ * `objectClasses`.
3773
+ *
3774
+ * Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
3775
+ * percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
3776
+ * non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
3777
+ * si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
3778
+ * device (D12) — mai un elenco globale di cap.
3779
+ *
3780
+ * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
3781
+ * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
3782
+ * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
3783
+ * il livello: un contatto trovato già aperto al riavvio del runner non fa
3784
+ * registrare.
3785
+ */
3786
+ sensorDeviceIds: z.array(z.number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
3682
3787
  });
3683
3788
  /**
3684
3789
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -4130,41 +4235,6 @@ var DecoderSessionConfigSchema = z.object({
4130
4235
  */
4131
4236
  debug: z.boolean().optional()
4132
4237
  });
4133
- var LabelDefinitionSchema = z.object({
4134
- id: z.string(),
4135
- name: z.string(),
4136
- category: z.string().optional(),
4137
- description: z.string().optional(),
4138
- icon: z.string().optional()
4139
- });
4140
- /**
4141
- * Wire schema for a per-model CATALOG classMap override
4142
- * (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
4143
- * restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
4144
- * detection pipeline executor actually routes.
4145
- *
4146
- * This is deliberately a DIFFERENT, narrower shape than the general-purpose
4147
- * `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
4148
- * and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
4149
- * enum) — the two used to share the name `ClassMapDefinition`/
4150
- * `ClassMapDefinitionSchema`, which made the schema-type-twin guard
4151
- * (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
4152
- * are not: it is two different concepts colliding on a name. Keep this type
4153
- * under its own name rather than reusing `ClassMapDefinition` — reusing it
4154
- * would either narrow every `ClassMapDefinition` consumer to the four
4155
- * detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
4156
- * schema exists for (see the "rejects a classMap whose target is not a
4157
- * detection macro" test in `model-catalog-schema.test.ts`).
4158
- */
4159
- var DetectionCatalogClassMapSchema = z.object({
4160
- mapping: z.record(z.string(), z.enum([
4161
- "person",
4162
- "vehicle",
4163
- "animal",
4164
- "package"
4165
- ])),
4166
- preserveOriginal: z.boolean()
4167
- });
4168
4238
  var MODEL_FORMATS = [
4169
4239
  "onnx",
4170
4240
  "coreml",
@@ -21096,7 +21166,7 @@ var lifecycleJobSchema = z.object({
21096
21166
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
21097
21167
  * as every other cap.
21098
21168
  */
21099
- var LogLevelSchema$1 = z.enum([
21169
+ var LogLevelSchema$2 = z.enum([
21100
21170
  "debug",
21101
21171
  "info",
21102
21172
  "warn",
@@ -21323,7 +21393,7 @@ var addonsCapability = {
21323
21393
  getLogs: method(z.object({
21324
21394
  addonId: z.string(),
21325
21395
  limit: z.number().min(1).max(500).default(100),
21326
- level: LogLevelSchema$1.optional()
21396
+ level: LogLevelSchema$2.optional()
21327
21397
  }), z.array(LogQueryEntrySchema)),
21328
21398
  listPackages: method(z.void(), z.array(InstalledPackageSchema).readonly()),
21329
21399
  installPackage: method(z.object({
@@ -21561,7 +21631,7 @@ var addonsCapability = {
21561
21631
  }),
21562
21632
  onAddonLogs: method(z.object({
21563
21633
  addonId: z.string(),
21564
- level: LogLevelSchema$1.optional()
21634
+ level: LogLevelSchema$2.optional()
21565
21635
  }), LogStreamEntrySchema, { kind: "subscription" })
21566
21636
  },
21567
21637
  /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
@@ -23403,6 +23473,35 @@ var FaceFilterEnum = z.enum([
23403
23473
  "identified",
23404
23474
  "all"
23405
23475
  ]);
23476
+ /**
23477
+ * What a `listRecentFaces` page is ORDERED BY.
23478
+ *
23479
+ * - `timestamp` — when the face was seen. The historical (and default) order.
23480
+ * - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
23481
+ * cosine of the face's SUGGESTED identity. This is the "review by certainty"
23482
+ * order: it puts the suggestions an operator can confirm with one tap at the
23483
+ * top, and it is the reason this enum exists — a client that ranked a capped
23484
+ * page client-side was ranking the newest N, never the most certain N.
23485
+ *
23486
+ * A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
23487
+ * auto-assigned face, or a face below the suggestion band) has no certainty to
23488
+ * compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
23489
+ * — flipping the direction reorders the rows that HAVE a certainty and never
23490
+ * floods the page with the ones that do not. `addon-post-analysis`'s
23491
+ * `store/face-sort.ts` is the single implementation, tiebreaks newest-first
23492
+ * then by faceId, and is what makes this a total order instead of the
23493
+ * backend's NULL-collation accident.
23494
+ */
23495
+ var FaceSortFieldEnum = z.enum(["timestamp", "suggestionConfidence"]);
23496
+ var FaceSortDirectionEnum = z.enum(["asc", "desc"]);
23497
+ /** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
23498
+ * never leaves the server. */
23499
+ var FaceClusterSchema = z.object({
23500
+ faceIds: z.array(z.string()).readonly(),
23501
+ representativeFaceId: z.string(),
23502
+ size: z.number().int(),
23503
+ cohesion: z.number()
23504
+ });
23406
23505
  var MediaFileLiteSchema$1 = z.object({
23407
23506
  key: z.string(),
23408
23507
  kind: z.string(),
@@ -23460,24 +23559,72 @@ includeCrops: z.boolean().optional() }).optional(), z.array(IdentitySchema).read
23460
23559
  auth: "admin"
23461
23560
  }),
23462
23561
  listRecentFaces: method(z.object({
23463
- /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
23562
+ /**
23563
+ * Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
23564
+ *
23565
+ * The legacy single-camera form, kept verbatim for every caller that
23566
+ * already sends it. A caller that wants a SET sends {@link deviceIds}
23567
+ * instead — never both: `deviceIds` is the authority whenever it is
23568
+ * present, and this field is then ignored rather than unioned, so
23569
+ * there is exactly one answer to "which cameras did I ask for".
23570
+ */
23464
23571
  deviceId: z.number().int().optional(),
23572
+ /**
23573
+ * Restrict to a SET of cameras — the review UI's camera filter, which
23574
+ * until now had to fetch the cluster-wide page and drop rows in the
23575
+ * client (so the `limit` it asked for was spent on cameras it was
23576
+ * about to discard).
23577
+ *
23578
+ * An **empty array reads NOTHING** — `[]` is an empty page, never
23579
+ * "every camera". A request for no devices is a request, not an
23580
+ * omission; same contract as `deviceManager.listFleet` and
23581
+ * `pipelineAnalytics.listRecentTracks`.
23582
+ *
23583
+ * Absent (`undefined`) is the omission, and keeps the cluster-wide view.
23584
+ */
23585
+ deviceIds: z.array(z.number().int()).optional(),
23465
23586
  limit: z.number().int().positive().optional(),
23466
23587
  filter: FaceFilterEnum.optional(),
23467
23588
  /**
23468
- * Inline the base64 crop on every row. Default `true` — the existing
23469
- * behaviour, kept so no caller breaks.
23589
+ * Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23590
+ * Absent means no lower bound.
23591
+ */
23592
+ since: z.number().int().optional(),
23593
+ /**
23594
+ * Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
23595
+ * Absent means no upper bound.
23596
+ */
23597
+ until: z.number().int().optional(),
23598
+ /**
23599
+ * Order the page by time or by suggestion certainty. Default
23600
+ * `'timestamp'` — the historical order, unchanged for every caller
23601
+ * that does not ask.
23470
23602
  *
23471
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
23472
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
23473
- * the browser cache the images.
23603
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
23604
+ * does under `'suggestionConfidence'`.
23474
23605
  *
23475
- * **This is an INPUT field, so it does not reach the addon until the
23476
- * next train.** The hub router validates cap inputs against its own
23477
- * compiled Zod, which strips a key it does not know verified today
23478
- * on the OUTPUT side, where an additive field DOES arrive immediately
23479
- * (`Track.hasFace`). Until the train ships, sending `false` is
23480
- * harmless and simply keeps the crops inline.
23606
+ * Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
23607
+ * index and stops reading as soon as `limit` rows have PASSED the
23608
+ * filter. `'suggestionConfidence'` cannot stop earlythe most
23609
+ * certain row may be the oldest so it walks the window. Narrow it
23610
+ * with {@link since} / {@link until}.
23611
+ */
23612
+ sortBy: FaceSortFieldEnum.optional(),
23613
+ /** Sort direction for {@link sortBy}. Default `'desc'`. */
23614
+ sortDirection: FaceSortDirectionEnum.optional(),
23615
+ /**
23616
+ * Inline the base64 crop on every row.
23617
+ *
23618
+ * Default `false` since the 2026-08-25 inversion — see
23619
+ * `include-crops-default.ts`, which is the ONE place that resolves
23620
+ * this for every gallery, and which records why the inline shape had
23621
+ * to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
23622
+ * The doc here used to still say `true`; it was wrong, and a leftover
23623
+ * that describes the old design reads as permission to rely on it.
23624
+ *
23625
+ * Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
23626
+ * which the browser fetches off the `event-media` plane in parallel,
23627
+ * cached and ETagged.
23481
23628
  */
23482
23629
  includeCrops: z.boolean().optional()
23483
23630
  }).optional(), z.array(FaceInfoSchema).readonly()),
@@ -23526,13 +23673,39 @@ includeCrops: z.boolean().optional() }).optional(), z.array(IdentitySchema).read
23526
23673
  suggestFaceClusters: method(z.object({
23527
23674
  threshold: z.number().min(0).max(1).optional(),
23528
23675
  minClusterSize: z.number().int().min(2).optional(),
23529
- limit: z.number().int().positive().optional()
23530
- }).optional(), z.array(z.object({
23531
- faceIds: z.array(z.string()).readonly(),
23532
- representativeFaceId: z.string(),
23533
- size: z.number().int(),
23534
- cohesion: z.number()
23535
- })).readonly())
23676
+ /**
23677
+ * Cap on the number of CLUSTERS returned. Renamed from `limit`,
23678
+ * which read as though it bounded the work — it never did.
23679
+ *
23680
+ * Wins over {@link limit} when both are sent.
23681
+ */
23682
+ maxClusters: z.number().int().positive().optional(),
23683
+ /**
23684
+ * @deprecated Ambiguous name for {@link maxClusters} — it cuts the
23685
+ * RESULT, not the scan. Kept so existing callers keep working; send
23686
+ * `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
23687
+ */
23688
+ limit: z.number().int().positive().optional(),
23689
+ /**
23690
+ * Cap on the number of unassigned faces READ AND CLUSTERED — the
23691
+ * POOL, not the result.
23692
+ *
23693
+ * This is the knob {@link maxClusters} was mistaken for. Clustering
23694
+ * used to read every unassigned face on the hub no matter what the
23695
+ * caller asked for, because the only bound cut the finished clusters
23696
+ * afterwards; a UI showing a window of 100 paid for a scan of the
23697
+ * whole corpus, on an addon whose disk is under contention.
23698
+ *
23699
+ * The pool is the NEWEST matching faces first — the same order the
23700
+ * gallery shows — so a bound here shortens the horizon, it does not
23701
+ * sample it randomly.
23702
+ *
23703
+ * Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
23704
+ * so the live corpus — 372 face rows — is unaffected while the
23705
+ * unbounded scan can never come back as the table grows.
23706
+ */
23707
+ maxFacesScanned: z.number().int().positive().optional()
23708
+ }).optional(), z.array(FaceClusterSchema).readonly())
23536
23709
  }
23537
23710
  };
23538
23711
  /**
@@ -29393,6 +29566,211 @@ var SetSiteLocationInputSchema = z.object({
29393
29566
  latitude: z.number().min(-90).max(90),
29394
29567
  longitude: z.number().min(-180).max(180)
29395
29568
  }).nullable();
29569
+ /**
29570
+ * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
29571
+ * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
29572
+ * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
29573
+ * already prints - never a token, never an `Authorization` header.
29574
+ */
29575
+ var RequestCensusGroupSchema = z.object({
29576
+ procedure: z.string(),
29577
+ userAgent: z.string(),
29578
+ ip: z.string(),
29579
+ principal: z.string(),
29580
+ calls: z.number(),
29581
+ perMin: z.number()
29582
+ });
29583
+ /**
29584
+ * A procedure's TOTAL over the window, across every caller.
29585
+ *
29586
+ * This block, not the group list, is what answers "did these calls arrive over
29587
+ * HTTP at all". A total far BELOW what a store-side census counted over the
29588
+ * same window excludes the HTTP plane, which is a result, not a failure.
29589
+ */
29590
+ var RequestCensusProcedureSchema = z.object({
29591
+ procedure: z.string(),
29592
+ calls: z.number(),
29593
+ perMin: z.number()
29594
+ });
29595
+ /**
29596
+ * The census as an operator sees it.
29597
+ *
29598
+ * `persisted` is the honest answer to "will this survive the restart I am
29599
+ * about to do": the arm deadline is written to `system-settings` so a window
29600
+ * armed now can measure the NEXT boot, and a write that failed must not look
29601
+ * like one that succeeded.
29602
+ */
29603
+ var RequestCensusStatusSchema = z.object({
29604
+ armed: z.boolean(),
29605
+ /** How long the current - or just-closed - window collected, in ms. */
29606
+ elapsedMs: z.number(),
29607
+ /** The window actually armed, after the server clamped the request. */
29608
+ windowMs: z.number(),
29609
+ /** Epoch ms the window closes at. 0 when disarmed. */
29610
+ armedUntilMs: z.number(),
29611
+ httpRequests: z.number(),
29612
+ batchedRequests: z.number(),
29613
+ /**
29614
+ * Procedure invocations. Higher than `httpRequests` whenever tRPC batching
29615
+ * is in play (`?batch=1` carries several procedures in one request); this is
29616
+ * the number comparable with a store-side call count.
29617
+ */
29618
+ procedureCalls: z.number(),
29619
+ /**
29620
+ * tRPC WebSocket connections opened during the window. NOT calls - the WS
29621
+ * transport resolves one context per connection - but the number that says
29622
+ * whether a plane this census cannot see was busy while HTTP was quiet.
29623
+ */
29624
+ wsConnections: z.number(),
29625
+ distinctGroups: z.number(),
29626
+ /** Calls counted in the totals whose group attribution was shed at the
29627
+ * cardinality bound. */
29628
+ unattributedCalls: z.number(),
29629
+ procedures: z.array(RequestCensusProcedureSchema).readonly(),
29630
+ groups: z.array(RequestCensusGroupSchema).readonly()
29631
+ }).extend({ persisted: z.boolean() });
29632
+ /** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
29633
+ var LogLevelSchema$1 = z.enum([
29634
+ "debug",
29635
+ "info",
29636
+ "warn",
29637
+ "error"
29638
+ ]);
29639
+ /**
29640
+ * The diagnostics that can be ARMED for a window. Exactly one today.
29641
+ *
29642
+ * A diagnostic is anything whose cost is only worth paying while a question is
29643
+ * open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
29644
+ */
29645
+ var DiagnosticIdSchema = z.enum(["request-census"]);
29646
+ /**
29647
+ * The layers of the level hierarchy, general → specific. The most specific
29648
+ * layer that carries an explicit value wins.
29649
+ *
29650
+ * `component` is DECLARED and not yet resolvable: the per-component channels
29651
+ * are a later slice of the same plan, and a `levelSource` enum that has to
29652
+ * grow later would force every consumer of this document to change with it.
29653
+ * Nothing returns `component` today.
29654
+ */
29655
+ var LoggingScopeKindSchema = z.enum([
29656
+ "cluster",
29657
+ "node",
29658
+ "component"
29659
+ ]);
29660
+ /** Where an effective level came from. `default` = nothing is set anywhere. */
29661
+ var LoggingLevelSourceSchema = z.enum([
29662
+ "default",
29663
+ "cluster",
29664
+ "node",
29665
+ "component"
29666
+ ]);
29667
+ /**
29668
+ * One layer of the hierarchy as it actually STANDS.
29669
+ *
29670
+ * `level: null` is the whole reason this array is returned: it is the
29671
+ * difference between "this node is at `info` because I decided it" and
29672
+ * "...because it inherits". An operator who clears an override believing they
29673
+ * are clearing an inherited value has been handed the same defect as the two
29674
+ * contradicting knobs this document exists to remove, moved one floor up.
29675
+ */
29676
+ var LoggingLevelLayerSchema = z.object({
29677
+ scope: LoggingScopeKindSchema,
29678
+ /** The node this layer speaks for; `null` on the cluster layer. */
29679
+ nodeId: z.string().nullable(),
29680
+ /** Explicitly set here, or `null` when this layer inherits. */
29681
+ level: LogLevelSchema$1.nullable()
29682
+ });
29683
+ /** What a line is judged against, and WHICH layer decided it. */
29684
+ var LoggingEffectiveSchema = z.object({
29685
+ level: LogLevelSchema$1,
29686
+ levelSource: LoggingLevelSourceSchema
29687
+ });
29688
+ /** Every layer, general → specific. Never collapsed into the effective value. */
29689
+ var LoggingExplicitSchema = z.object({ layers: z.array(LoggingLevelLayerSchema).readonly() });
29690
+ /**
29691
+ * An armed diagnostic, with its DEADLINE.
29692
+ *
29693
+ * The shape of ADR-0244: what is stored is a deadline and never a flag, so a
29694
+ * diagnostic somebody forgot expires by itself, and a boot-window measurement
29695
+ * survives the restart it exists to measure. `remainingMs` is 0 whenever
29696
+ * `armed` is false — a window is never reported as slightly expired.
29697
+ */
29698
+ var DiagnosticWindowSchema = z.object({
29699
+ id: DiagnosticIdSchema,
29700
+ armed: z.boolean(),
29701
+ /** Epoch ms the window closes at. 0 when disarmed. */
29702
+ armedUntilMs: z.number(),
29703
+ /** Ms left before it expires on its own. 0 when disarmed. */
29704
+ remainingMs: z.number(),
29705
+ /** Whether the stored deadline is the one the live diagnostic is running —
29706
+ * i.e. whether this window would survive a restart. */
29707
+ persisted: z.boolean()
29708
+ });
29709
+ /**
29710
+ * `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
29711
+ * server — there is no maximum here on purpose: a bound repeated in a schema
29712
+ * is a second knob that disagrees with the first the day one of them moves.
29713
+ */
29714
+ var DiagnosticWindowPatchSchema = z.object({
29715
+ id: DiagnosticIdSchema,
29716
+ armMs: z.number().int().min(0),
29717
+ /** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
29718
+ reportEveryMs: z.number().int().positive().optional()
29719
+ });
29720
+ /**
29721
+ * A PATCH, and patches MERGE.
29722
+ *
29723
+ * A field absent from the patch is left exactly as it was — arming a
29724
+ * diagnostic never resets a level, and setting a level never disarms a window.
29725
+ * The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
29726
+ * `setAll` already merges, and rebuilding the object is how an absent field
29727
+ * turns into an erased one.
29728
+ */
29729
+ var LoggingSettingsPatchSchema = z.object({
29730
+ /**
29731
+ * Absent leaves the level untouched. `null` CLEARS the explicit value at the
29732
+ * addressed scope so it inherits again. A value sets it.
29733
+ */
29734
+ level: LogLevelSchema$1.nullable().optional(),
29735
+ /**
29736
+ * Only the diagnostics NAMED here change. An armed window that is not listed
29737
+ * keeps running — a patch is never a full replacement.
29738
+ */
29739
+ diagnostics: z.array(DiagnosticWindowPatchSchema).readonly().optional()
29740
+ });
29741
+ /**
29742
+ * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
29743
+ *
29744
+ * Deliberately NOT called `nodeId`: that key is reserved on every cap method
29745
+ * input — the generated router strips it and uses it to resolve the PROVIDER
29746
+ * on that node (`resolveProvider(cap, nodeId, …)`). A document about
29747
+ * `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
29748
+ * by an agent that holds no cluster document at all. The hub is the single
29749
+ * authority over the whole hierarchy and answers for every layer, so the
29750
+ * layer selector needs a name the transport does not already own.
29751
+ */
29752
+ var GetLoggingSettingsInputSchema = z.object({ scopeNodeId: z.string().optional() });
29753
+ var SetLoggingSettingsInputSchema = z.object({
29754
+ scopeNodeId: z.string().optional(),
29755
+ patch: LoggingSettingsPatchSchema
29756
+ });
29757
+ /**
29758
+ * The whole document, as read and as returned after every write.
29759
+ *
29760
+ * `persisted: false` means the settings store could not be read or written.
29761
+ * The in-memory mirror still governs behaviour and is unchanged by the
29762
+ * failure — a read that fails neither switches a level nor disarms a window
29763
+ * (D49) — but the operator is told that what they are looking at would not
29764
+ * survive a restart.
29765
+ */
29766
+ var LoggingSettingsStateSchema = z.object({
29767
+ /** The layer this document was read at. `null` = the cluster layer. */
29768
+ scopeNodeId: z.string().nullable(),
29769
+ effective: LoggingEffectiveSchema,
29770
+ explicit: LoggingExplicitSchema,
29771
+ activeWindows: z.array(DiagnosticWindowSchema).readonly(),
29772
+ persisted: z.boolean()
29773
+ });
29396
29774
  var systemCapability = {
29397
29775
  name: "system",
29398
29776
  scope: "system",
@@ -29436,6 +29814,38 @@ var systemCapability = {
29436
29814
  detectSiteLocation: method(z.void(), SiteLocationStatusSchema, {
29437
29815
  kind: "mutation",
29438
29816
  auth: "admin"
29817
+ }),
29818
+ /**
29819
+ * Read the HTTP request census - which caller, from which address, with
29820
+ * which user-agent, invoked which tRPC procedure, and how often.
29821
+ *
29822
+ * Reading NEVER re-arms: re-arming clears the counts, which would throw
29823
+ * away exactly the numbers being asked for. A closed window may be read as
29824
+ * many times as the operator likes and always describes the same window.
29825
+ *
29826
+ * Admin-only: the rows carry source addresses and principal names.
29827
+ */
29828
+ getRequestCensus: method(z.void(), RequestCensusStatusSchema, { auth: "admin" }),
29829
+ /**
29830
+ * The logging settings document — levels and armed diagnostics — resolved
29831
+ * for `nodeId`, or for the cluster when `nodeId` is absent.
29832
+ *
29833
+ * Returns BOTH `effective` and `explicit`. See
29834
+ * {@link LoggingLevelLayerSchema} for why collapsing them is the defect.
29835
+ */
29836
+ getLoggingSettings: method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }),
29837
+ /**
29838
+ * Write the logging settings document. The ONLY write authority over log
29839
+ * levels and diagnostic windows — arming the request census went through
29840
+ * `system.setRequestCensus` until 2026-08-27 and no longer does, because
29841
+ * two writes that disagree about the same window is exactly the defect
29842
+ * this document exists to remove (D245).
29843
+ *
29844
+ * The patch MERGES: see {@link LoggingSettingsPatchSchema}.
29845
+ */
29846
+ setLoggingSettings: method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29847
+ kind: "mutation",
29848
+ auth: "admin"
29439
29849
  })
29440
29850
  },
29441
29851
  /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
@@ -30507,6 +30917,170 @@ var zoneRulesCapability = {
30507
30917
  durability: "restored"
30508
30918
  };
30509
30919
  /**
30920
+ * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
30921
+ * valutatore puro del suo FRONTE.
30922
+ *
30923
+ * Viveva dentro il builtin virtual-doorbell
30924
+ * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
30925
+ * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
30926
+ * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
30927
+ * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
30928
+ * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
30929
+ * SPOSTA qui e il doorbell la ri-esporta.
30930
+ *
30931
+ * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
30932
+ * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
30933
+ * regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
30934
+ * booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
30935
+ */
30936
+ /**
30937
+ * Known binary / switch source caps → the boolean slice field whose
30938
+ * false→true rise counts as ACTIVE. Every entry is "fire on active".
30939
+ * Sensors whose "active" reading is not a plain boolean (presence's string
30940
+ * state, connectivity's connected flag) are deliberately excluded — a
30941
+ * reconnect is not a doorbell press, and it is not a recording either.
30942
+ */
30943
+ var SOURCE_CAP_ACTIVE_FIELD = {
30944
+ contact: "entryOpen",
30945
+ binary: "on",
30946
+ switch: "on",
30947
+ motion: "detected",
30948
+ flood: "flooded",
30949
+ gas: "detected",
30950
+ smoke: "detected",
30951
+ "carbon-monoxide": "detected",
30952
+ vibration: "detected",
30953
+ tamper: "tampered"
30954
+ };
30955
+ /**
30956
+ * The same caps → the slice field carrying the ms-epoch timestamp of the
30957
+ * last transition. Every source cap MUST appear here (guarded by a spec):
30958
+ * without a transition timestamp the evaluator cannot tell a genuine rise
30959
+ * from a boot-time hydration when the FIRST slice it ever sees is already
30960
+ * active, and errs towards silence — swallowing the rise.
30961
+ *
30962
+ * These timestamps are UPSTREAM ones, not ingest ones: the Home Assistant
30963
+ * provider derives them from `state.last_changed`, so they survive our own
30964
+ * restarts and correctly read as "hours ago" for a state that has been
30965
+ * active for hours. `motion` names its rise timestamp `lastDetectedAt`.
30966
+ */
30967
+ var SOURCE_CAP_CHANGED_AT_FIELD = {
30968
+ contact: "lastChangedAt",
30969
+ binary: "lastChangedAt",
30970
+ switch: "lastChangedAt",
30971
+ motion: "lastDetectedAt",
30972
+ flood: "lastChangedAt",
30973
+ gas: "lastChangedAt",
30974
+ smoke: "lastChangedAt",
30975
+ "carbon-monoxide": "lastChangedAt",
30976
+ vibration: "lastChangedAt",
30977
+ tamper: "lastChangedAt"
30978
+ };
30979
+ /** Cap names whose presence in a device's bindings qualify it as a source. */
30980
+ var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
30981
+ /**
30982
+ * Device `type` values (from `DeviceType`) that can host a binary/switch
30983
+ * source cap. Used by the camera's `device-multiselect` picker as the
30984
+ * CLIENT-SIDE filter, alongside `SOURCE_CAPS`.
30985
+ *
30986
+ * Why types and not caps alone: the shared picker filters
30987
+ * `deviceManager.listAll` rows client-side, and those rows carry only the
30988
+ * device's advertised `features` — NOT its registered cap list. On the live
30989
+ * cluster binary sensors and switches advertise EMPTY features (features
30990
+ * mirror only a handful of caps like `motion-trigger`), so a caps-only
30991
+ * filter matched against `features` would list nothing (the very bug this
30992
+ * replaced, which relied on the now-empty `getAllBindings`). Matching by
30993
+ * `type` is the reliable client-side signal; the union with `SOURCE_CAPS`
30994
+ * still captures any device that DOES advertise a source-cap feature.
30995
+ * `sensor` covers contact/motion/flood/gas/smoke/CO/vibration/tamper,
30996
+ * `switch` covers switches, `control` covers generic binary actuators.
30997
+ */
30998
+ var SOURCE_DEVICE_TYPES = [
30999
+ "sensor",
31000
+ "switch",
31001
+ "control"
31002
+ ];
31003
+ /** True when a cap is a recognised binary/switch source. */
31004
+ function isSourceCap(capName) {
31005
+ return Object.prototype.hasOwnProperty.call(SOURCE_CAP_ACTIVE_FIELD, capName);
31006
+ }
31007
+ /** Extract the "active" boolean a source cap's slice carries, or null when
31008
+ * the cap is unknown or the field is missing / non-boolean. */
31009
+ function sliceActiveValue(capName, slice) {
31010
+ const field = SOURCE_CAP_ACTIVE_FIELD[capName];
31011
+ if (field === void 0) return null;
31012
+ const raw = slice[field];
31013
+ return typeof raw === "boolean" ? raw : null;
31014
+ }
31015
+ /** Ms-epoch transition timestamp a source cap's slice carries, or null when
31016
+ * it is absent, non-numeric or the zero "never observed" sentinel. */
31017
+ function sliceChangedAt(capName, slice) {
31018
+ const field = SOURCE_CAP_CHANGED_AT_FIELD[capName];
31019
+ if (field === void 0) return null;
31020
+ const raw = slice[field];
31021
+ if (typeof raw !== "number" || !Number.isFinite(raw) || raw <= 0) return null;
31022
+ return raw;
31023
+ }
31024
+ /**
31025
+ * How recent a source's own transition timestamp must be for a FIRST
31026
+ * sighting that is already active to count as a genuine rise rather than a
31027
+ * hydration of long-standing state.
31028
+ */
31029
+ var DEFAULT_FIRST_SIGHTING_FRESHNESS_MS = 3e4;
31030
+ /**
31031
+ * IL fronte. Puro: nessun orologio proprio, nessuna memoria — il chiamante
31032
+ * porta `prior`, `nowMs` e il proprio `startedAtMs`.
31033
+ *
31034
+ * Il caso della PRIMA slice già attiva è trattato esplicitamente e vale come
31035
+ * fronte solo se il timestamp UPSTREAM della transizione è posteriore a
31036
+ * `startedAtMs` **e** entro `firstSightingFreshnessMs`. Entrambe le metà
31037
+ * servono: la sola freschezza scatterebbe su un'idratazione al boot di uno
31038
+ * stato flippato pochi secondi prima del riavvio, e il solo "dopo che abbiamo
31039
+ * iniziato" scatterebbe, su un processo di lunga vita, per una sorgente
31040
+ * adottata oggi il cui stato è cambiato ieri. Il caso ambiguo ERRA VERSO IL
31041
+ * SILENZIO e lo dichiara (`baseline-seeded-stale-active`).
31042
+ */
31043
+ function evaluateSensorEdge(input) {
31044
+ const value = sliceActiveValue(input.capName, input.slice);
31045
+ if (value === null) return {
31046
+ edge: "none",
31047
+ value: null,
31048
+ reason: isSourceCap(input.capName) ? "non-boolean-value" : "unknown-cap"
31049
+ };
31050
+ if (input.prior === void 0) {
31051
+ if (!value) return {
31052
+ edge: "none",
31053
+ value,
31054
+ reason: "baseline-seeded-inactive"
31055
+ };
31056
+ const changedAt = sliceChangedAt(input.capName, input.slice);
31057
+ const floor = Math.max(input.startedAtMs, input.nowMs - input.firstSightingFreshnessMs);
31058
+ if (changedAt === null || changedAt < floor) return {
31059
+ edge: "none",
31060
+ value,
31061
+ reason: "baseline-seeded-stale-active"
31062
+ };
31063
+ return {
31064
+ edge: "rising",
31065
+ value: true
31066
+ };
31067
+ }
31068
+ if (input.prior === value) return {
31069
+ edge: "none",
31070
+ value,
31071
+ reason: "no-change"
31072
+ };
31073
+ if (!value) return {
31074
+ edge: "none",
31075
+ value,
31076
+ reason: "falling-edge"
31077
+ };
31078
+ return {
31079
+ edge: "rising",
31080
+ value: true
31081
+ };
31082
+ }
31083
+ /**
30510
31084
  * Runtime defaults -- used by ConfigManager.get() for backward compatibility
30511
31085
  * until Plan B wires all runtime settings to the system_settings SQL table.
30512
31086
  *
@@ -30582,6 +31156,24 @@ var AccessoryKind = {
30582
31156
  PrivacyMask: DeviceRole.PrivacyMask
30583
31157
  };
30584
31158
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
31159
+ /**
31160
+ * THE derivation. One crop rectangle, one presence verdict — see D52 for why
31161
+ * this repo insists a derived value has exactly one implementation.
31162
+ *
31163
+ * `undefined` status ⇒ `sleeping`. A device with no slice has made no claim,
31164
+ * and the caller decides separately whether it is even battery-operated
31165
+ * (`DeviceFeature.BatteryOperated`); this function never answers that
31166
+ * question, only what a battery device is doing.
31167
+ */
31168
+ function deriveBatteryPresence(input) {
31169
+ const status = input.status;
31170
+ if (!status) return "sleeping";
31171
+ if (status.sleeping !== true) return "awake";
31172
+ const lastContactAt = status.lastContactAt;
31173
+ if (typeof lastContactAt !== "number" || lastContactAt <= 0) return "sleeping";
31174
+ const budget = input.unreachableAfterMs ?? 216e5;
31175
+ return input.nowMs - lastContactAt > budget ? "unreachable" : "sleeping";
31176
+ }
30585
31177
  /** Marker written to a declared integration's `info`. */
30586
31178
  var DECLARED_INTEGRATION_FIXED_KEY = "fixed";
30587
31179
  /**
@@ -30823,24 +31415,6 @@ var DeclaredDevices = class {
30823
31415
  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;
30824
31416
  new Set(Object.values(DeviceType));
30825
31417
  DeviceFeature.BatteryOperated;
30826
- /**
30827
- * THE derivation. One crop rectangle, one presence verdict — see D52 for why
30828
- * this repo insists a derived value has exactly one implementation.
30829
- *
30830
- * `undefined` status ⇒ `sleeping`. A device with no slice has made no claim,
30831
- * and the caller decides separately whether it is even battery-operated
30832
- * (`DeviceFeature.BatteryOperated`); this function never answers that
30833
- * question, only what a battery device is doing.
30834
- */
30835
- function deriveBatteryPresence(input) {
30836
- const status = input.status;
30837
- if (!status) return "sleeping";
30838
- if (status.sleeping !== true) return "awake";
30839
- const lastContactAt = status.lastContactAt;
30840
- if (typeof lastContactAt !== "number" || lastContactAt <= 0) return "sleeping";
30841
- const budget = input.unreachableAfterMs ?? 216e5;
30842
- return input.nowMs - lastContactAt > budget ? "unreachable" : "sleeping";
30843
- }
30844
31418
  /** Unwrap ZodNullable / ZodOptional / ZodDefault wrappers to reach the inner type.
30845
31419
  * Zod v4 exposes `.unwrap()` on all three wrapper classes. */
30846
31420
  function unwrap(schema) {
@@ -36291,6 +36865,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
36291
36865
  addonId: null,
36292
36866
  access: "create"
36293
36867
  },
36868
+ "system.getLoggingSettings": {
36869
+ capName: "system",
36870
+ capScope: "system",
36871
+ addonId: null,
36872
+ access: "view"
36873
+ },
36874
+ "system.getRequestCensus": {
36875
+ capName: "system",
36876
+ capScope: "system",
36877
+ addonId: null,
36878
+ access: "view"
36879
+ },
36294
36880
  "system.getRetentionConfig": {
36295
36881
  capName: "system",
36296
36882
  capScope: "system",
@@ -36321,6 +36907,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
36321
36907
  addonId: null,
36322
36908
  access: "view"
36323
36909
  },
36910
+ "system.setLoggingSettings": {
36911
+ capName: "system",
36912
+ capScope: "system",
36913
+ addonId: null,
36914
+ access: "create"
36915
+ },
36324
36916
  "system.setRetentionConfig": {
36325
36917
  capName: "system",
36326
36918
  capScope: "system",
@@ -37476,6 +38068,10 @@ Object.freeze({
37476
38068
  name: "deviceId",
37477
38069
  form: "single",
37478
38070
  optional: true
38071
+ }, {
38072
+ name: "deviceIds",
38073
+ form: "array",
38074
+ optional: true
37479
38075
  }],
37480
38076
  "fanControl.setDirection": [{
37481
38077
  name: "deviceId",
@@ -39366,7 +39962,38 @@ z.object({
39366
39962
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
39367
39963
  * reproduce that.
39368
39964
  */
39369
- tileBudgetMb: z.number().int().min(0).max(1024)
39965
+ tileBudgetMb: z.number().int().min(0).max(1024),
39966
+ /**
39967
+ * RAM ceiling per decode worker, in MB, for the SCENE TILES — one
39968
+ * JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
39969
+ * subject tiles, on frames that detected something.
39970
+ *
39971
+ * It exists because a subject tile cannot answer a FULL-FRAME request:
39972
+ * containment is strict by design, so the native `keyFrame`, the detail
39973
+ * plane's `frameJpeg` rung and the display-crop fallback had no rung at all
39974
+ * below the hold. Measured on the live cluster: 23.3% of key-frame captures
39975
+ * missed, 95.7% of them with `worker-lease-gone` — the raster released one
39976
+ * frame-time after delivery, with the request only p50 367 ms behind it.
39977
+ *
39978
+ * Sizing, and why this is a budget and not a duration: a scene tile is
39979
+ * ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
39980
+ * ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
39981
+ * camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
39982
+ * frames, i.e. the store's 30 s TTL binds at the steady state and the budget
39983
+ * binds only through a detection burst, where it still covers well past the
39984
+ * measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
39985
+ * would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
39986
+ * whole shape exists to avoid.
39987
+ *
39988
+ * A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
39989
+ * subject tile, so one shared budget would let a busy camera's key frames
39990
+ * evict the face/plate tiles the recognisers depend on. Two budgets make that
39991
+ * impossible rather than unlikely. `0` DISABLES scene tiles and restores the
39992
+ * pre-existing behaviour, where a late full-frame request had nothing but the
39993
+ * ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
39994
+ * nothing.
39995
+ */
39996
+ sceneBudgetMb: z.number().int().min(0).max(1024)
39370
39997
  });
39371
39998
  /**
39372
39999
  * The values in force when the operator has set nothing.
@@ -39382,12 +40009,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
39382
40009
  budgetMb: 1024,
39383
40010
  activityMs: 15e3,
39384
40011
  tileBudgetMb: 64,
40012
+ sceneBudgetMb: 48,
39385
40013
  admission: "inferred"
39386
40014
  };
39387
40015
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
39388
40016
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
39389
40017
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
39390
40018
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
40019
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
39391
40020
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
39392
40021
  /**
39393
40022
  * The addon id as the REGISTRY, the wire and the durable stores spell it.
@@ -39559,4 +40188,4 @@ function enumerateInferenceDevices(hw) {
39559
40188
  return out;
39560
40189
  }
39561
40190
  //#endregion
39562
- export { metricsProviderCapability as $, dataStoreProviderCapability as A, asJsonObject as At, extractNestedAddonId as B, parseJsonObject as Bt, backupCapability as C, DEVICE_STATUS_METHOD as Ct, coreBlockAddonId as D, ReadinessRegistry as Dt, buildStreamParamsConfigSchema as E, DeviceType as Et, deviceStatusCapability as F, emitReadiness as Ft, isSameAddonId as G, sleep as Gt, isArrayOutputSchema as H, readinessKey as Ht, doorbellCapability as I, expandCapMethods as It, lifecycleJobSchema as J, isVoidInput as K, EventCategory as Kt, enumerateInferenceDevices as L, hydrateSchema as Lt, deriveBatteryPresence as M, asString as Mt, deviceManagerCapability as N, createEvent as Nt, coreBlockIdFromAddonId as O, ReadinessTimeoutError as Ot, deviceStateCapability as P, emitDownForOwnedCaps as Pt, looseSchema as Q, enumerateItemArrayFields as R, isDeviceConfigCap as Rt, authProviderCapability as S, DEVICE_SETTINGS_CONTRIBUTION_METHODS as St, batteryCapability as T, DeviceRole as Tt, isCollectionArrayMethod as U, resolveCapMount as Ut, filesystemBrowseCapability as V, parseJsonUnknown as Vt, isObjectInput as W, scopeKey as Wt, logDestinationCapability as X, localNetworkCapability as Y, logLevelAtMost as Z, UserRecordSchema as _, vectorDimFromBase64 as _t, CAP_NAMES_WITH_STATUS as a, resolveMethodAuth as at, addonWidgetsCapability as b, BaseAddon as bt, CoreBlockSchema as c, scopesAllowDeviceCap as ct, METHOD_ACCESS_MAP as d, snapshotCapability as dt, normalizeUnit as et, RUNTIME_DEFAULTS as f, storageCapability as ft, StorageMigrationJobSchema as g, userManagementCapability as gt, StorageLocationTypeSchema as h, streamQualityLabel as ht, BatteryStatusSchema as i, procedureAuthKey as it, decodeVectorBase64 as j, asNumber as jt, coreBlocksCapability as k, WELL_KNOWN_TAB_MAP as kt, DeclaredDevices as l, scoreRuntimes as lt, ScopedTokenSchema as m, storageProviderCapability as mt, AlertSchema as n, parseStreamParamsFormPatch as nt, CORE_BLOCKS_ADDON_ID as o, runtimeStatePolicyFor as ot, STREAM_PROFILE_META as p, storageMigrationCapability as pt, kebabToCamel as q, ApiKeyRecordSchema as r, platformProbeCapability as rt, CORE_BLOCK_ADDON_PREFIX as s, scopesAllowAddon as st, ALL_CAPABILITY_DEFINITIONS as t, objectInputDeclaresAddonId as tt, DeviceStatusSchema as u, settingsStoreCapability as ut, addonPagesCapability as v, vectorStoreCapability as vt, bareAddonId as w, DeviceFeature as wt, alertsCapability as x, DATAPLANE_SECRET_HEADER as xt, addonSettingsCapability as y, errMsg as yt, enumerateSchemaFields as z, nodePin as zt };
40191
+ export { kebabToCamel as $, buildStreamParamsConfigSchema as A, DeviceFeature as At, doorbellCapability as B, emitDownForOwnedCaps as Bt, addonSettingsCapability as C, vectorDimFromBase64 as Ct, backupCapability as D, DATAPLANE_SECRET_HEADER as Dt, authProviderCapability as E, BaseAddon as Et, decodeVectorBase64 as F, WELL_KNOWN_TAB_MAP as Ft, extractNestedAddonId as G, nodePin as Gt, enumerateItemArrayFields as H, expandCapMethods as Ht, deriveBatteryPresence as I, asJsonObject as It, isCollectionArrayMethod as J, readinessKey as Jt, filesystemBrowseCapability as K, parseJsonObject as Kt, deviceManagerCapability as L, asNumber as Lt, coreBlockIdFromAddonId as M, DeviceType as Mt, coreBlocksCapability as N, ReadinessRegistry as Nt, bareAddonId as O, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Ot, dataStoreProviderCapability as P, ReadinessTimeoutError as Pt, isVoidInput as Q, EventCategory as Qt, deviceStateCapability as R, asString as Rt, addonPagesCapability as S, userManagementCapability as St, alertsCapability as T, errMsg as Tt, enumerateSchemaFields as U, hydrateSchema as Ut, enumerateInferenceDevices as V, emitReadiness as Vt, evaluateSensorEdge as W, isDeviceConfigCap as Wt, isSameAddonId as X, scopeKey as Xt, isObjectInput as Y, resolveCapMount as Yt, isSourceCap as Z, sleep as Zt, STREAM_PROFILE_META as _, snapshotCapability as _t, CAP_NAMES_WITH_STATUS as a, metricsProviderCapability as at, StorageMigrationJobSchema as b, storageProviderCapability as bt, CoreBlockSchema as c, parseStreamParamsFormPatch as ct, DeviceStatusSchema as d, resolveMethodAuth as dt, lifecycleJobSchema as et, LOG_LEVEL_RANK as f, runtimeStatePolicyFor as ft, SOURCE_DEVICE_TYPES as g, settingsStoreCapability as gt, SOURCE_CAPS as h, scoreRuntimes as ht, BatteryStatusSchema as i, looseSchema as it, coreBlockAddonId as j, DeviceRole as jt, batteryCapability as k, DEVICE_STATUS_METHOD as kt, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as l, platformProbeCapability as lt, RUNTIME_DEFAULTS as m, scopesAllowDeviceCap as mt, AlertSchema as n, logDestinationCapability as nt, CORE_BLOCKS_ADDON_ID as o, normalizeUnit as ot, METHOD_ACCESS_MAP as p, scopesAllowAddon as pt, isArrayOutputSchema as q, parseJsonUnknown as qt, ApiKeyRecordSchema as r, logLevelAtMost as rt, CORE_BLOCK_ADDON_PREFIX as s, objectInputDeclaresAddonId as st, ALL_CAPABILITY_DEFINITIONS as t, localNetworkCapability as tt, DeclaredDevices as u, procedureAuthKey as ut, ScopedTokenSchema as v, storageCapability as vt, addonWidgetsCapability as w, vectorStoreCapability as wt, UserRecordSchema as x, streamQualityLabel as xt, StorageLocationTypeSchema as y, storageMigrationCapability as yt, deviceStatusCapability as z, createEvent as zt };