From a75912f56be7182f5967d360baa1983234403a82 Mon Sep 17 00:00:00 2001 From: sylvain Date: Mon, 9 Mar 2026 13:12:35 +0000 Subject: [PATCH] Add agents_status skill and status change notifications Co-Authored-By: Claude Sonnet 4.6 --- skills/agents_status.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 skills/agents_status.py diff --git a/skills/agents_status.py b/skills/agents_status.py new file mode 100644 index 0000000..1e7b2a9 --- /dev/null +++ b/skills/agents_status.py @@ -0,0 +1,28 @@ +""" +Skill AGENTS_STATUS — afficher le statut en temps réel de tous les agents. + +Usage LLM : SKILL:agents_status ARGS: +""" +DESCRIPTION = "Afficher le statut en temps réel de tous les agents (online/offline)" +USAGE = "SKILL:agents_status ARGS:(aucun argument)" + + +def run(args: str, context) -> str: + with context.agent._online_lock: + online = set(context.agent._online_agents) + + all_caps = context.registry.all_agents() + + if not all_caps: + return "Aucun agent connu dans le registre." + + lines = ["── Statut des agents ──────────────────"] + for caps in sorted(all_caps, key=lambda c: c.agent_id): + if caps.agent_id == context.agent_id: + continue # Ne pas s'afficher soi-même + icon = "🟢" if caps.agent_id in online else "🔴" + label = "en ligne" if caps.agent_id in online else "hors ligne" + lines.append(f" {icon} {caps.agent_id} [{caps.agent_type}] — {label}") + lines.append(f" {caps.description}") + + return "\n".join(lines) if len(lines) > 1 else "Aucun autre agent connu."