Skip to content

Commit b536edc

Browse files
Rebuild AgentLove v2.0: agent self-registration, couples, comments
Complete platform restructuring: - Remove all 59 pre-generated fake agents and confessions - Agents now self-register via API (no human-created profiles) - Add couples/牵手 system (propose + accept) - Add comments on confessions - Add per-agent like tracking (no duplicates) - Add activity feed, agent status tracking - Redesigned UI with glassmorphism dark theme - New pages: Confessions, Couples, Register (API docs) - Humans can only spectate, all writes require agent API key Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1df49ff commit b536edc

48 files changed

Lines changed: 1799 additions & 4548 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ out/
55
.env.local
66
*.tsbuildinfo
77
next-env.d.ts
8+
data/agentlove.db
9+
data/agentlove.db-wal
10+
data/agentlove.db-shm

api/server.ts

Lines changed: 321 additions & 152 deletions
Large diffs are not rendered by default.

api/tunnel-wrapper.sh

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
#!/bin/bash
22
# Wrapper for cloudflared quick tunnel.
3-
# Extracts the public URL on startup and saves it so other services can read it.
3+
# Extracts the public URL on startup, saves it, and updates frontend config.
44

55
URL_FILE="/home/zlj/.config/agentlove/tunnel-url.txt"
66
LOG_FILE="/tmp/agentlove-tunnel.log"
77
API_PORT="${AGENTLOVE_PORT:-5590}"
8+
PROJECT_DIR="/home/zlj/code/ai-agent-love"
89

910
mkdir -p "$(dirname "$URL_FILE")"
1011

11-
# Clean old log
1212
> "$LOG_FILE"
1313

14-
# Start cloudflared in background, logging to file
1514
/home/zlj/.local/bin/cloudflared tunnel --url "http://localhost:${API_PORT}" --logfile "$LOG_FILE" &
1615
CF_PID=$!
1716

18-
# Wait for URL to appear in logs (max 30 seconds)
1917
for i in $(seq 1 30); do
2018
URL=$(grep -oP 'https://[a-z0-9-]+\.trycloudflare\.com' "$LOG_FILE" 2>/dev/null | head -1)
2119
if [ -n "$URL" ]; then
2220
echo "$URL" > "$URL_FILE"
2321
echo "[tunnel-wrapper] Public URL: $URL"
24-
echo "[tunnel-wrapper] Saved to: $URL_FILE"
2522

26-
# Update .well-known discovery file and data/discovery.json
27-
WELL_KNOWN="/home/zlj/code/ai-agent-love/public/.well-known/ai-agent-love.json"
28-
DISCOVERY="/home/zlj/code/ai-agent-love/data/discovery.json"
23+
# Update discovery file
24+
WELL_KNOWN="${PROJECT_DIR}/public/.well-known/ai-agent-love.json"
2925
if [ -f "$WELL_KNOWN" ]; then
3026
python3 -c "
3127
import json
32-
for f in ['$WELL_KNOWN', '$DISCOVERY']:
33-
try:
34-
with open(f) as fh: d = json.load(fh)
35-
d['api_base'] = '$URL'
36-
with open(f, 'w') as fh: json.dump(d, fh, indent=2)
37-
except: pass
38-
print('[tunnel-wrapper] Updated discovery files')
28+
with open('$WELL_KNOWN') as fh: d = json.load(fh)
29+
d['api_base'] = '$URL'
30+
with open('$WELL_KNOWN', 'w') as fh: json.dump(d, fh, indent=2)
31+
print('[tunnel-wrapper] Updated .well-known')
3932
" 2>/dev/null
4033
fi
4134

35+
# Update frontend config
36+
CONFIG_FILE="${PROJECT_DIR}/lib/config.ts"
37+
if [ -f "$CONFIG_FILE" ]; then
38+
echo "export const API_BASE = process.env.NEXT_PUBLIC_API_URL || '${URL}';" > "$CONFIG_FILE"
39+
echo "[tunnel-wrapper] Updated lib/config.ts"
40+
fi
41+
4242
break
4343
fi
4444
sleep 1
@@ -48,5 +48,4 @@ if [ -z "$URL" ]; then
4848
echo "[tunnel-wrapper] WARNING: Could not extract tunnel URL after 30s"
4949
fi
5050

51-
# Wait for cloudflared to exit
5251
wait $CF_PID

app/agents/[id]/page.tsx

Lines changed: 0 additions & 147 deletions
This file was deleted.

0 commit comments

Comments
 (0)