MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / run_acp_command

Function run_acp_command

crates/opencode-cli/src/main.rs:1931–1950  ·  view source on GitHub ↗
(
    port: u16,
    hostname: String,
    mdns: bool,
    mdns_domain: String,
    cors: Vec<String>,
    cwd: PathBuf,
)

Source from the content-addressed store, hash-verified

1929}
1930
1931async fn run_acp_command(
1932 port: u16,
1933 hostname: String,
1934 mdns: bool,
1935 mdns_domain: String,
1936 cors: Vec<String>,
1937 cwd: PathBuf,
1938) -> anyhow::Result<()> {
1939 std::env::set_current_dir(&cwd)
1940 .map_err(|e| anyhow::anyhow!("Failed to change directory to {}: {}", cwd.display(), e))?;
1941
1942 if try_run_external_acp_bridge(port, &hostname, mdns, &mdns_domain, &cors, &cwd)? {
1943 return Ok(());
1944 }
1945
1946 eprintln!(
1947 "Warning: no external ACP stdio bridge runtime found; falling back to HTTP server mode."
1948 );
1949 run_server_command("acp", port, hostname, mdns, mdns_domain, cors).await
1950}
1951
1952fn is_loopback_host(host: &str) -> bool {
1953 matches!(host, "127.0.0.1" | "localhost" | "::1")

Callers 1

mainFunction · 0.85

Calls 2

run_server_commandFunction · 0.85

Tested by

no test coverage detected