@mexty/engine-schema
v0.2.3
Published
Game definition, primitive manifest and asset manifest schemas for the Mexty game engine (zod + JSON Schema), plus the event/action/condition vocabularies.
Readme
@mexty/engine-schema
The data contracts of the Mexty game engine, as zod schemas with generated JSON Schema:
GameDefinitionSchema— a whole game:meta,settings,assets,primitives,player,scene.entities,quests,triggers,hud,completion. A game host block's props are a game definition;validateGameDefinition(value)returns{ valid, errors, warnings, definition }with defaults applied and cross-references (aliases, entity ids, objective targets) checked.PrimitiveManifestSchema— what a primitive block declares insrc/manifest.json.EngineAssetManifestSchema— a catalog asset (kind, url, clips, scale, collider hint).- Vocabularies:
ASSET_KINDS,PRIMITIVE_KINDS,BUILTIN_PRIMITIVES,SEMANTIC_CLIPS,CAMERA_MODES,OBJECTIVE_TYPES,EVENT_NAMES,OBJECTIVE_EVENTS; theActionandConditionunions the trigger interpreter runs. gameDefinitionJsonSchema()— the JSON Schema committed as a game host'ssrc/props.schema.json, carrying the editor keywords (x-asset,x-primitive,x-entity-ref,x-alias-ref,x-animation,x-engine). Also shipped asdist/game-definition.schema.json.chestDemoDefinition— the smallest complete game ("walk to the chest, open it").
No React or three.js dependency: the backend validates with it, the website reads its keywords, the engine renders from it.
