@camstack/addon-provider-hikvision 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
@@ -12582,7 +12582,8 @@ var PipelineStepInputSchema = lazy(() => object({
12582
12582
  modelId: string().optional(),
12583
12583
  enabled: boolean().default(true),
12584
12584
  children: array(PipelineStepInputSchema).optional(),
12585
- settings: record(string(), unknown()).optional()
12585
+ settings: record(string(), unknown()).optional(),
12586
+ jumpDeviceKey: string().optional()
12586
12587
  }));
12587
12588
  var ModelSubstitutionSchema = object({
12588
12589
  addonId: string(),
@@ -12921,10 +12922,40 @@ var NativeCropBboxSchema = object({
12921
12922
  });
12922
12923
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12923
12924
  var NativeCropResultSchema = object({
12924
- /** Packed rgb (24-bit) pixels of the crop. */
12925
- bytes: _instanceof(Uint8Array),
12925
+ /**
12926
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12927
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12928
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12929
+ * path below), where shipping raw RGB is both an invariant violation and, for
12930
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12931
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12932
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12933
+ */
12934
+ bytes: _instanceof(Uint8Array).optional(),
12935
+ /**
12936
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12937
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12938
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12939
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12940
+ * set `encodeJpeg: true`; `bytes` is then absent.
12941
+ */
12942
+ jpeg: string().optional(),
12926
12943
  width: number().int().positive(),
12927
- height: number().int().positive()
12944
+ height: number().int().positive(),
12945
+ /**
12946
+ * Which source served this crop, so a quality-sensitive consumer (the native
12947
+ * `keyFrame`) can reject a degraded fallback:
12948
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12949
+ * quality path).
12950
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12951
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12952
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12953
+ *
12954
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12955
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12956
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12957
+ */
12958
+ tier: _enum(["native", "ram-fullframe"]).optional()
12928
12959
  });
12929
12960
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12930
12961
  * originating detection, in FRAME-space coordinates. Reuses
@@ -13054,6 +13085,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
13054
13085
  hubHostnameOverride: string().optional()
13055
13086
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
13056
13087
  /**
13088
+ * One ENABLED inference device on the runner's node, as the step-tree
13089
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
13090
+ * roster on the attach payload whenever the camera is elected onto a specific
13091
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
13092
+ * runner auto-jumps an enrichment step to when the elected device's format
13093
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
13094
+ * per-device knobs so the auto choice is weighted-least-loaded.
13095
+ */
13096
+ var RunnerInferenceDeviceSchema = object({
13097
+ deviceKey: string(),
13098
+ weight: number().positive().default(1),
13099
+ maxSessions: number().int().positive().nullable().default(null)
13100
+ });
13101
+ /**
13057
13102
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
13058
13103
  * specific runner instance via `attachCamera`. Carries everything the
13059
13104
  * runner needs to subscribe to the local broker and execute inference.
@@ -13171,7 +13216,16 @@ var RunnerCameraConfigSchema = object({
13171
13216
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
13172
13217
  * this only selects WHICH device pool of that node runs the session.
13173
13218
  */
13174
- deviceKey: string().optional()
13219
+ deviceKey: string().optional(),
13220
+ /**
13221
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
13222
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
13223
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
13224
+ * step whose model has no build for the elected device's format onto another
13225
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
13226
+ * ⇒ no jump possible; the step runs on `deviceKey`.
13227
+ */
13228
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
13175
13229
  });
13176
13230
  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;
13177
13231
  /**
@@ -13227,7 +13281,18 @@ var RunnerLocalMetricsSchema = object({
13227
13281
  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({
13228
13282
  handle: FrameHandleSchema,
13229
13283
  bbox: NativeCropBboxSchema,
13230
- maxWidth: number().int().positive().optional()
13284
+ maxWidth: number().int().positive().optional(),
13285
+ /**
13286
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13287
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13288
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13289
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13290
+ * no raw pixels cross the process boundary. Same-node callers omit it
13291
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13292
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13293
+ * the caller falls back to encoding locally.
13294
+ */
13295
+ encodeJpeg: boolean().optional()
13231
13296
  }), NativeCropResultSchema.nullable()), method(object({
13232
13297
  deviceId: number(),
13233
13298
  frameHandle: FrameHandleSchema.optional(),
@@ -17940,7 +18005,8 @@ var LinkedDeviceSchema = object({
17940
18005
  deviceId: number(),
17941
18006
  name: string(),
17942
18007
  location: string().nullable(),
17943
- features: array(string())
18008
+ features: array(string()),
18009
+ producesTrackedEvents: boolean().optional()
17944
18010
  });
17945
18011
  var SavedDeviceRowSchema = object({
17946
18012
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19570,6 +19636,7 @@ var TrackSchema = object({
19570
19636
  deviceId: number(),
19571
19637
  className: string(),
19572
19638
  label: string().optional(),
19639
+ producingDeviceName: string().optional(),
19573
19640
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19574
19641
  source: TrackSourceSchema.optional(),
19575
19642
  firstSeen: number(),
@@ -19707,7 +19774,8 @@ var MediaFileKindEnum = _enum([
19707
19774
  "fullFrameBoxed",
19708
19775
  "faceCrop",
19709
19776
  "plateCrop",
19710
- "keyFrame"
19777
+ "keyFrame",
19778
+ "keyFrameSmall"
19711
19779
  ]);
19712
19780
  var MediaFileSchema = object({
19713
19781
  key: string(),
@@ -20038,7 +20106,16 @@ var PipelineTemplateSchema = object({
20038
20106
  });
20039
20107
  var DeviceStepConfigSchema = object({
20040
20108
  modelId: string().optional(),
20041
- settings: record(string(), unknown()).optional()
20109
+ settings: record(string(), unknown()).optional(),
20110
+ /**
20111
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
20112
+ * When set, this step runs on the named enabled device of the SAME node
20113
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
20114
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
20115
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
20116
+ * auto-jumps only when the effective device's format cannot run the step.
20117
+ */
20118
+ jumpDeviceKey: string().optional()
20042
20119
  });
20043
20120
  var AgentPipelineSettingsSchema = object({
20044
20121
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/addon.mjs CHANGED
@@ -12583,7 +12583,8 @@ var PipelineStepInputSchema = lazy(() => object({
12583
12583
  modelId: string().optional(),
12584
12584
  enabled: boolean().default(true),
12585
12585
  children: array(PipelineStepInputSchema).optional(),
12586
- settings: record(string(), unknown()).optional()
12586
+ settings: record(string(), unknown()).optional(),
12587
+ jumpDeviceKey: string().optional()
12587
12588
  }));
12588
12589
  var ModelSubstitutionSchema = object({
12589
12590
  addonId: string(),
@@ -12922,10 +12923,40 @@ var NativeCropBboxSchema = object({
12922
12923
  });
12923
12924
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12924
12925
  var NativeCropResultSchema = object({
12925
- /** Packed rgb (24-bit) pixels of the crop. */
12926
- bytes: _instanceof(Uint8Array),
12926
+ /**
12927
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12928
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12929
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12930
+ * path below), where shipping raw RGB is both an invariant violation and, for
12931
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12932
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12933
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12934
+ */
12935
+ bytes: _instanceof(Uint8Array).optional(),
12936
+ /**
12937
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12938
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12939
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12940
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12941
+ * set `encodeJpeg: true`; `bytes` is then absent.
12942
+ */
12943
+ jpeg: string().optional(),
12927
12944
  width: number().int().positive(),
12928
- height: number().int().positive()
12945
+ height: number().int().positive(),
12946
+ /**
12947
+ * Which source served this crop, so a quality-sensitive consumer (the native
12948
+ * `keyFrame`) can reject a degraded fallback:
12949
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12950
+ * quality path).
12951
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12952
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12953
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12954
+ *
12955
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12956
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12957
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12958
+ */
12959
+ tier: _enum(["native", "ram-fullframe"]).optional()
12929
12960
  });
12930
12961
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12931
12962
  * originating detection, in FRAME-space coordinates. Reuses
@@ -13055,6 +13086,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
13055
13086
  hubHostnameOverride: string().optional()
13056
13087
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
13057
13088
  /**
13089
+ * One ENABLED inference device on the runner's node, as the step-tree
13090
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
13091
+ * roster on the attach payload whenever the camera is elected onto a specific
13092
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
13093
+ * runner auto-jumps an enrichment step to when the elected device's format
13094
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
13095
+ * per-device knobs so the auto choice is weighted-least-loaded.
13096
+ */
13097
+ var RunnerInferenceDeviceSchema = object({
13098
+ deviceKey: string(),
13099
+ weight: number().positive().default(1),
13100
+ maxSessions: number().int().positive().nullable().default(null)
13101
+ });
13102
+ /**
13058
13103
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
13059
13104
  * specific runner instance via `attachCamera`. Carries everything the
13060
13105
  * runner needs to subscribe to the local broker and execute inference.
@@ -13172,7 +13217,16 @@ var RunnerCameraConfigSchema = object({
13172
13217
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
13173
13218
  * this only selects WHICH device pool of that node runs the session.
13174
13219
  */
13175
- deviceKey: string().optional()
13220
+ deviceKey: string().optional(),
13221
+ /**
13222
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
13223
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
13224
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
13225
+ * step whose model has no build for the elected device's format onto another
13226
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
13227
+ * ⇒ no jump possible; the step runs on `deviceKey`.
13228
+ */
13229
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
13176
13230
  });
13177
13231
  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;
13178
13232
  /**
@@ -13228,7 +13282,18 @@ var RunnerLocalMetricsSchema = object({
13228
13282
  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({
13229
13283
  handle: FrameHandleSchema,
13230
13284
  bbox: NativeCropBboxSchema,
13231
- maxWidth: number().int().positive().optional()
13285
+ maxWidth: number().int().positive().optional(),
13286
+ /**
13287
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13288
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13289
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13290
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13291
+ * no raw pixels cross the process boundary. Same-node callers omit it
13292
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13293
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13294
+ * the caller falls back to encoding locally.
13295
+ */
13296
+ encodeJpeg: boolean().optional()
13232
13297
  }), NativeCropResultSchema.nullable()), method(object({
13233
13298
  deviceId: number(),
13234
13299
  frameHandle: FrameHandleSchema.optional(),
@@ -17941,7 +18006,8 @@ var LinkedDeviceSchema = object({
17941
18006
  deviceId: number(),
17942
18007
  name: string(),
17943
18008
  location: string().nullable(),
17944
- features: array(string())
18009
+ features: array(string()),
18010
+ producesTrackedEvents: boolean().optional()
17945
18011
  });
17946
18012
  var SavedDeviceRowSchema = object({
17947
18013
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19571,6 +19637,7 @@ var TrackSchema = object({
19571
19637
  deviceId: number(),
19572
19638
  className: string(),
19573
19639
  label: string().optional(),
19640
+ producingDeviceName: string().optional(),
19574
19641
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19575
19642
  source: TrackSourceSchema.optional(),
19576
19643
  firstSeen: number(),
@@ -19708,7 +19775,8 @@ var MediaFileKindEnum = _enum([
19708
19775
  "fullFrameBoxed",
19709
19776
  "faceCrop",
19710
19777
  "plateCrop",
19711
- "keyFrame"
19778
+ "keyFrame",
19779
+ "keyFrameSmall"
19712
19780
  ]);
19713
19781
  var MediaFileSchema = object({
19714
19782
  key: string(),
@@ -20039,7 +20107,16 @@ var PipelineTemplateSchema = object({
20039
20107
  });
20040
20108
  var DeviceStepConfigSchema = object({
20041
20109
  modelId: string().optional(),
20042
- settings: record(string(), unknown()).optional()
20110
+ settings: record(string(), unknown()).optional(),
20111
+ /**
20112
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
20113
+ * When set, this step runs on the named enabled device of the SAME node
20114
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
20115
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
20116
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
20117
+ * auto-jumps only when the effective device's format cannot run the step.
20118
+ */
20119
+ jumpDeviceKey: string().optional()
20043
20120
  });
20044
20121
  var AgentPipelineSettingsSchema = object({
20045
20122
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-hikvision",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Hikvision camera device provider addon for CamStack — ISAPI over HTTP(S) with digest auth (snapshot, alarm stream, RTSP discovery)",
5
5
  "keywords": [
6
6
  "camstack",