@camstack/addon-provider-dreo 0.2.101 → 0.2.103

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 (3) hide show
  1. package/dist/addon.js +501 -19
  2. package/dist/addon.mjs +501 -19
  3. package/package.json +2 -2
package/dist/addon.js CHANGED
@@ -35,7 +35,7 @@ var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["modu
35
35
  //#endregion
36
36
  let crypto$1 = require("crypto");
37
37
  let events = require("events");
38
- //#region ../types/dist/event-category-ZyX6jcse.mjs
38
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
39
39
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
40
40
  EventCategory["SystemBoot"] = "system.boot";
41
41
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -652,6 +652,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
652
652
  * pull-reconcile from the provider's `getStatus` on reconnect. */
653
653
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
654
654
  EventCategory["BackupCompleted"] = "backup.completed";
655
+ /**
656
+ * A whole backup RUN finished — every destination attempted, win or lose.
657
+ *
658
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
659
+ * a progress UI and the wrong one for a notification: an operator with three
660
+ * destinations would be told three times. And a run where two of three
661
+ * destinations succeeded is not a clean success — a single "backup
662
+ * completed" that hid the failed one would be a lie, so the count of each is
663
+ * carried here and the message says both.
664
+ *
665
+ * Emitted by the backup orchestrator only after the destination loop, so a
666
+ * run that dies during the BUILD phase produces no completion at all.
667
+ */
668
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
655
669
  EventCategory["BackupRestored"] = "backup.restored";
656
670
  EventCategory["NotificationDispatched"] = "notification.dispatched";
657
671
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5382,7 +5396,7 @@ var ZodIssueCode = {
5382
5396
  var ZodFirstPartyTypeKind;
5383
5397
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5384
5398
  //#endregion
5385
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5399
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5386
5400
  /**
5387
5401
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5388
5402
  * window to float samples (D455).
@@ -11526,6 +11540,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11526
11540
  auth: "admin"
11527
11541
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11528
11542
  DeviceType.Camera;
11543
+ /**
11544
+ * The signals a device can emit to WAKE its own stream.
11545
+ *
11546
+ * A camera whose stream is built on demand sleeps until something asks for it,
11547
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11548
+ * puller holds a session open for ever, and treating that as demand would keep
11549
+ * a battery camera awake for ever, which is the whole thing the battery is for
11550
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11551
+ * itself, with no stream running.
11552
+ *
11553
+ * ## The vocabulary is the PROVIDER'S, not ours
11554
+ *
11555
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11556
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11557
+ * Reolink offers motion and camera-native detection; another provider may offer
11558
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11559
+ * yet. A fixed enum here would mean every new signal is a framework release.
11560
+ *
11561
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11562
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11563
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11564
+ * binding — but both answer "what drives the detection pipeline", which is a
11565
+ * different question from "what may wake a sleeping stream". A camera can do
11566
+ * the first and not be trusted with the second, and the operator picks per
11567
+ * camera. Two questions, two authorities.
11568
+ *
11569
+ * ## Availability is not permission
11570
+ *
11571
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11572
+ * wakes the stream is the operator's per-camera choice, held by the broker
11573
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11574
+ * provider declaring a signal is not a provider enabling it.
11575
+ */
11576
+ /** One signal a device can emit. */
11577
+ var StreamSignalSchema = object({
11578
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11579
+ code: string().min(1),
11580
+ /** What an operator reads in the picker. The provider's own wording. */
11581
+ label: string().min(1),
11582
+ /**
11583
+ * Whether the provider recommends this signal ON when a camera is first set
11584
+ * up. A provider knows which of its signals are cheap and reliable; an
11585
+ * operator should not have to discover that by trial. Reolink recommends
11586
+ * both of its own.
11587
+ */
11588
+ recommended: boolean()
11589
+ });
11590
+ var StreamSignalsStatusSchema = object({
11591
+ signals: array(StreamSignalSchema),
11592
+ lastFetchedAt: number()
11593
+ });
11594
+ var streamSignalsCapability = {
11595
+ name: "stream-signals",
11596
+ scope: "device",
11597
+ deviceNative: true,
11598
+ mode: "singleton",
11599
+ deviceTypes: Object.values(DeviceType),
11600
+ runtimeState: StreamSignalsStatusSchema,
11601
+ /**
11602
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11603
+ *
11604
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11605
+ * not an operator choice: the provider re-declares it on every registration,
11606
+ * so losing it loses nothing and persisting it would freeze an answer the
11607
+ * camera is entitled to change. Measured the same day on the sibling case —
11608
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11609
+ * class the camera really detected stayed missing for the life of the row
11610
+ * because the fix could not reach it.
11611
+ *
11612
+ * See `RuntimeStateDurability`. Enforced by
11613
+ * `scripts/check-runtime-state-durability.ts`.
11614
+ */
11615
+ durability: "session",
11616
+ methods: {
11617
+ /**
11618
+ * What this device can emit. Empty is a valid and common answer — most
11619
+ * cameras have nothing to offer here, and an empty list is what makes the
11620
+ * broker's picker show nothing rather than a false choice.
11621
+ */
11622
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11623
+ };
11529
11624
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11530
11625
  var StreamFormatSchema = _enum([
11531
11626
  "webrtc",
@@ -11922,6 +12017,22 @@ var EgressTranscodeSchema = object({
11922
12017
  camStreamId: string().nullable()
11923
12018
  });
11924
12019
  method(object({
12020
+ deviceId: number().int().nonnegative(),
12021
+ /** The provider's signal code. */
12022
+ code: string().min(1),
12023
+ /** Ms epoch. Absent ⇒ now. */
12024
+ at: number().optional()
12025
+ }), object({
12026
+ /** Whether the broker acted on it, and if not, why. */
12027
+ accepted: boolean(),
12028
+ reason: _enum([
12029
+ "woke",
12030
+ "hold-extended",
12031
+ "not-enabled",
12032
+ "no-consumer",
12033
+ "unknown-code"
12034
+ ])
12035
+ }), { kind: "mutation" }), method(object({
11925
12036
  deviceId: number().int().nonnegative(),
11926
12037
  camStreamId: string().min(1),
11927
12038
  kind: CamStreamKindSchema,
@@ -12176,6 +12287,16 @@ var PickStreamRequirementsSchema = object({
12176
12287
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12177
12288
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12178
12289
  minHeight: number().int().positive().optional(),
12290
+ /**
12291
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12292
+ *
12293
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12294
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12295
+ * Without this the ceiling had to be re-implemented by every caller — and
12296
+ * one caller implementing it privately is how a second scoring authority
12297
+ * gets born.
12298
+ */
12299
+ maxHeight: number().int().positive().optional(),
12179
12300
  /** Minimum horizontal resolution. */
12180
12301
  minWidth: number().int().positive().optional(),
12181
12302
  /**
@@ -12192,7 +12313,22 @@ var PickStreamRequirementsSchema = object({
12192
12313
  * transcoded" guard: if the device is already serving the consumer's
12193
12314
  * codec end-to-end, there's nothing to optimise.
12194
12315
  */
12195
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12316
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12317
+ /**
12318
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12319
+ * understanding that it will be transcoded.
12320
+ *
12321
+ * Default `false` — today's behaviour, and the right one for a bypass
12322
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12323
+ * ask the larger question: "what is the best stream for me, transcoding if
12324
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12325
+ * does not, so a passthrough is never lost to a transcode; the answer says
12326
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12327
+ *
12328
+ * This is what lets one picker serve both the bypass and the full source
12329
+ * choice, instead of a consumer scoring privately when the bypass misses.
12330
+ */
12331
+ allowTranscode: boolean().optional()
12196
12332
  }).readonly();
12197
12333
  var PickStreamPreferencesSchema = object({
12198
12334
  /**
@@ -12206,12 +12342,32 @@ var PickStreamPreferencesSchema = object({
12206
12342
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12207
12343
  * memory-constrained consumers / Apple Home guest sessions).
12208
12344
  */
12209
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12345
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12346
+ /**
12347
+ * The height the consumer actually wants to DELIVER.
12348
+ *
12349
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12350
+ * above the target wins, and only if nothing reaches it does the tallest
12351
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12352
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12353
+ * express that: it says "as big as possible", which is a different wish.
12354
+ *
12355
+ * Ignored when absent, so every existing caller keeps its ordering.
12356
+ */
12357
+ targetHeight: number().int().positive().optional()
12210
12358
  }).readonly();
12211
12359
  var PickedCamStreamSchema = object({
12212
12360
  camStreamId: string(),
12213
12361
  codec: string().optional(),
12214
12362
  resolution: CamStreamResolutionSchema.optional(),
12363
+ /**
12364
+ * Whether serving this stream requires a decode + re-encode.
12365
+ *
12366
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12367
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12368
+ * not ask cannot be handed a cost it never agreed to pay.
12369
+ */
12370
+ transcodes: boolean(),
12215
12371
  /** One-line explanation of why this stream won — for logs / debug UI. */
12216
12372
  reason: string()
12217
12373
  });
@@ -16745,6 +16901,8 @@ var NcSystemEventKindSchema = _enum([
16745
16901
  "device-enabled",
16746
16902
  "device-battery-low",
16747
16903
  "device-battery-normal",
16904
+ "device-consumable-low",
16905
+ "device-consumable-normal",
16748
16906
  "stream-online",
16749
16907
  "stream-offline",
16750
16908
  "node-online",
@@ -16763,6 +16921,7 @@ var NcSystemEventKindSchema = _enum([
16763
16921
  "addon-updated",
16764
16922
  "server-updated",
16765
16923
  "export-completed",
16924
+ "backup-completed",
16766
16925
  "camera-online",
16767
16926
  "camera-offline",
16768
16927
  "camera-disabled",
@@ -18085,6 +18244,48 @@ var NcAlarmConfigSchema = object({
18085
18244
  settings: NcAlarmSettingsSchema,
18086
18245
  coverage: array(NcAlarmModeCoverageSchema)
18087
18246
  });
18247
+ /**
18248
+ * ONE rule's demand on ONE camera's clip ring.
18249
+ *
18250
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18251
+ * camera, so the answer stays a faithful description of the rules and the
18252
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18253
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18254
+ * a different thing from never having been told, and only the envelope
18255
+ * (`rulesLoaded`) can tell those apart.
18256
+ */
18257
+ var NcClipRetentionAskSchema = object({
18258
+ /**
18259
+ * The camera this ask is about. **Absent = every camera**, which is what a
18260
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18261
+ * asking everywhere.
18262
+ */
18263
+ deviceId: number().int().nonnegative().optional(),
18264
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18265
+ * needs nothing produces no ask at all. */
18266
+ seconds: number().min(0).max(60),
18267
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18268
+ * assigned, which is what the cut defaults to. */
18269
+ profile: CamProfileSchema.optional(),
18270
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18271
+ ruleId: string(),
18272
+ ruleName: string(),
18273
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18274
+ reason: _enum(["window", "occupancy"])
18275
+ });
18276
+ /**
18277
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18278
+ *
18279
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18280
+ * once. A centre that is up but has not read its rules yet answers with an
18281
+ * empty ask list that means nothing at all — applying it would drop every
18282
+ * camera's ring to zero for the first events after a restart, which is the
18283
+ * footage this mechanism exists to keep.
18284
+ */
18285
+ var NcClipRetentionPlanSchema = object({
18286
+ rulesLoaded: boolean(),
18287
+ asks: array(NcClipRetentionAskSchema).readonly()
18288
+ });
18088
18289
  method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
18089
18290
  kind: "mutation",
18090
18291
  auth: "admin",
@@ -18105,7 +18306,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18105
18306
  }), object({ success: literal(true) }), {
18106
18307
  kind: "mutation",
18107
18308
  auth: "admin"
18108
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18309
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18109
18310
  deviceId: number().int(),
18110
18311
  muted: boolean()
18111
18312
  }), object({ success: literal(true) }), {
@@ -20679,6 +20880,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20679
20880
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20680
20881
  framesMatched: number().int()
20681
20882
  })).readonly() });
20883
+ /**
20884
+ * The long-term series a camera produces. A closed union so a typo cannot
20885
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20886
+ * is an alias of this, not a second list.
20887
+ */
20888
+ var AnalyticsLtsSeriesSchema = _enum([
20889
+ "motion",
20890
+ "audio-dbfs",
20891
+ "battery",
20892
+ "occupancy"
20893
+ ]);
20894
+ /**
20895
+ * One closed 5-minute bucket of a long-term series.
20896
+ *
20897
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20898
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20899
+ * that exists at all was measured; a bucket that is absent was not, which is a
20900
+ * different claim from zero and the reason this is a sparse series.
20901
+ */
20902
+ var LtsBucketSchema = object({
20903
+ scope: string(),
20904
+ bucketStart: number().int(),
20905
+ samples: number().int().nonnegative(),
20906
+ sum: number(),
20907
+ min: number(),
20908
+ max: number()
20909
+ });
20682
20910
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20683
20911
  deviceId: number(),
20684
20912
  trackId: string()
@@ -20725,6 +20953,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20725
20953
  kinds: array(string()).optional(),
20726
20954
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20727
20955
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20956
+ deviceId: number(),
20957
+ series: AnalyticsLtsSeriesSchema,
20958
+ /** Omit for EVERY scope of this series in the range. */
20959
+ scope: string().optional(),
20960
+ from: number(),
20961
+ to: number(),
20962
+ limit: number().int().positive().optional()
20963
+ }), array(LtsBucketSchema).readonly()), method(object({
20728
20964
  deviceId: number(),
20729
20965
  since: number(),
20730
20966
  until: number(),
@@ -21343,6 +21579,14 @@ var MotionSourceEnum = _enum([
21343
21579
  */
21344
21580
  var MotionSourcesSchema = array(MotionSourceEnum);
21345
21581
  /**
21582
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21583
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21584
+ * than a second spelling of the same two ideas — the value an operator picks
21585
+ * here is the value that comes back on the track, the overlay and the debug
21586
+ * row.
21587
+ */
21588
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21589
+ /**
21346
21590
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21347
21591
  * so cap-side consumers (the orchestrator forward, the runner addon's
21348
21592
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21493,6 +21737,35 @@ var RunnerCameraConfigSchema = object({
21493
21737
  * events; the orchestrator forwards to `reportMotion`.
21494
21738
  */
21495
21739
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21740
+ /**
21741
+ * WHICH root detector runs for this camera. The detection counterpart of
21742
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21743
+ * of sources the system understands, vendor-agnostic, owned here.
21744
+ *
21745
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21746
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21747
+ * here. Its boxes reach post-analysis on the same
21748
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21749
+ * track gets the same tracker, the same overlay and the same detail
21750
+ * subtree (face / plate / embedding).
21751
+ *
21752
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21753
+ * run, and that is where a camera with a usable onboard detector buys back
21754
+ * its share of the accelerator. It saves the root inference, not the decode
21755
+ * — the detail subtree still needs pixels to cut crops from.
21756
+ *
21757
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21758
+ * step at all (there is nothing to track), and the cap that knows this says
21759
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21760
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21761
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21762
+ * worth exactly what it already is — a wake signal with a class.
21763
+ *
21764
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21765
+ * vendor never turns a detector on for the operator, and neither does a
21766
+ * default.
21767
+ */
21768
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21496
21769
  pipelineEnabled: boolean().default(true),
21497
21770
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21498
21771
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21674,7 +21947,47 @@ var RunnerLocalMetricsSchema = object({
21674
21947
  queueDepth: number(),
21675
21948
  frameLazy: FrameLazyMetricsSchema.optional()
21676
21949
  });
21950
+ /**
21951
+ * Pipeline Runner capability — runtime detection workhorse.
21952
+ *
21953
+ * One instance per node. Receives camera assignments from
21954
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21955
+ * decoded frames, drains motion + detection queues, calls the local
21956
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21957
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21958
+ * the bus.
21959
+ *
21960
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21961
+ * runner has zero knowledge of other agents, no global state, and never
21962
+ * makes assignment decisions itself.
21963
+ */
21964
+ /**
21965
+ * Why a runner declined to look at a camera out of band. Named rather than a
21966
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21967
+ * already mid-session and one already bursting are four different facts, and a
21968
+ * caller told only "no" cannot tell a protection from a bug.
21969
+ */
21970
+ var OccupancyBurstRefusalSchema = _enum([
21971
+ "not-attached",
21972
+ "battery-asleep",
21973
+ "not-watching",
21974
+ "already-bursting"
21975
+ ]);
21677
21976
  method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly()), method(object({
21977
+ deviceId: number(),
21978
+ /** How many frames to collect. The caller sizes this against what its
21979
+ * own confirmation needs; the runner clamps it to the field's range. */
21980
+ frames: number().int().positive().optional(),
21981
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21982
+ * defend — the periodic one at least has a timer to point at. */
21983
+ reason: string()
21984
+ }), object({
21985
+ started: boolean(),
21986
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21987
+ }), {
21988
+ auth: "admin",
21989
+ kind: "mutation"
21990
+ }), method(object({
21678
21991
  handle: FrameHandleSchema,
21679
21992
  bbox: NativeCropBboxSchema,
21680
21993
  maxWidth: number().int().positive().optional(),
@@ -24044,10 +24357,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24044
24357
  }), boolean()), method(object({
24045
24358
  deviceId: number().int().nonnegative(),
24046
24359
  sessionId: string()
24047
- }), object({ pendingRenegotiation: object({
24048
- target: WebrtcStreamTargetSchema,
24049
- epoch: number()
24050
- }).nullable() }));
24360
+ }), object({
24361
+ pendingRenegotiation: object({
24362
+ target: WebrtcStreamTargetSchema,
24363
+ epoch: number()
24364
+ }).nullable(),
24365
+ /**
24366
+ * Whether the session still EXISTS.
24367
+ *
24368
+ * A consumer that holds a resource for the life of a session needs to
24369
+ * be able to ask, because a session does not always end the way it
24370
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24371
+ * sent `SessionDisconnected`, so the Alexa exporter's
24372
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24373
+ * H.264 transcode kept running for NOBODY for more than twenty
24374
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24375
+ * minutes earlier — the broker knew; the holder had no way to ask.
24376
+ *
24377
+ * `false` for a session id the provider has never heard of, which is
24378
+ * the same answer as "it ended": either way nothing is holding it up.
24379
+ */
24380
+ alive: boolean()
24381
+ }));
24051
24382
  object({
24052
24383
  /** All accessory children of the parent. */
24053
24384
  childDeviceIds: array(number()).readonly(),
@@ -28494,11 +28825,46 @@ var NativeObjectDetectionStatusSchema = object({
28494
28825
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28495
28826
  /**
28496
28827
  * Whether forwarding of onboard AI detections is enabled for this device.
28497
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28498
- * churn the tracker, so forwarding stays off until the operator enables it.
28828
+ *
28829
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28830
+ * camera runs — that is the operator's choice, and it is made where every
28831
+ * other detection choice is made. `geometry` on
28832
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28833
+ * choice would buy this particular camera.
28499
28834
  */
28500
28835
  enabled: boolean()
28501
28836
  });
28837
+ /**
28838
+ * WHEN a camera's onboard detections carry geometry.
28839
+ *
28840
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28841
+ * a detection is a trackable subject whenever the camera sees one.
28842
+ * - `while-streaming` — only while some stream of this camera is already open.
28843
+ * The boxes ride the video's own side-channel rather than a feed of their
28844
+ * own, so they cost nothing and they exist only when something is pulling.
28845
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28846
+ * radio drain, but a camera that is awake is awake precisely because
28847
+ * something is in front of it, and its stream is already being pulled.
28848
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28849
+ * pipeline needs geometry to make a subject, so such a push reaches the
28850
+ * tracker as motion and no further.
28851
+ *
28852
+ * Reported and not inferred, because the operator's question in front of the
28853
+ * picker is "what do I get", and these are three different answers (D14: the
28854
+ * derived form is only as honest as `getOptions`).
28855
+ */
28856
+ var NativeObjectGeometryEnum = _enum([
28857
+ "boxed",
28858
+ "while-streaming",
28859
+ "flag-only"
28860
+ ]);
28861
+ var NativeObjectDetectionOptionsSchema = object({
28862
+ /** Classes this firmware can detect — the same list the status reports. */
28863
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28864
+ /** What a detection from this camera carries. */
28865
+ geometry: NativeObjectGeometryEnum
28866
+ });
28867
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28502
28868
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28503
28869
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28504
28870
  lastFetchedAt: number() });
@@ -28508,13 +28874,23 @@ var nativeObjectDetectionCapability = {
28508
28874
  deviceNative: true,
28509
28875
  mode: "singleton",
28510
28876
  deviceTypes: [DeviceType.Camera],
28511
- methods: { setEnabled: method(object({
28512
- deviceId: number(),
28513
- enabled: boolean()
28514
- }), _void(), {
28515
- kind: "mutation",
28516
- auth: "admin"
28517
- }) },
28877
+ methods: {
28878
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28879
+ setSettings: method(object({
28880
+ deviceId: number(),
28881
+ settings: NativeObjectDetectionSettingsPatchSchema
28882
+ }), _void(), {
28883
+ kind: "mutation",
28884
+ auth: "admin"
28885
+ }),
28886
+ setEnabled: method(object({
28887
+ deviceId: number(),
28888
+ enabled: boolean()
28889
+ }), _void(), {
28890
+ kind: "mutation",
28891
+ auth: "admin"
28892
+ })
28893
+ },
28518
28894
  events: { onDetected: { data: object({
28519
28895
  deviceId: number(),
28520
28896
  detection: NativeDetectionSchema
@@ -33362,7 +33738,28 @@ var PerScopeBreakdownSchema = object({
33362
33738
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33363
33739
  totalObjects: number().int().nonnegative(),
33364
33740
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33365
- byClass: record(string(), number().int().nonnegative())
33741
+ byClass: record(string(), number().int().nonnegative()),
33742
+ /**
33743
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33744
+ * present but not going anywhere (a parked car, a bin, a statue).
33745
+ *
33746
+ * The operator's question about a scene has two halves and they answer
33747
+ * different things: "what is parked here" is stable for hours and must not
33748
+ * flap, while "who is walking through" is the thing an alert is about. One
33749
+ * number could only serve one of them, and `totalObjects` served the first
33750
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33751
+ *
33752
+ * `standing + transient === totalObjects`, always. The total keeps its old
33753
+ * meaning exactly, so no rule written against it changes behaviour.
33754
+ *
33755
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33756
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33757
+ * parked objects here" about a camera whose lot is full.
33758
+ */
33759
+ standingObjects: number().int().nonnegative().optional(),
33760
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33761
+ * same absence rule. */
33762
+ transientObjects: number().int().nonnegative().optional()
33366
33763
  });
33367
33764
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33368
33765
  zoneId: string(),
@@ -33485,6 +33882,23 @@ var HistoryPointSchema = object({
33485
33882
  * triple covers the three spatial scopes (per-zone, frame-wide,
33486
33883
  * outside-any-zone). Crossing them with `className?` gives the full
33487
33884
  * combinatorial coverage the operator UI requested.
33885
+ *
33886
+ * ## ⚠️ The three history methods are DEPRECATED
33887
+ *
33888
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33889
+ * so after a restart they report nothing about a night that did happen, and any
33890
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33891
+ * an empty scene. The presets in the occupancy chart existed to hide that
33892
+ * horizon rather than to answer a question.
33893
+ *
33894
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33895
+ * instead. Those rows are already written for every camera, ~60 bytes per
33896
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33897
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33898
+ * function the writer uses, so the two cannot drift.
33899
+ *
33900
+ * The ring stays until these three go, and it is the only thing left reading
33901
+ * it. Do not add a fourth caller.
33488
33902
  */
33489
33903
  var zoneAnalyticsCapability = {
33490
33904
  name: "zone-analytics",
@@ -33974,6 +34388,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33974
34388
  smoke: smokeCapability,
33975
34389
  streamCatalog: streamCatalogCapability,
33976
34390
  streamParams: streamParamsCapability,
34391
+ streamSignals: streamSignalsCapability,
33977
34392
  switch: switchCapability,
33978
34393
  tamper: tamperCapability,
33979
34394
  temperatureSensor: temperatureSensorCapability,
@@ -37883,12 +38298,24 @@ Object.freeze({
37883
38298
  addonId: null,
37884
38299
  access: "create"
37885
38300
  },
38301
+ "nativeObjectDetection.getOptions": {
38302
+ capName: "native-object-detection",
38303
+ capScope: "device",
38304
+ addonId: null,
38305
+ access: "view"
38306
+ },
37886
38307
  "nativeObjectDetection.setEnabled": {
37887
38308
  capName: "native-object-detection",
37888
38309
  capScope: "device",
37889
38310
  addonId: null,
37890
38311
  access: "create"
37891
38312
  },
38313
+ "nativeObjectDetection.setSettings": {
38314
+ capName: "native-object-detection",
38315
+ capScope: "device",
38316
+ addonId: null,
38317
+ access: "create"
38318
+ },
37892
38319
  "navigation.getFeatures": {
37893
38320
  capName: "navigation",
37894
38321
  capScope: "device",
@@ -38153,6 +38580,12 @@ Object.freeze({
38153
38580
  addonId: null,
38154
38581
  access: "view"
38155
38582
  },
38583
+ "notificationRules.getClipRetentionAsks": {
38584
+ capName: "notification-rules",
38585
+ capScope: "system",
38586
+ addonId: null,
38587
+ access: "view"
38588
+ },
38156
38589
  "notificationRules.getConditionCatalog": {
38157
38590
  capName: "notification-rules",
38158
38591
  capScope: "system",
@@ -38663,6 +39096,12 @@ Object.freeze({
38663
39096
  addonId: null,
38664
39097
  access: "create"
38665
39098
  },
39099
+ "pipelineAnalytics.readLongTermSeries": {
39100
+ capName: "pipeline-analytics",
39101
+ capScope: "device",
39102
+ addonId: null,
39103
+ access: "view"
39104
+ },
38666
39105
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38667
39106
  capName: "pipeline-analytics",
38668
39107
  capScope: "device",
@@ -39335,6 +39774,12 @@ Object.freeze({
39335
39774
  addonId: null,
39336
39775
  access: "create"
39337
39776
  },
39777
+ "pipelineRunner.requestOccupancyBurst": {
39778
+ capName: "pipeline-runner",
39779
+ capScope: "system",
39780
+ addonId: null,
39781
+ access: "create"
39782
+ },
39338
39783
  "pipelineRunner.runDetailSubtree": {
39339
39784
  capName: "pipeline-runner",
39340
39785
  capScope: "system",
@@ -40547,6 +40992,12 @@ Object.freeze({
40547
40992
  addonId: null,
40548
40993
  access: "create"
40549
40994
  },
40995
+ "streamBroker.reportStreamSignal": {
40996
+ capName: "stream-broker",
40997
+ capScope: "system",
40998
+ addonId: null,
40999
+ access: "create"
41000
+ },
40550
41001
  "streamBroker.restartProfile": {
40551
41002
  capName: "stream-broker",
40552
41003
  capScope: "system",
@@ -40631,6 +41082,12 @@ Object.freeze({
40631
41082
  addonId: null,
40632
41083
  access: "create"
40633
41084
  },
41085
+ "streamSignals.listSignals": {
41086
+ capName: "stream-signals",
41087
+ capScope: "device",
41088
+ addonId: null,
41089
+ access: "view"
41090
+ },
40634
41091
  "switch.setState": {
40635
41092
  capName: "switch",
40636
41093
  capScope: "device",
@@ -42103,11 +42560,21 @@ Object.freeze({
42103
42560
  form: "single",
42104
42561
  optional: false
42105
42562
  }],
42563
+ "nativeObjectDetection.getOptions": [{
42564
+ name: "deviceId",
42565
+ form: "single",
42566
+ optional: false
42567
+ }],
42106
42568
  "nativeObjectDetection.setEnabled": [{
42107
42569
  name: "deviceId",
42108
42570
  form: "single",
42109
42571
  optional: false
42110
42572
  }],
42573
+ "nativeObjectDetection.setSettings": [{
42574
+ name: "deviceId",
42575
+ form: "single",
42576
+ optional: false
42577
+ }],
42111
42578
  "navigation.getFeatures": [{
42112
42579
  name: "deviceId",
42113
42580
  form: "single",
@@ -42457,6 +42924,11 @@ Object.freeze({
42457
42924
  form: "single",
42458
42925
  optional: false
42459
42926
  }],
42927
+ "pipelineAnalytics.readLongTermSeries": [{
42928
+ name: "deviceId",
42929
+ form: "single",
42930
+ optional: false
42931
+ }],
42460
42932
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42461
42933
  name: "deviceId",
42462
42934
  form: "single",
@@ -42647,6 +43119,11 @@ Object.freeze({
42647
43119
  form: "single",
42648
43120
  optional: false
42649
43121
  }],
43122
+ "pipelineRunner.requestOccupancyBurst": [{
43123
+ name: "deviceId",
43124
+ form: "single",
43125
+ optional: false
43126
+ }],
42650
43127
  "pipelineRunner.runDetailSubtree": [{
42651
43128
  name: "deviceId",
42652
43129
  form: "single",
@@ -43003,6 +43480,11 @@ Object.freeze({
43003
43480
  form: "single",
43004
43481
  optional: false
43005
43482
  }],
43483
+ "streamBroker.reportStreamSignal": [{
43484
+ name: "deviceId",
43485
+ form: "single",
43486
+ optional: false
43487
+ }],
43006
43488
  "streamBroker.restartProfile": [{
43007
43489
  name: "deviceId",
43008
43490
  form: "single",