Merge pull request #623 from charmbracelet/schema

Kujtim Hoxha created

fix: add $schema to jsonschema

Change summary

internal/config/config.go | 3 ++-
schema.json               | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)

Detailed changes

internal/config/config.go 🔗

@@ -20,7 +20,6 @@ import (
 const (
 	appName              = "crush"
 	defaultDataDirectory = ".crush"
-	defaultLogLevel      = "info"
 )
 
 var defaultContextPaths = []string{
@@ -244,6 +243,8 @@ type Agent struct {
 
 // Config holds the configuration for crush.
 type Config struct {
+	Schema string `json:"$schema,omitempty"`
+
 	// We currently only support large/small as values here.
 	Models map[SelectedModelType]SelectedModel `json:"models,omitempty" jsonschema:"description=Model configurations for different model types,example={\"large\":{\"model\":\"gpt-4o\",\"provider\":\"openai\"}}"`
 

schema.json 🔗

@@ -5,6 +5,9 @@
   "$defs": {
     "Config": {
       "properties": {
+        "$schema": {
+          "type": "string"
+        },
         "models": {
           "additionalProperties": {
             "$ref": "#/$defs/SelectedModel"