Feat/custom component#57
Merged
Merged
Conversation
memorte03
approved these changes
Jul 21, 2026
memorte03
approved these changes
Jul 21, 2026
ssmrmmk
approved these changes
Jul 21, 2026
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.
What does this PR do?
Adds the
customcomponent type — a host-extensible escape hatch for components the built-in typesdon't cover. Rather than a new type name per component, it's a stable envelope:
nameselects avariant the host registered,
propscarries its inputs,actionswires its events. The spec staysintent-level; all rendering lives in the host.
The key difference from the existing custom-type path (
type: timer+customSchemas) is that theenvelope is LLM-authorable. A model can't invent
type: timer— it isn't in the spec any promptteaches — but it can emit
type: customwithname: timeronce the variant appears in the catalogthe host passes to
buildSystemPrompt({ customComponents }). Both paths share the samecustomSchemasmap, so a schema written for one is reusable by the other.Also fixes a latent bug found along the way: the markdown pipeline was missing
remark-gfm, so theGFM tables models routinely emit next to charts silently degraded into run-on pipe text.
Type of Change
Additive only — existing documents parse identically.
Packages Affected
@mobile-reality/mdma-spec@mobile-reality/mdma-parser@mobile-reality/mdma-runtime@mobile-reality/mdma-attachables-core@mobile-reality/mdma-renderer-react@mobile-reality/mdma-prompt-packAlso touched (no version bump — tests/docs only):
mdma-mcp,mdma-validator,demo,evals.Checklist
pnpm formatandpnpm lintpass).pnpm test) — 24/24 tasks.pnpm typecheck) — 22/22 tasks.pnpm changeset) — minor for the five packages above.sensitive: truewhere appropriate — N/A, no new fields.How to Test
pnpm install && pnpm test && pnpm typecheck— all green.nameprops validation:pnpm --filter @mobile-reality/mdma-parser test.Covers a registered
name(props validated, errors prefixedprops.*) and an unregistered one(passes through rather than failing the parse, so a document authored against a richer host still
renders elsewhere).
pnpm --filter @mobile-reality/mdma-demo dev→ Docs → Components →custom.A WebGL 3D bar chart rendered through the envelope via three.js; drag to orbit, click a bar and
confirm the selection lands in the action log.
pls generate sample 3D graph; the agent should emit atype: custom/name: graph-3dblockwith its
onSelectaction wired.pnpm --filter @mobile-reality/mdma-evals eval(33 cases incl. 5custom scenarios),
eval:fixer(16),eval:guidance-coexistence(8).Screenshots / Examples