/** * Reality Alert™ Demo * Demonstrates the spontaneous observation pipeline */ const { RealityAlertService } = require('../src/services/realityAlert'); async function runDemo() { console.log('🚨 Landvex Reality Alert™ Demo'); console.log('================================\n'); const service = new RealityAlertService(); // Simulate a Zoomer observation const observation = { imageUrl: 'https://example.com/photos/diesel-spill-001.jpg', gpsLocation: { lat: 59.3293, lng: 18.0686, address: 'Stureplan, Stockholm' }, timestamp: new Date().toISOString(), zoomerId: 'zoomer-123', description: 'I noticed a dark liquid leaking from a pump station', objectType: 'pump_station' }; console.log('📸 Simulating Zoomer observation:'); console.log(` Location: ${observation.gpsLocation.address}`); console.log(` Description: ${observation.description}`); console.log(` Zoomer: ${observation.zoomerId}\n`); // Process the observation const result = await service.processObservation(observation); if (result.status === 'verified') { console.log('✅ Observation verified by AI!'); console.log(`\n🚨 REALITY ALERT CREATED`); console.log(` ID: ${result.alert.id}`); console.log(` Severity: ${result.alert.severity.toUpperCase()}`); console.log(` Category: ${result.alert.category}`); console.log(` Risk Score: ${result.alert.riskScore}/100`); console.log(` Description: ${result.alert.description}`); console.log(`\n📡 ROUTING INTELLIGENCE`); console.log(` Primary: ${result.alert.routing.primary}`); console.log(` Secondary: ${result.alert.routing.secondary.join(', ')}`); console.log(` Emergency: ${result.alert.routing.emergency ? 'YES' : 'No'}`); console.log(`\n💰 ZOOMER REWARD`); console.log(` Amount: $${result.reward.amount}`); console.log(` Breakdown:`, result.reward.breakdown); console.log(`\n📊 ALERT STATS`); const stats = service.getPendingAlerts(); console.log(` Total pending alerts: ${stats.length}`); } else if (result.status === 'rejected') { console.log('❌ Observation rejected:', result.message); } else if (result.status === 'unclear') { console.log('⚠️ Need more info:', result.message); } console.log('\n✅ Demo complete!'); } // Run if called directly if (require.main === module) { runDemo().catch(console.error); } module.exports = { runDemo };