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