@zzp123/mcp-zentao 1.18.10 → 1.18.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-pm.js +80 -0
- package/dist/roleConfig.js +6 -2
- package/package.json +1 -1
- package/scripts/generate-role-versions.cjs +5 -1
package/dist/index-pm.js
CHANGED
|
@@ -270,6 +270,86 @@ server.tool("deleteStory", "删除需求 - 支持软件需求(story)和用户需
|
|
|
270
270
|
throw new Error("Please initialize Zentao API first");
|
|
271
271
|
return { content: [{ type: "text", text: JSON.stringify(await zentaoApi.deleteStory(storyId), null, 2) }] };
|
|
272
272
|
});
|
|
273
|
+
server.tool("getMyProfile", {}, async () => {
|
|
274
|
+
if (!zentaoApi)
|
|
275
|
+
throw new Error("Please initialize Zentao API first");
|
|
276
|
+
return { content: [{ type: "text", text: JSON.stringify(await zentaoApi.getMyProfile(), null, 2) }] };
|
|
277
|
+
});
|
|
278
|
+
server.tool("getUsers", {
|
|
279
|
+
page: z.number().optional(),
|
|
280
|
+
limit: z.number().optional()
|
|
281
|
+
}, async (params) => {
|
|
282
|
+
if (!zentaoApi)
|
|
283
|
+
throw new Error("Please initialize Zentao API first");
|
|
284
|
+
return { content: [{ type: "text", text: JSON.stringify(await zentaoApi.getUsers(params), null, 2) }] };
|
|
285
|
+
});
|
|
286
|
+
server.tool("getComments", "获取评论列表 - 获取指定对象的所有评论", {
|
|
287
|
+
objectType: z.enum([
|
|
288
|
+
'story', // 软件需求
|
|
289
|
+
'requirement', // 用户需求
|
|
290
|
+
'task', // 任务
|
|
291
|
+
'bug', // Bug
|
|
292
|
+
'testcase', // 测试用例
|
|
293
|
+
'testtask', // 测试单
|
|
294
|
+
'todo', // 待办
|
|
295
|
+
'doc', // 文档
|
|
296
|
+
'execution', // 执行/迭代
|
|
297
|
+
'project', // 项目
|
|
298
|
+
'doctemplate' // 文档模板
|
|
299
|
+
]).describe("对象类型"),
|
|
300
|
+
objectID: z.number().describe("对象ID")
|
|
301
|
+
}, async ({ objectType, objectID }) => {
|
|
302
|
+
if (!zentaoApi)
|
|
303
|
+
throw new Error("Please initialize Zentao API first");
|
|
304
|
+
const comments = await zentaoApi.getComments(objectType, objectID);
|
|
305
|
+
return {
|
|
306
|
+
content: [{
|
|
307
|
+
type: "text",
|
|
308
|
+
text: JSON.stringify({
|
|
309
|
+
total: comments.length,
|
|
310
|
+
objectType,
|
|
311
|
+
objectID,
|
|
312
|
+
comments
|
|
313
|
+
}, null, 2)
|
|
314
|
+
}]
|
|
315
|
+
};
|
|
316
|
+
});
|
|
317
|
+
server.tool("addComment", "添加评论 - 为需求、任务、Bug等对象添加评论", {
|
|
318
|
+
objectType: z.enum([
|
|
319
|
+
'story', // 软件需求
|
|
320
|
+
'requirement', // 用户需求
|
|
321
|
+
'task', // 任务
|
|
322
|
+
'bug', // Bug
|
|
323
|
+
'testcase', // 测试用例
|
|
324
|
+
'testtask', // 测试单
|
|
325
|
+
'todo', // 待办
|
|
326
|
+
'doc', // 文档
|
|
327
|
+
'execution', // 执行/迭代
|
|
328
|
+
'project', // 项目
|
|
329
|
+
'doctemplate' // 文档模板
|
|
330
|
+
]).describe("对象类型"),
|
|
331
|
+
objectID: z.number().describe("对象ID"),
|
|
332
|
+
comment: z.string().describe("评论内容,支持HTML格式"),
|
|
333
|
+
uid: z.string().optional().describe("唯一标识符(可选)")
|
|
334
|
+
}, async ({ objectType, objectID, comment, uid }) => {
|
|
335
|
+
if (!zentaoApi)
|
|
336
|
+
throw new Error("Please initialize Zentao API first");
|
|
337
|
+
const result = await zentaoApi.addComment({
|
|
338
|
+
objectType,
|
|
339
|
+
objectID,
|
|
340
|
+
comment,
|
|
341
|
+
uid
|
|
342
|
+
});
|
|
343
|
+
return {
|
|
344
|
+
content: [{
|
|
345
|
+
type: "text",
|
|
346
|
+
text: JSON.stringify({
|
|
347
|
+
message: '评论添加成功',
|
|
348
|
+
comment: result
|
|
349
|
+
}, null, 2)
|
|
350
|
+
}]
|
|
351
|
+
};
|
|
352
|
+
});
|
|
273
353
|
await startServerTransport(server, { args }).catch(err => {
|
|
274
354
|
process.stderr.write('[FATAL] MCP server failed: ' + String(err) + '\n');
|
|
275
355
|
process.exit(1);
|
package/dist/roleConfig.js
CHANGED
|
@@ -82,7 +82,7 @@ export const TOOL_CATEGORIES = {
|
|
|
82
82
|
};
|
|
83
83
|
// 角色权限配置
|
|
84
84
|
export const ROLE_PERMISSIONS = {
|
|
85
|
-
//
|
|
85
|
+
// 产品经理:初始化+项目+需求+执行+计划+评论+用户
|
|
86
86
|
pm: [
|
|
87
87
|
'initZentao',
|
|
88
88
|
'getProjects',
|
|
@@ -95,7 +95,11 @@ export const ROLE_PERMISSIONS = {
|
|
|
95
95
|
'linkStoriesToPlan',
|
|
96
96
|
'createExecution',
|
|
97
97
|
'deleteExecution',
|
|
98
|
-
'deletePlan'
|
|
98
|
+
'deletePlan',
|
|
99
|
+
'getComments',
|
|
100
|
+
'addComment',
|
|
101
|
+
'getUsers',
|
|
102
|
+
'getMyProfile'
|
|
99
103
|
],
|
|
100
104
|
// 测试工程师:初始化+缺陷与用例
|
|
101
105
|
qa: [
|
package/package.json
CHANGED
|
@@ -38,7 +38,11 @@ const ROLE_PERMISSIONS = {
|
|
|
38
38
|
'linkStoriesToPlan', // 产品计划关联需求
|
|
39
39
|
'createExecution', // 创建执行
|
|
40
40
|
'deleteExecution', // 删除执行
|
|
41
|
-
'deletePlan' // 删除产品计划
|
|
41
|
+
'deletePlan', // 删除产品计划
|
|
42
|
+
'getComments', // 查看评论
|
|
43
|
+
'addComment', // 添加评论
|
|
44
|
+
'getUsers', // 获取用户列表
|
|
45
|
+
'getMyProfile' // 获取我的个人信息
|
|
42
46
|
],
|
|
43
47
|
qa: [
|
|
44
48
|
...TOOL_CATEGORIES.init,
|