@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.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import net from "node:net";
2
- //#region ../types/dist/event-category-ZyX6jcse.mjs
2
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -616,6 +616,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
616
616
  * pull-reconcile from the provider's `getStatus` on reconnect. */
617
617
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
618
618
  EventCategory["BackupCompleted"] = "backup.completed";
619
+ /**
620
+ * A whole backup RUN finished — every destination attempted, win or lose.
621
+ *
622
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
623
+ * a progress UI and the wrong one for a notification: an operator with three
624
+ * destinations would be told three times. And a run where two of three
625
+ * destinations succeeded is not a clean success — a single "backup
626
+ * completed" that hid the failed one would be a lie, so the count of each is
627
+ * carried here and the message says both.
628
+ *
629
+ * Emitted by the backup orchestrator only after the destination loop, so a
630
+ * run that dies during the BUILD phase produces no completion at all.
631
+ */
632
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
619
633
  EventCategory["BackupRestored"] = "backup.restored";
620
634
  EventCategory["NotificationDispatched"] = "notification.dispatched";
621
635
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5346,7 +5360,7 @@ var ZodIssueCode = {
5346
5360
  var ZodFirstPartyTypeKind;
5347
5361
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5348
5362
  //#endregion
5349
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5363
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5350
5364
  /**
5351
5365
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5352
5366
  * window to float samples (D455).
@@ -11522,6 +11536,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11522
11536
  auth: "admin"
11523
11537
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11524
11538
  DeviceType.Camera;
11539
+ /**
11540
+ * The signals a device can emit to WAKE its own stream.
11541
+ *
11542
+ * A camera whose stream is built on demand sleeps until something asks for it,
11543
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11544
+ * puller holds a session open for ever, and treating that as demand would keep
11545
+ * a battery camera awake for ever, which is the whole thing the battery is for
11546
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11547
+ * itself, with no stream running.
11548
+ *
11549
+ * ## The vocabulary is the PROVIDER'S, not ours
11550
+ *
11551
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11552
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11553
+ * Reolink offers motion and camera-native detection; another provider may offer
11554
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11555
+ * yet. A fixed enum here would mean every new signal is a framework release.
11556
+ *
11557
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11558
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11559
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11560
+ * binding — but both answer "what drives the detection pipeline", which is a
11561
+ * different question from "what may wake a sleeping stream". A camera can do
11562
+ * the first and not be trusted with the second, and the operator picks per
11563
+ * camera. Two questions, two authorities.
11564
+ *
11565
+ * ## Availability is not permission
11566
+ *
11567
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11568
+ * wakes the stream is the operator's per-camera choice, held by the broker
11569
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11570
+ * provider declaring a signal is not a provider enabling it.
11571
+ */
11572
+ /** One signal a device can emit. */
11573
+ var StreamSignalSchema = object({
11574
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11575
+ code: string().min(1),
11576
+ /** What an operator reads in the picker. The provider's own wording. */
11577
+ label: string().min(1),
11578
+ /**
11579
+ * Whether the provider recommends this signal ON when a camera is first set
11580
+ * up. A provider knows which of its signals are cheap and reliable; an
11581
+ * operator should not have to discover that by trial. Reolink recommends
11582
+ * both of its own.
11583
+ */
11584
+ recommended: boolean()
11585
+ });
11586
+ var StreamSignalsStatusSchema = object({
11587
+ signals: array(StreamSignalSchema),
11588
+ lastFetchedAt: number()
11589
+ });
11590
+ var streamSignalsCapability = {
11591
+ name: "stream-signals",
11592
+ scope: "device",
11593
+ deviceNative: true,
11594
+ mode: "singleton",
11595
+ deviceTypes: Object.values(DeviceType),
11596
+ runtimeState: StreamSignalsStatusSchema,
11597
+ /**
11598
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11599
+ *
11600
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11601
+ * not an operator choice: the provider re-declares it on every registration,
11602
+ * so losing it loses nothing and persisting it would freeze an answer the
11603
+ * camera is entitled to change. Measured the same day on the sibling case —
11604
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11605
+ * class the camera really detected stayed missing for the life of the row
11606
+ * because the fix could not reach it.
11607
+ *
11608
+ * See `RuntimeStateDurability`. Enforced by
11609
+ * `scripts/check-runtime-state-durability.ts`.
11610
+ */
11611
+ durability: "session",
11612
+ methods: {
11613
+ /**
11614
+ * What this device can emit. Empty is a valid and common answer — most
11615
+ * cameras have nothing to offer here, and an empty list is what makes the
11616
+ * broker's picker show nothing rather than a false choice.
11617
+ */
11618
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11619
+ };
11525
11620
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11526
11621
  var StreamFormatSchema = _enum([
11527
11622
  "webrtc",
@@ -11918,6 +12013,22 @@ var EgressTranscodeSchema = object({
11918
12013
  camStreamId: string().nullable()
11919
12014
  });
11920
12015
  method(object({
12016
+ deviceId: number().int().nonnegative(),
12017
+ /** The provider's signal code. */
12018
+ code: string().min(1),
12019
+ /** Ms epoch. Absent ⇒ now. */
12020
+ at: number().optional()
12021
+ }), object({
12022
+ /** Whether the broker acted on it, and if not, why. */
12023
+ accepted: boolean(),
12024
+ reason: _enum([
12025
+ "woke",
12026
+ "hold-extended",
12027
+ "not-enabled",
12028
+ "no-consumer",
12029
+ "unknown-code"
12030
+ ])
12031
+ }), { kind: "mutation" }), method(object({
11921
12032
  deviceId: number().int().nonnegative(),
11922
12033
  camStreamId: string().min(1),
11923
12034
  kind: CamStreamKindSchema,
@@ -12172,6 +12283,16 @@ var PickStreamRequirementsSchema = object({
12172
12283
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12173
12284
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12174
12285
  minHeight: number().int().positive().optional(),
12286
+ /**
12287
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12288
+ *
12289
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12290
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12291
+ * Without this the ceiling had to be re-implemented by every caller — and
12292
+ * one caller implementing it privately is how a second scoring authority
12293
+ * gets born.
12294
+ */
12295
+ maxHeight: number().int().positive().optional(),
12175
12296
  /** Minimum horizontal resolution. */
12176
12297
  minWidth: number().int().positive().optional(),
12177
12298
  /**
@@ -12188,7 +12309,22 @@ var PickStreamRequirementsSchema = object({
12188
12309
  * transcoded" guard: if the device is already serving the consumer's
12189
12310
  * codec end-to-end, there's nothing to optimise.
12190
12311
  */
12191
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12312
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12313
+ /**
12314
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12315
+ * understanding that it will be transcoded.
12316
+ *
12317
+ * Default `false` — today's behaviour, and the right one for a bypass
12318
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12319
+ * ask the larger question: "what is the best stream for me, transcoding if
12320
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12321
+ * does not, so a passthrough is never lost to a transcode; the answer says
12322
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12323
+ *
12324
+ * This is what lets one picker serve both the bypass and the full source
12325
+ * choice, instead of a consumer scoring privately when the bypass misses.
12326
+ */
12327
+ allowTranscode: boolean().optional()
12192
12328
  }).readonly();
12193
12329
  var PickStreamPreferencesSchema = object({
12194
12330
  /**
@@ -12202,12 +12338,32 @@ var PickStreamPreferencesSchema = object({
12202
12338
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12203
12339
  * memory-constrained consumers / Apple Home guest sessions).
12204
12340
  */
12205
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12341
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12342
+ /**
12343
+ * The height the consumer actually wants to DELIVER.
12344
+ *
12345
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12346
+ * above the target wins, and only if nothing reaches it does the tallest
12347
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12348
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12349
+ * express that: it says "as big as possible", which is a different wish.
12350
+ *
12351
+ * Ignored when absent, so every existing caller keeps its ordering.
12352
+ */
12353
+ targetHeight: number().int().positive().optional()
12206
12354
  }).readonly();
12207
12355
  var PickedCamStreamSchema = object({
12208
12356
  camStreamId: string(),
12209
12357
  codec: string().optional(),
12210
12358
  resolution: CamStreamResolutionSchema.optional(),
12359
+ /**
12360
+ * Whether serving this stream requires a decode + re-encode.
12361
+ *
12362
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12363
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12364
+ * not ask cannot be handed a cost it never agreed to pay.
12365
+ */
12366
+ transcodes: boolean(),
12211
12367
  /** One-line explanation of why this stream won — for logs / debug UI. */
12212
12368
  reason: string()
12213
12369
  });
@@ -16724,6 +16880,8 @@ var NcSystemEventKindSchema = _enum([
16724
16880
  "device-enabled",
16725
16881
  "device-battery-low",
16726
16882
  "device-battery-normal",
16883
+ "device-consumable-low",
16884
+ "device-consumable-normal",
16727
16885
  "stream-online",
16728
16886
  "stream-offline",
16729
16887
  "node-online",
@@ -16742,6 +16900,7 @@ var NcSystemEventKindSchema = _enum([
16742
16900
  "addon-updated",
16743
16901
  "server-updated",
16744
16902
  "export-completed",
16903
+ "backup-completed",
16745
16904
  "camera-online",
16746
16905
  "camera-offline",
16747
16906
  "camera-disabled",
@@ -18064,6 +18223,48 @@ var NcAlarmConfigSchema = object({
18064
18223
  settings: NcAlarmSettingsSchema,
18065
18224
  coverage: array(NcAlarmModeCoverageSchema)
18066
18225
  });
18226
+ /**
18227
+ * ONE rule's demand on ONE camera's clip ring.
18228
+ *
18229
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18230
+ * camera, so the answer stays a faithful description of the rules and the
18231
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18232
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18233
+ * a different thing from never having been told, and only the envelope
18234
+ * (`rulesLoaded`) can tell those apart.
18235
+ */
18236
+ var NcClipRetentionAskSchema = object({
18237
+ /**
18238
+ * The camera this ask is about. **Absent = every camera**, which is what a
18239
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18240
+ * asking everywhere.
18241
+ */
18242
+ deviceId: number().int().nonnegative().optional(),
18243
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18244
+ * needs nothing produces no ask at all. */
18245
+ seconds: number().min(0).max(60),
18246
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18247
+ * assigned, which is what the cut defaults to. */
18248
+ profile: CamProfileSchema.optional(),
18249
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18250
+ ruleId: string(),
18251
+ ruleName: string(),
18252
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18253
+ reason: _enum(["window", "occupancy"])
18254
+ });
18255
+ /**
18256
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18257
+ *
18258
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18259
+ * once. A centre that is up but has not read its rules yet answers with an
18260
+ * empty ask list that means nothing at all — applying it would drop every
18261
+ * camera's ring to zero for the first events after a restart, which is the
18262
+ * footage this mechanism exists to keep.
18263
+ */
18264
+ var NcClipRetentionPlanSchema = object({
18265
+ rulesLoaded: boolean(),
18266
+ asks: array(NcClipRetentionAskSchema).readonly()
18267
+ });
18067
18268
  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 }), {
18068
18269
  kind: "mutation",
18069
18270
  auth: "admin",
@@ -18084,7 +18285,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18084
18285
  }), object({ success: literal(true) }), {
18085
18286
  kind: "mutation",
18086
18287
  auth: "admin"
18087
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18288
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18088
18289
  deviceId: number().int(),
18089
18290
  muted: boolean()
18090
18291
  }), object({ success: literal(true) }), {
@@ -20658,6 +20859,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20658
20859
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20659
20860
  framesMatched: number().int()
20660
20861
  })).readonly() });
20862
+ /**
20863
+ * The long-term series a camera produces. A closed union so a typo cannot
20864
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20865
+ * is an alias of this, not a second list.
20866
+ */
20867
+ var AnalyticsLtsSeriesSchema = _enum([
20868
+ "motion",
20869
+ "audio-dbfs",
20870
+ "battery",
20871
+ "occupancy"
20872
+ ]);
20873
+ /**
20874
+ * One closed 5-minute bucket of a long-term series.
20875
+ *
20876
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20877
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20878
+ * that exists at all was measured; a bucket that is absent was not, which is a
20879
+ * different claim from zero and the reason this is a sparse series.
20880
+ */
20881
+ var LtsBucketSchema = object({
20882
+ scope: string(),
20883
+ bucketStart: number().int(),
20884
+ samples: number().int().nonnegative(),
20885
+ sum: number(),
20886
+ min: number(),
20887
+ max: number()
20888
+ });
20661
20889
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20662
20890
  deviceId: number(),
20663
20891
  trackId: string()
@@ -20704,6 +20932,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20704
20932
  kinds: array(string()).optional(),
20705
20933
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20706
20934
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20935
+ deviceId: number(),
20936
+ series: AnalyticsLtsSeriesSchema,
20937
+ /** Omit for EVERY scope of this series in the range. */
20938
+ scope: string().optional(),
20939
+ from: number(),
20940
+ to: number(),
20941
+ limit: number().int().positive().optional()
20942
+ }), array(LtsBucketSchema).readonly()), method(object({
20707
20943
  deviceId: number(),
20708
20944
  since: number(),
20709
20945
  until: number(),
@@ -21322,6 +21558,14 @@ var MotionSourceEnum = _enum([
21322
21558
  */
21323
21559
  var MotionSourcesSchema = array(MotionSourceEnum);
21324
21560
  /**
21561
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21562
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21563
+ * than a second spelling of the same two ideas — the value an operator picks
21564
+ * here is the value that comes back on the track, the overlay and the debug
21565
+ * row.
21566
+ */
21567
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21568
+ /**
21325
21569
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21326
21570
  * so cap-side consumers (the orchestrator forward, the runner addon's
21327
21571
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21472,6 +21716,35 @@ var RunnerCameraConfigSchema = object({
21472
21716
  * events; the orchestrator forwards to `reportMotion`.
21473
21717
  */
21474
21718
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21719
+ /**
21720
+ * WHICH root detector runs for this camera. The detection counterpart of
21721
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21722
+ * of sources the system understands, vendor-agnostic, owned here.
21723
+ *
21724
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21725
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21726
+ * here. Its boxes reach post-analysis on the same
21727
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21728
+ * track gets the same tracker, the same overlay and the same detail
21729
+ * subtree (face / plate / embedding).
21730
+ *
21731
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21732
+ * run, and that is where a camera with a usable onboard detector buys back
21733
+ * its share of the accelerator. It saves the root inference, not the decode
21734
+ * — the detail subtree still needs pixels to cut crops from.
21735
+ *
21736
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21737
+ * step at all (there is nothing to track), and the cap that knows this says
21738
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21739
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21740
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21741
+ * worth exactly what it already is — a wake signal with a class.
21742
+ *
21743
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21744
+ * vendor never turns a detector on for the operator, and neither does a
21745
+ * default.
21746
+ */
21747
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21475
21748
  pipelineEnabled: boolean().default(true),
21476
21749
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21477
21750
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21653,7 +21926,47 @@ var RunnerLocalMetricsSchema = object({
21653
21926
  queueDepth: number(),
21654
21927
  frameLazy: FrameLazyMetricsSchema.optional()
21655
21928
  });
21929
+ /**
21930
+ * Pipeline Runner capability — runtime detection workhorse.
21931
+ *
21932
+ * One instance per node. Receives camera assignments from
21933
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21934
+ * decoded frames, drains motion + detection queues, calls the local
21935
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21936
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21937
+ * the bus.
21938
+ *
21939
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21940
+ * runner has zero knowledge of other agents, no global state, and never
21941
+ * makes assignment decisions itself.
21942
+ */
21943
+ /**
21944
+ * Why a runner declined to look at a camera out of band. Named rather than a
21945
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21946
+ * already mid-session and one already bursting are four different facts, and a
21947
+ * caller told only "no" cannot tell a protection from a bug.
21948
+ */
21949
+ var OccupancyBurstRefusalSchema = _enum([
21950
+ "not-attached",
21951
+ "battery-asleep",
21952
+ "not-watching",
21953
+ "already-bursting"
21954
+ ]);
21656
21955
  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({
21956
+ deviceId: number(),
21957
+ /** How many frames to collect. The caller sizes this against what its
21958
+ * own confirmation needs; the runner clamps it to the field's range. */
21959
+ frames: number().int().positive().optional(),
21960
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21961
+ * defend — the periodic one at least has a timer to point at. */
21962
+ reason: string()
21963
+ }), object({
21964
+ started: boolean(),
21965
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21966
+ }), {
21967
+ auth: "admin",
21968
+ kind: "mutation"
21969
+ }), method(object({
21657
21970
  handle: FrameHandleSchema,
21658
21971
  bbox: NativeCropBboxSchema,
21659
21972
  maxWidth: number().int().positive().optional(),
@@ -24127,10 +24440,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24127
24440
  }), boolean()), method(object({
24128
24441
  deviceId: number().int().nonnegative(),
24129
24442
  sessionId: string()
24130
- }), object({ pendingRenegotiation: object({
24131
- target: WebrtcStreamTargetSchema,
24132
- epoch: number()
24133
- }).nullable() }));
24443
+ }), object({
24444
+ pendingRenegotiation: object({
24445
+ target: WebrtcStreamTargetSchema,
24446
+ epoch: number()
24447
+ }).nullable(),
24448
+ /**
24449
+ * Whether the session still EXISTS.
24450
+ *
24451
+ * A consumer that holds a resource for the life of a session needs to
24452
+ * be able to ask, because a session does not always end the way it
24453
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24454
+ * sent `SessionDisconnected`, so the Alexa exporter's
24455
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24456
+ * H.264 transcode kept running for NOBODY for more than twenty
24457
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24458
+ * minutes earlier — the broker knew; the holder had no way to ask.
24459
+ *
24460
+ * `false` for a session id the provider has never heard of, which is
24461
+ * the same answer as "it ended": either way nothing is holding it up.
24462
+ */
24463
+ alive: boolean()
24464
+ }));
24134
24465
  object({
24135
24466
  /** All accessory children of the parent. */
24136
24467
  childDeviceIds: array(number()).readonly(),
@@ -28577,11 +28908,46 @@ var NativeObjectDetectionStatusSchema = object({
28577
28908
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28578
28909
  /**
28579
28910
  * Whether forwarding of onboard AI detections is enabled for this device.
28580
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28581
- * churn the tracker, so forwarding stays off until the operator enables it.
28911
+ *
28912
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28913
+ * camera runs — that is the operator's choice, and it is made where every
28914
+ * other detection choice is made. `geometry` on
28915
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28916
+ * choice would buy this particular camera.
28582
28917
  */
28583
28918
  enabled: boolean()
28584
28919
  });
28920
+ /**
28921
+ * WHEN a camera's onboard detections carry geometry.
28922
+ *
28923
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28924
+ * a detection is a trackable subject whenever the camera sees one.
28925
+ * - `while-streaming` — only while some stream of this camera is already open.
28926
+ * The boxes ride the video's own side-channel rather than a feed of their
28927
+ * own, so they cost nothing and they exist only when something is pulling.
28928
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28929
+ * radio drain, but a camera that is awake is awake precisely because
28930
+ * something is in front of it, and its stream is already being pulled.
28931
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28932
+ * pipeline needs geometry to make a subject, so such a push reaches the
28933
+ * tracker as motion and no further.
28934
+ *
28935
+ * Reported and not inferred, because the operator's question in front of the
28936
+ * picker is "what do I get", and these are three different answers (D14: the
28937
+ * derived form is only as honest as `getOptions`).
28938
+ */
28939
+ var NativeObjectGeometryEnum = _enum([
28940
+ "boxed",
28941
+ "while-streaming",
28942
+ "flag-only"
28943
+ ]);
28944
+ var NativeObjectDetectionOptionsSchema = object({
28945
+ /** Classes this firmware can detect — the same list the status reports. */
28946
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28947
+ /** What a detection from this camera carries. */
28948
+ geometry: NativeObjectGeometryEnum
28949
+ });
28950
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28585
28951
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28586
28952
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28587
28953
  lastFetchedAt: number() });
@@ -28591,13 +28957,23 @@ var nativeObjectDetectionCapability = {
28591
28957
  deviceNative: true,
28592
28958
  mode: "singleton",
28593
28959
  deviceTypes: [DeviceType.Camera],
28594
- methods: { setEnabled: method(object({
28595
- deviceId: number(),
28596
- enabled: boolean()
28597
- }), _void(), {
28598
- kind: "mutation",
28599
- auth: "admin"
28600
- }) },
28960
+ methods: {
28961
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28962
+ setSettings: method(object({
28963
+ deviceId: number(),
28964
+ settings: NativeObjectDetectionSettingsPatchSchema
28965
+ }), _void(), {
28966
+ kind: "mutation",
28967
+ auth: "admin"
28968
+ }),
28969
+ setEnabled: method(object({
28970
+ deviceId: number(),
28971
+ enabled: boolean()
28972
+ }), _void(), {
28973
+ kind: "mutation",
28974
+ auth: "admin"
28975
+ })
28976
+ },
28601
28977
  events: { onDetected: { data: object({
28602
28978
  deviceId: number(),
28603
28979
  detection: NativeDetectionSchema
@@ -33445,7 +33821,28 @@ var PerScopeBreakdownSchema = object({
33445
33821
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33446
33822
  totalObjects: number().int().nonnegative(),
33447
33823
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33448
- byClass: record(string(), number().int().nonnegative())
33824
+ byClass: record(string(), number().int().nonnegative()),
33825
+ /**
33826
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33827
+ * present but not going anywhere (a parked car, a bin, a statue).
33828
+ *
33829
+ * The operator's question about a scene has two halves and they answer
33830
+ * different things: "what is parked here" is stable for hours and must not
33831
+ * flap, while "who is walking through" is the thing an alert is about. One
33832
+ * number could only serve one of them, and `totalObjects` served the first
33833
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33834
+ *
33835
+ * `standing + transient === totalObjects`, always. The total keeps its old
33836
+ * meaning exactly, so no rule written against it changes behaviour.
33837
+ *
33838
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33839
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33840
+ * parked objects here" about a camera whose lot is full.
33841
+ */
33842
+ standingObjects: number().int().nonnegative().optional(),
33843
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33844
+ * same absence rule. */
33845
+ transientObjects: number().int().nonnegative().optional()
33449
33846
  });
33450
33847
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33451
33848
  zoneId: string(),
@@ -33568,6 +33965,23 @@ var HistoryPointSchema = object({
33568
33965
  * triple covers the three spatial scopes (per-zone, frame-wide,
33569
33966
  * outside-any-zone). Crossing them with `className?` gives the full
33570
33967
  * combinatorial coverage the operator UI requested.
33968
+ *
33969
+ * ## ⚠️ The three history methods are DEPRECATED
33970
+ *
33971
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33972
+ * so after a restart they report nothing about a night that did happen, and any
33973
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33974
+ * an empty scene. The presets in the occupancy chart existed to hide that
33975
+ * horizon rather than to answer a question.
33976
+ *
33977
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33978
+ * instead. Those rows are already written for every camera, ~60 bytes per
33979
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33980
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33981
+ * function the writer uses, so the two cannot drift.
33982
+ *
33983
+ * The ring stays until these three go, and it is the only thing left reading
33984
+ * it. Do not add a fourth caller.
33571
33985
  */
33572
33986
  var zoneAnalyticsCapability = {
33573
33987
  name: "zone-analytics",
@@ -34057,6 +34471,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34057
34471
  smoke: smokeCapability,
34058
34472
  streamCatalog: streamCatalogCapability,
34059
34473
  streamParams: streamParamsCapability,
34474
+ streamSignals: streamSignalsCapability,
34060
34475
  switch: switchCapability,
34061
34476
  tamper: tamperCapability,
34062
34477
  temperatureSensor: temperatureSensorCapability,
@@ -38032,12 +38447,24 @@ Object.freeze({
38032
38447
  addonId: null,
38033
38448
  access: "create"
38034
38449
  },
38450
+ "nativeObjectDetection.getOptions": {
38451
+ capName: "native-object-detection",
38452
+ capScope: "device",
38453
+ addonId: null,
38454
+ access: "view"
38455
+ },
38035
38456
  "nativeObjectDetection.setEnabled": {
38036
38457
  capName: "native-object-detection",
38037
38458
  capScope: "device",
38038
38459
  addonId: null,
38039
38460
  access: "create"
38040
38461
  },
38462
+ "nativeObjectDetection.setSettings": {
38463
+ capName: "native-object-detection",
38464
+ capScope: "device",
38465
+ addonId: null,
38466
+ access: "create"
38467
+ },
38041
38468
  "navigation.getFeatures": {
38042
38469
  capName: "navigation",
38043
38470
  capScope: "device",
@@ -38302,6 +38729,12 @@ Object.freeze({
38302
38729
  addonId: null,
38303
38730
  access: "view"
38304
38731
  },
38732
+ "notificationRules.getClipRetentionAsks": {
38733
+ capName: "notification-rules",
38734
+ capScope: "system",
38735
+ addonId: null,
38736
+ access: "view"
38737
+ },
38305
38738
  "notificationRules.getConditionCatalog": {
38306
38739
  capName: "notification-rules",
38307
38740
  capScope: "system",
@@ -38812,6 +39245,12 @@ Object.freeze({
38812
39245
  addonId: null,
38813
39246
  access: "create"
38814
39247
  },
39248
+ "pipelineAnalytics.readLongTermSeries": {
39249
+ capName: "pipeline-analytics",
39250
+ capScope: "device",
39251
+ addonId: null,
39252
+ access: "view"
39253
+ },
38815
39254
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38816
39255
  capName: "pipeline-analytics",
38817
39256
  capScope: "device",
@@ -39484,6 +39923,12 @@ Object.freeze({
39484
39923
  addonId: null,
39485
39924
  access: "create"
39486
39925
  },
39926
+ "pipelineRunner.requestOccupancyBurst": {
39927
+ capName: "pipeline-runner",
39928
+ capScope: "system",
39929
+ addonId: null,
39930
+ access: "create"
39931
+ },
39487
39932
  "pipelineRunner.runDetailSubtree": {
39488
39933
  capName: "pipeline-runner",
39489
39934
  capScope: "system",
@@ -40696,6 +41141,12 @@ Object.freeze({
40696
41141
  addonId: null,
40697
41142
  access: "create"
40698
41143
  },
41144
+ "streamBroker.reportStreamSignal": {
41145
+ capName: "stream-broker",
41146
+ capScope: "system",
41147
+ addonId: null,
41148
+ access: "create"
41149
+ },
40699
41150
  "streamBroker.restartProfile": {
40700
41151
  capName: "stream-broker",
40701
41152
  capScope: "system",
@@ -40780,6 +41231,12 @@ Object.freeze({
40780
41231
  addonId: null,
40781
41232
  access: "create"
40782
41233
  },
41234
+ "streamSignals.listSignals": {
41235
+ capName: "stream-signals",
41236
+ capScope: "device",
41237
+ addonId: null,
41238
+ access: "view"
41239
+ },
40783
41240
  "switch.setState": {
40784
41241
  capName: "switch",
40785
41242
  capScope: "device",
@@ -42252,11 +42709,21 @@ Object.freeze({
42252
42709
  form: "single",
42253
42710
  optional: false
42254
42711
  }],
42712
+ "nativeObjectDetection.getOptions": [{
42713
+ name: "deviceId",
42714
+ form: "single",
42715
+ optional: false
42716
+ }],
42255
42717
  "nativeObjectDetection.setEnabled": [{
42256
42718
  name: "deviceId",
42257
42719
  form: "single",
42258
42720
  optional: false
42259
42721
  }],
42722
+ "nativeObjectDetection.setSettings": [{
42723
+ name: "deviceId",
42724
+ form: "single",
42725
+ optional: false
42726
+ }],
42260
42727
  "navigation.getFeatures": [{
42261
42728
  name: "deviceId",
42262
42729
  form: "single",
@@ -42606,6 +43073,11 @@ Object.freeze({
42606
43073
  form: "single",
42607
43074
  optional: false
42608
43075
  }],
43076
+ "pipelineAnalytics.readLongTermSeries": [{
43077
+ name: "deviceId",
43078
+ form: "single",
43079
+ optional: false
43080
+ }],
42609
43081
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42610
43082
  name: "deviceId",
42611
43083
  form: "single",
@@ -42796,6 +43268,11 @@ Object.freeze({
42796
43268
  form: "single",
42797
43269
  optional: false
42798
43270
  }],
43271
+ "pipelineRunner.requestOccupancyBurst": [{
43272
+ name: "deviceId",
43273
+ form: "single",
43274
+ optional: false
43275
+ }],
42799
43276
  "pipelineRunner.runDetailSubtree": [{
42800
43277
  name: "deviceId",
42801
43278
  form: "single",
@@ -43152,6 +43629,11 @@ Object.freeze({
43152
43629
  form: "single",
43153
43630
  optional: false
43154
43631
  }],
43632
+ "streamBroker.reportStreamSignal": [{
43633
+ name: "deviceId",
43634
+ form: "single",
43635
+ optional: false
43636
+ }],
43155
43637
  "streamBroker.restartProfile": [{
43156
43638
  name: "deviceId",
43157
43639
  form: "single",