dsh-workflow-canvas 1.4.1 → 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 +15 -8
- package/README.zh.md +15 -8
- package/client.js +1479 -330
- package/docs/DETAIL.md +50 -27
- package/docs/MECHANISM.md +20 -18
- package/docs/MECHANISM.zh.md +20 -18
- package/docs/images/retry-loop-en.png +0 -0
- package/docs/images/retry-loop-zh.png +0 -0
- package/index.js +717 -72
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
- package/skills/workflow-canvas/SKILL.md +8 -7
package/locale/en.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Workflow canvas",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Visually orchestrate subagents, conditional branching, Lead gates, and controlled retry loops.",
|
|
5
5
|
"detail": "docs/DETAIL.md"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/locale/zh.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-workflow-canvas",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "A visual multi-agent workflow canvas for DeepSeek Harness — parallel subagents, conditional branching & Lead decision gates in the sidebar.",
|
|
3
|
+
"version": "1.5.5",
|
|
4
|
+
"description": "A visual multi-agent workflow canvas for DeepSeek Harness — parallel subagents, conditional branching, controlled retry loops & Lead decision gates in the sidebar.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"exports": {
|
|
@@ -13,6 +13,7 @@ A canvas is a DAG of agents the user can see and edit.
|
|
|
13
13
|
- **Downstream Lead** (`kind: "lead"`, blue top bar) — performed by the conversation itself, never spawned. Any added non-entry Lead node holds a `role` and pauses the run (`status: "need-lead"`) so you can decide, review, or integrate before continuing. Direct `Lead → Lead` stage chains are supported (zero subagents spawned) as long as each chained Lead has a non-empty `role` describing its main-conversation stage.
|
|
14
14
|
- **Subagent** (`kind: "agent"`, green top bar) — spawned as a child agent with its own model, reasoning effort, capability scope, fallback model and memory switch. Wire every subagent's output into a downstream node or final Lead so nothing becomes a dead end.
|
|
15
15
|
- **Condition** (`kind: "condition"`, amber top bar) — lightweight read-only (`minimal`) branch judge that evaluates upstream outputs (including failure/incomplete flags) against `role`. Defaults to binary `if/else` (`branch: "true"` / `"false"`, returning `{ pass, reason }`); set `branches: ["通过", "小修", "重做"]` (2+ entries) for multi-way `switch/case` routing (`{ branches: [...], reason }`), with optional `multiMatch: true` to run all matching branches in parallel (and returning `[]` skips all downstream branches when none match). Unchosen branches are pruned automatically without spawning (even when a side `session-ref` wire connects an upstream ancestor into a pruned branch), and branches can converge back into a shared downstream node or terminal Lead.
|
|
16
|
+
- **Controlled retry loops** (`edge.loop: true`, `maxIterations: 1..10`, default `3`) — wire any condition branch back to a strict forward ancestor (never entry Lead, no crossing loops) to build a bounded feedback retry loop. On retry, only nodes strictly inside the loop (`descendants(target) ∩ ancestors(source)`) are reset; the entry node receives the condition judge's failure reason (reusing its healthy warm session when available, or starting fresh if it crashed); hitting `maxIterations` circuit-breaks and hands off all round summaries to the nearest downstream Lead.
|
|
16
17
|
- **References** (`refs: string[]`) — attach up to 16 reference file paths, URLs, or shared rules to Entry Lead (global `refs`, injected into every subagent) or any individual node (`node.refs`), cleanly replacing boilerplate read-only loader nodes.
|
|
17
18
|
|
|
18
19
|
## Which tool to call
|
|
@@ -22,7 +23,7 @@ A canvas is a DAG of agents the user can see and edit.
|
|
|
22
23
|
| inspecting or editing a manually drawn / preset canvas | `canvas_inspect` first to read node ids, models and links |
|
|
23
24
|
| a visual workflow, pipeline, or graph of agents | `canvas_generate` (replaces the canvas) |
|
|
24
25
|
| a change to the existing canvas | `canvas_patch` (edits in place, keeps the layout) |
|
|
25
|
-
| running the canvas | `canvas_workflow` (supports `leadResult`, `task` override, `reset: true`) |
|
|
26
|
+
| running the canvas | `canvas_workflow` (supports `leadResult`, `task` override, `reset: true`, `cancel: true`) |
|
|
26
27
|
|
|
27
28
|
Prefer `canvas_patch` for edits: it merges by node id, so renamed, re-roled or re-modelled nodes keep their position and untouched nodes stay as they are. Call `canvas_inspect` first if you do not already know the current node ids. Regenerating throws the layout away.
|
|
28
29
|
|
|
@@ -52,14 +53,14 @@ Output sockets determine link type; every non-entry node has a single universal
|
|
|
52
53
|
## Running
|
|
53
54
|
|
|
54
55
|
1. The canvas must be enabled (the pill over the canvas); `canvas_workflow` refuses while it is disabled. While enabled, the host automatically injects a per-session runtime context reminder on each turn.
|
|
55
|
-
2. You may pass `task` to override the entry Lead's task (handy when reusing a preset), `reset: true` to discard a paused run and start from scratch, `retryFailed: true` to reuse succeeded nodes and re-run only failed/empty/unfinished nodes plus their downstream, `fromNodes: [...]` to re-run from specific node ids/labels, `clearMemory: true` to forget saved `keepSession` child sessions, and `maxParallel` (1–8) to adjust concurrency.
|
|
56
|
+
2. You may pass `task` to override the entry Lead's task (handy when reusing a preset), `reset: true` to discard a paused run and start from scratch, `cancel: true` to cleanly terminate an active or paused (`need-lead`) run, `retryFailed: true` to reuse succeeded nodes and re-run only failed/empty/unfinished nodes plus their downstream, `fromNodes: [...]` to re-run from specific node ids/labels, `clearMemory: true` to forget saved `keepSession` child sessions, and `maxParallel` (1–8) to adjust concurrency.
|
|
56
57
|
3. Chained Lead nodes with **both** zero subagent upstream **and** an empty `role` — as well as dangling dead-end subagents (zero outgoing edges while an active downstream Lead exists) — are rendered dashed on the canvas and skipped at run time. Chained `Lead → Lead` stages with a non-empty `role` (or Lead + Subagent → Lead) are valid and active.
|
|
57
58
|
4. Subagent capability (`preset: standard | minimal`) narrows the toolset within the main chat's permission ceiling; it cannot elevate past the parent session's sandbox/approval mode.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
5. Subagent nodes run in a dynamic concurrency pool of up to four: as soon as any node finishes, newly unblocked downstream subagents start immediately without waiting for slower siblings.
|
|
60
|
+
6. Intermediate downstream Lead nodes pause the run (`status: "need-lead"`). Complete that Lead step yourself, then call `canvas_workflow` again with `leadResult` to resume downstream nodes — do not spawn an agent for it. If the user asks to cancel/abort instead, call `canvas_workflow({ cancel: true })`.
|
|
61
|
+
7. A **terminal** Lead node (zero remaining downstream nodes) finishes directly with `status: "done"` and `finalLead`: complete the review/summary and reply directly to the user — no extra `canvas_workflow` callback is needed.
|
|
62
|
+
8. When a `session-ref` link points into that Lead node the result lists `sessions: [{ label, childId }]`; you may message those agents directly to follow up.
|
|
63
|
+
9. Only assign image/visual inspection roles to models that declare image input support.
|
|
63
64
|
|
|
64
65
|
## Failures & verification iron rule
|
|
65
66
|
|