Improve dependency hygiene (#9360)

Signed-off-by: jh-block <jhugo@block.xyz>
This commit is contained in:
jh-block
2026-05-26 18:09:03 +02:00
committed by GitHub
parent bf0da953d5
commit 27dc0d5f83
24 changed files with 950 additions and 1639 deletions
+24 -19
View File
@@ -20,15 +20,15 @@ name = "generate_manpages"
path = "src/bin/generate_manpages.rs"
[dependencies]
clap_mangen = "0.3.0"
clap_mangen = { version = "0.2", default-features = false }
goose = { path = "../goose", default-features = false }
goose-mcp = { path = "../goose-mcp" }
goose-mcp = { path = "../goose-mcp", default-features = false }
rmcp = { workspace = true }
clap = { workspace = true }
cliclack = "0.5.4"
console = "0.16.1"
cliclack = { version = "0.5", default-features = false }
console = { version = "0.16", default-features = false, features = ["std"] }
dotenvy = { workspace = true }
bat = { version = "0.26.1", default-features = false, features = ["regex-onig"] }
bat = { version = "0.26", default-features = false, features = ["regex-onig"] }
anyhow = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
@@ -39,33 +39,34 @@ strum = { workspace = true }
tempfile = { workspace = true }
etcetera = { workspace = true }
rand = { workspace = true }
rustyline = "18.0.0"
rustyline = { version = "18", default-features = false, features = ["custom-bindings", "with-dirs", "with-file-history"] }
tracing = { workspace = true }
chrono = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter", "fmt", "json", "time"] }
shlex = "2.0.1"
shlex = { version = "1.3", default-features = false, features = ["std"] }
async-trait = { workspace = true }
base64 = { workspace = true }
regex = { workspace = true }
tar = "0.4.46"
reqwest = { workspace = true, features = ["blocking"], default-features = false }
tar = { version = "0.4.46", default-features = false }
reqwest = { workspace = true, features = ["blocking"] }
zip = { workspace = true }
bzip2 = "0.6"
bzip2 = { version = "0.6", default-features = false, features = ["default"] }
webbrowser = { workspace = true }
indicatif = "0.18.1"
indicatif = { version = "0.18", default-features = false }
tokio-util = { workspace = true, features = ["compat", "rt"] }
anstream = "1.0.0"
open = "5.3.5"
anstream = { version = "1", default-features = false, features = ["auto"] }
open = { version = "5", default-features = false }
url = { workspace = true }
urlencoding = { workspace = true }
clap_complete = "4.6.5"
comfy-table = "7.2.2"
clap_complete = { version = "4", default-features = false }
comfy-table = { version = "7", default-features = false }
sha2 = { workspace = true }
sigstore-verify = { version = "=0.8.0", default-features = false }
sigstore-verify = { version = "0.8", default-features = false, optional = true }
axum.workspace = true
clap_complete_nushell = "4.6.0"
clap_complete_nushell = { version = "4", default-features = false }
[target.'cfg(target_os = "windows")'.dependencies]
anstream = { version = "1", default-features = false, features = ["wincon"] }
winapi = { workspace = true }
[features]
@@ -74,9 +75,11 @@ default = [
"local-inference",
"aws-providers",
"telemetry",
"nostr",
"otel",
"rustls-tls",
"system-keyring",
"update",
]
code-mode = ["goose/code-mode"]
local-inference = ["goose/local-inference"]
@@ -84,20 +87,22 @@ aws-providers = ["goose/aws-providers"]
cuda = ["goose/cuda", "local-inference"]
vulkan = ["goose/vulkan", "local-inference"]
telemetry = ["goose/telemetry"]
nostr = ["goose/nostr"]
otel = ["goose/otel"]
system-keyring = ["goose/system-keyring"]
update = ["dep:sigstore-verify"]
portable-default = ["rustls-tls", "aws-providers", "telemetry", "otel"]
# disables the update command
disable-update = []
rustls-tls = [
"reqwest/rustls",
"sigstore-verify/rustls",
"sigstore-verify?/rustls",
"goose/rustls-tls",
"goose-mcp/rustls-tls",
]
native-tls = [
"reqwest/native-tls",
"sigstore-verify/native-tls",
"sigstore-verify?/native-tls",
"goose/native-tls",
"goose-mcp/native-tls",
]
+3
View File
@@ -935,6 +935,7 @@ enum Command {
},
/// Update the goose CLI version
#[cfg(feature = "update")]
#[command(about = "Update the goose CLI version")]
Update {
/// Update to canary version
@@ -1269,6 +1270,7 @@ fn get_command_name(command: &Option<Command>) -> &'static str {
Some(Command::Run { .. }) => "run",
Some(Command::Gateway { .. }) => "gateway",
Some(Command::Schedule { .. }) => "schedule",
#[cfg(feature = "update")]
Some(Command::Update { .. }) => "update",
Some(Command::Recipe { .. }) => "recipe",
Some(Command::Plugin { .. }) => "plugin",
@@ -2099,6 +2101,7 @@ pub async fn cli() -> anyhow::Result<()> {
}
Some(Command::Gateway { command }) => handle_gateway_command(command).await,
Some(Command::Schedule { command }) => handle_schedule_command(command).await,
#[cfg(feature = "update")]
Some(Command::Update {
canary,
reconfigure,
+1
View File
@@ -10,4 +10,5 @@ pub mod schedule;
pub mod session;
pub mod term;
pub mod tui;
#[cfg(feature = "update")]
pub mod update;
+16 -3
View File
@@ -3,8 +3,11 @@ use anyhow::{Context, Result};
use cliclack::{confirm, multiselect, select};
use etcetera::home_dir;
#[cfg(feature = "nostr")]
use goose::config::Config;
use goose::session::{generate_diagnostics, nostr_share, Session, SessionManager, SessionType};
#[cfg(feature = "nostr")]
use goose::session::nostr_share;
use goose::session::{generate_diagnostics, Session, SessionManager, SessionType};
use goose::utils::safe_truncate;
use regex::Regex;
use std::fs;
@@ -218,7 +221,7 @@ pub async fn handle_session_export(
output_path: Option<PathBuf>,
format: String,
nostr: bool,
relays: Vec<String>,
#[cfg_attr(not(feature = "nostr"), allow(unused_variables))] relays: Vec<String>,
) -> Result<()> {
let session_manager = SessionManager::instance();
let session = match session_manager.get_session(&session_id, true).await {
@@ -244,6 +247,7 @@ pub async fn handle_session_export(
_ => return Err(anyhow::anyhow!("Unsupported format: {}", format)),
};
#[cfg(feature = "nostr")]
if nostr {
if format != "json" {
return Err(anyhow::anyhow!(
@@ -266,6 +270,10 @@ pub async fn handle_session_export(
println!("{}", share.deeplink);
return Ok(());
}
#[cfg(not(feature = "nostr"))]
if nostr {
return Err(anyhow::anyhow!("goose was not built with nostr support"));
}
if let Some(output_path) = output_path {
fs::write(&output_path, output).with_context(|| {
@@ -281,7 +289,12 @@ pub async fn handle_session_export(
pub async fn handle_session_import(input: String, nostr: bool) -> Result<()> {
let json = if nostr || input.starts_with("goose://sessions/nostr") {
nostr_share::import_session_json_from_deeplink(&input).await?
#[cfg(feature = "nostr")]
{
nostr_share::import_session_json_from_deeplink(&input).await?
}
#[cfg(not(feature = "nostr"))]
return Err(anyhow::anyhow!("goose was not built with nostr support"));
} else {
fs::read_to_string(&input)
.with_context(|| format!("Failed to read session import file: {input}"))?