agui

package
v0.218.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

README

agui

What - the AG-UI publisher: rendering a headless run's chat events as the AG-UI protocol event stream. Why - external orchestrators and desktop clients need a stable, published event schema that is not the CLI's internal chat-event type. How - Render maps agent events to AG-UI events and writes them as newline-delimited JSON; approval and question answers flow back through the channels it is given.

How it plugs in

  • infer headless --format ag-ui selects it. The browser extension bridge reuses it for its own event stream.
  • A run emits one RUN_STARTED, per-turn deltas and tool calls, then one RUN_FINISHED carrying the session stats (tokens, cost, tool calls) or one RUN_ERROR.
  • There is no domain/ subpackage: the only model it owns is the published event mapping.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentStartupEmitter

func AgentStartupEmitter(w io.Writer) func(name, state, message string, done, total int)

AgentStartupEmitter reports local A2A agent startup (image pull, container start, health check) as agent_status custom events before the run's events begin, so a client can show progress instead of silence while a multi-GB image pulls.

func EmitRunError

func EmitRunError(w io.Writer, err error)

EmitRunError writes a RUN_ERROR event for a failure that happens before the run starts (gateway down, unknown model, ...) so stdout consumers see the failure instead of silence.

func Render

func Render(events <-chan agentdomain.ChatEvent, w io.Writer, approvals <-chan ipc.ApprovalResponse, questions <-chan ipc.UserQuestionResponse, sessionID, model string, repo convdomain.ConversationRepository, jobs func() []scheddomain.TrackedJob) error

Render renders the run as newline-delimited AG-UI protocol events: one RUN_STARTED, per-turn deltas, tool calls and stats, then one terminal RUN_FINISHED or RUN_ERROR. approvals and questions broker IPC answers and jobs publishes background_tasks snapshots. ponytail: intermediate job state changes are not published, bridge the UI notifier in if a client needs them.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL