Files
blackroad/bin/br-slack
Alexa Amundson 9b10326c78
Some checks failed
Lint & Format / detect (push) Has been cancelled
Lint & Format / js-lint (push) Has been cancelled
Lint & Format / py-lint (push) Has been cancelled
Lint & Format / sh-lint (push) Has been cancelled
Lint & Format / go-lint (push) Has been cancelled
Monorepo Lint / lint-shell (push) Has been cancelled
Monorepo Lint / lint-js (push) Has been cancelled
sync: 2026-03-16 21:30 — 17 files from Alexandria
RoadChain-SHA2048: 608d6fd1f55acb3f
RoadChain-Identity: alexa@sovereign
RoadChain-Full: 608d6fd1f55acb3f324fbe05e50e200b26c50a20a590ebcc982bade81d3392a1f19a7052d53e8b247fdb70554b97297d020df3de5a4d4d99415462afaa3d2c73006b0e038a62ce7b44fa95b76a39ad087bfe16043e535a6dc24304520777fd99a4d386987f028a774bd63b66729b7a4f00bd65bd55022f425595ccbc50eb7f27c6072a6a1324d613e019c0635d30a06127934eeb7540cfca85e9706d28f189c0c667145d08ec2e34f588662b83074f86ba5d728ed658edbaf3187b32b0da919640ee3acb6fdbc5aa6e45f198d2f569effbafa430f08d0f98dd487ca9ed29e8f5dadfc85b4f256ebcdb7702b12cfec4292585d477d1c7ff8918092a9ed5643b97
2026-03-16 21:30:02 -05:00

17 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
SLACK_API="https://blackroad-slack.amundsonalexa.workers.dev"
NODE_NAME="alexandria"
P='\033[38;5;205m'; G='\033[38;5;82m'; R='\033[0m'
case "${1:-help}" in
say|post) curl -s -X POST "$SLACK_API/post" -H 'Content-Type: application/json' -d "{\"text\":\"*${NODE_NAME}:* ${*:2}\"}" >/dev/null; echo -e "${G}${R} Posted";;
alert) curl -s -X POST "$SLACK_API/alert" -H 'Content-Type: application/json' -d "{\"text\":\"*${NODE_NAME}:* ${*:2}\"}" >/dev/null; echo -e "${G}${R} Alert sent";;
ask) curl -s -X POST "$SLACK_API/ask" -H 'Content-Type: application/json' -d "{\"agent\":\"${2:-road}\",\"message\":\"${*:3}\",\"slack\":true}" | python3 -c "import sys,json;print(json.load(sys.stdin).get('reply','?'))" 2>/dev/null;;
collab) curl -s -X POST "$SLACK_API/collab" -H 'Content-Type: application/json' -d "{\"type\":\"announce\",\"session_id\":\"${NODE_NAME}-$(date +%s)\",\"message\":\"${*:2}\"}" >/dev/null; echo -e "${G}${R} Sent";;
til) curl -s -X POST "$SLACK_API/memory" -H 'Content-Type: application/json' -H 'User-Agent: BlackRoad-Pi/1.0' -d "{\"type\":\"til\",\"category\":\"${2:-tip}\",\"learning\":\"${*:3}\",\"broadcaster\":\"$NODE_NAME\"}" >/dev/null; echo -e "${G}${R} TIL";;
log) curl -s -X POST "$SLACK_API/memory" -H 'Content-Type: application/json' -H 'User-Agent: BlackRoad-Pi/1.0' -d "{\"type\":\"journal\",\"action\":\"${2:-log}\",\"entity\":\"${3:-?}\",\"details\":\"${*:4}\",\"source\":\"$NODE_NAME\"}" >/dev/null; echo -e "${G}${R} Logged";;
health) curl -s "$SLACK_API/health" | python3 -m json.tool 2>/dev/null;;
agents) curl -s "$SLACK_API/agents" | python3 -c "import json,sys;[print(f'{a[\"emoji\"]} {a[\"name\"]:14} — {a[\"role\"]}') for a in json.load(sys.stdin)['agents']];print()" 2>/dev/null;;
status) curl -s "$SLACK_API/memory/stats" | python3 -m json.tool 2>/dev/null;;
*) echo -e "${P}br-slack${R} — say|alert|ask|collab|til|log|health|agents|status";;
esac