@devflow-tools/context-engine 0.8.10 → 0.8.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/README.md +18 -10
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @devflow-tools/context-engine
2
2
 
3
- Context engine for DevFlow intelligently retrieves the most relevant code snippets for natural language queries.
3
+ DevFlow 上下文引擎智能代码检索,支持通用上下文、Onboarding Pack 和任务级上下文构建。
4
4
 
5
5
  ## Installation
6
6
 
@@ -14,24 +14,32 @@ npm install @devflow-tools/context-engine
14
14
  import { ContextEngine } from '@devflow-tools/context-engine';
15
15
 
16
16
  const engine = new ContextEngine({ projectRoot: '/path/to/project' });
17
+
18
+ // 构建通用上下文
17
19
  const context = await engine.buildContext('user authentication flow');
18
20
  console.log(context.files);
21
+
22
+ // 构建任务级上下文(含风险提示、下一步行动)
23
+ const taskContext = await engine.buildTaskContext('fix the login bug');
19
24
  ```
20
25
 
21
26
  ## Features
22
27
 
23
- - **Intent parsing** extract keywords from natural language queries
24
- - **Fuzzy search** — find relevant symbols even with partial matches
25
- - **Multi-dimensional ranking** — combines dependency graph, memory, and knowledge signals
26
- - **Token budget control** compress results to fit context windows (fast/deep modes)
28
+ - **通用上下文**自然语言查询 最相关代码片段,结合依赖图、记忆、知识库多维度排序
29
+ - **Onboarding Pack** — 项目新手包自动生成(统计、分层、关键模块/文件/符号、推荐插件/工作流)
30
+ - **Task Context** — 任务类型识别(debug/feature/understand/review/refactor),文件分组(required/optional),风险提示和下一步行动推荐
31
+ - **Token 预算控制**fast/deep 模式自动压缩结果拟合 context window
32
+ - **Intent 解析** — 从自然语言提取关键词和意图
33
+ - **反馈系统** — 支持 hit/partial/miss 反馈,持续优化排序
27
34
 
28
35
  ## API
29
36
 
30
- - `createEngines(projectRoot)` — initialize all engines (indexer, graph, context)
31
- - `ContextEngine`context building engine
32
- - `parseIntent(query)` — parse user query into structured intent
33
- - `fuzzySearch(query, symbols)` — fuzzy symbol search
34
- - `compressToTokenLimit(text, limit)` — compress context to token budget
37
+ - `new ContextEngine({ projectRoot })` — 构造函数
38
+ - `.buildContext(query, options?)` — 通用上下文检索
39
+ - `.buildTaskContext(query, options?)` — 任务级上下文(含风险提示、下一步行动)
40
+ - `.onboard()` — 生成 Onboarding Pack
41
+ - `.submitFeedback(contextId, rating)` — 提交上下文反馈
42
+ - `.getFeedbackSummary()` — 反馈汇总
35
43
 
36
44
  ## License
37
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/context-engine",
3
- "version": "0.8.10",
3
+ "version": "0.8.11",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,10 +18,10 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@colbymchenry/codegraph": "^1.1.1",
21
- "@devflow-tools/knowledge-engine": "^0.8.10",
22
- "@devflow-tools/memory-engine": "^0.8.10",
23
- "@devflow-tools/sdk": "^0.8.10",
24
- "@devflow-tools/telemetry": "^0.8.10"
21
+ "@devflow-tools/knowledge-engine": "^0.8.11",
22
+ "@devflow-tools/memory-engine": "^0.8.11",
23
+ "@devflow-tools/sdk": "^0.8.11",
24
+ "@devflow-tools/telemetry": "^0.8.11"
25
25
  },
26
26
  "devDependencies": {
27
27
  "typescript": "^5.5.0",
@@ -30,5 +30,5 @@
30
30
  "files": [
31
31
  "dist"
32
32
  ],
33
- "gitHead": "ac4f93d6a52fa40b4126b514e899eee581f8f46e"
33
+ "gitHead": "a0a0b61377aa88ebbd380f50a5d532f63175ef45"
34
34
  }