@camstack/addon-provider-amcrest 0.2.1 → 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,8 +12730,24 @@ 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
12752
  height: number().int().positive(),
12736
12753
  /**
@@ -12876,6 +12893,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12876
12893
  hubHostnameOverride: string().optional()
12877
12894
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12878
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
+ /**
12879
12910
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12880
12911
  * specific runner instance via `attachCamera`. Carries everything the
12881
12912
  * runner needs to subscribe to the local broker and execute inference.
@@ -12993,7 +13024,16 @@ var RunnerCameraConfigSchema = object({
12993
13024
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12994
13025
  * this only selects WHICH device pool of that node runs the session.
12995
13026
  */
12996
- 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()
12997
13037
  });
12998
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;
12999
13039
  /**
@@ -13049,7 +13089,18 @@ var RunnerLocalMetricsSchema = object({
13049
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({
13050
13090
  handle: FrameHandleSchema,
13051
13091
  bbox: NativeCropBboxSchema,
13052
- 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()
13053
13104
  }), NativeCropResultSchema.nullable()), method(object({
13054
13105
  deviceId: number(),
13055
13106
  frameHandle: FrameHandleSchema.optional(),
@@ -19851,7 +19902,16 @@ var PipelineTemplateSchema = object({
19851
19902
  });
19852
19903
  var DeviceStepConfigSchema = object({
19853
19904
  modelId: string().optional(),
19854
- 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()
19855
19915
  });
19856
19916
  var AgentPipelineSettingsSchema = object({
19857
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,8 +12731,24 @@ 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
12753
  height: number().int().positive(),
12737
12754
  /**
@@ -12877,6 +12894,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12877
12894
  hubHostnameOverride: string().optional()
12878
12895
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12879
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
+ /**
12880
12911
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12881
12912
  * specific runner instance via `attachCamera`. Carries everything the
12882
12913
  * runner needs to subscribe to the local broker and execute inference.
@@ -12994,7 +13025,16 @@ var RunnerCameraConfigSchema = object({
12994
13025
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12995
13026
  * this only selects WHICH device pool of that node runs the session.
12996
13027
  */
12997
- 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()
12998
13038
  });
12999
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;
13000
13040
  /**
@@ -13050,7 +13090,18 @@ var RunnerLocalMetricsSchema = object({
13050
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({
13051
13091
  handle: FrameHandleSchema,
13052
13092
  bbox: NativeCropBboxSchema,
13053
- 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()
13054
13105
  }), NativeCropResultSchema.nullable()), method(object({
13055
13106
  deviceId: number(),
13056
13107
  frameHandle: FrameHandleSchema.optional(),
@@ -19852,7 +19903,16 @@ var PipelineTemplateSchema = object({
19852
19903
  });
19853
19904
  var DeviceStepConfigSchema = object({
19854
19905
  modelId: string().optional(),
19855
- 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()
19856
19916
  });
19857
19917
  var AgentPipelineSettingsSchema = object({
19858
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.1",
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",