feat: add task-bound real browser checks and verified page delivery
This commit is contained in:
@@ -3,11 +3,13 @@ import path from 'node:path';
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { planReaBundle, copyReaBundle } from './bundle-rea.mjs';
|
||||
import { planBrowserBundle, copyBrowserBundle } from './bundle-browser.mjs';
|
||||
|
||||
const root = process.cwd();
|
||||
const meta = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
||||
const lock = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'));
|
||||
const reaPlan = planReaBundle(root);
|
||||
const browserPlan = planBrowserBundle(root);
|
||||
const releases = path.resolve(root, 'releases');
|
||||
fs.mkdirSync(releases, { recursive: true });
|
||||
const baseName = 'Agent-Workbench-' + meta.version;
|
||||
@@ -46,6 +48,8 @@ if (!fs.existsSync(path.join(npmRoot, 'bin', 'npm-cli.js'))) throw new Error('Th
|
||||
copyTree(npmRoot, path.join(portableRoot, 'runtime', 'node_modules', 'npm'));
|
||||
const reaRuntime = copyReaBundle(path.join(portableRoot, 'runtime'), reaPlan);
|
||||
copyReaBundle(path.join(sourceRoot, 'runtime'), reaPlan);
|
||||
const browserRuntime = copyBrowserBundle(path.join(portableRoot, 'runtime'), browserPlan);
|
||||
copyBrowserBundle(path.join(sourceRoot, 'runtime'), browserPlan);
|
||||
|
||||
const notices = ['Agent Workbench third-party notices', '',
|
||||
'Original product code is supplied for the project owner. Its redistribution terms are determined by the project owner.',
|
||||
@@ -113,5 +117,6 @@ function archive(directory) {
|
||||
return { path: destination, bytes: fs.statSync(destination).size, sha256: createHash('sha256').update(fs.readFileSync(destination)).digest('hex') };
|
||||
}
|
||||
const result = { portableRoot, sourceRoot, portable: archive(portableRoot), source: archive(sourceRoot), nodeVersion, reaRuntime, portableFiles: portableManifest.files.length, licenseTexts: licenseCount + 2 };
|
||||
result.browserRuntime = { playwrightVersion: browserRuntime.playwrightVersion, packages: browserRuntime.packages.map(pkg => ({ name: pkg.name, version: pkg.version, files: pkg.files.length })) };
|
||||
fs.writeFileSync(path.join(releases, 'latest.json'), JSON.stringify(result, null, 2));
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
|
||||
Reference in New Issue
Block a user