@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/dist/main.nodejs.js +1 -1
- package/dist/main.nodejs.js.map +1 -1
- package/dist/plugin.zip +0 -0
- package/out/main.nodejs.js +5 -5
- package/out/main.nodejs.js.map +1 -1
- package/out/plugin.zip +0 -0
- package/package.json +1 -1
- package/src/core/spatial-reasoning.ts +1 -1
- package/src/models/topology.ts +4 -4
package/out/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -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',
|
package/src/models/topology.ts
CHANGED
|
@@ -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
|
|
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
|
|
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]';
|