diff --git a/.gitignore b/.gitignore index ecfa040b..8af4386c 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ docs/* !docs/long-context-features.md !docs/desktop-app-build-process.md !docs/cli.md +!docs/rust-replatform.md AGENTS.md CLAUDE.md GEMINI.md @@ -75,6 +76,7 @@ claude-progress.txt feature_list.json tui-snapshot*.txt tui-ttyd.png +rust/target/ # Local settings (user-specific) *.local.json diff --git a/README.md b/README.md index f8461872..0fb1ad56 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ Built in Go, it handles OAuth authentication, token management, and API translation automatically. One server to route them all.

+

+ An experimental Rust replatform now lives on the rust-replatform branch with a terminal-first proxypilot-rs binary under rust/. +

+ --- > [!TIP] diff --git a/docs/rust-replatform.md b/docs/rust-replatform.md new file mode 100644 index 00000000..ab926ea5 --- /dev/null +++ b/docs/rust-replatform.md @@ -0,0 +1,43 @@ +# ProxyPilot Rust Replatform + +This branch carries the Rust rewrite line for ProxyPilot. + +## Branch contract + +- Go `main` remains the shipping line while Rust grows. +- Rust lives under [`rust/`](/home/fsos/code-lean/ai-tools/ProxyPilot/rust). +- The Rust line is terminal-first and does not treat the browser dashboard as a required early target. +- The first real milestone is a working Rust executable that can proxy a Codex-compatible request end-to-end. + +## Current milestone + +`proxypilot-rs` is the first Rust binary in the repo. It currently provides: + +- a `run` command that starts a local proxy server +- a `tui` command that opens a minimal terminal operator view +- a TOML config model focused on one provider path: Codex +- an HTTP proxy path for `/v1/*` so the Rust line can forward real Codex/OpenAI-style traffic +- end-to-end tests against a mocked upstream server + +## Design defaults + +- Go is the behavioral reference, not a line-by-line port target. +- The Rust branch is allowed to redesign config and management surfaces. +- The product identity does not change: ProxyPilot still exists to be a local proxy for coding tools. + +## Local workflow + +From the repo root: + +```bash +cd rust +cargo run -p proxypilot-rs -- init +cargo run -p proxypilot-rs -- run --config proxypilot-rs.toml +``` + +Open the TUI with: + +```bash +cd rust +cargo run -p proxypilot-rs -- tui --config proxypilot-rs.toml +``` diff --git a/rust/Cargo.toml b/rust/Cargo.toml new file mode 100644 index 00000000..6cc2fe07 --- /dev/null +++ b/rust/Cargo.toml @@ -0,0 +1,26 @@ +[workspace] +members = ["proxypilot-rs"] +resolver = "2" + +[workspace.package] +edition = "2024" +license = "MIT" +version = "0.1.0" + +[workspace.dependencies] +anyhow = "1.0.100" +axum = { version = "0.8.8", features = ["macros", "json"] } +clap = { version = "4.6.0", features = ["derive"] } +crossterm = "0.29.0" +http = "1.3.1" +ratatui = "0.29.0" +reqwest = { version = "0.12.25", default-features = false, features = ["http2", "json", "rustls-tls"] } +serde = { version = "1.0.228", features = ["derive"] } +serde_json = "1.0.145" +tokio = { version = "1.48.0", features = ["macros", "rt-multi-thread", "signal", "time", "sync", "net"] } +toml = "0.9.8" +tower = "0.5.2" +tower-http = { version = "0.6.6", features = ["trace"] } +tracing = "0.1.41" +tracing-subscriber = { version = "0.3.20", features = ["env-filter"] } +url = "2.5.7" diff --git a/rust/proxypilot-rs/Cargo.toml b/rust/proxypilot-rs/Cargo.toml new file mode 100644 index 00000000..a0e154ba --- /dev/null +++ b/rust/proxypilot-rs/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "proxypilot-rs" +version.workspace = true +edition.workspace = true +license.workspace = true + +[dependencies] +anyhow.workspace = true +axum.workspace = true +clap.workspace = true +crossterm.workspace = true +http.workspace = true +ratatui.workspace = true +reqwest.workspace = true +serde.workspace = true +serde_json.workspace = true +tokio.workspace = true +toml.workspace = true +tower-http.workspace = true +tracing.workspace = true +tracing-subscriber.workspace = true +url.workspace = true + +[dev-dependencies] +tower = { workspace = true, features = ["util"] }