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:
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user