mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
* fix(oauth): fix CSS arrow bullets + add MCP branding to consent page
- CSS content:'\2192' (not HTML entity which doesn't work in CSS)
- Rename logo/title to "WorldMonitor MCP" on both consent and error pages
- Inject real news headlines into get_country_brief to prevent hallucination
Fetches list-feed-digest (4s budget), passes top-15 headlines as ?context=
to get-country-intel-brief; brief timeout reduced to 24s to stay under Edge ceiling
* feat(mcp): add get_airspace + get_maritime_activity live query tools
New tools answer real-time positional questions via existing bbox RPCs:
- get_airspace: civilian ADS-B (OpenSky) + military flights over any country
parallel-fetches track-aircraft + list-military-flights, capped at 100 each
- get_maritime_activity: AIS density zones + disruptions for a country's waters
calls get-vessel-snapshot with country bbox
Country → bounding box resolved via shared/country-bboxes.json (167 entries,
generated from public/data/countries.geojson by scripts/generate-country-bboxes.cjs).
Both API calls use 8s AbortSignal.timeout; get_airspace uses Promise.allSettled
so one failure doesn't block the other.
* docs: fix markdown lint in airspace/maritime plan (blank lines around lists)
* fix(oauth): use literal → in CSS content (\2192 is invalid JS octal in ESM)
* fix(hooks): extend bundle check to api/oauth/ subdirectory (was api/*.js, now uses find)
* fix(mcp): address P1 review findings from PR 2442
- JSON import: add 'with { type: json }' so node --test works without tsx loader
- get_airspace: surface upstream failures; partial outage => partial:true+warnings,
total outage => throw (prevents misleading zero-aircraft response)
- pre-push hook: add #!/usr/bin/env bash shebang (was no shebang, ran as /bin/sh
on Linux CI/contributors; process substitution + [[ ]] require bash)
* fix(mcp): replace JSON import attribute with TS module for Vercel compat
Vercel's esbuild bundler does not support `with { type: 'json' }` import
attributes, causing builds to fail with "Expected ';' but found 'with'".
Fix: generate shared/country-bboxes.ts (typed TS module) alongside the
existing JSON file. The TS import has no attributes and bundles cleanly
with all esbuild versions.
Also extend the pre-push bundle check to include api/*.ts root-level files
so this class of error is caught locally before push.
* fix(mcp): reduce get_country_brief timing budget to 24 s (6 s Edge margin)
Digest pre-fetch: 4 s → 2 s (cached endpoint, silent fallback on miss)
Brief call: 24 s → 22 s
Total worst-case: 24 s vs Vercel Edge 30 s hard kill — was 28 s (2 s margin)
* test(mcp): add coverage for get_airspace and get_maritime_activity
9 new tests:
- get_airspace: happy path, unknown code, partial failure (mil down),
total failure (-32603), type=civilian skips military fetch
- get_maritime_activity: happy path, unknown code, API failure (-32603),
empty snapshot handled gracefully
Also fixes import to use .ts extension so Node --test resolver finds the
country-bboxes module (tsx resolves .ts directly; .js alias only works
under moduleResolution:bundler at typecheck time)
* fix(mcp): use .js + .d.ts for country-bboxes — Vercel rejects .ts imports
Vercel edge bundler refuses .ts extension imports even from .ts edge
functions. Plain .js is the only safe runtime import for edge functions.
Pattern: generate shared/country-bboxes.js (pure ESM, no TS syntax) +
shared/country-bboxes.d.ts (type declaration). TypeScript uses the .d.ts
for tuple types at check time; Vercel and Node --test load the .js at
runtime. The previous .ts module is removed.
* test(mcp): update tool count to 26 (main added search_flights + search_flight_prices_by_date)
173 lines
6.4 KiB
JavaScript
173 lines
6.4 KiB
JavaScript
// Auto-generated by scripts/generate-country-bboxes.cjs — do not edit manually
|
|
// To regenerate: node scripts/generate-country-bboxes.cjs
|
|
const COUNTRY_BBOXES = {
|
|
"AE": [22.62, 51.57, 26.06, 56.38],
|
|
"AF": [29.39, 60.49, 38.47, 74.89],
|
|
"AL": [39.69, 19.31, 42.55, 20.97],
|
|
"AM": [38.86, 43.44, 41.29, 46.6],
|
|
"AO": [-18.03, 11.74, -4.39, 24],
|
|
"AQ": [-90, -180, -64.38, 180],
|
|
"AR": [-54.91, -73.47, -21.79, -53.67],
|
|
"AT": [46.42, 9.52, 49.01, 17.15],
|
|
"AU": [-43.63, 113.39, -10.93, 153.61],
|
|
"AZ": [38.43, 44.77, 41.89, 49.59],
|
|
"BA": [42.56, 15.72, 45.28, 19.62],
|
|
"BD": [21.06, 88.02, 26.42, 92.58],
|
|
"BE": [49.54, 2.52, 51.38, 6.12],
|
|
"BF": [9.49, -5.52, 15.07, 2.39],
|
|
"BG": [41.24, 22.35, 44.23, 28.58],
|
|
"BI": [-4.45, 29.02, -2.4, 30.83],
|
|
"BJ": [6.21, 0.77, 12.4, 3.84],
|
|
"BN": [4.02, 114, 4.89, 114.98],
|
|
"BO": [-22.83, -69.58, -9.83, -57.55],
|
|
"BR": [-33.74, -73.77, 5.2, -34.8],
|
|
"BT": [26.7, 88.89, 28.34, 92.04],
|
|
"BW": [-26.86, 19.98, -17.79, 29.35],
|
|
"BY": [51.48, 23.49, 56.14, 32.72],
|
|
"BZ": [15.89, -89.24, 18.48, -88.09],
|
|
"CA": [41.68, -141.01, 83.05, -52.63],
|
|
"CD": [-13.43, 12.21, 5.37, 31.24],
|
|
"CF": [2.24, 14.52, 11, 27.44],
|
|
"CG": [-5.02, 11.11, 3.62, 18.63],
|
|
"CH": [45.91, 6.06, 47.8, 10.45],
|
|
"CI": [4.35, -8.57, 10.43, -2.51],
|
|
"CL": [-55.63, -75.7, -17.51, -67.01],
|
|
"CM": [1.91, 8.59, 13.08, 16.2],
|
|
"CN": [18.29, 73.63, 53.55, 134.77],
|
|
"CO": [-4.24, -78.83, 12.47, -66.88],
|
|
"CR": [8.03, -85.86, 11.08, -82.57],
|
|
"CU": [19.86, -84.02, 23.2, -74.27],
|
|
"CY": [34.63, 32.58, 35.19, 34.02],
|
|
"CZ": [48.59, 12.34, 50.92, 18.83],
|
|
"DE": [47.3, 5.99, 54.9, 14.81],
|
|
"DJ": [10.97, 41.75, 12.71, 43.41],
|
|
"DK": [54.81, 8.29, 57.59, 12.6],
|
|
"DO": [18.04, -71.91, 19.94, -68.74],
|
|
"DZ": [18.98, -8.68, 37.08, 11.97],
|
|
"EC": [-4.96, -80.85, 1.43, -75.28],
|
|
"EE": [57.52, 23.47, 59.63, 28.02],
|
|
"EG": [21.99, 24.69, 31.66, 36.88],
|
|
"EH": [20.77, -17.06, 27.66, -8.68],
|
|
"ER": [12.47, 36.42, 18, 43.12],
|
|
"ES": [36.14, -9.22, 43.71, 3.18],
|
|
"ET": [3.46, 33.05, 14.88, 47.98],
|
|
"FI": [59.9, 20.62, 70.08, 31.57],
|
|
"FJ": [-18.25, 177.34, -16.15, 180],
|
|
"FR": [2.11, -54.62, 51.09, 9.55],
|
|
"GA": [-3.94, 8.8, 2.3, 14.5],
|
|
"GB": [50.23, -8.16, 58.66, 1.77],
|
|
"GE": [41.11, 39.99, 43.54, 46.43],
|
|
"GH": [4.74, -3.26, 11.13, 1.19],
|
|
"GL": [60.19, -72.78, 83.63, -11.64],
|
|
"GN": [7.25, -15.02, 12.67, -7.69],
|
|
"GQ": [1, 9.41, 2.34, 11.34],
|
|
"GR": [34.93, 20, 41.71, 26.64],
|
|
"GT": [13.73, -92.25, 17.81, -88.22],
|
|
"GW": [10.97, -16.73, 12.68, -13.73],
|
|
"GY": [1.27, -61.38, 8.56, -56.48],
|
|
"HN": [12.98, -89.36, 15.98, -83.13],
|
|
"HR": [42.42, 13.59, 46.5, 19.02],
|
|
"HT": [18.04, -72.89, 19.94, -71.64],
|
|
"HU": [45.74, 16.09, 48.53, 22.88],
|
|
"ID": [-10.34, 95.2, 5.55, 140.98],
|
|
"IE": [51.59, -10.23, 55.16, -6],
|
|
"IL": [29.49, 34.25, 33.41, 35.82],
|
|
"IN": [8.08, 68.18, 35.5, 97.32],
|
|
"IQ": [29.1, 38.77, 37.37, 48.53],
|
|
"IR": [25.2, 44.06, 39.69, 62.75],
|
|
"IS": [63.4, -24.2, 66.47, -13.53],
|
|
"IT": [36.79, 7.02, 46.99, 18.01],
|
|
"JM": [17.72, -78.08, 18.52, -76.26],
|
|
"JO": [29.19, 34.95, 33.37, 39.15],
|
|
"JP": [31.11, 129.85, 45.51, 145.77],
|
|
"KE": [-4.68, 33.89, 4.98, 41.89],
|
|
"KG": [39.33, 69.29, 43.22, 80.21],
|
|
"KH": [10.42, 102.33, 14.7, 107.6],
|
|
"KP": [37.83, 124.37, 42.53, 130.7],
|
|
"KR": [34.44, 126.27, 38.62, 129.45],
|
|
"KW": [28.53, 46.53, 29.99, 48.43],
|
|
"KZ": [40.58, 46.48, 55.35, 87.32],
|
|
"LA": [14.32, 100.1, 22.4, 107.66],
|
|
"LB": [33.09, 35.11, 34.65, 36.6],
|
|
"LK": [5.92, 79.76, 9.5, 81.88],
|
|
"LR": [4.35, -11.48, 8.49, -7.45],
|
|
"LS": [-30.65, 27.01, -28.6, 29.44],
|
|
"LT": [53.94, 21.05, 56.42, 26.59],
|
|
"LU": [49.46, 5.79, 50.12, 6.35],
|
|
"LV": [55.67, 21.05, 58.06, 28.15],
|
|
"LY": [19.5, 9.4, 33.18, 25.15],
|
|
"MA": [21.42, -17.01, 35.92, -1.25],
|
|
"MD": [45.46, 26.62, 48.45, 29.73],
|
|
"ME": [41.85, 18.44, 43.53, 20.35],
|
|
"MG": [-25.57, 43.22, -12.3, 50.5],
|
|
"MK": [40.85, 20.48, 42.31, 22.92],
|
|
"ML": [10.16, -12.26, 25, 4.23],
|
|
"MM": [10.35, 92.27, 28.53, 101.16],
|
|
"MN": [41.6, 87.82, 52.11, 119.7],
|
|
"MR": [14.77, -17.06, 27.29, -4.82],
|
|
"MW": [-16.48, 32.72, -9.41, 35.85],
|
|
"MX": [14.55, -117.13, 32.53, -86.74],
|
|
"MY": [0.85, 100.13, 6.71, 119.16],
|
|
"MZ": [-26.85, 30.21, -10.47, 40.84],
|
|
"NA": [-28.96, 11.77, -16.96, 25.26],
|
|
"NC": [-22.29, 164.37, -20.3, 167.03],
|
|
"NE": [11.7, 0.15, 23.52, 15.95],
|
|
"NG": [4.28, 2.67, 13.87, 14.67],
|
|
"NI": [10.72, -87.31, 15, -83.13],
|
|
"NL": [50.75, 4.14, 53.41, 7.19],
|
|
"NO": [58.03, 4.96, 80.33, 31.06],
|
|
"NP": [26.35, 80.04, 30.41, 88.12],
|
|
"NZ": [-46.68, 166.49, -35.01, 178.29],
|
|
"OM": [16.64, 51.98, 24.98, 59.79],
|
|
"PA": [7.21, -82.9, 9.63, -77.2],
|
|
"PE": [-18.34, -81.25, -0.11, -68.68],
|
|
"PG": [-10.35, 140.97, -2.6, 155.93],
|
|
"PH": [5.8, 119.88, 18.54, 126.57],
|
|
"PK": [23.8, 60.84, 37.02, 77.05],
|
|
"PL": [49.07, 14.2, 54.82, 24.11],
|
|
"PR": [17.93, -67.21, 18.52, -65.63],
|
|
"PS": [31.21, 34.2, 32.38, 35.56],
|
|
"PT": [37.12, -9.49, 41.97, -6.21],
|
|
"PY": [-27.49, -62.65, -19.29, -54.25],
|
|
"QA": [24.63, 50.75, 26.05, 51.62],
|
|
"RO": [43.65, 20.24, 48.26, 29.66],
|
|
"RS": [42.25, 18.9, 46.11, 22.94],
|
|
"RU": [41.21, -180, 81.29, 180],
|
|
"RW": [-2.81, 28.86, -1.07, 30.83],
|
|
"SA": [16.37, 34.63, 32.12, 55.64],
|
|
"SD": [8.69, 22.07, 22, 38.6],
|
|
"SE": [55.4, 11.22, 69.04, 24.16],
|
|
"SI": [45.49, 13.59, 46.86, 16.52],
|
|
"SK": [47.75, 16.95, 49.51, 22.54],
|
|
"SL": [6.92, -13.3, 10, -10.28],
|
|
"SN": [12.31, -17.18, 16.64, -11.39],
|
|
"SO": [-1.7, 40.97, 11.99, 51.14],
|
|
"SR": [1.94, -58.07, 6.01, -53.99],
|
|
"SS": [3.49, 24.17, 11.71, 35.92],
|
|
"SV": [13.25, -90.1, 14.42, -87.82],
|
|
"SY": [32.32, 35.76, 37.11, 42.36],
|
|
"SZ": [-27.32, 30.79, -25.91, 32.11],
|
|
"TD": [7.52, 13.45, 23.44, 23.98],
|
|
"TG": [6.1, -0.17, 11.13, 1.62],
|
|
"TH": [5.64, 97.77, 20.32, 105.65],
|
|
"TJ": [36.7, 67.76, 40.88, 75.16],
|
|
"TL": [-9.49, 124.92, -8.31, 127.01],
|
|
"TM": [35.22, 52.44, 42.78, 66.55],
|
|
"TN": [30.23, 7.48, 37.34, 11.51],
|
|
"TR": [35.92, 26.04, 42.09, 44.81],
|
|
"TZ": [-11.72, 29.4, -1, 40.44],
|
|
"UA": [45.22, 22.13, 52.35, 40.14],
|
|
"UG": [-1.39, 29.58, 4.22, 34.98],
|
|
"US": [19.03, -168.08, 71.31, -66.98],
|
|
"UY": [-34.97, -58.39, -30.1, -53.13],
|
|
"UZ": [37.19, 55.98, 45.56, 72.62],
|
|
"VE": [0.76, -73.01, 11.85, -59.82],
|
|
"VN": [8.82, 102.12, 23.32, 109.47],
|
|
"XK": [41.87, 20.06, 43.17, 21.56],
|
|
"YE": [12.62, 42.7, 19, 53.09],
|
|
"ZA": [-34.81, 16.49, -22.19, 32.89],
|
|
"ZM": [-17.94, 21.98, -8.19, 33.67],
|
|
"ZW": [-22.4, 25.26, -15.64, 33.03],
|
|
};
|
|
export default COUNTRY_BBOXES;
|