How wavetermdev/waveterm works
Wave Terminal is an AI-integrated desktop terminal for organizing terminal sessions, editors, previews, browsers, and AI assistants into workspaces. Users create and arrange blocks, connect to local or remote shells, and interact with their output; they can also edit and preview files or ask Wave AI to analyze workspace context and perform approved file operations. The frontend communicates with backend services through RPC and events, while controllers manage processes, connections, and durable jobs. README capabilities fill in branches not visible in the sampled source; those implementation details are represented at their supported directory paths.
Main entry points: service.go Backend services · workspace.tsx Tabs and blocks · wshclient.ts RPC client · jobcontroller.go Durable jobs
Components 29
Desktop experience
- Workspace UI
frontend/app/app.tsx - Tabs and blocks
frontend/app/workspace/workspace.tsx - Block layout
frontend/layout/index.ts - Terminal view
frontend/app/view/term/term.tsx - Code editor
frontend/app/view/codeeditor/codeeditor.tsx - File previews
frontend/app/view/preview/preview.tsx - Web view
frontend/app/view/webview/webview.tsx
Workspace runtime
- RPC client
frontend/app/store/wshclient.ts - Electron main
emain/emain.ts - Wave server
cmd/server/main-server.go - Backend services
pkg/service/service.go - Block controllers
pkg/blockcontroller/blockcontroller.go - Shell execution
pkg/blockcontroller/shellcontroller.go - Durable jobs
pkg/jobcontroller/jobcontroller.go - Job manager
pkg/jobmanager/jobmanager.go - Output streaming
pkg/streamclient/streambroker.go
AI assistance
- AI panel
frontend/app/aipanel/aipanel.tsx - AI orchestration
pkg/aiusechat/usechat.go - AI tools
pkg/aiusechat/tools.go - Model providers
pkg/aiusechat/usechat-backend.go
Connections and files
- SSH connections
pkg/remote/conncontroller/conncontroller.go - WSH commands
cmd/wsh/cmd/wshcmd-root.go - Remote file access
pkg/remote/fileshare/wshfs/wshfs.go
Persistence and events
- Wave object store
pkg/wstore/wstore.go - Block file store
pkg/filestore/blockstore.go - Event broker
pkg/wps/wps.go
Other components
- Wave user
- Model services
- SSH host
Connections 38
- Wave user → Workspace UI: uses
- Workspace UI → Tabs and blocks: renders
- Tabs and blocks → Block layout: arranges
- Tabs and blocks → Terminal view: hosts
- Tabs and blocks → Code editor: hosts
- Tabs and blocks → File previews: hosts
- Tabs and blocks → Web view: hosts
- Tabs and blocks → AI panel: hosts
- Workspace UI → RPC client: requests
- RPC client → Electron main: IPC requests
- Electron main → Wave server: RPC and events
- Wave server → Backend services: dispatches
- Backend services → Block controllers: controls blocks
- Block controllers → Shell execution: runs shell
- Shell execution → SSH connections: starts remote shells
- SSH connections → SSH host: connects
- Backend services → Durable jobs: manages jobs
- Durable jobs → Job manager: attaches job
- Durable jobs → Output streaming: streams output
- Job manager → Output streaming: transfers output
- Output streaming → Terminal view: delivers output
- Backend services → Remote file access: accesses files
- Remote file access → SSH host: reads and writes
- Code editor → RPC client: file operations
- File previews → RPC client: requests file data
- AI panel → RPC client: submits chat
- Backend services → AI orchestration: routes chat
- AI orchestration → Model providers: selects backend
- Model providers → Model services: sends prompts
- AI orchestration → AI tools: invokes tools
- AI tools → Remote file access: file operations
- AI tools → Terminal view: reads context
- Backend services → Wave object store: reads and writes
- Durable jobs → Wave object store: updates job state
- Durable jobs → Block file store: stores output
- Backend services → Event broker: publishes events
- Event broker → RPC client: delivers updates
- WSH commands → Backend services: invokes commands