26. Build Your Own Agent Shell
Minimal Architecture
- CLI entry file like
main.tsx - Command router like
commands.ts - Tool contract and registry like
Tool.ts+tools.ts - Model adapter layer replacing
services/api/client.ts - Three core tools: read, edit, bash
- One simple permission model: allow / ask / deny
- Basic history and compacting
Recommended Build Order
| Phase | Build | Do not build yet |
|---|---|---|
| 1 | CLI shell, streaming text, model adapter | Multi-agent |
| 2 | Read/edit/bash tools with permissions | MCP marketplace |
| 3 | History and compacting | Complex auth providers |
| 4 | Optional agent delegation | Everything internal-only or enterprise-only |
Source Navigation
Recommended Source Files
source/main.tsxsource/tools.tssource/Tool.tssource/components/PromptInputsource/services/tools/toolExecution.ts
Next Files to Read
source/state/AppStateStore.tssource/tools/FileEditTool/FileEditTool.tssource/services/api/client.ts