dsh-workflow-canvas 1.5.0 → 1.6.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 CHANGED
@@ -103,6 +103,8 @@ 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**: Always visible beside `● ON` (muted when idle; lights up red alongside a compact `⏹` button on the Entry Lead card whenever a run is active or paused at **`⏸ Awaiting Lead`**) — 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 })`).
107
+ - **Zero-token Run Summary**: Once a workflow runs, a compact bottom-left summary pill (and `⋯ → 📊 Run summary`) displays live elapsed time, per-node duration bars, fallback/session-continuation tags, condition verdicts, and round-by-round loop retry history, with one-click node focus, child-chat jump (`↗`), and **Copy Markdown** export — computed purely from local `.run.json` telemetry with zero extra LLM calls or prompt tokens.
106
108
  - 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
109
 
108
110
  ![Auto-run enabled canvas, pause at Lead decision, and finish](docs/images/lead-pause-resume.gif)
@@ -131,16 +133,16 @@ Active nodes glow blue with animated flow wires and turn green when done. **Clic
131
133
  | `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
134
  | Middle-drag / `Space` + left-drag | Pan the canvas |
133
135
  | 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) |
136
+ | `⇄ 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
137
  | 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) |
138
+ | Right-click node / edge / canvas | Context menu (edit role, manage refs, insert node on wire, create loop, add nodes, layout, undo/redo) |
137
139
  | 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 |
140
+ | Toolbar `↶ / ↷` / `Ctrl+Z` / `Ctrl+Shift+Z` (`Ctrl+Y`) / `Esc` | Undo / redo (covers structural edits, node drags & layout flips) / close popups |
141
+ | `⋯` menu | Undo, Fit, Import / Copy JSON (preserves direction), Auto layout, Clear canvas, Visual effects, Max parallel, Language, Shortcuts |
140
142
 
141
143
  ## Presets, sharing & limits
142
144
 
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.
145
+ - **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
146
  - **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
147
  - **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
148
  - **Limits**: Per-node `Scope` only narrows tools within the main chat's permission/sandbox ceiling.
package/README.zh.md CHANGED
@@ -103,6 +103,8 @@
103
103
 
104
104
  - 入口 Lead 的任务栏可填可不填;点卡片 **`▶ 运行`** 需已启用且任务非空,留空时也可直接在聊天框发送任务作为 `task` 传入。
105
105
  - 跑到中间 Lead 时,画布亮起 **`⏸ 待拍板`**(入口按钮同步变为 `⏸ 等待决策`)并交回主对话;回复后下游自动续跑到终审完成。
106
+ - **一键统一终止(`⏹ 终止`)**:画布左上角 `● 已启用` 旁常驻 **`⏹ 终止`** 按钮(空闲时为灰标禁用;任务运行中或停在 **`⏸ 待拍板`** 状态时亮红,同时入口 Lead 卡片左下角出现快捷 `⏹` 按钮)——点一下即可并发中止主回合与全部运行中的子代理、解除等待拍板状态并保留已完成节点的缓存(聊天里也可直接要求取消,触发 `canvas_workflow({ cancel: true })`)。
107
+ - **零额外 Token 执行复盘(`📊 执行复盘`)**:运行开始后,画布左下角自动出现紧凑复盘胶囊(也可从 `⋯ → 📊 执行复盘` 打开),实时汇总总耗时、各节点耗时条与轮次、备用模型回退/会话续接标签、条件命中理由和回环打回记录,支持点击节点居中定位、直达子会话(`↗`)及一键复制 Markdown 复盘报告——全程基于本地 `.run.json` 纯统计渲染,不消耗任何额外 Token。
106
108
  - 同一对话重跑支持 `reset: true`;若画布含已产生历史会话的记忆节点,Agent 会在重跑前确认保留记忆还是清空记忆(`clearMemory: true`)。
107
109
 
108
110
  ![启用即跑、Lead 暂停拍板与自动续跑交付](docs/images/lead-pause-resume.gif)
@@ -132,16 +134,16 @@
132
134
  | `Shift+A` / 拖线松手 | 在光标处新建节点,或从输出口拖线至空白处松手就地新建并自动连线(`1` 子代理,`2` Lead,`3` 条件) |
133
135
  | 鼠标中键拖拽 / `Space` + 左键拖拽 | 平移画布 |
134
136
  | 滚轮 / 右下角 `⊡` & `100%` 浮条 | 光标处缩放 / 一键居中看全图 / 点击回 100%,左右拖可连续缩放 |
135
- | `⇄ 横排` / `⇅ 竖排` | 一键切换画布流向并自动重排(竖排为顶入底出 + 垂直曲线,更适合窄侧边栏;条件节点支持 `右出 / 左出` 切换) |
137
+ | `⇄ 横排` / `⇅ 竖排` | 一键切换画布流向并自动重排,**自动记住为新会话默认布局**(竖排为顶入底出 + 垂直曲线,更适合窄侧边栏;条件节点支持 `右出 / 左出` 切换) |
136
138
  | 左键框选 / `Shift`/`Ctrl` 点选 + `Shift+D` / `Delete` | 批量移动、批量复制(连同参数配置与内部连线)或批量删除 |
137
- | 右键单击节点 / 连线 / 空白处 | 打开右键上下文菜单(编辑分工、管理参考、在连线中间插入节点、新建/排版/撤销重做等) |
139
+ | 右键单击节点 / 连线 / 空白处 | 打开右键上下文菜单(编辑分工、管理参考、在连线中间插入节点、设为回环、新建/排版/撤销重做等) |
138
140
  | 右键按住划过连线 | 切断连线(移动 ≥ 6px 触发,与右键菜单不冲突;可在 `⋯` 菜单开关) |
139
- | `Ctrl+Z` / `Ctrl+Shift+Z`(`Ctrl+Y`) / `Esc` | 撤销 / 重做上一步改动 / 关闭菜单弹窗 |
140
- | `⋯` 更多菜单 | 撤销、全览、导入 / 复制 JSON、自动排版、清空画布、动效档位、最大并发、语言切换、快捷键设置 |
141
+ | 顶栏 `↶ / ↷` / `Ctrl+Z` / `Ctrl+Shift+Z`(`Ctrl+Y`) / `Esc` | 撤销 / 重做(涵盖结构改动、节点拖拽位置与横竖排切换)/ 关闭菜单弹窗 |
142
+ | `⋯` 更多菜单 | 撤销、全览、导入 / 复制 JSON(保留布局方向)、自动排版、清空画布、动效档位、最大并发、语言切换、快捷键设置 |
141
143
 
142
144
  ## 预设、分享与限制
143
145
 
144
- - **预设与跨会话复用**:点右上角 `☰ 预设` 即可在顶部将当前画布保存为自定义预设(跨会话通用,新对话一键载入),下方还内置 5 套开箱即用模板(含条件分支与循环重试)和「新建空白画布」。自定义预设保存在本地浏览器存储中,跨设备分享请用 `⋯ → ⇧ 复制 JSON` 与 `⇩ 导入`。
146
+ - **预设与跨会话复用**:点右上角 `☰ 预设` 即可在顶部将当前画布(连同横/竖排方向)保存为自定义预设,**已打开的其它会话实时同步**并支持点 `↻` 手动刷新;下方还内置 5 套开箱即用模板(含条件分支与循环重试,随当前布局方向自适应排版)和「新建空白画布」。自定义预设保存在本地浏览器存储中,跨设备分享请用 `⋯ → ⇧ 复制 JSON` 与 `⇩ 导入`。
145
147
  - **局部重跑与并发调节**:中间节点失败后支持 `retryFailed: true` 或 `fromNodes` 只重跑失败段及下游、复用已成功节点缓存;`⋯` 菜单可调整最大并发数(1 / 2 / 4 / 6 / 8,默认 4)。
146
148
  - **与其它画布插件的区别**:本项目专注**多子代理编排 + 条件分流 + 对话本体拍板**;如果你需要的是把底层工具调用编译为 `ctx.workflows` 的管线,可看 [`@piedpiper911/dsh-workflow-canvas`](https://github.com/PiedPiper911/dsh-workflow-canvas)。
147
149
  - **运行限制**:子代理的「能力」受主对话权限/沙箱上限约束。