probe: Trial B2 — getChromeDevtoolsMcpUrl, getWsTargets, remote-debugging-port scan
This commit is contained in:
@@ -435,60 +435,69 @@ function activate(context) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// ========== Trial A: Extension exports probe ==========
|
||||
// ========== Trial B2: Chrome DevTools Protocol probe ==========
|
||||
setTimeout(async () => {
|
||||
console.log('Gravity Bridge: [Trial A] Probing Antigravity extension exports...');
|
||||
// Try both possible extension IDs
|
||||
const extIds = ['google.antigravity', 'Google.antigravity', 'antigravity.antigravity'];
|
||||
for (const id of extIds) {
|
||||
const ext = vscode.extensions.getExtension(id);
|
||||
if (ext) {
|
||||
console.log(`Gravity Bridge: [Trial A] ✅ Found extension: ${id}`);
|
||||
console.log(`Gravity Bridge: [Trial A] isActive: ${ext.isActive}`);
|
||||
console.log(`Gravity Bridge: [Trial A] extensionPath: ${ext.extensionPath}`);
|
||||
// Check exports
|
||||
const exports = ext.exports;
|
||||
if (exports) {
|
||||
const keys = Object.keys(exports);
|
||||
console.log(`Gravity Bridge: [Trial A] exports keys (${keys.length}): ${keys.join(', ')}`);
|
||||
// Deep inspect each export
|
||||
for (const key of keys.slice(0, 10)) {
|
||||
const val = exports[key];
|
||||
const type = typeof val;
|
||||
if (type === 'function') {
|
||||
console.log(`Gravity Bridge: [Trial A] ${key}: function(${val.length} args)`);
|
||||
}
|
||||
else if (type === 'object' && val) {
|
||||
const subKeys = Object.keys(val).slice(0, 5);
|
||||
console.log(`Gravity Bridge: [Trial A] ${key}: object {${subKeys.join(', ')}}`);
|
||||
}
|
||||
else {
|
||||
console.log(`Gravity Bridge: [Trial A] ${key}: ${type} = ${JSON.stringify(val).substring(0, 100)}`);
|
||||
}
|
||||
console.log('Gravity Bridge: [Trial B2] Probing Chrome DevTools Protocol access...');
|
||||
// Try getChromeDevtoolsMcpUrl - could give us DevTools WebSocket URL
|
||||
try {
|
||||
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 B2] getChromeDevtoolsMcpUrl error: ${e.message}`);
|
||||
}
|
||||
// Try getBrowserOnboardingPort
|
||||
try {
|
||||
const port = await vscode.commands.executeCommand('antigravity.getBrowserOnboardingPort');
|
||||
console.log(`Gravity Bridge: [Trial B2] getBrowserOnboardingPort: ${JSON.stringify(port)}`);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Gravity Bridge: [Trial B2] getBrowserOnboardingPort error: ${e.message}`);
|
||||
}
|
||||
// Try getWsTargets commands
|
||||
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) {
|
||||
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`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log(`Gravity Bridge: [Trial A] exports is null/undefined`);
|
||||
}
|
||||
// Check extension package.json for activation events
|
||||
const pkg = ext.packageJSON;
|
||||
if (pkg?.contributes?.commands) {
|
||||
const cmdCount = pkg.contributes.commands.length;
|
||||
console.log(`Gravity Bridge: [Trial A] package.json contributes ${cmdCount} commands`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Gravity Bridge: [Trial B2] process scan error: ${e.message}`);
|
||||
}
|
||||
// Trial B: Check all chat-related commands
|
||||
console.log('Gravity Bridge: [Trial B] Probing chat-related commands...');
|
||||
const cmds = await vscode.commands.getCommands(true);
|
||||
const chatCmds = cmds.filter((c) => c.includes('chat') && (c.includes('export') || c.includes('history') ||
|
||||
c.includes('conversation') || c.includes('message') || c.includes('copy')));
|
||||
console.log(`Gravity Bridge: [Trial B] chat export/history/conversation commands: ${chatCmds.join(', ') || 'NONE'}`);
|
||||
// Also list ALL antigravity commands we haven't explored
|
||||
const agCmds = cmds.filter((c) => c.includes('antigravity') && (c.includes('get') || c.includes('export') ||
|
||||
c.includes('conversation') || c.includes('history') || c.includes('message')));
|
||||
console.log(`Gravity Bridge: [Trial B] antigravity get/export/conversation commands: ${agCmds.join(', ') || 'NONE'}`);
|
||||
}, 5000);
|
||||
// Start LS bridge after a delay
|
||||
setTimeout(async () => {
|
||||
|
||||
Reference in New Issue
Block a user