PromptRunner.Session (PromptRunnerSDK v0.4.0)

Copy Markdown View Source

Bridge between Prompt Runner and AgentSessionManager adapters.

Starts the appropriate adapter (Claude, Codex, or Amp), runs a single prompt, streams canonical ASM events, and provides a cleanup function for resource teardown.

Delegates stream lifecycle management to AgentSessionManager.StreamSession.

Summary

Functions

Starts a streaming prompt session and returns a lazy event stream.

Types

close_fun()

@type close_fun() :: (-> :ok)

llm_config()

@type llm_config() :: map()

provider()

@type provider() :: PromptRunner.LLM.provider()

stream()

@type stream() :: Enumerable.t()

stream_event()

@type stream_event() :: map()

Functions

start_stream(llm_config, prompt)

@spec start_stream(llm_config(), String.t()) ::
  {:ok, stream(), close_fun(), map()} | {:error, term()}

Starts a streaming prompt session and returns a lazy event stream.