Prepare desktop 1.15 offline source and release acceptance

This commit is contained in:
Agent Workbench Dev
2026-10-31 11:50:51 +08:00
parent b77783ba67
commit c5c8a84a7b
51 changed files with 6211 additions and 1136 deletions
+5 -3
View File
@@ -9,6 +9,7 @@ import { _electron } from 'playwright';
import { HostController } from '../src/core/desktop/host-controller.mjs';
import { observeWindowsProcess } from '../src/core/desktop/process-identity.mjs';
import { projectEnvironment } from '../src/core/process-environment.mjs';
import { desktopExecutableIdentity } from '../src/core/desktop/app-installation.mjs';
if (process.argv.includes('--help')) { console.log('node scripts/verify-desktop-window.mjs [--native-picker] — isolated actual Electron runtime; default uses explicitly identified native-dialog/shell fixtures, --native-picker waits for actual Windows UI selection. No existing credentials or configured model.'); process.exit(0); }
if (process.argv.slice(2).some(arg => arg !== '--native-picker')) throw new Error('Use --help.');
@@ -28,8 +29,9 @@ const completedTools = id => {
try { return db.prepare("SELECT payload FROM records WHERE kind='tool' AND session_id=? ORDER BY id").all(id).map(row => JSON.parse(row.payload)).filter(value => value.state === 'completed'); } finally { db.close(); }
};
async function launch() {
const current = await _electron.launch({ executablePath: path.join(appRoot, 'node_modules/electron/dist/electron.exe'),
args: [path.join(appRoot, 'dist-desktop/main.cjs'), '--app-root', appRoot, '--data-root', dataRoot, '--node', process.execPath, '--port', String(port), ...(native ? [] : ['--hidden-window'])],
const executable = desktopExecutableIdentity(appRoot).path, packaged = executable.toLowerCase().endsWith('agentworkbench.exe');
const current = await _electron.launch({ executablePath: executable,
args: [...(packaged ? [] : [path.join(appRoot, 'dist-desktop/main.cjs')]), '--app-root', appRoot, '--data-root', dataRoot, '--node', process.execPath, '--port', String(port), ...(native ? [] : ['--hidden-window'])],
cwd: appRoot, env: projectEnvironment(), timeout: 60000 });
const window = await current.firstWindow();
window.on('pageerror', error => errors.push(error.message)); window.on('requestfailed', request => { if (!expectedNavigation) requests.push({ url: request.url(), failure: request.failure()?.errorText }); });
@@ -37,7 +39,7 @@ async function launch() {
return { application: current, page: window };
}
async function snapshot(name, width) {
const window = await application.browserWindow(page); await window.evaluate((value, width) => value.setContentSize(width, 900), width);
const window = await application.browserWindow(page); await window.evaluate((value, width) => { value.showInactive(); value.setContentSize(width, 900); }, width);
await until(() => page.evaluate(width => innerWidth === width, width));
await page.screenshot({ path: path.join(root, name + '.png') }); fs.writeFileSync(path.join(root, name + '.html'), await page.content());
const overflow = await page.evaluate(() => document.documentElement.scrollWidth > innerWidth);