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