Uname:Linux antigravity-cli 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64

Base Dir : /var/www/moonbloom

User : wp-moonbloom


403WebShell
403Webshell
Server IP : 85.155.190.233  /  Your IP : 216.73.216.103
Web Server : nginx/1.24.0
System : Linux antigravity-cli 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User : wp-moonbloom ( 1001)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /opt/Gemini_Swarm_Core/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/Gemini_Swarm_Core/scripts/jules-smoke-test.py
#!/usr/bin/env python3
import os
import sys
import json
import subprocess
from pathlib import Path

def print_result(step_name, success, message=""):
    status = "āœ” PASS" if success else "āŒ FAIL"
    print(f"[{status}] {step_name}")
    if message:
        print(f"   {message}")
    if not success:
        sys.exit(1)

def main():
    print("=== JULES MCP SMOKE TEST ===")
    
    workspace_root = Path("/opt/Gemini_Swarm_Core")
    scripts_dir = workspace_root / "Gemini_Swarm_Core" / "scripts"
    plugin_mcp_path = workspace_root / ".agents" / "plugins" / "antigravity-swarm" / "mcp_config.json"
    
    # 1. Verify jules_mcp_server.py exists
    server_path = scripts_dir / "jules_mcp_server.py"
    print_result(
        "Checking jules_mcp_server.py existence",
        server_path.exists(),
        f"Path: {server_path}"
    )
    
    # 2. Verify mcp_config.json contains julesServer config
    mcp_config_exists = plugin_mcp_path.exists()
    print_result(
        "Checking plugin mcp_config.json existence",
        mcp_config_exists,
        f"Path: {plugin_mcp_path}"
    )
    
    try:
        with open(plugin_mcp_path, "r", encoding="utf-8") as f:
            config = json.load(f)
        
        jules_server_config = config.get("mcpServers", {}).get("julesServer", {})
        has_jules = "jules_mcp_server.py" in "".join(jules_server_config.get("args", []))
        print_result(
            "Verifying julesServer registration in plugin config",
            has_jules,
            f"Config found: {json.dumps(jules_server_config)}"
        )
    except Exception as e:
        print_result("Verifying julesServer registration in plugin config", False, str(e))
        
    # 3. Verify agy plugin is imported
    try:
        res = subprocess.run(
            ["agy", "plugin", "list"],
            capture_output=True,
            text=True,
            check=True
        )
        is_imported = "antigravity-swarm" in res.stdout
        print_result(
            "Checking agy plugin list for antigravity-swarm",
            is_imported,
            f"Output: {res.stdout.strip()}"
        )
    except Exception as e:
        print_result("Checking agy plugin list for antigravity-swarm", False, str(e))

    # 4. Live MCP Protocol Verification via stdin/stdout
    print("\nRunning Live MCP Server diagnostics...")
    try:
        # Run the server as a subprocess
        proc = subprocess.Popen(
            [sys.executable, str(server_path)],
            stdin=subprocess.PIPE,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            text=True
        )
        
        # Send initialize request
        init_req = {
            "jsonrpc": "2.0",
            "id": 1,
            "method": "initialize",
            "params": {
                "protocolVersion": "2024-11-05",
                "capabilities": {},
                "clientInfo": {"name": "smoke-test"}
            }
        }
        proc.stdin.write(json.dumps(init_req) + "\n")
        proc.stdin.flush()
        
        init_resp_line = proc.stdout.readline()
        init_resp = json.loads(init_resp_line)
        has_proto_version = init_resp.get("result", {}).get("protocolVersion") == "2024-11-05"
        
        # Send tools/list request
        list_req = {
            "jsonrpc": "2.0",
            "id": 2,
            "method": "tools/list"
        }
        proc.stdin.write(json.dumps(list_req) + "\n")
        proc.stdin.flush()
        
        list_resp_line = proc.stdout.readline()
        list_resp = json.loads(list_resp_line)
        
        tools = list_resp.get("result", {}).get("tools", [])
        has_jules_tool = any(t.get("name") == "start_new_jules_task" for t in tools)
        
        # Send call request
        call_req = {
            "jsonrpc": "2.0",
            "id": 3,
            "method": "tools/call",
            "params": {
                "name": "start_new_jules_task",
                "arguments": {
                    "task": "Smoke Test Task",
                    "files": ["test.py"]
                }
            }
        }
        proc.stdin.write(json.dumps(call_req) + "\n")
        proc.stdin.flush()
        
        call_resp_line = proc.stdout.readline()
        call_resp = json.loads(call_resp_line)
        
        call_success = not call_resp.get("result", {}).get("isError", True)
        call_text = call_resp.get("result", {}).get("content", [{}])[0].get("text", "")
        
        # Clean up
        proc.terminate()
        proc.wait()
        
        print_result("Live MCP: initialize response protocol version", has_proto_version, f"Received: {init_resp_line.strip()}")
        print_result("Live MCP: tools/list contains start_new_jules_task", has_jules_tool, f"Received: {list_resp_line.strip()}")
        print_result("Live MCP: tools/call start_new_jules_task responds OK", call_success, f"Response text: {call_text}")
        
    except Exception as e:
        print_result("Live MCP diagnostics", False, str(e))
        
    print("\nāœ” JULES MCP SMOKE TEST COMPLETED SUCCESSFULLY!")

if __name__ == "__main__":
    main()

Youez - 2016 - github.com/yon3zu
LinuXploit