Manifest 结构

bundle-manifest.json

每个 Bundle 的核心是一个 manifest.json 文件,遵循 RKT v1.0 规范。当前阶段 Bundle 是最小交易/安装/替换单元。

字段类型必须说明
rktVersionstring必填协议版本(当前 "1.0")
idstring必填唯一标识符(kebab-case)
versionstring必填Bundle 版本(语义化版本)
namestring必填显示名称
summarystring必填一句话描述
targetUserstring必填目标用户
rolesRole[]必填角色定义(≥1 个)
kitsKit[]可选能力包数组
teamsTeam[]可选协作团队定义
modeenum可选single | team
rollbackProfileobject必填回滚策略 { snapshotEnabled, strategy }
activationScopeenum可选session | agent | workspace | global
assertionsAssertion[]可选契约测试声明
authorstring新增发布者/作者
tagsstring[]新增市场标签
categorystring新增市场分类
licensestring新增许可证(默认 MIT)
四大对象

Role 角色

{
  "id": "analyst",
  "label": "数据分析师",
  "purpose": "负责数据采集与趋势分析",
  "description": "专注于金融数据的深度分析",
  "thinkingLevel": "deep",
  "isEntry": true,
  "responsibilities": ["数据清洗", "趋势分析"],
  "boundaries": ["不执行写操作"],
  "kits": ["data-kit", "chart-kit"],
  "input": { "type": "json" },
  "output": { "type": "structured" }
}

Kit 能力包

{
  "id": "web-search",
  "label": "全网搜索",
  "description": "实时网页搜索能力",
  "capabilities": ["信息检索", "摘要提取"],
  "riskLevel": "low",
  "runtime": "mcp-server",
  "entryPoint": "search.js",
  "toolBinding": { "type": "mcp", "config": { "server": "search-api" } },
  "mirror": {
    "source": "roleos-mirror://official",
    "digest": "sha256:ce59501374eb5ee0d9cb0138cb6fe08a74d26c806d05845c10e40f2e84f89bc9",
    "autoUpdate": false,
    "clawHubRef": "web-search@1.0.0"
  }
}

Team 团队

{
  "id": "research-team",
  "label": "研究团队",
  "topology": "pipeline",
  "entryRoleId": "analyst",
  "concurrencyMode": "sequential",
  "members": [
    { "id": "analyst", "isEntry": true },
    { "id": "writer" }
  ],
  "handoffGraph": [
    { "source": "analyst", "target": "writer", "type": "sequential", "label": "分析完成" }
  ],
  "terminationRules": ["报告已生成"],
  "degradationStrategy": { "toolMissing": "skip", "permDenied": "escalate" }
}
质量守门

6 层 Validator

L1

包体结构

必填字段存在、rktVersion 有效、JSON 合法

L2

语义对象

Role id 唯一、Kit capabilities 非空、runtime 枚举、thinkingLevel 枚举、handoff 边类型

L3

依赖兼容

协议版本兼容、Kit 依赖解析、mirror.digest 哈希校验

L4

权限隔离

Kit 风险等级审核、permissions 权限清单、autoUpdate 热更新警告

L5

运行时确定

rollbackProfile、activationScope、projectionPlan 投影方式

L6

体验可转译

summary/description/author 可读性、能否生成安装预览