# Morning brief

A good-morning widget: the day, the weather in a few words, the first meetings and steps so far. Your agent writes it each morning from the phone context; a separate job keeps the weather current.

**Sizes:** small (greeting and day), medium (greeting and first two meetings), large (everything)
**Freshness:** your agent, once each morning (cron or a scheduled task); weather from a job every 30 min
**Lock Screen:** steps on the round widget, first meeting inline

## Widget

```json
{
  "slug": "morning-brief",
  "title": "Morning brief",
  "symbol": "sun.horizon.fill",
  "accent": "#FF9F0A",
  "blocks": [
    { "type": "metric", "label": "Steps", "value": "3,420" },
    { "type": "text", "style": "title", "text": "Good morning" },
    { "type": "text", "style": "caption", "text": "Tue 28 Oct · Sunny, 26°" },
    { "type": "list", "items": ["10:00 Team standup", "14:00 Design review", "17:30 Gym"] }
  ],
  "sizes": { "small": [1, 2], "medium": [1, 3], "large": [1, 2, 3, 0] },
  "lock": { "circular": 0, "inline": "10:00 Team standup" }
}
```

Medium: the greeting (24 pt) and three meetings (60 pt) is 94 of the 100 pt budget, so there's no room for the caption there.

## Build it each morning from the phone

```javascript
const ctx = await droplet_get_phone_context();
const today = ctx.local_time.slice(0, 10);
const events = (ctx.calendar ?? []).filter((e) => e.start.startsWith(today) && !e.all_day);
const time = (iso) => iso.slice(11, 16);            // the phone's local "HH:MM"
const steps = ctx.health?.steps_today;              // missing = not shared, not zero

await droplet_set_widget({
  slug: "morning-brief",
  title: "Morning brief",
  blocks: [
    { type: "metric", label: "Steps", value: steps === undefined ? "–" : steps.toLocaleString("en-US") },
    { type: "text", style: "title", text: "Good morning" },
    { type: "text", style: "caption", text: `${dayLabel} · ${weatherWords}` },   // your own strings
    events.length
      ? { type: "list", items: events.slice(0, 6).map((e) => `${time(e.start)} ${e.title}`.slice(0, 40)) }
      : { type: "text", text: "No meetings today." },
  ],
  sizes: { small: [1, 2], medium: [1, 3], large: [1, 2, 3, 0] },
  lock: { circular: 0, inline: events[0] ? `${time(events[0].start)} ${events[0].title}`.slice(0, 20) : "No meetings" },
});
// then droplet_preview_widget { slug: "morning-brief" } and fix any warning
```

Calendar times arrive with the phone's offset (`2026-10-28T10:00:00+03:00`), so `slice(11, 16)` is the local time. The context's `calendar` covers the rest of today and tomorrow; filter to today.

## Weather from a job (a separate widget)

A job owns its widget's blocks: every run replaces them. Keep job content in its own widget.

```json
{
  "action": "schedule",
  "name": "weather-riyadh",
  "widget_slug": "weather-now",
  "every_minutes": 30,
  "fetch": { "url": "https://wttr.in/Riyadh?format=j1" },
  "values": {
    "temp": "current_condition.0.temp_C",
    "feels": "current_condition.0.FeelsLikeC",
    "desc": "current_condition.0.weatherDesc.0.value",
    "max": "weather.0.maxtempC",
    "min": "weather.0.mintempC",
    "humidity": "current_condition.0.humidity",
    "wind": "current_condition.0.windspeedKmph"
  },
  "widget": {
    "title": "Riyadh",
    "symbol": "cloud.sun.fill",
    "blocks": [
      { "type": "metric", "label": "Now", "value": "{{temp}}°" },
      { "type": "metric", "label": "Feels like", "value": "{{feels}}°" },
      { "type": "text", "style": "caption", "text": "{{desc}}" },
      { "type": "list", "items": ["High {{max}}°, low {{min}}°", "Humidity {{humidity}}%", "Wind {{wind}} km/h"] }
    ],
    "sizes": { "small": [0], "large": [0, 1, 2, 3] },
    "lock": { "circular": 0, "inline": "{{temp}}° {{desc}}" }
  }
}
```

The URL names the city, so the job doesn't follow the user when they travel. Reschedule it (same `name`) with the new city.
