/** * Handler for get_river_conditions tool */ import { NOAAService } from '../services/noaa.js'; import { OpenMeteoService } from '../services/openmeteo.js'; import { LocationStore } from '../services/locationStore.js'; import { GeocodingService } from '../services/geocoding.js'; import { NominatimService } from '../services/nominatim.js'; import { EnvironmentAgencyService } from '../services/environmentAgency.js'; import type { GaugeStatus, StageFlowDataPoint } from '../types/noaa.js'; /** * True only for a real, present numeric reading (not null, not a missing-data sentinel). */ export declare function isRealValue(value: number | null | undefined): value is number; /** * A status block (observed or forecast) is worth displaying only if it carries at * least one real value AND a plausible timestamp. Otherwise NWPS is returning a * placeholder (-999 values, year-0001 time, "fcst_not_current"/"obs_not_current" * category) that should be suppressed rather than rendered raw. */ export declare function isUsableForecast(status: GaugeStatus): boolean; export interface StageTrend { direction: 'rising' | 'falling' | 'steady'; delta: number; windowHours: number; } /** * Derive a rise/fall trend from an observed stage series: latest real reading * vs. the earliest real reading inside the lookback window (or the nearest * predecessor when the series is sparse, labeled with the actual window). * Sentinel values (-999) and implausible timestamps are excluded per-point. * Returns undefined when fewer than two real points exist. */ export declare function computeStageTrend(points: StageFlowDataPoint[] | undefined, windowHours?: number): StageTrend | undefined; /** * Render a trend as an inline clause, e.g. "↘ falling (-0.4 ft / 6h)". * Steady trends omit the near-zero magnitude. */ export declare function formatStageTrend(trend: StageTrend): string; /** * Route a river request to gauge observations or to the global discharge model. * * `auto` sends US coordinates to NOAA's NWPS gauge network (unchanged), Great * Britain to the Environment Agency's real gauge network, and everywhere else * to the Open-Meteo Flood API. An explicit `source` forces the branch. There is * deliberately no cross-fallback: an observed river stage in feet against * official flood categories, an observed level in metres against a published * typical range, and a modeled discharge in m³/s against its own history are * three different claims, and silently swapping one for another would * misrepresent the data (design D1). * * **Why the GB arm is gated on a box before a country lookup.** Routing Great * Britain on a country code alone would fire a Nominatim reverse-geocode on * every `auto` river request on Earth outside the US boxes, against a 1 req/sec * server-wide limit, to answer `'gb'` for a fraction of a percent of them. * `isInGreatBritain` is the cheap pre-gate that decides whether the lookup is * worth making; the country code is what actually decides. The box routes and * never renders — no sentence below is derived from it (G53). * * **The EA arm requires a positively-resolved `'gb'`, never a negative test.** * With no country signal at all — no saved `country_code` and no Nominatim * service — `resolveCountryCode` returns `{ countryCode: null }`, which is not * `'gb'`, so `auto` falls to GloFAS. That is a required behaviour, not an * accident: 19 existing tests in `tests/unit/river-conditions-global.test.ts` * pass London on `auto` with no Nominatim fake wired and assert the Open-Meteo * path, and this condition is the single thing keeping all of them green. */ export declare function handleGetRiverConditions(args: unknown, noaaService: NOAAService, locationStore: LocationStore, geocodingService: GeocodingService, openMeteoService?: OpenMeteoService, nominatimService?: NominatimService, eaService?: EnvironmentAgencyService): Promise<{ content: Array<{ type: string; text: string; }>; }>; //# sourceMappingURL=riverConditionsHandler.d.ts.map