# `ASM.Migration.MainCompat`
[🔗](https://github.com/nshkrdotcom/agent_session_manager/blob/v0.9.2/lib/asm/migration/main_compat.ex#L1)

Compatibility helpers for migrating `main` SessionManager input/event shapes
to the rebuild `ASM` runtime.

This module is intentionally explicit about unsupported migration paths:

- Amp and Shell adapter migration is blocked in this helper.
- `main` workflow options that require extension/domain parity are rejected
  with actionable `%ASM.Error{}` messages.

# `legacy_event`

```elixir
@type legacy_event() :: %{
  type: atom(),
  timestamp: DateTime.t(),
  session_id: String.t(),
  run_id: String.t(),
  data: map(),
  provider: atom()
}
```

# `main_input`

```elixir
@type main_input() :: String.t() | map()
```

# `provider_hint`

```elixir
@type provider_hint() :: atom() | String.t()
```

# `query_spec`

```elixir
@type query_spec() :: %{
  provider: :claude | :codex | :gemini,
  prompt: String.t(),
  session_opts: keyword(),
  query_opts: keyword()
}
```

# `bridge_event`

```elixir
@spec bridge_event(ASM.Event.t()) :: [legacy_event()]
```

# `bridge_stream`

```elixir
@spec bridge_stream(Enumerable.t()) :: Enumerable.t()
```

# `build_query`

```elixir
@spec build_query(provider_hint(), main_input(), keyword()) ::
  {:ok, query_spec()} | {:error, ASM.Error.t()}
```

# `input_to_prompt`

```elixir
@spec input_to_prompt(main_input()) :: {:ok, String.t()} | {:error, ASM.Error.t()}
```

# `resolve_provider`

```elixir
@spec resolve_provider(provider_hint()) ::
  {:ok, :claude | :codex | :gemini} | {:error, ASM.Error.t()}
```

# `run_once`

```elixir
@spec run_once(provider_hint(), main_input(), keyword()) ::
  {:ok, map()} | {:error, ASM.Error.t()}
```

# `run_once`

```elixir
@spec run_once(term(), provider_hint(), main_input(), keyword()) ::
  {:ok, map()} | {:error, ASM.Error.t()}
```

---

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