@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.js CHANGED
@@ -31,7 +31,7 @@ let node_module = require("node:module");
31
31
  let sharp = require("sharp");
32
32
  sharp = __toESM(sharp);
33
33
  let node_http = require("node:http");
34
- //#region ../types/dist/event-category-ZyX6jcse.mjs
34
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
35
35
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
36
36
  EventCategory["SystemBoot"] = "system.boot";
37
37
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -648,6 +648,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
648
648
  * pull-reconcile from the provider's `getStatus` on reconnect. */
649
649
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
650
650
  EventCategory["BackupCompleted"] = "backup.completed";
651
+ /**
652
+ * A whole backup RUN finished — every destination attempted, win or lose.
653
+ *
654
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
655
+ * a progress UI and the wrong one for a notification: an operator with three
656
+ * destinations would be told three times. And a run where two of three
657
+ * destinations succeeded is not a clean success — a single "backup
658
+ * completed" that hid the failed one would be a lie, so the count of each is
659
+ * carried here and the message says both.
660
+ *
661
+ * Emitted by the backup orchestrator only after the destination loop, so a
662
+ * run that dies during the BUILD phase produces no completion at all.
663
+ */
664
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
651
665
  EventCategory["BackupRestored"] = "backup.restored";
652
666
  EventCategory["NotificationDispatched"] = "notification.dispatched";
653
667
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5378,7 +5392,7 @@ var ZodIssueCode = {
5378
5392
  var ZodFirstPartyTypeKind;
5379
5393
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5380
5394
  //#endregion
5381
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5395
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5382
5396
  /**
5383
5397
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5384
5398
  * window to float samples (D455).
@@ -11589,6 +11603,87 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11589
11603
  auth: "admin"
11590
11604
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11591
11605
  DeviceType.Camera;
11606
+ /**
11607
+ * The signals a device can emit to WAKE its own stream.
11608
+ *
11609
+ * A camera whose stream is built on demand sleeps until something asks for it,
11610
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11611
+ * puller holds a session open for ever, and treating that as demand would keep
11612
+ * a battery camera awake for ever, which is the whole thing the battery is for
11613
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11614
+ * itself, with no stream running.
11615
+ *
11616
+ * ## The vocabulary is the PROVIDER'S, not ours
11617
+ *
11618
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11619
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11620
+ * Reolink offers motion and camera-native detection; another provider may offer
11621
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11622
+ * yet. A fixed enum here would mean every new signal is a framework release.
11623
+ *
11624
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11625
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11626
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11627
+ * binding — but both answer "what drives the detection pipeline", which is a
11628
+ * different question from "what may wake a sleeping stream". A camera can do
11629
+ * the first and not be trusted with the second, and the operator picks per
11630
+ * camera. Two questions, two authorities.
11631
+ *
11632
+ * ## Availability is not permission
11633
+ *
11634
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11635
+ * wakes the stream is the operator's per-camera choice, held by the broker
11636
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11637
+ * provider declaring a signal is not a provider enabling it.
11638
+ */
11639
+ /** One signal a device can emit. */
11640
+ var StreamSignalSchema = object({
11641
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11642
+ code: string().min(1),
11643
+ /** What an operator reads in the picker. The provider's own wording. */
11644
+ label: string().min(1),
11645
+ /**
11646
+ * Whether the provider recommends this signal ON when a camera is first set
11647
+ * up. A provider knows which of its signals are cheap and reliable; an
11648
+ * operator should not have to discover that by trial. Reolink recommends
11649
+ * both of its own.
11650
+ */
11651
+ recommended: boolean()
11652
+ });
11653
+ var StreamSignalsStatusSchema = object({
11654
+ signals: array(StreamSignalSchema),
11655
+ lastFetchedAt: number()
11656
+ });
11657
+ var streamSignalsCapability = {
11658
+ name: "stream-signals",
11659
+ scope: "device",
11660
+ deviceNative: true,
11661
+ mode: "singleton",
11662
+ deviceTypes: Object.values(DeviceType),
11663
+ runtimeState: StreamSignalsStatusSchema,
11664
+ /**
11665
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11666
+ *
11667
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11668
+ * not an operator choice: the provider re-declares it on every registration,
11669
+ * so losing it loses nothing and persisting it would freeze an answer the
11670
+ * camera is entitled to change. Measured the same day on the sibling case —
11671
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11672
+ * class the camera really detected stayed missing for the life of the row
11673
+ * because the fix could not reach it.
11674
+ *
11675
+ * See `RuntimeStateDurability`. Enforced by
11676
+ * `scripts/check-runtime-state-durability.ts`.
11677
+ */
11678
+ durability: "session",
11679
+ methods: {
11680
+ /**
11681
+ * What this device can emit. Empty is a valid and common answer — most
11682
+ * cameras have nothing to offer here, and an empty list is what makes the
11683
+ * broker's picker show nothing rather than a false choice.
11684
+ */
11685
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11686
+ };
11592
11687
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11593
11688
  var StreamFormatSchema = _enum([
11594
11689
  "webrtc",
@@ -11985,6 +12080,22 @@ var EgressTranscodeSchema = object({
11985
12080
  camStreamId: string().nullable()
11986
12081
  });
11987
12082
  method(object({
12083
+ deviceId: number().int().nonnegative(),
12084
+ /** The provider's signal code. */
12085
+ code: string().min(1),
12086
+ /** Ms epoch. Absent ⇒ now. */
12087
+ at: number().optional()
12088
+ }), object({
12089
+ /** Whether the broker acted on it, and if not, why. */
12090
+ accepted: boolean(),
12091
+ reason: _enum([
12092
+ "woke",
12093
+ "hold-extended",
12094
+ "not-enabled",
12095
+ "no-consumer",
12096
+ "unknown-code"
12097
+ ])
12098
+ }), { kind: "mutation" }), method(object({
11988
12099
  deviceId: number().int().nonnegative(),
11989
12100
  camStreamId: string().min(1),
11990
12101
  kind: CamStreamKindSchema,
@@ -12239,6 +12350,16 @@ var PickStreamRequirementsSchema = object({
12239
12350
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12240
12351
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12241
12352
  minHeight: number().int().positive().optional(),
12353
+ /**
12354
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12355
+ *
12356
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12357
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12358
+ * Without this the ceiling had to be re-implemented by every caller — and
12359
+ * one caller implementing it privately is how a second scoring authority
12360
+ * gets born.
12361
+ */
12362
+ maxHeight: number().int().positive().optional(),
12242
12363
  /** Minimum horizontal resolution. */
12243
12364
  minWidth: number().int().positive().optional(),
12244
12365
  /**
@@ -12255,7 +12376,22 @@ var PickStreamRequirementsSchema = object({
12255
12376
  * transcoded" guard: if the device is already serving the consumer's
12256
12377
  * codec end-to-end, there's nothing to optimise.
12257
12378
  */
12258
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12379
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12380
+ /**
12381
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12382
+ * understanding that it will be transcoded.
12383
+ *
12384
+ * Default `false` — today's behaviour, and the right one for a bypass
12385
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12386
+ * ask the larger question: "what is the best stream for me, transcoding if
12387
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12388
+ * does not, so a passthrough is never lost to a transcode; the answer says
12389
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12390
+ *
12391
+ * This is what lets one picker serve both the bypass and the full source
12392
+ * choice, instead of a consumer scoring privately when the bypass misses.
12393
+ */
12394
+ allowTranscode: boolean().optional()
12259
12395
  }).readonly();
12260
12396
  var PickStreamPreferencesSchema = object({
12261
12397
  /**
@@ -12269,12 +12405,32 @@ var PickStreamPreferencesSchema = object({
12269
12405
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12270
12406
  * memory-constrained consumers / Apple Home guest sessions).
12271
12407
  */
12272
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12408
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12409
+ /**
12410
+ * The height the consumer actually wants to DELIVER.
12411
+ *
12412
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12413
+ * above the target wins, and only if nothing reaches it does the tallest
12414
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12415
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12416
+ * express that: it says "as big as possible", which is a different wish.
12417
+ *
12418
+ * Ignored when absent, so every existing caller keeps its ordering.
12419
+ */
12420
+ targetHeight: number().int().positive().optional()
12273
12421
  }).readonly();
12274
12422
  var PickedCamStreamSchema = object({
12275
12423
  camStreamId: string(),
12276
12424
  codec: string().optional(),
12277
12425
  resolution: CamStreamResolutionSchema.optional(),
12426
+ /**
12427
+ * Whether serving this stream requires a decode + re-encode.
12428
+ *
12429
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12430
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12431
+ * not ask cannot be handed a cost it never agreed to pay.
12432
+ */
12433
+ transcodes: boolean(),
12278
12434
  /** One-line explanation of why this stream won — for logs / debug UI. */
12279
12435
  reason: string()
12280
12436
  });
@@ -16710,6 +16866,8 @@ var NcSystemEventKindSchema = _enum([
16710
16866
  "device-enabled",
16711
16867
  "device-battery-low",
16712
16868
  "device-battery-normal",
16869
+ "device-consumable-low",
16870
+ "device-consumable-normal",
16713
16871
  "stream-online",
16714
16872
  "stream-offline",
16715
16873
  "node-online",
@@ -16728,6 +16886,7 @@ var NcSystemEventKindSchema = _enum([
16728
16886
  "addon-updated",
16729
16887
  "server-updated",
16730
16888
  "export-completed",
16889
+ "backup-completed",
16731
16890
  "camera-online",
16732
16891
  "camera-offline",
16733
16892
  "camera-disabled",
@@ -18050,6 +18209,48 @@ var NcAlarmConfigSchema = object({
18050
18209
  settings: NcAlarmSettingsSchema,
18051
18210
  coverage: array(NcAlarmModeCoverageSchema)
18052
18211
  });
18212
+ /**
18213
+ * ONE rule's demand on ONE camera's clip ring.
18214
+ *
18215
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18216
+ * camera, so the answer stays a faithful description of the rules and the
18217
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18218
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18219
+ * a different thing from never having been told, and only the envelope
18220
+ * (`rulesLoaded`) can tell those apart.
18221
+ */
18222
+ var NcClipRetentionAskSchema = object({
18223
+ /**
18224
+ * The camera this ask is about. **Absent = every camera**, which is what a
18225
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18226
+ * asking everywhere.
18227
+ */
18228
+ deviceId: number().int().nonnegative().optional(),
18229
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18230
+ * needs nothing produces no ask at all. */
18231
+ seconds: number().min(0).max(60),
18232
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18233
+ * assigned, which is what the cut defaults to. */
18234
+ profile: CamProfileSchema.optional(),
18235
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18236
+ ruleId: string(),
18237
+ ruleName: string(),
18238
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18239
+ reason: _enum(["window", "occupancy"])
18240
+ });
18241
+ /**
18242
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18243
+ *
18244
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18245
+ * once. A centre that is up but has not read its rules yet answers with an
18246
+ * empty ask list that means nothing at all — applying it would drop every
18247
+ * camera's ring to zero for the first events after a restart, which is the
18248
+ * footage this mechanism exists to keep.
18249
+ */
18250
+ var NcClipRetentionPlanSchema = object({
18251
+ rulesLoaded: boolean(),
18252
+ asks: array(NcClipRetentionAskSchema).readonly()
18253
+ });
18053
18254
  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 }), {
18054
18255
  kind: "mutation",
18055
18256
  auth: "admin",
@@ -18070,7 +18271,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18070
18271
  }), object({ success: literal(true) }), {
18071
18272
  kind: "mutation",
18072
18273
  auth: "admin"
18073
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18274
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18074
18275
  deviceId: number().int(),
18075
18276
  muted: boolean()
18076
18277
  }), object({ success: literal(true) }), {
@@ -20644,6 +20845,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20644
20845
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20645
20846
  framesMatched: number().int()
20646
20847
  })).readonly() });
20848
+ /**
20849
+ * The long-term series a camera produces. A closed union so a typo cannot
20850
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20851
+ * is an alias of this, not a second list.
20852
+ */
20853
+ var AnalyticsLtsSeriesSchema = _enum([
20854
+ "motion",
20855
+ "audio-dbfs",
20856
+ "battery",
20857
+ "occupancy"
20858
+ ]);
20859
+ /**
20860
+ * One closed 5-minute bucket of a long-term series.
20861
+ *
20862
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20863
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20864
+ * that exists at all was measured; a bucket that is absent was not, which is a
20865
+ * different claim from zero and the reason this is a sparse series.
20866
+ */
20867
+ var LtsBucketSchema = object({
20868
+ scope: string(),
20869
+ bucketStart: number().int(),
20870
+ samples: number().int().nonnegative(),
20871
+ sum: number(),
20872
+ min: number(),
20873
+ max: number()
20874
+ });
20647
20875
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20648
20876
  deviceId: number(),
20649
20877
  trackId: string()
@@ -20690,6 +20918,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20690
20918
  kinds: array(string()).optional(),
20691
20919
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20692
20920
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20921
+ deviceId: number(),
20922
+ series: AnalyticsLtsSeriesSchema,
20923
+ /** Omit for EVERY scope of this series in the range. */
20924
+ scope: string().optional(),
20925
+ from: number(),
20926
+ to: number(),
20927
+ limit: number().int().positive().optional()
20928
+ }), array(LtsBucketSchema).readonly()), method(object({
20693
20929
  deviceId: number(),
20694
20930
  since: number(),
20695
20931
  until: number(),
@@ -21308,6 +21544,14 @@ var MotionSourceEnum = _enum([
21308
21544
  */
21309
21545
  var MotionSourcesSchema = array(MotionSourceEnum);
21310
21546
  /**
21547
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21548
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21549
+ * than a second spelling of the same two ideas — the value an operator picks
21550
+ * here is the value that comes back on the track, the overlay and the debug
21551
+ * row.
21552
+ */
21553
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21554
+ /**
21311
21555
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21312
21556
  * so cap-side consumers (the orchestrator forward, the runner addon's
21313
21557
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21458,6 +21702,35 @@ var RunnerCameraConfigSchema = object({
21458
21702
  * events; the orchestrator forwards to `reportMotion`.
21459
21703
  */
21460
21704
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21705
+ /**
21706
+ * WHICH root detector runs for this camera. The detection counterpart of
21707
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21708
+ * of sources the system understands, vendor-agnostic, owned here.
21709
+ *
21710
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21711
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21712
+ * here. Its boxes reach post-analysis on the same
21713
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21714
+ * track gets the same tracker, the same overlay and the same detail
21715
+ * subtree (face / plate / embedding).
21716
+ *
21717
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21718
+ * run, and that is where a camera with a usable onboard detector buys back
21719
+ * its share of the accelerator. It saves the root inference, not the decode
21720
+ * — the detail subtree still needs pixels to cut crops from.
21721
+ *
21722
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21723
+ * step at all (there is nothing to track), and the cap that knows this says
21724
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21725
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21726
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21727
+ * worth exactly what it already is — a wake signal with a class.
21728
+ *
21729
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21730
+ * vendor never turns a detector on for the operator, and neither does a
21731
+ * default.
21732
+ */
21733
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21461
21734
  pipelineEnabled: boolean().default(true),
21462
21735
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21463
21736
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21639,7 +21912,47 @@ var RunnerLocalMetricsSchema = object({
21639
21912
  queueDepth: number(),
21640
21913
  frameLazy: FrameLazyMetricsSchema.optional()
21641
21914
  });
21915
+ /**
21916
+ * Pipeline Runner capability — runtime detection workhorse.
21917
+ *
21918
+ * One instance per node. Receives camera assignments from
21919
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21920
+ * decoded frames, drains motion + detection queues, calls the local
21921
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21922
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21923
+ * the bus.
21924
+ *
21925
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21926
+ * runner has zero knowledge of other agents, no global state, and never
21927
+ * makes assignment decisions itself.
21928
+ */
21929
+ /**
21930
+ * Why a runner declined to look at a camera out of band. Named rather than a
21931
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21932
+ * already mid-session and one already bursting are four different facts, and a
21933
+ * caller told only "no" cannot tell a protection from a bug.
21934
+ */
21935
+ var OccupancyBurstRefusalSchema = _enum([
21936
+ "not-attached",
21937
+ "battery-asleep",
21938
+ "not-watching",
21939
+ "already-bursting"
21940
+ ]);
21642
21941
  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({
21942
+ deviceId: number(),
21943
+ /** How many frames to collect. The caller sizes this against what its
21944
+ * own confirmation needs; the runner clamps it to the field's range. */
21945
+ frames: number().int().positive().optional(),
21946
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21947
+ * defend — the periodic one at least has a timer to point at. */
21948
+ reason: string()
21949
+ }), object({
21950
+ started: boolean(),
21951
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21952
+ }), {
21953
+ auth: "admin",
21954
+ kind: "mutation"
21955
+ }), method(object({
21643
21956
  handle: FrameHandleSchema,
21644
21957
  bbox: NativeCropBboxSchema,
21645
21958
  maxWidth: number().int().positive().optional(),
@@ -24157,10 +24470,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24157
24470
  }), boolean()), method(object({
24158
24471
  deviceId: number().int().nonnegative(),
24159
24472
  sessionId: string()
24160
- }), object({ pendingRenegotiation: object({
24161
- target: WebrtcStreamTargetSchema,
24162
- epoch: number()
24163
- }).nullable() }));
24473
+ }), object({
24474
+ pendingRenegotiation: object({
24475
+ target: WebrtcStreamTargetSchema,
24476
+ epoch: number()
24477
+ }).nullable(),
24478
+ /**
24479
+ * Whether the session still EXISTS.
24480
+ *
24481
+ * A consumer that holds a resource for the life of a session needs to
24482
+ * be able to ask, because a session does not always end the way it
24483
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24484
+ * sent `SessionDisconnected`, so the Alexa exporter's
24485
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24486
+ * H.264 transcode kept running for NOBODY for more than twenty
24487
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24488
+ * minutes earlier — the broker knew; the holder had no way to ask.
24489
+ *
24490
+ * `false` for a session id the provider has never heard of, which is
24491
+ * the same answer as "it ended": either way nothing is holding it up.
24492
+ */
24493
+ alive: boolean()
24494
+ }));
24164
24495
  object({
24165
24496
  /** All accessory children of the parent. */
24166
24497
  childDeviceIds: array(number()).readonly(),
@@ -28599,11 +28930,46 @@ var NativeObjectDetectionStatusSchema = object({
28599
28930
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28600
28931
  /**
28601
28932
  * Whether forwarding of onboard AI detections is enabled for this device.
28602
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28603
- * churn the tracker, so forwarding stays off until the operator enables it.
28933
+ *
28934
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28935
+ * camera runs — that is the operator's choice, and it is made where every
28936
+ * other detection choice is made. `geometry` on
28937
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28938
+ * choice would buy this particular camera.
28604
28939
  */
28605
28940
  enabled: boolean()
28606
28941
  });
28942
+ /**
28943
+ * WHEN a camera's onboard detections carry geometry.
28944
+ *
28945
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28946
+ * a detection is a trackable subject whenever the camera sees one.
28947
+ * - `while-streaming` — only while some stream of this camera is already open.
28948
+ * The boxes ride the video's own side-channel rather than a feed of their
28949
+ * own, so they cost nothing and they exist only when something is pulling.
28950
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28951
+ * radio drain, but a camera that is awake is awake precisely because
28952
+ * something is in front of it, and its stream is already being pulled.
28953
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28954
+ * pipeline needs geometry to make a subject, so such a push reaches the
28955
+ * tracker as motion and no further.
28956
+ *
28957
+ * Reported and not inferred, because the operator's question in front of the
28958
+ * picker is "what do I get", and these are three different answers (D14: the
28959
+ * derived form is only as honest as `getOptions`).
28960
+ */
28961
+ var NativeObjectGeometryEnum = _enum([
28962
+ "boxed",
28963
+ "while-streaming",
28964
+ "flag-only"
28965
+ ]);
28966
+ var NativeObjectDetectionOptionsSchema = object({
28967
+ /** Classes this firmware can detect — the same list the status reports. */
28968
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28969
+ /** What a detection from this camera carries. */
28970
+ geometry: NativeObjectGeometryEnum
28971
+ });
28972
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28607
28973
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28608
28974
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28609
28975
  lastFetchedAt: number() });
@@ -28613,13 +28979,23 @@ var nativeObjectDetectionCapability = {
28613
28979
  deviceNative: true,
28614
28980
  mode: "singleton",
28615
28981
  deviceTypes: [DeviceType.Camera],
28616
- methods: { setEnabled: method(object({
28617
- deviceId: number(),
28618
- enabled: boolean()
28619
- }), _void(), {
28620
- kind: "mutation",
28621
- auth: "admin"
28622
- }) },
28982
+ methods: {
28983
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28984
+ setSettings: method(object({
28985
+ deviceId: number(),
28986
+ settings: NativeObjectDetectionSettingsPatchSchema
28987
+ }), _void(), {
28988
+ kind: "mutation",
28989
+ auth: "admin"
28990
+ }),
28991
+ setEnabled: method(object({
28992
+ deviceId: number(),
28993
+ enabled: boolean()
28994
+ }), _void(), {
28995
+ kind: "mutation",
28996
+ auth: "admin"
28997
+ })
28998
+ },
28623
28999
  events: { onDetected: { data: object({
28624
29000
  deviceId: number(),
28625
29001
  detection: NativeDetectionSchema
@@ -33467,7 +33843,28 @@ var PerScopeBreakdownSchema = object({
33467
33843
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33468
33844
  totalObjects: number().int().nonnegative(),
33469
33845
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33470
- byClass: record(string(), number().int().nonnegative())
33846
+ byClass: record(string(), number().int().nonnegative()),
33847
+ /**
33848
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33849
+ * present but not going anywhere (a parked car, a bin, a statue).
33850
+ *
33851
+ * The operator's question about a scene has two halves and they answer
33852
+ * different things: "what is parked here" is stable for hours and must not
33853
+ * flap, while "who is walking through" is the thing an alert is about. One
33854
+ * number could only serve one of them, and `totalObjects` served the first
33855
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33856
+ *
33857
+ * `standing + transient === totalObjects`, always. The total keeps its old
33858
+ * meaning exactly, so no rule written against it changes behaviour.
33859
+ *
33860
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33861
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33862
+ * parked objects here" about a camera whose lot is full.
33863
+ */
33864
+ standingObjects: number().int().nonnegative().optional(),
33865
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33866
+ * same absence rule. */
33867
+ transientObjects: number().int().nonnegative().optional()
33471
33868
  });
33472
33869
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33473
33870
  zoneId: string(),
@@ -33590,6 +33987,23 @@ var HistoryPointSchema = object({
33590
33987
  * triple covers the three spatial scopes (per-zone, frame-wide,
33591
33988
  * outside-any-zone). Crossing them with `className?` gives the full
33592
33989
  * combinatorial coverage the operator UI requested.
33990
+ *
33991
+ * ## ⚠️ The three history methods are DEPRECATED
33992
+ *
33993
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33994
+ * so after a restart they report nothing about a night that did happen, and any
33995
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33996
+ * an empty scene. The presets in the occupancy chart existed to hide that
33997
+ * horizon rather than to answer a question.
33998
+ *
33999
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34000
+ * instead. Those rows are already written for every camera, ~60 bytes per
34001
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34002
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34003
+ * function the writer uses, so the two cannot drift.
34004
+ *
34005
+ * The ring stays until these three go, and it is the only thing left reading
34006
+ * it. Do not add a fourth caller.
33593
34007
  */
33594
34008
  var zoneAnalyticsCapability = {
33595
34009
  name: "zone-analytics",
@@ -34079,6 +34493,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34079
34493
  smoke: smokeCapability,
34080
34494
  streamCatalog: streamCatalogCapability,
34081
34495
  streamParams: streamParamsCapability,
34496
+ streamSignals: streamSignalsCapability,
34082
34497
  switch: switchCapability,
34083
34498
  tamper: tamperCapability,
34084
34499
  temperatureSensor: temperatureSensorCapability,
@@ -37570,12 +37985,24 @@ Object.freeze({
37570
37985
  addonId: null,
37571
37986
  access: "create"
37572
37987
  },
37988
+ "nativeObjectDetection.getOptions": {
37989
+ capName: "native-object-detection",
37990
+ capScope: "device",
37991
+ addonId: null,
37992
+ access: "view"
37993
+ },
37573
37994
  "nativeObjectDetection.setEnabled": {
37574
37995
  capName: "native-object-detection",
37575
37996
  capScope: "device",
37576
37997
  addonId: null,
37577
37998
  access: "create"
37578
37999
  },
38000
+ "nativeObjectDetection.setSettings": {
38001
+ capName: "native-object-detection",
38002
+ capScope: "device",
38003
+ addonId: null,
38004
+ access: "create"
38005
+ },
37579
38006
  "navigation.getFeatures": {
37580
38007
  capName: "navigation",
37581
38008
  capScope: "device",
@@ -37840,6 +38267,12 @@ Object.freeze({
37840
38267
  addonId: null,
37841
38268
  access: "view"
37842
38269
  },
38270
+ "notificationRules.getClipRetentionAsks": {
38271
+ capName: "notification-rules",
38272
+ capScope: "system",
38273
+ addonId: null,
38274
+ access: "view"
38275
+ },
37843
38276
  "notificationRules.getConditionCatalog": {
37844
38277
  capName: "notification-rules",
37845
38278
  capScope: "system",
@@ -38350,6 +38783,12 @@ Object.freeze({
38350
38783
  addonId: null,
38351
38784
  access: "create"
38352
38785
  },
38786
+ "pipelineAnalytics.readLongTermSeries": {
38787
+ capName: "pipeline-analytics",
38788
+ capScope: "device",
38789
+ addonId: null,
38790
+ access: "view"
38791
+ },
38353
38792
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38354
38793
  capName: "pipeline-analytics",
38355
38794
  capScope: "device",
@@ -39022,6 +39461,12 @@ Object.freeze({
39022
39461
  addonId: null,
39023
39462
  access: "create"
39024
39463
  },
39464
+ "pipelineRunner.requestOccupancyBurst": {
39465
+ capName: "pipeline-runner",
39466
+ capScope: "system",
39467
+ addonId: null,
39468
+ access: "create"
39469
+ },
39025
39470
  "pipelineRunner.runDetailSubtree": {
39026
39471
  capName: "pipeline-runner",
39027
39472
  capScope: "system",
@@ -40234,6 +40679,12 @@ Object.freeze({
40234
40679
  addonId: null,
40235
40680
  access: "create"
40236
40681
  },
40682
+ "streamBroker.reportStreamSignal": {
40683
+ capName: "stream-broker",
40684
+ capScope: "system",
40685
+ addonId: null,
40686
+ access: "create"
40687
+ },
40237
40688
  "streamBroker.restartProfile": {
40238
40689
  capName: "stream-broker",
40239
40690
  capScope: "system",
@@ -40318,6 +40769,12 @@ Object.freeze({
40318
40769
  addonId: null,
40319
40770
  access: "create"
40320
40771
  },
40772
+ "streamSignals.listSignals": {
40773
+ capName: "stream-signals",
40774
+ capScope: "device",
40775
+ addonId: null,
40776
+ access: "view"
40777
+ },
40321
40778
  "switch.setState": {
40322
40779
  capName: "switch",
40323
40780
  capScope: "device",
@@ -41790,11 +42247,21 @@ Object.freeze({
41790
42247
  form: "single",
41791
42248
  optional: false
41792
42249
  }],
42250
+ "nativeObjectDetection.getOptions": [{
42251
+ name: "deviceId",
42252
+ form: "single",
42253
+ optional: false
42254
+ }],
41793
42255
  "nativeObjectDetection.setEnabled": [{
41794
42256
  name: "deviceId",
41795
42257
  form: "single",
41796
42258
  optional: false
41797
42259
  }],
42260
+ "nativeObjectDetection.setSettings": [{
42261
+ name: "deviceId",
42262
+ form: "single",
42263
+ optional: false
42264
+ }],
41798
42265
  "navigation.getFeatures": [{
41799
42266
  name: "deviceId",
41800
42267
  form: "single",
@@ -42144,6 +42611,11 @@ Object.freeze({
42144
42611
  form: "single",
42145
42612
  optional: false
42146
42613
  }],
42614
+ "pipelineAnalytics.readLongTermSeries": [{
42615
+ name: "deviceId",
42616
+ form: "single",
42617
+ optional: false
42618
+ }],
42147
42619
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42148
42620
  name: "deviceId",
42149
42621
  form: "single",
@@ -42334,6 +42806,11 @@ Object.freeze({
42334
42806
  form: "single",
42335
42807
  optional: false
42336
42808
  }],
42809
+ "pipelineRunner.requestOccupancyBurst": [{
42810
+ name: "deviceId",
42811
+ form: "single",
42812
+ optional: false
42813
+ }],
42337
42814
  "pipelineRunner.runDetailSubtree": [{
42338
42815
  name: "deviceId",
42339
42816
  form: "single",
@@ -42690,6 +43167,11 @@ Object.freeze({
42690
43167
  form: "single",
42691
43168
  optional: false
42692
43169
  }],
43170
+ "streamBroker.reportStreamSignal": [{
43171
+ name: "deviceId",
43172
+ form: "single",
43173
+ optional: false
43174
+ }],
42693
43175
  "streamBroker.restartProfile": [{
42694
43176
  name: "deviceId",
42695
43177
  form: "single",