@camstack/addon-mqtt-broker 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.
@@ -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,10 +11366,40 @@ 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
- height: number().int().positive()
11388
+ height: number().int().positive(),
11389
+ /**
11390
+ * Which source served this crop, so a quality-sensitive consumer (the native
11391
+ * `keyFrame`) can reject a degraded fallback:
11392
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11393
+ * quality path).
11394
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11395
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11396
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11397
+ *
11398
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11399
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11400
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11401
+ */
11402
+ tier: _enum(["native", "ram-fullframe"]).optional()
11372
11403
  });
11373
11404
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11374
11405
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11498,6 +11529,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11498
11529
  hubHostnameOverride: string().optional()
11499
11530
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11500
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
+ /**
11501
11546
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11502
11547
  * specific runner instance via `attachCamera`. Carries everything the
11503
11548
  * runner needs to subscribe to the local broker and execute inference.
@@ -11615,7 +11660,16 @@ var RunnerCameraConfigSchema = object({
11615
11660
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11616
11661
  * this only selects WHICH device pool of that node runs the session.
11617
11662
  */
11618
- 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()
11619
11673
  });
11620
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;
11621
11675
  /**
@@ -11671,7 +11725,18 @@ var RunnerLocalMetricsSchema = object({
11671
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({
11672
11726
  handle: FrameHandleSchema,
11673
11727
  bbox: NativeCropBboxSchema,
11674
- 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()
11675
11740
  }), NativeCropResultSchema.nullable()), method(object({
11676
11741
  deviceId: number(),
11677
11742
  frameHandle: FrameHandleSchema.optional(),
@@ -14748,7 +14813,8 @@ var LinkedDeviceSchema = object({
14748
14813
  deviceId: number(),
14749
14814
  name: string(),
14750
14815
  location: string().nullable(),
14751
- features: array(string())
14816
+ features: array(string()),
14817
+ producesTrackedEvents: boolean().optional()
14752
14818
  });
14753
14819
  var SavedDeviceRowSchema = object({
14754
14820
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16397,6 +16463,7 @@ var TrackSchema = object({
16397
16463
  deviceId: number(),
16398
16464
  className: string(),
16399
16465
  label: string().optional(),
16466
+ producingDeviceName: string().optional(),
16400
16467
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16401
16468
  source: TrackSourceSchema.optional(),
16402
16469
  firstSeen: number(),
@@ -16534,7 +16601,8 @@ var MediaFileKindEnum = _enum([
16534
16601
  "fullFrameBoxed",
16535
16602
  "faceCrop",
16536
16603
  "plateCrop",
16537
- "keyFrame"
16604
+ "keyFrame",
16605
+ "keyFrameSmall"
16538
16606
  ]);
16539
16607
  var MediaFileSchema = object({
16540
16608
  key: string(),
@@ -16865,7 +16933,16 @@ var PipelineTemplateSchema = object({
16865
16933
  });
16866
16934
  var DeviceStepConfigSchema = object({
16867
16935
  modelId: string().optional(),
16868
- 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()
16869
16946
  });
16870
16947
  var AgentPipelineSettingsSchema = object({
16871
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,10 +11361,40 @@ 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
- height: number().int().positive()
11383
+ height: number().int().positive(),
11384
+ /**
11385
+ * Which source served this crop, so a quality-sensitive consumer (the native
11386
+ * `keyFrame`) can reject a degraded fallback:
11387
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11388
+ * quality path).
11389
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11390
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11391
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11392
+ *
11393
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11394
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11395
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11396
+ */
11397
+ tier: _enum(["native", "ram-fullframe"]).optional()
11367
11398
  });
11368
11399
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11369
11400
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11493,6 +11524,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11493
11524
  hubHostnameOverride: string().optional()
11494
11525
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11495
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
+ /**
11496
11541
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11497
11542
  * specific runner instance via `attachCamera`. Carries everything the
11498
11543
  * runner needs to subscribe to the local broker and execute inference.
@@ -11610,7 +11655,16 @@ var RunnerCameraConfigSchema = object({
11610
11655
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11611
11656
  * this only selects WHICH device pool of that node runs the session.
11612
11657
  */
11613
- 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()
11614
11668
  });
11615
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;
11616
11670
  /**
@@ -11666,7 +11720,18 @@ var RunnerLocalMetricsSchema = object({
11666
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({
11667
11721
  handle: FrameHandleSchema,
11668
11722
  bbox: NativeCropBboxSchema,
11669
- 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()
11670
11735
  }), NativeCropResultSchema.nullable()), method(object({
11671
11736
  deviceId: number(),
11672
11737
  frameHandle: FrameHandleSchema.optional(),
@@ -14743,7 +14808,8 @@ var LinkedDeviceSchema = object({
14743
14808
  deviceId: number(),
14744
14809
  name: string(),
14745
14810
  location: string().nullable(),
14746
- features: array(string())
14811
+ features: array(string()),
14812
+ producesTrackedEvents: boolean().optional()
14747
14813
  });
14748
14814
  var SavedDeviceRowSchema = object({
14749
14815
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16392,6 +16458,7 @@ var TrackSchema = object({
16392
16458
  deviceId: number(),
16393
16459
  className: string(),
16394
16460
  label: string().optional(),
16461
+ producingDeviceName: string().optional(),
16395
16462
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16396
16463
  source: TrackSourceSchema.optional(),
16397
16464
  firstSeen: number(),
@@ -16529,7 +16596,8 @@ var MediaFileKindEnum = _enum([
16529
16596
  "fullFrameBoxed",
16530
16597
  "faceCrop",
16531
16598
  "plateCrop",
16532
- "keyFrame"
16599
+ "keyFrame",
16600
+ "keyFrameSmall"
16533
16601
  ]);
16534
16602
  var MediaFileSchema = object({
16535
16603
  key: string(),
@@ -16860,7 +16928,16 @@ var PipelineTemplateSchema = object({
16860
16928
  });
16861
16929
  var DeviceStepConfigSchema = object({
16862
16930
  modelId: string().optional(),
16863
- 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()
16864
16941
  });
16865
16942
  var AgentPipelineSettingsSchema = object({
16866
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.0",
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",