feat: 增加 MCP 研究模板保存工具

This commit is contained in:
yuxuanhui
2026-09-11 23:05:01 +08:00
parent 03a66546f3
commit f29063c9a2
13 changed files with 430 additions and 13 deletions
+1
View File
@@ -23,6 +23,7 @@ type TokenPage = {
const scopes = [
["research:read", "读取研究数据", "查询目录、历史、运行与结果"],
["research:refresh", "刷新研究数据", "更新缓存、检查自相关及恢复 WorldQuant 认证"],
["research:write", "保存研究模板", "保存大模型总结的模板及来源,供后续批量回测"],
["backtests:execute", "执行回测", "提交新的回测批次"],
["backtests:control", "控制回测", "暂停、继续、停止与恢复采集"],
] as const;
+9
View File
@@ -57,4 +57,13 @@ test("MCP Key menu creates, hides secrets on navigation, and revokes", async ({
page.getByRole("heading", { name: "MCP Key", exact: true }),
).toBeVisible();
await expect(page.getByLabel("新 Key 明文")).toHaveCount(0);
await page.getByLabel("Key 名称").fill("Browser test template writer");
await page.getByRole("checkbox", { name: /保存研究模板/ }).check();
await page.getByRole("button", { name: "创建 Key", exact: true }).click();
await expect(page.getByLabel("新 Key 明文")).toBeVisible();
const writers = await (await page.request.get("/api/v1/mcp-tokens")).json();
const writer = writers.items.find(
(item: { name: string }) => item.name === "Browser test template writer",
);
expect(writer.scopes).toEqual(["research:read", "research:write"]);
});