@camstack/addon-matter-broker 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
@@ -12335,7 +12335,8 @@ var PipelineStepInputSchema = lazy(() => object({
12335
12335
  modelId: string$2().optional(),
12336
12336
  enabled: boolean().default(true),
12337
12337
  children: array(PipelineStepInputSchema).optional(),
12338
- settings: record(string$2(), unknown()).optional()
12338
+ settings: record(string$2(), unknown()).optional(),
12339
+ jumpDeviceKey: string$2().optional()
12339
12340
  }));
12340
12341
  var ModelSubstitutionSchema = object({
12341
12342
  addonId: string$2(),
@@ -12674,8 +12675,24 @@ var NativeCropBboxSchema = object({
12674
12675
  });
12675
12676
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12676
12677
  var NativeCropResultSchema = object({
12677
- /** Packed rgb (24-bit) pixels of the crop. */
12678
- bytes: _instanceof(Uint8Array),
12678
+ /**
12679
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12680
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12681
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12682
+ * path below), where shipping raw RGB is both an invariant violation and, for
12683
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12684
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12685
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12686
+ */
12687
+ bytes: _instanceof(Uint8Array).optional(),
12688
+ /**
12689
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12690
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12691
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12692
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12693
+ * set `encodeJpeg: true`; `bytes` is then absent.
12694
+ */
12695
+ jpeg: string$2().optional(),
12679
12696
  width: number().int().positive(),
12680
12697
  height: number().int().positive(),
12681
12698
  /**
@@ -12821,6 +12838,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12821
12838
  hubHostnameOverride: string$2().optional()
12822
12839
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12823
12840
  /**
12841
+ * One ENABLED inference device on the runner's node, as the step-tree
12842
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12843
+ * roster on the attach payload whenever the camera is elected onto a specific
12844
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12845
+ * runner auto-jumps an enrichment step to when the elected device's format
12846
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12847
+ * per-device knobs so the auto choice is weighted-least-loaded.
12848
+ */
12849
+ var RunnerInferenceDeviceSchema = object({
12850
+ deviceKey: string$2(),
12851
+ weight: number().positive().default(1),
12852
+ maxSessions: number().int().positive().nullable().default(null)
12853
+ });
12854
+ /**
12824
12855
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12825
12856
  * specific runner instance via `attachCamera`. Carries everything the
12826
12857
  * runner needs to subscribe to the local broker and execute inference.
@@ -12938,7 +12969,16 @@ var RunnerCameraConfigSchema = object({
12938
12969
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12939
12970
  * this only selects WHICH device pool of that node runs the session.
12940
12971
  */
12941
- deviceKey: string$2().optional()
12972
+ deviceKey: string$2().optional(),
12973
+ /**
12974
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
12975
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
12976
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
12977
+ * step whose model has no build for the elected device's format onto another
12978
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
12979
+ * ⇒ no jump possible; the step runs on `deviceKey`.
12980
+ */
12981
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
12942
12982
  });
12943
12983
  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;
12944
12984
  /**
@@ -12994,7 +13034,18 @@ var RunnerLocalMetricsSchema = object({
12994
13034
  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({
12995
13035
  handle: FrameHandleSchema,
12996
13036
  bbox: NativeCropBboxSchema,
12997
- maxWidth: number().int().positive().optional()
13037
+ maxWidth: number().int().positive().optional(),
13038
+ /**
13039
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13040
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13041
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13042
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13043
+ * no raw pixels cross the process boundary. Same-node callers omit it
13044
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13045
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13046
+ * the caller falls back to encoding locally.
13047
+ */
13048
+ encodeJpeg: boolean().optional()
12998
13049
  }), NativeCropResultSchema.nullable()), method(object({
12999
13050
  deviceId: number(),
13000
13051
  frameHandle: FrameHandleSchema.optional(),
@@ -19862,7 +19913,16 @@ var PipelineTemplateSchema = object({
19862
19913
  });
19863
19914
  var DeviceStepConfigSchema = object({
19864
19915
  modelId: string$2().optional(),
19865
- settings: record(string$2(), unknown()).optional()
19916
+ settings: record(string$2(), unknown()).optional(),
19917
+ /**
19918
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19919
+ * When set, this step runs on the named enabled device of the SAME node
19920
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19921
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19922
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19923
+ * auto-jumps only when the effective device's format cannot run the step.
19924
+ */
19925
+ jumpDeviceKey: string$2().optional()
19866
19926
  });
19867
19927
  var AgentPipelineSettingsSchema = object({
19868
19928
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/addon.mjs CHANGED
@@ -12333,7 +12333,8 @@ var PipelineStepInputSchema = lazy(() => object({
12333
12333
  modelId: string$2().optional(),
12334
12334
  enabled: boolean().default(true),
12335
12335
  children: array(PipelineStepInputSchema).optional(),
12336
- settings: record(string$2(), unknown()).optional()
12336
+ settings: record(string$2(), unknown()).optional(),
12337
+ jumpDeviceKey: string$2().optional()
12337
12338
  }));
12338
12339
  var ModelSubstitutionSchema = object({
12339
12340
  addonId: string$2(),
@@ -12672,8 +12673,24 @@ var NativeCropBboxSchema = object({
12672
12673
  });
12673
12674
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12674
12675
  var NativeCropResultSchema = object({
12675
- /** Packed rgb (24-bit) pixels of the crop. */
12676
- bytes: _instanceof(Uint8Array),
12676
+ /**
12677
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12678
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12679
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12680
+ * path below), where shipping raw RGB is both an invariant violation and, for
12681
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12682
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12683
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12684
+ */
12685
+ bytes: _instanceof(Uint8Array).optional(),
12686
+ /**
12687
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12688
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12689
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12690
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12691
+ * set `encodeJpeg: true`; `bytes` is then absent.
12692
+ */
12693
+ jpeg: string$2().optional(),
12677
12694
  width: number().int().positive(),
12678
12695
  height: number().int().positive(),
12679
12696
  /**
@@ -12819,6 +12836,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12819
12836
  hubHostnameOverride: string$2().optional()
12820
12837
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12821
12838
  /**
12839
+ * One ENABLED inference device on the runner's node, as the step-tree
12840
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12841
+ * roster on the attach payload whenever the camera is elected onto a specific
12842
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12843
+ * runner auto-jumps an enrichment step to when the elected device's format
12844
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12845
+ * per-device knobs so the auto choice is weighted-least-loaded.
12846
+ */
12847
+ var RunnerInferenceDeviceSchema = object({
12848
+ deviceKey: string$2(),
12849
+ weight: number().positive().default(1),
12850
+ maxSessions: number().int().positive().nullable().default(null)
12851
+ });
12852
+ /**
12822
12853
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12823
12854
  * specific runner instance via `attachCamera`. Carries everything the
12824
12855
  * runner needs to subscribe to the local broker and execute inference.
@@ -12936,7 +12967,16 @@ var RunnerCameraConfigSchema = object({
12936
12967
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
12937
12968
  * this only selects WHICH device pool of that node runs the session.
12938
12969
  */
12939
- deviceKey: string$2().optional()
12970
+ deviceKey: string$2().optional(),
12971
+ /**
12972
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
12973
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
12974
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
12975
+ * step whose model has no build for the elected device's format onto another
12976
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
12977
+ * ⇒ no jump possible; the step runs on `deviceKey`.
12978
+ */
12979
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
12940
12980
  });
12941
12981
  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;
12942
12982
  /**
@@ -12992,7 +13032,18 @@ var RunnerLocalMetricsSchema = object({
12992
13032
  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({
12993
13033
  handle: FrameHandleSchema,
12994
13034
  bbox: NativeCropBboxSchema,
12995
- maxWidth: number().int().positive().optional()
13035
+ maxWidth: number().int().positive().optional(),
13036
+ /**
13037
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13038
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13039
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13040
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13041
+ * no raw pixels cross the process boundary. Same-node callers omit it
13042
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13043
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13044
+ * the caller falls back to encoding locally.
13045
+ */
13046
+ encodeJpeg: boolean().optional()
12996
13047
  }), NativeCropResultSchema.nullable()), method(object({
12997
13048
  deviceId: number(),
12998
13049
  frameHandle: FrameHandleSchema.optional(),
@@ -19860,7 +19911,16 @@ var PipelineTemplateSchema = object({
19860
19911
  });
19861
19912
  var DeviceStepConfigSchema = object({
19862
19913
  modelId: string$2().optional(),
19863
- settings: record(string$2(), unknown()).optional()
19914
+ settings: record(string$2(), unknown()).optional(),
19915
+ /**
19916
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
19917
+ * When set, this step runs on the named enabled device of the SAME node
19918
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
19919
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
19920
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
19921
+ * auto-jumps only when the effective device's format cannot run the step.
19922
+ */
19923
+ jumpDeviceKey: string$2().optional()
19864
19924
  });
19865
19925
  var AgentPipelineSettingsSchema = object({
19866
19926
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-matter-broker",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
5
5
  "keywords": [
6
6
  "camstack",