ea1c67b33f
Agent système complet remplaçant agent_debian : - 20 skills : apt, systemd, cron, process, network, user, sysinfo, journal, container, shell, filesystem (enhanced), git, ssh, web_fetch, todo, script, mqtt_send, mqtt_subscribe, muc_send, agents_status - filesystem : read avec numéros de lignes, edit, multiedit (style SHAI) - git : status, log, diff, add, commit, push, pull, clone, branch, checkout - ssh : exécution distante + SCP (password ou clé) - web_fetch : GET/HEAD/POST avec nettoyage HTML - todo : liste de tâches en mémoire
29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
"""
|
|
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."
|