@hupan56/wlkj 3.1.12 → 3.1.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hupan56/wlkj",
3
- "version": "3.1.12",
3
+ "version": "3.1.14",
4
4
  "description": "AI Product R&D Workflow - PRD/Prototype/Search/Task/Report",
5
5
  "bin": {
6
6
  "wlkj": "bin/cli.js"
@@ -134,9 +134,9 @@ def get_index_info():
134
134
  pass
135
135
 
136
136
  lines.append('## Knowledge Graph')
137
- lines.append('MCP工具 (QoderWork自动调用): search_code / get_impact / coverage_matrix / get_workflow 等11个')
138
- lines.append(' python .qoder/scripts/io/search_index.py <keyword> [--platform web|app]')
139
- lines.append(' python .qoder/scripts/io/context_pack.py <keyword> # 一次打包全部上下文')
137
+ lines.append('MCP工具 (QoderWork自动调用): search_code / get_impact / coverage_matrix / get_workflow 等17个')
138
+ lines.append(' python .qoder/scripts/orchestration/wlkj.py search <keyword> [--platform web|app]')
139
+ lines.append(' python .qoder/scripts/orchestration/wlkj.py context <keyword> # 一次打包全部上下文')
140
140
 
141
141
  # DuckDB 知识图谱状态检查
142
142
  # Read role from .developer file
@@ -184,14 +184,14 @@ def get_index_info():
184
184
  if code_newer or db_age_hours > 168: # 7天 = 168小时
185
185
  lines.append(' [WARN] 知识图谱过期! 代码有新变更.')
186
186
  lines.append(' → 管理员请运行: python .qoder/scripts/kg/kg_build.py')
187
- lines.append(' → 完成后: python .qoder/scripts/io/team_sync.py push (共享给团队)')
187
+ lines.append(' → 完成后: python .qoder/scripts/orchestration/wlkj.py sync push (共享给团队)')
188
188
  else:
189
189
  lines.append(' ✓ 知识图谱最新')
190
190
  else:
191
191
  # 非管理员: 只拉取
192
192
  if code_newer or db_age_hours > 168:
193
193
  lines.append(' [WARN] 知识图谱可能过期.')
194
- lines.append(' → 运行: python .qoder/scripts/io/team_sync.py pull (获取管理员最新构建)')
194
+ lines.append(' → 运行: python .qoder/scripts/orchestration/wlkj.py sync pull (获取管理员最新构建)')
195
195
  else:
196
196
  lines.append(' ✓ 知识图谱最新')
197
197
 
@@ -214,7 +214,7 @@ def get_index_info():
214
214
  if role in ('admin', 'dev'):
215
215
  lines.append(' → 运行: python .qoder/scripts/kg/kg_build.py')
216
216
  else:
217
- lines.append(' → 运行: python .qoder/scripts/io/team_sync.py pull')
217
+ lines.append(' → 运行: python .qoder/scripts/orchestration/wlkj.py sync pull')
218
218
 
219
219
  return NL.join(lines)
220
220
 
@@ -227,8 +227,8 @@ def get_style_info():
227
227
 
228
228
  lines = []
229
229
  lines.append('## UI Style Index')
230
- lines.append('Style search: python .qoder/scripts/io/search_index.py --style <table|form|modal>')
231
- lines.append('Field search: python .qoder/scripts/io/search_index.py --field <name>')
230
+ lines.append('Style search: python .qoder/scripts/orchestration/wlkj.py style --style <table|form|modal>')
231
+ lines.append('Field search: python .qoder/scripts/orchestration/wlkj.py search --field <name>')
232
232
 
233
233
  for proj, d in meta.get('projects', {}).items():
234
234
  vue = d.get('vue_files', 0)
@@ -335,7 +335,18 @@ def main():
335
335
  dev = get_developer()
336
336
  if dev:
337
337
  name = dev.get('name', 'unknown')
338
- role = dev.get('role', 'unknown')
338
+ # role 真源在 member.json (.developer 常无 role= 行 → 显示 unknown)
339
+ # 回退查 member.json, 再回退 'pm' (绝不显示 unknown, 误导 AI)。
340
+ role = dev.get('role')
341
+ if not role or role == 'unknown':
342
+ try:
343
+ mj = os.path.join(BASE, 'workspace', 'members', name, 'member.json')
344
+ if os.path.isfile(mj):
345
+ m = json.load(open(mj, encoding='utf-8'))
346
+ role = m.get('role') or 'pm'
347
+ except Exception:
348
+ pass
349
+ role = role or 'pm'
339
350
  parts.append('Developer: ' + name + ' (' + role + ')')
340
351
  parts.append('Workspace: workspace/members/' + name + '/')
341
352
  else:
@@ -1,17 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """build_workflows.py — 从 traces + endpoints 推导业务流程链, 生成 workflow-index.json。
3
3
 
4
- # v3.0 路径自举: 引导到 common/bootstrap, 统一 sys.path 逻辑
5
- import os as _o, sys as _s
6
- _f = _o.path.abspath(__file__)
7
- for _ in range(10):
8
- _f = _o.path.dirname(_f)
9
- _cp = _o.path.join(_f, 'foundation')
10
- if _o.path.isfile(_o.path.join(_cp, 'bootstrap.py')):
11
- break
12
- if _cp not in _s.path: _s.path.insert(0, _cp)
13
- from bootstrap import setup; setup()
14
-
15
4
  产出 data/index/_build_cache/workflow-index.json, 供 kg_duckdb 导入 workflows 表,
16
5
  让 kg.py workflow <模块> 能返回该模块的状态流转链 (query→create→audit→...)。
17
6
 
@@ -26,13 +15,24 @@ workflows 表结构: module, state, seq, button, endpoint
26
15
  数据源: trace-chain.json (vue_file→button→endpoint→verb) + entity-registry.json
27
16
  (module→endpoint 邻接, 用于把 endpoint 归到 module)。
28
17
  """
18
+ # v3.0 路径自举: 引导到 foundation/bootstrap, 统一 sys.path 逻辑
19
+ # ⚠ 必须在 module docstring 之外! 旧版把这块包进 docstring (闭引号在第28行) →
20
+ # bootstrap 永不执行 → from foundation ModuleNotFoundError → 脚本直接跑死。
21
+ import os as _o, sys as _s
22
+ _f = _o.path.abspath(__file__)
23
+ for _ in range(10):
24
+ _f = _o.path.dirname(_f)
25
+ _cp = _o.path.join(_f, 'foundation')
26
+ if _o.path.isfile(_o.path.join(_cp, 'bootstrap.py')):
27
+ break
28
+ if _cp not in _s.path: _s.path.insert(0, _cp)
29
+ from bootstrap import setup; setup()
30
+
29
31
  import json
30
32
  import os
31
33
  import sys
32
34
  from datetime import datetime
33
35
 
34
- THIS_DIR = os.path.dirname(os.path.abspath(__file__))
35
- sys.path.insert(0, os.path.join(THIS_DIR, '..'))
36
36
  from foundation.core.paths import DATA_INDEX_DIR, BUILD_CACHE_DIR
37
37
 
38
38