@camstack/addon-provider-velux 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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-ZyX6jcse.mjs
2
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -616,6 +616,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
616
616
  * pull-reconcile from the provider's `getStatus` on reconnect. */
617
617
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
618
618
  EventCategory["BackupCompleted"] = "backup.completed";
619
+ /**
620
+ * A whole backup RUN finished — every destination attempted, win or lose.
621
+ *
622
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
623
+ * a progress UI and the wrong one for a notification: an operator with three
624
+ * destinations would be told three times. And a run where two of three
625
+ * destinations succeeded is not a clean success — a single "backup
626
+ * completed" that hid the failed one would be a lie, so the count of each is
627
+ * carried here and the message says both.
628
+ *
629
+ * Emitted by the backup orchestrator only after the destination loop, so a
630
+ * run that dies during the BUILD phase produces no completion at all.
631
+ */
632
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
619
633
  EventCategory["BackupRestored"] = "backup.restored";
620
634
  EventCategory["NotificationDispatched"] = "notification.dispatched";
621
635
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5346,7 +5360,7 @@ var ZodIssueCode = {
5346
5360
  var ZodFirstPartyTypeKind;
5347
5361
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5348
5362
  //#endregion
5349
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5363
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5350
5364
  /**
5351
5365
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5352
5366
  * window to float samples (D455).
@@ -11490,6 +11504,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11490
11504
  auth: "admin"
11491
11505
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11492
11506
  DeviceType.Camera;
11507
+ /**
11508
+ * The signals a device can emit to WAKE its own stream.
11509
+ *
11510
+ * A camera whose stream is built on demand sleeps until something asks for it,
11511
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11512
+ * puller holds a session open for ever, and treating that as demand would keep
11513
+ * a battery camera awake for ever, which is the whole thing the battery is for
11514
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11515
+ * itself, with no stream running.
11516
+ *
11517
+ * ## The vocabulary is the PROVIDER'S, not ours
11518
+ *
11519
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11520
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11521
+ * Reolink offers motion and camera-native detection; another provider may offer
11522
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11523
+ * yet. A fixed enum here would mean every new signal is a framework release.
11524
+ *
11525
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11526
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11527
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11528
+ * binding — but both answer "what drives the detection pipeline", which is a
11529
+ * different question from "what may wake a sleeping stream". A camera can do
11530
+ * the first and not be trusted with the second, and the operator picks per
11531
+ * camera. Two questions, two authorities.
11532
+ *
11533
+ * ## Availability is not permission
11534
+ *
11535
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11536
+ * wakes the stream is the operator's per-camera choice, held by the broker
11537
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11538
+ * provider declaring a signal is not a provider enabling it.
11539
+ */
11540
+ /** One signal a device can emit. */
11541
+ var StreamSignalSchema = object({
11542
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11543
+ code: string().min(1),
11544
+ /** What an operator reads in the picker. The provider's own wording. */
11545
+ label: string().min(1),
11546
+ /**
11547
+ * Whether the provider recommends this signal ON when a camera is first set
11548
+ * up. A provider knows which of its signals are cheap and reliable; an
11549
+ * operator should not have to discover that by trial. Reolink recommends
11550
+ * both of its own.
11551
+ */
11552
+ recommended: boolean()
11553
+ });
11554
+ var StreamSignalsStatusSchema = object({
11555
+ signals: array(StreamSignalSchema),
11556
+ lastFetchedAt: number()
11557
+ });
11558
+ var streamSignalsCapability = {
11559
+ name: "stream-signals",
11560
+ scope: "device",
11561
+ deviceNative: true,
11562
+ mode: "singleton",
11563
+ deviceTypes: Object.values(DeviceType),
11564
+ runtimeState: StreamSignalsStatusSchema,
11565
+ /**
11566
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11567
+ *
11568
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11569
+ * not an operator choice: the provider re-declares it on every registration,
11570
+ * so losing it loses nothing and persisting it would freeze an answer the
11571
+ * camera is entitled to change. Measured the same day on the sibling case —
11572
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11573
+ * class the camera really detected stayed missing for the life of the row
11574
+ * because the fix could not reach it.
11575
+ *
11576
+ * See `RuntimeStateDurability`. Enforced by
11577
+ * `scripts/check-runtime-state-durability.ts`.
11578
+ */
11579
+ durability: "session",
11580
+ methods: {
11581
+ /**
11582
+ * What this device can emit. Empty is a valid and common answer — most
11583
+ * cameras have nothing to offer here, and an empty list is what makes the
11584
+ * broker's picker show nothing rather than a false choice.
11585
+ */
11586
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11587
+ };
11493
11588
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11494
11589
  var StreamFormatSchema = _enum([
11495
11590
  "webrtc",
@@ -11886,6 +11981,22 @@ var EgressTranscodeSchema = object({
11886
11981
  camStreamId: string().nullable()
11887
11982
  });
11888
11983
  method(object({
11984
+ deviceId: number().int().nonnegative(),
11985
+ /** The provider's signal code. */
11986
+ code: string().min(1),
11987
+ /** Ms epoch. Absent ⇒ now. */
11988
+ at: number().optional()
11989
+ }), object({
11990
+ /** Whether the broker acted on it, and if not, why. */
11991
+ accepted: boolean(),
11992
+ reason: _enum([
11993
+ "woke",
11994
+ "hold-extended",
11995
+ "not-enabled",
11996
+ "no-consumer",
11997
+ "unknown-code"
11998
+ ])
11999
+ }), { kind: "mutation" }), method(object({
11889
12000
  deviceId: number().int().nonnegative(),
11890
12001
  camStreamId: string().min(1),
11891
12002
  kind: CamStreamKindSchema,
@@ -12140,6 +12251,16 @@ var PickStreamRequirementsSchema = object({
12140
12251
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12141
12252
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12142
12253
  minHeight: number().int().positive().optional(),
12254
+ /**
12255
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12256
+ *
12257
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12258
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12259
+ * Without this the ceiling had to be re-implemented by every caller — and
12260
+ * one caller implementing it privately is how a second scoring authority
12261
+ * gets born.
12262
+ */
12263
+ maxHeight: number().int().positive().optional(),
12143
12264
  /** Minimum horizontal resolution. */
12144
12265
  minWidth: number().int().positive().optional(),
12145
12266
  /**
@@ -12156,7 +12277,22 @@ var PickStreamRequirementsSchema = object({
12156
12277
  * transcoded" guard: if the device is already serving the consumer's
12157
12278
  * codec end-to-end, there's nothing to optimise.
12158
12279
  */
12159
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12280
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12281
+ /**
12282
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12283
+ * understanding that it will be transcoded.
12284
+ *
12285
+ * Default `false` — today's behaviour, and the right one for a bypass
12286
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12287
+ * ask the larger question: "what is the best stream for me, transcoding if
12288
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12289
+ * does not, so a passthrough is never lost to a transcode; the answer says
12290
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12291
+ *
12292
+ * This is what lets one picker serve both the bypass and the full source
12293
+ * choice, instead of a consumer scoring privately when the bypass misses.
12294
+ */
12295
+ allowTranscode: boolean().optional()
12160
12296
  }).readonly();
12161
12297
  var PickStreamPreferencesSchema = object({
12162
12298
  /**
@@ -12170,12 +12306,32 @@ var PickStreamPreferencesSchema = object({
12170
12306
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12171
12307
  * memory-constrained consumers / Apple Home guest sessions).
12172
12308
  */
12173
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12309
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12310
+ /**
12311
+ * The height the consumer actually wants to DELIVER.
12312
+ *
12313
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12314
+ * above the target wins, and only if nothing reaches it does the tallest
12315
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12316
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12317
+ * express that: it says "as big as possible", which is a different wish.
12318
+ *
12319
+ * Ignored when absent, so every existing caller keeps its ordering.
12320
+ */
12321
+ targetHeight: number().int().positive().optional()
12174
12322
  }).readonly();
12175
12323
  var PickedCamStreamSchema = object({
12176
12324
  camStreamId: string(),
12177
12325
  codec: string().optional(),
12178
12326
  resolution: CamStreamResolutionSchema.optional(),
12327
+ /**
12328
+ * Whether serving this stream requires a decode + re-encode.
12329
+ *
12330
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12331
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12332
+ * not ask cannot be handed a cost it never agreed to pay.
12333
+ */
12334
+ transcodes: boolean(),
12179
12335
  /** One-line explanation of why this stream won — for logs / debug UI. */
12180
12336
  reason: string()
12181
12337
  });
@@ -16692,6 +16848,8 @@ var NcSystemEventKindSchema = _enum([
16692
16848
  "device-enabled",
16693
16849
  "device-battery-low",
16694
16850
  "device-battery-normal",
16851
+ "device-consumable-low",
16852
+ "device-consumable-normal",
16695
16853
  "stream-online",
16696
16854
  "stream-offline",
16697
16855
  "node-online",
@@ -16710,6 +16868,7 @@ var NcSystemEventKindSchema = _enum([
16710
16868
  "addon-updated",
16711
16869
  "server-updated",
16712
16870
  "export-completed",
16871
+ "backup-completed",
16713
16872
  "camera-online",
16714
16873
  "camera-offline",
16715
16874
  "camera-disabled",
@@ -18032,6 +18191,48 @@ var NcAlarmConfigSchema = object({
18032
18191
  settings: NcAlarmSettingsSchema,
18033
18192
  coverage: array(NcAlarmModeCoverageSchema)
18034
18193
  });
18194
+ /**
18195
+ * ONE rule's demand on ONE camera's clip ring.
18196
+ *
18197
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18198
+ * camera, so the answer stays a faithful description of the rules and the
18199
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18200
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18201
+ * a different thing from never having been told, and only the envelope
18202
+ * (`rulesLoaded`) can tell those apart.
18203
+ */
18204
+ var NcClipRetentionAskSchema = object({
18205
+ /**
18206
+ * The camera this ask is about. **Absent = every camera**, which is what a
18207
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18208
+ * asking everywhere.
18209
+ */
18210
+ deviceId: number().int().nonnegative().optional(),
18211
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18212
+ * needs nothing produces no ask at all. */
18213
+ seconds: number().min(0).max(60),
18214
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18215
+ * assigned, which is what the cut defaults to. */
18216
+ profile: CamProfileSchema.optional(),
18217
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18218
+ ruleId: string(),
18219
+ ruleName: string(),
18220
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18221
+ reason: _enum(["window", "occupancy"])
18222
+ });
18223
+ /**
18224
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18225
+ *
18226
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18227
+ * once. A centre that is up but has not read its rules yet answers with an
18228
+ * empty ask list that means nothing at all — applying it would drop every
18229
+ * camera's ring to zero for the first events after a restart, which is the
18230
+ * footage this mechanism exists to keep.
18231
+ */
18232
+ var NcClipRetentionPlanSchema = object({
18233
+ rulesLoaded: boolean(),
18234
+ asks: array(NcClipRetentionAskSchema).readonly()
18235
+ });
18035
18236
  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 }), {
18036
18237
  kind: "mutation",
18037
18238
  auth: "admin",
@@ -18052,7 +18253,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18052
18253
  }), object({ success: literal(true) }), {
18053
18254
  kind: "mutation",
18054
18255
  auth: "admin"
18055
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18256
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18056
18257
  deviceId: number().int(),
18057
18258
  muted: boolean()
18058
18259
  }), object({ success: literal(true) }), {
@@ -20626,6 +20827,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20626
20827
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20627
20828
  framesMatched: number().int()
20628
20829
  })).readonly() });
20830
+ /**
20831
+ * The long-term series a camera produces. A closed union so a typo cannot
20832
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20833
+ * is an alias of this, not a second list.
20834
+ */
20835
+ var AnalyticsLtsSeriesSchema = _enum([
20836
+ "motion",
20837
+ "audio-dbfs",
20838
+ "battery",
20839
+ "occupancy"
20840
+ ]);
20841
+ /**
20842
+ * One closed 5-minute bucket of a long-term series.
20843
+ *
20844
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20845
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20846
+ * that exists at all was measured; a bucket that is absent was not, which is a
20847
+ * different claim from zero and the reason this is a sparse series.
20848
+ */
20849
+ var LtsBucketSchema = object({
20850
+ scope: string(),
20851
+ bucketStart: number().int(),
20852
+ samples: number().int().nonnegative(),
20853
+ sum: number(),
20854
+ min: number(),
20855
+ max: number()
20856
+ });
20629
20857
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20630
20858
  deviceId: number(),
20631
20859
  trackId: string()
@@ -20672,6 +20900,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20672
20900
  kinds: array(string()).optional(),
20673
20901
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20674
20902
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20903
+ deviceId: number(),
20904
+ series: AnalyticsLtsSeriesSchema,
20905
+ /** Omit for EVERY scope of this series in the range. */
20906
+ scope: string().optional(),
20907
+ from: number(),
20908
+ to: number(),
20909
+ limit: number().int().positive().optional()
20910
+ }), array(LtsBucketSchema).readonly()), method(object({
20675
20911
  deviceId: number(),
20676
20912
  since: number(),
20677
20913
  until: number(),
@@ -21290,6 +21526,14 @@ var MotionSourceEnum = _enum([
21290
21526
  */
21291
21527
  var MotionSourcesSchema = array(MotionSourceEnum);
21292
21528
  /**
21529
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21530
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21531
+ * than a second spelling of the same two ideas — the value an operator picks
21532
+ * here is the value that comes back on the track, the overlay and the debug
21533
+ * row.
21534
+ */
21535
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21536
+ /**
21293
21537
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21294
21538
  * so cap-side consumers (the orchestrator forward, the runner addon's
21295
21539
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21440,6 +21684,35 @@ var RunnerCameraConfigSchema = object({
21440
21684
  * events; the orchestrator forwards to `reportMotion`.
21441
21685
  */
21442
21686
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21687
+ /**
21688
+ * WHICH root detector runs for this camera. The detection counterpart of
21689
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21690
+ * of sources the system understands, vendor-agnostic, owned here.
21691
+ *
21692
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21693
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21694
+ * here. Its boxes reach post-analysis on the same
21695
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21696
+ * track gets the same tracker, the same overlay and the same detail
21697
+ * subtree (face / plate / embedding).
21698
+ *
21699
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21700
+ * run, and that is where a camera with a usable onboard detector buys back
21701
+ * its share of the accelerator. It saves the root inference, not the decode
21702
+ * — the detail subtree still needs pixels to cut crops from.
21703
+ *
21704
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21705
+ * step at all (there is nothing to track), and the cap that knows this says
21706
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21707
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21708
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21709
+ * worth exactly what it already is — a wake signal with a class.
21710
+ *
21711
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21712
+ * vendor never turns a detector on for the operator, and neither does a
21713
+ * default.
21714
+ */
21715
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21443
21716
  pipelineEnabled: boolean().default(true),
21444
21717
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21445
21718
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21621,7 +21894,47 @@ var RunnerLocalMetricsSchema = object({
21621
21894
  queueDepth: number(),
21622
21895
  frameLazy: FrameLazyMetricsSchema.optional()
21623
21896
  });
21897
+ /**
21898
+ * Pipeline Runner capability — runtime detection workhorse.
21899
+ *
21900
+ * One instance per node. Receives camera assignments from
21901
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21902
+ * decoded frames, drains motion + detection queues, calls the local
21903
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21904
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21905
+ * the bus.
21906
+ *
21907
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21908
+ * runner has zero knowledge of other agents, no global state, and never
21909
+ * makes assignment decisions itself.
21910
+ */
21911
+ /**
21912
+ * Why a runner declined to look at a camera out of band. Named rather than a
21913
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21914
+ * already mid-session and one already bursting are four different facts, and a
21915
+ * caller told only "no" cannot tell a protection from a bug.
21916
+ */
21917
+ var OccupancyBurstRefusalSchema = _enum([
21918
+ "not-attached",
21919
+ "battery-asleep",
21920
+ "not-watching",
21921
+ "already-bursting"
21922
+ ]);
21624
21923
  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({
21924
+ deviceId: number(),
21925
+ /** How many frames to collect. The caller sizes this against what its
21926
+ * own confirmation needs; the runner clamps it to the field's range. */
21927
+ frames: number().int().positive().optional(),
21928
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21929
+ * defend — the periodic one at least has a timer to point at. */
21930
+ reason: string()
21931
+ }), object({
21932
+ started: boolean(),
21933
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21934
+ }), {
21935
+ auth: "admin",
21936
+ kind: "mutation"
21937
+ }), method(object({
21625
21938
  handle: FrameHandleSchema,
21626
21939
  bbox: NativeCropBboxSchema,
21627
21940
  maxWidth: number().int().positive().optional(),
@@ -23991,10 +24304,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
23991
24304
  }), boolean()), method(object({
23992
24305
  deviceId: number().int().nonnegative(),
23993
24306
  sessionId: string()
23994
- }), object({ pendingRenegotiation: object({
23995
- target: WebrtcStreamTargetSchema,
23996
- epoch: number()
23997
- }).nullable() }));
24307
+ }), object({
24308
+ pendingRenegotiation: object({
24309
+ target: WebrtcStreamTargetSchema,
24310
+ epoch: number()
24311
+ }).nullable(),
24312
+ /**
24313
+ * Whether the session still EXISTS.
24314
+ *
24315
+ * A consumer that holds a resource for the life of a session needs to
24316
+ * be able to ask, because a session does not always end the way it
24317
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24318
+ * sent `SessionDisconnected`, so the Alexa exporter's
24319
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24320
+ * H.264 transcode kept running for NOBODY for more than twenty
24321
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24322
+ * minutes earlier — the broker knew; the holder had no way to ask.
24323
+ *
24324
+ * `false` for a session id the provider has never heard of, which is
24325
+ * the same answer as "it ended": either way nothing is holding it up.
24326
+ */
24327
+ alive: boolean()
24328
+ }));
23998
24329
  object({
23999
24330
  /** All accessory children of the parent. */
24000
24331
  childDeviceIds: array(number()).readonly(),
@@ -28433,11 +28764,46 @@ var NativeObjectDetectionStatusSchema = object({
28433
28764
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28434
28765
  /**
28435
28766
  * Whether forwarding of onboard AI detections is enabled for this device.
28436
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28437
- * churn the tracker, so forwarding stays off until the operator enables it.
28767
+ *
28768
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28769
+ * camera runs — that is the operator's choice, and it is made where every
28770
+ * other detection choice is made. `geometry` on
28771
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28772
+ * choice would buy this particular camera.
28438
28773
  */
28439
28774
  enabled: boolean()
28440
28775
  });
28776
+ /**
28777
+ * WHEN a camera's onboard detections carry geometry.
28778
+ *
28779
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28780
+ * a detection is a trackable subject whenever the camera sees one.
28781
+ * - `while-streaming` — only while some stream of this camera is already open.
28782
+ * The boxes ride the video's own side-channel rather than a feed of their
28783
+ * own, so they cost nothing and they exist only when something is pulling.
28784
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28785
+ * radio drain, but a camera that is awake is awake precisely because
28786
+ * something is in front of it, and its stream is already being pulled.
28787
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28788
+ * pipeline needs geometry to make a subject, so such a push reaches the
28789
+ * tracker as motion and no further.
28790
+ *
28791
+ * Reported and not inferred, because the operator's question in front of the
28792
+ * picker is "what do I get", and these are three different answers (D14: the
28793
+ * derived form is only as honest as `getOptions`).
28794
+ */
28795
+ var NativeObjectGeometryEnum = _enum([
28796
+ "boxed",
28797
+ "while-streaming",
28798
+ "flag-only"
28799
+ ]);
28800
+ var NativeObjectDetectionOptionsSchema = object({
28801
+ /** Classes this firmware can detect — the same list the status reports. */
28802
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28803
+ /** What a detection from this camera carries. */
28804
+ geometry: NativeObjectGeometryEnum
28805
+ });
28806
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28441
28807
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28442
28808
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28443
28809
  lastFetchedAt: number() });
@@ -28447,13 +28813,23 @@ var nativeObjectDetectionCapability = {
28447
28813
  deviceNative: true,
28448
28814
  mode: "singleton",
28449
28815
  deviceTypes: [DeviceType.Camera],
28450
- methods: { setEnabled: method(object({
28451
- deviceId: number(),
28452
- enabled: boolean()
28453
- }), _void(), {
28454
- kind: "mutation",
28455
- auth: "admin"
28456
- }) },
28816
+ methods: {
28817
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28818
+ setSettings: method(object({
28819
+ deviceId: number(),
28820
+ settings: NativeObjectDetectionSettingsPatchSchema
28821
+ }), _void(), {
28822
+ kind: "mutation",
28823
+ auth: "admin"
28824
+ }),
28825
+ setEnabled: method(object({
28826
+ deviceId: number(),
28827
+ enabled: boolean()
28828
+ }), _void(), {
28829
+ kind: "mutation",
28830
+ auth: "admin"
28831
+ })
28832
+ },
28457
28833
  events: { onDetected: { data: object({
28458
28834
  deviceId: number(),
28459
28835
  detection: NativeDetectionSchema
@@ -33301,7 +33677,28 @@ var PerScopeBreakdownSchema = object({
33301
33677
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33302
33678
  totalObjects: number().int().nonnegative(),
33303
33679
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33304
- byClass: record(string(), number().int().nonnegative())
33680
+ byClass: record(string(), number().int().nonnegative()),
33681
+ /**
33682
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33683
+ * present but not going anywhere (a parked car, a bin, a statue).
33684
+ *
33685
+ * The operator's question about a scene has two halves and they answer
33686
+ * different things: "what is parked here" is stable for hours and must not
33687
+ * flap, while "who is walking through" is the thing an alert is about. One
33688
+ * number could only serve one of them, and `totalObjects` served the first
33689
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33690
+ *
33691
+ * `standing + transient === totalObjects`, always. The total keeps its old
33692
+ * meaning exactly, so no rule written against it changes behaviour.
33693
+ *
33694
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33695
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33696
+ * parked objects here" about a camera whose lot is full.
33697
+ */
33698
+ standingObjects: number().int().nonnegative().optional(),
33699
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33700
+ * same absence rule. */
33701
+ transientObjects: number().int().nonnegative().optional()
33305
33702
  });
33306
33703
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33307
33704
  zoneId: string(),
@@ -33424,6 +33821,23 @@ var HistoryPointSchema = object({
33424
33821
  * triple covers the three spatial scopes (per-zone, frame-wide,
33425
33822
  * outside-any-zone). Crossing them with `className?` gives the full
33426
33823
  * combinatorial coverage the operator UI requested.
33824
+ *
33825
+ * ## ⚠️ The three history methods are DEPRECATED
33826
+ *
33827
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33828
+ * so after a restart they report nothing about a night that did happen, and any
33829
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33830
+ * an empty scene. The presets in the occupancy chart existed to hide that
33831
+ * horizon rather than to answer a question.
33832
+ *
33833
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33834
+ * instead. Those rows are already written for every camera, ~60 bytes per
33835
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33836
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33837
+ * function the writer uses, so the two cannot drift.
33838
+ *
33839
+ * The ring stays until these three go, and it is the only thing left reading
33840
+ * it. Do not add a fourth caller.
33427
33841
  */
33428
33842
  var zoneAnalyticsCapability = {
33429
33843
  name: "zone-analytics",
@@ -33913,6 +34327,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33913
34327
  smoke: smokeCapability,
33914
34328
  streamCatalog: streamCatalogCapability,
33915
34329
  streamParams: streamParamsCapability,
34330
+ streamSignals: streamSignalsCapability,
33916
34331
  switch: switchCapability,
33917
34332
  tamper: tamperCapability,
33918
34333
  temperatureSensor: temperatureSensorCapability,
@@ -37822,12 +38237,24 @@ Object.freeze({
37822
38237
  addonId: null,
37823
38238
  access: "create"
37824
38239
  },
38240
+ "nativeObjectDetection.getOptions": {
38241
+ capName: "native-object-detection",
38242
+ capScope: "device",
38243
+ addonId: null,
38244
+ access: "view"
38245
+ },
37825
38246
  "nativeObjectDetection.setEnabled": {
37826
38247
  capName: "native-object-detection",
37827
38248
  capScope: "device",
37828
38249
  addonId: null,
37829
38250
  access: "create"
37830
38251
  },
38252
+ "nativeObjectDetection.setSettings": {
38253
+ capName: "native-object-detection",
38254
+ capScope: "device",
38255
+ addonId: null,
38256
+ access: "create"
38257
+ },
37831
38258
  "navigation.getFeatures": {
37832
38259
  capName: "navigation",
37833
38260
  capScope: "device",
@@ -38092,6 +38519,12 @@ Object.freeze({
38092
38519
  addonId: null,
38093
38520
  access: "view"
38094
38521
  },
38522
+ "notificationRules.getClipRetentionAsks": {
38523
+ capName: "notification-rules",
38524
+ capScope: "system",
38525
+ addonId: null,
38526
+ access: "view"
38527
+ },
38095
38528
  "notificationRules.getConditionCatalog": {
38096
38529
  capName: "notification-rules",
38097
38530
  capScope: "system",
@@ -38602,6 +39035,12 @@ Object.freeze({
38602
39035
  addonId: null,
38603
39036
  access: "create"
38604
39037
  },
39038
+ "pipelineAnalytics.readLongTermSeries": {
39039
+ capName: "pipeline-analytics",
39040
+ capScope: "device",
39041
+ addonId: null,
39042
+ access: "view"
39043
+ },
38605
39044
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38606
39045
  capName: "pipeline-analytics",
38607
39046
  capScope: "device",
@@ -39274,6 +39713,12 @@ Object.freeze({
39274
39713
  addonId: null,
39275
39714
  access: "create"
39276
39715
  },
39716
+ "pipelineRunner.requestOccupancyBurst": {
39717
+ capName: "pipeline-runner",
39718
+ capScope: "system",
39719
+ addonId: null,
39720
+ access: "create"
39721
+ },
39277
39722
  "pipelineRunner.runDetailSubtree": {
39278
39723
  capName: "pipeline-runner",
39279
39724
  capScope: "system",
@@ -40486,6 +40931,12 @@ Object.freeze({
40486
40931
  addonId: null,
40487
40932
  access: "create"
40488
40933
  },
40934
+ "streamBroker.reportStreamSignal": {
40935
+ capName: "stream-broker",
40936
+ capScope: "system",
40937
+ addonId: null,
40938
+ access: "create"
40939
+ },
40489
40940
  "streamBroker.restartProfile": {
40490
40941
  capName: "stream-broker",
40491
40942
  capScope: "system",
@@ -40570,6 +41021,12 @@ Object.freeze({
40570
41021
  addonId: null,
40571
41022
  access: "create"
40572
41023
  },
41024
+ "streamSignals.listSignals": {
41025
+ capName: "stream-signals",
41026
+ capScope: "device",
41027
+ addonId: null,
41028
+ access: "view"
41029
+ },
40573
41030
  "switch.setState": {
40574
41031
  capName: "switch",
40575
41032
  capScope: "device",
@@ -42042,11 +42499,21 @@ Object.freeze({
42042
42499
  form: "single",
42043
42500
  optional: false
42044
42501
  }],
42502
+ "nativeObjectDetection.getOptions": [{
42503
+ name: "deviceId",
42504
+ form: "single",
42505
+ optional: false
42506
+ }],
42045
42507
  "nativeObjectDetection.setEnabled": [{
42046
42508
  name: "deviceId",
42047
42509
  form: "single",
42048
42510
  optional: false
42049
42511
  }],
42512
+ "nativeObjectDetection.setSettings": [{
42513
+ name: "deviceId",
42514
+ form: "single",
42515
+ optional: false
42516
+ }],
42050
42517
  "navigation.getFeatures": [{
42051
42518
  name: "deviceId",
42052
42519
  form: "single",
@@ -42396,6 +42863,11 @@ Object.freeze({
42396
42863
  form: "single",
42397
42864
  optional: false
42398
42865
  }],
42866
+ "pipelineAnalytics.readLongTermSeries": [{
42867
+ name: "deviceId",
42868
+ form: "single",
42869
+ optional: false
42870
+ }],
42399
42871
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42400
42872
  name: "deviceId",
42401
42873
  form: "single",
@@ -42586,6 +43058,11 @@ Object.freeze({
42586
43058
  form: "single",
42587
43059
  optional: false
42588
43060
  }],
43061
+ "pipelineRunner.requestOccupancyBurst": [{
43062
+ name: "deviceId",
43063
+ form: "single",
43064
+ optional: false
43065
+ }],
42589
43066
  "pipelineRunner.runDetailSubtree": [{
42590
43067
  name: "deviceId",
42591
43068
  form: "single",
@@ -42942,6 +43419,11 @@ Object.freeze({
42942
43419
  form: "single",
42943
43420
  optional: false
42944
43421
  }],
43422
+ "streamBroker.reportStreamSignal": [{
43423
+ name: "deviceId",
43424
+ form: "single",
43425
+ optional: false
43426
+ }],
42945
43427
  "streamBroker.restartProfile": [{
42946
43428
  name: "deviceId",
42947
43429
  form: "single",