diff --git a/internal/config/config.go b/internal/config/config.go index fd00f4a31e851ae8060c13dea369cb8a9f33d790..9abbc4eef189315ba786992d6f00f374121c0af9 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -13,7 +13,6 @@ import ( "github.com/charmbracelet/catwalk/pkg/catwalk" "github.com/charmbracelet/crush/internal/csync" "github.com/charmbracelet/crush/internal/env" - "github.com/invopop/jsonschema" "github.com/tidwall/sjson" ) @@ -46,16 +45,6 @@ const ( SelectedModelTypeSmall SelectedModelType = "small" ) -// JSONSchema returns the JSON schema for SelectedModelType -func (SelectedModelType) JSONSchema() *jsonschema.Schema { - return &jsonschema.Schema{ - Type: "string", - Description: "Model type selection for different use cases", - Enum: []any{"large", "small"}, - Default: "large", - } -} - type SelectedModel struct { // The model id as used by the provider API. // Required. @@ -111,16 +100,6 @@ const ( MCPHttp MCPType = "http" ) -// JSONSchema returns the JSON schema for MCPType -func (MCPType) JSONSchema() *jsonschema.Schema { - return &jsonschema.Schema{ - Type: "string", - Description: "Type of MCP connection protocol", - Enum: []any{"stdio", "sse", "http"}, - Default: "stdio", - } -} - type MCPConfig struct { Command string `json:"command,omitempty" jsonschema:"description=Command to execute for stdio MCP servers,example=npx"` Env map[string]string `json:"env,omitempty" jsonschema:"description=Environment variables to set for the MCP server"` @@ -239,7 +218,7 @@ type Agent struct { // This is the id of the system prompt used by the agent Disabled bool `json:"disabled,omitempty"` - Model SelectedModelType `json:"model"` + Model SelectedModelType `json:"model" jsonschema:"required,description=The model type to use for this agent,enum=large,enum=small,default=large"` // The available tools for the agent // if this is nil, all tools are available diff --git a/schema.json b/schema.json index 0f3b01b6f4c452f1badaf5cbb8237406fcc5438b..05dcc56c573405c6e4c3eb67762dd7ffd2d38ad7 100644 --- a/schema.json +++ b/schema.json @@ -100,8 +100,14 @@ "description": "Arguments to pass to the MCP server command" }, "type": { - "$ref": "#/$defs/MCPType", - "description": "Type of MCP connection" + "type": "string", + "enum": [ + "stdio", + "sse", + "http" + ], + "description": "Type of MCP connection", + "default": "stdio" }, "url": { "type": "string", @@ -130,16 +136,6 @@ "type" ] }, - "MCPType": { - "type": "string", - "enum": [ - "stdio", - "sse", - "http" - ], - "description": "Type of MCP connection protocol", - "default": "stdio" - }, "MCPs": { "additionalProperties": { "$ref": "#/$defs/MCPConfig"