@roarpeng/graphflow 1.7.7 → 1.7.10

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 (129) hide show
  1. package/CHANGELOG.md +66 -2
  2. package/README.md +266 -264
  3. package/dist/config/discover-workspace.d.ts +2 -0
  4. package/dist/config/discover-workspace.d.ts.map +1 -1
  5. package/dist/config/discover-workspace.js +62 -15
  6. package/dist/config/discover-workspace.js.map +1 -1
  7. package/dist/config/embedding-factory.d.ts.map +1 -1
  8. package/dist/config/embedding-factory.js +8 -0
  9. package/dist/config/embedding-factory.js.map +1 -1
  10. package/dist/config/workspace-root.d.ts.map +1 -1
  11. package/dist/config/workspace-root.js +7 -2
  12. package/dist/config/workspace-root.js.map +1 -1
  13. package/dist/core/types.d.ts +1 -1
  14. package/dist/core/types.d.ts.map +1 -1
  15. package/dist/graph/artifact-manager.d.ts +1 -0
  16. package/dist/graph/artifact-manager.d.ts.map +1 -1
  17. package/dist/graph/artifact-manager.js +15 -8
  18. package/dist/graph/artifact-manager.js.map +1 -1
  19. package/dist/graph/file-indexer-walker.d.ts.map +1 -1
  20. package/dist/graph/file-indexer-walker.js +1 -0
  21. package/dist/graph/file-indexer-walker.js.map +1 -1
  22. package/dist/graph/file-indexer.d.ts.map +1 -1
  23. package/dist/graph/file-indexer.js +18 -0
  24. package/dist/graph/file-indexer.js.map +1 -1
  25. package/dist/graph/file-watcher.d.ts.map +1 -1
  26. package/dist/graph/file-watcher.js +1 -0
  27. package/dist/graph/file-watcher.js.map +1 -1
  28. package/dist/graph/graph-compression.d.ts.map +1 -1
  29. package/dist/graph/graph-compression.js +2 -0
  30. package/dist/graph/graph-compression.js.map +1 -1
  31. package/dist/graph/hit-diversify.js +1 -1
  32. package/dist/graph/hit-diversify.js.map +1 -1
  33. package/dist/graph/language-indexers/dart.d.ts +9 -0
  34. package/dist/graph/language-indexers/dart.d.ts.map +1 -0
  35. package/dist/graph/language-indexers/dart.js +225 -0
  36. package/dist/graph/language-indexers/dart.js.map +1 -0
  37. package/dist/graph/language-indexers/index.d.ts.map +1 -1
  38. package/dist/graph/language-indexers/index.js +6 -0
  39. package/dist/graph/language-indexers/index.js.map +1 -1
  40. package/dist/graph/language-indexers/markdown.d.ts +11 -0
  41. package/dist/graph/language-indexers/markdown.d.ts.map +1 -0
  42. package/dist/graph/language-indexers/markdown.js +158 -0
  43. package/dist/graph/language-indexers/markdown.js.map +1 -0
  44. package/dist/graph/language-indexers/plcopen-xml.d.ts +16 -0
  45. package/dist/graph/language-indexers/plcopen-xml.d.ts.map +1 -0
  46. package/dist/graph/language-indexers/plcopen-xml.js +204 -0
  47. package/dist/graph/language-indexers/plcopen-xml.js.map +1 -0
  48. package/dist/graph/language-indexers/st-analyzer.d.ts +49 -0
  49. package/dist/graph/language-indexers/st-analyzer.d.ts.map +1 -0
  50. package/dist/graph/language-indexers/st-analyzer.js +439 -0
  51. package/dist/graph/language-indexers/st-analyzer.js.map +1 -0
  52. package/dist/graph/language-indexers/tree-sitter-loader.d.ts +2 -1
  53. package/dist/graph/language-indexers/tree-sitter-loader.d.ts.map +1 -1
  54. package/dist/graph/language-indexers/tree-sitter-loader.js +5 -2
  55. package/dist/graph/language-indexers/tree-sitter-loader.js.map +1 -1
  56. package/dist/integrations/agent-mcp-installer.d.ts +8 -2
  57. package/dist/integrations/agent-mcp-installer.d.ts.map +1 -1
  58. package/dist/integrations/agent-mcp-installer.js +70 -5
  59. package/dist/integrations/agent-mcp-installer.js.map +1 -1
  60. package/dist/integrations/agent-profiles/index.d.ts +2 -0
  61. package/dist/integrations/agent-profiles/index.d.ts.map +1 -1
  62. package/dist/integrations/agent-profiles/index.js +2 -0
  63. package/dist/integrations/agent-profiles/index.js.map +1 -1
  64. package/dist/integrations/agent-profiles/profiles/opencode.d.ts +2 -0
  65. package/dist/integrations/agent-profiles/profiles/opencode.d.ts.map +1 -0
  66. package/dist/integrations/agent-profiles/profiles/opencode.js +28 -0
  67. package/dist/integrations/agent-profiles/profiles/opencode.js.map +1 -0
  68. package/dist/integrations/agent-profiles/skills/opencode.d.ts +2 -0
  69. package/dist/integrations/agent-profiles/skills/opencode.d.ts.map +1 -0
  70. package/dist/integrations/agent-profiles/skills/opencode.js +13 -0
  71. package/dist/integrations/agent-profiles/skills/opencode.js.map +1 -0
  72. package/dist/integrations/agent-profiles/types.d.ts +2 -2
  73. package/dist/integrations/agent-profiles/types.d.ts.map +1 -1
  74. package/dist/integrations/skill-installer.d.ts.map +1 -1
  75. package/dist/integrations/skill-installer.js +7 -0
  76. package/dist/integrations/skill-installer.js.map +1 -1
  77. package/dist/learning/embedding-quality.d.ts +4 -0
  78. package/dist/learning/embedding-quality.d.ts.map +1 -1
  79. package/dist/learning/embedding-quality.js +10 -0
  80. package/dist/learning/embedding-quality.js.map +1 -1
  81. package/dist/learning/embeddings.d.ts +31 -2
  82. package/dist/learning/embeddings.d.ts.map +1 -1
  83. package/dist/learning/embeddings.js +114 -22
  84. package/dist/learning/embeddings.js.map +1 -1
  85. package/dist/learning/episodic-memory.d.ts +3 -0
  86. package/dist/learning/episodic-memory.d.ts.map +1 -1
  87. package/dist/learning/episodic-memory.js +13 -0
  88. package/dist/learning/episodic-memory.js.map +1 -1
  89. package/dist/learning/skill-flywheel.d.ts +11 -0
  90. package/dist/learning/skill-flywheel.d.ts.map +1 -1
  91. package/dist/learning/skill-flywheel.js +85 -0
  92. package/dist/learning/skill-flywheel.js.map +1 -1
  93. package/dist/learning/skill-store.d.ts.map +1 -1
  94. package/dist/learning/skill-store.js +1 -0
  95. package/dist/learning/skill-store.js.map +1 -1
  96. package/dist/learning/skill-types.d.ts +1 -0
  97. package/dist/learning/skill-types.d.ts.map +1 -1
  98. package/dist/learning/skill-types.js.map +1 -1
  99. package/dist/surfaces/cli/index.js +115 -9
  100. package/dist/surfaces/cli/index.js.map +1 -1
  101. package/dist/surfaces/cli/init.d.ts +55 -2
  102. package/dist/surfaces/cli/init.d.ts.map +1 -1
  103. package/dist/surfaces/cli/init.js +234 -56
  104. package/dist/surfaces/cli/init.js.map +1 -1
  105. package/dist/surfaces/cli/output.d.ts +6 -0
  106. package/dist/surfaces/cli/output.d.ts.map +1 -1
  107. package/dist/surfaces/cli/output.js +62 -2
  108. package/dist/surfaces/cli/output.js.map +1 -1
  109. package/dist/surfaces/cli/runtime/graph.d.ts +1 -0
  110. package/dist/surfaces/cli/runtime/graph.d.ts.map +1 -1
  111. package/dist/surfaces/cli/runtime/graph.js.map +1 -1
  112. package/dist/surfaces/cli/runtime/learning.d.ts +13 -0
  113. package/dist/surfaces/cli/runtime/learning.d.ts.map +1 -1
  114. package/dist/surfaces/cli/runtime/learning.js +27 -0
  115. package/dist/surfaces/cli/runtime/learning.js.map +1 -1
  116. package/dist/surfaces/cli/runtime/routing.d.ts.map +1 -1
  117. package/dist/surfaces/cli/runtime/routing.js +65 -0
  118. package/dist/surfaces/cli/runtime/routing.js.map +1 -1
  119. package/dist/surfaces/cli/runtime/types.d.ts +25 -0
  120. package/dist/surfaces/cli/runtime/types.d.ts.map +1 -1
  121. package/dist/surfaces/cli/runtime.d.ts +1 -1
  122. package/dist/surfaces/cli/runtime.d.ts.map +1 -1
  123. package/dist/surfaces/cli/runtime.js +5 -1
  124. package/dist/surfaces/cli/runtime.js.map +1 -1
  125. package/package.json +13 -8
  126. package/scripts/safe-postinstall.cjs +38 -1
  127. package/wasm/.grammar-version +1 -0
  128. package/wasm/tree-sitter-dart.wasm +0 -0
  129. package/wasm/tree-sitter-kotlin.wasm +0 -0
package/README.md CHANGED
@@ -1,24 +1,24 @@
1
1
  # GraphFlow
2
2
 
3
- > **Local-first 代码知识图谱 + 跨会话学习记�?* —�?不只是压缩上下文,还记住项目的决策与教训�?
3
+ > **Local-first ?????? + ????????* ?????????????????????????
4
4
 
5
- GraphFlow 把你的仓库变成一�?*可查询的代码图谱**,在 agent 读全文之前先返回压缩摘要与锚点(入门钩子�?*图谱 + 90%+ token 压缩**);更进一步,它用 **Episodic / Skill / Decision 节点**把每次任务的决策与教训沉淀回图谱,形成跨会话的**学习飞轮**(差异化纵深)�?
5
+ GraphFlow ??????????*????????**?? agent ??????????????????????*?? + 90%+ token ??**????????? **Episodic / Skill / Decision ??**???????????????????????**????**?????????
6
6
 
7
- �?TypeScript/Node 本地运行,通过 CLIMCPVS Code 扩展对外暴露�?*无需 API key、无需配置**即可起步:结构索�?+ 离线压缩开箱即用�?
7
+ ??TypeScript/Node ??????? CLI?MCP?VS Code ????????*?? API key?????**??????????+ ??????????
8
8
 
9
- ## 30 秒上�?
9
+ ## 30 ????
10
10
 
11
- 无需 API key、无需注册——结构图谱与离线压缩本地直接跑:
11
+ ?? API key??????????????????????
12
12
 
13
13
  ```bash
14
- # 1. 建立结构图谱(纯 AST,零 LLM、零网络�?
14
+ # 1. ???????? AST?? LLM??????
15
15
  npx @roarpeng/graphflow graph index .
16
16
 
17
- # 2. 压缩预览:读全文前先拿摘�?+ 锚点(通常�?90%+ token�?
17
+ # 2. ??????????????+ ???????90%+ token??
18
18
  npx @roarpeng/graphflow context preview "orchestrator" --json
19
19
  ```
20
20
 
21
- 接入 MCPCursor / Claude Code 等),最小配置:
21
+ ?? MCP?Cursor / Claude Code ????????
22
22
 
23
23
  ```json
24
24
  {
@@ -31,162 +31,163 @@ npx @roarpeng/graphflow context preview "orchestrator" --json
31
31
  }
32
32
  ```
33
33
 
34
- 接好后让 agent 优先调用 `graphflow_context` 取压缩上下文;多步任务用 `graphflow_plan`。配�?provider API key �?*可�?*的——只在需�?LLM 规划增强时才用�?
34
+ ???? agent ???? `graphflow_context` ???????????? `graphflow_plan`????provider API key ??*???*????????LLM ?????????
35
35
 
36
- ## 为什么�?GraphFlow(与同类对比�?
36
+ ## ?????GraphFlow????????
37
37
 
38
- 这个赛道里有许多优秀的单点工具,GraphFlow 的定位不�?某一项最�?,而是**在代码图谱之上叠加了上下文压缩、规划编排与跨会话学习记�?*——尤其是"记忆型代码图�?这一块目前少有人占据。诚实对比如下:
38
+ ????????????????GraphFlow ???????????????**?????????????????????????????*?????"??????????????????????????
39
39
 
40
- | 维度 | **GraphFlow** | CodeGraph | Serena | Repomix |
40
+ | ?? | **GraphFlow** | CodeGraph | Serena | Repomix |
41
41
  | --- | --- | --- | --- | --- |
42
- | 结构代码图谱 | �?多语言 AST 图谱 | �?更成熟(�?更高�?| ⚠️ LSP 符号(非全图谱) | �?|
43
- | 上下文压�?| �?两层渐进(结�?向量�?| ⚠️ 图查询为�?| ⚠️ 符号级精�?| �?整库打包(无压缩�?|
44
- | 规划编排 | �?DAG / 六顶思考帽 | �?| �?| �?|
45
- | **跨会话学习记�?* | �?Episodic / Skill / Decision 节点 | �?| �?| �?|
46
- | Local-first | �?| �?| �?| �?|
47
- | 许可 | Apache-2.0 | MIT | MIT | 宽松开�?|
42
+ | ?????? | ????? AST ?? | ????????????| ?? LSP ???????? | ??|
43
+ | ??????| ??????????????| ?? ??????| ?? ??????| ????????????|
44
+ | ???? | ??DAG / ????? | ??| ??| ??|
45
+ | **????????* | ??Episodic / Skill / Decision ?? | ??| ??| ??|
46
+ | Local-first | ??| ??| ??| ??|
47
+ | ?? | Apache-2.0 | MIT | MIT | ?????|
48
48
 
49
- > 实话实说:论纯图谱的成熟度与社区规模,CodeGraph 更领先;�?LSP 符号编辑标准,Serena 更专精;论整库打包,Repomix 更简单。GraphFlow 的价值在于把"图谱 + 压缩 + 规划 + 学习记忆"合到一处,�?agent 不仅�?token,还能跨会话复用项目经验�?
49
+ > ???????????????????CodeGraph ??????LSP ???????Serena ??????????Repomix ????GraphFlow ??????"?? + ?? + ?? + ????"???????agent ????token??????????????
50
50
 
51
- ## 当前能力总览(v1.7.7+�?
51
+ ## ???????v1.7.10+??
52
52
 
53
- | 能力�?| 说明 |
53
+ | ????| ?? |
54
54
  | --- | --- |
55
- | **任务规划与移�?* | 按任务复杂度分流 simple / complex / insightDAG 规划�?*ATP v1.0 Agent Thinking Protocol**:Intent �?Requirement �?Six Hats �?5-Why �?First Principles �?Decision Matrix �?Planning �?Reflection(`planInsight(task, opts, true)` 开启完�?8 阶段分析,简单任务自�?short-circuit);Agent 委托模式生成 work items;默�?**bridge 模式**输出结构化任务描述符交给外部 coding agent 执行 |
55
+ | **????????* | ???????? simple / complex / insight?DAG ????*ATP v1.0 Agent Thinking Protocol**?Intent ??Requirement ??Six Hats ??5-Why ??First Principles ??Decision Matrix ??Planning ??Reflection?`planInsight(task, opts, true)` ?????8 ????????????short-circuit??Agent ?????? work items????**bridge ??**?????????????? coding agent ?? |
56
56
 
57
- | **模型路由** | Smart / Economy �?tier;多 provider 健康探测�?fallback�?*DeepSeek**、OpenAI、Anthropic、百炼、豆包) |
58
- | **知识图谱** | 工作�?AST 索引(TS/JS/Python/Rust/Go/C/C++/Java/Ruby/Kotlin/Swift);File / Module / Symbol 节点 + 依赖/引用/定义/调用/继承边;图谱 artifact 导入/导出 |
59
- | **上下文压�?* | L1/L2/L3 分层锚点;近无损打包;图结构压缩(边权重+PageRank,零成本默认开启);向量召�?+ RRF 融合;RepoMap 概览;自适应预算 |
60
- | **持续建图** | 默认 `autoIndexOnSave`;MCP 启动时自动启�?FileWatcher;preview / run 前按需增量索引;MCP `graphflow_index` 单文件增�?|
61
- | **学习飞轮** | Episodic Memory(Jaccard + embedding RRF 语义检索)、Reflection(聚�?+ Lesson 提取)、Skill 节点(score ±1,bounded [-20,20])、nightly 学习、技能提示注入规�?|
62
- | **可观测�?* | `graphflow_diagnose` 累计 token 节省;VS Code 知识图谱 Snapshot |
63
- | **Agent 接入** | CLI `--json`;MCP stdio�?*10 工具**);自动安装 MCP �?15+ Agent(Cursor / Claude Code / Windsurf / Cline / Codex / Gemini 等) |
64
- | **VS Code 扩展** | Settings、建图、路由测试、Context Preview�?*知识图谱可视�?*、Skill Insights、Chat Agent、一键安�?MCP |
65
- | **存储后端** | `file`(JSON�? `memory` / `sqlite`(FTS5�? `mcp-http`(Graphify�?|
66
- | **多项目隔�?* | 全局配置共享 LLM/路由�?*图谱路径按当前工作区解析**,不再串读其它项目的 `graphflow-out` |
67
- | **工程质量** | TypeScript strict�?*59 测试文件 / 280+ tests**;`npm run ci` 含扩�?esbuild 打包�?bundled runtime smoke |
57
+ | **模型路由** | Smart / Economy tier;多 provider 健康探测与 fallback(**DeepSeek**、OpenAI、Anthropic、百炼、豆包) |
58
+ | **知识图谱** | 工作区 AST 索引(TS/JS/Python/Rust/Go/C/C++/Java/Ruby/Kotlin/Swift/Dart);File / Module / Symbol 节点 + 依赖/引用/定义/调用/继承边;图谱 artifact 导入/导出 |
59
+ | **上下文压缩** | L1/L2/L3 分层锚点;近无损打包;图结构压缩(边权重+PageRank,零成本默认开启);向量召回 + RRF 融合;RepoMap 概览;自适应预算 |
60
+ | **持续建图** | 默认 `autoIndexOnSave`;MCP 启动时自动启动 FileWatcher;preview / run 前按需增量索引;MCP `graphflow_index` 单文件增量 |
61
+ | **学习飞轮** | Episodic Memory(Jaccard + embedding RRF 语义检索)、Reflection(聚类 + Lesson 提取)、Skill 节点(score ±1,bounded [-20,20])、nightly 学习、技能提示注入规划 |
62
+ | **可观测性** | `graphflow_diagnose` 累计 token 节省;VS Code 知识图谱 Snapshot |
63
+ | **Agent 接入** | CLI `--json`;MCP stdio(**10 工具**);自动安装 MCP 15+ Agent(Cursor / Claude Code / Windsurf / Cline / Codex / Gemini / Opencode 等) |
64
+ | **VS Code 扩展** | Settings、建图、路由测试、Context Preview、**知识图谱可视化**、Skill Insights、Chat Agent、一键安装 MCP |
65
+ | **存储后端** | `file`(JSON)/ `memory` / `sqlite`(FTS5)/ `mcp-http`(Graphify) |
66
+ | **多项目隔离** | 全局配置共享 LLM/路由;**图谱路径按当前工作区解析**,不再串读其它项目的 `graphflow-out` |
67
+ | **工程质量** | TypeScript strict;**72 测试文件 / 357+ tests**;`npm run ci` 含扩展 esbuild 打包与 bundled runtime smoke |
68
68
 
69
- ### 一句话总结
69
+ ### ?????
70
70
 
71
- > �?task 描述出发,自动规�?�?路由模型 �?压缩图谱上下文(含向量召回)�?**输出结构化执行描述符交给外部 coding agent**,并把经验沉淀回知识图谱;定位�?**上下文与规划服务(context service�?*,而非独立执行器�?
71
+ > ??task ???????????????? ??????????????????**?????????????? coding agent**?????????????????**?????????context service??*??????????
72
72
 
73
- ### v1.7.0 核心�?026-07�?
73
+ ### v1.7.0 ????026-07??
74
74
 
75
- **P0 向量召回修正**:废�?FNV-1a hash embedding,引�?`@xenova/transformers` + `all-MiniLM-L6-v2`�?84 维,�?22MB,纯 JS 推理),实现真正的本地语义召回�?
75
+ **P0 ??????**????FNV-1a hash embedding????`@xenova/transformers` + `all-MiniLM-L6-v2`??84 ????22MB?? JS ?????????????????
76
76
 
77
- **P1 移除 hnswlib-node**:彻底移�?C++ 编译依赖,向量召回统一使用纯线性扫描(典型仓库 <10K 节点性能完全够用)�?
77
+ **P1 ?? hnswlib-node**??????C++ ??????????????????????? <10K ???????????
78
78
 
79
- **P2 MCP 工具精简**�?8 个工具合并为 10 个核心工具(contextplanindexinsightdiagnoseartifact 等合并),降�?LLM 工具调用认知负荷�?
79
+ **P2 MCP ????**??8 ?????? 10 ??????context?plan?index?insight?diagnose?artifact ????????LLM ??????????
80
80
 
81
- **P2 ATP 自适应截断**:简单任务(低优先级、无约束、短描述)自�?short-circuit,跳�?First Principles / Decision Matrix / Reflection,节�?4-6 �?LLM 调用�?
81
+ **P2 ATP ?????**??????????????????????short-circuit????First Principles / Decision Matrix / Reflection????4-6 ??LLM ????
82
82
 
83
83
  ---
84
84
 
85
- ### v1.5.0 核心�?026-07�?
85
+ ### v1.5.0 ????026-07??
86
86
 
87
- **ATP v1.0 Agent Thinking Protocol**:以文档驱动的全链路思考协议增强深度分析流程�?
87
+ **ATP v1.0 Agent Thinking Protocol**????????????????????????
88
88
 
89
- **新增 5 个分析阶�?*(在 Six Hats + 5-Why 基础上补齐)�?
89
+ **?? 5 ??????*?? Six Hats + 5-Why ????????
90
90
 
91
- 1. **Intent Analysis** �?区分显式/隐式意图、核心问题、非目标、成功标�?
92
- 2. **Requirement Analysis** �?结构化功�?非功能需求、优先级、范围(included/excluded�?
93
- 3. **First Principles** �?拆解到不可再分事实、挑战假�?
94
- 4. **Decision Matrix** �?多方案按 5 维度打分(complexity/cost/risk/maintainability/impact)比较后推荐
95
- 5. **Plan Reflection** �?规划阶段自评置信度、不确定性、缺失信息、改进方�?
91
+ 1. **Intent Analysis** ??????/???????????????????
92
+ 2. **Requirement Analysis** ?????????????????????included/excluded??
93
+ 3. **First Principles** ?????????????????
94
+ 4. **Decision Matrix** ?????? 5 ?????complexity/cost/risk/maintainability/impact??????
95
+ 5. **Plan Reflection** ???????????????????????????
96
96
 
97
- **ATP 类型 IR**:`atp-schema.ts` 导出 `AgentThinkingProtocol` 完整接口,作�?Multi-Agent 共享中间表示�?
97
+ **ATP ?? IR**?`atp-schema.ts` ?? `AgentThinkingProtocol` ????????Multi-Agent ????????
98
98
 
99
- **TaskNode 丰富**:新�?`priority`、`complexity`、`verification`、`inputs`、`outputs`、`risks` 6 个可选字段�?
99
+ **TaskNode ??**????`priority`?`complexity`?`verification`?`inputs`?`outputs`?`risks` 6 ???????
100
100
 
101
- **Agent 委托扩展**:work items 扩展�?intent +requirement +first-principles +decision-matrix +reflection),submit/merge 闭环不变�?
101
+ **Agent ????**?work items ????intent +requirement +first-principles +decision-matrix +reflection??submit/merge ??????
102
102
 
103
- **向后兼容**:`planInsight(task, options)` 不传第三参数时行为不变;`runFullAtp=true` 启用完整 ATP 8 阶段�?
103
+ **????**?`planInsight(task, options)` ????????????`runFullAtp=true` ???? ATP 8 ????
104
104
 
105
- **P0 残留清理**:移�?VS Code 扩展中对已删�?runtime 方法的调用(`enrichGraph`/`downloadModel`/`showSetupGuide` 命令 + `/enrich` 聊天命令);清理 87 �?OpenBMB/enrichment 残留代码;移�?`canaryAllowed`/`canaryReason` �?5 �?enrichment 类型字段�?
105
+ **P0 ????**????VS Code ????????runtime ??????`enrichGraph`/`downloadModel`/`showSetupGuide` ?? + `/enrich` ???????? 87 ??OpenBMB/enrichment ????????`canaryAllowed`/`canaryReason` ??5 ??enrichment ??????
106
106
 
107
- ### v1.4.0 核心�?026-07�?
107
+ ### v1.4.0 ????026-07??
108
108
 
109
- **奥卡姆剃刀精简**:移�?OpenBMB 本地部署、语义压缩模型、语义增强器、技能进化、金丝雀门控、本地嵌入模型、向量存储等未产生真实价值的模块。留下的是三条经过验证的闭环链路�?
109
+ **???????**????OpenBMB ?????????????????????????????????????????????????????????????????????
110
110
 
111
- **三大核心功能验证修复**�?
111
+ **??????????**??
112
112
 
113
- 1. **HNSW 向量召回完全打�?*(P0 修复�?
114
- - `file-indexer` 现在为所�?File/Symbol/Module 节点附加真正的语�?embedding(`@xenova/transformers` + `all-MiniLM-L6-v2`�?84 维)
115
- - `orchestrator-context` 现在传�?`embeddingProvider` + `enableVectorRecall` 到压缩管�?
116
- - 向量召回统一使用纯线性扫描,无需 C++ 编译依赖
113
+ 1. **HNSW ?????????*?P0 ????
114
+ - `file-indexer` ??????File/Symbol/Module ??????????embedding?`@xenova/transformers` + `all-MiniLM-L6-v2`??84 ??
115
+ - `orchestrator-context` ?????`embeddingProvider` + `enableVectorRecall` ??????
116
+ - ???????????????? C++ ????
117
117
 
118
- 2. **FileWatcher 接入 MCP 启动**(P0 修复�?
119
- - `startFileWatcherIfEnabled` 此前是死代码,现已接�?MCP 服务器启动路�?
120
- - �?`autoIndexOnSave: true` 时自动监听文件变化并增量索引
118
+ 2. **FileWatcher ?? MCP ??**?P0 ????
119
+ - `startFileWatcherIfEnabled` ????????????MCP ????????
120
+ - ??`autoIndexOnSave: true` ??????????????
121
121
 
122
- 3. **技能飞轮闭环修�?*(P1 修复�?
123
- - `skillHints` 解耦:不再依赖 `enableGraphContextInPrompt`,独立注�?worker prompt
124
- - Dangling edges 修复:`applySkillLearning` 现在先创�?Decision 节点再连 `improves` �?
122
+ 3. **?????????*?P1 ????
123
+ - `skillHints` ??????? `enableGraphContextInPrompt`??????worker prompt
124
+ - Dangling edges ???`applySkillLearning` ??????Decision ???? `improves` ??
125
125
 
126
- ### 历史演进
126
+ ### ????
127
127
 
128
- - **v1.3.x**:多项目图谱隔离、Java/Ruby 索引器、MCP 工具扩展、知识图谱可视化
129
- - **v1.0.x**:诚实执行语义(bridge 模式)、三层渐进压缩、混合压缩模�?
130
- - **v0.6.x**:全局配置脚手架、autoIndexOnSaveruntime 模块化、VS Code esbuild bundle
128
+ - **v1.3.x**?????????Java/Ruby ????MCP ????????????
129
+ - **v1.0.x**????????bridge ??????????????????
130
+ - **v0.6.x**?????????autoIndexOnSave?runtime ????VS Code esbuild bundle
131
131
 
132
- ### 发布信息
132
+ ### ????
133
133
 
134
- - 最新版本:**v1.7.7**(root + vscode-extension);npm:`@roarpeng/graphflow@1.7.7`
135
- - **GitHub Release**:push �?`main` �?CI �?`windows-2022` 上自动构�?VSIX 并发布到 [GitHub Releases](https://github.com/Roarpeng/GraphFlow/releases)
136
- - **npm 发布**:push tag `v*`(如 `v1.4.1`)触�?[Publish npm](https://github.com/Roarpeng/GraphFlow/actions/workflows/publish-npm.yml) 工作�?
137
- - 变更日志:`CHANGELOG.md`
134
+ - ?????**v1.7.10**?root + vscode-extension??npm?`@roarpeng/graphflow@1.7.10`
135
+ - **GitHub Release**?push ??`main` ??CI ??`windows-2022` ??????VSIX ???? [GitHub Releases](https://github.com/Roarpeng/GraphFlow/releases)
136
+ - **Open VSX**:`main` / `v*` Build 成功后自动幂等发布到 [Open VSX](https://open-vsx.org/extension/roarpeng/graphflow-tool)(密钥 `open_vsx_token`,namespace `roarpeng`,与 `package.json` publisher 一致;版本已存在则跳过)
137
+ - **npm ??**?push tag `v*`?? `v1.4.1`????[Publish npm](https://github.com/Roarpeng/GraphFlow/actions/workflows/publish-npm.yml) ????
138
+ - ?????`CHANGELOG.md`
138
139
 
139
- ## 环境要求
140
+ ## ????
140
141
 
141
142
  1. Node.js >= 20
142
143
  2. npm >= 10
143
- 3. Windows / macOS / Linux 均可
144
- 4. **npm 安装 `@roarpeng/graphflow` �?*:纯 JS/TS 依赖,无原生模块编译
144
+ 3. Windows / macOS / Linux ??
145
+ 4. **npm ?? `@roarpeng/graphflow` ??*?? JS/TS ??????????
145
146
 
146
- ## 5 分钟本地试跑
147
+ ## 5 ??????
147
148
 
148
149
  ```bash
149
150
  npm install
150
151
  npm run ci
151
152
  ```
152
153
 
153
- 预期:`lint` 无错误、`build` 成功�?*280+ tests** 通过、扩�?bundle �?runtime smoke 通过�?
154
+ 预期:`lint` 无错误、`build` 成功、**357+ tests** 通过、扩展 bundle runtime smoke 通过。
154
155
 
155
- ## Agent 工具接入
156
+ ## Agent ????
156
157
 
157
- GraphFlow 支持两种对外接入方式�?
158
+ GraphFlow ????????????
158
159
 
159
- 1. **CLI 机器输出**:核心命令均支持 `--json`
160
- 2. **MCP stdio server**:CursorClaude Code 等可直接调用
160
+ 1. **CLI ????**???????? `--json`
161
+ 2. **MCP stdio server**?Cursor?Claude Code ??????
161
162
 
162
- 本仓库启�?MCP�?
163
+ ??????MCP??
163
164
 
164
165
  ```bash
165
166
  npm run start:mcp
166
167
  ```
167
168
 
168
- ### MCP 工具一览(10 个)
169
+ ### MCP ?????10 ??
169
170
 
170
- | 工具 | 用�?|
171
+ | ?? | ???|
171
172
  | --- | --- |
172
- | `graphflow_context` | 预览压缩上下文(query)或扩展锚点(anchorId)(**优先调用**�?|
173
- | `graphflow_plan` | 多步任务分解�?DAG 规划(mode='simple' �?'insight'�?|
174
- | `graphflow_run` | 规划 + 压缩上下文,输出 bridge 执行描述�?|
175
- | `graphflow_report_outcome` | �?GraphFlow 汇报任务执行结果,用于学习飞�?|
176
- | `graphflow_insight` | 提交或合�?agent 分析结果(Six Hats / plan prompts�?|
177
- | `graphflow_index` | 全工作区增量建图、单文件建图或全量重�?|
178
- | `graphflow_skill_insights` | 技能学习洞�?|
179
- | `graphflow_diagnose` | 路由健康、图谱统计与 token 节省 |
180
- | `graphflow_artifact` | 导出或导入压缩图�?artifact |
181
- | `graphflow_skill_guide` | 获取 GraphFlow Skill 使用指南 |
173
+ | `graphflow_context` | ????????query???????anchorId??**????**??|
174
+ | `graphflow_plan` | ????????DAG ???mode='simple' ??'insight'??|
175
+ | `graphflow_run` | ?? + ???????? bridge ??????|
176
+ | `graphflow_report_outcome` | ??GraphFlow ????????????????|
177
+ | `graphflow_insight` | ??????agent ?????Six Hats / plan prompts??|
178
+ | `graphflow_index` | ????????????????????|
179
+ | `graphflow_skill_insights` | ???????|
180
+ | `graphflow_diagnose` | ?????????? token ?? |
181
+ | `graphflow_artifact` | ??????????artifact |
182
+ | `graphflow_skill_guide` | ?? GraphFlow Skill ???? |
182
183
 
183
- **MCP 建图提示**:用户级 MCP 进程�?`cwd` 不一定是当前项目。请任选其一�?
184
+ **MCP ????**???? MCP ????`cwd` ????????????????
184
185
 
185
- - 调用 `graphflow_index` 时传�?`rootDir`(项目绝对路径)
186
- - �?MCP 配置中设�?`GRAPHFLOW_WORKSPACE_ROOT` 环境变量
187
- - 使用 VS Code 扩展「建立图谱」或项目�?`.cursor/mcp.json`
186
+ - ?? `graphflow_index` ????`rootDir`????????
187
+ - ??MCP ??????`GRAPHFLOW_WORKSPACE_ROOT` ????
188
+ - ?? VS Code ?????????????`.cursor/mcp.json`
188
189
 
189
- CLI 示例�?
190
+ CLI ????
190
191
 
191
192
  ```bash
192
193
  npm run start -- plan "refactor planner and add tests" --json
@@ -194,34 +195,34 @@ npm run start -- context preview "orchestrator" --json
194
195
  npm run start -- graph inspect --json
195
196
  ```
196
197
 
197
- 外部 agent 约定文件:`AGENTS.md`、`CLAUDE.md`、`.cursor/rules/graphflow.mdc`
198
+ ?? agent ?????`AGENTS.md`?`CLAUDE.md`?`.cursor/rules/graphflow.mdc`
198
199
 
199
- ## 本地功能验证(CLI�?
200
+ ## ???????CLI??
200
201
 
201
- ### 图谱索引
202
+ ### ????
202
203
 
203
204
  ```bash
204
205
  npm run start -- graph index .
205
206
  ```
206
207
 
207
- 预期:`indexedFiles=�? indexedSymbols=…`
208
+ ???`indexedFiles=?? indexedSymbols=?`
208
209
 
209
- ### 上下文压缩预�?
210
+ ### ????????
210
211
 
211
212
  ```bash
212
213
  npm run start -- context preview "orchestrator"
213
214
  ```
214
215
 
215
- 预期:`summary=�? anchors=�? tokens=…`(相对原始上下文通常可节�?**90%+ token**�?
216
+ ???`summary=?? anchors=?? tokens=?`??????????????**90%+ token**??
216
217
 
217
- ### 执行任务 / 规划
218
+ ### ???? / ??
218
219
 
219
220
  ```bash
220
221
  npm run start -- run "update readme and add tests"
221
222
  npm run start -- plan "update readme and add tests and refactor architecture module"
222
223
  ```
223
224
 
224
- ### 路由诊断 / 学习 / 洞察
225
+ ### ???? / ?? / ??
225
226
 
226
227
  ```bash
227
228
  npm run start -- route diagnose
@@ -230,27 +231,27 @@ npm run start -- graph inspect
230
231
  npm run start -- skill insights
231
232
  ```
232
233
 
233
- ## 进阶能力
234
+ ## ????
234
235
 
235
- ### 上下文压�?
236
+ ### ??????
236
237
 
237
- GraphFlow 的压缩采用「两层渐进」策略,先用零成本图结构压缩砍掉冗余节点,再用向量召回补充语义相关节点:
238
+ GraphFlow ??????????????????????????????????????????????
238
239
 
239
- | �?| 机制 | 成本 | 默认 |
240
+ | ??| ?? | ?? | ?? |
240
241
  | --- | --- | --- | --- |
241
- | 图结构压�?| 边权重连通子�?+ PageRank 中心性重�?| �?LLM | **开�?* |
242
- | 向量召回 | transformers.js embedding + 线性扫�?+ RRF 融合 | 本地模型 | **开�?* |
243
- | RepoMap 概览 | 预算紧张时返回模块级地图 | �?LLM | opt-in |
244
- | 自适应预算 | 按任务复杂度动态调�?token 预算 | �?LLM | opt-in |
242
+ | ??????| ????????+ PageRank ??????| ??LLM | **???* |
243
+ | ???? | transformers.js embedding + ?????+ RRF ?? | ???? | **???* |
244
+ | RepoMap ?? | ???????????? | ??LLM | opt-in |
245
+ | ????? | ???????????token ?? | ??LLM | opt-in |
245
246
 
246
- **向量召回设计**�?
247
+ **??????**??
247
248
 
248
- - 索引时:`file-indexer` 为每个节点生�?384 维语�?embedding(`@xenova/transformers` + `all-MiniLM-L6-v2`,约 22MB,纯 JS 推理�?
249
- - 查询时:�?query 生成同样维度�?embedding,与图中节点�?cosine similarity
250
- - 统一使用线性扫描(典型仓库 <10K 节点性能完全够用,无需 HNSW ANN�?
251
- - 关键词检�?+ 向量召回结果通过 RRFReciprocal Rank Fusion, k=60)融�?
249
+ - ????`file-indexer` ????????384 ????embedding?`@xenova/transformers` + `all-MiniLM-L6-v2`?? 22MB?? JS ????
250
+ - ??????query ????????embedding????????cosine similarity
251
+ - ????????????? <10K ??????????? HNSW ANN??
252
+ - ??????+ ???????? RRF?Reciprocal Rank Fusion, k=60????
252
253
 
253
- 配置示例�?
254
+ ??????
254
255
 
255
256
  ```json
256
257
  {
@@ -270,15 +271,15 @@ GraphFlow 的压缩采用「两层渐进」策略,先用零成本图结构压
270
271
  }
271
272
  ```
272
273
 
273
- 离线环境可提前预下载 `@xenova/transformers` 模型缓存,并通过 `embeddingPolicy.modelCacheDir` 或环境变�?`GRAPHFLOW_EMBEDDING_CACHE_DIR` 指向该目录�?
274
+ ?????????? `@xenova/transformers` ???????? `embeddingPolicy.modelCacheDir` ??????`GRAPHFLOW_EMBEDDING_CACHE_DIR` ???????
274
275
 
275
- 查看当前压缩与路由状态:
276
+ ????????????
276
277
 
277
278
  ```bash
278
279
  npm run start -- route diagnose
279
280
  ```
280
281
 
281
- ### SQLite / FTS5 后端
282
+ ### SQLite / FTS5 ??
282
283
 
283
284
  ```json
284
285
  {
@@ -290,7 +291,7 @@ npm run start -- route diagnose
290
291
  }
291
292
  ```
292
293
 
293
- WAL + FTS5 全文索引;与 `file` / `memory` 接口一致�?
294
+ WAL + FTS5 ?????? `file` / `memory` ??????
294
295
 
295
296
  ### Episodic Memory + Reflection
296
297
 
@@ -301,18 +302,18 @@ const run = await orchestrate(
301
302
  );
302
303
  ```
303
304
 
304
- 每次 task 写入 Episode(附�?embedding);相似 task 注入历史决策(Jaccard + embedding RRF 融合检索);`learn nightly` 合成 Lesson 节点;Lesson 自动注入后续任务�?planner prompt�?
305
+ ?? task ?? Episode????embedding???? task ???????Jaccard + embedding RRF ??????`learn nightly` ?? Lesson ???Lesson ??????????planner prompt??
305
306
 
306
- ### 技能学习飞�?
307
+ ### ???????
307
308
 
308
- - `applySkillLearning`:每次任务结束后提取技能原子,更新 Skill 节点 scorepass +1 / fail -1bounded [-20,20]�?
309
- - `suggestSkillHints`:查�?Skill 节点,按 score/uses 排序,返�?top-N 技能提�?
310
- - 技能提示独立注�?worker prompt,不依赖图谱上下文是否启�?
311
- - 复合技能:技能对共现次数达阈值后自动创建 composite skill 节点
309
+ - `applySkillLearning`????????????????? Skill ?? score?pass +1 / fail -1?bounded [-20,20]??
310
+ - `suggestSkillHints`????Skill ???? score/uses ??????top-N ?????
311
+ - ?????????worker prompt??????????????
312
+ - ???????????????????? composite skill ??
312
313
 
313
- ### 跨语言 AST 索引
314
+ ### ??? AST ??
314
315
 
315
- | 语言 | 扩展 |
316
+ | ?? | ?? |
316
317
  | --- | --- |
317
318
  | TypeScript / JavaScript | `.ts .tsx .js .jsx` |
318
319
  | Python | `.py` |
@@ -323,158 +324,159 @@ const run = await orchestrate(
323
324
  | Ruby | `.rb` |
324
325
  | Kotlin | `.kt` |
325
326
  | Swift | `.swift` |
327
+ | Dart | `.dart` |
326
328
 
327
- 通过 `graphPolicy.includeExtensions` 限制扫描范围。tree-sitter WASM 语法包在 `npm run build` 时打�?`wasm/` 并随 npm 包分发,安装后无需联网下载�?
329
+ ?? `graphPolicy.includeExtensions` ???????tree-sitter WASM ???? `npm run build` ????`wasm/` ?? npm ???????????????
328
330
 
329
- ### Agent MCP 自动安装
331
+ ### Agent MCP ????
330
332
 
331
- GraphFlow CLI 可自动检测并安装 MCP 配置�?15+ 编码 Agent�?
333
+ GraphFlow CLI ???????? MCP ????15+ ?? Agent??
332
334
 
333
335
  ```bash
334
- # 检测已安装�?Agent �?MCP 配置状�?
336
+ # ???????Agent ??MCP ?????
335
337
  npx @roarpeng/graphflow doctor
336
338
 
337
- # 一键安�?MCP + Skill + Cursor Rules(推荐)
339
+ # ?????MCP + Skill + Cursor Rules????
338
340
  npx @roarpeng/graphflow install
339
341
 
340
- # 或仅初始化项目级配置�?graphflow/config.json 等)
342
+ # ????????????graphflow/config.json ??
341
343
  npx @roarpeng/graphflow init
342
344
  ```
343
345
 
344
- **本地 `npm install` �?*:若项目已有 `.cursor/mcp.json` �?`.vscode/mcp.json`,postinstall 会自动注�?workspace �?GraphFlow MCP �?Skill;完整用户级安装请运�?`npx @roarpeng/graphflow install`�?
346
+ **?? `npm install` ??*?????? `.cursor/mcp.json` ??`.vscode/mcp.json`?postinstall ??????workspace ??GraphFlow MCP ??Skill????????????`npx @roarpeng/graphflow install`??
345
347
 
346
- ### Trae / Trae CN 推荐配置
348
+ ### Trae / Trae CN ????
347
349
 
348
- Trae 区分 **Rules**(每轮自动加载)�?**Skill**(按需匹配)。仅�?Skill �?GraphFlow 触发频率偏低;`install` / `init` 会在项目内写入:
350
+ Trae ?? **Rules**??????????**Skill**??????????Skill ??GraphFlow ???????`install` / `init` ????????
349
351
 
350
- | 路径 | 作用 |
352
+ | ?? | ?? |
351
353
  |------|------|
352
- | `.trae/rules/graphflow.md` | `alwaysApply: true` �?每轮强制先调 `graphflow_context` |
353
- | `.trae/skills/graphflow/SKILL.md` | 详细 10 工具工作流;可用 `#graphflow` 手动触发 |
354
- | `~/.config/Trae CN/User/skills/graphflow/SKILL.md` | 用户�?Skill(跨项目�?|
355
- | `User/mcp.json` | GraphFlow MCP 服务�?|
354
+ | `.trae/rules/graphflow.md` | `alwaysApply: true` ???????? `graphflow_context` |
355
+ | `.trae/skills/graphflow/SKILL.md` | ?? 10 ???????? `#graphflow` ???? |
356
+ | `~/.config/Trae CN/User/skills/graphflow/SKILL.md` | ????Skill??????|
357
+ | `User/mcp.json` | GraphFlow MCP ????|
356
358
 
357
359
  ```bash
358
- # 在项目根目录执行(fat-battle/webGraphFlow 等)
360
+ # ?????????fat-battle/web?GraphFlow ??
359
361
  npx @roarpeng/graphflow install
360
- npx @roarpeng/graphflow doctor # 检�?Trae CN rules/skill/MCP 是否就绪
362
+ npx @roarpeng/graphflow doctor # ???Trae CN rules/skill/MCP ????
361
363
  ```
362
364
 
363
- **注意**:MCP 配置中不要硬编码 `GRAPHFLOW_WORKSPACE_ROOT` 到其他项目;�?Trae 打开哪个仓库,就�?Agent �?`graphflow_context` 里传该仓库的 `rootDir`�?
365
+ **??**?MCP ???????? `GRAPHFLOW_WORKSPACE_ROOT` ????????Trae ??????????Agent ??`graphflow_context` ?????? `rootDir`??
364
366
 
365
- ### Antigravity IDE 推荐配置
367
+ ### Antigravity IDE ????
366
368
 
367
- | 路径 | 作用 |
369
+ | ?? | ?? |
368
370
  |------|------|
369
- | `~/.gemini/antigravity/mcp_config.json` | 全局 MCP(`mcpServers` 键) |
370
- | `~/.gemini/antigravity/skills/graphflow/SKILL.md` | 全局 Skill |
371
- | `.agent/rules/graphflow.md` | 项目�?Rules |
372
- | `.agent/skills/graphflow/SKILL.md` | 项目�?Skill |
373
- | `GEMINI.md` | 项目级受管指令块 |
371
+ | `~/.gemini/antigravity/mcp_config.json` | ?? MCP?`mcpServers` ?? |
372
+ | `~/.gemini/antigravity/skills/graphflow/SKILL.md` | ?? Skill |
373
+ | `.agent/rules/graphflow.md` | ????Rules |
374
+ | `.agent/skills/graphflow/SKILL.md` | ????Skill |
375
+ | `GEMINI.md` | ???????? |
374
376
 
375
- ### Gemini CLI 推荐配置
377
+ ### Gemini CLI ????
376
378
 
377
- | 路径 | 作用 |
379
+ | ?? | ?? |
378
380
  |------|------|
379
- | `~/.gemini/settings.json` | MCP 服务�?|
380
- | `~/.gemini/GEMINI.md` | 全局受管指令�?|
381
+ | `~/.gemini/settings.json` | MCP ????|
382
+ | `~/.gemini/GEMINI.md` | ????????|
381
383
 
382
- ### VS Code / GitHub Copilot 推荐配置
384
+ ### VS Code / GitHub Copilot ????
383
385
 
384
- | 路径 | 作用 |
386
+ | ?? | ?? |
385
387
  |------|------|
386
- | `~/.config/Code/User/mcp.json` | 用户�?MCP(`servers` 键) |
387
- | `.github/copilot-instructions.md` | 仓库�?Copilot 指令(token-first�?|
388
- | `.vscode/mcp.json` | 可选项目级 MCP |
388
+ | `~/.config/Code/User/mcp.json` | ????MCP?`servers` ?? |
389
+ | `.github/copilot-instructions.md` | ????Copilot ???token-first??|
390
+ | `.vscode/mcp.json` | ????? MCP |
389
391
 
390
392
  ```bash
391
- npx @roarpeng/graphflow install # 用户�?MCP + Skills
392
- npx @roarpeng/graphflow install --scope all # 含项目级 Rules / Copilot 指令
393
+ npx @roarpeng/graphflow install # ????MCP + Skills
394
+ npx @roarpeng/graphflow install --scope all # ???? Rules / Copilot ??
393
395
  npx @roarpeng/graphflow doctor
394
396
  ```
395
397
 
396
- 支持�?AgentCursorVS CodeTraeClaude CodeWindsurfClineRoo CodeKilo CodePearAIGeminiCodexAntigravityAmazon QZedContinue�?
398
+ ????Agent?Cursor?VS Code?Trae?Claude Code?Windsurf?Cline?Roo Code?Kilo Code?PearAI?Gemini?Codex?Antigravity?Amazon Q?Zed?Continue??
397
399
 
398
- ## 配置文件
400
+ ## ????
399
401
 
400
- 默认:`graphflow.config.json`(也可使�?`~/.graphflow.config.json` 全局配置)�?
402
+ ???`graphflow.config.json`??????`~/.graphflow.config.json` ???????
401
403
 
402
404
  ```bash
403
405
  cp graphflow.config.example.json graphflow.config.json
404
406
  ```
405
407
 
406
- ### 全局 vs 项目配置
408
+ ### ?? vs ????
407
409
 
408
- | 层级 | 路径 | 适合存放 |
410
+ | ?? | ?? | ???? |
409
411
  | --- | --- | --- |
410
- | 全局 | `~/.graphflow.config.json` | ProviderAPI KeySmart/Economy 模型、路由策�?|
411
- | 项目�?| `graphflow.config.json` | 项目专属覆盖(可选) |
412
- | 项目覆盖 | `.graphflow/config.json` | 工作区局部覆盖(`graphflow init` 生成�?|
412
+ | ?? | `~/.graphflow.config.json` | Provider?API Key?Smart/Economy ????????|
413
+ | ????| `graphflow.config.json` | ?????????? |
414
+ | ???? | `.graphflow/config.json` | ????????`graphflow init` ????|
413
415
 
414
- **多项目重要约�?*�?
416
+ **????????*??
415
417
 
416
- - 图谱文件默认写在**当前工作�?*下的 `graphflow-out/graphflow-graph.json`
417
- - 全局配置**不应**包含固定�?`workspaceRoot`(旧版本若已写入,请删除该字段)
418
- - MCP / 脚本可通过环境变量指定工作区:`GRAPHFLOW_WORKSPACE_ROOT=/path/to/project`
418
+ - ????????**??????*?? `graphflow-out/graphflow-graph.json`
419
+ - ????**??**??????`workspaceRoot`????????????????
420
+ - MCP / ???????????????`GRAPHFLOW_WORKSPACE_ROOT=/path/to/project`
419
421
 
420
- 关键项:
422
+ ????
421
423
 
422
- | 配置 | 说明 |
424
+ | ?? | ?? |
423
425
  | --- | --- |
424
426
  | `graphPolicy.transport` | `file` / `memory` / `sqlite` / `mcp-http` |
425
- | `graphPolicy.graphStorePath` | 相对当前工作区的 JSON �?`.sqlite` 路径 |
426
- | `graphPolicy.maxContextTokens` | 压缩上下文预算(默认 **1500**�?|
427
- | `graphPolicy.autoIndexOnSave` | 保存后增量索引(默认 **true**�?|
428
- | `graphPolicy.autoIndexOnPreview` / `autoIndexOnRun` | preview / run 前自动索�?|
429
- | `graphPolicy.enableNearLosslessMode` | 近无损上下文打包 |
427
+ | `graphPolicy.graphStorePath` | ???????? JSON ??`.sqlite` ?? |
428
+ | `graphPolicy.maxContextTokens` | ?????????? **1500**??|
429
+ | `graphPolicy.autoIndexOnSave` | ?????????? **true**??|
430
+ | `graphPolicy.autoIndexOnPreview` / `autoIndexOnRun` | preview / run ??????|
431
+ | `graphPolicy.enableNearLosslessMode` | ???????? |
430
432
 
431
- | `graphPolicy.layerQuota` | L1/L2/L3 锚点配额 |
432
- | `routingPolicy.enableDynamicRouting` | provider 健康路由 |
433
- | `skillPolicy.enableSkillFlywheel` | 技能飞�?|
434
- | `embeddingPolicy.provider` | embedding 提供者(`transformers` 本地 / `openai`�?|
433
+ | `graphPolicy.layerQuota` | L1/L2/L3 ???? |
434
+ | `routingPolicy.enableDynamicRouting` | provider ???? |
435
+ | `skillPolicy.enableSkillFlywheel` | ?????|
436
+ | `embeddingPolicy.provider` | embedding ????`transformers` ?? / `openai`??|
435
437
 
436
- ## VS Code / Cursor 扩展
438
+ ## VS Code / Cursor ??
437
439
 
438
- 扩展内置 GraphFlow runtime�?*安装 VSIX 后无需�?clone 本仓库或配置 `npm run start`**。VSIX 仍不捆绑 `@xenova/transformers` 模型包;需要本地语义向量时可预置缓存并设置 `GRAPHFLOW_EMBEDDING_CACHE_DIR`。Installer 支持面已冻结,后续不再继续扩展新�?IDE 安装目标�?
440
+ ???? GraphFlow runtime??*?? VSIX ?????clone ?????? `npm run start`**?VSIX ???? `@xenova/transformers` ????????????????????? `GRAPHFLOW_EMBEDDING_CACHE_DIR`?Installer ??????????????????IDE ??????
439
441
 
440
- ### 安装 VSIX(推荐)
442
+ ### ?? VSIX????
441
443
 
442
- 1. 打开 [GitHub Releases](https://github.com/Roarpeng/GraphFlow/releases),下载最�?`graphflow-tool-<version>.vsix`(CI 在每�?push `main` / tag 后自动构建)
443
- 2. **VS Code**:扩展视�?�?`…` �?**�?VSIX 安装�?* �?选择下载的文�?
444
- 3. **Cursor**:扩展视�?�?右上�?`…` �?**Install from VSIX** �?选择下载的文�?
445
- 4. 重启编辑器;首次激活会自动尝试安装 GraphFlow MCP 到本�?Agent 配置
446
- 5. 命令面板运行 **GraphFlow: Show Settings** �?**建立图谱(无需 LLM�?* �?即可使用 Context Preview / 知识图谱
444
+ 1. ?? [GitHub Releases](https://github.com/Roarpeng/GraphFlow/releases)??????`graphflow-tool-<version>.vsix`?CI ????push `main` / tag ??????
445
+ 2. **VS Code**????????`?` ??**??VSIX ????* ??????????
446
+ 3. **Cursor**????????????`?` ??**Install from VSIX** ??????????
447
+ 4. ????????????????? GraphFlow MCP ????Agent ??
448
+ 5. ?????? **GraphFlow: Show Settings** ??**??????? LLM??* ?????? Context Preview / ????
447
449
 
448
- CLI 安装(若已安�?`code` / `cursor` 命令):
450
+ CLI ????????`code` / `cursor` ????
449
451
 
450
452
  ```bash
451
- code --install-extension graphflow-tool-1.7.7.vsix
452
- cursor --install-extension graphflow-tool-1.7.7.vsix
453
+ code --install-extension graphflow-tool-1.7.10.vsix
454
+ cursor --install-extension graphflow-tool-1.7.10.vsix
453
455
  ```
454
456
 
455
- ### 命令面板
457
+ ### ????
456
458
 
457
- | 命令 | 说明 |
459
+ | ?? | ?? |
458
460
  | --- | --- |
459
- | GraphFlow: Show Settings | 配置、建图、路由测�?|
460
- | GraphFlow: Show Graph | **知识图谱可视�?*(分层、搜索、跳转源码) |
461
- | GraphFlow: Preview Context | 上下文压缩与 Token Budget |
462
- | GraphFlow: Plan & Brainstorm | 任务规划 |
463
- | GraphFlow: Run Task | 执行任务 |
464
- | GraphFlow: Skill Insights | 技能学习面�?|
465
- | GraphFlow: Install MCP | 注入 MCP 配置 |
461
+ | GraphFlow: Show Settings | ???????????|
462
+ | GraphFlow: Show Graph | **????????*???????????? |
463
+ | GraphFlow: Preview Context | ?????? Token Budget |
464
+ | GraphFlow: Plan & Brainstorm | ???? |
465
+ | GraphFlow: Run Task | ???? |
466
+ | GraphFlow: Skill Insights | ???????|
467
+ | GraphFlow: Install MCP | ?? MCP ?? |
466
468
 
467
- Chat Agent(`@graphflow`):`/run`、`/plan`、`/graph`、`/skills`、`/diagnose`、`/learn`、`/history`
469
+ Chat Agent?`@graphflow`??`/run`?`/plan`?`/graph`?`/skills`?`/diagnose`?`/learn`?`/history`
468
470
 
469
- ### Settings 推荐流程
471
+ ### Settings ????
470
472
 
471
- 1. 填写 Graph Store Path �?**Save Settings**
472
- 2. **建立图谱(无需 LLM�?* �?生成结构图谱
473
- 3. (可选)配置 Provider �?**测试路由并建立图�?*
473
+ 1. ?? Graph Store Path ??**Save Settings**
474
+ 2. **??????? LLM??* ????????
475
+ 3. ?????? Provider ??**??????????*
474
476
 
475
- 其它建图入口:`graph index` CLIMCP `graphflow_index`、`autoIndexOnPreview` / `autoIndexOnRun` / `autoIndexOnSave`
477
+ ???????`graph index` CLI?MCP `graphflow_index`?`autoIndexOnPreview` / `autoIndexOnRun` / `autoIndexOnSave`
476
478
 
477
- ### 开发模式(贡献者)
479
+ ### ?????????
478
480
 
479
481
  ```bash
480
482
  cd vscode-extension
@@ -482,76 +484,76 @@ npm install
482
484
  npm run build
483
485
  ```
484
486
 
485
- �?VS Code �?`F5` 启动 Extension Development Host�?
487
+ ??VS Code ??`F5` ?? Extension Development Host??
486
488
 
487
- ### 本地打包 VSIX
489
+ ### ???? VSIX
488
490
 
489
491
  ```bash
490
492
  npm run package:extension
491
- # 输出:artifacts/graphflow-tool-<version>.vsix
493
+ # ???artifacts/graphflow-tool-<version>.vsix
492
494
  ```
493
495
 
494
- ## 本地验收清单
496
+ ## ??????
495
497
 
496
- 1. `npm run ci` 全绿
497
- 2. `graph index` �?`indexedFiles > 0`
498
- 3. `context preview` �?`summary > 0` �?`anchors > 0`
499
- 4. VS Code **Show Graph** �?画布正常显示节点聚类(非角落小点�?
500
- 5. `plan` / `run` 返回正常输出
501
- 6. `route diagnose` �?显示 provider 路由状�?
498
+ 1. `npm run ci` ??
499
+ 2. `graph index` ??`indexedFiles > 0`
500
+ 3. `context preview` ??`summary > 0` ??`anchors > 0`
501
+ 4. VS Code **Show Graph** ????????????????????
502
+ 5. `plan` / `run` ??????
503
+ 6. `route diagnose` ???? provider ?????
502
504
 
503
- ## 常见问题
505
+ ## ????
504
506
 
505
- **切换项目�?Snapshot 显示别的仓库的图�?*
507
+ **??????Snapshot ??????????*
506
508
 
507
- - 检�?`~/.graphflow.config.json` 是否含有旧的 `workspaceRoot`�?*删除该字�?*后重载窗�?
508
- - 在当前项目重新「建立图谱」,确认顶栏 `store` 路径指向本项目的 `graphflow-out/`
509
+ - ???`~/.graphflow.config.json` ?????? `workspaceRoot`??*??????*??????
510
+ - ?????????????????? `store` ???????? `graphflow-out/`
509
511
 
510
- **MCP 建图失败或索引到错误目录**
512
+ **MCP ????????????**
511
513
 
512
- - `graphflow_index` 传入 `rootDir: "/你的项目绝对路径"`
513
- - 或在 MCP 配置中加 `"env": { "GRAPHFLOW_WORKSPACE_ROOT": "/你的项目绝对路径" }`
514
- - 离线环境索引多语言项目时,WASM 语法包已�?`@roarpeng/graphflow` 安装包内置,无需联网下载
514
+ - `graphflow_index` ?? `rootDir: "/????????"`
515
+ - ?? MCP ???? `"env": { "GRAPHFLOW_WORKSPACE_ROOT": "/????????" }`
516
+ - ?????????????WASM ??????`@roarpeng/graphflow` ????????????
515
517
 
516
- **`context preview` 返回 0 anchors**
518
+ **`context preview` ?? 0 anchors**
517
519
 
518
- - 先执�?`graph index` �?Settings 建图
519
- - 检查查询词是否命中代码符号(如 `orchestrator`、`planner`�?
520
+ - ????`graph index` ??Settings ??
521
+ - ??????????????? `orchestrator`?`planner`??
520
522
 
521
- **知识图谱面板空白或只有小�?*
523
+ **??????????????*
522
524
 
523
- - 点击画布工具�?**「适应�?*
524
- - 注意:画布展示的�?*采样子图**(约 120 节点),全库规模请看顶栏统计
525
+ - ????????**?????*
526
+ - ??????????*????**?? 120 ??????????????
525
527
 
526
- **API Key 未配�?*
528
+ **API Key ????*
527
529
 
528
- - �?`graphflow.config.json` 配置 provider `apiKey`,支�?`${ENV_VAR}` 占位
529
- - **DeepSeek(推荐)**:`providers.deepseek` + `tiers.*.provider: "deepseek"`,Base URL 默认 `https://api.deepseek.com`,模型用 `deepseek-v4-pro` / `deepseek-v4-flash`(见 [DeepSeek API 文档](https://api-docs.deepseek.com/zh-cn/)�?
530
+ - ??`graphflow.config.json` ?? provider `apiKey`????`${ENV_VAR}` ??
531
+ - **DeepSeek????**?`providers.deepseek` + `tiers.*.provider: "deepseek"`?Base URL ?? `https://api.deepseek.com`???? `deepseek-v4-pro` / `deepseek-v4-flash`?? [DeepSeek API ??](https://api-docs.deepseek.com/zh-cn/)??
530
532
 
531
- **�?LLM 时能用吗**
533
+ **??LLM ????**
532
534
 
533
- - 可以:结构索引、图谱可视化、context preview(基于结构图�?+ transformers.js 语义向量召回)、MCP `graphflow_diagnose` 均不强制 LLM
534
- - 只有 Six Hats 深度规划�?LLM 语义压缩需要配�?provider
535
+ - ??????????????context preview????????+ transformers.js ????????MCP `graphflow_diagnose` ???? LLM
536
+ - ?? Six Hats ??????LLM ?????????provider
535
537
 
536
- ## 项目结构
538
+ ## ????
537
539
 
538
540
  ```text
539
541
  GraphFlow/
540
542
  ├── src/
541
- �? ├── core/ # 编排核心:orchestrator, triage, dag-engine, types
542
- �? ├── graph/ # 索引、上下文切片、图压缩、snapshot
543
- �? ├── routing/ # 模型路由与健康探测(deepseek/openai/anthropic/bailian/doubao�?
544
- �? ├── learning/ # embeddings, episode, skill-flywheel, reflector, hnsw
545
- �? └── surfaces/
546
- �? ├── cli/ # CLI + runtime 子模�?
547
- �? └── mcp/ # MCP server (10 tools)
548
- ├── tests/ # 59 文件 / 280+ tests
549
- ├── vscode-extension/ # VS Code 面板与命�?
543
+ ├── core/ # 编排核心:orchestrator, triage, dag-engine, types
544
+ ├── graph/ # 索引、上下文切片、图压缩、snapshot
545
+ ├── routing/ # 模型路由与健康探测(deepseek/openai/anthropic/bailian/doubao
546
+ ├── learning/ # embeddings, episode, skill-flywheel, reflector, hnsw
547
+ └── surfaces/
548
+ ├── cli/ # CLI + runtime 子模块
549
+ └── mcp/ # MCP server (10 tools)
550
+ ├── tests/ # 72 文件 / 357+ tests
551
+ ├── vscode-extension/ # VS Code 面板与命令
550
552
  ├── docs/
551
553
  └── CHANGELOG.md
552
554
  ```
553
555
 
554
- ## 版本与变�?
556
+ ## ??????
555
557
 
556
- - 变更日志:`CHANGELOG.md`
557
- - LicenseApache-2.0
558
+ - ?????`CHANGELOG.md`
559
+ - License?Apache-2.0