{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "title": "Supabase",
  "description": "Integration with Supabase backend-as-a-service platform enabling database operations and Edge Function invocations",
  "x-icon": "/skills/supabase/supabase.svg",
  "x-tags": [
    "Infrastructure"
  ],
  "properties": {
    "enabled": {
      "type": "boolean",
      "title": "Enabled",
      "description": "Whether this skill is enabled",
      "default": false
    },
    "states": {
      "type": "object",
      "properties": {
        "fetch_data": {
          "type": "string",
          "title": "Fetch Data",
          "enum": [
            "disabled",
            "public",
            "private"
          ],
          "x-enum-title": [
            "Disabled",
            "Agent Owner + All Users",
            "Agent Owner Only"
          ],
          "description": "Fetch data from Supabase tables with filtering, ordering, and pagination support",
          "default": "disabled"
        },
        "insert_data": {
          "type": "string",
          "title": "Insert Data",
          "enum": [
            "disabled",
            "public",
            "private"
          ],
          "x-enum-title": [
            "Disabled",
            "Agent Owner + All Users",
            "Agent Owner Only"
          ],
          "description": "Insert new records into Supabase tables",
          "default": "disabled"
        },
        "update_data": {
          "type": "string",
          "title": "Update Data",
          "enum": [
            "disabled",
            "public",
            "private"
          ],
          "x-enum-title": [
            "Disabled",
            "Agent Owner + All Users",
            "Agent Owner Only"
          ],
          "description": "Update existing records in Supabase tables based on filter conditions",
          "default": "disabled"
        },
        "upsert_data": {
          "type": "string",
          "title": "Upsert Data",
          "enum": [
            "disabled",
            "public",
            "private"
          ],
          "x-enum-title": [
            "Disabled",
            "Agent Owner + All Users",
            "Agent Owner Only"
          ],
          "description": "Insert or update records in Supabase tables based on conflict resolution",
          "default": "disabled"
        },
        "delete_data": {
          "type": "string",
          "title": "Delete Data",
          "enum": [
            "disabled",
            "public",
            "private"
          ],
          "x-enum-title": [
            "Disabled",
            "Agent Owner + All Users",
            "Agent Owner Only"
          ],
          "description": "Delete records from Supabase tables based on filter conditions",
          "default": "disabled"
        },
        "invoke_function": {
          "type": "string",
          "title": "Invoke Edge Function",
          "enum": [
            "disabled",
            "public",
            "private"
          ],
          "x-enum-title": [
            "Disabled",
            "Agent Owner + All Users",
            "Agent Owner Only"
          ],
          "description": "Invoke Supabase Edge Functions with optional parameters and headers",
          "default": "disabled"
        }
      },
      "description": "States for each Supabase skill"
    },
    "supabase_url": {
      "type": "string",
      "title": "Supabase URL",
      "description": "Your Supabase project URL (e.g., https://your-project.supabase.co). You can find it in Project Settings -> Data API",
      "x-link": "[Create Your DB](https://supabase.com/)",
      "format": "uri"
    },
    "supabase_key": {
      "type": "string",
      "title": "Supabase API Key",
      "description": "Your Supabase project's API key. You can find it in Project Settings -> API Keys",
      "x-sensitive": true,
      "format": "password"
    },
    "public_key": {
      "type": "string",
      "title": "Public API Key",
      "description": "You can add a key with more restrictive permissions for public skills. If not provided, supabase_key will be used.",
      "x-sensitive": true,
      "format": "password"
    },
    "public_write_tables": {
      "type": "string",
      "title": "Public Write Tables",
      "description": "Add tables separated by commas. When insert, update, upsert, or delete operations are enabled for public use, only tables from this list can be used. This list does not restrict the skills executed by the owner or in autonomous chat. You can use either this option or public_key to secure your public access."
    }
  },
  "required": [
    "states",
    "enabled"
  ],
  "if": {
    "properties": {
      "enabled": {
        "const": true
      }
    }
  },
  "then": {
    "required": [
      "supabase_url",
      "supabase_key"
    ]
  }
}
