@mostlyrightmd/core
Classes
Section titled “Classes”AuthenticationError
Section titled “AuthenticationError”Base HTTP-layer marker. Subclass of MostlyrightError so callers that
catch MostlyrightError also catch transport errors.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new AuthenticationError()
Section titled “new AuthenticationError()”new AuthenticationError(
message,options):AuthenticationError
Parameters
Section titled “Parameters”message
Section titled “message”string = "Authentication required"
options
Section titled “options”HttpErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="HTTP_UNAUTHORIZED"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”statusCode
Section titled “statusCode”
readonlystatusCode:null|number
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”CityCatalog
Section titled “CityCatalog”Read-only city index over the station registry.
Lookups normalize their argument, so get("new_york"), get("New York")
and get("new-york") all resolve to the same record.
Constructors
Section titled “Constructors”new CityCatalog()
Section titled “new CityCatalog()”new CityCatalog(
cities):CityCatalog
Parameters
Section titled “Parameters”cities
Section titled “cities”readonly CityRecord[] = CITY_RECORDS
Returns
Section titled “Returns”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get size():
number
Returns
Section titled “Returns”number
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
Iterator<City>
Returns
Section titled “Returns”Iterator<City>
filterByCountry()
Section titled “filterByCountry()”filterByCountry(
country):City[]
Cities whose ISO 3166-1 alpha-2 country matches, sorted by key.
Parameters
Section titled “Parameters”country
Section titled “country”string
Returns
Section titled “Returns”City[]
filterByVenue()
Section titled “filterByVenue()”filterByVenue(
venue):City[]
Cities with at least one station tagged venue, sorted by key.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”City[]
get(
key):City
Return the city for key (city key or display name).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Throws
Section titled “Throws”if no city matches.
has(
key):boolean
True iff key resolves to a city (key or display name).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
venues()
Section titled “venues()”venues():
ReadonlySet<string>
Union of all venue tags present in the catalog.
Returns
Section titled “Returns”ReadonlySet<string>
ContractError
Section titled “ContractError”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.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”new ContractError()
Section titled “new ContractError()”new ContractError(
message,options):ContractError
Parameters
Section titled “Parameters”message
Section titled “message”string = ""
options
Section titled “options”ContractErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”actual
Section titled “actual”
readonlyactual:null|string
defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="CONTRACT_ERROR"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
docUrl
Section titled “docUrl”
readonlydocUrl:null|string
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”expected
Section titled “expected”
readonlyexpected:null|string
readonlyfield:null|string
location
Section titled “location”
readonlylocation:null|string
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”DataAvailabilityError
Section titled “DataAvailabilityError”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.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”new DataAvailabilityError()
Section titled “new DataAvailabilityError()”new DataAvailabilityError(
options):DataAvailabilityError
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="DATA_AVAILABILITY"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”
readonlyhint:string
reason
Section titled “reason”
readonlyreason:"model_unavailable"|"out_of_window"|"cache_miss"|"source_404"|"source_5xx"|"rate_limited"
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”DeferredMarketError
Section titled “DeferredMarketError”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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new DeferredMarketError()
Section titled “new DeferredMarketError()”new DeferredMarketError(
message,options):DeferredMarketError
Parameters
Section titled “Parameters”message
Section titled “message”string = ""
options
Section titled “options”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="DEFERRED_MARKET"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”ForbiddenError
Section titled “ForbiddenError”Base HTTP-layer marker. Subclass of MostlyrightError so callers that
catch MostlyrightError also catch transport errors.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new ForbiddenError()
Section titled “new ForbiddenError()”new ForbiddenError(
message,options):ForbiddenError
Parameters
Section titled “Parameters”message
Section titled “message”string = "Access denied"
options
Section titled “options”HttpErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="HTTP_FORBIDDEN"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”statusCode
Section titled “statusCode”
readonlystatusCode:null|number
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”HazardRetentionError
Section titled “HazardRetentionError”The requested window is older than the live route’s retention limit.
api.weather.gov/alerts and api.weather.gov/products both retain exactly
7 days: a start seven days back returns rows, eight days back returns zero
features. Asking the live route for an older window is a caller contract
violation caught before any request — it is not a data-availability failure,
and it never degrades to an empty result that reads as “no hazards occurred”.
The fix the message carries is a source: pin, not a second verb name:
source: "iem" routes the same call at the Iowa State VTEC/AFOS archive,
which has no 7-day cliff. Keeping the fix on an option rather than on a
separate archive verb is what lets this teaching error survive a rename.
Takes the ContractError options unchanged
(field/expected/actual), so the structured teaching payload is the same
one every other contract violation in the SDK emits. Mirrors Python
HazardRetentionError.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new HazardRetentionError()
Section titled “new HazardRetentionError()”new HazardRetentionError(
message,options):HazardRetentionError
Parameters
Section titled “Parameters”message
Section titled “message”string = ""
options
Section titled “options”ContractErrorOptions = {}
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”actual
Section titled “actual”
readonlyactual:null|string
Inherited from
Section titled “Inherited from”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="HAZARD_RETENTION_EXCEEDED"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”ContractError.defaultErrorCode
docUrl
Section titled “docUrl”
readonlydocUrl:null|string
Inherited from
Section titled “Inherited from”errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”expected
Section titled “expected”
readonlyexpected:null|string
Inherited from
Section titled “Inherited from”
readonlyfield:null|string
Inherited from
Section titled “Inherited from”location
Section titled “location”
readonlylocation:null|string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”HttpError
Section titled “HttpError”Base HTTP-layer marker. Subclass of MostlyrightError so callers that
catch MostlyrightError also catch transport errors.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”new HttpError()
Section titled “new HttpError()”new HttpError(
message,options):HttpError
Parameters
Section titled “Parameters”message
Section titled “message”string
options
Section titled “options”HttpErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="HTTP_ERROR"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”statusCode
Section titled “statusCode”
readonlystatusCode:null|number
Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”IndicatorNotYetReleasedError
Section titled “IndicatorNotYetReleasedError”A requested economic release is expected but has not been published yet.
Mirrors the Python class: errorCode === "INDICATOR_NOT_YET_RELEASED", carries
indicator / period / expectedRelease, and the message reads
"{indicator} for period '{period}' is not yet released" (plus
" (expected {iso})" when a scheduled release is known).
Example
Section titled “Example”import { IndicatorNotYetReleasedError } from "@mostlyrightmd/core";try { await history("cpi", from, to);} catch (e) { if (e instanceof IndicatorNotYetReleasedError) { console.warn(`Come back at ${e.expectedRelease ?? "the next drop"}`); } else { throw e; }}Extends
Section titled “Extends”Constructors
Section titled “Constructors”new IndicatorNotYetReleasedError()
Section titled “new IndicatorNotYetReleasedError()”new IndicatorNotYetReleasedError(
indicator,period,options):IndicatorNotYetReleasedError
Parameters
Section titled “Parameters”indicator
Section titled “indicator”string
period
Section titled “period”string
options
Section titled “options”IndicatorNotYetReleasedErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="INDICATOR_NOT_YET_RELEASED"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”expectedRelease
Section titled “expectedRelease”
readonlyexpectedRelease:null|string
ISO 8601 string when the scheduled release is known, else null.
indicator
Section titled “indicator”
readonlyindicator:string
period
Section titled “period”
readonlyperiod:string
remedy
Section titled “remedy”
readonlyremedy:null|string
An actionable unlock hint (e.g. naming FRED_API_KEY) when known, else null.
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”IssuedAtMissingError
Section titled “IssuedAtMissingError”A forecast row would land with issuedAt = null.
Rows without issuance times cannot be evaluated against a point-in-time cutoff and could introduce later model runs into training data.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new IssuedAtMissingError()
Section titled “new IssuedAtMissingError()”new IssuedAtMissingError(
message,options):IssuedAtMissingError
Parameters
Section titled “Parameters”message
Section titled “message”string
options
Section titled “options”IssuedAtMissingErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”SchemaValidationError.constructor
Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="ISSUED_AT_MISSING"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”SchemaValidationError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”SchemaValidationError.errorCode
quarantineCount
Section titled “quarantineCount”
readonlyquarantineCount:number
Inherited from
Section titled “Inherited from”SchemaValidationError.quarantineCount
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”SchemaValidationError.requestId
sampleViolations
Section titled “sampleViolations”
readonlysampleViolations:Record<string,unknown>[]
Inherited from
Section titled “Inherited from”SchemaValidationError.sampleViolations
schemaId
Section titled “schemaId”
readonlyschemaId:string
Inherited from
Section titled “Inherited from”SchemaValidationError.schemaId
source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”violatingCountRows
Section titled “violatingCountRows”
readonlyviolatingCountRows:number
violations
Section titled “violations”
readonlyviolations:Record<string,unknown>[]
Inherited from
Section titled “Inherited from”SchemaValidationError.violations
Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”LeakageError
Section titled “LeakageError”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.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”new LeakageError()
Section titled “new LeakageError()”new LeakageError(
message,options):LeakageError
Parameters
Section titled “Parameters”message
Section titled “message”string
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”
readonlyasOf:string
boundary
Section titled “boundary”
readonlyboundary:null|string
column
Section titled “column”
readonlycolumn:null|string
decisionTime
Section titled “decisionTime”
readonlydecisionTime:null|string
defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="LEAKAGE_DETECTED"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
docUrl
Section titled “docUrl”
readonlydocUrl:null|string
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”sampleViolations
Section titled “sampleViolations”
readonlysampleViolations:Record<string,unknown>[]
source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”violatingCount
Section titled “violatingCount”
readonlyviolatingCount:number
Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”LiveStreamError
Section titled “LiveStreamError”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.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”new LiveStreamError()
Section titled “new LiveStreamError()”new LiveStreamError(
message,options):LiveStreamError
Parameters
Section titled “Parameters”message
Section titled “message”string = ""
options
Section titled “options”NoDataErrorOptions = {}
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="LIVE_STREAM_ERROR"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”noDataCause
Section titled “noDataCause”
readonlynoDataCause:null|string
The actual cause the query returned nothing. Serialized as cause.
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”LiveThrottledError
Section titled “LiveThrottledError”The live source is rate-limiting us (HTTP 429) — the poll is refused.
Mirrors Python LiveThrottledError. Thrown by the live.latest /
live.stream IEM leg when an upstream 429 just occurred (a cooldown was
recorded) or a previously-recorded cooldown is still active — in which
case the poll fails fast without touching the network. Subclass of
NoLiveDataError so existing skip/catch paths keep working
(stream() skips the tick); callers that want to branch catch this class
and honor retryAfterSeconds.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new LiveThrottledError()
Section titled “new LiveThrottledError()”new LiveThrottledError(
message,options):LiveThrottledError
Parameters
Section titled “Parameters”message
Section titled “message”string
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="LIVE_THROTTLED"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”NoLiveDataError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”noDataCause
Section titled “noDataCause”
readonlynoDataCause:null|string
The actual cause the query returned nothing. Serialized as cause.
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”retryAfterSeconds
Section titled “retryAfterSeconds”
readonlyretryAfterSeconds:number
source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”station
Section titled “station”
readonlystation:string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”MostlyrightError
Section titled “MostlyrightError”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.
Extends
Section titled “Extends”Error
Extended by
Section titled “Extended by”SourceUnavailableErrorDataAvailabilityErrorSchemaValidationErrorContractErrorNoDataErrorSourceMismatchErrorLeakageErrorTemporalDriftErrorPayloadTooLargeErrorDeferredMarketErrorPolymarketEventErrorHttpErrorIndicatorNotYetReleasedErrorUnknownSchemaErrorHostedConfigErrorHostedResponseError
Constructors
Section titled “Constructors”new MostlyrightError()
Section titled “new MostlyrightError()”new MostlyrightError(
message,options):MostlyrightError
Parameters
Section titled “Parameters”message
Section titled “message”string = ""
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="MOSTLYRIGHT_ERROR"
Subclass override — the stable string enum surfaced via errorCode.
errorCode
Section titled “errorCode”
readonlyerrorCode:string
requestId
Section titled “requestId”
readonlyrequestId:null|string
source
Section titled “source”
readonlysource:null|string
Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
NoDataError
Section titled “NoDataError”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.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”new NoDataError()
Section titled “new NoDataError()”new NoDataError(
message,options):NoDataError
Parameters
Section titled “Parameters”message
Section titled “message”string = ""
options
Section titled “options”NoDataErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="NO_DATA"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”noDataCause
Section titled “noDataCause”
readonlynoDataCause:null|string
The actual cause the query returned nothing. Serialized as cause.
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”NoHazardDataError
Section titled “NoHazardDataError”A named hazard identity produced no rows.
Thrown by the identity verbs — the ones handed a specific storm id or product
id (bestTrack(stormId), textProducts({ productId })) — instead of
resolving to an empty result. Carries the identifier that was asked for and
the reason.
Extends NoDataError, not NoLiveDataError: a valid finite query
that returns zero rows is a zero-row answer, not a live-capture failure.
Mirrors Python NoHazardDataError.
Enumeration verbs do not throw this. tropicalCyclones() in a quiet season
resolves to an empty DataResult, because CurrentStorms.json serving
{"activeStorms": []} is a correct answer about the world. A missing named
identity is not.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new NoHazardDataError()
Section titled “new NoHazardDataError()”new NoHazardDataError(
identifier,reason,options):NoHazardDataError
Parameters
Section titled “Parameters”identifier
Section titled “identifier”string
reason
Section titled “reason”string
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="NO_HAZARD_DATA"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”identifier
Section titled “identifier”
readonlyidentifier:string
What was asked for — the storm id, product id, or zone.
noDataCause
Section titled “noDataCause”
readonlynoDataCause:null|string
The actual cause the query returned nothing. Serialized as cause.
Inherited from
Section titled “Inherited from”reason
Section titled “reason”
readonlyreason:string
Why it produced nothing, in the words the verb used.
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”NoLiveDataError
Section titled “NoLiveDataError”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.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”new NoLiveDataError()
Section titled “new NoLiveDataError()”new NoLiveDataError(
message,options):NoLiveDataError
Parameters
Section titled “Parameters”message
Section titled “message”string
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="NO_LIVE_DATA"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”LiveStreamError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”noDataCause
Section titled “noDataCause”
readonlynoDataCause:null|string
The actual cause the query returned nothing. Serialized as cause.
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”station
Section titled “station”
readonlystation:string
Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”NotFoundError
Section titled “NotFoundError”Base HTTP-layer marker. Subclass of MostlyrightError so callers that
catch MostlyrightError also catch transport errors.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new NotFoundError()
Section titled “new NotFoundError()”new NotFoundError(
message,options):NotFoundError
Parameters
Section titled “Parameters”message
Section titled “message”string = "Resource not found"
options
Section titled “options”HttpErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="HTTP_NOT_FOUND"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”statusCode
Section titled “statusCode”
readonlystatusCode:null|number
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”NwpNotAvailableError
Section titled “NwpNotAvailableError”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 implementation impractical).
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 unavailable in TypeScript; ${e.hint}`); // Fall back to iemMosForecasts() when available, else Python SDK. } else { throw e; }}See docs/nwp-forecasts.md for current availability and alternatives.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new NwpNotAvailableError()
Section titled “new NwpNotAvailableError()”new NwpNotAvailableError(
options):NwpNotAvailableError
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”DataAvailabilityError.constructor
Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="NWP_NOT_AVAILABLE"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”DataAvailabilityError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”DataAvailabilityError.errorCode
readonlyhint:string
Inherited from
Section titled “Inherited from”
readonlymodel:string
reason
Section titled “reason”
readonlyreason:"model_unavailable"|"out_of_window"|"cache_miss"|"source_404"|"source_5xx"|"rate_limited"
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”DataAvailabilityError.requestId
source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”station
Section titled “station”
readonlystation:string
Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”OpenMeteoSeamlessLeakageError
Section titled “OpenMeteoSeamlessLeakageError”The Open-Meteo Historical Forecast (seamless) endpoint was used
without allowLeakage: true.
The seamless endpoint 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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new OpenMeteoSeamlessLeakageError()
Section titled “new OpenMeteoSeamlessLeakageError()”new OpenMeteoSeamlessLeakageError(
message,options):OpenMeteoSeamlessLeakageError
Parameters
Section titled “Parameters”message
Section titled “message”string
options
Section titled “options”OpenMeteoSeamlessLeakageErrorOptions
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”
readonlyasOf:string
Inherited from
Section titled “Inherited from”boundary
Section titled “boundary”
readonlyboundary:null|string
Inherited from
Section titled “Inherited from”column
Section titled “column”
readonlycolumn:null|string
Inherited from
Section titled “Inherited from”decisionTime
Section titled “decisionTime”
readonlydecisionTime:null|string
Inherited from
Section titled “Inherited from”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="OPEN_METEO_SEAMLESS_LEAKAGE"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”docUrl
Section titled “docUrl”
readonlydocUrl:null|string
Inherited from
Section titled “Inherited from”endpointUrl
Section titled “endpointUrl”
readonlyendpointUrl:string
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”
readonlymodel:string
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”sampleViolations
Section titled “sampleViolations”
readonlysampleViolations:Record<string,unknown>[]
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”violatingCount
Section titled “violatingCount”
readonlyviolatingCount:number
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”PayloadTooLargeError
Section titled “PayloadTooLargeError”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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new PayloadTooLargeError()
Section titled “new PayloadTooLargeError()”new PayloadTooLargeError(
message,options):PayloadTooLargeError
Parameters
Section titled “Parameters”message
Section titled “message”string
options
Section titled “options”PayloadTooLargeErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”acceptedModes
Section titled “acceptedModes”
readonlyacceptedModes:string[]
declaredSize
Section titled “declaredSize”
readonlydeclaredSize:number
defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="PAYLOAD_TOO_LARGE"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”
readonlylimit:number
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”PolymarketEventError
Section titled “PolymarketEventError”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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new PolymarketEventError()
Section titled “new PolymarketEventError()”new PolymarketEventError(
message,options):PolymarketEventError
Parameters
Section titled “Parameters”message
Section titled “message”string = ""
options
Section titled “options”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="POLYMARKET_EVENT_INVALID"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”RateLimitError
Section titled “RateLimitError”Base HTTP-layer marker. Subclass of MostlyrightError so callers that
catch MostlyrightError also catch transport errors.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new RateLimitError()
Section titled “new RateLimitError()”new RateLimitError(
retryAfter,options):RateLimitError
Parameters
Section titled “Parameters”retryAfter
Section titled “retryAfter”null | number
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="HTTP_RATE_LIMITED"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”retryAfter
Section titled “retryAfter”
readonlyretryAfter:null|number
source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”statusCode
Section titled “statusCode”
readonlystatusCode:null|number
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”ReleaseScheduleUnavailableError
Section titled “ReleaseScheduleUnavailableError”A release-schedule source answered, but the body carried no usable schedule.
Thrown when a schedule leg returns a body that parses to zero usable events, or an event whose release-type token is outside the mapped vocabulary. An empty schedule is an explicit error, never a silently-empty return: a caller that receives an empty calendar reads it as “every future release is cancelled”, which is the wrong answer to a bot-wall page, an HTML landing page served at HTTP 200, or an unfolded line the parser dropped.
Extends SourceUnavailableError so an existing
instanceof SourceUnavailableError branch still matches, and reuses that
options object unchanged — source / url / httpStatus carry the same
meaning. The distinct errorCode is what lets a caller that cares tell “the
endpoint answered with nothing usable” apart from “the endpoint was
unreachable”.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new ReleaseScheduleUnavailableError()
Section titled “new ReleaseScheduleUnavailableError()”new ReleaseScheduleUnavailableError(
message,options):ReleaseScheduleUnavailableError
Parameters
Section titled “Parameters”message
Section titled “message”string = ""
options
Section titled “options”SourceUnavailableErrorOptions = {}
Returns
Section titled “Returns”ReleaseScheduleUnavailableError
Inherited from
Section titled “Inherited from”SourceUnavailableError.constructor
Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="RELEASE_SCHEDULE_UNAVAILABLE"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”SourceUnavailableError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”SourceUnavailableError.errorCode
httpStatus
Section titled “httpStatus”
readonlyhttpStatus:null|number
Inherited from
Section titled “Inherited from”SourceUnavailableError.httpStatus
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”SourceUnavailableError.requestId
retryable
Section titled “retryable”
readonlyretryable:boolean
Inherited from
Section titled “Inherited from”SourceUnavailableError.retryable
retryAfterS
Section titled “retryAfterS”
readonlyretryAfterS:null|number
Inherited from
Section titled “Inherited from”SourceUnavailableError.retryAfterS
source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”underlying
Section titled “underlying”
readonlyunderlying:string
Inherited from
Section titled “Inherited from”SourceUnavailableError.underlying
readonlyurl:null|string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”SchemaValidationError
Section titled “SchemaValidationError”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.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”new SchemaValidationError()
Section titled “new SchemaValidationError()”new SchemaValidationError(
message,options):SchemaValidationError
Parameters
Section titled “Parameters”message
Section titled “message”string
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="SCHEMA_VALIDATION_FAILED"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”quarantineCount
Section titled “quarantineCount”
readonlyquarantineCount:number
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”sampleViolations
Section titled “sampleViolations”
readonlysampleViolations:Record<string,unknown>[]
schemaId
Section titled “schemaId”
readonlyschemaId:string
source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”violations
Section titled “violations”
readonlyviolations:Record<string,unknown>[]
Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”ServerError
Section titled “ServerError”Base HTTP-layer marker. Subclass of MostlyrightError so callers that
catch MostlyrightError also catch transport errors.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new ServerError()
Section titled “new ServerError()”new ServerError(
message,options):ServerError
Parameters
Section titled “Parameters”message
Section titled “message”string = "Server error"
options
Section titled “options”HttpErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="HTTP_SERVER_ERROR"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”statusCode
Section titled “statusCode”
readonlystatusCode:null|number
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”SourceMismatchError
Section titled “SourceMismatchError”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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new SourceMismatchError()
Section titled “new SourceMismatchError()”new SourceMismatchError(
message,options):SourceMismatchError
Parameters
Section titled “Parameters”message
Section titled “message”string
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”catalogWarning
Section titled “catalogWarning”
readonlycatalogWarning:null|string
dataSource
Section titled “dataSource”
readonlydataSource:string
defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="SOURCE_MISMATCH"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”
readonlyrole:null|SourceMismatchRole
schemaSource
Section titled “schemaSource”
readonlyschemaSource:string
source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”VALID_ROLES
Section titled “VALID_ROLES”
readonlystaticVALID_ROLES:ReadonlySet<SourceMismatchRole>
Canonical role-name vocabulary for source mismatches.
Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”SourceUnavailableError
Section titled “SourceUnavailableError”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.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”new SourceUnavailableError()
Section titled “new SourceUnavailableError()”new SourceUnavailableError(
message,options):SourceUnavailableError
Parameters
Section titled “Parameters”message
Section titled “message”string = ""
options
Section titled “options”SourceUnavailableErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="SOURCE_UNAVAILABLE"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”httpStatus
Section titled “httpStatus”
readonlyhttpStatus:null|number
requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”retryable
Section titled “retryable”
readonlyretryable:boolean
retryAfterS
Section titled “retryAfterS”
readonlyretryAfterS:null|number
source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”underlying
Section titled “underlying”
readonlyunderlying:string
readonlyurl:null|string
Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”StationCatalog
Section titled “StationCatalog”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.
Constructors
Section titled “Constructors”new StationCatalog()
Section titled “new StationCatalog()”new StationCatalog(
stations):StationCatalog
Parameters
Section titled “Parameters”stations
Section titled “stations”readonly StationInfo[] = STATIONS
Returns
Section titled “Returns”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get size():
number
Returns
Section titled “Returns”number
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
Iterator<StationInfo>
Returns
Section titled “Returns”Iterator<StationInfo>
filterByCountry()
Section titled “filterByCountry()”filterByCountry(
country):StationInfo[]
Stations whose ISO 3166-1 alpha-2 country matches, sorted by ICAO.
Parameters
Section titled “Parameters”country
Section titled “country”string
Returns
Section titled “Returns”filterByVenue()
Section titled “filterByVenue()”filterByVenue(
venue):StationInfo[]
Stations tagged with venue (e.g. “kalshi”), sorted by ICAO.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”get(
code):StationInfo
Return the station for code (registry code or ICAO).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Throws
Section titled “Throws”if no station matches.
has(
code):boolean
True iff code resolves to a station (by registry code or ICAO).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
venues()
Section titled “venues()”venues():
ReadonlySet<string>
Union of all venue tags present in the catalog.
Returns
Section titled “Returns”ReadonlySet<string>
TemporalDriftError
Section titled “TemporalDriftError”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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new TemporalDriftError()
Section titled “new TemporalDriftError()”new TemporalDriftError(
message,options):TemporalDriftError
Parameters
Section titled “Parameters”message
Section titled “message”string
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”assertedRange
Section titled “assertedRange”
readonlyassertedRange: [string,string]
defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="TEMPORAL_DRIFT"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”MostlyrightError.defaultErrorCode
errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”sampleViolations
Section titled “sampleViolations”
readonlysampleViolations:Record<string,unknown>[]
schemaId
Section titled “schemaId”
readonlyschemaId:string
source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”violatingRows
Section titled “violatingRows”
readonlyviolatingRows:number
Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”ValidationError
Section titled “ValidationError”Base HTTP-layer marker. Subclass of MostlyrightError so callers that
catch MostlyrightError also catch transport errors.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”new ValidationError()
Section titled “new ValidationError()”new ValidationError(
message,options):ValidationError
Parameters
Section titled “Parameters”message
Section titled “message”string = "Invalid request"
options
Section titled “options”HttpErrorOptions = {}
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Properties
Section titled “Properties”defaultErrorCode
Section titled “defaultErrorCode”
staticdefaultErrorCode:string="HTTP_BAD_REQUEST"
Subclass override — the stable string enum surfaced via errorCode.
Overrides
Section titled “Overrides”errorCode
Section titled “errorCode”
readonlyerrorCode:string
Inherited from
Section titled “Inherited from”requestId
Section titled “requestId”
readonlyrequestId:null|string
Inherited from
Section titled “Inherited from”source
Section titled “source”
readonlysource:null|string
Inherited from
Section titled “Inherited from”statusCode
Section titled “statusCode”
readonlystatusCode:null|number
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toDict()
Section titled “toDict()”toDict():
Record<string,unknown>
Return a JSON-safe dict suitable for MCP error.data.
Returns
Section titled “Returns”Record<string, unknown>
Inherited from
Section titled “Inherited from”Interfaces
Section titled “Interfaces”A city and the registry stations that observe it.
Properties
Section titled “Properties”country
Section titled “country”
readonlycountry:null|string
ISO 3166-1 alpha-2 code, shared by all of the city’s stations.
readonlykey:string
snake_case ASCII join key (e.g. “new_york”).
readonlyname:string
Display name in its native spelling (e.g. “São Paulo”).
stations
Section titled “stations”
readonlystations: readonlystring[]
ICAOs serving this city, sorted, at least one.
venueStations
Section titled “venueStations”
readonlyvenueStations:Readonly<Record<string, readonlystring[]>>
venue -> ICAOs for the stations that venue settles against, derived from
Station.venues. A venue with no station here is absent, so an empty
object means no prediction-market venue settles against this city.
CityRecord
Section titled “CityRecord”Properties
Section titled “Properties”key:
string
name:
string
stations
Section titled “stations”stations: readonly
string[]
ContractErrorOptions
Section titled “ContractErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”actual?
Section titled “actual?”
optionalactual:null|string
What the caller actually supplied.
docUrl?
Section titled “docUrl?”
optionaldocUrl:null|string
Doc URL teaching the fix. Serialized as doc_url.
errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
expected?
Section titled “expected?”
optionalexpected:null|string
What the contract required.
field?
Section titled “field?”
optionalfield:null|string
The offending contract/argument field name.
location?
Section titled “location?”
optionallocation:null|string
Where the violation was detected (call site / column / selector).
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
DataAvailabilityErrorOptions
Section titled “DataAvailabilityErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
hint:
string
reason
Section titled “reason”reason:
"model_unavailable"|"out_of_window"|"cache_miss"|"source_404"|"source_5xx"|"rate_limited"
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
DataResult<Row>
Section titled “DataResult<Row>”The single finite-verb return shape: the rows plus their provenance envelope.
rows is a native readonly array (enumerable), never an array with hidden props.
Type Parameters
Section titled “Type Parameters”• Row
Properties
Section titled “Properties”provenance
Section titled “provenance”
readonlyprovenance:Provenance
readonlyrows: readonlyRow[]
FetchWithRetryOptions
Section titled “FetchWithRetryOptions”Properties
Section titled “Properties”baseDelayMs?
Section titled “baseDelayMs?”
optionalbaseDelayMs:number
Base backoff delay in milliseconds (default 1000).
optionalbody:null|BodyInit
Optional request body (forwarded to fetch).
fetchImpl()?
Section titled “fetchImpl()?”
optionalfetchImpl: (input,init?) =>Promise<Response>(input,init?) =>Promise<Response>
Inject fetch for tests or for a proxy wrapper. Defaults to global fetch.
Parameters
Section titled “Parameters”URL | RequestInfo
RequestInit
Returns
Section titled “Returns”Promise<Response>
Parameters
Section titled “Parameters”string | URL | Request
RequestInit
Returns
Section titled “Returns”Promise<Response>
headers?
Section titled “headers?”
optionalheaders:Record<string,string>
Request headers.
maxRetries?
Section titled “maxRetries?”
optionalmaxRetries:number
Total attempts (default 3).
method?
Section titled “method?”
optionalmethod:string
HTTP method (default GET).
retryStatuses?
Section titled “retryStatuses?”
optionalretryStatuses:ReadonlySet<number>
Statuses that trigger a retry. Default {429, 500, 502, 503, 504}.
signal?
Section titled “signal?”
optionalsignal:AbortSignal
Caller-supplied abort signal (composed with per-attempt timeout).
sourceTag?
Section titled “sourceTag?”
optionalsourceTag:string
The ROUTE TAG to attribute a RateLimitError to, instead of the full URL.
Python’s _nwps_shared.raise_if_rate_limited sets error.source to the
route tag — "nwps.gauge.live", "usgs.waterdata.live" — so a caller
reading to_dict() learns WHICH upstream throttled them rather than which
cursor URL happened to be in flight. Absent, the URL is used, which is what
every caller that does not pass one keeps getting.
timeoutMs?
Section titled “timeoutMs?”
optionaltimeoutMs:number
Per-attempt timeout in milliseconds (default 60_000).
userAgent?
Section titled “userAgent?”
optionaluserAgent:string
Convenience: set the User-Agent header.
ForecastNwpV1
Section titled “ForecastNwpV1”Properties
Section titled “Properties”cloud_ceiling_m?
Section titled “cloud_ceiling_m?”
optionalcloud_ceiling_m:null|number
units: m
cloud_cover_pct?
Section titled “cloud_cover_pct?”
optionalcloud_cover_pct:null|number
units: percent
dewpoint_k_2m?
Section titled “dewpoint_k_2m?”
optionaldewpoint_k_2m:null|number
units: K
forecast_hour
Section titled “forecast_hour”forecast_hour:
number
units: hours — lead time in hours (alias: fxx)
grid_dist_km
Section titled “grid_dist_km”grid_dist_km:
number
units: km — great-circle distance from station to nearest grid cell
grid_kind
Section titled “grid_kind”grid_kind:
string
grid-projection label (lambert_conformal_conus, regular_latlon_global_0p25, …)
issued_at
Section titled “issued_at”issued_at:
string
model run / cycle reference time
mirror
Section titled “mirror”mirror:
"aws_bdp"|"azure_bdp"|"ecmwf_aws"|"ecmwf_azure"|"ecmwf_data_portal"|"ecmwf_gcp"|"gcp_bdp"|"msc"|"nomads"
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"
precipitation_mm_1h?
Section titled “precipitation_mm_1h?”
optionalprecipitation_mm_1h:null|number
units: mm
pressure_pa_surface?
Section titled “pressure_pa_surface?”
optionalpressure_pa_surface:null|number
units: Pa
qc_status
Section titled “qc_status”qc_status:
"clean"|"flagged"|"suspect"
inline physics-bounds verdict; finer-grained QC is a later addition
relative_humidity_pct_2m?
Section titled “relative_humidity_pct_2m?”
optionalrelative_humidity_pct_2m:null|number
units: percent
retrieved_at
Section titled “retrieved_at”retrieved_at:
string
wall-clock UTC when the bytes were fetched
sea_level_pressure_pa?
Section titled “sea_level_pressure_pa?”
optionalsea_level_pressure_pa:null|number
units: Pa
station
Section titled “station”station:
string
temp_k_2m?
Section titled “temp_k_2m?”
optionaltemp_k_2m:null|number
units: K
valid_at
Section titled “valid_at”valid_at:
string
forecast target time = issued_at + forecast_hour
visibility_m?
Section titled “visibility_m?”
optionalvisibility_m:null|number
units: m
wind_gust_ms?
Section titled “wind_gust_ms?”
optionalwind_gust_ms:null|number
units: m/s
wind_u_ms_10m?
Section titled “wind_u_ms_10m?”
optionalwind_u_ms_10m:null|number
units: m/s
wind_v_ms_10m?
Section titled “wind_v_ms_10m?”
optionalwind_v_ms_10m:null|number
units: m/s
ForecastStationV1
Section titled “ForecastStationV1”Properties
Section titled “Properties”apparent_temp_c?
Section titled “apparent_temp_c?”
optionalapparent_temp_c:null|number
units: celsius
cape_jkg?
Section titled “cape_jkg?”
optionalcape_jkg:null|number
units: J/kg
cloud_cover_pct?
Section titled “cloud_cover_pct?”
optionalcloud_cover_pct:null|number
units: percent
dewpoint_c?
Section titled “dewpoint_c?”
optionaldewpoint_c:null|number
units: celsius
direct_radiation_wm2?
Section titled “direct_radiation_wm2?”
optionaldirect_radiation_wm2:null|number
units: W/m^2
forecast_hour
Section titled “forecast_hour”forecast_hour:
number
units: hours — (valid_at - issued_at).total_seconds() / 3600
freezing_level_m?
Section titled “freezing_level_m?”
optionalfreezing_level_m:null|number
units: meters
issued_at?
Section titled “issued_at?”
optionalissued_at:null|string
model run time (knowledge_time). Nullable to accommodate 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
e.g. NBE, GFS, LAV, MET, gfs_global, ecmwf_ifs025
precip_probability?
Section titled “precip_probability?”
optionalprecip_probability:null|number
units: probability — bounded [0, 1]
precipitation_mm_1h?
Section titled “precipitation_mm_1h?”
optionalprecipitation_mm_1h:null|number
units: mm
retrieved_at
Section titled “retrieved_at”retrieved_at:
string
wall-clock time the row was fetched from upstream
sea_level_pressure_hpa?
Section titled “sea_level_pressure_hpa?”
optionalsea_level_pressure_hpa:null|number
units: hPa
shortwave_radiation_wm2?
Section titled “shortwave_radiation_wm2?”
optionalshortwave_radiation_wm2:null|number
units: W/m^2
sky_cover_pct?
Section titled “sky_cover_pct?”
optionalsky_cover_pct:null|number
units: percent — bounded [0, 100]
snow_depth_m?
Section titled “snow_depth_m?”
optionalsnow_depth_m:null|number
units: meters
source
Section titled “source”source:
string
iem.archive | open_meteo.previous_runs | open_meteo.single_run | open_meteo.live
station
Section titled “station”station:
string
surface_pressure_hpa?
Section titled “surface_pressure_hpa?”
optionalsurface_pressure_hpa:null|number
units: hPa
temp_c?
Section titled “temp_c?”
optionaltemp_c:null|number
units: celsius
valid_at
Section titled “valid_at”valid_at:
string
forecast target time (event_time)
visibility_m?
Section titled “visibility_m?”
optionalvisibility_m:null|number
units: meters
weather_code?
Section titled “weather_code?”
optionalweather_code:null|number
units: WMO 4677 — WMO weather code (clear, fog, rain, snow, etc.)
wind_direction_degrees?
Section titled “wind_direction_degrees?”
optionalwind_direction_degrees:null|number
units: degrees
wind_gust_ms?
Section titled “wind_gust_ms?”
optionalwind_gust_ms:null|number
units: m/s
wind_speed_ms?
Section titled “wind_speed_ms?”
optionalwind_speed_ms:null|number
units: m/s
HttpErrorOptions
Section titled “HttpErrorOptions”Extends
Section titled “Extends”Extended by
Section titled “Extended by”Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
retryAfter?
Section titled “retryAfter?”
optionalretryAfter:null|number
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
statusCode?
Section titled “statusCode?”
optionalstatusCode:null|number
IndicatorNotYetReleasedErrorOptions
Section titled “IndicatorNotYetReleasedErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
expectedRelease?
Section titled “expectedRelease?”
optionalexpectedRelease:string|Date
The scheduled release wall-clock when known, else omitted. Accepts a tz-aware
ISO 8601 string or a Date; a Date is normalized to its ISO string (the
TS analog of Python’s expected_release.isoformat()). The payload never
fabricates a timestamp — an absent expectedRelease serializes to null.
remedy?
Section titled “remedy?”
optionalremedy:string
An optional actionable hint for how to unlock the value (e.g. that the
settlement-grade first print needs FRED_API_KEY). It has its own field,
carried in both the message body and the payload, so period stays a true
observation period and never doubles as a hint. Mirrors the Python
IndicatorNotYetReleasedError.remedy field.
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
IssuedAtMissingErrorOptions
Section titled “IssuedAtMissingErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
sampleViolations?
Section titled “sampleViolations?”
optionalsampleViolations:Record<string,unknown>[]
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
violatingCount?
Section titled “violatingCount?”
optionalviolatingCount:number
LeakageErrorOptions
Section titled “LeakageErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”asOf:
string
boundary?
Section titled “boundary?”
optionalboundary:null|string
column?
Section titled “column?”
optionalcolumn:null|string
The offending column, leak boundary, and decision-time the row must respect, plus a doc URL.
decisionTime?
Section titled “decisionTime?”
optionaldecisionTime:null|string
docUrl?
Section titled “docUrl?”
optionaldocUrl:null|string
errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
sampleViolations?
Section titled “sampleViolations?”
optionalsampleViolations:Record<string,unknown>[]
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
violatingCount
Section titled “violatingCount”violatingCount:
number
LiveThrottledErrorOptions
Section titled “LiveThrottledErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”NoLiveDataErrorOptions.errorCode
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”NoLiveDataErrorOptions.requestId
retryAfterSeconds
Section titled “retryAfterSeconds”retryAfterSeconds:
number
Seconds the caller should back off before the next live poll.
source
Section titled “source”source:
string
Inherited from
Section titled “Inherited from”station
Section titled “station”station:
string
Inherited from
Section titled “Inherited from”NoLiveDataErrorOptions.station
MostlyrightErrorOptions
Section titled “MostlyrightErrorOptions”Extended by
Section titled “Extended by”SourceUnavailableErrorOptionsDataAvailabilityErrorOptionsNwpNotAvailableErrorOptionsSchemaValidationErrorOptionsContractErrorOptionsNoDataErrorOptionsSourceMismatchErrorOptionsLeakageErrorOptionsIssuedAtMissingErrorOptionsOpenMeteoSeamlessLeakageErrorOptionsTemporalDriftErrorOptionsPayloadTooLargeErrorOptionsHttpErrorOptionsNoLiveDataErrorOptionsIndicatorNotYetReleasedErrorOptions
Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
requestId?
Section titled “requestId?”
optionalrequestId:null|string
source?
Section titled “source?”
optionalsource:null|string
NoDataErrorOptions
Section titled “NoDataErrorOptions”Extends
Section titled “Extends”Extended by
Section titled “Extended by”Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:null|string
Names which fact failed: window-empty vs entity-unknown vs source-gap.
errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
NoHazardDataErrorOptions
Section titled “NoHazardDataErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:null|string
Names which fact failed: window-empty vs entity-unknown vs source-gap.
Inherited from
Section titled “Inherited from”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”source?
Section titled “source?”
optionalsource:null|string
The route that answered. Defaults to "hazards.cache", as in Python.
Overrides
Section titled “Overrides”NoLiveDataErrorOptions
Section titled “NoLiveDataErrorOptions”Extends
Section titled “Extends”Extended by
Section titled “Extended by”Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
source
Section titled “source”source:
string
Overrides
Section titled “Overrides”MostlyrightErrorOptions.source
station
Section titled “station”station:
string
NwpNotAvailableErrorOptions
Section titled “NwpNotAvailableErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
hint:
string
Operator-actionable hint. Required (matches DataAvailabilityError contract).
model:
string
NWP model the caller asked for (e.g. "gfs", "hrrr").
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
station
Section titled “station”station:
string
Station the caller asked for (echoed back for log/error attribution).
ObservationQcV1
Section titled “ObservationQcV1”Properties
Section titled “Properties”as_of_time?
Section titled “as_of_time?”
optionalas_of_time:null|string
detector_metadata?
Section titled “detector_metadata?”
optionaldetector_metadata:null|string
JSON-serialized detector payload; shape per qc_system.
event_time_utc
Section titled “event_time_utc”event_time_utc:
string
field:
string
Observation column the rule evaluated (e.g. temp_c).
flag:
"clean"|"flagged"|"suspect"
ingestion_id?
Section titled “ingestion_id?”
optionalingestion_id:null|string
observation_type?
Section titled “observation_type?”
optionalobservation_type:null|"METAR"|"SPECI"
parser_name?
Section titled “parser_name?”
optionalparser_name:null|string
qc_system
Section titled “qc_system”qc_system:
string
qc_version
Section titled “qc_version”qc_version:
string
rule_id
Section titled “rule_id”rule_id:
string
source
Section titled “source”source:
"awc"|"ghcnh"|"iem"|"ncei"
station
Section titled “station”station:
string
ObservationV1
Section titled “ObservationV1”Properties
Section titled “Properties”dewpoint_c?
Section titled “dewpoint_c?”
optionaldewpoint_c:null|number
units: celsius — bounded
event_time_utc
Section titled “event_time_utc”event_time_utc:
string
observation valid time
observation_type
Section titled “observation_type”observation_type:
"METAR"|"SPECI"
METAR | SPECI; defaults METAR when source can’t distinguish (e.g. AWC JSON)
precipitation_mm_1h?
Section titled “precipitation_mm_1h?”
optionalprecipitation_mm_1h:null|number
units: mm — hourly precip (METAR p01i, converted from inches)
raw_metar?
Section titled “raw_metar?”
optionalraw_metar:null|string
raw METAR text if source has it; null for AWC JSON (structured-only)
sea_level_pressure_hpa?
Section titled “sea_level_pressure_hpa?”
optionalsea_level_pressure_hpa:null|number
units: hPa — sea-level pressure (canonical aviation unit, not converted across modes)
sky_base_1_m?
Section titled “sky_base_1_m?”
optionalsky_base_1_m:null|number
units: meters — first cloud layer base height (converted from feet)
sky_base_2_m?
Section titled “sky_base_2_m?”
optionalsky_base_2_m:null|number
units: meters
sky_base_3_m?
Section titled “sky_base_3_m?”
optionalsky_base_3_m:null|number
units: meters
sky_base_4_m?
Section titled “sky_base_4_m?”
optionalsky_base_4_m:null|number
units: meters
sky_cover_1?
Section titled “sky_cover_1?”
optionalsky_cover_1:null|"BKN"|"CLR"|"FEW"|"OVC"|"SCT"|"VV"
first cloud layer cover code
sky_cover_2?
Section titled “sky_cover_2?”
optionalsky_cover_2:null|"BKN"|"CLR"|"FEW"|"OVC"|"SCT"|"VV"
second layer; null if not present
sky_cover_3?
Section titled “sky_cover_3?”
optionalsky_cover_3:null|"BKN"|"CLR"|"FEW"|"OVC"|"SCT"|"VV"
third layer; null if not present
sky_cover_4?
Section titled “sky_cover_4?”
optionalsky_cover_4:null|"BKN"|"CLR"|"FEW"|"OVC"|"SCT"|"VV"
fourth layer; null if not present
station
Section titled “station”station:
string
ICAO/ASOS station ID (e.g. KORD)
temp_c?
Section titled “temp_c?”
optionaltemp_c:null|number
units: celsius — bounded TEMP_MIN_C..TEMP_MAX_C
visibility_m?
Section titled “visibility_m?”
optionalvisibility_m:null|number
units: meters — converted from statute miles
wind_direction_degrees?
Section titled “wind_direction_degrees?”
optionalwind_direction_degrees:null|number
units: degrees — 0-360, bounded
wind_gust_ms?
Section titled “wind_gust_ms?”
optionalwind_gust_ms:null|number
units: m/s — converted from kt
wind_speed_ms?
Section titled “wind_speed_ms?”
optionalwind_speed_ms:null|number
units: m/s — converted from kt
OpenMeteoSeamlessLeakageErrorOptions
Section titled “OpenMeteoSeamlessLeakageErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”
optionalasOf:null|string
endpointUrl
Section titled “endpointUrl”endpointUrl:
string
errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
model:
string
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
PayloadTooLargeErrorOptions
Section titled “PayloadTooLargeErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”acceptedModes?
Section titled “acceptedModes?”
optionalacceptedModes:string[]
declaredSize?
Section titled “declaredSize?”
optionaldeclaredSize:number
errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
limit?
Section titled “limit?”
optionallimit:number
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
Provenance
Section titled “Provenance”The provenance envelope carried by every DataResult. Keys are snake_case to serialize identically to the Python attrs vocabulary.
Properties
Section titled “Properties”data_version
Section titled “data_version”
readonlydata_version:null|string
The data/vintage version when applicable, else null.
quality_control
Section titled “quality_control”
readonlyquality_control:null|string
The quality-control disposition when applicable, else null.
retrieved_at
Section titled “retrieved_at”
readonlyretrieved_at:string
ISO-8601 UTC instant the data was retrieved.
schema_id
Section titled “schema_id”
readonlyschema_id:string
The wire schema id (mirrors Python mostlyright_schema_id).
source
Section titled “source”
readonlysource:string
The source identity tag (e.g. "merged.live_v1", "cli.archive").
QcAlphaRule
Section titled “QcAlphaRule”Properties
Section titled “Properties”bit_position
Section titled “bit_position”bit_position:
number
description
Section titled “description”description:
string
field:
string
rule_id
Section titled “rule_id”rule_id:
string
RateLimitErrorOptions
Section titled “RateLimitErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”retryAfter?
Section titled “retryAfter?”
optionalretryAfter:null|number
Overrides
Section titled “Overrides”source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”statusCode?
Section titled “statusCode?”
optionalstatusCode:null|number
Inherited from
Section titled “Inherited from”SchemaValidationErrorOptions
Section titled “SchemaValidationErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
quarantineCount?
Section titled “quarantineCount?”
optionalquarantineCount:number
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
sampleViolations?
Section titled “sampleViolations?”
optionalsampleViolations:Record<string,unknown>[]
schemaId
Section titled “schemaId”schemaId:
string
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
violations?
Section titled “violations?”
optionalviolations:Record<string,unknown>[]
SettlementCliV1
Section titled “SettlementCliV1”Properties
Section titled “Properties”cli_data_quality
Section titled “cli_data_quality”cli_data_quality:
"clean"|"flagged_instrument"|"flagged_late"|"flagged_other"|"missing"
NWS CLI data-quality marker. Allows downstream code to filter or weight settlement rows by issuer quality without re-parsing the product header.
event_time_utc
Section titled “event_time_utc”event_time_utc:
string
00:00 local time on local_standard_date converted to UTC; for sort/join only
local_standard_date
Section titled “local_standard_date”local_standard_date:
string
local climate day per NWS convention (no timezone applied to the date itself)
precipitation_in?
Section titled “precipitation_in?”
optionalprecipitation_in:null|number
units: inches
product_release_time
Section titled “product_release_time”product_release_time:
string
parsed from CLI product header (_climate.py::_parse_product_timestamp)
report_type
Section titled “report_type”report_type:
"correction"|"final"|"preliminary"
preliminary | final | correction; dedup priority preliminary < final < correction
settlement_finality
Section titled “settlement_finality”settlement_finality:
"final"|"provisional"|"superseded"
provisional | final | superseded. Kalshi NHIGH/NLOW settlement contractually requires ‘final’; ‘provisional’ values are kept for early-look research only.
snowfall_in?
Section titled “snowfall_in?”
optionalsnowfall_in:null|number
units: inches
station
Section titled “station”station:
string
ICAO/ASOS station ID
station_tz
Section titled “station_tz”station_tz:
string
IANA timezone for the station (e.g. America/Chicago for KORD). Required for local-climate-day semantics.
temp_high_f?
Section titled “temp_high_f?”
optionaltemp_high_f:null|number
units: fahrenheit — daily high
temp_low_f?
Section titled “temp_low_f?”
optionaltemp_low_f:null|number
units: fahrenheit — daily low
SourceMismatchErrorOptions
Section titled “SourceMismatchErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”catalogWarning?
Section titled “catalogWarning?”
optionalcatalogWarning:null|string
dataSource
Section titled “dataSource”dataSource:
string
errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
optionalrole:null|SourceMismatchRole
schemaSource
Section titled “schemaSource”schemaSource:
string
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
SourceUnavailableErrorOptions
Section titled “SourceUnavailableErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
httpStatus?
Section titled “httpStatus?”
optionalhttpStatus:null|number
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
retryable?
Section titled “retryable?”
optionalretryable:boolean
retryAfterS?
Section titled “retryAfterS?”
optionalretryAfterS:null|number
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
underlying?
Section titled “underlying?”
optionalunderlying:string
optionalurl:null|string
StationInfo
Section titled “StationInfo”Properties
Section titled “Properties”code:
null|string
country
Section titled “country”country:
null|string
ghcnh_id
Section titled “ghcnh_id”ghcnh_id:
null|string
icao:
string
latitude
Section titled “latitude”latitude:
null|number
longitude
Section titled “longitude”longitude:
null|number
name:
null|string
tz:
string
venues
Section titled “venues”venues: readonly
string[]
TemporalDriftErrorOptions
Section titled “TemporalDriftErrorOptions”Extends
Section titled “Extends”Properties
Section titled “Properties”assertedRange
Section titled “assertedRange”assertedRange: [
string,string]
errorCode?
Section titled “errorCode?”
optionalerrorCode:string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.errorCode
requestId?
Section titled “requestId?”
optionalrequestId:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.requestId
sampleViolations?
Section titled “sampleViolations?”
optionalsampleViolations:Record<string,unknown>[]
schemaId
Section titled “schemaId”schemaId:
string
source?
Section titled “source?”
optionalsource:null|string
Inherited from
Section titled “Inherited from”MostlyrightErrorOptions.source
violatingRows
Section titled “violatingRows”violatingRows:
number
Type Aliases
Section titled “Type Aliases”Availability
Section titled “Availability”Availability:
"python"|"typescript"
discover() availability selector — mirrors Python discover Availability.
DataAvailabilityReason
Section titled “DataAvailabilityReason”DataAvailabilityReason: typeof
DATA_AVAILABILITY_REASONS[number]
DiscoverKind
Section titled “DiscoverKind”DiscoverKind:
"source"|"label"|"dataset"
discover() kind discriminant — mirrors Python discover Kind.
Label:
"cli"|"daily_extremes"
Settlement label recipe — mirrors Python weather.training_table Label.
QcStatus
Section titled “QcStatus”QcStatus:
"clean"|"flagged"|"dropped"|"unknown"
CWOP QC verdict — mirrors Python weather.cwop.history QCStatus.
Source
Section titled “Source”Source:
"iem"|"ghcnh"|"awc"
Observation source selector — mirrors Python weather.observations Source.
SourceMismatchRole
Section titled “SourceMismatchRole”SourceMismatchRole:
"observations"|"forecasts"|"settlement"
Station
Section titled “Station”Station:
StationInfo
Variables
Section titled “Variables”CATALOG
Section titled “CATALOG”
constCATALOG:StationCatalog
Process-wide default catalog over the codegen station registry.
CITIES
Section titled “CITIES”
constCITIES:CityCatalog
Process-wide default city index over the codegen station registry.
CITY_RECORDS
Section titled “CITY_RECORDS”
constCITY_RECORDS:ReadonlyArray<CityRecord>
CLIMATE_REPORT_TYPE_PRIORITY
Section titled “CLIMATE_REPORT_TYPE_PRIORITY”
constCLIMATE_REPORT_TYPE_PRIORITY:Readonly<Record<string,number>>
DATA_AVAILABILITY_REASONS
Section titled “DATA_AVAILABILITY_REASONS”
constDATA_AVAILABILITY_REASONS: readonly ["model_unavailable","out_of_window","cache_miss","source_404","source_5xx","rate_limited"]
Shared reason enum — must match Python exactly.
DATA_RESULT_KEYS
Section titled “DATA_RESULT_KEYS”
constDATA_RESULT_KEYS: readonly keyofDataResult<unknown>[]
The exact enumerable key set of a DataResult envelope.
FORECAST_NWP_V1_SCHEMA_ID
Section titled “FORECAST_NWP_V1_SCHEMA_ID”
constFORECAST_NWP_V1_SCHEMA_ID:"schema.forecast.nwp.v1"
FORECAST_NWP_V1_SCHEMA_VERSION
Section titled “FORECAST_NWP_V1_SCHEMA_VERSION”
constFORECAST_NWP_V1_SCHEMA_VERSION:"1"
FORECAST_STATION_V1_SCHEMA_ID
Section titled “FORECAST_STATION_V1_SCHEMA_ID”
constFORECAST_STATION_V1_SCHEMA_ID:"schema.forecast.station.v1"
FORECAST_STATION_V1_SCHEMA_VERSION
Section titled “FORECAST_STATION_V1_SCHEMA_VERSION”
constFORECAST_STATION_V1_SCHEMA_VERSION:"1"
LIVE_V1_POLICY
Section titled “LIVE_V1_POLICY”
constLIVE_V1_POLICY:object
Type declaration
Section titled “Type declaration”name:
string
secondaryKey
Section titled “secondaryKey”secondaryKey:
ReadonlyArray<string>
sourcePriority
Section titled “sourcePriority”sourcePriority:
Readonly<Record<string,number>>
OBSERVATION_QC_V1_SCHEMA_ID
Section titled “OBSERVATION_QC_V1_SCHEMA_ID”
constOBSERVATION_QC_V1_SCHEMA_ID:"schema.observation.qc.v1"
OBSERVATION_QC_V1_SCHEMA_VERSION
Section titled “OBSERVATION_QC_V1_SCHEMA_VERSION”
constOBSERVATION_QC_V1_SCHEMA_VERSION:"1"
OBSERVATION_SOURCE_PRIORITY
Section titled “OBSERVATION_SOURCE_PRIORITY”
constOBSERVATION_SOURCE_PRIORITY:Readonly<Record<string,number>>
OBSERVATION_V1_SCHEMA_ID
Section titled “OBSERVATION_V1_SCHEMA_ID”
constOBSERVATION_V1_SCHEMA_ID:"schema.observation.v1"
OBSERVATION_V1_SCHEMA_VERSION
Section titled “OBSERVATION_V1_SCHEMA_VERSION”
constOBSERVATION_V1_SCHEMA_VERSION:"1"
PROVENANCE_KEYS
Section titled “PROVENANCE_KEYS”
constPROVENANCE_KEYS: readonly keyofProvenance[]
The exact enumerable key set of a Provenance — pinned by the runtime parity tests.
QC_ALPHA_RULES
Section titled “QC_ALPHA_RULES”
constQC_ALPHA_RULES:ReadonlyArray<QcAlphaRule>
QC_ALPHA_RULES_BY_ID
Section titled “QC_ALPHA_RULES_BY_ID”
constQC_ALPHA_RULES_BY_ID:ReadonlyMap<string,QcAlphaRule>
SETTLEMENT_CLI_V1_SCHEMA_ID
Section titled “SETTLEMENT_CLI_V1_SCHEMA_ID”
constSETTLEMENT_CLI_V1_SCHEMA_ID:"schema.settlement.cli.v1"
SETTLEMENT_CLI_V1_SCHEMA_VERSION
Section titled “SETTLEMENT_CLI_V1_SCHEMA_VERSION”
constSETTLEMENT_CLI_V1_SCHEMA_VERSION:"1"
STATION_BY_CODE
Section titled “STATION_BY_CODE”
constSTATION_BY_CODE:ReadonlyMap<string,StationInfo>
STATION_BY_ICAO
Section titled “STATION_BY_ICAO”
constSTATION_BY_ICAO:ReadonlyMap<string,StationInfo>
STATIONS
Section titled “STATIONS”
constSTATIONS:ReadonlyArray<StationInfo>
USER_AGENT_REPO
Section titled “USER_AGENT_REPO”
constUSER_AGENT_REPO:"https://github.com/mostlyrightmd/mostlyright-sdk"="https://github.com/mostlyrightmd/mostlyright-sdk"
The canonical SDK repository URL embedded in the User-Agent.
version
Section titled “version”
constversion:"4.1.0"="4.1.0"
Public package version; kept in lockstep with package.json (and the six-package fixed group).
Functions
Section titled “Functions”cliAvailableAt()
Section titled “cliAvailableAt()”cliAvailableAt(
dateStr,station,delayHours,tzOverride?):Date
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.
Parameters
Section titled “Parameters”dateStr
Section titled “dateStr”string
station
Section titled “station”string
delayHours
Section titled “delayHours”number = _CLI_PUBLICATION_DELAY_HOURS
tzOverride?
Section titled “tzOverride?”string
Returns
Section titled “Returns”Date
fetchWithRetry()
Section titled “fetchWithRetry()”fetchWithRetry(
url,opts):Promise<Response>
GET (or other) a URL with exponential-backoff retry semantics.
Behaviour:
signalis composed with a per-attempt timeout viaAbortController.- On retryable status (default: 429/500/502/503/504), wait
baseDelayMs * 2^attempt(with ≤25% jitter) and retry, up tomaxRetriestotal attempts. - On 404 →
NotFoundError. On 400/401/403 →ValidationError/AuthenticationError/ForbiddenError. After retry exhaustion on 429 →RateLimitError(withretryAfterhonoured). After retry exhaustion on 5xx →ServerError. - On network/transport failure: retried under the same budget, last
error rethrown as a
HttpErrorif it isn’t one already.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<Response>
localStandardDateFor()
Section titled “localStandardDateFor()”localStandardDateFor(
asOf,station,tzOverride?):string
Return the local standard date (YYYY-MM-DD LST) for a UTC moment.
Kalshi NHIGH/NLOW contracts cover midnight to midnight LOCAL STANDARD TIME. DST is ignored: the window is always fixed to the standard UTC offset.
Parameters
Section titled “Parameters”string | Date
station
Section titled “station”string
tzOverride?
Section titled “tzOverride?”string
Returns
Section titled “Returns”string
localStandardDateWindowUtc()
Section titled “localStandardDateWindowUtc()”localStandardDateWindowUtc(
dateStr,station,tzOverride?): [Date,Date]
Return UTC start/end of the local standard date window for a date. The window is midnight-midnight LST, expressed in UTC.
Parameters
Section titled “Parameters”dateStr
Section titled “dateStr”string
station
Section titled “station”string
tzOverride?
Section titled “tzOverride?”string
Returns
Section titled “Returns”[Date, Date]
makeDataResult()
Section titled “makeDataResult()”makeDataResult<
Row>(rows,provenance):DataResult<Row>
Assemble a DataResult. Every verb builds its return value here, so all of them emit an identical enumerable shape.
Type Parameters
Section titled “Type Parameters”• Row
Parameters
Section titled “Parameters”readonly Row[]
provenance
Section titled “provenance”Returns
Section titled “Returns”DataResult<Row>
marketCloseUtc()
Section titled “marketCloseUtc()”marketCloseUtc(
dateStr,station,tzOverride?):Date
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.
Parameters
Section titled “Parameters”dateStr
Section titled “dateStr”string
station
Section titled “station”string
tzOverride?
Section titled “tzOverride?”string
Returns
Section titled “Returns”Date
toJsonSafe()
Section titled “toJsonSafe()”toJsonSafe(
value,seen?):unknown
Recursively coerce value into a JSON-serializable structure.
Coercion rules (mirrors Python’s to_json_safe):
null/undefined/NaN/Infinity/-Infinity→nullDate→ ISO 8601 UTC string ending inZ- 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) }.
Parameters
Section titled “Parameters”unknown
WeakSet<object>
Returns
Section titled “Returns”unknown
userAgent()
Section titled “userAgent()”userAgent(
v):string
Build the SDK User-Agent from release metadata:
mostlyright-ts/<version> (+<repo>).
Parameters
Section titled “Parameters”string = version
the release version (defaults to the lockstep core version).
Returns
Section titled “Returns”string
References
Section titled “References”CalendarDate
Section titled “CalendarDate”Re-exports CalendarDate
DateLike
Section titled “DateLike”Re-exports DateLike
UtcInstant
Section titled “UtcInstant”Re-exports UtcInstant