class LittleGhost::AGUI::Adapter

Adapter turns a LittleGhost stream into AG-UI event hashes. It lets a Ruby agent drive compatible chat interfaces without changing the agent itself.

events = CustomerSupportAgent.new.stream_ask("Where is my order?")
adapter = LittleGhost::AGUI::Adapter.new
adapter.stream(events, thread_id: "thread-1", run_id: "run-1").each do |event|
  websocket.write(JSON.generate(event))
end

The adapter has no state between stream calls, so one instance can translate independent runs.

Security and trust

Provider plaintext reasoning becomes AG-UI reasoning events. Tool arguments and results, invocation metadata, subagent events, trace context, and selected error text also pass through without redaction. Authorize and filter the complete stream before transport, and send it only to an interface trusted to display that data. Encrypted reasoning and provider continuity artifacts are never exposed here.