<?php

namespace AtlasAiDev\Awfah\Integrations;

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

// Never parse while the official AI plugin is inactive (see Wpai_Excerpt_Feature).
if ( ! class_exists( '\WordPress\AI\Abstracts\Abstract_Feature' ) ) {
    return;
}

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

/**
 * Our feature-image generation experiment as an official AI plugin Feature (AI-10).
 * Registration-only: UI and backend stay in Editor_Experiments / abilities.
 */
class Wpai_Image_Feature extends Abstract_Feature {

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

    protected function load_metadata(): array {
        return [
            'label'       => 'AtlasAI: ' . __( 'Feature Image Generation', 'ai-workflow-automation-ai-agent-hub' ),
            'description' => sprintf(
                /* translators: %s: plugin brand name (do not translate) */
                __( 'AI featured images by %s — style presets, progress steps, generation history with thumbnails, and per-request provider choice in the featured image panel.', 'ai-workflow-automation-ai-agent-hub' ),
                'AtlasAI Connector'
            ),
            'category'    => Experiment_Category::EDITOR,
        ];
    }

    public function register(): void {
        Wpai_Bridge::mark_enabled( 'image-generation' );
    }
}
