{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
    },
    "version": {
      "type": "string",
      "maxLength": 60
    },
    "description": {
      "type": "string",
      "maxLength": 1000
    },
    "author": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "email": {
              "type": "string",
              "maxLength": 200
            },
            "url": {
              "type": "string",
              "maxLength": 500
            }
          },
          "required": [
            "name"
          ]
        }
      ]
    },
    "homepage": {
      "type": "string",
      "maxLength": 500
    },
    "repository": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "object",
          "properties": {
            "url": {
              "type": "string",
              "maxLength": 500
            }
          },
          "required": [
            "url"
          ]
        }
      ]
    },
    "license": {
      "type": "string",
      "maxLength": 100
    },
    "keywords": {
      "maxItems": 30,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 60
      }
    },
    "mcpServers": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 300
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.-]{1,100}$"
          },
          "additionalProperties": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "command": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "args": {
                    "default": [],
                    "maxItems": 60,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 1000
                    }
                  },
                  "env": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 2000
                    }
                  },
                  "cwd": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "command"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "http",
                      "sse",
                      "streamable-http"
                    ]
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "headers": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9-]{1,60}$"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 2000
                    }
                  }
                },
                "required": [
                  "url"
                ]
              }
            ]
          }
        }
      ]
    },
    "hooks": {},
    "commands": {},
    "lspServers": {},
    "outputStyles": {},
    "monitors": {},
    "apps": {},
    "extensions": {
      "type": "object",
      "properties": {
        "dev.getramu": {
          "type": "object",
          "properties": {
            "credentials": {
              "default": [],
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_-]{0,39}$"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "env": {
                    "type": "string",
                    "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "token",
                      "sign-in"
                    ]
                  },
                  "page": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "scope": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "pattern": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "fields": {
                    "default": [],
                    "maxItems": 6,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_-]{0,39}$"
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "env": {
                          "type": "string",
                          "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
                        },
                        "kind": {
                          "default": "text",
                          "type": "string",
                          "enum": [
                            "text",
                            "url",
                            "secret"
                          ]
                        },
                        "pattern": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "placeholder": {
                          "type": "string",
                          "maxLength": 200
                        },
                        "values": {
                          "minItems": 1,
                          "maxItems": 20,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 60
                          }
                        },
                        "default": {
                          "type": "string",
                          "maxLength": 200
                        }
                      },
                      "required": [
                        "id",
                        "label",
                        "env"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "signIn": {
                    "type": "object",
                    "properties": {
                      "authorizeUrl": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "tokenUrl": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "scopes": {
                        "default": [],
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        }
                      },
                      "sandbox": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 60
                          },
                          "authorizeUrl": {
                            "type": "string",
                            "maxLength": 2000
                          },
                          "tokenUrl": {
                            "type": "string",
                            "maxLength": 2000
                          }
                        },
                        "required": [
                          "label",
                          "authorizeUrl",
                          "tokenUrl"
                        ],
                        "additionalProperties": false
                      },
                      "clientPage": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "instanceField": {
                        "type": "string",
                        "pattern": "^[a-z_]{1,40}$"
                      }
                    },
                    "required": [
                      "authorizeUrl",
                      "tokenUrl"
                    ],
                    "additionalProperties": false
                  },
                  "check": {
                    "type": "object",
                    "properties": {
                      "request": {
                        "type": "object",
                        "properties": {
                          "method": {
                            "default": "GET",
                            "type": "string",
                            "enum": [
                              "GET",
                              "POST"
                            ]
                          },
                          "url": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          },
                          "headers": {
                            "default": {},
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9-]{1,60}$"
                            },
                            "additionalProperties": {
                              "type": "string",
                              "maxLength": 500
                            }
                          },
                          "body": {}
                        },
                        "required": [
                          "url"
                        ],
                        "additionalProperties": false
                      },
                      "identity": {
                        "type": "string",
                        "maxLength": 200
                      }
                    },
                    "required": [
                      "request"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "label",
                  "env",
                  "kind"
                ],
                "additionalProperties": false
              }
            },
            "cli": {
              "type": "object",
              "properties": {
                "binaries": {
                  "minItems": 1,
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9._-]{1,60}$"
                  }
                },
                "npx": {
                  "type": "string",
                  "pattern": "^(@[a-z0-9._-]+\\/)?[a-z0-9._-]+(@[A-Za-z0-9.^~<>=*-]+)?$"
                },
                "reads": {
                  "default": [],
                  "maxItems": 60,
                  "type": "array",
                  "items": {
                    "minItems": 1,
                    "maxItems": 6,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 60
                    }
                  }
                },
                "credential": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_-]{0,39}$"
                }
              },
              "required": [
                "binaries"
              ],
              "additionalProperties": false
            },
            "abilities": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "server": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "tool": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "status": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "balance": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "fromImage": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "refine": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "downloads": {
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "server",
                  "tool"
                ],
                "additionalProperties": false
              }
            },
            "dataSources": {
              "default": [],
              "maxItems": 12,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{0,39}$"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "credential": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_-]{0,39}$"
                  },
                  "request": {
                    "type": "object",
                    "properties": {
                      "method": {
                        "default": "GET",
                        "type": "string",
                        "enum": [
                          "GET",
                          "POST"
                        ]
                      },
                      "url": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      },
                      "headers": {
                        "default": {},
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9-]{1,60}$"
                        },
                        "additionalProperties": {
                          "type": "string",
                          "maxLength": 500
                        }
                      },
                      "body": {}
                    },
                    "required": [
                      "url"
                    ],
                    "additionalProperties": false
                  },
                  "readOnly": {
                    "default": false,
                    "type": "boolean"
                  },
                  "query": {
                    "default": [],
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "pattern": "^[A-Za-z][A-Za-z0-9_]{0,39}$"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "string",
                            "number",
                            "boolean",
                            "object"
                          ]
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "values": {
                          "minItems": 1,
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 100
                              },
                              {
                                "type": "number"
                              }
                            ]
                          }
                        },
                        "default": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        },
                        "min": {
                          "type": "number"
                        },
                        "max": {
                          "type": "number"
                        },
                        "maxLength": {
                          "default": 500,
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 4000
                        },
                        "pattern": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "required": {
                          "default": false,
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "name",
                        "type"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "rows": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "shape": {
                            "type": "string",
                            "const": "objects"
                          },
                          "path": {
                            "default": "",
                            "type": "string",
                            "maxLength": 200
                          }
                        },
                        "required": [
                          "shape"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "shape": {
                            "type": "string",
                            "const": "columns"
                          },
                          "names": {
                            "type": "string",
                            "maxLength": 200
                          },
                          "nameKey": {
                            "type": "string",
                            "maxLength": 60
                          },
                          "values": {
                            "type": "string",
                            "maxLength": 200
                          }
                        },
                        "required": [
                          "shape",
                          "names",
                          "values"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "shape": {
                            "type": "string",
                            "const": "series"
                          },
                          "dates": {
                            "type": "string",
                            "maxLength": 200
                          },
                          "values": {
                            "type": "string",
                            "maxLength": 200
                          },
                          "labels": {
                            "type": "string",
                            "maxLength": 200
                          },
                          "label": {
                            "type": "string",
                            "maxLength": 200
                          }
                        },
                        "required": [
                          "shape",
                          "dates",
                          "values"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "label",
                  "credential",
                  "request",
                  "rows"
                ],
                "additionalProperties": false
              }
            },
            "stacks": {
              "default": [],
              "maxItems": 10,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "static",
                  "nextjs",
                  "vite-react",
                  "astro",
                  "expo",
                  "node-api",
                  "django",
                  "fastapi",
                  "rails",
                  "go"
                ]
              }
            },
            "keywords": {
              "default": [],
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              }
            },
            "requires": {
              "type": "object",
              "properties": {
                "ramu": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d+\\.\\d+(-[\\w.]+)?$"
                }
              },
              "required": [
                "ramu"
              ],
              "additionalProperties": false
            },
            "companion": {
              "type": "string",
              "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": {}
    },
    "$schema": {
      "type": "string"
    }
  },
  "required": [
    "name"
  ],
  "$id": "https://getramu.dev/schema/plugin.json",
  "title": "Ramu plugin manifest"
}
