1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * This file is part of the Nexus MCP SDK package.
7: *
8: * (c) 2026 John Paul E. Balandan, CPA <paulbalandan@gmail.com>
9: *
10: * For the full copyright and license information, please view
11: * the LICENSE file that was distributed with this source code.
12: */
13:
14: namespace Nexus\Mcp\Core\Schema\Result;
15:
16: use Nexus\Mcp\Core\Schema\Cursor;
17: use Nexus\Mcp\Core\Schema\Enum\CacheScope;
18: use Nexus\Mcp\Core\Schema\MetaObject;
19:
20: /**
21: * Common shape for results that paginate via an opaque cursor. Subclasses add their own
22: * payload field alongside the optional `nextCursor`.
23: *
24: * @template-covariant T of array<string, mixed>
25: *
26: * @extends CacheableResult<T>
27: *
28: * @see https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/draft/schema.ts
29: */
30: abstract readonly class PaginatedResult extends CacheableResult
31: {
32: public function __construct(
33: int $ttlMs,
34: CacheScope $cacheScope,
35: public ?Cursor $nextCursor = null,
36: MetaObject $meta = new MetaObject(),
37: ) {
38: parent::__construct(ttlMs: $ttlMs, cacheScope: $cacheScope, meta: $meta);
39: }
40: }
41: