@camstack/addon-provider-petkit 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.mjs CHANGED
@@ -1100,7 +1100,7 @@ var Nodepetkit = class {
1100
1100
  }
1101
1101
  };
1102
1102
  //#endregion
1103
- //#region ../types/dist/event-category-ZyX6jcse.mjs
1103
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
1104
1104
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
1105
1105
  EventCategory["SystemBoot"] = "system.boot";
1106
1106
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1717,6 +1717,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1717
1717
  * pull-reconcile from the provider's `getStatus` on reconnect. */
1718
1718
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
1719
1719
  EventCategory["BackupCompleted"] = "backup.completed";
1720
+ /**
1721
+ * A whole backup RUN finished — every destination attempted, win or lose.
1722
+ *
1723
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
1724
+ * a progress UI and the wrong one for a notification: an operator with three
1725
+ * destinations would be told three times. And a run where two of three
1726
+ * destinations succeeded is not a clean success — a single "backup
1727
+ * completed" that hid the failed one would be a lie, so the count of each is
1728
+ * carried here and the message says both.
1729
+ *
1730
+ * Emitted by the backup orchestrator only after the destination loop, so a
1731
+ * run that dies during the BUILD phase produces no completion at all.
1732
+ */
1733
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
1720
1734
  EventCategory["BackupRestored"] = "backup.restored";
1721
1735
  EventCategory["NotificationDispatched"] = "notification.dispatched";
1722
1736
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -6447,7 +6461,7 @@ var ZodIssueCode = {
6447
6461
  var ZodFirstPartyTypeKind;
6448
6462
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6449
6463
  //#endregion
6450
- //#region ../types/dist/sleep-DBKu2-U5.mjs
6464
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
6451
6465
  /**
6452
6466
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6453
6467
  * window to float samples (D455).
@@ -12591,6 +12605,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
12591
12605
  auth: "admin"
12592
12606
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
12593
12607
  DeviceType.Camera;
12608
+ /**
12609
+ * The signals a device can emit to WAKE its own stream.
12610
+ *
12611
+ * A camera whose stream is built on demand sleeps until something asks for it,
12612
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
12613
+ * puller holds a session open for ever, and treating that as demand would keep
12614
+ * a battery camera awake for ever, which is the whole thing the battery is for
12615
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
12616
+ * itself, with no stream running.
12617
+ *
12618
+ * ## The vocabulary is the PROVIDER'S, not ours
12619
+ *
12620
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
12621
+ * names each signal with a `code` it chooses and a `label` an operator reads.
12622
+ * Reolink offers motion and camera-native detection; another provider may offer
12623
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
12624
+ * yet. A fixed enum here would mean every new signal is a framework release.
12625
+ *
12626
+ * It is deliberately NOT derived from the caps a device already binds. Whether
12627
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
12628
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
12629
+ * binding — but both answer "what drives the detection pipeline", which is a
12630
+ * different question from "what may wake a sleeping stream". A camera can do
12631
+ * the first and not be trusted with the second, and the operator picks per
12632
+ * camera. Two questions, two authorities.
12633
+ *
12634
+ * ## Availability is not permission
12635
+ *
12636
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
12637
+ * wakes the stream is the operator's per-camera choice, held by the broker
12638
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
12639
+ * provider declaring a signal is not a provider enabling it.
12640
+ */
12641
+ /** One signal a device can emit. */
12642
+ var StreamSignalSchema = object({
12643
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
12644
+ code: string().min(1),
12645
+ /** What an operator reads in the picker. The provider's own wording. */
12646
+ label: string().min(1),
12647
+ /**
12648
+ * Whether the provider recommends this signal ON when a camera is first set
12649
+ * up. A provider knows which of its signals are cheap and reliable; an
12650
+ * operator should not have to discover that by trial. Reolink recommends
12651
+ * both of its own.
12652
+ */
12653
+ recommended: boolean()
12654
+ });
12655
+ var StreamSignalsStatusSchema = object({
12656
+ signals: array(StreamSignalSchema),
12657
+ lastFetchedAt: number()
12658
+ });
12659
+ var streamSignalsCapability = {
12660
+ name: "stream-signals",
12661
+ scope: "device",
12662
+ deviceNative: true,
12663
+ mode: "singleton",
12664
+ deviceTypes: Object.values(DeviceType),
12665
+ runtimeState: StreamSignalsStatusSchema,
12666
+ /**
12667
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
12668
+ *
12669
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
12670
+ * not an operator choice: the provider re-declares it on every registration,
12671
+ * so losing it loses nothing and persisting it would freeze an answer the
12672
+ * camera is entitled to change. Measured the same day on the sibling case —
12673
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
12674
+ * class the camera really detected stayed missing for the life of the row
12675
+ * because the fix could not reach it.
12676
+ *
12677
+ * See `RuntimeStateDurability`. Enforced by
12678
+ * `scripts/check-runtime-state-durability.ts`.
12679
+ */
12680
+ durability: "session",
12681
+ methods: {
12682
+ /**
12683
+ * What this device can emit. Empty is a valid and common answer — most
12684
+ * cameras have nothing to offer here, and an empty list is what makes the
12685
+ * broker's picker show nothing rather than a false choice.
12686
+ */
12687
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
12688
+ };
12594
12689
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
12595
12690
  var StreamFormatSchema = _enum([
12596
12691
  "webrtc",
@@ -12987,6 +13082,22 @@ var EgressTranscodeSchema = object({
12987
13082
  camStreamId: string().nullable()
12988
13083
  });
12989
13084
  method(object({
13085
+ deviceId: number().int().nonnegative(),
13086
+ /** The provider's signal code. */
13087
+ code: string().min(1),
13088
+ /** Ms epoch. Absent ⇒ now. */
13089
+ at: number().optional()
13090
+ }), object({
13091
+ /** Whether the broker acted on it, and if not, why. */
13092
+ accepted: boolean(),
13093
+ reason: _enum([
13094
+ "woke",
13095
+ "hold-extended",
13096
+ "not-enabled",
13097
+ "no-consumer",
13098
+ "unknown-code"
13099
+ ])
13100
+ }), { kind: "mutation" }), method(object({
12990
13101
  deviceId: number().int().nonnegative(),
12991
13102
  camStreamId: string().min(1),
12992
13103
  kind: CamStreamKindSchema,
@@ -13241,6 +13352,16 @@ var PickStreamRequirementsSchema = object({
13241
13352
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
13242
13353
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
13243
13354
  minHeight: number().int().positive().optional(),
13355
+ /**
13356
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
13357
+ *
13358
+ * A consumer can have a ceiling as real as its floor: Alexa documents
13359
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
13360
+ * Without this the ceiling had to be re-implemented by every caller — and
13361
+ * one caller implementing it privately is how a second scoring authority
13362
+ * gets born.
13363
+ */
13364
+ maxHeight: number().int().positive().optional(),
13244
13365
  /** Minimum horizontal resolution. */
13245
13366
  minWidth: number().int().positive().optional(),
13246
13367
  /**
@@ -13257,7 +13378,22 @@ var PickStreamRequirementsSchema = object({
13257
13378
  * transcoded" guard: if the device is already serving the consumer's
13258
13379
  * codec end-to-end, there's nothing to optimise.
13259
13380
  */
13260
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
13381
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
13382
+ /**
13383
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
13384
+ * understanding that it will be transcoded.
13385
+ *
13386
+ * Default `false` — today's behaviour, and the right one for a bypass
13387
+ * question ("is there a stream I can forward untouched?"). Set `true` to
13388
+ * ask the larger question: "what is the best stream for me, transcoding if
13389
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
13390
+ * does not, so a passthrough is never lost to a transcode; the answer says
13391
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
13392
+ *
13393
+ * This is what lets one picker serve both the bypass and the full source
13394
+ * choice, instead of a consumer scoring privately when the bypass misses.
13395
+ */
13396
+ allowTranscode: boolean().optional()
13261
13397
  }).readonly();
13262
13398
  var PickStreamPreferencesSchema = object({
13263
13399
  /**
@@ -13271,12 +13407,32 @@ var PickStreamPreferencesSchema = object({
13271
13407
  * picks the tallest stream; `'lowest'` picks the shortest (used by
13272
13408
  * memory-constrained consumers / Apple Home guest sessions).
13273
13409
  */
13274
- resolutionPreference: _enum(["highest", "lowest"]).optional()
13410
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
13411
+ /**
13412
+ * The height the consumer actually wants to DELIVER.
13413
+ *
13414
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
13415
+ * above the target wins, and only if nothing reaches it does the tallest
13416
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
13417
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
13418
+ * express that: it says "as big as possible", which is a different wish.
13419
+ *
13420
+ * Ignored when absent, so every existing caller keeps its ordering.
13421
+ */
13422
+ targetHeight: number().int().positive().optional()
13275
13423
  }).readonly();
13276
13424
  var PickedCamStreamSchema = object({
13277
13425
  camStreamId: string(),
13278
13426
  codec: string().optional(),
13279
13427
  resolution: CamStreamResolutionSchema.optional(),
13428
+ /**
13429
+ * Whether serving this stream requires a decode + re-encode.
13430
+ *
13431
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
13432
+ * when the caller asked for it with `allowTranscode`, so a caller that did
13433
+ * not ask cannot be handed a cost it never agreed to pay.
13434
+ */
13435
+ transcodes: boolean(),
13280
13436
  /** One-line explanation of why this stream won — for logs / debug UI. */
13281
13437
  reason: string()
13282
13438
  });
@@ -17810,6 +17966,8 @@ var NcSystemEventKindSchema = _enum([
17810
17966
  "device-enabled",
17811
17967
  "device-battery-low",
17812
17968
  "device-battery-normal",
17969
+ "device-consumable-low",
17970
+ "device-consumable-normal",
17813
17971
  "stream-online",
17814
17972
  "stream-offline",
17815
17973
  "node-online",
@@ -17828,6 +17986,7 @@ var NcSystemEventKindSchema = _enum([
17828
17986
  "addon-updated",
17829
17987
  "server-updated",
17830
17988
  "export-completed",
17989
+ "backup-completed",
17831
17990
  "camera-online",
17832
17991
  "camera-offline",
17833
17992
  "camera-disabled",
@@ -19150,6 +19309,48 @@ var NcAlarmConfigSchema = object({
19150
19309
  settings: NcAlarmSettingsSchema,
19151
19310
  coverage: array(NcAlarmModeCoverageSchema)
19152
19311
  });
19312
+ /**
19313
+ * ONE rule's demand on ONE camera's clip ring.
19314
+ *
19315
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
19316
+ * camera, so the answer stays a faithful description of the rules and the
19317
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
19318
+ * lives. A camera that appears in no ask is being told **nothing** — which is
19319
+ * a different thing from never having been told, and only the envelope
19320
+ * (`rulesLoaded`) can tell those apart.
19321
+ */
19322
+ var NcClipRetentionAskSchema = object({
19323
+ /**
19324
+ * The camera this ask is about. **Absent = every camera**, which is what a
19325
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
19326
+ * asking everywhere.
19327
+ */
19328
+ deviceId: number().int().nonnegative().optional(),
19329
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
19330
+ * needs nothing produces no ask at all. */
19331
+ seconds: number().min(0).max(60),
19332
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
19333
+ * assigned, which is what the cut defaults to. */
19334
+ profile: CamProfileSchema.optional(),
19335
+ /** Who is asking — so a retention the operator did not expect names a rule. */
19336
+ ruleId: string(),
19337
+ ruleName: string(),
19338
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
19339
+ reason: _enum(["window", "occupancy"])
19340
+ });
19341
+ /**
19342
+ * The whole answer, with the one bit that keeps absence from reading as zero.
19343
+ *
19344
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
19345
+ * once. A centre that is up but has not read its rules yet answers with an
19346
+ * empty ask list that means nothing at all — applying it would drop every
19347
+ * camera's ring to zero for the first events after a restart, which is the
19348
+ * footage this mechanism exists to keep.
19349
+ */
19350
+ var NcClipRetentionPlanSchema = object({
19351
+ rulesLoaded: boolean(),
19352
+ asks: array(NcClipRetentionAskSchema).readonly()
19353
+ });
19153
19354
  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 }), {
19154
19355
  kind: "mutation",
19155
19356
  auth: "admin",
@@ -19170,7 +19371,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
19170
19371
  }), object({ success: literal(true) }), {
19171
19372
  kind: "mutation",
19172
19373
  auth: "admin"
19173
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
19374
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
19174
19375
  deviceId: number().int(),
19175
19376
  muted: boolean()
19176
19377
  }), object({ success: literal(true) }), {
@@ -21744,6 +21945,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
21744
21945
  * solid is this track", cheaper than re-deriving it from a trajectory. */
21745
21946
  framesMatched: number().int()
21746
21947
  })).readonly() });
21948
+ /**
21949
+ * The long-term series a camera produces. A closed union so a typo cannot
21950
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21951
+ * is an alias of this, not a second list.
21952
+ */
21953
+ var AnalyticsLtsSeriesSchema = _enum([
21954
+ "motion",
21955
+ "audio-dbfs",
21956
+ "battery",
21957
+ "occupancy"
21958
+ ]);
21959
+ /**
21960
+ * One closed 5-minute bucket of a long-term series.
21961
+ *
21962
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21963
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21964
+ * that exists at all was measured; a bucket that is absent was not, which is a
21965
+ * different claim from zero and the reason this is a sparse series.
21966
+ */
21967
+ var LtsBucketSchema = object({
21968
+ scope: string(),
21969
+ bucketStart: number().int(),
21970
+ samples: number().int().nonnegative(),
21971
+ sum: number(),
21972
+ min: number(),
21973
+ max: number()
21974
+ });
21747
21975
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
21748
21976
  deviceId: number(),
21749
21977
  trackId: string()
@@ -21790,6 +22018,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21790
22018
  kinds: array(string()).optional(),
21791
22019
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
21792
22020
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
22021
+ deviceId: number(),
22022
+ series: AnalyticsLtsSeriesSchema,
22023
+ /** Omit for EVERY scope of this series in the range. */
22024
+ scope: string().optional(),
22025
+ from: number(),
22026
+ to: number(),
22027
+ limit: number().int().positive().optional()
22028
+ }), array(LtsBucketSchema).readonly()), method(object({
21793
22029
  deviceId: number(),
21794
22030
  since: number(),
21795
22031
  until: number(),
@@ -22408,6 +22644,14 @@ var MotionSourceEnum = _enum([
22408
22644
  */
22409
22645
  var MotionSourcesSchema = array(MotionSourceEnum);
22410
22646
  /**
22647
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
22648
+ * post-analysis already tags every detection with (`DetectionSource`) rather
22649
+ * than a second spelling of the same two ideas — the value an operator picks
22650
+ * here is the value that comes back on the track, the overlay and the debug
22651
+ * row.
22652
+ */
22653
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
22654
+ /**
22411
22655
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
22412
22656
  * so cap-side consumers (the orchestrator forward, the runner addon's
22413
22657
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -22558,6 +22802,35 @@ var RunnerCameraConfigSchema = object({
22558
22802
  * events; the orchestrator forwards to `reportMotion`.
22559
22803
  */
22560
22804
  motionSources: MotionSourcesSchema.default(["analyzer"]),
22805
+ /**
22806
+ * WHICH root detector runs for this camera. The detection counterpart of
22807
+ * {@link motionSources}, same shape and same discipline: a per-camera list
22808
+ * of sources the system understands, vendor-agnostic, owned here.
22809
+ *
22810
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
22811
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
22812
+ * here. Its boxes reach post-analysis on the same
22813
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
22814
+ * track gets the same tracker, the same overlay and the same detail
22815
+ * subtree (face / plate / embedding).
22816
+ *
22817
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
22818
+ * run, and that is where a camera with a usable onboard detector buys back
22819
+ * its share of the accelerator. It saves the root inference, not the decode
22820
+ * — the detail subtree still needs pixels to cut crops from.
22821
+ *
22822
+ * A camera whose onboard detections carry no geometry cannot serve as a root
22823
+ * step at all (there is nothing to track), and the cap that knows this says
22824
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
22825
+ * every battery camera: the boxes ride a sub-stream a battery camera never
22826
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
22827
+ * worth exactly what it already is — a wake signal with a class.
22828
+ *
22829
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
22830
+ * vendor never turns a detector on for the operator, and neither does a
22831
+ * default.
22832
+ */
22833
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
22561
22834
  pipelineEnabled: boolean().default(true),
22562
22835
  /** Ordered tree of video steps. Absent → runner skips video detection. */
22563
22836
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -22739,7 +23012,47 @@ var RunnerLocalMetricsSchema = object({
22739
23012
  queueDepth: number(),
22740
23013
  frameLazy: FrameLazyMetricsSchema.optional()
22741
23014
  });
23015
+ /**
23016
+ * Pipeline Runner capability — runtime detection workhorse.
23017
+ *
23018
+ * One instance per node. Receives camera assignments from
23019
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
23020
+ * decoded frames, drains motion + detection queues, calls the local
23021
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
23022
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
23023
+ * the bus.
23024
+ *
23025
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
23026
+ * runner has zero knowledge of other agents, no global state, and never
23027
+ * makes assignment decisions itself.
23028
+ */
23029
+ /**
23030
+ * Why a runner declined to look at a camera out of band. Named rather than a
23031
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
23032
+ * already mid-session and one already bursting are four different facts, and a
23033
+ * caller told only "no" cannot tell a protection from a bug.
23034
+ */
23035
+ var OccupancyBurstRefusalSchema = _enum([
23036
+ "not-attached",
23037
+ "battery-asleep",
23038
+ "not-watching",
23039
+ "already-bursting"
23040
+ ]);
22742
23041
  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({
23042
+ deviceId: number(),
23043
+ /** How many frames to collect. The caller sizes this against what its
23044
+ * own confirmation needs; the runner clamps it to the field's range. */
23045
+ frames: number().int().positive().optional(),
23046
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
23047
+ * defend — the periodic one at least has a timer to point at. */
23048
+ reason: string()
23049
+ }), object({
23050
+ started: boolean(),
23051
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
23052
+ }), {
23053
+ auth: "admin",
23054
+ kind: "mutation"
23055
+ }), method(object({
22743
23056
  handle: FrameHandleSchema,
22744
23057
  bbox: NativeCropBboxSchema,
22745
23058
  maxWidth: number().int().positive().optional(),
@@ -25109,10 +25422,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
25109
25422
  }), boolean()), method(object({
25110
25423
  deviceId: number().int().nonnegative(),
25111
25424
  sessionId: string()
25112
- }), object({ pendingRenegotiation: object({
25113
- target: WebrtcStreamTargetSchema,
25114
- epoch: number()
25115
- }).nullable() }));
25425
+ }), object({
25426
+ pendingRenegotiation: object({
25427
+ target: WebrtcStreamTargetSchema,
25428
+ epoch: number()
25429
+ }).nullable(),
25430
+ /**
25431
+ * Whether the session still EXISTS.
25432
+ *
25433
+ * A consumer that holds a resource for the life of a session needs to
25434
+ * be able to ask, because a session does not always end the way it
25435
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
25436
+ * sent `SessionDisconnected`, so the Alexa exporter's
25437
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
25438
+ * H.264 transcode kept running for NOBODY for more than twenty
25439
+ * minutes. The WebRTC session had logged `WebRTC session closed`
25440
+ * minutes earlier — the broker knew; the holder had no way to ask.
25441
+ *
25442
+ * `false` for a session id the provider has never heard of, which is
25443
+ * the same answer as "it ended": either way nothing is holding it up.
25444
+ */
25445
+ alive: boolean()
25446
+ }));
25116
25447
  object({
25117
25448
  /** All accessory children of the parent. */
25118
25449
  childDeviceIds: array(number()).readonly(),
@@ -29559,11 +29890,46 @@ var NativeObjectDetectionStatusSchema = object({
29559
29890
  supportedClasses: array(NativeObjectClassEnum).readonly(),
29560
29891
  /**
29561
29892
  * Whether forwarding of onboard AI detections is enabled for this device.
29562
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
29563
- * churn the tracker, so forwarding stays off until the operator enables it.
29893
+ *
29894
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
29895
+ * camera runs — that is the operator's choice, and it is made where every
29896
+ * other detection choice is made. `geometry` on
29897
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
29898
+ * choice would buy this particular camera.
29564
29899
  */
29565
29900
  enabled: boolean()
29566
29901
  });
29902
+ /**
29903
+ * WHEN a camera's onboard detections carry geometry.
29904
+ *
29905
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
29906
+ * a detection is a trackable subject whenever the camera sees one.
29907
+ * - `while-streaming` — only while some stream of this camera is already open.
29908
+ * The boxes ride the video's own side-channel rather than a feed of their
29909
+ * own, so they cost nothing and they exist only when something is pulling.
29910
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
29911
+ * radio drain, but a camera that is awake is awake precisely because
29912
+ * something is in front of it, and its stream is already being pulled.
29913
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
29914
+ * pipeline needs geometry to make a subject, so such a push reaches the
29915
+ * tracker as motion and no further.
29916
+ *
29917
+ * Reported and not inferred, because the operator's question in front of the
29918
+ * picker is "what do I get", and these are three different answers (D14: the
29919
+ * derived form is only as honest as `getOptions`).
29920
+ */
29921
+ var NativeObjectGeometryEnum = _enum([
29922
+ "boxed",
29923
+ "while-streaming",
29924
+ "flag-only"
29925
+ ]);
29926
+ var NativeObjectDetectionOptionsSchema = object({
29927
+ /** Classes this firmware can detect — the same list the status reports. */
29928
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
29929
+ /** What a detection from this camera carries. */
29930
+ geometry: NativeObjectGeometryEnum
29931
+ });
29932
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
29567
29933
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
29568
29934
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
29569
29935
  lastFetchedAt: number() });
@@ -29573,13 +29939,23 @@ var nativeObjectDetectionCapability = {
29573
29939
  deviceNative: true,
29574
29940
  mode: "singleton",
29575
29941
  deviceTypes: [DeviceType.Camera],
29576
- methods: { setEnabled: method(object({
29577
- deviceId: number(),
29578
- enabled: boolean()
29579
- }), _void(), {
29580
- kind: "mutation",
29581
- auth: "admin"
29582
- }) },
29942
+ methods: {
29943
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29944
+ setSettings: method(object({
29945
+ deviceId: number(),
29946
+ settings: NativeObjectDetectionSettingsPatchSchema
29947
+ }), _void(), {
29948
+ kind: "mutation",
29949
+ auth: "admin"
29950
+ }),
29951
+ setEnabled: method(object({
29952
+ deviceId: number(),
29953
+ enabled: boolean()
29954
+ }), _void(), {
29955
+ kind: "mutation",
29956
+ auth: "admin"
29957
+ })
29958
+ },
29583
29959
  events: { onDetected: { data: object({
29584
29960
  deviceId: number(),
29585
29961
  detection: NativeDetectionSchema
@@ -34427,7 +34803,28 @@ var PerScopeBreakdownSchema = object({
34427
34803
  /** Total tracked objects in this scope (frame / zone / unzoned). */
34428
34804
  totalObjects: number().int().nonnegative(),
34429
34805
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
34430
- byClass: record(string(), number().int().nonnegative())
34806
+ byClass: record(string(), number().int().nonnegative()),
34807
+ /**
34808
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
34809
+ * present but not going anywhere (a parked car, a bin, a statue).
34810
+ *
34811
+ * The operator's question about a scene has two halves and they answer
34812
+ * different things: "what is parked here" is stable for hours and must not
34813
+ * flap, while "who is walking through" is the thing an alert is about. One
34814
+ * number could only serve one of them, and `totalObjects` served the first
34815
+ * badly — a passer-by moved it and every occupancy rule saw a change.
34816
+ *
34817
+ * `standing + transient === totalObjects`, always. The total keeps its old
34818
+ * meaning exactly, so no rule written against it changes behaviour.
34819
+ *
34820
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
34821
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
34822
+ * parked objects here" about a camera whose lot is full.
34823
+ */
34824
+ standingObjects: number().int().nonnegative().optional(),
34825
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
34826
+ * same absence rule. */
34827
+ transientObjects: number().int().nonnegative().optional()
34431
34828
  });
34432
34829
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
34433
34830
  zoneId: string(),
@@ -34550,6 +34947,23 @@ var HistoryPointSchema = object({
34550
34947
  * triple covers the three spatial scopes (per-zone, frame-wide,
34551
34948
  * outside-any-zone). Crossing them with `className?` gives the full
34552
34949
  * combinatorial coverage the operator UI requested.
34950
+ *
34951
+ * ## ⚠️ The three history methods are DEPRECATED
34952
+ *
34953
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34954
+ * so after a restart they report nothing about a night that did happen, and any
34955
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34956
+ * an empty scene. The presets in the occupancy chart existed to hide that
34957
+ * horizon rather than to answer a question.
34958
+ *
34959
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34960
+ * instead. Those rows are already written for every camera, ~60 bytes per
34961
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34962
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34963
+ * function the writer uses, so the two cannot drift.
34964
+ *
34965
+ * The ring stays until these three go, and it is the only thing left reading
34966
+ * it. Do not add a fourth caller.
34553
34967
  */
34554
34968
  var zoneAnalyticsCapability = {
34555
34969
  name: "zone-analytics",
@@ -35039,6 +35453,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
35039
35453
  smoke: smokeCapability,
35040
35454
  streamCatalog: streamCatalogCapability,
35041
35455
  streamParams: streamParamsCapability,
35456
+ streamSignals: streamSignalsCapability,
35042
35457
  switch: switchCapability,
35043
35458
  tamper: tamperCapability,
35044
35459
  temperatureSensor: temperatureSensorCapability,
@@ -38948,12 +39363,24 @@ Object.freeze({
38948
39363
  addonId: null,
38949
39364
  access: "create"
38950
39365
  },
39366
+ "nativeObjectDetection.getOptions": {
39367
+ capName: "native-object-detection",
39368
+ capScope: "device",
39369
+ addonId: null,
39370
+ access: "view"
39371
+ },
38951
39372
  "nativeObjectDetection.setEnabled": {
38952
39373
  capName: "native-object-detection",
38953
39374
  capScope: "device",
38954
39375
  addonId: null,
38955
39376
  access: "create"
38956
39377
  },
39378
+ "nativeObjectDetection.setSettings": {
39379
+ capName: "native-object-detection",
39380
+ capScope: "device",
39381
+ addonId: null,
39382
+ access: "create"
39383
+ },
38957
39384
  "navigation.getFeatures": {
38958
39385
  capName: "navigation",
38959
39386
  capScope: "device",
@@ -39218,6 +39645,12 @@ Object.freeze({
39218
39645
  addonId: null,
39219
39646
  access: "view"
39220
39647
  },
39648
+ "notificationRules.getClipRetentionAsks": {
39649
+ capName: "notification-rules",
39650
+ capScope: "system",
39651
+ addonId: null,
39652
+ access: "view"
39653
+ },
39221
39654
  "notificationRules.getConditionCatalog": {
39222
39655
  capName: "notification-rules",
39223
39656
  capScope: "system",
@@ -39728,6 +40161,12 @@ Object.freeze({
39728
40161
  addonId: null,
39729
40162
  access: "create"
39730
40163
  },
40164
+ "pipelineAnalytics.readLongTermSeries": {
40165
+ capName: "pipeline-analytics",
40166
+ capScope: "device",
40167
+ addonId: null,
40168
+ access: "view"
40169
+ },
39731
40170
  "pipelineAnalytics.rebuildObjectEmbeddings": {
39732
40171
  capName: "pipeline-analytics",
39733
40172
  capScope: "device",
@@ -40400,6 +40839,12 @@ Object.freeze({
40400
40839
  addonId: null,
40401
40840
  access: "create"
40402
40841
  },
40842
+ "pipelineRunner.requestOccupancyBurst": {
40843
+ capName: "pipeline-runner",
40844
+ capScope: "system",
40845
+ addonId: null,
40846
+ access: "create"
40847
+ },
40403
40848
  "pipelineRunner.runDetailSubtree": {
40404
40849
  capName: "pipeline-runner",
40405
40850
  capScope: "system",
@@ -41612,6 +42057,12 @@ Object.freeze({
41612
42057
  addonId: null,
41613
42058
  access: "create"
41614
42059
  },
42060
+ "streamBroker.reportStreamSignal": {
42061
+ capName: "stream-broker",
42062
+ capScope: "system",
42063
+ addonId: null,
42064
+ access: "create"
42065
+ },
41615
42066
  "streamBroker.restartProfile": {
41616
42067
  capName: "stream-broker",
41617
42068
  capScope: "system",
@@ -41696,6 +42147,12 @@ Object.freeze({
41696
42147
  addonId: null,
41697
42148
  access: "create"
41698
42149
  },
42150
+ "streamSignals.listSignals": {
42151
+ capName: "stream-signals",
42152
+ capScope: "device",
42153
+ addonId: null,
42154
+ access: "view"
42155
+ },
41699
42156
  "switch.setState": {
41700
42157
  capName: "switch",
41701
42158
  capScope: "device",
@@ -43168,11 +43625,21 @@ Object.freeze({
43168
43625
  form: "single",
43169
43626
  optional: false
43170
43627
  }],
43628
+ "nativeObjectDetection.getOptions": [{
43629
+ name: "deviceId",
43630
+ form: "single",
43631
+ optional: false
43632
+ }],
43171
43633
  "nativeObjectDetection.setEnabled": [{
43172
43634
  name: "deviceId",
43173
43635
  form: "single",
43174
43636
  optional: false
43175
43637
  }],
43638
+ "nativeObjectDetection.setSettings": [{
43639
+ name: "deviceId",
43640
+ form: "single",
43641
+ optional: false
43642
+ }],
43176
43643
  "navigation.getFeatures": [{
43177
43644
  name: "deviceId",
43178
43645
  form: "single",
@@ -43522,6 +43989,11 @@ Object.freeze({
43522
43989
  form: "single",
43523
43990
  optional: false
43524
43991
  }],
43992
+ "pipelineAnalytics.readLongTermSeries": [{
43993
+ name: "deviceId",
43994
+ form: "single",
43995
+ optional: false
43996
+ }],
43525
43997
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
43526
43998
  name: "deviceId",
43527
43999
  form: "single",
@@ -43712,6 +44184,11 @@ Object.freeze({
43712
44184
  form: "single",
43713
44185
  optional: false
43714
44186
  }],
44187
+ "pipelineRunner.requestOccupancyBurst": [{
44188
+ name: "deviceId",
44189
+ form: "single",
44190
+ optional: false
44191
+ }],
43715
44192
  "pipelineRunner.runDetailSubtree": [{
43716
44193
  name: "deviceId",
43717
44194
  form: "single",
@@ -44068,6 +44545,11 @@ Object.freeze({
44068
44545
  form: "single",
44069
44546
  optional: false
44070
44547
  }],
44548
+ "streamBroker.reportStreamSignal": [{
44549
+ name: "deviceId",
44550
+ form: "single",
44551
+ optional: false
44552
+ }],
44071
44553
  "streamBroker.restartProfile": [{
44072
44554
  name: "deviceId",
44073
44555
  form: "single",