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