@camstack/addon-provider-onvif 1.2.0 → 1.2.2

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.
package/dist/addon.js CHANGED
@@ -11199,7 +11199,8 @@ var PipelineStepInputSchema = lazy(() => object({
11199
11199
  modelId: string().optional(),
11200
11200
  enabled: boolean().default(true),
11201
11201
  children: array(PipelineStepInputSchema).optional(),
11202
- settings: record(string(), unknown()).optional()
11202
+ settings: record(string(), unknown()).optional(),
11203
+ jumpDeviceKey: string().optional()
11203
11204
  }));
11204
11205
  var ModelSubstitutionSchema = object({
11205
11206
  addonId: string(),
@@ -11505,10 +11506,40 @@ var NativeCropBboxSchema = object({
11505
11506
  });
11506
11507
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11507
11508
  var NativeCropResultSchema = object({
11508
- /** Packed rgb (24-bit) pixels of the crop. */
11509
- bytes: _instanceof(Uint8Array),
11509
+ /**
11510
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11511
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11512
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11513
+ * path below), where shipping raw RGB is both an invariant violation and, for
11514
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11515
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11516
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11517
+ */
11518
+ bytes: _instanceof(Uint8Array).optional(),
11519
+ /**
11520
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11521
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11522
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11523
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11524
+ * set `encodeJpeg: true`; `bytes` is then absent.
11525
+ */
11526
+ jpeg: string().optional(),
11510
11527
  width: number().int().positive(),
11511
- height: number().int().positive()
11528
+ height: number().int().positive(),
11529
+ /**
11530
+ * Which source served this crop, so a quality-sensitive consumer (the native
11531
+ * `keyFrame`) can reject a degraded fallback:
11532
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11533
+ * quality path).
11534
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11535
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11536
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11537
+ *
11538
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11539
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11540
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11541
+ */
11542
+ tier: _enum(["native", "ram-fullframe"]).optional()
11512
11543
  });
11513
11544
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11514
11545
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11638,6 +11669,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11638
11669
  hubHostnameOverride: string().optional()
11639
11670
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11640
11671
  /**
11672
+ * One ENABLED inference device on the runner's node, as the step-tree
11673
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11674
+ * roster on the attach payload whenever the camera is elected onto a specific
11675
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11676
+ * runner auto-jumps an enrichment step to when the elected device's format
11677
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11678
+ * per-device knobs so the auto choice is weighted-least-loaded.
11679
+ */
11680
+ var RunnerInferenceDeviceSchema = object({
11681
+ deviceKey: string(),
11682
+ weight: number().positive().default(1),
11683
+ maxSessions: number().int().positive().nullable().default(null)
11684
+ });
11685
+ /**
11641
11686
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11642
11687
  * specific runner instance via `attachCamera`. Carries everything the
11643
11688
  * runner needs to subscribe to the local broker and execute inference.
@@ -11755,7 +11800,16 @@ var RunnerCameraConfigSchema = object({
11755
11800
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11756
11801
  * this only selects WHICH device pool of that node runs the session.
11757
11802
  */
11758
- deviceKey: string().optional()
11803
+ deviceKey: string().optional(),
11804
+ /**
11805
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11806
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11807
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11808
+ * step whose model has no build for the elected device's format onto another
11809
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11810
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11811
+ */
11812
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11759
11813
  });
11760
11814
  motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
11761
11815
  /**
@@ -11811,7 +11865,18 @@ var RunnerLocalMetricsSchema = object({
11811
11865
  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({
11812
11866
  handle: FrameHandleSchema,
11813
11867
  bbox: NativeCropBboxSchema,
11814
- maxWidth: number().int().positive().optional()
11868
+ maxWidth: number().int().positive().optional(),
11869
+ /**
11870
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11871
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11872
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11873
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11874
+ * no raw pixels cross the process boundary. Same-node callers omit it
11875
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11876
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11877
+ * the caller falls back to encoding locally.
11878
+ */
11879
+ encodeJpeg: boolean().optional()
11815
11880
  }), NativeCropResultSchema.nullable()), method(object({
11816
11881
  deviceId: number(),
11817
11882
  frameHandle: FrameHandleSchema.optional(),
@@ -15133,7 +15198,8 @@ var LinkedDeviceSchema = object({
15133
15198
  deviceId: number(),
15134
15199
  name: string(),
15135
15200
  location: string().nullable(),
15136
- features: array(string())
15201
+ features: array(string()),
15202
+ producesTrackedEvents: boolean().optional()
15137
15203
  });
15138
15204
  var SavedDeviceRowSchema = object({
15139
15205
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16763,6 +16829,7 @@ var TrackSchema = object({
16763
16829
  deviceId: number(),
16764
16830
  className: string(),
16765
16831
  label: string().optional(),
16832
+ producingDeviceName: string().optional(),
16766
16833
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16767
16834
  source: TrackSourceSchema.optional(),
16768
16835
  firstSeen: number(),
@@ -16900,7 +16967,8 @@ var MediaFileKindEnum = _enum([
16900
16967
  "fullFrameBoxed",
16901
16968
  "faceCrop",
16902
16969
  "plateCrop",
16903
- "keyFrame"
16970
+ "keyFrame",
16971
+ "keyFrameSmall"
16904
16972
  ]);
16905
16973
  var MediaFileSchema = object({
16906
16974
  key: string(),
@@ -17231,7 +17299,16 @@ var PipelineTemplateSchema = object({
17231
17299
  });
17232
17300
  var DeviceStepConfigSchema = object({
17233
17301
  modelId: string().optional(),
17234
- settings: record(string(), unknown()).optional()
17302
+ settings: record(string(), unknown()).optional(),
17303
+ /**
17304
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
17305
+ * When set, this step runs on the named enabled device of the SAME node
17306
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
17307
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
17308
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
17309
+ * auto-jumps only when the effective device's format cannot run the step.
17310
+ */
17311
+ jumpDeviceKey: string().optional()
17235
17312
  });
17236
17313
  var AgentPipelineSettingsSchema = object({
17237
17314
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/addon.mjs CHANGED
@@ -11200,7 +11200,8 @@ var PipelineStepInputSchema = lazy(() => object({
11200
11200
  modelId: string().optional(),
11201
11201
  enabled: boolean().default(true),
11202
11202
  children: array(PipelineStepInputSchema).optional(),
11203
- settings: record(string(), unknown()).optional()
11203
+ settings: record(string(), unknown()).optional(),
11204
+ jumpDeviceKey: string().optional()
11204
11205
  }));
11205
11206
  var ModelSubstitutionSchema = object({
11206
11207
  addonId: string(),
@@ -11506,10 +11507,40 @@ var NativeCropBboxSchema = object({
11506
11507
  });
11507
11508
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11508
11509
  var NativeCropResultSchema = object({
11509
- /** Packed rgb (24-bit) pixels of the crop. */
11510
- bytes: _instanceof(Uint8Array),
11510
+ /**
11511
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11512
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11513
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11514
+ * path below), where shipping raw RGB is both an invariant violation and, for
11515
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11516
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11517
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11518
+ */
11519
+ bytes: _instanceof(Uint8Array).optional(),
11520
+ /**
11521
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11522
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11523
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11524
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11525
+ * set `encodeJpeg: true`; `bytes` is then absent.
11526
+ */
11527
+ jpeg: string().optional(),
11511
11528
  width: number().int().positive(),
11512
- height: number().int().positive()
11529
+ height: number().int().positive(),
11530
+ /**
11531
+ * Which source served this crop, so a quality-sensitive consumer (the native
11532
+ * `keyFrame`) can reject a degraded fallback:
11533
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11534
+ * quality path).
11535
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11536
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11537
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11538
+ *
11539
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11540
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11541
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11542
+ */
11543
+ tier: _enum(["native", "ram-fullframe"]).optional()
11513
11544
  });
11514
11545
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11515
11546
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11639,6 +11670,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11639
11670
  hubHostnameOverride: string().optional()
11640
11671
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11641
11672
  /**
11673
+ * One ENABLED inference device on the runner's node, as the step-tree
11674
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11675
+ * roster on the attach payload whenever the camera is elected onto a specific
11676
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11677
+ * runner auto-jumps an enrichment step to when the elected device's format
11678
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11679
+ * per-device knobs so the auto choice is weighted-least-loaded.
11680
+ */
11681
+ var RunnerInferenceDeviceSchema = object({
11682
+ deviceKey: string(),
11683
+ weight: number().positive().default(1),
11684
+ maxSessions: number().int().positive().nullable().default(null)
11685
+ });
11686
+ /**
11642
11687
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11643
11688
  * specific runner instance via `attachCamera`. Carries everything the
11644
11689
  * runner needs to subscribe to the local broker and execute inference.
@@ -11756,7 +11801,16 @@ var RunnerCameraConfigSchema = object({
11756
11801
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11757
11802
  * this only selects WHICH device pool of that node runs the session.
11758
11803
  */
11759
- deviceKey: string().optional()
11804
+ deviceKey: string().optional(),
11805
+ /**
11806
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11807
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11808
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11809
+ * step whose model has no build for the elected device's format onto another
11810
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11811
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11812
+ */
11813
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11760
11814
  });
11761
11815
  motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
11762
11816
  /**
@@ -11812,7 +11866,18 @@ var RunnerLocalMetricsSchema = object({
11812
11866
  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({
11813
11867
  handle: FrameHandleSchema,
11814
11868
  bbox: NativeCropBboxSchema,
11815
- maxWidth: number().int().positive().optional()
11869
+ maxWidth: number().int().positive().optional(),
11870
+ /**
11871
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11872
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11873
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11874
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11875
+ * no raw pixels cross the process boundary. Same-node callers omit it
11876
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11877
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11878
+ * the caller falls back to encoding locally.
11879
+ */
11880
+ encodeJpeg: boolean().optional()
11816
11881
  }), NativeCropResultSchema.nullable()), method(object({
11817
11882
  deviceId: number(),
11818
11883
  frameHandle: FrameHandleSchema.optional(),
@@ -15134,7 +15199,8 @@ var LinkedDeviceSchema = object({
15134
15199
  deviceId: number(),
15135
15200
  name: string(),
15136
15201
  location: string().nullable(),
15137
- features: array(string())
15202
+ features: array(string()),
15203
+ producesTrackedEvents: boolean().optional()
15138
15204
  });
15139
15205
  var SavedDeviceRowSchema = object({
15140
15206
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16764,6 +16830,7 @@ var TrackSchema = object({
16764
16830
  deviceId: number(),
16765
16831
  className: string(),
16766
16832
  label: string().optional(),
16833
+ producingDeviceName: string().optional(),
16767
16834
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16768
16835
  source: TrackSourceSchema.optional(),
16769
16836
  firstSeen: number(),
@@ -16901,7 +16968,8 @@ var MediaFileKindEnum = _enum([
16901
16968
  "fullFrameBoxed",
16902
16969
  "faceCrop",
16903
16970
  "plateCrop",
16904
- "keyFrame"
16971
+ "keyFrame",
16972
+ "keyFrameSmall"
16905
16973
  ]);
16906
16974
  var MediaFileSchema = object({
16907
16975
  key: string(),
@@ -17232,7 +17300,16 @@ var PipelineTemplateSchema = object({
17232
17300
  });
17233
17301
  var DeviceStepConfigSchema = object({
17234
17302
  modelId: string().optional(),
17235
- settings: record(string(), unknown()).optional()
17303
+ settings: record(string(), unknown()).optional(),
17304
+ /**
17305
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
17306
+ * When set, this step runs on the named enabled device of the SAME node
17307
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
17308
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
17309
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
17310
+ * auto-jumps only when the effective device's format cannot run the step.
17311
+ */
17312
+ jumpDeviceKey: string().optional()
17236
17313
  });
17237
17314
  var AgentPipelineSettingsSchema = object({
17238
17315
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-onvif",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "ONVIF camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",