@camstack/addon-static-turn 1.2.1 → 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.
@@ -11014,7 +11014,8 @@ var PipelineStepInputSchema = lazy(() => object({
11014
11014
  modelId: string().optional(),
11015
11015
  enabled: boolean().default(true),
11016
11016
  children: array(PipelineStepInputSchema).optional(),
11017
- settings: record(string(), unknown()).optional()
11017
+ settings: record(string(), unknown()).optional(),
11018
+ jumpDeviceKey: string().optional()
11018
11019
  }));
11019
11020
  var ModelSubstitutionSchema = object({
11020
11021
  addonId: string(),
@@ -11320,8 +11321,24 @@ var NativeCropBboxSchema = object({
11320
11321
  });
11321
11322
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11322
11323
  var NativeCropResultSchema = object({
11323
- /** Packed rgb (24-bit) pixels of the crop. */
11324
- bytes: _instanceof(Uint8Array),
11324
+ /**
11325
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11326
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11327
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11328
+ * path below), where shipping raw RGB is both an invariant violation and, for
11329
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11330
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11331
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11332
+ */
11333
+ bytes: _instanceof(Uint8Array).optional(),
11334
+ /**
11335
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11336
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11337
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11338
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11339
+ * set `encodeJpeg: true`; `bytes` is then absent.
11340
+ */
11341
+ jpeg: string().optional(),
11325
11342
  width: number().int().positive(),
11326
11343
  height: number().int().positive(),
11327
11344
  /**
@@ -11467,6 +11484,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11467
11484
  hubHostnameOverride: string().optional()
11468
11485
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11469
11486
  /**
11487
+ * One ENABLED inference device on the runner's node, as the step-tree
11488
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11489
+ * roster on the attach payload whenever the camera is elected onto a specific
11490
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11491
+ * runner auto-jumps an enrichment step to when the elected device's format
11492
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11493
+ * per-device knobs so the auto choice is weighted-least-loaded.
11494
+ */
11495
+ var RunnerInferenceDeviceSchema = object({
11496
+ deviceKey: string(),
11497
+ weight: number().positive().default(1),
11498
+ maxSessions: number().int().positive().nullable().default(null)
11499
+ });
11500
+ /**
11470
11501
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11471
11502
  * specific runner instance via `attachCamera`. Carries everything the
11472
11503
  * runner needs to subscribe to the local broker and execute inference.
@@ -11584,7 +11615,16 @@ var RunnerCameraConfigSchema = object({
11584
11615
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11585
11616
  * this only selects WHICH device pool of that node runs the session.
11586
11617
  */
11587
- deviceKey: string().optional()
11618
+ deviceKey: string().optional(),
11619
+ /**
11620
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11621
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11622
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11623
+ * step whose model has no build for the elected device's format onto another
11624
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11625
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11626
+ */
11627
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11588
11628
  });
11589
11629
  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;
11590
11630
  /**
@@ -11640,7 +11680,18 @@ var RunnerLocalMetricsSchema = object({
11640
11680
  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({
11641
11681
  handle: FrameHandleSchema,
11642
11682
  bbox: NativeCropBboxSchema,
11643
- maxWidth: number().int().positive().optional()
11683
+ maxWidth: number().int().positive().optional(),
11684
+ /**
11685
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11686
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11687
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11688
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11689
+ * no raw pixels cross the process boundary. Same-node callers omit it
11690
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11691
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11692
+ * the caller falls back to encoding locally.
11693
+ */
11694
+ encodeJpeg: boolean().optional()
11644
11695
  }), NativeCropResultSchema.nullable()), method(object({
11645
11696
  deviceId: number(),
11646
11697
  frameHandle: FrameHandleSchema.optional(),
@@ -16769,7 +16820,16 @@ var PipelineTemplateSchema = object({
16769
16820
  });
16770
16821
  var DeviceStepConfigSchema = object({
16771
16822
  modelId: string().optional(),
16772
- settings: record(string(), unknown()).optional()
16823
+ settings: record(string(), unknown()).optional(),
16824
+ /**
16825
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16826
+ * When set, this step runs on the named enabled device of the SAME node
16827
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16828
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16829
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16830
+ * auto-jumps only when the effective device's format cannot run the step.
16831
+ */
16832
+ jumpDeviceKey: string().optional()
16773
16833
  });
16774
16834
  var AgentPipelineSettingsSchema = object({
16775
16835
  maxCameras: number().int().nonnegative().nullable().default(null),
@@ -11013,7 +11013,8 @@ var PipelineStepInputSchema = lazy(() => object({
11013
11013
  modelId: string().optional(),
11014
11014
  enabled: boolean().default(true),
11015
11015
  children: array(PipelineStepInputSchema).optional(),
11016
- settings: record(string(), unknown()).optional()
11016
+ settings: record(string(), unknown()).optional(),
11017
+ jumpDeviceKey: string().optional()
11017
11018
  }));
11018
11019
  var ModelSubstitutionSchema = object({
11019
11020
  addonId: string(),
@@ -11319,8 +11320,24 @@ var NativeCropBboxSchema = object({
11319
11320
  });
11320
11321
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11321
11322
  var NativeCropResultSchema = object({
11322
- /** Packed rgb (24-bit) pixels of the crop. */
11323
- bytes: _instanceof(Uint8Array),
11323
+ /**
11324
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11325
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11326
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11327
+ * path below), where shipping raw RGB is both an invariant violation and, for
11328
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11329
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11330
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11331
+ */
11332
+ bytes: _instanceof(Uint8Array).optional(),
11333
+ /**
11334
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11335
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11336
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11337
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11338
+ * set `encodeJpeg: true`; `bytes` is then absent.
11339
+ */
11340
+ jpeg: string().optional(),
11324
11341
  width: number().int().positive(),
11325
11342
  height: number().int().positive(),
11326
11343
  /**
@@ -11466,6 +11483,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11466
11483
  hubHostnameOverride: string().optional()
11467
11484
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11468
11485
  /**
11486
+ * One ENABLED inference device on the runner's node, as the step-tree
11487
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11488
+ * roster on the attach payload whenever the camera is elected onto a specific
11489
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11490
+ * runner auto-jumps an enrichment step to when the elected device's format
11491
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11492
+ * per-device knobs so the auto choice is weighted-least-loaded.
11493
+ */
11494
+ var RunnerInferenceDeviceSchema = object({
11495
+ deviceKey: string(),
11496
+ weight: number().positive().default(1),
11497
+ maxSessions: number().int().positive().nullable().default(null)
11498
+ });
11499
+ /**
11469
11500
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11470
11501
  * specific runner instance via `attachCamera`. Carries everything the
11471
11502
  * runner needs to subscribe to the local broker and execute inference.
@@ -11583,7 +11614,16 @@ var RunnerCameraConfigSchema = object({
11583
11614
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11584
11615
  * this only selects WHICH device pool of that node runs the session.
11585
11616
  */
11586
- deviceKey: string().optional()
11617
+ deviceKey: string().optional(),
11618
+ /**
11619
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11620
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11621
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11622
+ * step whose model has no build for the elected device's format onto another
11623
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11624
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11625
+ */
11626
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11587
11627
  });
11588
11628
  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
11629
  /**
@@ -11639,7 +11679,18 @@ var RunnerLocalMetricsSchema = object({
11639
11679
  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
11680
  handle: FrameHandleSchema,
11641
11681
  bbox: NativeCropBboxSchema,
11642
- maxWidth: number().int().positive().optional()
11682
+ maxWidth: number().int().positive().optional(),
11683
+ /**
11684
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11685
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11686
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11687
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11688
+ * no raw pixels cross the process boundary. Same-node callers omit it
11689
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11690
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11691
+ * the caller falls back to encoding locally.
11692
+ */
11693
+ encodeJpeg: boolean().optional()
11643
11694
  }), NativeCropResultSchema.nullable()), method(object({
11644
11695
  deviceId: number(),
11645
11696
  frameHandle: FrameHandleSchema.optional(),
@@ -16768,7 +16819,16 @@ var PipelineTemplateSchema = object({
16768
16819
  });
16769
16820
  var DeviceStepConfigSchema = object({
16770
16821
  modelId: string().optional(),
16771
- settings: record(string(), unknown()).optional()
16822
+ settings: record(string(), unknown()).optional(),
16823
+ /**
16824
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16825
+ * When set, this step runs on the named enabled device of the SAME node
16826
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16827
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16828
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16829
+ * auto-jumps only when the effective device's format cannot run the step.
16830
+ */
16831
+ jumpDeviceKey: string().optional()
16772
16832
  });
16773
16833
  var AgentPipelineSettingsSchema = object({
16774
16834
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-static-turn",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Static / self-hosted (coturn) TURN provider for CamStack",
5
5
  "keywords": [
6
6
  "camstack",