diff --git a/CHANGELOG.md b/CHANGELOG.md index ee4b868..c328b00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to Waygate will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.5.0] - 2026-05-24 + +### Added +- AI reasoning and selected pattern slugs are now persisted as post meta (`_waygate_reasoning`, `_waygate_patterns`, `_waygate_generated_at`) on every Waygate-generated page +- "Waygate" meta box on the page editor sidebar — always shows the AI reasoning sentence; shows generation timestamp and ordered pattern slug list when `WP_ENV=development` +- Success notice in Tools → Waygate now shows the ordered pattern slugs when `WP_ENV=development` + +### Documentation +- `README.md` updated with AI reasoning and developer debug info features; version badge bumped to 0.5.0 + ## [0.4.0] - 2026-05-24 ### Added diff --git a/README.md b/README.md index 7258f30..6036c76 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Waygate lets you assemble WordPress pages from block patterns — manually or via a natural-language AI prompt powered by the WordPress AI Client (WordPress 7.0+). Works with any block theme; [Elayne](https://github.com/imagewize/elayne) is the primary supported theme. -> **Beta** — v0.4.0. Use on staging/development sites; not yet recommended for production. +> **Beta** — v0.5.0. Use on staging/development sites; not yet recommended for production. --- @@ -12,6 +12,8 @@ Waygate lets you assemble WordPress pages from block patterns — manually or vi - **Pattern catalog** — Browse registered block patterns with slug, title, and categories; filter by category - **AI page generation** — Describe the page you want; the AI picks patterns and creates a draft +- **AI reasoning** — The AI's one-sentence explanation of its pattern choices is shown after generation and persisted as post meta on the created page +- **Developer debug info** — When `WP_ENV=development`, the page editor sidebar and the generation notice also show the ordered pattern slugs and generation timestamp - **Feature detection** — AI form is hidden automatically when no provider supports text generation - **Abilities API** — Exposes `elayne/list-patterns` and `elayne/create-page` abilities for WP 7.0+ - **Multi-provider** — Works with Mistral, Claude, OpenAI, or Gemini via WP AI Client diff --git a/includes/class-admin.php b/includes/class-admin.php index c0cc437..5a1f82e 100644 --- a/includes/class-admin.php +++ b/includes/class-admin.php @@ -8,6 +8,7 @@ class Admin { public static function init(): void { add_action( 'admin_menu', [ self::class, 'register_menu' ] ); + add_action( 'add_meta_boxes', [ self::class, 'register_meta_box' ] ); } public static function register_menu(): void { @@ -230,6 +231,10 @@ private static function status_notices( bool $ai_available, bool $text_gen_suppo
Error: ' . esc_html( $result['error'] ) . '
'; @@ -245,6 +250,11 @@ private static function result_notice( array $result ): void {AI reasoning:
+ ++ Patterns (dev): +
+Edit page @@ -253,4 +263,45 @@ private static function result_notice( array $result ): void { ID, '_waygate_reasoning', true ); + + if ( ! $reasoning ) { + echo '
Not generated by Waygate.
'; + return; + } + + echo 'AI reasoning
' . esc_html( $reasoning ) . '
Generated: ' . esc_html( $generated_at ) . '
'; + } + + if ( $patterns ) { + echo 'Patterns
'; + echo '' . esc_html( $slug ) . '