openyida 2026.4.2-beta.3 → 2026.4.2-beta.4
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/lib/core/doctor.js +34 -7
- package/package.json +1 -1
- package/yida-skills/SKILL.md +1 -1
package/lib/core/doctor.js
CHANGED
|
@@ -195,15 +195,9 @@ class EnvironmentChecker {
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
checkPlaywrightInstalled() {
|
|
198
|
+
// 1. 检查 playwright npm 包是否安装
|
|
198
199
|
try {
|
|
199
200
|
require.resolve('playwright');
|
|
200
|
-
return {
|
|
201
|
-
id: 'env-playwright',
|
|
202
|
-
label: 'Playwright 已安装',
|
|
203
|
-
passed: true,
|
|
204
|
-
severity: Severity.INFO,
|
|
205
|
-
fixType: null,
|
|
206
|
-
};
|
|
207
201
|
} catch {
|
|
208
202
|
return {
|
|
209
203
|
id: 'env-playwright',
|
|
@@ -215,6 +209,39 @@ class EnvironmentChecker {
|
|
|
215
209
|
fixCommand: 'npm install playwright && npx playwright install chromium',
|
|
216
210
|
};
|
|
217
211
|
}
|
|
212
|
+
|
|
213
|
+
// 2. 检查 Chromium 二进制是否存在于用户目录(postinstall 已自动安装)
|
|
214
|
+
try {
|
|
215
|
+
const { chromium } = require('playwright');
|
|
216
|
+
const chromiumPath = chromium.executablePath();
|
|
217
|
+
if (chromiumPath && fs.existsSync(chromiumPath)) {
|
|
218
|
+
return {
|
|
219
|
+
id: 'env-playwright',
|
|
220
|
+
label: `Playwright + Chromium 已就绪`,
|
|
221
|
+
passed: true,
|
|
222
|
+
severity: Severity.INFO,
|
|
223
|
+
fixType: null,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
id: 'env-playwright',
|
|
228
|
+
label: 'Chromium 浏览器检测',
|
|
229
|
+
passed: false,
|
|
230
|
+
severity: Severity.ERROR,
|
|
231
|
+
message: `Chromium 未安装(期望路径:${chromiumPath || '未知'})`,
|
|
232
|
+
fixType: FixType.COMMAND,
|
|
233
|
+
fixCommand: 'npx playwright install chromium',
|
|
234
|
+
};
|
|
235
|
+
} catch {
|
|
236
|
+
// playwright API 不可用,降级为仅检查包安装
|
|
237
|
+
return {
|
|
238
|
+
id: 'env-playwright',
|
|
239
|
+
label: 'Playwright 已安装',
|
|
240
|
+
passed: true,
|
|
241
|
+
severity: Severity.INFO,
|
|
242
|
+
fixType: null,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
218
245
|
}
|
|
219
246
|
|
|
220
247
|
checkConfig() {
|
package/package.json
CHANGED
package/yida-skills/SKILL.md
CHANGED