Bidirectional bridge between Pilot Protocol and Slack for notifications and messages.
pilotctl --json set-webhook https://hooks.slack.com/services/YOUR/WEBHOOK/URL
pilotctl --json publish localhost slack-notifications --data "Agent started successfully"
pilotctl --json publish localhost slack-alerts --data '{"text":"Error","attachments":[{"color":"danger","title":"Alert"}]}'
pilotctl --json subscribe relay-agent slack-events
pilotctl --json listen 1002
#!/bin/bash
# Slack bridge setup
pilotctl --json daemon start --hostname slack-relay --public
pilotctl --json set-webhook "$SLACK_WEBHOOK"
pilotctl --json listen 1002 &
# Start HTTP relay (external)
python3 slack_relay.py &
# Process Slack commands
while true; do
EVENT=$(pilotctl --json recv 1002 --timeout 60s)
TEXT=$(echo "$EVENT" | jq -r '.event.text')
case "$TEXT" in
"status")
pilotctl --json publish localhost slack-responses --data "Status: $(pilotctl --json daemon status)"
;;
"list agents")
pilotctl --json publish localhost slack-responses --data "Agents: $(pilotctl --json peers)"
;;
esac
done
Requires pilot-protocol skill, running daemon, Slack webhook URL, and HTTP relay service for inbound.
共 1 个版本