@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.mjs CHANGED
@@ -2,7 +2,7 @@ import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
2
2
  import { readFileSync } from "node:fs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- //#region ../types/dist/event-category-ZyX6jcse.mjs
5
+ //#region ../types/dist/event-category-BVDXG4tB.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -619,6 +619,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
619
619
  * pull-reconcile from the provider's `getStatus` on reconnect. */
620
620
  EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
621
621
  EventCategory["BackupCompleted"] = "backup.completed";
622
+ /**
623
+ * A whole backup RUN finished — every destination attempted, win or lose.
624
+ *
625
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
626
+ * a progress UI and the wrong one for a notification: an operator with three
627
+ * destinations would be told three times. And a run where two of three
628
+ * destinations succeeded is not a clean success — a single "backup
629
+ * completed" that hid the failed one would be a lie, so the count of each is
630
+ * carried here and the message says both.
631
+ *
632
+ * Emitted by the backup orchestrator only after the destination loop, so a
633
+ * run that dies during the BUILD phase produces no completion at all.
634
+ */
635
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
622
636
  EventCategory["BackupRestored"] = "backup.restored";
623
637
  EventCategory["NotificationDispatched"] = "notification.dispatched";
624
638
  EventCategory["NotificationFailed"] = "notification.failed";
@@ -5349,7 +5363,7 @@ var ZodIssueCode = {
5349
5363
  var ZodFirstPartyTypeKind;
5350
5364
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5351
5365
  //#endregion
5352
- //#region ../types/dist/sleep-DBKu2-U5.mjs
5366
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5353
5367
  /**
5354
5368
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5355
5369
  * window to float samples (D455).
@@ -7230,6 +7244,28 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7230
7244
  DeviceRole["GenericNotifier"] = "generic-notifier";
7231
7245
  return DeviceRole;
7232
7246
  }({});
7247
+ /**
7248
+ * Identity — preserves literal types for downstream inference.
7249
+ *
7250
+ * The constraint is `Record<string, unknown>` (not `CustomActionsSpec`) so
7251
+ * TypeScript does not widen each entry's literal `kind`/`auth` fields to
7252
+ * the broader unions declared on `CustomActionSpec`'s default generics.
7253
+ * Shape validity is enforced separately by the `customAction(...)` helper
7254
+ * whose return type is already a `CustomActionSpec<...>`.
7255
+ */
7256
+ function defineCustomActions(spec) {
7257
+ return spec;
7258
+ }
7259
+ function customAction(input, output, options) {
7260
+ return {
7261
+ input,
7262
+ output,
7263
+ kind: options?.kind ?? "query",
7264
+ auth: options?.auth ?? "protected",
7265
+ scope: options?.scope ?? { kind: "system" },
7266
+ ...options?.caller ? { caller: "required" } : {}
7267
+ };
7268
+ }
7233
7269
  var StaticDirOutputSchema = object({ staticDir: string() });
7234
7270
  var VersionOutputSchema = object({ version: string() });
7235
7271
  method(_void(), StaticDirOutputSchema, { auth: "admin" }), method(_void(), VersionOutputSchema, { auth: "admin" });
@@ -11613,6 +11649,58 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
11613
11649
  auth: "admin"
11614
11650
  }), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
11615
11651
  DeviceType.Camera;
11652
+ /**
11653
+ * The signals a device can emit to WAKE its own stream.
11654
+ *
11655
+ * A camera whose stream is built on demand sleeps until something asks for it,
11656
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
11657
+ * puller holds a session open for ever, and treating that as demand would keep
11658
+ * a battery camera awake for ever, which is the whole thing the battery is for
11659
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
11660
+ * itself, with no stream running.
11661
+ *
11662
+ * ## The vocabulary is the PROVIDER'S, not ours
11663
+ *
11664
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
11665
+ * names each signal with a `code` it chooses and a `label` an operator reads.
11666
+ * Reolink offers motion and camera-native detection; another provider may offer
11667
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11668
+ * yet. A fixed enum here would mean every new signal is a framework release.
11669
+ *
11670
+ * It is deliberately NOT derived from the caps a device already binds. Whether
11671
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
11672
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11673
+ * binding — but both answer "what drives the detection pipeline", which is a
11674
+ * different question from "what may wake a sleeping stream". A camera can do
11675
+ * the first and not be trusted with the second, and the operator picks per
11676
+ * camera. Two questions, two authorities.
11677
+ *
11678
+ * ## Availability is not permission
11679
+ *
11680
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
11681
+ * wakes the stream is the operator's per-camera choice, held by the broker
11682
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
11683
+ * provider declaring a signal is not a provider enabling it.
11684
+ */
11685
+ /** One signal a device can emit. */
11686
+ var StreamSignalSchema = object({
11687
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11688
+ code: string().min(1),
11689
+ /** What an operator reads in the picker. The provider's own wording. */
11690
+ label: string().min(1),
11691
+ /**
11692
+ * Whether the provider recommends this signal ON when a camera is first set
11693
+ * up. A provider knows which of its signals are cheap and reliable; an
11694
+ * operator should not have to discover that by trial. Reolink recommends
11695
+ * both of its own.
11696
+ */
11697
+ recommended: boolean()
11698
+ });
11699
+ object({
11700
+ signals: array(StreamSignalSchema),
11701
+ lastFetchedAt: number()
11702
+ });
11703
+ Object.values(DeviceType), method(_void(), array(StreamSignalSchema).readonly());
11616
11704
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11617
11705
  var StreamFormatSchema = _enum([
11618
11706
  "webrtc",
@@ -12009,6 +12097,22 @@ var EgressTranscodeSchema = object({
12009
12097
  camStreamId: string().nullable()
12010
12098
  });
12011
12099
  method(object({
12100
+ deviceId: number().int().nonnegative(),
12101
+ /** The provider's signal code. */
12102
+ code: string().min(1),
12103
+ /** Ms epoch. Absent ⇒ now. */
12104
+ at: number().optional()
12105
+ }), object({
12106
+ /** Whether the broker acted on it, and if not, why. */
12107
+ accepted: boolean(),
12108
+ reason: _enum([
12109
+ "woke",
12110
+ "hold-extended",
12111
+ "not-enabled",
12112
+ "no-consumer",
12113
+ "unknown-code"
12114
+ ])
12115
+ }), { kind: "mutation" }), method(object({
12012
12116
  deviceId: number().int().nonnegative(),
12013
12117
  camStreamId: string().min(1),
12014
12118
  kind: CamStreamKindSchema,
@@ -12263,6 +12367,16 @@ var PickStreamRequirementsSchema = object({
12263
12367
  acceptCodecs: array(StreamCodecSchema).readonly().optional(),
12264
12368
  /** Minimum vertical resolution. Streams shorter than this are dropped. */
12265
12369
  minHeight: number().int().positive().optional(),
12370
+ /**
12371
+ * Maximum vertical resolution. Streams TALLER than this are dropped.
12372
+ *
12373
+ * A consumer can have a ceiling as real as its floor: Alexa documents
12374
+ * 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
12375
+ * Without this the ceiling had to be re-implemented by every caller — and
12376
+ * one caller implementing it privately is how a second scoring authority
12377
+ * gets born.
12378
+ */
12379
+ maxHeight: number().int().positive().optional(),
12266
12380
  /** Minimum horizontal resolution. */
12267
12381
  minWidth: number().int().positive().optional(),
12268
12382
  /**
@@ -12279,7 +12393,22 @@ var PickStreamRequirementsSchema = object({
12279
12393
  * transcoded" guard: if the device is already serving the consumer's
12280
12394
  * codec end-to-end, there's nothing to optimise.
12281
12395
  */
12282
- requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
12396
+ requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
12397
+ /**
12398
+ * Whether a stream the consumer CANNOT decode may still be picked, on the
12399
+ * understanding that it will be transcoded.
12400
+ *
12401
+ * Default `false` — today's behaviour, and the right one for a bypass
12402
+ * question ("is there a stream I can forward untouched?"). Set `true` to
12403
+ * ask the larger question: "what is the best stream for me, transcoding if
12404
+ * I must?" A stream that satisfies `acceptCodecs` always outranks one that
12405
+ * does not, so a passthrough is never lost to a transcode; the answer says
12406
+ * which it is in {@link PickedCamStreamSchema.transcodes}.
12407
+ *
12408
+ * This is what lets one picker serve both the bypass and the full source
12409
+ * choice, instead of a consumer scoring privately when the bypass misses.
12410
+ */
12411
+ allowTranscode: boolean().optional()
12283
12412
  }).readonly();
12284
12413
  var PickStreamPreferencesSchema = object({
12285
12414
  /**
@@ -12293,12 +12422,32 @@ var PickStreamPreferencesSchema = object({
12293
12422
  * picks the tallest stream; `'lowest'` picks the shortest (used by
12294
12423
  * memory-constrained consumers / Apple Home guest sessions).
12295
12424
  */
12296
- resolutionPreference: _enum(["highest", "lowest"]).optional()
12425
+ resolutionPreference: _enum(["highest", "lowest"]).optional(),
12426
+ /**
12427
+ * The height the consumer actually wants to DELIVER.
12428
+ *
12429
+ * Not a constraint — an ordering. With it set, the SMALLEST stream at or
12430
+ * above the target wins, and only if nothing reaches it does the tallest
12431
+ * take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
12432
+ * a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
12433
+ * express that: it says "as big as possible", which is a different wish.
12434
+ *
12435
+ * Ignored when absent, so every existing caller keeps its ordering.
12436
+ */
12437
+ targetHeight: number().int().positive().optional()
12297
12438
  }).readonly();
12298
12439
  var PickedCamStreamSchema = object({
12299
12440
  camStreamId: string(),
12300
12441
  codec: string().optional(),
12301
12442
  resolution: CamStreamResolutionSchema.optional(),
12443
+ /**
12444
+ * Whether serving this stream requires a decode + re-encode.
12445
+ *
12446
+ * `false` is a stream the consumer can take as it stands. Only ever `true`
12447
+ * when the caller asked for it with `allowTranscode`, so a caller that did
12448
+ * not ask cannot be handed a cost it never agreed to pay.
12449
+ */
12450
+ transcodes: boolean(),
12302
12451
  /** One-line explanation of why this stream won — for logs / debug UI. */
12303
12452
  reason: string()
12304
12453
  });
@@ -12416,28 +12565,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
12416
12565
  content: string()
12417
12566
  })) }), { auth: "admin" });
12418
12567
  /**
12419
- * Identity — preserves literal types for downstream inference.
12420
- *
12421
- * The constraint is `Record<string, unknown>` (not `CustomActionsSpec`) so
12422
- * TypeScript does not widen each entry's literal `kind`/`auth` fields to
12423
- * the broader unions declared on `CustomActionSpec`'s default generics.
12424
- * Shape validity is enforced separately by the `customAction(...)` helper
12425
- * whose return type is already a `CustomActionSpec<...>`.
12426
- */
12427
- function defineCustomActions(spec) {
12428
- return spec;
12429
- }
12430
- function customAction(input, output, options) {
12431
- return {
12432
- input,
12433
- output,
12434
- kind: options?.kind ?? "query",
12435
- auth: options?.auth ?? "protected",
12436
- scope: options?.scope ?? { kind: "system" },
12437
- ...options?.caller ? { caller: "required" } : {}
12438
- };
12439
- }
12440
- /**
12441
12568
  * `custom-model-registry` — collection cap exposing operator-registered
12442
12569
  * custom detection models. Each provider (today: `addon-model-studio`)
12443
12570
  * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
@@ -16523,6 +16650,8 @@ var NcSystemEventKindSchema = _enum([
16523
16650
  "device-enabled",
16524
16651
  "device-battery-low",
16525
16652
  "device-battery-normal",
16653
+ "device-consumable-low",
16654
+ "device-consumable-normal",
16526
16655
  "stream-online",
16527
16656
  "stream-offline",
16528
16657
  "node-online",
@@ -16541,6 +16670,7 @@ var NcSystemEventKindSchema = _enum([
16541
16670
  "addon-updated",
16542
16671
  "server-updated",
16543
16672
  "export-completed",
16673
+ "backup-completed",
16544
16674
  "camera-online",
16545
16675
  "camera-offline",
16546
16676
  "camera-disabled",
@@ -17863,6 +17993,48 @@ var NcAlarmConfigSchema = object({
17863
17993
  settings: NcAlarmSettingsSchema,
17864
17994
  coverage: array(NcAlarmModeCoverageSchema)
17865
17995
  });
17996
+ /**
17997
+ * ONE rule's demand on ONE camera's clip ring.
17998
+ *
17999
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18000
+ * camera, so the answer stays a faithful description of the rules and the
18001
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18002
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18003
+ * a different thing from never having been told, and only the envelope
18004
+ * (`rulesLoaded`) can tell those apart.
18005
+ */
18006
+ var NcClipRetentionAskSchema = object({
18007
+ /**
18008
+ * The camera this ask is about. **Absent = every camera**, which is what a
18009
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18010
+ * asking everywhere.
18011
+ */
18012
+ deviceId: number().int().nonnegative().optional(),
18013
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18014
+ * needs nothing produces no ask at all. */
18015
+ seconds: number().min(0).max(60),
18016
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18017
+ * assigned, which is what the cut defaults to. */
18018
+ profile: CamProfileSchema.optional(),
18019
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18020
+ ruleId: string(),
18021
+ ruleName: string(),
18022
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18023
+ reason: _enum(["window", "occupancy"])
18024
+ });
18025
+ /**
18026
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18027
+ *
18028
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18029
+ * once. A centre that is up but has not read its rules yet answers with an
18030
+ * empty ask list that means nothing at all — applying it would drop every
18031
+ * camera's ring to zero for the first events after a restart, which is the
18032
+ * footage this mechanism exists to keep.
18033
+ */
18034
+ var NcClipRetentionPlanSchema = object({
18035
+ rulesLoaded: boolean(),
18036
+ asks: array(NcClipRetentionAskSchema).readonly()
18037
+ });
17866
18038
  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 }), {
17867
18039
  kind: "mutation",
17868
18040
  auth: "admin",
@@ -17883,7 +18055,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
17883
18055
  }), object({ success: literal(true) }), {
17884
18056
  kind: "mutation",
17885
18057
  auth: "admin"
17886
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18058
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
17887
18059
  deviceId: number().int(),
17888
18060
  muted: boolean()
17889
18061
  }), object({ success: literal(true) }), {
@@ -20417,6 +20589,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20417
20589
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20418
20590
  framesMatched: number().int()
20419
20591
  })).readonly() });
20592
+ /**
20593
+ * The long-term series a camera produces. A closed union so a typo cannot
20594
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20595
+ * is an alias of this, not a second list.
20596
+ */
20597
+ var AnalyticsLtsSeriesSchema = _enum([
20598
+ "motion",
20599
+ "audio-dbfs",
20600
+ "battery",
20601
+ "occupancy"
20602
+ ]);
20603
+ /**
20604
+ * One closed 5-minute bucket of a long-term series.
20605
+ *
20606
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20607
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20608
+ * that exists at all was measured; a bucket that is absent was not, which is a
20609
+ * different claim from zero and the reason this is a sparse series.
20610
+ */
20611
+ var LtsBucketSchema = object({
20612
+ scope: string(),
20613
+ bucketStart: number().int(),
20614
+ samples: number().int().nonnegative(),
20615
+ sum: number(),
20616
+ min: number(),
20617
+ max: number()
20618
+ });
20420
20619
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20421
20620
  deviceId: number(),
20422
20621
  trackId: string()
@@ -20463,6 +20662,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20463
20662
  kinds: array(string()).optional(),
20464
20663
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20465
20664
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20665
+ deviceId: number(),
20666
+ series: AnalyticsLtsSeriesSchema,
20667
+ /** Omit for EVERY scope of this series in the range. */
20668
+ scope: string().optional(),
20669
+ from: number(),
20670
+ to: number(),
20671
+ limit: number().int().positive().optional()
20672
+ }), array(LtsBucketSchema).readonly()), method(object({
20466
20673
  deviceId: number(),
20467
20674
  since: number(),
20468
20675
  until: number(),
@@ -21081,6 +21288,14 @@ var MotionSourceEnum = _enum([
21081
21288
  */
21082
21289
  var MotionSourcesSchema = array(MotionSourceEnum);
21083
21290
  /**
21291
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21292
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21293
+ * than a second spelling of the same two ideas — the value an operator picks
21294
+ * here is the value that comes back on the track, the overlay and the debug
21295
+ * row.
21296
+ */
21297
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21298
+ /**
21084
21299
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21085
21300
  * so cap-side consumers (the orchestrator forward, the runner addon's
21086
21301
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21231,6 +21446,35 @@ var RunnerCameraConfigSchema = object({
21231
21446
  * events; the orchestrator forwards to `reportMotion`.
21232
21447
  */
21233
21448
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21449
+ /**
21450
+ * WHICH root detector runs for this camera. The detection counterpart of
21451
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21452
+ * of sources the system understands, vendor-agnostic, owned here.
21453
+ *
21454
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21455
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21456
+ * here. Its boxes reach post-analysis on the same
21457
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21458
+ * track gets the same tracker, the same overlay and the same detail
21459
+ * subtree (face / plate / embedding).
21460
+ *
21461
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21462
+ * run, and that is where a camera with a usable onboard detector buys back
21463
+ * its share of the accelerator. It saves the root inference, not the decode
21464
+ * — the detail subtree still needs pixels to cut crops from.
21465
+ *
21466
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21467
+ * step at all (there is nothing to track), and the cap that knows this says
21468
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21469
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21470
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21471
+ * worth exactly what it already is — a wake signal with a class.
21472
+ *
21473
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21474
+ * vendor never turns a detector on for the operator, and neither does a
21475
+ * default.
21476
+ */
21477
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21234
21478
  pipelineEnabled: boolean().default(true),
21235
21479
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21236
21480
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21412,7 +21656,47 @@ var RunnerLocalMetricsSchema = object({
21412
21656
  queueDepth: number(),
21413
21657
  frameLazy: FrameLazyMetricsSchema.optional()
21414
21658
  });
21659
+ /**
21660
+ * Pipeline Runner capability — runtime detection workhorse.
21661
+ *
21662
+ * One instance per node. Receives camera assignments from
21663
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21664
+ * decoded frames, drains motion + detection queues, calls the local
21665
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21666
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21667
+ * the bus.
21668
+ *
21669
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21670
+ * runner has zero knowledge of other agents, no global state, and never
21671
+ * makes assignment decisions itself.
21672
+ */
21673
+ /**
21674
+ * Why a runner declined to look at a camera out of band. Named rather than a
21675
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21676
+ * already mid-session and one already bursting are four different facts, and a
21677
+ * caller told only "no" cannot tell a protection from a bug.
21678
+ */
21679
+ var OccupancyBurstRefusalSchema = _enum([
21680
+ "not-attached",
21681
+ "battery-asleep",
21682
+ "not-watching",
21683
+ "already-bursting"
21684
+ ]);
21415
21685
  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({
21686
+ deviceId: number(),
21687
+ /** How many frames to collect. The caller sizes this against what its
21688
+ * own confirmation needs; the runner clamps it to the field's range. */
21689
+ frames: number().int().positive().optional(),
21690
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21691
+ * defend — the periodic one at least has a timer to point at. */
21692
+ reason: string()
21693
+ }), object({
21694
+ started: boolean(),
21695
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21696
+ }), {
21697
+ auth: "admin",
21698
+ kind: "mutation"
21699
+ }), method(object({
21416
21700
  handle: FrameHandleSchema,
21417
21701
  bbox: NativeCropBboxSchema,
21418
21702
  maxWidth: number().int().positive().optional(),
@@ -23782,10 +24066,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
23782
24066
  }), boolean()), method(object({
23783
24067
  deviceId: number().int().nonnegative(),
23784
24068
  sessionId: string()
23785
- }), object({ pendingRenegotiation: object({
23786
- target: WebrtcStreamTargetSchema,
23787
- epoch: number()
23788
- }).nullable() }));
24069
+ }), object({
24070
+ pendingRenegotiation: object({
24071
+ target: WebrtcStreamTargetSchema,
24072
+ epoch: number()
24073
+ }).nullable(),
24074
+ /**
24075
+ * Whether the session still EXISTS.
24076
+ *
24077
+ * A consumer that holds a resource for the life of a session needs to
24078
+ * be able to ask, because a session does not always end the way it
24079
+ * began. Measured on this hub 2026-09-13: an Echo that got stuck never
24080
+ * sent `SessionDisconnected`, so the Alexa exporter's
24081
+ * `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
24082
+ * H.264 transcode kept running for NOBODY for more than twenty
24083
+ * minutes. The WebRTC session had logged `WebRTC session closed`
24084
+ * minutes earlier — the broker knew; the holder had no way to ask.
24085
+ *
24086
+ * `false` for a session id the provider has never heard of, which is
24087
+ * the same answer as "it ended": either way nothing is holding it up.
24088
+ */
24089
+ alive: boolean()
24090
+ }));
23789
24091
  object({
23790
24092
  /** All accessory children of the parent. */
23791
24093
  childDeviceIds: array(number()).readonly(),
@@ -26863,7 +27165,7 @@ var NativeDetectionSchema = object({
26863
27165
  /** Firmware-provided confidence [0..1]. Reolink pushes don't carry it → undefined. */
26864
27166
  confidence: number().min(0).max(1).optional()
26865
27167
  });
26866
- object({
27168
+ var NativeObjectDetectionStatusSchema = object({
26867
27169
  /**
26868
27170
  * Last observed instance per class. Missing entries mean the class
26869
27171
  * is supported but nothing has been seen since the provider started.
@@ -26880,14 +27182,56 @@ object({
26880
27182
  supportedClasses: array(NativeObjectClassEnum).readonly(),
26881
27183
  /**
26882
27184
  * Whether forwarding of onboard AI detections is enabled for this device.
26883
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
26884
- * churn the tracker, so forwarding stays off until the operator enables it.
27185
+ *
27186
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
27187
+ * camera runs — that is the operator's choice, and it is made where every
27188
+ * other detection choice is made. `geometry` on
27189
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
27190
+ * choice would buy this particular camera.
26885
27191
  */
26886
27192
  enabled: boolean()
26887
- }).extend({
27193
+ });
27194
+ /**
27195
+ * WHEN a camera's onboard detections carry geometry.
27196
+ *
27197
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
27198
+ * a detection is a trackable subject whenever the camera sees one.
27199
+ * - `while-streaming` — only while some stream of this camera is already open.
27200
+ * The boxes ride the video's own side-channel rather than a feed of their
27201
+ * own, so they cost nothing and they exist only when something is pulling.
27202
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
27203
+ * radio drain, but a camera that is awake is awake precisely because
27204
+ * something is in front of it, and its stream is already being pulled.
27205
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
27206
+ * pipeline needs geometry to make a subject, so such a push reaches the
27207
+ * tracker as motion and no further.
27208
+ *
27209
+ * Reported and not inferred, because the operator's question in front of the
27210
+ * picker is "what do I get", and these are three different answers (D14: the
27211
+ * derived form is only as honest as `getOptions`).
27212
+ */
27213
+ var NativeObjectGeometryEnum = _enum([
27214
+ "boxed",
27215
+ "while-streaming",
27216
+ "flag-only"
27217
+ ]);
27218
+ var NativeObjectDetectionOptionsSchema = object({
27219
+ /** Classes this firmware can detect — the same list the status reports. */
27220
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
27221
+ /** What a detection from this camera carries. */
27222
+ geometry: NativeObjectGeometryEnum
27223
+ });
27224
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
27225
+ NativeObjectDetectionStatusSchema.extend({
26888
27226
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
26889
27227
  lastFetchedAt: number() });
26890
- DeviceType.Camera, method(object({
27228
+ DeviceType.Camera, method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema), method(object({
27229
+ deviceId: number(),
27230
+ settings: NativeObjectDetectionSettingsPatchSchema
27231
+ }), _void(), {
27232
+ kind: "mutation",
27233
+ auth: "admin"
27234
+ }), method(object({
26891
27235
  deviceId: number(),
26892
27236
  enabled: boolean()
26893
27237
  }), _void(), {
@@ -30686,7 +31030,28 @@ var PerScopeBreakdownSchema = object({
30686
31030
  /** Total tracked objects in this scope (frame / zone / unzoned). */
30687
31031
  totalObjects: number().int().nonnegative(),
30688
31032
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
30689
- byClass: record(string(), number().int().nonnegative())
31033
+ byClass: record(string(), number().int().nonnegative()),
31034
+ /**
31035
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
31036
+ * present but not going anywhere (a parked car, a bin, a statue).
31037
+ *
31038
+ * The operator's question about a scene has two halves and they answer
31039
+ * different things: "what is parked here" is stable for hours and must not
31040
+ * flap, while "who is walking through" is the thing an alert is about. One
31041
+ * number could only serve one of them, and `totalObjects` served the first
31042
+ * badly — a passer-by moved it and every occupancy rule saw a change.
31043
+ *
31044
+ * `standing + transient === totalObjects`, always. The total keeps its old
31045
+ * meaning exactly, so no rule written against it changes behaviour.
31046
+ *
31047
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
31048
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
31049
+ * parked objects here" about a camera whose lot is full.
31050
+ */
31051
+ standingObjects: number().int().nonnegative().optional(),
31052
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
31053
+ * same absence rule. */
31054
+ transientObjects: number().int().nonnegative().optional()
30690
31055
  });
30691
31056
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
30692
31057
  zoneId: string(),
@@ -33625,12 +33990,24 @@ Object.freeze({
33625
33990
  addonId: null,
33626
33991
  access: "create"
33627
33992
  },
33993
+ "nativeObjectDetection.getOptions": {
33994
+ capName: "native-object-detection",
33995
+ capScope: "device",
33996
+ addonId: null,
33997
+ access: "view"
33998
+ },
33628
33999
  "nativeObjectDetection.setEnabled": {
33629
34000
  capName: "native-object-detection",
33630
34001
  capScope: "device",
33631
34002
  addonId: null,
33632
34003
  access: "create"
33633
34004
  },
34005
+ "nativeObjectDetection.setSettings": {
34006
+ capName: "native-object-detection",
34007
+ capScope: "device",
34008
+ addonId: null,
34009
+ access: "create"
34010
+ },
33634
34011
  "navigation.getFeatures": {
33635
34012
  capName: "navigation",
33636
34013
  capScope: "device",
@@ -33895,6 +34272,12 @@ Object.freeze({
33895
34272
  addonId: null,
33896
34273
  access: "view"
33897
34274
  },
34275
+ "notificationRules.getClipRetentionAsks": {
34276
+ capName: "notification-rules",
34277
+ capScope: "system",
34278
+ addonId: null,
34279
+ access: "view"
34280
+ },
33898
34281
  "notificationRules.getConditionCatalog": {
33899
34282
  capName: "notification-rules",
33900
34283
  capScope: "system",
@@ -34405,6 +34788,12 @@ Object.freeze({
34405
34788
  addonId: null,
34406
34789
  access: "create"
34407
34790
  },
34791
+ "pipelineAnalytics.readLongTermSeries": {
34792
+ capName: "pipeline-analytics",
34793
+ capScope: "device",
34794
+ addonId: null,
34795
+ access: "view"
34796
+ },
34408
34797
  "pipelineAnalytics.rebuildObjectEmbeddings": {
34409
34798
  capName: "pipeline-analytics",
34410
34799
  capScope: "device",
@@ -35077,6 +35466,12 @@ Object.freeze({
35077
35466
  addonId: null,
35078
35467
  access: "create"
35079
35468
  },
35469
+ "pipelineRunner.requestOccupancyBurst": {
35470
+ capName: "pipeline-runner",
35471
+ capScope: "system",
35472
+ addonId: null,
35473
+ access: "create"
35474
+ },
35080
35475
  "pipelineRunner.runDetailSubtree": {
35081
35476
  capName: "pipeline-runner",
35082
35477
  capScope: "system",
@@ -36289,6 +36684,12 @@ Object.freeze({
36289
36684
  addonId: null,
36290
36685
  access: "create"
36291
36686
  },
36687
+ "streamBroker.reportStreamSignal": {
36688
+ capName: "stream-broker",
36689
+ capScope: "system",
36690
+ addonId: null,
36691
+ access: "create"
36692
+ },
36292
36693
  "streamBroker.restartProfile": {
36293
36694
  capName: "stream-broker",
36294
36695
  capScope: "system",
@@ -36373,6 +36774,12 @@ Object.freeze({
36373
36774
  addonId: null,
36374
36775
  access: "create"
36375
36776
  },
36777
+ "streamSignals.listSignals": {
36778
+ capName: "stream-signals",
36779
+ capScope: "device",
36780
+ addonId: null,
36781
+ access: "view"
36782
+ },
36376
36783
  "switch.setState": {
36377
36784
  capName: "switch",
36378
36785
  capScope: "device",
@@ -37845,11 +38252,21 @@ Object.freeze({
37845
38252
  form: "single",
37846
38253
  optional: false
37847
38254
  }],
38255
+ "nativeObjectDetection.getOptions": [{
38256
+ name: "deviceId",
38257
+ form: "single",
38258
+ optional: false
38259
+ }],
37848
38260
  "nativeObjectDetection.setEnabled": [{
37849
38261
  name: "deviceId",
37850
38262
  form: "single",
37851
38263
  optional: false
37852
38264
  }],
38265
+ "nativeObjectDetection.setSettings": [{
38266
+ name: "deviceId",
38267
+ form: "single",
38268
+ optional: false
38269
+ }],
37853
38270
  "navigation.getFeatures": [{
37854
38271
  name: "deviceId",
37855
38272
  form: "single",
@@ -38199,6 +38616,11 @@ Object.freeze({
38199
38616
  form: "single",
38200
38617
  optional: false
38201
38618
  }],
38619
+ "pipelineAnalytics.readLongTermSeries": [{
38620
+ name: "deviceId",
38621
+ form: "single",
38622
+ optional: false
38623
+ }],
38202
38624
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
38203
38625
  name: "deviceId",
38204
38626
  form: "single",
@@ -38389,6 +38811,11 @@ Object.freeze({
38389
38811
  form: "single",
38390
38812
  optional: false
38391
38813
  }],
38814
+ "pipelineRunner.requestOccupancyBurst": [{
38815
+ name: "deviceId",
38816
+ form: "single",
38817
+ optional: false
38818
+ }],
38392
38819
  "pipelineRunner.runDetailSubtree": [{
38393
38820
  name: "deviceId",
38394
38821
  form: "single",
@@ -38745,6 +39172,11 @@ Object.freeze({
38745
39172
  form: "single",
38746
39173
  optional: false
38747
39174
  }],
39175
+ "streamBroker.reportStreamSignal": [{
39176
+ name: "deviceId",
39177
+ form: "single",
39178
+ optional: false
39179
+ }],
38748
39180
  "streamBroker.restartProfile": [{
38749
39181
  name: "deviceId",
38750
39182
  form: "single",