@camstack/addon-provider-wyze 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
@@ -12338,7 +12338,8 @@ var PipelineStepInputSchema = lazy(() => object({
12338
12338
  modelId: string().optional(),
12339
12339
  enabled: boolean().default(true),
12340
12340
  children: array(PipelineStepInputSchema).optional(),
12341
- settings: record(string(), unknown()).optional()
12341
+ settings: record(string(), unknown()).optional(),
12342
+ jumpDeviceKey: string().optional()
12342
12343
  }));
12343
12344
  var ModelSubstitutionSchema = object({
12344
12345
  addonId: string(),
@@ -12677,10 +12678,40 @@ var NativeCropBboxSchema = object({
12677
12678
  });
12678
12679
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12679
12680
  var NativeCropResultSchema = object({
12680
- /** Packed rgb (24-bit) pixels of the crop. */
12681
- bytes: _instanceof(Uint8Array),
12681
+ /**
12682
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12683
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12684
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12685
+ * path below), where shipping raw RGB is both an invariant violation and, for
12686
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12687
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12688
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12689
+ */
12690
+ bytes: _instanceof(Uint8Array).optional(),
12691
+ /**
12692
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12693
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12694
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12695
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12696
+ * set `encodeJpeg: true`; `bytes` is then absent.
12697
+ */
12698
+ jpeg: string().optional(),
12682
12699
  width: number().int().positive(),
12683
- height: number().int().positive()
12700
+ height: number().int().positive(),
12701
+ /**
12702
+ * Which source served this crop, so a quality-sensitive consumer (the native
12703
+ * `keyFrame`) can reject a degraded fallback:
12704
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12705
+ * quality path).
12706
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12707
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12708
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12709
+ *
12710
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12711
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12712
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12713
+ */
12714
+ tier: _enum(["native", "ram-fullframe"]).optional()
12684
12715
  });
12685
12716
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12686
12717
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12810,6 +12841,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12810
12841
  hubHostnameOverride: string().optional()
12811
12842
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12812
12843
  /**
12844
+ * One ENABLED inference device on the runner's node, as the step-tree
12845
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12846
+ * roster on the attach payload whenever the camera is elected onto a specific
12847
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12848
+ * runner auto-jumps an enrichment step to when the elected device's format
12849
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12850
+ * per-device knobs so the auto choice is weighted-least-loaded.
12851
+ */
12852
+ var RunnerInferenceDeviceSchema = object({
12853
+ deviceKey: string(),
12854
+ weight: number().positive().default(1),
12855
+ maxSessions: number().int().positive().nullable().default(null)
12856
+ });
12857
+ /**
12813
12858
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12814
12859
  * specific runner instance via `attachCamera`. Carries everything the
12815
12860
  * runner needs to subscribe to the local broker and execute inference.
@@ -12927,7 +12972,16 @@ var RunnerCameraConfigSchema = object({
12927
12972
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12928
12973
  * this only selects WHICH device pool of that node runs the session.
12929
12974
  */
12930
- deviceKey: string().optional()
12975
+ deviceKey: string().optional(),
12976
+ /**
12977
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
12978
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
12979
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
12980
+ * step whose model has no build for the elected device's format onto another
12981
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
12982
+ * ⇒ no jump possible; the step runs on `deviceKey`.
12983
+ */
12984
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
12931
12985
  });
12932
12986
  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;
12933
12987
  /**
@@ -12983,7 +13037,18 @@ var RunnerLocalMetricsSchema = object({
12983
13037
  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({
12984
13038
  handle: FrameHandleSchema,
12985
13039
  bbox: NativeCropBboxSchema,
12986
- maxWidth: number().int().positive().optional()
13040
+ maxWidth: number().int().positive().optional(),
13041
+ /**
13042
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13043
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13044
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13045
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13046
+ * no raw pixels cross the process boundary. Same-node callers omit it
13047
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13048
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13049
+ * the caller falls back to encoding locally.
13050
+ */
13051
+ encodeJpeg: boolean().optional()
12987
13052
  }), NativeCropResultSchema.nullable()), method(object({
12988
13053
  deviceId: number(),
12989
13054
  frameHandle: FrameHandleSchema.optional(),
@@ -17701,7 +17766,8 @@ var LinkedDeviceSchema = object({
17701
17766
  deviceId: number(),
17702
17767
  name: string(),
17703
17768
  location: string().nullable(),
17704
- features: array(string())
17769
+ features: array(string()),
17770
+ producesTrackedEvents: boolean().optional()
17705
17771
  });
17706
17772
  var SavedDeviceRowSchema = object({
17707
17773
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19331,6 +19397,7 @@ var TrackSchema = object({
19331
19397
  deviceId: number(),
19332
19398
  className: string(),
19333
19399
  label: string().optional(),
19400
+ producingDeviceName: string().optional(),
19334
19401
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19335
19402
  source: TrackSourceSchema.optional(),
19336
19403
  firstSeen: number(),
@@ -19468,7 +19535,8 @@ var MediaFileKindEnum = _enum([
19468
19535
  "fullFrameBoxed",
19469
19536
  "faceCrop",
19470
19537
  "plateCrop",
19471
- "keyFrame"
19538
+ "keyFrame",
19539
+ "keyFrameSmall"
19472
19540
  ]);
19473
19541
  var MediaFileSchema = object({
19474
19542
  key: string(),
@@ -19799,7 +19867,16 @@ var PipelineTemplateSchema = object({
19799
19867
  });
19800
19868
  var DeviceStepConfigSchema = object({
19801
19869
  modelId: string().optional(),
19802
- settings: record(string(), unknown()).optional()
19870
+ settings: record(string(), unknown()).optional(),
19871
+ /**
19872
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19873
+ * When set, this step runs on the named enabled device of the SAME node
19874
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19875
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19876
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19877
+ * auto-jumps only when the effective device's format cannot run the step.
19878
+ */
19879
+ jumpDeviceKey: string().optional()
19803
19880
  });
19804
19881
  var AgentPipelineSettingsSchema = object({
19805
19882
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/addon.mjs CHANGED
@@ -12317,7 +12317,8 @@ var PipelineStepInputSchema = lazy(() => object({
12317
12317
  modelId: string().optional(),
12318
12318
  enabled: boolean().default(true),
12319
12319
  children: array(PipelineStepInputSchema).optional(),
12320
- settings: record(string(), unknown()).optional()
12320
+ settings: record(string(), unknown()).optional(),
12321
+ jumpDeviceKey: string().optional()
12321
12322
  }));
12322
12323
  var ModelSubstitutionSchema = object({
12323
12324
  addonId: string(),
@@ -12656,10 +12657,40 @@ var NativeCropBboxSchema = object({
12656
12657
  });
12657
12658
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12658
12659
  var NativeCropResultSchema = object({
12659
- /** Packed rgb (24-bit) pixels of the crop. */
12660
- bytes: _instanceof(Uint8Array),
12660
+ /**
12661
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12662
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12663
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12664
+ * path below), where shipping raw RGB is both an invariant violation and, for
12665
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12666
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12667
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12668
+ */
12669
+ bytes: _instanceof(Uint8Array).optional(),
12670
+ /**
12671
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12672
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12673
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12674
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12675
+ * set `encodeJpeg: true`; `bytes` is then absent.
12676
+ */
12677
+ jpeg: string().optional(),
12661
12678
  width: number().int().positive(),
12662
- height: number().int().positive()
12679
+ height: number().int().positive(),
12680
+ /**
12681
+ * Which source served this crop, so a quality-sensitive consumer (the native
12682
+ * `keyFrame`) can reject a degraded fallback:
12683
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12684
+ * quality path).
12685
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12686
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12687
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12688
+ *
12689
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12690
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12691
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12692
+ */
12693
+ tier: _enum(["native", "ram-fullframe"]).optional()
12663
12694
  });
12664
12695
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12665
12696
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12789,6 +12820,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12789
12820
  hubHostnameOverride: string().optional()
12790
12821
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12791
12822
  /**
12823
+ * One ENABLED inference device on the runner's node, as the step-tree
12824
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12825
+ * roster on the attach payload whenever the camera is elected onto a specific
12826
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12827
+ * runner auto-jumps an enrichment step to when the elected device's format
12828
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12829
+ * per-device knobs so the auto choice is weighted-least-loaded.
12830
+ */
12831
+ var RunnerInferenceDeviceSchema = object({
12832
+ deviceKey: string(),
12833
+ weight: number().positive().default(1),
12834
+ maxSessions: number().int().positive().nullable().default(null)
12835
+ });
12836
+ /**
12792
12837
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12793
12838
  * specific runner instance via `attachCamera`. Carries everything the
12794
12839
  * runner needs to subscribe to the local broker and execute inference.
@@ -12906,7 +12951,16 @@ var RunnerCameraConfigSchema = object({
12906
12951
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12907
12952
  * this only selects WHICH device pool of that node runs the session.
12908
12953
  */
12909
- deviceKey: string().optional()
12954
+ deviceKey: string().optional(),
12955
+ /**
12956
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
12957
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
12958
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
12959
+ * step whose model has no build for the elected device's format onto another
12960
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
12961
+ * ⇒ no jump possible; the step runs on `deviceKey`.
12962
+ */
12963
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
12910
12964
  });
12911
12965
  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;
12912
12966
  /**
@@ -12962,7 +13016,18 @@ var RunnerLocalMetricsSchema = object({
12962
13016
  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({
12963
13017
  handle: FrameHandleSchema,
12964
13018
  bbox: NativeCropBboxSchema,
12965
- maxWidth: number().int().positive().optional()
13019
+ maxWidth: number().int().positive().optional(),
13020
+ /**
13021
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13022
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13023
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13024
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13025
+ * no raw pixels cross the process boundary. Same-node callers omit it
13026
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13027
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13028
+ * the caller falls back to encoding locally.
13029
+ */
13030
+ encodeJpeg: boolean().optional()
12966
13031
  }), NativeCropResultSchema.nullable()), method(object({
12967
13032
  deviceId: number(),
12968
13033
  frameHandle: FrameHandleSchema.optional(),
@@ -17680,7 +17745,8 @@ var LinkedDeviceSchema = object({
17680
17745
  deviceId: number(),
17681
17746
  name: string(),
17682
17747
  location: string().nullable(),
17683
- features: array(string())
17748
+ features: array(string()),
17749
+ producesTrackedEvents: boolean().optional()
17684
17750
  });
17685
17751
  var SavedDeviceRowSchema = object({
17686
17752
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19310,6 +19376,7 @@ var TrackSchema = object({
19310
19376
  deviceId: number(),
19311
19377
  className: string(),
19312
19378
  label: string().optional(),
19379
+ producingDeviceName: string().optional(),
19313
19380
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19314
19381
  source: TrackSourceSchema.optional(),
19315
19382
  firstSeen: number(),
@@ -19447,7 +19514,8 @@ var MediaFileKindEnum = _enum([
19447
19514
  "fullFrameBoxed",
19448
19515
  "faceCrop",
19449
19516
  "plateCrop",
19450
- "keyFrame"
19517
+ "keyFrame",
19518
+ "keyFrameSmall"
19451
19519
  ]);
19452
19520
  var MediaFileSchema = object({
19453
19521
  key: string(),
@@ -19778,7 +19846,16 @@ var PipelineTemplateSchema = object({
19778
19846
  });
19779
19847
  var DeviceStepConfigSchema = object({
19780
19848
  modelId: string().optional(),
19781
- settings: record(string(), unknown()).optional()
19849
+ settings: record(string(), unknown()).optional(),
19850
+ /**
19851
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19852
+ * When set, this step runs on the named enabled device of the SAME node
19853
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19854
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19855
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19856
+ * auto-jumps only when the effective device's format cannot run the step.
19857
+ */
19858
+ jumpDeviceKey: string().optional()
19782
19859
  });
19783
19860
  var AgentPipelineSettingsSchema = object({
19784
19861
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-wyze",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Wyze camera device-provider addon for CamStack — wraps the @apocaliss92/wyze-bridge-js P2P/DTLS client, feeding the stream-broker via the pull-rfc4571 lazy-publish path (a structural twin of addon-provider-reolink)",
5
5
  "keywords": [
6
6
  "camstack",