# Mail Context Panel

> The quiet column beside a decision in an AI-first inbox: who it's about, what you owe each other, the thread so far with clickable sources, the message the ask comes from with the ask marked, files with what an agent read in them, an agent's evidence, the day's calendar for a meeting and the rule that put it in front of you. contextToMarkdown gives agents the same, mail fenced as untrusted.

- Slug: `mail-context`
- Category: [Email](https://www.assembli.design/category/email.md)
- Type: component
- Tags: email, ai, agents, context, sidebar, citations, crm
- npm dependencies: lucide-react, motion
- shadcn/ui dependencies: button, @assembli/avatar
- Live preview: https://www.assembli.design/preview/mail-context
- Page: https://www.assembli.design/components/mail-context

![Mail Context Panel preview](https://www.assembli.design/thumbnails/mail-context-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `context` (required) | `MailContextData` |  |  |
| `agents` | `MailAgent[]` | `DEFAULT_AGENTS` |  |
| `highlight` | `string` |  | A quote to mark and bring into view, e.g. when a citation elsewhere is clicked. Found in the latest message, it is marked there (the message expands if clamped); otherwise the matching summary quote … |
| `onAction` | `(action: MailAction) => void` |  | `open` (ids: [threadId]) and `cite` (index, quote), with the person as the actor. |
| `actorName` | `string` | `"You"` | The person acting, for `actor` on emitted actions. |

## 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-context/mail-context.tsx` and installs dependencies):

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

Registry item JSON: https://www.assembli.design/r/mail-context.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.
