dsh-workflow-canvas 0.2.4 → 1.0.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/README.md +77 -111
- package/README.zh.md +78 -75
- package/client.js +217 -170
- package/docs/DETAIL.md +13 -10
- package/docs/images/add-node-shift-a.gif +0 -0
- package/docs/images/connect-and-cut.gif +0 -0
- package/docs/images/lead-pause-resume.gif +0 -0
- package/docs/images/node-config.gif +0 -0
- package/docs/images/node-entry-en.png +0 -0
- package/docs/images/node-entry-zh.png +0 -0
- package/docs/images/node-lead-en.png +0 -0
- package/docs/images/node-lead-zh.png +0 -0
- package/docs/images/node-subagent-en.png +0 -0
- package/docs/images/node-subagent-zh.png +0 -0
- package/docs/images/parallel-and-inspect.gif +0 -0
- package/index.js +144 -51
- package/package.json +1 -1
- package/skills/workflow-canvas/SKILL.md +3 -1
package/README.md
CHANGED
|
@@ -6,156 +6,122 @@
|
|
|
6
6
|
|
|
7
7
|
English | [中文](README.zh.md) | [Mechanism & Architecture](docs/MECHANISM.md)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
the data flow with three link types, enable it, and run it from chat — subagent nodes
|
|
11
|
-
are spawned for real, Lead nodes pause the run and are performed by the conversation
|
|
12
|
-
itself.
|
|
9
|
+
Turn multi-agent orchestration in DSH into a visual node graph: each card is an AI role, each wire defines who feeds whom, and pressing **● ON** lets you run the whole pipeline straight from chat.
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
- **Real parallelism**: Independent nodes run concurrently (up to 4 at once), and newly unblocked downstream nodes start the instant their inputs finish.
|
|
12
|
+
- **Human-in-the-loop**: Drop a **Lead** card anywhere in the flow to pause automatically for your decision before continuing.
|
|
13
|
+
- **Zero black box**: Click any subagent card to open its live chat transcript and inspect its exact output.
|
|
14
|
+
- **Don't want to draw by hand?** Describe the workflow in one sentence in chat — the agent sketches the graph for you and can patch it in place anytime.
|
|
17
15
|
|
|
18
|
-

|
|
19
17
|
|
|
20
18
|
## Installation
|
|
21
19
|
|
|
22
|
-
Requires DeepSeek Harness **0.2.2** or newer (
|
|
23
|
-
`engines.dsh: ">=0.2.2-rc.1 <0.3.0-0"`).
|
|
20
|
+
Requires DeepSeek Harness **0.2.2** or newer (`engines.dsh: ">=0.2.2-rc.1 <0.3.0-0"`).
|
|
24
21
|
|
|
25
|
-
- **From the plugin market** — open **Plugins → Discover**, search
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
[catalog PR](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/17180).
|
|
29
|
-
- **From npm** — install the published package `dsh-workflow-canvas` from the
|
|
30
|
-
**Plugins** panel, or via the `plugin_manager` tool / `dsh` CLI with
|
|
31
|
-
`install_bundle` and `target: dsh-workflow-canvas`.
|
|
32
|
-
- **From source** — clone the repository and install it as a local directory
|
|
33
|
-
with **Plugins → Add plugin**, pointing at the checkout.
|
|
22
|
+
- **From the plugin market** — open **Plugins → Discover**, search *"workflow canvas"*, and install ([catalog PR #17180](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/17180)).
|
|
23
|
+
- **From npm** — install `dsh-workflow-canvas` from the **Plugins** panel or via `plugin_manager` / `dsh` CLI (`install_bundle`).
|
|
24
|
+
- **From source** — clone this repo and install it via **Plugins → Add plugin** pointing at the local folder.
|
|
34
25
|
|
|
35
|
-
|
|
36
|
-
sidebar.
|
|
26
|
+
Once enabled, open the **`Workflow`** tab in the right sidebar.
|
|
37
27
|
|
|
38
|
-
|
|
28
|
+
---
|
|
39
29
|
|
|
40
|
-
|
|
41
|
-
template from `☰ Presets` → press **● ON** at top-left → ask in chat to run the
|
|
42
|
-
canvas.
|
|
43
|
-
- **Prompts you can copy right into chat**:
|
|
44
|
-
- **Sketch from one sentence**: *"Build a parallel research workflow on the canvas: two subagents investigate competitors and technical feasibility in parallel, pause for me (Lead) to decide, then hand off to a writer subagent."*
|
|
45
|
-
- **Patch in place**: *"Inspect the current canvas, turn Memory on for the feasibility node, and add a read-only cost-estimate node wired in parallel into plan synthesis."*
|
|
46
|
-
- **Reuse a template with a new task**: *"Run the current canvas with the task: evaluate adding a local knowledge base to this project."*
|
|
30
|
+
## Usage
|
|
47
31
|
|
|
48
|
-
|
|
32
|
+
### 1. Node types
|
|
49
33
|
|
|
50
|
-
|
|
51
|
-
the sidebar, performs Lead steps in the conversation itself, and lets the agent
|
|
52
|
-
sketch a whole canvas from one sentence. For tool-call / condition / output
|
|
53
|
-
pipelines compiled to `ctx.workflows`, see
|
|
54
|
-
[`@piedpiper911/dsh-workflow-canvas`](https://github.com/PiedPiper911/dsh-workflow-canvas).
|
|
34
|
+
There are three node types on the canvas:
|
|
55
35
|
|
|
56
|
-
|
|
36
|
+
| Node | Description |
|
|
37
|
+
|---|---|
|
|
38
|
+
| <img src="docs/images/node-entry-en.png" width="220" alt="Entry Lead node" /> | **Entry Lead (start node, always present)**<br>• The starting point of the graph — **right-side output sockets only**.<br>• Write the overall goal in **Task**, or leave it blank and send your prompt directly in chat once the canvas is **● ON**.<br>• Every node that should run must be reachable from here. |
|
|
39
|
+
| <img src="docs/images/node-subagent-en.png" width="220" alt="Subagent node" /> | **Subagent (green top bar — runs in an isolated child session)**<br>• **Model / Reasoning**: Configure model and reasoning effort per node.<br>• **Scope**: `standard` (all tools) or `minimal` (read-only thinking — disables file edits and web), bounded by the main chat's permission mode.<br>• **Fallback**: Automatically retries once on another model if the primary one fails.<br>• **Memory**: Flip **on** and use the dropdown beside it to resume **Latest** or pin any past run (`#1 / #2`).<br>• **Role**: Click the pencil icon to describe what this node is responsible for. |
|
|
40
|
+
| <img src="docs/images/node-lead-en.png" width="220" alt="Lead node" /> | **Lead (blue top bar — runs directly in the main conversation)**<br>• **Never spawned** — handled by your main chat itself.<br>• **Mid-flow** (e.g. `Lead Pick`): pauses with `⏸ Ready` once upstream finishes so you can decide before downstream starts.<br>• **End-of-flow** (e.g. `Lead Review`): delivers the final summary in one shot without an extra round-trip.<br>• Requires at least one subagent upstream (solo Lead-to-Lead nodes render dashed and are skipped). |
|
|
41
|
+
|
|
42
|
+
Load a built-in template from **`☰ Presets`**, or press **`Shift+A`** anywhere on the canvas to add a node (`⋯` also provides `⊞ Auto layout` and `✕ Clear canvas`):
|
|
43
|
+
|
|
44
|
+

|
|
57
45
|
|
|
58
|
-
|
|
59
|
-
model, reasoning effort, capability scope (`standard` / `minimal`), fallback
|
|
60
|
-
model, memory and role.
|
|
61
|
-
- **Lead node** (blue top bar) — performed by the conversation, never spawned. The
|
|
62
|
-
entry Lead carries the overall task; the run stops at every Lead step and resumes
|
|
63
|
-
with your answer.
|
|
46
|
+
---
|
|
64
47
|
|
|
65
|
-
|
|
48
|
+
### 2. Links and data flow
|
|
66
49
|
|
|
67
|
-
|
|
50
|
+
**Drag from a right-side output socket on an upstream node to a left-side input socket on a downstream node** to pass results forward.
|
|
51
|
+
|
|
52
|
+
Socket colour indicates the channel type — **only matching colours connect**:
|
|
53
|
+
| Colour | Type | Description |
|
|
68
54
|
|---|---|---|
|
|
69
|
-
| `prompt` |
|
|
70
|
-
| `structured` |
|
|
71
|
-
| `session` |
|
|
55
|
+
| Grey | `prompt` | Passes plain-text output downstream |
|
|
56
|
+
| Blue | `structured` | Passes a JSON object; the upstream node is automatically asked for structured output |
|
|
57
|
+
| Purple | `session` | Continues inside the upstream child session without reloading context |
|
|
72
58
|
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
- **Disconnect**: Hold **right-click and sweep across any wire** to cut it (or drag a connected left socket away).
|
|
60
|
+
- **Dashed nodes (inactive)**: Unreachable nodes, solo chained Lead nodes with no subagent upstream, and dangling dead-end subagents render **dashed** and are skipped at run time.
|
|
75
61
|
|
|
76
|
-
|
|
62
|
+

|
|
77
63
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### 3. Per-node settings
|
|
67
|
+
|
|
68
|
+
Every subagent node can be configured independently:
|
|
69
|
+
- **Model & Reasoning**: Assign different models and effort levels per step.
|
|
70
|
+
- **Scope**: `standard` (all tools) or `minimal` (read-only thinking). *Bounded by the main chat's permission mode.*
|
|
71
|
+
- **Fallback**: Retries once on another model when the primary model fails.
|
|
72
|
+
- **Memory**: Reuses a past child session across runs and restarts, with a dropdown to pick **Latest** or a specific run.
|
|
86
73
|
|
|
87
|
-
|
|
74
|
+

|
|
88
75
|
|
|
89
|
-
|
|
90
|
-
blank and pass `task` from chat when reusing a template).
|
|
91
|
-
2. Connect the nodes — unlinked nodes are dashed and skipped.
|
|
92
|
-
3. Press the **● ON / ○ OFF** pill at the top-left of the canvas, then ask in chat
|
|
93
|
-
to run it (pass `reset: true` to restart from scratch).
|
|
94
|
-
4. The run proceeds in parallel waves (up to 4 at a time) and pauses at each Lead
|
|
95
|
-
node with the results collected so far. Click a subagent's status pill (e.g.
|
|
96
|
-
`Done ↗`) to jump straight to its live chat pane.
|
|
76
|
+
---
|
|
97
77
|
|
|
98
|
-
|
|
78
|
+
### 4. Enable and run
|
|
99
79
|
|
|
100
|
-
|
|
101
|
-
id at the Lead step, so the conversation can keep talking to that agent instead of
|
|
102
|
-
only receiving its text.
|
|
80
|
+
Press **`● ON`** at the top-left of the canvas, then send your task in chat (while enabled, a per-session runtime context notifies the agent automatically):
|
|
103
81
|
|
|
104
|
-
|
|
82
|
+
- If the entry Lead's task is blank, your chat message is passed as `task`.
|
|
83
|
+
- At an intermediate **Lead** node, the canvas shows **`⏸ Ready`** and hands control to chat; once you reply, downstream nodes resume automatically through the final Lead review.
|
|
84
|
+
- Re-running in the same chat supports `reset: true`; if any node has saved **Memory**, the agent confirms whether to keep memory or clear it (`clearMemory: true`).
|
|
105
85
|
|
|
106
|
-
-
|
|
107
|
-
and links), so the agent can safely patch manually edited or preset graphs.
|
|
108
|
-
- `canvas_generate` — build a whole canvas from a node/edge sketch (replaces it).
|
|
109
|
-
- `canvas_patch` — edit it in place: update nodes by id, add or remove nodes and
|
|
110
|
-
links, leaving positions and everything else untouched.
|
|
86
|
+

|
|
111
87
|
|
|
112
|
-
|
|
113
|
-
up within ~1.5s.
|
|
88
|
+
---
|
|
114
89
|
|
|
115
|
-
|
|
90
|
+
### 5. Inspect live subagent runs
|
|
116
91
|
|
|
117
|
-
|
|
118
|
-
`☆ Save` to keep your own. Presets live in browser storage; to share across
|
|
119
|
-
machines or between Desktop and `dsh web`, use `⋯ → ⇧ Copy JSON` and `⇩ Import`.
|
|
92
|
+
Active nodes glow blue with animated flow wires and turn green when done. **Click the status badge (`Running ↗` / `Done ↗`) at the bottom-right of any subagent node** to open its conversation pane:
|
|
120
93
|
|
|
121
|
-
|
|
94
|
+

|
|
122
95
|
|
|
123
|
-
|
|
124
|
-
same session, and — through the persisted child id — after a restart, where the
|
|
125
|
-
Host cold-resumes it. A resume the Host refuses is forgotten and the node starts
|
|
126
|
-
fresh.
|
|
96
|
+
---
|
|
127
97
|
|
|
128
|
-
##
|
|
98
|
+
## Let the agent draw or edit the canvas from chat
|
|
129
99
|
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
to move or share them).
|
|
133
|
-
- Node status is read from the subagent catalog, so Lead steps show **Runs in chat**
|
|
134
|
-
instead of a tracked state.
|
|
135
|
-
- Up to 4 nodes run at a time.
|
|
100
|
+
- **Sketch from one sentence** (`canvas_generate`): *"Build a parallel research workflow on the canvas: two subagents investigate competitors and feasibility, pause for me to decide, then write the plan."*
|
|
101
|
+
- **Patch in place** (`canvas_inspect` + `canvas_patch`): *"Inspect the current canvas, turn Memory on for feasibility, and add a read-only cost-estimate node wired into plan synthesis."* (Preserves your layout.)
|
|
136
102
|
|
|
137
|
-
##
|
|
103
|
+
## Shortcuts & controls
|
|
138
104
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
105
|
+
| Control / Shortcut | Action |
|
|
106
|
+
|---|---|
|
|
107
|
+
| `Shift+A` | Add a node at the cursor (`1` = Subagent, `2` = Lead) |
|
|
108
|
+
| Middle-drag / `Space` + left-drag | Pan the canvas |
|
|
109
|
+
| Wheel / `⊡ Fit` / `100%` pill | Zoom around cursor / fit all nodes / click to reset 100%, drag left-right to scrub zoom |
|
|
110
|
+
| Marquee drag + `Ctrl+D` / `Delete` | Multi-select move, duplicate (with settings), or batch delete |
|
|
111
|
+
| Right-drag across wires | Cut links (toggle under `⋯`) |
|
|
112
|
+
| `Ctrl+Z` / `Esc` | Undo structural edit / close popups |
|
|
113
|
+
| `⋯` menu | Import / Copy JSON, Auto layout, Clear canvas, Visual effects (Minimal / Standard / Vivid) |
|
|
142
114
|
|
|
143
|
-
|
|
144
|
-
node graph, 画布, 工作流, 编排.
|
|
145
|
-
2. **Pointers from the tools** — every `canvas_*` tool description tells the model
|
|
146
|
-
to load the skill first, and tools are always in context.
|
|
147
|
-
3. **A line in your project's `AGENTS.md`** — the strongest option, because it is
|
|
148
|
-
always loaded:
|
|
115
|
+
## Presets, sharing & limits
|
|
149
116
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
```
|
|
117
|
+
- **Presets & sharing**: `☰ Presets` includes 3 starter templates plus **New blank canvas**; save your own with `☆ Save`. Custom presets live in browser storage — use `⋯ → ⇧ Copy JSON` and `⇩ Import` to share across devices.
|
|
118
|
+
- **How this differs from other canvas plugins**: Built for **multi-subagent orchestration + conversation Lead gates**; for `ctx.workflows` tool/condition pipelines, see [`@piedpiper911/dsh-workflow-canvas`](https://github.com/PiedPiper911/dsh-workflow-canvas).
|
|
119
|
+
- **Limits**: Up to 4 subagents run concurrently; per-node `Scope` only narrows tools within the main chat's permission/sandbox ceiling.
|
|
154
120
|
|
|
155
121
|
## Development & internals
|
|
156
122
|
|
|
157
|
-
-
|
|
158
|
-
- Edit `client.js` / `index.js` and reload
|
|
123
|
+
- See [**Mechanism & Architecture**](docs/MECHANISM.md) ([中文](docs/MECHANISM.zh.md)) for the Client ↔ Host bridge, event-driven concurrency pool, link semantics, and cold resume.
|
|
124
|
+
- Edit `client.js` / `index.js` and reload (Host changes require restart). Run `npm test` for the test suite. Compact plugin page: [docs/DETAIL.md](docs/DETAIL.md).
|
|
159
125
|
|
|
160
126
|
## License
|
|
161
127
|
|
package/README.zh.md
CHANGED
|
@@ -6,120 +6,123 @@
|
|
|
6
6
|
|
|
7
7
|
中文 | [English](README.md) | [工作机制与架构原理](docs/MECHANISM.zh.md)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
启用后直接在对话里运行。子代理节点会被真实启动,Lead 节点会暂停运行、由对话本体执行。
|
|
9
|
+
把 DSH 的多智能体协作画成一张直观的流程图:每个卡片是一名负责具体工作的 AI,连线决定「谁先做、结果交给谁」,点一下启用就能在聊天里直接开跑。
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
- **真并行**:互相不依赖的卡片会自动同时开工(最多 4 个并行),跑完一个立刻推进下游,不用干等。
|
|
12
|
+
- **人机协同**:在关键节点放一个 **Lead 卡片**,跑到那一步会自动停下来问你拍板,确认后再继续往下跑。
|
|
13
|
+
- **完全白盒**:每个子代理的对话记录都能直接点开看,不用猜黑盒里发生了什么。
|
|
14
|
+
- **懒得手动画?** 直接在聊天里用一句话描述分工,AI 会帮你把整张图搭好,之后还能随时说一句让它原地修改。
|
|
14
15
|
|
|
15
|
-

|
|
16
17
|
|
|
17
18
|
## 安装
|
|
18
19
|
|
|
19
|
-
需要 DeepSeek Harness **0.2.2**
|
|
20
|
-
`engines.dsh: ">=0.2.2-rc.1 <0.3.0-0"`)。
|
|
20
|
+
需要 DeepSeek Harness **0.2.2** 或更新版本(`engines.dsh: ">=0.2.2-rc.1 <0.3.0-0"`)。
|
|
21
21
|
|
|
22
|
-
- **从插件市场安装** —— 打开 **插件 → 发现(Discover)**,搜索
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- **从 npm 安装** —— 从 **插件** 面板,或用 `plugin_manager` 工具 / `dsh` CLI
|
|
26
|
-
的 `install_bundle`(`target` 填 `dsh-workflow-canvas`)安装已发布的包
|
|
27
|
-
`dsh-workflow-canvas`。
|
|
28
|
-
- **从源码安装** —— 克隆仓库后,用 **插件 → 添加插件(Add plugin)** 把它作为
|
|
29
|
-
本地目录安装,指向 checkout 目录。
|
|
22
|
+
- **从插件市场安装** —— 打开 **插件 → 发现(Discover)**,搜索 *"workflow canvas"* 安装(目录 PR:[#17180](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/17180))。
|
|
23
|
+
- **从 npm 安装** —— 在 **插件** 面板,或用 `plugin_manager` / `dsh` CLI 的 `install_bundle` 安装 `dsh-workflow-canvas`。
|
|
24
|
+
- **从源码安装** —— 克隆仓库后,通过 **插件 → 添加插件(Add plugin)** 指向本地目录即可。
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
启用插件后,右侧边栏会出现 **`Workflow`** 标签页。
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
---
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
- **直接用对话驱动画布**(可复制尝试):
|
|
37
|
-
- **一句话搭图**:*「帮我在工作流画布里搭一个并行调研流程:先让两个子代理分别做竞品调研和技术可行性评估,再由我(Lead)拍板,最后交给子代理写方案」*
|
|
38
|
-
- **就地微调**:*「先看一下当前画布,把技术可行性节点开启记忆,再补一个只读的成本估算节点并行连到方案合成」*
|
|
39
|
-
- **复用模板换任务跑**:*「用当前画布跑一下,总任务改为:评估在现有项目里接入本地知识库的方案」*
|
|
30
|
+
## 使用说明
|
|
40
31
|
|
|
41
|
-
|
|
32
|
+
### 1. 节点类型
|
|
42
33
|
|
|
43
|
-
|
|
44
|
-
还支持一句话让 agent 自动搭图。若要的是「工具调用 / 条件分支 / 输出模板」编译成 `ctx.workflows`
|
|
45
|
-
的那类管线,请看 [`@piedpiper911/dsh-workflow-canvas`](https://github.com/PiedPiper911/dsh-workflow-canvas)。
|
|
34
|
+
画布上有三种节点:
|
|
46
35
|
|
|
47
|
-
|
|
36
|
+
| 节点 | 说明 |
|
|
37
|
+
|---|---|
|
|
38
|
+
| <img src="docs/images/node-entry-zh.png" width="220" alt="开始节点(入口 Lead)" /> | **入口 Lead(开始节点,不可删除)**<br>• 整张图的起点,**只有右侧输出口**。<br>• 「任务」框用于填写本次流程的总目标;也可以留空,开启画布后直接在聊天框发任务即可自动传入。<br>• 需要参与执行的节点都必须从它连出去。 |
|
|
39
|
+
| <img src="docs/images/node-subagent-zh.png" width="220" alt="子代理节点" /> | **子代理节点(绿顶,独立子会话执行)**<br>• **模型 / 推理**:可为每个节点单独指定模型和推理强度。<br>• **能力**:`standard`(全部工具)或 `minimal`(只读思考,关闭文件读写与联网),受主对话权限上限约束。<br>• **备用**:主模型报错时自动换备用模型重试一次。<br>• **记忆**:打开 `开` 后可在右侧下拉框选 `最新` 或指定某次历史会话(`#1 / #2`)续接。<br>• **分工**:点铅笔图标展开填写该节点的具体职责。 |
|
|
40
|
+
| <img src="docs/images/node-lead-zh.png" width="220" alt="Lead 节点" /> | **Lead 节点(蓝顶,由主对话直接执行)**<br>• **不创建子会话**,直接交回当前主对话完成这一步。<br>• **放在流程中间**(如 `Lead 拍板`):上游完成后暂停并亮起 `⏸ 待拍板`,在对话里确认或补充后再继续跑下游。<br>• **放在流程末尾**(如 `Lead 终审`):所有子代理完成后直接汇总交付,不产生额外回调轮次。<br>• 至少需连入一个子代理上游,否则会显示为虚线并在运行时跳过。 |
|
|
41
|
+
|
|
42
|
+
可以直接点右上角 **`☰ 预设`** 载入内置模板,或在画布任意位置按 **`Shift+A`** 新建节点(`⋯` 菜单提供 `⊞ 自动排版` 和 `✕ 清空画布`):
|
|
43
|
+
|
|
44
|
+

|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
- **Lead 节点**(顶部蓝条)—— 由对话本体执行,从不 spawn。入口 Lead 承载总任务;运行每到一步 Lead 就暂停,等你在对话里完成。
|
|
46
|
+
---
|
|
51
47
|
|
|
52
|
-
|
|
48
|
+
### 2. 连线与数据流向
|
|
53
49
|
|
|
54
|
-
|
|
50
|
+
**从上游节点的右侧端口拖到下游节点的左侧端口**,表示上游完成后把结果传给下游。
|
|
51
|
+
|
|
52
|
+
端口颜色代表传递方式,**只能同色相连**:
|
|
53
|
+
| 颜色 | 类型 | 说明 |
|
|
55
54
|
|---|---|---|
|
|
56
|
-
| `prompt` |
|
|
57
|
-
| `structured` |
|
|
58
|
-
| `session` |
|
|
55
|
+
| 灰 | `prompt` | 传递纯文本结果给下游 |
|
|
56
|
+
| 蓝 | `structured` | 传递 JSON 对象;上游会被自动要求输出结构化结果 |
|
|
57
|
+
| 紫 | `session` | 复用上游的子会话,下游在同一个上下文里继续执行 |
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
- **断开连线**:按住**鼠标右键划过连线**即可切断(也可以把左侧已连接的端口拖开)。
|
|
60
|
+
- **虚线节点(不生效)**:未从入口连通的节点、未连入任何子代理的单独串联 Lead、以及存在终审 Lead 却没有连出下游的子代理,都会显示为**虚线框**并在运行时跳过。
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+

|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### 3. 单节点配置
|
|
67
|
+
|
|
68
|
+
每个子代理节点都支持独立配置:
|
|
69
|
+
- **模型 & 推理强度**:按步骤复杂度分别搭配不同模型与推理档位。
|
|
70
|
+
- **能力范围**:`standard`(全部工具)或 `minimal`(只读思考,关闭文件读写与联网)。*受主对话权限上限约束,只收窄、不提权。*
|
|
71
|
+
- **备用模型**:主模型失败时自动切换重试一次。
|
|
72
|
+
- **记忆**:开启后可续接历史子会话(跨运行及重启后仍可恢复),并通过右侧下拉框选择 `最新` 或具体某次历史会话。
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+

|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
2. 连好节点——未连线的节点会显示虚线并被跳过。
|
|
77
|
-
3. 点画布左上角的 **● 已启用 / ○ 已禁用** 浮窗,然后在对话里让它跑(支持 `reset: true` 从头重跑)。
|
|
78
|
-
4. 运行按波次并行(每次最多 4 个),每到一个 Lead 节点就暂停,并把已收集的结果交回;点击子代理节点右下角状态胶囊(如 `已完成 ↗`)可直达它的对话记录。
|
|
76
|
+
---
|
|
79
77
|
|
|
80
|
-
|
|
78
|
+
### 4. 启用与运行
|
|
81
79
|
|
|
82
|
-
|
|
80
|
+
连好图后,点画布左上角的 **`● 已启用`**,然后在聊天框直接发任务即可(启用状态下插件会按会话自动注入上下文,无需额外提示调用工具):
|
|
83
81
|
|
|
84
|
-
|
|
82
|
+
- 入口 Lead 的任务栏可填可不填;留空时,聊天框发出的任务会自动作为 `task` 传入。
|
|
83
|
+
- 跑到中间 Lead 时,画布亮起 **`⏸ 待拍板`** 并交回主对话;回复后下游自动续跑到终审完成。
|
|
84
|
+
- 同一对话重跑支持 `reset: true`;若画布含已产生历史会话的记忆节点,Agent 会在重跑前确认保留记忆还是清空记忆(`clearMemory: true`)。
|
|
85
85
|
|
|
86
|
-
-
|
|
87
|
-
- `canvas_generate` —— 从一个节点/连线草图重建整张画布(替换)。
|
|
88
|
-
- `canvas_patch` —— 就地编辑:按 id 更新节点、增删节点和连线,位置和其余内容保持不变。
|
|
86
|
+

|
|
89
87
|
|
|
90
|
-
|
|
88
|
+
---
|
|
91
89
|
|
|
92
|
-
|
|
90
|
+
### 5. 查看子代理执行过程
|
|
93
91
|
|
|
94
|
-
|
|
92
|
+
运行中,执行中的节点亮蓝光并显示流动连线,完成后变绿。**点击任意子代理节点右下角的 `进行中 ↗` / `已完成 ↗`**,即可打开它的独立对话窗格查看过程与输出:
|
|
95
93
|
|
|
96
|
-
|
|
94
|
+

|
|
97
95
|
|
|
98
|
-
|
|
96
|
+
---
|
|
99
97
|
|
|
100
|
-
##
|
|
98
|
+
## 用对话让 AI 帮你画图 / 改图
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
100
|
+
除了手动拖拽,你也可以直接对聊天框说:
|
|
101
|
+
- **一句话搭图**(`canvas_generate`):*「帮我在工作流画布里搭一个并行调研流程:两个子代理分别做竞品和技术可行性,再让我拍板,最后写方案」*
|
|
102
|
+
- **原地微调**(`canvas_inspect` + `canvas_patch`):*「看一下当前画布,把技术可行性开启记忆,再加一个只读成本估算节点并行连到方案合成」*(不会打乱你摆好的位置)
|
|
105
103
|
|
|
106
|
-
##
|
|
104
|
+
## 常用快捷键一览
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
| 操作 / 快捷键 | 效果 |
|
|
107
|
+
|---|---|
|
|
108
|
+
| `Shift+A` | 在鼠标位置新建节点(按 `1` 加子代理,`2` 加 Lead) |
|
|
109
|
+
| 鼠标中键拖拽 / `Space` + 左键拖拽 | 平移画布 |
|
|
110
|
+
| 滚轮 / `⊡ 全览` / `100%` 按钮 | 光标处缩放 / 一键居中看全图 / 点击回 100%,左右拖可连续缩放 |
|
|
111
|
+
| 左键框选 + `Ctrl+D` / `Delete` | 批量移动、批量复制(连同参数配置)或批量删除 |
|
|
112
|
+
| 右键按住划过连线 | 切断连线(可在 `⋯` 菜单开关) |
|
|
113
|
+
| `Ctrl+Z` / `Esc` | 撤销上一步改动 / 关闭菜单弹窗 |
|
|
114
|
+
| `⋯` 更多菜单 | 导入 / 复制 JSON、自动排版、清空画布、切换三档视觉效果(极简 / 标准 / 炫酷) |
|
|
109
115
|
|
|
110
|
-
|
|
111
|
-
2. **从工具指路** —— 每个 `canvas_*` 工具的说明都提示先加载该技能,而工具永远在上下文里。
|
|
112
|
-
3. **在项目的 `AGENTS.md` 里加一行** —— 最稳的办法,因为它每次都会加载:
|
|
116
|
+
## 预设、分享与限制
|
|
113
117
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
+
- **预设与分享**:`☰ 预设` 内置 3 套开箱即用模板和「新建空白画布」;输入名字点 `☆ 保存` 存为自己的预设。自定义预设保存在本地浏览器存储中,跨设备分享请用 `⋯ → ⇧ 复制 JSON` 与 `⇩ 导入`。
|
|
119
|
+
- **与其它画布插件的区别**:本项目专注**多子代理编排 + 对话本体拍板**;如果你需要的是把工具调用/条件分支编译为 `ctx.workflows` 的管线,可看 [`@piedpiper911/dsh-workflow-canvas`](https://github.com/PiedPiper911/dsh-workflow-canvas)。
|
|
120
|
+
- **运行限制**:同时最多并行运行 4 个子代理;子代理的「能力」受主对话权限/沙箱上限约束。
|
|
118
121
|
|
|
119
122
|
## 开发与原理
|
|
120
123
|
|
|
121
|
-
-
|
|
122
|
-
-
|
|
124
|
+
- 底层双向同步、并发池调度、三色连线运行时机制与冷恢复详见 [**工作机制与架构原理**](docs/MECHANISM.zh.md)([English](docs/MECHANISM.md))。
|
|
125
|
+
- 本地开发:改完 `client.js` / `index.js` 重载应用(Host 改动需重启),运行 `npm test` 执行全套单测。插件详情页见 [docs/DETAIL.md](docs/DETAIL.md)。
|
|
123
126
|
|
|
124
127
|
## 许可
|
|
125
128
|
|