中文文档见 README.zh-CN.md.
Code-centric controllable AI Agent IDE built with Tauri v2, Rust, React, TypeScript, Tailwind CSS, Monaco Editor, and xterm.js.
Agent IDE is not intended to be a chat-only coding tool. The product direction is an IDE where the Agent is visible, auditable, and user-controlled through task plans, role pipelines, diff review, logs, Git state, and terminal workflows.
Phase 7 is feature-complete. Phase 8 is focused on daily IDE replacement hardening.
Capability snapshot:
- Desktop IDE shell: Monaco editor, Explorer, Git, Terminal, Problems, Logs, Commands, and Agent panels.
- Agent loop: role pipeline, editable plan, context preview/budgeting, structured action logs,
agent-changesprotocol, and diff review/apply/regenerate. - Project memory: workspace-root
AGENTS.mdis loaded into Agent context (bounded, budget-aware, IDE + CLI). - Semantic/runtime loop: TypeScript/JavaScript and Go LSP first pass, diagnostics to Problems/editor markers, project command run history, and terminal failure context for Agent repair.
- Automation/release: headless
agent_clifirst pass and Windows packaging workflow.
The detailed implementation state, remaining gaps, and next tasks live in ROADMAP.md. Design and protocol docs: docs/agent_ide_design.md, docs/agent_changes_schema.md, and docs/smoke_test.md.
There are two different development modes:
npm run devRuns Vite web preview only. Tauri IPC, filesystem, terminal, Git, and Agent backend features are disabled or guarded.
npm run tauri -- devRuns the real desktop IDE with the Rust backend and Tauri APIs.
Once it is running, docs/getting_started.md walks through configuring a model, running a first task, reviewing and undoing changes, and the keyboard shortcuts. The rest of this file is build and architecture material.
Before you begin, ensure you have the following installed:
-
Node.js (v18 or higher) and npm
- Download: https://nodejs.org/
- Verify:
node --versionandnpm --version
-
Rust toolchain (latest stable)
- Windows: Download and run rustup-init.exe
- macOS: Run
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - Linux: Run
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - Verify:
rustc --versionandcargo --version
Windows:
- Microsoft Visual C++ Build Tools 2015 or later
- WebView2 Runtime (usually included with Windows 10/11)
- OpenSSL (for some dependencies)
macOS:
- Xcode Command Line Tools:
xcode-select --install - CocoaPods:
sudo gem install cocoapods
Linux:
- WebKitGTK development libraries
- libayatana-appindicator development libraries
- OpenSSL development libraries
Windows:
# Download and run rustup installer
# Visit: https://rustup.rs/
# Or use PowerShell:
Invoke-WebRequest -Uri https://win.rustup.rs/x86_64 -OutFile rustup-init.exe
.\rustup-init.exemacOS/Linux:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/envrustc --version
cargo --versionExpected output:
rustc 1.80.0 (or later)
cargo 1.80.0 (or later)
Windows:
# Install Visual Studio Build Tools
# Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
# Select "Desktop development with C++" workload
# Install WebView2 (if not present)
# Download from: https://developer.microsoft.com/en-us/microsoft-edge/webview2/macOS:
# Install Xcode Command Line Tools
xcode-select --install
# Install CocoaPods
sudo gem install cocoapodsLinux (Ubuntu/Debian):
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
openssl-dev \
libssl-dev \
curl \
wget \
file \
libxdo-dev \
libxcb-devnpm install# Verify Node.js and npm
node --version
npm --version
# Verify Rust and Cargo
rustc --version
cargo --version
# Verify Tauri CLI
npm run tauri -- --versionnpm run devThis runs Vite web preview only. Tauri IPC, filesystem, terminal, Git, and Agent backend features are disabled or guarded.
Use this for:
- Frontend development and testing
- UI/UX changes
- When Rust backend is not required
npm run tauri -- devThis runs the real desktop IDE with the Rust backend and Tauri APIs.
Use this for:
- Full application development
- Testing Agent functionality
- File system operations
- Terminal integration
- Git operations
Note: This command requires a properly installed Rust toolchain. If you see cargo: command not found or similar errors, please refer to the Troubleshooting section below.
Error:
failed to run 'cargo metadata' command to get workspace directory: failed to run command cargo metadata --no-deps --format-version 1: program not found
Quick Fix Scripts:
We provide two automatic fix scripts:
PowerShell Version (Recommended):
.\fix-environment.ps1Batch Version (Alternative):
.\fix-environment.batThese scripts will automatically:
- Check Node.js and npm installation
- Check Rust and Cargo installation
- Download and install Rust if needed
- Fix PATH configuration
- Verify installation
Manual Solutions:
-
Install Rust:
# Windows Invoke-WebRequest -Uri https://win.rustup.rs/x86_64 -OutFile rustup-init.exe .\rustup-init.exe # macOS/Linux curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Restart your terminal (important!)
-
Verify installation:
rustc --version cargo --version
-
Add Cargo to PATH (if still not found):
Windows (PowerShell):
# Add to current session $env:PATH += ";$env:USERPROFILE\.cargo\bin" # Add permanently (run as Administrator) [Environment]::SetEnvironmentVariable( "Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$env:USERPROFILE\.cargo\bin", "User" )
macOS/Linux:
# Add to ~/.bashrc or ~/.zshrc echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc source ~/.bashrc
Error:
Error: Node.js version too old. Requires v18 or higher.
Solution:
# Install Node.js 18+ using nvm (recommended)
# Windows: Download from https://github.com/coreybutler/nvm-windows/releases
# macOS/Linux:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18
nvm use 18Error:
error: failed to run custom build command for `openssl-sys`
Solution:
# Windows: Install OpenSSL
# Download from: https://slproweb.com/products/Win32OpenSSL.html
# Install to C:\Program Files\OpenSSL-Win64
# Set environment variable
$env:OPENSSL_DIR = "C:\Program Files\OpenSSL-Win64"Error:
error: linker `link.exe` not found
Solution:
# Install Visual Studio Build Tools
# Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
# Select "Desktop development with C++" during installationError:
Error: EACCES: permission denied
Solution:
# macOS/Linux: Fix npm permissions
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrcError:
Error: Port 1420 is already in use
Solution:
# Windows: Find and kill the process
netstat -ano | findstr :1420
taskkill /PID <PID> /F
# macOS/Linux:
lsof -ti:1420 | xargs kill -9Error:
error: failed to compile
Solution:
# Clean cargo cache
cargo clean
# Update Rust toolchain
rustup update
# Rebuild
npm run tauri -- devError:
Error: WebView2 runtime not found
Solution:
# Download and install WebView2 Runtime
# https://developer.microsoft.com/en-us/microsoft-edge/webview2/
# Or use Windows Update to get the latest WebView2Common Issues:
- Hot reload not working: Ensure you're running
npm run tauri -- dev, not justnpm run dev - Styles not loading: Clear browser cache and restart dev server
- Extensions not working: Check browser console for errors and ensure Tauri APIs are available
If you encounter issues not covered here:
Quick Fix Scripts:
# PowerShell version (recommended)
.\fix-environment.ps1
# Or batch version
.\fix-environment.batThese scripts will automatically:
- Check Node.js and npm installation
- Check Rust and Cargo installation
- Download and install Rust if needed
- Fix PATH configuration
- Verify installation
- Check the Tauri documentation
- Review Rust installation guide
- Check Node.js documentation
- Open an issue on GitHub with:
- Your operating system and version
- Node.js and npm versions
- Rust and Cargo versions
- Complete error message
- Steps to reproduce
Run these checks before committing substantial changes:
npm run build
npm test
cd src-tauri
cargo check
cargo testKnown build note: Vite currently warns about a large chunk because Monaco, Markdown, xterm, and syntax tooling are bundled together. This is not a correctness failure.
For changes to LSP, Problems, Terminal, Git, or Agent diff application, also run the real Tauri runtime checklist in docs/smoke_test.md.
Build a Windows installer package:
npm run package:windowsThe script runs frontend build/tests, cargo check, cargo test, and tauri build --bundles nsis,msi, then copies installers to release/windows/<version>/ with SHA256SUMS.txt and manifest.json.
For a local packaging smoke after checks have already passed:
npm run package:windows:fastTo build one installer format:
npm run package:windows:nsis
npm run package:windows:msiThe first Windows bundle may download NSIS, nsis_tauri_utils.dll, and/or WiX tooling through Tauri. If local bundling times out while downloading those tools, rerun the command after the tool cache is populated or run the Windows Package GitHub Actions workflow, which builds on windows-latest and uploads the generated artifacts.
Generated release artifacts are intentionally ignored by Git.
src/
components/
agent/ Agent chat, task, diff, pipeline, settings UI
editor/ Monaco editor, tabs, overlays, quick actions
layout/ top/left/right/bottom layout panels
panels/ Explorer, Git, Terminal, Logs
hooks/ Tauri event bridge and shortcuts
stores/ Zustand stores
types/ frontend DTOs
utils/ Tauri runtime helpers
src-tauri/
src/
agent/ planner, executor, orchestrator, diff apply, roles
commands/ Tauri IPC commands for fs/git/terminal/agent
services/ workspace, context, LLM client
bin/ agent_cli
docs/
agent_ide_design.md detailed current design
agent_cli_manual.md CLI mode usage and limitations
agent_cli_design.md CLI automation and integration target design
agent_ide_plan.md original technical plan
agent_ide_ui_design.md product UI design target
Agent IDE uses the chat UI as the user entry point, but the Agent is scheduled by the IDE runtime rather than by a single free-form chat loop.
Chat prompt
-> ChatView collects prompt, active file, selection, and attached context files
-> useAgentStore.sendPrompt() invokes send_agent_prompt over Tauri IPC
-> commands/agent.rs builds AgentContext and reads the configured pipeline
-> services/context.rs enriches and compresses context
-> agent/orchestrator.rs runs the Agent state machine
-> planner produces task steps
-> role pipeline executes configured stages
-> architect
-> coder
-> tester
-> reviewer
-> executor streams LLM output through services/llm_client.rs
-> diff parser converts model output into pending diffs
-> reviewer receives actual pending diff summaries
-> useAgentBridge receives backend events and refreshes Chat/Tasks/Pipeline/Diff/Logs
-> user applies/rejects diffs through commands/agent.rs and agent/diff_apply.rs
The main scheduling modules are:
| Layer | Module | Responsibility |
|---|---|---|
| UI | src/components/agent/* |
Chat input, task view, pipeline view, diff review, settings. |
| Frontend state | src/stores/useAgentStore.ts |
Agent state, IPC calls, messages, steps, diffs, pipeline config. |
| Event bridge | src/hooks/useAgentBridge.ts |
Subscribes to backend events and updates Zustand stores. |
| IPC boundary | src-tauri/src/commands/agent.rs |
Validates requests, builds context, starts/stops Agent runs, applies/rejects diffs. |
| Context | src-tauri/src/services/context.rs |
Adds active file, selection, open files, project tree, Git diff, and compression mode. |
| Orchestration | src-tauri/src/agent/orchestrator.rs |
Runs planner, role stages, reviewer, action logs, and Agent state transitions. |
| Role execution | src-tauri/src/agent/executor.rs |
Sends role-specific prompts to the LLM and streams responses. |
| LLM | src-tauri/src/services/llm_client.rs |
OpenAI-compatible streaming chat client. |
| Diff apply | src-tauri/src/agent/diff_apply.rs |
Applies reviewable file changes inside the workspace boundary. |
Context compression is selected per Chat run:
| Mode | Use |
|---|---|
focused |
Default practical mode: selection, active-file excerpt, project summary, Git diff. |
compact |
Lower-token mode: outline and metadata for broad context. |
budgeted |
Token-budget-aware packing that uses provider profile budget metadata or a safe default budget. |
full |
Maximum-fidelity mode: complete active context when accuracy matters more than token use. |
Agent events are streamed back to the UI and action log:
agent-state-changedagent-stream-tokenagent-plan-readyagent-step-updateagent-pipeline-updateagent-diff-readyagent-action-log
For the full design, read docs/agent_ide_design.md, especially sections 4.3 Agent Prompt, 4.4 Agent Pipeline, 5 Context Model, and 6 Agent Modes and Safety. The structured change protocol is documented in docs/agent_changes_schema.md.
Preferred structured output:
```agent-changes
{
"version": 1,
"changes": [
{
"type": "edit",
"file": "path/to/file",
"baseHash": "optional current file hash when known",
"rationale": "why this change is needed",
"hunks": [
{ "original": "exact existing code", "updated": "replacement code" }
]
},
{
"type": "create",
"file": "path/to/new-file",
"rationale": "why this file is needed",
"content": "complete file content"
}
],
"findings": [
{
"severity": "warning",
"file": "path/to/file",
"hunkIndex": 0,
"message": "optional reviewer finding tied to this hunk"
}
]
}
```
Legacy diff:path and new:path code blocks are still supported. Schema details and validation behavior are documented in docs/agent_changes_schema.md.
If an AGENTS.md file exists at the workspace root, Agent IDE loads it as project memory for every Agent run, in both the desktop IDE and agent_cli.
- Content is injected as a bounded
Project memory (AGENTS.md)context section and participates in all compression modes and token budget packing. - It is included by default. Per-run context source controls can exclude it (
includeProjectMemory), and the CLI can select it with--include project-memory. - Oversized files are trimmed at 8,000 characters with a truncation marker.
This keeps persistent project conventions, preferred commands, and constraints versioned inside the workspace itself, following the cross-tool AGENTS.md convention.
LLM config can be provided through the UI or environment variables:
$env:LLM_ENDPOINT = "https://api.openai.com/v1"
$env:LLM_API_KEY = "..."
$env:LLM_MODEL = "..."Current local config files are stored under ~/.agent-ide unless AGENT_IDE_CONFIG_DIR is set.
The Rust side includes a headless automation CLI:
cd src-tauri
cargo build --bin agent_cli --release
target\release\agent_cli --helpCLI mode is first-pass complete for headless automation. It supports doctor, context estimate, plan, run, smoke ide-backend, and smoke ide-surface; text/JSON/NDJSON output; run artifacts; optional apply; project command checks; bounded repair iterations; command allow-listing; timeout/output/diff limits; and smoke-tested project-tasks.json, problems.json, repair-chain.json, and repair-summary.json artifacts.
smoke ide-surface is the read-only probe for the panel backends the Agent flow does not touch — workspace resolution, project task discovery, verification candidates, Git status/diff, and context packing — using the same functions the desktop calls. It needs no LLM provider, so it can run in CI:
target\release\agent_cli smoke ide-surface --output jsonIt reports each probe as ok, unavailable (nothing to show, e.g. not a Git repository), or failed, and writes surface-probes.json beside the other run artifacts. Only failed affects the exit code.
It is intentionally not a full command-line IDE replacement. Visual Agent plan controls, Problems/Terminal/Git integration, LSP views, run history, and per-hunk review UI remain desktop IDE workflows.
See docs/agent_cli_manual.md for usage, safety notes, and the current completeness assessment. See docs/agent_cli_design.md for the planned toolchain-integration and full-automation architecture.
This repo may have local demo changes. Check status before staging:
git status --shortDo not include unrelated demo/workspace changes in feature commits.
MIT — see LICENSE.
Third-party dependencies keep their own licenses:
- Tauri and the Rust/npm dependency tree are permissively licensed (mostly MIT or Apache-2.0).
- No native inference engine is linked. Local models are reached over HTTP through an OpenAI-compatible server (Ollama, LM Studio, vLLM), so nothing from llama.cpp ends up in the binary.
Model weights and LLM provider endpoints are not part of this repository and are governed by whatever terms you obtain them under.
