magi-code 0.63.4

Repository-aware CLI coding agent for terminal work
Documentation
<!--THIS IS A GENERATED FILE - DO NOT MODIFY DIRECTLY, FOR MANUAL ADJUSTMENTS UPDATE `../../../AGENTS_CUSTOM.MD`-->
# src/tui/input KNOWLEDGE BASE

## OVERVIEW
Input subsystem translates terminal keys, paste, mouse, clipboard, autocomplete, and submit gestures into controller actions for Mission Control display state.

## WHERE TO LOOK
| Need | Path | Signal |
|------|------|--------|
| Module boundary | `mod.rs` | public input handlers, action types, command dispatch seam |
| Key routing | `keybindings.rs` | key chord map, command names, help labels |
| Prompt submit | `submit_command.rs` | enter/send behavior, command extraction, multiline rules |
| Path completion | `autocomplete.rs` | completion lifecycle, selection, replacement ranges |
| Completion sources | `autocomplete_sources.rs` | filesystem candidates, `.gitignore` filtering, cwd-relative paths |
| Mouse input | `mouse.rs` | scroll wheel, pane hit tests, click-driven focus/selection |
| Clipboard | `clipboard.rs` | paste/copy plumbing and terminal clipboard integration |
| Modal keys | `modal.rs` | modal-local navigation and confirmation/cancel paths |
| Text selection | `selection.rs` | selection anchors, drag updates, copyable spans |

## CONVENTIONS
- Map raw terminal events to explicit commands before state effects.
- Dispatch state changes through controller-facing actions; avoid direct global mutation.
- Keep input display-only: focus, cursor, prompt text, selection, scroll, modal intent.
- Keep provider, tool, auth, session, and model semantics out of input handlers.
- Prefer command names stable enough for key help and tests.
- Keep keybindings discoverable from one table-like source when possible.
- Let modal handlers consume keys before global shortcuts.
- Preserve text editing expectations: cursor movement, selection, paste, multiline submit.
- Autocomplete paths stay cwd-relative for display and insertion.
- Autocomplete must respect `.gitignore` and hidden-file behavior already implemented.
- Mouse scroll should target hovered/active pane predictably.
- Click handling should select focus or item; never trigger provider work directly.
- Treat paste as user input; sanitize only at display/render boundary where existing code does.
- Add focused tests for new chord, completion replacement, mouse hit-test, or modal routing changes.

## ANTI-PATTERNS
- Do not mutate `MissionControlState` from helper code that should return an action.
- Do not put provider request shaping, tool dispatch, or session persistence in this directory.
- Do not make keybindings depend on provider/model names.
- Do not bypass controller event flow for submit, cancel, focus, or scroll effects.
- Do not let autocomplete scan outside allowed cwd/root boundaries.
- Do not ignore `.gitignore` when offering file path completions.
- Do not trigger submit from mouse click without explicit controller command path.
- Do not duplicate keybinding truth across help text and handlers.
- Do not add terminal escape parsing here; upstream event layer owns raw decoding.
- Do not leak raw clipboard, prompt, or path data into logs beyond existing redaction rules.