probe: Trial D — streaming RPCs + JSON retry with live auth context
This commit is contained in:
Binary file not shown.
@@ -435,70 +435,49 @@ function activate(context) {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// ========== Trial B2: Chrome DevTools Protocol probe ==========
|
// ========== Trial D: Streaming RPC + JSON retry ==========
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
console.log('Gravity Bridge: [Trial B2] Probing Chrome DevTools Protocol access...');
|
if (!lsPort || !lsCsrf) {
|
||||||
// Try getChromeDevtoolsMcpUrl - could give us DevTools WebSocket URL
|
console.log('Gravity Bridge: [Trial D] Skipped — no LS');
|
||||||
try {
|
return;
|
||||||
const cdpUrl = await vscode.commands.executeCommand('antigravity.getChromeDevtoolsMcpUrl');
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] getChromeDevtoolsMcpUrl: ${JSON.stringify(cdpUrl).substring(0, 500)}`);
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
console.log(`Gravity Bridge: [Trial D] Probing streaming RPCs on port ${lsPort}...`);
|
||||||
console.log(`Gravity Bridge: [Trial B2] getChromeDevtoolsMcpUrl error: ${e.message}`);
|
const http = require('http');
|
||||||
}
|
function tryRPC(method, bodyStr) {
|
||||||
// Try getBrowserOnboardingPort
|
return new Promise((resolve) => {
|
||||||
try {
|
const isJson = !!bodyStr;
|
||||||
const port = await vscode.commands.executeCommand('antigravity.getBrowserOnboardingPort');
|
const body = isJson ? Buffer.from(bodyStr) : Buffer.from([0, 0, 0, 0, 0]);
|
||||||
console.log(`Gravity Bridge: [Trial B2] getBrowserOnboardingPort: ${JSON.stringify(port)}`);
|
const req = http.request({ hostname: '127.0.0.1', port: lsPort, path: `/exa.language_server_pb.LanguageServerService/${method}`, method: 'POST', headers: { 'Content-Type': isJson ? 'application/json' : 'application/connect+proto', 'Connect-Protocol-Version': '1', 'x-codeium-csrf-token': lsCsrf }, timeout: 8000 }, (res) => {
|
||||||
}
|
const chunks = [];
|
||||||
catch (e) {
|
res.on('data', (c) => chunks.push(c));
|
||||||
console.log(`Gravity Bridge: [Trial B2] getBrowserOnboardingPort error: ${e.message}`);
|
res.on('end', () => resolve(Buffer.concat(chunks).toString('utf-8')));
|
||||||
}
|
});
|
||||||
// Try getWsTargets commands
|
req.on('error', (e) => resolve(`err:${e.message}`));
|
||||||
try {
|
req.on('timeout', () => { req.destroy(); resolve('timeout'); });
|
||||||
const wsTargets = await vscode.commands.executeCommand('antigravity.getWsTargets.open');
|
req.write(body);
|
||||||
console.log(`Gravity Bridge: [Trial B2] getWsTargets.open: ${JSON.stringify(wsTargets).substring(0, 500)}`);
|
req.end();
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] getWsTargets.open error: ${e.message}`);
|
|
||||||
}
|
|
||||||
// Try getCascadePluginTemplate - might reveal plugin API
|
|
||||||
try {
|
|
||||||
const tmpl = await vscode.commands.executeCommand('antigravity.getCascadePluginTemplate');
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] getCascadePluginTemplate: ${JSON.stringify(tmpl).substring(0, 500)}`);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] getCascadePluginTemplate error: ${e.message}`);
|
|
||||||
}
|
|
||||||
// Try workbench.action.chat.copyLink - might copy chat content
|
|
||||||
try {
|
|
||||||
const chatLink = await vscode.commands.executeCommand('workbench.action.chat.copyLink');
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] chat.copyLink: ${JSON.stringify(chatLink)}`);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] chat.copyLink error: ${e.message}`);
|
|
||||||
}
|
|
||||||
// Try to find DevTools WebSocket URL from process args (Electron --remote-debugging-port)
|
|
||||||
try {
|
|
||||||
const exec = require('child_process');
|
|
||||||
const cmd = 'wmic process where "name=\'Antigravity.exe\'" get CommandLine /format:list 2>nul';
|
|
||||||
exec.exec(cmd, (err, stdout) => {
|
|
||||||
if (stdout) {
|
|
||||||
const portMatch = stdout.match(/--remote-debugging-port=(\d+)/);
|
|
||||||
if (portMatch) {
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] ✅ Electron remote debugging port: ${portMatch[1]}`);
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] CDP URL: http://127.0.0.1:${portMatch[1]}/json`);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] No --remote-debugging-port in Antigravity args`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (e) {
|
for (const m of ['StreamCascadeReactiveUpdates', 'StreamCascadeSummariesReactiveUpdates', 'StreamAgentStateUpdates', 'GetBrowserOpenConversation']) {
|
||||||
console.log(`Gravity Bridge: [Trial B2] process scan error: ${e.message}`);
|
const r = await tryRPC(m);
|
||||||
|
console.log(`Gravity Bridge: [Trial D] ${m}: ${r.substring(0, 400)}`);
|
||||||
}
|
}
|
||||||
}, 5000);
|
try {
|
||||||
|
const dRaw = await vscode.commands.executeCommand('antigravity.getDiagnostics');
|
||||||
|
const d = typeof dRaw === 'string' ? JSON.parse(dRaw) : dRaw;
|
||||||
|
const ts = d?.recentTrajectories || [];
|
||||||
|
if (ts.length > 0) {
|
||||||
|
const t = ts[ts.length - 1];
|
||||||
|
const gid = t.googleAgentId || '';
|
||||||
|
console.log(`Gravity Bridge: [Trial D] Latest: ${gid.substring(0, 8)} step=${t.lastStepIndex}`);
|
||||||
|
const r = await tryRPC('GetCascadeTrajectorySteps', JSON.stringify({ trajectoryId: gid, startStepIndex: Math.max(0, t.lastStepIndex - 1) }));
|
||||||
|
console.log(`Gravity Bridge: [Trial D] Steps(json): ${r.substring(0, 500)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log(`Gravity Bridge: [Trial D] err: ${e.message}`);
|
||||||
|
}
|
||||||
|
}, 15000);
|
||||||
// Start LS bridge after a delay
|
// Start LS bridge after a delay
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
const found = await discoverLS();
|
const found = await discoverLS();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -429,58 +429,42 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ========== Trial B2: Chrome DevTools Protocol probe ==========
|
// ========== Trial D: Streaming RPC + JSON retry ==========
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
console.log('Gravity Bridge: [Trial B2] Probing Chrome DevTools Protocol access...');
|
if (!lsPort || !lsCsrf) { console.log('Gravity Bridge: [Trial D] Skipped — no LS'); return; }
|
||||||
|
console.log(`Gravity Bridge: [Trial D] Probing streaming RPCs on port ${lsPort}...`);
|
||||||
// Try getChromeDevtoolsMcpUrl - could give us DevTools WebSocket URL
|
const http = require('http');
|
||||||
try {
|
function tryRPC(method: string, bodyStr?: string): Promise<string> {
|
||||||
const cdpUrl = await vscode.commands.executeCommand('antigravity.getChromeDevtoolsMcpUrl');
|
return new Promise((resolve) => {
|
||||||
console.log(`Gravity Bridge: [Trial B2] getChromeDevtoolsMcpUrl: ${JSON.stringify(cdpUrl).substring(0, 500)}`);
|
const isJson = !!bodyStr;
|
||||||
} catch (e: any) { console.log(`Gravity Bridge: [Trial B2] getChromeDevtoolsMcpUrl error: ${e.message}`); }
|
const body = isJson ? Buffer.from(bodyStr!) : Buffer.from([0, 0, 0, 0, 0]);
|
||||||
|
const req = http.request({ hostname: '127.0.0.1', port: lsPort, path: `/exa.language_server_pb.LanguageServerService/${method}`, method: 'POST', headers: { 'Content-Type': isJson ? 'application/json' : 'application/connect+proto', 'Connect-Protocol-Version': '1', 'x-codeium-csrf-token': lsCsrf }, timeout: 8000 }, (res: any) => {
|
||||||
// Try getBrowserOnboardingPort
|
const chunks: Buffer[] = [];
|
||||||
try {
|
res.on('data', (c: Buffer) => chunks.push(c));
|
||||||
const port = await vscode.commands.executeCommand('antigravity.getBrowserOnboardingPort');
|
res.on('end', () => resolve(Buffer.concat(chunks).toString('utf-8')));
|
||||||
console.log(`Gravity Bridge: [Trial B2] getBrowserOnboardingPort: ${JSON.stringify(port)}`);
|
});
|
||||||
} catch (e: any) { console.log(`Gravity Bridge: [Trial B2] getBrowserOnboardingPort error: ${e.message}`); }
|
req.on('error', (e: any) => resolve(`err:${e.message}`));
|
||||||
|
req.on('timeout', () => { req.destroy(); resolve('timeout'); });
|
||||||
// Try getWsTargets commands
|
req.write(body); req.end();
|
||||||
try {
|
|
||||||
const wsTargets = await vscode.commands.executeCommand('antigravity.getWsTargets.open');
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] getWsTargets.open: ${JSON.stringify(wsTargets).substring(0, 500)}`);
|
|
||||||
} catch (e: any) { console.log(`Gravity Bridge: [Trial B2] getWsTargets.open error: ${e.message}`); }
|
|
||||||
|
|
||||||
// Try getCascadePluginTemplate - might reveal plugin API
|
|
||||||
try {
|
|
||||||
const tmpl = await vscode.commands.executeCommand('antigravity.getCascadePluginTemplate');
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] getCascadePluginTemplate: ${JSON.stringify(tmpl).substring(0, 500)}`);
|
|
||||||
} catch (e: any) { console.log(`Gravity Bridge: [Trial B2] getCascadePluginTemplate error: ${e.message}`); }
|
|
||||||
|
|
||||||
// Try workbench.action.chat.copyLink - might copy chat content
|
|
||||||
try {
|
|
||||||
const chatLink = await vscode.commands.executeCommand('workbench.action.chat.copyLink');
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] chat.copyLink: ${JSON.stringify(chatLink)}`);
|
|
||||||
} catch (e: any) { console.log(`Gravity Bridge: [Trial B2] chat.copyLink error: ${e.message}`); }
|
|
||||||
|
|
||||||
// Try to find DevTools WebSocket URL from process args (Electron --remote-debugging-port)
|
|
||||||
try {
|
|
||||||
const exec = require('child_process');
|
|
||||||
const cmd = 'wmic process where "name=\'Antigravity.exe\'" get CommandLine /format:list 2>nul';
|
|
||||||
exec.exec(cmd, (err: any, stdout: string) => {
|
|
||||||
if (stdout) {
|
|
||||||
const portMatch = stdout.match(/--remote-debugging-port=(\d+)/);
|
|
||||||
if (portMatch) {
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] ✅ Electron remote debugging port: ${portMatch[1]}`);
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] CDP URL: http://127.0.0.1:${portMatch[1]}/json`);
|
|
||||||
} else {
|
|
||||||
console.log(`Gravity Bridge: [Trial B2] No --remote-debugging-port in Antigravity args`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} catch (e: any) { console.log(`Gravity Bridge: [Trial B2] process scan error: ${e.message}`); }
|
}
|
||||||
|
for (const m of ['StreamCascadeReactiveUpdates', 'StreamCascadeSummariesReactiveUpdates', 'StreamAgentStateUpdates', 'GetBrowserOpenConversation']) {
|
||||||
}, 5000);
|
const r = await tryRPC(m);
|
||||||
|
console.log(`Gravity Bridge: [Trial D] ${m}: ${r.substring(0, 400)}`);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const dRaw = await vscode.commands.executeCommand('antigravity.getDiagnostics');
|
||||||
|
const d = typeof dRaw === 'string' ? JSON.parse(dRaw) : dRaw;
|
||||||
|
const ts = d?.recentTrajectories || [];
|
||||||
|
if (ts.length > 0) {
|
||||||
|
const t = ts[ts.length - 1];
|
||||||
|
const gid = t.googleAgentId || '';
|
||||||
|
console.log(`Gravity Bridge: [Trial D] Latest: ${gid.substring(0, 8)} step=${t.lastStepIndex}`);
|
||||||
|
const r = await tryRPC('GetCascadeTrajectorySteps', JSON.stringify({ trajectoryId: gid, startStepIndex: Math.max(0, t.lastStepIndex - 1) }));
|
||||||
|
console.log(`Gravity Bridge: [Trial D] Steps(json): ${r.substring(0, 500)}`);
|
||||||
|
}
|
||||||
|
} catch (e: any) { console.log(`Gravity Bridge: [Trial D] err: ${e.message}`); }
|
||||||
|
}, 15000);
|
||||||
|
|
||||||
|
|
||||||
// Start LS bridge after a delay
|
// Start LS bridge after a delay
|
||||||
|
|||||||
Reference in New Issue
Block a user