@camstack/addon-import-alexa 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
@@ -12477,7 +12477,8 @@ var PipelineStepInputSchema = lazy(() => object({
12477
12477
  modelId: string().optional(),
12478
12478
  enabled: boolean().default(true),
12479
12479
  children: array(PipelineStepInputSchema).optional(),
12480
- settings: record(string(), unknown()).optional()
12480
+ settings: record(string(), unknown()).optional(),
12481
+ jumpDeviceKey: string().optional()
12481
12482
  }));
12482
12483
  var ModelSubstitutionSchema = object({
12483
12484
  addonId: string(),
@@ -12816,10 +12817,40 @@ var NativeCropBboxSchema = object({
12816
12817
  });
12817
12818
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12818
12819
  var NativeCropResultSchema = object({
12819
- /** Packed rgb (24-bit) pixels of the crop. */
12820
- bytes: _instanceof(Uint8Array),
12820
+ /**
12821
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12822
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12823
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12824
+ * path below), where shipping raw RGB is both an invariant violation and, for
12825
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12826
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12827
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12828
+ */
12829
+ bytes: _instanceof(Uint8Array).optional(),
12830
+ /**
12831
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12832
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12833
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12834
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12835
+ * set `encodeJpeg: true`; `bytes` is then absent.
12836
+ */
12837
+ jpeg: string().optional(),
12821
12838
  width: number().int().positive(),
12822
- height: number().int().positive()
12839
+ height: number().int().positive(),
12840
+ /**
12841
+ * Which source served this crop, so a quality-sensitive consumer (the native
12842
+ * `keyFrame`) can reject a degraded fallback:
12843
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12844
+ * quality path).
12845
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12846
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12847
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12848
+ *
12849
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12850
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12851
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12852
+ */
12853
+ tier: _enum(["native", "ram-fullframe"]).optional()
12823
12854
  });
12824
12855
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12825
12856
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12949,6 +12980,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12949
12980
  hubHostnameOverride: string().optional()
12950
12981
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12951
12982
  /**
12983
+ * One ENABLED inference device on the runner's node, as the step-tree
12984
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12985
+ * roster on the attach payload whenever the camera is elected onto a specific
12986
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12987
+ * runner auto-jumps an enrichment step to when the elected device's format
12988
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12989
+ * per-device knobs so the auto choice is weighted-least-loaded.
12990
+ */
12991
+ var RunnerInferenceDeviceSchema = object({
12992
+ deviceKey: string(),
12993
+ weight: number().positive().default(1),
12994
+ maxSessions: number().int().positive().nullable().default(null)
12995
+ });
12996
+ /**
12952
12997
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12953
12998
  * specific runner instance via `attachCamera`. Carries everything the
12954
12999
  * runner needs to subscribe to the local broker and execute inference.
@@ -13066,7 +13111,16 @@ var RunnerCameraConfigSchema = object({
13066
13111
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
13067
13112
  * this only selects WHICH device pool of that node runs the session.
13068
13113
  */
13069
- deviceKey: string().optional()
13114
+ deviceKey: string().optional(),
13115
+ /**
13116
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
13117
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
13118
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
13119
+ * step whose model has no build for the elected device's format onto another
13120
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
13121
+ * ⇒ no jump possible; the step runs on `deviceKey`.
13122
+ */
13123
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
13070
13124
  });
13071
13125
  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;
13072
13126
  /**
@@ -13122,7 +13176,18 @@ var RunnerLocalMetricsSchema = object({
13122
13176
  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({
13123
13177
  handle: FrameHandleSchema,
13124
13178
  bbox: NativeCropBboxSchema,
13125
- maxWidth: number().int().positive().optional()
13179
+ maxWidth: number().int().positive().optional(),
13180
+ /**
13181
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13182
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13183
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13184
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13185
+ * no raw pixels cross the process boundary. Same-node callers omit it
13186
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13187
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13188
+ * the caller falls back to encoding locally.
13189
+ */
13190
+ encodeJpeg: boolean().optional()
13126
13191
  }), NativeCropResultSchema.nullable()), method(object({
13127
13192
  deviceId: number(),
13128
13193
  frameHandle: FrameHandleSchema.optional(),
@@ -17908,7 +17973,8 @@ var LinkedDeviceSchema = object({
17908
17973
  deviceId: number(),
17909
17974
  name: string(),
17910
17975
  location: string().nullable(),
17911
- features: array(string())
17976
+ features: array(string()),
17977
+ producesTrackedEvents: boolean().optional()
17912
17978
  });
17913
17979
  var SavedDeviceRowSchema = object({
17914
17980
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19538,6 +19604,7 @@ var TrackSchema = object({
19538
19604
  deviceId: number(),
19539
19605
  className: string(),
19540
19606
  label: string().optional(),
19607
+ producingDeviceName: string().optional(),
19541
19608
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19542
19609
  source: TrackSourceSchema.optional(),
19543
19610
  firstSeen: number(),
@@ -19675,7 +19742,8 @@ var MediaFileKindEnum = _enum([
19675
19742
  "fullFrameBoxed",
19676
19743
  "faceCrop",
19677
19744
  "plateCrop",
19678
- "keyFrame"
19745
+ "keyFrame",
19746
+ "keyFrameSmall"
19679
19747
  ]);
19680
19748
  var MediaFileSchema = object({
19681
19749
  key: string(),
@@ -20006,7 +20074,16 @@ var PipelineTemplateSchema = object({
20006
20074
  });
20007
20075
  var DeviceStepConfigSchema = object({
20008
20076
  modelId: string().optional(),
20009
- settings: record(string(), unknown()).optional()
20077
+ settings: record(string(), unknown()).optional(),
20078
+ /**
20079
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
20080
+ * When set, this step runs on the named enabled device of the SAME node
20081
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
20082
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
20083
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
20084
+ * auto-jumps only when the effective device's format cannot run the step.
20085
+ */
20086
+ jumpDeviceKey: string().optional()
20010
20087
  });
20011
20088
  var AgentPipelineSettingsSchema = object({
20012
20089
  maxCameras: number().int().nonnegative().nullable().default(null),
package/dist/addon.mjs CHANGED
@@ -12477,7 +12477,8 @@ var PipelineStepInputSchema = lazy(() => object({
12477
12477
  modelId: string().optional(),
12478
12478
  enabled: boolean().default(true),
12479
12479
  children: array(PipelineStepInputSchema).optional(),
12480
- settings: record(string(), unknown()).optional()
12480
+ settings: record(string(), unknown()).optional(),
12481
+ jumpDeviceKey: string().optional()
12481
12482
  }));
12482
12483
  var ModelSubstitutionSchema = object({
12483
12484
  addonId: string(),
@@ -12816,10 +12817,40 @@ var NativeCropBboxSchema = object({
12816
12817
  });
12817
12818
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12818
12819
  var NativeCropResultSchema = object({
12819
- /** Packed rgb (24-bit) pixels of the crop. */
12820
- bytes: _instanceof(Uint8Array),
12820
+ /**
12821
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
12822
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
12823
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
12824
+ * path below), where shipping raw RGB is both an invariant violation and, for
12825
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
12826
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
12827
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
12828
+ */
12829
+ bytes: _instanceof(Uint8Array).optional(),
12830
+ /**
12831
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
12832
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
12833
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
12834
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
12835
+ * set `encodeJpeg: true`; `bytes` is then absent.
12836
+ */
12837
+ jpeg: string().optional(),
12821
12838
  width: number().int().positive(),
12822
- height: number().int().positive()
12839
+ height: number().int().positive(),
12840
+ /**
12841
+ * Which source served this crop, so a quality-sensitive consumer (the native
12842
+ * `keyFrame`) can reject a degraded fallback:
12843
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
12844
+ * quality path).
12845
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
12846
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
12847
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
12848
+ *
12849
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
12850
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
12851
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
12852
+ */
12853
+ tier: _enum(["native", "ram-fullframe"]).optional()
12823
12854
  });
12824
12855
  /** Parent detection context passed to `runDetailSubtree` — the crop's
12825
12856
  * originating detection, in FRAME-space coordinates. Reuses
@@ -12949,6 +12980,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12949
12980
  hubHostnameOverride: string().optional()
12950
12981
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
12951
12982
  /**
12983
+ * One ENABLED inference device on the runner's node, as the step-tree
12984
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
12985
+ * roster on the attach payload whenever the camera is elected onto a specific
12986
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
12987
+ * runner auto-jumps an enrichment step to when the elected device's format
12988
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
12989
+ * per-device knobs so the auto choice is weighted-least-loaded.
12990
+ */
12991
+ var RunnerInferenceDeviceSchema = object({
12992
+ deviceKey: string(),
12993
+ weight: number().positive().default(1),
12994
+ maxSessions: number().int().positive().nullable().default(null)
12995
+ });
12996
+ /**
12952
12997
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
12953
12998
  * specific runner instance via `attachCamera`. Carries everything the
12954
12999
  * runner needs to subscribe to the local broker and execute inference.
@@ -13066,7 +13111,16 @@ var RunnerCameraConfigSchema = object({
13066
13111
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
13067
13112
  * this only selects WHICH device pool of that node runs the session.
13068
13113
  */
13069
- deviceKey: string().optional()
13114
+ deviceKey: string().optional(),
13115
+ /**
13116
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
13117
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
13118
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
13119
+ * step whose model has no build for the elected device's format onto another
13120
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
13121
+ * ⇒ no jump possible; the step runs on `deviceKey`.
13122
+ */
13123
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
13070
13124
  });
13071
13125
  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;
13072
13126
  /**
@@ -13122,7 +13176,18 @@ var RunnerLocalMetricsSchema = object({
13122
13176
  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({
13123
13177
  handle: FrameHandleSchema,
13124
13178
  bbox: NativeCropBboxSchema,
13125
- maxWidth: number().int().positive().optional()
13179
+ maxWidth: number().int().positive().optional(),
13180
+ /**
13181
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
13182
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
13183
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
13184
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
13185
+ * no raw pixels cross the process boundary. Same-node callers omit it
13186
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
13187
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
13188
+ * the caller falls back to encoding locally.
13189
+ */
13190
+ encodeJpeg: boolean().optional()
13126
13191
  }), NativeCropResultSchema.nullable()), method(object({
13127
13192
  deviceId: number(),
13128
13193
  frameHandle: FrameHandleSchema.optional(),
@@ -17908,7 +17973,8 @@ var LinkedDeviceSchema = object({
17908
17973
  deviceId: number(),
17909
17974
  name: string(),
17910
17975
  location: string().nullable(),
17911
- features: array(string())
17976
+ features: array(string()),
17977
+ producesTrackedEvents: boolean().optional()
17912
17978
  });
17913
17979
  var SavedDeviceRowSchema = object({
17914
17980
  /** Numeric id reserved at allocateDeviceId time. */
@@ -19538,6 +19604,7 @@ var TrackSchema = object({
19538
19604
  deviceId: number(),
19539
19605
  className: string(),
19540
19606
  label: string().optional(),
19607
+ producingDeviceName: string().optional(),
19541
19608
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
19542
19609
  source: TrackSourceSchema.optional(),
19543
19610
  firstSeen: number(),
@@ -19675,7 +19742,8 @@ var MediaFileKindEnum = _enum([
19675
19742
  "fullFrameBoxed",
19676
19743
  "faceCrop",
19677
19744
  "plateCrop",
19678
- "keyFrame"
19745
+ "keyFrame",
19746
+ "keyFrameSmall"
19679
19747
  ]);
19680
19748
  var MediaFileSchema = object({
19681
19749
  key: string(),
@@ -20006,7 +20074,16 @@ var PipelineTemplateSchema = object({
20006
20074
  });
20007
20075
  var DeviceStepConfigSchema = object({
20008
20076
  modelId: string().optional(),
20009
- settings: record(string(), unknown()).optional()
20077
+ settings: record(string(), unknown()).optional(),
20078
+ /**
20079
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
20080
+ * When set, this step runs on the named enabled device of the SAME node
20081
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
20082
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
20083
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
20084
+ * auto-jumps only when the effective device's format cannot run the step.
20085
+ */
20086
+ jumpDeviceKey: string().optional()
20010
20087
  });
20011
20088
  var AgentPipelineSettingsSchema = object({
20012
20089
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-import-alexa",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
5
5
  "keywords": [
6
6
  "camstack",