yiyan-browser-agent 1.0.31 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/src/postinstall.js +26 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yiyan-browser-agent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"description": "AI coding agent powered by Yiyan (文心一言) via browser automation — no API key needed",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "node src/index.js",
|
|
12
|
+
"postinstall": "node src/postinstall.js",
|
|
12
13
|
"debug": "node src/index.js --debug",
|
|
13
14
|
"calibrate": "node src/calibrate.js"
|
|
14
15
|
},
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/postinstall.js — Auto-install Playwright Chromium
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { execSync } = require('child_process');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
|
|
8
|
+
// Skip in CI
|
|
9
|
+
if (process.env.CI || process.env.SKIP_PLAYWRIGHT_INSTALL) {
|
|
10
|
+
console.log('[yiyan-agent] Skipping browser install (CI detected)');
|
|
11
|
+
process.exit(0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
console.log('\n[yiyan-agent] Installing Playwright Chromium...\n');
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const isWindows = process.platform === 'win32';
|
|
18
|
+
const playwrightBin = path.join(__dirname, '..', 'node_modules', '.bin',
|
|
19
|
+
isWindows ? 'playwright.cmd' : 'playwright');
|
|
20
|
+
|
|
21
|
+
execSync(`"${playwrightBin}" install chromium`, { stdio: 'inherit' });
|
|
22
|
+
console.log('\n[yiyan-agent] ✓ Browser installed!\n');
|
|
23
|
+
} catch {
|
|
24
|
+
console.warn('\n[yiyan-agent] ⚠ Could not auto-install. Run manually:');
|
|
25
|
+
console.warn(' npx playwright install chromium\n');
|
|
26
|
+
}
|