Summary
Add a small, optional transport interface so Agentation can communicate with AG-UI agent runtimes without adding AG-UI dependencies to the core browser bundle.
Agentation would continue to own element selection, drawing, layout tools, markers, and its structured DOM/React/source metadata. AG-UI would provide the standardized run, message, shared-state, tool-call, progress, and human-in-the-loop layer between the toolbar and an agent runtime.
Motivation
Agentation already has the domain primitives needed for this integration:
- Structured annotation metadata
- Annotation and submit callbacks
- Optional REST/SSE synchronization
- Webhooks
- MCP tools for acknowledgement, resolution, dismissal, and replies
The current browser/server event protocol is Agentation-specific. An optional AG-UI adapter would allow Agentation to work as a frontend for AG-UI-compatible agents while preserving the existing local, webhook, REST/SSE, and MCP workflows.
AG-UI and MCP are complementary here: AG-UI connects the agent runtime to the user-facing toolbar, while MCP continues to expose annotation, repository, and coding tools to the agent.
Proposed direction
- Add an optional
AgentationTransport interface to the core package.
- Move the current REST/SSE behavior behind a legacy/default transport implementation.
- Keep the core
agentation package free of new AG-UI runtime dependencies.
- Implement AG-UI support in a separate optional package or repository, such as
agentation-ag-ui.
- Consolidate the package, MCP, and published JSON annotation schemas into one versioned contract.
Suggested AG-UI mapping:
| Agentation behavior |
AG-UI mechanism |
| Submit annotations |
RunAgentInput |
| DOM, React, source, and page metadata |
state.agentation |
| Agent responses |
TEXT_MESSAGE_* |
| Live progress |
ACTIVITY_* |
| Annotation status and thread changes |
STATE_SNAPSHOT / STATE_DELTA |
| Highlight, scroll, inspect, request selection |
Client-provided tools |
| Approval of mutating actions |
Interrupt and resume |
| Transient toolbar effects |
Namespaced CUSTOM events |
Potential frontend tools include:
agentation_inspect_element
agentation_highlight_element
agentation_scroll_to_element
agentation_request_selection
agentation_acknowledge
agentation_resolve
agentation_reply
agentation_propose_change
Read-only interactions could run automatically. Clicking, typing, form submission, or other state-changing browser actions should remain opt-in and approval-gated.
Non-goals
- Replacing Agentation's annotation UI or metadata schema
- Replacing MCP
- Adding AG-UI dependencies to the default browser bundle
- Exposing arbitrary JavaScript execution to agents
- Breaking existing props, callbacks, storage, webhook, or endpoint behavior
Acceptance criteria
Would a PR be welcome?
If this direction fits Agentation's roadmap, would the maintainers welcome a PR? We could start with the transport interface and canonical schema as a backward-compatible first PR, then keep the AG-UI adapter isolated as an optional integration.
Summary
Add a small, optional transport interface so Agentation can communicate with AG-UI agent runtimes without adding AG-UI dependencies to the core browser bundle.
Agentation would continue to own element selection, drawing, layout tools, markers, and its structured DOM/React/source metadata. AG-UI would provide the standardized run, message, shared-state, tool-call, progress, and human-in-the-loop layer between the toolbar and an agent runtime.
Motivation
Agentation already has the domain primitives needed for this integration:
The current browser/server event protocol is Agentation-specific. An optional AG-UI adapter would allow Agentation to work as a frontend for AG-UI-compatible agents while preserving the existing local, webhook, REST/SSE, and MCP workflows.
AG-UI and MCP are complementary here: AG-UI connects the agent runtime to the user-facing toolbar, while MCP continues to expose annotation, repository, and coding tools to the agent.
Proposed direction
AgentationTransportinterface to the core package.agentationpackage free of new AG-UI runtime dependencies.agentation-ag-ui.Suggested AG-UI mapping:
RunAgentInputstate.agentationTEXT_MESSAGE_*ACTIVITY_*STATE_SNAPSHOT/STATE_DELTACUSTOMeventsPotential frontend tools include:
agentation_inspect_elementagentation_highlight_elementagentation_scroll_to_elementagentation_request_selectionagentation_acknowledgeagentation_resolveagentation_replyagentation_propose_changeRead-only interactions could run automatically. Clicking, typing, form submission, or other state-changing browser actions should remain opt-in and approval-gated.
Non-goals
Acceptance criteria
RunAgentInputand consume the mandatory run lifecycle events.Would a PR be welcome?
If this direction fits Agentation's roadmap, would the maintainers welcome a PR? We could start with the transport interface and canonical schema as a backward-compatible first PR, then keep the AG-UI adapter isolated as an optional integration.