@camstack/addon-provider-unifi 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(),
@@ -28449,11 +28780,46 @@ var NativeObjectDetectionStatusSchema = object({
28449
28780
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28450
28781
  /**
28451
28782
  * Whether forwarding of onboard AI detections is enabled for this device.
28452
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28453
- * churn the tracker, so forwarding stays off until the operator enables it.
28783
+ *
28784
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28785
+ * camera runs — that is the operator's choice, and it is made where every
28786
+ * other detection choice is made. `geometry` on
28787
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28788
+ * choice would buy this particular camera.
28454
28789
  */
28455
28790
  enabled: boolean()
28456
28791
  });
28792
+ /**
28793
+ * WHEN a camera's onboard detections carry geometry.
28794
+ *
28795
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28796
+ * a detection is a trackable subject whenever the camera sees one.
28797
+ * - `while-streaming` — only while some stream of this camera is already open.
28798
+ * The boxes ride the video's own side-channel rather than a feed of their
28799
+ * own, so they cost nothing and they exist only when something is pulling.
28800
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28801
+ * radio drain, but a camera that is awake is awake precisely because
28802
+ * something is in front of it, and its stream is already being pulled.
28803
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28804
+ * pipeline needs geometry to make a subject, so such a push reaches the
28805
+ * tracker as motion and no further.
28806
+ *
28807
+ * Reported and not inferred, because the operator's question in front of the
28808
+ * picker is "what do I get", and these are three different answers (D14: the
28809
+ * derived form is only as honest as `getOptions`).
28810
+ */
28811
+ var NativeObjectGeometryEnum = _enum([
28812
+ "boxed",
28813
+ "while-streaming",
28814
+ "flag-only"
28815
+ ]);
28816
+ var NativeObjectDetectionOptionsSchema = object({
28817
+ /** Classes this firmware can detect — the same list the status reports. */
28818
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28819
+ /** What a detection from this camera carries. */
28820
+ geometry: NativeObjectGeometryEnum
28821
+ });
28822
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28457
28823
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28458
28824
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28459
28825
  lastFetchedAt: number() });
@@ -28463,13 +28829,23 @@ var nativeObjectDetectionCapability = {
28463
28829
  deviceNative: true,
28464
28830
  mode: "singleton",
28465
28831
  deviceTypes: [DeviceType.Camera],
28466
- methods: { setEnabled: method(object({
28467
- deviceId: number(),
28468
- enabled: boolean()
28469
- }), _void(), {
28470
- kind: "mutation",
28471
- auth: "admin"
28472
- }) },
28832
+ methods: {
28833
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28834
+ setSettings: method(object({
28835
+ deviceId: number(),
28836
+ settings: NativeObjectDetectionSettingsPatchSchema
28837
+ }), _void(), {
28838
+ kind: "mutation",
28839
+ auth: "admin"
28840
+ }),
28841
+ setEnabled: method(object({
28842
+ deviceId: number(),
28843
+ enabled: boolean()
28844
+ }), _void(), {
28845
+ kind: "mutation",
28846
+ auth: "admin"
28847
+ })
28848
+ },
28473
28849
  events: { onDetected: { data: object({
28474
28850
  deviceId: number(),
28475
28851
  detection: NativeDetectionSchema
@@ -33317,7 +33693,28 @@ var PerScopeBreakdownSchema = object({
33317
33693
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33318
33694
  totalObjects: number().int().nonnegative(),
33319
33695
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33320
- byClass: record(string(), number().int().nonnegative())
33696
+ byClass: record(string(), number().int().nonnegative()),
33697
+ /**
33698
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33699
+ * present but not going anywhere (a parked car, a bin, a statue).
33700
+ *
33701
+ * The operator's question about a scene has two halves and they answer
33702
+ * different things: "what is parked here" is stable for hours and must not
33703
+ * flap, while "who is walking through" is the thing an alert is about. One
33704
+ * number could only serve one of them, and `totalObjects` served the first
33705
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33706
+ *
33707
+ * `standing + transient === totalObjects`, always. The total keeps its old
33708
+ * meaning exactly, so no rule written against it changes behaviour.
33709
+ *
33710
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33711
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33712
+ * parked objects here" about a camera whose lot is full.
33713
+ */
33714
+ standingObjects: number().int().nonnegative().optional(),
33715
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33716
+ * same absence rule. */
33717
+ transientObjects: number().int().nonnegative().optional()
33321
33718
  });
33322
33719
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33323
33720
  zoneId: string(),
@@ -33440,6 +33837,23 @@ var HistoryPointSchema = object({
33440
33837
  * triple covers the three spatial scopes (per-zone, frame-wide,
33441
33838
  * outside-any-zone). Crossing them with `className?` gives the full
33442
33839
  * combinatorial coverage the operator UI requested.
33840
+ *
33841
+ * ## ⚠️ The three history methods are DEPRECATED
33842
+ *
33843
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33844
+ * so after a restart they report nothing about a night that did happen, and any
33845
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33846
+ * an empty scene. The presets in the occupancy chart existed to hide that
33847
+ * horizon rather than to answer a question.
33848
+ *
33849
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33850
+ * instead. Those rows are already written for every camera, ~60 bytes per
33851
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33852
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33853
+ * function the writer uses, so the two cannot drift.
33854
+ *
33855
+ * The ring stays until these three go, and it is the only thing left reading
33856
+ * it. Do not add a fourth caller.
33443
33857
  */
33444
33858
  var zoneAnalyticsCapability = {
33445
33859
  name: "zone-analytics",
@@ -33929,6 +34343,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33929
34343
  smoke: smokeCapability,
33930
34344
  streamCatalog: streamCatalogCapability,
33931
34345
  streamParams: streamParamsCapability,
34346
+ streamSignals: streamSignalsCapability,
33932
34347
  switch: switchCapability,
33933
34348
  tamper: tamperCapability,
33934
34349
  temperatureSensor: temperatureSensorCapability,
@@ -37838,12 +38253,24 @@ Object.freeze({
37838
38253
  addonId: null,
37839
38254
  access: "create"
37840
38255
  },
38256
+ "nativeObjectDetection.getOptions": {
38257
+ capName: "native-object-detection",
38258
+ capScope: "device",
38259
+ addonId: null,
38260
+ access: "view"
38261
+ },
37841
38262
  "nativeObjectDetection.setEnabled": {
37842
38263
  capName: "native-object-detection",
37843
38264
  capScope: "device",
37844
38265
  addonId: null,
37845
38266
  access: "create"
37846
38267
  },
38268
+ "nativeObjectDetection.setSettings": {
38269
+ capName: "native-object-detection",
38270
+ capScope: "device",
38271
+ addonId: null,
38272
+ access: "create"
38273
+ },
37847
38274
  "navigation.getFeatures": {
37848
38275
  capName: "navigation",
37849
38276
  capScope: "device",
@@ -38108,6 +38535,12 @@ Object.freeze({
38108
38535
  addonId: null,
38109
38536
  access: "view"
38110
38537
  },
38538
+ "notificationRules.getClipRetentionAsks": {
38539
+ capName: "notification-rules",
38540
+ capScope: "system",
38541
+ addonId: null,
38542
+ access: "view"
38543
+ },
38111
38544
  "notificationRules.getConditionCatalog": {
38112
38545
  capName: "notification-rules",
38113
38546
  capScope: "system",
@@ -38618,6 +39051,12 @@ Object.freeze({
38618
39051
  addonId: null,
38619
39052
  access: "create"
38620
39053
  },
39054
+ "pipelineAnalytics.readLongTermSeries": {
39055
+ capName: "pipeline-analytics",
39056
+ capScope: "device",
39057
+ addonId: null,
39058
+ access: "view"
39059
+ },
38621
39060
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38622
39061
  capName: "pipeline-analytics",
38623
39062
  capScope: "device",
@@ -39290,6 +39729,12 @@ Object.freeze({
39290
39729
  addonId: null,
39291
39730
  access: "create"
39292
39731
  },
39732
+ "pipelineRunner.requestOccupancyBurst": {
39733
+ capName: "pipeline-runner",
39734
+ capScope: "system",
39735
+ addonId: null,
39736
+ access: "create"
39737
+ },
39293
39738
  "pipelineRunner.runDetailSubtree": {
39294
39739
  capName: "pipeline-runner",
39295
39740
  capScope: "system",
@@ -40502,6 +40947,12 @@ Object.freeze({
40502
40947
  addonId: null,
40503
40948
  access: "create"
40504
40949
  },
40950
+ "streamBroker.reportStreamSignal": {
40951
+ capName: "stream-broker",
40952
+ capScope: "system",
40953
+ addonId: null,
40954
+ access: "create"
40955
+ },
40505
40956
  "streamBroker.restartProfile": {
40506
40957
  capName: "stream-broker",
40507
40958
  capScope: "system",
@@ -40586,6 +41037,12 @@ Object.freeze({
40586
41037
  addonId: null,
40587
41038
  access: "create"
40588
41039
  },
41040
+ "streamSignals.listSignals": {
41041
+ capName: "stream-signals",
41042
+ capScope: "device",
41043
+ addonId: null,
41044
+ access: "view"
41045
+ },
40589
41046
  "switch.setState": {
40590
41047
  capName: "switch",
40591
41048
  capScope: "device",
@@ -42058,11 +42515,21 @@ Object.freeze({
42058
42515
  form: "single",
42059
42516
  optional: false
42060
42517
  }],
42518
+ "nativeObjectDetection.getOptions": [{
42519
+ name: "deviceId",
42520
+ form: "single",
42521
+ optional: false
42522
+ }],
42061
42523
  "nativeObjectDetection.setEnabled": [{
42062
42524
  name: "deviceId",
42063
42525
  form: "single",
42064
42526
  optional: false
42065
42527
  }],
42528
+ "nativeObjectDetection.setSettings": [{
42529
+ name: "deviceId",
42530
+ form: "single",
42531
+ optional: false
42532
+ }],
42066
42533
  "navigation.getFeatures": [{
42067
42534
  name: "deviceId",
42068
42535
  form: "single",
@@ -42412,6 +42879,11 @@ Object.freeze({
42412
42879
  form: "single",
42413
42880
  optional: false
42414
42881
  }],
42882
+ "pipelineAnalytics.readLongTermSeries": [{
42883
+ name: "deviceId",
42884
+ form: "single",
42885
+ optional: false
42886
+ }],
42415
42887
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42416
42888
  name: "deviceId",
42417
42889
  form: "single",
@@ -42602,6 +43074,11 @@ Object.freeze({
42602
43074
  form: "single",
42603
43075
  optional: false
42604
43076
  }],
43077
+ "pipelineRunner.requestOccupancyBurst": [{
43078
+ name: "deviceId",
43079
+ form: "single",
43080
+ optional: false
43081
+ }],
42605
43082
  "pipelineRunner.runDetailSubtree": [{
42606
43083
  name: "deviceId",
42607
43084
  form: "single",
@@ -42958,6 +43435,11 @@ Object.freeze({
42958
43435
  form: "single",
42959
43436
  optional: false
42960
43437
  }],
43438
+ "streamBroker.reportStreamSignal": [{
43439
+ name: "deviceId",
43440
+ form: "single",
43441
+ optional: false
43442
+ }],
42961
43443
  "streamBroker.restartProfile": [{
42962
43444
  name: "deviceId",
42963
43445
  form: "single",