GravityKit\GravityCalendar\Abilities\Bootstrap
Registers the gravitycalendar product and every ability under it.
The product declaration gives these abilities their MCP tool names in Foundation's catalog:
gk-gravitycalendar/calendar-create reaches an AI client as gc_calendar_create.
No-ops when the Abilities API is absent (WordPress below 6.9, or a Foundation without the component); the rest of the plugin is unaffected.
Adding an ability is dropping one class file into includes/abilities/{Category}/, named after
its class and extending \Ability, then adding its follow-ups to \self::next_steps_map().
Since: TBD
Source: includes/abilities/Bootstrap.php:28
Details
- Kind:
class - Namespace:
GravityKit\GravityCalendar\Abilities
Methods
| Method | Description |
|---|---|
init() | Loads the ability files and hooks the product into Foundation. Called once Foundation is ready. |
load() | Requires the base classes, the helpers and every ability file. |
register_product() | Declares the product: the MCP tool-name prefix, and every category an ability may sit in. |
categories() | The categories this product registers, keyed by slug. |
next_steps_map() | Which ability usually follows which, and when. |
next_steps_for() | One ability's follow-ups, or none. |
register_abilities() | Registers every ability class with Foundation. |
ability_classes() | Every ability class, found by globbing the category directories. |
Method Reference
init()
public static function init(): void
Loads the ability files and hooks the product into Foundation. Called once Foundation is ready.
Returns
void
Since: TBD
Source: includes/abilities/Bootstrap.php:48
load()
public static function load(): void
Requires the base classes, the helpers and every ability file.
The plugin has no autoloader for includes/, so this is what makes the classes exist.
Returns
void
Since: TBD
Source: includes/abilities/Bootstrap.php:83
register_product()
public static function register_product( $products ): array
Declares the product: the MCP tool-name prefix, and every category an ability may sit in.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$products | array | Product declarations, keyed by product slug. |
Returns
array
Since: TBD
Source: includes/abilities/Bootstrap.php:105
categories()
public static function categories(): array
The categories this product registers, keyed by slug.
A scope subcategory's slug must start with gk-gravitycalendar-, or Foundation derives no
gk_scope for the abilities in it.
Returns
array<string,— array{label:string, description:string}>
Since: TBD
Source: includes/abilities/Bootstrap.php:126
next_steps_map()
public static function next_steps_map(): array
Which ability usually follows which, and when.
Sent in each ability's meta.annotations.next_steps, which the MCP client appends to
that tool's description; a step naming an unregistered ability is dropped silently.
Returns
array<string,— array<int, array{ability:string, when:string}>>
Since: TBD
Source: includes/abilities/Bootstrap.php:157
next_steps_for()
public static function next_steps_for( string $ability_name ): array
One ability's follow-ups, or none.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$ability_name | string | Fully-qualified ability name. |
Returns
array<int,— array{ability:string, when:string}>
Since: TBD
Source: includes/abilities/Bootstrap.php:249
register_abilities()
public static function register_abilities( $manager=null ): void
Registers every ability class with Foundation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$manager | mixed | null | Foundation's abilities manager, as the action passes it. |
Returns
void
Since: TBD
Source: includes/abilities/Bootstrap.php:264
ability_classes()
public static function ability_classes(): array
Every ability class, found by globbing the category directories.
A file whose class is not an \Ability subclass named after it is skipped.
Returns
string[]— Fully-qualified class names, sorted by ability name.
Since: TBD
Source: includes/abilities/Bootstrap.php:285