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