Architecture Explain · winBrain Creator OS
为什么本分支把「专家」从执行单元降级为静态装载资产,以及它和旧设定的实质区别
plugin.json
声明身份 + skills/ 承载员工), 项目一次会话只读加载 N
个专家插件 + 本体 MCP + 员工 skills。角色定义没删,而是降级为 plugin
元数据 + systemPrompt 动态拼接。
| 维度 | 旧 · 专家=Agent | 新 · 专家=Plugin |
|---|---|---|
| 本质 | 执行单元:角色定义 + 独立运行时 | 静态只读资产:plugin.json + skills/ 目录 |
| 角色定义 | 内嵌在 agent 定义里,随执行实体走 | 降级为 plugin.json 元数据 + systemPrompt 动态拼接("以专家「X」身份工作") |
| 会话 / 记忆 | 每专家独立会话与记忆 | 无独立会话;项目一次 SDK 会话内按专家切片(target 三级切换) |
| 装载方式 | 每专家一个 agent 进程 |
plugins:[{type:"local", path}] 只读加载,与本体
MCP、员工 skills 同会话聚合
|
| 版本化 | 运行实体,难以快照/回滚 |
文件树资产:.versions/<expert-id>/<sha256>/
原子归档,退休/回滚可审计
|
| 组合性 | N 专家 = N 运行时,成本线性涨 | N 专家 = 一次会话只读切片,权限边界天然清晰 |
| 发布 API | 绑定执行生命周期 | 独立发布(expert-publication),不绑定执行 |
| 代价 | — | 无专家级持久记忆;身份靠 prompt 拼接,未来需在项目会话内按专家切片管理 |
1. ExpertAsset —— 无任何 agent 运行时字段(src/application/organization.ts)
export type ExpertAsset = {
id: string; name: string; description: string;
pluginPath: string; // .claude-plugin/plugin.json
employees: EmployeeAsset[]; // skills/ 目录,员工 = Skill
ontologyMcpIds?: string[]; mcpServerIds?: string[];
status: ExpertLifecycleStatus; retiredAt?: string;
};
2. buildChatOptions —— 专家走 plugins 装载,员工走 skills(claude-agent-sdk.ts)
const plugins: SdkPluginConfig[] = context.pluginPaths.map((path) => ({
type: "local", path, skipMcpDiscovery: true,
}));
// ...
skills: context.skillNames,
systemPrompt: `你正在 ${context.project.name} 的独享 Session Sandbox 中,
以${...}「${context.label}」身份工作。项目层级:${hierarchy}。…`
3. 专家目录即 Plugin 包(workspace/experts/expert-msn1bi5s/)
expert-msn1bi5s/ ├── .claude-plugin/plugin.json # name / description / ontologyMcps / mcpServers ├── README.md └── skills/zhuizhen-diagnosis/ # 员工(SKILL.md + references/)
4. 迭代文档原文(docs/iterations/2026-07-27-ink-agent-sdk-creator-os.md)
- 员工 = Skill、专家 = Plugin、项目 = Claude Agent SDK。