PluginProbe
Extendify / trunk
Extendify vtrunk
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
← All changes | app/Agent/AbilitiesDiscovery.php +6 -1 3.1.4 → trunk View file →
@@ -67,13 +67,18 @@
67 67 foreach ($allowed as $ability) {
68 68 $meta = $ability->get_meta();
69 69 $name = $ability->get_name();
70 70 $label = $ability->get_label();
71 + $schema = $ability->get_input_schema();
72 + // Filters out unnecessary context
73 + if (function_exists('wp_prepare_json_schema_for_client')) {
74 + $schema = wp_prepare_json_schema_for_client($schema);
75 + }
71 76 $byCategory[$ability->get_category()][] = [
72 77 'name' => $name,
73 78 'label' => $glossary[$label] ?? $label,
74 79 'description' => $ability->get_description(),
75 - 'inputSchema' => $ability->get_input_schema(),
80 + 'inputSchema' => $schema,
76 81 'annotations' => $meta['annotations'] ?? null,
77 82 'runHref' => \rest_url('wp-abilities/v1/abilities/' . $name . '/run'),
78 83 ];
79 84 }