# `MingaEditor.Shell.InputRouter`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/shell/input_router.ex#L1)

Behaviour: how a shell routes input.

Carved out of `MingaEditor.Shell`. This is the natural home for the
focus-tree mouse routing in #1435 and any future "click-to-focus"
semantics — those are presentation concerns the shell owns, not
the editing model.

# `shell_state`

```elixir
@type shell_state() :: term()
```

Shell-specific state. Each shell defines its own struct.

# `workspace`

```elixir
@type workspace() :: MingaEditor.Workspace.State.t()
```

Workspace state (the editing context shared by all shells).

# `handle_event`

```elixir
@callback handle_event(shell_state(), workspace(), event :: term()) ::
  {shell_state(), workspace()}
```

Handle a shell-specific event (tool prompt, nav flash, git status, etc.).

# `handle_gui_action`

```elixir
@callback handle_gui_action(shell_state(), workspace(), action :: term()) ::
  {shell_state(), workspace()}
```

Handle a shell-specific GUI action from the native frontend.

# `input_handlers`

```elixir
@callback input_handlers(editor_state :: term()) :: %{
  overlay: [module()],
  surface: [module()]
}
```

Returns the input handler stack for this shell. Overlay handlers
(picker, completion, conflict prompt) sit above the surface and
intercept keys first; surface handlers (dashboard, file tree, agent
panel, mode dispatch) handle keys when no overlay claims them.

---

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