保留工作流节点开通测试环境选项

- 增加可选 --is-test 配置并路由到测试 Piper
- 默认仍使用标准 Piper,dry-run 与结果显示所选环境
- 更新命令帮助、Skill 与接口目录
This commit is contained in:
gitea committed 2026-11-05 12:10:00 +08:00
1 parent e562ae9227
commit e58841e164
13 files changed
+56 -13

No files matched your search

@@ -12,7 +12,12 @@ test("node grant previews without a gateway call and requires explicit confirmat
expect(JSON.parse(result.stdout).dryRun).toBe(true);
expect(JSON.parse(result.stdout).changes.nodes).toEqual(["code-js2"]);
expect(grant).not.toHaveBeenCalled();
const testPreview = await handleWorkflowCommand(parseArgs(["workflow", "nodes", "grant", "code", "--is-test", "--dry-run", "--yes"]), runtime);
expect(JSON.parse(testPreview.stdout).changes.isTest).toBe(true);
expect(grant).not.toHaveBeenCalled();
await handleWorkflowCommand(parseArgs(["workflow", "nodes", "grant", "code-js2", "--confirm"]), runtime);
expect(grant).toHaveBeenCalledTimes(1);
await handleWorkflowCommand(parseArgs(["workflow", "nodes", "grant", "code", "--is-test", "--yes"]), runtime);
expect(grant).toHaveBeenLastCalledWith(expect.anything(), expect.objectContaining({ nodes: ["code"], isTest: true }));
} finally { grant.mockRestore(); }
});