UnifiedInvocationHandler

Unified handler for invocation requests — single entry point for all input/output shapes.

The plugin auto-dispatches the request body into an InvocationInput variant by Content-Type and size. The handler returns an InvocationResult variant which the plugin maps to the correct HTTP response (text, binary, SSE stream, or chunked binary).

Coroutine context warning for streaming results: when constructing InvocationResult.TextStream / InvocationResult.BinaryStream from a callback-style SDK (e.g. AWS Bedrock's converseStream, whose collector runs in its own coroutine context), use streamingFlow / streamingBytesFlow rather than flow { emit() } — the strict flow {} builder will throw IllegalStateException: Flow invariant is violated when emit and collect happen in different contexts.