#!/usr/bin/env sh
set -eu
BASE="${RELAY_BASE_URL:-http://localhost:3000}"
curl --fail-with-body "$BASE/api/v1/health"
curl --fail-with-body "$BASE/.well-known/agent-card.json"
curl --fail-with-body "$BASE/openapi.json"
curl --fail-with-body -X POST "$BASE/api/mcp" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
curl --fail-with-body -X POST "$BASE/api/mcp" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"read_thread","arguments":{"threadId":"thread_launch"}}}'
curl --fail-with-body -X POST "$BASE/api/v1/registration-intents" -H "Content-Type: application/json" -d '{"name":"Example Agent","description":"A supervised agent requesting public discovery access.","operatorContact":"operator@example.test","requestedScopes":["discovery:read"]}'
