@camstack/addon-provider-amcrest 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
@@ -12390,7 +12390,8 @@ var PipelineStepInputSchema = lazy(() => object({
12390
12390
  modelId: string().optional(),
12391
12391
  enabled: boolean().default(true),
12392
12392
  children: array(PipelineStepInputSchema).optional(),
12393
- settings: record(string(), unknown()).optional()
12393
+ settings: record(string(), unknown()).optional(),
12394
+ jumpDeviceKey: string().optional()
12394
12395
  }));
12395
12396
  var ModelSubstitutionSchema = object({
12396
12397
  addonId: string(),
@@ -12729,10 +12730,40 @@ var NativeCropBboxSchema = object({
12729
12730
  });
12730
12731
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12731
12732
  var NativeCropResultSchema = object({
12732
- /** Packed rgb (24-bit) pixels of the crop. */
12733
- bytes: _instanceof(Uint8Array),
12733
+ /**
12734
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12735
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12736
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12737
+ * path below), where shipping raw RGB is both an invariant violation and, for
12738
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12739
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12740
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12741
+ */
12742
+ bytes: _instanceof(Uint8Array).optional(),
12743
+ /**
12744
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12745
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12746
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12747
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12748
+ * set `encodeJpeg: true`; `bytes` is then absent.
12749
+ */
12750
+ jpeg: string().optional(),
12734
12751
  width: number().int().positive(),
12735
- height: number().int().positive()
12752
+ height: number().int().positive(),
12753
+ /**
12754
+ * Which source served this crop, so a quality-sensitive consumer (the native
12755
+ * `keyFrame`) can reject a degraded fallback:
12756
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12757
+ * quality path).
12758
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12759
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12760
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12761
+ *
12762
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12763
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12764
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12765
+ */
12766
+ tier: _enum(["native", "ram-fullframe"]).optional()
12736
12767
  });
12737
12768
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12738
12769
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12862,6 +12893,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12862
12893
  hubHostnameOverride: string().optional()
12863
12894
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12864
12895
  /**
12896
+ * One ENABLED inference device on the runner's node, as the step-tree
12897
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12898
+ * roster on the attach payload whenever the camera is elected onto a specific
12899
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12900
+ * runner auto-jumps an enrichment step to when the elected device's format
12901
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12902
+ * per-device knobs so the auto choice is weighted-least-loaded.
12903
+ */
12904
+ var RunnerInferenceDeviceSchema = object({
12905
+ deviceKey: string(),
12906
+ weight: number().positive().default(1),
12907
+ maxSessions: number().int().positive().nullable().default(null)
12908
+ });
12909
+ /**
12865
12910
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12866
12911
  * specific runner instance via `attachCamera`. Carries everything the
12867
12912
  * runner needs to subscribe to the local broker and execute inference.
@@ -12979,7 +13024,16 @@ var RunnerCameraConfigSchema = object({
12979
13024
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12980
13025
  * this only selects WHICH device pool of that node runs the session.
12981
13026
  */
12982
- deviceKey: string().optional()
13027
+ deviceKey: string().optional(),
13028
+ /**
13029
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
13030
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
13031
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
13032
+ * step whose model has no build for the elected device's format onto another
13033
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
13034
+ * ⇒ no jump possible; the step runs on `deviceKey`.
13035
+ */
13036
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
12983
13037
  });
12984
13038
  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;
12985
13039
  /**
@@ -13035,7 +13089,18 @@ var RunnerLocalMetricsSchema = object({
13035
13089
  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({
13036
13090
  handle: FrameHandleSchema,
13037
13091
  bbox: NativeCropBboxSchema,
13038
- maxWidth: number().int().positive().optional()
13092
+ maxWidth: number().int().positive().optional(),
13093
+ /**
13094
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13095
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13096
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13097
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13098
+ * no raw pixels cross the process boundary. Same-node callers omit it
13099
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13100
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13101
+ * the caller falls back to encoding locally.
13102
+ */
13103
+ encodeJpeg: boolean().optional()
13039
13104
  }), NativeCropResultSchema.nullable()), method(object({
13040
13105
  deviceId: number(),
13041
13106
  frameHandle: FrameHandleSchema.optional(),
@@ -17736,7 +17801,8 @@ var LinkedDeviceSchema = object({
17736
17801
  deviceId: number(),
17737
17802
  name: string(),
17738
17803
  location: string().nullable(),
17739
- features: array(string())
17804
+ features: array(string()),
17805
+ producesTrackedEvents: boolean().optional()
17740
17806
  });
17741
17807
  var SavedDeviceRowSchema = object({
17742
17808
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19366,6 +19432,7 @@ var TrackSchema = object({
19366
19432
  deviceId: number(),
19367
19433
  className: string(),
19368
19434
  label: string().optional(),
19435
+ producingDeviceName: string().optional(),
19369
19436
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19370
19437
  source: TrackSourceSchema.optional(),
19371
19438
  firstSeen: number(),
@@ -19503,7 +19570,8 @@ var MediaFileKindEnum = _enum([
19503
19570
  "fullFrameBoxed",
19504
19571
  "faceCrop",
19505
19572
  "plateCrop",
19506
- "keyFrame"
19573
+ "keyFrame",
19574
+ "keyFrameSmall"
19507
19575
  ]);
19508
19576
  var MediaFileSchema = object({
19509
19577
  key: string(),
@@ -19834,7 +19902,16 @@ var PipelineTemplateSchema = object({
19834
19902
  });
19835
19903
  var DeviceStepConfigSchema = object({
19836
19904
  modelId: string().optional(),
19837
- settings: record(string(), unknown()).optional()
19905
+ settings: record(string(), unknown()).optional(),
19906
+ /**
19907
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19908
+ * When set, this step runs on the named enabled device of the SAME node
19909
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19910
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19911
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19912
+ * auto-jumps only when the effective device's format cannot run the step.
19913
+ */
19914
+ jumpDeviceKey: string().optional()
19838
19915
  });
19839
19916
  var AgentPipelineSettingsSchema = object({
19840
19917
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/addon.mjs CHANGED
@@ -12391,7 +12391,8 @@ var PipelineStepInputSchema = lazy(() => object({
12391
12391
  modelId: string().optional(),
12392
12392
  enabled: boolean().default(true),
12393
12393
  children: array(PipelineStepInputSchema).optional(),
12394
- settings: record(string(), unknown()).optional()
12394
+ settings: record(string(), unknown()).optional(),
12395
+ jumpDeviceKey: string().optional()
12395
12396
  }));
12396
12397
  var ModelSubstitutionSchema = object({
12397
12398
  addonId: string(),
@@ -12730,10 +12731,40 @@ var NativeCropBboxSchema = object({
12730
12731
  });
12731
12732
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12732
12733
  var NativeCropResultSchema = object({
12733
- /** Packed rgb (24-bit) pixels of the crop. */
12734
- bytes: _instanceof(Uint8Array),
12734
+ /**
12735
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12736
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12737
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12738
+ * path below), where shipping raw RGB is both an invariant violation and, for
12739
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12740
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12741
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12742
+ */
12743
+ bytes: _instanceof(Uint8Array).optional(),
12744
+ /**
12745
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12746
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12747
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12748
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12749
+ * set `encodeJpeg: true`; `bytes` is then absent.
12750
+ */
12751
+ jpeg: string().optional(),
12735
12752
  width: number().int().positive(),
12736
- height: number().int().positive()
12753
+ height: number().int().positive(),
12754
+ /**
12755
+ * Which source served this crop, so a quality-sensitive consumer (the native
12756
+ * `keyFrame`) can reject a degraded fallback:
12757
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12758
+ * quality path).
12759
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12760
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12761
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12762
+ *
12763
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12764
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12765
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12766
+ */
12767
+ tier: _enum(["native", "ram-fullframe"]).optional()
12737
12768
  });
12738
12769
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12739
12770
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12863,6 +12894,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12863
12894
  hubHostnameOverride: string().optional()
12864
12895
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12865
12896
  /**
12897
+ * One ENABLED inference device on the runner's node, as the step-tree
12898
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12899
+ * roster on the attach payload whenever the camera is elected onto a specific
12900
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12901
+ * runner auto-jumps an enrichment step to when the elected device's format
12902
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12903
+ * per-device knobs so the auto choice is weighted-least-loaded.
12904
+ */
12905
+ var RunnerInferenceDeviceSchema = object({
12906
+ deviceKey: string(),
12907
+ weight: number().positive().default(1),
12908
+ maxSessions: number().int().positive().nullable().default(null)
12909
+ });
12910
+ /**
12866
12911
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12867
12912
  * specific runner instance via `attachCamera`. Carries everything the
12868
12913
  * runner needs to subscribe to the local broker and execute inference.
@@ -12980,7 +13025,16 @@ var RunnerCameraConfigSchema = object({
12980
13025
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12981
13026
  * this only selects WHICH device pool of that node runs the session.
12982
13027
  */
12983
- deviceKey: string().optional()
13028
+ deviceKey: string().optional(),
13029
+ /**
13030
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
13031
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
13032
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
13033
+ * step whose model has no build for the elected device's format onto another
13034
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
13035
+ * ⇒ no jump possible; the step runs on `deviceKey`.
13036
+ */
13037
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
12984
13038
  });
12985
13039
  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;
12986
13040
  /**
@@ -13036,7 +13090,18 @@ var RunnerLocalMetricsSchema = object({
13036
13090
  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({
13037
13091
  handle: FrameHandleSchema,
13038
13092
  bbox: NativeCropBboxSchema,
13039
- maxWidth: number().int().positive().optional()
13093
+ maxWidth: number().int().positive().optional(),
13094
+ /**
13095
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13096
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13097
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13098
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13099
+ * no raw pixels cross the process boundary. Same-node callers omit it
13100
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13101
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13102
+ * the caller falls back to encoding locally.
13103
+ */
13104
+ encodeJpeg: boolean().optional()
13040
13105
  }), NativeCropResultSchema.nullable()), method(object({
13041
13106
  deviceId: number(),
13042
13107
  frameHandle: FrameHandleSchema.optional(),
@@ -17737,7 +17802,8 @@ var LinkedDeviceSchema = object({
17737
17802
  deviceId: number(),
17738
17803
  name: string(),
17739
17804
  location: string().nullable(),
17740
- features: array(string())
17805
+ features: array(string()),
17806
+ producesTrackedEvents: boolean().optional()
17741
17807
  });
17742
17808
  var SavedDeviceRowSchema = object({
17743
17809
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19367,6 +19433,7 @@ var TrackSchema = object({
19367
19433
  deviceId: number(),
19368
19434
  className: string(),
19369
19435
  label: string().optional(),
19436
+ producingDeviceName: string().optional(),
19370
19437
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19371
19438
  source: TrackSourceSchema.optional(),
19372
19439
  firstSeen: number(),
@@ -19504,7 +19571,8 @@ var MediaFileKindEnum = _enum([
19504
19571
  "fullFrameBoxed",
19505
19572
  "faceCrop",
19506
19573
  "plateCrop",
19507
- "keyFrame"
19574
+ "keyFrame",
19575
+ "keyFrameSmall"
19508
19576
  ]);
19509
19577
  var MediaFileSchema = object({
19510
19578
  key: string(),
@@ -19835,7 +19903,16 @@ var PipelineTemplateSchema = object({
19835
19903
  });
19836
19904
  var DeviceStepConfigSchema = object({
19837
19905
  modelId: string().optional(),
19838
- settings: record(string(), unknown()).optional()
19906
+ settings: record(string(), unknown()).optional(),
19907
+ /**
19908
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19909
+ * When set, this step runs on the named enabled device of the SAME node
19910
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19911
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19912
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19913
+ * auto-jumps only when the effective device's format cannot run the step.
19914
+ */
19915
+ jumpDeviceKey: string().optional()
19839
19916
  });
19840
19917
  var AgentPipelineSettingsSchema = object({
19841
19918
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-amcrest",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Amcrest/Dahua camera device provider addon for CamStack — Dahua CGI over HTTP(S) with digest auth (snapshot, RTSP catalog, PTZ, image/day-night config)",
5
5
  "keywords": [
6
6
  "camstack",