feat: add aviation and satellite tools

Add aircraft_in_area, find_aircraft, get_aircraft_track and
get_aircraft_info over the live aircraft sources, with an optional
military feed, and next_satellite_pass and satellites_overhead over the
satellite catalog and the existing pass predictor.

Source failures from the live contract now become tool errors with the
matching code, so a rate limit reaches clients as retry_later with a
wait time. Tool schemas may use pattern.
This commit is contained in:
Sameh Khamis committed 2026-10-01 12:05:50 -07:00
1 parent 9895942633
commit 22c3fe40b0
16 files changed
+1111 -16

No files matched your search

+14
View File
@@ -104,6 +104,20 @@ export function distanceKm(a, b) {
return 2 * EARTH_RADIUS_KM * Math.asin(Math.min(1, Math.sqrt(h)));
}
/** The center of a resolved area, handling boxes across the antimeridian. */
export function areaCenter(area) {
if (area.center) return { lat: area.center.lat, lon: area.center.lon };
const width =
area.west <= area.east
? area.east - area.west
: area.east + 360 - area.west;
const lon = area.west + width / 2;
return {
lat: (area.south + area.north) / 2,
lon: lon > 180 ? lon - 360 : lon,
};
}
/** Whether a point lies inside a resolved area, including radius areas. */
export function areaContains(area, point) {
if (!Number.isFinite(point?.lat) || !Number.isFinite(point?.lon))