@camstack/addon-export-ha-mqtt 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.
@@ -11065,7 +11065,8 @@ var PipelineStepInputSchema = lazy(() => object({
11065
11065
  modelId: string().optional(),
11066
11066
  enabled: boolean().default(true),
11067
11067
  children: array(PipelineStepInputSchema).optional(),
11068
- settings: record(string(), unknown()).optional()
11068
+ settings: record(string(), unknown()).optional(),
11069
+ jumpDeviceKey: string().optional()
11069
11070
  }));
11070
11071
  var ModelSubstitutionSchema = object({
11071
11072
  addonId: string(),
@@ -11371,10 +11372,40 @@ var NativeCropBboxSchema = object({
11371
11372
  });
11372
11373
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11373
11374
  var NativeCropResultSchema = object({
11374
- /** Packed rgb (24-bit) pixels of the crop. */
11375
- bytes: _instanceof(Uint8Array),
11375
+ /**
11376
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11377
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11378
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11379
+ * path below), where shipping raw RGB is both an invariant violation and, for
11380
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11381
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11382
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11383
+ */
11384
+ bytes: _instanceof(Uint8Array).optional(),
11385
+ /**
11386
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11387
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11388
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11389
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11390
+ * set `encodeJpeg: true`; `bytes` is then absent.
11391
+ */
11392
+ jpeg: string().optional(),
11376
11393
  width: number$1().int().positive(),
11377
- height: number$1().int().positive()
11394
+ height: number$1().int().positive(),
11395
+ /**
11396
+ * Which source served this crop, so a quality-sensitive consumer (the native
11397
+ * `keyFrame`) can reject a degraded fallback:
11398
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11399
+ * quality path).
11400
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11401
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11402
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11403
+ *
11404
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11405
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11406
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11407
+ */
11408
+ tier: _enum(["native", "ram-fullframe"]).optional()
11378
11409
  });
11379
11410
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11380
11411
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11504,6 +11535,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11504
11535
  hubHostnameOverride: string().optional()
11505
11536
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11506
11537
  /**
11538
+ * One ENABLED inference device on the runner's node, as the step-tree
11539
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11540
+ * roster on the attach payload whenever the camera is elected onto a specific
11541
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11542
+ * runner auto-jumps an enrichment step to when the elected device's format
11543
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11544
+ * per-device knobs so the auto choice is weighted-least-loaded.
11545
+ */
11546
+ var RunnerInferenceDeviceSchema = object({
11547
+ deviceKey: string(),
11548
+ weight: number$1().positive().default(1),
11549
+ maxSessions: number$1().int().positive().nullable().default(null)
11550
+ });
11551
+ /**
11507
11552
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11508
11553
  * specific runner instance via `attachCamera`. Carries everything the
11509
11554
  * runner needs to subscribe to the local broker and execute inference.
@@ -11621,7 +11666,16 @@ var RunnerCameraConfigSchema = object({
11621
11666
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11622
11667
  * this only selects WHICH device pool of that node runs the session.
11623
11668
  */
11624
- deviceKey: string().optional()
11669
+ deviceKey: string().optional(),
11670
+ /**
11671
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11672
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11673
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11674
+ * step whose model has no build for the elected device's format onto another
11675
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11676
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11677
+ */
11678
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11625
11679
  });
11626
11680
  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;
11627
11681
  /**
@@ -11677,7 +11731,18 @@ var RunnerLocalMetricsSchema = object({
11677
11731
  method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number$1() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number$1() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number$1()).readonly()), method(object({
11678
11732
  handle: FrameHandleSchema,
11679
11733
  bbox: NativeCropBboxSchema,
11680
- maxWidth: number$1().int().positive().optional()
11734
+ maxWidth: number$1().int().positive().optional(),
11735
+ /**
11736
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11737
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11738
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11739
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11740
+ * no raw pixels cross the process boundary. Same-node callers omit it
11741
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11742
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11743
+ * the caller falls back to encoding locally.
11744
+ */
11745
+ encodeJpeg: boolean().optional()
11681
11746
  }), NativeCropResultSchema.nullable()), method(object({
11682
11747
  deviceId: number$1(),
11683
11748
  frameHandle: FrameHandleSchema.optional(),
@@ -14730,7 +14795,8 @@ var LinkedDeviceSchema = object({
14730
14795
  deviceId: number$1(),
14731
14796
  name: string(),
14732
14797
  location: string().nullable(),
14733
- features: array(string())
14798
+ features: array(string()),
14799
+ producesTrackedEvents: boolean().optional()
14734
14800
  });
14735
14801
  var SavedDeviceRowSchema = object({
14736
14802
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16360,6 +16426,7 @@ var TrackSchema = object({
16360
16426
  deviceId: number$1(),
16361
16427
  className: string(),
16362
16428
  label: string().optional(),
16429
+ producingDeviceName: string().optional(),
16363
16430
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16364
16431
  source: TrackSourceSchema.optional(),
16365
16432
  firstSeen: number$1(),
@@ -16497,7 +16564,8 @@ var MediaFileKindEnum = _enum([
16497
16564
  "fullFrameBoxed",
16498
16565
  "faceCrop",
16499
16566
  "plateCrop",
16500
- "keyFrame"
16567
+ "keyFrame",
16568
+ "keyFrameSmall"
16501
16569
  ]);
16502
16570
  var MediaFileSchema = object({
16503
16571
  key: string(),
@@ -16828,7 +16896,16 @@ var PipelineTemplateSchema = object({
16828
16896
  });
16829
16897
  var DeviceStepConfigSchema = object({
16830
16898
  modelId: string().optional(),
16831
- settings: record(string(), unknown()).optional()
16899
+ settings: record(string(), unknown()).optional(),
16900
+ /**
16901
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16902
+ * When set, this step runs on the named enabled device of the SAME node
16903
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16904
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16905
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16906
+ * auto-jumps only when the effective device's format cannot run the step.
16907
+ */
16908
+ jumpDeviceKey: string().optional()
16832
16909
  });
16833
16910
  var AgentPipelineSettingsSchema = object({
16834
16911
  maxCameras: number$1().int().nonnegative().nullable().default(null),
@@ -11063,7 +11063,8 @@ var PipelineStepInputSchema = lazy(() => object({
11063
11063
  modelId: string().optional(),
11064
11064
  enabled: boolean().default(true),
11065
11065
  children: array(PipelineStepInputSchema).optional(),
11066
- settings: record(string(), unknown()).optional()
11066
+ settings: record(string(), unknown()).optional(),
11067
+ jumpDeviceKey: string().optional()
11067
11068
  }));
11068
11069
  var ModelSubstitutionSchema = object({
11069
11070
  addonId: string(),
@@ -11369,10 +11370,40 @@ var NativeCropBboxSchema = object({
11369
11370
  });
11370
11371
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11371
11372
  var NativeCropResultSchema = object({
11372
- /** Packed rgb (24-bit) pixels of the crop. */
11373
- bytes: _instanceof(Uint8Array),
11373
+ /**
11374
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11375
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11376
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11377
+ * path below), where shipping raw RGB is both an invariant violation and, for
11378
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11379
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11380
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11381
+ */
11382
+ bytes: _instanceof(Uint8Array).optional(),
11383
+ /**
11384
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11385
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11386
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11387
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11388
+ * set `encodeJpeg: true`; `bytes` is then absent.
11389
+ */
11390
+ jpeg: string().optional(),
11374
11391
  width: number$1().int().positive(),
11375
- height: number$1().int().positive()
11392
+ height: number$1().int().positive(),
11393
+ /**
11394
+ * Which source served this crop, so a quality-sensitive consumer (the native
11395
+ * `keyFrame`) can reject a degraded fallback:
11396
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11397
+ * quality path).
11398
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11399
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11400
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11401
+ *
11402
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11403
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11404
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11405
+ */
11406
+ tier: _enum(["native", "ram-fullframe"]).optional()
11376
11407
  });
11377
11408
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11378
11409
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11502,6 +11533,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11502
11533
  hubHostnameOverride: string().optional()
11503
11534
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11504
11535
  /**
11536
+ * One ENABLED inference device on the runner's node, as the step-tree
11537
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11538
+ * roster on the attach payload whenever the camera is elected onto a specific
11539
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11540
+ * runner auto-jumps an enrichment step to when the elected device's format
11541
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11542
+ * per-device knobs so the auto choice is weighted-least-loaded.
11543
+ */
11544
+ var RunnerInferenceDeviceSchema = object({
11545
+ deviceKey: string(),
11546
+ weight: number$1().positive().default(1),
11547
+ maxSessions: number$1().int().positive().nullable().default(null)
11548
+ });
11549
+ /**
11505
11550
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11506
11551
  * specific runner instance via `attachCamera`. Carries everything the
11507
11552
  * runner needs to subscribe to the local broker and execute inference.
@@ -11619,7 +11664,16 @@ var RunnerCameraConfigSchema = object({
11619
11664
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11620
11665
  * this only selects WHICH device pool of that node runs the session.
11621
11666
  */
11622
- deviceKey: string().optional()
11667
+ deviceKey: string().optional(),
11668
+ /**
11669
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11670
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11671
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11672
+ * step whose model has no build for the elected device's format onto another
11673
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11674
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11675
+ */
11676
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11623
11677
  });
11624
11678
  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;
11625
11679
  /**
@@ -11675,7 +11729,18 @@ var RunnerLocalMetricsSchema = object({
11675
11729
  method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number$1() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number$1() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number$1()).readonly()), method(object({
11676
11730
  handle: FrameHandleSchema,
11677
11731
  bbox: NativeCropBboxSchema,
11678
- maxWidth: number$1().int().positive().optional()
11732
+ maxWidth: number$1().int().positive().optional(),
11733
+ /**
11734
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11735
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11736
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11737
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11738
+ * no raw pixels cross the process boundary. Same-node callers omit it
11739
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11740
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11741
+ * the caller falls back to encoding locally.
11742
+ */
11743
+ encodeJpeg: boolean().optional()
11679
11744
  }), NativeCropResultSchema.nullable()), method(object({
11680
11745
  deviceId: number$1(),
11681
11746
  frameHandle: FrameHandleSchema.optional(),
@@ -14728,7 +14793,8 @@ var LinkedDeviceSchema = object({
14728
14793
  deviceId: number$1(),
14729
14794
  name: string(),
14730
14795
  location: string().nullable(),
14731
- features: array(string())
14796
+ features: array(string()),
14797
+ producesTrackedEvents: boolean().optional()
14732
14798
  });
14733
14799
  var SavedDeviceRowSchema = object({
14734
14800
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16358,6 +16424,7 @@ var TrackSchema = object({
16358
16424
  deviceId: number$1(),
16359
16425
  className: string(),
16360
16426
  label: string().optional(),
16427
+ producingDeviceName: string().optional(),
16361
16428
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16362
16429
  source: TrackSourceSchema.optional(),
16363
16430
  firstSeen: number$1(),
@@ -16495,7 +16562,8 @@ var MediaFileKindEnum = _enum([
16495
16562
  "fullFrameBoxed",
16496
16563
  "faceCrop",
16497
16564
  "plateCrop",
16498
- "keyFrame"
16565
+ "keyFrame",
16566
+ "keyFrameSmall"
16499
16567
  ]);
16500
16568
  var MediaFileSchema = object({
16501
16569
  key: string(),
@@ -16826,7 +16894,16 @@ var PipelineTemplateSchema = object({
16826
16894
  });
16827
16895
  var DeviceStepConfigSchema = object({
16828
16896
  modelId: string().optional(),
16829
- settings: record(string(), unknown()).optional()
16897
+ settings: record(string(), unknown()).optional(),
16898
+ /**
16899
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16900
+ * When set, this step runs on the named enabled device of the SAME node
16901
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16902
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16903
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16904
+ * auto-jumps only when the effective device's format cannot run the step.
16905
+ */
16906
+ jumpDeviceKey: string().optional()
16830
16907
  });
16831
16908
  var AgentPipelineSettingsSchema = object({
16832
16909
  maxCameras: number$1().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-ha-mqtt",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "HomeAssistant MQTT discovery exporter for CamStack devices. Publishes discovery topics so HA auto-creates entities for exposed cameras/switches/intercoms/sensors.",
5
5
  "keywords": [
6
6
  "camstack",