@roarpeng/graphflow 1.9.13 → 1.9.15
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 +2 -0
- package/CHANGELOG.md +43 -0
- package/CLAUDE.md +2 -0
- package/README.md +63 -9
- package/README.zh.md +137 -0
- package/cordis.patch.yml +42 -0
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +1 -0
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +1 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +6 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/graph/context-slicer-types.d.ts +7 -1
- 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 +6 -1
- package/dist/graph/context-slicer.d.ts.map +1 -1
- package/dist/graph/context-slicer.js +120 -39
- package/dist/graph/context-slicer.js.map +1 -1
- package/dist/graph/snapshot-view.d.ts +4 -0
- package/dist/graph/snapshot-view.d.ts.map +1 -1
- package/dist/graph/snapshot-view.js +36 -2
- package/dist/graph/snapshot-view.js.map +1 -1
- package/dist/graph/token-savings.d.ts +13 -0
- package/dist/graph/token-savings.d.ts.map +1 -1
- package/dist/graph/token-savings.js +36 -6
- package/dist/graph/token-savings.js.map +1 -1
- package/dist/hooks/auto-capture.d.ts +3 -2
- package/dist/hooks/auto-capture.d.ts.map +1 -1
- package/dist/hooks/auto-capture.js +3 -2
- package/dist/hooks/auto-capture.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/integrations/agent-mcp-installer.d.ts.map +1 -1
- package/dist/integrations/agent-mcp-installer.js +8 -0
- package/dist/integrations/agent-mcp-installer.js.map +1 -1
- package/dist/integrations/agent-profiles/index.d.ts +2 -0
- package/dist/integrations/agent-profiles/index.d.ts.map +1 -1
- package/dist/integrations/agent-profiles/index.js +2 -0
- package/dist/integrations/agent-profiles/index.js.map +1 -1
- package/dist/integrations/agent-profiles/profiles/dsh.d.ts +2 -0
- package/dist/integrations/agent-profiles/profiles/dsh.d.ts.map +1 -0
- package/dist/integrations/agent-profiles/profiles/dsh.js +16 -0
- package/dist/integrations/agent-profiles/profiles/dsh.js.map +1 -0
- package/dist/integrations/agent-profiles/skills/dsh.d.ts +2 -0
- package/dist/integrations/agent-profiles/skills/dsh.d.ts.map +1 -0
- package/dist/integrations/agent-profiles/skills/dsh.js +13 -0
- package/dist/integrations/agent-profiles/skills/dsh.js.map +1 -0
- package/dist/integrations/claude-code-hooks.d.ts +6 -3
- package/dist/integrations/claude-code-hooks.d.ts.map +1 -1
- package/dist/integrations/claude-code-hooks.js +20 -8
- package/dist/integrations/claude-code-hooks.js.map +1 -1
- package/dist/integrations/dsh-harness-installer.d.ts +53 -0
- package/dist/integrations/dsh-harness-installer.d.ts.map +1 -0
- package/dist/integrations/dsh-harness-installer.js +211 -0
- package/dist/integrations/dsh-harness-installer.js.map +1 -0
- package/dist/integrations/skill-installer.d.ts.map +1 -1
- package/dist/integrations/skill-installer.js +6 -0
- package/dist/integrations/skill-installer.js.map +1 -1
- package/dist/learning/canary-gate.d.ts +5 -2
- package/dist/learning/canary-gate.d.ts.map +1 -1
- package/dist/learning/canary-gate.js +11 -3
- package/dist/learning/canary-gate.js.map +1 -1
- package/dist/learning/dialogue-thread.d.ts +88 -0
- package/dist/learning/dialogue-thread.d.ts.map +1 -0
- package/dist/learning/dialogue-thread.js +419 -0
- package/dist/learning/dialogue-thread.js.map +1 -0
- package/dist/learning/episodic-memory.d.ts +16 -0
- package/dist/learning/episodic-memory.d.ts.map +1 -1
- package/dist/learning/episodic-memory.js +61 -1
- package/dist/learning/episodic-memory.js.map +1 -1
- package/dist/learning/skill-admission.d.ts +38 -0
- package/dist/learning/skill-admission.d.ts.map +1 -0
- package/dist/learning/skill-admission.js +195 -0
- package/dist/learning/skill-admission.js.map +1 -0
- package/dist/learning/skill-consolidate.d.ts +4 -1
- package/dist/learning/skill-consolidate.d.ts.map +1 -1
- package/dist/learning/skill-consolidate.js +56 -6
- package/dist/learning/skill-consolidate.js.map +1 -1
- package/dist/learning/skill-flywheel.d.ts +8 -2
- package/dist/learning/skill-flywheel.d.ts.map +1 -1
- package/dist/learning/skill-flywheel.js +65 -38
- package/dist/learning/skill-flywheel.js.map +1 -1
- package/dist/learning/skill-opt-lite.d.ts +17 -0
- package/dist/learning/skill-opt-lite.d.ts.map +1 -1
- package/dist/learning/skill-opt-lite.js +108 -0
- package/dist/learning/skill-opt-lite.js.map +1 -1
- package/dist/learning/skill-store.d.ts.map +1 -1
- package/dist/learning/skill-store.js +44 -4
- package/dist/learning/skill-store.js.map +1 -1
- package/dist/learning/skill-types.d.ts +15 -0
- package/dist/learning/skill-types.d.ts.map +1 -1
- package/dist/learning/skill-types.js +11 -0
- package/dist/learning/skill-types.js.map +1 -1
- package/dist/learning/workbench-topic.d.ts +116 -0
- package/dist/learning/workbench-topic.d.ts.map +1 -0
- package/dist/learning/workbench-topic.js +642 -0
- package/dist/learning/workbench-topic.js.map +1 -0
- package/dist/learning/workflow-skill.d.ts +25 -0
- package/dist/learning/workflow-skill.d.ts.map +1 -0
- package/dist/learning/workflow-skill.js +91 -0
- package/dist/learning/workflow-skill.js.map +1 -0
- package/dist/surfaces/cli/index.js +124 -6
- package/dist/surfaces/cli/index.js.map +1 -1
- package/dist/surfaces/cli/init.d.ts +3 -0
- package/dist/surfaces/cli/init.d.ts.map +1 -1
- package/dist/surfaces/cli/init.js +44 -3
- package/dist/surfaces/cli/init.js.map +1 -1
- package/dist/surfaces/cli/output.d.ts.map +1 -1
- package/dist/surfaces/cli/output.js +4 -1
- package/dist/surfaces/cli/output.js.map +1 -1
- package/dist/surfaces/cli/runtime/dialogue.d.ts +23 -0
- package/dist/surfaces/cli/runtime/dialogue.d.ts.map +1 -0
- package/dist/surfaces/cli/runtime/dialogue.js +50 -0
- package/dist/surfaces/cli/runtime/dialogue.js.map +1 -0
- package/dist/surfaces/cli/runtime/graph.d.ts +24 -22
- package/dist/surfaces/cli/runtime/graph.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime/graph.js +284 -26
- package/dist/surfaces/cli/runtime/graph.js.map +1 -1
- package/dist/surfaces/cli/runtime/memory.d.ts +7 -6
- package/dist/surfaces/cli/runtime/memory.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime/memory.js +12 -21
- package/dist/surfaces/cli/runtime/memory.js.map +1 -1
- package/dist/surfaces/cli/runtime/routing.d.ts +4 -1
- package/dist/surfaces/cli/runtime/routing.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime/routing.js +54 -7
- package/dist/surfaces/cli/runtime/routing.js.map +1 -1
- package/dist/surfaces/cli/runtime/types.d.ts +63 -0
- package/dist/surfaces/cli/runtime/types.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime.d.ts +2 -1
- package/dist/surfaces/cli/runtime.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime.js +7 -2
- package/dist/surfaces/cli/runtime.js.map +1 -1
- package/dist/surfaces/cursor-rules/graphflow.mdc +10 -3
- package/dist/surfaces/mcp/tool-definitions.d.ts.map +1 -1
- package/dist/surfaces/mcp/tool-definitions.js +24 -4
- 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 +27 -3
- package/dist/surfaces/mcp/tool-handlers.js.map +1 -1
- package/dist/surfaces/trae-skill/graphflow/SKILL.md +51 -5
- package/dsh/plugin.mjs +255 -0
- package/package.json +20 -2
- package/plugin.json +27 -4
- package/skills/graphflow/SKILL.md +51 -5
- package/src/surfaces/cursor-rules/graphflow.mdc +10 -3
- package/src/surfaces/trae-skill/graphflow/SKILL.md +51 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "graphflow"
|
|
3
|
-
description: "
|
|
3
|
+
description: "图谱上下文压缩、任务规划与知识图谱编排(10 个 MCP 工具)。任何读代码、改代码、排错、中文问题之前必须先调 graphflow_context。DeepSeek Harness 下工具名为 mcp__graphflow__graphflow_*。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# GraphFlow Skill
|
|
@@ -91,6 +91,42 @@ Run `npx @roarpeng/graphflow install` from the project root. Do **not** hardcode
|
|
|
91
91
|
| `.vscode/mcp.json` | Project MCP (optional, team-shared) |
|
|
92
92
|
| `.github/copilot-instructions.md` | Repo-level Copilot instructions |
|
|
93
93
|
|
|
94
|
+
### DeepSeek Harness(`dsh`)插件:用法与能力
|
|
95
|
+
|
|
96
|
+
GraphFlow 是 DeepSeek Harness 的 `dsh-plugin`。装入后模型看到的工具名带前缀 `mcp__graphflow__`。
|
|
97
|
+
|
|
98
|
+
**能力**
|
|
99
|
+
|
|
100
|
+
| 能力 | 工具(dsh 名) |
|
|
101
|
+
|------|----------------|
|
|
102
|
+
| 压缩上下文(先调用) | `mcp__graphflow__graphflow_context` |
|
|
103
|
+
| 任务规划 DAG | `mcp__graphflow__graphflow_plan` |
|
|
104
|
+
| 桥接执行包 | `mcp__graphflow__graphflow_run` |
|
|
105
|
+
| 回填飞轮 | `mcp__graphflow__graphflow_report_outcome` |
|
|
106
|
+
| ATP insight | `mcp__graphflow__graphflow_insight` |
|
|
107
|
+
| 增量/全量建图 | `mcp__graphflow__graphflow_index` |
|
|
108
|
+
| 技能洞察 | `mcp__graphflow__graphflow_skill_insights` |
|
|
109
|
+
| 诊断 | `mcp__graphflow__graphflow_diagnose` |
|
|
110
|
+
| 图谱产物 | `mcp__graphflow__graphflow_artifact` |
|
|
111
|
+
| 技能指南 | `mcp__graphflow__graphflow_skill_guide` |
|
|
112
|
+
|
|
113
|
+
**安装**
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
dsh plugin --profile web add @roarpeng/graphflow
|
|
117
|
+
npx @deepseek-ai/dsh web
|
|
118
|
+
# 或已有 ~/.dsh 时写 home overlay + skill 文件:
|
|
119
|
+
npx @roarpeng/graphflow install
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
| 路径 | 作用 |
|
|
123
|
+
|------|------|
|
|
124
|
+
| 包内 `cordis.patch.yml` | `dsh plugin add` 插入的 bundle 层:MCP(`cwd: process.cwd()`)+ `@roarpeng/graphflow/dsh` glue |
|
|
125
|
+
| `$DSH_HOME/cordis.patch.yml`(默认 `~/.dsh`) | `graphflow install` 写的 home overlay |
|
|
126
|
+
| `$DSH_HOME/skills/graphflow/SKILL.md` | 本 Skill(install 复制);glue 也会在运行时 `ctx.skills.register` |
|
|
127
|
+
|
|
128
|
+
**用法:** 第一轮先 `mcp__graphflow__graphflow_context`(`rootDir` = 仓库绝对路径)。不要在 patch 里写死 `GRAPHFLOW_WORKSPACE_ROOT`。走了 `graphflow_run` 后必须 `graphflow_report_outcome`。会话结束时 glue 会 best-effort 关闭 pending episode(`GRAPHFLOW_AUTO_CAPTURE=0` 可关)。VS Code 图谱面板 / Workbench Tree 不在 dsh 上。
|
|
129
|
+
|
|
94
130
|
---
|
|
95
131
|
|
|
96
132
|
## Tool Inventory (10 MCP Tools)
|
|
@@ -138,13 +174,21 @@ Step 1: graphflow_context(query: "<your question>")
|
|
|
138
174
|
Step 2: Read summary + anchors as primary context
|
|
139
175
|
Step 3: Expand specific anchors with graphflow_context(anchorId: "...") when needed
|
|
140
176
|
Step 4: Read full files only when exact edits required
|
|
177
|
+
Step 5: After answering the user, call graphflow_context({ assistantReply: "<original answer>" })
|
|
178
|
+
(query optional). This fills the pending turn/topic. Store original text, not an extracted abstract.
|
|
141
179
|
```
|
|
142
180
|
|
|
181
|
+
Complex tasks: `graphflow_plan` seeds a **workbench** of topic containers (function nodes on the canvas). Pass `topicId` to refine a node or return to the mainline. Drift auto-forks an isolated side node; messages stay inside the topic — the canvas is not one-turn-one-node. Without a workbench, previews still record as dialogue-turn nodes (`resumeFromTurnId`). Workbench titles/Path labels are **display only**; next-turn context is Goal + path titles + local original Q/A.
|
|
182
|
+
|
|
143
183
|
**Input - context (preview):**
|
|
144
184
|
```typescript
|
|
145
185
|
{
|
|
146
|
-
query
|
|
186
|
+
query?: string; // User question (Chinese OK). Omit when only filling assistantReply.
|
|
147
187
|
englishQuery?: string; // Agent-translated English code search terms (recommended for CJK)
|
|
188
|
+
topicId?: string; // Click a workbench function node to refine / return to mainline
|
|
189
|
+
sessionId?: string; // Dialogue session name (default "main")
|
|
190
|
+
resumeFromTurnId?: string; // Continue from a clicked dialogue-turn node (legacy, no workbench)
|
|
191
|
+
assistantReply?: string; // Original assistant answer to store on the pending turn/topic
|
|
148
192
|
configPath?: string;
|
|
149
193
|
rootDir?: string;
|
|
150
194
|
}
|
|
@@ -210,9 +254,11 @@ Step 2: graphflow_plan(task: "<task description>")
|
|
|
210
254
|
(simple-plan-intent, simple-plan-decomposition) and optional suggestedNodes.
|
|
211
255
|
MUST submit/merge via graphflow_insight before treating the DAG as final.
|
|
212
256
|
- Local suggestedNodes are heuristic hints only.
|
|
213
|
-
|
|
214
|
-
Step
|
|
215
|
-
Step
|
|
257
|
+
- Result includes workbench.topics and workbench.outline (mainline DAG + side branches).
|
|
258
|
+
Step 3: Review workbench.outline (function nodes), not chat turns. Wake later with graphflow workbench tree or graphflow_diagnose (graph.workbenchOutline).
|
|
259
|
+
Step 4: Refine a node: graphflow_context({ query, topicId: "<topic:...>" })
|
|
260
|
+
Step 5: If the conversation drifted, click a 主线 node (same topicId) to restore trunk context
|
|
261
|
+
Step 6: graphflow_index() after major changes
|
|
216
262
|
```
|
|
217
263
|
|
|
218
264
|
**Input:**
|
|
@@ -87,8 +87,11 @@ Step 1: graphflow_context(query: "<your question>")
|
|
|
87
87
|
Step 2: Read summary + anchors as primary context
|
|
88
88
|
Step 3: Expand specific anchors with graphflow_context(anchorId: "...") when needed
|
|
89
89
|
Step 4: Read full files only when exact edits required
|
|
90
|
+
Step 5: After answering, graphflow_context({ assistantReply: "<original answer>" }) to fill the pending turn
|
|
90
91
|
```
|
|
91
92
|
|
|
93
|
+
Each `graphflow_context` preview records the user question into the graph (workbench topic if a plan DAG exists, otherwise a dialogue-turn). After answering, call again with `assistantReply` (query optional) so the original answer is stored. Workbench titles are display labels only — do not replace stored messages with an extracted abstract.
|
|
94
|
+
|
|
92
95
|
### Workflow 2: Plan Before Coding (complex tasks)
|
|
93
96
|
|
|
94
97
|
**Use when:** Multi-step changes, refactors, features with unclear scope
|
|
@@ -96,11 +99,14 @@ Step 4: Read full files only when exact edits required
|
|
|
96
99
|
```
|
|
97
100
|
Step 1: graphflow_context(query: "<task>")
|
|
98
101
|
Step 2: graphflow_plan(task: "<task description>")
|
|
99
|
-
Step 3: Review
|
|
100
|
-
Step 4:
|
|
101
|
-
Step 5:
|
|
102
|
+
Step 3: Review workbench.topics (function nodes on the canvas). Wake the outline later with graphflow workbench tree / graphflow_diagnose.graph.workbenchOutline.
|
|
103
|
+
Step 4: Refine a node with graphflow_context({ query, topicId })
|
|
104
|
+
Step 5: If the chat drifted, click a 主线 node (same topicId) to return
|
|
105
|
+
Step 6: graphflow_index() after major changes
|
|
102
106
|
```
|
|
103
107
|
|
|
108
|
+
Each `graphflow_plan` seeds a **workbench** of topic containers (function nodes). Click a node and pass `topicId` to `graphflow_context` to refine that function. Drift auto-forks an isolated side node; click a 主线 node to return. Messages stay inside the topic — the canvas is not one-turn-one-node. Wake the outline with `graphflow workbench tree`, VS Code **GraphFlow: Workbench Tree**, or chat `/tree`. The tree stays collapsed until you open it.
|
|
109
|
+
|
|
104
110
|
### Workflow 3: Deep Analysis (complex/ambiguous tasks)
|
|
105
111
|
|
|
106
112
|
**Use when:** High-stakes changes, root-cause analysis, ambiguous requirements
|
|
@@ -131,6 +137,7 @@ If MCP is unavailable, use the CLI fallback and always request JSON output:
|
|
|
131
137
|
graphflow --json context preview "<query>"
|
|
132
138
|
graphflow --json plan "<task>"
|
|
133
139
|
graphflow --json graph inspect
|
|
140
|
+
graphflow --json workbench tree
|
|
134
141
|
graphflow --json skill insights
|
|
135
142
|
graphflow --json route diagnose
|
|
136
143
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "graphflow"
|
|
3
|
-
description: "
|
|
3
|
+
description: "图谱上下文压缩、任务规划与知识图谱编排(10 个 MCP 工具)。任何读代码、改代码、排错、中文问题之前必须先调 graphflow_context。DeepSeek Harness 下工具名为 mcp__graphflow__graphflow_*。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# GraphFlow Skill
|
|
@@ -91,6 +91,42 @@ Run `npx @roarpeng/graphflow install` from the project root. Do **not** hardcode
|
|
|
91
91
|
| `.vscode/mcp.json` | Project MCP (optional, team-shared) |
|
|
92
92
|
| `.github/copilot-instructions.md` | Repo-level Copilot instructions |
|
|
93
93
|
|
|
94
|
+
### DeepSeek Harness(`dsh`)插件:用法与能力
|
|
95
|
+
|
|
96
|
+
GraphFlow 是 DeepSeek Harness 的 `dsh-plugin`。装入后模型看到的工具名带前缀 `mcp__graphflow__`。
|
|
97
|
+
|
|
98
|
+
**能力**
|
|
99
|
+
|
|
100
|
+
| 能力 | 工具(dsh 名) |
|
|
101
|
+
|------|----------------|
|
|
102
|
+
| 压缩上下文(先调用) | `mcp__graphflow__graphflow_context` |
|
|
103
|
+
| 任务规划 DAG | `mcp__graphflow__graphflow_plan` |
|
|
104
|
+
| 桥接执行包 | `mcp__graphflow__graphflow_run` |
|
|
105
|
+
| 回填飞轮 | `mcp__graphflow__graphflow_report_outcome` |
|
|
106
|
+
| ATP insight | `mcp__graphflow__graphflow_insight` |
|
|
107
|
+
| 增量/全量建图 | `mcp__graphflow__graphflow_index` |
|
|
108
|
+
| 技能洞察 | `mcp__graphflow__graphflow_skill_insights` |
|
|
109
|
+
| 诊断 | `mcp__graphflow__graphflow_diagnose` |
|
|
110
|
+
| 图谱产物 | `mcp__graphflow__graphflow_artifact` |
|
|
111
|
+
| 技能指南 | `mcp__graphflow__graphflow_skill_guide` |
|
|
112
|
+
|
|
113
|
+
**安装**
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
dsh plugin --profile web add @roarpeng/graphflow
|
|
117
|
+
npx @deepseek-ai/dsh web
|
|
118
|
+
# 或已有 ~/.dsh 时写 home overlay + skill 文件:
|
|
119
|
+
npx @roarpeng/graphflow install
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
| 路径 | 作用 |
|
|
123
|
+
|------|------|
|
|
124
|
+
| 包内 `cordis.patch.yml` | `dsh plugin add` 插入的 bundle 层:MCP(`cwd: process.cwd()`)+ `@roarpeng/graphflow/dsh` glue |
|
|
125
|
+
| `$DSH_HOME/cordis.patch.yml`(默认 `~/.dsh`) | `graphflow install` 写的 home overlay |
|
|
126
|
+
| `$DSH_HOME/skills/graphflow/SKILL.md` | 本 Skill(install 复制);glue 也会在运行时 `ctx.skills.register` |
|
|
127
|
+
|
|
128
|
+
**用法:** 第一轮先 `mcp__graphflow__graphflow_context`(`rootDir` = 仓库绝对路径)。不要在 patch 里写死 `GRAPHFLOW_WORKSPACE_ROOT`。走了 `graphflow_run` 后必须 `graphflow_report_outcome`。会话结束时 glue 会 best-effort 关闭 pending episode(`GRAPHFLOW_AUTO_CAPTURE=0` 可关)。VS Code 图谱面板 / Workbench Tree 不在 dsh 上。
|
|
129
|
+
|
|
94
130
|
---
|
|
95
131
|
|
|
96
132
|
## Tool Inventory (10 MCP Tools)
|
|
@@ -138,13 +174,21 @@ Step 1: graphflow_context(query: "<your question>")
|
|
|
138
174
|
Step 2: Read summary + anchors as primary context
|
|
139
175
|
Step 3: Expand specific anchors with graphflow_context(anchorId: "...") when needed
|
|
140
176
|
Step 4: Read full files only when exact edits required
|
|
177
|
+
Step 5: After answering the user, call graphflow_context({ assistantReply: "<original answer>" })
|
|
178
|
+
(query optional). This fills the pending turn/topic. Store original text, not an extracted abstract.
|
|
141
179
|
```
|
|
142
180
|
|
|
181
|
+
Complex tasks: `graphflow_plan` seeds a **workbench** of topic containers (function nodes on the canvas). Pass `topicId` to refine a node or return to the mainline. Drift auto-forks an isolated side node; messages stay inside the topic — the canvas is not one-turn-one-node. Without a workbench, previews still record as dialogue-turn nodes (`resumeFromTurnId`). Workbench titles/Path labels are **display only**; next-turn context is Goal + path titles + local original Q/A.
|
|
182
|
+
|
|
143
183
|
**Input - context (preview):**
|
|
144
184
|
```typescript
|
|
145
185
|
{
|
|
146
|
-
query
|
|
186
|
+
query?: string; // User question (Chinese OK). Omit when only filling assistantReply.
|
|
147
187
|
englishQuery?: string; // Agent-translated English code search terms (recommended for CJK)
|
|
188
|
+
topicId?: string; // Click a workbench function node to refine / return to mainline
|
|
189
|
+
sessionId?: string; // Dialogue session name (default "main")
|
|
190
|
+
resumeFromTurnId?: string; // Continue from a clicked dialogue-turn node (legacy, no workbench)
|
|
191
|
+
assistantReply?: string; // Original assistant answer to store on the pending turn/topic
|
|
148
192
|
configPath?: string;
|
|
149
193
|
rootDir?: string;
|
|
150
194
|
}
|
|
@@ -210,9 +254,11 @@ Step 2: graphflow_plan(task: "<task description>")
|
|
|
210
254
|
(simple-plan-intent, simple-plan-decomposition) and optional suggestedNodes.
|
|
211
255
|
MUST submit/merge via graphflow_insight before treating the DAG as final.
|
|
212
256
|
- Local suggestedNodes are heuristic hints only.
|
|
213
|
-
|
|
214
|
-
Step
|
|
215
|
-
Step
|
|
257
|
+
- Result includes workbench.topics and workbench.outline (mainline DAG + side branches).
|
|
258
|
+
Step 3: Review workbench.outline (function nodes), not chat turns. Wake later with graphflow workbench tree or graphflow_diagnose (graph.workbenchOutline).
|
|
259
|
+
Step 4: Refine a node: graphflow_context({ query, topicId: "<topic:...>" })
|
|
260
|
+
Step 5: If the conversation drifted, click a 主线 node (same topicId) to restore trunk context
|
|
261
|
+
Step 6: graphflow_index() after major changes
|
|
216
262
|
```
|
|
217
263
|
|
|
218
264
|
**Input:**
|