@camstack/addon-provider-dreame 0.2.102 → 0.2.104

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
@@ -52672,7 +52672,7 @@ var DreameCameraStream = class extends TypedEmitter {
52672
52672
  }
52673
52673
  };
52674
52674
  //#endregion
52675
- //#region ../types/dist/event-category-ZyX6jcse.mjs
52675
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
52676
52676
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
52677
52677
  EventCategory["SystemBoot"] = "system.boot";
52678
52678
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -53289,6 +53289,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
53289
53289
  * pull-reconcile from the provider's `getStatus` on reconnect. */
53290
53290
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
53291
53291
  EventCategory["BackupCompleted"] = "backup.completed";
53292
+ /**
53293
+ * A whole backup RUN finished — every destination attempted, win or lose.
53294
+ *
53295
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
53296
+ * a progress UI and the wrong one for a notification: an operator with three
53297
+ * destinations would be told three times. And a run where two of three
53298
+ * destinations succeeded is not a clean success — a single "backup
53299
+ * completed" that hid the failed one would be a lie, so the count of each is
53300
+ * carried here and the message says both.
53301
+ *
53302
+ * Emitted by the backup orchestrator only after the destination loop, so a
53303
+ * run that dies during the BUILD phase produces no completion at all.
53304
+ */
53305
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
53292
53306
  EventCategory["BackupRestored"] = "backup.restored";
53293
53307
  EventCategory["NotificationDispatched"] = "notification.dispatched";
53294
53308
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -58019,7 +58033,7 @@ var ZodIssueCode = {
58019
58033
  var ZodFirstPartyTypeKind;
58020
58034
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
58021
58035
  //#endregion
58022
- //#region ../types/dist/sleep-DBKu2-U5.mjs
58036
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
58023
58037
  /**
58024
58038
  * The audio chunk plane's byte format, and the ONE expansion from a coded
58025
58039
  * window to float samples (D455).
@@ -64163,6 +64177,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
64163
64177
  auth: "admin"
64164
64178
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
64165
64179
  DeviceType.Camera;
64180
+ /**
64181
+ * The signals a device can emit to WAKE its own stream.
64182
+ *
64183
+ * A camera whose stream is built on demand sleeps until something asks for it,
64184
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
64185
+ * puller holds a session open for ever, and treating that as demand would keep
64186
+ * a battery camera awake for ever, which is the whole thing the battery is for
64187
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
64188
+ * itself, with no stream running.
64189
+ *
64190
+ * ## The vocabulary is the PROVIDER'S, not ours
64191
+ *
64192
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
64193
+ * names each signal with a `code` it chooses and a `label` an operator reads.
64194
+ * Reolink offers motion and camera-native detection; another provider may offer
64195
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
64196
+ * yet. A fixed enum here would mean every new signal is a framework release.
64197
+ *
64198
+ * It is deliberately NOT derived from the caps a device already binds. Whether
64199
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
64200
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
64201
+ * binding — but both answer "what drives the detection pipeline", which is a
64202
+ * different question from "what may wake a sleeping stream". A camera can do
64203
+ * the first and not be trusted with the second, and the operator picks per
64204
+ * camera. Two questions, two authorities.
64205
+ *
64206
+ * ## Availability is not permission
64207
+ *
64208
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
64209
+ * wakes the stream is the operator's per-camera choice, held by the broker
64210
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
64211
+ * provider declaring a signal is not a provider enabling it.
64212
+ */
64213
+ /** One signal a device can emit. */
64214
+ var StreamSignalSchema = object({
64215
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
64216
+ code: string().min(1),
64217
+ /** What an operator reads in the picker. The provider's own wording. */
64218
+ label: string().min(1),
64219
+ /**
64220
+ * Whether the provider recommends this signal ON when a camera is first set
64221
+ * up. A provider knows which of its signals are cheap and reliable; an
64222
+ * operator should not have to discover that by trial. Reolink recommends
64223
+ * both of its own.
64224
+ */
64225
+ recommended: boolean()
64226
+ });
64227
+ var StreamSignalsStatusSchema = object({
64228
+ signals: array(StreamSignalSchema),
64229
+ lastFetchedAt: number()
64230
+ });
64231
+ var streamSignalsCapability = {
64232
+ name: "stream-signals",
64233
+ scope: "device",
64234
+ deviceNative: true,
64235
+ mode: "singleton",
64236
+ deviceTypes: Object.values(DeviceType),
64237
+ runtimeState: StreamSignalsStatusSchema,
64238
+ /**
64239
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
64240
+ *
64241
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
64242
+ * not an operator choice: the provider re-declares it on every registration,
64243
+ * so losing it loses nothing and persisting it would freeze an answer the
64244
+ * camera is entitled to change. Measured the same day on the sibling case —
64245
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
64246
+ * class the camera really detected stayed missing for the life of the row
64247
+ * because the fix could not reach it.
64248
+ *
64249
+ * See `RuntimeStateDurability`. Enforced by
64250
+ * `scripts/check-runtime-state-durability.ts`.
64251
+ */
64252
+ durability: "session",
64253
+ methods: {
64254
+ /**
64255
+ * What this device can emit. Empty is a valid and common answer — most
64256
+ * cameras have nothing to offer here, and an empty list is what makes the
64257
+ * broker's picker show nothing rather than a false choice.
64258
+ */
64259
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
64260
+ };
64166
64261
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
64167
64262
  var StreamFormatSchema = _enum([
64168
64263
  "webrtc",
@@ -64559,6 +64654,22 @@ var EgressTranscodeSchema = object({
64559
64654
  camStreamId: string().nullable()
64560
64655
  });
64561
64656
  method(object({
64657
+ deviceId: number().int().nonnegative(),
64658
+ /** The provider's signal code. */
64659
+ code: string().min(1),
64660
+ /** Ms epoch. Absent ⇒ now. */
64661
+ at: number().optional()
64662
+ }), object({
64663
+ /** Whether the broker acted on it, and if not, why. */
64664
+ accepted: boolean(),
64665
+ reason: _enum([
64666
+ "woke",
64667
+ "hold-extended",
64668
+ "not-enabled",
64669
+ "no-consumer",
64670
+ "unknown-code"
64671
+ ])
64672
+ }), { kind: "mutation" }), method(object({
64562
64673
  deviceId: number().int().nonnegative(),
64563
64674
  camStreamId: string().min(1),
64564
64675
  kind: CamStreamKindSchema,
@@ -64813,6 +64924,16 @@ var PickStreamRequirementsSchema = object({
64813
64924
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
64814
64925
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
64815
64926
  minHeight: number().int().positive().optional(),
64927
+ /**
64928
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
64929
+ *
64930
+ * A consumer can have a ceiling as real as its floor: Alexa documents
64931
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
64932
+ * Without this the ceiling had to be re-implemented by every caller — and
64933
+ * one caller implementing it privately is how a second scoring authority
64934
+ * gets born.
64935
+ */
64936
+ maxHeight: number().int().positive().optional(),
64816
64937
  /** Minimum horizontal resolution. */
64817
64938
  minWidth: number().int().positive().optional(),
64818
64939
  /**
@@ -64829,7 +64950,22 @@ var PickStreamRequirementsSchema = object({
64829
64950
  * transcoded" guard: if the device is already serving the consumer's
64830
64951
  * codec end-to-end, there's nothing to optimise.
64831
64952
  */
64832
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
64953
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
64954
+ /**
64955
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
64956
+ * understanding that it will be transcoded.
64957
+ *
64958
+ * Default `false` — today's behaviour, and the right one for a bypass
64959
+ * question ("is there a stream I can forward untouched?"). Set `true` to
64960
+ * ask the larger question: "what is the best stream for me, transcoding if
64961
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
64962
+ * does not, so a passthrough is never lost to a transcode; the answer says
64963
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
64964
+ *
64965
+ * This is what lets one picker serve both the bypass and the full source
64966
+ * choice, instead of a consumer scoring privately when the bypass misses.
64967
+ */
64968
+ allowTranscode: boolean().optional()
64833
64969
  }).readonly();
64834
64970
  var PickStreamPreferencesSchema = object({
64835
64971
  /**
@@ -64843,12 +64979,32 @@ var PickStreamPreferencesSchema = object({
64843
64979
  * picks the tallest stream; `'lowest'` picks the shortest (used by
64844
64980
  * memory-constrained consumers / Apple Home guest sessions).
64845
64981
  */
64846
- resolutionPreference: _enum(["highest", "lowest"]).optional()
64982
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
64983
+ /**
64984
+ * The height the consumer actually wants to DELIVER.
64985
+ *
64986
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
64987
+ * above the target wins, and only if nothing reaches it does the tallest
64988
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
64989
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
64990
+ * express that: it says "as big as possible", which is a different wish.
64991
+ *
64992
+ * Ignored when absent, so every existing caller keeps its ordering.
64993
+ */
64994
+ targetHeight: number().int().positive().optional()
64847
64995
  }).readonly();
64848
64996
  var PickedCamStreamSchema = object({
64849
64997
  camStreamId: string(),
64850
64998
  codec: string().optional(),
64851
64999
  resolution: CamStreamResolutionSchema.optional(),
65000
+ /**
65001
+ * Whether serving this stream requires a decode + re-encode.
65002
+ *
65003
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
65004
+ * when the caller asked for it with `allowTranscode`, so a caller that did
65005
+ * not ask cannot be handed a cost it never agreed to pay.
65006
+ */
65007
+ transcodes: boolean(),
64852
65008
  /** One-line explanation of why this stream won — for logs / debug UI. */
64853
65009
  reason: string()
64854
65010
  });
@@ -69382,6 +69538,8 @@ var NcSystemEventKindSchema = _enum([
69382
69538
  "device-enabled",
69383
69539
  "device-battery-low",
69384
69540
  "device-battery-normal",
69541
+ "device-consumable-low",
69542
+ "device-consumable-normal",
69385
69543
  "stream-online",
69386
69544
  "stream-offline",
69387
69545
  "node-online",
@@ -69400,6 +69558,7 @@ var NcSystemEventKindSchema = _enum([
69400
69558
  "addon-updated",
69401
69559
  "server-updated",
69402
69560
  "export-completed",
69561
+ "backup-completed",
69403
69562
  "camera-online",
69404
69563
  "camera-offline",
69405
69564
  "camera-disabled",
@@ -70722,6 +70881,48 @@ var NcAlarmConfigSchema = object({
70722
70881
  settings: NcAlarmSettingsSchema,
70723
70882
  coverage: array(NcAlarmModeCoverageSchema)
70724
70883
  });
70884
+ /**
70885
+ * ONE rule's demand on ONE camera's clip ring.
70886
+ *
70887
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
70888
+ * camera, so the answer stays a faithful description of the rules and the
70889
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
70890
+ * lives. A camera that appears in no ask is being told **nothing** — which is
70891
+ * a different thing from never having been told, and only the envelope
70892
+ * (`rulesLoaded`) can tell those apart.
70893
+ */
70894
+ var NcClipRetentionAskSchema = object({
70895
+ /**
70896
+ * The camera this ask is about. **Absent = every camera**, which is what a
70897
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
70898
+ * asking everywhere.
70899
+ */
70900
+ deviceId: number().int().nonnegative().optional(),
70901
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
70902
+ * needs nothing produces no ask at all. */
70903
+ seconds: number().min(0).max(60),
70904
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
70905
+ * assigned, which is what the cut defaults to. */
70906
+ profile: CamProfileSchema.optional(),
70907
+ /** Who is asking — so a retention the operator did not expect names a rule. */
70908
+ ruleId: string(),
70909
+ ruleName: string(),
70910
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
70911
+ reason: _enum(["window", "occupancy"])
70912
+ });
70913
+ /**
70914
+ * The whole answer, with the one bit that keeps absence from reading as zero.
70915
+ *
70916
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
70917
+ * once. A centre that is up but has not read its rules yet answers with an
70918
+ * empty ask list that means nothing at all — applying it would drop every
70919
+ * camera's ring to zero for the first events after a restart, which is the
70920
+ * footage this mechanism exists to keep.
70921
+ */
70922
+ var NcClipRetentionPlanSchema = object({
70923
+ rulesLoaded: boolean(),
70924
+ asks: array(NcClipRetentionAskSchema).readonly()
70925
+ });
70725
70926
  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 }), {
70726
70927
  kind: "mutation",
70727
70928
  auth: "admin",
@@ -70742,7 +70943,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
70742
70943
  }), object({ success: literal(true) }), {
70743
70944
  kind: "mutation",
70744
70945
  auth: "admin"
70745
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
70946
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
70746
70947
  deviceId: number().int(),
70747
70948
  muted: boolean()
70748
70949
  }), object({ success: literal(true) }), {
@@ -73316,6 +73517,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
73316
73517
  * solid is this track", cheaper than re-deriving it from a trajectory. */
73317
73518
  framesMatched: number().int()
73318
73519
  })).readonly() });
73520
+ /**
73521
+ * The long-term series a camera produces. A closed union so a typo cannot
73522
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
73523
+ * is an alias of this, not a second list.
73524
+ */
73525
+ var AnalyticsLtsSeriesSchema = _enum([
73526
+ "motion",
73527
+ "audio-dbfs",
73528
+ "battery",
73529
+ "occupancy"
73530
+ ]);
73531
+ /**
73532
+ * One closed 5-minute bucket of a long-term series.
73533
+ *
73534
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
73535
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
73536
+ * that exists at all was measured; a bucket that is absent was not, which is a
73537
+ * different claim from zero and the reason this is a sparse series.
73538
+ */
73539
+ var LtsBucketSchema = object({
73540
+ scope: string(),
73541
+ bucketStart: number().int(),
73542
+ samples: number().int().nonnegative(),
73543
+ sum: number(),
73544
+ min: number(),
73545
+ max: number()
73546
+ });
73319
73547
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
73320
73548
  deviceId: number(),
73321
73549
  trackId: string()
@@ -73362,6 +73590,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
73362
73590
  kinds: array(string()).optional(),
73363
73591
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
73364
73592
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
73593
+ deviceId: number(),
73594
+ series: AnalyticsLtsSeriesSchema,
73595
+ /** Omit for EVERY scope of this series in the range. */
73596
+ scope: string().optional(),
73597
+ from: number(),
73598
+ to: number(),
73599
+ limit: number().int().positive().optional()
73600
+ }), array(LtsBucketSchema).readonly()), method(object({
73365
73601
  deviceId: number(),
73366
73602
  since: number(),
73367
73603
  until: number(),
@@ -73980,6 +74216,14 @@ var MotionSourceEnum = _enum([
73980
74216
  */
73981
74217
  var MotionSourcesSchema = array(MotionSourceEnum);
73982
74218
  /**
74219
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
74220
+ * post-analysis already tags every detection with (`DetectionSource`) rather
74221
+ * than a second spelling of the same two ideas — the value an operator picks
74222
+ * here is the value that comes back on the track, the overlay and the debug
74223
+ * row.
74224
+ */
74225
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
74226
+ /**
73983
74227
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
73984
74228
  * so cap-side consumers (the orchestrator forward, the runner addon's
73985
74229
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -74130,6 +74374,35 @@ var RunnerCameraConfigSchema = object({
74130
74374
  * events; the orchestrator forwards to `reportMotion`.
74131
74375
  */
74132
74376
  motionSources: MotionSourcesSchema.default(["analyzer"]),
74377
+ /**
74378
+ * WHICH root detector runs for this camera. The detection counterpart of
74379
+ * {@link motionSources}, same shape and same discipline: a per-camera list
74380
+ * of sources the system understands, vendor-agnostic, owned here.
74381
+ *
74382
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
74383
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
74384
+ * here. Its boxes reach post-analysis on the same
74385
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
74386
+ * track gets the same tracker, the same overlay and the same detail
74387
+ * subtree (face / plate / embedding).
74388
+ *
74389
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
74390
+ * run, and that is where a camera with a usable onboard detector buys back
74391
+ * its share of the accelerator. It saves the root inference, not the decode
74392
+ * — the detail subtree still needs pixels to cut crops from.
74393
+ *
74394
+ * A camera whose onboard detections carry no geometry cannot serve as a root
74395
+ * step at all (there is nothing to track), and the cap that knows this says
74396
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
74397
+ * every battery camera: the boxes ride a sub-stream a battery camera never
74398
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
74399
+ * worth exactly what it already is — a wake signal with a class.
74400
+ *
74401
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
74402
+ * vendor never turns a detector on for the operator, and neither does a
74403
+ * default.
74404
+ */
74405
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
74133
74406
  pipelineEnabled: boolean().default(true),
74134
74407
  /** Ordered tree of video steps. Absent → runner skips video detection. */
74135
74408
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -74311,7 +74584,47 @@ var RunnerLocalMetricsSchema = object({
74311
74584
  queueDepth: number(),
74312
74585
  frameLazy: FrameLazyMetricsSchema.optional()
74313
74586
  });
74587
+ /**
74588
+ * Pipeline Runner capability — runtime detection workhorse.
74589
+ *
74590
+ * One instance per node. Receives camera assignments from
74591
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
74592
+ * decoded frames, drains motion + detection queues, calls the local
74593
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
74594
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
74595
+ * the bus.
74596
+ *
74597
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
74598
+ * runner has zero knowledge of other agents, no global state, and never
74599
+ * makes assignment decisions itself.
74600
+ */
74601
+ /**
74602
+ * Why a runner declined to look at a camera out of band. Named rather than a
74603
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
74604
+ * already mid-session and one already bursting are four different facts, and a
74605
+ * caller told only "no" cannot tell a protection from a bug.
74606
+ */
74607
+ var OccupancyBurstRefusalSchema = _enum([
74608
+ "not-attached",
74609
+ "battery-asleep",
74610
+ "not-watching",
74611
+ "already-bursting"
74612
+ ]);
74314
74613
  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({
74614
+ deviceId: number(),
74615
+ /** How many frames to collect. The caller sizes this against what its
74616
+ * own confirmation needs; the runner clamps it to the field's range. */
74617
+ frames: number().int().positive().optional(),
74618
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
74619
+ * defend — the periodic one at least has a timer to point at. */
74620
+ reason: string()
74621
+ }), object({
74622
+ started: boolean(),
74623
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
74624
+ }), {
74625
+ auth: "admin",
74626
+ kind: "mutation"
74627
+ }), method(object({
74315
74628
  handle: FrameHandleSchema,
74316
74629
  bbox: NativeCropBboxSchema,
74317
74630
  maxWidth: number().int().positive().optional(),
@@ -76681,10 +76994,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
76681
76994
  }), boolean()), method(object({
76682
76995
  deviceId: number().int().nonnegative(),
76683
76996
  sessionId: string()
76684
- }), object({ pendingRenegotiation: object({
76685
- target: WebrtcStreamTargetSchema,
76686
- epoch: number()
76687
- }).nullable() }));
76997
+ }), object({
76998
+ pendingRenegotiation: object({
76999
+ target: WebrtcStreamTargetSchema,
77000
+ epoch: number()
77001
+ }).nullable(),
77002
+ /**
77003
+ * Whether the session still EXISTS.
77004
+ *
77005
+ * A consumer that holds a resource for the life of a session needs to
77006
+ * be able to ask, because a session does not always end the way it
77007
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
77008
+ * sent `SessionDisconnected`, so the Alexa exporter's
77009
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
77010
+ * H.264 transcode kept running for NOBODY for more than twenty
77011
+ * minutes. The WebRTC session had logged `WebRTC session closed`
77012
+ * minutes earlier — the broker knew; the holder had no way to ask.
77013
+ *
77014
+ * `false` for a session id the provider has never heard of, which is
77015
+ * the same answer as "it ended": either way nothing is holding it up.
77016
+ */
77017
+ alive: boolean()
77018
+ }));
76688
77019
  object({
76689
77020
  /** All accessory children of the parent. */
76690
77021
  childDeviceIds: array(number()).readonly(),
@@ -81148,11 +81479,46 @@ var NativeObjectDetectionStatusSchema = object({
81148
81479
  supportedClasses: array(NativeObjectClassEnum).readonly(),
81149
81480
  /**
81150
81481
  * Whether forwarding of onboard AI detections is enabled for this device.
81151
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
81152
- * churn the tracker, so forwarding stays off until the operator enables it.
81482
+ *
81483
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
81484
+ * camera runs — that is the operator's choice, and it is made where every
81485
+ * other detection choice is made. `geometry` on
81486
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
81487
+ * choice would buy this particular camera.
81153
81488
  */
81154
81489
  enabled: boolean()
81155
81490
  });
81491
+ /**
81492
+ * WHEN a camera's onboard detections carry geometry.
81493
+ *
81494
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
81495
+ * a detection is a trackable subject whenever the camera sees one.
81496
+ * - `while-streaming` — only while some stream of this camera is already open.
81497
+ * The boxes ride the video's own side-channel rather than a feed of their
81498
+ * own, so they cost nothing and they exist only when something is pulling.
81499
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
81500
+ * radio drain, but a camera that is awake is awake precisely because
81501
+ * something is in front of it, and its stream is already being pulled.
81502
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
81503
+ * pipeline needs geometry to make a subject, so such a push reaches the
81504
+ * tracker as motion and no further.
81505
+ *
81506
+ * Reported and not inferred, because the operator's question in front of the
81507
+ * picker is "what do I get", and these are three different answers (D14: the
81508
+ * derived form is only as honest as `getOptions`).
81509
+ */
81510
+ var NativeObjectGeometryEnum = _enum([
81511
+ "boxed",
81512
+ "while-streaming",
81513
+ "flag-only"
81514
+ ]);
81515
+ var NativeObjectDetectionOptionsSchema = object({
81516
+ /** Classes this firmware can detect — the same list the status reports. */
81517
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
81518
+ /** What a detection from this camera carries. */
81519
+ geometry: NativeObjectGeometryEnum
81520
+ });
81521
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
81156
81522
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
81157
81523
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
81158
81524
  lastFetchedAt: number() });
@@ -81162,13 +81528,23 @@ var nativeObjectDetectionCapability = {
81162
81528
  deviceNative: true,
81163
81529
  mode: "singleton",
81164
81530
  deviceTypes: [DeviceType.Camera],
81165
- methods: { setEnabled: method(object({
81166
- deviceId: number(),
81167
- enabled: boolean()
81168
- }), _void(), {
81169
- kind: "mutation",
81170
- auth: "admin"
81171
- }) },
81531
+ methods: {
81532
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
81533
+ setSettings: method(object({
81534
+ deviceId: number(),
81535
+ settings: NativeObjectDetectionSettingsPatchSchema
81536
+ }), _void(), {
81537
+ kind: "mutation",
81538
+ auth: "admin"
81539
+ }),
81540
+ setEnabled: method(object({
81541
+ deviceId: number(),
81542
+ enabled: boolean()
81543
+ }), _void(), {
81544
+ kind: "mutation",
81545
+ auth: "admin"
81546
+ })
81547
+ },
81172
81548
  events: { onDetected: { data: object({
81173
81549
  deviceId: number(),
81174
81550
  detection: NativeDetectionSchema
@@ -86164,7 +86540,28 @@ var PerScopeBreakdownSchema = object({
86164
86540
  /** Total tracked objects in this scope (frame / zone / unzoned). */
86165
86541
  totalObjects: number().int().nonnegative(),
86166
86542
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
86167
- byClass: record(string(), number().int().nonnegative())
86543
+ byClass: record(string(), number().int().nonnegative()),
86544
+ /**
86545
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
86546
+ * present but not going anywhere (a parked car, a bin, a statue).
86547
+ *
86548
+ * The operator's question about a scene has two halves and they answer
86549
+ * different things: "what is parked here" is stable for hours and must not
86550
+ * flap, while "who is walking through" is the thing an alert is about. One
86551
+ * number could only serve one of them, and `totalObjects` served the first
86552
+ * badly — a passer-by moved it and every occupancy rule saw a change.
86553
+ *
86554
+ * `standing + transient === totalObjects`, always. The total keeps its old
86555
+ * meaning exactly, so no rule written against it changes behaviour.
86556
+ *
86557
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
86558
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
86559
+ * parked objects here" about a camera whose lot is full.
86560
+ */
86561
+ standingObjects: number().int().nonnegative().optional(),
86562
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
86563
+ * same absence rule. */
86564
+ transientObjects: number().int().nonnegative().optional()
86168
86565
  });
86169
86566
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
86170
86567
  zoneId: string(),
@@ -86287,6 +86684,23 @@ var HistoryPointSchema = object({
86287
86684
  * triple covers the three spatial scopes (per-zone, frame-wide,
86288
86685
  * outside-any-zone). Crossing them with `className?` gives the full
86289
86686
  * combinatorial coverage the operator UI requested.
86687
+ *
86688
+ * ## ⚠️ The three history methods are DEPRECATED
86689
+ *
86690
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
86691
+ * so after a restart they report nothing about a night that did happen, and any
86692
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
86693
+ * an empty scene. The presets in the occupancy chart existed to hide that
86694
+ * horizon rather than to answer a question.
86695
+ *
86696
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
86697
+ * instead. Those rows are already written for every camera, ~60 bytes per
86698
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
86699
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
86700
+ * function the writer uses, so the two cannot drift.
86701
+ *
86702
+ * The ring stays until these three go, and it is the only thing left reading
86703
+ * it. Do not add a fourth caller.
86290
86704
  */
86291
86705
  var zoneAnalyticsCapability = {
86292
86706
  name: "zone-analytics",
@@ -86776,6 +87190,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
86776
87190
  smoke: smokeCapability,
86777
87191
  streamCatalog: streamCatalogCapability,
86778
87192
  streamParams: streamParamsCapability,
87193
+ streamSignals: streamSignalsCapability,
86779
87194
  switch: switchCapability,
86780
87195
  tamper: tamperCapability,
86781
87196
  temperatureSensor: temperatureSensorCapability,
@@ -90685,12 +91100,24 @@ Object.freeze({
90685
91100
  addonId: null,
90686
91101
  access: "create"
90687
91102
  },
91103
+ "nativeObjectDetection.getOptions": {
91104
+ capName: "native-object-detection",
91105
+ capScope: "device",
91106
+ addonId: null,
91107
+ access: "view"
91108
+ },
90688
91109
  "nativeObjectDetection.setEnabled": {
90689
91110
  capName: "native-object-detection",
90690
91111
  capScope: "device",
90691
91112
  addonId: null,
90692
91113
  access: "create"
90693
91114
  },
91115
+ "nativeObjectDetection.setSettings": {
91116
+ capName: "native-object-detection",
91117
+ capScope: "device",
91118
+ addonId: null,
91119
+ access: "create"
91120
+ },
90694
91121
  "navigation.getFeatures": {
90695
91122
  capName: "navigation",
90696
91123
  capScope: "device",
@@ -90955,6 +91382,12 @@ Object.freeze({
90955
91382
  addonId: null,
90956
91383
  access: "view"
90957
91384
  },
91385
+ "notificationRules.getClipRetentionAsks": {
91386
+ capName: "notification-rules",
91387
+ capScope: "system",
91388
+ addonId: null,
91389
+ access: "view"
91390
+ },
90958
91391
  "notificationRules.getConditionCatalog": {
90959
91392
  capName: "notification-rules",
90960
91393
  capScope: "system",
@@ -91465,6 +91898,12 @@ Object.freeze({
91465
91898
  addonId: null,
91466
91899
  access: "create"
91467
91900
  },
91901
+ "pipelineAnalytics.readLongTermSeries": {
91902
+ capName: "pipeline-analytics",
91903
+ capScope: "device",
91904
+ addonId: null,
91905
+ access: "view"
91906
+ },
91468
91907
  "pipelineAnalytics.rebuildObjectEmbeddings": {
91469
91908
  capName: "pipeline-analytics",
91470
91909
  capScope: "device",
@@ -92137,6 +92576,12 @@ Object.freeze({
92137
92576
  addonId: null,
92138
92577
  access: "create"
92139
92578
  },
92579
+ "pipelineRunner.requestOccupancyBurst": {
92580
+ capName: "pipeline-runner",
92581
+ capScope: "system",
92582
+ addonId: null,
92583
+ access: "create"
92584
+ },
92140
92585
  "pipelineRunner.runDetailSubtree": {
92141
92586
  capName: "pipeline-runner",
92142
92587
  capScope: "system",
@@ -93349,6 +93794,12 @@ Object.freeze({
93349
93794
  addonId: null,
93350
93795
  access: "create"
93351
93796
  },
93797
+ "streamBroker.reportStreamSignal": {
93798
+ capName: "stream-broker",
93799
+ capScope: "system",
93800
+ addonId: null,
93801
+ access: "create"
93802
+ },
93352
93803
  "streamBroker.restartProfile": {
93353
93804
  capName: "stream-broker",
93354
93805
  capScope: "system",
@@ -93433,6 +93884,12 @@ Object.freeze({
93433
93884
  addonId: null,
93434
93885
  access: "create"
93435
93886
  },
93887
+ "streamSignals.listSignals": {
93888
+ capName: "stream-signals",
93889
+ capScope: "device",
93890
+ addonId: null,
93891
+ access: "view"
93892
+ },
93436
93893
  "switch.setState": {
93437
93894
  capName: "switch",
93438
93895
  capScope: "device",
@@ -94905,11 +95362,21 @@ Object.freeze({
94905
95362
  form: "single",
94906
95363
  optional: false
94907
95364
  }],
95365
+ "nativeObjectDetection.getOptions": [{
95366
+ name: "deviceId",
95367
+ form: "single",
95368
+ optional: false
95369
+ }],
94908
95370
  "nativeObjectDetection.setEnabled": [{
94909
95371
  name: "deviceId",
94910
95372
  form: "single",
94911
95373
  optional: false
94912
95374
  }],
95375
+ "nativeObjectDetection.setSettings": [{
95376
+ name: "deviceId",
95377
+ form: "single",
95378
+ optional: false
95379
+ }],
94913
95380
  "navigation.getFeatures": [{
94914
95381
  name: "deviceId",
94915
95382
  form: "single",
@@ -95259,6 +95726,11 @@ Object.freeze({
95259
95726
  form: "single",
95260
95727
  optional: false
95261
95728
  }],
95729
+ "pipelineAnalytics.readLongTermSeries": [{
95730
+ name: "deviceId",
95731
+ form: "single",
95732
+ optional: false
95733
+ }],
95262
95734
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
95263
95735
  name: "deviceId",
95264
95736
  form: "single",
@@ -95449,6 +95921,11 @@ Object.freeze({
95449
95921
  form: "single",
95450
95922
  optional: false
95451
95923
  }],
95924
+ "pipelineRunner.requestOccupancyBurst": [{
95925
+ name: "deviceId",
95926
+ form: "single",
95927
+ optional: false
95928
+ }],
95452
95929
  "pipelineRunner.runDetailSubtree": [{
95453
95930
  name: "deviceId",
95454
95931
  form: "single",
@@ -95805,6 +96282,11 @@ Object.freeze({
95805
96282
  form: "single",
95806
96283
  optional: false
95807
96284
  }],
96285
+ "streamBroker.reportStreamSignal": [{
96286
+ name: "deviceId",
96287
+ form: "single",
96288
+ optional: false
96289
+ }],
95808
96290
  "streamBroker.restartProfile": [{
95809
96291
  name: "deviceId",
95810
96292
  form: "single",