@blueharford/scrypted-spatial-awareness 0.2.0 → 0.2.1

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/out/plugin.zip CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueharford/scrypted-spatial-awareness",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Cross-camera object tracking for Scrypted NVR with spatial awareness",
5
5
  "author": "Joshua Seidel <blueharford>",
6
6
  "license": "Apache-2.0",
@@ -116,7 +116,7 @@ export class SpatialReasoningEngine {
116
116
  }
117
117
 
118
118
  // Landmark contexts
119
- for (const landmark of this.topology.landmarks) {
119
+ for (const landmark of this.topology.landmarks || []) {
120
120
  this.contextChunks.push({
121
121
  id: `landmark_${landmark.id}`,
122
122
  type: 'landmark',
@@ -324,7 +324,7 @@ export function findCamera(topology: CameraTopology, deviceId: string): CameraNo
324
324
 
325
325
  /** Finds a landmark by ID */
326
326
  export function findLandmark(topology: CameraTopology, landmarkId: string): Landmark | undefined {
327
- return topology.landmarks.find(l => l.id === landmarkId);
327
+ return topology.landmarks?.find(l => l.id === landmarkId);
328
328
  }
329
329
 
330
330
  /** Finds connections from a camera */
@@ -400,7 +400,7 @@ export function inferRelationships(topology: CameraTopology, proximityThreshold:
400
400
  entities.push({ id: camera.deviceId, position: camera.floorPlanPosition, type: 'camera' });
401
401
  }
402
402
  }
403
- for (const landmark of topology.landmarks) {
403
+ for (const landmark of topology.landmarks || []) {
404
404
  entities.push({ id: landmark.id, position: landmark.position, type: 'landmark' });
405
405
  }
406
406
 
@@ -436,9 +436,9 @@ export function generateTopologyDescription(topology: CameraTopology): string {
436
436
  }
437
437
 
438
438
  // Landmarks
439
- if (topology.landmarks.length > 0) {
439
+ if (topology.landmarks?.length > 0) {
440
440
  lines.push('\nLandmarks on property:');
441
- for (const landmark of topology.landmarks) {
441
+ for (const landmark of topology.landmarks || []) {
442
442
  let desc = `- ${landmark.name} (${landmark.type})`;
443
443
  if (landmark.description) desc += `: ${landmark.description}`;
444
444
  if (landmark.isEntryPoint) desc += ' [Entry point]';