Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ __pycache__/
.vscode/settings.json
.kiro/settings/mcp.json
.vscode/settings.json
.vscode/settings.json
.context-engine
paper.md
/semantic-search
/codebase-index-cli
Expand Down
180 changes: 180 additions & 0 deletions deploy/nginx/context-engine-rmcp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# Context-Engine RMCP + Upload reverse proxy
# Copy to /etc/nginx/conf.d/context-engine.conf (or similar) and reload nginx.

upstream rmcp_memory_backend {
server 127.0.0.1:8002; # mcp-search-http-dev-remote (RMCP memory)
keepalive 8;
}

upstream rmcp_indexer_backend {
server 127.0.0.1:8003; # mcp-indexer-http-dev-remote (RMCP indexer)
keepalive 8;
}

upstream upload_service_backend {
server 127.0.0.1:8004; # upload-service-dev-remote
keepalive 8;
}

upstream fastmcp_core_backend {
server 127.0.0.1:8000;
keepalive 8;
}

upstream fastmcp_indexer_core_backend {
server 127.0.0.1:8001;
keepalive 8;
}

# HTTP listener kept minimal for ACME HTTP-01 challenges / health checks.
server {
listen 80;
server_name <yourdomain>;

location /.well-known/acme-challenge/ {
root /var/lib/letsencrypt;
}

location / {
return 404;
}
}

# Core FastMCP service exposed on https://<yourdomain>:8800/mcp
server {
listen 8800 ssl http2;
server_name <yourdomain>;

ssl_certificate /etc/letsencrypt/live/<yourdomain>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<yourdomain>/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

client_max_body_size 200m;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

location ^~ /mcp {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
proxy_pass http://fastmcp_core_backend;
}
}

# Core FastMCP indexer service exposed on https://<yourdomain>:8801/mcp
server {
listen 8801 ssl http2;
server_name <yourdomain>;

ssl_certificate /etc/letsencrypt/live/<yourdomain>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<yourdomain>/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

client_max_body_size 200m;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

location ^~ /mcp {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
proxy_pass http://fastmcp_indexer_core_backend;
}
}

# RMCP memory service exposed on https://<yourdomain>:8802/mcp
server {
listen 8802 ssl http2;
server_name <yourdomain>;

ssl_certificate /etc/letsencrypt/live/<yourdomain>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<yourdomain>/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

client_max_body_size 200m;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

location ^~ /mcp {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
proxy_pass http://rmcp_memory_backend;
}
}

# RMCP indexer service exposed on https://<yourdomain>:8803/mcp
server {
listen 8803 ssl http2;
server_name <yourdomain>;

ssl_certificate /etc/letsencrypt/live/<yourdomain>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<yourdomain>/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

client_max_body_size 200m;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

location ^~ /mcp {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
proxy_pass http://rmcp_indexer_backend;
}
}

# Upload service exposed on https://<yourdomain>:8804/
server {
listen 8804 ssl http2;
server_name <yourdomain>;

ssl_certificate /etc/letsencrypt/live/<yourdomain>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<yourdomain>/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

client_max_body_size 200m;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

location / {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
proxy_pass http://upload_service_backend/;
}

location /health {
proxy_pass http://upload_service_backend/health;
}
}
62 changes: 62 additions & 0 deletions docs/vscode-extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Context Engine Uploader VS Code Extension
=========================================

Build Prerequisites
-------------------
- Node.js 18+ and npm
- Python 3 available on PATH for runtime testing
- VS Code Extension Manager `vsce` (`npm install -g @vscode/vsce`) or run via `npx`

Install Dependencies
--------------------
```bash
cd vscode-extension/context-engine-uploader
npm install
```

Package the Extension
---------------------
```bash
cd vscode-extension/context-engine-uploader
npx vsce package
```
This emits a `.vsix` file such as `context-engine-uploader-0.1.0.vsix`.

Test Locally
------------
1. In VS Code, open the command palette and select `Developer: Install Extension from Location...`.
2. Pick the generated `.vsix`.
3. Reload the window when prompted.

Key Settings After Install
--------------------------
- `Context Engine Upload` output channel shows force-sync and watch logs.
- `Context Engine Uploader: Index Codebase` command or status bar button runs a force sync followed by watch.
- Configure `contextEngineUploader.targetPath`, `endpoint`, and other options under Settings → Extensions → Context Engine Uploader.

## Prerequisites
Python 3.8+ must be available on the host so the bundled client can run.

## Configuration

All settings live under `Context Engine Uploader` in the VS Code settings UI or `settings.json`.

| Setting | Description |
| --- | --- |
| `contextEngineUploader.runOnStartup` | Runs the force sync automatically after VS Code starts, then starts watch mode. Leave enabled to mirror the old manual workflow. |
| `contextEngineUploader.pythonPath` | Python executable to use (`python3` by default). |
| `contextEngineUploader.scriptWorkingDirectory` | Optional override for the folder that contains `standalone_upload_client.py`. Leave blank to use the extension’s own copy. |
| `contextEngineUploader.targetPath` | Absolute path that should be passed to `--path` (for example `/Users/mikah/Nadi/dumon/dumon-ai-engine-revised`). |
| `contextEngineUploader.endpoint` | Remote endpoint passed to `--endpoint`, defaulting to `http://mcp.speramus.id:8004`. |
| `contextEngineUploader.intervalSeconds` | Poll interval for watch mode. Set to `5` to match the previous command file. |
| `contextEngineUploader.extraForceArgs` | Optional string array appended to the force invocation. Leave empty for the standard workflow. |
| `contextEngineUploader.extraWatchArgs` | Optional string array appended to the watch invocation. |

## Commands and lifecycle

- `Context Engine Uploader: Start` — executes the initial `--force` followed by `--watch` using the configured settings.
- `Context Engine Uploader: Stop` — terminates any running upload client processes.
- `Context Engine Uploader: Restart` — stops current processes and re-runs the startup sequence.

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.

Binary file added vscode-extension/.DS_Store
Binary file not shown.
21 changes: 21 additions & 0 deletions vscode-extension/context-engine-uploader/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 John Donalson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 27 additions & 0 deletions vscode-extension/context-engine-uploader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Context Engine Uploader
=======================

Features
--------
- Runs a force sync (`Index Codebase`) followed by watch mode to keep a remote Context Engine instance in sync with your workspace.
- Auto-detects the first workspace folder as the default target path, storing it in workspace settings so the extension is portable.
- Provides commands and a status-bar button:
- `Context Engine Uploader: Index Codebase` – force sync + watch with spinner feedback.
- `Context Engine Uploader: Start/Stop/Restart` for manual lifecycle control.
- Streams detailed logs into the `Context Engine Upload` output channel for visibility into both force sync and watch phases.
- Status bar shows current state (indexing spinner, purple watching state) so you always know if uploads are active.

Configuration
-------------
- `Run On Startup` auto-triggers force sync + watch after VS Code finishes loading.
- `Python Path`, `Endpoint`, `Extra Force Args`, `Extra Watch Args`, and `Interval Seconds` can be tuned via standard VS Code settings.
- `Target Path` is auto-filled from the workspace but can be overridden if you need to upload a different folder.

Commands
--------
- Command Palette → “Context Engine Uploader” to access Start/Stop/Restart/Index Codebase.
- Status-bar button (`Index Codebase`) mirrors the same behavior and displays progress.

Logs
----
Open `View → Output → Context Engine Upload` to see the remote uploader’s stdout/stderr, including any errors from the Python client.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading