mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-12-03 03:44:54 +00:00
The bridge between incoming mux streams and MCP sessions was duplicated across integration tests and would be duplicated again in the Android service. This extracts the shared logic into a new core:bridge KMP module. SessionHandler accepts a MuxStream, performs TLS server-side accept using TlsCertProvider, then bridges plaintext HTTP to a local MCP session via McpSessionFactory. TunnelSessionManager collects incoming sessions from TunnelClient and dispatches each to SessionHandler in its own coroutine. Tests cover: TLS+MCP round-trip, full tool call flow, multiple providers routed by path, OAuth device code flow, concurrent independent sessions, and error handling when no cert is available. Refactors TunnelMcpIntegrationTest to use SessionHandler instead of inline TLS accept + bridge code. Adds core:bridge as a dependency to :app and :work modules for production wiring. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| build.gradle.kts | ||