@@ -13,7 +13,6 @@ import (
13 "github.com/charmbracelet/catwalk/pkg/catwalk"
13 "github.com/charmbracelet/catwalk/pkg/catwalk"
14 "github.com/charmbracelet/crush/internal/csync"
14 "github.com/charmbracelet/crush/internal/csync"
15 "github.com/charmbracelet/crush/internal/env"
15 "github.com/charmbracelet/crush/internal/env"
16− "github.com/invopop/jsonschema"
17 "github.com/tidwall/sjson"
16 "github.com/tidwall/sjson"
@@ -46,16 +45,6 @@ const (
46 SelectedModelTypeSmall SelectedModelType = "small"
45 SelectedModelTypeSmall SelectedModelType = "small"
49−// JSONSchema returns the JSON schema for SelectedModelType
50−func (SelectedModelType) JSONSchema() *jsonschema.Schema {
51− return &jsonschema.Schema{
53− Description: "Model type selection for different use cases",
54− Enum: []any{"large", "small"},
59type SelectedModel struct {
48type SelectedModel struct {
60 // The model id as used by the provider API.
49 // The model id as used by the provider API.
61 // Required.
50 // Required.
@@ -111,16 +100,6 @@ const (
111 MCPHttp MCPType = "http"
100 MCPHttp MCPType = "http"
114−// JSONSchema returns the JSON schema for MCPType
115−func (MCPType) JSONSchema() *jsonschema.Schema {
116− return &jsonschema.Schema{
118− Description: "Type of MCP connection protocol",
119− Enum: []any{"stdio", "sse", "http"},
124type MCPConfig struct {
103type MCPConfig struct {
125 Command string `json:"command,omitempty" jsonschema:"description=Command to execute for stdio MCP servers,example=npx"`
104 Command string `json:"command,omitempty" jsonschema:"description=Command to execute for stdio MCP servers,example=npx"`
126 Env map[string]string `json:"env,omitempty" jsonschema:"description=Environment variables to set for the MCP server"`
105 Env map[string]string `json:"env,omitempty" jsonschema:"description=Environment variables to set for the MCP server"`
@@ -239,7 +218,7 @@ type Agent struct {
239 // This is the id of the system prompt used by the agent
218 // This is the id of the system prompt used by the agent
240 Disabled bool `json:"disabled,omitempty"`
219 Disabled bool `json:"disabled,omitempty"`
242− Model SelectedModelType `json:"model"`
221+ Model SelectedModelType `json:"model" jsonschema:"required,description=The model type to use for this agent,enum=large,enum=small,default=large"`
244 // The available tools for the agent
223 // The available tools for the agent
245 // if this is nil, all tools are available
224 // if this is nil, all tools are available