feat(studio): 新增 Studio 工作流编辑/运行页,优化顶部三栏对齐

- 后端:项目/运行 API、上下文服务与数据模型
- 前端:Studio 列表、编辑页(R1/R2 布局)、运行页与节点图
- 编辑页顶部:CSS Grid 统一标签行与控件行对齐,项目按钮独立第三行
- Docker 开发配置与文档脚本

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-31 21:24:57 +08:00
parent bc130d98f4
commit fa6907fb8d
48 changed files with 8795 additions and 20 deletions

16
data/agent/niches.json Normal file
View File

@@ -0,0 +1,16 @@
{
"niches": [
{
"id": "aesthetic_tone",
"label": "整体美学",
"description": "视觉、氛围、叙事基调等宏观美学设定",
"suggestedStepGoal": "描述角色的整体美学:色调、材质、氛围、叙事基调,供后续人设与世界书条目引用。"
},
{
"id": "persona_detail",
"label": "具体人设",
"description": "性格、口癖、关系、行为模式等可扮演细节",
"suggestedStepGoal": "在整体美学基础上,细化可扮演的人设:性格、动机、口癖、与他人关系。"
}
]
}

View File

@@ -0,0 +1,58 @@
{
"templates": [
{
"skillId": "studio.init_bind",
"displayName": "创建并绑定",
"description": "创建角色卡与世界书,并绑定到当前 Studio 项目",
"displayParams": [
{
"key": "characterName",
"label": "角色卡名称",
"type": "text",
"required": true,
"placeholder": "例如:帝国骑士维尔"
},
{
"key": "worldbookName",
"label": "世界书名称",
"type": "text",
"required": true,
"placeholder": "例如:维尔的世界观"
}
],
"configWhitelist": [],
"artifacts": [],
"supportsLoopUntilSatisfied": false,
"supportsInputs": false,
"supportsInsertion": false,
"supportsScoring": false
},
{
"skillId": "studio.worldbook_entry",
"displayName": "创作世界书条目",
"description": "根据 stepGoal 与上文引用,生成并写入世界书条目",
"displayParams": [],
"configWhitelist": [
"stepGoal",
"thinkingPrompt",
"insertion.position",
"insertion.activationType",
"insertion.key",
"insertion.keysecondary",
"insertion.ragConfig",
"insertion.comment",
"scoring"
],
"artifacts": [
{
"type": "worldbook.entries",
"displayName": "世界书条目"
}
],
"supportsLoopUntilSatisfied": true,
"supportsInputs": true,
"supportsInsertion": true,
"supportsScoring": true
}
]
}

View File

@@ -0,0 +1,10 @@
{
"id": "default",
"name": "单人类角色卡",
"description": "从创建绑定到世界书条目的默认三步流水线,可在工作流编辑页复制并修改。",
"templateId": "builtin.studio.example",
"characterId": "f04ba2d6-1ffd-4c33-9cfe-cf6fd026c175",
"worldbookId": "8682f790-1b9d-4842-826b-c07764be6b9b",
"createdAt": "2026-05-31T00:00:00",
"updatedAt": "2026-05-31T13:11:55.525055"
}

View File

@@ -0,0 +1,122 @@
{
"workflowGoal": "设计一个单人角色:先绑定角色卡与世界书,再迭代整体美学与具体人设,写入世界书条目。",
"nodes": [
{
"id": "init",
"skillId": "studio.init_bind",
"displayName": "创建并绑定",
"enabled": true,
"loopUntilSatisfied": false,
"config": {},
"displayParams": [
{
"key": "characterName",
"label": "角色卡名称",
"type": "text",
"required": true,
"placeholder": ""
},
{
"key": "worldbookName",
"label": "世界书名称",
"type": "text",
"required": true,
"placeholder": ""
}
],
"inputs": []
},
{
"id": "aesthetic",
"skillId": "studio.worldbook_entry",
"displayName": "整体美学",
"enabled": true,
"niche": "aesthetic_tone",
"loopUntilSatisfied": true,
"config": {
"stepGoal": "产出角色的整体美学设定:视觉风格、氛围、叙事基调,供后续人设步骤引用。",
"thinkingPrompt": "step1首先思考整个故事是怎么样的\nstep2然后思考如何展示\nstep3选中核心爽点",
"insertion": {
"position": 1,
"activationType": "permanent",
"key": "整体美学",
"comment": "Studio · 整体美学"
},
"scoring": {
"enabled": true,
"dimensions": [
{
"id": "authenticity",
"name": "真实性",
"criteria": "美学设定是否自洽、可感知,而非空泛形容词堆砌。"
},
{
"id": "fit",
"name": "贴合度",
"criteria": "是否覆盖色调/材质/氛围/叙事基调;是否可与后续人设衔接;表述是否简洁可注入世界书。"
}
]
}
},
"displayParams": [],
"inputs": [
{
"ref": "workflow.goal",
"label": "工作流目标文本",
"optional": false
}
]
},
{
"id": "persona",
"skillId": "studio.worldbook_entry",
"displayName": "具体人设",
"enabled": true,
"niche": "persona_detail",
"loopUntilSatisfied": true,
"config": {
"stepGoal": "在整体美学基础上,写出可扮演的人设:性格、动机、口癖、关系与行为模式。",
"thinkingPrompt": "",
"insertion": {
"position": 1,
"activationType": "keyword",
"key": "具体人设",
"comment": "Studio · 具体人设"
},
"scoring": {
"enabled": true,
"dimensions": [
{
"id": "authenticity",
"name": "真实性",
"criteria": "人设细节是否具体、可扮演,动机与行为是否一致。"
},
{
"id": "fit",
"name": "贴合度",
"criteria": "是否与人设目标一致;是否与整体美学一致;是否避免与已有条目冲突。"
}
]
}
},
"displayParams": [],
"inputs": [
{
"ref": "workflow.goal",
"label": "工作流目标文本",
"optional": false
},
{
"ref": "aesthetic.output",
"label": "整体美学 · 上轮产物",
"optional": false
},
{
"ref": "persona.output",
"label": "具体人设 · 上轮产物",
"optional": true
}
]
}
]
}

View File

@@ -0,0 +1,6 @@
{
"id": "builtin.studio.example",
"name": "世界书条目创建",
"description": "从创建绑定到世界书条目的默认三步流水线,可在工作流编辑页复制并修改。",
"version": "1.0.0"
}

View File

@@ -0,0 +1,104 @@
{
"workflowGoal": "设计一个单人角色:先绑定角色卡与世界书,再迭代整体美学与具体人设,写入世界书条目。",
"nodes": [
{
"id": "init",
"skillId": "studio.init_bind",
"displayName": "创建并绑定",
"enabled": true,
"config": {},
"displayParams": [
{
"key": "characterName",
"label": "角色卡名称",
"type": "text",
"required": true,
"placeholder": ""
},
{
"key": "worldbookName",
"label": "世界书名称",
"type": "text",
"required": true,
"placeholder": ""
}
],
"inputs": []
},
{
"id": "aesthetic",
"skillId": "studio.worldbook_entry",
"displayName": "整体美学",
"niche": "aesthetic_tone",
"enabled": true,
"loopUntilSatisfied": true,
"config": {
"stepGoal": "产出角色的整体美学设定:视觉风格、氛围、叙事基调,供后续人设步骤引用。",
"thinkingPrompt": "====== 思考流程 ======\nStep1: 简短确认任务性质(新设计/修改)\nStep2: 阅读绑定角色/世界书与上文引用\nStep3: 按步骤目标起草世界书条目\nStep4: 对照评价维度自检并优化表述\n\n核心目的、评价标准与优化建议由系统在运行时自动注入无需在此填写",
"insertion": {
"position": 1,
"activationType": "permanent",
"key": "整体美学",
"comment": "Studio · 整体美学"
},
"scoring": {
"enabled": true,
"dimensions": [
{
"id": "authenticity",
"name": "真实性",
"criteria": "美学设定是否自洽、可感知,而非空泛形容词堆砌。"
},
{
"id": "fit",
"name": "贴合度",
"criteria": "是否覆盖色调/材质/氛围/叙事基调;是否可与后续人设衔接;表述是否简洁可注入世界书。"
}
]
}
},
"displayParams": [],
"inputs": []
},
{
"id": "persona",
"skillId": "studio.worldbook_entry",
"displayName": "具体人设",
"niche": "persona_detail",
"enabled": true,
"loopUntilSatisfied": true,
"config": {
"stepGoal": "在整体美学基础上,写出可扮演的人设:性格、动机、口癖、关系与行为模式。",
"thinkingPrompt": "====== 思考流程 ======\nStep1: 简短确认任务性质(新设计/修改)\nStep2: 阅读绑定角色/世界书与上文引用\nStep3: 按步骤目标起草世界书条目\nStep4: 对照评价维度自检并优化表述\n\n核心目的、评价标准与优化建议由系统在运行时自动注入无需在此填写",
"insertion": {
"position": 1,
"activationType": "keyword",
"key": "具体人设",
"comment": "Studio · 具体人设"
},
"scoring": {
"enabled": true,
"dimensions": [
{
"id": "authenticity",
"name": "真实性",
"criteria": "人设细节是否具体、可扮演,动机与行为是否一致。"
},
{
"id": "fit",
"name": "贴合度",
"criteria": "是否与人设目标一致;是否与整体美学一致;是否避免与已有条目冲突。"
}
]
}
},
"displayParams": [],
"inputs": [
{
"ref": "aesthetic.output",
"label": "整体美学 · 世界书条目"
}
]
}
]
}

View File

@@ -0,0 +1,56 @@
{
"builtIn": [
{
"ref": "workflow.goal",
"label": "工作流目标文本",
"description": "当前 Studio 项目的 workflowGoal 全文(系统自动注入,不可手动选择)",
"autoInjected": true
},
{
"ref": "workflow.boundWorldbook",
"label": "绑定世界书摘要",
"description": "项目绑定的世界书 meta / 摘要(系统自动注入,不可手动选择)",
"autoInjected": true
},
{
"ref": "workflow.boundCharacter",
"label": "绑定角色卡摘要",
"description": "项目绑定的角色卡摘要(系统自动注入,不可手动选择)",
"autoInjected": true
}
],
"dynamicSuffixes": [
{
"suffix": ".output",
"labelPattern": "{displayName} · 世界书条目"
}
],
"autoInjectedContext": [
"目前产物",
"思考流程",
"核心目的",
"评价标准与优化建议"
],
"autoInjectedContextDefs": [
{
"id": "currentProduct",
"label": "目前产物",
"description": "当前步骤已生成的世界书条目草稿或最新版本,供模型在迭代修改时对照与延续。"
},
{
"id": "thinkingFlow",
"label": "思考流程",
"description": "本步骤配置的 thinkingPrompt引导模型按既定步骤推理与自检。"
},
{
"id": "coreGoal",
"label": "核心目的",
"description": "本步骤的 stepGoal步骤目标明确本步要产出的内容与边界。"
},
{
"id": "scoringCriteria",
"label": "评价标准与优化建议",
"description": "本步骤启用的 scoring 评价维度及准则,用于模型自检与优化表述。"
}
]
}