@camstack/addon-provider-rademacher 0.2.100 → 0.2.102

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
@@ -984,7 +984,7 @@ var Rademacher = class {
984
984
  }
985
985
  };
986
986
  //#endregion
987
- //#region ../types/dist/event-category-ZyX6jcse.mjs
987
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
988
988
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
989
989
  EventCategory["SystemBoot"] = "system.boot";
990
990
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1601,6 +1601,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1601
1601
  * pull-reconcile from the provider's `getStatus` on reconnect. */
1602
1602
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
1603
1603
  EventCategory["BackupCompleted"] = "backup.completed";
1604
+ /**
1605
+ * A whole backup RUN finished — every destination attempted, win or lose.
1606
+ *
1607
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
1608
+ * a progress UI and the wrong one for a notification: an operator with three
1609
+ * destinations would be told three times. And a run where two of three
1610
+ * destinations succeeded is not a clean success — a single "backup
1611
+ * completed" that hid the failed one would be a lie, so the count of each is
1612
+ * carried here and the message says both.
1613
+ *
1614
+ * Emitted by the backup orchestrator only after the destination loop, so a
1615
+ * run that dies during the BUILD phase produces no completion at all.
1616
+ */
1617
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
1604
1618
  EventCategory["BackupRestored"] = "backup.restored";
1605
1619
  EventCategory["NotificationDispatched"] = "notification.dispatched";
1606
1620
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -6331,7 +6345,7 @@ var ZodIssueCode = {
6331
6345
  var ZodFirstPartyTypeKind;
6332
6346
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6333
6347
  //#endregion
6334
- //#region ../types/dist/sleep-DBKu2-U5.mjs
6348
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
6335
6349
  /**
6336
6350
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6337
6351
  * window to float samples (D455).
@@ -12475,6 +12489,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
12475
12489
  auth: "admin"
12476
12490
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
12477
12491
  DeviceType.Camera;
12492
+ /**
12493
+ * The signals a device can emit to WAKE its own stream.
12494
+ *
12495
+ * A camera whose stream is built on demand sleeps until something asks for it,
12496
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
12497
+ * puller holds a session open for ever, and treating that as demand would keep
12498
+ * a battery camera awake for ever, which is the whole thing the battery is for
12499
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
12500
+ * itself, with no stream running.
12501
+ *
12502
+ * ## The vocabulary is the PROVIDER'S, not ours
12503
+ *
12504
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
12505
+ * names each signal with a `code` it chooses and a `label` an operator reads.
12506
+ * Reolink offers motion and camera-native detection; another provider may offer
12507
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
12508
+ * yet. A fixed enum here would mean every new signal is a framework release.
12509
+ *
12510
+ * It is deliberately NOT derived from the caps a device already binds. Whether
12511
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
12512
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
12513
+ * binding — but both answer "what drives the detection pipeline", which is a
12514
+ * different question from "what may wake a sleeping stream". A camera can do
12515
+ * the first and not be trusted with the second, and the operator picks per
12516
+ * camera. Two questions, two authorities.
12517
+ *
12518
+ * ## Availability is not permission
12519
+ *
12520
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
12521
+ * wakes the stream is the operator's per-camera choice, held by the broker
12522
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
12523
+ * provider declaring a signal is not a provider enabling it.
12524
+ */
12525
+ /** One signal a device can emit. */
12526
+ var StreamSignalSchema = object({
12527
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
12528
+ code: string().min(1),
12529
+ /** What an operator reads in the picker. The provider's own wording. */
12530
+ label: string().min(1),
12531
+ /**
12532
+ * Whether the provider recommends this signal ON when a camera is first set
12533
+ * up. A provider knows which of its signals are cheap and reliable; an
12534
+ * operator should not have to discover that by trial. Reolink recommends
12535
+ * both of its own.
12536
+ */
12537
+ recommended: boolean()
12538
+ });
12539
+ var StreamSignalsStatusSchema = object({
12540
+ signals: array(StreamSignalSchema),
12541
+ lastFetchedAt: number()
12542
+ });
12543
+ var streamSignalsCapability = {
12544
+ name: "stream-signals",
12545
+ scope: "device",
12546
+ deviceNative: true,
12547
+ mode: "singleton",
12548
+ deviceTypes: Object.values(DeviceType),
12549
+ runtimeState: StreamSignalsStatusSchema,
12550
+ /**
12551
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
12552
+ *
12553
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
12554
+ * not an operator choice: the provider re-declares it on every registration,
12555
+ * so losing it loses nothing and persisting it would freeze an answer the
12556
+ * camera is entitled to change. Measured the same day on the sibling case —
12557
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
12558
+ * class the camera really detected stayed missing for the life of the row
12559
+ * because the fix could not reach it.
12560
+ *
12561
+ * See `RuntimeStateDurability`. Enforced by
12562
+ * `scripts/check-runtime-state-durability.ts`.
12563
+ */
12564
+ durability: "session",
12565
+ methods: {
12566
+ /**
12567
+ * What this device can emit. Empty is a valid and common answer — most
12568
+ * cameras have nothing to offer here, and an empty list is what makes the
12569
+ * broker's picker show nothing rather than a false choice.
12570
+ */
12571
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
12572
+ };
12478
12573
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
12479
12574
  var StreamFormatSchema = _enum([
12480
12575
  "webrtc",
@@ -12871,6 +12966,22 @@ var EgressTranscodeSchema = object({
12871
12966
  camStreamId: string().nullable()
12872
12967
  });
12873
12968
  method(object({
12969
+ deviceId: number().int().nonnegative(),
12970
+ /** The provider's signal code. */
12971
+ code: string().min(1),
12972
+ /** Ms epoch. Absent ⇒ now. */
12973
+ at: number().optional()
12974
+ }), object({
12975
+ /** Whether the broker acted on it, and if not, why. */
12976
+ accepted: boolean(),
12977
+ reason: _enum([
12978
+ "woke",
12979
+ "hold-extended",
12980
+ "not-enabled",
12981
+ "no-consumer",
12982
+ "unknown-code"
12983
+ ])
12984
+ }), { kind: "mutation" }), method(object({
12874
12985
  deviceId: number().int().nonnegative(),
12875
12986
  camStreamId: string().min(1),
12876
12987
  kind: CamStreamKindSchema,
@@ -13125,6 +13236,16 @@ var PickStreamRequirementsSchema = object({
13125
13236
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
13126
13237
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
13127
13238
  minHeight: number().int().positive().optional(),
13239
+ /**
13240
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
13241
+ *
13242
+ * A consumer can have a ceiling as real as its floor: Alexa documents
13243
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
13244
+ * Without this the ceiling had to be re-implemented by every caller — and
13245
+ * one caller implementing it privately is how a second scoring authority
13246
+ * gets born.
13247
+ */
13248
+ maxHeight: number().int().positive().optional(),
13128
13249
  /** Minimum horizontal resolution. */
13129
13250
  minWidth: number().int().positive().optional(),
13130
13251
  /**
@@ -13141,7 +13262,22 @@ var PickStreamRequirementsSchema = object({
13141
13262
  * transcoded" guard: if the device is already serving the consumer's
13142
13263
  * codec end-to-end, there's nothing to optimise.
13143
13264
  */
13144
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
13265
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
13266
+ /**
13267
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
13268
+ * understanding that it will be transcoded.
13269
+ *
13270
+ * Default `false` — today's behaviour, and the right one for a bypass
13271
+ * question ("is there a stream I can forward untouched?"). Set `true` to
13272
+ * ask the larger question: "what is the best stream for me, transcoding if
13273
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
13274
+ * does not, so a passthrough is never lost to a transcode; the answer says
13275
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
13276
+ *
13277
+ * This is what lets one picker serve both the bypass and the full source
13278
+ * choice, instead of a consumer scoring privately when the bypass misses.
13279
+ */
13280
+ allowTranscode: boolean().optional()
13145
13281
  }).readonly();
13146
13282
  var PickStreamPreferencesSchema = object({
13147
13283
  /**
@@ -13155,12 +13291,32 @@ var PickStreamPreferencesSchema = object({
13155
13291
  * picks the tallest stream; `'lowest'` picks the shortest (used by
13156
13292
  * memory-constrained consumers / Apple Home guest sessions).
13157
13293
  */
13158
- resolutionPreference: _enum(["highest", "lowest"]).optional()
13294
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
13295
+ /**
13296
+ * The height the consumer actually wants to DELIVER.
13297
+ *
13298
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
13299
+ * above the target wins, and only if nothing reaches it does the tallest
13300
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
13301
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
13302
+ * express that: it says "as big as possible", which is a different wish.
13303
+ *
13304
+ * Ignored when absent, so every existing caller keeps its ordering.
13305
+ */
13306
+ targetHeight: number().int().positive().optional()
13159
13307
  }).readonly();
13160
13308
  var PickedCamStreamSchema = object({
13161
13309
  camStreamId: string(),
13162
13310
  codec: string().optional(),
13163
13311
  resolution: CamStreamResolutionSchema.optional(),
13312
+ /**
13313
+ * Whether serving this stream requires a decode + re-encode.
13314
+ *
13315
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
13316
+ * when the caller asked for it with `allowTranscode`, so a caller that did
13317
+ * not ask cannot be handed a cost it never agreed to pay.
13318
+ */
13319
+ transcodes: boolean(),
13164
13320
  /** One-line explanation of why this stream won — for logs / debug UI. */
13165
13321
  reason: string()
13166
13322
  });
@@ -17677,6 +17833,8 @@ var NcSystemEventKindSchema = _enum([
17677
17833
  "device-enabled",
17678
17834
  "device-battery-low",
17679
17835
  "device-battery-normal",
17836
+ "device-consumable-low",
17837
+ "device-consumable-normal",
17680
17838
  "stream-online",
17681
17839
  "stream-offline",
17682
17840
  "node-online",
@@ -17695,6 +17853,7 @@ var NcSystemEventKindSchema = _enum([
17695
17853
  "addon-updated",
17696
17854
  "server-updated",
17697
17855
  "export-completed",
17856
+ "backup-completed",
17698
17857
  "camera-online",
17699
17858
  "camera-offline",
17700
17859
  "camera-disabled",
@@ -19017,6 +19176,48 @@ var NcAlarmConfigSchema = object({
19017
19176
  settings: NcAlarmSettingsSchema,
19018
19177
  coverage: array(NcAlarmModeCoverageSchema)
19019
19178
  });
19179
+ /**
19180
+ * ONE rule's demand on ONE camera's clip ring.
19181
+ *
19182
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
19183
+ * camera, so the answer stays a faithful description of the rules and the
19184
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
19185
+ * lives. A camera that appears in no ask is being told **nothing** — which is
19186
+ * a different thing from never having been told, and only the envelope
19187
+ * (`rulesLoaded`) can tell those apart.
19188
+ */
19189
+ var NcClipRetentionAskSchema = object({
19190
+ /**
19191
+ * The camera this ask is about. **Absent = every camera**, which is what a
19192
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
19193
+ * asking everywhere.
19194
+ */
19195
+ deviceId: number().int().nonnegative().optional(),
19196
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
19197
+ * needs nothing produces no ask at all. */
19198
+ seconds: number().min(0).max(60),
19199
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
19200
+ * assigned, which is what the cut defaults to. */
19201
+ profile: CamProfileSchema.optional(),
19202
+ /** Who is asking — so a retention the operator did not expect names a rule. */
19203
+ ruleId: string(),
19204
+ ruleName: string(),
19205
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
19206
+ reason: _enum(["window", "occupancy"])
19207
+ });
19208
+ /**
19209
+ * The whole answer, with the one bit that keeps absence from reading as zero.
19210
+ *
19211
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
19212
+ * once. A centre that is up but has not read its rules yet answers with an
19213
+ * empty ask list that means nothing at all — applying it would drop every
19214
+ * camera's ring to zero for the first events after a restart, which is the
19215
+ * footage this mechanism exists to keep.
19216
+ */
19217
+ var NcClipRetentionPlanSchema = object({
19218
+ rulesLoaded: boolean(),
19219
+ asks: array(NcClipRetentionAskSchema).readonly()
19220
+ });
19020
19221
  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 }), {
19021
19222
  kind: "mutation",
19022
19223
  auth: "admin",
@@ -19037,7 +19238,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
19037
19238
  }), object({ success: literal(true) }), {
19038
19239
  kind: "mutation",
19039
19240
  auth: "admin"
19040
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
19241
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
19041
19242
  deviceId: number().int(),
19042
19243
  muted: boolean()
19043
19244
  }), object({ success: literal(true) }), {
@@ -21611,6 +21812,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
21611
21812
  * solid is this track", cheaper than re-deriving it from a trajectory. */
21612
21813
  framesMatched: number().int()
21613
21814
  })).readonly() });
21815
+ /**
21816
+ * The long-term series a camera produces. A closed union so a typo cannot
21817
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21818
+ * is an alias of this, not a second list.
21819
+ */
21820
+ var AnalyticsLtsSeriesSchema = _enum([
21821
+ "motion",
21822
+ "audio-dbfs",
21823
+ "battery",
21824
+ "occupancy"
21825
+ ]);
21826
+ /**
21827
+ * One closed 5-minute bucket of a long-term series.
21828
+ *
21829
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21830
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21831
+ * that exists at all was measured; a bucket that is absent was not, which is a
21832
+ * different claim from zero and the reason this is a sparse series.
21833
+ */
21834
+ var LtsBucketSchema = object({
21835
+ scope: string(),
21836
+ bucketStart: number().int(),
21837
+ samples: number().int().nonnegative(),
21838
+ sum: number(),
21839
+ min: number(),
21840
+ max: number()
21841
+ });
21614
21842
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
21615
21843
  deviceId: number(),
21616
21844
  trackId: string()
@@ -21657,6 +21885,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21657
21885
  kinds: array(string()).optional(),
21658
21886
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
21659
21887
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
21888
+ deviceId: number(),
21889
+ series: AnalyticsLtsSeriesSchema,
21890
+ /** Omit for EVERY scope of this series in the range. */
21891
+ scope: string().optional(),
21892
+ from: number(),
21893
+ to: number(),
21894
+ limit: number().int().positive().optional()
21895
+ }), array(LtsBucketSchema).readonly()), method(object({
21660
21896
  deviceId: number(),
21661
21897
  since: number(),
21662
21898
  until: number(),
@@ -22275,6 +22511,14 @@ var MotionSourceEnum = _enum([
22275
22511
  */
22276
22512
  var MotionSourcesSchema = array(MotionSourceEnum);
22277
22513
  /**
22514
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
22515
+ * post-analysis already tags every detection with (`DetectionSource`) rather
22516
+ * than a second spelling of the same two ideas — the value an operator picks
22517
+ * here is the value that comes back on the track, the overlay and the debug
22518
+ * row.
22519
+ */
22520
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
22521
+ /**
22278
22522
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
22279
22523
  * so cap-side consumers (the orchestrator forward, the runner addon's
22280
22524
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -22425,6 +22669,35 @@ var RunnerCameraConfigSchema = object({
22425
22669
  * events; the orchestrator forwards to `reportMotion`.
22426
22670
  */
22427
22671
  motionSources: MotionSourcesSchema.default(["analyzer"]),
22672
+ /**
22673
+ * WHICH root detector runs for this camera. The detection counterpart of
22674
+ * {@link motionSources}, same shape and same discipline: a per-camera list
22675
+ * of sources the system understands, vendor-agnostic, owned here.
22676
+ *
22677
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
22678
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
22679
+ * here. Its boxes reach post-analysis on the same
22680
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
22681
+ * track gets the same tracker, the same overlay and the same detail
22682
+ * subtree (face / plate / embedding).
22683
+ *
22684
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
22685
+ * run, and that is where a camera with a usable onboard detector buys back
22686
+ * its share of the accelerator. It saves the root inference, not the decode
22687
+ * — the detail subtree still needs pixels to cut crops from.
22688
+ *
22689
+ * A camera whose onboard detections carry no geometry cannot serve as a root
22690
+ * step at all (there is nothing to track), and the cap that knows this says
22691
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
22692
+ * every battery camera: the boxes ride a sub-stream a battery camera never
22693
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
22694
+ * worth exactly what it already is — a wake signal with a class.
22695
+ *
22696
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
22697
+ * vendor never turns a detector on for the operator, and neither does a
22698
+ * default.
22699
+ */
22700
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
22428
22701
  pipelineEnabled: boolean().default(true),
22429
22702
  /** Ordered tree of video steps. Absent → runner skips video detection. */
22430
22703
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -22606,7 +22879,47 @@ var RunnerLocalMetricsSchema = object({
22606
22879
  queueDepth: number(),
22607
22880
  frameLazy: FrameLazyMetricsSchema.optional()
22608
22881
  });
22882
+ /**
22883
+ * Pipeline Runner capability — runtime detection workhorse.
22884
+ *
22885
+ * One instance per node. Receives camera assignments from
22886
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22887
+ * decoded frames, drains motion + detection queues, calls the local
22888
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22889
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22890
+ * the bus.
22891
+ *
22892
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22893
+ * runner has zero knowledge of other agents, no global state, and never
22894
+ * makes assignment decisions itself.
22895
+ */
22896
+ /**
22897
+ * Why a runner declined to look at a camera out of band. Named rather than a
22898
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22899
+ * already mid-session and one already bursting are four different facts, and a
22900
+ * caller told only "no" cannot tell a protection from a bug.
22901
+ */
22902
+ var OccupancyBurstRefusalSchema = _enum([
22903
+ "not-attached",
22904
+ "battery-asleep",
22905
+ "not-watching",
22906
+ "already-bursting"
22907
+ ]);
22609
22908
  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({
22909
+ deviceId: number(),
22910
+ /** How many frames to collect. The caller sizes this against what its
22911
+ * own confirmation needs; the runner clamps it to the field's range. */
22912
+ frames: number().int().positive().optional(),
22913
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22914
+ * defend — the periodic one at least has a timer to point at. */
22915
+ reason: string()
22916
+ }), object({
22917
+ started: boolean(),
22918
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22919
+ }), {
22920
+ auth: "admin",
22921
+ kind: "mutation"
22922
+ }), method(object({
22610
22923
  handle: FrameHandleSchema,
22611
22924
  bbox: NativeCropBboxSchema,
22612
22925
  maxWidth: number().int().positive().optional(),
@@ -24976,10 +25289,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24976
25289
  }), boolean()), method(object({
24977
25290
  deviceId: number().int().nonnegative(),
24978
25291
  sessionId: string()
24979
- }), object({ pendingRenegotiation: object({
24980
- target: WebrtcStreamTargetSchema,
24981
- epoch: number()
24982
- }).nullable() }));
25292
+ }), object({
25293
+ pendingRenegotiation: object({
25294
+ target: WebrtcStreamTargetSchema,
25295
+ epoch: number()
25296
+ }).nullable(),
25297
+ /**
25298
+ * Whether the session still EXISTS.
25299
+ *
25300
+ * A consumer that holds a resource for the life of a session needs to
25301
+ * be able to ask, because a session does not always end the way it
25302
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
25303
+ * sent `SessionDisconnected`, so the Alexa exporter's
25304
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
25305
+ * H.264 transcode kept running for NOBODY for more than twenty
25306
+ * minutes. The WebRTC session had logged `WebRTC session closed`
25307
+ * minutes earlier — the broker knew; the holder had no way to ask.
25308
+ *
25309
+ * `false` for a session id the provider has never heard of, which is
25310
+ * the same answer as "it ended": either way nothing is holding it up.
25311
+ */
25312
+ alive: boolean()
25313
+ }));
24983
25314
  object({
24984
25315
  /** All accessory children of the parent. */
24985
25316
  childDeviceIds: array(number()).readonly(),
@@ -29418,11 +29749,46 @@ var NativeObjectDetectionStatusSchema = object({
29418
29749
  supportedClasses: array(NativeObjectClassEnum).readonly(),
29419
29750
  /**
29420
29751
  * Whether forwarding of onboard AI detections is enabled for this device.
29421
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
29422
- * churn the tracker, so forwarding stays off until the operator enables it.
29752
+ *
29753
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
29754
+ * camera runs — that is the operator's choice, and it is made where every
29755
+ * other detection choice is made. `geometry` on
29756
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
29757
+ * choice would buy this particular camera.
29423
29758
  */
29424
29759
  enabled: boolean()
29425
29760
  });
29761
+ /**
29762
+ * WHEN a camera's onboard detections carry geometry.
29763
+ *
29764
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
29765
+ * a detection is a trackable subject whenever the camera sees one.
29766
+ * - `while-streaming` — only while some stream of this camera is already open.
29767
+ * The boxes ride the video's own side-channel rather than a feed of their
29768
+ * own, so they cost nothing and they exist only when something is pulling.
29769
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
29770
+ * radio drain, but a camera that is awake is awake precisely because
29771
+ * something is in front of it, and its stream is already being pulled.
29772
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
29773
+ * pipeline needs geometry to make a subject, so such a push reaches the
29774
+ * tracker as motion and no further.
29775
+ *
29776
+ * Reported and not inferred, because the operator's question in front of the
29777
+ * picker is "what do I get", and these are three different answers (D14: the
29778
+ * derived form is only as honest as `getOptions`).
29779
+ */
29780
+ var NativeObjectGeometryEnum = _enum([
29781
+ "boxed",
29782
+ "while-streaming",
29783
+ "flag-only"
29784
+ ]);
29785
+ var NativeObjectDetectionOptionsSchema = object({
29786
+ /** Classes this firmware can detect — the same list the status reports. */
29787
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
29788
+ /** What a detection from this camera carries. */
29789
+ geometry: NativeObjectGeometryEnum
29790
+ });
29791
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
29426
29792
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
29427
29793
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
29428
29794
  lastFetchedAt: number() });
@@ -29432,13 +29798,23 @@ var nativeObjectDetectionCapability = {
29432
29798
  deviceNative: true,
29433
29799
  mode: "singleton",
29434
29800
  deviceTypes: [DeviceType.Camera],
29435
- methods: { setEnabled: method(object({
29436
- deviceId: number(),
29437
- enabled: boolean()
29438
- }), _void(), {
29439
- kind: "mutation",
29440
- auth: "admin"
29441
- }) },
29801
+ methods: {
29802
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29803
+ setSettings: method(object({
29804
+ deviceId: number(),
29805
+ settings: NativeObjectDetectionSettingsPatchSchema
29806
+ }), _void(), {
29807
+ kind: "mutation",
29808
+ auth: "admin"
29809
+ }),
29810
+ setEnabled: method(object({
29811
+ deviceId: number(),
29812
+ enabled: boolean()
29813
+ }), _void(), {
29814
+ kind: "mutation",
29815
+ auth: "admin"
29816
+ })
29817
+ },
29442
29818
  events: { onDetected: { data: object({
29443
29819
  deviceId: number(),
29444
29820
  detection: NativeDetectionSchema
@@ -34286,7 +34662,28 @@ var PerScopeBreakdownSchema = object({
34286
34662
  /** Total tracked objects in this scope (frame / zone / unzoned). */
34287
34663
  totalObjects: number().int().nonnegative(),
34288
34664
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
34289
- byClass: record(string(), number().int().nonnegative())
34665
+ byClass: record(string(), number().int().nonnegative()),
34666
+ /**
34667
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
34668
+ * present but not going anywhere (a parked car, a bin, a statue).
34669
+ *
34670
+ * The operator's question about a scene has two halves and they answer
34671
+ * different things: "what is parked here" is stable for hours and must not
34672
+ * flap, while "who is walking through" is the thing an alert is about. One
34673
+ * number could only serve one of them, and `totalObjects` served the first
34674
+ * badly — a passer-by moved it and every occupancy rule saw a change.
34675
+ *
34676
+ * `standing + transient === totalObjects`, always. The total keeps its old
34677
+ * meaning exactly, so no rule written against it changes behaviour.
34678
+ *
34679
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
34680
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
34681
+ * parked objects here" about a camera whose lot is full.
34682
+ */
34683
+ standingObjects: number().int().nonnegative().optional(),
34684
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
34685
+ * same absence rule. */
34686
+ transientObjects: number().int().nonnegative().optional()
34290
34687
  });
34291
34688
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
34292
34689
  zoneId: string(),
@@ -34409,6 +34806,23 @@ var HistoryPointSchema = object({
34409
34806
  * triple covers the three spatial scopes (per-zone, frame-wide,
34410
34807
  * outside-any-zone). Crossing them with `className?` gives the full
34411
34808
  * combinatorial coverage the operator UI requested.
34809
+ *
34810
+ * ## ⚠️ The three history methods are DEPRECATED
34811
+ *
34812
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34813
+ * so after a restart they report nothing about a night that did happen, and any
34814
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34815
+ * an empty scene. The presets in the occupancy chart existed to hide that
34816
+ * horizon rather than to answer a question.
34817
+ *
34818
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34819
+ * instead. Those rows are already written for every camera, ~60 bytes per
34820
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34821
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34822
+ * function the writer uses, so the two cannot drift.
34823
+ *
34824
+ * The ring stays until these three go, and it is the only thing left reading
34825
+ * it. Do not add a fourth caller.
34412
34826
  */
34413
34827
  var zoneAnalyticsCapability = {
34414
34828
  name: "zone-analytics",
@@ -34898,6 +35312,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34898
35312
  smoke: smokeCapability,
34899
35313
  streamCatalog: streamCatalogCapability,
34900
35314
  streamParams: streamParamsCapability,
35315
+ streamSignals: streamSignalsCapability,
34901
35316
  switch: switchCapability,
34902
35317
  tamper: tamperCapability,
34903
35318
  temperatureSensor: temperatureSensorCapability,
@@ -38807,12 +39222,24 @@ Object.freeze({
38807
39222
  addonId: null,
38808
39223
  access: "create"
38809
39224
  },
39225
+ "nativeObjectDetection.getOptions": {
39226
+ capName: "native-object-detection",
39227
+ capScope: "device",
39228
+ addonId: null,
39229
+ access: "view"
39230
+ },
38810
39231
  "nativeObjectDetection.setEnabled": {
38811
39232
  capName: "native-object-detection",
38812
39233
  capScope: "device",
38813
39234
  addonId: null,
38814
39235
  access: "create"
38815
39236
  },
39237
+ "nativeObjectDetection.setSettings": {
39238
+ capName: "native-object-detection",
39239
+ capScope: "device",
39240
+ addonId: null,
39241
+ access: "create"
39242
+ },
38816
39243
  "navigation.getFeatures": {
38817
39244
  capName: "navigation",
38818
39245
  capScope: "device",
@@ -39077,6 +39504,12 @@ Object.freeze({
39077
39504
  addonId: null,
39078
39505
  access: "view"
39079
39506
  },
39507
+ "notificationRules.getClipRetentionAsks": {
39508
+ capName: "notification-rules",
39509
+ capScope: "system",
39510
+ addonId: null,
39511
+ access: "view"
39512
+ },
39080
39513
  "notificationRules.getConditionCatalog": {
39081
39514
  capName: "notification-rules",
39082
39515
  capScope: "system",
@@ -39587,6 +40020,12 @@ Object.freeze({
39587
40020
  addonId: null,
39588
40021
  access: "create"
39589
40022
  },
40023
+ "pipelineAnalytics.readLongTermSeries": {
40024
+ capName: "pipeline-analytics",
40025
+ capScope: "device",
40026
+ addonId: null,
40027
+ access: "view"
40028
+ },
39590
40029
  "pipelineAnalytics.rebuildObjectEmbeddings": {
39591
40030
  capName: "pipeline-analytics",
39592
40031
  capScope: "device",
@@ -40259,6 +40698,12 @@ Object.freeze({
40259
40698
  addonId: null,
40260
40699
  access: "create"
40261
40700
  },
40701
+ "pipelineRunner.requestOccupancyBurst": {
40702
+ capName: "pipeline-runner",
40703
+ capScope: "system",
40704
+ addonId: null,
40705
+ access: "create"
40706
+ },
40262
40707
  "pipelineRunner.runDetailSubtree": {
40263
40708
  capName: "pipeline-runner",
40264
40709
  capScope: "system",
@@ -41471,6 +41916,12 @@ Object.freeze({
41471
41916
  addonId: null,
41472
41917
  access: "create"
41473
41918
  },
41919
+ "streamBroker.reportStreamSignal": {
41920
+ capName: "stream-broker",
41921
+ capScope: "system",
41922
+ addonId: null,
41923
+ access: "create"
41924
+ },
41474
41925
  "streamBroker.restartProfile": {
41475
41926
  capName: "stream-broker",
41476
41927
  capScope: "system",
@@ -41555,6 +42006,12 @@ Object.freeze({
41555
42006
  addonId: null,
41556
42007
  access: "create"
41557
42008
  },
42009
+ "streamSignals.listSignals": {
42010
+ capName: "stream-signals",
42011
+ capScope: "device",
42012
+ addonId: null,
42013
+ access: "view"
42014
+ },
41558
42015
  "switch.setState": {
41559
42016
  capName: "switch",
41560
42017
  capScope: "device",
@@ -43027,11 +43484,21 @@ Object.freeze({
43027
43484
  form: "single",
43028
43485
  optional: false
43029
43486
  }],
43487
+ "nativeObjectDetection.getOptions": [{
43488
+ name: "deviceId",
43489
+ form: "single",
43490
+ optional: false
43491
+ }],
43030
43492
  "nativeObjectDetection.setEnabled": [{
43031
43493
  name: "deviceId",
43032
43494
  form: "single",
43033
43495
  optional: false
43034
43496
  }],
43497
+ "nativeObjectDetection.setSettings": [{
43498
+ name: "deviceId",
43499
+ form: "single",
43500
+ optional: false
43501
+ }],
43035
43502
  "navigation.getFeatures": [{
43036
43503
  name: "deviceId",
43037
43504
  form: "single",
@@ -43381,6 +43848,11 @@ Object.freeze({
43381
43848
  form: "single",
43382
43849
  optional: false
43383
43850
  }],
43851
+ "pipelineAnalytics.readLongTermSeries": [{
43852
+ name: "deviceId",
43853
+ form: "single",
43854
+ optional: false
43855
+ }],
43384
43856
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
43385
43857
  name: "deviceId",
43386
43858
  form: "single",
@@ -43571,6 +44043,11 @@ Object.freeze({
43571
44043
  form: "single",
43572
44044
  optional: false
43573
44045
  }],
44046
+ "pipelineRunner.requestOccupancyBurst": [{
44047
+ name: "deviceId",
44048
+ form: "single",
44049
+ optional: false
44050
+ }],
43574
44051
  "pipelineRunner.runDetailSubtree": [{
43575
44052
  name: "deviceId",
43576
44053
  form: "single",
@@ -43927,6 +44404,11 @@ Object.freeze({
43927
44404
  form: "single",
43928
44405
  optional: false
43929
44406
  }],
44407
+ "streamBroker.reportStreamSignal": [{
44408
+ name: "deviceId",
44409
+ form: "single",
44410
+ optional: false
44411
+ }],
43930
44412
  "streamBroker.restartProfile": [{
43931
44413
  name: "deviceId",
43932
44414
  form: "single",