Repository navigation
feat!: one read vocabulary — get/list rooted in the operations registry (3a) - #34
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: c3c203f The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 59 minutes. View limit details
TanStack is on CodeRabbit Free, which includes PR summaries. Ask your admin to upgrade for code reviews.
|
This was referenced Nov 6, 2026
cursor
Bot
force-pushed
the
cursor/access-fail-closed-a931
branch
from
November 6, 2026 14:50
a9287ec to
c00ad35
Compare
cursor
Bot
force-pushed
the
cursor/read-verbs-get-list-a931
branch
from
November 6, 2026 14:50
71f3aad to
550fc8f
Compare
cursor
Bot
changed the base branch from
cursor/access-fail-closed-a931
to
main
November 6, 2026 14:56
jherr
force-pushed
the
cursor/read-verbs-get-list-a931
branch
from
November 6, 2026 15:08
550fc8f to
c3c203f
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.
Implements cms-refactor-plan.md § Phase 3 (3a): item 5 ("One read vocabulary (get/list) rooted in the operations registry"), plus questions 17 and 18.
Merge chain: step 16 of 24. Base:
main. Merge it right after #30. The branch ismain3b4a112, then one commit for each PR before this one in the merge order, then this PR's own commit550fc8f(treef1763d9).What
@tanstack/cms-coreexportsreadVerbs, the registry of canonical reads. Each verb has a name, a noun, a description and one zod input bag (getInput,listInput). Every surface derives from it:cmsAs(cms, ctx).get(options)and.list(options?), plusgetAs(ctx, options)andlistAs(ctx, options?)from@tanstack/cms-core/server. The store validates the bag itself.getandlistoperations in@tanstack/cms-api, with matching Start server functions.client.get(options)andclient.list(options?), typed fromRegister.cmsTools:get_document(new) andlist_documents. Names come fromagentToolName(verb), which is<verb>_<noun>(Q18).get:{ collection, id | locator, locale?, populate? }. Exactly one ofidorlocatormust be given, which both the type and a runtime check enforce. It resolves to{ id, collection, doc, relations? }, or tonullwhen the document is missing or unreadable.list:{ collection?, locale?, where?, sort?, limit?, offset?, cursor?, populate? }. It resolves to{ items, total, nextCursor? }.limitdefaults to 100, with a maximum of 500. Without acollection, it lists every collection the reader may read.livecontext reads published documents.previewandeditread the working copy, and in those modesgetoverlays staged changes.populatestays off here. 3b turns it on.search_documentsstays its own verb (Q17).read_documentis deprecated in favour ofget_document. It keeps its input and its bare-document output.queryDocuments,readDocument,getPublicDocumentandlistPublishedDocuments, plus their…Asforms.locale..changeset/read-verbs-get-list.md, minor for core, api and client.Breaking changes
list_documentstakes thelistbag and returns{ items: [{ id, collection, doc }], total, nextCursor? }instead of an array of summaries.limitdefaults to 100. Staged creates are no longer listed;get_documentreads them.getandlistare reserved operation names.get_documentbeforeupdate_document, instead ofread_document.How verified
tests/read-verbs.test.ts(14), covering modes, locale, hidden collections, the exclusive bag (runtime and type), the limits, the old verbs and the agent tools;tests/read-verbs.test.ts(5);71f3aadintoorigin/mainat3b4a112. The only conflict wasscripts/codemods/index.ts, where I kept both codemods.pnpm install --frozen-lockfilepnpm test:ci(174 tasks)@tanstack/cms-api:test:oxlintfailure on a type cast. Core 590 passed (30 skipped), api 207.pnpm test:dtspnpm test:dialectspnpm test:scriptsAssumptions (conservative defaults where the plan gives none)
getandlistare the names on every surface.getAsandlistAs, following 2b's…Asconvention.listwithout a collection lists every readable collection, asqueryDocumentsalready did.limit: defaults to 100 with a maximum of 500, the old MCP defaults.locale: filters documents by locale, and locators match per locale.locator: means slug or id until 3c defines locators.getoverlays them in preview and edit modes.listreads stored rows only.get/listread the way the public site does.Divergence from plan
read_documentis kept as a deprecated alias, rather than removed.getPublicDocument, which keeps its cross-collectionpreferredlookup.Merge chain (local verification, CI down)
This PR's commits are squashed into one commit on the linear merge chain. That commit holds this PR's own changes, resolved against every PR before it, with the integration rehearsal's fixes for this PR applied. No conflicts. Its upgrading section is renumbered to step 26.
The chain tip's tree is exactly the integration rehearsal plus #46 (
c4e6d7c), and the tip passes the full local suite. I simulated merging every PR in order, with a merge commit or a fast-forward at each step, and every step is clean. A plain squash of the next PR would conflict, because the squash commit isn't an ancestor of the next branch. To squash instead, first rebase the branch's one commit onto the newmain; that rebase is always clean.