@hupan56/wlkj 3.1.24 → 3.1.25

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/bin/cli.js +11 -4
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -1464,10 +1464,17 @@ switch (cmd) {
1464
1464
  console.log(" wlkj selftest — 全套件自检 (验证跨环境 + 第一宿主)");
1465
1465
  console.log("=".repeat(56));
1466
1466
  let totalFail = 0;
1467
+ // 找 packages/wlkj/tests/ 目录:可能在 cwd 下(项目根),也可能在 npx 缓存里
1468
+ // 用 __dirname (cli.js 所在目录) 往上找
1469
+ let testsDir = path.join(__dirname, "..", "tests");
1470
+ if (!fs.existsSync(testsDir)) {
1471
+ // fallback: cwd 下找
1472
+ testsDir = path.join(cwd, "packages", "wlkj", "tests");
1473
+ }
1467
1474
  const suites = [
1468
- ["1. 跨环境模拟验证", ["packages/wlkj/tests/test_cross_env.py"]],
1469
- ["2. QoderWork 工具协议 (真实 MCP JSON-RPC)", ["packages/wlkj/tests/test_qoderwork_tools.py"]],
1470
- ["3. 命令底层脚本 smoke", ["-c", "import sys; sys.path.insert(0, r'" + path.join(cwd, ".qoder", "scripts") + "'); exec(open(r'" + path.join(cwd, ".qoder", "scripts", "validation", "test", "smoke_all_commands.py") + "').read())"]],
1475
+ ["1. 跨环境模拟验证", [path.join(testsDir, "test_cross_env.py")]],
1476
+ ["2. QoderWork 工具协议 (真实 MCP JSON-RPC)", [path.join(testsDir, "test_qoderwork_tools.py")]],
1477
+ ["3. 命令底层脚本 smoke", ["-c", "import sys, os; p=os.path.join(os.getcwd(), '.qoder', 'scripts', 'validation', 'test', 'smoke_all_commands.py'); sys.path.insert(0, os.path.join(os.getcwd(), '.qoder', 'scripts')); exec(open(p).read()) if os.path.isfile(p) else print('[SKIP] smoke_all_commands.py 不存在 (init 后才有)')"]],
1471
1478
  ["4. 环境体检 (doctor)", [path.join(cwd, ".qoder", "scripts", "orchestration", "wlkj.py"), "doctor"]],
1472
1479
  ["5. MCP 实测 (mcp_doctor)", [path.join(cwd, ".qoder", "scripts", "protocol", "mcp", "mcp_doctor.py")]],
1473
1480
  ];
@@ -1478,7 +1485,7 @@ switch (cmd) {
1478
1485
  const isTestFile = args[0] && args[0].endsWith(".py") && !args[0].startsWith(path.sep) && !args[0].includes(":");
1479
1486
  const fullArgs = isTestFile ? [path.join(cwd, args[0])] : args;
1480
1487
  try {
1481
- const r = _ss(pyCmd, fullArgs, { cwd, stdio: "inherit", timeout: 120000, env });
1488
+ const r = _ss(pyCmd, fullArgs, { cwd, stdio: "inherit", timeout: 300000, env });
1482
1489
  if (r.status !== 0) { console.log(" [FAIL] exit " + r.status); totalFail++; }
1483
1490
  } catch (e) { console.log(" [FAIL] " + (e.message || "").slice(0, 80)); totalFail++; }
1484
1491
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hupan56/wlkj",
3
- "version": "3.1.24",
3
+ "version": "3.1.25",
4
4
  "description": "AI Product R&D Workflow - PRD/Prototype/Search/Task/Report",
5
5
  "bin": {
6
6
  "wlkj": "bin/cli.js"