Goal
Add cursor-based pagination support (x-has-more / x-next-cursor response headers) to the SDK's central pagination plumbing, backward-compatibly alongside the existing offset/x-total-count pagination. Ships first, before any backend change — it alters no endpoint behaviour.
Scope (Phase 1)
Core plumbing only — the three central pagination files plus a bulk helper:
All additive: responses without cursor headers behave exactly as today, so this is safe to release before the backend moves.
Confirmed decisions
- Cursor sent back as the
cursor query param.
- Coexistence: SDK handles both offset and cursor responses.
- Forward-only (no prev/jump-to-page).
- No
sort param on cursor endpoints (fixed server-side).
Not in this phase
Endpoint call-site migration → Phase 2 (#442).
References
- Design:
docs/superpowers/specs/2026-07-02-cursor-pagination-design.md
- Plan (Tasks 1–4, 7):
docs/superpowers/plans/2026-07-02-cursor-pagination.md
Goal
Add cursor-based pagination support (
x-has-more/x-next-cursorresponse headers) to the SDK's central pagination plumbing, backward-compatibly alongside the existing offset/x-total-countpagination. Ships first, before any backend change — it alters no endpoint behaviour.Scope (Phase 1)
Core plumbing only — the three central pagination files plus a bulk helper:
parseResponsereadsx-has-more/x-next-cursorand wraps the body as{ list, hasMore, nextCursor }when present (offsetx-total-countpath unchanged).nextCursor+hasMore;hasNextPage()prefershasMoreover theendReachedheuristic.cursor(fromprevious.nextCursor) into the callback; deriveendReachedfromhasMorewhen provided.hasMoreis false (for bulk fetchers in Phase 2).npx jest,npx tsc -p . --noEmit,npm run lint.All additive: responses without cursor headers behave exactly as today, so this is safe to release before the backend moves.
Confirmed decisions
cursorquery param.sortparam on cursor endpoints (fixed server-side).Not in this phase
Endpoint call-site migration → Phase 2 (#442).
References
docs/superpowers/specs/2026-07-02-cursor-pagination-design.mddocs/superpowers/plans/2026-07-02-cursor-pagination.md