Skip to content

Commit 1efa5ad

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/terminal-drag-drop
2 parents 4b3e314 + 0ade6ee commit 1efa5ad

375 files changed

Lines changed: 25396 additions & 8520 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: wavetermdev

.github/copilot-instructions.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Wave Terminal — Copilot Instructions
2+
3+
## Project Rules
4+
5+
- See the overview of the project in `.kilocode/rules/overview.md`
6+
- Read and follow all guidelines in `.kilocode/rules/rules.md`
7+
8+
---
9+
10+
## Skill Guides
11+
12+
This project uses a set of "skill" guides — focused how-to documents for common implementation tasks. When your task matches one of the descriptions below, **read the linked SKILL.md file before proceeding** and follow its instructions precisely.
13+
14+
| Skill | File | Description |
15+
| ------------ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16+
| add-config | `.kilocode/skills/add-config/SKILL.md` | Guide for adding new configuration settings to Wave Terminal. Use when adding a new setting to the configuration system, implementing a new config key, or adding user-customizable settings. |
17+
| add-rpc | `.kilocode/skills/add-rpc/SKILL.md` | Guide for adding new RPC calls to Wave Terminal. Use when implementing new RPC commands, adding server-client communication methods, or extending the RPC interface with new functionality. |
18+
| add-wshcmd | `.kilocode/skills/add-wshcmd/SKILL.md` | Guide for adding new wsh commands to Wave Terminal. Use when implementing new CLI commands, adding command-line functionality, or extending the wsh command interface. |
19+
| context-menu | `.kilocode/skills/context-menu/SKILL.md` | Guide for creating and displaying context menus in Wave Terminal. Use when implementing right-click menus, adding context menu items, creating submenus, or handling menu interactions with checkboxes and separators. |
20+
| create-view | `.kilocode/skills/create-view/SKILL.md` | Guide for implementing a new view type in Wave Terminal. Use when creating a new view component, implementing the ViewModel interface, registering a new view type in BlockRegistry, or adding a new content type to display within blocks. |
21+
| electron-api | `.kilocode/skills/electron-api/SKILL.md` | Guide for adding new Electron APIs to Wave Terminal. Use when implementing new frontend-to-electron communications via preload/IPC. |
22+
| waveenv | `.kilocode/skills/waveenv/SKILL.md` | Guide for creating WaveEnv narrowings in Wave Terminal. Use when writing a named subset type of WaveEnv for a component tree, documenting environmental dependencies, or enabling mock environments for preview/test server usage. |
23+
| wps-events | `.kilocode/skills/wps-events/SKILL.md` | Guide for working with Wave Terminal's WPS (Wave PubSub) event system. Use when implementing new event types, publishing events, subscribing to events, or adding asynchronous communication between components. |
24+
25+
> **How skills work:** Each skill is a self-contained guide covering the exact files to edit, patterns to follow, and steps to take for a specific type of task in this codebase. If your task matches a skill's description, open that SKILL.md and treat it as your primary reference for the implementation.
26+
27+
---
28+
29+
## Preview Server
30+
31+
To run the standalone component preview (no Electron, no backend required):
32+
33+
```
34+
task preview
35+
```
36+
37+
This runs `cd frontend/preview && npx vite` and serves at **http://localhost:7007** (port configured in `frontend/preview/vite.config.ts`).
38+
39+
To build a static preview: `task build:preview`
40+
41+
**Do NOT use any of the following to start the preview — they all launch the full Electron app or serve the wrong content:**
42+
43+
- `npm run dev` — runs `electron-vite dev`, launches Electron
44+
- `npm run start` — also launches Electron
45+
- `npx vite` from the repo root — uses the Electron-Vite config, not the preview app
46+
- Serving the `dist/` directory — the preview app is never built there; it has its own build output

.github/workflows/build-helper.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
run: |
7575
git config --global url.https://github.com/.insteadof ssh://git@github.com/
7676
git config --global url.https://github.com/.insteadof git@github.com:
77-
- uses: nick-fields/retry@v3
77+
- uses: nick-fields/retry@v4
7878
name: npm ci
7979
with:
8080
command: npm ci --no-audit --no-fund
@@ -132,7 +132,7 @@ jobs:
132132
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
133133
SNAPCRAFT_BUILD_ENVIRONMENT: host
134134
# Retry Darwin build in case of notarization failures
135-
- uses: nick-fields/retry@v3
135+
- uses: nick-fields/retry@v4
136136
name: Build (Darwin)
137137
if: matrix.platform == 'darwin'
138138
with:

.github/workflows/bump-version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- name: Get App Token
32-
uses: actions/create-github-app-token@v2
32+
uses: actions/create-github-app-token@v3
3333
id: app-token
3434
with:
3535
app-id: ${{ vars.WAVE_BUILDER_APPID }}
@@ -44,7 +44,7 @@ jobs:
4444
node-version: ${{env.NODE_VERSION}}
4545
cache: npm
4646
cache-dependency-path: package-lock.json
47-
- uses: nick-fields/retry@v3
47+
- uses: nick-fields/retry@v4
4848
name: npm ci
4949
with:
5050
command: npm ci --no-audit --no-fund

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
node-version: ${{env.NODE_VERSION}}
7777
cache: npm
7878
cache-dependency-path: package-lock.json
79-
- uses: nick-fields/retry@v3
79+
- uses: nick-fields/retry@v4
8080
name: npm ci
8181
with:
8282
command: npm ci --no-audit --no-fund

.github/workflows/copilot-setup-steps.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ on:
77
pull_request:
88
paths: [.github/workflows/copilot-setup-steps.yml]
99

10-
env:
11-
GO_VERSION: "1.25.6"
12-
NODE_VERSION: 22
10+
# Note: global env vars are NOT used here — they are not reliable in all
11+
# GitHub Actions contexts (e.g. Copilot setup steps). Values are inlined
12+
# directly into each step that needs them.
1313

1414
jobs:
1515
copilot-setup-steps:
@@ -23,12 +23,12 @@ jobs:
2323
# Go + Node versions match your helper
2424
- uses: actions/setup-go@v6
2525
with:
26-
go-version: ${{ env.GO_VERSION }}
26+
go-version: "1.25.6"
2727
cache-dependency-path: go.sum
2828

2929
- uses: actions/setup-node@v6
3030
with:
31-
node-version: ${{ env.NODE_VERSION }}
31+
node-version: 22
3232
cache: npm
3333
cache-dependency-path: package-lock.json
3434

@@ -48,7 +48,7 @@ jobs:
4848
git config --global url.https://github.com/.insteadof git@github.com:
4949
5050
# Warm caches only (no builds)
51-
- uses: nick-fields/retry@v3
51+
- uses: nick-fields/retry@v4
5252
name: npm ci
5353
with:
5454
command: npm ci --no-audit --no-fund
@@ -60,4 +60,8 @@ jobs:
6060
GIT_TERMINAL_PROMPT: "0"
6161

6262
- name: Pre-fetch Go modules
63-
run: go mod download
63+
env:
64+
GOTOOLCHAIN: auto
65+
run: |
66+
go version
67+
go mod download

.github/workflows/deploy-docsite.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
version: 3.x
4545
repo-token: ${{ secrets.GITHUB_TOKEN }}
46-
- uses: nick-fields/retry@v3
46+
- uses: nick-fields/retry@v4
4747
name: npm ci
4848
with:
4949
command: npm ci --no-audit --no-fund
@@ -55,7 +55,7 @@ jobs:
5555
- name: Upload Build Artifact
5656
# Only upload the build artifact when pushed to the main branch
5757
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
58-
uses: actions/upload-pages-artifact@v3
58+
uses: actions/upload-pages-artifact@v4
5959
with:
6060
path: docs/build
6161
deploy:

.github/workflows/testdriver-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
node-version: ${{env.NODE_VERSION}}
5353
cache: npm
5454
cache-dependency-path: package-lock.json
55-
- uses: nick-fields/retry@v3
55+
- uses: nick-fields/retry@v4
5656
name: npm ci
5757
with:
5858
command: npm ci --no-audit --no-fund

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ out/
1616
make/
1717
artifacts/
1818
mikework/
19+
aiplans/
1920
manifests/
2021
.env
2122
out
@@ -36,3 +37,5 @@ storybook-static/
3637
test-results.xml
3738

3839
docsite/
40+
41+
.kilo-format-temp-*

.kilocode/rules/overview.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Wave Terminal - High Level Architecture Overview
2+
3+
## Project Description
4+
5+
Wave Terminal is an open-source AI-native terminal built for seamless workflows. It's an Electron application that serves as a command line terminal host (it hosts CLI applications rather than running inside a CLI). The application combines a React frontend with a Go backend server to provide a modern terminal experience with advanced features.
6+
7+
## Top-Level Directory Structure
8+
9+
```
10+
waveterm/
11+
├── emain/ # Electron main process code
12+
├── frontend/ # React application (renderer process)
13+
├── cmd/ # Go command-line applications
14+
├── pkg/ # Go packages/modules
15+
├── db/ # Database migrations
16+
├── docs/ # Documentation (Docusaurus)
17+
├── build/ # Build configuration and assets
18+
├── assets/ # Application assets (icons, images)
19+
├── public/ # Static public assets
20+
├── tests/ # Test files
21+
├── .github/ # GitHub workflows and configuration
22+
└── Configuration files (package.json, tsconfig.json, etc.)
23+
```
24+
25+
## Architecture Components
26+
27+
### 1. Electron Main Process (`emain/`)
28+
29+
The Electron main process handles the native desktop application layer:
30+
31+
**Key Files:**
32+
33+
- [`emain.ts`](emain/emain.ts) - Main entry point, application lifecycle management
34+
- [`emain-window.ts`](emain/emain-window.ts) - Window management (`WaveBrowserWindow` class)
35+
- [`emain-tabview.ts`](emain/emain-tabview.ts) - Tab view management (`WaveTabView` class)
36+
- [`emain-wavesrv.ts`](emain/emain-wavesrv.ts) - Go backend server integration
37+
- [`emain-wsh.ts`](emain/emain-wsh.ts) - WSH (Wave Shell) client integration
38+
- [`emain-ipc.ts`](emain/emain-ipc.ts) - IPC handlers for frontend ↔ main process communication
39+
- [`emain-menu.ts`](emain/emain-menu.ts) - Application menu system
40+
- [`updater.ts`](emain/updater.ts) - Auto-update functionality
41+
- [`preload.ts`](emain/preload.ts) - Preload script for renderer security
42+
- [`preload-webview.ts`](emain/preload-webview.ts) - Webview preload script
43+
44+
### 2. Frontend React Application (`frontend/`)
45+
46+
The React application runs in the Electron renderer process:
47+
48+
**Structure:**
49+
50+
```
51+
frontend/
52+
├── app/ # Main application code
53+
│ ├── app.tsx # Root App component
54+
│ ├── aipanel/ # AI panel UI
55+
│ ├── block/ # Block-based UI components
56+
│ ├── element/ # Reusable UI elements
57+
│ ├── hook/ # Custom React hooks
58+
│ ├── modals/ # Modal components
59+
│ ├── store/ # State management (Jotai)
60+
│ ├── tab/ # Tab components
61+
│ ├── view/ # Different view types
62+
│ │ ├── codeeditor/ # Code editor (Monaco)
63+
│ │ ├── preview/ # File preview
64+
│ │ ├── sysinfo/ # System info view
65+
│ │ ├── term/ # Terminal view
66+
│ │ ├── tsunami/ # Tsunami builder view
67+
│ │ ├── vdom/ # Virtual DOM view
68+
│ │ ├── waveai/ # AI chat integration
69+
│ │ ├── waveconfig/ # Config editor view
70+
│ │ └── webview/ # Web view
71+
│ └── workspace/ # Workspace management
72+
├── builder/ # Builder app entry
73+
├── layout/ # Layout system
74+
├── preview/ # Standalone preview renderer
75+
├── types/ # TypeScript type definitions
76+
└── util/ # Utility functions
77+
```
78+
79+
**Key Technologies:**
80+
81+
- Electron (desktop application shell)
82+
- React 19 with TypeScript
83+
- Jotai for state management
84+
- Monaco Editor for code editing
85+
- XTerm.js for terminal emulation
86+
- Tailwind CSS v4 for styling
87+
- SCSS for additional styling (deprecated, new components should use Tailwind)
88+
- Vite / electron-vite for bundling
89+
- Task (Taskfile.yml) for build and code generation commands
90+
91+
### 3. Go Backend Server (`cmd/server/`)
92+
93+
The Go backend server handles all heavy lifting operations:
94+
95+
**Entry Point:** [`main-server.go`](cmd/server/main-server.go)
96+
97+
### 4. Go Packages (`pkg/`)
98+
99+
The Go codebase is organized into modular packages:
100+
101+
**Key Packages:**
102+
103+
- `wstore/` - Database and storage layer
104+
- `wconfig/` - Configuration management
105+
- `wcore/` - Core business logic
106+
- `wshrpc/` - RPC communication system
107+
- `wshutil/` - WSH (Wave Shell) utilities
108+
- `blockcontroller/` - Block execution management
109+
- `remote/` - Remote connection handling
110+
- `filestore/` - File storage system
111+
- `web/` - Web server and WebSocket handling
112+
- `telemetry/` - Usage analytics and telemetry
113+
- `waveobj/` - Core data objects
114+
- `service/` - Service layer
115+
- `wps/` - Wave PubSub event system
116+
- `waveai/` - AI functionality
117+
- `shellexec/` - Shell execution
118+
- `util/` - Common utilities
119+
120+
### 5. Command Line Tools (`cmd/`)
121+
122+
Key Go command-line utilities:
123+
124+
- `wsh/` - Wave Shell command-line tool
125+
- `server/` - Main backend server
126+
- `generatego/` - Code generation
127+
- `generateschema/` - Schema generation
128+
- `generatets/` - TypeScript generation
129+
130+
## Communication Architecture
131+
132+
The core communication system is built around the **WSH RPC (Wave Shell RPC)** system, which provides a unified interface for all inter-process communication: frontend ↔ Go backend, Electron main process ↔ backend, and backend ↔ remote systems (SSH, WSL).
133+
134+
### WSH RPC System (`pkg/wshrpc/`)
135+
136+
The WSH RPC system is the backbone of Wave Terminal's communication architecture:
137+
138+
**Key Components:**
139+
140+
- [`wshrpctypes.go`](pkg/wshrpc/wshrpctypes.go) - Core RPC interface and type definitions (source of truth for all RPC commands)
141+
- [`wshserver/`](pkg/wshrpc/wshserver/) - Server-side RPC implementation
142+
- [`wshremote/`](pkg/wshrpc/wshremote/) - Remote connection handling
143+
- [`wshclient.go`](pkg/wshrpc/wshclient.go) - Go client for making RPC calls
144+
- [`frontend/app/store/wshclientapi.ts`](frontend/app/store/wshclientapi.ts) - Generated TypeScript RPC client
145+
146+
**Routing:** Callers address RPC calls using _routes_ (e.g. a block ID, connection name, or `"waveapp"`) rather than caring about the underlying transport. The RPC layer resolves the route to the correct transport (WebSocket, Unix socket, SSH tunnel, stdio) automatically. This means the same RPC interface works whether the target is local or a remote SSH connection.
147+
148+
## Development Notes
149+
150+
- **Build commands** - Use `task` (Taskfile.yml) for all build, generate, and packaging commands
151+
- **Code generation** - Run `task generate` after modifying Go types in `pkg/wshrpc/wshrpctypes.go`, `pkg/wconfig/settingsconfig.go`, or `pkg/waveobj/wtypemeta.go`
152+
- **Testing** - Vitest for frontend unit tests; standard `go test` for Go packages
153+
- **Database migrations** - SQL migration files in `db/migrations-wstore/` and `db/migrations-filestore/`
154+
- **Documentation** - Docusaurus site in `docs/`

0 commit comments

Comments
 (0)