@camstack/addon-static-turn 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.
@@ -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,10 +11321,40 @@ 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
- height: number().int().positive()
11343
+ height: number().int().positive(),
11344
+ /**
11345
+ * Which source served this crop, so a quality-sensitive consumer (the native
11346
+ * `keyFrame`) can reject a degraded fallback:
11347
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11348
+ * quality path).
11349
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11350
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11351
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11352
+ *
11353
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11354
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11355
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11356
+ */
11357
+ tier: _enum(["native", "ram-fullframe"]).optional()
11327
11358
  });
11328
11359
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11329
11360
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11453,6 +11484,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11453
11484
  hubHostnameOverride: string().optional()
11454
11485
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11455
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
+ /**
11456
11501
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11457
11502
  * specific runner instance via `attachCamera`. Carries everything the
11458
11503
  * runner needs to subscribe to the local broker and execute inference.
@@ -11570,7 +11615,16 @@ var RunnerCameraConfigSchema = object({
11570
11615
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11571
11616
  * this only selects WHICH device pool of that node runs the session.
11572
11617
  */
11573
- 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()
11574
11628
  });
11575
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;
11576
11630
  /**
@@ -11626,7 +11680,18 @@ var RunnerLocalMetricsSchema = object({
11626
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({
11627
11681
  handle: FrameHandleSchema,
11628
11682
  bbox: NativeCropBboxSchema,
11629
- 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()
11630
11695
  }), NativeCropResultSchema.nullable()), method(object({
11631
11696
  deviceId: number(),
11632
11697
  frameHandle: FrameHandleSchema.optional(),
@@ -14654,7 +14719,8 @@ var LinkedDeviceSchema = object({
14654
14719
  deviceId: number(),
14655
14720
  name: string(),
14656
14721
  location: string().nullable(),
14657
- features: array(string())
14722
+ features: array(string()),
14723
+ producesTrackedEvents: boolean().optional()
14658
14724
  });
14659
14725
  var SavedDeviceRowSchema = object({
14660
14726
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16284,6 +16350,7 @@ var TrackSchema = object({
16284
16350
  deviceId: number(),
16285
16351
  className: string(),
16286
16352
  label: string().optional(),
16353
+ producingDeviceName: string().optional(),
16287
16354
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16288
16355
  source: TrackSourceSchema.optional(),
16289
16356
  firstSeen: number(),
@@ -16421,7 +16488,8 @@ var MediaFileKindEnum = _enum([
16421
16488
  "fullFrameBoxed",
16422
16489
  "faceCrop",
16423
16490
  "plateCrop",
16424
- "keyFrame"
16491
+ "keyFrame",
16492
+ "keyFrameSmall"
16425
16493
  ]);
16426
16494
  var MediaFileSchema = object({
16427
16495
  key: string(),
@@ -16752,7 +16820,16 @@ var PipelineTemplateSchema = object({
16752
16820
  });
16753
16821
  var DeviceStepConfigSchema = object({
16754
16822
  modelId: string().optional(),
16755
- 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()
16756
16833
  });
16757
16834
  var AgentPipelineSettingsSchema = object({
16758
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,10 +11320,40 @@ 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
- height: number().int().positive()
11342
+ height: number().int().positive(),
11343
+ /**
11344
+ * Which source served this crop, so a quality-sensitive consumer (the native
11345
+ * `keyFrame`) can reject a degraded fallback:
11346
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11347
+ * quality path).
11348
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11349
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11350
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11351
+ *
11352
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11353
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11354
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11355
+ */
11356
+ tier: _enum(["native", "ram-fullframe"]).optional()
11326
11357
  });
11327
11358
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11328
11359
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11452,6 +11483,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11452
11483
  hubHostnameOverride: string().optional()
11453
11484
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11454
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
+ /**
11455
11500
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11456
11501
  * specific runner instance via `attachCamera`. Carries everything the
11457
11502
  * runner needs to subscribe to the local broker and execute inference.
@@ -11569,7 +11614,16 @@ var RunnerCameraConfigSchema = object({
11569
11614
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11570
11615
  * this only selects WHICH device pool of that node runs the session.
11571
11616
  */
11572
- 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()
11573
11627
  });
11574
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;
11575
11629
  /**
@@ -11625,7 +11679,18 @@ var RunnerLocalMetricsSchema = object({
11625
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({
11626
11680
  handle: FrameHandleSchema,
11627
11681
  bbox: NativeCropBboxSchema,
11628
- 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()
11629
11694
  }), NativeCropResultSchema.nullable()), method(object({
11630
11695
  deviceId: number(),
11631
11696
  frameHandle: FrameHandleSchema.optional(),
@@ -14653,7 +14718,8 @@ var LinkedDeviceSchema = object({
14653
14718
  deviceId: number(),
14654
14719
  name: string(),
14655
14720
  location: string().nullable(),
14656
- features: array(string())
14721
+ features: array(string()),
14722
+ producesTrackedEvents: boolean().optional()
14657
14723
  });
14658
14724
  var SavedDeviceRowSchema = object({
14659
14725
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16283,6 +16349,7 @@ var TrackSchema = object({
16283
16349
  deviceId: number(),
16284
16350
  className: string(),
16285
16351
  label: string().optional(),
16352
+ producingDeviceName: string().optional(),
16286
16353
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16287
16354
  source: TrackSourceSchema.optional(),
16288
16355
  firstSeen: number(),
@@ -16420,7 +16487,8 @@ var MediaFileKindEnum = _enum([
16420
16487
  "fullFrameBoxed",
16421
16488
  "faceCrop",
16422
16489
  "plateCrop",
16423
- "keyFrame"
16490
+ "keyFrame",
16491
+ "keyFrameSmall"
16424
16492
  ]);
16425
16493
  var MediaFileSchema = object({
16426
16494
  key: string(),
@@ -16751,7 +16819,16 @@ var PipelineTemplateSchema = object({
16751
16819
  });
16752
16820
  var DeviceStepConfigSchema = object({
16753
16821
  modelId: string().optional(),
16754
- 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()
16755
16832
  });
16756
16833
  var AgentPipelineSettingsSchema = object({
16757
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.0",
3
+ "version": "1.2.2",
4
4
  "description": "Static / self-hosted (coturn) TURN provider for CamStack",
5
5
  "keywords": [
6
6
  "camstack",