feat: mcp router extension discovery and install tool (#1995)
Co-authored-by: Alice Hau <ahau@squareup.com>
This commit is contained in:
@@ -642,6 +642,24 @@ impl Session {
|
||||
principal_type: PrincipalType::Tool,
|
||||
permission,
|
||||
},).await;
|
||||
} else if let Some(MessageContent::EnableExtensionRequest(enable_extension_request)) = message.content.first() {
|
||||
output::hide_thinking();
|
||||
|
||||
let prompt = "Goose would like to install the following extension, do you approve?".to_string();
|
||||
let confirmed = cliclack::select(prompt)
|
||||
.item(true, "Yes, for this session", "Enable the extension for this session")
|
||||
.item(false, "No", "Do not enable the extension")
|
||||
.interact()?;
|
||||
let permission = if confirmed {
|
||||
Permission::AllowOnce
|
||||
} else {
|
||||
Permission::DenyOnce
|
||||
};
|
||||
self.agent.handle_confirmation(enable_extension_request.id.clone(), PermissionConfirmation {
|
||||
principal_name: "extension_name_placeholder".to_string(),
|
||||
principal_type: PrincipalType::Extension,
|
||||
permission,
|
||||
},).await;
|
||||
}
|
||||
// otherwise we have a model/tool to render
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user