@camstack/addon-terminal 0.1.107 → 0.1.109

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 +355 -14
  2. package/dist/addon.mjs +355 -14
  3. package/package.json +2 -2
package/dist/addon.js CHANGED
@@ -5392,7 +5392,7 @@ var ZodIssueCode = {
5392
5392
  var ZodFirstPartyTypeKind;
5393
5393
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5394
5394
  //#endregion
5395
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5395
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5396
5396
  /**
5397
5397
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5398
5398
  * window to float samples (D455).
@@ -11661,6 +11661,21 @@ var streamSignalsCapability = {
11661
11661
  mode: "singleton",
11662
11662
  deviceTypes: Object.values(DeviceType),
11663
11663
  runtimeState: StreamSignalsStatusSchema,
11664
+ /**
11665
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11666
+ *
11667
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11668
+ * not an operator choice: the provider re-declares it on every registration,
11669
+ * so losing it loses nothing and persisting it would freeze an answer the
11670
+ * camera is entitled to change. Measured the same day on the sibling case —
11671
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11672
+ * class the camera really detected stayed missing for the life of the row
11673
+ * because the fix could not reach it.
11674
+ *
11675
+ * See `RuntimeStateDurability`. Enforced by
11676
+ * `scripts/check-runtime-state-durability.ts`.
11677
+ */
11678
+ durability: "session",
11664
11679
  methods: {
11665
11680
  /**
11666
11681
  * What this device can emit. Empty is a valid and common answer — most
@@ -18194,6 +18209,48 @@ var NcAlarmConfigSchema = object({
18194
18209
  settings: NcAlarmSettingsSchema,
18195
18210
  coverage: array(NcAlarmModeCoverageSchema)
18196
18211
  });
18212
+ /**
18213
+ * ONE rule's demand on ONE camera's clip ring.
18214
+ *
18215
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18216
+ * camera, so the answer stays a faithful description of the rules and the
18217
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18218
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18219
+ * a different thing from never having been told, and only the envelope
18220
+ * (`rulesLoaded`) can tell those apart.
18221
+ */
18222
+ var NcClipRetentionAskSchema = object({
18223
+ /**
18224
+ * The camera this ask is about. **Absent = every camera**, which is what a
18225
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18226
+ * asking everywhere.
18227
+ */
18228
+ deviceId: number().int().nonnegative().optional(),
18229
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18230
+ * needs nothing produces no ask at all. */
18231
+ seconds: number().min(0).max(60),
18232
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18233
+ * assigned, which is what the cut defaults to. */
18234
+ profile: CamProfileSchema.optional(),
18235
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18236
+ ruleId: string(),
18237
+ ruleName: string(),
18238
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18239
+ reason: _enum(["window", "occupancy"])
18240
+ });
18241
+ /**
18242
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18243
+ *
18244
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18245
+ * once. A centre that is up but has not read its rules yet answers with an
18246
+ * empty ask list that means nothing at all — applying it would drop every
18247
+ * camera's ring to zero for the first events after a restart, which is the
18248
+ * footage this mechanism exists to keep.
18249
+ */
18250
+ var NcClipRetentionPlanSchema = object({
18251
+ rulesLoaded: boolean(),
18252
+ asks: array(NcClipRetentionAskSchema).readonly()
18253
+ });
18197
18254
  method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
18198
18255
  kind: "mutation",
18199
18256
  auth: "admin",
@@ -18214,7 +18271,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18214
18271
  }), object({ success: literal(true) }), {
18215
18272
  kind: "mutation",
18216
18273
  auth: "admin"
18217
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18274
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18218
18275
  deviceId: number().int(),
18219
18276
  muted: boolean()
18220
18277
  }), object({ success: literal(true) }), {
@@ -19399,13 +19456,26 @@ var TrackAudioLabelSchema = object({
19399
19456
  * - `audio` — an audio event on the camera itself that was anomalous for
19400
19457
  * THAT camera, loud, and heard while nothing visual was happening (D62).
19401
19458
  *
19459
+ * - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
19460
+ * that frame's pixel space. A real root detector and a SPATIAL one: its
19461
+ * boxes are the same kind of fact `pipeline`'s are, produced by a different
19462
+ * detector.
19463
+ *
19464
+ * `onboard` was missing here while `DetectionSourceSchema` already had it, so
19465
+ * a persisted onboard track failed `safeParse` on read and came back with NO
19466
+ * source at all — which `isSpatialTrack` then admitted by accident, through the
19467
+ * `undefined` arm rather than by anybody's decision, and which `excludeSources`
19468
+ * could not name.
19469
+ *
19402
19470
  * The spatial subsystems (tracker association, occupancy count, re-id /
19403
19471
  * embedding, resurrection) MUST skip every synthetic source. Test for that
19404
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
19405
- * check silently readmits every source added after it was written.
19472
+ * with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
19473
+ * `!== 'sensor'` check silently readmits every source added after it was
19474
+ * written.
19406
19475
  */
19407
19476
  var TrackSourceSchema = _enum([
19408
19477
  "pipeline",
19478
+ "onboard",
19409
19479
  "sensor",
19410
19480
  "audio"
19411
19481
  ]);
@@ -20788,6 +20858,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20788
20858
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20789
20859
  framesMatched: number().int()
20790
20860
  })).readonly() });
20861
+ /**
20862
+ * The long-term series a camera produces. A closed union so a typo cannot
20863
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20864
+ * is an alias of this, not a second list.
20865
+ */
20866
+ var AnalyticsLtsSeriesSchema = _enum([
20867
+ "motion",
20868
+ "audio-dbfs",
20869
+ "battery",
20870
+ "occupancy"
20871
+ ]);
20872
+ /**
20873
+ * One closed 5-minute bucket of a long-term series.
20874
+ *
20875
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20876
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20877
+ * that exists at all was measured; a bucket that is absent was not, which is a
20878
+ * different claim from zero and the reason this is a sparse series.
20879
+ */
20880
+ var LtsBucketSchema = object({
20881
+ scope: string(),
20882
+ bucketStart: number().int(),
20883
+ samples: number().int().nonnegative(),
20884
+ sum: number(),
20885
+ min: number(),
20886
+ max: number()
20887
+ });
20791
20888
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20792
20889
  deviceId: number(),
20793
20890
  trackId: string()
@@ -20834,6 +20931,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20834
20931
  kinds: array(string()).optional(),
20835
20932
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20836
20933
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20934
+ deviceId: number(),
20935
+ series: AnalyticsLtsSeriesSchema,
20936
+ /** Omit for EVERY scope of this series in the range. */
20937
+ scope: string().optional(),
20938
+ from: number(),
20939
+ to: number(),
20940
+ limit: number().int().positive().optional()
20941
+ }), array(LtsBucketSchema).readonly()), method(object({
20837
20942
  deviceId: number(),
20838
20943
  since: number(),
20839
20944
  until: number(),
@@ -21452,6 +21557,40 @@ var MotionSourceEnum = _enum([
21452
21557
  */
21453
21558
  var MotionSourcesSchema = array(MotionSourceEnum);
21454
21559
  /**
21560
+ * Which root detector a camera runs — EXACTLY ONE.
21561
+ *
21562
+ * Deliberately the SAME vocabulary post-analysis already tags every detection
21563
+ * with (`DetectionSource`) rather than a second spelling of the same two
21564
+ * ideas: the value an operator picks here is the value that comes back on the
21565
+ * track, the overlay and the debug row.
21566
+ *
21567
+ * ## Why one, and why it is still an array
21568
+ *
21569
+ * Two roots on one camera is a capability nobody asked for and the operator has
21570
+ * since ruled out. It was never free: both planes feed the SAME per-device
21571
+ * stationary registry, both can promote the same parked object, and the two
21572
+ * detectors disagree about the same box by construction — which is the
21573
+ * disagreement D505 had to arbitrate. Removing the case removes the arbitration.
21574
+ *
21575
+ * The ARRAY shape survives because the stored settings and the attach payload
21576
+ * already speak it on every camera of every fleet, and a cap input that
21577
+ * suddenly refuses a stored value makes the camera un-attachable — a fail-closed
21578
+ * in the one direction that costs an operator their cameras. So the wire stays
21579
+ * tolerant and the TYPE is exact: a longer list is truncated to its first
21580
+ * element rather than refused, and `max(1)` is what every consumer can then
21581
+ * rely on.
21582
+ *
21583
+ * AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
21584
+ * a camera an operator left with no root detector — and `planDetectionSources`
21585
+ * has always said so: inventing a root for them is how a default acts without
21586
+ * anybody choosing it. Tightening this to `length(1)` broke that, and the
21587
+ * suite caught it.
21588
+ *
21589
+ * Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
21590
+ * `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
21591
+ */
21592
+ var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
21593
+ /**
21455
21594
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21456
21595
  * so cap-side consumers (the orchestrator forward, the runner addon's
21457
21596
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21602,6 +21741,35 @@ var RunnerCameraConfigSchema = object({
21602
21741
  * events; the orchestrator forwards to `reportMotion`.
21603
21742
  */
21604
21743
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21744
+ /**
21745
+ * WHICH root detector runs for this camera. The detection counterpart of
21746
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21747
+ * of sources the system understands, vendor-agnostic, owned here.
21748
+ *
21749
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21750
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21751
+ * here. Its boxes reach post-analysis on the same
21752
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21753
+ * track gets the same tracker, the same overlay and the same detail
21754
+ * subtree (face / plate / embedding).
21755
+ *
21756
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21757
+ * run, and that is where a camera with a usable onboard detector buys back
21758
+ * its share of the accelerator. It saves the root inference, not the decode
21759
+ * — the detail subtree still needs pixels to cut crops from.
21760
+ *
21761
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21762
+ * step at all (there is nothing to track), and the cap that knows this says
21763
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21764
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21765
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21766
+ * worth exactly what it already is — a wake signal with a class.
21767
+ *
21768
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21769
+ * vendor never turns a detector on for the operator, and neither does a
21770
+ * default.
21771
+ */
21772
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21605
21773
  pipelineEnabled: boolean().default(true),
21606
21774
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21607
21775
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21783,7 +21951,47 @@ var RunnerLocalMetricsSchema = object({
21783
21951
  queueDepth: number(),
21784
21952
  frameLazy: FrameLazyMetricsSchema.optional()
21785
21953
  });
21954
+ /**
21955
+ * Pipeline Runner capability — runtime detection workhorse.
21956
+ *
21957
+ * One instance per node. Receives camera assignments from
21958
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21959
+ * decoded frames, drains motion + detection queues, calls the local
21960
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21961
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21962
+ * the bus.
21963
+ *
21964
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21965
+ * runner has zero knowledge of other agents, no global state, and never
21966
+ * makes assignment decisions itself.
21967
+ */
21968
+ /**
21969
+ * Why a runner declined to look at a camera out of band. Named rather than a
21970
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21971
+ * already mid-session and one already bursting are four different facts, and a
21972
+ * caller told only "no" cannot tell a protection from a bug.
21973
+ */
21974
+ var OccupancyBurstRefusalSchema = _enum([
21975
+ "not-attached",
21976
+ "battery-asleep",
21977
+ "not-watching",
21978
+ "already-bursting"
21979
+ ]);
21786
21980
  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({
21981
+ deviceId: number(),
21982
+ /** How many frames to collect. The caller sizes this against what its
21983
+ * own confirmation needs; the runner clamps it to the field's range. */
21984
+ frames: number().int().positive().optional(),
21985
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21986
+ * defend — the periodic one at least has a timer to point at. */
21987
+ reason: string()
21988
+ }), object({
21989
+ started: boolean(),
21990
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21991
+ }), {
21992
+ auth: "admin",
21993
+ kind: "mutation"
21994
+ }), method(object({
21787
21995
  handle: FrameHandleSchema,
21788
21996
  bbox: NativeCropBboxSchema,
21789
21997
  maxWidth: number().int().positive().optional(),
@@ -28761,11 +28969,46 @@ var NativeObjectDetectionStatusSchema = object({
28761
28969
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28762
28970
  /**
28763
28971
  * Whether forwarding of onboard AI detections is enabled for this device.
28764
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28765
- * churn the tracker, so forwarding stays off until the operator enables it.
28972
+ *
28973
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28974
+ * camera runs — that is the operator's choice, and it is made where every
28975
+ * other detection choice is made. `geometry` on
28976
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28977
+ * choice would buy this particular camera.
28766
28978
  */
28767
28979
  enabled: boolean()
28768
28980
  });
28981
+ /**
28982
+ * WHEN a camera's onboard detections carry geometry.
28983
+ *
28984
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28985
+ * a detection is a trackable subject whenever the camera sees one.
28986
+ * - `while-streaming` — only while some stream of this camera is already open.
28987
+ * The boxes ride the video's own side-channel rather than a feed of their
28988
+ * own, so they cost nothing and they exist only when something is pulling.
28989
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28990
+ * radio drain, but a camera that is awake is awake precisely because
28991
+ * something is in front of it, and its stream is already being pulled.
28992
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28993
+ * pipeline needs geometry to make a subject, so such a push reaches the
28994
+ * tracker as motion and no further.
28995
+ *
28996
+ * Reported and not inferred, because the operator's question in front of the
28997
+ * picker is "what do I get", and these are three different answers (D14: the
28998
+ * derived form is only as honest as `getOptions`).
28999
+ */
29000
+ var NativeObjectGeometryEnum = _enum([
29001
+ "boxed",
29002
+ "while-streaming",
29003
+ "flag-only"
29004
+ ]);
29005
+ var NativeObjectDetectionOptionsSchema = object({
29006
+ /** Classes this firmware can detect — the same list the status reports. */
29007
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
29008
+ /** What a detection from this camera carries. */
29009
+ geometry: NativeObjectGeometryEnum
29010
+ });
29011
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28769
29012
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28770
29013
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28771
29014
  lastFetchedAt: number() });
@@ -28775,13 +29018,23 @@ var nativeObjectDetectionCapability = {
28775
29018
  deviceNative: true,
28776
29019
  mode: "singleton",
28777
29020
  deviceTypes: [DeviceType.Camera],
28778
- methods: { setEnabled: method(object({
28779
- deviceId: number(),
28780
- enabled: boolean()
28781
- }), _void(), {
28782
- kind: "mutation",
28783
- auth: "admin"
28784
- }) },
29021
+ methods: {
29022
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29023
+ setSettings: method(object({
29024
+ deviceId: number(),
29025
+ settings: NativeObjectDetectionSettingsPatchSchema
29026
+ }), _void(), {
29027
+ kind: "mutation",
29028
+ auth: "admin"
29029
+ }),
29030
+ setEnabled: method(object({
29031
+ deviceId: number(),
29032
+ enabled: boolean()
29033
+ }), _void(), {
29034
+ kind: "mutation",
29035
+ auth: "admin"
29036
+ })
29037
+ },
28785
29038
  events: { onDetected: { data: object({
28786
29039
  deviceId: number(),
28787
29040
  detection: NativeDetectionSchema
@@ -33629,7 +33882,28 @@ var PerScopeBreakdownSchema = object({
33629
33882
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33630
33883
  totalObjects: number().int().nonnegative(),
33631
33884
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33632
- byClass: record(string(), number().int().nonnegative())
33885
+ byClass: record(string(), number().int().nonnegative()),
33886
+ /**
33887
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33888
+ * present but not going anywhere (a parked car, a bin, a statue).
33889
+ *
33890
+ * The operator's question about a scene has two halves and they answer
33891
+ * different things: "what is parked here" is stable for hours and must not
33892
+ * flap, while "who is walking through" is the thing an alert is about. One
33893
+ * number could only serve one of them, and `totalObjects` served the first
33894
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33895
+ *
33896
+ * `standing + transient === totalObjects`, always. The total keeps its old
33897
+ * meaning exactly, so no rule written against it changes behaviour.
33898
+ *
33899
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33900
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33901
+ * parked objects here" about a camera whose lot is full.
33902
+ */
33903
+ standingObjects: number().int().nonnegative().optional(),
33904
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33905
+ * same absence rule. */
33906
+ transientObjects: number().int().nonnegative().optional()
33633
33907
  });
33634
33908
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33635
33909
  zoneId: string(),
@@ -33752,6 +34026,23 @@ var HistoryPointSchema = object({
33752
34026
  * triple covers the three spatial scopes (per-zone, frame-wide,
33753
34027
  * outside-any-zone). Crossing them with `className?` gives the full
33754
34028
  * combinatorial coverage the operator UI requested.
34029
+ *
34030
+ * ## ⚠️ The three history methods are DEPRECATED
34031
+ *
34032
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34033
+ * so after a restart they report nothing about a night that did happen, and any
34034
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34035
+ * an empty scene. The presets in the occupancy chart existed to hide that
34036
+ * horizon rather than to answer a question.
34037
+ *
34038
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34039
+ * instead. Those rows are already written for every camera, ~60 bytes per
34040
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34041
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34042
+ * function the writer uses, so the two cannot drift.
34043
+ *
34044
+ * The ring stays until these three go, and it is the only thing left reading
34045
+ * it. Do not add a fourth caller.
33755
34046
  */
33756
34047
  var zoneAnalyticsCapability = {
33757
34048
  name: "zone-analytics",
@@ -37733,12 +38024,24 @@ Object.freeze({
37733
38024
  addonId: null,
37734
38025
  access: "create"
37735
38026
  },
38027
+ "nativeObjectDetection.getOptions": {
38028
+ capName: "native-object-detection",
38029
+ capScope: "device",
38030
+ addonId: null,
38031
+ access: "view"
38032
+ },
37736
38033
  "nativeObjectDetection.setEnabled": {
37737
38034
  capName: "native-object-detection",
37738
38035
  capScope: "device",
37739
38036
  addonId: null,
37740
38037
  access: "create"
37741
38038
  },
38039
+ "nativeObjectDetection.setSettings": {
38040
+ capName: "native-object-detection",
38041
+ capScope: "device",
38042
+ addonId: null,
38043
+ access: "create"
38044
+ },
37742
38045
  "navigation.getFeatures": {
37743
38046
  capName: "navigation",
37744
38047
  capScope: "device",
@@ -38003,6 +38306,12 @@ Object.freeze({
38003
38306
  addonId: null,
38004
38307
  access: "view"
38005
38308
  },
38309
+ "notificationRules.getClipRetentionAsks": {
38310
+ capName: "notification-rules",
38311
+ capScope: "system",
38312
+ addonId: null,
38313
+ access: "view"
38314
+ },
38006
38315
  "notificationRules.getConditionCatalog": {
38007
38316
  capName: "notification-rules",
38008
38317
  capScope: "system",
@@ -38513,6 +38822,12 @@ Object.freeze({
38513
38822
  addonId: null,
38514
38823
  access: "create"
38515
38824
  },
38825
+ "pipelineAnalytics.readLongTermSeries": {
38826
+ capName: "pipeline-analytics",
38827
+ capScope: "device",
38828
+ addonId: null,
38829
+ access: "view"
38830
+ },
38516
38831
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38517
38832
  capName: "pipeline-analytics",
38518
38833
  capScope: "device",
@@ -39185,6 +39500,12 @@ Object.freeze({
39185
39500
  addonId: null,
39186
39501
  access: "create"
39187
39502
  },
39503
+ "pipelineRunner.requestOccupancyBurst": {
39504
+ capName: "pipeline-runner",
39505
+ capScope: "system",
39506
+ addonId: null,
39507
+ access: "create"
39508
+ },
39188
39509
  "pipelineRunner.runDetailSubtree": {
39189
39510
  capName: "pipeline-runner",
39190
39511
  capScope: "system",
@@ -41965,11 +42286,21 @@ Object.freeze({
41965
42286
  form: "single",
41966
42287
  optional: false
41967
42288
  }],
42289
+ "nativeObjectDetection.getOptions": [{
42290
+ name: "deviceId",
42291
+ form: "single",
42292
+ optional: false
42293
+ }],
41968
42294
  "nativeObjectDetection.setEnabled": [{
41969
42295
  name: "deviceId",
41970
42296
  form: "single",
41971
42297
  optional: false
41972
42298
  }],
42299
+ "nativeObjectDetection.setSettings": [{
42300
+ name: "deviceId",
42301
+ form: "single",
42302
+ optional: false
42303
+ }],
41973
42304
  "navigation.getFeatures": [{
41974
42305
  name: "deviceId",
41975
42306
  form: "single",
@@ -42319,6 +42650,11 @@ Object.freeze({
42319
42650
  form: "single",
42320
42651
  optional: false
42321
42652
  }],
42653
+ "pipelineAnalytics.readLongTermSeries": [{
42654
+ name: "deviceId",
42655
+ form: "single",
42656
+ optional: false
42657
+ }],
42322
42658
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42323
42659
  name: "deviceId",
42324
42660
  form: "single",
@@ -42509,6 +42845,11 @@ Object.freeze({
42509
42845
  form: "single",
42510
42846
  optional: false
42511
42847
  }],
42848
+ "pipelineRunner.requestOccupancyBurst": [{
42849
+ name: "deviceId",
42850
+ form: "single",
42851
+ optional: false
42852
+ }],
42512
42853
  "pipelineRunner.runDetailSubtree": [{
42513
42854
  name: "deviceId",
42514
42855
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5369,7 +5369,7 @@ var ZodIssueCode = {
5369
5369
  var ZodFirstPartyTypeKind;
5370
5370
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5371
5371
  //#endregion
5372
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5372
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5373
5373
  /**
5374
5374
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5375
5375
  * window to float samples (D455).
@@ -11638,6 +11638,21 @@ var streamSignalsCapability = {
11638
11638
  mode: "singleton",
11639
11639
  deviceTypes: Object.values(DeviceType),
11640
11640
  runtimeState: StreamSignalsStatusSchema,
11641
+ /**
11642
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11643
+ *
11644
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11645
+ * not an operator choice: the provider re-declares it on every registration,
11646
+ * so losing it loses nothing and persisting it would freeze an answer the
11647
+ * camera is entitled to change. Measured the same day on the sibling case —
11648
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11649
+ * class the camera really detected stayed missing for the life of the row
11650
+ * because the fix could not reach it.
11651
+ *
11652
+ * See `RuntimeStateDurability`. Enforced by
11653
+ * `scripts/check-runtime-state-durability.ts`.
11654
+ */
11655
+ durability: "session",
11641
11656
  methods: {
11642
11657
  /**
11643
11658
  * What this device can emit. Empty is a valid and common answer — most
@@ -18171,6 +18186,48 @@ var NcAlarmConfigSchema = object({
18171
18186
  settings: NcAlarmSettingsSchema,
18172
18187
  coverage: array(NcAlarmModeCoverageSchema)
18173
18188
  });
18189
+ /**
18190
+ * ONE rule's demand on ONE camera's clip ring.
18191
+ *
18192
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18193
+ * camera, so the answer stays a faithful description of the rules and the
18194
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18195
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18196
+ * a different thing from never having been told, and only the envelope
18197
+ * (`rulesLoaded`) can tell those apart.
18198
+ */
18199
+ var NcClipRetentionAskSchema = object({
18200
+ /**
18201
+ * The camera this ask is about. **Absent = every camera**, which is what a
18202
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18203
+ * asking everywhere.
18204
+ */
18205
+ deviceId: number().int().nonnegative().optional(),
18206
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18207
+ * needs nothing produces no ask at all. */
18208
+ seconds: number().min(0).max(60),
18209
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18210
+ * assigned, which is what the cut defaults to. */
18211
+ profile: CamProfileSchema.optional(),
18212
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18213
+ ruleId: string(),
18214
+ ruleName: string(),
18215
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18216
+ reason: _enum(["window", "occupancy"])
18217
+ });
18218
+ /**
18219
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18220
+ *
18221
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18222
+ * once. A centre that is up but has not read its rules yet answers with an
18223
+ * empty ask list that means nothing at all — applying it would drop every
18224
+ * camera's ring to zero for the first events after a restart, which is the
18225
+ * footage this mechanism exists to keep.
18226
+ */
18227
+ var NcClipRetentionPlanSchema = object({
18228
+ rulesLoaded: boolean(),
18229
+ asks: array(NcClipRetentionAskSchema).readonly()
18230
+ });
18174
18231
  method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
18175
18232
  kind: "mutation",
18176
18233
  auth: "admin",
@@ -18191,7 +18248,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18191
18248
  }), object({ success: literal(true) }), {
18192
18249
  kind: "mutation",
18193
18250
  auth: "admin"
18194
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18251
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18195
18252
  deviceId: number().int(),
18196
18253
  muted: boolean()
18197
18254
  }), object({ success: literal(true) }), {
@@ -19376,13 +19433,26 @@ var TrackAudioLabelSchema = object({
19376
19433
  * - `audio` — an audio event on the camera itself that was anomalous for
19377
19434
  * THAT camera, loud, and heard while nothing visual was happening (D62).
19378
19435
  *
19436
+ * - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
19437
+ * that frame's pixel space. A real root detector and a SPATIAL one: its
19438
+ * boxes are the same kind of fact `pipeline`'s are, produced by a different
19439
+ * detector.
19440
+ *
19441
+ * `onboard` was missing here while `DetectionSourceSchema` already had it, so
19442
+ * a persisted onboard track failed `safeParse` on read and came back with NO
19443
+ * source at all — which `isSpatialTrack` then admitted by accident, through the
19444
+ * `undefined` arm rather than by anybody's decision, and which `excludeSources`
19445
+ * could not name.
19446
+ *
19379
19447
  * The spatial subsystems (tracker association, occupancy count, re-id /
19380
19448
  * embedding, resurrection) MUST skip every synthetic source. Test for that
19381
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
19382
- * check silently readmits every source added after it was written.
19449
+ * with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
19450
+ * `!== 'sensor'` check silently readmits every source added after it was
19451
+ * written.
19383
19452
  */
19384
19453
  var TrackSourceSchema = _enum([
19385
19454
  "pipeline",
19455
+ "onboard",
19386
19456
  "sensor",
19387
19457
  "audio"
19388
19458
  ]);
@@ -20765,6 +20835,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20765
20835
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20766
20836
  framesMatched: number().int()
20767
20837
  })).readonly() });
20838
+ /**
20839
+ * The long-term series a camera produces. A closed union so a typo cannot
20840
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20841
+ * is an alias of this, not a second list.
20842
+ */
20843
+ var AnalyticsLtsSeriesSchema = _enum([
20844
+ "motion",
20845
+ "audio-dbfs",
20846
+ "battery",
20847
+ "occupancy"
20848
+ ]);
20849
+ /**
20850
+ * One closed 5-minute bucket of a long-term series.
20851
+ *
20852
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20853
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20854
+ * that exists at all was measured; a bucket that is absent was not, which is a
20855
+ * different claim from zero and the reason this is a sparse series.
20856
+ */
20857
+ var LtsBucketSchema = object({
20858
+ scope: string(),
20859
+ bucketStart: number().int(),
20860
+ samples: number().int().nonnegative(),
20861
+ sum: number(),
20862
+ min: number(),
20863
+ max: number()
20864
+ });
20768
20865
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20769
20866
  deviceId: number(),
20770
20867
  trackId: string()
@@ -20811,6 +20908,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20811
20908
  kinds: array(string()).optional(),
20812
20909
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20813
20910
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20911
+ deviceId: number(),
20912
+ series: AnalyticsLtsSeriesSchema,
20913
+ /** Omit for EVERY scope of this series in the range. */
20914
+ scope: string().optional(),
20915
+ from: number(),
20916
+ to: number(),
20917
+ limit: number().int().positive().optional()
20918
+ }), array(LtsBucketSchema).readonly()), method(object({
20814
20919
  deviceId: number(),
20815
20920
  since: number(),
20816
20921
  until: number(),
@@ -21429,6 +21534,40 @@ var MotionSourceEnum = _enum([
21429
21534
  */
21430
21535
  var MotionSourcesSchema = array(MotionSourceEnum);
21431
21536
  /**
21537
+ * Which root detector a camera runs — EXACTLY ONE.
21538
+ *
21539
+ * Deliberately the SAME vocabulary post-analysis already tags every detection
21540
+ * with (`DetectionSource`) rather than a second spelling of the same two
21541
+ * ideas: the value an operator picks here is the value that comes back on the
21542
+ * track, the overlay and the debug row.
21543
+ *
21544
+ * ## Why one, and why it is still an array
21545
+ *
21546
+ * Two roots on one camera is a capability nobody asked for and the operator has
21547
+ * since ruled out. It was never free: both planes feed the SAME per-device
21548
+ * stationary registry, both can promote the same parked object, and the two
21549
+ * detectors disagree about the same box by construction — which is the
21550
+ * disagreement D505 had to arbitrate. Removing the case removes the arbitration.
21551
+ *
21552
+ * The ARRAY shape survives because the stored settings and the attach payload
21553
+ * already speak it on every camera of every fleet, and a cap input that
21554
+ * suddenly refuses a stored value makes the camera un-attachable — a fail-closed
21555
+ * in the one direction that costs an operator their cameras. So the wire stays
21556
+ * tolerant and the TYPE is exact: a longer list is truncated to its first
21557
+ * element rather than refused, and `max(1)` is what every consumer can then
21558
+ * rely on.
21559
+ *
21560
+ * AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
21561
+ * a camera an operator left with no root detector — and `planDetectionSources`
21562
+ * has always said so: inventing a root for them is how a default acts without
21563
+ * anybody choosing it. Tightening this to `length(1)` broke that, and the
21564
+ * suite caught it.
21565
+ *
21566
+ * Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
21567
+ * `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
21568
+ */
21569
+ var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
21570
+ /**
21432
21571
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21433
21572
  * so cap-side consumers (the orchestrator forward, the runner addon's
21434
21573
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21579,6 +21718,35 @@ var RunnerCameraConfigSchema = object({
21579
21718
  * events; the orchestrator forwards to `reportMotion`.
21580
21719
  */
21581
21720
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21721
+ /**
21722
+ * WHICH root detector runs for this camera. The detection counterpart of
21723
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21724
+ * of sources the system understands, vendor-agnostic, owned here.
21725
+ *
21726
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21727
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21728
+ * here. Its boxes reach post-analysis on the same
21729
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21730
+ * track gets the same tracker, the same overlay and the same detail
21731
+ * subtree (face / plate / embedding).
21732
+ *
21733
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21734
+ * run, and that is where a camera with a usable onboard detector buys back
21735
+ * its share of the accelerator. It saves the root inference, not the decode
21736
+ * — the detail subtree still needs pixels to cut crops from.
21737
+ *
21738
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21739
+ * step at all (there is nothing to track), and the cap that knows this says
21740
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21741
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21742
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21743
+ * worth exactly what it already is — a wake signal with a class.
21744
+ *
21745
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21746
+ * vendor never turns a detector on for the operator, and neither does a
21747
+ * default.
21748
+ */
21749
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21582
21750
  pipelineEnabled: boolean().default(true),
21583
21751
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21584
21752
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21760,7 +21928,47 @@ var RunnerLocalMetricsSchema = object({
21760
21928
  queueDepth: number(),
21761
21929
  frameLazy: FrameLazyMetricsSchema.optional()
21762
21930
  });
21931
+ /**
21932
+ * Pipeline Runner capability — runtime detection workhorse.
21933
+ *
21934
+ * One instance per node. Receives camera assignments from
21935
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21936
+ * decoded frames, drains motion + detection queues, calls the local
21937
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21938
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21939
+ * the bus.
21940
+ *
21941
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21942
+ * runner has zero knowledge of other agents, no global state, and never
21943
+ * makes assignment decisions itself.
21944
+ */
21945
+ /**
21946
+ * Why a runner declined to look at a camera out of band. Named rather than a
21947
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21948
+ * already mid-session and one already bursting are four different facts, and a
21949
+ * caller told only "no" cannot tell a protection from a bug.
21950
+ */
21951
+ var OccupancyBurstRefusalSchema = _enum([
21952
+ "not-attached",
21953
+ "battery-asleep",
21954
+ "not-watching",
21955
+ "already-bursting"
21956
+ ]);
21763
21957
  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({
21958
+ deviceId: number(),
21959
+ /** How many frames to collect. The caller sizes this against what its
21960
+ * own confirmation needs; the runner clamps it to the field's range. */
21961
+ frames: number().int().positive().optional(),
21962
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21963
+ * defend — the periodic one at least has a timer to point at. */
21964
+ reason: string()
21965
+ }), object({
21966
+ started: boolean(),
21967
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21968
+ }), {
21969
+ auth: "admin",
21970
+ kind: "mutation"
21971
+ }), method(object({
21764
21972
  handle: FrameHandleSchema,
21765
21973
  bbox: NativeCropBboxSchema,
21766
21974
  maxWidth: number().int().positive().optional(),
@@ -28738,11 +28946,46 @@ var NativeObjectDetectionStatusSchema = object({
28738
28946
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28739
28947
  /**
28740
28948
  * Whether forwarding of onboard AI detections is enabled for this device.
28741
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28742
- * churn the tracker, so forwarding stays off until the operator enables it.
28949
+ *
28950
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28951
+ * camera runs — that is the operator's choice, and it is made where every
28952
+ * other detection choice is made. `geometry` on
28953
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28954
+ * choice would buy this particular camera.
28743
28955
  */
28744
28956
  enabled: boolean()
28745
28957
  });
28958
+ /**
28959
+ * WHEN a camera's onboard detections carry geometry.
28960
+ *
28961
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28962
+ * a detection is a trackable subject whenever the camera sees one.
28963
+ * - `while-streaming` — only while some stream of this camera is already open.
28964
+ * The boxes ride the video's own side-channel rather than a feed of their
28965
+ * own, so they cost nothing and they exist only when something is pulling.
28966
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28967
+ * radio drain, but a camera that is awake is awake precisely because
28968
+ * something is in front of it, and its stream is already being pulled.
28969
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28970
+ * pipeline needs geometry to make a subject, so such a push reaches the
28971
+ * tracker as motion and no further.
28972
+ *
28973
+ * Reported and not inferred, because the operator's question in front of the
28974
+ * picker is "what do I get", and these are three different answers (D14: the
28975
+ * derived form is only as honest as `getOptions`).
28976
+ */
28977
+ var NativeObjectGeometryEnum = _enum([
28978
+ "boxed",
28979
+ "while-streaming",
28980
+ "flag-only"
28981
+ ]);
28982
+ var NativeObjectDetectionOptionsSchema = object({
28983
+ /** Classes this firmware can detect — the same list the status reports. */
28984
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28985
+ /** What a detection from this camera carries. */
28986
+ geometry: NativeObjectGeometryEnum
28987
+ });
28988
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28746
28989
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28747
28990
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28748
28991
  lastFetchedAt: number() });
@@ -28752,13 +28995,23 @@ var nativeObjectDetectionCapability = {
28752
28995
  deviceNative: true,
28753
28996
  mode: "singleton",
28754
28997
  deviceTypes: [DeviceType.Camera],
28755
- methods: { setEnabled: method(object({
28756
- deviceId: number(),
28757
- enabled: boolean()
28758
- }), _void(), {
28759
- kind: "mutation",
28760
- auth: "admin"
28761
- }) },
28998
+ methods: {
28999
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29000
+ setSettings: method(object({
29001
+ deviceId: number(),
29002
+ settings: NativeObjectDetectionSettingsPatchSchema
29003
+ }), _void(), {
29004
+ kind: "mutation",
29005
+ auth: "admin"
29006
+ }),
29007
+ setEnabled: method(object({
29008
+ deviceId: number(),
29009
+ enabled: boolean()
29010
+ }), _void(), {
29011
+ kind: "mutation",
29012
+ auth: "admin"
29013
+ })
29014
+ },
28762
29015
  events: { onDetected: { data: object({
28763
29016
  deviceId: number(),
28764
29017
  detection: NativeDetectionSchema
@@ -33606,7 +33859,28 @@ var PerScopeBreakdownSchema = object({
33606
33859
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33607
33860
  totalObjects: number().int().nonnegative(),
33608
33861
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33609
- byClass: record(string(), number().int().nonnegative())
33862
+ byClass: record(string(), number().int().nonnegative()),
33863
+ /**
33864
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33865
+ * present but not going anywhere (a parked car, a bin, a statue).
33866
+ *
33867
+ * The operator's question about a scene has two halves and they answer
33868
+ * different things: "what is parked here" is stable for hours and must not
33869
+ * flap, while "who is walking through" is the thing an alert is about. One
33870
+ * number could only serve one of them, and `totalObjects` served the first
33871
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33872
+ *
33873
+ * `standing + transient === totalObjects`, always. The total keeps its old
33874
+ * meaning exactly, so no rule written against it changes behaviour.
33875
+ *
33876
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33877
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33878
+ * parked objects here" about a camera whose lot is full.
33879
+ */
33880
+ standingObjects: number().int().nonnegative().optional(),
33881
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33882
+ * same absence rule. */
33883
+ transientObjects: number().int().nonnegative().optional()
33610
33884
  });
33611
33885
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33612
33886
  zoneId: string(),
@@ -33729,6 +34003,23 @@ var HistoryPointSchema = object({
33729
34003
  * triple covers the three spatial scopes (per-zone, frame-wide,
33730
34004
  * outside-any-zone). Crossing them with `className?` gives the full
33731
34005
  * combinatorial coverage the operator UI requested.
34006
+ *
34007
+ * ## ⚠️ The three history methods are DEPRECATED
34008
+ *
34009
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34010
+ * so after a restart they report nothing about a night that did happen, and any
34011
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34012
+ * an empty scene. The presets in the occupancy chart existed to hide that
34013
+ * horizon rather than to answer a question.
34014
+ *
34015
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34016
+ * instead. Those rows are already written for every camera, ~60 bytes per
34017
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34018
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34019
+ * function the writer uses, so the two cannot drift.
34020
+ *
34021
+ * The ring stays until these three go, and it is the only thing left reading
34022
+ * it. Do not add a fourth caller.
33732
34023
  */
33733
34024
  var zoneAnalyticsCapability = {
33734
34025
  name: "zone-analytics",
@@ -37710,12 +38001,24 @@ Object.freeze({
37710
38001
  addonId: null,
37711
38002
  access: "create"
37712
38003
  },
38004
+ "nativeObjectDetection.getOptions": {
38005
+ capName: "native-object-detection",
38006
+ capScope: "device",
38007
+ addonId: null,
38008
+ access: "view"
38009
+ },
37713
38010
  "nativeObjectDetection.setEnabled": {
37714
38011
  capName: "native-object-detection",
37715
38012
  capScope: "device",
37716
38013
  addonId: null,
37717
38014
  access: "create"
37718
38015
  },
38016
+ "nativeObjectDetection.setSettings": {
38017
+ capName: "native-object-detection",
38018
+ capScope: "device",
38019
+ addonId: null,
38020
+ access: "create"
38021
+ },
37719
38022
  "navigation.getFeatures": {
37720
38023
  capName: "navigation",
37721
38024
  capScope: "device",
@@ -37980,6 +38283,12 @@ Object.freeze({
37980
38283
  addonId: null,
37981
38284
  access: "view"
37982
38285
  },
38286
+ "notificationRules.getClipRetentionAsks": {
38287
+ capName: "notification-rules",
38288
+ capScope: "system",
38289
+ addonId: null,
38290
+ access: "view"
38291
+ },
37983
38292
  "notificationRules.getConditionCatalog": {
37984
38293
  capName: "notification-rules",
37985
38294
  capScope: "system",
@@ -38490,6 +38799,12 @@ Object.freeze({
38490
38799
  addonId: null,
38491
38800
  access: "create"
38492
38801
  },
38802
+ "pipelineAnalytics.readLongTermSeries": {
38803
+ capName: "pipeline-analytics",
38804
+ capScope: "device",
38805
+ addonId: null,
38806
+ access: "view"
38807
+ },
38493
38808
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38494
38809
  capName: "pipeline-analytics",
38495
38810
  capScope: "device",
@@ -39162,6 +39477,12 @@ Object.freeze({
39162
39477
  addonId: null,
39163
39478
  access: "create"
39164
39479
  },
39480
+ "pipelineRunner.requestOccupancyBurst": {
39481
+ capName: "pipeline-runner",
39482
+ capScope: "system",
39483
+ addonId: null,
39484
+ access: "create"
39485
+ },
39165
39486
  "pipelineRunner.runDetailSubtree": {
39166
39487
  capName: "pipeline-runner",
39167
39488
  capScope: "system",
@@ -41942,11 +42263,21 @@ Object.freeze({
41942
42263
  form: "single",
41943
42264
  optional: false
41944
42265
  }],
42266
+ "nativeObjectDetection.getOptions": [{
42267
+ name: "deviceId",
42268
+ form: "single",
42269
+ optional: false
42270
+ }],
41945
42271
  "nativeObjectDetection.setEnabled": [{
41946
42272
  name: "deviceId",
41947
42273
  form: "single",
41948
42274
  optional: false
41949
42275
  }],
42276
+ "nativeObjectDetection.setSettings": [{
42277
+ name: "deviceId",
42278
+ form: "single",
42279
+ optional: false
42280
+ }],
41950
42281
  "navigation.getFeatures": [{
41951
42282
  name: "deviceId",
41952
42283
  form: "single",
@@ -42296,6 +42627,11 @@ Object.freeze({
42296
42627
  form: "single",
42297
42628
  optional: false
42298
42629
  }],
42630
+ "pipelineAnalytics.readLongTermSeries": [{
42631
+ name: "deviceId",
42632
+ form: "single",
42633
+ optional: false
42634
+ }],
42299
42635
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42300
42636
  name: "deviceId",
42301
42637
  form: "single",
@@ -42486,6 +42822,11 @@ Object.freeze({
42486
42822
  form: "single",
42487
42823
  optional: false
42488
42824
  }],
42825
+ "pipelineRunner.requestOccupancyBurst": [{
42826
+ name: "deviceId",
42827
+ form: "single",
42828
+ optional: false
42829
+ }],
42489
42830
  "pipelineRunner.runDetailSubtree": [{
42490
42831
  name: "deviceId",
42491
42832
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-terminal",
3
- "version": "0.1.107",
3
+ "version": "0.1.109",
4
4
  "description": "Interactive terminal sessions (pty + xterm) as a CamStack addon",
5
5
  "keywords": [
6
6
  "camstack",
@@ -64,7 +64,7 @@
64
64
  "dev": "vite build --watch",
65
65
  "typecheck": "tsc --noEmit",
66
66
  "test": "vitest run",
67
- "publish": "npm publish --access public"
67
+ "publish:npm": "npm publish --access public"
68
68
  },
69
69
  "dependencies": {
70
70
  "@xterm/addon-serialize": "^0.13.0",