---
title: Connect eve
description: useLoomEve connects Loom's components to an eve agent and returns the LoomChat they render.
---

`useLoomEve` wraps eve's `useEveAgent` and returns a `LoomChat`: the conversation, what the agent is doing, and the commands to change it. Pass the chat to a [thread](/docs/components#thread) or any [layout](/docs/layouts).

```tsx
"use client";

import { LoomWidget } from "@/components/loom/widget";
import { useLoomEve } from "@/lib/loom/eve";

export function Assistant() {
  const chat = useLoomEve({ agent: "support" });
  return <LoomWidget chat={chat} />;
}
```

It comes with the `eve` item:

```bash
npx shadcn@latest add https://loom.mkhonta.com/r/eve.json
```

## Options

`useLoomEve` takes exactly the options of `useEveAgent` from `eve/react`, such as `agent` for a named agent, `baseUrl` for an eve server elsewhere, `auth` and `headers`, `resume` with `initialSession`, and the `onEvent`, `onFinish` and `onError` callbacks. See eve's documentation for each one.

## What it returns

| Prop | Type | Default | Description |
| - | - | - | - |
| `messages?` | `readonly LoomMessage[]` | - | The conversation. Each message has a role and its parts: text, reasoning, files, tool calls and interactions. eve's messages pass through as they are. |
| `status?` | `"idle" \| "busy" \| "resuming"` | - | Busy while a send, an answer or the agent's work is pending. Resuming while an attached session catches up; the composer disables sending. |
| `activity?` | `LoomActivity` | - | What the agent is doing right now: thinking, calling tools by name, waiting on a person, compacting, or idle. |
| `error?` | `Error \| undefined` | - | The latest failure. |
| `canCancel?` | `boolean` | - | A turn is running or waiting on a person, so it can be cancelled. |
| `send?` | `(message, options?) => Promise` | - | Sends text, or text and files. While a turn runs, `{ turnPolicy: "queue" }` waits for it and `"steer"` redirects it. `clientContext` adds context the model sees for this turn only; the composer sends mentions and slash commands this way. |
| `respond?` | `(answers) => Promise` | - | Answers open interactions: `{ interactionId, optionId?, text? }`. |
| `cancel?` | `() => Promise` | - | Cancels the active turn. |
| `newSession?` | `() => void` | - | Starts a fresh conversation. |
| `agent?` | `UseEveAgentReturn` | - | eve's full binding, for anything the kit doesn't cover: `events`, `view`, `resume`, `compact`, `end`. |

## Without eve

Components only ever see a `LoomChat`, so anything that produces one can drive them: a test, a preview, a scripted demo, or another backend. The types live in `@/lib/loom/types`.

```tsx
import type { LoomChat } from "@/lib/loom/types";

const preview: LoomChat = {
  messages: [{ id: "1", role: "user", parts: [{ type: "text", text: "Hi" }] }],
  status: "idle",
  activity: { kind: "idle" },
  error: undefined,
  canCancel: false,
  send: async () => undefined,
  respond: async () => undefined,
  cancel: async () => undefined,
  newSession: () => {},
};
```

:::tip
The demo on Loom's home page is a `LoomChat` driven by timers, rendering the same components you install.
:::
