@camstack/addon-terminal 0.1.106 → 0.1.108

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
@@ -8,7 +8,7 @@ import { createServer } from "node:http";
8
8
  //#region \0rolldown/runtime.js
9
9
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
10
  //#endregion
11
- //#region ../types/dist/event-category-ZyX6jcse.mjs
11
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
12
12
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
13
13
  EventCategory["SystemBoot"] = "system.boot";
14
14
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -625,6 +625,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
625
625
  * pull-reconcile from the provider's `getStatus` on reconnect. */
626
626
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
627
627
  EventCategory["BackupCompleted"] = "backup.completed";
628
+ /**
629
+ * A whole backup RUN finished — every destination attempted, win or lose.
630
+ *
631
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
632
+ * a progress UI and the wrong one for a notification: an operator with three
633
+ * destinations would be told three times. And a run where two of three
634
+ * destinations succeeded is not a clean success — a single "backup
635
+ * completed" that hid the failed one would be a lie, so the count of each is
636
+ * carried here and the message says both.
637
+ *
638
+ * Emitted by the backup orchestrator only after the destination loop, so a
639
+ * run that dies during the BUILD phase produces no completion at all.
640
+ */
641
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
628
642
  EventCategory["BackupRestored"] = "backup.restored";
629
643
  EventCategory["NotificationDispatched"] = "notification.dispatched";
630
644
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5355,7 +5369,7 @@ var ZodIssueCode = {
5355
5369
  var ZodFirstPartyTypeKind;
5356
5370
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5357
5371
  //#endregion
5358
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5372
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5359
5373
  /**
5360
5374
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5361
5375
  * window to float samples (D455).
@@ -11566,6 +11580,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11566
11580
  auth: "admin"
11567
11581
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11568
11582
  DeviceType.Camera;
11583
+ /**
11584
+ * The signals a device can emit to WAKE its own stream.
11585
+ *
11586
+ * A camera whose stream is built on demand sleeps until something asks for it,
11587
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11588
+ * puller holds a session open for ever, and treating that as demand would keep
11589
+ * a battery camera awake for ever, which is the whole thing the battery is for
11590
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11591
+ * itself, with no stream running.
11592
+ *
11593
+ * ## The vocabulary is the PROVIDER'S, not ours
11594
+ *
11595
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11596
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11597
+ * Reolink offers motion and camera-native detection; another provider may offer
11598
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11599
+ * yet. A fixed enum here would mean every new signal is a framework release.
11600
+ *
11601
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11602
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11603
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11604
+ * binding — but both answer "what drives the detection pipeline", which is a
11605
+ * different question from "what may wake a sleeping stream". A camera can do
11606
+ * the first and not be trusted with the second, and the operator picks per
11607
+ * camera. Two questions, two authorities.
11608
+ *
11609
+ * ## Availability is not permission
11610
+ *
11611
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11612
+ * wakes the stream is the operator's per-camera choice, held by the broker
11613
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11614
+ * provider declaring a signal is not a provider enabling it.
11615
+ */
11616
+ /** One signal a device can emit. */
11617
+ var StreamSignalSchema = object({
11618
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11619
+ code: string().min(1),
11620
+ /** What an operator reads in the picker. The provider's own wording. */
11621
+ label: string().min(1),
11622
+ /**
11623
+ * Whether the provider recommends this signal ON when a camera is first set
11624
+ * up. A provider knows which of its signals are cheap and reliable; an
11625
+ * operator should not have to discover that by trial. Reolink recommends
11626
+ * both of its own.
11627
+ */
11628
+ recommended: boolean()
11629
+ });
11630
+ var StreamSignalsStatusSchema = object({
11631
+ signals: array(StreamSignalSchema),
11632
+ lastFetchedAt: number()
11633
+ });
11634
+ var streamSignalsCapability = {
11635
+ name: "stream-signals",
11636
+ scope: "device",
11637
+ deviceNative: true,
11638
+ mode: "singleton",
11639
+ deviceTypes: Object.values(DeviceType),
11640
+ runtimeState: StreamSignalsStatusSchema,
11641
+ /**
11642
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11643
+ *
11644
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11645
+ * not an operator choice: the provider re-declares it on every registration,
11646
+ * so losing it loses nothing and persisting it would freeze an answer the
11647
+ * camera is entitled to change. Measured the same day on the sibling case —
11648
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11649
+ * class the camera really detected stayed missing for the life of the row
11650
+ * because the fix could not reach it.
11651
+ *
11652
+ * See `RuntimeStateDurability`. Enforced by
11653
+ * `scripts/check-runtime-state-durability.ts`.
11654
+ */
11655
+ durability: "session",
11656
+ methods: {
11657
+ /**
11658
+ * What this device can emit. Empty is a valid and common answer — most
11659
+ * cameras have nothing to offer here, and an empty list is what makes the
11660
+ * broker's picker show nothing rather than a false choice.
11661
+ */
11662
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11663
+ };
11569
11664
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11570
11665
  var StreamFormatSchema = _enum([
11571
11666
  "webrtc",
@@ -11962,6 +12057,22 @@ var EgressTranscodeSchema = object({
11962
12057
  camStreamId: string().nullable()
11963
12058
  });
11964
12059
  method(object({
12060
+ deviceId: number().int().nonnegative(),
12061
+ /** The provider's signal code. */
12062
+ code: string().min(1),
12063
+ /** Ms epoch. Absent ⇒ now. */
12064
+ at: number().optional()
12065
+ }), object({
12066
+ /** Whether the broker acted on it, and if not, why. */
12067
+ accepted: boolean(),
12068
+ reason: _enum([
12069
+ "woke",
12070
+ "hold-extended",
12071
+ "not-enabled",
12072
+ "no-consumer",
12073
+ "unknown-code"
12074
+ ])
12075
+ }), { kind: "mutation" }), method(object({
11965
12076
  deviceId: number().int().nonnegative(),
11966
12077
  camStreamId: string().min(1),
11967
12078
  kind: CamStreamKindSchema,
@@ -12216,6 +12327,16 @@ var PickStreamRequirementsSchema = object({
12216
12327
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12217
12328
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12218
12329
  minHeight: number().int().positive().optional(),
12330
+ /**
12331
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12332
+ *
12333
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12334
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12335
+ * Without this the ceiling had to be re-implemented by every caller — and
12336
+ * one caller implementing it privately is how a second scoring authority
12337
+ * gets born.
12338
+ */
12339
+ maxHeight: number().int().positive().optional(),
12219
12340
  /** Minimum horizontal resolution. */
12220
12341
  minWidth: number().int().positive().optional(),
12221
12342
  /**
@@ -12232,7 +12353,22 @@ var PickStreamRequirementsSchema = object({
12232
12353
  * transcoded" guard: if the device is already serving the consumer's
12233
12354
  * codec end-to-end, there's nothing to optimise.
12234
12355
  */
12235
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12356
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12357
+ /**
12358
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12359
+ * understanding that it will be transcoded.
12360
+ *
12361
+ * Default `false` — today's behaviour, and the right one for a bypass
12362
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12363
+ * ask the larger question: "what is the best stream for me, transcoding if
12364
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12365
+ * does not, so a passthrough is never lost to a transcode; the answer says
12366
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12367
+ *
12368
+ * This is what lets one picker serve both the bypass and the full source
12369
+ * choice, instead of a consumer scoring privately when the bypass misses.
12370
+ */
12371
+ allowTranscode: boolean().optional()
12236
12372
  }).readonly();
12237
12373
  var PickStreamPreferencesSchema = object({
12238
12374
  /**
@@ -12246,12 +12382,32 @@ var PickStreamPreferencesSchema = object({
12246
12382
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12247
12383
  * memory-constrained consumers / Apple Home guest sessions).
12248
12384
  */
12249
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12385
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12386
+ /**
12387
+ * The height the consumer actually wants to DELIVER.
12388
+ *
12389
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12390
+ * above the target wins, and only if nothing reaches it does the tallest
12391
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12392
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12393
+ * express that: it says "as big as possible", which is a different wish.
12394
+ *
12395
+ * Ignored when absent, so every existing caller keeps its ordering.
12396
+ */
12397
+ targetHeight: number().int().positive().optional()
12250
12398
  }).readonly();
12251
12399
  var PickedCamStreamSchema = object({
12252
12400
  camStreamId: string(),
12253
12401
  codec: string().optional(),
12254
12402
  resolution: CamStreamResolutionSchema.optional(),
12403
+ /**
12404
+ * Whether serving this stream requires a decode + re-encode.
12405
+ *
12406
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12407
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12408
+ * not ask cannot be handed a cost it never agreed to pay.
12409
+ */
12410
+ transcodes: boolean(),
12255
12411
  /** One-line explanation of why this stream won — for logs / debug UI. */
12256
12412
  reason: string()
12257
12413
  });
@@ -16687,6 +16843,8 @@ var NcSystemEventKindSchema = _enum([
16687
16843
  "device-enabled",
16688
16844
  "device-battery-low",
16689
16845
  "device-battery-normal",
16846
+ "device-consumable-low",
16847
+ "device-consumable-normal",
16690
16848
  "stream-online",
16691
16849
  "stream-offline",
16692
16850
  "node-online",
@@ -16705,6 +16863,7 @@ var NcSystemEventKindSchema = _enum([
16705
16863
  "addon-updated",
16706
16864
  "server-updated",
16707
16865
  "export-completed",
16866
+ "backup-completed",
16708
16867
  "camera-online",
16709
16868
  "camera-offline",
16710
16869
  "camera-disabled",
@@ -18027,6 +18186,48 @@ var NcAlarmConfigSchema = object({
18027
18186
  settings: NcAlarmSettingsSchema,
18028
18187
  coverage: array(NcAlarmModeCoverageSchema)
18029
18188
  });
18189
+ /**
18190
+ * ONE rule's demand on ONE camera's clip ring.
18191
+ *
18192
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18193
+ * camera, so the answer stays a faithful description of the rules and the
18194
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18195
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18196
+ * a different thing from never having been told, and only the envelope
18197
+ * (`rulesLoaded`) can tell those apart.
18198
+ */
18199
+ var NcClipRetentionAskSchema = object({
18200
+ /**
18201
+ * The camera this ask is about. **Absent = every camera**, which is what a
18202
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18203
+ * asking everywhere.
18204
+ */
18205
+ deviceId: number().int().nonnegative().optional(),
18206
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18207
+ * needs nothing produces no ask at all. */
18208
+ seconds: number().min(0).max(60),
18209
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18210
+ * assigned, which is what the cut defaults to. */
18211
+ profile: CamProfileSchema.optional(),
18212
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18213
+ ruleId: string(),
18214
+ ruleName: string(),
18215
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18216
+ reason: _enum(["window", "occupancy"])
18217
+ });
18218
+ /**
18219
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18220
+ *
18221
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18222
+ * once. A centre that is up but has not read its rules yet answers with an
18223
+ * empty ask list that means nothing at all — applying it would drop every
18224
+ * camera's ring to zero for the first events after a restart, which is the
18225
+ * footage this mechanism exists to keep.
18226
+ */
18227
+ var NcClipRetentionPlanSchema = object({
18228
+ rulesLoaded: boolean(),
18229
+ asks: array(NcClipRetentionAskSchema).readonly()
18230
+ });
18030
18231
  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 }), {
18031
18232
  kind: "mutation",
18032
18233
  auth: "admin",
@@ -18047,7 +18248,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18047
18248
  }), object({ success: literal(true) }), {
18048
18249
  kind: "mutation",
18049
18250
  auth: "admin"
18050
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18251
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18051
18252
  deviceId: number().int(),
18052
18253
  muted: boolean()
18053
18254
  }), object({ success: literal(true) }), {
@@ -20621,6 +20822,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20621
20822
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20622
20823
  framesMatched: number().int()
20623
20824
  })).readonly() });
20825
+ /**
20826
+ * The long-term series a camera produces. A closed union so a typo cannot
20827
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20828
+ * is an alias of this, not a second list.
20829
+ */
20830
+ var AnalyticsLtsSeriesSchema = _enum([
20831
+ "motion",
20832
+ "audio-dbfs",
20833
+ "battery",
20834
+ "occupancy"
20835
+ ]);
20836
+ /**
20837
+ * One closed 5-minute bucket of a long-term series.
20838
+ *
20839
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20840
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20841
+ * that exists at all was measured; a bucket that is absent was not, which is a
20842
+ * different claim from zero and the reason this is a sparse series.
20843
+ */
20844
+ var LtsBucketSchema = object({
20845
+ scope: string(),
20846
+ bucketStart: number().int(),
20847
+ samples: number().int().nonnegative(),
20848
+ sum: number(),
20849
+ min: number(),
20850
+ max: number()
20851
+ });
20624
20852
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20625
20853
  deviceId: number(),
20626
20854
  trackId: string()
@@ -20667,6 +20895,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20667
20895
  kinds: array(string()).optional(),
20668
20896
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20669
20897
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20898
+ deviceId: number(),
20899
+ series: AnalyticsLtsSeriesSchema,
20900
+ /** Omit for EVERY scope of this series in the range. */
20901
+ scope: string().optional(),
20902
+ from: number(),
20903
+ to: number(),
20904
+ limit: number().int().positive().optional()
20905
+ }), array(LtsBucketSchema).readonly()), method(object({
20670
20906
  deviceId: number(),
20671
20907
  since: number(),
20672
20908
  until: number(),
@@ -21285,6 +21521,14 @@ var MotionSourceEnum = _enum([
21285
21521
  */
21286
21522
  var MotionSourcesSchema = array(MotionSourceEnum);
21287
21523
  /**
21524
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21525
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21526
+ * than a second spelling of the same two ideas — the value an operator picks
21527
+ * here is the value that comes back on the track, the overlay and the debug
21528
+ * row.
21529
+ */
21530
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21531
+ /**
21288
21532
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21289
21533
  * so cap-side consumers (the orchestrator forward, the runner addon's
21290
21534
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21435,6 +21679,35 @@ var RunnerCameraConfigSchema = object({
21435
21679
  * events; the orchestrator forwards to `reportMotion`.
21436
21680
  */
21437
21681
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21682
+ /**
21683
+ * WHICH root detector runs for this camera. The detection counterpart of
21684
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21685
+ * of sources the system understands, vendor-agnostic, owned here.
21686
+ *
21687
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21688
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21689
+ * here. Its boxes reach post-analysis on the same
21690
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21691
+ * track gets the same tracker, the same overlay and the same detail
21692
+ * subtree (face / plate / embedding).
21693
+ *
21694
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21695
+ * run, and that is where a camera with a usable onboard detector buys back
21696
+ * its share of the accelerator. It saves the root inference, not the decode
21697
+ * — the detail subtree still needs pixels to cut crops from.
21698
+ *
21699
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21700
+ * step at all (there is nothing to track), and the cap that knows this says
21701
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21702
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21703
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21704
+ * worth exactly what it already is — a wake signal with a class.
21705
+ *
21706
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21707
+ * vendor never turns a detector on for the operator, and neither does a
21708
+ * default.
21709
+ */
21710
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21438
21711
  pipelineEnabled: boolean().default(true),
21439
21712
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21440
21713
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21616,7 +21889,47 @@ var RunnerLocalMetricsSchema = object({
21616
21889
  queueDepth: number(),
21617
21890
  frameLazy: FrameLazyMetricsSchema.optional()
21618
21891
  });
21892
+ /**
21893
+ * Pipeline Runner capability — runtime detection workhorse.
21894
+ *
21895
+ * One instance per node. Receives camera assignments from
21896
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21897
+ * decoded frames, drains motion + detection queues, calls the local
21898
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21899
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21900
+ * the bus.
21901
+ *
21902
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21903
+ * runner has zero knowledge of other agents, no global state, and never
21904
+ * makes assignment decisions itself.
21905
+ */
21906
+ /**
21907
+ * Why a runner declined to look at a camera out of band. Named rather than a
21908
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21909
+ * already mid-session and one already bursting are four different facts, and a
21910
+ * caller told only "no" cannot tell a protection from a bug.
21911
+ */
21912
+ var OccupancyBurstRefusalSchema = _enum([
21913
+ "not-attached",
21914
+ "battery-asleep",
21915
+ "not-watching",
21916
+ "already-bursting"
21917
+ ]);
21619
21918
  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({
21919
+ deviceId: number(),
21920
+ /** How many frames to collect. The caller sizes this against what its
21921
+ * own confirmation needs; the runner clamps it to the field's range. */
21922
+ frames: number().int().positive().optional(),
21923
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21924
+ * defend — the periodic one at least has a timer to point at. */
21925
+ reason: string()
21926
+ }), object({
21927
+ started: boolean(),
21928
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21929
+ }), {
21930
+ auth: "admin",
21931
+ kind: "mutation"
21932
+ }), method(object({
21620
21933
  handle: FrameHandleSchema,
21621
21934
  bbox: NativeCropBboxSchema,
21622
21935
  maxWidth: number().int().positive().optional(),
@@ -24134,10 +24447,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24134
24447
  }), boolean()), method(object({
24135
24448
  deviceId: number().int().nonnegative(),
24136
24449
  sessionId: string()
24137
- }), object({ pendingRenegotiation: object({
24138
- target: WebrtcStreamTargetSchema,
24139
- epoch: number()
24140
- }).nullable() }));
24450
+ }), object({
24451
+ pendingRenegotiation: object({
24452
+ target: WebrtcStreamTargetSchema,
24453
+ epoch: number()
24454
+ }).nullable(),
24455
+ /**
24456
+ * Whether the session still EXISTS.
24457
+ *
24458
+ * A consumer that holds a resource for the life of a session needs to
24459
+ * be able to ask, because a session does not always end the way it
24460
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24461
+ * sent `SessionDisconnected`, so the Alexa exporter's
24462
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24463
+ * H.264 transcode kept running for NOBODY for more than twenty
24464
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24465
+ * minutes earlier — the broker knew; the holder had no way to ask.
24466
+ *
24467
+ * `false` for a session id the provider has never heard of, which is
24468
+ * the same answer as "it ended": either way nothing is holding it up.
24469
+ */
24470
+ alive: boolean()
24471
+ }));
24141
24472
  object({
24142
24473
  /** All accessory children of the parent. */
24143
24474
  childDeviceIds: array(number()).readonly(),
@@ -28576,11 +28907,46 @@ var NativeObjectDetectionStatusSchema = object({
28576
28907
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28577
28908
  /**
28578
28909
  * Whether forwarding of onboard AI detections is enabled for this device.
28579
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28580
- * churn the tracker, so forwarding stays off until the operator enables it.
28910
+ *
28911
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28912
+ * camera runs — that is the operator's choice, and it is made where every
28913
+ * other detection choice is made. `geometry` on
28914
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28915
+ * choice would buy this particular camera.
28581
28916
  */
28582
28917
  enabled: boolean()
28583
28918
  });
28919
+ /**
28920
+ * WHEN a camera's onboard detections carry geometry.
28921
+ *
28922
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28923
+ * a detection is a trackable subject whenever the camera sees one.
28924
+ * - `while-streaming` — only while some stream of this camera is already open.
28925
+ * The boxes ride the video's own side-channel rather than a feed of their
28926
+ * own, so they cost nothing and they exist only when something is pulling.
28927
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28928
+ * radio drain, but a camera that is awake is awake precisely because
28929
+ * something is in front of it, and its stream is already being pulled.
28930
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28931
+ * pipeline needs geometry to make a subject, so such a push reaches the
28932
+ * tracker as motion and no further.
28933
+ *
28934
+ * Reported and not inferred, because the operator's question in front of the
28935
+ * picker is "what do I get", and these are three different answers (D14: the
28936
+ * derived form is only as honest as `getOptions`).
28937
+ */
28938
+ var NativeObjectGeometryEnum = _enum([
28939
+ "boxed",
28940
+ "while-streaming",
28941
+ "flag-only"
28942
+ ]);
28943
+ var NativeObjectDetectionOptionsSchema = object({
28944
+ /** Classes this firmware can detect — the same list the status reports. */
28945
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28946
+ /** What a detection from this camera carries. */
28947
+ geometry: NativeObjectGeometryEnum
28948
+ });
28949
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28584
28950
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28585
28951
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28586
28952
  lastFetchedAt: number() });
@@ -28590,13 +28956,23 @@ var nativeObjectDetectionCapability = {
28590
28956
  deviceNative: true,
28591
28957
  mode: "singleton",
28592
28958
  deviceTypes: [DeviceType.Camera],
28593
- methods: { setEnabled: method(object({
28594
- deviceId: number(),
28595
- enabled: boolean()
28596
- }), _void(), {
28597
- kind: "mutation",
28598
- auth: "admin"
28599
- }) },
28959
+ methods: {
28960
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28961
+ setSettings: method(object({
28962
+ deviceId: number(),
28963
+ settings: NativeObjectDetectionSettingsPatchSchema
28964
+ }), _void(), {
28965
+ kind: "mutation",
28966
+ auth: "admin"
28967
+ }),
28968
+ setEnabled: method(object({
28969
+ deviceId: number(),
28970
+ enabled: boolean()
28971
+ }), _void(), {
28972
+ kind: "mutation",
28973
+ auth: "admin"
28974
+ })
28975
+ },
28600
28976
  events: { onDetected: { data: object({
28601
28977
  deviceId: number(),
28602
28978
  detection: NativeDetectionSchema
@@ -33444,7 +33820,28 @@ var PerScopeBreakdownSchema = object({
33444
33820
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33445
33821
  totalObjects: number().int().nonnegative(),
33446
33822
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33447
- byClass: record(string(), number().int().nonnegative())
33823
+ byClass: record(string(), number().int().nonnegative()),
33824
+ /**
33825
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33826
+ * present but not going anywhere (a parked car, a bin, a statue).
33827
+ *
33828
+ * The operator's question about a scene has two halves and they answer
33829
+ * different things: "what is parked here" is stable for hours and must not
33830
+ * flap, while "who is walking through" is the thing an alert is about. One
33831
+ * number could only serve one of them, and `totalObjects` served the first
33832
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33833
+ *
33834
+ * `standing + transient === totalObjects`, always. The total keeps its old
33835
+ * meaning exactly, so no rule written against it changes behaviour.
33836
+ *
33837
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33838
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33839
+ * parked objects here" about a camera whose lot is full.
33840
+ */
33841
+ standingObjects: number().int().nonnegative().optional(),
33842
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33843
+ * same absence rule. */
33844
+ transientObjects: number().int().nonnegative().optional()
33448
33845
  });
33449
33846
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33450
33847
  zoneId: string(),
@@ -33567,6 +33964,23 @@ var HistoryPointSchema = object({
33567
33964
  * triple covers the three spatial scopes (per-zone, frame-wide,
33568
33965
  * outside-any-zone). Crossing them with `className?` gives the full
33569
33966
  * combinatorial coverage the operator UI requested.
33967
+ *
33968
+ * ## ⚠️ The three history methods are DEPRECATED
33969
+ *
33970
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33971
+ * so after a restart they report nothing about a night that did happen, and any
33972
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33973
+ * an empty scene. The presets in the occupancy chart existed to hide that
33974
+ * horizon rather than to answer a question.
33975
+ *
33976
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33977
+ * instead. Those rows are already written for every camera, ~60 bytes per
33978
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33979
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33980
+ * function the writer uses, so the two cannot drift.
33981
+ *
33982
+ * The ring stays until these three go, and it is the only thing left reading
33983
+ * it. Do not add a fourth caller.
33570
33984
  */
33571
33985
  var zoneAnalyticsCapability = {
33572
33986
  name: "zone-analytics",
@@ -34056,6 +34470,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34056
34470
  smoke: smokeCapability,
34057
34471
  streamCatalog: streamCatalogCapability,
34058
34472
  streamParams: streamParamsCapability,
34473
+ streamSignals: streamSignalsCapability,
34059
34474
  switch: switchCapability,
34060
34475
  tamper: tamperCapability,
34061
34476
  temperatureSensor: temperatureSensorCapability,
@@ -37547,12 +37962,24 @@ Object.freeze({
37547
37962
  addonId: null,
37548
37963
  access: "create"
37549
37964
  },
37965
+ "nativeObjectDetection.getOptions": {
37966
+ capName: "native-object-detection",
37967
+ capScope: "device",
37968
+ addonId: null,
37969
+ access: "view"
37970
+ },
37550
37971
  "nativeObjectDetection.setEnabled": {
37551
37972
  capName: "native-object-detection",
37552
37973
  capScope: "device",
37553
37974
  addonId: null,
37554
37975
  access: "create"
37555
37976
  },
37977
+ "nativeObjectDetection.setSettings": {
37978
+ capName: "native-object-detection",
37979
+ capScope: "device",
37980
+ addonId: null,
37981
+ access: "create"
37982
+ },
37556
37983
  "navigation.getFeatures": {
37557
37984
  capName: "navigation",
37558
37985
  capScope: "device",
@@ -37817,6 +38244,12 @@ Object.freeze({
37817
38244
  addonId: null,
37818
38245
  access: "view"
37819
38246
  },
38247
+ "notificationRules.getClipRetentionAsks": {
38248
+ capName: "notification-rules",
38249
+ capScope: "system",
38250
+ addonId: null,
38251
+ access: "view"
38252
+ },
37820
38253
  "notificationRules.getConditionCatalog": {
37821
38254
  capName: "notification-rules",
37822
38255
  capScope: "system",
@@ -38327,6 +38760,12 @@ Object.freeze({
38327
38760
  addonId: null,
38328
38761
  access: "create"
38329
38762
  },
38763
+ "pipelineAnalytics.readLongTermSeries": {
38764
+ capName: "pipeline-analytics",
38765
+ capScope: "device",
38766
+ addonId: null,
38767
+ access: "view"
38768
+ },
38330
38769
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38331
38770
  capName: "pipeline-analytics",
38332
38771
  capScope: "device",
@@ -38999,6 +39438,12 @@ Object.freeze({
38999
39438
  addonId: null,
39000
39439
  access: "create"
39001
39440
  },
39441
+ "pipelineRunner.requestOccupancyBurst": {
39442
+ capName: "pipeline-runner",
39443
+ capScope: "system",
39444
+ addonId: null,
39445
+ access: "create"
39446
+ },
39002
39447
  "pipelineRunner.runDetailSubtree": {
39003
39448
  capName: "pipeline-runner",
39004
39449
  capScope: "system",
@@ -40211,6 +40656,12 @@ Object.freeze({
40211
40656
  addonId: null,
40212
40657
  access: "create"
40213
40658
  },
40659
+ "streamBroker.reportStreamSignal": {
40660
+ capName: "stream-broker",
40661
+ capScope: "system",
40662
+ addonId: null,
40663
+ access: "create"
40664
+ },
40214
40665
  "streamBroker.restartProfile": {
40215
40666
  capName: "stream-broker",
40216
40667
  capScope: "system",
@@ -40295,6 +40746,12 @@ Object.freeze({
40295
40746
  addonId: null,
40296
40747
  access: "create"
40297
40748
  },
40749
+ "streamSignals.listSignals": {
40750
+ capName: "stream-signals",
40751
+ capScope: "device",
40752
+ addonId: null,
40753
+ access: "view"
40754
+ },
40298
40755
  "switch.setState": {
40299
40756
  capName: "switch",
40300
40757
  capScope: "device",
@@ -41767,11 +42224,21 @@ Object.freeze({
41767
42224
  form: "single",
41768
42225
  optional: false
41769
42226
  }],
42227
+ "nativeObjectDetection.getOptions": [{
42228
+ name: "deviceId",
42229
+ form: "single",
42230
+ optional: false
42231
+ }],
41770
42232
  "nativeObjectDetection.setEnabled": [{
41771
42233
  name: "deviceId",
41772
42234
  form: "single",
41773
42235
  optional: false
41774
42236
  }],
42237
+ "nativeObjectDetection.setSettings": [{
42238
+ name: "deviceId",
42239
+ form: "single",
42240
+ optional: false
42241
+ }],
41775
42242
  "navigation.getFeatures": [{
41776
42243
  name: "deviceId",
41777
42244
  form: "single",
@@ -42121,6 +42588,11 @@ Object.freeze({
42121
42588
  form: "single",
42122
42589
  optional: false
42123
42590
  }],
42591
+ "pipelineAnalytics.readLongTermSeries": [{
42592
+ name: "deviceId",
42593
+ form: "single",
42594
+ optional: false
42595
+ }],
42124
42596
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42125
42597
  name: "deviceId",
42126
42598
  form: "single",
@@ -42311,6 +42783,11 @@ Object.freeze({
42311
42783
  form: "single",
42312
42784
  optional: false
42313
42785
  }],
42786
+ "pipelineRunner.requestOccupancyBurst": [{
42787
+ name: "deviceId",
42788
+ form: "single",
42789
+ optional: false
42790
+ }],
42314
42791
  "pipelineRunner.runDetailSubtree": [{
42315
42792
  name: "deviceId",
42316
42793
  form: "single",
@@ -42667,6 +43144,11 @@ Object.freeze({
42667
43144
  form: "single",
42668
43145
  optional: false
42669
43146
  }],
43147
+ "streamBroker.reportStreamSignal": [{
43148
+ name: "deviceId",
43149
+ form: "single",
43150
+ optional: false
43151
+ }],
42670
43152
  "streamBroker.restartProfile": [{
42671
43153
  name: "deviceId",
42672
43154
  form: "single",