opencode-api-security-testing 5.4.8 → 5.4.9
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 -1
- package/postinstall.mjs +17 -5
package/package.json
CHANGED
package/postinstall.mjs
CHANGED
|
@@ -145,13 +145,25 @@ function installPlaywright(pythonCmd) {
|
|
|
145
145
|
const pipCmd = checkPip(pythonCmd);
|
|
146
146
|
if (!pipCmd) return { success: false, error: "pip not found" };
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
// 安装 Playwright 包(增加超时时间)
|
|
149
|
+
const pkgResult = runCommand(`${pipCmd} install playwright`, 180000);
|
|
150
|
+
if (!pkgResult.success) {
|
|
151
|
+
console.log(` ⚠ Failed to install playwright package: ${pkgResult.error}`);
|
|
152
|
+
return { success: false, error: pkgResult.error };
|
|
153
|
+
}
|
|
154
|
+
console.log(" ✓ Playwright package installed");
|
|
150
155
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
// 安装浏览器(增加超时时间到 10 分钟)
|
|
157
|
+
console.log(" Installing Playwright browsers (chromium) - this may take several minutes...");
|
|
158
|
+
const browserResult = runCommand(`${pythonCmd} -m playwright install chromium`, 600000);
|
|
159
|
+
if (browserResult.success) {
|
|
160
|
+
console.log(" ✓ Playwright browsers installed");
|
|
161
|
+
return { success: true, error: "" };
|
|
162
|
+
}
|
|
154
163
|
|
|
164
|
+
console.log(` ⚠ Browser installation failed: ${browserResult.error}`);
|
|
165
|
+
console.log(" → browser_collect tool will have limited functionality");
|
|
166
|
+
console.log(` → Manual fix: ${pythonCmd} -m playwright install chromium`);
|
|
155
167
|
return { success: false, error: browserResult.error };
|
|
156
168
|
}
|
|
157
169
|
|