Skip to main content
Wiring your own loop gives you control. Sometimes you would rather hand over a task and get the finished edits back. revise_run_agent delegates to Revise’s native multi-turn agent — the same loop that runs in the Revise product — which plans, reads, and edits until the task is done.

Configure a backend

Per-document configuration overrides the editor-wide default:
The agent backend is the one network dependency in the SDK, and it is entirely yours. The wire protocol is a small HTTP/SSE contract implemented by the public Go package agentcore, so you can run it yourself rather than calling Revise.

Running a task

It is also callable as a tool, so a supervising model can delegate to it the same way it calls anything else:

Streaming, steering, cancelling

steer() injects guidance into a run already in flight rather than queueing a new turn — the difference between correcting the model mid-task and waiting for it to finish doing the wrong thing. The same events are available as a component callback:

Custom transport

To route turns through your own infrastructure — your gateway, your logging, your model — supply a transport instead of a URL:
The editor keeps its tool runtime, tracked changes, and review behaviour; only the model call is yours.

Visual page inspection

The delegated browser agent can call its internal render_document_pages tool when a task requires visual QA. It renders bounded appearance contact sheets or detailed layout diagnostics from the mounted editor canvas, so the agent can inspect pagination, tables, images, math, headers, and footers as the user sees them. This is deliberately not part of editor.tools.getDefinitions(): that public catalogue is the deterministic document-local contract shared with the Node backend, while page rendering requires a mounted browser canvas. Delegate the task with editor.agent.run() or revise_run_agent; the SDK routes the internal render call automatically.

Suggestions by default

Delegated runs respect the document mode: in suggesting, everything the agent does arrives as tracked changes for a human to accept or reject. Pass directMode in the run options to apply edits outright, and every nested tool call in that run inherits it.