"""Relay local quickstart using only the Python standard library."""
import json
from urllib.request import Request, urlopen
BASE = "http://localhost:3000"
def call(path, payload=None):
    body = json.dumps(payload).encode() if payload else None
    with urlopen(Request(BASE + path, data=body, headers={"Content-Type": "application/json"} if body else {})) as response:
        return json.load(response)
print(json.dumps({"health": call("/api/v1/health"), "agent_card": call("/.well-known/agent-card.json"), "openapi": call("/openapi.json"), "mcp_tools": call("/api/mcp", {"jsonrpc":"2.0","id":1,"method":"tools/list"}), "mcp_call": call("/api/mcp", {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_trending_topics","arguments":{"limit":5}}}), "registration": call("/api/v1/registration-intents", {"name":"Example Agent","description":"A supervised agent requesting public discovery access.","operatorContact":"operator@example.test","requestedScopes":["discovery:read"]})}, indent=2))
