Skip to content

Commit b732ea7

Browse files
committed
docs
1 parent 0cbf9da commit b732ea7

1 file changed

Lines changed: 23 additions & 85 deletions

File tree

‎README.md‎

Lines changed: 23 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -18,66 +18,24 @@ Hosted at **[web.eca.dev](https://web.eca.dev)** and deployed automatically via
1818
3. The frontend connects to the ECA process via REST (commands) and SSE (live updates).
1919
4. Both the editor and the web UI can send prompts, approve tool calls, and control chat — first response wins.
2020

21-
## Project structure
21+
The web app is a thin shell around the **shared webview UI** (`eca-webview/` git submodule) — the same chat UI used in VS Code and IntelliJ. A bridge layer (`src/bridge/`) fakes the editor environment by:
2222

23-
```
24-
eca-web/
25-
├── src/ # Web shell — connection UI + bridge layer
26-
│ ├── App.tsx # Router: / → /remote
27-
│ ├── main.tsx # Entry point
28-
│ ├── bridge/
29-
│ │ ├── api.ts # REST client for ECA remote server
30-
│ │ ├── sse.ts # SSE client (fetch + ReadableStream, not EventSource)
31-
│ │ └── transport.ts # WebBridge: maps SSE events ↔ webview postMessage protocol
32-
│ ├── pages/
33-
│ │ └── RemotePage.tsx # Connection form + renders webview app on success
34-
│ └── styles/
35-
│ └── web-theme.css # Dark theme CSS variables
36-
├── eca-webview/ # Shared webview UI (git submodule)
37-
│ └── src/ # Chat UI, Redux store, components — shared with VS Code / IntelliJ
38-
├── public/
39-
│ ├── 404.html # GitHub Pages SPA redirect
40-
│ └── CNAME # web.eca.dev
41-
└── .github/
42-
└── workflows/
43-
└── deploy.yml # Build + deploy to GitHub Pages
44-
```
45-
46-
The `eca-webview/` directory is a **git submodule** containing the shared webview UI used by the VS Code extension, IntelliJ plugin, and this web app. The Vite alias `@webview` points to `eca-webview/src`.
47-
48-
## Run locally with Docker
49-
50-
The fastest way to run eca-web on your machine — no Node.js required:
23+
- **Inbound:** SSE events from the server are dispatched as `window.postMessage` calls, matching the message types the editor extensions use.
24+
- **Outbound:** The webview's `webviewSend()` calls are intercepted via `window.__ecaWebTransport` and mapped to REST API calls.
5125

52-
```bash
53-
docker run -p 8080:80 ghcr.io/editor-code-assistant/eca-web
54-
```
55-
56-
Then open [http://localhost:8080](http://localhost:8080).
26+
This means the chat UI, Redux store, and all components work identically across editors — only the transport layer differs.
5727

58-
Or using Docker Compose:
59-
60-
```bash
61-
# Download the compose file (or clone the repo)
62-
curl -O https://raw.githubusercontent.com/editor-code-assistant/eca-web/master/docker-compose.yml
63-
64-
docker compose up
65-
```
66-
67-
### Available tags
28+
### Authentication
6829

69-
| Tag | Description |
70-
|-----|-------------|
71-
| `latest` | Latest build from `master` |
72-
| `<sha>` | Pinned to a specific commit |
73-
| `<version>` | Semantic version (e.g. `1.0.0`, `1.0`) when tagged |
30+
All requests use `Authorization: Bearer <token>` headers — no cookies. SSE is consumed via `fetch()` + `ReadableStream` (not `EventSource`) to support custom auth headers.
7431

7532
## Development setup
7633

7734
```bash
7835
git clone --recurse-submodules https://github.com/editor-code-assistant/eca-web.git
7936
cd eca-web
8037
npm install
38+
npm run dev # Dev server on http://localhost:8080
8139
```
8240

8341
If you already cloned without `--recurse-submodules`:
@@ -86,14 +44,27 @@ If you already cloned without `--recurse-submodules`:
8644
git submodule update --init
8745
```
8846

47+
Other commands:
48+
8949
```bash
90-
npm run dev # Start dev server on http://localhost:5180
9150
npm run build # Type-check + production build → dist/
9251
npm run preview # Serve the production build locally
9352
```
9453

54+
### Docker
55+
56+
Run eca-web without Node.js:
57+
58+
```bash
59+
docker run -p 8080:80 ghcr.io/editor-code-assistant/eca-web
60+
```
61+
62+
Then open [http://localhost:8080](http://localhost:8080).
63+
9564
## Connecting to ECA
9665

66+
For full remote configuration options (host, port, password, etc.), see the **[Remote Configuration docs](https://eca.dev/config/remote)**.
67+
9768
### From URL (automatic)
9869

9970
ECA logs a URL like:
@@ -102,44 +73,11 @@ ECA logs a URL like:
10273
🔗 https://web.eca.dev?host=192.168.1.42:7888&token=a3f8b2...
10374
```
10475

105-
Click it — the frontend auto-connects, strips the token from the URL, and saves the connection to `localStorage`.
76+
Click it — the frontend auto-connects, strips the token from the URL, and saves the connection to localStorage.
10677

10778
### Manual
10879

109-
Go to [web.eca.dev](https://web.eca.dev) and enter the host (`ip:port`) and token in the connection form.
110-
111-
### ECA config
112-
113-
```json
114-
{
115-
"remote": {
116-
"enabled": true,
117-
"host": "myserver.example.com",
118-
"port": 7888,
119-
"password": "my-secret"
120-
}
121-
}
122-
```
123-
124-
| Field | Default | Description |
125-
|------------|----------------------|---------------------------------------------------|
126-
| `enabled` | `false` | Enable the embedded HTTP server |
127-
| `host` | auto-detected LAN IP | Host in the logged URL (LAN IP, domain, tunnel) |
128-
| `port` | random free port | Port the HTTP server listens on |
129-
| `password` | auto-generated token | Auth token; auto-generated and logged if unset |
130-
131-
## Architecture
132-
133-
The web app is a thin shell around the **shared webview UI** (`eca-webview`). The bridge layer (`src/bridge/`) translates between two protocols:
134-
135-
- **Inbound** (server → browser): SSE events are parsed and dispatched as `window.postMessage` calls, matching the same message types the VS Code / IntelliJ extensions use.
136-
- **Outbound** (browser → server): The webview's `webviewSend()` calls are intercepted via `window.__ecaWebTransport` and mapped to REST API calls.
137-
138-
This means the chat UI, Redux store, and all components work identically across VS Code, IntelliJ, and the web — only the transport layer differs.
139-
140-
### Authentication
141-
142-
All requests use `Authorization: Bearer <token>` headers. No cookies — avoids `Secure`/`SameSite` issues with non-localhost connections. SSE is consumed via `fetch()` + `ReadableStream` (not `EventSource`) to support custom headers.
80+
Go to [web.eca.dev](https://web.eca.dev), enter the host IP and password, and hit **Discover & Connect** — it scans ports 7777–7787 and connects to any running ECA sessions automatically.
14381

14482
## License
14583

0 commit comments

Comments
 (0)