Skip to content

Commit cb3cf95

Browse files
committed
chore: added changeset
1 parent e2c77d4 commit cb3cf95

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
"@mobile-reality/mdma-spec": minor
3+
"@mobile-reality/mdma-parser": minor
4+
"@mobile-reality/mdma-runtime": minor
5+
"@mobile-reality/mdma-renderer-react": minor
6+
"@mobile-reality/mdma-prompt-pack": minor
7+
---
8+
9+
Add the `custom` component type — a host-extensible escape hatch for components the built-in types
10+
do not cover. It is a stable envelope rather than a new type per component: `name` selects a variant
11+
the host registered, `props` carries its inputs, and `actions` wires its events. This keeps the spec
12+
intent-level while all rendering lives in the host, and — unlike the existing custom-*type* path — it
13+
is authorable by an LLM, because the envelope is part of the spec every prompt already teaches. A
14+
model cannot invent `type: timer`, but it can emit `type: custom` with `name: timer` once the variant
15+
appears in the catalog the host passes to `buildSystemPrompt({ customComponents })`.
16+
17+
- **spec**`CustomComponentSchema` (`id` required, `name` required, open `props` record, optional
18+
`actions` map), added to the component union, `COMPONENT_TYPES`, and the schema registry.
19+
- **parser** — per-`name` props validation: the envelope is validated by the union, then `props` are
20+
validated against the matching entry in `customSchemas`, with errors prefixed `props.*`. An
21+
unregistered `name` passes through rather than failing the parse, so a document authored against a
22+
richer host still renders elsewhere.
23+
- **runtime**`registerCustomComponent()` registers a variant's handler and schema together.
24+
- **renderer-react**`CustomVariantProvider` / `useCustomVariants()` and a `CustomRenderer` that
25+
falls back to an inline notice when a `name` has no registered variant, so an unknown variant
26+
degrades visibly instead of rendering nothing.
27+
- **prompt-pack**`buildSystemPrompt({ customComponents })` renders an
28+
`## Available Custom Components` catalog; author, fixer, and agent prompts document the envelope
29+
and the standalone-not-a-form-field rule. Adds prompt variants for gpt-5.6 (sol/terra/luna),
30+
claude-opus-4.8, claude-fable-5, gemini-3.5-flash, and grok-4.5.
31+
32+
The agent prompts also gain an other-tools clause so `generate_mdma` defers to a host's own tools
33+
when it is imported into an existing tool set, rather than answering requests those tools own.
34+
35+
`@mobile-reality/mdma-renderer-react-native` does not yet render the `custom` type — documents using
36+
it fall back to the unknown-component path on React Native.

0 commit comments

Comments
 (0)