yiyan-browser-agent 1.0.30 → 1.0.31
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 +1 -2
- package/src/postinstall.js +0 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yiyan-browser-agent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31",
|
|
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,7 +9,6 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "node src/index.js",
|
|
12
|
-
"postinstall": "node src/postinstall.js",
|
|
13
12
|
"debug": "node src/index.js --debug",
|
|
14
13
|
"calibrate": "node src/calibrate.js"
|
|
15
14
|
},
|
package/src/postinstall.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// src/postinstall.js — Runs after `npm install -g yiyan-browser-agent`
|
|
2
|
-
// Automatically downloads the Playwright Chromium browser.
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
const { execSync } = require('child_process');
|
|
6
|
-
const path = require('path');
|
|
7
|
-
const os = require('os');
|
|
8
|
-
|
|
9
|
-
// Skip in CI environments where a display isn't available
|
|
10
|
-
if (process.env.CI || process.env.SKIP_PLAYWRIGHT_INSTALL) {
|
|
11
|
-
console.log('[yiyan-agent] Skipping Playwright browser install (CI detected).');
|
|
12
|
-
process.exit(0);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
console.log('');
|
|
16
|
-
console.log('╔══════════════════════════════════════════════════╗');
|
|
17
|
-
console.log('║ 🤖 Yiyan Browser Agent (文心一言) — Setup ║');
|
|
18
|
-
console.log('╚══════════════════════════════════════════════════╝');
|
|
19
|
-
console.log('');
|
|
20
|
-
console.log(' Downloading Playwright Chromium browser...');
|
|
21
|
-
console.log(' (This only happens once — ~150 MB)\n');
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
// Use the playwright binary bundled in this package's node_modules
|
|
25
|
-
// On Windows, .bin files have .cmd extension; on Linux/macOS, they're shell scripts
|
|
26
|
-
const isWindows = process.platform === 'win32';
|
|
27
|
-
const playwrightBin = path.join(__dirname, '..', 'node_modules', '.bin',
|
|
28
|
-
isWindows ? 'playwright.cmd' : 'playwright');
|
|
29
|
-
|
|
30
|
-
execSync(`"${playwrightBin}" install chromium`, {
|
|
31
|
-
stdio : 'inherit',
|
|
32
|
-
env : { ...process.env },
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
console.log('');
|
|
36
|
-
console.log(' ✓ Browser installed successfully!');
|
|
37
|
-
console.log('');
|
|
38
|
-
console.log(' Get started:');
|
|
39
|
-
console.log(' yiyan-agent --interactive');
|
|
40
|
-
console.log(' yiyan-agent "build a REST API in Express"');
|
|
41
|
-
console.log('');
|
|
42
|
-
} catch (err) {
|
|
43
|
-
console.warn('');
|
|
44
|
-
console.warn(' ⚠ Could not auto-install Chromium.');
|
|
45
|
-
console.warn(' Run this manually to complete setup:');
|
|
46
|
-
console.warn('');
|
|
47
|
-
console.warn(' npx playwright install chromium');
|
|
48
|
-
console.warn('');
|
|
49
|
-
// Don't exit(1) — don't break the install if browser download fails
|
|
50
|
-
}
|