Loading component…
Loading component…
A codebase as a treemap with coding agents working on it – every file a tile as large as its lines, each agent hopping from file to file and coloring what it edits
To reuse this local React demo, copy all files from the Code tab into the same folder, then import RepoMap from ./repo-map.
import { RepoMap, type RepoAgent, type RepoFile } from "@/components/ui/repo-map";
const files: RepoFile[] = [
{ path: "src/lib/auth.ts", lines: 320, edits: [{ agent: "auth", added: 64, removed: 12 }] },
{ path: "src/lib/session.ts", lines: 240 },
{ path: "src/components/LoginForm.tsx", lines: 210 },
{ path: "tests/auth.test.ts", lines: 230 },
];
const agents: RepoAgent[] = [
{ id: "auth", name: "Auth agent", file: "src/lib/session.ts", action: "edit", task: "Adding token refresh" },
{ id: "tests", name: "Test agent", file: "tests/auth.test.ts", action: "read" },
];
export function Workspace() {
return <RepoMap title="acme/web" branch="feat/token-refresh" files={files} agents={agents} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| files | RepoFile[] | Every file – { path, lines, edits? }. The folder in its path groups it, its lines are its area; a path given twice shows once | |
| edits | { agent, added?, removed? }[] | Per file, oldest first – who changed it and how much. The last one's agent tints the file; the tile shows +added −removed | |
| agents | RepoAgent[] | The agents – { id, name, color?, file?, action?, task? }. Each is its pixel mark in a color of the palette (blue when it works alone), sitting on the file it is at | |
| action | "edit" \| "read" | Per agent – edit (default) fills the file with its color and runs a sheen over it; read gives it a dashed edge. Two agents editing one file make it blink orange | |
| title / branch | string | The repo's name and its branch, in the bar | |
| depth | number | How many folder levels group the files – 2 by default (src/components, src/lib …) | |
| className | string | Extra class on the root – set the color variables on it, e.g. --ui-rpm-height |
The map keeps its height and lays the files out again for any width – a file's name and its count show while there's room
Narrow: a taller map, the count on its own line, the agents wrap
Long paths and names end in … with the full text on hover and in the file's card
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"