@hupan56/wlkj 2.7.10 → 2.7.11

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 +21 -9
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -576,20 +576,32 @@ function doUpdate() {
576
576
  console.log(` git: 已拉取最新`);
577
577
  }
578
578
  } catch (e) {
579
- // git pull 失败诊断: 区分"没配git身份"/"远程要认证"/"网络问题"
579
+ // git pull 失败诊断: 区分"没配git身份"/"远程要认证"/"网络问题"/"非git仓库"
580
+ // node execSync 抛异常时, git 的真实报错在 e.stderr/e.stdout, 不能只看 e.message
580
581
  const errMsg = String(e.message || "");
581
- const stdout = String(e.stdout || "");
582
- const combined = errMsg + " " + stdout;
583
- if (combined.includes("Authentication failed") || combined.includes("Permission denied") ||
584
- combined.includes("could not read Username") || combined.includes("不支持密码")) {
582
+ const stdout = String((e.stdout || "") + " " + (e.stderr || ""));
583
+ const combined = (errMsg + " " + stdout).toLowerCase();
584
+ if (combined.includes("authentication failed") || combined.includes("permission denied") ||
585
+ combined.includes("could not read username") || combined.includes("不支持密码") ||
586
+ combined.includes("credentials") || combined.includes("403") || combined.includes("401")) {
585
587
  console.log(` git: ⚠️ 认证失败 — kg.duckdb 等团队数据拉不到`);
586
588
  console.log(` 原因: git 身份/凭证未配。MCP 能连但无数据。`);
587
589
  console.log(` 修复: npx @hupan56/wlkj init <你的名字> (交互式配 git 账号)`);
588
- } else if (combined.includes("not a git repository") || combined.includes("not a git dir")) {
589
- console.log(` git: 非git仓库 team_sync 拉团队数据`);
590
- console.log(` 修复: npx @hupan56/wlkj init <你的名字>`);
590
+ } else if (combined.includes("not a git repository") || combined.includes("not a git dir") ||
591
+ combined.includes("unknown revision") || combined.includes("does not have any commits")) {
592
+ console.log(` git: ⚠️ 非git仓库或空仓库 团队数据拉不到`);
593
+ console.log(` 原因: 此目录不是 git clone 来的, 或没有 remote。`);
594
+ console.log(` 修复: npx @hupan56/wlkj init <你的名字> (会配团队远程仓库)`);
595
+ } else if (combined.includes("timed out") || combined.includes("timeout") ||
596
+ combined.includes("could not resolve host") || combined.includes("connection refused") ||
597
+ combined.includes("network is unreachable")) {
598
+ console.log(` git: ⚠️ 网络问题 — 连不上远程仓库`);
599
+ console.log(` 原因: ${stdout.trim().slice(0, 80) || "网络超时/无法解析主机"}`);
600
+ console.log(` (kg.duckdb 拉不到, MCP 能连但搜索无结果)`);
591
601
  } else {
592
- console.log(` git: 跳过 ${(errMsg).slice(0, 60)}`);
602
+ // 兜底: 显示 git 的真实报错, 不再笼统说 "Command failed"
603
+ const realErr = stdout.trim() || errMsg;
604
+ console.log(` git: ⚠️ 拉取失败 — ${realErr.slice(0, 100)}`);
593
605
  console.log(` (kg.duckdb 拉不到, MCP 能连但搜索无结果)`);
594
606
  }
595
607
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hupan56/wlkj",
3
- "version": "2.7.10",
3
+ "version": "2.7.11",
4
4
  "description": "AI Product R&D Workflow - PRD/Prototype/Search/Task/Report",
5
5
  "bin": {
6
6
  "wlkj": "bin/cli.js"