@camstack/addon-provider-dreo 0.2.101 → 0.2.103

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