How sidenai/sidex works
1. Top-level shape
SideX is a desktop IDE built as a Tauri 2 shell around a TypeScript port of VS Code’s workbench. The UI runs inside the OS-native webview, while the privileged work lives in the Rust backend. The repo is a monorepo with two main halves: src/ for the frontend workbench and src-tauri/ plus supporting Rust crates for backend services.
2. Process / boundary model
The key architectural boundary is between:
• the renderer/webview: Monaco editor, workbench shell, panels, menus, and contributions
• the Rust backend: file I/O, terminal PTY, search, Git, storage, watching, process management
Communication is Tauri-style invoke()/events rather than Electron IPC. The README explicitly maps VS Code’s Electron main process to the Tauri backend.
3. Workbench frontend
src/vs/ is largely VS Code’s workbench code, organized into base, platform, editor, and workbench. This layer owns the IDE shell, editor panes, sidebar/panel layout, commands, keybindings, notifications, settings UI, and contribution registration. SideX-specific integration is concentrated in src/vs/platform/sidex/ and src/vs/workbench/api/tauri/.
4. Frontend service architecture
The frontend uses VS Code’s service/DI model heavily. src/vs/platform/* provides reusable services for configuration, commands, menus, keybindings, storage, theme, URI handling, webviews, workspace, etc. The sidex platform services adapt these abstractions to Tauri-backed implementations, so higher-level workbench code can stay close to upstream VS Code patterns.
5. Backend command surface
src-tauri/src/commands/ is the Rust command API exposed to the frontend. This is the main backend integration layer and contains modules for fs, git, terminal, search, settings, watch, window, process, lsp, tasks, syntax, theme, debug, extensions, and more. src-tauri/src/lib.rs wires these commands into Tauri; main.rs is the entrypoint.
6. Filesystem, workspace, and persistence
File access is split between frontend workspace logic and backend providers. The workspace UI and file explorer live in src/vs/workbench/contrib/files and src/vs/workbench/services/workspaces, while Tauri-backed file system providers are in src/vs/platform/files/browser/. Persistent state is handled by the Rust-side data crates, especially sidex-db for SQLite-backed storage and state/history/recent-window tracking, plus settings/profile services in sidex-settings and sidex-profiles.
7. Editor, text model, and language intelligence
The editing stack centers on Monaco Editor with VS Code’s text model and view model layers. Syntax highlighting and language metadata are provided by sidex-syntax, sidex-textmate, and sidex-theme, which cover TextMate grammars, theme resolution, bracket/folding/highlight logic, and token colorization. The repo also includes src-wasm/* helpers and public/onig.wasm, indicating WASM-backed text/syntax utilities in the rendering path.
8. Terminal subsystem
The terminal is a two-part pipeline: the frontend uses xterm.js-based UI in src/vs/workbench/contrib/terminal, while the backend owns the real PTY and shell process lifecycle. The Rust crate sidex-terminal contains PTY, shell integration, ANSI parsing, selection, renderer support, and link detection. Shell integration scripts are shipped under src-tauri/shell-integration and src/vs/workbench/contrib/terminal/common/scripts.
9. Git and source control
Git integration is backend-backed via sidex-git, which provides repo discovery and operations such as status, diff, log, blame, branch, stash, push/pull/fetch, and reset. The workbench SCM UI in src/vs/workbench/contrib/scm consumes that service to render repository state, diffs, history, and file decorations.
10. Extensions and extension host
Extensions are a major subsystem with several layers:
• sidex-extension-api defines the host-facing API and WIT world
• sidex-extensions handles manifests, registry, marketplace/install flow, activation, VSIX parsing, tree views, webviews, and contribution routing
• src-tauri/extension-host/ contains the sidecar Node-compatible host bootstrap and polyfills
• src/vs/workbench/api/* and src/vs/workbench/services/extensions/* implement the VS Code extension host/workbench protocol
Extension installation targets Open VSX, and infrastructure/marketplace-proxy is a Cloudflare Worker that adapts marketplace/gallery requests.
11. LSP, debug, tasks, and testing
Language services are split into dedicated crates and workbench consumers. sidex-lsp implements protocol/client logic for completion, hover, rename, code actions, diagnostics, document sync, folding, formatting, and navigation. sidex-dap handles debug adapter protocol transport/session/client state. sidex-tasks supports task providers and problem matchers. On the workbench side, the corresponding editors, panels, and contribution points live under src/vs/workbench/contrib/{debug,tasks,testing,search}.
12. Remote and environment integration
sidex-remote covers remote workspace modes such as SSH, containers, tunnels, Codespaces, WSL, and port forwarding. This is a separate boundary because it mediates how the IDE reaches files/processes outside the local machine. Related services in the workbench (src/vs/workbench/services/remote, src/vs/platform/remote, and src/vs/platform/tunnel) abstract those connection types.
13. Build, tooling, and deployment
The frontend is built with Vite + TypeScript, while the backend is Rust/Tauri. GitHub Actions cover build, test, lint, format, audit, and release. src-tauri has multiple Tauri configs and capability manifests, and .devcontainer supports reproducible development. There are also small WASM crates (hash, scroll, tfidf) used by browser-side performance-critical helpers.
14. Useful diagram boundaries
If you draw the architecture, the most important boxes are:
• Webview UI / VS Code workbench
• Tauri Rust backend
• Extension host sidecar
• Remote/environment adapters
• External services: filesystem/OS, terminal shell, Git, Open VSX, remote providers
The main arrows are UI actions and model updates flowing from the workbench to backend commands, with backend events/results flowing back into the workbench services and UI state.
Main entry points: commands Command API · contrib Workbench Features · sidex-extensions Extensions Runtime · workbench.web.main.ts Workbench Shell
Components 21
Webview UI
TypeScript workbench and renderer-side IDE shell
- Workbench Shell · Top-level renderer entrypoints and app boot for the VS Code-style IDE UI
src/vs/workbench/workbench.web.main.ts - Workbench Parts · Editor, sidebar, panel, status bar, title bar, notifications, and other shell regions
src/vs/workbench/browser/parts - Platform Services · Core browser/platform service abstractions for commands, config, storage, theme, keybindings, files, workspace, remote, and more
src/vs/platform - Sidex Adapters · Sidex-specific frontend services that adapt VS Code abstractions to Tauri-backed implementations
src/vs/platform/sidex - Editor Stack · Monaco editor, text model, view model, diffing, tokenization, and editor contributions
src/vs/editor - Workbench Features · Major user-facing workbench features such as files, search, SCM, terminal, debug, settings, tasks, testing, and views
src/vs/workbench/contrib
Rust Backend
Tauri commands and Rust services that own privileged work
- Tauri Entry · Native application entrypoint and Tauri bootstrap
src-tauri/src/main.rs - Tauri Bridge · Backend wiring that registers commands, state, and app services with Tauri
src-tauri/src/lib.rs - Command API · Backend command surface invoked from the webview for filesystem, process, search, git, terminal, settings, remote, and related operations
src-tauri/src/commands - State DB · Persistent storage for history, recent windows, window state, and related app data
crates/sidex-db - Settings Store · User settings, profiles, migrations, schema, and sync support
crates/sidex-settings - Workspace Core · Workspace, file tree, watcher, search, trust, decorations, and file operation logic
crates/sidex-workspace - Git Service · Repository discovery and source control operations such as status, diff, log, blame, branches, stash, and reset
crates/sidex-git - Terminal Engine · PTY, shell integration, ANSI handling, rendering support, selection, links, and terminal lifecycle
crates/sidex-terminal - LSP Service · Language protocol client and feature support for completion, hover, rename, diagnostics, formatting, and navigation
crates/sidex-lsp - Debug Protocol · Debug adapter transport, client, session, and launch config support
crates/sidex-dap
Extensions
Extension host, API, and packaging surface
- Extensions Runtime · Extension manifests, registry, marketplace/install flow, activation, VSIX handling, tree views, and webviews
crates/sidex-extensions - Ext API · Host-facing extension API and WIT world definitions
crates/sidex-extension-api - Host Sidecar · Node-compatible extension host bootstrap and polyfills
src-tauri/extension-host/host.cjs
Support
Build, tooling, and deployment support
- Marketplace Proxy · Cloudflare Worker that adapts Open VSX marketplace and gallery requests
infrastructure/marketplace-proxy/src/worker.ts - Build Tooling · Frontend build, Rust/Tauri packaging, WASM helpers, scripts, and CI workflows
vite.config.ts
Connections 26
- Workbench Shell → Workbench Parts: renders · Workbench bootstraps the IDE shell regions
- Workbench Shell → Platform Services: uses · Shell composes platform services through DI
- Workbench Shell → Sidex Adapters: adapts · Sidex-specific frontend bindings plug into the workbench
- Workbench Parts → Editor Stack: hosts · Editor UI is embedded in the workbench layout
- Workbench Parts → Workbench Features: hosts · Shell regions surface workbench feature contributions
- Platform Services → Command API: invokes · Frontend services call backend commands for privileged work
- Sidex Adapters → Command API: bridges · Sidex adapters map VS Code services to Tauri commands and events
- Editor Stack → LSP Service: requests · Editor language features are backed by language protocol services
- Workbench Features → Git Service: consumes · SCM views and diffs consume backend Git operations
- Workbench Features → Terminal Engine: drives · Terminal panel drives PTY sessions and shell integration
- Workbench Features → Debug Protocol: drives · Debug views and actions consume debug sessions
- Workbench Features → Workspace Core: observes · Files, search, and workspace UI reflect workspace state and watchers
- Tauri Entry → Tauri Bridge: loads · Native entrypoint hands off to backend wiring
- Tauri Bridge → Command API: registers · Backend wiring exposes command handlers to the frontend
- Command API → State DB: persists · Commands read and write application state and history
- Command API → Settings Store: reads/writes · Commands manage configuration, profiles, and sync data
- Command API → Workspace Core: services · Command handlers delegate workspace, file, and watcher logic
- Command API → Git Service: services · Command handlers delegate Git operations
- Command API → Terminal Engine: services · Command handlers manage terminal and PTY lifecycle
- Command API → LSP Service: services · Command handlers expose language-server operations
- Command API → Extensions Runtime: services · Command handlers expose extension install and runtime operations
- Extensions Runtime → Ext API: implements · Extension runtime is built around the host-facing API
- Extensions Runtime → Host Sidecar: launches · Extension runtime bootstraps the sidecar host process
- Extensions Runtime → Marketplace Proxy: queries · Extension discovery and install flows can route through the marketplace proxy
- Build Tooling → Workbench Shell: builds · Vite/TypeScript tooling builds the frontend workbench
- Build Tooling → Tauri Entry: packages · Rust/Tauri tooling packages the native backend