Skip to content

Commit 5291410

Browse files
committed
Update README.md to enhance project documentation, including an overview of features, technology stack, development setup, deployment instructions, and architecture details for the Pyright WebSocket bridge.
1 parent 05fc2e4 commit 5291410

File tree

1 file changed

+74
-11
lines changed

1 file changed

+74
-11
lines changed

README.md

Lines changed: 74 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
11
# Pyright LSP WebSocket Bridge
22

3-
WebSocket bridge for Pyright language server with bundled Node.js runtime.
3+
A WebSocket bridge for the Pyright language server with a bundled Node.js runtime. This service provides Python language server capabilities (autocomplete, type checking, diagnostics, etc.) through a WebSocket interface, primarily used by the Jesse dashboard to provide IntelliSense features for Jesse strategies.
4+
5+
## Overview
6+
7+
This repository delivers:
8+
- **WebSocket Bridge** - Translates WebSocket messages to Pyright LSP protocol
9+
- **Bundled Runtime** - Includes Node.js, eliminating system dependencies
10+
- **Cross-Platform Support** - Works on Linux, macOS, and Windows
11+
- **Optimized Builds** - ~70% size reduction with production-only dependencies
12+
13+
## Technology Stack
14+
15+
- **TypeScript** - Main language for the bridge implementation
16+
- **Node.js** - Runtime environment
17+
- **Pyright** - Microsoft's static type checker for Python
18+
- **WebSocket (ws)** - WebSocket communication
19+
- **vscode-ws-jsonrpc** - JSON-RPC over WebSocket
20+
- **esbuild** - Fast JavaScript bundler
21+
22+
## Development
23+
24+
### Setup
25+
```bash
26+
npm install
27+
```
28+
29+
### Running in Development Mode
30+
```bash
31+
npm start -- \
32+
--port 9011 \
33+
--project-root /path/to/project \
34+
--jesse-relative-path jesse_folder_name \
35+
--bot-relative-path jesse-bot_folder_name
36+
```
37+
38+
### Command-Line Arguments
39+
- `--port` - WebSocket server port (default: 9011)
40+
- `--project-root` - Root directory of the Python project
41+
- `--jesse-relative-path` - Relative path to Jesse framework folder
42+
- `--bot-relative-path` - Relative path to Jesse bot folder
443

544
## Build
645

@@ -19,14 +58,14 @@ Outputs:
1958
- `darwin-x64.tar.gz` / `darwin-arm64.tar.gz`
2059
- `win32-x64.zip`
2160

22-
## Deploy & Run
61+
## Deployment & Usage
2362

2463
### Linux/macOS
2564
```bash
26-
# Extract
65+
# Extract the archive
2766
tar -xzf linux-x64.tar.gz
2867

29-
# Run
68+
# Run the server
3069
cd linux-x64
3170
./start.sh \
3271
--port 9011 \
@@ -37,22 +76,46 @@ cd linux-x64
3776

3877
### Windows
3978
```cmd
40-
REM Extract linux-x64.zip, then:
41-
cd linux-x64
42-
start.bat --port 9011 --project-root C:\path\to\project --jesse-relative-path jesse_folder_name --bot-relative-path jesse-bot_folder_nam
79+
REM Extract win32-x64.zip
80+
81+
REM Run the server
82+
cd win32-x64
83+
start.bat --port 9011 --project-root C:\path\to\project --jesse-relative-path jesse_folder_name --bot-relative-path jesse-bot_folder_name
4384
```
4485

86+
## Configuration
87+
88+
The Pyright language server is configured via `pyrightconfig.json` in the project root. You can customize type checking behavior, Python version, include/exclude patterns, and more.
89+
4590
## Features
4691

4792
- ✅ Bundled Node.js runtime (no system dependencies)
4893
- ✅ Optimized build (~70% size reduction)
4994
- ✅ Cross-platform support (Linux, macOS, Windows)
5095
- ✅ Production-ready dependencies only
96+
- ✅ WebSocket-based communication
97+
- ✅ Full Pyright LSP capabilities
5198

52-
## Development
99+
## Architecture
100+
101+
The bridge acts as a middleware between WebSocket clients (like the Jesse dashboard) and the Pyright language server:
53102

54-
```bash
55-
npm install
56-
npm start -- --port 9011 --project-root /path/to/project ...
57103
```
104+
Client (Jesse Dashboard) <-> WebSocket <-> Bridge <-> Pyright LSP
105+
```
106+
107+
Messages are translated between WebSocket and the Language Server Protocol, enabling Python IntelliSense features in web-based interfaces.
108+
109+
## File Structure
110+
111+
- `index.ts` - Entry point and CLI argument handling
112+
- `pyright-bridge.ts` - WebSocket bridge implementation
113+
- `pyrightconfig.json` - Pyright configuration
114+
- `package.json` - Node.js project configuration
115+
- `build.sh` - Build script for Linux x64
116+
- `build-all.sh` - Build script for all platforms
117+
- `output/` - Build output directory (generated)
118+
119+
## License
58120

121+
This project is part of the Jesse ecosystem.

0 commit comments

Comments
 (0)