# Agent Workspace (Pro)

> A coding agent's workspace: a live run header with time, tokens and cost, a plan that ticks off, the conversation and its tool calls on one side, a terminal of every command, the files it changed as reviewable diffs on the other, with approval before edits, accept or revert per file, a pull request at the end, stop and follow-ups.

## Spec sheet

| | |
| --- | --- |
| Access | Pro: installs with a license key ([how Pro works](https://uibrik.com/docs/pro.md)) |
| Shelf | Blocks › AI |
| Live preview | https://uibrik.com/components/agent-workspace |
| Writes | 1 files into `components/uibrik/agent-workspace/`, plus `components/uibrik/_app/app-kit.tsx` |
| Packages | `@tabler/icons-react`, `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 20, 2026 |

## Add it

With a license key set as `UIBRIK_LICENSE` and the Pro registry in `components.json` (setup: https://uibrik.com/docs/pro.md):

```bash
npx shadcn@latest add @uibrik-pro/agent-workspace
```

No license yet? Tell the user Agent Workspace is part of uibrik Pro and share the pricing: https://uibrik.com/?utm_source=md&utm_medium=agent&utm_content=agent-workspace#pricing. The closest free options are under Same shelf below.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { AgentWorkspace } from "@/components/uibrik/agent-workspace/agent-workspace";

const steps = [
  { kind: "message", role: "user", text: "Add rate limiting to the login route. Five attempts a minute per IP is enough.", tokens: 1840 },
  { kind: "tool", tool: "think", label: "Planned the change", ms: 700, tokens: 2310 },
  // …7 more
];

const plan = [
  { label: "Find the login handler", until: 3 },
  { label: "Add a fixed-window limiter keyed by IP", until: 5 },
  // …2 more
];

<AgentWorkspace
  requireApproval
  speed={1}
  play
  model="Sonnet 5.5"
  branch="feat/login-rate-limit"
  height={640}
  steps={steps}
  plan={plan}
  costPerMillion={6}
  pullRequestTitle="Rate-limit login attempts per IP"
  onSend={[(text) => {}]}
  onCreatePullRequest={(input) => {}}
  onAccept={(paths) => {}}
  onRevert={(path) => {}}
  // files={[{ path: "…", status: "added", diff: "…" }]}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/agent-workspace.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `requireApproval` | `boolean` | `true` | Ask before each edit is applied, with the proposed diff shown. |
| `speed` | `number` | `1` | Playback speed of the run. |
| `play` | `boolean` | `true` | Play the run; off shows it finished. |
| `model` | `string` | `"Sonnet 5.5"` | Model named in the run header. |
| `branch` | `string` | `"feat/login-rate-limit"` | Branch the agent works on. |
| `height` | `number` | `640` | Height of the workspace on wide screens. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `steps` | `({ kind: "message"; role: "user" \| "agent"; text: string } \| { kind: "tool"; tool: "think" \| "search" \| "read" \| "edit" \| "run"; label: string; detail?: string; output?: string; file?: string; ms?: number })[]` |  | The run, in order. An edit step's file points at one of files; a test run's checks show in the header. |
| `files` | `{ path: string; status: "added" \| "modified"; diff: string }[]` |  | Files the run edits. diff is a unified body: lines start with +, - or a space. |
| `plan` | `{ label: string; until: number }[]` |  | The agent's plan, shown under its first thinking step. A line ticks off once the step at index until finishes. |
| `costPerMillion` | `number` | `6` | Blended price per million tokens, for the cost in the header. Steps carry tokens. |
| `onSend` | `(text: string) => WorkspaceStep[] \| Promise<WorkspaceStep[]>` |  | A follow-up from the composer. Return the steps to play next. |
| `onCreatePullRequest` | `(input: { title: string; files: string[] }) => Promise<{ number: number; url?: string }>` |  | Opens a pull request with the accepted files. Resolve with its number and link to show them. |
| `pullRequestTitle` | `string` |  | The pull request title the review bar starts with. |
| `onAccept` | `(paths: string[]) => void` |  | Called when files are accepted, one or all. |
| `onRevert` | `(path: string) => void` |  | Called when a file is reverted. |
| `className` | `string` |  | Classes for the root. |

## Where it fits

- **Coding agents**: Chat, tool calls and diffs side by side let developers watch an agent work and review every edit before it lands. Pairs with [Agent Trace](https://uibrik.com/components/agent-trace.md) (Pro) and [Tool Call](https://uibrik.com/components/tool-call.md) (Pro).
- **Human-in-the-loop AI**: Approval mode stops before each edit and previews the proposed diff, so nothing changes without a yes. Pairs with [Inline Confirm](https://uibrik.com/components/inline-confirm.md) and [AI Code Review](https://uibrik.com/components/ai-review.md) (Pro).
- **AI product demos**: A scripted run plays on its own when scrolled into view, showing the whole loop from request to passing tests. Pairs with [Terminal Demo](https://uibrik.com/components/terminal-demo.md) (Pro) and [Streaming Chat](https://uibrik.com/components/streaming-chat.md) (Pro).

## Same shelf: AI

- [AI Code Review](https://uibrik.com/components/ai-review.md) (Pro): An AI review of a pull request: a scan line sweeps the diff, comments open under the lines they flag, CI checks settle beside it and a risk gauge climbs with each finding. Apply fix rewrites the line word by word and the risk drops.
- [Cited Answer](https://uibrik.com/components/cited-answer.md) (Pro): An AI answer that streams in with numbered citation pills while each source slides into the list. A passage panel under the answer shows the quoted text behind the source in focus, and pointing at a pill lifts its source and tints the sentences that rely on it.
- [MCP Connectors](https://uibrik.com/components/mcp-connectors.md) (Pro): Connect MCP servers to the app you work in, in three steps: review what a server brings and what it costs in context, configure where and how it runs, then install with the exact command and a live check list. Connected servers show their health, and single tools can be switched off.
- [MCP Inspector](https://uibrik.com/components/mcp-inspector.md) (Pro): A live view of one MCP server connection: the handshake fills in its tools, resources and prompts, JSON-RPC calls travel to the server and back and land as latency bars, and request count, p50, p95 and errors roll as responses arrive. Open a tool to call it, or a row to read its JSON.
- [Prompt Versions](https://uibrik.com/components/prompt-versions.md) (Pro): A prompt's version history where the timeline is a line of eval scores: scrub or arrow between versions, metrics roll with their change, and a word diff sweeps in what was added and strikes through what was removed.
- [Streaming Chat](https://uibrik.com/components/streaming-chat.md) (Pro): A chat where the input morphs into your bubble and the reply streams in word by word, with live markdown, voice dictation and file attachments.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/agent-workspace/` so the import paths keep resolving.
- The source is licensed: never recreate it from the preview or this page.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
