<?php
/**
 * Plugin Name:       Answyr
 * Description:       AI-grounded support suite for WordPress products. Drafts replies grounded in your published docs — a human vets every send. Desk (tickets) + Chat (deflection) surfaces over one shared AI core.
 * Version:           1.1.1
 * Requires at least: 6.0
 * Requires PHP:      8.0
 * Author:            Kevon Adonis
 * Author URI:        https://profiles.wordpress.org/kevonadonis/
 * License:           GPL-2.0+
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       answyr
 * Domain Path:       /languages
 *
 * @package Answyr
 */

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

define( 'ANSWYR_VERSION', '1.1.1' );
define( 'ANSWYR_PATH', plugin_dir_path( __FILE__ ) );
define( 'ANSWYR_URL', plugin_dir_url( __FILE__ ) );
define( 'ANSWYR_BASENAME', plugin_basename( __FILE__ ) );

// ── Core ──────────────────────────────────────────────────────────────────────
require_once ANSWYR_PATH . 'inc/core/pro.php';
// Freemius licensing (dormant until inc/core/freemius-config.php provides the IDs).
require_once ANSWYR_PATH . 'inc/core/freemius.php';
require_once ANSWYR_PATH . 'inc/core/uninstall-cleanup.php';
require_once ANSWYR_PATH . 'inc/core/class-crypto.php';
require_once ANSWYR_PATH . 'inc/core/class-settings.php';
require_once ANSWYR_PATH . 'inc/core/class-rate-limiter.php';
require_once ANSWYR_PATH . 'inc/core/class-retrieval.php';
require_once ANSWYR_PATH . 'inc/core/class-knowledge-admin.php';
require_once ANSWYR_PATH . 'inc/core/class-onboarding.php';
require_once ANSWYR_PATH . 'inc/core/class-core-rest.php';

// ── AI subsystem ────────────────────────────────────────────────────────────────
require_once ANSWYR_PATH . 'inc/core/ai/abstract-ai-provider.php';
require_once ANSWYR_PATH . 'inc/core/ai/class-provider-registry.php';
require_once ANSWYR_PATH . 'inc/core/ai/providers/class-anthropic-provider.php';
require_once ANSWYR_PATH . 'inc/core/ai/providers/class-openai-provider.php';
require_once ANSWYR_PATH . 'inc/core/ai/class-ai-client.php';

// ── Module framework ────────────────────────────────────────────────────────────
require_once ANSWYR_PATH . 'inc/core/abstract-module.php';
require_once ANSWYR_PATH . 'inc/core/class-plugin.php';

// ── Bootstrap ────────────────────────────────────────────────────────────────────
add_action(
	'plugins_loaded',
	static function () {
		Answyr_Plugin::instance()->boot();
	}
);

// ── Activation ────────────────────────────────────────────────────────────────────
register_activation_hook( __FILE__, array( 'Answyr_Plugin', 'activate' ) );
