Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 14 additions & 18 deletions crates/goose-cli/src/commands/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,22 @@ pub fn handle_info(verbose: bool) -> Result<()> {
// Print verbose info if requested
if verbose {
println!("\n{}", style("goose Configuration:").cyan().bold());
match config.load_values() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre existing, but I think we can now just let the error bubble up

Ok(values) => {
if values.is_empty() {
println!(" No configuration values set");
println!(
" Run '{}' to configure goose",
style("goose configure").cyan()
);
} else {
let sorted_values: std::collections::BTreeMap<_, _> =
values.iter().map(|(k, v)| (k.clone(), v.clone())).collect();

if let Ok(yaml) = serde_yaml::to_string(&sorted_values) {
for line in yaml.lines() {
println!(" {}", line);
}
}
let values = config.all_values()?;
if values.is_empty() {
println!(" No configuration values set");
println!(
" Run '{}' to configure goose",
style("goose configure").cyan()
);
} else {
let sorted_values: std::collections::BTreeMap<_, _> =
values.iter().map(|(k, v)| (k.clone(), v.clone())).collect();

if let Ok(yaml) = serde_yaml::to_string(&sorted_values) {
for line in yaml.lines() {
println!(" {}", line);
}
}
Err(e) => println!(" Error loading configuration: {}", e),
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/goose-server/src/routes/config_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ pub async fn read_all_config() -> Result<Json<ConfigResponse>, StatusCode> {
let config = Config::global();

let values = config
.load_values()
.all_values()
.map_err(|_| StatusCode::UNPROCESSABLE_ENTITY)?;

Ok(Json(ConfigResponse { config: values }))
Expand Down Expand Up @@ -509,7 +509,7 @@ pub async fn init_config() -> Result<Json<String>, StatusCode> {

// Use the shared function to load init-config.yaml
match goose::config::base::load_init_config_from_workspace() {
Ok(init_values) => match config.save_values(init_values) {
Ok(init_values) => match config.initialize_if_empty(init_values) {
Ok(_) => Ok(Json("Config initialized successfully".to_string())),
Err(_) => Err(StatusCode::INTERNAL_SERVER_ERROR),
},
Expand Down Expand Up @@ -584,7 +584,7 @@ pub async fn recover_config() -> Result<Json<String>, StatusCode> {
let config = Config::global();

// Force a reload which will trigger recovery if needed
match config.load_values() {
match config.all_values() {
Ok(values) => {
let recovered_keys: Vec<String> = values.keys().cloned().collect();
if recovered_keys.is_empty() {
Expand Down
1 change: 1 addition & 0 deletions crates/goose/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ schemars = { version = "1.0.4", default-features = false, features = ["derive"]
insta = "1.43.2"
paste = "1.0.0"
shellexpand = "3.1.1"
indexmap = "2.12.0"


[target.'cfg(target_os = "windows")'.dependencies]
Expand Down
14 changes: 14 additions & 0 deletions crates/goose/src/agents/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ pub enum ExtensionConfig {
Sse {
/// The name used to identify this extension
name: String,
#[serde(default)]
#[schema(required)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha! that's the way

description: String,
uri: String,
#[serde(default)]
Expand All @@ -234,6 +236,8 @@ pub enum ExtensionConfig {
Stdio {
/// The name used to identify this extension
name: String,
#[serde(default)]
#[schema(required)]
description: String,
cmd: String,
args: Vec<String>,
Expand All @@ -252,6 +256,8 @@ pub enum ExtensionConfig {
Builtin {
/// The name used to identify this extension
name: String,
#[serde(default)]
#[schema(required)]
description: String,
display_name: Option<String>, // needed for the UI
timeout: Option<u64>,
Expand All @@ -265,6 +271,8 @@ pub enum ExtensionConfig {
Platform {
/// The name used to identify this extension
name: String,
#[serde(default)]
#[schema(required)]
description: String,
#[serde(default)]
bundled: Option<bool>,
Expand All @@ -276,6 +284,8 @@ pub enum ExtensionConfig {
StreamableHttp {
/// The name used to identify this extension
name: String,
#[serde(default)]
#[schema(required)]
description: String,
uri: String,
#[serde(default)]
Expand All @@ -297,6 +307,8 @@ pub enum ExtensionConfig {
Frontend {
/// The name used to identify this extension
name: String,
#[serde(default)]
#[schema(required)]
description: String,
/// The tools provided by the frontend
tools: Vec<Tool>,
Expand All @@ -312,6 +324,8 @@ pub enum ExtensionConfig {
InlinePython {
/// The name used to identify this extension
name: String,
#[serde(default)]
#[schema(required)]
description: String,
/// The Python code to execute
code: String,
Expand Down
Loading