=== Codiecool Action Guard for AI Agents ===
Contributors: codiecool
Tags: ai, mcp, security, audit, approval
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Human-approval queue, audit log, and undo for AI/MCP agent writes on WordPress.

== Description ==

**Codiecool Action Guard for AI Agents** is the governance layer for AI on WordPress.

MCP connectors and AI agents can edit your site. This plugin does not replace them — it sits beside them and makes sure **publish, delete, settings, and role changes** go through a human first when you want them to.

= Features =

* Intercept publish, trash/delete, media delete, watched options, and role changes
* Detect Application Password / Basic-auth REST traffic and watched roles (including `cagai_ai_agent`)
* Per-action modes: Allow / Ask first / Block
* Pending queue with human-readable before/after summary
* Soft-held deletes (redirect + notice — no scary error page)
* Audit log with one-click undo
* First-run setup checklist (plugins screen / plugin pages only)
* Configurable retention (up to 365 days)
* REST API for queue review workflows

Works alongside any MCP or AI plugin. The filter `cagai_is_agent_request` lets connectors mark requests as agent-driven.

== Installation ==

1. Upload the `codiecool-action-guard-ai-agents` folder to `/wp-content/plugins/`
2. Activate **Codiecool Action Guard for AI Agents** through the Plugins menu
3. Follow the welcome checklist (AI Agent user + Application Password)
4. Open **Codiecool Action Guard → Settings** and confirm Publish/Delete are set to **Ask first**

== Frequently Asked Questions ==

= Does this include an MCP server? =

No. This plugin is the approval and audit layer only. Use the official WordPress MCP Adapter or any third-party MCP/AI plugin for connectivity.

= Will it block my normal editing? =

By default, only watched roles and Application Password requests are governed. Draft updates default to Allow. Turn on Paranoid mode only if you want every user watched.

= Who can approve queued actions? =

Administrators (users with `manage_options`).

== Screenshots ==

1. Pending Queue — review AI and watched-role writes before they go live
2. Settings — Allow / Ask first / Block modes for each action family
3. Audit Log — approved actions with one-click undo when available
4. First-run onboarding checklist for AI Agent users

== Changelog ==

= 1.0.3 =
* Fix fatal error on Pending Queue when multiple items were listed (kind mapper variable clash)

= 1.0.2 =
* Unique 5-character prefix (cagai / CAGAI) for defines, options, hooks, caps, tables, and assets
* Namespace moved to Codiecool\ActionGuardAiAgents to avoid collisions

= 1.0.1 =
* Distinctive plugin name and slug for WordPress.org guidelines
* Limit admin notices to dashboard / plugin screens (Guideline 11)
* Text domain and admin menu slugs aligned with the new permalink

= 1.0.0 =
* Initial release
* Approval queue for publish, delete, media, settings, and role changes
* Human-readable before/after summaries
* Soft-held deletes with redirect notices
* Audit log with undo
* Allow / Ask first / Block modes
* Application Password and watched-role detection
* Modern admin UI with confirm dialogs and snackbars

== Upgrade Notice ==

= 1.0.3 =
Fixes a fatal error on the Pending Queue page when more than one item is waiting.

= 1.0.2 =
Prefixes and namespace updated for WordPress.org uniqueness requirements. Re-save settings if you tested an earlier review build.

= 1.0.1 =
Updated plugin name/slug and moderated admin notices for directory compliance.
