@cyanheads/noaa-spaceweather-mcp-server 0.4.0 → 0.6.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.
Files changed (45) hide show
  1. package/AGENTS.md +9 -8
  2. package/CLAUDE.md +9 -8
  3. package/README.md +13 -12
  4. package/changelog/0.5.x/0.5.0.md +28 -0
  5. package/changelog/0.6.x/0.6.0.md +41 -0
  6. package/changelog/template.md +20 -11
  7. package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts +3 -2
  8. package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts.map +1 -1
  9. package/dist/mcp-server/tools/definitions/get-alerts.tool.js +69 -36
  10. package/dist/mcp-server/tools/definitions/get-alerts.tool.js.map +1 -1
  11. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.d.ts +2 -2
  12. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.d.ts.map +1 -1
  13. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.js +19 -22
  14. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.js.map +1 -1
  15. package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts +28 -26
  16. package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/get-conditions.tool.js +108 -115
  18. package/dist/mcp-server/tools/definitions/get-conditions.tool.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/get-kp-index.tool.d.ts +8 -5
  20. package/dist/mcp-server/tools/definitions/get-kp-index.tool.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/get-kp-index.tool.js +64 -42
  22. package/dist/mcp-server/tools/definitions/get-kp-index.tool.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.d.ts +23 -16
  24. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.js +151 -64
  26. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.d.ts +2 -2
  28. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.d.ts.map +1 -1
  29. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js +5 -28
  30. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js.map +1 -1
  31. package/dist/mcp-server/tools/definitions/index.d.ts +117 -104
  32. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  33. package/dist/services/space-weather/kp-headline.d.ts +30 -0
  34. package/dist/services/space-weather/kp-headline.d.ts.map +1 -0
  35. package/dist/services/space-weather/kp-headline.js +39 -0
  36. package/dist/services/space-weather/kp-headline.js.map +1 -0
  37. package/dist/services/space-weather/space-weather-service.d.ts +37 -8
  38. package/dist/services/space-weather/space-weather-service.d.ts.map +1 -1
  39. package/dist/services/space-weather/space-weather-service.js +277 -112
  40. package/dist/services/space-weather/space-weather-service.js.map +1 -1
  41. package/dist/services/space-weather/types.d.ts +97 -46
  42. package/dist/services/space-weather/types.d.ts.map +1 -1
  43. package/package.json +9 -9
  44. package/server.json +3 -3
  45. package/skills/noaa-spaceweather-guide/SKILL.md +8 -8
@@ -5,10 +5,10 @@
5
5
  * records, and exposes per-feed methods used by all tools.
6
6
  * @module services/space-weather/space-weather-service
7
7
  */
8
- import type { Context } from '@cyanheads/mcp-ts-core';
8
+ import { type Context } from '@cyanheads/mcp-ts-core';
9
9
  import type { AppConfig } from '@cyanheads/mcp-ts-core/config';
10
10
  import type { StorageService } from '@cyanheads/mcp-ts-core/storage';
11
- import type { AuroraForecastData, F107Observation, ForecastDiscussion, KpForecast, KpObservation, NoaaScalesData, ProtonFlux, SolarProbabilities, SolarRegion, SolarWindMag, SolarWindPlasma, SpaceWeatherAlert, XrayFlare, XrayFlux } from './types.js';
11
+ import type { AuroraForecastData, F107Observation, FlareRegionAttribution, ForecastDiscussion, KpForecast, KpObservation, NoaaScalesData, ProtonFlux, SolarProbabilities, SolarRegion, SolarWindMag, SolarWindPlasma, SpaceWeatherAlert, XrayFlare, XrayFlux } from './types.js';
12
12
  /**
13
13
  * Maps a Kp value (0–9) to its NOAA G-scale level (0–5). Shared with the
14
14
  * get-kp-index tool.
@@ -32,16 +32,19 @@ export interface AuroraBand {
32
32
  minKp: number;
33
33
  }
34
34
  /**
35
- * Aurora reachability by geomagnetic latitude, keyed on NOAA G level, ordered
35
+ * Typical aurora reach by geomagnetic latitude, keyed on NOAA G level, ordered
36
36
  * poleward-first. The single table for the whole server: aurora-latitude guidance
37
37
  * on the Kp tools and the Kp threshold the aurora tool reports for a location both
38
38
  * read it, so the two can no longer state different thresholds for one place.
39
39
  *
40
- * Latitudes for G2–G5 are the NOAA scales page figures. The 60° G1 row is this
40
+ * Latitudes for G2–G5 are the NOAA scales page figures, which give where each
41
+ * level's aurora is typically seen, not hard limits. The 60° G1 row is this
41
42
  * server's interpolation between that page's G2 row and the oval edge — the page
42
43
  * states no G1 latitude. The 65° row is not a storm level at all: it is the
43
44
  * quiet-time equatorward edge of the auroral oval, where aurora needs no elevated
44
- * Kp. Below the 40° G5 row no level on the scale reaches.
45
+ * Kp. Below the 40° G5 row the table assigns no level: that lies beyond the typical
46
+ * G5 band, though an exceptional storm has carried aurora well past it (Puerto Rico,
47
+ * 27° magnetic latitude, May 2024).
45
48
  *
46
49
  * Each Kp floor is its level's "minus" third — the value at which SWPC starts the
47
50
  * level, per {@link kpToGScale} — except G5, which begins at a whole Kp 9.
@@ -49,7 +52,7 @@ export interface AuroraBand {
49
52
  export declare const AURORA_BANDS: readonly AuroraBand[];
50
53
  /**
51
54
  * Resolve the aurora band a geomagnetic latitude sits in, north or south. Returns
52
- * null equatorward of the 40° G5 edge, where no NOAA storm level reaches.
55
+ * null equatorward of the 40° G5 edge, beyond the typical G5 band.
53
56
  */
54
57
  export declare function auroraBandForGeomagneticLatitude(geomagneticLatitude: number): AuroraBand | null;
55
58
  /** NOAA SWPC public feeds client. Initialized once; accessed via accessor. */
@@ -60,7 +63,7 @@ export declare class SpaceWeatherService {
60
63
  */
61
64
  private readonly userAgent;
62
65
  constructor(config: AppConfig, _storage: StorageService);
63
- /** Fetch NOAA storm scales: yesterday's assessed levels, today, and the 3-day forecast. */
66
+ /** Fetch latest observed levels, rolling 24-hour observed maxima, and the 3-day forecast. */
64
67
  getNoaaScales(ctx: Context): Promise<NoaaScalesData>;
65
68
  /**
66
69
  * Fetch the SWPC Forecast Discussion — the forecaster-written narrative explaining
@@ -93,6 +96,10 @@ export declare class SpaceWeatherService {
93
96
  * feed — same seven keys, same two energy channels, same 1-minute cadence, same
94
97
  * newest time tag — so the past-hour slice its only caller takes is the same 61
95
98
  * records either way, for ~4.36 MB less per call.
99
+ *
100
+ * A reading without a finite flux (null, a repaired `NaN`, or the fill value) is
101
+ * dropped rather than passed on: it has no class to report, and the series' last
102
+ * element is read as the latest reading. Zero and negative readings are real and stay.
96
103
  */
97
104
  getXrayFlux(ctx: Context): Promise<XrayFlux[]>;
98
105
  /**
@@ -104,6 +111,22 @@ export declare class SpaceWeatherService {
104
111
  * accident of the feed.
105
112
  */
106
113
  getXrayFlares(ctx: Context): Promise<XrayFlare[]>;
114
+ /**
115
+ * Fetch SWPC's edited events and index their GOES X-ray (`XRA`) records for flare
116
+ * source-region attribution, or report why attribution is unavailable.
117
+ *
118
+ * A flare matches the record from its own satellite (`G<satellite>`) beginning in the
119
+ * same UTC minute, never another satellite's: GOES-19 records an onset a minute or two
120
+ * off GOES-18 on about a third of flares, so a minute-only key would pair the wrong
121
+ * record. Records sharing a key that name different regions read as unassigned.
122
+ *
123
+ * This is an opt-in side lookup, so it rejects only on caller cancellation. Every other
124
+ * failure resolves as `unavailable` with a logged warning, so the caller keeps its
125
+ * primary answer: `feed_unavailable` or `feed_moved` from the shared funnel, and
126
+ * `feed_moved` for a body not in the documented shape. The shape check runs out here,
127
+ * after the funnel, so a break no retry can fix costs one attempt.
128
+ */
129
+ getFlareSourceRegions(ctx: Context): Promise<FlareRegionAttribution>;
107
130
  /**
108
131
  * Fetch the latest daily F10.7 solar radio flux report, or null when the feed
109
132
  * carries no Noon record.
@@ -119,7 +142,13 @@ export declare class SpaceWeatherService {
119
142
  getSolarRegions(ctx: Context): Promise<SolarRegion[]>;
120
143
  /** Fetch solar flare probabilities (3-day forward outlook from the latest issued entry). */
121
144
  getSolarProbabilities(ctx: Context): Promise<SolarProbabilities[]>;
122
- /** Fetch GOES integral proton flux (3-day, ≥10 MeV channel). */
145
+ /**
146
+ * Fetch GOES integral proton flux (3-day, ≥10 MeV channel).
147
+ *
148
+ * A record without a finite flux (null, a repaired `NaN`, or the fill value) is
149
+ * dropped, so the series' last element — the reading the S level is classified
150
+ * from — is the newest one SWPC actually measured, however old.
151
+ */
123
152
  getProtonFlux(ctx: Context): Promise<ProtonFlux[]>;
124
153
  /** Fetch SWPC alerts, watches, and warnings. */
125
154
  getAlerts(ctx: Context): Promise<SpaceWeatherAlert[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"space-weather-service.d.ts","sourceRoot":"","sources":["../../../src/services/space-weather/space-weather-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,cAAc,EAEd,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACT,MAAM,YAAY,CAAC;AAgCpB;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAQ7C;AAED,sEAAsE;AACtE,MAAM,WAAW,UAAU;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;OAOG;IACG,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAkBtD;IAED;;;;;;;;;OASG;IACG,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAe3D;IAED,mEAAmE;IAC7D,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAqC1D;IAED,4FAA4F;IACtF,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA0CvE;IAED,gEAAgE;IAC1D,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAcvD;IAID,gDAAgD;IAC1C,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAiD1D;CACF;AAMD,0EAA0E;AAC1E,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAExF;AAED,4DAA4D;AAC5D,wBAAgB,sBAAsB,IAAI,mBAAmB,CAM5D"}
1
+ {"version":3,"file":"space-weather-service.d.ts","sourceRoot":"","sources":["../../../src/services/space-weather/space-weather-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAK,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,cAAc,EAEd,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACT,MA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