Skip to content

core/src

Mostlyright TypeScript SDK


Mostlyright TypeScript SDK / core/src

Defined in: packages-ts/core/src/exceptions/index.ts:723

Base HTTP-layer marker. Subclass of MostlyRightError so callers that catch MostlyRightError also catch transport errors.

new AuthenticationError(message, options): AuthenticationError

Defined in: packages-ts/core/src/exceptions/index.ts:726

string = "Authentication required"

TherminalErrorOptions = {}

AuthenticationError

TherminalError.constructor

static defaultErrorCode: string = "HTTP_UNAUTHORIZED"

Defined in: packages-ts/core/src/exceptions/index.ts:724

Subclass override — the stable string enum surfaced via errorCode.

TherminalError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

TherminalError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

TherminalError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

TherminalError.source

readonly statusCode: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:669

TherminalError.statusCode

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

TherminalError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:233

Base class for all mostlyright structured errors.

errorCode is a stable enum (e.g. “SOURCE_UNAVAILABLE”) used by callers / agents to branch on without parsing message text. source is the source id involved (e.g. “iem.archive”) when applicable, and requestId correlates a JSON-RPC / MCP request id when applicable.

new DataAvailabilityError(options): DataAvailabilityError

Defined in: packages-ts/core/src/exceptions/index.ts:239

DataAvailabilityErrorOptions

DataAvailabilityError

MostlyRightError.constructor

static defaultErrorCode: string = "DATA_AVAILABILITY"

Defined in: packages-ts/core/src/exceptions/index.ts:234

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly hint: string

Defined in: packages-ts/core/src/exceptions/index.ts:237

readonly reason: "model_unavailable" | "out_of_window" | "cache_miss" | "source_404" | "source_5xx" | "rate_limited"

Defined in: packages-ts/core/src/exceptions/index.ts:236

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:641

Base class for all mostlyright structured errors.

errorCode is a stable enum (e.g. “SOURCE_UNAVAILABLE”) used by callers / agents to branch on without parsing message text. source is the source id involved (e.g. “iem.archive”) when applicable, and requestId correlates a JSON-RPC / MCP request id when applicable.

new DeferredMarketError(message, options): DeferredMarketError

Defined in: packages-ts/core/src/exceptions/index.ts:130

string = ""

MostlyRightErrorOptions = {}

DeferredMarketError

MostlyRightError.constructor

static defaultErrorCode: string = "DEFERRED_MARKET"

Defined in: packages-ts/core/src/exceptions/index.ts:642

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:731

Base HTTP-layer marker. Subclass of MostlyRightError so callers that catch MostlyRightError also catch transport errors.

new ForbiddenError(message, options): ForbiddenError

Defined in: packages-ts/core/src/exceptions/index.ts:734

string = "Access denied"

TherminalErrorOptions = {}

ForbiddenError

TherminalError.constructor

static defaultErrorCode: string = "HTTP_FORBIDDEN"

Defined in: packages-ts/core/src/exceptions/index.ts:732

Subclass override — the stable string enum surfaced via errorCode.

TherminalError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

TherminalError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

TherminalError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

TherminalError.source

readonly statusCode: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:669

TherminalError.statusCode

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

TherminalError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:492

A forecast row would land with issuedAt = null.

Phase 20 OM-04. Origin: Tarabcak/mostlyright#70 — the legacy seamless-feed bug where /forecast_series proxied Open-Meteo’s seamless endpoint without preserving issued_at, silently using post-snapshot model runs in training data.

new IssuedAtMissingError(message, options): IssuedAtMissingError

Defined in: packages-ts/core/src/exceptions/index.ts:497

string

IssuedAtMissingErrorOptions = {}

IssuedAtMissingError

SchemaValidationError.constructor

static defaultErrorCode: string = "ISSUED_AT_MISSING"

Defined in: packages-ts/core/src/exceptions/index.ts:493

Subclass override — the stable string enum surfaced via errorCode.

SchemaValidationError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

SchemaValidationError.errorCode

readonly quarantineCount: number

Defined in: packages-ts/core/src/exceptions/index.ts:372

SchemaValidationError.quarantineCount

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

SchemaValidationError.requestId

readonly sampleViolations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:373

SchemaValidationError.sampleViolations

readonly schemaId: string

Defined in: packages-ts/core/src/exceptions/index.ts:370

SchemaValidationError.schemaId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

SchemaValidationError.source

readonly violatingCountRows: number

Defined in: packages-ts/core/src/exceptions/index.ts:495

readonly violations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:371

SchemaValidationError.violations

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

SchemaValidationError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:451

Base class for all mostlyright structured errors.

errorCode is a stable enum (e.g. “SOURCE_UNAVAILABLE”) used by callers / agents to branch on without parsing message text. source is the source id involved (e.g. “iem.archive”) when applicable, and requestId correlates a JSON-RPC / MCP request id when applicable.

new LeakageError(message, options): LeakageError

Defined in: packages-ts/core/src/exceptions/index.ts:458

string

LeakageErrorOptions

LeakageError

MostlyRightError.constructor

readonly asOf: string

Defined in: packages-ts/core/src/exceptions/index.ts:454

static defaultErrorCode: string = "LEAKAGE_DETECTED"

Defined in: packages-ts/core/src/exceptions/index.ts:452

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly sampleViolations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:456

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

readonly violatingCount: number

Defined in: packages-ts/core/src/exceptions/index.ts:455

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:759

Base class for mostlyright.live.stream / live.latest failures.

Mirrors Python LiveStreamError. Live-streaming errors are a separate sub-tree from SourceUnavailableError because the recovery path differs — stream() swallows empty-tick errors and waits for the next polite-floor cycle. Only latest() raises NoLiveDataError on empty responses.

new LiveStreamError(message, options): LiveStreamError

Defined in: packages-ts/core/src/exceptions/index.ts:130

string = ""

MostlyRightErrorOptions = {}

LiveStreamError

MostlyRightError.constructor

static defaultErrorCode: string = "LIVE_STREAM_ERROR"

Defined in: packages-ts/core/src/exceptions/index.ts:760

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:122

Base class for all mostlyright structured errors.

errorCode is a stable enum (e.g. “SOURCE_UNAVAILABLE”) used by callers / agents to branch on without parsing message text. source is the source id involved (e.g. “iem.archive”) when applicable, and requestId correlates a JSON-RPC / MCP request id when applicable.

  • Error

new MostlyRightError(message, options): MostlyRightError

Defined in: packages-ts/core/src/exceptions/index.ts:130

string = ""

MostlyRightErrorOptions = {}

MostlyRightError

Error.constructor

static defaultErrorCode: string = "MOSTLYRIGHT_ERROR"

Defined in: packages-ts/core/src/exceptions/index.ts:124

Subclass override — the stable string enum surfaced via errorCode.

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>


Defined in: packages-ts/core/src/exceptions/index.ts:775

mostlyright.live.latest returned no observations for the station.

Carries the resolved ICAO station and the canonical source identity tag ("awc.live" / "iem.live") so caller logs can branch by source without re-parsing the message.

new NoLiveDataError(message, options): NoLiveDataError

Defined in: packages-ts/core/src/exceptions/index.ts:780

string

NoLiveDataErrorOptions

NoLiveDataError

LiveStreamError.constructor

static defaultErrorCode: string = "NO_LIVE_DATA"

Defined in: packages-ts/core/src/exceptions/index.ts:776

Subclass override — the stable string enum surfaced via errorCode.

LiveStreamError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

LiveStreamError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

LiveStreamError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

LiveStreamError.source

readonly station: string

Defined in: packages-ts/core/src/exceptions/index.ts:778

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

LiveStreamError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:684

Base HTTP-layer marker. Subclass of MostlyRightError so callers that catch MostlyRightError also catch transport errors.

new NotFoundError(message, options): NotFoundError

Defined in: packages-ts/core/src/exceptions/index.ts:687

string = "Resource not found"

TherminalErrorOptions = {}

NotFoundError

TherminalError.constructor

static defaultErrorCode: string = "HTTP_NOT_FOUND"

Defined in: packages-ts/core/src/exceptions/index.ts:685

Subclass override — the stable string enum surfaced via errorCode.

TherminalError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

TherminalError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

TherminalError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

TherminalError.source

readonly statusCode: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:669

TherminalError.statusCode

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

TherminalError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:324

Raised when the TS forecastNwp() stub is called.

Why this exists: no production-ready browser GRIB2 decoder ships in v1.x (eccodes / cfgrib are C/Python only; WASM compile-time + bundle size make a browser port impractical today). The function signature is stable so callers can write code today; v2.0+ lands the execution body.

Recommended catch pattern:

import { forecastNwp } from '@mostlyrightmd/weather';
import { NwpNotAvailableError } from '@mostlyrightmd/core';
try {
const grid = await forecastNwp('KNYC', 'gfs');
} catch (e) {
if (e instanceof NwpNotAvailableError) {
console.warn(`NWP deferred to v2.0+; ${e.hint}`);
// Fall back to iemMosForecasts() when available, else Python SDK.
} else {
throw e;
}
}

See docs/nwp-forecasts.md for the full architectural rationale and the v2.0+ roadmap.

new NwpNotAvailableError(options): NwpNotAvailableError

Defined in: packages-ts/core/src/exceptions/index.ts:330

NwpNotAvailableErrorOptions

NwpNotAvailableError

DataAvailabilityError.constructor

static defaultErrorCode: string = "NWP_NOT_AVAILABLE"

Defined in: packages-ts/core/src/exceptions/index.ts:325

Subclass override — the stable string enum surfaced via errorCode.

DataAvailabilityError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

DataAvailabilityError.errorCode

readonly hint: string

Defined in: packages-ts/core/src/exceptions/index.ts:237

DataAvailabilityError.hint

readonly model: string

Defined in: packages-ts/core/src/exceptions/index.ts:328

readonly reason: "model_unavailable" | "out_of_window" | "cache_miss" | "source_404" | "source_5xx" | "rate_limited"

Defined in: packages-ts/core/src/exceptions/index.ts:236

DataAvailabilityError.reason

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

DataAvailabilityError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

DataAvailabilityError.source

readonly station: string

Defined in: packages-ts/core/src/exceptions/index.ts:327

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

DataAvailabilityError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:538

The Open-Meteo Historical Forecast (seamless) endpoint was used without allowLeakage: true.

Phase 20 D-01 (locked decision): the seamless endpoint silently stitches forecasts from multiple model cycles into a continuous timeseries; the cycle that produced each value is unrecoverable from the response. LeakageDetector rejects rows tagged source="open_meteo.seamless" whenever as_of is asserted.

Origin: Tarabcak/mostlyright#70.

new OpenMeteoSeamlessLeakageError(message, options): OpenMeteoSeamlessLeakageError

Defined in: packages-ts/core/src/exceptions/index.ts:544

string

OpenMeteoSeamlessLeakageErrorOptions

OpenMeteoSeamlessLeakageError

LeakageError.constructor

readonly asOf: string

Defined in: packages-ts/core/src/exceptions/index.ts:454

LeakageError.asOf

static defaultErrorCode: string = "OPEN_METEO_SEAMLESS_LEAKAGE"

Defined in: packages-ts/core/src/exceptions/index.ts:539

Subclass override — the stable string enum surfaced via errorCode.

LeakageError.defaultErrorCode

readonly endpointUrl: string

Defined in: packages-ts/core/src/exceptions/index.ts:542

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

LeakageError.errorCode

readonly model: string

Defined in: packages-ts/core/src/exceptions/index.ts:541

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

LeakageError.requestId

readonly sampleViolations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:456

LeakageError.sampleViolations

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

LeakageError.source

readonly violatingCount: number

Defined in: packages-ts/core/src/exceptions/index.ts:455

LeakageError.violatingCount

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

LeakageError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:613

Base class for all mostlyright structured errors.

errorCode is a stable enum (e.g. “SOURCE_UNAVAILABLE”) used by callers / agents to branch on without parsing message text. source is the source id involved (e.g. “iem.archive”) when applicable, and requestId correlates a JSON-RPC / MCP request id when applicable.

new PayloadTooLargeError(message, options): PayloadTooLargeError

Defined in: packages-ts/core/src/exceptions/index.ts:620

string

PayloadTooLargeErrorOptions

PayloadTooLargeError

MostlyRightError.constructor

readonly acceptedModes: string[]

Defined in: packages-ts/core/src/exceptions/index.ts:618

readonly declaredSize: number

Defined in: packages-ts/core/src/exceptions/index.ts:616

static defaultErrorCode: string = "PAYLOAD_TOO_LARGE"

Defined in: packages-ts/core/src/exceptions/index.ts:614

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly limit: number

Defined in: packages-ts/core/src/exceptions/index.ts:617

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:649

Base class for all mostlyright structured errors.

errorCode is a stable enum (e.g. “SOURCE_UNAVAILABLE”) used by callers / agents to branch on without parsing message text. source is the source id involved (e.g. “iem.archive”) when applicable, and requestId correlates a JSON-RPC / MCP request id when applicable.

new PolymarketEventError(message, options): PolymarketEventError

Defined in: packages-ts/core/src/exceptions/index.ts:130

string = ""

MostlyRightErrorOptions = {}

PolymarketEventError

MostlyRightError.constructor

static defaultErrorCode: string = "POLYMARKET_EVENT_INVALID"

Defined in: packages-ts/core/src/exceptions/index.ts:650

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:696

Base HTTP-layer marker. Subclass of MostlyRightError so callers that catch MostlyRightError also catch transport errors.

new RateLimitError(retryAfter, options): RateLimitError

Defined in: packages-ts/core/src/exceptions/index.ts:701

null | number

RateLimitErrorOptions = {}

RateLimitError

TherminalError.constructor

static defaultErrorCode: string = "HTTP_RATE_LIMITED"

Defined in: packages-ts/core/src/exceptions/index.ts:697

Subclass override — the stable string enum surfaced via errorCode.

TherminalError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

TherminalError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

TherminalError.requestId

readonly retryAfter: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:699

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

TherminalError.source

readonly statusCode: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:669

TherminalError.statusCode

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

TherminalError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:367

Base class for all mostlyright structured errors.

errorCode is a stable enum (e.g. “SOURCE_UNAVAILABLE”) used by callers / agents to branch on without parsing message text. source is the source id involved (e.g. “iem.archive”) when applicable, and requestId correlates a JSON-RPC / MCP request id when applicable.

new SchemaValidationError(message, options): SchemaValidationError

Defined in: packages-ts/core/src/exceptions/index.ts:375

string

SchemaValidationErrorOptions

SchemaValidationError

MostlyRightError.constructor

static defaultErrorCode: string = "SCHEMA_VALIDATION_FAILED"

Defined in: packages-ts/core/src/exceptions/index.ts:368

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly quarantineCount: number

Defined in: packages-ts/core/src/exceptions/index.ts:372

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly sampleViolations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:373

readonly schemaId: string

Defined in: packages-ts/core/src/exceptions/index.ts:370

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

readonly violations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:371

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:739

Base HTTP-layer marker. Subclass of MostlyRightError so callers that catch MostlyRightError also catch transport errors.

new ServerError(message, options): ServerError

Defined in: packages-ts/core/src/exceptions/index.ts:742

string = "Server error"

TherminalErrorOptions = {}

ServerError

TherminalError.constructor

static defaultErrorCode: string = "HTTP_SERVER_ERROR"

Defined in: packages-ts/core/src/exceptions/index.ts:740

Subclass override — the stable string enum surfaced via errorCode.

TherminalError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

TherminalError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

TherminalError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

TherminalError.source

readonly statusCode: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:669

TherminalError.statusCode

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

TherminalError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:407

Base class for all mostlyright structured errors.

errorCode is a stable enum (e.g. “SOURCE_UNAVAILABLE”) used by callers / agents to branch on without parsing message text. source is the source id involved (e.g. “iem.archive”) when applicable, and requestId correlates a JSON-RPC / MCP request id when applicable.

new SourceMismatchError(message, options): SourceMismatchError

Defined in: packages-ts/core/src/exceptions/index.ts:422

string

SourceMismatchErrorOptions

SourceMismatchError

MostlyRightError.constructor

readonly catalogWarning: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:420

readonly dataSource: string

Defined in: packages-ts/core/src/exceptions/index.ts:418

static defaultErrorCode: string = "SOURCE_MISMATCH"

Defined in: packages-ts/core/src/exceptions/index.ts:408

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly role: null | SourceMismatchRole

Defined in: packages-ts/core/src/exceptions/index.ts:419

readonly schemaSource: string

Defined in: packages-ts/core/src/exceptions/index.ts:417

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

readonly static VALID_ROLES: ReadonlySet<SourceMismatchRole>

Defined in: packages-ts/core/src/exceptions/index.ts:411

Canonical role-name vocabulary (design.md §R).

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:175

Base class for all mostlyright structured errors.

errorCode is a stable enum (e.g. “SOURCE_UNAVAILABLE”) used by callers / agents to branch on without parsing message text. source is the source id involved (e.g. “iem.archive”) when applicable, and requestId correlates a JSON-RPC / MCP request id when applicable.

new SourceUnavailableError(message, options): SourceUnavailableError

Defined in: packages-ts/core/src/exceptions/index.ts:184

string = ""

SourceUnavailableErrorOptions = {}

SourceUnavailableError

MostlyRightError.constructor

static defaultErrorCode: string = "SOURCE_UNAVAILABLE"

Defined in: packages-ts/core/src/exceptions/index.ts:176

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly httpStatus: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:178

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly retryable: boolean

Defined in: packages-ts/core/src/exceptions/index.ts:179

readonly retryAfterS: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:180

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

readonly underlying: string

Defined in: packages-ts/core/src/exceptions/index.ts:181

readonly url: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:182

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/stations/index.ts:33

Read-only view over the station registry with venue/country filters.

Lookups accept either the registry code (3-letter NWS code for US stations, ICAO for international) or the 4-letter ICAO directly, so get("NYC"), get("KNYC"), and get("EGLL") all resolve.

new StationCatalog(stations): StationCatalog

Defined in: packages-ts/core/src/stations/index.ts:38

readonly StationInfo[] = STATIONS

StationCatalog

get size(): number

Defined in: packages-ts/core/src/stations/index.ts:98

number

[iterator](): Iterator<StationInfo>

Defined in: packages-ts/core/src/stations/index.ts:102

Iterator<StationInfo>

filterByCountry(country): StationInfo[]

Defined in: packages-ts/core/src/stations/index.ts:78

Stations whose ISO 3166-1 alpha-2 country matches, sorted by ICAO.

string

StationInfo[]

filterByVenue(venue): StationInfo[]

Defined in: packages-ts/core/src/stations/index.ts:71

Stations tagged with venue (e.g. “kalshi”), sorted by ICAO.

string

StationInfo[]

get(code): StationInfo

Defined in: packages-ts/core/src/stations/index.ts:60

Return the station for code (registry code or ICAO).

string

StationInfo

if no station matches.

has(code): boolean

Defined in: packages-ts/core/src/stations/index.ts:94

True iff code resolves to a station (by registry code or ICAO).

string

boolean

venues(): ReadonlySet<string>

Defined in: packages-ts/core/src/stations/index.ts:85

Union of all venue tags present in the catalog.

ReadonlySet<string>


Defined in: packages-ts/core/src/exceptions/index.ts:576

Base class for all mostlyright structured errors.

errorCode is a stable enum (e.g. “SOURCE_UNAVAILABLE”) used by callers / agents to branch on without parsing message text. source is the source id involved (e.g. “iem.archive”) when applicable, and requestId correlates a JSON-RPC / MCP request id when applicable.

new TemporalDriftError(message, options): TemporalDriftError

Defined in: packages-ts/core/src/exceptions/index.ts:584

string

TemporalDriftErrorOptions

TemporalDriftError

MostlyRightError.constructor

readonly assertedRange: [string, string]

Defined in: packages-ts/core/src/exceptions/index.ts:580

static defaultErrorCode: string = "TEMPORAL_DRIFT"

Defined in: packages-ts/core/src/exceptions/index.ts:577

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly sampleViolations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:582

readonly schemaId: string

Defined in: packages-ts/core/src/exceptions/index.ts:579

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

readonly violatingRows: number

Defined in: packages-ts/core/src/exceptions/index.ts:581

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:666

Base HTTP-layer marker. Subclass of MostlyRightError so callers that catch MostlyRightError also catch transport errors.

new TherminalError(message, options): TherminalError

Defined in: packages-ts/core/src/exceptions/index.ts:671

string

TherminalErrorOptions = {}

TherminalError

MostlyRightError.constructor

static defaultErrorCode: string = "HTTP_ERROR"

Defined in: packages-ts/core/src/exceptions/index.ts:667

Subclass override — the stable string enum surfaced via errorCode.

MostlyRightError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

MostlyRightError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

MostlyRightError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

MostlyRightError.source

readonly statusCode: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:669

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

MostlyRightError.toDict


Defined in: packages-ts/core/src/exceptions/index.ts:715

Base HTTP-layer marker. Subclass of MostlyRightError so callers that catch MostlyRightError also catch transport errors.

new ValidationError(message, options): ValidationError

Defined in: packages-ts/core/src/exceptions/index.ts:718

string = "Invalid request"

TherminalErrorOptions = {}

ValidationError

TherminalError.constructor

static defaultErrorCode: string = "HTTP_BAD_REQUEST"

Defined in: packages-ts/core/src/exceptions/index.ts:716

Subclass override — the stable string enum surfaced via errorCode.

TherminalError.defaultErrorCode

readonly errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:126

TherminalError.errorCode

readonly requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:128

TherminalError.requestId

readonly source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:127

TherminalError.source

readonly statusCode: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:669

TherminalError.statusCode

toDict(): Record<string, unknown>

Defined in: packages-ts/core/src/exceptions/index.ts:157

Return a JSON-safe dict suitable for MCP error.data.

Record<string, unknown>

TherminalError.toDict

Defined in: packages-ts/core/src/exceptions/index.ts:228

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

hint: string

Defined in: packages-ts/core/src/exceptions/index.ts:230

reason: "model_unavailable" | "out_of_window" | "cache_miss" | "source_404" | "source_5xx" | "rate_limited"

Defined in: packages-ts/core/src/exceptions/index.ts:229

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source


Defined in: packages-ts/core/src/internal/http.ts:38

optional baseDelayMs: number

Defined in: packages-ts/core/src/internal/http.ts:40

Base backoff delay in milliseconds (default 1000).

optional body: null | BodyInit

Defined in: packages-ts/core/src/internal/http.ts:56

Optional request body (forwarded to fetch).

optional headers: Record<string, string>

Defined in: packages-ts/core/src/internal/http.ts:50

Request headers.

optional maxRetries: number

Defined in: packages-ts/core/src/internal/http.ts:42

Total attempts (default 3).

optional method: string

Defined in: packages-ts/core/src/internal/http.ts:54

HTTP method (default GET).

optional retryStatuses: ReadonlySet<number>

Defined in: packages-ts/core/src/internal/http.ts:46

Statuses that trigger a retry. Default {429, 500, 502, 503, 504}.

optional signal: AbortSignal

Defined in: packages-ts/core/src/internal/http.ts:48

Caller-supplied abort signal (composed with per-attempt timeout).

optional timeoutMs: number

Defined in: packages-ts/core/src/internal/http.ts:44

Per-attempt timeout in milliseconds (default 60_000).

optional userAgent: string

Defined in: packages-ts/core/src/internal/http.ts:52

Convenience: set the User-Agent header.


Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:5

optional apparent_temp_c: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:9

units: celsius

optional cape_jkg: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:13

units: J/kg

optional cloud_cover_pct: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:17

units: percent

optional dew_point_c: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:21

units: celsius

optional direct_radiation_wm2: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:25

units: W/m^2

forecast_hour: number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:29

units: hours — (valid_at - issued_at).total_seconds() / 3600

optional freezing_level_m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:33

units: meters

optional issued_at: null | string

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:37

model run time (knowledge_time). Nullable to accommodate Phase 20 open_meteo.seamless rows whose cycle is unrecoverable from the response. LeakageDetector + assert_issued_at_populated() are the runtime gates that reject null issued_at in training-data paths.

model: string

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:41

e.g. NBE, GFS, LAV, MET, gfs_global, ecmwf_ifs025

optional precip_probability: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:45

units: probability — bounded [0, 1]

optional precipitation_mm: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:49

units: mm

optional pressure_msl_hpa: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:53

units: hPa

retrieved_at: string

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:57

wall-clock time the row was fetched from upstream

optional shortwave_radiation_wm2: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:61

units: W/m^2

optional sky_cover_pct: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:65

units: percent — bounded [0, 100]

optional snow_depth_m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:69

units: meters

source: string

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:73

iem.archive | open_meteo.previous_runs | open_meteo.single_run | open_meteo.live

station: string

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:74

optional surface_pressure_hpa: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:78

units: hPa

optional temp_c: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:82

units: celsius

valid_at: string

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:86

forecast target time (event_time)

optional visibility_m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:90

units: meters

optional weather_code: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:94

units: WMO 4677 — WMO weather code (clear, fog, rain, snow, etc.)

optional wind_dir_deg: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:98

units: degrees

optional wind_gusts_ms: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:102

units: m/s

optional wind_speed_ms: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.iem_mos.v1.ts:106

units: m/s


Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:5

optional cloud_ceiling_m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:9

units: m

optional cloud_cover_pct: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:13

units: percent

optional dewpoint_k_2m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:17

units: K

forecast_hour: number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:21

units: hours — lead time in hours (alias: fxx)

grid_dist_km: number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:25

units: km — great-circle distance from station to nearest grid cell

grid_kind: string

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:29

grid-projection label (lambert_conformal_conus, regular_latlon_global_0p25, …)

issued_at: string

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:33

model run / cycle reference time

mirror: "aws_bdp" | "azure_bdp" | "ecmwf_aws" | "ecmwf_azure" | "ecmwf_data_portal" | "ecmwf_gcp" | "gcp_bdp" | "msc" | "nomads"

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:37

NOAA BDP mirror that served the underlying bytes

model: "cfs" | "ecmwf_aifs_ens" | "ecmwf_aifs_single" | "ecmwf_ifs_ens" | "ecmwf_ifs_hres" | "gdas" | "gdps" | "gefs" | "geps" | "gfs" | "hafs" | "hiresw" | "hrdps" | "href" | "hrrr" | "hrrrak" | "nam" | "nbm" | "rap" | "rdps" | "reps" | "rrfs" | "rtma" | "urma"

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:47

optional precip_mm_1h: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:75

units: mm

optional pressure_pa_mslp: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:79

units: Pa

optional pressure_pa_surface: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:83

units: Pa

qc_status: "clean" | "flagged" | "suspect"

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:87

inline physics-bounds verdict; finer-grained QC lands in Phase 3.4

optional relative_humidity_pct_2m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:91

units: percent

retrieved_at: string

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:95

wall-clock UTC when the bytes were fetched

station: string

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:96

optional temp_k_2m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:100

units: K

valid_at: string

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:104

forecast target time = issued_at + forecast_hour

optional visibility_m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:108

units: m

optional wind_gust_ms: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:112

units: m/s

optional wind_u_ms_10m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:116

units: m/s

optional wind_v_ms_10m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast_nwp.v1.ts:120

units: m/s


Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:5

optional apparent_temp_c: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:9

units: celsius

optional cape_jkg: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:13

units: J/kg

optional cloud_cover_pct: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:17

units: percent

optional dew_point_c: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:21

units: celsius

optional direct_radiation_wm2: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:25

units: W/m^2

forecast_hour: number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:29

units: hours — (valid_at - issued_at).total_seconds() / 3600

optional freezing_level_m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:33

units: meters

optional issued_at: null | string

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:37

model run time (knowledge_time). Nullable to accommodate Phase 20 open_meteo.seamless rows whose cycle is unrecoverable from the response. LeakageDetector + assert_issued_at_populated() are the runtime gates that reject null issued_at in training-data paths.

model: string

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:41

e.g. NBE, GFS, LAV, MET, gfs_global, ecmwf_ifs025

optional precip_probability: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:45

units: probability — bounded [0, 1]

optional precipitation_mm: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:49

units: mm

optional pressure_msl_hpa: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:53

units: hPa

retrieved_at: string

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:57

wall-clock time the row was fetched from upstream

optional shortwave_radiation_wm2: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:61

units: W/m^2

optional sky_cover_pct: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:65

units: percent — bounded [0, 100]

optional snow_depth_m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:69

units: meters

source: string

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:73

iem.archive | open_meteo.previous_runs | open_meteo.single_run | open_meteo.live

station: string

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:74

optional surface_pressure_hpa: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:78

units: hPa

optional temp_c: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:82

units: celsius

valid_at: string

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:86

forecast target time (event_time)

optional visibility_m: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:90

units: meters

optional weather_code: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:94

units: WMO 4677 — WMO weather code (clear, fog, rain, snow, etc.)

optional wind_dir_deg: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:98

units: degrees

optional wind_gusts_ms: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:102

units: m/s

optional wind_speed_ms: null | number

Defined in: packages-ts/core/src/schemas/generated/forecast.station.v1.ts:106

units: m/s


Defined in: packages-ts/core/src/exceptions/index.ts:479

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional sampleViolations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:481

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source

optional violatingCount: number

Defined in: packages-ts/core/src/exceptions/index.ts:480


Defined in: packages-ts/core/src/exceptions/index.ts:445

asOf: string

Defined in: packages-ts/core/src/exceptions/index.ts:446

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional sampleViolations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:448

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source

violatingCount: number

Defined in: packages-ts/core/src/exceptions/index.ts:447


Defined in: packages-ts/core/src/exceptions/index.ts:108

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110


Defined in: packages-ts/core/src/exceptions/index.ts:763

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

source: string

Defined in: packages-ts/core/src/exceptions/index.ts:765

MostlyRightErrorOptions.source

station: string

Defined in: packages-ts/core/src/exceptions/index.ts:764


Defined in: packages-ts/core/src/exceptions/index.ts:286

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

hint: string

Defined in: packages-ts/core/src/exceptions/index.ts:292

Operator-actionable hint. Required (matches DataAvailabilityError contract).

model: string

Defined in: packages-ts/core/src/exceptions/index.ts:290

NWP model the caller asked for (e.g. "gfs", "hrrr").

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source

station: string

Defined in: packages-ts/core/src/exceptions/index.ts:288

Station the caller asked for (echoed back for log/error attribution).


Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:5

optional as_of_time: null | string

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:6

optional dewpoint_c: null | number

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:10

units: celsius

optional ingestion_id: null | string

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:11

optional observation_kind: null | "METAR" | "SPECI"

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:12

optional observation_quality: null | "clean" | "flagged" | "suspect"

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:16

Lineage row-quality flag per LINEAGE-01; distinct from qc_status enum slot AND distinct from the obs_qc_status bitmask column per QC-05.

observation_type: "METAR" | "SPECI"

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:17

observed_at: string

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:18

optional parser_name: null | "ghcnh" | "iem" | "mostlyright_v1" | "ncei"

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:19

optional parser_version: null | string

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:20

optional provenance: null | "legacy" | "reingested"

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:21

optional qc_status: null | "clean" | "flagged" | "suspect"

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:22

source: "ghcnh" | "iem" | "ncei" | "awc"

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:26

ncei reserved per D-2.1-09; never written in v0.1.0.

optional source_received_at: null | string

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:27

station_code: string

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:28

optional temp_c: null | number

Defined in: packages-ts/core/src/schemas/generated/observation_ledger.v1.ts:32

units: celsius


Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:5

optional as_of_time: null | string

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:6

optional detector_metadata: null | string

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:10

JSON-serialized detector payload; shape per qc_system.

field: string

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:14

Observation column the rule evaluated (e.g. temp_c).

flag: "clean" | "flagged" | "suspect"

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:15

optional ingestion_id: null | string

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:16

optional observation_kind: null | "METAR" | "SPECI"

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:17

observed_at: string

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:18

optional parser_name: null | string

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:19

qc_system: string

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:20

qc_version: string

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:21

rule_id: string

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:22

source: "ghcnh" | "iem" | "ncei" | "awc"

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:23

station_code: string

Defined in: packages-ts/core/src/schemas/generated/observation_qc.v1.ts:24


Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:5

optional dew_point_c: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:9

units: celsius — bounded

event_time: string

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:13

observation valid time

optional metar_raw: null | string

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:17

raw METAR text if source has it; null for AWC JSON (structured-only)

observation_type: "METAR" | "SPECI"

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:21

METAR | SPECI; defaults METAR when source can’t distinguish (e.g. AWC JSON)

optional precip_mm_1h: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:25

units: mm — hourly precip (METAR p01i, converted from inches)

optional sky_base_1_m: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:29

units: meters — first cloud layer base height (converted from feet)

optional sky_base_2_m: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:33

units: meters

optional sky_base_3_m: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:37

units: meters

optional sky_base_4_m: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:41

units: meters

optional sky_cover_1: null | "BKN" | "CLR" | "FEW" | "OVC" | "SCT" | "VV"

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:45

first cloud layer cover code

optional sky_cover_2: null | "BKN" | "CLR" | "FEW" | "OVC" | "SCT" | "VV"

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:49

second layer; null if not present

optional sky_cover_3: null | "BKN" | "CLR" | "FEW" | "OVC" | "SCT" | "VV"

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:53

third layer; null if not present

optional sky_cover_4: null | "BKN" | "CLR" | "FEW" | "OVC" | "SCT" | "VV"

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:57

fourth layer; null if not present

optional slp_hpa: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:61

units: hPa — sea-level pressure (canonical aviation unit, not converted across modes)

station: string

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:65

ICAO/ASOS station ID (e.g. KORD)

optional temp_c: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:69

units: celsius — bounded TEMP_MIN_C..TEMP_MAX_C

optional visibility_m: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:73

units: meters — converted from statute miles

optional wind_dir_deg: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:77

units: degrees — 0-360, bounded

optional wind_gust_ms: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:81

units: m/s — converted from kt

optional wind_speed_ms: null | number

Defined in: packages-ts/core/src/schemas/generated/observation.v1.ts:85

units: m/s — converted from kt


Defined in: packages-ts/core/src/exceptions/index.ts:520

optional asOf: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:523

endpointUrl: string

Defined in: packages-ts/core/src/exceptions/index.ts:522

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

model: string

Defined in: packages-ts/core/src/exceptions/index.ts:521

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source


Defined in: packages-ts/core/src/exceptions/index.ts:607

optional acceptedModes: string[]

Defined in: packages-ts/core/src/exceptions/index.ts:610

declaredSize: number

Defined in: packages-ts/core/src/exceptions/index.ts:608

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

limit: number

Defined in: packages-ts/core/src/exceptions/index.ts:609

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source


Defined in: packages-ts/core/src/data/generated/qc-alpha-rules.ts:5

bit_position: number

Defined in: packages-ts/core/src/data/generated/qc-alpha-rules.ts:7

description: string

Defined in: packages-ts/core/src/data/generated/qc-alpha-rules.ts:8

field: string

Defined in: packages-ts/core/src/data/generated/qc-alpha-rules.ts:9

rule_id: string

Defined in: packages-ts/core/src/data/generated/qc-alpha-rules.ts:6


Defined in: packages-ts/core/src/exceptions/index.ts:692

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

TherminalErrorOptions.errorCode

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

TherminalErrorOptions.requestId

optional retryAfter: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:693

TherminalErrorOptions.retryAfter

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

TherminalErrorOptions.source

optional statusCode: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:658

TherminalErrorOptions.statusCode


Defined in: packages-ts/core/src/exceptions/index.ts:360

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

optional quarantineCount: number

Defined in: packages-ts/core/src/exceptions/index.ts:363

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional sampleViolations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:364

schemaId: string

Defined in: packages-ts/core/src/exceptions/index.ts:361

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source

optional violations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:362


Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:5

cli_data_quality: "clean" | "flagged_instrument" | "flagged_late" | "flagged_other" | "missing"

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:9

NWS CLI data-quality marker (Pitfall 6/16). Allows downstream code to filter or weight settlement rows by issuer quality without re-parsing the product header.

event_time: string

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:13

00:00 local time on observation_date converted to UTC; for sort/join only

observation_date: string

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:17

local climate day per NWS convention (no timezone applied to the date itself)

optional precipitation_in: null | number

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:21

units: inches

product_release_time: string

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:25

parsed from CLI product header (_climate.py::_parse_product_timestamp)

report_type: "correction" | "final" | "preliminary"

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:29

preliminary | final | correction; dedup priority preliminary < final < correction

settlement_finality: "final" | "provisional" | "superseded"

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:33

provisional | final | superseded. Kalshi NHIGH/NLOW settlement contractually requires ‘final’; ‘provisional’ values are kept for early-look research only.

optional snowfall_in: null | number

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:37

units: inches

station: string

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:41

ICAO/ASOS station ID

station_tz: string

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:45

IANA timezone for the station (e.g. America/Chicago for KORD). Required for local-climate-day semantics; see §U.

optional temp_max_F: null | number

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:49

units: fahrenheit — daily high (uppercase F for consistency with obs imperial mode)

optional temp_min_F: null | number

Defined in: packages-ts/core/src/schemas/generated/settlement.cli.v1.ts:53

units: fahrenheit — daily low


Defined in: packages-ts/core/src/exceptions/index.ts:400

optional catalogWarning: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:404

dataSource: string

Defined in: packages-ts/core/src/exceptions/index.ts:402

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional role: null | SourceMismatchRole

Defined in: packages-ts/core/src/exceptions/index.ts:403

schemaSource: string

Defined in: packages-ts/core/src/exceptions/index.ts:401

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source


Defined in: packages-ts/core/src/exceptions/index.ts:167

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

optional httpStatus: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:168

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional retryable: boolean

Defined in: packages-ts/core/src/exceptions/index.ts:169

optional retryAfterS: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:170

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source

optional underlying: string

Defined in: packages-ts/core/src/exceptions/index.ts:171

optional url: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:172


Defined in: packages-ts/core/src/data/generated/stations.ts:5

code: null | string

Defined in: packages-ts/core/src/data/generated/stations.ts:6

country: null | string

Defined in: packages-ts/core/src/data/generated/stations.ts:13

ghcnh_id: null | string

Defined in: packages-ts/core/src/data/generated/stations.ts:7

icao: string

Defined in: packages-ts/core/src/data/generated/stations.ts:8

latitude: null | number

Defined in: packages-ts/core/src/data/generated/stations.ts:11

longitude: null | number

Defined in: packages-ts/core/src/data/generated/stations.ts:12

name: null | string

Defined in: packages-ts/core/src/data/generated/stations.ts:9

tz: string

Defined in: packages-ts/core/src/data/generated/stations.ts:10

venues: readonly string[]

Defined in: packages-ts/core/src/data/generated/stations.ts:14


Defined in: packages-ts/core/src/exceptions/index.ts:569

assertedRange: [string, string]

Defined in: packages-ts/core/src/exceptions/index.ts:571

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional sampleViolations: Record<string, unknown>[]

Defined in: packages-ts/core/src/exceptions/index.ts:573

schemaId: string

Defined in: packages-ts/core/src/exceptions/index.ts:570

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source

violatingRows: number

Defined in: packages-ts/core/src/exceptions/index.ts:572


Defined in: packages-ts/core/src/exceptions/index.ts:657

optional errorCode: string

Defined in: packages-ts/core/src/exceptions/index.ts:109

MostlyRightErrorOptions.errorCode

optional requestId: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:111

MostlyRightErrorOptions.requestId

optional retryAfter: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:659

optional source: null | string

Defined in: packages-ts/core/src/exceptions/index.ts:110

MostlyRightErrorOptions.source

optional statusCode: null | number

Defined in: packages-ts/core/src/exceptions/index.ts:658

DataAvailabilityReason: typeof DATA_AVAILABILITY_REASONS[number]

Defined in: packages-ts/core/src/exceptions/index.ts:226


SourceMismatchRole: "observations" | "forecasts" | "settlement"

Defined in: packages-ts/core/src/exceptions/index.ts:398


Station: StationInfo

Defined in: packages-ts/core/src/stations/index.ts:24

const _CLI_PUBLICATION_DELAY_HOURS: 10 = 10.0

Defined in: packages-ts/core/src/snapshot.ts:134

NWS CLI typical publication delay: 10 h after midnight LST.


const _JAN_REF: Date

Defined in: packages-ts/core/src/snapshot.ts:131

Reference UTC moment in January (no DST in Northern Hemisphere US).


const _MARKET_CLOSE_HOUR_LST: 16 = 16

Defined in: packages-ts/core/src/snapshot.ts:137

Kalshi market typical close time (LST).


const _MARKET_CLOSE_MINUTE_LST: 30 = 30

Defined in: packages-ts/core/src/snapshot.ts:138


const _STATION_TZ: Readonly<Record<string, string>>

Defined in: packages-ts/core/src/snapshot.ts:22


const CATALOG: StationCatalog

Defined in: packages-ts/core/src/stations/index.ts:108

Process-wide default catalog over the codegen station registry.


const CLIMATE_REPORT_TYPE_PRIORITY: Readonly<Record<string, number>>

Defined in: packages-ts/core/src/data/generated/source-priority.ts:11


const DATA_AVAILABILITY_REASONS: readonly ["model_unavailable", "out_of_window", "cache_miss", "source_404", "source_5xx", "rate_limited"]

Defined in: packages-ts/core/src/exceptions/index.ts:217

Shared reason enum — MUST match Python EXACTLY (Phase 21 D-04).


const LIVE_V1_POLICY: object

Defined in: packages-ts/core/src/data/generated/source-priority.ts:19

name: string

secondaryKey: ReadonlyArray<string>

sourcePriority: Readonly<Record<string, number>>


const OBSERVATION_SOURCE_PRIORITY: Readonly<Record<string, number>>

Defined in: packages-ts/core/src/data/generated/source-priority.ts:5


const QC_ALPHA_RULES: ReadonlyArray<QcAlphaRule>

Defined in: packages-ts/core/src/data/generated/qc-alpha-rules.ts:12


const QC_ALPHA_RULES_BY_ID: ReadonlyMap<string, QcAlphaRule>

Defined in: packages-ts/core/src/data/generated/qc-alpha-rules.ts:45


const STATION_BY_CODE: ReadonlyMap<string, StationInfo>

Defined in: packages-ts/core/src/data/generated/stations.ts:1190


const STATION_BY_ICAO: ReadonlyMap<string, StationInfo>

Defined in: packages-ts/core/src/data/generated/stations.ts:1287


const STATIONS: ReadonlyArray<StationInfo>

Defined in: packages-ts/core/src/data/generated/stations.ts:17


const version: "1.15.0" = "1.15.0"

Defined in: packages-ts/core/src/index.ts:9

Placeholder version string from the TS-W0 Wave 1 scaffold. The authoritative package version lives in package.json#version (currently 0.1.0-rc.7); this constant has not been bumped.

_lstOffsetHours(stationTz): number

Defined in: packages-ts/core/src/snapshot.ts:154

Return the LOCAL STANDARD TIME UTC offset (in hours) for an IANA tz, sampled from January 15 2024 12:00 UTC so the result is never affected by DST in the Northern Hemisphere.

Implementation: format _JAN_REF in the target tz via Intl.DateTimeFormat and diff against the UTC formatted view to recover the offset.

string

number


_resolveStationTz(station, tzOverride?): string

Defined in: packages-ts/core/src/snapshot.ts:213

Resolve a station code (NWS 3-letter, ICAO 4-letter) to an IANA tz string. Honors tzOverride first, then the built-in _STATION_TZ map. Throws if no tz can be resolved.

string

string

string


cliAvailableAt(dateStr, station, delayHours, tzOverride?): Date

Defined in: packages-ts/core/src/snapshot.ts:315

Return the UTC time at which the NWS CLI for a date is expected to be available. Default delay is 10 h after midnight LST on the next day.

string

string

number = _CLI_PUBLICATION_DELAY_HOURS

string

Date


fetchWithRetry(url, opts): Promise<Response>

Defined in: packages-ts/core/src/internal/http.ts:130

GET (or other) a URL with exponential-backoff retry semantics.

Behaviour:

  • signal is composed with a per-attempt timeout via AbortController.
  • On retryable status (default: 429/500/502/503/504), wait baseDelayMs * 2^attempt (with ≤25% jitter) and retry, up to maxRetries total attempts.
  • On 404 → NotFoundError. On 400/401/403 → ValidationError / AuthenticationError / ForbiddenError. After retry exhaustion on 429 → RateLimitError (with retryAfter honoured). After retry exhaustion on 5xx → ServerError.
  • On network/transport failure: retried under the same budget, last error rethrown as a TherminalError if it isn’t one already.

string

FetchWithRetryOptions = {}

Promise<Response>


helloCore(): string

Defined in: packages-ts/core/src/index.ts:17

Smoke-test export from the TS-W0 Wave 1 scaffold. Returns the literal string "hello @mostlyrightmd/core". Retained so the published package has at least one importable runtime export until the scaffold is removed in a later phase.

string


marketCloseUtc(dateStr, station, tzOverride?): Date

Defined in: packages-ts/core/src/snapshot.ts:329

Return the UTC time of the Kalshi market close for a settlement date. Kalshi NHIGH/NLOW markets close at 4:30 PM LST on the day of settlement.

string

string

string

Date


settlementDateFor(asOf, station, tzOverride?): string

Defined in: packages-ts/core/src/snapshot.ts:267

Return the Kalshi settlement date (YYYY-MM-DD LST) for a UTC moment.

Kalshi NHIGH/NLOW contracts cover midnight–midnight LOCAL STANDARD TIME. DST is ignored: the window is always fixed to the standard UTC offset.

string | Date

string

string

string


settlementWindowUtc(dateStr, station, tzOverride?): [Date, Date]

Defined in: packages-ts/core/src/snapshot.ts:286

Return UTC start/end of the Kalshi settlement window for a date. The window is midnight-midnight LST, expressed in UTC.

string

string

string

[Date, Date]


toJsonSafe(value, seen?): unknown

Defined in: packages-ts/core/src/exceptions/index.ts:27

Recursively coerce value into a JSON-serializable structure.

Coercion rules (mirrors Python’s to_json_safe):

  • null / undefined / NaN / Infinity / -Infinitynull
  • Date → ISO 8601 UTC string ending in Z
  • Numeric / boolean / string scalars pass through (non-finite numbers → null)
  • Arrays + plain objects → recursive (cycles → { _cycle: true, value: String(obj) })
  • Dict keys MUST be strings; non-string keys throw TypeError.
  • Anything else (Symbol, function, class instance without toJSON) → { _repr_only: true, value: String(value) }.

unknown

WeakSet<object>

unknown