@hupan56/wlkj 3.3.2 → 3.3.3
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 +16 -1
- package/package.json +1 -1
- package/templates/qoder/scripts/capability/registry_mcp.py +1 -1
- package/templates/qoder/scripts/deployment/setup/init_doctor.py +6 -2
- package/templates/qoder/scripts/deployment/setup/setup.py +5 -2
- package/templates/qoder/scripts/domain/integration/return_to_platform.py +3 -2
- package/templates/qoder/scripts/domain/integration/spec_upload.py +1 -1
- package/templates/qoder/scripts/domain/kg/switch_project.py +2 -2
- package/templates/qoder/scripts/engine/poller.py +1 -1
package/bin/cli.js
CHANGED
|
@@ -383,7 +383,7 @@ async function doInit(name, roleArg) {
|
|
|
383
383
|
console.log(`\n--- 自动初始化 ---`);
|
|
384
384
|
const setupPath = path.join(cwd, ".qoder", "scripts", "deployment", "setup", "setup.py");
|
|
385
385
|
if (fs.existsSync(setupPath)) {
|
|
386
|
-
const setupArgs = [name, role, "--skip-cron", "--skip-qoderwork"].filter(Boolean);
|
|
386
|
+
const setupArgs = [name, role, "--skip-cron", "--skip-qoderwork", "--skip-code"].filter(Boolean);
|
|
387
387
|
try {
|
|
388
388
|
const cmd = `python "${setupPath}" ${setupArgs.map(a => `"${a}"`).join(" ")}`;
|
|
389
389
|
console.log(` 运行: setup.py ${setupArgs.join(" ")}`);
|
|
@@ -443,6 +443,21 @@ async function doInit(name, roleArg) {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
+
// === 6.6. 连云平台 bind 项目(云模式:KG 在云平台,引擎调云 MCP)===
|
|
447
|
+
if (pyCmd) {
|
|
448
|
+
const switchScript = path.join(cwd, ".qoder", "scripts", "domain", "kg", "switch_project.py");
|
|
449
|
+
if (fs.existsSync(switchScript)) {
|
|
450
|
+
console.log(`\n--- 连云平台 bind 项目 ---`);
|
|
451
|
+
console.log(` 问平台邮箱/密码 → 拉项目列表 → 选项目 → 写 mcp_config(连云)`);
|
|
452
|
+
try {
|
|
453
|
+
const env = { ...process.env, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1" };
|
|
454
|
+
execSync(`${pyCmd} "${switchScript}"`, { cwd, stdio: "inherit", timeout: 180000, env });
|
|
455
|
+
} catch (e) {
|
|
456
|
+
console.log(` [WARN] 云 bind 未完成,可手动: python .qoder/scripts/domain/kg/switch_project.py`);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
446
461
|
// === 7. 写版本戳 ===
|
|
447
462
|
writeEngineVersion(cwd);
|
|
448
463
|
|
package/package.json
CHANGED
|
@@ -51,7 +51,7 @@ _KNOWLEDGE_SERVER_ALIASES = ["wlinkj-knowledge", "qoder-knowledge-graph"]
|
|
|
51
51
|
SERVERS: dict[str, dict] = {
|
|
52
52
|
"qoder-knowledge-graph": {
|
|
53
53
|
"kind": "http",
|
|
54
|
-
"url": "http://
|
|
54
|
+
"url": os.environ.get("WLKJ_BASE_URL", "http://10.89.7.120") + "/mcp",
|
|
55
55
|
"note": "知识图谱。已改为 http 模式,指向资产平台 MCP 服务(POST /mcp JSON-RPC)",
|
|
56
56
|
},
|
|
57
57
|
"qoder-zentao": {
|
|
@@ -834,6 +834,7 @@ def check_lanhu():
|
|
|
834
834
|
def main():
|
|
835
835
|
args = [a for a in sys.argv[1:]]
|
|
836
836
|
fix = '--fix' in args
|
|
837
|
+
skip_code = '--skip-code' in args or '--cloud' in args
|
|
837
838
|
pos = [a for a in args if not a.startswith('--')]
|
|
838
839
|
name = pos[0] if pos else None
|
|
839
840
|
role = pos[1] if len(pos) > 1 else None
|
|
@@ -848,8 +849,11 @@ def main():
|
|
|
848
849
|
check_dependencies(fix)
|
|
849
850
|
check_developer(fix, name, role)
|
|
850
851
|
check_team_sync(fix)
|
|
851
|
-
|
|
852
|
-
|
|
852
|
+
if skip_code:
|
|
853
|
+
print('\n--- 4. 源码/索引: 云模式跳过(KG 在云平台,引擎调云 MCP)---')
|
|
854
|
+
else:
|
|
855
|
+
check_source_repos(fix, config)
|
|
856
|
+
check_index(fix)
|
|
853
857
|
check_style(fix)
|
|
854
858
|
check_prd_templates()
|
|
855
859
|
check_weekly(fix)
|
|
@@ -242,9 +242,11 @@ def detect_name(explicit=None):
|
|
|
242
242
|
# Step 2: 调 init_doctor --fix (主体)
|
|
243
243
|
# ============================================================
|
|
244
244
|
|
|
245
|
-
def run_doctor(name, role):
|
|
245
|
+
def run_doctor(name, role, skip_code=False):
|
|
246
246
|
print('\n--- 初始化 (init_doctor) ---')
|
|
247
247
|
cmd = [sys.executable, str(THIS_DIR / 'init_doctor.py'), '--fix', name, role]
|
|
248
|
+
if skip_code:
|
|
249
|
+
cmd.append('--skip-code')
|
|
248
250
|
# 透传 stdio (用户能看到实时输出) + 强制 UTF-8 环境 (解决 cmd GBK 乱码)
|
|
249
251
|
env = dict(os.environ)
|
|
250
252
|
env['PYTHONIOENCODING'] = 'utf-8'
|
|
@@ -911,6 +913,7 @@ def main():
|
|
|
911
913
|
parser.add_argument('--skip-cron', action='store_true', help='跳过 cron 注册')
|
|
912
914
|
parser.add_argument('--skip-qoderwork', action='store_true', help='跳过 QoderWork 安装')
|
|
913
915
|
parser.add_argument('--skip-lanhu', action='store_true', help='跳过蓝湖 MCP 引导')
|
|
916
|
+
parser.add_argument('--skip-code', '--cloud', action='store_true', help='云模式:跳过本地源码 clone/索引(KG 在云平台)')
|
|
914
917
|
args = parser.parse_args()
|
|
915
918
|
|
|
916
919
|
print('=' * 56)
|
|
@@ -931,7 +934,7 @@ def main():
|
|
|
931
934
|
configure_git_identity(name)
|
|
932
935
|
|
|
933
936
|
# Step 2
|
|
934
|
-
if not run_doctor(name, args.role):
|
|
937
|
+
if not run_doctor(name, args.role, args.skip_code):
|
|
935
938
|
warn('init_doctor 未完全成功, 继续 setup 后续步骤...')
|
|
936
939
|
|
|
937
940
|
# Step 3
|
|
@@ -20,6 +20,7 @@ integration.return_to_platform —— 引擎产出回流平台的统一通道。
|
|
|
20
20
|
"""
|
|
21
21
|
from __future__ import annotations
|
|
22
22
|
|
|
23
|
+
import os
|
|
23
24
|
from typing import Optional
|
|
24
25
|
|
|
25
26
|
|
|
@@ -121,7 +122,7 @@ def _via_http(payload: dict) -> tuple[bool, str]:
|
|
|
121
122
|
|
|
122
123
|
|
|
123
124
|
def _platform_base() -> str:
|
|
124
|
-
"""平台 base url
|
|
125
|
+
"""平台 base url(默认 http://10.89.7.120 云),从 mcp_config server url 推导。"""
|
|
125
126
|
from urllib.parse import urlparse
|
|
126
127
|
cfg = _load_mcp_config()
|
|
127
128
|
for srv in (cfg.get("mcpServers") or {}).values():
|
|
@@ -133,7 +134,7 @@ def _platform_base() -> str:
|
|
|
133
134
|
if ep:
|
|
134
135
|
p = urlparse(ep)
|
|
135
136
|
return "%s://%s" % (p.scheme, p.netloc)
|
|
136
|
-
return "http://
|
|
137
|
+
return os.environ.get("WLKJ_BASE_URL", "http://10.89.7.120")
|
|
137
138
|
|
|
138
139
|
|
|
139
140
|
def _engine_token() -> Optional[str]:
|
|
@@ -48,7 +48,7 @@ def _resolve_endpoint() -> Tuple[str, str, str]:
|
|
|
48
48
|
u = srv.get("url", "")
|
|
49
49
|
if "/mcp" in u:
|
|
50
50
|
base = u.split("/mcp")[0]; break
|
|
51
|
-
base = (base or "http://
|
|
51
|
+
base = (base or os.environ.get("WLKJ_BASE_URL", "http://10.89.7.120")).rstrip("/")
|
|
52
52
|
token = os.environ.get("WLKJ_MCP_TOKEN", "")
|
|
53
53
|
if not token:
|
|
54
54
|
for srv in (cfg.get("mcpServers") or {}).values():
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
python switch_project.py --email a@b.c --pw xxx # 非交互:直接指定
|
|
7
7
|
python switch_project.py --project-uuid <UUID> # 非交互:直接指定项目
|
|
8
8
|
|
|
9
|
-
需工作台后端在跑(默认 http://
|
|
9
|
+
需工作台后端在跑(默认 http://10.89.7.120 云)。
|
|
10
10
|
"""
|
|
11
11
|
import json
|
|
12
12
|
import os
|
|
@@ -33,7 +33,7 @@ def _find_config_path():
|
|
|
33
33
|
CONFIG_PATH = _find_config_path()
|
|
34
34
|
|
|
35
35
|
# 平台地址(默认 10010,可 env 覆盖)
|
|
36
|
-
BASE_URL = os.environ.get("WLKJ_BASE_URL", "http://
|
|
36
|
+
BASE_URL = os.environ.get("WLKJ_BASE_URL", "http://10.89.7.120")
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
def bind(email, password, base_url=BASE_URL):
|
|
@@ -51,7 +51,7 @@ def _get_base(cfg: dict) -> str:
|
|
|
51
51
|
u = srv.get("url", "")
|
|
52
52
|
if "/mcp" in u:
|
|
53
53
|
return u.split("/mcp")[0]
|
|
54
|
-
return "http://
|
|
54
|
+
return os.environ.get("WLKJ_BASE_URL", "http://10.89.7.120")
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
def _api(base, method, path, token, body=None):
|