@camstack/addon-import-alexa 0.2.100 → 0.2.102

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
@@ -38,7 +38,7 @@ let node_os = require("node:os");
38
38
  let node_fs = require("node:fs");
39
39
  let node_path = require("node:path");
40
40
  node_path = __toESM(node_path);
41
- //#region ../types/dist/event-category-ZyX6jcse.mjs
41
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
42
42
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
43
43
  EventCategory["SystemBoot"] = "system.boot";
44
44
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -655,6 +655,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
655
655
  * pull-reconcile from the provider's `getStatus` on reconnect. */
656
656
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
657
657
  EventCategory["BackupCompleted"] = "backup.completed";
658
+ /**
659
+ * A whole backup RUN finished — every destination attempted, win or lose.
660
+ *
661
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
662
+ * a progress UI and the wrong one for a notification: an operator with three
663
+ * destinations would be told three times. And a run where two of three
664
+ * destinations succeeded is not a clean success — a single "backup
665
+ * completed" that hid the failed one would be a lie, so the count of each is
666
+ * carried here and the message says both.
667
+ *
668
+ * Emitted by the backup orchestrator only after the destination loop, so a
669
+ * run that dies during the BUILD phase produces no completion at all.
670
+ */
671
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
658
672
  EventCategory["BackupRestored"] = "backup.restored";
659
673
  EventCategory["NotificationDispatched"] = "notification.dispatched";
660
674
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5385,7 +5399,7 @@ var ZodIssueCode = {
5385
5399
  var ZodFirstPartyTypeKind;
5386
5400
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5387
5401
  //#endregion
5388
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5402
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5389
5403
  /**
5390
5404
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5391
5405
  * window to float samples (D455).
@@ -11714,6 +11728,87 @@ var brokerCapability = {
11714
11728
  }
11715
11729
  };
11716
11730
  DeviceType.Camera;
11731
+ /**
11732
+ * The signals a device can emit to WAKE its own stream.
11733
+ *
11734
+ * A camera whose stream is built on demand sleeps until something asks for it,
11735
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11736
+ * puller holds a session open for ever, and treating that as demand would keep
11737
+ * a battery camera awake for ever, which is the whole thing the battery is for
11738
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11739
+ * itself, with no stream running.
11740
+ *
11741
+ * ## The vocabulary is the PROVIDER'S, not ours
11742
+ *
11743
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11744
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11745
+ * Reolink offers motion and camera-native detection; another provider may offer
11746
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11747
+ * yet. A fixed enum here would mean every new signal is a framework release.
11748
+ *
11749
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11750
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11751
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11752
+ * binding — but both answer "what drives the detection pipeline", which is a
11753
+ * different question from "what may wake a sleeping stream". A camera can do
11754
+ * the first and not be trusted with the second, and the operator picks per
11755
+ * camera. Two questions, two authorities.
11756
+ *
11757
+ * ## Availability is not permission
11758
+ *
11759
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11760
+ * wakes the stream is the operator's per-camera choice, held by the broker
11761
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11762
+ * provider declaring a signal is not a provider enabling it.
11763
+ */
11764
+ /** One signal a device can emit. */
11765
+ var StreamSignalSchema = object({
11766
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11767
+ code: string().min(1),
11768
+ /** What an operator reads in the picker. The provider's own wording. */
11769
+ label: string().min(1),
11770
+ /**
11771
+ * Whether the provider recommends this signal ON when a camera is first set
11772
+ * up. A provider knows which of its signals are cheap and reliable; an
11773
+ * operator should not have to discover that by trial. Reolink recommends
11774
+ * both of its own.
11775
+ */
11776
+ recommended: boolean()
11777
+ });
11778
+ var StreamSignalsStatusSchema = object({
11779
+ signals: array(StreamSignalSchema),
11780
+ lastFetchedAt: number()
11781
+ });
11782
+ var streamSignalsCapability = {
11783
+ name: "stream-signals",
11784
+ scope: "device",
11785
+ deviceNative: true,
11786
+ mode: "singleton",
11787
+ deviceTypes: Object.values(DeviceType),
11788
+ runtimeState: StreamSignalsStatusSchema,
11789
+ /**
11790
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11791
+ *
11792
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11793
+ * not an operator choice: the provider re-declares it on every registration,
11794
+ * so losing it loses nothing and persisting it would freeze an answer the
11795
+ * camera is entitled to change. Measured the same day on the sibling case —
11796
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11797
+ * class the camera really detected stayed missing for the life of the row
11798
+ * because the fix could not reach it.
11799
+ *
11800
+ * See `RuntimeStateDurability`. Enforced by
11801
+ * `scripts/check-runtime-state-durability.ts`.
11802
+ */
11803
+ durability: "session",
11804
+ methods: {
11805
+ /**
11806
+ * What this device can emit. Empty is a valid and common answer — most
11807
+ * cameras have nothing to offer here, and an empty list is what makes the
11808
+ * broker's picker show nothing rather than a false choice.
11809
+ */
11810
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11811
+ };
11717
11812
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11718
11813
  var StreamFormatSchema = _enum([
11719
11814
  "webrtc",
@@ -12110,6 +12205,22 @@ var EgressTranscodeSchema = object({
12110
12205
  camStreamId: string().nullable()
12111
12206
  });
12112
12207
  method(object({
12208
+ deviceId: number().int().nonnegative(),
12209
+ /** The provider's signal code. */
12210
+ code: string().min(1),
12211
+ /** Ms epoch. Absent ⇒ now. */
12212
+ at: number().optional()
12213
+ }), object({
12214
+ /** Whether the broker acted on it, and if not, why. */
12215
+ accepted: boolean(),
12216
+ reason: _enum([
12217
+ "woke",
12218
+ "hold-extended",
12219
+ "not-enabled",
12220
+ "no-consumer",
12221
+ "unknown-code"
12222
+ ])
12223
+ }), { kind: "mutation" }), method(object({
12113
12224
  deviceId: number().int().nonnegative(),
12114
12225
  camStreamId: string().min(1),
12115
12226
  kind: CamStreamKindSchema,
@@ -12364,6 +12475,16 @@ var PickStreamRequirementsSchema = object({
12364
12475
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12365
12476
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12366
12477
  minHeight: number().int().positive().optional(),
12478
+ /**
12479
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12480
+ *
12481
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12482
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12483
+ * Without this the ceiling had to be re-implemented by every caller — and
12484
+ * one caller implementing it privately is how a second scoring authority
12485
+ * gets born.
12486
+ */
12487
+ maxHeight: number().int().positive().optional(),
12367
12488
  /** Minimum horizontal resolution. */
12368
12489
  minWidth: number().int().positive().optional(),
12369
12490
  /**
@@ -12380,7 +12501,22 @@ var PickStreamRequirementsSchema = object({
12380
12501
  * transcoded" guard: if the device is already serving the consumer's
12381
12502
  * codec end-to-end, there's nothing to optimise.
12382
12503
  */
12383
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12504
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12505
+ /**
12506
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12507
+ * understanding that it will be transcoded.
12508
+ *
12509
+ * Default `false` — today's behaviour, and the right one for a bypass
12510
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12511
+ * ask the larger question: "what is the best stream for me, transcoding if
12512
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12513
+ * does not, so a passthrough is never lost to a transcode; the answer says
12514
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12515
+ *
12516
+ * This is what lets one picker serve both the bypass and the full source
12517
+ * choice, instead of a consumer scoring privately when the bypass misses.
12518
+ */
12519
+ allowTranscode: boolean().optional()
12384
12520
  }).readonly();
12385
12521
  var PickStreamPreferencesSchema = object({
12386
12522
  /**
@@ -12394,12 +12530,32 @@ var PickStreamPreferencesSchema = object({
12394
12530
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12395
12531
  * memory-constrained consumers / Apple Home guest sessions).
12396
12532
  */
12397
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12533
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12534
+ /**
12535
+ * The height the consumer actually wants to DELIVER.
12536
+ *
12537
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12538
+ * above the target wins, and only if nothing reaches it does the tallest
12539
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12540
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12541
+ * express that: it says "as big as possible", which is a different wish.
12542
+ *
12543
+ * Ignored when absent, so every existing caller keeps its ordering.
12544
+ */
12545
+ targetHeight: number().int().positive().optional()
12398
12546
  }).readonly();
12399
12547
  var PickedCamStreamSchema = object({
12400
12548
  camStreamId: string(),
12401
12549
  codec: string().optional(),
12402
12550
  resolution: CamStreamResolutionSchema.optional(),
12551
+ /**
12552
+ * Whether serving this stream requires a decode + re-encode.
12553
+ *
12554
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12555
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12556
+ * not ask cannot be handed a cost it never agreed to pay.
12557
+ */
12558
+ transcodes: boolean(),
12403
12559
  /** One-line explanation of why this stream won — for logs / debug UI. */
12404
12560
  reason: string()
12405
12561
  });
@@ -16933,6 +17089,8 @@ var NcSystemEventKindSchema = _enum([
16933
17089
  "device-enabled",
16934
17090
  "device-battery-low",
16935
17091
  "device-battery-normal",
17092
+ "device-consumable-low",
17093
+ "device-consumable-normal",
16936
17094
  "stream-online",
16937
17095
  "stream-offline",
16938
17096
  "node-online",
@@ -16951,6 +17109,7 @@ var NcSystemEventKindSchema = _enum([
16951
17109
  "addon-updated",
16952
17110
  "server-updated",
16953
17111
  "export-completed",
17112
+ "backup-completed",
16954
17113
  "camera-online",
16955
17114
  "camera-offline",
16956
17115
  "camera-disabled",
@@ -18273,6 +18432,48 @@ var NcAlarmConfigSchema = object({
18273
18432
  settings: NcAlarmSettingsSchema,
18274
18433
  coverage: array(NcAlarmModeCoverageSchema)
18275
18434
  });
18435
+ /**
18436
+ * ONE rule's demand on ONE camera's clip ring.
18437
+ *
18438
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18439
+ * camera, so the answer stays a faithful description of the rules and the
18440
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18441
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18442
+ * a different thing from never having been told, and only the envelope
18443
+ * (`rulesLoaded`) can tell those apart.
18444
+ */
18445
+ var NcClipRetentionAskSchema = object({
18446
+ /**
18447
+ * The camera this ask is about. **Absent = every camera**, which is what a
18448
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18449
+ * asking everywhere.
18450
+ */
18451
+ deviceId: number().int().nonnegative().optional(),
18452
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18453
+ * needs nothing produces no ask at all. */
18454
+ seconds: number().min(0).max(60),
18455
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18456
+ * assigned, which is what the cut defaults to. */
18457
+ profile: CamProfileSchema.optional(),
18458
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18459
+ ruleId: string(),
18460
+ ruleName: string(),
18461
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18462
+ reason: _enum(["window", "occupancy"])
18463
+ });
18464
+ /**
18465
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18466
+ *
18467
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18468
+ * once. A centre that is up but has not read its rules yet answers with an
18469
+ * empty ask list that means nothing at all — applying it would drop every
18470
+ * camera's ring to zero for the first events after a restart, which is the
18471
+ * footage this mechanism exists to keep.
18472
+ */
18473
+ var NcClipRetentionPlanSchema = object({
18474
+ rulesLoaded: boolean(),
18475
+ asks: array(NcClipRetentionAskSchema).readonly()
18476
+ });
18276
18477
  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 }), {
18277
18478
  kind: "mutation",
18278
18479
  auth: "admin",
@@ -18293,7 +18494,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18293
18494
  }), object({ success: literal(true) }), {
18294
18495
  kind: "mutation",
18295
18496
  auth: "admin"
18296
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18497
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18297
18498
  deviceId: number().int(),
18298
18499
  muted: boolean()
18299
18500
  }), object({ success: literal(true) }), {
@@ -20867,6 +21068,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20867
21068
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20868
21069
  framesMatched: number().int()
20869
21070
  })).readonly() });
21071
+ /**
21072
+ * The long-term series a camera produces. A closed union so a typo cannot
21073
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21074
+ * is an alias of this, not a second list.
21075
+ */
21076
+ var AnalyticsLtsSeriesSchema = _enum([
21077
+ "motion",
21078
+ "audio-dbfs",
21079
+ "battery",
21080
+ "occupancy"
21081
+ ]);
21082
+ /**
21083
+ * One closed 5-minute bucket of a long-term series.
21084
+ *
21085
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21086
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21087
+ * that exists at all was measured; a bucket that is absent was not, which is a
21088
+ * different claim from zero and the reason this is a sparse series.
21089
+ */
21090
+ var LtsBucketSchema = object({
21091
+ scope: string(),
21092
+ bucketStart: number().int(),
21093
+ samples: number().int().nonnegative(),
21094
+ sum: number(),
21095
+ min: number(),
21096
+ max: number()
21097
+ });
20870
21098
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20871
21099
  deviceId: number(),
20872
21100
  trackId: string()
@@ -20913,6 +21141,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20913
21141
  kinds: array(string()).optional(),
20914
21142
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20915
21143
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
21144
+ deviceId: number(),
21145
+ series: AnalyticsLtsSeriesSchema,
21146
+ /** Omit for EVERY scope of this series in the range. */
21147
+ scope: string().optional(),
21148
+ from: number(),
21149
+ to: number(),
21150
+ limit: number().int().positive().optional()
21151
+ }), array(LtsBucketSchema).readonly()), method(object({
20916
21152
  deviceId: number(),
20917
21153
  since: number(),
20918
21154
  until: number(),
@@ -21531,6 +21767,14 @@ var MotionSourceEnum = _enum([
21531
21767
  */
21532
21768
  var MotionSourcesSchema = array(MotionSourceEnum);
21533
21769
  /**
21770
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21771
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21772
+ * than a second spelling of the same two ideas — the value an operator picks
21773
+ * here is the value that comes back on the track, the overlay and the debug
21774
+ * row.
21775
+ */
21776
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21777
+ /**
21534
21778
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21535
21779
  * so cap-side consumers (the orchestrator forward, the runner addon's
21536
21780
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21681,6 +21925,35 @@ var RunnerCameraConfigSchema = object({
21681
21925
  * events; the orchestrator forwards to `reportMotion`.
21682
21926
  */
21683
21927
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21928
+ /**
21929
+ * WHICH root detector runs for this camera. The detection counterpart of
21930
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21931
+ * of sources the system understands, vendor-agnostic, owned here.
21932
+ *
21933
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21934
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21935
+ * here. Its boxes reach post-analysis on the same
21936
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21937
+ * track gets the same tracker, the same overlay and the same detail
21938
+ * subtree (face / plate / embedding).
21939
+ *
21940
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21941
+ * run, and that is where a camera with a usable onboard detector buys back
21942
+ * its share of the accelerator. It saves the root inference, not the decode
21943
+ * — the detail subtree still needs pixels to cut crops from.
21944
+ *
21945
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21946
+ * step at all (there is nothing to track), and the cap that knows this says
21947
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21948
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21949
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21950
+ * worth exactly what it already is — a wake signal with a class.
21951
+ *
21952
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21953
+ * vendor never turns a detector on for the operator, and neither does a
21954
+ * default.
21955
+ */
21956
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21684
21957
  pipelineEnabled: boolean().default(true),
21685
21958
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21686
21959
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21862,7 +22135,47 @@ var RunnerLocalMetricsSchema = object({
21862
22135
  queueDepth: number(),
21863
22136
  frameLazy: FrameLazyMetricsSchema.optional()
21864
22137
  });
22138
+ /**
22139
+ * Pipeline Runner capability — runtime detection workhorse.
22140
+ *
22141
+ * One instance per node. Receives camera assignments from
22142
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22143
+ * decoded frames, drains motion + detection queues, calls the local
22144
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22145
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22146
+ * the bus.
22147
+ *
22148
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22149
+ * runner has zero knowledge of other agents, no global state, and never
22150
+ * makes assignment decisions itself.
22151
+ */
22152
+ /**
22153
+ * Why a runner declined to look at a camera out of band. Named rather than a
22154
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22155
+ * already mid-session and one already bursting are four different facts, and a
22156
+ * caller told only "no" cannot tell a protection from a bug.
22157
+ */
22158
+ var OccupancyBurstRefusalSchema = _enum([
22159
+ "not-attached",
22160
+ "battery-asleep",
22161
+ "not-watching",
22162
+ "already-bursting"
22163
+ ]);
21865
22164
  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({
22165
+ deviceId: number(),
22166
+ /** How many frames to collect. The caller sizes this against what its
22167
+ * own confirmation needs; the runner clamps it to the field's range. */
22168
+ frames: number().int().positive().optional(),
22169
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22170
+ * defend — the periodic one at least has a timer to point at. */
22171
+ reason: string()
22172
+ }), object({
22173
+ started: boolean(),
22174
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22175
+ }), {
22176
+ auth: "admin",
22177
+ kind: "mutation"
22178
+ }), method(object({
21866
22179
  handle: FrameHandleSchema,
21867
22180
  bbox: NativeCropBboxSchema,
21868
22181
  maxWidth: number().int().positive().optional(),
@@ -24232,10 +24545,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
24232
24545
  }), boolean()), method(object({
24233
24546
  deviceId: number().int().nonnegative(),
24234
24547
  sessionId: string()
24235
- }), object({ pendingRenegotiation: object({
24236
- target: WebrtcStreamTargetSchema,
24237
- epoch: number()
24238
- }).nullable() }));
24548
+ }), object({
24549
+ pendingRenegotiation: object({
24550
+ target: WebrtcStreamTargetSchema,
24551
+ epoch: number()
24552
+ }).nullable(),
24553
+ /**
24554
+ * Whether the session still EXISTS.
24555
+ *
24556
+ * A consumer that holds a resource for the life of a session needs to
24557
+ * be able to ask, because a session does not always end the way it
24558
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24559
+ * sent `SessionDisconnected`, so the Alexa exporter's
24560
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24561
+ * H.264 transcode kept running for NOBODY for more than twenty
24562
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24563
+ * minutes earlier — the broker knew; the holder had no way to ask.
24564
+ *
24565
+ * `false` for a session id the provider has never heard of, which is
24566
+ * the same answer as "it ended": either way nothing is holding it up.
24567
+ */
24568
+ alive: boolean()
24569
+ }));
24239
24570
  object({
24240
24571
  /** All accessory children of the parent. */
24241
24572
  childDeviceIds: array(number()).readonly(),
@@ -28691,11 +29022,46 @@ var NativeObjectDetectionStatusSchema = object({
28691
29022
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28692
29023
  /**
28693
29024
  * Whether forwarding of onboard AI detections is enabled for this device.
28694
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28695
- * churn the tracker, so forwarding stays off until the operator enables it.
29025
+ *
29026
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
29027
+ * camera runs — that is the operator's choice, and it is made where every
29028
+ * other detection choice is made. `geometry` on
29029
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
29030
+ * choice would buy this particular camera.
28696
29031
  */
28697
29032
  enabled: boolean()
28698
29033
  });
29034
+ /**
29035
+ * WHEN a camera's onboard detections carry geometry.
29036
+ *
29037
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
29038
+ * a detection is a trackable subject whenever the camera sees one.
29039
+ * - `while-streaming` — only while some stream of this camera is already open.
29040
+ * The boxes ride the video's own side-channel rather than a feed of their
29041
+ * own, so they cost nothing and they exist only when something is pulling.
29042
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
29043
+ * radio drain, but a camera that is awake is awake precisely because
29044
+ * something is in front of it, and its stream is already being pulled.
29045
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
29046
+ * pipeline needs geometry to make a subject, so such a push reaches the
29047
+ * tracker as motion and no further.
29048
+ *
29049
+ * Reported and not inferred, because the operator's question in front of the
29050
+ * picker is "what do I get", and these are three different answers (D14: the
29051
+ * derived form is only as honest as `getOptions`).
29052
+ */
29053
+ var NativeObjectGeometryEnum = _enum([
29054
+ "boxed",
29055
+ "while-streaming",
29056
+ "flag-only"
29057
+ ]);
29058
+ var NativeObjectDetectionOptionsSchema = object({
29059
+ /** Classes this firmware can detect — the same list the status reports. */
29060
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
29061
+ /** What a detection from this camera carries. */
29062
+ geometry: NativeObjectGeometryEnum
29063
+ });
29064
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28699
29065
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28700
29066
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28701
29067
  lastFetchedAt: number() });
@@ -28705,13 +29071,23 @@ var nativeObjectDetectionCapability = {
28705
29071
  deviceNative: true,
28706
29072
  mode: "singleton",
28707
29073
  deviceTypes: [DeviceType.Camera],
28708
- methods: { setEnabled: method(object({
28709
- deviceId: number(),
28710
- enabled: boolean()
28711
- }), _void(), {
28712
- kind: "mutation",
28713
- auth: "admin"
28714
- }) },
29074
+ methods: {
29075
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29076
+ setSettings: method(object({
29077
+ deviceId: number(),
29078
+ settings: NativeObjectDetectionSettingsPatchSchema
29079
+ }), _void(), {
29080
+ kind: "mutation",
29081
+ auth: "admin"
29082
+ }),
29083
+ setEnabled: method(object({
29084
+ deviceId: number(),
29085
+ enabled: boolean()
29086
+ }), _void(), {
29087
+ kind: "mutation",
29088
+ auth: "admin"
29089
+ })
29090
+ },
28715
29091
  events: { onDetected: { data: object({
28716
29092
  deviceId: number(),
28717
29093
  detection: NativeDetectionSchema
@@ -33559,7 +33935,28 @@ var PerScopeBreakdownSchema = object({
33559
33935
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33560
33936
  totalObjects: number().int().nonnegative(),
33561
33937
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33562
- byClass: record(string(), number().int().nonnegative())
33938
+ byClass: record(string(), number().int().nonnegative()),
33939
+ /**
33940
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33941
+ * present but not going anywhere (a parked car, a bin, a statue).
33942
+ *
33943
+ * The operator's question about a scene has two halves and they answer
33944
+ * different things: "what is parked here" is stable for hours and must not
33945
+ * flap, while "who is walking through" is the thing an alert is about. One
33946
+ * number could only serve one of them, and `totalObjects` served the first
33947
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33948
+ *
33949
+ * `standing + transient === totalObjects`, always. The total keeps its old
33950
+ * meaning exactly, so no rule written against it changes behaviour.
33951
+ *
33952
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33953
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33954
+ * parked objects here" about a camera whose lot is full.
33955
+ */
33956
+ standingObjects: number().int().nonnegative().optional(),
33957
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33958
+ * same absence rule. */
33959
+ transientObjects: number().int().nonnegative().optional()
33563
33960
  });
33564
33961
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33565
33962
  zoneId: string(),
@@ -33682,6 +34079,23 @@ var HistoryPointSchema = object({
33682
34079
  * triple covers the three spatial scopes (per-zone, frame-wide,
33683
34080
  * outside-any-zone). Crossing them with `className?` gives the full
33684
34081
  * combinatorial coverage the operator UI requested.
34082
+ *
34083
+ * ## ⚠️ The three history methods are DEPRECATED
34084
+ *
34085
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34086
+ * so after a restart they report nothing about a night that did happen, and any
34087
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34088
+ * an empty scene. The presets in the occupancy chart existed to hide that
34089
+ * horizon rather than to answer a question.
34090
+ *
34091
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34092
+ * instead. Those rows are already written for every camera, ~60 bytes per
34093
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34094
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34095
+ * function the writer uses, so the two cannot drift.
34096
+ *
34097
+ * The ring stays until these three go, and it is the only thing left reading
34098
+ * it. Do not add a fourth caller.
33685
34099
  */
33686
34100
  var zoneAnalyticsCapability = {
33687
34101
  name: "zone-analytics",
@@ -34171,6 +34585,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
34171
34585
  smoke: smokeCapability,
34172
34586
  streamCatalog: streamCatalogCapability,
34173
34587
  streamParams: streamParamsCapability,
34588
+ streamSignals: streamSignalsCapability,
34174
34589
  switch: switchCapability,
34175
34590
  tamper: tamperCapability,
34176
34591
  temperatureSensor: temperatureSensorCapability,
@@ -38080,12 +38495,24 @@ Object.freeze({
38080
38495
  addonId: null,
38081
38496
  access: "create"
38082
38497
  },
38498
+ "nativeObjectDetection.getOptions": {
38499
+ capName: "native-object-detection",
38500
+ capScope: "device",
38501
+ addonId: null,
38502
+ access: "view"
38503
+ },
38083
38504
  "nativeObjectDetection.setEnabled": {
38084
38505
  capName: "native-object-detection",
38085
38506
  capScope: "device",
38086
38507
  addonId: null,
38087
38508
  access: "create"
38088
38509
  },
38510
+ "nativeObjectDetection.setSettings": {
38511
+ capName: "native-object-detection",
38512
+ capScope: "device",
38513
+ addonId: null,
38514
+ access: "create"
38515
+ },
38089
38516
  "navigation.getFeatures": {
38090
38517
  capName: "navigation",
38091
38518
  capScope: "device",
@@ -38350,6 +38777,12 @@ Object.freeze({
38350
38777
  addonId: null,
38351
38778
  access: "view"
38352
38779
  },
38780
+ "notificationRules.getClipRetentionAsks": {
38781
+ capName: "notification-rules",
38782
+ capScope: "system",
38783
+ addonId: null,
38784
+ access: "view"
38785
+ },
38353
38786
  "notificationRules.getConditionCatalog": {
38354
38787
  capName: "notification-rules",
38355
38788
  capScope: "system",
@@ -38860,6 +39293,12 @@ Object.freeze({
38860
39293
  addonId: null,
38861
39294
  access: "create"
38862
39295
  },
39296
+ "pipelineAnalytics.readLongTermSeries": {
39297
+ capName: "pipeline-analytics",
39298
+ capScope: "device",
39299
+ addonId: null,
39300
+ access: "view"
39301
+ },
38863
39302
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38864
39303
  capName: "pipeline-analytics",
38865
39304
  capScope: "device",
@@ -39532,6 +39971,12 @@ Object.freeze({
39532
39971
  addonId: null,
39533
39972
  access: "create"
39534
39973
  },
39974
+ "pipelineRunner.requestOccupancyBurst": {
39975
+ capName: "pipeline-runner",
39976
+ capScope: "system",
39977
+ addonId: null,
39978
+ access: "create"
39979
+ },
39535
39980
  "pipelineRunner.runDetailSubtree": {
39536
39981
  capName: "pipeline-runner",
39537
39982
  capScope: "system",
@@ -40744,6 +41189,12 @@ Object.freeze({
40744
41189
  addonId: null,
40745
41190
  access: "create"
40746
41191
  },
41192
+ "streamBroker.reportStreamSignal": {
41193
+ capName: "stream-broker",
41194
+ capScope: "system",
41195
+ addonId: null,
41196
+ access: "create"
41197
+ },
40747
41198
  "streamBroker.restartProfile": {
40748
41199
  capName: "stream-broker",
40749
41200
  capScope: "system",
@@ -40828,6 +41279,12 @@ Object.freeze({
40828
41279
  addonId: null,
40829
41280
  access: "create"
40830
41281
  },
41282
+ "streamSignals.listSignals": {
41283
+ capName: "stream-signals",
41284
+ capScope: "device",
41285
+ addonId: null,
41286
+ access: "view"
41287
+ },
40831
41288
  "switch.setState": {
40832
41289
  capName: "switch",
40833
41290
  capScope: "device",
@@ -42300,11 +42757,21 @@ Object.freeze({
42300
42757
  form: "single",
42301
42758
  optional: false
42302
42759
  }],
42760
+ "nativeObjectDetection.getOptions": [{
42761
+ name: "deviceId",
42762
+ form: "single",
42763
+ optional: false
42764
+ }],
42303
42765
  "nativeObjectDetection.setEnabled": [{
42304
42766
  name: "deviceId",
42305
42767
  form: "single",
42306
42768
  optional: false
42307
42769
  }],
42770
+ "nativeObjectDetection.setSettings": [{
42771
+ name: "deviceId",
42772
+ form: "single",
42773
+ optional: false
42774
+ }],
42308
42775
  "navigation.getFeatures": [{
42309
42776
  name: "deviceId",
42310
42777
  form: "single",
@@ -42654,6 +43121,11 @@ Object.freeze({
42654
43121
  form: "single",
42655
43122
  optional: false
42656
43123
  }],
43124
+ "pipelineAnalytics.readLongTermSeries": [{
43125
+ name: "deviceId",
43126
+ form: "single",
43127
+ optional: false
43128
+ }],
42657
43129
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42658
43130
  name: "deviceId",
42659
43131
  form: "single",
@@ -42844,6 +43316,11 @@ Object.freeze({
42844
43316
  form: "single",
42845
43317
  optional: false
42846
43318
  }],
43319
+ "pipelineRunner.requestOccupancyBurst": [{
43320
+ name: "deviceId",
43321
+ form: "single",
43322
+ optional: false
43323
+ }],
42847
43324
  "pipelineRunner.runDetailSubtree": [{
42848
43325
  name: "deviceId",
42849
43326
  form: "single",
@@ -43200,6 +43677,11 @@ Object.freeze({
43200
43677
  form: "single",
43201
43678
  optional: false
43202
43679
  }],
43680
+ "streamBroker.reportStreamSignal": [{
43681
+ name: "deviceId",
43682
+ form: "single",
43683
+ optional: false
43684
+ }],
43203
43685
  "streamBroker.restartProfile": [{
43204
43686
  name: "deviceId",
43205
43687
  form: "single",