# While you slept

*What your agents finished overnight, and the one thing that needs you.*

**Type: [Glance](types/glance.md).** One thing worth knowing right now, at a glance. This is one good use of it; the same widget serves your day, what's useful where you are, flight or train status, what your agents did overnight and more. Switch the subject when something else matters more.

Template id `overnight` · Informative · uses nothing on the phone · for: Agents running on a schedule (routines, cron, CI bots).

## Goal

The user starts the day knowing what their agents did, without reading any logs.

## When to offer it

The user runs agents or jobs on a schedule.

## What the user gets

- Sums up what your scheduled agents did
- Leads with the one thing that needs a decision
- Stays quiet when everything went fine

## What each size shows

- **Small**: metric: Finished = 4.
- **Medium**: metric: Finished = 4; text (body): "Nightly tests green. 1 needs you: PR #218."; buttons: Show me (`show`), All good (`clear`).
- **Large**: metric: Finished = 4; text (body): "Nightly tests green. 1 needs you: PR #218."; buttons: Show me (`show`), All good (`clear`); list: Last night (3 rows).
- **Lock Screen**: inline "4 done, 1 needs you".

## Make it theirs

**Look.** Send `look` instead of `theme` and `accent`; every combination is designed to read well:

- `style`: `glass` (default: see-through, adapts to dark mode), `soft` (a calm pale tint) or `bold` (a vivid gradient with dark buttons).
- `accent`: blue, indigo, purple, pink, red, orange, green, teal, graphite, or a hex.
- `font`: default, rounded, serif or mono.

This template's own accent is **indigo**. To restyle a widget you already saved, send only the look:

```json
{"slug": "overnight", "look": {"style": "bold", "accent": "indigo", "font": "rounded"}}
```

Preview a look without saving: `droplet_preview_widget` with the slug and `look`. When the user says "make it greener", "calmer" or "bolder", change the look; keep the content.

**Their choices.** Ask once (droplet_ask) or use what you know:

- Which jobs to include
- What time to report

**Search words:** overnight, morning, summary, report, scheduled, routine, nightly, cron, digest.


## Before you build

- You need: Agents running on a schedule (routines, cron, CI bots).
- Ask once: Nothing here: this moment only reports.

## Fill it with real data

Start from the template (`droplet_library` with `id: "overnight"`), keep the design, and replace each sample value:

| Block | Real value |
|---|---|
| 0 · metric | How many things finished. |
| 1 · text | The state in a line, and what needs them. |
| 2 · buttons | Show me opens what needs them; All good clears it. |
| 3 · list | What ran, with real results. |

Sources:
- The runs of your scheduled jobs since last night, with their real results.
- Anything that failed or is waiting on the user.

## The widget

Sample values; send it with `droplet_set_widget` on your widget's slug (or a new slug with `new_widget: true` if the user asked for a separate widget). Preview it and fix every warning first.

```json
{
  "slug": "overnight",
  "title": "While you slept",
  "symbol": "moon.stars.fill",
  "accent": "#5E5CE6",
  "blocks": [
    {"type": "metric", "label": "Finished", "value": "4"},
    {"type": "text", "text": "Nightly tests green. 1 needs you: PR #218.", "style": "body"},
    {"type": "buttons", "items": [{"id": "show", "label": "Show me", "symbol": "arrow.right.circle.fill"}, {"id": "clear", "label": "All good", "symbol": "checkmark"}]},
    {"type": "list", "title": "Last night", "items": [{"title": "Dependency updates merged", "detail": "3"}, {"title": "Nightly tests", "detail": "passed"}, {"title": "PR #218 needs a decision", "detail": "open"}]}
  ],
  "sizes": {"medium": [0, 1, 2], "large": [0, 1, 2, 3]},
  "lock": {"inline": "4 done, 1 needs you", "circular": 0}
}
```

## Keep it fresh

Once each morning, from your scheduled run. Clear it when they tap.

## Handle the taps

Each tap reaches you once on `droplet_get_events` (keep a waker running, SKILL.md Process C). Answer within seconds by updating the widget.

**Show me** (`show`)

```json
{"widget": "overnight", "kind": "button", "target": "show", "value": {"label": "Show me"}}
```

Turn the widget into the moment that needs them (PR review, Your call, Approvals).

**All good** (`clear`)

```json
{"widget": "overnight", "kind": "button", "target": "clear", "value": {"label": "All good"}}
```

Go back to the widget's normal state.

## Ask first

Nothing here: this moment only reports.

For example:

```json
null
```

## Phone actions

None. The morning is not worth a buzz unless something is broken.

## Edge cases

- Nothing ran: say so plainly, because that may be the problem.
- Everything's fine and nothing needs them: keep it small, or show nothing.

## Never

Never report work you didn't verify finished.

## Done when

- [ ] Every sample value is replaced with real data (no "Dr. Lee" on a real widget).
- [ ] `droplet_preview_widget` shows no warnings at the sizes the user placed (`placed` in `droplet_whoami`).
- [ ] Every button has a handler and a waker is running.
- [ ] Refresh is set up as above.
- [ ] You told the user in one line what it does on its own and what it asks first.

## Same widget, other uses

- [Your day](day-brief.md): What you need to know, changing through the day: how you slept, what's first, what's left.
- [Here and now](here-now.md): What's useful where you are: your meetings at work, what's nearby when you're out, tomorrow when you're home.
- [Travel day](travel-day.md): Flight, gate, when to leave and the ride, as one live widget.
- [Usage spike](usage-spike.md): A bill is about to jump. Your agent found out why and how to stop it.
