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