Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/1438-workflow-ui-unify.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Settings → Workflow graphs** is now canvas-first with a per-node inspector panel. Select a node to edit its system prompt, role, and tools — no more wall of textareas. **Workflow stage chat** reuses the normal FlyBot conversation UI (same message bubbles and spacing as Bot/group chats), replacing the previous pipeline-log card style. **Sidebar Workflows list, Hand-a-task modal, and flowchart drawer** now show visual mini-flowcharts instead of text chains like "Planner → Writer → Coder", with a unified visual language across all surfaces. **Hand-a-task modal** overflow fixed: content scrolls, Cancel/Confirm footer is sticky and always visible. **Flowchart drawer** defaults to showing the graph collapsed; system prompts expand only when a node is selected. **Workflow runs** now advance only along graph edges when ephemeral Bots finish — no timer-based demo-step bypass for live runs. The `workflow/demo-step` endpoint remains for replaying canned demos only and refuses while a live run exists.
4 changes: 4 additions & 0 deletions core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ var ZH = {
"Could not open this workflow": "打不开这个工作流",
"This definition cannot be saved": "这个定义不能保存",
"This definition cannot be copied": "这个定义不能复制",
"Select a node to edit": "选择一个节点来编辑",
"Node settings": "节点设置",
Tools: "工具",
"Inputs and outputs": "输入和输出",
"{count} card(s) name a node this workflow draws no column for.": "有 {count} 张卡指向这个工作流不画列的节点。",
// Shared
"Main Bot": "主 Bot",
Expand Down
4 changes: 4 additions & 0 deletions core/src/client/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ const ZH = {
'Could not open this workflow': '打不开这个工作流',
'This definition cannot be saved': '这个定义不能保存',
'This definition cannot be copied': '这个定义不能复制',
'Select a node to edit': '选择一个节点来编辑',
'Node settings': '节点设置',
Tools: '工具',
'Inputs and outputs': '输入和输出',
'{count} card(s) name a node this workflow draws no column for.': '有 {count} 张卡指向这个工作流不画列的节点。',
// Shared
'Main Bot': '主 Bot',
Expand Down
6 changes: 3 additions & 3 deletions docs/subsystems/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Everything in `plugins/workflow/`: the graph rules, the run store, the matcher,
| `plugins/workflow/src/match.js` | Which open card matches a Workflow or a local Bot. |
| `plugins/workflow/src/template.js` | 发布交付流水线 (a parallel branch) and the weekly report, each node with the inputs and outputs that edge carries. |
| `plugins/workflow/src/narrate.js` | Progress lines for a step. A live run quotes the Bot reply. The canned delivery copy is the demo player only. A join line is only for a rank of more than one node. |
| `plugins/workflow/client.js` | Sidebar section, chat stage, assign dialog, flowchart editor, and Settings → Workflow graphs. The product UI starts only live runs (assign, ingest, composer); it does not call `workflow/demo-step`. The stage shows the queue and refreshes state while one is active. The stage and the dialogs portal onto `document.body`; a missing container stays in the section tree. |
| `plugins/workflow/client.js` | Sidebar section (with mini-flowcharts), chat stage (normal conversation UI), assign dialog (scrollable with sticky footer), flowchart drawer (collapsed by default, per-node inspector), and Settings → Workflow graphs (canvas-first with inspector panel). The product UI starts only live runs (assign, ingest, composer); it does not call `workflow/demo-step`. The stage shows the queue and refreshes state while one is active. Visual flowcharts replace text chains across all surfaces. The stage and dialogs portal onto `document.body`; a missing container stays in the section tree. |

## Entry points

Expand All @@ -46,7 +46,7 @@ Everything in `plugins/workflow/`: the graph rules, the run store, the matcher,

1. Friends' Bots are not nodes. A `remote` Bot is refused by create, define and the matcher.
2. The canvas and the run share one graph: nodes, edges and positions. A drag commits `workflow/graph`. Status highlighting reads that same graph. Replacing edges does not recompute who is already running.
3. A live run advances only when its ephemeral Bot replies, and that reply is the chat line. `workflow/demo-step` exists for unit tests and scripted fixtures only; the browser client does not call it. A run does not create a schedule. `scheduleLabel` is display text. When the host can create Bots, starting a live run (`assign`, `run_workflow`, `ingest`) spawns one ephemeral Bot per node from that node's prompt, role, model and tools, sends it the step from the Main Bot, and removes every instance when the run finishes, fails for good, or is reset. A `failOnce` retry keeps them. They are hidden and left out of the sidebar. Loading the plugin does not spawn Bots for the seeded fixture. Loading is also the one moment a run the host left behind is noticed: a run still marked `running` is abandoned, so loading releases its instances and records the run as `failed`. Nothing resumes it. A run that already ended keeps its own status (#1388). A dispatch that does not land is not marked handed. The chat names the code, and the next hand-off tries that node again. It is not sent twice in the same hand-off. A reply that says `could not answer your message` or `model call failed` fails that node and does not start its successor. A 429 or rate-limit mention in any other reply does not.
3. **A live run advances only when its ephemeral Bot replies, following the graph's edges in order.** That reply is the chat line. Nodes start only when their forward predecessors finish and edges reach them. `workflow/demo-step` exists for unit tests and scripted fixtures only; the browser client does not call it. A run does not create a schedule. `scheduleLabel` is display text. When the host can create Bots, starting a live run (`assign`, `run_workflow`, `ingest`) spawns one ephemeral Bot per node from that node's prompt, role, model and tools, sends it the step from the Main Bot, and removes every instance when the run finishes, fails for good, or is reset. A `failOnce` retry keeps them. They are hidden and left out of the sidebar. Loading the plugin does not spawn Bots for the seeded fixture. Loading is also the one moment a run the host left behind is noticed: a run still marked `running` is abandoned, so loading releases its instances and records the run as `failed`. Nothing resumes it. A run that already ended keeps its own status (#1388). A dispatch that does not land is not marked handed. The chat names the code, and the next hand-off tries that node again. It is not sent twice in the same hand-off. A reply that says `could not answer your message` or `model call failed` fails that node and does not start its successor. A 429 or rate-limit mention in any other reply does not.
4. Each workflow keeps a FIFO queue and up to `maxConcurrent` live runs (default 2, an integer from 1 to 8 on the record or via `workflow/concurrency`). The host runs at most 6 live runs at once. A task that does not fit is enqueued. When a run finishes, every workflow with a free slot is drained, oldest enqueue first, until the host cap. A new assign on a workflow that already has a queue waits behind it. A task does not replace a running run or release that run's Bots. An old store run is a demo unless it is still `running` and has ephemeral Bot ids. History records a finished or failed run only. Lowering the cap does not stop a run that has already started. Assigning `{ botId }` claims the card for that local Bot and does not enqueue. A remote Bot is refused.
5. A node declares up to eight inputs and eight outputs. A required input is an output of the same name on an ancestor, or `task`, `title`, or `brief` on a root. A start with no provider is refused, and Bots spawned for that attempt are released. On a Bot-backed run a successor stays queued until its required inputs are present. If every forward predecessor is done, failed or skipped and an input is still missing, that node fails and the run stops. The dispatch text carries `Input <name>: <value>`. The Bot reports `OUTPUT <name>: <value>`; a single declared output may be the reply body. Nodes start in edge order.
6. Each node is a real ephemeral Bot for that run, then it is removed. A permanent sidebar Bot (`botId`) is optional and is not required for the step to run. `tools` on the node is what that Bot may use: `github` grants `mcp__github__*` (pull requests, reviews, comments); `bash` or `shell` sets the permission to `danger-full-access` and allows a full-access shell; any other step gets `workspace-write`. A hidden run Bot cannot show an approval card, so a granted tool is allowed and a connector it did not name is refused. The host stores this on the run Bot as `stepTools` and `permission`.
Expand All @@ -55,7 +55,7 @@ Everything in `plugins/workflow/`: the graph rules, the run store, the matcher,
9. The browser draws text only. Names and messages are React text children. The unit renderer asserts a hostile name is not markup.
10. `enabled: false` registers no endpoint, tool or listener and writes nothing.
11. A sidebar click opens the stage or a dialog and leaves the Workflows section in place. The stage and the dialogs portal onto `document.body`. When that container is missing they stay in the section tree; the click does not throw.
12. A node's prompt and the graph are one record. Settings → Workflow graphs, the flowchart's prompt fields, and `define_workflow` all write `workflow/graph`. A run reads that record; it does not define it. After a live run finishes, the stage shows `lane.last` for that workflow until a new live run starts. Seeded fixture scripts stay in `state.demos` for tests; the product UI does not step them.
12. A node's prompt and the graph are one record. Settings → Workflow graphs (canvas-first with per-node inspector), the flowchart drawer (collapsed by default, inspector on select), and `define_workflow` all write `workflow/graph`. A run reads that record; it does not define it. After a live run finishes, the stage shows `lane.last` for that workflow until a new live run starts. Seeded fixture scripts stay in `state.demos` for tests; the product UI does not step them.

## Tests

Expand Down
6 changes: 5 additions & 1 deletion patches/ds-bot/0001-core-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ diff --git a/src/client/feedback.js b/src/client/feedback.js
diff --git a/src/client/i18n.js b/src/client/i18n.js
--- a/src/client/i18n.js
+++ b/src/client/i18n.js
@@ -5,6 +5,55 @@
@@ -5,6 +5,59 @@
export const NAMESPACE = 'ds-bot'

const ZH = {
Expand Down Expand Up @@ -630,6 +630,10 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js
+ 'Could not open this workflow': '打不开这个工作流',
+ 'This definition cannot be saved': '这个定义不能保存',
+ 'This definition cannot be copied': '这个定义不能复制',
+ 'Select a node to edit': '选择一个节点来编辑',
+ 'Node settings': '节点设置',
+ Tools: '工具',
+ 'Inputs and outputs': '输入和输出',
+ '{count} card(s) name a node this workflow draws no column for.': '有 {count} 张卡指向这个工作流不画列的节点。',
// Shared
'Main Bot': '主 Bot',
Expand Down
6 changes: 5 additions & 1 deletion patches/ds-bot/0008-client-bundle.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FlyBot patch 0008-client-bundle on Fei2411/DeepSeek-Bot@2b10c70 (ds-bot/). Gener
diff --git a/client.js b/client.js
--- a/client.js
+++ b/client.js
@@ -42,6 +42,52 @@ module.exports = __toCommonJS(index_exports);
@@ -42,6 +42,56 @@ module.exports = __toCommonJS(index_exports);
// src/client/i18n.js
var NAMESPACE = "ds-bot";
var ZH = {
Expand Down Expand Up @@ -52,6 +52,10 @@ diff --git a/client.js b/client.js
+ "Could not open this workflow": "打不开这个工作流",
+ "This definition cannot be saved": "这个定义不能保存",
+ "This definition cannot be copied": "这个定义不能复制",
+ "Select a node to edit": "选择一个节点来编辑",
+ "Node settings": "节点设置",
+ Tools: "工具",
+ "Inputs and outputs": "输入和输出",
+ "{count} card(s) name a node this workflow draws no column for.": "有 {count} 张卡指向这个工作流不画列的节点。",
// Shared
"Main Bot": "主 Bot",
Expand Down
Loading
Loading