@camstack/addon-import-alexa 0.2.101 → 0.2.103

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
@@ -5399,7 +5399,7 @@ var ZodIssueCode = {
5399
5399
  var ZodFirstPartyTypeKind;
5400
5400
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5401
5401
  //#endregion
5402
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5402
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5403
5403
  /**
5404
5404
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5405
5405
  * window to float samples (D455).
@@ -11786,6 +11786,21 @@ var streamSignalsCapability = {
11786
11786
  mode: "singleton",
11787
11787
  deviceTypes: Object.values(DeviceType),
11788
11788
  runtimeState: StreamSignalsStatusSchema,
11789
+ /**
11790
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11791
+ *
11792
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11793
+ * not an operator choice: the provider re-declares it on every registration,
11794
+ * so losing it loses nothing and persisting it would freeze an answer the
11795
+ * camera is entitled to change. Measured the same day on the sibling case —
11796
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11797
+ * class the camera really detected stayed missing for the life of the row
11798
+ * because the fix could not reach it.
11799
+ *
11800
+ * See `RuntimeStateDurability`. Enforced by
11801
+ * `scripts/check-runtime-state-durability.ts`.
11802
+ */
11803
+ durability: "session",
11789
11804
  methods: {
11790
11805
  /**
11791
11806
  * What this device can emit. Empty is a valid and common answer — most
@@ -18417,6 +18432,48 @@ var NcAlarmConfigSchema = object({
18417
18432
  settings: NcAlarmSettingsSchema,
18418
18433
  coverage: array(NcAlarmModeCoverageSchema)
18419
18434
  });
18435
+ /**
18436
+ * ONE rule's demand on ONE camera's clip ring.
18437
+ *
18438
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18439
+ * camera, so the answer stays a faithful description of the rules and the
18440
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18441
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18442
+ * a different thing from never having been told, and only the envelope
18443
+ * (`rulesLoaded`) can tell those apart.
18444
+ */
18445
+ var NcClipRetentionAskSchema = object({
18446
+ /**
18447
+ * The camera this ask is about. **Absent = every camera**, which is what a
18448
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18449
+ * asking everywhere.
18450
+ */
18451
+ deviceId: number().int().nonnegative().optional(),
18452
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18453
+ * needs nothing produces no ask at all. */
18454
+ seconds: number().min(0).max(60),
18455
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18456
+ * assigned, which is what the cut defaults to. */
18457
+ profile: CamProfileSchema.optional(),
18458
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18459
+ ruleId: string(),
18460
+ ruleName: string(),
18461
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18462
+ reason: _enum(["window", "occupancy"])
18463
+ });
18464
+ /**
18465
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18466
+ *
18467
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18468
+ * once. A centre that is up but has not read its rules yet answers with an
18469
+ * empty ask list that means nothing at all — applying it would drop every
18470
+ * camera's ring to zero for the first events after a restart, which is the
18471
+ * footage this mechanism exists to keep.
18472
+ */
18473
+ var NcClipRetentionPlanSchema = object({
18474
+ rulesLoaded: boolean(),
18475
+ asks: array(NcClipRetentionAskSchema).readonly()
18476
+ });
18420
18477
  method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
18421
18478
  kind: "mutation",
18422
18479
  auth: "admin",
@@ -18437,7 +18494,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18437
18494
  }), object({ success: literal(true) }), {
18438
18495
  kind: "mutation",
18439
18496
  auth: "admin"
18440
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18497
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18441
18498
  deviceId: number().int(),
18442
18499
  muted: boolean()
18443
18500
  }), object({ success: literal(true) }), {
@@ -19622,13 +19679,26 @@ var TrackAudioLabelSchema = object({
19622
19679
  * - `audio` — an audio event on the camera itself that was anomalous for
19623
19680
  * THAT camera, loud, and heard while nothing visual was happening (D62).
19624
19681
  *
19682
+ * - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
19683
+ * that frame's pixel space. A real root detector and a SPATIAL one: its
19684
+ * boxes are the same kind of fact `pipeline`'s are, produced by a different
19685
+ * detector.
19686
+ *
19687
+ * `onboard` was missing here while `DetectionSourceSchema` already had it, so
19688
+ * a persisted onboard track failed `safeParse` on read and came back with NO
19689
+ * source at all — which `isSpatialTrack` then admitted by accident, through the
19690
+ * `undefined` arm rather than by anybody's decision, and which `excludeSources`
19691
+ * could not name.
19692
+ *
19625
19693
  * The spatial subsystems (tracker association, occupancy count, re-id /
19626
19694
  * embedding, resurrection) MUST skip every synthetic source. Test for that
19627
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
19628
- * check silently readmits every source added after it was written.
19695
+ * with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
19696
+ * `!== 'sensor'` check silently readmits every source added after it was
19697
+ * written.
19629
19698
  */
19630
19699
  var TrackSourceSchema = _enum([
19631
19700
  "pipeline",
19701
+ "onboard",
19632
19702
  "sensor",
19633
19703
  "audio"
19634
19704
  ]);
@@ -21011,6 +21081,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
21011
21081
  * solid is this track", cheaper than re-deriving it from a trajectory. */
21012
21082
  framesMatched: number().int()
21013
21083
  })).readonly() });
21084
+ /**
21085
+ * The long-term series a camera produces. A closed union so a typo cannot
21086
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21087
+ * is an alias of this, not a second list.
21088
+ */
21089
+ var AnalyticsLtsSeriesSchema = _enum([
21090
+ "motion",
21091
+ "audio-dbfs",
21092
+ "battery",
21093
+ "occupancy"
21094
+ ]);
21095
+ /**
21096
+ * One closed 5-minute bucket of a long-term series.
21097
+ *
21098
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21099
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21100
+ * that exists at all was measured; a bucket that is absent was not, which is a
21101
+ * different claim from zero and the reason this is a sparse series.
21102
+ */
21103
+ var LtsBucketSchema = object({
21104
+ scope: string(),
21105
+ bucketStart: number().int(),
21106
+ samples: number().int().nonnegative(),
21107
+ sum: number(),
21108
+ min: number(),
21109
+ max: number()
21110
+ });
21014
21111
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
21015
21112
  deviceId: number(),
21016
21113
  trackId: string()
@@ -21057,6 +21154,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21057
21154
  kinds: array(string()).optional(),
21058
21155
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
21059
21156
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
21157
+ deviceId: number(),
21158
+ series: AnalyticsLtsSeriesSchema,
21159
+ /** Omit for EVERY scope of this series in the range. */
21160
+ scope: string().optional(),
21161
+ from: number(),
21162
+ to: number(),
21163
+ limit: number().int().positive().optional()
21164
+ }), array(LtsBucketSchema).readonly()), method(object({
21060
21165
  deviceId: number(),
21061
21166
  since: number(),
21062
21167
  until: number(),
@@ -21675,6 +21780,40 @@ var MotionSourceEnum = _enum([
21675
21780
  */
21676
21781
  var MotionSourcesSchema = array(MotionSourceEnum);
21677
21782
  /**
21783
+ * Which root detector a camera runs — EXACTLY ONE.
21784
+ *
21785
+ * Deliberately the SAME vocabulary post-analysis already tags every detection
21786
+ * with (`DetectionSource`) rather than a second spelling of the same two
21787
+ * ideas: the value an operator picks here is the value that comes back on the
21788
+ * track, the overlay and the debug row.
21789
+ *
21790
+ * ## Why one, and why it is still an array
21791
+ *
21792
+ * Two roots on one camera is a capability nobody asked for and the operator has
21793
+ * since ruled out. It was never free: both planes feed the SAME per-device
21794
+ * stationary registry, both can promote the same parked object, and the two
21795
+ * detectors disagree about the same box by construction — which is the
21796
+ * disagreement D505 had to arbitrate. Removing the case removes the arbitration.
21797
+ *
21798
+ * The ARRAY shape survives because the stored settings and the attach payload
21799
+ * already speak it on every camera of every fleet, and a cap input that
21800
+ * suddenly refuses a stored value makes the camera un-attachable — a fail-closed
21801
+ * in the one direction that costs an operator their cameras. So the wire stays
21802
+ * tolerant and the TYPE is exact: a longer list is truncated to its first
21803
+ * element rather than refused, and `max(1)` is what every consumer can then
21804
+ * rely on.
21805
+ *
21806
+ * AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
21807
+ * a camera an operator left with no root detector — and `planDetectionSources`
21808
+ * has always said so: inventing a root for them is how a default acts without
21809
+ * anybody choosing it. Tightening this to `length(1)` broke that, and the
21810
+ * suite caught it.
21811
+ *
21812
+ * Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
21813
+ * `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
21814
+ */
21815
+ var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
21816
+ /**
21678
21817
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21679
21818
  * so cap-side consumers (the orchestrator forward, the runner addon's
21680
21819
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21825,6 +21964,35 @@ var RunnerCameraConfigSchema = object({
21825
21964
  * events; the orchestrator forwards to `reportMotion`.
21826
21965
  */
21827
21966
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21967
+ /**
21968
+ * WHICH root detector runs for this camera. The detection counterpart of
21969
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21970
+ * of sources the system understands, vendor-agnostic, owned here.
21971
+ *
21972
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21973
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21974
+ * here. Its boxes reach post-analysis on the same
21975
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21976
+ * track gets the same tracker, the same overlay and the same detail
21977
+ * subtree (face / plate / embedding).
21978
+ *
21979
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21980
+ * run, and that is where a camera with a usable onboard detector buys back
21981
+ * its share of the accelerator. It saves the root inference, not the decode
21982
+ * — the detail subtree still needs pixels to cut crops from.
21983
+ *
21984
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21985
+ * step at all (there is nothing to track), and the cap that knows this says
21986
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21987
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21988
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21989
+ * worth exactly what it already is — a wake signal with a class.
21990
+ *
21991
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21992
+ * vendor never turns a detector on for the operator, and neither does a
21993
+ * default.
21994
+ */
21995
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21828
21996
  pipelineEnabled: boolean().default(true),
21829
21997
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21830
21998
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -22006,7 +22174,47 @@ var RunnerLocalMetricsSchema = object({
22006
22174
  queueDepth: number(),
22007
22175
  frameLazy: FrameLazyMetricsSchema.optional()
22008
22176
  });
22177
+ /**
22178
+ * Pipeline Runner capability — runtime detection workhorse.
22179
+ *
22180
+ * One instance per node. Receives camera assignments from
22181
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22182
+ * decoded frames, drains motion + detection queues, calls the local
22183
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22184
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22185
+ * the bus.
22186
+ *
22187
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22188
+ * runner has zero knowledge of other agents, no global state, and never
22189
+ * makes assignment decisions itself.
22190
+ */
22191
+ /**
22192
+ * Why a runner declined to look at a camera out of band. Named rather than a
22193
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22194
+ * already mid-session and one already bursting are four different facts, and a
22195
+ * caller told only "no" cannot tell a protection from a bug.
22196
+ */
22197
+ var OccupancyBurstRefusalSchema = _enum([
22198
+ "not-attached",
22199
+ "battery-asleep",
22200
+ "not-watching",
22201
+ "already-bursting"
22202
+ ]);
22009
22203
  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({
22204
+ deviceId: number(),
22205
+ /** How many frames to collect. The caller sizes this against what its
22206
+ * own confirmation needs; the runner clamps it to the field's range. */
22207
+ frames: number().int().positive().optional(),
22208
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22209
+ * defend — the periodic one at least has a timer to point at. */
22210
+ reason: string()
22211
+ }), object({
22212
+ started: boolean(),
22213
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22214
+ }), {
22215
+ auth: "admin",
22216
+ kind: "mutation"
22217
+ }), method(object({
22010
22218
  handle: FrameHandleSchema,
22011
22219
  bbox: NativeCropBboxSchema,
22012
22220
  maxWidth: number().int().positive().optional(),
@@ -28853,11 +29061,46 @@ var NativeObjectDetectionStatusSchema = object({
28853
29061
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28854
29062
  /**
28855
29063
  * Whether forwarding of onboard AI detections is enabled for this device.
28856
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28857
- * churn the tracker, so forwarding stays off until the operator enables it.
29064
+ *
29065
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
29066
+ * camera runs — that is the operator's choice, and it is made where every
29067
+ * other detection choice is made. `geometry` on
29068
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
29069
+ * choice would buy this particular camera.
28858
29070
  */
28859
29071
  enabled: boolean()
28860
29072
  });
29073
+ /**
29074
+ * WHEN a camera's onboard detections carry geometry.
29075
+ *
29076
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
29077
+ * a detection is a trackable subject whenever the camera sees one.
29078
+ * - `while-streaming` — only while some stream of this camera is already open.
29079
+ * The boxes ride the video's own side-channel rather than a feed of their
29080
+ * own, so they cost nothing and they exist only when something is pulling.
29081
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
29082
+ * radio drain, but a camera that is awake is awake precisely because
29083
+ * something is in front of it, and its stream is already being pulled.
29084
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
29085
+ * pipeline needs geometry to make a subject, so such a push reaches the
29086
+ * tracker as motion and no further.
29087
+ *
29088
+ * Reported and not inferred, because the operator's question in front of the
29089
+ * picker is "what do I get", and these are three different answers (D14: the
29090
+ * derived form is only as honest as `getOptions`).
29091
+ */
29092
+ var NativeObjectGeometryEnum = _enum([
29093
+ "boxed",
29094
+ "while-streaming",
29095
+ "flag-only"
29096
+ ]);
29097
+ var NativeObjectDetectionOptionsSchema = object({
29098
+ /** Classes this firmware can detect — the same list the status reports. */
29099
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
29100
+ /** What a detection from this camera carries. */
29101
+ geometry: NativeObjectGeometryEnum
29102
+ });
29103
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28861
29104
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28862
29105
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28863
29106
  lastFetchedAt: number() });
@@ -28867,13 +29110,23 @@ var nativeObjectDetectionCapability = {
28867
29110
  deviceNative: true,
28868
29111
  mode: "singleton",
28869
29112
  deviceTypes: [DeviceType.Camera],
28870
- methods: { setEnabled: method(object({
28871
- deviceId: number(),
28872
- enabled: boolean()
28873
- }), _void(), {
28874
- kind: "mutation",
28875
- auth: "admin"
28876
- }) },
29113
+ methods: {
29114
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29115
+ setSettings: method(object({
29116
+ deviceId: number(),
29117
+ settings: NativeObjectDetectionSettingsPatchSchema
29118
+ }), _void(), {
29119
+ kind: "mutation",
29120
+ auth: "admin"
29121
+ }),
29122
+ setEnabled: method(object({
29123
+ deviceId: number(),
29124
+ enabled: boolean()
29125
+ }), _void(), {
29126
+ kind: "mutation",
29127
+ auth: "admin"
29128
+ })
29129
+ },
28877
29130
  events: { onDetected: { data: object({
28878
29131
  deviceId: number(),
28879
29132
  detection: NativeDetectionSchema
@@ -33721,7 +33974,28 @@ var PerScopeBreakdownSchema = object({
33721
33974
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33722
33975
  totalObjects: number().int().nonnegative(),
33723
33976
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33724
- byClass: record(string(), number().int().nonnegative())
33977
+ byClass: record(string(), number().int().nonnegative()),
33978
+ /**
33979
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33980
+ * present but not going anywhere (a parked car, a bin, a statue).
33981
+ *
33982
+ * The operator's question about a scene has two halves and they answer
33983
+ * different things: "what is parked here" is stable for hours and must not
33984
+ * flap, while "who is walking through" is the thing an alert is about. One
33985
+ * number could only serve one of them, and `totalObjects` served the first
33986
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33987
+ *
33988
+ * `standing + transient === totalObjects`, always. The total keeps its old
33989
+ * meaning exactly, so no rule written against it changes behaviour.
33990
+ *
33991
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33992
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33993
+ * parked objects here" about a camera whose lot is full.
33994
+ */
33995
+ standingObjects: number().int().nonnegative().optional(),
33996
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33997
+ * same absence rule. */
33998
+ transientObjects: number().int().nonnegative().optional()
33725
33999
  });
33726
34000
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33727
34001
  zoneId: string(),
@@ -33844,6 +34118,23 @@ var HistoryPointSchema = object({
33844
34118
  * triple covers the three spatial scopes (per-zone, frame-wide,
33845
34119
  * outside-any-zone). Crossing them with `className?` gives the full
33846
34120
  * combinatorial coverage the operator UI requested.
34121
+ *
34122
+ * ## ⚠️ The three history methods are DEPRECATED
34123
+ *
34124
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34125
+ * so after a restart they report nothing about a night that did happen, and any
34126
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34127
+ * an empty scene. The presets in the occupancy chart existed to hide that
34128
+ * horizon rather than to answer a question.
34129
+ *
34130
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34131
+ * instead. Those rows are already written for every camera, ~60 bytes per
34132
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34133
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34134
+ * function the writer uses, so the two cannot drift.
34135
+ *
34136
+ * The ring stays until these three go, and it is the only thing left reading
34137
+ * it. Do not add a fourth caller.
33847
34138
  */
33848
34139
  var zoneAnalyticsCapability = {
33849
34140
  name: "zone-analytics",
@@ -38243,12 +38534,24 @@ Object.freeze({
38243
38534
  addonId: null,
38244
38535
  access: "create"
38245
38536
  },
38537
+ "nativeObjectDetection.getOptions": {
38538
+ capName: "native-object-detection",
38539
+ capScope: "device",
38540
+ addonId: null,
38541
+ access: "view"
38542
+ },
38246
38543
  "nativeObjectDetection.setEnabled": {
38247
38544
  capName: "native-object-detection",
38248
38545
  capScope: "device",
38249
38546
  addonId: null,
38250
38547
  access: "create"
38251
38548
  },
38549
+ "nativeObjectDetection.setSettings": {
38550
+ capName: "native-object-detection",
38551
+ capScope: "device",
38552
+ addonId: null,
38553
+ access: "create"
38554
+ },
38252
38555
  "navigation.getFeatures": {
38253
38556
  capName: "navigation",
38254
38557
  capScope: "device",
@@ -38513,6 +38816,12 @@ Object.freeze({
38513
38816
  addonId: null,
38514
38817
  access: "view"
38515
38818
  },
38819
+ "notificationRules.getClipRetentionAsks": {
38820
+ capName: "notification-rules",
38821
+ capScope: "system",
38822
+ addonId: null,
38823
+ access: "view"
38824
+ },
38516
38825
  "notificationRules.getConditionCatalog": {
38517
38826
  capName: "notification-rules",
38518
38827
  capScope: "system",
@@ -39023,6 +39332,12 @@ Object.freeze({
39023
39332
  addonId: null,
39024
39333
  access: "create"
39025
39334
  },
39335
+ "pipelineAnalytics.readLongTermSeries": {
39336
+ capName: "pipeline-analytics",
39337
+ capScope: "device",
39338
+ addonId: null,
39339
+ access: "view"
39340
+ },
39026
39341
  "pipelineAnalytics.rebuildObjectEmbeddings": {
39027
39342
  capName: "pipeline-analytics",
39028
39343
  capScope: "device",
@@ -39695,6 +40010,12 @@ Object.freeze({
39695
40010
  addonId: null,
39696
40011
  access: "create"
39697
40012
  },
40013
+ "pipelineRunner.requestOccupancyBurst": {
40014
+ capName: "pipeline-runner",
40015
+ capScope: "system",
40016
+ addonId: null,
40017
+ access: "create"
40018
+ },
39698
40019
  "pipelineRunner.runDetailSubtree": {
39699
40020
  capName: "pipeline-runner",
39700
40021
  capScope: "system",
@@ -42475,11 +42796,21 @@ Object.freeze({
42475
42796
  form: "single",
42476
42797
  optional: false
42477
42798
  }],
42799
+ "nativeObjectDetection.getOptions": [{
42800
+ name: "deviceId",
42801
+ form: "single",
42802
+ optional: false
42803
+ }],
42478
42804
  "nativeObjectDetection.setEnabled": [{
42479
42805
  name: "deviceId",
42480
42806
  form: "single",
42481
42807
  optional: false
42482
42808
  }],
42809
+ "nativeObjectDetection.setSettings": [{
42810
+ name: "deviceId",
42811
+ form: "single",
42812
+ optional: false
42813
+ }],
42483
42814
  "navigation.getFeatures": [{
42484
42815
  name: "deviceId",
42485
42816
  form: "single",
@@ -42829,6 +43160,11 @@ Object.freeze({
42829
43160
  form: "single",
42830
43161
  optional: false
42831
43162
  }],
43163
+ "pipelineAnalytics.readLongTermSeries": [{
43164
+ name: "deviceId",
43165
+ form: "single",
43166
+ optional: false
43167
+ }],
42832
43168
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42833
43169
  name: "deviceId",
42834
43170
  form: "single",
@@ -43019,6 +43355,11 @@ Object.freeze({
43019
43355
  form: "single",
43020
43356
  optional: false
43021
43357
  }],
43358
+ "pipelineRunner.requestOccupancyBurst": [{
43359
+ name: "deviceId",
43360
+ form: "single",
43361
+ optional: false
43362
+ }],
43022
43363
  "pipelineRunner.runDetailSubtree": [{
43023
43364
  name: "deviceId",
43024
43365
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5399,7 +5399,7 @@ var ZodIssueCode = {
5399
5399
  var ZodFirstPartyTypeKind;
5400
5400
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5401
5401
  //#endregion
5402
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5402
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5403
5403
  /**
5404
5404
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5405
5405
  * window to float samples (D455).
@@ -11786,6 +11786,21 @@ var streamSignalsCapability = {
11786
11786
  mode: "singleton",
11787
11787
  deviceTypes: Object.values(DeviceType),
11788
11788
  runtimeState: StreamSignalsStatusSchema,
11789
+ /**
11790
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11791
+ *
11792
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11793
+ * not an operator choice: the provider re-declares it on every registration,
11794
+ * so losing it loses nothing and persisting it would freeze an answer the
11795
+ * camera is entitled to change. Measured the same day on the sibling case —
11796
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11797
+ * class the camera really detected stayed missing for the life of the row
11798
+ * because the fix could not reach it.
11799
+ *
11800
+ * See `RuntimeStateDurability`. Enforced by
11801
+ * `scripts/check-runtime-state-durability.ts`.
11802
+ */
11803
+ durability: "session",
11789
11804
  methods: {
11790
11805
  /**
11791
11806
  * What this device can emit. Empty is a valid and common answer — most
@@ -18417,6 +18432,48 @@ var NcAlarmConfigSchema = object({
18417
18432
  settings: NcAlarmSettingsSchema,
18418
18433
  coverage: array(NcAlarmModeCoverageSchema)
18419
18434
  });
18435
+ /**
18436
+ * ONE rule's demand on ONE camera's clip ring.
18437
+ *
18438
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18439
+ * camera, so the answer stays a faithful description of the rules and the
18440
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18441
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18442
+ * a different thing from never having been told, and only the envelope
18443
+ * (`rulesLoaded`) can tell those apart.
18444
+ */
18445
+ var NcClipRetentionAskSchema = object({
18446
+ /**
18447
+ * The camera this ask is about. **Absent = every camera**, which is what a
18448
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18449
+ * asking everywhere.
18450
+ */
18451
+ deviceId: number().int().nonnegative().optional(),
18452
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18453
+ * needs nothing produces no ask at all. */
18454
+ seconds: number().min(0).max(60),
18455
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18456
+ * assigned, which is what the cut defaults to. */
18457
+ profile: CamProfileSchema.optional(),
18458
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18459
+ ruleId: string(),
18460
+ ruleName: string(),
18461
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18462
+ reason: _enum(["window", "occupancy"])
18463
+ });
18464
+ /**
18465
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18466
+ *
18467
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18468
+ * once. A centre that is up but has not read its rules yet answers with an
18469
+ * empty ask list that means nothing at all — applying it would drop every
18470
+ * camera's ring to zero for the first events after a restart, which is the
18471
+ * footage this mechanism exists to keep.
18472
+ */
18473
+ var NcClipRetentionPlanSchema = object({
18474
+ rulesLoaded: boolean(),
18475
+ asks: array(NcClipRetentionAskSchema).readonly()
18476
+ });
18420
18477
  method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
18421
18478
  kind: "mutation",
18422
18479
  auth: "admin",
@@ -18437,7 +18494,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18437
18494
  }), object({ success: literal(true) }), {
18438
18495
  kind: "mutation",
18439
18496
  auth: "admin"
18440
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18497
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18441
18498
  deviceId: number().int(),
18442
18499
  muted: boolean()
18443
18500
  }), object({ success: literal(true) }), {
@@ -19622,13 +19679,26 @@ var TrackAudioLabelSchema = object({
19622
19679
  * - `audio` — an audio event on the camera itself that was anomalous for
19623
19680
  * THAT camera, loud, and heard while nothing visual was happening (D62).
19624
19681
  *
19682
+ * - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
19683
+ * that frame's pixel space. A real root detector and a SPATIAL one: its
19684
+ * boxes are the same kind of fact `pipeline`'s are, produced by a different
19685
+ * detector.
19686
+ *
19687
+ * `onboard` was missing here while `DetectionSourceSchema` already had it, so
19688
+ * a persisted onboard track failed `safeParse` on read and came back with NO
19689
+ * source at all — which `isSpatialTrack` then admitted by accident, through the
19690
+ * `undefined` arm rather than by anybody's decision, and which `excludeSources`
19691
+ * could not name.
19692
+ *
19625
19693
  * The spatial subsystems (tracker association, occupancy count, re-id /
19626
19694
  * embedding, resurrection) MUST skip every synthetic source. Test for that
19627
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
19628
- * check silently readmits every source added after it was written.
19695
+ * with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
19696
+ * `!== 'sensor'` check silently readmits every source added after it was
19697
+ * written.
19629
19698
  */
19630
19699
  var TrackSourceSchema = _enum([
19631
19700
  "pipeline",
19701
+ "onboard",
19632
19702
  "sensor",
19633
19703
  "audio"
19634
19704
  ]);
@@ -21011,6 +21081,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
21011
21081
  * solid is this track", cheaper than re-deriving it from a trajectory. */
21012
21082
  framesMatched: number().int()
21013
21083
  })).readonly() });
21084
+ /**
21085
+ * The long-term series a camera produces. A closed union so a typo cannot
21086
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21087
+ * is an alias of this, not a second list.
21088
+ */
21089
+ var AnalyticsLtsSeriesSchema = _enum([
21090
+ "motion",
21091
+ "audio-dbfs",
21092
+ "battery",
21093
+ "occupancy"
21094
+ ]);
21095
+ /**
21096
+ * One closed 5-minute bucket of a long-term series.
21097
+ *
21098
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21099
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21100
+ * that exists at all was measured; a bucket that is absent was not, which is a
21101
+ * different claim from zero and the reason this is a sparse series.
21102
+ */
21103
+ var LtsBucketSchema = object({
21104
+ scope: string(),
21105
+ bucketStart: number().int(),
21106
+ samples: number().int().nonnegative(),
21107
+ sum: number(),
21108
+ min: number(),
21109
+ max: number()
21110
+ });
21014
21111
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
21015
21112
  deviceId: number(),
21016
21113
  trackId: string()
@@ -21057,6 +21154,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21057
21154
  kinds: array(string()).optional(),
21058
21155
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
21059
21156
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
21157
+ deviceId: number(),
21158
+ series: AnalyticsLtsSeriesSchema,
21159
+ /** Omit for EVERY scope of this series in the range. */
21160
+ scope: string().optional(),
21161
+ from: number(),
21162
+ to: number(),
21163
+ limit: number().int().positive().optional()
21164
+ }), array(LtsBucketSchema).readonly()), method(object({
21060
21165
  deviceId: number(),
21061
21166
  since: number(),
21062
21167
  until: number(),
@@ -21675,6 +21780,40 @@ var MotionSourceEnum = _enum([
21675
21780
  */
21676
21781
  var MotionSourcesSchema = array(MotionSourceEnum);
21677
21782
  /**
21783
+ * Which root detector a camera runs — EXACTLY ONE.
21784
+ *
21785
+ * Deliberately the SAME vocabulary post-analysis already tags every detection
21786
+ * with (`DetectionSource`) rather than a second spelling of the same two
21787
+ * ideas: the value an operator picks here is the value that comes back on the
21788
+ * track, the overlay and the debug row.
21789
+ *
21790
+ * ## Why one, and why it is still an array
21791
+ *
21792
+ * Two roots on one camera is a capability nobody asked for and the operator has
21793
+ * since ruled out. It was never free: both planes feed the SAME per-device
21794
+ * stationary registry, both can promote the same parked object, and the two
21795
+ * detectors disagree about the same box by construction — which is the
21796
+ * disagreement D505 had to arbitrate. Removing the case removes the arbitration.
21797
+ *
21798
+ * The ARRAY shape survives because the stored settings and the attach payload
21799
+ * already speak it on every camera of every fleet, and a cap input that
21800
+ * suddenly refuses a stored value makes the camera un-attachable — a fail-closed
21801
+ * in the one direction that costs an operator their cameras. So the wire stays
21802
+ * tolerant and the TYPE is exact: a longer list is truncated to its first
21803
+ * element rather than refused, and `max(1)` is what every consumer can then
21804
+ * rely on.
21805
+ *
21806
+ * AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
21807
+ * a camera an operator left with no root detector — and `planDetectionSources`
21808
+ * has always said so: inventing a root for them is how a default acts without
21809
+ * anybody choosing it. Tightening this to `length(1)` broke that, and the
21810
+ * suite caught it.
21811
+ *
21812
+ * Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
21813
+ * `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
21814
+ */
21815
+ var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
21816
+ /**
21678
21817
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21679
21818
  * so cap-side consumers (the orchestrator forward, the runner addon's
21680
21819
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21825,6 +21964,35 @@ var RunnerCameraConfigSchema = object({
21825
21964
  * events; the orchestrator forwards to `reportMotion`.
21826
21965
  */
21827
21966
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21967
+ /**
21968
+ * WHICH root detector runs for this camera. The detection counterpart of
21969
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21970
+ * of sources the system understands, vendor-agnostic, owned here.
21971
+ *
21972
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21973
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21974
+ * here. Its boxes reach post-analysis on the same
21975
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21976
+ * track gets the same tracker, the same overlay and the same detail
21977
+ * subtree (face / plate / embedding).
21978
+ *
21979
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21980
+ * run, and that is where a camera with a usable onboard detector buys back
21981
+ * its share of the accelerator. It saves the root inference, not the decode
21982
+ * — the detail subtree still needs pixels to cut crops from.
21983
+ *
21984
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21985
+ * step at all (there is nothing to track), and the cap that knows this says
21986
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21987
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21988
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21989
+ * worth exactly what it already is — a wake signal with a class.
21990
+ *
21991
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21992
+ * vendor never turns a detector on for the operator, and neither does a
21993
+ * default.
21994
+ */
21995
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21828
21996
  pipelineEnabled: boolean().default(true),
21829
21997
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21830
21998
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -22006,7 +22174,47 @@ var RunnerLocalMetricsSchema = object({
22006
22174
  queueDepth: number(),
22007
22175
  frameLazy: FrameLazyMetricsSchema.optional()
22008
22176
  });
22177
+ /**
22178
+ * Pipeline Runner capability — runtime detection workhorse.
22179
+ *
22180
+ * One instance per node. Receives camera assignments from
22181
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22182
+ * decoded frames, drains motion + detection queues, calls the local
22183
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22184
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22185
+ * the bus.
22186
+ *
22187
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22188
+ * runner has zero knowledge of other agents, no global state, and never
22189
+ * makes assignment decisions itself.
22190
+ */
22191
+ /**
22192
+ * Why a runner declined to look at a camera out of band. Named rather than a
22193
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22194
+ * already mid-session and one already bursting are four different facts, and a
22195
+ * caller told only "no" cannot tell a protection from a bug.
22196
+ */
22197
+ var OccupancyBurstRefusalSchema = _enum([
22198
+ "not-attached",
22199
+ "battery-asleep",
22200
+ "not-watching",
22201
+ "already-bursting"
22202
+ ]);
22009
22203
  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({
22204
+ deviceId: number(),
22205
+ /** How many frames to collect. The caller sizes this against what its
22206
+ * own confirmation needs; the runner clamps it to the field's range. */
22207
+ frames: number().int().positive().optional(),
22208
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22209
+ * defend — the periodic one at least has a timer to point at. */
22210
+ reason: string()
22211
+ }), object({
22212
+ started: boolean(),
22213
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22214
+ }), {
22215
+ auth: "admin",
22216
+ kind: "mutation"
22217
+ }), method(object({
22010
22218
  handle: FrameHandleSchema,
22011
22219
  bbox: NativeCropBboxSchema,
22012
22220
  maxWidth: number().int().positive().optional(),
@@ -28853,11 +29061,46 @@ var NativeObjectDetectionStatusSchema = object({
28853
29061
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28854
29062
  /**
28855
29063
  * Whether forwarding of onboard AI detections is enabled for this device.
28856
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28857
- * churn the tracker, so forwarding stays off until the operator enables it.
29064
+ *
29065
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
29066
+ * camera runs — that is the operator's choice, and it is made where every
29067
+ * other detection choice is made. `geometry` on
29068
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
29069
+ * choice would buy this particular camera.
28858
29070
  */
28859
29071
  enabled: boolean()
28860
29072
  });
29073
+ /**
29074
+ * WHEN a camera's onboard detections carry geometry.
29075
+ *
29076
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
29077
+ * a detection is a trackable subject whenever the camera sees one.
29078
+ * - `while-streaming` — only while some stream of this camera is already open.
29079
+ * The boxes ride the video's own side-channel rather than a feed of their
29080
+ * own, so they cost nothing and they exist only when something is pulling.
29081
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
29082
+ * radio drain, but a camera that is awake is awake precisely because
29083
+ * something is in front of it, and its stream is already being pulled.
29084
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
29085
+ * pipeline needs geometry to make a subject, so such a push reaches the
29086
+ * tracker as motion and no further.
29087
+ *
29088
+ * Reported and not inferred, because the operator's question in front of the
29089
+ * picker is "what do I get", and these are three different answers (D14: the
29090
+ * derived form is only as honest as `getOptions`).
29091
+ */
29092
+ var NativeObjectGeometryEnum = _enum([
29093
+ "boxed",
29094
+ "while-streaming",
29095
+ "flag-only"
29096
+ ]);
29097
+ var NativeObjectDetectionOptionsSchema = object({
29098
+ /** Classes this firmware can detect — the same list the status reports. */
29099
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
29100
+ /** What a detection from this camera carries. */
29101
+ geometry: NativeObjectGeometryEnum
29102
+ });
29103
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28861
29104
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28862
29105
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28863
29106
  lastFetchedAt: number() });
@@ -28867,13 +29110,23 @@ var nativeObjectDetectionCapability = {
28867
29110
  deviceNative: true,
28868
29111
  mode: "singleton",
28869
29112
  deviceTypes: [DeviceType.Camera],
28870
- methods: { setEnabled: method(object({
28871
- deviceId: number(),
28872
- enabled: boolean()
28873
- }), _void(), {
28874
- kind: "mutation",
28875
- auth: "admin"
28876
- }) },
29113
+ methods: {
29114
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29115
+ setSettings: method(object({
29116
+ deviceId: number(),
29117
+ settings: NativeObjectDetectionSettingsPatchSchema
29118
+ }), _void(), {
29119
+ kind: "mutation",
29120
+ auth: "admin"
29121
+ }),
29122
+ setEnabled: method(object({
29123
+ deviceId: number(),
29124
+ enabled: boolean()
29125
+ }), _void(), {
29126
+ kind: "mutation",
29127
+ auth: "admin"
29128
+ })
29129
+ },
28877
29130
  events: { onDetected: { data: object({
28878
29131
  deviceId: number(),
28879
29132
  detection: NativeDetectionSchema
@@ -33721,7 +33974,28 @@ var PerScopeBreakdownSchema = object({
33721
33974
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33722
33975
  totalObjects: number().int().nonnegative(),
33723
33976
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33724
- byClass: record(string(), number().int().nonnegative())
33977
+ byClass: record(string(), number().int().nonnegative()),
33978
+ /**
33979
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33980
+ * present but not going anywhere (a parked car, a bin, a statue).
33981
+ *
33982
+ * The operator's question about a scene has two halves and they answer
33983
+ * different things: "what is parked here" is stable for hours and must not
33984
+ * flap, while "who is walking through" is the thing an alert is about. One
33985
+ * number could only serve one of them, and `totalObjects` served the first
33986
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33987
+ *
33988
+ * `standing + transient === totalObjects`, always. The total keeps its old
33989
+ * meaning exactly, so no rule written against it changes behaviour.
33990
+ *
33991
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33992
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33993
+ * parked objects here" about a camera whose lot is full.
33994
+ */
33995
+ standingObjects: number().int().nonnegative().optional(),
33996
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33997
+ * same absence rule. */
33998
+ transientObjects: number().int().nonnegative().optional()
33725
33999
  });
33726
34000
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33727
34001
  zoneId: string(),
@@ -33844,6 +34118,23 @@ var HistoryPointSchema = object({
33844
34118
  * triple covers the three spatial scopes (per-zone, frame-wide,
33845
34119
  * outside-any-zone). Crossing them with `className?` gives the full
33846
34120
  * combinatorial coverage the operator UI requested.
34121
+ *
34122
+ * ## ⚠️ The three history methods are DEPRECATED
34123
+ *
34124
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34125
+ * so after a restart they report nothing about a night that did happen, and any
34126
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34127
+ * an empty scene. The presets in the occupancy chart existed to hide that
34128
+ * horizon rather than to answer a question.
34129
+ *
34130
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34131
+ * instead. Those rows are already written for every camera, ~60 bytes per
34132
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34133
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34134
+ * function the writer uses, so the two cannot drift.
34135
+ *
34136
+ * The ring stays until these three go, and it is the only thing left reading
34137
+ * it. Do not add a fourth caller.
33847
34138
  */
33848
34139
  var zoneAnalyticsCapability = {
33849
34140
  name: "zone-analytics",
@@ -38243,12 +38534,24 @@ Object.freeze({
38243
38534
  addonId: null,
38244
38535
  access: "create"
38245
38536
  },
38537
+ "nativeObjectDetection.getOptions": {
38538
+ capName: "native-object-detection",
38539
+ capScope: "device",
38540
+ addonId: null,
38541
+ access: "view"
38542
+ },
38246
38543
  "nativeObjectDetection.setEnabled": {
38247
38544
  capName: "native-object-detection",
38248
38545
  capScope: "device",
38249
38546
  addonId: null,
38250
38547
  access: "create"
38251
38548
  },
38549
+ "nativeObjectDetection.setSettings": {
38550
+ capName: "native-object-detection",
38551
+ capScope: "device",
38552
+ addonId: null,
38553
+ access: "create"
38554
+ },
38252
38555
  "navigation.getFeatures": {
38253
38556
  capName: "navigation",
38254
38557
  capScope: "device",
@@ -38513,6 +38816,12 @@ Object.freeze({
38513
38816
  addonId: null,
38514
38817
  access: "view"
38515
38818
  },
38819
+ "notificationRules.getClipRetentionAsks": {
38820
+ capName: "notification-rules",
38821
+ capScope: "system",
38822
+ addonId: null,
38823
+ access: "view"
38824
+ },
38516
38825
  "notificationRules.getConditionCatalog": {
38517
38826
  capName: "notification-rules",
38518
38827
  capScope: "system",
@@ -39023,6 +39332,12 @@ Object.freeze({
39023
39332
  addonId: null,
39024
39333
  access: "create"
39025
39334
  },
39335
+ "pipelineAnalytics.readLongTermSeries": {
39336
+ capName: "pipeline-analytics",
39337
+ capScope: "device",
39338
+ addonId: null,
39339
+ access: "view"
39340
+ },
39026
39341
  "pipelineAnalytics.rebuildObjectEmbeddings": {
39027
39342
  capName: "pipeline-analytics",
39028
39343
  capScope: "device",
@@ -39695,6 +40010,12 @@ Object.freeze({
39695
40010
  addonId: null,
39696
40011
  access: "create"
39697
40012
  },
40013
+ "pipelineRunner.requestOccupancyBurst": {
40014
+ capName: "pipeline-runner",
40015
+ capScope: "system",
40016
+ addonId: null,
40017
+ access: "create"
40018
+ },
39698
40019
  "pipelineRunner.runDetailSubtree": {
39699
40020
  capName: "pipeline-runner",
39700
40021
  capScope: "system",
@@ -42475,11 +42796,21 @@ Object.freeze({
42475
42796
  form: "single",
42476
42797
  optional: false
42477
42798
  }],
42799
+ "nativeObjectDetection.getOptions": [{
42800
+ name: "deviceId",
42801
+ form: "single",
42802
+ optional: false
42803
+ }],
42478
42804
  "nativeObjectDetection.setEnabled": [{
42479
42805
  name: "deviceId",
42480
42806
  form: "single",
42481
42807
  optional: false
42482
42808
  }],
42809
+ "nativeObjectDetection.setSettings": [{
42810
+ name: "deviceId",
42811
+ form: "single",
42812
+ optional: false
42813
+ }],
42483
42814
  "navigation.getFeatures": [{
42484
42815
  name: "deviceId",
42485
42816
  form: "single",
@@ -42829,6 +43160,11 @@ Object.freeze({
42829
43160
  form: "single",
42830
43161
  optional: false
42831
43162
  }],
43163
+ "pipelineAnalytics.readLongTermSeries": [{
43164
+ name: "deviceId",
43165
+ form: "single",
43166
+ optional: false
43167
+ }],
42832
43168
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42833
43169
  name: "deviceId",
42834
43170
  form: "single",
@@ -43019,6 +43355,11 @@ Object.freeze({
43019
43355
  form: "single",
43020
43356
  optional: false
43021
43357
  }],
43358
+ "pipelineRunner.requestOccupancyBurst": [{
43359
+ name: "deviceId",
43360
+ form: "single",
43361
+ optional: false
43362
+ }],
43022
43363
  "pipelineRunner.runDetailSubtree": [{
43023
43364
  name: "deviceId",
43024
43365
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-import-alexa",
3
- "version": "0.2.101",
3
+ "version": "0.2.103",
4
4
  "description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
5
5
  "keywords": [
6
6
  "camstack",
@@ -68,7 +68,7 @@
68
68
  "dev": "vite build --watch",
69
69
  "typecheck": "tsc --noEmit",
70
70
  "test": "vitest run",
71
- "publish": "npm publish --access public"
71
+ "publish:npm": "npm publish --access public"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@camstack/types": "*",