@camstack/addon-decoder-ffmpeg 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/index.js CHANGED
@@ -11031,7 +11031,8 @@ var PipelineStepInputSchema = lazy(() => object({
11031
11031
  modelId: string().optional(),
11032
11032
  enabled: boolean().default(true),
11033
11033
  children: array(PipelineStepInputSchema).optional(),
11034
- settings: record(string(), unknown()).optional()
11034
+ settings: record(string(), unknown()).optional(),
11035
+ jumpDeviceKey: string().optional()
11035
11036
  }));
11036
11037
  var ModelSubstitutionSchema = object({
11037
11038
  addonId: string(),
@@ -11337,10 +11338,40 @@ var NativeCropBboxSchema = object({
11337
11338
  });
11338
11339
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11339
11340
  var NativeCropResultSchema = object({
11340
- /** Packed rgb (24-bit) pixels of the crop. */
11341
- bytes: _instanceof(Uint8Array),
11341
+ /**
11342
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11343
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11344
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11345
+ * path below), where shipping raw RGB is both an invariant violation and, for
11346
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11347
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11348
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11349
+ */
11350
+ bytes: _instanceof(Uint8Array).optional(),
11351
+ /**
11352
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11353
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11354
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11355
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11356
+ * set `encodeJpeg: true`; `bytes` is then absent.
11357
+ */
11358
+ jpeg: string().optional(),
11342
11359
  width: number().int().positive(),
11343
- height: number().int().positive()
11360
+ height: number().int().positive(),
11361
+ /**
11362
+ * Which source served this crop, so a quality-sensitive consumer (the native
11363
+ * `keyFrame`) can reject a degraded fallback:
11364
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11365
+ * quality path).
11366
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11367
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11368
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11369
+ *
11370
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11371
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11372
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11373
+ */
11374
+ tier: _enum(["native", "ram-fullframe"]).optional()
11344
11375
  });
11345
11376
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11346
11377
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11470,6 +11501,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11470
11501
  hubHostnameOverride: string().optional()
11471
11502
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11472
11503
  /**
11504
+ * One ENABLED inference device on the runner's node, as the step-tree
11505
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11506
+ * roster on the attach payload whenever the camera is elected onto a specific
11507
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11508
+ * runner auto-jumps an enrichment step to when the elected device's format
11509
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11510
+ * per-device knobs so the auto choice is weighted-least-loaded.
11511
+ */
11512
+ var RunnerInferenceDeviceSchema = object({
11513
+ deviceKey: string(),
11514
+ weight: number().positive().default(1),
11515
+ maxSessions: number().int().positive().nullable().default(null)
11516
+ });
11517
+ /**
11473
11518
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11474
11519
  * specific runner instance via `attachCamera`. Carries everything the
11475
11520
  * runner needs to subscribe to the local broker and execute inference.
@@ -11587,7 +11632,16 @@ var RunnerCameraConfigSchema = object({
11587
11632
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11588
11633
  * this only selects WHICH device pool of that node runs the session.
11589
11634
  */
11590
- deviceKey: string().optional()
11635
+ deviceKey: string().optional(),
11636
+ /**
11637
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11638
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11639
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11640
+ * step whose model has no build for the elected device's format onto another
11641
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11642
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11643
+ */
11644
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11591
11645
  });
11592
11646
  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;
11593
11647
  /**
@@ -11643,7 +11697,18 @@ var RunnerLocalMetricsSchema = object({
11643
11697
  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({
11644
11698
  handle: FrameHandleSchema,
11645
11699
  bbox: NativeCropBboxSchema,
11646
- maxWidth: number().int().positive().optional()
11700
+ maxWidth: number().int().positive().optional(),
11701
+ /**
11702
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11703
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11704
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11705
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11706
+ * no raw pixels cross the process boundary. Same-node callers omit it
11707
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11708
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11709
+ * the caller falls back to encoding locally.
11710
+ */
11711
+ encodeJpeg: boolean().optional()
11647
11712
  }), NativeCropResultSchema.nullable()), method(object({
11648
11713
  deviceId: number(),
11649
11714
  frameHandle: FrameHandleSchema.optional(),
@@ -14801,7 +14866,8 @@ var LinkedDeviceSchema = object({
14801
14866
  deviceId: number(),
14802
14867
  name: string(),
14803
14868
  location: string().nullable(),
14804
- features: array(string())
14869
+ features: array(string()),
14870
+ producesTrackedEvents: boolean().optional()
14805
14871
  });
14806
14872
  var SavedDeviceRowSchema = object({
14807
14873
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16431,6 +16497,7 @@ var TrackSchema = object({
16431
16497
  deviceId: number(),
16432
16498
  className: string(),
16433
16499
  label: string().optional(),
16500
+ producingDeviceName: string().optional(),
16434
16501
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16435
16502
  source: TrackSourceSchema.optional(),
16436
16503
  firstSeen: number(),
@@ -16568,7 +16635,8 @@ var MediaFileKindEnum = _enum([
16568
16635
  "fullFrameBoxed",
16569
16636
  "faceCrop",
16570
16637
  "plateCrop",
16571
- "keyFrame"
16638
+ "keyFrame",
16639
+ "keyFrameSmall"
16572
16640
  ]);
16573
16641
  var MediaFileSchema = object({
16574
16642
  key: string(),
@@ -16899,7 +16967,16 @@ var PipelineTemplateSchema = object({
16899
16967
  });
16900
16968
  var DeviceStepConfigSchema = object({
16901
16969
  modelId: string().optional(),
16902
- settings: record(string(), unknown()).optional()
16970
+ settings: record(string(), unknown()).optional(),
16971
+ /**
16972
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16973
+ * When set, this step runs on the named enabled device of the SAME node
16974
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16975
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16976
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16977
+ * auto-jumps only when the effective device's format cannot run the step.
16978
+ */
16979
+ jumpDeviceKey: string().optional()
16903
16980
  });
16904
16981
  var AgentPipelineSettingsSchema = object({
16905
16982
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/index.mjs CHANGED
@@ -11027,7 +11027,8 @@ var PipelineStepInputSchema = lazy(() => object({
11027
11027
  modelId: string().optional(),
11028
11028
  enabled: boolean().default(true),
11029
11029
  children: array(PipelineStepInputSchema).optional(),
11030
- settings: record(string(), unknown()).optional()
11030
+ settings: record(string(), unknown()).optional(),
11031
+ jumpDeviceKey: string().optional()
11031
11032
  }));
11032
11033
  var ModelSubstitutionSchema = object({
11033
11034
  addonId: string(),
@@ -11333,10 +11334,40 @@ var NativeCropBboxSchema = object({
11333
11334
  });
11334
11335
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11335
11336
  var NativeCropResultSchema = object({
11336
- /** Packed rgb (24-bit) pixels of the crop. */
11337
- bytes: _instanceof(Uint8Array),
11337
+ /**
11338
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11339
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11340
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11341
+ * path below), where shipping raw RGB is both an invariant violation and, for
11342
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11343
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11344
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11345
+ */
11346
+ bytes: _instanceof(Uint8Array).optional(),
11347
+ /**
11348
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11349
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11350
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11351
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11352
+ * set `encodeJpeg: true`; `bytes` is then absent.
11353
+ */
11354
+ jpeg: string().optional(),
11338
11355
  width: number().int().positive(),
11339
- height: number().int().positive()
11356
+ height: number().int().positive(),
11357
+ /**
11358
+ * Which source served this crop, so a quality-sensitive consumer (the native
11359
+ * `keyFrame`) can reject a degraded fallback:
11360
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11361
+ * quality path).
11362
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11363
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11364
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11365
+ *
11366
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11367
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11368
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11369
+ */
11370
+ tier: _enum(["native", "ram-fullframe"]).optional()
11340
11371
  });
11341
11372
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11342
11373
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11466,6 +11497,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11466
11497
  hubHostnameOverride: string().optional()
11467
11498
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11468
11499
  /**
11500
+ * One ENABLED inference device on the runner's node, as the step-tree
11501
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11502
+ * roster on the attach payload whenever the camera is elected onto a specific
11503
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11504
+ * runner auto-jumps an enrichment step to when the elected device's format
11505
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11506
+ * per-device knobs so the auto choice is weighted-least-loaded.
11507
+ */
11508
+ var RunnerInferenceDeviceSchema = object({
11509
+ deviceKey: string(),
11510
+ weight: number().positive().default(1),
11511
+ maxSessions: number().int().positive().nullable().default(null)
11512
+ });
11513
+ /**
11469
11514
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11470
11515
  * specific runner instance via `attachCamera`. Carries everything the
11471
11516
  * runner needs to subscribe to the local broker and execute inference.
@@ -11583,7 +11628,16 @@ var RunnerCameraConfigSchema = object({
11583
11628
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11584
11629
  * this only selects WHICH device pool of that node runs the session.
11585
11630
  */
11586
- deviceKey: string().optional()
11631
+ deviceKey: string().optional(),
11632
+ /**
11633
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11634
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11635
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11636
+ * step whose model has no build for the elected device's format onto another
11637
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11638
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11639
+ */
11640
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11587
11641
  });
11588
11642
  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;
11589
11643
  /**
@@ -11639,7 +11693,18 @@ var RunnerLocalMetricsSchema = object({
11639
11693
  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({
11640
11694
  handle: FrameHandleSchema,
11641
11695
  bbox: NativeCropBboxSchema,
11642
- maxWidth: number().int().positive().optional()
11696
+ maxWidth: number().int().positive().optional(),
11697
+ /**
11698
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11699
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11700
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11701
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11702
+ * no raw pixels cross the process boundary. Same-node callers omit it
11703
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11704
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11705
+ * the caller falls back to encoding locally.
11706
+ */
11707
+ encodeJpeg: boolean().optional()
11643
11708
  }), NativeCropResultSchema.nullable()), method(object({
11644
11709
  deviceId: number(),
11645
11710
  frameHandle: FrameHandleSchema.optional(),
@@ -14797,7 +14862,8 @@ var LinkedDeviceSchema = object({
14797
14862
  deviceId: number(),
14798
14863
  name: string(),
14799
14864
  location: string().nullable(),
14800
- features: array(string())
14865
+ features: array(string()),
14866
+ producesTrackedEvents: boolean().optional()
14801
14867
  });
14802
14868
  var SavedDeviceRowSchema = object({
14803
14869
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16427,6 +16493,7 @@ var TrackSchema = object({
16427
16493
  deviceId: number(),
16428
16494
  className: string(),
16429
16495
  label: string().optional(),
16496
+ producingDeviceName: string().optional(),
16430
16497
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16431
16498
  source: TrackSourceSchema.optional(),
16432
16499
  firstSeen: number(),
@@ -16564,7 +16631,8 @@ var MediaFileKindEnum = _enum([
16564
16631
  "fullFrameBoxed",
16565
16632
  "faceCrop",
16566
16633
  "plateCrop",
16567
- "keyFrame"
16634
+ "keyFrame",
16635
+ "keyFrameSmall"
16568
16636
  ]);
16569
16637
  var MediaFileSchema = object({
16570
16638
  key: string(),
@@ -16895,7 +16963,16 @@ var PipelineTemplateSchema = object({
16895
16963
  });
16896
16964
  var DeviceStepConfigSchema = object({
16897
16965
  modelId: string().optional(),
16898
- settings: record(string(), unknown()).optional()
16966
+ settings: record(string(), unknown()).optional(),
16967
+ /**
16968
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16969
+ * When set, this step runs on the named enabled device of the SAME node
16970
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16971
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16972
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16973
+ * auto-jumps only when the effective device's format cannot run the step.
16974
+ */
16975
+ jumpDeviceKey: string().optional()
16899
16976
  });
16900
16977
  var AgentPipelineSettingsSchema = object({
16901
16978
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-decoder-ffmpeg",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Standalone ffmpeg-subprocess decoder fallback addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",