# Mail Thread

> An email reading pane for people and agents. An agent brief tops the thread: summary, decisions, open questions and action items, each citing its source. Click a citation to jump to the exact sentence. Older messages fold to one line, attachments show a fact read from the file, and the Agent view shows the Markdown a model receives, bodies fenced as untrusted.

- Slug: `mail-thread`
- Category: [Email](https://www.assembli.design/category/email.md)
- Type: block
- Tags: email, mail, thread, summary, citations, agents, ai
- npm dependencies: lucide-react, motion
- shadcn/ui dependencies: button, dropdown-menu, @assembli/actions-menu, @assembli/avatar, @assembli/classic-checkbox, @assembli/copy-button, @assembli/tooltip
- Live preview: https://www.assembli.design/preview/mail-thread
- Page: https://www.assembli.design/components/mail-thread

![Mail Thread preview](https://www.assembli.design/thumbnails/mail-thread-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `thread` (required) | `MailThreadData` |  |  |
| `brief` | `ThreadBrief` |  |  |
| `onAction` | `(action: MailAction) => void` |  |  |
| `agents` | `MailAgent[]` | `DEFAULT_AGENTS` |  |
| `me` | `Person` | `ME` | The signed-in person; shown as "me" and used as the actor for clicks. |
| `defaultLens` | `"read" \| "agent"` | `"read"` | Start in the agent view. |
| `draft` | `{ by: string }` |  | An agent has a reply drafted: the Reply button reads "Review draft" and names it. `by` is an agent id. |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/mail-thread/mail-thread.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/mail-thread
```

Registry item JSON: https://www.assembli.design/r/mail-thread.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
