Files
agents_and_robots/dev-scripts/remove.sh
T
egutierrez bd8e1432e5 feat: add assistant bot with LLM integration and configuration
- Implemented the assistant bot with basic command handling and LLM routing.
- Created configuration file for the assistant bot with personality, behavior, and LLM settings.
- Added system prompt for the assistant bot to define its capabilities and limitations.
- Developed registration script for creating Matrix bot users via Synapse admin API.
- Introduced common development scripts for agent management (start, stop, list, logs).
- Scaffolded new agent creation script to streamline the addition of new agents.
- Implemented agent removal script to disable agents without deleting data.
2026-03-03 23:57:13 +00:00

42 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# remove.sh — deshabilita un agente (enabled: false). No borra datos.
#
# Uso:
# ./dev-scripts/remove.sh assistant-bot
source "$(dirname "$0")/_common.sh"
need_arg "${1:-}"
TARGET="$1"
found=false
while IFS='|' read -r id _version _enabled _desc cfg; do
[[ "$id" != "$TARGET" ]] && continue
found=true
# Detener si está corriendo
if is_running "$id"; then
local_pid="$(read_pid "$id")"
info "Deteniendo $id (PID $local_pid)..."
kill -TERM "$local_pid" 2>/dev/null || true
sleep 1
kill -0 "$local_pid" 2>/dev/null && kill -9 "$local_pid" 2>/dev/null || true
rm -f "$(pid_file "$id")"
ok "$id detenido"
fi
# Marcar como disabled en el config (reemplaza solo la primera ocurrencia)
if grep -q 'enabled: true' "$cfg"; then
# sed compatible con Linux y macOS
sed -i 's/enabled: true/enabled: false/' "$cfg"
ok "$id marcado como disabled en $cfg"
else
warn "$id ya estaba marcado como disabled"
fi
dim " Datos preservados en agents/$id/data/"
done < <(list_agents_raw)
"$found" || fail "Agente '$TARGET' no encontrado"