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