Skip to content

Agent Cursors

Agents editing a document like teammates in a shared editor: live pointers with names, what they are doing and what they spent, suggestions typed in as tracked changes, images they resize, code they fix and comments beside the page.

On this page
Used for
  • Agents editing a doc
  • Review tracked changes
  • Accept all suggestions
  • Co-edit a table
  • Show who is where

Examples

Installation

npx knowns-ui@latest add agent-cursors
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Agents work in your document the way teammates do in a shared editor. Each has a pointer in its own colour with its name, what it is doing and what it has spent. Text changes arrive letter by letter as tracked suggestions: the old words struck through, the new ones underlined in the agent's colour, with a bar in the margin beside the block. Images get resize handles and a live size, code blocks are edited like text, and comments land in the rail beside the page with a typing indicator while they are written.

Hover or focus a suggestion to accept or reject it; with the keyboard, Tab to it and press Enter to accept or Delete to reject. Accept all takes every open suggestion. Screen readers hear each suggestion as a sentence ("Fact-checker suggests: replace 10,000 with 50,000"); the pointers are decorative and hidden from them. Pointers move with transforms only and stop when the component is offscreen. With reduced motion, pointers sit at their targets and changes appear whole. Below 760px the comments move under their blocks.

Props

run
AgentRun
Agents with label, model, spend, state and activity. Each gets a colour from the house palette, ordered so pointers next to each other differ.
actors
Actor[]
Default[]
Plain data instead of a run.
doc
CursorDoc
{ path?, blocks }. Blocks: heading (level 1 or 2), paragraph, bullet, code, image { alt, width, height, src?, caption? }.
table
CursorTable
{ columns, rows: { id, cells }[] } adds a Table tab. Cell ids are row.id + ":" + column index.
suggestions
Suggestion[]
Default[]
Text: { id, agentId, blockId, range: [start, end], insert } on the original text. Resize: { id, agentId, blockId, kind: "resize", width }.
comments
CursorComment[]
Default[]
{ id, agentId, blockId, text, at? }, shown in the rail beside their block.
presence
Record<agentId, Presence>
Default{}
{ target?, action?, away? }. target is a block, cell, suggestion or comment id. While an agent types, its pointer follows the caret.
onAccept / onReject
(s) => void
A suggestion was accepted or rejected. The view applies it with a short highlight; update your document to keep it.
onAcceptAll
(accepted) => void
Accept all, with the suggestions it took.
tab / defaultTab / onTabChange
"doc" | "table"
Default"doc"
Controlled or uncontrolled tab.
typing
boolean
Defaulttrue
Type changes in letter by letter. Off (or reduced motion) shows them whole.
typeSpeed
number
Default34
ms per character.

What it handles

  1. 01Draws a coloured pointer for each agent with its name, current action and spend, placed on the block or cell named in presence.
  2. 02Types suggestions and comments in letter by letter at typeSpeed ms per character, 34 by default, or shows them whole with typing off.
  3. 03Marks a suggestion as a tracked change that you accept or reject by button, or with Enter and Delete or Backspace on the focused change.
  4. 04Accepts everything at once with Accept all and calls onAcceptAll with the suggestions it accepted.
  5. 05Handles image resize and code edits as suggestions too, with a stand-in picture that scales while an agent resizes the block.
  6. 06Adds a Table tab through the table prop so the same agents edit cells, and an agent marked away fades to grey.

States

First render
Nothing. Blocks and pointers paint as they are
none
A suggestion lands
Its highlight fades from a tint to the plain colour
280ms, ease out
Pointer moves
It follows its target frame by frame
none
Agent goes away
Its avatar fades and loses colour
180ms, ease out
Switch to Table tab
Rows fade in and settle
280ms, ease in-out
Typing dots
Three dots pulse while an agent types
none
Reduced motion
Suggestions appear whole, with no typing
0ms

Works with

When to use

When to use

  • Agents that edit a document, spec or table while people watch, where it matters who changed what.
  • Keeping every agent edit as a suggestion until a person accepts it, one by one or all at once.
  • Showing several agents at work in one place, each with its own colour, task and spend.

When not to use

  • A plain before and after of one file or a code change: use Inline Diff.
  • Following when each call ran and how long it took: use Trace Waterfall.
  • Agents that never touch a shared document: show their progress instead: use Agent Lanes.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Agent Cursors to my app and wire it to my own data.
  • I need agents that edit a document, spec or table while people watch, where it matters who changed what. Set that up with the Knowns UI Agent Cursors.
  • Which Agent Cursors props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "agent-cursors" }) and search_docs({ query: "agent cursors" }).

Need help?

Stuck on Agent Cursors, or found something off? We read every message.