- gRPC dev_mode config: disables JWT auth, uses fixed dev identity - Agent prefix (agents.agent_prefix): dev agents use "dev-sol-orchestrator" to avoid colliding with production on shared Mistral accounts - Coding sessions use instructions (system prompt + coding addendum) with mistral-medium-latest for personality adherence - Conversations API: don't send both model + agent_id (422 fix) - GrpcState carries system_prompt + orchestrator_agent_id - Session.end() keeps session active for reuse (not "ended") - User messages posted as m.notice, assistant as m.text (role detection) - History loaded from Matrix room on session resume - Docker Compose local dev stack: OpenSearch 3 + Tuwunel + SearXNG - Dev config: localhost URLs, dev_mode, opensearch-init.sh for ML setup
50 lines
1.8 KiB
Bash
Executable File
50 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
## Bootstrap the local dev environment.
|
|
## Run after `docker compose -f docker-compose.dev.yaml up -d`
|
|
|
|
set -euo pipefail
|
|
|
|
HOMESERVER="http://localhost:8008"
|
|
USERNAME="sol"
|
|
PASSWORD="soldevpassword"
|
|
SERVER_NAME="sunbeam.local"
|
|
|
|
echo "Waiting for Tuwunel..."
|
|
until curl -sf "$HOMESERVER/_matrix/client/versions" > /dev/null 2>&1; do
|
|
sleep 1
|
|
done
|
|
echo "Tuwunel is ready."
|
|
|
|
echo "Registering @sol:$SERVER_NAME..."
|
|
RESPONSE=$(curl -s -X POST "$HOMESERVER/_matrix/client/v3/register" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{
|
|
\"username\": \"$USERNAME\",
|
|
\"password\": \"$PASSWORD\",
|
|
\"auth\": {\"type\": \"m.login.dummy\"}
|
|
}")
|
|
|
|
ACCESS_TOKEN=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin).get('access_token',''))" 2>/dev/null || true)
|
|
DEVICE_ID=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin).get('device_id',''))" 2>/dev/null || true)
|
|
|
|
if [ -z "$ACCESS_TOKEN" ]; then
|
|
echo "Registration failed (user may already exist). Trying login..."
|
|
RESPONSE=$(curl -s -X POST "$HOMESERVER/_matrix/client/v3/login" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{
|
|
\"type\": \"m.login.password\",
|
|
\"identifier\": {\"type\": \"m.id.user\", \"user\": \"$USERNAME\"},
|
|
\"password\": \"$PASSWORD\"
|
|
}")
|
|
ACCESS_TOKEN=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])")
|
|
DEVICE_ID=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['device_id'])")
|
|
fi
|
|
|
|
echo ""
|
|
echo "Add these to your .env or export them:"
|
|
echo ""
|
|
echo "export SOL_MATRIX_ACCESS_TOKEN=\"$ACCESS_TOKEN\""
|
|
echo "export SOL_MATRIX_DEVICE_ID=\"$DEVICE_ID\""
|
|
echo ""
|
|
echo "Then restart Sol: docker compose -f docker-compose.dev.yaml restart sol"
|