refactor: susun semula struktur folder — Laravel source ke src/

This commit is contained in:
Saufi
2026-05-19 15:58:35 +08:00
parent f052251b94
commit bf53c71b45
10806 changed files with 1385379 additions and 121 deletions

View File

@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace Laravel\Mcp\Server\Contracts;
interface Annotation
{
public function key(): string;
}

View File

@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Laravel\Mcp\Server\Contracts;
use Laravel\Mcp\Server\Completions\CompletionResponse;
interface Completable
{
/**
* @param array<string, mixed> $context
*/
public function complete(string $argument, string $value, array $context): CompletionResponse;
}

View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace Laravel\Mcp\Server\Contracts;
use Illuminate\Contracts\Support\Arrayable;
use Laravel\Mcp\Server\Prompt;
use Laravel\Mcp\Server\Resource;
use Laravel\Mcp\Server\Tool;
use Stringable;
/**
* @extends Arrayable<string, mixed>
*/
interface Content extends Arrayable, Stringable
{
/**
* @return array<string, mixed>
*/
public function toTool(Tool $tool): array;
/**
* @return array<string, mixed>
*/
public function toPrompt(Prompt $prompt): array;
/**
* @return array<string, mixed>
*/
public function toResource(Resource $resource): array;
/**
* @param array<string, mixed>|string $meta
*/
public function setMeta(array|string $meta, mixed $value = null): void;
public function __toString(): string;
}

View File

@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace Laravel\Mcp\Server\Contracts;
interface Errable
{
//
}

View File

@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Laravel\Mcp\Server\Contracts;
use Laravel\Mcp\Support\UriTemplate;
interface HasUriTemplate
{
/**
* Get the URI pattern for the resource template.
*/
public function uriTemplate(): UriTemplate;
}

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Laravel\Mcp\Server\Contracts;
use Laravel\Mcp\Server\Exceptions\JsonRpcException;
use Laravel\Mcp\Server\ServerContext;
use Laravel\Mcp\Server\Transport\JsonRpcRequest;
use Laravel\Mcp\Server\Transport\JsonRpcResponse;
interface Method
{
/**
* @return iterable<JsonRpcResponse>|JsonRpcResponse
*
* @throws JsonRpcException
*/
public function handle(JsonRpcRequest $request, ServerContext $context): iterable|JsonRpcResponse;
}

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Laravel\Mcp\Server\Contracts;
use Closure;
interface Transport
{
public function onReceive(Closure $handler): void;
public function run(); // @phpstan-ignore-line
public function send(string $message, ?string $sessionId = null): void;
public function sessionId(): ?string;
public function stream(Closure $stream): void;
}