feat: extensions read config (#1637)

This commit is contained in:
Lily Delalande
2025-03-12 18:41:31 -07:00
committed by GitHub
parent 68b3b3f9cc
commit 4537264387
15 changed files with 756 additions and 190 deletions
+235 -14
View File
@@ -33,7 +33,28 @@
}
}
},
"/config/extension": {
"/config/extensions": {
"get": {
"tags": [
"super::routes::config_management"
],
"operationId": "get_extensions",
"responses": {
"200": {
"description": "All extensions retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExtensionResponse"
}
}
}
},
"500": {
"description": "Internal server error"
}
}
},
"post": {
"tags": [
"super::routes::config_management"
@@ -67,12 +88,24 @@
"description": "Internal server error"
}
}
},
}
},
"/config/extensions/{name}": {
"put": {
"tags": [
"super::routes::config_management"
],
"operationId": "update_extension",
"parameters": [
{
"name": "name",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
@@ -85,7 +118,7 @@
},
"responses": {
"200": {
"description": "Extension configuration updated successfully",
"description": "Extension updated successfully",
"content": {
"text/plain": {
"schema": {
@@ -107,16 +140,16 @@
"super::routes::config_management"
],
"operationId": "remove_extension",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ConfigKeyQuery"
}
"parameters": [
{
"name": "name",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
"required": true
},
}
],
"responses": {
"200": {
"description": "Extension removed successfully",
@@ -259,6 +292,42 @@
}
}
}
},
"/extensions/{name}/toggle": {
"post": {
"tags": [
"super::routes::config_management"
],
"operationId": "toggle_extension",
"parameters": [
{
"name": "name",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Extension toggled successfully",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
},
"404": {
"description": "Extension not found"
},
"500": {
"description": "Internal server error"
}
}
}
}
},
"components": {
@@ -313,19 +382,171 @@
}
}
},
"Envs": {
"type": "object",
"additionalProperties": {
"type": "string",
"description": "A map of environment variables to set, e.g. API_KEY -> some_secret, HOST -> host"
}
},
"ExtensionConfig": {
"oneOf": [
{
"type": "object",
"description": "Server-sent events client with a URI endpoint",
"required": [
"name",
"uri",
"type"
],
"properties": {
"envs": {
"$ref": "#/components/schemas/Envs"
},
"name": {
"type": "string",
"description": "The name used to identify this extension"
},
"timeout": {
"type": "integer",
"format": "int64",
"nullable": true,
"minimum": 0
},
"type": {
"type": "string",
"enum": [
"sse"
]
},
"uri": {
"type": "string"
}
}
},
{
"type": "object",
"description": "Standard I/O client with command and arguments",
"required": [
"name",
"cmd",
"args",
"type"
],
"properties": {
"args": {
"type": "array",
"items": {
"type": "string"
}
},
"cmd": {
"type": "string"
},
"envs": {
"$ref": "#/components/schemas/Envs"
},
"name": {
"type": "string",
"description": "The name used to identify this extension"
},
"timeout": {
"type": "integer",
"format": "int64",
"nullable": true,
"minimum": 0
},
"type": {
"type": "string",
"enum": [
"stdio"
]
}
}
},
{
"type": "object",
"description": "Built-in extension that is part of the goose binary",
"required": [
"name",
"type"
],
"properties": {
"name": {
"type": "string",
"description": "The name used to identify this extension"
},
"timeout": {
"type": "integer",
"format": "int64",
"nullable": true,
"minimum": 0
},
"type": {
"type": "string",
"enum": [
"builtin"
]
}
}
}
],
"description": "Represents the different types of MCP extensions that can be added to the manager",
"discriminator": {
"propertyName": "type"
}
},
"ExtensionEntry": {
"allOf": [
{
"$ref": "#/components/schemas/ExtensionConfig"
},
{
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
}
}
}
]
},
"ExtensionQuery": {
"type": "object",
"required": [
"name",
"config"
"config",
"enabled"
],
"properties": {
"config": {},
"config": {
"$ref": "#/components/schemas/ExtensionConfig"
},
"enabled": {
"type": "boolean"
},
"name": {
"type": "string"
}
}
},
"ExtensionResponse": {
"type": "object",
"required": [
"extensions"
],
"properties": {
"extensions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ExtensionEntry"
}
}
}
},
"ProviderDetails": {
"type": "object",
"required": [