Skip to content

Commit 2013575

Browse files
authored
Merge pull request #71 from nikomatsakis/main
cleanup in prep for next release
2 parents 122d0f6 + 17a55e5 commit 2013575

File tree

28 files changed

+647
-885
lines changed

28 files changed

+647
-885
lines changed

Cargo.lock

Lines changed: 32 additions & 254 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ members = [
55
"ci",
66
"src/symposium-acp-proxy",
77
"src/symposium-acp-agent",
8-
"src/symposium-crate-sources-proxy",
98
"src/symposium-ferris",
109
"src/symposium-math",
1110
"src/cli-agent-util",
@@ -14,14 +13,14 @@ members = [
1413
resolver = "2"
1514

1615
[workspace.dependencies]
17-
sacp = "10.0.0-alpha.2"
18-
sacp-tokio = "10.0.0-alpha.2"
19-
sacp-conductor = "10.0.0-alpha.2"
20-
sacp-rmcp = "10.0.0-alpha.2"
21-
sacp-tee = "10.0.0-alpha.2"
22-
sacp-test = "10.0.0-alpha.2"
23-
yopo = "10.0.0-alpha.2"
24-
elizacp = "10.0.0-alpha.2"
16+
sacp = "10.0.0-alpha.3"
17+
sacp-tokio = "10.0.0-alpha.3"
18+
sacp-conductor = "10.0.0-alpha.3"
19+
sacp-rmcp = "10.0.0-alpha.3"
20+
sacp-tee = "10.0.0-alpha.3"
21+
sacp-test = "10.0.0-alpha.3"
22+
yopo = "10.0.0-alpha.3"
23+
elizacp = "10.0.0-alpha.3"
2524
jsonrpcmsg = "0.1.2"
2625

2726
# Core async runtime
@@ -49,7 +48,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
4948
rmcp = { version = "0.12", features = ["server", "transport-io", "schemars"] }
5049

5150
# Sparkle integration
52-
sparkle = { package = "sparkle-mcp", version = "0.3.0" }
51+
sparkle = { package = "sparkle-mcp", version = "0.4.0" }
5352

5453
# CLI parsing
5554
clap = { version = "4.0", features = ["derive"] }

src/symposium-acp-agent/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ clap = { workspace = true }
2424

2525
# Symposium components
2626
symposium-acp-proxy = { path = "../symposium-acp-proxy", version = "1.0.0-alpha.1" }
27+
symposium-ferris = { path = "../symposium-ferris", version = "1.0.0-alpha.1" }

src/symposium-acp-agent/src/main.rs

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,19 @@ use std::path::PathBuf;
2525
and it provides Symposium's capabilities on top of the underlying agent."
2626
)]
2727
struct Cli {
28-
/// Disable Sparkle integration
29-
#[arg(long, default_value = "false")]
30-
no_sparkle: bool,
28+
/// Enable or disable Sparkle integration (default: yes)
29+
#[arg(long, default_value = "yes", value_parser = parse_yes_no)]
30+
sparkle: bool,
3131

32-
/// Disable the crate researcher
33-
#[arg(long, default_value = "false")]
34-
no_crate_researcher: bool,
32+
/// Enable or disable Ferris tools (default: yes)
33+
#[arg(long, default_value = "yes", value_parser = parse_yes_no)]
34+
ferris: bool,
35+
36+
/// Comma-separated list of Ferris tools to enable.
37+
/// Available tools: crate_source, rust_researcher
38+
/// Default: crate_source
39+
#[arg(long, default_value = "crate_source", value_delimiter = ',')]
40+
ferris_tools: Vec<String>,
3541

3642
/// Enable trace logging to the specified directory.
3743
/// Traces are written as timestamped .jsons files viewable with sacp-trace-viewer.
@@ -47,6 +53,29 @@ struct Cli {
4753
agent: Vec<String>,
4854
}
4955

56+
fn parse_yes_no(s: &str) -> Result<bool, String> {
57+
match s.to_lowercase().as_str() {
58+
"yes" | "true" | "1" => Ok(true),
59+
"no" | "false" | "0" => Ok(false),
60+
_ => Err(format!("expected 'yes' or 'no', got '{}'", s)),
61+
}
62+
}
63+
64+
fn build_ferris_config(enabled: bool, tools: &[String]) -> Option<symposium_ferris::Ferris> {
65+
if !enabled {
66+
return None;
67+
}
68+
69+
let crate_sources = tools.iter().any(|t| t == "crate_source");
70+
let rust_researcher = tools.iter().any(|t| t == "rust_researcher");
71+
72+
Some(
73+
symposium_ferris::Ferris::new()
74+
.crate_sources(crate_sources)
75+
.rust_researcher(rust_researcher),
76+
)
77+
}
78+
5079
#[tokio::main]
5180
async fn main() -> Result<()> {
5281
let cli = Cli::parse();
@@ -65,9 +94,11 @@ async fn main() -> Result<()> {
6594
tracing::debug!("agent: {:?}", agent.server());
6695

6796
// Run Symposium with the agent as the downstream component
97+
let ferris_config = build_ferris_config(cli.ferris, &cli.ferris_tools);
98+
6899
let mut symposium = symposium_acp_proxy::Symposium::new()
69-
.sparkle(!cli.no_sparkle)
70-
.crate_sources_proxy(!cli.no_crate_researcher);
100+
.sparkle(cli.sparkle)
101+
.ferris(ferris_config);
71102

72103
if let Some(trace_dir) = cli.trace_dir {
73104
symposium = symposium.trace_dir(trace_dir);

src/symposium-acp-proxy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ chrono = "0.4"
3434
tokio-util = { version = "0.7", features = ["compat"] }
3535

3636
# Proxy components
37-
symposium-crate-sources-proxy = { path = "../symposium-crate-sources-proxy", version = "1.0.0-alpha.1" }
37+
symposium-ferris = { path = "../symposium-ferris", version = "1.0.0-alpha.1" }
3838
sacp-tee.workspace = true
3939
sparkle.workspace = true

src/symposium-acp-proxy/src/lib.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::path::PathBuf;
2323

2424
/// Shared configuration for Symposium proxy chains.
2525
struct SymposiumConfig {
26-
crate_sources_proxy: bool,
26+
ferris: Option<symposium_ferris::Ferris>,
2727
sparkle: bool,
2828
trace_dir: Option<PathBuf>,
2929
}
@@ -32,7 +32,7 @@ impl SymposiumConfig {
3232
fn new() -> Self {
3333
SymposiumConfig {
3434
sparkle: true,
35-
crate_sources_proxy: true,
35+
ferris: Some(symposium_ferris::Ferris::default()),
3636
trace_dir: None,
3737
}
3838
}
@@ -58,8 +58,9 @@ impl Symposium {
5858
self
5959
}
6060

61-
pub fn crate_sources_proxy(mut self, enable: bool) -> Self {
62-
self.config.crate_sources_proxy = enable;
61+
/// Configure Ferris tools. Pass `None` to disable Ferris entirely.
62+
pub fn ferris(mut self, config: Option<symposium_ferris::Ferris>) -> Self {
63+
self.config.ferris = config;
6364
self
6465
}
6566

@@ -82,7 +83,7 @@ impl Component<ProxyToConductor> for Symposium {
8283
tracing::debug!("Symposium::serve starting (proxy mode)");
8384
let Self { config } = self;
8485

85-
let crate_sources_proxy = config.crate_sources_proxy;
86+
let ferris = config.ferris;
8687
let sparkle = config.sparkle;
8788
let trace_dir = config.trace_dir;
8889

@@ -94,10 +95,10 @@ impl Component<ProxyToConductor> for Symposium {
9495

9596
let mut proxies: Vec<DynComponent<ProxyToConductor>> = vec![];
9697

97-
if crate_sources_proxy {
98-
proxies.push(DynComponent::new(
99-
symposium_crate_sources_proxy::CrateSourcesProxy {},
100-
));
98+
if let Some(ferris_config) = ferris {
99+
proxies.push(DynComponent::new(symposium_ferris::FerrisComponent::new(
100+
ferris_config,
101+
)));
101102
}
102103

103104
if sparkle {
@@ -151,7 +152,7 @@ impl Component<AgentToClient> for SymposiumAgent {
151152
tracing::debug!("SymposiumAgent::serve starting (agent mode)");
152153
let Self { config, agent } = self;
153154

154-
let crate_sources_proxy = config.crate_sources_proxy;
155+
let ferris = config.ferris;
155156
let sparkle = config.sparkle;
156157
let trace_dir = config.trace_dir;
157158

@@ -163,10 +164,10 @@ impl Component<AgentToClient> for SymposiumAgent {
163164

164165
let mut proxies: Vec<DynComponent<ProxyToConductor>> = vec![];
165166

166-
if crate_sources_proxy {
167-
proxies.push(DynComponent::new(
168-
symposium_crate_sources_proxy::CrateSourcesProxy {},
169-
));
167+
if let Some(ferris_config) = ferris {
168+
proxies.push(DynComponent::new(symposium_ferris::FerrisComponent::new(
169+
ferris_config,
170+
)));
170171
}
171172

172173
if sparkle {
Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,92 @@
11
//! Symposium ACP Proxy - Main entry point
2+
//!
3+
//! A proxy that sits between an editor and an existing agent, enriching the
4+
//! connection with Symposium's capabilities.
5+
//!
6+
//! Usage:
7+
//! symposium-acp-proxy [OPTIONS]
28
9+
use anyhow::Result;
10+
use clap::Parser;
311
use sacp::Component;
12+
use std::path::PathBuf;
13+
14+
#[derive(Parser, Debug)]
15+
#[command(name = "symposium-acp-proxy")]
16+
#[command(about = "Symposium ACP proxy - enriches editor-agent connections")]
17+
struct Cli {
18+
/// Enable or disable Sparkle integration (default: yes)
19+
#[arg(long, default_value = "yes", value_parser = parse_yes_no)]
20+
sparkle: bool,
21+
22+
/// Enable or disable Ferris tools (default: yes)
23+
#[arg(long, default_value = "yes", value_parser = parse_yes_no)]
24+
ferris: bool,
25+
26+
/// Comma-separated list of Ferris tools to enable.
27+
/// Available tools: crate_source, rust_researcher
28+
/// Default: crate_source
29+
#[arg(long, default_value = "crate_source", value_delimiter = ',')]
30+
ferris_tools: Vec<String>,
31+
32+
/// Enable trace logging to the specified directory.
33+
/// Traces are written as timestamped .jsons files viewable with sacp-trace-viewer.
34+
#[arg(long)]
35+
trace_dir: Option<PathBuf>,
36+
37+
/// Enable logging to stderr at the specified level (error, warn, info, debug, trace).
38+
#[arg(long)]
39+
log: Option<tracing::Level>,
40+
}
41+
42+
fn parse_yes_no(s: &str) -> Result<bool, String> {
43+
match s.to_lowercase().as_str() {
44+
"yes" | "true" | "1" => Ok(true),
45+
"no" | "false" | "0" => Ok(false),
46+
_ => Err(format!("expected 'yes' or 'no', got '{}'", s)),
47+
}
48+
}
49+
50+
fn build_ferris_config(enabled: bool, tools: &[String]) -> Option<symposium_ferris::Ferris> {
51+
if !enabled {
52+
return None;
53+
}
54+
55+
let crate_sources = tools.iter().any(|t| t == "crate_source");
56+
let rust_researcher = tools.iter().any(|t| t == "rust_researcher");
57+
58+
Some(
59+
symposium_ferris::Ferris::new()
60+
.crate_sources(crate_sources)
61+
.rust_researcher(rust_researcher),
62+
)
63+
}
464

565
#[tokio::main]
6-
async fn main() -> anyhow::Result<()> {
7-
symposium_acp_proxy::Symposium::new()
8-
.serve(sacp_tokio::Stdio::new())
9-
.await?;
66+
async fn main() -> Result<()> {
67+
let cli = Cli::parse();
68+
69+
// Set up logging if requested
70+
if let Some(level) = cli.log {
71+
use tracing_subscriber::EnvFilter;
72+
tracing_subscriber::fmt()
73+
.with_env_filter(EnvFilter::new(level.to_string()))
74+
.with_writer(std::io::stderr)
75+
.init();
76+
}
77+
78+
// Run Symposium as a proxy
79+
let ferris_config = build_ferris_config(cli.ferris, &cli.ferris_tools);
80+
81+
let mut symposium = symposium_acp_proxy::Symposium::new()
82+
.sparkle(cli.sparkle)
83+
.ferris(ferris_config);
84+
85+
if let Some(trace_dir) = cli.trace_dir {
86+
symposium = symposium.trace_dir(trace_dir);
87+
}
88+
89+
symposium.serve(sacp_tokio::Stdio::new()).await?;
90+
1091
Ok(())
1192
}

src/symposium-benchmark/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ publish = false
77
[dependencies]
88
# Symposium components
99
symposium-acp-proxy = { path = "../symposium-acp-proxy" }
10-
symposium-crate-sources-proxy = { path = "../symposium-crate-sources-proxy" }
10+
symposium-ferris = { path = "../symposium-ferris" }
1111

1212
# ACP framework
1313
sacp.workspace = true

src/symposium-crate-sources-proxy/CHANGELOG.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/symposium-crate-sources-proxy/Cargo.toml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)