MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / format_role_list

Function format_role_list

agents/role-manager/main.py:248–274  ·  view source on GitHub ↗

格式化角色列表

(roles_result: Dict)

Source from the content-addressed store, hash-verified

246def format_role_list(roles_result: Dict) -> str:
247 """格式化角色列表"""
248 lines = []
249 lines.append("=" * 60)
250 lines.append("Role List")
251 lines.append("=" * 60)
252 lines.append("")
253
254 roles = roles_result.get("roles", [])
255
256 if not roles:
257 lines.append("(no roles yet)")
258 else:
259 for role in roles:
260 marker = "[CURRENT]" if role["is_current"] else " "
261 lines.append(f"{marker} {role['name']} - {role.get('description', 'no description')}")
262
263 lines.append("")
264 lines.append("=" * 60)
265 lines.append("Commands:")
266 lines.append(' Create: "create role roleB, direction: ..."')
267 lines.append(' Switch: "switch to roleB"')
268 lines.append(' Delete: "delete role roleA"')
269 lines.append("=" * 60)
270
271 return "\n".join(lines)
272
273
274def bind_chat_id(role_name: str, feishu_chat_id: str) -> Dict[str, Any]:
275 """
276 绑定飞书群 ID 到角色
277

Callers 1

process_role_commandFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected