@camstack/addon-notifiers 1.2.105 → 1.2.107

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 +469 -37
  2. package/dist/addon.mjs +469 -37
  3. package/package.json +2 -2
package/dist/addon.js CHANGED
@@ -29,7 +29,7 @@ let node_fs = require("node:fs");
29
29
  let node_path = require("node:path");
30
30
  node_path = __toESM(node_path);
31
31
  let node_url = require("node:url");
32
- //#region ../types/dist/event-category-ZyX6jcse.mjs
32
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
33
33
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
34
34
  EventCategory["SystemBoot"] = "system.boot";
35
35
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -646,6 +646,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
646
646
  * pull-reconcile from the provider's `getStatus` on reconnect. */
647
647
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
648
648
  EventCategory["BackupCompleted"] = "backup.completed";
649
+ /**
650
+ * A whole backup RUN finished — every destination attempted, win or lose.
651
+ *
652
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
653
+ * a progress UI and the wrong one for a notification: an operator with three
654
+ * destinations would be told three times. And a run where two of three
655
+ * destinations succeeded is not a clean success — a single "backup
656
+ * completed" that hid the failed one would be a lie, so the count of each is
657
+ * carried here and the message says both.
658
+ *
659
+ * Emitted by the backup orchestrator only after the destination loop, so a
660
+ * run that dies during the BUILD phase produces no completion at all.
661
+ */
662
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
649
663
  EventCategory["BackupRestored"] = "backup.restored";
650
664
  EventCategory["NotificationDispatched"] = "notification.dispatched";
651
665
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5376,7 +5390,7 @@ var ZodIssueCode = {
5376
5390
  var ZodFirstPartyTypeKind;
5377
5391
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5378
5392
  //#endregion
5379
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5393
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5380
5394
  /**
5381
5395
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5382
5396
  * window to float samples (D455).
@@ -7257,6 +7271,28 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7257
7271
  DeviceRole["GenericNotifier"] = "generic-notifier";
7258
7272
  return DeviceRole;
7259
7273
  }({});
7274
+ /**
7275
+ * Identity — preserves literal types for downstream inference.
7276
+ *
7277
+ * The constraint is `Record<string, unknown>` (not `CustomActionsSpec`) so
7278
+ * TypeScript does not widen each entry's literal `kind`/`auth` fields to
7279
+ * the broader unions declared on `CustomActionSpec`'s default generics.
7280
+ * Shape validity is enforced separately by the `customAction(...)` helper
7281
+ * whose return type is already a `CustomActionSpec<...>`.
7282
+ */
7283
+ function defineCustomActions(spec) {
7284
+ return spec;
7285
+ }
7286
+ function customAction(input, output, options) {
7287
+ return {
7288
+ input,
7289
+ output,
7290
+ kind: options?.kind ?? "query",
7291
+ auth: options?.auth ?? "protected",
7292
+ scope: options?.scope ?? { kind: "system" },
7293
+ ...options?.caller ? { caller: "required" } : {}
7294
+ };
7295
+ }
7260
7296
  var StaticDirOutputSchema = object({ staticDir: string() });
7261
7297
  var VersionOutputSchema = object({ version: string() });
7262
7298
  method(_void(), StaticDirOutputSchema, { auth: "admin" }), method(_void(), VersionOutputSchema, { auth: "admin" });
@@ -11640,6 +11676,58 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11640
11676
  auth: "admin"
11641
11677
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11642
11678
  DeviceType.Camera;
11679
+ /**
11680
+ * The signals a device can emit to WAKE its own stream.
11681
+ *
11682
+ * A camera whose stream is built on demand sleeps until something asks for it,
11683
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11684
+ * puller holds a session open for ever, and treating that as demand would keep
11685
+ * a battery camera awake for ever, which is the whole thing the battery is for
11686
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11687
+ * itself, with no stream running.
11688
+ *
11689
+ * ## The vocabulary is the PROVIDER'S, not ours
11690
+ *
11691
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11692
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11693
+ * Reolink offers motion and camera-native detection; another provider may offer
11694
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11695
+ * yet. A fixed enum here would mean every new signal is a framework release.
11696
+ *
11697
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11698
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11699
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11700
+ * binding — but both answer "what drives the detection pipeline", which is a
11701
+ * different question from "what may wake a sleeping stream". A camera can do
11702
+ * the first and not be trusted with the second, and the operator picks per
11703
+ * camera. Two questions, two authorities.
11704
+ *
11705
+ * ## Availability is not permission
11706
+ *
11707
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11708
+ * wakes the stream is the operator's per-camera choice, held by the broker
11709
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11710
+ * provider declaring a signal is not a provider enabling it.
11711
+ */
11712
+ /** One signal a device can emit. */
11713
+ var StreamSignalSchema = object({
11714
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11715
+ code: string().min(1),
11716
+ /** What an operator reads in the picker. The provider's own wording. */
11717
+ label: string().min(1),
11718
+ /**
11719
+ * Whether the provider recommends this signal ON when a camera is first set
11720
+ * up. A provider knows which of its signals are cheap and reliable; an
11721
+ * operator should not have to discover that by trial. Reolink recommends
11722
+ * both of its own.
11723
+ */
11724
+ recommended: boolean()
11725
+ });
11726
+ object({
11727
+ signals: array(StreamSignalSchema),
11728
+ lastFetchedAt: number()
11729
+ });
11730
+ Object.values(DeviceType), method(_void(), array(StreamSignalSchema).readonly());
11643
11731
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11644
11732
  var StreamFormatSchema = _enum([
11645
11733
  "webrtc",
@@ -12036,6 +12124,22 @@ var EgressTranscodeSchema = object({
12036
12124
  camStreamId: string().nullable()
12037
12125
  });
12038
12126
  method(object({
12127
+ deviceId: number().int().nonnegative(),
12128
+ /** The provider's signal code. */
12129
+ code: string().min(1),
12130
+ /** Ms epoch. Absent ⇒ now. */
12131
+ at: number().optional()
12132
+ }), object({
12133
+ /** Whether the broker acted on it, and if not, why. */
12134
+ accepted: boolean(),
12135
+ reason: _enum([
12136
+ "woke",
12137
+ "hold-extended",
12138
+ "not-enabled",
12139
+ "no-consumer",
12140
+ "unknown-code"
12141
+ ])
12142
+ }), { kind: "mutation" }), method(object({
12039
12143
  deviceId: number().int().nonnegative(),
12040
12144
  camStreamId: string().min(1),
12041
12145
  kind: CamStreamKindSchema,
@@ -12290,6 +12394,16 @@ var PickStreamRequirementsSchema = object({
12290
12394
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12291
12395
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12292
12396
  minHeight: number().int().positive().optional(),
12397
+ /**
12398
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12399
+ *
12400
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12401
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12402
+ * Without this the ceiling had to be re-implemented by every caller — and
12403
+ * one caller implementing it privately is how a second scoring authority
12404
+ * gets born.
12405
+ */
12406
+ maxHeight: number().int().positive().optional(),
12293
12407
  /** Minimum horizontal resolution. */
12294
12408
  minWidth: number().int().positive().optional(),
12295
12409
  /**
@@ -12306,7 +12420,22 @@ var PickStreamRequirementsSchema = object({
12306
12420
  * transcoded" guard: if the device is already serving the consumer's
12307
12421
  * codec end-to-end, there's nothing to optimise.
12308
12422
  */
12309
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12423
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12424
+ /**
12425
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12426
+ * understanding that it will be transcoded.
12427
+ *
12428
+ * Default `false` — today's behaviour, and the right one for a bypass
12429
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12430
+ * ask the larger question: "what is the best stream for me, transcoding if
12431
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12432
+ * does not, so a passthrough is never lost to a transcode; the answer says
12433
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12434
+ *
12435
+ * This is what lets one picker serve both the bypass and the full source
12436
+ * choice, instead of a consumer scoring privately when the bypass misses.
12437
+ */
12438
+ allowTranscode: boolean().optional()
12310
12439
  }).readonly();
12311
12440
  var PickStreamPreferencesSchema = object({
12312
12441
  /**
@@ -12320,12 +12449,32 @@ var PickStreamPreferencesSchema = object({
12320
12449
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12321
12450
  * memory-constrained consumers / Apple Home guest sessions).
12322
12451
  */
12323
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12452
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12453
+ /**
12454
+ * The height the consumer actually wants to DELIVER.
12455
+ *
12456
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12457
+ * above the target wins, and only if nothing reaches it does the tallest
12458
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12459
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12460
+ * express that: it says "as big as possible", which is a different wish.
12461
+ *
12462
+ * Ignored when absent, so every existing caller keeps its ordering.
12463
+ */
12464
+ targetHeight: number().int().positive().optional()
12324
12465
  }).readonly();
12325
12466
  var PickedCamStreamSchema = object({
12326
12467
  camStreamId: string(),
12327
12468
  codec: string().optional(),
12328
12469
  resolution: CamStreamResolutionSchema.optional(),
12470
+ /**
12471
+ * Whether serving this stream requires a decode + re-encode.
12472
+ *
12473
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12474
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12475
+ * not ask cannot be handed a cost it never agreed to pay.
12476
+ */
12477
+ transcodes: boolean(),
12329
12478
  /** One-line explanation of why this stream won — for logs / debug UI. */
12330
12479
  reason: string()
12331
12480
  });
@@ -12443,28 +12592,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
12443
12592
  content: string()
12444
12593
  })) }), { auth: "admin" });
12445
12594
  /**
12446
- * Identity — preserves literal types for downstream inference.
12447
- *
12448
- * The constraint is `Record<string, unknown>` (not `CustomActionsSpec`) so
12449
- * TypeScript does not widen each entry's literal `kind`/`auth` fields to
12450
- * the broader unions declared on `CustomActionSpec`'s default generics.
12451
- * Shape validity is enforced separately by the `customAction(...)` helper
12452
- * whose return type is already a `CustomActionSpec<...>`.
12453
- */
12454
- function defineCustomActions(spec) {
12455
- return spec;
12456
- }
12457
- function customAction(input, output, options) {
12458
- return {
12459
- input,
12460
- output,
12461
- kind: options?.kind ?? "query",
12462
- auth: options?.auth ?? "protected",
12463
- scope: options?.scope ?? { kind: "system" },
12464
- ...options?.caller ? { caller: "required" } : {}
12465
- };
12466
- }
12467
- /**
12468
12595
  * `custom-model-registry` — collection cap exposing operator-registered
12469
12596
  * custom detection models. Each provider (today: `addon-model-studio`)
12470
12597
  * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
@@ -16550,6 +16677,8 @@ var NcSystemEventKindSchema = _enum([
16550
16677
  "device-enabled",
16551
16678
  "device-battery-low",
16552
16679
  "device-battery-normal",
16680
+ "device-consumable-low",
16681
+ "device-consumable-normal",
16553
16682
  "stream-online",
16554
16683
  "stream-offline",
16555
16684
  "node-online",
@@ -16568,6 +16697,7 @@ var NcSystemEventKindSchema = _enum([
16568
16697
  "addon-updated",
16569
16698
  "server-updated",
16570
16699
  "export-completed",
16700
+ "backup-completed",
16571
16701
  "camera-online",
16572
16702
  "camera-offline",
16573
16703
  "camera-disabled",
@@ -17890,6 +18020,48 @@ var NcAlarmConfigSchema = object({
17890
18020
  settings: NcAlarmSettingsSchema,
17891
18021
  coverage: array(NcAlarmModeCoverageSchema)
17892
18022
  });
18023
+ /**
18024
+ * ONE rule's demand on ONE camera's clip ring.
18025
+ *
18026
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18027
+ * camera, so the answer stays a faithful description of the rules and the
18028
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18029
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18030
+ * a different thing from never having been told, and only the envelope
18031
+ * (`rulesLoaded`) can tell those apart.
18032
+ */
18033
+ var NcClipRetentionAskSchema = object({
18034
+ /**
18035
+ * The camera this ask is about. **Absent = every camera**, which is what a
18036
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18037
+ * asking everywhere.
18038
+ */
18039
+ deviceId: number().int().nonnegative().optional(),
18040
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18041
+ * needs nothing produces no ask at all. */
18042
+ seconds: number().min(0).max(60),
18043
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18044
+ * assigned, which is what the cut defaults to. */
18045
+ profile: CamProfileSchema.optional(),
18046
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18047
+ ruleId: string(),
18048
+ ruleName: string(),
18049
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18050
+ reason: _enum(["window", "occupancy"])
18051
+ });
18052
+ /**
18053
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18054
+ *
18055
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18056
+ * once. A centre that is up but has not read its rules yet answers with an
18057
+ * empty ask list that means nothing at all — applying it would drop every
18058
+ * camera's ring to zero for the first events after a restart, which is the
18059
+ * footage this mechanism exists to keep.
18060
+ */
18061
+ var NcClipRetentionPlanSchema = object({
18062
+ rulesLoaded: boolean(),
18063
+ asks: array(NcClipRetentionAskSchema).readonly()
18064
+ });
17893
18065
  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 }), {
17894
18066
  kind: "mutation",
17895
18067
  auth: "admin",
@@ -17910,7 +18082,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
17910
18082
  }), object({ success: literal(true) }), {
17911
18083
  kind: "mutation",
17912
18084
  auth: "admin"
17913
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18085
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
17914
18086
  deviceId: number().int(),
17915
18087
  muted: boolean()
17916
18088
  }), object({ success: literal(true) }), {
@@ -20444,6 +20616,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20444
20616
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20445
20617
  framesMatched: number().int()
20446
20618
  })).readonly() });
20619
+ /**
20620
+ * The long-term series a camera produces. A closed union so a typo cannot
20621
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20622
+ * is an alias of this, not a second list.
20623
+ */
20624
+ var AnalyticsLtsSeriesSchema = _enum([
20625
+ "motion",
20626
+ "audio-dbfs",
20627
+ "battery",
20628
+ "occupancy"
20629
+ ]);
20630
+ /**
20631
+ * One closed 5-minute bucket of a long-term series.
20632
+ *
20633
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20634
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20635
+ * that exists at all was measured; a bucket that is absent was not, which is a
20636
+ * different claim from zero and the reason this is a sparse series.
20637
+ */
20638
+ var LtsBucketSchema = object({
20639
+ scope: string(),
20640
+ bucketStart: number().int(),
20641
+ samples: number().int().nonnegative(),
20642
+ sum: number(),
20643
+ min: number(),
20644
+ max: number()
20645
+ });
20447
20646
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20448
20647
  deviceId: number(),
20449
20648
  trackId: string()
@@ -20490,6 +20689,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20490
20689
  kinds: array(string()).optional(),
20491
20690
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20492
20691
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20692
+ deviceId: number(),
20693
+ series: AnalyticsLtsSeriesSchema,
20694
+ /** Omit for EVERY scope of this series in the range. */
20695
+ scope: string().optional(),
20696
+ from: number(),
20697
+ to: number(),
20698
+ limit: number().int().positive().optional()
20699
+ }), array(LtsBucketSchema).readonly()), method(object({
20493
20700
  deviceId: number(),
20494
20701
  since: number(),
20495
20702
  until: number(),
@@ -21108,6 +21315,14 @@ var MotionSourceEnum = _enum([
21108
21315
  */
21109
21316
  var MotionSourcesSchema = array(MotionSourceEnum);
21110
21317
  /**
21318
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21319
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21320
+ * than a second spelling of the same two ideas — the value an operator picks
21321
+ * here is the value that comes back on the track, the overlay and the debug
21322
+ * row.
21323
+ */
21324
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21325
+ /**
21111
21326
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21112
21327
  * so cap-side consumers (the orchestrator forward, the runner addon's
21113
21328
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21258,6 +21473,35 @@ var RunnerCameraConfigSchema = object({
21258
21473
  * events; the orchestrator forwards to `reportMotion`.
21259
21474
  */
21260
21475
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21476
+ /**
21477
+ * WHICH root detector runs for this camera. The detection counterpart of
21478
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21479
+ * of sources the system understands, vendor-agnostic, owned here.
21480
+ *
21481
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21482
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21483
+ * here. Its boxes reach post-analysis on the same
21484
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21485
+ * track gets the same tracker, the same overlay and the same detail
21486
+ * subtree (face / plate / embedding).
21487
+ *
21488
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21489
+ * run, and that is where a camera with a usable onboard detector buys back
21490
+ * its share of the accelerator. It saves the root inference, not the decode
21491
+ * — the detail subtree still needs pixels to cut crops from.
21492
+ *
21493
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21494
+ * step at all (there is nothing to track), and the cap that knows this says
21495
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21496
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21497
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21498
+ * worth exactly what it already is — a wake signal with a class.
21499
+ *
21500
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21501
+ * vendor never turns a detector on for the operator, and neither does a
21502
+ * default.
21503
+ */
21504
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21261
21505
  pipelineEnabled: boolean().default(true),
21262
21506
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21263
21507
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21439,7 +21683,47 @@ var RunnerLocalMetricsSchema = object({
21439
21683
  queueDepth: number(),
21440
21684
  frameLazy: FrameLazyMetricsSchema.optional()
21441
21685
  });
21686
+ /**
21687
+ * Pipeline Runner capability — runtime detection workhorse.
21688
+ *
21689
+ * One instance per node. Receives camera assignments from
21690
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21691
+ * decoded frames, drains motion + detection queues, calls the local
21692
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21693
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21694
+ * the bus.
21695
+ *
21696
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21697
+ * runner has zero knowledge of other agents, no global state, and never
21698
+ * makes assignment decisions itself.
21699
+ */
21700
+ /**
21701
+ * Why a runner declined to look at a camera out of band. Named rather than a
21702
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21703
+ * already mid-session and one already bursting are four different facts, and a
21704
+ * caller told only "no" cannot tell a protection from a bug.
21705
+ */
21706
+ var OccupancyBurstRefusalSchema = _enum([
21707
+ "not-attached",
21708
+ "battery-asleep",
21709
+ "not-watching",
21710
+ "already-bursting"
21711
+ ]);
21442
21712
  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({
21713
+ deviceId: number(),
21714
+ /** How many frames to collect. The caller sizes this against what its
21715
+ * own confirmation needs; the runner clamps it to the field's range. */
21716
+ frames: number().int().positive().optional(),
21717
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21718
+ * defend — the periodic one at least has a timer to point at. */
21719
+ reason: string()
21720
+ }), object({
21721
+ started: boolean(),
21722
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21723
+ }), {
21724
+ auth: "admin",
21725
+ kind: "mutation"
21726
+ }), method(object({
21443
21727
  handle: FrameHandleSchema,
21444
21728
  bbox: NativeCropBboxSchema,
21445
21729
  maxWidth: number().int().positive().optional(),
@@ -23809,10 +24093,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
23809
24093
  }), boolean()), method(object({
23810
24094
  deviceId: number().int().nonnegative(),
23811
24095
  sessionId: string()
23812
- }), object({ pendingRenegotiation: object({
23813
- target: WebrtcStreamTargetSchema,
23814
- epoch: number()
23815
- }).nullable() }));
24096
+ }), object({
24097
+ pendingRenegotiation: object({
24098
+ target: WebrtcStreamTargetSchema,
24099
+ epoch: number()
24100
+ }).nullable(),
24101
+ /**
24102
+ * Whether the session still EXISTS.
24103
+ *
24104
+ * A consumer that holds a resource for the life of a session needs to
24105
+ * be able to ask, because a session does not always end the way it
24106
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24107
+ * sent `SessionDisconnected`, so the Alexa exporter's
24108
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24109
+ * H.264 transcode kept running for NOBODY for more than twenty
24110
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24111
+ * minutes earlier — the broker knew; the holder had no way to ask.
24112
+ *
24113
+ * `false` for a session id the provider has never heard of, which is
24114
+ * the same answer as "it ended": either way nothing is holding it up.
24115
+ */
24116
+ alive: boolean()
24117
+ }));
23816
24118
  object({
23817
24119
  /** All accessory children of the parent. */
23818
24120
  childDeviceIds: array(number()).readonly(),
@@ -26890,7 +27192,7 @@ var NativeDetectionSchema = object({
26890
27192
  /** Firmware-provided confidence [0..1]. Reolink pushes don't carry it → undefined. */
26891
27193
  confidence: number().min(0).max(1).optional()
26892
27194
  });
26893
- object({
27195
+ var NativeObjectDetectionStatusSchema = object({
26894
27196
  /**
26895
27197
  * Last observed instance per class. Missing entries mean the class
26896
27198
  * is supported but nothing has been seen since the provider started.
@@ -26907,14 +27209,56 @@ object({
26907
27209
  supportedClasses: array(NativeObjectClassEnum).readonly(),
26908
27210
  /**
26909
27211
  * Whether forwarding of onboard AI detections is enabled for this device.
26910
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
26911
- * churn the tracker, so forwarding stays off until the operator enables it.
27212
+ *
27213
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
27214
+ * camera runs — that is the operator's choice, and it is made where every
27215
+ * other detection choice is made. `geometry` on
27216
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
27217
+ * choice would buy this particular camera.
26912
27218
  */
26913
27219
  enabled: boolean()
26914
- }).extend({
27220
+ });
27221
+ /**
27222
+ * WHEN a camera's onboard detections carry geometry.
27223
+ *
27224
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
27225
+ * a detection is a trackable subject whenever the camera sees one.
27226
+ * - `while-streaming` — only while some stream of this camera is already open.
27227
+ * The boxes ride the video's own side-channel rather than a feed of their
27228
+ * own, so they cost nothing and they exist only when something is pulling.
27229
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
27230
+ * radio drain, but a camera that is awake is awake precisely because
27231
+ * something is in front of it, and its stream is already being pulled.
27232
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
27233
+ * pipeline needs geometry to make a subject, so such a push reaches the
27234
+ * tracker as motion and no further.
27235
+ *
27236
+ * Reported and not inferred, because the operator's question in front of the
27237
+ * picker is "what do I get", and these are three different answers (D14: the
27238
+ * derived form is only as honest as `getOptions`).
27239
+ */
27240
+ var NativeObjectGeometryEnum = _enum([
27241
+ "boxed",
27242
+ "while-streaming",
27243
+ "flag-only"
27244
+ ]);
27245
+ var NativeObjectDetectionOptionsSchema = object({
27246
+ /** Classes this firmware can detect — the same list the status reports. */
27247
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
27248
+ /** What a detection from this camera carries. */
27249
+ geometry: NativeObjectGeometryEnum
27250
+ });
27251
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
27252
+ NativeObjectDetectionStatusSchema.extend({
26915
27253
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
26916
27254
  lastFetchedAt: number() });
26917
- DeviceType.Camera, method(object({
27255
+ DeviceType.Camera, method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema), method(object({
27256
+ deviceId: number(),
27257
+ settings: NativeObjectDetectionSettingsPatchSchema
27258
+ }), _void(), {
27259
+ kind: "mutation",
27260
+ auth: "admin"
27261
+ }), method(object({
26918
27262
  deviceId: number(),
26919
27263
  enabled: boolean()
26920
27264
  }), _void(), {
@@ -30713,7 +31057,28 @@ var PerScopeBreakdownSchema = object({
30713
31057
  /** Total tracked objects in this scope (frame / zone / unzoned). */
30714
31058
  totalObjects: number().int().nonnegative(),
30715
31059
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
30716
- byClass: record(string(), number().int().nonnegative())
31060
+ byClass: record(string(), number().int().nonnegative()),
31061
+ /**
31062
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
31063
+ * present but not going anywhere (a parked car, a bin, a statue).
31064
+ *
31065
+ * The operator's question about a scene has two halves and they answer
31066
+ * different things: "what is parked here" is stable for hours and must not
31067
+ * flap, while "who is walking through" is the thing an alert is about. One
31068
+ * number could only serve one of them, and `totalObjects` served the first
31069
+ * badly — a passer-by moved it and every occupancy rule saw a change.
31070
+ *
31071
+ * `standing + transient === totalObjects`, always. The total keeps its old
31072
+ * meaning exactly, so no rule written against it changes behaviour.
31073
+ *
31074
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
31075
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
31076
+ * parked objects here" about a camera whose lot is full.
31077
+ */
31078
+ standingObjects: number().int().nonnegative().optional(),
31079
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
31080
+ * same absence rule. */
31081
+ transientObjects: number().int().nonnegative().optional()
30717
31082
  });
30718
31083
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
30719
31084
  zoneId: string(),
@@ -33652,12 +34017,24 @@ Object.freeze({
33652
34017
  addonId: null,
33653
34018
  access: "create"
33654
34019
  },
34020
+ "nativeObjectDetection.getOptions": {
34021
+ capName: "native-object-detection",
34022
+ capScope: "device",
34023
+ addonId: null,
34024
+ access: "view"
34025
+ },
33655
34026
  "nativeObjectDetection.setEnabled": {
33656
34027
  capName: "native-object-detection",
33657
34028
  capScope: "device",
33658
34029
  addonId: null,
33659
34030
  access: "create"
33660
34031
  },
34032
+ "nativeObjectDetection.setSettings": {
34033
+ capName: "native-object-detection",
34034
+ capScope: "device",
34035
+ addonId: null,
34036
+ access: "create"
34037
+ },
33661
34038
  "navigation.getFeatures": {
33662
34039
  capName: "navigation",
33663
34040
  capScope: "device",
@@ -33922,6 +34299,12 @@ Object.freeze({
33922
34299
  addonId: null,
33923
34300
  access: "view"
33924
34301
  },
34302
+ "notificationRules.getClipRetentionAsks": {
34303
+ capName: "notification-rules",
34304
+ capScope: "system",
34305
+ addonId: null,
34306
+ access: "view"
34307
+ },
33925
34308
  "notificationRules.getConditionCatalog": {
33926
34309
  capName: "notification-rules",
33927
34310
  capScope: "system",
@@ -34432,6 +34815,12 @@ Object.freeze({
34432
34815
  addonId: null,
34433
34816
  access: "create"
34434
34817
  },
34818
+ "pipelineAnalytics.readLongTermSeries": {
34819
+ capName: "pipeline-analytics",
34820
+ capScope: "device",
34821
+ addonId: null,
34822
+ access: "view"
34823
+ },
34435
34824
  "pipelineAnalytics.rebuildObjectEmbeddings": {
34436
34825
  capName: "pipeline-analytics",
34437
34826
  capScope: "device",
@@ -35104,6 +35493,12 @@ Object.freeze({
35104
35493
  addonId: null,
35105
35494
  access: "create"
35106
35495
  },
35496
+ "pipelineRunner.requestOccupancyBurst": {
35497
+ capName: "pipeline-runner",
35498
+ capScope: "system",
35499
+ addonId: null,
35500
+ access: "create"
35501
+ },
35107
35502
  "pipelineRunner.runDetailSubtree": {
35108
35503
  capName: "pipeline-runner",
35109
35504
  capScope: "system",
@@ -36316,6 +36711,12 @@ Object.freeze({
36316
36711
  addonId: null,
36317
36712
  access: "create"
36318
36713
  },
36714
+ "streamBroker.reportStreamSignal": {
36715
+ capName: "stream-broker",
36716
+ capScope: "system",
36717
+ addonId: null,
36718
+ access: "create"
36719
+ },
36319
36720
  "streamBroker.restartProfile": {
36320
36721
  capName: "stream-broker",
36321
36722
  capScope: "system",
@@ -36400,6 +36801,12 @@ Object.freeze({
36400
36801
  addonId: null,
36401
36802
  access: "create"
36402
36803
  },
36804
+ "streamSignals.listSignals": {
36805
+ capName: "stream-signals",
36806
+ capScope: "device",
36807
+ addonId: null,
36808
+ access: "view"
36809
+ },
36403
36810
  "switch.setState": {
36404
36811
  capName: "switch",
36405
36812
  capScope: "device",
@@ -37872,11 +38279,21 @@ Object.freeze({
37872
38279
  form: "single",
37873
38280
  optional: false
37874
38281
  }],
38282
+ "nativeObjectDetection.getOptions": [{
38283
+ name: "deviceId",
38284
+ form: "single",
38285
+ optional: false
38286
+ }],
37875
38287
  "nativeObjectDetection.setEnabled": [{
37876
38288
  name: "deviceId",
37877
38289
  form: "single",
37878
38290
  optional: false
37879
38291
  }],
38292
+ "nativeObjectDetection.setSettings": [{
38293
+ name: "deviceId",
38294
+ form: "single",
38295
+ optional: false
38296
+ }],
37880
38297
  "navigation.getFeatures": [{
37881
38298
  name: "deviceId",
37882
38299
  form: "single",
@@ -38226,6 +38643,11 @@ Object.freeze({
38226
38643
  form: "single",
38227
38644
  optional: false
38228
38645
  }],
38646
+ "pipelineAnalytics.readLongTermSeries": [{
38647
+ name: "deviceId",
38648
+ form: "single",
38649
+ optional: false
38650
+ }],
38229
38651
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
38230
38652
  name: "deviceId",
38231
38653
  form: "single",
@@ -38416,6 +38838,11 @@ Object.freeze({
38416
38838
  form: "single",
38417
38839
  optional: false
38418
38840
  }],
38841
+ "pipelineRunner.requestOccupancyBurst": [{
38842
+ name: "deviceId",
38843
+ form: "single",
38844
+ optional: false
38845
+ }],
38419
38846
  "pipelineRunner.runDetailSubtree": [{
38420
38847
  name: "deviceId",
38421
38848
  form: "single",
@@ -38772,6 +39199,11 @@ Object.freeze({
38772
39199
  form: "single",
38773
39200
  optional: false
38774
39201
  }],
39202
+ "streamBroker.reportStreamSignal": [{
39203
+ name: "deviceId",
39204
+ form: "single",
39205
+ optional: false
39206
+ }],
38775
39207
  "streamBroker.restartProfile": [{
38776
39208
  name: "deviceId",
38777
39209
  form: "single",