dsh-workflow-canvas 1.0.2 → 1.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 +33 -16
- package/README.zh.md +33 -16
- package/client.js +1334 -317
- package/docs/DETAIL.md +21 -10
- package/docs/MECHANISM.md +7 -7
- package/docs/MECHANISM.zh.md +7 -7
- package/docs/images/add-node-shift-a.gif +0 -0
- package/docs/images/canvas-demo-zh.png +0 -0
- package/docs/images/canvas-demo.png +0 -0
- package/docs/images/chat-patch-canvas.gif +0 -0
- package/docs/images/condition-switch-run.gif +0 -0
- package/docs/images/connect-and-cut.gif +0 -0
- package/docs/images/node-condition-en.png +0 -0
- package/docs/images/node-condition-zh.png +0 -0
- package/docs/images/node-config.gif +0 -0
- package/docs/images/node-entry-en.png +0 -0
- package/docs/images/node-entry-zh.png +0 -0
- package/docs/images/node-lead-en.png +0 -0
- package/docs/images/node-lead-zh.png +0 -0
- package/docs/images/node-subagent-en.png +0 -0
- package/docs/images/node-subagent-zh.png +0 -0
- package/docs/images/parallel-and-inspect.gif +0 -0
- package/index.js +738 -78
- package/package.json +1 -1
- package/skills/workflow-canvas/SKILL.md +3 -2
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ A canvas is a DAG of agents the user can see and edit.
|
|
|
12
12
|
- **Entry Lead** (`id: "lead"`, blue top bar) — created automatically by `canvas_generate` to hold the overall `task`. **Do not author a separate entry Lead node** — wire first-wave nodes directly from `from: "lead"`. The entry Lead **never** triggers `need-lead` (it does not pause before Wave 1).
|
|
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.
|
|
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
|
+
- **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.
|
|
15
16
|
|
|
16
17
|
## Which tool to call
|
|
17
18
|
|
|
@@ -26,7 +27,7 @@ Prefer `canvas_patch` for edits: it merges by node id, so renamed, re-roled or r
|
|
|
26
27
|
|
|
27
28
|
## Node fields
|
|
28
29
|
|
|
29
|
-
`id` (stable handle, never reuse it for a different node), `kind` (`lead` or `
|
|
30
|
+
`id` (stable handle, never reuse it for a different node), `kind` (`lead`, `agent`, or `condition`), `label` (display name), `role` (what this step must do, or for `condition` nodes the routing rule), `branches` (optional for `condition` nodes: 2–5 branch names for `switch/case`), `provider` / `model`, `reasoning` (an effort id declared by that model), `preset` (`standard` or `minimal`), `keepSession`, `fallbackModel` / `fallbackProvider`.
|
|
30
31
|
|
|
31
32
|
Fill `role` for every node. A node with an empty role still runs, but it invents its own task and may wander.
|
|
32
33
|
|
|
@@ -45,7 +46,7 @@ Capability (`preset`) is a two-state switch:
|
|
|
45
46
|
| `structured` | blue | a JSON object; the upstream node is asked for structured output automatically, so do not set that by hand |
|
|
46
47
|
| `session-ref` | purple | the upstream child session; the downstream step runs inside it |
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
Output sockets determine link type; every non-entry node has a single universal left input that accepts any incoming channel (`prompt`, `structured`, `session-ref`, or condition branches). Nodes the entry Lead cannot reach are skipped at run time and drawn dashed.
|
|
49
50
|
|
|
50
51
|
## Running
|
|
51
52
|
|