mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 11:14:23 +01:00
config validation
This commit is contained in:
269
opencode-schema.json
Normal file
269
opencode-schema.json
Normal file
@@ -0,0 +1,269 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"agent": {
|
||||
"description": "Agent configuration",
|
||||
"properties": {
|
||||
"maxTokens": {
|
||||
"description": "Maximum tokens for the agent",
|
||||
"minimum": 1,
|
||||
"type": "integer"
|
||||
},
|
||||
"model": {
|
||||
"description": "Model ID for the agent",
|
||||
"enum": [
|
||||
"gemini-2.0-flash",
|
||||
"bedrock.claude-3.7-sonnet",
|
||||
"claude-3-opus",
|
||||
"claude-3.5-sonnet",
|
||||
"gpt-4o-mini",
|
||||
"o1",
|
||||
"o3-mini",
|
||||
"o1-pro",
|
||||
"o4-mini",
|
||||
"claude-3-haiku",
|
||||
"gpt-4o",
|
||||
"o3",
|
||||
"gpt-4.1-mini",
|
||||
"gpt-4.5-preview",
|
||||
"gemini-2.5-flash",
|
||||
"claude-3.5-haiku",
|
||||
"gpt-4.1",
|
||||
"gemini-2.0-flash-lite",
|
||||
"claude-3.7-sonnet",
|
||||
"o1-mini",
|
||||
"gpt-4.1-nano",
|
||||
"gemini-2.5"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"description": "Reasoning effort for models that support it (OpenAI, Anthropic)",
|
||||
"enum": [
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"model"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"description": "Configuration schema for the OpenCode application",
|
||||
"properties": {
|
||||
"agents": {
|
||||
"additionalProperties": {
|
||||
"description": "Agent configuration",
|
||||
"properties": {
|
||||
"maxTokens": {
|
||||
"description": "Maximum tokens for the agent",
|
||||
"minimum": 1,
|
||||
"type": "integer"
|
||||
},
|
||||
"model": {
|
||||
"description": "Model ID for the agent",
|
||||
"enum": [
|
||||
"gemini-2.0-flash",
|
||||
"bedrock.claude-3.7-sonnet",
|
||||
"claude-3-opus",
|
||||
"claude-3.5-sonnet",
|
||||
"gpt-4o-mini",
|
||||
"o1",
|
||||
"o3-mini",
|
||||
"o1-pro",
|
||||
"o4-mini",
|
||||
"claude-3-haiku",
|
||||
"gpt-4o",
|
||||
"o3",
|
||||
"gpt-4.1-mini",
|
||||
"gpt-4.5-preview",
|
||||
"gemini-2.5-flash",
|
||||
"claude-3.5-haiku",
|
||||
"gpt-4.1",
|
||||
"gemini-2.0-flash-lite",
|
||||
"claude-3.7-sonnet",
|
||||
"o1-mini",
|
||||
"gpt-4.1-nano",
|
||||
"gemini-2.5"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"description": "Reasoning effort for models that support it (OpenAI, Anthropic)",
|
||||
"enum": [
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"model"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"description": "Agent configurations",
|
||||
"properties": {
|
||||
"coder": {
|
||||
"$ref": "#/definitions/agent"
|
||||
},
|
||||
"task": {
|
||||
"$ref": "#/definitions/agent"
|
||||
},
|
||||
"title": {
|
||||
"$ref": "#/definitions/agent"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"data": {
|
||||
"description": "Storage configuration",
|
||||
"properties": {
|
||||
"directory": {
|
||||
"default": ".opencode",
|
||||
"description": "Directory where application data is stored",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"directory"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"debug": {
|
||||
"default": false,
|
||||
"description": "Enable debug mode",
|
||||
"type": "boolean"
|
||||
},
|
||||
"debugLSP": {
|
||||
"default": false,
|
||||
"description": "Enable LSP debug mode",
|
||||
"type": "boolean"
|
||||
},
|
||||
"lsp": {
|
||||
"additionalProperties": {
|
||||
"description": "LSP configuration for a language",
|
||||
"properties": {
|
||||
"args": {
|
||||
"description": "Command arguments for the LSP server",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"command": {
|
||||
"description": "Command to execute for the LSP server",
|
||||
"type": "string"
|
||||
},
|
||||
"disabled": {
|
||||
"default": false,
|
||||
"description": "Whether the LSP is disabled",
|
||||
"type": "boolean"
|
||||
},
|
||||
"options": {
|
||||
"description": "Additional options for the LSP server",
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"description": "Language Server Protocol configurations",
|
||||
"type": "object"
|
||||
},
|
||||
"mcpServers": {
|
||||
"additionalProperties": {
|
||||
"description": "MCP server configuration",
|
||||
"properties": {
|
||||
"args": {
|
||||
"description": "Command arguments for the MCP server",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"command": {
|
||||
"description": "Command to execute for the MCP server",
|
||||
"type": "string"
|
||||
},
|
||||
"env": {
|
||||
"description": "Environment variables for the MCP server",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"headers": {
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "HTTP headers for SSE type MCP servers",
|
||||
"type": "object"
|
||||
},
|
||||
"type": {
|
||||
"default": "stdio",
|
||||
"description": "Type of MCP server",
|
||||
"enum": [
|
||||
"stdio",
|
||||
"sse"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"description": "URL for SSE type MCP servers",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"description": "Model Control Protocol server configurations",
|
||||
"type": "object"
|
||||
},
|
||||
"providers": {
|
||||
"additionalProperties": {
|
||||
"description": "Provider configuration",
|
||||
"properties": {
|
||||
"apiKey": {
|
||||
"description": "API key for the provider",
|
||||
"type": "string"
|
||||
},
|
||||
"disabled": {
|
||||
"default": false,
|
||||
"description": "Whether the provider is disabled",
|
||||
"type": "boolean"
|
||||
},
|
||||
"provider": {
|
||||
"description": "Provider type",
|
||||
"enum": [
|
||||
"anthropic",
|
||||
"openai",
|
||||
"gemini",
|
||||
"groq",
|
||||
"bedrock"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"description": "LLM provider configurations",
|
||||
"type": "object"
|
||||
},
|
||||
"wd": {
|
||||
"description": "Working directory for the application",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "OpenCode Configuration",
|
||||
"type": "object"
|
||||
}
|
||||
Reference in New Issue
Block a user