fix: wire AdminActions into boot
This commit is contained in:
@@ -4,9 +4,6 @@ namespace AskTamMCP\Core;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
/**
|
||||
* Main plugin bootstrap. Singleton.
|
||||
*/
|
||||
final class Plugin {
|
||||
|
||||
private static ?self $instance = null;
|
||||
@@ -21,24 +18,20 @@ final class Plugin {
|
||||
private function __construct() {}
|
||||
|
||||
public function boot(): void {
|
||||
// Load text domain
|
||||
load_plugin_textdomain('advanced-mcp-plugin', false, dirname(plugin_basename(ASKTAM_MCP_FILE)) . '/languages');
|
||||
|
||||
// Register REST routes (MCP endpoint + admin API)
|
||||
add_action('rest_api_init', [$this, 'registerRoutes']);
|
||||
|
||||
// Admin UI
|
||||
if (is_admin()) {
|
||||
new AdminMenu();
|
||||
new \AskTamMCP\Admin\AdminActions();
|
||||
}
|
||||
}
|
||||
|
||||
public function registerRoutes(): void {
|
||||
// MCP SSE endpoint — AI clients connect here
|
||||
$mcpServer = new \AskTamMCP\MCP\Server();
|
||||
$mcpServer->registerRoutes();
|
||||
|
||||
// Internal admin REST routes (API key management)
|
||||
$apiKeyController = new \AskTamMCP\Admin\ApiKeyController();
|
||||
$apiKeyController->registerRoutes();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user