Add interface abstractions for SchemaGenerator and Discoverer with DI improvements (#215)
* schema generator injection * add interface for schema generator * improve discoverer dependency * remove some comments * make some classes final * simplify condition * code review * Extend changelog for covering interfaces * Adopt SchemaGeneratorInterface after rebase and #153 --------- Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
This commit is contained in:
parent
1de4ea933f
commit
7cb29125bd
1 changed files with 167 additions and 27 deletions
31
src/Capability/Discovery/DiscovererInterface.php
Normal file
31
src/Capability/Discovery/DiscovererInterface.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the official PHP MCP SDK.
|
||||
*
|
||||
* A collaboration between Symfony and the PHP Foundation.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Mcp\Capability\Discovery;
|
||||
|
||||
/**
|
||||
* Discovers MCP elements (tools, resources, prompts, resource templates) in directories.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @author Antoine Bluchet <soyuka@gmail.com>
|
||||
*/
|
||||
interface DiscovererInterface
|
||||
{
|
||||
/**
|
||||
* Discover MCP elements in the specified directories and return the discovery state.
|
||||
*
|
||||
* @param string $basePath the base path for resolving directories
|
||||
* @param array<string> $directories list of directories (relative to base path) to scan
|
||||
* @param array<string> $excludeDirs list of directories (relative to base path) to exclude from the scan
|
||||
*/
|
||||
public function discover(string $basePath, array $directories, array $excludeDirs = []): DiscoveryState;
|
||||
}
|
||||
Loading…
Reference in a new issue