docs: update architecture and design docs with proxy reconnect and deployment strategies

This commit is contained in:
Riz Ashraf committed 2026-09-14 04:07:52 +01:00
1 parent a9a861abe1
commit 1da413568e
18 files changed
+2010 -722

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
use std::process::Command;
fn main() {
let git_hash = Command::new("git")
.args(&["rev-parse", "--short", "HEAD"])
.output()
.ok()
.and_then(|out| String::from_utf8(out.stdout).ok())
.unwrap_or_else(|| "unknown".to_string());
let git_date = Command::new("git")
.args(&["log", "-1", "--format=%cd", "--date=format:%Y.%m.%d"])
.output()
.ok()
.and_then(|out| String::from_utf8(out.stdout).ok())
.unwrap_or_else(|| "unknown".to_string());
let version = format!("{} ({} {})", env!("CARGO_PKG_VERSION"), git_date.trim(), git_hash.trim());
println!("cargo:rustc-env=APP_VERSION={}", version);
}
+8 -4
View File
@@ -5,7 +5,7 @@ use tokio::io::AsyncBufReadExt;
use tokio::sync::mpsc;
#[derive(Parser)]
#[command(name = "mcp-memory-stub", author, version, about = "Antigravity MCP Memory Stub / Proxy", long_about = None)]
#[command(name = "mcp-memory-stub", author, version = env!("APP_VERSION"), about = "Antigravity MCP Memory Stub / Proxy", long_about = None)]
struct Cli {
/// Target URL for the stub to proxy messages to
#[arg(long, default_value = "http://localhost:3000")]
@@ -20,15 +20,19 @@ async fn read_mcp_message(stdin: &mut tokio::io::BufReader<tokio::io::Stdin>) ->
let mut length = 0;
loop {
let mut line = String::new();
if stdin.read_line(&mut line).await.unwrap_or(0) == 0 {
let bytes_read = stdin.read_line(&mut line).await.unwrap_or(0);
if bytes_read == 0 {
tracing::info!("stdin EOF reached");
return None;
}
tracing::info!("Read {} bytes from stdin: {:?}", bytes_read, line);
let line = line.trim_end();
if line.is_empty() {
break;
}
if let Some(len_str) = line.strip_prefix("Content-Length: ") {
length = len_str.parse().unwrap_or(0);
let lower_line = line.to_lowercase();
if let Some(len_str) = lower_line.strip_prefix("content-length:") {
length = len_str.trim().parse().unwrap_or(0);
}
}
if length == 0 {
+28 -9
View File
@@ -2,8 +2,6 @@ use serde_json::{json, Value};
use std::io::{BufRead, BufReader, Read, Write};
use std::process::{Command, Stdio};
use std::time::Duration;
use std::sync::Arc;
use tokio::sync::Mutex;
fn send_message(stdin: &mut std::process::ChildStdin, msg: Value) {
let s = serde_json::to_string(&msg).unwrap();
@@ -48,14 +46,27 @@ async fn test_full_system_e2e_performance() {
let test_port = "3031"; // Use a distinct port
let mut server_exe = std::env::current_exe().unwrap();
server_exe.pop();
server_exe.pop();
server_exe.push("mcp-memory-server.exe");
let mut exe_dir = std::env::current_exe().unwrap();
exe_dir.pop(); // pop test executable name
exe_dir.pop(); // pop deps/
let mut nvim_exe = server_exe.clone();
nvim_exe.pop();
nvim_exe.push("mcp-memory-win-nvim.exe");
let mut server_exe = exe_dir.join("mcp-memory-server.exe");
if !server_exe.exists() {
let mut target_dir = std::env::current_dir().unwrap();
if target_dir.ends_with("stub") {
target_dir.pop();
}
server_exe = target_dir.join("target").join("debug").join("mcp-memory-server.exe");
}
let mut nvim_exe = exe_dir.join("mcp-memory-win-nvim.exe");
if !nvim_exe.exists() {
let mut target_dir = std::env::current_dir().unwrap();
if target_dir.ends_with("stub") {
target_dir.pop();
}
nvim_exe = target_dir.join("target").join("debug").join("mcp-memory-win-nvim.exe");
}
// 1. Start Server
let mut server = Command::new(&server_exe)
@@ -132,3 +143,11 @@ async fn test_full_system_e2e_performance() {
let _ = win_nvim.kill();
let _ = server.kill();
}