You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: weather integration type, onWeatherGet handler and pivot format (spec B.18) (#19)
* feat: weather integration type — onWeatherGet handler and pivot format (spec B.18)
Implement the "weather" integration type shipped by Gladys (B.18,
GladysAssistant/Gladys#2738): a weather provider answers the core's
external-integration.weather.get command with the pivot weather format,
acked back as data.weather under the 15 s deadline.
- WEATHER_GET WebSocket message type, routed to the new onWeatherGet
handler ((options) => Promise<pivot weather>), auto-acked like every
command
- WEATHER_CONDITIONS and WEATHER_ALERT_SEVERITIES constants exported
(CJS + ESM), plus the core-side bounds of the pivot format
- TypeScript typings of the whole pivot format (WeatherGetOptions,
WeatherPayload, hourly/daily forecasts, CAP-style alerts)
- README: onWeatherGet handler row + a dedicated "Weather providers"
section (unit systems, condition enum, normalization bounds)
- tests: WS command acks (success, us units, failure, not implemented)
and constants, + compile-time typing checks
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BPXiFG8AQAUprvrRNCtaKF
* feat: sync the weather pivot format with Gladys — finer conditions, is_day, typed alerts
Mirror the Gladys-side extension of the B.18 pivot weather format
(GladysAssistant/Gladys#2738, follow-up commit):
- condition enum gains partly-cloudy, pouring and hail; night stays
accepted but is deprecated for providers (send the real condition
plus is_day: false — a rainy night stays rain)
- is_day optional strict boolean on the current conditions and each
hours entry, driving the day/night rendering variant
- alerts gain an optional phenomenon type (WEATHER_ALERT_TYPES: wind,
rain, flood, thunderstorm, snow, heat, cold, avalanche, coastal,
fog), exported CJS + ESM and typed; an invalid type is dropped by
the core, the alert is kept
Typings, README section and tests updated accordingly.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BPXiFG8AQAUprvrRNCtaKF
* feat: weather provider images and freshness nudge (spec B.18 points 5-6)
Mirror the latest extension of the Gladys weather type
(GladysAssistant/Gladys#2738): alert scene triggers are core-owned (zero
integration contract), but two new SDK surfaces ship with them:
- onWeatherGetImage(cb) — the core requests a provider image declared in
the pivot's new `images` metadata (<= 3 entries of { key, label? });
resolve the raw base64 of a PNG/JPEG (<= 500 KB decoded), acked as
data.image under 15 s, validated and cached 10 min by the core
- requestWeatherRefresh() — fire-and-forget freshness nudge over the new
external-integration.weather.refresh message: "re-pull me now and
re-evaluate the alert scene triggers"; no payload, no ack, rate-limited
core-side (1/min), dropped silently while disconnected
- alert description bound raised 2000 -> 5000 chars (CAP bulletins run
long), image bounds mirrored in constants
Typings (WeatherImage, images field, new message types), README (handler
and method rows + provider images / freshness nudge subsections) and
tests updated accordingly.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BPXiFG8AQAUprvrRNCtaKF
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments