#!/bin/bash
# 快速切换agent身份

if [[ $# -eq 0 ]]; then
    echo "用法: ./switch_agent.sh <agent名称>"
    echo "可用agents:"
    python3 -c "
import sys
sys.path.append('agents')
from agent_identity_manager import AgentIdentityManager
manager = AgentIdentityManager()
for agent in manager.list_agents():
    print(f'  - {agent[\"name\"]} ({agent[\"role\"]})')
    "
    exit 1
fi

AGENT_NAME=$1
echo "🔄 切换到agent: $AGENT_NAME"
python3 -c "
import sys
sys.path.append('agents')
from agent_identity_manager import AgentIdentityManager
manager = AgentIdentityManager()
try:
    manager.switch_to_agent('$AGENT_NAME')
    print('✅ 切换成功')
except Exception as e:
    print(f'❌ 切换失败: {e}')
    exit(1)
"
