AI 时代的对象语言 — 完整技术规范
每个 Bundle 的核心是一个 manifest.json 文件,遵循 RKT v1.0 规范。当前阶段 Bundle 是最小交易/安装/替换单元。
| 字段 | 类型 | 必须 | 说明 |
|---|---|---|---|
rktVersion | string | 必填 | 协议版本(当前 "1.0") |
id | string | 必填 | 唯一标识符(kebab-case) |
version | string | 必填 | Bundle 版本(语义化版本) |
name | string | 必填 | 显示名称 |
summary | string | 必填 | 一句话描述 |
targetUser | string | 必填 | 目标用户 |
roles | Role[] | 必填 | 角色定义(≥1 个) |
kits | Kit[] | 可选 | 能力包数组 |
teams | Team[] | 可选 | 协作团队定义 |
mode | enum | 可选 | single | team |
rollbackProfile | object | 必填 | 回滚策略 { snapshotEnabled, strategy } |
activationScope | enum | 可选 | session | agent | workspace | global |
assertions | Assertion[] | 可选 | 契约测试声明 |
author | string | 新增 | 发布者/作者 |
tags | string[] | 新增 | 市场标签 |
category | string | 新增 | 市场分类 |
license | string | 新增 | 许可证(默认 MIT) |
{
"id": "analyst",
"label": "数据分析师",
"purpose": "负责数据采集与趋势分析",
"description": "专注于金融数据的深度分析",
"thinkingLevel": "deep",
"isEntry": true,
"responsibilities": ["数据清洗", "趋势分析"],
"boundaries": ["不执行写操作"],
"kits": ["data-kit", "chart-kit"],
"input": { "type": "json" },
"output": { "type": "structured" }
}{
"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"
}
}{
"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" }
}必填字段存在、rktVersion 有效、JSON 合法
Role id 唯一、Kit capabilities 非空、runtime 枚举、thinkingLevel 枚举、handoff 边类型
协议版本兼容、Kit 依赖解析、mirror.digest 哈希校验
Kit 风险等级审核、permissions 权限清单、autoUpdate 热更新警告
rollbackProfile、activationScope、projectionPlan 投影方式
summary/description/author 可读性、能否生成安装预览