@jablum/weather-mcp 1.7.0
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/LICENSE +21 -0
- package/README.md +1319 -0
- package/dist/analytics/anonymizer.d.ts +37 -0
- package/dist/analytics/anonymizer.d.ts.map +1 -0
- package/dist/analytics/anonymizer.js +112 -0
- package/dist/analytics/anonymizer.js.map +1 -0
- package/dist/analytics/collector.d.ts +72 -0
- package/dist/analytics/collector.d.ts.map +1 -0
- package/dist/analytics/collector.js +282 -0
- package/dist/analytics/collector.js.map +1 -0
- package/dist/analytics/config.d.ts +15 -0
- package/dist/analytics/config.d.ts.map +1 -0
- package/dist/analytics/config.js +172 -0
- package/dist/analytics/config.js.map +1 -0
- package/dist/analytics/index.d.ts +8 -0
- package/dist/analytics/index.d.ts.map +1 -0
- package/dist/analytics/index.js +7 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/analytics/middleware.d.ts +33 -0
- package/dist/analytics/middleware.d.ts.map +1 -0
- package/dist/analytics/middleware.js +99 -0
- package/dist/analytics/middleware.js.map +1 -0
- package/dist/analytics/transport.d.ts +11 -0
- package/dist/analytics/transport.d.ts.map +1 -0
- package/dist/analytics/transport.js +92 -0
- package/dist/analytics/transport.js.map +1 -0
- package/dist/analytics/types.d.ts +74 -0
- package/dist/analytics/types.d.ts.map +1 -0
- package/dist/analytics/types.js +6 -0
- package/dist/analytics/types.js.map +1 -0
- package/dist/config/api.d.ts +30 -0
- package/dist/config/api.d.ts.map +1 -0
- package/dist/config/api.js +32 -0
- package/dist/config/api.js.map +1 -0
- package/dist/config/cache.d.ts +31 -0
- package/dist/config/cache.d.ts.map +1 -0
- package/dist/config/cache.js +108 -0
- package/dist/config/cache.js.map +1 -0
- package/dist/config/displayThresholds.d.ts +83 -0
- package/dist/config/displayThresholds.d.ts.map +1 -0
- package/dist/config/displayThresholds.js +83 -0
- package/dist/config/displayThresholds.js.map +1 -0
- package/dist/config/tools.d.ts +44 -0
- package/dist/config/tools.d.ts.map +1 -0
- package/dist/config/tools.js +269 -0
- package/dist/config/tools.js.map +1 -0
- package/dist/errors/ApiError.d.ts +62 -0
- package/dist/errors/ApiError.d.ts.map +1 -0
- package/dist/errors/ApiError.js +171 -0
- package/dist/errors/ApiError.js.map +1 -0
- package/dist/handlers/airQualityHandler.d.ts +11 -0
- package/dist/handlers/airQualityHandler.d.ts.map +1 -0
- package/dist/handlers/airQualityHandler.js +154 -0
- package/dist/handlers/airQualityHandler.js.map +1 -0
- package/dist/handlers/alertsHandler.d.ts +11 -0
- package/dist/handlers/alertsHandler.d.ts.map +1 -0
- package/dist/handlers/alertsHandler.js +98 -0
- package/dist/handlers/alertsHandler.js.map +1 -0
- package/dist/handlers/currentConditionsHandler.d.ts +13 -0
- package/dist/handlers/currentConditionsHandler.d.ts.map +1 -0
- package/dist/handlers/currentConditionsHandler.js +296 -0
- package/dist/handlers/currentConditionsHandler.js.map +1 -0
- package/dist/handlers/forecastHandler.d.ts +16 -0
- package/dist/handlers/forecastHandler.d.ts.map +1 -0
- package/dist/handlers/forecastHandler.js +454 -0
- package/dist/handlers/forecastHandler.js.map +1 -0
- package/dist/handlers/historicalWeatherHandler.d.ts +12 -0
- package/dist/handlers/historicalWeatherHandler.d.ts.map +1 -0
- package/dist/handlers/historicalWeatherHandler.js +188 -0
- package/dist/handlers/historicalWeatherHandler.js.map +1 -0
- package/dist/handlers/lightningHandler.d.ts +14 -0
- package/dist/handlers/lightningHandler.d.ts.map +1 -0
- package/dist/handlers/lightningHandler.js +258 -0
- package/dist/handlers/lightningHandler.js.map +1 -0
- package/dist/handlers/locationHandler.d.ts +12 -0
- package/dist/handlers/locationHandler.d.ts.map +1 -0
- package/dist/handlers/locationHandler.js +149 -0
- package/dist/handlers/locationHandler.js.map +1 -0
- package/dist/handlers/marineConditionsHandler.d.ts +13 -0
- package/dist/handlers/marineConditionsHandler.d.ts.map +1 -0
- package/dist/handlers/marineConditionsHandler.js +270 -0
- package/dist/handlers/marineConditionsHandler.js.map +1 -0
- package/dist/handlers/riverConditionsHandler.d.ts +11 -0
- package/dist/handlers/riverConditionsHandler.d.ts.map +1 -0
- package/dist/handlers/riverConditionsHandler.js +176 -0
- package/dist/handlers/riverConditionsHandler.js.map +1 -0
- package/dist/handlers/savedLocationsHandler.d.ts +50 -0
- package/dist/handlers/savedLocationsHandler.d.ts.map +1 -0
- package/dist/handlers/savedLocationsHandler.js +397 -0
- package/dist/handlers/savedLocationsHandler.js.map +1 -0
- package/dist/handlers/statusHandler.d.ts +12 -0
- package/dist/handlers/statusHandler.d.ts.map +1 -0
- package/dist/handlers/statusHandler.js +115 -0
- package/dist/handlers/statusHandler.js.map +1 -0
- package/dist/handlers/weatherImageryHandler.d.ts +14 -0
- package/dist/handlers/weatherImageryHandler.d.ts.map +1 -0
- package/dist/handlers/weatherImageryHandler.js +143 -0
- package/dist/handlers/weatherImageryHandler.js.map +1 -0
- package/dist/handlers/wildfireHandler.d.ts +11 -0
- package/dist/handlers/wildfireHandler.d.ts.map +1 -0
- package/dist/handlers/wildfireHandler.js +186 -0
- package/dist/handlers/wildfireHandler.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +735 -0
- package/dist/index.js.map +1 -0
- package/dist/services/blitzortung.d.ts +67 -0
- package/dist/services/blitzortung.d.ts.map +1 -0
- package/dist/services/blitzortung.js +475 -0
- package/dist/services/blitzortung.js.map +1 -0
- package/dist/services/geocoding.d.ts +57 -0
- package/dist/services/geocoding.d.ts.map +1 -0
- package/dist/services/geocoding.js +393 -0
- package/dist/services/geocoding.js.map +1 -0
- package/dist/services/locationStore.d.ts +62 -0
- package/dist/services/locationStore.d.ts.map +1 -0
- package/dist/services/locationStore.js +201 -0
- package/dist/services/locationStore.js.map +1 -0
- package/dist/services/ncei.d.ts +61 -0
- package/dist/services/ncei.d.ts.map +1 -0
- package/dist/services/ncei.js +126 -0
- package/dist/services/ncei.js.map +1 -0
- package/dist/services/nifc.d.ts +44 -0
- package/dist/services/nifc.d.ts.map +1 -0
- package/dist/services/nifc.js +159 -0
- package/dist/services/nifc.js.map +1 -0
- package/dist/services/noaa.d.ts +161 -0
- package/dist/services/noaa.d.ts.map +1 -0
- package/dist/services/noaa.js +681 -0
- package/dist/services/noaa.js.map +1 -0
- package/dist/services/nominatim.d.ts +62 -0
- package/dist/services/nominatim.d.ts.map +1 -0
- package/dist/services/nominatim.js +254 -0
- package/dist/services/nominatim.js.map +1 -0
- package/dist/services/openmeteo.d.ts +189 -0
- package/dist/services/openmeteo.d.ts.map +1 -0
- package/dist/services/openmeteo.js +936 -0
- package/dist/services/openmeteo.js.map +1 -0
- package/dist/services/rainviewer.d.ts +37 -0
- package/dist/services/rainviewer.d.ts.map +1 -0
- package/dist/services/rainviewer.js +115 -0
- package/dist/services/rainviewer.js.map +1 -0
- package/dist/types/imagery.d.ts +82 -0
- package/dist/types/imagery.d.ts.map +1 -0
- package/dist/types/imagery.js +6 -0
- package/dist/types/imagery.js.map +1 -0
- package/dist/types/lightning.d.ts +89 -0
- package/dist/types/lightning.d.ts.map +1 -0
- package/dist/types/lightning.js +6 -0
- package/dist/types/lightning.js.map +1 -0
- package/dist/types/noaa.d.ts +535 -0
- package/dist/types/noaa.d.ts.map +1 -0
- package/dist/types/noaa.js +5 -0
- package/dist/types/noaa.js.map +1 -0
- package/dist/types/nominatim.d.ts +72 -0
- package/dist/types/nominatim.d.ts.map +1 -0
- package/dist/types/nominatim.js +6 -0
- package/dist/types/nominatim.js.map +1 -0
- package/dist/types/openmeteo.d.ts +583 -0
- package/dist/types/openmeteo.d.ts.map +1 -0
- package/dist/types/openmeteo.js +6 -0
- package/dist/types/openmeteo.js.map +1 -0
- package/dist/types/savedLocations.d.ts +58 -0
- package/dist/types/savedLocations.d.ts.map +1 -0
- package/dist/types/savedLocations.js +5 -0
- package/dist/types/savedLocations.js.map +1 -0
- package/dist/types/wildfire.d.ts +83 -0
- package/dist/types/wildfire.d.ts.map +1 -0
- package/dist/types/wildfire.js +5 -0
- package/dist/types/wildfire.js.map +1 -0
- package/dist/utils/airQuality.d.ts +54 -0
- package/dist/utils/airQuality.d.ts.map +1 -0
- package/dist/utils/airQuality.js +251 -0
- package/dist/utils/airQuality.js.map +1 -0
- package/dist/utils/cache.d.ts +69 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +164 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/distance.d.ts +25 -0
- package/dist/utils/distance.d.ts.map +1 -0
- package/dist/utils/distance.js +40 -0
- package/dist/utils/distance.js.map +1 -0
- package/dist/utils/fireWeather.d.ts +76 -0
- package/dist/utils/fireWeather.d.ts.map +1 -0
- package/dist/utils/fireWeather.js +243 -0
- package/dist/utils/fireWeather.js.map +1 -0
- package/dist/utils/geography.d.ts +79 -0
- package/dist/utils/geography.d.ts.map +1 -0
- package/dist/utils/geography.js +266 -0
- package/dist/utils/geography.js.map +1 -0
- package/dist/utils/geohash.d.ts +62 -0
- package/dist/utils/geohash.d.ts.map +1 -0
- package/dist/utils/geohash.js +146 -0
- package/dist/utils/geohash.js.map +1 -0
- package/dist/utils/locationResolver.d.ts +34 -0
- package/dist/utils/locationResolver.d.ts.map +1 -0
- package/dist/utils/locationResolver.js +120 -0
- package/dist/utils/locationResolver.js.map +1 -0
- package/dist/utils/logger.d.ts +75 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +153 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/marine.d.ts +59 -0
- package/dist/utils/marine.d.ts.map +1 -0
- package/dist/utils/marine.js +215 -0
- package/dist/utils/marine.js.map +1 -0
- package/dist/utils/normals.d.ts +86 -0
- package/dist/utils/normals.d.ts.map +1 -0
- package/dist/utils/normals.js +223 -0
- package/dist/utils/normals.js.map +1 -0
- package/dist/utils/snow.d.ts +45 -0
- package/dist/utils/snow.d.ts.map +1 -0
- package/dist/utils/snow.js +144 -0
- package/dist/utils/snow.js.map +1 -0
- package/dist/utils/temperatureConversion.d.ts +12 -0
- package/dist/utils/temperatureConversion.d.ts.map +1 -0
- package/dist/utils/temperatureConversion.js +17 -0
- package/dist/utils/temperatureConversion.js.map +1 -0
- package/dist/utils/timezone.d.ts +56 -0
- package/dist/utils/timezone.d.ts.map +1 -0
- package/dist/utils/timezone.js +167 -0
- package/dist/utils/timezone.js.map +1 -0
- package/dist/utils/units.d.ts +69 -0
- package/dist/utils/units.d.ts.map +1 -0
- package/dist/utils/units.js +158 -0
- package/dist/utils/units.js.map +1 -0
- package/dist/utils/validation.d.ts +89 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +177 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/utils/version.d.ts +15 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +24 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handler for check_service_status tool
|
|
3
|
+
*/
|
|
4
|
+
import { NOAAService } from '../services/noaa.js';
|
|
5
|
+
import { OpenMeteoService } from '../services/openmeteo.js';
|
|
6
|
+
export declare function handleCheckServiceStatus(noaaService: NOAAService, openMeteoService: OpenMeteoService, serverVersion?: string): Promise<{
|
|
7
|
+
content: Array<{
|
|
8
|
+
type: string;
|
|
9
|
+
text: string;
|
|
10
|
+
}>;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=statusHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/statusHandler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAyH7D"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handler for check_service_status tool
|
|
3
|
+
*/
|
|
4
|
+
import { CacheConfig } from '../config/cache.js';
|
|
5
|
+
export async function handleCheckServiceStatus(noaaService, openMeteoService, serverVersion) {
|
|
6
|
+
// Check status of both services
|
|
7
|
+
const noaaStatus = await noaaService.checkServiceStatus();
|
|
8
|
+
const openMeteoStatus = await openMeteoService.checkServiceStatus();
|
|
9
|
+
// Format the status report
|
|
10
|
+
let output = `# Weather API Service Status\n\n`;
|
|
11
|
+
output += `**Check Time:** ${new Date().toLocaleString()}\n\n`;
|
|
12
|
+
// Server Version Information
|
|
13
|
+
if (serverVersion) {
|
|
14
|
+
output += `## Server Version\n\n`;
|
|
15
|
+
output += `**Installed Version:** ${serverVersion}\n`;
|
|
16
|
+
output += `**Latest Release:** https://github.com/weather-mcp/weather-mcp/releases/latest\n`;
|
|
17
|
+
output += `**Changelog:** https://github.com/weather-mcp/weather-mcp/blob/main/CHANGELOG.md\n`;
|
|
18
|
+
output += `**Upgrade Instructions:** See README.md "Upgrading to Latest Version" section\n\n`;
|
|
19
|
+
output += `*Tip: Use \`npx -y @dangahagan/weather-mcp@latest\` in your MCP config to always run the newest version.*\n\n`;
|
|
20
|
+
}
|
|
21
|
+
// NOAA Status
|
|
22
|
+
output += `## NOAA Weather API (Forecasts & Current Conditions)\n\n`;
|
|
23
|
+
output += `**Status:** ${noaaStatus.operational ? '✅ Operational' : '❌ Issues Detected'}\n`;
|
|
24
|
+
output += `**Message:** ${noaaStatus.message}\n`;
|
|
25
|
+
output += `**Status Page:** ${noaaStatus.statusPage}\n`;
|
|
26
|
+
output += `**Coverage:** United States locations only\n\n`;
|
|
27
|
+
if (!noaaStatus.operational) {
|
|
28
|
+
output += `**Recommended Actions:**\n`;
|
|
29
|
+
output += `- Check planned outages: https://weather-gov.github.io/api/planned-outages\n`;
|
|
30
|
+
output += `- View service notices: https://www.weather.gov/notification\n`;
|
|
31
|
+
output += `- Report issues: nco.ops@noaa.gov or (301) 683-1518\n\n`;
|
|
32
|
+
}
|
|
33
|
+
// Open-Meteo Status
|
|
34
|
+
output += `## Open-Meteo API (Historical Weather Data)\n\n`;
|
|
35
|
+
output += `**Status:** ${openMeteoStatus.operational ? '✅ Operational' : '❌ Issues Detected'}\n`;
|
|
36
|
+
output += `**Message:** ${openMeteoStatus.message}\n`;
|
|
37
|
+
output += `**Status Page:** ${openMeteoStatus.statusPage}\n`;
|
|
38
|
+
output += `**Coverage:** Global (worldwide locations)\n\n`;
|
|
39
|
+
if (!openMeteoStatus.operational) {
|
|
40
|
+
output += `**Recommended Actions:**\n`;
|
|
41
|
+
output += `- Check production status: https://open-meteo.com/en/docs/model-updates\n`;
|
|
42
|
+
output += `- View GitHub issues: https://github.com/open-meteo/open-meteo/issues\n`;
|
|
43
|
+
output += `- Review documentation: https://open-meteo.com/en/docs\n\n`;
|
|
44
|
+
}
|
|
45
|
+
// Cache Statistics
|
|
46
|
+
if (CacheConfig.enabled) {
|
|
47
|
+
output += `## Cache Statistics\n\n`;
|
|
48
|
+
const noaaStats = noaaService.getCacheStats();
|
|
49
|
+
const openMeteoStats = openMeteoService.getCacheStats();
|
|
50
|
+
const totalHits = noaaStats.hits + openMeteoStats.hits;
|
|
51
|
+
const totalMisses = noaaStats.misses + openMeteoStats.misses;
|
|
52
|
+
const totalRequests = totalHits + totalMisses;
|
|
53
|
+
const overallHitRate = totalRequests > 0 ? ((totalHits / totalRequests) * 100).toFixed(1) : '0.0';
|
|
54
|
+
output += `**Cache Status:** ✅ Enabled\n`;
|
|
55
|
+
output += `**Overall Hit Rate:** ${overallHitRate}%\n`;
|
|
56
|
+
output += `**Total Cache Hits:** ${totalHits}\n`;
|
|
57
|
+
output += `**Total Cache Misses:** ${totalMisses}\n`;
|
|
58
|
+
output += `**Total Requests:** ${totalRequests}\n\n`;
|
|
59
|
+
const noaaHitRate = (noaaStats.hits + noaaStats.misses) > 0
|
|
60
|
+
? ((noaaStats.hits / (noaaStats.hits + noaaStats.misses)) * 100).toFixed(1)
|
|
61
|
+
: '0.0';
|
|
62
|
+
const openMeteoHitRate = (openMeteoStats.hits + openMeteoStats.misses) > 0
|
|
63
|
+
? ((openMeteoStats.hits / (openMeteoStats.hits + openMeteoStats.misses)) * 100).toFixed(1)
|
|
64
|
+
: '0.0';
|
|
65
|
+
output += `### NOAA Service Cache\n`;
|
|
66
|
+
output += `- Entries: ${noaaStats.size} / ${noaaStats.maxSize}\n`;
|
|
67
|
+
output += `- Hit Rate: ${noaaHitRate}%\n`;
|
|
68
|
+
output += `- Hits: ${noaaStats.hits}\n`;
|
|
69
|
+
output += `- Misses: ${noaaStats.misses}\n`;
|
|
70
|
+
output += `- Evictions: ${noaaStats.evictions}\n\n`;
|
|
71
|
+
output += `### Open-Meteo Service Cache\n`;
|
|
72
|
+
output += `- Entries: ${openMeteoStats.size} / ${openMeteoStats.maxSize}\n`;
|
|
73
|
+
output += `- Hit Rate: ${openMeteoHitRate}%\n`;
|
|
74
|
+
output += `- Hits: ${openMeteoStats.hits}\n`;
|
|
75
|
+
output += `- Misses: ${openMeteoStats.misses}\n`;
|
|
76
|
+
output += `- Evictions: ${openMeteoStats.evictions}\n\n`;
|
|
77
|
+
output += `*Cache reduces API calls and improves performance for repeated queries.*\n\n`;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
output += `## Cache Statistics\n\n`;
|
|
81
|
+
output += `**Cache Status:** ❌ Disabled\n`;
|
|
82
|
+
output += `*Set CACHE_ENABLED=true in environment to enable caching.*\n\n`;
|
|
83
|
+
}
|
|
84
|
+
// Overall status summary
|
|
85
|
+
const bothOperational = noaaStatus.operational && openMeteoStatus.operational;
|
|
86
|
+
const neitherOperational = !noaaStatus.operational && !openMeteoStatus.operational;
|
|
87
|
+
if (bothOperational) {
|
|
88
|
+
output += `## Overall Status: ✅ All Services Operational\n\n`;
|
|
89
|
+
output += `Both NOAA and Open-Meteo APIs are functioning normally. Weather data requests should succeed.\n`;
|
|
90
|
+
}
|
|
91
|
+
else if (neitherOperational) {
|
|
92
|
+
output += `## Overall Status: ❌ Multiple Service Issues\n\n`;
|
|
93
|
+
output += `Both weather APIs are experiencing issues. Please check the status pages above for updates.\n`;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
output += `## Overall Status: ⚠️ Partial Service Availability\n\n`;
|
|
97
|
+
if (noaaStatus.operational) {
|
|
98
|
+
output += `NOAA API is operational: Forecasts and current conditions for US locations are available.\n`;
|
|
99
|
+
output += `Open-Meteo API has issues: Historical weather data may be unavailable.\n`;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
output += `Open-Meteo API is operational: Historical weather data is available globally.\n`;
|
|
103
|
+
output += `NOAA API has issues: Forecasts and current conditions for US locations may be unavailable.\n`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
type: 'text',
|
|
110
|
+
text: output
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=statusHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusHandler.js","sourceRoot":"","sources":["../../src/handlers/statusHandler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,WAAwB,EACxB,gBAAkC,EAClC,aAAsB;IAEtB,gCAAgC;IAChC,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC,kBAAkB,EAAE,CAAC;IAC1D,MA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AM,kBAAkB,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;IAEnF,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,IAAI,mDAAmD,CAAC;QAC9D,MAAM,IAAI,iGAAiG,CAAC;IAC9G,CAAC;SAAM,IAAI,kBAAkB,EAAE,CAAC;QAC9B,MAAM,IAAI,kDAAkD,CAAC;QAC7D,MAAM,IAAI,+FAA+F,CAAC;IAC5G,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,wDAAwD,CAAC;QACnE,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;YAC3B,MAAM,IAAI,6FAA6F,CAAC;YACxG,MAAM,IAAI,0EAA0E,CAAC;QACvF,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,iFAAiF,CAAC;YAC5F,MAAM,IAAI,8FAA8F,CAAC;QAC3G,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,MAAM;aACb;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handler for get_weather_imagery tool
|
|
3
|
+
* Provides weather radar, satellite, and precipitation imagery
|
|
4
|
+
*/
|
|
5
|
+
import { WeatherImageryParams, WeatherImageryResponse } from '../types/imagery.js';
|
|
6
|
+
/**
|
|
7
|
+
* Get weather imagery based on type
|
|
8
|
+
*/
|
|
9
|
+
export declare function getWeatherImagery(params: WeatherImageryParams): Promise<WeatherImageryResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Format weather imagery response for display
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatWeatherImageryResponse(response: WeatherImageryResponse): string;
|
|
14
|
+
//# sourceMappingURL=weatherImageryHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weatherImageryHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/weatherImageryHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAe,MAAM,qBAAqB,CAAC;AAwChG;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAiDrG;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,sBAAsB,GAAG,MAAM,CAqErF"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handler for get_weather_imagery tool
|
|
3
|
+
* Provides weather radar, satellite, and precipitation imagery
|
|
4
|
+
*/
|
|
5
|
+
import { rainViewerService } from '../services/rainviewer.js';
|
|
6
|
+
import { validateLatitude, validateLongitude } from '../utils/validation.js';
|
|
7
|
+
import { logger, redactCoordinatesForLogging } from '../utils/logger.js';
|
|
8
|
+
import { ValidationError } from '../errors/ApiError.js';
|
|
9
|
+
/**
|
|
10
|
+
* Validate imagery request parameters
|
|
11
|
+
*/
|
|
12
|
+
function validateImageryParams(params) {
|
|
13
|
+
// Validate coordinates
|
|
14
|
+
validateLatitude(params.latitude);
|
|
15
|
+
validateLongitude(params.longitude);
|
|
16
|
+
// Validate imagery type
|
|
17
|
+
const validTypes = ['radar', 'satellite', 'precipitation'];
|
|
18
|
+
if (!validTypes.includes(params.type)) {
|
|
19
|
+
throw new ValidationError(`Invalid imagery type: ${params.type}. Must be one of: ${validTypes.join(', ')}`, 'type', params.type);
|
|
20
|
+
}
|
|
21
|
+
// Validate boolean parameters
|
|
22
|
+
if (params.animated !== undefined && typeof params.animated !== 'boolean') {
|
|
23
|
+
throw new ValidationError('animated parameter must be a boolean', 'animated', params.animated);
|
|
24
|
+
}
|
|
25
|
+
// Validate layers array if provided
|
|
26
|
+
if (params.layers !== undefined) {
|
|
27
|
+
if (!Array.isArray(params.layers)) {
|
|
28
|
+
throw new ValidationError('layers parameter must be an array', 'layers', params.layers);
|
|
29
|
+
}
|
|
30
|
+
if (params.layers.length > 10) {
|
|
31
|
+
throw new ValidationError('Maximum 10 layers allowed', 'layers', params.layers);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get weather imagery based on type
|
|
37
|
+
*/
|
|
38
|
+
export async function getWeatherImagery(params) {
|
|
39
|
+
// Validate parameters
|
|
40
|
+
validateImageryParams(params);
|
|
41
|
+
const { latitude, longitude, type, animated = false } = params;
|
|
42
|
+
// Redact coordinates for logging to protect user privacy
|
|
43
|
+
const redacted = redactCoordinatesForLogging(latitude, longitude);
|
|
44
|
+
logger.info('Weather imagery requested', {
|
|
45
|
+
latitude: redacted.lat,
|
|
46
|
+
longitude: redacted.lon,
|
|
47
|
+
type,
|
|
48
|
+
animated
|
|
49
|
+
});
|
|
50
|
+
// For now, we'll focus on precipitation radar using RainViewer
|
|
51
|
+
// Future enhancements can add NOAA radar and satellite imagery
|
|
52
|
+
switch (type) {
|
|
53
|
+
case 'precipitation':
|
|
54
|
+
case 'radar': {
|
|
55
|
+
const frames = await rainViewerService.getPrecipitationRadar(latitude, longitude, animated);
|
|
56
|
+
return {
|
|
57
|
+
type,
|
|
58
|
+
location: { latitude, longitude },
|
|
59
|
+
coverage: 'Global',
|
|
60
|
+
resolution: animated ? `${frames.length} frames` : 'Latest snapshot',
|
|
61
|
+
source: 'RainViewer',
|
|
62
|
+
animated,
|
|
63
|
+
frames,
|
|
64
|
+
generatedAt: new Date(),
|
|
65
|
+
disclaimer: 'RainViewer provides global precipitation radar. Data may have 5-10 minute delay. For official forecasts, consult local meteorological services.'
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
case 'satellite': {
|
|
69
|
+
// Placeholder for satellite imagery
|
|
70
|
+
// Future implementation can use NOAA GOES-16/17 or other satellite APIs
|
|
71
|
+
throw new ValidationError('Satellite imagery is not yet implemented. Use type="precipitation" or type="radar" for precipitation radar.', 'type', type);
|
|
72
|
+
}
|
|
73
|
+
default: {
|
|
74
|
+
throw new ValidationError(`Unsupported imagery type: ${type}`, 'type', type);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Format weather imagery response for display
|
|
80
|
+
*/
|
|
81
|
+
export function formatWeatherImageryResponse(response) {
|
|
82
|
+
const lines = [];
|
|
83
|
+
lines.push('# Weather Imagery');
|
|
84
|
+
lines.push('');
|
|
85
|
+
lines.push(`**Location:** ${response.location.latitude.toFixed(4)}, ${response.location.longitude.toFixed(4)}`);
|
|
86
|
+
lines.push(`**Type:** ${response.type.charAt(0).toUpperCase() + response.type.slice(1)}`);
|
|
87
|
+
lines.push(`**Coverage:** ${response.coverage}`);
|
|
88
|
+
if (response.resolution) {
|
|
89
|
+
lines.push(`**Resolution:** ${response.resolution}`);
|
|
90
|
+
}
|
|
91
|
+
lines.push(`**Source:** ${response.source}`);
|
|
92
|
+
lines.push(`**Animated:** ${response.animated ? 'Yes' : 'No'}`);
|
|
93
|
+
lines.push('');
|
|
94
|
+
// Display frames
|
|
95
|
+
if (response.animated && response.frames.length > 1) {
|
|
96
|
+
lines.push(`## 🎬 Animation Frames (${response.frames.length} frames)`);
|
|
97
|
+
lines.push('');
|
|
98
|
+
// Show first, middle, and last frames for brevity
|
|
99
|
+
const framesToShow = response.frames.length <= 5
|
|
100
|
+
? response.frames
|
|
101
|
+
: [
|
|
102
|
+
response.frames[0],
|
|
103
|
+
response.frames[Math.floor(response.frames.length / 2)],
|
|
104
|
+
response.frames[response.frames.length - 1]
|
|
105
|
+
];
|
|
106
|
+
framesToShow.forEach((frame) => {
|
|
107
|
+
const frameNumber = response.frames.indexOf(frame) + 1;
|
|
108
|
+
lines.push(`### Frame ${frameNumber} - ${frame.timestamp.toISOString()}`);
|
|
109
|
+
lines.push(``);
|
|
110
|
+
lines.push('');
|
|
111
|
+
});
|
|
112
|
+
if (response.frames.length > 5) {
|
|
113
|
+
lines.push(`*Showing 3 of ${response.frames.length} frames for brevity*`);
|
|
114
|
+
lines.push('');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else if (response.frames.length > 0) {
|
|
118
|
+
lines.push('## 📸 Current Imagery');
|
|
119
|
+
lines.push('');
|
|
120
|
+
const frame = response.frames[0];
|
|
121
|
+
lines.push(`**Timestamp:** ${frame.timestamp.toISOString()}`);
|
|
122
|
+
lines.push(``);
|
|
123
|
+
lines.push('');
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
lines.push('## ⚠️ No Imagery Available');
|
|
127
|
+
lines.push('');
|
|
128
|
+
lines.push('No imagery data is currently available for this location and time.');
|
|
129
|
+
lines.push('');
|
|
130
|
+
}
|
|
131
|
+
// Add disclaimer if present
|
|
132
|
+
if (response.disclaimer) {
|
|
133
|
+
lines.push('---');
|
|
134
|
+
lines.push('');
|
|
135
|
+
lines.push(`⚠️ **DISCLAIMER:** ${response.disclaimer}`);
|
|
136
|
+
lines.push('');
|
|
137
|
+
}
|
|
138
|
+
lines.push('---');
|
|
139
|
+
lines.push(`*Generated: ${response.generatedAt.toISOString()}*`);
|
|
140
|
+
lines.push(`*Data source: ${response.source}*`);
|
|
141
|
+
return lines.join('\n');
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=weatherImageryHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weatherImageryHandler.js","sourceRoot":"","sources":["../../src/handlers/weatherImageryHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,SAAS,qBAAqB,CAAC,MAA4B;IACzD,uBAAuB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handleGetWildfireInfo(args: unknown, nifcService: NIFCService): Promise<{
|
|
6
|
+
content: Array<{
|
|
7
|
+
type: string;
|
|
8
|
+
text: string;
|
|
9
|
+
}>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=wildfireHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wildfireHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/wildfireHandler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAYlD,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAmK7D"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handler for get_wildfire_info tool
|
|
3
|
+
*/
|
|
4
|
+
import { validateCoordinates } from '../utils/validation.js';
|
|
5
|
+
import { guessTimezoneFromCoords } from '../utils/timezone.js';
|
|
6
|
+
import { calculateDistance } from '../utils/distance.js';
|
|
7
|
+
export async function handleGetWildfireInfo(args, nifcService) {
|
|
8
|
+
// Validate input parameters with runtime checks
|
|
9
|
+
const { latitude, longitude } = validateCoordinates(args);
|
|
10
|
+
// Validate radius parameter
|
|
11
|
+
let radius = args?.radius ?? 100; // default 100 km
|
|
12
|
+
if (typeof radius !== 'number' || isNaN(radius) || !isFinite(radius)) {
|
|
13
|
+
radius = 100;
|
|
14
|
+
}
|
|
15
|
+
// Clamp to valid range (1-500 km)
|
|
16
|
+
radius = Math.max(1, Math.min(radius, 500));
|
|
17
|
+
// Get timezone for proper time formatting
|
|
18
|
+
const timezone = guessTimezoneFromCoords(latitude, longitude);
|
|
19
|
+
let output = `# Wildfire Information Report\n\n`;
|
|
20
|
+
output += `**Location:** ${latitude.toFixed(4)}, ${longitude.toFixed(4)}\n`;
|
|
21
|
+
output += `**Search Radius:** ${radius} km (${(radius * 0.621371).toFixed(1)} miles)\n\n`;
|
|
22
|
+
try {
|
|
23
|
+
// Calculate bounding box from center point and radius
|
|
24
|
+
// Approximate: 1 degree latitude ≈ 111 km
|
|
25
|
+
const latOffset = radius / 111;
|
|
26
|
+
const lonOffset = radius / (111 * Math.cos(latitude * Math.PI / 180));
|
|
27
|
+
const west = longitude - lonOffset;
|
|
28
|
+
const south = latitude - latOffset;
|
|
29
|
+
const east = longitude + lonOffset;
|
|
30
|
+
const north = latitude + latOffset;
|
|
31
|
+
// Query NIFC for fire perimeters
|
|
32
|
+
const response = await nifcService.queryFirePerimeters(west, south, east, north);
|
|
33
|
+
const features = response.features || [];
|
|
34
|
+
if (features.length === 0) {
|
|
35
|
+
output += `✅ **No active wildfires found within ${radius} km**\n\n`;
|
|
36
|
+
output += `The area is currently clear of reported wildfire activity.\n\n`;
|
|
37
|
+
output += `**Note:** This data includes active wildfires and prescribed burns tracked by the National Interagency Fire Center. Small fires or very recent ignitions may not yet be included.\n`;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Process and filter fires by actual distance
|
|
41
|
+
const firesWithDistance = [];
|
|
42
|
+
for (const feature of features) {
|
|
43
|
+
const attrs = feature.attributes;
|
|
44
|
+
// Calculate distance from center point to fire origin
|
|
45
|
+
let fireDistance = radius; // default if no coordinates
|
|
46
|
+
if (attrs.attr_InitialLatitude && attrs.attr_InitialLongitude) {
|
|
47
|
+
fireDistance = calculateDistance(latitude, longitude, attrs.attr_InitialLatitude, attrs.attr_InitialLongitude);
|
|
48
|
+
}
|
|
49
|
+
else if (feature.geometry?.rings?.[0]?.[0]) {
|
|
50
|
+
// Use first point of fire perimeter if no origin coordinates
|
|
51
|
+
const [fireLon, fireLat] = feature.geometry.rings[0][0];
|
|
52
|
+
fireDistance = calculateDistance(latitude, longitude, fireLat, fireLon);
|
|
53
|
+
}
|
|
54
|
+
// Only include fires within radius
|
|
55
|
+
if (fireDistance <= radius) {
|
|
56
|
+
const fireInfo = {
|
|
57
|
+
name: attrs.poly_IncidentName || 'Unknown Fire',
|
|
58
|
+
distance: fireDistance,
|
|
59
|
+
acres: attrs.poly_GISAcres || attrs.attr_FinalAcres || attrs.attr_CalculatedAcres || 0,
|
|
60
|
+
containment: attrs.attr_PercentContained || 0,
|
|
61
|
+
discoveryDate: attrs.attr_FireDiscoveryDateTime
|
|
62
|
+
? new Date(attrs.attr_FireDiscoveryDateTime)
|
|
63
|
+
: new Date(),
|
|
64
|
+
latitude: attrs.attr_InitialLatitude,
|
|
65
|
+
longitude: attrs.attr_InitialLongitude,
|
|
66
|
+
state: attrs.attr_POOState,
|
|
67
|
+
county: attrs.attr_POOCounty,
|
|
68
|
+
city: attrs.attr_POOCity,
|
|
69
|
+
type: attrs.attr_IncidentTypeCategory === 'WF' ? 'Wildfire' :
|
|
70
|
+
attrs.attr_IncidentTypeCategory === 'RX' ? 'Prescribed Fire' : 'Unknown',
|
|
71
|
+
status: attrs.poly_FeatureStatus || 'Active'
|
|
72
|
+
};
|
|
73
|
+
firesWithDistance.push({ fire: fireInfo, distance: fireDistance });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Sort by distance (nearest first)
|
|
77
|
+
firesWithDistance.sort((a, b) => a.distance - b.distance);
|
|
78
|
+
const fireCount = firesWithDistance.length;
|
|
79
|
+
const wildfireCount = firesWithDistance.filter(f => f.fire.type === 'Wildfire').length;
|
|
80
|
+
const prescribedCount = firesWithDistance.filter(f => f.fire.type === 'Prescribed Fire').length;
|
|
81
|
+
output += `🔥 **Found ${fireCount} active fire${fireCount > 1 ? 's' : ''}**\n`;
|
|
82
|
+
if (wildfireCount > 0) {
|
|
83
|
+
output += ` - ${wildfireCount} wildfire${wildfireCount > 1 ? 's' : ''}\n`;
|
|
84
|
+
}
|
|
85
|
+
if (prescribedCount > 0) {
|
|
86
|
+
output += ` - ${prescribedCount} prescribed burn${prescribedCount > 1 ? 's' : ''}\n`;
|
|
87
|
+
}
|
|
88
|
+
output += `\n`;
|
|
89
|
+
// Show details for nearest fires (limit to 5 to avoid overwhelming output)
|
|
90
|
+
const maxFiresToShow = 5;
|
|
91
|
+
const firesToShow = firesWithDistance.slice(0, maxFiresToShow);
|
|
92
|
+
for (const { fire, distance } of firesToShow) {
|
|
93
|
+
output += formatFireDetails(fire, distance, timezone);
|
|
94
|
+
}
|
|
95
|
+
if (firesWithDistance.length > maxFiresToShow) {
|
|
96
|
+
output += `\n*Note: ${firesWithDistance.length - maxFiresToShow} additional fire${firesWithDistance.length - maxFiresToShow > 1 ? 's' : ''} found within radius (showing nearest ${maxFiresToShow} only)*\n`;
|
|
97
|
+
}
|
|
98
|
+
// Safety recommendations based on nearest wildfire
|
|
99
|
+
const nearestWildfire = firesWithDistance.find(f => f.fire.type === 'Wildfire');
|
|
100
|
+
if (nearestWildfire) {
|
|
101
|
+
output += `\n## Safety Assessment\n\n`;
|
|
102
|
+
const dist = nearestWildfire.distance;
|
|
103
|
+
if (dist < 5) {
|
|
104
|
+
output += `⚠️ **EXTREME DANGER** - Wildfire within 5 km\n`;
|
|
105
|
+
output += `- Evacuate immediately if advised by authorities\n`;
|
|
106
|
+
output += `- Monitor local emergency alerts\n`;
|
|
107
|
+
output += `- Have evacuation plan ready\n`;
|
|
108
|
+
}
|
|
109
|
+
else if (dist < 25) {
|
|
110
|
+
output += `🟠 **HIGH ALERT** - Wildfire within 25 km\n`;
|
|
111
|
+
output += `- Monitor fire conditions closely\n`;
|
|
112
|
+
output += `- Prepare for possible evacuation\n`;
|
|
113
|
+
output += `- Watch for smoke and changing conditions\n`;
|
|
114
|
+
}
|
|
115
|
+
else if (dist < 50) {
|
|
116
|
+
output += `🟡 **CAUTION** - Wildfire within 50 km\n`;
|
|
117
|
+
output += `- Be aware of smoke and air quality impacts\n`;
|
|
118
|
+
output += `- Monitor local news and fire updates\n`;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
output += `ℹ️ **AWARENESS** - Wildfire detected within ${radius} km\n`;
|
|
122
|
+
output += `- Stay informed about fire progression\n`;
|
|
123
|
+
output += `- Air quality may be affected by smoke\n`;
|
|
124
|
+
}
|
|
125
|
+
output += `\n`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
output += `❌ **Error retrieving wildfire data**\n\n`;
|
|
131
|
+
output += `Unable to fetch fire information. This may be due to:\n`;
|
|
132
|
+
output += `- Temporary service unavailability\n`;
|
|
133
|
+
output += `- Network connectivity issues\n`;
|
|
134
|
+
output += `- Service maintenance\n\n`;
|
|
135
|
+
output += `Error details: ${error instanceof Error ? error.message : String(error)}\n`;
|
|
136
|
+
}
|
|
137
|
+
output += `\n---\n`;
|
|
138
|
+
output += `*Data source: NIFC (National Interagency Fire Center) WFIGS*\n`;
|
|
139
|
+
output += `*Wildfire data is updated throughout the day. Always consult official sources for evacuation orders and emergency information.*\n`;
|
|
140
|
+
output += `*For active incidents and evacuation orders, visit: https://inciweb.nwcg.gov/*\n`;
|
|
141
|
+
return {
|
|
142
|
+
content: [
|
|
143
|
+
{
|
|
144
|
+
type: 'text',
|
|
145
|
+
text: output
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Format detailed information for a single wildfire
|
|
152
|
+
*/
|
|
153
|
+
function formatFireDetails(fire, distance, timezone) {
|
|
154
|
+
let output = `## ${fire.name}\n\n`;
|
|
155
|
+
// Fire type emoji
|
|
156
|
+
const typeEmoji = fire.type === 'Wildfire' ? '🔥' :
|
|
157
|
+
fire.type === 'Prescribed Fire' ? '🟦' : '⚪';
|
|
158
|
+
output += `**Type:** ${typeEmoji} ${fire.type}\n`;
|
|
159
|
+
output += `**Distance:** ${distance.toFixed(1)} km (${(distance * 0.621371).toFixed(1)} mi)\n`;
|
|
160
|
+
if (fire.state) {
|
|
161
|
+
let location = fire.state;
|
|
162
|
+
if (fire.county)
|
|
163
|
+
location += `, ${fire.county} County`;
|
|
164
|
+
if (fire.city)
|
|
165
|
+
location += ` near ${fire.city}`;
|
|
166
|
+
output += `**Location:** ${location}\n`;
|
|
167
|
+
}
|
|
168
|
+
if (fire.latitude && fire.longitude) {
|
|
169
|
+
output += `**Coordinates:** ${fire.latitude.toFixed(4)}, ${fire.longitude.toFixed(4)}\n`;
|
|
170
|
+
}
|
|
171
|
+
output += `\n`;
|
|
172
|
+
// Fire statistics
|
|
173
|
+
output += `### Status\n`;
|
|
174
|
+
output += `**Size:** ${fire.acres.toFixed(0)} acres (${(fire.acres * 0.404686).toFixed(0)} hectares)\n`;
|
|
175
|
+
// Containment with visual indicator
|
|
176
|
+
const containmentBars = Math.round(fire.containment / 10);
|
|
177
|
+
const containmentVisual = '█'.repeat(containmentBars) + '░'.repeat(10 - containmentBars);
|
|
178
|
+
output += `**Containment:** ${fire.containment.toFixed(0)}% ${containmentVisual}\n`;
|
|
179
|
+
const now = new Date();
|
|
180
|
+
const daysActive = Math.floor((now.getTime() - fire.discoveryDate.getTime()) / (1000 * 60 * 60 * 24));
|
|
181
|
+
output += `**Discovery Date:** ${fire.discoveryDate.toLocaleDateString('en-US', { timeZone: timezone })}\n`;
|
|
182
|
+
output += `**Days Active:** ${daysActive}\n`;
|
|
183
|
+
output += `\n---\n\n`;
|
|
184
|
+
return output;
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=wildfireHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wildfireHandler.js","sourceRoot":"","sources":["../../src/handlers/wildfireHandler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAA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