@roarpeng/graphflow 1.4.3 → 1.7.0
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/AGENTS.md +11 -37
- package/CHANGELOG.md +40 -0
- package/CLAUDE.md +1 -1
- package/README.md +116 -44
- package/dist/agents/atp-schema.d.ts +59 -0
- package/dist/agents/atp-schema.d.ts.map +1 -0
- package/dist/agents/atp-schema.js +3 -0
- package/dist/agents/atp-schema.js.map +1 -0
- package/dist/agents/decision-engine.d.ts +55 -0
- package/dist/agents/decision-engine.d.ts.map +1 -0
- package/dist/agents/decision-engine.js +338 -0
- package/dist/agents/decision-engine.js.map +1 -0
- package/dist/agents/insight.d.ts +57 -1
- package/dist/agents/insight.d.ts.map +1 -1
- package/dist/agents/insight.js +365 -2
- package/dist/agents/insight.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +1 -2
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/discover-workspace.d.ts.map +1 -1
- package/dist/config/discover-workspace.js +4 -0
- package/dist/config/discover-workspace.js.map +1 -1
- package/dist/config/embedding-factory.js +6 -6
- package/dist/config/embedding-factory.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +1 -2
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +1 -2
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/core/agent-delegation.d.ts +3 -1
- package/dist/core/agent-delegation.d.ts.map +1 -1
- package/dist/core/agent-delegation.js +121 -0
- package/dist/core/agent-delegation.js.map +1 -1
- package/dist/core/orchestrator-context.d.ts.map +1 -1
- package/dist/core/orchestrator-context.js +25 -3
- package/dist/core/orchestrator-context.js.map +1 -1
- package/dist/core/types.d.ts +12 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/graph/context-slicer-types.d.ts +0 -4
- package/dist/graph/context-slicer-types.d.ts.map +1 -1
- package/dist/graph/context-slicer-types.js.map +1 -1
- package/dist/graph/context-slicer.d.ts.map +1 -1
- package/dist/graph/context-slicer.js +5 -15
- package/dist/graph/context-slicer.js.map +1 -1
- package/dist/graph/file-indexer-walker.d.ts +3 -0
- package/dist/graph/file-indexer-walker.d.ts.map +1 -1
- package/dist/graph/file-indexer-walker.js.map +1 -1
- package/dist/graph/file-indexer.d.ts +1 -0
- package/dist/graph/file-indexer.d.ts.map +1 -1
- package/dist/graph/file-indexer.js +14 -18
- package/dist/graph/file-indexer.js.map +1 -1
- package/dist/integrations/agent-mcp-installer.d.ts.map +1 -1
- package/dist/integrations/agent-mcp-installer.js +26 -10
- package/dist/integrations/agent-mcp-installer.js.map +1 -1
- package/dist/integrations/skill-installer.d.ts +24 -2
- package/dist/integrations/skill-installer.d.ts.map +1 -1
- package/dist/integrations/skill-installer.js +262 -18
- package/dist/integrations/skill-installer.js.map +1 -1
- package/dist/learning/embeddings.d.ts +2 -3
- package/dist/learning/embeddings.d.ts.map +1 -1
- package/dist/learning/embeddings.js +18 -33
- package/dist/learning/embeddings.js.map +1 -1
- package/dist/learning/hnsw-index.d.ts +9 -35
- package/dist/learning/hnsw-index.d.ts.map +1 -1
- package/dist/learning/hnsw-index.js +8 -154
- package/dist/learning/hnsw-index.js.map +1 -1
- package/dist/surfaces/antigravity-rules/graphflow.md +45 -0
- package/dist/surfaces/cli/init.d.ts.map +1 -1
- package/dist/surfaces/cli/init.js +24 -1
- package/dist/surfaces/cli/init.js.map +1 -1
- package/dist/surfaces/cli/runtime/graph.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime/graph.js +0 -1
- package/dist/surfaces/cli/runtime/graph.js.map +1 -1
- package/dist/surfaces/cli/runtime/settings.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime/settings.js +0 -5
- package/dist/surfaces/cli/runtime/settings.js.map +1 -1
- package/dist/surfaces/cli/runtime/types.d.ts +0 -8
- package/dist/surfaces/cli/runtime/types.d.ts.map +1 -1
- package/dist/surfaces/copilot-instructions/graphflow.md +74 -0
- package/dist/surfaces/cursor-rules/graphflow.mdc +17 -25
- package/dist/surfaces/mcp/tool-definitions.d.ts.map +1 -1
- package/dist/surfaces/mcp/tool-definitions.js +31 -124
- package/dist/surfaces/mcp/tool-definitions.js.map +1 -1
- package/dist/surfaces/mcp/tool-handlers.d.ts.map +1 -1
- package/dist/surfaces/mcp/tool-handlers.js +78 -42
- package/dist/surfaces/mcp/tool-handlers.js.map +1 -1
- package/dist/surfaces/trae-rules/graphflow.md +52 -0
- package/dist/surfaces/trae-skill/graphflow/SKILL.md +104 -73
- package/package.json +5 -2
- package/src/surfaces/antigravity-rules/graphflow.md +45 -0
- package/src/surfaces/copilot-instructions/graphflow.md +74 -0
- package/src/surfaces/cursor-rules/graphflow.mdc +17 -25
- package/src/surfaces/trae-rules/graphflow.md +52 -0
- package/src/surfaces/trae-skill/graphflow/SKILL.md +104 -73
package/AGENTS.md
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
# GraphFlow
|
|
1
|
+
# GraphFlow for Claude Code
|
|
2
2
|
|
|
3
|
-
GraphFlow
|
|
3
|
+
Use GraphFlow as a local orchestration and context service.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Recommended setup
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
2. Fall back to CLI with `--json` when MCP is unavailable.
|
|
9
|
-
|
|
10
|
-
## MCP startup
|
|
11
|
-
|
|
12
|
-
Installed package:
|
|
7
|
+
Add a local MCP server entry that launches GraphFlow over stdio:
|
|
13
8
|
|
|
14
9
|
```json
|
|
15
10
|
{
|
|
@@ -22,7 +17,7 @@ Installed package:
|
|
|
22
17
|
}
|
|
23
18
|
```
|
|
24
19
|
|
|
25
|
-
|
|
20
|
+
During repository development you can also point Claude Code at this checkout:
|
|
26
21
|
|
|
27
22
|
```json
|
|
28
23
|
{
|
|
@@ -36,31 +31,10 @@ From this repository:
|
|
|
36
31
|
}
|
|
37
32
|
```
|
|
38
33
|
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
- Use `graphflow_plan` before multi-step edits.
|
|
42
|
-
- Use `graphflow_preview_context` before large refactors or codebase-wide questions.
|
|
43
|
-
- Use `graphflow_run` when you want GraphFlow to plan and package a task with compressed context, returning a structured execution descriptor (executionDescriptor) for you to execute. GraphFlow delegates execution to external coding agents by default (bridge mode).
|
|
44
|
-
- **Mandatory:** after executing work from a `graphflow_run` `executionDescriptor`, call `graphflow_report_outcome` with the `episodeId` from the run result, a `success` boolean, and optional `lessons`. This closes the skill flywheel loop.
|
|
45
|
-
- Use `graphflow_index` after workspace changes if graph freshness matters.
|
|
46
|
-
- Use `graphflow_inspect_graph` and `graphflow_skill_insights` for observability.
|
|
47
|
-
- Use `graphflow_diagnose` when model/provider routing looks wrong.
|
|
48
|
-
|
|
49
|
-
### No API key? Use agent-delegated LLM
|
|
50
|
-
|
|
51
|
-
When no GraphFlow provider API is configured, `graphflow_plan_insight` and complex `graphflow_run` return **`agentWorkItems`**: Six Hats + plan prompts for **you** (the connected coding agent) to answer with your own model. GraphFlow still supplies heuristic plans, compressed graph context, and DAG structure — no external GraphFlow API required.
|
|
52
|
-
|
|
53
|
-
After answering `agentWorkItems` prompts, call `graphflow_submit_insight` with `task`, `workItemId`, and your JSON `response` to persist each answer as a Decision node in the graph (optionally pass `episodeId` from `graphflow_run` for traceability). When all items are submitted, call `graphflow_merge_insight` to merge into a full Six Hats insight and refined DAG plan before execution.
|
|
54
|
-
|
|
55
|
-
## CLI fallback
|
|
56
|
-
|
|
57
|
-
Examples:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
npx @roarpeng/graphflow plan "refactor planner and add tests" --json
|
|
61
|
-
npx @roarpeng/graphflow context preview "orchestrator" --json
|
|
62
|
-
npx @roarpeng/graphflow route diagnose --json
|
|
63
|
-
npx @roarpeng/graphflow outcome report <episodeId> <success> --json
|
|
64
|
-
```
|
|
34
|
+
## Usage guidance
|
|
65
35
|
|
|
66
|
-
|
|
36
|
+
- Ask GraphFlow to plan before broad changes: `graphflow_plan`.
|
|
37
|
+
- Ask GraphFlow to compress and anchor code context: `graphflow_context`.
|
|
38
|
+
- Ask GraphFlow to inspect graph state or skill learnings when the repo history matters.
|
|
39
|
+
- After executing work from a `graphflow_run` `executionDescriptor`, **must** call `graphflow_report_outcome` with the `episodeId` from the run result, a `success` boolean, and optional `lessons` to close the skill flywheel loop.
|
|
40
|
+
- Fall back to `graphflow ... --json` only if MCP is not available (including `graphflow --json outcome report <episodeId> <success>`).
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,46 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [1.7.0] - 2026-07-11
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **P0 向量召回修正**:引入 `@xenova/transformers` + `all-MiniLM-L6-v2`(384 维,约 22MB),实现真正的本地语义 embedding 召回
|
|
12
|
+
- **P2 ATP 自适应截断**:简单任务(低优先级、无约束、短描述)自动 short-circuit,跳过 First Principles / Decision Matrix / Reflection,节省 4-6 次 LLM 调用
|
|
13
|
+
- **P2 MCP 工具精简**:18 个工具合并为 10 个核心工具,降低 LLM 工具调用认知负荷
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **embedding provider 默认改为 `transformers`**:替代原有的 FNV-1a hash embedding(伪语义)
|
|
18
|
+
- **MCP 工具合并**:
|
|
19
|
+
- `graphflow_context` = `preview_context` + `expand_anchor`
|
|
20
|
+
- `graphflow_plan` = `plan` + `plan_insight`(mode 参数区分)
|
|
21
|
+
- `graphflow_index` = `index` + `index_file` + `rebuild`
|
|
22
|
+
- `graphflow_insight` = `submit_insight` + `merge_insight`
|
|
23
|
+
- `graphflow_diagnose` = `diagnose` + `inspect_graph` + `stats`
|
|
24
|
+
- `graphflow_artifact` = `export_artifact` + `import_artifact`
|
|
25
|
+
|
|
26
|
+
### Removed
|
|
27
|
+
|
|
28
|
+
- **P1 移除 `hnswlib-node`**:彻底移除 C++ 编译依赖,向量召回统一使用纯线性扫描
|
|
29
|
+
- 移除 `graphPolicy.enableHnsw` 配置项及相关代码
|
|
30
|
+
- 移除 `hash` embedding provider 及相关函数
|
|
31
|
+
|
|
32
|
+
## [1.4.4] - 2026-07-05
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- **Antigravity IDE 安装**:MCP 写入 `~/.gemini/antigravity/mcp_config.json`;全局 Skill、项目 `.agent/rules` / `.agent/skills`;项目 `GEMINI.md` 受管块
|
|
37
|
+
- **Gemini CLI**:共享 MCP 路径 `~/.gemini/config/mcp_config.json`
|
|
38
|
+
- **GitHub Copilot**:专用 `.github/copilot-instructions.md` 源文件(token-first,非 CLAUDE.md 副本)
|
|
39
|
+
- **Trae CN 项目安装**:`.trae/rules/graphflow.md`(alwaysApply)与项目 Skill;doctor 自检
|
|
40
|
+
- **测试**:`m62-trae-cn-install`、`m63-agents-install`
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- **Antigravity MCP 路径错误**:不再写入 VS Code `Code/User/mcp.json`
|
|
45
|
+
- **用户级 MCP 污染**:`install` 不再向用户配置注入 `GRAPHFLOW_WORKSPACE_ROOT`;切换策略时自动清除 stale env
|
|
46
|
+
|
|
7
47
|
## [1.4.3] - 2026-07-05
|
|
8
48
|
|
|
9
49
|
### Added
|
package/CLAUDE.md
CHANGED
|
@@ -34,7 +34,7 @@ During repository development you can also point Claude Code at this checkout:
|
|
|
34
34
|
## Usage guidance
|
|
35
35
|
|
|
36
36
|
- Ask GraphFlow to plan before broad changes: `graphflow_plan`.
|
|
37
|
-
- Ask GraphFlow to compress and anchor code context: `
|
|
37
|
+
- Ask GraphFlow to compress and anchor code context: `graphflow_context`.
|
|
38
38
|
- Ask GraphFlow to inspect graph state or skill learnings when the repo history matters.
|
|
39
39
|
- After executing work from a `graphflow_run` `executionDescriptor`, **must** call `graphflow_report_outcome` with the `episodeId` from the run result, a `success` boolean, and optional `lessons` to close the skill flywheel loop.
|
|
40
40
|
- Fall back to `graphflow ... --json` only if MCP is not available (including `graphflow --json outcome report <episodeId> <success>`).
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ npx @roarpeng/graphflow context preview "orchestrator" --json
|
|
|
31
31
|
}
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
接好后让 agent 优先调用 `
|
|
34
|
+
接好后让 agent 优先调用 `graphflow_context` 取压缩上下文;多步任务用 `graphflow_plan`。配置 provider API key 是**可选**的——只在需要 LLM 规划增强时才用。
|
|
35
35
|
|
|
36
36
|
## 为什么选 GraphFlow(与同类对比)
|
|
37
37
|
|
|
@@ -48,27 +48,62 @@ npx @roarpeng/graphflow context preview "orchestrator" --json
|
|
|
48
48
|
|
|
49
49
|
> 实话实说:论纯图谱的成熟度与社区规模,CodeGraph 更领先;论 LSP 符号编辑标准,Serena 更专精;论整库打包,Repomix 更简单。GraphFlow 的价值在于把"图谱 + 压缩 + 规划 + 学习记忆"合到一处,让 agent 不仅省 token,还能跨会话复用项目经验。
|
|
50
50
|
|
|
51
|
-
## 当前能力总览(v1.
|
|
51
|
+
## 当前能力总览(v1.7.0+)
|
|
52
52
|
|
|
53
53
|
| 能力域 | 说明 |
|
|
54
54
|
| --- | --- |
|
|
55
|
-
| **任务规划与移交** | 按任务复杂度分流 simple / complex / insight;DAG
|
|
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(OpenAI、Anthropic、百炼、豆包) |
|
|
57
58
|
| **知识图谱** | 工作区 AST 索引(TS/JS/Python/Rust/Go/C/C++/Java/Ruby/Kotlin/Swift);File / Module / Symbol 节点 + 依赖/引用/定义/调用/继承边;图谱 artifact 导入/导出 |
|
|
58
|
-
| **上下文压缩** | L1/L2/L3 分层锚点;近无损打包;图结构压缩(边权重+PageRank,零成本默认开启);向量召回 + RRF
|
|
59
|
-
| **持续建图** | 默认 `autoIndexOnSave`;MCP 启动时自动启动 FileWatcher;preview / run 前按需增量索引;MCP `
|
|
59
|
+
| **上下文压缩** | L1/L2/L3 分层锚点;近无损打包;图结构压缩(边权重+PageRank,零成本默认开启);向量召回 + RRF 融合;RepoMap 概览;自适应预算 |
|
|
60
|
+
| **持续建图** | 默认 `autoIndexOnSave`;MCP 启动时自动启动 FileWatcher;preview / run 前按需增量索引;MCP `graphflow_index` 单文件增量 |
|
|
60
61
|
| **学习飞轮** | Episodic Memory(Jaccard + embedding RRF 语义检索)、Reflection(聚类 + Lesson 提取)、Skill 节点(score ±1,bounded [-20,20])、nightly 学习、技能提示注入规划 |
|
|
61
|
-
| **可观测性** | `
|
|
62
|
-
| **Agent 接入** | CLI `--json`;MCP stdio(**
|
|
62
|
+
| **可观测性** | `graphflow_diagnose` 累计 token 节省;VS Code 知识图谱 Snapshot |
|
|
63
|
+
| **Agent 接入** | CLI `--json`;MCP stdio(**10 工具**);自动安装 MCP 到 15+ Agent(Cursor / Claude Code / Windsurf / Cline / Codex / Gemini 等) |
|
|
63
64
|
| **VS Code 扩展** | Settings、建图、路由测试、Context Preview、**知识图谱可视化**、Skill Insights、Chat Agent、一键安装 MCP |
|
|
64
65
|
| **存储后端** | `file`(JSON)/ `memory` / `sqlite`(FTS5)/ `mcp-http`(Graphify) |
|
|
65
66
|
| **多项目隔离** | 全局配置共享 LLM/路由;**图谱路径按当前工作区解析**,不再串读其它项目的 `graphflow-out` |
|
|
66
|
-
| **工程质量** | TypeScript strict;**
|
|
67
|
+
| **工程质量** | TypeScript strict;**59 测试文件 / 280+ tests**;`npm run ci` 含扩展 esbuild 打包与 bundled runtime smoke |
|
|
67
68
|
|
|
68
69
|
### 一句话总结
|
|
69
70
|
|
|
70
71
|
> 从 task 描述出发,自动规划 → 路由模型 → 压缩图谱上下文(含向量召回)→ **输出结构化执行描述符交给外部 coding agent**,并把经验沉淀回知识图谱;定位为 **上下文与规划服务(context service)**,而非独立执行器。
|
|
71
72
|
|
|
73
|
+
### v1.7.0 核心(2026-07)
|
|
74
|
+
|
|
75
|
+
**P0 向量召回修正**:废弃 FNV-1a hash embedding,引入 `@xenova/transformers` + `all-MiniLM-L6-v2`(384 维,约 22MB,纯 JS 推理),实现真正的本地语义召回。
|
|
76
|
+
|
|
77
|
+
**P1 移除 hnswlib-node**:彻底移除 C++ 编译依赖,向量召回统一使用纯线性扫描(典型仓库 <10K 节点性能完全够用)。
|
|
78
|
+
|
|
79
|
+
**P2 MCP 工具精简**:18 个工具合并为 10 个核心工具(context、plan、index、insight、diagnose、artifact 等合并),降低 LLM 工具调用认知负荷。
|
|
80
|
+
|
|
81
|
+
**P2 ATP 自适应截断**:简单任务(低优先级、无约束、短描述)自动 short-circuit,跳过 First Principles / Decision Matrix / Reflection,节省 4-6 次 LLM 调用。
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### v1.5.0 核心(2026-07)
|
|
86
|
+
|
|
87
|
+
**ATP v1.0 Agent Thinking Protocol**:以文档驱动的全链路思考协议增强深度分析流程。
|
|
88
|
+
|
|
89
|
+
**新增 5 个分析阶段**(在 Six Hats + 5-Why 基础上补齐):
|
|
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** — 规划阶段自评置信度、不确定性、缺失信息、改进方向
|
|
96
|
+
|
|
97
|
+
**ATP 类型 IR**:`atp-schema.ts` 导出 `AgentThinkingProtocol` 完整接口,作为 Multi-Agent 共享中间表示。
|
|
98
|
+
|
|
99
|
+
**TaskNode 丰富**:新增 `priority`、`complexity`、`verification`、`inputs`、`outputs`、`risks` 6 个可选字段。
|
|
100
|
+
|
|
101
|
+
**Agent 委托扩展**:work items 扩展(+intent +requirement +first-principles +decision-matrix +reflection),submit/merge 闭环不变。
|
|
102
|
+
|
|
103
|
+
**向后兼容**:`planInsight(task, options)` 不传第三参数时行为不变;`runFullAtp=true` 启用完整 ATP 8 阶段。
|
|
104
|
+
|
|
105
|
+
**P0 残留清理**:移除 VS Code 扩展中对已删除 runtime 方法的调用(`enrichGraph`/`downloadModel`/`showSetupGuide` 命令 + `/enrich` 聊天命令);清理 87 处 OpenBMB/enrichment 残留代码;移除 `canaryAllowed`/`canaryReason` 和 5 个 enrichment 类型字段。
|
|
106
|
+
|
|
72
107
|
### v1.4.0 核心(2026-07)
|
|
73
108
|
|
|
74
109
|
**奥卡姆剃刀精简**:移除 OpenBMB 本地部署、语义压缩模型、语义增强器、技能进化、金丝雀门控、本地嵌入模型、向量存储等未产生真实价值的模块。留下的是三条经过验证的闭环链路。
|
|
@@ -76,10 +111,9 @@ npx @roarpeng/graphflow context preview "orchestrator" --json
|
|
|
76
111
|
**三大核心功能验证修复**:
|
|
77
112
|
|
|
78
113
|
1. **HNSW 向量召回完全打通**(P0 修复)
|
|
79
|
-
- `file-indexer` 现在为所有 File/Symbol/Module
|
|
114
|
+
- `file-indexer` 现在为所有 File/Symbol/Module 节点附加真正的语义 embedding(`@xenova/transformers` + `all-MiniLM-L6-v2`,384 维)
|
|
80
115
|
- `orchestrator-context` 现在传递 `embeddingProvider` + `enableVectorRecall` 到压缩管道
|
|
81
|
-
-
|
|
82
|
-
- 大仓库(≥200 节点)自动使用 HNSW ANN(10-100x 提速),小仓库线性扫描
|
|
116
|
+
- 向量召回统一使用纯线性扫描,无需 C++ 编译依赖
|
|
83
117
|
|
|
84
118
|
2. **FileWatcher 接入 MCP 启动**(P0 修复)
|
|
85
119
|
- `startFileWatcherIfEnabled` 此前是死代码,现已接入 MCP 服务器启动路径
|
|
@@ -97,7 +131,7 @@ npx @roarpeng/graphflow context preview "orchestrator" --json
|
|
|
97
131
|
|
|
98
132
|
### 发布信息
|
|
99
133
|
|
|
100
|
-
- 最新版本:**v1.
|
|
134
|
+
- 最新版本:**v1.7.0**(root + vscode-extension);npm:`@roarpeng/graphflow@1.7.0`
|
|
101
135
|
- **GitHub Release**:push 到 `main` 后 CI 在 `windows-2022` 上自动构建 VSIX 并发布到 [GitHub Releases](https://github.com/Roarpeng/GraphFlow/releases)
|
|
102
136
|
- **npm 发布**:push tag `v*`(如 `v1.4.1`)触发 [Publish npm](https://github.com/Roarpeng/GraphFlow/actions/workflows/publish-npm.yml) 工作流
|
|
103
137
|
- 变更日志:`CHANGELOG.md`
|
|
@@ -107,9 +141,7 @@ npx @roarpeng/graphflow context preview "orchestrator" --json
|
|
|
107
141
|
1. Node.js >= 20
|
|
108
142
|
2. npm >= 10
|
|
109
143
|
3. Windows / macOS / Linux 均可
|
|
110
|
-
4. **npm 安装 `@roarpeng/graphflow`
|
|
111
|
-
- **Linux / macOS**:通常自带 C++ 工具链即可
|
|
112
|
-
- **Windows**:需安装 [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) 并勾选 **「使用 C++ 的桌面开发」**;或使用 WSL / Linux 环境安装
|
|
144
|
+
4. **npm 安装 `@roarpeng/graphflow` 时**:纯 JS/TS 依赖,无原生模块编译
|
|
113
145
|
|
|
114
146
|
## 5 分钟本地试跑
|
|
115
147
|
|
|
@@ -118,7 +150,7 @@ npm install
|
|
|
118
150
|
npm run ci
|
|
119
151
|
```
|
|
120
152
|
|
|
121
|
-
预期:`lint` 无错误、`build` 成功、**
|
|
153
|
+
预期:`lint` 无错误、`build` 成功、**280+ tests** 通过、扩展 bundle 与 runtime smoke 通过。
|
|
122
154
|
|
|
123
155
|
## Agent 工具接入
|
|
124
156
|
|
|
@@ -133,27 +165,19 @@ GraphFlow 支持两种对外接入方式:
|
|
|
133
165
|
npm run start:mcp
|
|
134
166
|
```
|
|
135
167
|
|
|
136
|
-
### MCP 工具一览(
|
|
168
|
+
### MCP 工具一览(10 个)
|
|
137
169
|
|
|
138
170
|
| 工具 | 用途 |
|
|
139
171
|
| --- | --- |
|
|
140
|
-
| `
|
|
141
|
-
| `graphflow_plan` | 多步任务分解与 DAG
|
|
142
|
-
| `graphflow_plan_insight` | 六顶思考帽 + 5-Why 深度分析后规划(复杂任务) |
|
|
172
|
+
| `graphflow_context` | 预览压缩上下文(query)或扩展锚点(anchorId)(**优先调用**) |
|
|
173
|
+
| `graphflow_plan` | 多步任务分解与 DAG 规划(mode='simple' 或 'insight') |
|
|
143
174
|
| `graphflow_run` | 规划 + 压缩上下文,输出 bridge 执行描述符 |
|
|
144
175
|
| `graphflow_report_outcome` | 向 GraphFlow 汇报任务执行结果,用于学习飞轮 |
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
147
|
-
| `graphflow_expand_anchor` | 扩展指定锚点的上下文详情 |
|
|
148
|
-
| `graphflow_index` | 全工作区增量建图 |
|
|
149
|
-
| `graphflow_index_file` | 单文件增量建图(适合 onSave / watcher) |
|
|
150
|
-
| `graphflow_rebuild` | 清空缓存后全量重建 |
|
|
151
|
-
| `graphflow_inspect_graph` | 图谱快照统计与样本节点 |
|
|
176
|
+
| `graphflow_insight` | 提交或合并 agent 分析结果(Six Hats / plan prompts) |
|
|
177
|
+
| `graphflow_index` | 全工作区增量建图、单文件建图或全量重建 |
|
|
152
178
|
| `graphflow_skill_insights` | 技能学习洞察 |
|
|
153
|
-
| `graphflow_diagnose` |
|
|
154
|
-
| `
|
|
155
|
-
| `graphflow_import_artifact` | 导入图谱 artifact |
|
|
156
|
-
| `graphflow_stats` | 累计 token 节省 ROI 统计 |
|
|
179
|
+
| `graphflow_diagnose` | 路由健康、图谱统计与 token 节省 |
|
|
180
|
+
| `graphflow_artifact` | 导出或导入压缩图谱 artifact |
|
|
157
181
|
| `graphflow_skill_guide` | 获取 GraphFlow Skill 使用指南 |
|
|
158
182
|
|
|
159
183
|
**MCP 建图提示**:用户级 MCP 进程的 `cwd` 不一定是当前项目。请任选其一:
|
|
@@ -215,16 +239,15 @@ GraphFlow 的压缩采用「两层渐进」策略,先用零成本图结构压
|
|
|
215
239
|
| 层 | 机制 | 成本 | 默认 |
|
|
216
240
|
| --- | --- | --- | --- |
|
|
217
241
|
| 图结构压缩 | 边权重连通子图 + PageRank 中心性重排 | 零 LLM | **开启** |
|
|
218
|
-
| 向量召回 |
|
|
242
|
+
| 向量召回 | transformers.js embedding + 线性扫描 + RRF 融合 | 本地模型 | **开启** |
|
|
219
243
|
| RepoMap 概览 | 预算紧张时返回模块级地图 | 零 LLM | opt-in |
|
|
220
244
|
| 自适应预算 | 按任务复杂度动态调整 token 预算 | 零 LLM | opt-in |
|
|
221
245
|
|
|
222
246
|
**向量召回设计**:
|
|
223
247
|
|
|
224
|
-
- 索引时:`file-indexer` 为每个节点生成
|
|
248
|
+
- 索引时:`file-indexer` 为每个节点生成 384 维语义 embedding(`@xenova/transformers` + `all-MiniLM-L6-v2`,约 22MB,纯 JS 推理)
|
|
225
249
|
- 查询时:对 query 生成同样维度的 embedding,与图中节点做 cosine similarity
|
|
226
|
-
-
|
|
227
|
-
- 小仓库使用线性扫描,避免 HNSW 构建开销
|
|
250
|
+
- 统一使用线性扫描(典型仓库 <10K 节点性能完全够用,无需 HNSW ANN)
|
|
228
251
|
- 关键词检索 + 向量召回结果通过 RRF(Reciprocal Rank Fusion, k=60)融合
|
|
229
252
|
|
|
230
253
|
配置示例:
|
|
@@ -232,7 +255,6 @@ GraphFlow 的压缩采用「两层渐进」策略,先用零成本图结构压
|
|
|
232
255
|
```json
|
|
233
256
|
{
|
|
234
257
|
"graphPolicy": {
|
|
235
|
-
"enableHnsw": true,
|
|
236
258
|
"compression": {
|
|
237
259
|
"enableGraphCompression": true,
|
|
238
260
|
"enableAdaptiveBudget": true
|
|
@@ -240,7 +262,7 @@ GraphFlow 的压缩采用「两层渐进」策略,先用零成本图结构压
|
|
|
240
262
|
},
|
|
241
263
|
"embeddingPolicy": {
|
|
242
264
|
"enabled": true,
|
|
243
|
-
"provider": "
|
|
265
|
+
"provider": "transformers",
|
|
244
266
|
"topK": 8,
|
|
245
267
|
"minSimilarity": 0.05
|
|
246
268
|
}
|
|
@@ -318,6 +340,56 @@ npx @roarpeng/graphflow init
|
|
|
318
340
|
|
|
319
341
|
**本地 `npm install` 后**:若项目已有 `.cursor/mcp.json` 或 `.vscode/mcp.json`,postinstall 会自动注入 workspace 级 GraphFlow MCP 与 Skill;完整用户级安装请运行 `npx @roarpeng/graphflow install`。
|
|
320
342
|
|
|
343
|
+
### Trae / Trae CN 推荐配置
|
|
344
|
+
|
|
345
|
+
Trae 区分 **Rules**(每轮自动加载)与 **Skill**(按需匹配)。仅装 Skill 时 GraphFlow 触发频率偏低;`install` / `init` 会在项目内写入:
|
|
346
|
+
|
|
347
|
+
| 路径 | 作用 |
|
|
348
|
+
|------|------|
|
|
349
|
+
| `.trae/rules/graphflow.md` | `alwaysApply: true` — 每轮强制先调 `graphflow_context` |
|
|
350
|
+
| `.trae/skills/graphflow/SKILL.md` | 详细 10 工具工作流;可用 `#graphflow` 手动触发 |
|
|
351
|
+
| `~/.config/Trae CN/User/skills/graphflow/SKILL.md` | 用户级 Skill(跨项目) |
|
|
352
|
+
| `User/mcp.json` | GraphFlow MCP 服务器 |
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
# 在项目根目录执行(fat-battle/web、GraphFlow 等)
|
|
356
|
+
npx @roarpeng/graphflow install
|
|
357
|
+
npx @roarpeng/graphflow doctor # 检查 Trae CN rules/skill/MCP 是否就绪
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
**注意**:MCP 配置中不要硬编码 `GRAPHFLOW_WORKSPACE_ROOT` 到其他项目;在 Trae 打开哪个仓库,就让 Agent 在 `graphflow_context` 里传该仓库的 `rootDir`。
|
|
361
|
+
|
|
362
|
+
### Antigravity IDE 推荐配置
|
|
363
|
+
|
|
364
|
+
| 路径 | 作用 |
|
|
365
|
+
|------|------|
|
|
366
|
+
| `~/.gemini/antigravity/mcp_config.json` | 全局 MCP(`mcpServers` 键) |
|
|
367
|
+
| `~/.gemini/antigravity/skills/graphflow/SKILL.md` | 全局 Skill |
|
|
368
|
+
| `.agent/rules/graphflow.md` | 项目级 Rules |
|
|
369
|
+
| `.agent/skills/graphflow/SKILL.md` | 项目级 Skill |
|
|
370
|
+
| `GEMINI.md` | 项目级受管指令块 |
|
|
371
|
+
|
|
372
|
+
### Gemini CLI 推荐配置
|
|
373
|
+
|
|
374
|
+
| 路径 | 作用 |
|
|
375
|
+
|------|------|
|
|
376
|
+
| `~/.gemini/settings.json` | MCP 服务器 |
|
|
377
|
+
| `~/.gemini/GEMINI.md` | 全局受管指令块 |
|
|
378
|
+
|
|
379
|
+
### VS Code / GitHub Copilot 推荐配置
|
|
380
|
+
|
|
381
|
+
| 路径 | 作用 |
|
|
382
|
+
|------|------|
|
|
383
|
+
| `~/.config/Code/User/mcp.json` | 用户级 MCP(`servers` 键) |
|
|
384
|
+
| `.github/copilot-instructions.md` | 仓库级 Copilot 指令(token-first) |
|
|
385
|
+
| `.vscode/mcp.json` | 可选项目级 MCP |
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
npx @roarpeng/graphflow install # 用户级 MCP + Skills
|
|
389
|
+
npx @roarpeng/graphflow install --scope all # 含项目级 Rules / Copilot 指令
|
|
390
|
+
npx @roarpeng/graphflow doctor
|
|
391
|
+
```
|
|
392
|
+
|
|
321
393
|
支持的 Agent:Cursor、VS Code、Trae、Claude Code、Windsurf、Cline、Roo Code、Kilo Code、PearAI、Gemini、Codex、Antigravity、Amazon Q、Zed、Continue。
|
|
322
394
|
|
|
323
395
|
## 配置文件
|
|
@@ -352,11 +424,11 @@ cp graphflow.config.example.json graphflow.config.json
|
|
|
352
424
|
| `graphPolicy.autoIndexOnSave` | 保存后增量索引(默认 **true**) |
|
|
353
425
|
| `graphPolicy.autoIndexOnPreview` / `autoIndexOnRun` | preview / run 前自动索引 |
|
|
354
426
|
| `graphPolicy.enableNearLosslessMode` | 近无损上下文打包 |
|
|
355
|
-
|
|
427
|
+
|
|
356
428
|
| `graphPolicy.layerQuota` | L1/L2/L3 锚点配额 |
|
|
357
429
|
| `routingPolicy.enableDynamicRouting` | provider 健康路由 |
|
|
358
430
|
| `skillPolicy.enableSkillFlywheel` | 技能飞轮 |
|
|
359
|
-
| `embeddingPolicy.provider` | embedding 提供者(`
|
|
431
|
+
| `embeddingPolicy.provider` | embedding 提供者(`transformers` 本地 / `openai`) |
|
|
360
432
|
|
|
361
433
|
## VS Code / Cursor 扩展
|
|
362
434
|
|
|
@@ -373,9 +445,9 @@ cp graphflow.config.example.json graphflow.config.json
|
|
|
373
445
|
CLI 安装(若已安装 `code` / `cursor` 命令):
|
|
374
446
|
|
|
375
447
|
```bash
|
|
376
|
-
code --install-extension graphflow-vscode-1.
|
|
448
|
+
code --install-extension graphflow-vscode-1.7.0.vsix
|
|
377
449
|
# 或
|
|
378
|
-
cursor --install-extension graphflow-vscode-1.
|
|
450
|
+
cursor --install-extension graphflow-vscode-1.7.0.vsix
|
|
379
451
|
```
|
|
380
452
|
|
|
381
453
|
### 命令面板
|
|
@@ -455,7 +527,7 @@ npm run package:extension
|
|
|
455
527
|
|
|
456
528
|
**无 LLM 时能用吗**
|
|
457
529
|
|
|
458
|
-
- 可以:结构索引、图谱可视化、context preview(基于结构图谱 +
|
|
530
|
+
- 可以:结构索引、图谱可视化、context preview(基于结构图谱 + transformers.js 语义向量召回)、MCP `graphflow_diagnose` 均不强制 LLM
|
|
459
531
|
- 只有 Six Hats 深度规划和 LLM 语义压缩需要配置 provider
|
|
460
532
|
|
|
461
533
|
## 项目结构
|
|
@@ -469,8 +541,8 @@ GraphFlow/
|
|
|
469
541
|
│ ├── learning/ # embeddings, episode, skill-flywheel, reflector, hnsw
|
|
470
542
|
│ └── surfaces/
|
|
471
543
|
│ ├── cli/ # CLI + runtime 子模块
|
|
472
|
-
│ └── mcp/ # MCP server (
|
|
473
|
-
├── tests/ #
|
|
544
|
+
│ └── mcp/ # MCP server (10 tools)
|
|
545
|
+
├── tests/ # 59 文件 / 280+ tests
|
|
474
546
|
├── vscode-extension/ # VS Code 面板与命令
|
|
475
547
|
├── docs/
|
|
476
548
|
└── CHANGELOG.md
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface IntentAnalysis {
|
|
2
|
+
explicitIntent: string;
|
|
3
|
+
implicitIntent: string;
|
|
4
|
+
coreProblem: string;
|
|
5
|
+
nonGoals: string[];
|
|
6
|
+
successDefinition: string;
|
|
7
|
+
complexity?: "simple" | "moderate" | "complex";
|
|
8
|
+
}
|
|
9
|
+
export interface RequirementAnalysis {
|
|
10
|
+
functional: string[];
|
|
11
|
+
nonFunctional: string[];
|
|
12
|
+
constraints: string[];
|
|
13
|
+
priority: "Low" | "Medium" | "High" | "Critical";
|
|
14
|
+
scope: {
|
|
15
|
+
included: string[];
|
|
16
|
+
excluded: string[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface FirstPrinciplesAnalysis {
|
|
20
|
+
assumptions: string[];
|
|
21
|
+
facts: string[];
|
|
22
|
+
deconstructedTo: string[];
|
|
23
|
+
challenges: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface DecisionMatrixOption {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
scores: {
|
|
29
|
+
complexity: number;
|
|
30
|
+
cost: number;
|
|
31
|
+
risk: number;
|
|
32
|
+
maintainability: number;
|
|
33
|
+
impact: number;
|
|
34
|
+
};
|
|
35
|
+
pros: string[];
|
|
36
|
+
cons: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface DecisionMatrixResult {
|
|
39
|
+
options: DecisionMatrixOption[];
|
|
40
|
+
recommendedOption: string;
|
|
41
|
+
rationale: string;
|
|
42
|
+
}
|
|
43
|
+
export interface PlanReflection {
|
|
44
|
+
confidence: number;
|
|
45
|
+
uncertainties: string[];
|
|
46
|
+
missingInformation: string[];
|
|
47
|
+
improvementDirections: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface AgentThinkingProtocol {
|
|
50
|
+
task: string;
|
|
51
|
+
intent: IntentAnalysis;
|
|
52
|
+
requirements: RequirementAnalysis;
|
|
53
|
+
sixHatsInsight: import("./insight").SixHatsInsight;
|
|
54
|
+
firstPrinciples: FirstPrinciplesAnalysis;
|
|
55
|
+
decisionMatrix: DecisionMatrixResult;
|
|
56
|
+
plan: import("../core/types").TaskNode[];
|
|
57
|
+
reflection: PlanReflection;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=atp-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atp-schema.d.ts","sourceRoot":"","sources":["../../src/agents/atp-schema.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;CAChD;AAGD,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IACjD,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH;AAGD,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAGD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,MAAM,CAAC;QACxB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC;AAGD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;IACvB,YAAY,EAAE,mBAAmB,CAAC;IAClC,cAAc,EAAE,OAAO,WAAW,EAAE,cAAc,CAAC;IACnD,eAAe,EAAE,uBAAuB,CAAC;IACzC,cAAc,EAAE,oBAAoB,CAAC;IACrC,IAAI,EAAE,OAAO,eAAe,EAAE,QAAQ,EAAE,CAAC;IACzC,UAAU,EAAE,cAAc,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atp-schema.js","sourceRoot":"","sources":["../../src/agents/atp-schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decision Engine — First Principles Analysis + Decision Matrix.
|
|
3
|
+
*
|
|
4
|
+
* These two modules form the core of ATP v1.0's analytical depth:
|
|
5
|
+
* - First Principles: strip away assumptions, decompose to fundamental
|
|
6
|
+
* truths, and challenge every belief about the problem.
|
|
7
|
+
* - Decision Matrix: generate viable options, score them across
|
|
8
|
+
* multiple dimensions, and recommend the best path forward.
|
|
9
|
+
*
|
|
10
|
+
* Each module has an LLM-powered version (calls executeRolePrompt) and
|
|
11
|
+
* a heuristic fallback (rule-based, no LLM dependency). The LLM version
|
|
12
|
+
* always falls back to the heuristic when the call fails or the JSON
|
|
13
|
+
* response is unparseable.
|
|
14
|
+
*/
|
|
15
|
+
import type { SixHatsInsight, PlanInsightOptions } from "./insight";
|
|
16
|
+
import type { FirstPrinciplesAnalysis, DecisionMatrixResult } from "./atp-schema";
|
|
17
|
+
/** === First Principles Analysis === */
|
|
18
|
+
/**
|
|
19
|
+
* Apply first principles thinking to the task using LLM.
|
|
20
|
+
*
|
|
21
|
+
* Asks the LLM to:
|
|
22
|
+
* 1. List current assumptions (assumptions)
|
|
23
|
+
* 2. Decompose to irreducible facts (facts)
|
|
24
|
+
* 3. Identify fundamental elements (deconstructedTo)
|
|
25
|
+
* 4. Challenge each assumption (challenges)
|
|
26
|
+
*
|
|
27
|
+
* Falls back to heuristic on LLM failure or unparseable response.
|
|
28
|
+
*/
|
|
29
|
+
export declare function applyFirstPrinciples(task: string, insight: SixHatsInsight, options: PlanInsightOptions): Promise<FirstPrinciplesAnalysis>;
|
|
30
|
+
/**
|
|
31
|
+
* Heuristic first principles analysis — no LLM calls.
|
|
32
|
+
* Derives assumptions, facts, decomposition, and challenges from
|
|
33
|
+
* the Six Hats insight using rule-based logic.
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyFirstPrinciplesHeuristic(task: string, insight: SixHatsInsight): FirstPrinciplesAnalysis;
|
|
36
|
+
/** === Decision Matrix Evaluation === */
|
|
37
|
+
/**
|
|
38
|
+
* Evaluate solution options using a decision matrix with LLM.
|
|
39
|
+
*
|
|
40
|
+
* Asks the LLM to:
|
|
41
|
+
* 1. Generate 2-3 viable options based on first principles analysis
|
|
42
|
+
* 2. Score each option on complexity, cost, risk, maintainability, impact (1-10)
|
|
43
|
+
* 3. List pros and cons for each option
|
|
44
|
+
* 4. Recommend one option with rationale
|
|
45
|
+
*
|
|
46
|
+
* Falls back to heuristic on LLM failure or unparseable response.
|
|
47
|
+
*/
|
|
48
|
+
export declare function evaluateOptions(task: string, insight: SixHatsInsight, firstPrinciples: FirstPrinciplesAnalysis, options: PlanInsightOptions): Promise<DecisionMatrixResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Heuristic decision matrix evaluation — no LLM calls.
|
|
51
|
+
* Generates two standard options (Incremental vs Comprehensive)
|
|
52
|
+
* and recommends based on risk count.
|
|
53
|
+
*/
|
|
54
|
+
export declare function evaluateOptionsHeuristic(_task: string, insight: SixHatsInsight): DecisionMatrixResult;
|
|
55
|
+
//# sourceMappingURL=decision-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-engine.d.ts","sourceRoot":"","sources":["../../src/agents/decision-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EAErB,MAAM,cAAc,CAAC;AAItB,wCAAwC;AAExC;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,uBAAuB,CAAC,CA4ClC;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,cAAc,GACtB,uBAAuB,CAoBzB;AAED,yCAAyC;AAEzC;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,cAAc,EACvB,eAAe,EAAE,uBAAuB,EACxC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,oBAAoB,CAAC,CAiE/B;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,cAAc,GACtB,oBAAoB,CAwBtB"}
|