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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": 1,
"name": "workflow-console",
"displayName": "Dynamic Workflow Console / 动态工作流控制台",
"version": "1.1.0",
"version": "1.2.0",
"description": "Run and supervise MiniMax Code dynamic workflows from one page: live status, a stage-and-dependency flow graph, per-node output, approval and control, templates, and report export. 自带的动态工作流监控与控制台:内置 Workflow Studio 引擎,无需安装插件即可运行。提供运行列表、实时日志、拓扑与节点结果、审核后开始执行、暂停取消恢复、模板保存与复用、报告导出。",
"author": "书先生 (stevenjj33)",
"icon": "icon.png",
Expand All @@ -13,5 +13,7 @@
],
"apps": [],
"mcpServers": [],
"skills": []
"skills": [
"skills/workflow-console/SKILL.md"
]
}
38 changes: 33 additions & 5 deletions plugins/stevenjj33/workflow-console/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Dynamic Workflow Console (`workflow-console`)

[简体中文](README.zh-CN.md) | English

> **中文速览**:一个把 MiniMax Code 动态工作流跑起来、盯住、看清的 Mini App。内置 Workflow Studio
> 引擎,**无需另装插件即可运行**:运行列表、实时事件流、按阶段与依赖画出的流程图、每个节点的输出、
> 审核后开始执行、暂停 / 取消 / 恢复、模板保存与复用、报告导出。引擎启动前必须先选定项目目录,
> 它不会替你猜。完整中文说明见 [README.zh-CN.md](README.zh-CN.md)。

A Mini App that runs, supervises, and inspects MiniMax Code dynamic workflows from one page.

It embeds the `mcode-dynamic-workflows` runtime, so it works on a machine where that plugin was
Expand All @@ -8,7 +15,10 @@ project directory, and shows every run of that project: status, live event log,
flow graph, per-node output, and the final report. Runs can be approved, started, paused, cancelled,
resumed, exported to Markdown or HTML, saved as a template, and restored from a template.

The user interface is in Chinese.
The user interface is in Chinese, so this README quotes the page's own wording. The terms you will
meet on screen are: 「工作目录」 (Working directory), 「待审核」 (pending review), 「开始执行」 (start),
「内置引擎」 (the bundled engine), 「还没有选择项目目录」 (no project directory chosen yet), and
「审核版本已更新,请刷新后再开始执行」 (the reviewed version changed, refresh and start again).

## Based on which project

Expand Down Expand Up @@ -62,18 +72,33 @@ The console needs to know which project the engine should work in, and it will *

- If the Host declares the current project through an environment variable
(`MCODE_WORKSPACE`, `MCODE_PROJECT_DIR`, `PROJECT_DIR`, `WORKSPACE`), that directory is used.
- Otherwise the console uses the directory you typed in the always-visible **Working directory** bar
at the top of the page, remembered under `context.dataDir`.
- Otherwise the console uses the directory you typed in the always-visible **Working directory**
(「工作目录」) bar at the top of the page, remembered under `context.dataDir`.
- If neither is available, **the engine does not start at all** and the page asks for an absolute
project path. It never falls back to your home directory — a run started there could act on your
whole home folder — and it never uses the Host's temporary deployment directory.
project path; the empty state reads 「还没有选择项目目录」 (no project directory chosen yet). It
never falls back to your home directory — a run started there could act on your whole home
folder — and it never uses the Host's temporary deployment directory.

Saving the bar restarts the embedded engine against the new directory; run history is kept in the
engine's own database and is not affected by the change.

Running real workflows still requires a working `mcode` CLI: the engine orchestrates agents through
it. The demo executor works without it.

## Skill

The package ships one Skill, `skills/workflow-console/SKILL.md`. It tells the Agent how to drive
this console: that a project directory must be chosen before the engine can start, that a run sits
in `pending_review` (「待审核」) until it is approved, what "approve" (「开始执行」), "pause",
"cancel" and "resume" mean, that reusing a template creates a new draft rather than running
anything, and that the `demo` executor calls no model. It also tells the Agent not to pick a
working directory on the user's behalf and not to approve a run without the user's say-so.

The Skill is what the Host loads when it registers this plugin; the console process itself never
reads it. It is also what makes the package importable through **"Import from a Git repository"**:
the Host accepts a Git import only when the package declares at least one Skill, MCP server, or
hook, and a Mini App on its own does not count.

## Tested environment

- MiniMax Code 3.1.4 on Windows 11, Node.js 22 and 26. Installed from this directory, opened
Expand All @@ -96,6 +121,8 @@ this app.
Read:

- `miniapp/client/` and `miniapp/node/vendor/` — this package's own assets.
- `skills/workflow-console/SKILL.md` — read by the Host when it registers this plugin, not by the
console process.
- The project directory it is bound to — the engine runs with it as its working directory, and the
`mcode` CLI it launches reads and writes inside it.

Expand Down Expand Up @@ -153,6 +180,7 @@ in browser storage.
```text
.minimax-plugin/plugin.json Plugin manifest
package.json Mini App declaration
skills/workflow-console/SKILL.md Skill the Agent loads to drive this console
miniapp/miniapp.json Payload roots, Node entry, page route
miniapp/client/index.html The page served at /dashboard
miniapp/client/app.js Front end (plain HTML/CSS/JS, no framework, no build)
Expand Down
13 changes: 13 additions & 0 deletions plugins/stevenjj33/workflow-console/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ Apache-2.0)。

跑真实工作流仍然需要本机 `mcode` CLI 可用:引擎通过它去编排 Agent。demo 执行器不需要。

## Skill

本包附带一个 Skill:`skills/workflow-console/SKILL.md`。它告诉 Agent 怎么用这个控制台——
引擎启动前必须先选定项目目录、运行在 `pending_review` 状态要等审核、
「审核通过 / 暂停 / 取消 / 恢复」各自意味着什么、复用模板只是新建草稿而不是开始执行、
`demo` 执行器不调模型。也明确要求 Agent 不要替用户猜工作目录,也不要在用户没点头时替他批准运行。

这个 Skill 是宿主注册本插件时加载的,控制台进程自己不会读它。
它同时也是本包**能通过「从 Git 仓库导入」装上**的原因:宿主只在包里声明了 Skill、MCP Server 或
Hook 时才接受 Git 导入,光有一个 Mini App 不算。

## 测试环境

- MiniMax Code 3.1.4 + Windows 11,Node.js 22 与 26。从本目录安装,经 Agent 打开,页面渲染正常,
Expand All @@ -84,6 +95,7 @@ Apache-2.0)。
### 读取的文件

- `miniapp/client/` 与 `miniapp/node/vendor/` —— 本包自己的资源。
- `skills/workflow-console/SKILL.md` —— 宿主注册本插件时读取,控制台进程自己不读。
- 它绑定的那个项目目录 —— 引擎以它为工作目录运行,被它拉起的 `mcode` CLI 在其中读写文件。

本包**不读**自己包目录与项目目录之外的任何文件。特别是**不读**
Expand Down Expand Up @@ -134,6 +146,7 @@ argv 元素传入,不会拼进命令行。应用退出时整棵进程树会被
```text
.minimax-plugin/plugin.json 插件清单
package.json Mini App 声明
skills/workflow-console/SKILL.md Agent 用来操作本控制台的 Skill
miniapp/miniapp.json 运行时根目录、Node 入口、页面路由
miniapp/client/index.html /dashboard 上提供的页面
miniapp/client/app.js 前端(原生 HTML/CSS/JS,无框架无构建)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
name: workflow-console
description: "运行、查看与管控 MiniMax Code 动态工作流(多 Agent 编排)。当用户要发起工作流、查运行进度与节点输出、要审核后开始执行、要暂停/取消/恢复运行、要复用模板或导出工作流报告时使用。Triggers:动态工作流、工作流控制台、Workflow Studio、dynamic workflow、工作流运行、多 Agent 编排、工作流报告。"
---

# 动态工作流控制台

`workflow-console` 是一个 Mini App:把 MiniMax Code 的动态工作流(多 Agent 编排)放进一个页面里——
运行列表、实时事件流、按阶段与依赖画出的流程图、每个节点的输出、审核与控制、模板、报告导出。

它**自带** Workflow Studio 引擎,不需要另外安装 `mcode-dynamic-workflows` 插件。

用 Mini App 工具打开插件 `workflow-console`(页面路由 `/dashboard`)。界面是中文的。

## 第一件事:确认项目目录,不要猜

控制台**不会**替用户挑工作目录。没有项目目录,引擎根本不启动,页面会显示「还没有选择项目目录」。

解析顺序是服务端固定的,别自己另发明一套:

1. 宿主声明的当前项目——`MCODE_WORKSPACE` / `MCODE_PROJECT_DIR` / `PROJECT_DIR` / `WORKSPACE` 环境变量。
2. 用户在页面顶部「工作目录」栏里填的绝对路径(记在 `context.dataDir` 的 `workspace.json`)。
3. 都没有 → 引擎不启动,页面要一个绝对路径。

要做的:

- 页面报「还没有选择项目目录」→ **问用户**要哪个项目的绝对路径,不要从当前会话随手推断一个。
- **家目录和宿主投放目录一律不行**,服务端直接拒绝(400)。理由很实在:一次运行就能改写整个家目录。
- 换目录会让引擎重启;属于旧目录的运行将无法开始或恢复(上游要求运行与引擎同工作区)。所以别在运行进行中改目录。

## 运行的生命周期

```
待审核(pending_review) ──「开始执行」──> 运行中 ──> 完成 / 失败 / 已取消
```

- 草稿进来就是**待审核**,不会自己跑。
- 「开始执行」=审核+启动,会先弹确认框,然后调度真实 Agent。
- 演示草稿(demo 执行器)不调用模型,只演流程。

**用户点下去之前,你要替他核对**(这一步之后没法收回):

- 拓扑对不对:阶段划分、依赖关系、有没有孤立节点。
- 每个节点要读什么、写什么——引擎在这个目录里跑,`mcode` CLI 会在里面读写文件。
- 执行器是 `demo` 还是 `mcode`。

**除非用户明确说了「直接开始」,否则不要替他点「开始执行」。** 这一步会真的动他的项目目录。

## 控制运行

运行中可暂停、取消、恢复(恢复前要确认之前那个 Agent 确实停了)。

- 报「审核版本已更新,请刷新后再开始执行」=409:审核对象变了,刷新页面重新核对后再审。
- 待审核的草稿可以直接取消(上游支持直接取消草稿)。

## 模板

- 把一次运行存成模板,之后复用。
- **复用模板=新建一份待审核草稿,不是直接执行。** 别把复用说成「已经跑起来了」。

## 报告

运行结束可导出 Markdown / HTML 报告。给用户结论时别把原始事件日志整段贴回去——
挑关键节点输出和最终结论。

## 先 demo,后 mcode

| | demo | mcode |
| --- | --- | --- |
| 调模型 | 否 | 是,调度真实 Agent |
| 前提 | 无 | 机器上有 `mcode` CLI 且已登录 |
| 用途 | 验拓扑、验流程 | 真正干活 |

页面上 `mcodeAvailable: true` 只说明 `mcode` 可执行文件存在,**不代表它登录了或还有额度**。
真实执行失败时先查登录和额度,别直接归因给工作流本身。

## 数据与边界

- 引擎只监听 `127.0.0.1`,控制台只代理到它:不连外网,也不连别的本地服务。
- 状态文件全在 `context.dataDir`:`workspace.json`、`hidden-runs.json`、`engine/`。
- 引擎在项目目录里工作,真实执行会读写那个目录。
- 隐藏某个运行只是本地隐藏,不是删除;运行记录还在引擎数据库里,可以恢复。

## 不要做的事

- 不要替用户猜工作目录。
- 不要把 `demo` 的结果说成真实模型跑出来的。
- 不要在用户没确认时替他批准并开始执行。
- 不要把「复用模板」说成「已执行」。
Loading