@camstack/addon-provider-hikvision 1.2.109 → 1.2.111

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 +513 -31
  2. package/dist/addon.mjs +513 -31
  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).
@@ -7238,6 +7252,18 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7238
7252
  DeviceRole["GenericNotifier"] = "generic-notifier";
7239
7253
  return DeviceRole;
7240
7254
  }({});
7255
+ function deviceCustomAction(input, output, options) {
7256
+ return {
7257
+ input,
7258
+ output,
7259
+ kind: options?.kind ?? "query",
7260
+ auth: options?.auth ?? "protected",
7261
+ scope: {
7262
+ kind: "device",
7263
+ ...options?.deviceTypes ? { deviceTypes: options.deviceTypes } : {}
7264
+ }
7265
+ };
7266
+ }
7241
7267
  var StaticDirOutputSchema = object({ staticDir: string() });
7242
7268
  var VersionOutputSchema = object({ version: string() });
7243
7269
  method(_void(), StaticDirOutputSchema, { auth: "admin" }), method(_void(), VersionOutputSchema, { auth: "admin" });
@@ -11766,6 +11792,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11766
11792
  auth: "admin"
11767
11793
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11768
11794
  DeviceType.Camera;
11795
+ /**
11796
+ * The signals a device can emit to WAKE its own stream.
11797
+ *
11798
+ * A camera whose stream is built on demand sleeps until something asks for it,
11799
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11800
+ * puller holds a session open for ever, and treating that as demand would keep
11801
+ * a battery camera awake for ever, which is the whole thing the battery is for
11802
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11803
+ * itself, with no stream running.
11804
+ *
11805
+ * ## The vocabulary is the PROVIDER'S, not ours
11806
+ *
11807
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11808
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11809
+ * Reolink offers motion and camera-native detection; another provider may offer
11810
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11811
+ * yet. A fixed enum here would mean every new signal is a framework release.
11812
+ *
11813
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11814
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11815
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11816
+ * binding — but both answer "what drives the detection pipeline", which is a
11817
+ * different question from "what may wake a sleeping stream". A camera can do
11818
+ * the first and not be trusted with the second, and the operator picks per
11819
+ * camera. Two questions, two authorities.
11820
+ *
11821
+ * ## Availability is not permission
11822
+ *
11823
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11824
+ * wakes the stream is the operator's per-camera choice, held by the broker
11825
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11826
+ * provider declaring a signal is not a provider enabling it.
11827
+ */
11828
+ /** One signal a device can emit. */
11829
+ var StreamSignalSchema = object({
11830
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11831
+ code: string().min(1),
11832
+ /** What an operator reads in the picker. The provider's own wording. */
11833
+ label: string().min(1),
11834
+ /**
11835
+ * Whether the provider recommends this signal ON when a camera is first set
11836
+ * up. A provider knows which of its signals are cheap and reliable; an
11837
+ * operator should not have to discover that by trial. Reolink recommends
11838
+ * both of its own.
11839
+ */
11840
+ recommended: boolean()
11841
+ });
11842
+ var StreamSignalsStatusSchema = object({
11843
+ signals: array(StreamSignalSchema),
11844
+ lastFetchedAt: number()
11845
+ });
11846
+ var streamSignalsCapability = {
11847
+ name: "stream-signals",
11848
+ scope: "device",
11849
+ deviceNative: true,
11850
+ mode: "singleton",
11851
+ deviceTypes: Object.values(DeviceType),
11852
+ runtimeState: StreamSignalsStatusSchema,
11853
+ /**
11854
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11855
+ *
11856
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11857
+ * not an operator choice: the provider re-declares it on every registration,
11858
+ * so losing it loses nothing and persisting it would freeze an answer the
11859
+ * camera is entitled to change. Measured the same day on the sibling case —
11860
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11861
+ * class the camera really detected stayed missing for the life of the row
11862
+ * because the fix could not reach it.
11863
+ *
11864
+ * See `RuntimeStateDurability`. Enforced by
11865
+ * `scripts/check-runtime-state-durability.ts`.
11866
+ */
11867
+ durability: "session",
11868
+ methods: {
11869
+ /**
11870
+ * What this device can emit. Empty is a valid and common answer — most
11871
+ * cameras have nothing to offer here, and an empty list is what makes the
11872
+ * broker's picker show nothing rather than a false choice.
11873
+ */
11874
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11875
+ };
11769
11876
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11770
11877
  var StreamFormatSchema = _enum([
11771
11878
  "webrtc",
@@ -12162,6 +12269,22 @@ var EgressTranscodeSchema = object({
12162
12269
  camStreamId: string().nullable()
12163
12270
  });
12164
12271
  method(object({
12272
+ deviceId: number().int().nonnegative(),
12273
+ /** The provider's signal code. */
12274
+ code: string().min(1),
12275
+ /** Ms epoch. Absent ⇒ now. */
12276
+ at: number().optional()
12277
+ }), object({
12278
+ /** Whether the broker acted on it, and if not, why. */
12279
+ accepted: boolean(),
12280
+ reason: _enum([
12281
+ "woke",
12282
+ "hold-extended",
12283
+ "not-enabled",
12284
+ "no-consumer",
12285
+ "unknown-code"
12286
+ ])
12287
+ }), { kind: "mutation" }), method(object({
12165
12288
  deviceId: number().int().nonnegative(),
12166
12289
  camStreamId: string().min(1),
12167
12290
  kind: CamStreamKindSchema,
@@ -12416,6 +12539,16 @@ var PickStreamRequirementsSchema = object({
12416
12539
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12417
12540
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12418
12541
  minHeight: number().int().positive().optional(),
12542
+ /**
12543
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12544
+ *
12545
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12546
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12547
+ * Without this the ceiling had to be re-implemented by every caller — and
12548
+ * one caller implementing it privately is how a second scoring authority
12549
+ * gets born.
12550
+ */
12551
+ maxHeight: number().int().positive().optional(),
12419
12552
  /** Minimum horizontal resolution. */
12420
12553
  minWidth: number().int().positive().optional(),
12421
12554
  /**
@@ -12432,7 +12565,22 @@ var PickStreamRequirementsSchema = object({
12432
12565
  * transcoded" guard: if the device is already serving the consumer's
12433
12566
  * codec end-to-end, there's nothing to optimise.
12434
12567
  */
12435
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12568
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12569
+ /**
12570
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12571
+ * understanding that it will be transcoded.
12572
+ *
12573
+ * Default `false` — today's behaviour, and the right one for a bypass
12574
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12575
+ * ask the larger question: "what is the best stream for me, transcoding if
12576
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12577
+ * does not, so a passthrough is never lost to a transcode; the answer says
12578
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12579
+ *
12580
+ * This is what lets one picker serve both the bypass and the full source
12581
+ * choice, instead of a consumer scoring privately when the bypass misses.
12582
+ */
12583
+ allowTranscode: boolean().optional()
12436
12584
  }).readonly();
12437
12585
  var PickStreamPreferencesSchema = object({
12438
12586
  /**
@@ -12446,12 +12594,32 @@ var PickStreamPreferencesSchema = object({
12446
12594
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12447
12595
  * memory-constrained consumers / Apple Home guest sessions).
12448
12596
  */
12449
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12597
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12598
+ /**
12599
+ * The height the consumer actually wants to DELIVER.
12600
+ *
12601
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12602
+ * above the target wins, and only if nothing reaches it does the tallest
12603
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12604
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12605
+ * express that: it says "as big as possible", which is a different wish.
12606
+ *
12607
+ * Ignored when absent, so every existing caller keeps its ordering.
12608
+ */
12609
+ targetHeight: number().int().positive().optional()
12450
12610
  }).readonly();
12451
12611
  var PickedCamStreamSchema = object({
12452
12612
  camStreamId: string(),
12453
12613
  codec: string().optional(),
12454
12614
  resolution: CamStreamResolutionSchema.optional(),
12615
+ /**
12616
+ * Whether serving this stream requires a decode + re-encode.
12617
+ *
12618
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12619
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12620
+ * not ask cannot be handed a cost it never agreed to pay.
12621
+ */
12622
+ transcodes: boolean(),
12455
12623
  /** One-line explanation of why this stream won — for logs / debug UI. */
12456
12624
  reason: string()
12457
12625
  });
@@ -12670,18 +12838,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
12670
12838
  filePath: string(),
12671
12839
  content: string()
12672
12840
  })) }), { auth: "admin" });
12673
- function deviceCustomAction(input, output, options) {
12674
- return {
12675
- input,
12676
- output,
12677
- kind: options?.kind ?? "query",
12678
- auth: options?.auth ?? "protected",
12679
- scope: {
12680
- kind: "device",
12681
- ...options?.deviceTypes ? { deviceTypes: options.deviceTypes } : {}
12682
- }
12683
- };
12684
- }
12685
12841
  /**
12686
12842
  * `custom-model-registry` — collection cap exposing operator-registered
12687
12843
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -16999,6 +17155,8 @@ var NcSystemEventKindSchema = _enum([
16999
17155
  "device-enabled",
17000
17156
  "device-battery-low",
17001
17157
  "device-battery-normal",
17158
+ "device-consumable-low",
17159
+ "device-consumable-normal",
17002
17160
  "stream-online",
17003
17161
  "stream-offline",
17004
17162
  "node-online",
@@ -17017,6 +17175,7 @@ var NcSystemEventKindSchema = _enum([
17017
17175
  "addon-updated",
17018
17176
  "server-updated",
17019
17177
  "export-completed",
17178
+ "backup-completed",
17020
17179
  "camera-online",
17021
17180
  "camera-offline",
17022
17181
  "camera-disabled",
@@ -18339,6 +18498,48 @@ var NcAlarmConfigSchema = object({
18339
18498
  settings: NcAlarmSettingsSchema,
18340
18499
  coverage: array(NcAlarmModeCoverageSchema)
18341
18500
  });
18501
+ /**
18502
+ * ONE rule's demand on ONE camera's clip ring.
18503
+ *
18504
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18505
+ * camera, so the answer stays a faithful description of the rules and the
18506
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18507
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18508
+ * a different thing from never having been told, and only the envelope
18509
+ * (`rulesLoaded`) can tell those apart.
18510
+ */
18511
+ var NcClipRetentionAskSchema = object({
18512
+ /**
18513
+ * The camera this ask is about. **Absent = every camera**, which is what a
18514
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18515
+ * asking everywhere.
18516
+ */
18517
+ deviceId: number().int().nonnegative().optional(),
18518
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18519
+ * needs nothing produces no ask at all. */
18520
+ seconds: number().min(0).max(60),
18521
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18522
+ * assigned, which is what the cut defaults to. */
18523
+ profile: CamProfileSchema.optional(),
18524
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18525
+ ruleId: string(),
18526
+ ruleName: string(),
18527
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18528
+ reason: _enum(["window", "occupancy"])
18529
+ });
18530
+ /**
18531
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18532
+ *
18533
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18534
+ * once. A centre that is up but has not read its rules yet answers with an
18535
+ * empty ask list that means nothing at all — applying it would drop every
18536
+ * camera's ring to zero for the first events after a restart, which is the
18537
+ * footage this mechanism exists to keep.
18538
+ */
18539
+ var NcClipRetentionPlanSchema = object({
18540
+ rulesLoaded: boolean(),
18541
+ asks: array(NcClipRetentionAskSchema).readonly()
18542
+ });
18342
18543
  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 }), {
18343
18544
  kind: "mutation",
18344
18545
  auth: "admin",
@@ -18359,7 +18560,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18359
18560
  }), object({ success: literal(true) }), {
18360
18561
  kind: "mutation",
18361
18562
  auth: "admin"
18362
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18563
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18363
18564
  deviceId: number().int(),
18364
18565
  muted: boolean()
18365
18566
  }), object({ success: literal(true) }), {
@@ -20933,6 +21134,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20933
21134
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20934
21135
  framesMatched: number().int()
20935
21136
  })).readonly() });
21137
+ /**
21138
+ * The long-term series a camera produces. A closed union so a typo cannot
21139
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21140
+ * is an alias of this, not a second list.
21141
+ */
21142
+ var AnalyticsLtsSeriesSchema = _enum([
21143
+ "motion",
21144
+ "audio-dbfs",
21145
+ "battery",
21146
+ "occupancy"
21147
+ ]);
21148
+ /**
21149
+ * One closed 5-minute bucket of a long-term series.
21150
+ *
21151
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21152
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21153
+ * that exists at all was measured; a bucket that is absent was not, which is a
21154
+ * different claim from zero and the reason this is a sparse series.
21155
+ */
21156
+ var LtsBucketSchema = object({
21157
+ scope: string(),
21158
+ bucketStart: number().int(),
21159
+ samples: number().int().nonnegative(),
21160
+ sum: number(),
21161
+ min: number(),
21162
+ max: number()
21163
+ });
20936
21164
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20937
21165
  deviceId: number(),
20938
21166
  trackId: string()
@@ -20979,6 +21207,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20979
21207
  kinds: array(string()).optional(),
20980
21208
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20981
21209
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
21210
+ deviceId: number(),
21211
+ series: AnalyticsLtsSeriesSchema,
21212
+ /** Omit for EVERY scope of this series in the range. */
21213
+ scope: string().optional(),
21214
+ from: number(),
21215
+ to: number(),
21216
+ limit: number().int().positive().optional()
21217
+ }), array(LtsBucketSchema).readonly()), method(object({
20982
21218
  deviceId: number(),
20983
21219
  since: number(),
20984
21220
  until: number(),
@@ -21597,6 +21833,14 @@ var MotionSourceEnum = _enum([
21597
21833
  */
21598
21834
  var MotionSourcesSchema = array(MotionSourceEnum);
21599
21835
  /**
21836
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21837
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21838
+ * than a second spelling of the same two ideas — the value an operator picks
21839
+ * here is the value that comes back on the track, the overlay and the debug
21840
+ * row.
21841
+ */
21842
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21843
+ /**
21600
21844
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21601
21845
  * so cap-side consumers (the orchestrator forward, the runner addon's
21602
21846
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21747,6 +21991,35 @@ var RunnerCameraConfigSchema = object({
21747
21991
  * events; the orchestrator forwards to `reportMotion`.
21748
21992
  */
21749
21993
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21994
+ /**
21995
+ * WHICH root detector runs for this camera. The detection counterpart of
21996
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21997
+ * of sources the system understands, vendor-agnostic, owned here.
21998
+ *
21999
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
22000
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
22001
+ * here. Its boxes reach post-analysis on the same
22002
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
22003
+ * track gets the same tracker, the same overlay and the same detail
22004
+ * subtree (face / plate / embedding).
22005
+ *
22006
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
22007
+ * run, and that is where a camera with a usable onboard detector buys back
22008
+ * its share of the accelerator. It saves the root inference, not the decode
22009
+ * — the detail subtree still needs pixels to cut crops from.
22010
+ *
22011
+ * A camera whose onboard detections carry no geometry cannot serve as a root
22012
+ * step at all (there is nothing to track), and the cap that knows this says
22013
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
22014
+ * every battery camera: the boxes ride a sub-stream a battery camera never
22015
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
22016
+ * worth exactly what it already is — a wake signal with a class.
22017
+ *
22018
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
22019
+ * vendor never turns a detector on for the operator, and neither does a
22020
+ * default.
22021
+ */
22022
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21750
22023
  pipelineEnabled: boolean().default(true),
21751
22024
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21752
22025
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21928,7 +22201,47 @@ var RunnerLocalMetricsSchema = object({
21928
22201
  queueDepth: number(),
21929
22202
  frameLazy: FrameLazyMetricsSchema.optional()
21930
22203
  });
22204
+ /**
22205
+ * Pipeline Runner capability — runtime detection workhorse.
22206
+ *
22207
+ * One instance per node. Receives camera assignments from
22208
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22209
+ * decoded frames, drains motion + detection queues, calls the local
22210
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22211
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22212
+ * the bus.
22213
+ *
22214
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22215
+ * runner has zero knowledge of other agents, no global state, and never
22216
+ * makes assignment decisions itself.
22217
+ */
22218
+ /**
22219
+ * Why a runner declined to look at a camera out of band. Named rather than a
22220
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22221
+ * already mid-session and one already bursting are four different facts, and a
22222
+ * caller told only "no" cannot tell a protection from a bug.
22223
+ */
22224
+ var OccupancyBurstRefusalSchema = _enum([
22225
+ "not-attached",
22226
+ "battery-asleep",
22227
+ "not-watching",
22228
+ "already-bursting"
22229
+ ]);
21931
22230
  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({
22231
+ deviceId: number(),
22232
+ /** How many frames to collect. The caller sizes this against what its
22233
+ * own confirmation needs; the runner clamps it to the field's range. */
22234
+ frames: number().int().positive().optional(),
22235
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22236
+ * defend — the periodic one at least has a timer to point at. */
22237
+ reason: string()
22238
+ }), object({
22239
+ started: boolean(),
22240
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22241
+ }), {
22242
+ auth: "admin",
22243
+ kind: "mutation"
22244
+ }), method(object({
21932
22245
  handle: FrameHandleSchema,
21933
22246
  bbox: NativeCropBboxSchema,
21934
22247
  maxWidth: number().int().positive().optional(),
@@ -24402,10 +24715,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24402
24715
  }), boolean()), method(object({
24403
24716
  deviceId: number().int().nonnegative(),
24404
24717
  sessionId: string()
24405
- }), object({ pendingRenegotiation: object({
24406
- target: WebrtcStreamTargetSchema,
24407
- epoch: number()
24408
- }).nullable() }));
24718
+ }), object({
24719
+ pendingRenegotiation: object({
24720
+ target: WebrtcStreamTargetSchema,
24721
+ epoch: number()
24722
+ }).nullable(),
24723
+ /**
24724
+ * Whether the session still EXISTS.
24725
+ *
24726
+ * A consumer that holds a resource for the life of a session needs to
24727
+ * be able to ask, because a session does not always end the way it
24728
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24729
+ * sent `SessionDisconnected`, so the Alexa exporter's
24730
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24731
+ * H.264 transcode kept running for NOBODY for more than twenty
24732
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24733
+ * minutes earlier — the broker knew; the holder had no way to ask.
24734
+ *
24735
+ * `false` for a session id the provider has never heard of, which is
24736
+ * the same answer as "it ended": either way nothing is holding it up.
24737
+ */
24738
+ alive: boolean()
24739
+ }));
24409
24740
  object({
24410
24741
  /** All accessory children of the parent. */
24411
24742
  childDeviceIds: array(number()).readonly(),
@@ -28869,11 +29200,46 @@ var NativeObjectDetectionStatusSchema = object({
28869
29200
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28870
29201
  /**
28871
29202
  * Whether forwarding of onboard AI detections is enabled for this device.
28872
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28873
- * churn the tracker, so forwarding stays off until the operator enables it.
29203
+ *
29204
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
29205
+ * camera runs — that is the operator's choice, and it is made where every
29206
+ * other detection choice is made. `geometry` on
29207
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
29208
+ * choice would buy this particular camera.
28874
29209
  */
28875
29210
  enabled: boolean()
28876
29211
  });
29212
+ /**
29213
+ * WHEN a camera's onboard detections carry geometry.
29214
+ *
29215
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
29216
+ * a detection is a trackable subject whenever the camera sees one.
29217
+ * - `while-streaming` — only while some stream of this camera is already open.
29218
+ * The boxes ride the video's own side-channel rather than a feed of their
29219
+ * own, so they cost nothing and they exist only when something is pulling.
29220
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
29221
+ * radio drain, but a camera that is awake is awake precisely because
29222
+ * something is in front of it, and its stream is already being pulled.
29223
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
29224
+ * pipeline needs geometry to make a subject, so such a push reaches the
29225
+ * tracker as motion and no further.
29226
+ *
29227
+ * Reported and not inferred, because the operator's question in front of the
29228
+ * picker is "what do I get", and these are three different answers (D14: the
29229
+ * derived form is only as honest as `getOptions`).
29230
+ */
29231
+ var NativeObjectGeometryEnum = _enum([
29232
+ "boxed",
29233
+ "while-streaming",
29234
+ "flag-only"
29235
+ ]);
29236
+ var NativeObjectDetectionOptionsSchema = object({
29237
+ /** Classes this firmware can detect — the same list the status reports. */
29238
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
29239
+ /** What a detection from this camera carries. */
29240
+ geometry: NativeObjectGeometryEnum
29241
+ });
29242
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28877
29243
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28878
29244
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28879
29245
  lastFetchedAt: number() });
@@ -28883,13 +29249,23 @@ var nativeObjectDetectionCapability = {
28883
29249
  deviceNative: true,
28884
29250
  mode: "singleton",
28885
29251
  deviceTypes: [DeviceType.Camera],
28886
- methods: { setEnabled: method(object({
28887
- deviceId: number(),
28888
- enabled: boolean()
28889
- }), _void(), {
28890
- kind: "mutation",
28891
- auth: "admin"
28892
- }) },
29252
+ methods: {
29253
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29254
+ setSettings: method(object({
29255
+ deviceId: number(),
29256
+ settings: NativeObjectDetectionSettingsPatchSchema
29257
+ }), _void(), {
29258
+ kind: "mutation",
29259
+ auth: "admin"
29260
+ }),
29261
+ setEnabled: method(object({
29262
+ deviceId: number(),
29263
+ enabled: boolean()
29264
+ }), _void(), {
29265
+ kind: "mutation",
29266
+ auth: "admin"
29267
+ })
29268
+ },
28893
29269
  events: { onDetected: { data: object({
28894
29270
  deviceId: number(),
28895
29271
  detection: NativeDetectionSchema
@@ -34068,7 +34444,28 @@ var PerScopeBreakdownSchema = object({
34068
34444
  /** Total tracked objects in this scope (frame / zone / unzoned). */
34069
34445
  totalObjects: number().int().nonnegative(),
34070
34446
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
34071
- byClass: record(string(), number().int().nonnegative())
34447
+ byClass: record(string(), number().int().nonnegative()),
34448
+ /**
34449
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
34450
+ * present but not going anywhere (a parked car, a bin, a statue).
34451
+ *
34452
+ * The operator's question about a scene has two halves and they answer
34453
+ * different things: "what is parked here" is stable for hours and must not
34454
+ * flap, while "who is walking through" is the thing an alert is about. One
34455
+ * number could only serve one of them, and `totalObjects` served the first
34456
+ * badly — a passer-by moved it and every occupancy rule saw a change.
34457
+ *
34458
+ * `standing + transient === totalObjects`, always. The total keeps its old
34459
+ * meaning exactly, so no rule written against it changes behaviour.
34460
+ *
34461
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
34462
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
34463
+ * parked objects here" about a camera whose lot is full.
34464
+ */
34465
+ standingObjects: number().int().nonnegative().optional(),
34466
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
34467
+ * same absence rule. */
34468
+ transientObjects: number().int().nonnegative().optional()
34072
34469
  });
34073
34470
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
34074
34471
  zoneId: string(),
@@ -34191,6 +34588,23 @@ var HistoryPointSchema = object({
34191
34588
  * triple covers the three spatial scopes (per-zone, frame-wide,
34192
34589
  * outside-any-zone). Crossing them with `className?` gives the full
34193
34590
  * combinatorial coverage the operator UI requested.
34591
+ *
34592
+ * ## ⚠️ The three history methods are DEPRECATED
34593
+ *
34594
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34595
+ * so after a restart they report nothing about a night that did happen, and any
34596
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34597
+ * an empty scene. The presets in the occupancy chart existed to hide that
34598
+ * horizon rather than to answer a question.
34599
+ *
34600
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34601
+ * instead. Those rows are already written for every camera, ~60 bytes per
34602
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34603
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34604
+ * function the writer uses, so the two cannot drift.
34605
+ *
34606
+ * The ring stays until these three go, and it is the only thing left reading
34607
+ * it. Do not add a fourth caller.
34194
34608
  */
34195
34609
  var zoneAnalyticsCapability = {
34196
34610
  name: "zone-analytics",
@@ -34695,6 +35109,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34695
35109
  smoke: smokeCapability,
34696
35110
  streamCatalog: streamCatalogCapability,
34697
35111
  streamParams: streamParamsCapability,
35112
+ streamSignals: streamSignalsCapability,
34698
35113
  switch: switchCapability,
34699
35114
  tamper: tamperCapability,
34700
35115
  temperatureSensor: temperatureSensorCapability,
@@ -38822,12 +39237,24 @@ Object.freeze({
38822
39237
  addonId: null,
38823
39238
  access: "create"
38824
39239
  },
39240
+ "nativeObjectDetection.getOptions": {
39241
+ capName: "native-object-detection",
39242
+ capScope: "device",
39243
+ addonId: null,
39244
+ access: "view"
39245
+ },
38825
39246
  "nativeObjectDetection.setEnabled": {
38826
39247
  capName: "native-object-detection",
38827
39248
  capScope: "device",
38828
39249
  addonId: null,
38829
39250
  access: "create"
38830
39251
  },
39252
+ "nativeObjectDetection.setSettings": {
39253
+ capName: "native-object-detection",
39254
+ capScope: "device",
39255
+ addonId: null,
39256
+ access: "create"
39257
+ },
38831
39258
  "navigation.getFeatures": {
38832
39259
  capName: "navigation",
38833
39260
  capScope: "device",
@@ -39092,6 +39519,12 @@ Object.freeze({
39092
39519
  addonId: null,
39093
39520
  access: "view"
39094
39521
  },
39522
+ "notificationRules.getClipRetentionAsks": {
39523
+ capName: "notification-rules",
39524
+ capScope: "system",
39525
+ addonId: null,
39526
+ access: "view"
39527
+ },
39095
39528
  "notificationRules.getConditionCatalog": {
39096
39529
  capName: "notification-rules",
39097
39530
  capScope: "system",
@@ -39602,6 +40035,12 @@ Object.freeze({
39602
40035
  addonId: null,
39603
40036
  access: "create"
39604
40037
  },
40038
+ "pipelineAnalytics.readLongTermSeries": {
40039
+ capName: "pipeline-analytics",
40040
+ capScope: "device",
40041
+ addonId: null,
40042
+ access: "view"
40043
+ },
39605
40044
  "pipelineAnalytics.rebuildObjectEmbeddings": {
39606
40045
  capName: "pipeline-analytics",
39607
40046
  capScope: "device",
@@ -40274,6 +40713,12 @@ Object.freeze({
40274
40713
  addonId: null,
40275
40714
  access: "create"
40276
40715
  },
40716
+ "pipelineRunner.requestOccupancyBurst": {
40717
+ capName: "pipeline-runner",
40718
+ capScope: "system",
40719
+ addonId: null,
40720
+ access: "create"
40721
+ },
40277
40722
  "pipelineRunner.runDetailSubtree": {
40278
40723
  capName: "pipeline-runner",
40279
40724
  capScope: "system",
@@ -41486,6 +41931,12 @@ Object.freeze({
41486
41931
  addonId: null,
41487
41932
  access: "create"
41488
41933
  },
41934
+ "streamBroker.reportStreamSignal": {
41935
+ capName: "stream-broker",
41936
+ capScope: "system",
41937
+ addonId: null,
41938
+ access: "create"
41939
+ },
41489
41940
  "streamBroker.restartProfile": {
41490
41941
  capName: "stream-broker",
41491
41942
  capScope: "system",
@@ -41570,6 +42021,12 @@ Object.freeze({
41570
42021
  addonId: null,
41571
42022
  access: "create"
41572
42023
  },
42024
+ "streamSignals.listSignals": {
42025
+ capName: "stream-signals",
42026
+ capScope: "device",
42027
+ addonId: null,
42028
+ access: "view"
42029
+ },
41573
42030
  "switch.setState": {
41574
42031
  capName: "switch",
41575
42032
  capScope: "device",
@@ -43042,11 +43499,21 @@ Object.freeze({
43042
43499
  form: "single",
43043
43500
  optional: false
43044
43501
  }],
43502
+ "nativeObjectDetection.getOptions": [{
43503
+ name: "deviceId",
43504
+ form: "single",
43505
+ optional: false
43506
+ }],
43045
43507
  "nativeObjectDetection.setEnabled": [{
43046
43508
  name: "deviceId",
43047
43509
  form: "single",
43048
43510
  optional: false
43049
43511
  }],
43512
+ "nativeObjectDetection.setSettings": [{
43513
+ name: "deviceId",
43514
+ form: "single",
43515
+ optional: false
43516
+ }],
43050
43517
  "navigation.getFeatures": [{
43051
43518
  name: "deviceId",
43052
43519
  form: "single",
@@ -43396,6 +43863,11 @@ Object.freeze({
43396
43863
  form: "single",
43397
43864
  optional: false
43398
43865
  }],
43866
+ "pipelineAnalytics.readLongTermSeries": [{
43867
+ name: "deviceId",
43868
+ form: "single",
43869
+ optional: false
43870
+ }],
43399
43871
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
43400
43872
  name: "deviceId",
43401
43873
  form: "single",
@@ -43586,6 +44058,11 @@ Object.freeze({
43586
44058
  form: "single",
43587
44059
  optional: false
43588
44060
  }],
44061
+ "pipelineRunner.requestOccupancyBurst": [{
44062
+ name: "deviceId",
44063
+ form: "single",
44064
+ optional: false
44065
+ }],
43589
44066
  "pipelineRunner.runDetailSubtree": [{
43590
44067
  name: "deviceId",
43591
44068
  form: "single",
@@ -43942,6 +44419,11 @@ Object.freeze({
43942
44419
  form: "single",
43943
44420
  optional: false
43944
44421
  }],
44422
+ "streamBroker.reportStreamSignal": [{
44423
+ name: "deviceId",
44424
+ form: "single",
44425
+ optional: false
44426
+ }],
43945
44427
  "streamBroker.restartProfile": [{
43946
44428
  name: "deviceId",
43947
44429
  form: "single",