@camstack/addon-export-hap 1.2.0 → 1.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.
@@ -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,10 +11411,40 @@ 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
- height: number().int().positive()
11433
+ height: number().int().positive(),
11434
+ /**
11435
+ * Which source served this crop, so a quality-sensitive consumer (the native
11436
+ * `keyFrame`) can reject a degraded fallback:
11437
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11438
+ * quality path).
11439
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11440
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11441
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11442
+ *
11443
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11444
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11445
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11446
+ */
11447
+ tier: _enum(["native", "ram-fullframe"]).optional()
11417
11448
  });
11418
11449
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11419
11450
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11543,6 +11574,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11543
11574
  hubHostnameOverride: string().optional()
11544
11575
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11545
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
+ /**
11546
11591
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11547
11592
  * specific runner instance via `attachCamera`. Carries everything the
11548
11593
  * runner needs to subscribe to the local broker and execute inference.
@@ -11660,7 +11705,16 @@ var RunnerCameraConfigSchema = object({
11660
11705
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11661
11706
  * this only selects WHICH device pool of that node runs the session.
11662
11707
  */
11663
- 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()
11664
11718
  });
11665
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;
11666
11720
  /**
@@ -11716,7 +11770,18 @@ var RunnerLocalMetricsSchema = object({
11716
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({
11717
11771
  handle: FrameHandleSchema,
11718
11772
  bbox: NativeCropBboxSchema,
11719
- 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()
11720
11785
  }), NativeCropResultSchema.nullable()), method(object({
11721
11786
  deviceId: number(),
11722
11787
  frameHandle: FrameHandleSchema.optional(),
@@ -14769,7 +14834,8 @@ var LinkedDeviceSchema = object({
14769
14834
  deviceId: number(),
14770
14835
  name: string(),
14771
14836
  location: string().nullable(),
14772
- features: array(string())
14837
+ features: array(string()),
14838
+ producesTrackedEvents: boolean().optional()
14773
14839
  });
14774
14840
  var SavedDeviceRowSchema = object({
14775
14841
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16399,6 +16465,7 @@ var TrackSchema = object({
16399
16465
  deviceId: number(),
16400
16466
  className: string(),
16401
16467
  label: string().optional(),
16468
+ producingDeviceName: string().optional(),
16402
16469
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16403
16470
  source: TrackSourceSchema.optional(),
16404
16471
  firstSeen: number(),
@@ -16536,7 +16603,8 @@ var MediaFileKindEnum = _enum([
16536
16603
  "fullFrameBoxed",
16537
16604
  "faceCrop",
16538
16605
  "plateCrop",
16539
- "keyFrame"
16606
+ "keyFrame",
16607
+ "keyFrameSmall"
16540
16608
  ]);
16541
16609
  var MediaFileSchema = object({
16542
16610
  key: string(),
@@ -16867,7 +16935,16 @@ var PipelineTemplateSchema = object({
16867
16935
  });
16868
16936
  var DeviceStepConfigSchema = object({
16869
16937
  modelId: string().optional(),
16870
- settings: record(string(), unknown()).optional()
16938
+ settings: record(string(), unknown()).optional(),
16939
+ /**
16940
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16941
+ * When set, this step runs on the named enabled device of the SAME node
16942
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16943
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16944
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16945
+ * auto-jumps only when the effective device's format cannot run the step.
16946
+ */
16947
+ jumpDeviceKey: string().optional()
16871
16948
  });
16872
16949
  var AgentPipelineSettingsSchema = object({
16873
16950
  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,10 +11386,40 @@ 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
- height: number().int().positive()
11408
+ height: number().int().positive(),
11409
+ /**
11410
+ * Which source served this crop, so a quality-sensitive consumer (the native
11411
+ * `keyFrame`) can reject a degraded fallback:
11412
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11413
+ * quality path).
11414
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11415
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11416
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11417
+ *
11418
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11419
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11420
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11421
+ */
11422
+ tier: _enum(["native", "ram-fullframe"]).optional()
11392
11423
  });
11393
11424
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11394
11425
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11518,6 +11549,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11518
11549
  hubHostnameOverride: string().optional()
11519
11550
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11520
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
+ /**
11521
11566
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11522
11567
  * specific runner instance via `attachCamera`. Carries everything the
11523
11568
  * runner needs to subscribe to the local broker and execute inference.
@@ -11635,7 +11680,16 @@ var RunnerCameraConfigSchema = object({
11635
11680
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11636
11681
  * this only selects WHICH device pool of that node runs the session.
11637
11682
  */
11638
- 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()
11639
11693
  });
11640
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;
11641
11695
  /**
@@ -11691,7 +11745,18 @@ var RunnerLocalMetricsSchema = object({
11691
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({
11692
11746
  handle: FrameHandleSchema,
11693
11747
  bbox: NativeCropBboxSchema,
11694
- 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()
11695
11760
  }), NativeCropResultSchema.nullable()), method(object({
11696
11761
  deviceId: number(),
11697
11762
  frameHandle: FrameHandleSchema.optional(),
@@ -14744,7 +14809,8 @@ var LinkedDeviceSchema = object({
14744
14809
  deviceId: number(),
14745
14810
  name: string(),
14746
14811
  location: string().nullable(),
14747
- features: array(string())
14812
+ features: array(string()),
14813
+ producesTrackedEvents: boolean().optional()
14748
14814
  });
14749
14815
  var SavedDeviceRowSchema = object({
14750
14816
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16374,6 +16440,7 @@ var TrackSchema = object({
16374
16440
  deviceId: number(),
16375
16441
  className: string(),
16376
16442
  label: string().optional(),
16443
+ producingDeviceName: string().optional(),
16377
16444
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16378
16445
  source: TrackSourceSchema.optional(),
16379
16446
  firstSeen: number(),
@@ -16511,7 +16578,8 @@ var MediaFileKindEnum = _enum([
16511
16578
  "fullFrameBoxed",
16512
16579
  "faceCrop",
16513
16580
  "plateCrop",
16514
- "keyFrame"
16581
+ "keyFrame",
16582
+ "keyFrameSmall"
16515
16583
  ]);
16516
16584
  var MediaFileSchema = object({
16517
16585
  key: string(),
@@ -16842,7 +16910,16 @@ var PipelineTemplateSchema = object({
16842
16910
  });
16843
16911
  var DeviceStepConfigSchema = object({
16844
16912
  modelId: string().optional(),
16845
- settings: record(string(), unknown()).optional()
16913
+ settings: record(string(), unknown()).optional(),
16914
+ /**
16915
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16916
+ * When set, this step runs on the named enabled device of the SAME node
16917
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16918
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16919
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16920
+ * auto-jumps only when the effective device's format cannot run the step.
16921
+ */
16922
+ jumpDeviceKey: string().optional()
16846
16923
  });
16847
16924
  var AgentPipelineSettingsSchema = object({
16848
16925
  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.0",
3
+ "version": "1.2.2",
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",