mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-21 21:04:04 +00:00
chore: fix bad merge
This commit is contained in:
parent
1dd45908a3
commit
94353f7696
205 changed files with 19244 additions and 14866 deletions
55
server/packages/acp-http-adapter/src/main.rs
Normal file
55
server/packages/acp-http-adapter/src/main.rs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
use std::time::Duration;
|
||||
|
||||
use acp_http_adapter::{run_server, ServerConfig};
|
||||
use clap::Parser;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(name = "acp-http-adapter")]
|
||||
#[command(about = "Minimal ACP HTTP->stdio adapter", version)]
|
||||
struct Cli {
|
||||
#[arg(long, default_value = "127.0.0.1")]
|
||||
host: String,
|
||||
|
||||
#[arg(long, default_value_t = 7591)]
|
||||
port: u16,
|
||||
|
||||
#[arg(long)]
|
||||
registry_json: String,
|
||||
|
||||
#[arg(long)]
|
||||
registry_agent_id: Option<String>,
|
||||
|
||||
#[arg(long)]
|
||||
rpc_timeout_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
if let Err(err) = run().await {
|
||||
tracing::error!(error = %err, "acp-http-adapter failed");
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
async fn run() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(
|
||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
||||
)
|
||||
.compact()
|
||||
.init();
|
||||
|
||||
let cli = Cli::parse();
|
||||
run_server(ServerConfig {
|
||||
host: cli.host,
|
||||
port: cli.port,
|
||||
registry_json: cli.registry_json,
|
||||
registry_agent_id: cli.registry_agent_id,
|
||||
rpc_timeout: cli
|
||||
.rpc_timeout_ms
|
||||
.map(Duration::from_millis)
|
||||
.unwrap_or_else(|| Duration::from_secs(120)),
|
||||
})
|
||||
.await
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue