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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/postinstall.mjs +17 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-api-security-testing",
3
- "version": "5.4.8",
3
+ "version": "5.4.9",
4
4
  "description": "API Security Testing Plugin for OpenCode - Automated vulnerability scanning and penetration testing",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
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
- const pkgResult = installPythonPackage(pipCmd, "playwright");
149
- if (!pkgResult.success) return pkgResult;
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
- console.log(" Installing Playwright browsers (chromium)...");
152
- const browserResult = runCommand(`${pythonCmd} -m playwright install chromium`, 300000);
153
- if (browserResult.success) return { success: true, error: "" };
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