mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-18 22:54:24 +01:00
hotfix: fix build (#3102)
This commit is contained in:
@@ -10,6 +10,9 @@ license = "Apache-2.0"
|
||||
repository = "https://github.com/block/goose"
|
||||
description = "An AI agent"
|
||||
|
||||
[workspace.lints.clippy]
|
||||
uninlined_format_args = "allow"
|
||||
|
||||
# Patch for Windows cross-compilation issue with crunchy
|
||||
[patch.crates-io]
|
||||
crunchy = { git = "https://github.com/nmathewson/crunchy", branch = "cross-compilation-fix" }
|
||||
@@ -7,6 +7,9 @@ license.workspace = true
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
|
||||
@@ -7,6 +7,9 @@ license.workspace = true
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "goose"
|
||||
path = "src/main.rs"
|
||||
|
||||
@@ -8,6 +8,9 @@ license.workspace = true
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[lib]
|
||||
name = "goose_ffi"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
@@ -7,6 +7,9 @@ license.workspace = true
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[lib]
|
||||
crate-type = ["lib", "cdylib"]
|
||||
name = "goose_llm"
|
||||
|
||||
@@ -7,6 +7,9 @@ license.workspace = true
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
mcp-core = { path = "../mcp-core" }
|
||||
mcp-server = { path = "../mcp-server" }
|
||||
|
||||
@@ -7,6 +7,9 @@ license.workspace = true
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
goose = { path = "../goose" }
|
||||
mcp-core = { path = "../mcp-core" }
|
||||
|
||||
@@ -7,6 +7,9 @@ license.workspace = true
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[build-dependencies]
|
||||
tokio = { version = "1.43", features = ["full"] }
|
||||
reqwest = { version = "0.12.9", features = ["json", "rustls-tls-native-roots"], default-features = false }
|
||||
|
||||
@@ -10,7 +10,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
// Create base directory
|
||||
fs::create_dir_all(BASE_DIR)?;
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
println!("cargo:rerun-if-changed={}", BASE_DIR);
|
||||
println!("cargo:rerun-if-changed={BASE_DIR}");
|
||||
|
||||
for tokenizer_name in TOKENIZERS {
|
||||
download_tokenizer(tokenizer_name).await?;
|
||||
@@ -21,30 +21,26 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
|
||||
async fn download_tokenizer(repo_id: &str) -> Result<(), Box<dyn Error>> {
|
||||
let dir_name = repo_id.replace('/', "--");
|
||||
let download_dir = format!("{}/{}", BASE_DIR, dir_name);
|
||||
let file_url = format!(
|
||||
"https://huggingface.co/{}/resolve/main/tokenizer.json",
|
||||
repo_id
|
||||
);
|
||||
let file_path = format!("{}/tokenizer.json", download_dir);
|
||||
let download_dir = format!("{BASE_DIR}/{dir_name}");
|
||||
let file_url = format!("https://huggingface.co/{repo_id}/resolve/main/tokenizer.json");
|
||||
let file_path = format!("{download_dir}/tokenizer.json");
|
||||
|
||||
// Create directory if it doesn't exist
|
||||
fs::create_dir_all(&download_dir)?;
|
||||
|
||||
// Check if file already exists
|
||||
if Path::new(&file_path).exists() {
|
||||
println!("Tokenizer for {} already exists, skipping...", repo_id);
|
||||
println!("Tokenizer for {repo_id} already exists, skipping...");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
println!("Downloading tokenizer for {}...", repo_id);
|
||||
println!("Downloading tokenizer for {repo_id}...");
|
||||
|
||||
// Download the file
|
||||
let response = reqwest::get(&file_url).await?;
|
||||
if !response.status().is_success() {
|
||||
return Err(format!(
|
||||
"Failed to download tokenizer for {}, status: {}",
|
||||
repo_id,
|
||||
"Failed to download tokenizer for {repo_id}, status: {}",
|
||||
response.status()
|
||||
)
|
||||
.into());
|
||||
@@ -53,6 +49,6 @@ async fn download_tokenizer(repo_id: &str) -> Result<(), Box<dyn Error>> {
|
||||
let content = response.bytes().await?;
|
||||
fs::write(&file_path, content)?;
|
||||
|
||||
println!("Downloaded {} to {}", repo_id, file_path);
|
||||
println!("Downloaded {repo_id} to {file_path}");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ name = "mcp-client"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
mcp-core = { path = "../mcp-core" }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
|
||||
@@ -134,10 +134,7 @@ impl StdioActor {
|
||||
while let Some(message_str) = receiver.recv().await {
|
||||
tracing::debug!(message = ?message_str, "Sending outgoing message");
|
||||
|
||||
if let Err(e) = stdin
|
||||
.write_all(format!("{}\n", message_str).as_bytes())
|
||||
.await
|
||||
{
|
||||
if let Err(e) = stdin.write_all(format!("{message_str}\n").as_bytes()).await {
|
||||
tracing::error!(error = ?e, "Error writing message to child process");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ name = "mcp-core"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
||||
@@ -3,6 +3,9 @@ name = "mcp-macros"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ name = "mcp-server"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.94"
|
||||
thiserror = "1.0"
|
||||
|
||||
Reference in New Issue
Block a user