Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions inc/Abilities/AgentPingAbilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use DataMachine\Abilities\PermissionHelper;

use DataMachine\Abilities\AgentPing\SendPingAbility;
use DataMachine\Abilities\Traits\HasCheckPermission;

defined( 'ABSPATH' ) || exit;

Expand All @@ -23,6 +24,7 @@ class AgentPingAbilities {
private SendPingAbility $send_ping;

public function __construct() {
add_action('wp_abilities_api_init', array( $this, 'abilities_api_init' ));
if ( ! class_exists( 'WP_Ability' ) || self::$registered ) {
return;
}
Expand Down
11 changes: 6 additions & 5 deletions inc/Abilities/AgentTokenAbilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use DataMachine\Core\Database\Agents\Agents;
use DataMachine\Core\Database\Agents\AgentTokens;
use DataMachine\Abilities\PermissionHelper;

defined( 'ABSPATH' ) || exit;

Expand Down Expand Up @@ -234,11 +235,11 @@ public function executeCreateToken( array $input ): array {
'info',
'Agent token created',
array(
'agent_id' => $agent_id,
'agent_slug' => $agent['agent_slug'],
'token_id' => $result['token_id'],
'label' => $label,
'has_expiry' => null !== $expires_at,
'agent_id' => $agent_id,
'agent_slug' => $agent['agent_slug'],
'token_id' => $result['token_id'],
'label' => $label,
'has_expiry' => null !== $expires_at,
'has_cap_restriction' => null !== $capabilities,
)
);
Expand Down
2 changes: 2 additions & 0 deletions inc/Abilities/Analytics/BingWebmasterAbilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

use DataMachine\Abilities\PermissionHelper;
use DataMachine\Core\HttpClient;
use DataMachine\Abilities\Analytics\Traits\HasGetConfig;
use DataMachine\Abilities\Media\ImageGenerationAbilities;

defined( 'ABSPATH' ) || exit;

Expand Down
1 change: 1 addition & 0 deletions inc/Abilities/Analytics/GoogleAnalyticsAbilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

use DataMachine\Abilities\PermissionHelper;
use DataMachine\Core\HttpClient;
use DataMachine\Abilities\Analytics\Traits\HasGetConfig;

defined( 'ABSPATH' ) || exit;

Expand Down
2 changes: 2 additions & 0 deletions inc/Abilities/Analytics/GoogleSearchConsoleAbilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

use DataMachine\Abilities\PermissionHelper;
use DataMachine\Core\HttpClient;
use DataMachine\Abilities\Analytics\GoogleAnalyticsAbilities;
use DataMachine\Abilities\Analytics\Traits\HasGetConfig;

defined( 'ABSPATH' ) || exit;

Expand Down
2 changes: 2 additions & 0 deletions inc/Abilities/Analytics/PageSpeedAbilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

use DataMachine\Abilities\PermissionHelper;
use DataMachine\Core\HttpClient;
use DataMachine\Abilities\Analytics\Traits\HasGetConfig;
use DataMachine\Engine\AI\Tools\Global\Traits\HasIsConfigured;

defined( 'ABSPATH' ) || exit;

Expand Down
2 changes: 2 additions & 0 deletions inc/Abilities/AuthAbilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
namespace DataMachine\Abilities;

use DataMachine\Abilities\PermissionHelper;
use DataMachine\Abilities\Traits\HasCheckPermission;
use DataMachine\Core\NetworkSettings;

defined( 'ABSPATH' ) || exit;

Expand Down
1 change: 1 addition & 0 deletions inc/Abilities/ChatAbilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ChatAbilities {
private CreateChatSessionAbility $create_session;

public function __construct() {
add_action('wp_abilities_api_init', array( $this, 'abilities_api_init' ));
if ( ! class_exists( 'WP_Ability' ) || self::$registered ) {
return;
}
Expand Down
56 changes: 28 additions & 28 deletions inc/Abilities/Content/EditPostBlocksAbility.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,32 @@ private function registerAbility(): void {
'type' => 'integer',
'description' => __( 'Post ID to edit', 'data-machine' ),
),
'edits' => array(
'type' => 'array',
'description' => __( 'Array of edit operations', 'data-machine' ),
'items' => array(
'type' => 'object',
'required' => array( 'block_index', 'find', 'replace' ),
'properties' => array(
'block_index' => array(
'type' => 'integer',
'description' => __( 'Zero-based block index to edit', 'data-machine' ),
),
'find' => array(
'type' => 'string',
'description' => __( 'Text to find within the block', 'data-machine' ),
),
'replace' => array(
'type' => 'string',
'description' => __( 'Replacement text', 'data-machine' ),
'edits' => array(
'type' => 'array',
'description' => __( 'Array of edit operations', 'data-machine' ),
'items' => array(
'type' => 'object',
'required' => array( 'block_index', 'find', 'replace' ),
'properties' => array(
'block_index' => array(
'type' => 'integer',
'description' => __( 'Zero-based block index to edit', 'data-machine' ),
),
'find' => array(
'type' => 'string',
'description' => __( 'Text to find within the block', 'data-machine' ),
),
'replace' => array(
'type' => 'string',
'description' => __( 'Replacement text', 'data-machine' ),
),
),
),
),
),
'preview' => array(
'type' => 'boolean',
'description' => __( 'When true, return diff preview without applying changes', 'data-machine' ),
),
'preview' => array(
'type' => 'boolean',
'description' => __( 'When true, return diff preview without applying changes', 'data-machine' ),
),
),
),
'output_schema' => array(
Expand Down Expand Up @@ -301,11 +301,11 @@ function ( $content ) use ( $find, $replace ) {
) );

return array(
'success' => true,
'preview' => true,
'post_id' => $post_id,
'diff_id' => $diff_id,
'diff' => array(
'success' => true,
'preview' => true,
'post_id' => $post_id,
'diff_id' => $diff_id,
'diff' => array(
'diffId' => $diff_id,
'diffType' => 'edit',
'originalContent' => implode( "\n", array_column( $diffs, 'originalContent' ) ),
Expand Down
46 changes: 23 additions & 23 deletions inc/Abilities/Content/ReplacePostBlocksAbility.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,27 @@ private function registerAbility(): void {
'description' => __( 'Post ID to edit', 'data-machine' ),
),
'replacements' => array(
'type' => 'array',
'description' => __( 'Array of block replacement operations', 'data-machine' ),
'items' => array(
'type' => 'object',
'required' => array( 'block_index', 'new_content' ),
'properties' => array(
'block_index' => array(
'type' => 'integer',
'description' => __( 'Zero-based block index to replace', 'data-machine' ),
),
'new_content' => array(
'type' => 'string',
'description' => __( 'New innerHTML for the block', 'data-machine' ),
'type' => 'array',
'description' => __( 'Array of block replacement operations', 'data-machine' ),
'items' => array(
'type' => 'object',
'required' => array( 'block_index', 'new_content' ),
'properties' => array(
'block_index' => array(
'type' => 'integer',
'description' => __( 'Zero-based block index to replace', 'data-machine' ),
),
'new_content' => array(
'type' => 'string',
'description' => __( 'New innerHTML for the block', 'data-machine' ),
),
),
),
),
),
'preview' => array(
'type' => 'boolean',
'description' => __( 'When true, return diff preview without applying changes', 'data-machine' ),
),
'preview' => array(
'type' => 'boolean',
'description' => __( 'When true, return diff preview without applying changes', 'data-machine' ),
),
),
),
'output_schema' => array(
Expand Down Expand Up @@ -288,11 +288,11 @@ public static function execute( array $input ): array {
}, $changes );

return array(
'success' => true,
'preview' => true,
'post_id' => $post_id,
'diff_id' => $diff_id,
'diff' => array(
'success' => true,
'preview' => true,
'post_id' => $post_id,
'diff_id' => $diff_id,
'diff' => array(
'diffId' => $diff_id,
'diffType' => 'replace',
'originalContent' => implode( "\n", array_column( $diffs, 'originalContent' ) ),
Expand Down
Loading
Loading