PublisherRunner
Java-friendly wrapper around a Runner. A run is exposed as a Reactive Streams Publisher of events, so Java callers never touch Flow; collect it with AsyncJavaHelpers.collect/forEach or any Reactive Streams consumer. Session management is not a runner concern: to call the session service from Java, create it wrapped in a CompletableFutureSessionService and build the runner with the wrapper's asKotlinSessionService().
Functions
The wrapped engine runner, for code that has dropped into Kotlin.
Rewinds the session to before rewindBeforeInvocationId; see Runner.rewindAsync. The returned future completes once the rewind has been applied. The rewind runs in the caller's OpenTelemetry context and in coroutineContext, as in runAsync.
Runs the agent, streaming its events; set invocationId to resume an interrupted invocation. The run, including tool calls and the subscriber's onNext, executes on Dispatchers.IO in the OpenTelemetry context current at this call, with coroutineContext added: pass MDCContext() from kotlinx-coroutines-slf4j to carry the caller's MDC, or a dispatcher to use instead of IO. A Job in coroutineContext has no effect, so cancel the run through its subscription.
Experimental: runs the root agent or node live, streaming the whole run's events (see Runner.runLive). Each subscription starts its own run, which ends as Runner.runLive describes, and a second one reading the same queue at once fails; cancelling the subscription closes any connection and leaves the queue open. As in runAsync, the run and onNext execute on Dispatchers.IO, not on the thread that sends to the queue, in the OpenTelemetry context current at this call, with coroutineContext added; hand slow work in onNext to your own executor.