dsh-workflow-canvas 1.3.0 → 1.4.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 +9 -7
- package/README.zh.md +9 -7
- package/client.js +1042 -285
- package/index.js +87 -13
- package/package.json +1 -1
- package/skills/workflow-canvas/SKILL.md +4 -3
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ There are four node types on the canvas (Entry Lead, Subagent, Lead, Condition):
|
|
|
38
38
|
|---|---|
|
|
39
39
|
| <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. |
|
|
40
40
|
| <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** to enable the session dropdown beside it (**Latest** or pin any past run `#1 / #2`; muted when off).<br>• **Role**: Edit inline or click `⤢` to open a larger editor. |
|
|
41
|
-
| <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>• **
|
|
41
|
+
| <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>• **Main-conversation stage chains (`Lead → Lead`)**: chain Lead nodes directly as lightweight human-in-the-loop gates or multi-step guidance with zero subagent spawns — just fill in **Role** (only blank-role solo Lead nodes without subagent upstream render dashed and are skipped).<br>• **End-of-flow** (e.g. `Lead Review`): delivers the final summary in one shot without an extra round-trip. |
|
|
42
42
|
| <img src="docs/images/node-condition-en.png" width="220" alt="Condition node" /> | **Condition (amber top bar — lightweight read-only judge for `if/else`, `switch/case` & parallel multi-match)**<br>• Runs as a dedicated lightweight read-only subagent with **Model / Reasoning / Fallback** controls; both the overall rule and every individual branch have a `⤢` button to open a larger editor.<br>• Starts with inline editable **`Yes` / `No`** branches; click **`+ Case`** to add more named branches freely (e.g. `Pass / Minor Fix / Rewrite / Other`).<br>• Toggle **`Single`** (pick at most 1 best match) vs **`Multi`** (run all matching branches in parallel); if none match or the condition node itself fails, it never guesses a branch — it skips intermediate branches and hands off to the nearest downstream Lead (or halts cleanly for `retryFailed: true`). |
|
|
43
43
|
|
|
44
44
|
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`):
|
|
@@ -58,8 +58,8 @@ Output socket colour indicates the channel type:
|
|
|
58
58
|
| Blue | `structured` | Passes a JSON object; the upstream node is automatically asked for structured output |
|
|
59
59
|
| Purple | `session` | Continues inside the upstream child session without reloading context |
|
|
60
60
|
|
|
61
|
-
- **Disconnect
|
|
62
|
-
- **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.
|
|
61
|
+
- **Disconnect & right-click menus**: **Right-click any node, edge, or blank canvas** to open a context menu (edit role, manage refs, duplicate/delete, insert a subagent/condition directly onto a wire, add nodes, auto-layout, undo); **right-drag across any wire** still cuts links cleanly without conflict.
|
|
62
|
+
- **Dashed nodes (inactive)**: Unreachable nodes, blank-role solo chained Lead nodes with no subagent upstream, and dangling dead-end subagents render **dashed** and are skipped at run time.
|
|
63
63
|
|
|
64
64
|

|
|
65
65
|
|
|
@@ -84,6 +84,7 @@ Drop a **Condition** node anywhere in the graph to route downstream automaticall
|
|
|
84
84
|
- Supports default binary **`Yes / No`**, multi-way **`switch/case`** via **`+ Case`** (e.g. `Pass / Minor Fix / Rewrite`), and **`Single / Multi`** match modes.
|
|
85
85
|
- Unchosen branches are pruned automatically without spawning; if zero branches match or the condition node itself fails, it never guesses — it skips intermediate branches and hands off to the nearest downstream Lead.
|
|
86
86
|
- Once judged, a compact verdict pill appears right under the condition card (click to inspect the full verdict reason), while unchosen branch edges and skipped nodes dim automatically.
|
|
87
|
+
- **Per-node & global `+ Refs` list**: Click **`+ Refs`** in the top-right title bar of any node (Entry Lead global refs, downstream Leads, Subagents, or Condition nodes) to attach up to 16 reference file paths, URLs, or constraints — deduplicated and injected into prompts automatically at run time.
|
|
87
88
|
|
|
88
89
|

|
|
89
90
|
|
|
@@ -122,12 +123,13 @@ Active nodes glow blue with animated flow wires and turn green when done. **Clic
|
|
|
122
123
|
|---|---|
|
|
123
124
|
| `Shift+A` / Drag-wire drop | Add a node at cursor, or drag from an output socket onto blank canvas to create & auto-connect (`1` Subagent, `2` Lead, `3` Condition) |
|
|
124
125
|
| Middle-drag / `Space` + left-drag | Pan the canvas |
|
|
125
|
-
| Wheel /
|
|
126
|
+
| Wheel / bottom-right `⊡` & `100%` pill | Zoom around cursor / fit all nodes / click to reset 100%, drag left-right to scrub zoom |
|
|
126
127
|
| `⇄ Horiz` / `⇅ Vert` | Switch canvas direction and auto-layout (vertical mode uses top-in / bottom-out vertical curves for narrow sidebars; Condition nodes support `Out R / Out L` side toggle) |
|
|
127
|
-
| Marquee drag + `
|
|
128
|
-
| Right-
|
|
128
|
+
| Marquee drag + `Shift+D` / `Delete` | Multi-select move, duplicate (with settings & internal links), or batch delete |
|
|
129
|
+
| Right-click node / edge / canvas | Context menu (edit role, manage refs, insert node on wire, add nodes, layout, undo) |
|
|
130
|
+
| Right-drag across wires | Cut links (activates at ≥ 6px drag without conflicting with context menu; toggle under `⋯`) |
|
|
129
131
|
| `Ctrl+Z` / `Esc` | Undo structural edit / close popups |
|
|
130
|
-
| `⋯` menu | Import / Copy JSON, Auto layout, Clear canvas, Visual effects
|
|
132
|
+
| `⋯` menu | Undo, Fit, Import / Copy JSON, Auto layout, Clear canvas, Visual effects, Max parallel, Language, Shortcuts |
|
|
131
133
|
|
|
132
134
|
## Presets, sharing & limits
|
|
133
135
|
|
package/README.zh.md
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|---|---|
|
|
39
39
|
| <img src="docs/images/node-entry-zh.png" width="220" alt="开始节点(入口 Lead)" /> | **入口 Lead(开始节点,不可删除)**<br>• 整张图的起点,**只有右侧输出口**。<br>• 「任务」框用于填写本次流程的总目标;也可以留空,开启画布后直接在聊天框发任务即可自动传入。<br>• 需要参与执行的节点都必须从它连出去。 |
|
|
40
40
|
| <img src="docs/images/node-subagent-zh.png" width="220" alt="子代理节点" /> | **子代理节点(绿顶,独立子会话执行)**<br>• **模型 / 推理**:可为每个节点单独指定模型和推理强度。<br>• **能力**:`standard`(全部工具)或 `minimal`(只读思考,关闭文件读写与联网),受主对话权限上限约束。<br>• **备用**:主模型报错时自动换备用模型重试一次。<br>• **记忆**:打开 `开` 后可在右侧下拉框选 `最新` 或指定某次历史会话(`#1 / #2`)续接(关闭时下拉框置灰占位)。<br>• **分工**:支持行内直接输入,或点右侧 `⤢` 展开大输入框编辑。 |
|
|
41
|
-
| <img src="docs/images/node-lead-zh.png" width="220" alt="Lead 节点" /> | **Lead 节点(蓝顶,由主对话直接执行)**<br>• **不创建子会话**,直接交回当前主对话完成这一步。<br>• **放在流程中间**(如 `Lead 拍板`):上游完成后暂停并亮起 `⏸ 待拍板`,在对话里确认或补充后再继续跑下游。<br>•
|
|
41
|
+
| <img src="docs/images/node-lead-zh.png" width="220" alt="Lead 节点" /> | **Lead 节点(蓝顶,由主对话直接执行)**<br>• **不创建子会话**,直接交回当前主对话完成这一步。<br>• **放在流程中间**(如 `Lead 拍板`):上游完成后暂停并亮起 `⏸ 待拍板`,在对话里确认或补充后再继续跑下游。<br>• **支持主对话阶段串联(`Lead → Lead`)**:只要填写了 `分工` 即可直接把多个主对话阶段串成轻量级人工闸门或分步引导,全程不拉起子代理;未连入子代理且未填写 `分工` 的空 Lead 才会显示为虚线并跳过。<br>• **放在流程末尾**(如 `Lead 终审`):所有上游完成后直接汇总交付,不产生额外回调轮次。 |
|
|
42
42
|
| <img src="docs/images/node-condition-zh.png" width="220" alt="条件分支节点" /> | **条件分支节点(琥珀顶,轻量只读裁判,支持 `if/else`、`switch/case` 与多选并行)**<br>• 作为独立轻量只读子代理读取上游交付物(含失败状态)并按「条件」做客观路由;支持配置**模型 / 推理 / 备用模型**,主规则与每条分支均支持点 `⤢` 展开大框编辑。<br>• 初始即为可编辑文本框 **`是` / `否`**,点 **`+ 分支`** 可自由扩展多路(如 `通过 / 小修 / 重做 / 其他`)。<br>• 支持 **`单选`**(最多命中 1 路)与 **`多选`**(所有满足条件的分支并行执行);若全不满足或条件节点自身执行失败,不擅自乱选分支,直接跳过中间分支转交最近下游 Lead(无下游 Lead 时熔断暂停),并支持 `retryFailed: true` 断点重跑。 |
|
|
43
43
|
|
|
44
44
|
可以直接点右上角 **`☰ 预设`** 载入内置模板,或在画布任意位置按 **`Shift+A`** 新建节点(`⋯` 菜单提供 `⊞ 自动排版` 和 `✕ 清空画布`):
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
| 蓝 | `structured` | 传递 JSON 对象;上游会被自动要求输出结构化结果 |
|
|
59
59
|
| 紫 | `session` | 复用上游的子会话,下游在同一个上下文里继续执行 |
|
|
60
60
|
|
|
61
|
-
-
|
|
62
|
-
-
|
|
61
|
+
- **断开连线与右键菜单**:**右键单击节点 / 连线 / 空白画布**可弹出对应上下文菜单(支持复制/删除节点、在连线中一键插入子代理或条件节点、空白处新建/排版/撤销等);**按住鼠标右键划过连线**仍可快速切断连线,两种操作互不冲突。
|
|
62
|
+
- **虚线节点(不生效)**:未从入口连通的节点、既未连入子代理又未填 `分工` 的空串联 Lead、以及存在终审 Lead 却没有连出下游的子代理,都会显示为**虚线框**并在运行时跳过。
|
|
63
63
|
|
|
64
64
|

|
|
65
65
|
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
- 支持默认二分支 **`是 / 否`**、点击 **`+ 分支`** 扩展多路 **`switch/case`**(如 `通过 / 小修 / 重做`),以及 **`单选 / 多选`** 两种匹配模式。
|
|
85
85
|
- 未命中的分支自动剪枝跳过、不消耗额度;所有分支均未命中或条件节点自身失败时,不擅自乱选,直接转交最近下游 Lead 处理。
|
|
86
86
|
- 判决完成后,条件节点下方会直接显示命中分支标签(点击可查看完整判断理由),未命中的分支连线与被跳过节点自动淡化标示。
|
|
87
|
+
- **节点 `+ 参考` 清单**:所有节点(包括入口 Lead 全局参考、下游 Lead、子代理、条件节点)标题栏右上角均提供 **`+ 参考`** 按钮,可附带文件路径、URL 或规范约束(最多 16 条),运行时自动去重注入提示词。
|
|
87
88
|
|
|
88
89
|

|
|
89
90
|
|
|
@@ -123,12 +124,13 @@
|
|
|
123
124
|
|---|---|
|
|
124
125
|
| `Shift+A` / 拖线松手 | 在光标处新建节点,或从输出口拖线至空白处松手就地新建并自动连线(`1` 子代理,`2` Lead,`3` 条件) |
|
|
125
126
|
| 鼠标中键拖拽 / `Space` + 左键拖拽 | 平移画布 |
|
|
126
|
-
| 滚轮 /
|
|
127
|
+
| 滚轮 / 右下角 `⊡` & `100%` 浮条 | 光标处缩放 / 一键居中看全图 / 点击回 100%,左右拖可连续缩放 |
|
|
127
128
|
| `⇄ 横排` / `⇅ 竖排` | 一键切换画布流向并自动重排(竖排为顶入底出 + 垂直曲线,更适合窄侧边栏;条件节点支持 `右出 / 左出` 切换) |
|
|
128
|
-
| 左键框选 + `
|
|
129
|
-
|
|
|
129
|
+
| 左键框选 + `Shift+D` / `Delete` | 批量移动、批量复制(连同参数配置与内部连线)或批量删除 |
|
|
130
|
+
| 右键单击节点 / 连线 / 空白处 | 打开右键上下文菜单(编辑分工、管理参考、在连线中间插入节点、新建/排版/撤销等) |
|
|
131
|
+
| 右键按住划过连线 | 切断连线(移动 ≥ 6px 触发,与右键菜单不冲突;可在 `⋯` 菜单开关) |
|
|
130
132
|
| `Ctrl+Z` / `Esc` | 撤销上一步改动 / 关闭菜单弹窗 |
|
|
131
|
-
| `⋯` 更多菜单 |
|
|
133
|
+
| `⋯` 更多菜单 | 撤销、全览、导入 / 复制 JSON、自动排版、清空画布、动效档位、最大并发、语言切换、快捷键设置 |
|
|
132
134
|
|
|
133
135
|
## 预设、分享与限制
|
|
134
136
|
|