@camstack/addon-pipeline 1.2.131 → 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-DCQ5AP_v.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-DO0UVhOk.mjs → dist-7Uc6NdFm.mjs} +736 -67
  7. package/dist/{dist-CqoMNE1e.js → dist-DsnZUYTs.js} +753 -66
  8. package/dist/{event-loop-stall-monitor-eM7_yYfn.js → event-loop-stall-monitor-D86J6d2c.js} +1 -1
  9. package/dist/{event-loop-stall-monitor-D0Juf7Dn.mjs → event-loop-stall-monitor-XzDMVU9d.mjs} +1 -1
  10. package/dist/{lazy-sharp-BGrpS8yi.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-Bac3FuG6.mjs → process-memory-Ci90-zF_.mjs} +1 -1
  16. package/dist/{process-memory-xAPjvSw9.js → process-memory-Co59RQIK.js} +1 -1
  17. package/dist/recorder/index.js +677 -99
  18. package/dist/recorder/index.mjs +676 -98
  19. package/dist/{segment-demux-js-skhsAZx6.mjs → segment-demux-js-0NZ9TXro.mjs} +1 -1
  20. package/dist/{segment-demux-js-Cu0oDMUL.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-DGQkDEYw.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-CQKwHIHI.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-D7FwwZgj.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-_Ujvj1hl.mjs → worker-protocol-CMDUAqvX.mjs} +12 -6
  34. package/dist/{worker-protocol-G3HXTY8z.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-Bme2OZQp.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",
@@ -17337,7 +17415,23 @@ var NcHistoryEntrySchema = object({
17337
17415
  updatedAt: number(),
17338
17416
  /** Failure detail — present on a `dead` row. */
17339
17417
  error: string().optional(),
17340
- subject: NcHistorySubjectSchema
17418
+ subject: NcHistorySubjectSchema,
17419
+ /**
17420
+ * Ids of the artefacts (still, then gif, then clip) this row's successful
17421
+ * delivery indexed in the artefact library — a REFERENCE, never the bytes
17422
+ * (an artefact is often megabytes; this row is durable JSON rewritten on
17423
+ * every delivery attempt). Absent on a row still pending/dead, a row
17424
+ * delivered before this field shipped, or a wiring with no artefact index.
17425
+ *
17426
+ * Resolve one to a fetchable URL with `resolveArtifactUrl` — an id
17427
+ * outlives any one URL's TTL, so a caller mints a fresh link on demand
17428
+ * rather than trusting one frozen at delivery time. `resolveArtifactUrl`
17429
+ * also answers `null` for an id whose artefact has since expired past the
17430
+ * retained shelf's own age bound — the degrade a caller (the Home
17431
+ * Assistant export) must render as "no image right now", never as a
17432
+ * broken link.
17433
+ */
17434
+ artifactIds: array(string().min(1)).optional()
17341
17435
  });
17342
17436
  /**
17343
17437
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -17564,7 +17658,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
17564
17658
  }), method(object({}), object({
17565
17659
  catalog: array(NcConditionDescriptorSchema),
17566
17660
  taxonomy: NcTaxonomySchema.optional()
17567
- })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
17661
+ })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
17568
17662
  kind: "mutation",
17569
17663
  caller: "required"
17570
17664
  }), method(object({ snoozeId: string() }), object({ success: literal(true) }), {
@@ -23080,7 +23174,7 @@ var lifecycleJobSchema = object({
23080
23174
  * `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
23081
23175
  * as every other cap.
23082
23176
  */
23083
- var LogLevelSchema$1 = _enum([
23177
+ var LogLevelSchema$2 = _enum([
23084
23178
  "debug",
23085
23179
  "info",
23086
23180
  "warn",
@@ -23287,7 +23381,7 @@ var CustomActionInputSchema = object({
23287
23381
  method(_void(), array(AddonListItemSchema).readonly()), method(object({
23288
23382
  addonId: string(),
23289
23383
  limit: number().min(1).max(500).default(100),
23290
- level: LogLevelSchema$1.optional()
23384
+ level: LogLevelSchema$2.optional()
23291
23385
  }), array(LogQueryEntrySchema)), method(_void(), array(InstalledPackageSchema).readonly()), method(object({
23292
23386
  packageName: string(),
23293
23387
  version: string().optional()
@@ -23385,7 +23479,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
23385
23479
  auth: "admin"
23386
23480
  }), method(object({
23387
23481
  addonId: string(),
23388
- level: LogLevelSchema$1.optional()
23482
+ level: LogLevelSchema$2.optional()
23389
23483
  }), LogStreamEntrySchema, { kind: "subscription" });
23390
23484
  object({
23391
23485
  /** Carbon dioxide concentration in ppm. */
@@ -24446,6 +24540,35 @@ var FaceFilterEnum = _enum([
24446
24540
  "identified",
24447
24541
  "all"
24448
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
+ });
24449
24572
  var MediaFileLiteSchema$1 = object({
24450
24573
  key: string(),
24451
24574
  kind: string(),
@@ -24492,24 +24615,72 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24492
24615
  kind: "mutation",
24493
24616
  auth: "admin"
24494
24617
  }), method(object({
24495
- /** 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
+ */
24496
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(),
24497
24642
  limit: number().int().positive().optional(),
24498
24643
  filter: FaceFilterEnum.optional(),
24499
24644
  /**
24500
- * Inline the base64 crop on every row. Default `true` — the existing
24501
- * 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.
24502
24658
  *
24503
- * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
24504
- * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
24505
- * the browser cache the images.
24659
+ * See {@link FaceSortFieldEnum} for what a row with no suggestion
24660
+ * does under `'suggestionConfidence'`.
24506
24661
  *
24507
- * **This is an INPUT field, so it does not reach the addon until the
24508
- * next train.** The hub router validates cap inputs against its own
24509
- * compiled Zod, which strips a key it does not know verified today
24510
- * on the OUTPUT side, where an additive field DOES arrive immediately
24511
- * (`Track.hasFace`). Until the train ships, sending `false` is
24512
- * 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.
24513
24684
  */
24514
24685
  includeCrops: boolean().optional()
24515
24686
  }).optional(), array(FaceInfoSchema).readonly()), method(object({
@@ -24545,13 +24716,39 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
24545
24716
  }), method(object({
24546
24717
  threshold: number().min(0).max(1).optional(),
24547
24718
  minClusterSize: number().int().min(2).optional(),
24548
- limit: number().int().positive().optional()
24549
- }).optional(), array(object({
24550
- faceIds: array(string()).readonly(),
24551
- representativeFaceId: string(),
24552
- size: number().int(),
24553
- cohesion: number()
24554
- })).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());
24555
24752
  /**
24556
24753
  * Fan-control cap. Models HA `fan.*` entity-specific surfaces:
24557
24754
  * speed percentage, preset modes, ceiling-fan direction, and
@@ -27351,6 +27548,39 @@ var ReadGopBytesResultSchema = object({
27351
27548
  /** Media ms the returned fragment covers. */
27352
27549
  gopDurMs: number()
27353
27550
  });
27551
+ /**
27552
+ * A time WINDOW of one finalized segment, cut by byte range — the multi-GOP
27553
+ * twin of {@link ReadGopBytesResultSchema}'s single instant. Built for the
27554
+ * replay clip's `recording` source (`docs/design/plans/2026-08-26-replay-clip-su-pipeline.md`):
27555
+ * a replay needs several seconds of native pixels, not one frame.
27556
+ *
27557
+ * `ok.data` is standalone-demuxable, same as a GOP read. `ok.reachesRequestedEnd`
27558
+ * is `false` when the returned bytes were cut short by the read's own safety
27559
+ * byte cap before covering `[fromMs, toMs)` — a truncation, reported, not a
27560
+ * silently shorter answer. `spans-multiple-segments` is a REFUSAL, not a
27561
+ * degradation: a window whose end falls past the covering segment would need
27562
+ * bytes stitched from a second segment file (its own `ftyp`+`moov`), which is
27563
+ * not one standalone-demuxable stream — the caller's answer is to request a
27564
+ * shorter window or one aligned to a single segment, not to receive spliced
27565
+ * bytes nothing has proven decodable.
27566
+ */
27567
+ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
27568
+ kind: literal("ok"),
27569
+ data: _instanceof(Uint8Array),
27570
+ /** Absolute epoch ms of the returned bytes' first sample — at or before
27571
+ * the requested `fromMs` (anchored on the nearest keyframe). */
27572
+ gopStartMs: number(),
27573
+ /** Media ms the returned bytes cover, from `gopStartMs`. */
27574
+ gopDurMs: number(),
27575
+ /** `false` ⇒ the safety byte cap cut the read short before it reached
27576
+ * the requested `toMs`; the caller got fewer frames than asked for. */
27577
+ reachesRequestedEnd: boolean()
27578
+ }), object({
27579
+ kind: literal("spans-multiple-segments"),
27580
+ /** Where the covering segment's own footage runs out — informational,
27581
+ * not a retry hint (retrying the same window would refuse again). */
27582
+ segmentEndMs: number()
27583
+ })]);
27354
27584
  var recordingCapability = {
27355
27585
  name: "recording",
27356
27586
  scope: "system",
@@ -27430,6 +27660,21 @@ var recordingCapability = {
27430
27660
  kind: "query",
27431
27661
  auth: "admin"
27432
27662
  }),
27663
+ /** Read a WINDOW `[fromMs, toMs)` of segment `startMs`, by mfra byte
27664
+ * range — the multi-GOP twin of `readGopBytes`. Refuses (does not
27665
+ * degrade) when the window runs past the covering segment. Used by the
27666
+ * replay clip's `recording` source to fetch several seconds of native
27667
+ * footage for its single ffmpeg decode pass. */
27668
+ readWindowBytes: method(object({
27669
+ deviceId: number(),
27670
+ profile: string(),
27671
+ startMs: number(),
27672
+ fromMs: number(),
27673
+ toMs: number()
27674
+ }), ReadWindowBytesResultSchema, {
27675
+ kind: "query",
27676
+ auth: "admin"
27677
+ }),
27433
27678
  setDeviceConfig: method(object({
27434
27679
  deviceId: number(),
27435
27680
  config: RecordingConfigSchema
@@ -28385,6 +28630,211 @@ var SetSiteLocationInputSchema = object({
28385
28630
  latitude: number().min(-90).max(90),
28386
28631
  longitude: number().min(-180).max(180)
28387
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
+ });
28388
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(), {
28389
28839
  kind: "mutation",
28390
28840
  auth: "admin"
@@ -28397,6 +28847,9 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28397
28847
  }), method(_void(), SiteLocationStatusSchema, {
28398
28848
  kind: "mutation",
28399
28849
  auth: "admin"
28850
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28851
+ kind: "mutation",
28852
+ auth: "admin"
28400
28853
  });
28401
28854
  object({
28402
28855
  /** True when the device's tamper switch / case-open contact is
@@ -29025,6 +29478,146 @@ DeviceType.Camera, method(object({
29025
29478
  detection: array(ZoneRuleSchema).readonly(),
29026
29479
  package: array(ZoneRuleSchema).readonly()
29027
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
+ }
29028
29621
  var HF_BASE_URL = `https://huggingface.co/camstack/camstack-models/resolve/main`;
29029
29622
  /**
29030
29623
  * Accessory device helpers — shared across drivers.
@@ -29065,9 +29658,6 @@ var AccessoryKind = {
29065
29658
  PrivacyMask: DeviceRole.PrivacyMask
29066
29659
  };
29067
29660
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
29068
- 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;
29069
- new Set(Object.values(DeviceType));
29070
- DeviceFeature.BatteryOperated;
29071
29661
  /**
29072
29662
  * THE derivation. One crop rectangle, one presence verdict — see D52 for why
29073
29663
  * this repo insists a derived value has exactly one implementation.
@@ -29086,6 +29676,9 @@ function deriveBatteryPresence(input) {
29086
29676
  const budget = input.unreachableAfterMs ?? 216e5;
29087
29677
  return input.nowMs - lastContactAt > budget ? "unreachable" : "sleeping";
29088
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;
29089
29682
  Object.freeze({
29090
29683
  "accessories.setChildHidden": {
29091
29684
  capName: "accessories",
@@ -31991,6 +32584,12 @@ Object.freeze({
31991
32584
  addonId: null,
31992
32585
  access: "view"
31993
32586
  },
32587
+ "notificationRules.resolveArtifactUrl": {
32588
+ capName: "notification-rules",
32589
+ capScope: "system",
32590
+ addonId: null,
32591
+ access: "view"
32592
+ },
31994
32593
  "notificationRules.setAlarmConfig": {
31995
32594
  capName: "notification-rules",
31996
32595
  capScope: "system",
@@ -33395,6 +33994,12 @@ Object.freeze({
33395
33994
  addonId: null,
33396
33995
  access: "view"
33397
33996
  },
33997
+ "recording.readWindowBytes": {
33998
+ capName: "recording",
33999
+ capScope: "system",
34000
+ addonId: null,
34001
+ access: "view"
34002
+ },
33398
34003
  "recording.refreshStorageLocationsForMigration": {
33399
34004
  capName: "recording",
33400
34005
  capScope: "system",
@@ -34235,6 +34840,18 @@ Object.freeze({
34235
34840
  addonId: null,
34236
34841
  access: "create"
34237
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
+ },
34238
34855
  "system.getRetentionConfig": {
34239
34856
  capName: "system",
34240
34857
  capScope: "system",
@@ -34265,6 +34882,12 @@ Object.freeze({
34265
34882
  addonId: null,
34266
34883
  access: "view"
34267
34884
  },
34885
+ "system.setLoggingSettings": {
34886
+ capName: "system",
34887
+ capScope: "system",
34888
+ addonId: null,
34889
+ access: "create"
34890
+ },
34268
34891
  "system.setRetentionConfig": {
34269
34892
  capName: "system",
34270
34893
  capScope: "system",
@@ -35420,6 +36043,10 @@ Object.freeze({
35420
36043
  name: "deviceId",
35421
36044
  form: "single",
35422
36045
  optional: true
36046
+ }, {
36047
+ name: "deviceIds",
36048
+ form: "array",
36049
+ optional: true
35423
36050
  }],
35424
36051
  "fanControl.setDirection": [{
35425
36052
  name: "deviceId",
@@ -36225,6 +36852,11 @@ Object.freeze({
36225
36852
  form: "single",
36226
36853
  optional: false
36227
36854
  }],
36855
+ "recording.readWindowBytes": [{
36856
+ name: "deviceId",
36857
+ form: "single",
36858
+ optional: false
36859
+ }],
36228
36860
  "recording.relocateFootage": [{
36229
36861
  name: "deviceId",
36230
36862
  form: "single",
@@ -37245,6 +37877,7 @@ var NATIVE_LEASE_BUDGET_KEY = "nativeLeaseBudgetMb";
37245
37877
  var NATIVE_LEASE_ACTIVITY_KEY = "nativeLeaseActivityMs";
37246
37878
  var NATIVE_LEASE_ADMISSION_KEY = "nativeLeaseAdmission";
37247
37879
  var NATIVE_LEASE_TILE_BUDGET_KEY = "nativeTileBudgetMb";
37880
+ var NATIVE_LEASE_SCENE_BUDGET_KEY = "nativeSceneBudgetMb";
37248
37881
  /**
37249
37882
  * WHICH delivered frames the decode worker retains a native copy of.
37250
37883
  *
@@ -37339,7 +37972,38 @@ var NativeLeaseSettingsSchema = object({
37339
37972
  * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
37340
37973
  * reproduce that.
37341
37974
  */
37342
- 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)
37343
38007
  });
37344
38008
  /**
37345
38009
  * The values in force when the operator has set nothing.
@@ -37355,12 +38019,14 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
37355
38019
  budgetMb: 1024,
37356
38020
  activityMs: 15e3,
37357
38021
  tileBudgetMb: 64,
38022
+ sceneBudgetMb: 48,
37358
38023
  admission: "inferred"
37359
38024
  };
37360
38025
  DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
37361
38026
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
37362
38027
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
37363
38028
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
38029
+ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
37364
38030
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
37365
38031
  /**
37366
38032
  * Parse one knob, reporting `null` for absent, junk, out-of-bounds — AND for a
@@ -37409,12 +38075,14 @@ function readNativeLeaseOverride(config) {
37409
38075
  const activityMs = readKnob("activityMs", config[NATIVE_LEASE_ACTIVITY_KEY]);
37410
38076
  const admission = readAdmissionKnob(config[NATIVE_LEASE_ADMISSION_KEY]);
37411
38077
  const tileBudgetMb = readKnob("tileBudgetMb", config[NATIVE_LEASE_TILE_BUDGET_KEY]);
38078
+ const sceneBudgetMb = readKnob("sceneBudgetMb", config[NATIVE_LEASE_SCENE_BUDGET_KEY]);
37412
38079
  return {
37413
38080
  ...holdFrames === null ? {} : { holdFrames },
37414
38081
  ...budgetMb === null ? {} : { budgetMb },
37415
38082
  ...activityMs === null ? {} : { activityMs },
37416
38083
  ...admission === null ? {} : { admission },
37417
- ...tileBudgetMb === null ? {} : { tileBudgetMb }
38084
+ ...tileBudgetMb === null ? {} : { tileBudgetMb },
38085
+ ...sceneBudgetMb === null ? {} : { sceneBudgetMb }
37418
38086
  };
37419
38087
  }
37420
38088
  function isHydratedField(entry) {
@@ -37425,7 +38093,8 @@ var LEASE_KEYS = [
37425
38093
  NATIVE_LEASE_BUDGET_KEY,
37426
38094
  NATIVE_LEASE_ACTIVITY_KEY,
37427
38095
  NATIVE_LEASE_ADMISSION_KEY,
37428
- NATIVE_LEASE_TILE_BUDGET_KEY
38096
+ NATIVE_LEASE_TILE_BUDGET_KEY,
38097
+ NATIVE_LEASE_SCENE_BUDGET_KEY
37429
38098
  ];
37430
38099
  /**
37431
38100
  * Extract the operator's lease overrides from an
@@ -38147,4 +38816,4 @@ function enumerateInferenceDevices(hw) {
38147
38816
  return out;
38148
38817
  }
38149
38818
  //#endregion
38150
- 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 };