vscode-pi-companion 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,14 +6,14 @@ A VS Code extension that provides real-time IDE context (files, selection) to pi
|
|
|
6
6
|
|
|
7
7
|
- **Real-time context**: Monitors open files, cursor position, and selection
|
|
8
8
|
- **Instant updates**: Pushes context changes via SSE
|
|
9
|
-
- **Seamless integration**:
|
|
9
|
+
- **Seamless integration**: Injects the current selection, or the active file (first 100 lines) if nothing is selected, into the LLM context
|
|
10
10
|
- **Widget display**: Shows current file/selection in pi UI
|
|
11
11
|
|
|
12
12
|
## Architecture
|
|
13
13
|
|
|
14
14
|
**VS Code Extension** → SSE ← **pi Extension**
|
|
15
15
|
|
|
16
|
-
- **VS Code**: Context tracking, SSE server
|
|
16
|
+
- **VS Code**: Context tracking, SSE server, MCP server
|
|
17
17
|
- **pi**: SSE client, Widget, Context injection
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
@@ -21,25 +21,17 @@ A VS Code extension that provides real-time IDE context (files, selection) to pi
|
|
|
21
21
|
### 1. Install pi Extension
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
pi install
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Or manually:
|
|
28
|
-
```bash
|
|
29
|
-
mkdir -p ~/.pi/agent/extensions/vscode-pi-companion
|
|
30
|
-
git clone git@github.com:ravshansbox/vscode-pi-companion.git ~/.pi/agent/extensions/vscode-pi-companion
|
|
31
|
-
cd ~/.pi/agent/extensions/vscode-pi-companion
|
|
32
|
-
npm install
|
|
24
|
+
pi install npm:vscode-pi-companion
|
|
33
25
|
```
|
|
34
26
|
|
|
35
27
|
### 2. Install VS Code Extension
|
|
36
28
|
|
|
37
29
|
The pi extension will auto-install the VS Code extension when you run `pi` in a VS Code terminal.
|
|
38
30
|
|
|
39
|
-
Alternatively, install
|
|
31
|
+
Alternatively, install it from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=ravshansbox.vscode-pi-companion) or run:
|
|
32
|
+
|
|
40
33
|
```bash
|
|
41
|
-
|
|
42
|
-
code --install-extension vscode-pi-companion.vsix
|
|
34
|
+
code --install-extension ravshansbox.vscode-pi-companion
|
|
43
35
|
```
|
|
44
36
|
|
|
45
37
|
Then reload VS Code window.
|
|
@@ -51,17 +43,25 @@ Then reload VS Code window.
|
|
|
51
43
|
3. Run `pi`
|
|
52
44
|
4. The extension auto-connects and shows current file in widget
|
|
53
45
|
5. Select code → widget updates instantly
|
|
54
|
-
6.
|
|
46
|
+
6. The selection (or the active file) is injected into LLM context automatically
|
|
55
47
|
|
|
56
48
|
## Widget Display
|
|
57
49
|
|
|
58
50
|
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
vscode: disconnected # VS Code extension not reachable
|
|
52
|
+
filename # no selection
|
|
53
|
+
filename L9 # single line
|
|
54
|
+
filename L9:14 # multi-line selection
|
|
55
|
+
filename L9:14 +2 # 2 more files open
|
|
62
56
|
```
|
|
63
57
|
|
|
64
|
-
##
|
|
58
|
+
## VS Code Commands
|
|
59
|
+
|
|
60
|
+
- `PI Companion: Start Server`
|
|
61
|
+
- `PI Companion: Stop Server`
|
|
62
|
+
- `PI Companion: Show Status`
|
|
63
|
+
|
|
64
|
+
## pi Tools (for LLM)
|
|
65
65
|
|
|
66
66
|
| Tool | Description |
|
|
67
67
|
|------|-------------|
|
|
@@ -69,15 +69,25 @@ Then reload VS Code window.
|
|
|
69
69
|
| `get_current_file` | Current file with selection |
|
|
70
70
|
| `list_open_files` | List all open files |
|
|
71
71
|
|
|
72
|
+
## MCP Server (for other agents)
|
|
73
|
+
|
|
74
|
+
The VS Code extension serves MCP at `http://127.0.0.1:$PI_COMPANION_PORT/mcp`. Send `Authorization: Bearer $PI_COMPANION_AUTH_TOKEN`. Both variables are set in VS Code terminals.
|
|
75
|
+
|
|
76
|
+
| Tool | Description |
|
|
77
|
+
|------|-------------|
|
|
78
|
+
| `get_open_files` | Open files with content, cursor and selection |
|
|
79
|
+
| `read_file` | Read a file by absolute path |
|
|
80
|
+
| `goto` | Open a file at a line and character |
|
|
81
|
+
|
|
72
82
|
## Development
|
|
73
83
|
|
|
74
84
|
```bash
|
|
75
|
-
# Build VS Code extension
|
|
76
85
|
npm install
|
|
77
86
|
npm run compile
|
|
87
|
+
npm test
|
|
78
88
|
|
|
79
89
|
# Package as .vsix
|
|
80
|
-
|
|
90
|
+
npm run package
|
|
81
91
|
```
|
|
82
92
|
|
|
83
93
|
Press F5 to run in Extension Development Host.
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"displayName": "PI Companion",
|
|
4
4
|
"description": "Share VS Code context with pi coding agent",
|
|
5
5
|
"repository": "https://github.com/ravshansbox/vscode-pi-companion",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.9",
|
|
7
7
|
"publisher": "ravshansbox",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"pi-package"
|