NAME

Langertha::Knarr::Protocol::AGUI - AG-UI (Agent-UI) event protocol for Knarr

VERSION

version 1.103

DESCRIPTION

Implements the CopilotKit AG-UI agent-to-UI event protocol on top of Langertha::Knarr::Protocol. Loaded by default.

  • POST /awp — Agent Wire Protocol endpoint, always streaming

Streaming emits the typed AG-UI event sequence: RUN_STARTED, TEXT_MESSAGE_START, TEXT_MESSAGE_CONTENT×N, TEXT_MESSAGE_END, RUN_FINISHED. Sync mode synthesizes the same sequence into a single response body for non-streaming clients.

format_stream_error

my $bytes = $proto->format_stream_error( 500, 'boom' );

AG-UI's RUN_ERROR event (message, code); it takes the place of RUN_FINISHED.

format_error_response

my ($status, $headers, $body) = $proto->format_error_response( 500, 'boom' );

An error before the stream started: AG-UI defines no error body of its own, only the RUN_ERROR event, so the body is that event as plain JSON (application/json, the HTTP status kept) -- the same object the stream sends as an SSE frame once it has started.

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha-knarr/issues.

IRC

Join #langertha on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.