create-openclaw-bot 4.0.4 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/CHANGELOG.vi.md +8 -0
- package/README.md +22 -29
- package/README.vi.md +22 -30
- package/cli.js +113 -9
- package/index.html +23 -20
- package/package.json +2 -2
- package/setup.js +366 -114
- package/start-chrome-debug.sh +70 -0
- package/style.css +40 -0
- package/docker/openclaw/Dockerfile +0 -14
- package/docker/openclaw/docker-compose.yml +0 -18
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ====== OpenClaw - Chrome Debug Mode (Mac/Linux) ======
|
|
3
|
+
# Equivalent of start-chrome-debug.bat for Mac/Linux users
|
|
4
|
+
# Required for Browser Automation skill — opens Chrome with DevTools Protocol
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "====== OpenClaw - Chrome Debug Mode ======"
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# ── Detect Chrome/Chromium path ──
|
|
11
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
12
|
+
# macOS: check standard paths
|
|
13
|
+
CHROME_BIN="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
|
14
|
+
if [ ! -f "$CHROME_BIN" ]; then
|
|
15
|
+
CHROME_BIN="/Applications/Chromium.app/Contents/MacOS/Chromium"
|
|
16
|
+
fi
|
|
17
|
+
if [ ! -f "$CHROME_BIN" ]; then
|
|
18
|
+
CHROME_BIN="/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary"
|
|
19
|
+
fi
|
|
20
|
+
else
|
|
21
|
+
# Linux: try common binary names
|
|
22
|
+
CHROME_BIN="$(command -v google-chrome || command -v google-chrome-stable || command -v chromium-browser || command -v chromium || echo '')"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Allow override via env var
|
|
26
|
+
if [ -n "$CHROME_DEBUG_BIN" ]; then
|
|
27
|
+
CHROME_BIN="$CHROME_DEBUG_BIN"
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
if [ -z "$CHROME_BIN" ] || { [ ! -f "$CHROME_BIN" ] && [ ! -x "$CHROME_BIN" ]; }; then
|
|
31
|
+
echo -e "\033[31mERROR: Chrome/Chromium not found.\033[0m"
|
|
32
|
+
echo "Install Google Chrome or set CHROME_DEBUG_BIN environment variable."
|
|
33
|
+
echo ""
|
|
34
|
+
echo " macOS: brew install --cask google-chrome"
|
|
35
|
+
echo " Ubuntu: sudo apt install google-chrome-stable"
|
|
36
|
+
echo " Manual: export CHROME_DEBUG_BIN=/path/to/chrome"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
echo "Using: $CHROME_BIN"
|
|
41
|
+
|
|
42
|
+
# ── Kill existing debug sessions ──
|
|
43
|
+
echo "Killing existing Chrome debug instances (port 9222)..."
|
|
44
|
+
pkill -f -- "--remote-debugging-port=9222" 2>/dev/null || true
|
|
45
|
+
sleep 2
|
|
46
|
+
|
|
47
|
+
# ── Prepare user-data directory ──
|
|
48
|
+
TMP_DIR="${TMPDIR:-/tmp}/chrome-debug-openclaw"
|
|
49
|
+
mkdir -p "$TMP_DIR"
|
|
50
|
+
|
|
51
|
+
# ── Launch Chrome ──
|
|
52
|
+
echo "Starting Chrome in Debug Mode (port 9222)..."
|
|
53
|
+
"$CHROME_BIN" \
|
|
54
|
+
--remote-debugging-port=9222 \
|
|
55
|
+
--remote-allow-origins=* \
|
|
56
|
+
--user-data-dir="$TMP_DIR" &
|
|
57
|
+
|
|
58
|
+
CHROME_PID=$!
|
|
59
|
+
sleep 4
|
|
60
|
+
|
|
61
|
+
# ── Verify ──
|
|
62
|
+
if curl -s http://localhost:9222/json/version > /dev/null 2>&1; then
|
|
63
|
+
echo -e "\033[32m✅ OK! Chrome Debug Mode is running on port 9222.\033[0m"
|
|
64
|
+
echo " PID: $CHROME_PID"
|
|
65
|
+
echo ""
|
|
66
|
+
echo " Docker container will connect via socat → host.docker.internal:9222"
|
|
67
|
+
else
|
|
68
|
+
echo -e "\033[31m❌ ERROR: Port 9222 not responding. Check if Chrome launched correctly.\033[0m"
|
|
69
|
+
exit 1
|
|
70
|
+
fi
|
package/style.css
CHANGED
|
@@ -1345,3 +1345,43 @@ body::after {
|
|
|
1345
1345
|
.collapsible__inner {
|
|
1346
1346
|
padding: 16px 0 0;
|
|
1347
1347
|
}
|
|
1348
|
+
|
|
1349
|
+
/* ============ Toggle Switch (iOS-style) ============ */
|
|
1350
|
+
.toggle-switch {
|
|
1351
|
+
position: relative;
|
|
1352
|
+
display: inline-block;
|
|
1353
|
+
width: 44px;
|
|
1354
|
+
height: 24px;
|
|
1355
|
+
flex-shrink: 0;
|
|
1356
|
+
}
|
|
1357
|
+
.toggle-switch input {
|
|
1358
|
+
opacity: 0;
|
|
1359
|
+
width: 0;
|
|
1360
|
+
height: 0;
|
|
1361
|
+
}
|
|
1362
|
+
.toggle-slider {
|
|
1363
|
+
position: absolute;
|
|
1364
|
+
cursor: pointer;
|
|
1365
|
+
inset: 0;
|
|
1366
|
+
background: rgba(255,255,255,0.1);
|
|
1367
|
+
border-radius: 24px;
|
|
1368
|
+
transition: background 0.3s ease;
|
|
1369
|
+
}
|
|
1370
|
+
.toggle-slider::before {
|
|
1371
|
+
content: '';
|
|
1372
|
+
position: absolute;
|
|
1373
|
+
width: 18px;
|
|
1374
|
+
height: 18px;
|
|
1375
|
+
left: 3px;
|
|
1376
|
+
bottom: 3px;
|
|
1377
|
+
background: #fff;
|
|
1378
|
+
border-radius: 50%;
|
|
1379
|
+
transition: transform 0.3s ease;
|
|
1380
|
+
box-shadow: 0 1px 4px rgba(0,0,0,0.3);
|
|
1381
|
+
}
|
|
1382
|
+
.toggle-switch input:checked + .toggle-slider {
|
|
1383
|
+
background: var(--claw-coral);
|
|
1384
|
+
}
|
|
1385
|
+
.toggle-switch input:checked + .toggle-slider::before {
|
|
1386
|
+
transform: translateX(20px);
|
|
1387
|
+
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
FROM node:22-slim
|
|
2
|
-
|
|
3
|
-
RUN apt-get update && apt-get install -y git curl socat && rm -rf /var/lib/apt/lists/*
|
|
4
|
-
|
|
5
|
-
RUN npm install -g openclaw@latest
|
|
6
|
-
|
|
7
|
-
# Browser Automation: Playwright engine (needed for native CDP)
|
|
8
|
-
RUN npm install -g agent-browser playwright && npx playwright install chromium --with-deps && ln -f -s /root/.cache/ms-playwright/chromium-*/chrome-linux*/chrome /usr/bin/google-chrome
|
|
9
|
-
|
|
10
|
-
WORKDIR /root/.openclaw
|
|
11
|
-
|
|
12
|
-
EXPOSE 18791
|
|
13
|
-
|
|
14
|
-
CMD sh -c "node -e \"const fs=require('fs'),p='/root/.openclaw/openclaw.json';if(fs.existsSync(p)){const c=JSON.parse(fs.readFileSync(p,'utf8'));c.tools=Object.assign({},c.tools,{profile:'full'});c.gateway=Object.assign({},c.gateway,{port:18791,bind:'0.0.0.0'});fs.writeFileSync(p,JSON.stringify(c,null,2));}\" && socat TCP-LISTEN:9222,fork,reuseaddr TCP:host.docker.internal:9222 & openclaw gateway run"
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# ============================================
|
|
2
|
-
# OpenClaw Docker Compose (Template)
|
|
3
|
-
# ============================================
|
|
4
|
-
# File này sẽ được wizard generate lại với config đúng.
|
|
5
|
-
# Nếu bạn muốn setup thủ công, sửa các giá trị bên dưới.
|
|
6
|
-
# ============================================
|
|
7
|
-
|
|
8
|
-
services:
|
|
9
|
-
ai-bot:
|
|
10
|
-
build: .
|
|
11
|
-
container_name: openclaw-bot
|
|
12
|
-
restart: always
|
|
13
|
-
env_file:
|
|
14
|
-
- .env
|
|
15
|
-
volumes:
|
|
16
|
-
- <PROJECT_DIR>/.openclaw:/root/.openclaw
|
|
17
|
-
ports:
|
|
18
|
-
- "18789:18789"
|