feat(agent): WebSocket + JSON-RPC API gateway (Wave 5, Track C)#1385
Merged
feat(agent): WebSocket + JSON-RPC API gateway (Wave 5, Track C)#1385
Conversation
added 2 commits
April 1, 2026 11:06
Add Bandit + WebSock deps and build the API gateway that exposes MingaAgent.Runtime to external clients via WebSocket + JSON-RPC 2.0. New modules: - MingaAgent.Runtime: public facade unifying SessionManager, Tool.Registry, Tool.Executor, and Introspection into one entry point - MingaAgent.Introspection: runtime self-description (capabilities, tool descriptions, session descriptions) for external client discovery - MingaAgent.Gateway.Server: GenServer owning the Bandit HTTP/WS listener - MingaAgent.Gateway.Router: Plug router (/ws upgrade, /health probe) - MingaAgent.Gateway.WebSocket: WebSock handler dispatching JSON-RPC - MingaAgent.Gateway.JsonRpc: pure dispatch (decode, call Runtime, encode) - MingaAgent.Gateway.EventStream: domain event subscription + JSON-RPC notification formatting for push delivery Gateway starts on-demand via MingaAgent.Runtime.start_gateway/1 or Minga.Runtime.start(gateway: true). Never starts in editor mode. Default port 4820, configurable. All dispatch routes through Runtime facade. Domain events (not rendered state) are pushed to clients. Covers plan items C-5.1 (deps), C-5.2 (gateway modules), C-5.3 (wiring). 34 new tests including WebSocket integration test.
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.
What
WebSocket + JSON-RPC gateway exposing
MingaAgent.Runtimeto external clients. Uses Bandit + WebSock (~5 new deps, all pure Elixir). No Phoenix.Plan reference
docs/PLAN-runtime-first.mdWave 5 Track C (PRs C-5.1, C-5.2, C-5.3).New modules
MingaAgent.RuntimeMingaAgent.IntrospectionMingaAgent.Gateway.ServerMingaAgent.Gateway.Router/wsupgrade,/healthprobeMingaAgent.Gateway.WebSocketMingaAgent.Gateway.JsonRpcMingaAgent.Gateway.EventStreamKey design decisions
MingaAgent.Runtime.start_gateway/1orMinga.Runtime.start(gateway: true).agent_session_stopped,log_message), not rendered state or chrome opcodes.Testing
34 new tests:
Verification
No Layer 1 to Layer 2 boundary violations in any new code.