From 1d07a0c2556e543467f4a50c5b1534d9e19cb6c5 Mon Sep 17 00:00:00 2001 From: denis defolie Date: Tue, 6 Oct 2026 14:27:41 +0200 Subject: [PATCH] make-agent --- README-EN.md | 6 +++--- README.md | 6 +++--- agent/Makefile | 2 +- agent/agent.yaml.example | 2 +- agent/voice-agent.service | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README-EN.md b/README-EN.md index 18acec0..2ce6168 100644 --- a/README-EN.md +++ b/README-EN.md @@ -207,7 +207,7 @@ cd ~/voice-agent-install sudo make install # 3. Configure -sudo nano /etc/voice-agent/agent.yaml +sudo nano /etc/voice-assistant/agent.yaml # id: pc-bureau ← name used in MQTT topics # mqtt.host: 192.168.1.104 ← broker IP address # dry_run: false ← true to test without executing anything @@ -283,7 +283,7 @@ Current step: **15b — Linux machines on the network**. Steps 1 to 15 are valid "Hey Mycroft, éteins le PC du bureau": each machine runs an **agent** ([agent/voice_agent.py](agent/voice_agent.py)), a small MQTT client that only runs -the actions in **its own** list (`/etc/voice-agent/agent.yaml`): fixed commands, +the actions in **its own** list (`/etc/voice-assistant/agent.yaml`): fixed commands, no shell. The server only sends an action name. "Allume" wakes a machine that is off through **Wake-on-LAN** (a network packet received by the sleeping network card). @@ -298,7 +298,7 @@ off through **Wake-on-LAN** (a network packet received by the sleeping network c 2. `make run`, then "Hey Mycroft, éteins le PC du bureau" → confirmation → "oui": the agent prints `essai : systemctl poweroff (non execute)`. 3. Real machine: copy `agent/` to it, `make -C agent install`, edit - `/etc/voice-agent/agent.yaml`, and name it in `server/config.yaml` (`machines.list`). + `/etc/voice-assistant/agent.yaml`, and name it in `server/config.yaml` (`machines.list`). **Anonymous broker**: any device on the network can then publish on `agent//command`. In production, use the accounts and rights of step 15 (`mosquitto/acl` has the agent rules). diff --git a/README.md b/README.md index c9be78d..f217bd0 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ cd ~/voice-agent sudo make install # 3. Configurer -sudo nano /etc/voice-agent/agent.yaml +sudo nano /etc/voice-assistant/agent.yaml # id: pc-bureau ← nom dans les topics MQTT # mqtt.host: 192.168.1.104 ← adresse IP du broker # dry_run: false ← true pour tester sans rien exécuter @@ -284,7 +284,7 @@ L'état exact du projet, étape par étape, est dans **[CONTEXT.md](CONTEXT.md)* « Hey Mycroft, éteins le PC du bureau » : chaque machine fait tourner un **agent** ([agent/voice_agent.py](agent/voice_agent.py)), petit client MQTT qui n'exécute que -les actions de **sa** liste (`/etc/voice-agent/agent.yaml`), commandes fixes, sans +les actions de **sa** liste (`/etc/voice-assistant/agent.yaml`), commandes fixes, sans shell. Le serveur n'envoie qu'un nom d'action. « Allume » réveille une machine éteinte par **Wake-on-LAN** (paquet réseau reçu par la carte réseau en veille). @@ -299,7 +299,7 @@ shell. Le serveur n'envoie qu'un nom d'action. « Allume » réveille une machin 2. `make run`, puis « Hey Mycroft, éteins le PC du bureau » → confirmation → « oui » : l'agent affiche `essai : systemctl poweroff (non execute)`. 3. Machine réelle : copier `agent/` dessus, `make -C agent install`, régler - `/etc/voice-agent/agent.yaml`, et la nommer dans `server/config.yaml` (`machines.list`). + `/etc/voice-assistant/agent.yaml`, et la nommer dans `server/config.yaml` (`machines.list`). **Broker anonyme** : tout appareil du réseau peut alors publier sur `agent//command`. En production, les comptes et droits de l'étape 15 (`mosquitto/acl` contient les règles des agents). diff --git a/agent/Makefile b/agent/Makefile index 1c7d829..5172203 100644 --- a/agent/Makefile +++ b/agent/Makefile @@ -4,7 +4,7 @@ SHELL := /bin/bash PREFIX := /opt/voice-agent -CONFIG_DIR := /etc/voice-agent +CONFIG_DIR := /etc/voice-assistant # Mêmes versions que le serveur (server/pyproject.toml). DEPS := paho-mqtt==2.1.0 PyYAML==6.0.2 diff --git a/agent/agent.yaml.example b/agent/agent.yaml.example index 3a76ae5..134ecc2 100644 --- a/agent/agent.yaml.example +++ b/agent/agent.yaml.example @@ -1,6 +1,6 @@ # Agent de l'assistant vocal (étape 15b) : UNE machine Linux commandée par la voix. # -# Installé par « make agent-install » dans /etc/voice-agent/agent.yaml (lisible par root +# Installé par « make agent-install » dans /etc/voice-assistant/agent.yaml (lisible par root # seulement : il peut contenir un mot de passe MQTT). Après modification : # sudo systemctl restart voice-agent # diff --git a/agent/voice-agent.service b/agent/voice-agent.service index 805d667..2b284bf 100644 --- a/agent/voice-agent.service +++ b/agent/voice-agent.service @@ -5,7 +5,7 @@ After=network-online.target Wants=network-online.target [Service] -ExecStart=/opt/voice-agent/.venv/bin/python /opt/voice-agent/voice_agent.py --config /etc/voice-agent/agent.yaml +ExecStart=/opt/voice-agent/.venv/bin/python /opt/voice-agent/voice_agent.py --config /etc/voice-assistant/agent.yaml # Relancé s'il s'arrête (broker absent au démarrage, plantage...) : l'agent doit toujours répondre. Restart=always RestartSec=5