@camstack/addon-provider-tuya 0.2.101 → 0.2.103

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
@@ -819,7 +819,7 @@ async function discoverDevices(options = {}, binder = createDgramBinder()) {
819
819
  return [...byId.values()];
820
820
  }
821
821
  //#endregion
822
- //#region ../types/dist/event-category-ZyX6jcse.mjs
822
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
823
823
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
824
824
  EventCategory["SystemBoot"] = "system.boot";
825
825
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1436,6 +1436,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1436
1436
  * pull-reconcile from the provider's `getStatus` on reconnect. */
1437
1437
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
1438
1438
  EventCategory["BackupCompleted"] = "backup.completed";
1439
+ /**
1440
+ * A whole backup RUN finished — every destination attempted, win or lose.
1441
+ *
1442
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
1443
+ * a progress UI and the wrong one for a notification: an operator with three
1444
+ * destinations would be told three times. And a run where two of three
1445
+ * destinations succeeded is not a clean success — a single "backup
1446
+ * completed" that hid the failed one would be a lie, so the count of each is
1447
+ * carried here and the message says both.
1448
+ *
1449
+ * Emitted by the backup orchestrator only after the destination loop, so a
1450
+ * run that dies during the BUILD phase produces no completion at all.
1451
+ */
1452
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
1439
1453
  EventCategory["BackupRestored"] = "backup.restored";
1440
1454
  EventCategory["NotificationDispatched"] = "notification.dispatched";
1441
1455
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -6166,7 +6180,7 @@ var ZodIssueCode = {
6166
6180
  var ZodFirstPartyTypeKind;
6167
6181
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6168
6182
  //#endregion
6169
- //#region ../types/dist/sleep-DBKu2-U5.mjs
6183
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
6170
6184
  /**
6171
6185
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6172
6186
  * window to float samples (D455).
@@ -12310,6 +12324,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
12310
12324
  auth: "admin"
12311
12325
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
12312
12326
  DeviceType.Camera;
12327
+ /**
12328
+ * The signals a device can emit to WAKE its own stream.
12329
+ *
12330
+ * A camera whose stream is built on demand sleeps until something asks for it,
12331
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
12332
+ * puller holds a session open for ever, and treating that as demand would keep
12333
+ * a battery camera awake for ever, which is the whole thing the battery is for
12334
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
12335
+ * itself, with no stream running.
12336
+ *
12337
+ * ## The vocabulary is the PROVIDER'S, not ours
12338
+ *
12339
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
12340
+ * names each signal with a `code` it chooses and a `label` an operator reads.
12341
+ * Reolink offers motion and camera-native detection; another provider may offer
12342
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
12343
+ * yet. A fixed enum here would mean every new signal is a framework release.
12344
+ *
12345
+ * It is deliberately NOT derived from the caps a device already binds. Whether
12346
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
12347
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
12348
+ * binding — but both answer "what drives the detection pipeline", which is a
12349
+ * different question from "what may wake a sleeping stream". A camera can do
12350
+ * the first and not be trusted with the second, and the operator picks per
12351
+ * camera. Two questions, two authorities.
12352
+ *
12353
+ * ## Availability is not permission
12354
+ *
12355
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
12356
+ * wakes the stream is the operator's per-camera choice, held by the broker
12357
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
12358
+ * provider declaring a signal is not a provider enabling it.
12359
+ */
12360
+ /** One signal a device can emit. */
12361
+ var StreamSignalSchema = object({
12362
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
12363
+ code: string().min(1),
12364
+ /** What an operator reads in the picker. The provider's own wording. */
12365
+ label: string().min(1),
12366
+ /**
12367
+ * Whether the provider recommends this signal ON when a camera is first set
12368
+ * up. A provider knows which of its signals are cheap and reliable; an
12369
+ * operator should not have to discover that by trial. Reolink recommends
12370
+ * both of its own.
12371
+ */
12372
+ recommended: boolean()
12373
+ });
12374
+ var StreamSignalsStatusSchema = object({
12375
+ signals: array(StreamSignalSchema),
12376
+ lastFetchedAt: number()
12377
+ });
12378
+ var streamSignalsCapability = {
12379
+ name: "stream-signals",
12380
+ scope: "device",
12381
+ deviceNative: true,
12382
+ mode: "singleton",
12383
+ deviceTypes: Object.values(DeviceType),
12384
+ runtimeState: StreamSignalsStatusSchema,
12385
+ /**
12386
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
12387
+ *
12388
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
12389
+ * not an operator choice: the provider re-declares it on every registration,
12390
+ * so losing it loses nothing and persisting it would freeze an answer the
12391
+ * camera is entitled to change. Measured the same day on the sibling case —
12392
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
12393
+ * class the camera really detected stayed missing for the life of the row
12394
+ * because the fix could not reach it.
12395
+ *
12396
+ * See `RuntimeStateDurability`. Enforced by
12397
+ * `scripts/check-runtime-state-durability.ts`.
12398
+ */
12399
+ durability: "session",
12400
+ methods: {
12401
+ /**
12402
+ * What this device can emit. Empty is a valid and common answer — most
12403
+ * cameras have nothing to offer here, and an empty list is what makes the
12404
+ * broker's picker show nothing rather than a false choice.
12405
+ */
12406
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
12407
+ };
12313
12408
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
12314
12409
  var StreamFormatSchema = _enum([
12315
12410
  "webrtc",
@@ -12706,6 +12801,22 @@ var EgressTranscodeSchema = object({
12706
12801
  camStreamId: string().nullable()
12707
12802
  });
12708
12803
  method(object({
12804
+ deviceId: number().int().nonnegative(),
12805
+ /** The provider's signal code. */
12806
+ code: string().min(1),
12807
+ /** Ms epoch. Absent ⇒ now. */
12808
+ at: number().optional()
12809
+ }), object({
12810
+ /** Whether the broker acted on it, and if not, why. */
12811
+ accepted: boolean(),
12812
+ reason: _enum([
12813
+ "woke",
12814
+ "hold-extended",
12815
+ "not-enabled",
12816
+ "no-consumer",
12817
+ "unknown-code"
12818
+ ])
12819
+ }), { kind: "mutation" }), method(object({
12709
12820
  deviceId: number().int().nonnegative(),
12710
12821
  camStreamId: string().min(1),
12711
12822
  kind: CamStreamKindSchema,
@@ -12960,6 +13071,16 @@ var PickStreamRequirementsSchema = object({
12960
13071
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12961
13072
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12962
13073
  minHeight: number().int().positive().optional(),
13074
+ /**
13075
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
13076
+ *
13077
+ * A consumer can have a ceiling as real as its floor: Alexa documents
13078
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
13079
+ * Without this the ceiling had to be re-implemented by every caller — and
13080
+ * one caller implementing it privately is how a second scoring authority
13081
+ * gets born.
13082
+ */
13083
+ maxHeight: number().int().positive().optional(),
12963
13084
  /** Minimum horizontal resolution. */
12964
13085
  minWidth: number().int().positive().optional(),
12965
13086
  /**
@@ -12976,7 +13097,22 @@ var PickStreamRequirementsSchema = object({
12976
13097
  * transcoded" guard: if the device is already serving the consumer's
12977
13098
  * codec end-to-end, there's nothing to optimise.
12978
13099
  */
12979
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
13100
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
13101
+ /**
13102
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
13103
+ * understanding that it will be transcoded.
13104
+ *
13105
+ * Default `false` — today's behaviour, and the right one for a bypass
13106
+ * question ("is there a stream I can forward untouched?"). Set `true` to
13107
+ * ask the larger question: "what is the best stream for me, transcoding if
13108
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
13109
+ * does not, so a passthrough is never lost to a transcode; the answer says
13110
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
13111
+ *
13112
+ * This is what lets one picker serve both the bypass and the full source
13113
+ * choice, instead of a consumer scoring privately when the bypass misses.
13114
+ */
13115
+ allowTranscode: boolean().optional()
12980
13116
  }).readonly();
12981
13117
  var PickStreamPreferencesSchema = object({
12982
13118
  /**
@@ -12990,12 +13126,32 @@ var PickStreamPreferencesSchema = object({
12990
13126
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12991
13127
  * memory-constrained consumers / Apple Home guest sessions).
12992
13128
  */
12993
- resolutionPreference: _enum(["highest", "lowest"]).optional()
13129
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
13130
+ /**
13131
+ * The height the consumer actually wants to DELIVER.
13132
+ *
13133
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
13134
+ * above the target wins, and only if nothing reaches it does the tallest
13135
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
13136
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
13137
+ * express that: it says "as big as possible", which is a different wish.
13138
+ *
13139
+ * Ignored when absent, so every existing caller keeps its ordering.
13140
+ */
13141
+ targetHeight: number().int().positive().optional()
12994
13142
  }).readonly();
12995
13143
  var PickedCamStreamSchema = object({
12996
13144
  camStreamId: string(),
12997
13145
  codec: string().optional(),
12998
13146
  resolution: CamStreamResolutionSchema.optional(),
13147
+ /**
13148
+ * Whether serving this stream requires a decode + re-encode.
13149
+ *
13150
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
13151
+ * when the caller asked for it with `allowTranscode`, so a caller that did
13152
+ * not ask cannot be handed a cost it never agreed to pay.
13153
+ */
13154
+ transcodes: boolean(),
12999
13155
  /** One-line explanation of why this stream won — for logs / debug UI. */
13000
13156
  reason: string()
13001
13157
  });
@@ -17529,6 +17685,8 @@ var NcSystemEventKindSchema = _enum([
17529
17685
  "device-enabled",
17530
17686
  "device-battery-low",
17531
17687
  "device-battery-normal",
17688
+ "device-consumable-low",
17689
+ "device-consumable-normal",
17532
17690
  "stream-online",
17533
17691
  "stream-offline",
17534
17692
  "node-online",
@@ -17547,6 +17705,7 @@ var NcSystemEventKindSchema = _enum([
17547
17705
  "addon-updated",
17548
17706
  "server-updated",
17549
17707
  "export-completed",
17708
+ "backup-completed",
17550
17709
  "camera-online",
17551
17710
  "camera-offline",
17552
17711
  "camera-disabled",
@@ -18869,6 +19028,48 @@ var NcAlarmConfigSchema = object({
18869
19028
  settings: NcAlarmSettingsSchema,
18870
19029
  coverage: array(NcAlarmModeCoverageSchema)
18871
19030
  });
19031
+ /**
19032
+ * ONE rule's demand on ONE camera's clip ring.
19033
+ *
19034
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
19035
+ * camera, so the answer stays a faithful description of the rules and the
19036
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
19037
+ * lives. A camera that appears in no ask is being told **nothing** — which is
19038
+ * a different thing from never having been told, and only the envelope
19039
+ * (`rulesLoaded`) can tell those apart.
19040
+ */
19041
+ var NcClipRetentionAskSchema = object({
19042
+ /**
19043
+ * The camera this ask is about. **Absent = every camera**, which is what a
19044
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
19045
+ * asking everywhere.
19046
+ */
19047
+ deviceId: number().int().nonnegative().optional(),
19048
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
19049
+ * needs nothing produces no ask at all. */
19050
+ seconds: number().min(0).max(60),
19051
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
19052
+ * assigned, which is what the cut defaults to. */
19053
+ profile: CamProfileSchema.optional(),
19054
+ /** Who is asking — so a retention the operator did not expect names a rule. */
19055
+ ruleId: string(),
19056
+ ruleName: string(),
19057
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
19058
+ reason: _enum(["window", "occupancy"])
19059
+ });
19060
+ /**
19061
+ * The whole answer, with the one bit that keeps absence from reading as zero.
19062
+ *
19063
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
19064
+ * once. A centre that is up but has not read its rules yet answers with an
19065
+ * empty ask list that means nothing at all — applying it would drop every
19066
+ * camera's ring to zero for the first events after a restart, which is the
19067
+ * footage this mechanism exists to keep.
19068
+ */
19069
+ var NcClipRetentionPlanSchema = object({
19070
+ rulesLoaded: boolean(),
19071
+ asks: array(NcClipRetentionAskSchema).readonly()
19072
+ });
18872
19073
  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 }), {
18873
19074
  kind: "mutation",
18874
19075
  auth: "admin",
@@ -18889,7 +19090,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18889
19090
  }), object({ success: literal(true) }), {
18890
19091
  kind: "mutation",
18891
19092
  auth: "admin"
18892
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
19093
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18893
19094
  deviceId: number().int(),
18894
19095
  muted: boolean()
18895
19096
  }), object({ success: literal(true) }), {
@@ -21463,6 +21664,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
21463
21664
  * solid is this track", cheaper than re-deriving it from a trajectory. */
21464
21665
  framesMatched: number().int()
21465
21666
  })).readonly() });
21667
+ /**
21668
+ * The long-term series a camera produces. A closed union so a typo cannot
21669
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21670
+ * is an alias of this, not a second list.
21671
+ */
21672
+ var AnalyticsLtsSeriesSchema = _enum([
21673
+ "motion",
21674
+ "audio-dbfs",
21675
+ "battery",
21676
+ "occupancy"
21677
+ ]);
21678
+ /**
21679
+ * One closed 5-minute bucket of a long-term series.
21680
+ *
21681
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21682
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21683
+ * that exists at all was measured; a bucket that is absent was not, which is a
21684
+ * different claim from zero and the reason this is a sparse series.
21685
+ */
21686
+ var LtsBucketSchema = object({
21687
+ scope: string(),
21688
+ bucketStart: number().int(),
21689
+ samples: number().int().nonnegative(),
21690
+ sum: number(),
21691
+ min: number(),
21692
+ max: number()
21693
+ });
21466
21694
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
21467
21695
  deviceId: number(),
21468
21696
  trackId: string()
@@ -21509,6 +21737,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21509
21737
  kinds: array(string()).optional(),
21510
21738
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
21511
21739
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
21740
+ deviceId: number(),
21741
+ series: AnalyticsLtsSeriesSchema,
21742
+ /** Omit for EVERY scope of this series in the range. */
21743
+ scope: string().optional(),
21744
+ from: number(),
21745
+ to: number(),
21746
+ limit: number().int().positive().optional()
21747
+ }), array(LtsBucketSchema).readonly()), method(object({
21512
21748
  deviceId: number(),
21513
21749
  since: number(),
21514
21750
  until: number(),
@@ -22127,6 +22363,14 @@ var MotionSourceEnum = _enum([
22127
22363
  */
22128
22364
  var MotionSourcesSchema = array(MotionSourceEnum);
22129
22365
  /**
22366
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
22367
+ * post-analysis already tags every detection with (`DetectionSource`) rather
22368
+ * than a second spelling of the same two ideas — the value an operator picks
22369
+ * here is the value that comes back on the track, the overlay and the debug
22370
+ * row.
22371
+ */
22372
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
22373
+ /**
22130
22374
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
22131
22375
  * so cap-side consumers (the orchestrator forward, the runner addon's
22132
22376
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -22277,6 +22521,35 @@ var RunnerCameraConfigSchema = object({
22277
22521
  * events; the orchestrator forwards to `reportMotion`.
22278
22522
  */
22279
22523
  motionSources: MotionSourcesSchema.default(["analyzer"]),
22524
+ /**
22525
+ * WHICH root detector runs for this camera. The detection counterpart of
22526
+ * {@link motionSources}, same shape and same discipline: a per-camera list
22527
+ * of sources the system understands, vendor-agnostic, owned here.
22528
+ *
22529
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
22530
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
22531
+ * here. Its boxes reach post-analysis on the same
22532
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
22533
+ * track gets the same tracker, the same overlay and the same detail
22534
+ * subtree (face / plate / embedding).
22535
+ *
22536
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
22537
+ * run, and that is where a camera with a usable onboard detector buys back
22538
+ * its share of the accelerator. It saves the root inference, not the decode
22539
+ * — the detail subtree still needs pixels to cut crops from.
22540
+ *
22541
+ * A camera whose onboard detections carry no geometry cannot serve as a root
22542
+ * step at all (there is nothing to track), and the cap that knows this says
22543
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
22544
+ * every battery camera: the boxes ride a sub-stream a battery camera never
22545
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
22546
+ * worth exactly what it already is — a wake signal with a class.
22547
+ *
22548
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
22549
+ * vendor never turns a detector on for the operator, and neither does a
22550
+ * default.
22551
+ */
22552
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
22280
22553
  pipelineEnabled: boolean().default(true),
22281
22554
  /** Ordered tree of video steps. Absent → runner skips video detection. */
22282
22555
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -22458,7 +22731,47 @@ var RunnerLocalMetricsSchema = object({
22458
22731
  queueDepth: number(),
22459
22732
  frameLazy: FrameLazyMetricsSchema.optional()
22460
22733
  });
22734
+ /**
22735
+ * Pipeline Runner capability — runtime detection workhorse.
22736
+ *
22737
+ * One instance per node. Receives camera assignments from
22738
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22739
+ * decoded frames, drains motion + detection queues, calls the local
22740
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22741
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22742
+ * the bus.
22743
+ *
22744
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22745
+ * runner has zero knowledge of other agents, no global state, and never
22746
+ * makes assignment decisions itself.
22747
+ */
22748
+ /**
22749
+ * Why a runner declined to look at a camera out of band. Named rather than a
22750
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22751
+ * already mid-session and one already bursting are four different facts, and a
22752
+ * caller told only "no" cannot tell a protection from a bug.
22753
+ */
22754
+ var OccupancyBurstRefusalSchema = _enum([
22755
+ "not-attached",
22756
+ "battery-asleep",
22757
+ "not-watching",
22758
+ "already-bursting"
22759
+ ]);
22461
22760
  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({
22761
+ deviceId: number(),
22762
+ /** How many frames to collect. The caller sizes this against what its
22763
+ * own confirmation needs; the runner clamps it to the field's range. */
22764
+ frames: number().int().positive().optional(),
22765
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22766
+ * defend — the periodic one at least has a timer to point at. */
22767
+ reason: string()
22768
+ }), object({
22769
+ started: boolean(),
22770
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22771
+ }), {
22772
+ auth: "admin",
22773
+ kind: "mutation"
22774
+ }), method(object({
22462
22775
  handle: FrameHandleSchema,
22463
22776
  bbox: NativeCropBboxSchema,
22464
22777
  maxWidth: number().int().positive().optional(),
@@ -24828,10 +25141,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24828
25141
  }), boolean()), method(object({
24829
25142
  deviceId: number().int().nonnegative(),
24830
25143
  sessionId: string()
24831
- }), object({ pendingRenegotiation: object({
24832
- target: WebrtcStreamTargetSchema,
24833
- epoch: number()
24834
- }).nullable() }));
25144
+ }), object({
25145
+ pendingRenegotiation: object({
25146
+ target: WebrtcStreamTargetSchema,
25147
+ epoch: number()
25148
+ }).nullable(),
25149
+ /**
25150
+ * Whether the session still EXISTS.
25151
+ *
25152
+ * A consumer that holds a resource for the life of a session needs to
25153
+ * be able to ask, because a session does not always end the way it
25154
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
25155
+ * sent `SessionDisconnected`, so the Alexa exporter's
25156
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
25157
+ * H.264 transcode kept running for NOBODY for more than twenty
25158
+ * minutes. The WebRTC session had logged `WebRTC session closed`
25159
+ * minutes earlier — the broker knew; the holder had no way to ask.
25160
+ *
25161
+ * `false` for a session id the provider has never heard of, which is
25162
+ * the same answer as "it ended": either way nothing is holding it up.
25163
+ */
25164
+ alive: boolean()
25165
+ }));
24835
25166
  object({
24836
25167
  /** All accessory children of the parent. */
24837
25168
  childDeviceIds: array(number()).readonly(),
@@ -29278,11 +29609,46 @@ var NativeObjectDetectionStatusSchema = object({
29278
29609
  supportedClasses: array(NativeObjectClassEnum).readonly(),
29279
29610
  /**
29280
29611
  * Whether forwarding of onboard AI detections is enabled for this device.
29281
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
29282
- * churn the tracker, so forwarding stays off until the operator enables it.
29612
+ *
29613
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
29614
+ * camera runs — that is the operator's choice, and it is made where every
29615
+ * other detection choice is made. `geometry` on
29616
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
29617
+ * choice would buy this particular camera.
29283
29618
  */
29284
29619
  enabled: boolean()
29285
29620
  });
29621
+ /**
29622
+ * WHEN a camera's onboard detections carry geometry.
29623
+ *
29624
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
29625
+ * a detection is a trackable subject whenever the camera sees one.
29626
+ * - `while-streaming` — only while some stream of this camera is already open.
29627
+ * The boxes ride the video's own side-channel rather than a feed of their
29628
+ * own, so they cost nothing and they exist only when something is pulling.
29629
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
29630
+ * radio drain, but a camera that is awake is awake precisely because
29631
+ * something is in front of it, and its stream is already being pulled.
29632
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
29633
+ * pipeline needs geometry to make a subject, so such a push reaches the
29634
+ * tracker as motion and no further.
29635
+ *
29636
+ * Reported and not inferred, because the operator's question in front of the
29637
+ * picker is "what do I get", and these are three different answers (D14: the
29638
+ * derived form is only as honest as `getOptions`).
29639
+ */
29640
+ var NativeObjectGeometryEnum = _enum([
29641
+ "boxed",
29642
+ "while-streaming",
29643
+ "flag-only"
29644
+ ]);
29645
+ var NativeObjectDetectionOptionsSchema = object({
29646
+ /** Classes this firmware can detect — the same list the status reports. */
29647
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
29648
+ /** What a detection from this camera carries. */
29649
+ geometry: NativeObjectGeometryEnum
29650
+ });
29651
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
29286
29652
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
29287
29653
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
29288
29654
  lastFetchedAt: number() });
@@ -29292,13 +29658,23 @@ var nativeObjectDetectionCapability = {
29292
29658
  deviceNative: true,
29293
29659
  mode: "singleton",
29294
29660
  deviceTypes: [DeviceType.Camera],
29295
- methods: { setEnabled: method(object({
29296
- deviceId: number(),
29297
- enabled: boolean()
29298
- }), _void(), {
29299
- kind: "mutation",
29300
- auth: "admin"
29301
- }) },
29661
+ methods: {
29662
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29663
+ setSettings: method(object({
29664
+ deviceId: number(),
29665
+ settings: NativeObjectDetectionSettingsPatchSchema
29666
+ }), _void(), {
29667
+ kind: "mutation",
29668
+ auth: "admin"
29669
+ }),
29670
+ setEnabled: method(object({
29671
+ deviceId: number(),
29672
+ enabled: boolean()
29673
+ }), _void(), {
29674
+ kind: "mutation",
29675
+ auth: "admin"
29676
+ })
29677
+ },
29302
29678
  events: { onDetected: { data: object({
29303
29679
  deviceId: number(),
29304
29680
  detection: NativeDetectionSchema
@@ -34146,7 +34522,28 @@ var PerScopeBreakdownSchema = object({
34146
34522
  /** Total tracked objects in this scope (frame / zone / unzoned). */
34147
34523
  totalObjects: number().int().nonnegative(),
34148
34524
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
34149
- byClass: record(string(), number().int().nonnegative())
34525
+ byClass: record(string(), number().int().nonnegative()),
34526
+ /**
34527
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
34528
+ * present but not going anywhere (a parked car, a bin, a statue).
34529
+ *
34530
+ * The operator's question about a scene has two halves and they answer
34531
+ * different things: "what is parked here" is stable for hours and must not
34532
+ * flap, while "who is walking through" is the thing an alert is about. One
34533
+ * number could only serve one of them, and `totalObjects` served the first
34534
+ * badly — a passer-by moved it and every occupancy rule saw a change.
34535
+ *
34536
+ * `standing + transient === totalObjects`, always. The total keeps its old
34537
+ * meaning exactly, so no rule written against it changes behaviour.
34538
+ *
34539
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
34540
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
34541
+ * parked objects here" about a camera whose lot is full.
34542
+ */
34543
+ standingObjects: number().int().nonnegative().optional(),
34544
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
34545
+ * same absence rule. */
34546
+ transientObjects: number().int().nonnegative().optional()
34150
34547
  });
34151
34548
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
34152
34549
  zoneId: string(),
@@ -34269,6 +34666,23 @@ var HistoryPointSchema = object({
34269
34666
  * triple covers the three spatial scopes (per-zone, frame-wide,
34270
34667
  * outside-any-zone). Crossing them with `className?` gives the full
34271
34668
  * combinatorial coverage the operator UI requested.
34669
+ *
34670
+ * ## ⚠️ The three history methods are DEPRECATED
34671
+ *
34672
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34673
+ * so after a restart they report nothing about a night that did happen, and any
34674
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34675
+ * an empty scene. The presets in the occupancy chart existed to hide that
34676
+ * horizon rather than to answer a question.
34677
+ *
34678
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34679
+ * instead. Those rows are already written for every camera, ~60 bytes per
34680
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34681
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34682
+ * function the writer uses, so the two cannot drift.
34683
+ *
34684
+ * The ring stays until these three go, and it is the only thing left reading
34685
+ * it. Do not add a fourth caller.
34272
34686
  */
34273
34687
  var zoneAnalyticsCapability = {
34274
34688
  name: "zone-analytics",
@@ -34758,6 +35172,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34758
35172
  smoke: smokeCapability,
34759
35173
  streamCatalog: streamCatalogCapability,
34760
35174
  streamParams: streamParamsCapability,
35175
+ streamSignals: streamSignalsCapability,
34761
35176
  switch: switchCapability,
34762
35177
  tamper: tamperCapability,
34763
35178
  temperatureSensor: temperatureSensorCapability,
@@ -38667,12 +39082,24 @@ Object.freeze({
38667
39082
  addonId: null,
38668
39083
  access: "create"
38669
39084
  },
39085
+ "nativeObjectDetection.getOptions": {
39086
+ capName: "native-object-detection",
39087
+ capScope: "device",
39088
+ addonId: null,
39089
+ access: "view"
39090
+ },
38670
39091
  "nativeObjectDetection.setEnabled": {
38671
39092
  capName: "native-object-detection",
38672
39093
  capScope: "device",
38673
39094
  addonId: null,
38674
39095
  access: "create"
38675
39096
  },
39097
+ "nativeObjectDetection.setSettings": {
39098
+ capName: "native-object-detection",
39099
+ capScope: "device",
39100
+ addonId: null,
39101
+ access: "create"
39102
+ },
38676
39103
  "navigation.getFeatures": {
38677
39104
  capName: "navigation",
38678
39105
  capScope: "device",
@@ -38937,6 +39364,12 @@ Object.freeze({
38937
39364
  addonId: null,
38938
39365
  access: "view"
38939
39366
  },
39367
+ "notificationRules.getClipRetentionAsks": {
39368
+ capName: "notification-rules",
39369
+ capScope: "system",
39370
+ addonId: null,
39371
+ access: "view"
39372
+ },
38940
39373
  "notificationRules.getConditionCatalog": {
38941
39374
  capName: "notification-rules",
38942
39375
  capScope: "system",
@@ -39447,6 +39880,12 @@ Object.freeze({
39447
39880
  addonId: null,
39448
39881
  access: "create"
39449
39882
  },
39883
+ "pipelineAnalytics.readLongTermSeries": {
39884
+ capName: "pipeline-analytics",
39885
+ capScope: "device",
39886
+ addonId: null,
39887
+ access: "view"
39888
+ },
39450
39889
  "pipelineAnalytics.rebuildObjectEmbeddings": {
39451
39890
  capName: "pipeline-analytics",
39452
39891
  capScope: "device",
@@ -40119,6 +40558,12 @@ Object.freeze({
40119
40558
  addonId: null,
40120
40559
  access: "create"
40121
40560
  },
40561
+ "pipelineRunner.requestOccupancyBurst": {
40562
+ capName: "pipeline-runner",
40563
+ capScope: "system",
40564
+ addonId: null,
40565
+ access: "create"
40566
+ },
40122
40567
  "pipelineRunner.runDetailSubtree": {
40123
40568
  capName: "pipeline-runner",
40124
40569
  capScope: "system",
@@ -41331,6 +41776,12 @@ Object.freeze({
41331
41776
  addonId: null,
41332
41777
  access: "create"
41333
41778
  },
41779
+ "streamBroker.reportStreamSignal": {
41780
+ capName: "stream-broker",
41781
+ capScope: "system",
41782
+ addonId: null,
41783
+ access: "create"
41784
+ },
41334
41785
  "streamBroker.restartProfile": {
41335
41786
  capName: "stream-broker",
41336
41787
  capScope: "system",
@@ -41415,6 +41866,12 @@ Object.freeze({
41415
41866
  addonId: null,
41416
41867
  access: "create"
41417
41868
  },
41869
+ "streamSignals.listSignals": {
41870
+ capName: "stream-signals",
41871
+ capScope: "device",
41872
+ addonId: null,
41873
+ access: "view"
41874
+ },
41418
41875
  "switch.setState": {
41419
41876
  capName: "switch",
41420
41877
  capScope: "device",
@@ -42887,11 +43344,21 @@ Object.freeze({
42887
43344
  form: "single",
42888
43345
  optional: false
42889
43346
  }],
43347
+ "nativeObjectDetection.getOptions": [{
43348
+ name: "deviceId",
43349
+ form: "single",
43350
+ optional: false
43351
+ }],
42890
43352
  "nativeObjectDetection.setEnabled": [{
42891
43353
  name: "deviceId",
42892
43354
  form: "single",
42893
43355
  optional: false
42894
43356
  }],
43357
+ "nativeObjectDetection.setSettings": [{
43358
+ name: "deviceId",
43359
+ form: "single",
43360
+ optional: false
43361
+ }],
42895
43362
  "navigation.getFeatures": [{
42896
43363
  name: "deviceId",
42897
43364
  form: "single",
@@ -43241,6 +43708,11 @@ Object.freeze({
43241
43708
  form: "single",
43242
43709
  optional: false
43243
43710
  }],
43711
+ "pipelineAnalytics.readLongTermSeries": [{
43712
+ name: "deviceId",
43713
+ form: "single",
43714
+ optional: false
43715
+ }],
43244
43716
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
43245
43717
  name: "deviceId",
43246
43718
  form: "single",
@@ -43431,6 +43903,11 @@ Object.freeze({
43431
43903
  form: "single",
43432
43904
  optional: false
43433
43905
  }],
43906
+ "pipelineRunner.requestOccupancyBurst": [{
43907
+ name: "deviceId",
43908
+ form: "single",
43909
+ optional: false
43910
+ }],
43434
43911
  "pipelineRunner.runDetailSubtree": [{
43435
43912
  name: "deviceId",
43436
43913
  form: "single",
@@ -43787,6 +44264,11 @@ Object.freeze({
43787
44264
  form: "single",
43788
44265
  optional: false
43789
44266
  }],
44267
+ "streamBroker.reportStreamSignal": [{
44268
+ name: "deviceId",
44269
+ form: "single",
44270
+ optional: false
44271
+ }],
43790
44272
  "streamBroker.restartProfile": [{
43791
44273
  name: "deviceId",
43792
44274
  form: "single",