feat: structured errors with hint, ToolResult, cursor pagination

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
2026-09-25 21:37:42 +02:00
co-authored by Claude Opus 5.5
parent 5434cb6767
commit f63d35c2f8
12 changed files with 631 additions and 14 deletions
@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace LIT\MCP\Tests\Unit\Abilities;
use LIT\MCP\Abilities\JsonMap;
use LIT\MCP\Abilities\Rev;
use LIT\MCP\Tests\Unit\TestCase;
use stdClass;
final class RevAndJsonMapTest extends TestCase
{
public function testRevIsShortDeterministicAndContentSensitive(): void
{
self::assertMatchesRegularExpression('/^[0-9a-f]{12}$/', Rev::of('abc'));
self::assertSame(Rev::of('abc'), Rev::of('abc'));
self::assertNotSame(Rev::of('abc'), Rev::of('abd'));
}
public function testEmptyMapBecomesJsonObject(): void
{
self::assertInstanceOf(stdClass::class, JsonMap::of([]));
self::assertSame('{}', json_encode(JsonMap::of([])));
self::assertSame(['a' => 1], JsonMap::of(['a' => 1]));
}
}