const http = require('http');

// Try to reload AG window via test-rpc
const payload = JSON.stringify({
    method: "antigravity.reloadWindow",
    args: {}
});

const req = http.request({
    hostname: '127.0.0.1',
    port: 34332,
    path: '/test-rpc',
    method: 'POST',
    headers: { 'Content-Type': 'application/json' }
}, (res) => {
    let data = '';
    res.on('data', c => data += c);
    res.on('end', () => {
        console.log('Status:', res.statusCode);
        console.log('Response:', data);
    });
});

req.on('error', e => console.log('Error:', e.message));
req.write(payload);
req.end();
