Add Agent Mail multi-workspace deployment guide and scripts

- docs/AGENT_MAIL_DEPLOYMENT.md: 10-step deployment plan for 13 workspaces
- docs/AGENT_MAIL_MULTI_WORKSPACE_SETUP.md: Architecture and configuration guide
- scripts/setup-agent-mail-workspace.sh: Auto-configure .envrc per workspace
- scripts/start-agent-mail-server.sh: Start Agent Mail server
- scripts/stop-agent-mail-server.sh: Stop Agent Mail server
- scripts/agent-mail-status.sh: Monitor server and all channels

Supports 3-channel setup: beads.dev, vc.dev, wyvern.dev
Ready for 0.23.0 deployment with Agent Mail integration

Amp-Thread-ID: https://ampcode.com/threads/T-bc960efb-3ddc-4635-8c8e-a42a6e9e67d9
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-08 04:16:44 -08:00
parent 9c5bf2c1eb
commit bbe73d54bc
6 changed files with 1264 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
#!/bin/bash
# Stop Agent Mail server
# Usage: ./stop-agent-mail-server.sh
PID_FILE="${AGENT_MAIL_PID:-$HOME/agent-mail.pid}"
if [[ ! -f "$PID_FILE" ]]; then
echo "⚠️ No PID file found: $PID_FILE"
echo " Attempting to kill by process name..."
if pkill -f "mcp_agent_mail.cli serve-http"; then
echo "✅ Killed Agent Mail server by process name"
else
echo " No Agent Mail server process found"
fi
exit 0
fi
PID=$(cat "$PID_FILE")
if ! ps -p "$PID" > /dev/null 2>&1; then
echo "⚠️ Process $PID not running (stale PID file)"
rm -f "$PID_FILE"
exit 0
fi
echo "🛑 Stopping Agent Mail server (PID: $PID)..."
kill "$PID"
# Wait for graceful shutdown
for i in {1..5}; do
if ! ps -p "$PID" > /dev/null 2>&1; then
echo "✅ Server stopped gracefully"
rm -f "$PID_FILE"
exit 0
fi
sleep 1
done
# Force kill if needed
if ps -p "$PID" > /dev/null 2>&1; then
echo "⚠️ Server didn't stop gracefully, forcing..."
kill -9 "$PID"
sleep 1
fi
if ! ps -p "$PID" > /dev/null 2>&1; then
echo "✅ Server stopped (forced)"
rm -f "$PID_FILE"
else
echo "❌ Failed to stop server"
exit 1
fi