@camstack/addon-provider-homeassistant 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.
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,8 +13004,24 @@ 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
13026
  height: number().int().positive(),
13010
13027
  /**
@@ -13150,6 +13167,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
13150
13167
  hubHostnameOverride: string().optional()
13151
13168
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
13152
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
+ /**
13153
13184
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
13154
13185
  * specific runner instance via `attachCamera`. Carries everything the
13155
13186
  * runner needs to subscribe to the local broker and execute inference.
@@ -13267,7 +13298,16 @@ var RunnerCameraConfigSchema = object({
13267
13298
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
13268
13299
  * this only selects WHICH device pool of that node runs the session.
13269
13300
  */
13270
- 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()
13271
13311
  });
13272
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;
13273
13313
  /**
@@ -13323,7 +13363,18 @@ var RunnerLocalMetricsSchema = object({
13323
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({
13324
13364
  handle: FrameHandleSchema,
13325
13365
  bbox: NativeCropBboxSchema,
13326
- 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()
13327
13378
  }), NativeCropResultSchema.nullable()), method(object({
13328
13379
  deviceId: number(),
13329
13380
  frameHandle: FrameHandleSchema.optional(),
@@ -20224,7 +20275,16 @@ var PipelineTemplateSchema = object({
20224
20275
  });
20225
20276
  var DeviceStepConfigSchema = object({
20226
20277
  modelId: string().optional(),
20227
- 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()
20228
20288
  });
20229
20289
  var AgentPipelineSettingsSchema = object({
20230
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,8 +13003,24 @@ 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
13025
  height: number().int().positive(),
13009
13026
  /**
@@ -13149,6 +13166,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
13149
13166
  hubHostnameOverride: string().optional()
13150
13167
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
13151
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
+ /**
13152
13183
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
13153
13184
  * specific runner instance via `attachCamera`. Carries everything the
13154
13185
  * runner needs to subscribe to the local broker and execute inference.
@@ -13266,7 +13297,16 @@ var RunnerCameraConfigSchema = object({
13266
13297
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
13267
13298
  * this only selects WHICH device pool of that node runs the session.
13268
13299
  */
13269
- 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()
13270
13310
  });
13271
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;
13272
13312
  /**
@@ -13322,7 +13362,18 @@ var RunnerLocalMetricsSchema = object({
13322
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({
13323
13363
  handle: FrameHandleSchema,
13324
13364
  bbox: NativeCropBboxSchema,
13325
- 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()
13326
13377
  }), NativeCropResultSchema.nullable()), method(object({
13327
13378
  deviceId: number(),
13328
13379
  frameHandle: FrameHandleSchema.optional(),
@@ -20223,7 +20274,16 @@ var PipelineTemplateSchema = object({
20223
20274
  });
20224
20275
  var DeviceStepConfigSchema = object({
20225
20276
  modelId: string().optional(),
20226
- 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()
20227
20287
  });
20228
20288
  var AgentPipelineSettingsSchema = object({
20229
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.1",
3
+ "version": "1.2.2",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",