@azohra/meteo.station 0.4.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/dist/client/climatology.js +1 -1
  3. package/dist/client/history.d.ts +8 -14
  4. package/dist/client/history.js +8 -18
  5. package/dist/client/live.d.ts +2 -1
  6. package/dist/client/live.js +7 -4
  7. package/dist/client/stores.js +10 -2
  8. package/dist/climatology.d.ts +9 -4
  9. package/dist/climatology.js +28 -6
  10. package/dist/contract-climatology.d.ts +4 -0
  11. package/dist/contract-climatology.js +3 -1
  12. package/dist/contract.d.ts +7 -7
  13. package/dist/derive.js +5 -4
  14. package/dist/elements/elements/DailyPatternElement.js +4 -4
  15. package/dist/elements/elements/TrendChartElement.js +12 -31
  16. package/dist/elements/elements/WindHistoryChartElement.js +16 -35
  17. package/dist/elements/elements/atoms.d.ts +1 -1
  18. package/dist/elements/lib/pinned-cursor.js +48 -0
  19. package/dist/fixtures.d.ts +6 -2
  20. package/dist/fixtures.js +30 -2
  21. package/dist/format.js +7 -3
  22. package/dist/geometry.d.ts +2 -2
  23. package/dist/geometry.js +24 -17
  24. package/dist/index.d.ts +2 -2
  25. package/dist/index.js +2 -2
  26. package/dist/react/components/DailyPattern.js +2 -2
  27. package/dist/react/components/Dial.d.ts +1 -2
  28. package/dist/react/components/RecentSummaries.d.ts +1 -2
  29. package/dist/react/components/RecentSummaries.js +1 -2
  30. package/dist/react/components/TrendChart.js +8 -26
  31. package/dist/react/components/WindHistoryChart.js +12 -31
  32. package/dist/react/components/WindSampleStrip.js +11 -29
  33. package/dist/react/hooks/useStation.js +28 -50
  34. package/dist/react/hooks/useStationFeed.d.ts +0 -1
  35. package/dist/react/index.js +2 -2
  36. package/dist/react/lib/use-pinned-cursor.js +32 -0
  37. package/dist/samples.js +7 -43
  38. package/dist/scene/climatology-pattern.js +1 -1
  39. package/dist/scene/climatology-rose.js +1 -1
  40. package/dist/scene/daily-pattern.js +3 -3
  41. package/dist/scene/recent-summaries.js +1 -4
  42. package/dist/scene/trend.js +2 -7
  43. package/dist/scene/wind-plot.js +14 -6
  44. package/dist/server/adapters/windnerd-climatology.d.ts +5 -8
  45. package/dist/server/adapters/windnerd-climatology.js +11 -10
  46. package/dist/server/adapters/windnerd-live.d.ts +5 -8
  47. package/dist/server/adapters/windnerd-live.js +5 -8
  48. package/dist/server/adapters/windnerd.d.ts +2 -3
  49. package/dist/server/adapters/windnerd.js +4 -15
  50. package/dist/server/environment.d.ts +4 -10
  51. package/dist/server/environment.js +4 -10
  52. package/dist/server/index.d.ts +2 -2
  53. package/dist/server/index.js +2 -2
  54. package/dist/strings.d.ts +1 -1
  55. package/dist/strings.js +1 -1
  56. package/dist/windnerd.d.ts +3 -1
  57. package/dist/windnerd.js +11 -1
  58. package/package.json +3 -3
  59. package/schema/README.md +2 -2
  60. package/schema/stationclimatology.schema.json +26 -0
  61. package/styles.css +19 -21
@@ -1,11 +1,10 @@
1
1
  import { History, HistoryPoint, LiveSamples, Reading, RecentSummary, StationMeta, StationTelemetry } from "../../contract.js";
2
+ import { WindnerdRecordPeriodMinutes } from "../../windnerd.js";
2
3
  import "../environment.js";
3
4
  import { WindnerdStationConfig } from "../config.js";
4
5
  import { StationAdapter, StationAdapterOptions } from "../adapter.js";
5
6
  import { DirectionArc } from "@azohra/meteo.core";
6
7
  //#region src/server/adapters/windnerd.d.ts
7
- declare const WINDNERD_RECORD_PERIODS_MINUTES: readonly [1, 5, 10, 15, 30, 60, 180, 360];
8
- type WindnerdRecordPeriodMinutes = (typeof WINDNERD_RECORD_PERIODS_MINUTES)[number];
9
8
  declare const WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS = 3;
10
9
  type WindnerdAdapterOptions = StationAdapterOptions & {
11
10
  recordsUrl?: string;
@@ -94,4 +93,4 @@ declare function windnerdLiveSamples(records: WindnerdLiveSampleRecord[]): LiveS
94
93
  declare function windnerdEnrichedMeta(config: Pick<WindnerdStationConfig, "latitude" | "longitude" | "timeZone" | "elevationM">, location: WindnerdLiveLocation | null, broadcastDelaySeconds: number | null): Partial<StationMeta>;
95
94
  declare function parseWindnerdRecords(value: string, locationId: number, hasPressure?: boolean): WindnerdRecords;
96
95
  //#endregion
97
- export { WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WINDNERD_RECORD_PERIODS_MINUTES, WindnerdAdapterOptions, WindnerdHistoryQuery, WindnerdLiveDigest, WindnerdLiveInit, WindnerdLiveLocation, WindnerdLiveSampleRecord, WindnerdRecordPeriodMinutes, WindnerdRecords, loadWindnerdHistory, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl };
96
+ export { WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WindnerdAdapterOptions, WindnerdHistoryQuery, WindnerdLiveDigest, WindnerdLiveInit, WindnerdLiveLocation, WindnerdLiveSampleRecord, WindnerdRecords, loadWindnerdHistory, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl };
@@ -1,6 +1,6 @@
1
1
  import { emptyConditions } from "../../contract.js";
2
2
  import { isCalm, normalizeDegrees, pressureTendency, seaLevelPressureHpa } from "../../derive.js";
3
- import { windnerdStationUrl } from "../../windnerd.js";
3
+ import { WINDNERD_RECORD_PERIODS_MINUTES, windnerdStationUrl } from "../../windnerd.js";
4
4
  import { sseEvents } from "../../sse.js";
5
5
  import { coalesceUpstreamLoad, fetchUpstreamStream, fetchUpstreamText, logUpstreamFailure, resolveEnvironment } from "../environment.js";
6
6
  import { defineStationAdapter } from "../adapter.js";
@@ -9,16 +9,6 @@ import { UpstreamError } from "@azohra/meteo.core";
9
9
  const WINDNERD_RECORDS_URL = "https://windnerd.net/api/records";
10
10
  const WINDNERD_LIVE_URL = "https://windnerd.net/api/live-url";
11
11
  const RECORD_PERIOD_MINUTES = 1;
12
- const WINDNERD_RECORD_PERIODS_MINUTES = [
13
- 1,
14
- 5,
15
- 10,
16
- 15,
17
- 30,
18
- 60,
19
- 180,
20
- 360
21
- ];
22
12
  const CACHE_TTL_SECONDS = 60;
23
13
  const AGGREGATE_CACHE_TTL_SECONDS = 900;
24
14
  const LIVE_CACHE_TTL_SECONDS = 15;
@@ -366,9 +356,8 @@ async function cacheWindnerdLocation(config, environment, init) {
366
356
  };
367
357
  await environment.cache.put(`windnerd/location/${config.locationId}`, JSON.stringify(cached), LOCATION_CACHE_TTL_SECONDS);
368
358
  }
369
- /** The spot's cached location block, read through the 6-hour cache — one
370
- * live connection at most, then cache-served. Throws on a cold cache with a
371
- * dark live road; callers decide whether that degrades or fails. */
359
+ /** Cached location block (6-hour TTL). Throws on a cold cache when the
360
+ * live stream is unreachable; callers choose degrade or fail. */
372
361
  async function loadWindnerdLocation(config, environment, options = {}) {
373
362
  const cached = await environment.cache.get(`windnerd/location/${config.locationId}`);
374
363
  if (cached != null) return JSON.parse(cached);
@@ -496,4 +485,4 @@ function isRecord(value) {
496
485
  return typeof value === "object" && value !== null;
497
486
  }
498
487
  //#endregion
499
- export { WINDNERD_LIVE_INIT_TIMEOUT_MS, WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WINDNERD_RECORDS_URL, WINDNERD_RECORD_PERIODS_MINUTES, loadWindnerdHistory, loadWindnerdLocation, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl, windnerdStationMeta };
488
+ export { WINDNERD_LIVE_INIT_TIMEOUT_MS, WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WINDNERD_RECORDS_URL, loadWindnerdHistory, loadWindnerdLocation, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl, windnerdStationMeta };
@@ -48,11 +48,8 @@ type UpstreamTextRequest = {
48
48
  * in-flight load. The load owns its own cache fill; this only deduplicates.
49
49
  */
50
50
  declare function coalesceUpstreamLoad(cache: FeedCache, key: string, load: () => Promise<string>): Promise<string>;
51
- /**
52
- * The one road to an upstream document: cache lookup, bounded fetch under a
53
- * timeout, cache fill. Concurrent misses on the same (cache instance,
54
- * cacheKey) coalesce onto a single in-flight load.
55
- */
51
+ /** Cache lookup, bounded fetch under a timeout, cache fill. Concurrent
52
+ * misses on one (cache instance, cacheKey) coalesce onto a single load. */
56
53
  declare function fetchUpstreamText(environment: ResolvedEnvironment, request: UpstreamTextRequest): Promise<string>;
57
54
  type UpstreamStreamRequest = {
58
55
  url: string | URL;
@@ -63,11 +60,8 @@ type UpstreamStreamRequest = {
63
60
  signal?: AbortSignal;
64
61
  };
65
62
  declare const UPSTREAM_CONNECT_TIMEOUT_MS = 10000;
66
- /**
67
- * The road to a long-lived upstream body. No cache and no byte cap — the
68
- * consumer bounds its own buffering — and never coalesced: every caller owns
69
- * its connection and tears it down through its signal.
70
- */
63
+ /** Long-lived upstream body: no cache, no byte cap, never coalesced —
64
+ * the caller owns the connection and tears it down through its signal. */
71
65
  declare function fetchUpstreamStream(environment: ResolvedEnvironment, request: UpstreamStreamRequest): Promise<Response>;
72
66
  declare function boundedResponseText(response: Response, limitBytes: number, subject: string): Promise<string>;
73
67
  declare function logUpstreamFailure(environment: ResolvedEnvironment, message: string, error: unknown, detail?: Record<string, unknown>): void;
@@ -87,11 +87,8 @@ function coalesceUpstreamLoad(cache, key, load) {
87
87
  pending.set(key, loading);
88
88
  return loading;
89
89
  }
90
- /**
91
- * The one road to an upstream document: cache lookup, bounded fetch under a
92
- * timeout, cache fill. Concurrent misses on the same (cache instance,
93
- * cacheKey) coalesce onto a single in-flight load.
94
- */
90
+ /** Cache lookup, bounded fetch under a timeout, cache fill. Concurrent
91
+ * misses on one (cache instance, cacheKey) coalesce onto a single load. */
95
92
  async function fetchUpstreamText(environment, request) {
96
93
  const cached = await environment.cache.get(request.cacheKey);
97
94
  if (cached != null) return cached;
@@ -126,11 +123,8 @@ async function loadUpstreamText(environment, request) {
126
123
  return text;
127
124
  }
128
125
  const UPSTREAM_CONNECT_TIMEOUT_MS = 1e4;
129
- /**
130
- * The road to a long-lived upstream body. No cache and no byte cap — the
131
- * consumer bounds its own buffering — and never coalesced: every caller owns
132
- * its connection and tears it down through its signal.
133
- */
126
+ /** Long-lived upstream body: no cache, no byte cap, never coalesced —
127
+ * the caller owns the connection and tears it down through its signal. */
134
128
  async function fetchUpstreamStream(environment, request) {
135
129
  const connect = new AbortController();
136
130
  const connectTimer = setTimeout(() => connect.abort(), request.connectTimeoutMs ?? 1e4);
@@ -1,4 +1,4 @@
1
- import { normalizeWindnerdStationKey, windnerdStationUrl } from "../windnerd.js";
1
+ import { WINDNERD_RECORD_PERIODS_MINUTES, WindnerdRecordPeriodMinutes, normalizeWindnerdStationKey, windnerdStationUrl } from "../windnerd.js";
2
2
  import { DEFAULT_USER_AGENT, FeedCache, LogEvent, LogEventCode, ResolvedEnvironment, ServerEnvironment, UPSTREAM_CONNECT_TIMEOUT_MS, UPSTREAM_FAILURE_REASONS, UPSTREAM_FETCH_TIMEOUT_MS, UPSTREAM_RESPONSE_LIMIT_BYTES, UpstreamError, UpstreamErrorReason, UpstreamFailureReason, UpstreamStreamRequest, UpstreamTextRequest, boundedResponseText, coalesceUpstreamLoad, fetchUpstreamStream, fetchUpstreamText, logUpstreamFailure, memoryCache, resolveEnvironment, unavailableReasonForError, workersCache } from "./environment.js";
3
3
  import { CampbellStationConfig, CustomStationConfig, CustomStationContext, CustomStationIdentity, CustomStationLoader, EcowittStationConfig, StationConfig, StationConfigInput, TempestStationConfig, WindnerdStationConfig, campbellStationConfigSchema, customStationConfigSchema, ecowittStationConfigSchema, parseStationConfig, stationConfigSchema, tempestStationConfigSchema, windnerdStationConfigSchema } from "./config.js";
4
4
  import { StationAdapter, StationAdapterContext, StationAdapterDefinition, StationAdapterMode, StationAdapterOptions, StationAdapterResult, defineStationAdapter } from "./adapter.js";
@@ -7,7 +7,7 @@ import { StationFeedHandler, StationFeedHandlerOptions, StationFeedHandlerRoute,
7
7
  import { STATION_LIVE_SSE_HEADERS, encodeStationLiveSse } from "./live.js";
8
8
  import { WindnerdLiveOptions, openWindnerdLive } from "./adapters/windnerd-live.js";
9
9
  import { CLIMATOLOGY_DEFAULT_SECTOR_COUNT, CLIMATOLOGY_DEFAULT_YEARS, CLIMATOLOGY_RECORD_PERIOD_MINUTES, WindnerdClimatologyOptions, loadWindnerdClimatology } from "./adapters/windnerd-climatology.js";
10
- import { WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WINDNERD_RECORD_PERIODS_MINUTES, WindnerdAdapterOptions, WindnerdHistoryQuery, WindnerdLiveDigest, WindnerdLiveInit, WindnerdLiveLocation, WindnerdLiveSampleRecord, WindnerdRecordPeriodMinutes, WindnerdRecords, loadWindnerdHistory, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl } from "./adapters/windnerd.js";
10
+ import { WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WindnerdAdapterOptions, WindnerdHistoryQuery, WindnerdLiveDigest, WindnerdLiveInit, WindnerdLiveLocation, WindnerdLiveSampleRecord, WindnerdRecords, loadWindnerdHistory, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl } from "./adapters/windnerd.js";
11
11
  import { HOLOGRAM_API_BASE, HologramConnectivityConfig, HologramConnectivityOptions, TRIAL_HOLOGRAM_CACHE_TTL_SECONDS, hologramConnectivityConfigSchema, hologramServiceState, hologramTimeToIso, loadHologramConnectivity, parseHologramConnectivity } from "./hologram.js";
12
12
  import { TempestAdapterOptions, TempestObservation, loadTempestStation, parseTempestWind } from "./adapters/tempest.js";
13
13
  import { EcowittAdapterOptions, EcowittObservation, loadEcowittStation, parseEcowittRealTime } from "./adapters/ecowitt.js";
@@ -1,10 +1,10 @@
1
- import { normalizeWindnerdStationKey, windnerdStationUrl } from "../windnerd.js";
1
+ import { WINDNERD_RECORD_PERIODS_MINUTES, normalizeWindnerdStationKey, windnerdStationUrl } from "../windnerd.js";
2
2
  import { DEFAULT_USER_AGENT, UPSTREAM_CONNECT_TIMEOUT_MS, UPSTREAM_FAILURE_REASONS, UPSTREAM_FETCH_TIMEOUT_MS, UPSTREAM_RESPONSE_LIMIT_BYTES, UpstreamError, boundedResponseText, coalesceUpstreamLoad, fetchUpstreamStream, fetchUpstreamText, logUpstreamFailure, memoryCache, resolveEnvironment, unavailableReasonForError, workersCache } from "./environment.js";
3
3
  import { campbellStationConfigSchema, customStationConfigSchema, ecowittStationConfigSchema, parseStationConfig, stationConfigSchema, tempestStationConfigSchema, windnerdStationConfigSchema } from "./config.js";
4
4
  import { CAMPBELL_FIELD_CONTRACTS, loadCampbellCurrent, loadCampbellStation, naiveLocalToIso, parseCampbellCurrent, parseCampbellHistory, parseCampbellTable } from "./adapters/campbell.js";
5
5
  import { loadEcowittStation, parseEcowittRealTime } from "./adapters/ecowitt.js";
6
6
  import { loadTempestStation, parseTempestWind } from "./adapters/tempest.js";
7
- import { WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WINDNERD_RECORD_PERIODS_MINUTES, loadWindnerdHistory, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl } from "./adapters/windnerd.js";
7
+ import { WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, loadWindnerdHistory, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl } from "./adapters/windnerd.js";
8
8
  import { CLIMATOLOGY_DEFAULT_SECTOR_COUNT, CLIMATOLOGY_DEFAULT_YEARS, CLIMATOLOGY_RECORD_PERIOD_MINUTES, loadWindnerdClimatology } from "./adapters/windnerd-climatology.js";
9
9
  import { openWindnerdLive } from "./adapters/windnerd-live.js";
10
10
  import { DEFAULT_HISTORY_HOURS, StationClimatologyUnsupportedError, StationHistoryUnsupportedError, StationLiveUnsupportedError, UnknownStationError, assembleStations, loadStationClimatology, loadStationCurrent, loadStationFeed, loadStationHistory, openStationLive } from "./feed.js";
package/dist/strings.d.ts CHANGED
@@ -34,7 +34,7 @@ type StationStrings = {
34
34
  lastNightLowLabel: string;
35
35
  pressureDeltaLabel: (windowHours: number) => string;
36
36
  dailyPatternSamples: (sampleCount: number) => string;
37
- dailyPatternCoverage: (sampleCount: number, expectedCount: number) => string;
37
+ dailyPatternCoverage: (sampleCount: number, coveragePercent: number) => string;
38
38
  compassSpoken: Record<CompassPoint, string>;
39
39
  updated: {
40
40
  justNow: string;
package/dist/strings.js CHANGED
@@ -33,7 +33,7 @@ const defaultStrings = {
33
33
  lastNightLowLabel: "Last night low",
34
34
  pressureDeltaLabel: (windowHours) => `Pressure ${windowHours} h`,
35
35
  dailyPatternSamples: (sampleCount) => `${sampleCount} samples`,
36
- dailyPatternCoverage: (sampleCount, expectedCount) => `${sampleCount} samples · ${Math.round(sampleCount / Math.max(1, expectedCount) * 100)}%`,
36
+ dailyPatternCoverage: (sampleCount, coveragePercent) => `${sampleCount} samples · ${coveragePercent}%`,
37
37
  compassSpoken: {
38
38
  N: "north",
39
39
  NNE: "north-northeast",
@@ -1,5 +1,7 @@
1
1
  //#region src/windnerd.d.ts
2
+ declare const WINDNERD_RECORD_PERIODS_MINUTES: readonly [1, 5, 10, 15, 30, 60, 180, 360];
3
+ type WindnerdRecordPeriodMinutes = (typeof WINDNERD_RECORD_PERIODS_MINUTES)[number];
2
4
  declare function normalizeWindnerdStationKey(value: string | null | undefined): string | null;
3
5
  declare function windnerdStationUrl(stationKey: string): string;
4
6
  //#endregion
5
- export { normalizeWindnerdStationKey, windnerdStationUrl };
7
+ export { WINDNERD_RECORD_PERIODS_MINUTES, WindnerdRecordPeriodMinutes, normalizeWindnerdStationKey, windnerdStationUrl };
package/dist/windnerd.js CHANGED
@@ -1,6 +1,16 @@
1
1
  //#region src/windnerd.ts
2
2
  const WINDNERD_HOST = "windnerd.net";
3
3
  const WINDNERD_KEY = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
4
+ const WINDNERD_RECORD_PERIODS_MINUTES = [
5
+ 1,
6
+ 5,
7
+ 10,
8
+ 15,
9
+ 30,
10
+ 60,
11
+ 180,
12
+ 360
13
+ ];
4
14
  function normalizeWindnerdStationKey(value) {
5
15
  const candidate = value?.trim();
6
16
  if (!candidate) return null;
@@ -22,4 +32,4 @@ function windnerdStationUrl(stationKey) {
22
32
  return `https://${WINDNERD_HOST}/en/${stationKey}`;
23
33
  }
24
34
  //#endregion
25
- export { normalizeWindnerdStationKey, windnerdStationUrl };
35
+ export { WINDNERD_RECORD_PERIODS_MINUTES, normalizeWindnerdStationKey, windnerdStationUrl };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@azohra/meteo.station",
3
- "version": "0.4.2",
4
- "description": "The station capability of meteo by Azohra: live weather-station reading, derivation, and display - the wire contract, provider adapters, a polling client, a Node server, and React and custom-element display bindings.",
3
+ "version": "0.6.0",
4
+ "description": "Live weather-station reading and display. A wire contract, provider adapters, a polling client, a Node server, and byte-identical React and custom-element display bindings.",
5
5
  "keywords": [
6
6
  "weather-station",
7
7
  "wind",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "zod": "^4.0.0",
67
- "@azohra/meteo.core": "0.2.0"
67
+ "@azohra/meteo.core": "0.3.0"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react": "^18.0.0 || ^19.0.0"
package/schema/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Wire contract artifacts
2
2
 
3
3
  The station capability's wire contract in language-neutral form: JSON
4
- Schemas emitted from the zod contract (`station/contract.ts`), plus three
5
- annotated example documents. Never edited by hand — regenerate with
4
+ Schemas emitted from the zod contract (`station/contract.ts`), plus an
5
+ annotated example document beside each schema. Never edited by hand — regenerate with
6
6
  `pnpm schemas` at the workspace root, which must reproduce every file
7
7
  byte-identical (the drift guard is this package's own test suite).
8
8
 
@@ -84,6 +84,32 @@
84
84
  "minimum": 0,
85
85
  "maximum": 9007199254740991,
86
86
  "description": "Records a gapless station would have produced over the requested window — the honesty denominator; a leading dropout lowers the ratio instead of hiding."
87
+ },
88
+ "coveredSlotCount": {
89
+ "description": "Distinct (day, slot) buckets holding at least one record.",
90
+ "anyOf": [
91
+ {
92
+ "type": "integer",
93
+ "minimum": 0,
94
+ "maximum": 9007199254740991
95
+ },
96
+ {
97
+ "type": "null"
98
+ }
99
+ ]
100
+ },
101
+ "expectedSlotCount": {
102
+ "description": "Slots a gapless station would have covered over the window.",
103
+ "anyOf": [
104
+ {
105
+ "type": "integer",
106
+ "minimum": 0,
107
+ "maximum": 9007199254740991
108
+ },
109
+ {
110
+ "type": "null"
111
+ }
112
+ ]
87
113
  }
88
114
  },
89
115
  "required": [
package/styles.css CHANGED
@@ -4,7 +4,7 @@
4
4
  * - `--meteo-*` is the SHARED skin — surfaces, ink, muted text, borders,
5
5
  * grid lines, the accent, the gap hatch, typography, radius, shadow, and
6
6
  * the freshness states (live/aging/stale). Any meteo capability's
7
- * components (wind today, forecast tomorrow) wear these.
7
+ * components (wind today, forecast tomorrow) use these.
8
8
  * - `--meteo-wind-*` is genuinely wind-scoped — the lull–gust band fill, the mean
9
9
  * trace, vanes, the inspection cursor, the meteo-band-0..4 ramp, and the
10
10
  * rose's favorable/unfavorable judgment ring.
@@ -21,8 +21,7 @@
21
21
  * outranks it without specificity games.
22
22
  *
23
23
  * meteo-band-0..4 is a placeholder ramp — calm blue through green and amber to
24
- * red. What a band means (flyable, marginal, nuked) and what colour it wears
25
- * belong to the consumer. */
24
+ * red. What a band means and what colour it gets belong to the consumer. */
26
25
 
27
26
  @layer meteo {
28
27
 
@@ -94,8 +93,7 @@
94
93
  color: var(--meteo-accent, #0f7490);
95
94
  }
96
95
 
97
- /* One voice for every caption-grade label: flank labels, summary terms,
98
- * table headers. */
96
+ /* Shared style for caption-grade labels: flanks, summary terms, table headers. */
99
97
  .meteo-microlabel {
100
98
  font-size: 0.68rem;
101
99
  font-weight: 600;
@@ -151,7 +149,7 @@
151
149
  color: var(--meteo-ink, #17232e);
152
150
  }
153
151
 
154
- /* The unit hangs quieter beside the number, like the dial hub's unit line. */
152
+ /* Unit is smaller and muted beside the number, matching the dial hub. */
155
153
  .meteo-value .meteo-unit {
156
154
  font-size: 0.72em;
157
155
  font-weight: 500;
@@ -196,7 +194,7 @@
196
194
  color: var(--meteo-muted, #62717f);
197
195
  }
198
196
 
199
- /* A timestamp is context, not a reading — it speaks in the muted voice. */
197
+ /* Timestamps are context, not readings: muted. */
200
198
  .meteo-updated {
201
199
  color: var(--meteo-muted, #62717f);
202
200
  }
@@ -240,9 +238,7 @@
240
238
  box-shadow: var(--meteo-shadow, 0 1px 2px rgb(23 35 46 / 0.06), 0 8px 24px rgb(23 35 46 / 0.05));
241
239
  }
242
240
 
243
- /* Wraps rather than overflows: LULL/dial/GUST needs more width than a
244
- * narrow card can promise, and a flank spilling into whatever sits beside
245
- * the card reads as a broken layout, not a compact one. */
241
+ /* Wraps rather than overflows when LULL/dial/GUST exceeds a narrow card. */
246
242
  .meteo-current-instrument {
247
243
  display: flex;
248
244
  flex-wrap: wrap;
@@ -305,8 +301,8 @@
305
301
  stroke-linecap: butt;
306
302
  }
307
303
 
308
- /* The speed arc: the current reading's share of the dial scale, wearing the
309
- * reading's band when thresholds grade it. */
304
+ /* Speed arc: the reading's share of the dial scale, in the reading's band
305
+ * colour when thresholds grade it. */
310
306
  .meteo-wind-dial-arc {
311
307
  fill: none;
312
308
  stroke: var(--meteo-accent, #0f7490);
@@ -444,7 +440,7 @@
444
440
 
445
441
  /* Fixed minimum height so pinning and unpinning never moves the chart. The
446
442
  * daily-pattern caption is static — no pin state — but shares the line so
447
- * it never wears a different rhythm than the chart above it. */
443
+ * it keeps the same line metrics as the chart caption above it. */
448
444
  .meteo-wind-chart-readout,
449
445
  .meteo-sample-strip-readout,
450
446
  .meteo-daily-pattern-caption,
@@ -491,7 +487,7 @@
491
487
  stroke-width: 1;
492
488
  }
493
489
 
494
- /* Band zones: each band's territory tinted at a whisper behind the plot. */
490
+ /* Band zones: each band's range faintly tinted behind the plot. */
495
491
  .meteo-wind-zone {
496
492
  stroke: none;
497
493
  fill-opacity: 0.05;
@@ -503,7 +499,7 @@
503
499
  .meteo-wind-zone.meteo-band-3 { fill: var(--meteo-band-3, #e2662c); }
504
500
  .meteo-wind-zone.meteo-band-4 { fill: var(--meteo-band-4, #c22727); }
505
501
 
506
- /* Threshold guides wear the band they open. */
502
+ /* Threshold guides use the colour of the band they open. */
507
503
  .meteo-wind-threshold {
508
504
  stroke: var(--meteo-muted, #62717f);
509
505
  stroke-width: 1;
@@ -594,7 +590,7 @@
594
590
  }
595
591
 
596
592
  /* Verdict-tinted vanes, drawn only when the consumer supplied favorable
597
- * arcs; a calm cell never wears one. */
593
+ * arcs; a calm cell never gets one. */
598
594
  .meteo-wind-vane-favorable {
599
595
  stroke: var(--meteo-wind-favorable, #2e9e63);
600
596
  }
@@ -664,7 +660,7 @@
664
660
  }
665
661
 
666
662
  /* The em-dash placeholder holds the exact box the glyph would, so a station
667
- * going quiet never twitches the row's layout. */
663
+ * going empty never shifts the row's layout. */
668
664
  .meteo-sparkline-na {
669
665
  display: inline-flex;
670
666
  align-items: center;
@@ -721,7 +717,7 @@
721
717
  width: 100%;
722
718
  }
723
719
 
724
- /* The trace speaks in the mean line's voice, a step quieter — a trend is a
720
+ /* The trace uses the mean line's colour, thinner — a trend is a
725
721
  * background fact, not the wind. */
726
722
  .meteo-trend-line {
727
723
  fill: none;
@@ -844,7 +840,7 @@
844
840
  font-feature-settings: "tnum";
845
841
  }
846
842
 
847
- /* Night columns: sunset to sunrise from real astronomy, quiet gray under
843
+ /* Night columns: sunset to sunrise, low-opacity gray under
848
844
  * every data layer. */
849
845
  .meteo-night {
850
846
  fill: var(--meteo-muted, #62717f);
@@ -1256,7 +1252,7 @@
1256
1252
  padding-top: 0.5rem;
1257
1253
  }
1258
1254
 
1259
- /* Row labels speak in the shared micro-label voice; the unit hangs off the
1255
+ /* Row labels use the shared micro-label style; the unit follows the
1260
1256
  * label so cells hold bare numbers. */
1261
1257
  .meteo-air-label {
1262
1258
  font-size: 0.78rem;
@@ -1293,8 +1289,10 @@
1293
1289
  * keeps the unavailable arm the same height as a reading. */
1294
1290
  .meteo-strip {
1295
1291
  display: flex;
1292
+ /* Wrap rather than clip when the column is narrower than the cells. */
1293
+ flex-wrap: wrap;
1296
1294
  align-items: center;
1297
- gap: 1.1rem;
1295
+ gap: 0.15rem 1.1rem;
1298
1296
  min-height: 2.6rem;
1299
1297
  padding: 0.4rem 0.9rem;
1300
1298
  font-family: var(--meteo-font, ui-sans-serif, system-ui, sans-serif);