@zzp123/mcp-zentao 1.17.9 → 1.18.0

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.
@@ -33,9 +33,8 @@ export declare class ZentaoAPI {
33
33
  */
34
34
  private filterBugFields;
35
35
  /**
36
- * 获取我的 Bug 列表(默认只查询指派给我的 Bug)
36
+ * 获取我的 Bug 列表(固定查询指派给我的 Bug)
37
37
  *
38
- * @param status Bug状态筛选(默认'assigntome'指派给我的,支持多种状态,详见BugStatus类型)
39
38
  * @param productId 产品ID(可选,默认使用第二个产品)
40
39
  * @param page 页码(从1开始,默认1)
41
40
  * @param limit 每页数量(默认20,最大100)
@@ -44,7 +43,7 @@ export declare class ZentaoAPI {
44
43
  * @param fields 返回字段级别('basic'基本/'default'默认/'full'完整,默认'basic')
45
44
  * @returns Promise<Bug列表及分页信息>
46
45
  */
47
- getMyBugs(status?: BugStatus, productId?: number, page?: number, limit?: number, branch?: string, order?: string, fields?: 'basic' | 'default' | 'full'): Promise<{
46
+ getMyBugs(productId?: number, page?: number, limit?: number, branch?: string, order?: string, fields?: 'basic' | 'default' | 'full'): Promise<{
48
47
  page: number;
49
48
  total: number;
50
49
  limit: number;
@@ -232,9 +232,8 @@ export class ZentaoAPI {
232
232
  };
233
233
  }
234
234
  /**
235
- * 获取我的 Bug 列表(默认只查询指派给我的 Bug)
235
+ * 获取我的 Bug 列表(固定查询指派给我的 Bug)
236
236
  *
237
- * @param status Bug状态筛选(默认'assigntome'指派给我的,支持多种状态,详见BugStatus类型)
238
237
  * @param productId 产品ID(可选,默认使用第二个产品)
239
238
  * @param page 页码(从1开始,默认1)
240
239
  * @param limit 每页数量(默认20,最大100)
@@ -243,7 +242,7 @@ export class ZentaoAPI {
243
242
  * @param fields 返回字段级别('basic'基本/'default'默认/'full'完整,默认'basic')
244
243
  * @returns Promise<Bug列表及分页信息>
245
244
  */
246
- async getMyBugs(status, productId, page, limit, branch, order, fields) {
245
+ async getMyBugs(productId, page, limit, branch, order, fields) {
247
246
  if (!productId) {
248
247
  // 如果没有提供产品ID,获取第二个可用的产品(索引为1)
249
248
  const products = await this.getProducts();
@@ -260,18 +259,16 @@ export class ZentaoAPI {
260
259
  const finalBranch = branch || 'all';
261
260
  const finalOrder = order || 'id_desc';
262
261
  const finalFields = fields || 'basic';
263
- // 默认查询指派给我的 Bug
264
- const finalStatus = status || 'assigntome';
262
+ // 固定查询指派给我的 Bug
263
+ const finalStatus = 'assigntome';
265
264
  // 构建查询参数
266
265
  const queryParams = new URLSearchParams();
267
266
  queryParams.append('branch', finalBranch);
268
267
  queryParams.append('page', finalPage.toString());
269
268
  queryParams.append('limit', finalLimit.toString());
270
269
  queryParams.append('order', finalOrder);
271
- // 添加状态筛选
272
- if (finalStatus !== 'all') {
273
- queryParams.append('status', finalStatus);
274
- }
270
+ // 固定添加状态筛选:只查询指派给我的 Bug
271
+ queryParams.append('status', finalStatus);
275
272
  try {
276
273
  console.log(`正在获取产品 ${productId} 的Bug列表,参数: status=${finalStatus}, branch=${finalBranch}, page=${finalPage}, limit=${finalLimit}, order=${finalOrder}, fields=${finalFields}`);
277
274
  const response = await this.request('GET', `/products/${productId}/bugs?${queryParams.toString()}`);
package/dist/index-dev.js CHANGED
@@ -75,39 +75,17 @@ server.tool("getTaskDetail", {
75
75
  content: [{ type: "text", text: JSON.stringify(task, null, 2) }]
76
76
  };
77
77
  });
78
- server.tool("getMyBugs", "获取我的Bug列表 - 默认只查询指派给我的Bug,支持多种状态筛选和分支筛选", {
79
- status: z.enum([
80
- 'active', // 激活状态
81
- 'resolved', // 已解决
82
- 'closed', // 已关闭
83
- 'all', // 所有状态
84
- 'assigntome', // 指派给我的
85
- 'openedbyme', // 由我创建
86
- 'resolvedbyme', // 由我解决
87
- 'assignedbyme', // 由我指派
88
- 'assigntonull', // 未指派
89
- 'unconfirmed', // 未确认
90
- 'unclosed', // 未关闭
91
- 'unresolved', // 未解决(激活状态)
92
- 'toclosed', // 待关闭(已解决)
93
- 'postponedbugs', // 延期的Bug
94
- 'longlifebugs', // 长期未处理的Bug
95
- 'overduebugs', // 已过期的Bug
96
- 'review', // 待我审核
97
- 'feedback', // 用户反馈
98
- 'needconfirm', // 需求变更需确认
99
- 'bysearch' // 自定义搜索
100
- ]).optional().describe("Bug状态筛选,默认'assigntome'(指派给我的)"),
78
+ server.tool("getMyBugs", "获取我的Bug列表 - 固定查询指派给我的Bug(status='assigntome')", {
101
79
  productId: z.number().optional().describe("产品ID,默认使用第二个产品"),
102
80
  page: z.number().optional().describe("页码,从1开始,默认为1"),
103
81
  limit: z.number().optional().describe("每页数量,默认20,最大100"),
104
82
  branch: z.string().optional().describe("分支筛选:'all'(所有分支,默认)、'0'(主干分支)、分支ID"),
105
83
  order: z.string().optional().describe("排序方式,如 id_desc(ID降序), pri_desc(优先级降序), openedDate_desc(创建时间降序)等,默认id_desc"),
106
84
  fields: z.enum(['basic', 'default', 'full']).optional().describe("返回字段级别:'basic'(基本字段,默认)、'default'(默认字段)、'full'(完整字段),默认'basic'")
107
- }, async ({ status, productId, page, limit, branch, order, fields }) => {
85
+ }, async ({ productId, page, limit, branch, order, fields }) => {
108
86
  if (!zentaoApi)
109
87
  throw new Error("Please initialize Zentao API first");
110
- const result = await zentaoApi.getMyBugs(status, productId, page, limit, branch, order, fields);
88
+ const result = await zentaoApi.getMyBugs(productId, page, limit, branch, order, fields);
111
89
  // 返回分页信息和数据
112
90
  const summary = {
113
91
  summary: `当前第 ${result.page} 页,共 ${result.total} 个Bug,本页显示 ${result.bugs.length} 个`,
package/dist/index-pm.js CHANGED
@@ -85,39 +85,17 @@ server.tool("getProducts", "获取产品列表 - 只返回核心字段(id, 名
85
85
  content: [{ type: "text", text: JSON.stringify(products, null, 2) }]
86
86
  };
87
87
  });
88
- server.tool("getMyBugs", "获取我的Bug列表 - 默认只查询指派给我的Bug,支持多种状态筛选和分支筛选", {
89
- status: z.enum([
90
- 'active', // 激活状态
91
- 'resolved', // 已解决
92
- 'closed', // 已关闭
93
- 'all', // 所有状态
94
- 'assigntome', // 指派给我的
95
- 'openedbyme', // 由我创建
96
- 'resolvedbyme', // 由我解决
97
- 'assignedbyme', // 由我指派
98
- 'assigntonull', // 未指派
99
- 'unconfirmed', // 未确认
100
- 'unclosed', // 未关闭
101
- 'unresolved', // 未解决(激活状态)
102
- 'toclosed', // 待关闭(已解决)
103
- 'postponedbugs', // 延期的Bug
104
- 'longlifebugs', // 长期未处理的Bug
105
- 'overduebugs', // 已过期的Bug
106
- 'review', // 待我审核
107
- 'feedback', // 用户反馈
108
- 'needconfirm', // 需求变更需确认
109
- 'bysearch' // 自定义搜索
110
- ]).optional().describe("Bug状态筛选,默认'assigntome'(指派给我的)"),
88
+ server.tool("getMyBugs", "获取我的Bug列表 - 固定查询指派给我的Bug(status='assigntome')", {
111
89
  productId: z.number().optional().describe("产品ID,默认使用第二个产品"),
112
90
  page: z.number().optional().describe("页码,从1开始,默认为1"),
113
91
  limit: z.number().optional().describe("每页数量,默认20,最大100"),
114
92
  branch: z.string().optional().describe("分支筛选:'all'(所有分支,默认)、'0'(主干分支)、分支ID"),
115
93
  order: z.string().optional().describe("排序方式,如 id_desc(ID降序), pri_desc(优先级降序), openedDate_desc(创建时间降序)等,默认id_desc"),
116
94
  fields: z.enum(['basic', 'default', 'full']).optional().describe("返回字段级别:'basic'(基本字段,默认)、'default'(默认字段)、'full'(完整字段),默认'basic'")
117
- }, async ({ status, productId, page, limit, branch, order, fields }) => {
95
+ }, async ({ productId, page, limit, branch, order, fields }) => {
118
96
  if (!zentaoApi)
119
97
  throw new Error("Please initialize Zentao API first");
120
- const result = await zentaoApi.getMyBugs(status, productId, page, limit, branch, order, fields);
98
+ const result = await zentaoApi.getMyBugs(productId, page, limit, branch, order, fields);
121
99
  // 返回分页信息和数据
122
100
  const summary = {
123
101
  summary: `当前第 ${result.page} 页,共 ${result.total} 个Bug,本页显示 ${result.bugs.length} 个`,
package/dist/index-qa.js CHANGED
@@ -75,39 +75,17 @@ server.tool("getTaskDetail", {
75
75
  content: [{ type: "text", text: JSON.stringify(task, null, 2) }]
76
76
  };
77
77
  });
78
- server.tool("getMyBugs", "获取我的Bug列表 - 默认只查询指派给我的Bug,支持多种状态筛选和分支筛选", {
79
- status: z.enum([
80
- 'active', // 激活状态
81
- 'resolved', // 已解决
82
- 'closed', // 已关闭
83
- 'all', // 所有状态
84
- 'assigntome', // 指派给我的
85
- 'openedbyme', // 由我创建
86
- 'resolvedbyme', // 由我解决
87
- 'assignedbyme', // 由我指派
88
- 'assigntonull', // 未指派
89
- 'unconfirmed', // 未确认
90
- 'unclosed', // 未关闭
91
- 'unresolved', // 未解决(激活状态)
92
- 'toclosed', // 待关闭(已解决)
93
- 'postponedbugs', // 延期的Bug
94
- 'longlifebugs', // 长期未处理的Bug
95
- 'overduebugs', // 已过期的Bug
96
- 'review', // 待我审核
97
- 'feedback', // 用户反馈
98
- 'needconfirm', // 需求变更需确认
99
- 'bysearch' // 自定义搜索
100
- ]).optional().describe("Bug状态筛选,默认'assigntome'(指派给我的)"),
78
+ server.tool("getMyBugs", "获取我的Bug列表 - 固定查询指派给我的Bug(status='assigntome')", {
101
79
  productId: z.number().optional().describe("产品ID,默认使用第二个产品"),
102
80
  page: z.number().optional().describe("页码,从1开始,默认为1"),
103
81
  limit: z.number().optional().describe("每页数量,默认20,最大100"),
104
82
  branch: z.string().optional().describe("分支筛选:'all'(所有分支,默认)、'0'(主干分支)、分支ID"),
105
83
  order: z.string().optional().describe("排序方式,如 id_desc(ID降序), pri_desc(优先级降序), openedDate_desc(创建时间降序)等,默认id_desc"),
106
84
  fields: z.enum(['basic', 'default', 'full']).optional().describe("返回字段级别:'basic'(基本字段,默认)、'default'(默认字段)、'full'(完整字段),默认'basic'")
107
- }, async ({ status, productId, page, limit, branch, order, fields }) => {
85
+ }, async ({ productId, page, limit, branch, order, fields }) => {
108
86
  if (!zentaoApi)
109
87
  throw new Error("Please initialize Zentao API first");
110
- const result = await zentaoApi.getMyBugs(status, productId, page, limit, branch, order, fields);
88
+ const result = await zentaoApi.getMyBugs(productId, page, limit, branch, order, fields);
111
89
  // 返回分页信息和数据
112
90
  const summary = {
113
91
  summary: `当前第 ${result.page} 页,共 ${result.total} 个Bug,本页显示 ${result.bugs.length} 个`,
package/dist/index.js CHANGED
@@ -89,39 +89,17 @@ server.tool("getProducts", "获取产品列表 - 只返回核心字段(id, 名
89
89
  };
90
90
  });
91
91
  // Add getMyBugs tool
92
- server.tool("getMyBugs", "获取我的Bug列表 - 默认只查询指派给我的Bug,支持多种状态筛选和分支筛选", {
93
- status: z.enum([
94
- 'active', // 激活状态
95
- 'resolved', // 已解决
96
- 'closed', // 已关闭
97
- 'all', // 所有状态
98
- 'assigntome', // 指派给我的
99
- 'openedbyme', // 由我创建
100
- 'resolvedbyme', // 由我解决
101
- 'assignedbyme', // 由我指派
102
- 'assigntonull', // 未指派
103
- 'unconfirmed', // 未确认
104
- 'unclosed', // 未关闭
105
- 'unresolved', // 未解决(激活状态)
106
- 'toclosed', // 待关闭(已解决)
107
- 'postponedbugs', // 延期的Bug
108
- 'longlifebugs', // 长期未处理的Bug
109
- 'overduebugs', // 已过期的Bug
110
- 'review', // 待我审核
111
- 'feedback', // 用户反馈
112
- 'needconfirm', // 需求变更需确认
113
- 'bysearch' // 自定义搜索
114
- ]).optional().describe("Bug状态筛选,默认'assigntome'(指派给我的)"),
92
+ server.tool("getMyBugs", "获取我的Bug列表 - 固定查询指派给我的Bug(status='assigntome')", {
115
93
  productId: z.number().optional().describe("产品ID,默认使用第二个产品"),
116
94
  page: z.number().optional().describe("页码,从1开始,默认为1"),
117
95
  limit: z.number().optional().describe("每页数量,默认20,最大100"),
118
96
  branch: z.string().optional().describe("分支筛选:'all'(所有分支,默认)、'0'(主干分支)、分支ID"),
119
97
  order: z.string().optional().describe("排序方式,如 id_desc(ID降序), pri_desc(优先级降序), openedDate_desc(创建时间降序)等,默认id_desc"),
120
98
  fields: z.enum(['basic', 'default', 'full']).optional().describe("返回字段级别:'basic'(基本字段,默认)、'default'(默认字段)、'full'(完整字段),默认'basic'")
121
- }, async ({ status, productId, page, limit, branch, order, fields }) => {
99
+ }, async ({ productId, page, limit, branch, order, fields }) => {
122
100
  if (!zentaoApi)
123
101
  throw new Error("Please initialize Zentao API first");
124
- const result = await zentaoApi.getMyBugs(status, productId, page, limit, branch, order, fields);
102
+ const result = await zentaoApi.getMyBugs(productId, page, limit, branch, order, fields);
125
103
  // 返回分页信息和数据
126
104
  const summary = {
127
105
  summary: `当前第 ${result.page} 页,共 ${result.total} 个Bug,本页显示 ${result.bugs.length} 个`,
@@ -1,6 +1,6 @@
1
- import { BugStatus, TaskStatus, ZentaoConfig } from './types/zentao';
1
+ import { TaskStatus, ZentaoConfig } from './types/zentao';
2
2
  export declare function mcp_zentao_connect(config: ZentaoConfig): Promise<string>;
3
3
  export declare function mcp_zentao_tasks(status?: TaskStatus): Promise<string>;
4
4
  export declare function mcp_zentao_task(taskId: number): Promise<string>;
5
- export declare function mcp_zentao_bugs(status?: BugStatus): Promise<string>;
5
+ export declare function mcp_zentao_bugs(): Promise<string>;
6
6
  export declare function mcp_zentao_bug(bugId: number): Promise<string>;
@@ -44,11 +44,11 @@ export async function mcp_zentao_task(taskId) {
44
44
  return `获取任务详情失败: ${error instanceof Error ? error.message : '未知错误'}`;
45
45
  }
46
46
  }
47
- export async function mcp_zentao_bugs(status) {
47
+ export async function mcp_zentao_bugs() {
48
48
  try {
49
49
  if (!bugService)
50
50
  throw new Error('请先连接禅道');
51
- const bugs = await bugService.getMyBugs(status);
51
+ const bugs = await bugService.getMyBugs();
52
52
  if (bugs.length === 0)
53
53
  return '没有找到任何Bug';
54
54
  return formatBugsTable(bugs);
@@ -1,9 +1,9 @@
1
1
  import { ZentaoAPI } from '../api/zentaoApi';
2
- import { Bug, BugStatus } from '../types/zentao';
2
+ import { Bug } from '../types/zentao';
3
3
  export declare class BugService {
4
4
  private api;
5
5
  constructor(api: ZentaoAPI);
6
- getMyBugs(status?: BugStatus): Promise<Bug[]>;
6
+ getMyBugs(): Promise<Bug[]>;
7
7
  getBugDetail(bugId: number): Promise<Bug>;
8
8
  private enrichBugData;
9
9
  }
@@ -4,8 +4,8 @@ export class BugService {
4
4
  constructor(api) {
5
5
  this.api = api;
6
6
  }
7
- async getMyBugs(status) {
8
- const result = await this.api.getMyBugs(status);
7
+ async getMyBugs() {
8
+ const result = await this.api.getMyBugs();
9
9
  return result.bugs.map((bug) => this.enrichBugData(bug));
10
10
  }
11
11
  async getBugDetail(bugId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zzp123/mcp-zentao",
3
- "version": "1.17.9",
3
+ "version": "1.18.0",
4
4
  "description": "禅道项目管理系统的高级API集成包 - 完整版,包含所有94个工具。另有产品经理、测试工程师、开发工程师专用精简版本可选",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",