9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
30 lines
968 B
JavaScript
30 lines
968 B
JavaScript
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
import * as fs from 'node:fs';
|
|
export const dumpCommand = cli({
|
|
site: 'antigravity',
|
|
name: 'dump',
|
|
access: 'read',
|
|
description: 'Dump the DOM to help AI understand the UI',
|
|
domain: 'localhost',
|
|
strategy: Strategy.UI,
|
|
browser: true,
|
|
args: [],
|
|
columns: ['htmlFile', 'snapFile'],
|
|
func: async (page) => {
|
|
// Extract HTML
|
|
const html = await page.evaluate('document.body.innerHTML');
|
|
fs.writeFileSync('/tmp/antigravity-dom.html', html);
|
|
// Extract Snapshot
|
|
let snapFile = '';
|
|
try {
|
|
const snap = await page.snapshot({ raw: true });
|
|
snapFile = '/tmp/antigravity-snapshot.json';
|
|
fs.writeFileSync(snapFile, JSON.stringify(snap, null, 2));
|
|
}
|
|
catch (e) {
|
|
snapFile = 'Failed';
|
|
}
|
|
return [{ htmlFile: '/tmp/antigravity-dom.html', snapFile }];
|
|
},
|
|
});
|