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
88 changes: 86 additions & 2 deletions crates/goose-sdk/src/custom_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ pub struct ProviderConfigChangeResponse {

#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct ProviderCatalogEntryDto {
pub struct ProviderTemplateCatalogEntryDto {
pub provider_id: String,
pub name: String,
pub format: String,
Expand All @@ -437,6 +437,73 @@ pub struct ProviderCatalogEntryDto {
pub env_var: String,
}

#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ProviderSetupCategoryDto {
Agent,
#[default]
Model,
}

#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ProviderSetupMethodDto {
None,
SingleApiKey,
ConfigFields,
HostWithOauthFallback,
OauthBrowser,
OauthDeviceCode,
CloudCredentials,
Local,
CliAuth,
}

#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ProviderSetupGroupDto {
Default,
Additional,
}

#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct ProviderSetupFieldDto {
pub key: String,
pub label: String,
pub secret: bool,
pub required: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub placeholder: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_value: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct ProviderSetupCatalogEntryDto {
pub provider_id: String,
pub name: String,
pub category: ProviderSetupCategoryDto,
pub description: String,
pub setup_method: ProviderSetupMethodDto,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub native_connect_query: Option<String>,
#[serde(default)]
pub fields: Vec<ProviderSetupFieldDto>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub binary_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub doc_url: Option<String>,
pub group: ProviderSetupGroupDto,
pub show_only_when_installed: bool,
#[serde(default)]
pub aliases: Vec<String>,
pub supports_install: bool,
pub supports_auth: bool,
pub supports_auth_status: bool,
}

#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct ProviderTemplateCapabilitiesDto {
Expand Down Expand Up @@ -484,7 +551,22 @@ pub struct ProviderCatalogListRequest {
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcResponse)]
#[serde(rename_all = "camelCase")]
pub struct ProviderCatalogListResponse {
pub providers: Vec<ProviderCatalogEntryDto>,
pub providers: Vec<ProviderTemplateCatalogEntryDto>,
}

/// List provider setup catalog entries
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
#[request(
method = "_goose/providers/setup/catalog/list",
response = ProviderSetupCatalogListResponse
)]
#[serde(rename_all = "camelCase")]
pub struct ProviderSetupCatalogListRequest {}

#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcResponse)]
#[serde(rename_all = "camelCase")]
pub struct ProviderSetupCatalogListResponse {
pub providers: Vec<ProviderSetupCatalogEntryDto>,
}

/// Return the editable template for one catalog provider.
Expand Down Expand Up @@ -949,6 +1031,8 @@ pub struct ProviderInventoryEntryDto {
pub configured: bool,
/// Provider classification such as `Preferred`, `Builtin`, `Declarative`, or `Custom`.
pub provider_type: String,
/// Whether this inventory entry represents an agent provider or a model provider.
pub category: ProviderSetupCategoryDto,
/// Required configuration keys and setup metadata.
pub config_keys: Vec<ProviderConfigKey>,
/// Step-by-step setup instructions, when present.
Expand Down
5 changes: 5 additions & 0 deletions crates/goose/acp-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
"requestType": "ProviderCatalogListRequest",
"responseType": "ProviderCatalogListResponse"
},
{
"method": "_goose/providers/setup/catalog/list",
"requestType": "ProviderSetupCatalogListRequest",
"responseType": "ProviderSetupCatalogListResponse"
},
{
"method": "_goose/providers/catalog/template",
"requestType": "ProviderCatalogTemplateRequest",
Expand Down
190 changes: 188 additions & 2 deletions crates/goose/acp-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@
"type": "string",
"description": "Provider classification such as `Preferred`, `Builtin`, `Declarative`, or `Custom`."
},
"category": {
"$ref": "#/$defs/ProviderSetupCategoryDto",
"description": "Whether this inventory entry represents an agent provider or a model provider."
},
"configKeys": {
"type": "array",
"items": {
Expand Down Expand Up @@ -420,6 +424,7 @@
"defaultModel",
"configured",
"providerType",
"category",
"configKeys",
"setupSteps",
"supportsRefresh",
Expand All @@ -429,6 +434,13 @@
],
"description": "Provider inventory entry."
},
"ProviderSetupCategoryDto": {
"type": "string",
"enum": [
"agent",
"model"
]
},
"ProviderConfigKey": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -533,7 +545,7 @@
"providers": {
"type": "array",
"items": {
"$ref": "#/$defs/ProviderCatalogEntryDto"
"$ref": "#/$defs/ProviderTemplateCatalogEntryDto"
}
}
},
Expand All @@ -543,7 +555,7 @@
"x-side": "agent",
"x-method": "_goose/providers/catalog/list"
},
"ProviderCatalogEntryDto": {
"ProviderTemplateCatalogEntryDto": {
"type": "object",
"properties": {
"providerId": {
Expand Down Expand Up @@ -579,6 +591,163 @@
"envVar"
]
},
"ProviderSetupCatalogListRequest": {
"type": "object",
"description": "List provider setup catalog entries",
"x-side": "agent",
"x-method": "_goose/providers/setup/catalog/list"
},
"ProviderSetupCatalogListResponse": {
"type": "object",
"properties": {
"providers": {
"type": "array",
"items": {
"$ref": "#/$defs/ProviderSetupCatalogEntryDto"
}
}
},
"required": [
"providers"
],
"x-side": "agent",
"x-method": "_goose/providers/setup/catalog/list"
},
"ProviderSetupCatalogEntryDto": {
"type": "object",
"properties": {
"providerId": {
"type": "string"
},
"name": {
"type": "string"
},
"category": {
"$ref": "#/$defs/ProviderSetupCategoryDto"
},
"description": {
"type": "string"
},
"setupMethod": {
"$ref": "#/$defs/ProviderSetupMethodDto"
},
"nativeConnectQuery": {
"type": [
"string",
"null"
]
},
"fields": {
"type": "array",
"items": {
"$ref": "#/$defs/ProviderSetupFieldDto"
},
"default": []
},
"binaryName": {
"type": [
"string",
"null"
]
},
"docUrl": {
"type": [
"string",
"null"
]
},
"group": {
"$ref": "#/$defs/ProviderSetupGroupDto"
},
"showOnlyWhenInstalled": {
"type": "boolean"
},
"aliases": {
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"supportsInstall": {
"type": "boolean"
},
"supportsAuth": {
"type": "boolean"
},
"supportsAuthStatus": {
"type": "boolean"
}
},
"required": [
"providerId",
"name",
"category",
"description",
"setupMethod",
"group",
"showOnlyWhenInstalled",
"supportsInstall",
"supportsAuth",
"supportsAuthStatus"
]
},
"ProviderSetupMethodDto": {
"type": "string",
"enum": [
"none",
"single_api_key",
"config_fields",
"host_with_oauth_fallback",
"oauth_browser",
"oauth_device_code",
"cloud_credentials",
"local",
"cli_auth"
]
},
"ProviderSetupFieldDto": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
"secret": {
"type": "boolean"
},
"required": {
"type": "boolean"
},
"placeholder": {
"type": [
"string",
"null"
]
},
"defaultValue": {
"type": [
"string",
"null"
]
}
},
"required": [
"key",
"label",
"secret",
"required"
]
},
"ProviderSetupGroupDto": {
"type": "string",
"enum": [
"default",
"additional"
]
},
"ProviderCatalogTemplateRequest": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2265,6 +2434,15 @@
"description": "Params for _goose/providers/catalog/list",
"title": "ProviderCatalogListRequest"
},
{
"allOf": [
{
"$ref": "#/$defs/ProviderSetupCatalogListRequest"
}
],
"description": "Params for _goose/providers/setup/catalog/list",
"title": "ProviderSetupCatalogListRequest"
},
{
"allOf": [
{
Expand Down Expand Up @@ -2683,6 +2861,14 @@
],
"title": "ProviderCatalogListResponse"
},
{
"allOf": [
{
"$ref": "#/$defs/ProviderSetupCatalogListResponse"
}
],
"title": "ProviderSetupCatalogListResponse"
},
{
"allOf": [
{
Expand Down
1 change: 1 addition & 0 deletions crates/goose/src/acp/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3189,6 +3189,7 @@ print(\"hello, world\")
default_model: "unused".to_string(),
configured: true,
provider_type: crate::providers::base::ProviderType::Builtin,
category: crate::providers::catalog::ProviderSetupCategory::Model,
config_keys: vec![],
setup_steps: vec![],
supports_refresh: true,
Expand Down
8 changes: 8 additions & 0 deletions crates/goose/src/acp/server/custom_dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ impl GooseAcpAgent {
self.on_list_provider_catalog(req).await
}

#[custom_method(ProviderSetupCatalogListRequest)]
async fn dispatch_list_provider_setup_catalog(
&self,
req: ProviderSetupCatalogListRequest,
) -> Result<ProviderSetupCatalogListResponse, sacp::Error> {
self.on_list_provider_setup_catalog(req).await
}

#[custom_method(ProviderCatalogTemplateRequest)]
async fn dispatch_get_provider_catalog_template(
&self,
Expand Down
Loading
Loading