REFAC: Shift terminology to Autonomy and harden CLI via socat
This commit is contained in:
15
org-agent.sh
15
org-agent.sh
@@ -13,10 +13,15 @@ NC='\033[0m'
|
||||
command_exists() { command -v "$1" >/dev/null 2>&1; }
|
||||
|
||||
# 1. Try to drop straight into the CLI chat
|
||||
if command_exists nc && nc -z $HOST $PORT 2>/dev/null; then
|
||||
echo -e "${BLUE}Connected to sovereign brain at $HOST:$PORT...${NC}"
|
||||
echo "Type your message and press Enter. Ctrl+C to exit."
|
||||
echo "--------------------------------------------------"
|
||||
if command_exists socat && socat - TCP:$HOST:$PORT,connect-timeout=1 2>/dev/null; then
|
||||
echo -e "${BLUE}Connected to autonomous brain at $HOST:$PORT...${NC}"
|
||||
# Use socat with READLINE for history and arrow-key support.
|
||||
# It establishes a persistent bidirectional connection.
|
||||
socat READLINE,history=$HOME/.org_agent_history TCP:$HOST:$PORT
|
||||
exit 0
|
||||
elif command_exists nc && nc -z $HOST $PORT 2>/dev/null; then
|
||||
echo -e "${YELLOW}socat not found. Falling back to nc (no line-editing).${NC}"
|
||||
echo -e "${BLUE}Connected to autonomous brain at $HOST:$PORT...${NC}"
|
||||
while true; do
|
||||
read -p "User: " MESSAGE
|
||||
if [ -z "$MESSAGE" ]; then continue; fi
|
||||
@@ -86,7 +91,7 @@ fi
|
||||
|
||||
# 4. Zero-to-One Onboarding (No installation found)
|
||||
echo -e "${BLUE}==================================================${NC}"
|
||||
echo -e "${BLUE} org-agent: Sovereign Intelligence Onboarding ${NC}"
|
||||
echo -e "${BLUE} org-agent: Autonomous Intelligence Onboarding ${NC}"
|
||||
echo -e "${BLUE}==================================================${NC}"
|
||||
|
||||
# --- OS & Docker Detection ---
|
||||
|
||||
Reference in New Issue
Block a user