What Postal is built on, and what each piece is actually doing.
| Ink | The full-screen interactive terminal. Ink renders React to the terminal, which gives the TUI a declarative layout and a component model. |
| React | The UI runtime behind Ink: state, effects, and a pure reducer (ui/terminal/src/state.ts) that turns backend events into screen state. |
| TypeScript | The whole frontend, type-checked against the JSON-lines protocol shared with Python. |
| esbuild | Bundles the app into the single ui/terminal_bundle/postal.mjs file that ships in the package, so users need Node but not npm. |
| marked + marked-terminal | Markdown rendering for assistant replies and tool output. |
| wrap-ansi / string-width | Grapheme- and width-aware wrapping so wide characters and emoji do not break the layout. |
| Rich | Slash-command output and the streaming renderer for single-shot runs, plus the shared render components. |
| prompt-toolkit | Persistent prompt history shared with the previous interface, and legacy terminal input helpers. |
| Pygments | Syntax highlighting for code blocks and file previews rendered through Rich. |
| Python 3.11+ | The agent loop is asyncio-based, so streaming, tool calls, and MCP connections run concurrently. |
| OpenAI SDK | The API client, pointed at OpenRouter's OpenAI-compatible endpoint for streaming and tool calling. |
| OpenRouter | The model gateway. One login, any model, no per-vendor SDKs. |
| Pydantic | Config schemas, tool argument validation, and the JSON Schema sent to the model for each tool definition. |
| FastMCP / MCP | Connecting to external MCP servers and exposing their tools to the agent. |
| tiktoken | Token counting that drives context pruning and compaction. |
| httpx | Async HTTP for URL fetching and the OAuth token exchange. |
| ddgs | DuckDuckGo-backed web search. |
| Click | The postal CLI: flags, single-shot mode, and the login / logout subcommands. |
| Node.js 22+ | The runtime that executes the bundled TypeScript TUI. The npm dependencies are bundled ahead of time; users only need node on PATH. |
| OAuth 2.0 + PKCE | Browser login runs on a stdlib http.server loopback redirect, with the key stored locally. |
| platformdirs + TOML | Cross-platform config and credential paths, read with tomllib. |
| Docker | A Dockerfile and Compose file in docker/ for running the agent sandboxed. |
How these are wired together is covered in Architecture.