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