<?php
/** Read the verified ASE Free generator-tag state. */

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

function wpagent_ability_get_ase_free_generator_tag(): array {
	return array(
		'label'               => __( 'ASE-Free-Generatormarkierung lesen', 'wp-agent-companion' ),
		'description'         => __( 'Liest den eng geprüften ASE-Free-Schalter zum Entfernen der WordPress-Generator-Meta-Markierung samt Konflikthash.', 'wp-agent-companion' ),
		'category'            => 'wp-agent',
		'input_schema'        => array( 'type' => 'object', 'properties' => array(), 'additionalProperties' => false ),
		'output_schema'       => wpagent_ase_free_generator_output_schema(),
		'execute_callback'    => 'wpagent_exec_get_ase_free_generator_tag',
		'permission_callback' => 'wpagent_perm_manage_options',
		'meta'                => array( 'show_in_rest' => true, 'annotations' => array( 'readonly' => true, 'destructive' => false, 'idempotent' => true ) ),
	);
}

/** @return array<string,mixed>|WP_Error */
function wpagent_exec_get_ase_free_generator_tag() {
	$ready = wpagent_ase_free_generator_require_runtime();
	if ( is_wp_error( $ready ) ) {
		return $ready;
	}
	$snapshot = wpagent_ase_free_generator_snapshot();
	if ( is_wp_error( $snapshot ) ) {
		return $snapshot;
	}
	return wpagent_ase_free_generator_output( $snapshot );
}
