@camstack/addon-decoder-nodeav 1.2.1 → 1.2.3

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,8 +11337,24 @@ 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
11359
  height: number().int().positive(),
11343
11360
  /**
@@ -11483,6 +11500,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11483
11500
  hubHostnameOverride: string().optional()
11484
11501
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11485
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
+ /**
11486
11517
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11487
11518
  * specific runner instance via `attachCamera`. Carries everything the
11488
11519
  * runner needs to subscribe to the local broker and execute inference.
@@ -11600,7 +11631,16 @@ var RunnerCameraConfigSchema = object({
11600
11631
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11601
11632
  * this only selects WHICH device pool of that node runs the session.
11602
11633
  */
11603
- 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()
11604
11644
  });
11605
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;
11606
11646
  /**
@@ -11656,7 +11696,18 @@ var RunnerLocalMetricsSchema = object({
11656
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({
11657
11697
  handle: FrameHandleSchema,
11658
11698
  bbox: NativeCropBboxSchema,
11659
- 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()
11660
11711
  }), NativeCropResultSchema.nullable()), method(object({
11661
11712
  deviceId: number(),
11662
11713
  frameHandle: FrameHandleSchema.optional(),
@@ -16584,7 +16635,8 @@ var MediaFileKindEnum = _enum([
16584
16635
  "faceCrop",
16585
16636
  "plateCrop",
16586
16637
  "keyFrame",
16587
- "keyFrameSmall"
16638
+ "keyFrameSmall",
16639
+ "thumbnailSmall"
16588
16640
  ]);
16589
16641
  var MediaFileSchema = object({
16590
16642
  key: string(),
@@ -16915,7 +16967,16 @@ var PipelineTemplateSchema = object({
16915
16967
  });
16916
16968
  var DeviceStepConfigSchema = object({
16917
16969
  modelId: string().optional(),
16918
- 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()
16919
16980
  });
16920
16981
  var AgentPipelineSettingsSchema = object({
16921
16982
  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,8 +11333,24 @@ 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
11355
  height: number().int().positive(),
11339
11356
  /**
@@ -11479,6 +11496,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11479
11496
  hubHostnameOverride: string().optional()
11480
11497
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11481
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
+ /**
11482
11513
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11483
11514
  * specific runner instance via `attachCamera`. Carries everything the
11484
11515
  * runner needs to subscribe to the local broker and execute inference.
@@ -11596,7 +11627,16 @@ var RunnerCameraConfigSchema = object({
11596
11627
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11597
11628
  * this only selects WHICH device pool of that node runs the session.
11598
11629
  */
11599
- 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()
11600
11640
  });
11601
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;
11602
11642
  /**
@@ -11652,7 +11692,18 @@ var RunnerLocalMetricsSchema = object({
11652
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({
11653
11693
  handle: FrameHandleSchema,
11654
11694
  bbox: NativeCropBboxSchema,
11655
- 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()
11656
11707
  }), NativeCropResultSchema.nullable()), method(object({
11657
11708
  deviceId: number(),
11658
11709
  frameHandle: FrameHandleSchema.optional(),
@@ -16580,7 +16631,8 @@ var MediaFileKindEnum = _enum([
16580
16631
  "faceCrop",
16581
16632
  "plateCrop",
16582
16633
  "keyFrame",
16583
- "keyFrameSmall"
16634
+ "keyFrameSmall",
16635
+ "thumbnailSmall"
16584
16636
  ]);
16585
16637
  var MediaFileSchema = object({
16586
16638
  key: string(),
@@ -16911,7 +16963,16 @@ var PipelineTemplateSchema = object({
16911
16963
  });
16912
16964
  var DeviceStepConfigSchema = object({
16913
16965
  modelId: string().optional(),
16914
- 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()
16915
16976
  });
16916
16977
  var AgentPipelineSettingsSchema = object({
16917
16978
  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.1",
3
+ "version": "1.2.3",
4
4
  "description": "Standalone in-process node-av decoder addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",