Conversation
Add A2UI.Server, A2UI.Socket, A2UI.Endpoint, and A2UI.SurfaceProvider behaviour so applications can serve interactive A2UI surfaces over WebSocket from any OTP supervision tree. - SurfaceProvider behaviour: init/1, surface/1, handle_action/2 - WebSock handler bridging frames to provider callbacks - Plug endpoint routing /ws (upgrade), / (debug renderer) - OTP-compatible server wrapper with child_spec - Self-contained debug renderer page (priv/static/index.html) - Integration tests with real WebSocket via :gun - 67 tests (24 new), all passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A2UI.Server— Bandit-based HTTP + WebSocket endpoint, embeddable in any OTP supervision treeA2UI.SurfaceProviderbehaviour — applications implementinit/1,surface/1, andhandle_action/2to define surfaces and handle user actionsA2UI.Socket(WebSock handler) andA2UI.Endpoint(Plug routing) as internal infrastructurepriv/static/index.html) — renders Text, Button, Card, Row, Column, CheckBox, Divider; shows message log; auto-reconnectsdemo_server.exs— runmix run demo_server.exs, openhttp://localhost:4000New dependencies
bandit(~> 1.0) — pure Elixir HTTP serverwebsock_adapter(~> 0.5) — WebSocket upgrade adaptergun(~> 2.1, test-only) — WebSocket client for integration testsTest plan
mix cipasses (format check + compile warnings-as-errors + 67 tests)mix run demo_server.exsstarts server, open http://localhost:4000 in browser🤖 Generated with Claude Code