26. Build Your Own Agent Shell

Minimal Architecture

  1. CLI entry file like main.tsx
  2. Command router like commands.ts
  3. Tool contract and registry like Tool.ts + tools.ts
  4. Model adapter layer replacing services/api/client.ts
  5. Three core tools: read, edit, bash
  6. One simple permission model: allow / ask / deny
  7. Basic history and compacting

Recommended Build Order

PhaseBuildDo not build yet
1CLI shell, streaming text, model adapterMulti-agent
2Read/edit/bash tools with permissionsMCP marketplace
3History and compactingComplex auth providers
4Optional agent delegationEverything internal-only or enterprise-only

Source Navigation

Recommended Source Files

  • source/main.tsx
  • source/tools.ts
  • source/Tool.ts
  • source/components/PromptInput
  • source/services/tools/toolExecution.ts

Next Files to Read

  • source/state/AppStateStore.ts
  • source/tools/FileEditTool/FileEditTool.ts
  • source/services/api/client.ts