Restore recipe parameters functionality (#3530)

This commit is contained in:
Zane
2025-07-22 10:31:44 -07:00
committed by GitHub
parent 914c537965
commit 246ba19256
28 changed files with 1057 additions and 479 deletions
@@ -80,6 +80,7 @@ pub async fn handle_configure() -> Result<(), Box<dyn Error>> {
display_name: Some(goose::config::DEFAULT_DISPLAY_NAME.to_string()),
timeout: Some(goose::config::DEFAULT_EXTENSION_TIMEOUT),
bundled: Some(true),
description: None,
},
})?;
}
@@ -558,6 +559,7 @@ pub fn configure_extensions_dialog() -> Result<(), Box<dyn Error>> {
display_name: Some(display_name),
timeout: Some(timeout),
bundled: Some(true),
description: None,
},
})?;
@@ -33,6 +33,7 @@ pub fn extract_recipe_info_from_cli(
name,
values: None,
sequential_when_repeated: true,
description: None,
};
all_sub_recipes.push(additional_sub_recipe);
}
+1
View File
@@ -304,6 +304,7 @@ impl Session {
// TODO: should set a timeout
timeout: Some(goose::config::DEFAULT_EXTENSION_TIMEOUT),
bundled: None,
description: None,
};
self.agent
.add_extension(config)
@@ -19,9 +19,12 @@ fn main() {
fs::create_dir_all(parent).unwrap();
}
fs::write(&output_path, schema).unwrap();
println!(
fs::write(&output_path, &schema).unwrap();
eprintln!(
"Successfully generated OpenAPI schema at {}",
output_path.display()
);
// Output the schema to stdout for piping
println!("{}", schema);
}
@@ -251,6 +251,7 @@ async fn add_extension(
display_name,
timeout,
bundled: None,
description: None,
},
ExtensionConfigRequest::Frontend {
name,
+2
View File
@@ -163,6 +163,7 @@ pub enum ExtensionConfig {
/// The name used to identify this extension
name: String,
display_name: Option<String>, // needed for the UI
description: Option<String>,
timeout: Option<u64>,
/// Whether this extension is bundled with Goose
#[serde(default)]
@@ -208,6 +209,7 @@ impl Default for ExtensionConfig {
Self::Builtin {
name: config::DEFAULT_EXTENSION.to_string(),
display_name: Some(config::DEFAULT_DISPLAY_NAME.to_string()),
description: None,
timeout: Some(config::DEFAULT_EXTENSION_TIMEOUT),
bundled: Some(true),
}
@@ -242,6 +242,7 @@ impl ExtensionManager {
ExtensionConfig::Builtin {
name,
display_name: _,
description: _,
timeout,
bundled: _,
} => {
+1
View File
@@ -46,6 +46,7 @@ impl ExtensionConfigManager {
display_name: Some(DEFAULT_DISPLAY_NAME.to_string()),
timeout: Some(DEFAULT_EXTENSION_TIMEOUT),
bundled: Some(true),
description: Some(DEFAULT_EXTENSION_DESCRIPTION.to_string()),
},
},
)]);
+5
View File
@@ -151,6 +151,8 @@ pub struct SubRecipe {
pub values: Option<HashMap<String, String>>,
#[serde(default)]
pub sequential_when_repeated: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
fn deserialize_value_map_as_string<'de, D>(
@@ -204,6 +206,7 @@ pub enum RecipeParameterInputType {
Boolean,
Date,
File,
Select,
}
impl fmt::Display for RecipeParameterInputType {
@@ -224,6 +227,8 @@ pub struct RecipeParameter {
pub description: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub default: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<Vec<String>>,
}
/// Builder for creating Recipe instances