Skip to content

Commit 64ef083

Browse files
jbernard077claude
andcommitted
chore(docs): sync the registry-item schema mirror
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 1badea6 commit 64ef083

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

docs/schema/registry-item.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,76 @@
125125
"poster": { "type": "string" }
126126
}
127127
},
128+
"controls": {
129+
"type": "array",
130+
"minItems": 1,
131+
"description": "The item's declared control surface — the single authoring source for control documentation. Each entry mirrors one control in the item's top-of-script CONFIG object and is rendered as a controls table on the item's generated catalog page.",
132+
"items": {
133+
"type": "object",
134+
"required": ["name", "type", "drives"],
135+
"additionalProperties": false,
136+
"properties": {
137+
"name": {
138+
"type": "string",
139+
"pattern": "^[a-zA-Z][a-zA-Z0-9]*$",
140+
"description": "Control name as it appears in CONFIG. Intent-named (e.g. \"energy\", \"layout\"), never implementation-named (e.g. \"staggerMs\")."
141+
},
142+
"type": {
143+
"type": "string",
144+
"enum": ["toggle", "variant", "scalar"],
145+
"description": "toggle = boolean between two authored states; variant = enum over N authored poses; scalar = bounded number interpolating authored anchor states through a mapping."
146+
},
147+
"values": {
148+
"type": "array",
149+
"minItems": 2,
150+
"items": { "type": "string", "minLength": 1 },
151+
"description": "variant only: the authored poses. Toggles omit this (always true | false)."
152+
},
153+
"fields": {
154+
"type": "array",
155+
"minItems": 2,
156+
"items": { "type": "string", "minLength": 1 },
157+
"description": "Maps one declared control to N CONFIG keys (e.g. a paired animationIn/animationOut toggle counting as one control). default is then keyed per field."
158+
},
159+
"min": {
160+
"type": "number",
161+
"description": "scalar only: lower declared bound (out-of-bounds input clamps here, loudly)."
162+
},
163+
"max": {
164+
"type": "number",
165+
"description": "scalar only: upper declared bound (out-of-bounds input clamps here, loudly)."
166+
},
167+
"default": {
168+
"description": "The shipped state: variant = one of values; toggle = boolean (or a per-field object when fields is set); scalar = a number within min..max."
169+
},
170+
"drives": {
171+
"type": "string",
172+
"minLength": 1,
173+
"description": "What the control drives — the designed state group or mapping behind it."
174+
}
175+
},
176+
"allOf": [
177+
{
178+
"if": {
179+
"required": ["type"],
180+
"properties": { "type": { "const": "variant" } }
181+
},
182+
"then": { "required": ["values"] },
183+
"else": { "not": { "required": ["values"] } }
184+
},
185+
{
186+
"if": {
187+
"required": ["type"],
188+
"properties": { "type": { "const": "scalar" } }
189+
},
190+
"then": { "required": ["min", "max"] },
191+
"else": {
192+
"not": { "anyOf": [{ "required": ["min"] }, { "required": ["max"] }] }
193+
}
194+
}
195+
]
196+
}
197+
},
128198
"relatedSkill": {
129199
"type": "string",
130200
"minLength": 1

0 commit comments

Comments
 (0)