How wecode-ai/runvsagent works
Project Type & Purpose
• RunVSAgent is a cross-IDE integration tool (full-stack, plugin-based) that lets you run VS Code–style coding agents (e.g., Roo Code, Cline) inside JetBrains IDEs.
• It consists of two main parts:
• A Kotlin-based JetBrains plugin that lives inside the IDE.
• A Node.js/TypeScript “extension host” process that emulates VS Code’s API and manages the agents.
File-Structure Analysis
Top-level directories:
• extension_host/ → Node.js runtime, TS source, RPC & VS Code API layer
• jetbrains_plugin/ → Kotlin plugin code, organized into core, editor, actions, IPC proxies, webview, etc.
• scripts/ → build/setup/test shell scripts
• deps/, docs/, configs (BUILD.md, README.md)
Patterns & clues:
• RPC layer in extension_host/src/rpcManager.ts + IPC proxy interfaces in jetbrains_plugin (com/sina/weibo/agent/ipc/proxy)
• WebView support both in plugin (webview manager) and extension host (webViewManager.ts)
• Gradle build for plugin and npm/pnpm/tsup for extension host
README Insights
• Technology stack callouts: Node.js 18+/TypeScript 5.0+, Kotlin 1.8+/IntelliJ Platform, Unix domain sockets/Named pipes for IPC.
• JetBrains IDE Process
– Kotlin Plugin (modules: core, actions, editor bridge, webview integration)
– UI Integration & Tool Window
• Extension Host Process
– Node.js Runtime
– VSCode API Compatibility Layer
– RPC Manager (message broker)
– Agent Manager (lifecycle & loading of agents)
• VSCode Agents
– Cline, RooCode, others (each as plugin bundles loaded by the host)
• External/OS services
– IPC Channel (Unix Domain Socket or Named Pipe)
– File System, Network, Shell for agents’ side effects
1. IDE Plugin ↔ Extension Host via RPC channel:
– “register command” / “invoke API” / “handle events”
2. Plugin → IDE Editor & UI API (IntelliJ Platform)
3. Extension Host → VSCode API stubs → Agents
4. Agents → VSCode API → Host → Plugin → IDE
c. Architectural Patterns & Principles:
• Modular separation: Plugin vs Host vs Agents
• Interprocess communication via RPC & message proxies
• Adapter/compatibility pattern: VSCode API layer adapts VS Code extensions to JetBrains environment
• Plugin lifecycle management (bootstrap scripts, extensionHost/bootstrap-*.ts)
d. Key Technologies & Frameworks:
• Kotlin + IntelliJ Platform SDK (JetBrains Plugin)
• Node.js + TypeScript + tsup (Extension Host bundler)
• IPC via Unix Domain Socket / Named Pipe
• Gradle (build plugin), npm/pnpm (build host), shell scripts (scripts/*)