@camstack/addon-export-hap 1.2.1 → 1.2.3

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.
@@ -11104,7 +11104,8 @@ var PipelineStepInputSchema = lazy(() => object({
11104
11104
  modelId: string().optional(),
11105
11105
  enabled: boolean().default(true),
11106
11106
  children: array(PipelineStepInputSchema).optional(),
11107
- settings: record(string(), unknown()).optional()
11107
+ settings: record(string(), unknown()).optional(),
11108
+ jumpDeviceKey: string().optional()
11108
11109
  }));
11109
11110
  var ModelSubstitutionSchema = object({
11110
11111
  addonId: string(),
@@ -11410,8 +11411,24 @@ var NativeCropBboxSchema = object({
11410
11411
  });
11411
11412
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11412
11413
  var NativeCropResultSchema = object({
11413
- /** Packed rgb (24-bit) pixels of the crop. */
11414
- bytes: _instanceof(Uint8Array),
11414
+ /**
11415
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11416
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11417
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11418
+ * path below), where shipping raw RGB is both an invariant violation and, for
11419
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11420
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11421
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11422
+ */
11423
+ bytes: _instanceof(Uint8Array).optional(),
11424
+ /**
11425
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11426
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11427
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11428
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11429
+ * set `encodeJpeg: true`; `bytes` is then absent.
11430
+ */
11431
+ jpeg: string().optional(),
11415
11432
  width: number().int().positive(),
11416
11433
  height: number().int().positive(),
11417
11434
  /**
@@ -11557,6 +11574,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11557
11574
  hubHostnameOverride: string().optional()
11558
11575
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11559
11576
  /**
11577
+ * One ENABLED inference device on the runner's node, as the step-tree
11578
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11579
+ * roster on the attach payload whenever the camera is elected onto a specific
11580
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11581
+ * runner auto-jumps an enrichment step to when the elected device's format
11582
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11583
+ * per-device knobs so the auto choice is weighted-least-loaded.
11584
+ */
11585
+ var RunnerInferenceDeviceSchema = object({
11586
+ deviceKey: string(),
11587
+ weight: number().positive().default(1),
11588
+ maxSessions: number().int().positive().nullable().default(null)
11589
+ });
11590
+ /**
11560
11591
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11561
11592
  * specific runner instance via `attachCamera`. Carries everything the
11562
11593
  * runner needs to subscribe to the local broker and execute inference.
@@ -11674,7 +11705,16 @@ var RunnerCameraConfigSchema = object({
11674
11705
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11675
11706
  * this only selects WHICH device pool of that node runs the session.
11676
11707
  */
11677
- deviceKey: string().optional()
11708
+ deviceKey: string().optional(),
11709
+ /**
11710
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11711
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11712
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11713
+ * step whose model has no build for the elected device's format onto another
11714
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11715
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11716
+ */
11717
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11678
11718
  });
11679
11719
  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;
11680
11720
  /**
@@ -11730,7 +11770,18 @@ var RunnerLocalMetricsSchema = object({
11730
11770
  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({
11731
11771
  handle: FrameHandleSchema,
11732
11772
  bbox: NativeCropBboxSchema,
11733
- maxWidth: number().int().positive().optional()
11773
+ maxWidth: number().int().positive().optional(),
11774
+ /**
11775
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11776
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11777
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11778
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11779
+ * no raw pixels cross the process boundary. Same-node callers omit it
11780
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11781
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11782
+ * the caller falls back to encoding locally.
11783
+ */
11784
+ encodeJpeg: boolean().optional()
11734
11785
  }), NativeCropResultSchema.nullable()), method(object({
11735
11786
  deviceId: number(),
11736
11787
  frameHandle: FrameHandleSchema.optional(),
@@ -16553,7 +16604,8 @@ var MediaFileKindEnum = _enum([
16553
16604
  "faceCrop",
16554
16605
  "plateCrop",
16555
16606
  "keyFrame",
16556
- "keyFrameSmall"
16607
+ "keyFrameSmall",
16608
+ "thumbnailSmall"
16557
16609
  ]);
16558
16610
  var MediaFileSchema = object({
16559
16611
  key: string(),
@@ -16884,7 +16936,16 @@ var PipelineTemplateSchema = object({
16884
16936
  });
16885
16937
  var DeviceStepConfigSchema = object({
16886
16938
  modelId: string().optional(),
16887
- settings: record(string(), unknown()).optional()
16939
+ settings: record(string(), unknown()).optional(),
16940
+ /**
16941
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16942
+ * When set, this step runs on the named enabled device of the SAME node
16943
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16944
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16945
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16946
+ * auto-jumps only when the effective device's format cannot run the step.
16947
+ */
16948
+ jumpDeviceKey: string().optional()
16888
16949
  });
16889
16950
  var AgentPipelineSettingsSchema = object({
16890
16951
  maxCameras: number().int().nonnegative().nullable().default(null),
@@ -11079,7 +11079,8 @@ var PipelineStepInputSchema = lazy(() => object({
11079
11079
  modelId: string().optional(),
11080
11080
  enabled: boolean().default(true),
11081
11081
  children: array(PipelineStepInputSchema).optional(),
11082
- settings: record(string(), unknown()).optional()
11082
+ settings: record(string(), unknown()).optional(),
11083
+ jumpDeviceKey: string().optional()
11083
11084
  }));
11084
11085
  var ModelSubstitutionSchema = object({
11085
11086
  addonId: string(),
@@ -11385,8 +11386,24 @@ var NativeCropBboxSchema = object({
11385
11386
  });
11386
11387
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11387
11388
  var NativeCropResultSchema = object({
11388
- /** Packed rgb (24-bit) pixels of the crop. */
11389
- bytes: _instanceof(Uint8Array),
11389
+ /**
11390
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11391
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11392
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11393
+ * path below), where shipping raw RGB is both an invariant violation and, for
11394
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11395
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11396
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11397
+ */
11398
+ bytes: _instanceof(Uint8Array).optional(),
11399
+ /**
11400
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11401
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11402
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11403
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11404
+ * set `encodeJpeg: true`; `bytes` is then absent.
11405
+ */
11406
+ jpeg: string().optional(),
11390
11407
  width: number().int().positive(),
11391
11408
  height: number().int().positive(),
11392
11409
  /**
@@ -11532,6 +11549,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11532
11549
  hubHostnameOverride: string().optional()
11533
11550
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11534
11551
  /**
11552
+ * One ENABLED inference device on the runner's node, as the step-tree
11553
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11554
+ * roster on the attach payload whenever the camera is elected onto a specific
11555
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11556
+ * runner auto-jumps an enrichment step to when the elected device's format
11557
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11558
+ * per-device knobs so the auto choice is weighted-least-loaded.
11559
+ */
11560
+ var RunnerInferenceDeviceSchema = object({
11561
+ deviceKey: string(),
11562
+ weight: number().positive().default(1),
11563
+ maxSessions: number().int().positive().nullable().default(null)
11564
+ });
11565
+ /**
11535
11566
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11536
11567
  * specific runner instance via `attachCamera`. Carries everything the
11537
11568
  * runner needs to subscribe to the local broker and execute inference.
@@ -11649,7 +11680,16 @@ var RunnerCameraConfigSchema = object({
11649
11680
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11650
11681
  * this only selects WHICH device pool of that node runs the session.
11651
11682
  */
11652
- deviceKey: string().optional()
11683
+ deviceKey: string().optional(),
11684
+ /**
11685
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11686
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11687
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11688
+ * step whose model has no build for the elected device's format onto another
11689
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11690
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11691
+ */
11692
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11653
11693
  });
11654
11694
  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;
11655
11695
  /**
@@ -11705,7 +11745,18 @@ var RunnerLocalMetricsSchema = object({
11705
11745
  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({
11706
11746
  handle: FrameHandleSchema,
11707
11747
  bbox: NativeCropBboxSchema,
11708
- maxWidth: number().int().positive().optional()
11748
+ maxWidth: number().int().positive().optional(),
11749
+ /**
11750
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11751
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11752
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11753
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11754
+ * no raw pixels cross the process boundary. Same-node callers omit it
11755
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11756
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11757
+ * the caller falls back to encoding locally.
11758
+ */
11759
+ encodeJpeg: boolean().optional()
11709
11760
  }), NativeCropResultSchema.nullable()), method(object({
11710
11761
  deviceId: number(),
11711
11762
  frameHandle: FrameHandleSchema.optional(),
@@ -16528,7 +16579,8 @@ var MediaFileKindEnum = _enum([
16528
16579
  "faceCrop",
16529
16580
  "plateCrop",
16530
16581
  "keyFrame",
16531
- "keyFrameSmall"
16582
+ "keyFrameSmall",
16583
+ "thumbnailSmall"
16532
16584
  ]);
16533
16585
  var MediaFileSchema = object({
16534
16586
  key: string(),
@@ -16859,7 +16911,16 @@ var PipelineTemplateSchema = object({
16859
16911
  });
16860
16912
  var DeviceStepConfigSchema = object({
16861
16913
  modelId: string().optional(),
16862
- settings: record(string(), unknown()).optional()
16914
+ settings: record(string(), unknown()).optional(),
16915
+ /**
16916
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16917
+ * When set, this step runs on the named enabled device of the SAME node
16918
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16919
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16920
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16921
+ * auto-jumps only when the effective device's format cannot run the step.
16922
+ */
16923
+ jumpDeviceKey: string().optional()
16863
16924
  });
16864
16925
  var AgentPipelineSettingsSchema = object({
16865
16926
  maxCameras: number().int().nonnegative().nullable().default(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-hap",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "HomeKit (HAP) bridge exporter for CamStack devices. Publishes a bridged accessory per exposed device — MotionSensor in this MVP; Camera/Doorbell/Switch/Light follow.",
5
5
  "keywords": [
6
6
  "camstack",