dsh-workflow-canvas 1.5.0 → 1.5.5

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 CHANGED
@@ -103,6 +103,7 @@ Press **`● ON`** at the top-left of the canvas, then either click **`▶ Run`*
103
103
 
104
104
  - If the entry Lead's task is blank, `▶ Run` stays disabled with a hint and you can still send your chat message directly as `task`.
105
105
  - At an intermediate **Lead** node, the canvas shows **`⏸ Ready`** (and Entry Lead shows `⏸ Awaiting Lead`) while handing control to chat; once you reply, downstream nodes resume automatically through the final Lead review.
106
+ - **Unified `⏹ Stop` button**: Whenever a run is active or paused at **`⏸ Awaiting Lead`**, a red **`⏹ Stop`** button appears beside `● ON` and on the Entry Lead card — clicking it immediately cancels the root turn, interrupts all live subagents, clears any Lead pause, and preserves completed-node cache (you can also ask in chat to cancel via `canvas_workflow({ cancel: true })`).
106
107
  - 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`).
107
108
 
108
109
  ![Auto-run enabled canvas, pause at Lead decision, and finish](docs/images/lead-pause-resume.gif)
@@ -131,16 +132,16 @@ Active nodes glow blue with animated flow wires and turn green when done. **Clic
131
132
  | `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) |
132
133
  | Middle-drag / `Space` + left-drag | Pan the canvas |
133
134
  | Wheel / bottom-right `⊡` & `100%` pill | Zoom around cursor / fit all nodes / click to reset 100%, drag left-right to scrub zoom |
134
- | `⇄ 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) |
135
+ | `⇄ Horiz` / `⇅ Vert` | Switch canvas direction and auto-layout, **remembered as the default for new sessions** (vertical mode uses top-in / bottom-out curves; Condition nodes support `Out R / Out L` side toggle) |
135
136
  | Marquee / `Shift`/`Ctrl` click + `Shift+D` / `Delete` | Multi-select move, duplicate (with settings & internal links), or batch delete |
136
- | Right-click node / edge / canvas | Context menu (edit role, manage refs, insert node on wire, add nodes, layout, undo/redo) |
137
+ | Right-click node / edge / canvas | Context menu (edit role, manage refs, insert node on wire, create loop, add nodes, layout, undo/redo) |
137
138
  | Right-drag across wires | Cut links (activates at ≥ 6px drag without conflicting with context menu; toggle under `⋯`) |
138
- | `Ctrl+Z` / `Ctrl+Shift+Z` (`Ctrl+Y`) / `Esc` | Undo / redo structural edit / close popups |
139
- | `⋯` menu | Undo, Fit, Import / Copy JSON, Auto layout, Clear canvas, Visual effects, Max parallel, Language, Shortcuts |
139
+ | Toolbar `↶ / ↷` / `Ctrl+Z` / `Ctrl+Shift+Z` (`Ctrl+Y`) / `Esc` | Undo / redo (covers structural edits, node drags & layout flips) / close popups |
140
+ | `⋯` menu | Undo, Fit, Import / Copy JSON (preserves direction), Auto layout, Clear canvas, Visual effects, Max parallel, Language, Shortcuts |
140
141
 
141
142
  ## Presets, sharing & limits
142
143
 
143
- - **Presets & cross-session reuse**: Click `☰ Presets` to save the current canvas at the top of the menu (immediately available in any new chat), or load one of the 5 starter templates (including conditional branching & retry loop) and **New blank canvas**. Custom presets live in browser storage — use `⋯ → ⇧ Copy JSON` and `⇩ Import` to share across devices.
144
+ - **Presets & cross-session reuse**: Click `☰ Presets` to save the current canvas (including its horizontal/vertical layout direction) — **already-open sessions stay in sync live** with a manual `↻` refresh button — or load one of the 5 starter templates (including conditional branching & retry loop, adapting to the active layout direction) and **New blank canvas**. Custom presets live in browser storage — use `⋯ → ⇧ Copy JSON` and `⇩ Import` to share across devices.
144
145
  - **Partial resume & concurrency**: If a mid-flow node fails, call `retryFailed: true` or `fromNodes` to reuse succeeded outputs and re-run only the failed segment and its downstream; adjust max concurrency (1 / 2 / 4 / 6 / 8, default 4) under `⋯`.
145
146
  - **How this differs from other canvas plugins**: Built for **multi-subagent orchestration + conditional routing + conversation Lead gates**; for `ctx.workflows` low-level tool pipelines, see [`@piedpiper911/dsh-workflow-canvas`](https://github.com/PiedPiper911/dsh-workflow-canvas).
146
147
  - **Limits**: Per-node `Scope` only narrows tools within the main chat's permission/sandbox ceiling.
package/README.zh.md CHANGED
@@ -103,6 +103,7 @@
103
103
 
104
104
  - 入口 Lead 的任务栏可填可不填;点卡片 **`▶ 运行`** 需已启用且任务非空,留空时也可直接在聊天框发送任务作为 `task` 传入。
105
105
  - 跑到中间 Lead 时,画布亮起 **`⏸ 待拍板`**(入口按钮同步变为 `⏸ 等待决策`)并交回主对话;回复后下游自动续跑到终审完成。
106
+ - **一键统一终止(`⏹ 终止`)**:任务运行中或停在 **`⏸ 待拍板`** 状态时,画布左上角 `● 已启用` 旁和入口 Lead 卡片左下角均会自动显示红色 **`⏹ 终止`** 按钮——点一下即可并发中止主回合与全部运行中的子代理、解除等待拍板状态并保留已完成节点的缓存(聊天里也可直接要求取消,触发 `canvas_workflow({ cancel: true })`)。
106
107
  - 同一对话重跑支持 `reset: true`;若画布含已产生历史会话的记忆节点,Agent 会在重跑前确认保留记忆还是清空记忆(`clearMemory: true`)。
107
108
 
108
109
  ![启用即跑、Lead 暂停拍板与自动续跑交付](docs/images/lead-pause-resume.gif)
@@ -132,16 +133,16 @@
132
133
  | `Shift+A` / 拖线松手 | 在光标处新建节点,或从输出口拖线至空白处松手就地新建并自动连线(`1` 子代理,`2` Lead,`3` 条件) |
133
134
  | 鼠标中键拖拽 / `Space` + 左键拖拽 | 平移画布 |
134
135
  | 滚轮 / 右下角 `⊡` & `100%` 浮条 | 光标处缩放 / 一键居中看全图 / 点击回 100%,左右拖可连续缩放 |
135
- | `⇄ 横排` / `⇅ 竖排` | 一键切换画布流向并自动重排(竖排为顶入底出 + 垂直曲线,更适合窄侧边栏;条件节点支持 `右出 / 左出` 切换) |
136
+ | `⇄ 横排` / `⇅ 竖排` | 一键切换画布流向并自动重排,**自动记住为新会话默认布局**(竖排为顶入底出 + 垂直曲线,更适合窄侧边栏;条件节点支持 `右出 / 左出` 切换) |
136
137
  | 左键框选 / `Shift`/`Ctrl` 点选 + `Shift+D` / `Delete` | 批量移动、批量复制(连同参数配置与内部连线)或批量删除 |
137
- | 右键单击节点 / 连线 / 空白处 | 打开右键上下文菜单(编辑分工、管理参考、在连线中间插入节点、新建/排版/撤销重做等) |
138
+ | 右键单击节点 / 连线 / 空白处 | 打开右键上下文菜单(编辑分工、管理参考、在连线中间插入节点、设为回环、新建/排版/撤销重做等) |
138
139
  | 右键按住划过连线 | 切断连线(移动 ≥ 6px 触发,与右键菜单不冲突;可在 `⋯` 菜单开关) |
139
- | `Ctrl+Z` / `Ctrl+Shift+Z`(`Ctrl+Y`) / `Esc` | 撤销 / 重做上一步改动 / 关闭菜单弹窗 |
140
- | `⋯` 更多菜单 | 撤销、全览、导入 / 复制 JSON、自动排版、清空画布、动效档位、最大并发、语言切换、快捷键设置 |
140
+ | 顶栏 `↶ / ↷` / `Ctrl+Z` / `Ctrl+Shift+Z`(`Ctrl+Y`) / `Esc` | 撤销 / 重做(涵盖结构改动、节点拖拽位置与横竖排切换)/ 关闭菜单弹窗 |
141
+ | `⋯` 更多菜单 | 撤销、全览、导入 / 复制 JSON(保留布局方向)、自动排版、清空画布、动效档位、最大并发、语言切换、快捷键设置 |
141
142
 
142
143
  ## 预设、分享与限制
143
144
 
144
- - **预设与跨会话复用**:点右上角 `☰ 预设` 即可在顶部将当前画布保存为自定义预设(跨会话通用,新对话一键载入),下方还内置 5 套开箱即用模板(含条件分支与循环重试)和「新建空白画布」。自定义预设保存在本地浏览器存储中,跨设备分享请用 `⋯ → ⇧ 复制 JSON` 与 `⇩ 导入`。
145
+ - **预设与跨会话复用**:点右上角 `☰ 预设` 即可在顶部将当前画布(连同横/竖排方向)保存为自定义预设,**已打开的其它会话实时同步**并支持点 `↻` 手动刷新;下方还内置 5 套开箱即用模板(含条件分支与循环重试,随当前布局方向自适应排版)和「新建空白画布」。自定义预设保存在本地浏览器存储中,跨设备分享请用 `⋯ → ⇧ 复制 JSON` 与 `⇩ 导入`。
145
146
  - **局部重跑与并发调节**:中间节点失败后支持 `retryFailed: true` 或 `fromNodes` 只重跑失败段及下游、复用已成功节点缓存;`⋯` 菜单可调整最大并发数(1 / 2 / 4 / 6 / 8,默认 4)。
146
147
  - **与其它画布插件的区别**:本项目专注**多子代理编排 + 条件分流 + 对话本体拍板**;如果你需要的是把底层工具调用编译为 `ctx.workflows` 的管线,可看 [`@piedpiper911/dsh-workflow-canvas`](https://github.com/PiedPiper911/dsh-workflow-canvas)。
147
148
  - **运行限制**:子代理的「能力」受主对话权限/沙箱上限约束。