omniwire 3.4.0 → 3.5.0
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/.omc/state/agent-replay-834b010e-b80d-4721-b297-777fbd0099c1.jsonl +3 -0
- package/.omc/state/hud-state.json +3 -3
- package/.omc/state/hud-stdin-cache.json +1 -1
- package/.omc/state/last-tool-error.json +7 -0
- package/.omc/state/subagent-tracking.json +7 -0
- package/.omniwire-state/update-state.json +1 -1
- package/README.md +202 -1
- package/clawhub-skill/SKILL.md +465 -187
- package/dist/mcp/server.js +58 -14
- package/dist/mcp/server.js.map +1 -1
- package/package.json +1 -1
package/dist/mcp/server.js
CHANGED
|
@@ -4175,13 +4175,25 @@ echo "port-knock configured: ${ports.join(' -> ')} -> port ${target}"`;
|
|
|
4175
4175
|
const target = targetNode ?? 'contabo';
|
|
4176
4176
|
// --- Action: install ---
|
|
4177
4177
|
if (action === 'install') {
|
|
4178
|
-
|
|
4179
|
-
|
|
4178
|
+
// Detect target OS for cross-platform install
|
|
4179
|
+
const targetOs = remoteNodes().find(n => n.id === target)?.os ?? 'linux';
|
|
4180
|
+
const pyCmd = targetOs === 'windows' ? 'python' : 'python3';
|
|
4181
|
+
const pipCmd = targetOs === 'windows' ? 'pip' : 'pip3';
|
|
4182
|
+
const installScript = targetOs === 'windows'
|
|
4183
|
+
? `${pipCmd} install --upgrade "scrapling[all]" 2>&1 | Select-Object -Last 3; scrapling install 2>&1 | Select-Object -Last 3; ${pyCmd} -c "import scrapling; print('scrapling', scrapling.__version__)" 2>&1`
|
|
4184
|
+
: `
|
|
4185
|
+
# Ensure Python 3.10+ and pip are available
|
|
4186
|
+
command -v ${pyCmd} &>/dev/null || { echo "ERROR: ${pyCmd} not found — install Python 3.10+"; exit 1; }
|
|
4187
|
+
command -v ${pipCmd} &>/dev/null || { ${pyCmd} -m ensurepip --upgrade 2>&1 | tail -1; }
|
|
4188
|
+
# Install/upgrade Scrapling and all dependencies
|
|
4189
|
+
${pipCmd} install --upgrade "scrapling[all]" 2>&1 | tail -3
|
|
4190
|
+
# Download/update Playwright + Camoufox browsers
|
|
4180
4191
|
scrapling install 2>&1 | tail -3
|
|
4181
|
-
|
|
4182
|
-
# Set up systemd service if
|
|
4183
|
-
if
|
|
4184
|
-
|
|
4192
|
+
${pyCmd} -c "import scrapling; print('scrapling', scrapling.__version__)" 2>&1
|
|
4193
|
+
# Set up systemd service if available
|
|
4194
|
+
if command -v systemctl &>/dev/null; then
|
|
4195
|
+
if [ ! -f /etc/systemd/system/scrapling-mcp.service ]; then
|
|
4196
|
+
cat > /etc/systemd/system/scrapling-mcp.service << 'UNIT'
|
|
4185
4197
|
[Unit]
|
|
4186
4198
|
Description=Scrapling MCP HTTP Server
|
|
4187
4199
|
After=network.target
|
|
@@ -4194,20 +4206,50 @@ Environment=HOME=/root
|
|
|
4194
4206
|
[Install]
|
|
4195
4207
|
WantedBy=multi-user.target
|
|
4196
4208
|
UNIT
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4209
|
+
systemctl daemon-reload
|
|
4210
|
+
systemctl enable scrapling-mcp
|
|
4211
|
+
systemctl start scrapling-mcp
|
|
4212
|
+
echo "systemd service created and started"
|
|
4213
|
+
else
|
|
4214
|
+
systemctl restart scrapling-mcp
|
|
4215
|
+
echo "systemd service restarted"
|
|
4216
|
+
fi
|
|
4217
|
+
elif command -v launchctl &>/dev/null; then
|
|
4218
|
+
# macOS: create launchd plist
|
|
4219
|
+
PLIST="/Library/LaunchDaemons/com.scrapling.mcp.plist"
|
|
4220
|
+
if [ ! -f "$PLIST" ]; then
|
|
4221
|
+
cat > "$PLIST" << 'PLIST'
|
|
4222
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
4223
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
4224
|
+
<plist version="1.0"><dict>
|
|
4225
|
+
<key>Label</key><string>com.scrapling.mcp</string>
|
|
4226
|
+
<key>ProgramArguments</key><array><string>/usr/local/bin/scrapling</string><string>mcp</string><string>--http</string><string>--port</string><string>8931</string></array>
|
|
4227
|
+
<key>RunAtLoad</key><true/>
|
|
4228
|
+
<key>KeepAlive</key><true/>
|
|
4229
|
+
</dict></plist>
|
|
4230
|
+
PLIST
|
|
4231
|
+
launchctl load "$PLIST"
|
|
4232
|
+
echo "launchd service created and loaded"
|
|
4233
|
+
else
|
|
4234
|
+
launchctl unload "$PLIST" 2>/dev/null; launchctl load "$PLIST"
|
|
4235
|
+
echo "launchd service reloaded"
|
|
4236
|
+
fi
|
|
4201
4237
|
else
|
|
4202
|
-
|
|
4203
|
-
|
|
4238
|
+
# Fallback: run in background with nohup
|
|
4239
|
+
nohup scrapling mcp --http --port 8931 &>/tmp/scrapling-mcp.log &
|
|
4240
|
+
echo "started in background (no service manager)"
|
|
4204
4241
|
fi`.trim();
|
|
4205
4242
|
const r = await manager.exec(target, installScript);
|
|
4206
4243
|
return okBrief(`Scrapling install on ${target}:\n${r.stdout.trim()}`);
|
|
4207
4244
|
}
|
|
4208
4245
|
// --- Action: status ---
|
|
4209
4246
|
if (action === 'status') {
|
|
4210
|
-
const
|
|
4247
|
+
const targetOs = remoteNodes().find(n => n.id === target)?.os ?? 'linux';
|
|
4248
|
+
const pyCmd = targetOs === 'windows' ? 'python' : 'python3';
|
|
4249
|
+
const statusScript = targetOs === 'windows'
|
|
4250
|
+
? `${pyCmd} -c "import scrapling; print('version:', scrapling.__version__)" 2>&1; curl -s --connect-timeout 2 http://localhost:8931/ 2>&1 | head -1`
|
|
4251
|
+
: `${pyCmd} -c "import scrapling; print('version:', scrapling.__version__)" 2>&1; systemctl is-active scrapling-mcp 2>/dev/null || (launchctl list com.scrapling.mcp 2>/dev/null && echo "launchd") || echo "no service manager"; curl -s --connect-timeout 2 http://localhost:8931/ 2>&1 | head -1 || echo "MCP server not reachable"`;
|
|
4252
|
+
const r = await manager.exec(target, statusScript);
|
|
4211
4253
|
return okBrief(`Scrapling on ${target}:\n${r.stdout.trim()}`);
|
|
4212
4254
|
}
|
|
4213
4255
|
// --- Action: scrape ---
|
|
@@ -4287,7 +4329,9 @@ print(json.dumps(results))
|
|
|
4287
4329
|
`.trim();
|
|
4288
4330
|
try {
|
|
4289
4331
|
// Route through VPN if requested, otherwise direct exec via WireGuard mesh
|
|
4290
|
-
|
|
4332
|
+
const targetOs = remoteNodes().find(n => n.id === target)?.os ?? 'linux';
|
|
4333
|
+
const pyCmd = targetOs === 'windows' ? 'python' : 'python3';
|
|
4334
|
+
let execCmd = `${pyCmd} -c ${JSON.stringify(script)}`;
|
|
4291
4335
|
if (via_vpn)
|
|
4292
4336
|
execCmd = buildVpnWrappedCmd(via_vpn, execCmd);
|
|
4293
4337
|
const r = await manager.exec(target, execCmd);
|