PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.10
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.10
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
← All changes | includes/agents/rest.php +15 -3 1.1.51.1.10 View file →
@@ -193,14 +193,22 @@
193 193 'methods' => WP_REST_Server::CREATABLE,
194 194 'permission_callback' => 'openstation_agents_rest_invoke_permission',
195 195 'callback' => 'openstation_agents_rest_invoke',
196 196 'args' => array(
197 - 'message' => array(
197 + 'async' => array(
198 + 'type' => 'boolean',
199 + 'default' => false,
200 + ),
201 + 'requestId' => array(
202 + 'type' => 'string',
203 + 'format' => 'uuid',
204 + ),
205 + 'message' => array(
198 206 'type' => 'string',
199 207 'required' => true,
200 208 'sanitize_callback' => 'sanitize_textarea_field',
201 209 ),
202 - 'source' => array(
210 + 'source' => array(
203 211 'type' => 'string',
204 212 'default' => 'chat',
205 213 'enum' => array( 'chat', 'drag', 'send-to' ),
206 214 'sanitize_callback' => 'sanitize_key',
@@ -208,9 +216,9 @@
208 216 // Prior conversation turns, oldest first. Without these
209 217 // every message is a contextless run — a follow-up like
210 218 // "yes, do it" would be resolved against nothing and the
211 219 // agent could act on the wrong entity entirely.
212 - 'history' => array(
220 + 'history' => array(
213 221 'type' => 'array',
214 222 'default' => array(),
215 223 'items' => array(
216 224 'type' => 'object',
@@ -479,8 +487,12 @@
479 487 'openstation_agents_forbidden',
480 488 __( 'You do not have permission to invoke this agent.', 'desktop-mode' ),
481 489 array( 'status' => rest_authorization_required_code() )
482 490 );
491 + }
492 +
493 + if ( $request['async'] ) {
494 + return openstation_agents_rest_enqueue_job( $request );
483 495 }
484 496
485 497 $result = openstation_agent_invoke(
486 498 (int) $user->ID,