# Eve

Render an Eve conversation and respond when a turn needs human input.

## Connect an Eve session

[Install Ghost UI and its view dependencies](/libraries/ai#installation), then add the Eve release candidate used here.

```bash
npm install eve@1.0.0-rc.0
```

Configure Eve using its [server and framework setup](https://github.com/vercel/eve). Mount a new keyed hook when replacing the session or connection settings. Eve 0.x uses a different event format.

```tsx
import { useState } from "react";
import { Button } from "@collectivecreation/ghost-ui/components/button";
import { useEveAgent, type UseEveAgentOptions } from "eve/react";
import { activeTurn } from "eve/events";
import { createEveAdapter } from "@collectivecreation/ghost-ui/chat-adapter-eve";
import { useChatAdapter } from "@collectivecreation/ghost-ui/chat-runtime-react";
import { Message, MessageBody } from "@collectivecreation/ghost-ui/components/message";
import { MessageParts } from "@collectivecreation/ghost-ui/components/message-parts";
const adapter = createEveAdapter();
export function EveConversation({ options, threadId, revision }: {
  options: UseEveAgentOptions; threadId: string; revision: number;
}) {
  const eve = useEveAgent(options);
  const runtime = useChatAdapter(adapter, { ...eve, canCancel: !!activeTurn(eve.view) }, {
    identity: { threadId, revision },
  });
  const [error, setError] = useState<unknown>();
  return <>
    {runtime.messages.map(message => <Message key={message.id} actor={message.actor}><MessageBody>
      <MessageParts parts={message.parts} />
    </MessageBody></Message>)}
    <Button disabled={runtime.capabilities.send.support !== "supported" || !runtime.capabilities.send.available}
      onClick={() => { setError(undefined); void Promise.resolve().then(() => runtime.controller.send({ text: "Review the brief", attachments: [] })).catch(setError); }}>Review brief</Button>
    {runtime.capabilities.stop.support === "supported" && runtime.capabilities.stop.available &&
      <Button onClick={() => { void Promise.resolve().then(() => runtime.controller.stop?.()).catch(setError); }}>Stop</Button>}
    {(error || runtime.controller.error) ? <p role="alert">The request could not complete.</p> : null}
  </>;
}

```

Pass { agent: "support" } for a named same-origin agent, or { baseUrl: "/api" } for your proxy; do not combine them. The identity must name the application/native session context, not a display label. Keep native session lifecycle in the owner that supplies these options.

## Acceptance, completion and human input

send() resolves when Eve accepts delivery. Follow the native event log to tell when work finishes. Use Eve’s follow or resume APIs to recover progress. A turn paused for human input may report idle. Ghost reads canCancel from activeTurn(eve.view) to decide whether Stop is available.

```tsx
import type { UseEveAgentReturn } from "eve/react";
export function answerInteraction(eve: UseEveAgentReturn, interactionId: string, optionId: string) {
  return eve.respond([{ interactionId, optionId }]);
}

```

Interaction parts remain explicit eve-interaction data, separate from tool execution. Render their validated options in your application and send the actual native answer. Approval, clarification and a tool result have different payloads; do not manufacture a boolean approval from an arbitrary interaction.

## Troubleshooting

A successful send with unfinished work may be an accepted delivery; inspect the native view rather than marking execution complete. A disabled stop may mean there is no active turn. A changed baseUrl or session option needs a replacement owner, not only new props. See [threads](/libraries/ai-threads), [adapters](/libraries/ai-adapters) and [stability](/libraries/ai-stability) for the shared contracts.
