Mechanics Overview
The mechanics track explains how each subsystem works once you have the agent running. Each page pairs short context with the exact code that powers the feature, so you can reason about behaviour without stepping through the entire build series again.
Topics
- Agent loop — input prompts, slash commands, readline lifecycle.
- Vercel AI SDK — streaming chat integration, step gating, provider options.
- Tool execution — adapters, managed runtimes, schema validation.
- Diff rendering — computing diffs, stats, and terminal presentation.
- Markdown rendering — parsing and displaying docs in the terminal.
- Terminal UI — colour palette, frames, tool result presenters.
How to use these pages
- Skim the diagrams and snippets before editing the source—they highlight the data flow and Effect layers involved.
- Open the referenced files alongside the docs. Each section includes navigation cues so you can jump straight into
src/. - When experimenting with new tools or UI changes, start here to understand the surfaces you are touching.
Looking for a step-by-step rebuild? Return to the Build Series. If you want to dive deeper into Effect layer composition or service design, move to the Effect Deep Dive.