dsh-workflow-canvas 0.1.1 → 0.2.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
@@ -1,5 +1,11 @@
1
1
  # DSH Workflow Canvas
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/dsh-workflow-canvas)](https://www.npmjs.com/package/dsh-workflow-canvas)
4
+ [![DSH](https://img.shields.io/badge/DSH-%3E%3D0.2.2-2f81f7)](https://github.com/Wasabi2575/dsh-workflow-canvas)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-3fb950.svg)](LICENSE)
6
+
7
+ English | [中文](README.zh.md)
8
+
3
9
  Orchestrate subagent workflows from the DSH sidebar. Draw each step as a node, wire
4
10
  the data flow with three link types, enable it, and run it from chat — subagent nodes
5
11
  are spawned for real, Lead nodes pause the run and are performed by the conversation
@@ -11,8 +17,6 @@ glance — grey carries text, blue carries JSON, purple continues the upstream s
11
17
 
12
18
  ![workflow canvas](docs/images/canvas-demo.png)
13
19
 
14
- - [中文说明](README.zh.md)
15
-
16
20
  ## Installation
17
21
 
18
22
  Requires DeepSeek Harness **0.2.2** or newer (the package declares
@@ -22,15 +26,25 @@ Requires DeepSeek Harness **0.2.2** or newer (the package declares
22
26
  *"workflow canvas"*, and install. The dshmarket entry is still awaiting
23
27
  review; see the
24
28
  [catalog PR](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/17180).
25
- - **From npm** — install the published package `dsh-workflow-canvas`
26
- (latest `0.1.0`) from the **Plugins** panel, or via the `plugin_manager` tool /
27
- `dsh` CLI with `install_bundle` and `target: dsh-workflow-canvas`.
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`.
28
32
  - **From source** — clone the repository and install it as a local directory
29
33
  with **Plugins → Add plugin**, pointing at the checkout.
30
34
 
31
35
  After installing, enable the plugin and the `workflow` tab appears in the right
32
36
  sidebar.
33
37
 
38
+ ## Quick start (30 seconds)
39
+
40
+ - **Zero-setup tryout**: open the right-sidebar `Workflow` tab → load a starter
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."*
47
+
34
48
  ## How this differs from other canvas plugins
35
49
 
36
50
  DSH has more than one "workflow canvas". This one orchestrates **subagents** from
@@ -56,18 +70,30 @@ pipelines compiled to `ctx.workflows`, see
56
70
  | `structured` | blue | a JSON object; the upstream node is asked for structured output automatically |
57
71
  | `session` | purple | the upstream child session, so the downstream runs **inside it** |
58
72
 
59
- Drag from a right socket to a left socket, or from a left socket to a right one.
60
- Drag a connected left socket away to detach. Hold the **right button** and sweep
61
- across links to cut them (toggle in `⋯`).
73
+ Drag from a right socket to a left socket, or from a left socket to a right one
74
+ (cycles are blocked immediately). Drag a connected left socket away to detach.
75
+
76
+ ## Canvas controls & shortcuts
77
+
78
+ | Control / Shortcut | Action |
79
+ |---|---|
80
+ | `Shift+A` | Open the Add Node menu at the cursor (`1` / `2` to drop immediately) |
81
+ | Middle-drag / `Space` + left-drag | Pan the canvas (works even when starting over a node) |
82
+ | Wheel / `⊡ Fit` / `100%` | Cursor-anchored zoom / fit all nodes in view / reset to 100% on Lead |
83
+ | Marquee drag + `Ctrl+D` / `Delete` | Multi-select move, duplicate (preserving settings), or batch delete |
84
+ | `Ctrl+Z` / `Esc` | Undo structural edits / close open popups and menus |
85
+ | Right-drag across links | Cut swept links (toggle under `⋯`); `⋯` also has `⊞ Auto layout`, `⇧ Copy JSON`, and `Visual effects` (Minimal / Standard / Vivid) |
62
86
 
63
87
  ## Running
64
88
 
65
- 1. Write the task in the entry Lead, and a role for each node.
89
+ 1. Write the task in the entry Lead, and a role for each node (or leave the task
90
+ blank and pass `task` from chat when reusing a template).
66
91
  2. Connect the nodes — unlinked nodes are dashed and skipped.
67
92
  3. Press the **● ON / ○ OFF** pill at the top-left of the canvas, then ask in chat
68
- to run it.
93
+ to run it (pass `reset: true` to restart from scratch).
69
94
  4. The run proceeds in parallel waves (up to 4 at a time) and pauses at each Lead
70
- node with the results collected so far.
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.
71
97
 
72
98
  ## Lead handover
73
99
 
@@ -75,19 +101,22 @@ When a `session` link points into a Lead node, the run reports that child sessio
75
101
  id at the Lead step, so the conversation can keep talking to that agent instead of
76
102
  only receiving its text.
77
103
 
78
- ## Generating and editing the canvas from chat
104
+ ## Inspecting, generating and editing the canvas from chat
79
105
 
106
+ - `canvas_inspect` — read the current canvas (enabled state, task, node ids/models/roles
107
+ and links), so the agent can safely patch manually edited or preset graphs.
80
108
  - `canvas_generate` — build a whole canvas from a node/edge sketch (replaces it).
81
109
  - `canvas_patch` — edit it in place: update nodes by id, add or remove nodes and
82
110
  links, leaving positions and everything else untouched.
83
111
 
84
- Both write the canvas to the workspace, and the panel picks it up within ~1.5s.
112
+ Generate and patch both write the canvas to the workspace, and the panel picks it
113
+ up within ~1.5s.
85
114
 
86
- ## Presets
115
+ ## Presets & sharing
87
116
 
88
- Name a canvas and press `☆ Save`; load it in another session from `☰ Presets`.
89
- Presets live in browser storage, shared across sessions of the same origin, and are
90
- not synchronised across machines.
117
+ `☰ Presets` ships with ready-to-run starter templates; name any canvas and press
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`.
91
120
 
92
121
  ## Memory
93
122
 
@@ -98,7 +127,9 @@ fresh.
98
127
 
99
128
  ## Limits
100
129
 
101
- - Presets do not travel between the Desktop app and `dsh web`, nor across machines.
130
+ - Saved presets live in browser storage and do not auto-sync between the Desktop
131
+ app and `dsh web`, nor across machines (use `⋯ → ⇧ Copy JSON` and `⇩ Import`
132
+ to move or share them).
102
133
  - Node status is read from the subagent catalog, so Lead steps show **Runs in chat**
103
134
  instead of a tracked state.
104
135
  - Up to 4 nodes run at a time.
@@ -124,7 +155,8 @@ tool with name `workflow-canvas` first.
124
155
  ## Development
125
156
 
126
157
  Edit `client.js` / `index.js` and reload the app; client changes hot-reload, Host
127
- changes need a restart. See [docs/DETAIL.md](docs/DETAIL.md) for the internals.
158
+ changes need a restart. Run `npm test` for the test suite. See
159
+ [docs/DETAIL.md](docs/DETAIL.md) for the internals.
128
160
 
129
161
  ## License
130
162
 
package/README.zh.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # DSH Workflow Canvas(可视化工作流画布)
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/dsh-workflow-canvas)](https://www.npmjs.com/package/dsh-workflow-canvas)
4
+ [![DSH](https://img.shields.io/badge/DSH-%3E%3D0.2.2-2f81f7)](https://github.com/Wasabi2575/dsh-workflow-canvas)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-3fb950.svg)](LICENSE)
6
+
7
+ 中文 | [English](README.md)
8
+
3
9
  在 DSH 侧边栏里编排子代理工作流:把每一步画成一个节点、用三种连线标出数据怎么流转,
4
10
  启用后直接在对话里运行。子代理节点会被真实启动,Lead 节点会暂停运行、由对话本体执行。
5
11
 
@@ -8,8 +14,6 @@
8
14
 
9
15
  ![工作流画布](docs/images/canvas-demo-zh.png)
10
16
 
11
- - [English README](README.md)
12
-
13
17
  ## 安装
14
18
 
15
19
  需要 DeepSeek Harness **0.2.2** 或更新版本(包声明
@@ -20,12 +24,20 @@
20
24
  [目录 PR](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/17180)。
21
25
  - **从 npm 安装** —— 从 **插件** 面板,或用 `plugin_manager` 工具 / `dsh` CLI
22
26
  的 `install_bundle`(`target` 填 `dsh-workflow-canvas`)安装已发布的包
23
- `dsh-workflow-canvas`(最新 `0.1.0`)。
27
+ `dsh-workflow-canvas`。
24
28
  - **从源码安装** —— 克隆仓库后,用 **插件 → 添加插件(Add plugin)** 把它作为
25
29
  本地目录安装,指向 checkout 目录。
26
30
 
27
31
  装好并启用插件后,右侧边栏会出现 `workflow` 标签页。
28
32
 
33
+ ## 30 秒快速上手
34
+
35
+ - **最快体验(零手动画图)**:打开右侧 `Workflow` 标签页 → 点击 `☰ 预设` 载入内置示例模板 → 点左上角 **● 已启用** → 在对话里说「按画布跑一次」。
36
+ - **直接用对话驱动画布**(可复制尝试):
37
+ - **一句话搭图**:*「帮我在工作流画布里搭一个并行调研流程:先让两个子代理分别做竞品调研和技术可行性评估,再由我(Lead)拍板,最后交给子代理写方案」*
38
+ - **就地微调**:*「先看一下当前画布,把技术可行性节点开启记忆,再补一个只读的成本估算节点并行连到方案合成」*
39
+ - **复用模板换任务跑**:*「用当前画布跑一下,总任务改为:评估在现有项目里接入本地知识库的方案」*
40
+
29
41
  ## 与其它画布插件的区别
30
42
 
31
43
  DSH 生态里不止一个「工作流画布」。本项目在侧边栏里编排**子代理**,Lead 步骤由对话本体执行,
@@ -45,30 +57,41 @@ DSH 生态里不止一个「工作流画布」。本项目在侧边栏里编排*
45
57
  | `structured` | 蓝 | 一个 JSON 对象;上游节点会被自动要求输出结构化结果 |
46
58
  | `session` | 紫 | 上游的子会话,下游在**它里面**继续跑 |
47
59
 
48
- 从右端口拖到左端口、或从左端口拖到右端口都能连线;拖已连接的左端口可断开。
49
- 按住**右键**划过连线可切断(可在 `⋯` 里关掉这个手势)。
60
+ 从右端口拖到左端口、或从左端口拖到右端口都能连线(成环会被即时阻止);拖已连接的左端口可断开。
61
+
62
+ ## 画布操作与快捷键
63
+
64
+ | 操作 / 快捷键 | 效果 |
65
+ |---|---|
66
+ | `Shift+A` | 在光标位置打开新建节点菜单(按 `1` / `2` 快速落点) |
67
+ | 鼠标中键拖拽 / `Space` + 左键拖拽 | 平移画布(鼠标悬停在节点上也可直接拖) |
68
+ | 滚轮 / `⊡ 全览` / `100%` | 光标处缩放 / 自适应完整显示全图 / 重置 100% 并聚焦入口 Lead |
69
+ | 左键框选 + `Ctrl+D` / `Delete` | 多选拖拽、批量复制(保留模型与参数配置)或批量删除选中节点 |
70
+ | `Ctrl+Z` / `Esc` | 撤销结构改动 / 关闭当前浮层与菜单 |
71
+ | 右键按住划过连线 | 切断连线(可在 `⋯` 菜单开关);`⋯` 里还提供 `⊞ 自动排版`、`⇧ 复制 JSON` 与三档 `视觉效果`(极简 / 标准 / 炫酷) |
50
72
 
51
73
  ## 运行
52
74
 
53
- 1. 在入口 Lead 写总任务,给每个节点写分工。
75
+ 1. 在入口 Lead 写总任务,给每个节点写分工(也可以留空任务,在对话里直接让 agent 传 `task` 运行)。
54
76
  2. 连好节点——未连线的节点会显示虚线并被跳过。
55
- 3. 点画布左上角的 **● 已启用 / ○ 已禁用** 浮窗,然后在对话里让它跑。
56
- 4. 运行按波次并行(每次最多 4 个),每到一个 Lead 节点就暂停,并把已收集的结果交回。
77
+ 3. 点画布左上角的 **● 已启用 / ○ 已禁用** 浮窗,然后在对话里让它跑(支持 `reset: true` 从头重跑)。
78
+ 4. 运行按波次并行(每次最多 4 个),每到一个 Lead 节点就暂停,并把已收集的结果交回;点击子代理节点右下角状态胶囊(如 `已完成 ↗`)可直达它的对话记录。
57
79
 
58
80
  ## Lead 交接
59
81
 
60
82
  当 `session` 线指向 Lead 节点时,运行会在 Lead 步骤上报那个子会话 id,于是对话可以继续追问那个子代理,而不只是拿到它的文本。
61
83
 
62
- ## 从对话生成 / 修改画布
84
+ ## 从对话读取 / 生成 / 修改画布
63
85
 
86
+ - `canvas_inspect` —— 只读查看当前画布的启用状态、总任务、节点 id/模型/分工与连线(手动改图或载入预设后,先读再改)。
64
87
  - `canvas_generate` —— 从一个节点/连线草图重建整张画布(替换)。
65
88
  - `canvas_patch` —— 就地编辑:按 id 更新节点、增删节点和连线,位置和其余内容保持不变。
66
89
 
67
- 两者都会把画布写到工作区,面板约 1.5 秒内自动读取。
90
+ 生成和修改都会把画布写到工作区,面板约 1.5 秒内自动读取。
68
91
 
69
- ## 预设
92
+ ## 预设与分享
70
93
 
71
- 给画布起名后点 `☆ 保存`;在其它会话里从 `☰ 预设` 载入。预设存在浏览器存储里,同源会话共享,不跨机器同步。
94
+ `☰ 预设` 内置了开箱即用的示例模板,点一下即可载入试跑;给画布起名后点 `☆ 保存` 即可存为自定义预设。若要跨机器或在桌面端 / `dsh web` 之间分享,用 `⋯ → ⇧ 复制 JSON` 与 `⇩ 导入` 即可。
72
95
 
73
96
  ## 记忆
74
97
 
@@ -76,7 +99,7 @@ DSH 生态里不止一个「工作流画布」。本项目在侧边栏里编排*
76
99
 
77
100
  ## 限制
78
101
 
79
- - 预设不在桌面应用和 `dsh web` 之间互通,也不跨机器同步。
102
+ - 自定义预设存储在浏览器本地,不在桌面应用和 `dsh web` 之间自动同步,也不跨机器同步(可通过 `⋯ → ⇧ 复制 JSON` 与 `⇩ 导入` 手动迁移或分享)。
80
103
  - 节点状态读取自子代理目录,因此 Lead 步骤显示 **由对话执行**,而不是一个可追踪的状态。
81
104
  - 同一时间最多并行运行 4 个节点。
82
105
 
@@ -95,7 +118,7 @@ DSH 生态里不止一个「工作流画布」。本项目在侧边栏里编排*
95
118
 
96
119
  ## 开发
97
120
 
98
- 编辑 `client.js` / `index.js` 后重载应用;客户端改动热更生效,Host 改动需要重启。内部实现见 [docs/DETAIL.md](docs/DETAIL.md)。
121
+ 编辑 `client.js` / `index.js` 后重载应用;客户端改动热更生效,Host 改动需要重启。运行 `npm test` 执行单测;内部实现见 [docs/DETAIL.md](docs/DETAIL.md)。
99
122
 
100
123
  ## 许可
101
124