@camstack/addon-provider-rtsp 1.2.101 → 1.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
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  //#endregion
24
24
  let node_net = require("node:net");
25
25
  node_net = __toESM(node_net);
26
- //#region ../types/dist/event-category-ZyX6jcse.mjs
26
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
27
27
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
28
28
  EventCategory["SystemBoot"] = "system.boot";
29
29
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -640,6 +640,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
640
640
  * pull-reconcile from the provider's `getStatus` on reconnect. */
641
641
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
642
642
  EventCategory["BackupCompleted"] = "backup.completed";
643
+ /**
644
+ * A whole backup RUN finished — every destination attempted, win or lose.
645
+ *
646
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
647
+ * a progress UI and the wrong one for a notification: an operator with three
648
+ * destinations would be told three times. And a run where two of three
649
+ * destinations succeeded is not a clean success — a single "backup
650
+ * completed" that hid the failed one would be a lie, so the count of each is
651
+ * carried here and the message says both.
652
+ *
653
+ * Emitted by the backup orchestrator only after the destination loop, so a
654
+ * run that dies during the BUILD phase produces no completion at all.
655
+ */
656
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
643
657
  EventCategory["BackupRestored"] = "backup.restored";
644
658
  EventCategory["NotificationDispatched"] = "notification.dispatched";
645
659
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5370,7 +5384,7 @@ var ZodIssueCode = {
5370
5384
  var ZodFirstPartyTypeKind;
5371
5385
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5372
5386
  //#endregion
5373
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5387
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5374
5388
  /**
5375
5389
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5376
5390
  * window to float samples (D455).
@@ -11546,6 +11560,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11546
11560
  auth: "admin"
11547
11561
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11548
11562
  DeviceType.Camera;
11563
+ /**
11564
+ * The signals a device can emit to WAKE its own stream.
11565
+ *
11566
+ * A camera whose stream is built on demand sleeps until something asks for it,
11567
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11568
+ * puller holds a session open for ever, and treating that as demand would keep
11569
+ * a battery camera awake for ever, which is the whole thing the battery is for
11570
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11571
+ * itself, with no stream running.
11572
+ *
11573
+ * ## The vocabulary is the PROVIDER'S, not ours
11574
+ *
11575
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11576
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11577
+ * Reolink offers motion and camera-native detection; another provider may offer
11578
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11579
+ * yet. A fixed enum here would mean every new signal is a framework release.
11580
+ *
11581
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11582
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11583
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11584
+ * binding — but both answer "what drives the detection pipeline", which is a
11585
+ * different question from "what may wake a sleeping stream". A camera can do
11586
+ * the first and not be trusted with the second, and the operator picks per
11587
+ * camera. Two questions, two authorities.
11588
+ *
11589
+ * ## Availability is not permission
11590
+ *
11591
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11592
+ * wakes the stream is the operator's per-camera choice, held by the broker
11593
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11594
+ * provider declaring a signal is not a provider enabling it.
11595
+ */
11596
+ /** One signal a device can emit. */
11597
+ var StreamSignalSchema = object({
11598
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11599
+ code: string().min(1),
11600
+ /** What an operator reads in the picker. The provider's own wording. */
11601
+ label: string().min(1),
11602
+ /**
11603
+ * Whether the provider recommends this signal ON when a camera is first set
11604
+ * up. A provider knows which of its signals are cheap and reliable; an
11605
+ * operator should not have to discover that by trial. Reolink recommends
11606
+ * both of its own.
11607
+ */
11608
+ recommended: boolean()
11609
+ });
11610
+ var StreamSignalsStatusSchema = object({
11611
+ signals: array(StreamSignalSchema),
11612
+ lastFetchedAt: number()
11613
+ });
11614
+ var streamSignalsCapability = {
11615
+ name: "stream-signals",
11616
+ scope: "device",
11617
+ deviceNative: true,
11618
+ mode: "singleton",
11619
+ deviceTypes: Object.values(DeviceType),
11620
+ runtimeState: StreamSignalsStatusSchema,
11621
+ /**
11622
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11623
+ *
11624
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11625
+ * not an operator choice: the provider re-declares it on every registration,
11626
+ * so losing it loses nothing and persisting it would freeze an answer the
11627
+ * camera is entitled to change. Measured the same day on the sibling case —
11628
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11629
+ * class the camera really detected stayed missing for the life of the row
11630
+ * because the fix could not reach it.
11631
+ *
11632
+ * See `RuntimeStateDurability`. Enforced by
11633
+ * `scripts/check-runtime-state-durability.ts`.
11634
+ */
11635
+ durability: "session",
11636
+ methods: {
11637
+ /**
11638
+ * What this device can emit. Empty is a valid and common answer — most
11639
+ * cameras have nothing to offer here, and an empty list is what makes the
11640
+ * broker's picker show nothing rather than a false choice.
11641
+ */
11642
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11643
+ };
11549
11644
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11550
11645
  var StreamFormatSchema = _enum([
11551
11646
  "webrtc",
@@ -11942,6 +12037,22 @@ var EgressTranscodeSchema = object({
11942
12037
  camStreamId: string().nullable()
11943
12038
  });
11944
12039
  method(object({
12040
+ deviceId: number().int().nonnegative(),
12041
+ /** The provider's signal code. */
12042
+ code: string().min(1),
12043
+ /** Ms epoch. Absent ⇒ now. */
12044
+ at: number().optional()
12045
+ }), object({
12046
+ /** Whether the broker acted on it, and if not, why. */
12047
+ accepted: boolean(),
12048
+ reason: _enum([
12049
+ "woke",
12050
+ "hold-extended",
12051
+ "not-enabled",
12052
+ "no-consumer",
12053
+ "unknown-code"
12054
+ ])
12055
+ }), { kind: "mutation" }), method(object({
11945
12056
  deviceId: number().int().nonnegative(),
11946
12057
  camStreamId: string().min(1),
11947
12058
  kind: CamStreamKindSchema,
@@ -12196,6 +12307,16 @@ var PickStreamRequirementsSchema = object({
12196
12307
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12197
12308
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12198
12309
  minHeight: number().int().positive().optional(),
12310
+ /**
12311
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12312
+ *
12313
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12314
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12315
+ * Without this the ceiling had to be re-implemented by every caller — and
12316
+ * one caller implementing it privately is how a second scoring authority
12317
+ * gets born.
12318
+ */
12319
+ maxHeight: number().int().positive().optional(),
12199
12320
  /** Minimum horizontal resolution. */
12200
12321
  minWidth: number().int().positive().optional(),
12201
12322
  /**
@@ -12212,7 +12333,22 @@ var PickStreamRequirementsSchema = object({
12212
12333
  * transcoded" guard: if the device is already serving the consumer's
12213
12334
  * codec end-to-end, there's nothing to optimise.
12214
12335
  */
12215
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12336
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12337
+ /**
12338
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12339
+ * understanding that it will be transcoded.
12340
+ *
12341
+ * Default `false` — today's behaviour, and the right one for a bypass
12342
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12343
+ * ask the larger question: "what is the best stream for me, transcoding if
12344
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12345
+ * does not, so a passthrough is never lost to a transcode; the answer says
12346
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12347
+ *
12348
+ * This is what lets one picker serve both the bypass and the full source
12349
+ * choice, instead of a consumer scoring privately when the bypass misses.
12350
+ */
12351
+ allowTranscode: boolean().optional()
12216
12352
  }).readonly();
12217
12353
  var PickStreamPreferencesSchema = object({
12218
12354
  /**
@@ -12226,12 +12362,32 @@ var PickStreamPreferencesSchema = object({
12226
12362
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12227
12363
  * memory-constrained consumers / Apple Home guest sessions).
12228
12364
  */
12229
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12365
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12366
+ /**
12367
+ * The height the consumer actually wants to DELIVER.
12368
+ *
12369
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12370
+ * above the target wins, and only if nothing reaches it does the tallest
12371
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12372
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12373
+ * express that: it says "as big as possible", which is a different wish.
12374
+ *
12375
+ * Ignored when absent, so every existing caller keeps its ordering.
12376
+ */
12377
+ targetHeight: number().int().positive().optional()
12230
12378
  }).readonly();
12231
12379
  var PickedCamStreamSchema = object({
12232
12380
  camStreamId: string(),
12233
12381
  codec: string().optional(),
12234
12382
  resolution: CamStreamResolutionSchema.optional(),
12383
+ /**
12384
+ * Whether serving this stream requires a decode + re-encode.
12385
+ *
12386
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12387
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12388
+ * not ask cannot be handed a cost it never agreed to pay.
12389
+ */
12390
+ transcodes: boolean(),
12235
12391
  /** One-line explanation of why this stream won — for logs / debug UI. */
12236
12392
  reason: string()
12237
12393
  });
@@ -16748,6 +16904,8 @@ var NcSystemEventKindSchema = _enum([
16748
16904
  "device-enabled",
16749
16905
  "device-battery-low",
16750
16906
  "device-battery-normal",
16907
+ "device-consumable-low",
16908
+ "device-consumable-normal",
16751
16909
  "stream-online",
16752
16910
  "stream-offline",
16753
16911
  "node-online",
@@ -16766,6 +16924,7 @@ var NcSystemEventKindSchema = _enum([
16766
16924
  "addon-updated",
16767
16925
  "server-updated",
16768
16926
  "export-completed",
16927
+ "backup-completed",
16769
16928
  "camera-online",
16770
16929
  "camera-offline",
16771
16930
  "camera-disabled",
@@ -18088,6 +18247,48 @@ var NcAlarmConfigSchema = object({
18088
18247
  settings: NcAlarmSettingsSchema,
18089
18248
  coverage: array(NcAlarmModeCoverageSchema)
18090
18249
  });
18250
+ /**
18251
+ * ONE rule's demand on ONE camera's clip ring.
18252
+ *
18253
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18254
+ * camera, so the answer stays a faithful description of the rules and the
18255
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18256
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18257
+ * a different thing from never having been told, and only the envelope
18258
+ * (`rulesLoaded`) can tell those apart.
18259
+ */
18260
+ var NcClipRetentionAskSchema = object({
18261
+ /**
18262
+ * The camera this ask is about. **Absent = every camera**, which is what a
18263
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18264
+ * asking everywhere.
18265
+ */
18266
+ deviceId: number().int().nonnegative().optional(),
18267
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18268
+ * needs nothing produces no ask at all. */
18269
+ seconds: number().min(0).max(60),
18270
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18271
+ * assigned, which is what the cut defaults to. */
18272
+ profile: CamProfileSchema.optional(),
18273
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18274
+ ruleId: string(),
18275
+ ruleName: string(),
18276
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18277
+ reason: _enum(["window", "occupancy"])
18278
+ });
18279
+ /**
18280
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18281
+ *
18282
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18283
+ * once. A centre that is up but has not read its rules yet answers with an
18284
+ * empty ask list that means nothing at all — applying it would drop every
18285
+ * camera's ring to zero for the first events after a restart, which is the
18286
+ * footage this mechanism exists to keep.
18287
+ */
18288
+ var NcClipRetentionPlanSchema = object({
18289
+ rulesLoaded: boolean(),
18290
+ asks: array(NcClipRetentionAskSchema).readonly()
18291
+ });
18091
18292
  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 }), {
18092
18293
  kind: "mutation",
18093
18294
  auth: "admin",
@@ -18108,7 +18309,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18108
18309
  }), object({ success: literal(true) }), {
18109
18310
  kind: "mutation",
18110
18311
  auth: "admin"
18111
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18312
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18112
18313
  deviceId: number().int(),
18113
18314
  muted: boolean()
18114
18315
  }), object({ success: literal(true) }), {
@@ -20682,6 +20883,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20682
20883
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20683
20884
  framesMatched: number().int()
20684
20885
  })).readonly() });
20886
+ /**
20887
+ * The long-term series a camera produces. A closed union so a typo cannot
20888
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20889
+ * is an alias of this, not a second list.
20890
+ */
20891
+ var AnalyticsLtsSeriesSchema = _enum([
20892
+ "motion",
20893
+ "audio-dbfs",
20894
+ "battery",
20895
+ "occupancy"
20896
+ ]);
20897
+ /**
20898
+ * One closed 5-minute bucket of a long-term series.
20899
+ *
20900
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20901
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20902
+ * that exists at all was measured; a bucket that is absent was not, which is a
20903
+ * different claim from zero and the reason this is a sparse series.
20904
+ */
20905
+ var LtsBucketSchema = object({
20906
+ scope: string(),
20907
+ bucketStart: number().int(),
20908
+ samples: number().int().nonnegative(),
20909
+ sum: number(),
20910
+ min: number(),
20911
+ max: number()
20912
+ });
20685
20913
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20686
20914
  deviceId: number(),
20687
20915
  trackId: string()
@@ -20728,6 +20956,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20728
20956
  kinds: array(string()).optional(),
20729
20957
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20730
20958
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20959
+ deviceId: number(),
20960
+ series: AnalyticsLtsSeriesSchema,
20961
+ /** Omit for EVERY scope of this series in the range. */
20962
+ scope: string().optional(),
20963
+ from: number(),
20964
+ to: number(),
20965
+ limit: number().int().positive().optional()
20966
+ }), array(LtsBucketSchema).readonly()), method(object({
20731
20967
  deviceId: number(),
20732
20968
  since: number(),
20733
20969
  until: number(),
@@ -21346,6 +21582,14 @@ var MotionSourceEnum = _enum([
21346
21582
  */
21347
21583
  var MotionSourcesSchema = array(MotionSourceEnum);
21348
21584
  /**
21585
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21586
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21587
+ * than a second spelling of the same two ideas — the value an operator picks
21588
+ * here is the value that comes back on the track, the overlay and the debug
21589
+ * row.
21590
+ */
21591
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21592
+ /**
21349
21593
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21350
21594
  * so cap-side consumers (the orchestrator forward, the runner addon's
21351
21595
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21496,6 +21740,35 @@ var RunnerCameraConfigSchema = object({
21496
21740
  * events; the orchestrator forwards to `reportMotion`.
21497
21741
  */
21498
21742
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21743
+ /**
21744
+ * WHICH root detector runs for this camera. The detection counterpart of
21745
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21746
+ * of sources the system understands, vendor-agnostic, owned here.
21747
+ *
21748
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21749
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21750
+ * here. Its boxes reach post-analysis on the same
21751
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21752
+ * track gets the same tracker, the same overlay and the same detail
21753
+ * subtree (face / plate / embedding).
21754
+ *
21755
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21756
+ * run, and that is where a camera with a usable onboard detector buys back
21757
+ * its share of the accelerator. It saves the root inference, not the decode
21758
+ * — the detail subtree still needs pixels to cut crops from.
21759
+ *
21760
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21761
+ * step at all (there is nothing to track), and the cap that knows this says
21762
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21763
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21764
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21765
+ * worth exactly what it already is — a wake signal with a class.
21766
+ *
21767
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21768
+ * vendor never turns a detector on for the operator, and neither does a
21769
+ * default.
21770
+ */
21771
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21499
21772
  pipelineEnabled: boolean().default(true),
21500
21773
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21501
21774
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21677,7 +21950,47 @@ var RunnerLocalMetricsSchema = object({
21677
21950
  queueDepth: number(),
21678
21951
  frameLazy: FrameLazyMetricsSchema.optional()
21679
21952
  });
21953
+ /**
21954
+ * Pipeline Runner capability — runtime detection workhorse.
21955
+ *
21956
+ * One instance per node. Receives camera assignments from
21957
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21958
+ * decoded frames, drains motion + detection queues, calls the local
21959
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21960
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21961
+ * the bus.
21962
+ *
21963
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21964
+ * runner has zero knowledge of other agents, no global state, and never
21965
+ * makes assignment decisions itself.
21966
+ */
21967
+ /**
21968
+ * Why a runner declined to look at a camera out of band. Named rather than a
21969
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21970
+ * already mid-session and one already bursting are four different facts, and a
21971
+ * caller told only "no" cannot tell a protection from a bug.
21972
+ */
21973
+ var OccupancyBurstRefusalSchema = _enum([
21974
+ "not-attached",
21975
+ "battery-asleep",
21976
+ "not-watching",
21977
+ "already-bursting"
21978
+ ]);
21680
21979
  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({
21980
+ deviceId: number(),
21981
+ /** How many frames to collect. The caller sizes this against what its
21982
+ * own confirmation needs; the runner clamps it to the field's range. */
21983
+ frames: number().int().positive().optional(),
21984
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21985
+ * defend — the periodic one at least has a timer to point at. */
21986
+ reason: string()
21987
+ }), object({
21988
+ started: boolean(),
21989
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21990
+ }), {
21991
+ auth: "admin",
21992
+ kind: "mutation"
21993
+ }), method(object({
21681
21994
  handle: FrameHandleSchema,
21682
21995
  bbox: NativeCropBboxSchema,
21683
21996
  maxWidth: number().int().positive().optional(),
@@ -24151,10 +24464,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24151
24464
  }), boolean()), method(object({
24152
24465
  deviceId: number().int().nonnegative(),
24153
24466
  sessionId: string()
24154
- }), object({ pendingRenegotiation: object({
24155
- target: WebrtcStreamTargetSchema,
24156
- epoch: number()
24157
- }).nullable() }));
24467
+ }), object({
24468
+ pendingRenegotiation: object({
24469
+ target: WebrtcStreamTargetSchema,
24470
+ epoch: number()
24471
+ }).nullable(),
24472
+ /**
24473
+ * Whether the session still EXISTS.
24474
+ *
24475
+ * A consumer that holds a resource for the life of a session needs to
24476
+ * be able to ask, because a session does not always end the way it
24477
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24478
+ * sent `SessionDisconnected`, so the Alexa exporter's
24479
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24480
+ * H.264 transcode kept running for NOBODY for more than twenty
24481
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24482
+ * minutes earlier — the broker knew; the holder had no way to ask.
24483
+ *
24484
+ * `false` for a session id the provider has never heard of, which is
24485
+ * the same answer as "it ended": either way nothing is holding it up.
24486
+ */
24487
+ alive: boolean()
24488
+ }));
24158
24489
  object({
24159
24490
  /** All accessory children of the parent. */
24160
24491
  childDeviceIds: array(number()).readonly(),
@@ -28601,11 +28932,46 @@ var NativeObjectDetectionStatusSchema = object({
28601
28932
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28602
28933
  /**
28603
28934
  * Whether forwarding of onboard AI detections is enabled for this device.
28604
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28605
- * churn the tracker, so forwarding stays off until the operator enables it.
28935
+ *
28936
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28937
+ * camera runs — that is the operator's choice, and it is made where every
28938
+ * other detection choice is made. `geometry` on
28939
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28940
+ * choice would buy this particular camera.
28606
28941
  */
28607
28942
  enabled: boolean()
28608
28943
  });
28944
+ /**
28945
+ * WHEN a camera's onboard detections carry geometry.
28946
+ *
28947
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28948
+ * a detection is a trackable subject whenever the camera sees one.
28949
+ * - `while-streaming` — only while some stream of this camera is already open.
28950
+ * The boxes ride the video's own side-channel rather than a feed of their
28951
+ * own, so they cost nothing and they exist only when something is pulling.
28952
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28953
+ * radio drain, but a camera that is awake is awake precisely because
28954
+ * something is in front of it, and its stream is already being pulled.
28955
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28956
+ * pipeline needs geometry to make a subject, so such a push reaches the
28957
+ * tracker as motion and no further.
28958
+ *
28959
+ * Reported and not inferred, because the operator's question in front of the
28960
+ * picker is "what do I get", and these are three different answers (D14: the
28961
+ * derived form is only as honest as `getOptions`).
28962
+ */
28963
+ var NativeObjectGeometryEnum = _enum([
28964
+ "boxed",
28965
+ "while-streaming",
28966
+ "flag-only"
28967
+ ]);
28968
+ var NativeObjectDetectionOptionsSchema = object({
28969
+ /** Classes this firmware can detect — the same list the status reports. */
28970
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28971
+ /** What a detection from this camera carries. */
28972
+ geometry: NativeObjectGeometryEnum
28973
+ });
28974
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28609
28975
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28610
28976
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28611
28977
  lastFetchedAt: number() });
@@ -28615,13 +28981,23 @@ var nativeObjectDetectionCapability = {
28615
28981
  deviceNative: true,
28616
28982
  mode: "singleton",
28617
28983
  deviceTypes: [DeviceType.Camera],
28618
- methods: { setEnabled: method(object({
28619
- deviceId: number(),
28620
- enabled: boolean()
28621
- }), _void(), {
28622
- kind: "mutation",
28623
- auth: "admin"
28624
- }) },
28984
+ methods: {
28985
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28986
+ setSettings: method(object({
28987
+ deviceId: number(),
28988
+ settings: NativeObjectDetectionSettingsPatchSchema
28989
+ }), _void(), {
28990
+ kind: "mutation",
28991
+ auth: "admin"
28992
+ }),
28993
+ setEnabled: method(object({
28994
+ deviceId: number(),
28995
+ enabled: boolean()
28996
+ }), _void(), {
28997
+ kind: "mutation",
28998
+ auth: "admin"
28999
+ })
29000
+ },
28625
29001
  events: { onDetected: { data: object({
28626
29002
  deviceId: number(),
28627
29003
  detection: NativeDetectionSchema
@@ -33469,7 +33845,28 @@ var PerScopeBreakdownSchema = object({
33469
33845
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33470
33846
  totalObjects: number().int().nonnegative(),
33471
33847
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33472
- byClass: record(string(), number().int().nonnegative())
33848
+ byClass: record(string(), number().int().nonnegative()),
33849
+ /**
33850
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33851
+ * present but not going anywhere (a parked car, a bin, a statue).
33852
+ *
33853
+ * The operator's question about a scene has two halves and they answer
33854
+ * different things: "what is parked here" is stable for hours and must not
33855
+ * flap, while "who is walking through" is the thing an alert is about. One
33856
+ * number could only serve one of them, and `totalObjects` served the first
33857
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33858
+ *
33859
+ * `standing + transient === totalObjects`, always. The total keeps its old
33860
+ * meaning exactly, so no rule written against it changes behaviour.
33861
+ *
33862
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33863
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33864
+ * parked objects here" about a camera whose lot is full.
33865
+ */
33866
+ standingObjects: number().int().nonnegative().optional(),
33867
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33868
+ * same absence rule. */
33869
+ transientObjects: number().int().nonnegative().optional()
33473
33870
  });
33474
33871
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33475
33872
  zoneId: string(),
@@ -33592,6 +33989,23 @@ var HistoryPointSchema = object({
33592
33989
  * triple covers the three spatial scopes (per-zone, frame-wide,
33593
33990
  * outside-any-zone). Crossing them with `className?` gives the full
33594
33991
  * combinatorial coverage the operator UI requested.
33992
+ *
33993
+ * ## ⚠️ The three history methods are DEPRECATED
33994
+ *
33995
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33996
+ * so after a restart they report nothing about a night that did happen, and any
33997
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33998
+ * an empty scene. The presets in the occupancy chart existed to hide that
33999
+ * horizon rather than to answer a question.
34000
+ *
34001
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34002
+ * instead. Those rows are already written for every camera, ~60 bytes per
34003
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34004
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34005
+ * function the writer uses, so the two cannot drift.
34006
+ *
34007
+ * The ring stays until these three go, and it is the only thing left reading
34008
+ * it. Do not add a fourth caller.
33595
34009
  */
33596
34010
  var zoneAnalyticsCapability = {
33597
34011
  name: "zone-analytics",
@@ -34081,6 +34495,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34081
34495
  smoke: smokeCapability,
34082
34496
  streamCatalog: streamCatalogCapability,
34083
34497
  streamParams: streamParamsCapability,
34498
+ streamSignals: streamSignalsCapability,
34084
34499
  switch: switchCapability,
34085
34500
  tamper: tamperCapability,
34086
34501
  temperatureSensor: temperatureSensorCapability,
@@ -38056,12 +38471,24 @@ Object.freeze({
38056
38471
  addonId: null,
38057
38472
  access: "create"
38058
38473
  },
38474
+ "nativeObjectDetection.getOptions": {
38475
+ capName: "native-object-detection",
38476
+ capScope: "device",
38477
+ addonId: null,
38478
+ access: "view"
38479
+ },
38059
38480
  "nativeObjectDetection.setEnabled": {
38060
38481
  capName: "native-object-detection",
38061
38482
  capScope: "device",
38062
38483
  addonId: null,
38063
38484
  access: "create"
38064
38485
  },
38486
+ "nativeObjectDetection.setSettings": {
38487
+ capName: "native-object-detection",
38488
+ capScope: "device",
38489
+ addonId: null,
38490
+ access: "create"
38491
+ },
38065
38492
  "navigation.getFeatures": {
38066
38493
  capName: "navigation",
38067
38494
  capScope: "device",
@@ -38326,6 +38753,12 @@ Object.freeze({
38326
38753
  addonId: null,
38327
38754
  access: "view"
38328
38755
  },
38756
+ "notificationRules.getClipRetentionAsks": {
38757
+ capName: "notification-rules",
38758
+ capScope: "system",
38759
+ addonId: null,
38760
+ access: "view"
38761
+ },
38329
38762
  "notificationRules.getConditionCatalog": {
38330
38763
  capName: "notification-rules",
38331
38764
  capScope: "system",
@@ -38836,6 +39269,12 @@ Object.freeze({
38836
39269
  addonId: null,
38837
39270
  access: "create"
38838
39271
  },
39272
+ "pipelineAnalytics.readLongTermSeries": {
39273
+ capName: "pipeline-analytics",
39274
+ capScope: "device",
39275
+ addonId: null,
39276
+ access: "view"
39277
+ },
38839
39278
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38840
39279
  capName: "pipeline-analytics",
38841
39280
  capScope: "device",
@@ -39508,6 +39947,12 @@ Object.freeze({
39508
39947
  addonId: null,
39509
39948
  access: "create"
39510
39949
  },
39950
+ "pipelineRunner.requestOccupancyBurst": {
39951
+ capName: "pipeline-runner",
39952
+ capScope: "system",
39953
+ addonId: null,
39954
+ access: "create"
39955
+ },
39511
39956
  "pipelineRunner.runDetailSubtree": {
39512
39957
  capName: "pipeline-runner",
39513
39958
  capScope: "system",
@@ -40720,6 +41165,12 @@ Object.freeze({
40720
41165
  addonId: null,
40721
41166
  access: "create"
40722
41167
  },
41168
+ "streamBroker.reportStreamSignal": {
41169
+ capName: "stream-broker",
41170
+ capScope: "system",
41171
+ addonId: null,
41172
+ access: "create"
41173
+ },
40723
41174
  "streamBroker.restartProfile": {
40724
41175
  capName: "stream-broker",
40725
41176
  capScope: "system",
@@ -40804,6 +41255,12 @@ Object.freeze({
40804
41255
  addonId: null,
40805
41256
  access: "create"
40806
41257
  },
41258
+ "streamSignals.listSignals": {
41259
+ capName: "stream-signals",
41260
+ capScope: "device",
41261
+ addonId: null,
41262
+ access: "view"
41263
+ },
40807
41264
  "switch.setState": {
40808
41265
  capName: "switch",
40809
41266
  capScope: "device",
@@ -42276,11 +42733,21 @@ Object.freeze({
42276
42733
  form: "single",
42277
42734
  optional: false
42278
42735
  }],
42736
+ "nativeObjectDetection.getOptions": [{
42737
+ name: "deviceId",
42738
+ form: "single",
42739
+ optional: false
42740
+ }],
42279
42741
  "nativeObjectDetection.setEnabled": [{
42280
42742
  name: "deviceId",
42281
42743
  form: "single",
42282
42744
  optional: false
42283
42745
  }],
42746
+ "nativeObjectDetection.setSettings": [{
42747
+ name: "deviceId",
42748
+ form: "single",
42749
+ optional: false
42750
+ }],
42284
42751
  "navigation.getFeatures": [{
42285
42752
  name: "deviceId",
42286
42753
  form: "single",
@@ -42630,6 +43097,11 @@ Object.freeze({
42630
43097
  form: "single",
42631
43098
  optional: false
42632
43099
  }],
43100
+ "pipelineAnalytics.readLongTermSeries": [{
43101
+ name: "deviceId",
43102
+ form: "single",
43103
+ optional: false
43104
+ }],
42633
43105
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42634
43106
  name: "deviceId",
42635
43107
  form: "single",
@@ -42820,6 +43292,11 @@ Object.freeze({
42820
43292
  form: "single",
42821
43293
  optional: false
42822
43294
  }],
43295
+ "pipelineRunner.requestOccupancyBurst": [{
43296
+ name: "deviceId",
43297
+ form: "single",
43298
+ optional: false
43299
+ }],
42823
43300
  "pipelineRunner.runDetailSubtree": [{
42824
43301
  name: "deviceId",
42825
43302
  form: "single",
@@ -43176,6 +43653,11 @@ Object.freeze({
43176
43653
  form: "single",
43177
43654
  optional: false
43178
43655
  }],
43656
+ "streamBroker.reportStreamSignal": [{
43657
+ name: "deviceId",
43658
+ form: "single",
43659
+ optional: false
43660
+ }],
43179
43661
  "streamBroker.restartProfile": [{
43180
43662
  name: "deviceId",
43181
43663
  form: "single",