# Copyright (c) 2025 Alibaba Group and its affiliates

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from sec_code_bench.editor.cli import CliEditor


class QwenEditor(CliEditor):
    """Qwen CLI editor implementation for code generation."""

    def _get_prompt_args(self) -> str:
        """
        Get the prompt arguments for the Qwen CLI command.

        Returns:
            Prompt argument flag as string
        """
        return "-p"

    def _get_binary_name(self) -> str:
        """
        Get the name of the Qwen binary.

        Returns:
            Binary name as string
        """
        return "qwen"

    def get_editor(self) -> str:
        """
        Get the editor name.

        Returns:
            Editor name as string
        """
        return "qwen-code"

    def get_type(self) -> str:
        """
        Get the editor type.

        Returns:
            Editor type as string
        """
        return "cli"

    def _get_extends_args(self) -> list[str]:
        """
        Get the extended arguments for the Qwen CLI command.

        Returns:
            Extended arguments as list of strings
        """
        return ["--yolo"]
