probe: getDiagnostics structure discovery for AI response relay
This commit is contained in:
@@ -97,6 +97,36 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
vscode.commands.registerCommand('gravityBridge.reject', () => handleManualAction(false)),
|
vscode.commands.registerCommand('gravityBridge.reject', () => handleManualAction(false)),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Probe getDiagnostics to discover AI response data structure
|
||||||
|
setTimeout(async () => {
|
||||||
|
try {
|
||||||
|
const diag: any = await vscode.commands.executeCommand('antigravity.getDiagnostics');
|
||||||
|
if (typeof diag === 'string') {
|
||||||
|
const parsed = JSON.parse(diag);
|
||||||
|
console.log(`Gravity Bridge: getDiagnostics keys: ${Object.keys(parsed).join(', ')}`);
|
||||||
|
// Sample each key to understand structure
|
||||||
|
for (const key of Object.keys(parsed)) {
|
||||||
|
const val = parsed[key];
|
||||||
|
if (Array.isArray(val)) {
|
||||||
|
console.log(` [${key}] Array(${val.length})`);
|
||||||
|
if (val.length > 0) {
|
||||||
|
const sample = val[val.length - 1]; // last item
|
||||||
|
console.log(` last: ${JSON.stringify(sample).substring(0, 300)}`);
|
||||||
|
}
|
||||||
|
} else if (typeof val === 'object') {
|
||||||
|
console.log(` [${key}] Object: ${JSON.stringify(val).substring(0, 200)}`);
|
||||||
|
} else {
|
||||||
|
console.log(` [${key}] ${typeof val}: ${String(val).substring(0, 100)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`Gravity Bridge: getDiagnostics returned ${typeof diag}`);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(`Gravity Bridge: getDiagnostics error: ${e}`);
|
||||||
|
}
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
// Chat document change listener — captures AI text responses
|
// Chat document change listener — captures AI text responses
|
||||||
context.subscriptions.push(
|
context.subscriptions.push(
|
||||||
vscode.workspace.onDidChangeTextDocument((event) => {
|
vscode.workspace.onDidChangeTextDocument((event) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user