@camstack/addon-provider-vesync 0.2.0 → 0.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
@@ -12321,7 +12321,8 @@ var PipelineStepInputSchema = lazy(() => object({
12321
12321
  modelId: string().optional(),
12322
12322
  enabled: boolean().default(true),
12323
12323
  children: array(PipelineStepInputSchema).optional(),
12324
- settings: record(string(), unknown()).optional()
12324
+ settings: record(string(), unknown()).optional(),
12325
+ jumpDeviceKey: string().optional()
12325
12326
  }));
12326
12327
  var ModelSubstitutionSchema = object({
12327
12328
  addonId: string(),
@@ -12660,10 +12661,40 @@ var NativeCropBboxSchema = object({
12660
12661
  });
12661
12662
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12662
12663
  var NativeCropResultSchema = object({
12663
- /** Packed rgb (24-bit) pixels of the crop. */
12664
- bytes: _instanceof(Uint8Array),
12664
+ /**
12665
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12666
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12667
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12668
+ * path below), where shipping raw RGB is both an invariant violation and, for
12669
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12670
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12671
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12672
+ */
12673
+ bytes: _instanceof(Uint8Array).optional(),
12674
+ /**
12675
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12676
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12677
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12678
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12679
+ * set `encodeJpeg: true`; `bytes` is then absent.
12680
+ */
12681
+ jpeg: string().optional(),
12665
12682
  width: number().int().positive(),
12666
- height: number().int().positive()
12683
+ height: number().int().positive(),
12684
+ /**
12685
+ * Which source served this crop, so a quality-sensitive consumer (the native
12686
+ * `keyFrame`) can reject a degraded fallback:
12687
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12688
+ * quality path).
12689
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12690
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12691
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12692
+ *
12693
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12694
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12695
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12696
+ */
12697
+ tier: _enum(["native", "ram-fullframe"]).optional()
12667
12698
  });
12668
12699
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12669
12700
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12793,6 +12824,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12793
12824
  hubHostnameOverride: string().optional()
12794
12825
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12795
12826
  /**
12827
+ * One ENABLED inference device on the runner's node, as the step-tree
12828
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12829
+ * roster on the attach payload whenever the camera is elected onto a specific
12830
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12831
+ * runner auto-jumps an enrichment step to when the elected device's format
12832
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12833
+ * per-device knobs so the auto choice is weighted-least-loaded.
12834
+ */
12835
+ var RunnerInferenceDeviceSchema = object({
12836
+ deviceKey: string(),
12837
+ weight: number().positive().default(1),
12838
+ maxSessions: number().int().positive().nullable().default(null)
12839
+ });
12840
+ /**
12796
12841
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12797
12842
  * specific runner instance via `attachCamera`. Carries everything the
12798
12843
  * runner needs to subscribe to the local broker and execute inference.
@@ -12910,7 +12955,16 @@ var RunnerCameraConfigSchema = object({
12910
12955
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12911
12956
  * this only selects WHICH device pool of that node runs the session.
12912
12957
  */
12913
- deviceKey: string().optional()
12958
+ deviceKey: string().optional(),
12959
+ /**
12960
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
12961
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
12962
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
12963
+ * step whose model has no build for the elected device's format onto another
12964
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
12965
+ * ⇒ no jump possible; the step runs on `deviceKey`.
12966
+ */
12967
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
12914
12968
  });
12915
12969
  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;
12916
12970
  /**
@@ -12966,7 +13020,18 @@ var RunnerLocalMetricsSchema = object({
12966
13020
  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({
12967
13021
  handle: FrameHandleSchema,
12968
13022
  bbox: NativeCropBboxSchema,
12969
- maxWidth: number().int().positive().optional()
13023
+ maxWidth: number().int().positive().optional(),
13024
+ /**
13025
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13026
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13027
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13028
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13029
+ * no raw pixels cross the process boundary. Same-node callers omit it
13030
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13031
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13032
+ * the caller falls back to encoding locally.
13033
+ */
13034
+ encodeJpeg: boolean().optional()
12970
13035
  }), NativeCropResultSchema.nullable()), method(object({
12971
13036
  deviceId: number(),
12972
13037
  frameHandle: FrameHandleSchema.optional(),
@@ -17667,7 +17732,8 @@ var LinkedDeviceSchema = object({
17667
17732
  deviceId: number(),
17668
17733
  name: string(),
17669
17734
  location: string().nullable(),
17670
- features: array(string())
17735
+ features: array(string()),
17736
+ producesTrackedEvents: boolean().optional()
17671
17737
  });
17672
17738
  var SavedDeviceRowSchema = object({
17673
17739
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19297,6 +19363,7 @@ var TrackSchema = object({
19297
19363
  deviceId: number(),
19298
19364
  className: string(),
19299
19365
  label: string().optional(),
19366
+ producingDeviceName: string().optional(),
19300
19367
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19301
19368
  source: TrackSourceSchema.optional(),
19302
19369
  firstSeen: number(),
@@ -19434,7 +19501,8 @@ var MediaFileKindEnum = _enum([
19434
19501
  "fullFrameBoxed",
19435
19502
  "faceCrop",
19436
19503
  "plateCrop",
19437
- "keyFrame"
19504
+ "keyFrame",
19505
+ "keyFrameSmall"
19438
19506
  ]);
19439
19507
  var MediaFileSchema = object({
19440
19508
  key: string(),
@@ -19765,7 +19833,16 @@ var PipelineTemplateSchema = object({
19765
19833
  });
19766
19834
  var DeviceStepConfigSchema = object({
19767
19835
  modelId: string().optional(),
19768
- settings: record(string(), unknown()).optional()
19836
+ settings: record(string(), unknown()).optional(),
19837
+ /**
19838
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19839
+ * When set, this step runs on the named enabled device of the SAME node
19840
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19841
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19842
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19843
+ * auto-jumps only when the effective device's format cannot run the step.
19844
+ */
19845
+ jumpDeviceKey: string().optional()
19769
19846
  });
19770
19847
  var AgentPipelineSettingsSchema = object({
19771
19848
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/addon.mjs CHANGED
@@ -12320,7 +12320,8 @@ var PipelineStepInputSchema = lazy(() => object({
12320
12320
  modelId: string().optional(),
12321
12321
  enabled: boolean().default(true),
12322
12322
  children: array(PipelineStepInputSchema).optional(),
12323
- settings: record(string(), unknown()).optional()
12323
+ settings: record(string(), unknown()).optional(),
12324
+ jumpDeviceKey: string().optional()
12324
12325
  }));
12325
12326
  var ModelSubstitutionSchema = object({
12326
12327
  addonId: string(),
@@ -12659,10 +12660,40 @@ var NativeCropBboxSchema = object({
12659
12660
  });
12660
12661
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12661
12662
  var NativeCropResultSchema = object({
12662
- /** Packed rgb (24-bit) pixels of the crop. */
12663
- bytes: _instanceof(Uint8Array),
12663
+ /**
12664
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12665
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12666
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12667
+ * path below), where shipping raw RGB is both an invariant violation and, for
12668
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12669
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12670
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12671
+ */
12672
+ bytes: _instanceof(Uint8Array).optional(),
12673
+ /**
12674
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12675
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12676
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12677
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12678
+ * set `encodeJpeg: true`; `bytes` is then absent.
12679
+ */
12680
+ jpeg: string().optional(),
12664
12681
  width: number().int().positive(),
12665
- height: number().int().positive()
12682
+ height: number().int().positive(),
12683
+ /**
12684
+ * Which source served this crop, so a quality-sensitive consumer (the native
12685
+ * `keyFrame`) can reject a degraded fallback:
12686
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12687
+ * quality path).
12688
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12689
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12690
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12691
+ *
12692
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12693
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12694
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12695
+ */
12696
+ tier: _enum(["native", "ram-fullframe"]).optional()
12666
12697
  });
12667
12698
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12668
12699
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12792,6 +12823,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12792
12823
  hubHostnameOverride: string().optional()
12793
12824
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12794
12825
  /**
12826
+ * One ENABLED inference device on the runner's node, as the step-tree
12827
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12828
+ * roster on the attach payload whenever the camera is elected onto a specific
12829
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12830
+ * runner auto-jumps an enrichment step to when the elected device's format
12831
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12832
+ * per-device knobs so the auto choice is weighted-least-loaded.
12833
+ */
12834
+ var RunnerInferenceDeviceSchema = object({
12835
+ deviceKey: string(),
12836
+ weight: number().positive().default(1),
12837
+ maxSessions: number().int().positive().nullable().default(null)
12838
+ });
12839
+ /**
12795
12840
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12796
12841
  * specific runner instance via `attachCamera`. Carries everything the
12797
12842
  * runner needs to subscribe to the local broker and execute inference.
@@ -12909,7 +12954,16 @@ var RunnerCameraConfigSchema = object({
12909
12954
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12910
12955
  * this only selects WHICH device pool of that node runs the session.
12911
12956
  */
12912
- deviceKey: string().optional()
12957
+ deviceKey: string().optional(),
12958
+ /**
12959
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
12960
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
12961
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
12962
+ * step whose model has no build for the elected device's format onto another
12963
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
12964
+ * ⇒ no jump possible; the step runs on `deviceKey`.
12965
+ */
12966
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
12913
12967
  });
12914
12968
  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;
12915
12969
  /**
@@ -12965,7 +13019,18 @@ var RunnerLocalMetricsSchema = object({
12965
13019
  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({
12966
13020
  handle: FrameHandleSchema,
12967
13021
  bbox: NativeCropBboxSchema,
12968
- maxWidth: number().int().positive().optional()
13022
+ maxWidth: number().int().positive().optional(),
13023
+ /**
13024
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13025
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13026
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13027
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13028
+ * no raw pixels cross the process boundary. Same-node callers omit it
13029
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13030
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13031
+ * the caller falls back to encoding locally.
13032
+ */
13033
+ encodeJpeg: boolean().optional()
12969
13034
  }), NativeCropResultSchema.nullable()), method(object({
12970
13035
  deviceId: number(),
12971
13036
  frameHandle: FrameHandleSchema.optional(),
@@ -17666,7 +17731,8 @@ var LinkedDeviceSchema = object({
17666
17731
  deviceId: number(),
17667
17732
  name: string(),
17668
17733
  location: string().nullable(),
17669
- features: array(string())
17734
+ features: array(string()),
17735
+ producesTrackedEvents: boolean().optional()
17670
17736
  });
17671
17737
  var SavedDeviceRowSchema = object({
17672
17738
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19296,6 +19362,7 @@ var TrackSchema = object({
19296
19362
  deviceId: number(),
19297
19363
  className: string(),
19298
19364
  label: string().optional(),
19365
+ producingDeviceName: string().optional(),
19299
19366
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19300
19367
  source: TrackSourceSchema.optional(),
19301
19368
  firstSeen: number(),
@@ -19433,7 +19500,8 @@ var MediaFileKindEnum = _enum([
19433
19500
  "fullFrameBoxed",
19434
19501
  "faceCrop",
19435
19502
  "plateCrop",
19436
- "keyFrame"
19503
+ "keyFrame",
19504
+ "keyFrameSmall"
19437
19505
  ]);
19438
19506
  var MediaFileSchema = object({
19439
19507
  key: string(),
@@ -19764,7 +19832,16 @@ var PipelineTemplateSchema = object({
19764
19832
  });
19765
19833
  var DeviceStepConfigSchema = object({
19766
19834
  modelId: string().optional(),
19767
- settings: record(string(), unknown()).optional()
19835
+ settings: record(string(), unknown()).optional(),
19836
+ /**
19837
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19838
+ * When set, this step runs on the named enabled device of the SAME node
19839
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19840
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19841
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19842
+ * auto-jumps only when the effective device's format cannot run the step.
19843
+ */
19844
+ jumpDeviceKey: string().optional()
19768
19845
  });
19769
19846
  var AgentPipelineSettingsSchema = object({
19770
19847
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-vesync",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "VeSync cloud-account device-provider addon for CamStack — Levoit / Cosori air purifiers as Fan devices (power, speed, preset, child-lock, display, air-quality + filter-life sensors)",
5
5
  "keywords": [
6
6
  "camstack",