# `PromptRunner.Session`
[🔗](https://github.com/nshkrdotcom/prompt_runner_sdk/blob/v0.4.0/lib/prompt_runner/session.ex#L1)

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`.

# `close_fun`

```elixir
@type close_fun() :: (-&gt; :ok)
```

# `llm_config`

```elixir
@type llm_config() :: map()
```

# `provider`

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

# `stream`

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

# `stream_event`

```elixir
@type stream_event() :: map()
```

# `start_stream`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
