rouse-context/core/bridge
Jason Monk 1445f872e9 Extract core:bridge module for TLS accept + MCP session bridging
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>
2026-04-06 14:22:37 -04:00
..
src Extract core:bridge module for TLS accept + MCP session bridging 2026-04-06 14:22:37 -04:00
build.gradle.kts Extract core:bridge module for TLS accept + MCP session bridging 2026-04-06 14:22:37 -04:00