@camstack/addon-provider-wyze 0.2.105 → 0.2.107

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
@@ -31,7 +31,7 @@ let net = require("net");
31
31
  net = __toESM(net, 1);
32
32
  let node_child_process = require("node:child_process");
33
33
  let node_tls = require("node:tls");
34
- //#region ../types/dist/event-category-ZyX6jcse.mjs
34
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
35
35
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
36
36
  EventCategory["SystemBoot"] = "system.boot";
37
37
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -648,6 +648,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
648
648
  * pull-reconcile from the provider's `getStatus` on reconnect. */
649
649
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
650
650
  EventCategory["BackupCompleted"] = "backup.completed";
651
+ /**
652
+ * A whole backup RUN finished — every destination attempted, win or lose.
653
+ *
654
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
655
+ * a progress UI and the wrong one for a notification: an operator with three
656
+ * destinations would be told three times. And a run where two of three
657
+ * destinations succeeded is not a clean success — a single "backup
658
+ * completed" that hid the failed one would be a lie, so the count of each is
659
+ * carried here and the message says both.
660
+ *
661
+ * Emitted by the backup orchestrator only after the destination loop, so a
662
+ * run that dies during the BUILD phase produces no completion at all.
663
+ */
664
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
651
665
  EventCategory["BackupRestored"] = "backup.restored";
652
666
  EventCategory["NotificationDispatched"] = "notification.dispatched";
653
667
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5378,7 +5392,7 @@ var ZodIssueCode = {
5378
5392
  var ZodFirstPartyTypeKind;
5379
5393
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5380
5394
  //#endregion
5381
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5395
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5382
5396
  /**
5383
5397
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5384
5398
  * window to float samples (D455).
@@ -11522,6 +11536,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11522
11536
  auth: "admin"
11523
11537
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11524
11538
  DeviceType.Camera;
11539
+ /**
11540
+ * The signals a device can emit to WAKE its own stream.
11541
+ *
11542
+ * A camera whose stream is built on demand sleeps until something asks for it,
11543
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11544
+ * puller holds a session open for ever, and treating that as demand would keep
11545
+ * a battery camera awake for ever, which is the whole thing the battery is for
11546
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11547
+ * itself, with no stream running.
11548
+ *
11549
+ * ## The vocabulary is the PROVIDER'S, not ours
11550
+ *
11551
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11552
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11553
+ * Reolink offers motion and camera-native detection; another provider may offer
11554
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11555
+ * yet. A fixed enum here would mean every new signal is a framework release.
11556
+ *
11557
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11558
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11559
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11560
+ * binding — but both answer "what drives the detection pipeline", which is a
11561
+ * different question from "what may wake a sleeping stream". A camera can do
11562
+ * the first and not be trusted with the second, and the operator picks per
11563
+ * camera. Two questions, two authorities.
11564
+ *
11565
+ * ## Availability is not permission
11566
+ *
11567
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11568
+ * wakes the stream is the operator's per-camera choice, held by the broker
11569
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11570
+ * provider declaring a signal is not a provider enabling it.
11571
+ */
11572
+ /** One signal a device can emit. */
11573
+ var StreamSignalSchema = object({
11574
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11575
+ code: string().min(1),
11576
+ /** What an operator reads in the picker. The provider's own wording. */
11577
+ label: string().min(1),
11578
+ /**
11579
+ * Whether the provider recommends this signal ON when a camera is first set
11580
+ * up. A provider knows which of its signals are cheap and reliable; an
11581
+ * operator should not have to discover that by trial. Reolink recommends
11582
+ * both of its own.
11583
+ */
11584
+ recommended: boolean()
11585
+ });
11586
+ var StreamSignalsStatusSchema = object({
11587
+ signals: array(StreamSignalSchema),
11588
+ lastFetchedAt: number()
11589
+ });
11590
+ var streamSignalsCapability = {
11591
+ name: "stream-signals",
11592
+ scope: "device",
11593
+ deviceNative: true,
11594
+ mode: "singleton",
11595
+ deviceTypes: Object.values(DeviceType),
11596
+ runtimeState: StreamSignalsStatusSchema,
11597
+ /**
11598
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11599
+ *
11600
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11601
+ * not an operator choice: the provider re-declares it on every registration,
11602
+ * so losing it loses nothing and persisting it would freeze an answer the
11603
+ * camera is entitled to change. Measured the same day on the sibling case —
11604
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11605
+ * class the camera really detected stayed missing for the life of the row
11606
+ * because the fix could not reach it.
11607
+ *
11608
+ * See `RuntimeStateDurability`. Enforced by
11609
+ * `scripts/check-runtime-state-durability.ts`.
11610
+ */
11611
+ durability: "session",
11612
+ methods: {
11613
+ /**
11614
+ * What this device can emit. Empty is a valid and common answer — most
11615
+ * cameras have nothing to offer here, and an empty list is what makes the
11616
+ * broker's picker show nothing rather than a false choice.
11617
+ */
11618
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11619
+ };
11525
11620
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11526
11621
  var StreamFormatSchema = _enum([
11527
11622
  "webrtc",
@@ -11918,6 +12013,22 @@ var EgressTranscodeSchema = object({
11918
12013
  camStreamId: string().nullable()
11919
12014
  });
11920
12015
  method(object({
12016
+ deviceId: number().int().nonnegative(),
12017
+ /** The provider's signal code. */
12018
+ code: string().min(1),
12019
+ /** Ms epoch. Absent ⇒ now. */
12020
+ at: number().optional()
12021
+ }), object({
12022
+ /** Whether the broker acted on it, and if not, why. */
12023
+ accepted: boolean(),
12024
+ reason: _enum([
12025
+ "woke",
12026
+ "hold-extended",
12027
+ "not-enabled",
12028
+ "no-consumer",
12029
+ "unknown-code"
12030
+ ])
12031
+ }), { kind: "mutation" }), method(object({
11921
12032
  deviceId: number().int().nonnegative(),
11922
12033
  camStreamId: string().min(1),
11923
12034
  kind: CamStreamKindSchema,
@@ -12172,6 +12283,16 @@ var PickStreamRequirementsSchema = object({
12172
12283
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12173
12284
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12174
12285
  minHeight: number().int().positive().optional(),
12286
+ /**
12287
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12288
+ *
12289
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12290
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12291
+ * Without this the ceiling had to be re-implemented by every caller — and
12292
+ * one caller implementing it privately is how a second scoring authority
12293
+ * gets born.
12294
+ */
12295
+ maxHeight: number().int().positive().optional(),
12175
12296
  /** Minimum horizontal resolution. */
12176
12297
  minWidth: number().int().positive().optional(),
12177
12298
  /**
@@ -12188,7 +12309,22 @@ var PickStreamRequirementsSchema = object({
12188
12309
  * transcoded" guard: if the device is already serving the consumer's
12189
12310
  * codec end-to-end, there's nothing to optimise.
12190
12311
  */
12191
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12312
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12313
+ /**
12314
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12315
+ * understanding that it will be transcoded.
12316
+ *
12317
+ * Default `false` — today's behaviour, and the right one for a bypass
12318
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12319
+ * ask the larger question: "what is the best stream for me, transcoding if
12320
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12321
+ * does not, so a passthrough is never lost to a transcode; the answer says
12322
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12323
+ *
12324
+ * This is what lets one picker serve both the bypass and the full source
12325
+ * choice, instead of a consumer scoring privately when the bypass misses.
12326
+ */
12327
+ allowTranscode: boolean().optional()
12192
12328
  }).readonly();
12193
12329
  var PickStreamPreferencesSchema = object({
12194
12330
  /**
@@ -12202,12 +12338,32 @@ var PickStreamPreferencesSchema = object({
12202
12338
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12203
12339
  * memory-constrained consumers / Apple Home guest sessions).
12204
12340
  */
12205
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12341
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12342
+ /**
12343
+ * The height the consumer actually wants to DELIVER.
12344
+ *
12345
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12346
+ * above the target wins, and only if nothing reaches it does the tallest
12347
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12348
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12349
+ * express that: it says "as big as possible", which is a different wish.
12350
+ *
12351
+ * Ignored when absent, so every existing caller keeps its ordering.
12352
+ */
12353
+ targetHeight: number().int().positive().optional()
12206
12354
  }).readonly();
12207
12355
  var PickedCamStreamSchema = object({
12208
12356
  camStreamId: string(),
12209
12357
  codec: string().optional(),
12210
12358
  resolution: CamStreamResolutionSchema.optional(),
12359
+ /**
12360
+ * Whether serving this stream requires a decode + re-encode.
12361
+ *
12362
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12363
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12364
+ * not ask cannot be handed a cost it never agreed to pay.
12365
+ */
12366
+ transcodes: boolean(),
12211
12367
  /** One-line explanation of why this stream won — for logs / debug UI. */
12212
12368
  reason: string()
12213
12369
  });
@@ -16741,6 +16897,8 @@ var NcSystemEventKindSchema = _enum([
16741
16897
  "device-enabled",
16742
16898
  "device-battery-low",
16743
16899
  "device-battery-normal",
16900
+ "device-consumable-low",
16901
+ "device-consumable-normal",
16744
16902
  "stream-online",
16745
16903
  "stream-offline",
16746
16904
  "node-online",
@@ -16759,6 +16917,7 @@ var NcSystemEventKindSchema = _enum([
16759
16917
  "addon-updated",
16760
16918
  "server-updated",
16761
16919
  "export-completed",
16920
+ "backup-completed",
16762
16921
  "camera-online",
16763
16922
  "camera-offline",
16764
16923
  "camera-disabled",
@@ -18081,6 +18240,48 @@ var NcAlarmConfigSchema = object({
18081
18240
  settings: NcAlarmSettingsSchema,
18082
18241
  coverage: array(NcAlarmModeCoverageSchema)
18083
18242
  });
18243
+ /**
18244
+ * ONE rule's demand on ONE camera's clip ring.
18245
+ *
18246
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18247
+ * camera, so the answer stays a faithful description of the rules and the
18248
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18249
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18250
+ * a different thing from never having been told, and only the envelope
18251
+ * (`rulesLoaded`) can tell those apart.
18252
+ */
18253
+ var NcClipRetentionAskSchema = object({
18254
+ /**
18255
+ * The camera this ask is about. **Absent = every camera**, which is what a
18256
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18257
+ * asking everywhere.
18258
+ */
18259
+ deviceId: number().int().nonnegative().optional(),
18260
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18261
+ * needs nothing produces no ask at all. */
18262
+ seconds: number().min(0).max(60),
18263
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18264
+ * assigned, which is what the cut defaults to. */
18265
+ profile: CamProfileSchema.optional(),
18266
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18267
+ ruleId: string(),
18268
+ ruleName: string(),
18269
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18270
+ reason: _enum(["window", "occupancy"])
18271
+ });
18272
+ /**
18273
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18274
+ *
18275
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18276
+ * once. A centre that is up but has not read its rules yet answers with an
18277
+ * empty ask list that means nothing at all — applying it would drop every
18278
+ * camera's ring to zero for the first events after a restart, which is the
18279
+ * footage this mechanism exists to keep.
18280
+ */
18281
+ var NcClipRetentionPlanSchema = object({
18282
+ rulesLoaded: boolean(),
18283
+ asks: array(NcClipRetentionAskSchema).readonly()
18284
+ });
18084
18285
  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 }), {
18085
18286
  kind: "mutation",
18086
18287
  auth: "admin",
@@ -18101,7 +18302,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18101
18302
  }), object({ success: literal(true) }), {
18102
18303
  kind: "mutation",
18103
18304
  auth: "admin"
18104
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18305
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18105
18306
  deviceId: number().int(),
18106
18307
  muted: boolean()
18107
18308
  }), object({ success: literal(true) }), {
@@ -20675,6 +20876,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20675
20876
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20676
20877
  framesMatched: number().int()
20677
20878
  })).readonly() });
20879
+ /**
20880
+ * The long-term series a camera produces. A closed union so a typo cannot
20881
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20882
+ * is an alias of this, not a second list.
20883
+ */
20884
+ var AnalyticsLtsSeriesSchema = _enum([
20885
+ "motion",
20886
+ "audio-dbfs",
20887
+ "battery",
20888
+ "occupancy"
20889
+ ]);
20890
+ /**
20891
+ * One closed 5-minute bucket of a long-term series.
20892
+ *
20893
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20894
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20895
+ * that exists at all was measured; a bucket that is absent was not, which is a
20896
+ * different claim from zero and the reason this is a sparse series.
20897
+ */
20898
+ var LtsBucketSchema = object({
20899
+ scope: string(),
20900
+ bucketStart: number().int(),
20901
+ samples: number().int().nonnegative(),
20902
+ sum: number(),
20903
+ min: number(),
20904
+ max: number()
20905
+ });
20678
20906
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20679
20907
  deviceId: number(),
20680
20908
  trackId: string()
@@ -20721,6 +20949,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20721
20949
  kinds: array(string()).optional(),
20722
20950
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20723
20951
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20952
+ deviceId: number(),
20953
+ series: AnalyticsLtsSeriesSchema,
20954
+ /** Omit for EVERY scope of this series in the range. */
20955
+ scope: string().optional(),
20956
+ from: number(),
20957
+ to: number(),
20958
+ limit: number().int().positive().optional()
20959
+ }), array(LtsBucketSchema).readonly()), method(object({
20724
20960
  deviceId: number(),
20725
20961
  since: number(),
20726
20962
  until: number(),
@@ -21339,6 +21575,14 @@ var MotionSourceEnum = _enum([
21339
21575
  */
21340
21576
  var MotionSourcesSchema = array(MotionSourceEnum);
21341
21577
  /**
21578
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21579
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21580
+ * than a second spelling of the same two ideas — the value an operator picks
21581
+ * here is the value that comes back on the track, the overlay and the debug
21582
+ * row.
21583
+ */
21584
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21585
+ /**
21342
21586
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21343
21587
  * so cap-side consumers (the orchestrator forward, the runner addon's
21344
21588
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21489,6 +21733,35 @@ var RunnerCameraConfigSchema = object({
21489
21733
  * events; the orchestrator forwards to `reportMotion`.
21490
21734
  */
21491
21735
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21736
+ /**
21737
+ * WHICH root detector runs for this camera. The detection counterpart of
21738
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21739
+ * of sources the system understands, vendor-agnostic, owned here.
21740
+ *
21741
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21742
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21743
+ * here. Its boxes reach post-analysis on the same
21744
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21745
+ * track gets the same tracker, the same overlay and the same detail
21746
+ * subtree (face / plate / embedding).
21747
+ *
21748
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21749
+ * run, and that is where a camera with a usable onboard detector buys back
21750
+ * its share of the accelerator. It saves the root inference, not the decode
21751
+ * — the detail subtree still needs pixels to cut crops from.
21752
+ *
21753
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21754
+ * step at all (there is nothing to track), and the cap that knows this says
21755
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21756
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21757
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21758
+ * worth exactly what it already is — a wake signal with a class.
21759
+ *
21760
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21761
+ * vendor never turns a detector on for the operator, and neither does a
21762
+ * default.
21763
+ */
21764
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21492
21765
  pipelineEnabled: boolean().default(true),
21493
21766
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21494
21767
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21670,7 +21943,47 @@ var RunnerLocalMetricsSchema = object({
21670
21943
  queueDepth: number(),
21671
21944
  frameLazy: FrameLazyMetricsSchema.optional()
21672
21945
  });
21946
+ /**
21947
+ * Pipeline Runner capability — runtime detection workhorse.
21948
+ *
21949
+ * One instance per node. Receives camera assignments from
21950
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21951
+ * decoded frames, drains motion + detection queues, calls the local
21952
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21953
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21954
+ * the bus.
21955
+ *
21956
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21957
+ * runner has zero knowledge of other agents, no global state, and never
21958
+ * makes assignment decisions itself.
21959
+ */
21960
+ /**
21961
+ * Why a runner declined to look at a camera out of band. Named rather than a
21962
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21963
+ * already mid-session and one already bursting are four different facts, and a
21964
+ * caller told only "no" cannot tell a protection from a bug.
21965
+ */
21966
+ var OccupancyBurstRefusalSchema = _enum([
21967
+ "not-attached",
21968
+ "battery-asleep",
21969
+ "not-watching",
21970
+ "already-bursting"
21971
+ ]);
21673
21972
  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({
21973
+ deviceId: number(),
21974
+ /** How many frames to collect. The caller sizes this against what its
21975
+ * own confirmation needs; the runner clamps it to the field's range. */
21976
+ frames: number().int().positive().optional(),
21977
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21978
+ * defend — the periodic one at least has a timer to point at. */
21979
+ reason: string()
21980
+ }), object({
21981
+ started: boolean(),
21982
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21983
+ }), {
21984
+ auth: "admin",
21985
+ kind: "mutation"
21986
+ }), method(object({
21674
21987
  handle: FrameHandleSchema,
21675
21988
  bbox: NativeCropBboxSchema,
21676
21989
  maxWidth: number().int().positive().optional(),
@@ -24144,10 +24457,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24144
24457
  }), boolean()), method(object({
24145
24458
  deviceId: number().int().nonnegative(),
24146
24459
  sessionId: string()
24147
- }), object({ pendingRenegotiation: object({
24148
- target: WebrtcStreamTargetSchema,
24149
- epoch: number()
24150
- }).nullable() }));
24460
+ }), object({
24461
+ pendingRenegotiation: object({
24462
+ target: WebrtcStreamTargetSchema,
24463
+ epoch: number()
24464
+ }).nullable(),
24465
+ /**
24466
+ * Whether the session still EXISTS.
24467
+ *
24468
+ * A consumer that holds a resource for the life of a session needs to
24469
+ * be able to ask, because a session does not always end the way it
24470
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24471
+ * sent `SessionDisconnected`, so the Alexa exporter's
24472
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24473
+ * H.264 transcode kept running for NOBODY for more than twenty
24474
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24475
+ * minutes earlier — the broker knew; the holder had no way to ask.
24476
+ *
24477
+ * `false` for a session id the provider has never heard of, which is
24478
+ * the same answer as "it ended": either way nothing is holding it up.
24479
+ */
24480
+ alive: boolean()
24481
+ }));
24151
24482
  object({
24152
24483
  /** All accessory children of the parent. */
24153
24484
  childDeviceIds: array(number()).readonly(),
@@ -28594,11 +28925,46 @@ var NativeObjectDetectionStatusSchema = object({
28594
28925
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28595
28926
  /**
28596
28927
  * Whether forwarding of onboard AI detections is enabled for this device.
28597
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28598
- * churn the tracker, so forwarding stays off until the operator enables it.
28928
+ *
28929
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28930
+ * camera runs — that is the operator's choice, and it is made where every
28931
+ * other detection choice is made. `geometry` on
28932
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28933
+ * choice would buy this particular camera.
28599
28934
  */
28600
28935
  enabled: boolean()
28601
28936
  });
28937
+ /**
28938
+ * WHEN a camera's onboard detections carry geometry.
28939
+ *
28940
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28941
+ * a detection is a trackable subject whenever the camera sees one.
28942
+ * - `while-streaming` — only while some stream of this camera is already open.
28943
+ * The boxes ride the video's own side-channel rather than a feed of their
28944
+ * own, so they cost nothing and they exist only when something is pulling.
28945
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28946
+ * radio drain, but a camera that is awake is awake precisely because
28947
+ * something is in front of it, and its stream is already being pulled.
28948
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28949
+ * pipeline needs geometry to make a subject, so such a push reaches the
28950
+ * tracker as motion and no further.
28951
+ *
28952
+ * Reported and not inferred, because the operator's question in front of the
28953
+ * picker is "what do I get", and these are three different answers (D14: the
28954
+ * derived form is only as honest as `getOptions`).
28955
+ */
28956
+ var NativeObjectGeometryEnum = _enum([
28957
+ "boxed",
28958
+ "while-streaming",
28959
+ "flag-only"
28960
+ ]);
28961
+ var NativeObjectDetectionOptionsSchema = object({
28962
+ /** Classes this firmware can detect — the same list the status reports. */
28963
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28964
+ /** What a detection from this camera carries. */
28965
+ geometry: NativeObjectGeometryEnum
28966
+ });
28967
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28602
28968
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28603
28969
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28604
28970
  lastFetchedAt: number() });
@@ -28608,13 +28974,23 @@ var nativeObjectDetectionCapability = {
28608
28974
  deviceNative: true,
28609
28975
  mode: "singleton",
28610
28976
  deviceTypes: [DeviceType.Camera],
28611
- methods: { setEnabled: method(object({
28612
- deviceId: number(),
28613
- enabled: boolean()
28614
- }), _void(), {
28615
- kind: "mutation",
28616
- auth: "admin"
28617
- }) },
28977
+ methods: {
28978
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28979
+ setSettings: method(object({
28980
+ deviceId: number(),
28981
+ settings: NativeObjectDetectionSettingsPatchSchema
28982
+ }), _void(), {
28983
+ kind: "mutation",
28984
+ auth: "admin"
28985
+ }),
28986
+ setEnabled: method(object({
28987
+ deviceId: number(),
28988
+ enabled: boolean()
28989
+ }), _void(), {
28990
+ kind: "mutation",
28991
+ auth: "admin"
28992
+ })
28993
+ },
28618
28994
  events: { onDetected: { data: object({
28619
28995
  deviceId: number(),
28620
28996
  detection: NativeDetectionSchema
@@ -33462,7 +33838,28 @@ var PerScopeBreakdownSchema = object({
33462
33838
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33463
33839
  totalObjects: number().int().nonnegative(),
33464
33840
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33465
- byClass: record(string(), number().int().nonnegative())
33841
+ byClass: record(string(), number().int().nonnegative()),
33842
+ /**
33843
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33844
+ * present but not going anywhere (a parked car, a bin, a statue).
33845
+ *
33846
+ * The operator's question about a scene has two halves and they answer
33847
+ * different things: "what is parked here" is stable for hours and must not
33848
+ * flap, while "who is walking through" is the thing an alert is about. One
33849
+ * number could only serve one of them, and `totalObjects` served the first
33850
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33851
+ *
33852
+ * `standing + transient === totalObjects`, always. The total keeps its old
33853
+ * meaning exactly, so no rule written against it changes behaviour.
33854
+ *
33855
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33856
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33857
+ * parked objects here" about a camera whose lot is full.
33858
+ */
33859
+ standingObjects: number().int().nonnegative().optional(),
33860
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33861
+ * same absence rule. */
33862
+ transientObjects: number().int().nonnegative().optional()
33466
33863
  });
33467
33864
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33468
33865
  zoneId: string(),
@@ -33585,6 +33982,23 @@ var HistoryPointSchema = object({
33585
33982
  * triple covers the three spatial scopes (per-zone, frame-wide,
33586
33983
  * outside-any-zone). Crossing them with `className?` gives the full
33587
33984
  * combinatorial coverage the operator UI requested.
33985
+ *
33986
+ * ## ⚠️ The three history methods are DEPRECATED
33987
+ *
33988
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33989
+ * so after a restart they report nothing about a night that did happen, and any
33990
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33991
+ * an empty scene. The presets in the occupancy chart existed to hide that
33992
+ * horizon rather than to answer a question.
33993
+ *
33994
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33995
+ * instead. Those rows are already written for every camera, ~60 bytes per
33996
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33997
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33998
+ * function the writer uses, so the two cannot drift.
33999
+ *
34000
+ * The ring stays until these three go, and it is the only thing left reading
34001
+ * it. Do not add a fourth caller.
33588
34002
  */
33589
34003
  var zoneAnalyticsCapability = {
33590
34004
  name: "zone-analytics",
@@ -34074,6 +34488,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34074
34488
  smoke: smokeCapability,
34075
34489
  streamCatalog: streamCatalogCapability,
34076
34490
  streamParams: streamParamsCapability,
34491
+ streamSignals: streamSignalsCapability,
34077
34492
  switch: switchCapability,
34078
34493
  tamper: tamperCapability,
34079
34494
  temperatureSensor: temperatureSensorCapability,
@@ -37983,12 +38398,24 @@ Object.freeze({
37983
38398
  addonId: null,
37984
38399
  access: "create"
37985
38400
  },
38401
+ "nativeObjectDetection.getOptions": {
38402
+ capName: "native-object-detection",
38403
+ capScope: "device",
38404
+ addonId: null,
38405
+ access: "view"
38406
+ },
37986
38407
  "nativeObjectDetection.setEnabled": {
37987
38408
  capName: "native-object-detection",
37988
38409
  capScope: "device",
37989
38410
  addonId: null,
37990
38411
  access: "create"
37991
38412
  },
38413
+ "nativeObjectDetection.setSettings": {
38414
+ capName: "native-object-detection",
38415
+ capScope: "device",
38416
+ addonId: null,
38417
+ access: "create"
38418
+ },
37992
38419
  "navigation.getFeatures": {
37993
38420
  capName: "navigation",
37994
38421
  capScope: "device",
@@ -38253,6 +38680,12 @@ Object.freeze({
38253
38680
  addonId: null,
38254
38681
  access: "view"
38255
38682
  },
38683
+ "notificationRules.getClipRetentionAsks": {
38684
+ capName: "notification-rules",
38685
+ capScope: "system",
38686
+ addonId: null,
38687
+ access: "view"
38688
+ },
38256
38689
  "notificationRules.getConditionCatalog": {
38257
38690
  capName: "notification-rules",
38258
38691
  capScope: "system",
@@ -38763,6 +39196,12 @@ Object.freeze({
38763
39196
  addonId: null,
38764
39197
  access: "create"
38765
39198
  },
39199
+ "pipelineAnalytics.readLongTermSeries": {
39200
+ capName: "pipeline-analytics",
39201
+ capScope: "device",
39202
+ addonId: null,
39203
+ access: "view"
39204
+ },
38766
39205
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38767
39206
  capName: "pipeline-analytics",
38768
39207
  capScope: "device",
@@ -39435,6 +39874,12 @@ Object.freeze({
39435
39874
  addonId: null,
39436
39875
  access: "create"
39437
39876
  },
39877
+ "pipelineRunner.requestOccupancyBurst": {
39878
+ capName: "pipeline-runner",
39879
+ capScope: "system",
39880
+ addonId: null,
39881
+ access: "create"
39882
+ },
39438
39883
  "pipelineRunner.runDetailSubtree": {
39439
39884
  capName: "pipeline-runner",
39440
39885
  capScope: "system",
@@ -40647,6 +41092,12 @@ Object.freeze({
40647
41092
  addonId: null,
40648
41093
  access: "create"
40649
41094
  },
41095
+ "streamBroker.reportStreamSignal": {
41096
+ capName: "stream-broker",
41097
+ capScope: "system",
41098
+ addonId: null,
41099
+ access: "create"
41100
+ },
40650
41101
  "streamBroker.restartProfile": {
40651
41102
  capName: "stream-broker",
40652
41103
  capScope: "system",
@@ -40731,6 +41182,12 @@ Object.freeze({
40731
41182
  addonId: null,
40732
41183
  access: "create"
40733
41184
  },
41185
+ "streamSignals.listSignals": {
41186
+ capName: "stream-signals",
41187
+ capScope: "device",
41188
+ addonId: null,
41189
+ access: "view"
41190
+ },
40734
41191
  "switch.setState": {
40735
41192
  capName: "switch",
40736
41193
  capScope: "device",
@@ -42203,11 +42660,21 @@ Object.freeze({
42203
42660
  form: "single",
42204
42661
  optional: false
42205
42662
  }],
42663
+ "nativeObjectDetection.getOptions": [{
42664
+ name: "deviceId",
42665
+ form: "single",
42666
+ optional: false
42667
+ }],
42206
42668
  "nativeObjectDetection.setEnabled": [{
42207
42669
  name: "deviceId",
42208
42670
  form: "single",
42209
42671
  optional: false
42210
42672
  }],
42673
+ "nativeObjectDetection.setSettings": [{
42674
+ name: "deviceId",
42675
+ form: "single",
42676
+ optional: false
42677
+ }],
42211
42678
  "navigation.getFeatures": [{
42212
42679
  name: "deviceId",
42213
42680
  form: "single",
@@ -42557,6 +43024,11 @@ Object.freeze({
42557
43024
  form: "single",
42558
43025
  optional: false
42559
43026
  }],
43027
+ "pipelineAnalytics.readLongTermSeries": [{
43028
+ name: "deviceId",
43029
+ form: "single",
43030
+ optional: false
43031
+ }],
42560
43032
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42561
43033
  name: "deviceId",
42562
43034
  form: "single",
@@ -42747,6 +43219,11 @@ Object.freeze({
42747
43219
  form: "single",
42748
43220
  optional: false
42749
43221
  }],
43222
+ "pipelineRunner.requestOccupancyBurst": [{
43223
+ name: "deviceId",
43224
+ form: "single",
43225
+ optional: false
43226
+ }],
42750
43227
  "pipelineRunner.runDetailSubtree": [{
42751
43228
  name: "deviceId",
42752
43229
  form: "single",
@@ -43103,6 +43580,11 @@ Object.freeze({
43103
43580
  form: "single",
43104
43581
  optional: false
43105
43582
  }],
43583
+ "streamBroker.reportStreamSignal": [{
43584
+ name: "deviceId",
43585
+ form: "single",
43586
+ optional: false
43587
+ }],
43106
43588
  "streamBroker.restartProfile": [{
43107
43589
  name: "deviceId",
43108
43590
  form: "single",