/** * @fileoverview Shared Zod output schemas, domain→output mappers, and * content[] renderers for the OurAirports tool surface. Centralizes the * airport / runway / frequency / navaid output shapes, the shared-code * resolution note, and the Markdown escaping of upstream text so * `get_airport`, the `airport://` resource, and the search/find tools render * the same fields the same way. * * Sparsity is first-class: absent upstream fields map to `null` (codes, * elevation) so "this airport has no IATA" is explicit signal, never fabricated. * @module src/mcp-server/tools/definitions/_schemas */ import { z } from '@cyanheads/mcp-ts-core'; import type { Airport, CodeResolution, Frequency, Navaid, Runway } from '../../../services/airport-data/types.js'; /** Literal empty optional facets are unset; whitespace-only values remain invalid. */ export declare const CountryCodeSchema: z.ZodOptional, z.ZodString]>>; /** Accept the source region shape without assuming its country association. */ export declare const RegionCodeSchema: z.ZodOptional, z.ZodString]>>; /** Nullable code set echoed on every airport record (drives "no IATA" signal). */ export declare const AirportSummarySchema: z.ZodObject<{ id: z.ZodNumber; ident: z.ZodString; type: z.ZodString; name: z.ZodString; latitudeDeg: z.ZodNumber; longitudeDeg: z.ZodNumber; elevationFt: z.ZodNullable; continent: z.ZodNullable; isoCountry: z.ZodNullable; countryName: z.ZodNullable; isoRegion: z.ZodNullable; regionName: z.ZodNullable; municipality: z.ZodNullable; scheduledService: z.ZodBoolean; icaoCode: z.ZodNullable; iataCode: z.ZodNullable; gpsCode: z.ZodNullable; localCode: z.ZodNullable; }, z.core.$strip>; export declare const RunwaySchema: z.ZodObject<{ id: z.ZodNumber; lengthFt: z.ZodNullable; widthFt: z.ZodNullable; surface: z.ZodNullable; lighted: z.ZodBoolean; closed: z.ZodBoolean; leIdent: z.ZodNullable; leHeadingDegT: z.ZodNullable; leDisplacedThresholdFt: z.ZodNullable; heIdent: z.ZodNullable; heHeadingDegT: z.ZodNullable; heDisplacedThresholdFt: z.ZodNullable; }, z.core.$strip>; export declare const FrequencySchema: z.ZodObject<{ id: z.ZodNumber; type: z.ZodString; description: z.ZodNullable; frequencyMhz: z.ZodNullable; }, z.core.$strip>; export declare const NavaidSchema: z.ZodObject<{ id: z.ZodNumber; ident: z.ZodString; name: z.ZodString; type: z.ZodString; frequencyKhz: z.ZodNullable; frequencyMhz: z.ZodNullable; latitudeDeg: z.ZodNumber; longitudeDeg: z.ZodNumber; elevationFt: z.ZodNullable; isoCountry: z.ZodNullable; dmeChannel: z.ZodNullable; dmeFrequencyKhz: z.ZodNullable; usageType: z.ZodNullable; power: z.ZodNullable; magneticVariationDeg: z.ZodNullable; slavedVariationDeg: z.ZodNullable; associatedAirport: z.ZodNullable; }, z.core.$strip>; /** Map a domain Airport to the summary output shape, resolving country/region names. */ export declare function toAirportSummary(a: Airport, countryName: string | undefined, regionName: string | undefined): z.infer; export declare function toRunway(r: Runway): z.infer; export declare function toFrequency(f: Frequency): z.infer; export declare function toNavaid(n: Navaid): z.infer; /** * Escape upstream text for interpolation into content[] Markdown, so it renders * as the literal value. `structuredContent` always carries the raw value — call * this at the render boundary only. * * Escapes only what can open or close a construct where the value lands: * `\`, backtick, `*`, `~`; `_` unless between two letters/digits; `<` before a * letter, `/`, `!`, or `?`, or ending the value (template text follows it); * `]` before `(` or `[`; `&` (as `&`) starting an * entity reference; the first `#` of a trailing `#` run. CR/LF fold to a space. * Everything else passes through, so ordinary names (`AT&T`, `snake_case`, * `Sahabat [Sahabat 16] Airport`) stay byte-identical. * * `position: 'line-start'` is for a value that opens a line or list-item * content, where a leading `-`, `+`, `>`, `#`, `1.`, or `[x]` would start a * block; it additionally escapes that marker. One pass, linear in the length. * * Known limit: GFM treats a bare `www.`/`http://` URL as an autolink and ignores * escapes inside it, so an escaped character in such a URL shows its backslash. */ export declare function escapeMarkdown(value: string, position?: 'inline' | 'line-start'): string; /** Render a number, or a dash when null — keeps every field present for format-parity. */ export declare const numOrDash: (v: number | null) => string; /** Render upstream text escaped for Markdown, or a dash when null. */ export declare const textOrDash: (v: string | null) => string; /** * Shared markdown renderer for an airport summary block. Renders EVERY field of * AirportSummarySchema (format-parity is lint-enforced — each output field must * appear in the rendered text), showing a dash for absent values. Coordinates * render as the exact `structuredContent` numbers. */ export declare function renderAirportLines(a: z.infer): string[]; type RunwayOutput = z.infer; /** The runway's end designators (`16L/34R`), escaped, or `unnamed`. */ export declare function renderRunwayName(r: RunwayOutput): string; /** `(id …) — length … × width … | surface … | lighted … | closed …` for one runway. */ export declare function renderRunwaySpec(r: RunwayOutput): string; /** Per-end headings and displaced thresholds, each next to its end designator. */ export declare function renderRunwayEnds(r: RunwayOutput): string; type NavaidOutput = z.infer; /** * `116800 kHz (paired VHF 116.8 MHz)` for DME/TACAN/VORTAC, `115300 kHz (115.3 MHz)` * for VOR/VOR-DME, `414 kHz` for NDB/NDB-DME (no MHz figure), `—` when unknown. */ export declare function renderNavaidFrequency(n: NavaidOutput): string; /** * The human-readable note on how `code` resolved — shared by * ourairports_get_airport, the airport://{code} resource, and * ourairports_find_navaids airport mode. A code on one airport reads * `Resolved via .`; a shared code also names every other airport * carrying it (ident, country, code spaces), says whether resolution priority * or dataset row order (a tie within the matched space) picked this one, and * points at the other airport's ident — every ident resolves to itself. */ export declare function buildResolutionNote(code: string, resolution: CodeResolution): string; export {}; //# sourceMappingURL=_schemas.d.ts.map