(value: Any)
| 1853 | roles.append( |
| 1854 | { |
| 1855 | "name": role.get("name"), |
| 1856 | "user_id": role.get("user_id"), |
| 1857 | "description": role.get("description", ""), |
| 1858 | "is_current": bool(role.get("is_current")), |
| 1859 | } |
| 1860 | ) |
| 1861 | return {"roles": roles, "current_role": result.get("current_role")} |
| 1862 | |
| 1863 | |
| 1864 | def create_role(role_name: str, description: str = "", feishu_chat_id: str = "") -> Dict[str, Any]: |
| 1865 | role_name = str(role_name or "").strip() |
| 1866 | if not role_name: |
| 1867 | raise ValueError("role_name is required") |
| 1868 | result = role_manager.create_role( |
| 1869 | role_name=role_name, |
| 1870 | description=str(description or "").strip(), |
| 1871 | natural_language=str(description or "").strip(), |
| 1872 | feishu_chat_id=str(feishu_chat_id or "").strip() or None, |
| 1873 | ) |
| 1874 | return {"result": result, **list_roles()} |
| 1875 |
no test coverage detected