<?php

namespace AtlasAiDev\Awfah\Integrations;

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

if ( ! class_exists( '\WordPress\AI\Abstracts\Abstract_Feature' ) ) {
    return;
}

use WordPress\AI\Abstracts\Abstract_Feature;
use WordPress\AI\Experiments\Experiment_Category;

/**
 * Our title-suggestions experiment as an official AI plugin Feature (AI-10).
 */
class Wpai_Title_Feature extends Abstract_Feature {

    public static function get_id(): string {
        return 'awfah-title-generation';
    }

    protected function load_metadata(): array {
        return [
            'label'       => 'AtlasAI: ' . __( 'Title Suggestions', 'ai-workflow-automation-ai-agent-hub' ),
            'description' => sprintf(
                /* translators: %s: plugin brand name (do not translate) */
                __( 'AI title suggestions by %s — five editable candidates with SEO length hints, generation history, and per-request provider choice.', 'ai-workflow-automation-ai-agent-hub' ),
                'AtlasAI Connector'
            ),
            'category'    => Experiment_Category::EDITOR,
        ];
    }

    public function register(): void {
        Wpai_Bridge::mark_enabled( 'suggest-titles' );
    }
}
