Skip to content

Commit f424d90

Browse files
authored
Merge pull request #22 from mikahoy045/vscode-ext
feat(vscode): add VS Code extension for remote delta uploads
2 parents 619e4f8 + 1218c29 commit f424d90

File tree

120 files changed

+43912
-1
lines changed

Some content is hidden

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

120 files changed

+43912
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ __pycache__/
1313
.vscode/settings.json
1414
.kiro/settings/mcp.json
1515
.vscode/settings.json
16-
.vscode/settings.json
16+
.context-engine
1717
paper.md
1818
/semantic-search
1919
/codebase-index-cli
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# Context-Engine RMCP + Upload reverse proxy
2+
# Copy to /etc/nginx/conf.d/context-engine.conf (or similar) and reload nginx.
3+
4+
upstream rmcp_memory_backend {
5+
server 127.0.0.1:8002; # mcp-search-http-dev-remote (RMCP memory)
6+
keepalive 8;
7+
}
8+
9+
upstream rmcp_indexer_backend {
10+
server 127.0.0.1:8003; # mcp-indexer-http-dev-remote (RMCP indexer)
11+
keepalive 8;
12+
}
13+
14+
upstream upload_service_backend {
15+
server 127.0.0.1:8004; # upload-service-dev-remote
16+
keepalive 8;
17+
}
18+
19+
upstream fastmcp_core_backend {
20+
server 127.0.0.1:8000;
21+
keepalive 8;
22+
}
23+
24+
upstream fastmcp_indexer_core_backend {
25+
server 127.0.0.1:8001;
26+
keepalive 8;
27+
}
28+
29+
# HTTP listener kept minimal for ACME HTTP-01 challenges / health checks.
30+
server {
31+
listen 80;
32+
server_name <yourdomain>;
33+
34+
location /.well-known/acme-challenge/ {
35+
root /var/lib/letsencrypt;
36+
}
37+
38+
location / {
39+
return 404;
40+
}
41+
}
42+
43+
# Core FastMCP service exposed on https://<yourdomain>:8800/mcp
44+
server {
45+
listen 8800 ssl http2;
46+
server_name <yourdomain>;
47+
48+
ssl_certificate /etc/letsencrypt/live/<yourdomain>/fullchain.pem;
49+
ssl_certificate_key /etc/letsencrypt/live/<yourdomain>/privkey.pem;
50+
include /etc/letsencrypt/options-ssl-nginx.conf;
51+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
52+
53+
client_max_body_size 200m;
54+
proxy_read_timeout 3600s;
55+
proxy_send_timeout 3600s;
56+
57+
proxy_set_header Host $host;
58+
proxy_set_header X-Real-IP $remote_addr;
59+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
60+
proxy_set_header X-Forwarded-Proto $scheme;
61+
62+
location ^~ /mcp {
63+
proxy_http_version 1.1;
64+
proxy_set_header Connection "";
65+
proxy_buffering off;
66+
proxy_pass http://fastmcp_core_backend;
67+
}
68+
}
69+
70+
# Core FastMCP indexer service exposed on https://<yourdomain>:8801/mcp
71+
server {
72+
listen 8801 ssl http2;
73+
server_name <yourdomain>;
74+
75+
ssl_certificate /etc/letsencrypt/live/<yourdomain>/fullchain.pem;
76+
ssl_certificate_key /etc/letsencrypt/live/<yourdomain>/privkey.pem;
77+
include /etc/letsencrypt/options-ssl-nginx.conf;
78+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
79+
80+
client_max_body_size 200m;
81+
proxy_read_timeout 3600s;
82+
proxy_send_timeout 3600s;
83+
84+
proxy_set_header Host $host;
85+
proxy_set_header X-Real-IP $remote_addr;
86+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
87+
proxy_set_header X-Forwarded-Proto $scheme;
88+
89+
location ^~ /mcp {
90+
proxy_http_version 1.1;
91+
proxy_set_header Connection "";
92+
proxy_buffering off;
93+
proxy_pass http://fastmcp_indexer_core_backend;
94+
}
95+
}
96+
97+
# RMCP memory service exposed on https://<yourdomain>:8802/mcp
98+
server {
99+
listen 8802 ssl http2;
100+
server_name <yourdomain>;
101+
102+
ssl_certificate /etc/letsencrypt/live/<yourdomain>/fullchain.pem;
103+
ssl_certificate_key /etc/letsencrypt/live/<yourdomain>/privkey.pem;
104+
include /etc/letsencrypt/options-ssl-nginx.conf;
105+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
106+
107+
client_max_body_size 200m;
108+
proxy_read_timeout 3600s;
109+
proxy_send_timeout 3600s;
110+
111+
proxy_set_header Host $host;
112+
proxy_set_header X-Real-IP $remote_addr;
113+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
114+
proxy_set_header X-Forwarded-Proto $scheme;
115+
116+
location ^~ /mcp {
117+
proxy_http_version 1.1;
118+
proxy_set_header Connection "";
119+
proxy_buffering off;
120+
proxy_pass http://rmcp_memory_backend;
121+
}
122+
}
123+
124+
# RMCP indexer service exposed on https://<yourdomain>:8803/mcp
125+
server {
126+
listen 8803 ssl http2;
127+
server_name <yourdomain>;
128+
129+
ssl_certificate /etc/letsencrypt/live/<yourdomain>/fullchain.pem;
130+
ssl_certificate_key /etc/letsencrypt/live/<yourdomain>/privkey.pem;
131+
include /etc/letsencrypt/options-ssl-nginx.conf;
132+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
133+
134+
client_max_body_size 200m;
135+
proxy_read_timeout 3600s;
136+
proxy_send_timeout 3600s;
137+
138+
proxy_set_header Host $host;
139+
proxy_set_header X-Real-IP $remote_addr;
140+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
141+
proxy_set_header X-Forwarded-Proto $scheme;
142+
143+
location ^~ /mcp {
144+
proxy_http_version 1.1;
145+
proxy_set_header Connection "";
146+
proxy_buffering off;
147+
proxy_pass http://rmcp_indexer_backend;
148+
}
149+
}
150+
151+
# Upload service exposed on https://<yourdomain>:8804/
152+
server {
153+
listen 8804 ssl http2;
154+
server_name <yourdomain>;
155+
156+
ssl_certificate /etc/letsencrypt/live/<yourdomain>/fullchain.pem;
157+
ssl_certificate_key /etc/letsencrypt/live/<yourdomain>/privkey.pem;
158+
include /etc/letsencrypt/options-ssl-nginx.conf;
159+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
160+
161+
client_max_body_size 200m;
162+
proxy_read_timeout 3600s;
163+
proxy_send_timeout 3600s;
164+
165+
proxy_set_header Host $host;
166+
proxy_set_header X-Real-IP $remote_addr;
167+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
168+
proxy_set_header X-Forwarded-Proto $scheme;
169+
170+
location / {
171+
proxy_http_version 1.1;
172+
proxy_set_header Connection "";
173+
proxy_buffering off;
174+
proxy_pass http://upload_service_backend/;
175+
}
176+
177+
location /health {
178+
proxy_pass http://upload_service_backend/health;
179+
}
180+
}

docs/vscode-extension.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
Context Engine Uploader VS Code Extension
2+
=========================================
3+
4+
Build Prerequisites
5+
-------------------
6+
- Node.js 18+ and npm
7+
- Python 3 available on PATH for runtime testing
8+
- VS Code Extension Manager `vsce` (`npm install -g @vscode/vsce`) or run via `npx`
9+
10+
Install Dependencies
11+
--------------------
12+
```bash
13+
cd vscode-extension/context-engine-uploader
14+
npm install
15+
```
16+
17+
Package the Extension
18+
---------------------
19+
```bash
20+
cd vscode-extension/context-engine-uploader
21+
npx vsce package
22+
```
23+
This emits a `.vsix` file such as `context-engine-uploader-0.1.0.vsix`.
24+
25+
Test Locally
26+
------------
27+
1. In VS Code, open the command palette and select `Developer: Install Extension from Location...`.
28+
2. Pick the generated `.vsix`.
29+
3. Reload the window when prompted.
30+
31+
Key Settings After Install
32+
--------------------------
33+
- `Context Engine Upload` output channel shows force-sync and watch logs.
34+
- `Context Engine Uploader: Index Codebase` command or status bar button runs a force sync followed by watch.
35+
- Configure `contextEngineUploader.targetPath`, `endpoint`, and other options under Settings → Extensions → Context Engine Uploader.
36+
37+
## Prerequisites
38+
Python 3.8+ must be available on the host so the bundled client can run.
39+
40+
## Configuration
41+
42+
All settings live under `Context Engine Uploader` in the VS Code settings UI or `settings.json`.
43+
44+
| Setting | Description |
45+
| --- | --- |
46+
| `contextEngineUploader.runOnStartup` | Runs the force sync automatically after VS Code starts, then starts watch mode. Leave enabled to mirror the old manual workflow. |
47+
| `contextEngineUploader.pythonPath` | Python executable to use (`python3` by default). |
48+
| `contextEngineUploader.scriptWorkingDirectory` | Optional override for the folder that contains `standalone_upload_client.py`. Leave blank to use the extension’s own copy. |
49+
| `contextEngineUploader.targetPath` | Absolute path that should be passed to `--path` (for example `/Users/mikah/Nadi/dumon/dumon-ai-engine-revised`). |
50+
| `contextEngineUploader.endpoint` | Remote endpoint passed to `--endpoint`, defaulting to `http://mcp.speramus.id:8004`. |
51+
| `contextEngineUploader.intervalSeconds` | Poll interval for watch mode. Set to `5` to match the previous command file. |
52+
| `contextEngineUploader.extraForceArgs` | Optional string array appended to the force invocation. Leave empty for the standard workflow. |
53+
| `contextEngineUploader.extraWatchArgs` | Optional string array appended to the watch invocation. |
54+
55+
## Commands and lifecycle
56+
57+
- `Context Engine Uploader: Start` — executes the initial `--force` followed by `--watch` using the configured settings.
58+
- `Context Engine Uploader: Stop` — terminates any running upload client processes.
59+
- `Context Engine Uploader: Restart` — stops current processes and re-runs the startup sequence.
60+
61+
The extension logs all subprocess output to the **Context Engine Upload** output channel so you can confirm uploads without leaving VS Code. The watch process shuts down automatically when VS Code exits or when you run the Stop command.
62+

vscode-extension/.DS_Store

6 KB
Binary file not shown.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 John Donalson
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Context Engine Uploader
2+
=======================
3+
4+
Features
5+
--------
6+
- Runs a force sync (`Index Codebase`) followed by watch mode to keep a remote Context Engine instance in sync with your workspace.
7+
- Auto-detects the first workspace folder as the default target path, storing it in workspace settings so the extension is portable.
8+
- Provides commands and a status-bar button:
9+
- `Context Engine Uploader: Index Codebase` – force sync + watch with spinner feedback.
10+
- `Context Engine Uploader: Start/Stop/Restart` for manual lifecycle control.
11+
- Streams detailed logs into the `Context Engine Upload` output channel for visibility into both force sync and watch phases.
12+
- Status bar shows current state (indexing spinner, purple watching state) so you always know if uploads are active.
13+
14+
Configuration
15+
-------------
16+
- `Run On Startup` auto-triggers force sync + watch after VS Code finishes loading.
17+
- `Python Path`, `Endpoint`, `Extra Force Args`, `Extra Watch Args`, and `Interval Seconds` can be tuned via standard VS Code settings.
18+
- `Target Path` is auto-filled from the workspace but can be overridden if you need to upload a different folder.
19+
20+
Commands
21+
--------
22+
- Command Palette → “Context Engine Uploader” to access Start/Stop/Restart/Index Codebase.
23+
- Status-bar button (`Index Codebase`) mirrors the same behavior and displays progress.
24+
25+
Logs
26+
----
27+
Open `View → Output → Context Engine Upload` to see the remote uploader’s stdout/stderr, including any errors from the Python client.
22.2 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)