{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://dashfy.dev/schema.json",
  "title": "Dashfy Project Configuration",
  "description": "The dashfy.json project configuration written by `dashfy init` and read by add, remove, and doctor.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": { "type": "string" },
    "registries": {
      "type": "object",
      "description": "Custom registry endpoints, merged over the built-in @getdashfy namespace.",
      "propertyNames": { "pattern": "^@" },
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string",
            "description": "URL template containing the {name} placeholder.",
            "pattern": "\\{name\\}"
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": ["url"],
            "properties": {
              "url": {
                "type": "string",
                "description": "URL template containing the {name} placeholder.",
                "pattern": "\\{name\\}"
              },
              "params": {
                "type": "object",
                "description": "Query parameters sent with each request. Values may reference ${ENV_VAR}.",
                "additionalProperties": { "type": "string" }
              },
              "headers": {
                "type": "object",
                "description": "Headers sent with each request. Values may reference ${ENV_VAR}.",
                "additionalProperties": { "type": "string" }
              }
            }
          }
        ]
      }
    },
    "paths": {
      "type": "object",
      "description": "Where the CLI applies changes. Takes precedence over its file discovery.",
      "additionalProperties": false,
      "properties": {
        "app": {
          "type": "string",
          "description": "File that registers widgets via WidgetRegistry.addExtension (e.g. src/App.tsx)."
        },
        "server": {
          "type": "string",
          "description": "Dashfy server entry that registers data sources (e.g. dashfy.server.ts)."
        },
        "config": {
          "type": "string",
          "description": "Dashboard configuration file (e.g. dashfy.config.yml)."
        },
        "env": {
          "type": "string",
          "description": "Environment file seeded with an extension's envVars (e.g. .env)."
        }
      }
    }
  }
}
