# X-Coder **Repository Path**: carllee34/x-coder ## Basic Information - **Project Name**: X-Coder - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-03 - **Last Updated**: 2026-04-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # X-Coder - Multi-Agent AI Coding Assistant > Your intelligent coding partner with collaborative AI agents X-Coder is a top-tier VS Code extension that leverages multiple AI agents working together to help you code faster, better, and more efficiently. Built with insights from Claude Code, Roo Code, and Cline. ## Features ### Multi-Agent Collaboration - **Lead Agent**: Analyzes requirements, decomposes tasks, and coordinates work - **Code Agent**: Writes and modifies code with deep understanding - **Review Agent**: Reviews code for quality, security, and best practices - **Test Agent**: Generates and runs comprehensive tests - **Doc Agent**: Creates and updates documentation - **Architect Agent**: Designs system architecture and makes tech recommendations - **Debug Agent**: Diagnoses and fixes issues systematically ### Model Support - **Anthropic Claude** (Sonnet 4.5, Opus 4.6) - **OpenAI** (GPT-4o, o1, GPT-4o Mini) - **Google Gemini** (2.5 Pro, 2.0 Flash) - **Ollama** (Local models) - **OpenRouter** (Access to 100+ models) - **AWS Bedrock** & **GCP Vertex** ### MCP Integration - Connect to external tools and APIs via Model Context Protocol - Discover and use MCP-provided tools in your workflow - OAuth authentication support ### Advanced Context Management - Layered context strategy for efficient token usage - Automatic context compression when approaching limits - File context caching and workspace understanding ### Task Management - Visual task queue with progress tracking - Task decomposition for complex requirements - Dependency management between tasks ### User Experience - Clean, VS Code-native interface - Real-time agent status monitoring - Approval workflow for all changes - Git-based checkpoints for recovery ## Installation 1. Download the `.vsix` file from releases 2. Install via VS Code: `Extensions > Install from VSIX...` 3. Or install from VS Code Marketplace (coming soon) ## Quick Start 1. **Configure your API key**: Open X-Coder settings and add your API key 2. **Start a task**: Click the + button or type your request in the chat 3. **Monitor progress**: Watch agents work in the Agent Monitor panel 4. **Review changes**: Approve or reject each proposed change ## Architecture ``` ┌─────────────────────────────────────────────────────────────────┐ │ VS Code Extension │ ├─────────────────────────────────────────────────────────────────┤ │ ┌───────────────────────────────────────────────────────────┐ │ │ │ Service Container │ │ │ │ (Dependency Injection & Lifecycle Management) │ │ │ └───────────────────────────────────────────────────────────┘ │ │ │ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌───────────┐ │ │ │ Agent │ │ Task │ │ Context │ │ Tool │ │ │ │Orchestrator │ │Orchestrator │ │ Manager │ │ Registry │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ └───────────┘ │ │ │ │ │ ┌───────────────────────────────────────────────────────────┐ │ │ │ Communication Bus │ │ │ │ (Inter-Agent Messaging) │ │ │ └───────────────────────────────────────────────────────────┘ │ │ │ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌───────────┐ │ │ │ Model │ │ MCP │ │ Permission │ │Checkpoint │ │ │ │ Router │ │ Hub │ │ Controller │ │ Manager │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ └───────────┘ │ ├─────────────────────────────────────────────────────────────────┤ │ Webview UI │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │ │ Chat │ │ Tasks │ │ Agents │ │ Settings │ │ │ │ View │ │ Panel │ │ Monitor │ │ Panel │ │ │ └──────────┘ └──────────┘ └──────────┘ └──────────────────┘ │ └─────────────────────────────────────────────────────────────────┘ ``` ## Project Structure ``` x-coder/ ├── src/ # Extension source │ ├── extension.ts # Entry point │ ├── core/ # Core modules │ │ ├── agent/ # Agent system │ │ ├── task/ # Task system │ │ ├── communication/ # Inter-agent communication │ │ ├── context/ # Context management │ │ ├── tools/ # Tool registry │ │ └── events/ # Event bus │ ├── api/ # Model API adapters │ │ ├── ModelRouter.ts # Model routing │ │ └── adapters/ # Provider adapters │ ├── services/ # Services │ │ ├── MCPHub.ts # MCP server management │ │ ├── LogManager.ts # Logging │ │ ├── TelemetryManager.ts # Telemetry │ │ ├── ConfigManager.ts # Configuration │ │ └── PermissionController.ts │ ├── storage/ # Persistent storage │ │ └── Database.ts # SQLite database │ └── webview/ # Webview integration │ └── WebviewProvider.ts ├── webview-ui/ # Frontend UI │ └── src/ │ ├── components/ # React components │ ├── hooks/ # React hooks │ └── context/ # React context ├── locales/ # Internationalization └── assets/ # Icons and resources ``` ## Development ### Prerequisites - Node.js 20+ - VS Code 1.84+ ### Setup ```bash # Install dependencies npm install cd webview-ui && npm install && cd .. # Build npm run build # Run in development mode npm run dev ``` ### Debug Press F5 in VS Code to launch the Extension Development Host. ### Testing ```bash # Run all tests npm test # Run tests with coverage npm run test:coverage # Run specific test file npx vitest tests/unit/core/EventBus.test.ts # Watch mode for development npm run test:watch ``` **测试覆盖范围** (656+ 测试用例): | 模块 | 测试文件 | 覆盖内容 | |------|----------|----------| | **Core** | EventBus, ContextManager, TaskOrchestrator | 事件总线、上下文管理、任务编排 | | **API** | ModelRouter | 模型路由、适配器注册 | | **Services** | MCPHub, LogManager, ConfigManager | MCP集成、日志管理、配置管理 | | **Tools** | EditFileTool, SearchTools, InteractionTools | 文件编辑、搜索工具、交互工具 | | **Utils** | MultiLevelCache, PerformanceAndDedup | 多级缓存、性能监控、请求去重 | | **Integration** | AgentLoop | 完整Agent工作流 | **运行测试结果**: ``` Test Files 26 passed (26) Tests 656 passed (656) Duration 2.74s ``` ## Configuration | Setting | Description | Default | |---------|-------------|---------| | `x-coder.apiProvider` | API provider (anthropic, openai, etc.) | `anthropic` | | `x-coder.apiKey` | API key for the provider | - | | `x-coder.model` | Model to use | `claude-sonnet-4-5-20250514` | | `x-coder.maxTokens` | Maximum response tokens | `8192` | | `x-coder.temperature` | Response temperature | `0.7` | | `x-coder.autoApprove` | Auto-approve operations | `false` | | `x-coder.mcpEnabled` | Enable MCP support | `true` | | `x-coder.maxConcurrentAgents` | Max concurrent agents | `5` | ## Commands | Command | Description | |---------|-------------| | `X-Coder: New Task` | Start a new task | | `X-Coder: MCP Servers` | Manage MCP servers | | `X-Coder: History` | View task history | | `X-Coder: Settings` | Open settings | | `X-Coder: Add to X-Coder` | Add selected code to chat | | `X-Coder: Generate Commit Message` | Generate git commit message | | `X-Coder: Explain with X-Coder` | Explain selected code | | `X-Coder: Improve with X-Coder` | Improve selected code | ## Keyboard Shortcuts | Shortcut | Action | |----------|--------| | `Cmd+'` (Mac) / `Ctrl+'` (Win/Linux) | Add selection to chat / Focus chat | ## Security & Privacy - **Local-first**: All processing happens locally, no data sent to third parties except your chosen AI provider - **Permission system**: Every file change and command execution requires your approval - **Telemetry**: Anonymous usage telemetry can be disabled in settings - **API keys**: Stored securely in VS Code settings ## License Apache-2.0 ## Acknowledgments This project draws architectural inspiration from: - [Claude Code](https://github.com/anthropics/claude-code) - Multi-agent patterns, tool system - [Roo Code](https://github.com/RooVetGit/Roo-Code) - Mode system, custom instructions - [Cline](https://github.com/cline/cline) - MCP integration, checkpoint system