@camstack/addon-provider-homematic 1.2.102 → 1.2.104

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +501 -19
  2. package/dist/addon.mjs +501 -19
  3. package/package.json +2 -2
package/dist/addon.js CHANGED
@@ -8,7 +8,7 @@ let http = require("http");
8
8
  let crypto$1 = require("crypto");
9
9
  let fs_promises = require("fs/promises");
10
10
  let path = require("path");
11
- //#region ../types/dist/event-category-ZyX6jcse.mjs
11
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
12
12
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
13
13
  EventCategory["SystemBoot"] = "system.boot";
14
14
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -625,6 +625,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
625
625
  * pull-reconcile from the provider's `getStatus` on reconnect. */
626
626
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
627
627
  EventCategory["BackupCompleted"] = "backup.completed";
628
+ /**
629
+ * A whole backup RUN finished — every destination attempted, win or lose.
630
+ *
631
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
632
+ * a progress UI and the wrong one for a notification: an operator with three
633
+ * destinations would be told three times. And a run where two of three
634
+ * destinations succeeded is not a clean success — a single "backup
635
+ * completed" that hid the failed one would be a lie, so the count of each is
636
+ * carried here and the message says both.
637
+ *
638
+ * Emitted by the backup orchestrator only after the destination loop, so a
639
+ * run that dies during the BUILD phase produces no completion at all.
640
+ */
641
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
628
642
  EventCategory["BackupRestored"] = "backup.restored";
629
643
  EventCategory["NotificationDispatched"] = "notification.dispatched";
630
644
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5355,7 +5369,7 @@ var ZodIssueCode = {
5355
5369
  var ZodFirstPartyTypeKind;
5356
5370
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5357
5371
  //#endregion
5358
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5372
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5359
5373
  /**
5360
5374
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5361
5375
  * window to float samples (D455).
@@ -11548,6 +11562,87 @@ var brokerCapability = {
11548
11562
  }
11549
11563
  };
11550
11564
  DeviceType.Camera;
11565
+ /**
11566
+ * The signals a device can emit to WAKE its own stream.
11567
+ *
11568
+ * A camera whose stream is built on demand sleeps until something asks for it,
11569
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11570
+ * puller holds a session open for ever, and treating that as demand would keep
11571
+ * a battery camera awake for ever, which is the whole thing the battery is for
11572
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11573
+ * itself, with no stream running.
11574
+ *
11575
+ * ## The vocabulary is the PROVIDER'S, not ours
11576
+ *
11577
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11578
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11579
+ * Reolink offers motion and camera-native detection; another provider may offer
11580
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11581
+ * yet. A fixed enum here would mean every new signal is a framework release.
11582
+ *
11583
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11584
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11585
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11586
+ * binding — but both answer "what drives the detection pipeline", which is a
11587
+ * different question from "what may wake a sleeping stream". A camera can do
11588
+ * the first and not be trusted with the second, and the operator picks per
11589
+ * camera. Two questions, two authorities.
11590
+ *
11591
+ * ## Availability is not permission
11592
+ *
11593
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11594
+ * wakes the stream is the operator's per-camera choice, held by the broker
11595
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11596
+ * provider declaring a signal is not a provider enabling it.
11597
+ */
11598
+ /** One signal a device can emit. */
11599
+ var StreamSignalSchema = object({
11600
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11601
+ code: string().min(1),
11602
+ /** What an operator reads in the picker. The provider's own wording. */
11603
+ label: string().min(1),
11604
+ /**
11605
+ * Whether the provider recommends this signal ON when a camera is first set
11606
+ * up. A provider knows which of its signals are cheap and reliable; an
11607
+ * operator should not have to discover that by trial. Reolink recommends
11608
+ * both of its own.
11609
+ */
11610
+ recommended: boolean()
11611
+ });
11612
+ var StreamSignalsStatusSchema = object({
11613
+ signals: array(StreamSignalSchema),
11614
+ lastFetchedAt: number()
11615
+ });
11616
+ var streamSignalsCapability = {
11617
+ name: "stream-signals",
11618
+ scope: "device",
11619
+ deviceNative: true,
11620
+ mode: "singleton",
11621
+ deviceTypes: Object.values(DeviceType),
11622
+ runtimeState: StreamSignalsStatusSchema,
11623
+ /**
11624
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11625
+ *
11626
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11627
+ * not an operator choice: the provider re-declares it on every registration,
11628
+ * so losing it loses nothing and persisting it would freeze an answer the
11629
+ * camera is entitled to change. Measured the same day on the sibling case —
11630
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11631
+ * class the camera really detected stayed missing for the life of the row
11632
+ * because the fix could not reach it.
11633
+ *
11634
+ * See `RuntimeStateDurability`. Enforced by
11635
+ * `scripts/check-runtime-state-durability.ts`.
11636
+ */
11637
+ durability: "session",
11638
+ methods: {
11639
+ /**
11640
+ * What this device can emit. Empty is a valid and common answer — most
11641
+ * cameras have nothing to offer here, and an empty list is what makes the
11642
+ * broker's picker show nothing rather than a false choice.
11643
+ */
11644
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11645
+ };
11551
11646
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11552
11647
  var StreamFormatSchema = _enum([
11553
11648
  "webrtc",
@@ -11944,6 +12039,22 @@ var EgressTranscodeSchema = object({
11944
12039
  camStreamId: string().nullable()
11945
12040
  });
11946
12041
  method(object({
12042
+ deviceId: number().int().nonnegative(),
12043
+ /** The provider's signal code. */
12044
+ code: string().min(1),
12045
+ /** Ms epoch. Absent ⇒ now. */
12046
+ at: number().optional()
12047
+ }), object({
12048
+ /** Whether the broker acted on it, and if not, why. */
12049
+ accepted: boolean(),
12050
+ reason: _enum([
12051
+ "woke",
12052
+ "hold-extended",
12053
+ "not-enabled",
12054
+ "no-consumer",
12055
+ "unknown-code"
12056
+ ])
12057
+ }), { kind: "mutation" }), method(object({
11947
12058
  deviceId: number().int().nonnegative(),
11948
12059
  camStreamId: string().min(1),
11949
12060
  kind: CamStreamKindSchema,
@@ -12198,6 +12309,16 @@ var PickStreamRequirementsSchema = object({
12198
12309
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12199
12310
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12200
12311
  minHeight: number().int().positive().optional(),
12312
+ /**
12313
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12314
+ *
12315
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12316
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12317
+ * Without this the ceiling had to be re-implemented by every caller — and
12318
+ * one caller implementing it privately is how a second scoring authority
12319
+ * gets born.
12320
+ */
12321
+ maxHeight: number().int().positive().optional(),
12201
12322
  /** Minimum horizontal resolution. */
12202
12323
  minWidth: number().int().positive().optional(),
12203
12324
  /**
@@ -12214,7 +12335,22 @@ var PickStreamRequirementsSchema = object({
12214
12335
  * transcoded" guard: if the device is already serving the consumer's
12215
12336
  * codec end-to-end, there's nothing to optimise.
12216
12337
  */
12217
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12338
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12339
+ /**
12340
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12341
+ * understanding that it will be transcoded.
12342
+ *
12343
+ * Default `false` — today's behaviour, and the right one for a bypass
12344
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12345
+ * ask the larger question: "what is the best stream for me, transcoding if
12346
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12347
+ * does not, so a passthrough is never lost to a transcode; the answer says
12348
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12349
+ *
12350
+ * This is what lets one picker serve both the bypass and the full source
12351
+ * choice, instead of a consumer scoring privately when the bypass misses.
12352
+ */
12353
+ allowTranscode: boolean().optional()
12218
12354
  }).readonly();
12219
12355
  var PickStreamPreferencesSchema = object({
12220
12356
  /**
@@ -12228,12 +12364,32 @@ var PickStreamPreferencesSchema = object({
12228
12364
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12229
12365
  * memory-constrained consumers / Apple Home guest sessions).
12230
12366
  */
12231
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12367
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12368
+ /**
12369
+ * The height the consumer actually wants to DELIVER.
12370
+ *
12371
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12372
+ * above the target wins, and only if nothing reaches it does the tallest
12373
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12374
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12375
+ * express that: it says "as big as possible", which is a different wish.
12376
+ *
12377
+ * Ignored when absent, so every existing caller keeps its ordering.
12378
+ */
12379
+ targetHeight: number().int().positive().optional()
12232
12380
  }).readonly();
12233
12381
  var PickedCamStreamSchema = object({
12234
12382
  camStreamId: string(),
12235
12383
  codec: string().optional(),
12236
12384
  resolution: CamStreamResolutionSchema.optional(),
12385
+ /**
12386
+ * Whether serving this stream requires a decode + re-encode.
12387
+ *
12388
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12389
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12390
+ * not ask cannot be handed a cost it never agreed to pay.
12391
+ */
12392
+ transcodes: boolean(),
12237
12393
  /** One-line explanation of why this stream won — for logs / debug UI. */
12238
12394
  reason: string()
12239
12395
  });
@@ -16767,6 +16923,8 @@ var NcSystemEventKindSchema = _enum([
16767
16923
  "device-enabled",
16768
16924
  "device-battery-low",
16769
16925
  "device-battery-normal",
16926
+ "device-consumable-low",
16927
+ "device-consumable-normal",
16770
16928
  "stream-online",
16771
16929
  "stream-offline",
16772
16930
  "node-online",
@@ -16785,6 +16943,7 @@ var NcSystemEventKindSchema = _enum([
16785
16943
  "addon-updated",
16786
16944
  "server-updated",
16787
16945
  "export-completed",
16946
+ "backup-completed",
16788
16947
  "camera-online",
16789
16948
  "camera-offline",
16790
16949
  "camera-disabled",
@@ -18107,6 +18266,48 @@ var NcAlarmConfigSchema = object({
18107
18266
  settings: NcAlarmSettingsSchema,
18108
18267
  coverage: array(NcAlarmModeCoverageSchema)
18109
18268
  });
18269
+ /**
18270
+ * ONE rule's demand on ONE camera's clip ring.
18271
+ *
18272
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18273
+ * camera, so the answer stays a faithful description of the rules and the
18274
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18275
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18276
+ * a different thing from never having been told, and only the envelope
18277
+ * (`rulesLoaded`) can tell those apart.
18278
+ */
18279
+ var NcClipRetentionAskSchema = object({
18280
+ /**
18281
+ * The camera this ask is about. **Absent = every camera**, which is what a
18282
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18283
+ * asking everywhere.
18284
+ */
18285
+ deviceId: number().int().nonnegative().optional(),
18286
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18287
+ * needs nothing produces no ask at all. */
18288
+ seconds: number().min(0).max(60),
18289
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18290
+ * assigned, which is what the cut defaults to. */
18291
+ profile: CamProfileSchema.optional(),
18292
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18293
+ ruleId: string(),
18294
+ ruleName: string(),
18295
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18296
+ reason: _enum(["window", "occupancy"])
18297
+ });
18298
+ /**
18299
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18300
+ *
18301
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18302
+ * once. A centre that is up but has not read its rules yet answers with an
18303
+ * empty ask list that means nothing at all — applying it would drop every
18304
+ * camera's ring to zero for the first events after a restart, which is the
18305
+ * footage this mechanism exists to keep.
18306
+ */
18307
+ var NcClipRetentionPlanSchema = object({
18308
+ rulesLoaded: boolean(),
18309
+ asks: array(NcClipRetentionAskSchema).readonly()
18310
+ });
18110
18311
  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 }), {
18111
18312
  kind: "mutation",
18112
18313
  auth: "admin",
@@ -18127,7 +18328,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18127
18328
  }), object({ success: literal(true) }), {
18128
18329
  kind: "mutation",
18129
18330
  auth: "admin"
18130
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18331
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18131
18332
  deviceId: number().int(),
18132
18333
  muted: boolean()
18133
18334
  }), object({ success: literal(true) }), {
@@ -20701,6 +20902,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20701
20902
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20702
20903
  framesMatched: number().int()
20703
20904
  })).readonly() });
20905
+ /**
20906
+ * The long-term series a camera produces. A closed union so a typo cannot
20907
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20908
+ * is an alias of this, not a second list.
20909
+ */
20910
+ var AnalyticsLtsSeriesSchema = _enum([
20911
+ "motion",
20912
+ "audio-dbfs",
20913
+ "battery",
20914
+ "occupancy"
20915
+ ]);
20916
+ /**
20917
+ * One closed 5-minute bucket of a long-term series.
20918
+ *
20919
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20920
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20921
+ * that exists at all was measured; a bucket that is absent was not, which is a
20922
+ * different claim from zero and the reason this is a sparse series.
20923
+ */
20924
+ var LtsBucketSchema = object({
20925
+ scope: string(),
20926
+ bucketStart: number().int(),
20927
+ samples: number().int().nonnegative(),
20928
+ sum: number(),
20929
+ min: number(),
20930
+ max: number()
20931
+ });
20704
20932
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20705
20933
  deviceId: number(),
20706
20934
  trackId: string()
@@ -20747,6 +20975,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20747
20975
  kinds: array(string()).optional(),
20748
20976
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20749
20977
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20978
+ deviceId: number(),
20979
+ series: AnalyticsLtsSeriesSchema,
20980
+ /** Omit for EVERY scope of this series in the range. */
20981
+ scope: string().optional(),
20982
+ from: number(),
20983
+ to: number(),
20984
+ limit: number().int().positive().optional()
20985
+ }), array(LtsBucketSchema).readonly()), method(object({
20750
20986
  deviceId: number(),
20751
20987
  since: number(),
20752
20988
  until: number(),
@@ -21365,6 +21601,14 @@ var MotionSourceEnum = _enum([
21365
21601
  */
21366
21602
  var MotionSourcesSchema = array(MotionSourceEnum);
21367
21603
  /**
21604
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21605
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21606
+ * than a second spelling of the same two ideas — the value an operator picks
21607
+ * here is the value that comes back on the track, the overlay and the debug
21608
+ * row.
21609
+ */
21610
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21611
+ /**
21368
21612
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21369
21613
  * so cap-side consumers (the orchestrator forward, the runner addon's
21370
21614
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21515,6 +21759,35 @@ var RunnerCameraConfigSchema = object({
21515
21759
  * events; the orchestrator forwards to `reportMotion`.
21516
21760
  */
21517
21761
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21762
+ /**
21763
+ * WHICH root detector runs for this camera. The detection counterpart of
21764
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21765
+ * of sources the system understands, vendor-agnostic, owned here.
21766
+ *
21767
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21768
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21769
+ * here. Its boxes reach post-analysis on the same
21770
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21771
+ * track gets the same tracker, the same overlay and the same detail
21772
+ * subtree (face / plate / embedding).
21773
+ *
21774
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21775
+ * run, and that is where a camera with a usable onboard detector buys back
21776
+ * its share of the accelerator. It saves the root inference, not the decode
21777
+ * — the detail subtree still needs pixels to cut crops from.
21778
+ *
21779
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21780
+ * step at all (there is nothing to track), and the cap that knows this says
21781
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21782
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21783
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21784
+ * worth exactly what it already is — a wake signal with a class.
21785
+ *
21786
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21787
+ * vendor never turns a detector on for the operator, and neither does a
21788
+ * default.
21789
+ */
21790
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21518
21791
  pipelineEnabled: boolean().default(true),
21519
21792
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21520
21793
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21696,7 +21969,47 @@ var RunnerLocalMetricsSchema = object({
21696
21969
  queueDepth: number(),
21697
21970
  frameLazy: FrameLazyMetricsSchema.optional()
21698
21971
  });
21972
+ /**
21973
+ * Pipeline Runner capability — runtime detection workhorse.
21974
+ *
21975
+ * One instance per node. Receives camera assignments from
21976
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21977
+ * decoded frames, drains motion + detection queues, calls the local
21978
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21979
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21980
+ * the bus.
21981
+ *
21982
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21983
+ * runner has zero knowledge of other agents, no global state, and never
21984
+ * makes assignment decisions itself.
21985
+ */
21986
+ /**
21987
+ * Why a runner declined to look at a camera out of band. Named rather than a
21988
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21989
+ * already mid-session and one already bursting are four different facts, and a
21990
+ * caller told only "no" cannot tell a protection from a bug.
21991
+ */
21992
+ var OccupancyBurstRefusalSchema = _enum([
21993
+ "not-attached",
21994
+ "battery-asleep",
21995
+ "not-watching",
21996
+ "already-bursting"
21997
+ ]);
21699
21998
  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({
21999
+ deviceId: number(),
22000
+ /** How many frames to collect. The caller sizes this against what its
22001
+ * own confirmation needs; the runner clamps it to the field's range. */
22002
+ frames: number().int().positive().optional(),
22003
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22004
+ * defend — the periodic one at least has a timer to point at. */
22005
+ reason: string()
22006
+ }), object({
22007
+ started: boolean(),
22008
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22009
+ }), {
22010
+ auth: "admin",
22011
+ kind: "mutation"
22012
+ }), method(object({
21700
22013
  handle: FrameHandleSchema,
21701
22014
  bbox: NativeCropBboxSchema,
21702
22015
  maxWidth: number().int().positive().optional(),
@@ -24066,10 +24379,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24066
24379
  }), boolean()), method(object({
24067
24380
  deviceId: number().int().nonnegative(),
24068
24381
  sessionId: string()
24069
- }), object({ pendingRenegotiation: object({
24070
- target: WebrtcStreamTargetSchema,
24071
- epoch: number()
24072
- }).nullable() }));
24382
+ }), object({
24383
+ pendingRenegotiation: object({
24384
+ target: WebrtcStreamTargetSchema,
24385
+ epoch: number()
24386
+ }).nullable(),
24387
+ /**
24388
+ * Whether the session still EXISTS.
24389
+ *
24390
+ * A consumer that holds a resource for the life of a session needs to
24391
+ * be able to ask, because a session does not always end the way it
24392
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24393
+ * sent `SessionDisconnected`, so the Alexa exporter's
24394
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24395
+ * H.264 transcode kept running for NOBODY for more than twenty
24396
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24397
+ * minutes earlier — the broker knew; the holder had no way to ask.
24398
+ *
24399
+ * `false` for a session id the provider has never heard of, which is
24400
+ * the same answer as "it ended": either way nothing is holding it up.
24401
+ */
24402
+ alive: boolean()
24403
+ }));
24073
24404
  object({
24074
24405
  /** All accessory children of the parent. */
24075
24406
  childDeviceIds: array(number()).readonly(),
@@ -28508,11 +28839,46 @@ var NativeObjectDetectionStatusSchema = object({
28508
28839
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28509
28840
  /**
28510
28841
  * Whether forwarding of onboard AI detections is enabled for this device.
28511
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28512
- * churn the tracker, so forwarding stays off until the operator enables it.
28842
+ *
28843
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28844
+ * camera runs — that is the operator's choice, and it is made where every
28845
+ * other detection choice is made. `geometry` on
28846
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28847
+ * choice would buy this particular camera.
28513
28848
  */
28514
28849
  enabled: boolean()
28515
28850
  });
28851
+ /**
28852
+ * WHEN a camera's onboard detections carry geometry.
28853
+ *
28854
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28855
+ * a detection is a trackable subject whenever the camera sees one.
28856
+ * - `while-streaming` — only while some stream of this camera is already open.
28857
+ * The boxes ride the video's own side-channel rather than a feed of their
28858
+ * own, so they cost nothing and they exist only when something is pulling.
28859
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28860
+ * radio drain, but a camera that is awake is awake precisely because
28861
+ * something is in front of it, and its stream is already being pulled.
28862
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28863
+ * pipeline needs geometry to make a subject, so such a push reaches the
28864
+ * tracker as motion and no further.
28865
+ *
28866
+ * Reported and not inferred, because the operator's question in front of the
28867
+ * picker is "what do I get", and these are three different answers (D14: the
28868
+ * derived form is only as honest as `getOptions`).
28869
+ */
28870
+ var NativeObjectGeometryEnum = _enum([
28871
+ "boxed",
28872
+ "while-streaming",
28873
+ "flag-only"
28874
+ ]);
28875
+ var NativeObjectDetectionOptionsSchema = object({
28876
+ /** Classes this firmware can detect — the same list the status reports. */
28877
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28878
+ /** What a detection from this camera carries. */
28879
+ geometry: NativeObjectGeometryEnum
28880
+ });
28881
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28516
28882
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28517
28883
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28518
28884
  lastFetchedAt: number() });
@@ -28522,13 +28888,23 @@ var nativeObjectDetectionCapability = {
28522
28888
  deviceNative: true,
28523
28889
  mode: "singleton",
28524
28890
  deviceTypes: [DeviceType.Camera],
28525
- methods: { setEnabled: method(object({
28526
- deviceId: number(),
28527
- enabled: boolean()
28528
- }), _void(), {
28529
- kind: "mutation",
28530
- auth: "admin"
28531
- }) },
28891
+ methods: {
28892
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28893
+ setSettings: method(object({
28894
+ deviceId: number(),
28895
+ settings: NativeObjectDetectionSettingsPatchSchema
28896
+ }), _void(), {
28897
+ kind: "mutation",
28898
+ auth: "admin"
28899
+ }),
28900
+ setEnabled: method(object({
28901
+ deviceId: number(),
28902
+ enabled: boolean()
28903
+ }), _void(), {
28904
+ kind: "mutation",
28905
+ auth: "admin"
28906
+ })
28907
+ },
28532
28908
  events: { onDetected: { data: object({
28533
28909
  deviceId: number(),
28534
28910
  detection: NativeDetectionSchema
@@ -33376,7 +33752,28 @@ var PerScopeBreakdownSchema = object({
33376
33752
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33377
33753
  totalObjects: number().int().nonnegative(),
33378
33754
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33379
- byClass: record(string(), number().int().nonnegative())
33755
+ byClass: record(string(), number().int().nonnegative()),
33756
+ /**
33757
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33758
+ * present but not going anywhere (a parked car, a bin, a statue).
33759
+ *
33760
+ * The operator's question about a scene has two halves and they answer
33761
+ * different things: "what is parked here" is stable for hours and must not
33762
+ * flap, while "who is walking through" is the thing an alert is about. One
33763
+ * number could only serve one of them, and `totalObjects` served the first
33764
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33765
+ *
33766
+ * `standing + transient === totalObjects`, always. The total keeps its old
33767
+ * meaning exactly, so no rule written against it changes behaviour.
33768
+ *
33769
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33770
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33771
+ * parked objects here" about a camera whose lot is full.
33772
+ */
33773
+ standingObjects: number().int().nonnegative().optional(),
33774
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33775
+ * same absence rule. */
33776
+ transientObjects: number().int().nonnegative().optional()
33380
33777
  });
33381
33778
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33382
33779
  zoneId: string(),
@@ -33499,6 +33896,23 @@ var HistoryPointSchema = object({
33499
33896
  * triple covers the three spatial scopes (per-zone, frame-wide,
33500
33897
  * outside-any-zone). Crossing them with `className?` gives the full
33501
33898
  * combinatorial coverage the operator UI requested.
33899
+ *
33900
+ * ## ⚠️ The three history methods are DEPRECATED
33901
+ *
33902
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33903
+ * so after a restart they report nothing about a night that did happen, and any
33904
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33905
+ * an empty scene. The presets in the occupancy chart existed to hide that
33906
+ * horizon rather than to answer a question.
33907
+ *
33908
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33909
+ * instead. Those rows are already written for every camera, ~60 bytes per
33910
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33911
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33912
+ * function the writer uses, so the two cannot drift.
33913
+ *
33914
+ * The ring stays until these three go, and it is the only thing left reading
33915
+ * it. Do not add a fourth caller.
33502
33916
  */
33503
33917
  var zoneAnalyticsCapability = {
33504
33918
  name: "zone-analytics",
@@ -33988,6 +34402,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33988
34402
  smoke: smokeCapability,
33989
34403
  streamCatalog: streamCatalogCapability,
33990
34404
  streamParams: streamParamsCapability,
34405
+ streamSignals: streamSignalsCapability,
33991
34406
  switch: switchCapability,
33992
34407
  tamper: tamperCapability,
33993
34408
  temperatureSensor: temperatureSensorCapability,
@@ -37897,12 +38312,24 @@ Object.freeze({
37897
38312
  addonId: null,
37898
38313
  access: "create"
37899
38314
  },
38315
+ "nativeObjectDetection.getOptions": {
38316
+ capName: "native-object-detection",
38317
+ capScope: "device",
38318
+ addonId: null,
38319
+ access: "view"
38320
+ },
37900
38321
  "nativeObjectDetection.setEnabled": {
37901
38322
  capName: "native-object-detection",
37902
38323
  capScope: "device",
37903
38324
  addonId: null,
37904
38325
  access: "create"
37905
38326
  },
38327
+ "nativeObjectDetection.setSettings": {
38328
+ capName: "native-object-detection",
38329
+ capScope: "device",
38330
+ addonId: null,
38331
+ access: "create"
38332
+ },
37906
38333
  "navigation.getFeatures": {
37907
38334
  capName: "navigation",
37908
38335
  capScope: "device",
@@ -38167,6 +38594,12 @@ Object.freeze({
38167
38594
  addonId: null,
38168
38595
  access: "view"
38169
38596
  },
38597
+ "notificationRules.getClipRetentionAsks": {
38598
+ capName: "notification-rules",
38599
+ capScope: "system",
38600
+ addonId: null,
38601
+ access: "view"
38602
+ },
38170
38603
  "notificationRules.getConditionCatalog": {
38171
38604
  capName: "notification-rules",
38172
38605
  capScope: "system",
@@ -38677,6 +39110,12 @@ Object.freeze({
38677
39110
  addonId: null,
38678
39111
  access: "create"
38679
39112
  },
39113
+ "pipelineAnalytics.readLongTermSeries": {
39114
+ capName: "pipeline-analytics",
39115
+ capScope: "device",
39116
+ addonId: null,
39117
+ access: "view"
39118
+ },
38680
39119
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38681
39120
  capName: "pipeline-analytics",
38682
39121
  capScope: "device",
@@ -39349,6 +39788,12 @@ Object.freeze({
39349
39788
  addonId: null,
39350
39789
  access: "create"
39351
39790
  },
39791
+ "pipelineRunner.requestOccupancyBurst": {
39792
+ capName: "pipeline-runner",
39793
+ capScope: "system",
39794
+ addonId: null,
39795
+ access: "create"
39796
+ },
39352
39797
  "pipelineRunner.runDetailSubtree": {
39353
39798
  capName: "pipeline-runner",
39354
39799
  capScope: "system",
@@ -40561,6 +41006,12 @@ Object.freeze({
40561
41006
  addonId: null,
40562
41007
  access: "create"
40563
41008
  },
41009
+ "streamBroker.reportStreamSignal": {
41010
+ capName: "stream-broker",
41011
+ capScope: "system",
41012
+ addonId: null,
41013
+ access: "create"
41014
+ },
40564
41015
  "streamBroker.restartProfile": {
40565
41016
  capName: "stream-broker",
40566
41017
  capScope: "system",
@@ -40645,6 +41096,12 @@ Object.freeze({
40645
41096
  addonId: null,
40646
41097
  access: "create"
40647
41098
  },
41099
+ "streamSignals.listSignals": {
41100
+ capName: "stream-signals",
41101
+ capScope: "device",
41102
+ addonId: null,
41103
+ access: "view"
41104
+ },
40648
41105
  "switch.setState": {
40649
41106
  capName: "switch",
40650
41107
  capScope: "device",
@@ -42117,11 +42574,21 @@ Object.freeze({
42117
42574
  form: "single",
42118
42575
  optional: false
42119
42576
  }],
42577
+ "nativeObjectDetection.getOptions": [{
42578
+ name: "deviceId",
42579
+ form: "single",
42580
+ optional: false
42581
+ }],
42120
42582
  "nativeObjectDetection.setEnabled": [{
42121
42583
  name: "deviceId",
42122
42584
  form: "single",
42123
42585
  optional: false
42124
42586
  }],
42587
+ "nativeObjectDetection.setSettings": [{
42588
+ name: "deviceId",
42589
+ form: "single",
42590
+ optional: false
42591
+ }],
42125
42592
  "navigation.getFeatures": [{
42126
42593
  name: "deviceId",
42127
42594
  form: "single",
@@ -42471,6 +42938,11 @@ Object.freeze({
42471
42938
  form: "single",
42472
42939
  optional: false
42473
42940
  }],
42941
+ "pipelineAnalytics.readLongTermSeries": [{
42942
+ name: "deviceId",
42943
+ form: "single",
42944
+ optional: false
42945
+ }],
42474
42946
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42475
42947
  name: "deviceId",
42476
42948
  form: "single",
@@ -42661,6 +43133,11 @@ Object.freeze({
42661
43133
  form: "single",
42662
43134
  optional: false
42663
43135
  }],
43136
+ "pipelineRunner.requestOccupancyBurst": [{
43137
+ name: "deviceId",
43138
+ form: "single",
43139
+ optional: false
43140
+ }],
42664
43141
  "pipelineRunner.runDetailSubtree": [{
42665
43142
  name: "deviceId",
42666
43143
  form: "single",
@@ -43017,6 +43494,11 @@ Object.freeze({
43017
43494
  form: "single",
43018
43495
  optional: false
43019
43496
  }],
43497
+ "streamBroker.reportStreamSignal": [{
43498
+ name: "deviceId",
43499
+ form: "single",
43500
+ optional: false
43501
+ }],
43020
43502
  "streamBroker.restartProfile": [{
43021
43503
  name: "deviceId",
43022
43504
  form: "single",