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