@camstack/addon-provider-homeassistant 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.
package/dist/addon.js CHANGED
@@ -12664,7 +12664,8 @@ var PipelineStepInputSchema = lazy(() => object({
12664
12664
  modelId: string().optional(),
12665
12665
  enabled: boolean().default(true),
12666
12666
  children: array(PipelineStepInputSchema).optional(),
12667
- settings: record(string(), unknown()).optional()
12667
+ settings: record(string(), unknown()).optional(),
12668
+ jumpDeviceKey: string().optional()
12668
12669
  }));
12669
12670
  var ModelSubstitutionSchema = object({
12670
12671
  addonId: string(),
@@ -13003,10 +13004,40 @@ var NativeCropBboxSchema = object({
13003
13004
  });
13004
13005
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
13005
13006
  var NativeCropResultSchema = object({
13006
- /** Packed rgb (24-bit) pixels of the crop. */
13007
- bytes: _instanceof(Uint8Array),
13007
+ /**
13008
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
13009
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
13010
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
13011
+ * path below), where shipping raw RGB is both an invariant violation and, for
13012
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
13013
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
13014
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
13015
+ */
13016
+ bytes: _instanceof(Uint8Array).optional(),
13017
+ /**
13018
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
13019
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
13020
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
13021
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
13022
+ * set `encodeJpeg: true`; `bytes` is then absent.
13023
+ */
13024
+ jpeg: string().optional(),
13008
13025
  width: number().int().positive(),
13009
- height: number().int().positive()
13026
+ height: number().int().positive(),
13027
+ /**
13028
+ * Which source served this crop, so a quality-sensitive consumer (the native
13029
+ * `keyFrame`) can reject a degraded fallback:
13030
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
13031
+ * quality path).
13032
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
13033
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
13034
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
13035
+ *
13036
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
13037
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
13038
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
13039
+ */
13040
+ tier: _enum(["native", "ram-fullframe"]).optional()
13010
13041
  });
13011
13042
  /** Parent detection context passed to `runDetailSubtree` — the crop's
13012
13043
  * originating detection, in FRAME-space coordinates. Reuses
@@ -13136,6 +13167,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
13136
13167
  hubHostnameOverride: string().optional()
13137
13168
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
13138
13169
  /**
13170
+ * One ENABLED inference device on the runner's node, as the step-tree
13171
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
13172
+ * roster on the attach payload whenever the camera is elected onto a specific
13173
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
13174
+ * runner auto-jumps an enrichment step to when the elected device's format
13175
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
13176
+ * per-device knobs so the auto choice is weighted-least-loaded.
13177
+ */
13178
+ var RunnerInferenceDeviceSchema = object({
13179
+ deviceKey: string(),
13180
+ weight: number().positive().default(1),
13181
+ maxSessions: number().int().positive().nullable().default(null)
13182
+ });
13183
+ /**
13139
13184
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
13140
13185
  * specific runner instance via `attachCamera`. Carries everything the
13141
13186
  * runner needs to subscribe to the local broker and execute inference.
@@ -13253,7 +13298,16 @@ var RunnerCameraConfigSchema = object({
13253
13298
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
13254
13299
  * this only selects WHICH device pool of that node runs the session.
13255
13300
  */
13256
- deviceKey: string().optional()
13301
+ deviceKey: string().optional(),
13302
+ /**
13303
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
13304
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
13305
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
13306
+ * step whose model has no build for the elected device's format onto another
13307
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
13308
+ * ⇒ no jump possible; the step runs on `deviceKey`.
13309
+ */
13310
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
13257
13311
  });
13258
13312
  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;
13259
13313
  /**
@@ -13309,7 +13363,18 @@ var RunnerLocalMetricsSchema = object({
13309
13363
  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({
13310
13364
  handle: FrameHandleSchema,
13311
13365
  bbox: NativeCropBboxSchema,
13312
- maxWidth: number().int().positive().optional()
13366
+ maxWidth: number().int().positive().optional(),
13367
+ /**
13368
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13369
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13370
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13371
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13372
+ * no raw pixels cross the process boundary. Same-node callers omit it
13373
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13374
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13375
+ * the caller falls back to encoding locally.
13376
+ */
13377
+ encodeJpeg: boolean().optional()
13313
13378
  }), NativeCropResultSchema.nullable()), method(object({
13314
13379
  deviceId: number(),
13315
13380
  frameHandle: FrameHandleSchema.optional(),
@@ -18095,7 +18160,8 @@ var LinkedDeviceSchema = object({
18095
18160
  deviceId: number(),
18096
18161
  name: string(),
18097
18162
  location: string().nullable(),
18098
- features: array(string())
18163
+ features: array(string()),
18164
+ producesTrackedEvents: boolean().optional()
18099
18165
  });
18100
18166
  var SavedDeviceRowSchema = object({
18101
18167
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19739,6 +19805,7 @@ var TrackSchema = object({
19739
19805
  deviceId: number(),
19740
19806
  className: string(),
19741
19807
  label: string().optional(),
19808
+ producingDeviceName: string().optional(),
19742
19809
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19743
19810
  source: TrackSourceSchema.optional(),
19744
19811
  firstSeen: number(),
@@ -19876,7 +19943,8 @@ var MediaFileKindEnum = _enum([
19876
19943
  "fullFrameBoxed",
19877
19944
  "faceCrop",
19878
19945
  "plateCrop",
19879
- "keyFrame"
19946
+ "keyFrame",
19947
+ "keyFrameSmall"
19880
19948
  ]);
19881
19949
  var MediaFileSchema = object({
19882
19950
  key: string(),
@@ -20207,7 +20275,16 @@ var PipelineTemplateSchema = object({
20207
20275
  });
20208
20276
  var DeviceStepConfigSchema = object({
20209
20277
  modelId: string().optional(),
20210
- settings: record(string(), unknown()).optional()
20278
+ settings: record(string(), unknown()).optional(),
20279
+ /**
20280
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
20281
+ * When set, this step runs on the named enabled device of the SAME node
20282
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
20283
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
20284
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
20285
+ * auto-jumps only when the effective device's format cannot run the step.
20286
+ */
20287
+ jumpDeviceKey: string().optional()
20211
20288
  });
20212
20289
  var AgentPipelineSettingsSchema = object({
20213
20290
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/addon.mjs CHANGED
@@ -12663,7 +12663,8 @@ var PipelineStepInputSchema = lazy(() => object({
12663
12663
  modelId: string().optional(),
12664
12664
  enabled: boolean().default(true),
12665
12665
  children: array(PipelineStepInputSchema).optional(),
12666
- settings: record(string(), unknown()).optional()
12666
+ settings: record(string(), unknown()).optional(),
12667
+ jumpDeviceKey: string().optional()
12667
12668
  }));
12668
12669
  var ModelSubstitutionSchema = object({
12669
12670
  addonId: string(),
@@ -13002,10 +13003,40 @@ var NativeCropBboxSchema = object({
13002
13003
  });
13003
13004
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
13004
13005
  var NativeCropResultSchema = object({
13005
- /** Packed rgb (24-bit) pixels of the crop. */
13006
- bytes: _instanceof(Uint8Array),
13006
+ /**
13007
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
13008
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
13009
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
13010
+ * path below), where shipping raw RGB is both an invariant violation and, for
13011
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
13012
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
13013
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
13014
+ */
13015
+ bytes: _instanceof(Uint8Array).optional(),
13016
+ /**
13017
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
13018
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
13019
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
13020
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
13021
+ * set `encodeJpeg: true`; `bytes` is then absent.
13022
+ */
13023
+ jpeg: string().optional(),
13007
13024
  width: number().int().positive(),
13008
- height: number().int().positive()
13025
+ height: number().int().positive(),
13026
+ /**
13027
+ * Which source served this crop, so a quality-sensitive consumer (the native
13028
+ * `keyFrame`) can reject a degraded fallback:
13029
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
13030
+ * quality path).
13031
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
13032
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
13033
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
13034
+ *
13035
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
13036
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
13037
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
13038
+ */
13039
+ tier: _enum(["native", "ram-fullframe"]).optional()
13009
13040
  });
13010
13041
  /** Parent detection context passed to `runDetailSubtree` — the crop's
13011
13042
  * originating detection, in FRAME-space coordinates. Reuses
@@ -13135,6 +13166,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
13135
13166
  hubHostnameOverride: string().optional()
13136
13167
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
13137
13168
  /**
13169
+ * One ENABLED inference device on the runner's node, as the step-tree
13170
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
13171
+ * roster on the attach payload whenever the camera is elected onto a specific
13172
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
13173
+ * runner auto-jumps an enrichment step to when the elected device's format
13174
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
13175
+ * per-device knobs so the auto choice is weighted-least-loaded.
13176
+ */
13177
+ var RunnerInferenceDeviceSchema = object({
13178
+ deviceKey: string(),
13179
+ weight: number().positive().default(1),
13180
+ maxSessions: number().int().positive().nullable().default(null)
13181
+ });
13182
+ /**
13138
13183
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
13139
13184
  * specific runner instance via `attachCamera`. Carries everything the
13140
13185
  * runner needs to subscribe to the local broker and execute inference.
@@ -13252,7 +13297,16 @@ var RunnerCameraConfigSchema = object({
13252
13297
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
13253
13298
  * this only selects WHICH device pool of that node runs the session.
13254
13299
  */
13255
- deviceKey: string().optional()
13300
+ deviceKey: string().optional(),
13301
+ /**
13302
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
13303
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
13304
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
13305
+ * step whose model has no build for the elected device's format onto another
13306
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
13307
+ * ⇒ no jump possible; the step runs on `deviceKey`.
13308
+ */
13309
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
13256
13310
  });
13257
13311
  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;
13258
13312
  /**
@@ -13308,7 +13362,18 @@ var RunnerLocalMetricsSchema = object({
13308
13362
  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({
13309
13363
  handle: FrameHandleSchema,
13310
13364
  bbox: NativeCropBboxSchema,
13311
- maxWidth: number().int().positive().optional()
13365
+ maxWidth: number().int().positive().optional(),
13366
+ /**
13367
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13368
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13369
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13370
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13371
+ * no raw pixels cross the process boundary. Same-node callers omit it
13372
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13373
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13374
+ * the caller falls back to encoding locally.
13375
+ */
13376
+ encodeJpeg: boolean().optional()
13312
13377
  }), NativeCropResultSchema.nullable()), method(object({
13313
13378
  deviceId: number(),
13314
13379
  frameHandle: FrameHandleSchema.optional(),
@@ -18094,7 +18159,8 @@ var LinkedDeviceSchema = object({
18094
18159
  deviceId: number(),
18095
18160
  name: string(),
18096
18161
  location: string().nullable(),
18097
- features: array(string())
18162
+ features: array(string()),
18163
+ producesTrackedEvents: boolean().optional()
18098
18164
  });
18099
18165
  var SavedDeviceRowSchema = object({
18100
18166
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19738,6 +19804,7 @@ var TrackSchema = object({
19738
19804
  deviceId: number(),
19739
19805
  className: string(),
19740
19806
  label: string().optional(),
19807
+ producingDeviceName: string().optional(),
19741
19808
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19742
19809
  source: TrackSourceSchema.optional(),
19743
19810
  firstSeen: number(),
@@ -19875,7 +19942,8 @@ var MediaFileKindEnum = _enum([
19875
19942
  "fullFrameBoxed",
19876
19943
  "faceCrop",
19877
19944
  "plateCrop",
19878
- "keyFrame"
19945
+ "keyFrame",
19946
+ "keyFrameSmall"
19879
19947
  ]);
19880
19948
  var MediaFileSchema = object({
19881
19949
  key: string(),
@@ -20206,7 +20274,16 @@ var PipelineTemplateSchema = object({
20206
20274
  });
20207
20275
  var DeviceStepConfigSchema = object({
20208
20276
  modelId: string().optional(),
20209
- settings: record(string(), unknown()).optional()
20277
+ settings: record(string(), unknown()).optional(),
20278
+ /**
20279
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
20280
+ * When set, this step runs on the named enabled device of the SAME node
20281
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
20282
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
20283
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
20284
+ * auto-jumps only when the effective device's format cannot run the step.
20285
+ */
20286
+ jumpDeviceKey: string().optional()
20210
20287
  });
20211
20288
  var AgentPipelineSettingsSchema = object({
20212
20289
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homeassistant",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",