Add agent workflow engine foundation and theme-style page switcher.
Introduce WorkflowEngine with state machine, tool registry, and builtin chat template; migrate stream chat to engine callbacks. Move page mode switching to TopBar actions cluster as a ThemeToggle-style dropdown (聊天/工作室/爽文/房间). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# Chat Reply Skill
|
||||
|
||||
Minimal skill placeholder for the builtin.chat workflow template.
|
||||
|
||||
This skill orchestrates a single chat turn: load character, activate worldbooks, assemble prompt, call LLM, apply regex, record usage, and enqueue parallel tasks.
|
||||
@@ -0,0 +1,3 @@
|
||||
id: chat_reply
|
||||
name: Chat Reply
|
||||
description: Minimal chat reply skill for builtin.chat template
|
||||
41
data/agent/templates/builtin.chat/state_machine.json
Normal file
41
data/agent/templates/builtin.chat/state_machine.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"initial": "regex_apply_user_input",
|
||||
"states": {
|
||||
"regex_apply_user_input": {
|
||||
"tool": "regex_apply_user_input",
|
||||
"next": "load_character"
|
||||
},
|
||||
"load_character": {
|
||||
"tool": "load_character",
|
||||
"next": "activate_worldbook"
|
||||
},
|
||||
"activate_worldbook": {
|
||||
"tool": "activate_worldbook",
|
||||
"next": "load_chat_history"
|
||||
},
|
||||
"load_chat_history": {
|
||||
"tool": "load_chat_history",
|
||||
"next": "build_prompt_messages"
|
||||
},
|
||||
"build_prompt_messages": {
|
||||
"tool": "build_prompt_messages",
|
||||
"next": "llm_main_reply"
|
||||
},
|
||||
"llm_main_reply": {
|
||||
"tool": "llm_main_reply",
|
||||
"next": "regex_apply_ai_output"
|
||||
},
|
||||
"regex_apply_ai_output": {
|
||||
"tool": "regex_apply_ai_output",
|
||||
"next": "record_token_usage"
|
||||
},
|
||||
"record_token_usage": {
|
||||
"tool": "record_token_usage",
|
||||
"next": "enqueue_parallel_tasks"
|
||||
},
|
||||
"enqueue_parallel_tasks": {
|
||||
"tool": "enqueue_parallel_tasks",
|
||||
"next": "end"
|
||||
}
|
||||
}
|
||||
}
|
||||
16
data/agent/templates/builtin.chat/template.json
Normal file
16
data/agent/templates/builtin.chat/template.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"id": "builtin.chat",
|
||||
"kind": "builtin.chat",
|
||||
"name": "Builtin Chat Reply",
|
||||
"description": "Default single-turn chat workflow migrated from ChatWorkflowService",
|
||||
"version": "1.0.0",
|
||||
"state_machine_path": "state_machine.json",
|
||||
"skills": [
|
||||
{
|
||||
"id": "chat_reply",
|
||||
"name": "Chat Reply",
|
||||
"description": "Main chat reply skill",
|
||||
"path": "skill/chat_reply"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user