@camstack/addon-provider-rtsp 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
@@ -12431,7 +12431,8 @@ var PipelineStepInputSchema = lazy(() => object({
12431
12431
  modelId: string().optional(),
12432
12432
  enabled: boolean().default(true),
12433
12433
  children: array(PipelineStepInputSchema).optional(),
12434
- settings: record(string(), unknown()).optional()
12434
+ settings: record(string(), unknown()).optional(),
12435
+ jumpDeviceKey: string().optional()
12435
12436
  }));
12436
12437
  var ModelSubstitutionSchema = object({
12437
12438
  addonId: string(),
@@ -12770,10 +12771,40 @@ var NativeCropBboxSchema = object({
12770
12771
  });
12771
12772
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12772
12773
  var NativeCropResultSchema = object({
12773
- /** Packed rgb (24-bit) pixels of the crop. */
12774
- bytes: _instanceof(Uint8Array),
12774
+ /**
12775
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12776
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12777
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12778
+ * path below), where shipping raw RGB is both an invariant violation and, for
12779
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12780
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12781
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12782
+ */
12783
+ bytes: _instanceof(Uint8Array).optional(),
12784
+ /**
12785
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12786
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12787
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12788
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12789
+ * set `encodeJpeg: true`; `bytes` is then absent.
12790
+ */
12791
+ jpeg: string().optional(),
12775
12792
  width: number().int().positive(),
12776
- height: number().int().positive()
12793
+ height: number().int().positive(),
12794
+ /**
12795
+ * Which source served this crop, so a quality-sensitive consumer (the native
12796
+ * `keyFrame`) can reject a degraded fallback:
12797
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12798
+ * quality path).
12799
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12800
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12801
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12802
+ *
12803
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12804
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12805
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12806
+ */
12807
+ tier: _enum(["native", "ram-fullframe"]).optional()
12777
12808
  });
12778
12809
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12779
12810
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12903,6 +12934,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12903
12934
  hubHostnameOverride: string().optional()
12904
12935
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12905
12936
  /**
12937
+ * One ENABLED inference device on the runner's node, as the step-tree
12938
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12939
+ * roster on the attach payload whenever the camera is elected onto a specific
12940
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12941
+ * runner auto-jumps an enrichment step to when the elected device's format
12942
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12943
+ * per-device knobs so the auto choice is weighted-least-loaded.
12944
+ */
12945
+ var RunnerInferenceDeviceSchema = object({
12946
+ deviceKey: string(),
12947
+ weight: number().positive().default(1),
12948
+ maxSessions: number().int().positive().nullable().default(null)
12949
+ });
12950
+ /**
12906
12951
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12907
12952
  * specific runner instance via `attachCamera`. Carries everything the
12908
12953
  * runner needs to subscribe to the local broker and execute inference.
@@ -13020,7 +13065,16 @@ var RunnerCameraConfigSchema = object({
13020
13065
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
13021
13066
  * this only selects WHICH device pool of that node runs the session.
13022
13067
  */
13023
- deviceKey: string().optional()
13068
+ deviceKey: string().optional(),
13069
+ /**
13070
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
13071
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
13072
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
13073
+ * step whose model has no build for the elected device's format onto another
13074
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
13075
+ * ⇒ no jump possible; the step runs on `deviceKey`.
13076
+ */
13077
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
13024
13078
  });
13025
13079
  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;
13026
13080
  /**
@@ -13076,7 +13130,18 @@ var RunnerLocalMetricsSchema = object({
13076
13130
  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({
13077
13131
  handle: FrameHandleSchema,
13078
13132
  bbox: NativeCropBboxSchema,
13079
- maxWidth: number().int().positive().optional()
13133
+ maxWidth: number().int().positive().optional(),
13134
+ /**
13135
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13136
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13137
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13138
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13139
+ * no raw pixels cross the process boundary. Same-node callers omit it
13140
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13141
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13142
+ * the caller falls back to encoding locally.
13143
+ */
13144
+ encodeJpeg: boolean().optional()
13080
13145
  }), NativeCropResultSchema.nullable()), method(object({
13081
13146
  deviceId: number(),
13082
13147
  frameHandle: FrameHandleSchema.optional(),
@@ -17777,7 +17842,8 @@ var LinkedDeviceSchema = object({
17777
17842
  deviceId: number(),
17778
17843
  name: string(),
17779
17844
  location: string().nullable(),
17780
- features: array(string())
17845
+ features: array(string()),
17846
+ producesTrackedEvents: boolean().optional()
17781
17847
  });
17782
17848
  var SavedDeviceRowSchema = object({
17783
17849
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19407,6 +19473,7 @@ var TrackSchema = object({
19407
19473
  deviceId: number(),
19408
19474
  className: string(),
19409
19475
  label: string().optional(),
19476
+ producingDeviceName: string().optional(),
19410
19477
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19411
19478
  source: TrackSourceSchema.optional(),
19412
19479
  firstSeen: number(),
@@ -19544,7 +19611,8 @@ var MediaFileKindEnum = _enum([
19544
19611
  "fullFrameBoxed",
19545
19612
  "faceCrop",
19546
19613
  "plateCrop",
19547
- "keyFrame"
19614
+ "keyFrame",
19615
+ "keyFrameSmall"
19548
19616
  ]);
19549
19617
  var MediaFileSchema = object({
19550
19618
  key: string(),
@@ -19875,7 +19943,16 @@ var PipelineTemplateSchema = object({
19875
19943
  });
19876
19944
  var DeviceStepConfigSchema = object({
19877
19945
  modelId: string().optional(),
19878
- settings: record(string(), unknown()).optional()
19946
+ settings: record(string(), unknown()).optional(),
19947
+ /**
19948
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19949
+ * When set, this step runs on the named enabled device of the SAME node
19950
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19951
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19952
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19953
+ * auto-jumps only when the effective device's format cannot run the step.
19954
+ */
19955
+ jumpDeviceKey: string().optional()
19879
19956
  });
19880
19957
  var AgentPipelineSettingsSchema = object({
19881
19958
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/addon.mjs CHANGED
@@ -12407,7 +12407,8 @@ var PipelineStepInputSchema = lazy(() => object({
12407
12407
  modelId: string().optional(),
12408
12408
  enabled: boolean().default(true),
12409
12409
  children: array(PipelineStepInputSchema).optional(),
12410
- settings: record(string(), unknown()).optional()
12410
+ settings: record(string(), unknown()).optional(),
12411
+ jumpDeviceKey: string().optional()
12411
12412
  }));
12412
12413
  var ModelSubstitutionSchema = object({
12413
12414
  addonId: string(),
@@ -12746,10 +12747,40 @@ var NativeCropBboxSchema = object({
12746
12747
  });
12747
12748
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12748
12749
  var NativeCropResultSchema = object({
12749
- /** Packed rgb (24-bit) pixels of the crop. */
12750
- bytes: _instanceof(Uint8Array),
12750
+ /**
12751
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12752
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12753
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12754
+ * path below), where shipping raw RGB is both an invariant violation and, for
12755
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12756
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12757
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12758
+ */
12759
+ bytes: _instanceof(Uint8Array).optional(),
12760
+ /**
12761
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12762
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12763
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12764
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12765
+ * set `encodeJpeg: true`; `bytes` is then absent.
12766
+ */
12767
+ jpeg: string().optional(),
12751
12768
  width: number().int().positive(),
12752
- height: number().int().positive()
12769
+ height: number().int().positive(),
12770
+ /**
12771
+ * Which source served this crop, so a quality-sensitive consumer (the native
12772
+ * `keyFrame`) can reject a degraded fallback:
12773
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12774
+ * quality path).
12775
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12776
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12777
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12778
+ *
12779
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12780
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12781
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12782
+ */
12783
+ tier: _enum(["native", "ram-fullframe"]).optional()
12753
12784
  });
12754
12785
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12755
12786
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12879,6 +12910,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12879
12910
  hubHostnameOverride: string().optional()
12880
12911
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12881
12912
  /**
12913
+ * One ENABLED inference device on the runner's node, as the step-tree
12914
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12915
+ * roster on the attach payload whenever the camera is elected onto a specific
12916
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12917
+ * runner auto-jumps an enrichment step to when the elected device's format
12918
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12919
+ * per-device knobs so the auto choice is weighted-least-loaded.
12920
+ */
12921
+ var RunnerInferenceDeviceSchema = object({
12922
+ deviceKey: string(),
12923
+ weight: number().positive().default(1),
12924
+ maxSessions: number().int().positive().nullable().default(null)
12925
+ });
12926
+ /**
12882
12927
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12883
12928
  * specific runner instance via `attachCamera`. Carries everything the
12884
12929
  * runner needs to subscribe to the local broker and execute inference.
@@ -12996,7 +13041,16 @@ var RunnerCameraConfigSchema = object({
12996
13041
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12997
13042
  * this only selects WHICH device pool of that node runs the session.
12998
13043
  */
12999
- deviceKey: string().optional()
13044
+ deviceKey: string().optional(),
13045
+ /**
13046
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
13047
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
13048
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
13049
+ * step whose model has no build for the elected device's format onto another
13050
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
13051
+ * ⇒ no jump possible; the step runs on `deviceKey`.
13052
+ */
13053
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
13000
13054
  });
13001
13055
  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;
13002
13056
  /**
@@ -13052,7 +13106,18 @@ var RunnerLocalMetricsSchema = object({
13052
13106
  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({
13053
13107
  handle: FrameHandleSchema,
13054
13108
  bbox: NativeCropBboxSchema,
13055
- maxWidth: number().int().positive().optional()
13109
+ maxWidth: number().int().positive().optional(),
13110
+ /**
13111
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13112
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13113
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13114
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13115
+ * no raw pixels cross the process boundary. Same-node callers omit it
13116
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13117
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13118
+ * the caller falls back to encoding locally.
13119
+ */
13120
+ encodeJpeg: boolean().optional()
13056
13121
  }), NativeCropResultSchema.nullable()), method(object({
13057
13122
  deviceId: number(),
13058
13123
  frameHandle: FrameHandleSchema.optional(),
@@ -17753,7 +17818,8 @@ var LinkedDeviceSchema = object({
17753
17818
  deviceId: number(),
17754
17819
  name: string(),
17755
17820
  location: string().nullable(),
17756
- features: array(string())
17821
+ features: array(string()),
17822
+ producesTrackedEvents: boolean().optional()
17757
17823
  });
17758
17824
  var SavedDeviceRowSchema = object({
17759
17825
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19383,6 +19449,7 @@ var TrackSchema = object({
19383
19449
  deviceId: number(),
19384
19450
  className: string(),
19385
19451
  label: string().optional(),
19452
+ producingDeviceName: string().optional(),
19386
19453
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19387
19454
  source: TrackSourceSchema.optional(),
19388
19455
  firstSeen: number(),
@@ -19520,7 +19587,8 @@ var MediaFileKindEnum = _enum([
19520
19587
  "fullFrameBoxed",
19521
19588
  "faceCrop",
19522
19589
  "plateCrop",
19523
- "keyFrame"
19590
+ "keyFrame",
19591
+ "keyFrameSmall"
19524
19592
  ]);
19525
19593
  var MediaFileSchema = object({
19526
19594
  key: string(),
@@ -19851,7 +19919,16 @@ var PipelineTemplateSchema = object({
19851
19919
  });
19852
19920
  var DeviceStepConfigSchema = object({
19853
19921
  modelId: string().optional(),
19854
- settings: record(string(), unknown()).optional()
19922
+ settings: record(string(), unknown()).optional(),
19923
+ /**
19924
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19925
+ * When set, this step runs on the named enabled device of the SAME node
19926
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19927
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19928
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19929
+ * auto-jumps only when the effective device's format cannot run the step.
19930
+ */
19931
+ jumpDeviceKey: string().optional()
19855
19932
  });
19856
19933
  var AgentPipelineSettingsSchema = object({
19857
19934
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-rtsp",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Generic RTSP camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",