@hupan56/wlkj 3.4.0 → 3.4.2
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/bin/cli.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// wlkj - workflow toolkit
|
|
3
3
|
|
|
4
|
+
// Windows 中文乱码修复
|
|
5
|
+
if (process.platform === "win32") {
|
|
6
|
+
try { execSync("chcp 65001", { stdio: "ignore" }); } catch (e) {}
|
|
7
|
+
process.stdout.setDefaultEncoding("utf-8");
|
|
8
|
+
process.stderr.setDefaultEncoding("utf-8");
|
|
9
|
+
}
|
|
10
|
+
|
|
4
11
|
const path = require("path");
|
|
5
12
|
const fs = require("fs");
|
|
6
13
|
const { execSync } = require("child_process");
|
|
@@ -1039,6 +1046,24 @@ function doUpdate() {
|
|
|
1039
1046
|
console.log(` [OK] mcp.json 已刷新 (选装了依赖的Python, 避免MCP黄)`);
|
|
1040
1047
|
} catch (e) { /* --mcp-only 可能不支持, 静默跳过 */ }
|
|
1041
1048
|
}
|
|
1049
|
+
|
|
1050
|
+
// ★ 共识:kg 走云平台 SSE(cli.js 最保险——npx 入口永远最新,不依赖旧版 install_qoderwork)
|
|
1051
|
+
// 在 install_qoderwork 写完 mcp.json 后,cli.js 强制把 kg 改为 SSE url
|
|
1052
|
+
const mcpFile = path.join(home, ".qoderwork", "mcp.json");
|
|
1053
|
+
if (fs.existsSync(mcpFile)) {
|
|
1054
|
+
try {
|
|
1055
|
+
const mcp = JSON.parse(fs.readFileSync(mcpFile, "utf-8"));
|
|
1056
|
+
if (mcp.mcpServers && mcp.mcpServers["qoder-knowledge-graph"]) {
|
|
1057
|
+
mcp.mcpServers["qoder-knowledge-graph"] = {
|
|
1058
|
+
"url": "http://10.89.7.120:10010/mcp",
|
|
1059
|
+
"type": "sse",
|
|
1060
|
+
"enabled": true,
|
|
1061
|
+
};
|
|
1062
|
+
fs.writeFileSync(mcpFile, JSON.stringify(mcp, null, 2) + "\n", "utf-8");
|
|
1063
|
+
console.log(` [OK] kg MCP → 云平台 SSE (http://10.89.7.120:10010/mcp)`);
|
|
1064
|
+
}
|
|
1065
|
+
} catch (e) { /* mcp.json 解析失败不阻塞 */ }
|
|
1066
|
+
}
|
|
1042
1067
|
} catch (e) { /* 刷新失败不阻塞升级 */ }
|
|
1043
1068
|
} // end WLKJ_SKIP_QW_INSTALL guard
|
|
1044
1069
|
|
package/package.json
CHANGED
|
@@ -122,8 +122,9 @@ autotest:
|
|
|
122
122
|
# setup.py init 时会交互式配置 git remote add origin <url>。
|
|
123
123
|
# 不配也能本地工作, 但 push/同步功能不可用。
|
|
124
124
|
team_remote:
|
|
125
|
-
url:
|
|
126
|
-
|
|
125
|
+
# url: 团队 git 地址(留空则 setup.py 会问; 填了团队所有人 init 自动用)
|
|
126
|
+
url: ""
|
|
127
|
+
branch: master
|
|
127
128
|
|
|
128
129
|
# ── Git Sync (Weekly) ──
|
|
129
130
|
# 每个项目在 data/code/ 下有自己的 git 仓库
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
|
+
# Windows 控制台 UTF-8 修复(ctypes 直调 Windows API)
|
|
4
|
+
import sys as _s
|
|
5
|
+
if _s.platform == 'win32':
|
|
6
|
+
import ctypes as _ct, io as _io
|
|
7
|
+
try:
|
|
8
|
+
_ct.windll.kernel32.SetConsoleOutputCP(65001)
|
|
9
|
+
_ct.windll.kernel32.SetConsoleCP(65001)
|
|
10
|
+
_s.stdout = _io.TextIOWrapper(_s.stdout.buffer, encoding='utf-8', errors='replace')
|
|
11
|
+
_s.stderr = _io.TextIOWrapper(_s.stderr.buffer, encoding='utf-8', errors='replace')
|
|
12
|
+
except Exception:
|
|
13
|
+
pass
|
|
3
14
|
# v3.0 路径自举: 引导到 common/bootstrap, 统一 sys.path 逻辑
|
|
4
15
|
import os as _o, sys as _s
|
|
5
16
|
_f = _o.path.abspath(__file__)
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
+
# Windows 控制台 UTF-8 修复(ctypes 直调 Windows API;所有经 bootstrap 引导的脚本都受益)
|
|
3
|
+
import sys as _s
|
|
4
|
+
if _s.platform == 'win32':
|
|
5
|
+
import ctypes as _ct, io as _io
|
|
6
|
+
try:
|
|
7
|
+
_ct.windll.kernel32.SetConsoleOutputCP(65001)
|
|
8
|
+
_ct.windll.kernel32.SetConsoleCP(65001)
|
|
9
|
+
_s.stdout = _io.TextIOWrapper(_s.stdout.buffer, encoding='utf-8', errors='replace')
|
|
10
|
+
_s.stderr = _io.TextIOWrapper(_s.stderr.buffer, encoding='utf-8', errors='replace')
|
|
11
|
+
except Exception:
|
|
12
|
+
pass
|
|
2
13
|
"""
|
|
3
14
|
bootstrap.py - 统一 CLI 启动样板 (DRY) + 子目录化路径自举 (v3.0)
|
|
4
15
|
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
|
+
# Windows 控制台 UTF-8 修复(ctypes 直调 Windows API)
|
|
4
|
+
import sys as _s
|
|
5
|
+
if _s.platform == 'win32':
|
|
6
|
+
import ctypes as _ct, io as _io
|
|
7
|
+
try:
|
|
8
|
+
_ct.windll.kernel32.SetConsoleOutputCP(65001)
|
|
9
|
+
_ct.windll.kernel32.SetConsoleCP(65001)
|
|
10
|
+
_s.stdout = _io.TextIOWrapper(_s.stdout.buffer, encoding='utf-8', errors='replace')
|
|
11
|
+
_s.stderr = _io.TextIOWrapper(_s.stderr.buffer, encoding='utf-8', errors='replace')
|
|
12
|
+
except Exception:
|
|
13
|
+
pass
|
|
3
14
|
"""
|
|
4
15
|
wlkj.py - 工作流顶层调度器 (Facade 统一入口)
|
|
5
16
|
|