@dangahagan/weather-mcp 1.35.13 → 1.35.14

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.
@@ -0,0 +1,68 @@
1
+ /**
2
+ * NWS alert-authority country codes (pure, no imports).
3
+ *
4
+ * Two consumers: the critical-alert banner (`resolveCriticalAlertBanner` in
5
+ * `src/handlers/criticalAlertBanner.ts`) and `get_alerts`'s country router
6
+ * (`src/handlers/alertsHandler.ts`, via `isNwsCountryCode`).
7
+ *
8
+ * **The banner applies `NWS_CODE_PLUS_BOX` together with `isInNwsTerritory`;
9
+ * `get_alerts` deliberately does not.** On 2026-11-11 NWS answered HTTP 200 at
10
+ * Pagan (18.12, 145.76) and the other northern Marianas, which lie outside the
11
+ * `isInNwsTerritory` box. A box-gated router would claim "not covered" where
12
+ * NOAA serves. The banner is a positive-assertion-only element that may omit
13
+ * itself; a router that claims coverage may not.
14
+ */
15
+ /**
16
+ * Country codes that settle NWS jurisdiction **on their own**, with no geography.
17
+ *
18
+ * Two sets, not one with a special case: a single set whose membership means
19
+ * different things for different members is how the next reader gets it wrong.
20
+ * The names state the rule.
21
+ *
22
+ * `'pr'` belongs **here and not in `NWS_CODE_PLUS_BOX`, and that is a correctness
23
+ * constraint rather than a style one.** Puerto Rico lives in `isInUS`, *not* in
24
+ * `isInNwsTerritory` — the new predicate covers only the four territories `isInUS`
25
+ * leaves out. Pairing `'pr'` with the territory box would therefore evaluate
26
+ * `false` and silently drop the banner for every Open-Meteo-geocoded Puerto Rico
27
+ * request, turning a coverage fix into a coverage regression. Tidying it across is
28
+ * the obvious wrong move; a mutation row in the plan pins it, and a relocation has
29
+ * the same red set as a deletion.
30
+ *
31
+ * `us` also stays code-alone because making it conditional on a box would silently
32
+ * narrow behaviour this change does not touch.
33
+ *
34
+ * **Which provider emits which value** (G48 — a fixture value the live resolver
35
+ * never produces proves nothing). `us` comes from Census (`CensusGovProvider`
36
+ * hard-codes `'US'`), from Nominatim (`NominatimProvider` upper-cases
37
+ * `address.country_code`; OSM resolves every US territory to `US` at country
38
+ * zoom, measured in issue #86 and again 2026-09-18), and from saved locations.
39
+ * The ISO territory codes `GU`/`MP`/`VI`/`AS`/`PR` come **only** from the
40
+ * Open-Meteo geocoder (`OpenMeteoProvider` passes `item.country_code` through),
41
+ * the last provider in every provider order `GeocodingService` builds, reached
42
+ * when the first two return nothing. So `pr` is reachable on that path and
43
+ * nowhere else.
44
+ *
45
+ * COFA codes (`fm`, `pw`, `mh`) are absent from both sets deliberately: sovereign
46
+ * countries, `/points` answers 500, out of scope until someone asks.
47
+ *
48
+ * Lower-cased, as `NIFC_COVERED_COUNTRIES` is (`wildfireHandler.ts`); these are
49
+ * not geography facts, which is why they live apart from `geography.ts`.
50
+ */
51
+ export declare const NWS_CODE_ALONE: ReadonlySet<string>;
52
+ /**
53
+ * Territory codes that require `isInNwsTerritory` **as well**, wherever the
54
+ * caller is the banner (see the module header: `get_alerts` does not apply it).
55
+ *
56
+ * A country code is a *fast path* — a resolved location already knows its country,
57
+ * so the common case costs no geography at all — and a fast path must not admit
58
+ * what the authoritative predicate rejects. `MP` is the one code in either set that
59
+ * spans served and unserved area: it names the whole Northern Marianas while NWS
60
+ * accepts only the southern arc, so `'MP'` deciding alone would re-open, through
61
+ * the Open-Meteo geocoder, exactly the northern-CNMI request the box was drawn to
62
+ * prevent — an uncached HTTP 400 and two `securityEvent` warns at the points the
63
+ * box exists to exclude.
64
+ */
65
+ export declare const NWS_CODE_PLUS_BOX: ReadonlySet<string>;
66
+ /** Lower-cased code → true when NWS is the alert authority for that country code, with no geography. */
67
+ export declare function isNwsCountryCode(code: string): boolean;
68
+ //# sourceMappingURL=nwsJurisdiction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nwsJurisdiction.d.ts","sourceRoot":"","sources":["../../src/utils/nwsJurisdiction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAAyB,CAAC;AAEzE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAqC,CAAC;AAExF,wGAAwG;AACxG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * NWS alert-authority country codes (pure, no imports).
3
+ *
4
+ * Two consumers: the critical-alert banner (`resolveCriticalAlertBanner` in
5
+ * `src/handlers/criticalAlertBanner.ts`) and `get_alerts`'s country router
6
+ * (`src/handlers/alertsHandler.ts`, via `isNwsCountryCode`).
7
+ *
8
+ * **The banner applies `NWS_CODE_PLUS_BOX` together with `isInNwsTerritory`;
9
+ * `get_alerts` deliberately does not.** On 2026-11-11 NWS answered HTTP 200 at
10
+ * Pagan (18.12, 145.76) and the other northern Marianas, which lie outside the
11
+ * `isInNwsTerritory` box. A box-gated router would claim "not covered" where
12
+ * NOAA serves. The banner is a positive-assertion-only element that may omit
13
+ * itself; a router that claims coverage may not.
14
+ */
15
+ /**
16
+ * Country codes that settle NWS jurisdiction **on their own**, with no geography.
17
+ *
18
+ * Two sets, not one with a special case: a single set whose membership means
19
+ * different things for different members is how the next reader gets it wrong.
20
+ * The names state the rule.
21
+ *
22
+ * `'pr'` belongs **here and not in `NWS_CODE_PLUS_BOX`, and that is a correctness
23
+ * constraint rather than a style one.** Puerto Rico lives in `isInUS`, *not* in
24
+ * `isInNwsTerritory` — the new predicate covers only the four territories `isInUS`
25
+ * leaves out. Pairing `'pr'` with the territory box would therefore evaluate
26
+ * `false` and silently drop the banner for every Open-Meteo-geocoded Puerto Rico
27
+ * request, turning a coverage fix into a coverage regression. Tidying it across is
28
+ * the obvious wrong move; a mutation row in the plan pins it, and a relocation has
29
+ * the same red set as a deletion.
30
+ *
31
+ * `us` also stays code-alone because making it conditional on a box would silently
32
+ * narrow behaviour this change does not touch.
33
+ *
34
+ * **Which provider emits which value** (G48 — a fixture value the live resolver
35
+ * never produces proves nothing). `us` comes from Census (`CensusGovProvider`
36
+ * hard-codes `'US'`), from Nominatim (`NominatimProvider` upper-cases
37
+ * `address.country_code`; OSM resolves every US territory to `US` at country
38
+ * zoom, measured in issue #86 and again 2026-09-18), and from saved locations.
39
+ * The ISO territory codes `GU`/`MP`/`VI`/`AS`/`PR` come **only** from the
40
+ * Open-Meteo geocoder (`OpenMeteoProvider` passes `item.country_code` through),
41
+ * the last provider in every provider order `GeocodingService` builds, reached
42
+ * when the first two return nothing. So `pr` is reachable on that path and
43
+ * nowhere else.
44
+ *
45
+ * COFA codes (`fm`, `pw`, `mh`) are absent from both sets deliberately: sovereign
46
+ * countries, `/points` answers 500, out of scope until someone asks.
47
+ *
48
+ * Lower-cased, as `NIFC_COVERED_COUNTRIES` is (`wildfireHandler.ts`); these are
49
+ * not geography facts, which is why they live apart from `geography.ts`.
50
+ */
51
+ export const NWS_CODE_ALONE = new Set(['us', 'pr']);
52
+ /**
53
+ * Territory codes that require `isInNwsTerritory` **as well**, wherever the
54
+ * caller is the banner (see the module header: `get_alerts` does not apply it).
55
+ *
56
+ * A country code is a *fast path* — a resolved location already knows its country,
57
+ * so the common case costs no geography at all — and a fast path must not admit
58
+ * what the authoritative predicate rejects. `MP` is the one code in either set that
59
+ * spans served and unserved area: it names the whole Northern Marianas while NWS
60
+ * accepts only the southern arc, so `'MP'` deciding alone would re-open, through
61
+ * the Open-Meteo geocoder, exactly the northern-CNMI request the box was drawn to
62
+ * prevent — an uncached HTTP 400 and two `securityEvent` warns at the points the
63
+ * box exists to exclude.
64
+ */
65
+ export const NWS_CODE_PLUS_BOX = new Set(['gu', 'mp', 'vi', 'as']);
66
+ /** Lower-cased code → true when NWS is the alert authority for that country code, with no geography. */
67
+ export function isNwsCountryCode(code) {
68
+ return NWS_CODE_ALONE.has(code) || NWS_CODE_PLUS_BOX.has(code);
69
+ }
70
+ //# sourceMappingURL=nwsJurisdiction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nwsJurisdiction.js","sourceRoot":"","sources":["../../src/utils/nwsJurisdiction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEzE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAExF,wGAAwG;AACxG,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dangahagan/weather-mcp",
3
- "version": "1.35.13",
3
+ "version": "1.35.14",
4
4
  "description": "MCP server giving AI assistants 17 weather tools with zero API keys: global forecasts, current conditions, alerts, air quality, marine conditions, lightning detection, radar imagery, river levels, wildfire tracking, and historical weather back to 1940. Built entirely on free public APIs (NOAA, Open-Meteo, USGS, NIFC).",
5
5
  "mcpName": "io.github.dgahagan/weather-mcp",
6
6
  "main": "dist/index.js",