register_hooks(); } } } /** * What the plugin wires (strings = static register_hooks(), objects = instance). * * Engine: abilities, changesets (engine + background jobs), store map/summary, chat image uploads. Chat: REST (addsynapse-assistant/v1, * logged-in users with the capability + REST nonce). wp-admin: the shared AddSynapse menu/Overview, AddSynapse → Store Assistant (chat + Settings). * * There is NO job channel: the AI answers with the manager's own key, every tool call * is made by the wp-admin chat request of a logged-in user, as that user, and every change is applied by a * logged-in user in wp-admin. * * @param bool $admin wp-admin request. * @return array */ public static function components( bool $admin ): array { $list = array( new AbilitiesRegistrar(), StoreMap::class, StoreSummary::class, ChangesetService::class, ImageUploads::class, new RestRoutes(), // Toolbar link to the chat (wp-admin and front end, users with the capability). AdminBarLink::class, // AI apps through AddSynapse: scoped application password + remote routes (inactive until the owner approves). \Addsynapse\StoreAssistant\Remote\RemoteAccess::class, // Optional anonymous usage info (off by default; the weekly WP-Cron call runs only after «Allow»). new Usage(), ); if ( $admin ) { // Shared «AddSynapse» top-level menu (docs/ADMIN-MENU.md): Home (welcome wizard / status), Chat, Settings. $list[] = AddsynapseMenu::class; // WordPress «Authorize Application» → back here → the password handed to AddSynapse server-to-server, never in a URL to it. $list[] = \Addsynapse\StoreAssistant\Remote\RelayClaim::class; // AddSynapse → Approvals: drafts AddSynapse may not apply by itself (a coupon above 50 % off), approved by an administrator. $list[] = \Addsynapse\StoreAssistant\Remote\AdminApprovals::class; $list[] = new \Addsynapse\StoreAssistant\Admin\HomePage(); $list[] = new AdminPage(); $list[] = new SettingsPage(); // Settings → «Your own AI key»: save + test, remove. $list[] = new OwnKeySection(); // Optional AddSynapse account (opt-in card) and short announcements — the plugin's own screens only. $list[] = new OptIn(); $list[] = new Announcements(); // Links to the separate Store Assistant Pro add-on (Home, Plugins row) and the one-time review request. $list[] = new ProOffers(); $list[] = new ReviewRequest(); } return $list; } }