feat: add withCursorPagination to withStandardDecorators#47
Merged
Conversation
275028f to
fc1bafe
Compare
Moves cursor pagination into the standard decorator chain so all hosts (stdio, hosted, any future) get it automatically. The return type uses CursorPaginatedArgs<Args> to correctly reflect the schema transformation (skip/take → optional cursor) at the TypeScript level. Updates template list-examples test to use cursor-based pagination. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fc1bafe to
d8e194e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
withCursorPaginationto thewithStandardDecoratorsdecorator chain so all hosts (stdio, hosted, any future) get cursor pagination automaticallyCursorPaginatedArgs<Args>conditional type that correctly reflects the schema transformation (skip/take → optional cursor) at the TypeScript levelCursorPaginatedArgsfrom the SDK public API for consumer useDetails
Previously
withCursorPaginationhad to be applied separately by each host's tool registrar. Now it's part of the standard decorator chain, applied between input sanitization and error handling.The return type of
withStandardDecoratorsis nowToolDefinition<CursorPaginatedArgs<Args>, OutputArgs>— tools with skip/take in their input schema will have the correct type showingcursor?instead, so consumers get proper type-checking when calling tool handlers.Test plan
🤖 Generated with Claude Code