=== MAIA - Multipurpose AI Assistant ===
Contributors: avram
Donate link: https://paypal.me/avramator
Tags: ai, assistant, abilities, ai-client, agent
Requires at least: 7.0
Requires PHP: 8.2
Tested up to: 7.1
Stable tag: 2.0
License: MIT
License URI: https://opensource.org/licenses/MIT

A free WordPress AI assistant that reads, edits and manages your site — powered by WordPress's own AI Client.

== Description ==

Hello there!

I can read, edit, and manage your site — always with your confirmation. Powered entirely by WordPress's own AI Client, no third-party account required.

I am MAIA, an AI assistant for your WordPress website. A superstar WP developer, a writer, a know-it-all and your partner in WP website management. I know a lot about your site and will be there 24/7 to help you manage it. I can speak any language and can track multiple conversations.

Starting with version 2.0, MAIA runs entirely on **WordPress 7.0's built-in AI Client and Abilities API** — no more third-party account. Connect any supported AI provider (Anthropic, OpenAI, Google, or another connector plugin) under **Settings → Connectors**, and MAIA uses it automatically. MAIA itself never holds an API key.

I can actually *do* things on your site instead of just talking about them:

* Read and search your theme/plugin files, and propose edits — you always see a diff and approve it before anything is written
* Write your posts/pages/product descriptions, and create/update/trash them for you (with your confirmation)
* Manage categories and tags
* Install, activate, deactivate, or delete plugins
* Answer questions about your site by looking things up itself — active theme, installed plugins, users, content — instead of guessing
* Search the web and search for images (optional — requires a Brave Search or Tavily API key in Settings / MAIA)
* Generate images from a text prompt (when your connected AI provider supports it) and save them straight to your media library, then insert them into the post/page you're viewing or set them as the featured image
* Show you any image it has a link to — found on the web, or anywhere else — directly in a card, with the same insert/featured-image actions
* Make HTTP requests to external APIs on your behalf (GET/HEAD run immediately, anything that writes always asks first)
* Remember facts about you across conversations, and recall, search, or forget them on request
* Find an earlier conversation for you by keyword, and jump straight to it
* Contemplate life and the Universe 🙂

Every write operation — editing a file, creating or changing content, managing a term — shows you exactly what's about to happen and waits for you to click Confirm. Nothing is written silently.

Version 2.0 also introduces a new side-panel interface (menu on top, chat below, opens from the right and covers as much of the screen as you like), with avatars in the conversation and full-text search across your past conversations. The classic floating chat window from earlier versions is still available — switch to it any time in Settings / MAIA → Interface.

[Try instantly on tastewp.com](https://tastewp.com/new?pre-installed-plugin-slug=maia-multipurpose-ai-assistant&redirect=%2F&ni=true)!

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` and activate it through the 'Plugins' menu in WordPress
2. Install an AI provider plugin (e.g. "AI Provider for Anthropic", "AI Provider for OpenAI") and add your API key under **Settings → Connectors**
3. Open MAIA (the avatar, bottom right) — it detects your connected provider automatically
4. Optionally visit Settings / MAIA to choose the side-panel or classic interface, pin preferred models, or turn off file editing / write tools entirely
5. Start chatting — the panel's menu lists your past conversations, with a search box and a "New conversation" button at the top

== External services ==

This plugin does not connect to any third-party AI service on its own. Instead, it uses **WordPress's built-in AI Client**, which routes every request to whichever AI provider you've connected under **Settings → Connectors** (e.g. Anthropic, OpenAI, or Google, each provided by its own separate connector plugin). If no provider is connected, MAIA cannot answer anything and will tell you so. Review the terms and privacy policy of whichever provider(s) you connect — MAIA itself has no relationship with them.

Every message you send includes some baseline context so MAIA doesn't have to ask you to repeat yourself:
* your site's name, description, and default language
* your own display name and role(s)
* the title and status of the post/page you're currently editing, if any (not its content)
* the current page URL and the page title you're viewing

Beyond that, MAIA works via abilities: when it needs more information, it calls a specific ability, and *only the result of that call* is sent to your connected AI provider as part of the conversation. Depending on what you ask, that can include:
* the contents of a plugin/theme file
* the content of a post, page, or product
* categories/tags, media library entries
* the list of users on your site, and your list of installed plugins/themes

This only happens when MAIA calls the corresponding ability while answering your request — never automatically on page load.

Writing anything (editing a file, creating/changing/deleting content, managing a term) always shows you a confirmation card first; nothing is written to your site until you click Confirm.

=== Optional: Web search (Brave Search or Tavily) ===
If you enter an API key for Brave Search and/or Tavily in Settings / MAIA, MAIA gains two extra abilities — web search and image search — backed by whichever one you've configured (Settings / MAIA → Web search provider chooses between them when both are set). When (and only when) MAIA calls one of these, your search query is sent from your own server directly to that provider's API using the key you provided, and the results (titles, URLs, descriptions, or image URLs/thumbnails) are returned to MAIA. No query is sent unless MAIA actually uses one of these abilities while answering you. This is entirely optional — leave both keys empty and neither ability is offered at all.

* **Brave Search** (api.search.brave.com) is provided by Brave Software: [terms of use](https://brave.com/search/api/terms-of-use/), [privacy policy](https://brave.com/privacy/browser/#search).
* **Tavily** (api.tavily.com) is provided by Tavily AI: [terms of service](https://www.tavily.com/terms), [privacy policy](https://www.tavily.com/privacy).

=== HTTP requests to external services ===
If enabled (on by default, Settings / MAIA), MAIA can make an HTTP request to any URL you or it specifies, e.g. to call a third-party API. This runs from your own server. Requests to internal/private network addresses are always blocked. GET/HEAD requests run without confirmation; any request that writes (POST/PUT/PATCH/DELETE) always shows you the exact method, URL, headers and body first. This can be turned off entirely in Settings / MAIA.

=== Image generation ===
Asking MAIA to generate an image sends your text prompt to your connected AI provider (whichever one you've configured under Settings → Connectors, if it supports image generation) from your own server. The resulting image is saved directly to your media library and shown to you in a card — MAIA itself never sees the image data — with buttons to insert it into the post/page you're viewing or set it as the featured image.

=== Showing images ===
When MAIA has a link to an image (e.g. found via web search) and shows it to you, your own browser loads it directly from wherever it's hosted, the same as clicking the link yourself would. It's shown in a card with save/insert/featured-image buttons; nothing is saved anywhere until you click one of them.

=== Important notes ===
- Each connected AI provider has its own account, pricing and limits — set up under Settings → Connectors, shared by MAIA and any other plugin that uses the WordPress AI Client.
- The abilities themselves (reading/editing files, managing content) run through your own WordPress installation using your own account's permissions — nothing is sent to a third party except what's described above.
- Your conversations and anything MAIA remembers about you (Settings / MAIA → Memory) are stored in your own site's database, private to your account — not sent anywhere else except as part of the messages you actively send while chatting.
- File editing respects the same rules as WordPress' own built-in file editor: it can be disabled entirely with `DISALLOW_FILE_EDIT`, and on a Multisite network only a Super Admin can edit files — a regular site Administrator cannot, even with MAIA.

== Frequently Asked Questions ==

= Do I need a Puter.com account? =

No. As of version 2.0, MAIA no longer uses Puter.com. Connect any AI provider you like under Settings → Connectors instead — see the Installation section above.

= Can it generate images? =

Yes, if your connected AI provider supports image generation (check Settings / MAIA — it tells you). Ask it to generate an image and it's saved to your media library and shown in a card, with buttons to insert it into the post/page you're viewing or set it as the featured image.

= I asked it to find an image (e.g. via web search) — why didn't I see it? =

If it just gives you a link back in text, ask it to show you the image. MAIA can display any image it has a URL for directly in a card, with save/insert/featured-image buttons.

= Does it remember things about me between conversations? =

Yes, if enabled (on by default, Settings / MAIA). MAIA can save short facts about you, recall them, search them, or forget them — all private to your own account, stored on your own site. You can ask it what it remembers at any time, and turn the whole feature off in Settings / MAIA.

= Can I find an old conversation? =

Yes — use the search box at the top of the panel's menu, which searches both titles and message content. If you can't find it that way, click "Search with agent" below the results: MAIA opens a new conversation and looks for it for you, then gives you clickable links straight to any matches.

= Can it call external APIs? =

Yes, if enabled (on by default, Settings / MAIA). It can make GET/HEAD requests without asking first, and any request that would write data (POST/PUT/PATCH/DELETE) always shows you the exact method, URL, headers and body before it runs. Requests to your own internal network are always blocked regardless of this setting.

= Can it edit website content? =

Yes — it can create, update, and delete posts, pages, and other content types (including WooCommerce products), always with your explicit confirmation first. You can also turn this off entirely in Settings / MAIA.

= Can it edit website or theme files? =

Yes, within the same rules as WordPress' own file editor — it can only touch files WordPress itself considers editable, every change requires your confirmation with a full diff, and if the edit introduces a fatal PHP error it is automatically detected and rolled back before it can break your site. This can also be turned off in Settings / MAIA, and it's unavailable if `DISALLOW_FILE_EDIT` is set or (on Multisite) you're not a Super Admin.

= Is it safe to let an AI write to my site? =

Every write action requires you to click Confirm on a card that shows exactly what will change — the raw diff or the raw arguments, never a summary written by the AI itself. Nothing happens automatically. That said, ability results (file contents, post content, etc.) are treated as data by MAIA, but no safeguard is perfect — review what you're confirming, especially on a site where other people can create content.

= Can it install or manage plugins? =

Yes — it can list installed plugins and install, activate, deactivate, or delete them, always with your confirmation first. This uses WordPress' own plugin REST endpoint, so it's subject to the same Administrator-only capability checks as the "Add Plugin" screen in wp-admin.

= What is "Full REST API access"? =

An optional, off-by-default setting (Settings / MAIA) that lets MAIA discover and call any REST route registered on your site — not just the specific ones its dedicated abilities use. It's restricted to Administrators, and every call (even a read) still requires your confirmation showing the exact method, route and parameters before it runs. Leave it off unless you have a specific need for it; MAIA's dedicated abilities already cover typical requests.

= Can I restrict who is allowed to use MAIA, or what it can do? =

Yes. Settings / MAIA lets you require a minimum WordPress capability before MAIA offers any abilities at all, and lets you turn file abilities and/or write abilities off completely, site-wide.

= Why is MAIA not responding? =

Check Settings → Connectors — MAIA needs at least one AI provider connected with a valid API key. If one is connected, check that provider's own usage/billing dashboard for limits or outages.

= Does this work with WooCommerce? =

MAIA can list, read, and write product titles/descriptions/status, and manage product categories and tags, the same way it does for posts and pages. Price and inventory management (WooCommerce-specific fields) are not yet supported.

= I'm a developer — how do I add my own ability for MAIA to use? =

Register a normal [WordPress Ability](https://developer.wordpress.org/reference/functions/wp_register_ability/) on the `wp_abilities_api_init` action, then add its name to MAIA's allow-list with the `maia_agent_abilities` filter:

`add_filter( 'maia_agent_abilities', function ( array $names, int $user_id ) {
    $names[] = 'my-plugin/my-ability';
    return $names;
}, 10, 2 );`

This replaces the `maia_tools` filter from versions before 2.0.

== Screenshots ==

1. MAIA's side panel — conversation search, list, and chat
2. Classic floating chat window (Settings / MAIA → Interface: Legacy)
3. Settings / MAIA

== Changelog ==

= 2.0 =
* New: `maia/ask-user` — MAIA can now ask you a multiple-choice question directly in the chat (radio buttons for one answer, checkboxes for several, plus an "Other" field for anything not listed) instead of only asking as plain text.
* New: Tavily is now a supported web/image search provider alongside Brave Search (Settings / MAIA → Web search provider) — a genuinely free option now that Brave Search API moved to metered billing for new accounts.
* New: automatic tool-result formatting for OpenAI-compatible providers (Ollama, local models), which expect a different message shape than Anthropic — Settings / MAIA → Tool result format auto-detects the right one, with manual override if needed.
* Major rewrite: MAIA no longer uses Puter.com. It now runs entirely on WordPress 7.0's built-in AI Client and Abilities API — connect any supported provider under Settings → Connectors and MAIA uses it automatically.
* All 32 tools rewritten as WordPress Abilities (`maia/*`), registered through the standard Abilities API so other AI plugins can see and reuse them.
* New: a side-panel interface (Settings / MAIA → Interface: Modern, the new default) — opens from the right, menu on top (search, "New conversation", your conversation list) with the chat underneath, and covers as much of the screen as you set in Settings / MAIA.
* New: avatars in the conversation — MAIA's own for its replies, yours for your messages.
* New: full-text search across your conversation history, plus a "Search with agent" option that has MAIA look for a match itself and hand you clickable links.
* New: deep links to a specific conversation (shareable/bookmarkable).
* New: model selection is Automatic by default (WordPress picks a suitable model from your connected provider); optionally pin preferred models in Settings / MAIA.
* Changed: the classic floating chat window from earlier versions is now an opt-in "Legacy" interface (Settings / MAIA → Interface), running on the same new backend.
* Changed: image generation now saves directly to your media library and only exists as an ability when your connected provider actually supports it.
* Removed: the `maia_tools` filter (replaced by `maia_agent_abilities` — see the FAQ for developers).
* Requires WordPress 7.0 (up from 6.0) for the AI Client and Abilities API.

= 1.1.1 =
* Fixed: Markdown in MAIA's replies is now formatted consistently inside the chat window — headings no longer render oversized, and lists, tables, blockquotes, links and inline code follow the chat's own typography.
* Fixed: the plugin no longer applied its own `h1` and `body` styles to the rest of the page (leftover demo CSS from the chat-bubble component).

= 1.1 =
* New: HTTP client tool — MAIA can call external APIs (GET/HEAD run immediately, writes always ask first; requests to internal/private network addresses are always blocked). On by default, Settings / MAIA.
* New: image generation — ask MAIA to generate an image and it's shown directly in a card with buttons to save it to the media library, insert it into the post/page being viewed, or set it as the featured image. Always available; optionally pin a specific model in Settings / MAIA.
* New: image search results (Brave) are now shown as a clickable thumbnail grid with the same save/insert/featured actions, instead of only being described in text.
* New: MAIA can show any image it has a URL for (e.g. found via web search) directly in a card, with the same save/insert/featured actions as a generated image.
* New: memory tools — MAIA can save, recall, search, list, and forget facts about a user across conversations, private per user. On by default, Settings / MAIA.
* Changed: discussion history now lives in your site's database (private per user) instead of only your browser's local storage, so it survives clearing browser data and follows you between browsers. Existing local discussions are imported automatically, once.
* Requires PHP 8.2 (unchanged from 1.0)

= 1.0 =
* Major release: MAIA can now use tools to read and search your site's files and content, and — with your confirmation on every single write — create/edit them too
* File tools: list/find/grep/read files under wp-content, and propose edits that show a diff and go through WordPress' own file editor safeguards (path/extension allowlist, automatic rollback on a PHP fatal)
* Content tools: list/read/create/update/delete posts, pages, and any REST-exposed post type (including WooCommerce products), plus manage categories/tags, list media, and list users — all routed through WordPress' own REST permission checks, so every user's existing capabilities are respected exactly as they are anywhere else in WordPress
* Plugin tools: list installed plugins and install/activate/deactivate/delete them, using the same core REST endpoint (and Administrator-only capability checks) as the built-in "Add Plugin" screen
* Optional "Full REST API access" (off by default, Settings / MAIA): lets MAIA discover and call any other REST route registered on the site — core, WooCommerce, or any other plugin — for the rare request none of MAIA's dedicated tools cover. Restricted to Administrators, and every single call always requires confirmation showing the exact method/route/parameters
* New Settings page (Settings / MAIA): choose the AI model, toggle file tools and write tools on/off, cap tool calls per turn, require a minimum capability before MAIA is offered at all, optionally add a Brave Search API key to unlock web search and image search tools, and optionally enable full REST API access
* The context sent with every message is now much smaller: MAIA used to send your entire site (every user, post, page, plugin and theme) on every single request — now it fetches only what it actually needs, when it needs it
* Requires PHP 8.2 (up from 7.4)

= 0.2 =
* improved code rendering in chat
* added button to code snippets to copy to clipboard

= 0.1 =
* initial release

== Upgrade Notice ==

= 2.0 =
Major rewrite. MAIA no longer uses Puter.com — connect an AI provider under Settings → Connectors after upgrading. The chat moved to a new side panel by default; switch back to the classic floating window in Settings / MAIA → Interface. Requires WordPress 7.0.

= 1.1.1 =
Formatting hotfix for MAIA's replies in the chat window; also stops the plugin from restyling headings elsewhere on the page.

= 1.0 =
Major release: adds file/content tools with confirmation-gated writes, and requires PHP 8.2. Your existing discussions are preserved (old context is dropped from them automatically, since it's no longer needed).
