@camstack/addon-provider-petkit 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
@@ -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(),
@@ -17686,7 +17751,8 @@ var LinkedDeviceSchema = object({
17686
17751
  deviceId: number(),
17687
17752
  name: string(),
17688
17753
  location: string().nullable(),
17689
- features: array(string())
17754
+ features: array(string()),
17755
+ producesTrackedEvents: boolean().optional()
17690
17756
  });
17691
17757
  var SavedDeviceRowSchema = object({
17692
17758
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19316,6 +19382,7 @@ var TrackSchema = object({
19316
19382
  deviceId: number(),
19317
19383
  className: string(),
19318
19384
  label: string().optional(),
19385
+ producingDeviceName: string().optional(),
19319
19386
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19320
19387
  source: TrackSourceSchema.optional(),
19321
19388
  firstSeen: number(),
@@ -19453,7 +19520,8 @@ var MediaFileKindEnum = _enum([
19453
19520
  "fullFrameBoxed",
19454
19521
  "faceCrop",
19455
19522
  "plateCrop",
19456
- "keyFrame"
19523
+ "keyFrame",
19524
+ "keyFrameSmall"
19457
19525
  ]);
19458
19526
  var MediaFileSchema = object({
19459
19527
  key: string(),
@@ -19784,7 +19852,16 @@ var PipelineTemplateSchema = object({
19784
19852
  });
19785
19853
  var DeviceStepConfigSchema = object({
19786
19854
  modelId: string().optional(),
19787
- settings: record(string(), unknown()).optional()
19855
+ settings: record(string(), unknown()).optional(),
19856
+ /**
19857
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19858
+ * When set, this step runs on the named enabled device of the SAME node
19859
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19860
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19861
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19862
+ * auto-jumps only when the effective device's format cannot run the step.
19863
+ */
19864
+ jumpDeviceKey: string().optional()
19788
19865
  });
19789
19866
  var AgentPipelineSettingsSchema = object({
19790
19867
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/addon.mjs CHANGED
@@ -12322,7 +12322,8 @@ var PipelineStepInputSchema = lazy(() => object({
12322
12322
  modelId: string().optional(),
12323
12323
  enabled: boolean().default(true),
12324
12324
  children: array(PipelineStepInputSchema).optional(),
12325
- settings: record(string(), unknown()).optional()
12325
+ settings: record(string(), unknown()).optional(),
12326
+ jumpDeviceKey: string().optional()
12326
12327
  }));
12327
12328
  var ModelSubstitutionSchema = object({
12328
12329
  addonId: string(),
@@ -12661,10 +12662,40 @@ var NativeCropBboxSchema = object({
12661
12662
  });
12662
12663
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12663
12664
  var NativeCropResultSchema = object({
12664
- /** Packed rgb (24-bit) pixels of the crop. */
12665
- bytes: _instanceof(Uint8Array),
12665
+ /**
12666
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12667
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12668
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12669
+ * path below), where shipping raw RGB is both an invariant violation and, for
12670
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12671
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12672
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12673
+ */
12674
+ bytes: _instanceof(Uint8Array).optional(),
12675
+ /**
12676
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12677
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12678
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12679
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12680
+ * set `encodeJpeg: true`; `bytes` is then absent.
12681
+ */
12682
+ jpeg: string().optional(),
12666
12683
  width: number().int().positive(),
12667
- height: number().int().positive()
12684
+ height: number().int().positive(),
12685
+ /**
12686
+ * Which source served this crop, so a quality-sensitive consumer (the native
12687
+ * `keyFrame`) can reject a degraded fallback:
12688
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12689
+ * quality path).
12690
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12691
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12692
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12693
+ *
12694
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12695
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12696
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12697
+ */
12698
+ tier: _enum(["native", "ram-fullframe"]).optional()
12668
12699
  });
12669
12700
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12670
12701
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12794,6 +12825,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12794
12825
  hubHostnameOverride: string().optional()
12795
12826
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12796
12827
  /**
12828
+ * One ENABLED inference device on the runner's node, as the step-tree
12829
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12830
+ * roster on the attach payload whenever the camera is elected onto a specific
12831
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12832
+ * runner auto-jumps an enrichment step to when the elected device's format
12833
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12834
+ * per-device knobs so the auto choice is weighted-least-loaded.
12835
+ */
12836
+ var RunnerInferenceDeviceSchema = object({
12837
+ deviceKey: string(),
12838
+ weight: number().positive().default(1),
12839
+ maxSessions: number().int().positive().nullable().default(null)
12840
+ });
12841
+ /**
12797
12842
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12798
12843
  * specific runner instance via `attachCamera`. Carries everything the
12799
12844
  * runner needs to subscribe to the local broker and execute inference.
@@ -12911,7 +12956,16 @@ var RunnerCameraConfigSchema = object({
12911
12956
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12912
12957
  * this only selects WHICH device pool of that node runs the session.
12913
12958
  */
12914
- deviceKey: string().optional()
12959
+ deviceKey: string().optional(),
12960
+ /**
12961
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
12962
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
12963
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
12964
+ * step whose model has no build for the elected device's format onto another
12965
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
12966
+ * ⇒ no jump possible; the step runs on `deviceKey`.
12967
+ */
12968
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
12915
12969
  });
12916
12970
  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;
12917
12971
  /**
@@ -12967,7 +13021,18 @@ var RunnerLocalMetricsSchema = object({
12967
13021
  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({
12968
13022
  handle: FrameHandleSchema,
12969
13023
  bbox: NativeCropBboxSchema,
12970
- maxWidth: number().int().positive().optional()
13024
+ maxWidth: number().int().positive().optional(),
13025
+ /**
13026
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13027
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13028
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13029
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13030
+ * no raw pixels cross the process boundary. Same-node callers omit it
13031
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13032
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13033
+ * the caller falls back to encoding locally.
13034
+ */
13035
+ encodeJpeg: boolean().optional()
12971
13036
  }), NativeCropResultSchema.nullable()), method(object({
12972
13037
  deviceId: number(),
12973
13038
  frameHandle: FrameHandleSchema.optional(),
@@ -17685,7 +17750,8 @@ var LinkedDeviceSchema = object({
17685
17750
  deviceId: number(),
17686
17751
  name: string(),
17687
17752
  location: string().nullable(),
17688
- features: array(string())
17753
+ features: array(string()),
17754
+ producesTrackedEvents: boolean().optional()
17689
17755
  });
17690
17756
  var SavedDeviceRowSchema = object({
17691
17757
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19315,6 +19381,7 @@ var TrackSchema = object({
19315
19381
  deviceId: number(),
19316
19382
  className: string(),
19317
19383
  label: string().optional(),
19384
+ producingDeviceName: string().optional(),
19318
19385
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19319
19386
  source: TrackSourceSchema.optional(),
19320
19387
  firstSeen: number(),
@@ -19452,7 +19519,8 @@ var MediaFileKindEnum = _enum([
19452
19519
  "fullFrameBoxed",
19453
19520
  "faceCrop",
19454
19521
  "plateCrop",
19455
- "keyFrame"
19522
+ "keyFrame",
19523
+ "keyFrameSmall"
19456
19524
  ]);
19457
19525
  var MediaFileSchema = object({
19458
19526
  key: string(),
@@ -19783,7 +19851,16 @@ var PipelineTemplateSchema = object({
19783
19851
  });
19784
19852
  var DeviceStepConfigSchema = object({
19785
19853
  modelId: string().optional(),
19786
- settings: record(string(), unknown()).optional()
19854
+ settings: record(string(), unknown()).optional(),
19855
+ /**
19856
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19857
+ * When set, this step runs on the named enabled device of the SAME node
19858
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19859
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19860
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19861
+ * auto-jumps only when the effective device's format cannot run the step.
19862
+ */
19863
+ jumpDeviceKey: string().optional()
19787
19864
  });
19788
19865
  var AgentPipelineSettingsSchema = object({
19789
19866
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",