Proposal: add source-derived component composition metadata#8217
Draft
adierkens wants to merge 6 commits into
Draft
Proposal: add source-derived component composition metadata#8217adierkens wants to merge 6 commits into
adierkens wants to merge 6 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824ae552-5d34-4683-9628-05bd0d5bff16
🦋 Changeset detectedLatest commit: e24f81d The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
Contributor
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824ae552-5d34-4683-9628-05bd0d5bff16
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824ae552-5d34-4683-9628-05bd0d5bff16
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824ae552-5d34-4683-9628-05bd0d5bff16
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824ae552-5d34-4683-9628-05bd0d5bff16
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824ae552-5d34-4683-9628-05bd0d5bff16
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.
Changelog
New
@primer/react/generated/components.json.get_component_compositionMCP tool and package-backed component documentation sources forget_componentandget_component_batch.Changed
Removed
Rollout strategy
Testing & Reviewing
Composition metadata is generated from canonical public Primer React sources, rather than separately maintained MCP-specific prose. API declarations describe documented availability only; observed records require at least two distinct source units and do not claim universal semantic correctness. Dynamic JSX and runtime children are excluded.
MCP consumption:
get_component_compositionexposes full filtered package-backed composition.get_componentandget_component_batchdefault to hosted Primer Style documentation, or return installed metadata withsource: "package"/PRIMER_COMPONENT_DOCS_SOURCE=package. Package-mode batches intentionally omit full generated documents and retainget_componentfor full documentation and provenance.Truncation guard: SDK protocol tests cover NavList, SegmentedControl, CounterLabel, and Avatar below 20 KB, plus the high-connectivity ActionList plus SegmentedControl batch below 15 KB. Batch summaries cap observed rows to the three strongest records per type and surface omitted counts.
Package/canary boundary: packed React metadata contains composition schema version 1. The current MCP canary artifact is
primer-mcp-0.5.0.tgzwith SHA-256c0a4c10e23235b9dc9e4510c08828a9d183f303c52821cc4f57e0757c3900306.Validated with:
npm run build(Node 26.4.0)npm run type-check -w @primer/reactnpm run type-check -w @primer/mcpnpm test -w @primer/mcpnpm run lintnpm run lint:mdnpm run format:diffnpx vitest --config vitest.config.mts --run src/__tests__/component-composition.test.ts(frompackages/react)npm packchecks for@primer/reactand@primer/mcp