清单参考
manifest.json 是给游戏作者看的公开契约。它应该描述游戏本身,而不是暴露运行环境内部权限图或运行时策略。
最小游戏清单
json
{
"name": "door-quest"
}只有 name 是必填。Vifu 会补齐可部署默认值:manifestVersion、type、version、main.url、main.type、main.engine、main.sdk 和 build.output。只有默认值不适合项目时才需要写这些字段。
部署不需要 id。Vifu 会根据当前登录的所有者和 name 决定更新目标,同一个项目重复部署会更新同一个游戏。
AI-native 游戏示例
json
{
"name": "AIventure",
"title": "AIventure",
"engine": "phaser",
"description": "A Phaser adventure game with AI-driven NPC dialogue.",
"tags": ["ai-native", "adventure", "phaser"],
"category": "story"
}字段
| 字段 | 必填 | 说明 |
|---|---|---|
name | 是 | 稳定的 ASCII 部署名,例如 door-quest。 |
manifestVersion | 否 | 默认是 1。 |
type | 否 | 默认是 game。 |
title | 否 | 玩家可见的显示名,默认从 name 推导。 |
version | 否 | 默认是 1.0.0。 |
engine | 否 | 简洁的运行时引擎提示,例如 phaser、three 或 vanilla。会编译为 main.engine;如果显式写了 main.engine,则以显式值为准。 |
description | 否 | 玩家可见的简短描述。 |
tags | 否 | 搜索、分类和发现用标签。 |
main | 否 | 浏览器入口和引擎信息。默认是 index.html、static-web、vanilla、sdk: auto。 |
build | 否 | 本地构建命令和输出目录。 |
ai | 否 | Vifu AI 默认可通过 SDK 使用。除非要明确关闭 AI 或使用平台特定覆盖,否则不要写这个字段。 |
companion | 否 | 启用 / 配置 companion bridge。companion 功能默认全开;只有要关闭某个功能时才写 false。 |
save | 否 | 游戏状态的保存范围。 |
dictionary | 否 | 词典语言对和字段。 |
voice | 否 | 语音输入 / 输出。 |
camera | 否 | 游戏请求的摄像头模式。 |
review | 否 | 复习 / 评分的对象和模式。 |
data | 否 | 可通过 vifu.resources 读取的命名数据文件。 |
media | 否 | 命名媒体文件。 |
bundle | 否 | 随游戏发布的额外文件。 |
links | 否 | 运行环境可以打开的外部链接。 |
category | 否 | 公开产品 family:language、knowledge、story、music、creative、wellbeing 或 arcade。更具体的词(如 adventure)应放在 tags 中。 |
remix | 否 | Remix 访问策略。 |
main
json
{
"main": {
"url": "index.html",
"type": "static-web",
"engine": "vanilla",
"sdk": "auto"
}
}url 是 build.output 内的 HTML 入口文件。
build
json
{
"build": {
"command": "npm run build",
"output": "dist"
}
}除非传入 --no-build,否则 vifu deploy 会执行 build.command,然后验证并上传 build.output。
不要写进 V1 的字段
这些 key 属于内部结构或旧公开设计。
identryplayruntimeservicesdevicesresourcespermissionscapabilitiesbrowsersecurityschema
请使用 ai、data、media、bundle、links、save、dictionary、voice、camera、review 这类产品语义名称。
验证和解释
bash
vifu manifest check
vifu manifest explain
vifu manifest explain --debug--debug 用于平台维护者查看编译后的内部运行时策略。