@camstack/addon-provider-amcrest 0.2.103 → 0.2.105

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
@@ -6,7 +6,7 @@ let node_crypto = require("node:crypto");
6
6
  let node_http = require("node:http");
7
7
  let node_https = require("node:https");
8
8
  let node_os = require("node:os");
9
- //#region ../types/dist/event-category-ZyX6jcse.mjs
9
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
10
10
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
11
11
  EventCategory["SystemBoot"] = "system.boot";
12
12
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -623,6 +623,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
623
623
  * pull-reconcile from the provider's `getStatus` on reconnect. */
624
624
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
625
625
  EventCategory["BackupCompleted"] = "backup.completed";
626
+ /**
627
+ * A whole backup RUN finished — every destination attempted, win or lose.
628
+ *
629
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
630
+ * a progress UI and the wrong one for a notification: an operator with three
631
+ * destinations would be told three times. And a run where two of three
632
+ * destinations succeeded is not a clean success — a single "backup
633
+ * completed" that hid the failed one would be a lie, so the count of each is
634
+ * carried here and the message says both.
635
+ *
636
+ * Emitted by the backup orchestrator only after the destination loop, so a
637
+ * run that dies during the BUILD phase produces no completion at all.
638
+ */
639
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
626
640
  EventCategory["BackupRestored"] = "backup.restored";
627
641
  EventCategory["NotificationDispatched"] = "notification.dispatched";
628
642
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5353,7 +5367,7 @@ var ZodIssueCode = {
5353
5367
  var ZodFirstPartyTypeKind;
5354
5368
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5355
5369
  //#endregion
5356
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5370
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5357
5371
  /**
5358
5372
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5359
5373
  * window to float samples (D455).
@@ -11485,6 +11499,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11485
11499
  auth: "admin"
11486
11500
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11487
11501
  DeviceType.Camera;
11502
+ /**
11503
+ * The signals a device can emit to WAKE its own stream.
11504
+ *
11505
+ * A camera whose stream is built on demand sleeps until something asks for it,
11506
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11507
+ * puller holds a session open for ever, and treating that as demand would keep
11508
+ * a battery camera awake for ever, which is the whole thing the battery is for
11509
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11510
+ * itself, with no stream running.
11511
+ *
11512
+ * ## The vocabulary is the PROVIDER'S, not ours
11513
+ *
11514
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11515
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11516
+ * Reolink offers motion and camera-native detection; another provider may offer
11517
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11518
+ * yet. A fixed enum here would mean every new signal is a framework release.
11519
+ *
11520
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11521
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11522
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11523
+ * binding — but both answer "what drives the detection pipeline", which is a
11524
+ * different question from "what may wake a sleeping stream". A camera can do
11525
+ * the first and not be trusted with the second, and the operator picks per
11526
+ * camera. Two questions, two authorities.
11527
+ *
11528
+ * ## Availability is not permission
11529
+ *
11530
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11531
+ * wakes the stream is the operator's per-camera choice, held by the broker
11532
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11533
+ * provider declaring a signal is not a provider enabling it.
11534
+ */
11535
+ /** One signal a device can emit. */
11536
+ var StreamSignalSchema = object({
11537
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11538
+ code: string().min(1),
11539
+ /** What an operator reads in the picker. The provider's own wording. */
11540
+ label: string().min(1),
11541
+ /**
11542
+ * Whether the provider recommends this signal ON when a camera is first set
11543
+ * up. A provider knows which of its signals are cheap and reliable; an
11544
+ * operator should not have to discover that by trial. Reolink recommends
11545
+ * both of its own.
11546
+ */
11547
+ recommended: boolean()
11548
+ });
11549
+ var StreamSignalsStatusSchema = object({
11550
+ signals: array(StreamSignalSchema),
11551
+ lastFetchedAt: number()
11552
+ });
11553
+ var streamSignalsCapability = {
11554
+ name: "stream-signals",
11555
+ scope: "device",
11556
+ deviceNative: true,
11557
+ mode: "singleton",
11558
+ deviceTypes: Object.values(DeviceType),
11559
+ runtimeState: StreamSignalsStatusSchema,
11560
+ /**
11561
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11562
+ *
11563
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11564
+ * not an operator choice: the provider re-declares it on every registration,
11565
+ * so losing it loses nothing and persisting it would freeze an answer the
11566
+ * camera is entitled to change. Measured the same day on the sibling case —
11567
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11568
+ * class the camera really detected stayed missing for the life of the row
11569
+ * because the fix could not reach it.
11570
+ *
11571
+ * See `RuntimeStateDurability`. Enforced by
11572
+ * `scripts/check-runtime-state-durability.ts`.
11573
+ */
11574
+ durability: "session",
11575
+ methods: {
11576
+ /**
11577
+ * What this device can emit. Empty is a valid and common answer — most
11578
+ * cameras have nothing to offer here, and an empty list is what makes the
11579
+ * broker's picker show nothing rather than a false choice.
11580
+ */
11581
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11582
+ };
11488
11583
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11489
11584
  var StreamFormatSchema = _enum([
11490
11585
  "webrtc",
@@ -11881,6 +11976,22 @@ var EgressTranscodeSchema = object({
11881
11976
  camStreamId: string().nullable()
11882
11977
  });
11883
11978
  method(object({
11979
+ deviceId: number().int().nonnegative(),
11980
+ /** The provider's signal code. */
11981
+ code: string().min(1),
11982
+ /** Ms epoch. Absent ⇒ now. */
11983
+ at: number().optional()
11984
+ }), object({
11985
+ /** Whether the broker acted on it, and if not, why. */
11986
+ accepted: boolean(),
11987
+ reason: _enum([
11988
+ "woke",
11989
+ "hold-extended",
11990
+ "not-enabled",
11991
+ "no-consumer",
11992
+ "unknown-code"
11993
+ ])
11994
+ }), { kind: "mutation" }), method(object({
11884
11995
  deviceId: number().int().nonnegative(),
11885
11996
  camStreamId: string().min(1),
11886
11997
  kind: CamStreamKindSchema,
@@ -12135,6 +12246,16 @@ var PickStreamRequirementsSchema = object({
12135
12246
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12136
12247
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12137
12248
  minHeight: number().int().positive().optional(),
12249
+ /**
12250
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12251
+ *
12252
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12253
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12254
+ * Without this the ceiling had to be re-implemented by every caller — and
12255
+ * one caller implementing it privately is how a second scoring authority
12256
+ * gets born.
12257
+ */
12258
+ maxHeight: number().int().positive().optional(),
12138
12259
  /** Minimum horizontal resolution. */
12139
12260
  minWidth: number().int().positive().optional(),
12140
12261
  /**
@@ -12151,7 +12272,22 @@ var PickStreamRequirementsSchema = object({
12151
12272
  * transcoded" guard: if the device is already serving the consumer's
12152
12273
  * codec end-to-end, there's nothing to optimise.
12153
12274
  */
12154
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12275
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12276
+ /**
12277
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12278
+ * understanding that it will be transcoded.
12279
+ *
12280
+ * Default `false` — today's behaviour, and the right one for a bypass
12281
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12282
+ * ask the larger question: "what is the best stream for me, transcoding if
12283
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12284
+ * does not, so a passthrough is never lost to a transcode; the answer says
12285
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12286
+ *
12287
+ * This is what lets one picker serve both the bypass and the full source
12288
+ * choice, instead of a consumer scoring privately when the bypass misses.
12289
+ */
12290
+ allowTranscode: boolean().optional()
12155
12291
  }).readonly();
12156
12292
  var PickStreamPreferencesSchema = object({
12157
12293
  /**
@@ -12165,12 +12301,32 @@ var PickStreamPreferencesSchema = object({
12165
12301
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12166
12302
  * memory-constrained consumers / Apple Home guest sessions).
12167
12303
  */
12168
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12304
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12305
+ /**
12306
+ * The height the consumer actually wants to DELIVER.
12307
+ *
12308
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12309
+ * above the target wins, and only if nothing reaches it does the tallest
12310
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12311
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12312
+ * express that: it says "as big as possible", which is a different wish.
12313
+ *
12314
+ * Ignored when absent, so every existing caller keeps its ordering.
12315
+ */
12316
+ targetHeight: number().int().positive().optional()
12169
12317
  }).readonly();
12170
12318
  var PickedCamStreamSchema = object({
12171
12319
  camStreamId: string(),
12172
12320
  codec: string().optional(),
12173
12321
  resolution: CamStreamResolutionSchema.optional(),
12322
+ /**
12323
+ * Whether serving this stream requires a decode + re-encode.
12324
+ *
12325
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12326
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12327
+ * not ask cannot be handed a cost it never agreed to pay.
12328
+ */
12329
+ transcodes: boolean(),
12174
12330
  /** One-line explanation of why this stream won — for logs / debug UI. */
12175
12331
  reason: string()
12176
12332
  });
@@ -16687,6 +16843,8 @@ var NcSystemEventKindSchema = _enum([
16687
16843
  "device-enabled",
16688
16844
  "device-battery-low",
16689
16845
  "device-battery-normal",
16846
+ "device-consumable-low",
16847
+ "device-consumable-normal",
16690
16848
  "stream-online",
16691
16849
  "stream-offline",
16692
16850
  "node-online",
@@ -16705,6 +16863,7 @@ var NcSystemEventKindSchema = _enum([
16705
16863
  "addon-updated",
16706
16864
  "server-updated",
16707
16865
  "export-completed",
16866
+ "backup-completed",
16708
16867
  "camera-online",
16709
16868
  "camera-offline",
16710
16869
  "camera-disabled",
@@ -18027,6 +18186,48 @@ var NcAlarmConfigSchema = object({
18027
18186
  settings: NcAlarmSettingsSchema,
18028
18187
  coverage: array(NcAlarmModeCoverageSchema)
18029
18188
  });
18189
+ /**
18190
+ * ONE rule's demand on ONE camera's clip ring.
18191
+ *
18192
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18193
+ * camera, so the answer stays a faithful description of the rules and the
18194
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18195
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18196
+ * a different thing from never having been told, and only the envelope
18197
+ * (`rulesLoaded`) can tell those apart.
18198
+ */
18199
+ var NcClipRetentionAskSchema = object({
18200
+ /**
18201
+ * The camera this ask is about. **Absent = every camera**, which is what a
18202
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18203
+ * asking everywhere.
18204
+ */
18205
+ deviceId: number().int().nonnegative().optional(),
18206
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18207
+ * needs nothing produces no ask at all. */
18208
+ seconds: number().min(0).max(60),
18209
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18210
+ * assigned, which is what the cut defaults to. */
18211
+ profile: CamProfileSchema.optional(),
18212
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18213
+ ruleId: string(),
18214
+ ruleName: string(),
18215
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18216
+ reason: _enum(["window", "occupancy"])
18217
+ });
18218
+ /**
18219
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18220
+ *
18221
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18222
+ * once. A centre that is up but has not read its rules yet answers with an
18223
+ * empty ask list that means nothing at all — applying it would drop every
18224
+ * camera's ring to zero for the first events after a restart, which is the
18225
+ * footage this mechanism exists to keep.
18226
+ */
18227
+ var NcClipRetentionPlanSchema = object({
18228
+ rulesLoaded: boolean(),
18229
+ asks: array(NcClipRetentionAskSchema).readonly()
18230
+ });
18030
18231
  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 }), {
18031
18232
  kind: "mutation",
18032
18233
  auth: "admin",
@@ -18047,7 +18248,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18047
18248
  }), object({ success: literal(true) }), {
18048
18249
  kind: "mutation",
18049
18250
  auth: "admin"
18050
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18251
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18051
18252
  deviceId: number().int(),
18052
18253
  muted: boolean()
18053
18254
  }), object({ success: literal(true) }), {
@@ -20621,6 +20822,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20621
20822
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20622
20823
  framesMatched: number().int()
20623
20824
  })).readonly() });
20825
+ /**
20826
+ * The long-term series a camera produces. A closed union so a typo cannot
20827
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20828
+ * is an alias of this, not a second list.
20829
+ */
20830
+ var AnalyticsLtsSeriesSchema = _enum([
20831
+ "motion",
20832
+ "audio-dbfs",
20833
+ "battery",
20834
+ "occupancy"
20835
+ ]);
20836
+ /**
20837
+ * One closed 5-minute bucket of a long-term series.
20838
+ *
20839
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20840
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20841
+ * that exists at all was measured; a bucket that is absent was not, which is a
20842
+ * different claim from zero and the reason this is a sparse series.
20843
+ */
20844
+ var LtsBucketSchema = object({
20845
+ scope: string(),
20846
+ bucketStart: number().int(),
20847
+ samples: number().int().nonnegative(),
20848
+ sum: number(),
20849
+ min: number(),
20850
+ max: number()
20851
+ });
20624
20852
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20625
20853
  deviceId: number(),
20626
20854
  trackId: string()
@@ -20667,6 +20895,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20667
20895
  kinds: array(string()).optional(),
20668
20896
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20669
20897
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20898
+ deviceId: number(),
20899
+ series: AnalyticsLtsSeriesSchema,
20900
+ /** Omit for EVERY scope of this series in the range. */
20901
+ scope: string().optional(),
20902
+ from: number(),
20903
+ to: number(),
20904
+ limit: number().int().positive().optional()
20905
+ }), array(LtsBucketSchema).readonly()), method(object({
20670
20906
  deviceId: number(),
20671
20907
  since: number(),
20672
20908
  until: number(),
@@ -21285,6 +21521,14 @@ var MotionSourceEnum = _enum([
21285
21521
  */
21286
21522
  var MotionSourcesSchema = array(MotionSourceEnum);
21287
21523
  /**
21524
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21525
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21526
+ * than a second spelling of the same two ideas — the value an operator picks
21527
+ * here is the value that comes back on the track, the overlay and the debug
21528
+ * row.
21529
+ */
21530
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21531
+ /**
21288
21532
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21289
21533
  * so cap-side consumers (the orchestrator forward, the runner addon's
21290
21534
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21435,6 +21679,35 @@ var RunnerCameraConfigSchema = object({
21435
21679
  * events; the orchestrator forwards to `reportMotion`.
21436
21680
  */
21437
21681
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21682
+ /**
21683
+ * WHICH root detector runs for this camera. The detection counterpart of
21684
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21685
+ * of sources the system understands, vendor-agnostic, owned here.
21686
+ *
21687
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21688
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21689
+ * here. Its boxes reach post-analysis on the same
21690
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21691
+ * track gets the same tracker, the same overlay and the same detail
21692
+ * subtree (face / plate / embedding).
21693
+ *
21694
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21695
+ * run, and that is where a camera with a usable onboard detector buys back
21696
+ * its share of the accelerator. It saves the root inference, not the decode
21697
+ * — the detail subtree still needs pixels to cut crops from.
21698
+ *
21699
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21700
+ * step at all (there is nothing to track), and the cap that knows this says
21701
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21702
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21703
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21704
+ * worth exactly what it already is — a wake signal with a class.
21705
+ *
21706
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21707
+ * vendor never turns a detector on for the operator, and neither does a
21708
+ * default.
21709
+ */
21710
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21438
21711
  pipelineEnabled: boolean().default(true),
21439
21712
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21440
21713
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21616,7 +21889,47 @@ var RunnerLocalMetricsSchema = object({
21616
21889
  queueDepth: number(),
21617
21890
  frameLazy: FrameLazyMetricsSchema.optional()
21618
21891
  });
21892
+ /**
21893
+ * Pipeline Runner capability — runtime detection workhorse.
21894
+ *
21895
+ * One instance per node. Receives camera assignments from
21896
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21897
+ * decoded frames, drains motion + detection queues, calls the local
21898
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21899
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21900
+ * the bus.
21901
+ *
21902
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21903
+ * runner has zero knowledge of other agents, no global state, and never
21904
+ * makes assignment decisions itself.
21905
+ */
21906
+ /**
21907
+ * Why a runner declined to look at a camera out of band. Named rather than a
21908
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21909
+ * already mid-session and one already bursting are four different facts, and a
21910
+ * caller told only "no" cannot tell a protection from a bug.
21911
+ */
21912
+ var OccupancyBurstRefusalSchema = _enum([
21913
+ "not-attached",
21914
+ "battery-asleep",
21915
+ "not-watching",
21916
+ "already-bursting"
21917
+ ]);
21619
21918
  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({
21919
+ deviceId: number(),
21920
+ /** How many frames to collect. The caller sizes this against what its
21921
+ * own confirmation needs; the runner clamps it to the field's range. */
21922
+ frames: number().int().positive().optional(),
21923
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21924
+ * defend — the periodic one at least has a timer to point at. */
21925
+ reason: string()
21926
+ }), object({
21927
+ started: boolean(),
21928
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21929
+ }), {
21930
+ auth: "admin",
21931
+ kind: "mutation"
21932
+ }), method(object({
21620
21933
  handle: FrameHandleSchema,
21621
21934
  bbox: NativeCropBboxSchema,
21622
21935
  maxWidth: number().int().positive().optional(),
@@ -24090,10 +24403,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24090
24403
  }), boolean()), method(object({
24091
24404
  deviceId: number().int().nonnegative(),
24092
24405
  sessionId: string()
24093
- }), object({ pendingRenegotiation: object({
24094
- target: WebrtcStreamTargetSchema,
24095
- epoch: number()
24096
- }).nullable() }));
24406
+ }), object({
24407
+ pendingRenegotiation: object({
24408
+ target: WebrtcStreamTargetSchema,
24409
+ epoch: number()
24410
+ }).nullable(),
24411
+ /**
24412
+ * Whether the session still EXISTS.
24413
+ *
24414
+ * A consumer that holds a resource for the life of a session needs to
24415
+ * be able to ask, because a session does not always end the way it
24416
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24417
+ * sent `SessionDisconnected`, so the Alexa exporter's
24418
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24419
+ * H.264 transcode kept running for NOBODY for more than twenty
24420
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24421
+ * minutes earlier — the broker knew; the holder had no way to ask.
24422
+ *
24423
+ * `false` for a session id the provider has never heard of, which is
24424
+ * the same answer as "it ended": either way nothing is holding it up.
24425
+ */
24426
+ alive: boolean()
24427
+ }));
24097
24428
  object({
24098
24429
  /** All accessory children of the parent. */
24099
24430
  childDeviceIds: array(number()).readonly(),
@@ -28557,11 +28888,46 @@ var NativeObjectDetectionStatusSchema = object({
28557
28888
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28558
28889
  /**
28559
28890
  * Whether forwarding of onboard AI detections is enabled for this device.
28560
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28561
- * churn the tracker, so forwarding stays off until the operator enables it.
28891
+ *
28892
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28893
+ * camera runs — that is the operator's choice, and it is made where every
28894
+ * other detection choice is made. `geometry` on
28895
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28896
+ * choice would buy this particular camera.
28562
28897
  */
28563
28898
  enabled: boolean()
28564
28899
  });
28900
+ /**
28901
+ * WHEN a camera's onboard detections carry geometry.
28902
+ *
28903
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28904
+ * a detection is a trackable subject whenever the camera sees one.
28905
+ * - `while-streaming` — only while some stream of this camera is already open.
28906
+ * The boxes ride the video's own side-channel rather than a feed of their
28907
+ * own, so they cost nothing and they exist only when something is pulling.
28908
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28909
+ * radio drain, but a camera that is awake is awake precisely because
28910
+ * something is in front of it, and its stream is already being pulled.
28911
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28912
+ * pipeline needs geometry to make a subject, so such a push reaches the
28913
+ * tracker as motion and no further.
28914
+ *
28915
+ * Reported and not inferred, because the operator's question in front of the
28916
+ * picker is "what do I get", and these are three different answers (D14: the
28917
+ * derived form is only as honest as `getOptions`).
28918
+ */
28919
+ var NativeObjectGeometryEnum = _enum([
28920
+ "boxed",
28921
+ "while-streaming",
28922
+ "flag-only"
28923
+ ]);
28924
+ var NativeObjectDetectionOptionsSchema = object({
28925
+ /** Classes this firmware can detect — the same list the status reports. */
28926
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28927
+ /** What a detection from this camera carries. */
28928
+ geometry: NativeObjectGeometryEnum
28929
+ });
28930
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28565
28931
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28566
28932
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28567
28933
  lastFetchedAt: number() });
@@ -28571,13 +28937,23 @@ var nativeObjectDetectionCapability = {
28571
28937
  deviceNative: true,
28572
28938
  mode: "singleton",
28573
28939
  deviceTypes: [DeviceType.Camera],
28574
- methods: { setEnabled: method(object({
28575
- deviceId: number(),
28576
- enabled: boolean()
28577
- }), _void(), {
28578
- kind: "mutation",
28579
- auth: "admin"
28580
- }) },
28940
+ methods: {
28941
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28942
+ setSettings: method(object({
28943
+ deviceId: number(),
28944
+ settings: NativeObjectDetectionSettingsPatchSchema
28945
+ }), _void(), {
28946
+ kind: "mutation",
28947
+ auth: "admin"
28948
+ }),
28949
+ setEnabled: method(object({
28950
+ deviceId: number(),
28951
+ enabled: boolean()
28952
+ }), _void(), {
28953
+ kind: "mutation",
28954
+ auth: "admin"
28955
+ })
28956
+ },
28581
28957
  events: { onDetected: { data: object({
28582
28958
  deviceId: number(),
28583
28959
  detection: NativeDetectionSchema
@@ -33731,7 +34107,28 @@ var PerScopeBreakdownSchema = object({
33731
34107
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33732
34108
  totalObjects: number().int().nonnegative(),
33733
34109
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33734
- byClass: record(string(), number().int().nonnegative())
34110
+ byClass: record(string(), number().int().nonnegative()),
34111
+ /**
34112
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
34113
+ * present but not going anywhere (a parked car, a bin, a statue).
34114
+ *
34115
+ * The operator's question about a scene has two halves and they answer
34116
+ * different things: "what is parked here" is stable for hours and must not
34117
+ * flap, while "who is walking through" is the thing an alert is about. One
34118
+ * number could only serve one of them, and `totalObjects` served the first
34119
+ * badly — a passer-by moved it and every occupancy rule saw a change.
34120
+ *
34121
+ * `standing + transient === totalObjects`, always. The total keeps its old
34122
+ * meaning exactly, so no rule written against it changes behaviour.
34123
+ *
34124
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
34125
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
34126
+ * parked objects here" about a camera whose lot is full.
34127
+ */
34128
+ standingObjects: number().int().nonnegative().optional(),
34129
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
34130
+ * same absence rule. */
34131
+ transientObjects: number().int().nonnegative().optional()
33735
34132
  });
33736
34133
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33737
34134
  zoneId: string(),
@@ -33854,6 +34251,23 @@ var HistoryPointSchema = object({
33854
34251
  * triple covers the three spatial scopes (per-zone, frame-wide,
33855
34252
  * outside-any-zone). Crossing them with `className?` gives the full
33856
34253
  * combinatorial coverage the operator UI requested.
34254
+ *
34255
+ * ## ⚠️ The three history methods are DEPRECATED
34256
+ *
34257
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34258
+ * so after a restart they report nothing about a night that did happen, and any
34259
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34260
+ * an empty scene. The presets in the occupancy chart existed to hide that
34261
+ * horizon rather than to answer a question.
34262
+ *
34263
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34264
+ * instead. Those rows are already written for every camera, ~60 bytes per
34265
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34266
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34267
+ * function the writer uses, so the two cannot drift.
34268
+ *
34269
+ * The ring stays until these three go, and it is the only thing left reading
34270
+ * it. Do not add a fourth caller.
33857
34271
  */
33858
34272
  var zoneAnalyticsCapability = {
33859
34273
  name: "zone-analytics",
@@ -34343,6 +34757,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34343
34757
  smoke: smokeCapability,
34344
34758
  streamCatalog: streamCatalogCapability,
34345
34759
  streamParams: streamParamsCapability,
34760
+ streamSignals: streamSignalsCapability,
34346
34761
  switch: switchCapability,
34347
34762
  tamper: tamperCapability,
34348
34763
  temperatureSensor: temperatureSensorCapability,
@@ -38458,12 +38873,24 @@ Object.freeze({
38458
38873
  addonId: null,
38459
38874
  access: "create"
38460
38875
  },
38876
+ "nativeObjectDetection.getOptions": {
38877
+ capName: "native-object-detection",
38878
+ capScope: "device",
38879
+ addonId: null,
38880
+ access: "view"
38881
+ },
38461
38882
  "nativeObjectDetection.setEnabled": {
38462
38883
  capName: "native-object-detection",
38463
38884
  capScope: "device",
38464
38885
  addonId: null,
38465
38886
  access: "create"
38466
38887
  },
38888
+ "nativeObjectDetection.setSettings": {
38889
+ capName: "native-object-detection",
38890
+ capScope: "device",
38891
+ addonId: null,
38892
+ access: "create"
38893
+ },
38467
38894
  "navigation.getFeatures": {
38468
38895
  capName: "navigation",
38469
38896
  capScope: "device",
@@ -38728,6 +39155,12 @@ Object.freeze({
38728
39155
  addonId: null,
38729
39156
  access: "view"
38730
39157
  },
39158
+ "notificationRules.getClipRetentionAsks": {
39159
+ capName: "notification-rules",
39160
+ capScope: "system",
39161
+ addonId: null,
39162
+ access: "view"
39163
+ },
38731
39164
  "notificationRules.getConditionCatalog": {
38732
39165
  capName: "notification-rules",
38733
39166
  capScope: "system",
@@ -39238,6 +39671,12 @@ Object.freeze({
39238
39671
  addonId: null,
39239
39672
  access: "create"
39240
39673
  },
39674
+ "pipelineAnalytics.readLongTermSeries": {
39675
+ capName: "pipeline-analytics",
39676
+ capScope: "device",
39677
+ addonId: null,
39678
+ access: "view"
39679
+ },
39241
39680
  "pipelineAnalytics.rebuildObjectEmbeddings": {
39242
39681
  capName: "pipeline-analytics",
39243
39682
  capScope: "device",
@@ -39910,6 +40349,12 @@ Object.freeze({
39910
40349
  addonId: null,
39911
40350
  access: "create"
39912
40351
  },
40352
+ "pipelineRunner.requestOccupancyBurst": {
40353
+ capName: "pipeline-runner",
40354
+ capScope: "system",
40355
+ addonId: null,
40356
+ access: "create"
40357
+ },
39913
40358
  "pipelineRunner.runDetailSubtree": {
39914
40359
  capName: "pipeline-runner",
39915
40360
  capScope: "system",
@@ -41122,6 +41567,12 @@ Object.freeze({
41122
41567
  addonId: null,
41123
41568
  access: "create"
41124
41569
  },
41570
+ "streamBroker.reportStreamSignal": {
41571
+ capName: "stream-broker",
41572
+ capScope: "system",
41573
+ addonId: null,
41574
+ access: "create"
41575
+ },
41125
41576
  "streamBroker.restartProfile": {
41126
41577
  capName: "stream-broker",
41127
41578
  capScope: "system",
@@ -41206,6 +41657,12 @@ Object.freeze({
41206
41657
  addonId: null,
41207
41658
  access: "create"
41208
41659
  },
41660
+ "streamSignals.listSignals": {
41661
+ capName: "stream-signals",
41662
+ capScope: "device",
41663
+ addonId: null,
41664
+ access: "view"
41665
+ },
41209
41666
  "switch.setState": {
41210
41667
  capName: "switch",
41211
41668
  capScope: "device",
@@ -42678,11 +43135,21 @@ Object.freeze({
42678
43135
  form: "single",
42679
43136
  optional: false
42680
43137
  }],
43138
+ "nativeObjectDetection.getOptions": [{
43139
+ name: "deviceId",
43140
+ form: "single",
43141
+ optional: false
43142
+ }],
42681
43143
  "nativeObjectDetection.setEnabled": [{
42682
43144
  name: "deviceId",
42683
43145
  form: "single",
42684
43146
  optional: false
42685
43147
  }],
43148
+ "nativeObjectDetection.setSettings": [{
43149
+ name: "deviceId",
43150
+ form: "single",
43151
+ optional: false
43152
+ }],
42686
43153
  "navigation.getFeatures": [{
42687
43154
  name: "deviceId",
42688
43155
  form: "single",
@@ -43032,6 +43499,11 @@ Object.freeze({
43032
43499
  form: "single",
43033
43500
  optional: false
43034
43501
  }],
43502
+ "pipelineAnalytics.readLongTermSeries": [{
43503
+ name: "deviceId",
43504
+ form: "single",
43505
+ optional: false
43506
+ }],
43035
43507
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
43036
43508
  name: "deviceId",
43037
43509
  form: "single",
@@ -43222,6 +43694,11 @@ Object.freeze({
43222
43694
  form: "single",
43223
43695
  optional: false
43224
43696
  }],
43697
+ "pipelineRunner.requestOccupancyBurst": [{
43698
+ name: "deviceId",
43699
+ form: "single",
43700
+ optional: false
43701
+ }],
43225
43702
  "pipelineRunner.runDetailSubtree": [{
43226
43703
  name: "deviceId",
43227
43704
  form: "single",
@@ -43578,6 +44055,11 @@ Object.freeze({
43578
44055
  form: "single",
43579
44056
  optional: false
43580
44057
  }],
44058
+ "streamBroker.reportStreamSignal": [{
44059
+ name: "deviceId",
44060
+ form: "single",
44061
+ optional: false
44062
+ }],
43581
44063
  "streamBroker.restartProfile": [{
43582
44064
  name: "deviceId",
43583
44065
  form: "single",