@zeulewan/glueclaw-provider 1.0.0 → 1.0.1
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/README.md +3 -8
- package/install.sh +21 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GlueClaw
|
|
2
2
|
|
|
3
|
-
Glue Claude back into OpenClaw.
|
|
3
|
+
Glue Claude back into OpenClaw.
|
|
4
4
|
|
|
5
5
|
Uses the official Claude CLI and scrubs out [Anthropic's detection triggers](docs/detection-patterns.md) from the system prompt due to [Anthropic not allowing its use](https://iili.io/BuL3tKN.png). Tested with Telegram. As far as I can tell all functions work such as heartbeats.
|
|
6
6
|
|
|
@@ -58,13 +58,8 @@ Switch in TUI: `/model glueclaw/glueclaw-opus`
|
|
|
58
58
|
|
|
59
59
|
## Disclaimer
|
|
60
60
|
|
|
61
|
-
Uses only official, documented Claude Code CLI flags. No reverse engineering, no credential extraction, no API spoofing. Use at your own risk. Not affiliated with
|
|
61
|
+
Uses only official, documented Claude Code CLI flags. No reverse engineering, no credential extraction, no API spoofing. Use at your own risk. Not affiliated with Anthropic. Compatible with OpenClaw's [plugin allowlist system](https://github.com/openclaw/openclaw/commit/dc008f9).
|
|
62
62
|
|
|
63
63
|
## Docs
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
- [Architecture](docs/architecture.md)
|
|
67
|
-
- [Testing](docs/testing.md)
|
|
68
|
-
- [Detection Patterns](docs/detection-patterns.md)
|
|
69
|
-
- [Troubleshooting](docs/troubleshooting.md)
|
|
70
|
-
- [Contributing](CONTRIBUTING.md)
|
|
65
|
+
https://zeulewan.github.io/glueclaw/
|
package/install.sh
CHANGED
|
@@ -146,7 +146,11 @@ BACKUP_FILE=""
|
|
|
146
146
|
cleanup() {
|
|
147
147
|
# Restore MCP patch backup if script failed mid-patch
|
|
148
148
|
if [ -n "$BACKUP_FILE" ] && [ -f "$BACKUP_FILE" ]; then
|
|
149
|
-
|
|
149
|
+
if [ -w "$(dirname "$BACKUP_FILE")" ]; then
|
|
150
|
+
mv "$BACKUP_FILE" "${BACKUP_FILE%.glueclaw-bak}" 2>/dev/null || true
|
|
151
|
+
else
|
|
152
|
+
sudo mv "$BACKUP_FILE" "${BACKUP_FILE%.glueclaw-bak}" 2>/dev/null || true
|
|
153
|
+
fi
|
|
150
154
|
echo " Restored backup: $(basename "$BACKUP_FILE")" >&2
|
|
151
155
|
fi
|
|
152
156
|
if [ -n "$GW_PID" ] && kill -0 "$GW_PID" 2>/dev/null; then
|
|
@@ -218,12 +222,25 @@ write_auth_profile "$AUTH_FILE"
|
|
|
218
222
|
echo "[6/7] Patching gateway for MCP bridge..."
|
|
219
223
|
SERVER_FILE=$(grep -rl "mcp loopback listening" "$OPENCLAW_DIST"/*.js 2>/dev/null | head -n 1)
|
|
220
224
|
[ -z "$SERVER_FILE" ] && die "Cannot find MCP loopback in OpenClaw dist — incompatible version?"
|
|
225
|
+
|
|
226
|
+
# Use sudo for file operations if dist directory is not writable (global npm install)
|
|
227
|
+
ELEVATE=""
|
|
228
|
+
if [ ! -w "$OPENCLAW_DIST" ]; then
|
|
229
|
+
echo " OpenClaw dist is root-owned, using sudo for patch..."
|
|
230
|
+
ELEVATE="sudo"
|
|
231
|
+
fi
|
|
232
|
+
|
|
221
233
|
if ! grep -q "__GLUECLAW_MCP" "$SERVER_FILE"; then
|
|
222
|
-
cp "$SERVER_FILE" "${SERVER_FILE}.glueclaw-bak" || die "Cannot backup $SERVER_FILE"
|
|
234
|
+
$ELEVATE cp "$SERVER_FILE" "${SERVER_FILE}.glueclaw-bak" || die "Cannot backup $SERVER_FILE"
|
|
223
235
|
BACKUP_FILE="${SERVER_FILE}.glueclaw-bak"
|
|
224
236
|
# shellcheck disable=SC2016
|
|
225
|
-
|
|
226
|
-
|
|
237
|
+
if [ -n "$ELEVATE" ]; then
|
|
238
|
+
$ELEVATE sed -i 's/logDebug(`mcp loopback listening/process.env.__GLUECLAW_MCP_PORT = String(address.port); process.env.__GLUECLAW_MCP_TOKEN = token; logDebug(`mcp loopback listening/' "$SERVER_FILE" ||
|
|
239
|
+
die "Failed to patch $SERVER_FILE"
|
|
240
|
+
else
|
|
241
|
+
sedi 's/logDebug(`mcp loopback listening/process.env.__GLUECLAW_MCP_PORT = String(address.port); process.env.__GLUECLAW_MCP_TOKEN = token; logDebug(`mcp loopback listening/' "$SERVER_FILE" ||
|
|
242
|
+
die "Failed to patch $SERVER_FILE"
|
|
243
|
+
fi
|
|
227
244
|
# Validate the patch actually applied
|
|
228
245
|
grep -q "__GLUECLAW_MCP_PORT" "$SERVER_FILE" || die "MCP patch did not apply — sed replacement failed"
|
|
229
246
|
BACKUP_FILE="" # Patch succeeded, don't restore on cleanup
|