@camstack/addon-mqtt-broker 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.
@@ -11059,7 +11059,8 @@ var PipelineStepInputSchema = lazy(() => object({
11059
11059
  modelId: string().optional(),
11060
11060
  enabled: boolean().default(true),
11061
11061
  children: array(PipelineStepInputSchema).optional(),
11062
- settings: record(string(), unknown()).optional()
11062
+ settings: record(string(), unknown()).optional(),
11063
+ jumpDeviceKey: string().optional()
11063
11064
  }));
11064
11065
  var ModelSubstitutionSchema = object({
11065
11066
  addonId: string(),
@@ -11365,8 +11366,24 @@ var NativeCropBboxSchema = object({
11365
11366
  });
11366
11367
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11367
11368
  var NativeCropResultSchema = object({
11368
- /** Packed rgb (24-bit) pixels of the crop. */
11369
- bytes: _instanceof(Uint8Array),
11369
+ /**
11370
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11371
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11372
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11373
+ * path below), where shipping raw RGB is both an invariant violation and, for
11374
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11375
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11376
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11377
+ */
11378
+ bytes: _instanceof(Uint8Array).optional(),
11379
+ /**
11380
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11381
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11382
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11383
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11384
+ * set `encodeJpeg: true`; `bytes` is then absent.
11385
+ */
11386
+ jpeg: string().optional(),
11370
11387
  width: number().int().positive(),
11371
11388
  height: number().int().positive(),
11372
11389
  /**
@@ -11512,6 +11529,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11512
11529
  hubHostnameOverride: string().optional()
11513
11530
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11514
11531
  /**
11532
+ * One ENABLED inference device on the runner's node, as the step-tree
11533
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11534
+ * roster on the attach payload whenever the camera is elected onto a specific
11535
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11536
+ * runner auto-jumps an enrichment step to when the elected device's format
11537
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11538
+ * per-device knobs so the auto choice is weighted-least-loaded.
11539
+ */
11540
+ var RunnerInferenceDeviceSchema = object({
11541
+ deviceKey: string(),
11542
+ weight: number().positive().default(1),
11543
+ maxSessions: number().int().positive().nullable().default(null)
11544
+ });
11545
+ /**
11515
11546
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11516
11547
  * specific runner instance via `attachCamera`. Carries everything the
11517
11548
  * runner needs to subscribe to the local broker and execute inference.
@@ -11629,7 +11660,16 @@ var RunnerCameraConfigSchema = object({
11629
11660
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11630
11661
  * this only selects WHICH device pool of that node runs the session.
11631
11662
  */
11632
- deviceKey: string().optional()
11663
+ deviceKey: string().optional(),
11664
+ /**
11665
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11666
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11667
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11668
+ * step whose model has no build for the elected device's format onto another
11669
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11670
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11671
+ */
11672
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11633
11673
  });
11634
11674
  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;
11635
11675
  /**
@@ -11685,7 +11725,18 @@ var RunnerLocalMetricsSchema = object({
11685
11725
  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({
11686
11726
  handle: FrameHandleSchema,
11687
11727
  bbox: NativeCropBboxSchema,
11688
- maxWidth: number().int().positive().optional()
11728
+ maxWidth: number().int().positive().optional(),
11729
+ /**
11730
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11731
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11732
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11733
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11734
+ * no raw pixels cross the process boundary. Same-node callers omit it
11735
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11736
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11737
+ * the caller falls back to encoding locally.
11738
+ */
11739
+ encodeJpeg: boolean().optional()
11689
11740
  }), NativeCropResultSchema.nullable()), method(object({
11690
11741
  deviceId: number(),
11691
11742
  frameHandle: FrameHandleSchema.optional(),
@@ -16882,7 +16933,16 @@ var PipelineTemplateSchema = object({
16882
16933
  });
16883
16934
  var DeviceStepConfigSchema = object({
16884
16935
  modelId: string().optional(),
16885
- settings: record(string(), unknown()).optional()
16936
+ settings: record(string(), unknown()).optional(),
16937
+ /**
16938
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16939
+ * When set, this step runs on the named enabled device of the SAME node
16940
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16941
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16942
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16943
+ * auto-jumps only when the effective device's format cannot run the step.
16944
+ */
16945
+ jumpDeviceKey: string().optional()
16886
16946
  });
16887
16947
  var AgentPipelineSettingsSchema = object({
16888
16948
  maxCameras: number().int().nonnegative().nullable().default(null),
@@ -11054,7 +11054,8 @@ var PipelineStepInputSchema = lazy(() => object({
11054
11054
  modelId: string().optional(),
11055
11055
  enabled: boolean().default(true),
11056
11056
  children: array(PipelineStepInputSchema).optional(),
11057
- settings: record(string(), unknown()).optional()
11057
+ settings: record(string(), unknown()).optional(),
11058
+ jumpDeviceKey: string().optional()
11058
11059
  }));
11059
11060
  var ModelSubstitutionSchema = object({
11060
11061
  addonId: string(),
@@ -11360,8 +11361,24 @@ var NativeCropBboxSchema = object({
11360
11361
  });
11361
11362
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11362
11363
  var NativeCropResultSchema = object({
11363
- /** Packed rgb (24-bit) pixels of the crop. */
11364
- bytes: _instanceof(Uint8Array),
11364
+ /**
11365
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11366
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11367
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11368
+ * path below), where shipping raw RGB is both an invariant violation and, for
11369
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11370
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11371
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11372
+ */
11373
+ bytes: _instanceof(Uint8Array).optional(),
11374
+ /**
11375
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11376
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11377
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11378
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11379
+ * set `encodeJpeg: true`; `bytes` is then absent.
11380
+ */
11381
+ jpeg: string().optional(),
11365
11382
  width: number().int().positive(),
11366
11383
  height: number().int().positive(),
11367
11384
  /**
@@ -11507,6 +11524,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11507
11524
  hubHostnameOverride: string().optional()
11508
11525
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11509
11526
  /**
11527
+ * One ENABLED inference device on the runner's node, as the step-tree
11528
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11529
+ * roster on the attach payload whenever the camera is elected onto a specific
11530
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11531
+ * runner auto-jumps an enrichment step to when the elected device's format
11532
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11533
+ * per-device knobs so the auto choice is weighted-least-loaded.
11534
+ */
11535
+ var RunnerInferenceDeviceSchema = object({
11536
+ deviceKey: string(),
11537
+ weight: number().positive().default(1),
11538
+ maxSessions: number().int().positive().nullable().default(null)
11539
+ });
11540
+ /**
11510
11541
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11511
11542
  * specific runner instance via `attachCamera`. Carries everything the
11512
11543
  * runner needs to subscribe to the local broker and execute inference.
@@ -11624,7 +11655,16 @@ var RunnerCameraConfigSchema = object({
11624
11655
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11625
11656
  * this only selects WHICH device pool of that node runs the session.
11626
11657
  */
11627
- deviceKey: string().optional()
11658
+ deviceKey: string().optional(),
11659
+ /**
11660
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11661
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11662
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11663
+ * step whose model has no build for the elected device's format onto another
11664
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11665
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11666
+ */
11667
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11628
11668
  });
11629
11669
  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;
11630
11670
  /**
@@ -11680,7 +11720,18 @@ var RunnerLocalMetricsSchema = object({
11680
11720
  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({
11681
11721
  handle: FrameHandleSchema,
11682
11722
  bbox: NativeCropBboxSchema,
11683
- maxWidth: number().int().positive().optional()
11723
+ maxWidth: number().int().positive().optional(),
11724
+ /**
11725
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11726
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11727
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11728
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11729
+ * no raw pixels cross the process boundary. Same-node callers omit it
11730
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11731
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11732
+ * the caller falls back to encoding locally.
11733
+ */
11734
+ encodeJpeg: boolean().optional()
11684
11735
  }), NativeCropResultSchema.nullable()), method(object({
11685
11736
  deviceId: number(),
11686
11737
  frameHandle: FrameHandleSchema.optional(),
@@ -16877,7 +16928,16 @@ var PipelineTemplateSchema = object({
16877
16928
  });
16878
16929
  var DeviceStepConfigSchema = object({
16879
16930
  modelId: string().optional(),
16880
- settings: record(string(), unknown()).optional()
16931
+ settings: record(string(), unknown()).optional(),
16932
+ /**
16933
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16934
+ * When set, this step runs on the named enabled device of the SAME node
16935
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16936
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16937
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16938
+ * auto-jumps only when the effective device's format cannot run the step.
16939
+ */
16940
+ jumpDeviceKey: string().optional()
16881
16941
  });
16882
16942
  var AgentPipelineSettingsSchema = object({
16883
16943
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-mqtt-broker",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "MQTT broker registry addon for CamStack — manages external broker entries + an optional embedded aedes broker. Consumers spin up their own `mqtt.js` clients via the `mqtt-broker` cap.",
5
5
  "keywords": [
6
6
  "camstack",