Skip to content

清单配置 (scenario.json)

scenario.json 是场景的清单配置文件,位于项目根目录。它定义了场景的元数据、身份、能力、UI 和权限。

完整字段参考

基础元数据

字段类型必填说明
idstring场景唯一标识,小写字母+数字+连字符,如 my-scenario
versionstring语义化版本号,如 1.0.0
namestring英文名称
nameZhstring中文名称
descriptionstring英文描述
descriptionZhstring中文描述
authorstring作者名称
iconstring图标名称(lucide-react 图标名)
categorystring分类(见下方分类表)
tagsstring[]标签列表
licensestring开源协议,如 MIT
typestring场景类型:declarativeprogrammatic

版本与兼容性

字段类型必填说明
minAppVersionstring最低客户端版本要求,如 1.2.0
dependenciesarray场景间依赖列表

发布信息

字段类型必填说明
entryPointstring编程式必填入口文件路径,如 src/index.ts
permissionsstring[]所需权限列表
sharedDepsobject编程式共享依赖声明

分类 (category)

说明
productivity生产力
development开发工具
education教育
business商业
creative创意
data数据
health健康
finance金融
legal法律
custom自定义

依赖声明

场景可以依赖其他场景:

json
{
  "dependencies": [
    {
      "scenarioId": "document-parser",
      "version": ">=1.0.0"
    },
    {
      "scenarioId": "code-formatter",
      "version": "^2.0.0"
    }
  ]
}

版本号支持 semver 范围语法:

  • >=1.0.0 - 大于等于 1.0.0
  • ^2.0.0 - 兼容 2.x.x
  • ~1.2.0 - 约等于 1.2.x
  • 1.0.0 - 精确匹配

编程式场景额外配置

json
{
  "type": "programmatic",
  "entryPoint": "src/index.ts",
  "sharedDeps": {
    "react": "^18.3.0",
    "react-dom": "^18.3.0",
    "zustand": "^5.0.0",
    "lucide-react": "^0.562.0"
  }
}

声明式场景额外配置

声明式场景的配置分布在 identitycapabilitiesuidatabasescripts 等子对象中,详见 声明式场景

AweeClaw AI 应用构建平台