mirror of
https://github.com/Heretek-AI/heretek-control-core.git
synced 2026-10-12 02:03:55 +00:00
Sweeps shipped copy clean of em dashes: readme.txt, README.md, CHANGELOG.md, the bundled sample prompts, and user-facing PHP strings (tool descriptions, admin labels). PHP was swept on non-comment lines only, so developer docblocks and inline comments are untouched. Internal dev docs (CLAUDE.md, docs/) were deliberately left alone. Replacements are contextual: colons for label/definition patterns, commas for asides, en dashes for numeric ranges. The .mcpb bundle display_name now reads "EMCP Tools - <host>" with a plain hyphen; its test is updated to match. Fixing CHANGELOG.md also clears the em dashes from the website's generated changelog on the next site build, since that file is its source. Verified: php -l clean on every touched file, pro suite 1559 pass, public suite 102 pass. Bumps the pro submodule for the Pro-side sweep.
79 lines
2.5 KiB
PHP
79 lines
2.5 KiB
PHP
<?php
|
|
/**
|
|
* Agent Skills as a module.
|
|
*
|
|
* Controls the *runtime* exposure of the bundled skills to connected AI agents:
|
|
* the `list-skills` / `get-skill` MCP tools and the `## Skills` catalog injected
|
|
* into the discovery context. Turning it off removes both (and their ~900-token
|
|
* footprint) without touching the local-install path on the Skills tab.
|
|
*
|
|
* Pro tier, on by default. Metadata only — the gating is read statically:
|
|
* - the ability registrar checks is_enabled() before registering the tools,
|
|
* - EMCP_Tools_Skill_Catalog::discovery_catalog() checks it before injecting.
|
|
* So this class carries no Pro logic and lives safely in the free tree, like
|
|
* EMCP_Tools_Templates_Module.
|
|
*
|
|
* @package EMCP_Tools
|
|
* @since 3.2.0
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* Agent Skills module.
|
|
*
|
|
* @since 3.2.0
|
|
*/
|
|
class EMCP_Tools_Agent_Skills_Module extends EMCP_Tools_Module {
|
|
|
|
public function id(): string {
|
|
return 'agent-skills';
|
|
}
|
|
|
|
public function title(): string {
|
|
return __( 'Agent Skills', 'emcp-tools' );
|
|
}
|
|
|
|
public function description(): string {
|
|
return __( 'Expose the bundled skills to connected AI agents at runtime, the list-skills / get-skill tools plus a Skills catalog in the discovery context. Turn off to remove that injection (the Skills download on the Skills tab is unaffected).', 'emcp-tools' );
|
|
}
|
|
|
|
public function tier(): string {
|
|
return 'pro';
|
|
}
|
|
|
|
public function default_active(): bool {
|
|
return true;
|
|
}
|
|
|
|
/** Requires an active Pro license (the skills are Pro content). */
|
|
public function is_available(): bool {
|
|
return function_exists( 'emcp_tools_fs' ) && emcp_tools_fs()->can_use_premium_code();
|
|
}
|
|
|
|
/** The Skills tab is where the skills live (download + guides). */
|
|
public function settings_url(): string {
|
|
return admin_url( 'admin.php?page=' . EMCP_Tools_Admin::PAGE_SLUG . '-skills' );
|
|
}
|
|
|
|
/** No overlay knobs — the on/off toggle is the whole control. */
|
|
public function render_settings(): void {}
|
|
|
|
/** Nothing to wire on boot — the two consumers gate themselves via is_enabled(). */
|
|
public function register(): void {}
|
|
|
|
/**
|
|
* Whether the module is active (static helper for the ability registrar,
|
|
* which runs on wp_abilities_api_init, before the module's init:5 boot).
|
|
* Reads the active-modules option directly.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public static function is_enabled(): bool {
|
|
$active = (array) get_option( EMCP_Tools_Module::OPTION_ACTIVE, array() );
|
|
return in_array( 'agent-skills', $active, true );
|
|
}
|
|
}
|