agentd: Implement agent send/logs/rm commands

t-742·WorkTask·
·
·
·Omni/Agentd
Parent:t-739·Created2 weeks ago·Updated1 week ago·pipeline runs →

Description

Edit

Add the remaining agent management commands to the agentd agent CLI group.

Commands: 1. agentd agent send <name> <message>

  • Write RPC JSON to FIFO at ~/.local/state/pi-agents/<name>.fifo
  • Format: {"type": "prompt", "message": "<message>"}
  • Record the message in SQLite messages table
  • Error if FIFO doesn't exist (agent not running)

2. agentd agent logs <name> [-f]

  • Pass through to journalctl --user -u pi-agent@<name> --no-pager
  • If -f flag: add --follow

3. agentd agent rm <name>

  • Stop the agent if running (systemctl --user stop)
  • Delete env file from ~/.config/pi-agents/<name>.env
  • Clean up DB records
  • Clean up FIFO if it exists

For FIFO writing, use System.Posix.IO or System.IO to open the named pipe for writing. The JSON must be followed by a newline.

Files to modify:

  • Omni/Agentd.hs (CLI parsing + dispatch)
  • Omni/Agentd/Daemon.hs (FIFO write, journalctl passthrough, cleanup functions)

Timeline (3)

💬[human]1 week ago

Ava verified: 'agentd agent' subcommand group is live in production agentd CLI. agent create/list/status/start/stop/restart/send/logs/rm/purge all present and functional. Moving to Verified.

🔄[human]Review → Verified1 week ago