Skip to content

Conversation

@emdashcodes
Copy link
Collaborator

@emdashcodes emdashcodes commented Aug 11, 2025

⚠️ Depends on WordPress/abilities-api#6

Implements client-side integration between the WordPress Abilities API and the WP Feature API, enabling the Feature API client to use Abilities as the backend for server-side features.

Why

The WordPress Abilities API provides a standardized way to register and manage server capabilities now, and is slated for WordPress core inclusion. This integration allows the Feature API client to leverage abilities as its backend, while still allowing client features to be used (until the Abilities API supports client abilities).

How

When enabled via the WP_FEATURE_API_ABILITIES_BACKEND constant or via JS, the Feature API client:

  • Automatically registers the abilities entity with WordPress core-data
  • Switches REST API calls from /wp/v2/features to /wp/v2/abilities
  • Handles the conversion between ability and feature formats on the client side

The integration is purely client-side - plugins can migrate from wp_register_feature() to wp_register_ability() directly.

Testing Steps

  1. Install the Abilities API plugin via Add REST API controllers for Abilities API WordPress/abilities-api#6 and set define( 'WP_FEATURE_API_ABILITIES_BACKEND', true ); in wp-config.php
  2. Activate the Feature API Demo Agent by setting define( 'WP_FEATURE_API_LOAD_DEMO', true ); in wp-config.php
  3. Set your Open AI key at /wp-admin/options-general.php?page=wp-ai-api-proxy-settings
  4. Ask the agent "can you test the site info tool?"
  5. See that ability/demo/site-info is called
  6. Test that client side features still work by asking the agent "What is the current URL?"

Implements a bridge between WordPress.org Abilities API and WP Feature API,
allowing abilities to be automatically registered as features when enabled.
@emdashcodes emdashcodes changed the title Add Abilities API bridge for WP Feature API [WIP] Add Abilities API bridge for WP Feature API Aug 11, 2025
@emdashcodes emdashcodes marked this pull request as draft August 11, 2025 19:08
- Change config from useAbilitiesBackend boolean to backend string ('features' | 'abilities')
- Remove unnecessary wp.data availability checks (it's a dependency)
- Fix demo ability registration with proper JSON schema for OpenAI compatibility
- Remove configure() function - config is read once at module load
- Simplify string comparison for wp_localize_script values
@emdashcodes emdashcodes marked this pull request as ready for review August 13, 2025 03:26
@emdashcodes emdashcodes changed the title [WIP] Add Abilities API bridge for WP Feature API Add Abilities API bridge for WP Feature API Aug 13, 2025
@gziolo
Copy link
Member

gziolo commented Aug 13, 2025

This is great! Once we publish wordpress/abilities-api package, we will be able to land it with the Abilities API as a backend 👌🏻

- Add key: 'name' to abilities entity config for core-data
- Map ability fields correctly to Feature interface
- Fix resolver to handle abilities using name instead of id
@gziolo
Copy link
Member

gziolo commented Aug 18, 2025

We are closer to the finish line to make it happen. The last remaining task is to publish a composer package, which is tracked in:

@gziolo
Copy link
Member

gziolo commented Aug 29, 2025

The initial v0.1.0 release for Abilities API is ready. It should get published on Packagist as wordpress/abilities-api soon.

@gziolo
Copy link
Member

gziolo commented Aug 29, 2025

https://packagist.org/packages/wordpress/abilities-api – it's ready for testing!

@emdashcodes
Copy link
Collaborator Author

Awesome! I'll retest this against the composer version Monday and get this merged 🎉

Copy link
Member

gziolo commented Oct 7, 2025

Should we close this one and archive the project on GitHub redirecting folks to use Abilities API v0.2+?

@gziolo gziolo removed their request for review October 7, 2025 11:14
@emdashcodes
Copy link
Collaborator Author

@gziolo Yes good call. I'll archive this repo a bit later today and update the README.

@emdashcodes emdashcodes closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants