{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "ExternalAgentConfigDetectResponse",
  "type": "object",
  "required": [
    "items"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/ExternalAgentConfigMigrationItem"
      }
    }
  },
  "definitions": {
    "ExternalAgentConfigMigrationItem": {
      "type": "object",
      "required": [
        "description",
        "itemType"
      ],
      "properties": {
        "cwd": {
          "description": "Null or empty means home-scoped migration; non-empty means repo-scoped migration.",
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": "string"
        },
        "details": {
          "anyOf": [
            {
              "$ref": "#/definitions/MigrationDetails"
            },
            {
              "type": "null"
            }
          ]
        },
        "itemType": {
          "$ref": "#/definitions/ExternalAgentConfigMigrationItemType"
        }
      }
    },
    "ExternalAgentConfigMigrationItemType": {
      "type": "string",
      "enum": [
        "AGENTS_MD",
        "CONFIG",
        "SKILLS",
        "PLUGINS",
        "MCP_SERVER_CONFIG"
      ]
    },
    "MigrationDetails": {
      "type": "object",
      "required": [
        "plugins"
      ],
      "properties": {
        "plugins": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PluginsMigration"
          }
        }
      }
    },
    "PluginsMigration": {
      "type": "object",
      "required": [
        "marketplaceName",
        "pluginNames"
      ],
      "properties": {
        "marketplaceName": {
          "type": "string"
        },
        "pluginNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}