@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.mjs CHANGED
@@ -10,7 +10,7 @@ import { getCACertificates, setDefaultCACertificates } from "node:tls";
10
10
  //#region \0rolldown/runtime.js
11
11
  var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
12
12
  //#endregion
13
- //#region ../types/dist/event-category-ZyX6jcse.mjs
13
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
14
14
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
15
15
  EventCategory["SystemBoot"] = "system.boot";
16
16
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -627,6 +627,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
627
627
  * pull-reconcile from the provider's `getStatus` on reconnect. */
628
628
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
629
629
  EventCategory["BackupCompleted"] = "backup.completed";
630
+ /**
631
+ * A whole backup RUN finished — every destination attempted, win or lose.
632
+ *
633
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
634
+ * a progress UI and the wrong one for a notification: an operator with three
635
+ * destinations would be told three times. And a run where two of three
636
+ * destinations succeeded is not a clean success — a single "backup
637
+ * completed" that hid the failed one would be a lie, so the count of each is
638
+ * carried here and the message says both.
639
+ *
640
+ * Emitted by the backup orchestrator only after the destination loop, so a
641
+ * run that dies during the BUILD phase produces no completion at all.
642
+ */
643
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
630
644
  EventCategory["BackupRestored"] = "backup.restored";
631
645
  EventCategory["NotificationDispatched"] = "notification.dispatched";
632
646
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5357,7 +5371,7 @@ var ZodIssueCode = {
5357
5371
  var ZodFirstPartyTypeKind;
5358
5372
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5359
5373
  //#endregion
5360
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5374
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5361
5375
  /**
5362
5376
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5363
5377
  * window to float samples (D455).
@@ -11501,6 +11515,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11501
11515
  auth: "admin"
11502
11516
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11503
11517
  DeviceType.Camera;
11518
+ /**
11519
+ * The signals a device can emit to WAKE its own stream.
11520
+ *
11521
+ * A camera whose stream is built on demand sleeps until something asks for it,
11522
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11523
+ * puller holds a session open for ever, and treating that as demand would keep
11524
+ * a battery camera awake for ever, which is the whole thing the battery is for
11525
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11526
+ * itself, with no stream running.
11527
+ *
11528
+ * ## The vocabulary is the PROVIDER'S, not ours
11529
+ *
11530
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11531
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11532
+ * Reolink offers motion and camera-native detection; another provider may offer
11533
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11534
+ * yet. A fixed enum here would mean every new signal is a framework release.
11535
+ *
11536
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11537
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11538
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11539
+ * binding — but both answer "what drives the detection pipeline", which is a
11540
+ * different question from "what may wake a sleeping stream". A camera can do
11541
+ * the first and not be trusted with the second, and the operator picks per
11542
+ * camera. Two questions, two authorities.
11543
+ *
11544
+ * ## Availability is not permission
11545
+ *
11546
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11547
+ * wakes the stream is the operator's per-camera choice, held by the broker
11548
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11549
+ * provider declaring a signal is not a provider enabling it.
11550
+ */
11551
+ /** One signal a device can emit. */
11552
+ var StreamSignalSchema = object({
11553
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11554
+ code: string().min(1),
11555
+ /** What an operator reads in the picker. The provider's own wording. */
11556
+ label: string().min(1),
11557
+ /**
11558
+ * Whether the provider recommends this signal ON when a camera is first set
11559
+ * up. A provider knows which of its signals are cheap and reliable; an
11560
+ * operator should not have to discover that by trial. Reolink recommends
11561
+ * both of its own.
11562
+ */
11563
+ recommended: boolean()
11564
+ });
11565
+ var StreamSignalsStatusSchema = object({
11566
+ signals: array(StreamSignalSchema),
11567
+ lastFetchedAt: number()
11568
+ });
11569
+ var streamSignalsCapability = {
11570
+ name: "stream-signals",
11571
+ scope: "device",
11572
+ deviceNative: true,
11573
+ mode: "singleton",
11574
+ deviceTypes: Object.values(DeviceType),
11575
+ runtimeState: StreamSignalsStatusSchema,
11576
+ /**
11577
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11578
+ *
11579
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11580
+ * not an operator choice: the provider re-declares it on every registration,
11581
+ * so losing it loses nothing and persisting it would freeze an answer the
11582
+ * camera is entitled to change. Measured the same day on the sibling case —
11583
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11584
+ * class the camera really detected stayed missing for the life of the row
11585
+ * because the fix could not reach it.
11586
+ *
11587
+ * See `RuntimeStateDurability`. Enforced by
11588
+ * `scripts/check-runtime-state-durability.ts`.
11589
+ */
11590
+ durability: "session",
11591
+ methods: {
11592
+ /**
11593
+ * What this device can emit. Empty is a valid and common answer — most
11594
+ * cameras have nothing to offer here, and an empty list is what makes the
11595
+ * broker's picker show nothing rather than a false choice.
11596
+ */
11597
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11598
+ };
11504
11599
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11505
11600
  var StreamFormatSchema = _enum([
11506
11601
  "webrtc",
@@ -11897,6 +11992,22 @@ var EgressTranscodeSchema = object({
11897
11992
  camStreamId: string().nullable()
11898
11993
  });
11899
11994
  method(object({
11995
+ deviceId: number().int().nonnegative(),
11996
+ /** The provider's signal code. */
11997
+ code: string().min(1),
11998
+ /** Ms epoch. Absent ⇒ now. */
11999
+ at: number().optional()
12000
+ }), object({
12001
+ /** Whether the broker acted on it, and if not, why. */
12002
+ accepted: boolean(),
12003
+ reason: _enum([
12004
+ "woke",
12005
+ "hold-extended",
12006
+ "not-enabled",
12007
+ "no-consumer",
12008
+ "unknown-code"
12009
+ ])
12010
+ }), { kind: "mutation" }), method(object({
11900
12011
  deviceId: number().int().nonnegative(),
11901
12012
  camStreamId: string().min(1),
11902
12013
  kind: CamStreamKindSchema,
@@ -12151,6 +12262,16 @@ var PickStreamRequirementsSchema = object({
12151
12262
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12152
12263
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12153
12264
  minHeight: number().int().positive().optional(),
12265
+ /**
12266
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12267
+ *
12268
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12269
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12270
+ * Without this the ceiling had to be re-implemented by every caller — and
12271
+ * one caller implementing it privately is how a second scoring authority
12272
+ * gets born.
12273
+ */
12274
+ maxHeight: number().int().positive().optional(),
12154
12275
  /** Minimum horizontal resolution. */
12155
12276
  minWidth: number().int().positive().optional(),
12156
12277
  /**
@@ -12167,7 +12288,22 @@ var PickStreamRequirementsSchema = object({
12167
12288
  * transcoded" guard: if the device is already serving the consumer's
12168
12289
  * codec end-to-end, there's nothing to optimise.
12169
12290
  */
12170
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12291
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12292
+ /**
12293
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12294
+ * understanding that it will be transcoded.
12295
+ *
12296
+ * Default `false` — today's behaviour, and the right one for a bypass
12297
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12298
+ * ask the larger question: "what is the best stream for me, transcoding if
12299
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12300
+ * does not, so a passthrough is never lost to a transcode; the answer says
12301
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12302
+ *
12303
+ * This is what lets one picker serve both the bypass and the full source
12304
+ * choice, instead of a consumer scoring privately when the bypass misses.
12305
+ */
12306
+ allowTranscode: boolean().optional()
12171
12307
  }).readonly();
12172
12308
  var PickStreamPreferencesSchema = object({
12173
12309
  /**
@@ -12181,12 +12317,32 @@ var PickStreamPreferencesSchema = object({
12181
12317
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12182
12318
  * memory-constrained consumers / Apple Home guest sessions).
12183
12319
  */
12184
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12320
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12321
+ /**
12322
+ * The height the consumer actually wants to DELIVER.
12323
+ *
12324
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12325
+ * above the target wins, and only if nothing reaches it does the tallest
12326
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12327
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12328
+ * express that: it says "as big as possible", which is a different wish.
12329
+ *
12330
+ * Ignored when absent, so every existing caller keeps its ordering.
12331
+ */
12332
+ targetHeight: number().int().positive().optional()
12185
12333
  }).readonly();
12186
12334
  var PickedCamStreamSchema = object({
12187
12335
  camStreamId: string(),
12188
12336
  codec: string().optional(),
12189
12337
  resolution: CamStreamResolutionSchema.optional(),
12338
+ /**
12339
+ * Whether serving this stream requires a decode + re-encode.
12340
+ *
12341
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12342
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12343
+ * not ask cannot be handed a cost it never agreed to pay.
12344
+ */
12345
+ transcodes: boolean(),
12190
12346
  /** One-line explanation of why this stream won — for logs / debug UI. */
12191
12347
  reason: string()
12192
12348
  });
@@ -16720,6 +16876,8 @@ var NcSystemEventKindSchema = _enum([
16720
16876
  "device-enabled",
16721
16877
  "device-battery-low",
16722
16878
  "device-battery-normal",
16879
+ "device-consumable-low",
16880
+ "device-consumable-normal",
16723
16881
  "stream-online",
16724
16882
  "stream-offline",
16725
16883
  "node-online",
@@ -16738,6 +16896,7 @@ var NcSystemEventKindSchema = _enum([
16738
16896
  "addon-updated",
16739
16897
  "server-updated",
16740
16898
  "export-completed",
16899
+ "backup-completed",
16741
16900
  "camera-online",
16742
16901
  "camera-offline",
16743
16902
  "camera-disabled",
@@ -18060,6 +18219,48 @@ var NcAlarmConfigSchema = object({
18060
18219
  settings: NcAlarmSettingsSchema,
18061
18220
  coverage: array(NcAlarmModeCoverageSchema)
18062
18221
  });
18222
+ /**
18223
+ * ONE rule's demand on ONE camera's clip ring.
18224
+ *
18225
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18226
+ * camera, so the answer stays a faithful description of the rules and the
18227
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18228
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18229
+ * a different thing from never having been told, and only the envelope
18230
+ * (`rulesLoaded`) can tell those apart.
18231
+ */
18232
+ var NcClipRetentionAskSchema = object({
18233
+ /**
18234
+ * The camera this ask is about. **Absent = every camera**, which is what a
18235
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18236
+ * asking everywhere.
18237
+ */
18238
+ deviceId: number().int().nonnegative().optional(),
18239
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18240
+ * needs nothing produces no ask at all. */
18241
+ seconds: number().min(0).max(60),
18242
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18243
+ * assigned, which is what the cut defaults to. */
18244
+ profile: CamProfileSchema.optional(),
18245
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18246
+ ruleId: string(),
18247
+ ruleName: string(),
18248
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18249
+ reason: _enum(["window", "occupancy"])
18250
+ });
18251
+ /**
18252
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18253
+ *
18254
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18255
+ * once. A centre that is up but has not read its rules yet answers with an
18256
+ * empty ask list that means nothing at all — applying it would drop every
18257
+ * camera's ring to zero for the first events after a restart, which is the
18258
+ * footage this mechanism exists to keep.
18259
+ */
18260
+ var NcClipRetentionPlanSchema = object({
18261
+ rulesLoaded: boolean(),
18262
+ asks: array(NcClipRetentionAskSchema).readonly()
18263
+ });
18063
18264
  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 }), {
18064
18265
  kind: "mutation",
18065
18266
  auth: "admin",
@@ -18080,7 +18281,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18080
18281
  }), object({ success: literal(true) }), {
18081
18282
  kind: "mutation",
18082
18283
  auth: "admin"
18083
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18284
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18084
18285
  deviceId: number().int(),
18085
18286
  muted: boolean()
18086
18287
  }), object({ success: literal(true) }), {
@@ -20654,6 +20855,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20654
20855
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20655
20856
  framesMatched: number().int()
20656
20857
  })).readonly() });
20858
+ /**
20859
+ * The long-term series a camera produces. A closed union so a typo cannot
20860
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20861
+ * is an alias of this, not a second list.
20862
+ */
20863
+ var AnalyticsLtsSeriesSchema = _enum([
20864
+ "motion",
20865
+ "audio-dbfs",
20866
+ "battery",
20867
+ "occupancy"
20868
+ ]);
20869
+ /**
20870
+ * One closed 5-minute bucket of a long-term series.
20871
+ *
20872
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20873
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20874
+ * that exists at all was measured; a bucket that is absent was not, which is a
20875
+ * different claim from zero and the reason this is a sparse series.
20876
+ */
20877
+ var LtsBucketSchema = object({
20878
+ scope: string(),
20879
+ bucketStart: number().int(),
20880
+ samples: number().int().nonnegative(),
20881
+ sum: number(),
20882
+ min: number(),
20883
+ max: number()
20884
+ });
20657
20885
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20658
20886
  deviceId: number(),
20659
20887
  trackId: string()
@@ -20700,6 +20928,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20700
20928
  kinds: array(string()).optional(),
20701
20929
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20702
20930
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20931
+ deviceId: number(),
20932
+ series: AnalyticsLtsSeriesSchema,
20933
+ /** Omit for EVERY scope of this series in the range. */
20934
+ scope: string().optional(),
20935
+ from: number(),
20936
+ to: number(),
20937
+ limit: number().int().positive().optional()
20938
+ }), array(LtsBucketSchema).readonly()), method(object({
20703
20939
  deviceId: number(),
20704
20940
  since: number(),
20705
20941
  until: number(),
@@ -21318,6 +21554,14 @@ var MotionSourceEnum = _enum([
21318
21554
  */
21319
21555
  var MotionSourcesSchema = array(MotionSourceEnum);
21320
21556
  /**
21557
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21558
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21559
+ * than a second spelling of the same two ideas — the value an operator picks
21560
+ * here is the value that comes back on the track, the overlay and the debug
21561
+ * row.
21562
+ */
21563
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21564
+ /**
21321
21565
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21322
21566
  * so cap-side consumers (the orchestrator forward, the runner addon's
21323
21567
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21468,6 +21712,35 @@ var RunnerCameraConfigSchema = object({
21468
21712
  * events; the orchestrator forwards to `reportMotion`.
21469
21713
  */
21470
21714
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21715
+ /**
21716
+ * WHICH root detector runs for this camera. The detection counterpart of
21717
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21718
+ * of sources the system understands, vendor-agnostic, owned here.
21719
+ *
21720
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21721
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21722
+ * here. Its boxes reach post-analysis on the same
21723
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21724
+ * track gets the same tracker, the same overlay and the same detail
21725
+ * subtree (face / plate / embedding).
21726
+ *
21727
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21728
+ * run, and that is where a camera with a usable onboard detector buys back
21729
+ * its share of the accelerator. It saves the root inference, not the decode
21730
+ * — the detail subtree still needs pixels to cut crops from.
21731
+ *
21732
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21733
+ * step at all (there is nothing to track), and the cap that knows this says
21734
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21735
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21736
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21737
+ * worth exactly what it already is — a wake signal with a class.
21738
+ *
21739
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21740
+ * vendor never turns a detector on for the operator, and neither does a
21741
+ * default.
21742
+ */
21743
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21471
21744
  pipelineEnabled: boolean().default(true),
21472
21745
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21473
21746
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21649,7 +21922,47 @@ var RunnerLocalMetricsSchema = object({
21649
21922
  queueDepth: number(),
21650
21923
  frameLazy: FrameLazyMetricsSchema.optional()
21651
21924
  });
21925
+ /**
21926
+ * Pipeline Runner capability — runtime detection workhorse.
21927
+ *
21928
+ * One instance per node. Receives camera assignments from
21929
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21930
+ * decoded frames, drains motion + detection queues, calls the local
21931
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21932
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21933
+ * the bus.
21934
+ *
21935
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21936
+ * runner has zero knowledge of other agents, no global state, and never
21937
+ * makes assignment decisions itself.
21938
+ */
21939
+ /**
21940
+ * Why a runner declined to look at a camera out of band. Named rather than a
21941
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21942
+ * already mid-session and one already bursting are four different facts, and a
21943
+ * caller told only "no" cannot tell a protection from a bug.
21944
+ */
21945
+ var OccupancyBurstRefusalSchema = _enum([
21946
+ "not-attached",
21947
+ "battery-asleep",
21948
+ "not-watching",
21949
+ "already-bursting"
21950
+ ]);
21652
21951
  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({
21952
+ deviceId: number(),
21953
+ /** How many frames to collect. The caller sizes this against what its
21954
+ * own confirmation needs; the runner clamps it to the field's range. */
21955
+ frames: number().int().positive().optional(),
21956
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21957
+ * defend — the periodic one at least has a timer to point at. */
21958
+ reason: string()
21959
+ }), object({
21960
+ started: boolean(),
21961
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21962
+ }), {
21963
+ auth: "admin",
21964
+ kind: "mutation"
21965
+ }), method(object({
21653
21966
  handle: FrameHandleSchema,
21654
21967
  bbox: NativeCropBboxSchema,
21655
21968
  maxWidth: number().int().positive().optional(),
@@ -24123,10 +24436,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24123
24436
  }), boolean()), method(object({
24124
24437
  deviceId: number().int().nonnegative(),
24125
24438
  sessionId: string()
24126
- }), object({ pendingRenegotiation: object({
24127
- target: WebrtcStreamTargetSchema,
24128
- epoch: number()
24129
- }).nullable() }));
24439
+ }), object({
24440
+ pendingRenegotiation: object({
24441
+ target: WebrtcStreamTargetSchema,
24442
+ epoch: number()
24443
+ }).nullable(),
24444
+ /**
24445
+ * Whether the session still EXISTS.
24446
+ *
24447
+ * A consumer that holds a resource for the life of a session needs to
24448
+ * be able to ask, because a session does not always end the way it
24449
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24450
+ * sent `SessionDisconnected`, so the Alexa exporter's
24451
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24452
+ * H.264 transcode kept running for NOBODY for more than twenty
24453
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24454
+ * minutes earlier — the broker knew; the holder had no way to ask.
24455
+ *
24456
+ * `false` for a session id the provider has never heard of, which is
24457
+ * the same answer as "it ended": either way nothing is holding it up.
24458
+ */
24459
+ alive: boolean()
24460
+ }));
24130
24461
  object({
24131
24462
  /** All accessory children of the parent. */
24132
24463
  childDeviceIds: array(number()).readonly(),
@@ -28573,11 +28904,46 @@ var NativeObjectDetectionStatusSchema = object({
28573
28904
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28574
28905
  /**
28575
28906
  * Whether forwarding of onboard AI detections is enabled for this device.
28576
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28577
- * churn the tracker, so forwarding stays off until the operator enables it.
28907
+ *
28908
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28909
+ * camera runs — that is the operator's choice, and it is made where every
28910
+ * other detection choice is made. `geometry` on
28911
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28912
+ * choice would buy this particular camera.
28578
28913
  */
28579
28914
  enabled: boolean()
28580
28915
  });
28916
+ /**
28917
+ * WHEN a camera's onboard detections carry geometry.
28918
+ *
28919
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28920
+ * a detection is a trackable subject whenever the camera sees one.
28921
+ * - `while-streaming` — only while some stream of this camera is already open.
28922
+ * The boxes ride the video's own side-channel rather than a feed of their
28923
+ * own, so they cost nothing and they exist only when something is pulling.
28924
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28925
+ * radio drain, but a camera that is awake is awake precisely because
28926
+ * something is in front of it, and its stream is already being pulled.
28927
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28928
+ * pipeline needs geometry to make a subject, so such a push reaches the
28929
+ * tracker as motion and no further.
28930
+ *
28931
+ * Reported and not inferred, because the operator's question in front of the
28932
+ * picker is "what do I get", and these are three different answers (D14: the
28933
+ * derived form is only as honest as `getOptions`).
28934
+ */
28935
+ var NativeObjectGeometryEnum = _enum([
28936
+ "boxed",
28937
+ "while-streaming",
28938
+ "flag-only"
28939
+ ]);
28940
+ var NativeObjectDetectionOptionsSchema = object({
28941
+ /** Classes this firmware can detect — the same list the status reports. */
28942
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28943
+ /** What a detection from this camera carries. */
28944
+ geometry: NativeObjectGeometryEnum
28945
+ });
28946
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28581
28947
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28582
28948
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28583
28949
  lastFetchedAt: number() });
@@ -28587,13 +28953,23 @@ var nativeObjectDetectionCapability = {
28587
28953
  deviceNative: true,
28588
28954
  mode: "singleton",
28589
28955
  deviceTypes: [DeviceType.Camera],
28590
- methods: { setEnabled: method(object({
28591
- deviceId: number(),
28592
- enabled: boolean()
28593
- }), _void(), {
28594
- kind: "mutation",
28595
- auth: "admin"
28596
- }) },
28956
+ methods: {
28957
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28958
+ setSettings: method(object({
28959
+ deviceId: number(),
28960
+ settings: NativeObjectDetectionSettingsPatchSchema
28961
+ }), _void(), {
28962
+ kind: "mutation",
28963
+ auth: "admin"
28964
+ }),
28965
+ setEnabled: method(object({
28966
+ deviceId: number(),
28967
+ enabled: boolean()
28968
+ }), _void(), {
28969
+ kind: "mutation",
28970
+ auth: "admin"
28971
+ })
28972
+ },
28597
28973
  events: { onDetected: { data: object({
28598
28974
  deviceId: number(),
28599
28975
  detection: NativeDetectionSchema
@@ -33441,7 +33817,28 @@ var PerScopeBreakdownSchema = object({
33441
33817
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33442
33818
  totalObjects: number().int().nonnegative(),
33443
33819
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33444
- byClass: record(string(), number().int().nonnegative())
33820
+ byClass: record(string(), number().int().nonnegative()),
33821
+ /**
33822
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33823
+ * present but not going anywhere (a parked car, a bin, a statue).
33824
+ *
33825
+ * The operator's question about a scene has two halves and they answer
33826
+ * different things: "what is parked here" is stable for hours and must not
33827
+ * flap, while "who is walking through" is the thing an alert is about. One
33828
+ * number could only serve one of them, and `totalObjects` served the first
33829
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33830
+ *
33831
+ * `standing + transient === totalObjects`, always. The total keeps its old
33832
+ * meaning exactly, so no rule written against it changes behaviour.
33833
+ *
33834
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33835
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33836
+ * parked objects here" about a camera whose lot is full.
33837
+ */
33838
+ standingObjects: number().int().nonnegative().optional(),
33839
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33840
+ * same absence rule. */
33841
+ transientObjects: number().int().nonnegative().optional()
33445
33842
  });
33446
33843
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33447
33844
  zoneId: string(),
@@ -33564,6 +33961,23 @@ var HistoryPointSchema = object({
33564
33961
  * triple covers the three spatial scopes (per-zone, frame-wide,
33565
33962
  * outside-any-zone). Crossing them with `className?` gives the full
33566
33963
  * combinatorial coverage the operator UI requested.
33964
+ *
33965
+ * ## ⚠️ The three history methods are DEPRECATED
33966
+ *
33967
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33968
+ * so after a restart they report nothing about a night that did happen, and any
33969
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33970
+ * an empty scene. The presets in the occupancy chart existed to hide that
33971
+ * horizon rather than to answer a question.
33972
+ *
33973
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33974
+ * instead. Those rows are already written for every camera, ~60 bytes per
33975
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33976
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33977
+ * function the writer uses, so the two cannot drift.
33978
+ *
33979
+ * The ring stays until these three go, and it is the only thing left reading
33980
+ * it. Do not add a fourth caller.
33567
33981
  */
33568
33982
  var zoneAnalyticsCapability = {
33569
33983
  name: "zone-analytics",
@@ -34053,6 +34467,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34053
34467
  smoke: smokeCapability,
34054
34468
  streamCatalog: streamCatalogCapability,
34055
34469
  streamParams: streamParamsCapability,
34470
+ streamSignals: streamSignalsCapability,
34056
34471
  switch: switchCapability,
34057
34472
  tamper: tamperCapability,
34058
34473
  temperatureSensor: temperatureSensorCapability,
@@ -37962,12 +38377,24 @@ Object.freeze({
37962
38377
  addonId: null,
37963
38378
  access: "create"
37964
38379
  },
38380
+ "nativeObjectDetection.getOptions": {
38381
+ capName: "native-object-detection",
38382
+ capScope: "device",
38383
+ addonId: null,
38384
+ access: "view"
38385
+ },
37965
38386
  "nativeObjectDetection.setEnabled": {
37966
38387
  capName: "native-object-detection",
37967
38388
  capScope: "device",
37968
38389
  addonId: null,
37969
38390
  access: "create"
37970
38391
  },
38392
+ "nativeObjectDetection.setSettings": {
38393
+ capName: "native-object-detection",
38394
+ capScope: "device",
38395
+ addonId: null,
38396
+ access: "create"
38397
+ },
37971
38398
  "navigation.getFeatures": {
37972
38399
  capName: "navigation",
37973
38400
  capScope: "device",
@@ -38232,6 +38659,12 @@ Object.freeze({
38232
38659
  addonId: null,
38233
38660
  access: "view"
38234
38661
  },
38662
+ "notificationRules.getClipRetentionAsks": {
38663
+ capName: "notification-rules",
38664
+ capScope: "system",
38665
+ addonId: null,
38666
+ access: "view"
38667
+ },
38235
38668
  "notificationRules.getConditionCatalog": {
38236
38669
  capName: "notification-rules",
38237
38670
  capScope: "system",
@@ -38742,6 +39175,12 @@ Object.freeze({
38742
39175
  addonId: null,
38743
39176
  access: "create"
38744
39177
  },
39178
+ "pipelineAnalytics.readLongTermSeries": {
39179
+ capName: "pipeline-analytics",
39180
+ capScope: "device",
39181
+ addonId: null,
39182
+ access: "view"
39183
+ },
38745
39184
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38746
39185
  capName: "pipeline-analytics",
38747
39186
  capScope: "device",
@@ -39414,6 +39853,12 @@ Object.freeze({
39414
39853
  addonId: null,
39415
39854
  access: "create"
39416
39855
  },
39856
+ "pipelineRunner.requestOccupancyBurst": {
39857
+ capName: "pipeline-runner",
39858
+ capScope: "system",
39859
+ addonId: null,
39860
+ access: "create"
39861
+ },
39417
39862
  "pipelineRunner.runDetailSubtree": {
39418
39863
  capName: "pipeline-runner",
39419
39864
  capScope: "system",
@@ -40626,6 +41071,12 @@ Object.freeze({
40626
41071
  addonId: null,
40627
41072
  access: "create"
40628
41073
  },
41074
+ "streamBroker.reportStreamSignal": {
41075
+ capName: "stream-broker",
41076
+ capScope: "system",
41077
+ addonId: null,
41078
+ access: "create"
41079
+ },
40629
41080
  "streamBroker.restartProfile": {
40630
41081
  capName: "stream-broker",
40631
41082
  capScope: "system",
@@ -40710,6 +41161,12 @@ Object.freeze({
40710
41161
  addonId: null,
40711
41162
  access: "create"
40712
41163
  },
41164
+ "streamSignals.listSignals": {
41165
+ capName: "stream-signals",
41166
+ capScope: "device",
41167
+ addonId: null,
41168
+ access: "view"
41169
+ },
40713
41170
  "switch.setState": {
40714
41171
  capName: "switch",
40715
41172
  capScope: "device",
@@ -42182,11 +42639,21 @@ Object.freeze({
42182
42639
  form: "single",
42183
42640
  optional: false
42184
42641
  }],
42642
+ "nativeObjectDetection.getOptions": [{
42643
+ name: "deviceId",
42644
+ form: "single",
42645
+ optional: false
42646
+ }],
42185
42647
  "nativeObjectDetection.setEnabled": [{
42186
42648
  name: "deviceId",
42187
42649
  form: "single",
42188
42650
  optional: false
42189
42651
  }],
42652
+ "nativeObjectDetection.setSettings": [{
42653
+ name: "deviceId",
42654
+ form: "single",
42655
+ optional: false
42656
+ }],
42190
42657
  "navigation.getFeatures": [{
42191
42658
  name: "deviceId",
42192
42659
  form: "single",
@@ -42536,6 +43003,11 @@ Object.freeze({
42536
43003
  form: "single",
42537
43004
  optional: false
42538
43005
  }],
43006
+ "pipelineAnalytics.readLongTermSeries": [{
43007
+ name: "deviceId",
43008
+ form: "single",
43009
+ optional: false
43010
+ }],
42539
43011
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42540
43012
  name: "deviceId",
42541
43013
  form: "single",
@@ -42726,6 +43198,11 @@ Object.freeze({
42726
43198
  form: "single",
42727
43199
  optional: false
42728
43200
  }],
43201
+ "pipelineRunner.requestOccupancyBurst": [{
43202
+ name: "deviceId",
43203
+ form: "single",
43204
+ optional: false
43205
+ }],
42729
43206
  "pipelineRunner.runDetailSubtree": [{
42730
43207
  name: "deviceId",
42731
43208
  form: "single",
@@ -43082,6 +43559,11 @@ Object.freeze({
43082
43559
  form: "single",
43083
43560
  optional: false
43084
43561
  }],
43562
+ "streamBroker.reportStreamSignal": [{
43563
+ name: "deviceId",
43564
+ form: "single",
43565
+ optional: false
43566
+ }],
43085
43567
  "streamBroker.restartProfile": [{
43086
43568
  name: "deviceId",
43087
43569
  form: "single",