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