Xzero UI
Pro library

Agent tasksPro

A home for background coding agents: start a task on a repository and branch, watch each card move from queued to running to ready for review, and open a pull request from the result.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/agent-tasks
Live · keyboard ready

Pass tasks and onStart to connect your agent runner, and onCreatePullRequest for the review step; with no props it simulates a few runs.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/agent-tasks

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { AgentTasks } from "@/components/xzero/blocks/agent-tasks/agent-tasks";

export function BackgroundAgents({ tasks, repositories }) {
  return (
    <AgentTasks
      tasks={tasks}
      repositories={repositories}
      onStart={({ prompt, repo, branch, model }) => api.tasks.create({ prompt, repo, branch, model })}
      onCreatePullRequest={async task => {
        const pr = await api.tasks.openPullRequest(task.id);
        return { number: pr.number, url: pr.html_url };
      }}
      onCancel={task => api.tasks.cancel(task.id)}
      onRetry={task => api.tasks.retry(task.id)}
      onArchive={task => api.tasks.archive(task.id)}
    />
  );
}

// A running task streams its current step; a finished one carries files and checks.
const task = {
  id: "task_8f2",
  title: "Fix the flaky checkout test in CI",
  repo: "xzero-ui/web",
  branch: "fix/flaky-checkout-test",
  baseBranch: "main",
  model: "claude-opus-5-5",
  status: "running",
  startedAt: Date.parse("2026-10-20T09:14:00Z"),
  step: "Running tests",
  steps: [{ text: "Installed dependencies with pnpm", state: "done", seconds: 38 }, { text: "Running tests", state: "active" }],
};

API reference

AgentTasks

A home for background coding agents. A composer takes the task, a repository, a branch and a model; Start inserts a card at the top that moves through queued, setting up environment and running, with the live step shimmering, until it is ready for review with a diff stat, the changed file count and the checks. Create pull request turns the button into the PR number with the GitHub mark. Filter tabs with rolling counts split the list into all, running, ready for review and merged; each card expands in place to show its step log and changed files, and running tasks can be cancelled, failed or cancelled ones retried and finished ones archived with undo. Without tasks the block runs a simulated demo and says so to assistive technology.

PropTypeDefaultDescription
tasksAgentTask[]–The tasks to show, newest first. Passing it makes the list controlled: nothing is simulated, every action calls back and you update the tasks. Each task has id, title, repo, branch, model (an id from models), status, startedAt (epoch ms) and optionally baseBranch, finishedAt, step (the live line), steps, files, checks, pullRequest and error. Leave it out for the demo.
repositoriesRepository[]sampleRepositoriesRepositories for the composer as { name, branches, defaultBranch }. Picking a repository resets the branch to its default.
modelsAgentModel[]sampleModelsModels for the composer chip as { id, name, short, provider }, where provider is "anthropic", "openai" or "google" and picks the mark. The first model is the default. The sample list is Claude Opus 5.5, Claude Sonnet 5.5, Claude Fable 5.1, GPT-6.1 Sol and Gemini 4 Argon.
onStart(request: StartRequest) => void | Promise<void>–Called with { prompt, repo, branch, model } when someone presses Start or Command Enter. Reject to keep the prompt and show an inline error. In the demo it is called before the simulated run begins.
onCreatePullRequest(task: AgentTask) => PullRequest | Promise<PullRequest>–Opens a pull request for a task that is ready for review and returns { number, url?, state? }. The button shows a spinner while it runs, then morphs into "PR #number open"; with a url the result is a link. Throw to show Try again. Without it the preview simulates PR #482 onwards.
onCancel(task: AgentTask) => void–Called when someone cancels a queued, setting up or running task. In the demo the run stops and the card reads Cancelled.
onRetry(task: AgentTask) => void–Called when someone retries a failed or cancelled task. In the demo the card restarts from queued in place.
onArchive(task: AgentTask) => void–Called when someone archives a finished task. The card leaves the list right away and an Undo line stays for six seconds; undo only restores it locally, so treat archive as reversible on your side.
defaultFilter"all" | "running" | "review" | "merged""all"The filter tab shown first.
classNamestring–Class on the root element, for width or a max height with your own scrolling.

Keyboard interactions

KeysAction
TabMoves through the task field, the repository, branch and model chips, Start, the filter tabs, then each card's toggle and its actions.
Command Enter / Control EnterIn the task field, starts the task.
Enter, SpaceOn a chip, opens its menu. On a card, expands or collapses the step log and changed files. On an action, runs it.
Arrow up / Arrow downInside an open chip menu, moves between options; Enter picks one and Escape closes the menu and returns focus to the chip.
Arrow left / Arrow right, Home, EndOn the filter tabs, moves the selection.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components