From 540e56e81f45169030dd0965c22710f6ca645b2e Mon Sep 17 00:00:00 2001 From: stevenjj33 <75509501+stevenjj33@users.noreply.github.com> Date: Sat, 24 Oct 2026 21:51:27 +0800 Subject: [PATCH] workflow-console: address the review suggestions on #64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three follow-ups, one per suggestion. Drop the restatement of the Host's Git-import rule from both READMEs. The rule belongs to the Host and can change under us; a README that repeats it goes stale, and this package does not need to carry it. What the Skill is for — telling the Agent how to drive the console — stays. Say which database "the run record stays in" means: the bundled engine's own `workflows.sqlite` under `context.dataDir/engine/`, in both READMEs and in SKILL.md, so it cannot be mistaken for some other store. Add a `test` script to package.json, so `npm test` in this directory runs the suite instead of reporting a missing script. The command matches the one other plugin in this repository that ships a test script (`node --test "tests/*.test.mjs"`), and the READMEs now lead with it. --- plugins/stevenjj33/workflow-console/README.md | 12 +++++++----- plugins/stevenjj33/workflow-console/README.zh-CN.md | 9 +++++---- plugins/stevenjj33/workflow-console/package.json | 3 +++ .../skills/workflow-console/SKILL.md | 3 ++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/plugins/stevenjj33/workflow-console/README.md b/plugins/stevenjj33/workflow-console/README.md index 59e22bed..c496448a 100644 --- a/plugins/stevenjj33/workflow-console/README.md +++ b/plugins/stevenjj33/workflow-console/README.md @@ -95,9 +95,7 @@ anything, and that the `demo` executor calls no model. It also tells the Agent n 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. +reads it. ## Tested environment @@ -136,7 +134,8 @@ Written — always under `context.dataDir`, never elsewhere: - `workspace.json` — the working directory the embedded engine is bound to. - `hidden-runs.json` — the list of runs hidden locally. Hiding is not deletion; the run record - stays in the engine's database and can be restored. + stays in the bundled engine's own database — `workflows.sqlite` under `context.dataDir/engine/` — + and can be restored. - `engine/` — `address.json`, `endpoint.json`, `service.log`, and `workflows.sqlite`, written by the embedded engine. @@ -202,9 +201,12 @@ The tests use Node's built-in test runner and start an isolated console instance directory, so they never touch a real project: ```bash -node --test "tests/*.test.mjs" +npm test ``` +`npm test` runs `node --test "tests/*.test.mjs"` in this directory; the same command works +without npm. + `tests/workspace-resolution.test.mjs` covers working-directory resolution: the Host's temporary deployment directory and other implausible paths are rejected, the home directory is never used as a fallback, and the engine does not start until a project directory is known. diff --git a/plugins/stevenjj33/workflow-console/README.zh-CN.md b/plugins/stevenjj33/workflow-console/README.zh-CN.md index 606b7b78..bb7d95e1 100644 --- a/plugins/stevenjj33/workflow-console/README.zh-CN.md +++ b/plugins/stevenjj33/workflow-console/README.zh-CN.md @@ -76,8 +76,6 @@ Apache-2.0)。 `demo` 执行器不调模型。也明确要求 Agent 不要替用户猜工作目录,也不要在用户没点头时替他批准运行。 这个 Skill 是宿主注册本插件时加载的,控制台进程自己不会读它。 -它同时也是本包**能通过「从 Git 仓库导入」装上**的原因:宿主只在包里声明了 Skill、MCP Server 或 -Hook 时才接受 Git 导入,光有一个 Mini App 不算。 ## 测试环境 @@ -107,7 +105,8 @@ Hook 时才接受 Git 导入,光有一个 Mini App 不算。 一律写在 `context.dataDir` 下,绝不写到别处: - `workspace.json` —— 内置引擎绑定的工作目录; -- `hidden-runs.json` —— 本地隐藏的运行列表。隐藏不是删除,记录仍在引擎数据库里,可恢复; +- `hidden-runs.json` —— 本地隐藏的运行列表。隐藏不是删除,记录仍在**内置引擎自己的数据库**里 + (`context.dataDir/engine/` 下的 `workflows.sqlite`),可恢复; - `engine/` —— `address.json`、`endpoint.json`、`service.log`、`workflows.sqlite`,由内置引擎写入。 ### 网络 @@ -167,9 +166,11 @@ icon.png 插件图标 测试用 Node 自带的测试运行器,在沙箱主目录里起一个隔离的控制台实例,不会碰任何真实项目: ```bash -node --test "tests/*.test.mjs" +npm test ``` +`npm test` 就是在本目录跑 `node --test "tests/*.test.mjs"`,不用 npm 直接敲那条命令也一样。 + `tests/workspace-resolution.test.mjs` 覆盖工作目录解析:宿主那个临时投放目录和其它不可信路径会被拒掉, 用户主目录绝不会被当成兜底,没选定项目目录之前引擎不会启动。 `tests/engine-isolation.test.mjs` 造一份别的插件的服务登记簿——指向一个会计账的本地服务—— diff --git a/plugins/stevenjj33/workflow-console/package.json b/plugins/stevenjj33/workflow-console/package.json index aab6b8dc..aa3c62f8 100644 --- a/plugins/stevenjj33/workflow-console/package.json +++ b/plugins/stevenjj33/workflow-console/package.json @@ -2,5 +2,8 @@ "mcode": { "schemaVersion": 2, "miniApp": "./miniapp/miniapp.json" + }, + "scripts": { + "test": "node --test \"tests/*.test.mjs\"" } } diff --git a/plugins/stevenjj33/workflow-console/skills/workflow-console/SKILL.md b/plugins/stevenjj33/workflow-console/skills/workflow-console/SKILL.md index 375b484c..9d57d359 100644 --- a/plugins/stevenjj33/workflow-console/skills/workflow-console/SKILL.md +++ b/plugins/stevenjj33/workflow-console/skills/workflow-console/SKILL.md @@ -79,7 +79,8 @@ description: "运行、查看与管控 MiniMax Code 动态工作流(多 Agent - 引擎只监听 `127.0.0.1`,控制台只代理到它:不连外网,也不连别的本地服务。 - 状态文件全在 `context.dataDir`:`workspace.json`、`hidden-runs.json`、`engine/`。 - 引擎在项目目录里工作,真实执行会读写那个目录。 -- 隐藏某个运行只是本地隐藏,不是删除;运行记录还在引擎数据库里,可以恢复。 +- 隐藏某个运行只是本地隐藏,不是删除;运行记录还在内置引擎自己的数据库里 + (`context.dataDir/engine/` 下的 `workflows.sqlite`),可以恢复。 ## 不要做的事