Agent Surface
experimentalA region an agent can operate through tools — yours or a browser agent's via WebMCP — and a person can take back at any moment.
- AI
- 5 files
- No extra npm packages
- Accessibility notes
pnpm dlx @dowel-ui/cli add agent-surfaceNo npm packages are needed beyond what Dowel already requires.
import { AgentSurface } from "@/components/ui/agent-surface";Default
Held By The Agent
Agent Needs You
Browser Agents
<AgentSurface>
| Prop | Type | Default |
|---|---|---|
agentNameHow the agent is referred to in announcements and the baton. | string | "Agent" |
announceCallsAlso announce each finished call. Off: six announcements a second is noise. | boolean | false |
apiRef | Ref<AgentSurfaceApi> | — |
defaultHolder | ControlHolder | "shared" |
exposedToWith | readonly string[] | — |
holder | ControlHolder | — |
labels | Partial<AgentSurfaceLabels> | — |
namePrefixes every tool name, so two surfaces on one page cannot collide. | string | — |
onApprovalRequestAsked before any call that needs approval. Takes precedence over an | ApprovalHandler | — |
onControlChange | (change: ControlChange) => void | — |
onToolCallEvery call, each time its state changes. | (call: AgentToolCall) => void | — |
takeOverOn
| "input" | "explicit" | "input" |
webmcpExpose the tools to browser agents through WebMCP, where supported. | boolean | false |
children | ReactNode | — |
Plus every attribute of <div>.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes