feat: MCP stdio server + TUI回车发送 + 子Agent无限制 + 安全引擎优化 + diff弹窗绿红背景

- 新增 mcp_server.py: 标准 MCP stdio 传输层入口
- TUI: 回车发送消息,Shift+回车换行 (SendTextArea子类)
- 子Agent: 移除 max_steps=20 限制
- 安全引擎: 移除 ALWAYS_CONFIRM 关键词强制拦截
- code_editor: diff弹窗绿底(+)/红底(-)背景色
This commit is contained in:
shuiyu1123 committed 2026-06-19 00:10:27 +08:00
1 parent b0d9a24003
commit 161ab9d3a8
7 files changed
+294 -49

No files matched your search

+4 -4
View File
@@ -26,7 +26,7 @@ class SubAgent:
self.created_at = datetime.now().strftime("%H:%M:%S")
self.finished_at = None
self.steps = 0 # 已执行步数
self.max_steps = 20
self.max_steps = float('inf') # 不限制步数
def to_dict(self):
return {
@@ -238,7 +238,7 @@ class Liugin:
if agent.status == "running":
agent.status = "done"
agent.result = "已达到最大步数限制,任务暂停。"
agent.result = "任务执行结束。"
except Exception as e:
agent.status = "failed"
@@ -369,7 +369,7 @@ class Liugin:
f" 名称: {agent.name}",
f" 任务: {agent.task}",
f" 状态: {agent.status}",
f" 步骤: {agent.steps}/{agent.max_steps}",
f" 步骤: {agent.steps}",
f" 创建: {agent.created_at}",
]
if agent.finished_at:
@@ -395,7 +395,7 @@ class Liugin:
return f"错误:未找到 Agent '{agent_id}'"
if agent.status == "running":
return f"Agent {agent.id} 仍在运行中 (步骤 {agent.steps}/{agent.max_steps})"
return f"Agent {agent.id} 仍在运行中 (步骤 {agent.steps})"
if agent.status == "failed":
return f"Agent {agent.id} 执行失败: {agent.error}"