Install
openclaw skills install @thcjp/account-manager账号切换管理(封号换号),包括设备调度、好友迁移、账号状态管理、换号前好友筛选与通知。触发:封号检测/换号请求/风险预警
openclaw skills install @thcjp/account-manager版本: v1.1 | 优先级: P0 | 状态: 🟢 switch_account已实现 | 依赖MCP: fishclaw-mcp, device-operations-mcp
v1.1更新(2026-08-15): 实现switch_account动作(DEF-37增强),支持封号后账号切换+cookie映射更新+bound_accounts更新+迁移报告生成。exec脚本:
scripts/account_manager.py --action switch_account
python skills/account-manager/scripts/save_account_status.py持久化{"action": "switch_account", "agent_id": "agent_002", "platform": "wechat", "old_account": "wx_001", "new_account": "wx_002", "phone_number": "138****0002", "banned_reason": "频繁加人", "banned_date": "2026-04-15T10:30:00Z"}
完整输入/输出JSON格式、字段说明、错误码、测试用例、依赖关系详见 scripts/account_manager_reference.json
{
"success": true,
"data": {
"action": "switch_account",
"agent_id": "agent_002",
"platform": "wechat",
"old_account": {
"account_id": "wx_001",
"status": "banned",
"banned_reason": "频繁加人",
"banned_date": "2026-04-15T10:30:00Z"
},
"new_account": {
"account_id": "wx_002",
"status": "active",
"phone_number": "138****0002",
"login_status": "success"
},
"inherited_data": {
"friends_count": 150,
"memory_count": 5000,
"tags_count": 12
},
"notification_sent": {
"high_value": 8,
"normal": 0,
"risk": 2
},
"switched_at": "2026-04-15T11:00:00Z"
},
"error": null,
"code": null
}
字段说明:
old_account.status: 旧账号状态(banned/disabled)new_account.status: 新账号状态(active/login_failed)inherited_data: 数据迁移统计(好友数/记忆条数/标签数)notification_sent: 通知策略执行统计(高价值/普通/风险)switched_at: 切换完成时间(ISO 8601)完整输出JSON格式详见 scripts/account_manager_reference.json
| 异常 | 错误码 | 处理 |
|---|---|---|
| 旧账号不存在 | ACCOUNT_NOT_FOUND | 检查账号ID |
| 新账号已存在 | ACCOUNT_ALREADY_EXISTS | 使用其他ID |
| 设备登录失败 | DEVICE_LOGIN_FAILED | 重试或检查设备 |
| 数据迁移失败 | DATA_MIGRATION_FAILED | 部分迁移或手动 |
| 平台不支持 | PLATFORM_NOT_SUPPORTED | 添加平台支持 |
| MCP未连接 | MCP_NOT_CONNECTED | 检查配置重启Gateway |
完整8个错误码+返回示例详见 scripts/account_manager_reference.json
{success:true, old_account:{status:"banned"}, new_account:{status:"active"}, inherited_data:{friends_count:150}}更多示例(抖音换号/异常场景)和10个测试用例详见 scripts/account_manager_reference.json
| 版本 | 日期 | 变更说明 |
|---|---|---|
| v1.0 | 2026-04-15 | 初始版本 |